[25888] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 8116 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 25 18:05:28 2005

Date: Wed, 25 May 2005 15:05:06 -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           Wed, 25 May 2005     Volume: 10 Number: 8116

Today's topics:
        [OT] Re: sql and perl <1usa@llenroc.ude.invalid>
    Re: fibonacci string (Anno Siegel)
    Re: FormMail Problem <noreply@gunnar.cc>
    Re: FormMail Problem <noreply@gunnar.cc>
    Re: Ignorant question regarding includes <mddibern@NOSPAM.student.cs.uwaterloo.ca>
        Mail::IMAPClient via SSL <ggershSNACK@CAKEctc.net>
    Re: sql and perl <alexj@freesurf.ch>
    Re: sql and perl xhoster@gmail.com
    Re: sql and perl <daveandniki@ntlworld.com>
    Re: sql and perl <mddibern@NOSPAM.student.cs.uwaterloo.ca>
    Re: sql and perl <daveandniki@ntlworld.com>
    Re: sql and perl <john@castleamber.com>
    Re: sql and perl <john@castleamber.com>
    Re: sql and perl <alexj@freesurf.ch>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 25 May 2005 19:03:56 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: [OT] Re: sql and perl
Message-Id: <Xns9661990CF60Aasu1cornelledu@127.0.0.1>

John Bokma <john@castleamber.com> wrote in 
news:Xns96618C896E79Dcastleamber@130.133.1.4:

> A. Sinan Unur wrote:
> 
>> "Thanks in advance" is one of the rudest, bossiest statements of all 
>> time.
> 
> It is?
> 
>> As such, it is no wonder that it gets used frequently by people 
>> who do not appreciate the value of others' time.
> 
> I started an email yesterday with:
> 
> "I hope you don't mind me bothering you again"
> 
> and at the bottom:
> 
> "Many thanks in advance,"
> 
> So that was extremely rude I guess?
> 
> Can you give a better way of writing this?

It is presumptious. Thanking in advance *presumes* that the other party 
is willing and able to do what you want. It *presumes* that what you 
want will be done because you have stated that you want it.

The favor that is being asked is thus no longer a favor because it being 
taken for granted by the asking party.

Only a boss or a commander can state a request, and expect that it will 
be done.

I prefer to close with "I appreciate your taking the time to ..."

Now, this is all a personal preference obviously.

You will notice that I do not respond this way *every time* someone says 
"thanks in advance". The OP has already demonstrated that whenever a 
question comes to his mind, he will post here *before* doing any 
research himself. The obviously off-topic SQL question was just the last 
drop.

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)

comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html


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

Date: 25 May 2005 18:27:36 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: fibonacci string
Message-Id: <d72g2o$kta$1@mamenchi.zrz.TU-Berlin.DE>

David K. Wall <darkon.tdo@gmail.com> wrote in comp.lang.perl.misc:
> Josef Moellers <josef.moellers@fujitsu-siemens.com> wrote:
> 
> > Anno Siegel wrote:
> > 
> >> The observation that it doesn't matter where the zeroes and ones
> >> appear in the strings leads to a solution that doesn't use s///:
> >> 
> >>     my $v = '1';
> >>     for ( 1 .. 20 ) {
> >>         my $n0 = $v =~ tr/0/1/;
> >>         printf "%10d %10d\n",  $n0, length( $v) - $n0;
> >>         $v .= '0' x ( length( $v) - $n0);
> >>     }
> >> 
> >> I generates a different sequence of strings $v (less fancy
> >> patterns), but with the same distribution of ones and zeroes.  If
> >> you prefer to call it "cheating" I won't object.
> > 
> > No, I'd call this professionalism.
> > I wish I'd be as thorough as you.
> > 
> > I bow my head,
> 
> Agreed.  I just wanted to generate it so I could look at the pattern 
> for longer strings than the book contained.
> 
> The original string does have some interesting properties that do 
> depend on the order of the ones and zeroes.  Some of them are 
> described at this URL:
> http://www.mcs.surrey.ac.uk/Personal/R.Knott/Fibonacci/fibrab.html
> The book I was reading mentions a few others.
> 
> Sorry, this is getting a bit removed from Perl.

Yes, but in an interesting way.  I'll stick with it for one more remark.

The sequence of $v, as defined by the substitution rule, can also
be generated by concatenating strings that have already be generated.
The rule is exactly that for generation of fibonacci numbers, with
addition replaced by concatenation.  In particular (code untested,
but the algorithm is):

    my ( $prev, $v) = qw( 0 1);
    for ( 1 .. 20 ) {
        printf "%10d %10d\n", $v =~ y/0//, $v =~ y/1//;
        ( $prev, $v) = ( $v, $v . $prev);
    }

I bet that's one of the interesting properties mentioned on the web site.
(or the book).  I haven't proved any of this, just observed it, but an
inductive proof seems entirely feasible.  It should create the original
sequence at the speed of the "cheating" solutions shown above.

Anno


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

Date: Wed, 25 May 2005 23:06:00 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: FormMail Problem
Message-Id: <3fk7ioF89ad6U1@individual.net>

Eric Schwartz wrote:
> Gunnar Hjalmarsson writes:
>> The discussion has been about whether it's accurate to describe
>> version 1.92 of Matt's FormMail script as "horribly, horrendously
>> insecure and thoroughly broken" without providing any evidence.
> 
> the CGI-parsing code in there
> query string delimited by ; not & for GET,

It's a *form*-to-mail script, so ';' as delimiter is not applicable.

=> Not broken.

> and read not reading all data in the buffer at once for POST

Well, it normally does its work as intended...

> Also, the regex for valid emails will flag as failed a number
> of valid addresses.

True.

> As for security holes, there's the obvious one that HTTP_REFERER is
> easily spoofable.

<quote from the FormMail docs>
This is not a security check. Referer headers can EASILY be faked.
</quote from the FormMail docs>

=> Not a security hole.

> So yeah, on further study I'd agree that 'broken' and 'insecure' are
> empirically valid adjectives.  You may disagree with the adverbs, if
> you like;

I do. It was them that caused me to object.

> those are clearly value judgements.

So are the adjectives, to some extent. For a serious and accurate 
discussion on programming code, you'd better be careful about which 
"value judgements" you use. ;-)

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Wed, 25 May 2005 23:06:16 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: FormMail Problem
Message-Id: <3fk7j8F89ad6U2@individual.net>

Christopher Nehren wrote:
> On 2005-05-23, Gunnar Hjalmarsson scribbled these
> curious markings:
>> Even if I'm not sure, I have a feeling that you are referring to 
>> previous versions. If also v. 1.92 deserves that verdict, it would be 
>> nice if you (or somebody else) could explain *how* it's broken.
> 
> First, no taint checking. Sure, this in itself doesn't make the code
> insecure,

Probably not in this particular script. And certainly not "horribly, 
horrendously insecure".

> The lack of 'use CGI;', while similarly not instantly insecure,

True.

> I wouldn't rely on something like /usr/lib/sendmail (and realistically
> couldn't, if taint checking were enabled),

Are you saying that you can't open a pipe to a program when tainted mode 
is enabled? That is simply not correct.

> In &parse_form, the /e operator to s/// is applied on completely
> unprocessed CGI variables -- not once, but twice.

Are you talking about

$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;

etc.? Note that the /e modifier is applied on the right side of the s/// 
operator, not the $value variable.

> I don't even want to think about what that can cause.

I do recommend that you think about it.


So, is that all there is? I'm stunned.

You'd better be more careful of how you express yourself, man. ;-)

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Wed, 25 May 2005 14:11:54 -0400
From: Debo <mddibern@NOSPAM.student.cs.uwaterloo.ca>
Subject: Re: Ignorant question regarding includes
Message-Id: <Pine.GSO.4.58.0505251410490.26743@rees.math.uwaterloo.ca>


GB> I'd say what you're doing is reasonable.  It sounds like you're making
GB> sound application of the "Keep It Simple, Stupid" rule. :-)

Excellent. I'm going to continue stupiding my way through this
application, then :)

