RE: Random numbers

2002-10-29 Thread Patrick Connolly
Title: RE: Terrible at my logic









To make it even a little more fun you could also vary the length of the
password:

 

@a = (0..9,A..Z,a..z);  # password
charactors

@b = (6..14);  
   # length of
password

for($I=0;$I<1000;$I++) {

  
for($x=0;$x<$b[rand @b];$x++) {

 
print $a[rand @a];

   }

   print
"\n";

}

-Original
Message-----
From: Patrick Connolly
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 29, 2002
1:00 PM
To: 'Krishna, Hari'; 'FARRINGTON,
RYAN'; '[EMAIL PROTECTED]'
Subject: RE: Random numbers

 

@a = (0..9,A..Z,a..z);

for($I=0;$I<1000;$I++) {

  
for($x=0;$x<8;$x++) {

  $index   = rand @a;

  print $a[$index];

   }

  
print "\n";

}

 

-Original
Message-
From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Krishna, Hari
Sent: Tuesday, October 29, 2002
12:48 PM
To: 'FARRINGTON, RYAN';
[EMAIL PROTECTED]
Subject: Random numbers

 

Hi
friends,

   
I want to generate some 1000 or more passwords
for some NT machine. 

I should
be able to generate an 8 digit alphanumeric random numbers from the list of
characters.

 

Say I
have 3 strings...

First
string : 0 - 9 numbers

Second
string : A - Z characters

Third
string: a - z characters.

 

Now I
should be able to generate strings like:

 

"abCd16Sz"

"U8Yb90vc"

"Nt7gO0PL"

 

something
like that.

 

Is there
a way to generate such kind of random numbers 8 characters long???

 

I saw in
a bok that there is a module in PERL

MATH::TrulyRandom

 

but I am
not sure if it helps. I will keep trying.

 

 

any
inputs appreciated. 

 

Hope I
can get some help.

 

 

Thanks
and Regards,

Hari.








RE: Random numbers

2002-10-29 Thread Patrick Connolly
Title: RE: Terrible at my logic









@a =
(0..9,A..Z,a..z);

for($I=0;$I<1000;$I++)
{

   for($x=0;$x<8;$x++) {

      $index   = rand @a;

      print $a[$index];

   }

   print "\n";

}

 

-Original
Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Krishna, Hari
Sent: Tuesday, October 29, 2002
12:48 PM
To: 'FARRINGTON, RYAN';
[EMAIL PROTECTED]
Subject: Random numbers

 

Hi friends,

   
I want to generate some 1000 or more passwords
for some NT machine. 

I should be able to
generate an 8 digit alphanumeric random numbers from the list of characters.

 

Say I have 3 strings...

First string : 0 - 9
numbers

Second string : A - Z
characters

Third string: a - z
characters.

 

Now I should be able to
generate strings like:

 

"abCd16Sz"

"U8Yb90vc"

"Nt7gO0PL"

 

something like that.

 

Is there a way to
generate such kind of random numbers 8 characters long???

 

I saw in a bok that there
is a module in PERL

MATH::TrulyRandom

 

but I am not sure if it
helps. I will keep trying.

 

 

any inputs appreciated. 

 

Hope I can get some help.

 

 

Thanks and Regards,

Hari.








RE: hash of hashes -- odd behavior

2002-09-30 Thread Patrick Connolly
Title: hash of hashes -- odd behavior









Peter,

 

On the line:

 

   foreach my $bucket (sort {$a <=> $b} keys
%{$mttr_total{$abrv_grp}} )

 

You have the
variable “$abrv_grp” but on the previous foreach you use the variable $group. If
you change $abrv_grp to $group it should work.

 

Pat

 

-Original
Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Peter Eisengrein
Sent: Monday, September 30, 2002
11:06 AM
To: Perl-Win32-Users Mailing List
(E-mail)
Subject: hash of hashes -- odd
behavior

 

I have a hash of
hashes that, at first pass, appears to be missing expected data when I try to
get it via variables. However, if I call it directly (see
$mttr_total{'TAC'}{'2'} in debug line below) I get the data. What gives?

Thx, 
Pete 

 

### SNIP 

foreach my $group
(keys %mttr_total) 
{ 
    next if ($group eq "Total"); 
    foreach my $bucket (sort {$a <=> $b} keys
%{$mttr_total{$abrv_grp}} ) 
    { 
   
    my $total = $mttr_hold_by_grp{$group}{$bucket} +
$mttr_work_by_grp{$group}{$bucket}; 
   
    my $weighted_hold; 
   
    my $weighted_work; 

   
    if ($total > 0) 
   
    { 
   
   
    $weighted_hold = (($mttr_hold_by_grp{$group}{$bucket} / $total) *
$mttr_total{$group}{$bucket});

   
   
    $weighted_work = (($mttr_work_by_grp{$group}{$bucket} / $total) *
$mttr_total{$group}{$bucket});

   
    } 
   
    else 
   
    { 
   
   
    $weighted_hold = $weighted_work = '0'; 
   
    } 

 

   
    printf
"$bucket,($group),%1.1f,%1.1f,%1.1f,%1.1f,%1.1f,$mttr_total{$group}{$bucket}\n",
$mttr_hold_by_grp{$group}{$bucket},$mttr_work_by_grp{$group}{$bucket},$total,$weighted_hold,$weighted_work;

 

   
} 

 

   
printf "\nDEBUG:
2,(TAC),%1.1f,%1.1f,$mttr_total{'TAC'}{'2'}\n",
$mttr_hold_by_grp{'TAC'}{'2'},$mttr_work_by_grp{'TAC'}{'2'};

   
print
"\n"; 

} 





### OUTPUT 
0,(TAC),0.0,0.0,0.0,0.0,0.0, 
1,(TAC),1.7,0.1,1.8,1.0,0.0,1 
3,(TAC),0.0,0.0,0.0,0.0,0.0, 
4,(TAC),0.0,0.0,0.0,0.0,0.0, 
5,(TAC),0.0,5.6,5.6,0.0,1.0,1 
12,(TAC),0.0,21.5,21.5,0.0,1.0,1 
24,(TAC),0.0,0.0,0.0,0.0,0.0, 
36,(TAC),0.0,0.0,0.0,0.0,0.0, 
48,(TAC),69.9,2.3,72.2,1.0,0.0,1 

DEBUG:
2,(TAC),0.0,4.9,2 








RE: search function on web

2002-09-22 Thread Patrick Connolly

There are two books from O'Reilly's that would make a good starting point.

Learning Perl & CGI Programming

Pat


 -Original Message-
From:   [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]  On Behalf Of
[EMAIL PROTECTED]
Sent:   Friday, September 20, 2002 2:16 PM
To: [EMAIL PROTECTED];
[EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject:search function on web

My boss asked me to create a search function on the web to search on the log
files. It should be able to search by date, job name, machine, or
result(succesful or failed), and should also include a full -text search of
the log files.

Does someone has experience working on this kind of stuff using perl and
CGI?

Is there any book mention this kind of technology?

Now, I do not have any idea on to do it.

Thanks a lot in advance!


Lixin

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs