Leser: 1
|< 1 2 >| | 13 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
for my $i (1..$numberOfBestFrags)
{
our $index = 0;
our $maxGoodness = 0;
while(($key, $value) = each %fragmentResultSetH)
{
if($value{goodness} > $maxGoodness)
{
$maxGoodness = $value{goodness};
$index = $key;
}  
;
}
push @tenBestFrags, $fragmentResultSetH{"$index"};
delete $fragmentResultSetH{"$index"};
}
Use of uninitialized value in numeric gt (>) at /root/development/eclipse/eclipse/workspace/PDB_FRAGMENT_LIB/bin/PDBQuery.pl line 436, <FILE> line 13484.
1
2
3
4
5
6
7
8
9
10
11
for my $i (1..$numberOfBestFrags)
{
print "for loop nr. $i \n";
my $nrOfKeys = scalar keys %fragmentResultSetH;
print "nr of keys = $nrOfKeys \n";
my $nrOfvalues = scalar values %fragmentResultSetH;
print "nr of values = $nrOfvalues \n";
....rest vom code wie oben........
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
for loop nr. 1
nr of keys = 35
nr of values = 35
for loop nr. 2
nr of keys = 34
nr of values = 34
for loop nr. 3
nr of keys = 34
nr of values = 34
for loop nr. 4
nr of keys = 34
nr of values = 34
usw....
QuoteDer each-operator kann zurückgesetzt werden, indem alle Elemente im Hash gelesen werden oder indem man keys %hash oder values %hash evaluiert.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
for my $i (1..$numberOfBestFrags)
{
print "for loop nr. $i \n";
my $nrOfKeys = scalar keys %fragmentResultSetH;
print "nr of keys = $nrOfKeys \n";
my $nrOfvalues = scalar values %fragmentResultSetH;
print "nr of values = $nrOfvalues \n";
my $index = 0;
my $maxGoodness = 0;
while(($key, $value) = each %fragmentResultSetH)
{
if($value{goodness} > $maxGoodness)
{
$maxGoodness = $value{goodness};
$index = $key;
}  
;
}
push @tenBestFrags, $fragmentResultSetH{"$index"};
delete $fragmentResultSetH{"$index"};
}
$value->{goodness}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
for my $i (1..$numberOfBestFrags)
{
my $index = 0;
my $maxGoodness = 0;
for our $firstHashKey (keys %fragmentResultSetH)
{
for our $secondHashKey (keys %{ $fragmentResultSetH{$firstHashKey} } )
{
if($secondHashKey =~ m/goodness/)
{
my $tmp = $fragmentResultSetH{$firstHashKey}{$secondHashKey};
if($tmp > $maxGoodness)
{
$maxGoodness = $tmp;
$index = $firstHashKey;
}
}
}
}
push @tenBestFrags, $fragmentResultSetH{"$index"};
delete $fragmentResultSetH{"$index"};
}
for our $secondHashKey (keys %{ $fragmentResultSetH{$firstHashKey} } )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl
use strict;
use warnings;
my %scores = (
134 => { Goodness => 10 },
4273 => { Goodness => 3 },
36285 => { Goodness => 6 },
9284 => { Goodness => 2 },
);
my $best_of = 2; # Die besten ... {zwei}
my @sorted_scores = map { $_->[1] }
sort { $b->[0] <=> $a->[0] }
map { [$scores{$_}->{Goodness}, $_ ] } keys %scores;
print "$_\n" for @sorted_scores[0 .. $best_of - 1];
|< 1 2 >| | 13 Einträge, 2 Seiten |