Thanks again for your help.

-Debo


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

Date: Wed, 25 May 2005 17:33:07 -0400
From: Greg G <ggershSNACK@CAKEctc.net>
Subject: Mail::IMAPClient via SSL
Message-Id: <-uqdnWGW9-5dcwnfRVn-qw@ctc.net>


I'm trying to get Mail::IMAPClient to work via SSL.  I'm running into a 
problem.  Here's the output:

# ./imap_test.pl
SSL OK? 1
SSL says: * OK mailtest Sendmail Server IMAP4rev1 
(2.1.5/smserver-2-1-5-build-1174)

Using Mail::IMAPClient version 2.2.9 and perl version 5.8.6 (5.008006)
  '0' '' |1|
Set State : 1
Sending literal string in two parts: 1 Login "ggtest103z@mydomain.net" {6}

	then: abcdef

Sending: 1 Login "XXXXXX" {6}

Sent 38 bytes
Can't call method "can_read" on an undefined value at 
/usr/local/lib/perl5/site_perl/5.8.6/Mail/IMAPClient.pm line 1583.
#
#
	then: abcdef

Sending: 1 Login "XXXXXX" {6}

Sent 38 bytes
Can't call method "can_read" on an undefined value at 
/usr/local/lib/perl5/site_perl/5.8.6/Mail/IMAPClient.pm line 1583.
#
---------------------------
Here's the code:

-------------------------
#!/usr/local/bin/perl -w

use IO::Socket::SSL;
use Mail::IMAPClient;


my $ssl = IO::Socket::SSL->new (Proto=>'tcp',
				#SSL_verify_mod=>0x00,
				PeerAddr=>"mailtest.mydomain.net",
				PeerPort=>993);

print "SSL OK? " . (defined $ssl) . "\n";

print "SSL says: " . <$ssl> . "\n";

$imap = Mail::IMAPClient->new(Server => "mailtest.mydomain.net",
			      Socket => $ssl,
			      Timeout=>5,
			      User => "ggtest103z\@mydomain.net",
			      Password => "abcdef",
			      Debug => 1,
			      );


print STDERR " \'$@\' \'$!\' |" . (defined $imap) . "|\n";

$imap->State ($imap->Connected);
print "Set State : " . $imap->State . "\n";
$imap->login();
print "Logged in $!\n";

exit 0;

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

Any idea what's happening here?  I've tested the mail server and it 
works fine via SSL.

Thanks.

-Greg G


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

Date: Wed, 25 May 2005 20:07:30 +0200
From: Alexandre Jaquet <alexj@freesurf.ch>
Subject: Re: sql and perl
Message-Id: <4294bee4$0$1145$5402220f@news.sunrise.ch>

A. Sinan Unur a écrit :
> Alexandre Jaquet <alexj@freesurf.ch> wrote in
> news:4294ba7f$0$1163$5402220f@news.sunrise.ch: 
> 
> 
>>I'm having trouble with a sql query on mysql with perl,
> 
> 
> You posted no Perl code.
> 
> 
>>I would like to show on a web page all items who have a different name
>>(nom in french) but mysql doesn't work correctly (as I know postgresql
>>and other database)
> 
> 
> How is that a Perl issue?
>  
> 
>>SELECT DISTINCT nom, id_vinyl,auteur,label,prix, pochette, date_stock 
>>FROM view_nouveaute WHERE id_vinyl = id_vinyl
> 
> 
> That is not Perl.
> 
> 
>>return me
> 
> 
> This could be Perl.
> 
>  
> 
>>nom1      1      auteur1      label1      12      pochette/0.jpg     
>>0000-00-00 nom1      2      auteur1      label1      12     
>>pochette/1.jpg      0000-00-00 nom1      15      auteur1      label1  
> 
> 
> This is definitely not Perl.
> 
> 
>>Any idea to solve it ?
> 
> 
> No.
> 
> 
>>Thanks in advance.
> 
> 
> "Thanks in advance" is one of the rudest, bossiest statements of all 
> time. As such, it is no wonder that it gets used frequently by people 
> who do not appreciate the value of others' time.
> 
> Sinan
> 

