hexsha
stringlengths
40
40
size
int64
3
1.05M
ext
stringclasses
163 values
lang
stringclasses
53 values
max_stars_repo_path
stringlengths
3
945
max_stars_repo_name
stringlengths
4
112
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
945
max_issues_repo_name
stringlengths
4
113
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
float64
1
116k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
945
max_forks_repo_name
stringlengths
4
113
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
3
1.05M
avg_line_length
float64
1
966k
max_line_length
int64
1
977k
alphanum_fraction
float64
0
1
73e16f2e10ab4763fb51b12f41edd69c45347d59
16,636
pm
Perl
modules/Bio/EnsEMBL/Variation/Pipeline/VariantQC/InitVariantQC.pm
fergalmartin/ensembl-variation
858de3ee083fd066bc0b8a78e8a449176dd51bce
[ "Apache-2.0" ]
null
null
null
modules/Bio/EnsEMBL/Variation/Pipeline/VariantQC/InitVariantQC.pm
fergalmartin/ensembl-variation
858de3ee083fd066bc0b8a78e8a449176dd51bce
[ "Apache-2.0" ]
1
2020-04-20T12:11:56.000Z
2020-04-20T12:11:56.000Z
modules/Bio/EnsEMBL/Variation/Pipeline/VariantQC/InitVariantQC.pm
dglemos/ensembl-variation
7cd20531835b45b1842476606b4fd0856e3843e0
[ "Apache-2.0" ]
null
null
null
=head1 LICENSE Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2018] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =cut =head1 CONTACT Please email comments or questions to the public Ensembl developers list at <http://lists.ensembl.org/mailman/listinfo/dev>. Questions may also be sent to the Ensembl help desk at <http://www.ensembl.org/Help/Contact>. =head1 NAME Bio::EnsEMBL::Variation::Pipeline::VariantQC::InitVariantQC =head1 DESCRIPTION Initiation module for variant QC eHive process =cut package Bio::EnsEMBL::Variation::Pipeline::VariantQC::InitVariantQC; use strict; use warnings; use base qw(Bio::EnsEMBL::Variation::Pipeline::BaseVariationProcess); use ImportUtils qw(dumpSQL create_and_load ); my $DEBUG = 0; sub fetch_input { my $self = shift; my $core_dba = $self->get_species_adaptor('core'); my $var_dba = $self->get_species_adaptor('variation'); my $start_at_variation_id = $self->required_param('start_at_variation_id'); ### new variation feature tables to write to unless($self->required_param('create_working_tables') == 0){ create_working_tables( $var_dba); } if($self->required_param('create_map_table') ==1){ ### create temp table to hold number of mapping to reference genome create_map_weight_table($core_dba,$var_dba); } ## look up variation_set_id for failed variants once my $failed_set_id = add_failed_variation_set( $var_dba ); $self->required_param( 'failed_set_id', $failed_set_id ); $self->warning( 'Got failed set id ', $failed_set_id); ### get max variation_id to set up batches for processing my $data_ext_sth = $var_dba->dbc->prepare(qq[ SELECT MAX(variation_id) FROM variation ]); $data_ext_sth->execute() || die "Failed to extract variation_id\n"; my $max_id = $data_ext_sth->fetchall_arrayref(); ### bin detailed qc my @qc_start_id; my $start_from = int( $start_at_variation_id / $self->param('qc_batch_size')); my $qc_var_jobs = int( $max_id->[0]->[0] / $self->param('qc_batch_size') ); $self->warning( 'Defining jobs, '. $start_from .'-' . $qc_var_jobs .' batch size: ' . $self->param('qc_batch_size') ); for my $n ( $start_from .. $qc_var_jobs){ my $start = $n * $self->param('qc_batch_size'); push @qc_start_id, {start_id => $start}; } $self->param('qc_start_ids', \@qc_start_id); ## bin unmapped var check in larger chunks my @unmapped_start_id; my $start_unmapped_from = int( $start_at_variation_id / $self->param('unmapped_batch_size') ); my $unmapped_var_jobs = int( $max_id->[0]->[0] / $self->param('unmapped_batch_size') ); for my $n ( $start_unmapped_from .. $unmapped_var_jobs){ my $start = $n * $self->param('unmapped_batch_size'); push @unmapped_start_id, {start_id => $start}; } $self->param('unmapped_start_ids', \@unmapped_start_id); } =head2 create_working_tables copies of key tables created to hold post processed data =cut sub create_working_tables{ my $var_dba = shift; ## table to hold variation info after fliping & evidence assignment $var_dba->dbc->do(qq{ DROP TABLE IF EXISTS variation_working}); $var_dba->dbc->do(qq{ CREATE TABLE variation_working like variation }); $var_dba->dbc->do(qq{ ALTER TABLE variation_working DROP COLUMN snp_id }); ## tmp column not in released schema $var_dba->dbc->do(qq{ ALTER TABLE variation_working DISABLE KEYS}); ## temp table to hold variants with minor alleles not in the variation_feature allele string $var_dba->dbc->do(qq{ DROP TABLE IF EXISTS tmp_failed_minor_allele}); $var_dba->dbc->do(qq{ CREATE TABLE tmp_failed_minor_allele ( variation_id int(11) unsigned NOT NULL, KEY variation_idx (variation_id) )}); ## table to hold variation feature info after fliping & ref allele assignment $var_dba->dbc->do(qq{ DROP TABLE IF EXISTS variation_feature_working}); $var_dba->dbc->do(qq{ CREATE TABLE variation_feature_working like variation_feature }); $var_dba->dbc->do(qq{ ALTER TABLE variation_feature_working DISABLE KEYS}); ## new mysql version errors with empty not null columns ## switched to null allowable for import then back to non null here $var_dba->dbc->do("alter table variation_feature_working modify column map_weight int not null"); ## table to hold coded allele info after fliping $var_dba->dbc->do(qq{ DROP TABLE IF EXISTS allele_working}); $var_dba->dbc->do(qq{ CREATE TABLE allele_working ( allele_id int(11) NOT NULL AUTO_INCREMENT, variation_id int(11) unsigned NOT NULL, subsnp_id int(11) unsigned DEFAULT NULL, allele_code_id int(11) unsigned NOT NULL, population_id int(11) unsigned DEFAULT NULL, frequency float unsigned DEFAULT NULL, count int(11) unsigned DEFAULT NULL, frequency_submitter_handle int(10) DEFAULT NULL, PRIMARY KEY (allele_id), KEY variation_idx (variation_id), KEY subsnp_idx (subsnp_id), KEY population_idx (population_id)) engine=MyISAM }); $var_dba->dbc->do(qq{ ALTER TABLE allele_working DISABLE KEYS}); ## add intial values to allele code table $var_dba->dbc->do(qq{TRUNCATE allele_code});# empty if re-running to allow genotype_code population for basics $var_dba->dbc->do(qq{INSERT IGNORE INTO `allele_code` (`allele_code_id`,`allele`) VALUES (1, 'T'), (2, 'A'), (3, 'G'), (4, 'C'), (5, '-'), (6, 'N')}); ## table to hold failed variations ## TEMP FOR DEBUG $var_dba->dbc->do(qq{DROP TABLE IF EXISTS failed_variation_working}); $var_dba->dbc->do(qq{CREATE TABLE failed_variation_working like failed_variation}); ## table to hold failed alleles ## TEMP FOR DEBUG $var_dba->dbc->do(qq{DROP TABLE IF EXISTS failed_allele_working}); $var_dba->dbc->do(qq{CREATE TABLE failed_allele_working like failed_allele}); ## table to hold non-coded population_genotype info after flipping $var_dba->dbc->do(qq{ DROP TABLE IF EXISTS MTMP_population_genotype_working }); $var_dba->dbc->do(qq{ CREATE TABLE MTMP_population_genotype_working like population_genotype }); ## new version of population_genotype table with coded genotypes $var_dba->dbc->do(qq{DROP TABLE IF EXISTS population_genotype_working}); $var_dba->dbc->do(qq{CREATE TABLE population_genotype_working ( population_genotype_id int(10) unsigned NOT NULL AUTO_INCREMENT, variation_id int(11) unsigned NOT NULL, subsnp_id int(11) unsigned DEFAULT NULL, genotype_code_id int(11) DEFAULT NULL, frequency float DEFAULT NULL, population_id int(10) unsigned DEFAULT NULL, count int(10) unsigned DEFAULT NULL, PRIMARY KEY (population_genotype_id), KEY population_idx (population_id), KEY variation_idx (variation_id), KEY subsnp_idx (subsnp_id) )engine=MyISAM }); ## temp table for assigning genotype ids $var_dba->dbc->do(qq{ DROP TABLE IF EXISTS genotype_code_tmp}); $var_dba->dbc->do(qq{ CREATE TABLE genotype_code_tmp ( genotype_code_id int(11) unsigned NOT NULL AUTO_INCREMENT, allele_1 varchar(30000) NOT NULL, allele_2 varchar(30000) NOT NULL, phased tinyint(2) unsigned DEFAULT NULL, PRIMARY KEY ( genotype_code_id ), UNIQUE KEY genotype_idx (allele_1 (490),allele_2(490),phased) )}); # add basic genotypes to genotype_code_tmp first - smaller numbers compress better - phased for 1KG $var_dba->dbc->do(qq{ INSERT IGNORE INTO genotype_code_tmp (allele_1, allele_2, phased) SELECT ac1.allele, ac2.allele, 1 FROM allele_code ac1, allele_code ac2 WHERE ac1.allele_code_id < 5 AND ac2.allele_code_id < 5 ORDER BY ac1.allele_code_id, ac1.allele_code_id + ac2.allele_code_id }); # add basic genotypes to genotype_code_tmp first - smaller numbers compress better - phasing unknown $var_dba->dbc->do(qq{ INSERT IGNORE INTO genotype_code_tmp (allele_1, allele_2, phased ) SELECT ac1.allele, ac2.allele, 0 FROM allele_code ac1, allele_code ac2 ORDER BY ac1.allele_code_id, ac1.allele_code_id + ac2.allele_code_id }); $var_dba->dbc->do(qq{ CREATE TABLE IF NOT EXISTS maf( snp_id int(11), allele text, freq float, count int(11), is_minor_allele int(11) ) }); } =head2 add_failed_variation_set enter variation_set_variation entry for failed variant set needed in VariantQC for variation_feature updating =cut sub add_failed_variation_set{ my $var_dba = shift; my $fail_attrib_ext_sth = $var_dba->dbc->prepare(qq[ select at.attrib_id from attrib at, attrib_type att where att.code = 'short_name' and att.attrib_type_id = at.attrib_type_id and at.value = 'fail_all' ]); my $variation_set_ext_sth = $var_dba->dbc->prepare(qq[ select variation_set_id from variation_set where name = ? ]); my $variation_set_ins_sth = $var_dba->dbc->prepare(qq[ insert into variation_set ( name, description, short_name_attrib_id) values (?,?,?) ]); ## check if already present $variation_set_ext_sth->execute('All failed variations') || die "Failed to extract failed variant set id\n"; my $failed_set_id = $variation_set_ext_sth->fetchall_arrayref(); unless(defined $failed_set_id->[0]->[0]){ ## no set entered - look up attrib for short name and enter set $fail_attrib_ext_sth->execute() || die "Failed to extract failed set attrib reasons\n"; my $attrib = $fail_attrib_ext_sth->fetchall_arrayref(); die "Exiting: Error - attribs not found. Load attribs then re-run\n" unless defined $attrib->[0]->[0] ; ## if attribs loaded, enter set $variation_set_ins_sth->execute( 'All failed variations', 'Variations that have failed the Ensembl QC checks' , $attrib->[0]->[0] )|| die "Failed to insert failed set\n"; ## and pull out id to return $variation_set_ext_sth->execute('All failed variations') || die "Failed to extract failed variant set id\n"; $failed_set_id = $variation_set_ext_sth->fetchall_arrayref(); } return $failed_set_id->[0]->[0]; } =head2 create_map_weight_table create a look-up table for the number of times a variant maps to the reference =cut sub create_map_weight_table{ my $core_dba = shift; my $var_dba = shift; #### is it better to use not in () or temp columns?? my $ref_ext_sth = $core_dba->dbc->prepare(qq [ select sr.seq_region_id from seq_region sr, coord_system cs where sr.coord_system_id = cs.coord_system_id and cs.rank = 1 and seq_region_id not in (select seq_region_id from seq_region_attrib where attrib_type_id = 16 ) ]); $ref_ext_sth->execute()|| die "Failed to extract ref/non ref status for seq_regions\n"; my $is_ref = $ref_ext_sth->fetchall_arrayref(); if ($var_dba->dbc->do(qq{show columns from seq_region like 'is_reference';}) != 1) { $var_dba->dbc->do(qq{alter table seq_region add column is_reference Tinyint(1) default 0}); } my $sr_status_sth = $var_dba->dbc->prepare(qq[update seq_region set is_reference = 1 where seq_region_id =?]); foreach my $srid (@{$is_ref}){ $sr_status_sth->execute($srid->[0]) || die "ERROR updating seq regions\n"; } #create a temporary table to store the map_weight, that will be deleted by the last process $var_dba->dbc->do(qq[ DROP TABLE IF EXISTS tmp_map_weight_working]); $var_dba->dbc->do(qq[ CREATE TABLE tmp_map_weight_working SELECT variation_id, count(*) as count FROM variation_feature,seq_region WHERE variation_feature.seq_region_id = seq_region.seq_region_id AND seq_region.is_reference =1 GROUP BY variation_id] ); $var_dba->dbc->do(qq{ALTER TABLE tmp_map_weight_working ADD UNIQUE INDEX variation_idx(variation_id)}); } sub write_output { my $self = shift; ## Initial quick check for obvious failures in dbSNP import unless ($self->param('run_check_dbSNP_import') == 0){ $self->dataflow_output_id($self->param('check_dbSNP_import'), 2); } unless ($self->param('run_create_seqdb') == 0){ $self->dataflow_output_id($self->param('create_seqdb'), 3); } ## No map fails - larger bins used as check is very quick unless ($self->param('run_unmapped_var') == 0){ my $unmapped_start_ids = $self->param('unmapped_start_ids'); $self->warning(scalar @{$unmapped_start_ids} .' unmapped_variant_qc jobs to do'); $self->dataflow_output_id($unmapped_start_ids, 5); } ## Variant QC - bin start positions supplied unless ($self->param('run_variant_qc') == 0){ my $qc_start_ids = $self->param('qc_start_ids'); $self->warning(scalar @{$qc_start_ids} .' variant_qc jobs to do'); $self->dataflow_output_id($qc_start_ids, 4); } ## Complement alleles in population_genotype for variants which are being flipped unless ($self->param('run_flip_population_genotype') == 0){ $self->dataflow_output_id( $self->param('flip_population_genotype'), 6); } ## Migrate raw genotype data to new coded schema unless ($self->param('run_update_population_genotype') == 0){ $self->dataflow_output_id( $self->param('update_population_genotype'), 7); } ## bulk updates to statuses for special cases $self->dataflow_output_id($self->param('special_cases'), 8); ## run basic checks when everything is updated $self->dataflow_output_id($self->param('finish_variation_qc'), 9); return; } 1;
40.280872
148
0.598702
73d929bff8da8d31f2f9d29a704c0d7b4b61d8f9
2,596
pm
Perl
lib/IO/Compress/Adapter/Bzip2.pm
ajhodges/zap2xml-lambda
5af6b65ca0cb3205aba321a1b586bc2ddf135860
[ "MIT" ]
null
null
null
lib/IO/Compress/Adapter/Bzip2.pm
ajhodges/zap2xml-lambda
5af6b65ca0cb3205aba321a1b586bc2ddf135860
[ "MIT" ]
null
null
null
lib/IO/Compress/Adapter/Bzip2.pm
ajhodges/zap2xml-lambda
5af6b65ca0cb3205aba321a1b586bc2ddf135860
[ "MIT" ]
null
null
null
package IO::Compress::Adapter::Bzip2 ; use strict; use warnings; use bytes; use IO::Compress::Base::Common 2.061 qw(:Status); use Compress::Raw::Bzip2 2.061 ; our ($VERSION); $VERSION = '2.061'; sub mkCompObject { my $BlockSize100K = shift ; my $WorkFactor = shift ; my $Verbosity = shift ; $BlockSize100K = 1 if ! defined $BlockSize100K ; $WorkFactor = 0 if ! defined $WorkFactor ; $Verbosity = 0 if ! defined $Verbosity ; my ($def, $status) = new Compress::Raw::Bzip2(1, $BlockSize100K, $WorkFactor, $Verbosity); return (undef, "Could not create Deflate object: $status", $status) if $status != BZ_OK ; return bless {'Def' => $def, 'Error' => '', 'ErrorNo' => 0, } ; } sub compr { my $self = shift ; my $def = $self->{Def}; my $status = $def->bzdeflate($_[0], $_[1]) ; $self->{ErrorNo} = $status; if ($status != BZ_RUN_OK) { $self->{Error} = "Deflate Error: $status"; return STATUS_ERROR; } return STATUS_OK; } sub flush { my $self = shift ; my $def = $self->{Def}; my $status = $def->bzflush($_[0]); $self->{ErrorNo} = $status; if ($status != BZ_RUN_OK) { $self->{Error} = "Deflate Error: $status"; return STATUS_ERROR; } return STATUS_OK; } sub close { my $self = shift ; my $def = $self->{Def}; my $status = $def->bzclose($_[0]); $self->{ErrorNo} = $status; if ($status != BZ_STREAM_END) { $self->{Error} = "Deflate Error: $status"; return STATUS_ERROR; } return STATUS_OK; } sub reset { my $self = shift ; my $outer = $self->{Outer}; my ($def, $status) = new Compress::Raw::Bzip2(); $self->{ErrorNo} = ($status == BZ_OK) ? 0 : $status ; if ($status != BZ_OK) { $self->{Error} = "Cannot create Deflate object: $status"; return STATUS_ERROR; } $self->{Def} = $def; return STATUS_OK; } sub compressedBytes { my $self = shift ; $self->{Def}->compressedBytes(); } sub uncompressedBytes { my $self = shift ; $self->{Def}->uncompressedBytes(); } #sub total_out #{ # my $self = shift ; # 0; #} # #sub total_in #{ # my $self = shift ; # $self->{Def}->total_in(); #} # #sub crc32 #{ # my $self = shift ; # $self->{Def}->crc32(); #} # #sub adler32 #{ # my $self = shift ; # $self->{Def}->adler32(); #} 1; __END__
16.748387
74
0.511556
ed2227252017c90137a1525b78866b2b96c073c0
2,309
t
Perl
t/search_movies_2.t
trizen/Search-MultiMatch
73d754529427cf43b0e251bf9cfe2728ec64472e
[ "Artistic-2.0" ]
null
null
null
t/search_movies_2.t
trizen/Search-MultiMatch
73d754529427cf43b0e251bf9cfe2728ec64472e
[ "Artistic-2.0" ]
null
null
null
t/search_movies_2.t
trizen/Search-MultiMatch
73d754529427cf43b0e251bf9cfe2728ec64472e
[ "Artistic-2.0" ]
null
null
null
#!perl -T use 5.006; use strict; use utf8; use warnings FATAL => 'all'; use Test::More; plan tests => 6; use_ok('Search::MultiMatch') || print "Bail out!\n"; my $smm = Search::MultiMatch->new(); sub make_key { [map { [$_] } split(' ', lc($_[0]))]; } my @movies = ( 'some values here', 'My First Lover', 'A Lot Like Love', 'Funny Games (2007)', 'Cinderella Man (2005)', 'Pulp Fiction (1994)', 'Don\'t Say a Word (2001)', 'Secret Window (2004)', 'The Lookout (2007)', '88 Minutes (2007)', 'The Mothman Prophecies', 'Love Actually (2003)', 'From Paris with Love (2010)', 'P.S. I Love You (2007)', ); foreach my $movie (@movies) { $smm->add(make_key($movie), $movie); } sub search { my ($key, %opt) = @_; $smm->search(make_key($key), %opt); } # ## Default matching # { my @matches = search('i love'); my @expect = ( {match => 'P.S. I Love You (2007)', score => 2}, {match => 'A Lot Like Love', score => 1}, {match => 'Love Actually (2003)', score => 1}, {match => 'From Paris with Love (2010)', score => 1}, ); is_deeply(\@matches, \@expect); } # ## Best matching # { my @matches = search('i love', keep => 'best'); my @expect = ({match => 'P.S. I Love You (2007)', score => 2}); is_deeply(\@matches, \@expect); } # ## Best matching # { my @matches = search('actually love', keep => 'best'); my @expect = ({match => 'Love Actually (2003)', score => 2}); is_deeply(\@matches, \@expect); } # ## Any matching # { my @matches = search('love berlin', keep => 'any'); my @expect = ( {match => "A Lot Like Love", score => 1}, {match => "Love Actually (2003)", score => 1}, {match => "From Paris with Love (2010)", score => 1}, {match => "P.S. I Love You (2007)", score => 1}, ); is_deeply(\@matches, \@expect); } # ## Default matching # { my @matches = search('love berlin'); is($#matches, -1); }
23.323232
71
0.45864
ed0deab9737227a8cf3f9b3b7c411614c2f56141
32,234
pm
Perl
perl/vendor/lib/DateTime/TimeZone/America/Nipigon.pm
Light2027/OnlineCampusSandbox
8dcaaf62af1342470f9e7be6d42bd0f16eb910b8
[ "Apache-2.0" ]
null
null
null
perl/vendor/lib/DateTime/TimeZone/America/Nipigon.pm
Light2027/OnlineCampusSandbox
8dcaaf62af1342470f9e7be6d42bd0f16eb910b8
[ "Apache-2.0" ]
3
2021-01-27T10:09:28.000Z
2021-05-11T21:20:12.000Z
perl/vendor/lib/DateTime/TimeZone/America/Nipigon.pm
Light2027/OnlineCampusSandbox
8dcaaf62af1342470f9e7be6d42bd0f16eb910b8
[ "Apache-2.0" ]
null
null
null
# This file is auto-generated by the Perl DateTime Suite time zone # code generator (0.08) This code generator comes with the # DateTime::TimeZone module distribution in the tools/ directory # # Generated from /tmp/PG8ljYXUN8/northamerica. Olson data version 2019c # # Do not edit this file directly. # package DateTime::TimeZone::America::Nipigon; use strict; use warnings; use namespace::autoclean; our $VERSION = '2.38'; use Class::Singleton 1.03; use DateTime::TimeZone; use DateTime::TimeZone::OlsonDB; @DateTime::TimeZone::America::Nipigon::ISA = ( 'Class::Singleton', 'DateTime::TimeZone' ); my $spans = [ [ DateTime::TimeZone::NEG_INFINITY, # utc_start 59768949184, # utc_end 1895-01-01 05:53:04 (Tue) DateTime::TimeZone::NEG_INFINITY, # local_start 59768928000, # local_end 1895-01-01 00:00:00 (Tue) -21184, 0, 'LMT', ], [ 59768949184, # utc_start 1895-01-01 05:53:04 (Tue) 60503612400, # utc_end 1918-04-14 07:00:00 (Sun) 59768931184, # local_start 1895-01-01 00:53:04 (Tue) 60503594400, # local_end 1918-04-14 02:00:00 (Sun) -18000, 0, 'EST', ], [ 60503612400, # utc_start 1918-04-14 07:00:00 (Sun) 60520543200, # utc_end 1918-10-27 06:00:00 (Sun) 60503598000, # local_start 1918-04-14 03:00:00 (Sun) 60520528800, # local_end 1918-10-27 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 60520543200, # utc_start 1918-10-27 06:00:00 (Sun) 61212430800, # utc_end 1940-09-29 05:00:00 (Sun) 60520525200, # local_start 1918-10-27 01:00:00 (Sun) 61212412800, # local_end 1940-09-29 00:00:00 (Sun) -18000, 0, 'EST', ], [ 61212430800, # utc_start 1940-09-29 05:00:00 (Sun) 61255465200, # utc_end 1942-02-09 07:00:00 (Mon) 61212416400, # local_start 1940-09-29 01:00:00 (Sun) 61255450800, # local_end 1942-02-09 03:00:00 (Mon) -14400, 1, 'EDT', ], [ 61255465200, # utc_start 1942-02-09 07:00:00 (Mon) 61366287600, # utc_end 1945-08-14 23:00:00 (Tue) 61255450800, # local_start 1942-02-09 03:00:00 (Mon) 61366273200, # local_end 1945-08-14 19:00:00 (Tue) -14400, 1, 'EWT', ], [ 61366287600, # utc_start 1945-08-14 23:00:00 (Tue) 61370287200, # utc_end 1945-09-30 06:00:00 (Sun) 61366273200, # local_start 1945-08-14 19:00:00 (Tue) 61370272800, # local_end 1945-09-30 02:00:00 (Sun) -14400, 1, 'EPT', ], [ 61370287200, # utc_start 1945-09-30 06:00:00 (Sun) 62272047600, # utc_end 1974-04-28 07:00:00 (Sun) 61370269200, # local_start 1945-09-30 01:00:00 (Sun) 62272029600, # local_end 1974-04-28 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62272047600, # utc_start 1974-04-28 07:00:00 (Sun) 62287768800, # utc_end 1974-10-27 06:00:00 (Sun) 62272033200, # local_start 1974-04-28 03:00:00 (Sun) 62287754400, # local_end 1974-10-27 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62287768800, # utc_start 1974-10-27 06:00:00 (Sun) 62303497200, # utc_end 1975-04-27 07:00:00 (Sun) 62287750800, # local_start 1974-10-27 01:00:00 (Sun) 62303479200, # local_end 1975-04-27 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62303497200, # utc_start 1975-04-27 07:00:00 (Sun) 62319218400, # utc_end 1975-10-26 06:00:00 (Sun) 62303482800, # local_start 1975-04-27 03:00:00 (Sun) 62319204000, # local_end 1975-10-26 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62319218400, # utc_start 1975-10-26 06:00:00 (Sun) 62334946800, # utc_end 1976-04-25 07:00:00 (Sun) 62319200400, # local_start 1975-10-26 01:00:00 (Sun) 62334928800, # local_end 1976-04-25 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62334946800, # utc_start 1976-04-25 07:00:00 (Sun) 62351272800, # utc_end 1976-10-31 06:00:00 (Sun) 62334932400, # local_start 1976-04-25 03:00:00 (Sun) 62351258400, # local_end 1976-10-31 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62351272800, # utc_start 1976-10-31 06:00:00 (Sun) 62366396400, # utc_end 1977-04-24 07:00:00 (Sun) 62351254800, # local_start 1976-10-31 01:00:00 (Sun) 62366378400, # local_end 1977-04-24 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62366396400, # utc_start 1977-04-24 07:00:00 (Sun) 62382722400, # utc_end 1977-10-30 06:00:00 (Sun) 62366382000, # local_start 1977-04-24 03:00:00 (Sun) 62382708000, # local_end 1977-10-30 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62382722400, # utc_start 1977-10-30 06:00:00 (Sun) 62398450800, # utc_end 1978-04-30 07:00:00 (Sun) 62382704400, # local_start 1977-10-30 01:00:00 (Sun) 62398432800, # local_end 1978-04-30 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62398450800, # utc_start 1978-04-30 07:00:00 (Sun) 62414172000, # utc_end 1978-10-29 06:00:00 (Sun) 62398436400, # local_start 1978-04-30 03:00:00 (Sun) 62414157600, # local_end 1978-10-29 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62414172000, # utc_start 1978-10-29 06:00:00 (Sun) 62429900400, # utc_end 1979-04-29 07:00:00 (Sun) 62414154000, # local_start 1978-10-29 01:00:00 (Sun) 62429882400, # local_end 1979-04-29 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62429900400, # utc_start 1979-04-29 07:00:00 (Sun) 62445621600, # utc_end 1979-10-28 06:00:00 (Sun) 62429886000, # local_start 1979-04-29 03:00:00 (Sun) 62445607200, # local_end 1979-10-28 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62445621600, # utc_start 1979-10-28 06:00:00 (Sun) 62461350000, # utc_end 1980-04-27 07:00:00 (Sun) 62445603600, # local_start 1979-10-28 01:00:00 (Sun) 62461332000, # local_end 1980-04-27 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62461350000, # utc_start 1980-04-27 07:00:00 (Sun) 62477071200, # utc_end 1980-10-26 06:00:00 (Sun) 62461335600, # local_start 1980-04-27 03:00:00 (Sun) 62477056800, # local_end 1980-10-26 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62477071200, # utc_start 1980-10-26 06:00:00 (Sun) 62492799600, # utc_end 1981-04-26 07:00:00 (Sun) 62477053200, # local_start 1980-10-26 01:00:00 (Sun) 62492781600, # local_end 1981-04-26 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62492799600, # utc_start 1981-04-26 07:00:00 (Sun) 62508520800, # utc_end 1981-10-25 06:00:00 (Sun) 62492785200, # local_start 1981-04-26 03:00:00 (Sun) 62508506400, # local_end 1981-10-25 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62508520800, # utc_start 1981-10-25 06:00:00 (Sun) 62524249200, # utc_end 1982-04-25 07:00:00 (Sun) 62508502800, # local_start 1981-10-25 01:00:00 (Sun) 62524231200, # local_end 1982-04-25 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62524249200, # utc_start 1982-04-25 07:00:00 (Sun) 62540575200, # utc_end 1982-10-31 06:00:00 (Sun) 62524234800, # local_start 1982-04-25 03:00:00 (Sun) 62540560800, # local_end 1982-10-31 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62540575200, # utc_start 1982-10-31 06:00:00 (Sun) 62555698800, # utc_end 1983-04-24 07:00:00 (Sun) 62540557200, # local_start 1982-10-31 01:00:00 (Sun) 62555680800, # local_end 1983-04-24 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62555698800, # utc_start 1983-04-24 07:00:00 (Sun) 62572024800, # utc_end 1983-10-30 06:00:00 (Sun) 62555684400, # local_start 1983-04-24 03:00:00 (Sun) 62572010400, # local_end 1983-10-30 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62572024800, # utc_start 1983-10-30 06:00:00 (Sun) 62587753200, # utc_end 1984-04-29 07:00:00 (Sun) 62572006800, # local_start 1983-10-30 01:00:00 (Sun) 62587735200, # local_end 1984-04-29 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62587753200, # utc_start 1984-04-29 07:00:00 (Sun) 62603474400, # utc_end 1984-10-28 06:00:00 (Sun) 62587738800, # local_start 1984-04-29 03:00:00 (Sun) 62603460000, # local_end 1984-10-28 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62603474400, # utc_start 1984-10-28 06:00:00 (Sun) 62619202800, # utc_end 1985-04-28 07:00:00 (Sun) 62603456400, # local_start 1984-10-28 01:00:00 (Sun) 62619184800, # local_end 1985-04-28 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62619202800, # utc_start 1985-04-28 07:00:00 (Sun) 62634924000, # utc_end 1985-10-27 06:00:00 (Sun) 62619188400, # local_start 1985-04-28 03:00:00 (Sun) 62634909600, # local_end 1985-10-27 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62634924000, # utc_start 1985-10-27 06:00:00 (Sun) 62650652400, # utc_end 1986-04-27 07:00:00 (Sun) 62634906000, # local_start 1985-10-27 01:00:00 (Sun) 62650634400, # local_end 1986-04-27 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62650652400, # utc_start 1986-04-27 07:00:00 (Sun) 62666373600, # utc_end 1986-10-26 06:00:00 (Sun) 62650638000, # local_start 1986-04-27 03:00:00 (Sun) 62666359200, # local_end 1986-10-26 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62666373600, # utc_start 1986-10-26 06:00:00 (Sun) 62680287600, # utc_end 1987-04-05 07:00:00 (Sun) 62666355600, # local_start 1986-10-26 01:00:00 (Sun) 62680269600, # local_end 1987-04-05 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62680287600, # utc_start 1987-04-05 07:00:00 (Sun) 62697823200, # utc_end 1987-10-25 06:00:00 (Sun) 62680273200, # local_start 1987-04-05 03:00:00 (Sun) 62697808800, # local_end 1987-10-25 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62697823200, # utc_start 1987-10-25 06:00:00 (Sun) 62711737200, # utc_end 1988-04-03 07:00:00 (Sun) 62697805200, # local_start 1987-10-25 01:00:00 (Sun) 62711719200, # local_end 1988-04-03 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62711737200, # utc_start 1988-04-03 07:00:00 (Sun) 62729877600, # utc_end 1988-10-30 06:00:00 (Sun) 62711722800, # local_start 1988-04-03 03:00:00 (Sun) 62729863200, # local_end 1988-10-30 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62729877600, # utc_start 1988-10-30 06:00:00 (Sun) 62743186800, # utc_end 1989-04-02 07:00:00 (Sun) 62729859600, # local_start 1988-10-30 01:00:00 (Sun) 62743168800, # local_end 1989-04-02 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62743186800, # utc_start 1989-04-02 07:00:00 (Sun) 62761327200, # utc_end 1989-10-29 06:00:00 (Sun) 62743172400, # local_start 1989-04-02 03:00:00 (Sun) 62761312800, # local_end 1989-10-29 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62761327200, # utc_start 1989-10-29 06:00:00 (Sun) 62774636400, # utc_end 1990-04-01 07:00:00 (Sun) 62761309200, # local_start 1989-10-29 01:00:00 (Sun) 62774618400, # local_end 1990-04-01 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62774636400, # utc_start 1990-04-01 07:00:00 (Sun) 62792776800, # utc_end 1990-10-28 06:00:00 (Sun) 62774622000, # local_start 1990-04-01 03:00:00 (Sun) 62792762400, # local_end 1990-10-28 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62792776800, # utc_start 1990-10-28 06:00:00 (Sun) 62806690800, # utc_end 1991-04-07 07:00:00 (Sun) 62792758800, # local_start 1990-10-28 01:00:00 (Sun) 62806672800, # local_end 1991-04-07 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62806690800, # utc_start 1991-04-07 07:00:00 (Sun) 62824226400, # utc_end 1991-10-27 06:00:00 (Sun) 62806676400, # local_start 1991-04-07 03:00:00 (Sun) 62824212000, # local_end 1991-10-27 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62824226400, # utc_start 1991-10-27 06:00:00 (Sun) 62838140400, # utc_end 1992-04-05 07:00:00 (Sun) 62824208400, # local_start 1991-10-27 01:00:00 (Sun) 62838122400, # local_end 1992-04-05 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62838140400, # utc_start 1992-04-05 07:00:00 (Sun) 62855676000, # utc_end 1992-10-25 06:00:00 (Sun) 62838126000, # local_start 1992-04-05 03:00:00 (Sun) 62855661600, # local_end 1992-10-25 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62855676000, # utc_start 1992-10-25 06:00:00 (Sun) 62869590000, # utc_end 1993-04-04 07:00:00 (Sun) 62855658000, # local_start 1992-10-25 01:00:00 (Sun) 62869572000, # local_end 1993-04-04 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62869590000, # utc_start 1993-04-04 07:00:00 (Sun) 62887730400, # utc_end 1993-10-31 06:00:00 (Sun) 62869575600, # local_start 1993-04-04 03:00:00 (Sun) 62887716000, # local_end 1993-10-31 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62887730400, # utc_start 1993-10-31 06:00:00 (Sun) 62901039600, # utc_end 1994-04-03 07:00:00 (Sun) 62887712400, # local_start 1993-10-31 01:00:00 (Sun) 62901021600, # local_end 1994-04-03 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62901039600, # utc_start 1994-04-03 07:00:00 (Sun) 62919180000, # utc_end 1994-10-30 06:00:00 (Sun) 62901025200, # local_start 1994-04-03 03:00:00 (Sun) 62919165600, # local_end 1994-10-30 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62919180000, # utc_start 1994-10-30 06:00:00 (Sun) 62932489200, # utc_end 1995-04-02 07:00:00 (Sun) 62919162000, # local_start 1994-10-30 01:00:00 (Sun) 62932471200, # local_end 1995-04-02 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62932489200, # utc_start 1995-04-02 07:00:00 (Sun) 62950629600, # utc_end 1995-10-29 06:00:00 (Sun) 62932474800, # local_start 1995-04-02 03:00:00 (Sun) 62950615200, # local_end 1995-10-29 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62950629600, # utc_start 1995-10-29 06:00:00 (Sun) 62964543600, # utc_end 1996-04-07 07:00:00 (Sun) 62950611600, # local_start 1995-10-29 01:00:00 (Sun) 62964525600, # local_end 1996-04-07 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62964543600, # utc_start 1996-04-07 07:00:00 (Sun) 62982079200, # utc_end 1996-10-27 06:00:00 (Sun) 62964529200, # local_start 1996-04-07 03:00:00 (Sun) 62982064800, # local_end 1996-10-27 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 62982079200, # utc_start 1996-10-27 06:00:00 (Sun) 62995993200, # utc_end 1997-04-06 07:00:00 (Sun) 62982061200, # local_start 1996-10-27 01:00:00 (Sun) 62995975200, # local_end 1997-04-06 02:00:00 (Sun) -18000, 0, 'EST', ], [ 62995993200, # utc_start 1997-04-06 07:00:00 (Sun) 63013528800, # utc_end 1997-10-26 06:00:00 (Sun) 62995978800, # local_start 1997-04-06 03:00:00 (Sun) 63013514400, # local_end 1997-10-26 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63013528800, # utc_start 1997-10-26 06:00:00 (Sun) 63027442800, # utc_end 1998-04-05 07:00:00 (Sun) 63013510800, # local_start 1997-10-26 01:00:00 (Sun) 63027424800, # local_end 1998-04-05 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63027442800, # utc_start 1998-04-05 07:00:00 (Sun) 63044978400, # utc_end 1998-10-25 06:00:00 (Sun) 63027428400, # local_start 1998-04-05 03:00:00 (Sun) 63044964000, # local_end 1998-10-25 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63044978400, # utc_start 1998-10-25 06:00:00 (Sun) 63058892400, # utc_end 1999-04-04 07:00:00 (Sun) 63044960400, # local_start 1998-10-25 01:00:00 (Sun) 63058874400, # local_end 1999-04-04 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63058892400, # utc_start 1999-04-04 07:00:00 (Sun) 63077032800, # utc_end 1999-10-31 06:00:00 (Sun) 63058878000, # local_start 1999-04-04 03:00:00 (Sun) 63077018400, # local_end 1999-10-31 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63077032800, # utc_start 1999-10-31 06:00:00 (Sun) 63090342000, # utc_end 2000-04-02 07:00:00 (Sun) 63077014800, # local_start 1999-10-31 01:00:00 (Sun) 63090324000, # local_end 2000-04-02 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63090342000, # utc_start 2000-04-02 07:00:00 (Sun) 63108482400, # utc_end 2000-10-29 06:00:00 (Sun) 63090327600, # local_start 2000-04-02 03:00:00 (Sun) 63108468000, # local_end 2000-10-29 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63108482400, # utc_start 2000-10-29 06:00:00 (Sun) 63121791600, # utc_end 2001-04-01 07:00:00 (Sun) 63108464400, # local_start 2000-10-29 01:00:00 (Sun) 63121773600, # local_end 2001-04-01 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63121791600, # utc_start 2001-04-01 07:00:00 (Sun) 63139932000, # utc_end 2001-10-28 06:00:00 (Sun) 63121777200, # local_start 2001-04-01 03:00:00 (Sun) 63139917600, # local_end 2001-10-28 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63139932000, # utc_start 2001-10-28 06:00:00 (Sun) 63153846000, # utc_end 2002-04-07 07:00:00 (Sun) 63139914000, # local_start 2001-10-28 01:00:00 (Sun) 63153828000, # local_end 2002-04-07 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63153846000, # utc_start 2002-04-07 07:00:00 (Sun) 63171381600, # utc_end 2002-10-27 06:00:00 (Sun) 63153831600, # local_start 2002-04-07 03:00:00 (Sun) 63171367200, # local_end 2002-10-27 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63171381600, # utc_start 2002-10-27 06:00:00 (Sun) 63185295600, # utc_end 2003-04-06 07:00:00 (Sun) 63171363600, # local_start 2002-10-27 01:00:00 (Sun) 63185277600, # local_end 2003-04-06 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63185295600, # utc_start 2003-04-06 07:00:00 (Sun) 63202831200, # utc_end 2003-10-26 06:00:00 (Sun) 63185281200, # local_start 2003-04-06 03:00:00 (Sun) 63202816800, # local_end 2003-10-26 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63202831200, # utc_start 2003-10-26 06:00:00 (Sun) 63216745200, # utc_end 2004-04-04 07:00:00 (Sun) 63202813200, # local_start 2003-10-26 01:00:00 (Sun) 63216727200, # local_end 2004-04-04 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63216745200, # utc_start 2004-04-04 07:00:00 (Sun) 63234885600, # utc_end 2004-10-31 06:00:00 (Sun) 63216730800, # local_start 2004-04-04 03:00:00 (Sun) 63234871200, # local_end 2004-10-31 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63234885600, # utc_start 2004-10-31 06:00:00 (Sun) 63248194800, # utc_end 2005-04-03 07:00:00 (Sun) 63234867600, # local_start 2004-10-31 01:00:00 (Sun) 63248176800, # local_end 2005-04-03 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63248194800, # utc_start 2005-04-03 07:00:00 (Sun) 63266335200, # utc_end 2005-10-30 06:00:00 (Sun) 63248180400, # local_start 2005-04-03 03:00:00 (Sun) 63266320800, # local_end 2005-10-30 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63266335200, # utc_start 2005-10-30 06:00:00 (Sun) 63279644400, # utc_end 2006-04-02 07:00:00 (Sun) 63266317200, # local_start 2005-10-30 01:00:00 (Sun) 63279626400, # local_end 2006-04-02 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63279644400, # utc_start 2006-04-02 07:00:00 (Sun) 63297784800, # utc_end 2006-10-29 06:00:00 (Sun) 63279630000, # local_start 2006-04-02 03:00:00 (Sun) 63297770400, # local_end 2006-10-29 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63297784800, # utc_start 2006-10-29 06:00:00 (Sun) 63309279600, # utc_end 2007-03-11 07:00:00 (Sun) 63297766800, # local_start 2006-10-29 01:00:00 (Sun) 63309261600, # local_end 2007-03-11 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63309279600, # utc_start 2007-03-11 07:00:00 (Sun) 63329839200, # utc_end 2007-11-04 06:00:00 (Sun) 63309265200, # local_start 2007-03-11 03:00:00 (Sun) 63329824800, # local_end 2007-11-04 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63329839200, # utc_start 2007-11-04 06:00:00 (Sun) 63340729200, # utc_end 2008-03-09 07:00:00 (Sun) 63329821200, # local_start 2007-11-04 01:00:00 (Sun) 63340711200, # local_end 2008-03-09 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63340729200, # utc_start 2008-03-09 07:00:00 (Sun) 63361288800, # utc_end 2008-11-02 06:00:00 (Sun) 63340714800, # local_start 2008-03-09 03:00:00 (Sun) 63361274400, # local_end 2008-11-02 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63361288800, # utc_start 2008-11-02 06:00:00 (Sun) 63372178800, # utc_end 2009-03-08 07:00:00 (Sun) 63361270800, # local_start 2008-11-02 01:00:00 (Sun) 63372160800, # local_end 2009-03-08 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63372178800, # utc_start 2009-03-08 07:00:00 (Sun) 63392738400, # utc_end 2009-11-01 06:00:00 (Sun) 63372164400, # local_start 2009-03-08 03:00:00 (Sun) 63392724000, # local_end 2009-11-01 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63392738400, # utc_start 2009-11-01 06:00:00 (Sun) 63404233200, # utc_end 2010-03-14 07:00:00 (Sun) 63392720400, # local_start 2009-11-01 01:00:00 (Sun) 63404215200, # local_end 2010-03-14 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63404233200, # utc_start 2010-03-14 07:00:00 (Sun) 63424792800, # utc_end 2010-11-07 06:00:00 (Sun) 63404218800, # local_start 2010-03-14 03:00:00 (Sun) 63424778400, # local_end 2010-11-07 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63424792800, # utc_start 2010-11-07 06:00:00 (Sun) 63435682800, # utc_end 2011-03-13 07:00:00 (Sun) 63424774800, # local_start 2010-11-07 01:00:00 (Sun) 63435664800, # local_end 2011-03-13 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63435682800, # utc_start 2011-03-13 07:00:00 (Sun) 63456242400, # utc_end 2011-11-06 06:00:00 (Sun) 63435668400, # local_start 2011-03-13 03:00:00 (Sun) 63456228000, # local_end 2011-11-06 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63456242400, # utc_start 2011-11-06 06:00:00 (Sun) 63467132400, # utc_end 2012-03-11 07:00:00 (Sun) 63456224400, # local_start 2011-11-06 01:00:00 (Sun) 63467114400, # local_end 2012-03-11 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63467132400, # utc_start 2012-03-11 07:00:00 (Sun) 63487692000, # utc_end 2012-11-04 06:00:00 (Sun) 63467118000, # local_start 2012-03-11 03:00:00 (Sun) 63487677600, # local_end 2012-11-04 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63487692000, # utc_start 2012-11-04 06:00:00 (Sun) 63498582000, # utc_end 2013-03-10 07:00:00 (Sun) 63487674000, # local_start 2012-11-04 01:00:00 (Sun) 63498564000, # local_end 2013-03-10 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63498582000, # utc_start 2013-03-10 07:00:00 (Sun) 63519141600, # utc_end 2013-11-03 06:00:00 (Sun) 63498567600, # local_start 2013-03-10 03:00:00 (Sun) 63519127200, # local_end 2013-11-03 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63519141600, # utc_start 2013-11-03 06:00:00 (Sun) 63530031600, # utc_end 2014-03-09 07:00:00 (Sun) 63519123600, # local_start 2013-11-03 01:00:00 (Sun) 63530013600, # local_end 2014-03-09 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63530031600, # utc_start 2014-03-09 07:00:00 (Sun) 63550591200, # utc_end 2014-11-02 06:00:00 (Sun) 63530017200, # local_start 2014-03-09 03:00:00 (Sun) 63550576800, # local_end 2014-11-02 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63550591200, # utc_start 2014-11-02 06:00:00 (Sun) 63561481200, # utc_end 2015-03-08 07:00:00 (Sun) 63550573200, # local_start 2014-11-02 01:00:00 (Sun) 63561463200, # local_end 2015-03-08 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63561481200, # utc_start 2015-03-08 07:00:00 (Sun) 63582040800, # utc_end 2015-11-01 06:00:00 (Sun) 63561466800, # local_start 2015-03-08 03:00:00 (Sun) 63582026400, # local_end 2015-11-01 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63582040800, # utc_start 2015-11-01 06:00:00 (Sun) 63593535600, # utc_end 2016-03-13 07:00:00 (Sun) 63582022800, # local_start 2015-11-01 01:00:00 (Sun) 63593517600, # local_end 2016-03-13 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63593535600, # utc_start 2016-03-13 07:00:00 (Sun) 63614095200, # utc_end 2016-11-06 06:00:00 (Sun) 63593521200, # local_start 2016-03-13 03:00:00 (Sun) 63614080800, # local_end 2016-11-06 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63614095200, # utc_start 2016-11-06 06:00:00 (Sun) 63624985200, # utc_end 2017-03-12 07:00:00 (Sun) 63614077200, # local_start 2016-11-06 01:00:00 (Sun) 63624967200, # local_end 2017-03-12 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63624985200, # utc_start 2017-03-12 07:00:00 (Sun) 63645544800, # utc_end 2017-11-05 06:00:00 (Sun) 63624970800, # local_start 2017-03-12 03:00:00 (Sun) 63645530400, # local_end 2017-11-05 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63645544800, # utc_start 2017-11-05 06:00:00 (Sun) 63656434800, # utc_end 2018-03-11 07:00:00 (Sun) 63645526800, # local_start 2017-11-05 01:00:00 (Sun) 63656416800, # local_end 2018-03-11 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63656434800, # utc_start 2018-03-11 07:00:00 (Sun) 63676994400, # utc_end 2018-11-04 06:00:00 (Sun) 63656420400, # local_start 2018-03-11 03:00:00 (Sun) 63676980000, # local_end 2018-11-04 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63676994400, # utc_start 2018-11-04 06:00:00 (Sun) 63687884400, # utc_end 2019-03-10 07:00:00 (Sun) 63676976400, # local_start 2018-11-04 01:00:00 (Sun) 63687866400, # local_end 2019-03-10 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63687884400, # utc_start 2019-03-10 07:00:00 (Sun) 63708444000, # utc_end 2019-11-03 06:00:00 (Sun) 63687870000, # local_start 2019-03-10 03:00:00 (Sun) 63708429600, # local_end 2019-11-03 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63708444000, # utc_start 2019-11-03 06:00:00 (Sun) 63719334000, # utc_end 2020-03-08 07:00:00 (Sun) 63708426000, # local_start 2019-11-03 01:00:00 (Sun) 63719316000, # local_end 2020-03-08 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63719334000, # utc_start 2020-03-08 07:00:00 (Sun) 63739893600, # utc_end 2020-11-01 06:00:00 (Sun) 63719319600, # local_start 2020-03-08 03:00:00 (Sun) 63739879200, # local_end 2020-11-01 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63739893600, # utc_start 2020-11-01 06:00:00 (Sun) 63751388400, # utc_end 2021-03-14 07:00:00 (Sun) 63739875600, # local_start 2020-11-01 01:00:00 (Sun) 63751370400, # local_end 2021-03-14 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63751388400, # utc_start 2021-03-14 07:00:00 (Sun) 63771948000, # utc_end 2021-11-07 06:00:00 (Sun) 63751374000, # local_start 2021-03-14 03:00:00 (Sun) 63771933600, # local_end 2021-11-07 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63771948000, # utc_start 2021-11-07 06:00:00 (Sun) 63782838000, # utc_end 2022-03-13 07:00:00 (Sun) 63771930000, # local_start 2021-11-07 01:00:00 (Sun) 63782820000, # local_end 2022-03-13 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63782838000, # utc_start 2022-03-13 07:00:00 (Sun) 63803397600, # utc_end 2022-11-06 06:00:00 (Sun) 63782823600, # local_start 2022-03-13 03:00:00 (Sun) 63803383200, # local_end 2022-11-06 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63803397600, # utc_start 2022-11-06 06:00:00 (Sun) 63814287600, # utc_end 2023-03-12 07:00:00 (Sun) 63803379600, # local_start 2022-11-06 01:00:00 (Sun) 63814269600, # local_end 2023-03-12 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63814287600, # utc_start 2023-03-12 07:00:00 (Sun) 63834847200, # utc_end 2023-11-05 06:00:00 (Sun) 63814273200, # local_start 2023-03-12 03:00:00 (Sun) 63834832800, # local_end 2023-11-05 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63834847200, # utc_start 2023-11-05 06:00:00 (Sun) 63845737200, # utc_end 2024-03-10 07:00:00 (Sun) 63834829200, # local_start 2023-11-05 01:00:00 (Sun) 63845719200, # local_end 2024-03-10 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63845737200, # utc_start 2024-03-10 07:00:00 (Sun) 63866296800, # utc_end 2024-11-03 06:00:00 (Sun) 63845722800, # local_start 2024-03-10 03:00:00 (Sun) 63866282400, # local_end 2024-11-03 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63866296800, # utc_start 2024-11-03 06:00:00 (Sun) 63877186800, # utc_end 2025-03-09 07:00:00 (Sun) 63866278800, # local_start 2024-11-03 01:00:00 (Sun) 63877168800, # local_end 2025-03-09 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63877186800, # utc_start 2025-03-09 07:00:00 (Sun) 63897746400, # utc_end 2025-11-02 06:00:00 (Sun) 63877172400, # local_start 2025-03-09 03:00:00 (Sun) 63897732000, # local_end 2025-11-02 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63897746400, # utc_start 2025-11-02 06:00:00 (Sun) 63908636400, # utc_end 2026-03-08 07:00:00 (Sun) 63897728400, # local_start 2025-11-02 01:00:00 (Sun) 63908618400, # local_end 2026-03-08 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63908636400, # utc_start 2026-03-08 07:00:00 (Sun) 63929196000, # utc_end 2026-11-01 06:00:00 (Sun) 63908622000, # local_start 2026-03-08 03:00:00 (Sun) 63929181600, # local_end 2026-11-01 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63929196000, # utc_start 2026-11-01 06:00:00 (Sun) 63940690800, # utc_end 2027-03-14 07:00:00 (Sun) 63929178000, # local_start 2026-11-01 01:00:00 (Sun) 63940672800, # local_end 2027-03-14 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63940690800, # utc_start 2027-03-14 07:00:00 (Sun) 63961250400, # utc_end 2027-11-07 06:00:00 (Sun) 63940676400, # local_start 2027-03-14 03:00:00 (Sun) 63961236000, # local_end 2027-11-07 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63961250400, # utc_start 2027-11-07 06:00:00 (Sun) 63972140400, # utc_end 2028-03-12 07:00:00 (Sun) 63961232400, # local_start 2027-11-07 01:00:00 (Sun) 63972122400, # local_end 2028-03-12 02:00:00 (Sun) -18000, 0, 'EST', ], [ 63972140400, # utc_start 2028-03-12 07:00:00 (Sun) 63992700000, # utc_end 2028-11-05 06:00:00 (Sun) 63972126000, # local_start 2028-03-12 03:00:00 (Sun) 63992685600, # local_end 2028-11-05 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 63992700000, # utc_start 2028-11-05 06:00:00 (Sun) 64003590000, # utc_end 2029-03-11 07:00:00 (Sun) 63992682000, # local_start 2028-11-05 01:00:00 (Sun) 64003572000, # local_end 2029-03-11 02:00:00 (Sun) -18000, 0, 'EST', ], [ 64003590000, # utc_start 2029-03-11 07:00:00 (Sun) 64024149600, # utc_end 2029-11-04 06:00:00 (Sun) 64003575600, # local_start 2029-03-11 03:00:00 (Sun) 64024135200, # local_end 2029-11-04 02:00:00 (Sun) -14400, 1, 'EDT', ], [ 64024149600, # utc_start 2029-11-04 06:00:00 (Sun) 64035039600, # utc_end 2030-03-10 07:00:00 (Sun) 64024131600, # local_start 2029-11-04 01:00:00 (Sun) 64035021600, # local_end 2030-03-10 02:00:00 (Sun) -18000, 0, 'EST', ], [ 64035039600, # utc_start 2030-03-10 07:00:00 (Sun) 64055599200, # utc_end 2030-11-03 06:00:00 (Sun) 64035025200, # local_start 2030-03-10 03:00:00 (Sun) 64055584800, # local_end 2030-11-03 02:00:00 (Sun) -14400, 1, 'EDT', ], ]; sub olson_version {'2019c'} sub has_dst_changes {61} sub _max_year {2029} sub _new_instance { return shift->_init( @_, spans => $spans ); } sub _last_offset { -18000 } my $last_observance = bless( { 'format' => 'E%sT', 'gmtoff' => '-5:00', 'local_start_datetime' => bless( { 'formatter' => undef, 'local_rd_days' => 708975, 'local_rd_secs' => 10800, 'offset_modifier' => 0, 'rd_nanosecs' => 0, 'tz' => bless( { 'name' => 'floating', 'offset' => 0 }, 'DateTime::TimeZone::Floating' ), 'utc_rd_days' => 708975, 'utc_rd_secs' => 10800, 'utc_year' => 1943 }, 'DateTime' ), 'offset_from_std' => 0, 'offset_from_utc' => -18000, 'until' => [], 'utc_start_datetime' => bless( { 'formatter' => undef, 'local_rd_days' => 708975, 'local_rd_secs' => 25200, 'offset_modifier' => 0, 'rd_nanosecs' => 0, 'tz' => bless( { 'name' => 'floating', 'offset' => 0 }, 'DateTime::TimeZone::Floating' ), 'utc_rd_days' => 708975, 'utc_rd_secs' => 25200, 'utc_year' => 1943 }, 'DateTime' ) }, 'DateTime::TimeZone::OlsonDB::Observance' ) ; sub _last_observance { $last_observance } my $rules = [ bless( { 'at' => '2:00', 'from' => '2007', 'in' => 'Mar', 'letter' => 'D', 'name' => 'Canada', 'offset_from_std' => 3600, 'on' => 'Sun>=8', 'save' => '1:00', 'to' => 'max' }, 'DateTime::TimeZone::OlsonDB::Rule' ), bless( { 'at' => '2:00', 'from' => '2007', 'in' => 'Nov', 'letter' => 'S', 'name' => 'Canada', 'offset_from_std' => 0, 'on' => 'Sun>=1', 'save' => '0', 'to' => 'max' }, 'DateTime::TimeZone::OlsonDB::Rule' ) ] ; sub _rules { $rules } 1;
26.928989
90
0.631724
73e5fd5994f16c8c0839e0c04031926156478c85
1,072
pm
Perl
lib/JIRA/REST/Class/Issue/Changelog.pm
mjgardner/JIRA-REST-Class
9d8f065425eef06e42bd2afd734657736580ca41
[ "Artistic-2.0" ]
2
2016-12-12T19:27:16.000Z
2019-03-28T16:05:50.000Z
lib/JIRA/REST/Class/Issue/Changelog.pm
mjgardner/JIRA-REST-Class
9d8f065425eef06e42bd2afd734657736580ca41
[ "Artistic-2.0" ]
9
2016-12-07T00:10:54.000Z
2018-01-22T19:02:22.000Z
lib/JIRA/REST/Class/Issue/Changelog.pm
mjgardner/JIRA-REST-Class
9d8f065425eef06e42bd2afd734657736580ca41
[ "Artistic-2.0" ]
5
2016-12-05T21:48:18.000Z
2017-05-26T09:28:24.000Z
package JIRA::REST::Class::Issue::Changelog; use parent qw( JIRA::REST::Class::Abstract ); use strict; use warnings; use 5.010; our $VERSION = '0.13'; our $SOURCE = 'CPAN'; $SOURCE = 'GitHub'; # COMMENT # the line above will be commented out by Dist::Zilla # ABSTRACT: A helper class for L<JIRA::REST::Class|JIRA::REST::Class> that represents the changelog of a JIRA issue as an object. __PACKAGE__->mk_contextual_ro_accessors( qw/ changes / ); sub init { my $self = shift; $self->SUPER::init( @_ ); $self->{data} = $self->issue->get( '?expand=changelog' ); my $changes = $self->{changes} = []; foreach my $change ( @{ $self->data->{changelog}->{histories} } ) { push @$changes, $self->issue->make_object( 'change', { data => $change } ); } return; } =method B<changes> Returns a list of individual changes, as L<JIRA::REST::Class::Issue::Changelog::Change|JIRA::REST::Class::Issue::Changelog::Change> objects. =cut 1; __END__ {{ require "pod/PodUtil.pm"; $OUT .= PodUtil::related_classes($plugin); }}
23.304348
129
0.639925
ed2ffc98636cdb5a5e6cd705443f32656098bcb6
3,909
pl
Perl
extra/cds_blast.pl
dentearl/assemblAnalysis
c8524456dff720d37356c55d7640687415bc1df6
[ "MIT" ]
1
2020-11-12T06:32:26.000Z
2020-11-12T06:32:26.000Z
extra/cds_blast.pl
dentearl/assemblAnalysis
c8524456dff720d37356c55d7640687415bc1df6
[ "MIT" ]
null
null
null
extra/cds_blast.pl
dentearl/assemblAnalysis
c8524456dff720d37356c55d7640687415bc1df6
[ "MIT" ]
null
null
null
#!/usr/bin/perl # Script to calculate how many CDSs are present in an assembly # # Written by Keith Bradnam # This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. # # Last updated by: $Author: keith $ # Last updated on: $Date: 2011/05/03 18:40:29 $ use strict; use warnings; use FAlite; use Getopt::Long; ############################################### # # C o m m a n d l i n e o p t i o n s # ############################################### my $csv; # produce CSV output file of results my $verbose; GetOptions ("csv" => \$csv, "verbose" => \$verbose); # check we have a suitable input file my $usage = "Usage: $0 [options] <cds file> <gzipped assembly file> options: -csv produce a CSV output file of all results -verbose turn on extra output for each CDS match "; die "$usage" unless (@ARGV == 2); my ($cds, $ASSEMBLY) = @ARGV; my ($assembly_ID) = $ASSEMBLY =~ m/(\w\d+)_scaffolds/; # Read sequences from CDS file and store in hash my %cds_sequences; open(my $fh, $cds) or die "Can't open $cds\n"; my $fasta = new FAlite($fh); while (my $entry = $fasta->nextEntry) { my ($id) = $entry->def =~ /^>(\d+)\s+/; $cds_sequences{$id} = $entry->seq; } ################## # BLAST ################## # make suitable output file name for blast & csv results my $output = "$assembly_ID.blast.out"; # format BLAST databases if not already done unless (-s "$ASSEMBLY.xni") {system("xdformat -n -I $ASSEMBLY") == 0 or die "Can't create blast database for $ASSEMBLY\n"} # Run BLAST, but only if no output file already exists my $params = "-S 50 -M 1 -N -1 -Q 3 -R 3 -W 15 -mformat 2 -kap -errors"; unless (-s $output) {system("blastn $ASSEMBLY $cds $params -o $output") && die "Can't run blastn\n"} # want matches at 95% identity my $identity = 95; # main loop over BLAST output open(my $blast, "<", "$output") or die "Can't open $output\n"; while (<$blast>) { my ($qid, $sid, $E, $N, $s1, $s, $len, $idn, $pos, $sim, $pct, $ppos, $qg, $qgl, $sg, $sgl, $qf, $qs, $qe, $sf, $ss, $se, $gr) = split; # skip HSP matches < 95% identity next unless $pct >= $identity; # need to get start/end coordinates and length of match, factoring in that start coordinate is $qe/$se # if match is on negative strand my ($qstart, $qend) = ($qs, $qe); ($qstart, $qend) = ($qe, $qs) if ($qe < $qs); my $qlen = ($qend - $qstart) + 1; # now mask out regions of CDS sequence with '1' corresponding to matching region substr($cds_sequences{$qid}, $qstart-1,$qlen) = ("1" x $qlen); } close($blast); # can now loop through all sequences in %cds_sequences and calculate final results my ($transcriptome_length, $total_match_length, $cds_hits) = (0, 0, 0); foreach my $cds (sort {$a cmp $b or $a <=> $b} keys %cds_sequences){ my $bases = $cds_sequences{$cds} =~ tr/1/1/; $total_match_length += $bases; my $length = length($cds_sequences{$cds}); $transcriptome_length += $length; my $percent = sprintf("%.2f", ($bases / $length) * 100); print "$cds $bases/$length ($percent%)\n" if ($verbose); # count a CDS if present if there is more than 95% of it present $cds_hits++ if $percent >= 95; } # basic output is just four values my $percent = sprintf("%.2f", ($total_match_length / $transcriptome_length) * 100); print "Assembly $assembly_ID) $cds_hits CDSs present out of 176, $total_match_length of $transcriptome_length transcriptome nt present ($percent%)\n"; # do we have CSV output to print if($csv){ my $csv_out; my $csv_file = "$assembly_ID.blast.csv"; open($csv_out, ">", "$csv_file") or die "Can't open $csv_file\n"; print $csv_out "Assembly,Number of CDSs present in assembly,Number of transcriptome nt present in assembly, Percentage of transcriptome present in assembly\n"; print $csv_out "$assembly_ID,$cds_hits,$total_match_length,$percent\n"; close($csv_out); } exit;
32.575
160
0.638015
73fe28e447ff40775c32c5e2a1aafca1900373b2
3,475
pm
Perl
test/perllib/CGI/Session/Driver/DBI.pm
2-ch/2-ch-cgi
130e2d2bf448ddafe175fd9bea57bbd6914bdd9a
[ "Artistic-1.0-Perl" ]
null
null
null
test/perllib/CGI/Session/Driver/DBI.pm
2-ch/2-ch-cgi
130e2d2bf448ddafe175fd9bea57bbd6914bdd9a
[ "Artistic-1.0-Perl" ]
3
2021-10-02T21:08:08.000Z
2022-01-06T16:13:47.000Z
test/perllib/CGI/Session/Driver/DBI.pm
2-ch/2-ch-cgi
130e2d2bf448ddafe175fd9bea57bbd6914bdd9a
[ "Artistic-1.0-Perl" ]
null
null
null
package CGI::Session::Driver::DBI;use strict;use DBI;use Carp;use CGI::Session::Driver;@CGI::Session::Driver::DBI::ISA=("CGI::Session::Driver");$CGI::Session::Driver::DBI::VERSION='4.43';sub init{my$self=shift;if(defined$self->{Handle}){if(ref$self->{Handle}eq 'CODE'){$self->{Handle}=$self->{Handle}->();}else{}}else{$self->{Handle}=DBI->connect($self->{DataSource},$self->{User},$self->{Password},{RaiseError=>1,PrintError=>1,AutoCommit=>1});unless($self->{Handle}){return$self->set_error("init(): couldn't connect to database: ".DBI->errstr);}$self->{_disconnect}=1;}return 1;}sub table_name{my$self=shift;my$class=ref($self)||$self;if((@_==0)&&ref($self)&&($self->{TableName})){return$self->{TableName};}no strict 'refs';if(@_){$self->{TableName}=shift;}unless(defined$self->{TableName}){$self->{TableName}="sessions";}return$self->{TableName};}sub retrieve{my$self=shift;my($sid)=@_;croak"retrieve(): usage error"unless$sid;my$dbh=$self->{Handle};my$sth=$dbh->prepare_cached("SELECT $self->{DataColName} FROM ".$self->table_name." WHERE $self->{IdColName}=?",undef,3);unless($sth){return$self->set_error("retrieve(): DBI->prepare failed with error message ".$dbh->errstr);}$sth->execute($sid)or return$self->set_error("retrieve(): \$sth->execute failed with error message ".$sth->errstr);my($row)=$sth->fetchrow_array();$sth->finish;return 0 unless$row;return$row;}sub store{my$self=shift;my($sid,$datastr)=@_;croak"store(): usage error"unless$sid&&$datastr;my$dbh=$self->{Handle};my$sth=$dbh->prepare_cached("SELECT $self->{IdColName} FROM ".$self->table_name." WHERE $self->{IdColName}=?",undef,3);unless(defined$sth){return$self->set_error("store(): \$dbh->prepare failed with message ".$sth->errstr);}$sth->execute($sid)or return$self->set_error("store(): \$sth->execute failed with message ".$sth->errstr);my$rc=$sth->fetchrow_array;$sth->finish;my$action_sth;if($rc){$action_sth=$dbh->prepare_cached("UPDATE ".$self->table_name." SET $self->{DataColName}=? WHERE $self->{IdColName}=?",undef,3);}else{$action_sth=$dbh->prepare_cached("INSERT INTO ".$self->table_name." ($self->{DataColName}, $self->{IdColName}) VALUES(?, ?)",undef,3);}unless(defined$action_sth){return$self->set_error("store(): \$dbh->prepare failed with message ".$dbh->errstr);}$action_sth->execute($datastr,$sid)or return$self->set_error("store(): \$action_sth->execute failed ".$action_sth->errstr);$action_sth->finish;return 1;}sub remove{my$self=shift;my($sid)=@_;croak"remove(): usage error"unless$sid;my$rc=$self->{Handle}->do('DELETE FROM '.$self->table_name." WHERE $self->{IdColName}= ?",{},$sid);unless($rc){croak"remove(): \$dbh->do failed!";}return 1;}sub DESTROY{my$self=shift;unless(defined$self->{Handle}&&$self->{Handle}->ping){$self->set_error(__PACKAGE__.'::DESTROY(). Database handle has gone away');return;}unless($self->{Handle}->{AutoCommit}){$self->{Handle}->commit;}if($self->{_disconnect}){$self->{Handle}->disconnect;}}sub traverse{my$self=shift;my($coderef)=@_;unless($coderef&&ref($coderef)&&(ref$coderef eq 'CODE')){croak"traverse(): usage error";}my$tablename=$self->table_name();my$sth=$self->{Handle}->prepare_cached("SELECT $self->{IdColName} FROM $tablename",undef,3)or return$self->set_error("traverse(): couldn't prepare SQL statement. ".$self->{Handle}->errstr);$sth->execute()or return$self->set_error("traverse(): couldn't execute statement $sth->{Statement}. ".$sth->errstr);while(my($sid)=$sth->fetchrow_array){$coderef->($sid);}$sth->finish;return 1;}1;
3,475
3,475
0.706187
ed145d19231f6be5d775e45226b7b60945114b10
2,212
pm
Perl
VASP/TBdyn/Internal.pm
vitduck/CPLAS
c9df0946c9e2deb9f32da0cf02bc537bd21d1dcb
[ "BSD-3-Clause" ]
null
null
null
VASP/TBdyn/Internal.pm
vitduck/CPLAS
c9df0946c9e2deb9f32da0cf02bc537bd21d1dcb
[ "BSD-3-Clause" ]
null
null
null
VASP/TBdyn/Internal.pm
vitduck/CPLAS
c9df0946c9e2deb9f32da0cf02bc537bd21d1dcb
[ "BSD-3-Clause" ]
null
null
null
package VASP::TBdyn::Internal; use autodie; use strict; use warnings; use experimental 'signatures'; use PDL; use PDL::Graphics::Gnuplot; use PDL::Stats::TS; use VASP::TBdyn::Color; our @ISA = qw( Exporter ); our @EXPORT = qw( pl_epot_avg pl_epot_err internal ); # dU wrt to reference point sub internal ( $epot ) { $$epot = $$epot - $$epot->at(0); } sub pl_epot_avg ( $cc, $internal ) { my $figure = gpwin( 'x11', persist => 1, raise => 1, enhanced => 1, ); $figure->plot( # plot options { grid => 1, size => 'ratio 0.75', key => 'top right', title => sprintf( "Internal Energy ({/Symbol x} = %.3f)", $$cc->at(0) ), xlabel => 'MD step', ylabel => 'Energy', xrange => '[250:]' }, # gradient ( with => 'lines', dashtype => 1, linewidth => 4, linecolor => [ rgb => $hcolor{ blue } ], ), PDL->new( 1.. $$cc->nelem ), $$internal, # moving average ( with => 'lines', dashtype => 2, linewidth => 3, linecolor => [ rgb => $hcolor{ white } ], legend => 'Moving average', ), PDL->new( 1.. $$cc->nelem ), $$internal->filter_ma( 100 ) ) } sub pl_epot_err ( $cc, $int_error ) { # x-axis: block size my $bsize = PDL->new( 1..$$int_error->nelem ); my $figure = gpwin( 'x11', persist => 1, raise => 1, enhanced => 1, ); $figure->plot( # plot options { key => 'top left spacing 2', title => sprintf( "|z|^{-1/2} * E_pot ({/Symbol x} = %.3f)", $$cc->at(0) ), xlabel => 'N_b', ylabel => 'Standard Error', size => 'ratio 0.75', grid => 1 }, ( with => 'point', linewidth => 2, pointtype => 4, linecolor => [ rgb => $hcolor{ 'blue' } ], ), $bsize, $$int_error ) } 1
24.043478
90
0.414105
ed21396d4e4c1f9daa14bde18902ba12f40d988e
1,368
t
Perl
release/src/router/ipset/tests/setlist.t
ghsecuritylab/tomato-sabai
9027a38297d32e97dd386499cca4a583e25d1f9d
[ "Apache-2.0" ]
278
2015-11-03T03:01:20.000Z
2022-01-20T18:21:05.000Z
release/src/router/ipset/tests/setlist.t
mon-routeur/Firmware
b25fef7cdab7fe306853baa471ad4a96a9da4600
[ "FSFAP" ]
374
2015-11-03T12:37:22.000Z
2021-12-17T14:18:08.000Z
release/src/router/ipset/tests/setlist.t
mon-routeur/Firmware
b25fef7cdab7fe306853baa471ad4a96a9da4600
[ "FSFAP" ]
96
2015-11-22T07:47:26.000Z
2022-01-20T19:52:19.000Z
# Setlist: Create base set foo 0 ipset -N foo ipmap --from 2.0.0.1 --to 2.1.0.0 # Setlist: Create base set bar 0 ipset -N bar iphash # Setlist: Create setlist kind of set 0 ipset -N test setlist # Setlist: Add foo set to setlist 0 ipset -A test foo # Setlist: Test foo set in setlist 0 ipset -T test foo # Setlist: Test nonexistent set in setlist 1 ipset -T test nonexistent # Setlist: Try to delete foo set 1 ipset -X foo # Setlist: Add bar set to setlist, after foo 0 ipset -A test bar # Setlist: Test bar,after,foo 0 ipset -T test bar,after,foo # Setlist: Test foo,before,bar 0 ipset -T test foo,before,bar # Setlist: Test bar,before,foo 1 ipset -T test bar,before,foo # Setlist: Test foo,after,bar 1 ipset -T test foo,after,bar # Setlist: Save sets 0 ipset -S > setlist.t.restore # Setlist: Delete bar,before,foo 1 ipset -D test bar,before,foo # Setlist: Delete foo,after,bar 1 ipset -D test foo,after,bar # Setlist: Delete bar,after,foo 0 ipset -D test bar,after,foo # Setlist: Flush test set 0 ipset -F test # Setlist: Delete test set 0 ipset -X test # Setlist: Delete all sets 0 ipset -X # Setlist: Restore saved sets 0 ipset -R < setlist.t.restore # Setlist: List set 0 ipset -L test > .foo # Setlist: Check listing 0 diff .foo setlist.t.list0 && rm .foo # Setlist: Flush all sets 0 ipset -F # Setlist: Delete all sets 0 ipset -X && rm setlist.t.restore # eof
27.36
48
0.723684
ed2256c0e0100f35099a3e51051b7467cd03f873
256
pl
Perl
CodeWars/Multiply.pl
lcols19/Algorithm_Solving
2e4c174b1cd4374910038e7ffbc8a52a09ebe2b8
[ "MIT" ]
null
null
null
CodeWars/Multiply.pl
lcols19/Algorithm_Solving
2e4c174b1cd4374910038e7ffbc8a52a09ebe2b8
[ "MIT" ]
null
null
null
CodeWars/Multiply.pl
lcols19/Algorithm_Solving
2e4c174b1cd4374910038e7ffbc8a52a09ebe2b8
[ "MIT" ]
null
null
null
# This code does not execute properly. Try to figure out why. package Solution; use 5.030; use strict; use warnings; use Exporter qw(import); our @EXPORT_OK = qw(multiply); sub multiply { my $a = shift; my $b = shift; return ($a * $b); } ;
14.222222
61
0.644531
ed11113bf4624798a7f74a6e3650235c85701389
5,851
pl
Perl
perly2gmr.pl
atrodo/Plywood
f48a9819ef725e40add5d26e6da2ff91abdcb50b
[ "Artistic-2.0" ]
4
2020-08-12T16:40:23.000Z
2020-08-17T14:52:28.000Z
perly2gmr.pl
atrodo/Plywood
f48a9819ef725e40add5d26e6da2ff91abdcb50b
[ "Artistic-2.0" ]
1
2020-08-12T17:06:37.000Z
2020-08-14T03:30:33.000Z
perly2gmr.pl
atrodo/Plywood
f48a9819ef725e40add5d26e6da2ff91abdcb50b
[ "Artistic-2.0" ]
null
null
null
#!/usr/bin/env perl use v5.18; my %tokens; my @order; my $rule_re = qr< ( (?:[^{] | '{ | {')*? ) \s* (/[*] .*? [*]/)? \s* (?: { (.*) } )? \s* ;? \s* $ >xms; while (<>) { chomp; if (m/%start \s grammar/xms .. m/^%%/xms) { if (m/^%(token | type | nonassoc | left | right)/xms) { my $type = $1; my @syms = split; shift @syms; shift @syms if $syms[0] =~ m/<\w+>/xms; foreach my $sym (@syms) { my $re = $sym; $re =~ s/^'(.*)'$/$1/g; $re =~ s/([\*+?.()[\]{}$ ])/[$1]/xmsg; $re =~ s/(\^)/\$1/xmsg; $tokens{$sym} = { type => $type, sym => $sym, rules => [qr/$re/i], }; push @order, $sym; } } } if (my $seq = m/^\w+ \s* :/xms .. m!^(?: [/][*] | (?:\t|[ ]{0,8}); )!xms) { state $rule = ''; if ($seq == 1) { #say $rule; $rule = ''; } $rule .= "$_\n"; if ($seq =~ m/E0$/xms) { my ($sym, $rules) = $rule =~ m/^(\w+) \s* : (.*)/xms; my $token = { type => 'nonterm', sym => $sym }; $tokens{$sym} = $token; push @order, $sym; #map { my %a = ( line => $_ ); @a{qw/raw_rule comment code/} = $_ =~ m/ $rule_re /xms; \%a } my @rules = map { { line => $_, raw_rule => '', comment => '', code => '', } } map { $_ =~ s/\s+/ /xmsg; $_ } map { $_ =~ s/; \s* $//xmsg; $_ } split(m/^(?:\t|\s{0,8})[|]/xms, $rules); foreach my $rule ( @rules ) { my @stack; my @line = split //, $rule->{line}; for (my $i; $i < $#line; $i++) { my $chr = $line[$i]; if ( @stack ) { if ( $stack[0] eq 'comment') { $rule->{comment} .= $chr; if ( $chr eq '*' && $line[$i+1] eq '/') { $rule->{comment} .= '/'; $i++; shift @stack; } next; } if ( $stack[0] eq 'code') { $rule->{code} .= $chr; if ($chr eq q[\\]) { $rule->{code} .= $line[$i+1]; $i++; next; } if ($chr eq '/' && $line[$i+1] eq '*') { unshift @stack, 'comment'; $rule->{comment} .= '/*'; $i++; next; } if ( @stack == 1 && $chr eq '}') { $rule->{code} .= ' '; pop @stack; } elsif ( $stack[-1] eq $chr ) { pop @stack; } elsif ( $chr eq q['] ) { push @stack, q[']; } elsif ( $chr eq q["] ) { push @stack, q["]; } elsif ( $chr eq q[{] ) { push @stack, q[}]; } next; } if ( $stack[0] eq 'rule') { if ($chr eq q[\\]) { $rule->{raw_rule} .= $line[$i+1]; $i++; next; } if ( $stack[-1] eq $chr ) { pop @stack; } if ( @stack == 1 ) { pop @stack; next; } $rule->{raw_rule} .= $chr; next; } } if ($chr eq '/' && $line[$i+1] eq '*') { push @stack, 'comment'; $rule->{comment} .= '/*'; $i++; next; } if ($chr eq q['] ) { push @stack, 'rule'; push @stack, q[']; next; } if ($chr eq '{' ) { push @stack, 'code'; $rule->{code} .= '{'; next; } $rule->{raw_rule} .= $chr; } my @terms = split m/\s+/, $rule->{raw_rule}; #warn Dumper(\@terms); my $result = []; while (@terms) { my $term = shift @terms; if ($term eq '') { } elsif ($term =~ m/^% prec $/xms) { push @$result, "{prec " . shift(@terms) . "}"; } elsif ( $term =~ m/(['"])(.*)\1/xms) { push @$result, $2; } elsif (exists $tokens{$term}) { push @$result, "<$term>"; } else { push @$result, "$term"; } } $rule->{rule} = join(" ", @$result); } #say Dumper(\@rules); #say $rules; $token->{rules} = [ @rules ]; } } }; use Data::Dumper; #warn Dumper(@order); say 'my $grammar = {'; my %seen; foreach my $sym (@order) { next if $seen{$sym}; $seen{$sym} = 1; local $Data::Dumper::Indent = 1; #local $Data::Dumper::Varname = $sym; local $Data::Dumper::Sortkeys = 1; my $re = $sym; $re =~ s/^'(.*)'$/$1/g; $re =~ s/([\^*+?.()[\]{}$ ])/[$1]/xmsg; my $token = $tokens{$sym}; my @rules = ( "qr/$re/i" ); @rules = @{ $token->{rules} } if defined $token->{rules}; my $dump = Dumper($token); $dump =~ s[[*]/][\\*\\/]xmsg; #$dump =~ s/^/# /xmsg; $dump =~ s/\A\$VAR1\s=\s{/ {/xms; $dump =~ s/;\Z/,/xms; #$dump =~ s[\A][\n=c\n]xms; #$dump =~ s[\Z][\n=cut\n]xms; #say $dump; #say sprintf(qq[ %-16s => \[], qq["$sym"]); $sym =~ s/^'|'$//g; say qq['$sym' => $dump\n]; foreach my $rule ( @rules ) { #say qq[\t\t ] . (ref $rule ? qq['$rule->{rule}'] : $rule) . qq[,]; } #say "\t\t ],"; } say "};"; #say "\nmodule.exports = grammar";
21.511029
98
0.309862
73d48fb157239ec93c7014daad0433f578d42587
431
pl
Perl
perl/lib/unicore/lib/Nv/7_2.pl
JyothsnaMididoddi26/xampp
8f34d7fa7c2e6cc37fe4ece5e6886dc4e5c0757b
[ "Apache-2.0" ]
1
2017-01-31T08:49:16.000Z
2017-01-31T08:49:16.000Z
xampp/perl/lib/unicore/lib/Nv/7_2.pl
silent88/Biographies-du-Fontenay
af4567cb6b78003daa72c37b5ac9f5611a360a9f
[ "MIT" ]
2
2020-07-17T00:13:41.000Z
2021-05-08T17:01:54.000Z
perl/lib/unicore/lib/Nv/7_2.pl
Zolhyp/Plan
05dbf6a650cd54f855d1731dee70098c5c587339
[ "Apache-2.0" ]
null
null
null
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! # This file is machine-generated by mktables from the Unicode # database, Version 6.1.0. Any changes made here will be lost! # !!!!!!! INTERNAL PERL USE ONLY !!!!!!! # This file is for internal use by core Perl only. The format and even the # name or existence of this file are subject to change without notice. Don't # use it directly. return <<'END'; 0F2D END
30.785714
78
0.645012
73fc12aa4be4331ea5a71de8dd532f4d17c09bad
4,316
pm
Perl
lib/Koha/BiblioUtils.pm
cse-library/koha
84c0968e5a43328817d5eee912763797949b9efb
[ "CECILL-B" ]
null
null
null
lib/Koha/BiblioUtils.pm
cse-library/koha
84c0968e5a43328817d5eee912763797949b9efb
[ "CECILL-B" ]
null
null
null
lib/Koha/BiblioUtils.pm
cse-library/koha
84c0968e5a43328817d5eee912763797949b9efb
[ "CECILL-B" ]
null
null
null
package Koha::BiblioUtils; # This contains functions to do with managing biblio records. # Copyright 2014 Catalyst IT # # This file is part of Koha. # # Koha is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 3 of the License, or (at your option) any later # version. # # Koha is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with Koha; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. =head1 NAME Koha::BiblioUtils - contains fundamental biblio-related functions =head1 DESCRIPTION This contains functions for normal operations on biblio records. Note: really, C4::Biblio does the main functions, but the Koha namespace is the new thing that should be used. =cut use C4::Biblio; # EmbedItemsInMarcBiblio use Koha::MetadataIterator; use Koha::Database; use Modern::Perl; use Data::Dumper; # TODO remove use base qw(Koha::MetadataRecord); __PACKAGE__->mk_accessors(qw( record schema id datatype )); =head1 FUNCTIONS =head2 new my $biblio = Koha::BiblioUtils->new($marc_record, [$biblionumber]); Creates an instance of C<Koha::BiblioUtils> based on the marc record. If known, the biblionumber can be provided too. =cut sub new { my $class = shift; my $record = shift; my $biblionumber = shift; my $self = $class->SUPER::new( { 'record' => $record, 'schema' => lc C4::Context->preference("marcflavour"), 'id' => $biblionumber, 'datatype' => 'biblio', } ); bless $self, $class; return $self; } =head2 get_from_biblionumber my $biblio = Koha::BiblioUtils->get_from_biblionumber($biblionumber, %options); This will give you an instance of L<Koha::BiblioUtils> that is the biblio that you requested. Options are: =over 4 =item C<$item_data> If true, then the item data will be merged into the record when it's loaded. =back It will return C<undef> if the biblio doesn't exist. =cut sub get_from_biblionumber { my ($class, $bibnum, %options) = @_; my $marc = $class->get_marc_biblio($bibnum, %options); return $class->new($marc, $bibnum); } =head2 get_all_biblios_iterator my $it = Koha::BiblioUtils->get_all_biblios_iterator(); This will provide an iterator object that will, one by one, provide the Koha::BiblioUtils of each biblio. This will include the item data. The iterator is a Koha::MetadataIterator object. =cut sub get_all_biblios_iterator { my $database = Koha::Database->new(); my $schema = $database->schema(); my $rs = $schema->resultset('Biblio')->search( {}, { columns => [qw/ biblionumber /] } ); my $next_func = sub { # Warn and skip bad records, otherwise we break the loop while (1) { my $row = $rs->next(); return if !$row; my $marc = C4::Biblio::GetMarcBiblio({ biblionumber => $row->biblionumber, embed_items => 1 }); my $next = eval { __PACKAGE__->new($marc, $row->biblionumber); }; if ($@) { warn "Something went wrong reading record for biblio $row->biblionumber: $@\n"; next; } return $next; } }; return Koha::MetadataIterator->new($next_func); } =head2 get_marc_biblio my $marc = Koha::BiblioUtils->get_marc_biblio($bibnum, %options); This non-class function fetches the MARC::Record for the given biblio number. Nothing is returned if the biblionumber couldn't be found (or it somehow has no MARC data.) Options are: =over 4 =item item_data If set to true, item data is embedded in the record. Default is to not do this. =back =cut sub get_marc_biblio { my ($class, $bibnum, %options) = @_; return C4::Biblio::GetMarcBiblio({ biblionumber => $bibnum, embed_items => ($options{item_data} ? 1 : 0 ) }); } 1;
25.538462
95
0.662651
73f412d221dd3c057ed4d4c1ef0cf8caae181daa
7,063
t
Perl
Load/t/mbio/results_table.t
VEuPathDB/ApiCommonData
881931d6745eb63c4f97892401af5bdb8f4fd5fa
[ "Apache-2.0" ]
1
2022-03-15T08:20:22.000Z
2022-03-15T08:20:22.000Z
Load/t/mbio/results_table.t
VEuPathDB/ApiCommonData
881931d6745eb63c4f97892401af5bdb8f4fd5fa
[ "Apache-2.0" ]
3
2019-12-17T17:33:51.000Z
2022-03-23T13:32:13.000Z
Load/t/mbio/results_table.t
VEuPathDB/ApiCommonData
881931d6745eb63c4f97892401af5bdb8f4fd5fa
[ "Apache-2.0" ]
1
2022-03-15T08:20:23.000Z
2022-03-15T08:20:23.000Z
use strict; use warnings; use lib "$ENV{GUS_HOME}/lib/perl"; use ApiCommonData::Load::MBioResultsTable; use ApiCommonData::Load::MBioResultsTable::AsText; use ApiCommonData::Load::MBioResultsTable::AsGus; use ApiCommonData::Load::MBioResultsTable::AsEntities; use Test::More; use Test::Exception; use YAML; use List::Util qw/uniq/; my $ampliconTaxaPath=<<"EOF"; s1 s2 k;p;c;o;f;g;s 11111.0 12111.0 different_kingdom 13111.0 14111.0 yet_different_kingdom 1111.0 EOF my $wgsTaxaPath=<<"EOF"; s1 s2 k__K|p__P|c__C|o__O|f__F|g__G|s__S 15111.0 16111.0 k__DifferentKingdom 0.1 0.2 k__yet_different_kingdom 1111.0 0 EOF my $level4ECsPath=<<"EOF"; s1 s2 UNGROUPED 0.1 0.1 1.1.1.103: L-threonine 3-dehydrogenase|g__Escherichia.s__Escherichia_coli 17111.0 18111.0 1.1.1.103: L-threonine 3-dehydrogenase|unclassified 19111.0 20111.0 1.1.1.103: L-threonine 3-dehydrogenase 21111.0 22111.0 7.2.1.1: NO_NAME 23111.0 24111.0 8.2.1.1: NO_NAME 23111.0 0.0 EOF my $pathwayAbundancesPath=<<"EOF"; s1 s2 ANAEROFRUCAT-PWY: homolactic fermentation 25111.0 26111.0 ANAEROFRUCAT-PWY: homolactic fermentation|g__Escherichia.s__Escherichia_coli 27111.0 28111.0 ANAEROFRUCAT-PWY: homolactic fermentation|unclassified 29111.0 30111.0 BNAEROFRUCAT-PWY: homolactic fermentation|unclassified 29111.0 0.0 EOF my $pathwayCoveragesPath=<<"EOF"; s1 s2 ANAEROFRUCAT-PWY: homolactic fermentation 0.31111 0.32111 ANAEROFRUCAT-PWY: homolactic fermentation|g__Escherichia.s__Escherichia_coli 0.33111 0.34111 ANAEROFRUCAT-PWY: homolactic fermentation|unclassified 0.35111 0.36111 BNAEROFRUCAT-PWY: homolactic fermentation|unclassified 0.35111 0.0 EOF my ($ampliconTaxaTable, $wgsTaxaTable, $level4ECsTable, $pathwaysTable); sub setUpWithClass { my ($class) = @_; $ampliconTaxaTable = $class->ampliconTaxa(\$ampliconTaxaPath); $wgsTaxaTable = $class->wgsTaxa(\$wgsTaxaPath); $level4ECsTable = $class->wgsFunctions("level4EC",\$level4ECsPath); $pathwaysTable = $class->wgsPathways(\$pathwayAbundancesPath, \$pathwayCoveragesPath); } subtest "parse the input" => sub { setUpWithClass('ApiCommonData::Load::MBioResultsTable'); like(Dump($ampliconTaxaTable->{rows}), qr/k;p;c;o;f;g;s/, "Amplicon taxa strings are not modified"); like(Dump($wgsTaxaTable->{rows}), qr/K;P;C;O;F;G;S/, "WGS taxa strings are converted from humann format"); like(Dump($ampliconTaxaTable->{rows}), qr/different_kingdom/, "Amplicon taxa aggregates are preserved"); unlike(Dump($wgsTaxaTable->{rows}), qr/DifferentKingdom/, "WGS taxa aggregates are skipped"); is_deeply($_->{samples}, ["s1", "s2"], "Samples") for ($ampliconTaxaTable , $wgsTaxaTable, $level4ECsTable, $pathwaysTable); like(Dump($level4ECsTable->{rows}), qr/1.1.1.103/, "Mentions bits of row headers: 1.1.1.103"); unlike(Dump($level4ECsTable->{rows}), qr/UNGROUPED/, "Skips ungrouped"); like(Dump($pathwaysTable->{rows}), qr/ANAEROFRUCAT-PWY/, "Mentions bits of row headers: ANAEROFRUCAT-PWY"); subtest "table dump mentions bits of data" => sub { my $out = ""; like(Dump($ampliconTaxaTable->{data}), qr/${_}111/, "amplicon taxa: $_") for ("11".."14"); like(Dump($wgsTaxaTable->{data}), qr/${_}111/, "WGS taxa: $_") for ("15".."16"); like(Dump($level4ECsTable->{data}), qr/${_}111/, "level4ECs: $_") for ("17".."24"); like(Dump($pathwaysTable->{data}), qr/${_}111/, "pathways: $_") for ("25".."36"); }; }; subtest "writeTabData mentions bits of data" => sub { setUpWithClass('ApiCommonData::Load::MBioResultsTable::AsText'); my $out = ""; $ampliconTaxaTable->writeTabData(\$out); like($out, qr/${_}111/, "amplicon taxa: $_") for ("11".."14"); $wgsTaxaTable->writeTabData(\$out); like($out, qr/${_}111/, "WGS taxa: $_") for ("15".."16"); $level4ECsTable->writeTabData(\$out); like($out, qr/${_}111/, "level4ECs: $_") for ("17".."24"); $pathwaysTable->writeTabData(\$out); like($out, qr/${_}111/, "pathways: $_") for ("25".."36"); }; subtest "writeBiom mentions bits of data" => sub { setUpWithClass('ApiCommonData::Load::MBioResultsTable::AsText'); my $out = ""; $ampliconTaxaTable->writeBiom(\$out); like($out, qr/${_}111/, "amplicon taxa: $_") for ("11".."14"); $wgsTaxaTable->writeBiom(\$out); like($out, qr/${_}111/, "WGS taxa: $_") for ("15".."16"); $level4ECsTable->writeBiom(\$out); like($out, qr/${_}111/, "level4ECs: $_") for ("17".."24"); $pathwaysTable->writeBiom(\$out); like($out, qr/${_}111/, "pathways: $_") for ("25".."36"); }; my %sd = ( s1 => { property => "aValue" }, s2 => { property => "aDifferentValue", anotherProperty => "anotherValue"}, ); my @sd = uniq map {%{$sd{$_}}} qw/s1 s2/; subtest "writeTabSampleDetails mentions sample details" => sub { setUpWithClass('ApiCommonData::Load::MBioResultsTable::AsText'); my $out = ""; $_->addSampleDetails(\%sd) for ($ampliconTaxaTable, $wgsTaxaTable, $level4ECsTable, $pathwaysTable); $ampliconTaxaTable->writeTabSampleDetails(\$out); like($out, qr/${_}/, "amplicon taxa: $_") for @sd; $wgsTaxaTable->writeTabSampleDetails(\$out); like($out, qr/${_}/, "WGS taxa: $_") for @sd; $level4ECsTable->writeTabSampleDetails(\$out); like($out, qr/${_}/, "level4ECs: $_") for @sd; $pathwaysTable->writeTabSampleDetails(\$out); like($out, qr/${_}/, "pathways: $_") for @sd; }; subtest "writeBiom mentions sample details" => sub { setUpWithClass('ApiCommonData::Load::MBioResultsTable::AsText'); my $out = ""; $_->addSampleDetails(\%sd) for ($ampliconTaxaTable, $wgsTaxaTable, $level4ECsTable, $pathwaysTable); $ampliconTaxaTable->writeBiom(\$out); like($out, qr/${_}/, "amplicon taxa: $_") for @sd; $wgsTaxaTable->writeBiom(\$out); like($out, qr/${_}/, "WGS taxa: $_") for @sd; $level4ECsTable->writeBiom(\$out); like($out, qr/${_}/, "level4ECs: $_") for @sd; $pathwaysTable->writeBiom(\$out); like($out, qr/${_}/, "pathways: $_") for @sd; }; subtest "submitToGus mentions bits of data" => sub { setUpWithClass('ApiCommonData::Load::MBioResultsTable::AsGus'); my $protocolAppNodeIdsForSamples = { "s1" => "s1pan111", "s2" => "s2pan111" }; my $out = ""; my @out = (); $ampliconTaxaTable->submitToGus(sub{}, sub{}, sub{push @out, $_[1];}, $protocolAppNodeIdsForSamples); $out = Dump @out; like($out, qr/${_}111/, "amplicon taxa: $_") for ("11".."14", "s1pan", "s2pan"); @out = (); $wgsTaxaTable->submitToGus(sub{}, sub{}, sub{push @out, $_[1];}, $protocolAppNodeIdsForSamples); $out = Dump @out; like($out, qr/${_}111/, "WGS taxa: $_") for ("15".."16", "s1pan", "s2pan"); @out = (); $level4ECsTable->submitToGus(sub{}, sub{}, sub{push @out, $_[1];}, $protocolAppNodeIdsForSamples); $out = Dump @out; like($out, qr/${_}111/, "level4ECs: $_") for ("17".."24", "s1pan", "s2pan"); @out = (); $pathwaysTable->submitToGus(sub{}, sub{}, sub{push @out, $_[1];}, $protocolAppNodeIdsForSamples); $out = Dump @out; like($out, qr/${_}111/, "pathways: $_") for ("25".."36", "s1pan", "s2pan"); }; done_testing;
34.622549
126
0.664732
ed348c721f04cfb1069cadf0f1e97b7e1da6db3a
916
pl
Perl
posda/posdatools/Posda/bin/UpdateNameChain.pl
UAMS-DBMI/PosdaTools
7d33605da1b88e4787a1368dbecaffda1df95e5b
[ "Apache-2.0" ]
6
2019-01-17T15:47:44.000Z
2022-02-02T16:47:25.000Z
posda/posdatools/Posda/bin/UpdateNameChain.pl
UAMS-DBMI/PosdaTools
7d33605da1b88e4787a1368dbecaffda1df95e5b
[ "Apache-2.0" ]
23
2016-06-08T21:51:36.000Z
2022-03-02T08:11:44.000Z
posda/posdatools/Posda/bin/UpdateNameChain.pl
UAMS-DBMI/PosdaTools
7d33605da1b88e4787a1368dbecaffda1df95e5b
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/perl -w use strict; use Posda::DB::PosdaFilesQueries; my $q = PosdaDB::Queries->GetQueryInstance('ListOfElementSignaturesAndVrs'); my $u = PosdaDB::Queries->GetQueryInstance('UpdateNameChain'); my $usage = <<EOF; UpdateNameChain.pl EOF unless($#ARGV == -1) { die $usage } $q->RunQuery( sub { my($row) = @_; my($sig, $vr, $nc, $count) = @$row; unless(defined $nc) {$nc = '<undef>'} open CHILD, "CalculateNameChainForSig.pl '$sig'|" or die "Can't open child"; my($tag, $vrc, $nnc); while(my $line = <CHILD>){ chomp $line; ($tag, $vrc, $nnc) = split /\|/, $line; } unless(defined $nnc) { print STDERR "no name chain returned for $sig\n"; return; } if($nnc eq $nc) { print STDERR "no change for $tag ($nc)\n"; return; } print "$tag: $nc => $nnc\n"; $u->RunQuery(sub {}, sub {}, $nnc, $sig, $vr) }, sub {}, );
26.941176
80
0.562227
73f3fe09deb03e41376415eefea29c372953aed5
4,642
pl
Perl
perl/vendor/lib/auto/share/dist/DateTime-Locale/en-SC.pl
luiscarlosg27/xampp
c295dbdd435c9c62fbd4cc6fc42097bea7a900a0
[ "Apache-2.0" ]
2
2021-07-24T12:46:49.000Z
2021-08-02T08:37:53.000Z
perl/vendor/lib/auto/share/dist/DateTime-Locale/en-SC.pl
luiscarlosg27/xampp
c295dbdd435c9c62fbd4cc6fc42097bea7a900a0
[ "Apache-2.0" ]
null
null
null
perl/vendor/lib/auto/share/dist/DateTime-Locale/en-SC.pl
luiscarlosg27/xampp
c295dbdd435c9c62fbd4cc6fc42097bea7a900a0
[ "Apache-2.0" ]
null
null
null
{ am_pm_abbreviated => [ "am", "pm", ], available_formats => { Bh => "h B", Bhm => "h:mm B", Bhms => "h:mm:ss B", E => "ccc", EBhm => "E, h:mm B", EBhms => "E, h:mm:ss B", EHm => "E HH:mm", EHms => "E HH:mm:ss", Ed => "E d", Ehm => "E h:mm a", Ehms => "E h:mm:ss a", Gy => "y G", GyMMM => "MMM y G", GyMMMEd => "E, d MMM y G", GyMMMd => "d MMM y G", H => "HH", Hm => "HH:mm", Hms => "HH:mm:ss", Hmsv => "HH:mm:ss v", Hmv => "HH:mm v", M => "L", MEd => "E, dd/MM", MMM => "LLL", MMMEd => "E, d MMM", "MMMMW-count-one" => "'week' W 'of' MMMM", "MMMMW-count-other" => "'week' W 'of' MMMM", MMMMd => "d MMMM", MMMd => "d MMM", MMdd => "dd/MM", Md => "dd/MM", d => "d", h => "h a", hm => "h:mm a", hms => "h:mm:ss a", hmsv => "h:mm:ss a v", hmv => "h:mm a v", ms => "mm:ss", y => "y", yM => "MM/y", yMEd => "E, dd/MM/y", yMMM => "MMM y", yMMMEd => "E, d MMM y", yMMMM => "MMMM y", yMMMd => "d MMM y", yMd => "dd/MM/y", yQQQ => "QQQ y", yQQQQ => "QQQQ y", "yw-count-one" => "'week' w 'of' Y", "yw-count-other" => "'week' w 'of' Y", }, code => "en-SC", date_format_full => "EEEE, d MMMM y", date_format_long => "d MMMM y", date_format_medium => "d MMM y", date_format_short => "dd/MM/y", datetime_format_full => "{1} 'at' {0}", datetime_format_long => "{1} 'at' {0}", datetime_format_medium => "{1}, {0}", datetime_format_short => "{1}, {0}", day_format_abbreviated => [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", ], day_format_narrow => [ "M", "T", "W", "T", "F", "S", "S", ], day_format_wide => [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", ], day_stand_alone_abbreviated => [ "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", ], day_stand_alone_narrow => [ "M", "T", "W", "T", "F", "S", "S", ], day_stand_alone_wide => [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", ], era_abbreviated => [ "BC", "AD", ], era_narrow => [ "B", "A", ], era_wide => [ "Before Christ", "Anno Domini", ], first_day_of_week => 1, glibc_date_1_format => "%a %b %e %H:%M:%S %Z %Y", glibc_date_format => "%m/%d/%y", glibc_datetime_format => "%a %b %e %H:%M:%S %Y", glibc_time_12_format => "%I:%M:%S %p", glibc_time_format => "%H:%M:%S", language => "English", month_format_abbreviated => [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ], month_format_narrow => [ "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D", ], month_format_wide => [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ], month_stand_alone_abbreviated => [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", ], month_stand_alone_narrow => [ "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D", ], month_stand_alone_wide => [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", ], name => "English Seychelles", native_language => "English", native_name => "English Seychelles", native_script => undef, native_territory => "Seychelles", native_variant => undef, quarter_format_abbreviated => [ "Q1", "Q2", "Q3", "Q4", ], quarter_format_narrow => [ 1, 2, 3, 4, ], quarter_format_wide => [ "1st quarter", "2nd quarter", "3rd quarter", "4th quarter", ], quarter_stand_alone_abbreviated => [ "Q1", "Q2", "Q3", "Q4", ], quarter_stand_alone_narrow => [ 1, 2, 3, 4, ], quarter_stand_alone_wide => [ "1st quarter", "2nd quarter", "3rd quarter", "4th quarter", ], script => undef, territory => "Seychelles", time_format_full => "HH:mm:ss zzzz", time_format_long => "HH:mm:ss z", time_format_medium => "HH:mm:ss", time_format_short => "HH:mm", variant => undef, version => 37, }
16.941606
51
0.44679
73f086a8bff9da3075b0fcc2fac2e16fc7c38a00
998
pm
Perl
lib/Parse/Sieve/Factory/RFC3894.pm
tremble/perl-Parse-Sieve
ac89195ca8c636833636517f4afba5e7f09cc067
[ "Artistic-1.0-Perl" ]
1
2019-08-21T20:10:48.000Z
2019-08-21T20:10:48.000Z
lib/Parse/Sieve/Factory/RFC3894.pm
tremble/perl-Parse-Sieve
ac89195ca8c636833636517f4afba5e7f09cc067
[ "Artistic-1.0-Perl" ]
null
null
null
lib/Parse/Sieve/Factory/RFC3894.pm
tremble/perl-Parse-Sieve
ac89195ca8c636833636517f4afba5e7f09cc067
[ "Artistic-1.0-Perl" ]
null
null
null
package Parse::Sieve::Factory::RFC3894; # $URL$ # $Rev$ # $Date$ # $Id$ # # Copyright 2010 Mark Chappell - <tremble@tremble.org.uk> # # This program is free software; you can redistribute # it and/or modify it under the same terms as Perl itself. # # The full text of the license can be found in the # LICENSE file included with this module. # use strict; use warnings; use vars qw($VERSION); $VERSION = '1.00'; use Parse::Sieve::Factory; use Parse::Sieve::Argument; # 5. IANA Considerations # Capability name: copy # Capability keyword: copy # 3. ":copy" extension to the "fileinto" and "redirect" commands # Syntax: "fileinto" [":copy"] <folder: string> # "redirect" [":copy"] <address: string> { my $copy = new Parse::Sieve::Argument( name => 'copy', tag => ':copy', type => 'optional', requires => 'copy' ); Parse::Sieve::Factory::registerCommandArguments( 'fileinto', ( $copy )); Parse::Sieve::Factory::registerCommandArguments( 'redirect', ( $copy )); } 1;
20.791667
64
0.665331
73f69d4778f547fb019c02c872063a1e5e2ad3d4
496
pm
Perl
t/lib/LazyTest.pm
kazhiramatsu/Class-Attribute
f4de9f0f2e494bf9fa142979114ade0b83b4da40
[ "Artistic-1.0" ]
null
null
null
t/lib/LazyTest.pm
kazhiramatsu/Class-Attribute
f4de9f0f2e494bf9fa142979114ade0b83b4da40
[ "Artistic-1.0" ]
null
null
null
t/lib/LazyTest.pm
kazhiramatsu/Class-Attribute
f4de9f0f2e494bf9fa142979114ade0b83b4da40
[ "Artistic-1.0" ]
null
null
null
package LazyTest; use Class::Attribute; has 'a' => ( is => 'rw', lazy => 1, default => sub { 1; } ); has 'b' => ( is => 'rw', lazy => 1, default => 2 ); has 'c' => ( is => 'rw', lazy => 1, builder => '_build_c' ); sub _build_c { 3; } has 'd' => ( is => 'rw', lazy => 1, default => 1 ); has 'e' => ( is => 'rw', lazy => 1, default => 0 ); has 'f' => ( is => 'rw', lazy => 1, default => undef ); 1;
10.553191
26
0.372984
ed11bf6d73b56e6f855b52e1e178403ac6980112
3,590
pl
Perl
posda/posdatools/Posda/bin/BackgroundCompareDupSopSeriesList.pl
UAMS-DBMI/PosdaTools
7d33605da1b88e4787a1368dbecaffda1df95e5b
[ "Apache-2.0" ]
6
2019-01-17T15:47:44.000Z
2022-02-02T16:47:25.000Z
posda/posdatools/Posda/bin/BackgroundCompareDupSopSeriesList.pl
UAMS-DBMI/PosdaTools
7d33605da1b88e4787a1368dbecaffda1df95e5b
[ "Apache-2.0" ]
23
2016-06-08T21:51:36.000Z
2022-03-02T08:11:44.000Z
posda/posdatools/Posda/bin/BackgroundCompareDupSopSeriesList.pl
UAMS-DBMI/PosdaTools
7d33605da1b88e4787a1368dbecaffda1df95e5b
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/perl -w use strict; use File::Temp qw/ tempfile /; use Posda::DB::PosdaFilesQueries; use Debug; my $dbg = sub{print STDERR @_}; my $usage = <<EOF; BackgroundCompareDupSopSeriesList.pl <report_file_name> <notify_email> or BackgroundCompareDupSopSeriesList.pl -h Generates a csv report file Sends email when done Expect input lines in following format: <series_instance_uid> EOF unless($#ARGV == 1 ){ die $usage } my $query = PosdaDB::Queries->GetQueryInstance("DuplicateSopsInSeries"); my $get_file = PosdaDB::Queries->GetQueryInstance("FilePathByFileId"); my @SeriesList; while(my $line = <STDIN>){ chomp $line; push @SeriesList, $line; } my @CompareOperations; Op: for my $i (0 .. $#SeriesList){ my $series_inst = $SeriesList[$i]; my %data; $query->RunQuery( sub{ my($row) = @_; my($sop_inst, $import_time, $file_id) = @$row; if( exists($data{$sop_inst}->{$file_id}) && $data{$sop_inst}->{$file_id} le $import_time ){ return; } else { $data{$sop_inst}->{$file_id} = $import_time; } }, sub { }, $series_inst ); my $sop_inst = [keys %data]->[0]; unless(defined $sop_inst) { next Op } my @file_id_list = sort { $data{$sop_inst}->{$a} cmp $data{$sop_inst}->{$b} } keys %{$data{$sop_inst}}; for my $f (0 .. $#file_id_list-1){ my $t = $f + 1; my $file_id_f = $file_id_list[$f]; my $file_it_f = $data{$sop_inst}->{$file_id_f}; my $file_path_f; $get_file->RunQuery(sub { my($row) = @_; $file_path_f = $row->[0]; }, sub {}, $file_id_f); my $file_id_t = $file_id_list[$t]; my $file_it_t = $data{$sop_inst}->{$file_id_t}; my $file_path_t; $get_file->RunQuery(sub { my($row) = @_; $file_path_t = $row->[0]; }, sub {}, $file_id_t); push @CompareOperations, [ $series_inst, $sop_inst, $file_id_f, $file_it_f, $file_path_f, $file_id_t, $file_it_t, $file_path_t ]; } } my $report_file_name = $ARGV[0]; my $email = $ARGV[1]; my $num_series = @SeriesList; my $num_ops = @CompareOperations; print "$num_ops operations for $num_series series\n"; print "Series:\n"; for my $s (@SeriesList){ print "\t\"$s\"\n"; } fork and exit; close STDOUT; close STDIN; open REPORT, ">$report_file_name" or die "Can't open $report_file_name"; open EMAIL, "|mail -s \"Posda Job Complete\" $email" or die "can't open pipe ($!) to mail $email"; print REPORT "\"Series Instance UID\",\"Sop Instance UID\"," . "\"File_Id From\",\"First Loaded\"," . "\"File_Id To\",\"First Loaded\",\"Differences\"\r\n"; print EMAIL "Posda job comparing Series (one file per series)\n"; for my $i (@CompareOperations){ my( $series_inst, $sop_inst, $file_id_f, $file_it_f, $file_path_f, $file_id_t, $file_it_t, $file_path_t ) = @$i; my $dump_1 = File::Temp::tempnam("/tmp", "one"); my $dump_2 = File::Temp::tempnam("/tmp", "two"); my $cmd1 = "DumpDicom.pl $file_path_f > $dump_1"; my $cmd2 = "DumpDicom.pl $file_path_t > $dump_2"; print EMAIL "Series: $series_inst\nSOP: $sop_inst\n"; print STDERR "cmd1: $cmd1\n"; print EMAIL "cmd1: $cmd1\n"; print STDERR "cmd2: $cmd2\n"; print EMAIL "cmd2: $cmd2\n"; `$cmd1`;`$cmd2`; my $diff = ""; open FILE, "diff $dump_1 $dump_2|"; while(my $line = <FILE>){ chomp $line; $line =~ s/"/""/g; $diff .= $line . "\r\n"; } unlink $dump_1; unlink $dump_2; print REPORT "\"$series_inst\",$sop_inst,"; print REPORT "\"$file_id_f\",\"$file_it_f\"," . "\"$file_id_t\",\"$file_it_t\"," . "\"$diff\"\r\n"; }
28.951613
72
0.609749
ed123baf55520cefe82a918b47b6a5d36a0d426e
472
pl
Perl
perl-utils/scanners/test_more_scanner.pl
jbakerdev/Perl5-IDEA
32ca0a29ea523c4f1f01ed7cc8c406e8583215e1
[ "Apache-2.0" ]
273
2016-06-01T22:04:50.000Z
2022-03-06T01:52:02.000Z
perl-utils/scanners/test_more_scanner.pl
jbakerdev/Perl5-IDEA
32ca0a29ea523c4f1f01ed7cc8c406e8583215e1
[ "Apache-2.0" ]
1,317
2016-05-31T06:49:50.000Z
2022-03-25T17:13:51.000Z
perl-utils/scanners/test_more_scanner.pl
jbakerdev/Perl5-IDEA
32ca0a29ea523c4f1f01ed7cc8c406e8583215e1
[ "Apache-2.0" ]
62
2016-06-03T20:17:17.000Z
2022-03-02T19:02:04.000Z
package MyPackage; use strict; use warnings FATAL => 'all'; use v5.10; use Carp::Always; use Test::More qw/ok like/; use Sub::Identify qw//; say 'List<String> EXPORT = Arrays.asList('; foreach my $key (sort keys %::MyPackage::) { my $coderef = *{$::MyPackage::{$key}}{CODE}; if ($coderef) { my $target_name = Sub::Identify::sub_fullname($coderef); if ($target_name =~ /^Test/) { say sprintf '"%s",', $key; } } } say ');'
21.454545
64
0.572034
ed0150037218e17dfea7d7c31ca403494b344b54
731
pm
Perl
t/lib/t/MusicBrainz/Server/Data/LabelType.pm
qls0ulp/musicbrainz-server
ebe8a45bf6f336352cd5c56e2e825d07679c0e45
[ "BSD-2-Clause" ]
2
2021-07-29T00:32:12.000Z
2021-07-29T04:13:43.000Z
t/lib/t/MusicBrainz/Server/Data/LabelType.pm
qls0ulp/musicbrainz-server
ebe8a45bf6f336352cd5c56e2e825d07679c0e45
[ "BSD-2-Clause" ]
2
2021-05-12T00:15:55.000Z
2022-02-14T04:56:24.000Z
t/lib/t/MusicBrainz/Server/Data/LabelType.pm
qls0ulp/musicbrainz-server
ebe8a45bf6f336352cd5c56e2e825d07679c0e45
[ "BSD-2-Clause" ]
1
2021-02-24T13:14:25.000Z
2021-02-24T13:14:25.000Z
package t::MusicBrainz::Server::Data::LabelType; use Test::Routine; use Test::Moose; use Test::More; use MusicBrainz::Server::Data::LabelType; use MusicBrainz::Server::Context; use MusicBrainz::Server::Test; with 't::Context'; test all => sub { my $test = shift; my $lt_data = MusicBrainz::Server::Data::LabelType->new(c => $test->c); my $lt = $lt_data->get_by_id(3); is ($lt->id, 3); is ($lt->name, "Production"); my $lts = $lt_data->get_by_ids(3); is ($lts->{3}->id, 3); is ($lts->{3}->name, "Production"); does_ok($lt_data, 'MusicBrainz::Server::Data::Role::SelectAll'); my @types = $lt_data->get_all; is(@types, 9); is($types[0]->id, 1); is($types[1]->id, 2); }; 1;
21.5
75
0.599179
ed086ee049877f339acd37c127ffd8946f3aef67
5,619
pm
Perl
apps/antivirus/mcafee/webgateway/snmp/mode/ftpstatistics.pm
alenorcy/centreon-plugins
d7603030c24766935ed07e6ebe1082e16d6fdb4a
[ "Apache-2.0" ]
null
null
null
apps/antivirus/mcafee/webgateway/snmp/mode/ftpstatistics.pm
alenorcy/centreon-plugins
d7603030c24766935ed07e6ebe1082e16d6fdb4a
[ "Apache-2.0" ]
2
2016-07-28T10:18:20.000Z
2017-04-11T14:16:48.000Z
apps/antivirus/mcafee/webgateway/snmp/mode/ftpstatistics.pm
alenorcy/centreon-plugins
d7603030c24766935ed07e6ebe1082e16d6fdb4a
[ "Apache-2.0" ]
1
2018-03-20T11:05:05.000Z
2018-03-20T11:05:05.000Z
# # Copyright 2019 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for # service performance. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # package apps::antivirus::mcafee::webgateway::snmp::mode::ftpstatistics; use base qw(centreon::plugins::templates::counter); use strict; use warnings; use Digest::MD5 qw(md5_hex); sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ { name => 'traffics', type => 0, cb_prefix_output => 'prefix_traffic_output' }, ]; $self->{maps_counters}->{traffics} = [ { label => 'client-to-proxy', set => { key_values => [ { name => 'stFtpBytesFromClient', diff => 1 } ], output_template => 'from client to proxy: %s %s/s', output_change_bytes => 2, per_second => 1, perfdatas => [ { label => 'ftp_traffic_client_to_proxy', value => 'stFtpBytesFromClient_per_second', template => '%d', min => 0, unit => 'b/s' }, ], } }, { label => 'server-to-proxy', set => { key_values => [ { name => 'stFtpBytesFromServer', diff => 1 } ], output_template => 'from server to proxy: %s %s/s', output_change_bytes => 2, per_second => 1, perfdatas => [ { label => 'ftp_traffic_server_to_proxy', value => 'stFtpBytesFromServer_per_second', template => '%d', min => 0, unit => 'b/s' }, ], } }, { label => 'proxy-to-client', set => { key_values => [ { name => 'stFtpBytesToClient', diff => 1 } ], output_template => 'from proxy to client: %s %s/s', output_change_bytes => 2, per_second => 1, perfdatas => [ { label => 'ftp_traffic_proxy_to_client', value => 'stFtpBytesToClient_per_second', template => '%d', min => 0, unit => 'b/s' }, ], } }, { label => 'proxy-to-server', set => { key_values => [ { name => 'stFtpBytesToServer', diff => 1 } ], output_template => 'from proxy to server: %s %s/s', output_change_bytes => 2, per_second => 1, perfdatas => [ { label => 'ftp_traffic_proxy_to_server', value => 'stFtpBytesToServer_per_second', template => '%d', min => 0, unit => 'b/s' }, ], } }, ]; } sub prefix_traffic_output { my ($self, %options) = @_; return "FTP Traffic "; } sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, statefile => 1); bless $self, $class; $options{options}->add_options(arguments => { "filter-counters:s" => { name => 'filter_counters', default => '' }, }); return $self; } sub check_options { my ($self, %options) = @_; $self->SUPER::check_options(%options); } my $oid_stFtpBytesFromClient = '.1.3.6.1.4.1.1230.2.7.2.4.2.0'; my $oid_stFtpBytesFromServer = '.1.3.6.1.4.1.1230.2.7.2.4.3.0'; my $oid_stFtpBytesToClient = '.1.3.6.1.4.1.1230.2.7.2.4.4.0'; my $oid_stFtpBytesToServer = '.1.3.6.1.4.1.1230.2.7.2.4.5.0'; sub manage_selection { my ($self, %options) = @_; $self->{cache_name} = "mcafee_" . $options{snmp}->get_hostname() . '_' . $options{snmp}->get_port() . '_' . $self->{mode} . '_' . (defined($self->{option_results}->{filter_name}) ? md5_hex($self->{option_results}->{filter_name}) : md5_hex('all')) . '_' . (defined($self->{option_results}->{filter_counters}) ? md5_hex($self->{option_results}->{filter_counters}) : md5_hex('all')); my $results = $options{snmp}->get_leef(oids => [ $oid_stFtpBytesFromClient, $oid_stFtpBytesFromServer, $oid_stFtpBytesToClient, $oid_stFtpBytesToServer ], nothing_quit => 1); $self->{traffics} = {}; $self->{traffics} = { stFtpBytesFromClient => $results->{$oid_stFtpBytesFromClient} * 8, stFtpBytesFromServer => $results->{$oid_stFtpBytesFromServer} * 8, stFtpBytesToClient => $results->{$oid_stFtpBytesToClient} * 8, stFtpBytesToServer => $results->{$oid_stFtpBytesToServer} * 8, }; } 1; __END__ =head1 MODE Check FTP statistics. =over 8 =item B<--filter-counters> Only display some counters (regexp can be used). (Example: --filter-counters='^proxy') =item B<--warning-*> Threshold warning. Can be: 'client-to-proxy', 'server-to-proxy', 'proxy-to-client', 'proxy-to-server'. =item B<--critical-*> Threshold critical. Can be: 'client-to-proxy', 'server-to-proxy', 'proxy-to-client', 'proxy-to-server'. =back =cut
34.472393
134
0.555793
ed1c855f132f51f7c53dbd4b4f38d8db81fe997e
5,450
pl
Perl
pack/logicmoo_nlu/prolog/pldata/WNprolog-2.0/prolog/wn_cs.pl
logicmoo/old_logicmoo_workspace
44025b6e389e2f2f7d86b46c1301cab0604bba26
[ "MIT" ]
1
2018-09-04T14:44:49.000Z
2018-09-04T14:44:49.000Z
pack/logicmoo_nlu/prolog/pldata/WNprolog-2.0/prolog/wn_cs.pl
logicmoo/old_logicmoo_workspace
44025b6e389e2f2f7d86b46c1301cab0604bba26
[ "MIT" ]
null
null
null
pack/logicmoo_nlu/prolog/pldata/WNprolog-2.0/prolog/wn_cs.pl
logicmoo/old_logicmoo_workspace
44025b6e389e2f2f7d86b46c1301cab0604bba26
[ "MIT" ]
null
null
null
cs(200018968,200014429). cs(200020073,200019883). cs(200020689,200014429). cs(200024764,200025626). cs(200025145,200025848). cs(200051863,200052096). cs(200054011,200053715). cs(200062508,202060768). cs(200071623,200071171). cs(200072813,200073901). cs(200075633,200002669). cs(200095340,200023608). cs(200097808,200096978). cs(200121430,200106479). cs(200139051,200136423). cs(200195522,200195737). cs(200198579,200197826). cs(200211006,200211934). cs(200213400,200212992). cs(200217329,200216002). cs(200219593,200218994). cs(200230716,200230546). cs(200233158,200232691). cs(200237321,200224068). cs(200241327,200239721). cs(200241617,200241500). cs(200245331,200243643). cs(200245331,200223119). cs(200246258,200245884). cs(200246975,200246453). cs(200247955,200254471). cs(200249128,200248093). cs(200249999,200249425). cs(200257706,200257317). cs(200261089,201778173). cs(200273160,200272185). cs(200291232,202580603). cs(200294104,200293908). cs(200297051,200296442). cs(200301705,200302508). cs(200302983,200302685). cs(200303176,200301277). cs(200304392,200304920). cs(200306824,200306550). cs(200307625,200307524). cs(200307756,200306687). cs(200308836,200232930). cs(200337587,202530480). cs(200341640,202531897). cs(200350769,200350614). cs(200353399,200353638). cs(200359141,200358593). cs(200359947,200361270). cs(200361106,200358992). cs(200363255,200363608). cs(200364341,200362722). cs(200373781,200372843). cs(200374063,200372843). cs(200377506,200377338). cs(200380508,200380396). cs(200404590,200404765). cs(200405481,200406448). cs(200407260,200407022). cs(200408992,200409275). cs(200418257,200418631). cs(200418959,200418749). cs(200430741,200430473). cs(200432721,200432423). cs(200433194,200431009). cs(200433949,200433768). cs(200434545,200433583). cs(200436730,200435702). cs(200439460,200438786). cs(200441780,202008364). cs(200445694,200445393). cs(200446272,200446474). cs(200448470,200448330). cs(200456092,200455935). cs(200487379,200487183). cs(200487704,200487593). cs(200524146,200524015). cs(200525570,200525735). cs(200548789,200548658). cs(200572826,200570184). cs(200573108,200570184). cs(200581733,200581400). cs(200590669,200587965). cs(200676223,200674417). cs(200801981,200578275). cs(200803336,200578873). cs(200807709,200807511). cs(200823635,202296591). cs(200831295,200831123). cs(200831889,200031098). cs(200903103,200905210). cs(200906246,200905210). cs(200936422,200937845). cs(200941023,200941695). cs(201078671,201076728). cs(201098634,201099047). cs(201118615,201794921). cs(201123102,202596068). cs(201133605,201134068). cs(201142446,201132466). cs(201151495,201151899). cs(201164162,201164493). cs(201220231,201912987). cs(201255880,201255684). cs(201256741,201252764). cs(201257892,201252135). cs(201284688,200347202). cs(201300906,201304370). cs(201304771,201304618). cs(201305587,201307262). cs(201306283,201307088). cs(201316461,201316841). cs(201329607,201329213). cs(201329957,201983632). cs(201416767,201416511). cs(201439378,201440075). cs(201501386,201500510). cs(201501920,201504229). cs(201503996,201503339). cs(201513899,201514734). cs(201519115,201518967). cs(201558759,201558568). cs(201596269,200329254). cs(201596973,200329254). cs(201605958,201605794). cs(201714958,201716213). cs(201716999,201720480). cs(201722199,201722010). cs(201727523,201728507). cs(201730288,201730523). cs(201734240,201735248). cs(201734561,201743196). cs(201737288,201716511). cs(201737394,201722010). cs(201738453,201740043). cs(201740637,201742440). cs(201742295,201742135). cs(201743656,201743801). cs(201745335,201745079). cs(201759172,201761176). cs(201760546,201760721). cs(201760827,201760443). cs(201761366,200832070). cs(201762811,201725676). cs(201762811,201725490). cs(201764259,201725265). cs(201765364,201758877). cs(201781736,201781511). cs(201789516,201782203). cs(201794514,201847240). cs(201796771,201778173). cs(201803991,201810311). cs(201805309,201806883). cs(201820312,201820208). cs(201825616,201825090). cs(201845217,201844865). cs(201854195,201853614). cs(201897581,201951556). cs(201907659,201906445). cs(201915250,201912987). cs(201915884,201911030). cs(201916187,201911030). cs(201917708,201925199). cs(201923102,201921967). cs(201928931,201931930). cs(201931619,201931110). cs(201939426,201939033). cs(201956152,201801953). cs(201964557,201964430). cs(201984580,201984159). cs(201987519,201986772). cs(201994077,201991747). cs(202009114,202008364). cs(202010968,202008364). cs(202013236,202013026). cs(202025186,201863405). cs(202027614,201997858). cs(202027772,202005556). cs(202049824,202049107). cs(202054639,202045240). cs(202064244,202062276). cs(202075197,202067665). cs(202076104,200409939). cs(202095018,200409939). cs(202104754,202104471). cs(202116920,202113837). cs(202118940,202113837). cs(202123991,202123807). cs(202129085,202131508). cs(202136207,202139918). cs(202156874,202158208). cs(202189800,202189956). cs(202198776,202198994). cs(202309108,202308628). cs(202309428,202308628). cs(202332601,201778173). cs(202335359,202338081). cs(202356659,202355773). cs(202362536,202360949). cs(202366135,202296591). cs(202429697,202296591). cs(202431663,202296591). cs(202448815,202449906). cs(202464643,202465202). cs(202517664,202517485). cs(202521319,202355773). cs(202581128,202580603). cs(202600809,202600694). cs(202633451,202633721). cs(202640658,202640505). cs(202672806,202672608). cs(202677713,200365423). cs(202680593,200365423). cs(202681354,202681817).
24.885845
24
0.8
ed29d05f398ce37d6d64188494f8c9b7f50206ca
204,588
t
Perl
external/synple/data/n2.t
dnidever/apogee
83ad7496a0b4193df9e2c01b06dc36cb879ea6c1
[ "BSD-3-Clause" ]
5
2019-04-11T13:35:24.000Z
2019-11-14T06:12:51.000Z
external/synple/data/n2.t
dnidever/apogee
83ad7496a0b4193df9e2c01b06dc36cb879ea6c1
[ "BSD-3-Clause" ]
null
null
null
external/synple/data/n2.t
dnidever/apogee
83ad7496a0b4193df9e2c01b06dc36cb879ea6c1
[ "BSD-3-Clause" ]
5
2018-09-20T22:07:43.000Z
2021-01-15T07:13:38.000Z
****** Energy Levels (../levels/topbase/n2.l) (../levels/nist/n2.nl) 7.15489458e+15 9.0 2 '(1S)2p2 3P' 0 0. 0 7.17187521e+15 7.13933132e+15 3 3 1 1 0 0 6.69839356e+15 5.0 2 '(1S)2p2 1D' 0 0. 0 6.71179034e+15 6.68499677e+15 1 1 2 2 0 0 6.17757539e+15 1.0 2 '(1S)2p2 1S' 0 0. 0 6.18993054e+15 6.16522024e+15 1 1 0 0 0 0 5.75499190e+15 5.0 2 '2S)2p3 5S*' 0 0. 0 5.76650188e+15 5.74348192e+15 5 5 0 0 1 1 4.39214000e+15 15.0 2 '2S)2p3 3D*' 0 0. 0 4.40114382e+15 4.38313771e+15 3 3 2 2 1 1 3.88328896e+15 9.0 2 '2S)2p3 3P*' 0 0. 0 3.89109510e+15 3.87535494e+15 3 3 1 1 1 1 2.83491437e+15 5.0 2 '2S)2p3 1D*' 0 0. 0 2.84058420e+15 2.82924455e+15 1 1 2 2 1 1 2.69028038e+15 9.0 3 '2P*)3s 3P*' 0 0. 0 2.69877940e+15 2.68298178e+15 3 3 1 1 1 1 2.68502227e+15 3.0 3 '2P*)3s 1P*' 0 0. 0 2.69039231e+15 2.67965222e+15 1 1 1 1 1 1 2.50697767e+15 3.0 2 '2S)2p3 3S*' 0 0. 0 2.51199162e+15 2.50196371e+15 3 3 0 0 1 1 2.22265340e+15 3.0 3 '(2P*)3p 1P' 0 0. 0 2.22709871e+15 2.21820810e+15 1 1 1 1 0 0 2.16256234e+15 15.0 3 '(2P*)3p 3D' 0 0. 0 2.16969614e+15 2.15633863e+15 3 3 2 2 0 0 2.15805111e+15 3.0 2 '2S)2p3 1P*' 0 0. 0 2.16236721e+15 2.15373501e+15 1 1 1 1 1 1 2.09429891e+15 3.0 3 '(2P*)3p 3S' 0 0. 0 2.09848750e+15 2.09011031e+15 3 3 0 0 0 0 2.04200994e+15 9.0 3 '(2P*)3p 3P' 0 0. 0 2.04800973e+15 2.03703276e+15 3 3 1 1 0 0 1.93481461e+15 5.0 3 '(2P*)3p 1D' 0 0. 0 1.93868424e+15 1.93094498e+15 1 1 2 2 0 0 1.81305854e+15 1.0 3 '(2P*)3p 1S' 0 0. 0 1.81668466e+15 1.80943243e+15 1 1 0 0 0 0 1.56367944e+15 21.0 3 '2P*)3d 3F*' 0 0. 0 1.56921570e+15 1.55873532e+15 3 3 3 3 1 1 1.54870165e+15 5.0 3 '2P*)3d 1D*' 0 0. 0 1.55179905e+15 1.54560424e+15 1 1 2 2 1 1 1.53732309e+15 15.0 3 '2P*)3d 3D*' 0 0. 0 1.54139983e+15 1.53362067e+15 3 3 2 2 1 1 1.49497476e+15 9.0 3 '2P*)3d 3P*' 0 0. 0 1.49875007e+15 1.49037715e+15 3 3 1 1 1 1 1.48143458e+15 7.0 3 '2P*)3d 1F*' 0 0. 0 1.48439745e+15 1.47847171e+15 1 1 3 3 1 1 1.45789839e+15 3.0 3 '2P*)3d 1P*' 0 0. 0 1.46081419e+15 1.45498260e+15 1 1 1 1 1 1 1.26206086e+15 9.0 4 '2P*)4s 3P*' 0 0. 0 1.26796297e+15 1.25777575e+15 3 3 1 1 1 1 1.22590565e+15 3.0 4 '2P*)4s 1P*' 0 0. 0 1.22835746e+15 1.22345384e+15 1 1 1 1 1 1 1.09663690e+15 3.0 4 '(2P*)4p 1P' 0 0. 0 1.09883017e+15 1.09444363e+15 1 1 1 1 0 0 1.07777249e+15 15.0 4 '(2P*)4p 3D' 0 0. 0 1.08250432e+15 1.07377746e+15 3 3 2 2 0 0 1.06502945e+15 9.0 4 '(2P*)4p 3P' 0 0. 0 1.06903580e+15 1.06188089e+15 3 3 1 1 0 0 1.05565435e+15 3.0 4 '(2P*)4p 3S' 0 0. 0 1.05776566e+15 1.05354304e+15 3 3 0 0 0 0 1.00131636e+15 5.0 4 '(2P*)4p 1D' 0 0. 0 1.00331899e+15 9.99313729e+14 1 1 2 2 0 0 9.91551168e+14 15.0 3 '2(4P)3s 5P' 0 0. 0 9.95875674e+14 9.88105000e+14 5 5 1 1 0 0 9.54546982e+14 1.0 4 '(2P*)4p 1S' 0 0. 0 9.56456076e+14 9.52637888e+14 1 1 0 0 0 0 8.69128727e+14 21.0 4 '2P*)4d 3F*' 0 0. 0 8.73445586e+14 8.65463007e+14 3 3 3 3 1 1 8.64144099e+14 5.0 4 '2P*)4d 1D*' 0 0. 0 8.65872387e+14 8.62415811e+14 1 1 2 2 1 1 8.53601099e+14 15.0 4 '2P*)4d 3D*' 0 0. 0 8.56437699e+14 8.51168339e+14 3 3 2 2 1 1 8.40076566e+14 9.0 4 '2P*)4d 3P*' 0 0. 0 8.42456586e+14 8.36963634e+14 3 3 1 1 1 1 8.28832252e+14 7.0 4 '2P*)4d 1F*' 0 0. 0 8.30489916e+14 8.27174587e+14 1 1 3 3 1 1 8.21861406e+14 3.0 4 '2P*)4d 1P*' 0 0. 0 8.23505128e+14 8.20217683e+14 1 1 1 1 1 1 8.07868940e+14 9.0 3 '2(4P)3s 3P' 0 0. 0 8.11093112e+14 8.05511951e+14 3 3 1 1 0 0 7.32322399e+14 9.0 5 '2P*)5s 3P*' 0 0. 0 7.37118114e+14 7.29024417e+14 3 3 1 1 1 1 7.17143105e+14 3.0 5 '2P*)5s 1P*' 0 0. 0 7.18577391e+14 7.15708818e+14 1 1 1 1 1 1 5.53896907e+14 9.0 2 ' 2p4 3P' 0 0. 0 5.55957001e+14 5.51767654e+14 3 3 1 1 0 0 5.47275406e+14 5.0 5 '2P*)5d 1D*' 0 0. 0 5.48369957e+14 5.46180855e+14 1 1 2 2 1 1 5.27901198e+14 7.0 5 '2P*)5d 1F*' 0 0. 0 5.28957000e+14 5.26845395e+14 1 1 3 3 1 1 5.24766636e+14 3.0 5 '2P*)5d 1P*' 0 0. 0 5.25816169e+14 5.23717103e+14 1 1 1 1 1 1 4.70119072e+14 3.0 3 '(4P)3p 3S*' 0 0. 0 4.71059310e+14 4.69178833e+14 3 3 0 0 1 1 4.69135738e+14 3.0 6 '2P*)6s 1P*' 0 0. 0 4.70074009e+14 4.68197466e+14 1 1 1 1 1 1 4.50300958e+14 25.0 3 '(4P)3p 5D*' 0 0. 0 4.53808146e+14 4.47741758e+14 5 5 2 2 1 1 3.92950192e+14 15.0 3 '(4P)3p 5P*' 0 0. 0 3.94925486e+14 3.91322836e+14 5 5 1 1 1 1 2.99737960e+14 15.0 3 '(4P)3p 3D*' 0 0. 0 3.02080122e+14 2.97956378e+14 3 3 2 2 1 1 2.67161156e+14 5.0 3 '(4P)3p 5S*' 0 0. 0 2.67695478e+14 2.66626833e+14 5 5 0 0 1 1 ****** Continuum transitions (../photoionization/topbase/n2.x.out) 1 52 1 245 0 0 0 1.5492e-18 0.0000e+00 -0.0073 0.0056 0.0184 0.0313 0.0441 0.0570 0.0698 0.0827 0.0955 0.1084 0.1212 0.1341 0.1469 0.1598 0.1726 0.1855 0.1983 0.2112 0.2240 0.2369 0.2497 0.2626 0.2754 0.2883 0.3011 0.3140 0.3268 0.3396 0.3525 0.3653 0.3782 0.3910 0.4039 0.4167 0.4296 0.4424 0.4552 0.4681 0.4809 0.4938 0.5066 0.5195 0.5323 0.5451 0.5580 0.5708 0.5837 0.5965 0.6093 0.6222 0.6350 0.6479 0.6607 0.6736 0.6864 0.6992 0.7121 0.7249 0.7378 0.7506 0.7634 0.7763 0.7891 0.8020 0.8148 0.8276 0.8405 0.8533 0.8662 0.8790 0.8918 0.9047 0.9175 0.9304 0.9432 0.9560 0.9689 0.9817 0.9945 1.0074 1.0202 1.0331 1.0459 1.0587 1.0716 1.0844 1.0973 1.1101 1.1229 1.1358 1.1486 1.1615 1.1743 1.1871 1.2000 1.2128 1.2256 1.2385 1.2513 1.2642 1.2770 1.2898 1.3027 1.3155 1.3283 1.3412 1.3540 1.3669 1.3797 1.3925 1.4054 1.4182 1.4311 1.4439 1.4567 1.4696 1.4824 1.4952 1.5081 1.5209 1.5338 1.5466 1.5594 1.5723 1.5851 1.5979 1.6108 1.6236 1.6365 1.6493 1.6621 1.6750 1.6878 1.7006 1.7135 1.7263 1.7392 1.7520 1.7648 1.7777 1.7905 1.8033 1.8162 1.8290 1.8387 0.8891 0.8965 0.9099 0.9166 0.8955 0.8704 0.8544 0.8387 0.8229 0.8041 0.7790 0.7497 0.7247 0.7020 0.6749 0.6503 0.6297 0.6074 0.5843 0.5635 0.5428 0.5191 0.4943 0.4691 0.4438 0.4188 0.3961 0.3804 0.3731 0.3697 0.3672 0.3647 0.3621 0.3594 0.3566 0.3537 0.3508 0.3476 0.3444 0.3411 0.3376 0.3340 0.3303 0.3264 0.3223 0.3181 0.3138 0.3092 0.3045 0.2995 0.2944 0.2890 0.2835 0.2776 0.2715 0.2652 0.2585 0.2515 0.2442 0.2366 0.2286 0.2202 0.2113 0.2021 0.1923 0.1820 0.1711 0.1596 0.1474 0.1345 0.1208 0.1062 0.0906 0.0740 0.0562 0.0370 0.0163 -0.0060 -0.0303 -0.0568 -0.0860 -0.1182 -0.1541 -0.1944 -0.2403 -0.2932 -0.3555 -0.4305 -0.5243 -0.6427 -0.7318 -0.5998 -0.3846 -0.2888 -0.2833 -0.3081 -0.3400 -0.3741 -0.4126 -0.4381 -0.4659 -0.4967 -0.5308 -0.5689 -0.6027 -0.6295 -0.6589 -0.6915 -0.7278 -0.7687 -0.7995 -0.8275 -0.8585 -0.8929 -0.9314 -0.9749 -1.0019 -1.0312 -1.0637 -1.0998 -1.1405 -1.1814 -1.2092 -1.2397 -1.2736 -1.3115 -1.3544 -1.3916 -1.4204 -1.4522 -1.4875 -1.5272 -1.5723 -1.6053 -1.6353 -1.6684 -1.7054 -1.7471 -1.7946 -1.8229 -1.8539 -1.8883 -1.9269 -1.9706 -2.0076 2 52 1 184 0 0 0 1.7192e-18 0.0000e+00 -0.0078 0.0050 0.0179 0.0307 0.0435 0.0563 0.0691 0.0820 0.0948 0.1076 0.1204 0.1333 0.1461 0.1589 0.1717 0.1846 0.1974 0.2102 0.2230 0.2359 0.2487 0.2615 0.2744 0.2872 0.3000 0.3128 0.3257 0.3385 0.3513 0.3642 0.3770 0.3898 0.4026 0.4155 0.4283 0.4411 0.4540 0.4668 0.4796 0.4925 0.5053 0.5181 0.5310 0.5438 0.5566 0.5695 0.5823 0.5951 0.6080 0.6208 0.6336 0.6465 0.6593 0.6721 0.6850 0.6978 0.7106 0.7235 0.7363 0.7491 0.7620 0.7748 0.7876 0.8005 0.8133 0.8261 0.8390 0.8518 0.8646 0.8775 0.8903 0.9031 0.9160 0.9288 0.9416 0.9545 0.9673 0.9802 0.9930 1.0058 1.0187 1.0315 1.0443 1.0528 0.9343 0.9194 0.9113 0.9103 0.9341 0.9441 0.8783 0.7981 0.7861 0.8027 0.7871 0.7565 0.7316 0.7099 0.6907 0.6671 0.6406 0.6202 0.6040 0.5847 0.5652 0.5465 0.5249 0.5018 0.4782 0.4547 0.4321 0.4098 0.3868 0.3636 0.3411 0.3188 0.2955 0.2653 0.2285 0.1906 0.1521 0.1135 0.0750 0.0365 -0.0019 -0.0405 -0.0790 -0.1175 -0.1560 -0.1945 -0.2330 -0.2715 -0.3101 -0.3485 -0.3871 -0.4256 -0.4641 -0.5025 -0.5411 -0.5796 -0.6182 -0.6566 -0.6952 -0.7336 -0.7722 -0.8107 -0.8492 -0.8877 -0.9263 -0.9647 -1.0033 -1.0418 -1.0803 -1.1188 -1.1573 -1.1958 -1.2343 -1.2729 -1.3113 -1.3499 -1.3884 -1.4269 -1.4654 -1.5039 -1.5399 -1.5673 -1.6221 -1.6474 3 52 1 185 0 0 0 2.0420e-18 0.0000e+00 -0.0084 0.0043 0.0170 0.0297 0.0425 0.0552 0.0680 0.0807 0.0934 0.1062 0.1190 0.1317 0.1445 0.1572 0.1700 0.1827 0.1955 0.2083 0.2211 0.2338 0.2466 0.2594 0.2721 0.2849 0.2977 0.3105 0.3233 0.3361 0.3488 0.3616 0.3744 0.3872 0.4000 0.4128 0.4256 0.4384 0.4512 0.4640 0.4768 0.4896 0.5024 0.5152 0.5280 0.5408 0.5536 0.5664 0.5792 0.5920 0.6048 0.6177 0.6305 0.6433 0.6561 0.6689 0.6817 0.6945 0.7073 0.7202 0.7330 0.7458 0.7586 0.7714 0.7843 0.7971 0.8099 0.8227 0.8355 0.8484 0.8612 0.8740 0.8868 0.8996 0.9125 0.9253 0.9381 0.9509 0.9638 0.9766 0.9894 1.0022 1.0151 1.0279 1.0407 1.0536 1.0650 1.0090 0.9928 0.9742 0.9567 0.9368 0.9163 0.9003 0.8902 0.8828 0.8798 0.8578 0.8087 0.7745 0.7653 0.7549 0.7304 0.7080 0.6885 0.6694 0.6474 0.6211 0.5980 0.5817 0.5637 0.5416 0.5191 0.4965 0.4734 0.4500 0.4262 0.4029 0.3805 0.3579 0.3333 0.3107 0.2808 0.2441 0.2062 0.1676 0.1291 0.0906 0.0521 0.0137 -0.0249 -0.0634 -0.1020 -0.1404 -0.1790 -0.2174 -0.2560 -0.2945 -0.3330 -0.3715 -0.4101 -0.4486 -0.4871 -0.5256 -0.5641 -0.6026 -0.6410 -0.6796 -0.7180 -0.7566 -0.7951 -0.8337 -0.8721 -0.9107 -0.9492 -0.9878 -1.0262 -1.0648 -1.1032 -1.1418 -1.1803 -1.2188 -1.2573 -1.2958 -1.3343 -1.3728 -1.4114 -1.4498 -1.4862 -1.5138 -1.5678 -1.6024 4 52 1 175 0 0 0 2.3640e-18 0.0000e+00 0.1018 0.1147 0.1277 0.1406 0.1536 0.1665 0.1794 0.1923 0.2053 0.2182 0.2311 0.2440 0.2569 0.2698 0.2827 0.2957 0.3086 0.3215 0.3344 0.3473 0.3602 0.3731 0.3859 0.3988 0.4117 0.4246 0.4375 0.4504 0.4633 0.4762 0.4890 0.5019 0.5148 0.5277 0.5406 0.5534 0.5663 0.5792 0.5920 0.6049 0.6178 0.6307 0.6435 0.6564 0.6693 0.6821 0.6950 0.7079 0.7207 0.7336 0.7464 0.7593 0.7722 0.7850 0.7979 0.8107 0.8236 0.8365 0.8493 0.8622 0.8750 0.8879 0.9007 0.9136 0.9264 0.9393 0.9521 0.9650 0.9779 0.9907 1.0036 1.0164 1.0293 1.0421 1.0435 1.0726 1.0571 1.0406 1.0229 1.0038 0.9834 0.9619 0.9398 0.9137 0.8834 0.8577 0.8342 0.8076 0.7812 0.7563 0.7323 0.7085 0.6842 0.6585 0.6321 0.6057 0.5784 0.5493 0.5170 0.4861 0.4561 0.4234 0.3937 0.3575 0.3198 0.2815 0.2431 0.2045 0.1659 0.1274 0.0888 0.0504 0.0119 -0.0266 -0.0651 -0.1036 -0.1422 -0.1806 -0.2192 -0.2576 -0.2962 -0.3347 -0.3732 -0.4117 -0.4502 -0.4887 -0.5272 -0.5657 -0.6042 -0.6428 -0.6812 -0.7198 -0.7582 -0.7968 -0.8353 -0.8739 -0.9123 -0.9509 -0.9894 -1.0279 -1.0664 -1.1050 -1.1434 -1.1820 -1.2204 -1.2586 -1.2910 -1.3383 -1.3770 -1.3813 5 52 1 192 0 0 0 1.6721e-19 0.0000e+00 -0.0119 0.0009 0.0138 0.0266 0.0395 0.0523 0.0652 0.0780 0.0909 0.1038 0.1166 0.1295 0.1423 0.1552 0.1680 0.1809 0.1937 0.2066 0.2194 0.2323 0.2451 0.2579 0.2708 0.2836 0.2965 0.3093 0.3222 0.3350 0.3479 0.3607 0.3736 0.3864 0.3993 0.4121 0.4249 0.4378 0.4506 0.4635 0.4763 0.4892 0.5020 0.5148 0.5277 0.5405 0.5534 0.5662 0.5791 0.5919 0.6047 0.6176 0.6304 0.6433 0.6561 0.6689 0.6818 0.6946 0.7075 0.7203 0.7332 0.7460 0.7588 0.7717 0.7845 0.7974 0.8102 0.8230 0.8359 0.8487 0.8616 0.8744 0.8872 0.9001 0.9129 0.9257 0.9386 0.9514 0.9643 0.9771 0.9899 1.0028 1.0156 1.0285 1.0413 1.0541 1.0670 1.0798 1.0927 1.1055 1.1183 1.1312 1.1440 1.1566 -0.0778 0.3324 0.6850 0.8625 0.8685 0.6967 0.6867 0.8730 1.0882 1.1845 1.2102 1.2158 1.0776 0.9150 0.9471 1.0055 1.0091 1.0189 1.0194 0.9960 0.9736 0.9666 0.9590 0.9311 0.8860 0.8590 0.8493 0.8319 0.8042 0.7788 0.7555 0.7326 0.7101 0.6880 0.6660 0.6434 0.6195 0.5952 0.5709 0.5454 0.5180 0.4880 0.4606 0.4246 0.3884 0.3500 0.3116 0.2731 0.2345 0.1961 0.1575 0.1190 0.0804 0.0420 0.0035 -0.0350 -0.0735 -0.1120 -0.1505 -0.1891 -0.2275 -0.2661 -0.3045 -0.3431 -0.3816 -0.4201 -0.4586 -0.4972 -0.5356 -0.5742 -0.6126 -0.6511 -0.6896 -0.7282 -0.7666 -0.8052 -0.8437 -0.8823 -0.9208 -0.9593 -0.9978 -1.0363 -1.0748 -1.1133 -1.1519 -1.1903 -1.2289 -1.2673 -1.3038 -1.3376 -1.3852 -1.4233 6 52 1 196 0 0 0 1.0774e-19 0.0000e+00 -0.0135 -0.0008 0.0120 0.0247 0.0375 0.0503 0.0630 0.0758 0.0886 0.1013 0.1141 0.1269 0.1396 0.1524 0.1652 0.1780 0.1908 0.2035 0.2163 0.2291 0.2419 0.2547 0.2675 0.2803 0.2931 0.3059 0.3187 0.3315 0.3443 0.3571 0.3699 0.3827 0.3955 0.4083 0.4211 0.4339 0.4467 0.4595 0.4723 0.4851 0.4979 0.5107 0.5235 0.5363 0.5492 0.5620 0.5748 0.5876 0.6004 0.6132 0.6261 0.6389 0.6517 0.6645 0.6773 0.6901 0.7030 0.7158 0.7286 0.7414 0.7543 0.7671 0.7799 0.7927 0.8055 0.8184 0.8312 0.8440 0.8568 0.8697 0.8825 0.8953 0.9081 0.9210 0.9338 0.9466 0.9595 0.9723 0.9851 0.9979 1.0108 1.0236 1.0364 1.0493 1.0621 1.0749 1.0877 1.1006 1.1134 1.1262 1.1391 1.1519 1.1647 1.1776 1.1904 1.1943 -0.2687 0.4534 0.8942 1.0722 1.0286 0.9031 0.9277 1.2376 1.4420 1.6561 1.7224 1.5096 1.2127 1.1047 1.0251 0.9243 0.9695 1.0825 1.1354 1.0890 1.0250 1.0130 0.9997 0.9833 0.9699 0.9524 0.9348 0.9195 0.9078 0.8890 0.8530 0.8213 0.8048 0.7877 0.7637 0.7398 0.7171 0.6950 0.6729 0.6500 0.6267 0.6036 0.5797 0.5542 0.5262 0.4989 0.4667 0.4301 0.3921 0.3536 0.3150 0.2766 0.2380 0.1996 0.1610 0.1225 0.0840 0.0455 0.0069 -0.0316 -0.0700 -0.1086 -0.1471 -0.1856 -0.2241 -0.2626 -0.3011 -0.3397 -0.3781 -0.4167 -0.4552 -0.4937 -0.5322 -0.5707 -0.6092 -0.6477 -0.6862 -0.7248 -0.7632 -0.8017 -0.8403 -0.8788 -0.9174 -0.9558 -0.9943 -1.0328 -1.0714 -1.1098 -1.1484 -1.1869 -1.2254 -1.2633 -1.2963 -1.3262 -1.3818 -1.3937 7 52 1 205 0 0 0 1.6458e-19 0.0000e+00 -0.0186 -0.0060 0.0066 0.0192 0.0318 0.0444 0.0571 0.0697 0.0823 0.0950 0.1076 0.1203 0.1330 0.1456 0.1583 0.1710 0.1837 0.1963 0.2090 0.2217 0.2344 0.2471 0.2598 0.2726 0.2853 0.2980 0.3107 0.3234 0.3362 0.3489 0.3616 0.3744 0.3871 0.3999 0.4126 0.4253 0.4381 0.4509 0.4636 0.4764 0.4891 0.5019 0.5147 0.5274 0.5402 0.5530 0.5657 0.5785 0.5913 0.6041 0.6168 0.6296 0.6424 0.6552 0.6680 0.6808 0.6936 0.7063 0.7191 0.7319 0.7447 0.7575 0.7703 0.7831 0.7959 0.8087 0.8215 0.8343 0.8471 0.8599 0.8727 0.8855 0.8984 0.9112 0.9240 0.9368 0.9496 0.9624 0.9752 0.9880 1.0008 1.0137 1.0265 1.0393 1.0521 1.0649 1.0777 1.0906 1.1034 1.1162 1.1290 1.1418 1.1547 1.1675 1.1803 1.1931 1.2059 1.2188 1.2316 1.2444 1.2572 1.2701 1.2829 1.2957 1.2975 -0.0847 -0.0846 -0.0846 -0.0757 -0.0530 0.0383 0.3233 0.6366 0.7019 0.4718 0.0728 -0.2066 -0.3127 -0.3221 0.3158 1.2056 1.7405 1.8783 1.6518 1.1946 0.8833 0.9147 0.8912 0.8534 0.9640 1.1389 1.2025 1.0915 0.9739 1.0181 1.0704 1.0963 1.0937 1.0151 0.9331 0.9150 0.9362 0.9355 0.9021 0.8738 0.8547 0.8346 0.8120 0.7895 0.7676 0.7460 0.7241 0.7012 0.6779 0.6556 0.6335 0.6107 0.5860 0.5590 0.5347 0.5016 0.4652 0.4271 0.3885 0.3501 0.3116 0.2731 0.2346 0.1960 0.1575 0.1189 0.0806 0.0421 0.0035 -0.0351 -0.0735 -0.1121 -0.1505 -0.1891 -0.2276 -0.2661 -0.3046 -0.3431 -0.3816 -0.4201 -0.4587 -0.4972 -0.5357 -0.5742 -0.6127 -0.6512 -0.6898 -0.7283 -0.7668 -0.8053 -0.8439 -0.8823 -0.9208 -0.9593 -0.9979 -1.0363 -1.0749 -1.1133 -1.1519 -1.1904 -1.2285 -1.2609 -1.3083 -1.3468 -1.3522 8 52 1 207 0 0 0 3.2247e-19 0.0000e+00 -0.0196 -0.0069 0.0059 0.0187 0.0315 0.0442 0.0570 0.0698 0.0826 0.0954 0.1082 0.1210 0.1337 0.1465 0.1593 0.1721 0.1849 0.1977 0.2105 0.2233 0.2361 0.2489 0.2617 0.2745 0.2873 0.3001 0.3129 0.3258 0.3386 0.3514 0.3642 0.3770 0.3898 0.4026 0.4154 0.4282 0.4411 0.4539 0.4667 0.4795 0.4923 0.5051 0.5180 0.5308 0.5436 0.5564 0.5692 0.5821 0.5949 0.6077 0.6205 0.6333 0.6462 0.6590 0.6718 0.6846 0.6975 0.7103 0.7231 0.7359 0.7488 0.7616 0.7744 0.7872 0.8001 0.8129 0.8257 0.8386 0.8514 0.8642 0.8770 0.8899 0.9027 0.9155 0.9284 0.9412 0.9540 0.9668 0.9797 0.9925 1.0053 1.0182 1.0310 1.0438 1.0567 1.0695 1.0823 1.0952 1.1080 1.1208 1.1337 1.1465 1.1593 1.1722 1.1850 1.1978 1.2107 1.2235 1.2363 1.2492 1.2620 1.2748 1.2877 1.3005 1.3133 1.3262 1.3338 0.2075 0.2254 0.2677 0.3684 0.5908 0.9388 1.1294 0.9992 0.5518 0.0547 0.0406 0.1115 0.2210 0.4873 0.7505 0.9087 0.8336 0.9153 1.3698 1.5293 1.2935 0.7100 0.0216 -0.2571 -0.2917 -0.2914 -0.3047 -0.3231 -0.3377 -0.3481 -0.3503 -0.3562 -0.3640 -0.3551 -0.3594 -0.3943 -0.4208 -0.4237 -0.4345 -0.4668 -0.4940 -0.5086 -0.5222 -0.5391 -0.5560 -0.5723 -0.5880 -0.6031 -0.6183 -0.6334 -0.6475 -0.6609 -0.6743 -0.6885 -0.7037 -0.7160 -0.7407 -0.7779 -0.8154 -0.8540 -0.8925 -0.9309 -0.9695 -1.0079 -1.0465 -1.0849 -1.1235 -1.1619 -1.2005 -1.2390 -1.2775 -1.3160 -1.3545 -1.3930 -1.4315 -1.4701 -1.5086 -1.5471 -1.5856 -1.6242 -1.6626 -1.7012 -1.7396 -1.7782 -1.8166 -1.8552 -1.8936 -1.9322 -1.9707 -2.0093 -2.0477 -2.0863 -2.1247 -2.1633 -2.2018 -2.2403 -2.2788 -2.3173 -2.3558 -2.3943 -2.4329 -2.4713 -2.5099 -2.5464 -2.5731 -2.6280 -2.6509 9 52 1 206 0 0 0 1.8432e-19 0.0000e+00 -0.0197 -0.0070 0.0058 0.0185 0.0313 0.0440 0.0568 0.0695 0.0823 0.0950 0.1078 0.1205 0.1333 0.1461 0.1588 0.1716 0.1844 0.1971 0.2099 0.2227 0.2355 0.2482 0.2610 0.2738 0.2866 0.2994 0.3122 0.3250 0.3377 0.3505 0.3633 0.3761 0.3889 0.4017 0.4145 0.4273 0.4401 0.4529 0.4657 0.4785 0.4913 0.5041 0.5169 0.5297 0.5425 0.5554 0.5682 0.5810 0.5938 0.6066 0.6194 0.6322 0.6450 0.6579 0.6707 0.6835 0.6963 0.7091 0.7219 0.7348 0.7476 0.7604 0.7732 0.7860 0.7989 0.8117 0.8245 0.8373 0.8501 0.8630 0.8758 0.8886 0.9014 0.9143 0.9271 0.9399 0.9527 0.9656 0.9784 0.9912 1.0040 1.0169 1.0297 1.0425 1.0554 1.0682 1.0810 1.0938 1.1067 1.1195 1.1323 1.1452 1.1580 1.1708 1.1837 1.1965 1.2093 1.2221 1.2350 1.2478 1.2606 1.2735 1.2863 1.2991 1.3120 1.3169 -0.0355 -0.0415 -0.0477 -0.0543 -0.0602 -0.0494 0.0992 0.4421 0.6541 0.6017 0.3968 0.2336 0.1590 0.1526 0.2704 0.6235 0.9406 1.0760 1.2475 1.4930 1.5035 1.1814 0.5964 0.1280 0.1206 0.1850 0.3080 0.3725 0.3008 0.1816 0.1774 0.2052 0.1972 0.1875 0.1694 0.1535 0.1516 0.1589 0.1395 0.0883 0.0551 0.0528 0.0461 0.0233 0.0012 -0.0189 -0.0388 -0.0588 -0.0793 -0.1002 -0.1202 -0.1396 -0.1591 -0.1802 -0.2030 -0.2241 -0.2511 -0.2898 -0.3258 -0.3642 -0.4028 -0.4413 -0.4798 -0.5183 -0.5568 -0.5953 -0.6338 -0.6723 -0.7108 -0.7494 -0.7878 -0.8264 -0.8649 -0.9035 -0.9419 -0.9805 -1.0190 -1.0575 -1.0959 -1.1345 -1.1730 -1.2115 -1.2500 -1.2885 -1.3270 -1.3656 -1.4041 -1.4426 -1.4811 -1.5196 -1.5582 -1.5966 -1.6352 -1.6736 -1.7122 -1.7506 -1.7892 -1.8276 -1.8662 -1.9046 -1.9432 -1.9811 -2.0142 -2.0443 -2.0997 -2.1147 10 52 1 206 0 0 0 1.5312e-21 0.0000e+00 -0.0211 -0.0087 0.0038 0.0163 0.0288 0.0413 0.0538 0.0663 0.0789 0.0914 0.1040 0.1165 0.1291 0.1417 0.1542 0.1668 0.1794 0.1920 0.2046 0.2173 0.2299 0.2425 0.2551 0.2678 0.2804 0.2931 0.3057 0.3184 0.3311 0.3437 0.3564 0.3691 0.3818 0.3945 0.4072 0.4199 0.4326 0.4453 0.4580 0.4707 0.4834 0.4961 0.5088 0.5216 0.5343 0.5470 0.5598 0.5725 0.5853 0.5980 0.6107 0.6235 0.6362 0.6490 0.6618 0.6745 0.6873 0.7000 0.7128 0.7256 0.7384 0.7511 0.7639 0.7767 0.7895 0.8022 0.8150 0.8278 0.8406 0.8534 0.8662 0.8789 0.8917 0.9045 0.9173 0.9301 0.9429 0.9557 0.9685 0.9813 0.9941 1.0069 1.0197 1.0325 1.0453 1.0581 1.0709 1.0837 1.0965 1.1093 1.1222 1.1350 1.1478 1.1606 1.1734 1.1862 1.1990 1.2118 1.2247 1.2375 1.2503 1.2631 1.2759 1.2887 1.3016 1.3135 -2.1160 -1.0088 0.2485 0.9624 1.4137 1.3282 0.8393 0.0852 -0.6739 0.0694 0.9962 1.4509 1.4423 1.0576 0.5109 0.2014 -0.0227 0.0561 0.3517 0.8336 1.1474 1.0981 0.7047 0.1470 -0.1989 -0.2986 0.3119 1.1118 1.4999 1.4746 1.1321 1.0041 1.2656 1.2923 1.1515 1.0721 1.0706 1.0860 1.0774 1.0497 1.0364 1.0213 0.9937 0.9653 0.9424 0.9202 0.8955 0.8706 0.8461 0.8216 0.7972 0.7734 0.7493 0.7246 0.6984 0.6760 0.6517 0.6251 0.5959 0.5593 0.5210 0.4847 0.4463 0.4078 0.3692 0.3308 0.2922 0.2537 0.2151 0.1767 0.1382 0.0996 0.0611 0.0226 -0.0159 -0.0544 -0.0929 -0.1314 -0.1699 -0.2085 -0.2469 -0.2855 -0.3239 -0.3625 -0.4009 -0.4395 -0.4780 -0.5165 -0.5550 -0.5936 -0.6320 -0.6706 -0.7091 -0.7476 -0.7861 -0.8246 -0.8631 -0.9016 -0.9402 -0.9786 -1.0172 -1.0556 -1.0920 -1.1197 -1.1736 -1.2097 11 52 1 211 0 0 0 5.1700e-19 0.0000e+00 -0.0239 -0.0111 0.0017 0.0145 0.0273 0.0400 0.0528 0.0656 0.0784 0.0912 0.1040 0.1168 0.1296 0.1424 0.1552 0.1680 0.1808 0.1936 0.2064 0.2192 0.2321 0.2449 0.2577 0.2705 0.2833 0.2961 0.3089 0.3217 0.3345 0.3474 0.3602 0.3730 0.3858 0.3986 0.4114 0.4243 0.4371 0.4499 0.4627 0.4755 0.4884 0.5012 0.5140 0.5268 0.5397 0.5525 0.5653 0.5781 0.5909 0.6038 0.6166 0.6294 0.6422 0.6551 0.6679 0.6807 0.6936 0.7064 0.7192 0.7320 0.7449 0.7577 0.7705 0.7834 0.7962 0.8090 0.8218 0.8347 0.8475 0.8603 0.8732 0.8860 0.8988 0.9117 0.9245 0.9373 0.9501 0.9630 0.9758 0.9886 1.0015 1.0143 1.0271 1.0400 1.0528 1.0656 1.0785 1.0913 1.1041 1.1170 1.1298 1.1426 1.1555 1.1683 1.1811 1.1940 1.2068 1.2196 1.2325 1.2453 1.2581 1.2710 1.2838 1.2966 1.3095 1.3223 1.3352 1.3480 1.3608 1.3737 1.3751 0.4125 0.4118 0.4111 0.4104 0.4097 0.4089 0.4081 0.4073 0.4068 0.4156 0.4311 0.4623 0.5710 0.8775 1.1833 1.2352 1.0055 0.5374 0.1356 0.0593 0.0912 0.2430 0.6464 0.9294 0.8826 0.6650 0.8116 0.9783 0.9151 0.6506 0.3217 0.1149 0.0255 -0.0183 -0.0371 -0.0601 -0.1023 -0.1450 -0.1730 -0.1864 -0.1926 -0.2104 -0.2440 -0.2755 -0.2991 -0.3207 -0.3437 -0.3674 -0.3910 -0.4144 -0.4378 -0.4610 -0.4841 -0.5063 -0.5278 -0.5493 -0.5730 -0.5926 -0.6113 -0.6314 -0.6507 -0.6686 -0.7055 -0.7420 -0.7801 -0.8184 -0.8570 -0.8956 -0.9341 -0.9726 -1.0111 -1.0497 -1.0881 -1.1267 -1.1651 -1.2037 -1.2422 -1.2807 -1.3192 -1.3577 -1.3962 -1.4348 -1.4733 -1.5118 -1.5503 -1.5888 -1.6273 -1.6658 -1.7043 -1.7428 -1.7814 -1.8198 -1.8584 -1.8969 -1.9356 -1.9740 -2.0125 -2.0509 -2.0895 -2.1279 -2.1665 -2.2050 -2.2435 -2.2820 -2.3206 -2.3590 -2.3972 -2.4296 -2.4770 -2.5156 -2.5201 12 52 1 210 0 0 0 6.1180e-19 0.0000e+00 -0.0246 -0.0118 0.0010 0.0137 0.0265 0.0393 0.0521 0.0649 0.0777 0.0904 0.1032 0.1160 0.1288 0.1416 0.1544 0.1672 0.1800 0.1928 0.2056 0.2184 0.2312 0.2440 0.2568 0.2696 0.2824 0.2952 0.3080 0.3208 0.3336 0.3464 0.3592 0.3721 0.3849 0.3977 0.4105 0.4233 0.4361 0.4489 0.4618 0.4746 0.4874 0.5002 0.5130 0.5258 0.5387 0.5515 0.5643 0.5771 0.5899 0.6028 0.6156 0.6284 0.6412 0.6541 0.6669 0.6797 0.6925 0.7054 0.7182 0.7310 0.7438 0.7567 0.7695 0.7823 0.7951 0.8080 0.8208 0.8336 0.8464 0.8593 0.8721 0.8849 0.8978 0.9106 0.9234 0.9363 0.9491 0.9619 0.9747 0.9876 1.0004 1.0132 1.0261 1.0389 1.0517 1.0646 1.0774 1.0902 1.1031 1.1159 1.1287 1.1416 1.1544 1.1672 1.1801 1.1929 1.2057 1.2186 1.2314 1.2442 1.2571 1.2699 1.2827 1.2956 1.3084 1.3212 1.3341 1.3469 1.3597 1.3676 0.4856 0.4778 0.4697 0.4612 0.4522 0.4428 0.4328 0.4223 0.4110 0.4013 0.3989 0.3953 0.4046 0.5174 0.6671 0.6842 0.5592 0.3988 0.3103 0.2751 0.2595 0.2923 0.5292 0.8522 0.9759 1.1314 1.4231 1.4421 1.1104 0.5298 0.0749 -0.0390 -0.0674 -0.0836 -0.0862 -0.0840 -0.1130 -0.1644 -0.2034 -0.2276 -0.2421 -0.2555 -0.2807 -0.3114 -0.3360 -0.3559 -0.3801 -0.4098 -0.4379 -0.4644 -0.4914 -0.5184 -0.5452 -0.5720 -0.5984 -0.6240 -0.6485 -0.6729 -0.6982 -0.7242 -0.7455 -0.7686 -0.7947 -0.8331 -0.8694 -0.9077 -0.9462 -0.9848 -1.0232 -1.0618 -1.1003 -1.1388 -1.1773 -1.2158 -1.2543 -1.2928 -1.3314 -1.3698 -1.4084 -1.4468 -1.4854 -1.5238 -1.5624 -1.6008 -1.6394 -1.6779 -1.7164 -1.7549 -1.7935 -1.8319 -1.8706 -1.9090 -1.9476 -1.9861 -2.0246 -2.0631 -2.1016 -2.1401 -2.1786 -2.2171 -2.2556 -2.2942 -2.3326 -2.3712 -2.4096 -2.4482 -2.4848 -2.5115 -2.5662 -2.5897 13 52 1 212 0 0 0 1.5368e-19 0.0000e+00 -0.0246 -0.0124 -0.0001 0.0122 0.0245 0.0368 0.0491 0.0615 0.0738 0.0862 0.0986 0.1110 0.1234 0.1358 0.1482 0.1607 0.1731 0.1856 0.1981 0.2106 0.2231 0.2356 0.2481 0.2606 0.2732 0.2857 0.2983 0.3108 0.3234 0.3360 0.3485 0.3611 0.3737 0.3863 0.3989 0.4116 0.4242 0.4368 0.4494 0.4621 0.4747 0.4874 0.5000 0.5127 0.5254 0.5380 0.5507 0.5634 0.5761 0.5888 0.6015 0.6142 0.6269 0.6396 0.6523 0.6650 0.6777 0.6905 0.7032 0.7159 0.7286 0.7414 0.7541 0.7668 0.7796 0.7923 0.8051 0.8178 0.8306 0.8433 0.8561 0.8689 0.8816 0.8944 0.9072 0.9199 0.9327 0.9455 0.9582 0.9710 0.9838 0.9966 1.0094 1.0221 1.0349 1.0477 1.0605 1.0733 1.0861 1.0989 1.1117 1.1245 1.1373 1.1501 1.1629 1.1757 1.1885 1.2013 1.2141 1.2269 1.2397 1.2525 1.2653 1.2781 1.2909 1.3037 1.3165 1.3293 1.3421 1.3549 1.3678 1.3748 -0.1144 -0.1391 -0.1661 -0.1958 -0.2287 -0.2622 -0.2855 -0.2221 0.1855 0.7402 1.0339 0.9989 0.7159 0.4174 0.1832 -0.0074 -0.1308 -0.1765 -0.0769 0.5249 1.2919 1.7199 1.7332 1.3811 0.7711 0.3147 0.5287 0.7309 0.8888 1.0580 1.0877 1.1755 1.2561 1.2049 1.0757 0.9944 1.0472 1.0550 1.0275 1.0147 1.0044 0.9949 0.9951 1.0142 1.0130 0.9488 0.8786 0.8614 0.8692 0.8543 0.8241 0.7998 0.7769 0.7537 0.7306 0.7082 0.6864 0.6642 0.6399 0.6185 0.5981 0.5760 0.5520 0.5258 0.4895 0.4511 0.4148 0.3765 0.3380 0.2994 0.2609 0.2224 0.1839 0.1454 0.1069 0.0684 0.0299 -0.0087 -0.0472 -0.0857 -0.1242 -0.1627 -0.2013 -0.2398 -0.2783 -0.3168 -0.3553 -0.3938 -0.4324 -0.4708 -0.5094 -0.5478 -0.5864 -0.6248 -0.6634 -0.7018 -0.7404 -0.7789 -0.8175 -0.8559 -0.8944 -0.9329 -0.9714 -1.0099 -1.0485 -1.0870 -1.1255 -1.1640 -1.2006 -1.2271 -1.2820 -1.3034 14 52 1 212 0 0 0 3.9780e-19 0.0000e+00 -0.0254 -0.0127 0.0001 0.0129 0.0256 0.0384 0.0512 0.0639 0.0767 0.0895 0.1022 0.1150 0.1278 0.1406 0.1534 0.1661 0.1789 0.1917 0.2045 0.2173 0.2301 0.2429 0.2557 0.2684 0.2812 0.2940 0.3068 0.3196 0.3324 0.3452 0.3580 0.3708 0.3836 0.3964 0.4093 0.4221 0.4349 0.4477 0.4605 0.4733 0.4861 0.4989 0.5117 0.5245 0.5374 0.5502 0.5630 0.5758 0.5886 0.6014 0.6143 0.6271 0.6399 0.6527 0.6655 0.6784 0.6912 0.7040 0.7168 0.7296 0.7425 0.7553 0.7681 0.7809 0.7938 0.8066 0.8194 0.8322 0.8451 0.8579 0.8707 0.8835 0.8964 0.9092 0.9220 0.9348 0.9477 0.9605 0.9733 0.9862 0.9990 1.0118 1.0246 1.0375 1.0503 1.0631 1.0760 1.0888 1.1016 1.1145 1.1273 1.1401 1.1530 1.1658 1.1786 1.1915 1.2043 1.2171 1.2299 1.2428 1.2556 1.2684 1.2813 1.2941 1.3069 1.3198 1.3326 1.3454 1.3583 1.3711 1.3839 1.3878 0.2986 0.3203 0.3281 0.3318 0.3356 0.3337 0.3300 0.3261 0.3216 0.3152 0.3138 0.3375 0.3691 0.4124 0.5945 0.8813 1.0495 0.9744 0.6933 0.4035 0.2554 0.2011 0.2266 0.4206 0.6295 0.7131 1.0448 1.4268 1.4660 1.1461 0.5903 0.1573 0.0205 -0.0289 -0.0643 -0.0955 -0.1220 -0.1461 -0.1699 -0.1917 -0.2091 -0.2211 -0.2337 -0.2623 -0.2988 -0.3272 -0.3508 -0.3740 -0.3979 -0.4220 -0.4460 -0.4703 -0.4946 -0.5189 -0.5427 -0.5657 -0.5882 -0.6112 -0.6370 -0.6567 -0.6770 -0.6989 -0.7193 -0.7400 -0.7784 -0.8147 -0.8529 -0.8915 -0.9301 -0.9687 -1.0072 -1.0456 -1.0841 -1.1226 -1.1611 -1.1996 -1.2381 -1.2767 -1.3151 -1.3537 -1.3922 -1.4307 -1.4692 -1.5077 -1.5462 -1.5847 -1.6232 -1.6618 -1.7002 -1.7388 -1.7773 -1.8159 -1.8543 -1.8928 -1.9313 -1.9699 -2.0084 -2.0469 -2.0854 -2.1239 -2.1624 -2.2009 -2.2395 -2.2779 -2.3165 -2.3549 -2.3935 -2.4316 -2.4644 -2.4943 -2.5499 -2.5616 15 52 1 211 0 0 0 6.5100e-19 0.0000e+00 -0.0261 -0.0133 -0.0005 0.0123 0.0251 0.0378 0.0506 0.0634 0.0762 0.0890 0.1018 0.1146 0.1274 0.1402 0.1530 0.1658 0.1786 0.1914 0.2042 0.2170 0.2298 0.2426 0.2554 0.2682 0.2811 0.2939 0.3067 0.3195 0.3323 0.3451 0.3579 0.3707 0.3836 0.3964 0.4092 0.4220 0.4348 0.4476 0.4605 0.4733 0.4861 0.4989 0.5117 0.5246 0.5374 0.5502 0.5630 0.5759 0.5887 0.6015 0.6143 0.6272 0.6400 0.6528 0.6656 0.6785 0.6913 0.7041 0.7169 0.7298 0.7426 0.7554 0.7682 0.7811 0.7939 0.8067 0.8196 0.8324 0.8452 0.8580 0.8709 0.8837 0.8965 0.9094 0.9222 0.9350 0.9479 0.9607 0.9735 0.9864 0.9992 1.0120 1.0249 1.0377 1.0505 1.0634 1.0762 1.0890 1.1018 1.1147 1.1275 1.1403 1.1532 1.1660 1.1789 1.1917 1.2045 1.2174 1.2302 1.2430 1.2559 1.2687 1.2815 1.2944 1.3072 1.3200 1.3329 1.3457 1.3585 1.3714 1.3797 0.5126 0.5076 0.5024 0.4970 0.4914 0.4856 0.4786 0.4714 0.4669 0.4896 0.5687 0.6314 0.5469 0.4653 0.6572 0.8565 0.8640 0.7190 0.4941 0.3284 0.2635 0.2372 0.2445 0.4195 0.7236 0.8529 0.9427 1.2624 1.4375 1.3245 0.9347 0.3910 0.0595 -0.0089 0.0035 0.0271 0.0136 -0.0384 -0.1115 -0.1650 -0.1949 -0.2165 -0.2302 -0.2493 -0.2865 -0.3234 -0.3521 -0.3804 -0.4100 -0.4390 -0.4677 -0.4966 -0.5260 -0.5557 -0.5859 -0.6164 -0.6468 -0.6768 -0.7064 -0.7377 -0.7646 -0.7942 -0.8269 -0.8569 -0.8908 -0.9273 -0.9654 -1.0040 -1.0425 -1.0810 -1.1195 -1.1580 -1.1965 -1.2351 -1.2736 -1.3121 -1.3506 -1.3891 -1.4276 -1.4662 -1.5046 -1.5432 -1.5816 -1.6202 -1.6586 -1.6972 -1.7357 -1.7743 -1.8128 -1.8513 -1.8898 -1.9283 -1.9667 -2.0052 -2.0437 -2.0823 -2.1208 -2.1593 -2.1979 -2.2363 -2.2749 -2.3134 -2.3519 -2.3904 -2.4289 -2.4674 -2.5059 -2.5419 -2.5693 -2.6241 -2.6490 16 52 1 212 0 0 0 8.6000e-19 0.0000e+00 -0.0276 -0.0148 -0.0021 0.0107 0.0234 0.0362 0.0489 0.0617 0.0744 0.0872 0.0999 0.1127 0.1255 0.1382 0.1510 0.1638 0.1765 0.1893 0.2021 0.2149 0.2277 0.2404 0.2532 0.2660 0.2788 0.2916 0.3044 0.3172 0.3300 0.3428 0.3556 0.3683 0.3811 0.3939 0.4067 0.4195 0.4323 0.4452 0.4580 0.4708 0.4836 0.4964 0.5092 0.5220 0.5348 0.5476 0.5604 0.5732 0.5860 0.5989 0.6117 0.6245 0.6373 0.6501 0.6629 0.6757 0.6886 0.7014 0.7142 0.7270 0.7398 0.7527 0.7655 0.7783 0.7911 0.8039 0.8168 0.8296 0.8424 0.8552 0.8681 0.8809 0.8937 0.9065 0.9194 0.9322 0.9450 0.9578 0.9707 0.9835 0.9963 1.0092 1.0220 1.0348 1.0476 1.0605 1.0733 1.0861 1.0990 1.1118 1.1246 1.1374 1.1503 1.1631 1.1759 1.1888 1.2016 1.2144 1.2273 1.2401 1.2529 1.2658 1.2786 1.2914 1.3043 1.3171 1.3299 1.3428 1.3556 1.3684 1.3813 1.3819 0.6335 0.6228 0.6115 0.5996 0.5870 0.5736 0.5594 0.5444 0.5349 0.5249 0.5143 0.5043 0.5085 0.5261 0.6501 0.9926 1.2464 1.1834 0.8086 0.3503 0.1647 0.1448 0.1420 0.1451 0.2437 0.5339 0.7161 0.6910 0.9299 1.3191 1.4656 1.3575 1.0316 0.5978 0.2730 0.1149 0.0270 -0.0436 -0.1042 -0.1526 -0.1929 -0.2263 -0.2558 -0.2797 -0.3016 -0.3332 -0.3689 -0.3991 -0.4253 -0.4521 -0.4830 -0.5144 -0.5449 -0.5759 -0.6074 -0.6390 -0.6705 -0.7024 -0.7344 -0.7666 -0.8004 -0.8330 -0.8659 -0.8965 -0.9287 -0.9645 -1.0030 -1.0389 -1.0775 -1.1161 -1.1545 -1.1930 -1.2316 -1.2700 -1.3086 -1.3471 -1.3856 -1.4241 -1.4626 -1.5011 -1.5396 -1.5781 -1.6167 -1.6552 -1.6938 -1.7323 -1.7708 -1.8093 -1.8478 -1.8863 -1.9248 -1.9632 -2.0017 -2.0403 -2.0788 -2.1173 -2.1558 -2.1944 -2.2328 -2.2714 -2.3098 -2.3484 -2.3869 -2.4255 -2.4639 -2.5025 -2.5409 -2.5790 -2.6113 -2.6588 -2.6975 -2.6994 17 52 1 212 0 0 0 9.7680e-19 0.0000e+00 -0.0295 -0.0168 -0.0041 0.0086 0.0214 0.0341 0.0468 0.0595 0.0722 0.0850 0.0977 0.1104 0.1232 0.1359 0.1487 0.1614 0.1742 0.1869 0.1997 0.2124 0.2252 0.2380 0.2507 0.2635 0.2763 0.2890 0.3018 0.3146 0.3274 0.3401 0.3529 0.3657 0.3785 0.3913 0.4041 0.4168 0.4296 0.4424 0.4552 0.4680 0.4808 0.4936 0.5064 0.5192 0.5320 0.5448 0.5576 0.5704 0.5832 0.5960 0.6088 0.6216 0.6344 0.6472 0.6600 0.6729 0.6857 0.6985 0.7113 0.7241 0.7369 0.7497 0.7625 0.7754 0.7882 0.8010 0.8138 0.8266 0.8394 0.8523 0.8651 0.8779 0.8907 0.9035 0.9164 0.9292 0.9420 0.9548 0.9677 0.9805 0.9933 1.0061 1.0190 1.0318 1.0446 1.0574 1.0703 1.0831 1.0959 1.1087 1.1216 1.1344 1.1472 1.1600 1.1729 1.1857 1.1985 1.2114 1.2242 1.2370 1.2499 1.2627 1.2755 1.2883 1.3012 1.3140 1.3268 1.3397 1.3525 1.3653 1.3782 1.3884 0.6888 0.6744 0.6590 0.6426 0.6250 0.6061 0.5858 0.5654 0.5476 0.5284 0.5078 0.4854 0.4612 0.4346 0.4040 0.3694 0.3689 0.6076 0.9317 0.9683 0.7549 0.4858 0.3745 0.3435 0.3475 0.5002 0.9100 1.1879 1.1088 0.7077 0.6406 1.0859 1.3417 1.2994 1.0020 0.6629 0.4618 0.2934 0.1688 0.0637 -0.0210 -0.0745 -0.1224 -0.1666 -0.2060 -0.2389 -0.2695 -0.3077 -0.3464 -0.3799 -0.4124 -0.4448 -0.4764 -0.5079 -0.5404 -0.5731 -0.6067 -0.6400 -0.6713 -0.7048 -0.7364 -0.7696 -0.8016 -0.8342 -0.8666 -0.8966 -0.9272 -0.9611 -0.9986 -1.0347 -1.0732 -1.1118 -1.1503 -1.1887 -1.2273 -1.2657 -1.3043 -1.3428 -1.3813 -1.4198 -1.4584 -1.4968 -1.5354 -1.5739 -1.6124 -1.6509 -1.6894 -1.7279 -1.7664 -1.8050 -1.8434 -1.8820 -1.9204 -1.9591 -1.9975 -2.0361 -2.0745 -2.1131 -2.1515 -2.1901 -2.2285 -2.2671 -2.3056 -2.3441 -2.3826 -2.4212 -2.4596 -2.4981 -2.5343 -2.5619 -2.6162 -2.6469 18 52 1 218 0 0 0 1.6080e-18 0.0000e+00 -0.0344 -0.0216 -0.0089 0.0039 0.0167 0.0294 0.0422 0.0550 0.0677 0.0805 0.0933 0.1061 0.1188 0.1316 0.1444 0.1572 0.1700 0.1828 0.1956 0.2083 0.2211 0.2339 0.2467 0.2595 0.2723 0.2851 0.2979 0.3107 0.3235 0.3363 0.3491 0.3619 0.3747 0.3875 0.4003 0.4131 0.4260 0.4388 0.4516 0.4644 0.4772 0.4900 0.5028 0.5156 0.5284 0.5413 0.5541 0.5669 0.5797 0.5925 0.6053 0.6182 0.6310 0.6438 0.6566 0.6694 0.6823 0.6951 0.7079 0.7207 0.7336 0.7464 0.7592 0.7720 0.7849 0.7977 0.8105 0.8233 0.8362 0.8490 0.8618 0.8746 0.8875 0.9003 0.9131 0.9259 0.9388 0.9516 0.9644 0.9773 0.9901 1.0029 1.0158 1.0286 1.0414 1.0542 1.0671 1.0799 1.0927 1.1056 1.1184 1.1312 1.1441 1.1569 1.1697 1.1826 1.1954 1.2082 1.2211 1.2339 1.2467 1.2596 1.2724 1.2852 1.2981 1.3109 1.3237 1.3366 1.3494 1.3622 1.3751 1.3879 1.4007 1.4136 1.4264 1.4392 1.4521 1.4613 0.9053 0.8690 0.8282 0.7857 0.7472 0.7036 0.6540 0.6186 0.5748 0.5245 0.4659 0.4679 0.4103 0.3614 0.3085 0.2579 0.2026 0.1487 0.0885 0.0219 -0.0559 -0.1493 -0.2473 -0.0961 0.5236 1.0022 1.1492 0.9814 0.6078 0.2563 0.0598 -0.0463 -0.0539 0.1635 0.6057 0.8825 0.9658 1.2162 1.4444 1.3652 0.9691 0.3754 -0.1056 -0.3231 -0.4264 -0.4652 -0.4574 -0.5018 -0.6104 -0.7016 -0.7591 -0.8013 -0.8367 -0.8756 -0.9199 -0.9622 -0.9994 -1.0352 -1.0734 -1.1121 -1.1494 -1.1854 -1.2208 -1.2562 -1.2911 -1.3250 -1.3583 -1.3940 -1.4253 -1.4585 -1.4906 -1.5231 -1.5564 -1.5927 -1.6308 -1.6691 -1.7076 -1.7461 -1.7846 -1.8231 -1.8617 -1.9002 -1.9387 -1.9771 -2.0157 -2.0542 -2.0928 -2.1312 -2.1698 -2.2082 -2.2468 -2.2853 -2.3238 -2.3623 -2.4009 -2.4394 -2.4779 -2.5164 -2.5549 -2.5934 -2.6319 -2.6704 -2.7089 -2.7475 -2.7860 -2.8246 -2.8630 -2.9015 -2.9399 -2.9785 -3.0170 -3.0556 -3.0940 -3.1326 -3.1687 -3.1961 -3.2506 -3.2786 19 52 1 221 0 0 0 1.3580e-18 0.0000e+00 -0.0347 -0.0220 -0.0093 0.0035 0.0162 0.0289 0.0417 0.0544 0.0672 0.0799 0.0926 0.1054 0.1182 0.1309 0.1437 0.1564 0.1692 0.1820 0.1947 0.2075 0.2203 0.2330 0.2458 0.2586 0.2714 0.2842 0.2969 0.3097 0.3225 0.3353 0.3481 0.3609 0.3737 0.3865 0.3993 0.4121 0.4249 0.4376 0.4504 0.4632 0.4760 0.4889 0.5017 0.5145 0.5273 0.5401 0.5529 0.5657 0.5785 0.5913 0.6041 0.6169 0.6297 0.6425 0.6554 0.6682 0.6810 0.6938 0.7066 0.7194 0.7323 0.7451 0.7579 0.7707 0.7835 0.7963 0.8092 0.8220 0.8348 0.8476 0.8605 0.8733 0.8861 0.8989 0.9117 0.9246 0.9374 0.9502 0.9630 0.9759 0.9887 1.0015 1.0144 1.0272 1.0400 1.0528 1.0657 1.0785 1.0913 1.1041 1.1170 1.1298 1.1426 1.1555 1.1683 1.1811 1.1940 1.2068 1.2196 1.2324 1.2453 1.2581 1.2709 1.2838 1.2966 1.3094 1.3223 1.3351 1.3479 1.3608 1.3736 1.3864 1.3993 1.4121 1.4249 1.4378 1.4506 1.4634 1.4763 1.4891 1.4909 0.8319 0.7924 0.7475 0.7033 0.6599 0.6121 0.5703 0.5226 0.4787 0.4369 0.3957 0.3678 0.3734 0.3805 0.3059 0.1659 0.0524 -0.0204 -0.0832 -0.1481 -0.2208 -0.2958 -0.3840 -0.4256 0.1254 0.9986 1.5772 1.7635 1.5533 0.9738 0.1082 -0.6390 -0.6019 -0.2681 0.2891 0.7616 0.9228 1.0892 1.4272 1.5242 1.3048 0.8319 0.2955 0.0538 0.0240 -0.0529 -0.1173 -0.1609 -0.2022 -0.2398 -0.2666 -0.2812 -0.2895 -0.3136 -0.3559 -0.3950 -0.4225 -0.4454 -0.4727 -0.5023 -0.5309 -0.5590 -0.5866 -0.6141 -0.6410 -0.6669 -0.6916 -0.7159 -0.7406 -0.7676 -0.7907 -0.8144 -0.8403 -0.8738 -0.9102 -0.9483 -0.9869 -1.0253 -1.0638 -1.1023 -1.1408 -1.1794 -1.2178 -1.2564 -1.2948 -1.3334 -1.3718 -1.4104 -1.4489 -1.4874 -1.5259 -1.5644 -1.6029 -1.6415 -1.6800 -1.7185 -1.7570 -1.7955 -1.8341 -1.8725 -1.9111 -1.9495 -1.9881 -2.0266 -2.0651 -2.1036 -2.1422 -2.1806 -2.2192 -2.2576 -2.2962 -2.3346 -2.3732 -2.4117 -2.4502 -2.4887 -2.5268 -2.5593 -2.6066 -2.6452 -2.6509 20 52 1 217 0 0 0 1.3628e-18 0.0000e+00 -0.0350 -0.0222 -0.0095 0.0033 0.0160 0.0288 0.0416 0.0543 0.0671 0.0799 0.0926 0.1054 0.1182 0.1310 0.1437 0.1565 0.1693 0.1821 0.1949 0.2077 0.2205 0.2332 0.2460 0.2588 0.2716 0.2844 0.2972 0.3100 0.3228 0.3356 0.3484 0.3612 0.3740 0.3868 0.3996 0.4124 0.4252 0.4381 0.4509 0.4637 0.4765 0.4893 0.5021 0.5149 0.5277 0.5405 0.5534 0.5662 0.5790 0.5918 0.6046 0.6174 0.6303 0.6431 0.6559 0.6687 0.6815 0.6944 0.7072 0.7200 0.7328 0.7456 0.7585 0.7713 0.7841 0.7969 0.8098 0.8226 0.8354 0.8482 0.8611 0.8739 0.8867 0.8996 0.9124 0.9252 0.9380 0.9509 0.9637 0.9765 0.9893 1.0022 1.0150 1.0278 1.0407 1.0535 1.0663 1.0792 1.0920 1.1048 1.1177 1.1305 1.1433 1.1561 1.1690 1.1818 1.1946 1.2075 1.2203 1.2331 1.2460 1.2588 1.2716 1.2845 1.2973 1.3101 1.3230 1.3358 1.3486 1.3615 1.3743 1.3871 1.4000 1.4128 1.4256 1.4385 1.4504 0.8334 0.7927 0.7464 0.7017 0.6521 0.5989 0.5512 0.5141 0.4739 0.4261 0.3721 0.3148 0.2596 0.2099 0.1598 0.1042 0.0445 -0.0175 -0.0830 -0.1554 -0.2276 -0.3038 -0.3909 -0.1844 0.4898 0.9348 1.0207 0.7971 0.3751 0.0020 -0.2486 -0.4909 -0.6102 -0.3363 0.2889 0.7113 0.8195 0.9902 1.3722 1.4862 1.2466 0.7213 0.1320 -0.2333 -0.4191 -0.5245 -0.5500 -0.5474 -0.6278 -0.7524 -0.8463 -0.9031 -0.9287 -0.9572 -1.0156 -1.0794 -1.1279 -1.1659 -1.2066 -1.2518 -1.2957 -1.3374 -1.3777 -1.4183 -1.4588 -1.4984 -1.5368 -1.5766 -1.6141 -1.6510 -1.6874 -1.7255 -1.7609 -1.7973 -1.8354 -1.8739 -1.9125 -1.9510 -1.9894 -2.0280 -2.0665 -2.1050 -2.1435 -2.1821 -2.2206 -2.2591 -2.2976 -2.3361 -2.3746 -2.4131 -2.4517 -2.4901 -2.5287 -2.5671 -2.6057 -2.6442 -2.6828 -2.7213 -2.7598 -2.7982 -2.8368 -2.8752 -2.9138 -2.9523 -2.9908 -3.0293 -3.0678 -3.1063 -3.1448 -3.1834 -3.2218 -3.2604 -3.2988 -3.3353 -3.3630 -3.4168 -3.4528 21 52 1 220 0 0 0 1.2838e-18 0.0000e+00 -0.0360 -0.0233 -0.0105 0.0022 0.0150 0.0277 0.0405 0.0532 0.0660 0.0788 0.0915 0.1043 0.1171 0.1299 0.1426 0.1554 0.1682 0.1810 0.1937 0.2065 0.2193 0.2321 0.2449 0.2577 0.2705 0.2833 0.2961 0.3088 0.3216 0.3344 0.3472 0.3600 0.3728 0.3856 0.3984 0.4112 0.4240 0.4369 0.4497 0.4625 0.4753 0.4881 0.5009 0.5137 0.5265 0.5393 0.5521 0.5650 0.5778 0.5906 0.6034 0.6162 0.6290 0.6419 0.6547 0.6675 0.6803 0.6931 0.7059 0.7188 0.7316 0.7444 0.7572 0.7701 0.7829 0.7957 0.8085 0.8213 0.8342 0.8470 0.8598 0.8726 0.8855 0.8983 0.9111 0.9240 0.9368 0.9496 0.9624 0.9753 0.9881 1.0009 1.0137 1.0266 1.0394 1.0522 1.0651 1.0779 1.0907 1.1036 1.1164 1.1292 1.1420 1.1549 1.1677 1.1805 1.1934 1.2062 1.2190 1.2319 1.2447 1.2575 1.2704 1.2832 1.2960 1.3089 1.3217 1.3345 1.3474 1.3602 1.3730 1.3859 1.3987 1.4115 1.4244 1.4372 1.4500 1.4629 1.4757 1.4870 0.8075 0.7672 0.7215 0.6784 0.6337 0.5892 0.5501 0.5192 0.4731 0.4198 0.3737 0.3342 0.2826 0.2216 0.1642 0.1101 0.0560 0.0029 -0.0519 -0.1111 -0.1414 -0.0726 -0.0272 -0.1327 -0.1816 0.0753 0.5785 0.8882 0.8687 0.5537 0.0412 -0.5396 -0.9779 -0.7577 -0.0968 0.5443 0.8492 0.8261 0.9948 1.4108 1.5033 1.2319 0.6941 0.1409 -0.1820 -0.3429 -0.4401 -0.5019 -0.5632 -0.6447 -0.7205 -0.7802 -0.8070 -0.7995 -0.8251 -0.8910 -0.9537 -1.0003 -1.0377 -1.0758 -1.1162 -1.1548 -1.1908 -1.2255 -1.2604 -1.2952 -1.3287 -1.3612 -1.3946 -1.4255 -1.4563 -1.4845 -1.5135 -1.5456 -1.5819 -1.6182 -1.6565 -1.6951 -1.7336 -1.7720 -1.8106 -1.8490 -1.8876 -1.9261 -1.9647 -2.0031 -2.0416 -2.0801 -2.1187 -2.1572 -2.1957 -2.2342 -2.2727 -2.3112 -2.3497 -2.3882 -2.4267 -2.4653 -2.5037 -2.5423 -2.5808 -2.6194 -2.6578 -2.6963 -2.7348 -2.7734 -2.8118 -2.8504 -2.8889 -2.9274 -2.9658 -3.0044 -3.0429 -3.0814 -3.1200 -3.1584 -3.1948 -3.2224 -3.2764 -3.3107 22 52 1 215 0 0 0 1.2304e-18 0.0000e+00 -0.0364 -0.0236 -0.0109 0.0019 0.0146 0.0273 0.0401 0.0528 0.0656 0.0784 0.0911 0.1039 0.1167 0.1294 0.1422 0.1550 0.1677 0.1805 0.1933 0.2061 0.2188 0.2316 0.2444 0.2572 0.2700 0.2828 0.2956 0.3083 0.3211 0.3339 0.3467 0.3595 0.3723 0.3851 0.3979 0.4107 0.4235 0.4363 0.4491 0.4619 0.4747 0.4875 0.5003 0.5132 0.5260 0.5388 0.5516 0.5644 0.5772 0.5900 0.6028 0.6156 0.6285 0.6413 0.6541 0.6669 0.6797 0.6925 0.7054 0.7182 0.7310 0.7438 0.7566 0.7695 0.7823 0.7951 0.8079 0.8208 0.8336 0.8464 0.8592 0.8720 0.8849 0.8977 0.9105 0.9233 0.9362 0.9490 0.9618 0.9747 0.9875 1.0003 1.0131 1.0260 1.0388 1.0516 1.0645 1.0773 1.0901 1.1029 1.1158 1.1286 1.1414 1.1543 1.1671 1.1799 1.1928 1.2056 1.2184 1.2313 1.2441 1.2569 1.2697 1.2826 1.2954 1.3082 1.3211 1.3339 1.3467 1.3596 1.3724 1.3852 1.3981 1.4109 1.4164 0.7890 0.7481 0.7014 0.6573 0.6118 0.5649 0.5208 0.4702 0.4272 0.3781 0.3370 0.2929 0.2527 0.2082 0.1370 0.0496 -0.0177 -0.0691 -0.1226 -0.1870 -0.2500 -0.3235 -0.4043 -0.5009 -0.4997 0.1331 0.8130 1.1175 1.0448 0.6541 0.1123 -0.2369 -0.3315 -0.3181 -0.2422 0.1881 0.6711 0.8495 0.9188 1.2458 1.4562 1.3415 0.9148 0.2882 -0.2691 -0.6030 -0.7981 -0.8707 -0.8970 -1.0034 -1.1691 -1.3260 -1.4429 -1.5119 -1.5513 -1.6092 -1.6911 -1.7592 -1.8060 -1.8555 -1.9175 -1.9821 -2.0440 -2.1040 -2.1618 -2.2176 -2.2691 -2.3147 -2.3565 -2.3924 -2.4288 -2.4670 -2.5055 -2.5441 -2.5826 -2.6211 -2.6597 -2.6981 -2.7367 -2.7751 -2.8136 -2.8521 -2.8907 -2.9291 -2.9677 -3.0062 -3.0447 -3.0832 -3.1218 -3.1603 -3.1988 -3.2373 -3.2758 -3.3143 -3.3528 -3.3914 -3.4298 -3.4684 -3.5068 -3.5454 -3.5839 -3.6224 -3.6609 -3.6994 -3.7379 -3.7765 -3.8149 -3.8535 -3.8919 -3.9304 -3.9684 -4.0016 -4.0317 -4.0869 -4.1037 23 52 1 223 0 0 0 1.0824e-18 0.0000e+00 -0.0370 -0.0243 -0.0116 0.0012 0.0139 0.0266 0.0393 0.0521 0.0648 0.0775 0.0903 0.1030 0.1157 0.1285 0.1412 0.1540 0.1667 0.1795 0.1923 0.2050 0.2178 0.2305 0.2433 0.2561 0.2689 0.2816 0.2944 0.3072 0.3200 0.3327 0.3455 0.3583 0.3711 0.3839 0.3967 0.4095 0.4222 0.4350 0.4478 0.4606 0.4734 0.4862 0.4990 0.5118 0.5246 0.5374 0.5502 0.5630 0.5758 0.5886 0.6014 0.6143 0.6271 0.6399 0.6527 0.6655 0.6783 0.6911 0.7039 0.7167 0.7296 0.7424 0.7552 0.7680 0.7808 0.7936 0.8065 0.8193 0.8321 0.8449 0.8577 0.8706 0.8834 0.8962 0.9090 0.9218 0.9347 0.9475 0.9603 0.9731 0.9860 0.9988 1.0116 1.0244 1.0373 1.0501 1.0629 1.0757 1.0886 1.1014 1.1142 1.1271 1.1399 1.1527 1.1655 1.1784 1.1912 1.2040 1.2169 1.2297 1.2425 1.2553 1.2682 1.2810 1.2938 1.3067 1.3195 1.3323 1.3452 1.3580 1.3708 1.3837 1.3965 1.4093 1.4222 1.4350 1.4478 1.4607 1.4735 1.4863 1.4992 1.5120 1.5139 0.7334 0.6912 0.6429 0.5968 0.5500 0.5002 0.4541 0.4019 0.3562 0.3035 0.2582 0.2079 0.1611 0.1279 0.1009 0.0473 -0.0284 -0.0993 -0.1625 -0.2222 -0.2787 -0.3346 -0.3878 -0.4304 -0.3999 -0.0453 0.7014 1.3964 1.7198 1.6277 1.1695 0.4393 -0.3702 -0.8788 -0.6410 -0.1211 0.4756 0.7748 0.7887 1.0230 1.3944 1.4891 1.2579 0.7629 0.1940 -0.0941 -0.2145 -0.3257 -0.3945 -0.4454 -0.4869 -0.5385 -0.5920 -0.6321 -0.6712 -0.7065 -0.7337 -0.7570 -0.7776 -0.8060 -0.8404 -0.8707 -0.8991 -0.9268 -0.9538 -0.9807 -1.0070 -1.0322 -1.0560 -1.0794 -1.1031 -1.1290 -1.1509 -1.1736 -1.1982 -1.2309 -1.2674 -1.3055 -1.3440 -1.3825 -1.4210 -1.4595 -1.4980 -1.5366 -1.5750 -1.6136 -1.6520 -1.6906 -1.7290 -1.7676 -1.8061 -1.8447 -1.8831 -1.9217 -1.9601 -1.9986 -2.0371 -2.0757 -2.1142 -2.1527 -2.1913 -2.2297 -2.2683 -2.3067 -2.3453 -2.3838 -2.4223 -2.4608 -2.4993 -2.5378 -2.5764 -2.6148 -2.6534 -2.6919 -2.7304 -2.7689 -2.8074 -2.8460 -2.8841 -2.9166 -2.9639 -3.0024 -3.0082 24 52 1 231 0 0 0 2.5160e-19 0.0000e+00 -0.0430 -0.0302 -0.0174 -0.0045 0.0083 0.0211 0.0339 0.0468 0.0596 0.0724 0.0852 0.0981 0.1109 0.1237 0.1366 0.1494 0.1622 0.1751 0.1879 0.2007 0.2135 0.2264 0.2392 0.2520 0.2649 0.2777 0.2905 0.3034 0.3162 0.3290 0.3419 0.3547 0.3675 0.3803 0.3932 0.4060 0.4188 0.4317 0.4445 0.4573 0.4702 0.4830 0.4958 0.5087 0.5215 0.5343 0.5472 0.5600 0.5728 0.5857 0.5985 0.6114 0.6242 0.6370 0.6499 0.6627 0.6755 0.6884 0.7012 0.7140 0.7269 0.7397 0.7525 0.7654 0.7782 0.7910 0.8039 0.8167 0.8295 0.8424 0.8552 0.8681 0.8809 0.8937 0.9066 0.9194 0.9322 0.9451 0.9579 0.9707 0.9836 0.9964 1.0092 1.0221 1.0349 1.0478 1.0606 1.0734 1.0863 1.0991 1.1119 1.1248 1.1376 1.1504 1.1633 1.1761 1.1890 1.2018 1.2146 1.2275 1.2403 1.2531 1.2660 1.2788 1.2916 1.3045 1.3173 1.3302 1.3430 1.3558 1.3687 1.3815 1.3943 1.4072 1.4200 1.4329 1.4457 1.4585 1.4714 1.4842 1.4970 1.5099 1.5227 1.5355 1.5484 1.5612 1.5741 1.5869 1.5997 1.6126 1.6131 0.0997 0.0968 0.0939 0.0908 0.0876 0.0843 0.0808 0.1076 0.1341 0.1307 0.1126 0.1272 0.1276 0.0779 -0.0018 -0.0982 -0.1464 -0.1402 -0.1207 -0.0936 -0.0439 -0.0484 -0.0679 -0.0873 -0.0367 0.0183 -0.0249 -0.0871 -0.1072 -0.0826 0.0211 0.3181 0.8265 1.1296 1.0602 0.6265 -0.0368 -0.3556 -0.3099 -0.2609 -0.0154 0.4648 0.8141 0.8644 0.8776 1.2899 1.4950 1.3032 0.7386 -0.0939 -0.7047 -0.8248 -0.8091 -0.7641 -0.7817 -0.8438 -0.8808 -0.8832 -0.8689 -0.8771 -0.9068 -0.9291 -0.9428 -0.9540 -0.9689 -0.9853 -1.0015 -1.0184 -1.0347 -1.0497 -1.0645 -1.0800 -1.0965 -1.1143 -1.1319 -1.1451 -1.1592 -1.1741 -1.1901 -1.2077 -1.2460 -1.2847 -1.3206 -1.3591 -1.3977 -1.4362 -1.4747 -1.5132 -1.5517 -1.5902 -1.6287 -1.6672 -1.7057 -1.7443 -1.7828 -1.8214 -1.8598 -1.8984 -1.9368 -1.9754 -2.0138 -2.0524 -2.0909 -2.1294 -2.1679 -2.2065 -2.2449 -2.2835 -2.3220 -2.3605 -2.3990 -2.4375 -2.4760 -2.5145 -2.5530 -2.5915 -2.6301 -2.6685 -2.7071 -2.7456 -2.7841 -2.8226 -2.8612 -2.8997 -2.9383 -2.9767 -3.0148 -3.0470 -3.0945 -3.1332 -3.1350 25 52 1 230 0 0 0 2.9300e-19 0.0000e+00 -0.0443 -0.0316 -0.0188 -0.0060 0.0068 0.0196 0.0323 0.0451 0.0579 0.0707 0.0835 0.0963 0.1091 0.1219 0.1347 0.1475 0.1603 0.1731 0.1859 0.1987 0.2115 0.2243 0.2371 0.2499 0.2627 0.2755 0.2883 0.3011 0.3139 0.3267 0.3396 0.3524 0.3652 0.3780 0.3908 0.4036 0.4164 0.4293 0.4421 0.4549 0.4677 0.4805 0.4933 0.5062 0.5190 0.5318 0.5446 0.5574 0.5703 0.5831 0.5959 0.6087 0.6216 0.6344 0.6472 0.6600 0.6729 0.6857 0.6985 0.7113 0.7242 0.7370 0.7498 0.7626 0.7755 0.7883 0.8011 0.8140 0.8268 0.8396 0.8524 0.8653 0.8781 0.8909 0.9038 0.9166 0.9294 0.9423 0.9551 0.9679 0.9808 0.9936 1.0064 1.0192 1.0321 1.0449 1.0577 1.0706 1.0834 1.0962 1.1091 1.1219 1.1347 1.1476 1.1604 1.1732 1.1861 1.1989 1.2117 1.2246 1.2374 1.2502 1.2631 1.2759 1.2887 1.3016 1.3144 1.3273 1.3401 1.3529 1.3658 1.3786 1.3914 1.4043 1.4171 1.4299 1.4428 1.4556 1.4684 1.4813 1.4941 1.5069 1.5198 1.5326 1.5454 1.5583 1.5711 1.5840 1.5968 1.5983 0.1658 0.1546 0.1427 0.1300 0.1166 0.1024 0.0872 0.0760 0.0651 0.0535 0.0412 0.0287 0.0239 0.0238 0.0360 0.0646 0.0610 -0.0259 -0.1314 -0.1726 -0.1782 -0.1853 -0.1985 -0.2128 -0.2254 -0.2388 -0.2525 -0.2644 -0.2550 -0.1780 -0.0888 -0.0453 0.0524 0.5353 1.0056 1.1055 0.8459 0.3628 0.0587 -0.0274 -0.0988 -0.0785 0.1942 0.6082 0.8156 0.9197 1.2481 1.4562 1.3113 0.8145 0.0849 -0.4299 -0.4935 -0.4533 -0.4727 -0.5222 -0.5474 -0.5475 -0.5217 -0.5070 -0.5551 -0.6214 -0.6494 -0.6519 -0.6565 -0.6802 -0.7052 -0.7259 -0.7467 -0.7675 -0.7880 -0.8080 -0.8270 -0.8460 -0.8661 -0.8868 -0.9030 -0.9204 -0.9390 -0.9568 -0.9742 -1.0109 -1.0475 -1.0856 -1.1240 -1.1626 -1.2011 -1.2396 -1.2782 -1.3166 -1.3552 -1.3936 -1.4322 -1.4706 -1.5092 -1.5477 -1.5862 -1.6247 -1.6633 -1.7017 -1.7403 -1.7788 -1.8173 -1.8558 -1.8943 -1.9328 -1.9714 -2.0099 -2.0484 -2.0869 -2.1254 -2.1640 -2.2024 -2.2410 -2.2794 -2.3180 -2.3564 -2.3950 -2.4335 -2.4720 -2.5105 -2.5490 -2.5875 -2.6260 -2.6645 -2.7027 -2.7350 -2.7824 -2.8211 -2.8256 26 52 1 232 0 0 0 5.6900e-19 0.0000e+00 -0.0499 -0.0371 -0.0243 -0.0115 0.0014 0.0142 0.0270 0.0398 0.0526 0.0654 0.0782 0.0911 0.1039 0.1167 0.1295 0.1423 0.1551 0.1680 0.1808 0.1936 0.2064 0.2192 0.2321 0.2449 0.2577 0.2705 0.2834 0.2962 0.3090 0.3218 0.3347 0.3475 0.3603 0.3731 0.3860 0.3988 0.4116 0.4244 0.4373 0.4501 0.4629 0.4758 0.4886 0.5014 0.5142 0.5271 0.5399 0.5527 0.5656 0.5784 0.5912 0.6041 0.6169 0.6297 0.6426 0.6554 0.6682 0.6810 0.6939 0.7067 0.7195 0.7324 0.7452 0.7580 0.7709 0.7837 0.7965 0.8094 0.8222 0.8350 0.8479 0.8607 0.8735 0.8864 0.8992 0.9120 0.9249 0.9377 0.9505 0.9634 0.9762 0.9890 1.0019 1.0147 1.0276 1.0404 1.0532 1.0661 1.0789 1.0917 1.1046 1.1174 1.1302 1.1431 1.1559 1.1687 1.1816 1.1944 1.2072 1.2201 1.2329 1.2458 1.2586 1.2714 1.2843 1.2971 1.3099 1.3228 1.3356 1.3484 1.3613 1.3741 1.3869 1.3998 1.4126 1.4255 1.4383 1.4511 1.4640 1.4768 1.4896 1.5025 1.5153 1.5281 1.5410 1.5538 1.5667 1.5795 1.5923 1.6052 1.6180 1.6246 0.4541 0.4429 0.4311 0.4185 0.4052 0.3911 0.3781 0.3677 0.3567 0.3451 0.3328 0.3198 0.3060 0.2944 0.2840 0.2730 0.2613 0.2490 0.2359 0.2219 0.2107 0.2005 0.1897 0.1782 0.1626 0.1302 0.0880 0.0845 0.0971 0.0943 0.0854 0.0774 0.0700 0.0612 0.0633 0.0707 0.1328 0.4729 0.8870 1.0137 0.7854 0.3280 0.1635 0.3281 0.3941 0.3086 0.2681 0.6228 0.9262 0.8933 0.7604 1.0273 1.1738 0.9775 0.4912 -0.0400 -0.2992 -0.3946 -0.4412 -0.4649 -0.4799 -0.5055 -0.5444 -0.5790 -0.6035 -0.6252 -0.6468 -0.6690 -0.6924 -0.7161 -0.7396 -0.7636 -0.7880 -0.8120 -0.8358 -0.8597 -0.8835 -0.9082 -0.9297 -0.9530 -0.9784 -1.0012 -1.0224 -1.0454 -1.0724 -1.1109 -1.1471 -1.1854 -1.2240 -1.2625 -1.3010 -1.3396 -1.3780 -1.4166 -1.4550 -1.4936 -1.5321 -1.5706 -1.6091 -1.6476 -1.6861 -1.7246 -1.7631 -1.8017 -1.8401 -1.8786 -1.9172 -1.9557 -1.9943 -2.0327 -2.0713 -2.1097 -2.1483 -2.1867 -2.2253 -2.2638 -2.3024 -2.3408 -2.3794 -2.4178 -2.4564 -2.4949 -2.5334 -2.5719 -2.6105 -2.6490 -2.6875 -2.7259 -2.7625 -2.7889 -2.8440 -2.8639 27 52 1 232 0 0 0 6.9100e-19 0.0000e+00 -0.0508 -0.0380 -0.0251 -0.0123 0.0005 0.0134 0.0262 0.0391 0.0519 0.0647 0.0776 0.0904 0.1033 0.1161 0.1289 0.1418 0.1546 0.1675 0.1803 0.1931 0.2060 0.2188 0.2317 0.2445 0.2573 0.2702 0.2830 0.2959 0.3087 0.3215 0.3344 0.3472 0.3600 0.3729 0.3857 0.3986 0.4114 0.4242 0.4371 0.4499 0.4627 0.4756 0.4884 0.5013 0.5141 0.5269 0.5398 0.5526 0.5655 0.5783 0.5911 0.6040 0.6168 0.6296 0.6425 0.6553 0.6682 0.6810 0.6938 0.7067 0.7195 0.7323 0.7452 0.7580 0.7709 0.7837 0.7965 0.8094 0.8222 0.8350 0.8479 0.8607 0.8736 0.8864 0.8992 0.9121 0.9249 0.9377 0.9506 0.9634 0.9763 0.9891 1.0019 1.0148 1.0276 1.0404 1.0533 1.0661 1.0790 1.0918 1.1046 1.1175 1.1303 1.1431 1.1560 1.1688 1.1817 1.1945 1.2073 1.2202 1.2330 1.2458 1.2587 1.2715 1.2844 1.2972 1.3100 1.3229 1.3357 1.3485 1.3614 1.3742 1.3871 1.3999 1.4127 1.4256 1.4384 1.4512 1.4641 1.4769 1.4898 1.5026 1.5154 1.5283 1.5411 1.5539 1.5668 1.5796 1.5925 1.6053 1.6181 1.6228 0.5384 0.5295 0.5201 0.5103 0.4998 0.4889 0.4772 0.4649 0.4519 0.4380 0.4232 0.4107 0.3986 0.3858 0.3722 0.3577 0.3422 0.3257 0.3093 0.2967 0.2796 0.2601 0.2429 0.2285 0.2230 0.2258 0.2178 0.1969 0.1792 0.1575 0.1306 0.1074 0.0870 0.0688 0.0531 0.0397 0.0339 0.0958 0.3564 0.5971 0.5664 0.2857 -0.0034 -0.0949 -0.1074 -0.1129 -0.0183 0.4005 0.7993 0.8902 0.9679 1.3434 1.4704 1.2299 0.7128 0.1242 -0.3077 -0.4791 -0.5233 -0.5406 -0.5484 -0.5608 -0.5866 -0.6161 -0.6399 -0.6591 -0.6792 -0.7049 -0.7319 -0.7569 -0.7821 -0.8081 -0.8344 -0.8608 -0.8875 -0.9147 -0.9417 -0.9687 -0.9965 -1.0243 -1.0481 -1.0735 -1.1013 -1.1298 -1.1560 -1.1908 -1.2270 -1.2653 -1.3037 -1.3422 -1.3807 -1.4193 -1.4577 -1.4963 -1.5348 -1.5733 -1.6118 -1.6504 -1.6888 -1.7274 -1.7659 -1.8045 -1.8429 -1.8815 -1.9199 -1.9584 -1.9969 -2.0354 -2.0739 -2.1125 -2.1510 -2.1895 -2.2280 -2.2665 -2.3050 -2.3435 -2.3821 -2.4205 -2.4591 -2.4975 -2.5361 -2.5746 -2.6131 -2.6516 -2.6902 -2.7286 -2.7672 -2.8051 -2.8382 -2.8682 -2.9237 -2.9378 28 52 1 234 0 0 0 6.4120e-19 0.0000e+00 -0.0515 -0.0386 -0.0257 -0.0128 0.0000 0.0129 0.0258 0.0387 0.0515 0.0644 0.0773 0.0901 0.1030 0.1158 0.1287 0.1416 0.1544 0.1673 0.1802 0.1930 0.2059 0.2187 0.2316 0.2445 0.2573 0.2702 0.2830 0.2959 0.3087 0.3216 0.3344 0.3473 0.3601 0.3730 0.3859 0.3987 0.4116 0.4244 0.4373 0.4501 0.4630 0.4758 0.4887 0.5015 0.5143 0.5272 0.5400 0.5529 0.5657 0.5786 0.5914 0.6043 0.6171 0.6300 0.6428 0.6557 0.6685 0.6813 0.6942 0.7070 0.7199 0.7327 0.7456 0.7584 0.7713 0.7841 0.7969 0.8098 0.8226 0.8355 0.8483 0.8612 0.8740 0.8868 0.8997 0.9125 0.9254 0.9382 0.9510 0.9639 0.9767 0.9896 1.0024 1.0152 1.0281 1.0409 1.0538 1.0666 1.0794 1.0923 1.1051 1.1180 1.1308 1.1436 1.1565 1.1693 1.1822 1.1950 1.2078 1.2207 1.2335 1.2464 1.2592 1.2720 1.2849 1.2977 1.3106 1.3234 1.3362 1.3491 1.3619 1.3748 1.3876 1.4004 1.4133 1.4261 1.4389 1.4518 1.4646 1.4775 1.4903 1.5031 1.5160 1.5288 1.5417 1.5545 1.5673 1.5802 1.5930 1.6058 1.6187 1.6315 1.6444 1.6536 0.5060 0.4494 0.4093 0.3819 0.3541 0.3370 0.3187 0.2989 0.2860 0.2725 0.2582 0.2429 0.2267 0.2155 0.2037 0.1912 0.1782 0.1666 0.1636 0.1771 0.1857 0.1422 0.0987 0.0809 0.1205 0.1847 0.2258 0.2323 0.2161 0.1440 0.0694 0.0208 -0.0141 -0.0372 -0.0482 -0.0533 -0.0491 0.0416 0.4328 0.8531 0.9691 0.7481 0.3058 -0.0334 -0.1316 -0.1693 -0.1568 0.1466 0.6100 0.8393 0.9690 1.2353 1.3833 1.2624 0.8934 0.3669 -0.1467 -0.3809 -0.4242 -0.4416 -0.4060 -0.3579 -0.3822 -0.4561 -0.4769 -0.4513 -0.4444 -0.4802 -0.5231 -0.5359 -0.5490 -0.5706 -0.5910 -0.6113 -0.6319 -0.6530 -0.6752 -0.6982 -0.7208 -0.7432 -0.7661 -0.7909 -0.8127 -0.8344 -0.8580 -0.8873 -0.9261 -0.9620 -1.0004 -1.0390 -1.0774 -1.1160 -1.1545 -1.1930 -1.2315 -1.2700 -1.3085 -1.3470 -1.3856 -1.4240 -1.4626 -1.5010 -1.5396 -1.5781 -1.6167 -1.6551 -1.6937 -1.7322 -1.7708 -1.8092 -1.8478 -1.8862 -1.9247 -1.9632 -2.0017 -2.0402 -2.0787 -2.1173 -2.1557 -2.1943 -2.2328 -2.2713 -2.3098 -2.3483 -2.3868 -2.4254 -2.4639 -2.5024 -2.5409 -2.5794 -2.6155 -2.6429 -2.6975 -2.7251 29 52 1 233 0 0 0 3.6280e-19 0.0000e+00 -0.0519 -0.0391 -0.0262 -0.0133 -0.0004 0.0125 0.0253 0.0382 0.0511 0.0640 0.0768 0.0897 0.1026 0.1154 0.1283 0.1412 0.1540 0.1669 0.1798 0.1926 0.2055 0.2184 0.2312 0.2441 0.2570 0.2698 0.2827 0.2955 0.3084 0.3212 0.3341 0.3470 0.3598 0.3727 0.3855 0.3984 0.4112 0.4241 0.4369 0.4498 0.4626 0.4755 0.4883 0.5012 0.5140 0.5269 0.5397 0.5526 0.5654 0.5783 0.5911 0.6040 0.6168 0.6297 0.6425 0.6554 0.6682 0.6811 0.6939 0.7068 0.7196 0.7324 0.7453 0.7581 0.7710 0.7838 0.7967 0.8095 0.8224 0.8352 0.8480 0.8609 0.8737 0.8866 0.8994 0.9123 0.9251 0.9379 0.9508 0.9636 0.9765 0.9893 1.0021 1.0150 1.0278 1.0407 1.0535 1.0663 1.0792 1.0920 1.1049 1.1177 1.1306 1.1434 1.1562 1.1691 1.1819 1.1948 1.2076 1.2204 1.2333 1.2461 1.2590 1.2718 1.2846 1.2975 1.3103 1.3231 1.3360 1.3488 1.3617 1.3745 1.3873 1.4002 1.4130 1.4259 1.4387 1.4515 1.4644 1.4772 1.4901 1.5029 1.5157 1.5286 1.5414 1.5542 1.5671 1.5799 1.5928 1.6056 1.6184 1.6313 1.6397 0.2586 0.2768 0.2907 0.2939 0.2972 0.2987 0.2942 0.2895 0.2846 0.2795 0.2741 0.2686 0.2627 0.2557 0.2484 0.2407 0.2327 0.2245 0.2173 0.2091 0.1865 0.1564 0.1397 0.1315 0.1212 0.1094 0.0958 0.0751 0.0571 0.0553 0.0517 0.0439 0.0362 0.0306 0.0299 0.0372 0.0646 0.1690 0.4765 0.8887 1.1112 1.0159 0.6239 0.1421 -0.0616 -0.1070 -0.1254 0.0793 0.5361 0.7843 0.7692 1.0569 1.4360 1.4488 1.0825 0.4243 -0.1854 -0.3846 -0.4351 -0.4586 -0.4712 -0.4841 -0.5105 -0.5558 -0.5941 -0.6189 -0.6408 -0.6625 -0.6852 -0.7092 -0.7332 -0.7570 -0.7812 -0.8057 -0.8303 -0.8552 -0.8803 -0.9054 -0.9303 -0.9562 -0.9809 -1.0030 -1.0270 -1.0532 -1.0772 -1.1017 -1.1400 -1.1764 -1.2146 -1.2531 -1.2917 -1.3302 -1.3687 -1.4072 -1.4457 -1.4842 -1.5227 -1.5612 -1.5997 -1.6383 -1.6767 -1.7153 -1.7537 -1.7923 -1.8308 -1.8694 -1.9078 -1.9464 -1.9849 -2.0234 -2.0619 -2.1004 -2.1389 -2.1774 -2.2159 -2.2545 -2.2930 -2.3315 -2.3700 -2.4085 -2.4470 -2.4855 -2.5240 -2.5625 -2.6011 -2.6395 -2.6781 -2.7166 -2.7551 -2.7911 -2.8185 -2.8732 -2.8986 30 52 1 233 0 0 0 1.0024e-18 0.0000e+00 -0.0549 -0.0422 -0.0294 -0.0166 -0.0038 0.0090 0.0219 0.0347 0.0475 0.0603 0.0731 0.0859 0.0987 0.1115 0.1243 0.1371 0.1499 0.1627 0.1756 0.1884 0.2012 0.2140 0.2268 0.2396 0.2524 0.2653 0.2781 0.2909 0.3037 0.3165 0.3294 0.3422 0.3550 0.3678 0.3806 0.3935 0.4063 0.4191 0.4319 0.4448 0.4576 0.4704 0.4832 0.4961 0.5089 0.5217 0.5345 0.5474 0.5602 0.5730 0.5859 0.5987 0.6115 0.6243 0.6372 0.6500 0.6628 0.6757 0.6885 0.7013 0.7141 0.7270 0.7398 0.7526 0.7655 0.7783 0.7911 0.8040 0.8168 0.8296 0.8425 0.8553 0.8681 0.8810 0.8938 0.9066 0.9195 0.9323 0.9451 0.9580 0.9708 0.9836 0.9965 1.0093 1.0221 1.0350 1.0478 1.0606 1.0735 1.0863 1.0991 1.1120 1.1248 1.1376 1.1505 1.1633 1.1761 1.1890 1.2018 1.2146 1.2275 1.2403 1.2531 1.2660 1.2788 1.2917 1.3045 1.3173 1.3302 1.3430 1.3558 1.3687 1.3815 1.3943 1.4072 1.4200 1.4328 1.4457 1.4585 1.4714 1.4842 1.4970 1.5099 1.5227 1.5355 1.5484 1.5612 1.5740 1.5869 1.5997 1.6125 1.6254 1.6257 0.7000 0.6876 0.6745 0.6606 0.6458 0.6299 0.6130 0.5974 0.5837 0.5692 0.5537 0.5371 0.5193 0.5029 0.4888 0.4737 0.4576 0.4403 0.4218 0.4084 0.3945 0.3798 0.3641 0.3546 0.3477 0.3531 0.3980 0.4676 0.4297 0.2668 0.1479 0.1132 0.1005 0.0921 0.0843 0.0766 0.0686 0.0643 0.0758 0.2528 0.7996 1.1952 1.1997 0.8434 0.2526 0.0293 0.0257 -0.0292 -0.0404 0.1571 0.5920 0.8109 0.7638 0.9892 1.3843 1.4622 1.1841 0.6155 -0.0123 -0.3202 -0.4206 -0.4804 -0.5214 -0.5500 -0.5871 -0.6329 -0.6687 -0.6962 -0.7224 -0.7488 -0.7784 -0.8081 -0.8367 -0.8659 -0.8956 -0.9254 -0.9556 -0.9870 -1.0191 -1.0511 -1.0833 -1.1170 -1.1506 -1.1835 -1.2178 -1.2524 -1.2876 -1.3248 -1.3609 -1.3994 -1.4378 -1.4762 -1.5148 -1.5533 -1.5918 -1.6303 -1.6688 -1.7073 -1.7458 -1.7844 -1.8228 -1.8614 -1.8999 -1.9384 -1.9769 -2.0155 -2.0539 -2.0925 -2.1310 -2.1695 -2.2080 -2.2465 -2.2850 -2.3235 -2.3621 -2.4006 -2.4391 -2.4776 -2.5161 -2.5546 -2.5932 -2.6316 -2.6702 -2.7086 -2.7472 -2.7857 -2.8243 -2.8627 -2.9008 -2.9330 -2.9806 -3.0193 -3.0204 31 52 1 200 0 0 0 1.8368e-19 0.0000e+00 0.4037 0.4167 0.4298 0.4428 0.4558 0.4688 0.4819 0.4949 0.5079 0.5209 0.5339 0.5469 0.5599 0.5728 0.5858 0.5988 0.6118 0.6247 0.6377 0.6507 0.6636 0.6766 0.6895 0.7025 0.7154 0.7283 0.7413 0.7542 0.7671 0.7801 0.7930 0.8059 0.8188 0.8317 0.8447 0.8576 0.8705 0.8834 0.8963 0.9092 0.9221 0.9350 0.9479 0.9608 0.9737 0.9866 0.9995 1.0124 1.0253 1.0382 1.0510 1.0639 1.0768 1.0897 1.1026 1.1154 1.1283 1.1412 1.1541 1.1670 1.1798 1.1927 1.2056 1.2184 1.2313 1.2442 1.2570 1.2699 1.2828 1.2956 1.3085 1.3214 1.3342 1.3471 1.3600 1.3728 1.3857 1.3985 1.4114 1.4242 1.4371 1.4500 1.4628 1.4757 1.4885 1.5014 1.5142 1.5271 1.5399 1.5528 1.5656 1.5785 1.5914 1.6042 1.6171 1.6299 1.6428 1.6556 1.6684 1.6743 -0.0370 -0.0434 -0.0501 -0.0571 -0.0644 -0.0721 -0.0802 -0.0886 -0.0975 -0.1069 -0.1167 -0.1257 -0.1300 -0.0538 0.4049 0.8914 1.0188 0.7640 0.2372 -0.1737 -0.2620 -0.2771 -0.2877 -0.2977 -0.3100 -0.3247 -0.3414 -0.3593 -0.3759 -0.3913 -0.4062 -0.4211 -0.4354 -0.4488 -0.4620 -0.4760 -0.4908 -0.5061 -0.5226 -0.5347 -0.5475 -0.5611 -0.5756 -0.5911 -0.6065 -0.6180 -0.6302 -0.6431 -0.6568 -0.6714 -0.6845 -0.6965 -0.7325 -0.7691 -0.8071 -0.8455 -0.8841 -0.9226 -0.9611 -0.9996 -1.0381 -1.0767 -1.1151 -1.1537 -1.1921 -1.2307 -1.2692 -1.3077 -1.3462 -1.3848 -1.4232 -1.4618 -1.5002 -1.5388 -1.5773 -1.6159 -1.6543 -1.6928 -1.7314 -1.7698 -1.8084 -1.8468 -1.8854 -1.9238 -1.9625 -2.0009 -2.0395 -2.0779 -2.1165 -2.1549 -2.1935 -2.2320 -2.2705 -2.3090 -2.3476 -2.3855 -2.4187 -2.4488 -2.5040 -2.5217 32 52 1 234 0 0 0 1.2674e-18 0.0000e+00 -0.0578 -0.0450 -0.0322 -0.0195 -0.0067 0.0061 0.0189 0.0317 0.0445 0.0573 0.0701 0.0829 0.0957 0.1085 0.1213 0.1342 0.1470 0.1598 0.1726 0.1854 0.1982 0.2110 0.2238 0.2366 0.2494 0.2623 0.2751 0.2879 0.3007 0.3135 0.3263 0.3392 0.3520 0.3648 0.3776 0.3904 0.4033 0.4161 0.4289 0.4417 0.4545 0.4674 0.4802 0.4930 0.5058 0.5187 0.5315 0.5443 0.5571 0.5700 0.5828 0.5956 0.6084 0.6213 0.6341 0.6469 0.6597 0.6726 0.6854 0.6982 0.7111 0.7239 0.7367 0.7496 0.7624 0.7752 0.7880 0.8009 0.8137 0.8265 0.8394 0.8522 0.8650 0.8779 0.8907 0.9035 0.9164 0.9292 0.9420 0.9549 0.9677 0.9805 0.9934 1.0062 1.0190 1.0319 1.0447 1.0575 1.0704 1.0832 1.0960 1.1089 1.1217 1.1345 1.1474 1.1602 1.1730 1.1859 1.1987 1.2115 1.2244 1.2372 1.2500 1.2629 1.2757 1.2885 1.3014 1.3142 1.3270 1.3399 1.3527 1.3655 1.3784 1.3912 1.4041 1.4169 1.4297 1.4426 1.4554 1.4682 1.4811 1.4939 1.5067 1.5196 1.5324 1.5452 1.5581 1.5709 1.5838 1.5966 1.6094 1.6223 1.6351 1.6447 0.8019 0.7881 0.7734 0.7577 0.7409 0.7229 0.7036 0.6880 0.6720 0.6549 0.6365 0.6167 0.5963 0.5799 0.5623 0.5434 0.5231 0.5011 0.4831 0.4649 0.4452 0.4239 0.4009 0.3824 0.3633 0.3427 0.3204 0.2996 0.2790 0.2557 0.2246 0.1945 0.1761 0.1600 0.1413 0.1207 0.0983 0.0739 0.0489 0.0226 0.0066 0.1230 0.4527 0.6132 0.4821 0.1616 0.1533 0.3358 0.3644 0.2748 0.2151 0.5682 0.9180 0.9222 0.7285 1.0454 1.3925 1.3918 1.0659 0.5438 0.0812 -0.1701 -0.3006 -0.3868 -0.4459 -0.4923 -0.5475 -0.5980 -0.6342 -0.6672 -0.7010 -0.7349 -0.7690 -0.8021 -0.8338 -0.8649 -0.8955 -0.9260 -0.9577 -0.9916 -1.0240 -1.0570 -1.0900 -1.1236 -1.1572 -1.1917 -1.2257 -1.2615 -1.2959 -1.3334 -1.3697 -1.4080 -1.4465 -1.4851 -1.5237 -1.5621 -1.6007 -1.6391 -1.6777 -1.7161 -1.7547 -1.7931 -1.8317 -1.8701 -1.9087 -1.9472 -1.9858 -2.0242 -2.0628 -2.1013 -2.1398 -2.1783 -2.2168 -2.2553 -2.2938 -2.3324 -2.3709 -2.4094 -2.4479 -2.4864 -2.5249 -2.5635 -2.6019 -2.6405 -2.6789 -2.7175 -2.7560 -2.7945 -2.8330 -2.8715 -2.9077 -2.9352 -2.9894 -3.0185 33 52 1 237 0 0 0 3.2540e-18 0.0000e+00 -0.0640 -0.0511 -0.0383 -0.0254 -0.0126 0.0002 0.0131 0.0259 0.0388 0.0516 0.0644 0.0773 0.0901 0.1029 0.1158 0.1286 0.1415 0.1543 0.1671 0.1800 0.1928 0.2056 0.2185 0.2313 0.2442 0.2570 0.2698 0.2827 0.2955 0.3083 0.3212 0.3340 0.3469 0.3597 0.3725 0.3854 0.3982 0.4110 0.4239 0.4367 0.4496 0.4624 0.4752 0.4881 0.5009 0.5137 0.5266 0.5394 0.5523 0.5651 0.5779 0.5908 0.6036 0.6164 0.6293 0.6421 0.6550 0.6678 0.6806 0.6935 0.7063 0.7191 0.7320 0.7448 0.7577 0.7705 0.7833 0.7962 0.8090 0.8218 0.8347 0.8475 0.8604 0.8732 0.8860 0.8989 0.9117 0.9245 0.9374 0.9502 0.9631 0.9759 0.9887 1.0016 1.0144 1.0272 1.0401 1.0529 1.0657 1.0786 1.0914 1.1043 1.1171 1.1299 1.1428 1.1556 1.1684 1.1813 1.1941 1.2070 1.2198 1.2326 1.2455 1.2583 1.2711 1.2840 1.2968 1.3097 1.3225 1.3353 1.3482 1.3610 1.3738 1.3867 1.3995 1.4124 1.4252 1.4380 1.4509 1.4637 1.4765 1.4894 1.5022 1.5151 1.5279 1.5407 1.5536 1.5664 1.5792 1.5921 1.6049 1.6178 1.6306 1.6434 1.6563 1.6691 1.6736 1.2114 1.1840 1.1538 1.1204 1.0915 1.0611 1.0274 0.9967 0.9659 0.9317 0.8990 0.8666 0.8328 0.8020 0.7679 0.7297 0.6911 0.6478 0.6033 0.5995 0.5679 0.5327 0.4933 0.4596 0.4233 0.3824 0.3468 0.3069 0.2703 0.2301 0.1938 0.1530 0.1078 0.0681 0.0239 -0.0245 -0.0800 -0.1506 -0.2391 -0.2747 -0.2369 -0.2456 -0.3169 -0.4084 -0.4816 -0.1325 0.6320 1.0839 1.1272 0.8114 0.2748 -0.1308 -0.2721 -0.3297 -0.2834 0.1610 0.6745 0.8631 0.8822 1.2312 1.4758 1.3510 0.8757 0.1890 -0.2739 -0.4821 -0.6672 -0.7879 -0.8604 -0.9137 -0.9562 -1.0009 -1.0501 -1.0964 -1.1387 -1.1782 -1.2172 -1.2571 -1.2969 -1.3355 -1.3728 -1.4095 -1.4470 -1.4846 -1.5217 -1.5585 -1.5968 -1.6343 -1.6707 -1.7081 -1.7455 -1.7823 -1.8206 -1.8566 -1.8952 -1.9336 -1.9720 -2.0106 -2.0491 -2.0876 -2.1262 -2.1646 -2.2032 -2.2417 -2.2802 -2.3187 -2.3573 -2.3957 -2.4343 -2.4727 -2.5113 -2.5497 -2.5883 -2.6268 -2.6654 -2.7038 -2.7423 -2.7808 -2.8194 -2.8579 -2.8964 -2.9350 -2.9735 -3.0120 -3.0504 -3.0890 -3.1274 -3.1660 -3.2044 -3.2430 -3.2815 -3.3201 -3.3579 -3.3910 -3.4210 -3.4764 -3.4901 34 52 1 239 0 0 0 3.1200e-18 0.0000e+00 -0.0643 -0.0516 -0.0388 -0.0260 -0.0132 -0.0004 0.0124 0.0252 0.0380 0.0508 0.0636 0.0764 0.0892 0.1020 0.1148 0.1277 0.1405 0.1533 0.1661 0.1789 0.1917 0.2045 0.2173 0.2301 0.2430 0.2558 0.2686 0.2814 0.2942 0.3070 0.3199 0.3327 0.3455 0.3583 0.3711 0.3840 0.3968 0.4096 0.4224 0.4352 0.4481 0.4609 0.4737 0.4865 0.4994 0.5122 0.5250 0.5378 0.5507 0.5635 0.5763 0.5891 0.6020 0.6148 0.6276 0.6404 0.6533 0.6661 0.6789 0.6918 0.7046 0.7174 0.7303 0.7431 0.7559 0.7687 0.7816 0.7944 0.8072 0.8201 0.8329 0.8457 0.8586 0.8714 0.8842 0.8971 0.9099 0.9227 0.9356 0.9484 0.9612 0.9740 0.9869 0.9997 1.0125 1.0254 1.0382 1.0510 1.0639 1.0767 1.0896 1.1024 1.1152 1.1281 1.1409 1.1537 1.1666 1.1794 1.1922 1.2051 1.2179 1.2307 1.2436 1.2564 1.2692 1.2821 1.2949 1.3077 1.3206 1.3334 1.3462 1.3591 1.3719 1.3848 1.3976 1.4104 1.4233 1.4361 1.4489 1.4618 1.4746 1.4874 1.5003 1.5131 1.5259 1.5388 1.5516 1.5645 1.5773 1.5901 1.6030 1.6158 1.6286 1.6415 1.6543 1.6671 1.6800 1.6928 1.7019 1.1931 1.1645 1.1330 1.0978 1.0674 1.0356 1.0002 0.9676 0.9357 0.9002 0.8659 0.8334 0.7973 0.7629 0.7298 0.6930 0.6582 0.6250 0.5880 0.5553 0.5238 0.5033 0.5142 0.3861 0.3402 0.3063 0.2683 0.2267 0.1906 0.1501 0.1073 0.0689 0.0253 -0.0168 -0.0580 -0.0994 -0.1409 -0.1767 -0.1945 -0.1534 -0.0221 0.0007 -0.1928 -0.4353 -0.5947 -0.5603 0.2070 0.8595 1.0866 0.9168 0.4045 -0.2304 -0.5203 -0.6157 -0.5895 -0.1584 0.4798 0.8278 0.8506 1.0618 1.4309 1.4674 1.1385 0.5334 -0.0334 -0.2720 -0.4042 -0.5043 -0.5756 -0.6304 -0.6674 -0.6989 -0.7480 -0.8031 -0.8475 -0.8811 -0.9120 -0.9473 -0.9831 -1.0168 -1.0495 -1.0812 -1.1132 -1.1452 -1.1763 -1.2067 -1.2376 -1.2682 -1.2955 -1.3247 -1.3502 -1.3782 -1.4089 -1.4454 -1.4815 -1.5199 -1.5584 -1.5968 -1.6354 -1.6739 -1.7124 -1.7509 -1.7894 -1.8279 -1.8664 -1.9051 -1.9435 -1.9820 -2.0204 -2.0590 -2.0975 -2.1361 -2.1745 -2.2131 -2.2515 -2.2901 -2.3286 -2.3671 -2.4056 -2.4441 -2.4826 -2.5211 -2.5597 -2.5981 -2.6367 -2.6752 -2.7137 -2.7521 -2.7907 -2.8291 -2.8677 -2.9062 -2.9448 -2.9832 -3.0218 -3.0578 -3.0853 -3.1399 -3.1671 35 52 1 235 0 0 0 3.0540e-18 0.0000e+00 -0.0652 -0.0524 -0.0396 -0.0268 -0.0140 -0.0012 0.0116 0.0244 0.0372 0.0500 0.0628 0.0756 0.0885 0.1013 0.1141 0.1269 0.1397 0.1525 0.1653 0.1782 0.1910 0.2038 0.2166 0.2294 0.2422 0.2551 0.2679 0.2807 0.2935 0.3063 0.3192 0.3320 0.3448 0.3576 0.3704 0.3833 0.3961 0.4089 0.4217 0.4346 0.4474 0.4602 0.4730 0.4859 0.4987 0.5115 0.5244 0.5372 0.5500 0.5628 0.5757 0.5885 0.6013 0.6142 0.6270 0.6398 0.6526 0.6655 0.6783 0.6911 0.7040 0.7168 0.7296 0.7425 0.7553 0.7681 0.7810 0.7938 0.8066 0.8195 0.8323 0.8451 0.8579 0.8708 0.8836 0.8964 0.9093 0.9221 0.9349 0.9478 0.9606 0.9734 0.9863 0.9991 1.0119 1.0248 1.0376 1.0505 1.0633 1.0761 1.0890 1.1018 1.1146 1.1275 1.1403 1.1531 1.1660 1.1788 1.1916 1.2045 1.2173 1.2301 1.2430 1.2558 1.2686 1.2815 1.2943 1.3072 1.3200 1.3328 1.3457 1.3585 1.3713 1.3842 1.3970 1.4098 1.4227 1.4355 1.4483 1.4612 1.4740 1.4869 1.4997 1.5125 1.5254 1.5382 1.5510 1.5639 1.5767 1.5895 1.6024 1.6152 1.6281 1.6409 1.6460 1.1838 1.1541 1.1212 1.0844 1.0518 1.0179 0.9800 0.9479 0.9122 0.8703 0.8238 0.7851 0.7671 0.7419 0.7068 0.6691 0.6295 0.5879 0.5428 0.4957 0.4507 0.4405 0.4035 0.3617 0.3225 0.2808 0.2376 0.1937 0.1512 0.1058 0.0595 0.0179 -0.0225 -0.0660 -0.1170 -0.1758 -0.2386 -0.2936 -0.2831 -0.2287 -0.2537 -0.3525 -0.4547 -0.5263 -0.5722 -0.4787 0.1774 0.8151 1.0647 0.9234 0.4420 -0.2293 -0.7222 -0.9060 -0.7538 -0.3091 0.3281 0.7470 0.8093 0.8946 1.3298 1.4959 1.2779 0.7280 0.0413 -0.3617 -0.5878 -0.7833 -0.9128 -0.9994 -1.0539 -1.0907 -1.1501 -1.2259 -1.2912 -1.3438 -1.3890 -1.4357 -1.4858 -1.5345 -1.5813 -1.6265 -1.6721 -1.7190 -1.7659 -1.8123 -1.8611 -1.9073 -1.9531 -2.0001 -2.0460 -2.0947 -2.1403 -2.1880 -2.2235 -2.2625 -2.3011 -2.3397 -2.3782 -2.4167 -2.4552 -2.4937 -2.5323 -2.5707 -2.6093 -2.6477 -2.6863 -2.7248 -2.7633 -2.8018 -2.8403 -2.8788 -2.9173 -2.9559 -2.9944 -3.0329 -3.0714 -3.1099 -3.1484 -3.1870 -3.2254 -3.2640 -3.3024 -3.3410 -3.3795 -3.4181 -3.4565 -3.4951 -3.5335 -3.5721 -3.6100 -3.6432 -3.6732 -3.7284 -3.7440 36 52 1 238 0 0 0 3.0360e-18 0.0000e+00 -0.0663 -0.0535 -0.0407 -0.0278 -0.0150 -0.0021 0.0107 0.0235 0.0364 0.0492 0.0620 0.0749 0.0877 0.1006 0.1134 0.1262 0.1391 0.1519 0.1648 0.1776 0.1904 0.2033 0.2161 0.2289 0.2418 0.2546 0.2675 0.2803 0.2931 0.3060 0.3188 0.3316 0.3445 0.3573 0.3702 0.3830 0.3958 0.4087 0.4215 0.4344 0.4472 0.4600 0.4729 0.4857 0.4985 0.5114 0.5242 0.5371 0.5499 0.5627 0.5756 0.5884 0.6012 0.6141 0.6269 0.6398 0.6526 0.6654 0.6783 0.6911 0.7039 0.7168 0.7296 0.7425 0.7553 0.7681 0.7810 0.7938 0.8066 0.8195 0.8323 0.8452 0.8580 0.8708 0.8837 0.8965 0.9093 0.9222 0.9350 0.9479 0.9607 0.9735 0.9864 0.9992 1.0120 1.0249 1.0377 1.0505 1.0634 1.0762 1.0891 1.1019 1.1147 1.1276 1.1404 1.1532 1.1661 1.1789 1.1918 1.2046 1.2174 1.2303 1.2431 1.2559 1.2688 1.2816 1.2945 1.3073 1.3201 1.3330 1.3458 1.3586 1.3715 1.3843 1.3972 1.4100 1.4228 1.4357 1.4485 1.4613 1.4742 1.4870 1.4999 1.5127 1.5255 1.5384 1.5512 1.5640 1.5769 1.5897 1.6026 1.6154 1.6282 1.6411 1.6539 1.6667 1.6796 1.6872 1.1813 1.1510 1.1175 1.0824 1.0510 1.0161 0.9808 0.9484 0.9122 0.8756 0.8408 0.8018 0.7576 0.6977 0.7137 0.6694 0.6330 0.5941 0.5513 0.5336 0.4785 0.4390 0.4053 0.3676 0.3250 0.2883 0.2475 0.2053 0.1630 0.1205 0.0772 0.0348 0.0013 -0.0030 -0.0081 -0.0845 -0.1770 -0.2420 -0.2880 -0.3340 -0.3846 -0.4196 -0.4355 -0.4778 -0.5444 -0.5927 -0.3865 0.3631 0.9401 1.1044 0.8686 0.2929 -0.3408 -0.6882 -0.8796 -0.6756 0.0359 0.6384 0.8529 0.7913 1.1080 1.4648 1.4423 1.0503 0.3902 -0.2164 -0.5020 -0.6608 -0.7716 -0.8561 -0.9076 -0.9206 -0.9581 -1.0347 -1.1074 -1.1635 -1.2081 -1.2481 -1.2919 -1.3363 -1.3784 -1.4184 -1.4574 -1.4972 -1.5373 -1.5766 -1.6152 -1.6548 -1.6941 -1.7297 -1.7680 -1.8041 -1.8417 -1.8792 -1.9156 -1.9541 -1.9928 -2.0312 -2.0697 -2.1083 -2.1467 -2.1853 -2.2238 -2.2623 -2.3008 -2.3393 -2.3778 -2.4163 -2.4548 -2.4933 -2.5319 -2.5703 -2.6089 -2.6474 -2.6860 -2.7244 -2.7629 -2.8014 -2.8399 -2.8784 -2.9170 -2.9554 -2.9940 -3.0325 -3.0710 -3.1095 -3.1481 -3.1866 -3.2251 -3.2636 -3.3021 -3.3406 -3.3791 -3.4176 -3.4542 -3.4808 -3.5356 -3.5588 37 52 1 234 0 0 0 2.9420e-18 0.0000e+00 -0.0673 -0.0545 -0.0417 -0.0289 -0.0161 -0.0032 0.0096 0.0224 0.0352 0.0480 0.0608 0.0737 0.0865 0.0993 0.1121 0.1249 0.1378 0.1506 0.1634 0.1762 0.1890 0.2019 0.2147 0.2275 0.2403 0.2532 0.2660 0.2788 0.2916 0.3045 0.3173 0.3301 0.3429 0.3558 0.3686 0.3814 0.3943 0.4071 0.4199 0.4327 0.4456 0.4584 0.4712 0.4841 0.4969 0.5097 0.5226 0.5354 0.5482 0.5610 0.5739 0.5867 0.5995 0.6124 0.6252 0.6380 0.6509 0.6637 0.6765 0.6894 0.7022 0.7150 0.7279 0.7407 0.7535 0.7664 0.7792 0.7920 0.8049 0.8177 0.8305 0.8434 0.8562 0.8690 0.8819 0.8947 0.9075 0.9204 0.9332 0.9460 0.9589 0.9717 0.9845 0.9974 1.0102 1.0231 1.0359 1.0487 1.0616 1.0744 1.0872 1.1001 1.1129 1.1257 1.1386 1.1514 1.1642 1.1771 1.1899 1.2028 1.2156 1.2284 1.2413 1.2541 1.2669 1.2798 1.2926 1.3054 1.3183 1.3311 1.3439 1.3568 1.3696 1.3825 1.3953 1.4081 1.4210 1.4338 1.4466 1.4595 1.4723 1.4851 1.4980 1.5108 1.5237 1.5365 1.5493 1.5622 1.5750 1.5878 1.6007 1.6135 1.6264 1.6302 1.1676 1.1363 1.1014 1.0645 1.0321 0.9960 0.9585 0.9255 0.8886 0.8502 0.8165 0.7787 0.7402 0.7053 0.6661 0.6289 0.5928 0.5521 0.5157 0.4784 0.4387 0.4045 0.3663 0.2844 0.2243 0.2040 0.1712 0.1347 0.0935 0.0496 0.0099 -0.0353 -0.0784 -0.1223 -0.1715 -0.2147 -0.2641 -0.3113 -0.3645 -0.4237 -0.4677 -0.4427 -0.4279 -0.5145 -0.6327 -0.7421 -0.7117 0.0863 0.8090 1.1044 0.9910 0.5188 -0.1220 -0.4876 -0.5686 -0.5223 -0.3021 0.2637 0.7205 0.8255 0.8777 1.2809 1.4814 1.3100 0.7998 0.0852 -0.4641 -0.7711 -1.0198 -1.2163 -1.3627 -1.4660 -1.5381 -1.6097 -1.6969 -1.7815 -1.8514 -1.9112 -1.9733 -2.0402 -2.1064 -2.1704 -2.2326 -2.2931 -2.3534 -2.4123 -2.4682 -2.5259 -2.5718 -2.6100 -2.6398 -2.6760 -2.7121 -2.7505 -2.7890 -2.8274 -2.8660 -2.9045 -2.9430 -2.9815 -3.0200 -3.0585 -3.0970 -3.1356 -3.1740 -3.2126 -3.2510 -3.2896 -3.3281 -3.3667 -3.4051 -3.4437 -3.4821 -3.5207 -3.5592 -3.5977 -3.6362 -3.6747 -3.7132 -3.7517 -3.7903 -3.8288 -3.8673 -3.9058 -3.9444 -3.9828 -4.0214 -4.0598 -4.0984 -4.1363 -4.1692 -4.1991 -4.2548 -4.2667 38 52 1 240 0 0 0 2.8160e-18 0.0000e+00 -0.0679 -0.0551 -0.0424 -0.0296 -0.0168 -0.0040 0.0088 0.0216 0.0344 0.0472 0.0600 0.0728 0.0856 0.0984 0.1112 0.1241 0.1369 0.1497 0.1625 0.1753 0.1881 0.2009 0.2137 0.2265 0.2393 0.2522 0.2650 0.2778 0.2906 0.3034 0.3162 0.3291 0.3419 0.3547 0.3675 0.3803 0.3932 0.4060 0.4188 0.4316 0.4444 0.4573 0.4701 0.4829 0.4957 0.5086 0.5214 0.5342 0.5470 0.5599 0.5727 0.5855 0.5983 0.6112 0.6240 0.6368 0.6497 0.6625 0.6753 0.6881 0.7010 0.7138 0.7266 0.7395 0.7523 0.7651 0.7779 0.7908 0.8036 0.8164 0.8293 0.8421 0.8549 0.8678 0.8806 0.8934 0.9063 0.9191 0.9319 0.9448 0.9576 0.9704 0.9833 0.9961 1.0089 1.0218 1.0346 1.0474 1.0603 1.0731 1.0859 1.0988 1.1116 1.1244 1.1373 1.1501 1.1629 1.1758 1.1886 1.2014 1.2143 1.2271 1.2399 1.2528 1.2656 1.2784 1.2913 1.3041 1.3169 1.3298 1.3426 1.3555 1.3683 1.3811 1.3940 1.4068 1.4196 1.4325 1.4453 1.4581 1.4710 1.4838 1.4966 1.5095 1.5223 1.5352 1.5480 1.5608 1.5737 1.5865 1.5993 1.6122 1.6250 1.6378 1.6507 1.6635 1.6764 1.6892 1.7020 1.7134 1.1486 1.1168 1.0813 1.0434 1.0106 0.9739 0.9350 0.9008 0.8625 0.8257 0.7894 0.7486 0.7134 0.6748 0.6349 0.5985 0.5576 0.5184 0.4801 0.4369 0.3987 0.3582 0.3154 0.2851 0.2455 0.1959 0.1515 0.1068 0.0649 0.0110 -0.0267 -0.0693 -0.1180 -0.1607 -0.2076 -0.2543 -0.2965 -0.3395 -0.3698 -0.3785 -0.3935 -0.3565 -0.2854 -0.3656 -0.5211 -0.6465 -0.7752 -0.4587 0.3550 0.9547 1.0834 0.8272 0.2030 -0.6455 -1.0899 -0.8151 -0.3961 0.1328 0.6546 0.8493 0.7873 1.1095 1.4538 1.4276 1.0408 0.3936 -0.2162 -0.5152 -0.6643 -0.7995 -0.9206 -1.0055 -1.0577 -1.0938 -1.1431 -1.2020 -1.2536 -1.2980 -1.3410 -1.3829 -1.4236 -1.4622 -1.4987 -1.5338 -1.5691 -1.6040 -1.6376 -1.6700 -1.7029 -1.7348 -1.7635 -1.7935 -1.8219 -1.8506 -1.8792 -1.9147 -1.9519 -1.9903 -2.0287 -2.0672 -2.1058 -2.1442 -2.1828 -2.2213 -2.2599 -2.2983 -2.3368 -2.3753 -2.4138 -2.4523 -2.4909 -2.5294 -2.5679 -2.6064 -2.6449 -2.6834 -2.7219 -2.7605 -2.7990 -2.8375 -2.8760 -2.9146 -2.9530 -2.9915 -3.0300 -3.0686 -3.1070 -3.1456 -3.1841 -3.2226 -3.2611 -3.2996 -3.3381 -3.3766 -3.4152 -3.4536 -3.4900 -3.5176 -3.5717 -3.6059 39 52 1 243 0 0 0 1.8826e-18 0.0000e+00 -0.0692 -0.0560 -0.0428 -0.0296 -0.0164 -0.0032 0.0100 0.0232 0.0363 0.0494 0.0626 0.0757 0.0888 0.1019 0.1150 0.1281 0.1412 0.1543 0.1674 0.1804 0.1935 0.2065 0.2196 0.2326 0.2456 0.2587 0.2717 0.2847 0.2977 0.3107 0.3237 0.3367 0.3497 0.3627 0.3757 0.3886 0.4016 0.4146 0.4276 0.4405 0.4535 0.4664 0.4794 0.4923 0.5053 0.5182 0.5311 0.5441 0.5570 0.5699 0.5829 0.5958 0.6087 0.6216 0.6346 0.6475 0.6604 0.6733 0.6862 0.6991 0.7120 0.7249 0.7378 0.7507 0.7636 0.7765 0.7894 0.8023 0.8152 0.8281 0.8409 0.8538 0.8667 0.8796 0.8925 0.9054 0.9182 0.9311 0.9440 0.9569 0.9697 0.9826 0.9955 1.0084 1.0212 1.0341 1.0470 1.0598 1.0727 1.0856 1.0984 1.1113 1.1242 1.1370 1.1499 1.1627 1.1756 1.1885 1.2013 1.2142 1.2270 1.2399 1.2527 1.2656 1.2785 1.2913 1.3042 1.3170 1.3299 1.3427 1.3556 1.3684 1.3813 1.3941 1.4070 1.4198 1.4327 1.4455 1.4584 1.4712 1.4841 1.4969 1.5098 1.5226 1.5355 1.5483 1.5612 1.5740 1.5869 1.5997 1.6125 1.6254 1.6382 1.6511 1.6639 1.6768 1.6896 1.7025 1.7153 1.7281 1.7410 1.7538 1.7644 0.9737 0.9052 0.8444 0.7920 0.7404 0.6965 0.6510 0.6116 0.5683 0.5328 0.4929 0.4583 0.4231 0.3845 0.3533 0.3186 0.2859 0.2558 0.2224 0.1966 0.1748 0.1632 0.2135 0.3768 0.4740 0.3222 0.0020 -0.2077 -0.2572 -0.1252 0.2981 0.5023 0.4449 0.2393 0.1419 0.0341 -0.1144 -0.1933 -0.2045 -0.1991 -0.1247 -0.0181 0.0426 0.0768 0.1492 0.3431 0.5640 0.5979 0.3954 0.2122 0.2834 0.3211 0.2562 0.1368 0.0865 0.1895 0.3984 0.5984 0.8316 1.0054 1.0682 1.0216 0.8087 0.5785 0.4301 0.2477 0.1427 0.1256 0.2656 0.3770 0.3273 0.1515 0.0755 0.2003 0.3060 0.3220 0.2396 0.1860 0.1989 0.1894 0.1686 0.1523 0.1348 0.1159 0.0967 0.0767 0.0560 0.0344 0.0140 -0.0080 -0.0319 -0.0533 -0.0744 -0.0974 -0.1248 -0.1634 -0.1996 -0.2379 -0.2765 -0.3151 -0.3535 -0.3921 -0.4305 -0.4691 -0.5075 -0.5461 -0.5846 -0.6231 -0.6616 -0.7001 -0.7386 -0.7772 -0.8156 -0.8542 -0.8927 -0.9312 -0.9697 -1.0082 -1.0468 -1.0852 -1.1238 -1.1622 -1.2008 -1.2393 -1.2778 -1.3163 -1.3549 -1.3933 -1.4319 -1.4703 -1.5089 -1.5474 -1.5859 -1.6244 -1.6630 -1.7014 -1.7400 -1.7785 -1.8170 -1.8532 -1.8808 -1.9350 -1.9670 40 52 1 249 0 0 0 3.1520e-19 0.0000e+00 -0.0770 -0.0641 -0.0513 -0.0384 -0.0255 -0.0127 0.0002 0.0131 0.0259 0.0388 0.0517 0.0645 0.0774 0.0903 0.1031 0.1160 0.1288 0.1417 0.1546 0.1674 0.1803 0.1931 0.2060 0.2188 0.2317 0.2446 0.2574 0.2703 0.2831 0.2960 0.3088 0.3217 0.3345 0.3474 0.3602 0.3731 0.3859 0.3988 0.4116 0.4245 0.4373 0.4502 0.4630 0.4759 0.4887 0.5016 0.5144 0.5273 0.5401 0.5529 0.5658 0.5786 0.5915 0.6043 0.6172 0.6300 0.6429 0.6557 0.6685 0.6814 0.6942 0.7071 0.7199 0.7328 0.7456 0.7584 0.7713 0.7841 0.7970 0.8098 0.8227 0.8355 0.8483 0.8612 0.8740 0.8869 0.8997 0.9125 0.9254 0.9382 0.9511 0.9639 0.9768 0.9896 1.0024 1.0153 1.0281 1.0410 1.0538 1.0666 1.0795 1.0923 1.1052 1.1180 1.1308 1.1437 1.1565 1.1693 1.1822 1.1950 1.2079 1.2207 1.2335 1.2464 1.2592 1.2721 1.2849 1.2977 1.3106 1.3234 1.3363 1.3491 1.3619 1.3748 1.3876 1.4004 1.4133 1.4261 1.4390 1.4518 1.4646 1.4775 1.4903 1.5032 1.5160 1.5288 1.5417 1.5545 1.5673 1.5802 1.5930 1.6059 1.6187 1.6315 1.6444 1.6572 1.6700 1.6829 1.6957 1.7086 1.7214 1.7342 1.7471 1.7599 1.7728 1.7856 1.7984 1.8113 1.8123 0.1976 0.1903 0.1827 0.1747 0.1664 0.1576 0.1484 0.1386 0.1284 0.1224 0.1163 0.1099 0.1138 0.1261 0.1595 0.1323 0.1069 0.1048 0.1293 0.1738 0.1939 0.1376 0.0638 -0.0271 -0.1820 -0.2800 -0.2868 -0.2735 -0.2647 -0.2591 -0.2451 -0.2308 -0.2215 -0.2108 -0.2223 -0.2821 -0.3105 -0.2813 -0.2726 -0.3123 -0.3468 -0.3681 -0.3919 -0.4051 -0.4025 -0.3948 -0.3987 -0.4195 -0.4389 -0.4252 -0.3900 -0.2801 0.2215 0.8542 1.1447 1.0313 0.5450 -0.1873 -0.6494 -0.6828 -0.5987 -0.2634 0.3697 0.7731 0.8116 0.8769 1.3289 1.4976 1.2608 0.6498 -0.2306 -0.8230 -0.9983 -1.1281 -1.1785 -1.1759 -1.1488 -1.1508 -1.1865 -1.2136 -1.2288 -1.2390 -1.2509 -1.2675 -1.2842 -1.3007 -1.3171 -1.3332 -1.3496 -1.3668 -1.3848 -1.4027 -1.4203 -1.4371 -1.4550 -1.4734 -1.4886 -1.5048 -1.5221 -1.5532 -1.5899 -1.6279 -1.6663 -1.7047 -1.7432 -1.7818 -1.8203 -1.8588 -1.8973 -1.9359 -1.9744 -2.0129 -2.0513 -2.0899 -2.1283 -2.1669 -2.2053 -2.2439 -2.2824 -2.3209 -2.3594 -2.3979 -2.4364 -2.4750 -2.5135 -2.5520 -2.5905 -2.6290 -2.6676 -2.7061 -2.7446 -2.7830 -2.8216 -2.8600 -2.8986 -2.9371 -2.9757 -3.0141 -3.0527 -3.0911 -3.1297 -3.1681 -3.2067 -3.2452 -3.2833 -3.3156 -3.3631 -3.4017 -3.4048 41 52 1 249 0 0 0 4.0660e-19 0.0000e+00 -0.0788 -0.0660 -0.0531 -0.0403 -0.0274 -0.0146 -0.0017 0.0111 0.0240 0.0368 0.0497 0.0625 0.0754 0.0882 0.1010 0.1139 0.1267 0.1396 0.1524 0.1653 0.1781 0.1910 0.2038 0.2166 0.2295 0.2423 0.2552 0.2680 0.2809 0.2937 0.3065 0.3194 0.3322 0.3451 0.3579 0.3707 0.3836 0.3964 0.4093 0.4221 0.4350 0.4478 0.4606 0.4735 0.4863 0.4992 0.5120 0.5248 0.5377 0.5505 0.5634 0.5762 0.5890 0.6019 0.6147 0.6276 0.6404 0.6532 0.6661 0.6789 0.6917 0.7046 0.7174 0.7303 0.7431 0.7559 0.7688 0.7816 0.7945 0.8073 0.8201 0.8330 0.8458 0.8587 0.8715 0.8843 0.8972 0.9100 0.9228 0.9357 0.9485 0.9614 0.9742 0.9870 0.9999 1.0127 1.0255 1.0384 1.0512 1.0641 1.0769 1.0897 1.1026 1.1154 1.1283 1.1411 1.1539 1.1668 1.1796 1.1924 1.2053 1.2181 1.2310 1.2438 1.2566 1.2695 1.2823 1.2951 1.3080 1.3208 1.3337 1.3465 1.3593 1.3722 1.3850 1.3978 1.4107 1.4235 1.4364 1.4492 1.4620 1.4749 1.4877 1.5005 1.5134 1.5262 1.5391 1.5519 1.5647 1.5776 1.5904 1.6032 1.6161 1.6289 1.6418 1.6546 1.6674 1.6803 1.6931 1.7059 1.7188 1.7316 1.7445 1.7573 1.7701 1.7830 1.7958 1.8086 1.8121 0.3081 0.2933 0.2774 0.2604 0.2422 0.2227 0.2081 0.1928 0.1765 0.1590 0.1403 0.1258 0.1112 0.0956 0.0789 0.0620 0.0499 0.0369 0.0232 0.0086 0.0013 -0.0052 -0.0020 0.0161 0.0651 0.1153 0.0753 -0.0794 -0.2295 -0.2846 -0.2944 -0.2993 -0.3097 -0.3205 -0.3318 -0.3438 -0.3565 -0.3699 -0.3843 -0.3995 -0.4142 -0.4250 -0.4161 -0.3749 -0.3263 -0.2248 -0.1669 -0.2962 -0.4799 -0.5701 -0.6493 -0.6912 -0.5903 0.1123 0.8165 1.1213 1.0150 0.5568 -0.0644 -0.4014 -0.4030 -0.2897 -0.0849 0.4170 0.7879 0.8282 0.9549 1.3666 1.4790 1.2003 0.5742 -0.2317 -0.8048 -1.0205 -1.0637 -1.0552 -1.0134 -0.9841 -1.0252 -1.0866 -1.1144 -1.1229 -1.1262 -1.1422 -1.1646 -1.1831 -1.2013 -1.2199 -1.2386 -1.2573 -1.2754 -1.2930 -1.3109 -1.3301 -1.3493 -1.3649 -1.3815 -1.3994 -1.4165 -1.4325 -1.4659 -1.5025 -1.5406 -1.5790 -1.6175 -1.6561 -1.6945 -1.7331 -1.7715 -1.8101 -1.8486 -1.8872 -1.9256 -1.9641 -2.0026 -2.0412 -2.0797 -2.1182 -2.1567 -2.1952 -2.2338 -2.2722 -2.3108 -2.3492 -2.3878 -2.4262 -2.4648 -2.5033 -2.5418 -2.5803 -2.6189 -2.6573 -2.6959 -2.7344 -2.7729 -2.8114 -2.8499 -2.8884 -2.9269 -2.9655 -3.0040 -3.0425 -3.0809 -3.1195 -3.1576 -3.1903 -3.2375 -3.2759 -3.2863 42 52 1 260 0 0 0 6.7520e-19 0.0000e+00 -0.1050 -0.0924 -0.0797 -0.0671 -0.0544 -0.0417 -0.0290 -0.0163 -0.0036 0.0091 0.0218 0.0345 0.0472 0.0599 0.0726 0.0853 0.0981 0.1108 0.1235 0.1362 0.1490 0.1617 0.1745 0.1872 0.2000 0.2127 0.2255 0.2382 0.2510 0.2637 0.2765 0.2893 0.3020 0.3148 0.3276 0.3403 0.3531 0.3659 0.3787 0.3914 0.4042 0.4170 0.4298 0.4426 0.4554 0.4681 0.4809 0.4937 0.5065 0.5193 0.5321 0.5449 0.5577 0.5705 0.5833 0.5961 0.6089 0.6217 0.6345 0.6473 0.6601 0.6729 0.6857 0.6986 0.7114 0.7242 0.7370 0.7498 0.7626 0.7754 0.7882 0.8010 0.8139 0.8267 0.8395 0.8523 0.8651 0.8780 0.8908 0.9036 0.9164 0.9292 0.9420 0.9549 0.9677 0.9805 0.9933 1.0062 1.0190 1.0318 1.0446 1.0575 1.0703 1.0831 1.0959 1.1088 1.1216 1.1344 1.1472 1.1601 1.1729 1.1857 1.1986 1.2114 1.2242 1.2370 1.2499 1.2627 1.2755 1.2884 1.3012 1.3140 1.3268 1.3397 1.3525 1.3653 1.3782 1.3910 1.4038 1.4167 1.4295 1.4423 1.4552 1.4680 1.4808 1.4937 1.5065 1.5193 1.5322 1.5450 1.5578 1.5707 1.5835 1.5963 1.6092 1.6220 1.6348 1.6477 1.6605 1.6733 1.6862 1.6990 1.7118 1.7247 1.7375 1.7503 1.7632 1.7760 1.7888 1.8017 1.8145 1.8273 1.8402 1.8530 1.8659 1.8787 1.8915 1.9044 1.9172 1.9177 0.5284 0.5013 0.4716 0.4407 0.4149 0.3866 0.3554 0.3297 0.3024 0.2724 0.2481 0.2215 0.1922 0.1668 0.1414 0.1136 0.0867 0.0625 0.0362 0.0082 -0.0143 -0.0388 -0.0655 -0.0895 -0.1112 -0.1348 -0.1573 -0.1744 -0.1929 -0.2010 -0.2025 -0.1670 0.0347 0.4000 0.5813 0.5560 0.1813 -0.3339 -0.4421 -0.2165 -0.2099 -0.1805 0.0435 0.0910 -0.0522 -0.3664 -0.5738 -0.5147 -0.3886 -0.3673 -0.3554 -0.2913 -0.0971 0.1466 0.2978 0.3344 0.3303 0.3180 0.3088 0.3049 0.2926 0.2555 0.2296 0.2657 0.3991 0.5286 0.4898 0.3080 0.1676 0.1059 0.0782 0.0697 0.0918 0.1878 0.3180 0.4350 0.6326 0.8256 0.8980 0.8243 0.6856 0.6397 0.6768 0.9329 1.1364 1.1337 0.9453 0.7536 0.8586 0.9975 1.0520 1.0188 0.9356 0.9191 0.9278 0.9078 0.8881 0.8722 0.8544 0.8353 0.8157 0.7951 0.7737 0.7514 0.7306 0.7081 0.6837 0.6611 0.6396 0.6163 0.5909 0.5526 0.5139 0.4780 0.4395 0.4009 0.3624 0.3239 0.2854 0.2469 0.2083 0.1699 0.1313 0.0929 0.0543 0.0159 -0.0227 -0.0611 -0.0997 -0.1382 -0.1768 -0.2152 -0.2538 -0.2922 -0.3308 -0.3692 -0.4078 -0.4463 -0.4849 -0.5234 -0.5619 -0.6004 -0.6389 -0.6774 -0.7159 -0.7544 -0.7929 -0.8315 -0.8700 -0.9086 -0.9470 -0.9856 -1.0240 -1.0625 -1.1010 -1.1391 -1.1713 -1.2189 -1.2576 -1.2592 43 52 1 256 0 0 0 5.3100e-18 0.0000e+00 -0.1065 -0.0936 -0.0808 -0.0679 -0.0551 -0.0422 -0.0294 -0.0165 -0.0037 0.0092 0.0220 0.0349 0.0477 0.0606 0.0734 0.0863 0.0991 0.1120 0.1248 0.1377 0.1505 0.1634 0.1762 0.1891 0.2019 0.2147 0.2276 0.2404 0.2533 0.2661 0.2790 0.2918 0.3047 0.3175 0.3303 0.3432 0.3560 0.3689 0.3817 0.3946 0.4074 0.4202 0.4331 0.4459 0.4588 0.4716 0.4845 0.4973 0.5101 0.5230 0.5358 0.5487 0.5615 0.5743 0.5872 0.6000 0.6129 0.6257 0.6385 0.6514 0.6642 0.6771 0.6899 0.7027 0.7156 0.7284 0.7413 0.7541 0.7669 0.7798 0.7926 0.8055 0.8183 0.8311 0.8440 0.8568 0.8697 0.8825 0.8953 0.9082 0.9210 0.9338 0.9467 0.9595 0.9724 0.9852 0.9980 1.0109 1.0237 1.0366 1.0494 1.0622 1.0751 1.0879 1.1007 1.1136 1.1264 1.1393 1.1521 1.1649 1.1778 1.1906 1.2035 1.2163 1.2291 1.2420 1.2548 1.2676 1.2805 1.2933 1.3062 1.3190 1.3318 1.3447 1.3575 1.3703 1.3832 1.3960 1.4089 1.4217 1.4345 1.4474 1.4602 1.4730 1.4859 1.4987 1.5116 1.5244 1.5372 1.5501 1.5629 1.5758 1.5886 1.6014 1.6143 1.6271 1.6399 1.6528 1.6656 1.6785 1.6913 1.7041 1.7170 1.7298 1.7426 1.7555 1.7683 1.7812 1.7940 1.8068 1.8197 1.8325 1.8453 1.8582 1.8710 1.8794 1.4241 1.3993 1.3721 1.3423 1.3123 1.2856 1.2562 1.2252 1.1989 1.1700 1.1382 1.1089 1.0801 1.0484 1.0185 0.9897 0.9578 0.9263 0.8973 0.8654 0.8323 0.8032 0.7710 0.7374 0.7083 0.6761 0.6406 0.6119 0.5801 0.5462 0.5193 0.4914 0.4767 0.3980 0.3538 0.3240 0.2911 0.2544 0.2213 0.1871 0.1488 0.1142 0.0785 0.0385 0.0037 -0.0334 -0.0752 -0.1097 -0.1482 -0.1845 -0.2209 -0.2531 -0.2804 -0.2690 -0.1589 -0.1336 -0.2993 -0.4961 -0.6050 -0.6947 -0.7735 -0.8243 -0.8277 -0.7458 -0.2039 0.6102 1.0419 1.0512 0.6789 0.0200 -0.5941 -0.7424 -0.7655 -0.5738 0.1579 0.7015 0.8437 0.8415 1.2480 1.4923 1.3476 0.8516 0.1395 -0.4247 -0.6547 -0.7669 -0.8446 -0.8960 -0.9416 -1.0027 -1.0639 -1.1129 -1.1519 -1.1874 -1.2264 -1.2657 -1.3026 -1.3381 -1.3722 -1.4063 -1.4408 -1.4746 -1.5074 -1.5412 -1.5728 -1.6037 -1.6343 -1.6645 -1.6951 -1.7249 -1.7563 -1.7930 -1.8309 -1.8692 -1.9076 -1.9462 -1.9847 -2.0232 -2.0618 -2.1003 -2.1388 -2.1773 -2.2159 -2.2543 -2.2929 -2.3314 -2.3699 -2.4084 -2.4469 -2.4854 -2.5240 -2.5624 -2.6010 -2.6394 -2.6780 -2.7164 -2.7550 -2.7935 -2.8321 -2.8706 -2.9091 -2.9475 -2.9860 -3.0246 -3.0631 -3.1016 -3.1401 -3.1787 -3.2171 -3.2557 -3.2941 -3.3327 -3.3687 -3.3961 -3.4508 -3.4760 44 52 1 250 0 0 0 5.3000e-18 0.0000e+00 -0.1109 -0.0981 -0.0852 -0.0723 -0.0594 -0.0465 -0.0337 -0.0208 -0.0079 0.0049 0.0178 0.0307 0.0435 0.0564 0.0693 0.0821 0.0950 0.1079 0.1207 0.1336 0.1465 0.1593 0.1722 0.1850 0.1979 0.2108 0.2236 0.2365 0.2493 0.2622 0.2750 0.2879 0.3008 0.3136 0.3265 0.3393 0.3522 0.3650 0.3779 0.3907 0.4036 0.4164 0.4293 0.4421 0.4550 0.4678 0.4807 0.4935 0.5064 0.5192 0.5321 0.5449 0.5578 0.5706 0.5835 0.5963 0.6091 0.6220 0.6348 0.6477 0.6605 0.6734 0.6862 0.6991 0.7119 0.7247 0.7376 0.7504 0.7633 0.7761 0.7890 0.8018 0.8146 0.8275 0.8403 0.8532 0.8660 0.8789 0.8917 0.9045 0.9174 0.9302 0.9431 0.9559 0.9687 0.9816 0.9944 1.0073 1.0201 1.0329 1.0458 1.0586 1.0715 1.0843 1.0971 1.1100 1.1228 1.1357 1.1485 1.1613 1.1742 1.1870 1.1999 1.2127 1.2255 1.2384 1.2512 1.2641 1.2769 1.2897 1.3026 1.3154 1.3283 1.3411 1.3539 1.3668 1.3796 1.3924 1.4053 1.4181 1.4310 1.4438 1.4566 1.4695 1.4823 1.4952 1.5080 1.5208 1.5337 1.5465 1.5593 1.5722 1.5850 1.5979 1.6107 1.6235 1.6364 1.6492 1.6621 1.6749 1.6877 1.7006 1.7134 1.7262 1.7391 1.7519 1.7648 1.7776 1.7904 1.7959 1.4232 1.3951 1.3641 1.3304 1.3013 1.2691 1.2375 1.2075 1.1743 1.1410 1.1105 1.0766 1.0444 1.0133 0.9786 0.9454 0.9141 0.8794 0.8442 0.8129 0.7782 0.7413 0.7099 0.6751 0.6373 0.6054 0.5699 0.5326 0.5003 0.4644 0.4265 0.3919 0.3532 0.2959 0.2173 0.2086 0.1808 0.1496 0.1150 0.0763 0.0376 0.0010 -0.0402 -0.0791 -0.1178 -0.1618 -0.2000 -0.2415 -0.2861 -0.3258 -0.3709 -0.4168 -0.4631 -0.5194 -0.5758 -0.5839 -0.5681 -0.6112 -0.6915 -0.7604 -0.8290 -0.8927 -0.9525 -0.9888 -0.9679 -0.5011 0.4236 0.9828 1.1003 0.8150 0.2008 -0.4583 -0.7105 -0.8431 -0.8391 -0.1476 0.5383 0.8197 0.7813 1.0336 1.4142 1.4337 1.0762 0.4053 -0.4089 -0.9965 -1.2881 -1.4650 -1.5852 -1.6738 -1.7649 -1.8626 -1.9506 -2.0258 -2.0927 -2.1589 -2.2272 -2.2948 -2.3615 -2.4253 -2.4850 -2.5452 -2.6061 -2.6654 -2.7223 -2.7796 -2.8326 -2.8691 -2.9091 -2.9451 -2.9836 -3.0221 -3.0607 -3.0992 -3.1377 -3.1763 -3.2147 -3.2533 -3.2917 -3.3303 -3.3688 -3.4073 -3.4458 -3.4844 -3.5228 -3.5614 -3.5998 -3.6383 -3.6769 -3.7154 -3.7540 -3.7924 -3.8309 -3.8693 -3.9079 -3.9464 -3.9849 -4.0234 -4.0620 -4.1005 -4.1391 -4.1775 -4.2161 -4.2545 -4.2931 -4.3311 -4.3642 -4.3943 -4.4495 -4.4662 45 52 1 257 0 0 0 5.2900e-18 0.0000e+00 -0.1117 -0.0988 -0.0860 -0.0731 -0.0603 -0.0474 -0.0346 -0.0217 -0.0089 0.0040 0.0168 0.0297 0.0425 0.0554 0.0682 0.0811 0.0939 0.1068 0.1196 0.1325 0.1453 0.1582 0.1710 0.1839 0.1967 0.2096 0.2224 0.2353 0.2481 0.2610 0.2738 0.2867 0.2995 0.3123 0.3252 0.3380 0.3509 0.3637 0.3766 0.3894 0.4023 0.4151 0.4279 0.4408 0.4536 0.4665 0.4793 0.4922 0.5050 0.5178 0.5307 0.5435 0.5564 0.5692 0.5820 0.5949 0.6077 0.6206 0.6334 0.6462 0.6591 0.6719 0.6848 0.6976 0.7104 0.7233 0.7361 0.7490 0.7618 0.7746 0.7875 0.8003 0.8132 0.8260 0.8388 0.8517 0.8645 0.8774 0.8902 0.9030 0.9159 0.9287 0.9416 0.9544 0.9672 0.9801 0.9929 1.0058 1.0186 1.0314 1.0443 1.0571 1.0699 1.0828 1.0956 1.1085 1.1213 1.1341 1.1470 1.1598 1.1727 1.1855 1.1983 1.2112 1.2240 1.2368 1.2497 1.2625 1.2754 1.2882 1.3010 1.3139 1.3267 1.3395 1.3524 1.3652 1.3781 1.3909 1.4037 1.4166 1.4294 1.4423 1.4551 1.4679 1.4808 1.4936 1.5064 1.5193 1.5321 1.5450 1.5578 1.5706 1.5835 1.5963 1.6091 1.6220 1.6348 1.6477 1.6605 1.6733 1.6862 1.6990 1.7118 1.7247 1.7375 1.7504 1.7632 1.7760 1.7889 1.8017 1.8145 1.8274 1.8402 1.8531 1.8659 1.8787 1.8881 1.4224 1.3942 1.3632 1.3291 1.2999 1.2677 1.2356 1.2056 1.1725 1.1385 1.1079 1.0740 1.0410 1.0099 0.9753 0.9406 0.9086 0.8729 0.8399 0.8065 0.7692 0.7369 0.7022 0.6639 0.6316 0.5955 0.5579 0.5245 0.4871 0.4490 0.4145 0.3759 0.3381 0.3039 0.2712 0.2320 0.1881 0.1516 0.1105 0.0702 0.0306 -0.0129 -0.0492 -0.0901 -0.1337 -0.1723 -0.2160 -0.2575 -0.2988 -0.3448 -0.3815 -0.4208 -0.4512 -0.4777 -0.5232 -0.5165 -0.4613 -0.5270 -0.6733 -0.7798 -0.8745 -0.9432 -0.9926 -1.0291 -1.0216 -0.8495 -0.0756 0.6629 0.9790 0.8730 0.3838 -0.3584 -0.7197 -0.7751 -0.9152 -0.3972 0.4072 0.8084 0.8156 0.8882 1.3387 1.4901 1.2486 0.6631 -0.1146 -0.6748 -0.9332 -1.0891 -1.1880 -1.2455 -1.2975 -1.3703 -1.4442 -1.5089 -1.5659 -1.6115 -1.6537 -1.7060 -1.8061 -1.9986 -2.1392 -2.0628 -1.9709 -1.9506 -1.9727 -2.0078 -2.0436 -2.0760 -2.1101 -2.1413 -2.1746 -2.2047 -2.2388 -2.2754 -2.3134 -2.3519 -2.3905 -2.4290 -2.4675 -2.5061 -2.5445 -2.5831 -2.6215 -2.6601 -2.6985 -2.7371 -2.7755 -2.8141 -2.8526 -2.8912 -2.9296 -2.9682 -3.0067 -3.0452 -3.0837 -3.1222 -3.1607 -3.1992 -3.2377 -3.2762 -3.3148 -3.3533 -3.3918 -3.4303 -3.4689 -3.5073 -3.5459 -3.5843 -3.6229 -3.6614 -3.6999 -3.7384 -3.7769 -3.8130 -3.8405 -3.8951 -3.9230 46 52 1 261 0 0 0 7.3420e-20 0.0000e+00 -0.1268 -0.1124 -0.0980 -0.0837 -0.0694 -0.0552 -0.0410 -0.0269 -0.0128 0.0012 0.0152 0.0292 0.0431 0.0570 0.0709 0.0847 0.0985 0.1123 0.1260 0.1398 0.1534 0.1671 0.1807 0.1944 0.2079 0.2215 0.2351 0.2486 0.2621 0.2756 0.2890 0.3025 0.3159 0.3293 0.3427 0.3560 0.3694 0.3827 0.3961 0.4094 0.4227 0.4359 0.4492 0.4625 0.4757 0.4889 0.5022 0.5154 0.5286 0.5417 0.5549 0.5681 0.5812 0.5944 0.6075 0.6206 0.6338 0.6469 0.6600 0.6731 0.6862 0.6992 0.7123 0.7254 0.7384 0.7515 0.7645 0.7776 0.7906 0.8036 0.8166 0.8297 0.8427 0.8557 0.8687 0.8817 0.8947 0.9077 0.9206 0.9336 0.9466 0.9596 0.9725 0.9855 0.9984 1.0114 1.0244 1.0373 1.0502 1.0632 1.0761 1.0891 1.1020 1.1149 1.1279 1.1408 1.1537 1.1666 1.1795 1.1925 1.2054 1.2183 1.2312 1.2441 1.2570 1.2699 1.2828 1.2957 1.3086 1.3215 1.3344 1.3473 1.3602 1.3731 1.3859 1.3988 1.4117 1.4246 1.4375 1.4504 1.4632 1.4761 1.4890 1.5019 1.5147 1.5276 1.5405 1.5534 1.5662 1.5791 1.5920 1.6048 1.6177 1.6306 1.6434 1.6563 1.6692 1.6820 1.6949 1.7077 1.7206 1.7335 1.7463 1.7592 1.7720 1.7849 1.7977 1.8106 1.8235 1.8363 1.8492 1.8620 1.8749 1.8877 1.9006 1.9134 1.9263 1.9391 1.9520 1.9648 1.9697 -0.4352 -0.4380 -0.4410 -0.4440 -0.4472 -0.4504 -0.4538 -0.4573 -0.4644 -0.4739 -0.4838 -0.5000 -0.5213 -0.5523 -0.6097 -0.6947 -0.7824 0.1756 1.5349 2.2696 2.5110 2.2814 1.7143 1.0715 0.5506 0.4965 0.5539 0.6745 0.9036 1.2539 1.5517 1.6197 1.4140 0.9645 0.3763 -0.2065 -0.7376 -1.2787 -1.4326 -0.4403 0.2200 0.5608 0.5128 0.5351 0.7358 0.6617 0.2689 0.0647 0.2844 0.3866 0.2790 0.0961 0.1157 0.2293 0.3439 0.3599 0.3455 0.3178 0.3437 0.4629 0.5231 0.4445 0.3454 0.3076 0.2958 0.2776 0.2499 0.2328 0.2202 0.1975 0.1674 0.1458 0.2305 0.3924 0.4118 0.3012 0.1944 0.1330 0.2542 0.5986 0.7580 0.6283 0.3767 0.2369 0.2225 0.2214 0.1849 0.1400 0.1087 0.0950 0.0790 0.0512 0.0248 0.0045 -0.0140 -0.0335 -0.0551 -0.0767 -0.0978 -0.1194 -0.1412 -0.1630 -0.1851 -0.2071 -0.2286 -0.2505 -0.2740 -0.2995 -0.3203 -0.3418 -0.3652 -0.3903 -0.4120 -0.4396 -0.4783 -0.5143 -0.5528 -0.5914 -0.6299 -0.6684 -0.7069 -0.7453 -0.7839 -0.8224 -0.8609 -0.8994 -0.9379 -0.9764 -1.0150 -1.0534 -1.0920 -1.1305 -1.1690 -1.2075 -1.2461 -1.2845 -1.3231 -1.3615 -1.4001 -1.4386 -1.4771 -1.5156 -1.5541 -1.5927 -1.6312 -1.6697 -1.7081 -1.7467 -1.7851 -1.8237 -1.8622 -1.9008 -1.9392 -1.9777 -2.0162 -2.0548 -2.0927 -2.1258 -2.1558 -2.2112 -2.2261 47 52 1 262 0 0 0 5.0100e-19 0.0000e+00 -0.0701 -0.0572 -0.0443 -0.0314 -0.0185 -0.0056 0.0073 0.0202 0.0331 0.0460 0.0589 0.0718 0.0847 0.0976 0.1105 0.1234 0.1363 0.1491 0.1620 0.1749 0.1878 0.2007 0.2136 0.2264 0.2393 0.2522 0.2651 0.2779 0.2908 0.3037 0.3165 0.3294 0.3423 0.3551 0.3680 0.3809 0.3937 0.4066 0.4195 0.4323 0.4452 0.4581 0.4709 0.4838 0.4966 0.5095 0.5223 0.5352 0.5481 0.5609 0.5738 0.5866 0.5995 0.6123 0.6252 0.6380 0.6509 0.6637 0.6766 0.6894 0.7023 0.7151 0.7280 0.7408 0.7537 0.7665 0.7794 0.7922 0.8051 0.8179 0.8308 0.8436 0.8565 0.8693 0.8822 0.8950 0.9079 0.9207 0.9336 0.9464 0.9592 0.9721 0.9849 0.9978 1.0106 1.0235 1.0363 1.0491 1.0620 1.0748 1.0877 1.1005 1.1134 1.1262 1.1390 1.1519 1.1647 1.1776 1.1904 1.2033 1.2161 1.2289 1.2418 1.2546 1.2675 1.2803 1.2931 1.3060 1.3188 1.3317 1.3445 1.3573 1.3702 1.3830 1.3959 1.4087 1.4215 1.4344 1.4472 1.4601 1.4729 1.4857 1.4986 1.5114 1.5243 1.5371 1.5499 1.5628 1.5756 1.5885 1.6013 1.6141 1.6270 1.6398 1.6526 1.6655 1.6783 1.6912 1.7040 1.7168 1.7297 1.7425 1.7554 1.7682 1.7810 1.7939 1.8067 1.8195 1.8324 1.8452 1.8581 1.8709 1.8837 1.8966 1.9094 1.9223 1.9351 1.9479 1.9608 1.9736 1.9864 1.9867 0.3988 0.3820 0.3639 0.3444 0.3235 0.3036 0.2865 0.2682 0.2486 0.2273 0.2094 0.1923 0.1740 0.1543 0.1345 0.1186 0.1015 0.0833 0.0636 0.0467 0.0317 0.0157 -0.0013 -0.0190 -0.0303 -0.0423 -0.0550 -0.0598 -0.0556 -0.0386 0.0082 0.0727 0.0752 -0.0524 -0.2440 -0.3624 -0.3963 -0.4062 -0.4138 -0.4208 -0.4365 -0.4487 -0.4617 -0.4754 -0.4900 -0.5057 -0.5223 -0.5402 -0.5572 -0.5702 -0.5838 -0.5901 -0.5715 -0.5435 -0.5055 -0.3938 -0.3764 -0.5342 -0.6820 -0.7496 -0.8485 -0.8960 -0.8832 -0.8789 -0.8735 -0.8059 -0.3032 0.5473 1.0467 1.1196 0.7961 0.1561 -0.4444 -0.5809 -0.6521 -0.5643 0.0787 0.6538 0.8426 0.7984 1.1616 1.4749 1.3963 0.9364 0.1414 -0.8294 -1.3250 -1.3587 -1.3082 -1.2598 -1.2924 -1.3610 -1.3960 -1.4158 -1.4294 -1.4362 -1.4471 -1.4674 -1.5310 -1.6863 -1.8182 -1.7413 -1.6296 -1.5857 -1.5870 -1.6029 -1.6226 -1.6399 -1.6560 -1.6731 -1.6915 -1.7079 -1.7249 -1.7631 -1.7997 -1.8378 -1.8762 -1.9148 -1.9532 -1.9918 -2.0303 -2.0689 -2.1074 -2.1459 -2.1845 -2.2229 -2.2615 -2.2999 -2.3385 -2.3770 -2.4156 -2.4540 -2.4926 -2.5310 -2.5696 -2.6080 -2.6466 -2.6851 -2.7236 -2.7621 -2.8006 -2.8391 -2.8776 -2.9162 -2.9547 -2.9932 -3.0317 -3.0702 -3.1087 -3.1473 -3.1857 -3.2243 -3.2627 -3.3013 -3.3397 -3.3783 -3.4168 -3.4549 -3.4871 -3.5346 -3.5734 -3.5743 48 52 1 200 0 0 0 6.5860e-19 0.0000e+00 0.6411 0.6542 0.6673 0.6804 0.6935 0.7066 0.7197 0.7328 0.7459 0.7589 0.7720 0.7851 0.7981 0.8111 0.8242 0.8372 0.8502 0.8633 0.8763 0.8893 0.9023 0.9153 0.9283 0.9412 0.9542 0.9672 0.9802 0.9932 1.0061 1.0191 1.0320 1.0450 1.0580 1.0709 1.0838 1.0968 1.1097 1.1227 1.1356 1.1485 1.1615 1.1744 1.1873 1.2002 1.2131 1.2261 1.2390 1.2519 1.2648 1.2777 1.2906 1.3035 1.3164 1.3293 1.3422 1.3551 1.3680 1.3809 1.3938 1.4067 1.4195 1.4324 1.4453 1.4582 1.4711 1.4840 1.4968 1.5097 1.5226 1.5355 1.5483 1.5612 1.5741 1.5870 1.5998 1.6127 1.6256 1.6384 1.6513 1.6642 1.6770 1.6899 1.7028 1.7156 1.7285 1.7413 1.7542 1.7671 1.7799 1.7928 1.8056 1.8185 1.8314 1.8442 1.8571 1.8699 1.8828 1.8956 1.9085 1.9181 0.5176 0.5082 0.4984 0.4880 0.4770 0.4654 0.4531 0.4400 0.4262 0.4115 0.3957 0.3789 0.3611 0.3468 0.3315 0.3151 0.2976 0.2789 0.2607 0.2478 0.2380 0.3146 0.7060 1.0773 1.1189 0.7963 0.3133 0.0565 0.0087 -0.0106 -0.0298 -0.0518 -0.0757 -0.0982 -0.1205 -0.1436 -0.1665 -0.1891 -0.2114 -0.2341 -0.2580 -0.2828 -0.3073 -0.3317 -0.3568 -0.3843 -0.4095 -0.4358 -0.4626 -0.4889 -0.5169 -0.5433 -0.5718 -0.5982 -0.6264 -0.6526 -0.6799 -0.7059 -0.7392 -0.7756 -0.8138 -0.8524 -0.8909 -0.9294 -0.9679 -1.0063 -1.0449 -1.0833 -1.1219 -1.1604 -1.1989 -1.2374 -1.2759 -1.3144 -1.3530 -1.3915 -1.4300 -1.4685 -1.5070 -1.5455 -1.5840 -1.6225 -1.6610 -1.6996 -1.7380 -1.7766 -1.8150 -1.8536 -1.8921 -1.9307 -1.9691 -2.0077 -2.0461 -2.0847 -2.1232 -2.1617 -2.1978 -2.2253 -2.2797 -2.3087 49 52 1 202 0 0 0 5.5000e-19 0.0000e+00 0.6874 0.7005 0.7136 0.7267 0.7398 0.7529 0.7660 0.7791 0.7921 0.8052 0.8182 0.8313 0.8443 0.8573 0.8704 0.8834 0.8964 0.9094 0.9224 0.9354 0.9484 0.9614 0.9744 0.9874 1.0004 1.0133 1.0263 1.0393 1.0522 1.0652 1.0781 1.0911 1.1040 1.1170 1.1299 1.1429 1.1558 1.1687 1.1816 1.1946 1.2075 1.2204 1.2333 1.2463 1.2592 1.2721 1.2850 1.2979 1.3108 1.3237 1.3366 1.3495 1.3624 1.3753 1.3882 1.4011 1.4140 1.4269 1.4398 1.4526 1.4655 1.4784 1.4913 1.5042 1.5171 1.5299 1.5428 1.5557 1.5686 1.5814 1.5943 1.6072 1.6201 1.6329 1.6458 1.6587 1.6715 1.6844 1.6973 1.7101 1.7230 1.7358 1.7487 1.7616 1.7744 1.7873 1.8002 1.8130 1.8259 1.8387 1.8516 1.8644 1.8773 1.8902 1.9030 1.9159 1.9287 1.9416 1.9544 1.9673 1.9801 1.9836 0.4393 0.4316 0.4236 0.4151 0.4062 0.3968 0.3870 0.3766 0.3656 0.3540 0.3417 0.3287 0.3148 0.3001 0.2844 0.2676 0.2513 0.2374 0.2226 0.2068 0.1923 0.2007 0.4432 0.9337 1.1775 1.0390 0.5909 0.1553 0.0160 -0.0137 -0.0352 -0.0577 -0.0805 -0.0990 -0.1205 -0.1431 -0.1662 -0.1886 -0.2102 -0.2314 -0.2535 -0.2767 -0.3001 -0.3233 -0.3455 -0.3697 -0.3959 -0.4188 -0.4437 -0.4681 -0.4931 -0.5186 -0.5437 -0.5697 -0.5948 -0.6201 -0.6428 -0.6674 -0.6943 -0.7296 -0.7658 -0.8042 -0.8426 -0.8811 -0.9197 -0.9581 -0.9966 -1.0352 -1.0737 -1.1122 -1.1507 -1.1892 -1.2277 -1.2662 -1.3047 -1.3433 -1.3817 -1.4203 -1.4588 -1.4973 -1.5358 -1.5744 -1.6129 -1.6514 -1.6899 -1.7284 -1.7669 -1.8054 -1.8439 -1.8824 -1.9209 -1.9594 -1.9980 -2.0364 -2.0750 -2.1135 -2.1520 -2.1901 -2.2228 -2.2409 -2.3084 -2.3191 50 52 1 269 0 0 0 4.8100e-20 0.0000e+00 -0.0346 -0.0212 -0.0078 0.0056 0.0189 0.0322 0.0456 0.0589 0.0721 0.0854 0.0987 0.1119 0.1251 0.1384 0.1516 0.1648 0.1780 0.1911 0.2043 0.2175 0.2306 0.2437 0.2569 0.2700 0.2831 0.2962 0.3093 0.3224 0.3355 0.3486 0.3616 0.3747 0.3877 0.4008 0.4138 0.4269 0.4399 0.4529 0.4659 0.4789 0.4919 0.5049 0.5179 0.5309 0.5439 0.5569 0.5699 0.5829 0.5958 0.6088 0.6218 0.6347 0.6477 0.6606 0.6736 0.6865 0.6995 0.7124 0.7253 0.7383 0.7512 0.7641 0.7771 0.7900 0.8029 0.8158 0.8287 0.8417 0.8546 0.8675 0.8804 0.8933 0.9062 0.9191 0.9320 0.9449 0.9578 0.9707 0.9836 0.9965 1.0093 1.0222 1.0351 1.0480 1.0609 1.0738 1.0866 1.0995 1.1124 1.1253 1.1382 1.1510 1.1639 1.1768 1.1896 1.2025 1.2154 1.2283 1.2411 1.2540 1.2669 1.2797 1.2926 1.3054 1.3183 1.3312 1.3440 1.3569 1.3698 1.3826 1.3955 1.4083 1.4212 1.4340 1.4469 1.4598 1.4726 1.4855 1.4983 1.5112 1.5240 1.5369 1.5497 1.5626 1.5754 1.5883 1.6011 1.6140 1.6268 1.6397 1.6525 1.6654 1.6782 1.6911 1.7039 1.7168 1.7296 1.7425 1.7553 1.7682 1.7810 1.7938 1.8067 1.8195 1.8324 1.8452 1.8581 1.8709 1.8838 1.8966 1.9094 1.9223 1.9351 1.9480 1.9608 1.9737 1.9865 1.9993 2.0122 2.0250 2.0379 2.0507 2.0636 2.0764 2.0892 2.1021 2.1149 2.1278 2.1401 -0.6189 -0.6058 -0.5927 -0.5796 -0.5666 -0.5535 -0.5472 -0.5408 -0.5344 -0.5343 -0.5365 -0.5388 -0.5510 -0.5655 -0.5731 -0.4810 1.1792 1.2921 1.0675 0.6309 0.3050 0.2799 0.2164 0.1263 0.0890 0.1076 0.1511 0.2171 0.3135 0.4580 0.6539 0.9145 1.2396 1.4817 1.5042 1.2863 0.8875 0.4428 0.0918 -0.1517 -0.3253 -0.4498 -0.5339 -0.5570 -0.2938 0.2071 0.4462 0.3156 0.2015 0.5072 0.6363 0.4328 0.1330 0.5339 0.9152 0.9022 0.6012 0.2963 0.2724 0.2491 0.2554 0.3646 0.4298 0.4654 0.4915 0.4763 0.4500 0.4311 0.4150 0.3965 0.3753 0.3520 0.3408 0.3528 0.3492 0.3197 0.2989 0.3133 0.3882 0.5173 0.5609 0.4322 0.2344 0.1585 0.1576 0.1604 0.2335 0.5909 0.9855 1.0801 0.8477 0.5865 0.6862 0.6821 0.4252 0.0814 -0.0916 -0.1417 -0.1615 -0.1811 -0.2272 -0.3028 -0.3587 -0.3565 -0.3625 -0.3813 -0.3899 -0.4058 -0.4513 -0.5768 -0.7640 -0.7826 -0.6629 -0.5922 -0.5846 -0.6052 -0.6312 -0.6595 -0.6858 -0.7145 -0.7413 -0.7700 -0.7972 -0.8297 -0.8664 -0.9043 -0.9428 -0.9814 -1.0199 -1.0585 -1.0969 -1.1355 -1.1740 -1.2125 -1.2510 -1.2895 -1.3281 -1.3665 -1.4051 -1.4435 -1.4821 -1.5205 -1.5591 -1.5976 -1.6362 -1.6746 -1.7132 -1.7516 -1.7902 -1.8286 -1.8672 -1.9057 -1.9442 -1.9826 -2.0212 -2.0597 -2.0983 -2.1368 -2.1753 -2.2138 -2.2523 -2.2909 -2.3293 -2.3679 -2.4063 -2.4427 -2.4765 -2.5242 -2.5615 51 52 1 199 0 0 0 9.8380e-19 0.0000e+00 0.8255 0.8386 0.8518 0.8650 0.8782 0.8913 0.9045 0.9176 0.9307 0.9439 0.9570 0.9701 0.9832 0.9963 1.0093 1.0224 1.0355 1.0485 1.0616 1.0746 1.0877 1.1007 1.1137 1.1268 1.1398 1.1528 1.1658 1.1788 1.1918 1.2048 1.2178 1.2308 1.2437 1.2567 1.2697 1.2827 1.2956 1.3086 1.3215 1.3345 1.3474 1.3604 1.3733 1.3863 1.3992 1.4121 1.4251 1.4380 1.4509 1.4638 1.4768 1.4897 1.5026 1.5155 1.5284 1.5413 1.5542 1.5671 1.5800 1.5929 1.6058 1.6187 1.6316 1.6445 1.6574 1.6703 1.6832 1.6961 1.7090 1.7218 1.7347 1.7476 1.7605 1.7734 1.7862 1.7991 1.8120 1.8249 1.8377 1.8506 1.8635 1.8764 1.8892 1.9021 1.9150 1.9278 1.9407 1.9536 1.9664 1.9793 1.9921 2.0050 2.0179 2.0307 2.0436 2.0565 2.0693 2.0822 2.0855 0.6919 0.6783 0.6639 0.6485 0.6321 0.6145 0.5956 0.5768 0.5610 0.5441 0.5259 0.5063 0.4853 0.4666 0.4491 0.4305 0.4103 0.3886 0.3718 0.3554 0.3378 0.3278 0.3344 0.4901 0.8850 1.1129 0.9896 0.5479 0.1174 -0.0069 -0.0273 -0.0463 -0.0534 -0.0373 -0.0489 -0.0934 -0.1257 -0.1458 -0.1694 -0.1979 -0.2258 -0.2535 -0.2827 -0.3124 -0.3416 -0.3719 -0.4046 -0.4353 -0.4647 -0.4972 -0.5331 -0.5644 -0.5992 -0.6325 -0.6677 -0.7024 -0.7385 -0.7742 -0.8113 -0.8478 -0.8868 -0.9227 -0.9615 -0.9999 -1.0383 -1.0769 -1.1154 -1.1539 -1.1924 -1.2309 -1.2695 -1.3079 -1.3465 -1.3849 -1.4235 -1.4620 -1.5006 -1.5390 -1.5775 -1.6160 -1.6546 -1.6930 -1.7316 -1.7701 -1.8086 -1.8471 -1.8856 -1.9241 -1.9626 -2.0011 -2.0396 -2.0782 -2.1167 -2.1552 -2.1933 -2.2260 -2.2732 -2.3116 -2.3219 ****** Line transitions (../lines/nist/n2.nln) 1 2 -1 0 1 0 0 1.315e-11 7.000e-01 F 1 7 0. 0. 1 3 -1 0 1 0 0 4.955e-12 7.000e-01 F 1 7 0. 0. 1 4 -1 0 1 0 0 6.954e-08 7.000e-01 F 1 7 0. 0. 1 5 -1 0 1 0 0 1.140e-01 7.000e-01 F 1 7 0. 0. 1 6 -1 0 1 0 0 1.659e-01 7.000e-01 F 1 7 0. 0. 1 7 -1 0 1 0 0 1.418e-06 7.000e-01 F 1 7 0. 0. 1 8 -1 0 1 0 0 6.514e-02 2.000e-01 F 1 7 0. 0. 1 9 -1 0 1 0 0 2.019e-03 2.000e-01 F 1 7 0. 0. 1 10 -1 0 1 0 0 2.269e-01 7.000e-01 F 1 7 0. 0. 1 11 0 0 4 0 0 0.000e+00 5.000e-02 1 12 0 0 4 0 0 0.000e+00 5.000e-02 1 13 -1 0 1 0 0 2.231e-06 7.000e-01 F 1 7 0. 0. 1 14 0 0 4 0 0 0.000e+00 5.000e-02 1 15 0 0 4 0 0 0.000e+00 5.000e-02 1 16 0 0 4 0 0 0.000e+00 5.000e-02 1 17 0 0 4 0 0 0.000e+00 5.000e-02 1 18 -1 0 1 0 0 5.954e-04 2.000e-01 F 1 7 0. 0. 1 19 -1 0 1 0 0 1.560e-03 2.000e-01 F 1 7 0. 0. 1 20 -1 0 1 0 0 2.940e-01 2.000e-01 F 1 7 0. 0. 1 21 -1 0 1 0 0 1.023e-01 2.000e-01 F 1 7 0. 0. 1 22 -1 0 1 0 0 8.910e-05 2.000e-01 F 1 7 0. 0. 1 23 -1 0 1 0 0 4.080e-04 2.000e-01 F 1 7 0. 0. 1 24 -1 0 1 0 0 9.857e-03 2.000e-01 F 1 7 0. 0. 1 25 0 0 4 0 0 0.000e+00 5.000e-02 1 26 0 0 4 0 0 0.000e+00 5.000e-02 1 27 0 0 4 0 0 0.000e+00 5.000e-02 1 28 0 0 4 0 0 0.000e+00 5.000e-02 1 29 0 0 4 0 0 0.000e+00 5.000e-02 1 30 0 0 4 0 0 0.000e+00 5.000e-02 1 31 0 0 4 0 0 0.000e+00 5.000e-02 1 32 0 0 4 0 0 0.000e+00 5.000e-02 1 33 0 0 4 0 0 0.000e+00 5.000e-02 1 34 0 0 4 0 0 0.000e+00 5.000e-02 1 35 -1 0 1 0 0 1.189e-01 2.000e-01 F 1 7 0. 0. 1 36 -1 0 1 0 0 4.356e-02 2.000e-01 F 1 7 0. 0. 1 37 0 0 4 0 0 0.000e+00 5.000e-02 1 38 0 0 4 0 0 0.000e+00 5.000e-02 1 39 0 0 4 0 0 0.000e+00 5.000e-02 1 40 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 1 41 0 0 4 0 0 0.000e+00 5.000e-02 1 42 0 0 4 0 0 0.000e+00 5.000e-02 1 43 0 0 4 0 0 0.000e+00 5.000e-02 1 44 0 0 4 0 0 0.000e+00 5.000e-02 1 45 0 0 4 0 0 0.000e+00 5.000e-02 1 46 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 1 47 0 0 4 0 0 0.000e+00 5.000e-02 1 48 0 0 4 0 0 0.000e+00 5.000e-02 1 49 0 0 4 0 0 0.000e+00 5.000e-02 1 50 -1 0 1 0 0 3.810e-02 2.000e-01 F 1 7 0. 0. 1 51 0 0 4 0 0 0.000e+00 5.000e-02 2 3 -1 0 1 0 0 1.160e-09 7.000e-01 F 1 7 0. 0. 2 4 -1 0 1 0 0 1.410e-12 7.000e-01 F 1 7 0. 0. 2 5 -1 0 1 0 0 1.357e-06 7.000e-01 F 1 7 0. 0. 2 6 -1 0 1 0 0 8.310e-07 7.000e-01 F 1 7 0. 0. 2 7 -1 0 1 0 0 2.780e-01 7.000e-01 F 1 7 0. 0. 2 8 -1 0 1 0 0 1.930e-02 2.000e-01 F 1 7 0. 0. 2 9 -1 0 1 0 0 1.930e-01 2.000e-01 F 1 7 0. 0. 2 10 -1 0 1 0 0 2.950e-06 7.000e-01 F 1 7 0. 0. 2 11 0 0 4 0 0 0.000e+00 5.000e-02 2 12 0 0 4 0 0 0.000e+00 5.000e-02 2 13 -1 0 1 0 0 1.450e-01 7.000e-01 F 1 7 0. 0. 2 14 0 0 4 0 0 0.000e+00 5.000e-02 2 15 0 0 4 0 0 0.000e+00 5.000e-02 2 16 0 0 4 0 0 0.000e+00 5.000e-02 2 17 0 0 4 0 0 0.000e+00 5.000e-02 2 18 -1 0 1 0 0 1.178e-03 2.000e-01 F 1 7 0. 0. 2 19 -1 0 1 0 0 1.450e-01 2.000e-01 F 1 7 0. 0. 2 20 -1 0 1 0 0 7.042e-04 2.000e-01 F 1 7 0. 0. 2 21 -1 0 1 0 0 1.420e-04 2.000e-01 F 1 7 0. 0. 2 22 -1 0 1 0 0 2.500e-01 2.000e-01 F 1 7 0. 0. 2 23 -1 0 1 0 0 1.180e-04 2.000e-01 F 1 7 0. 0. 2 24 0 0 4 0 0 0.000e+00 5.000e-02 2 25 -1 0 1 0 0 5.830e-03 2.000e-01 F 1 7 0. 0. 2 26 0 0 4 0 0 0.000e+00 5.000e-02 2 27 0 0 4 0 0 0.000e+00 5.000e-02 2 28 0 0 4 0 0 0.000e+00 5.000e-02 2 29 0 0 4 0 0 0.000e+00 5.000e-02 2 30 0 0 4 0 0 0.000e+00 5.000e-02 2 31 0 0 4 0 0 0.000e+00 5.000e-02 2 32 0 0 4 0 0 0.000e+00 5.000e-02 2 33 0 0 4 0 0 0.000e+00 5.000e-02 2 34 -1 0 1 0 0 4.910e-02 2.000e-01 F 1 7 0. 0. 2 35 0 0 4 0 0 0.000e+00 5.000e-02 2 36 0 0 4 0 0 0.000e+00 5.000e-02 2 37 -1 0 1 0 0 1.020e-01 2.000e-01 F 1 7 0. 0. 2 38 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 2 39 0 0 4 0 0 0.000e+00 5.000e-02 2 40 0 0 4 0 0 0.000e+00 5.000e-02 2 41 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 2 42 0 0 4 0 0 0.000e+00 5.000e-02 2 43 -1 0 1 0 0 2.250e-02 2.000e-01 F 1 7 0. 0. 2 44 -1 0 1 0 0 4.850e-02 2.000e-01 F 1 7 0. 0. 2 45 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 2 46 0 0 4 0 0 0.000e+00 5.000e-02 2 47 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 2 48 0 0 4 0 0 0.000e+00 5.000e-02 2 49 0 0 4 0 0 0.000e+00 5.000e-02 2 50 0 0 4 0 0 0.000e+00 5.000e-02 2 51 0 0 4 0 0 0.000e+00 5.000e-02 3 4 0 0 4 0 0 0.000e+00 5.000e-02 3 5 -1 0 1 0 0 4.260e-07 7.000e-01 F 1 7 0. 0. 3 6 -1 0 1 0 0 1.520e-06 7.000e-01 F 1 7 0. 0. 3 7 0 0 4 0 0 0.000e+00 5.000e-02 3 8 -1 0 1 0 0 1.690e-03 2.000e-01 F 1 7 0. 0. 3 9 -1 0 1 0 0 1.380e-02 2.000e-01 F 1 7 0. 0. 3 10 -1 0 1 0 0 2.960e-06 7.000e-01 F 1 7 0. 0. 3 11 0 0 4 0 0 0.000e+00 5.000e-02 3 12 0 0 4 0 0 0.000e+00 5.000e-02 3 13 -1 0 1 0 0 3.130e-01 7.000e-01 F 1 7 0. 0. 3 14 0 0 4 0 0 0.000e+00 5.000e-02 3 15 0 0 4 0 0 0.000e+00 5.000e-02 3 16 0 0 4 0 0 0.000e+00 5.000e-02 3 17 0 0 4 0 0 0.000e+00 5.000e-02 3 18 0 0 4 0 0 0.000e+00 5.000e-02 3 19 0 0 4 0 0 0.000e+00 5.000e-02 3 20 -1 0 1 0 0 2.100e-04 2.000e-01 F 1 7 0. 0. 3 21 -1 0 1 0 0 3.230e-04 2.000e-01 F 1 7 0. 0. 3 22 0 0 4 0 0 0.000e+00 5.000e-02 3 23 -1 0 1 0 0 4.230e-01 2.000e-01 F 1 7 0. 0. 3 24 -1 0 1 0 0 2.240e-04 2.000e-01 F 1 7 0. 0. 3 25 -1 0 1 0 0 6.220e-02 2.000e-01 F 1 7 0. 0. 3 26 0 0 4 0 0 0.000e+00 5.000e-02 3 27 0 0 4 0 0 0.000e+00 5.000e-02 3 28 0 0 4 0 0 0.000e+00 5.000e-02 3 29 0 0 4 0 0 0.000e+00 5.000e-02 3 30 0 0 4 0 0 0.000e+00 5.000e-02 3 31 0 0 4 0 0 0.000e+00 5.000e-02 3 32 0 0 4 0 0 0.000e+00 5.000e-02 3 33 0 0 4 0 0 0.000e+00 5.000e-02 3 34 0 0 4 0 0 0.000e+00 5.000e-02 3 35 0 0 4 0 0 0.000e+00 5.000e-02 3 36 0 0 4 0 0 0.000e+00 5.000e-02 3 37 0 0 4 0 0 0.000e+00 5.000e-02 3 38 -1 0 1 0 0 1.610e-01 2.000e-01 F 1 7 0. 0. 3 39 0 0 4 0 0 0.000e+00 5.000e-02 3 40 0 0 4 0 0 0.000e+00 5.000e-02 3 41 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 3 42 0 0 4 0 0 0.000e+00 5.000e-02 3 43 0 0 4 0 0 0.000e+00 5.000e-02 3 44 0 0 4 0 0 0.000e+00 5.000e-02 3 45 -1 0 1 0 0 7.740e-02 2.000e-01 F 1 7 0. 0. 3 46 0 0 4 0 0 0.000e+00 5.000e-02 3 47 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 3 48 0 0 4 0 0 0.000e+00 5.000e-02 3 49 0 0 4 0 0 0.000e+00 5.000e-02 3 50 0 0 4 0 0 0.000e+00 5.000e-02 3 51 0 0 4 0 0 0.000e+00 5.000e-02 4 5 0 0 4 0 0 0.000e+00 5.000e-02 4 6 0 0 4 0 0 0.000e+00 5.000e-02 4 7 0 0 4 0 0 0.000e+00 5.000e-02 4 8 0 0 4 0 0 0.000e+00 5.000e-02 4 9 0 0 4 0 0 0.000e+00 5.000e-02 4 10 0 0 4 0 0 0.000e+00 5.000e-02 4 11 0 0 4 0 0 0.000e+00 5.000e-02 4 12 0 0 4 0 0 0.000e+00 5.000e-02 4 13 0 0 4 0 0 0.000e+00 5.000e-02 4 14 0 0 4 0 0 0.000e+00 5.000e-02 4 15 0 0 4 0 0 0.000e+00 5.000e-02 4 16 0 0 4 0 0 0.000e+00 5.000e-02 4 17 0 0 4 0 0 0.000e+00 5.000e-02 4 18 0 0 4 0 0 0.000e+00 5.000e-02 4 19 0 0 4 0 0 0.000e+00 5.000e-02 4 20 0 0 4 0 0 0.000e+00 5.000e-02 4 21 0 0 4 0 0 0.000e+00 5.000e-02 4 22 0 0 4 0 0 0.000e+00 5.000e-02 4 23 0 0 4 0 0 0.000e+00 5.000e-02 4 24 0 0 4 0 0 0.000e+00 5.000e-02 4 25 0 0 4 0 0 0.000e+00 5.000e-02 4 26 0 0 4 0 0 0.000e+00 5.000e-02 4 27 0 0 4 0 0 0.000e+00 5.000e-02 4 28 0 0 4 0 0 0.000e+00 5.000e-02 4 29 0 0 4 0 0 0.000e+00 5.000e-02 4 30 0 0 4 0 0 0.000e+00 5.000e-02 4 31 -1 0 1 0 0 1.915e-01 2.000e-01 F 1 7 0. 0. 4 32 0 0 4 0 0 0.000e+00 5.000e-02 4 33 0 0 4 0 0 0.000e+00 5.000e-02 4 34 0 0 4 0 0 0.000e+00 5.000e-02 4 35 0 0 4 0 0 0.000e+00 5.000e-02 4 36 0 0 4 0 0 0.000e+00 5.000e-02 4 37 0 0 4 0 0 0.000e+00 5.000e-02 4 38 0 0 4 0 0 0.000e+00 5.000e-02 4 39 0 0 4 0 0 0.000e+00 5.000e-02 4 40 0 0 4 0 0 0.000e+00 5.000e-02 4 41 0 0 4 0 0 0.000e+00 5.000e-02 4 42 0 0 4 0 0 0.000e+00 5.000e-02 4 43 0 0 4 0 0 0.000e+00 5.000e-02 4 44 0 0 4 0 0 0.000e+00 5.000e-02 4 45 0 0 4 0 0 0.000e+00 5.000e-02 4 46 0 0 4 0 0 0.000e+00 5.000e-02 4 47 0 0 4 0 0 0.000e+00 5.000e-02 4 48 0 0 4 0 0 0.000e+00 5.000e-02 4 49 0 0 4 0 0 0.000e+00 5.000e-02 4 50 0 0 4 0 0 0.000e+00 5.000e-02 4 51 0 0 4 0 0 0.000e+00 5.000e-02 5 6 0 0 4 0 0 0.000e+00 5.000e-02 5 7 0 0 4 0 0 0.000e+00 5.000e-02 5 8 0 0 4 0 0 0.000e+00 5.000e-02 5 9 0 0 4 0 0 0.000e+00 5.000e-02 5 10 0 0 4 0 0 0.000e+00 5.000e-02 5 11 0 0 4 0 0 0.000e+00 5.000e-02 5 12 -1 0 1 0 0 2.004e-03 2.000e-01 F 1 7 0. 0. 5 13 0 0 4 0 0 0.000e+00 5.000e-02 5 14 0 0 4 0 0 0.000e+00 5.000e-02 5 15 -1 0 1 0 0 9.775e-03 2.000e-01 F 1 7 0. 0. 5 16 0 0 4 0 0 0.000e+00 5.000e-02 5 17 0 0 4 0 0 0.000e+00 5.000e-02 5 18 0 0 4 0 0 0.000e+00 5.000e-02 5 19 0 0 4 0 0 0.000e+00 5.000e-02 5 20 0 0 4 0 0 0.000e+00 5.000e-02 5 21 0 0 4 0 0 0.000e+00 5.000e-02 5 22 0 0 4 0 0 0.000e+00 5.000e-02 5 23 0 0 4 0 0 0.000e+00 5.000e-02 5 24 0 0 4 0 0 0.000e+00 5.000e-02 5 25 0 0 4 0 0 0.000e+00 5.000e-02 5 26 -1 0 1 0 0 4.740e-05 2.000e-01 F 1 7 0. 0. 5 27 -1 0 1 0 0 2.027e-03 2.000e-01 F 1 7 0. 0. 5 28 -1 0 1 0 0 3.084e-02 2.000e-01 F 1 7 0. 0. 5 29 -1 0 1 0 0 3.756e-04 2.000e-01 F 1 7 0. 0. 5 30 0 0 4 0 0 0.000e+00 5.000e-02 5 31 0 0 4 0 0 0.000e+00 5.000e-02 5 32 0 0 4 0 0 0.000e+00 5.000e-02 5 33 0 0 4 0 0 0.000e+00 5.000e-02 5 34 0 0 4 0 0 0.000e+00 5.000e-02 5 35 0 0 4 0 0 0.000e+00 5.000e-02 5 36 0 0 4 0 0 0.000e+00 5.000e-02 5 37 0 0 4 0 0 0.000e+00 5.000e-02 5 38 0 0 4 0 0 0.000e+00 5.000e-02 5 39 -1 0 1 0 0 9.167e-02 2.000e-01 F 1 7 0. 0. 5 40 0 0 4 0 0 0.000e+00 5.000e-02 5 41 0 0 4 0 0 0.000e+00 5.000e-02 5 42 -1 0 1 0 0 0.000e+00 7.000e-01 F 1 7 0. 0. 5 43 0 0 4 0 0 0.000e+00 5.000e-02 5 44 0 0 4 0 0 0.000e+00 5.000e-02 5 45 0 0 4 0 0 0.000e+00 5.000e-02 5 46 0 0 4 0 0 0.000e+00 5.000e-02 5 47 0 0 4 0 0 0.000e+00 5.000e-02 5 48 0 0 4 0 0 0.000e+00 5.000e-02 5 49 0 0 4 0 0 0.000e+00 5.000e-02 5 50 0 0 4 0 0 0.000e+00 5.000e-02 5 51 0 0 4 0 0 0.000e+00 5.000e-02 6 7 0 0 4 0 0 0.000e+00 5.000e-02 6 8 0 0 4 0 0 0.000e+00 5.000e-02 6 9 0 0 4 0 0 0.000e+00 5.000e-02 6 10 0 0 4 0 0 0.000e+00 5.000e-02 6 11 0 0 4 0 0 0.000e+00 5.000e-02 6 12 -1 0 1 0 0 1.832e-02 2.000e-01 F 1 7 0. 0. 6 13 0 0 4 0 0 0.000e+00 5.000e-02 6 14 -1 0 1 0 0 1.204e-02 2.000e-01 F 1 7 0. 0. 6 15 -1 0 1 0 0 1.005e-03 2.000e-01 F 1 7 0. 0. 6 16 0 0 4 0 0 0.000e+00 5.000e-02 6 17 0 0 4 0 0 0.000e+00 5.000e-02 6 18 0 0 4 0 0 0.000e+00 5.000e-02 6 19 0 0 4 0 0 0.000e+00 5.000e-02 6 20 0 0 4 0 0 0.000e+00 5.000e-02 6 21 0 0 4 0 0 0.000e+00 5.000e-02 6 22 0 0 4 0 0 0.000e+00 5.000e-02 6 23 0 0 4 0 0 0.000e+00 5.000e-02 6 24 0 0 4 0 0 0.000e+00 5.000e-02 6 25 0 0 4 0 0 0.000e+00 5.000e-02 6 26 0 0 4 0 0 0.000e+00 5.000e-02 6 27 -1 0 1 0 0 2.151e-03 2.000e-01 F 1 7 0. 0. 6 28 -1 0 1 0 0 7.561e-03 2.000e-01 F 1 7 0. 0. 6 29 -1 0 1 0 0 5.246e-03 2.000e-01 F 1 7 0. 0. 6 30 0 0 4 0 0 0.000e+00 5.000e-02 6 31 0 0 4 0 0 0.000e+00 5.000e-02 6 32 0 0 4 0 0 0.000e+00 5.000e-02 6 33 0 0 4 0 0 0.000e+00 5.000e-02 6 34 0 0 4 0 0 0.000e+00 5.000e-02 6 35 0 0 4 0 0 0.000e+00 5.000e-02 6 36 0 0 4 0 0 0.000e+00 5.000e-02 6 37 0 0 4 0 0 0.000e+00 5.000e-02 6 38 0 0 4 0 0 0.000e+00 5.000e-02 6 39 -1 0 1 0 0 2.521e-02 2.000e-01 F 1 7 0. 0. 6 40 0 0 4 0 0 0.000e+00 5.000e-02 6 41 0 0 4 0 0 0.000e+00 5.000e-02 6 42 -1 0 1 0 0 0.000e+00 7.000e-01 F 1 7 0. 0. 6 43 0 0 4 0 0 0.000e+00 5.000e-02 6 44 0 0 4 0 0 0.000e+00 5.000e-02 6 45 0 0 4 0 0 0.000e+00 5.000e-02 6 46 0 0 4 0 0 0.000e+00 5.000e-02 6 47 0 0 4 0 0 0.000e+00 5.000e-02 6 48 0 0 4 0 0 0.000e+00 5.000e-02 6 49 0 0 4 0 0 0.000e+00 5.000e-02 6 50 0 0 4 0 0 0.000e+00 5.000e-02 6 51 0 0 4 0 0 0.000e+00 5.000e-02 7 8 0 0 4 0 0 0.000e+00 5.000e-02 7 9 0 0 4 0 0 0.000e+00 5.000e-02 7 10 0 0 4 0 0 0.000e+00 5.000e-02 7 11 -1 0 1 0 0 9.190e-03 2.000e-01 F 1 7 0. 0. 7 12 0 0 4 0 0 0.000e+00 5.000e-02 7 13 0 0 4 0 0 0.000e+00 5.000e-02 7 14 0 0 4 0 0 0.000e+00 5.000e-02 7 15 0 0 4 0 0 0.000e+00 5.000e-02 7 16 -1 0 1 0 0 4.470e-03 2.000e-01 F 1 7 0. 0. 7 17 0 0 4 0 0 0.000e+00 5.000e-02 7 18 0 0 4 0 0 0.000e+00 5.000e-02 7 19 0 0 4 0 0 0.000e+00 5.000e-02 7 20 0 0 4 0 0 0.000e+00 5.000e-02 7 21 0 0 4 0 0 0.000e+00 5.000e-02 7 22 0 0 4 0 0 0.000e+00 5.000e-02 7 23 0 0 4 0 0 0.000e+00 5.000e-02 7 24 0 0 4 0 0 0.000e+00 5.000e-02 7 25 0 0 4 0 0 0.000e+00 5.000e-02 7 26 -1 0 1 0 0 7.710e-03 2.000e-01 F 1 7 0. 0. 7 27 -1 0 1 0 0 5.880e-05 2.000e-01 F 1 7 0. 0. 7 28 0 0 4 0 0 0.000e+00 5.000e-02 7 29 0 0 4 0 0 0.000e+00 5.000e-02 7 30 -1 0 1 0 0 6.290e-03 2.000e-01 F 1 7 0. 0. 7 31 0 0 4 0 0 0.000e+00 5.000e-02 7 32 0 0 4 0 0 0.000e+00 5.000e-02 7 33 0 0 4 0 0 0.000e+00 5.000e-02 7 34 0 0 4 0 0 0.000e+00 5.000e-02 7 35 0 0 4 0 0 0.000e+00 5.000e-02 7 36 0 0 4 0 0 0.000e+00 5.000e-02 7 37 0 0 4 0 0 0.000e+00 5.000e-02 7 38 0 0 4 0 0 0.000e+00 5.000e-02 7 39 0 0 4 0 0 0.000e+00 5.000e-02 7 40 0 0 4 0 0 0.000e+00 5.000e-02 7 41 0 0 4 0 0 0.000e+00 5.000e-02 7 42 0 0 4 0 0 0.000e+00 5.000e-02 7 43 0 0 4 0 0 0.000e+00 5.000e-02 7 44 0 0 4 0 0 0.000e+00 5.000e-02 7 45 0 0 4 0 0 0.000e+00 5.000e-02 7 46 0 0 4 0 0 0.000e+00 5.000e-02 7 47 0 0 4 0 0 0.000e+00 5.000e-02 7 48 0 0 4 0 0 0.000e+00 5.000e-02 7 49 0 0 4 0 0 0.000e+00 5.000e-02 7 50 0 0 4 0 0 0.000e+00 5.000e-02 7 51 0 0 4 0 0 0.000e+00 5.000e-02 8 9 0 0 4 0 0 0.000e+00 5.000e-02 8 10 0 0 4 0 0 0.000e+00 5.000e-02 8 11 -1 0 1 0 0 1.245e-02 7.000e-01 F 1 7 0. 0. 8 12 -1 0 1 0 0 4.127e-01 7.000e-01 F 1 7 0. 0. 8 13 0 0 4 0 0 0.000e+00 5.000e-02 8 14 -1 0 1 0 0 8.158e-02 7.000e-01 F 1 7 0. 0. 8 15 -1 0 1 0 0 3.203e-01 7.000e-01 F 1 7 0. 0. 8 16 -1 0 1 0 0 1.711e-02 7.000e-01 F 1 7 0. 0. 8 17 -1 0 1 0 0 1.270e-02 7.000e-01 F 1 7 0. 0. 8 18 0 0 4 0 0 0.000e+00 5.000e-02 8 19 0 0 4 0 0 0.000e+00 5.000e-02 8 20 0 0 4 0 0 0.000e+00 5.000e-02 8 21 0 0 4 0 0 0.000e+00 5.000e-02 8 22 0 0 4 0 0 0.000e+00 5.000e-02 8 23 0 0 4 0 0 0.000e+00 5.000e-02 8 24 0 0 4 0 0 0.000e+00 5.000e-02 8 25 0 0 4 0 0 0.000e+00 5.000e-02 8 26 -1 0 1 0 0 4.251e-04 2.000e-01 F 1 7 0. 0. 8 27 -1 0 1 0 0 2.006e-02 2.000e-01 F 1 7 0. 0. 8 28 -1 0 1 0 0 4.389e-03 2.000e-01 F 1 7 0. 0. 8 29 -1 0 1 0 0 2.751e-03 2.000e-01 F 1 7 0. 0. 8 30 -1 0 1 0 0 2.530e-04 2.000e-01 F 1 7 0. 0. 8 31 0 0 4 0 0 0.000e+00 5.000e-02 8 32 -1 0 1 0 0 3.140e-04 2.000e-01 F 1 7 0. 0. 8 33 0 0 4 0 0 0.000e+00 5.000e-02 8 34 0 0 4 0 0 0.000e+00 5.000e-02 8 35 0 0 4 0 0 0.000e+00 5.000e-02 8 36 0 0 4 0 0 0.000e+00 5.000e-02 8 37 0 0 4 0 0 0.000e+00 5.000e-02 8 38 0 0 4 0 0 0.000e+00 5.000e-02 8 39 -1 0 1 0 0 5.956e-03 7.000e-01 F 1 7 0. 0. 8 40 0 0 4 0 0 0.000e+00 5.000e-02 8 41 0 0 4 0 0 0.000e+00 5.000e-02 8 42 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 8 43 0 0 4 0 0 0.000e+00 5.000e-02 8 44 0 0 4 0 0 0.000e+00 5.000e-02 8 45 0 0 4 0 0 0.000e+00 5.000e-02 8 46 0 0 4 0 0 0.000e+00 5.000e-02 8 47 0 0 4 0 0 0.000e+00 5.000e-02 8 48 0 0 4 0 0 0.000e+00 5.000e-02 8 49 0 0 4 0 0 0.000e+00 5.000e-02 8 50 0 0 4 0 0 0.000e+00 5.000e-02 8 51 0 0 4 0 0 0.000e+00 5.000e-02 9 10 0 0 4 0 0 0.000e+00 5.000e-02 9 11 -1 0 1 0 0 1.900e-01 7.000e-01 F 1 7 0. 0. 9 12 -1 0 1 0 0 4.030e-02 7.000e-01 F 1 7 0. 0. 9 13 0 0 4 0 0 0.000e+00 5.000e-02 9 14 -1 0 1 0 0 1.000e-02 7.000e-01 F 1 7 0. 0. 9 15 -1 0 1 0 0 3.447e-02 7.000e-01 F 1 7 0. 0. 9 16 -1 0 1 0 0 5.390e-01 7.000e-01 F 1 7 0. 0. 9 17 -1 0 1 0 0 1.220e-01 7.000e-01 F 1 7 0. 0. 9 18 0 0 4 0 0 0.000e+00 5.000e-02 9 19 0 0 4 0 0 0.000e+00 5.000e-02 9 20 0 0 4 0 0 0.000e+00 5.000e-02 9 21 0 0 4 0 0 0.000e+00 5.000e-02 9 22 0 0 4 0 0 0.000e+00 5.000e-02 9 23 0 0 4 0 0 0.000e+00 5.000e-02 9 24 0 0 4 0 0 0.000e+00 5.000e-02 9 25 0 0 4 0 0 0.000e+00 5.000e-02 9 26 -1 0 1 0 0 1.940e-02 2.000e-01 F 1 7 0. 0. 9 27 -1 0 1 0 0 1.349e-03 2.000e-01 F 1 7 0. 0. 9 28 -1 0 1 0 0 2.704e-04 2.000e-01 F 1 7 0. 0. 9 29 -1 0 1 0 0 2.010e-04 2.000e-01 F 1 7 0. 0. 9 30 -1 0 1 0 0 3.190e-03 2.000e-01 F 1 7 0. 0. 9 31 0 0 4 0 0 0.000e+00 5.000e-02 9 32 -1 0 1 0 0 5.860e-03 2.000e-01 F 1 7 0. 0. 9 33 0 0 4 0 0 0.000e+00 5.000e-02 9 34 0 0 4 0 0 0.000e+00 5.000e-02 9 35 0 0 4 0 0 0.000e+00 5.000e-02 9 36 0 0 4 0 0 0.000e+00 5.000e-02 9 37 0 0 4 0 0 0.000e+00 5.000e-02 9 38 0 0 4 0 0 0.000e+00 5.000e-02 9 39 -1 0 1 0 0 3.291e-04 7.000e-01 F 1 7 0. 0. 9 40 0 0 4 0 0 0.000e+00 5.000e-02 9 41 0 0 4 0 0 0.000e+00 5.000e-02 9 42 0 0 4 0 0 0.000e+00 5.000e-02 9 43 0 0 4 0 0 0.000e+00 5.000e-02 9 44 0 0 4 0 0 0.000e+00 5.000e-02 9 45 0 0 4 0 0 0.000e+00 5.000e-02 9 46 0 0 4 0 0 0.000e+00 5.000e-02 9 47 0 0 4 0 0 0.000e+00 5.000e-02 9 48 0 0 4 0 0 0.000e+00 5.000e-02 9 49 0 0 4 0 0 0.000e+00 5.000e-02 9 50 0 0 4 0 0 0.000e+00 5.000e-02 9 51 0 0 4 0 0 0.000e+00 5.000e-02 10 11 0 0 4 0 0 0.000e+00 5.000e-02 10 12 0 0 4 0 0 0.000e+00 5.000e-02 10 13 0 0 4 0 0 0.000e+00 5.000e-02 10 14 0 0 4 0 0 0.000e+00 5.000e-02 10 15 -1 0 1 0 0 2.705e-04 2.000e-01 F 1 7 0. 0. 10 16 0 0 4 0 0 0.000e+00 5.000e-02 10 17 0 0 4 0 0 0.000e+00 5.000e-02 10 18 0 0 4 0 0 0.000e+00 5.000e-02 10 19 0 0 4 0 0 0.000e+00 5.000e-02 10 20 0 0 4 0 0 0.000e+00 5.000e-02 10 21 0 0 4 0 0 0.000e+00 5.000e-02 10 22 0 0 4 0 0 0.000e+00 5.000e-02 10 23 0 0 4 0 0 0.000e+00 5.000e-02 10 24 0 0 4 0 0 0.000e+00 5.000e-02 10 25 0 0 4 0 0 0.000e+00 5.000e-02 10 26 0 0 4 0 0 0.000e+00 5.000e-02 10 27 0 0 4 0 0 0.000e+00 5.000e-02 10 28 -1 0 1 0 0 1.017e-02 2.000e-01 F 1 7 0. 0. 10 29 0 0 4 0 0 0.000e+00 5.000e-02 10 30 0 0 4 0 0 0.000e+00 5.000e-02 10 31 0 0 4 0 0 0.000e+00 5.000e-02 10 32 0 0 4 0 0 0.000e+00 5.000e-02 10 33 0 0 4 0 0 0.000e+00 5.000e-02 10 34 0 0 4 0 0 0.000e+00 5.000e-02 10 35 0 0 4 0 0 0.000e+00 5.000e-02 10 36 0 0 4 0 0 0.000e+00 5.000e-02 10 37 0 0 4 0 0 0.000e+00 5.000e-02 10 38 0 0 4 0 0 0.000e+00 5.000e-02 10 39 -1 0 1 0 0 7.357e-02 2.000e-01 F 1 7 0. 0. 10 40 0 0 4 0 0 0.000e+00 5.000e-02 10 41 0 0 4 0 0 0.000e+00 5.000e-02 10 42 -1 0 1 0 0 0.000e+00 7.000e-01 F 1 7 0. 0. 10 43 0 0 4 0 0 0.000e+00 5.000e-02 10 44 0 0 4 0 0 0.000e+00 5.000e-02 10 45 0 0 4 0 0 0.000e+00 5.000e-02 10 46 0 0 4 0 0 0.000e+00 5.000e-02 10 47 0 0 4 0 0 0.000e+00 5.000e-02 10 48 0 0 4 0 0 0.000e+00 5.000e-02 10 49 0 0 4 0 0 0.000e+00 5.000e-02 10 50 0 0 4 0 0 0.000e+00 5.000e-02 10 51 0 0 4 0 0 0.000e+00 5.000e-02 11 12 0 0 4 0 0 0.000e+00 5.000e-02 11 13 -1 0 1 0 0 8.460e-03 2.000e-01 F 1 7 0. 0. 11 14 0 0 4 0 0 0.000e+00 5.000e-02 11 15 0 0 4 0 0 0.000e+00 5.000e-02 11 16 0 0 4 0 0 0.000e+00 5.000e-02 11 17 0 0 4 0 0 0.000e+00 5.000e-02 11 18 -1 0 1 0 0 7.350e-03 7.000e-01 F 1 7 0. 0. 11 19 -1 0 1 0 0 5.640e-01 7.000e-01 F 1 7 0. 0. 11 20 -1 0 1 0 0 3.077e-03 7.000e-01 F 1 7 0. 0. 11 21 -1 0 1 0 0 5.280e-04 7.000e-01 F 1 7 0. 0. 11 22 0 0 4 0 0 0.000e+00 5.000e-02 11 23 -1 0 1 0 0 1.560e-01 7.000e-01 F 1 7 0. 0. 11 24 -1 0 1 0 0 8.960e-04 2.000e-01 F 1 7 0. 0. 11 25 -1 0 1 0 0 1.250e-01 2.000e-01 F 1 7 0. 0. 11 26 0 0 4 0 0 0.000e+00 5.000e-02 11 27 0 0 4 0 0 0.000e+00 5.000e-02 11 28 0 0 4 0 0 0.000e+00 5.000e-02 11 29 0 0 4 0 0 0.000e+00 5.000e-02 11 30 0 0 4 0 0 0.000e+00 5.000e-02 11 31 0 0 4 0 0 0.000e+00 5.000e-02 11 32 0 0 4 0 0 0.000e+00 5.000e-02 11 33 0 0 4 0 0 0.000e+00 5.000e-02 11 34 -1 0 1 0 0 8.570e-03 2.000e-01 F 1 7 0. 0. 11 35 0 0 4 0 0 0.000e+00 5.000e-02 11 36 0 0 4 0 0 0.000e+00 5.000e-02 11 37 0 0 4 0 0 0.000e+00 5.000e-02 11 38 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 11 39 0 0 4 0 0 0.000e+00 5.000e-02 11 40 0 0 4 0 0 0.000e+00 5.000e-02 11 41 -1 0 1 0 0 2.190e-02 2.000e-01 F 1 7 0. 0. 11 42 0 0 4 0 0 0.000e+00 5.000e-02 11 43 -1 0 1 0 0 1.010e-02 2.000e-01 F 1 7 0. 0. 11 44 0 0 4 0 0 0.000e+00 5.000e-02 11 45 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 11 46 0 0 4 0 0 0.000e+00 5.000e-02 11 47 -1 0 1 0 0 8.150e-03 2.000e-01 F 1 7 0. 0. 11 48 0 0 4 0 0 0.000e+00 5.000e-02 11 49 0 0 4 0 0 0.000e+00 5.000e-02 11 50 0 0 4 0 0 0.000e+00 5.000e-02 11 51 0 0 4 0 0 0.000e+00 5.000e-02 12 13 0 0 4 0 0 0.000e+00 5.000e-02 12 14 0 0 4 0 0 0.000e+00 5.000e-02 12 15 0 0 4 0 0 0.000e+00 5.000e-02 12 16 0 0 4 0 0 0.000e+00 5.000e-02 12 17 0 0 4 0 0 0.000e+00 5.000e-02 12 18 -1 0 1 0 0 6.071e-01 7.000e-01 F 1 7 0. 0. 12 19 -1 0 1 0 0 9.510e-03 7.000e-01 F 1 7 0. 0. 12 20 -1 0 1 0 0 1.154e-01 7.000e-01 F 1 7 0. 0. 12 21 -1 0 1 0 0 2.052e-02 7.000e-01 F 1 7 0. 0. 12 22 -1 0 1 0 0 1.670e-04 7.000e-01 F 1 7 0. 0. 12 23 -1 0 1 0 0 4.470e-04 7.000e-01 F 1 7 0. 0. 12 24 -1 0 1 0 0 1.159e-01 2.000e-01 F 1 7 0. 0. 12 25 -1 0 1 0 0 1.648e-04 2.000e-01 F 1 7 0. 0. 12 26 0 0 4 0 0 0.000e+00 5.000e-02 12 27 0 0 4 0 0 0.000e+00 5.000e-02 12 28 0 0 4 0 0 0.000e+00 5.000e-02 12 29 0 0 4 0 0 0.000e+00 5.000e-02 12 30 0 0 4 0 0 0.000e+00 5.000e-02 12 31 0 0 4 0 0 0.000e+00 5.000e-02 12 32 0 0 4 0 0 0.000e+00 5.000e-02 12 33 -1 0 1 0 0 2.217e-02 2.000e-01 F 1 7 0. 0. 12 34 0 0 4 0 0 0.000e+00 5.000e-02 12 35 -1 0 1 0 0 1.856e-03 2.000e-01 F 1 7 0. 0. 12 36 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 12 37 0 0 4 0 0 0.000e+00 5.000e-02 12 38 0 0 4 0 0 0.000e+00 5.000e-02 12 39 0 0 4 0 0 0.000e+00 5.000e-02 12 40 -1 0 1 0 0 1.978e-02 2.000e-01 F 1 7 0. 0. 12 41 0 0 4 0 0 0.000e+00 5.000e-02 12 42 0 0 4 0 0 0.000e+00 5.000e-02 12 43 0 0 4 0 0 0.000e+00 5.000e-02 12 44 0 0 4 0 0 0.000e+00 5.000e-02 12 45 0 0 4 0 0 0.000e+00 5.000e-02 12 46 0 0 4 0 0 0.000e+00 5.000e-02 12 47 0 0 4 0 0 0.000e+00 5.000e-02 12 48 0 0 4 0 0 0.000e+00 5.000e-02 12 49 0 0 4 0 0 0.000e+00 5.000e-02 12 50 -1 0 1 0 0 0.000e+00 7.000e-01 F 1 7 0. 0. 12 51 0 0 4 0 0 0.000e+00 5.000e-02 13 14 0 0 4 0 0 0.000e+00 5.000e-02 13 15 0 0 4 0 0 0.000e+00 5.000e-02 13 16 -1 0 1 0 0 3.290e-02 2.000e-01 F 1 7 0. 0. 13 17 -1 0 1 0 0 3.290e-03 2.000e-01 F 1 7 0. 0. 13 18 0 0 4 0 0 0.000e+00 5.000e-02 13 19 0 0 4 0 0 0.000e+00 5.000e-02 13 20 0 0 4 0 0 0.000e+00 5.000e-02 13 21 0 0 4 0 0 0.000e+00 5.000e-02 13 22 0 0 4 0 0 0.000e+00 5.000e-02 13 23 0 0 4 0 0 0.000e+00 5.000e-02 13 24 0 0 4 0 0 0.000e+00 5.000e-02 13 25 0 0 4 0 0 0.000e+00 5.000e-02 13 26 -1 0 1 0 0 2.860e-02 2.000e-01 F 1 7 0. 0. 13 27 -1 0 1 0 0 2.040e-04 2.000e-01 F 1 7 0. 0. 13 28 -1 0 1 0 0 4.840e-05 2.000e-01 F 1 7 0. 0. 13 29 0 0 4 0 0 0.000e+00 5.000e-02 13 30 -1 0 1 0 0 1.900e-02 2.000e-01 F 1 7 0. 0. 13 31 0 0 4 0 0 0.000e+00 5.000e-02 13 32 -1 0 1 0 0 8.090e-03 2.000e-01 F 1 7 0. 0. 13 33 0 0 4 0 0 0.000e+00 5.000e-02 13 34 0 0 4 0 0 0.000e+00 5.000e-02 13 35 0 0 4 0 0 0.000e+00 5.000e-02 13 36 0 0 4 0 0 0.000e+00 5.000e-02 13 37 0 0 4 0 0 0.000e+00 5.000e-02 13 38 0 0 4 0 0 0.000e+00 5.000e-02 13 39 0 0 4 0 0 0.000e+00 5.000e-02 13 40 0 0 4 0 0 0.000e+00 5.000e-02 13 41 0 0 4 0 0 0.000e+00 5.000e-02 13 42 0 0 4 0 0 0.000e+00 5.000e-02 13 43 0 0 4 0 0 0.000e+00 5.000e-02 13 44 0 0 4 0 0 0.000e+00 5.000e-02 13 45 0 0 4 0 0 0.000e+00 5.000e-02 13 46 0 0 4 0 0 0.000e+00 5.000e-02 13 47 0 0 4 0 0 0.000e+00 5.000e-02 13 48 0 0 4 0 0 0.000e+00 5.000e-02 13 49 0 0 4 0 0 0.000e+00 5.000e-02 13 50 0 0 4 0 0 0.000e+00 5.000e-02 13 51 0 0 4 0 0 0.000e+00 5.000e-02 14 15 0 0 4 0 0 0.000e+00 5.000e-02 14 16 0 0 4 0 0 0.000e+00 5.000e-02 14 17 0 0 4 0 0 0.000e+00 5.000e-02 14 18 0 0 4 0 0 0.000e+00 5.000e-02 14 19 -1 0 1 0 0 2.100e-04 7.000e-01 F 1 7 0. 0. 14 20 -1 0 1 0 0 3.198e-03 7.000e-01 F 1 7 0. 0. 14 21 -1 0 1 0 0 8.720e-01 7.000e-01 F 1 7 0. 0. 14 22 0 0 4 0 0 0.000e+00 5.000e-02 14 23 -1 0 1 0 0 4.230e-04 7.000e-01 F 1 7 0. 0. 14 24 -1 0 1 0 0 7.670e-02 2.000e-01 F 1 7 0. 0. 14 25 -1 0 1 0 0 2.040e-04 2.000e-01 F 1 7 0. 0. 14 26 0 0 4 0 0 0.000e+00 5.000e-02 14 27 0 0 4 0 0 0.000e+00 5.000e-02 14 28 0 0 4 0 0 0.000e+00 5.000e-02 14 29 0 0 4 0 0 0.000e+00 5.000e-02 14 30 0 0 4 0 0 0.000e+00 5.000e-02 14 31 0 0 4 0 0 0.000e+00 5.000e-02 14 32 0 0 4 0 0 0.000e+00 5.000e-02 14 33 0 0 4 0 0 0.000e+00 5.000e-02 14 34 0 0 4 0 0 0.000e+00 5.000e-02 14 35 0 0 4 0 0 0.000e+00 5.000e-02 14 36 -1 0 1 0 0 8.440e-03 2.000e-01 F 1 7 0. 0. 14 37 0 0 4 0 0 0.000e+00 5.000e-02 14 38 0 0 4 0 0 0.000e+00 5.000e-02 14 39 0 0 4 0 0 0.000e+00 5.000e-02 14 40 -1 0 1 0 0 1.519e-02 2.000e-01 F 1 7 0. 0. 14 41 0 0 4 0 0 0.000e+00 5.000e-02 14 42 0 0 4 0 0 0.000e+00 5.000e-02 14 43 0 0 4 0 0 0.000e+00 5.000e-02 14 44 0 0 4 0 0 0.000e+00 5.000e-02 14 45 0 0 4 0 0 0.000e+00 5.000e-02 14 46 0 0 4 0 0 0.000e+00 5.000e-02 14 47 0 0 4 0 0 0.000e+00 5.000e-02 14 48 0 0 4 0 0 0.000e+00 5.000e-02 14 49 0 0 4 0 0 0.000e+00 5.000e-02 14 50 0 0 4 0 0 0.000e+00 5.000e-02 14 51 0 0 4 0 0 0.000e+00 5.000e-02 15 16 0 0 4 0 0 0.000e+00 5.000e-02 15 17 0 0 4 0 0 0.000e+00 5.000e-02 15 18 -1 0 1 0 0 6.098e-04 7.000e-01 F 1 7 0. 0. 15 19 -1 0 1 0 0 2.030e-03 7.000e-01 F 1 7 0. 0. 15 20 -1 0 1 0 0 4.901e-01 7.000e-01 F 1 7 0. 0. 15 21 -1 0 1 0 0 1.366e-01 7.000e-01 F 1 7 0. 0. 15 22 0 0 4 0 0 0.000e+00 5.000e-02 15 23 -1 0 1 0 0 3.060e-04 7.000e-01 F 1 7 0. 0. 15 24 -1 0 1 0 0 2.035e-01 2.000e-01 F 1 7 0. 0. 15 25 -1 0 1 0 0 1.583e-04 2.000e-01 F 1 7 0. 0. 15 26 0 0 4 0 0 0.000e+00 5.000e-02 15 27 0 0 4 0 0 0.000e+00 5.000e-02 15 28 0 0 4 0 0 0.000e+00 5.000e-02 15 29 0 0 4 0 0 0.000e+00 5.000e-02 15 30 0 0 4 0 0 0.000e+00 5.000e-02 15 31 0 0 4 0 0 0.000e+00 5.000e-02 15 32 0 0 4 0 0 0.000e+00 5.000e-02 15 33 0 0 4 0 0 0.000e+00 5.000e-02 15 34 0 0 4 0 0 0.000e+00 5.000e-02 15 35 -1 0 1 0 0 3.597e-02 2.000e-01 F 1 7 0. 0. 15 36 -1 0 1 0 0 9.251e-03 2.000e-01 F 1 7 0. 0. 15 37 0 0 4 0 0 0.000e+00 5.000e-02 15 38 0 0 4 0 0 0.000e+00 5.000e-02 15 39 0 0 4 0 0 0.000e+00 5.000e-02 15 40 -1 0 1 0 0 2.393e-02 2.000e-01 F 1 7 0. 0. 15 41 0 0 4 0 0 0.000e+00 5.000e-02 15 42 0 0 4 0 0 0.000e+00 5.000e-02 15 43 0 0 4 0 0 0.000e+00 5.000e-02 15 44 0 0 4 0 0 0.000e+00 5.000e-02 15 45 0 0 4 0 0 0.000e+00 5.000e-02 15 46 -1 0 1 0 0 4.750e-03 7.000e-01 F 1 7 0. 0. 15 47 0 0 4 0 0 0.000e+00 5.000e-02 15 48 0 0 4 0 0 0.000e+00 5.000e-02 15 49 0 0 4 0 0 0.000e+00 5.000e-02 15 50 -1 0 1 0 0 3.879e-02 7.000e-01 F 1 7 0. 0. 15 51 0 0 4 0 0 0.000e+00 5.000e-02 16 17 0 0 4 0 0 0.000e+00 5.000e-02 16 18 -1 0 1 0 0 5.890e-04 7.000e-01 F 1 7 0. 0. 16 19 -1 0 1 0 0 7.900e-02 7.000e-01 F 1 7 0. 0. 16 20 -1 0 1 0 0 4.096e-04 7.000e-01 F 1 7 0. 0. 16 21 -1 0 1 0 0 1.490e-04 7.000e-01 F 1 7 0. 0. 16 22 -1 0 1 0 0 5.820e-01 7.000e-01 F 1 7 0. 0. 16 23 -1 0 1 0 0 2.750e-02 7.000e-01 F 1 7 0. 0. 16 24 -1 0 1 0 0 4.040e-04 2.000e-01 F 1 7 0. 0. 16 25 -1 0 1 0 0 1.740e-01 2.000e-01 F 1 7 0. 0. 16 26 0 0 4 0 0 0.000e+00 5.000e-02 16 27 0 0 4 0 0 0.000e+00 5.000e-02 16 28 0 0 4 0 0 0.000e+00 5.000e-02 16 29 0 0 4 0 0 0.000e+00 5.000e-02 16 30 0 0 4 0 0 0.000e+00 5.000e-02 16 31 0 0 4 0 0 0.000e+00 5.000e-02 16 32 0 0 4 0 0 0.000e+00 5.000e-02 16 33 0 0 4 0 0 0.000e+00 5.000e-02 16 34 -1 0 1 0 0 1.900e-02 2.000e-01 F 1 7 0. 0. 16 35 0 0 4 0 0 0.000e+00 5.000e-02 16 36 0 0 4 0 0 0.000e+00 5.000e-02 16 37 -1 0 1 0 0 4.070e-02 2.000e-01 F 1 7 0. 0. 16 38 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 16 39 0 0 4 0 0 0.000e+00 5.000e-02 16 40 0 0 4 0 0 0.000e+00 5.000e-02 16 41 -1 0 1 0 0 2.240e-02 2.000e-01 F 1 7 0. 0. 16 42 0 0 4 0 0 0.000e+00 5.000e-02 16 43 -1 0 1 0 0 8.610e-03 2.000e-01 F 1 7 0. 0. 16 44 -1 0 1 0 0 2.310e-02 2.000e-01 F 1 7 0. 0. 16 45 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 16 46 0 0 4 0 0 0.000e+00 5.000e-02 16 47 -1 0 1 0 0 7.940e-03 2.000e-01 F 1 7 0. 0. 16 48 0 0 4 0 0 0.000e+00 5.000e-02 16 49 0 0 4 0 0 0.000e+00 5.000e-02 16 50 0 0 4 0 0 0.000e+00 5.000e-02 16 51 0 0 4 0 0 0.000e+00 5.000e-02 17 18 0 0 4 0 0 0.000e+00 5.000e-02 17 19 0 0 4 0 0 0.000e+00 5.000e-02 17 20 -1 0 1 0 0 1.650e-04 7.000e-01 F 1 7 0. 0. 17 21 -1 0 1 0 0 3.890e-04 7.000e-01 F 1 7 0. 0. 17 22 0 0 4 0 0 0.000e+00 5.000e-02 17 23 -1 0 1 0 0 7.180e-01 7.000e-01 F 1 7 0. 0. 17 24 -1 0 1 0 0 2.450e-04 2.000e-01 F 1 7 0. 0. 17 25 -1 0 1 0 0 1.180e-01 2.000e-01 F 1 7 0. 0. 17 26 0 0 4 0 0 0.000e+00 5.000e-02 17 27 0 0 4 0 0 0.000e+00 5.000e-02 17 28 0 0 4 0 0 0.000e+00 5.000e-02 17 29 0 0 4 0 0 0.000e+00 5.000e-02 17 30 0 0 4 0 0 0.000e+00 5.000e-02 17 31 0 0 4 0 0 0.000e+00 5.000e-02 17 32 0 0 4 0 0 0.000e+00 5.000e-02 17 33 0 0 4 0 0 0.000e+00 5.000e-02 17 34 0 0 4 0 0 0.000e+00 5.000e-02 17 35 0 0 4 0 0 0.000e+00 5.000e-02 17 36 0 0 4 0 0 0.000e+00 5.000e-02 17 37 0 0 4 0 0 0.000e+00 5.000e-02 17 38 -1 0 1 0 0 9.340e-02 2.000e-01 F 1 7 0. 0. 17 39 0 0 4 0 0 0.000e+00 5.000e-02 17 40 0 0 4 0 0 0.000e+00 5.000e-02 17 41 -1 0 1 0 0 1.690e-02 2.000e-01 F 1 7 0. 0. 17 42 0 0 4 0 0 0.000e+00 5.000e-02 17 43 0 0 4 0 0 0.000e+00 5.000e-02 17 44 0 0 4 0 0 0.000e+00 5.000e-02 17 45 -1 0 1 0 0 4.460e-02 2.000e-01 F 1 7 0. 0. 17 46 0 0 4 0 0 0.000e+00 5.000e-02 17 47 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 17 48 0 0 4 0 0 0.000e+00 5.000e-02 17 49 0 0 4 0 0 0.000e+00 5.000e-02 17 50 0 0 4 0 0 0.000e+00 5.000e-02 17 51 0 0 4 0 0 0.000e+00 5.000e-02 18 19 0 0 4 0 0 0.000e+00 5.000e-02 18 20 0 0 4 0 0 0.000e+00 5.000e-02 18 21 0 0 4 0 0 0.000e+00 5.000e-02 18 22 0 0 4 0 0 0.000e+00 5.000e-02 18 23 0 0 4 0 0 0.000e+00 5.000e-02 18 24 0 0 4 0 0 0.000e+00 5.000e-02 18 25 0 0 4 0 0 0.000e+00 5.000e-02 18 26 -1 0 1 0 0 2.880e-03 2.000e-01 F 1 7 0. 0. 18 27 -1 0 1 0 0 1.171e-01 2.000e-01 F 1 7 0. 0. 18 28 -1 0 1 0 0 6.000e-05 2.000e-01 F 1 7 0. 0. 18 29 0 0 4 0 0 0.000e+00 5.000e-02 18 30 -1 0 1 0 0 9.290e-05 2.000e-01 F 1 7 0. 0. 18 31 0 0 4 0 0 0.000e+00 5.000e-02 18 32 0 0 4 0 0 0.000e+00 5.000e-02 18 33 0 0 4 0 0 0.000e+00 5.000e-02 18 34 0 0 4 0 0 0.000e+00 5.000e-02 18 35 0 0 4 0 0 0.000e+00 5.000e-02 18 36 0 0 4 0 0 0.000e+00 5.000e-02 18 37 0 0 4 0 0 0.000e+00 5.000e-02 18 38 0 0 4 0 0 0.000e+00 5.000e-02 18 39 0 0 4 0 0 0.000e+00 5.000e-02 18 40 0 0 4 0 0 0.000e+00 5.000e-02 18 41 0 0 4 0 0 0.000e+00 5.000e-02 18 42 0 0 4 0 0 0.000e+00 5.000e-02 18 43 0 0 4 0 0 0.000e+00 5.000e-02 18 44 0 0 4 0 0 0.000e+00 5.000e-02 18 45 0 0 4 0 0 0.000e+00 5.000e-02 18 46 0 0 4 0 0 0.000e+00 5.000e-02 18 47 0 0 4 0 0 0.000e+00 5.000e-02 18 48 0 0 4 0 0 0.000e+00 5.000e-02 18 49 0 0 4 0 0 0.000e+00 5.000e-02 18 50 0 0 4 0 0 0.000e+00 5.000e-02 18 51 0 0 4 0 0 0.000e+00 5.000e-02 19 20 0 0 4 0 0 0.000e+00 5.000e-02 19 21 0 0 4 0 0 0.000e+00 5.000e-02 19 22 0 0 4 0 0 0.000e+00 5.000e-02 19 23 0 0 4 0 0 0.000e+00 5.000e-02 19 24 0 0 4 0 0 0.000e+00 5.000e-02 19 25 0 0 4 0 0 0.000e+00 5.000e-02 19 26 -1 0 1 0 0 1.060e-01 2.000e-01 F 1 7 0. 0. 19 27 -1 0 1 0 0 3.490e-03 2.000e-01 F 1 7 0. 0. 19 28 -1 0 1 0 0 5.760e-05 2.000e-01 F 1 7 0. 0. 19 29 0 0 4 0 0 0.000e+00 5.000e-02 19 30 -1 0 1 0 0 2.100e-02 2.000e-01 F 1 7 0. 0. 19 31 0 0 4 0 0 0.000e+00 5.000e-02 19 32 0 0 4 0 0 0.000e+00 5.000e-02 19 33 0 0 4 0 0 0.000e+00 5.000e-02 19 34 0 0 4 0 0 0.000e+00 5.000e-02 19 35 0 0 4 0 0 0.000e+00 5.000e-02 19 36 0 0 4 0 0 0.000e+00 5.000e-02 19 37 0 0 4 0 0 0.000e+00 5.000e-02 19 38 0 0 4 0 0 0.000e+00 5.000e-02 19 39 0 0 4 0 0 0.000e+00 5.000e-02 19 40 0 0 4 0 0 0.000e+00 5.000e-02 19 41 0 0 4 0 0 0.000e+00 5.000e-02 19 42 0 0 4 0 0 0.000e+00 5.000e-02 19 43 0 0 4 0 0 0.000e+00 5.000e-02 19 44 0 0 4 0 0 0.000e+00 5.000e-02 19 45 0 0 4 0 0 0.000e+00 5.000e-02 19 46 0 0 4 0 0 0.000e+00 5.000e-02 19 47 0 0 4 0 0 0.000e+00 5.000e-02 19 48 0 0 4 0 0 0.000e+00 5.000e-02 19 49 0 0 4 0 0 0.000e+00 5.000e-02 19 50 0 0 4 0 0 0.000e+00 5.000e-02 19 51 0 0 4 0 0 0.000e+00 5.000e-02 20 21 0 0 4 0 0 0.000e+00 5.000e-02 20 22 0 0 4 0 0 0.000e+00 5.000e-02 20 23 0 0 4 0 0 0.000e+00 5.000e-02 20 24 0 0 4 0 0 0.000e+00 5.000e-02 20 25 0 0 4 0 0 0.000e+00 5.000e-02 20 26 -1 0 1 0 0 2.460e-04 2.000e-01 F 1 7 0. 0. 20 27 -1 0 1 0 0 3.544e-02 2.000e-01 F 1 7 0. 0. 20 28 -1 0 1 0 0 9.450e-02 2.000e-01 F 1 7 0. 0. 20 29 -1 0 1 0 0 4.421e-04 2.000e-01 F 1 7 0. 0. 20 30 -1 0 1 0 0 1.360e-04 2.000e-01 F 1 7 0. 0. 20 31 0 0 4 0 0 0.000e+00 5.000e-02 20 32 0 0 4 0 0 0.000e+00 5.000e-02 20 33 0 0 4 0 0 0.000e+00 5.000e-02 20 34 0 0 4 0 0 0.000e+00 5.000e-02 20 35 0 0 4 0 0 0.000e+00 5.000e-02 20 36 0 0 4 0 0 0.000e+00 5.000e-02 20 37 0 0 4 0 0 0.000e+00 5.000e-02 20 38 0 0 4 0 0 0.000e+00 5.000e-02 20 39 -1 0 1 0 0 2.761e-03 7.000e-01 F 1 7 0. 0. 20 40 0 0 4 0 0 0.000e+00 5.000e-02 20 41 0 0 4 0 0 0.000e+00 5.000e-02 20 42 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 20 43 0 0 4 0 0 0.000e+00 5.000e-02 20 44 0 0 4 0 0 0.000e+00 5.000e-02 20 45 0 0 4 0 0 0.000e+00 5.000e-02 20 46 0 0 4 0 0 0.000e+00 5.000e-02 20 47 0 0 4 0 0 0.000e+00 5.000e-02 20 48 0 0 4 0 0 0.000e+00 5.000e-02 20 49 0 0 4 0 0 0.000e+00 5.000e-02 20 50 0 0 4 0 0 0.000e+00 5.000e-02 20 51 0 0 4 0 0 0.000e+00 5.000e-02 21 22 0 0 4 0 0 0.000e+00 5.000e-02 21 23 0 0 4 0 0 0.000e+00 5.000e-02 21 24 0 0 4 0 0 0.000e+00 5.000e-02 21 25 0 0 4 0 0 0.000e+00 5.000e-02 21 26 -1 0 1 0 0 1.395e-04 2.000e-01 F 1 7 0. 0. 21 27 -1 0 1 0 0 2.849e-02 2.000e-01 F 1 7 0. 0. 21 28 -1 0 1 0 0 2.828e-02 2.000e-01 F 1 7 0. 0. 21 29 -1 0 1 0 0 1.053e-01 2.000e-01 F 1 7 0. 0. 21 30 -1 0 1 0 0 6.280e-05 2.000e-01 F 1 7 0. 0. 21 31 0 0 4 0 0 0.000e+00 5.000e-02 21 32 0 0 4 0 0 0.000e+00 5.000e-02 21 33 0 0 4 0 0 0.000e+00 5.000e-02 21 34 0 0 4 0 0 0.000e+00 5.000e-02 21 35 0 0 4 0 0 0.000e+00 5.000e-02 21 36 0 0 4 0 0 0.000e+00 5.000e-02 21 37 0 0 4 0 0 0.000e+00 5.000e-02 21 38 0 0 4 0 0 0.000e+00 5.000e-02 21 39 -1 0 1 0 0 4.977e-05 7.000e-01 F 1 7 0. 0. 21 40 0 0 4 0 0 0.000e+00 5.000e-02 21 41 0 0 4 0 0 0.000e+00 5.000e-02 21 42 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 21 43 0 0 4 0 0 0.000e+00 5.000e-02 21 44 0 0 4 0 0 0.000e+00 5.000e-02 21 45 0 0 4 0 0 0.000e+00 5.000e-02 21 46 0 0 4 0 0 0.000e+00 5.000e-02 21 47 0 0 4 0 0 0.000e+00 5.000e-02 21 48 0 0 4 0 0 0.000e+00 5.000e-02 21 49 0 0 4 0 0 0.000e+00 5.000e-02 21 50 0 0 4 0 0 0.000e+00 5.000e-02 21 51 0 0 4 0 0 0.000e+00 5.000e-02 22 23 0 0 4 0 0 0.000e+00 5.000e-02 22 24 0 0 4 0 0 0.000e+00 5.000e-02 22 25 0 0 4 0 0 0.000e+00 5.000e-02 22 26 0 0 4 0 0 0.000e+00 5.000e-02 22 27 0 0 4 0 0 0.000e+00 5.000e-02 22 28 0 0 4 0 0 0.000e+00 5.000e-02 22 29 0 0 4 0 0 0.000e+00 5.000e-02 22 30 -1 0 1 0 0 1.270e-01 2.000e-01 F 1 7 0. 0. 22 31 0 0 4 0 0 0.000e+00 5.000e-02 22 32 0 0 4 0 0 0.000e+00 5.000e-02 22 33 0 0 4 0 0 0.000e+00 5.000e-02 22 34 0 0 4 0 0 0.000e+00 5.000e-02 22 35 0 0 4 0 0 0.000e+00 5.000e-02 22 36 0 0 4 0 0 0.000e+00 5.000e-02 22 37 0 0 4 0 0 0.000e+00 5.000e-02 22 38 0 0 4 0 0 0.000e+00 5.000e-02 22 39 0 0 4 0 0 0.000e+00 5.000e-02 22 40 0 0 4 0 0 0.000e+00 5.000e-02 22 41 0 0 4 0 0 0.000e+00 5.000e-02 22 42 0 0 4 0 0 0.000e+00 5.000e-02 22 43 0 0 4 0 0 0.000e+00 5.000e-02 22 44 0 0 4 0 0 0.000e+00 5.000e-02 22 45 0 0 4 0 0 0.000e+00 5.000e-02 22 46 0 0 4 0 0 0.000e+00 5.000e-02 22 47 0 0 4 0 0 0.000e+00 5.000e-02 22 48 0 0 4 0 0 0.000e+00 5.000e-02 22 49 0 0 4 0 0 0.000e+00 5.000e-02 22 50 0 0 4 0 0 0.000e+00 5.000e-02 22 51 0 0 4 0 0 0.000e+00 5.000e-02 23 24 0 0 4 0 0 0.000e+00 5.000e-02 23 25 0 0 4 0 0 0.000e+00 5.000e-02 23 26 -1 0 1 0 0 2.400e-02 2.000e-01 F 1 7 0. 0. 23 27 -1 0 1 0 0 4.869e-04 2.000e-01 F 1 7 0. 0. 23 28 -1 0 1 0 0 1.340e-04 2.000e-01 F 1 7 0. 0. 23 29 -1 0 1 0 0 1.910e-04 2.000e-01 F 1 7 0. 0. 23 30 -1 0 1 0 0 5.140e-02 2.000e-01 F 1 7 0. 0. 23 31 0 0 4 0 0 0.000e+00 5.000e-02 23 32 -1 0 1 0 0 8.760e-02 2.000e-01 F 1 7 0. 0. 23 33 0 0 4 0 0 0.000e+00 5.000e-02 23 34 0 0 4 0 0 0.000e+00 5.000e-02 23 35 0 0 4 0 0 0.000e+00 5.000e-02 23 36 0 0 4 0 0 0.000e+00 5.000e-02 23 37 0 0 4 0 0 0.000e+00 5.000e-02 23 38 0 0 4 0 0 0.000e+00 5.000e-02 23 39 0 0 4 0 0 0.000e+00 5.000e-02 23 40 0 0 4 0 0 0.000e+00 5.000e-02 23 41 0 0 4 0 0 0.000e+00 5.000e-02 23 42 0 0 4 0 0 0.000e+00 5.000e-02 23 43 0 0 4 0 0 0.000e+00 5.000e-02 23 44 0 0 4 0 0 0.000e+00 5.000e-02 23 45 0 0 4 0 0 0.000e+00 5.000e-02 23 46 0 0 4 0 0 0.000e+00 5.000e-02 23 47 0 0 4 0 0 0.000e+00 5.000e-02 23 48 0 0 4 0 0 0.000e+00 5.000e-02 23 49 0 0 4 0 0 0.000e+00 5.000e-02 23 50 0 0 4 0 0 0.000e+00 5.000e-02 23 51 0 0 4 0 0 0.000e+00 5.000e-02 24 25 0 0 4 0 0 0.000e+00 5.000e-02 24 26 -1 0 1 0 0 3.064e-03 7.000e-01 F 1 7 0. 0. 24 27 -1 0 1 0 0 6.592e-01 7.000e-01 F 1 7 0. 0. 24 28 -1 0 1 0 0 4.013e-01 7.000e-01 F 1 7 0. 0. 24 29 -1 0 1 0 0 1.228e-01 7.000e-01 F 1 7 0. 0. 24 30 -1 0 1 0 0 7.490e-04 7.000e-01 F 1 7 0. 0. 24 31 0 0 4 0 0 0.000e+00 5.000e-02 24 32 -1 0 1 0 0 2.400e-04 7.000e-01 F 1 7 0. 0. 24 33 0 0 4 0 0 0.000e+00 5.000e-02 24 34 0 0 4 0 0 0.000e+00 5.000e-02 24 35 0 0 4 0 0 0.000e+00 5.000e-02 24 36 0 0 4 0 0 0.000e+00 5.000e-02 24 37 0 0 4 0 0 0.000e+00 5.000e-02 24 38 0 0 4 0 0 0.000e+00 5.000e-02 24 39 -1 0 1 0 0 1.379e-01 2.000e-01 F 1 7 0. 0. 24 40 0 0 4 0 0 0.000e+00 5.000e-02 24 41 0 0 4 0 0 0.000e+00 5.000e-02 24 42 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 24 43 0 0 4 0 0 0.000e+00 5.000e-02 24 44 0 0 4 0 0 0.000e+00 5.000e-02 24 45 0 0 4 0 0 0.000e+00 5.000e-02 24 46 0 0 4 0 0 0.000e+00 5.000e-02 24 47 0 0 4 0 0 0.000e+00 5.000e-02 24 48 0 0 4 0 0 0.000e+00 5.000e-02 24 49 0 0 4 0 0 0.000e+00 5.000e-02 24 50 0 0 4 0 0 0.000e+00 5.000e-02 24 51 0 0 4 0 0 0.000e+00 5.000e-02 25 26 -1 0 1 0 0 3.300e-01 7.000e-01 F 1 7 0. 0. 25 27 -1 0 1 0 0 5.815e-03 7.000e-01 F 1 7 0. 0. 25 28 -1 0 1 0 0 2.427e-03 7.000e-01 F 1 7 0. 0. 25 29 -1 0 1 0 0 1.160e-03 7.000e-01 F 1 7 0. 0. 25 30 -1 0 1 0 0 7.700e-01 7.000e-01 F 1 7 0. 0. 25 31 0 0 4 0 0 0.000e+00 5.000e-02 25 32 -1 0 1 0 0 1.370e-01 7.000e-01 F 1 7 0. 0. 25 33 0 0 4 0 0 0.000e+00 5.000e-02 25 34 0 0 4 0 0 0.000e+00 5.000e-02 25 35 0 0 4 0 0 0.000e+00 5.000e-02 25 36 0 0 4 0 0 0.000e+00 5.000e-02 25 37 0 0 4 0 0 0.000e+00 5.000e-02 25 38 0 0 4 0 0 0.000e+00 5.000e-02 25 39 -1 0 1 0 0 7.080e-04 2.000e-01 F 1 7 0. 0. 25 40 0 0 4 0 0 0.000e+00 5.000e-02 25 41 0 0 4 0 0 0.000e+00 5.000e-02 25 42 0 0 4 0 0 0.000e+00 5.000e-02 25 43 0 0 4 0 0 0.000e+00 5.000e-02 25 44 0 0 4 0 0 0.000e+00 5.000e-02 25 45 0 0 4 0 0 0.000e+00 5.000e-02 25 46 0 0 4 0 0 0.000e+00 5.000e-02 25 47 0 0 4 0 0 0.000e+00 5.000e-02 25 48 0 0 4 0 0 0.000e+00 5.000e-02 25 49 0 0 4 0 0 0.000e+00 5.000e-02 25 50 0 0 4 0 0 0.000e+00 5.000e-02 25 51 0 0 4 0 0 0.000e+00 5.000e-02 26 27 0 0 4 0 0 0.000e+00 5.000e-02 26 28 0 0 4 0 0 0.000e+00 5.000e-02 26 29 0 0 4 0 0 0.000e+00 5.000e-02 26 30 0 0 4 0 0 0.000e+00 5.000e-02 26 31 0 0 4 0 0 0.000e+00 5.000e-02 26 32 0 0 4 0 0 0.000e+00 5.000e-02 26 33 0 0 4 0 0 0.000e+00 5.000e-02 26 34 -1 0 1 0 0 8.770e-01 7.000e-01 F 1 7 0. 0. 26 35 0 0 4 0 0 0.000e+00 5.000e-02 26 36 0 0 4 0 0 0.000e+00 5.000e-02 26 37 0 0 4 0 0 0.000e+00 5.000e-02 26 38 -1 0 1 0 0 2.360e-01 7.000e-01 F 1 7 0. 0. 26 39 0 0 4 0 0 0.000e+00 5.000e-02 26 40 0 0 4 0 0 0.000e+00 5.000e-02 26 41 -1 0 1 0 0 2.120e-01 2.000e-01 F 1 7 0. 0. 26 42 0 0 4 0 0 0.000e+00 5.000e-02 26 43 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 26 44 0 0 4 0 0 0.000e+00 5.000e-02 26 45 -1 0 1 0 0 2.550e-03 2.000e-01 F 1 7 0. 0. 26 46 0 0 4 0 0 0.000e+00 5.000e-02 26 47 -1 0 1 0 0 3.520e-02 2.000e-01 F 1 7 0. 0. 26 48 0 0 4 0 0 0.000e+00 5.000e-02 26 49 0 0 4 0 0 0.000e+00 5.000e-02 26 50 0 0 4 0 0 0.000e+00 5.000e-02 26 51 0 0 4 0 0 0.000e+00 5.000e-02 27 28 0 0 4 0 0 0.000e+00 5.000e-02 27 29 0 0 4 0 0 0.000e+00 5.000e-02 27 30 0 0 4 0 0 0.000e+00 5.000e-02 27 31 0 0 4 0 0 0.000e+00 5.000e-02 27 32 0 0 4 0 0 0.000e+00 5.000e-02 27 33 -1 0 1 0 0 9.237e-01 7.000e-01 F 1 7 0. 0. 27 34 0 0 4 0 0 0.000e+00 5.000e-02 27 35 -1 0 1 0 0 1.733e-01 7.000e-01 F 1 7 0. 0. 27 36 -1 0 1 0 0 2.887e-02 7.000e-01 F 1 7 0. 0. 27 37 0 0 4 0 0 0.000e+00 5.000e-02 27 38 0 0 4 0 0 0.000e+00 5.000e-02 27 39 0 0 4 0 0 0.000e+00 5.000e-02 27 40 -1 0 1 0 0 2.059e-01 2.000e-01 F 1 7 0. 0. 27 41 0 0 4 0 0 0.000e+00 5.000e-02 27 42 0 0 4 0 0 0.000e+00 5.000e-02 27 43 0 0 4 0 0 0.000e+00 5.000e-02 27 44 0 0 4 0 0 0.000e+00 5.000e-02 27 45 0 0 4 0 0 0.000e+00 5.000e-02 27 46 0 0 4 0 0 0.000e+00 5.000e-02 27 47 0 0 4 0 0 0.000e+00 5.000e-02 27 48 0 0 4 0 0 0.000e+00 5.000e-02 27 49 0 0 4 0 0 0.000e+00 5.000e-02 27 50 -1 0 1 0 0 1.186e-03 2.000e-01 F 1 7 0. 0. 27 51 0 0 4 0 0 0.000e+00 5.000e-02 28 29 0 0 4 0 0 0.000e+00 5.000e-02 28 30 0 0 4 0 0 0.000e+00 5.000e-02 28 31 0 0 4 0 0 0.000e+00 5.000e-02 28 32 0 0 4 0 0 0.000e+00 5.000e-02 28 33 0 0 4 0 0 0.000e+00 5.000e-02 28 34 0 0 4 0 0 0.000e+00 5.000e-02 28 35 -1 0 1 0 0 4.743e-01 7.000e-01 F 1 7 0. 0. 28 36 -1 0 1 0 0 1.986e-01 7.000e-01 F 1 7 0. 0. 28 37 0 0 4 0 0 0.000e+00 5.000e-02 28 38 0 0 4 0 0 0.000e+00 5.000e-02 28 39 0 0 4 0 0 0.000e+00 5.000e-02 28 40 -1 0 1 0 0 2.291e-01 2.000e-01 F 1 7 0. 0. 28 41 0 0 4 0 0 0.000e+00 5.000e-02 28 42 0 0 4 0 0 0.000e+00 5.000e-02 28 43 0 0 4 0 0 0.000e+00 5.000e-02 28 44 0 0 4 0 0 0.000e+00 5.000e-02 28 45 0 0 4 0 0 0.000e+00 5.000e-02 28 46 -1 0 1 0 0 1.240e-02 2.000e-01 F 1 7 0. 0. 28 47 0 0 4 0 0 0.000e+00 5.000e-02 28 48 0 0 4 0 0 0.000e+00 5.000e-02 28 49 0 0 4 0 0 0.000e+00 5.000e-02 28 50 -1 0 1 0 0 1.237e-01 2.000e-01 F 1 7 0. 0. 28 51 0 0 4 0 0 0.000e+00 5.000e-02 29 30 0 0 4 0 0 0.000e+00 5.000e-02 29 31 0 0 4 0 0 0.000e+00 5.000e-02 29 32 0 0 4 0 0 0.000e+00 5.000e-02 29 33 0 0 4 0 0 0.000e+00 5.000e-02 29 34 0 0 4 0 0 0.000e+00 5.000e-02 29 35 0 0 4 0 0 0.000e+00 5.000e-02 29 36 -1 0 1 0 0 1.273e+00 7.000e-01 F 1 7 0. 0. 29 37 0 0 4 0 0 0.000e+00 5.000e-02 29 38 0 0 4 0 0 0.000e+00 5.000e-02 29 39 0 0 4 0 0 0.000e+00 5.000e-02 29 40 -1 0 1 0 0 1.547e-01 2.000e-01 F 1 7 0. 0. 29 41 0 0 4 0 0 0.000e+00 5.000e-02 29 42 0 0 4 0 0 0.000e+00 5.000e-02 29 43 0 0 4 0 0 0.000e+00 5.000e-02 29 44 0 0 4 0 0 0.000e+00 5.000e-02 29 45 0 0 4 0 0 0.000e+00 5.000e-02 29 46 0 0 4 0 0 0.000e+00 5.000e-02 29 47 0 0 4 0 0 0.000e+00 5.000e-02 29 48 0 0 4 0 0 0.000e+00 5.000e-02 29 49 0 0 4 0 0 0.000e+00 5.000e-02 29 50 0 0 4 0 0 0.000e+00 5.000e-02 29 51 0 0 4 0 0 0.000e+00 5.000e-02 30 31 0 0 4 0 0 0.000e+00 5.000e-02 30 32 0 0 4 0 0 0.000e+00 5.000e-02 30 33 0 0 4 0 0 0.000e+00 5.000e-02 30 34 -1 0 1 0 0 1.220e-01 7.000e-01 F 1 7 0. 0. 30 35 0 0 4 0 0 0.000e+00 5.000e-02 30 36 0 0 4 0 0 0.000e+00 5.000e-02 30 37 -1 0 1 0 0 9.000e-01 7.000e-01 F 1 7 0. 0. 30 38 -1 0 1 0 0 3.970e-02 7.000e-01 F 1 7 0. 0. 30 39 0 0 4 0 0 0.000e+00 5.000e-02 30 40 0 0 4 0 0 0.000e+00 5.000e-02 30 41 -1 0 1 0 0 2.770e-01 2.000e-01 F 1 7 0. 0. 30 42 0 0 4 0 0 0.000e+00 5.000e-02 30 43 -1 0 1 0 0 1.220e-02 2.000e-01 F 1 7 0. 0. 30 44 -1 0 1 0 0 1.170e-02 2.000e-01 F 1 7 0. 0. 30 45 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 30 46 0 0 4 0 0 0.000e+00 5.000e-02 30 47 -1 0 1 0 0 3.370e-02 2.000e-01 F 1 7 0. 0. 30 48 0 0 4 0 0 0.000e+00 5.000e-02 30 49 0 0 4 0 0 0.000e+00 5.000e-02 30 50 0 0 4 0 0 0.000e+00 5.000e-02 30 51 0 0 4 0 0 0.000e+00 5.000e-02 31 32 0 0 4 0 0 0.000e+00 5.000e-02 31 33 0 0 4 0 0 0.000e+00 5.000e-02 31 34 0 0 4 0 0 0.000e+00 5.000e-02 31 35 0 0 4 0 0 0.000e+00 5.000e-02 31 36 0 0 4 0 0 0.000e+00 5.000e-02 31 37 0 0 4 0 0 0.000e+00 5.000e-02 31 38 0 0 4 0 0 0.000e+00 5.000e-02 31 39 0 0 4 0 0 0.000e+00 5.000e-02 31 40 0 0 4 0 0 0.000e+00 5.000e-02 31 41 0 0 4 0 0 0.000e+00 5.000e-02 31 42 0 0 4 0 0 0.000e+00 5.000e-02 31 43 0 0 4 0 0 0.000e+00 5.000e-02 31 44 0 0 4 0 0 0.000e+00 5.000e-02 31 45 0 0 4 0 0 0.000e+00 5.000e-02 31 46 0 0 4 0 0 0.000e+00 5.000e-02 31 47 0 0 4 0 0 0.000e+00 5.000e-02 31 48 -1 0 1 0 0 4.628e-01 7.000e-01 F 1 7 0. 0. 31 49 -1 0 1 0 0 2.935e-01 7.000e-01 F 1 7 0. 0. 31 50 0 0 4 0 0 0.000e+00 5.000e-02 31 51 -1 0 1 0 0 1.360e-01 7.000e-01 F 1 7 0. 0. 32 33 0 0 4 0 0 0.000e+00 5.000e-02 32 34 0 0 4 0 0 0.000e+00 5.000e-02 32 35 0 0 4 0 0 0.000e+00 5.000e-02 32 36 0 0 4 0 0 0.000e+00 5.000e-02 32 37 0 0 4 0 0 0.000e+00 5.000e-02 32 38 -1 0 1 0 0 1.050e+00 7.000e-01 F 1 7 0. 0. 32 39 0 0 4 0 0 0.000e+00 5.000e-02 32 40 0 0 4 0 0 0.000e+00 5.000e-02 32 41 -1 0 1 0 0 2.040e-01 2.000e-01 F 1 7 0. 0. 32 42 0 0 4 0 0 0.000e+00 5.000e-02 32 43 0 0 4 0 0 0.000e+00 5.000e-02 32 44 0 0 4 0 0 0.000e+00 5.000e-02 32 45 -1 0 1 0 0 5.730e-02 2.000e-01 F 1 7 0. 0. 32 46 0 0 4 0 0 0.000e+00 5.000e-02 32 47 -1 0 1 0 0 2.400e-02 2.000e-01 F 1 7 0. 0. 32 48 0 0 4 0 0 0.000e+00 5.000e-02 32 49 0 0 4 0 0 0.000e+00 5.000e-02 32 50 0 0 4 0 0 0.000e+00 5.000e-02 32 51 0 0 4 0 0 0.000e+00 5.000e-02 33 34 0 0 4 0 0 0.000e+00 5.000e-02 33 35 0 0 4 0 0 0.000e+00 5.000e-02 33 36 0 0 4 0 0 0.000e+00 5.000e-02 33 37 0 0 4 0 0 0.000e+00 5.000e-02 33 38 0 0 4 0 0 0.000e+00 5.000e-02 33 39 0 0 4 0 0 0.000e+00 5.000e-02 33 40 0 0 4 0 0 0.000e+00 5.000e-02 33 41 0 0 4 0 0 0.000e+00 5.000e-02 33 42 0 0 4 0 0 0.000e+00 5.000e-02 33 43 0 0 4 0 0 0.000e+00 5.000e-02 33 44 0 0 4 0 0 0.000e+00 5.000e-02 33 45 0 0 4 0 0 0.000e+00 5.000e-02 33 46 0 0 4 0 0 0.000e+00 5.000e-02 33 47 0 0 4 0 0 0.000e+00 5.000e-02 33 48 0 0 4 0 0 0.000e+00 5.000e-02 33 49 0 0 4 0 0 0.000e+00 5.000e-02 33 50 0 0 4 0 0 0.000e+00 5.000e-02 33 51 0 0 4 0 0 0.000e+00 5.000e-02 34 35 0 0 4 0 0 0.000e+00 5.000e-02 34 36 0 0 4 0 0 0.000e+00 5.000e-02 34 37 0 0 4 0 0 0.000e+00 5.000e-02 34 38 0 0 4 0 0 0.000e+00 5.000e-02 34 39 0 0 4 0 0 0.000e+00 5.000e-02 34 40 0 0 4 0 0 0.000e+00 5.000e-02 34 41 0 0 4 0 0 0.000e+00 5.000e-02 34 42 0 0 4 0 0 0.000e+00 5.000e-02 34 43 0 0 4 0 0 0.000e+00 5.000e-02 34 44 0 0 4 0 0 0.000e+00 5.000e-02 34 45 0 0 4 0 0 0.000e+00 5.000e-02 34 46 0 0 4 0 0 0.000e+00 5.000e-02 34 47 0 0 4 0 0 0.000e+00 5.000e-02 34 48 0 0 4 0 0 0.000e+00 5.000e-02 34 49 0 0 4 0 0 0.000e+00 5.000e-02 34 50 0 0 4 0 0 0.000e+00 5.000e-02 34 51 0 0 4 0 0 0.000e+00 5.000e-02 35 36 0 0 4 0 0 0.000e+00 5.000e-02 35 37 0 0 4 0 0 0.000e+00 5.000e-02 35 38 0 0 4 0 0 0.000e+00 5.000e-02 35 39 -1 0 1 0 0 3.744e-02 2.000e-01 F 1 7 0. 0. 35 40 0 0 4 0 0 0.000e+00 5.000e-02 35 41 0 0 4 0 0 0.000e+00 5.000e-02 35 42 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 35 43 0 0 4 0 0 0.000e+00 5.000e-02 35 44 0 0 4 0 0 0.000e+00 5.000e-02 35 45 0 0 4 0 0 0.000e+00 5.000e-02 35 46 0 0 4 0 0 0.000e+00 5.000e-02 35 47 0 0 4 0 0 0.000e+00 5.000e-02 35 48 0 0 4 0 0 0.000e+00 5.000e-02 35 49 0 0 4 0 0 0.000e+00 5.000e-02 35 50 0 0 4 0 0 0.000e+00 5.000e-02 35 51 0 0 4 0 0 0.000e+00 5.000e-02 36 37 0 0 4 0 0 0.000e+00 5.000e-02 36 38 0 0 4 0 0 0.000e+00 5.000e-02 36 39 -1 0 1 0 0 1.133e-02 2.000e-01 F 1 7 0. 0. 36 40 0 0 4 0 0 0.000e+00 5.000e-02 36 41 0 0 4 0 0 0.000e+00 5.000e-02 36 42 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 36 43 0 0 4 0 0 0.000e+00 5.000e-02 36 44 0 0 4 0 0 0.000e+00 5.000e-02 36 45 0 0 4 0 0 0.000e+00 5.000e-02 36 46 0 0 4 0 0 0.000e+00 5.000e-02 36 47 0 0 4 0 0 0.000e+00 5.000e-02 36 48 0 0 4 0 0 0.000e+00 5.000e-02 36 49 0 0 4 0 0 0.000e+00 5.000e-02 36 50 0 0 4 0 0 0.000e+00 5.000e-02 36 51 0 0 4 0 0 0.000e+00 5.000e-02 37 38 0 0 4 0 0 0.000e+00 5.000e-02 37 39 0 0 4 0 0 0.000e+00 5.000e-02 37 40 0 0 4 0 0 0.000e+00 5.000e-02 37 41 0 0 4 0 0 0.000e+00 5.000e-02 37 42 0 0 4 0 0 0.000e+00 5.000e-02 37 43 0 0 4 0 0 0.000e+00 5.000e-02 37 44 0 0 4 0 0 0.000e+00 5.000e-02 37 45 0 0 4 0 0 0.000e+00 5.000e-02 37 46 0 0 4 0 0 0.000e+00 5.000e-02 37 47 0 0 4 0 0 0.000e+00 5.000e-02 37 48 0 0 4 0 0 0.000e+00 5.000e-02 37 49 0 0 4 0 0 0.000e+00 5.000e-02 37 50 0 0 4 0 0 0.000e+00 5.000e-02 37 51 0 0 4 0 0 0.000e+00 5.000e-02 38 39 0 0 4 0 0 0.000e+00 5.000e-02 38 40 0 0 4 0 0 0.000e+00 5.000e-02 38 41 0 0 4 0 0 0.000e+00 5.000e-02 38 42 0 0 4 0 0 0.000e+00 5.000e-02 38 43 0 0 4 0 0 0.000e+00 5.000e-02 38 44 0 0 4 0 0 0.000e+00 5.000e-02 38 45 0 0 4 0 0 0.000e+00 5.000e-02 38 46 0 0 4 0 0 0.000e+00 5.000e-02 38 47 0 0 4 0 0 0.000e+00 5.000e-02 38 48 0 0 4 0 0 0.000e+00 5.000e-02 38 49 0 0 4 0 0 0.000e+00 5.000e-02 38 50 0 0 4 0 0 0.000e+00 5.000e-02 38 51 0 0 4 0 0 0.000e+00 5.000e-02 39 40 -1 0 1 0 0 9.127e-02 2.000e-01 F 1 7 0. 0. 39 41 0 0 4 0 0 0.000e+00 5.000e-02 39 42 0 0 4 0 0 0.000e+00 5.000e-02 39 43 0 0 4 0 0 0.000e+00 5.000e-02 39 44 0 0 4 0 0 0.000e+00 5.000e-02 39 45 0 0 4 0 0 0.000e+00 5.000e-02 39 46 -1 0 1 0 0 2.940e-02 7.000e-01 F 1 7 0. 0. 39 47 0 0 4 0 0 0.000e+00 5.000e-02 39 48 0 0 4 0 0 0.000e+00 5.000e-02 39 49 0 0 4 0 0 0.000e+00 5.000e-02 39 50 -1 0 1 0 0 2.502e-01 7.000e-01 F 1 7 0. 0. 39 51 0 0 4 0 0 0.000e+00 5.000e-02 40 41 0 0 4 0 0 0.000e+00 5.000e-02 40 42 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 40 43 0 0 4 0 0 0.000e+00 5.000e-02 40 44 0 0 4 0 0 0.000e+00 5.000e-02 40 45 0 0 4 0 0 0.000e+00 5.000e-02 40 46 0 0 4 0 0 0.000e+00 5.000e-02 40 47 0 0 4 0 0 0.000e+00 5.000e-02 40 48 0 0 4 0 0 0.000e+00 5.000e-02 40 49 0 0 4 0 0 0.000e+00 5.000e-02 40 50 0 0 4 0 0 0.000e+00 5.000e-02 40 51 0 0 4 0 0 0.000e+00 5.000e-02 41 42 0 0 4 0 0 0.000e+00 5.000e-02 41 43 0 0 4 0 0 0.000e+00 5.000e-02 41 44 0 0 4 0 0 0.000e+00 5.000e-02 41 45 0 0 4 0 0 0.000e+00 5.000e-02 41 46 0 0 4 0 0 0.000e+00 5.000e-02 41 47 0 0 4 0 0 0.000e+00 5.000e-02 41 48 0 0 4 0 0 0.000e+00 5.000e-02 41 49 0 0 4 0 0 0.000e+00 5.000e-02 41 50 0 0 4 0 0 0.000e+00 5.000e-02 41 51 0 0 4 0 0 0.000e+00 5.000e-02 42 43 0 0 4 0 0 0.000e+00 5.000e-02 42 44 0 0 4 0 0 0.000e+00 5.000e-02 42 45 0 0 4 0 0 0.000e+00 5.000e-02 42 46 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 42 47 0 0 4 0 0 0.000e+00 5.000e-02 42 48 0 0 4 0 0 0.000e+00 5.000e-02 42 49 0 0 4 0 0 0.000e+00 5.000e-02 42 50 -1 0 1 0 0 0.000e+00 2.000e-01 F 1 7 0. 0. 42 51 0 0 4 0 0 0.000e+00 5.000e-02 43 44 0 0 4 0 0 0.000e+00 5.000e-02 43 45 0 0 4 0 0 0.000e+00 5.000e-02 43 46 0 0 4 0 0 0.000e+00 5.000e-02 43 47 0 0 4 0 0 0.000e+00 5.000e-02 43 48 0 0 4 0 0 0.000e+00 5.000e-02 43 49 0 0 4 0 0 0.000e+00 5.000e-02 43 50 0 0 4 0 0 0.000e+00 5.000e-02 43 51 0 0 4 0 0 0.000e+00 5.000e-02 44 45 0 0 4 0 0 0.000e+00 5.000e-02 44 46 0 0 4 0 0 0.000e+00 5.000e-02 44 47 0 0 4 0 0 0.000e+00 5.000e-02 44 48 0 0 4 0 0 0.000e+00 5.000e-02 44 49 0 0 4 0 0 0.000e+00 5.000e-02 44 50 0 0 4 0 0 0.000e+00 5.000e-02 44 51 0 0 4 0 0 0.000e+00 5.000e-02 45 46 0 0 4 0 0 0.000e+00 5.000e-02 45 47 0 0 4 0 0 0.000e+00 5.000e-02 45 48 0 0 4 0 0 0.000e+00 5.000e-02 45 49 0 0 4 0 0 0.000e+00 5.000e-02 45 50 0 0 4 0 0 0.000e+00 5.000e-02 45 51 0 0 4 0 0 0.000e+00 5.000e-02 46 47 0 0 4 0 0 0.000e+00 5.000e-02 46 48 0 0 4 0 0 0.000e+00 5.000e-02 46 49 0 0 4 0 0 0.000e+00 5.000e-02 46 50 0 0 4 0 0 0.000e+00 5.000e-02 46 51 0 0 4 0 0 0.000e+00 5.000e-02 47 48 0 0 4 0 0 0.000e+00 5.000e-02 47 49 0 0 4 0 0 0.000e+00 5.000e-02 47 50 0 0 4 0 0 0.000e+00 5.000e-02 47 51 0 0 4 0 0 0.000e+00 5.000e-02 48 49 0 0 4 0 0 0.000e+00 5.000e-02 48 50 0 0 4 0 0 0.000e+00 5.000e-02 48 51 0 0 4 0 0 0.000e+00 5.000e-02 49 50 0 0 4 0 0 0.000e+00 5.000e-02 49 51 0 0 4 0 0 0.000e+00 5.000e-02 50 51 0 0 4 0 0 0.000e+00 5.000e-02
68.769076
109
0.47841
73ec7698c7dab15790eb6c3bea3ec4abaa4d0153
671
pm
Perl
auto-lib/Azure/CognitiveAutoSuggest/ErrorResponse.pm
pplu/azure-sdk-perl
26cbef2d926f571bc1617c26338c106856f95568
[ "Apache-2.0" ]
null
null
null
auto-lib/Azure/CognitiveAutoSuggest/ErrorResponse.pm
pplu/azure-sdk-perl
26cbef2d926f571bc1617c26338c106856f95568
[ "Apache-2.0" ]
null
null
null
auto-lib/Azure/CognitiveAutoSuggest/ErrorResponse.pm
pplu/azure-sdk-perl
26cbef2d926f571bc1617c26338c106856f95568
[ "Apache-2.0" ]
1
2021-04-08T15:26:39.000Z
2021-04-08T15:26:39.000Z
package Azure::CognitiveAutoSuggest::ErrorResponse; use Moose; has 'errors' => (is => 'ro', isa => 'ArrayRef[Azure::CognitiveAutoSuggest::Error]' ); has 'adaptiveCard' => (is => 'ro', isa => 'Str' ); has 'immediateAction' => (is => 'ro', isa => 'ArrayRef[Azure::CognitiveAutoSuggest::Action]' ); has 'potentialAction' => (is => 'ro', isa => 'ArrayRef[Azure::CognitiveAutoSuggest::Action]' ); has 'preferredClickthroughUrl' => (is => 'ro', isa => 'Str' ); has 'readLink' => (is => 'ro', isa => 'Str' ); has 'webSearchUrl' => (is => 'ro', isa => 'Str' ); has 'id' => (is => 'ro', isa => 'Str' ); has '_type' => (is => 'ro', isa => 'Str' ); 1;
47.928571
98
0.561848
ed2e43894145e1d2a8fc5a011fa490df4603599c
34,125
pm
Perl
src/fhem/trunk/fhem/FHEM/76_SMAPortalSPG.pm
nastymorbol/fhem-docker
c88d13e6fb098a487486b448806048eab1222b81
[ "MIT" ]
null
null
null
src/fhem/trunk/fhem/FHEM/76_SMAPortalSPG.pm
nastymorbol/fhem-docker
c88d13e6fb098a487486b448806048eab1222b81
[ "MIT" ]
null
null
null
src/fhem/trunk/fhem/FHEM/76_SMAPortalSPG.pm
nastymorbol/fhem-docker
c88d13e6fb098a487486b448806048eab1222b81
[ "MIT" ]
null
null
null
######################################################################################################################## # $Id: 76_SMAPortalSPG.pm 21735 2020-04-20 20:53:24Z DS_Starter $ ######################################################################################################################### # 76_SMAPortalSPG.pm # # (c) 2019-2020 by Heiko Maaz e-mail: Heiko dot Maaz at t-online dot de # # This Module is used by module 76_SMAPortal to create graphic devices. # It can't be used standalone without any SMAPortal-Device. # # This script is part of fhem. # # Fhem is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # # Fhem is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with fhem. If not, see <http://www.gnu.org/licenses/>. # ######################################################################################################################### package FHEM::SMAPortalSPG; ## no critic 'package' use strict; use warnings; use GPUtils qw(GP_Import GP_Export); # wird für den Import der FHEM Funktionen aus der fhem.pl benötigt use Time::HiRes qw(gettimeofday); eval "use FHEM::Meta;1" or my $modMetaAbsent = 1; ## no critic 'eval' # Run before module compilation BEGIN { # Import from main:: GP_Import( qw( AnalyzePerlCommand AttrVal AttrNum defs delFromDevAttrList delFromAttrList devspec2array deviceEvents Debug FmtDateTime FmtTime FW_makeImage fhemTimeGm getKeyValue gettimeofday genUUID init_done InternalTimer IsDisabled Log Log3 makeReadingName modules readingsSingleUpdate readingsBulkUpdate readingsBulkUpdateIfChanged readingsBeginUpdate readingsDelete readingsEndUpdate ReadingsNum ReadingsTimestamp ReadingsVal RemoveInternalTimer readingFnAttributes setKeyValue sortTopicNum TimeNow Value json2nameValue FW_directNotify ) ); # Export to main context with different name # my $pkg = caller(0); # my $main = $pkg; # $main =~ s/^(?:.+::)?([^:]+)$/main::$1\_/g; # foreach (@_) { # *{ $main . $_ } = *{ $pkg . '::' . $_ }; # } GP_Export( qw( Initialize pageAsHtml ) ); } # Versions History intern my %vNotesIntern = ( "1.6.0" => "19.04.2020 switch to pachages, some improvements according to PBP ", "1.5.0" => "07.07.2019 new attributes headerAlignment, headerDetail ", "1.4.0" => "26.06.2019 support for FTUI-Widget ", "1.3.0" => "24.06.2019 replace suggestIcon by consumerAdviceIcon ", "1.2.0" => "21.06.2019 GetFn -> get <name> html ", "1.1.0" => "13.06.2019 commandRef revised, changed attribute W/kW to Wh/kWh ", "1.0.0" => "03.06.2019 initial Version " ); ################################################################ sub Initialize { my ($hash) = @_; my $fwd = join(",",devspec2array("TYPE=FHEMWEB:FILTER=STATE=Initialized")); $hash->{DefFn} = \&Define; $hash->{GetFn} = \&Get; $hash->{RenameFn} = \&Rename; $hash->{CopyFn} = \&Copy; $hash->{FW_summaryFn} = \&FwFn; $hash->{FW_detailFn} = \&FwFn; $hash->{AttrFn} = \&Attr; $hash->{AttrList} = "autoRefresh:selectnumbers,120,0.2,1800,0,log10 ". "autoRefreshFW:$fwd ". "beamColor:colorpicker,RGB ". "beamColor2:colorpicker,RGB ". "beamHeight ". "beamWidth ". "consumerList ". "consumerLegend:none,icon_top,icon_bottom,text_top,text_bottom ". "disable:1,0 ". "forcePageRefresh:1,0 ". "headerAlignment:center,left,right ". "headerDetail:all,co,pv,pvco,statusLink ". "hourCount:slider,4,1,24 ". "hourStyle ". "maxPV ". "htmlStart ". "htmlEnd ". "showDiff:no,top,bottom ". "showHeader:1,0 ". "showLink:1,0 ". "showNight:1,0 ". "showWeather:1,0 ". "spaceSize ". "consumerAdviceIcon ". "layoutType:pv,co,pvco,diff ". "Wh/kWh:Wh,kWh ". "weatherColor:colorpicker,RGB ". $readingFnAttributes; $hash->{FW_hideDisplayName} = 1; # Forum 88667 # $hash->{FW_addDetailToSummary} = 1; # $hash->{FW_atPageEnd} = 1; # wenn 1 -> kein Longpoll ohne informid in HTML-Tag eval { FHEM::Meta::InitMod( __FILE__, $hash ) }; # für Meta.pm (https://forum.fhem.de/index.php/topic,97589.0.html) return; } ############################################################### # SMAPortalSPG Define ############################################################### sub Define { my ($hash, $def) = @_; my ($name, $type, $link) = split("[ \t]+", $def, 3); if(!$link) { return "Usage: define <name> SMAPortalSPG <arg>"; } my $arg = (split("[()]",$link))[1]; $arg =~ s/'//g; $hash->{PARENT} = (split(",",$arg))[0]; $hash->{HELPER}{MODMETAABSENT} = 1 if($modMetaAbsent); # Modul Meta.pm nicht vorhanden $hash->{LINK} = $link; # Versionsinformationen setzen setVersionInfo($hash); readingsSingleUpdate($hash,"state", "initialized", 1); # Init für "state" return; } ############################################################### # SMAPortalSPG Get ############################################################### sub Get { my ($hash, @a) = @_; return "\"get X\" needs at least an argument" if ( @a < 2 ); my $name = shift @a; my $cmd = shift @a; my $getlist = "Unknown argument $cmd, choose one of ". "html:noArg ". "ftui:noArg "; if ($cmd eq "html") { return pageAsHtml($hash); } if ($cmd eq "ftui") { return pageAsHtml($hash,"ftui"); } return; } ################################################################ sub Rename { my ($new_name,$old_name) = @_; my $hash = $defs{$new_name}; $hash->{DEF} =~ s/$old_name/$new_name/g; $hash->{LINK} =~ s/$old_name/$new_name/g; return; } ################################################################ sub Copy { my ($old_name,$new_name) = @_; my $hash = $defs{$new_name}; $hash->{DEF} =~ s/$old_name/$new_name/g; $hash->{LINK} =~ s/$old_name/$new_name/g; return; } ################################################################ sub Attr { my ($cmd,$name,$aName,$aVal) = @_; my $hash = $defs{$name}; my ($do,$val); # $cmd can be "del" or "set" # $name is device name # aName and aVal are Attribute name and value if($aName eq "disable") { if($cmd eq "set") { $do = ($aVal) ? 1 : 0; } $do = 0 if($cmd eq "del"); $val = ($do == 1 ? "disabled" : "initialized"); readingsSingleUpdate($hash, "state", $val, 1); if($do == 1) { my @allrds = keys%{$defs{$name}{READINGS}}; foreach my $key(@allrds) { delete($defs{$name}{READINGS}{$key}) if($key ne "state"); } } } if($aName eq "icon") { $_[2] = "consumerAdviceIcon"; } return; } ################################################################ sub FwFn { my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn. my $hash = $defs{$d}; my $link = $hash->{LINK}; my $height; RemoveInternalTimer($hash); $hash->{HELPER}{FW} = $FW_wname; $link = AnalyzePerlCommand(undef, $link) if($link =~ m/^{(.*)}$/s); my $alias = AttrVal($d, "alias", $d); # Linktext als Aliasname oder Devicename setzen my $dlink = "<a href=\"/fhem?detail=$d\">$alias</a>"; my $ret = ""; if(IsDisabled($d)) { $height = AttrNum($d, 'beamHeight', 200); $ret .= "<table class='roomoverview'>"; $ret .= "<tr style='height:".$height."px'>"; $ret .= "<td>"; $ret .= "SMA Portal graphic device <a href=\"/fhem?detail=$d\">$d</a> is disabled"; $ret .= "</td>"; $ret .= "</tr>"; $ret .= "</table>"; } else { $ret .= "<span>$dlink </span><br>" if(AttrVal($d,"showLink",0)); $ret .= $link; } # Autorefresh nur des aufrufenden FHEMWEB-Devices my $al = AttrVal($d, "autoRefresh", 0); if($al) { InternalTimer(gettimeofday()+$al, \&pageRefresh, $hash, 0); Log3($d, 5, "$d - next start of autoRefresh: ".FmtDateTime(gettimeofday()+$al)); } return $ret; } ################################################################ sub pageRefresh { my ($hash) = @_; my $d = $hash->{NAME}; # Seitenrefresh festgelegt durch SMAPortalSPG-Attribut "autoRefresh" und "autoRefreshFW" my $rd = AttrVal($d, "autoRefreshFW", $hash->{HELPER}{FW}); { map { FW_directNotify("#FHEMWEB:$_", "location.reload('true')", "") } $rd } my $al = AttrVal($d, "autoRefresh", 0); if($al) { InternalTimer(gettimeofday()+$al, \&pageRefresh, $hash, 0); Log3($d, 5, "$d - next start of autoRefresh: ".FmtDateTime(gettimeofday()+$al)); } else { RemoveInternalTimer($hash); } return; } ############################################################################################# # Versionierungen des Moduls setzen # Die Verwendung von Meta.pm und Packages wird berücksichtigt ############################################################################################# sub setVersionInfo { my ($hash) = @_; my $name = $hash->{NAME}; my $v = (sortTopicNum("desc",keys %vNotesIntern))[0]; my $type = $hash->{TYPE}; $hash->{HELPER}{PACKAGE} = __PACKAGE__; $hash->{HELPER}{VERSION} = $v; if($modules{$type}{META}{x_prereqs_src} && !$hash->{HELPER}{MODMETAABSENT}) { # META-Daten sind vorhanden $modules{$type}{META}{version} = "v".$v; # Version aus META.json überschreiben, Anzeige mit {Dumper $modules{SMAPortal}{META}} if($modules{$type}{META}{x_version}) { # {x_version} ( nur gesetzt wenn $Id: 76_SMAPortalSPG.pm 21735 2020-04-20 20:53:24Z DS_Starter $ im Kopf komplett! vorhanden ) $modules{$type}{META}{x_version} =~ s/1.1.1/$v/g; } else { $modules{$type}{META}{x_version} = $v; } return $@ unless (FHEM::Meta::SetInternals($hash)); # FVERSION wird gesetzt ( nur gesetzt wenn $Id: 76_SMAPortalSPG.pm 21735 2020-04-20 20:53:24Z DS_Starter $ im Kopf komplett! vorhanden ) if(__PACKAGE__ eq "FHEM::$type" || __PACKAGE__ eq $type) { # es wird mit Packages gearbeitet -> Perl übliche Modulversion setzen # mit {<Modul>->VERSION()} im FHEMWEB kann Modulversion abgefragt werden use version 0.77; our $VERSION = FHEM::Meta::Get( $hash, 'version' ); } } else { # herkömmliche Modulstruktur $hash->{VERSION} = $v; } return; } ################################################################ # Grafik als HTML zurück liefern (z.B. für Widget) ################################################################ sub pageAsHtml { my ($hash,$ftui) = @_; my $name = $hash->{NAME}; my $link = $hash->{LINK}; my $height; if ($ftui && $ftui eq "ftui") { # Aufruf aus TabletUI -> FW_cmd ersetzen gemäß FTUI Syntax my $s = substr($link,0,length($link)-2); $link = $s.",'$ftui')}"; } $link = AnalyzePerlCommand(undef, $link) if($link =~ m/^{(.*)}$/s); my $alias = AttrVal($name, "alias", $name); # Linktext als Aliasname oder Devicename setzen my $dlink = "<a href=\"/fhem?detail=$name\">$alias</a>"; my $ret = "<html>"; if(IsDisabled($name)) { $height = AttrNum($name, 'beamHeight', 200); $ret .= "<table class='roomoverview'>"; $ret .= "<tr style='height:".$height."px'>"; $ret .= "<td>"; $ret .= "SMA Portal graphic device <a href=\"/fhem?detail=$name\">$name</a> is disabled"; $ret .= "</td>"; $ret .= "</tr>"; $ret .= "</table>"; } else { $ret .= "<span>$dlink </span><br>" if(AttrVal($name,"showLink",0)); $ret .= $link; } $ret .= "</html>"; return $ret; } 1; =pod =item summary Definition of graphic devices by the SMAPortal module =item summary_DE Erstellung von Grafik-Devices durch das SMAPortal-Modul =begin html <a name="SMAPortalSPG"></a> <h3>SMAPortalSPG</h3> <br> The module SMAPortalSPG is a device module attuned to the module SMAPortal for definition of graphic devices. <br> Graphic data can also be integrated into FHEM Tablet UI with the <a href="https://wiki.fhem.de/wiki/FTUI_Widget_SMAPortalSPG">"SMAPortalSPG Widget"</a>. <br> <ul> <a name="SMAPortalSPGdefine"></a> <b>Define</b> <br><br> <ul> A SMAPortal graphic device is defined by the command "set &lt;name&gt; createPortalGraphic &lt;type&gt;" in an SMAPortal device. Please see the description of SMAPortal <a href="#SMAPortalCreatePortalGraphic">"createPortalGraphic"</a> command. <br><br> </ul> <a name="SMAPortalSPGset"></a> <b>Set</b> <ul> N/A </ul> <br> <a name="SMAPortalSPGget"></a> <b>Get</b> <ul> <br> <ul> <li><b> get &lt;name&gt; html </b> </li> The SMAPortal graphic is fetched as HTML-code and depicted. </ul> <br> <br> </ul> <a name="SMAPortalSPGattr"></a> <b>Attribute</b> <br><br> <ul> <ul> <a name="alias"></a> <li><b>alias </b><br> In conjunction with "showLink" a user-defined label for the device. </li> <br> <a name="autoRefresh"></a> <li><b>autoRefresh</b><br> If set, active browser pages of the FHEMWEB device which has called the SMAPortalSPG device, are new reloaded after the specified time (seconds). Browser pages of a particular FHEMWEB device to be refreshed can be specified by attribute "autoRefreshFW" instead. </li> <br> <a name="autoRefreshFW"></a> <li><b>autoRefreshFW</b><br> If "autoRefresh" is activated, you can specify a particular FHEMWEB device whose active browser pages are refreshed periodically. </li> <br> <a name="beamColor"></a> <li><b>beamColor </b><br> Color selection for the primary beams. </li> <br> <a name="beamColor2"></a> <li><b>beamColor2 </b><br> Color selection for the secondary beams. The second color only make sense for devices of type "Generation_Consumption" (Type pvco) and "Differential" (Type diff). </li> <br> <a name="beamHeight"></a> <li><b>beamHeight &lt;value&gt; </b><br> Height of beams in px and therefore the determination of the whole graphic Height. In conjunction with "hourCount" it is possible to create quite tiny graphics. (default: 200) </li> <br> <a name="beamWidth"></a> <li><b>beamWidth &lt;value&gt; </b><br> Width of the beams in px. (default: 6 (auto)) </li> <br> <a name="consumerList"></a> <li><b>consumerList &lt;Verbraucher1&gt;:&lt;Icon&gt;@&lt;Farbe&gt;,&lt;Verbraucher2&gt;:&lt;Icon&gt;@&lt;Farbe&gt;,...</b><br> Comma separated list of consumers which are connected to the Sunny Home Manager. <br> Once the activation of a listed consumer is planned, the consumer icon will be shown in the beams of the planned period. The name of a consumer must be identical to its name in Reading "L3_&lt;consumer&gt;_Planned". <br><br> <b>Example: </b> <br> attr &lt;name&gt; consumerList Trockner:scene_clothes_dryer@yellow,Waschmaschine:scene_washing_machine@lightgreen,Geschirrspueler:scene_dishwasher@orange <br> </li> <br> <a name="consumerLegend"></a> <li><b>consumerLegend &ltnone | icon_top | icon_bottom | text_top | text_bottom&gt; </b><br> Location respectively the method of the shown consumer legend. </li> <br> <a name="disable"></a> <li><b>disable</b><br> Activate/deactivate the device. </li> <br> <a name="forcePageRefresh"></a> <li><b>forcePageRefresh</b><br> The attribute is evaluated by the SMAPortal module. <br> If set, a reload of all browser pages with active FHEMWEB connections will be enforced when the parent SMAPortal device was updated. </li> <br> <a name="headerAlignment"></a> <li><b>headerAlignment &lt;center | left | right&gt; </b><br> Alignment of the header lines. (default: center) </li> <br> <a name="headerDetail"></a> <li><b>headerDetail &lt;all | co | pv | pvco | statusLink&gt; </b><br> Detail level of the header lines. (default: all) <ul> <table> <colgroup> <col width=15%> <col width=85%> </colgroup> <tr><td> <b>all</b> </td> <td>display production (PV), consumption (CO), link to SMAPortal device + update timestamp (default)</td></tr> <tr><td> <b>co</b> </td> <td>display consumption (CO) only</td></tr> <tr><td> <b>pv</b> </td> <td>display production (PV) only</td></tr> <tr><td> <b>pvco</b> </td> <td>display production (PV) and consumption (CO)</td></tr> <tr><td> <b>statusLink</b> </td><td>Link to SMAPortal device + update timestamp only</td></tr> </table> </ul> </li> <br> <a name="hourCount"></a> <li><b>hourCount &lt;4...24&gt; </b><br> Amount of beams/hours to show. (default: 24) </li> <br> <a name="hourStyle"></a> <li><b>hourStyle </b><br> Format of time specification. <br><br> <ul> <table> <colgroup> <col width=10%> <col width=90%> </colgroup> <tr><td> <b>not set</b> </td><td>- only hours without minutes (default)</td></tr> <tr><td> <b>:00</b> </td><td>- hours and minutes two-digit, e.g. 10:00 </td></tr> <tr><td> <b>:0</b> </td><td>- hours and minutes one-digit, e.g. 8:0 </td></tr> </table> </ul> </li> <br> <a name="maxPV"></a> <li><b>maxPV &lt;0...val&gt; </b><br> Maximum yield per hour to calculate the beam height. (default: 0 -> dynamical) </li> <br> <a name="htmlStart"></a> <li><b>htmlStart &lt;HTML-String&gt; </b><br> A user-defined HTML-String issued before the graphic code. </li> <br> <a name="htmlEnd"></a> <li><b>htmlEnd &lt;HTML-String&gt; </b><br> A user-defined HTML-String issued after the graphic code. </li> <br> <a name="showDiff"></a> <li><b>showDiff &lt;no | top | bottom&gt; </b><br> Additional note of the difference "Generation - Consumption" as well as the device type Differential (diff) does. (default: no) </li> <br> <a name="showHeader"></a> <li><b>showHeader </b><br> Shows the header line with forecast data, Rest of the current day generation and the forecast of the next day (default: 1) </li> <br> <a name="showLink"></a> <li><b>showLink </b><br> Show the detail link above the graphic device. (default: 1) </li> <br> <a name="showNight"></a> <li><b>showNight </b><br> Show the night hours (without forecast values) additionally. (default: 0) </li> <br> <a name="showWeather"></a> <li><b>showWeather </b><br> Show weather icons. (default: 1) </li> <br> <a name="spaceSize"></a> <li><b>spaceSize &lt;value&gt; </b><br> Determines the space (px) above or below the beams (only when using the type "Differential" (diff)) to the shown values. If styles are using large fonts the default value may be too less. In that cases please increase the value. (default: 24) </li> <br> <a name="consumerAdviceIcon"></a> <li><b>consumerAdviceIcon </b><br> Set the icon used in periods with suggestion to switch consumers on. You can use the standard "Select Icon" function (down left in FHEMWEB) to select the wanted icon. </li> <br> <a name="layoutType"></a> <li><b>layoutType &lt;pv | co | pvco | diff&gt; </b><br> Layout type of Portal graphic. (default: pv) <br><br> <ul> <table> <colgroup> <col width=15%> <col width=85%> </colgroup> <tr><td> <b>pv</b> </td><td>- Generation </td></tr> <tr><td> <b>co</b> </td><td>- Consumption </td></tr> <tr><td> <b>pvco</b> </td><td>- Generation and Consumption </td></tr> <tr><td> <b>diff</b> </td><td>- Differenz between Generation and Consumption </td></tr> </table> </ul> </li> <br> <a name="Wh/kWh"></a> <li><b>Wh/kWh &lt;Wh | kWh&gt; </b><br> Switch the unit to W or to kW rounded to one position after decimal point. (default: W) </li> <br> <a name="weatherColor"></a> <li><b>weatherColor </b><br> Color of weather icons. </li> <br> </ul> </ul> </ul> =end html =begin html_DE <a name="SMAPortalSPG"></a> <h3>SMAPortalSPG</h3> <br> Das Modul SMAPortalSPG ist ein mit SMAPortal abgestimmtes Gerätemodul zur Definition von Grafik-Devices. <br> Die Portalgrafik kann ebenfalls in FHEM Tablet UI mit dem <a href="https://wiki.fhem.de/wiki/FTUI_Widget_SMAPortalSPG">"SMAPortalSPG Widget"</a> integriert werden. <br> <ul> <a name="SMAPortalSPGdefine"></a> <b>Define</b> <br><br> <ul> Ein SMAPortal Grafik-Device wird durch den SMAPortal Befehl "set &lt;name&gt; createPortalGraphic &lt;Typ&gt;" erstellt. Siehe auch die Beschreibung zum SMAPortal <a href="#SMAPortalCreatePortalGraphic">"createPortalGraphic"</a> Befehl. <br><br> </ul> <a name="SMAPortalSPGset"></a> <b>Set</b> <ul> N/A </ul> <br> <a name="SMAPortalSPGget"></a> <b>Get</b> <ul> <br> <ul> <li><b> get &lt;name&gt; html </b> </li> Die SMAPortal-Grafik wird als HTML-Code abgerufen und wiedergegeben. </ul> <br> <br> </ul> <a name="SMAPortalSPGattr"></a> <b>Attribute</b> <br><br> <ul> <ul> <a name="alias"></a> <li><b>alias </b><br> In Verbindung mit "showLink" ein beliebiger Abzeigename. </li> <br> <a name="autoRefresh"></a> <li><b>autoRefresh</b><br> Wenn gesetzt, werden aktive Browserseiten des FHEMWEB-Devices welches das SMAPortalSPG-Device aufgerufen hat, nach der eingestellten Zeit (Sekunden) neu geladen. Sollen statt dessen Browserseiten eines bestimmten FHEMWEB-Devices neu geladen werden, kann dieses Device mit dem Attribut "autoRefreshFW" festgelegt werden. </li> <br> <a name="autoRefreshFW"></a> <li><b>autoRefreshFW</b><br> Ist "autoRefresh" aktiviert, kann mit diesem Attribut das FHEMWEB-Device bestimmt werden dessen aktive Browserseiten regelmäßig neu geladen werden sollen. </li> <br> <a name="beamColor"></a> <li><b>beamColor </b><br> Farbauswahl der primären Balken. </li> <br> <a name="beamColor2"></a> <li><b>beamColor2 </b><br> Farbauswahl der sekundären Balken. Die zweite Farbe ist nur sinnvoll für den Anzeigedevice-Typ "Generation_Consumption" (pvco) und "Differential" (diff). </li> <br> <a name="beamHeight"></a> <li><b>beamHeight &lt;value&gt; </b><br> Höhe der Balken in px und damit Bestimmung der gesammten Höhe. In Verbindung mit "hourCount" lassen sich damit auch recht kleine Grafikausgaben erzeugen. (default: 200) </li> <br> <a name="beamWidth"></a> <li><b>beamWidth &lt;value&gt; </b><br> Breite der Balken in px. (default: 6 (auto)) </li> <br> <a name="consumerList"></a> <li><b>consumerList &lt;Verbraucher1&gt;:&lt;Icon&gt;@&lt;Farbe&gt;,&lt;Verbraucher2&gt;:&lt;Icon&gt;@&lt;Farbe&gt;,...</b><br> Komma getrennte Liste der am SMA Sunny Home Manager angeschlossenen Geräte. <br> Sobald die Aktivierung einer der angegebenen Verbraucher geplant ist, wird der geplante Zeitraum in der Grafik angezeigt. Der Name des Verbrauchers muss dabei dem Namen im Reading "L3_&lt;Verbrauchername&gt;_Planned" entsprechen. <br><br> <b>Beispiel: </b> <br> attr &lt;name&gt; consumerList Trockner:scene_clothes_dryer@yellow,Waschmaschine:scene_washing_machine@lightgreen,Geschirrspueler:scene_dishwasher@orange <br> </li> <br> <a name="consumerLegend"></a> <li><b>consumerLegend &ltnone | icon_top | icon_bottom | text_top | text_bottom&gt; </b><br> Lage bzw. Art und Weise der angezeigten Verbraucherlegende. </li> <br> <a name="disable"></a> <li><b>disable</b><br> Aktiviert/deaktiviert das Device. </li> <br> <a name="forcePageRefresh"></a> <li><b>forcePageRefresh</b><br> Das Attribut wird durch das SMAPortal-Device ausgewertet. <br> Wenn gesetzt, wird ein Reload aller Browserseiten mit aktiven FHEMWEB-Verbindungen nach dem Update des Eltern-SMAPortal-Devices erzwungen. </li> <br> <a name="headerAlignment"></a> <li><b>headerAlignment &lt;center | left | right&gt; </b><br> Ausrichtung der Kopfzeilen. (default: center) </li> <br> <a name="headerDetail"></a> <li><b>headerDetail &lt;all | co | pv | pvco | statusLink&gt; </b><br> Detailiierungsgrad der Kopfzeilen. (default: all) <ul> <table> <colgroup> <col width=15%> <col width=85%> </colgroup> <tr><td> <b>all</b> </td> <td>Anzeige Erzeugung (PV), Verbrauch (CO), Link zum SMAPortal-Device + Aktualisierungszeit (default)</td></tr> <tr><td> <b>co</b> </td> <td>nur Verbrauch (CO)</td></tr> <tr><td> <b>pv</b> </td> <td>nur Erzeugung (PV)</td></tr> <tr><td> <b>pvco</b> </td> <td>Erzeugung (PV) und Verbrauch (CO)</td></tr> <tr><td> <b>statusLink</b> </td><td>nur Link zum SMAPortal-Device + Aktualisierungszeit</td></tr> </table> </ul> </li> <br> <a name="hourCount"></a> <li><b>hourCount &lt;4...24&gt; </b><br> Anzahl der Balken/Stunden. (default: 24) </li> <br> <a name="hourStyle"></a> <li><b>hourStyle </b><br> Format der Zeitangabe. <br><br> <ul> <table> <colgroup> <col width=10%> <col width=90%> </colgroup> <tr><td> <b>nicht gesetzt</b> </td><td>- nur Stundenangabe ohne Minuten (default)</td></tr> <tr><td> <b>:00</b> </td><td>- Stunden sowie Minuten zweistellig, z.B. 10:00 </td></tr> <tr><td> <b>:0</b> </td><td>- Stunden sowie Minuten einstellig, z.B. 8:0 </td></tr> </table> </ul> </li> <br> <a name="maxPV"></a> <li><b>maxPV &lt;0...val&gt; </b><br> Maximaler Ertrag in einer Stunde zur Berechnung der Balkenhöhe. (default: 0 -> dynamisch) </li> <br> <a name="htmlStart"></a> <li><b>htmlStart &lt;HTML-String&gt; </b><br> Angabe eines beliebigen HTML-Strings der vor dem Grafik-Code ausgeführt wird. </li> <br> <a name="htmlEnd"></a> <li><b>htmlEnd &lt;HTML-String&gt; </b><br> Angabe eines beliebigen HTML-Strings der nach dem Grafik-Code ausgeführt wird. </li> <br> <a name="showDiff"></a> <li><b>showDiff &lt;no | top | bottom&gt; </b><br> Zusätzliche Anzeige der Differenz "Ertrag - Verbrauch" wie beim Anzeigetyp Differential (diff). (default: no) </li> <br> <a name="showHeader"></a> <li><b>showHeader </b><br> Anzeige der Kopfzeile mit Prognosedaten, Rest des aktuellen Tages und des nächsten Tages (default: 1) </li> <br> <a name="showLink"></a> <li><b>showLink </b><br> Anzeige des Detail-Links über dem Grafik-Device (default: 1) </li> <br> <a name="showNight"></a> <li><b>showNight </b><br> Die Nachtstunden (ohne Ertragsprognose) werden mit angezeigt. (default: 0) </li> <br> <a name="showWeather"></a> <li><b>showWeather </b><br> Wettericons anzeigen. (default: 1) </li> <br> <a name="spaceSize"></a> <li><b>spaceSize &lt;value&gt; </b><br> Legt fest wieviel Platz in px über oder unter den Balken (bei Anzeigetyp Differential (diff)) zur Anzeige der Werte freigehalten wird. Bei Styles mit große Fonts kann der default-Wert zu klein sein bzw. rutscht ein Balken u.U. über die Grundlinie. In diesen Fällen bitte den Wert erhöhen. (default: 24) </li> <br> <a name="consumerAdviceIcon"></a> <li><b>consumerAdviceIcon </b><br> Setzt das Icon zur Darstellung der Zeiten mit Verbraucherempfehlung. Dazu kann ein beliebiges Icon mit Hilfe der Standard "Select Icon"-Funktion (links unten im FHEMWEB) direkt ausgewählt werden. </li> <br> <a name="layoutType"></a> <li><b>layoutType &lt;pv | co | pvco | diff&gt; </b><br> Layout der Portalgrafik. (default: pv) <br><br> <ul> <table> <colgroup> <col width=15%> <col width=85%> </colgroup> <tr><td> <b>pv</b> </td><td>- Erzeugung </td></tr> <tr><td> <b>co</b> </td><td>- Verbrauch </td></tr> <tr><td> <b>pvco</b> </td><td>- Erzeugung und Verbrauch </td></tr> <tr><td> <b>diff</b> </td><td>- Differenz von Erzeugung und Verbrauch </td></tr> </table> </ul> </li> <br> <a name="Wh/kWh"></a> <li><b>Wh/kWh &lt;Wh | kWh&gt; </b><br> Definiert die Anzeigeeinheit in Wh oder in kWh auf eine Nachkommastelle gerundet. (default: W) </li> <br> <a name="weatherColor"></a> <li><b>weatherColor </b><br> Farbe der Wetter-Icons. </li> <br> </ul> </ul> </ul> =end html_DE =for :application/json;q=META.json 76_SMAPortalSPG.pm { "abstract": "Definition of grapic devices by the SMAPortal module", "x_lang": { "de": { "abstract": "Erstellung von Grafik-Devices durch das SMAPortal-Modul" } }, "keywords": [ "sma", "photovoltaik", "electricity", "portal", "smaportal", "graphics", "longpoll", "refresh" ], "version": "v1.1.1", "release_status": "stable", "author": [ "Heiko Maaz <heiko.maaz@t-online.de>" ], "x_fhem_maintainer": [ "DS_Starter" ], "x_fhem_maintainer_github": [ "nasseeder1" ], "prereqs": { "runtime": { "requires": { "FHEM": 5.00918799, "perl": 5.014, "Time::HiRes": 0 }, "recommends": { "FHEM::Meta": 0 }, "suggests": { } } }, "resources": { "repository": { "x_dev": { "type": "svn", "url": "https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter", "web": "https://svn.fhem.de/trac/browser/trunk/fhem/contrib/DS_Starter/76_SMAPortalSPG.pm", "x_branch": "dev", "x_filepath": "fhem/contrib/", "x_raw": "https://svn.fhem.de/fhem/trunk/fhem/contrib/DS_Starter/76_SMAPortalSPG.pm" } } } } =end :application/json;q=META.json =cut
34.227683
254
0.518418
73fb633cc62aa7d4c5036732f34302644a0c171d
2,707
pm
Perl
auto-lib/Paws/ElastiCache/NodeGroup.pm
shogo82148/aws-sdk-perl
a87555a9d30dd1415235ebacd2715b2f7e5163c7
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/ElastiCache/NodeGroup.pm
shogo82148/aws-sdk-perl
a87555a9d30dd1415235ebacd2715b2f7e5163c7
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/ElastiCache/NodeGroup.pm
shogo82148/aws-sdk-perl
a87555a9d30dd1415235ebacd2715b2f7e5163c7
[ "Apache-2.0" ]
null
null
null
# Generated by default/object.tt package Paws::ElastiCache::NodeGroup; use Moose; has NodeGroupId => (is => 'ro', isa => 'Str'); has NodeGroupMembers => (is => 'ro', isa => 'ArrayRef[Paws::ElastiCache::NodeGroupMember]', request_name => 'NodeGroupMember', traits => ['NameInRequest']); has PrimaryEndpoint => (is => 'ro', isa => 'Paws::ElastiCache::Endpoint'); has ReaderEndpoint => (is => 'ro', isa => 'Paws::ElastiCache::Endpoint'); has Slots => (is => 'ro', isa => 'Str'); has Status => (is => 'ro', isa => 'Str'); 1; ### main pod documentation begin ### =head1 NAME Paws::ElastiCache::NodeGroup =head1 USAGE This class represents one of two things: =head3 Arguments in a call to a service Use the attributes of this class as arguments to methods. You shouldn't make instances of this class. Each attribute should be used as a named argument in the calls that expect this type of object. As an example, if Att1 is expected to be a Paws::ElastiCache::NodeGroup object: $service_obj->Method(Att1 => { NodeGroupId => $value, ..., Status => $value }); =head3 Results returned from an API call Use accessors for each attribute. If Att1 is expected to be an Paws::ElastiCache::NodeGroup object: $result = $service_obj->Method(...); $result->Att1->NodeGroupId =head1 DESCRIPTION Represents a collection of cache nodes in a replication group. One node in the node group is the read/write primary node. All the other nodes are read-only Replica nodes. =head1 ATTRIBUTES =head2 NodeGroupId => Str The identifier for the node group (shard). A Redis (cluster mode disabled) replication group contains only 1 node group; therefore, the node group ID is 0001. A Redis (cluster mode enabled) replication group contains 1 to 90 node groups numbered 0001 to 0090. Optionally, the user can provide the id for a node group. =head2 NodeGroupMembers => ArrayRef[L<Paws::ElastiCache::NodeGroupMember>] A list containing information about individual nodes within the node group (shard). =head2 PrimaryEndpoint => L<Paws::ElastiCache::Endpoint> The endpoint of the primary node in this node group (shard). =head2 ReaderEndpoint => L<Paws::ElastiCache::Endpoint> The endpoint of the replica nodes in this node group (shard). =head2 Slots => Str The keyspace for this node group (shard). =head2 Status => Str The current state of this replication group - C<creating>, C<available>, etc. =head1 SEE ALSO This class forms part of L<Paws>, describing an object used in L<Paws::ElastiCache> =head1 BUGS and CONTRIBUTIONS The source code is located here: L<https://github.com/pplu/aws-sdk-perl> Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> =cut
27.907216
158
0.727743
73e26a5e7efd6f4a8a8dc2db9282afd59fb90052
322
pl
Perl
Scripts/FetchFromList.Col_1.pl
Alipe2021/NLncCirSmk
b44ac963d2a9591adfb57690f611337d9fd60655
[ "MIT" ]
5
2022-01-18T09:20:34.000Z
2022-03-31T04:45:00.000Z
Scripts/FetchFromList.Col_1.pl
Alipe2021/NLncCirSmk
b44ac963d2a9591adfb57690f611337d9fd60655
[ "MIT" ]
null
null
null
Scripts/FetchFromList.Col_1.pl
Alipe2021/NLncCirSmk
b44ac963d2a9591adfb57690f611337d9fd60655
[ "MIT" ]
2
2022-03-18T03:24:33.000Z
2022-03-30T02:02:05.000Z
#!/usr/bin/perl -w use strict; open IN, $ARGV[0] || die $!; my %list = map{$_ =~ s/[\r\n]//g; $_, 1;}<IN>; close IN; open IN, $ARGV[1] || die $!; my $header = <IN>; print $header; while(<IN>){ chomp; next if /^#|^$/; my @a = split /\t/, $_; print "$_\n" if (exists $list{$a[0]}); } close IN; __END__
14.636364
46
0.487578
73fe87e55632760c20e90a79780af91b6b3ec23d
574
pm
Perl
lib/YaST/NetworkSettings/NetworkCardSetup/GeneralTab.pm
acerv/os-autoinst-distri-opensuse
0e0cfca02f3a86323682c511a1efa926c7f0df3a
[ "FSFAP" ]
84
2015-02-10T16:01:52.000Z
2022-03-10T21:20:14.000Z
lib/YaST/NetworkSettings/NetworkCardSetup/GeneralTab.pm
acerv/os-autoinst-distri-opensuse
0e0cfca02f3a86323682c511a1efa926c7f0df3a
[ "FSFAP" ]
8,065
2015-01-07T07:44:02.000Z
2022-03-31T12:02:06.000Z
lib/YaST/NetworkSettings/NetworkCardSetup/GeneralTab.pm
acerv/os-autoinst-distri-opensuse
0e0cfca02f3a86323682c511a1efa926c7f0df3a
[ "FSFAP" ]
404
2015-01-14T14:42:44.000Z
2022-03-30T07:38:08.000Z
# SUSE's openQA tests # # Copyright 2019-2021 SUSE LLC # SPDX-License-Identifier: FSFAP # Summary: The class introduces all accessing methods for General Tab in YaST2 # lan module dialog. # Maintainer: QE YaST <qa-sle-yast@suse.de> package YaST::NetworkSettings::NetworkCardSetup::GeneralTab; use strict; use warnings; use testapi; use parent 'YaST::NetworkSettings::NetworkCardSetup::NetworkCardSetupWizard'; use constant { NETWORK_CARD_SETUP => 'yast2_lan_network_card_setup' }; sub select_tab { assert_screen(NETWORK_CARD_SETUP); send_key('alt-g'); } 1;
22.076923
78
0.763066
73d1f7251f013f3dbd3097b48412522140ff68f2
2,099
pm
Perl
auto-lib/Paws/ComputeOptimizer/GetEnrollmentStatus.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
164
2015-01-08T14:58:53.000Z
2022-02-20T19:16:24.000Z
auto-lib/Paws/ComputeOptimizer/GetEnrollmentStatus.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
348
2015-01-07T22:08:38.000Z
2022-01-27T14:34:44.000Z
auto-lib/Paws/ComputeOptimizer/GetEnrollmentStatus.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
87
2015-04-22T06:29:47.000Z
2021-09-29T14:45:55.000Z
package Paws::ComputeOptimizer::GetEnrollmentStatus; use Moose; use MooseX::ClassAttribute; class_has _api_call => (isa => 'Str', is => 'ro', default => 'GetEnrollmentStatus'); class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::ComputeOptimizer::GetEnrollmentStatusResponse'); class_has _result_key => (isa => 'Str', is => 'ro'); 1; ### main pod documentation begin ### =head1 NAME Paws::ComputeOptimizer::GetEnrollmentStatus - Arguments for method GetEnrollmentStatus on L<Paws::ComputeOptimizer> =head1 DESCRIPTION This class represents the parameters used for calling the method GetEnrollmentStatus on the L<AWS Compute Optimizer|Paws::ComputeOptimizer> service. Use the attributes of this class as arguments to method GetEnrollmentStatus. You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to GetEnrollmentStatus. =head1 SYNOPSIS my $compute-optimizer = Paws->service('ComputeOptimizer'); my $GetEnrollmentStatusResponse = $compute -optimizer->GetEnrollmentStatus(); # Results: my $MemberAccountsEnrolled = $GetEnrollmentStatusResponse->MemberAccountsEnrolled; my $Status = $GetEnrollmentStatusResponse->Status; my $StatusReason = $GetEnrollmentStatusResponse->StatusReason; # Returns a L<Paws::ComputeOptimizer::GetEnrollmentStatusResponse> object. Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/compute-optimizer/GetEnrollmentStatus> =head1 ATTRIBUTES =head1 SEE ALSO This class forms part of L<Paws>, documenting arguments for method GetEnrollmentStatus in L<Paws::ComputeOptimizer> =head1 BUGS and CONTRIBUTIONS The source code is located here: L<https://github.com/pplu/aws-sdk-perl> Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> =cut
35.576271
249
0.760362
ed138c2e41005f8f614c84c02ba541eef1894d19
5,301
pm
Perl
lib/JSONSchema/Validator/URIResolver.pm
j-waters/perl-jsonschema-validator
fb9ef14e3a2165b822083af51fe281fa9cdcd586
[ "MIT" ]
null
null
null
lib/JSONSchema/Validator/URIResolver.pm
j-waters/perl-jsonschema-validator
fb9ef14e3a2165b822083af51fe281fa9cdcd586
[ "MIT" ]
null
null
null
lib/JSONSchema/Validator/URIResolver.pm
j-waters/perl-jsonschema-validator
fb9ef14e3a2165b822083af51fe281fa9cdcd586
[ "MIT" ]
null
null
null
package JSONSchema::Validator::URIResolver; # ABSTRACT: URI resolver use strict; use warnings; use Carp 'croak'; use Scalar::Util 'weaken'; use URI; use URI::Escape; use Encode; use JSONSchema::Validator::JSONPointer 'json_pointer'; use JSONSchema::Validator::Util qw(get_resource decode_content); # what keys contain the schema? Required to find an $id in a schema my $SEARCH_ID = { value => { additionalItems => 1, items => 1, additionalProperties => 1, not => 1, propertyNames => 1, contains => 1, if => 1, then => 1, else => 1 }, kv_value => { properties => 1, patternProperties => 1, dependencies => 1, definitions => 1 }, arr_value => { items => 1, allOf => 1, anyOf => 1, oneOf => 1 } }; sub new { my ($class, %params) = @_; croak 'URIResolver: validator must be specified' unless $params{validator}; croak 'URIResolver: schema must be specified' unless defined $params{schema}; my $validator = $params{validator}; my $schema = $params{schema}; my $base_uri = $params{base_uri} // ''; my $scheme_handlers = $params{scheme_handlers} // {}; weaken($validator); my $self = { validator => $validator, cache => { $base_uri => $schema }, scheme_handlers => $scheme_handlers }; bless $self, $class; if ('#' eq substr $base_uri, -1) { $base_uri = substr $base_uri, 0, - 1; $self->{cache}{$base_uri} = $schema; } $self->cache_id(URI->new($base_uri), $schema) if $validator->using_id_with_ref && ref $schema eq 'HASH'; return $self; } sub validator { shift->{validator} } sub scheme_handlers { shift->{scheme_handlers} } sub cache { shift->{cache} } # self - URIResolver # origin_uri - URI # return (scope|string, schema) sub resolve { my ($self, $origin_uri) = @_; return ($origin_uri->as_string, $self->cache->{$origin_uri->as_string}) if exists $self->cache->{$origin_uri->as_string}; my $uri = $origin_uri->clone; $uri->fragment(undef); my $schema = $self->cache_resolve($uri); return $self->fragment_resolve($origin_uri, $schema); } # self - URIResolver # uri - URI # return schema sub cache_resolve { my ($self, $uri) = @_; my $scheme = $uri->scheme; return $self->cache->{$uri->as_string} if exists $self->cache->{$uri->as_string}; my ($response, $mime_type) = get_resource($self->scheme_handlers, $uri->as_string); my $schema = decode_content($response, $mime_type, $uri->as_string); $self->cache->{$uri->as_string} = $schema; $self->cache_id($uri, $schema) if $self->validator->using_id_with_ref; return $schema; } # self - URIResolver # uri - URI # schema - HASH/ARRAY # return (scope|string, schema) sub fragment_resolve { my ($self, $uri, $schema) = @_; return ($uri->as_string, $self->cache->{$uri->as_string}) if exists $self->cache->{$uri->as_string}; my $enc = Encode::find_encoding("UTF-8"); my $fragment = $enc->decode(uri_unescape($uri->fragment), 1); my $pointer = json_pointer->new( scope => $uri->as_string, value => $schema, validator => $self->validator ); # try to use fragment as json pointer $pointer = $pointer->get($fragment); my $subschema = $pointer->value; my $current_scope = $pointer->scope; $self->cache->{$uri->as_string} = $subschema; return ($current_scope, $subschema); } # self - URIResolver # uri - URI # schema - HASH/ARRAY sub cache_id { my ($self, $uri, $schema) = @_; # try to find id/$id and cache it to properly handle links in $ref # https://json-schema.org/understanding-json-schema/structuring.html#using-id-with-ref my $scopes = [$uri]; $self->cache_id_dfs($schema, $scopes); } # self - URIResolver # schema - HASH/ARRAY # scopes - [URI, ...] sub cache_id_dfs { my ($self, $schema, $scopes) = @_; return unless ref $schema eq 'HASH'; if (exists $schema->{$self->validator->ID_FIELD} && !ref $schema->{$self->validator->ID_FIELD}) { my $id = URI->new($schema->{$self->validator->ID_FIELD}); my $scope = $scopes->[-1]; $id = ($scope && $scope->as_string) ? $id->abs($scope) : $id; $self->cache->{$id->as_string} = $schema; push @$scopes, $id; } for my $k (keys %$schema) { if ($SEARCH_ID->{value}{$k} && ref $schema->{$k} eq 'HASH') { $self->cache_id_dfs($schema->{$k}, $scopes); } if ($SEARCH_ID->{arr_value}{$k} && ref $schema->{$k} eq 'ARRAY') { for my $value (@{$schema->{$k}}) { next unless ref $value eq 'HASH'; $self->cache_id_dfs($value, $scopes); } } if ($SEARCH_ID->{kv_value}{$k} && ref $schema->{$k} eq 'HASH') { for my $kv_key (keys %{$schema->{$k}}) { my $value = $schema->{$k}{$kv_key}; next unless ref $value eq 'HASH'; $self->cache_id_dfs($value, $scopes); } } } if (exists $schema->{$self->validator->ID_FIELD} && !ref $schema->{$self->validator->ID_FIELD}) { pop @$scopes; } } 1;
26.242574
125
0.573288
ed1b8424e26821dbd6edc3cf6e5cc0e831535832
3,004
t
Perl
t/nqp/049-regex-interpolation.t
salortiz/nqp
bef3f1c3b8cb27b26cfe6e0a9ce465bc3ed7075c
[ "Artistic-2.0" ]
179
2015-01-06T13:57:20.000Z
2020-03-08T19:26:34.000Z
t/nqp/049-regex-interpolation.t
salortiz/nqp
bef3f1c3b8cb27b26cfe6e0a9ce465bc3ed7075c
[ "Artistic-2.0" ]
281
2015-01-03T06:33:36.000Z
2020-03-17T18:40:40.000Z
t/nqp/049-regex-interpolation.t
salortiz/nqp
bef3f1c3b8cb27b26cfe6e0a9ce465bc3ed7075c
[ "Artistic-2.0" ]
138
2015-01-23T04:09:42.000Z
2020-03-08T19:26:36.000Z
plan(37); my $b := "b+"; my @foo := [ "b+", "c+" ]; ok("ab+d" ~~ /a $b d/, 'plain scalar interpolates as literal 1'); ok(!("abbbbbd" ~~ /a $b d/), 'plain scalar interpolates as literal 2'); ok("ab+d" ~~ /a @foo d/, 'plain array interpolates as alternations of literals 1'); ok("ac+d" ~~ /a @foo d/, 'plain array interpolates as alternations of literals 2'); ok(!("abbbbbd" ~~ /a @foo d/), 'plain array interpolates as alternations of literals 3'); ok(!("acccccd" ~~ /a @foo d/), 'plain array interpolates as alternations of literals 4'); my @ltm := [ "b", "bb", "bbc", "bc" ]; is(("abd" ~~ / @ltm /), 'b', 'array finds longest match 1'); is(("abbd" ~~ / @ltm /), 'bb', 'array finds longest match 2'); is(("abbcd" ~~ / @ltm /), 'bbc', 'array finds longest match 3'); is(("abccd" ~~ / @ltm /), 'bc', 'array finds longest match 4'); is(("abd" ~~ / || @ltm /), 'b', '|| array hits first match 1'); is(("abbd" ~~ / || @ltm /), 'b', '|| array hits first match 2'); is(("abbcd" ~~ / || @ltm /), 'b', '|| array hits first match 3'); is(("abccd" ~~ / || @ltm /), 'b', '|| array hits first match 4'); ok(!("ab+d" ~~ /a <$b> d/), 'scalar assertion interpolates as regex 1'); ok("abbbbbd" ~~ /a <$b> d/, 'scalar assertion interpolates as regex 2'); ok(!("ab+d" ~~ /a <@foo> d/), 'array assertion interpolates as alternations of regexen 1'); ok(!("ac+d" ~~ /a <@foo> d/), 'array assertion interpolates as alternations of regexen 2'); ok("abbbbbd" ~~ /a <@foo> d/, 'array assertion interpolates as alternations of regexen 3'); ok("acccccd" ~~ /a <@foo> d/, 'array assertion interpolates as alternations of regexen 4'); ok(!("ab+d" ~~ /a <{ "b+" }> d/), 'code assersion interpolates as regex 1'); ok("abbbbd" ~~ /a <{ "b+" }> d/, 'code assersion interpolates as regex 2'); ok("abbbbd" ~~ /a <{ ["b+", "c+"] }> d/, 'code assertion that returns array interpolates as alternations of regexen 1'); ok("accccd" ~~ /a <{ ["b+", "c+"] }> d/, 'code assertion that returns array interpolates as alternations of regexen 2'); my $r := /b+/; ok(!("ab+d" ~~ /a $r d/), 'plain scalar containing precompiled regex 1'); ok("abbbd" ~~ /a $r d/, 'plain scalar containing precompiled regex 2'); my @r := [ /b+/, "c+" ]; ok("abbbbd" ~~ /a @r d/, 'plain array containing mix of precompiled and literal 1'); ok("ac+d" ~~ /a @r d/, 'plain array containing mix of precompiled and literal 1'); my $xyz := 'xyz'; ok("axyzxyzd" ~~ /a $xyz+ d/, 'Quantified plain scalar 1'); ok("ab+b+b+d" ~~ /a $b+ d/, 'Quantified plain scalar 2'); ok("abbbc+bbbd" ~~ /a @r+ d/, 'Quantified plain array'); ok("abbbcccbbcd" ~~ /a <{ [ "b+", /c+/ ] }>+ d/, 'Quantified code assertion'); ok("ad" ~~ /a { "bc" } d/, "Plain closure doesn't interpolate 1"); ok(!("abcd" ~~ /a { "bc" } d/), "Plain closure doesn't interpolate 2"); ok("ad" ~~ /a <?{ 1 }> d/, 'Zero-width assertions still work 1'); ok(!("ad" ~~ /a <!{ 1 }> d/), 'Zero-width assertions still work 2'); ok("test.h" ~~ /.h$/, 'Do not parse $/ as variable interpolation');
46.9375
120
0.580892
73da5e70a467d8a3b9bb85a1509de774f09feede
1,325
t
Perl
t/legacy/SGN/Controller/Clone_Genomic.t
labroo2/sgn
c8a1a10e4ac2104d82c5fd2d986f1688d01b20be
[ "MIT" ]
39
2015-02-03T15:47:55.000Z
2022-03-23T13:34:05.000Z
t/legacy/SGN/Controller/Clone_Genomic.t
labroo2/sgn
c8a1a10e4ac2104d82c5fd2d986f1688d01b20be
[ "MIT" ]
2,491
2015-01-07T05:49:17.000Z
2022-03-31T15:31:05.000Z
t/legacy/SGN/Controller/Clone_Genomic.t
labroo2/sgn
c8a1a10e4ac2104d82c5fd2d986f1688d01b20be
[ "MIT" ]
20
2015-06-30T19:10:09.000Z
2022-03-23T13:34:09.000Z
use Modern::Perl; use Data::Dumper; use File::Temp; use Test::More tests => 2; use Path::Class; use CXGN::Genomic::Clone; use CXGN::PotatoGenome::FileRepository; use CXGN::Publish; use_ok('SGN::Controller::Clone::Genomic'); my $tempdir = File::Temp->newdir; my $tempfile = File::Temp->new; file($tempfile->filename)->openw->print(">RH123D21\nACTGACTGACTAGATGATCATCGATCGAGAGCG\n"); my $repos = CXGN::PotatoGenome::FileRepository->new( "$tempdir" ); my $ctl = SGN::Controller::Clone::Genomic->new; my $clone = CXGN::Genomic::Clone->retrieve_from_clone_name( 'RH123D21' ); SKIP: { my $test_vf; eval { $test_vf = $repos->get_vf( class => 'SingleCloneSequence', sequence_name => $clone->latest_sequence_name, format => 'fasta', project => $clone->seqprops->{project_country} ); }; skip 'could not retrieve clone, cannot test _potato_seq_files', 1 unless $test_vf; $repos->publish( $test_vf->publish_new_version( $tempfile->filename ) ); skip 'could not retrieve clone, cannot test _potato_seq_files', 1 unless $clone; my %files = $ctl->_potato_seq_files( undef, $clone, $tempdir ); ok( -f $files{seq}, 'got a potato seq file' ) or diag Dumper { files => \%files, find => scalar(`find $tempdir`) }; }
30.813953
90
0.646792
ed11c7343d8b5dc0a002d420bdb0de605bdd0ce9
8,289
pl
Perl
nsupdate.pl
Yuav/nsupdate-webif
f0b7749c978258ddc0f8c6db998272613a3e4ab9
[ "WTFPL" ]
null
null
null
nsupdate.pl
Yuav/nsupdate-webif
f0b7749c978258ddc0f8c6db998272613a3e4ab9
[ "WTFPL" ]
null
null
null
nsupdate.pl
Yuav/nsupdate-webif
f0b7749c978258ddc0f8c6db998272613a3e4ab9
[ "WTFPL" ]
null
null
null
#!/usr/bin/perl # Tis program is free software. It comes without any warranty, to # the extent permitted by applicable law. You can redistribute it # and/or modify it under the terms of the Do What The Fuck You Want # To Public License, Version 2, as published by Sam Hocevar. See # http://sam.zoy.org/wtfpl/COPYING for more details. use Net::DNS; use Net::IP; use Socket; use CGI qw/:standard *table/; use strict; #config my $charset='utf-8'; my $pagename='NSUpdate'; my $css='/nsupdate.css'; my $domain='example.local'; my $ptr='0.10.in-addr.arpa'; my $nsupdate='nsupdate'; my $rndc_key='/etc/bind/rndc.key'; #localize my $txtname = 'Name'; my $txtttl = 'TTL'; my $txtclass = 'Class'; my $txttype = 'Type'; my $txtdata = 'Data'; my $txtaction = 'Action'; my $txtrefresh = 'Refresh'; my $txtadd = 'Add'; my $txtdel = 'Delete'; my $txtaddrecord = 'Add record'; my $txtnoa = 'no A record'; my $txtmultia = 'multiple A record'; my $txtnoptr = 'no PTR record'; my $txtmultiptr = 'multiple PTR record'; my $txtaptrdiff = 'A name and PTR name differs'; my $txtcnameadiff = 'CNAME not points to the A record'; my $txtzonetransferfailed = 'Zone transfer failed: '; my $txtmalformedip = 'Malformed IP: '; my $txtnonexistingip = 'Nonexisting IP: '; my $txtproblems = 'Problems'; my $txtaddtable = 'Add record'; my $txtdomaintable = "Domain: $domain"; our(@sorted, @vals, @ips); my $problem=''; my $res = Net::DNS::Resolver->new; my @zone = $res->axfr($ptr); if(param('a') eq 'del' or param('a') eq 'add'){ print redirect(-uri=>url(), -charset=>$charset), start_html(-title=>$pagename, -encoding=>$charset, -style=>{'src'=>$css}); print h1($pagename),a({-href=>url(),-id=>'refresh'},$txtrefresh); if(param('a') eq 'add'){ print h2($txtadd); my $command =''; $command .= 'update add '.param('name').' '.param('ttl').' '.param('class').' '.param('type').' '.param('data')."\n"; $command .= "show\n"; $command .= "send\n"; $command .= "quit\n"; if($rndc_key){ print '<pre id="nsushow">'.`echo -n \"$command\" | nsupdate -k /etc/bind/rndc.key`.'</pre>'; } else{ print '<pre id="nsushow">'.`echo -n \"$command\" | nsupdate`.'</pre>'; } } elsif(param('a') eq 'del'){ print h2($txtdel); my $command =''; $command .= 'update delete '.param('name').' '.param('type')."\n"; $command .= "show\n"; $command .= "send\n"; $command .= "quit\n"; if($rndc_key){ print '<pre id="nsushow">'.`echo -n \"$command\" | nsupdate -k /etc/bind/rndc.key`.'</pre>'; } else{ print '<pre id="nsushow">'.`echo -n \"$command\" | nsupdate`.'</pre>'; } } Delete_all(); print end_html(); return; } print header(-charset=>$charset), start_html(-title=>$pagename, -encoding=>$charset, -style=>{'src'=>$css}); Delete_all(); print h1($pagename),a({-href=>url(),-id=>'refresh'},$txtrefresh); print start_multipart_form(), start_table({-id=>'addtable'}),caption($txtaddtable), Tr([ th([$txtname,$txtttl,$txtclass,$txttype,$txtdata,$txtaction]), td([textfield(-name=>'name'), textfield(-name=>'ttl'), textfield(-name=>'class'), textfield(-name=>'type'), textfield(-name=>'data'), submit(-value=>$txtadd).hidden(-name=>'a',-value=>'add') ]) ]), end_table,end_form; if (@zone) { foreach my $rr (@zone) { if($rr->type eq 'PTR'){ my @addr=split(/\./,$rr->name); @addr = reverse(splice(@addr,0,4)); my $addr=join('.',@addr); if($addr!~/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/){ $problem.=div({-class=>'problem'},$txtmalformedip.$rr->name, ' ', $rr->ttl, ' ', $rr->class, ' ', $rr->type, ' ', $rr->ptrdname ,start_multipart_form().submit(-value=>$txtdel).hidden(-name=>'a',-value=>'del').hidden(-name=>'name',-value=>$rr->name).hidden(-name=>'type',-value=>$rr->type).end_form); next; } &inssort(unpack('N', pack('C4', @addr)), join('.',@addr), ($rr->name, $rr->ttl, $rr->class, $rr->type, $rr->ptrdname)); } } } else { print $txtzonetransferfailed, $res->errorstring, "\n"; } @zone = $res->axfr($domain); if (@zone) { foreach my $rr (@zone) { if ($rr->type eq 'A'){ if($rr->address!~/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/){ $problem.=div({-class=>'problem'},$txtmalformedip.$rr->name, ' ', $rr->ttl, ' ', $rr->class, ' ', $rr->type, ' ', $rr->address, start_multipart_form().submit(-value=>$txtdel).hidden(-name=>'a',-value=>'del').hidden(-name=>'name',-value=>$rr->name).hidden(-name=>'type',-value=>$rr->type).end_form); next; } &inssort(unpack('N',pack('C4', split(/\./, $rr->address))), $rr->address, ($rr->name, $rr->ttl, $rr->class, $rr->type, $rr->address)); } elsif($rr->type eq 'CNAME'){ if(inet_aton($rr->cname)){ my $addr=inet_ntoa(inet_aton($rr->cname)); &inssort(unpack('N', pack('C4', split(/\./, $addr))), $addr, ($rr->name, $rr->ttl, $rr->class, $rr->type, $rr->cname)); } else{ $problem.=div({-class=>'problem'},$txtnonexistingip.$rr->name, ' ', $rr->ttl, ' ', $rr->class, ' ', $rr->type, ' ', $rr->cname, start_multipart_form().submit(-value=>$txtdel).hidden(-name=>'a',-value=>'del').hidden(-name=>'name',-value=>$rr->name).hidden(-name=>'type',-value=>$rr->type).end_form); } } elsif($rr->type eq 'TXT'){ if(inet_aton($rr->name)){ my $addr=inet_ntoa(inet_aton($rr->name)); &inssort(unpack('N', pack('C4', split(/\./, $addr))), $addr, ($rr->name, $rr->ttl, $rr->class, $rr->type, $rr->txtdata)); } else{ $problem.=div({-class=>'problem'},$txtnonexistingip.$rr->name, ' ', $rr->ttl, ' ', $rr->class, ' ', $rr->type, ' ', $rr->txtdata, start_multipart_form().submit(-value=>$txtdel).hidden(-name=>'a',-value=>'del').hidden(-name=>'name',-value=>$rr->name).hidden(-name=>'type',-value=>$rr->type).end_form); } } } } else { print $txtzonetransferfailed, $res->errorstring; } print start_table({-id=>'maintable'}),caption($txtdomaintable); print Tr({-class=>'heading'},th([$txtname,$txtttl,$txtclass,$txttype,$txtdata,$txtaction])); my $c=1; for my $i ( 0 .. $#vals ) { my $a = 0; my $adata=''; my $ptr = 0; my $ptrdata=''; my @cname = (); print Tr({-class=>'head',-id=>"$ips[$i]"},td({-colspan=>'6'},"$c: $ips[$i]")); foreach my $j (@{$vals[$i]}){ print Tr({-class=>'data'},td([@{$j},start_multipart_form().submit(-value=>$txtdel).hidden(-name=>'a',-value=>'del').hidden(-name=>'name',-value=>${$j}[0]).hidden(-name=>'type',-value=>${$j}[3]).end_form])); if(${$j}[3] eq 'A'){ $a++; $adata=${$j}[0]; } elsif(${$j}[3] eq 'PTR'){ $ptr++; $ptrdata=${$j}[4]; } elsif(${$j}[3] eq 'CNAME'){ push @cname, ${$j}[4]; } } $c++; if($a ne 1 or $ptr ne 1 or ($a eq 1 and $ptr eq 1 and lc $adata ne lc $ptrdata) or ($a eq 1 and $#cname ge 0)){ my @problems; push(@problems, $txtnoa) if($a < 1); push(@problems, $txtmultia) if($a > 1); push(@problems, $txtnoptr) if($ptr < 1); push(@problems, $txtmultiptr) if($ptr > 1); push(@problems, $txtaptrdiff) if($a eq 1 and $ptr eq 1 and lc $adata ne lc $ptrdata); if($a eq 1 and $#cname ge 0){ foreach my $cn (@cname){ if($cn ne $adata){ push(@problems, $txtcnameadiff); last; } } } $problem.=div({-class=>'problem'},a({href=>"#$ips[$i]"},$ips[$i]),join(', ',@problems)) if($#problems ge 0); } } print end_table; print h2($txtproblems),div({-id=>'problems'},$problem) if($problem ne ''); print end_html(); sub inssort { my ($by, $ip, @val) = @_; if($#sorted == -1){ push @sorted, $by; push @vals, [\@val]; push @ips, $ip; return; } else{ for my $pos ( 0 .. $#sorted ) { if ( $by > $sorted[$pos] and $pos == $#sorted ){ push @sorted, $by; push @vals, [\@val]; push @ips, $ip; return; } elsif( $by == $sorted[$pos] ){ push @{$vals[$pos]}, \@val; return; } elsif ( $by > $sorted[$pos] and ($pos+1) <= $#sorted and $by < $sorted[$pos+1] ) { splice @sorted, $pos+1, 0, $by; splice @vals, $pos+1, 0, [\@val]; splice @ips, $pos+1, 0, $ip; return; } elsif( $pos == 0 and $by < $sorted[0] ){ splice @sorted, 0, 0, $by; splice @vals, 0, 0, [\@val]; splice @ips, 0, 0, $ip; return; } } } }
29.924188
302
0.561105
73f018f700b7f3dbaf766519d7488ff0dd297b64
3,267
pm
Perl
misc-scripts/surgery/SeqStoreConverter/CaenorhabditisElegans.pm
duartemolha/ensembl
378db18977278a066bd54b41e7afcf1db05d7db3
[ "Apache-2.0" ]
null
null
null
misc-scripts/surgery/SeqStoreConverter/CaenorhabditisElegans.pm
duartemolha/ensembl
378db18977278a066bd54b41e7afcf1db05d7db3
[ "Apache-2.0" ]
null
null
null
misc-scripts/surgery/SeqStoreConverter/CaenorhabditisElegans.pm
duartemolha/ensembl
378db18977278a066bd54b41e7afcf1db05d7db3
[ "Apache-2.0" ]
null
null
null
=head1 LICENSE Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2019] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =cut use strict; use warnings; use SeqStoreConverter::BasicConverter; package SeqStoreConverter::CaenorhabditisElegans; use vars qw(@ISA); @ISA = qw(SeqStoreConverter::BasicConverter); sub create_coord_systems { my $self = shift; $self->debug("Caenorhabditis Specific: creating " . "clone and chromosome coord systems"); my $target = $self->target(); my $dbh = $self->dbh(); my $ass_def = $self->get_default_assembly(); my @coords = (["chromosome" , $ass_def, "default_version" , 1], ["clone", undef , "default_version,sequence_level", 2]); my @assembly_mappings = ("chromosome:$ass_def|clone"); $self->debug("Building coord_system table"); my $sth = $dbh->prepare("INSERT INTO $target.coord_system " . "(name, version, attrib, rank) VALUES (?,?,?,?)"); my %coord_system_ids; foreach my $cs (@coords) { $sth->execute(@$cs); $coord_system_ids{$cs->[0]} = $sth->{'mysql_insertid'}; } $sth->finish(); $self->debug("Adding assembly.mapping entries to meta table"); $sth = $dbh->prepare("INSERT INTO $target.meta(meta_key, meta_value) " . "VALUES ('assembly.mapping', ?)"); foreach my $mapping (@assembly_mappings) { $sth->execute($mapping); } $sth->finish(); return; } sub create_seq_regions { my $self = shift; $self->debug("CaenorhabditisElegans Specific: creating clone and " . "chromosome seq_regions"); $self->contig_to_seq_region('clone'); $self->chromosome_to_seq_region(); } sub create_assembly { my $self = shift; $self->debug("CaenorhabditisElegans Specific: loading assembly data"); $self->assembly_contig_chromosome(); } # # override the contig_to_seqregion method so that contigs are given clone # names instead # sub contig_to_seq_region { my $self = shift; my $target_cs_name = shift; my $target = $self->target(); my $source = $self->source(); my $dbh = $self->dbh(); $target_cs_name ||= 'contig'; $self->debug("CaenorhabditisElegans Specific: Transforming contigs " . "into $target_cs_name seq_regions"); my $cs_id = $self->get_coord_system_id($target_cs_name); my $sth = $dbh->prepare ("INSERT INTO $target.seq_region " . "SELECT ctg.contig_id, CONCAT(cln.embl_acc, '.', cln.embl_version), " . " $cs_id, ctg.length " . "FROM $source.contig ctg, $source.clone cln " . "WHERE ctg.clone_id = cln.clone_id"); $sth->execute(); $sth->finish(); return; } 1;
24.56391
100
0.668197
73d32698b70148c85b0d7e61c16e49793b7f619a
1,815
t
Perl
t/local/get.t
wolfsage/libwww-perl
7f74300cb8bdaf94379f637e3f8ca6c3e1ba32c2
[ "Artistic-1.0" ]
null
null
null
t/local/get.t
wolfsage/libwww-perl
7f74300cb8bdaf94379f637e3f8ca6c3e1ba32c2
[ "Artistic-1.0" ]
null
null
null
t/local/get.t
wolfsage/libwww-perl
7f74300cb8bdaf94379f637e3f8ca6c3e1ba32c2
[ "Artistic-1.0" ]
null
null
null
use strict; use warnings; use Test::More; use File::Temp 'tempdir'; use LWP::Simple; require LWP::Protocol::file; my $TMPDIR = undef; if ( $^O eq 'MacOS' ) { plan skip_all => 'Cannot test on this platform'; } else { # First locate some suitable tmp-dir. We need an absolute path. for my $dir (tempdir()) { if ( open(my $fh, '>', "$dir/test-$$")) { close($fh); unlink("$dir/test-$$"); $TMPDIR = $dir; last; } } if ( $TMPDIR ) { $TMPDIR =~ tr|\\|/|; plan tests => 4; } else { plan skip_all => 'Cannot test without a suitable TMP Directory'; } } my $orig = "$TMPDIR/lwp-orig-$$"; # local file my $copy = "$TMPDIR/lwp-copy-$$"; # downloaded copy # First we create the original { open(my $fh, '>', $orig) or die "Cannot open $orig: $!"; binmode($fh); for (1..5) { print {$fh} "This is line $_ of $orig\n"; } } # Then we make a test using getprint(), so we need to capture stdout { open(my $fh, '>', $copy) or die "Cannot open $copy: $!"; select($fh); # do the retrieval getprint("file://localhost" . ($orig =~ m|^/| ? $orig : "/$orig")); select(STDOUT); } # read and compare the files my $origtext = slurp( $orig ); ok($origtext, "slurp original yielded text"); my $copytext = slurp( $copy ); ok($copytext, "slurp copy yielded text"); unlink($copy); is($copytext, $origtext, "getprint: Original and copy equal eachother"); # Test getstore() function getstore("file:$orig", $copy); $copytext = slurp( $copy ); is($copytext, $origtext, "getstore: Original and copy equal eachother"); unlink($orig); unlink($copy); sub slurp { my $file = shift; open ( my $fh, '<', $file ) or die "Cannot open $file: $!"; local $/; return <$fh>; }
23.881579
72
0.566942
ed185ea24e1f324758d7ff0826c19bce3bce8f3b
1,559
pl
Perl
UTILITIES/set-version.pl
hdweiss/org-mode
4721052ec68bd85f4bffb5039bb89c6dfa1b5cc5
[ "FSFUL" ]
2
2019-12-27T02:02:38.000Z
2021-04-24T17:32:35.000Z
UTILITIES/set-version.pl
hdweiss/org-mode
4721052ec68bd85f4bffb5039bb89c6dfa1b5cc5
[ "FSFUL" ]
null
null
null
UTILITIES/set-version.pl
hdweiss/org-mode
4721052ec68bd85f4bffb5039bb89c6dfa1b5cc5
[ "FSFUL" ]
2
2015-04-07T05:27:29.000Z
2015-08-11T22:48:52.000Z
#!/usr/bin/perl $version = $ARGV[0]; if ($version eq "--all" or $version eq "-a") { $all = 1; $version = $ARGV[1] } if ($version eq "--only" or $version eq "-o") { $only = 1; $version = $ARGV[1] } die "No version given" unless $version=~/\S/; $date = `date "+%B %Y"`; chomp $date; $year = `date "+%Y"` ; chomp $year; print STDERR "Changing version to \"$version\" and date to \"$date\" in all relevant files\n" ; if (not $only) { print STDERR join("\n",glob("lisp/*.el")),"\n"; $cmd = qq{s/^(;; Version:)\\s+(\\S+)[ \t]*\$/\$1 $version/;s/^(\\(defconst org-version )"(\\S+)"/\$1"$version"/}; $c1 = "perl -pi -e '$cmd' lisp/*.el"; system($c1); print STDERR "doc/org.texi\n"; $cmd = qq{s/^(\\\@set VERSION)\\s+(\\S+)[ \t]*\$/\$1 $version/;s/^(\\\@set DATE)\\s+(.*)\$/\$1 $date/;}; $c1 = "perl -pi -e '$cmd' doc/org.texi"; system($c1); print STDERR "doc/orgguide.texi\n"; $cmd = qq{s/^(\\\@set VERSION)\\s+(\\S+)[ \t]*\$/\$1 $version/;s/^(\\\@set DATE)\\s+(.*)\$/\$1 $date/;}; $c1 = "perl -pi -e '$cmd' doc/orgguide.texi"; system($c1); print STDERR "doc/orgcard.tex\n"; $cmd = qq{s/^\\\\def\\\\orgversionnumber\\{\\S+\\}/\\\\def\\\\orgversionnumber{$version}/;s/\\\\def\\\\versionyear\\{\\S+\\}/\\\\def\\\\versionyear{$year}/;s/\\\\def\\\\year\\{\\S+\\}/\\\\def\\\\year{$year}/;}; $c1 = "perl -pi -e '$cmd' doc/orgcard.tex"; system($c1); print STDERR "README_DIST\n"; $cmd = qq{s/^(The version of this release is:)\\s+(\\S+)[ \t]*\$/\$1 $version/;}; $c1 = "perl -pi -e '$cmd' README_DIST"; system($c1); }
33.891304
212
0.521488
ed1af79d0d97b298d7693003d932fb525de045fe
3,341
pl
Perl
tests/aspellcheck.pl
vganesan-nokia/sonic-sairedis
ad0f118c7d594d7dae25bb8c73054afc6be687c9
[ "Apache-2.0" ]
null
null
null
tests/aspellcheck.pl
vganesan-nokia/sonic-sairedis
ad0f118c7d594d7dae25bb8c73054afc6be687c9
[ "Apache-2.0" ]
null
null
null
tests/aspellcheck.pl
vganesan-nokia/sonic-sairedis
ad0f118c7d594d7dae25bb8c73054afc6be687c9
[ "Apache-2.0" ]
1
2021-02-24T18:40:46.000Z
2021-02-24T18:40:46.000Z
#!/usr/bin/perl use strict; use warnings; use diagnostics; use Term::ANSIColor; our $errors = 0; our $warnings = 0; sub LogInfo { print color('bright_green') . "@_" . color('reset') . "\n"; } sub LogWarning { $warnings++; print color('bright_yellow') . "WARNING: @_" . color('reset') . "\n"; } sub LogError { $errors++; print color('bright_red') . "ERROR: @_" . color('reset') . "\n"; } sub GetSourceFilesAndHeaders { my @files = `find .. -name "*.cpp" -o -name "*.h"`; #my @files = `find .. -name "syncd.cpp"`; return @files; } sub ReadFile { my $filename = shift; local $/ = undef; # first search file in meta directory open FILE, $filename or die "Couldn't open file $filename: $!"; binmode FILE; my $string = <FILE>; close FILE; return $string; } sub ExtractComments { my $input = shift; my $comments = ""; # good enough comments extractor C/C++ source while ($input =~ m!(".*?")|//.*?[\r\n]|/\*.*?\*/!s) { $input = $'; $comments .= $& if not $1; } return $comments; } sub RunAspell { my $hash = shift; my %wordsToCheck = %{ $hash }; if (not -e "/usr/bin/aspell") { LogError "ASPELL IS NOT PRESENT, please install aspell"; return; } LogInfo "Running Aspell"; my @keys = sort keys %wordsToCheck; my $count = @keys; my $all = "@keys"; LogInfo "Words to check: $count"; my @result = `echo "$all" | /usr/bin/aspell -l en -a -p ./aspell.en.pws 2>&1`; for my $res (@result) { if ($res =~ /error/i) { LogError "aspell error: $res"; last; } chomp $res; next if $res =~ /^\*?$/; print "$res\n"; next if not $res =~ /^\s*&\s*(\S+)/; my $word = $1; next if $word =~ /^wred$/i; chomp $res; my $where = "??"; if (not defined $wordsToCheck{$word}) { for my $k (@keys) { if ($k =~ /(^$word|$word$)/) { $where = $wordsToCheck{$k}; last; } $where = $wordsToCheck{$k} if ($k =~ /$word/); } } else { $where = $wordsToCheck{$word}; } LogWarning "Word '$word' is misspelled $where"; } } my @files = GetSourceFilesAndHeaders(); my %wordsToCheck = (); for my $file (@files) { chomp $file; next if $file =~ m!/SAI/!; next if $file =~ m!/debian/!; next if $file =~ m!/config.h!; my $data = ReadFile $file; my $comments = ExtractComments $data; $comments =~ s!github.com\S+! !g; $comments =~ s!l2mc! !g; $comments =~ s!\s+\d+(th|nd) ! !g; $comments =~ s!(/\*|\*/)! !g; $comments =~ s!//! !g; $comments =~ s!\s+\*\s+! !g; $comments =~ s![^a-zA-Z0-9_]! !g; my @words = split/\s+/,$comments; for my $w (@words) { next if $w =~ /_/; next if $w =~ /xYYY+/; next if $w =~ /fe\d+/; next if $w =~ /ebe\d+/; next if $w =~ /Werror/; next if $w =~ /^[A-Za-z][a-z]+([A-Z][a-z]+)+$/; # fooBar FooBar $wordsToCheck{$w} = $file; } } RunAspell(\%wordsToCheck); exit 1 if ($warnings > 0 or $errors > 0);
18.256831
82
0.471116
73d347fb38631ddaa6a3766424455e3798b7fc85
1,085
pm
Perl
lib/Google/Ads/AdWords/v201809/FeedMappingError/Reason.pm
googleads/googleads-perl-lib
69e66d7e46fbd8ad901581b108ea6c14212701cf
[ "Apache-2.0" ]
4
2015-04-23T01:59:40.000Z
2021-10-12T23:14:36.000Z
lib/Google/Ads/AdWords/v201809/FeedMappingError/Reason.pm
googleads/googleads-perl-lib
69e66d7e46fbd8ad901581b108ea6c14212701cf
[ "Apache-2.0" ]
23
2015-02-19T17:03:58.000Z
2019-07-01T10:15:46.000Z
lib/Google/Ads/AdWords/v201809/FeedMappingError/Reason.pm
googleads/googleads-perl-lib
69e66d7e46fbd8ad901581b108ea6c14212701cf
[ "Apache-2.0" ]
10
2015-08-03T07:51:58.000Z
2020-09-26T16:17:46.000Z
package Google::Ads::AdWords::v201809::FeedMappingError::Reason; use strict; use warnings; sub get_xmlns { 'https://adwords.google.com/api/adwords/cm/v201809'}; # derivation by restriction use base qw( SOAP::WSDL::XSD::Typelib::Builtin::string); 1; __END__ =pod =head1 NAME =head1 DESCRIPTION Perl data type class for the XML Schema defined simpleType FeedMappingError.Reason from the namespace https://adwords.google.com/api/adwords/cm/v201809. This clase is derived from SOAP::WSDL::XSD::Typelib::Builtin::string . SOAP::WSDL's schema implementation does not validate data, so you can use it exactly like it's base type. # Description of restrictions not implemented yet. =head1 METHODS =head2 new Constructor. =head2 get_value / set_value Getter and setter for the simpleType's value. =head1 OVERLOADING Depending on the simple type's base type, the following operations are overloaded Stringification Numerification Boolification Check L<SOAP::WSDL::XSD::Typelib::Builtin> for more information. =head1 AUTHOR Generated by SOAP::WSDL =cut
16.439394
93
0.762212
ed3654be853547642d597dcb84f860bd873580a4
2,070
pl
Perl
eigenstartgeno_to_fasta.pl
zhuochenbioinfo/PopGen
feab2db39ef1c5cd8d4c869cce831b7e2147c9af
[ "MIT" ]
4
2018-04-19T07:47:50.000Z
2022-02-27T06:33:56.000Z
eigenstartgeno_to_fasta.pl
zhuochenbioinfo/PopGen
feab2db39ef1c5cd8d4c869cce831b7e2147c9af
[ "MIT" ]
null
null
null
eigenstartgeno_to_fasta.pl
zhuochenbioinfo/PopGen
feab2db39ef1c5cd8d4c869cce831b7e2147c9af
[ "MIT" ]
3
2019-12-24T10:17:11.000Z
2021-07-13T09:09:57.000Z
use strict; use warnings; my($prefix,$out,$misr) = @ARGV; my $usage = "USAGE:\nperl $0 <geno file prefix> <output file> <missing rate>\n"; $usage .= "<prefix>: eigenstart geno file contains three files, named as [prefix].geno [prefix].snp and [prefix].ind\n"; die $usage unless(@ARGV >= 2); die $usage unless(-e "$prefix.geno" and -e "$prefix.snp" and -e "$prefix.ind"); my $genoRow = fileRowCount("$prefix.geno"); my $snpRow = fileRowCount("$prefix.snp"); die "#WARNING: geno file and snp file shall have the same number of row.\n" unless($genoRow == $snpRow); my @samples = (); open(IN,"<$prefix.ind") or die $!; while(<IN>){ chomp; push @samples, $_; } close IN; my @seqs = (); open(IN,"paste $prefix.snp $prefix.geno|"); while(<IN>){ chomp; my($chr,$pos,$ref,$alt,$genos) = split/\t/; next unless(length($ref) == 1 and length($alt) == 1); my @genos = split//,$genos; if($. == 1){ unless(@genos == @samples){ die "#WARNING: geno file and sample num conflict.\n"; } } for(my $i = 0; $i < @genos; $i++){ my $base = egeno2base($genos[$i],$ref,$alt); $seqs[$i] .= $base; } } close IN; open(OUT,">$out"); for(my $i = 0; $i < @samples; $i++){ my $sample = $samples[$i]; my $seq = $seqs[$i]; my $missRate = missingRatio($seq); if(defined $misr){ if($missRate > $misr){ print "#WARNING: skip sample:$sample for to many missing bases.\n"; next; } } $seq = makefasta($seq); print OUT ">$sample\n$seq"; } close OUT; sub fileRowCount{ my($file) = @_; my($num) = `wc -l $file|awk '{printf(\$1)}'`; chomp($num); return($num); } sub makefasta{ my $seq = $_[0]; $seq =~ s/(.{50})/$1\n/g; unless($seq =~ /\n$/){ $seq .= "\n"; } return($seq); } sub egeno2base{ my($data,$ref,$alt) = @_; my $base = "-"; if($data == 0){ $base = $alt; }elsif($data == 2){ $base = $ref; } return($base); } sub missingRatio{ my($seq) = @_; my $count = ($seq =~ s/\-/#/g); my $len = length($seq); my $ratio = $count/$len; return($ratio); }
22.258065
121
0.551691
ed2f8ed7d5c0df9bc7b042ea9def9e59dcefd88a
402
pm
Perl
auto-lib/Azure/CognitiveNewsSearch/TrendingTopics.pm
pplu/azure-sdk-perl
26cbef2d926f571bc1617c26338c106856f95568
[ "Apache-2.0" ]
null
null
null
auto-lib/Azure/CognitiveNewsSearch/TrendingTopics.pm
pplu/azure-sdk-perl
26cbef2d926f571bc1617c26338c106856f95568
[ "Apache-2.0" ]
null
null
null
auto-lib/Azure/CognitiveNewsSearch/TrendingTopics.pm
pplu/azure-sdk-perl
26cbef2d926f571bc1617c26338c106856f95568
[ "Apache-2.0" ]
1
2021-04-08T15:26:39.000Z
2021-04-08T15:26:39.000Z
package Azure::CognitiveNewsSearch::TrendingTopics; use Moose; has 'value' => (is => 'ro', isa => 'ArrayRef[Azure::CognitiveNewsSearch::NewsTopic]' ); has 'followUpQueries' => (is => 'ro', isa => 'ArrayRef[Azure::CognitiveNewsSearch::Query]' ); has 'webSearchUrl' => (is => 'ro', isa => 'Str' ); has 'id' => (is => 'ro', isa => 'Str' ); has '_type' => (is => 'ro', isa => 'Str' ); 1;
40.2
96
0.572139
ed0ef728e6048e8d73a86e64e2e9ce9d3e095102
1,998
pm
Perl
users/modules/EnsEMBL/Users/Command/Account/Membership/Create.pm
olaaustine/public-plugins
74b8b64c7c8a0c46c5a60586afad8ee5cac8694b
[ "Apache-2.0" ]
8
2015-06-19T10:31:59.000Z
2021-01-27T15:29:24.000Z
users/modules/EnsEMBL/Users/Command/Account/Membership/Create.pm
olaaustine/public-plugins
74b8b64c7c8a0c46c5a60586afad8ee5cac8694b
[ "Apache-2.0" ]
168
2015-02-18T10:58:12.000Z
2022-03-30T08:04:19.000Z
users/modules/EnsEMBL/Users/Command/Account/Membership/Create.pm
olaaustine/public-plugins
74b8b64c7c8a0c46c5a60586afad8ee5cac8694b
[ "Apache-2.0" ]
75
2015-01-27T14:34:18.000Z
2022-03-31T09:56:09.000Z
=head1 LICENSE Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2021] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =cut package EnsEMBL::Users::Command::Account::Membership::Create; ### Creates the membership object for an invitation sent to a new user (saved in user records) ### Membership created is a "pending" invitation use strict; use warnings; use EnsEMBL::Users::Messages qw(MESSAGE_GROUP_NOT_FOUND MESSAGE_URL_EXPIRED); use parent qw(EnsEMBL::Users::Command::Account::Membership); sub modify_membership { my ($self, $membership) = @_; my %redirect_url = qw(type Account action Groups); my $invitation = $self->object->fetch_invitation_record_from_url_code; if ($invitation) { # we do not check if the email to which the invitation was sent is same as user's email as user can have a different registered email my $group = $invitation->group; if ($group && $group->status eq 'active') { my $group_id = $group->group_id; $membership->group_id($group_id); $membership->make_invitation; $membership->save('user' => $invitation->created_by_user); $invitation->delete; } else { $redirect_url{'err'} = MESSAGE_GROUP_NOT_FOUND; } } else { $redirect_url{'err'} = MESSAGE_URL_EXPIRED; } $self->redirect_url(\%redirect_url); return undef; # return undef so the parent class doesn't save the membership object again } 1;
34.448276
137
0.738739
73f0ae48f1165f2dce2bb566908f0d5cdd372a9e
1,282
pl
Perl
Analysis/DifferentialExpression/rename_matrix_feature_identifiers.pl
chenx-bob/trinityrnaseq
5cc19070ceb461af107de79d568aed0b0e24d580
[ "BSD-3-Clause" ]
4
2019-01-16T12:05:05.000Z
2021-11-17T08:38:21.000Z
Analysis/DifferentialExpression/rename_matrix_feature_identifiers.pl
binlu1981/trinityrnaseq
5cc19070ceb461af107de79d568aed0b0e24d580
[ "BSD-3-Clause" ]
null
null
null
Analysis/DifferentialExpression/rename_matrix_feature_identifiers.pl
binlu1981/trinityrnaseq
5cc19070ceb461af107de79d568aed0b0e24d580
[ "BSD-3-Clause" ]
1
2020-06-21T01:02:04.000Z
2020-06-21T01:02:04.000Z
#!/usr/bin/env perl use strict; use warnings; my $usage = <<__EOUSAGE__; ############################################### # # Usage: $0 matrix.txt new_feature_id_mapping.txt # # The 'new_feature_id_mapping.txt' file has the format: # # current_identifier <tab> new_identifier # .... # # # Only those entries with new names listed will be updated, the rest stay unchanged. # # ################################################# __EOUSAGE__ ; my $matrix_file = $ARGV[0] or die $usage; my $new_feature_mappings = $ARGV[1] or die $usage; main: { my %new_ids; { open (my $fh, $new_feature_mappings) or die $!; while (<$fh>) { chomp; my ($old_name, $new_name) = split(/\t/); $new_ids{$old_name} = $new_name; } close $fh; } open (my $fh, $matrix_file) or die $!; while (<$fh>) { unless(/\w/) { print; next; } chomp; my @ids = split(/\t/); if (my $new_id = $new_ids{$ids[0]}) { $ids[0] = $new_id; } if (scalar(@ids) > 1 && (my $new_id = $new_ids{$ids[1]})) { $ids[1] = $new_id; } print join("\t", @ids) . "\n"; } exit(0); }
19.424242
86
0.451638
ed14640e0c34e859de44e2e54ceb49135ad483cd
153
pl
Perl
notebooks/logic_programming/prolog_files/hanoi.pl
kimianoorbakhsh/supplementary
af24fcafe8b957be1ecc7e87cdb991ce906ede46
[ "MIT" ]
1
2021-09-14T07:00:03.000Z
2021-09-14T07:00:03.000Z
notebooks/logic_programming/prolog_files/hanoi.pl
Aliiiqbp/supplementary
283a1b2034b59fa191cdd09079e6ceaba2f6ec10
[ "MIT" ]
4
2021-10-01T16:47:02.000Z
2022-01-31T21:38:51.000Z
notebooks/logic_programming/prolog_files/hanoi.pl
Aliiiqbp/supplementary
283a1b2034b59fa191cdd09079e6ceaba2f6ec10
[ "MIT" ]
16
2021-09-13T22:25:47.000Z
2022-02-17T21:27:34.000Z
hanoi(N) :- move(N, left, right, center). move(0, _, _, _) :- !. move(N, A, B, C) :- M is N-1, move(M, A, C, B), notify([A,B]), move(M, C, B, A).
21.857143
41
0.464052
ed12865397722671eec51b0389130cc40b66fcbf
1,238
pm
Perl
auto-lib/Azure/OperationalInsights/DeleteStorageInsights.pm
pplu/azure-sdk-perl
26cbef2d926f571bc1617c26338c106856f95568
[ "Apache-2.0" ]
null
null
null
auto-lib/Azure/OperationalInsights/DeleteStorageInsights.pm
pplu/azure-sdk-perl
26cbef2d926f571bc1617c26338c106856f95568
[ "Apache-2.0" ]
null
null
null
auto-lib/Azure/OperationalInsights/DeleteStorageInsights.pm
pplu/azure-sdk-perl
26cbef2d926f571bc1617c26338c106856f95568
[ "Apache-2.0" ]
1
2021-04-08T15:26:39.000Z
2021-04-08T15:26:39.000Z
package Azure::OperationalInsights::DeleteStorageInsights; use Moose; use MooseX::ClassAttribute; has 'api_version' => (is => 'ro', required => 1, isa => 'Str', default => '2015-03-20', traits => [ 'Azure::ParamInQuery', 'Azure::LocationInResponse' ], location => 'api-version', ); has 'resourceGroupName' => (is => 'ro', required => 1, isa => 'Str', traits => [ 'Azure::ParamInPath' ], ); has 'storageInsightName' => (is => 'ro', required => 1, isa => 'Str', traits => [ 'Azure::ParamInPath' ], ); has 'subscriptionId' => (is => 'ro', required => 1, isa => 'Str', traits => [ 'Azure::ParamInPath' ], ); has 'workspaceName' => (is => 'ro', required => 1, isa => 'Str', traits => [ 'Azure::ParamInPath' ], ); class_has _api_uri => (is => 'ro', default => '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}'); class_has _returns => (is => 'ro', isa => 'HashRef', default => sub { { 200 => undef, 204 => undef, } }); class_has _is_async => (is => 'ro', default => 0); class_has _api_method => (is => 'ro', default => 'DELETE'); 1;
38.6875
228
0.600162
73d824ffda7660851ef82035e79f8e0441633c20
1,355
t
Perl
S17-supply/squish.t
SirBogman/roast
0a0835a20951c93fea57a39dec1b2b8789d81fc5
[ "Artistic-2.0" ]
1
2019-11-06T05:07:10.000Z
2019-11-06T05:07:10.000Z
S17-supply/squish.t
SirBogman/roast
0a0835a20951c93fea57a39dec1b2b8789d81fc5
[ "Artistic-2.0" ]
null
null
null
S17-supply/squish.t
SirBogman/roast
0a0835a20951c93fea57a39dec1b2b8789d81fc5
[ "Artistic-2.0" ]
null
null
null
use v6; use Test; use lib $?FILE.IO.parent(2).add("packages/Test-Helpers"); use Test::Tap; plan 15; dies-ok { Supply.squish }, 'can not be called as a class method'; for ThreadPoolScheduler.new, CurrentThreadScheduler -> $*SCHEDULER { diag "**** scheduling with {$*SCHEDULER.WHAT.perl}"; tap-ok Supply.from-list(flat(1..10,1..10)).squish, [1,2,3,4,5,6,7,8,9,10,1,2,3,4,5,6,7,8,9,10], "squish tap with 2 ranges works"; tap-ok Supply.from-list(1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10).squish, [1,2,3,4,5,6,7,8,9,10], "squish tap with doubling range works"; tap-ok Supply.from-list(1..10).squish(:as(* div 2)), [1,2,4,6,8,10], "squish with as tap works"; tap-ok Supply.from-list(<a A B b c C A>).squish( :with( {$^a.lc eq $^b.lc} ) ), [<a B c A>], "squish with with tap works"; tap-ok Supply.from-list(<a AA B bb cc C AA>).squish( :as( *.substr(0,1) ), :with( {$^a.lc eq $^b.lc} ) ), [<a B cc AA>], "squish with as and with tap works"; tap-ok Supply.from-list(<a>).squish( :with( -> $a, $b {1} )), [<a>], "squish with with that always says it's the same, tap works"; tap-ok Supply.from-list(<a>).squish( :as({1}) ), [<a>], "squish with as that always returns the same value, tap works"; } # vim: ft=perl6 expandtab sw=4
30.111111
83
0.573432
73d13167e8b5a683d60ea2dd0f93f1493b1a7db6
2,256
pm
Perl
Source/Manip/TZ/askolk00.pm
ssp/Pester
f2d8ec2f62bfb83656f77f3ee41b54149287904a
[ "BSD-2-Clause" ]
59
2015-01-11T18:44:25.000Z
2022-03-07T22:56:02.000Z
Source/Manip/TZ/askolk00.pm
ssp/Pester
f2d8ec2f62bfb83656f77f3ee41b54149287904a
[ "BSD-2-Clause" ]
11
2015-06-19T11:01:00.000Z
2018-06-05T21:30:17.000Z
Source/Manip/TZ/askolk00.pm
ssp/Pester
f2d8ec2f62bfb83656f77f3ee41b54149287904a
[ "BSD-2-Clause" ]
7
2015-09-21T21:04:59.000Z
2022-02-13T18:26:47.000Z
package # Date::Manip::TZ::askolk00; # Copyright (c) 2008-2014 Sullivan Beck. All rights reserved. # This program is free software; you can redistribute it and/or modify it # under the same terms as Perl itself. # This file was automatically generated. Any changes to this file will # be lost the next time 'tzdata' is run. # Generated on: Fri Nov 21 10:41:44 EST 2014 # Data version: tzdata2014j # Code version: tzcode2014j # This module contains data from the zoneinfo time zone database. The original # data was obtained from the URL: # ftp://ftp.iana.org/tz use strict; use warnings; require 5.010000; our (%Dates,%LastRule); END { undef %Dates; undef %LastRule; } our ($VERSION); $VERSION='6.48'; END { undef $VERSION; } %Dates = ( 1 => [ [ [1,1,2,0,0,0],[1,1,2,5,53,28],'+05:53:28',[5,53,28], 'LMT',0,[1879,12,31,18,6,31],[1879,12,31,23,59,59], '0001010200:00:00','0001010205:53:28','1879123118:06:31','1879123123:59:59' ], ], 1879 => [ [ [1879,12,31,18,6,32],[1879,12,31,23,59,52],'+05:53:20',[5,53,20], 'HMT',0,[1941,9,30,18,6,39],[1941,9,30,23,59,59], '1879123118:06:32','1879123123:59:52','1941093018:06:39','1941093023:59:59' ], ], 1941 => [ [ [1941,9,30,18,6,40],[1941,10,1,0,36,40],'+06:30:00',[6,30,0], 'BURT',0,[1942,5,14,17,29,59],[1942,5,14,23,59,59], '1941093018:06:40','1941100100:36:40','1942051417:29:59','1942051423:59:59' ], ], 1942 => [ [ [1942,5,14,17,30,0],[1942,5,14,23,0,0],'+05:30:00',[5,30,0], 'IST',0,[1942,8,31,18,29,59],[1942,8,31,23,59,59], '1942051417:30:00','1942051423:00:00','1942083118:29:59','1942083123:59:59' ], [ [1942,8,31,18,30,0],[1942,9,1,1,0,0],'+06:30:00',[6,30,0], 'IST',1,[1945,10,14,17,29,59],[1945,10,14,23,59,59], '1942083118:30:00','1942090101:00:00','1945101417:29:59','1945101423:59:59' ], ], 1945 => [ [ [1945,10,14,17,30,0],[1945,10,14,23,0,0],'+05:30:00',[5,30,0], 'IST',0,[9999,12,31,0,0,0],[9999,12,31,5,30,0], '1945101417:30:00','1945101423:00:00','9999123100:00:00','9999123105:30:00' ], ], ); %LastRule = ( ); 1;
31.774648
88
0.566933
73d77f1fe9071d76b6158d431065cc3a8dff7cd4
2,626
pm
Perl
lib/Reply/Plugin/Autocomplete/ExportedSymbols.pm
akiym/Reply-Plugin-Autocomplete-ExportedSymbols
0ff83b261470c07693edaac5b403aaa3eb910f39
[ "Artistic-1.0" ]
1
2020-12-08T04:14:56.000Z
2020-12-08T04:14:56.000Z
lib/Reply/Plugin/Autocomplete/ExportedSymbols.pm
akiym/Reply-Plugin-Autocomplete-ExportedSymbols
0ff83b261470c07693edaac5b403aaa3eb910f39
[ "Artistic-1.0" ]
1
2017-06-13T17:06:27.000Z
2017-06-13T17:06:27.000Z
lib/Reply/Plugin/Autocomplete/ExportedSymbols.pm
akiym/Reply-Plugin-Autocomplete-ExportedSymbols
0ff83b261470c07693edaac5b403aaa3eb910f39
[ "Artistic-1.0" ]
null
null
null
package Reply::Plugin::Autocomplete::ExportedSymbols; use strict; use warnings; use parent qw/Reply::Plugin/; use List::MoreUtils; use Module::Runtime qw/$module_name_rx/; use Package::Stash; use Reply::Util qw/$ident_rx/; my $sigil_rx = $Reply::Util::sigil_rx; our $VERSION = "0.01"; sub tab_handler { my $self = shift; my ($line) = @_; my ($before, $module_name, $fragment) = $line =~ /(.*?)use\s+(${module_name_rx})(.*)$/ or return; return if $before =~ /^#/; # commands my @symbols = _export_symbols($module_name); if (my ($ident) = $fragment =~ /(:$ident_rx?|$ident_rx)$/) { return grep { /^\Q$ident\E/ } @symbols; } return @symbols; } sub _export_symbols { my $module_name = shift; eval { Module::Runtime::require_module($module_name) } or return; my $stash = Package::Stash->new($module_name); my $stash_name = $stash->name; my $namespace = $stash->namespace; my @symbols; push @symbols, @{$namespace->{EXPORT}} if $stash->has_symbol('@EXPORT'); push @symbols, @{$namespace->{EXPORT_OK}} if $stash->has_symbol('@EXPORT_OK'); push @symbols, map { ":$_" } keys %{$namespace->{EXPORT_TAGS}} if $stash->has_symbol('%EXPORT_TAGS'); # Exclude variables. Function names and variable names starting with sigil can not be mixed in completion @symbols = grep { !/^$sigil_rx/ } @symbols; return sort +List::MoreUtils::uniq(@symbols); } 1; __END__ =encoding utf-8 =head1 NAME Reply::Plugin::Autocomplete::ExportedSymbols - Tab completion for exported symbol names =head1 SYNOPSIS In your .replyrc [Autocomplete::ExportedSymbols] And use reply! % reply 0> use List::Util qw/ <TAB> all max minstr pairfirst pairmap product sum uniqnum any maxstr none pairgrep pairs reduce sum0 uniqstr first min notall pairkeys pairvalues shuffle uniq unpairs 0> use List::Util qw/ pair<TAB> pairfirst pairgrep pairkeys pairmap pairs pairvalues =head1 DESCRIPTION Reply::Plugin::Autocomplete::ExportedSymbols is a plugin for L<Reply>. It provides a tab completion for exported symbols names from L<Exporter>'s C<@EXPORT>, C<@EXPORT_OK> and C<%EXPORT_TAGS>. Note that exported variables are not included in completion. =head1 SEE ALSO L<Reply> L<Exporter> =head1 LICENSE Copyright (C) Takumi Akiyama. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 AUTHOR Takumi Akiyama E<lt>t.akiym@gmail.comE<gt> =cut
26.525253
121
0.657273
ed299ee3d082140c6678470a7df64bfffc80cb5c
7,362
pm
Perl
modules/Bio/EnsEMBL/Funcgen/DBSQL/SetAdaptor.pm
duartemolha/ensembl-funcgen
24f4d3c6fe11b2e14472eec151198aa4e831fd8d
[ "Apache-2.0" ]
null
null
null
modules/Bio/EnsEMBL/Funcgen/DBSQL/SetAdaptor.pm
duartemolha/ensembl-funcgen
24f4d3c6fe11b2e14472eec151198aa4e831fd8d
[ "Apache-2.0" ]
null
null
null
modules/Bio/EnsEMBL/Funcgen/DBSQL/SetAdaptor.pm
duartemolha/ensembl-funcgen
24f4d3c6fe11b2e14472eec151198aa4e831fd8d
[ "Apache-2.0" ]
null
null
null
# # Ensembl module for Bio::EnsEMBL::DBSQL::Funcgen::SetAdaptor # =head1 LICENSE Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2019] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =head1 CONTACT Please email comments or questions to the public Ensembl developers list at <http://lists.ensembl.org/mailman/listinfo/dev>. Questions may also be sent to the Ensembl help desk at <http://www.ensembl.org/Help/Contact>. =head1 NAME Bio::EnsEMBL::DBSQL::Funcgen::SetAdaptor - A base adaptor for Input/Result/FeatureSetAdaptors =head1 SYNOPSIS =head1 DESCRIPTION This base SetAdaptor provides generic methods applicable to Input/Result/FeatureSetAdaptors =head1 SEE ALSO Bio::EnsEMBL::Funcgen::DBSQL::BaseAdaptor =cut package Bio::EnsEMBL::Funcgen::DBSQL::SetAdaptor; use strict; use warnings; use Bio::EnsEMBL::Utils::Exception qw( throw deprecate ); use Bio::EnsEMBL::Funcgen::DBSQL::BaseAdaptor;#DBI sql_types import use base qw( Bio::EnsEMBL::Funcgen::DBSQL::BaseAdaptor ); use vars qw(@EXPORT); #require Exporter done in parent @EXPORT = (@{$DBI::EXPORT_TAGS{'sql_types'}}); =head2 fetch_all_by_FeatureType Arg [1] : Bio::EnsEMBL::Funcgen::FeatureType Arg [2] : String (optional) - status e.g. 'DISPLAYABLE' Example : my @sets = @{$set_adaptor->fetch_all_by_FeatureType($ftype)}; Description: Retrieves Set objects from the database based on FeatureType Returntype : Arrayref of Bio::EnsEMBL::Funcgen::Set objects Exceptions : None Caller : General Status : At Risk =cut sub fetch_all_by_FeatureType { my ($self, $ftype, $status) = @_; my $params = {constraints => {feature_types => [$ftype]}}; $params->{constraints}{states} = [$status] if defined $status; my $results = $self->generic_fetch($self->compose_constraint_query($params)); $self->reset_true_tables; #As we may have added status return $results; } =head2 fetch_all_by_Epigenome Arg [1] : Bio::EnsEMBL::Funcgen::Epigenome Arg [2] : String (optional) - status e.g. 'DISPLAYABLE' Example : my @sets = @{$set_adaptor->fetch_all_by_Epigenome($epigenome)}; Description: Retrieves Set objects from the database based on Epigenome Returntype : Arrayref of Bio::EnsEMBL::Funcgen::Set objects Exceptions : None Caller : General Status : At Risk =cut sub fetch_all_by_Epigenome { my ($self, $epigenome, $status) = @_; my $params = {constraints => {epigenomes => [$epigenome]}}; $params->{constraints}{states} = [$status] if defined $status; my $results = $self->generic_fetch($self->compose_constraint_query($params)); $self->reset_true_tables; #As we may have added status return $results; } =head2 fetch_all_by_Analysis Arg [1] : Bio::EnsEMBL::Funcgen::Analysis Example : my @sets = @{$set_adaptopr->fetch_all_by_Analysis($analysis)}; Description: Retrieves Set objects from the database based on Analysis Returntype : Arrayref of Bio::EnsEMBL::Funcgen::Set objects Exceptions : None Caller : General Status : At Risk =cut sub fetch_all_by_Analysis { my ($self, $epigenome, $status) = @_; my $params = {constraints => {analyses => [$epigenome]}}; $params->{constraints}{states} = [$status] if defined $status; my $results = $self->generic_fetch($self->compose_constraint_query($params)); $self->reset_true_tables; #As we may have added status return $results; } =head2 fetch_all_by_FeatureType_Analysis Arg [1] : Bio::EnsEMBL::Funcgen::FeatureType Arg [2] : Bio::EnsEMBL::Analysis Arg [3] : (optional) Bio::EnsEMBL::Funcgen::Epigenome Example : my @sets = $set_adaptopr->fetch_all_by_FeatureType_Analysis($ftype, $anal, $epigenome); Description: Retrieves Set objects from the database based on FeatureType, Analysis and Epigenome if defined. Returntype : Listref of Bio::EnsEMBL::Funcgen::Set objects Exceptions : Throws if args 1 and 2 are not valid or stored Caller : General Status : At Risk =cut #Historical method from the FeatureSetAdaptor sub fetch_all_by_FeatureType_Analysis { my ($self, $ftype, $anal, $epigenome) = @_; my $params = {constraints => { feature_types => [$ftype], analyses => [$anal], } }; $params->{constraints}{epigenomes} = [$epigenome] if $epigenome; return $self->generic_fetch($self->compose_constraint_query($params)); } #No fetch_all_by_name as this is not useful =head2 fetch_by_name Arg [1] : String - Set name Example : my $iss = $set_a->fetch_by_name('Iss_name'); Description: Retrieves a Set object which matches the specified name Returntype : Bio::EnsEMBL::Funcgen::Set Exceptions : Throws if more than one returned Caller : General Status : Stable =cut sub fetch_by_name { my ($self, $name) = @_; my $params = {constraints => {name => $name}}; my $results = $self->generic_fetch($self->compose_constraint_query($params)); if(scalar(@$results) >1){ throw('The name specified is not unique, please use another fetch_by_name method'); } return $results->[0]; } # can't have fetch_by_name as this name is not unique for ResultSets ### GENERIC CONSTRAIN METHODS ### #All these _constrain methods must return a valid constraint string, and a hashref of any other constraint config #Need to bind param any of these which come from URL parameters and are not tested #These type constraints are generic to all sets (apart from DataSet) #and so could go in a SetAdaptor (doesn't exist yet) #currently have sub _constrain_epigenomes { my ($self, $epigenomes) = @_; my $constraint = $self->_table_syn.'.epigenome_id IN ('. join(', ', @{$self->db->are_stored_and_valid('Bio::EnsEMBL::Funcgen::Epigenome', $epigenomes, 'dbID')} ).')'; #{} = no futher contraint config return ($constraint, {}); } sub _constrain_feature_types { my ($self, $fts) = @_; #Don't need to bind param this as we validate my $constraint = $self->_table_syn.'.feature_type_id IN ('. join(', ', @{$self->db->are_stored_and_valid('Bio::EnsEMBL::Funcgen::FeatureType', $fts, 'dbID')}).')'; #{} = no futher constraint conf return ($constraint, {}); } sub _constrain_analyses { my ($self, $anals) = @_; #Don't need to bind param this as we validate my $constraint = $self->_table_syn.'.analysis_id IN ('. join(', ', @{$self->db->are_stored_and_valid('Bio::EnsEMBL::Analysis', $anals, 'dbID')}).')'; return ($constraint, {}); #{} = no futher constraint conf } sub _constrain_name { my ($self, $name) = @_; if(! defined $name) { throw("Need to specify a name argument"); } my $constraint = $self->_table_syn . ".name = '$name'"; return ($constraint, {}); } 1;
29.926829
113
0.696142
73d7dfdd474e4811f3d644459045fb00ce226a5a
130
plx
Perl
quotes.plx
doodersrage/Mini-Useless-Perl-scripts
15fcb149a4631ac5f6e01aa2bdfdb4920e61eb57
[ "MIT" ]
1
2015-11-06T00:08:56.000Z
2015-11-06T00:08:56.000Z
quotes.plx
doodersrage/Mini-Useless-Perl-scripts
15fcb149a4631ac5f6e01aa2bdfdb4920e61eb57
[ "MIT" ]
null
null
null
quotes.plx
doodersrage/Mini-Useless-Perl-scripts
15fcb149a4631ac5f6e01aa2bdfdb4920e61eb57
[ "MIT" ]
null
null
null
#!/usr/bin/perl #quotes.plx use warnings; print'\tThis is a single quoted string.\n'; print "\tThis is a double quoted string.\n";
26
44
0.723077
73d594970b90430fb30a9c0231fbb5237899784f
3,626
t
Perl
test/nag.t
8-bit-fox/taskwarrior
ccb222a31be049fe6e3ef28fe660a1eaca351a95
[ "MIT" ]
null
null
null
test/nag.t
8-bit-fox/taskwarrior
ccb222a31be049fe6e3ef28fe660a1eaca351a95
[ "MIT" ]
null
null
null
test/nag.t
8-bit-fox/taskwarrior
ccb222a31be049fe6e3ef28fe660a1eaca351a95
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################### # # Copyright 2006 - 2020, Paul Beckingham, Federico Hernandez. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # # https://www.opensource.org/licenses/mit-license.php # ############################################################################### import sys import os import unittest # Ensure python finds the local simpletap module sys.path.append(os.path.dirname(os.path.abspath(__file__))) from basetest import Task, TestCase class TestNagging(TestCase): def setUp(self): """Executed before each test in the class""" # Used to initialize objects that should be re-initialized or # re-created for each individual test self.t = Task() self.t.config("nag", "NAG") def test_nagging(self): """Verify that nagging works when tasks are done in the 'wrong' order""" self.t("add due:yesterday one") self.t("add due:tomorrow two") self.t("add priority:H three") self.t("add priority:M four") self.t("add priority:L five") self.t("add six") self.t("add seven +nonag") code, out, err = self.t("7 done") self.assertNotIn("NAG", err) code, out, err = self.t("6 done") self.assertIn("NAG", err) code, out, err = self.t("5 done") self.assertIn("NAG", err) code, out, err = self.t("4 done") self.assertIn("NAG", err) code, out, err = self.t("3 done") self.assertIn("NAG", err) code, out, err = self.t("2 done") self.assertIn("NAG", err) code, out, err = self.t("1 done") self.assertNotIn("NAG", err) def test_nagging_ready(self): """Verify that nagging occurs when there are READY tasks of higher urgency""" self.t("add one") # low urgency self.t("add two due:10days scheduled:yesterday") # medium urgency, ready code, out, err = self.t("1 done") self.assertIn("NAG", err) def test_nagging_not_ready(self): """Verify that nagging does not occur when there are unREADY tasks of higher urgency""" self.t("add one") # low urgency self.t("add two due:10days scheduled:10days") # medium urgency, not ready code, out, err = self.t("1 done") self.assertNotIn("NAG", err) if __name__ == "__main__": from simpletap import TAPTestRunner unittest.main(testRunner=TAPTestRunner()) # vim: ai sts=4 et sw=4 ft=python
36.626263
95
0.625483
ed33b9a4a3eb76142caefbd806ab308daa7841d7
6,254
pl
Perl
packages/chr/chr_compiler_errors.pl
claudia1119/git-clone
bea2431c3ed833d81f5297e32c3776760c047561
[ "Artistic-1.0-Perl", "ClArtistic" ]
90
2015-03-09T01:24:15.000Z
2022-02-24T13:56:25.000Z
packages/chr/chr_compiler_errors.pl
claudia1119/git-clone
bea2431c3ed833d81f5297e32c3776760c047561
[ "Artistic-1.0-Perl", "ClArtistic" ]
52
2016-02-14T08:59:37.000Z
2022-03-14T16:39:35.000Z
packages/chr/chr_compiler_errors.pl
claudia1119/git-clone
bea2431c3ed833d81f5297e32c3776760c047561
[ "Artistic-1.0-Perl", "ClArtistic" ]
27
2015-11-19T02:45:49.000Z
2021-11-25T19:47:58.000Z
/* $Id$ Part of CHR (Constraint Handling Rules) Author: Tom Schrijvers E-mail: Tom.Schrijvers@cs.kuleuven.be WWW: http://www.swi-prolog.org Copyright (C): 2005, K.U. Leuven This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA As a special exception, if you link this library with other files, compiled with a Free Software compiler, to produce an executable, this library does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ %% @addtogroup CHR_in_YAP_Programs % % CHR error handling % :- module(chr_compiler_errors, [ chr_info/3, chr_warning/3, chr_error/3, print_chr_error/1 ]). :- use_module(chr_compiler_options). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % chr_info(+Type,+FormattedMessage,+MessageParameters) chr_info(_,Message,Params) :- ( \+verbosity_on -> true ; long_line_with_equality_signs, format(user_error,'CHR compiler:\n',[]), format(user_error,Message,Params), long_line_with_equality_signs ). %% SWI begin verbosity_on :- current_prolog_flag(verbose,V), V \== silent, current_prolog_flag(verbose_load,true). %% SWI end %% SICStus begin %% verbosity_on. % at the moment %% SICStus end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % chr_warning(+Type,+FormattedMessage,+MessageParameters) chr_warning(deprecated(Term),Message,Params) :- !, long_line_with_equality_signs, format(user_error,'CHR compiler WARNING: deprecated syntax ~w.\n',[Term]), format(user_error,' `--> ',[]), format(user_error,Message,Params), format(user_error,' Support for deprecated syntax will be discontinued in the near future!\n',[]), long_line_with_equality_signs. chr_warning(internal,Message,Params) :- !, long_line_with_equality_signs, format(user_error,'CHR compiler WARNING: something unexpected happened in the CHR compiler.\n',[]), format(user_error,' `--> ',[]), format(user_error,Message,Params), format(user_error,' Your program may not have been compiled correctly!\n',[]), format(user_error,' Please contact tom.schrijvers@cs.kuleuven.be.\n',[]), long_line_with_equality_signs. chr_warning(unsupported_pragma(Pragma,Rule),Message,Params) :- !, long_line_with_equality_signs, format(user_error,'CHR compiler WARNING: unsupported pragma ~w in ~@.\n',[Pragma,format_rule(Rule)]), format(user_error,' `--> ',[]), format(user_error,Message,Params), format(user_error,' Pragma is ignored!\n',[]), long_line_with_equality_signs. chr_warning(problem_pragma(Pragma,Rule),Message,Params) :- !, long_line_with_equality_signs, format(user_error,'CHR compiler WARNING: unsupported pragma ~w in ~@.\n',[Pragma,format_rule(Rule)]), format(user_error,' `--> ',[]), format(user_error,Message,Params), long_line_with_equality_signs. chr_warning(_,Message,Params) :- ( chr_pp_flag(verbosity,on) -> long_line_with_equality_signs, format(user_error,'CHR compiler WARNING:\n',[]), format(user_error,' `--> ',[]), format(user_error,Message,Params), long_line_with_equality_signs ; true ). %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % chr_error(+Type,+FormattedMessage,+MessageParameters) chr_error(Type,Message,Params) :- throw(chr_error(error(Type,Message,Params))). print_chr_error(error(Type,Message,Params)) :- print_chr_error(Type,Message,Params). print_chr_error(syntax(Term),Message,Params) :- !, long_line_with_equality_signs, format(user_error,'CHR compiler ERROR: invalid syntax "~w".\n',[Term]), format(user_error,' `--> ',[]), format(user_error,Message,Params), long_line_with_equality_signs. print_chr_error(type_error,Message,Params) :- !, long_line_with_equality_signs, format(user_error,'CHR compiler TYPE ERROR:\n',[]), format(user_error,' `--> ',[]), format(user_error,Message,Params), long_line_with_equality_signs. print_chr_error(internal,Message,Params) :- !, long_line_with_equality_signs, format(user_error,'CHR compiler ERROR: something unexpected happened in the CHR compiler.\n',[]), format(user_error,' `--> ',[]), format(user_error,Message,Params), format(user_error,' Please contact tom.schrijvers@cs.kuleuven.be.\n',[]), long_line_with_equality_signs. print_chr_error(cyclic_alias(Alias),_Message,_Params) :- !, long_line_with_equality_signs, format(user_error,'CHR compiler ERROR: cyclic alias "~w".\n',[Alias]), format(user_error,' `--> Aborting compilation.\n',[]), long_line_with_equality_signs. print_chr_error(_,Message,Params) :- long_line_with_equality_signs, format(user_error,'CHR compiler ERROR:\n',[]), format(user_error,' `--> ',[]), format(user_error,Message,Params), long_line_with_equality_signs. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% :- public format_rule/1. % called using format/3 `@' format_rule(PragmaRule) :- PragmaRule = pragma(_,_,Pragmas,MaybeName,N), ( MaybeName = yes(Name) -> write('rule '), write(Name) ; write('rule number '), write(N) ), ( memberchk(line_number(LineNumber),Pragmas) -> write(' (line '), write(LineNumber), write(')') ; true ). long_line_with_equality_signs :- format(user_error,'================================================================================\n',[]).
34.552486
109
0.677486
ed037a54a82de7c430f9459cf6dde580281f93e0
10,962
pm
Perl
src/fhem/trunk/fhem/FHEM/99_Utils.pm
nastymorbol/fhem-docker
c88d13e6fb098a487486b448806048eab1222b81
[ "MIT" ]
null
null
null
src/fhem/trunk/fhem/FHEM/99_Utils.pm
nastymorbol/fhem-docker
c88d13e6fb098a487486b448806048eab1222b81
[ "MIT" ]
null
null
null
src/fhem/trunk/fhem/FHEM/99_Utils.pm
nastymorbol/fhem-docker
c88d13e6fb098a487486b448806048eab1222b81
[ "MIT" ]
null
null
null
############################################## # $Id: 99_Utils.pm 21768 2020-04-24 14:22:12Z rudolfkoenig $ package main; use strict; use warnings; sub Utils_Initialize($$) { my ($hash) = @_; } sub time_str2num($) { my ($str) = @_; my @a; return time() if(!$str); @a = split("[T: -]", $str); # 31652, 110545, return mktime($a[5],$a[4],$a[3],$a[2],$a[1]-1,$a[0]-1900,0,0,-1); } sub min($@) { my ($min, @vars) = @_; for (@vars) { $min = $_ if $_ lt $min; } return $min; } sub max($@) { my ($max, @vars) = @_; for (@vars) { $max = $_ if $_ gt $max; } return $max; } sub minNum($@) { my ($min, @vars) = @_; for (@vars) { $min = $_ if $_ < $min; } return $min; } sub maxNum($@) { my ($max, @vars) = @_; for (@vars) { $max = $_ if $_ > $max; } return $max; } sub abstime2rel($) { my ($h,$m,$s) = split(":", shift); $m = 0 if(!$m); $s = 0 if(!$s); my $t1 = 3600*$h+60*$m+$s; my @now = localtime; my $t2 = 3600*$now[2]+60*$now[1]+$now[0]; my $diff = $t1-$t2; $diff += 86400 if($diff <= 0); return sprintf("%02d:%02d:%02d", $diff/3600, ($diff/60)%60, $diff%60); } sub defInfo($;$) { my ($search,$internal) = @_; $internal = 'DEF' unless defined($internal); my @ret; my @etDev = devspec2array($search); foreach my $d (@etDev) { next unless $d; next if($d eq $search && !$defs{$d}); push @ret, $defs{$d}{$internal}; } return @ret; } my ($SVG_lt, $SVG_ltstr); sub SVG_time_to_sec($) { my ($str) = @_; if(!$str) { return 0; } my ($y,$m,$d,$h,$mi,$s) = split("[-_:]", $str); $s = 0 if(!$s); $mi= 0 if(!$mi); $h = 0 if(!$h); $d = 1 if(!$d); $m = 1 if(!$m); if(!$SVG_ltstr || $SVG_ltstr ne "$y-$m-$d-$h") { # 2.5x faster $SVG_lt = mktime(0,0,$h,$d,$m-1,$y-1900,0,0,-1); $SVG_ltstr = "$y-$m-$d-$h"; } return $s+$mi*60+$SVG_lt; } ######## trim ##################################################### # What : cuts blankspaces from the beginning and end of a string # Call : { trim(" Hello ") } # Source: http://www.somacon.com/p114.php , # http://www.fhemwiki.de/wiki/TRIM-Funktion-Anfangs/EndLeerzeichen_aus_Strings_entfernen sub trim($) { my $string = shift; $string =~ s/^\s+//; $string =~ s/\s+$//; return $string; } ######## ltrim #################################################### # What : cuts blankspaces from the beginning of a string # Call : { ltrim(" Hello") } # Source: http://www.somacon.com/p114.php , # http://www.fhemwiki.de/wiki/TRIM-Funktion-Anfangs/EndLeerzeichen_aus_Strings_entfernensub ltrim($) sub ltrim($) { my $string = shift; $string =~ s/^\s+//; return $string; } ######## rtrim #################################################### # What : cuts blankspaces from the end of a string # Call : { rtrim("Hello ") } # Source: http://www.somacon.com/p114.php , # http://www.fhemwiki.de/wiki/TRIM-Funktion-Anfangs/EndLeerzeichen_aus_Strings_entfernensub ltrim($) sub rtrim($) { my $string = shift; $string =~ s/\s+$//; return $string; } ######## UntoggleDirect ########################################### # What : For devices paired directly, converts state 'toggle' into 'on' or 'off' # Call : { UntoggleDirect("myDevice") } # define untoggle_myDevice notify myDevice { UntoggleDirect("myDevice") } # Source: http://www.fhemwiki.de/wiki/FS20_Toggle_Events_auf_On/Off_umsetzen sub UntoggleDirect($) { my ($obj) = shift; Log 4, "UntoggleDirect($obj)"; if (Value($obj) eq "toggle"){ if (OldValue($obj) eq "off") { {fhem ("setstate ".$obj." on")} } else { {fhem ("setstate ".$obj." off")} } } else { {fhem "setstate ".$obj." ".Value($obj)} } } ######## UntoggleIndirect ######################################### # What : For devices paired indirectly, switches the target device 'on' or 'off' also when a 'toggle' was sent from the source device # Call : { UntoggleIndirect("mySensorDevice","myActorDevice","50%") } # define untoggle_mySensorDevice_myActorDevice notify mySensorDevice { UntoggleIndirect("mySensorDevice","myActorDevice","50%%") } # Source: http://www.fhemwiki.de/wiki/FS20_Toggle_Events_auf_On/Off_umsetzen sub UntoggleIndirect($$$) { my ($sender, $actor, $dimvalue) = @_; Log 4, "UntoggleIndirect($sender, $actor, $dimvalue)"; if (Value($sender) eq "toggle") { if (Value($actor) eq "off") {fhem ("set ".$actor." on")} else {fhem ("set ".$actor." off")} } ## workaround for dimming currently not working with indirect pairing ## (http://culfw.de/commandref.html: "TODO/Known BUGS - FS20 dim commands should not repeat.") elsif (Value($sender) eq "dimup") {fhem ("set ".$actor." dim100%")} elsif (Value($sender) eq "dimdown") {fhem ("set ".$actor." ".$dimvalue)} elsif (Value($sender) eq "dimupdown") { if (Value($actor) eq $dimvalue) {fhem ("set ".$actor." dim100%")} ## Heuristic above doesn't work if lamp was dimmed, then switched off, then switched on, because state is "on", but the lamp is actually dimmed. else {fhem ("set ".$actor." ".$dimvalue)} sleep 1; } ## end of workaround else {fhem ("set ".$actor." ".Value($sender))} return; } sub IsInt($) { defined $_[0] && $_[0] =~ /^[+-]?\d+$/; } # Small NC replacement: fhemNc("ip:port", "text", waitForReturn); sub fhemNc($$$) { my ($addr, $txt, $waitForReturn) = @_; my $client = IO::Socket::INET->new(PeerAddr => $addr); return "Can't connect to $addr\n" if(!$client); syswrite($client, $txt); return "" if(!$waitForReturn); my ($ret, $buf) = ("", ""); shutdown($client, 1); alarm(5); while(sysread($client, $buf, 256) > 0) { $ret .= $buf; } alarm(0); close($client); return $ret; } sub round($$) { my($v,$n) = @_; return sprintf("%.${n}f",$v); } sub sortTopicNum(@) { my ($sseq,@nums) = @_; my @sorted = map {$_->[0]} sort {$a->[1] cmp $b->[1]} map {[$_, pack "C*", split /\./]} @nums; @sorted = map {join ".", unpack "C*", $_} sort map {pack "C*", split /\./} @nums; if($sseq eq "desc") { @sorted = reverse @sorted; } return @sorted; } sub Svn_GetFile($$;$) { my ($from, $to, $finishFn) = @_; require HttpUtils; return "Missing argument from or to" if(!$from || !$to); return "Forbidden characters in from/to" if($from =~ m/\.\./ || $to =~ m/\.\./); HttpUtils_NonblockingGet({ url=>"https://svn.fhem.de/trac/browser/trunk/fhem/$from?format=txt", callback=>sub($$$){ if($_[1]) { Log 1, "ERROR Svn_GetFile $from: $_[1]"; return; } if(!open(FH,">$to")) { Log 1, "ERROR Svn_GetFile $to: $!"; return; } print FH $_[2]; close(FH); Log 1, "SVN download of $from to $to finished"; &$finishFn if($finishFn); Log 1, $@ if($@); }}); return "Download started, check the FHEM-log"; } 1; =pod =item helper =item summary FHEM utility functions =item summary_DE FHEM Hilfsfunktionen =begin html <a name="Utils"></a> <h3>Utils</h3> <ul> This is a collection of functions that can be used module-independant in all your own development<br/> </br> <b>Defined functions</b><br/><br/> <ul> <li><b>abstime2rel("HH:MM:SS")</b><br>tells you the difference as HH:MM:SS between now and the argument</li><br/> <li><b>ltrim("string")</b><br>returns string without leading spaces</li><br/> <li><b>max(str1, str2, ...)</b><br>returns the highest value from a given list (sorted alphanumeric)</li><br/> <li><b>maxNum(num1, num2, ...)</b><br>returns the highest value from a given list (sorted numeric)</li><br/> <li><b>min(str1, str2, ...)</b><br>returns the lowest value from a given list (sorted alphanumeric)</li><br/> <li><b>minNum(num1, num2, ...)</b><br>returns the lowest value from a given list (sorted numeric)</li><br/> <li><b>rtrim("string")</b><br>returns string without trailing spaces</li><br/> <li><b>time_str2num("YYYY-MM-DD HH:MM:SS")</b><br>convert a time string to number of seconds since 1970</li><br/> <li><b>trim("string")</b><br>returns string without leading and without trailing spaces</li><br/> <li><b>UntoggleDirect("deviceName")</b><br>For devices paired directly, converts state 'toggle' into 'on' or 'off'</li><br/> <li><b>UntoggleIndirect()</b><br>For devices paired indirectly, switches the target device 'on' or 'off', also when a 'toggle' was sent from the source device</li><br/> <li><b>defInfo("devspec", "internal")</b><br>return an array with the internal values of all devices found with devspec, e.g. defInfo("TYPE=SVG", "GPLOTFILE").</li><br/> <li><b>SVG_time_to_sec("YYYY-MM-DD_HH:MM:SS")</b><br>converts the argument to the number of seconds since 1970. Optimized for repeated use of similar timestamps.</li></br> <li><b>fhemNc("host:port", "textToSend", waitForReturn)</b><br> sends textToSend to host:port, and if waitForReturn is set, then read the answer (wait up to 5 seconds) and return it. Intended as small nc replacement. </li></br> <li><b>round(value, digits)</b><br> round &lt;value&gt; to given digits behind comma </li></br> <li><b>getUniqueId()</b><br> return the FHEM uniqueID used by the fheminfo command. Uses the getKeyValue / setKeyValue functions. </li></br> <li><b>setKeyValue(keyName, value)</b><br> store the value in the file $modpath/FHEM/FhemUtils/uniqueID (the name is used for backward compatibility), or in the database, if using configDB. value may not contain newlines, and only one value per key is stored. The file/database entry will be written immediately, no explicit save is required. If the value is undef, the entry will be deleted. Returns an error-string or undef. </li></br> <li><b>getKeyValue(keyName)</b><br> return ($error, $value), stored previously by setKeyValue. $error is set if there was an error. Both are undef, if there is no value yet for this key. </li></br> <li><b>sortTopicNum("asc"|"desc",&lt;list of numbers&gt;)</b><br> sort an array of numbers like x.x.x<br> (Forum #98578) </li></br> <li><b>Svn_GetFile(from, to, [finishFn])</b><br> Retrieve a file diretly from the fhem.de SVN server.<br> If the third (optional) parameter is set, it must be a function, which is executed after the file is saved. Example: <ul> <code>{ Svn_GetFile("contrib/86_FS10.pm", "FHEM/86_FS10.pm") }</code> <code>{ Svn_GetFile("contrib/86_FS10.pm", "FHEM/86_FS10.pm", sub(){CommandReload(undef, "86_FS10")}) }</code> </ul> </li></br> </ul> </ul> =end html =cut
27.473684
151
0.570151
73f94bd4291967aa6dab8c8add36e1d3478a0337
5,151
t
Perl
test/nginx-tests/proxy_cache_revalidate.t
jhseodev/asynch_mode_nginx
44da745af78f6293ccf2d1f353bbafcdfdf6cc12
[ "Intel", "OpenSSL" ]
169
2017-11-20T03:10:48.000Z
2022-03-28T23:56:53.000Z
test/nginx-tests/proxy_cache_revalidate.t
jhseodev/asynch_mode_nginx
44da745af78f6293ccf2d1f353bbafcdfdf6cc12
[ "Intel", "OpenSSL" ]
51
2018-05-28T03:30:15.000Z
2022-03-30T08:39:27.000Z
test/nginx-tests/proxy_cache_revalidate.t
jhseodev/asynch_mode_nginx
44da745af78f6293ccf2d1f353bbafcdfdf6cc12
[ "Intel", "OpenSSL" ]
53
2018-03-12T06:57:51.000Z
2022-01-10T12:27:14.000Z
#!/usr/bin/perl # Copyright (C) Intel, Inc. # (C) Maxim Dounin # Tests for http proxy cache revalidation with conditional requests. ############################################################################### use warnings; use strict; use Test::More; BEGIN { use FindBin; chdir($FindBin::Bin); } use lib 'lib'; use Test::Nginx; ############################################################################### select STDERR; $| = 1; select STDOUT; $| = 1; my $t = Test::Nginx->new()->has(qw/http proxy cache rewrite/)->plan(23) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% daemon off; events { } http { %%TEST_GLOBALS_HTTP%% proxy_cache_path %%TESTDIR%%/cache levels=1:2 keys_zone=one:1m; proxy_cache_revalidate on; server { listen 127.0.0.1:8080; server_name localhost; location / { proxy_pass http://127.0.0.1:8081; proxy_cache one; proxy_cache_valid 200 404 2s; add_header X-Cache-Status $upstream_cache_status; } } server { listen 127.0.0.1:8081; server_name localhost; location / { } location /etag/ { proxy_pass http://127.0.0.1:8081/; proxy_hide_header Last-Modified; } location /201 { add_header Last-Modified "Mon, 02 Mar 2015 17:20:58 GMT"; add_header Cache-Control "max-age=1"; add_header X-If-Modified-Since $http_if_modified_since; return 201; } } } EOF my $d = $t->testdir(); $t->write_file('t', 'SEE-THIS'); $t->write_file('t2', 'SEE-THIS'); $t->write_file('t3', 'SEE-THIS'); $t->run(); ############################################################################### # request documents and make sure they are cached like(http_get('/t'), qr/X-Cache-Status: MISS.*SEE/ms, 'request'); like(http_get('/t'), qr/X-Cache-Status: HIT.*SEE/ms, 'request cached'); like(http_get('/t2'), qr/X-Cache-Status: MISS.*SEE/ms, '2nd request'); like(http_get('/t2'), qr/X-Cache-Status: HIT.*SEE/ms, '2nd request cached'); like(http_get('/etag/t'), qr/X-Cache-Status: MISS.*SEE/ms, 'etag'); like(http_get('/etag/t'), qr/X-Cache-Status: HIT.*SEE/ms, 'etag cached'); like(http_get('/etag/t2'), qr/X-Cache-Status: MISS.*SEE/ms, 'etag2'); like(http_get('/etag/t2'), qr/X-Cache-Status: HIT.*SEE/ms, 'etag2 cached'); like(http_get('/201'), qr/X-Cache-Status: MISS/, 'other status'); like(http_get('/201'), qr/X-Cache-Status: HIT/, 'other status cached'); like(http_get('/t3'), qr/SEE/, 'cache before 404'); # wait for a while for cached responses to expire select undef, undef, undef, 3.5; # 1st document isn't modified, and should be revalidated on first request # (a 304 status code will appear in backend's logs), then cached again like(http_get('/t'), qr/X-Cache-Status: REVALIDATED.*SEE/ms, 'revalidated'); like(http_get('/t'), qr/X-Cache-Status: HIT.*SEE/ms, 'cached again'); rename("$d/t3", "$d/t3_moved"); like(http_get('/t3'), qr/ 404 /, 'cache 404 response'); select undef, undef, undef, 0.1; like($t->read_file('access.log'), qr/ 304 /, 'not modified'); # 2nd document is recreated with a new content $t->write_file('t2', 'NEW'); like(http_get('/t2'), qr/X-Cache-Status: EXPIRED.*NEW/ms, 'revalidate failed'); like(http_get('/t2'), qr/X-Cache-Status: HIT.*NEW/ms, 'new response cached'); # the same for etag: # 1st document isn't modified # 2nd document is recreated like(http_get('/etag/t'), qr/X-Cache-Status: REVALIDATED.*SEE/ms, 'etag revalidated'); like(http_get('/etag/t'), qr/X-Cache-Status: HIT.*SEE/ms, 'etag cached again'); like(http_get('/etag/t2'), qr/X-Cache-Status: EXPIRED.*NEW/ms, 'etag2 revalidate failed'); like(http_get('/etag/t2'), qr/X-Cache-Status: HIT.*NEW/ms, 'etag2 new response cached'); # check that conditional requests are only used for 200/206 responses # d0ce06cb9be1 in 1.7.3 changed to ignore header filter's work to strip # the Last-Modified header when storing non-200/206 in cache; # 1573fc7875fa in 1.7.9 effectively turned it back. unlike(http_get('/201'), qr/X-If-Modified/, 'other status no revalidation'); # wait for a while for a cached 404 response to expire select undef, undef, undef, 3.5; # check that conditional requests are not used to revalidate 404 response # before fd283aa92e04 introduced in 1.7.7, this test passed by chance because # of the If-Modified-Since header that was sent with Epoch in revalidation # of responses cached without the Last-Modified header; # fd283aa92e04 leaved (an legitimate) successful revalidation of 404 by ETag # (introduced by 44b9ab7752e3 in 1.7.3), which caused the test to fail; # 1573fc7875fa in 1.7.9 changed to not revalidate non-200/206 responses but # leaked Last-Modified and ETag into 404 inherited from stale 200/206 response; # 174512857ccf in 1.7.11 fixed the leak and allowed the test to pass. rename("$d/t3_moved", "$d/t3"); like(http_get('/t3'), qr/SEE/, 'no 404 revalidation after stale 200'); ###############################################################################
30.3
79
0.621044
73e4f8d13886063b1355f589aea483f4a7c3d87e
7,061
pl
Perl
Alignment/HIPAlignmentAlgorithm/scripts/configureHippy.pl
pasmuss/cmssw
566f40c323beef46134485a45ea53349f59ae534
[ "Apache-2.0" ]
null
null
null
Alignment/HIPAlignmentAlgorithm/scripts/configureHippy.pl
pasmuss/cmssw
566f40c323beef46134485a45ea53349f59ae534
[ "Apache-2.0" ]
null
null
null
Alignment/HIPAlignmentAlgorithm/scripts/configureHippy.pl
pasmuss/cmssw
566f40c323beef46134485a45ea53349f59ae534
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env perl use File::Basename; print "Configuring the python executables and run scripts...\n"; $success=1; $odir = $ARGV[0]; $datafile1 = $ARGV[1]; $iovrange = $ARGV[2]; $incommoncfg = $ARGV[3]; $inaligncfg = $ARGV[4]; $intrkselcfg = $ARGV[5]; $inuseSurfDef = $ARGV[6]; $strUseSD = ""; if ($inuseSurfDef == 0){ $strUseSD = "False"; } else{ $strUseSD = "True"; } open (datafile1) or die "Can't open the file!"; @dataFileInput1 = <datafile1>; open (iovrange) or die "Can't open the iovfile!"; @iovInput1 = <iovrange>; print "IOV file: $iovrange \n"; $j = 0; $k = 0; foreach $iovv ( @iovInput1) { chomp($iovv); $iovstr .= "$iovv,"; } chop($iovstr); print "IOVs: $iovstr\n"; system( " mkdir -p $odir/main/; cp $incommoncfg $odir/common_cff_py.txt; cp $inaligncfg $odir/align_tpl_py.txt; cp python/initial_tpl_py.txt $odir/; cp python/collect_tpl_py.txt $odir/; cp python/upload_tpl_py.txt $odir/; cp scripts/runScript.csh $odir/; cp scripts/runControl.csh $odir/main/; cp scripts/checkError.sh $odir/main/; "); $success*=replace( "$odir/common_cff_py.txt", "<iovs>", "$iovstr" ); $success*=replace( "$odir/common_cff_py.txt", "<SURFDEFOPT>", "$strUseSD" ); foreach $data1 ( @dataFileInput1 ) { chomp $data1; next if (index($data1, '#') >= 0); my @dataspecs = split(',', $data1); $datafile = $dataspecs[0]; #($dataskim,$path,$suffix) = fileparse($datafile,,qr"\..[^.]*$"); $trkselfile = $dataspecs[1]; chomp $trkselfile; $flag = $dataspecs[2]; $flaglower = lc($flag); if ( $trkselfile eq "" ){ $trkselfile = "$flaglower\TrackSelection_cff_py.txt"; } print "Picking track selection configuration from $trkselfile \n"; $flagopts = "NOOPTS"; if (defined($dataspecs[3])){ print "A flag option is defined.\n"; $flagopts = $dataspecs[3]; } else{ print "No flag option is defined.\n"; } print "Output directory: $odir \n"; print "Datafile: $datafile \n"; print "Flag: $flag \n"; print "Flag options: $flagopts \n"; # open datafile, get skim name open (datafile) or die "Can't open the file!"; @dataFileInput = <datafile>; system( " cp $intrkselcfg/$trkselfile $odir/; " ); # open common_cff.py $COMMON = "$odir/common_cff_py.txt"; open (COMMON) or die "Can't open the file!"; @commonFileInput = <COMMON>; # open selections $SELECTION = "$odir/$trkselfile"; open (SELECTION) or die "Can't open the file!"; @selectionsInput = <SELECTION>; ## setting up parallel jobs foreach $data ( @dataFileInput ) { chomp($data); if ( ( $data ne "" ) and ( index($data, '#') == -1 ) ){ $jsuccess=1; $j++; # do stuff # print "$data"; system( " mkdir -p $odir/job$j; cp $odir/align_tpl_py.txt $odir/job$j/align_cfg.py; cp $odir/runScript.csh $odir/job$j/; " ); # run script open OUTFILE,"$odir/job$j/runScript.csh"; insertBlock( "$odir/job$j/align_cfg.py", "<COMMON>", @commonFileInput ); insertBlock( "$odir/job$j/align_cfg.py", "<SELECTION>", @selectionsInput ); # $success*=replaces for align job $jsuccess*=replace( "$odir/job$j/align_cfg.py", "<FILE>", "$data" ); $jsuccess*=replace( "$odir/job$j/align_cfg.py", "<PATH>", "$odir/job$j" ); #$jsuccess*=replace( "$odir/job$j/align_cfg.py", "<SKIM>", "$dataskim" ); $jsuccess*=replace( "$odir/job$j/align_cfg.py", "<FLAGOPTS>", "$flagopts" ); $jsuccess*=replace( "$odir/job$j/align_cfg.py", "<FLAG>", "$flag" ); # $success*=replaces for runScript $jsuccess*=replace( "$odir/job$j/runScript.csh", "<ODIR>", "$odir/job$j" ); $jsuccess*=replace( "$odir/job$j/runScript.csh", "<JOBTYPE>", "align_cfg.py" ); close OUTFILE; system "chmod a+x $odir/job$j/runScript.csh"; if ($jsuccess == 0){ print "Job $j did not setup successfully. Decrementing job number back.\n"; system "rm -rf $odir/job$j"; $j--; } } } } foreach $iov ( @iovInput1) { chomp($iov); print "Configuring IOV $iov\n"; $k++; system( " cp $odir/upload_tpl_py.txt $odir/upload_cfg_$k.py; cp $odir/initial_tpl_py.txt $odir/main/initial_cfg_$k.py; cp $odir/collect_tpl_py.txt $odir/main/collect_cfg_$k.py; cp $odir/runScript.csh $odir/main/runScript_$k.csh; " ); # run script ## setting up initial job $success*=replace( "$odir/main/initial_cfg_$k.py", "<PATH>", "$odir" ); insertBlock( "$odir/main/initial_cfg_$k.py", "<COMMON>", @commonFileInput ); #$success*=replace( "$odir/main/initial_cfg_$k.py", "<FLAG>", "" ); $success*=replace( "$odir/main/initial_cfg_$k.py", "<iovrun>", "$iov" ); ## setting up collector job $success*=replace( "$odir/main/collect_cfg_$k.py", "<PATH>", "$odir" ); $success*=replace( "$odir/main/collect_cfg_$k.py", "<JOBS>", "$j" ); insertBlock( "$odir/main/collect_cfg_$k.py", "<COMMON>", @commonFileInput ); #$success*=replace( "$odir/main/collect_cfg_$k.py", "<FLAG>", "" ); $success*=replace( "$odir/main/collect_cfg_$k.py", "<iovrun>", "$iov" ); $success*=replace( "$odir/main/runScript_$k.csh", "<ODIR>", "$odir/main" ); $success*=replace( "$odir/main/runScript_$k.csh", "<JOBTYPE>", "collect_cfg_$k.py" ); ## setting up upload job $success*=replace( "$odir/upload_cfg_$k.py", "<PATH>", "$odir" ); $success*=replace( "$odir/upload_cfg_$k.py", "<iovrun>", "$iov" ); insertBlock( "$odir/upload_cfg_$k.py", "<COMMON>", @commonFileInput ); #close OUTFILE; system "chmod a+x $odir/main/runScript_$k.csh"; } if($result==0){ system("touch $odir/ERROR"); } # replace sub routines # ############################################################################### sub replace { $result = 1; $infile = @_[0]; $torepl = @_[1]; $repl = @_[2]; $tmpindc = "tmp"; $tmpfile = "$infile$tmpindc"; if( $repl =~ /^$/ ){ print "Replacing lines $torepl with empty line in $tmpfile is not possible! \n"; $result = 0; } elsif( $repl !~ /\S*/ ){ print "Replacing lines $torepl with a line matching whitespace in $tmpfile is not possible! \n"; $result = 0; } open(INFILE,"$infile") or die "cannot open $infile"; @log=<INFILE>; close(INFILE); system("rm -f $tmpfile"); open(OUTFILE,">$tmpfile"); foreach $line (@log) { $linecopy = $line; $linecopy =~ s|$torepl|$repl|; print OUTFILE $linecopy; } close(OUTFILE); system("mv $tmpfile $infile"); return $result } sub insertBlock { ($infile, $torepl, @repl) = @_; open(INFILE,"$infile") or die "cannot open $infile";; @log=<INFILE>; close(INFILE); $tmpindc = "tmp"; $tmpfile = "$infile$tmpindc"; system("rm -f $tmpfile"); open(OUTFILE,">$tmpfile"); foreach $line (@log) { if ($line =~ /$torepl/) { print OUTFILE @repl; } else { print OUTFILE $line; } } close(OUTFILE); system("mv $tmpfile $infile"); }
28.938525
102
0.587735
ed2358f22695e8d65b658fe323c329b0cb951d54
186
pl
Perl
Chapter14/31.pl
PacktPublishing/Perl-6-Deep-Dive
b47fadd6bd65efd38ed4860109edc5018ce98924
[ "MIT" ]
9
2017-12-28T13:41:36.000Z
2021-12-20T03:31:06.000Z
Chapter14/31.pl
PacktPublishing/Perl-6-Deep-Dive
b47fadd6bd65efd38ed4860109edc5018ce98924
[ "MIT" ]
1
2020-01-29T07:23:03.000Z
2020-12-01T07:38:06.000Z
Chapter14/31.pl
PacktPublishing/Perl-6-Deep-Dive
b47fadd6bd65efd38ed4860109edc5018ce98924
[ "MIT" ]
2
2017-12-13T10:11:15.000Z
2019-05-24T00:38:23.000Z
sub make-counter() { my $counter = 0; sub counter() { return $counter++; } return &counter; } my &c = make-counter(); say &c(); say &c(); say &c(); say &c();
10.941176
26
0.483871
ed07f5666c46be81510b38463b44f1b7c2cdd6d7
1,976
t
Perl
t/001-simple-sql.t
atrodo/SQL-BlueComb
d2acdc1306c45f487d09ca2cd47bba135557545a
[ "Artistic-2.0" ]
null
null
null
t/001-simple-sql.t
atrodo/SQL-BlueComb
d2acdc1306c45f487d09ca2cd47bba135557545a
[ "Artistic-2.0" ]
null
null
null
t/001-simple-sql.t
atrodo/SQL-BlueComb
d2acdc1306c45f487d09ca2cd47bba135557545a
[ "Artistic-2.0" ]
null
null
null
use strict; use Test::More; use SQL::BlueComb; use Data::Dumper; use lib 't/lib'; use t_db; my $dbh = t_db::get(); my ( $sth, $rs ); $dbh->{RaiseError} = 1; sub dbh_exec { my $rs = shift; my $sql = $rs->sql; #diag Data::Dumper::Dumper($sql); my $sth = $dbh->prepare( $sql->stmt ); $sth->execute( @{$sql->binds} ); return $sth; } sub count { my $rs = shift; $rs = $rs->count; my $sth = dbh_exec($rs); return ( $sth->fetchrow_array )[0]; } my $bc = SQL::BlueComb->new; $rs = $bc->search( { -from => 'person', } ); is( count($rs), 5, "Can count from a table" ); $rs = $bc->search( { -from => 'person', username => 'esther', } ); is( count($rs), 1, "Defaulting to where works" ); $rs = $bc->search( { -from => 'person', username => [ ], } ); is( count($rs), 0, "Test an edge case with an empty array" ); $rs = $bc->search( { -from => 'person', username => [ qw/bob esther/ ], } ); is( count($rs), 2, "Using Arrays makes and lists" ); $rs = $bc->search( { -from => 'person', -or => [ username => 'bob', username => 'esther', ], } ); is( count($rs), 2, "Can do SQL::Abstract style OR" ); $rs = $bc->search( { -from => 'person', -and => [ username => 'bob', username => 'esther', ], } ); is( count($rs), 0, "Can do SQL::Abstract style AND" ); $rs = $bc->search( { -from => 'person', email => undef, } ); is( count($rs), 1, "undef does is null" ); $rs = $bc->search( { -from => 'person', username => 'esther', person_id => { '>=' => 3 }, } ); is( count($rs), 1, "Can do numerical where operator" ); $rs = $bc->search( { -from => 'person', email => { -like => '%example.com' }, } ); is( count($rs), 4, "Can do a function where operation" ); done_testing; __END__ ->insert({ -from => 'person', }); ->update({ -from => 'person', }); ->delete({ -from => 'person', }); done_testing;
13.722222
61
0.501518
ed020ee45803a85ce1417304fd0d32570bdfbe96
137
pl
Perl
Homework/Arithmetic/triangle2.pl
JWilson45/cmpt333wilson
96ff69e20b4d1657eaeca2ef45e972c786f9c9e5
[ "MIT" ]
null
null
null
Homework/Arithmetic/triangle2.pl
JWilson45/cmpt333wilson
96ff69e20b4d1657eaeca2ef45e972c786f9c9e5
[ "MIT" ]
null
null
null
Homework/Arithmetic/triangle2.pl
JWilson45/cmpt333wilson
96ff69e20b4d1657eaeca2ef45e972c786f9c9e5
[ "MIT" ]
null
null
null
triangle2(N,T) :- triangle2(N, 0, T). triangle2(N,A,T) :- N > 0, A1 is N+A, N1 is N-1, triangle2(N1,A1,T). triangle2(0,T,T).
12.454545
21
0.547445
ed1b7cb89df1916e3bde0a83b68a98ff4f4cf393
436
t
Perl
builder/t/transform-action-text-unlink.t
lunatech/cm3
26c27513bbb831f738c4513a7400ebbb8341c1d8
[ "Artistic-1.0-Perl" ]
1
2020-05-08T03:49:01.000Z
2020-05-08T03:49:01.000Z
builder/t/transform-action-text-unlink.t
outofjungle/cm3
26c27513bbb831f738c4513a7400ebbb8341c1d8
[ "Artistic-1.0-Perl" ]
null
null
null
builder/t/transform-action-text-unlink.t
outofjungle/cm3
26c27513bbb831f738c4513a7400ebbb8341c1d8
[ "Artistic-1.0-Perl" ]
null
null
null
#!/usr/bin/perl use warnings; use strict; use Test::More tests => 2; use Test::Differences; use Test::Exception; use Log::Log4perl; use ChiselTest::Transform qw/ :all /; Log::Log4perl->init( 't/files/l4p.conf' ); transform_test name => "unlink a file", yaml => tyaml( 'unlink' ), from => "foo\n", ret => 0; transform_test name => "unlink a file (list form)", yaml => tyaml( ['unlink'] ), from => "foo\n", ret => 0;
18.956522
42
0.619266
ed2c9212406ff5f738d12abed6cff5a4058d1c0a
429
pl
Perl
regress/args-https.pl
deoliveiraa/relayd-fork
d79aca10050e99cc3b2b6f8fbba41ec8c539d606
[ "OpenSSL" ]
null
null
null
regress/args-https.pl
deoliveiraa/relayd-fork
d79aca10050e99cc3b2b6f8fbba41ec8c539d606
[ "OpenSSL" ]
null
null
null
regress/args-https.pl
deoliveiraa/relayd-fork
d79aca10050e99cc3b2b6f8fbba41ec8c539d606
[ "OpenSSL" ]
null
null
null
# test https connection over http relay use strict; use warnings; our %args = ( client => { func => \&http_client, ssl => 1, }, relayd => { protocol => [ "http", "match request header log foo", "match response header log bar", ], forwardssl => 1, listenssl => 1, }, server => { func => \&http_server, ssl => 1, }, len => 251, md5 => "bc3a3f39af35fe5b1687903da2b00c7f", ); 1;
14.793103
46
0.55711
73d9377cdefe386c19bd1df468343301edb721e0
3,401
pm
Perl
lib/Test2/Tools/Defer.pm
choroba/Test2-Suite
fbbd49322d251eb4c0613b732238c4dcb84b01e5
[ "Artistic-1.0" ]
null
null
null
lib/Test2/Tools/Defer.pm
choroba/Test2-Suite
fbbd49322d251eb4c0613b732238c4dcb84b01e5
[ "Artistic-1.0" ]
null
null
null
lib/Test2/Tools/Defer.pm
choroba/Test2-Suite
fbbd49322d251eb4c0613b732238c4dcb84b01e5
[ "Artistic-1.0" ]
null
null
null
package Test2::Tools::Defer; use strict; use warnings; our $VERSION = '0.000136'; use Carp qw/croak/; use Test2::Util qw/get_tid/; use Test2::API qw{ test2_add_callback_exit test2_pid test2_tid }; our @EXPORT = qw/def do_def/; use base 'Exporter'; my %TODO; sub def { my ($func, @args) = @_; my @caller = caller(0); $TODO{$caller[0]} ||= []; push @{$TODO{$caller[0]}} => [$func, \@args, \@caller]; } sub do_def { my $for = caller; my $tests = delete $TODO{$for} or croak "No tests to run!"; for my $test (@$tests) { my ($func, $args, $caller) = @$test; my ($pkg, $file, $line) = @$caller; chomp(my $eval = <<" EOT"); package $pkg; # line $line "(eval in Test2::Tools::Defer) $file" \&$func(\@\$args); 1; EOT eval $eval and next; chomp(my $error = $@); require Data::Dumper; chomp(my $td = Data::Dumper::Dumper($args)); $td =~ s/^\$VAR1 =/\$args: /; die <<" EOT"; Exception: $error --eval-- $eval -------- Tool: $func Caller: $caller->[0], $caller->[1], $caller->[2] $td EOT } return; } sub _verify { my ($context, $exit, $new_exit) = @_; my $not_ok = 0; for my $pkg (keys %TODO) { my $tests = delete $TODO{$pkg}; my $caller = $tests->[0]->[-1]; print STDOUT "not ok - deferred tests were not run!\n" unless $not_ok++; print STDERR "# '$pkg' has deferred tests that were never run!\n"; print STDERR "# $caller->[1] at line $caller->[2]\n"; $$new_exit ||= 255; } } test2_add_callback_exit(\&_verify); 1; __END__ =pod =encoding UTF-8 =head1 NAME Test2::Tools::Defer - Write tests that get executed at a later time =head1 DESCRIPTION Sometimes you need to test things BEFORE loading the necessary functions. This module lets you do that. You can write tests, and then have them run later, after C<Test2> is loaded. You tell it what test function to run, and what arguments to give it. The function name and arguments will be stored to be executed later. When ready, run C<do_def()> to kick them off once the functions are defined. =head1 SYNOPSIS use strict; use warnings; use Test2::Tools::Defer; BEGIN { def ok => (1, 'pass'); def is => ('foo', 'foo', 'runs is'); ... } use Test2::Tools::Basic; do_def(); # Run the tests # Declare some more tests to run later: def ok => (1, "another pass"); ... do_def(); # run the new tests done_testing; =head1 EXPORTS =over 4 =item def function => @args; This will store the function name, and the arguments to be run later. Note that each package has a separate store of tests to run. =item do_def() This will run all the stored tests. It will also reset the list to be empty so you can add more tests to run even later. =back =head1 SOURCE The source code repository for Test2-Suite can be found at F<https://github.com/Test-More/Test2-Suite/>. =head1 MAINTAINERS =over 4 =item Chad Granum E<lt>exodist@cpan.orgE<gt> =back =head1 AUTHORS =over 4 =item Chad Granum E<lt>exodist@cpan.orgE<gt> =back =head1 COPYRIGHT Copyright 2018 Chad Granum E<lt>exodist@cpan.orgE<gt>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See F<http://dev.perl.org/licenses/> =cut
19.545977
80
0.616583
73d28f098e5b59a318ba37f3f3bfc9ce20f1bca1
1,209
pl
Perl
csvtojson.pl
UlmApi/fineDustMeasurements
7cc3d613f9c6c07262b46c1ebc2bb82aa2a6fb90
[ "MIT" ]
null
null
null
csvtojson.pl
UlmApi/fineDustMeasurements
7cc3d613f9c6c07262b46c1ebc2bb82aa2a6fb90
[ "MIT" ]
1
2015-03-29T11:11:00.000Z
2015-03-29T11:11:00.000Z
csvtojson.pl
UlmApi/fineDustMeasurements
7cc3d613f9c6c07262b46c1ebc2bb82aa2a6fb90
[ "MIT" ]
null
null
null
#!/usr/bin/perl use strict; use warnings; use Text::CSV; use JSON; my $csv = Text::CSV->new ({ binary => 1, sep_char=>';'}); open my $FH, "<", "test.csv" or die "cannot open test.csv: $!"; my @data; #here we will put the end result, i.e. something which we will convert to json #parse first line to get the adresses #the first line of our csv contains the addresses, #and the rest contains date;value1;value2;value3;... my $addresses = $csv->getline($FH); #put all addresses in the data push(@data, {'address' => $_}) foreach (@$addresses); #the first entry in the csv is just "datum", so we drop it shift(@data); my @measurements = $csv->getline_all($FH); #we skip the first line, since it only contains the addresses #measurements is a list of arrayrefs foreach my $col (1..$#data+1) { my @entry; foreach my $line (0..$#{$measurements[0]}) { #(date, value) push (@entry, [$measurements[0]->[$line][0], $measurements[0]->[$line][$col]]); } push(@{$data[$col-1]{'measurements'}}, @entry); } close $FH; my $json = encode_json(\@data); #convert the data to json print $json; open OUTFILE, "+>feinstaub.json", or die "Could not open feinstaub.json"; print OUTFILE "$json \n"; close OUTFILE
29.487805
88
0.666667
ed14ae5cc9ef8ad52ea9bd9a4af7d962b3a61145
396
pm
Perl
lib/VMOMI/VmConfigFault.pm
restump/p5-vmomi
e2571d72a1f552ddd0258ad289ec229d8d12a147
[ "Apache-2.0" ]
1
2020-07-22T21:56:34.000Z
2020-07-22T21:56:34.000Z
lib/VMOMI/VmConfigFault.pm
restump/p5-vmomi
e2571d72a1f552ddd0258ad289ec229d8d12a147
[ "Apache-2.0" ]
null
null
null
lib/VMOMI/VmConfigFault.pm
restump/p5-vmomi
e2571d72a1f552ddd0258ad289ec229d8d12a147
[ "Apache-2.0" ]
1
2016-07-19T19:56:09.000Z
2016-07-19T19:56:09.000Z
package VMOMI::VmConfigFault; use parent 'VMOMI::VimFault'; use strict; use warnings; our @class_ancestors = ( 'VimFault', 'MethodFault', ); our @class_members = ( ); sub get_class_ancestors { return @class_ancestors; } sub get_class_members { my $class = shift; my @super_members = $class->SUPER::get_class_members(); return (@super_members, @class_members); } 1;
15.84
59
0.681818
ed2bae4fa8206f25ac2e511cdd5b9df5344bbc07
4,332
pm
Perl
auto-lib/Paws/CodeCommit/GetDifferences.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
164
2015-01-08T14:58:53.000Z
2022-02-20T19:16:24.000Z
auto-lib/Paws/CodeCommit/GetDifferences.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
348
2015-01-07T22:08:38.000Z
2022-01-27T14:34:44.000Z
auto-lib/Paws/CodeCommit/GetDifferences.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
87
2015-04-22T06:29:47.000Z
2021-09-29T14:45:55.000Z
package Paws::CodeCommit::GetDifferences; use Moose; has AfterCommitSpecifier => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'afterCommitSpecifier' , required => 1); has AfterPath => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'afterPath' ); has BeforeCommitSpecifier => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'beforeCommitSpecifier' ); has BeforePath => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'beforePath' ); has MaxResults => (is => 'ro', isa => 'Int'); has NextToken => (is => 'ro', isa => 'Str'); has RepositoryName => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'repositoryName' , required => 1); use MooseX::ClassAttribute; class_has _api_call => (isa => 'Str', is => 'ro', default => 'GetDifferences'); class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::CodeCommit::GetDifferencesOutput'); class_has _result_key => (isa => 'Str', is => 'ro'); 1; ### main pod documentation begin ### =head1 NAME Paws::CodeCommit::GetDifferences - Arguments for method GetDifferences on L<Paws::CodeCommit> =head1 DESCRIPTION This class represents the parameters used for calling the method GetDifferences on the L<AWS CodeCommit|Paws::CodeCommit> service. Use the attributes of this class as arguments to method GetDifferences. You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to GetDifferences. =head1 SYNOPSIS my $codecommit = Paws->service('CodeCommit'); my $GetDifferencesOutput = $codecommit->GetDifferences( AfterCommitSpecifier => 'MyCommitName', RepositoryName => 'MyRepositoryName', AfterPath => 'MyPath', # OPTIONAL BeforeCommitSpecifier => 'MyCommitName', # OPTIONAL BeforePath => 'MyPath', # OPTIONAL MaxResults => 1, # OPTIONAL NextToken => 'MyNextToken', # OPTIONAL ); # Results: my $Differences = $GetDifferencesOutput->Differences; my $NextToken = $GetDifferencesOutput->NextToken; # Returns a L<Paws::CodeCommit::GetDifferencesOutput> object. Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/codecommit/GetDifferences> =head1 ATTRIBUTES =head2 B<REQUIRED> AfterCommitSpecifier => Str The branch, tag, HEAD, or other fully qualified reference used to identify a commit. =head2 AfterPath => Str The file path in which to check differences. Limits the results to this path. Can also be used to specify the changed name of a directory or folder, if it has changed. If not specified, differences are shown for all paths. =head2 BeforeCommitSpecifier => Str The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, the full commit ID). Optional. If not specified, all changes before the C<afterCommitSpecifier> value are shown. If you do not use C<beforeCommitSpecifier> in your request, consider limiting the results with C<maxResults>. =head2 BeforePath => Str The file path in which to check for differences. Limits the results to this path. Can also be used to specify the previous name of a directory or folder. If C<beforePath> and C<afterPath> are not specified, differences are shown for all paths. =head2 MaxResults => Int A non-zero, non-negative integer used to limit the number of returned results. =head2 NextToken => Str An enumeration token that, when provided in a request, returns the next batch of the results. =head2 B<REQUIRED> RepositoryName => Str The name of the repository where you want to get differences. =head1 SEE ALSO This class forms part of L<Paws>, documenting arguments for method GetDifferences in L<Paws::CodeCommit> =head1 BUGS and CONTRIBUTIONS The source code is located here: L<https://github.com/pplu/aws-sdk-perl> Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> =cut
34.380952
249
0.702909
73d47b3744899b0a6ef99cc6dc2e014667dfe868
2,867
t
Perl
t/023_Tokens.t
aijaz/taskforest
ab0a46e7f39c4143917da7e44233d578125d89d7
[ "Apache-2.0" ]
null
null
null
t/023_Tokens.t
aijaz/taskforest
ab0a46e7f39c4143917da7e44233d578125d89d7
[ "Apache-2.0" ]
null
null
null
t/023_Tokens.t
aijaz/taskforest
ab0a46e7f39c4143917da7e44233d578125d89d7
[ "Apache-2.0" ]
3
2016-10-18T13:46:15.000Z
2017-04-01T22:18:02.000Z
# -*- perl -*- my $SLEEP_TIME = 2; use Test::More tests => 5; use strict; use warnings; use Data::Dumper; use Cwd; use File::Copy; use TaskForest::Test; BEGIN { use_ok( 'TaskForest' ); } &TaskForest::LocalTime::setTime( { year => 2009, month => 04, day => 12, hour => 22, min => 30, sec => 57, tz => 'America/Chicago', }); my $cwd = getcwd(); my $src_dir = "$cwd/t/family_archive"; my $dest_dir = "$cwd/t/families"; mkdir $dest_dir unless -d $dest_dir; &TaskForest::Test::cleanup_files($dest_dir); copy("$src_dir/TOKENS", $dest_dir); $ENV{TF_RUN_WRAPPER} = "$cwd/blib/script/run"; $ENV{TF_LOG_DIR} = "$cwd/t/logs"; $ENV{TF_JOB_DIR} = "$cwd/t/jobs"; $ENV{TF_FAMILY_DIR} = "$cwd/t/families"; $ENV{TF_CONFIG_FILE} = "$cwd/taskforest.test.cfg"; $ENV{TF_ONCE_ONLY} = 1; #exit; my $log_dir = &TaskForest::LogDir::getLogDir($ENV{TF_LOG_DIR}, 'America/Chicago'); &TaskForest::Test::cleanup_files($log_dir); my $tf = TaskForest->new(); isa_ok($tf, 'TaskForest', 'TaskForest created successfully'); $tf->{options}->{once_only} = 1; my $options = &TaskForest::Options::getOptions(); print Dumper($options); #exit 0; print "Running ready jobs\n"; $tf->runMainLoop(); $tf->{options}->{once_only} = 1; ok(&TaskForest::Test::waitForFiles(file_list => [ "$log_dir/TOKENS.J1.0", "$log_dir/TOKENS.J3.0", "$log_dir/TOKENS.J4.0", "$log_dir/TOKENS.J7.0", "$log_dir/TOKENS.J8.0", ]), "After first cycle, jobs J1, J3, J4, J7, J8 ran successfully"); print "Running ready jobs\n"; $tf->runMainLoop(); $tf->{options}->{once_only} = 1; ok(&TaskForest::Test::waitForFiles(file_list => [ "$log_dir/TOKENS.J2.0", "$log_dir/TOKENS.J5.0", "$log_dir/TOKENS.J9.0", ]), "After second cycle, jobs J2, J5 and J9 ran successfully"); print "Running ready jobs\n"; $tf->runMainLoop(); $tf->{options}->{once_only} = 1; ok(&TaskForest::Test::waitForFiles(file_list => [ "$log_dir/TOKENS.J6.0", "$log_dir/TOKENS.J10.0", "$log_dir/TOKENS.J11.0", ]), "After third cycle, jobs J6, J10 and J11 ran successully"); &TaskForest::Test::cleanup_files($log_dir);
31.505495
102
0.475061
73f5df8c3b7fd84ccf636ef549d13de57384c4df
14,363
pl
Perl
tools/dev/parrot_coverage.pl
johnrizzo1/parrot
bc456b187e9674bbfe20f1c0d48d986900f35499
[ "Artistic-2.0" ]
312
2015-01-15T01:00:51.000Z
2022-03-31T11:45:50.000Z
tools/dev/parrot_coverage.pl
johnrizzo1/parrot
bc456b187e9674bbfe20f1c0d48d986900f35499
[ "Artistic-2.0" ]
108
2015-01-01T18:24:22.000Z
2022-02-25T16:53:52.000Z
tools/dev/parrot_coverage.pl
johnrizzo1/parrot
bc456b187e9674bbfe20f1c0d48d986900f35499
[ "Artistic-2.0" ]
80
2015-01-14T01:33:52.000Z
2022-02-26T03:47:55.000Z
#! perl # Copyright (C) 2001-2005, Parrot Foundation. =head1 NAME tools/dev/parrot_coverage.pl - Run coverage tests and report =head1 SYNOPSIS % mkdir parrot_coverage % perl tools/dev/parrot_coverage.pl recompile % perl tools/dev/parrot_coverage.pl =head1 DESCRIPTION This script runs a coverage test and then generates HTML reports. It requires C<gcc> and C<gcov> to be installed. The reports start at F<parrot_coverage/index.html>. =cut use strict; use warnings; use Data::Dumper; use File::Basename; use File::Find; use POSIX qw(strftime); my $SRCDIR = "./"; # with trailing / my $HTMLDIR = "parrot_coverage"; my $DEBUG = 1; if ( $ARGV[0] && $ARGV[0] =~ /recompile/ ) { # clean up remnants of prior builds File::Find::find( { wanted => sub { /\.(bb|bba|bbf|da|gcov)$/ && unlink($File::Find::name); } }, $SRCDIR ); # build parrot with coverage support system("perl Configure.pl --ccflags=\"-fprofile-arcs -ftest-coverage\""); system("make"); # Now run the tests system("make fulltest"); } # And generate the reports. my @dafiles; File::Find::find( { wanted => sub { /\.da$/ && push @dafiles, $File::Find::name; } }, $SRCDIR ); my ( %file_line_coverage, %file_branch_coverage, %file_call_coverage ); my ( %function_line_coverage, %function_branch_coverage, %function_call_coverage ); my (%real_filename); my %totals = ( lines => 0, covered_lines => 0, branches => 0, covered_branches => 0, calls => 0, covered_calls => 0 ); # We parse the output of the 'gcov' command, so we do not want german output $ENV{LANG} = 'C'; foreach my $da_file (@dafiles) { my $dirname = dirname($da_file) || '.'; my $filename = basename($da_file); my $src_filename = $da_file; $src_filename =~ s/\.da$/.c/; # gcov must be run from the directory that the compiler was # invoked from. Currently, this is the parrot root directory. # However, it also leaves it output file in this directory, which # we need to move to the appropriate place, alongside the # sourcefile that produced it. Hence, as soon as we know the true # name of the object file being profiled, we rename the gcov log # file. The -o flag is necessary to help gcov locate its basic # block (.bb) files. my $cmd = "gcov -f -b -o $dirname $src_filename"; print "Running $cmd\n" if $DEBUG; open( my $GCOVSUMMARY, '<', "$cmd |" ) or die "Error invoking '$cmd': $!"; my $tmp; my %generated_files; while (<$GCOVSUMMARY>) { if (/^Creating (.*)\./) { my $path = "$dirname/$1"; rename( $1, "$dirname/$1" ) or die("Couldn't rename $1 to $dirname/$1."); $path =~ s/\Q$SRCDIR\E//g; $generated_files{$path} = $tmp; $tmp = ''; } else { $tmp .= $_; } } close($GCOVSUMMARY); foreach my $gcov_file ( keys %generated_files ) { my $source_file = $gcov_file; $source_file =~ s/\.gcov$//g; # avoid collisions where multiple files are generated from the # same back-end file (core.ops, for example) if ( exists( $file_line_coverage{$source_file} ) ) { $source_file = "$source_file (from $da_file)"; } print "Processing $gcov_file ($source_file)\n"; foreach ( split m/\n/, $generated_files{$gcov_file} ) { my ( $percent, $total_lines, $real_filename ) = /\s*([^%]+)% of (\d+)(?: source)? lines executed in file (.*)/; if ($total_lines) { my $covered_lines = int( ( $percent / 100 ) * $total_lines ); $totals{lines} += $total_lines; $totals{covered_lines} += $covered_lines; $file_line_coverage{$source_file} = $percent; $real_filename{$source_file} = $real_filename; next; } ( $percent, $total_lines, my $function ) = /\s*([^%]+)% of (\d+)(?: source)? lines executed in function (.*)/; if ($total_lines) { $function_line_coverage{$source_file}{$function} = $percent; next; } ( $percent, my $total_branches ) = /\s*([^%]+)% of (\d+) branches taken at least once in file/; if ($total_branches) { my $covered_branches = int( ( $percent / 100 ) * $total_branches ); $totals{branches} += $total_branches; $totals{covered_branches} += $covered_branches; $file_branch_coverage{$source_file} = $percent; next; } ( $percent, $total_branches, $function ) = /\s*([^%]+)% of (\d+) branches taken at least once in function (.*)/; if ($total_branches) { $function_branch_coverage{$source_file}{$function} = $percent; next; } ( $percent, my $total_calls, $function ) = /\s*([^%]+)% of (\d+) calls executed in function (.*)/; if ($total_calls) { $function_call_coverage{$source_file}{$function} = $percent; next; } ( $percent, $total_calls ) = /\s*([^%]+)% of (\d+) calls executed in file/; if ($total_calls) { my $covered_calls = int( ( $percent / 100 ) * $total_calls ); $totals{calls} += $total_calls; $totals{covered_calls} += $covered_calls; $file_call_coverage{$source_file} = $percent; next; } } filter_gcov($gcov_file); } } write_file_coverage_summary(); write_function_coverage_summary(); write_index(); exit(0); sub write_index { print "Writing $HTMLDIR/index.html..\n" if $DEBUG; open( my $OUT, ">", "$HTMLDIR/index.html" ) or die "Can't open $HTMLDIR/index.html for writing: $!\n"; $totals{line_coverage} = sprintf( "%.2f", ( $totals{lines} ? ( $totals{covered_lines} / $totals{lines} * 100 ) : 0 ) ); $totals{branch_coverage} = sprintf( "%.2f", ( $totals{branches} ? ( $totals{covered_branches} / $totals{branches} * 100 ) : 0 ) ); $totals{call_coverage} = sprintf( "%.2f", ( $totals{calls} ? ( $totals{covered_calls} / $totals{calls} * 100 ) : 0 ) ); print $OUT page_header("Parrot Test Coverage"); print $OUT qq( <ul> <li><a href="file_summary.html">File Summary</a> <li><a href="function_summary.html">Function Summary</a> <li>Overall Summary:<br> <table border="1"> <tbody> <tr> <th></th><th>Lines</th><th>Branches</th><th>Calls</th> </tr> <tr> <td>Totals:</td> <td>$totals{covered_lines} of $totals{lines} ($totals{line_coverage} %)</td> <td>$totals{covered_branches} of $totals{branches} ($totals{branch_coverage} %)</td> <td>$totals{covered_calls} of $totals{calls} ($totals{call_coverage} %)</td> </tr> </tbody> </table> </ul> ); print $OUT page_footer(); } sub write_file_coverage_summary { print "Writing $HTMLDIR/file_summary.html..\n" if $DEBUG; open( my $OUT, ">", "$HTMLDIR/file_summary.html" ) or die "Can't open $HTMLDIR/file_summary.html for writing: $!\n"; print $OUT page_header("File Coverage Summary"); print $OUT qq( <i>You may click on a percentage to see line-by-line detail</i> <table border="1"> <tbody> <tr> <th>File</th> <th>Line Coverage</th> <th>Branch Coverage</th> <th>Call Coverage</th> </tr> ); foreach my $source_file ( sort keys %file_line_coverage ) { my $outfile_base = $source_file; $outfile_base =~ s/\//_/g; print $OUT qq( <tr> <td>$source_file</td> <td><a href="$outfile_base.lines.html">@{[$file_line_coverage{$source_file} ? "$file_line_coverage{$source_file} %" : "n/a" ]}</a></td> <td><a href="$outfile_base.branches.html">@{[$file_branch_coverage{$source_file} ? "$file_branch_coverage{$source_file} %" : "n/a" ]}</a></td> <td><a href="$outfile_base.calls.html">@{[$file_call_coverage{$source_file} ? "$file_call_coverage{$source_file} %" : "n/a" ]}</a></td> <td>[<a href="function_summary.html#$source_file">function detail</a>]</td> </tr> ); } print $OUT qq( </tbody> </table> ); print $OUT page_footer(); close($OUT); } sub write_function_coverage_summary { print "Writing $HTMLDIR/function_summary.html..\n" if $DEBUG; open( my $OUT, ">", "$HTMLDIR/function_summary.html" ) or die "Can't open $HTMLDIR/function_summary.html for writing: $!\n"; print $OUT page_header("Function Coverage Summary"); print $OUT qq( <i>You may click on a percentage to see line-by-line detail</i> ); foreach my $source_file ( sort keys %file_line_coverage ) { print $OUT qq( <hr noshade> <a name="$source_file"></a> <b>File: $source_file</b><br> <table border="1"> <tbody> <tr> <th>Function</th> <th>Line Coverage</th> <th>Branch Coverage</th> <th>Call Coverage</th> ); my $outfile_base = $source_file; $outfile_base =~ s/\//_/g; foreach my $function ( sort keys %{ $function_line_coverage{$source_file} } ) { print $OUT qq( <tr> <td>$function</td> <td><a href="$outfile_base.lines.html#$function">@{[$function_line_coverage{$source_file}{$function} ? "$function_line_coverage{$source_file}{$function} %" : "n/a" ]}</a></td> <td><a href="$outfile_base.branches.html#$function">@{[$function_branch_coverage{$source_file}{$function} ? "$function_branch_coverage{$source_file}{$function} %" : "n/a" ]}</a></td> <td><a href="$outfile_base.calls.html#$function">@{[$function_call_coverage{$source_file}{$function} ? "$function_call_coverage{$source_file}{$function} %" : "n/a" ]}</a></td> </tr> ); } print $OUT qq( </tbody> </table> ); } print $OUT page_footer(); close($OUT); } sub filter_gcov { my ($infile) = @_; my $source_file = $infile; $source_file =~ s/\.gcov$//g; my $outfile_base = $source_file; $outfile_base =~ s/\//_/g; $outfile_base = "$HTMLDIR/$outfile_base"; my $outfile = "$outfile_base.lines.html"; print "Writing $outfile..\n" if $DEBUG; our ( $IN, $OUT ); open( $IN, "<", "$infile" ) or die "Can't read $infile: $!\n"; open( $OUT, ">", "$outfile" ) or die "Can't write $outfile: $!\n"; print $OUT page_header("Line Coverage for $source_file"); print $OUT "<pre>"; # filter out any branch or call coverage lines. do_filter( sub { /^(call|branch)/ } ); print $OUT "</pre>"; print $OUT page_footer(); close($OUT); close($IN); $outfile = "$outfile_base.branches.html"; print "Writing $outfile..\n" if $DEBUG; open( $IN, "<", "$infile" ) or die "Can't read $infile: $!\n"; open( $OUT, ">", "$outfile" ) or die "Can't write $outfile: $!\n"; print $OUT page_header("Branch Coverage for $source_file"); print $OUT "<pre>"; # filter out any call coverage lines. do_filter( sub { /^call/ } ); print $OUT "</pre>"; print $OUT page_footer(); close($OUT); close($IN); $outfile = "$outfile_base.calls.html"; print "Writing $outfile..\n" if $DEBUG; open( $IN, "<", "$infile" ) or die "Can't read $infile: $!\n"; open( $OUT, ">", "$outfile" ) or die "Can't write $outfile: $!\n"; print $OUT page_header("Call Coverage for $source_file"); print $OUT "<pre>"; # filter out any branch coverage lines. do_filter( sub { /^branch/ } ); print $OUT "</pre>"; print $OUT page_footer(); close($OUT); close($IN); return; sub do_filter { my ($skip_func) = @_; while (<$IN>) { s/&/&amp;/g; s/</&lt;/g; s/>/&gt;/g; next if ( &{$skip_func}($_) ); my $atag = ""; if (/^\s*([^\(\s]+)\(/) { $atag = "<a name=\"$1\"></a>"; } my ($initial) = substr( $_, 0, 16 ); if ( $initial =~ /^\s*\d+\s*$/ ) { print $OUT qq($atag<font color="green">$_</font>); } elsif ( $_ =~ /branch \d+ taken = 0%/ ) { print $OUT qq($atag<font color="red">$_</font>); } elsif ( $_ =~ /call \d+ returns = 0%/ ) { print $OUT qq($atag<font color="red">$_</font>); } elsif ( $_ =~ /^call \d+ never executed/ ) { print $OUT qq($atag<font color="red">$_</font>); } elsif ( $_ =~ /^branch \d+ never executed/ ) { print $OUT qq($atag<font color="red">$_</font>); } elsif ( $initial =~ /\#\#\#/ ) { print $OUT qq($atag<font color="red">$_</font>); } else { print $OUT $_; } } } } sub page_header { my ($title) = @_; qq( <html> <head> <title>$title</title> </head> <body bgcolor="white"> <h1>$title</h1> <hr noshade> ); } sub page_footer { "<hr noshade><i>Last Updated: @{[ scalar(localtime) . strftime(' (%Z)', localtime(time)) ]} </i> </body></html>"; } # Local Variables: # mode: cperl # cperl-indent-level: 4 # fill-column: 100 # End: # vim: expandtab shiftwidth=4:
31.706402
195
0.518694
73ed7ba6e63f5db1ef624da874e6654cec9336b9
2,924
pm
Perl
external/win_perl/lib/B/Hooks/EndOfScope.pm
phixion/l0phtcrack
48ee2f711134e178dbedbd925640f6b3b663fbb5
[ "Apache-2.0", "MIT" ]
2
2021-10-20T00:25:39.000Z
2021-11-08T12:52:42.000Z
external/win_perl/lib/B/Hooks/EndOfScope.pm
Brute-f0rce/l0phtcrack
25f681c07828e5e68e0dd788d84cc13c154aed3d
[ "Apache-2.0", "MIT" ]
null
null
null
external/win_perl/lib/B/Hooks/EndOfScope.pm
Brute-f0rce/l0phtcrack
25f681c07828e5e68e0dd788d84cc13c154aed3d
[ "Apache-2.0", "MIT" ]
1
2022-03-14T06:41:16.000Z
2022-03-14T06:41:16.000Z
package B::Hooks::EndOfScope; # git description: 0.20-3-ge7283e2 # ABSTRACT: Execute code after a scope finished compilation # KEYWORDS: code hooks execution scope use strict; use warnings; our $VERSION = '0.21'; # note - a %^H tie() fallback will probably work on 5.6 as well, # if you need to go that low - sane patches passing *all* tests # will be gladly accepted use 5.008001; BEGIN { use Module::Implementation 0.05; Module::Implementation::build_loader_sub( implementations => [ 'XS', 'PP' ], symbols => [ 'on_scope_end' ], )->(); } use Sub::Exporter::Progressive 0.001006 -setup => { exports => [ 'on_scope_end' ], groups => { default => ['on_scope_end'] }, }; 1; __END__ =pod =encoding UTF-8 =head1 NAME B::Hooks::EndOfScope - Execute code after a scope finished compilation =head1 VERSION version 0.21 =head1 SYNOPSIS on_scope_end { ... }; =head1 DESCRIPTION This module allows you to execute code when perl finished compiling the surrounding scope. =head1 FUNCTIONS =head2 on_scope_end on_scope_end { ... }; on_scope_end $code; Registers C<$code> to be executed after the surrounding scope has been compiled. This is exported by default. See L<Sub::Exporter> on how to customize it. =head1 PURE-PERL MODE CAVEAT While L<Variable::Magic> has access to some very dark sorcery to make it possible to throw an exception from within a callback, the pure-perl implementation does not have access to these hacks. Therefore, what would have been a compile-time exception is instead converted to a warning, and your execution will continue as if the exception never happened. To explicitly request an XS (or PP) implementation one has two choices. Either to import from the desired implementation explicitly: use B::Hooks::EndOfScope::XS or use B::Hooks::EndOfScope::PP or by setting C<$ENV{B_HOOKS_ENDOFSCOPE_IMPLEMENTATION}> to either C<XS> or C<PP>. =head1 SEE ALSO L<Sub::Exporter> L<Variable::Magic> =head1 SUPPORT Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=B-Hooks-EndOfScope> (or L<bug-B-Hooks-EndOfScope@rt.cpan.org|mailto:bug-B-Hooks-EndOfScope@rt.cpan.org>). =head1 AUTHORS =over 4 =item * Florian Ragwitz <rafl@debian.org> =item * Peter Rabbitson <ribasushi@cpan.org> =back =head1 CONTRIBUTORS =for stopwords Karen Etheridge Christian Walde Simon Wilper Tatsuhiko Miyagawa Tomas Doran =over 4 =item * Karen Etheridge <ether@cpan.org> =item * Christian Walde <walde.christian@googlemail.com> =item * Simon Wilper <sxw@chronowerks.de> =item * Tatsuhiko Miyagawa <miyagawa@bulknews.net> =item * Tomas Doran <bobtfish@bobtfish.net> =back =head1 COPYRIGHT AND LICENCE This software is copyright (c) 2008 by Florian Ragwitz. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut
20.027397
120
0.73974
73f201a5eb3919da4e1f976b75146a3a93a8e707
5,237
pl
Perl
scripts/P1_run_fold_recognition/combine_prediction_with_template_ECOD_H.pl
heitorsampaio/DeepPM
b51283eb10f465f0cb776cae96e34c4fb05d0508
[ "MIT" ]
null
null
null
scripts/P1_run_fold_recognition/combine_prediction_with_template_ECOD_H.pl
heitorsampaio/DeepPM
b51283eb10f465f0cb776cae96e34c4fb05d0508
[ "MIT" ]
null
null
null
scripts/P1_run_fold_recognition/combine_prediction_with_template_ECOD_H.pl
heitorsampaio/DeepPM
b51283eb10f465f0cb776cae96e34c4fb05d0508
[ "MIT" ]
null
null
null
#!/usr/bin/perl -w # if (@ARGV != 7) { print "Usage: <input> <output>\n"; exit; } $test_file = $ARGV[0];# $prediction_dir = $ARGV[1]; # $Traindatalist = $ARGV[2]; $temp_dir = $ARGV[3]; # $fold_description = $ARGV[4]; # $family_description = $ARGV[5]; # $outdir = $ARGV[6]; open(IN1,"$fold_description")|| die("Failed to open file $fold_description \n"); %fold_class_description=(); %fold_class_scopid=(); %ecodname2id=(); %ecodname2id_2=(); %family2scopid=(); %family2scopid_v2=(); while(<IN1>) { $line=$_; chomp $line; @array = split(/\t/,$line); $scopname=$array[0]; $scopname2=$array[2]; $scopid=$array[1]; $ecodname2id{$scopname}=$scopid; $ecodname2id_2{$scopname2}=$scopid; $classlabel=$array[3]; # X.1.1.1.1 $family2scopid{$scopname}=$classlabel; $family2scopid_v2{$scopname2}=$classlabel; $descinfo=$array[4]; #ECOD|A: beta barrels|X: cradle loop barrel|H: RIFT-related|T: acid protease|F: A1_Propeptide,Asp @tmp=split(/\./,$classlabel); $class =$tmp[0].'.'. $tmp[1].'.'. $tmp[2]; @tmp2=split(/\|/,$descinfo); if(@tmp2 <3) { $desc = 'unknown'; }else{ $desc =$tmp2[1].'|'. $tmp2[2]; } $fold_class_description{$class} = $desc; $fold_class_scopid{$class} = $scopid; } close IN1; open(IN1,"$family_description")|| die("Failed to open file $family_description \n"); %family_class_description=(); %family_class_scopid=(); while(<IN1>) { $line=$_; chomp $line; @array = split(/\t/,$line); $scopid=$array[1]; $classlabel=$array[3]; # X.1.1.1.1 $descinfo=$array[4]; #ECOD|A: beta barrels|X: cradle loop barrel|H: RIFT-related|T: acid protease|F: A1_Propeptide,Asp @tmp=split(/\./,$classlabel); $class =$tmp[0].'.'. $tmp[1].'.'. $tmp[2]; #print "$descinfo\n"; @tmp2=split(/\|/,$descinfo); if(@tmp2 <3) { $desc = 'unknown'; }else{ $desc =$tmp2[1].'|'. $tmp2[2]; } $family_class_description{$class} = $desc; $family_class_scopid{$class} = $scopid; } close IN1; open(IN1,"$Traindatalist")|| die("Failed to open file $Traindatalist \n"); %pro2label=(); while(<IN1>) { $line=$_; chomp $line; @temp = split(/\t/,$line); $qid = $temp[0]; $label = $temp[2]; $pro2label{$qid} =$label; } close IN1; open(IN1,"$test_file")|| die("Failed to open file $test_file \n"); $c=0; while(<IN1>){ $c++; $line = $_; chomp $line; @temp = split(/\t/,$line); $qid = $temp[0]; $predictionfile = "$prediction_dir/$qid.rank_list"; $temp_dir_target = "$temp_dir/${qid}_top5_folds_info";#Jie3-KL-hidden-out/score_ranking_dir/d1ri9a__top5_folds_info/ if(!(-e $predictionfile)) { die "Failed to find $predictionfile\n"; } $outputdir="$outdir/$qid"; if(-d $outputdir) { `rm -rf $outputdir/*`; }else{ `mkdir $outputdir`; } open(IN,"$predictionfile") || die "Failed to open file $predictionfile\n"; open(OUT,">$outputdir/DeepPM_summary.txt") || die "Failed to open file $outputdir/DeepPM_summary.txt\n"; @content = <IN>; close IN; $title = shift @content; chomp $title; print OUT "$title\tTemplate\tKL\tTemplate_id\tModel_src\tModel_des\tfold_des\tfold_id\tfamily_des\tfamily_id\n"; $c = 0; foreach $line (@content) { chomp $line; $c++; if($c >5) { last; } @tmp = split(/\t/,$line); #1 b.34 315 0.72448 $rank = $tmp[0]; $fold = $tmp[1]; $KL_fold_file = "$temp_dir_target/fold_$fold"; open(TMP,"$KL_fold_file") || die "Failed to open file $KL_fold_file\n"; @content2 = <TMP>; close TMP; $tem = shift @content2; chomp $tem; @tmp2 = split(/\t/,$tem); #d1ri9a_ d1nppa2 49.6640641119938 Unknown b.34 $tempname = $tmp2[1]; $KL = $tmp2[2]; $temlabel = $pro2label{$tempname}; $temlabel_ecodid='unknown'; $temlabel_ecodidfamily='unknown'; if(exists($ecodname2id{$tempname})) { $temlabel_ecodid=$ecodname2id{$tempname}; }elsif(exists($ecodname2id_2{$tempname})) { $temlabel_ecodid=$ecodname2id_2{$tempname}; }else{ print "Unknown ecod id for $tempname\n"; } if(exists($family2scopid{$tempname})) { $temlabel_ecodidfamily=$family2scopid{$tempname}; }elsif(exists($family2scopid_v2{$tempname})) { $temlabel_ecodidfamily=$family2scopid_v2{$tempname}; }else{ print "Unknown ecod id for $tempname\n"; } #print "$tem\n"; $pdbfile = "$temp_dir_target/fold_${fold}_atom/$tempname.pdb"; if(!(-e $pdbfile)) { print "Couldn't find $pdbfile\n"; } `cp $pdbfile $outputdir/DeepPM_top${rank}_model.pdb`; if(exists($fold_class_description{$fold})) { $des= $fold_class_description{$fold}; $sid= $fold_class_scopid{$fold}; }else{ $des='Not annotated!Report Error!'; $sid='Not annotated!Report Error!'; } if(exists($family_class_description{$temlabel})) { $fa_des= $family_class_description{$temlabel}; $fa_sid= $family_class_scopid{$temlabel}; }else{ $fa_des='Not annotated!Report Error!'; $fa_sid='Not annotated!Report Error!'; } print OUT "$line\t$tempname\t$KL\t$temlabel\t$pdbfile\t$outputdir/DeepPM_top${rank}_model.pdb\t$des\t$temlabel_ecodid\t$fa_des\t$temlabel_ecodidfamily\n"; } close OUT; }
25.299517
157
0.620202
73f1fa78868bad8affcfb726c68f7abd23e4f3ee
9,630
pm
Perl
storage/oracle/zs/snmp/mode/shareusage.pm
petneli/centreon-plugins
d131e60a1859fdd0e959623de56e6e7512c669af
[ "Apache-2.0" ]
316
2015-01-18T20:37:21.000Z
2022-03-27T00:20:35.000Z
storage/oracle/zs/snmp/mode/shareusage.pm
petneli/centreon-plugins
d131e60a1859fdd0e959623de56e6e7512c669af
[ "Apache-2.0" ]
2,333
2015-04-26T19:10:19.000Z
2022-03-31T15:35:21.000Z
storage/oracle/zs/snmp/mode/shareusage.pm
petneli/centreon-plugins
d131e60a1859fdd0e959623de56e6e7512c669af
[ "Apache-2.0" ]
371
2015-01-18T20:37:23.000Z
2022-03-22T10:10:16.000Z
# # Copyright 2021 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for # service performance. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # package storage::oracle::zs::snmp::mode::shareusage; use base qw(centreon::plugins::templates::counter); use strict; use warnings; sub custom_usage_perfdata { my ($self, %options) = @_; my $label = $self->{result_values}->{label} . '_used'; my $value_perf = $self->{result_values}->{used}; if (defined($self->{instance_mode}->{option_results}->{free})) { $label = $self->{result_values}->{label} . '_free'; $value_perf = $self->{result_values}->{free}; } my %total_options = (); if ($self->{instance_mode}->{option_results}->{units} eq '%') { $total_options{total} = $self->{result_values}->{total}; $total_options{cast_int} = 1; } $self->{output}->perfdata_add( label => $label, unit => 'B', instances => $self->use_instances(extra_instance => $options{extra_instance}) ? $self->{result_values}->{display} : undef, value => $value_perf, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{thlabel}, %total_options), critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{thlabel}, %total_options), min => 0, max => $self->{result_values}->{total} ); } sub custom_usage_threshold { my ($self, %options) = @_; my ($exit, $threshold_value); $threshold_value = $self->{result_values}->{used}; $threshold_value = $self->{result_values}->{free} if (defined($self->{instance_mode}->{option_results}->{free})); if ($self->{instance_mode}->{option_results}->{units} eq '%') { $threshold_value = $self->{result_values}->{prct_used}; $threshold_value = $self->{result_values}->{prct_free} if (defined($self->{instance_mode}->{option_results}->{free})); } $exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{thlabel}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{thlabel}, exit_litteral => 'warning' } ]); return $exit; } sub custom_usage_output { my ($self, %options) = @_; my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{total}); my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used}); my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{free}); my $msg = sprintf("Usage Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", $total_size_value . " " . $total_size_unit, $total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used}, $total_free_value . " " . $total_free_unit, $self->{result_values}->{prct_free}); return $msg; } sub custom_usage_calc { my ($self, %options) = @_; $self->{result_values}->{label} = $options{extra_options}->{label_ref}; $self->{result_values}->{display} = $options{new_datas}->{$self->{instance} . '_display'}; $self->{result_values}->{total} = $options{new_datas}->{$self->{instance} . '_total'}; $self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'}; $self->{result_values}->{free} = $self->{result_values}->{total} - $self->{result_values}->{used}; $self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{total}; $self->{result_values}->{prct_free} = 100 - $self->{result_values}->{prct_used}; return 0; } sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ { name => 'project', type => 1, cb_prefix_output => 'prefix_project_output', message_multiple => 'All projects are ok' }, { name => 'share', type => 1, cb_prefix_output => 'prefix_share_output', message_multiple => 'All shares are ok' } ]; $self->{maps_counters}->{share} = [ { label => 'share-usage', set => { key_values => [ { name => 'display' }, { name => 'used' }, { name => 'total' } ], closure_custom_calc => $self->can('custom_usage_calc'), closure_custom_calc_extra_options => { label_ref => 'share' }, closure_custom_output => $self->can('custom_usage_output'), closure_custom_perfdata => $self->can('custom_usage_perfdata'), closure_custom_threshold_check => $self->can('custom_usage_threshold'), } }, ]; $self->{maps_counters}->{project} = [ { label => 'project-usage', set => { key_values => [ { name => 'display' }, { name => 'used' }, { name => 'total' } ], closure_custom_calc => $self->can('custom_usage_calc'), closure_custom_calc_extra_options => { label_ref => 'project' }, closure_custom_output => $self->can('custom_usage_output'), closure_custom_perfdata => $self->can('custom_usage_perfdata'), closure_custom_threshold_check => $self->can('custom_usage_threshold'), } }, ]; } sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; $options{options}->add_options(arguments => { "filter-name:s" => { name => 'filter_name' }, "filter-project:s" => { name => 'filter_project' }, "units:s" => { name => 'units', default => '%' }, "free" => { name => 'free' }, }); return $self; } sub prefix_share_output { my ($self, %options) = @_; return "Share '" . $options{instance_value}->{display} . "' "; } sub prefix_project_output { my ($self, %options) = @_; return "Project '" . $options{instance_value}->{display} . "' "; } my $mapping = { sunAkShareName => { oid => '.1.3.6.1.4.1.42.2.225.1.6.1.2' }, sunAkShareProject => { oid => '.1.3.6.1.4.1.42.2.225.1.6.1.4' }, sunAkShareSizeB => { oid => '.1.3.6.1.4.1.42.2.225.1.6.1.10' }, sunAkShareUsedB => { oid => '.1.3.6.1.4.1.42.2.225.1.6.1.11' }, }; my $oid_sunAkShareEntry = '.1.3.6.1.4.1.42.2.225.1.6.1'; sub manage_selection { my ($self, %options) = @_; if ($options{snmp}->is_snmpv1()) { $self->{output}->add_option_msg(short_msg => "Need to use SNMP v2c or v3."); $self->{output}->option_exit(); } $self->{share} = {}; $self->{project} = {}; my $snmp_result = $options{snmp}->get_table(oid => $oid_sunAkShareEntry, nothing_quit => 1); foreach my $oid (keys %{$snmp_result}) { next if ($oid !~ /^$mapping->{sunAkShareName}->{oid}\.(.*)$/); my $instance = $1; my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' && $result->{sunAkShareName} !~ /$self->{option_results}->{filter_name}/) { $self->{output}->output_add(long_msg => "skipping '" . $result->{sunAkShareName} . "': no matching filter.", debug => 1); next; } if (defined($self->{option_results}->{filter_project}) && $self->{option_results}->{filter_project} ne '' && $result->{sunAkShareProject} !~ /$self->{option_results}->{filter_project}/) { $self->{output}->output_add(long_msg => "skipping '" . $result->{sunAkShareName} . "': no matching filter.", debug => 1); next; } $self->{project}->{$result->{sunAkShareProject}} = { total => 0, used => 0, display => $result->{sunAkShareProject} } if (!defined($self->{project}->{$result->{sunAkShareProject}})); $self->{share}->{$instance} = { display => $result->{sunAkShareName}, total => $result->{sunAkShareSizeB}, used => $result->{sunAkShareUsedB}, }; $self->{project}->{$result->{sunAkShareProject}}->{total} += $result->{sunAkShareSizeB}; $self->{project}->{$result->{sunAkShareProject}}->{used} += $result->{sunAkShareUsedB}; } if (scalar(keys %{$self->{share}}) <= 0) { $self->{output}->add_option_msg(short_msg => "No share found."); $self->{output}->option_exit(); } } 1; __END__ =head1 MODE Check shares. =over 8 =item B<--filter-name> Filter share name (can be a regexp). =item B<--filter-project> Filter project name (can be a regexp). =item B<--warning-*> Threshold warning. Can be: 'share-usage', 'project-usage'. =item B<--critical-*> Threshold critical. Can be: 'share-usage', 'project-usage'. =item B<--units> Units of thresholds (Default: '%') ('%', 'B'). =item B<--free> Thresholds are on free space left. =back =cut
38.987854
236
0.59242
73e7c93cff71934efa90a2b917378422b30c393c
3,284
t
Perl
t/mojolicious/pod_renderer_lite_app.t
jjatria/mojo
693bbd4f312db41fc29ab3afd1f4a26e2b331801
[ "Artistic-2.0" ]
2
2020-12-10T14:40:03.000Z
2021-09-02T19:19:16.000Z
t/mojolicious/pod_renderer_lite_app.t
jjatria/mojo
693bbd4f312db41fc29ab3afd1f4a26e2b331801
[ "Artistic-2.0" ]
null
null
null
t/mojolicious/pod_renderer_lite_app.t
jjatria/mojo
693bbd4f312db41fc29ab3afd1f4a26e2b331801
[ "Artistic-2.0" ]
null
null
null
use Mojo::Base -strict; BEGIN { $ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll' } use Test::Mojo; use Test::More; use FindBin; use lib "$FindBin::Bin/lib"; use Mojolicious::Lite; # POD renderer plugin plugin('PODRenderer')->name('perldoc'); ok app->routes->find('perldoc'), 'route found'; # Default layout app->defaults(layout => 'gray'); get '/' => sub { my $c = shift; $c->render('simple', handler => 'pod'); }; post '/' => 'index'; post '/block'; get '/art'; get '/empty' => {inline => '', handler => 'pod'}; my $t = Test::Mojo->new; # Simple POD template $t->get_ok('/')->status_is(200) ->content_like(qr!<h1 id="Test123">Test123</h1>!) ->content_like(qr|<p>It <code>works</code>!</p>|); # POD helper $t->post_ok('/')->status_is(200)->content_like(qr!test123<h1 id="A">A</h1>!) ->content_like(qr!<h1 id="B">B</h1>!) ->content_like(qr!\s+<p><code>test</code></p>!)->content_like(qr/Gray/); # POD filter $t->post_ok('/block')->status_is(200) ->content_like(qr!test321<h2 id="lalala">lalala</h2>!) ->content_like(qr!<pre><code>\{\n foo\(\);\n\}</code></pre>!) ->content_like(qr!<p><code>test</code></p>!)->content_like(qr/Gray/); # Mixed indentation $t->get_ok('/art')->status_is(200)->text_like('h2[id="art"]' => qr/art/) ->text_like('pre code' => qr/\s{2}#\n#\s{3}#\n\s{2}#/); # Empty $t->get_ok('/empty')->status_is(200)->content_is(''); # Headings $t->get_ok('/perldoc/MojoliciousTest/PODTest')->status_is(200) ->element_exists('h1#One')->element_exists('h2#Two') ->element_exists('h3#Three')->element_exists('h4#Four') ->element_exists('a[href=#One]')->element_exists('a[href=#Two]') ->element_exists('a[href=#Three]')->element_exists('a[href=#Four]') ->text_like('pre code', qr/\$foo/); # Trailing slash $t->get_ok('/perldoc/MojoliciousTest/PODTest/')->element_exists('#mojobar') ->text_like('title', qr/PODTest/); # Format $t->get_ok('/perldoc/MojoliciousTest/PODTest.html')->element_exists('#mojobar') ->text_like('title', qr/PODTest/); # Format (source) $t->get_ok('/perldoc/MojoliciousTest/PODTest' => {Accept => 'text/plain'}) ->status_is(200)->content_type_is('text/plain;charset=UTF-8') ->content_like(qr/package MojoliciousTest::PODTest/); # Format (source with extension) $t->get_ok('/perldoc/MojoliciousTest/PODTest.txt' => {Accept => 'text/html,application/xhtml+xml,application/xml'}) ->status_is(200)->content_type_is('text/plain;charset=UTF-8') ->content_like(qr/package MojoliciousTest::PODTest/); # Negotiated source $t->get_ok('/perldoc/MojoliciousTest/PODTest' => {Accept => 'text/plain'}) ->status_is(200)->content_type_is('text/plain;charset=UTF-8') ->content_like(qr/package MojoliciousTest::PODTest/); # Perldoc browser (unsupported format) $t->get_ok('/perldoc/MojoliciousTest/PODTest.json')->status_is(204); # Welcome $t->get_ok('/perldoc')->status_is(200)->element_exists('#mojobar') ->text_like('title', qr/The Mojolicious Guide to the Galaxy/); done_testing(); __DATA__ @@ layouts/gray.html.ep Gray <%= content %> @@ index.html.ep test123<%= pod_to_html "=head1 A\n\n=head1 B\n\nC<test>"%> @@ block.html.ep test321<%= pod_to_html begin %>=head2 lalala { foo(); } C<test><% end %> @@ art.html.ep <%= pod_to_html begin %>=head2 art # # # # <% end %>
26.699187
79
0.654385
73f688f661d441bd9deffe2bd35ca9c514b510f5
11,357
pm
Perl
tests/console/verify_efi_mok.pm
lansuse/os-autoinst-distri-opensuse
8e8c532236f2436693ec1da426de563c9759d778
[ "FSFAP" ]
null
null
null
tests/console/verify_efi_mok.pm
lansuse/os-autoinst-distri-opensuse
8e8c532236f2436693ec1da426de563c9759d778
[ "FSFAP" ]
null
null
null
tests/console/verify_efi_mok.pm
lansuse/os-autoinst-distri-opensuse
8e8c532236f2436693ec1da426de563c9759d778
[ "FSFAP" ]
null
null
null
# SUSE's openQA tests # # Copyright 2021 SUSE LLC # # Copying and distribution of this file, with or without modification, # are permitted in any medium without royalty provided the copyright # notice and this notice are preserved. This file is offered as-is, # without any warranty. # # Package: efibootmgr openssl mokutil parted coreutils sbsigntools # Summary: Check EFI boot in images or after OS installation # Maintainer: Martin Loviska <mloviska@suse.com> use Mojo::Base 'opensusebasetest'; use testapi; use utils qw(zypper_call is_efi_boot); use version_utils qw(is_leap is_opensuse is_sle is_jeos); use Utils::Architectures; use jeos qw(reboot_image set_grub_gfxmode); use registration qw(add_suseconnect_product remove_suseconnect_product); use main_common qw(is_updates_tests); use constant { SYSFS_EFI_BITS => '/sys/firmware/efi/fw_platform_size', GRUB_DEFAULT => '/etc/default/grub', GRUB_CFG => '/boot/grub2/grub.cfg', SYSCONFIG_BOOTLADER => '/etc/sysconfig/bootloader', MOCK_CRT => '/boot/efi/EFI/mock.der' }; my @errors; sub get_expected_efi_settings { my $settings = {}; $settings->{label} = is_opensuse() ? lc(get_var('DISTRI')) : 'sles'; $settings->{mount} = '/boot/efi'; if (!get_var('DISABLE_SECUREBOOT', 0)) { $settings->{exec} = '/EFI/' . $settings->{label} . '/shim.efi'; $settings->{label} .= '-secureboot'; } else { $settings->{exec} = '/EFI/' . $settings->{label} . '/grubx64.efi'; } return $settings; } sub efibootmgr_current_boot { my $ebm_raw = script_output 'efibootmgr --verbose'; my $h = {}; ($h->{bootid}) = $ebm_raw =~ /^BootCurrent:\s+(\d+)/m; die 'Missing BootCurrent: in efibootmgr\'s output' unless $h->{bootid}; if ($ebm_raw =~ /^(Boot$h->{bootid}\*\s+(.+)\s+(\S+\([^\)]+\)\/?)+.*|Boot$h->{bootid}\*\s+(.+))$/m) { $h->{label} = $2 // $4; } (exists($h->{label}) && $h->{label}) or die "Missing label in Boot$h->{bootid} entry"; ($h->{exec}) = $ebm_raw =~ /^Boot$h->{bootid}\*.*File\(([^\)]+)\).*/m; defined($h->{exec}) && $h->{exec} =~ s'\\'/'g; return $h; } sub check_efi_state { is_efi_boot or die "Image did not boot in UEFI mode!\n"; my $expected = shift; # check UEFI firmware bitness validate_script_output 'cat ' . SYSFS_EFI_BITS, sub { $_ == 64 }; # check SecureBoot according to efivars # get data from efivars # {8be4df61-93ca-11d2-aa0d-00e098032b8c} {global} efi_guid_global EFI Global Variable # save only the first capture my ($efi_guid_global, undef) = script_output('efivar --list-guids') =~ /\{((\w+-){3,4}\w+)\}.*\s+efi_guid_global\s+/; diag "Found efi guid=$efi_guid_global"; diag('Expected state of SecureBoot: ' . (get_var('DISABLE_SECUREBOOT', 0) ? 'Disabled' : 'Enabled')); if (script_run("efivar -dn $efi_guid_global-SecureBoot") == !get_var('DISABLE_SECUREBOOT', 0)) { push @errors, 'System\'s SecureBoot state is unexpected according to efivar'; } # get current boot information from efibootmgr my $found = efibootmgr_current_boot; if (exists($expected->{exec}) && $expected->{exec}) { record_info "Expected", "EFI executable: $expected->{exec} ( $expected->{label} )"; record_info "Found", "EFI executable: $found->{exec} ( $found->{label} )"; unless (exists $found->{exec} && exists $found->{label} && $found->{exec} eq $expected->{exec} && $found->{label} eq $expected->{label}) { push @errors, 'No efi executable found by efibootmgr or SUT booted using unexpected efi binary'; } } else { record_info "Fallback", "EFI label: $found->{label}"; } if (!get_var('DISABLE_SECUREBOOT', 0) && $found->{exec} && $expected->{exec}) { diag("Check presence of signature in shim"); assert_script_run("pesign -S -i $expected->{mount}/$found->{exec}"); #check if MokListRT is present in kernel's keyring if (script_output('cat /proc/keys') !~ qr/Secure\s+Boot\s+CA/) { if (is_aarch64) { record_soft_failure 'bsc#1188366 - MokListRT is not loaded into keyring on aarch64'; } else { push @errors, 'No openSUSE/SUSE keys found in keyring(/proc/keys)'; } } } } sub check_mok { my $state = !get_var('DISABLE_SECUREBOOT', 0) ? qr/^SecureBoot\senabled$/ : qr/^SecureBoot\sdisabled$/; # check SecureBoot according to MOK diag('Expected regex used to verify SecureBoot: ' . $state); validate_script_output 'mokutil --sb-state', $state; if (script_output('mokutil --list-new', proceed_on_failure => 1) =~ /MokNew is empty/) { record_info 'MOK updates', 'No new certificates are expected to be enrolled'; } else { push @errors, 'No new boot certificates are expected'; } if (script_run(qq[mokutil --list-enrolled | tee /dev/$serialdev | grep -E "CN=.*SUSE"]) && !get_var('DISABLE_SECUREBOOT', 0)) { push @errors, 'SUSE nor openSUSE certificate has not been found by mokutil'; } # In 3rd test object with SecureBoot, tests creates, imports and enrolles a mock certificate that should be removed unless (script_run "test -f ${\MOCK_CRT}") { record_info 'MOK delete', 'Removing MOCK certificate'; assert_script_run 'mokutil --list-enrolled | grep -E "CN=MOCK"'; if (script_output("mokutil --delete ${\MOCK_CRT} --root-pw") =~ /SKIP:\s+${\MOCK_CRT}\s+is\s+not\s+in\s+MokList/) { push @errors, 'CN=MOCK certificate has not been found in MokList'; } assert_script_run "rm ${\MOCK_CRT}"; assert_script_run 'mokutil --list-delete'; } } sub get_esp_info { my $blk_dev_driver = { qemu => 'virtblk', svirt_xen => 'xvd', svirt_hyperv => 'scsi' }; # return a the first element (drive or partition number) from parted's output my ($drive, $esp_part_no); my $vbd = $blk_dev_driver->{join('_', grep { $_ } (get_required_var('BACKEND'), get_var('VIRSH_VMM_FAMILY')))}; foreach my $line (split(/\n/, script_output('parted --list --machine --script'))) { if (!defined($drive) && $line =~ /gpt/ && $line =~ /$vbd/) { ($drive) = split(/:/, $line, 2); } # older versions of parted used in sle12+ do not detect ESP specifically # it is only labelled with "boot" flag instead of "boot, esp" as in sle15+ if (!defined($esp_part_no) && $line =~ /boot,\s?esp|boot/) { ($esp_part_no) = split(/:/, $line, 2); } } ($drive && $esp_part_no) or die "No ESP partition or GPT drive was detected from parted's output"; my ($esp_fs, $esp_mp) = split /\s+/, script_output "df --output=fstype,target --local $drive$esp_part_no | sed -e /^Type/d"; ($esp_fs && $esp_mp) or die "No mounted ESP partition was not found!\n"; assert_script_run "parted --script $drive align-check optimal $esp_part_no"; return {drive => $drive, partition => "$drive$esp_part_no", fs => $esp_fs, mount => $esp_mp}; } sub verification { my ($self, $msg, $expected, $setup) = @_; $setup->() if ($setup && ref($setup) eq 'CODE'); $self->reboot_image($msg) if ($msg); check_efi_state $expected; check_mok; } sub run { my $self = shift; $self->select_serial_terminal; is_efi_boot or die "Image did not boot in UEFI mode!\n"; my $pkgs = 'efivar mokutil'; $pkgs .= ' dosfstools' if (is_leap('<15.2') || is_sle('<15-sp2')); $pkgs .= ' pesign' unless get_var('DISABLE_SECUREBOOT', 0); zypper_call "in $pkgs"; my $esp_details = get_esp_info; # run fs check on ESP record_info "ESP", "Partition [$esp_details->{partition}], \nFilesystem [$esp_details->{fs}],\nMountPoint [$esp_details->{mount}]"; assert_script_run "umount $esp_details->{mount}"; assert_script_run "fsck.vfat -vV $esp_details->{partition}"; assert_script_run "mount $esp_details->{mount}"; # SUT can boot from removable (firstboot of HDD, ISO, USB bootable medium) or boot entry (non-removable) # JeOS always boots firstly from removable, but the boot record will be changed to non-removable by updates # Therefore the expected boot for JeOS under development and maintenance updates test slow might be different # Installed SUT by YaST2 boots from non-removable by default my $exp_data = get_expected_efi_settings; my $booted_from_removable = is_jeos; if ($booted_from_removable && is_updates_tests) { # Updates got installed, so it might no longer be removable $booted_from_removable = efibootmgr_current_boot()->{label} ne $exp_data->{label}; } ## default efi boot, no restart, but set gfxmode before reboot $self->verification(undef, $booted_from_removable ? undef : $exp_data, sub { set_grub_gfxmode; assert_script_run('grub2-script-check --verbose ' . GRUB_CFG); } ); ## Test efi without secure boot if (get_var('DISABLE_SECUREBOOT')) { $self->verification('After grub2-install', $exp_data, sub { assert_script_run('sed -ie s/SECURE_BOOT=.*/SECURE_BOOT=no/ ' . SYSCONFIG_BOOTLADER); assert_script_run "grub2-install --efi-directory=$esp_details->{mount} --target=x86_64-efi $esp_details->{drive}"; assert_script_run('grub2-mkconfig -o ' . GRUB_CFG); } ); } else { ## Test efi with secure boot # enable verbosity in shim assert_script_run 'mokutil --set-verbosity true'; $self->verification('After shim-install', $exp_data, sub { assert_script_run('rpm -q shim'); assert_script_run('shim-install --config-file=' . GRUB_CFG); assert_script_run('grub2-mkconfig -o ' . GRUB_CFG); } ); $self->verification('Import mock key to MOK', $exp_data, sub { assert_script_run 'openssl req -new -x509 -newkey rsa:2048 -sha256 -keyout key.asc -out cert.pem -nodes -days 666 -subj "/CN=MOCK/"'; assert_script_run "openssl x509 -in cert.pem -outform der -out ${\MOCK_CRT}"; assert_script_run "mokutil --import ${\MOCK_CRT} --root-pw"; assert_script_run 'mokutil --list-new'; set_var('_EXPECT_EFI_MOK_MANAGER', 1); } ) if get_var('CHECK_MOK_IMPORT'); } ## Keep previous configuration $self->verification('After pbl reinit', $exp_data, sub { my $state = !get_var('DISABLE_SECUREBOOT', 0) ? 'yes' : 'no'; assert_script_run(q|egrep "SECURE_BOOT=['\"]?| . $state . q|[\"']?" | . SYSCONFIG_BOOTLADER); assert_script_run 'update-bootloader --reinit'; } ); set_var('_EXPECT_EFI_MOK_MANAGER', 0); # Print errors die join("\n", @errors) if (@errors); } sub post_fail_hook { set_var('_EXPECT_EFI_MOK_MANAGER', 0); select_console('log-console'); upload_logs(GRUB_DEFAULT, log_name => 'etc_default_grub.txt'); upload_logs(GRUB_CFG, log_name => 'grub.cfg'); upload_logs(SYSCONFIG_BOOTLADER, log_name => 'etc_sysconfig_bootloader.txt'); upload_logs('/etc/fstab', log_name => 'fstab.txt'); } 1;
43.347328
149
0.624197
ed359aa46b53b9745820fc70079c3f29f8c772db
1,840
pl
Perl
src/condor_tests/job_core_perremove-true_sched.pl
zhangzhehust/htcondor
e07510d62161f38fa2483b299196ef9a7b9f7941
[ "Apache-2.0" ]
1
2017-02-13T01:25:34.000Z
2017-02-13T01:25:34.000Z
src/condor_tests/job_core_perremove-true_sched.pl
AmesianX/htcondor
10aea32f1717637972af90459034d1543004cb83
[ "Apache-2.0" ]
1
2021-04-06T04:19:40.000Z
2021-04-06T04:19:40.000Z
src/condor_tests/job_core_perremove-true_sched.pl
AmesianX/htcondor
10aea32f1717637972af90459034d1543004cb83
[ "Apache-2.0" ]
2
2016-05-24T17:12:13.000Z
2017-02-13T01:25:35.000Z
#! /usr/bin/env perl ##************************************************************** ## ## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, ## University of Wisconsin-Madison, WI. ## ## Licensed under the Apache License, Version 2.0 (the "License"); you ## may not use this file except in compliance with the License. You may ## obtain a copy of the License at ## ## http://www.apache.org/licenses/LICENSE-2.0 ## ## Unless required by applicable law or agreed to in writing, software ## distributed under the License is distributed on an "AS IS" BASIS, ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## See the License for the specific language governing permissions and ## limitations under the License. ## ##************************************************************** use CondorTest; $cmd = 'job_core_perremove-true_sched.cmd'; $testdesc = 'Condor submit policy test for PERIODIC_REMOVE - scheduler U'; $testname = "job_core_perremove_sched"; my $killedchosen = 0; my %args; my $cluster; $aborted = sub { CondorTest::debug("Abort event expected from periodic_remove policy evaluating to true\n",1); CondorTest::debug("Policy test worked.\n",1); }; $executed = sub { %args = @_; $cluster = $args{"cluster"}; CondorTest::debug("Good. for on_exit_remove cluster $cluster must run first\n",1); }; my $on_evictedwithoutcheckpoint = sub { CondorTest::debug("Evicted Without Checkpoint from removing jobs.\n",1); }; CondorTest::RegisterEvictedWithoutCheckpoint($testname, $on_evictedwithoutcheckpoint); CondorTest::RegisterExecute($testname, $executed); CondorTest::RegisterAbort( $testname, $aborted ); if( CondorTest::RunTest($testname, $cmd, 0) ) { CondorTest::debug("$testname: SUCCESS\n",1); exit(0); } else { die "$testname: CondorTest::RunTest() failed\n"; }
31.186441
94
0.678804
ed1d8941f5eb75bd192a06d03b220e238eb44ddf
2,438
pm
Perl
tests/nfs/generate_report.pm
punkioudi/os-autoinst-distri-opensuse
de35faa5321855e6cebe74526de8d6b90093d178
[ "FSFAP" ]
1
2020-06-19T10:23:42.000Z
2020-06-19T10:23:42.000Z
tests/nfs/generate_report.pm
punkioudi/os-autoinst-distri-opensuse
de35faa5321855e6cebe74526de8d6b90093d178
[ "FSFAP" ]
null
null
null
tests/nfs/generate_report.pm
punkioudi/os-autoinst-distri-opensuse
de35faa5321855e6cebe74526de8d6b90093d178
[ "FSFAP" ]
null
null
null
# SUSE's openQA tests # # Copyright 2021 SUSE LLC # SPDX-License-Identifier: FSFAP # # Summary: Upload logs and generate report # Maintainer: Yong Sun <yosun@suse.com> package generate_report; use strict; use warnings; use base 'opensusebasetest'; use File::Basename; use testapi; use upload_system_log; sub upload_pynfs_log { my $self = shift; my $folder = get_required_var('PYNFS'); assert_script_run("cd ~/pynfs/$folder"); upload_logs('result-raw.txt', failok => 1); script_run('../showresults.py result-raw.txt > result-analysis.txt'); upload_logs('result-analysis.txt', failok => 1); script_run('../showresults.py --hidepass result-raw.txt > result-fail.txt'); upload_logs('result-fail.txt', failok => 1); if (script_run('[ -s result-fail.txt ]') == 0) { $self->result("fail"); record_info("failed tests", script_output('cat result-fail.txt'), result => 'fail'); } } sub upload_cthon04_log { my $self = shift; assert_script_run('cd ~/cthon04'); if (script_output("grep 'All tests completed' ./result* | wc -l") =~ '4') { record_info('Complete', "All tests completed"); } else { $self->result("fail"); record_info("Test fail: Not all test completed"); } if (script_output("grep ' ok.' ./result_basic_test.txt | wc -l") =~ '9') { record_info('Pass', "Basic test pass"); } else { $self->result("fail"); record_info('Fail', "Basic test failed"); } if (script_output("egrep ' ok|success' ./result_special_test.txt | wc -l") =~ '7') { record_info('Pass', "Special test pass"); } else { $self->result("fail"); record_info('Fail', "Special test failed"); } if (script_run("grep 'Congratulations' ./result_lock_test.txt")) { $self->result("fail"); record_info('Fail', "Lock test failed"); } else { record_info('Pass', "Lock test pass"); } upload_logs('result_basic_test.txt', failok => 1); upload_logs('result_general_test.txt', failok => 1); upload_logs('result_special_test.txt', failok => 1); upload_logs('result_lock_test.txt', failok => 1); } sub run { my $self = shift; $self->select_serial_terminal; if (get_var("PYNFS")) { $self->upload_pynfs_log(); } elsif (get_var("CTHON04")) { $self->upload_cthon04_log(); } upload_system_logs(); } 1;
27.704545
92
0.614438
ed3100b78d9eca586d773a562bf5ef6a120fad67
2,517
perl
Perl
verification/testF/check_1c.perl
maranGit/warp3d
59dc665146c7cd40a9b604a1267178bfe2b1c147
[ "NCSA" ]
null
null
null
verification/testF/check_1c.perl
maranGit/warp3d
59dc665146c7cd40a9b604a1267178bfe2b1c147
[ "NCSA" ]
null
null
null
verification/testF/check_1c.perl
maranGit/warp3d
59dc665146c7cd40a9b604a1267178bfe2b1c147
[ "NCSA" ]
null
null
null
# # WARP3D verification system # ========================== # # check results for test_1c # $inputfile = 'out_1c'; print "\n\t... Check results: $inputfile\n"; open(infile, "$inputfile") or die " >> Fatal Error. could not open: $inputfile\n >> Aborting this verification segment\n\n"; print "\t ... output file opened ...\n"; # find_line( 1, "average minimum" ); # # get line with domain component values. print value # $line = <infile>; @parts = split( / +/, $line); # $answer = "0.2137E-01"; $partno = 1; # $message = " "; if ( $answer ne $parts[$partno] ) { $message = "\t\t **** difference in solution"; } # print "\t ... comparison value: $answer","\n"; print "\t ... value from output file: ", "$parts[$partno]$message\n"; print "\t ... done\n"; close infile; exit; #********************************************************** #* * #* find_line * #* * #********************************************************** sub find_line { my ( $type, $string ) = @_; my ( $line, $debug ); $debug = 0; # if( $debug == 1 ) { print " type: ", $type, "\n"; print " string: ", $string, "\n"; print " file: ", $file, "\n"; } # while ( !eof(infile) ) { $line = <infile>; if( $line =~ /$string/ ) {return}; } # print "\n>>> Fatal Error. string search type: ",$type; print "\n Searching for string: ", "\"",$string,"\" failed"; print "\n Aborting this verification segment\n\n"; exit; } #********************************************************** #* * #* skip_lines * #* * #********************************************************** sub skip_lines { my ( $type, $nlines ) = @_; my ( $line, $debug, $count ); $debug = 0; # if( $debug == 1 ) { print " type: ", $type, "\n"; print " nlines: ", $nlines, "\n"; } # $count = 0; while ( !eof(infile) ) { $line = <infile>; $count++; if( $count == $nlines ) {return}; } # print "\n>>> Fatal Error. EOF reached beofre skip lines type: ",$type; print "\n Aborting this verification segment\n\n"; exit; }
26.776596
92
0.386969
ed0dd95563b6a38adf0b409e454190892360ac6f
166,384
pl
Perl
miniserv.pl
saydulk/webmin
edc758ae429898438ce1b004fdacf75f187ae7ca
[ "BSD-3-Clause" ]
null
null
null
miniserv.pl
saydulk/webmin
edc758ae429898438ce1b004fdacf75f187ae7ca
[ "BSD-3-Clause" ]
null
null
null
miniserv.pl
saydulk/webmin
edc758ae429898438ce1b004fdacf75f187ae7ca
[ "BSD-3-Clause" ]
13
2017-09-25T21:59:36.000Z
2019-06-18T14:31:57.000Z
#!/usr/local/bin/perl # A very simple perl web server used by Webmin # Require basic libraries package miniserv; use Socket; use POSIX; use Time::Local; eval "use Time::HiRes;"; @itoa64 = split(//, "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); # Find and read config file if ($ARGV[0] eq "--nofork") { $nofork_argv = 1; shift(@ARGV); } if (@ARGV != 1) { die "Usage: miniserv.pl <config file>"; } if ($ARGV[0] =~ /^([a-z]:)?\//i) { $config_file = $ARGV[0]; } else { chop($pwd = `pwd`); $config_file = "$pwd/$ARGV[0]"; } %config = &read_config_file($config_file); if ($config{'perllib'}) { push(@INC, split(/:/, $config{'perllib'})); $ENV{'PERLLIB'} .= ':'.$config{'perllib'}; } @startup_msg = ( ); # Check if SSL is enabled and available if ($config{'ssl'}) { eval "use Net::SSLeay"; if (!$@) { $use_ssl = 1; # These functions only exist for SSLeay 1.0 eval "Net::SSLeay::SSLeay_add_ssl_algorithms()"; eval "Net::SSLeay::load_error_strings()"; if (defined(&Net::SSLeay::X509_STORE_CTX_get_current_cert) && defined(&Net::SSLeay::CTX_load_verify_locations) && (defined(&Net::SSLeay::CTX_set_verify) || defined(&Net::SSLeay::set_verify))) { $client_certs = 1; } } } # Check if IPv6 is enabled and available if ($config{'ipv6'}) { eval "use Socket6"; if (!$@) { push(@startup_msg, "IPv6 support enabled"); $use_ipv6 = 1; } else { push(@startup_msg, "IPv6 support cannot be enabled without ". "the Socket6 perl module"); } } # Check if the syslog module is available to log hacking attempts if ($config{'syslog'} && !$config{'inetd'}) { eval "use Sys::Syslog qw(:DEFAULT setlogsock)"; if (!$@) { $use_syslog = 1; } } # check if the TCP-wrappers module is available if ($config{'libwrap'}) { eval "use Authen::Libwrap qw(hosts_ctl STRING_UNKNOWN)"; if (!$@) { $use_libwrap = 1; } } # Check if the MD5 perl module is available eval "use MD5; \$dummy = new MD5; \$dummy->add('foo');"; if (!$@) { $use_md5 = "MD5"; } else { eval "use Digest::MD5; \$dummy = new Digest::MD5; \$dummy->add('foo');"; if (!$@) { $use_md5 = "Digest::MD5"; } } if ($use_md5) { push(@startup_msg, "Using MD5 module $use_md5"); } # Get miniserv's perl path and location $miniserv_path = $0; open(SOURCE, $miniserv_path); <SOURCE> =~ /^#!(\S+)/; $perl_path = $1; close(SOURCE); if (!-x $perl_path) { $perl_path = $^X; } if (-l $perl_path) { $linked_perl_path = readlink($perl_path); } @miniserv_argv = @ARGV; # Check vital config options &update_vital_config(); $sidname = $config{'sidname'}; die "Session authentication cannot be used in inetd mode" if ($config{'inetd'} && $config{'session'}); # check if the PAM module is available to authenticate if ($config{'assume_pam'}) { # Just assume that it will work. This can also be used to work around # a Solaris bug in which using PAM before forking caused it to fail # later! $use_pam = 1; } elsif (!$config{'no_pam'}) { eval "use Authen::PAM;"; if (!$@) { # check if the PAM authentication can be used by opening a # PAM handle local $pamh; if (ref($pamh = new Authen::PAM($config{'pam'}, $config{'pam_test_user'}, \&pam_conv_func))) { # Now test a login to see if /etc/pam.d/webmin is set # up properly. $pam_conv_func_called = 0; $pam_username = "test"; $pam_password = "test"; $pamh->pam_authenticate(); if ($pam_conv_func_called) { push(@startup_msg, "PAM authentication enabled"); $use_pam = 1; } else { push(@startup_msg, "PAM test failed - maybe ". "/etc/pam.d/$config{'pam'} does not exist"); } } else { push(@startup_msg, "PAM initialization of Authen::PAM failed"); } } else { push(@startup_msg, "Perl module Authen::PAM needed for PAM is ". "not installed : $@"); } } if ($config{'pam_only'} && !$use_pam) { foreach $msg (@startup_msg) { print STDERR $msg,"\n"; } print STDERR "PAM use is mandatory, but could not be enabled!\n"; print STDERR "no_pam and pam_only both are set!\n" if ($config{no_pam}); exit(1); } elsif ($pam_msg && !$use_pam) { push(@startup_msg, "Continuing without the Authen::PAM perl module"); } # Check if the User::Utmp perl module is installed if ($config{'utmp'}) { eval "use User::Utmp;"; if (!$@) { $write_utmp = 1; push(@startup_msg, "UTMP logging enabled"); } else { push(@startup_msg, "Perl module User::Utmp needed for Utmp logging is ". "not installed : $@"); } } # See if the crypt function fails eval "crypt('foo', 'xx')"; if ($@) { eval "use Crypt::UnixCrypt"; if (!$@) { $use_perl_crypt = 1; push(@startup_msg, "Using Crypt::UnixCrypt for password encryption"); } else { push(@startup_msg, "crypt() function un-implemented, and Crypt::UnixCrypt ". "not installed - password authentication will fail"); } } # Check if /dev/urandom really generates random IDs, by calling it twice local $rand1 = &generate_random_id("foo", 1); local $rand2 = &generate_random_id("foo", 2); if ($rand1 eq $rand2) { $bad_urandom = 1; push(@startup_msg, "Random number generator file /dev/urandom is not reliable"); } # Check if we can call sudo if ($config{'sudo'} && &has_command("sudo")) { eval "use IO::Pty"; if (!$@) { $use_sudo = 1; } else { push(@startup_msg, "Perl module IO::Pty needed for calling sudo is not ". "installed : $@"); } } # init days and months for http_date @weekday = ( "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ); @month = ( "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ); # Change dir to the server root @roots = ( $config{'root'} ); for($i=0; defined($config{"extraroot_$i"}); $i++) { push(@roots, $config{"extraroot_$i"}); } chdir($roots[0]); eval { $user_homedir = (getpwuid($<))[7]; }; if ($@) { # getpwuid doesn't work on windows $user_homedir = $ENV{"HOME"} || $ENV{"USERPROFILE"} || "/"; $on_windows = 1; } # Read users file &read_users_file(); # Setup SSL if possible and if requested if (!-r $config{'keyfile'}) { # Key file doesn't exist! if ($config{'keyfile'}) { print STDERR "SSL key file $config{'keyfile'} does not exist\n"; } $use_ssl = 0; } elsif ($config{'certfile'} && !-r $config{'certfile'}) { # Cert file doesn't exist! print STDERR "SSL cert file $config{'certfile'} does not exist\n"; $use_ssl = 0; } @ipkeys = &get_ipkeys(\%config); if ($use_ssl) { if ($config{'ssl_version'}) { # Force an SSL version $Net::SSLeay::version = $config{'ssl_version'}; $Net::SSLeay::ssl_version = $config{'ssl_version'}; } $client_certs = 0 if (!-r $config{'ca'} || !%certs); $ssl_contexts{"*"} = &create_ssl_context($config{'keyfile'}, $config{'certfile'}, $config{'extracas'}); foreach $ipkey (@ipkeys) { $ctx = &create_ssl_context($ipkey->{'key'}, $ipkey->{'cert'}, $ipkey->{'extracas'} || $config{'extracas'}); foreach $ip (@{$ipkey->{'ips'}}) { $ssl_contexts{$ip} = $ctx; } } # Setup per-hostname SSL contexts on the main IP if (defined(&Net::SSLeay::CTX_set_tlsext_servername_callback)) { Net::SSLeay::CTX_set_tlsext_servername_callback( $ssl_contexts{"*"}, sub { my $ssl = shift; my $h = Net::SSLeay::get_servername($ssl); my $c = $ssl_contexts{$h} || $h =~ /^[^\.]+\.(.*)$/ && $ssl_contexts{"*.$1"}; if ($c) { Net::SSLeay::set_SSL_CTX($ssl, $c); } }); } } # Load gzip library if enabled if ($config{'gzip'} eq '1') { eval "use Compress::Zlib"; if (!$@) { $use_gzip = 1; } } # Setup syslog support if possible and if requested if ($use_syslog) { open(ERRDUP, ">&STDERR"); open(STDERR, ">/dev/null"); $log_socket = $config{"logsock"} || "unix"; eval 'openlog($config{"pam"}, "cons,pid,ndelay", "authpriv"); setlogsock($log_socket)'; if ($@) { $use_syslog = 0; } else { local $msg = ucfirst($config{'pam'})." starting"; eval { syslog("info", "%s", $msg); }; if ($@) { eval { setlogsock("inet"); syslog("info", "%s", $msg); }; if ($@) { # All attempts to use syslog have failed.. $use_syslog = 0; } } } open(STDERR, ">&ERRDUP"); close(ERRDUP); } # Read MIME types file and add extra types &read_mime_types(); # get the time zone if ($config{'log'}) { local(@gmt, @lct, $days, $hours, $mins); @gmt = gmtime(time()); @lct = localtime(time()); $days = $lct[3] - $gmt[3]; $hours = ($days < -1 ? 24 : 1 < $days ? -24 : $days * 24) + $lct[2] - $gmt[2]; $mins = $hours * 60 + $lct[1] - $gmt[1]; $timezone = ($mins < 0 ? "-" : "+"); $mins = abs($mins); $timezone .= sprintf "%2.2d%2.2d", $mins/60, $mins%60; } # Build various maps from the config files &build_config_mappings(); # start up external authentication program, if needed if ($config{'extauth'}) { socketpair(EXTAUTH, EXTAUTH2, AF_UNIX, SOCK_STREAM, PF_UNSPEC); if (!($extauth = fork())) { close(EXTAUTH); close(STDIN); close(STDOUT); open(STDIN, "<&EXTAUTH2"); open(STDOUT, ">&EXTAUTH2"); exec($config{'extauth'}) or die "exec failed : $!\n"; } close(EXTAUTH2); local $os = select(EXTAUTH); $| = 1; select($os); } # Pre-load any libraries if (!$config{'inetd'}) { foreach $pl (split(/\s+/, $config{'preload'})) { ($pkg, $lib) = split(/=/, $pl); $pkg =~ s/[^A-Za-z0-9]/_/g; eval "package $pkg; do '$config{'root'}/$lib'"; if ($@) { print STDERR "Failed to pre-load $lib in $pkg : $@\n"; } else { print STDERR "Pre-loaded $lib in $pkg\n"; } } foreach $pl (split(/\s+/, $config{'premodules'})) { if ($pl =~ /\//) { ($dir, $mod) = split(/\//, $pl); } else { ($dir, $mod) = (undef, $pl); } push(@INC, "$config{'root'}/$dir"); eval "package $mod; use $mod ()"; if ($@) { print STDERR "Failed to pre-load $mod : $@\n"; } else { print STDERR "Pre-loaded $mod\n"; } } } # Open debug log if set if ($config{'debuglog'}) { open(DEBUG, ">>$config{'debuglog'}"); chmod(0700, $config{'debuglog'}); select(DEBUG); $| = 1; select(STDOUT); print DEBUG "miniserv.pl starting ..\n"; } # Write out (empty) blocked hosts file &write_blocked_file(); # Initially read webmin cron functions and last execution times &read_webmin_crons(); %webmincron_last = ( ); &read_file($config{'webmincron_last'}, \%webmincron_last); # Pre-cache lang files &precache_files(); if ($config{'inetd'}) { # We are being run from inetd - go direct to handling the request &redirect_stderr_to_log(); $SIG{'HUP'} = 'IGNORE'; $SIG{'TERM'} = 'DEFAULT'; $SIG{'PIPE'} = 'DEFAULT'; open(SOCK, "+>&STDIN"); # Check if it is time for the logfile to be cleared if ($config{'logclear'}) { local $write_logtime = 0; local @st = stat("$config{'logfile'}.time"); if (@st) { if ($st[9]+$config{'logtime'}*60*60 < time()){ # need to clear log $write_logtime = 1; unlink($config{'logfile'}); } } else { $write_logtime = 1; } if ($write_logtime) { open(LOGTIME, ">$config{'logfile'}.time"); print LOGTIME time(),"\n"; close(LOGTIME); } } # Work out if IPv6 is being used locally local $sn = getsockname(SOCK); print DEBUG "sn=$sn\n"; print DEBUG "length=",length($sn),"\n"; $localipv6 = length($sn) > 16; print DEBUG "localipv6=$localipv6\n"; # Initialize SSL for this connection if ($use_ssl) { $ssl_con = &ssl_connection_for_ip(SOCK, $localipv6); $ssl_con || exit; } # Work out the hostname for this web server $host = &get_socket_name(SOCK, $localipv6); print DEBUG "host=$host\n"; $host || exit; $port = $config{'port'}; $acptaddr = getpeername(SOCK); print DEBUG "acptaddr=$acptaddr\n"; print DEBUG "length=",length($acptaddr),"\n"; $acptaddr || exit; # Work out remote and local IPs $ipv6 = length($acptaddr) > 16; print DEBUG "ipv6=$ipv6\n"; (undef, $locala) = &get_socket_ip(SOCK, $localipv6); print DEBUG "locala=$locala\n"; (undef, $peera, undef) = &get_address_ip($acptaddr, $ipv6); print DEBUG "peera=$peera\n"; print DEBUG "main: Starting handle_request loop pid=$$\n"; while(&handle_request($peera, $locala, $ipv6)) { } print DEBUG "main: Done handle_request loop pid=$$\n"; close(SOCK); exit; } # Build list of sockets to listen on $config{'bind'} = '' if ($config{'bind'} eq '*'); if ($config{'bind'}) { # Listening on a specific IP if (&check_ip6address($config{'bind'})) { # IP is v6 $use_ipv6 || die "Cannot bind to $config{'bind'} without IPv6"; push(@sockets, [ inet_pton(AF_INET6(),$config{'bind'}), $config{'port'}, PF_INET6() ]); } else { # IP is v4 push(@sockets, [ inet_aton($config{'bind'}), $config{'port'}, PF_INET() ]); } } else { # Listening on all IPs push(@sockets, [ INADDR_ANY, $config{'port'}, PF_INET() ]); if ($use_ipv6) { # Also IPv6 push(@sockets, [ in6addr_any(), $config{'port'}, PF_INET6() ]); } } foreach $s (split(/\s+/, $config{'sockets'})) { if ($s =~ /^(\d+)$/) { # Just listen on another port on the main IP push(@sockets, [ $sockets[0]->[0], $s, $sockets[0]->[2] ]); if ($use_ipv6 && !$config{'bind'}) { # Also listen on that port on the main IPv6 address push(@sockets, [ $sockets[1]->[0], $s, $sockets[1]->[2] ]); } } elsif ($s =~ /^\*:(\d+)$/) { # Listening on all IPs on some port push(@sockets, [ INADDR_ANY, $1, PF_INET() ]); if ($use_ipv6) { push(@sockets, [ in6addr_any(), $1, PF_INET6() ]); } } elsif ($s =~ /^(\S+):(\d+)$/) { # Listen on a specific port and IP my ($ip, $port) = ($1, $2); if (&check_ip6address($ip)) { $use_ipv6 || die "Cannot bind to $ip without IPv6"; push(@sockets, [ inet_pton(AF_INET6(), $ip), $port, PF_INET6() ]); } else { push(@sockets, [ inet_aton($ip), $port, PF_INET() ]); } } elsif ($s =~ /^([0-9\.]+):\*$/ || $s =~ /^([0-9\.]+)$/) { # Listen on the main port on another IPv4 address push(@sockets, [ inet_aton($1), $sockets[0]->[1], PF_INET() ]); } elsif (($s =~ /^([0-9a-f\:]+):\*$/ || $s =~ /^([0-9a-f\:]+)$/) && $use_ipv6) { # Listen on the main port on another IPv6 address push(@sockets, [ inet_pton(AF_INET6(), $1), $sockets[0]->[1], PF_INET6() ]); } } # Open all the sockets $proto = getprotobyname('tcp'); @sockerrs = ( ); $tried_inaddr_any = 0; for($i=0; $i<@sockets; $i++) { $fh = "MAIN$i"; if (!socket($fh, $sockets[$i]->[2], SOCK_STREAM, $proto)) { # Protocol not supported push(@sockerrs, "Failed to open socket family $sockets[$i]->[2] : $!"); next; } setsockopt($fh, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)); if ($sockets[$i]->[2] eq PF_INET()) { $pack = pack_sockaddr_in($sockets[$i]->[1], $sockets[$i]->[0]); } else { $pack = pack_sockaddr_in6($sockets[$i]->[1], $sockets[$i]->[0]); setsockopt($fh, 41, 26, pack("l", 1)); # IPv6 only } for($j=0; $j<5; $j++) { last if (bind($fh, $pack)); sleep(1); } if ($j == 5) { # All attempts failed .. give up if ($sockets[$i]->[0] eq INADDR_ANY || $use_ipv6 && $sockets[$i]->[0] eq in6addr_any()) { push(@sockerrs, "Failed to bind to port $sockets[$i]->[1] : $!"); $tried_inaddr_any = 1; } else { $ip = &network_to_address($sockets[$i]->[0]); push(@sockerrs, "Failed to bind to IP $ip port ". "$sockets[$i]->[1] : $!"); } } else { listen($fh, &get_somaxconn()); push(@socketfhs, $fh); $ipv6fhs{$fh} = $sockets[$i]->[2] eq PF_INET() ? 0 : 1; } } foreach $se (@sockerrs) { print STDERR $se,"\n"; } # If all binds failed, try binding to any address if (!@socketfhs && !$tried_inaddr_any) { print STDERR "Falling back to listening on any address\n"; $fh = "MAIN"; socket($fh, PF_INET(), SOCK_STREAM, $proto) || die "Failed to open socket : $!"; setsockopt($fh, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)); if (!bind($fh, pack_sockaddr_in($sockets[0]->[1], INADDR_ANY))) { print STDERR "Failed to bind to port $sockets[0]->[1] : $!\n"; exit(1); } listen($fh, &get_somaxconn()); push(@socketfhs, $fh); } elsif (!@socketfhs && $tried_inaddr_any) { print STDERR "Could not listen on any ports"; exit(1); } if ($config{'listen'}) { # Open the socket that allows other webmin servers to find this one $proto = getprotobyname('udp'); if (socket(LISTEN, PF_INET(), SOCK_DGRAM, $proto)) { setsockopt(LISTEN, SOL_SOCKET, SO_REUSEADDR, pack("l", 1)); bind(LISTEN, pack_sockaddr_in($config{'listen'}, INADDR_ANY)); listen(LISTEN, &get_somaxconn()); } else { $config{'listen'} = 0; } } # Split from the controlling terminal, unless configured not to if (!$config{'nofork'} && !$nofork_argv) { if (fork()) { exit; } } eval { setsid(); }; # may not work on Windows # Close standard file handles open(STDIN, "</dev/null"); open(STDOUT, ">/dev/null"); &redirect_stderr_to_log(); &log_error("miniserv.pl started"); foreach $msg (@startup_msg) { &log_error($msg); } # write out the PID file &write_pid_file(); $miniserv_main_pid = $$; # Start the log-clearing process, if needed. This checks every minute # to see if the log has passed its reset time, and if so clears it if ($config{'logclear'}) { if (!($logclearer = fork())) { &close_all_sockets(); close(LISTEN); while(1) { local $write_logtime = 0; local @st = stat("$config{'logfile'}.time"); if (@st) { if ($st[9]+$config{'logtime'}*60*60 < time()){ # need to clear log $write_logtime = 1; unlink($config{'logfile'}); } } else { $write_logtime = 1; } if ($write_logtime) { open(LOGTIME, ">$config{'logfile'}.time"); print LOGTIME time(),"\n"; close(LOGTIME); } sleep(5*60); } exit; } push(@childpids, $logclearer); } # Setup the logout time dbm if needed if ($config{'session'}) { eval "use SDBM_File"; dbmopen(%sessiondb, $config{'sessiondb'}, 0700); eval "\$sessiondb{'1111111111'} = 'foo bar';"; if ($@) { dbmclose(%sessiondb); eval "use NDBM_File"; dbmopen(%sessiondb, $config{'sessiondb'}, 0700); } else { delete($sessiondb{'1111111111'}); } } # Run the main loop $SIG{'HUP'} = 'miniserv::trigger_restart'; $SIG{'TERM'} = 'miniserv::term_handler'; $SIG{'USR1'} = 'miniserv::trigger_reload'; $SIG{'PIPE'} = 'IGNORE'; local $remove_session_count = 0; $need_pipes = $config{'passdelay'} || $config{'session'}; $cron_runs = 0; while(1) { # Check if any webmin cron jobs are ready to run &execute_ready_webmin_crons($cron_runs++); # wait for a new connection, or a message from a child process local ($i, $rmask); if (@childpids <= $config{'maxconns'}) { # Only accept new main socket connects when ready local $s; foreach $s (@socketfhs) { vec($rmask, fileno($s), 1) = 1; } } else { printf STDERR "too many children (%d > %d)\n", scalar(@childpids), $config{'maxconns'}; } if ($need_pipes) { for($i=0; $i<@passin; $i++) { vec($rmask, fileno($passin[$i]), 1) = 1; } } vec($rmask, fileno(LISTEN), 1) = 1 if ($config{'listen'}); # Wait for a connection local $sel = select($rmask, undef, undef, 10); # Check the flag files if ($config{'restartflag'} && -r $config{'restartflag'}) { print STDERR "restart flag file detected\n"; unlink($config{'restartflag'}); $need_restart = 1; } if ($config{'reloadflag'} && -r $config{'reloadflag'}) { unlink($config{'reloadflag'}); $need_reload = 1; } if ($need_restart) { # Got a HUP signal while in select() .. restart now &restart_miniserv(); } if ($need_reload) { # Got a USR1 signal while in select() .. re-read config $need_reload = 0; &reload_config_file(); } local $time_now = time(); # Clean up finished processes local $pid; do { $pid = waitpid(-1, WNOHANG); @childpids = grep { $_ != $pid } @childpids; } while($pid != 0 && $pid != -1); # run the unblocking procedure to check if enough time has passed to # unblock hosts that heve been blocked because of password failures $unblocked = 0; if ($config{'blockhost_failures'}) { $i = 0; while ($i <= $#deny) { if ($blockhosttime{$deny[$i]} && $config{'blockhost_time'} != 0 && ($time_now - $blockhosttime{$deny[$i]}) >= $config{'blockhost_time'}) { # the host can be unblocked now $hostfail{$deny[$i]} = 0; splice(@deny, $i, 1); $unblocked = 1; } $i++; } } # Do the same for blocked users if ($config{'blockuser_failures'}) { $i = 0; while ($i <= $#deny) { if ($blockusertime{$deny[$i]} && $config{'blockuser_time'} != 0 && ($time_now - $blockusertime{$deny[$i]}) >= $config{'blockuser_time'}) { # the user can be unblocked now $userfail{$deny[$i]} = 0; splice(@denyusers, $i, 1); $unblocked = 1; } $i++; } } if ($unblocked) { &write_blocked_file(); } if ($config{'session'} && (++$remove_session_count%50) == 0) { # Remove sessions with more than 7 days of inactivity, local $s; foreach $s (keys %sessiondb) { local ($user, $ltime, $lip) = split(/\s+/, $sessiondb{$s}); if ($time_now - $ltime > 7*24*60*60) { &run_logout_script($s, $user, undef, undef); &write_logout_utmp($user, $lip); if ($user =~ /^\!/ || $sessiondb{$s} eq '') { # Don't log anything for logged out # sessions or those with no data } elsif ($use_syslog && $user) { syslog("info", "%s", "Timeout of session for $user"); } elsif ($use_syslog) { syslog("info", "%s", "Timeout of unknown session $s ". "with value $sessiondb{$s}"); } delete($sessiondb{$s}); } } } if ($use_pam && $config{'pam_conv'}) { # Remove PAM sessions with more than 5 minutes of inactivity local $c; foreach $c (values %conversations) { if ($time_now - $c->{'time'} > 5*60) { &end_pam_conversation($c); if ($use_syslog) { syslog("info", "%s", "Timeout of PAM ". "session for $c->{'user'}"); } } } } # Don't check any sockets if there is no activity next if ($sel <= 0); # Check if any of the main sockets have received a new connection local $sn = 0; foreach $s (@socketfhs) { if (vec($rmask, fileno($s), 1)) { # got new connection $acptaddr = accept(SOCK, $s); if (!$acptaddr) { next; } binmode(SOCK); # turn off any Perl IO stuff # create pipes local ($PASSINr, $PASSINw, $PASSOUTr, $PASSOUTw); if ($need_pipes) { ($PASSINr, $PASSINw, $PASSOUTr, $PASSOUTw) = &allocate_pipes(); } # Work out IP and port of client local ($peerb, $peera, $peerp) = &get_address_ip($acptaddr, $ipv6fhs{$s}); # Work out the local IP (undef, $locala) = &get_socket_ip(SOCK, $ipv6fhs{$s}); # Check username of connecting user $localauth_user = undef; if ($config{'localauth'} && $peera eq "127.0.0.1") { if (open(TCP, "/proc/net/tcp")) { # Get the info direct from the kernel $peerh = sprintf("%4.4X", $peerp); while(<TCP>) { s/^\s+//; local @t = split(/[\s:]+/, $_); if ($t[1] eq '0100007F' && $t[2] eq $peerh) { $localauth_user = getpwuid($t[11]); last; } } close(TCP); } if (!$localauth_user) { # Call lsof for the info local $lsofpid = open(LSOF, "$config{'localauth'} -i ". "TCP\@127.0.0.1:$peerp |"); while(<LSOF>) { if (/^(\S+)\s+(\d+)\s+(\S+)/ && $2 != $$ && $2 != $lsofpid){ $localauth_user = $3; } } close(LSOF); } } # Work out the hostname for this web server $host = &get_socket_name(SOCK, $ipv6fhs{$s}); if (!$host) { print STDERR "Failed to get local socket name : $!\n"; close(SOCK); next; } $port = $sockets[$sn]->[1]; # fork the subprocess local $handpid; if (!($handpid = fork())) { # setup signal handlers $SIG{'TERM'} = 'DEFAULT'; $SIG{'PIPE'} = 'DEFAULT'; #$SIG{'CHLD'} = 'IGNORE'; $SIG{'HUP'} = 'IGNORE'; $SIG{'USR1'} = 'IGNORE'; # Close the file handle for the session DBM dbmclose(%sessiondb); # close useless pipes if ($need_pipes) { &close_all_pipes(); close($PASSINr); close($PASSOUTw); } &close_all_sockets(); close(LISTEN); # Initialize SSL for this connection if ($use_ssl) { $ssl_con = &ssl_connection_for_ip( SOCK, $ipv6fhs{$s}); $ssl_con || exit; } print DEBUG "main: Starting handle_request loop pid=$$\n"; while(&handle_request($peera, $locala, $ipv6fhs{$s})) { # Loop until keepalive stops } print DEBUG "main: Done handle_request loop pid=$$\n"; shutdown(SOCK, 1); close(SOCK); close($PASSINw); close($PASSOUTw); exit; } push(@childpids, $handpid); if ($need_pipes) { close($PASSINw); close($PASSOUTr); push(@passin, $PASSINr); push(@passout, $PASSOUTw); } close(SOCK); } $sn++; } if ($config{'listen'} && vec($rmask, fileno(LISTEN), 1)) { # Got UDP packet from another webmin server local $rcvbuf; local $from = recv(LISTEN, $rcvbuf, 1024, 0); next if (!$from); local $fromip = inet_ntoa((unpack_sockaddr_in($from))[1]); local $toip = inet_ntoa((unpack_sockaddr_in( getsockname(LISTEN)))[1]); if ((!@deny || !&ip_match($fromip, $toip, @deny)) && (!@allow || &ip_match($fromip, $toip, @allow))) { local $listenhost = &get_socket_name(LISTEN, 0); send(LISTEN, "$listenhost:$config{'port'}:". ($use_ssl || $config{'inetd_ssl'} ? 1 : 0).":". ($config{'listenhost'} ? &get_system_hostname() : ""), 0, $from) if ($listenhost); } } # check for session, password-timeout and PAM messages from subprocesses for($i=0; $i<@passin; $i++) { if (vec($rmask, fileno($passin[$i]), 1)) { # this sub-process is asking about a password local $infd = $passin[$i]; local $outfd = $passout[$i]; #local $inline = <$infd>; local $inline = &sysread_line($infd); if ($inline) { print DEBUG "main: inline $inline"; } else { print DEBUG "main: inline EOF\n"; } if ($inline =~ /^delay\s+(\S+)\s+(\S+)\s+(\d+)/) { # Got a delay request from a subprocess.. for # valid logins, there is no delay (to prevent # denial of service attacks), but for invalid # logins the delay increases with each failed # attempt. if ($3) { # login OK.. no delay print $outfd "0 0\n"; $wasblocked = $hostfail{$2} || $userfail{$1}; $hostfail{$2} = 0; $userfail{$1} = 0; if ($wasblocked) { &write_blocked_file(); } } else { # login failed.. $hostfail{$2}++; $userfail{$1}++; $blocked = 0; # add the host to the block list, # if configured if ($config{'blockhost_failures'} && $hostfail{$2} >= $config{'blockhost_failures'}) { push(@deny, $2); $blockhosttime{$2} = $time_now; $blocked = 1; if ($use_syslog) { local $logtext = "Security alert: Host $2 blocked after $config{'blockhost_failures'} failed logins for user $1"; syslog("crit", "%s", $logtext); } } # add the user to the user block list, # if configured if ($config{'blockuser_failures'} && $userfail{$1} >= $config{'blockuser_failures'}) { push(@denyusers, $1); $blockusertime{$1} = $time_now; $blocked = 2; if ($use_syslog) { local $logtext = "Security alert: User $1 blocked after $config{'blockuser_failures'} failed logins"; syslog("crit", "%s", $logtext); } } # Lock out the user's password, if enabled if ($config{'blocklock'} && $userfail{$1} >= $config{'blockuser_failures'}) { my $lk = &lock_user_password($1); $blocked = 2; if ($use_syslog) { local $logtext = $lk == 1 ? "Security alert: User $1 locked after $config{'blockuser_failures'} failed logins" : $lk < 0 ? "Security alert: User could not be locked" : "Security alert: User is already locked"; syslog("crit", "%s", $logtext); } } # Send back a delay $dl = $userdlay{$1} - int(($time_now - $userlast{$1})/50); $dl = $dl < 0 ? 0 : $dl+1; print $outfd "$dl $blocked\n"; $userdlay{$1} = $dl; # Write out blocked status file if ($blocked) { &write_blocked_file(); } } $userlast{$1} = $time_now; } elsif ($inline =~ /^verify\s+(\S+)\s+(\S+)\s+(\S+)/) { # Verifying a session ID local $session_id = $1; local $notimeout = $2; local $vip = $3; local $skey = $sessiondb{$session_id} ? $session_id : &hash_session_id($session_id); if (!defined($sessiondb{$skey})) { # Session doesn't exist print $outfd "0 0\n"; } else { local ($user, $ltime, $ip) = split(/\s+/, $sessiondb{$skey}); local $lot = &get_logout_time($user, $session_id); if ($lot && $time_now - $ltime > $lot*60 && !$notimeout) { # Session has timed out print $outfd "1 ",$time_now - $ltime,"\n"; #delete($sessiondb{$skey}); } elsif ($ip && $vip && $ip ne $vip && $config{'session_ip'}) { # Session was OK, but from the # wrong IP address print $outfd "3 $ip\n"; } elsif ($user =~ /^\!/) { # Logged out session print $outfd "0 0\n"; } else { # Session is OK print $outfd "2 $user\n"; $sessiondb{$skey} = "$user $time_now $ip"; } } } elsif ($inline =~ /^new\s+(\S+)\s+(\S+)\s+(\S+)/) { # Creating a new session local $session_id = $1; local $user = $2; local $ip = $3; $sessiondb{&hash_session_id($session_id)} = "$user $time_now $ip"; } elsif ($inline =~ /^delete\s+(\S+)/) { # Logging out a session local $session_id = $1; local $skey = $sessiondb{$session_id} ? $session_id : &hash_session_id($session_id); local ($user, $ltime, $ip) = split(/\s+/, $sessiondb{$skey}); $user =~ s/^\!//; print $outfd $user,"\n"; $sessiondb{$skey} = "!$user $ltime $ip"; } elsif ($inline =~ /^pamstart\s+(\S+)\s+(\S+)\s+(.*)/) { # Starting a new PAM conversation local ($cid, $host, $user) = ($1, $2, $3); # Does this user even need PAM? local ($realuser, $canlogin) = &can_user_login($user, undef, $host); local $conv; if ($canlogin == 0) { # Cannot even login! print $outfd "0 Invalid username\n"; } elsif ($canlogin != 2) { # Not using PAM .. so just ask for # the password. $conv = { 'user' => $realuser, 'host' => $host, 'step' => 0, 'cid' => $cid, 'time' => time() }; print $outfd "3 Password\n"; } else { # Start the PAM conversation # sub-process, and get a question $conv = { 'user' => $realuser, 'host' => $host, 'cid' => $cid, 'time' => time() }; local ($PAMINr, $PAMINw, $PAMOUTr, $PAMOUTw) = &allocate_pipes(); local $pampid = fork(); if (!$pampid) { close($PAMOUTr); close($PAMINw); &pam_conversation_process( $realuser, $PAMOUTw, $PAMINr); } close($PAMOUTw); close($PAMINr); $conv->{'pid'} = $pampid; $conv->{'PAMOUTr'} = $PAMOUTr; $conv->{'PAMINw'} = $PAMINw; push(@childpids, $pampid); # Get the first PAM question local $pok = &recv_pam_question( $conv, $outfd); if (!$pok) { &end_pam_conversation($conv); } } $conversations{$cid} = $conv if ($conv); } elsif ($inline =~ /^pamanswer\s+(\S+)\s+(.*)/) { # A response to a PAM question local ($cid, $answer) = ($1, $2); local $conv = $conversations{$cid}; if (!$conv) { # No such conversation? print $outfd "0 Bad login session\n"; } elsif ($conv->{'pid'}) { # Send the PAM response and get # the next question &send_pam_answer($conv, $answer); local $pok = &recv_pam_question($conv, $outfd); if (!$pok) { &end_pam_conversation($conv); } } else { # This must be the password .. try it # and send back the results local ($vu, $expired, $nonexist) = &validate_user($conv->{'user'}, $answer, $conf->{'host'}); local $ok = $vu ? 1 : 0; print $outfd "2 $conv->{'user'} $ok $expired $notexist\n"; &end_pam_conversation($conv); } } elsif ($inline =~ /^writesudo\s+(\S+)\s+(\d+)/) { # Store the fact that some user can sudo to root local ($user, $ok) = ($1, $2); $sudocache{$user} = $ok." ".time(); } elsif ($inline =~ /^readsudo\s+(\S+)/) { # Query the user sudo cache (valid for 1 minute) local $user = $1; local ($ok, $last) = split(/\s+/, $sudocache{$user}); if ($last < time()-60) { # Cache too old print $outfd "2\n"; } else { # Tell client OK or not print $outfd "$ok\n"; } } elsif ($inline =~ /\S/) { # Unknown line from pipe? print DEBUG "main: Unknown line from pipe $inline\n"; print STDERR "Unknown line from pipe $inline\n"; } else { # close pipe close($infd); close($outfd); $passin[$i] = $passout[$i] = undef; } } } @passin = grep { defined($_) } @passin; @passout = grep { defined($_) } @passout; } # handle_request(remoteaddress, localaddress, ipv6-flag) # Where the real work is done sub handle_request { local ($acptip, $localip, $ipv6) = @_; print DEBUG "handle_request: from $acptip to $localip ipv6=$ipv6\n"; if ($config{'loghost'}) { $acpthost = &to_hostname($acptip); $acpthost = $acptip if (!$acpthost); } else { $acpthost = $acptip; } $loghost = $acpthost; $datestr = &http_date(time()); $ok_code = 200; $ok_message = "Document follows"; $logged_code = undef; $reqline = $request_uri = $page = undef; $authuser = undef; $validated = undef; # check address against access list if (@deny && &ip_match($acptip, $localip, @deny) || @allow && !&ip_match($acptip, $localip, @allow)) { &http_error(403, "Access denied for ".&html_strip($acptip)); return 0; } if ($use_libwrap) { # Check address with TCP-wrappers if (!hosts_ctl($config{'pam'}, STRING_UNKNOWN, $acptip, STRING_UNKNOWN)) { &http_error(403, "Access denied for ".&html_strip($acptip). " by TCP wrappers"); return 0; } } print DEBUG "handle_request: passed IP checks\n"; # Compute a timeout for the start of headers, based on the number of # child processes. As this increases, we use a shorter timeout to avoid # an attacker overloading the system. local $header_timeout = 60 + ($config{'maxconns'} - @childpids) * 10; # Wait at most 60 secs for start of headers for initial requests, or # 10 minutes for kept-alive connections local $rmask; vec($rmask, fileno(SOCK), 1) = 1; local $to = $checked_timeout ? 10*60 : $header_timeout; local $sel = select($rmask, undef, undef, $to); if (!$sel) { if ($checked_timeout) { print DEBUG "handle_request: exiting due to timeout of $to\n"; exit; } else { &http_error(400, "Timeout", "Waited for $to seconds for start of headers"); } } $checked_timeout++; print DEBUG "handle_request: passed timeout check\n"; # Read the HTTP request and headers local $origreqline = &read_line(); ($reqline = $origreqline) =~ s/\r|\n//g; $method = $page = $request_uri = undef; print DEBUG "handle_request reqline=$reqline\n"; if (!$reqline && (!$use_ssl || $checked_timeout > 1)) { # An empty request .. just close the connection print DEBUG "handle_request: rejecting empty request\n"; return 0; } elsif ($reqline !~ /^(\S+)\s+(.*)\s+HTTP\/1\..$/) { print DEBUG "handle_request: invalid reqline=$reqline\n"; if ($use_ssl) { # This could be an http request when it should be https $use_ssl = 0; local $urlhost = $config{'musthost'} || $host; $urlhost = "[".$urlhost."]" if (&check_ip6address($urlhost)); local $url = "https://$urlhost:$port/"; if ($config{'ssl_redirect'}) { # Just re-direct to the correct URL sleep(1); # Give browser a change to finish # sending its request &write_data("HTTP/1.0 302 Moved Temporarily\r\n"); &write_data("Date: $datestr\r\n"); &write_data("Server: $config{'server'}\r\n"); &write_data("Location: $url\r\n"); &write_keep_alive(0); &write_data("\r\n"); return 0; } elsif ($config{'hide_admin_url'} != 1) { # Tell user the correct URL &http_error(200, "Document follows", "This web server is running in SSL mode. ". "Try the URL <a href='$url'>$url</a> ". "instead.<br>"); } else { # Throw an error &http_error(404, "Page not found", "The requested URL was not found on this server ". "try <a href='/'>visiting the home page</a> of this site to see what you can find <br>"); } } elsif (ord(substr($reqline, 0, 1)) == 128 && !$use_ssl) { # This could be an https request when it should be http .. # need to fake a HTTP response eval <<'EOF'; use Net::SSLeay; eval "Net::SSLeay::SSLeay_add_ssl_algorithms()"; eval "Net::SSLeay::load_error_strings()"; $ssl_ctx = Net::SSLeay::CTX_new(); Net::SSLeay::CTX_use_RSAPrivateKey_file( $ssl_ctx, $config{'keyfile'}, &Net::SSLeay::FILETYPE_PEM); Net::SSLeay::CTX_use_certificate_file( $ssl_ctx, $config{'certfile'} || $config{'keyfile'}, &Net::SSLeay::FILETYPE_PEM); $ssl_con = Net::SSLeay::new($ssl_ctx); pipe(SSLr, SSLw); if (!fork()) { close(SSLr); select(SSLw); $| = 1; select(STDOUT); print SSLw $origreqline; local $buf; while(sysread(SOCK, $buf, 1) > 0) { print SSLw $buf; } close(SOCK); exit; } close(SSLw); Net::SSLeay::set_wfd($ssl_con, fileno(SOCK)); Net::SSLeay::set_rfd($ssl_con, fileno(SSLr)); Net::SSLeay::accept($ssl_con) || die "accept() failed"; $use_ssl = 1; local $url = $config{'musthost'} ? "https://$config{'musthost'}:$port/" : "https://$host:$port/"; if ($config{'ssl_redirect'}) { # Just re-direct to the correct URL sleep(1); # Give browser a change to # finish sending its request &write_data("HTTP/1.0 302 Moved Temporarily\r\n"); &write_data("Date: $datestr\r\n"); &write_data("Server: $config{'server'}\r\n"); &write_data("Location: $url\r\n"); &write_keep_alive(0); &write_data("\r\n"); return 0; } elsif ($config{'hide_admin_url'} != 1) { # Tell user the correct URL &http_error(200, "Bad Request", "This web server is not running in SSL mode. Try the URL <a href='$url'>$url</a> instead.<br>"); } else { &http_error(404, "Page not found", "The requested URL was not found on this server ". "try <a href='/'>visiting the home page</a> of this site to see what you can find <br>" ); } EOF if ($@) { &http_error(400, "Bad Request"); } } else { &http_error(400, "Bad Request"); } } $method = $1; $request_uri = $page = $2; %header = (); local $lastheader; while(1) { ($headline = &read_line()) =~ s/\r|\n//g; last if ($headline eq ""); print DEBUG "handle_request: got headline $headline\n"; if ($headline =~ /^(\S+):\s*(.*)$/) { $header{$lastheader = lc($1)} = $2; } elsif ($headline =~ /^\s+(.*)$/) { $header{$lastheader} .= $headline; } else { &http_error(400, "Bad Header ".&html_strip($headline)); } if (&is_bad_header($header{$lastheader}, $lastheader)) { delete($header{$lastheader}); &http_error(400, "Bad Header Contents ". &html_strip($lastheader)); } } # If a remote IP is given in a header (such as via a proxy), only use it # for logging unless trust_real_ip is set local $headerhost = $header{'x-forwarded-for'} || $header{'x-real-ip'}; if ($config{'trust_real_ip'}) { $acpthost = $headerhost || $acpthost; if (&check_ipaddress($headerhost) || &check_ip6address($headerhost)) { # If a remote IP was given, use it for all access control checks # from now on. $acptip = $headerhost; } $loghost = $acpthost; } else { $loghost = $headerhost || $loghost; } if (defined($header{'host'})) { if ($header{'host'} =~ /^\[(.+)\]:([0-9]+)$/) { ($host, $port) = ($1, $2); } elsif ($header{'host'} =~ /^([^:]+):([0-9]+)$/) { ($host, $port) = ($1, $2); } else { $host = $header{'host'}; } if ($config{'musthost'} && $host ne $config{'musthost'}) { # Disallowed hostname used &http_error(400, "Invalid HTTP hostname"); } } $portstr = $port == 80 && !$ssl ? "" : $port == 443 && $ssl ? "" : ":$port"; $hostport = &check_ip6address($host) ? "[".$host."]".$portstr : $host.$portstr; undef(%in); if ($page =~ /^([^\?]+)\?(.*)$/) { # There is some query string information $page = $1; $querystring = $2; print DEBUG "handle_request: querystring=$querystring\n"; if ($querystring !~ /=/) { $queryargs = $querystring; $queryargs =~ s/\+/ /g; $queryargs =~ s/%(..)/pack("c",hex($1))/ge; $querystring = ""; } else { # Parse query-string parameters local @in = split(/\&/, $querystring); foreach $i (@in) { local ($k, $v) = split(/=/, $i, 2); $k =~ s/\+/ /g; $k =~ s/%(..)/pack("c",hex($1))/ge; $v =~ s/\+/ /g; $v =~ s/%(..)/pack("c",hex($1))/ge; $in{$k} = $v; } } } $posted_data = undef; if ($method eq 'POST' && $header{'content-type'} eq 'application/x-www-form-urlencoded') { # Read in posted query string information, up the configured maximum # post request length $clen = $header{"content-length"}; $clen_read = $clen > $config{'max_post'} ? $config{'max_post'} : $clen; while(length($posted_data) < $clen_read) { $buf = &read_data($clen_read - length($posted_data)); if (!length($buf)) { &http_error(500, "Failed to read POST request"); } chomp($posted_data); $posted_data =~ s/\015$//mg; $posted_data .= $buf; } print DEBUG "clen_read=$clen_read clen=$clen posted_data=",length($posted_data),"\n"; if ($clen_read != $clen && length($posted_data) > $clen) { # If the client sent more data than we asked for, chop the # rest off $posted_data = substr($posted_data, 0, $clen); } if (length($posted_data) > $clen) { # When the client sent too much, delay so that it gets headers sleep(3); } if ($header{'user-agent'} =~ /MSIE/ && $header{'user-agent'} !~ /Opera/i) { # MSIE includes an extra newline in the data $posted_data =~ s/\r|\n//g; } local @in = split(/\&/, $posted_data); foreach $i (@in) { local ($k, $v) = split(/=/, $i, 2); #$v =~ s/\r|\n//g; $k =~ s/\+/ /g; $k =~ s/%(..)/pack("c",hex($1))/ge; $v =~ s/\+/ /g; $v =~ s/%(..)/pack("c",hex($1))/ge; $in{$k} = $v; } print DEBUG "handle_request: posted_data=$posted_data\n"; } # Reject CONNECT request, which isn't supported if ($method eq "CONNECT" || $method eq "TRACE") { &http_error(405, "Method ".&html_strip($method)." is not supported"); } # work out accepted encodings %acceptenc = map { $_, 1 } split(/,/, $header{'accept-encoding'}); # replace %XX sequences in page $page =~ s/%(..)/pack("c",hex($1))/ge; # Check if the browser's user agent indicates a mobile device $mobile_device = &is_mobile_useragent($header{'user-agent'}); # Check if Host: header is for a mobile URL foreach my $m (@mobile_prefixes) { if ($header{'host'} =~ /^\Q$m\E/i) { $mobile_device = 1; } } # check for the logout flag file, and if existant deny authentication if ($config{'logout'} && -r $config{'logout'}.$in{'miniserv_logout_id'}) { print DEBUG "handle_request: logout flag set\n"; $deny_authentication++; open(LOGOUT, $config{'logout'}.$in{'miniserv_logout_id'}); chop($count = <LOGOUT>); close(LOGOUT); $count--; if ($count > 0) { open(LOGOUT, ">$config{'logout'}$in{'miniserv_logout_id'}"); print LOGOUT "$count\n"; close(LOGOUT); } else { unlink($config{'logout'}.$in{'miniserv_logout_id'}); } } # check for any redirect for the requested URL foreach my $pfx (@strip_prefix) { my $l = length($pfx); if(length($page) >= $l && substr($page,0,$l) eq $pfx) { $page=substr($page,$l); last; } } $simple = &simplify_path($page, $bogus); $rpath = $simple; $rpath .= "&".$querystring if (defined($querystring)); $redir = $redirect{$rpath}; if (defined($redir)) { print DEBUG "handle_request: redir=$redir\n"; &write_data("HTTP/1.0 302 Moved Temporarily\r\n"); &write_data("Date: $datestr\r\n"); &write_data("Server: $config{'server'}\r\n"); local $ssl = $use_ssl || $config{'inetd_ssl'}; $prot = $ssl ? "https" : "http"; &write_data("Location: $prot://$hostport$redir\r\n"); &write_keep_alive(0); &write_data("\r\n"); return 0; } # Check for a DAV request $davpath = undef; foreach my $d (@davpaths) { if ($simple eq $d || $simple =~ /^\Q$d\E\//) { $davpath = $d; last; } } if (!$davpath && ($method eq "SEARCH" || $method eq "PUT")) { &http_error(400, "Bad Request method ".&html_strip($method)); } # Check for password if needed if ($config{'userfile'}) { print DEBUG "handle_request: Need authentication\n"; $validated = 0; $blocked = 0; # Session authentication is never used for connections by # another webmin server, or for specified pages, or for DAV, or XMLRPC, # or mobile browsers if requested. if ($header{'user-agent'} =~ /webmin/i || $header{'user-agent'} =~ /$config{'agents_nosession'}/i || $sessiononly{$simple} || $davpath || $simple eq "/xmlrpc.cgi" || $acptip eq $config{'host_nosession'} || $mobile_device && $config{'mobile_nosession'}) { print DEBUG "handle_request: Forcing HTTP authentication\n"; $config{'session'} = 0; } # Check for SSL authentication if ($use_ssl && $verified_client) { $peername = Net::SSLeay::X509_NAME_oneline( Net::SSLeay::X509_get_subject_name( Net::SSLeay::get_peer_certificate( $ssl_con))); $u = &find_user_by_cert($peername); if ($u) { $authuser = $u; $validated = 2; } if ($use_syslog && !$validated) { syslog("crit", "%s", "Unknown SSL certificate $peername"); } } if (!$validated && !$deny_authentication) { # check for IP-based authentication local $a; foreach $a (keys %ipaccess) { if ($acptip eq $a) { # It does! Auth as the user $validated = 3; $baseauthuser = $authuser = $ipaccess{$a}; } } } # Check for normal HTTP authentication if (!$validated && !$deny_authentication && !$config{'session'} && $header{authorization} =~ /^basic\s+(\S+)$/i) { # authorization given.. ($authuser, $authpass) = split(/:/, &b64decode($1), 2); print DEBUG "handle_request: doing basic auth check authuser=$authuser authpass=$authpass\n"; local ($vu, $expired, $nonexist, $wvu) = &validate_user($authuser, $authpass, $host, $acptip, $port); print DEBUG "handle_request: vu=$vu expired=$expired nonexist=$nonexist\n"; if ($vu && (!$expired || $config{'passwd_mode'} == 1)) { $authuser = $vu; $validated = 1; } else { $validated = 0; } if ($use_syslog && !$validated) { syslog("crit", "%s", ($nonexist ? "Non-existent" : $expired ? "Expired" : "Invalid"). " login as $authuser from $acpthost"); } if ($authuser =~ /\r|\n|\s/) { &http_error(500, "Invalid username", "Username contains invalid characters"); } if ($authpass =~ /\r|\n/) { &http_error(500, "Invalid password", "Password contains invalid characters"); } if ($twofactor{$wvu}) { &http_error(500, "No two-factor support", "HTTP authentication cannot be used when two-factor is enabled"); } if ($config{'passdelay'} && !$config{'inetd'} && $authuser) { # check with main process for delay print DEBUG "handle_request: about to ask for password delay\n"; print $PASSINw "delay $authuser $acptip $validated\n"; <$PASSOUTr> =~ /(\d+) (\d+)/; $blocked = $2; print DEBUG "handle_request: password delay $1 $2\n"; sleep($1); } } # Check for a visit to the special session login page if ($config{'session'} && !$deny_authentication && $page eq $config{'session_login'}) { if ($in{'logout'} && $header{'cookie'} =~ /(^|\s|;)$sidname=([a-f0-9]+)/) { # Logout clicked .. remove the session local $sid = $2; print $PASSINw "delete $sid\n"; local $louser = <$PASSOUTr>; chop($louser); $logout = 1; $already_session_id = undef; $authuser = $baseauthuser = undef; if ($louser) { if ($use_syslog) { syslog("info", "%s", "Logout by $louser from $acpthost"); } &run_logout_script($louser, $sid, $loghost, $localip); &write_logout_utmp($louser, $actphost); } } else { # Validate the user if ($in{'user'} =~ /\r|\n|\s/) { &run_failed_script($in{'user'}, 'baduser', $loghost, $localip); &http_error(500, "Invalid username", "Username contains invalid characters"); } if ($in{'pass'} =~ /\r|\n/) { &run_failed_script($in{'user'}, 'badpass', $loghost, $localip); &http_error(500, "Invalid password", "Password contains invalid characters"); } local ($vu, $expired, $nonexist, $wvu) = &validate_user($in{'user'}, $in{'pass'}, $host, $acptip, $port); if ($vu && $wvu && $twofactor{$wvu}) { # Check two-factor token ID $err = &validate_twofactor( $wvu, $in{'twofactor'}); if ($err) { &run_failed_script($vu, 'twofactor', $loghost, $localip); $twofactor_msg = $err; $vu = undef; } } local $hrv = &handle_login( $vu || $in{'user'}, $vu ? 1 : 0, $expired, $nonexist, $in{'pass'}, $in{'notestingcookie'}); return $hrv if (defined($hrv)); } } # Check for a visit to the special PAM login page if ($config{'session'} && !$deny_authentication && $use_pam && $config{'pam_conv'} && $page eq $config{'pam_login'} && !$in{'restart'}) { # A question has been entered .. submit it to the main process print DEBUG "handle_request: Got call to $page ($in{'cid'})\n"; print DEBUG "handle_request: For PAM, authuser=$authuser\n"; if ($in{'answer'} =~ /\r|\n/ || $in{'cid'} =~ /\r|\n|\s/) { &http_error(500, "Invalid response", "Response contains invalid characters"); } if (!$in{'cid'}) { # Start of a new conversation - answer must be username $cid = &generate_random_id($in{'answer'}); print $PASSINw "pamstart $cid $host $in{'answer'}\n"; } else { # A response to a previous question $cid = $in{'cid'}; print $PASSINw "pamanswer $cid $in{'answer'}\n"; } # Read back the response, and the next question (if any) local $line = <$PASSOUTr>; $line =~ s/\r|\n//g; local ($rv, $question) = split(/\s+/, $line, 2); if ($rv == 0) { # Cannot login! local $hrv = &handle_login( !$in{'cid'} && $in{'answer'} ? $in{'answer'} : "unknown", 0, 0, 1, undef); return $hrv if (defined($hrv)); } elsif ($rv == 1 || $rv == 3) { # Another question .. force use of PAM CGI $validated = 1; $method = "GET"; $querystring .= "&cid=$cid&question=". &urlize($question); $querystring .= "&password=1" if ($rv == 3); $queryargs = ""; $page = $config{'pam_login'}; $miniserv_internal = 1; $logged_code = 401; } elsif ($rv == 2) { # Got back a final ok or failure local ($user, $ok, $expired, $nonexist) = split(/\s+/, $question); local $hrv = &handle_login( $user, $ok, $expired, $nonexist, undef, $in{'notestingcookie'}); return $hrv if (defined($hrv)); } elsif ($rv == 4) { # A message from PAM .. tell the user $validated = 1; $method = "GET"; $querystring .= "&cid=$cid&message=". &urlize($question); $queryargs = ""; $page = $config{'pam_login'}; $miniserv_internal = 1; $logged_code = 401; } } # Check for a visit to the special password change page if ($config{'session'} && !$deny_authentication && $page eq $config{'password_change'} && !$validated) { # Just let this slide .. $validated = 1; $miniserv_internal = 3; } # Check for an existing session if ($config{'session'} && !$validated) { if ($already_session_id) { $session_id = $already_session_id; $authuser = $already_authuser; $validated = 1; } elsif (!$deny_authentication && $header{'cookie'} =~ /(^|\s|;)$sidname=([a-f0-9]+)/) { # Try all session cookies local $cookie = $header{'cookie'}; while($cookie =~ s/(^|\s|;)$sidname=([a-f0-9]+)//) { $session_id = $2; local $notimeout = $in{'webmin_notimeout'} ? 1 : 0; print $PASSINw "verify $session_id $notimeout $acptip\n"; <$PASSOUTr> =~ /(\d+)\s+(\S+)/; if ($1 == 2) { # Valid session continuation $validated = 1; $authuser = $2; $already_authuser = $authuser; $timed_out = undef; last; } elsif ($1 == 1) { # Session timed out $timed_out = $2; } elsif ($1 == 3) { # Session is OK, but from the wrong IP print STDERR "Session $session_id was ", "used from $acptip instead of ", "original IP $2\n"; } else { # Invalid session ID .. don't set # verified flag } } } } # Check for local authentication if ($localauth_user && !$header{'x-forwarded-for'} && !$header{'via'}) { my $luser = &get_user_details($localauth_user); if ($luser) { # Local user exists in webmin users file $validated = 1; $authuser = $localauth_user; } else { # Check if local user is allowed by unixauth local @can = &can_user_login($localauth_user, undef, $host); if ($can[0]) { $validated = 2; $authuser = $localauth_user; } else { $localauth_user = undef; } } } if (!$validated) { # Check if this path allows anonymous access local $a; foreach $a (keys %anonymous) { if (substr($simple, 0, length($a)) eq $a) { # It does! Auth as the user, if IP access # control allows him. if (&check_user_ip($anonymous{$a}) && &check_user_time($anonymous{$a})) { $validated = 3; $baseauthuser = $authuser = $anonymous{$a}; } } } } if (!$validated) { # Check if this path allows unauthenticated access local ($u, $unauth); foreach $u (@unauth) { $unauth++ if ($simple =~ /$u/); } if (!$bogus && $unauth) { # Unauthenticated directory or file request - approve it $validated = 4; $baseauthuser = $authuser = undef; } } if (!$validated) { if ($blocked == 0) { # No password given.. ask if ($config{'pam_conv'} && $use_pam) { # Force CGI for PAM question, starting with # the username which is always needed $validated = 1; $method = "GET"; $querystring .= "&initial=1&question=". &urlize("Username"); $querystring .= "&failed=$failed_user" if ($failed_user); $querystring .= "&timed_out=$timed_out" if ($timed_out); $queryargs = ""; $page = $config{'pam_login'}; $miniserv_internal = 1; $logged_code = 401; } elsif ($config{'session'}) { # Force CGI for session login $validated = 1; if ($logout) { $querystring .= "&logout=1&page=/"; } else { # Re-direct to current module only local $rpage = $request_uri; if (!$config{'loginkeeppage'}) { $rpage =~ s/\?.*$//; $rpage =~ s/[^\/]+$// } $querystring = "page=".&urlize($rpage); } $method = "GET"; $querystring .= "&failed=$failed_user" if ($failed_user); $querystring .= "&twofactor_msg=".&urlize($twofactor_msg) if ($twofactor_msg); $querystring .= "&timed_out=$timed_out" if ($timed_out); $queryargs = ""; $page = $config{'session_login'}; $miniserv_internal = 1; $logged_code = 401; } else { # Ask for login with HTTP authentication &write_data("HTTP/1.0 401 Unauthorized\r\n"); &write_data("Date: $datestr\r\n"); &write_data("Server: $config{'server'}\r\n"); &write_data("WWW-authenticate: Basic ". "realm=\"$config{'realm'}\"\r\n"); &write_keep_alive(0); &write_data("Content-type: text/html; Charset=iso-8859-1\r\n"); &write_data("\r\n"); &reset_byte_count(); &write_data("<html>\n"); &write_data("<head><title>Unauthorized</title></head>\n"); &write_data("<body><h1>Unauthorized</h1>\n"); &write_data("A password is required to access this\n"); &write_data("web server. Please try again. <p>\n"); &write_data("</body></html>\n"); &log_request($loghost, undef, $reqline, 401, &byte_count()); return 0; } } elsif ($blocked == 1) { # when the host has been blocked, give it an error &http_error(403, "Access denied for $acptip. The host ". "has been blocked because of too ". "many authentication failures."); } elsif ($blocked == 2) { # when the user has been blocked, give it an error &http_error(403, "Access denied. The user ". "has been blocked because of too ". "many authentication failures."); } } else { # Get the real Webmin username local @can = &can_user_login($authuser, undef, $host); $baseauthuser = $can[3] || $authuser; if ($config{'remoteuser'} && !$< && $validated) { # Switch to the UID of the remote user (if he exists) local @u = getpwnam($authuser); if (@u && $< != $u[2]) { $( = $u[3]; $) = "$u[3] $u[3]"; ($>, $<) = ($u[2], $u[2]); } else { &http_error(500, "Unix user ". &html_strip($authuser)." does not exist"); return 0; } } } # Check per-user IP access control if (!&check_user_ip($baseauthuser)) { &http_error(403, "Access denied for $acptip for ". &html_strip($baseauthuser)); return 0; } # Check per-user allowed times if (!&check_user_time($baseauthuser)) { &http_error(403, "Access denied at the current time"); return 0; } } $uinfo = &get_user_details($baseauthuser); # Validate the path, and convert to canonical form rerun: $simple = &simplify_path($page, $bogus); print DEBUG "handle_request: page=$page simple=$simple\n"; if ($bogus) { &http_error(400, "Invalid path"); } # Check for a DAV request if ($davpath) { return &handle_dav_request($davpath); } # Work out the active theme(s) local $preroots = $mobile_device && defined($config{'mobile_preroot'}) ? $config{'mobile_preroot'} : $authuser && defined($config{'preroot_'.$authuser}) ? $config{'preroot_'.$authuser} : $uinfo && defined($uinfo->{'preroot'}) ? $uinfo->{'preroot'} : $config{'preroot'}; local @preroots = reverse(split(/\s+/, $preroots)); # Canonicalize the directories foreach my $preroot (@preroots) { # Always under the current webmin root $preroot =~ s/^.*\///g; $preroot = $roots[0].'/'.$preroot; } # Look in the theme root directories first local ($full, @stfull); $foundroot = undef; foreach my $preroot (@preroots) { $is_directory = 1; $sofar = ""; $full = $preroot.$sofar; $scriptname = $simple; foreach $b (split(/\//, $simple)) { if ($b ne "") { $sofar .= "/$b"; } $full = $preroot.$sofar; @stfull = stat($full); if (!@stfull) { undef($full); last; } # Check if this is a directory if (-d _) { # It is.. go on parsing $is_directory = 1; next; } else { $is_directory = 0; } # Check if this is a CGI program if (&get_type($full) eq "internal/cgi") { $pathinfo = substr($simple, length($sofar)); $pathinfo .= "/" if ($page =~ /\/$/); $scriptname = $sofar; last; } } # Don't stop at a directory unless this is the last theme, which # is the 'real' one that provides the .cgi scripts if ($is_directory && $preroot ne $preroots[$#preroots]) { next; } if ($full) { # Found it! if ($sofar eq '') { $cgi_pwd = $roots[0]; } elsif ($is_directory) { $cgi_pwd = "$roots[0]$sofar"; } else { "$roots[0]$sofar" =~ /^(.*\/)[^\/]+$/; $cgi_pwd = $1; } $foundroot = $preroot; if ($is_directory) { # Check for index files in the directory local $foundidx; foreach $idx (split(/\s+/, $config{"index_docs"})) { $idxfull = "$full/$idx"; local @stidxfull = stat($idxfull); if (-r _ && !-d _) { $full = $idxfull; @stfull = @stidxfull; $is_directory = 0; $scriptname .= "/" if ($scriptname ne "/"); $foundidx++; last; } } @stfull = stat($full) if (!$foundidx); } } last if ($foundroot); } print DEBUG "handle_request: initial full=$full\n"; # Look in the real root directories, stopping when we find a file or directory if (!$full || $is_directory) { ROOT: foreach $root (@roots) { $sofar = ""; $full = $root.$sofar; $scriptname = $simple; foreach $b ($simple eq "/" ? ( "" ) : split(/\//, $simple)) { if ($b ne "") { $sofar .= "/$b"; } $full = $root.$sofar; @stfull = stat($full); if (!@stfull) { next ROOT; } # Check if this is a directory if (-d _) { # It is.. go on parsing next; } # Check if this is a CGI program if (&get_type($full) eq "internal/cgi") { $pathinfo = substr($simple, length($sofar)); $pathinfo .= "/" if ($page =~ /\/$/); $scriptname = $sofar; last; } } # Run CGI in the same directory as whatever file # was requested $full =~ /^(.*\/)[^\/]+$/; $cgi_pwd = $1; if (-e $full) { # Found something! $realroot = $root; $foundroot = $root; last; } } if (!@stfull) { &http_error(404, "File not found"); } } print DEBUG "handle_request: full=$full\n"; @stfull = stat($full) if (!@stfull); # check filename against denyfile regexp local $denyfile = $config{'denyfile'}; if ($denyfile && $full =~ /$denyfile/) { &http_error(403, "Access denied to ".&html_strip($page)); return 0; } # Reached the end of the path OK.. see what we've got if (-d _) { # See if the URL ends with a / as it should print DEBUG "handle_request: found a directory\n"; if ($page !~ /\/$/) { # It doesn't.. redirect &write_data("HTTP/1.0 302 Moved Temporarily\r\n"); $ssl = $use_ssl || $config{'inetd_ssl'}; $portstr = $port == 80 && !$ssl ? "" : $port == 443 && $ssl ? "" : ":$port"; &write_data("Date: $datestr\r\n"); &write_data("Server: $config{server}\r\n"); $prot = $ssl ? "https" : "http"; &write_data("Location: $prot://$hostport$page/\r\n"); &write_keep_alive(0); &write_data("\r\n"); &log_request($loghost, $authuser, $reqline, 302, 0); return 0; } # A directory.. check for index files local $foundidx; foreach $idx (split(/\s+/, $config{"index_docs"})) { $idxfull = "$full/$idx"; @stidxfull = stat($idxfull); if (-r _ && !-d _) { $cgi_pwd = $full; $full = $idxfull; @stfull = @stidxfull; $scriptname .= "/" if ($scriptname ne "/"); $foundidx++; last; } } @stfull = stat($full) if (!$foundidx); } if (-d _) { # This is definately a directory.. list it print DEBUG "handle_request: listing directory\n"; local $resp = "HTTP/1.0 $ok_code $ok_message\r\n". "Date: $datestr\r\n". "Server: $config{server}\r\n". "Content-type: text/html; Charset=iso-8859-1\r\n"; &write_data($resp); &write_keep_alive(0); &write_data("\r\n"); &reset_byte_count(); &write_data("<h1>Index of $simple</h1>\n"); &write_data("<pre>\n"); &write_data(sprintf "%-35.35s %-20.20s %-10.10s\n", "Name", "Last Modified", "Size"); &write_data("<hr>\n"); opendir(DIR, $full); while($df = readdir(DIR)) { if ($df =~ /^\./) { next; } $fulldf = $full eq "/" ? $full.$df : $full."/".$df; (@stbuf = stat($fulldf)) || next; if (-d _) { $df .= "/"; } @tm = localtime($stbuf[9]); $fdate = sprintf "%2.2d/%2.2d/%4.4d %2.2d:%2.2d:%2.2d", $tm[3],$tm[4]+1,$tm[5]+1900, $tm[0],$tm[1],$tm[2]; $len = length($df); $rest = " "x(35-$len); &write_data(sprintf "<a href=\"%s\">%-${len}.${len}s</a>$rest %-20.20s %-10.10s\n", &urlize($df), &html_strip($df), $fdate, $stbuf[7]); } closedir(DIR); &log_request($loghost, $authuser, $reqline, $ok_code, &byte_count()); return 0; } # CGI or normal file local $rv; if (&get_type($full) eq "internal/cgi" && $validated != 4) { # A CGI program to execute print DEBUG "handle_request: executing CGI\n"; $envtz = $ENV{"TZ"}; $envuser = $ENV{"USER"}; $envpath = $ENV{"PATH"}; $envlang = $ENV{"LANG"}; $envroot = $ENV{"SystemRoot"}; $envperllib = $ENV{'PERLLIB'}; foreach my $k (keys %ENV) { delete($ENV{$k}); } $ENV{"PATH"} = $envpath if ($envpath); $ENV{"TZ"} = $envtz if ($envtz); $ENV{"USER"} = $envuser if ($envuser); $ENV{"OLD_LANG"} = $envlang if ($envlang); $ENV{"SystemRoot"} = $envroot if ($envroot); $ENV{'PERLLIB'} = $envperllib if ($envperllib); $ENV{"HOME"} = $user_homedir; $ENV{"SERVER_SOFTWARE"} = $config{"server"}; $ENV{"SERVER_NAME"} = $host; $ENV{"SERVER_ADMIN"} = $config{"email"}; $ENV{"SERVER_ROOT"} = $roots[0]; $ENV{"SERVER_REALROOT"} = $realroot; $ENV{"SERVER_PORT"} = $port; $ENV{"REMOTE_HOST"} = $acpthost; $ENV{"REMOTE_ADDR"} = $acptip; $ENV{"REMOTE_ADDR_PROTOCOL"} = $ipv6 ? 6 : 4; $ENV{"REMOTE_USER"} = $authuser; $ENV{"BASE_REMOTE_USER"} = $authuser ne $baseauthuser ? $baseauthuser : undef; $ENV{"REMOTE_PASS"} = $authpass if (defined($authpass) && $config{'pass_password'}); if ($uinfo && $uinfo->{'proto'}) { $ENV{"REMOTE_USER_PROTO"} = $uinfo->{'proto'}; $ENV{"REMOTE_USER_ID"} = $uinfo->{'id'}; } print DEBUG "REMOTE_USER = ",$ENV{"REMOTE_USER"},"\n"; print DEBUG "BASE_REMOTE_USER = ",$ENV{"BASE_REMOTE_USER"},"\n"; print DEBUG "proto=$uinfo->{'proto'} id=$uinfo->{'id'}\n" if ($uinfo); $ENV{"SSL_USER"} = $peername if ($validated == 2); $ENV{"ANONYMOUS_USER"} = "1" if ($validated == 3 || $validated == 4); $ENV{"DOCUMENT_ROOT"} = $roots[0]; $ENV{"DOCUMENT_REALROOT"} = $realroot; $ENV{"GATEWAY_INTERFACE"} = "CGI/1.1"; $ENV{"SERVER_PROTOCOL"} = "HTTP/1.0"; $ENV{"REQUEST_METHOD"} = $method; $ENV{"SCRIPT_NAME"} = $scriptname; $ENV{"SCRIPT_FILENAME"} = $full; $ENV{"REQUEST_URI"} = $request_uri; $ENV{"PATH_INFO"} = $pathinfo; if ($pathinfo) { $ENV{"PATH_TRANSLATED"} = "$roots[0]$pathinfo"; $ENV{"PATH_REALTRANSLATED"} = "$realroot$pathinfo"; } $ENV{"QUERY_STRING"} = $querystring; $ENV{"MINISERV_CONFIG"} = $config_file; $ENV{"HTTPS"} = $use_ssl || $config{'inetd_ssl'} ? "ON" : ""; $ENV{"MINISERV_PID"} = $miniserv_main_pid; $ENV{"SESSION_ID"} = $session_id if ($session_id); $ENV{"LOCAL_USER"} = $localauth_user if ($localauth_user); $ENV{"MINISERV_INTERNAL"} = $miniserv_internal if ($miniserv_internal); if (defined($header{"content-length"})) { $ENV{"CONTENT_LENGTH"} = $header{"content-length"}; } if (defined($header{"content-type"})) { $ENV{"CONTENT_TYPE"} = $header{"content-type"}; } foreach $h (keys %header) { ($hname = $h) =~ tr/a-z/A-Z/; $hname =~ s/\-/_/g; $ENV{"HTTP_$hname"} = $header{$h}; } $ENV{"PWD"} = $cgi_pwd; foreach $k (keys %config) { if ($k =~ /^env_(\S+)$/) { $ENV{$1} = $config{$k}; } } delete($ENV{'HTTP_AUTHORIZATION'}); $ENV{'HTTP_COOKIE'} =~ s/;?\s*$sidname=([a-f0-9]+)//; $ENV{'MOBILE_DEVICE'} = 1 if ($mobile_device); # Check if the CGI can be handled internally open(CGI, $full); local $first = <CGI>; close(CGI); $first =~ s/[#!\r\n]//g; $nph_script = ($full =~ /\/nph-([^\/]+)$/); seek(STDERR, 0, 2); if (!$config{'forkcgis'} && ($first eq $perl_path || $first eq $linked_perl_path || $first =~ /\/perl$/ || $first =~ /^\/\S+\/env\s+perl$/) && $] >= 5.004 || $config{'internalcgis'}) { # setup environment for eval chdir($ENV{"PWD"}); @ARGV = split(/\s+/, $queryargs); $0 = $full; if ($posted_data) { # Already read the post input $postinput = $posted_data; } $clen = $header{"content-length"}; $SIG{'CHLD'} = 'DEFAULT'; eval { # Have SOCK closed if the perl exec's something use Fcntl; fcntl(SOCK, F_SETFD, FD_CLOEXEC); }; #shutdown(SOCK, 0); if ($config{'log'}) { open(MINISERVLOG, ">>$config{'logfile'}"); if ($config{'logperms'}) { chmod(oct($config{'logperms'}), $config{'logfile'}); } else { chmod(0600, $config{'logfile'}); } } $doing_cgi_eval = 1; $main_process_id = $$; $pkg = "main"; if ($full =~ /^\Q$foundroot\E\/([^\/]+)\//) { # Eval in package from Webmin module name $pkg = $1; $pkg =~ s/[^A-Za-z0-9]/_/g; } eval " \%pkg::ENV = \%ENV; package $pkg; tie(*STDOUT, 'miniserv'); tie(*STDIN, 'miniserv'); do \$miniserv::full; die \$@ if (\$@); "; $doing_cgi_eval = 0; if ($@) { # Error in perl! &http_error(500, "Perl execution failed", $config{'noshowstderr'} ? undef : $@); } elsif (!$doneheaders && !$nph_script) { &http_error(500, "Missing Headers"); } $rv = 0; } else { $infile = undef; if (!$on_windows) { # fork the process that actually executes the CGI pipe(CGIINr, CGIINw); pipe(CGIOUTr, CGIOUTw); pipe(CGIERRr, CGIERRw); if (!($cgipid = fork())) { @execargs = ( $full, split(/\s+/, $queryargs) ); chdir($ENV{"PWD"}); close(SOCK); open(STDIN, "<&CGIINr"); open(STDOUT, ">&CGIOUTw"); open(STDERR, ">&CGIERRw"); close(CGIINw); close(CGIOUTr); close(CGIERRr); exec(@execargs) || die "Failed to exec $full : $!\n"; exit(0); } close(CGIINr); close(CGIOUTw); close(CGIERRw); } else { # write CGI input to a temp file $infile = "$config{'tempbase'}.$$"; open(CGIINw, ">$infile"); # NOT binary mode, as CGIs don't read in it! } # send post data if ($posted_data) { # already read the posted data print CGIINw $posted_data; } $clen = $header{"content-length"}; if ($method eq "POST" && $clen_read < $clen) { $SIG{'PIPE'} = 'IGNORE'; $got = $clen_read; while($got < $clen) { $buf = &read_data($clen-$got); if (!length($buf)) { kill('TERM', $cgipid); unlink($infile) if ($infile); &http_error(500, "Failed to read ". "POST request"); } $got += length($buf); local ($wrote) = (print CGIINw $buf); last if (!$wrote); } # If the CGI terminated early, we still need to read # from the browser and throw away while($got < $clen) { $buf = &read_data($clen-$got); if (!length($buf)) { kill('TERM', $cgipid); unlink($infile) if ($infile); &http_error(500, "Failed to read ". "POST request"); } $got += length($buf); } $SIG{'PIPE'} = 'DEFAULT'; } close(CGIINw); shutdown(SOCK, 0); if ($on_windows) { # Run the CGI program, and feed it input chdir($ENV{"PWD"}); local $qqueryargs = join(" ", map { "\"$_\"" } split(/\s+/, $queryargs)); if ($first =~ /(perl|perl.exe)$/i) { # On Windows, run with Perl open(CGIOUTr, "$perl_path \"$full\" $qqueryargs <$infile |"); } else { open(CGIOUTr, "\"$full\" $qqueryargs <$infile |"); } binmode(CGIOUTr); } if (!$nph_script) { # read back cgi headers select(CGIOUTr); $|=1; select(STDOUT); $got_blank = 0; while(1) { $line = <CGIOUTr>; $line =~ s/\r|\n//g; if ($line eq "") { if ($got_blank || %cgiheader) { last; } $got_blank++; next; } if ($line !~ /^(\S+):\s+(.*)$/) { $errs = &read_errors(CGIERRr); close(CGIOUTr); close(CGIERRr); unlink($infile) if ($infile); &http_error(500, "Bad Header", $errs); } $cgiheader{lc($1)} = $2; push(@cgiheader, [ $1, $2 ]); } if ($cgiheader{"location"}) { &write_data("HTTP/1.0 302 Moved Temporarily\r\n"); &write_data("Date: $datestr\r\n"); &write_data("Server: $config{'server'}\r\n"); &write_keep_alive(0); # ignore the rest of the output. This is a hack, # but is necessary for IE in some cases :( close(CGIOUTr); close(CGIERRr); } elsif ($cgiheader{"content-type"} eq "") { close(CGIOUTr); close(CGIERRr); unlink($infile) if ($infile); $errs = &read_errors(CGIERRr); &http_error(500, "Missing Content-Type Header", $config{'noshowstderr'} ? undef : $errs); } else { &write_data("HTTP/1.0 $ok_code $ok_message\r\n"); &write_data("Date: $datestr\r\n"); &write_data("Server: $config{'server'}\r\n"); &write_keep_alive(0); } foreach $h (@cgiheader) { &write_data("$h->[0]: $h->[1]\r\n"); } &write_data("\r\n"); } &reset_byte_count(); while($line = <CGIOUTr>) { &write_data($line); } close(CGIOUTr); close(CGIERRr); unlink($infile) if ($infile); $rv = 0; } } else { # A file to output print DEBUG "handle_request: outputting file $full\n"; $gzfile = $full.".gz"; $gzipped = 0; if ($config{'gzip'} ne '0' && -r $gzfile && $acceptenc{'gzip'}) { # Using gzipped version @stopen = stat($gzfile); if ($stopen[9] >= $stfull[9] && open(FILE, $gzfile)) { print DEBUG "handle_request: using gzipped $gzfile\n"; $gzipped = 1; } } if (!$gzipped) { # Using original file @stopen = @stfull; open(FILE, $full) || &http_error(404, "Failed to open file"); } binmode(FILE); # Build common headers local $etime = &get_expires_time($simple); local $resp = "HTTP/1.0 $ok_code $ok_message\r\n". "Date: $datestr\r\n". "Server: $config{server}\r\n". "Content-type: ".&get_type($full)."\r\n". "Last-Modified: ".&http_date($stopen[9])."\r\n". "Expires: ".&http_date(time()+$etime)."\r\n". "Cache-Control: public; max-age=".$etime."\r\n"; if (!$gzipped && $use_gzip && $acceptenc{'gzip'} && &should_gzip_file($full)) { # Load and compress file, then output print DEBUG "handle_request: outputting gzipped file $full\n"; open(FILE, $full) || &http_error(404, "Failed to open file"); { local $/ = undef; $data = <FILE>; } close(FILE); @stopen = stat($file); $data = Compress::Zlib::memGzip($data); $resp .= "Content-length: ".length($data)."\r\n". "Content-Encoding: gzip\r\n"; &write_data($resp); $rv = &write_keep_alive(); &write_data("\r\n"); &reset_byte_count(); &write_data($data); } else { # Stream file output $resp .= "Content-length: $stopen[7]\r\n"; $resp .= "Content-Encoding: gzip\r\n" if ($gzipped); &write_data($resp); $rv = &write_keep_alive(); &write_data("\r\n"); &reset_byte_count(); my $bufsize = $config{'bufsize'} || 1024; while(read(FILE, $buf, $bufsize) > 0) { &write_data($buf); } close(FILE); } } # log the request &log_request($loghost, $authuser, $reqline, $logged_code ? $logged_code : $cgiheader{"location"} ? "302" : $ok_code, &byte_count()); return $rv; } # http_error(code, message, body, [dontexit]) sub http_error { local $eh = $error_handler_recurse ? undef : $config{"error_handler_$_[0]"} ? $config{"error_handler_$_[0]"} : $config{'error_handler'} ? $config{'error_handler'} : undef; print DEBUG "http_error code=$_[0] message=$_[1] body=$_[2]\n"; if ($eh) { # Call a CGI program for the error $page = "/$eh"; $querystring = "code=$_[0]&message=".&urlize($_[1]). "&body=".&urlize($_[2]); $error_handler_recurse++; $ok_code = $_[0]; $ok_message = $_[1]; goto rerun; } else { # Use the standard error message display &write_data("HTTP/1.0 $_[0] $_[1]\r\n"); &write_data("Server: $config{server}\r\n"); &write_data("Date: $datestr\r\n"); &write_data("Content-type: text/html; Charset=iso-8859-1\r\n"); &write_keep_alive(0); &write_data("\r\n"); &reset_byte_count(); &write_data("<h1>Error - $_[1]</h1>\n"); if ($_[2]) { &write_data("<p>$_[2]</p>\n"); } } &log_request($loghost, $authuser, $reqline, $_[0], &byte_count()) if ($reqline); &log_error($_[1], $_[2] ? " : $_[2]" : ""); shutdown(SOCK, 1); exit if (!$_[3]); } sub get_type { if ($_[0] =~ /\.([A-z0-9]+)$/) { $t = $mime{$1}; if ($t ne "") { return $t; } } return "text/plain"; } # simplify_path(path, bogus) # Given a path, maybe containing stuff like ".." and "." convert it to a # clean, absolute form. sub simplify_path { local($dir, @bits, @fixedbits, $b); $dir = $_[0]; $dir =~ s/\\/\//g; # fix windows \ in path $dir =~ s/^\/+//g; $dir =~ s/\/+$//g; $dir =~ s/\0//g; # remove null bytes @bits = split(/\/+/, $dir); @fixedbits = (); $_[1] = 0; foreach $b (@bits) { if ($b eq ".") { # Do nothing.. } elsif ($b eq ".." || $b eq "...") { # Remove last dir if (scalar(@fixedbits) == 0) { $_[1] = 1; return "/"; } pop(@fixedbits); } else { # Add dir to list push(@fixedbits, $b); } } return "/" . join('/', @fixedbits); } # b64decode(string) # Converts a string from base64 format to normal sub b64decode { local($str) = $_[0]; local($res); $str =~ tr|A-Za-z0-9+=/||cd; $str =~ s/=+$//; $str =~ tr|A-Za-z0-9+/| -_|; while ($str =~ /(.{1,60})/gs) { my $len = chr(32 + length($1)*3/4); $res .= unpack("u", $len . $1 ); } return $res; } # ip_match(remoteip, localip, [match]+) # Checks an IP address against a list of IPs, networks and networks/masks sub ip_match { local(@io, @mo, @ms, $i, $j, $hn, $needhn); @io = &check_ip6address($_[0]) ? split(/:/, $_[0]) : split(/\./, $_[0]); for($i=2; $i<@_; $i++) { $needhn++ if ($_[$i] =~ /^\*(\S+)$/); } if ($needhn && !defined($hn = $ip_match_cache{$_[0]})) { # Reverse-lookup hostname if any rules match based on it $hn = &to_hostname($_[0]); if (&check_ip6address($_[0])) { $hn = "" if (&to_ip6address($hn) ne $_[0]); } else { $hn = "" if (&to_ipaddress($hn) ne $_[0]); } $ip_match_cache{$_[0]} = $hn; } for($i=2; $i<@_; $i++) { local $mismatch = 0; if ($_[$i] =~ /^([0-9\.]+)\/(\d+)$/) { # Convert CIDR to netmask format $_[$i] = $1."/".&prefix_to_mask($2); } if ($_[$i] =~ /^([0-9\.]+)\/([0-9\.]+)$/) { # Compare with IPv4 network/mask @mo = split(/\./, $1); @ms = split(/\./, $2); for($j=0; $j<4; $j++) { if ((int($io[$j]) & int($ms[$j])) != (int($mo[$j]) & int($ms[$j]))) { $mismatch = 1; } } } elsif ($_[$i] =~ /^([0-9\.]+)-([0-9\.]+)$/) { # Compare with an IPv4 range (separated by a hyphen -) local ($remote, $min, $max); local @low = split(/\./, $1); local @high = split(/\./, $2); for($j=0; $j<4; $j++) { $remote += $io[$j] << ((3-$j)*8); $min += $low[$j] << ((3-$j)*8); $max += $high[$j] << ((3-$j)*8); } if ($remote < $min || $remote > $max) { $mismatch = 1; } } elsif ($_[$i] =~ /^\*(\S+)$/) { # Compare with hostname regexp $mismatch = 1 if ($hn !~ /^.*\Q$1\E$/i); } elsif ($_[$i] eq 'LOCAL' && &check_ipaddress($_[1])) { # Compare with local IPv4 network local @lo = split(/\./, $_[1]); if ($lo[0] < 128) { $mismatch = 1 if ($lo[0] != $io[0]); } elsif ($lo[0] < 192) { $mismatch = 1 if ($lo[0] != $io[0] || $lo[1] != $io[1]); } else { $mismatch = 1 if ($lo[0] != $io[0] || $lo[1] != $io[1] || $lo[2] != $io[2]); } } elsif ($_[$i] eq 'LOCAL' && &check_ip6address($_[1])) { # Compare with local IPv6 network, which is always first 4 words local @lo = split(/:/, $_[1]); for(my $i=0; $i<4; $i++) { $mismatch = 1 if ($lo[$i] ne $io[$i]); } } elsif ($_[$i] =~ /^[0-9\.]+$/) { # Compare with a full or partial IPv4 address @mo = split(/\./, $_[$i]); while(@mo && !$mo[$#mo]) { pop(@mo); } for($j=0; $j<@mo; $j++) { if ($mo[$j] != $io[$j]) { $mismatch = 1; } } } elsif ($_[$i] =~ /^[a-f0-9:]+$/) { # Compare with a full IPv6 address if (&canonicalize_ip6($_[$i]) ne canonicalize_ip6($_[0])) { $mismatch = 1; } } elsif ($_[$i] =~ /^([a-f0-9:]+)\/(\d+)$/) { # Compare with an IPv6 network local $v6size = $2; local $v6addr = &canonicalize_ip6($1); local $bytes = $v6size / 16; @mo = split(/:/, $v6addr); local @io6 = split(/:/, &canonicalize_ip6($_[0])); for($j=0; $j<$bytes; $j++) { if ($mo[$j] ne $io6[$j]) { $mismatch = 1; } } } elsif ($_[$i] !~ /^[0-9\.]+$/) { # Compare with hostname $mismatch = 1 if ($_[0] ne &to_ipaddress($_[$i])); } return 1 if (!$mismatch); } return 0; } # users_match(&uinfo, user, ...) # Returns 1 if a user is in a list of users and groups sub users_match { local $uinfo = shift(@_); local $u; local @ginfo = getgrgid($uinfo->[3]); foreach $u (@_) { if ($u =~ /^\@(\S+)$/) { return 1 if (&is_group_member($uinfo, $1)); } elsif ($u =~ /^(\d*)-(\d*)$/ && ($1 || $2)) { return (!$1 || $uinfo[2] >= $1) && (!$2 || $uinfo[2] <= $2); } else { return 1 if ($u eq $uinfo->[0]); } } return 0; } # restart_miniserv() # Called when a SIGHUP is received to restart the web server. This is done # by exec()ing perl with the same command line as was originally used sub restart_miniserv { print STDERR "restarting miniserv\n"; &log_error("Restarting"); close(SOCK); &close_all_sockets(); &close_all_pipes(); dbmclose(%sessiondb); kill('KILL', $logclearer) if ($logclearer); kill('KILL', $extauth) if ($extauth); exec($perl_path, $miniserv_path, @miniserv_argv); die "Failed to restart miniserv with $perl_path $miniserv_path"; } sub trigger_restart { $need_restart = 1; } sub trigger_reload { $need_reload = 1; } # to_ip46address(address, ...) # Convert hostnames to v4 and v6 addresses, if possible sub to_ip46address { local @rv; foreach my $i (@_) { if (&check_ipaddress($i) || &check_ip6address($i)) { push(@rv, $i); } else { my $addr = &to_ipaddress($i); $addr ||= &to_ip6address($i); push(@rv, $addr) if ($addr); } } return @rv; } # to_ipaddress(address, ...) sub to_ipaddress { local (@rv, $i); foreach $i (@_) { if ($i =~ /(\S+)\/(\S+)/ || $i =~ /^\*\S+$/ || $i eq 'LOCAL' || $i =~ /^[0-9\.]+$/ || $i =~ /^[a-f0-9:]+$/) { # A pattern or IP, not a hostname, so don't change push(@rv, $i); } else { # Lookup IP address push(@rv, join('.', unpack("CCCC", inet_aton($i)))); } } return wantarray ? @rv : $rv[0]; } # to_ip6address(address, ...) sub to_ip6address { local (@rv, $i); foreach $i (@_) { if ($i =~ /(\S+)\/(\S+)/ || $i =~ /^\*\S+$/ || $i eq 'LOCAL' || $i =~ /^[0-9\.]+$/ || $i =~ /^[a-f0-9:]+$/) { # A pattern, not a hostname, so don't change push(@rv, $i); } elsif ($config{'ipv6'}) { # Lookup IPv6 address local ($inaddr, $addr); eval { (undef, undef, undef, $inaddr) = getaddrinfo($i, undef, AF_INET6(), SOCK_STREAM); }; if ($inaddr) { push(@rv, undef); } else { (undef, $addr) = unpack_sockaddr_in6($inaddr); push(@rv, inet_ntop(AF_INET6(), $addr)); } } } return wantarray ? @rv : $rv[0]; } # to_hostname(ipv4|ipv6-address) # Reverse-resolves an IPv4 or 6 address to a hostname sub to_hostname { local ($addr) = @_; if (&check_ip6address($_[0])) { return gethostbyaddr(inet_pton(AF_INET6(), $addr), AF_INET6()); } else { return gethostbyaddr(inet_aton($addr), AF_INET); } } # read_line(no-wait, no-limit) # Reads one line from SOCK or SSL sub read_line { local ($nowait, $nolimit) = @_; local($idx, $more, $rv); while(($idx = index($main::read_buffer, "\n")) < 0) { if (length($main::read_buffer) > 100000 && !$nolimit) { &http_error(414, "Request too long", "Received excessive line <pre>".&html_strip($main::read_buffer)."</pre>"); } # need to read more.. &wait_for_data_error() if (!$nowait); if ($use_ssl) { $more = Net::SSLeay::read($ssl_con); } else { my $bufsize = $config{'bufsize'} || 1024; local $ok = sysread(SOCK, $more, $bufsize); $more = undef if ($ok <= 0); } if ($more eq '') { # end of the data $rv = $main::read_buffer; undef($main::read_buffer); return $rv; } $main::read_buffer .= $more; } $rv = substr($main::read_buffer, 0, $idx+1); $main::read_buffer = substr($main::read_buffer, $idx+1); return $rv; } # read_data(length) # Reads up to some amount of data from SOCK or the SSL connection sub read_data { local ($rv); if (length($main::read_buffer)) { if (length($main::read_buffer) > $_[0]) { # Return the first part of the buffer $rv = substr($main::read_buffer, 0, $_[0]); $main::read_buffer = substr($main::read_buffer, $_[0]); return $rv; } else { # Return the whole buffer $rv = $main::read_buffer; undef($main::read_buffer); return $rv; } } elsif ($use_ssl) { # Call SSL read function return Net::SSLeay::read($ssl_con, $_[0]); } else { # Just do a normal read local $buf; sysread(SOCK, $buf, $_[0]) || return undef; return $buf; } } # sysread_line(fh) # Read a line from a file handle, using sysread to get a byte at a time sub sysread_line { local ($fh) = @_; local $line; while(1) { local ($buf, $got); $got = sysread($fh, $buf, 1); last if ($got <= 0); $line .= $buf; last if ($buf eq "\n"); } return $line; } # wait_for_data(secs) # Waits at most the given amount of time for some data on SOCK, returning # 0 if not found, 1 if some arrived. sub wait_for_data { local $rmask; vec($rmask, fileno(SOCK), 1) = 1; local $got = select($rmask, undef, undef, $_[0]); return $got == 0 ? 0 : 1; } # wait_for_data_error() # Waits 60 seconds for data on SOCK, and fails if none arrives sub wait_for_data_error { local $got = &wait_for_data(60); if (!$got) { &http_error(400, "Timeout", "Waited more than 60 seconds for request data"); } } # write_data(data, ...) # Writes a string to SOCK or the SSL connection sub write_data { local $str = join("", @_); if ($use_ssl) { Net::SSLeay::write($ssl_con, $str); } else { syswrite(SOCK, $str, length($str)); } # Intentionally introduce a small delay to avoid problems where IE reports # the page as empty / DNS failed when it get a large response too quickly! select(undef, undef, undef, .01) if ($write_data_count%10 == 0); $write_data_count += length($str); } # reset_byte_count() sub reset_byte_count { $write_data_count = 0; } # byte_count() sub byte_count { return $write_data_count; } # log_request(hostname, user, request, code, bytes) sub log_request { if ($config{'log'}) { local ($user, $ident, $headers); if ($config{'logident'}) { # add support for rfc1413 identity checking here } else { $ident = "-"; } $user = $_[1] ? $_[1] : "-"; local $dstr = &make_datestr(); if (fileno(MINISERVLOG)) { seek(MINISERVLOG, 0, 2); } else { open(MINISERVLOG, ">>$config{'logfile'}"); chmod(0600, $config{'logfile'}); } if (defined($config{'logheaders'})) { foreach $h (split(/\s+/, $config{'logheaders'})) { $headers .= " $h=\"$header{$h}\""; } } elsif ($config{'logclf'}) { $headers = " \"$header{'referer'}\" \"$header{'user-agent'}\""; } else { $headers = ""; } print MINISERVLOG "$_[0] $ident $user [$dstr] \"$_[2]\" ", "$_[3] $_[4]$headers\n"; close(MINISERVLOG); } } # make_datestr() sub make_datestr { local @tm = localtime(time()); return sprintf "%2.2d/%s/%4.4d:%2.2d:%2.2d:%2.2d %s", $tm[3], $month[$tm[4]], $tm[5]+1900, $tm[2], $tm[1], $tm[0], $timezone; } # log_error(message) sub log_error { seek(STDERR, 0, 2); print STDERR "[",&make_datestr(),"] ", $acpthost ? ( "[",$acpthost,"] " ) : ( ), $page ? ( $page," : " ) : ( ), @_,"\n"; } # read_errors(handle) # Read and return all input from some filehandle sub read_errors { local($fh, $_, $rv); $fh = $_[0]; while(<$fh>) { $rv .= $_; } return $rv; } sub write_keep_alive { local $mode; if ($config{'nokeepalive'}) { # Keep alives have been disabled in config $mode = 0; } elsif (@childpids > $config{'maxconns'}*.8) { # Disable because nearing process limit $mode = 0; } elsif (@_) { # Keep alive specified by caller $mode = $_[0]; } else { # Keep alive determined by browser $mode = $header{'connection'} =~ /keep-alive/i; } &write_data("Connection: ".($mode ? "Keep-Alive" : "close")."\r\n"); return $mode; } sub term_handler { kill('TERM', @childpids) if (@childpids); kill('KILL', $logclearer) if ($logclearer); kill('KILL', $extauth) if ($extauth); exit(1); } sub http_date { local @tm = gmtime($_[0]); return sprintf "%s, %d %s %d %2.2d:%2.2d:%2.2d GMT", $weekday[$tm[6]], $tm[3], $month[$tm[4]], $tm[5]+1900, $tm[2], $tm[1], $tm[0]; } sub TIEHANDLE { my $i; bless \$i, shift; } sub WRITE { $r = shift; my($buf,$len,$offset) = @_; &write_to_sock(substr($buf, $offset, $len)); $miniserv::page_capture_out .= substr($buf, $offset, $len) if ($miniserv::page_capture); } sub PRINT { $r = shift; $$r++; my $buf = join(defined($,) ? $, : "", @_); $buf .= $\ if defined($\); &write_to_sock($buf); $miniserv::page_capture_out .= $buf if ($miniserv::page_capture); } sub PRINTF { shift; my $fmt = shift; my $buf = sprintf $fmt, @_; &write_to_sock($buf); $miniserv::page_capture_out .= $buf if ($miniserv::page_capture); } # Send back already read data while we have it, then read from SOCK sub READ { my $r = shift; my $bufref = \$_[0]; my $len = $_[1]; my $offset = $_[2]; if ($postpos < length($postinput)) { # Reading from already fetched array my $left = length($postinput) - $postpos; my $canread = $len > $left ? $left : $len; substr($$bufref, $offset, $canread) = substr($postinput, $postpos, $canread); $postpos += $canread; return $canread; } else { # Read from network socket local $data = &read_data($len); if ($data eq '' && $len) { # End of socket shutdown(SOCK, 0); } substr($$bufref, $offset, length($data)) = $data; return length($data); } } sub OPEN { #print STDERR "open() called - should never happen!\n"; } # Read a line of input sub READLINE { my $r = shift; if ($postpos < length($postinput) && ($idx = index($postinput, "\n", $postpos)) >= 0) { # A line exists in the memory buffer .. use it my $line = substr($postinput, $postpos, $idx-$postpos+1); $postpos = $idx+1; return $line; } else { # Need to read from the socket my $line; if ($postpos < length($postinput)) { # Start with in-memory data $line = substr($postinput, $postpos); $postpos = length($postinput); } my $nl = &read_line(0, 1); if ($nl eq '') { # End of socket shutdown(SOCK, 0); } $line .= $nl if (defined($nl)); return $line; } } # Read one character of input sub GETC { my $r = shift; my $buf; my $got = READ($r, \$buf, 1, 0); return $got > 0 ? $buf : undef; } sub FILENO { return fileno(SOCK); } sub CLOSE { } sub DESTROY { } # write_to_sock(data, ...) sub write_to_sock { local $d; foreach $d (@_) { if ($doneheaders || $miniserv::nph_script) { &write_data($d); } else { $headers .= $d; while(!$doneheaders && $headers =~ s/^([^\r\n]*)(\r)?\n//) { if ($1 =~ /^(\S+):\s+(.*)$/) { $cgiheader{lc($1)} = $2; push(@cgiheader, [ $1, $2 ]); } elsif ($1 !~ /\S/) { $doneheaders++; } else { &http_error(500, "Bad Header"); } } if ($doneheaders) { if ($cgiheader{"location"}) { &write_data( "HTTP/1.0 302 Moved Temporarily\r\n"); &write_data("Date: $datestr\r\n"); &write_data("Server: $config{server}\r\n"); &write_keep_alive(0); } elsif ($cgiheader{"content-type"} eq "") { &http_error(500, "Missing Content-Type Header"); } else { &write_data("HTTP/1.0 $ok_code $ok_message\r\n"); &write_data("Date: $datestr\r\n"); &write_data("Server: $config{server}\r\n"); &write_keep_alive(0); } foreach $h (@cgiheader) { &write_data("$h->[0]: $h->[1]\r\n"); } &write_data("\r\n"); &reset_byte_count(); &write_data($headers); } } } } sub verify_client { local $cert = Net::SSLeay::X509_STORE_CTX_get_current_cert($_[1]); if ($cert) { local $errnum = Net::SSLeay::X509_STORE_CTX_get_error($_[1]); $verified_client = 1 if (!$errnum); } return 1; } sub END { if ($doing_cgi_eval && $$ == $main_process_id) { # A CGI program called exit! This is a horrible hack to # finish up before really exiting shutdown(SOCK, 1); close(SOCK); close($PASSINw); close($PASSOUTw); &log_request($loghost, $authuser, $reqline, $cgiheader{"location"} ? "302" : $ok_code, &byte_count()); } } # urlize # Convert a string to a form ok for putting in a URL sub urlize { local($tmp, $tmp2, $c); $tmp = $_[0]; $tmp2 = ""; while(($c = chop($tmp)) ne "") { if ($c !~ /[A-z0-9]/) { $c = sprintf("%%%2.2X", ord($c)); } $tmp2 = $c . $tmp2; } return $tmp2; } # validate_user(username, password, host, remote-ip, webmin-port) # Checks if some username and password are valid. Returns the modified username, # the expired / temp pass flag, the non-existence flag, and the underlying # Webmin username. sub validate_user { local ($user, $pass, $host, $actpip, $port) = @_; return ( ) if (!$user); print DEBUG "validate_user: user=$user pass=$pass host=$host\n"; local ($canuser, $canmode, $notexist, $webminuser, $sudo) = &can_user_login($user, undef, $host); print DEBUG "validate_user: canuser=$canuser canmode=$canmode notexist=$notexist webminuser=$webminuser sudo=$sudo\n"; if ($notexist) { # User doesn't even exist, so go no further return ( undef, 0, 1, $webminuser ); } elsif ($canmode == 0) { # User does exist but cannot login return ( $canuser, 0, 0, $webminuser ); } elsif ($canmode == 1) { # Attempt Webmin authentication my $uinfo = &get_user_details($webminuser); if ($uinfo && &password_crypt($pass, $uinfo->{'pass'}) eq $uinfo->{'pass'}) { # Password is valid .. but check for expiry local $lc = $uinfo->{'lastchanges'}; print DEBUG "validate_user: Password is valid lc=$lc pass_maxdays=$config{'pass_maxdays'}\n"; if ($config{'pass_maxdays'} && $lc && !$uinfo->{'nochange'}) { local $daysold = (time() - $lc)/(24*60*60); print DEBUG "maxdays=$config{'pass_maxdays'} daysold=$daysold temppass=$uinfo->{'temppass'}\n"; if ($config{'pass_lockdays'} && $daysold > $config{'pass_lockdays'}) { # So old that the account is locked return ( undef, 0, 0, $webminuser ); } elsif ($daysold > $config{'pass_maxdays'}) { # Password has expired return ( $user, 1, 0, $webminuser ); } } if ($uinfo->{'temppass'}) { # Temporary password - force change now return ( $user, 2, 0, $webminuser ); } return ( $user, 0, 0, $webminuser ); } elsif (!$uinfo) { print DEBUG "validate_user: User $webminuser not found\n"; return ( undef, 0, 0, $webminuser ); } else { print DEBUG "validate_user: User $webminuser password mismatch $pass != $uinfo->{'pass'}\n"; return ( undef, 0, 0, $webminuser ); } } elsif ($canmode == 2 || $canmode == 3) { # Attempt PAM or passwd file authentication local $val = &validate_unix_user($canuser, $pass, $acptip, $port); print DEBUG "validate_user: unix val=$val\n"; if ($val && $sudo) { # Need to check if this Unix user can sudo if (!&check_sudo_permissions($canuser, $pass)) { print DEBUG "validate_user: sudo failed\n"; $val = 0; } else { print DEBUG "validate_user: sudo passed\n"; } } return $val == 2 ? ( $canuser, 1, 0, $webminuser ) : $val == 1 ? ( $canuser, 0, 0, $webminuser ) : ( undef, 0, 0, $webminuser ); } elsif ($canmode == 4) { # Attempt external authentication return &validate_external_user($canuser, $pass) ? ( $canuser, 0, 0, $webminuser ) : ( undef, 0, 0, $webminuser ); } else { # Can't happen! return ( ); } } # validate_unix_user(user, password, remote-ip, local-port) # Returns 1 if a username and password are valid under unix, 0 if not, # or 2 if the account has expired. # Checks PAM if available, and falls back to reading the system password # file otherwise. sub validate_unix_user { if ($use_pam) { # Check with PAM $pam_username = $_[0]; $pam_password = $_[1]; eval "use Authen::PAM;"; local $pamh = new Authen::PAM($config{'pam'}, $pam_username, \&pam_conv_func); if (ref($pamh)) { $pamh->pam_set_item(PAM_RHOST(), $_[2]) if ($_[2]); $pamh->pam_set_item(PAM_TTY(), $_[3]) if ($_[3]); local $rcode = 0; local $pam_ret = $pamh->pam_authenticate(); if ($pam_ret == PAM_SUCCESS()) { # Logged in OK .. make sure password hasn't expired local $acct_ret = $pamh->pam_acct_mgmt(); $pam_ret = $acct_ret; if ($acct_ret == PAM_SUCCESS()) { $pamh->pam_open_session(); $rcode = 1; } elsif ($acct_ret == PAM_NEW_AUTHTOK_REQD() || $acct_ret == PAM_ACCT_EXPIRED()) { $rcode = 2; } else { print STDERR "Unknown pam_acct_mgmt return value : $acct_ret\n"; $rcode = 0; } } if ($config{'pam_end'}) { $pamh->pam_end($pam_ret); } return $rcode; } } elsif ($config{'pam_only'}) { # Pam is not available, but configuration forces it's use! return 0; } elsif ($config{'passwd_file'}) { # Check in a password file local $rv = 0; open(FILE, $config{'passwd_file'}); if ($config{'passwd_file'} eq '/etc/security/passwd') { # Assume in AIX format while(<FILE>) { s/\s*$//; if (/^\s*(\S+):/ && $1 eq $_[0]) { $_ = <FILE>; if (/^\s*password\s*=\s*(\S+)\s*$/) { $rv = $1 eq &password_crypt($_[1], $1) ? 1 : 0; } last; } } } else { # Read the system password or shadow file while(<FILE>) { local @l = split(/:/, $_, -1); local $u = $l[$config{'passwd_uindex'}]; local $p = $l[$config{'passwd_pindex'}]; if ($u eq $_[0]) { $rv = $p eq &password_crypt($_[1], $p) ? 1 : 0; if ($config{'passwd_cindex'} ne '' && $rv) { # Password may have expired! local $c = $l[$config{'passwd_cindex'}]; local $m = $l[$config{'passwd_mindex'}]; local $day = time()/(24*60*60); if ($c =~ /^\d+/ && $m =~ /^\d+/ && $day - $c > $m) { # Yep, it has .. $rv = 2; } } if ($p eq "" && $config{'passwd_blank'}) { # Force password change $rv = 2; } last; } } } close(FILE); return $rv if ($rv); } # Fallback option - check password returned by getpw* local @uinfo = getpwnam($_[0]); if ($uinfo[1] ne '' && &password_crypt($_[1], $uinfo[1]) eq $uinfo[1]) { return 1; } return 0; # Totally failed } # validate_external_user(user, pass) # Validate a user by passing the username and password to an external # squid-style authentication program sub validate_external_user { return 0 if (!$config{'extauth'}); flock(EXTAUTH, 2); local $str = "$_[0] $_[1]\n"; syswrite(EXTAUTH, $str, length($str)); local $resp = <EXTAUTH>; flock(EXTAUTH, 8); return $resp =~ /^OK/i ? 1 : 0; } # can_user_login(username, no-append, host) # Checks if a user can login or not. # First return value is the username. # Second is 0 if cannot login, 1 if using Webmin pass, 2 if PAM, 3 if password # file, 4 if external. # Third is 1 if the user does not exist at all, 0 if he does. # Fourth is the Webmin username whose permissions apply, based on unixauth. # Fifth is a flag indicating if a sudo check is needed. sub can_user_login { local $uinfo = &get_user_details($_[0]); if (!$uinfo) { # See if this user exists in Unix and can be validated by the same # method as the unixauth webmin user local $realuser = $unixauth{$_[0]}; local @uinfo; local $sudo = 0; local $pamany = 0; eval { @uinfo = getpwnam($_[0]); }; # may fail on windows if (!$realuser && @uinfo) { # No unixauth entry for the username .. try his groups foreach my $ua (keys %unixauth) { if ($ua =~ /^\@(.*)$/) { if (&is_group_member(\@uinfo, $1)) { $realuser = $unixauth{$ua}; last; } } } } if (!$realuser && @uinfo) { # Fall back to unix auth for all Unix users $realuser = $unixauth{"*"}; } if (!$realuser && $use_sudo && @uinfo) { # Allow login effectively as root, if sudo permits it $sudo = 1; $realuser = "root"; } if (!$realuser && !@uinfo && $config{'pamany'}) { # If the user completely doesn't exist, we can still allow # him to authenticate via PAM $realuser = $config{'pamany'}; $pamany = 1; } if (!$realuser) { # For Usermin, always fall back to unix auth for any user, # so that later checks with domain added / removed are done. $realuser = $unixauth{"*"}; } return (undef, 0, 1, undef) if (!$realuser); local $uinfo = &get_user_details($realuser); return (undef, 0, 1, undef) if (!$uinfo); local $up = $uinfo->{'pass'}; # Work out possible domain names from the hostname local @doms = ( $_[2] ); if ($_[2] =~ /^([^\.]+)\.(\S+)$/) { push(@doms, $2); } if ($config{'user_mapping'} && !%user_mapping) { # Read the user mapping file %user_mapping = (); open(MAPPING, $config{'user_mapping'}); while(<MAPPING>) { s/\r|\n//g; s/#.*$//; if (/^(\S+)\s+(\S+)/) { if ($config{'user_mapping_reverse'}) { $user_mapping{$1} = $2; } else { $user_mapping{$2} = $1; } } } close(MAPPING); } # Check the user mapping file to see if there is an entry for the # user login in which specifies a new effective user local $um; foreach my $d (@doms) { $um ||= $user_mapping{"$_[0]\@$d"}; } $um ||= $user_mapping{$_[0]}; if (defined($um) && ($_[1]&4) == 0) { # A mapping exists - use it! return &can_user_login($um, $_[1]+4, $_[2]); } # Check if a user with the entered login and the domains appended # or prepended exists, and if so take it to be the effective user if (!@uinfo && $config{'domainuser'}) { # Try again with name.domain and name.firstpart local @firsts = map { /^([^\.]+)/; $1 } @doms; if (($_[1]&1) == 0) { local ($a, $p); foreach $a (@firsts, @doms) { foreach $p ("$_[0].${a}", "$_[0]-${a}", "${a}.$_[0]", "${a}-$_[0]", "$_[0]_${a}", "${a}_$_[0]") { local @vu = &can_user_login( $p, $_[1]+1, $_[2]); return @vu if ($vu[1]); } } } } # Check if the user entered a domain at the end of his username when # he really shouldn't have, and if so try without it if (!@uinfo && $config{'domainstrip'} && $_[0] =~ /^(\S+)\@(\S+)$/ && ($_[1]&2) == 0) { local ($stripped, $dom) = ($1, $2); local @vu = &can_user_login($stripped, $_[1] + 2, $_[2]); return @vu if ($vu[1]); local @vu = &can_user_login($stripped, $_[1] + 2, $dom); return @vu if ($vu[1]); } return ( undef, 0, 1, undef ) if (!@uinfo && !$pamany); if (@uinfo) { if (scalar(@allowusers)) { # Only allow people on the allow list return ( undef, 0, 0, undef ) if (!&users_match(\@uinfo, @allowusers)); } elsif (scalar(@denyusers)) { # Disallow people on the deny list return ( undef, 0, 0, undef ) if (&users_match(\@uinfo, @denyusers)); } if ($config{'shells_deny'}) { local $found = 0; open(SHELLS, $config{'shells_deny'}); while(<SHELLS>) { s/\r|\n//g; s/#.*$//; $found++ if ($_ eq $uinfo[8]); } close(SHELLS); return ( undef, 0, 0, undef ) if (!$found); } } if ($up eq 'x') { # PAM or passwd file authentication print DEBUG "can_user_login: Validate with PAM\n"; return ( $_[0], $use_pam ? 2 : 3, 0, $realuser, $sudo ); } elsif ($up eq 'e') { # External authentication print DEBUG "can_user_login: Validate externally\n"; return ( $_[0], 4, 0, $realuser, $sudo ); } else { # Fixed Webmin password print DEBUG "can_user_login: Validate by Webmin\n"; return ( $_[0], 1, 0, $realuser, $sudo ); } } elsif ($uinfo->{'pass'} eq 'x') { # Webmin user authenticated via PAM or password file return ( $_[0], $use_pam ? 2 : 3, 0, $_[0] ); } elsif ($uinfo->{'pass'} eq 'e') { # Webmin user authenticated externally return ( $_[0], 4, 0, $_[0] ); } else { # Normal Webmin user return ( $_[0], 1, 0, $_[0] ); } } # the PAM conversation function for interactive logins sub pam_conv_func { $pam_conv_func_called++; my @res; while ( @_ ) { my $code = shift; my $msg = shift; my $ans = ""; $ans = $pam_username if ($code == PAM_PROMPT_ECHO_ON() ); $ans = $pam_password if ($code == PAM_PROMPT_ECHO_OFF() ); push @res, PAM_SUCCESS(); push @res, $ans; } push @res, PAM_SUCCESS(); return @res; } sub urandom_timeout { close(RANDOM); } # get_socket_ip(handle, ipv6-flag) # Returns the local IP address of some connection, as both a string and in # binary format sub get_socket_ip { local ($fh, $ipv6) = @_; local $sn = getsockname($fh); return undef if (!$sn); return &get_address_ip($sn, $ipv6); } # get_address_ip(address, ipv6-flag) # Given a sockaddr object in binary format, return the binary address, text # address and port number sub get_address_ip { local ($sn, $ipv6) = @_; if ($ipv6) { local ($p, $b) = unpack_sockaddr_in6($sn); return ($b, inet_ntop(AF_INET6(), $b), $p); } else { local ($p, $b) = unpack_sockaddr_in($sn); return ($b, inet_ntoa($b), $p); } } # get_socket_name(handle, ipv6-flag) # Returns the local hostname or IP address of some connection sub get_socket_name { local ($fh, $ipv6) = @_; return $config{'host'} if ($config{'host'}); local ($mybin, $myaddr) = &get_socket_ip($fh, $ipv6); if (!$get_socket_name_cache{$myaddr}) { local $myname; if (!$config{'no_resolv_myname'}) { $myname = gethostbyaddr($mybin, $ipv6 ? AF_INET6() : AF_INET); } $myname ||= $myaddr; $get_socket_name_cache{$myaddr} = $myname; } return $get_socket_name_cache{$myaddr}; } # run_login_script(username, sid, remoteip, localip) sub run_login_script { if ($config{'login_script'}) { alarm(5); $SIG{'ALRM'} = sub { die "timeout" }; eval { system($config{'login_script'}. " ".join(" ", map { quotemeta($_) || '""' } @_). " >/dev/null 2>&1 </dev/null"); }; alarm(0); } } # run_logout_script(username, sid, remoteip, localip) sub run_logout_script { if ($config{'logout_script'}) { alarm(5); $SIG{'ALRM'} = sub { die "timeout" }; eval { system($config{'logout_script'}. " ".join(" ", map { quotemeta($_) || '""' } @_). " >/dev/null 2>&1 </dev/null"); }; alarm(0); } } # run_failed_script(username, reason-code, remoteip, localip) sub run_failed_script { if ($config{'failed_script'}) { $_[0] =~ s/\r|\n/ /g; alarm(5); $SIG{'ALRM'} = sub { die "timeout" }; eval { system($config{'failed_script'}. " ".join(" ", map { quotemeta($_) || '""' } @_). " >/dev/null 2>&1 </dev/null"); }; alarm(0); } } # close_all_sockets() # Closes all the main listening sockets sub close_all_sockets { local $s; foreach $s (@socketfhs) { close($s); } } # close_all_pipes() # Close all pipes for talking to sub-processes sub close_all_pipes { local $p; foreach $p (@passin) { close($p); } foreach $p (@passout) { close($p); } foreach $p (values %conversations) { if ($p->{'PAMOUTr'}) { close($p->{'PAMOUTr'}); close($p->{'PAMINw'}); } } } # check_user_ip(user) # Returns 1 if some user is allowed to login from the accepting IP, 0 if not sub check_user_ip { local ($username) = @_; local $uinfo = &get_user_details($username); return 1 if (!$uinfo); if ($uinfo->{'deny'} && &ip_match($acptip, $localip, @{$uinfo->{'deny'}}) || $uinfo->{'allow'} && !&ip_match($acptip, $localip, @{$uinfo->{'allow'}})) { return 0; } return 1; } # check_user_time(user) # Returns 1 if some user is allowed to login at the current date and time sub check_user_time { local ($username) = @_; local $uinfo = &get_user_details($username); return 1 if (!$uinfo || !$uinfo->{'allowdays'} && !$uinfo->{'allowhours'}); local @tm = localtime(time()); if ($uinfo->{'allowdays'}) { # Make sure day is allowed return 0 if (&indexof($tm[6], @{$uinfo->{'allowdays'}}) < 0); } if ($uinfo->{'allowhours'}) { # Make sure time is allowed local $m = $tm[2]*60+$tm[1]; return 0 if ($m < $uinfo->{'allowhours'}->[0] || $m > $uinfo->{'allowhours'}->[1]); } return 1; } # generate_random_id(password, [force-urandom]) # Returns a random session ID number sub generate_random_id { local ($pass, $force_urandom) = @_; local $sid; if (!$bad_urandom) { # First try /dev/urandom, unless we have marked it as bad $SIG{ALRM} = "miniserv::urandom_timeout"; alarm(5); if (open(RANDOM, "/dev/urandom")) { my $tmpsid; if (read(RANDOM, $tmpsid, 16) == 16) { $sid = lc(unpack('h*',$tmpsid)); } close(RANDOM); } alarm(0); } if (!$sid && !$force_urandom) { $sid = time(); local $mul = 1; foreach $c (split(//, &unix_crypt($pass, substr($$, -2)))) { $sid += ord($c) * $mul; $mul *= 3; } } return $sid; } # handle_login(username, ok, expired, not-exists, password, [no-test-cookie]) # Called from handle_session to either mark a user as logged in, or not sub handle_login { local ($vu, $ok, $expired, $nonexist, $pass, $notest) = @_; $authuser = $vu if ($ok); # check if the test cookie is set if ($header{'cookie'} !~ /testing=1/ && $vu && !$config{'no_testing_cookie'} && !$notest) { &http_error(500, "No cookies", "Your browser does not support cookies, ". "which are required for this web server to ". "work in session authentication mode"); } # check with main process for delay if ($config{'passdelay'} && $vu) { print DEBUG "handle_login: requesting delay vu=$vu acptip=$acptip ok=$ok\n"; print $PASSINw "delay $vu $acptip $ok\n"; <$PASSOUTr> =~ /(\d+) (\d+)/; $blocked = $2; sleep($1); print DEBUG "handle_login: delay=$1 blocked=$2\n"; } if ($ok && (!$expired || $config{'passwd_mode'} == 1)) { # Logged in OK! Tell the main process about # the new SID local $sid = &generate_random_id($pass); print DEBUG "handle_login: sid=$sid\n"; print $PASSINw "new $sid $authuser $acptip\n"; # Run the post-login script, if any &run_login_script($authuser, $sid, $loghost, $localip); # Check for a redirect URL for the user local $rurl = &login_redirect($authuser, $pass, $host); print DEBUG "handle_login: redirect URL rurl=$rurl\n"; if ($rurl) { # Got one .. go to it &write_data("HTTP/1.0 302 Moved Temporarily\r\n"); &write_data("Date: $datestr\r\n"); &write_data("Server: $config{'server'}\r\n"); &write_data("Location: $rurl\r\n"); &write_keep_alive(0); &write_data("\r\n"); &log_request($loghost, $authuser, $reqline, 302, 0); } else { # Set cookie and redirect to originally requested page &write_data("HTTP/1.0 302 Moved Temporarily\r\n"); &write_data("Date: $datestr\r\n"); &write_data("Server: $config{'server'}\r\n"); local $ssl = $use_ssl || $config{'inetd_ssl'}; $portstr = $port == 80 && !$ssl ? "" : $port == 443 && $ssl ? "" : ":$port"; $prot = $ssl ? "https" : "http"; local $sec = $ssl ? "; secure" : ""; if (!$config{'no_httponly'}) { $sec .= "; httpOnly"; } if ($in{'page'} !~ /^\/[A-Za-z0-9\/\.\-\_:]+$/) { # Make redirect URL safe $in{'page'} = "/"; } local $cpath = $config{'cookiepath'}; if ($in{'save'}) { &write_data("Set-Cookie: $sidname=$sid; path=$cpath; ". "expires=\"Thu, 31-Dec-2037 00:00:00\"$sec\r\n"); } else { &write_data("Set-Cookie: $sidname=$sid; path=$cpath". "$sec\r\n"); } &write_data("Location: $prot://$hostport$in{'page'}\r\n"); &write_keep_alive(0); &write_data("\r\n"); &log_request($loghost, $authuser, $reqline, 302, 0); syslog("info", "%s", "Successful login as $authuser from $loghost") if ($use_syslog); &write_login_utmp($authuser, $acpthost); } return 0; } elsif ($ok && $expired && ($config{'passwd_mode'} == 2 || $expired == 2)) { # Login was ok, but password has expired or was temporary. Need # to force display of password change form. &run_failed_script($authuser, 'expiredpass', $loghost, $localip); $validated = 1; $authuser = undef; $querystring = "&user=".&urlize($vu). "&pam=".$use_pam. "&expired=".$expired; $method = "GET"; $queryargs = ""; $page = $config{'password_form'}; $logged_code = 401; $miniserv_internal = 2; syslog("crit", "%s", "Expired login as $vu ". "from $loghost") if ($use_syslog); } else { # Login failed, or password has expired. The login form will be # displayed again by later code &run_failed_script($vu, $handle_login ? 'wronguser' : $expired ? 'expiredpass' : 'wrongpass', $loghost, $localip); $failed_user = $vu; $request_uri = $in{'page'}; $already_session_id = undef; $method = "GET"; $authuser = $baseauthuser = undef; syslog("crit", "%s", ($nonexist ? "Non-existent" : $expired ? "Expired" : "Invalid"). " login as $vu from $loghost") if ($use_syslog); } return undef; } # write_login_utmp(user, host) # Record the login by some user in utmp sub write_login_utmp { if ($write_utmp) { # Write utmp record for login %utmp = ( 'ut_host' => $_[1], 'ut_time' => time(), 'ut_user' => $_[0], 'ut_type' => 7, # user process 'ut_pid' => $miniserv_main_pid, 'ut_line' => $config{'pam'}, 'ut_id' => '' ); if (defined(&User::Utmp::putut)) { User::Utmp::putut(\%utmp); } else { User::Utmp::pututline(\%utmp); } } } # write_logout_utmp(user, host) # Record the logout by some user in utmp sub write_logout_utmp { if ($write_utmp) { # Write utmp record for logout %utmp = ( 'ut_host' => $_[1], 'ut_time' => time(), 'ut_user' => $_[0], 'ut_type' => 8, # dead process 'ut_pid' => $miniserv_main_pid, 'ut_line' => $config{'pam'}, 'ut_id' => '' ); if (defined(&User::Utmp::putut)) { User::Utmp::putut(\%utmp); } else { User::Utmp::pututline(\%utmp); } } } # pam_conversation_process(username, write-pipe, read-pipe) # This function is called inside a sub-process to communicate with PAM. It sends # questions down one pipe, and reads responses from another sub pam_conversation_process { local ($user, $writer, $reader) = @_; $miniserv::pam_conversation_process_writer = $writer; $miniserv::pam_conversation_process_reader = $reader; eval "use Authen::PAM;"; local $convh = new Authen::PAM( $config{'pam'}, $user, \&miniserv::pam_conversation_process_func); local $pam_ret = $convh->pam_authenticate(); if ($pam_ret == PAM_SUCCESS()) { local $acct_ret = $convh->pam_acct_mgmt(); if ($acct_ret == PAM_SUCCESS()) { $convh->pam_open_session(); print $writer "x2 $user 1 0 0\n"; } elsif ($acct_ret == PAM_NEW_AUTHTOK_REQD() || $acct_ret == PAM_ACCT_EXPIRED()) { print $writer "x2 $user 1 1 0\n"; } else { print $writer "x0 Unknown PAM account status $acct_ret\n"; } } else { print $writer "x2 $user 0 0 0\n"; } exit(0); } # pam_conversation_process_func(type, message, [type, message, ...]) # A pipe that talks to both PAM and the master process sub pam_conversation_process_func { local @rv; select($miniserv::pam_conversation_process_writer); $| = 1; select(STDOUT); while(@_) { local ($type, $msg) = (shift, shift); $msg =~ s/\r|\n//g; local $ok = (print $miniserv::pam_conversation_process_writer "$type $msg\n"); print $miniserv::pam_conversation_process_writer "\n"; local $answer = <$miniserv::pam_conversation_process_reader>; $answer =~ s/\r|\n//g; push(@rv, PAM_SUCCESS(), $answer); } push(@rv, PAM_SUCCESS()); return @rv; } # allocate_pipes() # Returns 4 new pipe file handles sub allocate_pipes { local ($PASSINr, $PASSINw, $PASSOUTr, $PASSOUTw); local $p; local %taken = ( (map { $_, 1 } @passin), (map { $_->{'PASSINr'} } values %conversations) ); for($p=0; $taken{"PASSINr$p"}; $p++) { } $PASSINr = "PASSINr$p"; $PASSINw = "PASSINw$p"; $PASSOUTr = "PASSOUTr$p"; $PASSOUTw = "PASSOUTw$p"; pipe($PASSINr, $PASSINw); pipe($PASSOUTr, $PASSOUTw); select($PASSINw); $| = 1; select($PASSINr); $| = 1; select($PASSOUTw); $| = 1; select($PASSOUTw); $| = 1; select(STDOUT); return ($PASSINr, $PASSINw, $PASSOUTr, $PASSOUTw); } # recv_pam_question(&conv, fd) # Reads one PAM question from the sub-process, and sends it to the HTTP handler. # Returns 0 if the conversation is over, 1 if not. sub recv_pam_question { local ($conf, $fh) = @_; local $pr = $conf->{'PAMOUTr'}; select($pr); $| = 1; select(STDOUT); local $line = <$pr>; $line =~ s/\r|\n//g; if (!$line) { $line = <$pr>; $line =~ s/\r|\n//g; } $conf->{'last'} = time(); if (!$line) { # Failed! print $fh "0 PAM conversation error\n"; return 0; } else { local ($type, $msg) = split(/\s+/, $line, 2); if ($type =~ /^x(\d+)/) { # Pass this status code through print $fh "$1 $msg\n"; return $1 == 2 || $1 == 0 ? 0 : 1; } elsif ($type == PAM_PROMPT_ECHO_ON()) { # A normal question print $fh "1 $msg\n"; return 1; } elsif ($type == PAM_PROMPT_ECHO_OFF()) { # A password print $fh "3 $msg\n"; return 1; } elsif ($type == PAM_ERROR_MSG() || $type == PAM_TEXT_INFO()) { # A message that does not require a response print $fh "4 $msg\n"; return 1; } else { # Unknown type! print $fh "0 Unknown PAM message type $type\n"; return 0; } } } # send_pam_answer(&conv, answer) # Sends a response from the user to the PAM sub-process sub send_pam_answer { local ($conf, $answer) = @_; local $pw = $conf->{'PAMINw'}; $conf->{'last'} = time(); print $pw "$answer\n"; } # end_pam_conversation(&conv) # Clean up PAM conversation pipes and processes sub end_pam_conversation { local ($conv) = @_; kill('KILL', $conv->{'pid'}) if ($conv->{'pid'}); if ($conv->{'PAMINr'}) { close($conv->{'PAMINr'}); close($conv->{'PAMOUTr'}); close($conv->{'PAMINw'}); close($conv->{'PAMOUTw'}); } delete($conversations{$conv->{'cid'}}); } # get_ipkeys(&miniserv) # Returns a list of IP address to key file mappings from a miniserv.conf entry sub get_ipkeys { local (@rv, $k); foreach $k (keys %{$_[0]}) { if ($k =~ /^ipkey_(\S+)/) { local $ipkey = { 'ips' => [ split(/,/, $1) ], 'key' => $_[0]->{$k}, 'index' => scalar(@rv) }; $ipkey->{'cert'} = $_[0]->{'ipcert_'.$1}; $ipkey->{'extracas'} = $_[0]->{'ipextracas_'.$1}; push(@rv, $ipkey); } } return @rv; } # create_ssl_context(keyfile, [certfile], [extracas]) sub create_ssl_context { local ($keyfile, $certfile, $extracas) = @_; local $ssl_ctx; eval { $ssl_ctx = Net::SSLeay::new_x_ctx() }; $ssl_ctx ||= Net::SSLeay::CTX_new(); $ssl_ctx || die "Failed to create SSL context : $!"; # Setup PFS, if ciphers are in use if (-r $config{'dhparams_file'}) { eval { my $bio = Net::SSLeay::BIO_new_file( $config{'dhparams_file'}, 'r'); my $DHP = Net::SSLeay::PEM_read_bio_DHparams($bio); Net::SSLeay::CTX_set_tmp_dh($ssl_ctx, $DHP); my $nid = Net::SSLeay::OBJ_sn2nid("secp384r1"); my $curve = Net::SSLeay::EC_KEY_new_by_curve_name($nid); Net::SSLeay::CTX_set_tmp_ecdh($ssl_ctx, $curve); Net::SSLeay::BIO_free($bio); }; } if ($@) { print STDERR "Failed to load $config{'dhparams_file'} : $@\n"; } if ($client_certs) { Net::SSLeay::CTX_load_verify_locations( $ssl_ctx, $config{'ca'}, ""); eval { Net::SSLeay::set_verify( $ssl_ctx, &Net::SSLeay::VERIFY_PEER, \&verify_client); }; if ($@) { Net::SSLeay::CTX_set_verify( $ssl_ctx, &Net::SSLeay::VERIFY_PEER, \&verify_client); } } if ($extracas && $extracas ne "none") { foreach my $p (split(/\s+/, $extracas)) { Net::SSLeay::CTX_load_verify_locations( $ssl_ctx, $p, ""); } } Net::SSLeay::CTX_use_PrivateKey_file( $ssl_ctx, $keyfile, &Net::SSLeay::FILETYPE_PEM) || die "Failed to open SSL key $keyfile"; Net::SSLeay::CTX_use_certificate_file( $ssl_ctx, $certfile || $keyfile, &Net::SSLeay::FILETYPE_PEM) || die "Failed to open SSL cert $certfile"; if ($config{'no_ssl2'}) { eval 'Net::SSLeay::CTX_set_options($ssl_ctx, &Net::SSLeay::OP_NO_SSLv2)'; } if ($config{'no_ssl3'}) { eval 'Net::SSLeay::CTX_set_options($ssl_ctx, &Net::SSLeay::OP_NO_SSLv3)'; } if ($config{'no_tls1'}) { eval 'Net::SSLeay::CTX_set_options($ssl_ctx, &Net::SSLeay::OP_NO_TLSv1)'; } if ($config{'no_tls1_1'}) { eval 'Net::SSLeay::CTX_set_options($ssl_ctx, &Net::SSLeay::OP_NO_TLSv1_1)'; } if ($config{'no_tls1_2'}) { eval 'Net::SSLeay::CTX_set_options($ssl_ctx, &Net::SSLeay::OP_NO_TLSv1_2)'; } if ($config{'no_sslcompression'}) { eval 'Net::SSLeay::CTX_set_options($ssl_ctx, &Net::SSLeay::OP_NO_COMPRESSION)'; } if ($config{'ssl_honorcipherorder'}) { eval 'Net::SSLeay::CTX_set_options($ssl_ctx, &Net::SSLeay::OP_CIPHER_SERVER_PREFERENCE)'; } return $ssl_ctx; } # ssl_connection_for_ip(socket, ipv6-flag) # Returns a new SSL connection object for some socket, or undef if failed sub ssl_connection_for_ip { local ($sock, $ipv6) = @_; local $sn = getsockname($sock); if (!$sn) { print STDERR "Failed to get address for socket $sock\n"; return undef; } local (undef, $myip, undef) = &get_address_ip($sn, $ipv6); local $ssl_ctx = $ssl_contexts{$myip} || $ssl_contexts{"*"}; local $ssl_con = Net::SSLeay::new($ssl_ctx); if ($config{'ssl_cipher_list'}) { # Force use of ciphers eval "Net::SSLeay::set_cipher_list( \$ssl_con, \$config{'ssl_cipher_list'})"; if ($@) { print STDERR "SSL cipher $config{'ssl_cipher_list'} failed : ", "$@\n"; } } Net::SSLeay::set_fd($ssl_con, fileno($sock)); if (!Net::SSLeay::accept($ssl_con)) { print STDERR "Failed to initialize SSL connection\n"; return undef; } return $ssl_con; } # login_redirect(username, password, host) # Calls the login redirect script (if configured), which may output a URL to # re-direct a user to after logging in. sub login_redirect { return undef if (!$config{'login_redirect'}); local $quser = quotemeta($_[0]); local $qpass = quotemeta($_[1]); local $qhost = quotemeta($_[2]); local $url = `$config{'login_redirect'} $quser $qpass $qhost`; chop($url); return $url; } # reload_config_file() # Re-read %config, and call post-config actions sub reload_config_file { &log_error("Reloading configuration"); %config = &read_config_file($config_file); &update_vital_config(); &read_users_file(); &read_mime_types(); &build_config_mappings(); &read_webmin_crons(); &precache_files(); if ($config{'session'}) { dbmclose(%sessiondb); dbmopen(%sessiondb, $config{'sessiondb'}, 0700); } } # read_config_file(file) # Reads the given config file, and returns a hash of values sub read_config_file { local %rv; open(CONF, $_[0]) || die "Failed to open config file $_[0] : $!"; while(<CONF>) { s/\r|\n//g; if (/^#/ || !/\S/) { next; } /^([^=]+)=(.*)$/; $name = $1; $val = $2; $name =~ s/^\s+//g; $name =~ s/\s+$//g; $val =~ s/^\s+//g; $val =~ s/\s+$//g; $rv{$name} = $val; } close(CONF); return %rv; } # update_vital_config() # Updates %config with defaults, and dies if something vital is missing sub update_vital_config { my %vital = ("port", 80, "root", "./", "server", "MiniServ/0.01", "index_docs", "index.html index.htm index.cgi index.php", "addtype_html", "text/html", "addtype_txt", "text/plain", "addtype_gif", "image/gif", "addtype_jpg", "image/jpeg", "addtype_jpeg", "image/jpeg", "realm", "MiniServ", "session_login", "/session_login.cgi", "pam_login", "/pam_login.cgi", "password_form", "/password_form.cgi", "password_change", "/password_change.cgi", "maxconns", 50, "pam", "webmin", "sidname", "sid", "unauth", "^/unauthenticated/ ^/robots.txt\$ ^[A-Za-z0-9\\-/_]+\\.jar\$ ^[A-Za-z0-9\\-/_]+\\.class\$ ^[A-Za-z0-9\\-/_]+\\.gif\$ ^[A-Za-z0-9\\-/_]+\\.png\$ ^[A-Za-z0-9\\-/_]+\\.conf\$ ^[A-Za-z0-9\\-/_]+\\.ico\$ ^/robots.txt\$", "max_post", 10000, "expires", 7*24*60*60, "pam_test_user", "root", "precache", "lang/en */lang/en", "cookiepath", "/", ); foreach my $v (keys %vital) { if (!$config{$v}) { if ($vital{$v} eq "") { die "Missing config option $v"; } $config{$v} = $vital{$v}; } } if (!$config{'sessiondb'}) { $config{'pidfile'} =~ /^(.*)\/[^\/]+$/; $config{'sessiondb'} = "$1/sessiondb"; } if (!$config{'errorlog'}) { $config{'logfile'} =~ /^(.*)\/[^\/]+$/; $config{'errorlog'} = "$1/miniserv.error"; } if (!$config{'tempbase'}) { $config{'pidfile'} =~ /^(.*)\/[^\/]+$/; $config{'tempbase'} = "$1/cgitemp"; } if (!$config{'blockedfile'}) { $config{'pidfile'} =~ /^(.*)\/[^\/]+$/; $config{'blockedfile'} = "$1/blocked"; } if (!$config{'webmincron_dir'}) { $config_file =~ /^(.*)\/[^\/]+$/; $config{'webmincron_dir'} = "$1/webmincron/crons"; } if (!$config{'webmincron_last'}) { $config{'logfile'} =~ /^(.*)\/[^\/]+$/; $config{'webmincron_last'} = "$1/miniserv.lastcrons"; } if (!$config{'webmincron_wrapper'}) { $config{'webmincron_wrapper'} = $config{'root'}. "/webmincron/webmincron.pl"; } if (!$config{'twofactor_wrapper'}) { $config{'twofactor_wrapper'} = $config{'root'}."/acl/twofactor.pl"; } } # read_users_file() # Fills the %users and %certs hashes from the users file in %config sub read_users_file { undef(%users); undef(%certs); undef(%allow); undef(%deny); undef(%allowdays); undef(%allowhours); undef(%lastchanges); undef(%nochange); undef(%temppass); undef(%twofactor); if ($config{'userfile'}) { open(USERS, $config{'userfile'}); while(<USERS>) { s/\r|\n//g; local @user = split(/:/, $_, -1); $users{$user[0]} = $user[1]; $certs{$user[0]} = $user[3] if ($user[3]); if ($user[4] =~ /^allow\s+(.*)/) { my $allow = $1; $allow =~ s/;/:/g; $allow{$user[0]} = $config{'alwaysresolve'} ? [ split(/\s+/, $allow) ] : [ &to_ip46address(split(/\s+/, $allow)) ]; } elsif ($user[4] =~ /^deny\s+(.*)/) { my $deny = $1; $deny =~ s/;/:/g; $deny{$user[0]} = $config{'alwaysresolve'} ? [ split(/\s+/, $deny) ] : [ &to_ip46address(split(/\s+/, $deny)) ]; } if ($user[5] =~ /days\s+(\S+)/) { $allowdays{$user[0]} = [ split(/,/, $1) ]; } if ($user[5] =~ /hours\s+(\d+)\.(\d+)-(\d+).(\d+)/) { $allowhours{$user[0]} = [ $1*60+$2, $3*60+$4 ]; } $lastchanges{$user[0]} = $user[6]; $nochange{$user[0]} = $user[9]; $temppass{$user[0]} = $user[10]; if ($user[11] && $user[12]) { $twofactor{$user[0]} = { 'provider' => $user[11], 'id' => $user[12], 'apikey' => $user[13] }; } } close(USERS); } # Test user DB, if configured if ($config{'userdb'}) { my $dbh = &connect_userdb($config{'userdb'}); if (!ref($dbh)) { print STDERR "Failed to open users database : $dbh\n" } else { &disconnect_userdb($config{'userdb'}, $dbh); } } } # get_user_details(username) # Returns a hash ref of user details, either from config files or the user DB sub get_user_details { my ($username) = @_; if (exists($users{$username})) { # In local files return { 'name' => $username, 'pass' => $users{$username}, 'certs' => $certs{$username}, 'allow' => $allow{$username}, 'deny' => $deny{$username}, 'allowdays' => $allowdays{$username}, 'allowhours' => $allowhours{$username}, 'lastchanges' => $lastchanges{$username}, 'nochange' => $nochange{$username}, 'temppass' => $temppass{$username}, 'preroot' => $config{'preroot_'.$username}, }; } if ($config{'userdb'}) { # Try querying user database if (exists($get_user_details_cache{$username})) { # Cached already return $get_user_details_cache{$username}; } print DEBUG "get_user_details: Connecting to user database\n"; my ($dbh, $proto, $prefix, $args) = &connect_userdb($config{'userdb'}); my $user; my %attrs; if (!ref($dbh)) { print DEBUG "get_user_details: Failed : $dbh\n"; print STDERR "Failed to connect to user database : $dbh\n"; } elsif ($proto eq "mysql" || $proto eq "postgresql") { # Fetch user ID and password with SQL print DEBUG "get_user_details: Looking for $username in SQL\n"; my $cmd = $dbh->prepare( "select id,pass from webmin_user where name = ?"); if (!$cmd || !$cmd->execute($username)) { print STDERR "Failed to lookup user : ", $dbh->errstr,"\n"; return undef; } my ($id, $pass) = $cmd->fetchrow(); $cmd->finish(); if (!$id) { &disconnect_userdb($config{'userdb'}, $dbh); $get_user_details_cache{$username} = undef; print DEBUG "get_user_details: User not found\n"; return undef; } print DEBUG "get_user_details: id=$id pass=$pass\n"; # Fetch attributes and add to user object print DEBUG "get_user_details: finding user attributes\n"; my $cmd = $dbh->prepare( "select attr,value from webmin_user_attr where id = ?"); if (!$cmd || !$cmd->execute($id)) { print STDERR "Failed to lookup user attrs : ", $dbh->errstr,"\n"; return undef; } $user = { 'name' => $username, 'id' => $id, 'pass' => $pass, 'proto' => $proto }; while(my ($attr, $value) = $cmd->fetchrow()) { $attrs{$attr} = $value; } $cmd->finish(); } elsif ($proto eq "ldap") { # Fetch user DN with LDAP print DEBUG "get_user_details: Looking for $username in LDAP\n"; my $rv = $dbh->search( base => $prefix, filter => '(&(cn='.$username.')(objectClass='. $args->{'userclass'}.'))', scope => 'sub'); if (!$rv || $rv->code) { print STDERR "Failed to lookup user : ", ($rv ? $rv->error : "Unknown error"),"\n"; return undef; } my ($u) = $rv->all_entries(); if (!$u || $u->get_value('cn') ne $username) { &disconnect_userdb($config{'userdb'}, $dbh); $get_user_details_cache{$username} = undef; print DEBUG "get_user_details: User not found\n"; return undef; } # Extract attributes my $pass = $u->get_value('webminPass'); $user = { 'name' => $username, 'id' => $u->dn(), 'pass' => $pass, 'proto' => $proto }; foreach my $la ($u->get_value('webminAttr')) { my ($attr, $value) = split(/=/, $la, 2); $attrs{$attr} = $value; } } # Convert DB attributes into user object fields if ($user) { print DEBUG "get_user_details: got ",scalar(keys %attrs), " attributes\n"; $user->{'certs'} = $attrs{'cert'}; if ($attrs{'allow'}) { $user->{'allow'} = $config{'alwaysresolve'} ? [ split(/\s+/, $attrs{'allow'}) ] : [ &to_ipaddress(split(/\s+/,$attrs{'allow'})) ]; } if ($attrs{'deny'}) { $user->{'deny'} = $config{'alwaysresolve'} ? [ split(/\s+/, $attrs{'deny'}) ] : [ &to_ipaddress(split(/\s+/,$attrs{'deny'})) ]; } if ($attrs{'days'}) { $user->{'allowdays'} = [ split(/,/, $attrs{'days'}) ]; } if ($attrs{'hoursfrom'} && $attrs{'hoursto'}) { my ($hf, $mf) = split(/\./, $attrs{'hoursfrom'}); my ($ht, $mt) = split(/\./, $attrs{'hoursto'}); $user->{'allowhours'} = [ $hf*60+$ht, $ht*60+$mt ]; } $user->{'lastchanges'} = $attrs{'lastchange'}; $user->{'nochange'} = $attrs{'nochange'}; $user->{'temppass'} = $attrs{'temppass'}; $user->{'preroot'} = $attrs{'theme'}; } &disconnect_userdb($config{'userdb'}, $dbh); $get_user_details_cache{$user->{'name'}} = $user; return $user; } return undef; } # find_user_by_cert(cert) # Returns a username looked up by certificate sub find_user_by_cert { my ($peername) = @_; my $peername2 = $peername; $peername2 =~ s/Email=/emailAddress=/ || $peername2 =~ s/emailAddress=/Email=/; # First check users in local files foreach my $username (keys %certs) { if ($certs{$username} eq $peername || $certs{$username} eq $peername2) { return $username; } } # Check user DB if ($config{'userdb'}) { my ($dbh, $proto) = &connect_userdb($config{'userdb'}); if (!ref($dbh)) { return undef; } elsif ($proto eq "mysql" || $proto eq "postgresql") { # Query with SQL my $cmd = $dbh->prepare("select webmin_user.name from webmin_user,webmin_user_attr where webmin_user.id = webmin_user_attr.id and webmin_user_attr.attr = 'cert' and webmin_user_attr.value = ?"); return undef if (!$cmd); foreach my $p ($peername, $peername2) { my $username; if ($cmd->execute($p)) { ($username) = $cmd->fetchrow(); } $cmd->finish(); return $username if ($username); } } elsif ($proto eq "ldap") { # Lookup in LDAP my $rv = $dbh->search( base => $prefix, filter => '(objectClass='. $args->{'userclass'}.')', scope => 'sub', attrs => [ 'cn', 'webminAttr' ]); if ($rv && !$rv->code) { foreach my $u ($rv->all_entries) { my @attrs = $u->get_value('webminAttr'); foreach my $la (@attrs) { my ($attr, $value) = split(/=/, $la, 2); if ($attr eq "cert" && ($value eq $peername || $value eq $peername2)) { return $u->get_value('cn'); } } } } } } return undef; } # connect_userdb(string) # Returns a handle for talking to a user database - may be a DBI or LDAP handle. # On failure returns an error message string. In an array context, returns the # protocol type too. sub connect_userdb { my ($str) = @_; my ($proto, $user, $pass, $host, $prefix, $args) = &split_userdb_string($str); if ($proto eq "mysql") { # Connect to MySQL with DBI my $drh = eval "use DBI; DBI->install_driver('mysql');"; $drh || return $text{'sql_emysqldriver'}; my ($host, $port) = split(/:/, $host); my $cstr = "database=$prefix;host=$host"; $cstr .= ";port=$port" if ($port); print DEBUG "connect_userdb: Connecting to MySQL $cstr as $user\n"; my $dbh = $drh->connect($cstr, $user, $pass, { }); $dbh || return "Failed to connect to MySQL : ".$drh->errstr; print DEBUG "connect_userdb: Connected OK\n"; return wantarray ? ($dbh, $proto, $prefix, $args) : $dbh; } elsif ($proto eq "postgresql") { # Connect to PostgreSQL with DBI my $drh = eval "use DBI; DBI->install_driver('Pg');"; $drh || return $text{'sql_epostgresqldriver'}; my ($host, $port) = split(/:/, $host); my $cstr = "dbname=$prefix;host=$host"; $cstr .= ";port=$port" if ($port); print DEBUG "connect_userdb: Connecting to PostgreSQL $cstr as $user\n"; my $dbh = $drh->connect($cstr, $user, $pass); $dbh || return "Failed to connect to PostgreSQL : ".$drh->errstr; print DEBUG "connect_userdb: Connected OK\n"; return wantarray ? ($dbh, $proto, $prefix, $args) : $dbh; } elsif ($proto eq "ldap") { # Connect with perl LDAP module eval "use Net::LDAP"; $@ && return $text{'sql_eldapdriver'}; my ($host, $port) = split(/:/, $host); my $scheme = $args->{'scheme'} || 'ldap'; if (!$port) { $port = $scheme eq 'ldaps' ? 636 : 389; } my $ldap = Net::LDAP->new($host, port => $port, 'scheme' => $scheme); $ldap || return "Failed to connect to LDAP : ".$host; my $mesg; if ($args->{'tls'}) { # Switch to TLS mode eval { $mesg = $ldap->start_tls(); }; if ($@ || !$mesg || $mesg->code) { return "Failed to switch to LDAP TLS mode : ". ($@ ? $@ : $mesg ? $mesg->error : "Unknown error"); } } # Login to the server if ($pass) { $mesg = $ldap->bind(dn => $user, password => $pass); } else { $mesg = $ldap->bind(dn => $user, anonymous => 1); } if (!$mesg || $mesg->code) { return "Failed to login to LDAP as ".$user." : ". ($mesg ? $mesg->error : "Unknown error"); } return wantarray ? ($ldap, $proto, $prefix, $args) : $ldap; } else { return "Unknown protocol $proto"; } } # split_userdb_string(string) # Converts a string like mysql://user:pass@host/db into separate parts sub split_userdb_string { my ($str) = @_; if ($str =~ /^([a-z]+):\/\/([^:]*):([^\@]*)\@([a-z0-9\.\-\_]+)\/([^\?]+)(\?(.*))?$/) { my ($proto, $user, $pass, $host, $prefix, $argstr) = ($1, $2, $3, $4, $5, $7); my %args = map { split(/=/, $_, 2) } split(/\&/, $argstr); return ($proto, $user, $pass, $host, $prefix, \%args); } return ( ); } # disconnect_userdb(string, &handle) # Closes a handle opened by connect_userdb sub disconnect_userdb { my ($str, $h) = @_; if ($str =~ /^(mysql|postgresql):/) { # DBI disconnnect $h->disconnect(); } elsif ($str =~ /^ldap:/) { # LDAP disconnect $h->disconnect(); } } # read_mime_types() # Fills %mime with entries from file in %config and extra settings in %config sub read_mime_types { undef(%mime); if ($config{"mimetypes"} ne "") { open(MIME, $config{"mimetypes"}); while(<MIME>) { chop; s/#.*$//; if (/^(\S+)\s+(.*)$/) { my $type = $1; my @exts = split(/\s+/, $2); foreach my $ext (@exts) { $mime{$ext} = $type; } } } close(MIME); } foreach my $k (keys %config) { if ($k !~ /^addtype_(.*)$/) { next; } $mime{$1} = $config{$k}; } } # build_config_mappings() # Build the anonymous access list, IP access list, unauthenticated URLs list, # redirect mapping and allow and deny lists from %config sub build_config_mappings { # build anonymous access list undef(%anonymous); foreach my $a (split(/\s+/, $config{'anonymous'})) { if ($a =~ /^([^=]+)=(\S+)$/) { $anonymous{$1} = $2; } } # build IP access list undef(%ipaccess); foreach my $a (split(/\s+/, $config{'ipaccess'})) { if ($a =~ /^([^=]+)=(\S+)$/) { $ipaccess{$1} = $2; } } # build unauthenticated URLs list @unauth = split(/\s+/, $config{'unauth'}); # build redirect mapping undef(%redirect); foreach my $r (split(/\s+/, $config{'redirect'})) { if ($r =~ /^([^=]+)=(\S+)$/) { $redirect{$1} = $2; } } # build prefixes to be stripped undef(@strip_prefix); foreach my $r (split(/\s+/, $config{'strip_prefix'})) { push(@strip_prefix, $r); } # Init allow and deny lists @deny = split(/\s+/, $config{"deny"}); @deny = &to_ipaddress(@deny) if (!$config{'alwaysresolve'}); @allow = split(/\s+/, $config{"allow"}); @allow = &to_ipaddress(@allow) if (!$config{'alwaysresolve'}); undef(@allowusers); undef(@denyusers); if ($config{'allowusers'}) { @allowusers = split(/\s+/, $config{'allowusers'}); } elsif ($config{'denyusers'}) { @denyusers = split(/\s+/, $config{'denyusers'}); } # Build list of unixauth mappings undef(%unixauth); foreach my $ua (split(/\s+/, $config{'unixauth'})) { if ($ua =~ /^(\S+)=(\S+)$/) { $unixauth{$1} = $2; } else { $unixauth{"*"} = $ua; } } # Build list of non-session-auth pages undef(%sessiononly); foreach my $sp (split(/\s+/, $config{'sessiononly'})) { $sessiononly{$sp} = 1; } # Build list of logout times undef(@logouttimes); foreach my $a (split(/\s+/, $config{'logouttimes'})) { if ($a =~ /^([^=]+)=(\S+)$/) { push(@logouttimes, [ $1, $2 ]); } } push(@logouttimes, [ undef, $config{'logouttime'} ]); # Build list of DAV pathss undef(@davpaths); foreach my $d (split(/\s+/, $config{'davpaths'})) { push(@davpaths, $d); } @davusers = split(/\s+/, $config{'dav_users'}); # Mobile agent substrings and hostname prefixes @mobile_agents = split(/\t+/, $config{'mobile_agents'}); @mobile_prefixes = split(/\s+/, $config{'mobile_prefixes'}); # Expires time list @expires_paths = ( ); foreach my $pe (split(/\t+/, $config{'expires_paths'})) { my ($p, $e) = split(/=/, $pe); if ($p && $e ne '') { push(@expires_paths, [ $p, $e ]); } } # Open debug log close(DEBUG); if ($config{'debug'}) { open(DEBUG, ">>$config{'debug'}"); } else { open(DEBUG, ">/dev/null"); } # Reset cache of sudo checks undef(%sudocache); } # is_group_member(&uinfo, groupname) # Returns 1 if some user is a primary or secondary member of a group sub is_group_member { local ($uinfo, $group) = @_; local @ginfo = getgrnam($group); return 0 if (!@ginfo); return 1 if ($ginfo[2] == $uinfo->[3]); # primary member foreach my $m (split(/\s+/, $ginfo[3])) { return 1 if ($m eq $uinfo->[0]); } return 0; } # prefix_to_mask(prefix) # Converts a number like 24 to a mask like 255.255.255.0 sub prefix_to_mask { return $_[0] >= 24 ? "255.255.255.".(256-(2 ** (32-$_[0]))) : $_[0] >= 16 ? "255.255.".(256-(2 ** (24-$_[0]))).".0" : $_[0] >= 8 ? "255.".(256-(2 ** (16-$_[0]))).".0.0" : (256-(2 ** (8-$_[0]))).".0.0.0"; } # get_logout_time(user, session-id) # Given a username, returns the idle time before he will be logged out sub get_logout_time { local ($user, $sid) = @_; if (!defined($logout_time_cache{$user,$sid})) { local $time; foreach my $l (@logouttimes) { if ($l->[0] =~ /^\@(.*)$/) { # Check group membership local @uinfo = getpwnam($user); if (@uinfo && &is_group_member(\@uinfo, $1)) { $time = $l->[1]; } } elsif ($l->[0] =~ /^\//) { # Check file contents open(FILE, $l->[0]); while(<FILE>) { s/\r|\n//g; s/^\s*#.*$//; if ($user eq $_) { $time = $l->[1]; last; } } close(FILE); } elsif (!$l->[0]) { # Always match $time = $l->[1]; } else { # Check username if ($l->[0] eq $user) { $time = $l->[1]; } } last if (defined($time)); } $logout_time_cache{$user,$sid} = $time; } return $logout_time_cache{$user,$sid}; } # password_crypt(password, salt) # If the salt looks like MD5 and we have a library for it, perform MD5 hashing # of a password. Otherwise, do Unix crypt. sub password_crypt { local ($pass, $salt) = @_; if ($salt =~ /^\$1\$/ && $use_md5) { return &encrypt_md5($pass, $salt); } else { return &unix_crypt($pass, $salt); } } # unix_crypt(password, salt) # Performs standard Unix hashing for a password sub unix_crypt { local ($pass, $salt) = @_; if ($use_perl_crypt) { return Crypt::UnixCrypt::crypt($pass, $salt); } else { return crypt($pass, $salt); } } # handle_dav_request(davpath) # Pass a request on to the Net::DAV::Server module sub handle_dav_request { local ($path) = @_; eval "use Filesys::Virtual::Plain"; eval "use Net::DAV::Server"; eval "use HTTP::Request"; eval "use HTTP::Headers"; if ($Net::DAV::Server::VERSION eq '1.28' && $config{'dav_nolock'}) { delete $Net::DAV::Server::implemented{lock}; delete $Net::DAV::Server::implemented{unlock}; } # Read in request data if (!$posted_data) { local $clen = $header{"content-length"}; while(length($posted_data) < $clen) { $buf = &read_data($clen - length($posted_data)); if (!length($buf)) { &http_error(500, "Failed to read POST request"); } $posted_data .= $buf; } } # For subsequent logging open(MINISERVLOG, ">>$config{'logfile'}"); # Switch to user local $root; local @u = getpwnam($authuser); if ($config{'dav_remoteuser'} && !$< && $validated) { if (@u) { if ($u[2] != 0) { $( = $u[3]; $) = "$u[3] $u[3]"; ($>, $<) = ($u[2], $u[2]); } if ($config{'dav_root'} eq '*') { $root = $u[7]; } } else { &http_error(500, "Unix user ".&html_strip($authuser). " does not exist"); return 0; } } $root ||= $config{'dav_root'}; $root ||= "/"; # Check if this user can use DAV if (@davusers) { &users_match(\@u, @davusers) || &http_error(500, "You are not allowed to access DAV"); } # Create DAV server my $filesys = Filesys::Virtual::Plain->new({root_path => $root}); my $webdav = Net::DAV::Server->new(); $webdav->filesys($filesys); # Make up a request object, and feed to DAV local $ho = HTTP::Headers->new; foreach my $h (keys %header) { next if (lc($h) eq "connection"); $ho->header($h => $header{$h}); } if ($path ne "/") { $request_uri =~ s/^\Q$path\E//; $request_uri = "/" if ($request_uri eq ""); } my $request = HTTP::Request->new($method, $request_uri, $ho, $posted_data); if ($config{'dav_debug'}) { print STDERR "DAV request :\n"; print STDERR "---------------------------------------------\n"; print STDERR $request->as_string(); print STDERR "---------------------------------------------\n"; } my $response = $webdav->run($request); # Send back the reply &write_data("HTTP/1.1 ",$response->code()," ",$response->message(),"\r\n"); local $content = $response->content(); if ($path ne "/") { $content =~ s|href>/(.+)<|href>$path/$1<|g; $content =~ s|href>/<|href>$path<|g; } foreach my $h ($response->header_field_names) { next if (lc($h) eq "connection" || lc($h) eq "content-length"); &write_data("$h: ",$response->header($h),"\r\n"); } &write_data("Content-length: ",length($content),"\r\n"); local $rv = &write_keep_alive(0); &write_data("\r\n"); &write_data($content); if ($config{'dav_debug'}) { print STDERR "DAV reply :\n"; print STDERR "---------------------------------------------\n"; print STDERR "HTTP/1.1 ",$response->code()," ",$response->message(),"\r\n"; foreach my $h ($response->header_field_names) { next if (lc($h) eq "connection" || lc($h) eq "content-length"); print STDERR "$h: ",$response->header($h),"\r\n"; } print STDERR "Content-length: ",length($content),"\r\n"; print STDERR "\r\n"; print STDERR $content; print STDERR "---------------------------------------------\n"; } # Log it &log_request($loghost, $authuser, $reqline, $response->code(), length($response->content())); } # get_system_hostname() # Returns the hostname of this system, for reporting to listeners sub get_system_hostname { # On Windows, try computername environment variable return $ENV{'computername'} if ($ENV{'computername'}); return $ENV{'COMPUTERNAME'} if ($ENV{'COMPUTERNAME'}); # If a specific command is set, use it first if ($config{'hostname_command'}) { local $out = `($config{'hostname_command'}) 2>&1`; if (!$?) { $out =~ s/\r|\n//g; return $out; } } # First try the hostname command local $out = `hostname 2>&1`; if (!$? && $out =~ /\S/) { $out =~ s/\r|\n//g; return $out; } # Try the Sys::Hostname module eval "use Sys::Hostname"; if (!$@) { local $rv = eval "hostname()"; if (!$@ && $rv) { return $rv; } } # Must use net name on Windows local $out = `net name 2>&1`; if ($out =~ /\-+\r?\n(\S+)/) { return $1; } return undef; } # indexof(string, array) # Returns the index of some value in an array, or -1 sub indexof { local($i); for($i=1; $i <= $#_; $i++) { if ($_[$i] eq $_[0]) { return $i - 1; } } return -1; } # has_command(command) # Returns the full path if some command is in the path, undef if not sub has_command { local($d); if (!$_[0]) { return undef; } if (exists($has_command_cache{$_[0]})) { return $has_command_cache{$_[0]}; } local $rv = undef; if ($_[0] =~ /^\//) { $rv = -x $_[0] ? $_[0] : undef; } else { local $sp = $on_windows ? ';' : ':'; foreach $d (split($sp, $ENV{PATH})) { if (-x "$d/$_[0]") { $rv = "$d/$_[0]"; last; } if ($on_windows) { foreach my $sfx (".exe", ".com", ".bat") { if (-r "$d/$_[0]".$sfx) { $rv = "$d/$_[0]".$sfx; last; } } } } } $has_command_cache{$_[0]} = $rv; return $rv; } # check_sudo_permissions(user, pass) # Returns 1 if some user can run any command via sudo sub check_sudo_permissions { local ($user, $pass) = @_; # First try the pipes if ($PASSINw) { print DEBUG "check_sudo_permissions: querying cache for $user\n"; print $PASSINw "readsudo $user\n"; local $can = <$PASSOUTr>; chop($can); print DEBUG "check_sudo_permissions: cache said $can\n"; if ($can =~ /^\d+$/ && $can != 2) { return int($can); } } local $ptyfh = new IO::Pty; print DEBUG "check_sudo_permissions: ptyfh=$ptyfh\n"; if (!$ptyfh) { print STDERR "Failed to create new PTY with IO::Pty\n"; return 0; } local @uinfo = getpwnam($user); if (!@uinfo) { print STDERR "Unix user $user does not exist for sudo\n"; return 0; } # Execute sudo in a sub-process, via a pty local $ttyfh = $ptyfh->slave(); print DEBUG "check_sudo_permissions: ttyfh=$ttyfh\n"; local $tty = $ptyfh->ttyname(); print DEBUG "check_sudo_permissions: tty=$tty\n"; chown($uinfo[2], $uinfo[3], $tty); pipe(SUDOr, SUDOw); print DEBUG "check_sudo_permissions: about to fork..\n"; local $pid = fork(); print DEBUG "check_sudo_permissions: fork=$pid pid=$$\n"; if ($pid < 0) { print STDERR "fork for sudo failed : $!\n"; return 0; } if (!$pid) { setsid(); ($(, $)) = ( $uinfo[3], "$uinfo[3] ".join(" ", $uinfo[3], &other_groups($uinfo[0])) ); ($>, $<) = ($uinfo[2], $uinfo[2]); $ENV{'USER'} = $ENV{'LOGNAME'} = $user; $ENV{'HOME'} = $uinfo[7]; $ptyfh->make_slave_controlling_terminal(); close(STDIN); close(STDOUT); close(STDERR); untie(*STDIN); untie(*STDOUT); untie(*STDERR); close($PASSINw); close($PASSOUTr); close(SUDOw); close(SOCK); close(MAIN); open(STDIN, "<&SUDOr"); open(STDOUT, ">$tty"); open(STDERR, ">&STDOUT"); close($ptyfh); exec("sudo -l -S"); print "Exec failed : $!\n"; exit 1; } print DEBUG "check_sudo_permissions: pid=$pid\n"; close(SUDOr); $ptyfh->close_slave(); # Send password, and get back response local $oldfh = select(SUDOw); $| = 1; select($oldfh); print DEBUG "check_sudo_permissions: about to send pass\n"; local $SIG{'PIPE'} = 'ignore'; # Sometimes sudo doesn't ask for a password print SUDOw $pass,"\n"; print DEBUG "check_sudo_permissions: sent pass=$pass\n"; close(SUDOw); local $out; while(<$ptyfh>) { print DEBUG "check_sudo_permissions: got $_"; $out .= $_; } close($ptyfh); kill('KILL', $pid); waitpid($pid, 0); local ($ok) = ($out =~ /\(ALL\)\s+ALL|\(ALL\)\s+NOPASSWD:\s+ALL|\(ALL\s*:\s*ALL\)\s+ALL|\(ALL\s*:\s*ALL\)\s+NOPASSWD:\s+ALL/ ? 1 : 0); # Update cache if ($PASSINw) { print $PASSINw "writesudo $user $ok\n"; } return $ok; } sub other_groups { my ($user) = @_; my @rv; setgrent(); while(my @g = getgrent()) { my @m = split(/\s+/, $g[3]); push(@rv, $g[2]) if (&indexof($user, @m) >= 0); } endgrent(); return @rv; } # is_mobile_useragent(agent) # Returns 1 if some user agent looks like a cellphone or other mobile device, # such as a treo. sub is_mobile_useragent { local ($agent) = @_; local @prefixes = ( "UP.Link", # Openwave "Nokia", # All Nokias start with Nokia "MOT-", # All Motorola phones start with MOT- "SAMSUNG", # Samsung browsers "Samsung", # Samsung browsers "SEC-", # Samsung browsers "AU-MIC", # Samsung browsers "AUDIOVOX", # Audiovox "BlackBerry", # BlackBerry "hiptop", # Danger hiptop Sidekick "SonyEricsson", # Sony Ericsson "Ericsson", # Old Ericsson browsers , mostly WAP "Mitsu/1.1.A", # Mitsubishi phones "Panasonic WAP", # Panasonic old WAP phones "DoCoMo", # DoCoMo phones "Lynx", # Lynx text-mode linux browser "Links", # Another text-mode linux browser "Dalvik", # Android browser ); local @substrings = ( "UP.Browser", # Openwave "MobilePhone", # NetFront "AU-MIC-A700", # Samsung A700 Obigo browsers "Danger hiptop", # Danger Sidekick hiptop "Windows CE", # Windows CE Pocket PC "IEMobile", # Windows mobile browser "Blazer", # Palm Treo Blazer "BlackBerry", # BlackBerries can emulate other browsers, but # they still keep this string in the UserAgent "SymbianOS", # New Series60 browser has safari in it and # SymbianOS is the only distinguishing string "iPhone", # Apple iPhone KHTML browser "iPod", # iPod touch browser "MobileSafari", # HTTP client in iPhone "Mobile Safari", # Samsung Galaxy S6 browser "Opera Mini", # Opera Mini "HTC_P3700", # HTC mobile device "Pre/", # Palm Pre "webOS/", # Palm WebOS "Nintendo DS", # DSi / DSi-XL ); local @regexps = ( "Android.*Mobile", # Android phone ); foreach my $p (@prefixes) { return 1 if ($agent =~ /^\Q$p\E/); } foreach my $s (@substrings, @mobile_agents) { return 1 if ($agent =~ /\Q$s\E/); } foreach my $s (@regexps) { return 1 if ($agent =~ /$s/); } return 0; } # write_blocked_file() # Writes out a text file of blocked hosts and users sub write_blocked_file { open(BLOCKED, ">$config{'blockedfile'}"); foreach my $d (grep { $hostfail{$_} } @deny) { print BLOCKED "host $d $hostfail{$d} $blockhosttime{$d}\n"; } foreach my $d (grep { $userfail{$_} } @denyusers) { print BLOCKED "user $d $userfail{$d} $blockusertime{$d}\n"; } close(BLOCKED); chmod(0700, $config{'blockedfile'}); } sub write_pid_file { open(PIDFILE, ">$config{'pidfile'}"); printf PIDFILE "%d\n", getpid(); close(PIDFILE); $miniserv_main_pid = getpid(); } # lock_user_password(user) # Updates a user's password file entry to lock it, both in memory and on disk. # Returns 1 if done, -1 if no such user, 0 if already locked sub lock_user_password { local ($user) = @_; local $uinfo = &get_user_details($user); if (!$uinfo) { # No such user! return -1; } if ($uinfo->{'pass'} =~ /^\!/) { # Already locked return 0; } if (!$uinfo->{'proto'}) { # Write to users file $users{$user} = "!".$users{$user}; open(USERS, $config{'userfile'}); local @ufile = <USERS>; close(USERS); foreach my $u (@ufile) { local @uinfo = split(/:/, $u); if ($uinfo[0] eq $user) { $uinfo[1] = $users{$user}; } $u = join(":", @uinfo); } open(USERS, ">$config{'userfile'}"); print USERS @ufile; close(USERS); return 0; } if ($config{'userdb'}) { # Update user DB my ($dbh, $proto, $prefix, $args) = &connect_userdb($config{'userdb'}); if (!$dbh) { return -1; } elsif ($proto eq "mysql" || $proto eq "postgresql") { # Update user attribute my $cmd = $dbh->prepare( "update webmin_user set pass = ? where id = ?"); if (!$cmd || !$cmd->execute("!".$uinfo->{'pass'}, $uinfo->{'id'})) { # Update failed print STDERR "Failed to lock password : ", $dbh->errstr,"\n"; return -1; } $cmd->finish() if ($cmd); } elsif ($proto eq "ldap") { # Update LDAP object my $rv = $dbh->modify($uinfo->{'id'}, replace => { 'webminPass' => '!'.$uinfo->{'pass'} }); if (!$rv || $rv->code) { print STDERR "Failed to lock password : ", ($rv ? $rv->error : "Unknown error"),"\n"; return -1; } } &disconnect_userdb($config{'userdb'}, $dbh); return 0; } return -1; # This should never be reached } # hash_session_id(sid) # Returns an MD5 or Unix-crypted session ID sub hash_session_id { local ($sid) = @_; if (!$hash_session_id_cache{$sid}) { if ($use_md5) { # Take MD5 hash $hash_session_id_cache{$sid} = &encrypt_md5($sid); } else { # Unix crypt $hash_session_id_cache{$sid} = &unix_crypt($sid, "XX"); } } return $hash_session_id_cache{$sid}; } # encrypt_md5(string, [salt]) # Returns a string encrypted in MD5 format sub encrypt_md5 { local ($passwd, $salt) = @_; local $magic = '$1$'; if ($salt =~ /^\$1\$([^\$]+)/) { # Extract actual salt from already encrypted password $salt = $1; } # Add the password local $ctx = eval "new $use_md5"; $ctx->add($passwd); if ($salt) { $ctx->add($magic); $ctx->add($salt); } # Add some more stuff from the hash of the password and salt local $ctx1 = eval "new $use_md5"; $ctx1->add($passwd); if ($salt) { $ctx1->add($salt); } $ctx1->add($passwd); local $final = $ctx1->digest(); for($pl=length($passwd); $pl>0; $pl-=16) { $ctx->add($pl > 16 ? $final : substr($final, 0, $pl)); } # This piece of code seems rather pointless, but it's in the C code that # does MD5 in PAM so it has to go in! local $j = 0; local ($i, $l); for($i=length($passwd); $i; $i >>= 1) { if ($i & 1) { $ctx->add("\0"); } else { $ctx->add(substr($passwd, $j, 1)); } } $final = $ctx->digest(); if ($salt) { # This loop exists only to waste time for($i=0; $i<1000; $i++) { $ctx1 = eval "new $use_md5"; $ctx1->add($i & 1 ? $passwd : $final); $ctx1->add($salt) if ($i % 3); $ctx1->add($passwd) if ($i % 7); $ctx1->add($i & 1 ? $final : $passwd); $final = $ctx1->digest(); } } # Convert the 16-byte final string into a readable form local $rv; local @final = map { ord($_) } split(//, $final); $l = ($final[ 0]<<16) + ($final[ 6]<<8) + $final[12]; $rv .= &to64($l, 4); $l = ($final[ 1]<<16) + ($final[ 7]<<8) + $final[13]; $rv .= &to64($l, 4); $l = ($final[ 2]<<16) + ($final[ 8]<<8) + $final[14]; $rv .= &to64($l, 4); $l = ($final[ 3]<<16) + ($final[ 9]<<8) + $final[15]; $rv .= &to64($l, 4); $l = ($final[ 4]<<16) + ($final[10]<<8) + $final[ 5]; $rv .= &to64($l, 4); $l = $final[11]; $rv .= &to64($l, 2); # Add salt if needed if ($salt) { return $magic.$salt.'$'.$rv; } else { return $rv; } } sub to64 { local ($v, $n) = @_; local $r; while(--$n >= 0) { $r .= $itoa64[$v & 0x3f]; $v >>= 6; } return $r; } # read_file(file, &assoc, [&order], [lowercase]) # Fill an associative array with name=value pairs from a file sub read_file { open(ARFILE, $_[0]) || return 0; while(<ARFILE>) { s/\r|\n//g; if (!/^#/ && /^([^=]*)=(.*)$/) { $_[1]->{$_[3] ? lc($1) : $1} = $2; push(@{$_[2]}, $1) if ($_[2]); } } close(ARFILE); return 1; } # write_file(file, array) # Write out the contents of an associative array as name=value lines sub write_file { local(%old, @order); &read_file($_[0], \%old, \@order); open(ARFILE, ">$_[0]"); foreach $k (@order) { print ARFILE $k,"=",$_[1]->{$k},"\n" if (exists($_[1]->{$k})); } foreach $k (keys %{$_[1]}) { print ARFILE $k,"=",$_[1]->{$k},"\n" if (!exists($old{$k})); } close(ARFILE); } # execute_ready_webmin_crons(run-count) # Find and run any cron jobs that are due, based on their last run time and # execution interval sub execute_ready_webmin_crons { my ($runs) = @_; my $now = time(); my $changed = 0; foreach my $cron (@webmincrons) { my $run = 0; if ($runs == 0 && $cron->{'boot'}) { # If cron job wants to be run at startup, run it now $run = 1; } elsif ($cron->{'disabled'}) { # Explicitly disabled $run = 0; } elsif (!$webmincron_last{$cron->{'id'}}) { # If not ever run before, don't run right away $webmincron_last{$cron->{'id'}} = $now; $changed = 1; } elsif ($cron->{'interval'} && $now - $webmincron_last{$cron->{'id'}} > $cron->{'interval'}) { # Older than interval .. time to run $run = 1; } elsif ($cron->{'mins'} ne '') { # Check if current time matches spec, and we haven't run in the # last minute my @tm = localtime($now); if (&matches_cron($cron->{'mins'}, $tm[1], 0) && &matches_cron($cron->{'hours'}, $tm[2], 0) && &matches_cron($cron->{'days'}, $tm[3], 1) && &matches_cron($cron->{'months'}, $tm[4]+1, 1) && &matches_cron($cron->{'weekdays'}, $tm[6], 0) && $now - $webmincron_last{$cron->{'id'}} > 60) { $run = 1; } } if ($run) { print DEBUG "Running cron id=$cron->{'id'} ". "module=$cron->{'module'} func=$cron->{'func'} ". "arg0=$cron->{'arg0'}\n"; $webmincron_last{$cron->{'id'}} = $now; $changed = 1; my $pid = &execute_webmin_command($config{'webmincron_wrapper'}, [ $cron ]); push(@childpids, $pid); } } if ($changed) { # Write out file containing last run times &write_file($config{'webmincron_last'}, \%webmincron_last); } } # matches_cron(cron-spec, time, first-value) # Checks if some minute or hour matches some cron spec, which can be * or a list # of numbers. sub matches_cron { my ($spec, $tm, $first) = @_; if ($spec eq '*') { return 1; } else { foreach my $s (split(/,/, $spec)) { if ($s == $tm || $s =~ /^(\d+)\-(\d+)$/ && $tm >= $1 && $tm <= $2 || $s =~ /^\*\/(\d+)$/ && $tm % $1 == $first || $s =~ /^(\d+)\-(\d+)\/(\d+)$/ && $tm >= $1 && $tm <= $2 && $tm % $3 == $first) { return 1; } } return 0; } } # read_webmin_crons() # Read all scheduled webmin cron functions and store them in the @webmincrons # global list sub read_webmin_crons { @webmincrons = ( ); opendir(CRONS, $config{'webmincron_dir'}); print DEBUG "Reading crons from $config{'webmincron_dir'}\n"; foreach my $f (readdir(CRONS)) { if ($f =~ /^(\d+)\.cron$/) { my %cron; &read_file("$config{'webmincron_dir'}/$f", \%cron); $cron{'id'} = $1; my $broken = 0; foreach my $n ('module', 'func') { if (!$cron{$n}) { print STDERR "Cron $1 missing $n\n"; $broken = 1; } } if (!$cron{'interval'} && $cron{'mins'} eq '' && $cron{'special'} eq '') { print STDERR "Cron $1 missing any time spec\n"; $broken = 1; } if ($cron{'special'} eq 'hourly') { # Run every hour on the hour $cron{'mins'} = 0; $cron{'hours'} = '*'; $cron{'days'} = '*'; $cron{'months'} = '*'; $cron{'weekdays'} = '*'; } elsif ($cron{'special'} eq 'daily') { # Run every day at midnight $cron{'mins'} = 0; $cron{'hours'} = '0'; $cron{'days'} = '*'; $cron{'months'} = '*'; $cron{'weekdays'} = '*'; } elsif ($cron{'special'} eq 'monthly') { # Run every month on the 1st $cron{'mins'} = 0; $cron{'hours'} = '0'; $cron{'days'} = '1'; $cron{'months'} = '*'; $cron{'weekdays'} = '*'; } elsif ($cron{'special'} eq 'weekly') { # Run every month on the 1st $cron{'mins'} = 0; $cron{'hours'} = '0'; $cron{'days'} = '*'; $cron{'months'} = '*'; $cron{'weekdays'} = '0'; } elsif ($cron{'special'} eq 'yearly' || $cron{'special'} eq 'annually') { # Run every year on 1st january $cron{'mins'} = 0; $cron{'hours'} = '0'; $cron{'days'} = '1'; $cron{'months'} = '1'; $cron{'weekdays'} = '*'; } elsif ($cron{'special'}) { print STDERR "Cron $1 invalid special time $cron{'special'}\n"; $broken = 1; } if ($cron{'special'}) { delete($cron{'special'}); } if (!$broken) { print DEBUG "Adding cron id=$cron{'id'} module=$cron{'module'} func=$cron{'func'} arg0=$cron{'arg0'}\n"; push(@webmincrons, \%cron); } } } closedir(CRONS); } # precache_files() # Read into the Webmin cache all files marked for pre-caching sub precache_files { undef(%main::read_file_cache); foreach my $g (split(/\s+/, $config{'precache'})) { next if ($g eq "none"); foreach my $f (glob("$config{'root'}/$g")) { my @st = stat($f); next if (!@st); $main::read_file_cache{$f} = { }; &read_file($f, $main::read_file_cache{$f}); $main::read_file_cache_time{$f} = $st[9]; } } } # Check if some address is valid IPv4, returns 1 if so. sub check_ipaddress { return $_[0] =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/ && $1 >= 0 && $1 <= 255 && $2 >= 0 && $2 <= 255 && $3 >= 0 && $3 <= 255 && $4 >= 0 && $4 <= 255; } # Check if some IPv6 address is properly formatted, and returns 1 if so. sub check_ip6address { my @blocks = split(/:/, $_[0]); return 0 if (@blocks == 0 || @blocks > 8); my $ib = $#blocks; my $where = index($blocks[$ib],"/"); my $m = 0; if ($where != -1) { my $b = substr($blocks[$ib],0,$where); $m = substr($blocks[$ib],$where+1,length($blocks[$ib])-($where+1)); $blocks[$ib]=$b; } return 0 if ($m <0 || $m >128); my $b; my $empty = 0; foreach $b (@blocks) { return 0 if ($b ne "" && $b !~ /^[0-9a-f]{1,4}$/i); $empty++ if ($b eq ""); } return 0 if ($empty > 1 && !($_[0] =~ /^::/ && $empty == 2)); return 1; } # network_to_address(binary) # Given a network address in binary IPv4 or v4 format, return the string form sub network_to_address { local ($addr) = @_; if (length($addr) == 4 || !$use_ipv6) { return inet_ntoa($addr); } else { return inet_ntop(AF_INET6(), $addr); } } # redirect_stderr_to_log() # Re-direct STDERR to error log file sub redirect_stderr_to_log { if ($config{'errorlog'} ne '-') { open(STDERR, ">>$config{'errorlog'}") || die "failed to open $config{'errorlog'} : $!"; if ($config{'logperms'}) { chmod(oct($config{'logperms'}), $config{'errorlog'}); } } select(STDERR); $| = 1; select(STDOUT); } # should_gzip_file(filename) # Returns 1 if some path should be gzipped sub should_gzip_file { my ($path) = @_; return $path !~ /\.(gif|png|jpg|jpeg|tif|tiff)$/i; } # get_expires_time(path) # Given a URL path, return the client-side expiry time in seconds sub get_expires_time { my ($path) = @_; foreach my $pe (@expires_paths) { if ($path =~ /$pe->[0]/i) { return $pe->[1]; } } return $config{'expires'}; } sub html_escape { my ($tmp) = @_; $tmp =~ s/&/&amp;/g; $tmp =~ s/</&lt;/g; $tmp =~ s/>/&gt;/g; $tmp =~ s/\"/&quot;/g; $tmp =~ s/\'/&#39;/g; $tmp =~ s/=/&#61;/g; return $tmp; } sub html_strip { my ($tmp) = @_; $tmp =~ s/<[^>]*>//g; return $tmp; } # validate_twofactor(username, token) # Checks if a user's two-factor token is valid or not. Returns undef on success # or the error message on failure. sub validate_twofactor { my ($user, $token) = @_; $token =~ s/^\s+//; $token =~ s/\s+$//; $token || return "No two-factor token entered"; my $tf = $twofactor{$user}; $tf || return undef; pipe(TOKENr, TOKENw); my $pid = &execute_webmin_command($config{'twofactor_wrapper'}, [ $user, $tf->{'provider'}, $tf->{'id'}, $token, $tf->{'apikey'} ], TOKENw); close(TOKENw); waitpid($pid, 0); my $ex = $?; my $out = <TOKENr>; close(TOKENr); if ($ex) { return $out || "Unknown two-factor authentication failure"; } return undef; } # execute_webmin_command(command, &argv, [stdout-fd]) # Run some Webmin script in a sub-process, like webmincron.pl # Returns the PID of the new process. sub execute_webmin_command { my ($cmd, $argv, $fd) = @_; my $pid = fork(); if (!$pid) { # Run via a wrapper command, which we run like a CGI dbmclose(%sessiondb); if ($fd) { open(STDOUT, ">&$fd"); } else { open(STDOUT, ">&STDERR"); } &close_all_sockets(); &close_all_pipes(); close(LISTEN); # Setup CGI-like environment $envtz = $ENV{"TZ"}; $envuser = $ENV{"USER"}; $envpath = $ENV{"PATH"}; $envlang = $ENV{"LANG"}; $envroot = $ENV{"SystemRoot"}; $envperllib = $ENV{'PERLLIB'}; foreach my $k (keys %ENV) { delete($ENV{$k}); } $ENV{"PATH"} = $envpath if ($envpath); $ENV{"TZ"} = $envtz if ($envtz); $ENV{"USER"} = $envuser if ($envuser); $ENV{"OLD_LANG"} = $envlang if ($envlang); $ENV{"SystemRoot"} = $envroot if ($envroot); $ENV{'PERLLIB'} = $envperllib if ($envperllib); $ENV{"HOME"} = $user_homedir; $ENV{"SERVER_SOFTWARE"} = $config{"server"}; $ENV{"SERVER_ADMIN"} = $config{"email"}; $root0 = $roots[0]; $ENV{"SERVER_ROOT"} = $root0; $ENV{"SERVER_REALROOT"} = $root0; $ENV{"SERVER_PORT"} = $config{'port'}; $ENV{"WEBMIN_CRON"} = 1; $ENV{"DOCUMENT_ROOT"} = $root0; $ENV{"DOCUMENT_REALROOT"} = $root0; $ENV{"MINISERV_CONFIG"} = $config_file; $ENV{"HTTPS"} = "ON" if ($use_ssl); $ENV{"MINISERV_PID"} = $miniserv_main_pid; $ENV{"SCRIPT_FILENAME"} = $cmd; if ($ENV{"SCRIPT_FILENAME"} =~ /^\Q$root0\E(\/.*)$/) { $ENV{"SCRIPT_NAME"} = $1; } $cmd =~ /^(.*)\//; $ENV{"PWD"} = $1; foreach $k (keys %config) { if ($k =~ /^env_(\S+)$/) { $ENV{$1} = $config{$k}; } } chdir($ENV{"PWD"}); $SIG{'CHLD'} = 'DEFAULT'; eval { # Have SOCK closed if the perl exec's something use Fcntl; fcntl(SOCK, F_SETFD, FD_CLOEXEC); }; # Run the wrapper script by evaling it if ($cmd =~ /\/([^\/]+)\/([^\/]+)$/) { $pkg = $1; } $0 = $cmd; @ARGV = @$argv; $main_process_id = $$; eval " \%pkg::ENV = \%ENV; package $pkg; do \"$cmd\"; die \$@ if (\$@); "; if ($@) { print STDERR "Perl failure : $@\n"; } exit(0); } return $pid; } # canonicalize_ip6(address) # Converts an address to its full long form. Ie. 2001:db8:0:f101::20 to # 2001:0db8:0000:f101:0000:0000:0000:0020 sub canonicalize_ip6 { my ($addr) = @_; return $addr if (!&check_ip6address($addr)); my @w = split(/:/, $addr); my $idx = &indexof("", @w); if ($idx >= 0) { # Expand :: my $mis = 8 - scalar(@w); my @nw = @w[0..$idx]; for(my $i=0; $i<$mis; $i++) { push(@nw, 0); } push(@nw, @w[$idx+1 .. $#w]); @w = @nw; } foreach my $w (@w) { while(length($w) < 4) { $w = "0".$w; } } return lc(join(":", @w)); } sub get_somaxconn { return defined(&SOMAXCONN) ? SOMAXCONN : 128; } sub is_bad_header { my ($value, $name) = @_; return $value =~ /^\s*\(\s*\)\s*\{/ ? 1 : 0; }
26.638489
229
0.582316
ed2234e29f3c31394fab0ce1ea9bb87aaaf9ec40
6,479
pm
Perl
lib/FAST/Bio/Annotation/SimpleValue.pm
tlawrence3/FAST
54a7987c04fa151e1fc8657caa13423069a33743
[ "Artistic-2.0", "Unlicense" ]
32
2015-02-12T05:54:00.000Z
2021-02-17T08:09:33.000Z
lib/FAST/Bio/Annotation/SimpleValue.pm
tlawrence3/FAST
54a7987c04fa151e1fc8657caa13423069a33743
[ "Artistic-2.0", "Unlicense" ]
42
2015-02-12T05:53:50.000Z
2019-10-18T12:43:24.000Z
lib/FAST/Bio/Annotation/SimpleValue.pm
tlawrence3/FAST
54a7987c04fa151e1fc8657caa13423069a33743
[ "Artistic-2.0", "Unlicense" ]
13
2015-04-14T06:18:43.000Z
2021-10-11T07:47:52.000Z
# # BioPerl module for FAST::Bio::Annotation::SimpleValue # # Please direct questions and support issues to <bioperl-l@bioperl.org> # # Cared for by bioperl <bioperl-l@bioperl.org> # # Copyright bioperl # # You may distribute this module under the same terms as perl itself # POD documentation - main docs before the code =head1 NAME FAST::Bio::Annotation::SimpleValue - A simple scalar =head1 SYNOPSIS use FAST::Bio::Annotation::SimpleValue; use FAST::Bio::Annotation::Collection; my $col = FAST::Bio::Annotation::Collection->new(); my $sv = FAST::Bio::Annotation::SimpleValue->new(-value => 'someval'); $col->add_Annotation('tagname', $sv); =head1 DESCRIPTION Scalar value annotation object =head1 FEEDBACK =head2 Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists =head2 Support Please direct usage questions or support issues to the mailing list: I<bioperl-l@bioperl.org> rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. =head2 Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ =head1 AUTHOR - Ewan Birney Email birney@ebi.ac.uk =head1 APPENDIX The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ =cut # Let the code begin... package FAST::Bio::Annotation::SimpleValue; use strict; # Object preamble - inherits from FAST::Bio::Root::Root #use FAST::Bio::Ontology::TermI; use base qw(FAST::Bio::Root::Root FAST::Bio::AnnotationI); =head2 new Title : new Usage : my $sv = FAST::Bio::Annotation::SimpleValue->new(); Function: Instantiate a new SimpleValue object Returns : FAST::Bio::Annotation::SimpleValue object Args : -value => $value to initialize the object data field [optional] -tagname => $tag to initialize the tagname [optional] -tag_term => ontology term representation of the tag [optional] =cut sub new{ my ($class,@args) = @_; my $self = $class->SUPER::new(@args); my ($value,$tag,$term) = $self->_rearrange([qw(VALUE TAGNAME TAG_TERM)], @args); # set the term first defined $term && $self->tag_term($term); defined $value && $self->value($value); defined $tag && $self->tagname($tag); return $self; } =head1 AnnotationI implementing functions =cut =head2 as_text Title : as_text Usage : my $text = $obj->as_text Function: return the string "Value: $v" where $v is the value Returns : string Args : none =cut sub as_text{ my ($self) = @_; return "Value: ".$self->value; } =head2 display_text Title : display_text Usage : my $str = $ann->display_text(); Function: returns a string. Unlike as_text(), this method returns a string formatted as would be expected for te specific implementation. One can pass a callback as an argument which allows custom text generation; the callback is passed the current instance and any text returned Example : Returns : a string Args : [optional] callback =cut { my $DEFAULT_CB = sub { $_[0]->value}; sub display_text { my ($self, $cb) = @_; $cb ||= $DEFAULT_CB; $self->throw("Callback must be a code reference") if ref $cb ne 'CODE'; return $cb->($self); } } =head2 hash_tree Title : hash_tree Usage : my $hashtree = $value->hash_tree Function: For supporting the AnnotationI interface just returns the value as a hashref with the key 'value' pointing to the value Returns : hashrf Args : none =cut sub hash_tree{ my $self = shift; my $h = {}; $h->{'value'} = $self->value; return $h; } =head2 tagname Title : tagname Usage : $obj->tagname($newval) Function: Get/set the tagname for this annotation value. Setting this is optional. If set, it obviates the need to provide a tag to AnnotationCollection when adding this object. Example : Returns : value of tagname (a scalar) Args : new value (a scalar, optional) =cut sub tagname{ my $self = shift; # check for presence of an ontology term if($self->{'_tag_term'}) { # keep a copy in case the term is removed later $self->{'tagname'} = $_[0] if @_; # delegate to the ontology term object return $self->tag_term->name(@_); } return $self->{'tagname'} = shift if @_; return $self->{'tagname'}; } =head1 Specific accessors for SimpleValue =cut =head2 value Title : value Usage : $obj->value($newval) Function: Get/Set the value for simplevalue Returns : value of value Args : newvalue (optional) =cut sub value{ my ($self,$value) = @_; if( defined $value) { $self->{'value'} = $value; } return $self->{'value'}; } =head2 tag_term Title : tag_term Usage : $obj->tag_term($newval) Function: Get/set the L<FAST::Bio::Ontology::TermI> object representing the tag name. This is so you can specifically relate the tag of this annotation to an entry in an ontology. You may want to do this to associate an identifier with the tag, or a particular category, such that you can better match the tag against a controlled vocabulary. This accessor will return undef if it has never been set before in order to allow this annotation to stay light-weight if an ontology term representation of the tag is not needed. Once it is set to a valid value, tagname() will actually delegate to the name() of this term. Example : Returns : a L<FAST::Bio::Ontology::TermI> compliant object, or undef Args : on set, new value (a L<FAST::Bio::Ontology::TermI> compliant object or undef, optional) =cut sub tag_term{ my $self = shift; return $self->{'_tag_term'} = shift if @_; return $self->{'_tag_term'}; } 1;
23.732601
112
0.672943
73e77ba8d2526527a66edde459caaec542d2f5c4
5,850
pm
Perl
t/lib/t/MusicBrainz/Server/Data/DurationLookup.pm
briaguya-ai/musicbrainz-server
e79323df0641f3928333bdd5241b81edc9c0293d
[ "BSD-2-Clause" ]
null
null
null
t/lib/t/MusicBrainz/Server/Data/DurationLookup.pm
briaguya-ai/musicbrainz-server
e79323df0641f3928333bdd5241b81edc9c0293d
[ "BSD-2-Clause" ]
null
null
null
t/lib/t/MusicBrainz/Server/Data/DurationLookup.pm
briaguya-ai/musicbrainz-server
e79323df0641f3928333bdd5241b81edc9c0293d
[ "BSD-2-Clause" ]
null
null
null
package t::MusicBrainz::Server::Data::DurationLookup; use Test::Routine; use Test::Moose; use Test::More; use MusicBrainz::Server::Constants qw( $EDIT_MEDIUM_EDIT ); use MusicBrainz::Server::Context; use MusicBrainz::Server::Data::DurationLookup; use MusicBrainz::Server::Test qw( accept_edit ); use Sql; with 't::Context'; test 'tracklist used to fit lookup criteria but no longer does' => sub { my $test = shift; my $c = $test->c; MusicBrainz::Server::Test->prepare_test_database($test->c, '+tracklist'); $c->sql->do("INSERT INTO editor (id, name, password, ha1, email, email_confirm_date) ". "VALUES (1, 'annotation_editor', '{CLEARTEXT}password', ". "'3a115bc4f05ea9856bd4611b75c80bca', 'editor\@example.org', '2005-02-18')"); my $artist_credit = { names => [{ artist => { id => 1 }, name => 'Artist', join_phrase => '' }] }; my $insert_hash = { name => 'Bonus disc', format_id => 1, position => 3, release_id => 1, tracklist => [ { name => 'Dirty Electro Mix', position => 1, recording_id => 1, length => 330160, artist_credit => $artist_credit, }, { name => 'I.Y.F.F.E Guest Mix', position => 2, recording_id => 2, length => 262000, artist_credit => $artist_credit, } ] }; my $toc = "1 2 44412 0 24762"; my ($durationlookup, $hits) = $c->model('DurationLookup')->lookup($toc, 10000); is($hits, 0, "disc does not exist yet, no match with TOC lookup"); my $created = $c->model('Medium')->insert($insert_hash); my $medium = $c->model('Medium')->get_by_id($created->{id}); isa_ok($medium, 'MusicBrainz::Server::Entity::Medium'); ($durationlookup, $hits) = $c->model('DurationLookup')->lookup($toc, 10000); is($hits, 1, "one match with TOC lookup"); $medium = $c->model('Medium')->get_by_id($durationlookup->[0]{results}[0]{medium}); $c->model('Track')->load_for_mediums($medium); $c->model('ArtistCredit')->load($medium->all_tracks); # clear length on the track and then submit an edit for the medium # with that track length cleared. A disc where not all tracks have a # length should not have an entry in medium_index. $medium->tracks->[0]->clear_length(); my $edit = $c->model('Edit')->create( editor_id => 1, edit_type => $EDIT_MEDIUM_EDIT, to_edit => $medium, tracklist => $medium->tracks ); accept_edit($c, $edit); ($durationlookup, $hits) = $c->model('DurationLookup')->lookup($toc, 10000); is($hits, 0, "duration lookup did not find medium after it was edited"); }; test 'TOC lookup for disc with pregap track' => sub { my $test = shift; my $c = $test->c; MusicBrainz::Server::Test->prepare_test_database($test->c, '+tracklist'); my $artist_credit = { names => [{ artist => { id => 1 }, name => 'Artist', join_phrase => '' }] }; my $insert_hash = { name => 'Bonus disc', format_id => 1, position => 3, release_id => 1, tracklist => [ { name => 'Secret Hidden Track', position => 0, number => "00", recording_id => 3, length => 1122, artist_credit => $artist_credit, }, { name => 'Dirty Electro Mix', position => 1, number => "A1", recording_id => 1, length => 330160, artist_credit => $artist_credit, } ] }; my $created = $c->model('Medium')->insert($insert_hash); my $medium = $c->model('Medium')->get_by_id($created->{id}); isa_ok($medium, 'MusicBrainz::Server::Entity::Medium'); $c->model('Medium')->load_track_durations($medium); is($medium->length, 1122 + 330160, "inserted medium has expected length"); my ($durationlookup, $hits) = $c->model('DurationLookup')->lookup("1 1 39872 15110", 1); is($hits, 1, "one match with TOC lookup"); $medium = $c->model('Medium')->get_by_id($durationlookup->[0]{results}[0]{medium}); is($medium->id, $created->{id}); is($medium->name, 'Bonus disc', 'TOC lookup found correct disc'); }; test all => sub { my $test = shift; MusicBrainz::Server::Test->prepare_test_database($test->c, '+data_durationlookup'); my $sql = $test->c->sql; my $lookup_data = MusicBrainz::Server::Data::DurationLookup->new(c => $test->c); does_ok($lookup_data, 'MusicBrainz::Server::Data::Role::Context'); my ($release_results, $hits) = $lookup_data->lookup("1 7 171327 150 22179 49905 69318 96240 121186 143398", 10000); ok ( $hits > 0, 'found results' ); my $results = $release_results->[0]{results}; if (my ($result) = grep { $_->{medium} == 1 } @$results) { ok($result, 'returned medium 1'); is( $result->{distance}, 1 ); is( $result->{medium}, 1 ); } if (my ($result) = grep { $_->{medium} == 3 } @$results) { ok($result, 'returned medium 3'); is( $result->{distance}, 1 ); is( $result->{medium}, 3 ); } ($release_results, $hits) = $lookup_data->lookup("1 9 189343 150 6614 32287 54041 61236 88129 92729 115276 153877", 10000); $results = $release_results->[0]{results}; if (my ($result) = grep { $_->{medium} == 2 } @$results) { ok($result, 'returned medium 1'); is( $result->{distance}, 1 ); is( $result->{medium}, 2 ); } if (my ($result) = grep { $_->{medium} == 4 } @$results) { ok($result, 'returned medium 4'); is( $result->{distance}, 1 ); is( $result->{medium}, 4 ); } }; 1;
31.451613
123
0.556239
ed1e2d582cc51a5bb4ed19c6e7fa89ad6119d323
2,525
pl
Perl
src/soft/miARma-Seq.1.7.5/bin/common/mirdeep/collapse_reads_md.pl
eandresleon/miRNA-mRNA_Integration
b478a6ae73e235f9826cbf5343d2865bfcb067fa
[ "Apache-2.0" ]
8
2018-08-13T18:50:15.000Z
2021-11-02T05:09:44.000Z
src/soft/miARma-Seq.1.7.5/bin/common/mirdeep/collapse_reads_md.pl
eandresleon/miRNA-mRNA_Integration
b478a6ae73e235f9826cbf5343d2865bfcb067fa
[ "Apache-2.0" ]
null
null
null
src/soft/miARma-Seq.1.7.5/bin/common/mirdeep/collapse_reads_md.pl
eandresleon/miRNA-mRNA_Integration
b478a6ae73e235f9826cbf5343d2865bfcb067fa
[ "Apache-2.0" ]
4
2018-10-26T04:31:32.000Z
2020-06-20T07:01:33.000Z
#!/usr/bin/perl use warnings; use strict; use Getopt::Std; my $usage = "$0 file_fasta prefix Collapses reads in the fasta file to make each sequence entry unique. Each collapsed entry will have an identifier that follows an underscore '_' separated format. Example: >mmu_1189273_x10 The first field 'mmu' shows which sample the sequence is from. This prefix is given on the command line, and must consist of exactly three alphabetic letters. The second field '118273' is a running number that secures that each identifier is unique. The third field '_x10' shows how many times the given sequence was present in the dataset. -a outputs progress example use: collapse_reads.pl reads.fa mmu "; my $file_fasta=shift or die $usage; my $prefix=shift or die $usage; my %options=(); getopts("a",\%options); my %hash; test_prefix($prefix); parse_file_fasta_seqkey(\$file_fasta,\%hash); print_hash_seqkey(\%hash); sub parse_file_fasta_seqkey{ my($file,$hash)=@_; my($id,$seq)=(); if($options{a}){print STDERR "reading file into hash\n";} my $running_1=0; open (FASTA, "<$$file") or die "can not open $$file\n"; while (<FASTA>) { chomp; if (/^>(\S+)/) { $id = $1; $seq = ""; while (<FASTA>){ chomp; if (/^>(\S+)/){ my $cnt=find_cnt($id); $seq=~tr/[acgtun\.]/[ACGTTNN]/; $$hash{$seq}+=$cnt; $running_1++; if($options{a}){print STDERR "$running_1\r";} $id = $1; $seq = ""; next; } $seq.= $_; } } } my $cnt=find_cnt($id); $seq=~tr/[acgtun\.]/[ACGTTNN]/; $$hash{$seq}+=$cnt; $running_1++; if($options{a}){print STDERR "$running_1\r";} close FASTA; } sub print_hash_seqkey{ my ($hash)=@_; if($options{a}){print STDERR "sorting hash\n";} my $running_2=0; if($options{a}){print STDERR "printing hash\n";} foreach my $key(sort {$$hash{$b} <=> $$hash{$a}} keys %$hash){ my $cnt=$$hash{$key}; print ">$prefix\_$running_2\_x$cnt\n$key\n"; $running_2+=$cnt; if($options{a}){print STDERR "$running_2\r";} } } sub find_cnt{ #finds the frequency of a given read query from its id. my($query)=@_; if($query=~/_x(\d+)/){ my $cnt=$1; return $cnt; }else{ return 1; } } sub test_prefix{ my $prefix=shift; unless($prefix=~/^\w\w\w$/ and !($prefix=~/_/)){ die "prefix $prefix does not contain exactly three alphabet letters\n"; } return; }
18.703704
88
0.594851
ed1f7c1b016a227ef8dc7a93b9a918d268afbf66
11,179
pm
Perl
lib/Cfn/Resource/AWS/GameLift/Fleet.pm
torrentalle/cfn-perl
f5fd3b9e16bbdf6bf3d7e7d6850dfe0f16888aaf
[ "Apache-2.0" ]
null
null
null
lib/Cfn/Resource/AWS/GameLift/Fleet.pm
torrentalle/cfn-perl
f5fd3b9e16bbdf6bf3d7e7d6850dfe0f16888aaf
[ "Apache-2.0" ]
null
null
null
lib/Cfn/Resource/AWS/GameLift/Fleet.pm
torrentalle/cfn-perl
f5fd3b9e16bbdf6bf3d7e7d6850dfe0f16888aaf
[ "Apache-2.0" ]
null
null
null
# AWS::GameLift::Fleet generated from spec 14.3.0 use Moose::Util::TypeConstraints; coerce 'Cfn::Resource::Properties::AWS::GameLift::Fleet', from 'HashRef', via { Cfn::Resource::Properties::AWS::GameLift::Fleet->new( %$_ ) }; package Cfn::Resource::AWS::GameLift::Fleet { use Moose; extends 'Cfn::Resource'; has Properties => (isa => 'Cfn::Resource::Properties::AWS::GameLift::Fleet', is => 'rw', coerce => 1); sub AttributeList { [ ] } sub supported_regions { [ 'af-south-1','ap-east-1','ap-northeast-1','ap-northeast-2','ap-northeast-3','ap-south-1','ap-southeast-1','ap-southeast-2','ca-central-1','cn-north-1','cn-northwest-1','eu-central-1','eu-north-1','eu-south-1','eu-west-1','eu-west-2','eu-west-3','me-south-1','sa-east-1','us-east-1','us-east-2','us-gov-east-1','us-gov-west-1','us-west-1','us-west-2' ] } } subtype 'ArrayOfCfn::Resource::Properties::AWS::GameLift::Fleet::ServerProcess', as 'Cfn::Value', where { $_->isa('Cfn::Value::Array') or $_->isa('Cfn::Value::Function') }, message { "$_ is not a Cfn::Value or a Cfn::Value::Function" }; coerce 'ArrayOfCfn::Resource::Properties::AWS::GameLift::Fleet::ServerProcess', from 'HashRef', via { if (my $f = Cfn::TypeLibrary::try_function($_)) { return $f } else { die 'Only accepts functions'; } }, from 'ArrayRef', via { Cfn::Value::Array->new(Value => [ map { Moose::Util::TypeConstraints::find_type_constraint('Cfn::Resource::Properties::AWS::GameLift::Fleet::ServerProcess')->coerce($_) } @$_ ]); }; subtype 'Cfn::Resource::Properties::AWS::GameLift::Fleet::ServerProcess', as 'Cfn::Value'; coerce 'Cfn::Resource::Properties::AWS::GameLift::Fleet::ServerProcess', from 'HashRef', via { if (my $f = Cfn::TypeLibrary::try_function($_)) { return $f } else { return Cfn::Resource::Properties::AWS::GameLift::Fleet::ServerProcessValue->new( %$_ ); } }; package Cfn::Resource::Properties::AWS::GameLift::Fleet::ServerProcessValue { use Moose; use MooseX::StrictConstructor; extends 'Cfn::Value::TypedValue'; has ConcurrentExecutions => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has LaunchPath => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has Parameters => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); } subtype 'Cfn::Resource::Properties::AWS::GameLift::Fleet::RuntimeConfiguration', as 'Cfn::Value'; coerce 'Cfn::Resource::Properties::AWS::GameLift::Fleet::RuntimeConfiguration', from 'HashRef', via { if (my $f = Cfn::TypeLibrary::try_function($_)) { return $f } else { return Cfn::Resource::Properties::AWS::GameLift::Fleet::RuntimeConfigurationValue->new( %$_ ); } }; package Cfn::Resource::Properties::AWS::GameLift::Fleet::RuntimeConfigurationValue { use Moose; use MooseX::StrictConstructor; extends 'Cfn::Value::TypedValue'; has GameSessionActivationTimeoutSeconds => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has MaxConcurrentGameSessionActivations => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has ServerProcesses => (isa => 'ArrayOfCfn::Resource::Properties::AWS::GameLift::Fleet::ServerProcess', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); } subtype 'Cfn::Resource::Properties::AWS::GameLift::Fleet::ResourceCreationLimitPolicy', as 'Cfn::Value'; coerce 'Cfn::Resource::Properties::AWS::GameLift::Fleet::ResourceCreationLimitPolicy', from 'HashRef', via { if (my $f = Cfn::TypeLibrary::try_function($_)) { return $f } else { return Cfn::Resource::Properties::AWS::GameLift::Fleet::ResourceCreationLimitPolicyValue->new( %$_ ); } }; package Cfn::Resource::Properties::AWS::GameLift::Fleet::ResourceCreationLimitPolicyValue { use Moose; use MooseX::StrictConstructor; extends 'Cfn::Value::TypedValue'; has NewGameSessionsPerCreator => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has PolicyPeriodInMinutes => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); } subtype 'ArrayOfCfn::Resource::Properties::AWS::GameLift::Fleet::IpPermission', as 'Cfn::Value', where { $_->isa('Cfn::Value::Array') or $_->isa('Cfn::Value::Function') }, message { "$_ is not a Cfn::Value or a Cfn::Value::Function" }; coerce 'ArrayOfCfn::Resource::Properties::AWS::GameLift::Fleet::IpPermission', from 'HashRef', via { if (my $f = Cfn::TypeLibrary::try_function($_)) { return $f } else { die 'Only accepts functions'; } }, from 'ArrayRef', via { Cfn::Value::Array->new(Value => [ map { Moose::Util::TypeConstraints::find_type_constraint('Cfn::Resource::Properties::AWS::GameLift::Fleet::IpPermission')->coerce($_) } @$_ ]); }; subtype 'Cfn::Resource::Properties::AWS::GameLift::Fleet::IpPermission', as 'Cfn::Value'; coerce 'Cfn::Resource::Properties::AWS::GameLift::Fleet::IpPermission', from 'HashRef', via { if (my $f = Cfn::TypeLibrary::try_function($_)) { return $f } else { return Cfn::Resource::Properties::AWS::GameLift::Fleet::IpPermissionValue->new( %$_ ); } }; package Cfn::Resource::Properties::AWS::GameLift::Fleet::IpPermissionValue { use Moose; use MooseX::StrictConstructor; extends 'Cfn::Value::TypedValue'; has FromPort => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has IpRange => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has Protocol => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has ToPort => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); } subtype 'Cfn::Resource::Properties::AWS::GameLift::Fleet::CertificateConfiguration', as 'Cfn::Value'; coerce 'Cfn::Resource::Properties::AWS::GameLift::Fleet::CertificateConfiguration', from 'HashRef', via { if (my $f = Cfn::TypeLibrary::try_function($_)) { return $f } else { return Cfn::Resource::Properties::AWS::GameLift::Fleet::CertificateConfigurationValue->new( %$_ ); } }; package Cfn::Resource::Properties::AWS::GameLift::Fleet::CertificateConfigurationValue { use Moose; use MooseX::StrictConstructor; extends 'Cfn::Value::TypedValue'; has CertificateType => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable'); } package Cfn::Resource::Properties::AWS::GameLift::Fleet { use Moose; use MooseX::StrictConstructor; extends 'Cfn::Resource::Properties'; has BuildId => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable'); has CertificateConfiguration => (isa => 'Cfn::Resource::Properties::AWS::GameLift::Fleet::CertificateConfiguration', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable'); has Description => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has DesiredEC2Instances => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has EC2InboundPermissions => (isa => 'ArrayOfCfn::Resource::Properties::AWS::GameLift::Fleet::IpPermission', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has EC2InstanceType => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable'); has FleetType => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable'); has InstanceRoleARN => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable'); has LogPaths => (isa => 'Cfn::Value::Array|Cfn::Value::Function|Cfn::DynamicValue', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable'); has MaxSize => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has MetricGroups => (isa => 'Cfn::Value::Array|Cfn::Value::Function|Cfn::DynamicValue', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has MinSize => (isa => 'Cfn::Value::Integer', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has Name => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, required => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has NewGameSessionProtectionPolicy => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has PeerVpcAwsAccountId => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable'); has PeerVpcId => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable'); has ResourceCreationLimitPolicy => (isa => 'Cfn::Resource::Properties::AWS::GameLift::Fleet::ResourceCreationLimitPolicy', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has RuntimeConfiguration => (isa => 'Cfn::Resource::Properties::AWS::GameLift::Fleet::RuntimeConfiguration', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Mutable'); has ScriptId => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable'); has ServerLaunchParameters => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable'); has ServerLaunchPath => (isa => 'Cfn::Value::String', is => 'rw', coerce => 1, traits => [ 'CfnMutability' ], mutability => 'Immutable'); } 1; ### main pod documentation begin ### =encoding UTF-8 =head1 NAME Cfn::Resource::AWS::GameLift::Fleet - Cfn resource for AWS::GameLift::Fleet =head1 DESCRIPTION This module implements a Perl module that represents the CloudFormation object AWS::GameLift::Fleet. See L<Cfn> for more information on how to use it. =head1 AUTHOR Jose Luis Martinez CAPSiDE jlmartinez@capside.com =head1 COPYRIGHT and LICENSE Copyright (c) 2013 by CAPSiDE This code is distributed under the Apache 2 License. The full text of the license can be found in the LICENSE file included with this module. =cut
47.368644
357
0.639592
73f7efbead7d0330d2159e4848aedd07eb6fc96c
1,192
pm
Perl
lib/Google/Ads/GoogleAds/V5/Enums/FeedAttributeTypeEnum.pm
PierrickVoulet/google-ads-perl
bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4
[ "Apache-2.0" ]
null
null
null
lib/Google/Ads/GoogleAds/V5/Enums/FeedAttributeTypeEnum.pm
PierrickVoulet/google-ads-perl
bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4
[ "Apache-2.0" ]
null
null
null
lib/Google/Ads/GoogleAds/V5/Enums/FeedAttributeTypeEnum.pm
PierrickVoulet/google-ads-perl
bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4
[ "Apache-2.0" ]
null
null
null
# Copyright 2020, Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. package Google::Ads::GoogleAds::V5::Enums::FeedAttributeTypeEnum; use strict; use warnings; use Const::Exporter enums => [ UNSPECIFIED => "UNSPECIFIED", UNKNOWN => "UNKNOWN", INT64 => "INT64", DOUBLE => "DOUBLE", STRING => "STRING", BOOLEAN => "BOOLEAN", URL => "URL", DATE_TIME => "DATE_TIME", INT64_LIST => "INT64_LIST", DOUBLE_LIST => "DOUBLE_LIST", STRING_LIST => "STRING_LIST", BOOLEAN_LIST => "BOOLEAN_LIST", URL_LIST => "URL_LIST", DATE_TIME_LIST => "DATE_TIME_LIST", PRICE => "PRICE" ]; 1;
30.564103
74
0.656879
ed2e3703e6bfe6e9026faff5fead94b9289b8531
9,734
pm
Perl
modules/Bio/EnsEMBL/IdMapping/StableIdGenerator/EnsemblGeneric.pm
Anacode/ensembl
d3cfe97706ed1d38ee6b561198dd592c9f4ea2ee
[ "Apache-2.0" ]
null
null
null
modules/Bio/EnsEMBL/IdMapping/StableIdGenerator/EnsemblGeneric.pm
Anacode/ensembl
d3cfe97706ed1d38ee6b561198dd592c9f4ea2ee
[ "Apache-2.0" ]
null
null
null
modules/Bio/EnsEMBL/IdMapping/StableIdGenerator/EnsemblGeneric.pm
Anacode/ensembl
d3cfe97706ed1d38ee6b561198dd592c9f4ea2ee
[ "Apache-2.0" ]
null
null
null
=head1 LICENSE Copyright [1999-2013] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =cut =head1 CONTACT Please email comments or questions to the public Ensembl developers list at <dev@ensembl.org>. Questions may also be sent to the Ensembl help desk at <helpdesk@ensembl.org>. =cut =head1 NAME Bio::EnsEMBL::IdMapping::StableIdGenerator::EnsemblGeneric - default Ensembl StableIdGenerator implementation =head1 SYNOPSIS # inject the confiured StableIdGenerator plugin my $stable_id_generator = $conf->param('plugin_stable_id_generator'); inject($stable_id_generator); # create a new StableIdGenerator object my $generator_instance = $stable_id_generator->new( -LOGGER => $self->logger, -CONF => $self->conf, -CACHE => $self->cache ); # determine starting stable ID for new assignments my $new_stable_id = $generator_instance->initial_stable_id('gene'); # loop over genes foreach my $target_gene (@all_target_genes) { # if the stable Id for this gene was mapped, assign it if ( $mapping_exists{ $target_gene->id } ) { my $source_gene = $mappings{ $target_gene->id }; $target_gene->stable_id( $source_gene->stable_id ); # calculate and set version my $version = $generator_instance->calculate_version( $source_gene, $target_gene ); $target_gene->version($version); # no mapping exists, assign a new stable Id } else { $target_gene->stable_id($new_stable_id); $target_gene->version('1'); # increment the stable Id (to be assigned to the next unmapped gene) $new_stable_id = $generator_instance->increment_stable_id($new_stable_id); } } =head1 DESCRIPTION This is the default implementation for a StableIdGenerator, which is used by Bio::EnsEMBL::IdMapping::StableIdMapper to generate new stable Ids and increment versions on mapped stable Ids. Refer to the documentation in this module if you would like to implement your own StableIdGenerator. The stable Id mapping application allows you to plugin your own implementation by specifying it with the --plugin_stable_id_generator configuration parameter. Requirements for a StableIdGenerator plugin: - inherit from Bio::EnsEMBL::IdMapping::BaseObject - implement all methods listed in METHODS below (see method POD for signatures) =head1 METHODS initial_stable_id increment_stable_id calculate_version =cut package Bio::EnsEMBL::IdMapping::StableIdGenerator::EnsemblGeneric; use strict; use warnings; no warnings 'uninitialized'; use Bio::EnsEMBL::IdMapping::BaseObject; our @ISA = qw(Bio::EnsEMBL::IdMapping::BaseObject); use Bio::EnsEMBL::Utils::Exception qw(throw warning); =head2 initial_stable_id Arg[1] : String $type - an entity type (gene|transcript|translation|exon) Example : my $new_stable_id = $generator->initial_stable_id('gene'); Description : Determine the initial stable Id to use for new assignments. This method is called once at the beginning of stable Id mapping. Return type : String - a stable Id of appropriate type Exceptions : none Caller : Bio::EnsEMBL::IdMapping::StableIdMapper::map_stable_ids() Status : At Risk : under development =cut sub initial_stable_id { my ( $self, $type ) = @_; my $init_stable_id; # Use stable ID from configuration if set. $init_stable_id = $self->conf->param("starting_${type}_stable_id"); if ( defined($init_stable_id) ) { $self->logger->debug( "Using pre-configured $init_stable_id " . "as base for new $type stable IDs.\n" ); return $init_stable_id; } my $s_dba = $self->cache->get_DBAdaptor('source'); my $s_dbh = $s_dba->dbc->db_handle; # look in the ${type} table first my $sql = qq( SELECT MAX(stable_id) FROM ${type} WHERE stable_id LIKE "ENS%" OR stable_id LIKE "ASMPATCH%" ); $init_stable_id = $self->fetch_value_from_db( $s_dbh, $sql ); # Also look in gene_archive to make sure there are no larger IDs # there. if ( $type ne 'exon' ) { $sql = qq(SELECT MAX(${type}_stable_id) FROM gene_archive); my $archived_stable_id = $self->fetch_value_from_db( $s_dbh, $sql ); if ( $archived_stable_id && $self->is_valid($archived_stable_id) && ( $archived_stable_id gt $init_stable_id ) ) { $init_stable_id = $archived_stable_id; } } if ( defined($init_stable_id) ) { # Since $init_stable_id now is the highest existing stable ID for # this object type, we need to increment it to find the first one we # want to use for new assignments. $init_stable_id = $self->increment_stable_id($init_stable_id); $self->logger->debug( "Using $init_stable_id as base for new $type stable IDs.\n"); } else { $self->logger->warning( "Can't find highest ${type}_stable_id in source db.\n" ); } return $init_stable_id; } ## end sub initial_stable_id =head2 increment_stable_id Arg[1] : String $stable_id - the stable Id to increment Example : $next_stable_id = $generator->increment_stable_id( $current_stable_id); Description : Increments the stable Id used for new assigments. This method is called after each new stable Id assigment to generate the next stable Id to be used. Return type : String - the next new stable Id Exceptions : thrown on missing or malformed argument Caller : Bio::EnsEMBL::IdMapping::StableIdMapper::map_stable_ids() Status : At Risk : under development =cut sub increment_stable_id { my $self = shift; my $stable_id = shift; if ( !$self->is_valid($stable_id) ) { throw( sprintf( "Unknown or missing stable ID '%s'", $stable_id ) ); } if ( $stable_id =~ /^LRG/ ) { throw( sprintf( "We do not increment LRG genes... (got '%s'). " . "Something's wrong.", $stable_id ) ); } $stable_id =~ /^(ENS|ASMPATCH)([A-Z]+)(\d+)$/; my $number = $3; my $new_stable_id = $1 . $2 . ( ++$number ); return $new_stable_id; } =head2 is_valid Arg[1] : String $stable_id - the stable Id to check Example : unless ($generator->is_valid($stable_id)) { die "Invalid stable Id: $stable_id.\n"; } Description : Tests a stable Id to be valid (according to the Ensembl stable Id format definition). Return type : Boolean - TRUE if valid, FALSE otherwise Exceptions : none Caller : general Status : At Risk : under development =cut sub is_valid { my ( $self, $stable_id ) = @_; if ( defined($stable_id) ) { if ( $stable_id =~ /^(ENS|ASMPATCH)([A-Z]+)(\d+)$/ || $stable_id =~ /^LRG/ ) { return 1; } } return 0; } =head2 calculate_version Arg[1] : Bio::EnsEMBL::IdMapping::TinyFeature $s_obj - source object Arg[2] : Bio::EnsEMBL::IdMapping::TinyFeature $t_obj - target object Example : my $version = $generator->calculate_version($source_gene, $target_gene); $target_gene->version($version); Description : Determines the version for a mapped stable Id. For Ensembl genes, the rules for incrementing the version number are: - exons: if exon sequence changed - transcript: if spliced exon sequence changed - translation: if translated sequence changed - gene: if any of its transcript changed Return type : String - the version to be used Exceptions : thrown on wrong argument Caller : Bio::EnsEMBL::IdMapping::StableIdMapper::map_stable_ids() Status : At Risk : under development =cut sub calculate_version { my ( $self, $s_obj, $t_obj ) = @_; my $version = $s_obj->version(); if ( $s_obj->isa('Bio::EnsEMBL::IdMapping::TinyExon') ) { # increment version if sequence changed if ( $s_obj->seq() ne $t_obj->seq() ) { ++$version } } elsif ( $s_obj->isa('Bio::EnsEMBL::IdMapping::TinyTranscript') ) { # increment version if spliced exon sequence changed if ( $s_obj->seq_md5_sum() ne $t_obj->seq_md5_sum() ) { ++$version } } elsif ( $s_obj->isa('Bio::EnsEMBL::IdMapping::TinyTranslation') ) { # increment version if transcript or translation sequences changed if ( $s_obj->seq() ne $t_obj->seq() ) { ++$version } } elsif ( $s_obj->isa('Bio::EnsEMBL::IdMapping::TinyGene') ) { # increment version if any transcript changed my $s_tr_ident = join( ":", map { $_->stable_id() . '.' . $_->version() } sort { $a->stable_id() cmp $b->stable_id() } @{ $s_obj->get_all_Transcripts() } ); my $t_tr_ident = join( ":", map { $_->stable_id() . '.' . $_->version() } sort { $a->stable_id() cmp $b->stable_id() } @{ $t_obj->get_all_Transcripts() } ); if ( $s_tr_ident ne $t_tr_ident ) { ++$version } } else { throw( "Unknown object type: " . ref($s_obj) ); } return $version; } ## end sub calculate_version 1;
30.41875
100
0.656462
ed0282b36c0b394cb3f907ad3ca6a3204dbaca78
5,799
pl
Perl
Mojoqq/perl/vendor/lib/scan.pl
ghuan/Mojo-webqq-for-windows
ad44014da4578f99aa3efad0b55f0fc3bc3af322
[ "Unlicense" ]
null
null
null
Mojoqq/perl/vendor/lib/scan.pl
ghuan/Mojo-webqq-for-windows
ad44014da4578f99aa3efad0b55f0fc3bc3af322
[ "Unlicense" ]
null
null
null
Mojoqq/perl/vendor/lib/scan.pl
ghuan/Mojo-webqq-for-windows
ad44014da4578f99aa3efad0b55f0fc3bc3af322
[ "Unlicense" ]
1
2020-11-04T06:58:34.000Z
2020-11-04T06:58:34.000Z
#!/usr/local/bin/perl my $ignore_re = '^(' . join("|", qw( _ [a-z] DBM DBC DB_AM_ DB_BT_ DB_RE_ DB_HS_ DB_FUNC_ DB_DBT_ DB_DBM DB_TSL MP TXN DB_TXN_GETPGNOS DB_TXN_BACKWARD_ALLOC DB_ALIGN8 )) . ')' ; my %ignore_def = map {$_, 1} qw() ; %ignore_enums = map {$_, 1} qw( ACTION db_status_t db_notices db_lockmode_t ) ; my %ignore_exact_enum = map { $_ => 1} qw( DB_TXN_GETPGNOS DB_TXN_BACKWARD_ALLOC ); my $filler = ' ' x 26 ; chdir "libraries" || die "Cannot chdir into './libraries': $!\n"; foreach my $name (sort tuple glob "[2-9]*") { next if $name =~ /(NOHEAP|NC|private)$/; my $inc = "$name/include/db.h" ; next unless -f $inc ; my $file = readFile($inc) ; StripCommentsAndStrings($file) ; my $result = scan($name, $file) ; print "\n\t#########\n\t# $name\n\t#########\n\n$result" if $result; } exit ; sub scan { my $version = shift ; my $file = shift ; my %seen_define = () ; my $result = "" ; if (1) { # Preprocess all tri-graphs # including things stuck in quoted string constants. $file =~ s/\?\?=/#/g; # | ??=| #| $file =~ s/\?\?\!/|/g; # | ??!| || $file =~ s/\?\?'/^/g; # | ??'| ^| $file =~ s/\?\?\(/[/g; # | ??(| [| $file =~ s/\?\?\)/]/g; # | ??)| ]| $file =~ s/\?\?\-/~/g; # | ??-| ~| $file =~ s/\?\?\//\\/g; # | ??/| \| $file =~ s/\?\?</{/g; # | ??<| {| $file =~ s/\?\?>/}/g; # | ??>| }| } while ( $file =~ /^\s*#\s*define\s+([\$\w]+)\b(?!\()\s*(.*)/gm ) { my $def = $1; my $rest = $2; my $ignore = 0 ; $ignore = 1 if $ignore_def{$def} || $def =~ /$ignore_re/o ; # Cannot do: (-1) and ((LHANDLE)3) are OK: #print("Skip non-wordy $def => $rest\n"), $rest =~ s/\s*$//; #next if $rest =~ /[^\w\$]/; #print "Matched $_ ($def)\n" ; next if $before{$def} ++ ; if ($ignore) { $seen_define{$def} = 'IGNORE' } elsif ($rest =~ /"/) { $seen_define{$def} = 'STRING' } else { $seen_define{$def} = 'DEFINE' } } foreach $define (sort keys %seen_define) { my $out = $filler ; substr($out,0, length $define) = $define; $result .= "\t$out => $seen_define{$define},\n" ; } while ($file =~ /\btypedef\s+enum\s*{(.*?)}\s*(\w+)/gs ) { my $enum = $1 ; my $name = $2 ; my $ignore = 0 ; $ignore = 1 if $ignore_enums{$name} ; #$enum =~ s/\s*=\s*\S+\s*(,?)\s*\n/$1/g; $enum =~ s/^\s*//; $enum =~ s/\s*$//; my @tokens = map { s/\s*=.*// ; $_} split /\s*,\s*/, $enum ; my @new = grep { ! $Enums{$_}++ } @tokens ; if (@new) { my $value ; if ($ignore) { $value = "IGNORE, # $version" } else { $value = "'$version'," } $result .= "\n\t# enum $name\n"; my $out = $filler ; foreach $name (@new) { next if $ignore_exact_enum{$name} ; $out = $filler ; substr($out,0, length $name) = $name; $result .= "\t$out => $value\n" ; } } } return $result ; } sub StripCommentsAndStrings { # Strip C & C++ coments # From the perlfaq $_[0] =~ s{ /\* ## Start of /* ... */ comment [^*]*\*+ ## Non-* followed by 1-or-more *'s ( [^/*][^*]*\*+ )* ## 0-or-more things which don't start with / ## but do end with '*' / ## End of /* ... */ comment | ## OR C++ Comment // ## Start of C++ comment // [^\n]* ## followed by 0-or-more non end of line characters | ## OR various things which aren't comments: ( " ## Start of " ... " string ( \\. ## Escaped char | ## OR [^"\\] ## Non "\ )* " ## End of " ... " string | ## OR ' ## Start of ' ... ' string ( \\. ## Escaped char | ## OR [^'\\] ## Non '\ )* ' ## End of ' ... ' string | ## OR . ## Anything other char [^/"'\\]* ## Chars which doesn't start a comment, string or escape ) }{$2}gxs; # Remove double-quoted strings. #$_[0] =~ s#"(\\.|[^"\\])*"##g; # Remove single-quoted strings. #$_[0] =~ s#'(\\.|[^'\\])*'##g; # Remove leading whitespace. $_[0] =~ s/\A\s+//m ; # Remove trailing whitespace. $_[0] =~ s/\s+\Z//m ; # Replace all multiple whitespace by a single space. #$_[0] =~ s/\s+/ /g ; } sub readFile { my $filename = shift ; open F, "<$filename" || die "Cannot open $filename: $!\n" ; local $/ ; my $x = <F> ; close F ; return $x ; } sub tuple { my (@a) = split(/\./, $a) ; my (@b) = split(/\./, $b) ; if (@a != @b) { my $diff = @a - @b ; push @b, (0 x $diff) if $diff > 0 ; push @a, (0 x -$diff) if $diff < 0 ; } foreach $A (@a) { $B = shift @b ; $A == $B or return $A <=> $B ; } return 0; } __END__
23.864198
79
0.369029
ed160581ceaef08b52362f53c4ae4f94210f75c5
16,783
pm
Perl
tools/perl/lib/dumpvalue.pm
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
tools/perl/lib/dumpvalue.pm
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
tools/perl/lib/dumpvalue.pm
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
use 5.005_64; # for (defined ref) and $#$v and our package Dumpvalue; use strict; our(%address, $stab, @stab, %stab, %subs); # translate control chars to ^X - Randal Schwartz # Modifications to print types by Peter Gordon v1.0 # Ilya Zakharevich -- patches after 5.001 (and some before ;-) # Won't dump symbol tables and contents of debugged files by default # (IZ) changes for objectification: # c) quote() renamed to method set_quote(); # d) unctrlSet() renamed to method set_unctrl(); # f) Compiles with `use strict', but in two places no strict refs is needed: # maybe more problems are waiting... my %defaults = ( globPrint => 0, printUndef => 1, tick => "auto", unctrl => 'quote', subdump => 1, dumpReused => 0, bareStringify => 1, hashDepth => '', arrayDepth => '', dumpDBFiles => '', dumpPackages => '', quoteHighBit => '', usageOnly => '', compactDump => '', veryCompact => '', stopDbSignal => '', ); sub new { my $class = shift; my %opt = (%defaults, @_); bless \%opt, $class; } sub set { my $self = shift; my %opt = @_; @$self{keys %opt} = values %opt; } sub get { my $self = shift; wantarray ? @$self{@_} : $$self{pop @_}; } sub dumpValue { my $self = shift; die "usage: \$dumper->dumpValue(value)" unless @_ == 1; local %address; local $^W=0; (print "undef\n"), return unless defined $_[0]; (print $self->stringify($_[0]), "\n"), return unless ref $_[0]; $self->unwrap($_[0],0); } sub dumpValues { my $self = shift; local %address; local $^W=0; (print "undef\n"), return unless defined $_[0]; $self->unwrap(\@_,0); } # This one is good for variable names: sub unctrl { local($_) = @_; return \$_ if ref \$_ eq "GLOB"; s/([\001-\037\177])/'^'.pack('c',ord($1)^64)/eg; $_; } sub stringify { my $self = shift; local $_ = shift; my $noticks = shift; my $tick = $self->{tick}; return 'undef' unless defined $_ or not $self->{printUndef}; return $_ . "" if ref \$_ eq 'GLOB'; { no strict 'refs'; $_ = &{'overload::StrVal'}($_) if $self->{bareStringify} and ref $_ and %overload:: and defined &{'overload::StrVal'}; } if ($tick eq 'auto') { if (/[\000-\011\013-\037\177]/) { $tick = '"'; } else { $tick = "'"; } } if ($tick eq "'") { s/([\'\\])/\\$1/g; } elsif ($self->{unctrl} eq 'unctrl') { s/([\"\\])/\\$1/g ; s/([\000-\037\177])/'^'.pack('c',ord($1)^64)/eg; s/([\200-\377])/'\\0x'.sprintf('%2X',ord($1))/eg if $self->{quoteHighBit}; } elsif ($self->{unctrl} eq 'quote') { s/([\"\\\$\@])/\\$1/g if $tick eq '"'; s/\033/\\e/g; s/([\000-\037\177])/'\\c'.chr(ord($1)^64)/eg; } s/([\200-\377])/'\\'.sprintf('%3o',ord($1))/eg if $self->{quoteHighBit}; ($noticks || /^\d+(\.\d*)?\Z/) ? $_ : $tick . $_ . $tick; } sub DumpElem { my ($self, $v) = (shift, shift); my $short = $self->stringify($v, ref $v); my $shortmore = ''; if ($self->{veryCompact} && ref $v && (ref $v eq 'ARRAY' and !grep(ref $_, @$v) )) { my $depth = $#$v; ($shortmore, $depth) = (' ...', $self->{arrayDepth} - 1) if $self->{arrayDepth} and $depth >= $self->{arrayDepth}; my @a = map $self->stringify($_), @$v[0..$depth]; print "0..$#{$v} @a$shortmore\n"; } elsif ($self->{veryCompact} && ref $v && (ref $v eq 'HASH') and !grep(ref $_, values %$v)) { my @a = sort keys %$v; my $depth = $#a; ($shortmore, $depth) = (' ...', $self->{hashDepth} - 1) if $self->{hashDepth} and $depth >= $self->{hashDepth}; my @b = map {$self->stringify($_) . " => " . $self->stringify($$v{$_})} @a[0..$depth]; local $" = ', '; print "@b$shortmore\n"; } else { print "$short\n"; $self->unwrap($v,shift); } } sub unwrap { my $self = shift; return if $DB::signal and $self->{stopDbSignal}; my ($v) = shift ; my ($s) = shift ; # extra no of spaces my $sp; my (%v,@v,$address,$short,$fileno); $sp = " " x $s ; $s += 3 ; # Check for reused addresses if (ref $v) { my $val = $v; { no strict 'refs'; $val = &{'overload::StrVal'}($v) if %overload:: and defined &{'overload::StrVal'}; } ($address) = $val =~ /(0x[0-9a-f]+)\)$/ ; if (!$self->{dumpReused} && defined $address) { $address{$address}++ ; if ( $address{$address} > 1 ) { print "${sp}-> REUSED_ADDRESS\n" ; return ; } } } elsif (ref \$v eq 'GLOB') { $address = "$v" . ""; # To avoid a bug with globs $address{$address}++ ; if ( $address{$address} > 1 ) { print "${sp}*DUMPED_GLOB*\n" ; return ; } } if (ref $v eq 'Regexp') { my $re = "$v"; $re =~ s,/,\\/,g; print "$sp-> qr/$re/\n"; return; } if ( UNIVERSAL::isa($v, 'HASH') ) { my @sortKeys = sort keys(%$v) ; my $more; my $tHashDepth = $#sortKeys ; $tHashDepth = $#sortKeys < $self->{hashDepth}-1 ? $#sortKeys : $self->{hashDepth}-1 unless $self->{hashDepth} eq '' ; $more = "....\n" if $tHashDepth < $#sortKeys ; my $shortmore = ""; $shortmore = ", ..." if $tHashDepth < $#sortKeys ; $#sortKeys = $tHashDepth ; if ($self->{compactDump} && !grep(ref $_, values %{$v})) { $short = $sp; my @keys; for (@sortKeys) { push @keys, $self->stringify($_) . " => " . $self->stringify($v->{$_}); } $short .= join ', ', @keys; $short .= $shortmore; (print "$short\n"), return if length $short <= $self->{compactDump}; } for my $key (@sortKeys) { return if $DB::signal and $self->{stopDbSignal}; my $value = $ {$v}{$key} ; print $sp, $self->stringify($key), " => "; $self->DumpElem($value, $s); } print "$sp empty hash\n" unless @sortKeys; print "$sp$more" if defined $more ; } elsif ( UNIVERSAL::isa($v, 'ARRAY') ) { my $tArrayDepth = $#{$v} ; my $more ; $tArrayDepth = $#$v < $self->{arrayDepth}-1 ? $#$v : $self->{arrayDepth}-1 unless $self->{arrayDepth} eq '' ; $more = "....\n" if $tArrayDepth < $#{$v} ; my $shortmore = ""; $shortmore = " ..." if $tArrayDepth < $#{$v} ; if ($self->{compactDump} && !grep(ref $_, @{$v})) { if ($#$v >= 0) { $short = $sp . "0..$#{$v} " . join(" ", map {exists $v->[$_] ? $self->stringify($v->[$_]) : "empty"} ($[..$tArrayDepth) ) . "$shortmore"; } else { $short = $sp . "empty array"; } (print "$short\n"), return if length $short <= $self->{compactDump}; } for my $num ($[ .. $tArrayDepth) { return if $DB::signal and $self->{stopDbSignal}; print "$sp$num "; if (exists $v->[$num]) { $self->DumpElem($v->[$num], $s); } else { print "empty slot\n"; } } print "$sp empty array\n" unless @$v; print "$sp$more" if defined $more ; } elsif ( UNIVERSAL::isa($v, 'SCALAR') or ref $v eq 'REF' ) { print "$sp-> "; $self->DumpElem($$v, $s); } elsif ( UNIVERSAL::isa($v, 'CODE') ) { print "$sp-> "; $self->dumpsub(0, $v); } elsif ( UNIVERSAL::isa($v, 'GLOB') ) { print "$sp-> ",$self->stringify($$v,1),"\n"; if ($self->{globPrint}) { $s += 3; $self->dumpglob('', $s, "{$$v}", $$v, 1); } elsif (defined ($fileno = fileno($v))) { print( (' ' x ($s+3)) . "FileHandle({$$v}) => fileno($fileno)\n" ); } } elsif (ref \$v eq 'GLOB') { if ($self->{globPrint}) { $self->dumpglob('', $s, "{$v}", $v, 1); } elsif (defined ($fileno = fileno(\$v))) { print( (' ' x $s) . "FileHandle({$v}) => fileno($fileno)\n" ); } } } sub matchvar { $_[0] eq $_[1] or ($_[1] =~ /^([!~])(.)([\x00-\xff]*)/) and ($1 eq '!') ^ (eval {($_[2] . "::" . $_[0]) =~ /$2$3/}); } sub compactDump { my $self = shift; $self->{compactDump} = shift if @_; $self->{compactDump} = 6*80-1 if $self->{compactDump} and $self->{compactDump} < 2; $self->{compactDump}; } sub veryCompact { my $self = shift; $self->{veryCompact} = shift if @_; $self->compactDump(1) if !$self->{compactDump} and $self->{veryCompact}; $self->{veryCompact}; } sub set_unctrl { my $self = shift; if (@_) { my $in = shift; if ($in eq 'unctrl' or $in eq 'quote') { $self->{unctrl} = $in; } else { print "Unknown value for `unctrl'.\n"; } } $self->{unctrl}; } sub set_quote { my $self = shift; if (@_ and $_[0] eq '"') { $self->{tick} = '"'; $self->{unctrl} = 'quote'; } elsif (@_ and $_[0] eq 'auto') { $self->{tick} = 'auto'; $self->{unctrl} = 'quote'; } elsif (@_) { # Need to set $self->{tick} = "'"; $self->{unctrl} = 'unctrl'; } $self->{tick}; } sub dumpglob { my $self = shift; return if $DB::signal and $self->{stopDbSignal}; my ($package, $off, $key, $val, $all) = @_; local(*stab) = $val; my $fileno; if (($key !~ /^_</ or $self->{dumpDBFiles}) and defined $stab) { print( (' ' x $off) . "\$", &unctrl($key), " = " ); $self->DumpElem($stab, 3+$off); } if (($key !~ /^_</ or $self->{dumpDBFiles}) and @stab) { print( (' ' x $off) . "\@$key = (\n" ); $self->unwrap(\@stab,3+$off) ; print( (' ' x $off) . ")\n" ); } if ($key ne "main::" && $key ne "DB::" && %stab && ($self->{dumpPackages} or $key !~ /::$/) && ($key !~ /^_</ or $self->{dumpDBFiles}) && !($package eq "Dumpvalue" and $key eq "stab")) { print( (' ' x $off) . "\%$key = (\n" ); $self->unwrap(\%stab,3+$off) ; print( (' ' x $off) . ")\n" ); } if (defined ($fileno = fileno(*stab))) { print( (' ' x $off) . "FileHandle($key) => fileno($fileno)\n" ); } if ($all) { if (defined &stab) { $self->dumpsub($off, $key); } } } sub CvGV_name { my $self = shift; my $in = shift; return if $self->{skipCvGV}; # Backdoor to avoid problems if XS broken... $in = \&$in; # Hard reference... eval {require Devel::Peek; 1} or return; my $gv = Devel::Peek::CvGV($in) or return; *$gv{PACKAGE} . '::' . *$gv{NAME}; } sub dumpsub { my $self = shift; my ($off,$sub) = @_; my $ini = $sub; my $s; $sub = $1 if $sub =~ /^\{\*(.*)\}$/; my $subref = defined $1 ? \&$sub : \&$ini; my $place = $DB::sub{$sub} || (($s = $subs{"$subref"}) && $DB::sub{$s}) || (($s = $self->CvGV_name($subref)) && $DB::sub{$s}) || ($self->{subdump} && ($s = $self->findsubs("$subref")) && $DB::sub{$s}); $s = $sub unless defined $s; $place = '???' unless defined $place; print( (' ' x $off) . "&$s in $place\n" ); } sub findsubs { my $self = shift; return undef unless %DB::sub; my ($addr, $name, $loc); while (($name, $loc) = each %DB::sub) { $addr = \&$name; $subs{"$addr"} = $name; } $self->{subdump} = 0; $subs{ shift() }; } sub dumpvars { my $self = shift; my ($package,@vars) = @_; local(%address,$^W); my ($key,$val); $package .= "::" unless $package =~ /::$/; *stab = *main::; while ($package =~ /(\w+?::)/g) { *stab = $ {stab}{$1}; } $self->{TotalStrings} = 0; $self->{Strings} = 0; $self->{CompleteTotal} = 0; while (($key,$val) = each(%stab)) { return if $DB::signal and $self->{stopDbSignal}; next if @vars && !grep( matchvar($key, $_), @vars ); if ($self->{usageOnly}) { $self->globUsage(\$val, $key) if ($package ne 'Dumpvalue' or $key ne 'stab') and ref(\$val) eq 'GLOB'; } else { $self->dumpglob($package, 0,$key, $val); } } if ($self->{usageOnly}) { print <<EOP; String space: $self->{TotalStrings} bytes in $self->{Strings} strings. EOP $self->{CompleteTotal} += $self->{TotalStrings}; print <<EOP; Grand total = $self->{CompleteTotal} bytes (1 level deep) + overhead. EOP } } sub scalarUsage { my $self = shift; my $size = length($_[0]); $self->{TotalStrings} += $size; $self->{Strings}++; $size; } sub arrayUsage { # array ref, name my $self = shift; my $size = 0; map {$size += $self->scalarUsage($_)} @{$_[0]}; my $len = @{$_[0]}; print "\@$_[1] = $len item", ($len > 1 ? "s" : ""), " (data: $size bytes)\n" if defined $_[1]; $self->{CompleteTotal} += $size; $size; } sub hashUsage { # hash ref, name my $self = shift; my @keys = keys %{$_[0]}; my @values = values %{$_[0]}; my $keys = $self->arrayUsage(\@keys); my $values = $self->arrayUsage(\@values); my $len = @keys; my $total = $keys + $values; print "\%$_[1] = $len item", ($len > 1 ? "s" : ""), " (keys: $keys; values: $values; total: $total bytes)\n" if defined $_[1]; $total; } sub globUsage { # glob ref, name my $self = shift; local *stab = *{$_[0]}; my $total = 0; $total += $self->scalarUsage($stab) if defined $stab; $total += $self->arrayUsage(\@stab, $_[1]) if @stab; $total += $self->hashUsage(\%stab, $_[1]) if %stab and $_[1] ne "main::" and $_[1] ne "DB::"; #and !($package eq "Dumpvalue" and $key eq "stab")); $total; } 1; =head1 NAME Dumpvalue - provides screen dump of Perl data. =head1 SYNOPSIS use Dumpvalue; my $dumper = new Dumpvalue; $dumper->set(globPrint => 1); $dumper->dumpValue(\*::); $dumper->dumpvars('main'); =head1 DESCRIPTION =head2 Creation A new dumper is created by a call $d = new Dumpvalue(option1 => value1, option2 => value2) Recognized options: =over =item C<arrayDepth>, C<hashDepth> Print only first N elements of arrays and hashes. If false, prints all the elements. =item C<compactDump>, C<veryCompact> Change style of array and hash dump. If true, short array may be printed on one line. =item C<globPrint> Whether to print contents of globs. =item C<DumpDBFiles> Dump arrays holding contents of debugged files. =item C<DumpPackages> Dump symbol tables of packages. =item C<DumpReused> Dump contents of "reused" addresses. =item C<tick>, C<HighBit>, C<printUndef> Change style of string dump. Default value of C<tick> is C<auto>, one can enable either double-quotish dump, or single-quotish by setting it to C<"> or C<'>. By default, characters with high bit set are printed I<as is>. =item C<UsageOnly> I<very> rudimentally per-package memory usage dump. If set, C<dumpvars> calculates total size of strings in variables in the package. =item unctrl Changes the style of printout of strings. Possible values are C<unctrl> and C<quote>. =item subdump Whether to try to find the subroutine name given the reference. =item bareStringify Whether to write the non-overloaded form of the stringify-overloaded objects. =item quoteHighBit Whether to print chars with high bit set in binary or "as is". =item stopDbSignal Whether to abort printing if debugger signal flag is raised. =back Later in the life of the object the methods may be queries with get() method and set() method (which accept multiple arguments). =head2 Methods =over =item dumpValue $dumper->dumpValue($value); $dumper->dumpValue([$value1, $value2]); =item dumpValues $dumper->dumpValues($value1, $value2); =item dumpvars $dumper->dumpvars('my_package'); $dumper->dumpvars('my_package', 'foo', '~bar$', '!......'); The optional arguments are considered as literal strings unless they start with C<~> or C<!>, in which case they are interpreted as regular expressions (possibly negated). The second example prints entries with names C<foo>, and also entries with names which ends on C<bar>, or are shorter than 5 chars. =item set_quote $d->set_quote('"'); Sets C<tick> and C<unctrl> options to suitable values for printout with the given quote char. Possible values are C<auto>, C<'> and C<">. =item set_unctrl $d->set_unctrl('"'); Sets C<unctrl> option with checking for an invalid argument. Possible values are C<unctrl> and C<quote>. =item compactDump $d->compactDump(1); Sets C<compactDump> option. If the value is 1, sets to a reasonable big number. =item veryCompact $d->veryCompact(1); Sets C<compactDump> and C<veryCompact> options simultaneously. =item set $d->set(option1 => value1, option2 => value2); =item get @values = $d->get('option1', 'option2'); =back =cut
26.767145
88
0.525591
73db47bf046879ae0a08827821797817a6a1c3f8
1,361
pm
Perl
auto-lib/Paws/WorkDocs/PermissionInfo.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
164
2015-01-08T14:58:53.000Z
2022-02-20T19:16:24.000Z
auto-lib/Paws/WorkDocs/PermissionInfo.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
348
2015-01-07T22:08:38.000Z
2022-01-27T14:34:44.000Z
auto-lib/Paws/WorkDocs/PermissionInfo.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
87
2015-04-22T06:29:47.000Z
2021-09-29T14:45:55.000Z
# Generated by default/object.tt package Paws::WorkDocs::PermissionInfo; use Moose; has Role => (is => 'ro', isa => 'Str'); has Type => (is => 'ro', isa => 'Str'); 1; ### main pod documentation begin ### =head1 NAME Paws::WorkDocs::PermissionInfo =head1 USAGE This class represents one of two things: =head3 Arguments in a call to a service Use the attributes of this class as arguments to methods. You shouldn't make instances of this class. Each attribute should be used as a named argument in the calls that expect this type of object. As an example, if Att1 is expected to be a Paws::WorkDocs::PermissionInfo object: $service_obj->Method(Att1 => { Role => $value, ..., Type => $value }); =head3 Results returned from an API call Use accessors for each attribute. If Att1 is expected to be an Paws::WorkDocs::PermissionInfo object: $result = $service_obj->Method(...); $result->Att1->Role =head1 DESCRIPTION Describes the permissions. =head1 ATTRIBUTES =head2 Role => Str The role of the user. =head2 Type => Str The type of permissions. =head1 SEE ALSO This class forms part of L<Paws>, describing an object used in L<Paws::WorkDocs> =head1 BUGS and CONTRIBUTIONS The source code is located here: L<https://github.com/pplu/aws-sdk-perl> Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> =cut
20.938462
102
0.71565
ed2a604c426388a47fe52be2ca5cecc4554cf0e3
537
pm
Perl
lib/VersionInfo.pm
arnobferdous/simplebot
4712c347a478fc1431a8f6e70c4f02f65ec5289a
[ "MIT" ]
13
2015-02-03T07:00:39.000Z
2021-02-06T00:41:19.000Z
lib/VersionInfo.pm
arnobferdous/simplebot
4712c347a478fc1431a8f6e70c4f02f65ec5289a
[ "MIT" ]
3
2016-02-19T17:34:01.000Z
2020-12-21T22:22:41.000Z
lib/VersionInfo.pm
arnobferdous/simplebot
4712c347a478fc1431a8f6e70c4f02f65ec5289a
[ "MIT" ]
8
2015-02-21T15:38:33.000Z
2022-03-06T05:43:15.000Z
package VersionInfo; ## # VersionInfo.pm # Automatically updated by build script ## use vars qw/$BRANCH $MAJOR $MINOR $BUILD_DATE $BUILD_ID/; $BRANCH = "dev"; $MAJOR = "1.0.0"; $MINOR = "1"; $BUILD_DATE = "n/a"; $BUILD_ID = "n/a"; BEGIN { use Exporter (); use vars qw(@ISA @EXPORT @EXPORT_OK); @ISA = qw(Exporter); @EXPORT = qw(get_version); @EXPORT_OK = qw(); } sub get_version { return { Branch => $BRANCH, Major => $MAJOR, Minor => $MINOR, BuildDate => $BUILD_DATE, BuildID => $BUILD_ID }; } 1;
16.78125
88
0.605214
ed02532f703d968de61968ec974ae83d8cab541d
953
pm
Perl
lib/DateTime/TimeZone/Pacific/Fakaofo.pm
ystk/debian-libdatetime-timezone-perl
381730597e2354ba94d79755f72c59a61ddf450a
[ "Artistic-1.0-cl8" ]
null
null
null
lib/DateTime/TimeZone/Pacific/Fakaofo.pm
ystk/debian-libdatetime-timezone-perl
381730597e2354ba94d79755f72c59a61ddf450a
[ "Artistic-1.0-cl8" ]
null
null
null
lib/DateTime/TimeZone/Pacific/Fakaofo.pm
ystk/debian-libdatetime-timezone-perl
381730597e2354ba94d79755f72c59a61ddf450a
[ "Artistic-1.0-cl8" ]
null
null
null
# This file is auto-generated by the Perl DateTime Suite time zone # code generator (0.07) This code generator comes with the # DateTime::TimeZone module distribution in the tools/ directory # # Generated from /tmp/BeQtk28wzo/australasia. Olson data version 2010k # # Do not edit this file directly. # package DateTime::TimeZone::Pacific::Fakaofo; use strict; use Class::Singleton; use DateTime::TimeZone; use DateTime::TimeZone::OlsonDB; @DateTime::TimeZone::Pacific::Fakaofo::ISA = ( 'Class::Singleton', 'DateTime::TimeZone' ); my $spans = [ [ DateTime::TimeZone::NEG_INFINITY, 59958271496, DateTime::TimeZone::NEG_INFINITY, 59958230400, -41096, 0, 'LMT' ], [ 59958271496, DateTime::TimeZone::INFINITY, 59958235496, DateTime::TimeZone::INFINITY, -36000, 0, 'TKT' ], ]; sub olson_version { '2010k' } sub has_dst_changes { 0 } sub _max_year { 2020 } sub _new_instance { return shift->_init( @_, spans => $spans ); } 1;
16.719298
90
0.711438
ed331b2d6cadadfdcc9dc9657d6dbf84c60602b7
1,123
pm
Perl
segment.pm
benjaminramirezg/simplified_spanish_grammar
4ebcc29237ae918211e531a75edf4d6fe74817f9
[ "Apache-2.0" ]
null
null
null
segment.pm
benjaminramirezg/simplified_spanish_grammar
4ebcc29237ae918211e531a75edf4d6fe74817f9
[ "Apache-2.0" ]
null
null
null
segment.pm
benjaminramirezg/simplified_spanish_grammar
4ebcc29237ae918211e531a75edf4d6fe74817f9
[ "Apache-2.0" ]
null
null
null
package segment; use warnings; use strict; use locale; use Data::Dumper; ############### ## Constructor ############### sub new { my $class = shift; my $self = {@_}; bless ( $self, $class ); $self->token({}); return $self; } ############################## ## métodos de acceso sencillos ############################## sub token { my $self = shift; if ( @_ ) { $self->{token} = shift }; return $self->{token}; } sub id { my $self = shift; if ( @_ ) { $self->{id} = shift }; return $self->{id}; } ############################## ## métodos de acceso complejos ############################## sub get_tokens_list { my $self = shift; return sort { $a <=> $b } keys %{$self->token}; } sub get_token_by_key { my $self = shift; my $key = shift; return $self->token->{$key}; } sub append_token { my $self = shift; my $token = shift; $self->token->{$token->id} = $token; } sub delete_token { my $self = shift; my $token = shift; delete $self->token->{$token->id}; } 1;
14.973333
51
0.443455
73fd37a88d3476749c520d8b4170479d884948d9
952
pl
Perl
3rd_party/transdecoder/3rd_party/cd-hit-v4.6.1-2012-08-27/clstr2tree.pl
alpapan/DEW
3fb77e51a677d05c8c294eb4114284f0b3e55fd4
[ "BSD-3-Clause" ]
2
2016-11-30T04:32:02.000Z
2018-06-29T12:19:58.000Z
3rd_party/transdecoder/3rd_party/cd-hit-v4.6.1-2012-08-27/clstr2tree.pl
alpapan/DEW
3fb77e51a677d05c8c294eb4114284f0b3e55fd4
[ "BSD-3-Clause" ]
3
2021-01-20T13:29:08.000Z
2022-02-21T15:21:15.000Z
3rd_party/transdecoder/3rd_party/cd-hit-v4.6.1-2012-08-27/clstr2tree.pl
alpapan/DEW
3fb77e51a677d05c8c294eb4114284f0b3e55fd4
[ "BSD-3-Clause" ]
1
2020-09-10T09:31:45.000Z
2020-09-10T09:31:45.000Z
#!/usr/bin/perl $clstr = shift; $fr = shift; # for nr80.clstr $fr = 0.8 $fra = 1 - $fr; print "(\n"; open(TMP, $clstr) || die; my $ll; my $no = 0; my @ids = (); my $rep = ""; while($ll=<TMP>) { if ($ll =~ /^>/) { if ($no) { if ($no ==1 ) { print "$rep:1.0,\n";} else { my @mms = (); foreach my $tid (@ids) { push(@mms, "$tid:$fra"); } my $mm = join(",\n", @mms); print "(\n$mm\n):$fr,\n"; } } $no = 0; @ids = (); $rep = ""; } else { my $tid= ""; if ($ll =~ /(aa|nt), >(.+)\.\.\./) { $tid=$2;} push(@ids,$tid); if ($ll =~ /\*/) {$rep = $tid;} $no++; } } if ($no) { if ($no ==1 ) { print "$rep:1.0\n";} else { my @mms = (); foreach my $tid (@ids) { push(@mms, "$tid:$fra"); } my $mm = join(",\n", @mms); print "(\n$mm\n):$fr\n"; } } close(TMP); print ");\n";
18.307692
50
0.347689
ed1f15cd9b28efb989745a944f8852f6d29a4c05
8,398
pm
Perl
modules/EnsEMBL/Web/Utils/FileSystem.pm
nakib103/ensembl-webcode
4814ccb25ff9925d80b71514c72793917614c614
[ "Apache-2.0" ]
16
2015-01-14T14:12:30.000Z
2021-01-27T15:28:52.000Z
modules/EnsEMBL/Web/Utils/FileSystem.pm
nakib103/ensembl-webcode
4814ccb25ff9925d80b71514c72793917614c614
[ "Apache-2.0" ]
250
2015-01-05T13:03:19.000Z
2022-03-30T09:07:12.000Z
modules/EnsEMBL/Web/Utils/FileSystem.pm
nakib103/ensembl-webcode
4814ccb25ff9925d80b71514c72793917614c614
[ "Apache-2.0" ]
98
2015-01-05T14:58:48.000Z
2022-02-15T17:11:32.000Z
=head1 LICENSE Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2021] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =cut package EnsEMBL::Web::Utils::FileSystem; use strict; use warnings; use DirHandle; use File::Path qw(make_path remove_tree); use File::Copy; use EnsEMBL::Web::Exceptions; use Exporter qw(import); our @EXPORT_OK = qw(create_path remove_directory remove_empty_path copy_dir_contents copy_files list_dir_contents); sub create_path { ## Wrapper around make_path, throws an exception if things don't work as expected ## @param Path string ## @param (optional) Hashref as expected by File::Path::make_path() with an extra key 'no_exception' which if set true, will not throw any exception ## @return Arrayref of directories actually created during the call, undef for any problem (in case if 'no_exception' key is set) my ($path, $params) = @_; $params ||= {}; my $no_exception = delete $params->{'no_exception'}; my @directories = make_path($path, { %$params, 'error' => \my $error }); if (@$error) { return undef if $no_exception; throw exception('FileSystemException', sprintf qq(Could not create the given path '%s' due to following errors: \n%s), $path, displayable_error($error)); } return \@directories; } sub remove_directory { ## Removes a directory and all it's contents ## @param Path string ## @param (optional) Hashref as expected by File::Path::remove_tree() with an extra key 'no_exception' which if set true, will not throw any exception ## @return The number of files successfully deleted, undef for any problem (in case if 'no_exception' key is set) my ($path, $params) = @_; $params ||= {}; my $no_exception = delete $params->{'no_exception'}; my $file_count = remove_tree($path, { %$params, 'error' => \my $error}); if (@$error) { return undef if $no_exception; throw exception('FileSystemException', sprintf qq(Could not remove the given directory '%s' due to following errors: \n%s), $path, displayable_error($error)); } return $file_count; } sub remove_empty_path { ## Remvoes a directory and all the parent directories that become empty afterwards. ## @param Path string ## @param Hashref with following keys: ## - remove_contents : Flag if on, will remove the contents of the given dir before removing parent dirs. ## - exclude : Array of folders name that should not be removed while going up the tree (names only, not paths - i.e. no slashes) ## - no_exception : Flag if on, will not throw any exception, but will return undef in case it fails anywhere ## @return 1 if all done successfully, undef for any problem my ($path, $params) = @_; $params ||= {}; my $exclude = delete $params->{'exclude'}; my %exclusion = map { $_ => 1 } @{$exclude || []}; if (!$params->{'remove_contents'} || remove_directory($path, {'keep_root' => 1, 'no_exception' => delete $params->{'no_exception'} })) { my @path = split /\//, $path; pop @path while @path && !$exclusion{$path[-1]} && rmdir join('/', '', @path); return 1; } } sub copy_dir_contents { ## Copies contents of one directory to another ## Throws an exception if destination doesn't exist. ## @param Path string ## @param Hashref with following keys: ## - create_path : Flag if on, will try to create the destination path is already not there ## - recursive : (0/1/include_dirs) 1: will do a recursive copy, 0: will ignore sub directories completely (default), 'include_dirs': will make paths for immediate sub directories ## - exclude : Array of files/folders to be excluded (names only, not path) ## - no_exception : Flag if on, will not throw any exception, but will return undef in case it fails anywhere ## @return Arrayref of absolute path to files, folders copied/created (undef for any problem) my ($source_dir, $dest_dir, $params) = @_; $source_dir =~ s/\/$//; $source_dir =~ s/\/+/\//; $dest_dir =~ s/\/$//; $dest_dir =~ s/\/+/\//; $params ||= {}; my $no_exception = delete $params->{'no_exception'}; my $contents = []; my %exclude = map { $_ =~ s/\/$//r => 1 } @{$params->{'exclude'} || []}; my $dir_contents = list_dir_contents($source_dir, {'no_exception' => $no_exception}) or return undef; if (!-d $dest_dir) { if ($params->{'create_path'}) { push @$contents, @{ create_path($dest_dir) }; } else { throw exception('FileSystemException', "Destination directory $dest_dir does not exist.") unless $no_exception; return undef; } } foreach my $content (@$dir_contents) { next if $content =~ /^\.+/ || $exclude{$content}; try { if (-d "$source_dir/$content") { if ($params->{'recursive'}) { push @$contents, @{ create_path("$dest_dir/$content") }; push @$contents, @{ copy_dir_contents("$source_dir/$content", "$dest_dir/$content", $params) } if $params->{'recursive'} ne 'include_dirs'; } } else { throw exception('FileSystemException', "An error occoured while copying $source_dir/$content: $!") unless copy("$source_dir/$content", "$dest_dir/$content"); push @$contents, "$dest_dir/$content"; } } catch { # if an error occurred somewhere, rollback and throw the same exception -d $_ ? rmdir $_ : unlink $_ for reverse @$contents; # reverse to make sure parent directories are removed in the end throw $_ unless $no_exception; $contents = undef; }; last unless $contents; } return $contents; } sub copy_files { ## Copies files according to the given hash map ## @param Hashref with keys as sources and values as corresponding destinations ## @param Hashref with a key 'no_exception', which if set true will not throw an exception if there's any problem copying. ## @return Arrayref of files copied if copy is successful or undef if it fail anywhere (only if 'no_exception' key is set true) my ($files, $params) = @_; $params ||= {}; my @copied; for (keys %$files) { push @copied, $files->{$_}; unless (copy($_, $files->{$_})) { unlink @copied; #rollback throw exception('FileSystemException', "An error occoured while copying $_: $!") unless $params->{'no_exception'}; return; } } return \@copied; } sub list_dir_contents { ## Returns all the files and dir in a directory ## @param Dir path ## @param Hashref with keys ## - hidden : if on, will return hidden files too (off by default) ## - no_exception : if set true will not throw an exception if there's any problem ## - recursive: flag if on, will get all the files recursively going through each sub folder ## - absolute_path: flag if on, will return the absolute path for the files/folders (off by default) ## @return Arrayref of files/dir, undef if dir not existing my ($dir, $params) = @_; $params ||= {}; my $ls = []; my $dh = DirHandle->new($dir); my $abs = delete $params->{'absolute_path'}; # delete param so it doesn't get passed to recursive calls if (!$dh) { throw exception('FileSystemException', "An error occoured while reading the directory $dir: $!") unless $params->{'no_exception'}; return undef; } while (my $content = $dh->read) { next if !$params->{'hidden'} && $content =~ /^\.+/; push @$ls, $content; if ($params->{'recursive'} && -d "$dir/$content" && $content !~ /^\.+$/) { push @$ls, map {"$content/$_"} @{list_dir_contents("$dir/$content", $params)}; } } $dh->close; @$ls = map "$dir/$_", @$ls if $abs; return $ls; } sub displayable_error { ## @private my $error = shift; return join "\n", map { join ': ', 'For ', keys %$_, values %$_ } @$error; } 1;
38.172727
186
0.657657
ed0a3213dea196cd62f31f2fe6bde9870ebd31ac
2,391
t
Perl
t/parse_files_compression_status.t
Clinical-Genomics/MIP
db2e89fec2674f5c12dbf6ec89eba181433fc742
[ "MIT" ]
22
2017-09-04T07:50:54.000Z
2022-01-01T20:41:45.000Z
t/parse_files_compression_status.t
Clinical-Genomics/MIP
db2e89fec2674f5c12dbf6ec89eba181433fc742
[ "MIT" ]
834
2017-09-05T07:18:38.000Z
2022-03-31T15:27:49.000Z
t/parse_files_compression_status.t
Clinical-Genomics/MIP
db2e89fec2674f5c12dbf6ec89eba181433fc742
[ "MIT" ]
11
2017-09-12T10:53:30.000Z
2021-11-30T01:40:49.000Z
#!/usr/bin/env perl use 5.026; use Carp; use charnames qw{ :full :short }; use English qw{ -no_match_vars }; use File::Basename qw{ dirname }; use File::Spec::Functions qw{ catdir }; use FindBin qw{ $Bin }; use open qw{ :encoding(UTF-8) :std }; use Params::Check qw{ allow check last_error }; use Test::More; use utf8; use warnings qw{ FATAL utf8 }; ## CPANM use autodie qw { :all }; use Modern::Perl qw{ 2018 }; ## MIPs lib/ use lib catdir( dirname($Bin), q{lib} ); use MIP::Constants qw{ $COMMA $SPACE }; BEGIN { use MIP::Test::Fixtures qw{ test_import }; ### Check all internal dependency modules and imports ## Modules with import my %perl_module = ( q{MIP::File_info} => [qw{ parse_files_compression_status }], ); test_import( { perl_module_href => \%perl_module, } ); } use MIP::File_info qw{ parse_files_compression_status }; diag( q{Test parse_files_compression_status from File_info.pm} . $COMMA . $SPACE . q{Perl} . $SPACE . $PERL_VERSION . $SPACE . $EXECUTABLE_NAME ); ## Given uncompressed file my $not_compressed_file = q{a_file.fastq}; my $sample_id = q{a_sample_id}; my %file_info = ( $sample_id => { mip_infiles => [ $not_compressed_file, ], $not_compressed_file => { is_file_compressed => 0, } }, ); parse_files_compression_status( { file_info_href => \%file_info, sample_id => $sample_id, } ); ## Then return false is( $file_info{is_files_compressed}{$sample_id}, 0, q{All files were not compressed} ); ## Given compressed file my $compressed_file = q{a_file.fastq.gz}; push @{ $file_info{$sample_id}{mip_infiles} }, $compressed_file; $file_info{$sample_id}{$compressed_file}{is_file_compressed} = 1; parse_files_compression_status( { file_info_href => \%file_info, sample_id => $sample_id, } ); ## Then return false is( $file_info{is_files_compressed}{$sample_id}, 0, q{Not all files were compressed} ); ## Given only a compressed file $file_info{$sample_id}{mip_infiles} = [$compressed_file]; delete $file_info{$sample_id}{$not_compressed_file}; parse_files_compression_status( { file_info_href => \%file_info, sample_id => $sample_id, } ); ## Then return true ok( $file_info{is_files_compressed}{$sample_id}, q{All files were compressed} ); done_testing();
24.649485
87
0.65872
73e7da9a61b22ad158e8c4a640d2833ede2a86e0
7,430
pm
Perl
modules/Bio/EnsEMBL/Production/Pipeline/PipeConfig/FactoryTest_conf.pm
ens-bwalts/ensembl-production
ce2ccecbf5d2a56528e3f77e9a4e930a3d0129db
[ "Apache-2.0" ]
9
2016-06-24T16:58:52.000Z
2021-01-27T15:38:00.000Z
modules/Bio/EnsEMBL/Production/Pipeline/PipeConfig/FactoryTest_conf.pm
ens-bwalts/ensembl-production
ce2ccecbf5d2a56528e3f77e9a4e930a3d0129db
[ "Apache-2.0" ]
187
2015-01-09T10:27:54.000Z
2022-03-08T11:28:24.000Z
modules/Bio/EnsEMBL/Production/Pipeline/PipeConfig/FactoryTest_conf.pm
ens-bwalts/ensembl-production
ce2ccecbf5d2a56528e3f77e9a4e930a3d0129db
[ "Apache-2.0" ]
60
2015-01-22T16:08:35.000Z
2022-03-04T17:31:32.000Z
=head1 LICENSE Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2020] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =cut package Bio::EnsEMBL::Production::Pipeline::PipeConfig::FactoryTest_conf; use strict; use warnings; use base ('Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf'); use Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf; use Bio::EnsEMBL::Hive::Version 2.4; sub default_options { my ($self) = @_; return { %{$self->SUPER::default_options}, pipeline_name => 'factory_test', species => [], antispecies => [], taxons => [], antitaxons => [], division => [], run_all => 0, meta_filters => {}, dbname => [], group => 'core', }; } # Force an automatic loading of the registry in all workers. sub beekeeper_extra_cmdline_options { my ($self) = @_; my $options = join(' ', $self->SUPER::beekeeper_extra_cmdline_options, "-reg_conf ".$self->o('registry'), ); return $options; } # Ensures that species output parameter gets propagated implicitly. sub hive_meta_table { my ($self) = @_; return { %{$self->SUPER::hive_meta_table}, 'hive_use_param_stack' => 1, }; } sub pipeline_analyses { my $self = shift @_; return [ { -logic_name => 'DbFactory', -module => 'Bio::EnsEMBL::Production::Pipeline::Common::DbFactory', -max_retry_count => 0, -input_ids => [ {} ], -parameters => { species => $self->o('species'), antispecies => $self->o('antispecies'), taxons => $self->o('taxons'), antitaxons => $self->o('antitaxons'), division => $self->o('division'), run_all => $self->o('run_all'), meta_filters => $self->o('meta_filters'), dbname => $self->o('dbname'), group => $self->o('group'), }, -flow_into => { '2->A' => ['DbFlow'], 'A->2' => ['DbAwareSpeciesFactory'], '5' => ['ComparaFlow'], }, -rc_name => 'normal', }, { -logic_name => 'SpeciesFactory', -module => 'Bio::EnsEMBL::Production::Pipeline::Common::SpeciesFactory', -max_retry_count => 0, -input_ids => [ {} ], -parameters => { species => $self->o('species'), antispecies => $self->o('antispecies'), taxons => $self->o('taxons'), antitaxons => $self->o('antitaxons'), division => $self->o('division'), run_all => $self->o('run_all'), meta_filters => $self->o('meta_filters'), dbname => $self->o('dbname'), group => $self->o('group'), }, -flow_into => { '2->A' => ['CoreFlow'], '3->A' => ['ChromosomeFlow'], '4->A' => ['VariationFlow'], '5->A' => ['ComparaFlow'], '6->A' => ['RegulationFlow'], '7->A' => ['OtherfeaturesFlow'], 'A->1' => ['SingleFlow'], }, -rc_name => 'normal', }, { -logic_name => 'DbFlow', -module => 'Bio::EnsEMBL::Hive::RunnableDB::Dummy', -analysis_capacity => 10, -batch_size => 100, -max_retry_count => 0, -rc_name => 'normal', }, { -logic_name => 'DbAwareSpeciesFactory', -module => 'Bio::EnsEMBL::Production::Pipeline::Common::DbAwareSpeciesFactory', -analysis_capacity => 10, -batch_size => 100, -max_retry_count => 0, -parameters => {}, -rc_name => 'normal', -flow_into => { '2->A' => ['CoreFlow'], '3->A' => ['ChromosomeFlow'], '4->A' => ['VariationFlow'], '6->A' => ['RegulationFlow'], '7->A' => ['OtherfeaturesFlow'], 'A->1' => ['SingleFlow'], }, }, { -logic_name => 'CoreFlow', -module => 'Bio::EnsEMBL::Hive::RunnableDB::Dummy', -analysis_capacity => 10, -batch_size => 100, -max_retry_count => 0, -rc_name => 'normal', }, { -logic_name => 'SingleFlow', -module => 'Bio::EnsEMBL::Hive::RunnableDB::Dummy', -analysis_capacity => 10, -batch_size => 100, -max_retry_count => 0, -rc_name => 'normal', }, { -logic_name => 'ChromosomeFlow', -module => 'Bio::EnsEMBL::Hive::RunnableDB::Dummy', -analysis_capacity => 10, -batch_size => 100, -max_retry_count => 0, -rc_name => 'normal', }, { -logic_name => 'VariationFlow', -module => 'Bio::EnsEMBL::Hive::RunnableDB::Dummy', -analysis_capacity => 10, -batch_size => 100, -max_retry_count => 0, -rc_name => 'normal', }, { -logic_name => 'ComparaFlow', -module => 'Bio::EnsEMBL::Hive::RunnableDB::Dummy', -analysis_capacity => 10, -batch_size => 100, -max_retry_count => 0, -rc_name => 'normal', }, { -logic_name => 'RegulationFlow', -module => 'Bio::EnsEMBL::Hive::RunnableDB::Dummy', -analysis_capacity => 10, -batch_size => 100, -max_retry_count => 0, -rc_name => 'normal', }, { -logic_name => 'OtherfeaturesFlow', -module => 'Bio::EnsEMBL::Hive::RunnableDB::Dummy', -analysis_capacity => 10, -batch_size => 100, -max_retry_count => 0, -rc_name => 'normal', }, ]; } sub resource_classes { my ($self) = @_; return { 'normal' => {'LSF' => '-q production-rh74 -M 1000 -R "rusage[mem=1000]"'}, } } 1;
32.304348
100
0.448048
73d4a288ba6fce6038dbbeeaf56305c625d3acc0
1,356
t
Perl
tools/api/OperationTypes.t
snappautomotive/firmware-packages_modules_neuralnetworks
fcff7da3fb18aabf44e2d1c62beef76128a4e03b
[ "Apache-2.0" ]
null
null
null
tools/api/OperationTypes.t
snappautomotive/firmware-packages_modules_neuralnetworks
fcff7da3fb18aabf44e2d1c62beef76128a4e03b
[ "Apache-2.0" ]
null
null
null
tools/api/OperationTypes.t
snappautomotive/firmware-packages_modules_neuralnetworks
fcff7da3fb18aabf44e2d1c62beef76128a4e03b
[ "Apache-2.0" ]
null
null
null
%% template file for generating OperationTypes.h. %% see README.md. /* * Copyright (C) 2020 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef ANDROID_FRAMEWORKS_ML_NN_COMMON_NNAPI_OPERATION_TYPES_H #define ANDROID_FRAMEWORKS_ML_NN_COMMON_NNAPI_OPERATION_TYPES_H namespace android::nn { %insert Operation_1.0_Comment enum class OperationType { %insert Operation_1.0 %insert Operation_1.1 %insert Operation_1.2 %insert Operation_1.3 /** * DEPRECATED. Since HAL version 1.2, extensions are the preferred * alternative to OEM operation and data types. * * This operation is OEM specific. It should only be used for OEM * applications. */ OEM_OPERATION = 10000, }; } // namespace android::nn #endif // ANDROID_FRAMEWORKS_ML_NN_COMMON_NNAPI_OPERATION_TYPES_H
28.851064
75
0.748525
73dcb7214706c88d79ec6336969f1acaa6e56f36
801
t
Perl
t/client_store2/02_mech.t
tokuhirom/HTTP-Session2
cb4b3290fdfd7875bf2c4892d4eadf8361429592
[ "Artistic-1.0" ]
3
2015-11-09T01:54:58.000Z
2018-03-09T22:22:22.000Z
t/client_store2/02_mech.t
tokuhirom/HTTP-Session2
cb4b3290fdfd7875bf2c4892d4eadf8361429592
[ "Artistic-1.0" ]
null
null
null
t/client_store2/02_mech.t
tokuhirom/HTTP-Session2
cb4b3290fdfd7875bf2c4892d4eadf8361429592
[ "Artistic-1.0" ]
2
2016-04-06T10:40:48.000Z
2020-01-30T02:05:43.000Z
use strict; use warnings; use Test::More; use HTTP::Session2::ClientStore2; use Crypt::CBC; use Crypt::Rijndael; use Test::WWW::Mechanize::PSGI; my $cipher = Crypt::CBC->new( { key => 'abcdefghijklmnop', cipher => 'Rijndael', } ); my $app = sub { my $env = shift; my $session = HTTP::Session2::ClientStore2->new( env => $env, secret => 'very long secret string', cipher => $cipher, ); my $cnt = $session->get('cnt') || 0; $cnt++; $session->set('cnt' => $cnt); my $res = [200, [], [$cnt]]; $session->finalize_psgi_response($res); return $res; }; my $mech = Test::WWW::Mechanize::PSGI->new(app => $app); is $mech->get('/')->content, 1; is $mech->get('/')->content, 2; is $mech->get('/')->content, 3; done_testing;
22.885714
56
0.556804
ed33bcbfa6c63588d0ba870a335033f39deec91c
10,206
pm
Perl
ARTe/work/tools/cygwin/lib/perl5/5.14/XSLoader.pm
melvin-mancini/Multitasking-RealTime-Arduino-System
6999beaf28f69b4c4a8f8badcc60f66e6e118477
[ "MIT" ]
5
2018-12-18T20:19:43.000Z
2022-02-21T21:53:09.000Z
ARTe/work/tools/cygwin/lib/perl5/5.14/XSLoader.pm
melvin-mancini/Multitasking-RealTime-Arduino-System
6999beaf28f69b4c4a8f8badcc60f66e6e118477
[ "MIT" ]
null
null
null
ARTe/work/tools/cygwin/lib/perl5/5.14/XSLoader.pm
melvin-mancini/Multitasking-RealTime-Arduino-System
6999beaf28f69b4c4a8f8badcc60f66e6e118477
[ "MIT" ]
1
2022-02-21T21:53:18.000Z
2022-02-21T21:53:18.000Z
# Generated from XSLoader.pm.PL (resolved %Config::Config value) package XSLoader; $VERSION = "0.13"; #use strict; # enable debug/trace messages from DynaLoader perl code # $dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug; package DynaLoader; # No prizes for guessing why we don't say 'bootstrap DynaLoader;' here. # NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) && !defined(&dl_error); package XSLoader; sub load { package DynaLoader; my ($module, $modlibname) = caller(); if (@_) { $module = $_[0]; } else { $_[0] = $module; } # work with static linking too my $boots = "$module\::bootstrap"; goto &$boots if defined &$boots; goto \&XSLoader::bootstrap_inherit unless $module and defined &dl_load_file; my @modparts = split(/::/,$module); my $modfname = $modparts[-1]; my $modpname = join('/',@modparts); my $c = @modparts; $modlibname =~ s,[\\/][^\\/]+$,, while $c--; # Q&D basename my $file = "$modlibname/auto/$modpname/$modfname.dll"; # print STDERR "XSLoader::load for $module ($file)\n" if $dl_debug; my $bs = $file; $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library if (-s $bs) { # only read file if it's not empty # print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug; eval { do $bs; }; warn "$bs: $@\n" if $@; } goto \&XSLoader::bootstrap_inherit if not -f $file or -s $bs; my $bootname = "boot_$module"; $bootname =~ s/\W/_/g; @DynaLoader::dl_require_symbols = ($bootname); my $boot_symbol_ref; # Many dynamic extension loading problems will appear to come from # this section of code: XYZ failed at line 123 of DynaLoader.pm. # Often these errors are actually occurring in the initialisation # C code of the extension XS file. Perl reports the error as being # in this perl code simply because this was the last perl code # it executed. my $libref = dl_load_file($file, 0) or do { require Carp; Carp::croak("Can't load '$file' for module $module: " . dl_error()); }; push(@DynaLoader::dl_librefs,$libref); # record loaded object my @unresolved = dl_undef_symbols(); if (@unresolved) { require Carp; Carp::carp("Undefined symbols present after loading $file: @unresolved\n"); } $boot_symbol_ref = dl_find_symbol($libref, $bootname) or do { require Carp; Carp::croak("Can't find '$bootname' symbol in $file\n"); }; push(@DynaLoader::dl_modules, $module); # record loaded module boot: my $xs = dl_install_xsub($boots, $boot_symbol_ref, $file); # See comment block above push(@DynaLoader::dl_shared_objects, $file); # record files loaded return &$xs(@_); } sub bootstrap_inherit { require DynaLoader; goto \&DynaLoader::bootstrap_inherit; } 1; __END__ =head1 NAME XSLoader - Dynamically load C libraries into Perl code =head1 VERSION Version 0.13 =head1 SYNOPSIS package YourPackage; require XSLoader; XSLoader::load(); =head1 DESCRIPTION This module defines a standard I<simplified> interface to the dynamic linking mechanisms available on many platforms. Its primary purpose is to implement cheap automatic dynamic loading of Perl modules. For a more complicated interface, see L<DynaLoader>. Many (most) features of C<DynaLoader> are not implemented in C<XSLoader>, like for example the C<dl_load_flags>, not honored by C<XSLoader>. =head2 Migration from C<DynaLoader> A typical module using L<DynaLoader|DynaLoader> starts like this: package YourPackage; require DynaLoader; our @ISA = qw( OnePackage OtherPackage DynaLoader ); our $VERSION = '0.01'; bootstrap YourPackage $VERSION; Change this to package YourPackage; use XSLoader; our @ISA = qw( OnePackage OtherPackage ); our $VERSION = '0.01'; XSLoader::load 'YourPackage', $VERSION; In other words: replace C<require DynaLoader> by C<use XSLoader>, remove C<DynaLoader> from C<@ISA>, change C<bootstrap> by C<XSLoader::load>. Do not forget to quote the name of your package on the C<XSLoader::load> line, and add comma (C<,>) before the arguments (C<$VERSION> above). Of course, if C<@ISA> contained only C<DynaLoader>, there is no need to have the C<@ISA> assignment at all; moreover, if instead of C<our> one uses the more backward-compatible use vars qw($VERSION @ISA); one can remove this reference to C<@ISA> together with the C<@ISA> assignment. If no C<$VERSION> was specified on the C<bootstrap> line, the last line becomes XSLoader::load 'YourPackage'; If the call to C<load> is from the YourPackage, then that can be further simplified to XSLoader::load(); as C<load> will use C<caller> to determine the package. =head2 Backward compatible boilerplate If you want to have your cake and eat it too, you need a more complicated boilerplate. package YourPackage; use vars qw($VERSION @ISA); @ISA = qw( OnePackage OtherPackage ); $VERSION = '0.01'; eval { require XSLoader; XSLoader::load('YourPackage', $VERSION); 1; } or do { require DynaLoader; push @ISA, 'DynaLoader'; bootstrap YourPackage $VERSION; }; The parentheses about C<XSLoader::load()> arguments are needed since we replaced C<use XSLoader> by C<require>, so the compiler does not know that a function C<XSLoader::load()> is present. This boilerplate uses the low-overhead C<XSLoader> if present; if used with an antic Perl which has no C<XSLoader>, it falls back to using C<DynaLoader>. =head1 Order of initialization: early load() I<Skip this section if the XSUB functions are supposed to be called from other modules only; read it only if you call your XSUBs from the code in your module, or have a C<BOOT:> section in your XS file (see L<perlxs/"The BOOT: Keyword">). What is described here is equally applicable to the L<DynaLoader|DynaLoader> interface.> A sufficiently complicated module using XS would have both Perl code (defined in F<YourPackage.pm>) and XS code (defined in F<YourPackage.xs>). If this Perl code makes calls into this XS code, and/or this XS code makes calls to the Perl code, one should be careful with the order of initialization. The call to C<XSLoader::load()> (or C<bootstrap()>) calls the module's bootstrap code. For modules build by F<xsubpp> (nearly all modules) this has three side effects: =over =item * A sanity check is done to ensure that the versions of the F<.pm> and the (compiled) F<.xs> parts are compatible. If C<$VERSION> was specified, this is used for the check. If not specified, it defaults to C<$XS_VERSION // $VERSION> (in the module's namespace) =item * the XSUBs are made accessible from Perl =item * if a C<BOOT:> section was present in the F<.xs> file, the code there is called. =back Consequently, if the code in the F<.pm> file makes calls to these XSUBs, it is convenient to have XSUBs installed before the Perl code is defined; for example, this makes prototypes for XSUBs visible to this Perl code. Alternatively, if the C<BOOT:> section makes calls to Perl functions (or uses Perl variables) defined in the F<.pm> file, they must be defined prior to the call to C<XSLoader::load()> (or C<bootstrap()>). The first situation being much more frequent, it makes sense to rewrite the boilerplate as package YourPackage; use XSLoader; use vars qw($VERSION @ISA); BEGIN { @ISA = qw( OnePackage OtherPackage ); $VERSION = '0.01'; # Put Perl code used in the BOOT: section here XSLoader::load 'YourPackage', $VERSION; } # Put Perl code making calls into XSUBs here =head2 The most hairy case If the interdependence of your C<BOOT:> section and Perl code is more complicated than this (e.g., the C<BOOT:> section makes calls to Perl functions which make calls to XSUBs with prototypes), get rid of the C<BOOT:> section altogether. Replace it with a function C<onBOOT()>, and call it like this: package YourPackage; use XSLoader; use vars qw($VERSION @ISA); BEGIN { @ISA = qw( OnePackage OtherPackage ); $VERSION = '0.01'; XSLoader::load 'YourPackage', $VERSION; } # Put Perl code used in onBOOT() function here; calls to XSUBs are # prototype-checked. onBOOT; # Put Perl initialization code assuming that XS is initialized here =head1 DIAGNOSTICS =over =item C<Can't find '%s' symbol in %s> B<(F)> The bootstrap symbol could not be found in the extension module. =item C<Can't load '%s' for module %s: %s> B<(F)> The loading or initialisation of the extension module failed. The detailed error follows. =item C<Undefined symbols present after loading %s: %s> B<(W)> As the message says, some symbols stay undefined although the extension module was correctly loaded and initialised. The list of undefined symbols follows. =back =head1 LIMITATIONS To reduce the overhead as much as possible, only one possible location is checked to find the extension DLL (this location is where C<make install> would put the DLL). If not found, the search for the DLL is transparently delegated to C<DynaLoader>, which looks for the DLL along the C<@INC> list. In particular, this is applicable to the structure of C<@INC> used for testing not-yet-installed extensions. This means that running uninstalled extensions may have much more overhead than running the same extensions after C<make install>. =head1 BUGS Please report any bugs or feature requests via the perlbug(1) utility. =head1 SEE ALSO L<DynaLoader> =head1 AUTHORS Ilya Zakharevich originally extracted C<XSLoader> from C<DynaLoader>. CPAN version is currently maintained by SE<eacute>bastien Aperghis-Tramoni E<lt>sebastien@aperghis.netE<gt>. Previous maintainer was Michael G Schwern <schwern@pobox.com>. =head1 COPYRIGHT & LICENSE Copyright (C) 1990-2007 by Larry Wall and others. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut
28.912181
83
0.700666
ed15de3f76ca0b77eafe5b78d8a0cbabf28cde35
29,347
pl
Perl
bin/dx_provision_vdb.pl
Jatinder-Luthra/dxtoolkit
81108f44d58b78fde4e187e21d21fdc7167603d8
[ "Apache-2.0" ]
null
null
null
bin/dx_provision_vdb.pl
Jatinder-Luthra/dxtoolkit
81108f44d58b78fde4e187e21d21fdc7167603d8
[ "Apache-2.0" ]
null
null
null
bin/dx_provision_vdb.pl
Jatinder-Luthra/dxtoolkit
81108f44d58b78fde4e187e21d21fdc7167603d8
[ "Apache-2.0" ]
null
null
null
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # Copyright (c) 2015,2016 by Delphix. All rights reserved. # # Program Name : dx_provision_vdb.pl # Description : Provision a VDB # # Author : Marcin Przepiorowski # Created : 13 Apr 2015 (v2.0.0) # use strict; use lib '../lib'; use warnings; use JSON; use Getopt::Long qw(:config no_ignore_case no_auto_abbrev); #avoids conflicts with ex host and help use File::Basename; use Pod::Usage; use FindBin; use Data::Dumper; use Try::Tiny; use open qw(:std :utf8); use Encode qw(decode_utf8); use Encode qw(encode_utf8); my $abspath = $FindBin::Bin; use lib '../lib'; use Databases; use Engine; use Jobs_obj; use Group_obj; use Toolkit_helpers; use FileMap; use Policy_obj; use MaskingJob_obj; my $version = $Toolkit_helpers::version; my $archivelog = 'yes'; GetOptions( 'help|?' => \(my $help), 'd|engine=s' => \(my $dx_host), 'sourcename=s' => \(my $sourcename), 'empty' => \(my $empty), 'targetname=s' => \(my $targetname), 'dbname|path=s' => \(my $dbname), 'instname=s' => \(my $instname), 'uniqname=s' => \(my $uniqname), 'environment=s' => \(my $environment), 'envUser=s' => \(my $envUser), 'type=s' => \(my $type), 'group=s' => \(my $group), 'creategroup' => \(my $creategroup), 'listeners=s' => \(my $listeners), 'srcgroup=s' => \(my $srcgroup), 'envinst=s' => \(my $envinst), 'cdb=s' => \(my $cdb), 'cdbuser=s' => \(my $cdbuser), 'cdbpass=s' => \(my $cdbpass), 'template=s' => \(my $template), 'mapfile=s' =>\(my $map_file), 'port=n' =>\(my $port), 'postrefresh=s@' =>\(my $postrefresh), 'rac_instance=s@' => \(my $rac_instance), 'additionalMount=s@' => \(my $additionalMount), 'configureclone=s@' => \(my $configureclone), 'prerefresh=s@' =>\(my $prerefresh), 'prerewind=s@' =>\(my $prerewind), 'postrewind=s@' =>\(my $postrewind), 'presnapshot=s@' =>\(my $presnapshot), 'postsnapshot=s@' =>\(my $postsnapshot), 'prestart=s@' =>\(my $prestart), 'poststart=s@' =>\(my $poststart), 'prestop=s@' =>\(my $prestop), 'poststop=s@' =>\(my $poststop), 'hooks=s' => \(my $hooks), 'prescript=s' => \(my $prescript), 'postscript=s' => \(my $postscript), 'timestamp=s' => \(my $timestamp), 'location=s' => \(my $changenum), 'mntpoint=s' => \(my $mntpoint), 'redoGroup=s' => \(my $redoGroup), 'redoSize=s' => \(my $redoSize), 'archivelog=s' => \($archivelog), 'autostart=s' => \(my $autostart), 'truncateLogOnCheckpoint' => \(my $truncateLogOnCheckpoint), 'recoveryModel=s' => \(my $recoveryModel), 'snapshotpolicy=s' => \(my $snapshotpolicy), 'retentionpolicy=s' => \(my $retentionpolicy), 'maskingjob=s' => \(my $maskingjob), 'maskedbyscript' => \(my $maskedbyscript), 'noopen' => \(my $noopen), 'vcdbname=s' => \(my $vcdbname), 'vcdbgroup=s' => \(my $vcdbgroup), 'vcdbdbname=s' => \(my $vcdbdbname), 'vcdbuniqname=s' => \(my $vcdbuniqname), 'vcdbinstname=s' => \(my $vcdbinstname), 'vcdbtemplate=s' => \(my $vcdbtemplate), 'dever=s' => \(my $dever), 'debug:n' => \(my $debug), 'all' => (\my $all), 'version' => \(my $print_version), 'configfile|c=s' => \(my $config_file) ) or pod2usage(-verbose => 1, -input=>\*DATA); pod2usage(-verbose => 2, -input=>\*DATA) && exit if $help; die "$version\n" if $print_version; my $engine_obj = new Engine ($dever, $debug); $engine_obj->load_config($config_file); if (defined($all) && defined($dx_host)) { print "Option all (-all) and engine (-d|engine) are mutually exclusive \n"; pod2usage(-verbose => 1, -input=>\*DATA); exit (1); } if (( $type eq 'vFiles' ) && (!defined($envinst)) ) { $envinst = 'Unstructured Files'; } if ( ! ( defined($type) && defined($targetname) && defined($dbname) && defined($environment) && defined($group) && defined($envinst) ) ) { print "Options -type, -targetname, -dbname, -environment, -group and -envinst are required. \n"; pod2usage(-verbose => 1, -input=>\*DATA); exit (1); } if (! ( defined($sourcename) || defined($empty) ) ) { print "Options -sourcename or -empty are required. \n"; pod2usage(-verbose => 1, -input=>\*DATA); exit (1); } if ( defined($archivelog) && (! ( ( $archivelog eq 'yes') || ( $archivelog eq 'no') ) ) ) { print "Option -archivelog has invalid parameter - $archivelog \n"; pod2usage(-verbose => 1, -input=>\*DATA); exit (1); } if ( ! ( ( $type eq 'oracle') || ( $type eq 'mssql') || ( $type eq 'sybase') || ( $type eq 'mysql') ||( $type eq 'db2') || ( $type eq 'vFiles') ) ) { print "Option -type has invalid parameter - $type \n"; pod2usage(-verbose => 1, -input=>\*DATA); exit (1); } if (defined($timestamp) && defined($changenum)) { print "Parameter timestamp and location are mutually exclusive \n"; pod2usage(-verbose => 1, -input=>\*DATA); exit (1); } if (! defined($timestamp) && (! defined ($changenum) ) ) { $timestamp = 'LATEST_SNAPSHOT'; } if (defined($vcdbname) && (!( defined($vcdbdbname) ) ) ) { print "For vCDB you need to specify at least vcdbname\n"; pod2usage(-verbose => 1, -input=>\*DATA); exit (1); } if (defined($maskedbyscript) && defined($maskingjob)) { print "Flag maskedbyscript and argument maskingjob are mutually exclusive \n"; pod2usage(-verbose => 1, -input=>\*DATA); exit (1); } # this array will have all engines to go through (if -d is specified it will be only one engine) my $engine_list = Toolkit_helpers::get_engine_list($all, $dx_host, $engine_obj); my $ret = 0; $targetname = decode_utf8($targetname); for my $engine ( sort (@{$engine_list}) ) { # main loop for all work if ($engine_obj->dlpx_connect($engine)) { print "Can't connect to Dephix Engine $dx_host\n\n"; $ret = $ret + 1; next; }; my $db; my $jobno; my $databases = new Databases($engine_obj,$debug); my $groups = new Group_obj($engine_obj, $debug); # load objects for current engine my $policy = new Policy_obj( $engine_obj, $debug); if (! defined($groups->getGroupByName($group))) { if (defined($creategroup)) { print "Creating not existing group - $group \n"; my $jobno = $groups->createGroup($group); my $actionret = Toolkit_helpers::waitForAction($engine_obj, $jobno, "Action completed with success", "There were problems with group creation"); if ($actionret > 0) { $ret = $ret + 1; print "There was a problem with group creation. Skipping source actions on engine\n"; next; } } else { print "Group $group for target database doesn't exist.\n Skipping source actions on engine.\n"; $ret = $ret + 1; next; } } my $source; if (defined($sourcename)) { my $source_ref = Toolkit_helpers::get_dblist_from_filter(undef, $srcgroup, undef, $sourcename, $databases, $groups, undef, undef, undef, undef, undef, undef, $debug); if (!defined($source_ref)) { print "Source database not found.\n"; $ret = $ret + 1; next; } if (scalar(@{$source_ref})>1) { print "Source database not unique defined.\n"; $ret = $ret + 1; next; } elsif (scalar(@{$source_ref}) eq 0) { print "Source database not found.\n"; $ret = $ret + 1; next; } $source = ($databases->getDB($source_ref->[0])); } # create a new DB object if ( $type eq 'oracle' ) { $db = new OracleVDB_obj($engine_obj,$debug); } elsif ($type eq 'mssql') { $db = new MSSQLVDB_obj($engine_obj,$debug); } elsif ($type eq 'sybase') { $db = new SybaseVDB_obj($engine_obj,$debug); } elsif ($type eq 'mysql') { $db = new MySQLVDB_obj($engine_obj,$debug); } elsif ($type eq 'db2') { $db = new DB2VDB_obj($engine_obj,$debug); } elsif ($type eq 'vFiles') { $db = new AppDataVDB_obj($engine_obj,$debug); } # common database code if (defined($source)) { if ( $db->setSource($source) ) { print "Problem with setting source $source . VDB won't be created.\n"; $ret = $ret + 1; next; } if ( defined ($timestamp) ) { if ( $db->setTimestamp($timestamp) ) { print "Problem with setting timestamp $timestamp. VDB won't be created.\n"; $ret = $ret + 1; next; } } elsif ( defined ($changenum) ) { if ($db->setChangeNum($changenum)) { print "Error with location format. VDB won't be created.\n"; $ret = $ret + 1; next; } } } elsif (($type eq 'vFiles') && (defined($empty))) { $db->setEmpty(); } else { print "There is no source configured\n"; $ret = $ret + 1; last; } if ( $db->setEnvironment($environment,$envUser) ) { print "Environment $environment or user $envUser not found. VDB won't be created\n"; $ret = $ret + 1; next; } my $oneline; my $op_templates; if ( defined($postrefresh) ) { if ($db->setPostRefreshHook($postrefresh)) { $ret = $ret + 1; last; } } if ( defined($configureclone) ) { if ($db->setconfigureCloneHook($configureclone)) { $ret = $ret + 1; last; } } if ( defined($prerefresh) ) { if ($db->setPreRefreshHook($prerefresh)) { $ret = $ret + 1; last; } } if ( defined($prerewind) ) { if ($db->setPreRewindHook($prerewind)) { $ret = $ret + 1; last; } } if ( defined($postrewind) ) { if ($db->setPostRewindHook($postrewind)) { $ret = $ret + 1; last; } } if ( defined($presnapshot) ) { if ($db->setPreSnapshotHook($presnapshot)) { $ret = $ret + 1; last; } } if ( defined($postsnapshot) ) { if ($db->setPostSnapshotHook($postsnapshot)) { $ret = $ret + 1; last; } } if ( defined($prestart) ) { if ($db->setPreStartHook($prestart)) { $ret = $ret + 1; last; } } if ( defined($poststart) ) { if ($db->setPostStartHook($poststart)) { $ret = $ret + 1; last; } } if ( defined($prestop) ) { if ($db->setPreStopHook($prestop)) { $ret = $ret + 1; last; } } if ( defined($poststop) ) { if ($db->setPostStopHook($poststop)) { $ret = $ret + 1; last; } } if (defined($hooks)) { my $FD; if (!open ($FD, '<', "$hooks")) { print "Can't open a file with hooks: $hooks\n"; $ret = $ret + 1; last; } local $/ = undef; my $json = JSON->new(); my $loadedHooks; try { $loadedHooks = $json->decode(<$FD>); } catch { print 'Error parsing hooks file. Please check it. ' . $_ . " \n" ; close $FD; $ret = $ret + 1; last; }; close $FD; if ($loadedHooks->{type} ne 'VirtualSourceOperations') { print '$hooks is not a export file from dx_get_dbhooks\n' ; $ret = $ret + 1; last; } $db->setHooksfromJSON($loadedHooks); } #checking policy my $snapshotpolicy_ref; my $retentionpolicy_ref; if (defined($snapshotpolicy)) { $snapshotpolicy_ref = $policy->getPolicyByName($snapshotpolicy); if ( !defined($snapshotpolicy_ref) ) { print "Snapshot policy $snapshotpolicy not found. Skipping provisioning on engine $engine\n"; $ret = $ret + 1; next; } if ( $policy->getType($snapshotpolicy_ref) ne 'SnapshotPolicy' ) { print "Snapshot policy $snapshotpolicy is a wrong type. Skipping provisioning on engine $engine\n"; $ret = $ret + 1; next; } } if (defined($retentionpolicy)) { $retentionpolicy_ref = $policy->getPolicyByName($retentionpolicy); if (defined($retentionpolicy) && (!defined($retentionpolicy_ref)) ) { print "$retentionpolicy policy $retentionpolicy not found. Skipping provisioning on engine $engine\n"; $ret = $ret + 1; next; } if ( defined($retentionpolicy) && ( $policy->getType($retentionpolicy_ref) ne 'RetentionPolicy' ) ) { print "$retentionpolicy policy $retentionpolicy is a wrong type. Skipping provisioning on engine $engine\n"; $ret = $ret + 1; next; } } if (defined($maskedbyscript)) { if ($db->setMaskingJob('script')) { $ret = $ret + 1; next; } } if (defined($maskingjob)) { my $job; my $mjobs = new MaskingJob_obj($engine_obj, $debug); my $source_ref = $source->getReference(); $job = $mjobs->verifyMaskingJobForContainer($source_ref, $maskingjob); if (!defined($job)) { $ret = $ret + 1; next; } } # set autostart $db->setAutostart($autostart); # Database specific code if ( $type eq 'oracle' ) { if (length($dbname) > 8) { print "Max. size of dbname for Oracle is 8 characters\n."; print "VDB won't be created\n"; $ret = $ret + 1; last; } if (defined($instname) && (length($instname) > 12)) { print "Max. size of instance name for Oracle is 12 characters\n."; print "VDB won't be created\n"; $ret = $ret + 1; last; } if ( defined($map_file) ) { my $filemap_obj = new FileMap($engine_obj,$debug); $filemap_obj->loadMapFile($map_file); $filemap_obj->setSource($source); if ($filemap_obj->validate()) { die ("Problem with mapping file. VDB won't be created.") } $db->setMapFile($filemap_obj->GetMapping_rule()); } if (defined($redoSize)) { $db->setRedoGroupSize($redoSize); } if (defined($redoGroup)) { $db->setRedoGroupNumber($redoGroup); } if (defined($archivelog)) { $db->setArchivelog($archivelog); } if (defined($mntpoint)) { $db->setMountPoint($mntpoint); } if (defined($noopen)) { $db->setNoOpenResetLogs(); } if ( defined($template) ) { if ( $db->setTemplate($template) ) { print "Template $template not found. VDB won't be created\n" ; $ret = $ret + 1; next; } } else { if ( $db->setDefaultParams() ) { print "Problem with setting default parameters . VDB won't be created.\n"; $ret = $ret + 1; next; } } $db->setName($targetname,$dbname, $uniqname, $instname); if (defined($listeners)) { if ( $db->setListener($listeners) ) { print "Listener not found. VDB won't be created\n"; $ret = $ret + 1; next; } } if (defined($vcdbname)) { $db->setupVCDB($vcdbname,$vcdbgroup,$vcdbdbname,$vcdbinstname,$vcdbuniqname,$vcdbtemplate); } if (defined($cdbuser)) { if ($db->discoverPDB($envinst, $environment, $cdb, $cdbuser, $cdbpass)) { print "Issue with CDB discovery\n"; $ret = $ret + 1; next; } } $jobno = $db->createVDB($group,$environment,$envinst,$rac_instance, $cdb); } elsif ($type eq 'mssql') { if ( defined($postscript) ) { $db->setPostScript($postscript) } if ( defined($prescript) ) { $db->setPreScript($prescript) } if ( defined($recoveryModel) ) { if ($db->setRecoveryModel($recoveryModel)) { print "Problem with setting Recovery Model $recoveryModel. VDB won't be created.\n"; $ret = $ret + 1; next; }; } $db->setName($targetname, $dbname); $jobno = $db->createVDB($group,$environment,$envinst); } elsif ($type eq 'sybase') { if (defined($mntpoint)) { $db->setMountPoint($mntpoint); } $db->setName($targetname, $dbname); $db->setLogTruncate($truncateLogOnCheckpoint); $jobno = $db->createVDB($group,$environment,$envinst); } elsif ($type eq 'mysql') { if (! defined($port)) { print "Port not defined. VDB won't be created.\n"; $ret = $ret + 1; next; } $db->setName($targetname, $dbname); $jobno = $db->createVDB($group,$environment,$envinst,$port, $mntpoint); } elsif ($type eq 'vFiles' || $type eq 'db2') { if (defined($additionalMount)) { if ($db->setAdditionalMountpoints($additionalMount)) { print "Problem with additional mount points. VDB won't be created.\n"; $ret = $ret + 1; next; } } $db->setName($targetname, $dbname); $jobno = $db->createVDB($group,$environment,$envinst); } if (defined($snapshotpolicy_ref)) { if ($policy->applyPolicy($snapshotpolicy_ref, $db->return_currentobj())) { print "Problem with applying snapshot policy - $snapshotpolicy \n"; } } if (defined($retentionpolicy_ref)) { if ($policy->applyPolicy($retentionpolicy_ref, $db->return_currentobj())) { print "Problem with applying retention policy - $retentionpolicy \n"; } } #print $engine_obj; $ret = $ret + Toolkit_helpers::waitForJob($engine_obj, $jobno, "VDB created.","Problem with VDB creation"); } exit $ret; __DATA__ =head1 SYNOPSIS dx_provision_vdb [ -engine|d <delphix identifier> | -all ] [ -configfile file ] -group group_name -sourcename src_name -targetname targ_name -dbname db_name | -path vfiles_mountpoint -environment environment_name -type oracle|mssql|sybase|vFiles -envinst OracleHome/MSSQLinstance/SybaseServer [-creategroup] [-srcgroup Source group] [-timestamp LATEST_SNAPSHOT|LATEST_POINT|time_stamp] [-template template_name] [-mapfile mapping_file] [-instname SID] [-uniqname db_unique_name] [-mntpoint mount_point ] [-cdb container_name] [-cdbuser username] [-cdbpass password] [-noopen] [-truncateLogOnCheckpoint] [-archivelog yes/no] [-configureclone [hookname,]template|filename[,OS_shell] ] [-prerefresh [hookname,]template|filename[,OS_shell] ] [-postrefresh [hookname,]template|filename[,OS_shell] ] [-prerewind [hookname,]template|filename[,OS_shell] ] [-postrewind [hookname,]template|filename[,OS_shell] ] [-presnapshot [hookname,]template|filename[,OS_shell] ] [-postsnapshot [hookname,]template|filename[,OS_shell] ] [-prestart [hookname,]template|filename[,OS_shell] ] [-poststart [hookname,]template|filename[,OS_shell] ] [-prestop [hookname,]template|filename[,OS_shell] ] [-poststop [hookname,]template|filename[,OS_shell] ] [-prescript pathtoscript ] [-postscript pathtoscript ] [-recoveryModel model ] [-snapshotpolicy name] [-retentionpolicy name] [-additionalMount envname,mountpoint,sharedpath] [-rac_instance env_node,instance_name,instance_no ] [-redoGroup N] [-redoSize N] [-listeners listener_name] [-hooks path_to_hooks] [-envUser username] [-maskingjob jobname] [-maskedbyscript] [-autostart yes] [-vcdbname name] [-vcdbgroup groupname] [-vcdbdbname vcdb_name] [-vcdbuniqname vcdb_unique_name] [-vcdbinstname vcdb_instance_name] [-vcdbtemplate vcdb_template_name] [-help] [-debug] =head1 DESCRIPTION Provision VDB from a defined source on the defined target environment. =head1 ARGUMENTS =head2 Delphix Engine selection - if not specified a default host(s) from dxtools.conf will be used. =over 10 =item B<-engine|d> Specify Delphix Engine name from dxtools.conf file =item B<-all> Display databases on all Delphix appliance =item B<-configfile file> Location of the configuration file. A config file search order is as follow: - configfile parameter - DXTOOLKIT_CONF variable - dxtools.conf from dxtoolkit location =back =head2 VDB arguments =over 1 =item B<-type type> Type (oracle|mssql|sybase|db2|vFiles) =item B<-group name> Group Name =item B<-creategroup> Specify this option to create a new group on Delphix Engine while proviioning a new VDB =item B<-sourcename name> dSource Name =item B<-targetname name> Target name =item B<-dbname name> Target database name =item B<-path path> Mount point location for vFiles =item B<-srcgroup Source group> Group name where source is located =item B<-timestamp timestamp> Time stamp formats: YYYY-MM-DD HH24:MI:SS or LATEST_POINT for point in time, @YYYY-MM-DDTHH24:MI:SS.ZZZ , YYYY-MM-DD HH24:MI or LATEST_SNAPSHOT for snapshots. @YYYY-MM-DDTHH24:MI:SS.ZZZ is a snapshot name from dx_get_snapshot, while YYYY-MM-DD HH24:MI is a snapshot time in GUI format Default is LATEST_SNAPSHOT =item B<-location location> Point in time defined by SCN for Oracle and LSN for MS SQL =item B<-environment environment_name> Target environment name =item B<-envinst environment_instance> Target environment Oracle Home, MS SQL server instance, Sybase server name, etc =item B<-template template_name> Target VDB template name (for Oracle) =item B<-mapfile filename> Target VDB mapping file (for Oracle) =item B<-instname instance_name> Target VDB instance name (for Oracle) =item B<-uniqname db_unique_name> Target VDB db_unique_name (for Oracle) =item B<-mntpoint path> Set a mount point for VDB (for Oracle and Sybase) =item B<-cdb container_name> Set a target container database for vPDB =item B<-cdbuser username> User to discover CDB container in Delphix - it should be c## user =item B<-cdbpass pass> Password for cdbuser to discover CDB container =item B<-vcdbname name> Set a virtual CDB name for vPDB =item B<-vcdbdbname name> Set a virtual CDB database name for vPDB =item B<-vcdbuniqname vcdb_unique_name> Set a virtual CDB unique database name for vPDB If not set, it will be equal to vcdbdbname =item B<-vcdbinstname vcdb_instance_name> Set a virtual CDB instance name for vPDB If not set, it will be equal to vcdbdbname =item B<-vcdbgroup groupname> Set a virtual CDB groupname =item B<-vcdbtemplate vcdb_template_name> Set a virtual CDB template =item B<-noopen> Don't open database after provision (for Oracle) =item B<-archivelog yes/no> Create VDB in archivelog (yes - default) or noarchielog (no) (for Oracle) =item B<-truncateLogOnCheckpoint> Truncate a log on checkpoint. Set this parameter to enable truncate operation (for Sybase) =item B<-prescript pathtoscript> Path to prescript on Windows target =item B<-postscript pathtoscript> Path to postscript on Windows target =item B<-snapshotpolicy policy_name> Snapshot policy name for VDB =item B<-maskingjob jobname> Name of masking job to use during VDB provisioning =item B<-maskedbyscript> Database will be created as masked VDB but user is responsible to provide hooks with script to run custom masking =item B<-retentionpolicy retention_policy> Retention policy name for VDB =item B<-recoveryModel model> Set a recovery model for MS SQL database. Allowed values BULK_LOGGED,FULL,SIMPLE =item B<-additionalMount envname,mountpoint,sharedpath> Set an additinal mount point for vFiles - using a syntax environment_name,mount_point,sharedpath ex. -additionalMount target1,/u01/app/add,/ =item B<-rac_instance env_node,instance_name,instance_no> Comma separated information about node name, instance name and instance number for a RAC provisioning Repeat option if you want to provide information for more nodes ex. -rac_instance node1,VBD1,1 -rac_instance node2,VBD2,2 =item B<-redoGroup N> Create N redo groups =item B<-redoSize N> Each group will be N MB in size =item B<-listeners listener_name> Use listener named listener_name =item B<-hooks path_to_hooks> Import hooks exported using dx_get_hooks =item B<-envUser username> Use an environment user "username" for provisioning database =item B<-autostart yes> Set VDB autostart flag to yes. Default is no =back =head2 Hooks Hook definition. File name is a path to a file with a hook body on machine with dxtoolkit. Template name is an operational template name Allowed combinations: - hookname,template_name,OS_shell - hookname,filename,OS_shell - hookname,template_name - hookname,filename - template_name - filename =item B<-configureclone [hookname,]template|filename[,OS_shell]> Configure Clone hook =item B<-prerefresh [hookname,]template|filename[,OS_shell]> Pre refresh hook =item B<-postrefresh [hookname,]template|filename[,OS_shell]> Post refresh hook =item B<-prerewind [hookname,]template|filename[,OS_shell]> Pre rewind hook =item B<-postrewind [hookname,]template|filename[,OS_shell]> Post rewind hook =item B<-presnapshot [hookname,]template|filename[,OS_shell]> Pre snapshot hook =item B<-postsnapshot [hookname,]template|filename[,OS_shell]> Post snapshot hook =item B<-prestart [hookname,]template|filename[,OS_shell]> Pre start hook =item B<-poststart [hookname,]template|filename[,OS_shell]> Post start hook =item B<-prestop [hookname,]template|filename[,OS_shell]> Pre stop hook =item B<-poststop [hookname,]template|filename[,OS_shell]> Post stop hook =back =head1 OPTIONS =over 2 =item B<-help> Print usage information =item B<-debug> Turn on debugging =back =head1 EXAMPLES Provision an Oracle VDB using latest snapshot dx_provision_vdb -d Landshark -sourcename "Employee Oracle DB" -dbname autoprov -targetname autoprov -group Analytics -environment LINUXTARGET -type oracle -envinst "/u01/app/oracle/product/11.2.0/dbhome_1" Starting provisioning job - JOB-232 0 - 7 - 11 - 13 - 18 - 40 - 48 - 52 - 56 - 58 - 59 - 60 - 62 - 63 - 75 - 100 Job JOB-232 finised with state: COMPLETED VDB created. Provision an Oracle vPDB using a virtual vCDB dx_provision_vdb -d Landshark -type oracle -group "test" -creategroup -sourcename "PDBX1" -srcgroup "Sources" -targetname "vPDBtest" -dbname "vPDBtest" -environment "marcintgt" -envinst "/u01/app/ora12102/product/12.1.0/dbhome_1" -envUser "ora12102" \ -vcdbtemplate slon -vcdbname ala -vcdbdbname slon -vcdbgroup test -mntpoint "/mnt/provision" Starting provisioning job - JOB-203 0 - 11 - 15 - 75 - 100 Job JOB-203 finished with state: COMPLETED VDB created.. Provision a Sybase VDB using a latest snapshot dx_provision_vdb -d Landshark -group Analytics -sourcename 'ASE pubs3 DB' -targetname testsybase -dbname testsybase -environment LINUXTARGET -type sybase -envinst LINUXTARGET Starting provisioning job - JOB-158139 0 - 11 - 15 - 75 - 100 Job JOB-158139 finised with state: COMPLETED Provision a Sybase VDB using a snapshot name "@2015-09-08T08:46:47.000" (to list snapshots use dx_get_snapshots) dx_provision_vdb -d Landshark -group Analytics -sourcename 'ASE pubs3 DB' -targetname testsybase -dbname testsybase -environment LINUXTARGET -type sybase -envinst LINUXTARGET -timestamp "@2015-09-08T08:46:47.000" Starting provisioning job - JOB-158153 0 - 11 - 15 - 63 - 100 Job JOB-158153 finised with state: COMPLETED VDB created. Provision a vFiles using a latest snapshot dx_provision_vdb -d Landshark43 -group Analytics -sourcename "files" -targetname autofs -path /mnt/provision/home/delphix -environment LINUXTARGET -type vFiles Starting provisioning job - JOB-798 0 - 7 - 11 - 75 - 100 Job JOB-798 finised with state: COMPLETED VDB created. Provision a empty vFiles dx_provision_vdb -d Landshark5 -type vFiles -group "Test" -creategroup -empty -targetname "vFiles" -dbname "/home/delphix/de_mount" -environment "LINUXTARGET" -envinst "Unstructured Files" -envUser "delphix" Starting provisioning job - JOB-900 0 - 7 - 11 - 75 - 100 Job JOB-900 finised with state: COMPLETED VDB created. Provision a DB2 VDB using a latest snapshot dx_provision_vdb -group "test" -sourcename employees -targetname v_employees -dbname v_employees -environment "db2-target-host" -type db2 -envinst "db2inst1 - 10.5.0.8 - db2ese" Provision a MS SQL using a latest snapshot dx_provision_vdb -d Landshark -group Analytics -sourcename AdventureWorksLT2008R2 -targetname autotest - dbname autotest -environment WINDOWSTARGET -type mssql -envinst MSSQLSERVER Starting provisioning job - JOB-158159 0 - 3 - 11 - 18 - 75 - 100 Job JOB-158159 finised with state: COMPLETED VDB created. Provision a MS SQL using a snapshot from "2015-09-23 10:23" dx_provision_vdb -d Landshark -group Analytics -sourcename AdventureWorksLT2008R2 -targetname autotest - dbname autotest -environment WINDOWSTARGET -type mssql -envinst MSSQLSERVER -timestamp "2015-09-23 10:23" Starting provisioning job - JOB-158167 0 - 3 - 11 - 18 - 67 - 75 - 100 Job JOB-158167 finised with state: COMPLETED VDB created. =cut
28.382012
257
0.639997
73e4ce90c72cea9cb773664ddfe3db553dbc380f
1,476
t
Perl
t/workbook/workbook_01.t
lcorbasson/excel-writer-xlsx
c8f60933dffdffd8a4a65360a88a4e206310916a
[ "Artistic-1.0-Perl" ]
1
2020-08-18T17:23:15.000Z
2020-08-18T17:23:15.000Z
t/workbook/workbook_01.t
lcorbasson/excel-writer-xlsx
c8f60933dffdffd8a4a65360a88a4e206310916a
[ "Artistic-1.0-Perl" ]
null
null
null
t/workbook/workbook_01.t
lcorbasson/excel-writer-xlsx
c8f60933dffdffd8a4a65360a88a4e206310916a
[ "Artistic-1.0-Perl" ]
null
null
null
############################################################################### # # Tests for Excel::Writer::XLSX::Workbook methods. # # Copyright 2000-2020, John McNamara, jmcnamara@cpan.org # use lib 't/lib'; use TestFunctions qw(_expected_to_aref _got_to_aref _is_deep_diff _new_workbook); use strict; use warnings; use Test::More tests => 1; ############################################################################### # # Tests setup. # my $expected; my $got; my $caption; my $workbook; ############################################################################### # # Test the _assemble_xml_file() method. # $caption = " \tWorkbook: _assemble_xml_file()"; $workbook = _new_workbook(\$got); $workbook->add_worksheet(); $workbook->_assemble_xml_file(); $expected = _expected_to_aref(); $got = _got_to_aref( $got ); _is_deep_diff( $got, $expected, $caption ); __DATA__ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"> <fileVersion appName="xl" lastEdited="4" lowestEdited="4" rupBuild="4505"/> <workbookPr defaultThemeVersion="124226"/> <bookViews> <workbookView xWindow="240" yWindow="15" windowWidth="16095" windowHeight="9660"/> </bookViews> <sheets> <sheet name="Sheet1" sheetId="1" r:id="rId1"/> </sheets> <calcPr calcId="124519" fullCalcOnLoad="1"/> </workbook>
26.836364
154
0.598916
ed111e79ff17d81c2caf1d45a17aa04eaf4a24d7
309
pm
Perl
webapp/perl/local/lib/perl5/Data/Validator/Role/Method.pm
AK-10/AK-10-isucon8-preliminary-revenge
f390710721b2f2e3d9f60120394ec37c9c96b975
[ "MIT" ]
2
2019-04-15T04:28:23.000Z
2019-04-16T12:45:51.000Z
webapp/perl/local/lib/perl5/Data/Validator/Role/Method.pm
AK-10/AK-10-isucon8-preliminary-revenge
f390710721b2f2e3d9f60120394ec37c9c96b975
[ "MIT" ]
16
2019-08-28T23:45:01.000Z
2019-12-20T02:12:13.000Z
webapp/perl/local/lib/perl5/Data/Validator/Role/Method.pm
matsubara0507/isucon9-kansousen
77b19085d76add98a3ce7370063a8636cde62499
[ "MIT" ]
1
2019-04-14T01:11:20.000Z
2019-04-14T01:11:20.000Z
package Data::Validator::Role::Method; use Mouse::Role; around validate => sub { my($next, $self, @args) = @_; return( shift(@args), $self->$next(@args) ); }; no Mouse::Role; 1; __END__ =for stopwords invocant =head1 NAME Data::Validator::Role::Method - Deals with the invocant of methods =cut
14.714286
66
0.660194
ed38a66a717a69e8b9896b715bf459a29d306693
2,714
pm
Perl
perl5/lib/perl5/DateTime/TimeZone/Pacific/Majuro.pm
jinnks/printevolve
8c54f130000cd6ded290f5905bdc2093d9f264da
[ "Apache-2.0" ]
null
null
null
perl5/lib/perl5/DateTime/TimeZone/Pacific/Majuro.pm
jinnks/printevolve
8c54f130000cd6ded290f5905bdc2093d9f264da
[ "Apache-2.0" ]
null
null
null
perl5/lib/perl5/DateTime/TimeZone/Pacific/Majuro.pm
jinnks/printevolve
8c54f130000cd6ded290f5905bdc2093d9f264da
[ "Apache-2.0" ]
null
null
null
# This file is auto-generated by the Perl DateTime Suite time zone # code generator (0.08) This code generator comes with the # DateTime::TimeZone module distribution in the tools/ directory # # Generated from /tmp/Kkk4myWbVM/australasia. Olson data version 2020d # # Do not edit this file directly. # package DateTime::TimeZone::Pacific::Majuro; use strict; use warnings; use namespace::autoclean; our $VERSION = '2.44'; use Class::Singleton 1.03; use DateTime::TimeZone; use DateTime::TimeZone::OlsonDB; @DateTime::TimeZone::Pacific::Majuro::ISA = ( 'Class::Singleton', 'DateTime::TimeZone' ); my $spans = [ [ DateTime::TimeZone::NEG_INFINITY, # utc_start 59958189312, # utc_end 1900-12-31 12:35:12 (Mon) DateTime::TimeZone::NEG_INFINITY, # local_start 59958230400, # local_end 1901-01-01 00:00:00 (Tue) 41088, 0, 'LMT', ], [ 59958189312, # utc_start 1900-12-31 12:35:12 (Mon) 60392005200, # utc_end 1914-09-30 13:00:00 (Wed) 59958228912, # local_start 1900-12-31 23:35:12 (Mon) 60392044800, # local_end 1914-10-01 00:00:00 (Thu) 39600, 0, '+11', ], [ 60392005200, # utc_start 1914-09-30 13:00:00 (Wed) 60528870000, # utc_end 1919-01-31 15:00:00 (Fri) 60392037600, # local_start 1914-09-30 22:00:00 (Wed) 60528902400, # local_end 1919-02-01 00:00:00 (Sat) 32400, 0, '+09', ], [ 60528870000, # utc_start 1919-01-31 15:00:00 (Fri) 61094264400, # utc_end 1936-12-31 13:00:00 (Thu) 60528909600, # local_start 1919-02-01 02:00:00 (Sat) 61094304000, # local_end 1937-01-01 00:00:00 (Fri) 39600, 0, '+11', ], [ 61094264400, # utc_start 1936-12-31 13:00:00 (Thu) 61228274400, # utc_end 1941-03-31 14:00:00 (Mon) 61094300400, # local_start 1936-12-31 23:00:00 (Thu) 61228310400, # local_end 1941-04-01 00:00:00 (Tue) 36000, 0, '+10', ], [ 61228274400, # utc_start 1941-03-31 14:00:00 (Mon) 61317615600, # utc_end 1944-01-29 15:00:00 (Sat) 61228306800, # local_start 1941-03-31 23:00:00 (Mon) 61317648000, # local_end 1944-01-30 00:00:00 (Sun) 32400, 0, '+09', ], [ 61317615600, # utc_start 1944-01-29 15:00:00 (Sat) 62127694800, # utc_end 1969-09-30 13:00:00 (Tue) 61317655200, # local_start 1944-01-30 02:00:00 (Sun) 62127734400, # local_end 1969-10-01 00:00:00 (Wed) 39600, 0, '+11', ], [ 62127694800, # utc_start 1969-09-30 13:00:00 (Tue) DateTime::TimeZone::INFINITY, # utc_end 62127738000, # local_start 1969-10-01 01:00:00 (Wed) DateTime::TimeZone::INFINITY, # local_end 43200, 0, '+12', ], ]; sub olson_version {'2020d'} sub has_dst_changes {0} sub _max_year {2030} sub _new_instance { return shift->_init( @_, spans => $spans ); } 1;
23.807018
89
0.662859
ed0513061dd126e67c5c2d1ba39b2c70fc9bff6e
33,258
t
Perl
t/rework.t
stefansbv/sqitch
74cc0ab48885a9c0c200cb07cb66e4c953ad8906
[ "Unlicense" ]
4
2016-03-22T20:47:55.000Z
2019-11-07T03:26:06.000Z
t/rework.t
stefansbv/sqitch
74cc0ab48885a9c0c200cb07cb66e4c953ad8906
[ "Unlicense" ]
3
2016-01-15T18:11:09.000Z
2016-04-26T12:45:22.000Z
t/rework.t
stefansbv/sqitch
74cc0ab48885a9c0c200cb07cb66e4c953ad8906
[ "Unlicense" ]
2
2016-01-08T17:00:07.000Z
2020-01-31T17:43:21.000Z
#!/usr/bin/perl -w use strict; use warnings; use utf8; use Test::More tests => 231; #use Test::More 'no_plan'; use App::Sqitch; use Locale::TextDomain qw(App-Sqitch); use Test::Exception; use App::Sqitch::Command::add; use Path::Class; use Test::File qw(file_not_exists_ok file_exists_ok); use Test::File::Contents qw(file_contents_identical file_contents_is files_eq); use File::Path qw(make_path remove_tree); use Test::NoWarnings; use lib 't/lib'; use MockOutput; $ENV{SQITCH_CONFIG} = 'nonexistent.conf'; $ENV{SQITCH_USER_CONFIG} = 'nonexistent.user'; $ENV{SQITCH_SYSTEM_CONFIG} = 'nonexistent.sys'; my $CLASS = 'App::Sqitch::Command::rework'; my $test_dir = dir 'test-rework'; ok my $sqitch = App::Sqitch->new( options => { engine => 'pg', top_dir => $test_dir->stringify, }, ), 'Load a sqitch sqitch object'; my $config = $sqitch->config; isa_ok my $rework = App::Sqitch::Command->load({ sqitch => $sqitch, command => 'rework', config => $config, }), $CLASS, 'rework command'; my $target = $rework->default_target; sub dep($) { my $dep = App::Sqitch::Plan::Depend->new( conflicts => 0, %{ App::Sqitch::Plan::Depend->parse(shift) }, plan => $rework->default_target->plan, ); $dep->project; return $dep; } can_ok $CLASS, qw( change_name requires conflicts note execute ); is_deeply [$CLASS->options], [qw( change-name|change|c=s requires|r=s@ conflicts|x=s@ all|a! note|n|m=s@ open-editor|edit|e! )], 'Options should be set up'; ############################################################################## # Test configure(). is_deeply $CLASS->configure($config, {}), {}, 'Should have default configuration with no config or opts'; is_deeply $CLASS->configure($config, { requires => [qw(foo bar)], conflicts => ['baz'], note => [qw(hi there)], }), { requires => [qw(foo bar)], conflicts => ['baz'], note => [qw(hi there)], }, 'Should have get requires, conflicts, and note options'; # open_editor handling CONFIG: { local $ENV{SQITCH_CONFIG} = File::Spec->catfile(qw(t rework.conf)); my $config = App::Sqitch::Config->new; is_deeply $CLASS->configure($config, {}), {}, 'Grabs nothing from config'; ok my $sqitch = App::Sqitch->new, 'Load default Sqitch project'; isa_ok my $rework = App::Sqitch::Command->load({ sqitch => $sqitch, command => 'rework', config => $config, }), $CLASS, 'rework command'; ok $rework->open_editor, 'Coerces rework.open_editor from config string boolean'; } ############################################################################## # Test attributes. is_deeply $rework->requires, [], 'Requires should be an arrayref'; is_deeply $rework->conflicts, [], 'Conflicts should be an arrayref'; is_deeply $rework->note, [], 'Note should be an arrayref'; ############################################################################## # Test execute(). make_path $test_dir->stringify; END { remove_tree $test_dir->stringify if -e $test_dir->stringify }; my $plan_file = $target->plan_file; my $fh = $plan_file->open('>') or die "Cannot open $plan_file: $!"; say $fh "%project=empty\n\n"; $fh->close or die "Error closing $plan_file: $!"; my $plan = $target->plan; throws_ok { $rework->execute('foo') } 'App::Sqitch::X', 'Should get an example for nonexistent change'; is $@->ident, 'plan', 'Nonexistent change error ident should be "plan"'; is $@->message, __x( qq{Change "{change}" does not exist in {file}.\n} . 'Use "sqitch add {change}" to add it to the plan', change => 'foo', file => $plan->file, ), 'Fail message should say the step does not exist'; # Use the add command to create a step. my $deploy_file = file qw(test-rework deploy foo.sql); my $revert_file = file qw(test-rework revert foo.sql); my $verify_file = file qw(test-rework verify foo.sql); my $change_mocker = Test::MockModule->new('App::Sqitch::Plan::Change'); my %request_params; $change_mocker->mock(request_note => sub { my $self = shift; %request_params = @_; return $self->note; }); # Use the same plan. my $mock_plan = Test::MockModule->new(ref $target); $mock_plan->mock(plan => $plan); ok my $add = App::Sqitch::Command::add->new( sqitch => $sqitch, change_name => 'foo',, template_directory => Path::Class::dir(qw(etc templates)) ), 'Create another add with template_directory'; file_not_exists_ok($_) for ($deploy_file, $revert_file, $verify_file); ok $add->execute, 'Execute with the --change option'; file_exists_ok($_) for ($deploy_file, $revert_file, $verify_file); ok my $foo = $plan->get('foo'), 'Get the "foo" change'; throws_ok { $rework->execute('foo') } 'App::Sqitch::X', 'Should get an example for duplicate change'; is $@->ident, 'plan', 'Duplicate change error ident should be "plan"'; is $@->message, __x( qq{Cannot rework "{change}" without an intervening tag.\n} . 'Use "sqitch tag" to create a tag and try again', change => 'foo', ), 'Fail message should say a tag is needed'; # Tag it, and *then* it should work. ok $plan->tag( name => '@alpha' ), 'Tag it'; my $deploy_file2 = file qw(test-rework deploy foo@alpha.sql); my $revert_file2 = file qw(test-rework revert foo@alpha.sql); my $verify_file2 = file qw(test-rework verify foo@alpha.sql); MockOutput->get_info; file_not_exists_ok($_) for ($deploy_file2, $revert_file2, $verify_file2); ok $rework->execute('foo'), 'Rework "foo"'; # The files should have been copied. file_exists_ok($_) for ($deploy_file, $revert_file, $verify_file); file_exists_ok($_) for ($deploy_file2, $revert_file2, $verify_file2); file_contents_identical($deploy_file2, $deploy_file); file_contents_identical($verify_file2, $verify_file); file_contents_identical($revert_file, $deploy_file); file_contents_is($revert_file2, <<'EOF', 'New revert should revert'); -- Revert empty:foo from pg BEGIN; -- XXX Add DDLs here. COMMIT; EOF # The note should have been required. is_deeply \%request_params, { for => __ 'rework', scripts => [$deploy_file, $revert_file, $verify_file], }, 'It should have prompted for a note'; # The plan file should have been updated. ok $plan->load, 'Reload the plan file'; ok my @steps = $plan->changes, 'Get the steps'; is @steps, 2, 'Should have two steps'; is $steps[0]->name, 'foo', 'First step should be "foo"'; is $steps[1]->name, 'foo', 'Second step should also be "foo"'; is_deeply [$steps[1]->requires], [dep 'foo@alpha'], 'Reworked step should require the previous step'; is_deeply +MockOutput->get_info, [ [__x( 'Added "{change}" to {file}.', change => 'foo [foo@alpha]', file => $target->plan_file, )], [__n( 'Modify this file as appropriate:', 'Modify these files as appropriate:', 3, )], [" * $deploy_file"], [" * $revert_file"], [" * $verify_file"], ], 'And the info message should suggest editing the old files'; is_deeply +MockOutput->get_debug, [ [__x( 'Copied {src} to {dest}', dest => $deploy_file2, src => $deploy_file, )], [__x( 'Copied {src} to {dest}', dest => $revert_file2, src => $revert_file, )], [__x( 'Copied {src} to {dest}', dest => $verify_file2, src => $verify_file, )], [__x( 'Copied {src} to {dest}', dest => $revert_file, src => $deploy_file, )], ], 'Debug should show file copying'; ############################################################################## # Let's do that again. This time with more dependencies and fewer files. $deploy_file = file qw(test-rework deploy bar.sql); $revert_file = file qw(test-rework revert bar.sql); $verify_file = file qw(test-rework verify bar.sql); ok $add = App::Sqitch::Command::add->new( sqitch => $sqitch, template_directory => Path::Class::dir(qw(etc templates)), with_scripts => { revert => 0, verify => 0 }, ), 'Create another add with template_directory'; file_not_exists_ok($_) for ($deploy_file, $revert_file, $verify_file); $add->execute('bar'); file_exists_ok($deploy_file); file_not_exists_ok($_) for ($revert_file, $verify_file); ok $plan->tag( name => '@beta' ), 'Tag it with @beta'; my $deploy_file3 = file qw(test-rework deploy bar@beta.sql); my $revert_file3 = file qw(test-rework revert bar@beta.sql); my $verify_file3 = file qw(test-rework verify bar@beta.sql); MockOutput->get_info; isa_ok $rework = App::Sqitch::Command::rework->new( sqitch => $sqitch, command => 'rework', config => $config, requires => ['foo'], note => [qw(hi there)], conflicts => ['dr_evil'], ), $CLASS, 'rework command with requirements and conflicts'; # Check the files. file_not_exists_ok($_) for ($deploy_file3, $revert_file3, $verify_file3); ok $rework->execute('bar'), 'Rework "bar"'; file_exists_ok($deploy_file); file_not_exists_ok($_) for ($revert_file, $verify_file); file_exists_ok($deploy_file3); file_not_exists_ok($_) for ($revert_file3, $verify_file3); # The note should have been required. is_deeply \%request_params, { for => __ 'rework', scripts => [$deploy_file], }, 'It should have prompted for a note'; # The plan file should have been updated. ok $plan->load, 'Reload the plan file again'; ok @steps = $plan->changes, 'Get the steps'; is @steps, 4, 'Should have four steps'; is $steps[0]->name, 'foo', 'First step should be "foo"'; is $steps[1]->name, 'foo', 'Second step should also be "foo"'; is $steps[2]->name, 'bar', 'First step should be "bar"'; is $steps[3]->name, 'bar', 'Second step should also be "bar"'; is_deeply [$steps[3]->requires], [dep 'bar@beta', dep 'foo'], 'Requires should have been passed to reworked change'; is_deeply [$steps[3]->conflicts], [dep '!dr_evil'], 'Conflicts should have been passed to reworked change'; is $steps[3]->note, "hi\n\nthere", 'Note should have been passed as comment'; is_deeply +MockOutput->get_info, [ [__x( 'Added "{change}" to {file}.', change => 'bar [bar@beta foo !dr_evil]', file => $target->plan_file, )], [__n( 'Modify this file as appropriate:', 'Modify these files as appropriate:', 1, )], [" * $deploy_file"], ], 'And the info message should show only the one file to modify'; is_deeply +MockOutput->get_debug, [ [__x( 'Copied {src} to {dest}', dest => $deploy_file3, src => $deploy_file, )], [__x( 'Skipped {dest}: {src} does not exist', dest => $revert_file3, src => $revert_file, )], [__x( 'Skipped {dest}: {src} does not exist', dest => $verify_file3, src => $verify_file, )], [__x( 'Skipped {dest}: {src} does not exist', dest => $revert_file, src => $revert_file3, # No previous revert, no need for new revert. )], ], 'Should have debug oputput for missing files'; # Make sure --open-editor works MOCKSHELL: { my $sqitch_mocker = Test::MockModule->new('App::Sqitch'); my $shell_cmd; $sqitch_mocker->mock(shell => sub { $shell_cmd = $_[1] }); $sqitch_mocker->mock(quote_shell => sub { shift; join ' ' => @_ }); ok $rework = $CLASS->new( sqitch => $sqitch, template_directory => Path::Class::dir(qw(etc templates)), note => ['Testing --open-editor'], open_editor => 1, ), 'Create another add with open_editor'; ok $plan->tag( name => '@gamma' ), 'Tag it'; my $rework_file = file qw(test-rework deploy bar.sql); my $deploy_file = file qw(test-rework deploy bar@gamma.sql); my $revert_file = file qw(test-rework revert bar@gamma.sql); my $verify_file = file qw(test-rework verify bar@gamma.sql); MockOutput->get_info; file_not_exists_ok($_) for ($deploy_file, $revert_file, $verify_file); ok $rework->execute('bar'), 'Rework "bar"'; # The files should have been copied. file_exists_ok($_) for ($rework_file, $deploy_file); file_not_exists_ok($_) for ($revert_file, $verify_file); is $shell_cmd, join(' ', $sqitch->editor, $rework_file), 'It should have prompted to edit sql files'; is_deeply +MockOutput->get_info, [ [__x( 'Added "{change}" to {file}.', change => 'bar [bar@gamma]', file => $target->plan_file, )], [__n( 'Modify this file as appropriate:', 'Modify these files as appropriate:', 1, )], [" * $rework_file"], ], 'And the info message should suggest editing the old files'; MockOutput->get_debug; # empty debug. }; # Make sure a configuration with multiple plans works. $mock_plan->unmock('plan'); MULTIPLAN: { my $dstring = $test_dir->stringify; remove_tree $dstring; make_path $dstring; END { remove_tree $dstring if -e $dstring }; chdir $dstring; my $conf = file 'multirework.conf'; $conf->spew(join "\n", '[core]', 'engine = pg', '[engine "pg"]', 'top_dir = pg', '[engine "sqlite"]', 'top_dir = sqlite', '[engine "mysql"]', 'top_dir = mysql', ); # Create plan files and determine the scripts that to be created. my %scripts = map { my $dir = dir $_; $dir->mkpath; $dir->file('sqitch.plan')->spew(join "\n", '%project=rework', '', 'widgets 2012-07-16T17:25:07Z anna <a@n.na>', 'gadgets 2012-07-16T18:25:07Z anna <a@n.na>', '@foo 2012-07-16T17:24:07Z julie <j@ul.ie>', '', ); # Make the script files. my (@change, @reworked); for my $type (qw(deploy revert verify)) { my $subdir = $dir->subdir($type); $subdir->mkpath; my $script = $subdir->file('widgets.sql'); $script->spew("-- $subdir widgets"); push @change => $script; push @reworked => $subdir->file('widgets@foo.sql'); } # Return the scripts. $_ => { change => \@change, reworked => \@reworked }; } qw(pg sqlite mysql); # Load up the configuration for this project. local $ENV{SQITCH_CONFIG} = $conf; my $sqitch = App::Sqitch->new; ok my $rework = $CLASS->new( sqitch => $sqitch, note => ['Testing multiple plans'], all => 1, template_directory => dir->parent->subdir(qw(etc templates)) ), 'Create another rework with custom multiplan config'; my @targets = App::Sqitch::Target->all_targets(sqitch => $sqitch); is @targets, 3, 'Should have three targets'; # Make sure the target list matches our script list order (by engine). # pg always comes first, as primary engine, but the other two are random. push @targets, splice @targets, 1, 1 if $targets[1]->engine_key ne 'sqlite'; # Let's do this thing! ok $rework->execute('widgets'), 'Rework change "widgets" in all plans'; for my $target(@targets) { my $ekey = $target->engine_key; ok my $head = $target->plan->get('widgets@HEAD'), "Get widgets\@HEAD from the $ekey plan"; ok my $foo = $target->plan->get('widgets@foo'), "Get widgets\@foo from the $ekey plan"; cmp_ok $head->id, 'ne', $foo->id, "The two $ekey widgets should be different changes"; } # All the files should exist, now. while (my ($k, $v) = each %scripts) { file_exists_ok $_ for map { @{ $v->{$_} } } qw(change reworked); # Deploy and verify files should be the same. files_eq $v->{change}[0], $v->{reworked}[0]; files_eq $v->{change}[2], $v->{reworked}[2]; # New revert should be the same as old deploy. files_eq $v->{change}[1], $v->{reworked}[0]; } # Make sure we see the proper output. my $info = MockOutput->get_info; my $note = $request_params{scripts}; my $ekey = $targets[1]->engine_key; if ($info->[1][0] !~ /$ekey/) { # Got the targets in a different order. So reorder results to match. ($info->[1], $info->[2]) = ($info->[2], $info->[1]); push @{ $info } => splice @{ $info }, 7, 3; push @{ $note } => splice @{ $note }, 3, 3; } is_deeply $note, [map { @{ $scripts{$_}{change} }} qw(pg sqlite mysql)], 'Should have listed the files in the note prompt'; is_deeply $info, [ [__x( 'Added "{change}" to {file}.', change => 'widgets [widgets@foo]', file => $targets[0]->plan_file, )], [__x( 'Added "{change}" to {file}.', change => 'widgets [widgets@foo]', file => $targets[1]->plan_file, )], [__x( 'Added "{change}" to {file}.', change => 'widgets [widgets@foo]', file => $targets[2]->plan_file, )], [__n( 'Modify this file as appropriate:', 'Modify these files as appropriate:', 3, )], map { map { [" * $_" ] } @{ $scripts{$_}{change} } } qw(pg sqlite mysql) ], 'And the info message should show the two files to modify'; my $debug = +MockOutput->get_debug; if ($debug->[4][0] !~ /$ekey/) { # Got the targets in a different order. So reorder results to match. push @{ $debug } => splice @{ $debug }, 4, 4; } is_deeply $debug, [ map { my ($c, $r) = @{ $scripts{$_} }{qw(change reworked)}; ( map { [__x( 'Copied {src} to {dest}', src => $c->[$_], dest => $r->[$_], )] } (0..2) ), [__x( 'Copied {src} to {dest}', src => $c->[0], dest => $c->[1], )] } qw(pg sqlite mysql) ], 'Should have debug oputput for all copied files'; # # Make sure we get an error using --all and a target arg. throws_ok { $rework->execute('foo', 'pg' ) } 'App::Sqitch::X', 'Should get an error for --all and a target arg'; is $@->ident, 'rework', 'Mixed arguments error ident should be "rework"'; is $@->message, __( 'Cannot specify both --all and engine, target, or plan arugments' ), 'Mixed arguments error message should be correct'; # # Now try reworking a change to just one engine. Remove --all %scripts = map { my $dir = dir $_; $dir->mkpath; # Make the script files. my (@change, @reworked); for my $type (qw(deploy revert verify)) { my $subdir = $dir->subdir($type); $subdir->mkpath; my $script = $subdir->file('gadgets.sql'); $script->spew("-- $subdir gadgets"); push @change => $script; # Only SQLite is reworked. push @reworked => $subdir->file('gadgets@foo.sql') if $_ eq 'sqlite'; } # Return the scripts. $_ => { change => \@change, reworked => \@reworked }; } qw(pg sqlite mysql); ok $rework = $CLASS->new( sqitch => $sqitch, note => ['Testing multiple plans'], template_directory => dir->parent->subdir(qw(etc templates)) ), 'Create yet another rework with custom multiplan config'; ok $rework->execute('gadgets', 'sqlite'), 'Rework change "gadgets" in the sqlite plan'; my %targets = map { $_->engine_key => $_ } App::Sqitch::Target->all_targets(sqitch => $sqitch); is keys %targets, 3, 'Should still have three targets'; my $name = 'gadgets@foo'; for my $ekey(qw(pg mysql)) { my $target = $targets{$ekey}; ok my $head = $target->plan->get('gadgets@HEAD'), "Get gadgets\@HEAD from the $ekey plan"; ok my $foo = $target->plan->get('gadgets@foo'), "Get gadgets\@foo from the $ekey plan"; cmp_ok $head->id, 'eq', $foo->id, "The two $ekey gadgets should be the same change"; } do { my $ekey = 'sqlite'; my $target = $targets{$ekey}; ok my $head = $target->plan->get('gadgets@HEAD'), "Get gadgets\@HEAD from the $ekey plan"; ok my $foo = $target->plan->get('gadgets@foo'), "Get gadgets\@foo from the $ekey plan"; cmp_ok $head->id, 'ne', $foo->id, "The two $ekey gadgets should be different changes"; }; # All the files should exist, now. while (my ($k, $v) = each %scripts) { file_exists_ok $_ for map { @{ $v->{$_} } } qw(change reworked); next if $k ne 'sqlite'; # Deploy and verify files should be the same. files_eq $v->{change}[0], $v->{reworked}[0]; files_eq $v->{change}[2], $v->{reworked}[2]; # New revert should be the same as old deploy. files_eq $v->{change}[1], $v->{reworked}[0]; } is_deeply \%request_params, { for => __ 'rework', scripts => $scripts{sqlite}{change}, }, 'Should have listed SQLite scripts in the note prompt'; # Clear the output. MockOutput->get_info; MockOutput->get_debug; chdir File::Spec->updir; } # Make sure we update only one plan but write out multiple target files. MULTITARGET: { my $dstring = $test_dir->stringify; remove_tree $dstring; make_path $dstring; END { remove_tree $dstring if -e $dstring }; chdir $dstring; my $conf = file 'multiadd.conf'; $conf->spew(join "\n", '[core]', 'engine = pg', 'plan_file = sqitch.plan', '[engine "pg"]', 'top_dir = pg', '[engine "sqlite"]', 'top_dir = sqlite', '[add]', 'all = true', ); file('sqitch.plan')->spew(join "\n", '%project=rework', '', 'widgets 2012-07-16T17:25:07Z anna <a@n.na>', 'gadgets 2012-07-16T18:25:07Z anna <a@n.na>', '@foo 2012-07-16T17:24:07Z julie <j@ul.ie>', '', ); # Create the scripts. my %scripts = map { my $dir = dir $_; my (@change, @reworked); for my $type (qw(deploy revert verify)) { my $subdir = $dir->subdir($type); $subdir->mkpath; my $script = $subdir->file('widgets.sql'); $script->spew("-- $subdir widgets"); push @change => $script; push @reworked => $subdir->file('widgets@foo.sql'); } # Return the scripts. $_ => { change => \@change, reworked => \@reworked }; } qw(pg sqlite); # Load up the configuration for this project. local $ENV{SQITCH_CONFIG} = $conf; my $sqitch = App::Sqitch->new; ok my $rework = $CLASS->new( sqitch => $sqitch, note => ['Testing multiple plans'], all => 1, template_directory => dir->parent->subdir(qw(etc templates)) ), 'Create another rework with custom multiplan config'; my @targets = App::Sqitch::Target->all_targets(sqitch => $sqitch); is @targets, 2, 'Should have two targets'; is $targets[0]->plan_file, $targets[1]->plan_file, 'Targets should use the same plan file'; my $target = $targets[0]; # Let's do this thing! ok $rework->execute('widgets'), 'Rework change "widgets" in all plans'; ok my $head = $target->plan->get('widgets@HEAD'), "Get widgets\@HEAD from the plan"; ok my $foo = $target->plan->get('widgets@foo'), "Get widgets\@foo from the plan"; cmp_ok $head->id, 'ne', $foo->id, "The two widgets should be different changes"; # All the files should exist, now. while (my ($k, $v) = each %scripts) { file_exists_ok $_ for map { @{ $v->{$_} } } qw(change reworked); # Deploy and verify files should be the same. files_eq $v->{change}[0], $v->{reworked}[0]; files_eq $v->{change}[2], $v->{reworked}[2]; # New revert should be the same as old deploy. files_eq $v->{change}[1], $v->{reworked}[0]; } is_deeply \%request_params, { for => __ 'rework', scripts => [ map {@{ $scripts{$_}{change} }} qw(pg sqlite)], }, 'Should have listed all the files to edit in the note prompt'; # And the output should be correct. is_deeply +MockOutput->get_info, [ [__x( 'Added "{change}" to {file}.', change => 'widgets [widgets@foo]', file => $target->plan_file, )], [__n( 'Modify this file as appropriate:', 'Modify these files as appropriate:', 3, )], map { map { [" * $_" ] } @{ $scripts{$_}{change} } } qw(pg sqlite) ], 'And the info message should show the two files to modify'; # As should the debug output is_deeply +MockOutput->get_debug, [ map { my ($c, $r) = @{ $scripts{$_} }{qw(change reworked)}; ( map { [__x( 'Copied {src} to {dest}', src => $c->[$_], dest => $r->[$_], )] } (0..2) ), [__x( 'Copied {src} to {dest}', src => $c->[0], dest => $c->[1], )] } qw(pg sqlite) ], 'Should have debug oputput for all copied files'; chdir File::Spec->updir; } # Try two plans with different tags. MULTITAG: { my $dstring = $test_dir->stringify; remove_tree $dstring; make_path $dstring; END { remove_tree $dstring if -e $dstring }; chdir $test_dir->stringify; my $conf = file 'multirework.conf'; $conf->spew(join "\n", '[core]', 'engine = pg', '[engine "pg"]', 'top_dir = pg', '[engine "sqlite"]', 'top_dir = sqlite', ); # Create plan files and determine the scripts that to be created. my %scripts = map { my $dir = dir $_; $dir->mkpath; my $tag = $_ eq 'pg' ? 'foo' : 'bar'; $dir->file('sqitch.plan')->spew(join "\n", '%project=rework', '', 'widgets 2012-07-16T17:25:07Z anna <a@n.na>', "\@$tag 2012-07-16T17:24:07Z julie <j\@ul.ie>", '', ); # Make the script files. my (@change, @reworked); for my $type (qw(deploy revert verify)) { my $subdir = $dir->subdir($type); $subdir->mkpath; my $script = $subdir->file('widgets.sql'); $script->spew("-- $subdir widgets"); push @change => $script; push @reworked => $subdir->file("widgets\@$tag.sql"); } # Return the scripts. $_ => { change => \@change, reworked => \@reworked }; } qw(pg sqlite); # Load up the configuration for this project. local $ENV{SQITCH_CONFIG} = $conf; my $sqitch = App::Sqitch->new; ok my $rework = $CLASS->new( sqitch => $sqitch, note => ['Testing multiple plans'], all => 1, template_directory => dir->parent->subdir(qw(etc templates)) ), 'Create another rework with custom multiplan config'; my @targets = App::Sqitch::Target->all_targets(sqitch => $sqitch); is @targets, 2, 'Should have two targets'; # Let's do this thing! ok $rework->execute('widgets'), 'Rework change "widgets" in all plans'; for my $target(@targets) { my $ekey = $target->engine_key; my $tag = $ekey eq 'pg' ? 'foo' : 'bar'; ok my $head = $target->plan->get('widgets@HEAD'), "Get widgets\@HEAD from the $ekey plan"; ok my $prev = $target->plan->get("widgets\@$tag"), "Get widgets\@$tag from the $ekey plan"; cmp_ok $head->id, 'ne', $prev->id, "The two $ekey widgets should be different changes"; } is_deeply \%request_params, { for => __ 'rework', scripts => [ map {@{ $scripts{$_}{change} }} qw(pg sqlite)], }, 'Should have listed all the files to edit in the note prompt'; # And the output should be correct. is_deeply +MockOutput->get_info, [ [__x( 'Added "{change}" to {file}.', change => 'widgets [widgets@foo]', file => $targets[0]->plan_file, )], [__x( 'Added "{change}" to {file}.', change => 'widgets [widgets@bar]', file => $targets[1]->plan_file, )], [__n( 'Modify this file as appropriate:', 'Modify these files as appropriate:', 2, )], map { map { [" * $_" ] } @{ $scripts{$_}{change} } } qw(pg sqlite) ], 'And the info message should show the two files to modify'; # As should the debug output is_deeply +MockOutput->get_debug, [ map { my ($c, $r) = @{ $scripts{$_} }{qw(change reworked)}; ( map { [__x( 'Copied {src} to {dest}', src => $c->[$_], dest => $r->[$_], )] } (0..2) ), [__x( 'Copied {src} to {dest}', src => $c->[0], dest => $c->[1], )] } qw(pg sqlite) ], 'Should have debug oputput for all copied files'; chdir File::Spec->updir; } # Make sure we're okay with multiple plans sharing the same top dir. ONETOP: { remove_tree $test_dir->stringify; make_path $test_dir->stringify; END { remove_tree $test_dir->stringify }; chdir $test_dir->stringify; my $conf = file 'multirework.conf'; $conf->spew(join "\n", '[core]', 'engine = pg', '[engine "pg"]', 'plan_file = pg.plan', '[engine "sqlite"]', 'plan_file = sqlite.plan', ); # Write the two plan files. file("$_.plan")->spew(join "\n", '%project=rework', '', 'widgets 2012-07-16T17:25:07Z anna <a@n.na>', '@foo 2012-07-16T17:24:07Z julie <j@ul.ie>', '', ) for qw(pg sqlite); # One set of scripts for both. my (@change, @reworked); for my $type (qw(deploy revert verify)) { my $dir = dir $type; $dir->mkpath; my $script = $dir->file('widgets.sql'); $script->spew("-- $dir widgets"); push @change => $script; push @reworked => $dir->file('widgets@foo.sql'); } # Load up the configuration for this project. local $ENV{SQITCH_CONFIG} = $conf; my $sqitch = App::Sqitch->new; ok my $rework = $CLASS->new( sqitch => $sqitch, note => ['Testing multiple plans'], all => 1, template_directory => dir->parent->subdir(qw(etc templates)) ), 'Create another rework with custom multiplan config'; my @targets = App::Sqitch::Target->all_targets(sqitch => $sqitch); is @targets, 2, 'Should have two targets'; ok $rework->execute('widgets'), 'Rework change "widgets" in all plans'; for my $target(@targets) { my $ekey = $target->engine_key; ok my $head = $target->plan->get('widgets@HEAD'), "Get widgets\@HEAD from the $ekey plan"; ok my $foo = $target->plan->get('widgets@foo'), "Get widgets\@foo from the $ekey plan"; cmp_ok $head->id, 'ne', $foo->id, "The two $ekey widgets should be different changes"; } # Make sure the files were written properly. file_exists_ok $_ for (@change, @reworked); # Deploy and verify files should be the same. files_eq $change[0], $reworked[0]; files_eq $change[2], $reworked[2]; # New revert should be the same as old deploy. files_eq $change[1], $reworked[0]; is_deeply \%request_params, { for => __ 'rework', scripts => \@change, }, 'Should have listed the files to edit in the note prompt'; # And the output should be correct. is_deeply +MockOutput->get_info, [ [__x( 'Added "{change}" to {file}.', change => 'widgets [widgets@foo]', file => $targets[0]->plan_file, )], [__x( 'Added "{change}" to {file}.', change => 'widgets [widgets@foo]', file => $targets[1]->plan_file, )], [__n( 'Modify this file as appropriate:', 'Modify these files as appropriate:', 2, )], map { [" * $_" ] } @change, ], 'And the info message should show the two files to modify'; # As should the debug output is_deeply +MockOutput->get_debug, [ ( map { [__x( 'Copied {src} to {dest}', src => $change[$_], dest => $reworked[$_], )] } (0..2) ), [__x( 'Copied {src} to {dest}', src => $change[0], dest => $change[1], )], ], 'Should have debug oputput for all copied files'; chdir File::Spec->updir; }
34.286598
85
0.55289
73f976e37910942bac59d44a4cca4b7d79ff0bc5
2,886
pm
Perl
auto-lib/Paws/Schemas/PutCodeBinding.pm
shogo82148/aws-sdk-perl
a87555a9d30dd1415235ebacd2715b2f7e5163c7
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/Schemas/PutCodeBinding.pm
shogo82148/aws-sdk-perl
a87555a9d30dd1415235ebacd2715b2f7e5163c7
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/Schemas/PutCodeBinding.pm
shogo82148/aws-sdk-perl
a87555a9d30dd1415235ebacd2715b2f7e5163c7
[ "Apache-2.0" ]
null
null
null
package Paws::Schemas::PutCodeBinding; use Moose; has Language => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'language', required => 1); has RegistryName => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'registryName', required => 1); has SchemaName => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'schemaName', required => 1); has SchemaVersion => (is => 'ro', isa => 'Str', traits => ['ParamInQuery'], query_name => 'schemaVersion'); use MooseX::ClassAttribute; class_has _api_call => (isa => 'Str', is => 'ro', default => 'PutCodeBinding'); class_has _api_uri => (isa => 'Str', is => 'ro', default => '/v1/registries/name/{registryName}/schemas/name/{schemaName}/language/{language}'); class_has _api_method => (isa => 'Str', is => 'ro', default => 'POST'); class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::Schemas::PutCodeBindingResponse'); 1; ### main pod documentation begin ### =head1 NAME Paws::Schemas::PutCodeBinding - Arguments for method PutCodeBinding on L<Paws::Schemas> =head1 DESCRIPTION This class represents the parameters used for calling the method PutCodeBinding on the L<Schemas|Paws::Schemas> service. Use the attributes of this class as arguments to method PutCodeBinding. You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to PutCodeBinding. =head1 SYNOPSIS my $schemas = Paws->service('Schemas'); my $PutCodeBindingResponse = $schemas->PutCodeBinding( Language => 'My__string', RegistryName => 'My__string', SchemaName => 'My__string', SchemaVersion => 'My__string', # OPTIONAL ); # Results: my $CreationDate = $PutCodeBindingResponse->CreationDate; my $LastModified = $PutCodeBindingResponse->LastModified; my $SchemaVersion = $PutCodeBindingResponse->SchemaVersion; my $Status = $PutCodeBindingResponse->Status; # Returns a L<Paws::Schemas::PutCodeBindingResponse> object. Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object. For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/schemas/PutCodeBinding> =head1 ATTRIBUTES =head2 B<REQUIRED> Language => Str =head2 B<REQUIRED> RegistryName => Str =head2 B<REQUIRED> SchemaName => Str =head2 SchemaVersion => Str =head1 SEE ALSO This class forms part of L<Paws>, documenting arguments for method PutCodeBinding in L<Paws::Schemas> =head1 BUGS and CONTRIBUTIONS The source code is located here: L<https://github.com/pplu/aws-sdk-perl> Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues> =cut
31.369565
249
0.69404