/[Sack]/trunk/views/00.demo.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/views/00.demo.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 147 - (show annotations)
Wed Oct 7 23:21:59 2009 UTC (14 years, 8 months ago) by dpavlin
File MIME type: text/plain
File size: 1284 byte(s)
improved C1_country view
1
2 #$out->{ 'fields +' }->{$_}++ foreach keys %$rec;
3
4 #$out->{ 'years +' }->{ $rec->{PY}->[0] }++;
5
6 #$out->{ 'DT +' }->{ $_ }++ foreach @{ $rec->{DT} };
7
8 #$out->{'SC +'}->{ $_ }++ foreach @{ $rec->{SC} };
9
10 # FIXME out of memory without Sack::Digest
11 #$out->{'C1 +'}->{ $_ }++ foreach @{ $rec->{C1} };
12 #$out->{'C1#+'}->{ $_ }++ foreach @{ $rec->{C1} };
13
14
15 #$out->{'C1_country+'}->{ m{,\s?([^,]+)\.$} && $1 }++ foreach @{ $rec->{C1} };
16
17 foreach ( @{ $rec->{C1} } ) {
18 my $country = $1 if m{,\s?([^,]+)\.$};
19 $country =~ s{^.+USA$}{USA};
20 $country =~ s{^\w\w\s\d{5}$}{USA};
21 $country =~ s{^\w\w$}{USA};
22 # $country =~ s{^([A-Z]+)$}{ucfirst($1)}e;
23 $country =~ s{^YUGOS.+}{Yugoslavia};
24 $out->{'C1_country+'}->{ uc $country }++;
25 }
26
27
28 #$out->{'CR#+'}->{ $_ }++ foreach @{ $rec->{CR} };
29
30 #$out->{'CR+'}->{ $_ }++ foreach @{ $rec->{CR} };
31
32 #$out->{'CR'}->{ $_ }++ foreach @{ $rec->{CR} };
33
34 #my $cr = 1;
35 #my $nr = $out->{_debug}->{nr}++;
36 #$out->{'CR +'}->{ "$nr." . $cr++ }++ foreach @{ $rec->{CR} };
37
38 # XXX dump first record
39 #$out->{_debug_rec} ||= $rec;
40
41 #push @{ $out->{TI} }, $rec->{TI};
42
43 #push @{ $out->{_debug}->{id} }, $rec->{'000'};
44
45 if (0) {
46 $out->{'_debug'}->{records}++ if $rec;
47 $out->{'_debug'}->{start_t} ||= time;
48 $out->{'_debug'}->{duration} = time - $out->{'_debug'}->{start_t};
49 }

  ViewVC Help
Powered by ViewVC 1.1.26