Here not, it's a form of courtesy. If you don't know how to solve it no 
trouble.

"who do not appreciate the value of others' time." Don't speak about 
yourself...

Your post he's just stupid.

Alexandre Jaquet


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

Date: 25 May 2005 18:14:56 GMT
From: xhoster@gmail.com
Subject: Re: sql and perl
Message-Id: <20050525141456.721$ws@newsreader.com>

Alexandre Jaquet <alexj@freesurf.ch> wrote:
> I'm having trouble with a sql query on mysql with perl,
>
> I would like to show on a web page all items who have a different name
> (nom in french)

A name different from what?

> but mysql doesn't work correctly (as I know postgresql
> and other database)

I find this hard to believe.

> SELECT DISTINCT nom, id_vinyl,auteur,label,prix, pochette, date_stock
> FROM view_nouveaute WHERE id_vinyl = id_vinyl

The "distinct" applies to all columns in the result set, not just to the
nom column.  That isn't just a mysql thing.  And it definitely isn't a Perl
thing.

Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


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

Date: Wed, 25 May 2005 18:25:01 GMT
From: "Dave" <daveandniki@ntlworld.com>
Subject: Re: sql and perl
Message-Id: <1q3le.1079$c4.1060@newsfe3-win.ntli.net>


"Alexandre Jaquet" <alexj@freesurf.ch> wrote in message 
news:4294ba7f$0$1163$5402220f@news.sunrise.ch...
> I'm having trouble with a sql query on mysql with perl,
>
> I would like to show on a web page all items who have a different name 
> (nom in french) but mysql doesn't work correctly (as I know postgresql and 
> other database)
>
> SELECT DISTINCT nom, id_vinyl,auteur,label,prix, pochette, date_stock FROM 
> view_nouveaute WHERE id_vinyl = id_vinyl
>
> return me
>
> nom1 1 auteur1 label1 12 pochette/0.jpg 0000-00-00
> nom1 2 auteur1 label1 12 pochette/1.jpg 0000-00-00
> nom1 15 auteur1 label1 12 pochette/14.jpg 0000-00-00
> nom1 16 auteur1 label1 12 pochette/15.jpg 0000-00-00
> nom1 17 auteur1 label1 12 pochette/16.jpg 0000-00-00
> nom1 18 auteur1 label1 12 pochette/17.jpg 0000-00-00
> nom1 19 auteur1 label1 12 pochette/18.jpg 0000-00-00
> nom1 20 auteur1 label1 12 pochette/19.jpg 0000-00-00
> nom2 21 auteur2 label2 12 pochette/20.jpg 0000-00-00
> nom2 22 auteur2 label2 12 pochette/21.jpg 0000-00-00
> nom2 23 auteur2 label2 12 pochette/22.jpg 0000-00-00
> nom2 24 auteur2 label2 12 pochette/23.jpg nom2 29 auteur2 label2 12 
> pochette/28.jpg 0000-00-00
> nom2 30 auteur2 label2 12 pochette/29.jpg 0000-00-00
>
> It doesn't take result who got ONLY different name.
>
> Any idea to solve it ?
>
> Thanks in advance.
>
> Alexandre Jaquet

Est-ce que vous êtes au courant de 'fr.comp.lang.perl'? Je crois que peut 
être vous pouvez mieux exprimé le problème en français  - et le groupe me 
semble plus poli qu`ici aussi.

David




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

Date: Wed, 25 May 2005 14:28:45 -0400
From: Debo <mddibern@NOSPAM.student.cs.uwaterloo.ca>
Subject: Re: sql and perl
Message-Id: <Pine.GSO.4.58.0505251427500.26743@rees.math.uwaterloo.ca>

D> et le groupe me semble plus poli qu`ici aussi.

LOL! Gotta love the foreign-language jabs...

I needed that.

-Debo


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

Date: Wed, 25 May 2005 18:46:00 GMT
From: "Dave" <daveandniki@ntlworld.com>
Subject: Re: sql and perl
Message-Id: <IJ3le.1084$c4.601@newsfe3-win.ntli.net>


"Debo" <mddibern@NOSPAM.student.cs.uwaterloo.ca> wrote in message 
news:Pine.GSO.4.58.0505251427500.26743@rees.math.uwaterloo.ca...
>D> et le groupe me semble plus poli qu`ici aussi.
>
> LOL! Gotta love the foreign-language jabs...
>
> I needed that.
>
> -Debo

Just an observation. I don`t know if its a cultural thing or an average age 
thing...

Dave





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

Date: 25 May 2005 18:48:57 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: sql and perl
Message-Id: <Xns96618C896E79Dcastleamber@130.133.1.4>

A. Sinan Unur wrote:

> "Thanks in advance" is one of the rudest, bossiest statements of all 
> time.

It is?

> As such, it is no wonder that it gets used frequently by people 
> who do not appreciate the value of others' time.

I started an email yesterday with:

"I hope you don't mind me bothering you again"

and at the bottom:

"Many thanks in advance,"

So that was extremely rude I guess?

Can you give a better way of writing this?

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: 25 May 2005 18:51:13 GMT
From: John Bokma <john@castleamber.com>
Subject: Re: sql and perl
Message-Id: <Xns96618CEC2E3BEcastleamber@130.133.1.4>

Dave wrote:

> et le groupe me semble plus poli qu`ici aussi

Yeah, sure. So newbies helping newbies?

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


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

Date: Wed, 25 May 2005 23:03:42 +0200
From: Alexandre Jaquet <alexj@freesurf.ch>
Subject: Re: sql and perl
Message-Id: <4294e830$0$1159$5402220f@news.sunrise.ch>

Dave a écrit :
> "Alexandre Jaquet" <alexj@freesurf.ch> wrote in message 
> news:4294ba7f$0$1163$5402220f@news.sunrise.ch...
> 
>>I'm having trouble with a sql query on mysql with perl,
>>
>>I would like to show on a web page all items who have a different name 
>>(nom in french) but mysql doesn't work correctly (as I know postgresql and 
>>other database)
>>
>>SELECT DISTINCT nom, id_vinyl,auteur,label,prix, pochette, date_stock FROM 
>>view_nouveaute WHERE id_vinyl = id_vinyl
>>
>>return me
>>
>>nom1 1 auteur1 label1 12 pochette/0.jpg 0000-00-00
>>nom1 2 auteur1 label1 12 pochette/1.jpg 0000-00-00
>>nom1 15 auteur1 label1 12 pochette/14.jpg 0000-00-00
>>nom1 16 auteur1 label1 12 pochette/15.jpg 0000-00-00
>>nom1 17 auteur1 label1 12 pochette/16.jpg 0000-00-00
>>nom1 18 auteur1 label1 12 pochette/17.jpg 0000-00-00
>>nom1 19 auteur1 label1 12 pochette/18.jpg 0000-00-00
>>nom1 20 auteur1 label1 12 pochette/19.jpg 0000-00-00
>>nom2 21 auteur2 label2 12 pochette/20.jpg 0000-00-00
>>nom2 22 auteur2 label2 12 pochette/21.jpg 0000-00-00
>>nom2 23 auteur2 label2 12 pochette/22.jpg 0000-00-00
>>nom2 24 auteur2 label2 12 pochette/23.jpg nom2 29 auteur2 label2 12 
>>pochette/28.jpg 0000-00-00
>>nom2 30 auteur2 label2 12 pochette/29.jpg 0000-00-00
>>
>>It doesn't take result who got ONLY different name.
>>
>>Any idea to solve it ?
>>
>>Thanks in advance.
>>
>>Alexandre Jaquet
> 
> 
> Est-ce que vous êtes au courant de 'fr.comp.lang.perl'? Je crois que peut 
> être vous pouvez mieux exprimé le problème en français  - et le groupe me 
> semble plus poli qu`ici aussi.
> 
> David
> 
> 

everything are good right now =)

mais merci du conseil David =)


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

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 8116
***************************************


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