hexsha
stringlengths
40
40
size
int64
3
1.05M
ext
stringlengths
1
11
lang
stringlengths
1
21
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
sequence
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
sequence
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
sequence
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
eda7a0ce3b6ce3c62490c83a9deeca60b3160e31
2,609
pm
Perl
lib/MongoDB/Op/_CreateIndexes.pm
nunorc/mongo-perl-driver
8fcdf41bb8e92771df0b68fc52aadf95d2586e62
[ "Apache-2.0" ]
null
null
null
lib/MongoDB/Op/_CreateIndexes.pm
nunorc/mongo-perl-driver
8fcdf41bb8e92771df0b68fc52aadf95d2586e62
[ "Apache-2.0" ]
null
null
null
lib/MongoDB/Op/_CreateIndexes.pm
nunorc/mongo-perl-driver
8fcdf41bb8e92771df0b68fc52aadf95d2586e62
[ "Apache-2.0" ]
null
null
null
# # Copyright 2014 MongoDB, Inc. # # 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 MongoDB::Op::_CreateIndexes; # Encapsulate index creation operations; returns a MongoDB::CommandResult # or a MongoDB::InsertManyResult, depending on the server version use version; our $VERSION = 'v1.5.0'; use Moo; use MongoDB::Op::_Command; use MongoDB::Op::_BatchInsert; use Types::Standard qw( ArrayRef HashRef ); use namespace::clean; has indexes => ( is => 'ro', required => 1, isa => ArrayRef [HashRef], ); with $_ for qw( MongoDB::Role::_PrivateConstructor MongoDB::Role::_CollectionOp MongoDB::Role::_WriteOp ); sub execute { my ( $self, $link ) = @_; my $res = $link->does_write_commands ? $self->_command_create_indexes($link) : $self->_legacy_index_insert($link); return $res; } sub _command_create_indexes { my ( $self, $link, $op_doc ) = @_; my $op = MongoDB::Op::_Command->_new( db_name => $self->db_name, query => [ createIndexes => $self->coll_name, indexes => $self->indexes, ( $link->accepts_wire_version(5) ? ( @{ $self->write_concern->as_args } ) : () ) ], query_flags => {}, bson_codec => $self->bson_codec, ); my $res = $op->execute( $link ); $res->assert_no_write_concern_error; return $res; } sub _legacy_index_insert { my ( $self, $link, $op_doc ) = @_; # construct docs for an insert many op my $ns = join( ".", $self->db_name, $self->coll_name ); my $indexes = [ map { { %$_, ns => $ns } } @{ $self->indexes } ]; my $op = MongoDB::Op::_BatchInsert->_new( db_name => $self->db_name, coll_name => "system.indexes", full_name => (join ".", $self->db_name, "system.indexes"), documents => $indexes, write_concern => $self->write_concern, bson_codec => $self->bson_codec, check_keys => 0, ordered => 1, ); return $op->execute($link); } 1;
24.847619
92
0.60253
edd559a19ed679fd22b34c159e6f50543a7dfe4b
1,516
pl
Perl
production/human_dumps_97/checksum_vcf_nonhuman.pl
at7/work
0198a1818700a37c36a8d42a87ac4e8d772ad3eb
[ "Apache-2.0" ]
null
null
null
production/human_dumps_97/checksum_vcf_nonhuman.pl
at7/work
0198a1818700a37c36a8d42a87ac4e8d772ad3eb
[ "Apache-2.0" ]
null
null
null
production/human_dumps_97/checksum_vcf_nonhuman.pl
at7/work
0198a1818700a37c36a8d42a87ac4e8d772ad3eb
[ "Apache-2.0" ]
null
null
null
use strict; use warnings; use FileHandle; my $dir = '/hps/nobackup2/production/ensembl/anja/release_97/dumps/vertebrates/vcf/'; my $all_species = {}; opendir(DIR, $dir) or die $!; while (my $species = readdir(DIR)) { next if ($species =~ /^\./); next if ($species ne 'homo_sapiens'); $all_species->{$species} = 1; } closedir(DIR); compute_checksums($dir, $all_species); sub run_cmd { my $cmd = shift; if (my $return_value = system($cmd)) { $return_value >>= 8; die "system($cmd) failed: $return_value"; } } sub compute_checksums { my ($data_dir, $all_species) = @_; foreach my $species (keys %$all_species) { print STDERR $species, "\n"; my $working_dir = "$data_dir/$species/"; opendir(my $dh, $working_dir) or die "Cannot open directory $working_dir"; my @files = sort {$a cmp $b} readdir($dh); closedir($dh) or die "Cannot close directory $working_dir"; my @checksums = (); foreach my $file (@files) { next if $file =~ /^\./; next if $file =~ /^CHECKSUM/; my $path = File::Spec->catfile($working_dir, $file); my $checksum = checksum($path); push(@checksums, [$checksum, $file]); } my $fh = FileHandle->new("$working_dir/CHECKSUMS", 'w'); foreach my $entry (@checksums) { my $line = join("\t", @{$entry}); print $fh $line, "\n"; } $fh->close(); } } sub checksum { my $path = shift; my $checksum = `sum $path`; $checksum =~ s/\s* $path//xms; chomp($checksum); return $checksum; }
24.852459
85
0.600923
edb2fc91e637952ff26ac937935323221523f677
7,257
al
Perl
benchmark/benchmarks/FASP-benchmarks/data/small-world-2/smallworld2-0800-5-390-1563.al
krzysg/FaspHeuristic
1929c40e3fbc49e68b04acfc5522539a18758031
[ "MIT" ]
null
null
null
benchmark/benchmarks/FASP-benchmarks/data/small-world-2/smallworld2-0800-5-390-1563.al
krzysg/FaspHeuristic
1929c40e3fbc49e68b04acfc5522539a18758031
[ "MIT" ]
null
null
null
benchmark/benchmarks/FASP-benchmarks/data/small-world-2/smallworld2-0800-5-390-1563.al
krzysg/FaspHeuristic
1929c40e3fbc49e68b04acfc5522539a18758031
[ "MIT" ]
null
null
null
1 21 28 166 2 125 139 156 158 266 376 377 3 45 119 293 4 38 229 311 5 57 85 299 314 341 6 145 148 179 390 7 134 192 349 8 87 220 251 355 9 11 76 127 201 313 10 13 111 131 212 366 11 9 48 76 83 201 12 3 239 324 13 79 212 14 36 64 120 297 365 15 26 111 132 185 205 302 370 16 30 53 65 66 347 380 17 4 68 82 229 311 360 18 41 96 233 369 19 48 56 94 114 219 20 28 116 156 208 284 377 382 21 100 148 22 81 92 94 198 337 381 23 164 226 256 353 24 224 247 258 330 25 48 140 191 194 26 15 24 170 205 224 27 38 122 163 261 322 28 1 20 73 292 29 86 184 203 357 30 53 318 380 31 37 54 76 124 153 214 224 336 32 116 177 321 344 33 18 41 269 339 360 34 215 346 385 35 67 194 275 338 36 209 213 37 31 154 274 296 38 4 229 261 288 311 315 39 104 280 334 349 40 169 281 41 18 33 112 312 360 42 170 314 43 38 63 170 243 261 278 387 44 143 286 326 374 45 3 119 182 231 253 46 20 116 47 118 131 162 298 48 11 83 94 330 49 158 202 50 26 154 224 254 51 75 147 246 294 52 45 128 300 53 16 30 65 54 31 124 184 203 301 336 55 121 123 352 56 108 114 282 57 87 217 299 58 87 88 204 248 356 59 113 257 303 337 358 60 125 311 61 34 97 99 103 135 232 262 335 62 104 141 171 270 63 6 43 148 210 238 64 109 209 65 16 53 169 301 66 16 168 275 380 67 35 136 172 310 343 68 82 117 126 129 332 69 108 138 228 70 106 144 230 71 198 72 193 195 230 384 73 100 148 197 74 107 217 223 271 295 375 75 99 147 294 332 76 83 77 123 186 245 255 78 220 223 375 79 241 379 80 17 117 126 81 19 22 199 263 390 82 17 68 129 136 172 229 83 48 53 76 318 84 159 199 322 85 2 5 251 299 87 74 217 251 299 88 110 190 248 329 333 356 89 325 335 90 120 195 213 255 257 91 97 103 226 326 92 69 93 142 198 325 368 390 94 19 22 48 141 157 157 281 378 95 175 96 18 268 369 389 97 61 91 98 226 350 98 188 226 305 344 99 61 75 135 264 294 100 1 21 28 101 12 47 335 102 34 181 385 103 91 104 62 118 105 111 115 354 366 106 216 230 107 192 223 108 69 92 112 175 225 237 109 74 209 110 88 150 356 368 111 150 155 366 112 41 215 271 113 49 59 158 202 303 114 56 108 259 115 8 105 187 354 386 116 20 32 46 284 306 117 17 68 80 118 47 104 306 344 119 3 45 164 176 188 256 293 120 14 36 106 230 365 121 55 90 123 265 122 267 123 55 352 124 95 125 2 139 266 126 80 140 158 180 127 16 22 71 169 198 281 128 52 151 158 389 129 68 82 126 140 338 130 133 227 289 345 131 47 104 277 298 132 15 42 207 314 370 133 191 218 227 317 364 134 52 252 336 361 383 135 89 99 335 136 67 82 146 158 161 137 48 50 146 201 290 330 138 29 54 86 95 203 367 139 17 80 125 158 311 140 95 126 180 211 141 107 270 344 142 93 105 115 325 368 143 88 234 248 263 144 106 124 216 384 145 6 373 146 26 204 258 290 327 147 235 148 100 124 206 387 149 51 246 285 377 150 18 111 171 236 151 147 185 213 249 382 152 88 177 183 329 339 153 115 142 325 381 386 154 26 50 163 274 296 388 155 10 11 111 200 156 28 260 331 157 40 48 53 83 94 281 158 113 139 355 365 159 341 376 160 24 170 331 161 310 313 328 380 162 89 101 116 285 306 343 163 1 21 27 122 292 387 164 23 98 119 188 226 256 165 63 174 177 243 273 289 346 166 95 175 332 167 189 227 271 351 372 168 66 191 194 279 364 380 169 53 65 104 127 281 170 15 24 26 42 171 110 111 200 271 172 136 338 343 173 44 99 103 232 326 374 174 243 278 175 95 166 237 259 176 119 253 177 175 182 234 329 339 383 384 178 248 359 179 6 34 145 210 373 180 126 196 211 221 308 181 34 258 346 368 182 231 309 183 26 154 184 29 54 209 185 151 249 296 304 308 370 186 44 77 91 245 286 187 115 178 354 359 188 119 293 189 167 191 312 351 190 88 110 200 215 316 191 25 168 189 194 308 192 141 223 349 193 176 195 253 265 384 194 25 140 191 371 195 193 265 196 25 180 211 308 197 73 145 160 206 331 198 22 93 127 325 199 60 311 322 376 200 10 171 242 244 345 201 363 364 385 202 49 59 113 208 308 203 184 204 58 142 150 236 354 359 205 15 183 296 206 6 73 145 148 333 207 132 272 314 208 32 116 321 209 14 36 213 210 63 165 317 346 211 180 390 212 130 289 366 368 213 90 209 255 214 31 37 85 241 287 296 302 215 112 167 216 120 144 263 217 57 74 87 107 141 344 218 71 279 317 347 364 219 114 139 259 220 307 337 358 221 49 126 180 184 212 308 222 13 345 223 7 107 257 224 24 254 225 22 56 92 226 97 127 164 186 352 227 133 167 242 345 351 228 94 367 229 4 17 43 122 136 278 230 70 120 195 231 3 301 232 99 103 235 319 233 96 128 217 339 234 144 200 384 235 75 147 173 185 304 319 236 58 110 204 350 356 237 69 108 138 238 31 79 214 320 379 239 12 182 231 252 309 383 240 109 160 164 195 297 367 241 287 302 304 242 167 291 316 345 372 243 63 244 13 222 245 77 213 255 286 320 336 246 51 138 147 249 377 247 330 248 88 143 178 216 263 323 348 365 249 185 207 246 310 362 250 69 92 228 276 386 251 2 8 158 299 252 12 239 280 334 253 24 119 176 182 193 316 384 254 50 224 330 388 255 121 123 245 256 23 119 164 176 193 353 257 7 78 258 89 197 247 373 259 108 175 219 254 388 260 250 362 377 261 43 262 101 291 305 332 263 143 144 234 264 53 89 285 294 265 42 55 121 185 353 266 60 184 199 267 84 292 321 268 202 312 358 369 269 18 217 339 270 104 118 271 167 189 215 272 260 314 362 273 9 102 165 181 222 342 274 124 166 216 340 388 275 35 66 168 194 230 328 371 276 115 187 228 250 323 367 277 12 39 104 293 298 324 278 43 136 161 229 279 66 364 389 280 39 134 334 281 22 40 94 157 282 22 56 81 225 283 240 276 297 367 284 46 109 162 285 89 149 162 264 284 294 286 66 379 287 214 238 248 288 311 315 289 13 131 212 222 345 290 146 247 258 330 291 98 188 262 298 292 28 122 163 208 267 293 3 188 298 294 51 149 257 295 8 87 220 296 15 183 205 248 302 297 14 64 240 245 283 323 365 298 47 131 188 262 277 291 299 5 216 251 387 300 7 128 257 307 302 15 185 214 241 304 303 113 337 304 173 185 235 241 302 374 379 305 291 350 306 15 32 47 162 344 307 39 78 128 254 358 389 308 25 77 189 191 202 268 312 309 182 224 383 310 35 328 311 38 63 199 229 288 312 41 268 271 369 313 76 278 318 342 314 132 156 260 272 315 27 38 165 316 200 215 372 317 71 130 212 390 318 30 53 76 83 380 319 75 99 320 35 379 321 292 344 322 122 199 267 288 315 323 187 248 283 297 324 3 277 293 325 93 198 326 44 103 173 186 340 327 27 34 97 258 363 385 328 35 161 275 310 329 88 143 152 177 330 19 24 219 224 247 254 331 73 156 160 332 166 175 259 388 333 88 91 112 152 190 215 339 334 12 277 280 335 61 89 101 135 162 262 336 31 213 238 245 301 320 353 337 59 158 355 358 338 35 82 140 194 343 339 112 128 152 233 269 361 340 37 213 274 341 217 328 376 342 9 165 174 278 343 35 82 344 84 141 159 217 267 270 306 345 227 244 346 165 179 210 347 70 71 127 218 279 348 58 332 359 349 39 62 104 141 160 350 97 262 305 351 122 133 352 123 186 226 268 353 23 55 143 167 256 265 354 111 150 187 359 355 8 220 251 337 356 88 270 287 357 29 86 240 358 59 96 268 389 359 348 360 33 112 361 52 128 134 177 339 362 5 69 207 260 272 363 146 293 364 364 168 191 218 365 14 120 216 237 297 366 10 105 367 86 228 240 276 283 357 368 93 105 366 390 369 41 74 268 343 370 15 132 207 249 371 184 213 301 336 372 215 242 316 373 34 179 197 258 327 374 44 173 379 375 111 220 223 295 376 55 84 85 266 377 20 59 156 260 362 382 378 133 157 379 79 293 380 16 30 66 161 275 313 328 385 381 22 92 198 325 382 20 86 284 285 383 134 239 252 309 361 384 70 72 182 193 234 253 385 201 273 327 363 386 92 381 387 21 27 63 261 388 50 166 254 259 274 332 389 96 128 233 307 390 71 198 212 317
18.703608
34
0.731294
edb29423247505d116e543621d3a1f27bcecdcf1
4,228
pm
Perl
auto-lib/Paws/SageMaker/ListLabelingJobsForWorkteam.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/SageMaker/ListLabelingJobsForWorkteam.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/SageMaker/ListLabelingJobsForWorkteam.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
87
2015-04-22T06:29:47.000Z
2021-09-29T14:45:55.000Z
package Paws::SageMaker::ListLabelingJobsForWorkteam; use Moose; has CreationTimeAfter => (is => 'ro', isa => 'Str'); has CreationTimeBefore => (is => 'ro', isa => 'Str'); has JobReferenceCodeContains => (is => 'ro', isa => 'Str'); has MaxResults => (is => 'ro', isa => 'Int'); has NextToken => (is => 'ro', isa => 'Str'); has SortBy => (is => 'ro', isa => 'Str'); has SortOrder => (is => 'ro', isa => 'Str'); has WorkteamArn => (is => 'ro', isa => 'Str', required => 1); use MooseX::ClassAttribute; class_has _api_call => (isa => 'Str', is => 'ro', default => 'ListLabelingJobsForWorkteam'); class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::SageMaker::ListLabelingJobsForWorkteamResponse'); class_has _result_key => (isa => 'Str', is => 'ro'); 1; ### main pod documentation begin ### =head1 NAME Paws::SageMaker::ListLabelingJobsForWorkteam - Arguments for method ListLabelingJobsForWorkteam on L<Paws::SageMaker> =head1 DESCRIPTION This class represents the parameters used for calling the method ListLabelingJobsForWorkteam on the L<Amazon SageMaker Service|Paws::SageMaker> service. Use the attributes of this class as arguments to method ListLabelingJobsForWorkteam. You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to ListLabelingJobsForWorkteam. =head1 SYNOPSIS my $api.sagemaker = Paws->service('SageMaker'); my $ListLabelingJobsForWorkteamResponse = $api . sagemaker->ListLabelingJobsForWorkteam( WorkteamArn => 'MyWorkteamArn', CreationTimeAfter => '1970-01-01T01:00:00', # OPTIONAL CreationTimeBefore => '1970-01-01T01:00:00', # OPTIONAL JobReferenceCodeContains => 'MyJobReferenceCodeContains', # OPTIONAL MaxResults => 1, # OPTIONAL NextToken => 'MyNextToken', # OPTIONAL SortBy => 'CreationTime', # OPTIONAL SortOrder => 'Ascending', # OPTIONAL ); # Results: my $LabelingJobSummaryList = $ListLabelingJobsForWorkteamResponse->LabelingJobSummaryList; my $NextToken = $ListLabelingJobsForWorkteamResponse->NextToken; # Returns a L<Paws::SageMaker::ListLabelingJobsForWorkteamResponse> 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/api.sagemaker/ListLabelingJobsForWorkteam> =head1 ATTRIBUTES =head2 CreationTimeAfter => Str A filter that returns only labeling jobs created after the specified time (timestamp). =head2 CreationTimeBefore => Str A filter that returns only labeling jobs created before the specified time (timestamp). =head2 JobReferenceCodeContains => Str A filter the limits jobs to only the ones whose job reference code contains the specified string. =head2 MaxResults => Int The maximum number of labeling jobs to return in each page of the response. =head2 NextToken => Str If the result of the previous C<ListLabelingJobsForWorkteam> request was truncated, the response includes a C<NextToken>. To retrieve the next set of labeling jobs, use the token in the next request. =head2 SortBy => Str The field to sort results by. The default is C<CreationTime>. Valid values are: C<"CreationTime"> =head2 SortOrder => Str The sort order for results. The default is C<Ascending>. Valid values are: C<"Ascending">, C<"Descending"> =head2 B<REQUIRED> WorkteamArn => Str The Amazon Resource Name (ARN) of the work team for which you want to see labeling jobs for. =head1 SEE ALSO This class forms part of L<Paws>, documenting arguments for method ListLabelingJobsForWorkteam in L<Paws::SageMaker> =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
32.523077
249
0.693472
73d299d2a17b38445c3162f2994caf5e018ca5ff
7,051
t
Perl
t/09xpath.t
melezhik/LibXML-raku
c5e8dc5e4b1b033b26c802d0ef4562fc57e84279
[ "Artistic-2.0" ]
null
null
null
t/09xpath.t
melezhik/LibXML-raku
c5e8dc5e4b1b033b26c802d0ef4562fc57e84279
[ "Artistic-2.0" ]
null
null
null
t/09xpath.t
melezhik/LibXML-raku
c5e8dc5e4b1b033b26c802d0ef4562fc57e84279
[ "Artistic-2.0" ]
null
null
null
use v6; use Test; plan 66; use LibXML; use LibXML::Document; use LibXML::XPath::Expression; my $xmlstring = q:to<EOSTR>; <foo> <bar> test 1 </bar> <!-- test --> <bar> test 2 </bar> </foo> EOSTR { my $parser = LibXML.new(); my $doc = $parser.parse: :string( $xmlstring ); ok($doc, 'Parsing successful.'); { my @nodes = $doc.findnodes( "/foo/bar" ); is( +@nodes, 2, 'Two bar nodes' ); ok( $doc.isSameNode(@nodes[0].ownerDocument), 'Doc is the same as the owner document.' ); my $compiled = LibXML::XPath::Expression.parse("/foo/bar"); for (1..3) -> $idx { @nodes = $doc.findnodes( $compiled ); is( +@nodes, 2, "Two nodes for /foo/bar - try No. $idx" ); } my $comment = $doc.first('/foo/comment()'); is $comment, '<!-- test -->'; is $comment.xpath-key, 'comment()'; ok( $doc.isSameNode(@nodes[0].ownerDocument), 'Same owner as previous one', ); my $n = $doc.createElement( "foobar" ); my $p = @nodes[1].parentNode; $p.insertBefore( $n, @nodes[1] ); ok( $p.isSameNode( $doc.documentElement ), 'Same as document elem' ); @nodes = $p.childNodes; is( +@nodes, 8, 'Found child nodes' ); } { my $result = $doc.find( "/foo/bar" ); ok( $result, ' TODO : Add test name' ); isa-ok( $result, "LibXML::Node::Set", ' TODO : Add test name' ); skip("numeric on nodes"); is( +$result, 2, ' TODO : Add test name' ); ok( $doc.isSameNode($result.iterator.pull-one.ownerDocument), ' TODO : Add test name' ); $result = $doc.find( LibXML::XPath::Expression.parse("/foo/bar") ); ok( $result, ' TODO : Add test name' ); isa-ok( $result, "LibXML::Node::Set", ' TODO : Add test name' ); skip("numeric on nodes"); is( +$result, 2, ' TODO : Add test name' ); { my $node = $doc.last("/foo/bar"); is $node.find('ancestor-or-self::*').map(*.nodePath).join(','), '/foo,/foo/bar[2]'; is $node.find('ancestor-or-self::*').reverse.map(*.nodePath).join(','), '/foo/bar[2],/foo'; } ok( $doc.isSameNode($result.iterator.pull-one.ownerDocument), ' TODO : Add test name' ); $result = $doc.find( "string(/foo/bar)" ); ok( $result, ' TODO : Add test name' ); ok( $result.isa(Str), ' TODO : Add test name' ); ok( $result ~~ /'test 1'/, ' TODO : Add test name' ); $result = $doc.find( "string(/foo/bar)" ); ok( $result, ' TODO : Add test name' ); ok( $result.isa(Str), ' TODO : Add test name' ); ok( $result.Str ~~ /'test 1'/, ' TODO : Add test name' ); $result = $doc.find( LibXML::XPath::Expression.parse("count(/foo/bar)") ); ok( $result, ' TODO : Add test name' ); todo("returning num64?"); ok( $result.isa( Numeric ), ' TODO : Add test name' ); is( $result, 2, ' TODO : Add test name' ); $result = $doc.find( "contains(/foo/bar[1], 'test 1')" ); ok( $result, ' TODO : Add test name' ); ok( $result.isa( Bool ), ' TODO : Add test name' ); is( $result, True, ' TODO : Add test name' ); $result = $doc.find( LibXML::XPath::Expression.parse("contains(/foo/bar[1], 'test 1')") ); ok( $result, ' TODO : Add test name' ); ok( $result.isa( Bool ), ' TODO : Add test name' ); is( $result, True, ' TODO : Add test name' ); $result = $doc.find( "contains(/foo/bar[3], 'test 1')" ); is( $result, False, ' TODO : Add test name' ); ok( $doc.exists("/foo/bar[2]"), ' TODO : Add test name' ); is( $doc.exists("/foo/bar[3]"), False, ' TODO : Add test name' ); is( $doc.exists("-7.2"), True, ' TODO : Add test name' ); is( $doc.exists("0"), False, ' TODO : Add test name' ); is( $doc.exists("'foo'"), True, ' TODO : Add test name' ); is( $doc.exists("''"), False, ' TODO : Add test name' ); is( $doc.exists("'0'"), True, ' TODO : Add test name' ); my $node = $doc.first("/foo/bar[1]" ); ok( $node, ' TODO : Add test name' ); ok ($node.exists("following-sibling::bar"), ' TODO : Add test name'); } { # test the strange segfault after xpathing my $root = $doc.documentElement(); for ( $root.findnodes( 'bar' ) ) -> $bar { $root.removeChild($bar); } pass(' TODO : Add test name'); # warn $root.toString(); $doc = $parser.parse: :string( $xmlstring ); my @bars = $doc.findnodes( '//bar' ); for @bars -> $node { $node.parentNode().removeChild( $node ); } pass(' TODO : Add test name'); } { my $root = $doc.root; is $root.findvalue('42'), 42; is $root.find('42'), 42; isa-ok $root.findnodes('42'), 'LibXML::Node::Set'; is-deeply $root.first('42'), LibXML::Node; is-deeply $root.last('42'), LibXML::Node; } } { # from Perl 5 #39178 my $p = LibXML.new; my $doc = $p.parse: :file("example/utf-16-2.xml"); ok($doc, ' TODO : Add test name'); my @nodes = $doc.findnodes("/cml/*"); ok (@nodes == 2, ' TODO : Add test name'); is(@nodes[1].textContent, "utf-16 test with umlauts: \x[e4]\x[f6]\x[fc]\x[c4]\x[d6]\x[dc]\x[df]", ' TODO : Add test name'); } { # from Perl #36576 my $p = LibXML.new; my $doc = $p.parse: :html, :file("example/utf-16-1.html"); ok($doc, ' TODO : Add test name'); my @nodes = $doc.findnodes("//p"); ok (@nodes == 1, ' TODO : Add test name'); _utf16_content_test(@nodes, 'nodes content is fine.'); } { # from Perl #36576 my $p = LibXML.new; my $doc = $p.parse: :html, :file("example/utf-16-2.html"); ok($doc, ' TODO : Add test name'); my @nodes = $doc.findnodes("//p"); is(+@nodes, 1, 'Found one p'); _utf16_content_test(@nodes, 'p content is fine.'); } { # from Perl #69096 my $doc = LibXML::Document.createDocument(); my $root = $doc.createElement('root'); $doc.setDocumentElement($root); my $e = $doc.createElement("child"); my $e2 = $doc.createElement("child"); my $t1 = $doc.createTextNode( "te" ); my $t2 = $doc.createTextNode( "st" ); $root.appendChild($e); $root.appendChild($e2); $e2.appendChild($t1); $e2.appendChild($t2); $doc.normalize(); my @cn = $doc.findnodes('//child[text()="test"]'); is( +@cn, 1, 'xpath testing adjacent text nodes' ); } sub _utf16_content_test { my ($nodes_ref, $blurb) = @_; is($nodes_ref[0].textContent, "utf-16 test with umlauts: \x[e4]\x[f6]\x[fc]\x[c4]\x[d6]\x[dc]\x[df]", $blurb, ); } subtest '#42 root parent from xpath', { plan 2; my LibXML::Document $doc .= parse("<root/>"); my LibXML::Document $doc2; lives-ok {$doc2 = .parent for $doc.find("//*");}; ok $doc.isSameNode($doc2); }
31.761261
127
0.519501
ede3510cdf664ed1a196cb25f3c06c2fc7bc8b93
13,178
pm
Perl
lib/Thrust.pm
gitpan/Thrust
82c86c93f49178c5baf11087c4405e0ec1049610
[ "MIT" ]
null
null
null
lib/Thrust.pm
gitpan/Thrust
82c86c93f49178c5baf11087c4405e0ec1049610
[ "MIT" ]
null
null
null
lib/Thrust.pm
gitpan/Thrust
82c86c93f49178c5baf11087c4405e0ec1049610
[ "MIT" ]
null
null
null
package Thrust; use common::sense; our $VERSION = '0.200'; use AnyEvent; use AnyEvent::Util; use AnyEvent::Handle; use JSON::XS; use File::ShareDir; use Scalar::Util; use Alien::Thrust; use Thrust::Window; our $THRUST_BOUNDARY = "\n--(Foo)++__THRUST_SHELL_BOUNDARY__++(Bar)--\n"; my $js; sub debug { my ($level, $msg_cb, $to_dump, $indent) = @_; return if $level > $ENV{THRUST_DEBUG}; $js ||= JSON::XS->new->pretty->canonical; my $out = "\n" . $msg_cb->() . "\n"; $out .= $js->encode($to_dump) . "\n" if $to_dump; $out =~ s/\n/\n /g if $indent; print STDERR $out; } sub new { my ($class, %args) = @_; my $self = { action_id => 10, # start at 10 to make groking protocol a bit easier from debug dumps }; bless $self, $class; my ($fh1, $fh2) = portable_socketpair(); $self->{cv} = run_cmd [ $Alien::Thrust::thrust_shell_binary ], close_all => 1, '>' => $fh2, '<' => $fh2, '2>' => $ENV{THRUST_DEBUG} >= 2 ? \*STDERR : '/dev/null', ## FIXME: /dev/null not portable '$$' => \$self->{pid}; close $fh2; $self->{fh} = $fh1; $self->{hdl} = AnyEvent::Handle->new(fh => $self->{fh}); my $line_handler; $line_handler = sub { my ($hdl, $line) = @_; my $msg = eval { decode_json($line) }; if (defined $msg) { debug(1, sub { "<<<<<<<<<<<<<<<<< Message from thrust shell" }, $msg, 1); if ($msg->{_action} eq 'reply') { my $action_cb = $self->{actions}->{$msg->{_id}}; if ($action_cb) { $action_cb->($msg); } else { warn "reply to unknown request"; } } elsif ($msg->{_action} eq 'event') { my $window = $self->{windows}->{$msg->{_target}}; if ($window) { $window->_trigger($msg->{_type}, $msg->{_event}); } } } $self->{hdl}->push_read(line => $line_handler); }; $self->{hdl}->push_read(line => $line_handler); return $self; } sub run { my ($self) = @_; $self->{cv} = AE::cv; $self->{cv}->recv; } sub do_action { my ($self, $params, $cb) = @_; my $action_id = $self->{action_id}++; $params->{_id} = $action_id; debug(1, sub { "Sending to thrust shell >>>>>>>>>>>>>>>>>" }, $params); $self->{hdl}->push_write(json => $params); $self->{hdl}->push_write($THRUST_BOUNDARY); $self->{actions}->{$action_id} = sub { delete $self->{actions}->{$action_id}; $cb->($_[0]->{_result}); }; } sub window { my ($self, %args) = @_; $self = Thrust->new if !ref $self; ## in case you forget the ->new in one-liners my $window = { thrust => $self, }; bless $window, 'Thrust::Window'; $self->do_action({ '_action' => 'create', '_type' => 'window', '_args' => \%args, }, sub { my $id = $_[0]->{_target}; $window->{target} = $id; $self->{windows}->{$id} = $window; Scalar::Util::weaken $self->{windows}->{$id}; $window->_trigger_event('ready'); }); return $window; } sub DESTROY { my ($self) = @_; kill 'KILL', $self->{pid}; } 1; __END__ =encoding utf-8 =head1 NAME Thrust - Perl bindings to the Thrust cross-platform application framework =head1 SYNOPSIS use Thrust; my $t = Thrust->new; my $w = $t->window( root_url => 'data:text/html,Hello World!', ## or file://, https://, etc title => 'My App', size => { width => 800, height => 600 }, )->show; $t->run; ## enter event loop =head1 DESCRIPTION Thrust is a chromium-based cross-platform and cross-language application framework. It allows you to create "native"-like applications using HTML/CSS for the interface and (of course) perl for the glue code to filesystems, DBs, networking, libraries, and everything else perl is great at. This is the easiest way to install perl-thrust: curl -sL https://raw.github.com/miyagawa/cpanminus/master/cpanm | sudo perl - Thrust Read more about Thrust at its L<official website|https://github.com/breach/thrust>. There are bindings for many other languages such as node.js, go, and python. Like the bindings for other languages, installing the perl module will download a zip file from github which contains the C<thrust_shell> binary. It will extract this into the perl distribution's private share directory. Unlike the bindings for other languages, in the perl ones there are no definitions for individual thrust methods. Instead, an AUTOLOAD is used to automatically "forward" all perl method calls (and their JSON encoded arguments) to the thrust shell. This has the advantage that there is generally no need to do anything to the perl bindings when new methods/parameters are added to the thrust shell. However, it has the disadvantage that sometimes the API is less convenient. For instance, instead of positional arguments in (for example) the C<move> method, you must use the named C<x> and C<y> parameters. Like the bindings in other languages, methods can be invoked on a window object even before the window is created. The methods will be queued up and invoked in order once the window is ready. After that point, all messages are delivered to the window asynchronously. For example, here is a one-liner command to open a maximized window with the dev tools console expanded: $ perl -MThrust -e 'Thrust->window->show->maximize->open_devtools->run' To understand how the above works, consider that the perl bindings also support some one-liner shortcuts such as method chaining, an implicit C<Thrust> context created by C<window>, and a C<run> method on the window. =head1 ASYNC PROGRAMMING Like browser programming itself, programming the perl side of a Thrust application is done asynchronously. The Thrust package depends on L<AnyEvent> for this purpose so you can use whichever event loop you prefer. See the L<AnyEvent> documentation for details on asynchronous programming. The C<run> methods of the Thrust context/window objects simply wait on a condition variable that will never be signalled (well you can if you want to, it's in C<< $t->{cv} >>) in order to enter the event loop and "sleep forever". C<run> is mostly there so you don't need to type C<< use AnyEvent; AE::cv->recv >> in simple scripts/examples. Almost all methods on the window object can optionally take a callback argument that will be called once the operation has been completed. For example: $w->maximize(sub { say "window has been maximized" }); If present, the callback must be the final argument. For methods that require parameters, the parameters must be in a hash-ref preceeding the (optional) callback: $w->resize({ width => 100, height => 100 }, sub { say "window has been resized" }); =head1 EVENT HANDLERS Window objects have an C<on> method which allows you to append a callback to be invoked when a particular event is triggered. For example, normally closing a window will not cause the termination of your perl program. Instead, the C<closed> event will be triggered. By default nothing is listening for this event so it is discarded. If you want you can make the closing of one or more windows terminate your perl program as well (which in turn kills all the other windows this process has started): $window->on(closed => sub { exit }); If you ever wish to remove handlers for an event, window objects also have a C<clear> method: $window->clear('closed'); See the thrust API docs for information on the potential events and actions. To snoop on the event traffic to and from the thrust shell, set the environment variable C<THRUST_DEBUG> to C<1> or higher. Set it to C<2> or higher to also see the standard error debugging output from the C<thrust_shell> process. Here is a simple example of the traffic when you create and show a window: $ THRUST_DEBUG=1 perl -MThrust -e 'Thrust->new->window->show->run' Sending to thrust shell >>>>>>>>>>>>>>>>> { "_action" : "create", "_args" : {}, "_id" : 10, "_type" : "window" } <<<<<<<<<<<<<<<<< Message from thrust shell { "_action" : "reply", "_error" : "", "_id" : 10, "_result" : { "_target" : 1 } } Sending to thrust shell >>>>>>>>>>>>>>>>> { "_action" : "call", "_args" : null, "_id" : 11, "_method" : "show", "_target" : 1 } <<<<<<<<<<<<<<<<< Message from thrust shell { "_action" : "reply", "_error" : "", "_id" : 11, "_result" : {} } <<<<<<<<<<<<<<<<< Message from thrust shell { "_action" : "event", "_event" : {}, "_id" : 1, "_target" : 1, "_type" : "focus" } =head1 REMOTE EVENTS One of the most useful features of thrust is its support for bi-directional messaging between your application and the browser over pipes connecting to the thrust shell's stdin/stdout. Without this support we would need to allocate some kind of network port or unix socket file and start something like an AJAX or websocket server. In order for the browser to send a message to your perl code, it should execute something like the following javascript code: THRUST.remote.send({ foo: 'bar' }); // send message to perl On the perl side, you will need to install an event handler for the C<remote> event by calling the C<on> method of a window object: $w->on('remote', sub { my $msg = $_[0]->{message}; print $msg->{foo}; # prints bar }); In order to send a message from perl to the browser, call the C<remote> method on a window object: $w->remote({ message => { foo => 'bar' } }); On the javascript side, you will need to install a handler like so: THRUST.remote.listen(function(msg) { console.log(msg['foo']); // prints bar }); B<IMPORTANT NOTE>: Before applications can send messages from perl to javascript, the C<THRUST.remote.listen> function must have been called. If you try to send a message before this, it is likely that the message will be delivered to the browser before the handler has been installed so your message will be lost. Applications should make javascript send a message indicating that the communication channel is ready to indicate to the perl component that it can begin sending messages to the browser. =head1 TESTS Currently this software has two tests, C<load.t> that verifies L<Thrust> is installed and C<remote.t> which starts and shows the thrust shell, then proceeds to confirm bi-directional transfer of messages between javascript and perl. Maybe the test-suite shouldn't show a window by default? =head1 BUGS Haha this software is so beta. I've only tested this so far on 64-bit linux so the cross-platform claim is theoretical. Only the window object is currently exposed. Eventually the window code should be refactored into a base class so that session and menu can be implemented as well (as done in the node.js bindings). Add a test that verifies C<thrust_shell> is killed when your program exits or is killed. The perl bindings don't report errors from the thrust shell properly to your code yet. Eventually I think they should use L<Callback::Frame>. Actually C<thrust_shell> doesn't have great error checking itself. Any error messages like the following probably indicate that you passed in some malformed argument and terminated the thrust_shell abnormally: AnyEvent::Handle uncaught error: Broken pipe at /usr/local/lib/perl/5.18.2/AnyEvent/Loop.pm line 248. The fact that C<thrust_shell> binaries are duplicated for every language binding is good and bad: depending on how backwards compatible everything is, duplication may be necessary because of protocol changes. It's bad in that you can't immediately apply bug-fixes to all copies of C<thrust_shell> on your system. =head1 SEE ALSO L<The Thrust perl module github repo|https://github.com/hoytech/Thrust> L<Alien::Thrust> L<The Thrust project|https://github.com/breach/thrust> - Official website L<The node.js Thrust bindings|https://github.com/breach/node-thrust/> - These are the most complete bindings =head1 AUTHOR Doug Hoyte, C<< <doug@hcsw.org> >> =head1 COPYRIGHT & LICENSE Copyright 2014 Doug Hoyte. This module is licensed under the same terms as perl itself. Thrust itself is Copyright (c) 2014 Stanislas Polu and is licensed under the MIT license. =cut {"_id":1,"_action":"create","_type":"window","_args":{"root_url":"http://google.com"}} --(Foo)++__THRUST_SHELL_BOUNDARY__++(Bar)-- {"_action":"reply","_error":"","_id":1,"_result":{"_target":1}} --(Foo)++__THRUST_SHELL_BOUNDARY__++(Bar)-- {"_id":2,"_action":"call","_target":1,"_method":"show","_args":{}} --(Foo)++__THRUST_SHELL_BOUNDARY__++(Bar)--
36.30303
605
0.649492
ed9b5961aeeb1534db8cb495133b471f53a34bdc
2,245
pm
Perl
auto-lib/Paws/ApiGateway/DeleteAuthorizer.pm
galenhuntington/aws-sdk-perl
13b775dcb5f0b3764f0a82f3679ed5c7721e67d3
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/ApiGateway/DeleteAuthorizer.pm
galenhuntington/aws-sdk-perl
13b775dcb5f0b3764f0a82f3679ed5c7721e67d3
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/ApiGateway/DeleteAuthorizer.pm
galenhuntington/aws-sdk-perl
13b775dcb5f0b3764f0a82f3679ed5c7721e67d3
[ "Apache-2.0" ]
null
null
null
package Paws::ApiGateway::DeleteAuthorizer; use Moose; has AuthorizerId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'authorizer_id', required => 1); has RestApiId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'restapi_id', required => 1); use MooseX::ClassAttribute; class_has _api_call => (isa => 'Str', is => 'ro', default => 'DeleteAuthorizer'); class_has _api_uri => (isa => 'Str', is => 'ro', default => '/restapis/{restapi_id}/authorizers/{authorizer_id}'); class_has _api_method => (isa => 'Str', is => 'ro', default => 'DELETE'); class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::API::Response'); 1; ### main pod documentation begin ### =head1 NAME Paws::ApiGateway::DeleteAuthorizer - Arguments for method DeleteAuthorizer on L<Paws::ApiGateway> =head1 DESCRIPTION This class represents the parameters used for calling the method DeleteAuthorizer on the L<Amazon API Gateway|Paws::ApiGateway> service. Use the attributes of this class as arguments to method DeleteAuthorizer. You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to DeleteAuthorizer. =head1 SYNOPSIS my $apigateway = Paws->service('ApiGateway'); $apigateway->DeleteAuthorizer( AuthorizerId => 'MyString', RestApiId => 'MyString', ); 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://aws.amazon.com/documentation/apigateway/> =head1 ATTRIBUTES =head2 B<REQUIRED> AuthorizerId => Str [Required] The identifier of the Authorizer resource. =head2 B<REQUIRED> RestApiId => Str [Required] The string identifier of the associated RestApi. =head1 SEE ALSO This class forms part of L<Paws>, documenting arguments for method DeleteAuthorizer in L<Paws::ApiGateway> =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
32.536232
249
0.714922
edc673db06230f7cfeb3b8491b57e99704923170
6,997
pl
Perl
msys64/usr/share/perl5/core_perl/unicore/lib/Gc/Lu.pl
andresfaagit/sg-desarrollo-ruby
2c9bc5dad657d9713cc0f7fc4e883a85b83537e5
[ "Ruby" ]
9
2018-04-19T05:08:30.000Z
2021-11-23T07:36:58.000Z
msys64/usr/share/perl5/core_perl/unicore/lib/Gc/Lu.pl
andresfaagit/sg-desarrollo-ruby
2c9bc5dad657d9713cc0f7fc4e883a85b83537e5
[ "Ruby" ]
98
2017-11-02T19:00:44.000Z
2022-03-22T16:15:39.000Z
msys64/usr/share/perl5/core_perl/unicore/lib/Gc/Lu.pl
andresfaagit/sg-desarrollo-ruby
2c9bc5dad657d9713cc0f7fc4e883a85b83537e5
[ "Ruby" ]
9
2017-10-24T21:53:36.000Z
2021-11-23T07:36:59.000Z
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! # This file is machine-generated by lib/unicore/mktables from the Unicode # database, Version 12.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. Use Unicode::UCD to access the Unicode character data # base. return <<'END'; V1272 65 91 192 215 216 223 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 378 379 380 381 382 385 387 388 389 390 392 393 396 398 402 403 405 406 409 412 414 415 417 418 419 420 421 422 424 425 426 428 429 430 432 433 436 437 438 439 441 444 445 452 453 455 456 458 459 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 497 498 500 501 502 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 570 572 573 575 577 578 579 583 584 585 586 587 588 589 590 591 880 881 882 883 886 887 895 896 902 903 904 907 908 909 910 912 913 930 931 940 975 976 978 981 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1012 1013 1015 1016 1017 1019 1021 1072 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1329 1367 4256 4294 4295 4296 4301 4302 5024 5110 7312 7355 7357 7360 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7944 7952 7960 7966 7976 7984 7992 8000 8008 8014 8025 8026 8027 8028 8029 8030 8031 8032 8040 8048 8120 8124 8136 8140 8152 8156 8168 8173 8184 8188 8450 8451 8455 8456 8459 8462 8464 8467 8469 8470 8473 8478 8484 8485 8486 8487 8488 8489 8490 8494 8496 8500 8510 8512 8517 8518 8579 8580 11264 11311 11360 11361 11362 11365 11367 11368 11369 11370 11371 11372 11373 11377 11378 11379 11381 11382 11390 11393 11394 11395 11396 11397 11398 11399 11400 11401 11402 11403 11404 11405 11406 11407 11408 11409 11410 11411 11412 11413 11414 11415 11416 11417 11418 11419 11420 11421 11422 11423 11424 11425 11426 11427 11428 11429 11430 11431 11432 11433 11434 11435 11436 11437 11438 11439 11440 11441 11442 11443 11444 11445 11446 11447 11448 11449 11450 11451 11452 11453 11454 11455 11456 11457 11458 11459 11460 11461 11462 11463 11464 11465 11466 11467 11468 11469 11470 11471 11472 11473 11474 11475 11476 11477 11478 11479 11480 11481 11482 11483 11484 11485 11486 11487 11488 11489 11490 11491 11499 11500 11501 11502 11506 11507 42560 42561 42562 42563 42564 42565 42566 42567 42568 42569 42570 42571 42572 42573 42574 42575 42576 42577 42578 42579 42580 42581 42582 42583 42584 42585 42586 42587 42588 42589 42590 42591 42592 42593 42594 42595 42596 42597 42598 42599 42600 42601 42602 42603 42604 42605 42624 42625 42626 42627 42628 42629 42630 42631 42632 42633 42634 42635 42636 42637 42638 42639 42640 42641 42642 42643 42644 42645 42646 42647 42648 42649 42650 42651 42786 42787 42788 42789 42790 42791 42792 42793 42794 42795 42796 42797 42798 42799 42802 42803 42804 42805 42806 42807 42808 42809 42810 42811 42812 42813 42814 42815 42816 42817 42818 42819 42820 42821 42822 42823 42824 42825 42826 42827 42828 42829 42830 42831 42832 42833 42834 42835 42836 42837 42838 42839 42840 42841 42842 42843 42844 42845 42846 42847 42848 42849 42850 42851 42852 42853 42854 42855 42856 42857 42858 42859 42860 42861 42862 42863 42873 42874 42875 42876 42877 42879 42880 42881 42882 42883 42884 42885 42886 42887 42891 42892 42893 42894 42896 42897 42898 42899 42902 42903 42904 42905 42906 42907 42908 42909 42910 42911 42912 42913 42914 42915 42916 42917 42918 42919 42920 42921 42922 42927 42928 42933 42934 42935 42936 42937 42938 42939 42940 42941 42942 42943 42946 42947 42948 42951 65313 65339 66560 66600 66736 66772 68736 68787 71840 71872 93760 93792 119808 119834 119860 119886 119912 119938 119964 119965 119966 119968 119970 119971 119973 119975 119977 119981 119982 119990 120016 120042 120068 120070 120071 120075 120077 120085 120086 120093 120120 120122 120123 120127 120128 120133 120134 120135 120138 120145 120172 120198 120224 120250 120276 120302 120328 120354 120380 120406 120432 120458 120488 120513 120546 120571 120604 120629 120662 120687 120720 120745 120778 120779 125184 125218 END
5.436674
77
0.796055
ede0d45c2fffcf353ca32bb9e5ffa5efb767150a
5,672
pm
Perl
lib/Photonic/WE/R2/Green.pm
mohawk2/Photonic
d060f2b76d2805f6285d8b3ac92f61bf9186ee5d
[ "Artistic-1.0" ]
null
null
null
lib/Photonic/WE/R2/Green.pm
mohawk2/Photonic
d060f2b76d2805f6285d8b3ac92f61bf9186ee5d
[ "Artistic-1.0" ]
null
null
null
lib/Photonic/WE/R2/Green.pm
mohawk2/Photonic
d060f2b76d2805f6285d8b3ac92f61bf9186ee5d
[ "Artistic-1.0" ]
null
null
null
package Photonic::WE::R2::Green; $Photonic::WE::R2::Green::VERSION = '0.015'; =encoding UTF-8 =head1 NAME Photonic::WE::R2::Green =head1 VERSION version 0.015 =head1 COPYRIGHT NOTICE Photonic - A perl package for calculations on photonics and metamaterials. Copyright (C) 2016 by W. Luis Mochán 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 1, 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 General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA mochan@fis.unam.mx Instituto de Ciencias Físicas, UNAM Apartado Postal 48-3 62251 Cuernavaca, Morelos México =cut =head1 SYNOPSIS use Photonic::WE::R2::Green; my $G=Photonic::WE::R2::Green->new(metric=>$m, nh=>$nh); my $GreenTensor=$G->evaluate($epsB); =head1 DESCRIPTION Calculates the retarded green's tensor for a given fixed Photonic::WE::R2::Metric structure as a function of the dielectric functions of the components. Includes the antysimmetric part, unless it is not desired. =head1 METHODS =over 4 =item * new(metric=>$m, nh=>$nh, smallH=>$smallH, smallE=>$smallE, symmetric=>$s, keepStates=>$k) Initializes the structure. $m Photonic::WE::R2::Metric describing the structure and some parametres. $nh is the maximum number of Haydock coefficients to use. $smallH and $smallE are the criteria of convergence (default 1e-7) for Haydock coefficients and continued fraction $s flags that you only want the symmetric part of the Green's tensor $k is a flag to keep states in Haydock calculations (default 0) =item * evaluate($epsB) Returns the macroscopic Green's operator for a given value of the dielectric functions of the particle $epsB. The host's response $epsA is taken from the metric. =back =head1 ACCESSORS (read only) =over 4 =item * keepStates Value of flag to keep Haydock states =item * epsA Dielectric function of component A =item * epsB Dielectric function of componente B =item * u Spectral variable =item * haydock Array of Photonic::WE::R2::AllH structures, one for each polarization =item * greenP Array of Photonic::WE::R2::GreenP structures, one for each direction. =item * greenTensor The Green's tensor of the last evaluation =item * nh The maximum number of Haydock coefficients to use. =item * nhActual The actual number of Haydock coefficients used in the last calculation =item * converged Flags that the last calculation converged before using up all coefficients =item * smallH, smallE Criteria of convergence of Haydock coefficients and continued fraction. 0 means don't check. =back =cut use namespace::autoclean; use PDL::Lite; use PDL::NiceSlice; use PDL::Complex; use Storable qw(dclone); use Photonic::WE::R2::AllH; use Photonic::WE::R2::GreenP; use Photonic::Types; use Moose; use MooseX::StrictConstructor; extends 'Photonic::WE::R2::GreenS'; has 'cHaydock' =>( is=>'ro', isa=>'ArrayRef[Photonic::WE::R2::AllH]', init_arg=>undef, lazy=>1, builder=>'_build_cHaydock', documentation=>'Array of Haydock calculators for complex projection'); has 'cGreenP'=>( is=>'ro', isa=>'ArrayRef[Photonic::WE::R2::GreenP]', init_arg=>undef, lazy=>1, builder=>'_build_cGreenP', documentation=>'Array of projected G calculators for complex projection'); has 'symmetric' => ( is=>'ro', required=>1, default=>0, documentation=>'Flags only symmetric part required'); around 'evaluate' => sub { my $orig=shift; my $self=shift; my $epsB=shift; my $sym=$self->$orig($epsB); #That's all unless you want the anstisymmetric part return $sym if $self->symmetric; my @greenPc; #array of Green's projections along complex directions. my $converged=$self->converged; foreach(@{$self->cGreenP}){ push @greenPc, $_->evaluate($epsB); $converged &&=$_->converged; } $self->_converged($converged); my $nd=$self->geometry->B->ndims; my $asy=$sym->zeroes->complex; #ri,xy,xy, 2x$ndx$nd my @cpairs=@{$self->geometry->cUnitPairs}; my $m=0; for my $i(0..$nd-2){ for my $j($i+1..$nd-1){ my $pair=$cpairs[$m]; #$asy is ri,xy,xy. First index is column $asy(:,($i), ($j)).=i*( $greenPc[$m]- ($pair->Cconj->(:,*1,:) #ri, column, row *$pair->(:,:,*1) *$sym)->sumover->sumover ); #ri $asy(:,($j), ($i)).=-$asy(:,($i),($j)); $m++ } } #print $asy, "\n"; my $greenTensor= $sym+$asy; $self->_greenTensor($greenTensor); return $greenTensor; }; sub _build_cHaydock { # One Haydock coefficients calculator per complex polarization my $self=shift; my @cHaydock; foreach(@{$self->geometry->cUnitPairs}){ my $m=dclone($self->metric); #clone metric, to be safe my $e=$_; #polarization #Build a corresponding Photonic::WE::R2::AllH structure my $chaydock=Photonic::WE::R2::AllH->new( metric=>$m, polarization=>$e, nh=>$self->nh, keepStates=>$self->keepStates, smallH=>$self->smallH); push @cHaydock, $chaydock; } return [@cHaydock] } sub _build_cGreenP { my $self=shift; [ map Photonic::WE::R2::GreenP->new(haydock=>$_, nh=>$self->nh, smallE=>$self->smallE), @{$self->cHaydock} ]; } __PACKAGE__->meta->make_immutable; 1; __END__
24.66087
113
0.696932
ed7cbb7441c94ec8ccc008eae68c0a2e9602dc49
4,328
pm
Perl
PerlMagick/quantum/quantum.pm
tkgmnimmo/ImageMagick
e360e8b1201fdd072c53519039dd6d9726f6b683
[ "ImageMagick" ]
1
2019-10-20T16:38:36.000Z
2019-10-20T16:38:36.000Z
PerlMagick/quantum/quantum.pm
tkgmnimmo/ImageMagick
e360e8b1201fdd072c53519039dd6d9726f6b683
[ "ImageMagick" ]
11
2017-12-16T19:45:47.000Z
2018-01-23T22:31:37.000Z
PerlMagick/quantum/quantum.pm
tkgmnimmo/ImageMagick
e360e8b1201fdd072c53519039dd6d9726f6b683
[ "ImageMagick" ]
1
2020-11-07T08:01:06.000Z
2020-11-07T08:01:06.000Z
package Image::Magick::Q16HDRI; # Copyright 1999-2020 ImageMagick Studio LLC, a non-profit organization # dedicated to making software imaging solutions freely available. # # You may not use this file except in compliance with the License. You may # obtain a copy of the License at # # https://imagemagick.org/script/license.php # # 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. # # Initial version, written by Kyle Shorter. use strict; use Carp; use vars qw($VERSION @ISA @EXPORT $AUTOLOAD); require 5.002; require Exporter; require DynaLoader; require AutoLoader; @ISA = qw(Exporter DynaLoader); # Items to export into callers namespace by default. Note: do not export # names by default without a very good reason. Use EXPORT_OK instead. # Do not simply export all your public functions/methods/constants. @EXPORT = qw( Success Transparent Opaque QuantumDepth QuantumRange MaxRGB WarningException ResourceLimitWarning TypeWarning OptionWarning DelegateWarning MissingDelegateWarning CorruptImageWarning FileOpenWarning BlobWarning StreamWarning CacheWarning CoderWarning ModuleWarning DrawWarning ImageWarning XServerWarning RegistryWarning ConfigureWarning ErrorException ResourceLimitError TypeError OptionError DelegateError MissingDelegateError CorruptImageError FileOpenError BlobError StreamError CacheError CoderError ModuleError DrawError ImageError XServerError RegistryError ConfigureError FatalErrorException ); $VERSION = '7.0.9'; sub AUTOLOAD { # This AUTOLOAD is used to 'autoload' constants from the constant() # XS function. If a constant is not found then control is passed # to the AUTOLOAD in AutoLoader. no warnings; my $constname; ($constname = $AUTOLOAD) =~ s/.*:://; die "&${AUTOLOAD} not defined. The required ImageMagick libraries are not installed or not installed properly.\n" if $constname eq 'constant'; my $val = constant($constname, @_ ? $_[0] : 0); if ($! != 0) { if ($! =~ /Invalid/) { $AutoLoader::AUTOLOAD = $AUTOLOAD; goto &AutoLoader::AUTOLOAD; } else { my($pack,$file,$line) = caller; die "Your vendor has not defined PerlMagick macro $pack\:\:$constname, used at $file line $line.\n"; } } eval "sub $AUTOLOAD { $val }"; goto &$AUTOLOAD; } bootstrap Image::Magick::Q16HDRI $VERSION; # Preloaded methods go here. sub new { my $this = shift; my $class = ref($this) || $this || "Image::Magick::Q16HDRI"; my $self = [ ]; bless $self, $class; $self->set(@_) if @_; return $self; } sub New { my $this = shift; my $class = ref($this) || $this || "Image::Magick::Q16HDRI"; my $self = [ ]; bless $self, $class; $self->set(@_) if @_; return $self; } # Autoload methods go after =cut, and are processed by the autosplit program. END { UNLOAD () }; 1; __END__ =head1 NAME Image::Magick::Q16HDRI - objected-oriented Perl interface to ImageMagick (Q16HDRI). Use it to create, edit, compose, or convert bitmap images from within a Perl script. =head1 SYNOPSIS use Image::Magick::Q16HDRI; $p = new Image::Magick::Q16HDRI; $p->Read("imagefile"); $p->Set(attribute => value, ...) ($a, ...) = $p->Get("attribute", ...) $p->routine(parameter => value, ...) $p->Mogrify("Routine", parameter => value, ...) $p->Write("filename"); =head1 DESCRIPTION This Perl extension allows the reading, manipulation and writing of a large number of image file formats using the ImageMagick library. It was originally developed to be used by CGI scripts for Web pages. A web page has been set up for this extension. See: file:///usr/local/share/doc/ImageMagick-7/www/perl-magick.html https://imagemagick.org/script/perl-magick.php If you have problems, go to https://imagemagick.org/discourse-server/viewforum.php?f=7 =head1 AUTHOR Kyle Shorter magick-users@imagemagick.org =head1 BUGS Has all the bugs of ImageMagick and much, much more! =head1 SEE ALSO perl(1). =cut
29.643836
168
0.703789
ede3e726642b37daef607c43dbfed7e7da76948e
1,665
pm
Perl
auto-lib/Paws/DirectConnect/DeleteConnection.pm
agimenez/aws-sdk-perl
9c4dff7d1af2ff0210c28ca44fb9e92bc625712b
[ "Apache-2.0" ]
2
2016-09-22T09:18:33.000Z
2017-06-20T01:36:58.000Z
auto-lib/Paws/DirectConnect/DeleteConnection.pm
cah-rfelsburg/paws
de9ffb8d49627635a2da588066df26f852af37e4
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/DirectConnect/DeleteConnection.pm
cah-rfelsburg/paws
de9ffb8d49627635a2da588066df26f852af37e4
[ "Apache-2.0" ]
null
null
null
package Paws::DirectConnect::DeleteConnection; use Moose; has ConnectionId => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'connectionId' , required => 1); use MooseX::ClassAttribute; class_has _api_call => (isa => 'Str', is => 'ro', default => 'DeleteConnection'); class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::DirectConnect::Connection'); class_has _result_key => (isa => 'Str', is => 'ro'); 1; ### main pod documentation begin ### =head1 NAME Paws::DirectConnect::DeleteConnection - Arguments for method DeleteConnection on Paws::DirectConnect =head1 DESCRIPTION This class represents the parameters used for calling the method DeleteConnection on the AWS Direct Connect service. Use the attributes of this class as arguments to method DeleteConnection. You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to DeleteConnection. As an example: $service_obj->DeleteConnection(Att1 => $value1, Att2 => $value2, ...); 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. =head1 ATTRIBUTES =head2 B<REQUIRED> ConnectionId => Str =head1 SEE ALSO This class forms part of L<Paws>, documenting arguments for method DeleteConnection in L<Paws::DirectConnect> =head1 BUGS and CONTRIBUTIONS The source code is located here: https://github.com/pplu/aws-sdk-perl Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues =cut
30.272727
249
0.735135
73dc6293ae2c40416e200eb1c4591ca0012616fc
127
pm
Perl
local/lib/perl5/URI/nntp.pm
rosiro/wasarabi
1016fb3a612fc4da3761c53c73473dd113a578d3
[ "MIT" ]
null
null
null
local/lib/perl5/URI/nntp.pm
rosiro/wasarabi
1016fb3a612fc4da3761c53c73473dd113a578d3
[ "MIT" ]
null
null
null
local/lib/perl5/URI/nntp.pm
rosiro/wasarabi
1016fb3a612fc4da3761c53c73473dd113a578d3
[ "MIT" ]
null
null
null
package URI::nntp; # draft-gilman-news-url-01 use strict; use warnings; our $VERSION = "1.69"; use parent 'URI::news'; 1;
11.545455
46
0.661417
ede706be0b22b3079048463b8d6e152130952d82
1,848
pl
Perl
phage_tree/color.pl
linsalrob/bioinformatics
da250531fdc3b0e5d6be0ac44d7874fa201f92b0
[ "MIT" ]
null
null
null
phage_tree/color.pl
linsalrob/bioinformatics
da250531fdc3b0e5d6be0ac44d7874fa201f92b0
[ "MIT" ]
null
null
null
phage_tree/color.pl
linsalrob/bioinformatics
da250531fdc3b0e5d6be0ac44d7874fa201f92b0
[ "MIT" ]
1
2020-03-07T07:15:51.000Z
2020-03-07T07:15:51.000Z
#!/usr/bin/perl -w # Copyright 2001, 20002 Rob Edwards # For updates, more information, or to discuss the scripts # please contact Rob Edwards at redwards@utmem.edu or via http://www.salmonella.org/ # # This file is part of The Phage Proteome Scripts developed by Rob Edwards. # # Tnese scripts are free software; you can redistribute and/or modify # them 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. # # They are distributed in the hope that they 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 # in the file (COPYING) along with these scripts; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # $color{'Tectiviridae'} = "#000FF"; $color{'Leviviridae'} = "#B22222"; $color{'Plasmaviridae'} = "#9932CC"; $color{'Inoviridae'} = "#32CD32"; $color{'Fuselloviridae'} = "#FF7F50"; $color{'Corticoviridae'} = "#006400"; $color{'Myoviridae'} = "#778899"; $color{'Podoviridae'} = "#FF0000"; $color{'Microviridae'} = "#B8860B"; $color{'Siphoviridae'} = "#20B2AA"; while (<>) { unless ($firstline) {unless (/html/) {print "<html><head><title>Phage tree</title></head><body>\n<pre>\n"} $firstline=1} foreach $key (keys %color) { if (/$key/) {s/^/<font color=\"$color{$key}\">/; s/$/<\/font>/} } print; } print "\n\n<p><p><hr><p><p>\n\nCOLOR CODES:\n<p>\n"; foreach $key (sort {$a cmp $b} keys %color) {print "<font color=\"$color{$key}\">$key</font><br>\n"} print "</pre></body></html>\n";
34.222222
121
0.667749
ed4201093d9de98c0727468c65d4403d8be091c5
549
t
Perl
package/support/help/Examples/characters.t
null-dev/Hyper
63ec4bb2b517e482318ff67724537c9799ad22aa
[ "MIT" ]
null
null
null
package/support/help/Examples/characters.t
null-dev/Hyper
63ec4bb2b517e482318ff67724537c9799ad22aa
[ "MIT" ]
null
null
null
package/support/help/Examples/characters.t
null-dev/Hyper
63ec4bb2b517e482318ff67724537c9799ad22aa
[ "MIT" ]
null
null
null
% The "characters" program. setscreen ("graphics:502;519") %setscreen ("msdos") for i : 0 .. 31 for j : 0 .. 224 by 32 var c : int := i + j if c = 0 or c = 8 or c = 9 or c = 10 then c := 1 end if put i + j : 3, " " .. put chr (c) .. if j not= 224 then put " " .. end if end for if i not= 31 then put "" end if end for % Draw Lines for i : 0 .. 7 var x := i * 64 if i > 3 then x -= 3 end if drawbox (x, 4, i * 64 + 48, maxy, black) drawline (i * 64 + 26, 4, i * 64 + 26, maxy, black) end for
18.3
55
0.497268
edd971a67c734d6397f0f43cb54e4e04d6c0ee68
34,051
t
Perl
t/select/01_statement.t
sakamossan/SQL-Maker
1ec4c7dd2f8b192d3b4df30e0cc44b5a093c725a
[ "Artistic-1.0" ]
10
2015-01-28T03:01:48.000Z
2021-03-01T15:38:32.000Z
t/select/01_statement.t
sakamossan/SQL-Maker
1ec4c7dd2f8b192d3b4df30e0cc44b5a093c725a
[ "Artistic-1.0" ]
5
2016-08-10T06:12:17.000Z
2021-02-20T13:16:24.000Z
t/select/01_statement.t
sakamossan/SQL-Maker
1ec4c7dd2f8b192d3b4df30e0cc44b5a093c725a
[ "Artistic-1.0" ]
7
2015-05-01T16:44:43.000Z
2020-12-27T06:42:32.000Z
use strict; use warnings; use SQL::Maker::Select; use Test::More; use Test::Requires 'Tie::IxHash'; sub ordered_hashref { tie my %params, Tie::IxHash::, @_; return \%params; } subtest 'PREFIX' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { subtest 'simple' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_select('*'); $stmt->add_from('foo'); is($stmt->as_sql, "SELECT *\nFROM `foo`"); }; subtest 'SQL_CALC_FOUND_ROWS' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->prefix('SELECT SQL_CALC_FOUND_ROWS '); $stmt->add_select('*'); $stmt->add_from('foo'); is($stmt->as_sql, "SELECT SQL_CALC_FOUND_ROWS *\nFROM `foo`"); }; }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { subtest 'simple' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ }); $stmt->add_select('*'); $stmt->add_from('foo'); is($stmt->as_sql, "SELECT * FROM foo"); }; subtest 'SQL_CALC_FOUND_ROWS' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->prefix('SELECT SQL_CALC_FOUND_ROWS '); $stmt->add_select('*'); $stmt->add_from('foo'); is($stmt->as_sql, "SELECT SQL_CALC_FOUND_ROWS * FROM foo"); }; }; }; subtest 'FROM' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { subtest 'single' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_from('foo'); is($stmt->as_sql, "FROM `foo`"); }; subtest 'multi' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_from( 'foo' ); $stmt->add_from( 'bar' ); is($stmt->as_sql, "FROM `foo`, `bar`"); }; subtest 'multi + alias' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_from( 'foo' => 'f' ); $stmt->add_from( 'bar' => 'b' ); is($stmt->as_sql, "FROM `foo` `f`, `bar` `b`"); }; }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { subtest 'single' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_from('foo'); is($stmt->as_sql, "FROM foo"); }; subtest 'multi' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, , new_line => q{ } ); $stmt->add_from( 'foo' ); $stmt->add_from( 'bar' ); is($stmt->as_sql, "FROM foo, bar"); }; subtest 'multi + alias' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, , new_line => q{ } ); $stmt->add_from( 'foo' => 'f' ); $stmt->add_from( 'bar' => 'b' ); is($stmt->as_sql, "FROM foo f, bar b"); }; }; }; subtest 'JOIN' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { subtest 'inner join' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_join( foo => { type => 'inner', table => 'baz', } ); is($stmt->as_sql, "FROM `foo` INNER JOIN `baz`"); }; subtest 'inner join with condition' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_join( foo => { type => 'inner', table => 'baz', condition => 'foo.baz_id = baz.baz_id' } ); is($stmt->as_sql, "FROM `foo` INNER JOIN `baz` ON foo.baz_id = baz.baz_id"); }; subtest 'from and inner join with condition' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_from( 'bar' ); $stmt->add_join( foo => { type => 'inner', table => 'baz', condition => 'foo.baz_id = baz.baz_id' } ); is($stmt->as_sql, "FROM `foo` INNER JOIN `baz` ON foo.baz_id = baz.baz_id, `bar`"); }; subtest 'inner join with hash condition' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_join( foo => { type => 'inner', table => 'baz', condition => {'foo.baz_id' => 'baz.baz_id'}, } ); is($stmt->as_sql, "FROM `foo` INNER JOIN `baz` ON `foo`.`baz_id` = `baz`.`baz_id`"); }; subtest 'inner join with hash condition with multi keys' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_join( foo => { type => 'inner', table => 'baz', condition => ordered_hashref( 'foo.baz_id' => 'baz.baz_id', 'foo.status' => 'baz.status', ), } ); is($stmt->as_sql, "FROM `foo` INNER JOIN `baz` ON `foo`.`baz_id` = `baz`.`baz_id` AND `foo`.`status` = `baz`.`status`"); }; subtest 'test case for bug found where add_join is called twice' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_join( foo => { type => 'inner', table => 'baz', alias => 'b1', condition => 'foo.baz_id = b1.baz_id AND b1.quux_id = 1' }, ); $stmt->add_join( foo => { type => 'left', table => 'baz', alias => 'b2', condition => 'foo.baz_id = b2.baz_id AND b2.quux_id = 2' }, ); is $stmt->as_sql, "FROM `foo` INNER JOIN `baz` `b1` ON foo.baz_id = b1.baz_id AND b1.quux_id = 1 LEFT JOIN `baz` `b2` ON foo.baz_id = b2.baz_id AND b2.quux_id = 2"; }; subtest 'test case adding another table onto the whole mess' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_join( foo => { type => 'inner', table => 'baz', alias => 'b1', condition => 'foo.baz_id = b1.baz_id AND b1.quux_id = 1' }, ); $stmt->add_join( foo => { type => 'left', table => 'baz', alias => 'b2', condition => 'foo.baz_id = b2.baz_id AND b2.quux_id = 2' }, ); $stmt->add_join( quux => { type => 'inner', table => 'foo', alias => 'f1', condition => 'f1.quux_id = quux.q_id' } ); is $stmt->as_sql, "FROM `foo` INNER JOIN `baz` `b1` ON foo.baz_id = b1.baz_id AND b1.quux_id = 1 LEFT JOIN `baz` `b2` ON foo.baz_id = b2.baz_id AND b2.quux_id = 2 INNER JOIN `foo` `f1` ON f1.quux_id = quux.q_id"; }; }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { subtest 'inner join' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_join( foo => { type => 'inner', table => 'baz', } ); is($stmt->as_sql, "FROM foo INNER JOIN baz"); }; subtest 'inner join with condition' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_join( foo => { type => 'inner', table => 'baz', condition => 'foo.baz_id = baz.baz_id' } ); is($stmt->as_sql, "FROM foo INNER JOIN baz ON foo.baz_id = baz.baz_id"); }; subtest 'from and inner join with condition' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_from( 'bar' ); $stmt->add_join( foo => { type => 'inner', table => 'baz', condition => 'foo.baz_id = baz.baz_id' } ); is($stmt->as_sql, "FROM foo INNER JOIN baz ON foo.baz_id = baz.baz_id, bar"); }; subtest 'test case for bug found where add_join is called twice' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_join( foo => { type => 'inner', table => 'baz', alias => 'b1', condition => 'foo.baz_id = b1.baz_id AND b1.quux_id = 1' }, ); $stmt->add_join( foo => { type => 'left', table => 'baz', alias => 'b2', condition => 'foo.baz_id = b2.baz_id AND b2.quux_id = 2' }, ); is $stmt->as_sql, "FROM foo INNER JOIN baz b1 ON foo.baz_id = b1.baz_id AND b1.quux_id = 1 LEFT JOIN baz b2 ON foo.baz_id = b2.baz_id AND b2.quux_id = 2"; }; subtest 'test case adding another table onto the whole mess' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_join( foo => { type => 'inner', table => 'baz', alias => 'b1', condition => 'foo.baz_id = b1.baz_id AND b1.quux_id = 1' }, ); $stmt->add_join( foo => { type => 'left', table => 'baz', alias => 'b2', condition => 'foo.baz_id = b2.baz_id AND b2.quux_id = 2' }, ); $stmt->add_join( quux => { type => 'inner', table => 'foo', alias => 'f1', condition => 'f1.quux_id = quux.q_id' } ); is $stmt->as_sql, "FROM foo INNER JOIN baz b1 ON foo.baz_id = b1.baz_id AND b1.quux_id = 1 LEFT JOIN baz b2 ON foo.baz_id = b2.baz_id AND b2.quux_id = 2 INNER JOIN foo f1 ON f1.quux_id = quux.q_id"; }; }; }; subtest 'GROUP BY' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { do { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_from( 'foo' ); $stmt->add_group_by('baz'); is($stmt->as_sql, "FROM `foo`\nGROUP BY `baz`", 'single bare group by'); }; do { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_from( 'foo' ); $stmt->add_group_by('baz' => 'DESC'); is($stmt->as_sql, "FROM `foo`\nGROUP BY `baz` DESC", 'single group by with desc'); }; do { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_from( 'foo' ); $stmt->add_group_by('baz'); $stmt->add_group_by('quux'); is($stmt->as_sql, "FROM `foo`\nGROUP BY `baz`, `quux`", 'multiple group by'); }; do { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_from( 'foo' ); $stmt->add_group_by('baz', 'DESC'); $stmt->add_group_by('quux', 'DESC'); is($stmt->as_sql, "FROM `foo`\nGROUP BY `baz` DESC, `quux` DESC", 'multiple group by with desc'); }; }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { do { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_from( 'foo' ); $stmt->add_group_by('baz'); is($stmt->as_sql, "FROM foo GROUP BY baz", 'single bare group by'); }; do { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_from( 'foo' ); $stmt->add_group_by('baz' => 'DESC'); is($stmt->as_sql, "FROM foo GROUP BY baz DESC", 'single group by with desc'); }; do { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_from( 'foo' ); $stmt->add_group_by('baz'); $stmt->add_group_by('quux'); is($stmt->as_sql, "FROM foo GROUP BY baz, quux", 'multiple group by'); }; do { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_from( 'foo' ); $stmt->add_group_by('baz', 'DESC'); $stmt->add_group_by('quux', 'DESC'); is($stmt->as_sql, "FROM foo GROUP BY baz DESC, quux DESC", 'multiple group by with desc'); }; }; }; subtest 'ORDER BY' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { do { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_from( 'foo' ); $stmt->add_order_by('baz' => 'DESC'); is($stmt->as_sql, "FROM `foo`\nORDER BY `baz` DESC", 'single order by'); }; do { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_from( 'foo' ); $stmt->add_order_by( 'baz' => 'DESC' ); $stmt->add_order_by( 'quux' => 'ASC' ); is($stmt->as_sql, "FROM `foo`\nORDER BY `baz` DESC, `quux` ASC", 'multiple order by'); }; do { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_from( 'foo' ); $stmt->add_order_by( \'baz DESC' ); is($stmt->as_sql, "FROM `foo`\nORDER BY baz DESC", 'scalar ref'); # should not quote }; }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { do { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_from( 'foo' ); $stmt->add_order_by('baz' => 'DESC'); is($stmt->as_sql, "FROM foo ORDER BY baz DESC", 'single order by'); }; do { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ }); $stmt->add_from( 'foo' ); $stmt->add_order_by( 'baz' => 'DESC' ); $stmt->add_order_by( 'quux' => 'ASC' ); is($stmt->as_sql, "FROM foo ORDER BY baz DESC, quux ASC", 'multiple order by'); }; subtest 'scalarref' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ }); $stmt->add_from( 'foo' ); $stmt->add_order_by( \'baz DESC' ); is($stmt->as_sql, "FROM foo ORDER BY baz DESC"); # should not quote }; }; }; subtest 'GROUP BY + ORDER BY' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_from( 'foo' ); $stmt->add_group_by('quux'); $stmt->add_order_by('baz' => 'DESC'); is($stmt->as_sql, "FROM `foo`\nGROUP BY `quux`\nORDER BY `baz` DESC", 'group by with order by'); }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ }); $stmt->add_from( 'foo' ); $stmt->add_group_by('quux'); $stmt->add_order_by('baz' => 'DESC'); is($stmt->as_sql, "FROM foo GROUP BY quux ORDER BY baz DESC", 'group by with order by'); }; }; subtest 'LIMIT OFFSET' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_from( 'foo' ); $stmt->limit(5); is($stmt->as_sql, "FROM `foo`\nLIMIT 5"); $stmt->offset(10); is($stmt->as_sql, "FROM `foo`\nLIMIT 5 OFFSET 10"); $stmt->limit(0); is($stmt->as_sql, "FROM `foo`\nLIMIT 0 OFFSET 10"); $stmt->limit(" 15g"); ## Non-numerics should cause an error { my $sql = eval { $stmt->as_sql }; like($@, qr/Non-numerics/, "bogus limit causes as_sql assertion"); }; }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_from( 'foo' ); $stmt->limit(5); is($stmt->as_sql, "FROM foo LIMIT 5"); $stmt->offset(10); is($stmt->as_sql, "FROM foo LIMIT 5 OFFSET 10"); $stmt->limit(0); is($stmt->as_sql, "FROM foo LIMIT 0 OFFSET 10"); $stmt->limit(" 15g"); ## Non-numerics should cause an error { my $sql = eval { $stmt->as_sql }; like($@, qr/Non-numerics/, "bogus limit causes as_sql assertion"); }; }; }; subtest 'WHERE' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { subtest 'single equals' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_where(foo => 'bar'); is($stmt->as_sql_where, "WHERE (`foo` = ?)\n"); is(scalar @{ $stmt->bind }, 1); is($stmt->bind->[0], 'bar'); }; subtest 'single equals multi values is IN() statement' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_where(foo => [ 'bar', 'baz' ]); is($stmt->as_sql_where, "WHERE (`foo` IN (?, ?))\n"); is(scalar @{ $stmt->bind }, 2); is($stmt->bind->[0], 'bar'); is($stmt->bind->[1], 'baz'); }; subtest 'new condition, single equals multi values is IN() statement' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); my $cond = $stmt->new_condition(); $cond->add(foo => [ 'bar', 'baz' ]); $stmt->set_where($cond); is($stmt->as_sql_where, "WHERE (`foo` IN (?, ?))\n"); is(scalar @{ $stmt->bind }, 2); is($stmt->bind->[0], 'bar'); is($stmt->bind->[1], 'baz'); }; }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { subtest 'single equals' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_where(foo => 'bar'); is($stmt->as_sql_where, "WHERE (foo = ?) "); is(scalar @{ $stmt->bind }, 1); is($stmt->bind->[0], 'bar'); }; subtest 'single equals multi values is IN() statement' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_where(foo => [ 'bar', 'baz' ]); is($stmt->as_sql_where, "WHERE (foo IN (?, ?)) "); is(scalar @{ $stmt->bind }, 2); is($stmt->bind->[0], 'bar'); is($stmt->bind->[1], 'baz'); }; subtest 'new condition, single equals multi values is IN() statement' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); my $cond = $stmt->new_condition(); $cond->add(foo => [ 'bar', 'baz' ]); $stmt->set_where($cond); is($stmt->as_sql_where, "WHERE (foo IN (?, ?)) "); is(scalar @{ $stmt->bind }, 2); is($stmt->bind->[0], 'bar'); is($stmt->bind->[1], 'baz'); }; }; }; subtest 'add_select' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { subtest 'simple' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_select(foo => 'foo'); $stmt->add_select('bar'); $stmt->add_from( qw( baz ) ); is($stmt->as_sql, "SELECT `foo`, `bar`\nFROM `baz`"); }; subtest 'with scalar ref' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_select('f.foo' => 'foo'); $stmt->add_select(\'COUNT(*)' => 'count'); $stmt->add_from( qw( baz ) ); is($stmt->as_sql, "SELECT `f`.`foo`, COUNT(*) AS `count`\nFROM `baz`"); }; }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { subtest 'simple' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_select(foo => 'foo'); $stmt->add_select('bar'); $stmt->add_from( qw( baz ) ); is($stmt->as_sql, "SELECT foo, bar FROM baz"); }; subtest 'with scalar ref' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_select('f.foo' => 'foo'); $stmt->add_select(\'COUNT(*)' => 'count'); $stmt->add_from( qw( baz ) ); is($stmt->as_sql, "SELECT f.foo, COUNT(*) AS count FROM baz"); }; }; }; # HAVING subtest 'HAVING' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_select(foo => 'foo'); $stmt->add_select(\'COUNT(*)' => 'count'); $stmt->add_from( qw(baz) ); $stmt->add_where(foo => 1); $stmt->add_group_by('baz'); $stmt->add_order_by('foo' => 'DESC'); $stmt->limit(2); $stmt->add_having(count => 2); is($stmt->as_sql, "SELECT `foo`, COUNT(*) AS `count`\nFROM `baz`\nWHERE (`foo` = ?)\nGROUP BY `baz`\nHAVING (COUNT(*) = ?)\nORDER BY `foo` DESC\nLIMIT 2"); }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_select(foo => 'foo'); $stmt->add_select(\'COUNT(*)' => 'count'); $stmt->add_from( qw(baz) ); $stmt->add_where(foo => 1); $stmt->add_group_by('baz'); $stmt->add_order_by('foo' => 'DESC'); $stmt->limit(2); $stmt->add_having(count => 2); is($stmt->as_sql, "SELECT foo, COUNT(*) AS count FROM baz WHERE (foo = ?) GROUP BY baz HAVING (COUNT(*) = ?) ORDER BY foo DESC LIMIT 2"); }; }; subtest 'DISTINCT' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_select(foo => 'foo'); $stmt->add_from( qw(baz) ); is($stmt->as_sql, "SELECT `foo`\nFROM `baz`", "DISTINCT is absent by default"); $stmt->distinct(1); is($stmt->as_sql, "SELECT DISTINCT `foo`\nFROM `baz`", "we can turn on DISTINCT"); }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_select(foo => 'foo'); $stmt->add_from( qw(baz) ); is($stmt->as_sql, "SELECT foo FROM baz", "DISTINCT is absent by default"); $stmt->distinct(1); is($stmt->as_sql, "SELECT DISTINCT foo FROM baz", "we can turn on DISTINCT"); }; }; subtest 'index hint' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_select(foo => 'foo'); $stmt->add_from( qw(baz) ); is($stmt->as_sql, "SELECT `foo`\nFROM `baz`", "index hint is absent by default"); $stmt->add_index_hint('baz' => { type => 'USE', list => ['index_hint']}); is($stmt->as_sql, "SELECT `foo`\nFROM `baz` USE INDEX (`index_hint`)", "we can turn on USE INDEX"); }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_select(foo => 'foo'); $stmt->add_from( qw(baz) ); is($stmt->as_sql, "SELECT foo FROM baz", "index hint is absent by default"); $stmt->add_index_hint('baz' => { type => 'USE', list => ['index_hint']}); is($stmt->as_sql, "SELECT foo FROM baz USE INDEX (index_hint)", "we can turn on USE INDEX"); }; subtest 'hint as scalar' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_select(foo => 'foo'); $stmt->add_from( qw(baz) ); $stmt->add_index_hint('baz' => 'index_hint'); is($stmt->as_sql, "SELECT foo FROM baz USE INDEX (index_hint)", "we can turn on USE INDEX"); }; subtest 'hint as array ref' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_select(foo => 'foo'); $stmt->add_from( qw(baz) ); $stmt->add_index_hint('baz' => ['index_hint']); is($stmt->as_sql, "SELECT foo FROM baz USE INDEX (index_hint)", "we can turn on USE INDEX"); }; }; subtest 'index hint with joins' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { do { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_select(foo => 'foo'); $stmt->add_index_hint('baz' => { type => 'USE', list => ['index_hint']}); $stmt->add_join( baz => { type => 'inner', table => 'baz', condition => 'baz.baz_id = foo.baz_id' } ); is($stmt->as_sql, "SELECT `foo`\nFROM `baz` USE INDEX (`index_hint`) INNER JOIN `baz` ON baz.baz_id = foo.baz_id", 'USE INDEX with JOIN'); }; do { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_select(foo => 'foo'); $stmt->add_index_hint('baz' => { type => 'USE', list => ['index_hint']}); $stmt->add_join( baz => { type => 'inner', table => 'baz', alias => 'b1', condition => 'baz.baz_id = b1.baz_id AND b1.quux_id = 1' }, ); $stmt->add_join( baz => { type => 'left', table => 'baz', alias => 'b2', condition => 'baz.baz_id = b2.baz_id AND b2.quux_id = 2' }, ); is($stmt->as_sql, "SELECT `foo`\nFROM `baz` USE INDEX (`index_hint`) INNER JOIN `baz` `b1` ON baz.baz_id = b1.baz_id AND b1.quux_id = 1 LEFT JOIN `baz` `b2` ON baz.baz_id = b2.baz_id AND b2.quux_id = 2", 'USE INDEX with JOINs'); }; }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { do { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_select(foo => 'foo'); $stmt->add_index_hint('baz' => { type => 'USE', list => ['index_hint']}); $stmt->add_join( baz => { type => 'inner', table => 'baz', condition => 'baz.baz_id = foo.baz_id' } ); is($stmt->as_sql, "SELECT foo FROM baz USE INDEX (index_hint) INNER JOIN baz ON baz.baz_id = foo.baz_id", 'USE INDEX with JOIN'); }; do { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_select(foo => 'foo'); $stmt->add_index_hint('baz' => { type => 'USE', list => ['index_hint']}); $stmt->add_join( baz => { type => 'inner', table => 'baz', alias => 'b1', condition => 'baz.baz_id = b1.baz_id AND b1.quux_id = 1' }, ); $stmt->add_join( baz => { type => 'left', table => 'baz', alias => 'b2', condition => 'baz.baz_id = b2.baz_id AND b2.quux_id = 2' }, ); is($stmt->as_sql, "SELECT foo FROM baz USE INDEX (index_hint) INNER JOIN baz b1 ON baz.baz_id = b1.baz_id AND b1.quux_id = 1 LEFT JOIN baz b2 ON baz.baz_id = b2.baz_id AND b2.quux_id = 2", 'USE INDEX with JOINs'); }; }; }; subtest 'select + from' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { my $stmt = ns( quote_char => q{`}, name_sep => q{.}, ); $stmt->add_select(foo => 'foo'); $stmt->add_from(qw(baz)); is($stmt->as_sql, "SELECT `foo`\nFROM `baz`"); }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { my $stmt = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $stmt->add_select(foo => 'foo'); $stmt->add_from(qw(baz)); is($stmt->as_sql, "SELECT foo FROM baz"); }; }; subtest join_with_using => sub { subtest 'quote_char: "`", name_sep: "."' => sub { my $sql = ns( quote_char => q{`}, name_sep => q{.}, ); $sql->add_join( foo => { type => 'inner', table => 'baz', condition => [qw/ hoge_id fuga_id /], }, ); is $sql->as_sql, "FROM `foo` INNER JOIN `baz` USING (`hoge_id`, `fuga_id`)"; }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { my $sql = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $sql->add_join( foo => { type => 'inner', table => 'baz', condition => [qw/ hoge_id fuga_id /], }, ); is $sql->as_sql, "FROM foo INNER JOIN baz USING (hoge_id, fuga_id)"; }; }; subtest 'add_where_raw' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { my $sql = ns( quote_char => q{`}, name_sep => q{.}, ); $sql->add_select( foo => 'foo' ); $sql->add_from( 'baz' ); $sql->add_where_raw( 'MATCH(foo) AGAINST (?)' => 'hoge' ); is $sql->as_sql, "SELECT `foo`\nFROM `baz`\nWHERE (MATCH(foo) AGAINST (?))"; is $sql->bind->[0], 'hoge'; }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { my $sql = ns( quote_char => q{}, name_sep => q{.}, new_line => q{ } ); $sql->add_select( foo => 'foo' ); $sql->add_from( 'baz' ); $sql->add_where_raw( 'MATCH(foo) AGAINST (?)' => 'hoge' ); is $sql->as_sql, "SELECT foo FROM baz WHERE (MATCH(foo) AGAINST (?))"; is $sql->bind->[0], 'hoge'; }; subtest 'multi values' => sub { my $sql = ns( quote_char => q{}, name_sep => q{.} ); $sql->add_select( foo => 'foo' ); $sql->add_from( 'baz' ); $sql->add_where_raw( 'foo = IF(bar = ?, ?, ?)' => ['hoge', 'fuga', 'piyo'] ); is $sql->as_sql, "SELECT foo\nFROM baz\nWHERE (foo = IF(bar = ?, ?, ?))"; is $sql->bind->[0], 'hoge'; is $sql->bind->[1], 'fuga'; is $sql->bind->[2], 'piyo'; }; subtest 'without value' => sub { my $sql = ns( quote_char => q{}, name_sep => q{.} ); $sql->add_select( foo => 'foo' ); $sql->add_from( 'baz' ); $sql->add_where_raw( 'foo IS NOT NULL' ); is $sql->as_sql, "SELECT foo\nFROM baz\nWHERE (foo IS NOT NULL)"; is scalar(@{$sql->bind}), 0; }; }; subtest 'add_having_raw' => sub { subtest 'quote_char: "`", name_sep: "."' => sub { my $sql = ns(quote_char => q{`}, name_sep => q{.},); $sql->add_select(foo => 'foo'); $sql->add_from('baz'); $sql->add_having_raw('MAX(foo) < (?)' => '100'); is $sql->as_sql, "SELECT `foo`\nFROM `baz`\nHAVING (MAX(foo) < (?))"; is $sql->bind->[0], '100'; }; subtest 'quote_char: "", name_sep: ".", new_line: " "' => sub { my $sql = ns(quote_char => q{}, name_sep => q{.}, new_line => q{ }); $sql->add_select(foo => 'foo'); $sql->add_from('baz'); $sql->add_having_raw('MAX(foo) < (?)' => '100'); is $sql->as_sql, "SELECT foo FROM baz HAVING (MAX(foo) < (?))"; is $sql->bind->[0], '100'; }; subtest 'multi values' => sub { my $sql = ns(quote_char => q{}, name_sep => q{.}); $sql->add_select(foo => 'foo'); $sql->add_from('baz'); $sql->add_having_raw('foo = IF(bar = ?, ?, ?)' => ['hoge', 'fuga', 'piyo']); is $sql->as_sql, "SELECT foo\nFROM baz\nHAVING (foo = IF(bar = ?, ?, ?))"; is $sql->bind->[0], 'hoge'; is $sql->bind->[1], 'fuga'; is $sql->bind->[2], 'piyo'; }; subtest 'without value' => sub { my $sql = ns(quote_char => q{}, name_sep => q{.}); $sql->add_select(foo => 'foo'); $sql->add_from('baz'); $sql->add_having_raw('foo IS NOT NULL'); is $sql->as_sql, "SELECT foo\nFROM baz\nHAVING (foo IS NOT NULL)"; is scalar(@{$sql->bind}), 0; }; }; sub ns { SQL::Maker::Select->new(@_) } done_testing;
39.004582
240
0.440956
ede3b7a51bbb430cbcb726503fb2fa51f1ad04c4
592
pm
Perl
lib/Forge/Model/R/Oos/Requestmap.pm
ant-i/db-crud
51b119b3e67e807ed216dafd467c7fd6d11186cf
[ "Apache-2.0" ]
null
null
null
lib/Forge/Model/R/Oos/Requestmap.pm
ant-i/db-crud
51b119b3e67e807ed216dafd467c7fd6d11186cf
[ "Apache-2.0" ]
null
null
null
lib/Forge/Model/R/Oos/Requestmap.pm
ant-i/db-crud
51b119b3e67e807ed216dafd467c7fd6d11186cf
[ "Apache-2.0" ]
null
null
null
package Forge::Model::R::Oos::Requestmap; use strict; use base qw(Forge::Model::R::Oos); __PACKAGE__->meta->setup( table => 'requestmap', columns => [ id => { type => 'bigint', not_null => 1 }, version => { type => 'bigint', not_null => 1 }, config_attribute => { type => 'varchar', length => 255, not_null => 1 }, url => { type => 'varchar', length => 255, not_null => 1 }, ], primary_key_columns => [ 'id' ], unique_key => [ 'url' ], ); __PACKAGE__->meta->make_manager_class('requestmap'); 1;
24.666667
80
0.518581
edea8e284582822812a54af240efba46450d43e4
547
pl
Perl
txt2csv.pl
dfellis/2csv
6ab028fcc79e3ceb33a000f998802c1e6f071e2a
[ "MIT", "Unlicense" ]
1
2020-10-21T12:06:58.000Z
2020-10-21T12:06:58.000Z
txt2csv.pl
dfellis/2csv
6ab028fcc79e3ceb33a000f998802c1e6f071e2a
[ "MIT", "Unlicense" ]
null
null
null
txt2csv.pl
dfellis/2csv
6ab028fcc79e3ceb33a000f998802c1e6f071e2a
[ "MIT", "Unlicense" ]
null
null
null
#!/usr/bin/perl #TXT to CSV my @titleArray; my %dataArrays; my $maxIndex = 0; my $currIndex = 0; my $outfile = $ARGV[0] . ".csv"; open(INFILE, "<", "$ARGV[0]") or die "Can't open \"$ARGV[0]\": $!"; open(OUTFILE, ">", "$outfile") or die "Can't create output file: $!"; while(<INFILE>) { $_ =~ s/ /,/g; if($_ =~ /^,*$/) { #Do nothing } elsif($_ =~ /^\@TIME\=,/) { #Do nothing } elsif($_ =~ /^,/) { #Do nothing } elsif($_ =~ /---/) { #Do nothing } else { my $out = $_; print OUTFILE $out; } } close(INFILE); close(OUTFILE);
16.088235
69
0.513711
ede281d5de36bfbf195a802f00b3a8d2dd8b5e9e
5,110
pm
Perl
apps/centreon/sql/mode/countnotifications.pm
garnier-quentin/centreon-plugins
51c16b4419d640709d3352a260e4cd63cd96db14
[ "Apache-2.0" ]
null
null
null
apps/centreon/sql/mode/countnotifications.pm
garnier-quentin/centreon-plugins
51c16b4419d640709d3352a260e4cd63cd96db14
[ "Apache-2.0" ]
null
null
null
apps/centreon/sql/mode/countnotifications.pm
garnier-quentin/centreon-plugins
51c16b4419d640709d3352a260e4cd63cd96db14
[ "Apache-2.0" ]
null
null
null
# # Copyright 2018 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::centreon::sql::mode::countnotifications; use base qw(centreon::plugins::mode); use strict; use warnings; use centreon::plugins::statefile; sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => { "warning:s" => { name => 'warning' }, "critical:s" => { name => 'critical' }, "centreon-storage-database:s" => { name => 'centreon_storage_database', default => 'centreon_storage' }, }); $self->{statefile_cache} = centreon::plugins::statefile->new(%options); return $self; } sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); $self->{output}->option_exit(); } if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical}. "'."); $self->{output}->option_exit(); } $self->{statefile_cache}->check_options(%options); } sub execute { my ($self, %options) = @_; $self->{sql}->connect(); $self->{sql}->query(query => "SELECT name, count(NULLIF(log_id, 0)) as num FROM " . $self->{option_results}->{centreon_storage_database} . ".instances LEFT JOIN " . $self->{option_results}->{centreon_storage_database} . ".logs ON logs.ctime > " . $options{time} . " AND logs.msg_type IN ('2', '3') AND logs.instance_name = instances.name WHERE deleted = '0' GROUP BY name"); my $total_notifications = 0; while ((my $row = $self->{sql}->fetchrow_hashref())) { $self->{output}->output_add(long_msg => sprintf("%d sent notifications from %s", $row->{num}, $row->{name})); $total_notifications += $row->{num}; $self->{output}->perfdata_add(label => 'notifications_' . $row->{name}, value => $row->{num}, min => 0); } my $exit_code = $self->{perfdata}->threshold_check(value => $total_notifications, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); $self->{output}->output_add(severity => $exit_code, short_msg => sprintf("%d total sent notifications", $total_notifications)); $self->{output}->perfdata_add(label => 'total', value => $total_notifications, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning'), critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical'), min => 0); } sub run { my ($self, %options) = @_; # $options{sql} = sqlmode object $self->{sql} = $options{sql}; $self->{statefile_cache}->read(statefile => 'sql_' . $self->{mode} . '_' . $self->{sql}->get_unique_id4save()); my $old_timestamp = $self->{statefile_cache}->get(name => 'last_timestamp'); my $new_datas = { last_timestamp => time() }; $self->{statefile_cache}->write(data => $new_datas); if (!defined($old_timestamp)) { $self->{output}->output_add(severity => 'OK', short_msg => "Buffer creation..."); } else { $self->execute(time => $old_timestamp); } $self->{output}->display(); $self->{output}->exit(); } 1; __END__ =head1 MODE Check the number of notifications (works only with centreon-broker). The mode should be used with mysql plugin and dyn-mode option. =over 8 =item B<--centreon-storage-database> Centreon storage database name (default: 'centreon_storage'). =item B<--warning> Threshold warning. =item B<--critical> Threshold critical. =back =cut
38.421053
378
0.591194
edc2a32102ff2e4f81f506002bff6978e7c2aac7
47,254
pm
Perl
lib/Date/Manip/TZ/euvien00.pm
Helmholtz-HIPS/prosnap
5286cda39276d5eda85d2ddb23b8ab83c5d4960c
[ "MIT" ]
1
2021-11-26T17:29:56.000Z
2021-11-26T17:29:56.000Z
lib/Date/Manip/TZ/euvien00.pm
Helmholtz-HIPS/prosnap
5286cda39276d5eda85d2ddb23b8ab83c5d4960c
[ "MIT" ]
1
2020-03-19T21:12:23.000Z
2020-03-19T21:12:23.000Z
lib/Date/Manip/TZ/euvien00.pm
Helmholtz-HIPS/prosnap
5286cda39276d5eda85d2ddb23b8ab83c5d4960c
[ "MIT" ]
null
null
null
package # Date::Manip::TZ::euvien00; # Copyright (c) 2008-2016 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: Thu Dec 1 11:59:52 EST 2016 # Data version: tzdata2016j # Code version: tzcode2016j # 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.57'; END { undef $VERSION; } %Dates = ( 1 => [ [ [1,1,2,0,0,0],[1,1,2,1,5,21],'+01:05:21',[1,5,21], 'LMT',0,[1893,3,31,22,54,38],[1893,3,31,23,59,59], '0001010200:00:00','0001010201:05:21','1893033122:54:38','1893033123:59:59' ], ], 1893 => [ [ [1893,3,31,22,54,39],[1893,3,31,23,54,39],'+01:00:00',[1,0,0], 'CET',0,[1916,4,30,21,59,59],[1916,4,30,22,59,59], '1893033122:54:39','1893033123:54:39','1916043021:59:59','1916043022:59:59' ], ], 1916 => [ [ [1916,4,30,22,0,0],[1916,5,1,0,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1916,9,30,22,59,59],[1916,10,1,0,59,59], '1916043022:00:00','1916050100:00:00','1916093022:59:59','1916100100:59:59' ], [ [1916,9,30,23,0,0],[1916,10,1,0,0,0],'+01:00:00',[1,0,0], 'CET',0,[1917,4,16,0,59,59],[1917,4,16,1,59,59], '1916093023:00:00','1916100100:00:00','1917041600:59:59','1917041601:59:59' ], ], 1917 => [ [ [1917,4,16,1,0,0],[1917,4,16,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1917,9,17,0,59,59],[1917,9,17,2,59,59], '1917041601:00:00','1917041603:00:00','1917091700:59:59','1917091702:59:59' ], [ [1917,9,17,1,0,0],[1917,9,17,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1918,4,15,0,59,59],[1918,4,15,1,59,59], '1917091701:00:00','1917091702:00:00','1918041500:59:59','1918041501:59:59' ], ], 1918 => [ [ [1918,4,15,1,0,0],[1918,4,15,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1918,9,16,0,59,59],[1918,9,16,2,59,59], '1918041501:00:00','1918041503:00:00','1918091600:59:59','1918091602:59:59' ], [ [1918,9,16,1,0,0],[1918,9,16,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1920,4,5,0,59,59],[1920,4,5,1,59,59], '1918091601:00:00','1918091602:00:00','1920040500:59:59','1920040501:59:59' ], ], 1920 => [ [ [1920,4,5,1,0,0],[1920,4,5,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1920,9,13,0,59,59],[1920,9,13,2,59,59], '1920040501:00:00','1920040503:00:00','1920091300:59:59','1920091302:59:59' ], [ [1920,9,13,1,0,0],[1920,9,13,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1940,4,1,0,59,59],[1940,4,1,1,59,59], '1920091301:00:00','1920091302:00:00','1940040100:59:59','1940040101:59:59' ], ], 1940 => [ [ [1940,4,1,1,0,0],[1940,4,1,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1942,11,2,0,59,59],[1942,11,2,2,59,59], '1940040101:00:00','1940040103:00:00','1942110200:59:59','1942110202:59:59' ], ], 1942 => [ [ [1942,11,2,1,0,0],[1942,11,2,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1943,3,29,0,59,59],[1943,3,29,1,59,59], '1942110201:00:00','1942110202:00:00','1943032900:59:59','1943032901:59:59' ], ], 1943 => [ [ [1943,3,29,1,0,0],[1943,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1943,10,4,0,59,59],[1943,10,4,2,59,59], '1943032901:00:00','1943032903:00:00','1943100400:59:59','1943100402:59:59' ], [ [1943,10,4,1,0,0],[1943,10,4,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1944,4,3,0,59,59],[1944,4,3,1,59,59], '1943100401:00:00','1943100402:00:00','1944040300:59:59','1944040301:59:59' ], ], 1944 => [ [ [1944,4,3,1,0,0],[1944,4,3,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1944,10,2,0,59,59],[1944,10,2,2,59,59], '1944040301:00:00','1944040303:00:00','1944100200:59:59','1944100202:59:59' ], [ [1944,10,2,1,0,0],[1944,10,2,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1945,4,2,0,59,59],[1945,4,2,1,59,59], '1944100201:00:00','1944100202:00:00','1945040200:59:59','1945040201:59:59' ], ], 1945 => [ [ [1945,4,2,1,0,0],[1945,4,2,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1945,4,12,0,59,59],[1945,4,12,2,59,59], '1945040201:00:00','1945040203:00:00','1945041200:59:59','1945041202:59:59' ], [ [1945,4,12,1,0,0],[1945,4,12,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1946,4,14,0,59,59],[1946,4,14,1,59,59], '1945041201:00:00','1945041202:00:00','1946041400:59:59','1946041401:59:59' ], ], 1946 => [ [ [1946,4,14,1,0,0],[1946,4,14,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1946,10,6,0,59,59],[1946,10,6,2,59,59], '1946041401:00:00','1946041403:00:00','1946100600:59:59','1946100602:59:59' ], [ [1946,10,6,1,0,0],[1946,10,6,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1947,4,6,0,59,59],[1947,4,6,1,59,59], '1946100601:00:00','1946100602:00:00','1947040600:59:59','1947040601:59:59' ], ], 1947 => [ [ [1947,4,6,1,0,0],[1947,4,6,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1947,10,5,0,59,59],[1947,10,5,2,59,59], '1947040601:00:00','1947040603:00:00','1947100500:59:59','1947100502:59:59' ], [ [1947,10,5,1,0,0],[1947,10,5,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1948,4,18,0,59,59],[1948,4,18,1,59,59], '1947100501:00:00','1947100502:00:00','1948041800:59:59','1948041801:59:59' ], ], 1948 => [ [ [1948,4,18,1,0,0],[1948,4,18,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1948,10,3,0,59,59],[1948,10,3,2,59,59], '1948041801:00:00','1948041803:00:00','1948100300:59:59','1948100302:59:59' ], [ [1948,10,3,1,0,0],[1948,10,3,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1980,4,5,22,59,59],[1980,4,5,23,59,59], '1948100301:00:00','1948100302:00:00','1980040522:59:59','1980040523:59:59' ], ], 1980 => [ [ [1980,4,5,23,0,0],[1980,4,6,1,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1980,9,27,21,59,59],[1980,9,27,23,59,59], '1980040523:00:00','1980040601:00:00','1980092721:59:59','1980092723:59:59' ], [ [1980,9,27,22,0,0],[1980,9,27,23,0,0],'+01:00:00',[1,0,0], 'CET',0,[1981,3,29,0,59,59],[1981,3,29,1,59,59], '1980092722:00:00','1980092723:00:00','1981032900:59:59','1981032901:59:59' ], ], 1981 => [ [ [1981,3,29,1,0,0],[1981,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1981,9,27,0,59,59],[1981,9,27,2,59,59], '1981032901:00:00','1981032903:00:00','1981092700:59:59','1981092702:59:59' ], [ [1981,9,27,1,0,0],[1981,9,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1982,3,28,0,59,59],[1982,3,28,1,59,59], '1981092701:00:00','1981092702:00:00','1982032800:59:59','1982032801:59:59' ], ], 1982 => [ [ [1982,3,28,1,0,0],[1982,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1982,9,26,0,59,59],[1982,9,26,2,59,59], '1982032801:00:00','1982032803:00:00','1982092600:59:59','1982092602:59:59' ], [ [1982,9,26,1,0,0],[1982,9,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1983,3,27,0,59,59],[1983,3,27,1,59,59], '1982092601:00:00','1982092602:00:00','1983032700:59:59','1983032701:59:59' ], ], 1983 => [ [ [1983,3,27,1,0,0],[1983,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1983,9,25,0,59,59],[1983,9,25,2,59,59], '1983032701:00:00','1983032703:00:00','1983092500:59:59','1983092502:59:59' ], [ [1983,9,25,1,0,0],[1983,9,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1984,3,25,0,59,59],[1984,3,25,1,59,59], '1983092501:00:00','1983092502:00:00','1984032500:59:59','1984032501:59:59' ], ], 1984 => [ [ [1984,3,25,1,0,0],[1984,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1984,9,30,0,59,59],[1984,9,30,2,59,59], '1984032501:00:00','1984032503:00:00','1984093000:59:59','1984093002:59:59' ], [ [1984,9,30,1,0,0],[1984,9,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1985,3,31,0,59,59],[1985,3,31,1,59,59], '1984093001:00:00','1984093002:00:00','1985033100:59:59','1985033101:59:59' ], ], 1985 => [ [ [1985,3,31,1,0,0],[1985,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1985,9,29,0,59,59],[1985,9,29,2,59,59], '1985033101:00:00','1985033103:00:00','1985092900:59:59','1985092902:59:59' ], [ [1985,9,29,1,0,0],[1985,9,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1986,3,30,0,59,59],[1986,3,30,1,59,59], '1985092901:00:00','1985092902:00:00','1986033000:59:59','1986033001:59:59' ], ], 1986 => [ [ [1986,3,30,1,0,0],[1986,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1986,9,28,0,59,59],[1986,9,28,2,59,59], '1986033001:00:00','1986033003:00:00','1986092800:59:59','1986092802:59:59' ], [ [1986,9,28,1,0,0],[1986,9,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1987,3,29,0,59,59],[1987,3,29,1,59,59], '1986092801:00:00','1986092802:00:00','1987032900:59:59','1987032901:59:59' ], ], 1987 => [ [ [1987,3,29,1,0,0],[1987,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1987,9,27,0,59,59],[1987,9,27,2,59,59], '1987032901:00:00','1987032903:00:00','1987092700:59:59','1987092702:59:59' ], [ [1987,9,27,1,0,0],[1987,9,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1988,3,27,0,59,59],[1988,3,27,1,59,59], '1987092701:00:00','1987092702:00:00','1988032700:59:59','1988032701:59:59' ], ], 1988 => [ [ [1988,3,27,1,0,0],[1988,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1988,9,25,0,59,59],[1988,9,25,2,59,59], '1988032701:00:00','1988032703:00:00','1988092500:59:59','1988092502:59:59' ], [ [1988,9,25,1,0,0],[1988,9,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1989,3,26,0,59,59],[1989,3,26,1,59,59], '1988092501:00:00','1988092502:00:00','1989032600:59:59','1989032601:59:59' ], ], 1989 => [ [ [1989,3,26,1,0,0],[1989,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1989,9,24,0,59,59],[1989,9,24,2,59,59], '1989032601:00:00','1989032603:00:00','1989092400:59:59','1989092402:59:59' ], [ [1989,9,24,1,0,0],[1989,9,24,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1990,3,25,0,59,59],[1990,3,25,1,59,59], '1989092401:00:00','1989092402:00:00','1990032500:59:59','1990032501:59:59' ], ], 1990 => [ [ [1990,3,25,1,0,0],[1990,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1990,9,30,0,59,59],[1990,9,30,2,59,59], '1990032501:00:00','1990032503:00:00','1990093000:59:59','1990093002:59:59' ], [ [1990,9,30,1,0,0],[1990,9,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1991,3,31,0,59,59],[1991,3,31,1,59,59], '1990093001:00:00','1990093002:00:00','1991033100:59:59','1991033101:59:59' ], ], 1991 => [ [ [1991,3,31,1,0,0],[1991,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1991,9,29,0,59,59],[1991,9,29,2,59,59], '1991033101:00:00','1991033103:00:00','1991092900:59:59','1991092902:59:59' ], [ [1991,9,29,1,0,0],[1991,9,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1992,3,29,0,59,59],[1992,3,29,1,59,59], '1991092901:00:00','1991092902:00:00','1992032900:59:59','1992032901:59:59' ], ], 1992 => [ [ [1992,3,29,1,0,0],[1992,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1992,9,27,0,59,59],[1992,9,27,2,59,59], '1992032901:00:00','1992032903:00:00','1992092700:59:59','1992092702:59:59' ], [ [1992,9,27,1,0,0],[1992,9,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1993,3,28,0,59,59],[1993,3,28,1,59,59], '1992092701:00:00','1992092702:00:00','1993032800:59:59','1993032801:59:59' ], ], 1993 => [ [ [1993,3,28,1,0,0],[1993,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1993,9,26,0,59,59],[1993,9,26,2,59,59], '1993032801:00:00','1993032803:00:00','1993092600:59:59','1993092602:59:59' ], [ [1993,9,26,1,0,0],[1993,9,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1994,3,27,0,59,59],[1994,3,27,1,59,59], '1993092601:00:00','1993092602:00:00','1994032700:59:59','1994032701:59:59' ], ], 1994 => [ [ [1994,3,27,1,0,0],[1994,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1994,9,25,0,59,59],[1994,9,25,2,59,59], '1994032701:00:00','1994032703:00:00','1994092500:59:59','1994092502:59:59' ], [ [1994,9,25,1,0,0],[1994,9,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1995,3,26,0,59,59],[1995,3,26,1,59,59], '1994092501:00:00','1994092502:00:00','1995032600:59:59','1995032601:59:59' ], ], 1995 => [ [ [1995,3,26,1,0,0],[1995,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1995,9,24,0,59,59],[1995,9,24,2,59,59], '1995032601:00:00','1995032603:00:00','1995092400:59:59','1995092402:59:59' ], [ [1995,9,24,1,0,0],[1995,9,24,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1996,3,31,0,59,59],[1996,3,31,1,59,59], '1995092401:00:00','1995092402:00:00','1996033100:59:59','1996033101:59:59' ], ], 1996 => [ [ [1996,3,31,1,0,0],[1996,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1996,10,27,0,59,59],[1996,10,27,2,59,59], '1996033101:00:00','1996033103:00:00','1996102700:59:59','1996102702:59:59' ], [ [1996,10,27,1,0,0],[1996,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1997,3,30,0,59,59],[1997,3,30,1,59,59], '1996102701:00:00','1996102702:00:00','1997033000:59:59','1997033001:59:59' ], ], 1997 => [ [ [1997,3,30,1,0,0],[1997,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1997,10,26,0,59,59],[1997,10,26,2,59,59], '1997033001:00:00','1997033003:00:00','1997102600:59:59','1997102602:59:59' ], [ [1997,10,26,1,0,0],[1997,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1998,3,29,0,59,59],[1998,3,29,1,59,59], '1997102601:00:00','1997102602:00:00','1998032900:59:59','1998032901:59:59' ], ], 1998 => [ [ [1998,3,29,1,0,0],[1998,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1998,10,25,0,59,59],[1998,10,25,2,59,59], '1998032901:00:00','1998032903:00:00','1998102500:59:59','1998102502:59:59' ], [ [1998,10,25,1,0,0],[1998,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[1999,3,28,0,59,59],[1999,3,28,1,59,59], '1998102501:00:00','1998102502:00:00','1999032800:59:59','1999032801:59:59' ], ], 1999 => [ [ [1999,3,28,1,0,0],[1999,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[1999,10,31,0,59,59],[1999,10,31,2,59,59], '1999032801:00:00','1999032803:00:00','1999103100:59:59','1999103102:59:59' ], [ [1999,10,31,1,0,0],[1999,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2000,3,26,0,59,59],[2000,3,26,1,59,59], '1999103101:00:00','1999103102:00:00','2000032600:59:59','2000032601:59:59' ], ], 2000 => [ [ [2000,3,26,1,0,0],[2000,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2000,10,29,0,59,59],[2000,10,29,2,59,59], '2000032601:00:00','2000032603:00:00','2000102900:59:59','2000102902:59:59' ], [ [2000,10,29,1,0,0],[2000,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2001,3,25,0,59,59],[2001,3,25,1,59,59], '2000102901:00:00','2000102902:00:00','2001032500:59:59','2001032501:59:59' ], ], 2001 => [ [ [2001,3,25,1,0,0],[2001,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2001,10,28,0,59,59],[2001,10,28,2,59,59], '2001032501:00:00','2001032503:00:00','2001102800:59:59','2001102802:59:59' ], [ [2001,10,28,1,0,0],[2001,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2002,3,31,0,59,59],[2002,3,31,1,59,59], '2001102801:00:00','2001102802:00:00','2002033100:59:59','2002033101:59:59' ], ], 2002 => [ [ [2002,3,31,1,0,0],[2002,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2002,10,27,0,59,59],[2002,10,27,2,59,59], '2002033101:00:00','2002033103:00:00','2002102700:59:59','2002102702:59:59' ], [ [2002,10,27,1,0,0],[2002,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2003,3,30,0,59,59],[2003,3,30,1,59,59], '2002102701:00:00','2002102702:00:00','2003033000:59:59','2003033001:59:59' ], ], 2003 => [ [ [2003,3,30,1,0,0],[2003,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2003,10,26,0,59,59],[2003,10,26,2,59,59], '2003033001:00:00','2003033003:00:00','2003102600:59:59','2003102602:59:59' ], [ [2003,10,26,1,0,0],[2003,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2004,3,28,0,59,59],[2004,3,28,1,59,59], '2003102601:00:00','2003102602:00:00','2004032800:59:59','2004032801:59:59' ], ], 2004 => [ [ [2004,3,28,1,0,0],[2004,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2004,10,31,0,59,59],[2004,10,31,2,59,59], '2004032801:00:00','2004032803:00:00','2004103100:59:59','2004103102:59:59' ], [ [2004,10,31,1,0,0],[2004,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2005,3,27,0,59,59],[2005,3,27,1,59,59], '2004103101:00:00','2004103102:00:00','2005032700:59:59','2005032701:59:59' ], ], 2005 => [ [ [2005,3,27,1,0,0],[2005,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2005,10,30,0,59,59],[2005,10,30,2,59,59], '2005032701:00:00','2005032703:00:00','2005103000:59:59','2005103002:59:59' ], [ [2005,10,30,1,0,0],[2005,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2006,3,26,0,59,59],[2006,3,26,1,59,59], '2005103001:00:00','2005103002:00:00','2006032600:59:59','2006032601:59:59' ], ], 2006 => [ [ [2006,3,26,1,0,0],[2006,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2006,10,29,0,59,59],[2006,10,29,2,59,59], '2006032601:00:00','2006032603:00:00','2006102900:59:59','2006102902:59:59' ], [ [2006,10,29,1,0,0],[2006,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2007,3,25,0,59,59],[2007,3,25,1,59,59], '2006102901:00:00','2006102902:00:00','2007032500:59:59','2007032501:59:59' ], ], 2007 => [ [ [2007,3,25,1,0,0],[2007,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2007,10,28,0,59,59],[2007,10,28,2,59,59], '2007032501:00:00','2007032503:00:00','2007102800:59:59','2007102802:59:59' ], [ [2007,10,28,1,0,0],[2007,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2008,3,30,0,59,59],[2008,3,30,1,59,59], '2007102801:00:00','2007102802:00:00','2008033000:59:59','2008033001:59:59' ], ], 2008 => [ [ [2008,3,30,1,0,0],[2008,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2008,10,26,0,59,59],[2008,10,26,2,59,59], '2008033001:00:00','2008033003:00:00','2008102600:59:59','2008102602:59:59' ], [ [2008,10,26,1,0,0],[2008,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2009,3,29,0,59,59],[2009,3,29,1,59,59], '2008102601:00:00','2008102602:00:00','2009032900:59:59','2009032901:59:59' ], ], 2009 => [ [ [2009,3,29,1,0,0],[2009,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2009,10,25,0,59,59],[2009,10,25,2,59,59], '2009032901:00:00','2009032903:00:00','2009102500:59:59','2009102502:59:59' ], [ [2009,10,25,1,0,0],[2009,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2010,3,28,0,59,59],[2010,3,28,1,59,59], '2009102501:00:00','2009102502:00:00','2010032800:59:59','2010032801:59:59' ], ], 2010 => [ [ [2010,3,28,1,0,0],[2010,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2010,10,31,0,59,59],[2010,10,31,2,59,59], '2010032801:00:00','2010032803:00:00','2010103100:59:59','2010103102:59:59' ], [ [2010,10,31,1,0,0],[2010,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2011,3,27,0,59,59],[2011,3,27,1,59,59], '2010103101:00:00','2010103102:00:00','2011032700:59:59','2011032701:59:59' ], ], 2011 => [ [ [2011,3,27,1,0,0],[2011,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2011,10,30,0,59,59],[2011,10,30,2,59,59], '2011032701:00:00','2011032703:00:00','2011103000:59:59','2011103002:59:59' ], [ [2011,10,30,1,0,0],[2011,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2012,3,25,0,59,59],[2012,3,25,1,59,59], '2011103001:00:00','2011103002:00:00','2012032500:59:59','2012032501:59:59' ], ], 2012 => [ [ [2012,3,25,1,0,0],[2012,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2012,10,28,0,59,59],[2012,10,28,2,59,59], '2012032501:00:00','2012032503:00:00','2012102800:59:59','2012102802:59:59' ], [ [2012,10,28,1,0,0],[2012,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2013,3,31,0,59,59],[2013,3,31,1,59,59], '2012102801:00:00','2012102802:00:00','2013033100:59:59','2013033101:59:59' ], ], 2013 => [ [ [2013,3,31,1,0,0],[2013,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2013,10,27,0,59,59],[2013,10,27,2,59,59], '2013033101:00:00','2013033103:00:00','2013102700:59:59','2013102702:59:59' ], [ [2013,10,27,1,0,0],[2013,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2014,3,30,0,59,59],[2014,3,30,1,59,59], '2013102701:00:00','2013102702:00:00','2014033000:59:59','2014033001:59:59' ], ], 2014 => [ [ [2014,3,30,1,0,0],[2014,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2014,10,26,0,59,59],[2014,10,26,2,59,59], '2014033001:00:00','2014033003:00:00','2014102600:59:59','2014102602:59:59' ], [ [2014,10,26,1,0,0],[2014,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2015,3,29,0,59,59],[2015,3,29,1,59,59], '2014102601:00:00','2014102602:00:00','2015032900:59:59','2015032901:59:59' ], ], 2015 => [ [ [2015,3,29,1,0,0],[2015,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2015,10,25,0,59,59],[2015,10,25,2,59,59], '2015032901:00:00','2015032903:00:00','2015102500:59:59','2015102502:59:59' ], [ [2015,10,25,1,0,0],[2015,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2016,3,27,0,59,59],[2016,3,27,1,59,59], '2015102501:00:00','2015102502:00:00','2016032700:59:59','2016032701:59:59' ], ], 2016 => [ [ [2016,3,27,1,0,0],[2016,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2016,10,30,0,59,59],[2016,10,30,2,59,59], '2016032701:00:00','2016032703:00:00','2016103000:59:59','2016103002:59:59' ], [ [2016,10,30,1,0,0],[2016,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2017,3,26,0,59,59],[2017,3,26,1,59,59], '2016103001:00:00','2016103002:00:00','2017032600:59:59','2017032601:59:59' ], ], 2017 => [ [ [2017,3,26,1,0,0],[2017,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2017,10,29,0,59,59],[2017,10,29,2,59,59], '2017032601:00:00','2017032603:00:00','2017102900:59:59','2017102902:59:59' ], [ [2017,10,29,1,0,0],[2017,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2018,3,25,0,59,59],[2018,3,25,1,59,59], '2017102901:00:00','2017102902:00:00','2018032500:59:59','2018032501:59:59' ], ], 2018 => [ [ [2018,3,25,1,0,0],[2018,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2018,10,28,0,59,59],[2018,10,28,2,59,59], '2018032501:00:00','2018032503:00:00','2018102800:59:59','2018102802:59:59' ], [ [2018,10,28,1,0,0],[2018,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2019,3,31,0,59,59],[2019,3,31,1,59,59], '2018102801:00:00','2018102802:00:00','2019033100:59:59','2019033101:59:59' ], ], 2019 => [ [ [2019,3,31,1,0,0],[2019,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2019,10,27,0,59,59],[2019,10,27,2,59,59], '2019033101:00:00','2019033103:00:00','2019102700:59:59','2019102702:59:59' ], [ [2019,10,27,1,0,0],[2019,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2020,3,29,0,59,59],[2020,3,29,1,59,59], '2019102701:00:00','2019102702:00:00','2020032900:59:59','2020032901:59:59' ], ], 2020 => [ [ [2020,3,29,1,0,0],[2020,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2020,10,25,0,59,59],[2020,10,25,2,59,59], '2020032901:00:00','2020032903:00:00','2020102500:59:59','2020102502:59:59' ], [ [2020,10,25,1,0,0],[2020,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2021,3,28,0,59,59],[2021,3,28,1,59,59], '2020102501:00:00','2020102502:00:00','2021032800:59:59','2021032801:59:59' ], ], 2021 => [ [ [2021,3,28,1,0,0],[2021,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2021,10,31,0,59,59],[2021,10,31,2,59,59], '2021032801:00:00','2021032803:00:00','2021103100:59:59','2021103102:59:59' ], [ [2021,10,31,1,0,0],[2021,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2022,3,27,0,59,59],[2022,3,27,1,59,59], '2021103101:00:00','2021103102:00:00','2022032700:59:59','2022032701:59:59' ], ], 2022 => [ [ [2022,3,27,1,0,0],[2022,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2022,10,30,0,59,59],[2022,10,30,2,59,59], '2022032701:00:00','2022032703:00:00','2022103000:59:59','2022103002:59:59' ], [ [2022,10,30,1,0,0],[2022,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2023,3,26,0,59,59],[2023,3,26,1,59,59], '2022103001:00:00','2022103002:00:00','2023032600:59:59','2023032601:59:59' ], ], 2023 => [ [ [2023,3,26,1,0,0],[2023,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2023,10,29,0,59,59],[2023,10,29,2,59,59], '2023032601:00:00','2023032603:00:00','2023102900:59:59','2023102902:59:59' ], [ [2023,10,29,1,0,0],[2023,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2024,3,31,0,59,59],[2024,3,31,1,59,59], '2023102901:00:00','2023102902:00:00','2024033100:59:59','2024033101:59:59' ], ], 2024 => [ [ [2024,3,31,1,0,0],[2024,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2024,10,27,0,59,59],[2024,10,27,2,59,59], '2024033101:00:00','2024033103:00:00','2024102700:59:59','2024102702:59:59' ], [ [2024,10,27,1,0,0],[2024,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2025,3,30,0,59,59],[2025,3,30,1,59,59], '2024102701:00:00','2024102702:00:00','2025033000:59:59','2025033001:59:59' ], ], 2025 => [ [ [2025,3,30,1,0,0],[2025,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2025,10,26,0,59,59],[2025,10,26,2,59,59], '2025033001:00:00','2025033003:00:00','2025102600:59:59','2025102602:59:59' ], [ [2025,10,26,1,0,0],[2025,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2026,3,29,0,59,59],[2026,3,29,1,59,59], '2025102601:00:00','2025102602:00:00','2026032900:59:59','2026032901:59:59' ], ], 2026 => [ [ [2026,3,29,1,0,0],[2026,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2026,10,25,0,59,59],[2026,10,25,2,59,59], '2026032901:00:00','2026032903:00:00','2026102500:59:59','2026102502:59:59' ], [ [2026,10,25,1,0,0],[2026,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2027,3,28,0,59,59],[2027,3,28,1,59,59], '2026102501:00:00','2026102502:00:00','2027032800:59:59','2027032801:59:59' ], ], 2027 => [ [ [2027,3,28,1,0,0],[2027,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2027,10,31,0,59,59],[2027,10,31,2,59,59], '2027032801:00:00','2027032803:00:00','2027103100:59:59','2027103102:59:59' ], [ [2027,10,31,1,0,0],[2027,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2028,3,26,0,59,59],[2028,3,26,1,59,59], '2027103101:00:00','2027103102:00:00','2028032600:59:59','2028032601:59:59' ], ], 2028 => [ [ [2028,3,26,1,0,0],[2028,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2028,10,29,0,59,59],[2028,10,29,2,59,59], '2028032601:00:00','2028032603:00:00','2028102900:59:59','2028102902:59:59' ], [ [2028,10,29,1,0,0],[2028,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2029,3,25,0,59,59],[2029,3,25,1,59,59], '2028102901:00:00','2028102902:00:00','2029032500:59:59','2029032501:59:59' ], ], 2029 => [ [ [2029,3,25,1,0,0],[2029,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2029,10,28,0,59,59],[2029,10,28,2,59,59], '2029032501:00:00','2029032503:00:00','2029102800:59:59','2029102802:59:59' ], [ [2029,10,28,1,0,0],[2029,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2030,3,31,0,59,59],[2030,3,31,1,59,59], '2029102801:00:00','2029102802:00:00','2030033100:59:59','2030033101:59:59' ], ], 2030 => [ [ [2030,3,31,1,0,0],[2030,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2030,10,27,0,59,59],[2030,10,27,2,59,59], '2030033101:00:00','2030033103:00:00','2030102700:59:59','2030102702:59:59' ], [ [2030,10,27,1,0,0],[2030,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2031,3,30,0,59,59],[2031,3,30,1,59,59], '2030102701:00:00','2030102702:00:00','2031033000:59:59','2031033001:59:59' ], ], 2031 => [ [ [2031,3,30,1,0,0],[2031,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2031,10,26,0,59,59],[2031,10,26,2,59,59], '2031033001:00:00','2031033003:00:00','2031102600:59:59','2031102602:59:59' ], [ [2031,10,26,1,0,0],[2031,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2032,3,28,0,59,59],[2032,3,28,1,59,59], '2031102601:00:00','2031102602:00:00','2032032800:59:59','2032032801:59:59' ], ], 2032 => [ [ [2032,3,28,1,0,0],[2032,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2032,10,31,0,59,59],[2032,10,31,2,59,59], '2032032801:00:00','2032032803:00:00','2032103100:59:59','2032103102:59:59' ], [ [2032,10,31,1,0,0],[2032,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2033,3,27,0,59,59],[2033,3,27,1,59,59], '2032103101:00:00','2032103102:00:00','2033032700:59:59','2033032701:59:59' ], ], 2033 => [ [ [2033,3,27,1,0,0],[2033,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2033,10,30,0,59,59],[2033,10,30,2,59,59], '2033032701:00:00','2033032703:00:00','2033103000:59:59','2033103002:59:59' ], [ [2033,10,30,1,0,0],[2033,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2034,3,26,0,59,59],[2034,3,26,1,59,59], '2033103001:00:00','2033103002:00:00','2034032600:59:59','2034032601:59:59' ], ], 2034 => [ [ [2034,3,26,1,0,0],[2034,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2034,10,29,0,59,59],[2034,10,29,2,59,59], '2034032601:00:00','2034032603:00:00','2034102900:59:59','2034102902:59:59' ], [ [2034,10,29,1,0,0],[2034,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2035,3,25,0,59,59],[2035,3,25,1,59,59], '2034102901:00:00','2034102902:00:00','2035032500:59:59','2035032501:59:59' ], ], 2035 => [ [ [2035,3,25,1,0,0],[2035,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2035,10,28,0,59,59],[2035,10,28,2,59,59], '2035032501:00:00','2035032503:00:00','2035102800:59:59','2035102802:59:59' ], [ [2035,10,28,1,0,0],[2035,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2036,3,30,0,59,59],[2036,3,30,1,59,59], '2035102801:00:00','2035102802:00:00','2036033000:59:59','2036033001:59:59' ], ], 2036 => [ [ [2036,3,30,1,0,0],[2036,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2036,10,26,0,59,59],[2036,10,26,2,59,59], '2036033001:00:00','2036033003:00:00','2036102600:59:59','2036102602:59:59' ], [ [2036,10,26,1,0,0],[2036,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2037,3,29,0,59,59],[2037,3,29,1,59,59], '2036102601:00:00','2036102602:00:00','2037032900:59:59','2037032901:59:59' ], ], 2037 => [ [ [2037,3,29,1,0,0],[2037,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2037,10,25,0,59,59],[2037,10,25,2,59,59], '2037032901:00:00','2037032903:00:00','2037102500:59:59','2037102502:59:59' ], [ [2037,10,25,1,0,0],[2037,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2038,3,28,0,59,59],[2038,3,28,1,59,59], '2037102501:00:00','2037102502:00:00','2038032800:59:59','2038032801:59:59' ], ], 2038 => [ [ [2038,3,28,1,0,0],[2038,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2038,10,31,0,59,59],[2038,10,31,2,59,59], '2038032801:00:00','2038032803:00:00','2038103100:59:59','2038103102:59:59' ], [ [2038,10,31,1,0,0],[2038,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2039,3,27,0,59,59],[2039,3,27,1,59,59], '2038103101:00:00','2038103102:00:00','2039032700:59:59','2039032701:59:59' ], ], 2039 => [ [ [2039,3,27,1,0,0],[2039,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2039,10,30,0,59,59],[2039,10,30,2,59,59], '2039032701:00:00','2039032703:00:00','2039103000:59:59','2039103002:59:59' ], [ [2039,10,30,1,0,0],[2039,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2040,3,25,0,59,59],[2040,3,25,1,59,59], '2039103001:00:00','2039103002:00:00','2040032500:59:59','2040032501:59:59' ], ], 2040 => [ [ [2040,3,25,1,0,0],[2040,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2040,10,28,0,59,59],[2040,10,28,2,59,59], '2040032501:00:00','2040032503:00:00','2040102800:59:59','2040102802:59:59' ], [ [2040,10,28,1,0,0],[2040,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2041,3,31,0,59,59],[2041,3,31,1,59,59], '2040102801:00:00','2040102802:00:00','2041033100:59:59','2041033101:59:59' ], ], 2041 => [ [ [2041,3,31,1,0,0],[2041,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2041,10,27,0,59,59],[2041,10,27,2,59,59], '2041033101:00:00','2041033103:00:00','2041102700:59:59','2041102702:59:59' ], [ [2041,10,27,1,0,0],[2041,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2042,3,30,0,59,59],[2042,3,30,1,59,59], '2041102701:00:00','2041102702:00:00','2042033000:59:59','2042033001:59:59' ], ], 2042 => [ [ [2042,3,30,1,0,0],[2042,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2042,10,26,0,59,59],[2042,10,26,2,59,59], '2042033001:00:00','2042033003:00:00','2042102600:59:59','2042102602:59:59' ], [ [2042,10,26,1,0,0],[2042,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2043,3,29,0,59,59],[2043,3,29,1,59,59], '2042102601:00:00','2042102602:00:00','2043032900:59:59','2043032901:59:59' ], ], 2043 => [ [ [2043,3,29,1,0,0],[2043,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2043,10,25,0,59,59],[2043,10,25,2,59,59], '2043032901:00:00','2043032903:00:00','2043102500:59:59','2043102502:59:59' ], [ [2043,10,25,1,0,0],[2043,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2044,3,27,0,59,59],[2044,3,27,1,59,59], '2043102501:00:00','2043102502:00:00','2044032700:59:59','2044032701:59:59' ], ], 2044 => [ [ [2044,3,27,1,0,0],[2044,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2044,10,30,0,59,59],[2044,10,30,2,59,59], '2044032701:00:00','2044032703:00:00','2044103000:59:59','2044103002:59:59' ], [ [2044,10,30,1,0,0],[2044,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2045,3,26,0,59,59],[2045,3,26,1,59,59], '2044103001:00:00','2044103002:00:00','2045032600:59:59','2045032601:59:59' ], ], 2045 => [ [ [2045,3,26,1,0,0],[2045,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2045,10,29,0,59,59],[2045,10,29,2,59,59], '2045032601:00:00','2045032603:00:00','2045102900:59:59','2045102902:59:59' ], [ [2045,10,29,1,0,0],[2045,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2046,3,25,0,59,59],[2046,3,25,1,59,59], '2045102901:00:00','2045102902:00:00','2046032500:59:59','2046032501:59:59' ], ], 2046 => [ [ [2046,3,25,1,0,0],[2046,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2046,10,28,0,59,59],[2046,10,28,2,59,59], '2046032501:00:00','2046032503:00:00','2046102800:59:59','2046102802:59:59' ], [ [2046,10,28,1,0,0],[2046,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2047,3,31,0,59,59],[2047,3,31,1,59,59], '2046102801:00:00','2046102802:00:00','2047033100:59:59','2047033101:59:59' ], ], 2047 => [ [ [2047,3,31,1,0,0],[2047,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2047,10,27,0,59,59],[2047,10,27,2,59,59], '2047033101:00:00','2047033103:00:00','2047102700:59:59','2047102702:59:59' ], [ [2047,10,27,1,0,0],[2047,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2048,3,29,0,59,59],[2048,3,29,1,59,59], '2047102701:00:00','2047102702:00:00','2048032900:59:59','2048032901:59:59' ], ], 2048 => [ [ [2048,3,29,1,0,0],[2048,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2048,10,25,0,59,59],[2048,10,25,2,59,59], '2048032901:00:00','2048032903:00:00','2048102500:59:59','2048102502:59:59' ], [ [2048,10,25,1,0,0],[2048,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2049,3,28,0,59,59],[2049,3,28,1,59,59], '2048102501:00:00','2048102502:00:00','2049032800:59:59','2049032801:59:59' ], ], 2049 => [ [ [2049,3,28,1,0,0],[2049,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2049,10,31,0,59,59],[2049,10,31,2,59,59], '2049032801:00:00','2049032803:00:00','2049103100:59:59','2049103102:59:59' ], [ [2049,10,31,1,0,0],[2049,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2050,3,27,0,59,59],[2050,3,27,1,59,59], '2049103101:00:00','2049103102:00:00','2050032700:59:59','2050032701:59:59' ], ], 2050 => [ [ [2050,3,27,1,0,0],[2050,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2050,10,30,0,59,59],[2050,10,30,2,59,59], '2050032701:00:00','2050032703:00:00','2050103000:59:59','2050103002:59:59' ], [ [2050,10,30,1,0,0],[2050,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2051,3,26,0,59,59],[2051,3,26,1,59,59], '2050103001:00:00','2050103002:00:00','2051032600:59:59','2051032601:59:59' ], ], 2051 => [ [ [2051,3,26,1,0,0],[2051,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2051,10,29,0,59,59],[2051,10,29,2,59,59], '2051032601:00:00','2051032603:00:00','2051102900:59:59','2051102902:59:59' ], [ [2051,10,29,1,0,0],[2051,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2052,3,31,0,59,59],[2052,3,31,1,59,59], '2051102901:00:00','2051102902:00:00','2052033100:59:59','2052033101:59:59' ], ], 2052 => [ [ [2052,3,31,1,0,0],[2052,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2052,10,27,0,59,59],[2052,10,27,2,59,59], '2052033101:00:00','2052033103:00:00','2052102700:59:59','2052102702:59:59' ], [ [2052,10,27,1,0,0],[2052,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2053,3,30,0,59,59],[2053,3,30,1,59,59], '2052102701:00:00','2052102702:00:00','2053033000:59:59','2053033001:59:59' ], ], 2053 => [ [ [2053,3,30,1,0,0],[2053,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2053,10,26,0,59,59],[2053,10,26,2,59,59], '2053033001:00:00','2053033003:00:00','2053102600:59:59','2053102602:59:59' ], [ [2053,10,26,1,0,0],[2053,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2054,3,29,0,59,59],[2054,3,29,1,59,59], '2053102601:00:00','2053102602:00:00','2054032900:59:59','2054032901:59:59' ], ], 2054 => [ [ [2054,3,29,1,0,0],[2054,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2054,10,25,0,59,59],[2054,10,25,2,59,59], '2054032901:00:00','2054032903:00:00','2054102500:59:59','2054102502:59:59' ], [ [2054,10,25,1,0,0],[2054,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2055,3,28,0,59,59],[2055,3,28,1,59,59], '2054102501:00:00','2054102502:00:00','2055032800:59:59','2055032801:59:59' ], ], 2055 => [ [ [2055,3,28,1,0,0],[2055,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2055,10,31,0,59,59],[2055,10,31,2,59,59], '2055032801:00:00','2055032803:00:00','2055103100:59:59','2055103102:59:59' ], [ [2055,10,31,1,0,0],[2055,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2056,3,26,0,59,59],[2056,3,26,1,59,59], '2055103101:00:00','2055103102:00:00','2056032600:59:59','2056032601:59:59' ], ], 2056 => [ [ [2056,3,26,1,0,0],[2056,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2056,10,29,0,59,59],[2056,10,29,2,59,59], '2056032601:00:00','2056032603:00:00','2056102900:59:59','2056102902:59:59' ], [ [2056,10,29,1,0,0],[2056,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2057,3,25,0,59,59],[2057,3,25,1,59,59], '2056102901:00:00','2056102902:00:00','2057032500:59:59','2057032501:59:59' ], ], 2057 => [ [ [2057,3,25,1,0,0],[2057,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2057,10,28,0,59,59],[2057,10,28,2,59,59], '2057032501:00:00','2057032503:00:00','2057102800:59:59','2057102802:59:59' ], [ [2057,10,28,1,0,0],[2057,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2058,3,31,0,59,59],[2058,3,31,1,59,59], '2057102801:00:00','2057102802:00:00','2058033100:59:59','2058033101:59:59' ], ], 2058 => [ [ [2058,3,31,1,0,0],[2058,3,31,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2058,10,27,0,59,59],[2058,10,27,2,59,59], '2058033101:00:00','2058033103:00:00','2058102700:59:59','2058102702:59:59' ], [ [2058,10,27,1,0,0],[2058,10,27,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2059,3,30,0,59,59],[2059,3,30,1,59,59], '2058102701:00:00','2058102702:00:00','2059033000:59:59','2059033001:59:59' ], ], 2059 => [ [ [2059,3,30,1,0,0],[2059,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2059,10,26,0,59,59],[2059,10,26,2,59,59], '2059033001:00:00','2059033003:00:00','2059102600:59:59','2059102602:59:59' ], [ [2059,10,26,1,0,0],[2059,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2060,3,28,0,59,59],[2060,3,28,1,59,59], '2059102601:00:00','2059102602:00:00','2060032800:59:59','2060032801:59:59' ], ], 2060 => [ [ [2060,3,28,1,0,0],[2060,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2060,10,31,0,59,59],[2060,10,31,2,59,59], '2060032801:00:00','2060032803:00:00','2060103100:59:59','2060103102:59:59' ], [ [2060,10,31,1,0,0],[2060,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2061,3,27,0,59,59],[2061,3,27,1,59,59], '2060103101:00:00','2060103102:00:00','2061032700:59:59','2061032701:59:59' ], ], 2061 => [ [ [2061,3,27,1,0,0],[2061,3,27,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2061,10,30,0,59,59],[2061,10,30,2,59,59], '2061032701:00:00','2061032703:00:00','2061103000:59:59','2061103002:59:59' ], [ [2061,10,30,1,0,0],[2061,10,30,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2062,3,26,0,59,59],[2062,3,26,1,59,59], '2061103001:00:00','2061103002:00:00','2062032600:59:59','2062032601:59:59' ], ], 2062 => [ [ [2062,3,26,1,0,0],[2062,3,26,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2062,10,29,0,59,59],[2062,10,29,2,59,59], '2062032601:00:00','2062032603:00:00','2062102900:59:59','2062102902:59:59' ], [ [2062,10,29,1,0,0],[2062,10,29,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2063,3,25,0,59,59],[2063,3,25,1,59,59], '2062102901:00:00','2062102902:00:00','2063032500:59:59','2063032501:59:59' ], ], 2063 => [ [ [2063,3,25,1,0,0],[2063,3,25,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2063,10,28,0,59,59],[2063,10,28,2,59,59], '2063032501:00:00','2063032503:00:00','2063102800:59:59','2063102802:59:59' ], [ [2063,10,28,1,0,0],[2063,10,28,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2064,3,30,0,59,59],[2064,3,30,1,59,59], '2063102801:00:00','2063102802:00:00','2064033000:59:59','2064033001:59:59' ], ], 2064 => [ [ [2064,3,30,1,0,0],[2064,3,30,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2064,10,26,0,59,59],[2064,10,26,2,59,59], '2064033001:00:00','2064033003:00:00','2064102600:59:59','2064102602:59:59' ], [ [2064,10,26,1,0,0],[2064,10,26,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2065,3,29,0,59,59],[2065,3,29,1,59,59], '2064102601:00:00','2064102602:00:00','2065032900:59:59','2065032901:59:59' ], ], 2065 => [ [ [2065,3,29,1,0,0],[2065,3,29,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2065,10,25,0,59,59],[2065,10,25,2,59,59], '2065032901:00:00','2065032903:00:00','2065102500:59:59','2065102502:59:59' ], [ [2065,10,25,1,0,0],[2065,10,25,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2066,3,28,0,59,59],[2066,3,28,1,59,59], '2065102501:00:00','2065102502:00:00','2066032800:59:59','2066032801:59:59' ], ], 2066 => [ [ [2066,3,28,1,0,0],[2066,3,28,3,0,0],'+02:00:00',[2,0,0], 'CEST',1,[2066,10,31,0,59,59],[2066,10,31,2,59,59], '2066032801:00:00','2066032803:00:00','2066103100:59:59','2066103102:59:59' ], [ [2066,10,31,1,0,0],[2066,10,31,2,0,0],'+01:00:00',[1,0,0], 'CET',0,[2067,3,27,0,59,59],[2067,3,27,1,59,59], '2066103101:00:00','2066103102:00:00','2067032700:59:59','2067032701:59:59' ], ], ); %LastRule = ( 'zone' => { 'dstoff' => '+02:00:00', 'stdoff' => '+01:00:00', }, 'rules' => { '03' => { 'flag' => 'last', 'dow' => '7', 'num' => '0', 'type' => 'u', 'time' => '01:00:00', 'isdst' => '1', 'abb' => 'CEST', }, '10' => { 'flag' => 'last', 'dow' => '7', 'num' => '0', 'type' => 'u', 'time' => '01:00:00', 'isdst' => '0', 'abb' => 'CET', }, }, ); 1;
49.274244
88
0.504063
edcf1f39763666a421bb51f9f48cc1961a6e7d21
3,460
pm
Perl
auto-lib/Paws/DMS/DescribeReplicationTasks.pm
shogo82148/aws-sdk-perl
a87555a9d30dd1415235ebacd2715b2f7e5163c7
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/DMS/DescribeReplicationTasks.pm
shogo82148/aws-sdk-perl
a87555a9d30dd1415235ebacd2715b2f7e5163c7
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/DMS/DescribeReplicationTasks.pm
shogo82148/aws-sdk-perl
a87555a9d30dd1415235ebacd2715b2f7e5163c7
[ "Apache-2.0" ]
null
null
null
package Paws::DMS::DescribeReplicationTasks; use Moose; has Filters => (is => 'ro', isa => 'ArrayRef[Paws::DMS::Filter]'); has Marker => (is => 'ro', isa => 'Str'); has MaxRecords => (is => 'ro', isa => 'Int'); has WithoutSettings => (is => 'ro', isa => 'Bool'); use MooseX::ClassAttribute; class_has _api_call => (isa => 'Str', is => 'ro', default => 'DescribeReplicationTasks'); class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::DMS::DescribeReplicationTasksResponse'); class_has _result_key => (isa => 'Str', is => 'ro'); 1; ### main pod documentation begin ### =head1 NAME Paws::DMS::DescribeReplicationTasks - Arguments for method DescribeReplicationTasks on L<Paws::DMS> =head1 DESCRIPTION This class represents the parameters used for calling the method DescribeReplicationTasks on the L<AWS Database Migration Service|Paws::DMS> service. Use the attributes of this class as arguments to method DescribeReplicationTasks. You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to DescribeReplicationTasks. =head1 SYNOPSIS my $dms = Paws->service('DMS'); my $DescribeReplicationTasksResponse = $dms->DescribeReplicationTasks( Filters => [ { Name => 'MyString', Values => [ 'MyString', ... ], }, ... ], # OPTIONAL Marker => 'MyString', # OPTIONAL MaxRecords => 1, # OPTIONAL WithoutSettings => 1, # OPTIONAL ); # Results: my $Marker = $DescribeReplicationTasksResponse->Marker; my $ReplicationTasks = $DescribeReplicationTasksResponse->ReplicationTasks; # Returns a L<Paws::DMS::DescribeReplicationTasksResponse> 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/dms/DescribeReplicationTasks> =head1 ATTRIBUTES =head2 Filters => ArrayRef[L<Paws::DMS::Filter>] Filters applied to the describe action. Valid filter names: replication-task-arn | replication-task-id | migration-type | endpoint-arn | replication-instance-arn =head2 Marker => Str An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the marker, up to the value specified by C<MaxRecords>. =head2 MaxRecords => Int The maximum number of records to include in the response. If more records exist than the specified C<MaxRecords> value, a pagination token called a marker is included in the response so that the remaining results can be retrieved. Default: 100 Constraints: Minimum 20, maximum 100. =head2 WithoutSettings => Bool An option to set to avoid returning information about settings. Use this to reduce overhead when setting information is too large. To use this option, choose C<true>; otherwise, choose C<false> (the default). =head1 SEE ALSO This class forms part of L<Paws>, documenting arguments for method DescribeReplicationTasks in L<Paws::DMS> =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.454545
249
0.709538
ed7688a6b4335901aaeeedd0cea96d21afc26df8
887
pm
Perl
lib/WebService/MinFraud/Data/Rx/Type/IPAddress.pm
lapakio/minfraud-api-perl
4a839947b7d417f8b4b1b499d75202107bef0187
[ "Artistic-1.0" ]
null
null
null
lib/WebService/MinFraud/Data/Rx/Type/IPAddress.pm
lapakio/minfraud-api-perl
4a839947b7d417f8b4b1b499d75202107bef0187
[ "Artistic-1.0" ]
null
null
null
lib/WebService/MinFraud/Data/Rx/Type/IPAddress.pm
lapakio/minfraud-api-perl
4a839947b7d417f8b4b1b499d75202107bef0187
[ "Artistic-1.0" ]
null
null
null
package WebService::MinFraud::Data::Rx::Type::IPAddress; use 5.010; use strict; use warnings; use namespace::autoclean; our $VERSION = '1.009002'; use Data::Validate::IP; use parent 'Data::Rx::CommonType::EasyNew'; use Role::Tiny::With; with 'WebService::MinFraud::Role::Data::Rx::Type'; sub assert_valid { my ( $self, $value ) = @_; return 1 if $value && ( Data::Validate::IP::is_ipv4($value) || Data::Validate::IP::is_ipv6($value) ); $self->fail( { error => [qw(type)], message => 'Found value is not an IP address, neither version 4 nor 6.', value => $value, } ); } sub type_uri { ## no critic(ValuesAndExpressions::ProhibitCommaSeparatedStatements) 'tag:maxmind.com,MAXMIND:rx/ip'; } 1; # ABSTRACT: A type to check for a valid IP address, version 4 or 6
19.711111
77
0.595265
edb10450f7c77e0f2ec368f10691c0de233d929c
794
pm
Perl
env/Library/usr/share/perl5/vendor_perl/URI/IRI.pm
h4vlik/TF2_OD_BRE
54643b6e8e9d76847329b1dbda69efa1c7ae3e72
[ "BSD-3-Clause" ]
16
2020-09-20T22:32:54.000Z
2021-04-02T17:14:25.000Z
usr/share/perl5/vendor_perl/URI/IRI.pm
Felipe-Souza-Pereira-Lima/didactic-funicular
88d902f879b6ad976a1b418e93f8bd2a11ba6cd8
[ "MIT" ]
98
2017-11-02T19:00:44.000Z
2022-03-22T16:15:39.000Z
usr/share/perl5/vendor_perl/URI/IRI.pm
Felipe-Souza-Pereira-Lima/didactic-funicular
88d902f879b6ad976a1b418e93f8bd2a11ba6cd8
[ "MIT" ]
9
2016-10-21T08:18:57.000Z
2021-05-23T14:19:21.000Z
package URI::IRI; # Experimental use strict; use warnings; use URI (); use overload '""' => sub { shift->as_string }; our $VERSION = '1.76'; sub new { my($class, $uri, $scheme) = @_; utf8::upgrade($uri); return bless { uri => URI->new($uri, $scheme), }, $class; } sub clone { my $self = shift; return bless { uri => $self->{uri}->clone, }, ref($self); } sub as_string { my $self = shift; return $self->{uri}->as_iri; } our $AUTOLOAD; sub AUTOLOAD { my $method = substr($AUTOLOAD, rindex($AUTOLOAD, '::')+2); # We create the function here so that it will not need to be # autoloaded the next time. no strict 'refs'; *$method = sub { shift->{uri}->$method(@_) }; goto &$method; } sub DESTROY {} # avoid AUTOLOADing it 1;
16.541667
64
0.576826
ed57562ac255d7f6ab1c5ee37a46849a8d22d8af
2,428
pm
Perl
auto-lib/Paws/Amplify/DeleteDomainAssociation.pm
meis/aws-sdk-perl
6d61ffcf351e446f06d7e84e53caa08d98573959
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/Amplify/DeleteDomainAssociation.pm
meis/aws-sdk-perl
6d61ffcf351e446f06d7e84e53caa08d98573959
[ "Apache-2.0" ]
1
2021-05-26T19:13:58.000Z
2021-05-26T19:13:58.000Z
auto-lib/Paws/Amplify/DeleteDomainAssociation.pm
meis/aws-sdk-perl
6d61ffcf351e446f06d7e84e53caa08d98573959
[ "Apache-2.0" ]
null
null
null
package Paws::Amplify::DeleteDomainAssociation; use Moose; has AppId => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'appId', required => 1); has DomainName => (is => 'ro', isa => 'Str', traits => ['ParamInURI'], uri_name => 'domainName', required => 1); use MooseX::ClassAttribute; class_has _api_call => (isa => 'Str', is => 'ro', default => 'DeleteDomainAssociation'); class_has _api_uri => (isa => 'Str', is => 'ro', default => '/apps/{appId}/domains/{domainName}'); class_has _api_method => (isa => 'Str', is => 'ro', default => 'DELETE'); class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::Amplify::DeleteDomainAssociationResult'); 1; ### main pod documentation begin ### =head1 NAME Paws::Amplify::DeleteDomainAssociation - Arguments for method DeleteDomainAssociation on L<Paws::Amplify> =head1 DESCRIPTION This class represents the parameters used for calling the method DeleteDomainAssociation on the L<AWS Amplify|Paws::Amplify> service. Use the attributes of this class as arguments to method DeleteDomainAssociation. You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to DeleteDomainAssociation. =head1 SYNOPSIS my $amplify = Paws->service('Amplify'); my $DeleteDomainAssociationResult = $amplify->DeleteDomainAssociation( AppId => 'MyAppId', DomainName => 'MyDomainName', ); # Results: my $DomainAssociation = $DeleteDomainAssociationResult->DomainAssociation; # Returns a L<Paws::Amplify::DeleteDomainAssociationResult> 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/amplify/DeleteDomainAssociation> =head1 ATTRIBUTES =head2 B<REQUIRED> AppId => Str Unique Id for an Amplify App. =head2 B<REQUIRED> DomainName => Str Name of the domain. =head1 SEE ALSO This class forms part of L<Paws>, documenting arguments for method DeleteDomainAssociation in L<Paws::Amplify> =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
32.810811
249
0.719934
edaed42af0099199f012036fa82cc46bdc2acb6d
288
t
Perl
t/Map-Tube-Tbilisi/07-name.t
manwar/Map-Tube-Tbilisi
d99c32c1163f9573af9cd7649a4041f5ec55d049
[ "Artistic-2.0", "BSD-2-Clause" ]
null
null
null
t/Map-Tube-Tbilisi/07-name.t
manwar/Map-Tube-Tbilisi
d99c32c1163f9573af9cd7649a4041f5ec55d049
[ "Artistic-2.0", "BSD-2-Clause" ]
null
null
null
t/Map-Tube-Tbilisi/07-name.t
manwar/Map-Tube-Tbilisi
d99c32c1163f9573af9cd7649a4041f5ec55d049
[ "Artistic-2.0", "BSD-2-Clause" ]
1
2019-05-20T16:15:19.000Z
2019-05-20T16:15:19.000Z
# Pragmas. use strict; use warnings; # Modules. use Encode qw(decode_utf8); use Map::Tube::Tbilisi; use Test::More tests => 2; use Test::NoWarnings; # Test. my $metro = Map::Tube::Tbilisi->new; my $ret = $metro->name; is($ret, decode_utf8('თბილისის მეტროპოლიტენი'), 'Get metro name.');
19.2
67
0.6875
edd19b7b04a5e80d4ad02f35f523c3987d12ca7f
1,385
pl
Perl
42ver2.pl
cjbednarzyk/project-euler
9e39177e9082dd5c62e50c2225582e640258951b
[ "MIT" ]
null
null
null
42ver2.pl
cjbednarzyk/project-euler
9e39177e9082dd5c62e50c2225582e640258951b
[ "MIT" ]
null
null
null
42ver2.pl
cjbednarzyk/project-euler
9e39177e9082dd5c62e50c2225582e640258951b
[ "MIT" ]
null
null
null
for($idx=3;$idx<10;$idx++) { $permTmp=findPermutations ($idx); @permTmp=@{$permTmp}; @perm=(@perm,@permTmp); print "$#permTmp\n"; } print "Sorting list of pandigital numbers...\n"; @perm=sort {$b <=> $a} @perm; print "Testing ".scalar(@perm)." numbers for primality...\n"; for($idx=0;$idx<=$#perm;$idx++) { if($idx % 100 == 0) { print "Testing $idx of ".scalar(@perm)." numbers for primality...\n"; } if(isPrime($perm[$idx])) { last; } } print "The largest n-digit pandigital prime is: $perm[$idx]\n"; <>; sub findPermutations { my $nbrMax=shift; print "Deriving permutations of length = $nbrMax...\n"; my @permutations=(1); my @permTemp; for(my $idxLen=2;$idxLen<=$nbrMax;$idxLen++) { for(my $idxPerm=0;$idxPerm<=$#permutations;$idxPerm++) { for(my $idxCopy=0;$idxCopy<$idxLen;$idxCopy++) { push @permTemp,$permutations[$idxPerm]; $permTemp[$#permTemp]=substr($permTemp[$#permTemp],0,$idxLen-1-$idxCopy).$idxLen.substr($permTemp[$#permTemp],$idxLen-1-$idxCopy,$idxCopy); } } @permutations=@permTemp; $#permTemp=-1; } return \@permutations; } sub isPrime { my $x = shift; my $limit = $x; my $numDiv = 0; for(my $currInt=1;$currInt<$limit;++$currInt) { if($x % $currInt == 0) { $limit = $x / $currInt; $numDiv++; if($numDiv>1) {return 0;} } } return 1; }
25.181818
147
0.587004
edc359316c02e5017fe72088e9888c4ee3f3bd98
10,826
pl
Perl
test/perl/TestServer.pl
shivam00/thrift
d81e9e3d22c130ef5ddba7b06fb9802267d9d1d7
[ "Apache-2.0" ]
2
2018-09-30T09:37:22.000Z
2020-05-07T01:53:04.000Z
test/perl/TestServer.pl
shivam00/thrift
d81e9e3d22c130ef5ddba7b06fb9802267d9d1d7
[ "Apache-2.0" ]
null
null
null
test/perl/TestServer.pl
shivam00/thrift
d81e9e3d22c130ef5ddba7b06fb9802267d9d1d7
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env perl # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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 5.10.0; use strict; use warnings; use Data::Dumper; use Getopt::Long qw(GetOptions); use Time::HiRes qw(gettimeofday); $SIG{INT} = \&sigint_handler; use lib '../../lib/perl/lib'; use lib 'gen-perl'; use Thrift; use Thrift::BinaryProtocol; use Thrift::BufferedTransport; use Thrift::FramedTransport; use Thrift::MultiplexedProcessor; use Thrift::SSLServerSocket; use Thrift::ServerSocket; use Thrift::Server; use Thrift::UnixServerSocket; use ThriftTest::SecondService; use ThriftTest::ThriftTest; use ThriftTest::Types; $|++; sub usage { print <<EOF; Usage: $0 [OPTIONS] Options: (default) --ca Certificate authority file (optional). --cert Certificate file. Required if using --ssl. --ciphers Acceptable cipher list. --domain-socket <file> Use a unix domain socket. --help Show usage. --key Private key file for certificate. Required if using --ssl and private key is not in the certificate file. --port <portnum> 9090 Port to use. --protocol {binary} binary Protocol to use. --ssl If present, use SSL/TLS. --transport {buffered|framed} buffered Transport to use. EOF } my %opts = ( 'port' => 9090, 'protocol' => 'binary', 'transport' => 'buffered' ); GetOptions(\%opts, qw ( ca=s cert=s ciphers=s domain-socket=s help host=s key=s port=i protocol=s ssl transport=s )) || exit 1; if ($opts{help}) { usage(); exit 0; } if ($opts{ssl} and not defined $opts{cert}) { usage(); exit 1; } my $handler = new ThriftTestHandler(); my $handler2 = new SecondServiceHandler(); my $processor = new ThriftTest::ThriftTestProcessor($handler); my $processor2 = new ThriftTest::SecondServiceProcessor($handler2); my $serversocket; if ($opts{"domain-socket"}) { unlink($opts{"domain-socket"}); $serversocket = new Thrift::UnixServerSocket($opts{"domain-socket"}); } elsif ($opts{ssl}) { $serversocket = new Thrift::SSLServerSocket(\%opts); } else { $serversocket = new Thrift::ServerSocket(\%opts); } my $transport; if ($opts{transport} eq 'buffered') { $transport = new Thrift::BufferedTransportFactory(); } elsif ($opts{transport} eq 'framed') { $transport = new Thrift::FramedTransportFactory(); } else { usage(); exit 1; } my $protocol; if ($opts{protocol} eq 'binary' || $opts{protocol} eq 'multi') { $protocol = new Thrift::BinaryProtocolFactory(); } else { usage(); exit 1; } if (index($opts{protocol}, 'multi') == 0) { my $newProcessor = new Thrift::MultiplexedProcessor($protocol); $newProcessor->defaultProcessor($processor); $newProcessor->registerProcessor("ThriftTest", $processor); $newProcessor->registerProcessor("SecondService", $processor2); $processor = $newProcessor; } my $ssltag = ''; if ($opts{ssl}) { $ssltag = "(SSL)"; } my $listening_on = "$opts{port} $ssltag"; if ($opts{"domain-socket"}) { $listening_on = $opts{"domain-socket"}; } my $server = new Thrift::SimpleServer($processor, $serversocket, $transport, $protocol); print "Starting \"simple\" server ($opts{transport}/$opts{protocol}) listen on: $listening_on\n"; $server->serve(); print "done.\n"; sub sigint_handler { print "received SIGINT, stopping...\n"; $server->stop(); } ### ### Test server implementation ### package ThriftTestHandler; use base qw( ThriftTest::ThriftTestIf ); sub new { my $classname = shift; my $self = {}; return bless($self, $classname); } sub testVoid() { print("testVoid()\n"); } sub testString() { my $self = shift; my $thing = shift; print("testString($thing)\n"); return $thing; } sub testBool() { my $self = shift; my $thing = shift; my $str = $thing ? "true" : "false"; print("testBool($str)\n"); return $thing; } sub testByte() { my $self = shift; my $thing = shift; print("testByte($thing)\n"); return $thing; } sub testI32() { my $self = shift; my $thing = shift; print("testI32($thing)\n"); return $thing; } sub testI64() { my $self = shift; my $thing = shift; print("testI64($thing)\n"); return $thing; } sub testDouble() { my $self = shift; my $thing = shift; print("testDouble($thing)\n"); return $thing; } sub testBinary() { my $self = shift; my $thing = shift; my @bytes = split //, $thing; print("testBinary("); foreach (@bytes) { printf "%02lx", ord $_; } print(")\n"); return $thing; } sub testStruct() { my $self = shift; my $thing = shift; printf("testStruct({\"%s\", %d, %d, %lld})\n", $thing->{string_thing}, $thing->{byte_thing}, $thing->{i32_thing}, $thing->{i64_thing}); return $thing; } sub testNest() { my $self = shift; my $nest = shift; my $thing = $nest->{struct_thing}; printf("testNest({%d, {\"%s\", %d, %d, %lld}, %d})\n", $nest->{byte_thing}, $thing->{string_thing}, $thing->{byte_thing}, $thing->{i32_thing}, $thing->{i64_thing}, $nest->{i32_thing}); return $nest; } sub testMap() { my $self = shift; my $thing = shift; print("testMap({"); my $first = 1; foreach my $key (keys %$thing) { if ($first) { $first = 0; } else { print(", "); } print("$key => $thing->{$key}"); } print("})\n"); return $thing; } sub testStringMap() { my $self = shift; my $thing = shift; print("testStringMap({"); my $first = 1; foreach my $key (keys %$thing) { if ($first) { $first = 0; } else { print(", "); } print("$key => $thing->{$key}"); } print("})\n"); return $thing; } sub testSet() { my $self = shift; my $thing = shift; my @arr; my $result = \@arr; print("testSet({"); my $first = 1; foreach my $key (keys %$thing) { if ($first) { $first = 0; } else { print(", "); } print("$key"); push(@arr, $key); } print("})\n"); return $result; } sub testList() { my $self = shift; my $thing = shift; print("testList({"); my $first = 1; foreach my $key (@$thing) { if ($first) { $first = 0; } else { print(", "); } print("$key"); } print("})\n"); return $thing; } sub testEnum() { my $self = shift; my $thing = shift; print("testEnum($thing)\n"); return $thing; } sub testTypedef() { my $self = shift; my $thing = shift; print("testTypedef($thing)\n"); return $thing; } sub testMapMap() { my $self = shift; my $hello = shift; printf("testMapMap(%d)\n", $hello); my $result = { 4 => { 1 => 1, 2 => 2, 3 => 3, 4 => 4 }, -4 => { -1 => -1, -2 => -2, -3 => -3, -4 => -4 } }; return $result; } sub testInsanity() { my $self = shift; my $argument = shift; print("testInsanity()\n"); my $hello = new ThriftTest::Xtruct({string_thing => "Hello2", byte_thing => 2, i32_thing => 2, i64_thing => 2}); my @hellos; push(@hellos, $hello); my $goodbye = new ThriftTest::Xtruct({string_thing => "Goodbye4", byte_thing => 4, i32_thing => 4, i64_thing => 4}); my @goodbyes; push(@goodbyes, $goodbye); my $crazy = new ThriftTest::Insanity({userMap => { ThriftTest::Numberz::EIGHT => 8 }, xtructs => \@goodbyes}); my $loony = new ThriftTest::Insanity(); my $result = { 1 => { ThriftTest::Numberz::TWO => $argument, ThriftTest::Numberz::THREE => $argument }, 2 => { ThriftTest::Numberz::SIX => $loony } }; return $result; } sub testMulti() { my $self = shift; my $arg0 = shift; my $arg1 = shift; my $arg2 = shift; my $arg3 = shift; my $arg4 = shift; my $arg5 = shift; print("testMulti()\n"); return new ThriftTest::Xtruct({string_thing => "Hello2", byte_thing => $arg0, i32_thing => $arg1, i64_thing => $arg2}); } sub testException() { my $self = shift; my $arg = shift; print("testException($arg)\n"); if ($arg eq "Xception") { die new ThriftTest::Xception({errorCode => 1001, message => $arg}); } elsif ($arg eq "TException") { die "astring"; # all unhandled exceptions become TExceptions } else { return new ThriftTest::Xtruct({string_thing => $arg}); } } sub testMultiException() { my $self = shift; my $arg0 = shift; my $arg1 = shift; printf("testMultiException(%s, %s)\n", $arg0, $arg1); if ($arg0 eq "Xception") { die new ThriftTest::Xception({errorCode => 1001, message => "This is an Xception"}); } elsif ($arg0 eq "Xception2") { my $struct_thing = new ThriftTest::Xtruct({string_thing => "This is an Xception2"}); die new ThriftTest::Xception2({errorCode => 2002, struct_thing => $struct_thing}); } else { return new ThriftTest::Xtruct({string_thing => $arg1}); } } sub testOneway() { my $self = shift; my $num = shift; print("testOneway($num): received\n"); } ### ### Test server implementation ### package SecondServiceHandler; use base qw( ThriftTest::SecondServiceIf ); sub new { my $classname = shift; my $self = {}; return bless($self, $classname); } sub secondtestString() { my $self = shift; my $thing = shift; print("testString($thing)\n"); return "testString(\"" . $thing . "\")"; } 1;
24.660592
122
0.560872
edd7f3782ea9cbf323a8611287c5cbe8ca5a4bb0
1,303
pl
Perl
probs/SYN/SYN977+1.pl
ptarau/TypesAndProofs
ca9e4347d3dabb3531d38bdef6aafaa41a30555d
[ "Apache-2.0" ]
25
2018-07-19T00:08:18.000Z
2022-02-08T23:07:12.000Z
probs/SYN/SYN977+1.pl
ptarau/TypesAndProofs
ca9e4347d3dabb3531d38bdef6aafaa41a30555d
[ "Apache-2.0" ]
null
null
null
probs/SYN/SYN977+1.pl
ptarau/TypesAndProofs
ca9e4347d3dabb3531d38bdef6aafaa41a30555d
[ "Apache-2.0" ]
4
2019-01-12T17:02:14.000Z
2021-11-23T08:16:09.000Z
%-------------------------------------------------------------------------- % File : SYN977+1 : ILTP v1.1.2 % Domain : Syntactic % Problem : Syntactic from Shults % Version : Especial. % English : % Refs : [Shu04] Shults (2004), Email to G. Sutcliffe % Source : [Shu04] % Names : % Status : Theorem % Rating : 0.11 v3.1.0 % % Status (intuit.) : Non-Theorem % Rating (intuit.) : 0.00 v1.1.0 % % Syntax : Number of formulae : 1 ( 0 unit) % Number of atoms : 4 ( 0 equality) % Maximal formula depth : 3 ( 3 average) % Number of connectives : 3 ( 0 ~ ; 2 v; 0 &) % ( 1 <->; 0 ->; 0 <-) % ( 0 <~>; 0 ~v; 0 ~&) % Number of predicates : 2 ( 2 propositional; 0-0 arity) % Number of functors : 0 ( 0 constant; --- arity) % Number of variables : 0 ( 0 singleton; 0 !; 0 ?) % Maximal term depth : 0 ( 0 average) % Comments : %-------------------------------------------------------------------------- fof(prove_this,conjecture, ( ( a <-> b ) v a v b )). %--------------------------------------------------------------------------
34.289474
75
0.363776
ede85d87774de11da3090c07136888cb8af5d794
329
pl
Perl
etc/test/perl/pygments.pl
d0nkey8/dotfiles
77c1376365ab7a1217b6d0df9ec7cd72356754be
[ "Vim", "curl", "MIT" ]
null
null
null
etc/test/perl/pygments.pl
d0nkey8/dotfiles
77c1376365ab7a1217b6d0df9ec7cd72356754be
[ "Vim", "curl", "MIT" ]
null
null
null
etc/test/perl/pygments.pl
d0nkey8/dotfiles
77c1376365ab7a1217b6d0df9ec7cd72356754be
[ "Vim", "curl", "MIT" ]
null
null
null
#!/usr/bin/perl use strict; use warnings; use Test::More; sub which($) { my $cmd = shift or die; my @path = split /:/, $ENV{'PATH'}; foreach (@path) { if (-x "$_/$cmd") { return 1; } } } system("yes | bash ./install_pygments.sh"); ok $? == 0; ok which('pygmentize'); done_testing;
14.954545
43
0.516717
ede68650cdc887bc523c2784c6558ee090f34107
2,830
pm
Perl
lib/Google/Ads/AdWords/v201809/AdSharingError.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/AdSharingError.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/AdSharingError.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::AdSharingError; use strict; use warnings; __PACKAGE__->_set_element_form_qualified(1); sub get_xmlns { 'https://adwords.google.com/api/adwords/cm/v201809' }; our $XML_ATTRIBUTE_CLASS; undef $XML_ATTRIBUTE_CLASS; sub __get_attr_class { return $XML_ATTRIBUTE_CLASS; } use base qw(Google::Ads::AdWords::v201809::ApiError); # Variety: sequence use Class::Std::Fast::Storable constructor => 'none'; use base qw(Google::Ads::SOAP::Typelib::ComplexType); { # BLOCK to scope variables my %fieldPath_of :ATTR(:get<fieldPath>); my %fieldPathElements_of :ATTR(:get<fieldPathElements>); my %trigger_of :ATTR(:get<trigger>); my %errorString_of :ATTR(:get<errorString>); my %ApiError__Type_of :ATTR(:get<ApiError__Type>); my %reason_of :ATTR(:get<reason>); my %sharedAdError_of :ATTR(:get<sharedAdError>); __PACKAGE__->_factory( [ qw( fieldPath fieldPathElements trigger errorString ApiError__Type reason sharedAdError ) ], { 'fieldPath' => \%fieldPath_of, 'fieldPathElements' => \%fieldPathElements_of, 'trigger' => \%trigger_of, 'errorString' => \%errorString_of, 'ApiError__Type' => \%ApiError__Type_of, 'reason' => \%reason_of, 'sharedAdError' => \%sharedAdError_of, }, { 'fieldPath' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', 'fieldPathElements' => 'Google::Ads::AdWords::v201809::FieldPathElement', 'trigger' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', 'errorString' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', 'ApiError__Type' => 'SOAP::WSDL::XSD::Typelib::Builtin::string', 'reason' => 'Google::Ads::AdWords::v201809::AdSharingError::Reason', 'sharedAdError' => 'Google::Ads::AdWords::v201809::ApiError', }, { 'fieldPath' => 'fieldPath', 'fieldPathElements' => 'fieldPathElements', 'trigger' => 'trigger', 'errorString' => 'errorString', 'ApiError__Type' => 'ApiError.Type', 'reason' => 'reason', 'sharedAdError' => 'sharedAdError', } ); } # end BLOCK 1; =pod =head1 NAME Google::Ads::AdWords::v201809::AdSharingError =head1 DESCRIPTION Perl data type class for the XML Schema defined complexType AdSharingError from the namespace https://adwords.google.com/api/adwords/cm/v201809. Errors related using the AdGroupAdService to create an AdGroupAd with a reference to an existing AdId. =head2 PROPERTIES The following properties may be accessed using get_PROPERTY / set_PROPERTY methods: =over =item * reason =item * sharedAdError =back =head1 METHODS =head2 new Constructor. The following data structure may be passed to new(): =head1 AUTHOR Generated by SOAP::WSDL =cut
20.962963
103
0.665018
eda9fad17f2ca5e91cb596a1769962989d2305f0
8,431
pm
Perl
cloud/aws/kinesis/mode/recordsstats.pm
centreon-lab/centreon-plugins
68096c697a9e1baf89a712674a193d9a9321503c
[ "Apache-2.0" ]
null
null
null
cloud/aws/kinesis/mode/recordsstats.pm
centreon-lab/centreon-plugins
68096c697a9e1baf89a712674a193d9a9321503c
[ "Apache-2.0" ]
null
null
null
cloud/aws/kinesis/mode/recordsstats.pm
centreon-lab/centreon-plugins
68096c697a9e1baf89a712674a193d9a9321503c
[ "Apache-2.0" ]
null
null
null
# # Copyright 2022 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 cloud::aws::kinesis::mode::recordsstats; use base qw(centreon::plugins::templates::counter); use strict; use warnings; my %metrics_mapping = ( 'GetRecords.IteratorAgeMilliseconds' => { 'output' => 'Get Records Iterator Age', 'label' => 'records-get-iteratorage', 'nlabel' => 'kinesis.stream.records.get.iteratorage.milliseconds', 'perf_unit' => 'ms', 'change_bytes' => '0', 'stats' => { 'sum' => 'false' } }, 'GetRecords.Bytes' => { 'output' => 'Get Records Bytes', 'label' => 'records-get-volume', 'nlabel' => 'kinesis.stream.records.get.volume.bytes', 'perf_unit' => 'B', 'change_bytes' => '2', }, 'GetRecords.Latency' => { 'output' => 'Get Records Latency', 'label' => 'records-get-latency', 'nlabel' => 'kinesis.stream.records.get.latency.milliseconds', 'perf_unit' => 'ms', 'change_bytes' => '0', 'stats' => { 'sum' => 'false' } }, 'GetRecords.Success' => { 'output' => 'Get Records Success', 'label' => 'records-get-success', 'nlabel' => 'kinesis.stream.records.get.success.count', 'perf_unit' => '', 'change_bytes' => '0', 'stats' => { 'average' => 'false' } }, 'PutRecord.Latency' => { 'output' => 'Put Records Latency', 'label' => 'records-put-latency', 'nlabel' => 'kinesis.stream.records.put.latency.milliseconds', 'perf_unit' => 'ms', 'change_bytes' => '0', 'stats' => { 'sum' => 'false' } }, 'PutRecord.Bytes' => { 'output' => 'Put Records Bytes', 'label' => 'records-put-volume', 'nlabel' => 'kinesis.stream.records.put.volume.bytes', 'perf_unit' => 'B', 'change_bytes' => '2' }, 'PutRecord.Success' => { 'output' => 'Put Records Success', 'label' => 'records-put-success', 'nlabel' => 'kinesis.stream.records.put.success.count', 'perf_unit' => '', 'change_bytes' => '0', 'stats' => { 'average' => 'false' } }, ); sub prefix_metric_output { my ($self, %options) = @_; return " '" . $options{instance_value}->{display} . "' "; } sub prefix_statistics_output { my ($self, %options) = @_; return "Statistic '" . $options{instance_value}->{display} . "' Metrics "; } sub long_output { my ($self, %options) = @_; return "Checking'" . $options{instance_value}->{display} . "' "; } sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ { name => 'metrics', type => 3, cb_prefix_output => 'prefix_metric_output', cb_long_output => 'long_output', message_multiple => 'All records to streams metrics are ok', indent_long_output => ' ', group => [ { name => 'statistics', display_long => 1, cb_prefix_output => 'prefix_statistics_output', message_multiple => 'All records to streams metrics are ok', type => 1, skipped_code => { -10 => 1 } }, ] } ]; foreach my $metric (keys %metrics_mapping) { my $entry = { label => $metrics_mapping{$metric}->{label}, nlabel => $metrics_mapping{$metric}->{nlabel}, set => { key_values => [ { name => $metric }, { name => 'display' } ], output_template => ($metrics_mapping{$metric}->{change_bytes} != 0) ? $metrics_mapping{$metric}->{output} . ': %.2f %s' : $metrics_mapping{$metric}->{output} . ': %.2f', change_bytes => $metrics_mapping{$metric}->{output_change_bytes}, perfdatas => [ { value => $metric , template => '%.2f', label_extra_instance => 1, unit => $metrics_mapping{$metric}->{perf_unit} } ], } }; push @{$self->{maps_counters}->{statistics}}, $entry; } } sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, force_new_perfdata => 1, %options); bless $self, $class; $options{options}->add_options(arguments => { 'stream-name:s@' => { name => 'stream_name' }, 'filter-metric:s' => { name => 'filter_metric' }, }); return $self; } sub check_options { my ($self, %options) = @_; $self->SUPER::check_options(%options); foreach my $instance (@{$self->{option_results}->{stream_name}}) { if ($instance ne '') { push @{$self->{aws_instance}}, $instance; } } $self->{aws_timeframe} = defined($self->{option_results}->{timeframe}) ? $self->{option_results}->{timeframe} : 600; $self->{aws_period} = defined($self->{option_results}->{period}) ? $self->{option_results}->{period} : 60; $self->{aws_statistics} = ['Average','Sum']; if (defined($self->{option_results}->{statistic})) { $self->{aws_statistics} = []; foreach my $stat (@{$self->{option_results}->{statistic}}) { if ($stat ne '') { push @{$self->{aws_statistics}}, ucfirst(lc($stat)); } } } foreach my $metric (keys %metrics_mapping) { next if (defined($self->{option_results}->{filter_metric}) && $self->{option_results}->{filter_metric} ne '' && $metric !~ /$self->{option_results}->{filter_metric}/); push @{$self->{aws_metrics}}, $metric; } } sub manage_selection { my ($self, %options) = @_; my %metric_results; foreach my $instance (@{$self->{aws_instance}}) { $metric_results{$instance} = $options{custom}->cloudwatch_get_metrics( namespace => 'AWS/Kinesis', dimensions => [ { Name => 'StreamName', Value => $instance } ], metrics => $self->{aws_metrics}, statistics => $self->{aws_statistics}, timeframe => $self->{aws_timeframe}, period => $self->{aws_period}, ); foreach my $metric (@{$self->{aws_metrics}}) { foreach my $statistic (@{$self->{aws_statistics}}) { next if (!defined($metric_results{$instance}->{$metric}->{lc($statistic)}) && !defined($self->{option_results}->{zeroed}) || defined($metrics_mapping{$metric}->{stats}->{lc($statistic)}) && $metrics_mapping{$metric}->{stats}->{lc($statistic)} eq "false"); $self->{metrics}->{$instance}->{display} = $instance; $self->{metrics}->{$instance}->{statistics}->{lc($statistic)}->{display} = $statistic; $self->{metrics}->{$instance}->{statistics}->{lc($statistic)}->{$metric} = defined($metric_results{$instance}->{$metric}->{lc($statistic)}) ? $metric_results{$instance}->{$metric}->{lc($statistic)} : 0; } } } if (scalar(keys %{$self->{metrics}}) <= 0) { $self->{output}->add_option_msg(short_msg => 'No metrics. Check your options or use --zeroed option to set 0 on undefined values'); $self->{output}->option_exit(); } } 1; __END__ =head1 MODE Check metrics about records statistics in Kinesis streams. =over 8 =item B<--name> Set the stream name (Required) (Can be multiple). =item B<--filter-metric> Filter metrics (Can be: 'GetRecords.IteratorAgeMilliseconds', 'GetRecords.Bytes', ) =item B<--warning-*> B<--critical-*> Thresholds warning can be: 'records-get-iteratorage', 'records-get-volume', 'records-get-latency', 'records-get-success', 'records-put-volume', 'records-put-latency', 'records-get-success', =back =cut
34.983402
185
0.565532
edc886abe5a0962ed95df45363ca23b638931943
2,238
pm
Perl
lib/PostgreSQL/SecureMonitoring/Checks/Alive.pm
DMaendlen/Posemo
e1c6a11048b073c46605646cab55d0b87bbd11b3
[ "PostgreSQL" ]
26
2017-05-19T13:31:38.000Z
2022-01-28T14:10:37.000Z
lib/PostgreSQL/SecureMonitoring/Checks/Alive.pm
DMaendlen/Posemo
e1c6a11048b073c46605646cab55d0b87bbd11b3
[ "PostgreSQL" ]
null
null
null
lib/PostgreSQL/SecureMonitoring/Checks/Alive.pm
DMaendlen/Posemo
e1c6a11048b073c46605646cab55d0b87bbd11b3
[ "PostgreSQL" ]
4
2018-04-02T00:31:08.000Z
2020-06-11T20:03:34.000Z
package PostgreSQL::SecureMonitoring::Checks::Alive; =head1 NAME PostgreSQL::SecureMonitoring::Checks::Alive -- minimalistic alive check =head1 SYNOPSIS In Config: # Optionally you may change the behaviour when there is a hard error # Default is: critical on error. <Check Alive> no_critical = 1 warn_if_failed = 1 </Check> =head1 DESCRIPTION This was a minimalistic Posemo check, now it has some error handling. This check creates a SQL for a simple function, which just returns true. So, if the server is alive, then it returns true. Connection errors and other hard errors are catched, so the check returns a fail message if failed (and not a connection error). In the config you can configure, that a failed connection should not result in a critical result and/or create a warning instead. =cut use PostgreSQL::SecureMonitoring::ChecksHelper; extends "PostgreSQL::SecureMonitoring::Checks"; use English qw( -no_match_vars ); has no_critical => ( is => "ro", isa => "Bool", ); has warn_if_failed => ( is => "ro", isa => "Bool", ); check_has description => 'Checks if server is alive', code => "SELECT true"; =head2 Modify execute We modify the execute method, wrap the original in eval (try) and build manually a result when failed. =cut around execute => sub { my $orig = shift; my $self = shift; my $result; eval { # catch errors $result = $self->$orig(); # Call original execute method here return 1; } or do { # when failed, then set fail messages and build result. $result->{result} = 0; $result->{row_type} = "single"; $result->{message} = "Failed Alive check for host ${ \$self->host_desc }; error: $EVAL_ERROR"; $result->{critical} = 1 unless $self->no_critical; $result->{warning} = 1 if $self->warn_if_failed; $result->{columns} = [qw(alive)]; }; return $result; }; =begin NoRendering =head2 test_critical_warning override test_critical_warning with empty sub, because everythhing is done above. =end NoRendering =cut sub test_critical_warning { return; } 1;
24.593407
106
0.654155
edbf9536a5fdfbd7ac253aafe9a0ab2e433ec25e
4,098
pm
Perl
source/battle_list/Ap.pm
white-mns/sola_parse
e2dd00d962b1868afdd05d3c4cdeff40ce0e160a
[ "MIT" ]
null
null
null
source/battle_list/Ap.pm
white-mns/sola_parse
e2dd00d962b1868afdd05d3c4cdeff40ce0e160a
[ "MIT" ]
null
null
null
source/battle_list/Ap.pm
white-mns/sola_parse
e2dd00d962b1868afdd05d3c4cdeff40ce0e160a
[ "MIT" ]
null
null
null
#=================================================================== # AP行動取得パッケージ #------------------------------------------------------------------- # (C) 2018 @white_mns #=================================================================== # パッケージの使用宣言 ---------------# use strict; use warnings; require "./source/lib/Store_Data.pm"; require "./source/lib/Store_HashData.pm"; use ConstData; #定数呼び出し use source::lib::GetNode; #------------------------------------------------------------------# # パッケージの定義 #------------------------------------------------------------------# package Ap; #-----------------------------------# # コンストラクタ #-----------------------------------# sub new { my $class = shift; bless { Datas => {}, }, $class; } #-----------------------------------# # 初期化 #-----------------------------------# sub Init(){ my $self = shift; ($self->{CommonDatas}) = @_; #初期化 $self->{Datas}{Ap} = StoreData->new(); my $header_list = ""; $header_list = [ "ap_no", "battle_type_id", "party_num", "quest_id", "difficulty_id", "battle_result", "created_at", ]; $self->{Datas}{Ap}->Init($header_list); #出力ファイル設定 $self->{Datas}{Ap}->SetOutputName( "./output/battle_list/ap.csv" ); return; } #-----------------------------------# # データ取得 #------------------------------------ # 引数|結果番号 # ターン別参加者一覧ノード # タイトルデータノード #-----------------------------------# sub GetData{ my $self = shift; my $ap_no = shift; my $th_nodes = shift; $self->{ApNo} = $ap_no; $self->GetApData($th_nodes); return; } #-----------------------------------# # サブタイトル、進行度取得 #------------------------------------ # 引数|サブタイトルノード #-----------------------------------# sub GetApData{ my $self = shift; my $th_nodes = shift; if (!scalar(@$th_nodes)) { return; } if ($$th_nodes[0]->as_text ne "LINK") { return; } my ($battle_type_id, $party_num, $quest_id, $difficulty_id, $battle_result, $created_at) = (0, 0, 0, 0, -99, 0); my $battle_type_text = $$th_nodes[1]->as_text; $battle_type_id = $self->{CommonDatas}{ProperName}->GetOrAddId($battle_type_text); $party_num = $self->GetPartyNum($$th_nodes[2]); my $right_party_num = $self->GetPartyNum($$th_nodes[3]); if ($right_party_num == 0) { my $quest_all_text = $$th_nodes[3]->as_text; if ($quest_all_text =~ /(.+) \((.+)\)/) { my $quest_text = $1; my $difficulty_text = $2; $quest_id = $self->{CommonDatas}{ProperName}->GetOrAddId($quest_text); $difficulty_id = $self->{CommonDatas}{ProperName}->GetOrAddId($difficulty_text); } } $created_at = $$th_nodes[4]->as_text; my $battle_result_text = $$th_nodes[5]->as_text; if ($battle_result_text eq "勝利") { $battle_result = 1} elsif ($battle_result_text eq "左側") { $battle_result = 2} elsif ($battle_result_text eq "引分") { $battle_result = 0} elsif ($battle_result_text eq "敗北") { $battle_result = -1} elsif ($battle_result_text eq "右側") { $battle_result = -2} $self->{Datas}{Ap}->AddData(join(ConstData::SPLIT, ($self->{ApNo}, $battle_type_id, $party_num, $quest_id, $difficulty_id, $battle_result, $created_at))); return; } #-----------------------------------# # 味方人数取得 #------------------------------------ # 引数|メンバーノード #-----------------------------------# sub GetPartyNum{ my $self = shift; my $th_node = shift; if (!$th_node) {return 0;} my $party_num = 0; my $a_nodes = &GetNode::GetNode_Tag("a", \$th_node); return scalar(@$a_nodes); } #-----------------------------------# # 出力 #------------------------------------ # 引数|ファイルアドレス #-----------------------------------# sub Output(){ my $self = shift; foreach my $object( values %{ $self->{Datas} } ) { $object->Output(); } return; } 1;
25.453416
158
0.426306
ed948ddf3bb650477710b26a95c276f9c2f28ab9
4,841
pm
Perl
lib/Mojo/Discord/Guild.pm
randolf/Mojo-Discord
dc6e3b1c275d83066f2d83602806debc886ad350
[ "MIT" ]
29
2017-02-16T19:55:55.000Z
2022-01-29T11:55:51.000Z
lib/Mojo/Discord/Guild.pm
vsTerminus/Net-Discord
114f879f216ca8670da836914bffb3bef755fbae
[ "MIT" ]
31
2017-03-04T08:31:08.000Z
2022-02-11T19:26:12.000Z
lib/Mojo/Discord/Guild.pm
vsTerminus/Net-Discord
114f879f216ca8670da836914bffb3bef755fbae
[ "MIT" ]
18
2017-02-16T20:02:26.000Z
2022-01-29T12:00:26.000Z
package Mojo::Discord::Guild; use feature 'say'; our $VERSION = '0.001'; use Moo; use strictures 2; use Mojo::Discord::Guild::Member; use Mojo::Discord::Guild::Role; use Mojo::Discord::Guild::Channel; use Mojo::Discord::Guild::Emoji; use Mojo::Discord::Guild::Presence; use namespace::clean; has id => ( is => 'rw' ); has members => ( is => 'rw', default => sub { {} } ); has roles => ( is => 'rw', default => sub { {} } ); has channels => ( is => 'rw', default => sub { {} } ); has webhooks => ( is => 'rw', default => sub { {} } ); has emojis => ( is => 'rw', default => sub { {} } ); has presences => ( is => 'rw', default => sub { {} } ); has owner_id => ( is => 'rw' ); has name => ( is => 'rw' ); has splash => ( is => 'rw' ); has features => ( is => 'rw' ); has joined_at => ( is => 'rw' ); has icon => ( is => 'rw' ); has voice_states => ( is => 'rw' ); has region => ( is => 'rw' ); has application_id => ( is => 'rw' ); has unavailable => ( is => 'rw' ); has member_count => ( is => 'rw' ); has afk_channel_id => ( is => 'rw' ); has default_message_notifications => ( is => 'rw' ); has large => ( is => 'rw' ); has afk_timeout => ( is => 'rw' ); has verification_level => ( is => 'rw' ); has mfa_level => ( is => 'rw' ); # Pass in a hash of top level attributes sub set_attributes { my ($self, $hash) = @_; # List of attributes it is possible to find at the top level # of a guild object. # This acts as a sort of whitelist so that complex structures like channels # cannot be added this way. my @attrs = ( 'id', 'name', 'icon', 'splash', 'owner', 'owner_id', 'region', 'afk_channel_id', 'afk_timeout', 'embed_enabled', 'embed_channel_id', 'verification_level', 'default_message_notifications', 'explicit_content_filter', 'mfa_level', 'application_id', 'widget_enabled', 'widget_channel_id', 'system_channel_id', 'joined_at', 'large', 'unavailable', 'member_count', ); foreach my $attr (@attrs) { if ( exists $hash->{$attr} ) { $self->{$attr} = $hash->{$attr}; } } } # Need functions to add, remove, and edit things as they change. sub add_channel { my ($self, $args) = @_; # print Dumper($args); my $id = $args->{'id'}; die("Cannot add a channel without an id.\nDied ") unless defined $id; # Add the guild ID to the object $args->{'guild_id'} = $self->id; my $channel = Mojo::Discord::Guild::Channel->new($args); $self->channels->{$id} = $channel; #print Dumper($self->channels); # Return the new object return $channel; } sub remove_channel { my ($self, $channel_id) = @_; delete $self->channels->{$channel_id}; } sub add_role { my ($self, $args) = @_; my $id = $args->{'id'}; die("Cannot add a role without an id.\nDied ") unless defined $id; my $role = Mojo::Discord::Guild::Role->new($args); $self->roles->{$id} = $role; return $role; } sub remove_role { my ($self, $role_id) = @_; delete $self->roles->{$role_id}; } sub add_presence { my ($self, $args) = @_; my $id = $args->{'id'}; die("Cannot add a presence without an id.\nDied ") unless defined $id; my $presence = Mojo::Discord::Guild::Presence->new($args); $self->presences->{$id} = $presence; return $presence; } sub remove_presence { # my ($self, $presence_id) = @_; # delete $self->presences{$presence_id}; } sub add_emoji { my ($self, $args) = @_; my $id = $args->{'id'}; die("Cannot add an emoji without an id.\nDied ") unless defined $id; my $emoji = Mojo::Discord::Guild::Emoji->new($args); $self->emojis->{$id} = $emoji; return $emoji; } sub remove_emoji { # my ($self, $emoji_id) = @_; # delete $self->emoji{$emoji_id}; } sub add_member { my ($self, $args) = @_; my $id = $args->{'user'}{'id'}; die("Cannot add a member without an id.\nDied ") unless defined $id; my $member = Mojo::Discord::Guild::Member->new($args); $self->members->{$id} = $member; return $member; } sub remove_member { my ($self, $member_id) = @_; delete $self->members->{$member_id}; } 1;
24.326633
79
0.494113
edda27eaa91a229f230941b7d5feaeef3ae392bc
2,556
t
Perl
integration/advent2013-day09.t
perl6/roast
30e8226c1a0562b9364ee9ea2730763374d79a3d
[ "Artistic-2.0" ]
99
2015-03-03T13:01:44.000Z
2020-03-05T15:21:43.000Z
integration/advent2013-day09.t
perl6/roast
30e8226c1a0562b9364ee9ea2730763374d79a3d
[ "Artistic-2.0" ]
331
2015-02-17T15:26:22.000Z
2020-03-16T18:29:49.000Z
integration/advent2013-day09.t
perl6/roast
30e8226c1a0562b9364ee9ea2730763374d79a3d
[ "Artistic-2.0" ]
136
2015-02-02T13:34:10.000Z
2020-02-18T02:26:59.000Z
use v6; use Test; plan 21; { my $employee = { name => 'Fred', age => 51, skills => <sweeping accounting barking>, }; is($employee<name>, 'Fred', 'emp name'); is($employee<skills>[1], 'accounting', 'emp skill'); }; { my %employee = name => 'Fred', age => 51, skills => <sweeping accounting barking>, ; is(%employee<name>, 'Fred', 'emp name'); is(%employee<skills>[1], 'accounting', 'emp skill'); }; my %options = rpm => 440, duration => 60, ; class HashArgsExample { method start(%options) { is %options<rpm>, 440, 'rpm hash option'; is %options<duration>, 60, 'duration hash option'; } } HashArgsExample.start(%options); class NamedArgsExample { method start(:$rpm!, :$duration) { is $rpm, 440, 'rpm named arg'; is $duration, 60, 'duration named'; } } NamedArgsExample.start( |%options); class NamedArgsExample2 { method start(:$rpm!, :$duration = 120) { is $rpm, 440, 'rpm named arg'; is $duration, 120, 'duration named'; } } NamedArgsExample2.start(:rpm<440>); throws-like {NamedArgsExample2.start()}, Exception; # no exception object yet my @args = "Would you like fries with that?", 15, 5; is substr(|@args), 'fries'; my %details = :year(1969), :month(7), :day(16), :hour(20), :minute(17); my $moonlanding = DateTime.new( |%details ); is $moonlanding.year, 1969, 'moonlanding year'; is $moonlanding.month, 7, 'moonlanding month'; is $moonlanding.day, 16, 'moonlanding day'; is $moonlanding.hour, 20, 'moonlanding hour'; is $moonlanding.minute, 17, 'moonlanding minute'; { my %opts = blackberries => 42; is %opts<blackberries>, 42, 'blackberries'; } { my %opts = :blackberries(42); is %opts<blackberries>, 42, 'blackberries'; } { my $blackberries = 42; my %opts = :$blackberries; # means the same as :blackberries($blackberries) is %opts<blackberries>, 42, 'blackberries'; } my $lisp-list = 1 => 2 => 3 => Nil; # it's nice that infix:<< => >> is right-associative Pair.^add_fallback( -> $, $name { $name ~~ /^c<[ad]>+r$/ }, # should we handle this? yes, if /^c<[ad]>+r$/ -> $, $name { # if it turned out to be our job, this is what we do -> $p { $name ~~ /^c(<[ad]>*)(<[ad]>)r$/; # split out last 'a' or 'd' my $r = $1 eq 'a' ?? $p.key !! $p.value; # choose key or value $0 ne '' ?? $r."c{$0}r"() !! $r; # maybe recurse } } ); is $lisp-list.caddr, 3, 'Pair.^add_fallback'; # vim: expandtab shiftwidth=4
25.058824
97
0.580986
edd0493a08b501d60c04044e79a9e0b096d77953
12,253
perl
Perl
git-1.8.1/git-difftool.perl
anatm/administrator
bc1109cb155052898b657f7bdd33d7cf34a43e67
[ "MIT" ]
null
null
null
git-1.8.1/git-difftool.perl
anatm/administrator
bc1109cb155052898b657f7bdd33d7cf34a43e67
[ "MIT" ]
null
null
null
git-1.8.1/git-difftool.perl
anatm/administrator
bc1109cb155052898b657f7bdd33d7cf34a43e67
[ "MIT" ]
null
null
null
#!/usr/bin/perl # Copyright (c) 2009, 2010 David Aguilar # Copyright (c) 2012 Tim Henigan # # This is a wrapper around the GIT_EXTERNAL_DIFF-compatible # git-difftool--helper script. # # This script exports GIT_EXTERNAL_DIFF and GIT_PAGER for use by git. # The GIT_DIFF* variables are exported for use by git-difftool--helper. # # Any arguments that are unknown to this script are forwarded to 'git diff'. use 5.008; use strict; use warnings; use File::Basename qw(dirname); use File::Copy; use File::Compare; use File::Find; use File::stat; use File::Path qw(mkpath rmtree); use File::Temp qw(tempdir); use Getopt::Long qw(:config pass_through); use Git; sub usage { my $exitcode = shift; print << 'USAGE'; usage: git difftool [-t|--tool=<tool>] [--tool-help] [-x|--extcmd=<cmd>] [-g|--gui] [--no-gui] [--prompt] [-y|--no-prompt] [-d|--dir-diff] ['git diff' options] USAGE exit($exitcode); } sub find_worktree { my ($repo) = @_; # Git->repository->wc_path() does not honor changes to the working # tree location made by $ENV{GIT_WORK_TREE} or the 'core.worktree' # config variable. my $worktree; my $env_worktree = $ENV{GIT_WORK_TREE}; my $core_worktree = Git::config('core.worktree'); if (defined($env_worktree) and (length($env_worktree) > 0)) { $worktree = $env_worktree; } elsif (defined($core_worktree) and (length($core_worktree) > 0)) { $worktree = $core_worktree; } else { $worktree = $repo->wc_path(); } return $worktree; } sub filter_tool_scripts { my ($tools) = @_; if (-d $_) { if ($_ ne ".") { # Ignore files in subdirectories $File::Find::prune = 1; } } else { if ((-f $_) && ($_ ne "defaults")) { push(@$tools, $_); } } } sub print_tool_help { my ($cmd, @found, @notfound, @tools); my $gitpath = Git::exec_path(); find(sub { filter_tool_scripts(\@tools) }, "$gitpath/mergetools"); foreach my $tool (@tools) { $cmd = "TOOL_MODE=diff"; $cmd .= ' && . "$(git --exec-path)/git-mergetool--lib"'; $cmd .= " && get_merge_tool_path $tool >/dev/null 2>&1"; $cmd .= " && can_diff >/dev/null 2>&1"; if (system('sh', '-c', $cmd) == 0) { push(@found, $tool); } else { push(@notfound, $tool); } } print << 'EOF'; 'git difftool --tool=<tool>' may be set to one of the following: EOF print "\t$_\n" for (sort(@found)); print << 'EOF'; The following tools are valid, but not currently available: EOF print "\t$_\n" for (sort(@notfound)); print << 'EOF'; NOTE: Some of the tools listed above only work in a windowed environment. If run in a terminal-only session, they will fail. EOF exit(0); } sub exit_cleanup { my ($tmpdir, $status) = @_; my $errno = $!; rmtree($tmpdir); if ($status and $errno) { my ($package, $file, $line) = caller(); warn "$file line $line: $errno\n"; } exit($status | ($status >> 8)); } sub setup_dir_diff { my ($repo, $workdir, $symlinks) = @_; # Run the diff; exit immediately if no diff found # 'Repository' and 'WorkingCopy' must be explicitly set to insure that # if $GIT_DIR and $GIT_WORK_TREE are set in ENV, they are actually used # by Git->repository->command*. my $repo_path = $repo->repo_path(); my %repo_args = (Repository => $repo_path, WorkingCopy => $workdir); my $diffrepo = Git->repository(%repo_args); my @gitargs = ('diff', '--raw', '--no-abbrev', '-z', @ARGV); my $diffrtn = $diffrepo->command_oneline(@gitargs); exit(0) unless defined($diffrtn); # Build index info for left and right sides of the diff my $submodule_mode = '160000'; my $symlink_mode = '120000'; my $null_mode = '0' x 6; my $null_sha1 = '0' x 40; my $lindex = ''; my $rindex = ''; my %submodule; my %symlink; my @working_tree = (); my @rawdiff = split('\0', $diffrtn); my $i = 0; while ($i < $#rawdiff) { if ($rawdiff[$i] =~ /^::/) { warn << 'EOF'; Combined diff formats ('-c' and '--cc') are not supported in directory diff mode ('-d' and '--dir-diff'). EOF exit(1); } my ($lmode, $rmode, $lsha1, $rsha1, $status) = split(' ', substr($rawdiff[$i], 1)); my $src_path = $rawdiff[$i + 1]; my $dst_path; if ($status =~ /^[CR]/) { $dst_path = $rawdiff[$i + 2]; $i += 3; } else { $dst_path = $src_path; $i += 2; } if ($lmode eq $submodule_mode or $rmode eq $submodule_mode) { $submodule{$src_path}{left} = $lsha1; if ($lsha1 ne $rsha1) { $submodule{$dst_path}{right} = $rsha1; } else { $submodule{$dst_path}{right} = "$rsha1-dirty"; } next; } if ($lmode eq $symlink_mode) { $symlink{$src_path}{left} = $diffrepo->command_oneline('show', "$lsha1"); } if ($rmode eq $symlink_mode) { $symlink{$dst_path}{right} = $diffrepo->command_oneline('show', "$rsha1"); } if ($lmode ne $null_mode and $status !~ /^C/) { $lindex .= "$lmode $lsha1\t$src_path\0"; } if ($rmode ne $null_mode) { if ($rsha1 ne $null_sha1) { $rindex .= "$rmode $rsha1\t$dst_path\0"; } else { push(@working_tree, $dst_path); } } } # Setup temp directories my $tmpdir = tempdir('git-difftool.XXXXX', CLEANUP => 0, TMPDIR => 1); my $ldir = "$tmpdir/left"; my $rdir = "$tmpdir/right"; mkpath($ldir) or exit_cleanup($tmpdir, 1); mkpath($rdir) or exit_cleanup($tmpdir, 1); # If $GIT_DIR is not set prior to calling 'git update-index' and # 'git checkout-index', then those commands will fail if difftool # is called from a directory other than the repo root. my $must_unset_git_dir = 0; if (not defined($ENV{GIT_DIR})) { $must_unset_git_dir = 1; $ENV{GIT_DIR} = $repo_path; } # Populate the left and right directories based on each index file my ($inpipe, $ctx); $ENV{GIT_INDEX_FILE} = "$tmpdir/lindex"; ($inpipe, $ctx) = $repo->command_input_pipe(qw(update-index -z --index-info)); print($inpipe $lindex); $repo->command_close_pipe($inpipe, $ctx); my $rc = system('git', 'checkout-index', '--all', "--prefix=$ldir/"); exit_cleanup($tmpdir, $rc) if $rc != 0; $ENV{GIT_INDEX_FILE} = "$tmpdir/rindex"; ($inpipe, $ctx) = $repo->command_input_pipe(qw(update-index -z --index-info)); print($inpipe $rindex); $repo->command_close_pipe($inpipe, $ctx); $rc = system('git', 'checkout-index', '--all', "--prefix=$rdir/"); exit_cleanup($tmpdir, $rc) if $rc != 0; # If $GIT_DIR was explicitly set just for the update/checkout # commands, then it should be unset before continuing. delete($ENV{GIT_DIR}) if ($must_unset_git_dir); delete($ENV{GIT_INDEX_FILE}); # Changes in the working tree need special treatment since they are # not part of the index for my $file (@working_tree) { my $dir = dirname($file); unless (-d "$rdir/$dir") { mkpath("$rdir/$dir") or exit_cleanup($tmpdir, 1); } if ($symlinks) { symlink("$workdir/$file", "$rdir/$file") or exit_cleanup($tmpdir, 1); } else { copy("$workdir/$file", "$rdir/$file") or exit_cleanup($tmpdir, 1); my $mode = stat("$workdir/$file")->mode; chmod($mode, "$rdir/$file") or exit_cleanup($tmpdir, 1); } } # Changes to submodules require special treatment. This loop writes a # temporary file to both the left and right directories to show the # change in the recorded SHA1 for the submodule. for my $path (keys %submodule) { my $ok; if (defined($submodule{$path}{left})) { $ok = write_to_file("$ldir/$path", "Subproject commit $submodule{$path}{left}"); } if (defined($submodule{$path}{right})) { $ok = write_to_file("$rdir/$path", "Subproject commit $submodule{$path}{right}"); } exit_cleanup($tmpdir, 1) if not $ok; } # Symbolic links require special treatment. The standard "git diff" # shows only the link itself, not the contents of the link target. # This loop replicates that behavior. for my $path (keys %symlink) { my $ok; if (defined($symlink{$path}{left})) { $ok = write_to_file("$ldir/$path", $symlink{$path}{left}); } if (defined($symlink{$path}{right})) { $ok = write_to_file("$rdir/$path", $symlink{$path}{right}); } exit_cleanup($tmpdir, 1) if not $ok; } return ($ldir, $rdir, $tmpdir, @working_tree); } sub write_to_file { my $path = shift; my $value = shift; # Make sure the path to the file exists my $dir = dirname($path); unless (-d "$dir") { mkpath("$dir") or return 0; } # If the file already exists in that location, delete it. This # is required in the case of symbolic links. unlink($path); open(my $fh, '>', $path) or return 0; print($fh $value); close($fh); return 1; } sub main { # parse command-line options. all unrecognized options and arguments # are passed through to the 'git diff' command. my %opts = ( difftool_cmd => undef, dirdiff => undef, extcmd => undef, gui => undef, help => undef, prompt => undef, symlinks => $^O ne 'cygwin' && $^O ne 'MSWin32' && $^O ne 'msys', tool_help => undef, ); GetOptions('g|gui!' => \$opts{gui}, 'd|dir-diff' => \$opts{dirdiff}, 'h' => \$opts{help}, 'prompt!' => \$opts{prompt}, 'y' => sub { $opts{prompt} = 0; }, 'symlinks' => \$opts{symlinks}, 'no-symlinks' => sub { $opts{symlinks} = 0; }, 't|tool:s' => \$opts{difftool_cmd}, 'tool-help' => \$opts{tool_help}, 'x|extcmd:s' => \$opts{extcmd}); if (defined($opts{help})) { usage(0); } if (defined($opts{tool_help})) { print_tool_help(); } if (defined($opts{difftool_cmd})) { if (length($opts{difftool_cmd}) > 0) { $ENV{GIT_DIFF_TOOL} = $opts{difftool_cmd}; } else { print "No <tool> given for --tool=<tool>\n"; usage(1); } } if (defined($opts{extcmd})) { if (length($opts{extcmd}) > 0) { $ENV{GIT_DIFFTOOL_EXTCMD} = $opts{extcmd}; } else { print "No <cmd> given for --extcmd=<cmd>\n"; usage(1); } } if ($opts{gui}) { my $guitool = Git::config('diff.guitool'); if (length($guitool) > 0) { $ENV{GIT_DIFF_TOOL} = $guitool; } } # In directory diff mode, 'git-difftool--helper' is called once # to compare the a/b directories. In file diff mode, 'git diff' # will invoke a separate instance of 'git-difftool--helper' for # each file that changed. if (defined($opts{dirdiff})) { dir_diff($opts{extcmd}, $opts{symlinks}); } else { file_diff($opts{prompt}); } } sub dir_diff { my ($extcmd, $symlinks) = @_; my $rc; my $error = 0; my $repo = Git->repository(); my $workdir = find_worktree($repo); my ($a, $b, $tmpdir, @worktree) = setup_dir_diff($repo, $workdir, $symlinks); if (defined($extcmd)) { $rc = system($extcmd, $a, $b); } else { $ENV{GIT_DIFFTOOL_DIRDIFF} = 'true'; $rc = system('git', 'difftool--helper', $a, $b); } # If the diff including working copy files and those # files were modified during the diff, then the changes # should be copied back to the working tree. # Do not copy back files when symlinks are used and the # external tool did not replace the original link with a file. for my $file (@worktree) { next if $symlinks && -l "$b/$file"; next if ! -f "$b/$file"; my $diff = compare("$b/$file", "$workdir/$file"); if ($diff == 0) { next; } elsif ($diff == -1) { my $errmsg = "warning: Could not compare "; $errmsg += "'$b/$file' with '$workdir/$file'\n"; warn $errmsg; $error = 1; } elsif ($diff == 1) { my $mode = stat("$b/$file")->mode; copy("$b/$file", "$workdir/$file") or exit_cleanup($tmpdir, 1); chmod($mode, "$workdir/$file") or exit_cleanup($tmpdir, 1); } } if ($error) { warn "warning: Temporary files exist in '$tmpdir'.\n"; warn "warning: You may want to cleanup or recover these.\n"; exit(1); } else { exit_cleanup($tmpdir, $rc); } } sub file_diff { my ($prompt) = @_; if (defined($prompt)) { if ($prompt) { $ENV{GIT_DIFFTOOL_PROMPT} = 'true'; } else { $ENV{GIT_DIFFTOOL_NO_PROMPT} = 'true'; } } $ENV{GIT_PAGER} = ''; $ENV{GIT_EXTERNAL_DIFF} = 'git-difftool--helper'; # ActiveState Perl for Win32 does not implement POSIX semantics of # exec* system call. It just spawns the given executable and finishes # the starting program, exiting with code 0. # system will at least catch the errors returned by git diff, # allowing the caller of git difftool better handling of failures. my $rc = system('git', 'diff', @ARGV); exit($rc | ($rc >> 8)); } main();
25.959746
76
0.622541
eddee839890a6ea84e17e46a5f9cfd4aae3403fe
7,655
pm
Perl
lib/Zonemaster/Backend/TestAgent.pm
sandoche2k/zonemaster-backend
39cd79711fc2ccddd830f00ba3e0b858aa537278
[ "CC-BY-4.0" ]
null
null
null
lib/Zonemaster/Backend/TestAgent.pm
sandoche2k/zonemaster-backend
39cd79711fc2ccddd830f00ba3e0b858aa537278
[ "CC-BY-4.0" ]
null
null
null
lib/Zonemaster/Backend/TestAgent.pm
sandoche2k/zonemaster-backend
39cd79711fc2ccddd830f00ba3e0b858aa537278
[ "CC-BY-4.0" ]
null
null
null
package Zonemaster::Backend::TestAgent; our $VERSION = '1.1.0'; use strict; use warnings; use 5.14.2; use DBI qw(:utils); use JSON::PP; use Scalar::Util qw( blessed ); use File::Slurp; use Zonemaster::LDNS; use Zonemaster::Engine; use Zonemaster::Engine::Translator; use Zonemaster::Backend::Config; use Zonemaster::Engine::Profile; sub new { my ( $class, $params ) = @_; my $self = {}; if ( $params && $params->{config} ) { $self->{config} = $params->{config}; } if ( $params && $params->{db} ) { eval "require $params->{db}"; $self->{db} = "$params->{db}"->new(); } else { my $backend_module = "Zonemaster::Backend::DB::" . $self->{config}->BackendDBType(); eval "require $backend_module"; $self->{db} = $backend_module->new(); } $self->{profiles} = $self->{config}->ReadProfilesInfo(); foreach my $profile (keys %{$self->{profiles}}) { die "default profile cannot be private" if ($profile eq 'default' && $self->{profiles}->{$profile}->{type} eq 'private'); if ( -e $self->{profiles}->{$profile}->{profile_file_name} ) { my $json = read_file( $self->{profiles}->{$profile}->{profile_file_name}, err_mode => 'croak' ); $self->{profiles}->{$profile}->{zm_profile} = Zonemaster::Engine::Profile->from_json( $json ); } elsif ($profile ne 'default') { die "the profile definition json file of the profile [$profile] defined in the backend config file can't be read"; } } bless( $self, $class ); return $self; } sub run { my ( $self, $test_id ) = @_; my @accumulator; my %counter; my %counter_for_progress_indicator; my $params; my $progress = $self->{db}->test_progress( $test_id, 1 ); $params = $self->{db}->get_test_params( $test_id ); my %methods = Zonemaster::Engine->all_methods; foreach my $module ( keys %methods ) { foreach my $method ( @{ $methods{$module} } ) { $counter_for_progress_indicator{planned}{ $module . '::' . $method } = $module . '::'; } } my ( $domain ) = $params->{domain}; if ( !$domain ) { die "Must give the name of a domain to test.\n"; } $domain = $self->to_idn( $domain ); if (defined $params->{ipv4}) { Zonemaster::Engine::Profile->effective->set( q{net.ipv4}, ( $params->{ipv4} ) ? ( 1 ) : ( 0 ) ); } if (defined $params->{ipv6}) { Zonemaster::Engine::Profile->effective->set( q{net.ipv6}, ( $params->{ipv6} ) ? ( 1 ) : ( 0 ) ); } # used for progress indicator my ( $previous_module, $previous_method ) = ( '', '' ); # Callback defined here so it closes over the setup above. Zonemaster::Engine->logger->callback( sub { my ( $entry ) = @_; foreach my $trace ( reverse @{ $entry->trace } ) { foreach my $module_method ( keys %{ $counter_for_progress_indicator{planned} } ) { if ( index( $trace->[1], $module_method ) > -1 ) { my $percent_progress = 0; my ( $module ) = ( $module_method =~ /(.+::)[^:]+/ ); if ( $previous_module eq $module ) { $counter_for_progress_indicator{executed}{$module_method}++; } elsif ( $previous_module ) { foreach my $planned_module_method ( keys %{ $counter_for_progress_indicator{planned} } ) { $counter_for_progress_indicator{executed}{$planned_module_method}++ if ( $counter_for_progress_indicator{planned}{$planned_module_method} eq $previous_module ); } } $previous_module = $module; if ( $previous_method ne $module_method ) { $percent_progress = sprintf( "%.0f", 100 * ( scalar( keys %{ $counter_for_progress_indicator{executed} } ) / scalar( keys %{ $counter_for_progress_indicator{planned} } ) ) ); $self->{db}->test_progress( $test_id, $percent_progress ); $previous_method = $module_method; } } } } $counter{ uc $entry->level } += 1; } ); if ( $params->{nameservers} && @{ $params->{nameservers} } > 0 ) { $self->add_fake_delegation( $domain, $params->{nameservers} ); } if ( $params->{ds_info} && @{ $params->{ds_info} } > 0 ) { $self->add_fake_ds( $domain, $params->{ds_info} ); } # If the profile parameter has been set in the API, then load a profile if ( $params->{profile} ) { $params->{profile} = lc($params->{profile}); if (defined $self->{profiles}->{$params->{profile}} && $self->{profiles}->{$params->{profile}}->{zm_profile}) { my $profile = Zonemaster::Engine::Profile->default; $profile->merge( $self->{profiles}->{$params->{profile}}->{zm_profile} ); Zonemaster::Engine::Profile->effective->merge( $profile ); } else { die "The profile [$params->{profile}] is not defined in the backend_config ini file" if ($params->{profile} ne 'default') } } # Actually run tests! eval { Zonemaster::Engine->test_zone( $domain ); }; if ( $@ ) { my $err = $@; if ( blessed $err and $err->isa( "NormalExit" ) ) { say STDERR "Exited early: " . $err->message; } else { die "$err\n"; # Don't know what it is, rethrow } } $self->{db}->test_results( $test_id, Zonemaster::Engine->logger->json( 'INFO' ) ); $progress = $self->{db}->test_progress( $test_id ); return; } ## end sub run sub reset { my ( $self ) = @_; Zonemaster::Engine->reset(); } sub add_fake_delegation { my ( $self, $domain, $nameservers ) = @_; my @ns_with_no_ip; my %data; foreach my $ns_ip_pair ( @$nameservers ) { if ( $ns_ip_pair->{ns} && $ns_ip_pair->{ip} ) { push( @{ $data{ $self->to_idn( $ns_ip_pair->{ns} ) } }, $ns_ip_pair->{ip} ); } elsif ($ns_ip_pair->{ns}) { push(@ns_with_no_ip, $self->to_idn( $ns_ip_pair->{ns} ) ); } else { die "Invalid ns_ip_pair"; } } foreach my $ns ( @ns_with_no_ip ) { if ( not exists $data{ $ns } ) { $data{ $self->to_idn( $ns ) } = undef; } } Zonemaster::Engine->add_fake_delegation( $domain => \%data ); return; } sub add_fake_ds { my ( $self, $domain, $ds_info ) = @_; my @data; foreach my $ds ( @{ $ds_info } ) { push @data, { keytag => $ds->{keytag}, algorithm => $ds->{algorithm}, type => $ds->{digtype}, digest => $ds->{digest} }; } Zonemaster::Engine->add_fake_ds( $domain => \@data ); return; } sub to_idn { my ( $self, $str ) = @_; if ( $str =~ m/^[[:ascii:]]+$/ ) { return $str; } if ( Zonemaster::LDNS::has_idn() ) { return Zonemaster::LDNS::to_idn( $str ); } else { warn __( "Warning: Zonemaster::LDNS not compiled with libidn, cannot handle non-ASCII names correctly." ); return $str; } } 1;
32.299578
133
0.506336
ed931a80a99cdba69f7ee2363fdd1c53b7f70d42
44,870
pm
Perl
lib/Demeter/UI/Athena/LCF.pm
nbeaver/demeter
898dcd23e8e72017df4a60faf9767834934612bf
[ "Artistic-1.0-Perl", "ClArtistic" ]
42
2015-08-19T21:56:19.000Z
2022-02-16T23:52:17.000Z
lib/Demeter/UI/Athena/LCF.pm
nbeaver/demeter
898dcd23e8e72017df4a60faf9767834934612bf
[ "Artistic-1.0-Perl", "ClArtistic" ]
48
2015-01-22T02:29:05.000Z
2021-11-25T12:26:04.000Z
lib/Demeter/UI/Athena/LCF.pm
nbeaver/demeter
898dcd23e8e72017df4a60faf9767834934612bf
[ "Artistic-1.0-Perl", "ClArtistic" ]
28
2015-03-02T07:21:33.000Z
2021-12-10T20:34:10.000Z
package Demeter::UI::Athena::LCF; use strict; use warnings; use Wx qw( :everything ); use base 'Wx::Panel'; use Wx::Event qw(EVT_BUTTON EVT_CHECKBOX EVT_COMBOBOX EVT_RADIOBOX EVT_LIST_ITEM_SELECTED EVT_TEXT_ENTER); use Wx::Perl::TextValidator; use Demeter::LCF; use Demeter::UI::Wx::SpecialCharacters qw(:all); use Cwd; use File::Basename; use File::Spec; use Scalar::Util qw(looks_like_number); use vars qw($label); $label = "Linear combination fitting"; # used in the Choicebox and in status bar messages to identify this tool my $tcsize = [60,-1]; my $icon = File::Spec->catfile(dirname($INC{"Demeter/UI/Athena.pm"}), 'Athena', , 'icons', "bullseye.png"); my $bullseye = Wx::Bitmap->new($icon, wxBITMAP_TYPE_PNG); sub new { my ($class, $parent, $app) = @_; my $this = $class->SUPER::new($parent, -1, wxDefaultPosition, wxDefaultSize, wxMAXIMIZE_BOX ); my $box = Wx::BoxSizer->new( wxVERTICAL); $this->{sizer} = $box; $this->{LCF} = Demeter::LCF->new(include_caller=>0); $this->{emin} = Demeter->co->default('lcf', 'emin'); $this->{emax} = Demeter->co->default('lcf', 'emax'); $this->{kmin} = Demeter->co->default('lcf', 'kmin'); $this->{kmax} = Demeter->co->default('lcf', 'kmax'); $this->{pastspace} = 0; my $hbox = Wx::BoxSizer->new( wxHORIZONTAL ); $box->Add($hbox, 0, wxGROW|wxLEFT|wxRIGHT, 5); $hbox->Add(Wx::StaticText->new($this, -1, 'Fit range:'), 0, wxRIGHT|wxALIGN_CENTRE, 5); $this->{xmin} = Wx::TextCtrl->new($this, -1, $this->{emin}, wxDefaultPosition, $tcsize, wxTE_PROCESS_ENTER); $hbox->Add($this->{xmin}, 0, wxLEFT|wxRIGHT|wxALIGN_CENTRE, 5); $this->{xmin_pluck} = Wx::BitmapButton -> new($this, -1, $bullseye); $hbox->Add($this->{xmin_pluck}, 0, wxRIGHT|wxALIGN_CENTRE, 5); $hbox->Add(Wx::StaticText->new($this, -1, 'to'), 0, wxRIGHT|wxALIGN_CENTRE, 5); $this->{xmax} = Wx::TextCtrl->new($this, -1, $this->{emax}, wxDefaultPosition, $tcsize, wxTE_PROCESS_ENTER); $hbox->Add($this->{xmax}, 0, wxLEFT|wxRIGHT|wxALIGN_CENTRE, 5); $this->{xmax_pluck} = Wx::BitmapButton -> new($this, -1, $bullseye); $hbox->Add($this->{xmax_pluck}, 0, wxRIGHT|wxALIGN_CENTRE, 5); $this->{space} = Wx::RadioBox->new($this, -1, 'Fitting space', wxDefaultPosition, wxDefaultSize, ["norm $MU(E)", "deriv $MU(E)", "$CHI(k)"], 1, wxRA_SPECIFY_ROWS); $hbox->Add($this->{space}, 0, wxLEFT|wxRIGHT|wxALIGN_CENTRE, 5); $this->{space}->SetSelection(0); EVT_RADIOBOX($this, $this->{space}, sub{OnSpace(@_)}); $this->{xmin} -> SetValidator( Wx::Perl::TextValidator->new( qr([-0-9.]) ) ); $this->{xmax} -> SetValidator( Wx::Perl::TextValidator->new( qr([-0-9.]) ) ); EVT_TEXT_ENTER($this, $this->{xmin}, sub{plot(@_)}); EVT_TEXT_ENTER($this, $this->{xmax}, sub{plot(@_)}); $this->{document} = Wx::Button->new($this, -1, 'Document section: LCF'); $this->{notebook} = Wx::Notebook->new($this, -1, wxDefaultPosition, wxDefaultSize, wxNB_TOP); $box -> Add($this->{notebook}, 1, wxGROW|wxALL, 2); my $main = $this->main_page($this->{notebook}); my $fits = $this->fit_page($this->{notebook}); my $combi = $this->combi_page($this->{notebook}); my $marked = $this->marked_page($this->{notebook}); $this->{notebook} ->AddPage($main, 'Standards', 1); $this->{notebook} ->AddPage($fits, 'Fit results', 0); $this->{notebook} ->AddPage($combi, 'Combinatorics', 0); $this->{notebook} ->AddPage($marked, 'Sequence', 0); #$box -> Add($this->{document}, 0, wxGROW|wxALL, 2); EVT_BUTTON($this, $this->{document}, sub{ $app->document("analysis.lcf")}); EVT_BUTTON($this, $this->{xmin_pluck}, sub{Pluck(@_, 'xmin')}); EVT_BUTTON($this, $this->{xmax_pluck}, sub{Pluck(@_, 'xmax')}); $this->{xmin_pluck}->Enable(0); $this->{xmax_pluck}->Enable(0); $this->SetSizerAndFit($box); return $this; }; sub main_page { my ($this, $nb) = @_; my $panel = Wx::Panel->new($nb, -1, wxDefaultPosition, wxDefaultSize, wxMAXIMIZE_BOX ); my $box = Wx::BoxSizer->new( wxVERTICAL); my $hbox = Wx::BoxSizer->new( wxHORIZONTAL ); $box -> Add($hbox, 0, wxALL|wxGROW, 5); $hbox->Add(Wx::StaticText->new($panel, -1, ' Standards', wxDefaultPosition, [180,-1]), 0, wxLEFT|wxRIGHT, 5); $hbox->Add(Wx::StaticText->new($panel, -1, 'Weight', wxDefaultPosition, $tcsize), 0, wxLEFT|wxRIGHT, 10); $hbox->Add(Wx::StaticText->new($panel, -1, 'E0',), 0, wxLEFT|wxRIGHT, 10); $hbox->Add(Wx::StaticText->new($panel, -1, 'Fit E0'), 0, wxLEFT|wxRIGHT, 10); $hbox->Add(Wx::StaticText->new($panel, -1, 'Required'), 0, wxLEFT|wxRIGHT, 10); $this->{window} = Wx::ScrolledWindow->new($panel, -1, wxDefaultPosition, wxDefaultSize, wxVSCROLL); my $winbox = Wx::GridBagSizer->new( 2,2 ); $this->{window} -> SetSizer($winbox); $this->{window} -> SetScrollbars(0, 20, 0, 50); $this->{nstan} = Demeter->co->default('lcf', 'nstan'); foreach my $i (0 .. $this->{nstan}-1) { $this->add_standard($this->{window}, $winbox, $i); }; $box -> Add($this->{window}, 1, wxALL|wxGROW, 5); $hbox = Wx::BoxSizer->new( wxHORIZONTAL ); $box -> Add($hbox, 2, wxLEFT|wxRIGHT|wxGROW, 5); my $vbox = Wx::BoxSizer->new( wxVERTICAL ); $hbox -> Add($vbox, 1, wxGROW|wxALL, 5); ## ------------- fitting options my $optionsbox = Wx::StaticBox->new($panel, -1, 'Options', wxDefaultPosition, wxDefaultSize); my $optionsboxsizer = Wx::StaticBoxSizer->new( $optionsbox, wxVERTICAL ); $vbox -> Add($optionsboxsizer, 0, wxGROW|wxALL, 5); $this->{components} = Wx::CheckBox->new($panel, -1, 'Plot weighted components'); $this->{residual} = Wx::CheckBox->new($panel, -1, 'Plot residual'); $this->{inclusive} = Wx::CheckBox->new($panel, -1, 'All weights between 0 and 1'); $this->{unity} = Wx::CheckBox->new($panel, -1, 'Force weights to sum to 1'); $this->{linear} = Wx::CheckBox->new($panel, -1, 'Add a linear term after E0'); $this->{one_e0} = Wx::CheckBox->new($panel, -1, 'All standards share an E0'); $this->{reset} = Wx::Button->new($panel, -1, 'Reset', wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); $this->{spacer} = Wx::StaticLine->new($panel, -1, wxDefaultPosition, [0,0], wxLI_HORIZONTAL); $::app->mouseover($this->{components}, "Include the weighted components in the plot."); $::app->mouseover($this->{residual}, "Include the residual from the fit in the plot."); $::app->mouseover($this->{inclusive}, "Force all weights to evaluate to values between 0 and 1."); $::app->mouseover($this->{unity}, "Force the weights to sum to 1, otherwise allow the weight of each group to float."); $::app->mouseover($this->{linear}, "Include a linear component (m*E + b) in the fit which is only evaluated after E0."); $::app->mouseover($this->{one_e0}, "Force the standards to share a single E0 parameter. This is equivalent (albeit with a sign change) to floating E0 for the data."); $::app->mouseover($this->{reset}, "Reset all LCF parameters to their default values."); #$optionsboxsizer->Add($this->{$_}, 0, wxGROW|wxALL, 0) # foreach (qw(components residual spacer inclusive unity spacer linear one_e0 usemarked reset)); $optionsboxsizer->Add($this->{$_}, 0, wxGROW|wxALL, 0) foreach (qw(components residual)); #$optionsboxsizer->Add($this->{spacer}, 0, wxALL, 3); $optionsboxsizer->Add($this->{$_}, 0, wxGROW|wxALL, 0) foreach (qw(inclusive unity)); #$optionsboxsizer->Add($this->{spacer}, 0, wxALL, 3); $optionsboxsizer->Add($this->{$_}, 0, wxGROW|wxALL, 0) foreach (qw(linear one_e0)); $optionsboxsizer->Add($this->{spacer}, 0, wxALL, 3); $this->{components} -> SetValue(Demeter->co->default('lcf', 'components')); $this->{residual} -> SetValue(Demeter->co->default('lcf', 'difference')); $this->{$_} -> SetValue(0) foreach (qw(linear one_e0)); $this->{$_} -> SetValue(Demeter->co->default('lcf', $_)) foreach (qw(inclusive unity)); $this->{linear}->Enable(0) if (Demeter->mo->template_analysis ne 'larch'); my $noisebox = Wx::BoxSizer->new( wxHORIZONTAL ); $optionsboxsizer->Add($noisebox, 0, wxGROW|wxALL, 1); $noisebox->Add(Wx::StaticText->new($panel, -1, 'Add noise'), 0, wxRIGHT|wxALIGN_CENTRE, 5); $this->{noise} = Wx::TextCtrl->new($panel, -1, 0, wxDefaultPosition, $tcsize, wxTE_PROCESS_ENTER); $this->{noise} -> SetValidator( Wx::Perl::TextValidator->new( qr([0-9.]) ) ); $noisebox->Add($this->{noise}, 0, wxLEFT|wxRIGHT|wxALIGN_CENTRE, 5); $noisebox->Add(Wx::StaticText->new($panel, -1, 'to data'), 0, wxRIGHT|wxALIGN_CENTRE, 5); my $ninfobox = Wx::BoxSizer->new( wxHORIZONTAL ); $optionsboxsizer->Add($ninfobox, 0, wxGROW|wxALL, 1); $ninfobox->Add(Wx::StaticText->new($panel, -1, 'Information content'), 0, wxRIGHT|wxALIGN_CENTRE, 5); $this->{ninfo} = Wx::TextCtrl->new($panel, -1, 0, wxDefaultPosition, $tcsize, wxTE_PROCESS_ENTER); $this->{ninfo} -> SetValidator( Wx::Perl::TextValidator->new( qr([0-9.]) ) ); $ninfobox->Add($this->{ninfo}, 0, wxLEFT|wxRIGHT|wxALIGN_CENTRE, 5); $::app->mouseover($this->{noise}, "Add randomly distributed noise, scaled by this amount, to the data before doing the fit."); if (Demeter->is_ifeffit) { $::app->mouseover($this->{ninfo}, "This displays Athena's estimate of the information content, which is not currently used in the fit."); } else { $::app->mouseover($this->{ninfo}, "Specify the information content of your data. If 0, Athena will estimate the information content."); }; ## ------------- combinatorics options my $combinbox = Wx::StaticBox->new($panel, -1, 'Combinatorics', wxDefaultPosition, wxDefaultSize); my $combinboxsizer = Wx::StaticBoxSizer->new( $combinbox, wxVERTICAL ); $vbox -> Add($combinboxsizer, 0, wxGROW|wxALL, 5); my $maxbox = Wx::BoxSizer->new( wxHORIZONTAL ); $combinboxsizer->Add($maxbox, 0, wxGROW|wxALL, 1); $maxbox->Add(Wx::StaticText->new($panel, -1, 'Use at most'), 0, wxRIGHT|wxALIGN_CENTRE, 5); $this->{max} = Wx::SpinCtrl->new($panel, -1, 4, wxDefaultPosition, $tcsize, wxSP_ARROW_KEYS, 2, 100); $maxbox->Add($this->{max}, 0, wxLEFT|wxRIGHT|wxALIGN_CENTRE, 5); $maxbox->Add(Wx::StaticText->new($panel, -1, 'standards'), 0, wxRIGHT|wxALIGN_CENTRE, 5); $::app->mouseover($this->{max}, "In a combinatorial fit, only consider combinations up to this number of standards."); ## ------------- reset button $vbox->Add($this->{spacer}, 0, wxALL, 3); $vbox->Add($this->{reset}, 0, wxGROW|wxLEFT|wxRIGHT, 5); $this->{LCF}->plot_components(Demeter->co->default('lcf', 'components')); $this->{LCF}->plot_difference(Demeter->co->default('lcf', 'difference')); $this->{LCF}->linear (0); $this->{LCF}->inclusive(Demeter->co->default('lcf', 'inclusive')); $this->{LCF}->unity (Demeter->co->default('lcf', 'unity')); $this->{LCF}->one_e0 (0); EVT_CHECKBOX($this, $this->{components}, sub{$this->{LCF}->plot_components($this->{components}->GetValue)}); EVT_CHECKBOX($this, $this->{residual}, sub{$this->{LCF}->plot_difference($this->{residual} ->GetValue)}); EVT_CHECKBOX($this, $this->{linear}, sub{$this->{LCF}->linear ($this->{linear} ->GetValue)}); EVT_CHECKBOX($this, $this->{inclusive}, sub{$this->{LCF}->inclusive ($this->{inclusive} ->GetValue)}); EVT_CHECKBOX($this, $this->{unity}, sub{$this->{LCF}->unity ($this->{unity} ->GetValue)}); EVT_CHECKBOX($this, $this->{one_e0}, sub{use_one_e0(@_)}); EVT_BUTTON($this, $this->{reset}, sub{Reset(@_)}); EVT_TEXT_ENTER($this, $this->{noise}, sub{1;}); my $actionsbox = Wx::StaticBox->new($panel, -1, 'Actions', wxDefaultPosition, wxDefaultSize); my $actionsboxsizer = Wx::StaticBoxSizer->new( $actionsbox, wxVERTICAL ); $hbox -> Add($actionsboxsizer, 1, wxGROW|wxALL, 5); $this->{usemarked} = Wx::Button->new($panel, -1, 'Use marked groups'); $this->{fit} = Wx::Button->new($panel, -1, 'Fit this group'); $this->{combi} = Wx::Button->new($panel, -1, 'Fit all combinations'); $this->{fitmarked} = Wx::Button->new($panel, -1, 'Fit marked groups'); $this->{report} = Wx::Button->new($panel, -1, 'Save fit as column data'); $this->{plot} = Wx::Button->new($panel, -1, 'Plot data and sum'); $this->{plotr} = Wx::Button->new($panel, -1, 'Plot data and sum in R'); $this->{make} = Wx::Button->new($panel, -1, 'Make group from fit'); foreach my $w (qw(fit combi fitmarked report plot plotr make)) { my $n = ($w eq 'fit') ? 4 : 0; $actionsboxsizer->Add($this->{$w}, 0, wxGROW|wxTOP, $n); $this->{$w}->Enable(0); }; $actionsboxsizer->Add($this->{usemarked}, 0, wxGROW|wxTOP, 10); $actionsboxsizer->Add(1,1,1); $this->{document} -> Reparent($panel); $actionsboxsizer->Add($this->{document}, 0, wxGROW|wxALL, 0); EVT_BUTTON($this, $this->{fit}, sub{fit(@_, 0)}); EVT_BUTTON($this, $this->{plot}, sub{plot(@_)}); EVT_BUTTON($this, $this->{report}, sub{save(@_)}); EVT_BUTTON($this, $this->{combi}, sub{combi(@_)}); EVT_BUTTON($this, $this->{fitmarked}, sub{sequence(@_)}); EVT_BUTTON($this, $this->{make}, sub{make(@_)}); EVT_BUTTON($this, $this->{plotr}, sub{fft(@_)}); EVT_BUTTON($this, $this->{usemarked}, sub{use_marked(@_)}); $::app->mouseover($this->{fit}, "Fit the current group using the current model."); $::app->mouseover($this->{plot}, "Plot the data with current sum of standards."); $::app->mouseover($this->{report}, "Save a column data file containing the current fit and its components."); $::app->mouseover($this->{combi}, "Perform a combinatorial fitting sequence using all possible combinations from the standards list."); $::app->mouseover($this->{fitmarked}, "Fit all marked groups using the current fitting model."); $::app->mouseover($this->{make}, "Turn the current sum of standards into its own data group."); $::app->mouseover($this->{plotr}, "Plot the current group and the current model in R space."); $::app->mouseover($this->{document}, "Show the document page for LCF in a browser."); $::app->mouseover($this->{usemarked}, "Move all marked groups into the list of standards."); $panel->SetSizerAndFit($box); return $panel; }; sub fit_page { my ($this, $nb) = @_; my $panel = Wx::Panel->new($nb, -1, wxDefaultPosition, wxDefaultSize, wxMAXIMIZE_BOX ); my $box = Wx::BoxSizer->new( wxVERTICAL); $this->{result} = Wx::TextCtrl->new($panel, -1, q{}, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_WORDWRAP|wxTE_AUTO_URL|wxTE_READONLY|wxTE_RICH2); my $size = Wx::SystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)->GetPointSize; $this->{result}->SetFont( Wx::Font->new( $size, wxTELETYPE, wxNORMAL, wxNORMAL, 0, "" ) ); $box->Add($this->{result}, 1, wxGROW|wxALL, 5); $this->{resultplot} = Wx::Button->new($panel, -1, 'Plot data and fit'); $box->Add($this->{resultplot}, 0, wxGROW|wxALL, 2); $this->{resultreport} = Wx::Button->new($panel, -1, 'Save fit as column data'); $box->Add($this->{resultreport}, 0, wxGROW|wxALL, 2); EVT_BUTTON($this, $this->{resultplot}, sub{fit(@_, 1)}); EVT_BUTTON($this, $this->{resultreport}, sub{save(@_)}); $this->{resultplot}->Enable(0); $this->{resultreport}->Enable(0); $panel->SetSizerAndFit($box); return $panel; }; sub combi_page { my ($this, $nb) = @_; my $panel = Wx::Panel->new($nb, -1, wxDefaultPosition, wxDefaultSize, wxMAXIMIZE_BOX ); my $box = Wx::BoxSizer->new( wxVERTICAL); $this->{stats} = Wx::ListCtrl->new($panel, -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_HRULES||wxLC_SINGLE_SEL); $this->{stats}->InsertColumn( 0, "Standards", wxLIST_FORMAT_LEFT, 100 ); $this->{stats}->InsertColumn( 1, "R-factor", wxLIST_FORMAT_LEFT, 100 ); $this->{stats}->InsertColumn( 2, "Reduced chi-square" , wxLIST_FORMAT_LEFT, 150 ); $box->Add($this->{stats}, 1, wxALL|wxGROW, 3); EVT_LIST_ITEM_SELECTED($this, $this->{stats}, sub{combi_select(@_)}); $this->{fitresults} = Wx::ListCtrl->new($panel, -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_HRULES||wxLC_SINGLE_SEL); $this->{fitresults}->InsertColumn( 0, "#", wxLIST_FORMAT_LEFT, 20 ); $this->{fitresults}->InsertColumn( 1, "Standard", wxLIST_FORMAT_LEFT, 150 ); $this->{fitresults}->InsertColumn( 2, "Weight", wxLIST_FORMAT_LEFT, 130 ); $this->{fitresults}->InsertColumn( 3, "E0", wxLIST_FORMAT_LEFT, 130 ); $box->Add($this->{fitresults}, 1, wxALL|wxGROW, 3); $this->{combireport} = Wx::Button->new($panel, -1, 'Save combinatorial results as an Excel file'); $box->Add($this->{combireport}, 0, wxGROW|wxALL, 2); EVT_BUTTON($this, $this->{combireport}, sub{combi_report(@_)}); $this->{combireport}->Enable(0); $panel->SetSizerAndFit($box); return $panel; }; sub marked_page { my ($this, $nb) = @_; my $panel = Wx::Panel->new($nb, -1, wxDefaultPosition, wxDefaultSize, wxMAXIMIZE_BOX ); my $box = Wx::BoxSizer->new( wxVERTICAL); $this->{markedresults} = Wx::ListCtrl->new($panel, -1, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxLC_HRULES||wxLC_SINGLE_SEL); $this->{markedresults}->InsertColumn( 0, "Data", wxLIST_FORMAT_LEFT, 100 ); $this->{markedresults}->InsertColumn( 1, "R-factor", wxLIST_FORMAT_LEFT, 80 ); $this->{markedresults}->InsertColumn( 2, "Red. chi-square", wxLIST_FORMAT_LEFT, 80 ); $this->{markedresults}->InsertColumn( 3, "Stan. 1", wxLIST_FORMAT_LEFT, 80 ); $this->{markedresults}->InsertColumn( 4, "Stan. 2", wxLIST_FORMAT_LEFT, 80 ); $this->{markedresults}->InsertColumn( 5, "Stan. 3", wxLIST_FORMAT_LEFT, 80 ); $this->{markedresults}->InsertColumn( 6, "Stan. 4", wxLIST_FORMAT_LEFT, 80 ); $box->Add($this->{markedresults}, 1, wxALL|wxGROW, 3); EVT_LIST_ITEM_SELECTED($this, $this->{markedresults}, sub{seq_select(@_)}); $this->{mreport} = Wx::TextCtrl->new($panel, -1, q{}, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_WORDWRAP|wxTE_AUTO_URL|wxTE_READONLY|wxTE_RICH2); my $size = Wx::SystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)->GetPointSize; $this->{mreport}->SetFont( Wx::Font->new( $size, wxTELETYPE, wxNORMAL, wxNORMAL, 0, "" ) ); $box->Add($this->{mreport}, 1, wxALL|wxGROW, 3); $this->{plotmarked} = Wx::Button->new($panel, -1, 'Plot components from fit sequence'); $this->{markedreport} = Wx::Button->new($panel, -1, 'Save fit sequence report as an Excel file'); $box->Add($this->{plotmarked}, 0, wxGROW|wxALL, 2); $box->Add($this->{markedreport}, 0, wxGROW|wxALL, 2); EVT_BUTTON($this, $this->{markedreport}, sub{seq_report(@_)}); EVT_BUTTON($this, $this->{plotmarked}, sub{seq_plot(@_)}); $this->{plotmarked}->Enable(0); $this->{markedreport}->Enable(0); $panel->SetSizerAndFit($box); return $panel; }; sub add_standard { my ($this, $panel, $gbs, $i) = @_; my $box = Wx::BoxSizer->new( wxHORIZONTAL ); $this->{'standard'.$i} = Demeter::UI::Athena::GroupList -> new($panel, $::app, 0, 0); $this->{'weight'.$i} = Wx::TextCtrl -> new($panel, -1, 0, wxDefaultPosition, $tcsize, wxTE_PROCESS_ENTER); $this->{'e0'.$i} = Wx::TextCtrl -> new($panel, -1, 0, wxDefaultPosition, $tcsize, wxTE_PROCESS_ENTER); $this->{'fite0'.$i} = Wx::CheckBox -> new($panel, -1, q{ }); $this->{'require'.$i} = Wx::CheckBox -> new($panel, -1, q{ }); $gbs -> Add(Wx::StaticText->new($panel, -1, sprintf("%2d: ",$i+1)), Wx::GBPosition->new($i,0)); $gbs -> Add($this->{'standard'.$i}, Wx::GBPosition->new($i,1)); $gbs -> Add($this->{'weight'.$i}, Wx::GBPosition->new($i,2)); $gbs -> Add($this->{'e0'.$i}, Wx::GBPosition->new($i,3)); $gbs -> Add($this->{'fite0'.$i}, Wx::GBPosition->new($i,4)); $gbs -> Add($this->{'require'.$i}, Wx::GBPosition->new($i,5)); $this->{'standard'.$i}->SetSelection(0); EVT_TEXT_ENTER($this, $this->{'weight'.$i}, sub{1}); EVT_TEXT_ENTER($this, $this->{'e0'.$i}, sub{1}); EVT_CHECKBOX($this, $this->{'fite0'.$i}, sub{use_individual_e0(@_, $i)}); $this->{'standard'.$i}->{callback} = sub{$this->OnSelect}; $this->{'weight'.$i} -> SetValidator( Wx::Perl::TextValidator->new( qr([0-9.]) ) ); $this->{'e0'.$i} -> SetValidator( Wx::Perl::TextValidator->new( qr([-0-9.]) ) ); }; ## deprecated? sub pull_values { my ($this, $data) = @_; 1; }; ## this subroutine fills the controls when an item is selected from the Group list sub push_values { my ($this, $data) = @_; foreach my $i (0 .. $this->{nstan}-1) { my $str = $this->{'standard'.$i}->GetStringSelection; $this->{'standard'.$i}->fill($::app, 1, 0); $this->{'standard'.$i}->SetStringSelection($str); $this->{'standard'.$i}->SetSelection(0) if not scalar $this->{'standard'.$i}->GetSelection; # if ((not defined $this->{'standard'.$i}->GetSelection) or # (not scalar $this->{'standard'.$i}->GetSelection) or # (not defined $this->{'standard'.$i}->GetClientData(scalar $this->{'standard'.$i}->GetSelection))) { # $this->{'standard'.$i}->SetSelection(0); # }; }; $this->{result}->Clear; $this->{$_} -> Enable(0) foreach (qw(make report fitmarked resultplot resultreport)); my $count = 0; foreach my $i (0 .. $this->{nstan}-1) { ++$count if (scalar $this->{'standard'.$i}->GetSelection > 0); }; $this->{fit} -> Enable($count > 1); $this->{fitmarked} -> Enable($count > 1); $this->{combi} -> Enable($count > 2); $this->{plot} -> Enable($count > 0); $this->{plotr} -> Enable($count > 0) if ($this->{space}->GetSelection == 2); $this->{LCF}->data($::app->current_data); if ($this->{LCF}->data->datatype eq 'chi') { $this->{space}->Enable(0,0); $this->{space}->Enable(1,0); $this->{space}->SetSelection(2); $this->OnSpace; } else { $this->{space}->Enable(0,1); $this->{space}->Enable(1,1); $this->OnSpace; }; 1; }; ## this subroutine sets the enabled/frozen state of the controls sub mode { my ($this, $data, $enabled, $frozen) = @_; 1; }; sub OnSelect { my ($this, $event) = @_; my $count = 0; foreach my $i (0 .. $this->{nstan}-1) { ++$count if (scalar $this->{'standard'.$i}->GetSelection > 0); }; foreach my $i (0 .. $this->{nstan}-1) { if (scalar $this->{'standard'.$i}->GetSelection > 0) { $this->{'weight'.$i}->SetValue(sprintf("%.3f", 1/$count)); } else { $this->{'weight'.$i}->SetValue(0); }; }; $this->{xmin_pluck} -> Enable($count > 0); $this->{xmax_pluck} -> Enable($count > 0); $this->{fit} -> Enable($count > 1); $this->{fitmarked} -> Enable($count > 1); $this->{combi} -> Enable($count > 2); $this->{plot} -> Enable($count > 0); $this->{plotr} -> Enable($count > 0) if ($this->{space}->GetSelection == 2); $this->{make} -> Enable(0); $this->{report} -> Enable(0); $this->{resultplot} -> Enable(0); $this->{resultreport} -> Enable(0); }; sub Pluck { my ($self, $ev, $which) = @_; my $busy = Wx::BusyCursor->new(); plot($self, $ev); undef $busy; my ($ok, $x, $y) = $::app->cursor($self); $self->status("Failed to pluck a value for $which"), return if not $ok; $x -= $::app->current_data->bkg_e0 if ($self->{LCF}->space ne 'chi'); my $plucked = sprintf("%.3f", $x); $self->{$which}->SetValue($plucked); my $text = sprintf("Plucked %s as the value for %s.", $plucked, $which); $::app->{main}->status($text); } sub use_one_e0 { my ($this, $event) = @_; my $val = $this->{one_e0}->GetValue; $this->{LCF}->one_e0($val); if ($val) { foreach my $i (0 .. $this->{nstan}-1) { $this->{'e0'.$i}->SetValue(0); $this->{'fite0'.$i}->SetValue(0); }; }; }; sub use_individual_e0 { my ($this, $event, $i) = @_; my $val = $this->{'fite0'.$i}->GetValue; if ($val) { $this->{one_e0}->SetValue(0); $this->{LCF}->one_e0(0); }; }; sub use_marked { my ($this, $event) = @_; my $count = 0; $this->_remove_all; foreach my $i (0 .. $::app->{main}->{list}->GetCount-1) { next if not $::app->{main}->{list}->IsChecked($i); next if not defined $this->{'standard'.$count}; $this->{'standard'.$count}->SetStringSelection($::app->{main}->{list}->GetIndexedData($i)->name); $this->{'fite0'.$count}->SetValue(0); $this->{'require'.$count}->SetValue(0); ++$count; }; $this->OnSelect($event); }; sub Reset { my ($this, $event) = @_; $this->OnSelect; foreach my $i (0 .. $this->{nstan}-1) { $this->{'e0'.$i}->SetValue(0); $this->{'fite0'.$i}->SetValue(0); $this->{'require'.$i}->SetValue(0); }; $this->{$_} -> SetValue(0) foreach (qw(linear one_e0)); $this->{$_} -> SetValue(Demeter->co->default('lcf', $_)) foreach (qw(inclusive unity)); }; sub OnSpace { my ($this, $event) = @_; if ($this->{space}->GetSelection == 2) { if ($this->{pastspace} != 2) { $this->{emin} = $this->{xmin}->GetValue; $this->{emax} = $this->{xmax}->GetValue; $this->{xmin}->SetValue($this->{kmin}); $this->{xmax}->SetValue($this->{kmax}); }; $this->{plotr} -> Enable(1); $this->{LCF}->po->space('k'); } else { if ($this->{pastspace} == 2) { $this->{kmin} = $this->{xmin}->GetValue; $this->{kmax} = $this->{xmax}->GetValue; $this->{xmin}->SetValue($this->{emin}); $this->{xmax}->SetValue($this->{emax}); }; $this->{plotr} -> Enable(0); $this->{LCF}->po->space('E'); }; $this->{pastspace} = $this->{space}->GetSelection; $this->{LCF}->space('norm') if $this->{space}->GetSelection == 0; $this->{LCF}->space('deriv') if $this->{space}->GetSelection == 1; $this->{LCF}->space('chi') if $this->{space}->GetSelection == 2; }; sub fetch { my ($this) = @_; my $max = $this->{max}->GetValue; $max = 2 if ($max < 2); $this->{LCF}->max_standards($max); my $noise = $this->{noise}->GetValue; #$noise =~ s{\.{2,}}{.}g; $noise = 0 if (not looks_like_number($noise)); $noise = 0 if ($noise < 0); $this->{LCF}->noise($noise); }; sub _prep { my ($this, $nofit) = @_; $nofit ||= 0; my $trouble = 0; my $busy = Wx::BusyCursor->new(); $this->fetch; $this->{LCF}->clear; #$this->{LCF}->clean if not $nofit; $this->{LCF}->data($::app->current_data); foreach my $i (0 .. $this->{nstan}-1) { my $n = scalar $this->{'standard'.$i}->GetSelection; my $stan = $this->{'standard'.$i}->GetClientData($n); next if not defined($stan); #print join("|", $i, $n, $this->{'weight'.$i}->GetValue), $/; return sprintf("weight #%d", $i+1) if (not looks_like_number($this->{'weight'.$i}->GetValue)); return sprintf("e0 #%d" , $i+1) if (not looks_like_number($this->{'e0'.$i}->GetValue)); $this->{LCF} -> add($stan, required => $this->{'require'.$i}->GetValue, float_e0 => $this->{'fite0'.$i}->GetValue, weight => $this->{'weight'.$i}->GetValue, e0 => $this->{'e0'.$i}->GetValue, ); }; $this->{LCF}->space('norm') if $this->{space}->GetSelection == 0; $this->{LCF}->space('deriv') if $this->{space}->GetSelection == 1; $this->{LCF}->space('chi') if $this->{space}->GetSelection == 2; my $e0 = ($this->{LCF}->space eq 'chi') ? 0 : $this->{LCF}->data->bkg_e0; ($this->{LCF}->space eq 'chi') ? $this->{LCF}->data->_update('fft') : $this->{LCF}->data->_update('background'); return 'xmin' if (not looks_like_number($this->{xmin}->GetValue)); return 'xmax' if (not looks_like_number($this->{xmax}->GetValue)); $this->{LCF}->xmin($this->{xmin}->GetValue + $e0); $this->{LCF}->xmax($this->{xmax}->GetValue + $e0); if ($this->{LCF}->space eq 'chi') { $this->{LCF}->po->set(kmin=>0, kmax=>$this->{xmax}->GetValue+1); } else { $this->{LCF}->po->set(emin=>$this->{xmin}->GetValue-10, emax=>$this->{xmax}->GetValue+10); }; undef $busy; return $trouble; }; sub _results { my ($this) = @_; foreach my $i (0 .. $this->{nstan}-1) { my $n = scalar $this->{'standard'.$i}->GetSelection; my $stan = $this->{'standard'.$i}->GetClientData($n); next if not defined($stan); my @answer = ($this->{LCF}->weight($stan)); my $w = sprintf("%.3f", $answer[0]); @answer = ($this->{LCF}->e0($stan)); my $e = sprintf("%.3f", $answer[0]); $this->{'weight'.$i}->SetValue($w); $this->{'e0'.$i} ->SetValue($e); }; $this->{ninfo}->SetValue($this->{LCF}->ninfo); $this->{result}->Clear; $this->{result}->SetValue($this->{LCF}->report); }; sub fit { my ($this, $event, $nofit) = @_; my $trouble = $this->_prep($nofit); my $busy = Wx::BusyCursor->new(); if (($this->{space}->GetSelection == 2) and ($::app->{main}->{kweights}->GetStringSelection eq 'kw')) { $::app->{main}->status("Not doing LCF -- Linear combination fitting in chi(k) cannot be done with arbitrary k-wieghting!", 'error'); return; }; if ($trouble) { $::app->{main}->status("Not doing LCF -- the $trouble parameter value is not a number!", 'error'); return; }; $this->{LCF} -> fit if not $nofit; $this->{LCF} -> plot_fit; $this->_results if not $nofit; $this->{make} -> Enable(1); $this->{report} -> Enable(1); #$this->{fitmarked} -> Enable(1); #$this->{markedreport} -> Enable(1); $this->{resultplot} -> Enable(1); $this->{resultreport} -> Enable(1); $this->{plotr} -> Enable(1) if ($this->{LCF}->space =~ m{\Achi}); $::app->{main}->status(sprintf("Finished LCF fit to %s", $this->{LCF}->data->name)); $::app->heap_check(0); undef $busy; }; sub combi { my ($this, $event) = @_; my $trouble = $this->_prep(0); my $busy = Wx::BusyCursor->new(); if ($trouble) { $::app->{main}->status("Not doing LCF -- the $trouble parameter value is not a number!", 'error|nobuffer'); return; }; my $size = $this->{LCF}->combi_size; if ($size > 70) { my $yesno = Demeter::UI::Wx::VerbDialog->new($::app->{main}, -1, "You have asked to do $size fits! Really perform this many fits?", "Perform $size fits?", "Perform fits"); my $result = $yesno->ShowModal; if ($result == wxID_NO) { $::app->{main}->status("Not doing combinatorial sequence of $size fits."); return 0; }; }; $::app->{main}->status("Doing $size combinatorial fits", 'wait'); my $start = DateTime->now( time_zone => 'floating' ); $this->{LCF} -> sentinal(sub{$this->combi_sentinal($size)}); $this->{LCF} -> combi; $this->{LCF} -> plot_fit; $this->{result}->Clear; $this->{result}->SetValue($this->{LCF}->report); $this->_remove_all; my $i = 0; foreach my $st (@{ $this->{LCF}->standards }) { $this->{'standard'.$i}->SetStringSelection($st->name); my $w = sprintf("%.3f", $this->{LCF}->weight($st)); my $e = sprintf("%.3f", $this->{LCF}->e0($st)); $this->{'weight'.$i} -> SetValue($w); $this->{'e0'.$i} -> SetValue($e); $this->{'fite0'.$i} -> SetValue($this->{LCF}->is_e0_floated($st)); $this->{'require'.$i} -> SetValue($this->{LCF}->is_required($st)); ++$i; }; $this->combi_results; $this->{make} -> Enable(1); $this->{report} -> Enable(1); $this->{fitmarked} -> Enable(1); $this->{resultplot} -> Enable(1); $this->{resultreport} -> Enable(1); $this->{combireport} -> Enable(1); $this->{stats}->SetItemState(0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); $this->{notebook}->ChangeSelection(2); my $finishtext = Demeter->howlong($start, sprintf("%d combinatorial fits",$size)); $::app->{main}->status($finishtext); undef $busy; }; sub combi_sentinal { my ($this, $size) = @_; $::app->{main}->status($this->{LCF}->combi_count." of $size combinatorial fits", 'wait|nobuffer'); }; sub combi_results { my ($this) = @_; $this->{stats}->DeleteAllItems; $this->{fitresults}->DeleteAllItems; my @stand = keys %{ $this->{LCF}->options }; my %map = (); my %idx = (); my $i = 0; my $row = 0; foreach my $s (sort by_position @stand) { $map{$s} = chr($row+65); # A B C ... $idx{$s} = $this->{fitresults}->InsertStringItem($i, $row); $this->{fitresults}->SetItemData($idx{$s}, $i++); $this->{fitresults}->SetItem( $idx{$s}, 0, $map{$s} ); $this->{fitresults}->SetItem( $idx{$s}, 1, $this->{LCF}->mo->fetch('Data', $s)->name ); ++$row; }; $this->{index_map} = \%idx; $row = 0; $i = 0; foreach my $res (@{ $this->{LCF}->combi_results }) { my $rfact = $res->{Rfactor}; my $chinu = $res->{Chinu}; my @included = (); foreach my $s (sort by_position @stand) { if (exists $res->{$s}) { push @included, $map{$s}; }; }; my $idx = $this->{stats}->InsertStringItem($i, $row); $this->{stats}->SetItemData($idx, $i++); $this->{stats}->SetItem( $idx, 0, join(',', @included) ); $this->{stats}->SetItem( $idx, 1, sprintf("%.5g", $rfact) ); $this->{stats}->SetItem( $idx, 2, sprintf("%.5g", $chinu) ); ++$row; }; }; sub combi_select { my ($this, $event) = @_; my $busy = Wx::BusyCursor->new(); my @all = @{ $this->{LCF}->combi_results }; my $result = $all[$event->GetIndex]; $this->{LCF} -> restore($result); my @stand = keys %{ $this->{LCF}->options }; my %idx = %{ $this->{index_map} }; foreach my $s (sort by_position @stand) { if (exists $result->{$s}) { my @here = @{ $result->{$s} }; $this->{fitresults}->SetItem( $idx{$s}, 2, sprintf("%.3f (%.3f)", @here[0,1]) ); $this->{fitresults}->SetItem( $idx{$s}, 3, sprintf("%.3f (%.3f)", @here[2,3]) ); } else { $this->{fitresults}->SetItem( $idx{$s}, 2, q{} ); $this->{fitresults}->SetItem( $idx{$s}, 3, q{} ); }; }; $this->{LCF} -> plot_fit; $this->{result}->Clear; $this->{result}->SetValue($this->{LCF}->report); $this->_remove_all; my $i = 0; foreach my $st (sort by_data @{ $this->{LCF}->standards }) { #next if not $this->{LCF}->option_exists($st->name); $this->{'standard'.$i}->SetStringSelection($st->name); my $w = sprintf("%.3f", scalar($this->{LCF}->weight($st))); my $e = sprintf("%.3f", scalar($this->{LCF}->e0($st))); $this->{'weight'.$i} -> SetValue($w); $this->{'e0'.$i} -> SetValue($e); $this->{'fite0'.$i} -> SetValue($this->{LCF}->is_e0_floated($st)); $this->{'require'.$i} -> SetValue($this->{LCF}->is_required($st)); ++$i; }; undef $busy; }; sub combi_report { my ($this, $event) = @_; my $init = $::app->current_data->name . '_combinatorial.xls'; my $fd = Wx::FileDialog->new( $::app->{main}, "Save combinatorial results", cwd, $init, "Excel (*.xls)|*.xls|All files (*)|*", wxFD_SAVE|wxFD_CHANGE_DIR|wxFD_OVERWRITE_PROMPT, wxDefaultPosition); if ($fd->ShowModal == wxID_CANCEL) { $::app->{main}->status("Saving combinatorial results has been canceled."); return 0; }; my $fname = $fd->GetPath; #return if $::app->{main}->overwrite_prompt($fname); # work-around gtk's wxFD_OVERWRITE_PROMPT bug (5 Jan 2011) $this->{LCF}->combi_report($fname); $::app->{main}->status("Wrote combinatorial report as an Excel spreadsheet to $fname"); }; sub sequence { my ($this, $event) = @_; my $trouble = $this->_prep(0); my $busy = Wx::BusyCursor->new(); if ($trouble) { $::app->{main}->status("Not doing sequence -- the $trouble parameter value is not a number!", 'error|nobuffer'); return; }; my @groups = $::app->marked_groups; my $i = 0; foreach my $g (@groups) { last if ($g->group eq $::app->current_data->group); ++$i; }; $::app->{main}->status(sprintf("Fitting %d marked groups", $#groups+1), 'wait'); my $start = DateTime->now( time_zone => 'floating' ); $this->{LCF} -> sentinal(sub{$this->seq_sentinal($#groups+1)}); $this->{LCF} -> sequence(@groups); $this->{result}->Clear; $this->{result}->SetValue($this->{LCF}->report); $this->seq_results(@groups); $this->{markedresults} -> SetItemState(0, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED ); $this->seq_select($i); $this->{markedresults} -> SetItemState(0, 0, wxLIST_STATE_SELECTED); $this->{markedresults} -> SetItemState($i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED); my $finishtext = Demeter->howlong($start, sprintf("Fitting %d groups",$#groups+1)); $this->{plotmarked} -> Enable(1); $this->{markedreport} -> Enable(1); $::app->{main}->status($finishtext); undef $busy; }; sub seq_sentinal { my ($this, $size) = @_; $::app->{main}->status($this->{LCF}->seq_count." of $size LCF fits", 'wait|nobuffer'); }; sub seq_results { my ($this, @data) = @_; $this->{markedresults}->DeleteAllItems; $this->{mreport}->Clear; my @standards = @{ $this->{LCF}->standards }; my $ncol = $this->{markedresults}->GetColumnCount; foreach my $nc (reverse(4..$ncol)) { $this->{markedresults}->DeleteColumn($nc-1); }; my $c = 3; foreach my $st (@standards) { $this->{markedresults}->InsertColumn($c++ , $st->name, wxLIST_FORMAT_LEFT, 80 ); }; my ($i, $row) = (0,0); foreach my $res (@{ $this->{LCF}->seq_results }) { my $rfact = $res->{Rfactor}; my $chinu = $res->{Chinu}; my $idx = $this->{markedresults}->InsertStringItem($i, $row); $this->{markedresults}->SetItemData($idx, $i); $this->{markedresults}->SetItem( $idx, 0, $data[$i]->name ); $this->{markedresults}->SetItem( $idx, 1, sprintf("%.5g", $rfact) ); $this->{markedresults}->SetItem( $idx, 2, sprintf("%.5g", $chinu) ); ++$i; my $c = 3; foreach my $st (@standards) { $this->{markedresults}->SetItem( $idx, $c, sprintf("%.3f(%.3f)", $res->{$st->group}->[0], $res->{$st->group}->[1]) ); ++$c; last if $c>6; }; ++$row; }; $this->{notebook}->ChangeSelection(3); }; sub seq_select { my ($this, $event) = @_; my $busy = Wx::BusyCursor->new(); my $index = (ref($event) =~ m{Event}) ? $event->GetIndex : $event; my $result = $this->{LCF}->seq_results->[$index]; my $data = $this->{LCF}->mo->fetch('Data', $result->{Data}); $this->{LCF}->data($data); $this->{LCF}->restore($result); my $which = ($this->{LCF}->space =~ m{\Achi}) ? "lcf_prep_k" : "lcf_prep"; $this->{LCF}->dispense("analysis", $which); $this->{mreport}->SetValue($this->{LCF}->report); $this->_remove_all; my $i = 0; foreach my $st (@{ $this->{LCF}->standards }) { $this->{'standard'.$i}->SetStringSelection($st->name); my $w = sprintf("%.3f", scalar($this->{LCF}->weight($st))); my $e = sprintf("%.3f", scalar($this->{LCF}->e0($st))); $this->{'weight'.$i} -> SetValue($w); $this->{'e0'.$i} -> SetValue($e); $this->{'fite0'.$i} -> SetValue($this->{LCF}->is_e0_floated($st)); $this->{'require'.$i} -> SetValue($this->{LCF}->is_required($st)); ++$i; }; my $j = 0; foreach my $n (0 .. $::app->{main}->{list}->GetCount-1) { last if ($::app->{main}->{list}->GetIndexedData($n)->group eq $data->group); ++$j; }; $::app->{main}->{list}->SetSelection($j); $::app->OnGroupSelect(0,0,0); $this->{result}->Clear; $this->{result}->SetValue($this->{LCF}->report); $this->{LCF}->plot_fit; undef $busy; }; sub seq_report { my ($this, $event) = @_; my $init = ($::app->{main}->{project}->GetLabel eq '<untitled>') ? 'lcf_sequence' : $::app->{main}->{project}->GetLabel.'_lcf_sequence'; $init .= '.xls'; my $fd = Wx::FileDialog->new( $::app->{main}, "Save LCF fit sequence results", cwd, $init, "Excel (*.xls)|*.xls|All files (*)|*", wxFD_SAVE|wxFD_CHANGE_DIR|wxFD_OVERWRITE_PROMPT, wxDefaultPosition); if ($fd->ShowModal == wxID_CANCEL) { $::app->{main}->status("Saving fit sequence results has been canceled."); return 0; }; my $fname = $fd->GetPath; #return if $::app->{main}->overwrite_prompt($fname); # work-around gtk's wxFD_OVERWRITE_PROMPT bug (5 Jan 2011) $this->{LCF}->sequence_report($fname); $::app->{main}->status("Wrote LCF fit sequence report as an Excel spreadsheet to $fname"); }; sub seq_plot { my ($this, $event) = @_; $this->{LCF}->sequence_plot; $::app->{main}->status("Plotted components from the fit sequence"); }; sub _remove_all { my ($this) = @_; foreach my $i (0 .. $this->{nstan}-1) { $this->{'standard'.$i}->SetSelection(0); $this->{'weight'.$i}->SetValue(0); $this->{'e0'.$i}->SetValue(0); }; }; sub plot { my ($this, $event) = @_; $this->_prep; $this->{LCF}->plot_fit; $::app->{main}->status(sprintf("Plotted %s and LCF fit", $this->{LCF}->data->name)); $::app->heap_check(0); }; sub save { my ($this, $event) = @_; my $data = $::app->current_data; (my $name = $data->name) =~ s{\s+}{_}g; my $fd = Wx::FileDialog->new( $::app->{main}, "Save LCF fit to a file", cwd, $name.".lcf", "LCF (*.lcf)|*.lcf|All files (*)|*", wxFD_SAVE|wxFD_CHANGE_DIR|wxFD_OVERWRITE_PROMPT, wxDefaultPosition); if ($fd->ShowModal == wxID_CANCEL) { $::app->{main}->status("Saving LCF results to a file has been canceled."); return 0; }; my $fname = $fd->GetPath; #return if $::app->{main}->overwrite_prompt($fname); # work-around gtk's wxFD_OVERWRITE_PROMPT bug (5 Jan 2011) $this->{LCF}->save($fname); $::app->{main}->status("Saved LCF results to $fname"); }; sub make { my ($this, $event) = @_; my $new = $this->{LCF}->make_group; my $index = $::app->current_index; if ($index == $::app->{main}->{list}->GetCount-1) { $::app->{main}->{list}->AddData($new->name, $new); } else { $::app->{main}->{list}->InsertData($new->name, $index+1, $new); }; $::app->{main}->status("Made a new data group fromLCF fit to " . $::app->current_data->name); $::app->modified(1); }; sub fft { my ($this, $event) = @_; $this->_prep; my $busy = Wx::BusyCursor->new(); $::app->{main}->{'PlotR'}->pull_marked_values; $this->{LCF}->data->po->start_plot; $this->{LCF}->data->plot('R'); $this->{LCF}->fft; $this->{LCF}->plot('R'); undef $busy; }; sub by_position { my %hash = (); foreach my $i (0 .. $::app->{main}->{list}->GetCount-1) { my $g = $::app->{main}->{list}->GetIndexedData($i)->group; $hash{$g} = $i; }; $hash{$a} <=> $hash{$b}; }; sub by_data { my %hash = (); foreach my $i (0 .. $::app->{main}->{list}->GetCount-1) { my $g = $::app->{main}->{list}->GetIndexedData($i); $hash{$g->group} = $i; }; $hash{$a->group} <=> $hash{$b->group}; }; ## restore persistent information from a project file sub reinstate { my ($this, $hash) = @_; #print Data::Dumper->Dump([$hash], [qw/*LCF/]); ## booleans $this->{components}->SetValue($hash->{plot_components}); $this->{residual}->SetValue($hash->{plot_difference}); foreach my $k (qw(inclusive unity linear one_e0)) { $this->{$k}->SetValue($hash->{$k}); }; ## fitting space $this->{space}->SetSelection(2); $this->{space}->SetSelection(0) if ($hash->{space} eq 'norm'); $this->{space}->SetSelection(1) if ($hash->{space} eq 'deriv'); $this->OnSpace(q()); ## fit range my $e0 = 0; if ($this->{LCF}->mo->fetch('Data', $hash->{datagroup})) { $e0 = $this->{LCF}->mo->fetch('Data', $hash->{datagroup})->bkg_e0; }; $this->{xmin}->SetValue($hash->{xmin} - $e0) if $hash->{xmin} != 0; $this->{xmax}->SetValue($hash->{xmax} - $e0) if $hash->{xmax} != 0; ## artificial noise, info content, combi $this->{noise}->SetValue($hash->{noise}); $this->{ninfo}->SetValue($hash->{ninfo}); $this->{max} ->SetValue($hash->{max_standards}); $this->_remove_all; my $count = 0; foreach my $g (keys %{ $hash->{options} }) { my $d = $this->{LCF}->mo->fetch('Data', $g); $this->{'standard'.$count}->SetStringSelection($d->name); $this->{'fite0'.$count} -> SetValue($hash->{options}->{$g}->[0]); $this->{'require'.$count} -> SetValue($hash->{options}->{$g}->[1]); $this->{'weight'.$count} -> SetValue($hash->{options}->{$g}->[2]); $this->{'e0'.$count} -> SetValue($hash->{options}->{$g}->[4]); ++$count; }; $::app->{main}->status("Restored LCF state from project file"); }; 1; =head1 NAME Demeter::UI::Athena::LCF - A linear combination fitting tool for Athena =head1 VERSION This documentation refers to Demeter version 0.9.26. =head1 SYNOPSIS This module provides a =head1 CONFIGURATION =head1 DEPENDENCIES Demeter's dependencies are in the F<Build.PL> file. =head1 BUGS AND LIMITATIONS =over 4 =item * This 'n' that =back Please report problems to the Ifeffit Mailing List (L<http://cars9.uchicago.edu/mailman/listinfo/ifeffit/>) Patches are welcome. =head1 AUTHOR Bruce Ravel, L<http://bruceravel.github.io/home> L<http://bruceravel.github.io/demeter/> =head1 LICENCE AND COPYRIGHT Copyright (c) 2006-2019 Bruce Ravel (L<http://bruceravel.github.io/home>). All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L<perlgpl>. 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. =cut
39.498239
174
0.598083
ed6b549f44971cc35c212538b63187d0cfff3047
15,727
pm
Perl
scripts/import/dbSNP/EnsemblIds.pm
ens-lgil/ensembl-variation
ebfebebbb815198d36027014feb0bebf2176a45a
[ "Apache-2.0" ]
null
null
null
scripts/import/dbSNP/EnsemblIds.pm
ens-lgil/ensembl-variation
ebfebebbb815198d36027014feb0bebf2176a45a
[ "Apache-2.0" ]
null
null
null
scripts/import/dbSNP/EnsemblIds.pm
ens-lgil/ensembl-variation
ebfebebbb815198d36027014feb0bebf2176a45a
[ "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 use strict; =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 <helpdesk.org>. =cut use warnings; #object that contains the specific methods to dump data when the specie is a HUMAN (adds HGVbase and TSC information). package dbSNP::EnsemblIds; #use dbSNP::GenericContig; use dbSNP::GenericChromosome; use vars qw(@ISA); use ImportUtils qw(debug load dumpSQL create_and_load); use Progress; #@ISA = ('dbSNP::GenericContig'); @ISA = ('dbSNP::GenericChromosome'); sub dump_dbSNP{ my $self = shift; my $start; my $end; my $duration; #first, dump all dbSNP data as usual $start = time(); $self->SUPER::dump_dbSNP(); print Progress::location(); $end = time(); $duration = Progress::time_format($end-$start); print $duration->{'weeks'} . " weeks, " . $duration->{'days'} . " days, " . $duration->{'hours'} . " hours, " . $duration->{'minutes'} . " minutes and " . $duration->{'seconds'} . " seconds spent in SUPER::dump_dbSNP()\n"; $start = time(); $self->dump_LSDBIDs() if $self->{'dbm'}->dbCore()->species =~ /hum|homo/i; print Progress::location(); $end = time(); $duration = Progress::time_format($end-$start); print $duration->{'weeks'} . " weeks, " . $duration->{'days'} . " days, " . $duration->{'hours'} . " hours, " . $duration->{'minutes'} . " minutes and " . $duration->{'seconds'} . " seconds spent in dump_LSDBIDs()\n"; } #get ENSIDs from dbSNP sub dump_ENSIDs{ my $self = shift; my %ens_batch_name = ('rat' => ['RAT_COMPUTATIONAL_CELERA','RAT_COMPUTATIONAL_STAR'], 'platypus' => ['2008FEB_platypus_assembly','2008FEB_platypus_reads'], ); #add the ENS source to the table foreach my $species (keys %ens_batch_name) { if ($self->{'dbCore'}->species =~ /$species/i) { foreach my $batch_name (@{$ens_batch_name{$species}}) { debug("Processing $batch_name..."); $self->{'dbVar'}->do(qq{INSERT INTO source (name,version,description) values ("ENSEMBL_$batch_name",1,"Variation called by ENSEMBL")}); my $source_id = $self->{'dbVar'}->db_handle->{'mysql_insertid'}; #get the last autoinc id in the database (the one from the ENS source) #and finally add the ENS ids to the synonyms table debug("Dumping ENS information from dbSNP"); my $stmt = qq{ SELECT 'rs'+LTRIM(STR(s.snp_id)), s.subsnp_id, $source_id, s.loc_snp_id FROM SubSNP s, Batch b WHERE s.batch_id = b.batch_id AND b.handle = 'ENSEMBL' AND b.loc_batch_id = '$batch_name' }; dumpSQL($self->{'dbSNP'},$stmt); debug("Loading ENS ids into temporary table"); create_and_load($self->{'dbVar'},"tmp_rs_ENS_$batch_name","rsID *","ss_id i","source_id i","ENSid"); debug("Loading ENS ids into variation_synonym table"); $self->{'dbVar'}->do(qq{ INSERT IGNORE INTO variation_synonym (variation_id, subsnp_id, source_id, name) SELECT v.variation_id, trt.ss_id, trt.source_id, trt.ENSid FROM variation v, tmp_rs_ENS_$batch_name trt WHERE v.name = trt.rsID } ); #and finally, remove the temporary table #$self->{'dbVar'}->do(qq{DROP TABLE tmp_rs_ENS_$batch_name}); } } } } # This method uses the pontus_affy_array_mapping database on ens-variation sub dump_AFFYIDs{ my $self = shift; my ($source_name,$source_description,$source_url,$set_name); my $stmt; $source_url = "http://www.affymetrix.com/"; debug("Dumping AFFY information from dbSNP"); $stmt = qq{ SELECT 'rs'+LTRIM(STR(s.snp_id)), s.loc_snp_id, loc_batch_id FROM SubSNP s, Batch b WHERE s.batch_id = b.batch_id AND b.handle = 'AFFY' }; dumpSQL($self->{'dbSNP'},$stmt); debug("Loading ids into temporary table"); create_and_load($self->{'dbVar'},"tmp_rs_AFFY","rsID *","AFFYid", "affy_name"); print Progress::location(); my $db = "pontus_dbsnp132_human_external_data"; foreach my $table ("affy_array_name_pair_100k","affy_array_name_pair_500k","affy_array_name_pair_g6") { if ($table =~ /100k/i) { $source_name = "Affy GeneChip 100K Array"; $source_description = "Variants from the Affymetrix GeneChip Human Mapping 100K Array Set"; $set_name = "Mapping50K"; } elsif ($table =~ /500k/i) { $source_name = "Affy GeneChip 500K Array"; $source_description = "Variants from the Affymetrix GeneChip Human Mapping 500K Array Set"; $set_name = "Mapping250K"; } elsif ($table =~ /g6/i) { $source_name = "Affy GenomeWideSNP_6.0"; $source_description = "Variants from the Affymetrix Genome-Wide Human SNP Array 6.0"; $set_name = "6.0"; } debug(localtime() . "\tCreating name_pair table with source_name $source_name..."); $stmt = qq{ CREATE TABLE $table LIKE $db\.$table }; $self->{'dbVar'}->do($stmt); print Progress::location(); debug(localtime() . "\tDumping AFFY id name pairs from $db\.$table\n"); $stmt = qq{ INSERT INTO $table ( affy_name, rs_name ) SELECT affy_name, rs_name FROM $db\.$table }; $self->{'dbVar'}->do($stmt); debug(localtime() . "\tCreating a temporary table for AFFY ids\n"); $stmt = qq{ CREATE TABLE tmp SELECT a.AFFYid AS affy_name, a.rsID AS rs_name FROM tmp_rs_AFFY a, $table c WHERE a.AFFYid = c.affy_name }; $self->{'dbVar'}->do($stmt); print Progress::location(); debug(localtime() . "\tAdding AFFY ids from temporary table\n"); $stmt = qq{ INSERT IGNORE INTO $table ( affy_name, rs_name ) SELECT affy_name, rs_name FROM tmp }; $self->{'dbVar'}->do($stmt); print Progress::location(); debug(localtime() . "\tDropping temporary table\n"); $stmt = qq{ DROP TABLE tmp }; $self->{'dbVar'}->do($stmt); print Progress::location(); # The code below has been replaced by the dump-and-load code above #$self->{'dbVar'}->do(qq{CREATE TABLE $table\_name_pair like $table.name_pair}); #$self->{'dbVar'}->do(qq{insert into $table\_name_pair select * from $table.name_pair}); #$self->{'dbVar'}->do(qq{insert ignore into $table\_name_pair # select a.AFFYid as affy_name,a.rsID as rs_name # from tmp_rs_AFFY a, $table.name_pair c # where a.AFFYid=c.affy_name}); if ($table =~ /g6/i) { debug(localtime() . "\tUpdating $table\n"); $stmt = qq{ UPDATE $table SET affy_name = REPLACE(affy_name,'AFFY_6_1M_','') }; $self->{'dbVar'}->do($stmt); print Progress::location(); } my $source_id_ref = $self->{'dbVar'}->db_handle->selectall_arrayref(qq{ SELECT source_id from source where name = "$source_name"}); my $source_id = $source_id_ref->[0][0]; if (!$source_id) { $self->{'dbVar'}->do(qq{insert into source (name,description,url,type) values("$source_name","$source_description","$source_url","chip")}); print Progress::location(); $source_id = $self->{'dbVar'}->db_handle->{'mysql_insertid'}; } debug("Inserting in variation_synonym table from $table\..."); $self->{'dbVar'}->do(qq{ INSERT IGNORE INTO variation_synonym (variation_id, source_id, name) SELECT v.variation_id, $source_id as source_id, t.affy_name as name FROM variation v, $table t WHERE v.name = t.rs_name } ); print Progress::location(); #update rs_ID to rsCurrent from rsHigh #$self->{'dbVar'}->do(qq{update tmp_rs_AFFY_test t, rsHist h set t.rsID=h.rsCurrent where t.rsID=h.rsHigh}); debug("Inserting in variation_synonym table from table tmp_rs_AFFY with $source_name..."); $self->{'dbVar'}->do(qq{ INSERT IGNORE INTO variation_synonym (variation_id, source_id, name) SELECT v.variation_id, $source_id as source_id, t.AFFYid as name FROM variation v, tmp_rs_AFFY t WHERE v.name = t.rsID AND t.affy_name like "%$set_name%" } ); print Progress::location(); #and finally, remove the temporary table $self->{'dbVar'}->do(qq{DROP TABLE $table}); print Progress::location(); } } # gets LSDB local IDs & source information sub dump_LSDBIDs { my $self = shift; print Progress::location(); debug(localtime() . "\tAdding/getting source ID for LSDB\n"); my $dbh = $self->{'dbVar'}->db_handle(); my %source_ids; my ($species,$tax_id,$version) = $self->{'snp_dbname'} =~ m/^(.+)?\_([0-9]+)\_([0-9]+)$/; $source_ids{default} = get_default_source($dbh, $version); ## include version for dbSNP $source_ids{phencode} = get_phencode_source($dbh); ## source data for LSDB submissions stored in production db my $batch_data = $self->get_lsdb_batches(); foreach my $batch(keys %{$batch_data }){ unless (defined $source_ids{ $$batch_data{$batch}{db} } ){ my %source_info = ( 'name' => $$batch_data{$batch}{db}, 'desc' => $$batch_data{$batch}{desc}, 'url' => $$batch_data{$batch}{url} ); warn "getting source for LSDB ". $$batch_data{$batch}{db} . ", ". $$batch_data{$batch}{desc} . "\n"; $source_ids{ $$batch_data{$batch}{db} } = get_source($dbh , \%source_info ); } } print Progress::location(); debug(localtime() . "\tDumping LSDB local IDs from dbSNP\n"); # dump IDs from dbSNP DB & load to temp table my $stmt = qq{ SELECT DISTINCT ss.loc_snp_id, ss.subsnp_id, sl.snp_id, b.loc_batch_id FROM SubSNP ss JOIN SNPSubSNPLink sl ON sl.subsnp_id = ss.subsnp_id JOIN Batch b ON b.batch_id = ss.batch_id JOIN $self->{'dbSNP_share_db'}.Method m ON b.method_id = m.method_id AND m.method_class = 109 WHERE b.handle !='SWISSPROT' }; dumpSQL($self->{'dbSNP'}, $stmt, $self->{source_engine}); print Progress::location(); debug(localtime() . "\tCopying IDs to synonym table\n"); create_and_load($self->{'dbVar'}, "tmp_lsdb_ids", 'name', 'ssid i*', 'rsid i*','batch_id'); my $syn_ins_sth = $dbh->prepare(qq[ INSERT INTO variation_synonym (variation_id, subsnp_id, source_id, name) values (?,?,?,?) ]); my $dat_ext_sth = $dbh->prepare(qq[SELECT distinct v.variation_id, t.ssid, t.batch_id, t.name FROM variation v, tmp_lsdb_ids t WHERE v.snp_id = t.rsid ]); my %done; $dat_ext_sth->execute()||die; while( my $line = $dat_ext_sth->fetchrow_arrayref()){ ## link to phencode if present in db if( defined $batch_data->{ $line->[2]}->{phencode} ){ $syn_ins_sth->execute($line->[0], $line->[1], $source_ids{phencode}, $line->[3])||die; } ## link to source db if not in phencode - could link to both if name switch implemented elsif( defined $batch_data->{$line->[2]}->{db} ){ $syn_ins_sth->execute($line->[0], $line->[1], $source_ids{ $batch_data->{$line->[2]}->{db} }, $line->[3])||die; } ## link to dbSNP source else{ next if(defined $done{$line->[3]}{default} ); $done{$line->[3]}{default} = 1; $syn_ins_sth->execute($line->[0], $line->[1], $source_ids{default}, $line->[3])||die; } } print Progress::location(); debug(localtime() . "\tDropping temporary table\n"); $self->{'dbVar'}->db_handle->do(qq{DROP TABLE tmp_lsdb_ids}); } sub get_source { my $dbh = shift; my $source_data = shift; die "Cannot handle nameless source\n" unless defined $source_data->{name}; my $source_ext_sth = $dbh->prepare(qq[ select source_id from source where name = ?]); my $source_ins_sth = $dbh->prepare(qq[ insert into source (name, version, description, url, somatic_status) values (?,?,?,?,?) ]); ### source already loaded $source_ext_sth->execute($source_data->{name})||die; my $id = $source_ext_sth->fetchall_arrayref(); return $id->[0]->[0] if defined $id->[0]->[0]; ## add new source $source_ins_sth->execute($source_data->{name}, $source_data->{version}, $source_data->{desc}, $source_data->{url}, $source_data->{somatic} )||die; $source_ext_sth->execute($source_data->{name})||die; my $idn = $source_ext_sth->fetchall_arrayref(); return $idn->[0]->[0] if defined $idn->[0]->[0]; die "Failed to get source for $source_data->{name} \n"; } sub get_default_source{ my $dbh = shift; my $version = shift; ## if original source cannot be identified, link to dbSNP my %default_source = ( 'name' => 'LSDB', 'version' => "dbSNP $version", 'desc' => "Variants dbSNP annotates as being from LSDBs", 'url' => "http://www.ncbi.nlm.nih.gov/projects/SNP/" ); return get_source($dbh, \%default_source); } sub get_phencode_source{ my $dbh = shift; ## many submissions linked to phencode my %phencode_source = ( 'name' => 'PhenCode', 'desc' => "PhenCode is a collaborative project to better understand the relationship between genotype and phenotype in humans", 'url' => "http://phencode.bx.psu.edu/" ); return get_source($dbh, \%phencode_source ); } ## find pre-checked batches and source info sub get_lsdb_batches{ my $self = shift; my %data; my $dbh = $self->{'dbInt'}->db_handle(); my $req_ext_sth = $dbh->prepare(qq[ select dbSNP_lsdb_batch.dbSNP_batch, lsdb_info.database_name, lsdb_info.is_displayed, lsdb_info.display_phencode, lsdb_info.description, lsdb_info.url from lsdb_info, dbSNP_lsdb_batch where dbSNP_lsdb_batch.dbSNP_handle = lsdb_info.dbSNP_handle ]); $req_ext_sth->execute(); my $dat = $req_ext_sth->fetchall_arrayref(); foreach my $l(@{$dat}){ if($l->[2] ==1){ ## link to source database $data{$l->[0]}{db} = $l->[1]; $data{$l->[0]}{desc} = $l->[4]; $data{$l->[0]}{url} = $l->[5]; } if($l->[3] ==1){ ## link to phencode $data{$l->[0]}{db} = 'phencode'; $data{$l->[0]}{phencode} = 1; } } return \%data; } 1;
32.03055
226
0.596681
edbd0e55f888b1a9c4beed44134544374c77dd6b
2,436
pm
Perl
auto-lib/Paws/EC2/DescribeRegions.pm
agimenez/aws-sdk-perl
9c4dff7d1af2ff0210c28ca44fb9e92bc625712b
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/EC2/DescribeRegions.pm
agimenez/aws-sdk-perl
9c4dff7d1af2ff0210c28ca44fb9e92bc625712b
[ "Apache-2.0" ]
null
null
null
auto-lib/Paws/EC2/DescribeRegions.pm
agimenez/aws-sdk-perl
9c4dff7d1af2ff0210c28ca44fb9e92bc625712b
[ "Apache-2.0" ]
null
null
null
package Paws::EC2::DescribeRegions; use Moose; has DryRun => (is => 'ro', isa => 'Bool', traits => ['NameInRequest'], request_name => 'dryRun' ); has Filters => (is => 'ro', isa => 'ArrayRef[Paws::EC2::Filter]', traits => ['NameInRequest'], request_name => 'Filter' ); has RegionNames => (is => 'ro', isa => 'ArrayRef[Str|Undef]', traits => ['NameInRequest'], request_name => 'RegionName' ); use MooseX::ClassAttribute; class_has _api_call => (isa => 'Str', is => 'ro', default => 'DescribeRegions'); class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::EC2::DescribeRegionsResult'); class_has _result_key => (isa => 'Str', is => 'ro'); 1; ### main pod documentation begin ### =head1 NAME Paws::EC2::DescribeRegions - Arguments for method DescribeRegions on Paws::EC2 =head1 DESCRIPTION This class represents the parameters used for calling the method DescribeRegions on the Amazon Elastic Compute Cloud service. Use the attributes of this class as arguments to method DescribeRegions. You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to DescribeRegions. As an example: $service_obj->DescribeRegions(Att1 => $value1, Att2 => $value2, ...); 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. =head1 ATTRIBUTES =head2 DryRun => Bool Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is C<DryRunOperation>. Otherwise, it is C<UnauthorizedOperation>. =head2 Filters => ArrayRef[L<Paws::EC2::Filter>] One or more filters. =over =item * C<endpoint> - The endpoint of the region (for example, C<ec2.us-east-1.amazonaws.com>). =item * C<region-name> - The name of the region (for example, C<us-east-1>). =back =head2 RegionNames => ArrayRef[Str|Undef] The names of one or more regions. =head1 SEE ALSO This class forms part of L<Paws>, documenting arguments for method DescribeRegions in L<Paws::EC2> =head1 BUGS and CONTRIBUTIONS The source code is located here: https://github.com/pplu/aws-sdk-perl Please report bugs to: https://github.com/pplu/aws-sdk-perl/issues =cut
28.325581
249
0.718391
ede2313f0c227c12f73d5635ef3723ea5665e8f2
115
pl
Perl
fixtures/cover-03.pl
toddr/devel-quickcover
e442c9c75d21e8ffce4bc48c91c294faa53536cf
[ "MIT" ]
8
2015-09-22T15:48:08.000Z
2020-07-26T21:04:52.000Z
fixtures/cover-03.pl
toddr/devel-quickcover
e442c9c75d21e8ffce4bc48c91c294faa53536cf
[ "MIT" ]
11
2016-02-29T08:08:22.000Z
2019-08-16T15:24:43.000Z
fixtures/cover-03.pl
toddr/devel-quickcover
e442c9c75d21e8ffce4bc48c91c294faa53536cf
[ "MIT" ]
9
2016-02-25T20:43:59.000Z
2020-07-26T21:04:54.000Z
my $a = 0; # YES my $f; # YES if (rand(10) > 10) { # YES $a += 4; } else { $a = 2; # YES }
6.764706
27
0.321739
edf19ce9b6767b312ccf88b11d4bc11a0e6d9b90
4,946
t
Perl
t/02-can.t
danaj/Math-Prime-Util
5ae0320be965be85c40af78d8899ff458e94bbb5
[ "Artistic-1.0" ]
37
2015-01-09T03:10:36.000Z
2021-11-05T23:38:46.000Z
t/02-can.t
danaj/Math-Prime-Util
5ae0320be965be85c40af78d8899ff458e94bbb5
[ "Artistic-1.0" ]
47
2015-04-14T19:47:22.000Z
2022-03-23T10:40:55.000Z
t/02-can.t
danaj/Math-Prime-Util
5ae0320be965be85c40af78d8899ff458e94bbb5
[ "Artistic-1.0" ]
19
2015-06-11T10:29:58.000Z
2021-06-28T15:06:00.000Z
#!/usr/bin/env perl use strict; use warnings; use Math::Prime::Util; use Test::More tests => 1; my @functions = qw( prime_get_config prime_set_config prime_precalc prime_memfree is_prime is_prob_prime is_provable_prime is_provable_prime_with_cert prime_certificate verify_prime is_pseudoprime is_euler_pseudoprime is_strong_pseudoprime is_euler_plumb_pseudoprime is_lucas_pseudoprime is_strong_lucas_pseudoprime is_extra_strong_lucas_pseudoprime is_almost_extra_strong_lucas_pseudoprime is_frobenius_pseudoprime is_frobenius_underwood_pseudoprime is_frobenius_khashin_pseudoprime is_perrin_pseudoprime is_catalan_pseudoprime is_aks_prime is_bpsw_prime is_ramanujan_prime is_mersenne_prime is_delicate_prime is_power is_prime_power is_perfect_power is_square is_square_free is_powerfree is_pillai is_polygonal is_semiprime is_almost_prime is_omega_prime is_primitive_root is_carmichael is_quasi_carmichael is_fundamental is_totient is_gaussian_prime is_sum_of_squares is_smooth is_rough is_powerful is_practical is_lucky sqrtint rootint logint lshiftint rshiftint rashiftint absint negint signint cmpint addint subint add1int sub1int mulint powint divint modint divrem fdivrem tdivrem miller_rabin_random lucas_sequence lucasu lucasv lucasuv lucasumod lucasvmod lucasuvmod primes twin_primes semi_primes almost_primes omega_primes ramanujan_primes sieve_prime_cluster sieve_range prime_powers lucky_numbers forprimes forcomposites foroddcomposites forsemiprimes foralmostprimes forpart forcomp forcomb forperm forderange formultiperm forsetproduct fordivisors forfactored forsquarefree lastfor numtoperm permtonum randperm shuffle prime_iterator prime_iterator_object next_prime prev_prime next_prime_power prev_prime_power next_perfect_power prev_perfect_power prime_count prime_count_lower prime_count_upper prime_count_approx nth_prime nth_prime_lower nth_prime_upper nth_prime_approx inverse_li twin_prime_count twin_prime_count_approx nth_twin_prime nth_twin_prime_approx semiprime_count semiprime_count_approx nth_semiprime nth_semiprime_approx almost_prime_count almost_prime_count_approx almost_prime_count_lower almost_prime_count_upper nth_almost_prime nth_almost_prime_approx nth_almost_prime_lower nth_almost_prime_upper omega_prime_count nth_omega_prime ramanujan_prime_count ramanujan_prime_count_approx ramanujan_prime_count_lower ramanujan_prime_count_upper nth_ramanujan_prime nth_ramanujan_prime_approx nth_ramanujan_prime_lower nth_ramanujan_prime_upper powerful_count nth_powerful prime_power_count prime_power_count_approx prime_power_count_lower prime_power_count_upper nth_prime_power nth_prime_power_approx nth_prime_power_lower nth_prime_power_upper perfect_power_count perfect_power_count_approx perfect_power_count_lower perfect_power_count_upper nth_perfect_power nth_perfect_power_approx nth_perfect_power_lower nth_perfect_power_upper powerfree_count powerfree_sum powerfree_part powerfree_part_sum smooth_count rough_count lucky_count lucky_count_approx lucky_count_lower lucky_count_upper nth_lucky nth_lucky_approx nth_lucky_lower nth_lucky_upper sum_primes print_primes random_prime random_ndigit_prime random_nbit_prime random_safe_prime random_strong_prime random_proven_prime random_proven_prime_with_cert random_maurer_prime random_maurer_prime_with_cert random_shawe_taylor_prime random_shawe_taylor_prime_with_cert random_semiprime random_unrestricted_semiprime random_factored_integer primorial pn_primorial consecutive_integer_lcm gcdext chinese chinese2 gcd lcm factor factor_exp divisors valuation hammingweight todigits fromdigits todigitstring sumdigits tozeckendorf fromzeckendorf sqrtmod allsqrtmod rootmod allrootmod invmod addmod submod mulmod divmod powmod qnr vecsum vecmin vecmax vecprod vecreduce vecextract vecequal vecany vecall vecnotall vecnone vecfirst vecfirstidx moebius mertens liouville sumliouville prime_omega prime_bigomega euler_phi jordan_totient exp_mangoldt partitions bernfrac bernreal harmfrac harmreal chebyshev_theta chebyshev_psi divisor_sum carmichael_lambda kronecker hclassno inverse_totient ramanujan_tau ramanujan_sum stirling znorder znprimroot znlog legendre_phi factorial factorialmod binomial binomialmod ExponentialIntegral LogarithmicIntegral RiemannZeta RiemannR LambertW Pi irand irand64 drand urandomb urandomm csrand random_bytes entropy_bytes ); can_ok( 'Math::Prime::Util', @functions);
47.104762
80
0.815609
edd2994b88c2bc9e1334b007940a716e924c83a4
1,453
pm
Perl
src/perl/lib/DnsResolvd.pm
rgolubtsov/dnsresolvd-multilang
44c03edd685f8b1276cff3dacfc821ea135038f1
[ "MIT" ]
2
2019-03-02T23:07:46.000Z
2020-09-05T10:19:06.000Z
src/perl/lib/DnsResolvd.pm
rgolubtsov/dnsresolvd-multilang
44c03edd685f8b1276cff3dacfc821ea135038f1
[ "MIT" ]
147
2017-10-17T22:08:00.000Z
2020-02-12T20:35:08.000Z
src/perl/lib/DnsResolvd.pm
rgolubtsov/dnsresolvd-multilang
44c03edd685f8b1276cff3dacfc821ea135038f1
[ "MIT" ]
null
null
null
# # src/perl/lib/DnsResolvd.pm # ============================================================================= # DNS Resolver Daemon (dnsresolvd). Version 0.9.9 # ============================================================================= # A daemon that performs DNS lookups for the given hostname # passed in an HTTP request, with the focus on its implementation # using various programming languages. (Mojolicious-boosted impl.) # ============================================================================= # Copyright (C) 2017-2022 Radislav (Radicchio) Golubtsov # # (See the LICENSE file at the top of the source tree.) # package DnsResolvd; use Mojo::Base "Mojolicious"; # HTTP request methods. use constant { HTTP_GET => "GET", HTTP_POST => "POST", }; ## Constant: The root route to make HTTP requests. use constant ROOT_ROUTE => "/"; ## Constant: The controller route to make DNS lookup actions. use constant DNS_LOOKUP_CONTROLLER_ROUTE => "dns_lookup_controller"; ## Constant: The DNS lookup action route. use constant DNS_LOOKUP_ACTION_ROUTE => "#dns_lookup"; ## Starts up the daemon. sub startup { my $self = shift(); # Getting the router object. my $router = $self->routes(); # Routing to the DNS lookup controller and action route. $router->any([ HTTP_GET, HTTP_POST, ] =>ROOT_ROUTE)->to(DNS_LOOKUP_CONTROLLER_ROUTE . DNS_LOOKUP_ACTION_ROUTE); } 1; # vim:set nu et ts=4 sw=4:
28.490196
79
0.590502
eda8d7d47dc914629c46146dc26c83b9415007c8
36,455
pm
Perl
perl/vendor/lib/DateTime/TimeZone/America/North_Dakota/New_Salem.pm
luiscarlosg27/xampp
c295dbdd435c9c62fbd4cc6fc42097bea7a900a0
[ "Apache-2.0" ]
2
2021-07-24T12:46:49.000Z
2021-08-02T08:37:53.000Z
perl/vendor/lib/DateTime/TimeZone/America/North_Dakota/New_Salem.pm
luiscarlosg27/xampp
c295dbdd435c9c62fbd4cc6fc42097bea7a900a0
[ "Apache-2.0" ]
null
null
null
perl/vendor/lib/DateTime/TimeZone/America/North_Dakota/New_Salem.pm
luiscarlosg27/xampp
c295dbdd435c9c62fbd4cc6fc42097bea7a900a0
[ "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/YblPzX5pmU/northamerica. Olson data version 2020a # # Do not edit this file directly. # package DateTime::TimeZone::America::North_Dakota::New_Salem; use strict; use warnings; use namespace::autoclean; our $VERSION = '2.39'; use Class::Singleton 1.03; use DateTime::TimeZone; use DateTime::TimeZone::OlsonDB; @DateTime::TimeZone::America::North_Dakota::New_Salem::ISA = ( 'Class::Singleton', 'DateTime::TimeZone' ); my $spans = [ [ DateTime::TimeZone::NEG_INFINITY, # utc_start 59418039600, # utc_end 1883-11-18 19:00:00 (Sun) DateTime::TimeZone::NEG_INFINITY, # local_start 59418015261, # local_end 1883-11-18 12:14:21 (Sun) -24339, 0, 'LMT', ], [ 59418039600, # utc_start 1883-11-18 19:00:00 (Sun) 60502410000, # utc_end 1918-03-31 09:00:00 (Sun) 59418014400, # local_start 1883-11-18 12:00:00 (Sun) 60502384800, # local_end 1918-03-31 02:00:00 (Sun) -25200, 0, 'MST', ], [ 60502410000, # utc_start 1918-03-31 09:00:00 (Sun) 60520550400, # utc_end 1918-10-27 08:00:00 (Sun) 60502388400, # local_start 1918-03-31 03:00:00 (Sun) 60520528800, # local_end 1918-10-27 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 60520550400, # utc_start 1918-10-27 08:00:00 (Sun) 60533859600, # utc_end 1919-03-30 09:00:00 (Sun) 60520525200, # local_start 1918-10-27 01:00:00 (Sun) 60533834400, # local_end 1919-03-30 02:00:00 (Sun) -25200, 0, 'MST', ], [ 60533859600, # utc_start 1919-03-30 09:00:00 (Sun) 60552000000, # utc_end 1919-10-26 08:00:00 (Sun) 60533838000, # local_start 1919-03-30 03:00:00 (Sun) 60551978400, # local_end 1919-10-26 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 60552000000, # utc_start 1919-10-26 08:00:00 (Sun) 61255472400, # utc_end 1942-02-09 09:00:00 (Mon) 60551974800, # local_start 1919-10-26 01:00:00 (Sun) 61255447200, # local_end 1942-02-09 02:00:00 (Mon) -25200, 0, 'MST', ], [ 61255472400, # utc_start 1942-02-09 09:00:00 (Mon) 61366287600, # utc_end 1945-08-14 23:00:00 (Tue) 61255450800, # local_start 1942-02-09 03:00:00 (Mon) 61366266000, # local_end 1945-08-14 17:00:00 (Tue) -21600, 1, 'MWT', ], [ 61366287600, # utc_start 1945-08-14 23:00:00 (Tue) 61370294400, # utc_end 1945-09-30 08:00:00 (Sun) 61366266000, # local_start 1945-08-14 17:00:00 (Tue) 61370272800, # local_end 1945-09-30 02:00:00 (Sun) -21600, 1, 'MPT', ], [ 61370294400, # utc_start 1945-09-30 08:00:00 (Sun) 62051302800, # utc_end 1967-04-30 09:00:00 (Sun) 61370269200, # local_start 1945-09-30 01:00:00 (Sun) 62051277600, # local_end 1967-04-30 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62051302800, # utc_start 1967-04-30 09:00:00 (Sun) 62067024000, # utc_end 1967-10-29 08:00:00 (Sun) 62051281200, # local_start 1967-04-30 03:00:00 (Sun) 62067002400, # local_end 1967-10-29 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62067024000, # utc_start 1967-10-29 08:00:00 (Sun) 62082752400, # utc_end 1968-04-28 09:00:00 (Sun) 62066998800, # local_start 1967-10-29 01:00:00 (Sun) 62082727200, # local_end 1968-04-28 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62082752400, # utc_start 1968-04-28 09:00:00 (Sun) 62098473600, # utc_end 1968-10-27 08:00:00 (Sun) 62082730800, # local_start 1968-04-28 03:00:00 (Sun) 62098452000, # local_end 1968-10-27 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62098473600, # utc_start 1968-10-27 08:00:00 (Sun) 62114202000, # utc_end 1969-04-27 09:00:00 (Sun) 62098448400, # local_start 1968-10-27 01:00:00 (Sun) 62114176800, # local_end 1969-04-27 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62114202000, # utc_start 1969-04-27 09:00:00 (Sun) 62129923200, # utc_end 1969-10-26 08:00:00 (Sun) 62114180400, # local_start 1969-04-27 03:00:00 (Sun) 62129901600, # local_end 1969-10-26 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62129923200, # utc_start 1969-10-26 08:00:00 (Sun) 62145651600, # utc_end 1970-04-26 09:00:00 (Sun) 62129898000, # local_start 1969-10-26 01:00:00 (Sun) 62145626400, # local_end 1970-04-26 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62145651600, # utc_start 1970-04-26 09:00:00 (Sun) 62161372800, # utc_end 1970-10-25 08:00:00 (Sun) 62145630000, # local_start 1970-04-26 03:00:00 (Sun) 62161351200, # local_end 1970-10-25 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62161372800, # utc_start 1970-10-25 08:00:00 (Sun) 62177101200, # utc_end 1971-04-25 09:00:00 (Sun) 62161347600, # local_start 1970-10-25 01:00:00 (Sun) 62177076000, # local_end 1971-04-25 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62177101200, # utc_start 1971-04-25 09:00:00 (Sun) 62193427200, # utc_end 1971-10-31 08:00:00 (Sun) 62177079600, # local_start 1971-04-25 03:00:00 (Sun) 62193405600, # local_end 1971-10-31 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62193427200, # utc_start 1971-10-31 08:00:00 (Sun) 62209155600, # utc_end 1972-04-30 09:00:00 (Sun) 62193402000, # local_start 1971-10-31 01:00:00 (Sun) 62209130400, # local_end 1972-04-30 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62209155600, # utc_start 1972-04-30 09:00:00 (Sun) 62224876800, # utc_end 1972-10-29 08:00:00 (Sun) 62209134000, # local_start 1972-04-30 03:00:00 (Sun) 62224855200, # local_end 1972-10-29 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62224876800, # utc_start 1972-10-29 08:00:00 (Sun) 62240605200, # utc_end 1973-04-29 09:00:00 (Sun) 62224851600, # local_start 1972-10-29 01:00:00 (Sun) 62240580000, # local_end 1973-04-29 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62240605200, # utc_start 1973-04-29 09:00:00 (Sun) 62256326400, # utc_end 1973-10-28 08:00:00 (Sun) 62240583600, # local_start 1973-04-29 03:00:00 (Sun) 62256304800, # local_end 1973-10-28 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62256326400, # utc_start 1973-10-28 08:00:00 (Sun) 62262378000, # utc_end 1974-01-06 09:00:00 (Sun) 62256301200, # local_start 1973-10-28 01:00:00 (Sun) 62262352800, # local_end 1974-01-06 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62262378000, # utc_start 1974-01-06 09:00:00 (Sun) 62287776000, # utc_end 1974-10-27 08:00:00 (Sun) 62262356400, # local_start 1974-01-06 03:00:00 (Sun) 62287754400, # local_end 1974-10-27 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62287776000, # utc_start 1974-10-27 08:00:00 (Sun) 62298061200, # utc_end 1975-02-23 09:00:00 (Sun) 62287750800, # local_start 1974-10-27 01:00:00 (Sun) 62298036000, # local_end 1975-02-23 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62298061200, # utc_start 1975-02-23 09:00:00 (Sun) 62319225600, # utc_end 1975-10-26 08:00:00 (Sun) 62298039600, # local_start 1975-02-23 03:00:00 (Sun) 62319204000, # local_end 1975-10-26 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62319225600, # utc_start 1975-10-26 08:00:00 (Sun) 62334954000, # utc_end 1976-04-25 09:00:00 (Sun) 62319200400, # local_start 1975-10-26 01:00:00 (Sun) 62334928800, # local_end 1976-04-25 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62334954000, # utc_start 1976-04-25 09:00:00 (Sun) 62351280000, # utc_end 1976-10-31 08:00:00 (Sun) 62334932400, # local_start 1976-04-25 03:00:00 (Sun) 62351258400, # local_end 1976-10-31 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62351280000, # utc_start 1976-10-31 08:00:00 (Sun) 62366403600, # utc_end 1977-04-24 09:00:00 (Sun) 62351254800, # local_start 1976-10-31 01:00:00 (Sun) 62366378400, # local_end 1977-04-24 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62366403600, # utc_start 1977-04-24 09:00:00 (Sun) 62382729600, # utc_end 1977-10-30 08:00:00 (Sun) 62366382000, # local_start 1977-04-24 03:00:00 (Sun) 62382708000, # local_end 1977-10-30 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62382729600, # utc_start 1977-10-30 08:00:00 (Sun) 62398458000, # utc_end 1978-04-30 09:00:00 (Sun) 62382704400, # local_start 1977-10-30 01:00:00 (Sun) 62398432800, # local_end 1978-04-30 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62398458000, # utc_start 1978-04-30 09:00:00 (Sun) 62414179200, # utc_end 1978-10-29 08:00:00 (Sun) 62398436400, # local_start 1978-04-30 03:00:00 (Sun) 62414157600, # local_end 1978-10-29 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62414179200, # utc_start 1978-10-29 08:00:00 (Sun) 62429907600, # utc_end 1979-04-29 09:00:00 (Sun) 62414154000, # local_start 1978-10-29 01:00:00 (Sun) 62429882400, # local_end 1979-04-29 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62429907600, # utc_start 1979-04-29 09:00:00 (Sun) 62445628800, # utc_end 1979-10-28 08:00:00 (Sun) 62429886000, # local_start 1979-04-29 03:00:00 (Sun) 62445607200, # local_end 1979-10-28 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62445628800, # utc_start 1979-10-28 08:00:00 (Sun) 62461357200, # utc_end 1980-04-27 09:00:00 (Sun) 62445603600, # local_start 1979-10-28 01:00:00 (Sun) 62461332000, # local_end 1980-04-27 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62461357200, # utc_start 1980-04-27 09:00:00 (Sun) 62477078400, # utc_end 1980-10-26 08:00:00 (Sun) 62461335600, # local_start 1980-04-27 03:00:00 (Sun) 62477056800, # local_end 1980-10-26 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62477078400, # utc_start 1980-10-26 08:00:00 (Sun) 62492806800, # utc_end 1981-04-26 09:00:00 (Sun) 62477053200, # local_start 1980-10-26 01:00:00 (Sun) 62492781600, # local_end 1981-04-26 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62492806800, # utc_start 1981-04-26 09:00:00 (Sun) 62508528000, # utc_end 1981-10-25 08:00:00 (Sun) 62492785200, # local_start 1981-04-26 03:00:00 (Sun) 62508506400, # local_end 1981-10-25 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62508528000, # utc_start 1981-10-25 08:00:00 (Sun) 62524256400, # utc_end 1982-04-25 09:00:00 (Sun) 62508502800, # local_start 1981-10-25 01:00:00 (Sun) 62524231200, # local_end 1982-04-25 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62524256400, # utc_start 1982-04-25 09:00:00 (Sun) 62540582400, # utc_end 1982-10-31 08:00:00 (Sun) 62524234800, # local_start 1982-04-25 03:00:00 (Sun) 62540560800, # local_end 1982-10-31 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62540582400, # utc_start 1982-10-31 08:00:00 (Sun) 62555706000, # utc_end 1983-04-24 09:00:00 (Sun) 62540557200, # local_start 1982-10-31 01:00:00 (Sun) 62555680800, # local_end 1983-04-24 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62555706000, # utc_start 1983-04-24 09:00:00 (Sun) 62572032000, # utc_end 1983-10-30 08:00:00 (Sun) 62555684400, # local_start 1983-04-24 03:00:00 (Sun) 62572010400, # local_end 1983-10-30 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62572032000, # utc_start 1983-10-30 08:00:00 (Sun) 62587760400, # utc_end 1984-04-29 09:00:00 (Sun) 62572006800, # local_start 1983-10-30 01:00:00 (Sun) 62587735200, # local_end 1984-04-29 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62587760400, # utc_start 1984-04-29 09:00:00 (Sun) 62603481600, # utc_end 1984-10-28 08:00:00 (Sun) 62587738800, # local_start 1984-04-29 03:00:00 (Sun) 62603460000, # local_end 1984-10-28 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62603481600, # utc_start 1984-10-28 08:00:00 (Sun) 62619210000, # utc_end 1985-04-28 09:00:00 (Sun) 62603456400, # local_start 1984-10-28 01:00:00 (Sun) 62619184800, # local_end 1985-04-28 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62619210000, # utc_start 1985-04-28 09:00:00 (Sun) 62634931200, # utc_end 1985-10-27 08:00:00 (Sun) 62619188400, # local_start 1985-04-28 03:00:00 (Sun) 62634909600, # local_end 1985-10-27 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62634931200, # utc_start 1985-10-27 08:00:00 (Sun) 62650659600, # utc_end 1986-04-27 09:00:00 (Sun) 62634906000, # local_start 1985-10-27 01:00:00 (Sun) 62650634400, # local_end 1986-04-27 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62650659600, # utc_start 1986-04-27 09:00:00 (Sun) 62666380800, # utc_end 1986-10-26 08:00:00 (Sun) 62650638000, # local_start 1986-04-27 03:00:00 (Sun) 62666359200, # local_end 1986-10-26 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62666380800, # utc_start 1986-10-26 08:00:00 (Sun) 62680294800, # utc_end 1987-04-05 09:00:00 (Sun) 62666355600, # local_start 1986-10-26 01:00:00 (Sun) 62680269600, # local_end 1987-04-05 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62680294800, # utc_start 1987-04-05 09:00:00 (Sun) 62697830400, # utc_end 1987-10-25 08:00:00 (Sun) 62680273200, # local_start 1987-04-05 03:00:00 (Sun) 62697808800, # local_end 1987-10-25 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62697830400, # utc_start 1987-10-25 08:00:00 (Sun) 62711744400, # utc_end 1988-04-03 09:00:00 (Sun) 62697805200, # local_start 1987-10-25 01:00:00 (Sun) 62711719200, # local_end 1988-04-03 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62711744400, # utc_start 1988-04-03 09:00:00 (Sun) 62729884800, # utc_end 1988-10-30 08:00:00 (Sun) 62711722800, # local_start 1988-04-03 03:00:00 (Sun) 62729863200, # local_end 1988-10-30 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62729884800, # utc_start 1988-10-30 08:00:00 (Sun) 62743194000, # utc_end 1989-04-02 09:00:00 (Sun) 62729859600, # local_start 1988-10-30 01:00:00 (Sun) 62743168800, # local_end 1989-04-02 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62743194000, # utc_start 1989-04-02 09:00:00 (Sun) 62761334400, # utc_end 1989-10-29 08:00:00 (Sun) 62743172400, # local_start 1989-04-02 03:00:00 (Sun) 62761312800, # local_end 1989-10-29 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62761334400, # utc_start 1989-10-29 08:00:00 (Sun) 62774643600, # utc_end 1990-04-01 09:00:00 (Sun) 62761309200, # local_start 1989-10-29 01:00:00 (Sun) 62774618400, # local_end 1990-04-01 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62774643600, # utc_start 1990-04-01 09:00:00 (Sun) 62792784000, # utc_end 1990-10-28 08:00:00 (Sun) 62774622000, # local_start 1990-04-01 03:00:00 (Sun) 62792762400, # local_end 1990-10-28 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62792784000, # utc_start 1990-10-28 08:00:00 (Sun) 62806698000, # utc_end 1991-04-07 09:00:00 (Sun) 62792758800, # local_start 1990-10-28 01:00:00 (Sun) 62806672800, # local_end 1991-04-07 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62806698000, # utc_start 1991-04-07 09:00:00 (Sun) 62824233600, # utc_end 1991-10-27 08:00:00 (Sun) 62806676400, # local_start 1991-04-07 03:00:00 (Sun) 62824212000, # local_end 1991-10-27 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62824233600, # utc_start 1991-10-27 08:00:00 (Sun) 62838147600, # utc_end 1992-04-05 09:00:00 (Sun) 62824208400, # local_start 1991-10-27 01:00:00 (Sun) 62838122400, # local_end 1992-04-05 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62838147600, # utc_start 1992-04-05 09:00:00 (Sun) 62855683200, # utc_end 1992-10-25 08:00:00 (Sun) 62838126000, # local_start 1992-04-05 03:00:00 (Sun) 62855661600, # local_end 1992-10-25 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62855683200, # utc_start 1992-10-25 08:00:00 (Sun) 62869597200, # utc_end 1993-04-04 09:00:00 (Sun) 62855658000, # local_start 1992-10-25 01:00:00 (Sun) 62869572000, # local_end 1993-04-04 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62869597200, # utc_start 1993-04-04 09:00:00 (Sun) 62887737600, # utc_end 1993-10-31 08:00:00 (Sun) 62869575600, # local_start 1993-04-04 03:00:00 (Sun) 62887716000, # local_end 1993-10-31 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62887737600, # utc_start 1993-10-31 08:00:00 (Sun) 62901046800, # utc_end 1994-04-03 09:00:00 (Sun) 62887712400, # local_start 1993-10-31 01:00:00 (Sun) 62901021600, # local_end 1994-04-03 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62901046800, # utc_start 1994-04-03 09:00:00 (Sun) 62919187200, # utc_end 1994-10-30 08:00:00 (Sun) 62901025200, # local_start 1994-04-03 03:00:00 (Sun) 62919165600, # local_end 1994-10-30 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62919187200, # utc_start 1994-10-30 08:00:00 (Sun) 62932496400, # utc_end 1995-04-02 09:00:00 (Sun) 62919162000, # local_start 1994-10-30 01:00:00 (Sun) 62932471200, # local_end 1995-04-02 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62932496400, # utc_start 1995-04-02 09:00:00 (Sun) 62950636800, # utc_end 1995-10-29 08:00:00 (Sun) 62932474800, # local_start 1995-04-02 03:00:00 (Sun) 62950615200, # local_end 1995-10-29 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62950636800, # utc_start 1995-10-29 08:00:00 (Sun) 62964550800, # utc_end 1996-04-07 09:00:00 (Sun) 62950611600, # local_start 1995-10-29 01:00:00 (Sun) 62964525600, # local_end 1996-04-07 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62964550800, # utc_start 1996-04-07 09:00:00 (Sun) 62982086400, # utc_end 1996-10-27 08:00:00 (Sun) 62964529200, # local_start 1996-04-07 03:00:00 (Sun) 62982064800, # local_end 1996-10-27 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 62982086400, # utc_start 1996-10-27 08:00:00 (Sun) 62996000400, # utc_end 1997-04-06 09:00:00 (Sun) 62982061200, # local_start 1996-10-27 01:00:00 (Sun) 62995975200, # local_end 1997-04-06 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62996000400, # utc_start 1997-04-06 09:00:00 (Sun) 63013536000, # utc_end 1997-10-26 08:00:00 (Sun) 62995978800, # local_start 1997-04-06 03:00:00 (Sun) 63013514400, # local_end 1997-10-26 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 63013536000, # utc_start 1997-10-26 08:00:00 (Sun) 63027450000, # utc_end 1998-04-05 09:00:00 (Sun) 63013510800, # local_start 1997-10-26 01:00:00 (Sun) 63027424800, # local_end 1998-04-05 02:00:00 (Sun) -25200, 0, 'MST', ], [ 63027450000, # utc_start 1998-04-05 09:00:00 (Sun) 63044985600, # utc_end 1998-10-25 08:00:00 (Sun) 63027428400, # local_start 1998-04-05 03:00:00 (Sun) 63044964000, # local_end 1998-10-25 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 63044985600, # utc_start 1998-10-25 08:00:00 (Sun) 63058899600, # utc_end 1999-04-04 09:00:00 (Sun) 63044960400, # local_start 1998-10-25 01:00:00 (Sun) 63058874400, # local_end 1999-04-04 02:00:00 (Sun) -25200, 0, 'MST', ], [ 63058899600, # utc_start 1999-04-04 09:00:00 (Sun) 63077040000, # utc_end 1999-10-31 08:00:00 (Sun) 63058878000, # local_start 1999-04-04 03:00:00 (Sun) 63077018400, # local_end 1999-10-31 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 63077040000, # utc_start 1999-10-31 08:00:00 (Sun) 63090349200, # utc_end 2000-04-02 09:00:00 (Sun) 63077014800, # local_start 1999-10-31 01:00:00 (Sun) 63090324000, # local_end 2000-04-02 02:00:00 (Sun) -25200, 0, 'MST', ], [ 63090349200, # utc_start 2000-04-02 09:00:00 (Sun) 63108489600, # utc_end 2000-10-29 08:00:00 (Sun) 63090327600, # local_start 2000-04-02 03:00:00 (Sun) 63108468000, # local_end 2000-10-29 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 63108489600, # utc_start 2000-10-29 08:00:00 (Sun) 63121798800, # utc_end 2001-04-01 09:00:00 (Sun) 63108464400, # local_start 2000-10-29 01:00:00 (Sun) 63121773600, # local_end 2001-04-01 02:00:00 (Sun) -25200, 0, 'MST', ], [ 63121798800, # utc_start 2001-04-01 09:00:00 (Sun) 63139939200, # utc_end 2001-10-28 08:00:00 (Sun) 63121777200, # local_start 2001-04-01 03:00:00 (Sun) 63139917600, # local_end 2001-10-28 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 63139939200, # utc_start 2001-10-28 08:00:00 (Sun) 63153853200, # utc_end 2002-04-07 09:00:00 (Sun) 63139914000, # local_start 2001-10-28 01:00:00 (Sun) 63153828000, # local_end 2002-04-07 02:00:00 (Sun) -25200, 0, 'MST', ], [ 63153853200, # utc_start 2002-04-07 09:00:00 (Sun) 63171388800, # utc_end 2002-10-27 08:00:00 (Sun) 63153831600, # local_start 2002-04-07 03:00:00 (Sun) 63171367200, # local_end 2002-10-27 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 63171388800, # utc_start 2002-10-27 08:00:00 (Sun) 63185302800, # utc_end 2003-04-06 09:00:00 (Sun) 63171363600, # local_start 2002-10-27 01:00:00 (Sun) 63185277600, # local_end 2003-04-06 02:00:00 (Sun) -25200, 0, 'MST', ], [ 63185302800, # utc_start 2003-04-06 09:00:00 (Sun) 63202838400, # utc_end 2003-10-26 08:00:00 (Sun) 63185281200, # local_start 2003-04-06 03:00:00 (Sun) 63202816800, # local_end 2003-10-26 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 63202838400, # utc_start 2003-10-26 08:00:00 (Sun) 63216748800, # utc_end 2004-04-04 08:00:00 (Sun) 63202816800, # local_start 2003-10-26 02:00:00 (Sun) 63216727200, # local_end 2004-04-04 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63216748800, # utc_start 2004-04-04 08:00:00 (Sun) 63234889200, # utc_end 2004-10-31 07:00:00 (Sun) 63216730800, # local_start 2004-04-04 03:00:00 (Sun) 63234871200, # local_end 2004-10-31 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63234889200, # utc_start 2004-10-31 07:00:00 (Sun) 63248198400, # utc_end 2005-04-03 08:00:00 (Sun) 63234867600, # local_start 2004-10-31 01:00:00 (Sun) 63248176800, # local_end 2005-04-03 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63248198400, # utc_start 2005-04-03 08:00:00 (Sun) 63266338800, # utc_end 2005-10-30 07:00:00 (Sun) 63248180400, # local_start 2005-04-03 03:00:00 (Sun) 63266320800, # local_end 2005-10-30 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63266338800, # utc_start 2005-10-30 07:00:00 (Sun) 63279648000, # utc_end 2006-04-02 08:00:00 (Sun) 63266317200, # local_start 2005-10-30 01:00:00 (Sun) 63279626400, # local_end 2006-04-02 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63279648000, # utc_start 2006-04-02 08:00:00 (Sun) 63297788400, # utc_end 2006-10-29 07:00:00 (Sun) 63279630000, # local_start 2006-04-02 03:00:00 (Sun) 63297770400, # local_end 2006-10-29 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63297788400, # utc_start 2006-10-29 07:00:00 (Sun) 63309283200, # utc_end 2007-03-11 08:00:00 (Sun) 63297766800, # local_start 2006-10-29 01:00:00 (Sun) 63309261600, # local_end 2007-03-11 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63309283200, # utc_start 2007-03-11 08:00:00 (Sun) 63329842800, # utc_end 2007-11-04 07:00:00 (Sun) 63309265200, # local_start 2007-03-11 03:00:00 (Sun) 63329824800, # local_end 2007-11-04 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63329842800, # utc_start 2007-11-04 07:00:00 (Sun) 63340732800, # utc_end 2008-03-09 08:00:00 (Sun) 63329821200, # local_start 2007-11-04 01:00:00 (Sun) 63340711200, # local_end 2008-03-09 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63340732800, # utc_start 2008-03-09 08:00:00 (Sun) 63361292400, # utc_end 2008-11-02 07:00:00 (Sun) 63340714800, # local_start 2008-03-09 03:00:00 (Sun) 63361274400, # local_end 2008-11-02 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63361292400, # utc_start 2008-11-02 07:00:00 (Sun) 63372182400, # utc_end 2009-03-08 08:00:00 (Sun) 63361270800, # local_start 2008-11-02 01:00:00 (Sun) 63372160800, # local_end 2009-03-08 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63372182400, # utc_start 2009-03-08 08:00:00 (Sun) 63392742000, # utc_end 2009-11-01 07:00:00 (Sun) 63372164400, # local_start 2009-03-08 03:00:00 (Sun) 63392724000, # local_end 2009-11-01 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63392742000, # utc_start 2009-11-01 07:00:00 (Sun) 63404236800, # utc_end 2010-03-14 08:00:00 (Sun) 63392720400, # local_start 2009-11-01 01:00:00 (Sun) 63404215200, # local_end 2010-03-14 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63404236800, # utc_start 2010-03-14 08:00:00 (Sun) 63424796400, # utc_end 2010-11-07 07:00:00 (Sun) 63404218800, # local_start 2010-03-14 03:00:00 (Sun) 63424778400, # local_end 2010-11-07 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63424796400, # utc_start 2010-11-07 07:00:00 (Sun) 63435686400, # utc_end 2011-03-13 08:00:00 (Sun) 63424774800, # local_start 2010-11-07 01:00:00 (Sun) 63435664800, # local_end 2011-03-13 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63435686400, # utc_start 2011-03-13 08:00:00 (Sun) 63456246000, # utc_end 2011-11-06 07:00:00 (Sun) 63435668400, # local_start 2011-03-13 03:00:00 (Sun) 63456228000, # local_end 2011-11-06 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63456246000, # utc_start 2011-11-06 07:00:00 (Sun) 63467136000, # utc_end 2012-03-11 08:00:00 (Sun) 63456224400, # local_start 2011-11-06 01:00:00 (Sun) 63467114400, # local_end 2012-03-11 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63467136000, # utc_start 2012-03-11 08:00:00 (Sun) 63487695600, # utc_end 2012-11-04 07:00:00 (Sun) 63467118000, # local_start 2012-03-11 03:00:00 (Sun) 63487677600, # local_end 2012-11-04 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63487695600, # utc_start 2012-11-04 07:00:00 (Sun) 63498585600, # utc_end 2013-03-10 08:00:00 (Sun) 63487674000, # local_start 2012-11-04 01:00:00 (Sun) 63498564000, # local_end 2013-03-10 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63498585600, # utc_start 2013-03-10 08:00:00 (Sun) 63519145200, # utc_end 2013-11-03 07:00:00 (Sun) 63498567600, # local_start 2013-03-10 03:00:00 (Sun) 63519127200, # local_end 2013-11-03 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63519145200, # utc_start 2013-11-03 07:00:00 (Sun) 63530035200, # utc_end 2014-03-09 08:00:00 (Sun) 63519123600, # local_start 2013-11-03 01:00:00 (Sun) 63530013600, # local_end 2014-03-09 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63530035200, # utc_start 2014-03-09 08:00:00 (Sun) 63550594800, # utc_end 2014-11-02 07:00:00 (Sun) 63530017200, # local_start 2014-03-09 03:00:00 (Sun) 63550576800, # local_end 2014-11-02 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63550594800, # utc_start 2014-11-02 07:00:00 (Sun) 63561484800, # utc_end 2015-03-08 08:00:00 (Sun) 63550573200, # local_start 2014-11-02 01:00:00 (Sun) 63561463200, # local_end 2015-03-08 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63561484800, # utc_start 2015-03-08 08:00:00 (Sun) 63582044400, # utc_end 2015-11-01 07:00:00 (Sun) 63561466800, # local_start 2015-03-08 03:00:00 (Sun) 63582026400, # local_end 2015-11-01 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63582044400, # utc_start 2015-11-01 07:00:00 (Sun) 63593539200, # utc_end 2016-03-13 08:00:00 (Sun) 63582022800, # local_start 2015-11-01 01:00:00 (Sun) 63593517600, # local_end 2016-03-13 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63593539200, # utc_start 2016-03-13 08:00:00 (Sun) 63614098800, # utc_end 2016-11-06 07:00:00 (Sun) 63593521200, # local_start 2016-03-13 03:00:00 (Sun) 63614080800, # local_end 2016-11-06 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63614098800, # utc_start 2016-11-06 07:00:00 (Sun) 63624988800, # utc_end 2017-03-12 08:00:00 (Sun) 63614077200, # local_start 2016-11-06 01:00:00 (Sun) 63624967200, # local_end 2017-03-12 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63624988800, # utc_start 2017-03-12 08:00:00 (Sun) 63645548400, # utc_end 2017-11-05 07:00:00 (Sun) 63624970800, # local_start 2017-03-12 03:00:00 (Sun) 63645530400, # local_end 2017-11-05 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63645548400, # utc_start 2017-11-05 07:00:00 (Sun) 63656438400, # utc_end 2018-03-11 08:00:00 (Sun) 63645526800, # local_start 2017-11-05 01:00:00 (Sun) 63656416800, # local_end 2018-03-11 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63656438400, # utc_start 2018-03-11 08:00:00 (Sun) 63676998000, # utc_end 2018-11-04 07:00:00 (Sun) 63656420400, # local_start 2018-03-11 03:00:00 (Sun) 63676980000, # local_end 2018-11-04 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63676998000, # utc_start 2018-11-04 07:00:00 (Sun) 63687888000, # utc_end 2019-03-10 08:00:00 (Sun) 63676976400, # local_start 2018-11-04 01:00:00 (Sun) 63687866400, # local_end 2019-03-10 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63687888000, # utc_start 2019-03-10 08:00:00 (Sun) 63708447600, # utc_end 2019-11-03 07:00:00 (Sun) 63687870000, # local_start 2019-03-10 03:00:00 (Sun) 63708429600, # local_end 2019-11-03 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63708447600, # utc_start 2019-11-03 07:00:00 (Sun) 63719337600, # utc_end 2020-03-08 08:00:00 (Sun) 63708426000, # local_start 2019-11-03 01:00:00 (Sun) 63719316000, # local_end 2020-03-08 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63719337600, # utc_start 2020-03-08 08:00:00 (Sun) 63739897200, # utc_end 2020-11-01 07:00:00 (Sun) 63719319600, # local_start 2020-03-08 03:00:00 (Sun) 63739879200, # local_end 2020-11-01 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63739897200, # utc_start 2020-11-01 07:00:00 (Sun) 63751392000, # utc_end 2021-03-14 08:00:00 (Sun) 63739875600, # local_start 2020-11-01 01:00:00 (Sun) 63751370400, # local_end 2021-03-14 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63751392000, # utc_start 2021-03-14 08:00:00 (Sun) 63771951600, # utc_end 2021-11-07 07:00:00 (Sun) 63751374000, # local_start 2021-03-14 03:00:00 (Sun) 63771933600, # local_end 2021-11-07 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63771951600, # utc_start 2021-11-07 07:00:00 (Sun) 63782841600, # utc_end 2022-03-13 08:00:00 (Sun) 63771930000, # local_start 2021-11-07 01:00:00 (Sun) 63782820000, # local_end 2022-03-13 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63782841600, # utc_start 2022-03-13 08:00:00 (Sun) 63803401200, # utc_end 2022-11-06 07:00:00 (Sun) 63782823600, # local_start 2022-03-13 03:00:00 (Sun) 63803383200, # local_end 2022-11-06 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63803401200, # utc_start 2022-11-06 07:00:00 (Sun) 63814291200, # utc_end 2023-03-12 08:00:00 (Sun) 63803379600, # local_start 2022-11-06 01:00:00 (Sun) 63814269600, # local_end 2023-03-12 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63814291200, # utc_start 2023-03-12 08:00:00 (Sun) 63834850800, # utc_end 2023-11-05 07:00:00 (Sun) 63814273200, # local_start 2023-03-12 03:00:00 (Sun) 63834832800, # local_end 2023-11-05 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63834850800, # utc_start 2023-11-05 07:00:00 (Sun) 63845740800, # utc_end 2024-03-10 08:00:00 (Sun) 63834829200, # local_start 2023-11-05 01:00:00 (Sun) 63845719200, # local_end 2024-03-10 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63845740800, # utc_start 2024-03-10 08:00:00 (Sun) 63866300400, # utc_end 2024-11-03 07:00:00 (Sun) 63845722800, # local_start 2024-03-10 03:00:00 (Sun) 63866282400, # local_end 2024-11-03 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63866300400, # utc_start 2024-11-03 07:00:00 (Sun) 63877190400, # utc_end 2025-03-09 08:00:00 (Sun) 63866278800, # local_start 2024-11-03 01:00:00 (Sun) 63877168800, # local_end 2025-03-09 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63877190400, # utc_start 2025-03-09 08:00:00 (Sun) 63897750000, # utc_end 2025-11-02 07:00:00 (Sun) 63877172400, # local_start 2025-03-09 03:00:00 (Sun) 63897732000, # local_end 2025-11-02 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63897750000, # utc_start 2025-11-02 07:00:00 (Sun) 63908640000, # utc_end 2026-03-08 08:00:00 (Sun) 63897728400, # local_start 2025-11-02 01:00:00 (Sun) 63908618400, # local_end 2026-03-08 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63908640000, # utc_start 2026-03-08 08:00:00 (Sun) 63929199600, # utc_end 2026-11-01 07:00:00 (Sun) 63908622000, # local_start 2026-03-08 03:00:00 (Sun) 63929181600, # local_end 2026-11-01 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63929199600, # utc_start 2026-11-01 07:00:00 (Sun) 63940694400, # utc_end 2027-03-14 08:00:00 (Sun) 63929178000, # local_start 2026-11-01 01:00:00 (Sun) 63940672800, # local_end 2027-03-14 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63940694400, # utc_start 2027-03-14 08:00:00 (Sun) 63961254000, # utc_end 2027-11-07 07:00:00 (Sun) 63940676400, # local_start 2027-03-14 03:00:00 (Sun) 63961236000, # local_end 2027-11-07 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63961254000, # utc_start 2027-11-07 07:00:00 (Sun) 63972144000, # utc_end 2028-03-12 08:00:00 (Sun) 63961232400, # local_start 2027-11-07 01:00:00 (Sun) 63972122400, # local_end 2028-03-12 02:00:00 (Sun) -21600, 0, 'CST', ], [ 63972144000, # utc_start 2028-03-12 08:00:00 (Sun) 63992703600, # utc_end 2028-11-05 07:00:00 (Sun) 63972126000, # local_start 2028-03-12 03:00:00 (Sun) 63992685600, # local_end 2028-11-05 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 63992703600, # utc_start 2028-11-05 07:00:00 (Sun) 64003593600, # utc_end 2029-03-11 08:00:00 (Sun) 63992682000, # local_start 2028-11-05 01:00:00 (Sun) 64003572000, # local_end 2029-03-11 02:00:00 (Sun) -21600, 0, 'CST', ], [ 64003593600, # utc_start 2029-03-11 08:00:00 (Sun) 64024153200, # utc_end 2029-11-04 07:00:00 (Sun) 64003575600, # local_start 2029-03-11 03:00:00 (Sun) 64024135200, # local_end 2029-11-04 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 64024153200, # utc_start 2029-11-04 07:00:00 (Sun) 64035043200, # utc_end 2030-03-10 08:00:00 (Sun) 64024131600, # local_start 2029-11-04 01:00:00 (Sun) 64035021600, # local_end 2030-03-10 02:00:00 (Sun) -21600, 0, 'CST', ], [ 64035043200, # utc_start 2030-03-10 08:00:00 (Sun) 64055602800, # utc_end 2030-11-03 07:00:00 (Sun) 64035025200, # local_start 2030-03-10 03:00:00 (Sun) 64055584800, # local_end 2030-11-03 02:00:00 (Sun) -18000, 1, 'CDT', ], [ 64055602800, # utc_start 2030-11-03 07:00:00 (Sun) 64066492800, # utc_end 2031-03-09 08:00:00 (Sun) 64055581200, # local_start 2030-11-03 01:00:00 (Sun) 64066471200, # local_end 2031-03-09 02:00:00 (Sun) -21600, 0, 'CST', ], [ 64066492800, # utc_start 2031-03-09 08:00:00 (Sun) 64087052400, # utc_end 2031-11-02 07:00:00 (Sun) 64066474800, # local_start 2031-03-09 03:00:00 (Sun) 64087034400, # local_end 2031-11-02 02:00:00 (Sun) -18000, 1, 'CDT', ], ]; sub olson_version {'2020a'} sub has_dst_changes {69} sub _max_year {2030} sub _new_instance { return shift->_init( @_, spans => $spans ); } sub _last_offset { -21600 } my $last_observance = bless( { 'format' => 'C%sT', 'gmtoff' => '-6:00', 'local_start_datetime' => bless( { 'formatter' => undef, 'local_rd_days' => 731514, 'local_rd_secs' => 7200, 'offset_modifier' => 0, 'rd_nanosecs' => 0, 'tz' => bless( { 'name' => 'floating', 'offset' => 0 }, 'DateTime::TimeZone::Floating' ), 'utc_rd_days' => 731514, 'utc_rd_secs' => 7200, 'utc_year' => 2004 }, 'DateTime' ), 'offset_from_std' => 0, 'offset_from_utc' => -21600, 'until' => [], 'utc_start_datetime' => bless( { 'formatter' => undef, 'local_rd_days' => 731514, 'local_rd_secs' => 28800, 'offset_modifier' => 0, 'rd_nanosecs' => 0, 'tz' => bless( { 'name' => 'floating', 'offset' => 0 }, 'DateTime::TimeZone::Floating' ), 'utc_rd_days' => 731514, 'utc_rd_secs' => 28800, 'utc_year' => 2004 }, 'DateTime' ) }, 'DateTime::TimeZone::OlsonDB::Observance' ) ; sub _last_observance { $last_observance } my $rules = [ bless( { 'at' => '2:00', 'from' => '2007', 'in' => 'Nov', 'letter' => 'S', 'name' => 'US', 'offset_from_std' => 0, 'on' => 'Sun>=1', 'save' => '0', 'to' => 'max' }, 'DateTime::TimeZone::OlsonDB::Rule' ), bless( { 'at' => '2:00', 'from' => '2007', 'in' => 'Mar', 'letter' => 'D', 'name' => 'US', 'offset_from_std' => 3600, 'on' => 'Sun>=8', 'save' => '1:00', 'to' => 'max' }, 'DateTime::TimeZone::OlsonDB::Rule' ) ] ; sub _rules { $rules } 1;
27.003704
106
0.632286
ed694402cb65be4cdce0ec73a48946b453a8ad6d
66
t
Perl
scratch/stdc/GRange.t
gitter-badger/jet-1
cc0d154e363d4178fe0831c2affb26262b8157eb
[ "MIT" ]
null
null
null
scratch/stdc/GRange.t
gitter-badger/jet-1
cc0d154e363d4178fe0831c2affb26262b8157eb
[ "MIT" ]
null
null
null
scratch/stdc/GRange.t
gitter-badger/jet-1
cc0d154e363d4178fe0831c2affb26262b8157eb
[ "MIT" ]
null
null
null
#define I 32 struct GRange(I) { uint(I) start, stop, step, pos; };
33
53
0.651515
edaa97008bf4af5c7fa204bd3c1780638705f54b
41,433
pm
Perl
lib/Environment_obj.pm
nib000/dxtoolkit
656bc9eabbc3877ccb95a2afa99f4a7bc8de89a2
[ "Apache-2.0" ]
null
null
null
lib/Environment_obj.pm
nib000/dxtoolkit
656bc9eabbc3877ccb95a2afa99f4a7bc8de89a2
[ "Apache-2.0" ]
null
null
null
lib/Environment_obj.pm
nib000/dxtoolkit
656bc9eabbc3877ccb95a2afa99f4a7bc8de89a2
[ "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 : Environment_obj.pm # Description : Delphix Engine environment object # It's include the following classes: # - Environment_obj - class which map a Delphix Engine environment API object # Author : Marcin Przepiorowski # Created : 13 Apr 2015 (v2.0.0) # # package Environment_obj; use warnings; use strict; use Data::Dumper; use JSON; use Toolkit_helpers qw (logger); use lib '../lib'; use Host_obj; # constructor # parameters # - dlpxObject - connection to DE # - debug - debug flag (debug on if defined) sub new { my $classname = shift; my $dlpxObject = shift; my $debug = shift; logger($debug, "Entering Environment_obj::constructor",1); my %environments; my %envusers; my %envlisteners; my $self = { _environments => \%environments, _envusers => \%envusers, _envlisteners => \%envlisteners, _dlpxObject => $dlpxObject, _debug => $debug }; bless($self,$classname); $self->getEnvironmentList(1); $self->listEnvironmentUsers(); $self->getEnvironmentListeners(); return $self; } # Procedure getAllEnvironments # parameters: none # Return list of environments (references) sub getAllEnvironments { my $self = shift; logger($self->{_debug}, "Entering Environment_obj::getAllEnvironments",1); my @mainenv = grep { ($self->{_environments}->{$_}->{type} ne 'OracleClusterNode') && ($self->{_environments}->{$_}->{type} ne 'WindowsClusterNode') } keys %{$self->{_environments}}; return sort ( @mainenv ); } # Procedure getEnvironment # parameters: # - reference # Return environment hash for specific environment reference sub getEnvironment { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::getEnvironment",1); my $environments = $self->{_environments}; return $environments->{$reference}; } # Procedure getEnvironmentUsers # parameters: # - reference # Return environment users for environment sub getEnvironmentUsers { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::getEnvironmentUsers",1); my $envusers = $self->{_envusers}; return $envusers->{$reference}; } # Procedure getProxy # parameters: # - reference # Return environment primary user for specific environment reference sub getProxy { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::getProxy",1); my $environments = $self->{_environments}; return $environments->{$reference}->{proxy} ? $environments->{$reference}->{proxy} : 'N/A'; } # Procedure getPrimaryUser # parameters: # - reference # Return environment primary user for specific environment reference sub getPrimaryUser { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::getPrimaryUser",1); my $environments = $self->{_environments}; my $ret; if (defined($environments->{$reference})) { $ret = $environments->{$reference}->{primaryUser}; } else { $ret = 'N/A'; } return $ret; } # Procedure getPrimaryUserName # parameters: # - reference # Return environment primary user for specific environment reference sub getPrimaryUserName { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::getPrimaryUser",1); my $environments = $self->{_environments}; #my $username = $self->{_envusers}->{name}; my $ret; if (defined($environments->{$reference}->{_primaryUserName})) { $ret = $environments->{$reference}->{_primaryUserName}; } else { $ret = 'N/A'; } return $ret; } # Procedure getEnvironmentUserAuth # parameters: # - environmet ref # - user ref # Return environment user auth for environment and user sub getEnvironmentUserAuth { my $self = shift; my $reference = shift; my $userref = shift; logger($self->{_debug}, "Entering Environment_obj::getEnvironmentUserAuth",1); my $envusers = $self->{_envusers}; my $ret; if ( defined($envusers->{$reference}) && ( defined($envusers->{$reference}->{$userref}) ) ) { my $auth = $envusers->{$reference}->{$userref}->{credential}->{type}; if ($auth eq 'PasswordCredential') { $ret = 'password'; } elsif ($auth eq 'KeyPairCredential') { $ret = 'systemkey'; } elsif ($auth eq 'KerberosCredential') { $ret = 'kerberos'; } } return $ret; } # Procedure getPrimaryUserAuth # parameters: # - reference # Return environment primary user authtype for specific environment reference sub getPrimaryUserAuth { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::getPrimaryUserAuth",1); return $self->getEnvironmentUserAuth($reference, $self->getPrimaryUser($reference)); # my $environments = $self->{_environments}; # # #my $username = $self->{_envusers}->{name}; # # my $ret = $environments->{$reference}->{_primaryUserAuth}; # if ($ret eq 'PasswordCredential') { # $ret = 'password'; # } elsif ($ret eq 'KeyPairCredential') { # $ret = 'systemkey'; # } # # return $ret; } # Procedure getEnvironmentNotPrimaryUsers # parameters: # - reference # Return environment user array without primary user sub getEnvironmentNotPrimaryUsers { my $self = shift; my $envitem = shift; logger($self->{_debug}, "Entering Environment_obj::getEnvironmentNotPrimaryUsers",1); my $primaryUser = $self->getPrimaryUser($envitem); my @users_withoutprim = grep { $_ ne $primaryUser } keys %{$self->{_envusers}->{$envitem}}; return \@users_withoutprim; } # Procedure getConfig # parameters: # - reference # Return environment metadata sub getConfig { my $self = shift; my $envitem = shift; my $host_obj = shift; my $backup = shift; logger($self->{_debug}, "Entering Environment_obj::getConfig",1); my $config = ''; my $joinsep; if (defined($backup)) { $joinsep = ' '; } else { $joinsep = ','; } my $envtype = $self->getType($envitem); my $host_ref = $self->getHost($envitem); if ($envtype eq 'rac') { my $clusenvnode = $self->getClusterNode($envitem); $host_ref = $self->getHost($clusenvnode); } my $toolkit = $host_obj->getToolkitpath($host_ref); if (!defined($toolkit)) { $toolkit = 'N/A'; } my $proxy_ref = $self->getProxy($envitem); my $proxy; if ($proxy_ref eq 'N/A') { $proxy = 'N/A'; } else { $proxy = $host_obj->getHostAddr($proxy_ref); } if ($toolkit eq 'N/A') { $config = join($joinsep,($config, "-proxy $proxy")); } else { $config = join($joinsep,($config, "-toolkitdir \"$toolkit\"")); } if ($envtype eq 'rac') { my $clusloc = $self->getClusterloc($envitem); my $clustname = $self->getClusterName($envitem); $config = join($joinsep,($config, "-clusterloc $clusloc -clustername $clustname ")); } my $asedbuser = $self->getASEUser($envitem); if ($asedbuser ne 'N/A') { $config = join($joinsep,($config, "-asedbuser $asedbuser -asedbpass xxxxxxxx")); } my $nfsaddresses = $host_obj->getHostNFS($host_ref); if ($nfsaddresses ne 'NA') { $config = join($joinsep,($config, "-nfsaddresses $nfsaddresses")); } my $rest; if ( ( $rest = $config ) =~ /^,(.*)/ ) { $config = $1; } return $config; } # Procedure getBackup # parameters: # - reference # Return environment metadata backup sub getBackup { my $self = shift; my $envitem = shift; my $host_obj = shift; my $engine = shift; my $envname = shift; my $envtype = shift; my $hostname = shift; my $user = shift; my $userauth = shift; logger($self->{_debug}, "Entering Environment_obj::getBackup",1); my $suffix = ''; if ( $^O eq 'MSWin32' ) { $suffix = '.exe'; } my $backup = "dx_create_env$suffix -d $engine -envname \"$envname\" -envtype $envtype -host $hostname -username \"$user\" -authtype $userauth -password xxxxxxxx"; $backup = $backup . $self->getConfig($envitem, $host_obj, 1); return $backup; } # Procedure getUserBackup # parameters: # - reference # Return environment metadata backup sub getUsersBackup { my $self = shift; my $envitem = shift; my $output = shift; my $engine = shift; my $backup; logger($self->{_debug}, "Entering Environment_obj::getUserBackup",1); my $suffix = ''; if ( $^O eq 'MSWin32' ) { $suffix = '.exe'; } my $name = $self->getName($envitem); my $auth; for my $useritem (@{$self->getEnvironmentNotPrimaryUsers($envitem)}) { $backup = "dx_ctl_env$suffix -d $engine -envname " . $name . " -action adduser -username \"" .$self->getEnvironmentUserNamebyRef($envitem,$useritem) . "\""; $auth = $self->getEnvironmentUserAuth($envitem,$useritem); if ($auth eq 'password') { $backup = $backup . " -authtype password -password ChangeMe"; } else { $backup = $backup . " -authtype systemkey"; } $output->addLine( $backup ); } } # Procedure getName # parameters: # - reference # Return environment name for specific environment reference sub getName { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::getName",1); my $environments = $self->{_environments}; return $environments->{$reference}->{'name'}; } # Procedure getStatus # parameters: # - reference # Return environment status for specific environment reference sub getStatus { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::getStatus",1); my $environments = $self->{_environments}; return $environments->{$reference}->{'enabled'} ? 'enabled' : 'disabled'; } # Procedure getType # parameters: # - reference # Return environment status for specific environment reference sub getType { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::getType",1); my $environments = $self->{_environments}; my $ret = $environments->{$reference}->{'type'}; if ($ret eq 'UnixHostEnvironment') { $ret = 'unix'; } elsif ($ret eq 'WindowsHostEnvironment') { $ret = 'windows'; } elsif ($ret eq 'WindowsCluster') { $ret = 'windows-cluster'; }elsif ($ret eq 'OracleCluster') { $ret = 'rac'; } return $ret; } # Procedure getClusterloc # parameters: # - reference # Return environment cluster location for specific environment reference sub getClusterloc { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::getClusterloc",1); my $environments = $self->{_environments}; my $ret; if ($environments->{$reference}->{'type'} eq 'OracleCluster') { $ret = $environments->{$reference}->{crsClusterHome}; } else { $ret = 'N/A'; } return $ret; } # Procedure getClusterName # parameters: # - reference # Return environment cluster name for specific environment reference sub getClusterName { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::getClusterName",1); my $environments = $self->{_environments}; my $ret; if ($environments->{$reference}->{'type'} eq 'OracleCluster') { $ret = $environments->{$reference}->{crsClusterName}; } else { $ret = 'N/A'; } return $ret; } # Procedure getClusterNodes # parameters: # - reference # Return all nodes from cluster sub getClusterNodes { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::getClusterNode",1); my $environments = $self->{_environments}; my $ret; if (($environments->{$reference}->{'type'} eq 'OracleCluster') || ($environments->{$reference}->{'type'} eq 'WindowsCluster')) { my @nodes = grep { defined($environments->{$_}->{cluster}) && ( $environments->{$_}->{cluster} eq $reference ) } sort (keys %{$environments} ); $ret = \@nodes; } else { $ret = 'N/A'; } return $ret; } # Procedure getClusterNode # parameters: # - reference # Return first node from cluster sub getClusterNode { my $self = shift; my $reference = shift; my $nodelist = $self->getClusterNodes($reference); if ($nodelist eq 'N/A') { return 'N/A'; } else { return $nodelist->[0]; } } # Procedure getASEUser # parameters: # - reference # Return environment ASE user sub getASEUser { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::getASEUser",1); my $environments = $self->{_environments}; my $ret; if ($environments->{$reference}->{'type'} eq 'UnixHostEnvironment') { if (defined($environments->{$reference}->{aseHostEnvironmentParameters})) { $ret = $environments->{$reference}->{aseHostEnvironmentParameters}->{dbUser}; } else { $ret = 'N/A'; } } else { $ret = 'N/A'; } return $ret; } # Procedure getHost # parameters: # - reference # Return host reference for specific environment reference sub getHost { my $self = shift; my $reference = shift; my $ret; logger($self->{_debug}, "Entering Environment_obj::getHost",1); my $environments = $self->{_environments}; if (defined($reference) && defined($environments->{$reference}) ) { if ( $environments->{$reference}->{'type'} eq 'OracleCluster') { $ret = 'CLUSTER'; } elsif ( $environments->{$reference}->{'type'} eq 'WindowsCluster' ) { $ret = 'CLUSTER'; } else { $ret = $environments->{$reference}->{'host'}; } } else { $ret = 'NA'; } return $ret; } # Procedure getEnvironmentByName # parameters: # - name - repository name # Return environment reference for environment name sub getEnvironmentByName { my $self = shift; my $name = shift; my $ret; logger($self->{_debug}, "Entering Environment_obj::getEnvironmentByName",1); for my $envitem ( sort ( keys %{$self->{_environments}} ) ) { if ( $self->getName($envitem) eq $name) { $ret = $self->getEnvironment($envitem); } } return $ret; } # Procedure getEnvironmentUserByRef # parameters: # - name - repository refrence # - user - user ref # Return environment user name for environment name and user ref sub getEnvironmentUserNamebyRef { my $self = shift; my $ref = shift; my $user = shift; my $ret; logger($self->{_debug}, "Entering Environment_obj::getEnvironmentUserByRef",1); if (defined($self->{_environments}->{$ref})) { # is this a environment refrerence my $users = $self->getEnvironmentUsers($ref); if (defined($users->{$user})) { $ret = $users->{$user}->{name}; } else { $ret = 'N/A'; } } return $ret; } # Procedure getEnvironmentUserByName # parameters: # - name - repository name or refrence # - username - user name # Return environment user reference for environment name and user name sub getEnvironmentUserByName { my $self = shift; my $name = shift; my $username = shift; my $ret; logger($self->{_debug}, "Entering Environment_obj::getEnvironmentUserByName",1); if (defined($self->{_environments}->{$name})) { # is this a environment refrerence my $users = $self->getEnvironmentUsers($name); logger($self->{_debug}, "Environment ref ". Dumper $name , 2); logger($self->{_debug}, "Environment users ". Dumper $users , 2); logger($self->{_debug}, "Looking for user ". Dumper $username , 2); my @t = grep { $users->{$_}->{name} eq $username } keys %{$users}; logger($self->{_debug}, "matching users ". Dumper \@t , 2); # if (defined($users->{$username})) { # $ret = $users->{$username}->{reference}; # } if (scalar(@t) > 1) { print "Too many users found\n"; } else { $ret = $t[-1]; } } else { for my $envitem ( sort ( keys %{$self->{_environments}} ) ) { if ( $self->getName($envitem) eq $name) { my $users = $self->getEnvironmentUsers($envitem); logger($self->{_debug}, "Environment name ". Dumper $name , 2); logger($self->{_debug}, "Environment users ". Dumper $users , 2); logger($self->{_debug}, "Looking for user ". Dumper $username , 2); my @t = grep { $users->{$_}->{name} eq $username } keys %{$users}; logger($self->{_debug}, "matching users ". Dumper \@t , 2); if (scalar(@t) > 1) { print "Too many users found\n"; } else { $ret = $t[-1]; } } } } return $ret; } # Procedure getOracleClusterNode # parameters: # - ref - environment reference # Return environment reference for environment name sub getOracleClusterNode { my $self = shift; my $ref = shift; my $ret; logger($self->{_debug}, "Entering Environment_obj::getOracleClusterNode",1); my $operation = "resources/json/delphix/environment/oracle/clusternode?cluster=" . $ref; my ($result, $result_fmt) = $self->{_dlpxObject}->getJSONResult($operation); if (defined $result->{result}) { $ret = $result->{result} } return $ret; } # Procedure getEnvironmentList # parameters: none # -primary - get primary only # Load a list of environment objects from Delphix Engine sub getEnvironmentList { my $self = shift; logger($self->{_debug}, "Entering Environment_obj::getEnvironmentList",1); my $operation = "resources/json/delphix/environment"; my ($result, $result_fmt) = $self->{_dlpxObject}->getJSONResult($operation); if (defined($result->{status}) && ($result->{status} eq 'OK')) { my @res = @{$result->{result}}; my $environments = $self->{_environments}; for my $envitem (@res) { if (defined($envitem->{namespace})) { #skip replicated env next; } $environments->{$envitem->{reference}} = $envitem; } } else { print "No data returned for $operation. Try to increase timeout \n"; } $operation = "resources/json/delphix/environment/oracle/clusternode"; ($result, $result_fmt) = $self->{_dlpxObject}->getJSONResult($operation); if (defined($result->{status}) && ($result->{status} eq 'OK')) { my @res = @{$result->{result}}; my $environments = $self->{_environments}; for my $envitem (@res) { $environments->{$envitem->{reference}} = $envitem; } } $operation = "resources/json/delphix/environment/windows/clusternode"; ($result, $result_fmt) = $self->{_dlpxObject}->getJSONResult($operation); if (defined($result->{status}) && ($result->{status} eq 'OK')) { my @res = @{$result->{result}}; my $environments = $self->{_environments}; for my $envitem (@res) { $environments->{$envitem->{reference}} = $envitem; } } } # Procedure listEnvironmentUsers # parameters: none # Load a list of users for all environment objects from Delphix Engine sub listEnvironmentUsers { my $self = shift; logger($self->{_debug}, "Entering Environment_obj::listEnvironmentUsers",1); my $operation = "resources/json/delphix/environment/user"; my ($result, $result_fmt) = $self->{_dlpxObject}->getJSONResult($operation); if (defined($result->{status}) && ($result->{status} eq 'OK')) { my @res = @{$result->{result}}; my $envusers = $self->{_envusers}; for my $envuser (@res) { if (defined($envuser->{namespace})) { next; } $envusers->{$envuser->{environment}}->{$envuser->{reference}} = $envuser; if ($self->getPrimaryUser($envuser->{environment}) eq $envuser->{reference} ) { $self->{_environments}->{$envuser->{environment}}->{_primaryUserName} = $envuser->{name}; $self->{_environments}->{$envuser->{environment}}->{_primaryUserAuth} = $envuser->{credential}->{type}; } } } else { print "No data returned for $operation. Try to increase timeout \n"; } } #procedure getEnvironmentListenerPorts #parameters: # - ref - environment #return array of listener ports sub getEnvironmentListenerPorts { my $self = shift; my $ref = shift; logger($self->{_debug}, "Entering Environment_obj::getEnvironmentListenerPorts",1); my $envlisteners = $self->{_envlisteners}; my %ports; if (defined($envlisteners->{$ref})) { for my $listenv (sort keys %{$envlisteners->{$ref}} ) { my $listarray = $envlisteners->{$ref}->{$listenv}->{endPoints}; if (defined($listarray)) { for my $list (@{$listarray}) { my $port = (split(':',$list))[1]; $ports{$port}=1; } } } } return sort keys %ports; } #procedure getListenerByName #parameters: # - env refrence # - list name #return listener refrence for name sub getListenerByName { my $self = shift; my $envref = shift; my $listname = shift; logger($self->{_debug}, "Entering Environment_obj::getListenerByName",1); my $envlisteners = $self->{_envlisteners}; my $ret; my @listref = grep { lc $envlisteners->{$envref}->{$_}->{name} eq lc $listname } keys %{$envlisteners->{$envref}}; if (scalar(@listref) eq 1) { $ret = $listref[-1]; }; return $ret; } #procedure getListenerName #parameters: # - env refrence # - list reference #return listener name for refrence sub getListenerName { my $self = shift; my $envref = shift; my $listref = shift; logger($self->{_debug}, "Entering Environment_obj::getListenerName",1); my $envlisteners = $self->{_envlisteners}; my $ret; if (defined($envlisteners->{$envref}->{$listref})) { $ret = $envlisteners->{$envref}->{$listref}->{name}; } else { $ret = 'N/A'; } return $ret; } #procedure getAllEnvironmentListenersPorts #parameters: none #return array of listener ports sub getAllEnvironmentListenersPorts { my $self = shift; logger($self->{_debug}, "Entering Environment_obj::getAllEnvironmentListenersPorts",1); my @ports; my $envlisteners = $self->{_envlisteners}; for my $env (sort keys %{$envlisteners}) { push (@ports, $self->getEnvironmentListenerPorts( $env )); } my %portshash = map { $_, 1 } @ports; return \%portshash; } # Procedure getEnvironmentListeners # parameters: none # Load a list of listeners for all environment objects from Delphix Engine sub getEnvironmentListeners { my $self = shift; logger($self->{_debug}, "Entering Environment_obj::getEnvironmentListeners",1); my $operation = "resources/json/delphix/environment/oracle/listener"; my ($result, $result_fmt) = $self->{_dlpxObject}->getJSONResult($operation); if (defined($result->{status}) && ($result->{status} eq 'OK')) { my @res = @{$result->{result}}; my $envlisteners = $self->{_envlisteners}; for my $envlist (@res) { $envlisteners->{$envlist->{environment}}->{$envlist->{reference}} = $envlist; } } else { print "No data returned for $operation. Try to increase timeout \n"; } } # Procedure runJobOperation # parameters: # - operation - API string # - json_data - JSON encoded data # Run POST command running background job for particular operation and json data # Return job number if job started or undef otherwise sub runJobOperation { my $self = shift; my $operation = shift; my $json_data = shift; my $action = shift; logger($self->{_debug}, "Entering Environment_obj::runJobOperation",1); logger($self->{_debug}, $operation, 2); my ($result, $result_fmt) = $self->{_dlpxObject}->postJSONData($operation, $json_data); my $jobno; if ( defined($result->{status}) && ($result->{status} eq 'OK' )) { if (defined($action) && $action eq 'ACTION') { $jobno = $result->{action}; } else { $jobno = $result->{job}; } } else { if (defined($result->{error})) { print "Problem with running job. Error " . Dumper $result->{error}->{details} ; logger($self->{_debug}, "Can't submit job for operation $operation",1); logger($self->{_debug}, $result->{error}->{action} ,1); logger($self->{_debug}, Dumper $result->{error}->{details} ,2); } else { print "Unknown error. Try with debug flag\n"; } } return $jobno; } # Procedure createEnv # parameters: # - type - environment type (unix/windows) # - name - envoironment name # - host - environment host # - toolkit_path - toolkit path # - username - host username # - authtype - user auth type (system key / password) # - password # - proxy # - crsname # - crsloc # - sshport # - ASE db user # - ASE db password # start create job # Return job name is sucessful or undef sub createEnv { my $self = shift; my $type = shift; my $name = shift; my $host = shift; my $toolkit_path = shift; my $username = shift; my $authtype = shift; my $password = shift; my $proxy = shift; my $crsname = shift; my $crsloc = shift; my $port = shift; my $asedbuser = shift; my $asedbpass = shift; my $nfsaddresses = shift; logger($self->{_debug}, "Entering Environment_obj::createEnv",1); my @addr; push (@addr, $host); my $operation = "resources/json/delphix/environment"; my %env = ( "primaryUser" => { "type" => "EnvironmentUser", "name" => $username } ); my %host; if (($type eq 'unix') || ($type eq 'rac')) { if (!defined($port)) { $port = 22; } %host = ( "type" => "UnixHostCreateParameters", "host" => { "type" => "UnixHost", "address" => $host, "sshPort" => $port, "toolkitPath" => $toolkit_path } ); if (defined($nfsaddresses)) { my @iplist = split(',', $nfsaddresses); $host{"host"}{"nfsAddressList"} = \@iplist; } } elsif ($type eq 'windows') { if (!defined($port)) { $port = 9100; } %host = ( "type" => "WindowsHostCreateParameters", "host" => { "type" => "WindowsHost", "connectorPort" => $port, "address" => $host } ); if (defined($toolkit_path)) { $host{"host"}{"toolkitPath"} = $toolkit_path; } if (defined($proxy)) { delete $host{"host"}{"connectorPort"}; } } if ($type eq 'unix') { $env{"type"} = "HostEnvironmentCreateParameters"; $env{"hostEnvironment"}{"type"} = "UnixHostEnvironment"; $env{"hostEnvironment"}{"name"} = $name; $env{"hostParameters"} = \%host; if (defined($asedbuser) ) { $env{"hostEnvironment"}{"aseHostEnvironmentParameters"}{"type"} = "ASEHostEnvironmentParameters"; $env{"hostEnvironment"}{"aseHostEnvironmentParameters"}{"dbUser"} = $asedbuser; $env{"hostEnvironment"}{"aseHostEnvironmentParameters"}{"credentials"}{"type"} = "PasswordCredential"; $env{"hostEnvironment"}{"aseHostEnvironmentParameters"}{"credentials"}{"password"} = $asedbpass; } } elsif ($type eq 'windows') { $env{"type"} = "HostEnvironmentCreateParameters"; $env{"hostEnvironment"}{"type"} = "WindowsHostEnvironment"; $env{"hostEnvironment"}{"name"} = $name; if (defined($proxy)) { $env{"hostEnvironment"}{"proxy"} = $proxy; } $env{"hostParameters"} = \%host; } elsif ($type eq 'rac') { $env{"type"} = "OracleClusterCreateParameters"; $env{"cluster"}{"type"} = "OracleCluster"; $env{"cluster"}{"crsClusterName"} = $crsname; $env{"cluster"}{"crsClusterHome"} = $crsloc; $env{"cluster"}{"name"} = $name; my @nodes; my %node1 = ( "type" => "OracleClusterNodeCreateParameters", "hostParameters" => \%host ); if (version->parse($self->{_dlpxObject}->getApi()) < version->parse(1.10.0)) { push (@nodes, \%node1); $env{"nodes"} = \@nodes; } else { # from 1.10.0 - we don't have array but single node $env{"node"} = \%node1; } } elsif ($type eq 'wincluster') { $env{"type"} = "WindowsClusterCreateParameters"; $env{"cluster"}{"type"} = "WindowsCluster"; $env{"cluster"}{"name"} = $name; $env{"cluster"}{"proxy"} = $proxy; $env{"cluster"}{"address"} = $host; } else { return undef; } my %cred; if ($authtype eq 'systemkey') { %cred = ( "type" => "SystemKeyCredential" ); } elsif ($authtype eq 'password') { %cred = ( "type" => "PasswordCredential", "password" => $password ); } else { return undef; } $env{"primaryUser"}{"credential"} = \%cred; my $json_data = encode_json(\%env); return $self->runJobOperation($operation, $json_data); } # Procedure delete # parameters: # - reference - environment reference # Delete environment # Return job name is sucessful or undef sub delete { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::delete",1); my $operation = "resources/json/delphix/environment/" . $reference . "/delete"; return $self->runJobOperation($operation, "{}"); } # Procedure refresh # parameters: # - reference - environment reference # start refresh job # Return job name is sucessful or undef sub refresh { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::refresh",1); my $operation = "resources/json/delphix/environment/" . $reference . "/refresh"; return $self->runJobOperation($operation, "{}"); } # Procedure disable # parameters: # - reference - environment reference # start disable job # Return 0 if OK and 1 if there was a problem sub disable { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::disable",1); my $operation = "resources/json/delphix/environment/" . $reference . "/disable"; my ($result, $result_fmt) = $self->{_dlpxObject}->postJSONData($operation, "{}"); if ( defined($result->{status}) && ($result->{status} eq 'OK' )) { return 0; } else { return 1; } } # Procedure enable # parameters: # - reference - environment reference # start enable job # Return job name is sucessful or undef sub enable { my $self = shift; my $reference = shift; logger($self->{_debug}, "Entering Environment_obj::enable",1); my $operation = "resources/json/delphix/environment/" . $reference . "/enable"; return $self->runJobOperation($operation, "{}"); } # Procedure changePassword # parameters: # - reference - user reference # - password - password # start enable job # Return job name is sucessful or undef sub changePassword { my $self = shift; my $reference = shift; my $password = shift; logger($self->{_debug}, "Entering Environment_obj::changePassword",1); my $operation = "resources/json/delphix/environment/user/" . $reference; my %pass_data = ( "type" => "EnvironmentUser", "credential" => { "type" => "PasswordCredential", "password" => $password } ); my $json_data = to_json(\%pass_data, {pretty=>1}); return $self->runJobOperation($operation, $json_data, 'ACTION'); } # Procedure changeASEPassword # parameters: # - reference - env reference # - password - password # start enable job # Return job name is sucessful or undef sub changeASEPassword { my $self = shift; my $reference = shift; my $password = shift; logger($self->{_debug}, "Entering Environment_obj::changeASEPassword",1); my $operation = "resources/json/delphix/environment/" . $reference; my %pass_data = ( "type" => "UnixHostEnvironment", "aseHostEnvironmentParameters" => { type => "ASEHostEnvironmentParameters", "credentials" => { "password" => $password, "type" => "PasswordCredential" } } ); my $json_data = to_json(\%pass_data, {pretty=>1}); return $self->runJobOperation($operation, $json_data, 'ACTION'); } # Procedure createEnvUser # parameters: # - reference - env reference # - username # - authtype # - password - password # Create environment user # Return 0 if OK sub createEnvUser { my $self = shift; my $reference = shift; my $username = shift; my $authtype = shift; my $password = shift; logger($self->{_debug}, "Entering Environment_obj::createEnvUser",1); my %cred; if ($authtype eq 'systemkey') { %cred = ( "type" => "SystemKeyCredential" ); } elsif ($authtype eq 'password') { %cred = ( "type" => "PasswordCredential", "password" => $password ); } my $operation = "resources/json/delphix/environment/user/"; my %pass_data = ( "type" => "EnvironmentUser", "credential" => \%cred, "name" => $username, "environment" => $reference ); my $json_data = to_json(\%pass_data, {pretty=>1}); logger($self->{_debug}, $json_data, 2); my ($result, $result_fmt) = $self->{_dlpxObject}->postJSONData($operation, $json_data); my $ret; if ( defined($result->{status}) && ($result->{status} eq 'OK' )) { print "User $username created \n"; $ret = 0; } else { if (defined($result->{error})) { print "Problem with user creation " . $result->{error}->{details} . "\n"; logger($self->{_debug}, $result->{error}->{action} ,1); } else { print "Unknown error. Try with debug flag\n"; } } } # Procedure deleteEnvUser # parameters: # - reference - env reference # - username - username # Delete environent user # Return 0 if OK sub deleteEnvUser { my $self = shift; my $reference = shift; my $username = shift; logger($self->{_debug}, "Entering Environment_obj::deleteEnvUser",1); my $userref = $self->getEnvironmentUserByName($reference, $username); if (!defined($userref)) { print "Username $username not found \n"; return 1; } my $operation = "resources/json/delphix/environment/user/" . $userref ."/delete"; my %del_data = ( "type" => "DeleteParameters" ); my $json_data = to_json(\%del_data, {pretty=>1}); logger($self->{_debug}, $json_data, 2); my ($result, $result_fmt) = $self->{_dlpxObject}->postJSONData($operation, $json_data); my $ret; if ( defined($result->{status}) && ($result->{status} eq 'OK' )) { print "User $username deleted \n"; $ret = 0; } else { $ret = 1; if (defined($result->{error})) { print $result->{error}->{details} . "\n"; logger($self->{_debug}, $result->{error}->{action} ,1); } else { print "Unknown error. Try with debug flag\n"; } } return $ret; } # Procedure createListener # parameters: # - reference - env reference # - listenername - name of listener # - endpoint - array of end points # Create listener # Return 0 if OK sub createListener { my $self = shift; my $reference = shift; my $listenername = shift; my $endpoint = shift; logger($self->{_debug}, "Entering Environment_obj::createListener",1); my $operation = "resources/json/delphix/environment/oracle/listener"; my $env = $self->getEnvironment($reference); if (!defined($env->{host})) { print "RAC environment is not supported now\n"; return 1; } my @badendpoint = grep { scalar(split(':',$_)) ne 2 } @{$endpoint}; if (scalar(@badendpoint)>0) { print "Endpoint definition doesn't match hostname:port \n"; return 1; } my %listener_hash = ( "type" => "OracleNodeListener", "name" => $listenername, "endPoints" => $endpoint, "environment" => $reference, "host" => $env->{host} ); my $json_data = to_json(\%listener_hash, {pretty=>1}); logger($self->{_debug}, $json_data, 2); my ($result, $result_fmt) = $self->{_dlpxObject}->postJSONData($operation, $json_data); my $ret; if ( defined($result->{status}) && ($result->{status} eq 'OK' )) { print "Listener $listenername created \n"; $ret = 0; } else { if (defined($result->{error})) { print "Problem with listener creation " . $result->{error}->{details} . "\n"; logger($self->{_debug}, $result->{error}->{action} ,1); } else { print "Unknown error. Try with debug flag\n"; } } } # Procedure deleteListener # parameters: # - reference - env reference # - listenername # Delete listener by name # Return 0 if OK sub deleteListener { my $self = shift; my $reference = shift; my $listenername = shift; logger($self->{_debug}, "Entering Environment_obj::deleteListener",1); my $listref = $self->getListenerByName($reference,$listenername); if (!defined($listref)) { print "Listener $listenername not found\n"; return 1; } my $operation = "resources/json/delphix/environment/oracle/listener/" . $listref . "/delete"; my ($result, $result_fmt) = $self->{_dlpxObject}->postJSONData($operation, '{}'); my $ret; if ( defined($result->{status}) && ($result->{status} eq 'OK' )) { print "Listener $listenername deleted \n"; $ret = 0; } else { if (defined($result->{error})) { print "Problem with listener deletion " . $result->{error}->{details} . "\n"; logger($self->{_debug}, $result->{error}->{action} ,1); } else { print "Unknown error. Try with debug flag\n"; } } } sub updatehost { my $self = shift; my $envitem = shift; my $hostip = shift; my $newhost = shift; logger($self->{_debug}, "Entering Environment_obj::updatehost",1); my $hosts = new Host_obj($self->{_dlpxObject}, $self->{_debug}); my $hostobj; my $host; if (!defined($hostip)) { $host = $self->getHost($envitem); if ($host eq 'CLUSTER') { print "Please specify which host in a cluster environment you want to change\n"; return undef; } $hostobj = $hosts->getHost($host); } else { $host = $self->getHost($envitem); my @nodestocheck; if ($host eq 'CLUSTER') { my @clusternodes = @{$self->getClusterNodes($envitem)}; @nodestocheck = map { $self->{_environments}->{$_}->{host} } @clusternodes; } else { push(@nodestocheck, $host); } logger($self->{_debug}, "Looking for IP: ". $hostip,2); my $foundhost; for my $h (@nodestocheck) { $hostobj = $hosts->getHost($h); my $ip = $hostobj->{"address"}; logger($self->{_debug}, "Checking IP: ". $ip,2); if ($hostip eq $ip) { logger($self->{_debug}, "Found IP: ". $ip,2); $foundhost = $h; last; } } if (defined($foundhost)) { # host will be set to one depend on IP matching $host = $foundhost; } else { print "Host with IP $hostip not found\n"; return undef; } } my %hostupdate = ( "type" => $hostobj->{"type"}, "address" => $newhost ); my $operation = "resources/json/delphix/host/" . $host; return $self->runJobOperation($operation, to_json(\%hostupdate)); } # Procedure getClusterHosts # parameters: # - reference # Return all host references for cluster sub getClusterHosts { my $self = shift; my $reference = shift; my @clusternodes = @{$self->getClusterNodes($reference)}; my @nodestocheck = map { $self->{_environments}->{$_}->{host} } @clusternodes; return @nodestocheck; } 1;
25.623377
186
0.597302
ed610354f9dfae126fbda54ba57d2a705c85fe83
353
pl
Perl
benchmarks/spec2k6bin/specint/perl_depends/lib/unicore/lib/gc_sc/InSuppl3.pl
YangZhou1997/DynamicCache_v2
60bc1e01e0eaf88f6c8e959cb6316e20ac910ed2
[ "BSD-3-Clause" ]
430
2015-01-05T19:21:10.000Z
2022-03-29T07:19:18.000Z
benchmarks/spec2k6bin/specint/perl_depends/lib/unicore/lib/gc_sc/InSuppl3.pl
YangZhou1997/DynamicCache_v2
60bc1e01e0eaf88f6c8e959cb6316e20ac910ed2
[ "BSD-3-Clause" ]
9
2015-01-20T17:42:30.000Z
2022-03-04T22:05:43.000Z
benchmarks/spec2k6bin/specint/perl_depends/lib/unicore/lib/gc_sc/InSuppl3.pl
YangZhou1997/DynamicCache_v2
60bc1e01e0eaf88f6c8e959cb6316e20ac910ed2
[ "BSD-3-Clause" ]
41
2015-05-10T17:08:50.000Z
2022-01-19T01:15:19.000Z
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! # This file is built by mktables from e.g. UnicodeData.txt. # Any changes made here will be lost! # # This file supports: # \p{InSupplementaryPrivateUseAreaA} (and fuzzy permutations) # # Meaning: Block 'Supplementary Private Use Area-A' # return <<'END'; F0000 FFFFF Supplementary Private Use Area-A END
25.214286
62
0.699717
edd271c3d04d5f6b37e4166f393f3ae96b646ed1
3,973
pl
Perl
L1TriggerOffline/L1Analyzer/test/runNtpMakerCAF.pl
sikler/cmssw
11ee6d8c8934607bb9b7d8a6081bc699b341fecd
[ "Apache-2.0" ]
852
2015-01-11T21:03:51.000Z
2022-03-25T21:14:00.000Z
L1TriggerOffline/L1Analyzer/test/runNtpMakerCAF.pl
sikler/cmssw
11ee6d8c8934607bb9b7d8a6081bc699b341fecd
[ "Apache-2.0" ]
30,371
2015-01-02T00:14:40.000Z
2022-03-31T23:26:05.000Z
L1TriggerOffline/L1Analyzer/test/runNtpMakerCAF.pl
sikler/cmssw
11ee6d8c8934607bb9b7d8a6081bc699b341fecd
[ "Apache-2.0" ]
3,240
2015-01-02T05:53:18.000Z
2022-03-31T17:24:21.000Z
#!/usr/bin/env perl # This scrits must be used ./runNtpMakerCAF.pl RunNumber # It looks for streamer files from run with name $GLOBAL following # the CMS conventions for the path name. #Jobs are submitted on the CAF. #------Configure here --------------------------------------- #$GLOBAL="GlobalCruzet4"; #$GLOBAL="GlobalRAFF"; $GLOBAL="Commissioning08"; $pathToFiles="Calo/RAW/v1"; #$eventSource="\"NewEventStreamFileReader\""; $eventSource="\"PoolSource\""; $nfiles= 100; #number of files processed per job $numJobs = -1; #number of jobs you want to submit (use -1 if all) $nEvents = -1; #number of events you want to run in each job (use -1 if all) $lumiMin = -1; #select based on lumi number, if all put -1 $lumiMax = 9999; #select based on lumi number, if all put a high number #------------------------------------------------------------- if(! $ARGV[0] ) {print "Usage: ./runNtpMaker.pl RunNumber\n"; exit;} $RUN = $ARGV[0]; $A = substr($RUN,0,2); $ZERO = "0"; $A = $ZERO.$A; $B = substr($RUN,2); ##look in castor and get list of files system("nsls /castor/cern.ch/cms/store/data/$GLOBAL/$pathToFiles/000/$A/$B/ > files.txt"); $count = `wc -l < files.txt`; die "wc failed: $?" if $?; chomp($count); print "-----------------------------\n"; print "Total number of file: $count\n"; print "-----------------------------\n"; #read file list open(MYFILE, "<files.txt"); $line=0; $myn=0; $job=1; # so that nothing is processed if no lumi section is found @names = (); while(<MYFILE>) { $name = $_; chomp($name); #check lumi section assuming std output naming convention $indx = index($name, '.'); $indx = index($name, '.',$indx+1); $lumi = substr($name,$indx+1,4); $lumi = $lumi+0; #needed to convert string to number if($lumi > $lumiMin && $lumi < $lumiMax) { #print "lumi is $lumi\n"; push(@names, $name); #accumulate the files for i_th-job. #print "$name"; $line++; $job = $line%$nfiles; if(eof(MYFILE)) { $job=0; #so that if there are not enough files wrt $nfiles } #it uses those. } #end lumo part if($job==0){ $total=@names; $myn=$line/$nfiles; if(eof(MYFILE) || int($myn)==0) {$myn=0;} #create i_th configuration file open CFGFILE, "> l1prompt_$RUN\_$myn\_cfg.py"; print CFGFILE "import FWCore.ParameterSet.Config as cms\n"; print CFGFILE "\n"; print CFGFILE "process = cms.Process(\"L1Prompt\")\n"; print CFGFILE "\n"; print CFGFILE "process.load(\"L1TriggerConfig.L1GeometryProducers.l1CaloGeometry_cfi\")\n"; print CFGFILE "process.load(\"L1TriggerConfig.L1GeometryProducers.l1CaloGeomRecordSource_cff\")\n"; print CFGFILE "process.load(\"L1TriggerOffline.L1Analyzer.dttfUnpack_cff\")\n"; print CFGFILE "process.load(\"L1TriggerOffline.L1Analyzer.gtUnpack_cff\")\n"; print CFGFILE "process.load(\"L1TriggerOffline.L1Analyzer.gctUnpack_cff\")\n"; print CFGFILE "process.load(\"L1TriggerOffline.L1Analyzer.L1PromptAnalysis_cfi\")\n"; print CFGFILE "process.l1PromptAnalysis.OutputFile = '$RUN\_$myn.root'\n"; print CFGFILE "\n"; print CFGFILE "process.source = cms.Source($eventSource,\n"; print CFGFILE "fileNames = cms.untracked.vstring(\n"; $ii=0; foreach $ll (@names) { $ii++; #print "$ll"; if($ii != $total){ print CFGFILE "\'/store/data/$GLOBAL/$pathToFiles/000/$A/$B/$ll\',\n"; } else { print CFGFILE "\'/store/data/$GLOBAL/$pathToFiles/000/$A/$B/$ll\'\n"; } } @names=(); print CFGFILE ")\n"; print CFGFILE ")\n"; print CFGFILE "\n"; print CFGFILE "process.maxEvents = cms.untracked.PSet(\n"; print CFGFILE " input = cms.untracked.int32($nEvents)\n"; print CFGFILE ")\n"; print CFGFILE "\n"; print CFGFILE "process.p = cms.Path(process.l1GtUnpack+process.l1GctHwDigis+process.l1GtEvmUnpack+process.l1dttfunpack+process.l1PromptAnalysis)\n"; print CFGFILE "\n"; print "bsub -J $RUN\_$myn -q cmscaf submit.ch l1prompt_$RUN\_$myn\_cfg.py $RUN\_$myn\n"; system("bsub -J $RUN\_$myn -q cmscaf submit.ch l1prompt_$RUN\_$myn\_cfg.py $RUN\_$myn\n"); if($myn==$numJobs) {exit;} } } print "End submission...\n";
30.561538
148
0.659703
edcca12be702df9e3026206cefb8e6f9065cf9e0
1,824
pm
Perl
auto-lib/Paws/SecurityHub/AwsS3BucketServerSideEncryptionRule.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/SecurityHub/AwsS3BucketServerSideEncryptionRule.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/SecurityHub/AwsS3BucketServerSideEncryptionRule.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::SecurityHub::AwsS3BucketServerSideEncryptionRule; use Moose; has ApplyServerSideEncryptionByDefault => (is => 'ro', isa => 'Paws::SecurityHub::AwsS3BucketServerSideEncryptionByDefault'); 1; ### main pod documentation begin ### =head1 NAME Paws::SecurityHub::AwsS3BucketServerSideEncryptionRule =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::SecurityHub::AwsS3BucketServerSideEncryptionRule object: $service_obj->Method(Att1 => { ApplyServerSideEncryptionByDefault => $value, ..., ApplyServerSideEncryptionByDefault => $value }); =head3 Results returned from an API call Use accessors for each attribute. If Att1 is expected to be an Paws::SecurityHub::AwsS3BucketServerSideEncryptionRule object: $result = $service_obj->Method(...); $result->Att1->ApplyServerSideEncryptionByDefault =head1 DESCRIPTION An encryption rule to apply to the S3 bucket. =head1 ATTRIBUTES =head2 ApplyServerSideEncryptionByDefault => L<Paws::SecurityHub::AwsS3BucketServerSideEncryptionByDefault> Specifies the default server-side encryption to apply to new objects in the bucket. If a C<PUT> object request doesn't specify any server-side encryption, this default encryption is applied. =head1 SEE ALSO This class forms part of L<Paws>, describing an object used in L<Paws::SecurityHub> =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
29.901639
133
0.784539
ede7efabb46cf30be7cb5513d594d1f4c3ebab96
1,182
pl
Perl
ex2.pl
KloudTrader/SWIPrologZ3
8d7ab740379f8d4c9110349128e76e31804411c4
[ "MIT" ]
13
2018-02-05T20:26:04.000Z
2021-10-15T05:55:05.000Z
ex2.pl
KloudTrader/SWIPrologZ3
8d7ab740379f8d4c9110349128e76e31804411c4
[ "MIT" ]
null
null
null
ex2.pl
KloudTrader/SWIPrologZ3
8d7ab740379f8d4c9110349128e76e31804411c4
[ "MIT" ]
1
2019-11-13T00:12:42.000Z
2019-11-13T00:12:42.000Z
/* a very simple clp interpreter over integers using the Z3 SMT solver */ :- use_module(swiplz3). :- dynamic context/1. init :- z3_mk_config, z3_set_param_value("model","true"), z3_mk_context(N), assert(context(N)), z3_mk_solver(N), z3_del_config. solve(true,C,C). solve((A,B),C,CB):- solve(A,C,CA),solve(B,CA,CB). solve(A,C,CA):- clp_clause(A,[],B), solve(B,C,CA). solve(A,C,CC):- clp_clause(A,CA,B),CA\=[], /* constraint solving using Z3 */ context(N), z3_intconstr2smtlib(N,C,CA,VarsC,Csmtlib2), (VarsC=[] -> true ; z3_mk_int_vars(N,VarsC)), z3_assert_string(N,Csmtlib2),z3_check(N), /* end */ append(C,CA,CC_), solve(B,CC_,CC). /* a concrete example */ clp_clause(list_length([],Length),[Length=0],true). clp_clause(list_length([_|Ls], Length),[Length = Length0 + 1],list_length(Ls, Length0)). /* you can test a goal using solve/1 */ solve(G) :- init, solve(G,[],C), /* producing a solution */ context(N), get_context_vars(N,VVS), get_model_var_eval(N,VVS,Values), term_variables(C,AllVars), AllVars=Values. /* try, e.g., ?- solve(list_length([1,2,3],L)). */
21.888889
88
0.619289
edae12751d7ddeb24e57282c280374395149264f
4,242
pm
Perl
network/radware/alteon/snmp/mode/memory.pm
garnier-quentin/centreon-plugins
51c16b4419d640709d3352a260e4cd63cd96db14
[ "Apache-2.0" ]
null
null
null
network/radware/alteon/snmp/mode/memory.pm
garnier-quentin/centreon-plugins
51c16b4419d640709d3352a260e4cd63cd96db14
[ "Apache-2.0" ]
null
null
null
network/radware/alteon/snmp/mode/memory.pm
garnier-quentin/centreon-plugins
51c16b4419d640709d3352a260e4cd63cd96db14
[ "Apache-2.0" ]
null
null
null
# # Copyright 2018 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 network::radware::alteon::snmp::mode::memory; use base qw(centreon::plugins::mode); use strict; use warnings; sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; $self->{version} = '1.0'; $options{options}->add_options(arguments => { "warning:s" => { name => 'warning' }, "critical:s" => { name => 'critical' }, }); return $self; } sub check_options { my ($self, %options) = @_; $self->SUPER::init(%options); if (($self->{perfdata}->threshold_validate(label => 'warning', value => $self->{option_results}->{warning})) == 0) { $self->{output}->add_option_msg(short_msg => "Wrong warning threshold '" . $self->{option_results}->{warning} . "'."); $self->{output}->option_exit(); } if (($self->{perfdata}->threshold_validate(label => 'critical', value => $self->{option_results}->{critical})) == 0) { $self->{output}->add_option_msg(short_msg => "Wrong critical threshold '" . $self->{option_results}->{critical} . "'."); $self->{output}->option_exit(); } } sub run { my ($self, %options) = @_; $self->{snmp} = $options{snmp}; my $oid_mpMemStatsTotal = '.1.3.6.1.4.1.1872.2.5.1.2.8.1.0'; my $oid_mpMemStatsFree = '.1.3.6.1.4.1.1872.2.5.1.2.8.3.0'; my $result = $self->{snmp}->get_leef(oids => [$oid_mpMemStatsTotal, $oid_mpMemStatsFree], nothing_quit => 1); my $total_size = $result->{$oid_mpMemStatsTotal}; my $memory_free = $result->{$oid_mpMemStatsFree}; my $memory_used = $total_size - $memory_free; my $prct_used = $memory_used * 100 / $total_size; my $prct_free = 100 - $prct_used; my $exit = $self->{perfdata}->threshold_check(value => $prct_used, threshold => [ { label => 'critical', exit_litteral => 'critical' }, { label => 'warning', exit_litteral => 'warning' } ]); my ($total_value, $total_unit) = $self->{perfdata}->change_bytes(value => $total_size); my ($used_value, $used_unit) = $self->{perfdata}->change_bytes(value => $memory_used); my ($free_value, $free_unit) = $self->{perfdata}->change_bytes(value => $memory_free); $self->{output}->output_add(severity => $exit, short_msg => sprintf("MP Memory Usage Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", $total_value . " " . $total_unit, $used_value . " " . $used_unit, $prct_used, $free_value . " " . $free_unit, $prct_free)); $self->{output}->perfdata_add(label => "used", unit => 'B', value => $memory_used, warning => $self->{perfdata}->get_perfdata_for_output(label => 'warning', total => $total_size), critical => $self->{perfdata}->get_perfdata_for_output(label => 'critical', total => $total_size), min => 0, max => $total_size); $self->{output}->display(); $self->{output}->exit(); } 1; __END__ =head1 MODE Check MP memory usage (ALTEON-CHEETAH-SWITCH-MIB). =over 8 =item B<--warning> Threshold warning in percent. =item B<--critical> Threshold critical in percent. =back =cut
37.210526
194
0.579208
edf6d441e42926f16d3d4ca5265c2984c1a394b6
15,795
t
Perl
js_subrequests.t
muradm/nginx-tests
ddfb68b9012a0aa6d60eb7e139830d4b3c86ff2a
[ "BSD-2-Clause" ]
null
null
null
js_subrequests.t
muradm/nginx-tests
ddfb68b9012a0aa6d60eb7e139830d4b3c86ff2a
[ "BSD-2-Clause" ]
null
null
null
js_subrequests.t
muradm/nginx-tests
ddfb68b9012a0aa6d60eb7e139830d4b3c86ff2a
[ "BSD-2-Clause" ]
null
null
null
#!/usr/bin/perl # # (C) Dmitry Volyntsev. # (C) Nginx, Inc. # Tests for subrequests in http njs module. ############################################################################### use warnings; use strict; use Test::More; use Socket qw/ CRLF /; BEGIN { use FindBin; chdir($FindBin::Bin); } use lib 'lib'; use Test::Nginx; ############################################################################### select STDERR; $| = 1; select STDOUT; $| = 1; eval { require JSON::PP; }; plan(skip_all => "JSON::PP not installed") if $@; my $t = Test::Nginx->new()->has(qw/http rewrite proxy cache/) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% daemon off; events { } http { %%TEST_GLOBALS_HTTP%% proxy_cache_path %%TESTDIR%%/cache1 keys_zone=ON:1m use_temp_path=on; js_include test.js; js_set $async_var async_var; js_set $subrequest_var subrequest_var; server { listen 127.0.0.1:8080; server_name localhost; location /njs { js_content test_njs; } location /sr { js_content sr; } location /sr_pr { js_content sr_pr; } location /sr_args { js_content sr_args; } location /sr_options_args { js_content sr_options_args; } location /sr_options_args_pr { js_content sr_options_args_pr; } location /sr_options_method { js_content sr_options_method; } location /sr_options_method_pr { js_content sr_options_method_pr; } location /sr_options_body { js_content sr_options_body; } location /sr_options_method_head { js_content sr_options_method_head; } location /sr_body { js_content sr_body; } location /sr_body_pr { js_content sr_body_pr; } location /sr_body_special { js_content sr_body_special; } location /sr_in_variable_handler { set $_ $async_var; js_content sr_in_variable_handler; } location /sr_detached_in_variable_handler { return 200 $subrequest_var; } location /sr_async_var { set $_ $async_var; error_page 404 /return; return 404; } location /sr_error_page { js_content sr_error_page; } location /sr_js_in_subrequest { js_content sr_js_in_subrequest; } location /sr_js_in_subrequest_pr { js_content sr_js_in_subrequest_pr; } location /sr_file { js_content sr_file; } location /sr_cache { js_content sr_cache; } location /sr_unavail { js_content sr_unavail; } location /sr_unavail_pr { js_content sr_unavail_pr; } location /sr_broken { js_content sr_broken; } location /sr_too_large { js_content sr_too_large; } location /sr_out_of_order { js_content sr_out_of_order; } location /sr_except_not_a_func { js_content sr_except_not_a_func; } location /sr_except_failed_to_convert_options_arg { js_content sr_except_failed_to_convert_options_arg; } location /sr_except_invalid_options_header_only { js_content sr_except_invalid_options_header_only; } location /sr_in_sr_callback { js_content sr_in_sr_callback; } location /sr_uri_except { js_content sr_uri_except; } location /file/ { alias %%TESTDIR%%/; } location /p/ { proxy_cache $arg_c; proxy_pass http://127.0.0.1:8081/; } location /daemon/ { proxy_pass http://127.0.0.1:8082/; } location /too_large/ { subrequest_output_buffer_size 3; proxy_pass http://127.0.0.1:8081/; } location /sr_in_sr { js_content sr_in_sr; } location /unavail { proxy_pass http://127.0.0.1:8084/; } location /sr_parent { js_content sr_parent; } location /js_sub { js_content js_sub; } location /return { return 200 '["$request_method"]'; } location /error_page_404 { return 404; error_page 404 /404.html; } } server { listen 127.0.0.1:8081; server_name localhost; location /sub1 { add_header H $arg_h; return 206 '{"a": {"b": 1}}'; } location /sub2 { return 404 '{"e": "msg"}'; } location /method { return 200 '["$request_method"]'; } location /body { js_content body; } location /detached { js_content detached; } location /delayed { js_content delayed; } } server { listen 127.0.0.1:8084; server_name localhost; return 444; } } EOF $t->write_file('test.js', <<EOF); this.Failed = {get toConvert() { return {toString(){return {};}}}}; function test_njs(r) { r.return(200, njs.version); } function sr(r) { subrequest_fn(r, ['/p/sub2'], ['uri', 'status']) } function sr_pr(r) { r.subrequest('/p/sub1', 'h=xxx') .then(reply => r.return(200, JSON.stringify({h:reply.headersOut.h}))) } function sr_args(r) { r.subrequest('/p/sub1', 'h=xxx', reply => { r.return(200, JSON.stringify({h:reply.headersOut.h})); }); } function sr_options_args(r) { r.subrequest('/p/sub1', {args:'h=xxx'}, reply => { r.return(200, JSON.stringify({h:reply.headersOut.h})); }); } function sr_options_args_pr(r) { r.subrequest('/p/sub1', {args:'h=xxx'}) .then(reply => r.return(200, JSON.stringify({h:reply.headersOut.h}))) } function sr_options_method(r) { r.subrequest('/p/method', {method:r.args.m}, body_fwd_cb); } function sr_options_method_pr(r) { r.subrequest('/p/method', {method:r.args.m}) .then(body_fwd_cb); } function sr_options_body(r) { r.subrequest('/p/body', {method:'POST', body:'["REQ-BODY"]'}, body_fwd_cb); } function sr_options_method_head(r) { r.subrequest('/p/method', {method:'HEAD'}, reply => { r.return(200, JSON.stringify({c:reply.status})); }); } function sr_body(r) { r.subrequest('/p/sub1', body_fwd_cb); } function sr_body_pr(r) { r.subrequest('/p/sub1') .then(body_fwd_cb); } function sr_body_special(r) { r.subrequest('/p/sub2', body_fwd_cb); } function body(r) { r.return(200, r.variables.request_body); } function delayed(r) { setTimeout(r => r.return(200), 100, r); } function detached(r) { var method = r.variables.request_method; r.log(`DETACHED: \${method} args: \${r.variables.args}`); r.return(200); } function sr_in_variable_handler(r) { } function async_var(r) { r.subrequest('/p/delayed', reply => { r.return(200, JSON.stringify(["CB-VAR"])); }); return ""; } function sr_error_page(r) { r.subrequest('/error_page_404') .then(reply => {r.return(200, `reply.status:\${reply.status}`)}); } function subrequest_var(r) { r.subrequest('/p/detached', {detached:true}); r.subrequest('/p/detached', {detached:true, args:'a=yyy', method:'POST'}); return "subrequest_var"; } function sr_file(r) { r.subrequest('/file/t', body_fwd_cb); } function sr_cache(r) { r.subrequest('/p/t', body_fwd_cb); } function sr_unavail(req) { subrequest_fn(req, ['/unavail'], ['uri', 'status']); } function sr_unavail_pr(req) { subrequest_fn_pr(req, ['/unavail'], ['uri', 'status']); } function sr_broken(r) { r.subrequest('/daemon/unfinished', reply => { r.return(200, JSON.stringify({code:reply.status})); }); } function sr_too_large(r) { r.subrequest('/too_large/t', body_fwd_cb); } function sr_in_sr(r) { r.subrequest('/sr', body_fwd_cb); } function sr_js_in_subrequest(r) { r.subrequest('/js_sub', body_fwd_cb); } function sr_js_in_subrequest_pr(r) { r.subrequest('/js_sub') .then(body_fwd_cb); } function sr_in_sr_callback(r) { r.subrequest('/return', function (reply) { try { reply.subrequest('/return'); } catch (err) { r.return(200, JSON.stringify({e:err.message})); return; } r.return(200); }); } function sr_parent(r) { try { var parent = r.parent; } catch (err) { r.return(200, JSON.stringify({e:err.message})); return; } r.return(200); } function sr_out_of_order(r) { subrequest_fn(r, ['/p/delayed', '/p/sub1', '/unknown'], ['uri', 'status']); } function collect(replies, props, total, reply) { reply.log(`subrequest handler: \${reply.uri} status: \${reply.status}`) var rep = {}; props.forEach(p => {rep[p] = reply[p]}); replies.push(rep); if (replies.length == total) { reply.parent.return(200, JSON.stringify(replies)); } } function subrequest_fn(r, subs, props) { var replies = []; subs.forEach(sr => r.subrequest(sr, collect.bind(null, replies, props, subs.length))); } function subrequest_fn_pr(r, subs, props) { var replies = []; subs.forEach(sr => r.subrequest(sr) .then(collect.bind(null, replies, props, subs.length))); } function sr_except_not_a_func(r) { r.subrequest('/sub1', 'a=1', 'b'); } function sr_except_failed_to_convert_options_arg(r) { r.subrequest('/sub1', {args:Failed.toConvert}, ()=>{}); } function sr_uri_except(r) { r.subrequest(Failed.toConvert, 'a=1', 'b'); } function body_fwd_cb(r) { r.parent.return(200, JSON.stringify(JSON.parse(r.responseBody))); } function js_sub(r) { r.return(200, '["JS-SUB"]'); } EOF $t->write_file('t', '["SEE-THIS"]'); $t->try_run('no njs available')->plan(32); $t->run_daemon(\&http_daemon); ############################################################################### is(get_json('/sr'), '[{"status":404,"uri":"/p/sub2"}]', 'sr'); is(get_json('/sr_args'), '{"h":"xxx"}', 'sr_args'); is(get_json('/sr_options_args'), '{"h":"xxx"}', 'sr_options_args'); is(get_json('/sr_options_method?m=POST'), '["POST"]', 'sr method POST'); is(get_json('/sr_options_method?m=PURGE'), '["PURGE"]', 'sr method PURGE'); is(get_json('/sr_options_body'), '["REQ-BODY"]', 'sr_options_body'); is(get_json('/sr_options_method_head'), '{"c":200}', 'sr_options_method_head'); is(get_json('/sr_body'), '{"a":{"b":1}}', 'sr_body'); is(get_json('/sr_body_special'), '{"e":"msg"}', 'sr_body_special'); is(get_json('/sr_in_variable_handler'), '["CB-VAR"]', 'sr_in_variable_handler'); $t->todo_alerts() if $t->read_file('nginx.conf') =~ /aio (on|threads)/ and !$t->has_version('1.17.9'); TODO: { local $TODO = 'header already sent' if $t->read_file('nginx.conf') =~ /aio on/ and !$t->has_version('1.17.9'); local $TODO = 'open socket left' if $t->read_file('nginx.conf') =~ /aio thread/ and !$t->has_version('1.17.9'); is(get_json('/sr_file'), '["SEE-THIS"]', 'sr_file'); } is(get_json('/sr_cache?c=1'), '["SEE-THIS"]', 'sr_cache'); is(get_json('/sr_cache?c=1'), '["SEE-THIS"]', 'sr_cached'); is(get_json('/sr_js_in_subrequest'), '["JS-SUB"]', 'sr_js_in_subrequest'); is(get_json('/sr_unavail'), '[{"status":502,"uri":"/unavail"}]', 'sr_unavail'); is(get_json('/sr_out_of_order'), '[{"status":404,"uri":"/unknown"},' . '{"status":206,"uri":"/p/sub1"},' . '{"status":200,"uri":"/p/delayed"}]', 'sr_multi'); is(get_json('/sr_pr'), '{"h":"xxx"}', 'sr_promise'); is(get_json('/sr_options_args_pr'), '{"h":"xxx"}', 'sr_options_args_pr'); is(get_json('/sr_options_method_pr?m=PUT'), '["PUT"]', 'sr method PUT'); is(get_json('/sr_body_pr'), '{"a":{"b":1}}', 'sr_body_pr'); is(get_json('/sr_js_in_subrequest_pr'), '["JS-SUB"]', 'sr_js_in_subrequest_pr'); is(get_json('/sr_unavail_pr'), '[{"status":502,"uri":"/unavail"}]', 'sr_unavail_pr'); like(http_get('/sr_detached_in_variable_handler'), qr/subrequest_var/, 'sr_detached_in_variable_handler'); TODO: { todo_skip 'leaves coredump', 1 unless $ENV{TEST_NGINX_UNSAFE} or http_get('/njs') =~ /^([.0-9]+)$/m && $1 ge '0.5.0'; like(http_get('/sr_error_page'), qr/reply\.status:404/, 'sr_error_page'); } http_get('/sr_broken'); http_get('/sr_in_sr'); http_get('/sr_in_variable_handler'); http_get('/sr_async_var'); http_get('/sr_too_large'); http_get('/sr_except_not_a_func'); http_get('/sr_except_failed_to_convert_options_arg'); http_get('/sr_uri_except'); is(get_json('/sr_in_sr_callback'), '{"e":"subrequest can only be created for the primary request"}', 'subrequest for non-primary request'); $t->stop(); ok(index($t->read_file('error.log'), 'callback is not a function') > 0, 'subrequest cb exception'); ok(index($t->read_file('error.log'), 'failed to convert uri arg') > 0, 'subrequest uri exception'); ok(index($t->read_file('error.log'), 'failed to convert options.args') > 0, 'subrequest invalid args exception'); ok(index($t->read_file('error.log'), 'too big subrequest response') > 0, 'subrequest too large body'); ok(index($t->read_file('error.log'), 'subrequest creation failed') > 0, 'subrequest creation failed'); ok(index($t->read_file('error.log'), 'js subrequest: failed to get the parent context') > 0, 'zero parent ctx'); ok(index($t->read_file('error.log'), 'DETACHED') > 0, 'detached subrequest'); ############################################################################### sub recode { my $json; eval { $json = JSON::PP::decode_json(shift) }; if ($@) { return "<failed to parse JSON>"; } JSON::PP->new()->canonical()->encode($json); } sub get_json { http_get(shift) =~ /\x0d\x0a?\x0d\x0a?(.*)/ms; recode($1); } ############################################################################### sub http_daemon { my $server = IO::Socket::INET->new( Proto => 'tcp', LocalAddr => '127.0.0.1:' . port(8082), Listen => 5, Reuse => 1 ) or die "Can't create listening socket: $!\n"; local $SIG{PIPE} = 'IGNORE'; while (my $client = $server->accept()) { $client->autoflush(1); my $headers = ''; my $uri = ''; while (<$client>) { $headers .= $_; last if (/^\x0d?\x0a?$/); } $uri = $1 if $headers =~ /^\S+\s+([^ ]+)\s+HTTP/i; if ($uri eq '/unfinished') { print $client "HTTP/1.1 200 OK" . CRLF . "Transfer-Encoding: chunked" . CRLF . "Content-Length: 100" . CRLF . CRLF . "unfinished" . CRLF; close($client); } } } ###############################################################################
24.488372
80
0.538398
edc6017d78e113c3018cac390299d38cc5e00130
3,885
t
Perl
t/node/healthcheck-passive.t
yuanfeng0905/apisix
bf44ed124d777ca64c6a5b18459f798e7b71a8a5
[ "Apache-2.0" ]
1
2020-12-01T11:36:27.000Z
2020-12-01T11:36:27.000Z
t/node/healthcheck-passive.t
yuanfeng0905/apisix
bf44ed124d777ca64c6a5b18459f798e7b71a8a5
[ "Apache-2.0" ]
1
2020-09-24T08:35:29.000Z
2020-09-24T08:35:29.000Z
t/node/healthcheck-passive.t
yuanfeng0905/apisix
bf44ed124d777ca64c6a5b18459f798e7b71a8a5
[ "Apache-2.0" ]
3
2020-08-12T17:22:23.000Z
2020-08-14T11:05:41.000Z
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You 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 t::APISIX 'no_plan'; master_on(); repeat_each(1); log_level('info'); no_root_location(); no_shuffle(); worker_connections(256); run_tests(); __DATA__ === TEST 1: set route(only passive) --- config location /t { content_by_lua_block { local t = require("lib.test_admin").test local code, body = t('/apisix/admin/routes/1', ngx.HTTP_PUT, [[{ "uri": "/server_port", "upstream": { "type": "roundrobin", "nodes": { "127.0.0.1:1980": 0, "127.0.0.1:1": 1 }, "retries": 0, "checks": { "active": { "http_path": "/status", "host": "foo.com", "healthy": { "interval": 100, "successes": 1 }, "unhealthy": { "interval": 100, "http_failures": 2 } }, "passive": { "healthy": { "http_statuses": [200, 201], "successes": 3 }, "unhealthy": { "http_statuses": [502], "http_failures": 1, "tcp_failures": 1 } } } } }]] ) if code >= 300 then ngx.status = code end ngx.say(body) } } --- request GET /t --- response_body passed === TEST 2: hit routes (two healthy nodes) --- config location /t { content_by_lua_block { ngx.sleep(1) -- wait for sync local json_sort = require("lib.json_sort") local http = require("resty.http") local uri = "http://127.0.0.1:" .. ngx.var.server_port .. "/server_port" local ports_count = {} for i = 1, 6 do local httpc = http.new() local res, err = httpc:request_uri(uri, {method = "GET", keepalive = false}) if not res then ngx.say(err) return end local status = tostring(res.status) ports_count[status] = (ports_count[status] or 0) + 1 end ngx.say(json_sort.encode(ports_count)) ngx.exit(200) } } --- request GET /t --- response_body {"200":5,"502":1} --- error_log (upstream#/apisix/routes/1) unhealthy HTTP increment (1/1)
31.844262
92
0.436036
ede794ad8d089effa2a72e9e9fb0fb7573f74c6c
33,248
pm
Perl
webapp/perl/local/lib/perl5/DateTime/TimeZone/Europe/Oslo.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/DateTime/TimeZone/Europe/Oslo.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/DateTime/TimeZone/Europe/Oslo.pm
AK-10/AK-10-isucon8-preliminary-revenge
f390710721b2f2e3d9f60120394ec37c9c96b975
[ "MIT" ]
1
2019-04-14T01:11:20.000Z
2019-04-14T01:11:20.000Z
# 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/wgHytuCyER/europe. Olson data version 2018e # # Do not edit this file directly. # package DateTime::TimeZone::Europe::Oslo; use strict; use warnings; use namespace::autoclean; our $VERSION = '2.19'; use Class::Singleton 1.03; use DateTime::TimeZone; use DateTime::TimeZone::OlsonDB; @DateTime::TimeZone::Europe::Oslo::ISA = ( 'Class::Singleton', 'DateTime::TimeZone' ); my $spans = [ [ DateTime::TimeZone::NEG_INFINITY, # utc_start 59768925420, # utc_end 1894-12-31 23:17:00 (Mon) DateTime::TimeZone::NEG_INFINITY, # local_start 59768928000, # local_end 1895-01-01 00:00:00 (Tue) 2580, 0, 'LMT', ], [ 59768925420, # utc_start 1894-12-31 23:17:00 (Mon) 60443798400, # utc_end 1916-05-22 00:00:00 (Mon) 59768929020, # local_start 1895-01-01 00:17:00 (Tue) 60443802000, # local_end 1916-05-22 01:00:00 (Mon) 3600, 0, 'CET', ], [ 60443798400, # utc_start 1916-05-22 00:00:00 (Mon) 60455109600, # utc_end 1916-09-29 22:00:00 (Fri) 60443805600, # local_start 1916-05-22 02:00:00 (Mon) 60455116800, # local_end 1916-09-30 00:00:00 (Sat) 7200, 1, 'CEST', ], [ 60455109600, # utc_start 1916-09-29 22:00:00 (Fri) 61208172000, # utc_end 1940-08-10 22:00:00 (Sat) 60455113200, # local_start 1916-09-29 23:00:00 (Fri) 61208175600, # local_end 1940-08-10 23:00:00 (Sat) 3600, 0, 'CET', ], [ 61208172000, # utc_start 1940-08-10 22:00:00 (Sat) 61278426000, # utc_end 1942-11-02 01:00:00 (Mon) 61208179200, # local_start 1940-08-11 00:00:00 (Sun) 61278433200, # local_end 1942-11-02 03:00:00 (Mon) 7200, 1, 'CEST', ], [ 61278426000, # utc_start 1942-11-02 01:00:00 (Mon) 61291126800, # utc_end 1943-03-29 01:00:00 (Mon) 61278429600, # local_start 1942-11-02 02:00:00 (Mon) 61291130400, # local_end 1943-03-29 02:00:00 (Mon) 3600, 0, 'CET', ], [ 61291126800, # utc_start 1943-03-29 01:00:00 (Mon) 61307456400, # utc_end 1943-10-04 01:00:00 (Mon) 61291134000, # local_start 1943-03-29 03:00:00 (Mon) 61307463600, # local_end 1943-10-04 03:00:00 (Mon) 7200, 1, 'CEST', ], [ 61307456400, # utc_start 1943-10-04 01:00:00 (Mon) 61323181200, # utc_end 1944-04-03 01:00:00 (Mon) 61307460000, # local_start 1943-10-04 02:00:00 (Mon) 61323184800, # local_end 1944-04-03 02:00:00 (Mon) 3600, 0, 'CET', ], [ 61323181200, # utc_start 1944-04-03 01:00:00 (Mon) 61338906000, # utc_end 1944-10-02 01:00:00 (Mon) 61323188400, # local_start 1944-04-03 03:00:00 (Mon) 61338913200, # local_end 1944-10-02 03:00:00 (Mon) 7200, 1, 'CEST', ], [ 61338906000, # utc_start 1944-10-02 01:00:00 (Mon) 61354630800, # utc_end 1945-04-02 01:00:00 (Mon) 61338909600, # local_start 1944-10-02 02:00:00 (Mon) 61354634400, # local_end 1945-04-02 02:00:00 (Mon) 3600, 0, 'CET', ], [ 61354630800, # utc_start 1945-04-02 01:00:00 (Mon) 61370355600, # utc_end 1945-10-01 01:00:00 (Mon) 61354638000, # local_start 1945-04-02 03:00:00 (Mon) 61370362800, # local_end 1945-10-01 03:00:00 (Mon) 7200, 1, 'CEST', ], [ 61370355600, # utc_start 1945-10-01 01:00:00 (Mon) 61794838800, # utc_end 1959-03-15 01:00:00 (Sun) 61370359200, # local_start 1945-10-01 02:00:00 (Mon) 61794842400, # local_end 1959-03-15 02:00:00 (Sun) 3600, 0, 'CET', ], [ 61794838800, # utc_start 1959-03-15 01:00:00 (Sun) 61811168400, # utc_end 1959-09-20 01:00:00 (Sun) 61794846000, # local_start 1959-03-15 03:00:00 (Sun) 61811175600, # local_end 1959-09-20 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 61811168400, # utc_start 1959-09-20 01:00:00 (Sun) 61826893200, # utc_end 1960-03-20 01:00:00 (Sun) 61811172000, # local_start 1959-09-20 02:00:00 (Sun) 61826896800, # local_end 1960-03-20 02:00:00 (Sun) 3600, 0, 'CET', ], [ 61826893200, # utc_start 1960-03-20 01:00:00 (Sun) 61842618000, # utc_end 1960-09-18 01:00:00 (Sun) 61826900400, # local_start 1960-03-20 03:00:00 (Sun) 61842625200, # local_end 1960-09-18 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 61842618000, # utc_start 1960-09-18 01:00:00 (Sun) 61858342800, # utc_end 1961-03-19 01:00:00 (Sun) 61842621600, # local_start 1960-09-18 02:00:00 (Sun) 61858346400, # local_end 1961-03-19 02:00:00 (Sun) 3600, 0, 'CET', ], [ 61858342800, # utc_start 1961-03-19 01:00:00 (Sun) 61874067600, # utc_end 1961-09-17 01:00:00 (Sun) 61858350000, # local_start 1961-03-19 03:00:00 (Sun) 61874074800, # local_end 1961-09-17 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 61874067600, # utc_start 1961-09-17 01:00:00 (Sun) 61889792400, # utc_end 1962-03-18 01:00:00 (Sun) 61874071200, # local_start 1961-09-17 02:00:00 (Sun) 61889796000, # local_end 1962-03-18 02:00:00 (Sun) 3600, 0, 'CET', ], [ 61889792400, # utc_start 1962-03-18 01:00:00 (Sun) 61905517200, # utc_end 1962-09-16 01:00:00 (Sun) 61889799600, # local_start 1962-03-18 03:00:00 (Sun) 61905524400, # local_end 1962-09-16 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 61905517200, # utc_start 1962-09-16 01:00:00 (Sun) 61921242000, # utc_end 1963-03-17 01:00:00 (Sun) 61905520800, # local_start 1962-09-16 02:00:00 (Sun) 61921245600, # local_end 1963-03-17 02:00:00 (Sun) 3600, 0, 'CET', ], [ 61921242000, # utc_start 1963-03-17 01:00:00 (Sun) 61936966800, # utc_end 1963-09-15 01:00:00 (Sun) 61921249200, # local_start 1963-03-17 03:00:00 (Sun) 61936974000, # local_end 1963-09-15 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 61936966800, # utc_start 1963-09-15 01:00:00 (Sun) 61952691600, # utc_end 1964-03-15 01:00:00 (Sun) 61936970400, # local_start 1963-09-15 02:00:00 (Sun) 61952695200, # local_end 1964-03-15 02:00:00 (Sun) 3600, 0, 'CET', ], [ 61952691600, # utc_start 1964-03-15 01:00:00 (Sun) 61969021200, # utc_end 1964-09-20 01:00:00 (Sun) 61952698800, # local_start 1964-03-15 03:00:00 (Sun) 61969028400, # local_end 1964-09-20 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 61969021200, # utc_start 1964-09-20 01:00:00 (Sun) 61987770000, # utc_end 1965-04-25 01:00:00 (Sun) 61969024800, # local_start 1964-09-20 02:00:00 (Sun) 61987773600, # local_end 1965-04-25 02:00:00 (Sun) 3600, 0, 'CET', ], [ 61987770000, # utc_start 1965-04-25 01:00:00 (Sun) 62000470800, # utc_end 1965-09-19 01:00:00 (Sun) 61987777200, # local_start 1965-04-25 03:00:00 (Sun) 62000478000, # local_end 1965-09-19 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62000470800, # utc_start 1965-09-19 01:00:00 (Sun) 62451212400, # utc_end 1979-12-31 23:00:00 (Mon) 62000474400, # local_start 1965-09-19 02:00:00 (Sun) 62451216000, # local_end 1980-01-01 00:00:00 (Tue) 3600, 0, 'CET', ], [ 62451212400, # utc_start 1979-12-31 23:00:00 (Mon) 62459514000, # utc_end 1980-04-06 01:00:00 (Sun) 62451216000, # local_start 1980-01-01 00:00:00 (Tue) 62459517600, # local_end 1980-04-06 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62459514000, # utc_start 1980-04-06 01:00:00 (Sun) 62474634000, # utc_end 1980-09-28 01:00:00 (Sun) 62459521200, # local_start 1980-04-06 03:00:00 (Sun) 62474641200, # local_end 1980-09-28 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62474634000, # utc_start 1980-09-28 01:00:00 (Sun) 62490358800, # utc_end 1981-03-29 01:00:00 (Sun) 62474637600, # local_start 1980-09-28 02:00:00 (Sun) 62490362400, # local_end 1981-03-29 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62490358800, # utc_start 1981-03-29 01:00:00 (Sun) 62506083600, # utc_end 1981-09-27 01:00:00 (Sun) 62490366000, # local_start 1981-03-29 03:00:00 (Sun) 62506090800, # local_end 1981-09-27 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62506083600, # utc_start 1981-09-27 01:00:00 (Sun) 62521808400, # utc_end 1982-03-28 01:00:00 (Sun) 62506087200, # local_start 1981-09-27 02:00:00 (Sun) 62521812000, # local_end 1982-03-28 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62521808400, # utc_start 1982-03-28 01:00:00 (Sun) 62537533200, # utc_end 1982-09-26 01:00:00 (Sun) 62521815600, # local_start 1982-03-28 03:00:00 (Sun) 62537540400, # local_end 1982-09-26 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62537533200, # utc_start 1982-09-26 01:00:00 (Sun) 62553258000, # utc_end 1983-03-27 01:00:00 (Sun) 62537536800, # local_start 1982-09-26 02:00:00 (Sun) 62553261600, # local_end 1983-03-27 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62553258000, # utc_start 1983-03-27 01:00:00 (Sun) 62568982800, # utc_end 1983-09-25 01:00:00 (Sun) 62553265200, # local_start 1983-03-27 03:00:00 (Sun) 62568990000, # local_end 1983-09-25 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62568982800, # utc_start 1983-09-25 01:00:00 (Sun) 62584707600, # utc_end 1984-03-25 01:00:00 (Sun) 62568986400, # local_start 1983-09-25 02:00:00 (Sun) 62584711200, # local_end 1984-03-25 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62584707600, # utc_start 1984-03-25 01:00:00 (Sun) 62601037200, # utc_end 1984-09-30 01:00:00 (Sun) 62584714800, # local_start 1984-03-25 03:00:00 (Sun) 62601044400, # local_end 1984-09-30 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62601037200, # utc_start 1984-09-30 01:00:00 (Sun) 62616762000, # utc_end 1985-03-31 01:00:00 (Sun) 62601040800, # local_start 1984-09-30 02:00:00 (Sun) 62616765600, # local_end 1985-03-31 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62616762000, # utc_start 1985-03-31 01:00:00 (Sun) 62632486800, # utc_end 1985-09-29 01:00:00 (Sun) 62616769200, # local_start 1985-03-31 03:00:00 (Sun) 62632494000, # local_end 1985-09-29 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62632486800, # utc_start 1985-09-29 01:00:00 (Sun) 62648211600, # utc_end 1986-03-30 01:00:00 (Sun) 62632490400, # local_start 1985-09-29 02:00:00 (Sun) 62648215200, # local_end 1986-03-30 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62648211600, # utc_start 1986-03-30 01:00:00 (Sun) 62663936400, # utc_end 1986-09-28 01:00:00 (Sun) 62648218800, # local_start 1986-03-30 03:00:00 (Sun) 62663943600, # local_end 1986-09-28 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62663936400, # utc_start 1986-09-28 01:00:00 (Sun) 62679661200, # utc_end 1987-03-29 01:00:00 (Sun) 62663940000, # local_start 1986-09-28 02:00:00 (Sun) 62679664800, # local_end 1987-03-29 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62679661200, # utc_start 1987-03-29 01:00:00 (Sun) 62695386000, # utc_end 1987-09-27 01:00:00 (Sun) 62679668400, # local_start 1987-03-29 03:00:00 (Sun) 62695393200, # local_end 1987-09-27 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62695386000, # utc_start 1987-09-27 01:00:00 (Sun) 62711110800, # utc_end 1988-03-27 01:00:00 (Sun) 62695389600, # local_start 1987-09-27 02:00:00 (Sun) 62711114400, # local_end 1988-03-27 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62711110800, # utc_start 1988-03-27 01:00:00 (Sun) 62726835600, # utc_end 1988-09-25 01:00:00 (Sun) 62711118000, # local_start 1988-03-27 03:00:00 (Sun) 62726842800, # local_end 1988-09-25 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62726835600, # utc_start 1988-09-25 01:00:00 (Sun) 62742560400, # utc_end 1989-03-26 01:00:00 (Sun) 62726839200, # local_start 1988-09-25 02:00:00 (Sun) 62742564000, # local_end 1989-03-26 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62742560400, # utc_start 1989-03-26 01:00:00 (Sun) 62758285200, # utc_end 1989-09-24 01:00:00 (Sun) 62742567600, # local_start 1989-03-26 03:00:00 (Sun) 62758292400, # local_end 1989-09-24 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62758285200, # utc_start 1989-09-24 01:00:00 (Sun) 62774010000, # utc_end 1990-03-25 01:00:00 (Sun) 62758288800, # local_start 1989-09-24 02:00:00 (Sun) 62774013600, # local_end 1990-03-25 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62774010000, # utc_start 1990-03-25 01:00:00 (Sun) 62790339600, # utc_end 1990-09-30 01:00:00 (Sun) 62774017200, # local_start 1990-03-25 03:00:00 (Sun) 62790346800, # local_end 1990-09-30 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62790339600, # utc_start 1990-09-30 01:00:00 (Sun) 62806064400, # utc_end 1991-03-31 01:00:00 (Sun) 62790343200, # local_start 1990-09-30 02:00:00 (Sun) 62806068000, # local_end 1991-03-31 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62806064400, # utc_start 1991-03-31 01:00:00 (Sun) 62821789200, # utc_end 1991-09-29 01:00:00 (Sun) 62806071600, # local_start 1991-03-31 03:00:00 (Sun) 62821796400, # local_end 1991-09-29 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62821789200, # utc_start 1991-09-29 01:00:00 (Sun) 62837514000, # utc_end 1992-03-29 01:00:00 (Sun) 62821792800, # local_start 1991-09-29 02:00:00 (Sun) 62837517600, # local_end 1992-03-29 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62837514000, # utc_start 1992-03-29 01:00:00 (Sun) 62853238800, # utc_end 1992-09-27 01:00:00 (Sun) 62837521200, # local_start 1992-03-29 03:00:00 (Sun) 62853246000, # local_end 1992-09-27 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62853238800, # utc_start 1992-09-27 01:00:00 (Sun) 62868963600, # utc_end 1993-03-28 01:00:00 (Sun) 62853242400, # local_start 1992-09-27 02:00:00 (Sun) 62868967200, # local_end 1993-03-28 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62868963600, # utc_start 1993-03-28 01:00:00 (Sun) 62884688400, # utc_end 1993-09-26 01:00:00 (Sun) 62868970800, # local_start 1993-03-28 03:00:00 (Sun) 62884695600, # local_end 1993-09-26 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62884688400, # utc_start 1993-09-26 01:00:00 (Sun) 62900413200, # utc_end 1994-03-27 01:00:00 (Sun) 62884692000, # local_start 1993-09-26 02:00:00 (Sun) 62900416800, # local_end 1994-03-27 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62900413200, # utc_start 1994-03-27 01:00:00 (Sun) 62916138000, # utc_end 1994-09-25 01:00:00 (Sun) 62900420400, # local_start 1994-03-27 03:00:00 (Sun) 62916145200, # local_end 1994-09-25 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62916138000, # utc_start 1994-09-25 01:00:00 (Sun) 62931862800, # utc_end 1995-03-26 01:00:00 (Sun) 62916141600, # local_start 1994-09-25 02:00:00 (Sun) 62931866400, # local_end 1995-03-26 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62931862800, # utc_start 1995-03-26 01:00:00 (Sun) 62947587600, # utc_end 1995-09-24 01:00:00 (Sun) 62931870000, # local_start 1995-03-26 03:00:00 (Sun) 62947594800, # local_end 1995-09-24 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62947587600, # utc_start 1995-09-24 01:00:00 (Sun) 62963917200, # utc_end 1996-03-31 01:00:00 (Sun) 62947591200, # local_start 1995-09-24 02:00:00 (Sun) 62963920800, # local_end 1996-03-31 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62963917200, # utc_start 1996-03-31 01:00:00 (Sun) 62982061200, # utc_end 1996-10-27 01:00:00 (Sun) 62963924400, # local_start 1996-03-31 03:00:00 (Sun) 62982068400, # local_end 1996-10-27 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 62982061200, # utc_start 1996-10-27 01:00:00 (Sun) 62995366800, # utc_end 1997-03-30 01:00:00 (Sun) 62982064800, # local_start 1996-10-27 02:00:00 (Sun) 62995370400, # local_end 1997-03-30 02:00:00 (Sun) 3600, 0, 'CET', ], [ 62995366800, # utc_start 1997-03-30 01:00:00 (Sun) 63013510800, # utc_end 1997-10-26 01:00:00 (Sun) 62995374000, # local_start 1997-03-30 03:00:00 (Sun) 63013518000, # local_end 1997-10-26 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63013510800, # utc_start 1997-10-26 01:00:00 (Sun) 63026816400, # utc_end 1998-03-29 01:00:00 (Sun) 63013514400, # local_start 1997-10-26 02:00:00 (Sun) 63026820000, # local_end 1998-03-29 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63026816400, # utc_start 1998-03-29 01:00:00 (Sun) 63044960400, # utc_end 1998-10-25 01:00:00 (Sun) 63026823600, # local_start 1998-03-29 03:00:00 (Sun) 63044967600, # local_end 1998-10-25 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63044960400, # utc_start 1998-10-25 01:00:00 (Sun) 63058266000, # utc_end 1999-03-28 01:00:00 (Sun) 63044964000, # local_start 1998-10-25 02:00:00 (Sun) 63058269600, # local_end 1999-03-28 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63058266000, # utc_start 1999-03-28 01:00:00 (Sun) 63077014800, # utc_end 1999-10-31 01:00:00 (Sun) 63058273200, # local_start 1999-03-28 03:00:00 (Sun) 63077022000, # local_end 1999-10-31 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63077014800, # utc_start 1999-10-31 01:00:00 (Sun) 63089715600, # utc_end 2000-03-26 01:00:00 (Sun) 63077018400, # local_start 1999-10-31 02:00:00 (Sun) 63089719200, # local_end 2000-03-26 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63089715600, # utc_start 2000-03-26 01:00:00 (Sun) 63108464400, # utc_end 2000-10-29 01:00:00 (Sun) 63089722800, # local_start 2000-03-26 03:00:00 (Sun) 63108471600, # local_end 2000-10-29 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63108464400, # utc_start 2000-10-29 01:00:00 (Sun) 63121165200, # utc_end 2001-03-25 01:00:00 (Sun) 63108468000, # local_start 2000-10-29 02:00:00 (Sun) 63121168800, # local_end 2001-03-25 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63121165200, # utc_start 2001-03-25 01:00:00 (Sun) 63139914000, # utc_end 2001-10-28 01:00:00 (Sun) 63121172400, # local_start 2001-03-25 03:00:00 (Sun) 63139921200, # local_end 2001-10-28 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63139914000, # utc_start 2001-10-28 01:00:00 (Sun) 63153219600, # utc_end 2002-03-31 01:00:00 (Sun) 63139917600, # local_start 2001-10-28 02:00:00 (Sun) 63153223200, # local_end 2002-03-31 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63153219600, # utc_start 2002-03-31 01:00:00 (Sun) 63171363600, # utc_end 2002-10-27 01:00:00 (Sun) 63153226800, # local_start 2002-03-31 03:00:00 (Sun) 63171370800, # local_end 2002-10-27 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63171363600, # utc_start 2002-10-27 01:00:00 (Sun) 63184669200, # utc_end 2003-03-30 01:00:00 (Sun) 63171367200, # local_start 2002-10-27 02:00:00 (Sun) 63184672800, # local_end 2003-03-30 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63184669200, # utc_start 2003-03-30 01:00:00 (Sun) 63202813200, # utc_end 2003-10-26 01:00:00 (Sun) 63184676400, # local_start 2003-03-30 03:00:00 (Sun) 63202820400, # local_end 2003-10-26 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63202813200, # utc_start 2003-10-26 01:00:00 (Sun) 63216118800, # utc_end 2004-03-28 01:00:00 (Sun) 63202816800, # local_start 2003-10-26 02:00:00 (Sun) 63216122400, # local_end 2004-03-28 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63216118800, # utc_start 2004-03-28 01:00:00 (Sun) 63234867600, # utc_end 2004-10-31 01:00:00 (Sun) 63216126000, # local_start 2004-03-28 03:00:00 (Sun) 63234874800, # local_end 2004-10-31 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63234867600, # utc_start 2004-10-31 01:00:00 (Sun) 63247568400, # utc_end 2005-03-27 01:00:00 (Sun) 63234871200, # local_start 2004-10-31 02:00:00 (Sun) 63247572000, # local_end 2005-03-27 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63247568400, # utc_start 2005-03-27 01:00:00 (Sun) 63266317200, # utc_end 2005-10-30 01:00:00 (Sun) 63247575600, # local_start 2005-03-27 03:00:00 (Sun) 63266324400, # local_end 2005-10-30 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63266317200, # utc_start 2005-10-30 01:00:00 (Sun) 63279018000, # utc_end 2006-03-26 01:00:00 (Sun) 63266320800, # local_start 2005-10-30 02:00:00 (Sun) 63279021600, # local_end 2006-03-26 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63279018000, # utc_start 2006-03-26 01:00:00 (Sun) 63297766800, # utc_end 2006-10-29 01:00:00 (Sun) 63279025200, # local_start 2006-03-26 03:00:00 (Sun) 63297774000, # local_end 2006-10-29 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63297766800, # utc_start 2006-10-29 01:00:00 (Sun) 63310467600, # utc_end 2007-03-25 01:00:00 (Sun) 63297770400, # local_start 2006-10-29 02:00:00 (Sun) 63310471200, # local_end 2007-03-25 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63310467600, # utc_start 2007-03-25 01:00:00 (Sun) 63329216400, # utc_end 2007-10-28 01:00:00 (Sun) 63310474800, # local_start 2007-03-25 03:00:00 (Sun) 63329223600, # local_end 2007-10-28 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63329216400, # utc_start 2007-10-28 01:00:00 (Sun) 63342522000, # utc_end 2008-03-30 01:00:00 (Sun) 63329220000, # local_start 2007-10-28 02:00:00 (Sun) 63342525600, # local_end 2008-03-30 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63342522000, # utc_start 2008-03-30 01:00:00 (Sun) 63360666000, # utc_end 2008-10-26 01:00:00 (Sun) 63342529200, # local_start 2008-03-30 03:00:00 (Sun) 63360673200, # local_end 2008-10-26 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63360666000, # utc_start 2008-10-26 01:00:00 (Sun) 63373971600, # utc_end 2009-03-29 01:00:00 (Sun) 63360669600, # local_start 2008-10-26 02:00:00 (Sun) 63373975200, # local_end 2009-03-29 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63373971600, # utc_start 2009-03-29 01:00:00 (Sun) 63392115600, # utc_end 2009-10-25 01:00:00 (Sun) 63373978800, # local_start 2009-03-29 03:00:00 (Sun) 63392122800, # local_end 2009-10-25 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63392115600, # utc_start 2009-10-25 01:00:00 (Sun) 63405421200, # utc_end 2010-03-28 01:00:00 (Sun) 63392119200, # local_start 2009-10-25 02:00:00 (Sun) 63405424800, # local_end 2010-03-28 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63405421200, # utc_start 2010-03-28 01:00:00 (Sun) 63424170000, # utc_end 2010-10-31 01:00:00 (Sun) 63405428400, # local_start 2010-03-28 03:00:00 (Sun) 63424177200, # local_end 2010-10-31 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63424170000, # utc_start 2010-10-31 01:00:00 (Sun) 63436870800, # utc_end 2011-03-27 01:00:00 (Sun) 63424173600, # local_start 2010-10-31 02:00:00 (Sun) 63436874400, # local_end 2011-03-27 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63436870800, # utc_start 2011-03-27 01:00:00 (Sun) 63455619600, # utc_end 2011-10-30 01:00:00 (Sun) 63436878000, # local_start 2011-03-27 03:00:00 (Sun) 63455626800, # local_end 2011-10-30 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63455619600, # utc_start 2011-10-30 01:00:00 (Sun) 63468320400, # utc_end 2012-03-25 01:00:00 (Sun) 63455623200, # local_start 2011-10-30 02:00:00 (Sun) 63468324000, # local_end 2012-03-25 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63468320400, # utc_start 2012-03-25 01:00:00 (Sun) 63487069200, # utc_end 2012-10-28 01:00:00 (Sun) 63468327600, # local_start 2012-03-25 03:00:00 (Sun) 63487076400, # local_end 2012-10-28 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63487069200, # utc_start 2012-10-28 01:00:00 (Sun) 63500374800, # utc_end 2013-03-31 01:00:00 (Sun) 63487072800, # local_start 2012-10-28 02:00:00 (Sun) 63500378400, # local_end 2013-03-31 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63500374800, # utc_start 2013-03-31 01:00:00 (Sun) 63518518800, # utc_end 2013-10-27 01:00:00 (Sun) 63500382000, # local_start 2013-03-31 03:00:00 (Sun) 63518526000, # local_end 2013-10-27 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63518518800, # utc_start 2013-10-27 01:00:00 (Sun) 63531824400, # utc_end 2014-03-30 01:00:00 (Sun) 63518522400, # local_start 2013-10-27 02:00:00 (Sun) 63531828000, # local_end 2014-03-30 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63531824400, # utc_start 2014-03-30 01:00:00 (Sun) 63549968400, # utc_end 2014-10-26 01:00:00 (Sun) 63531831600, # local_start 2014-03-30 03:00:00 (Sun) 63549975600, # local_end 2014-10-26 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63549968400, # utc_start 2014-10-26 01:00:00 (Sun) 63563274000, # utc_end 2015-03-29 01:00:00 (Sun) 63549972000, # local_start 2014-10-26 02:00:00 (Sun) 63563277600, # local_end 2015-03-29 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63563274000, # utc_start 2015-03-29 01:00:00 (Sun) 63581418000, # utc_end 2015-10-25 01:00:00 (Sun) 63563281200, # local_start 2015-03-29 03:00:00 (Sun) 63581425200, # local_end 2015-10-25 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63581418000, # utc_start 2015-10-25 01:00:00 (Sun) 63594723600, # utc_end 2016-03-27 01:00:00 (Sun) 63581421600, # local_start 2015-10-25 02:00:00 (Sun) 63594727200, # local_end 2016-03-27 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63594723600, # utc_start 2016-03-27 01:00:00 (Sun) 63613472400, # utc_end 2016-10-30 01:00:00 (Sun) 63594730800, # local_start 2016-03-27 03:00:00 (Sun) 63613479600, # local_end 2016-10-30 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63613472400, # utc_start 2016-10-30 01:00:00 (Sun) 63626173200, # utc_end 2017-03-26 01:00:00 (Sun) 63613476000, # local_start 2016-10-30 02:00:00 (Sun) 63626176800, # local_end 2017-03-26 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63626173200, # utc_start 2017-03-26 01:00:00 (Sun) 63644922000, # utc_end 2017-10-29 01:00:00 (Sun) 63626180400, # local_start 2017-03-26 03:00:00 (Sun) 63644929200, # local_end 2017-10-29 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63644922000, # utc_start 2017-10-29 01:00:00 (Sun) 63657622800, # utc_end 2018-03-25 01:00:00 (Sun) 63644925600, # local_start 2017-10-29 02:00:00 (Sun) 63657626400, # local_end 2018-03-25 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63657622800, # utc_start 2018-03-25 01:00:00 (Sun) 63676371600, # utc_end 2018-10-28 01:00:00 (Sun) 63657630000, # local_start 2018-03-25 03:00:00 (Sun) 63676378800, # local_end 2018-10-28 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63676371600, # utc_start 2018-10-28 01:00:00 (Sun) 63689677200, # utc_end 2019-03-31 01:00:00 (Sun) 63676375200, # local_start 2018-10-28 02:00:00 (Sun) 63689680800, # local_end 2019-03-31 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63689677200, # utc_start 2019-03-31 01:00:00 (Sun) 63707821200, # utc_end 2019-10-27 01:00:00 (Sun) 63689684400, # local_start 2019-03-31 03:00:00 (Sun) 63707828400, # local_end 2019-10-27 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63707821200, # utc_start 2019-10-27 01:00:00 (Sun) 63721126800, # utc_end 2020-03-29 01:00:00 (Sun) 63707824800, # local_start 2019-10-27 02:00:00 (Sun) 63721130400, # local_end 2020-03-29 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63721126800, # utc_start 2020-03-29 01:00:00 (Sun) 63739270800, # utc_end 2020-10-25 01:00:00 (Sun) 63721134000, # local_start 2020-03-29 03:00:00 (Sun) 63739278000, # local_end 2020-10-25 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63739270800, # utc_start 2020-10-25 01:00:00 (Sun) 63752576400, # utc_end 2021-03-28 01:00:00 (Sun) 63739274400, # local_start 2020-10-25 02:00:00 (Sun) 63752580000, # local_end 2021-03-28 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63752576400, # utc_start 2021-03-28 01:00:00 (Sun) 63771325200, # utc_end 2021-10-31 01:00:00 (Sun) 63752583600, # local_start 2021-03-28 03:00:00 (Sun) 63771332400, # local_end 2021-10-31 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63771325200, # utc_start 2021-10-31 01:00:00 (Sun) 63784026000, # utc_end 2022-03-27 01:00:00 (Sun) 63771328800, # local_start 2021-10-31 02:00:00 (Sun) 63784029600, # local_end 2022-03-27 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63784026000, # utc_start 2022-03-27 01:00:00 (Sun) 63802774800, # utc_end 2022-10-30 01:00:00 (Sun) 63784033200, # local_start 2022-03-27 03:00:00 (Sun) 63802782000, # local_end 2022-10-30 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63802774800, # utc_start 2022-10-30 01:00:00 (Sun) 63815475600, # utc_end 2023-03-26 01:00:00 (Sun) 63802778400, # local_start 2022-10-30 02:00:00 (Sun) 63815479200, # local_end 2023-03-26 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63815475600, # utc_start 2023-03-26 01:00:00 (Sun) 63834224400, # utc_end 2023-10-29 01:00:00 (Sun) 63815482800, # local_start 2023-03-26 03:00:00 (Sun) 63834231600, # local_end 2023-10-29 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63834224400, # utc_start 2023-10-29 01:00:00 (Sun) 63847530000, # utc_end 2024-03-31 01:00:00 (Sun) 63834228000, # local_start 2023-10-29 02:00:00 (Sun) 63847533600, # local_end 2024-03-31 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63847530000, # utc_start 2024-03-31 01:00:00 (Sun) 63865674000, # utc_end 2024-10-27 01:00:00 (Sun) 63847537200, # local_start 2024-03-31 03:00:00 (Sun) 63865681200, # local_end 2024-10-27 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63865674000, # utc_start 2024-10-27 01:00:00 (Sun) 63878979600, # utc_end 2025-03-30 01:00:00 (Sun) 63865677600, # local_start 2024-10-27 02:00:00 (Sun) 63878983200, # local_end 2025-03-30 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63878979600, # utc_start 2025-03-30 01:00:00 (Sun) 63897123600, # utc_end 2025-10-26 01:00:00 (Sun) 63878986800, # local_start 2025-03-30 03:00:00 (Sun) 63897130800, # local_end 2025-10-26 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63897123600, # utc_start 2025-10-26 01:00:00 (Sun) 63910429200, # utc_end 2026-03-29 01:00:00 (Sun) 63897127200, # local_start 2025-10-26 02:00:00 (Sun) 63910432800, # local_end 2026-03-29 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63910429200, # utc_start 2026-03-29 01:00:00 (Sun) 63928573200, # utc_end 2026-10-25 01:00:00 (Sun) 63910436400, # local_start 2026-03-29 03:00:00 (Sun) 63928580400, # local_end 2026-10-25 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63928573200, # utc_start 2026-10-25 01:00:00 (Sun) 63941878800, # utc_end 2027-03-28 01:00:00 (Sun) 63928576800, # local_start 2026-10-25 02:00:00 (Sun) 63941882400, # local_end 2027-03-28 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63941878800, # utc_start 2027-03-28 01:00:00 (Sun) 63960627600, # utc_end 2027-10-31 01:00:00 (Sun) 63941886000, # local_start 2027-03-28 03:00:00 (Sun) 63960634800, # local_end 2027-10-31 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63960627600, # utc_start 2027-10-31 01:00:00 (Sun) 63973328400, # utc_end 2028-03-26 01:00:00 (Sun) 63960631200, # local_start 2027-10-31 02:00:00 (Sun) 63973332000, # local_end 2028-03-26 02:00:00 (Sun) 3600, 0, 'CET', ], [ 63973328400, # utc_start 2028-03-26 01:00:00 (Sun) 63992077200, # utc_end 2028-10-29 01:00:00 (Sun) 63973335600, # local_start 2028-03-26 03:00:00 (Sun) 63992084400, # local_end 2028-10-29 03:00:00 (Sun) 7200, 1, 'CEST', ], [ 63992077200, # utc_start 2028-10-29 01:00:00 (Sun) 64004778000, # utc_end 2029-03-25 01:00:00 (Sun) 63992080800, # local_start 2028-10-29 02:00:00 (Sun) 64004781600, # local_end 2029-03-25 02:00:00 (Sun) 3600, 0, 'CET', ], [ 64004778000, # utc_start 2029-03-25 01:00:00 (Sun) 64023526800, # utc_end 2029-10-28 01:00:00 (Sun) 64004785200, # local_start 2029-03-25 03:00:00 (Sun) 64023534000, # local_end 2029-10-28 03:00:00 (Sun) 7200, 1, 'CEST', ], ]; sub olson_version {'2018e'} sub has_dst_changes {62} sub _max_year {2028} sub _new_instance { return shift->_init( @_, spans => $spans ); } sub _last_offset { 3600 } my $last_observance = bless( { 'format' => 'CE%sT', 'gmtoff' => '1:00', 'local_start_datetime' => bless( { 'formatter' => undef, 'local_rd_days' => 722815, 'local_rd_secs' => 0, 'offset_modifier' => 0, 'rd_nanosecs' => 0, 'tz' => bless( { 'name' => 'floating', 'offset' => 0 }, 'DateTime::TimeZone::Floating' ), 'utc_rd_days' => 722815, 'utc_rd_secs' => 0, 'utc_year' => 1981 }, 'DateTime' ), 'offset_from_std' => 0, 'offset_from_utc' => 3600, 'until' => [], 'utc_start_datetime' => bless( { 'formatter' => undef, 'local_rd_days' => 722814, 'local_rd_secs' => 82800, 'offset_modifier' => 0, 'rd_nanosecs' => 0, 'tz' => bless( { 'name' => 'floating', 'offset' => 0 }, 'DateTime::TimeZone::Floating' ), 'utc_rd_days' => 722814, 'utc_rd_secs' => 82800, 'utc_year' => 1980 }, 'DateTime' ) }, 'DateTime::TimeZone::OlsonDB::Observance' ) ; sub _last_observance { $last_observance } my $rules = [ bless( { 'at' => '1:00u', 'from' => '1996', 'in' => 'Oct', 'letter' => '', 'name' => 'EU', 'offset_from_std' => 0, 'on' => 'lastSun', 'save' => '0', 'to' => 'max' }, 'DateTime::TimeZone::OlsonDB::Rule' ), bless( { 'at' => '1:00u', 'from' => '1981', 'in' => 'Mar', 'letter' => 'S', 'name' => 'EU', 'offset_from_std' => 3600, 'on' => 'lastSun', 'save' => '1:00', 'to' => 'max' }, 'DateTime::TimeZone::OlsonDB::Rule' ) ] ; sub _rules { $rules } 1;
26.769726
86
0.633422
eddb476af5e9e4aa04294633fbf70636bc3fa1d1
2,391
t
Perl
language/src/regent/passes_default.t
AlexisPerry/legion
c9d3d829f6e6a910e776233e62629bab34cb2304
[ "Apache-2.0" ]
1
2021-02-24T16:46:03.000Z
2021-02-24T16:46:03.000Z
language/src/regent/passes_default.t
AlexisPerry/legion
c9d3d829f6e6a910e776233e62629bab34cb2304
[ "Apache-2.0" ]
null
null
null
language/src/regent/passes_default.t
AlexisPerry/legion
c9d3d829f6e6a910e776233e62629bab34cb2304
[ "Apache-2.0" ]
1
2019-07-31T21:54:40.000Z
2019-07-31T21:54:40.000Z
-- Copyright 2018 Stanford University -- -- 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. -- Regent Compiler Passes (Default List of Passes) local passes_hooks = require("regent/passes_hooks") local std = require("regent/std") local optimize_config_options = require("regent/optimize_config_options") local optimize_divergence = require("regent/optimize_divergence") local optimize_futures = require("regent/optimize_futures") local optimize_index_launches = require("regent/optimize_index_launches") local optimize_mapping = require("regent/optimize_mapping") local optimize_traces = require("regent/optimize_traces") local parallelize_tasks = require("regent/parallelize_tasks") local skip_empty_tasks = require("regent/skip_empty_tasks") local vectorize_loops = require("regent/vectorize_loops") if std.config["flow"] then require("regent/flow_from_ast") -- priority 15 require("regent/flow_spmd") -- priority 16 require("regent/flow_to_ast") -- priority 24 end if std.config["parallelize"] then passes_hooks.add_optimization(10, parallelize_tasks) end if std.config["index-launch"] then passes_hooks.add_optimization(25, optimize_index_launches) end if std.config["skip-empty-tasks"] then passes_hooks.add_optimization(28, skip_empty_tasks) end if std.config["future"] then passes_hooks.add_optimization(30, optimize_futures) end if std.config["leaf"] or std.config["inner"] or std.config["replicable"] then passes_hooks.add_optimization(40, optimize_config_options) end if std.config["mapping"] then passes_hooks.add_optimization(50, optimize_mapping) end if std.config["trace"] then passes_hooks.add_optimization(60, optimize_traces) end if std.config["no-dynamic-branches"] then passes_hooks.add_optimization(70, optimize_divergence) end if std.config["vectorize"] then passes_hooks.add_optimization(80, vectorize_loops) end passes_hooks.debug_optimizations()
50.87234
140
0.795483
edf38b9e48b409a61703fec51ba2bf08090ab76d
1,084
pl
Perl
prolog/logicmoo_utils_all.pl
TeamSPoon/logicmoo_utils_old
a2bb81f2d21b2bd165782ab198ebec726b793f67
[ "MIT" ]
null
null
null
prolog/logicmoo_utils_all.pl
TeamSPoon/logicmoo_utils_old
a2bb81f2d21b2bd165782ab198ebec726b793f67
[ "MIT" ]
null
null
null
prolog/logicmoo_utils_all.pl
TeamSPoon/logicmoo_utils_old
a2bb81f2d21b2bd165782ab198ebec726b793f67
[ "MIT" ]
null
null
null
/* Part of LogicMOO Base Logicmoo Path Setups % =================================================================== File: 'logicmoo_util_library.pl' Purpose: To load the logicmoo libraries as needed Contact: $Author: dmiles $@users.sourceforge.net ; Version: 'logicmoo_util_library.pl' 1.0.0 Revision: $Revision: 1.7 $ Revised At: $Date: 2002/07/11 21:57:28 $ Author: Douglas R. Miles Maintainers: logicmoo E-mail: logicmoo@gmail.com WWW: http://www.prologmoo.com SCM: https://github.com/logicmoo/PrologMUD/tree/master/pack/logicmoo_base Copyleft: 1999-2015, LogicMOO Prolog Extensions License: Lesser GNU Public License % =================================================================== */ :- module(logicmoo_utils_all_legacy,[]). %:- discontiguous(logicmoo_utils_all:'$exported_op'/3). %:- logicmoo_utils_all:use_module(library(logicmoo_utils)). %:- logicmoo_utils_all:reexport(library(logicmoo_utils)). :- reexport(library(logicmoo_common)).
41.692308
87
0.582103
ed9ca705c5b706acf49e8e6c1f4b49284eeb3aa0
16,550
pl
Perl
webcheck.pl
srcx/webcheck
265527bc058a0566ff05126550d44733448a0dc3
[ "Artistic-2.0" ]
null
null
null
webcheck.pl
srcx/webcheck
265527bc058a0566ff05126550d44733448a0dc3
[ "Artistic-2.0" ]
null
null
null
webcheck.pl
srcx/webcheck
265527bc058a0566ff05126550d44733448a0dc3
[ "Artistic-2.0" ]
null
null
null
#!/usr/bin/perl -w # Web Check 0.2 # (c)2001 # Stepan Roh # kontroluje webove stranky na platne odkazy # [10. 2.2001] verze 0.1: prvni verze # [18. 2.2001] verze 0.2: predelan system kontroly vystupu (-v, -w apod.) # todo: nekontroluje odkazy do stranky (#) # mohl by tvorit i mapu odkazu # kontrolovat i externi odkazy na platnost # detekce spatnych velikosti pismen v odkazech (soubor tam je, ale s jinymi velikostmi) # moznost sbirat soubory z ruznych adresaru a umistovat je do web stromu # mohl by rict i na ktere soubory se vubec neodkazovalo (+ rict vstupni stranky) # mohl by kontrolovat i ssi includes # kontrolovat soubory postupne (pruchod stromem) a ne tak jak jsou v hashi # vystup v xml $prog_name = 'Web Check'; $prog_major_ver = 0; $prog_minor_ver = 2; $prog_copy = '(c)2001 Stepan Roh'; $prog_full_name = "$prog_name $prog_major_ver.$prog_minor_ver $prog_copy"; # konfig. parametry $user_debug = 0; # ladici hlasky davaji smysl pouze s --output classic $user_verbose = 0; $user_filemask = '(?i)\.s?htm.*$'; $user_npathmask = ''; $user_nprocmask = ''; @builtin_refmasks = ( '(?i)<\s*a[^>]+href\s*=\s*"(.*?)".*?>', '(?i)<\s*img[^>]+src\s*=\s*"(.*?)".*?>', ); @user_refmasks = (); $user_prefix = '/'; @user_rewrites = (); $user_nwebmask = ''; $user_nrefmask = '(?i)^(mailto:|javascript:)'; @builtin_indexfiles = ( 'index.htm', 'index.html', 'index.shtml', 'index.phtml', 'index.php', 'index.php3', ); @user_indexfiles = (); $user_showopts = 0; $user_output = 'classic'; %user_warnings = (); if (!@ARGV || ($ARGV[0] eq '--help') || ($ARGV[0] eq '-h') || ($ARGV[0] eq '-?')) { print <<END; $prog_full_name usage: $0 [options] directory options: -h, --help this help -v, --verbose verbose mode (output processed file names) -vv, --more-verbose more verbose mode (output all references) -f, --process regexp regexp for processed files -x, --exclude regexp regexp for file paths excluded from everything -n, --not-process regexp regexp for file paths excluded from processing -r, --reference regexp regexp for references -r-, --no-built-in-references disable built-in refmasks -p, --prefix prefix prefix under which directory is published -i, --indexfile indexfile directory index file name -i-, --no-built-in-indexfiles disable built-in indexfiles -m, --rewrite regexp subst regexp for rewriting web paths -c, --cont-rewrite re. subst like --rewrite, but do not stop after match -e, --exclude-web-paths re. regexp for excluded web paths (after rewrite) -t, --exclude-references re. regexp for excluded references -o, --output type type of output (classic (default) or protocol) -w, --warnings type output warnings of given type -w-, --nowarnings type do not output warnings of given type -s, --show-options show options after init and exit -- end of options (optional) Options --reference, --indexfile, --rewrite, --cont-rewrite, --warnings and --nowarnings may occur multiple times. Options --rewrite and --cont-rewrite are evaluated as s/regexp/subst/ (but no need for escaping any character). They are applied sequentially and rewriting stops on first matched --rewrite (--cont-rewrite will continue after match). Web path is full file path where directory is replaced by prefix. Warning types are: all all warnings (implicitly --nowarnings all) noindex no index file found extref external reference built-in options: END print " --process $user_filemask\n"; print " --reference ".join ("\n".' 'x23, @builtin_refmasks)."\n"; print " --prefix $user_prefix\n"; print " --indexfile ".join ("\n".' 'x23, @builtin_indexfiles)."\n"; print " --exclude-references $user_nrefmask\n"; print " --output $user_output\n"; exit 1; } while (@ARGV) { $cmd = shift @ARGV; if ($cmd eq '-d') { $user_debug = 1; } elsif ($cmd eq '-d-') { $user_debug = 0; } elsif (($cmd eq '-v') || ($cmd eq '--verbose')) { $user_verbose = 1; } elsif (($cmd eq '-vv') || ($cmd eq '--more-verbose')) { $user_verbose = 2; } elsif (($cmd eq '-v-') || ($cmd eq '--noverbose')) { $user_verbose = 0; } elsif (($cmd eq '-f') || ($cmd eq '--process')) { $user_filemask = shift @ARGV; } elsif (($cmd eq '-x') || ($cmd eq '--exclude')) { $user_npathmask = shift @ARGV; } elsif (($cmd eq '-n') || ($cmd eq '--not-process')) { $user_nprocmask = shift @ARGV; } elsif (($cmd eq '-r') || ($cmd eq '--reference')) { push (@user_refmasks, shift @ARGV); } elsif (($cmd eq '-r-') || ($cmd eq '--no-built-in-references')) { @builtin_refmasks = (); } elsif (($cmd eq '-p') || ($cmd eq '--prefix')) { $user_prefix = shift @ARGV; } elsif (($cmd eq '-i') || ($cmd eq '--indexfile')) { push (@user_indexfiles, shift @ARGV); } elsif (($cmd eq '-i-') || ($cmd eq '--no-built-in-indexfiles')) { @builtin_indexfiles = (); } elsif (($cmd eq '-m') || ($cmd eq '--rewrite')) { my ($mask, $subst) = (shift @ARGV, shift @ARGV); push (@user_rewrites, { 'mask' => $mask, 'subst' => $subst, 'stop' => 1 }); } elsif (($cmd eq '-c') || ($cmd eq '--cont-rewrite')) { my ($mask, $subst) = (shift @ARGV, shift @ARGV); push (@user_rewrites, { 'mask' => $mask, 'subst' => $subst, 'stop' => 0 }); } elsif (($cmd eq '-e') || ($cmd eq '--exclude-web-paths')) { $user_nwebmask = shift @ARGV; } elsif (($cmd eq '-t') || ($cmd eq '--exclude-references')) { $user_nrefmask = shift @ARGV; } elsif (($cmd eq '-o') || ($cmd eq '--output')) { $user_output = shift @ARGV; } elsif (($cmd eq '-w') || ($cmd eq '--warnings')) { my $warn_type = shift @ARGV; if ($warn_type eq 'all') { $user_warnings{'noindex'} = 1; $user_warnings{'extref'} = 1; } elsif (($warn_type eq 'noindex') || ($warn_type eq 'extref')) { $user_warnings{$warn_type} = 1; } else { die "Unrecognized warning type $warn_type\n"; } } elsif (($cmd eq '-w-') || ($cmd eq '--nowarnings')) { my $warn_type = shift @ARGV; if ($warn_type eq 'all') { %user_warnings = (); } elsif (($warn_type eq 'noindex') || ($warn_type eq 'extref')) { delete ($user_warnings{$warn_type}); } else { die "Unrecognized warning type $warn_type\n"; } } elsif (($cmd eq '-s') || ($cmd eq '--show-options')) { $user_showopts = 1; } elsif ($cmd eq '--') { last; } elsif ($cmd =~ /^-/) { die "Unrecognized option $cmd\n"; } else { unshift @ARGV, $cmd; last; } } if (!@ARGV) { die "No directory specified\n"; } if (@ARGV > 1) { die "Too many arguments\n"; } $user_dir = shift (@ARGV); push (@user_refmasks, @builtin_refmasks); push (@user_indexfiles, @builtin_indexfiles); $user_warnings = scalar (keys %user_warnings); if ($user_showopts) { print " --process $user_filemask\n"; print " --exclude $user_npathmask\n"; print " --not-process $user_nprocmask\n"; print " --reference ".join ("\n".' 'x23, @user_refmasks)."\n"; print " --prefix $user_prefix\n"; print " --indexfile ".join ("\n".' 'x23, @user_indexfiles)."\n"; print " --rewrite "; my $first = 1; foreach $rule (@user_rewrites) { if ($$rule{'stop'}) { print ' 'x23 if (!$first); print "$$rule{'mask'} $$rule{'subst'}\n"; $first = 0; } } print "\n" if ($first); print " --cont-rewrite "; $first = 1; foreach $rule (@user_rewrites) { if (!$$rule{'stop'}) { print ' 'x23 if (!$first); print "$$rule{'mask'} $$rule{'subst'}\n"; $first = 0; } } print "\n" if ($first); print " --exclude-web-paths $user_nwebmask\n"; print " --exclude-references $user_nrefmask\n"; print " --output $user_output\n"; print " --warnings "; $first = 1; foreach $warn_type (keys %user_warnings) { print ' 'x23 if (!$first); print "$warn_type\n"; $first = 0; } print "\n" if ($first); exit 0; } foreach $rule (@user_rewrites) { $$rule{'mask'} =~ s,/,\\/,g; $$rule{'subst'} =~ s,/,\\/,g; } foreach $refmask (@user_refmasks) { $refmask =~ s,/,\\/,g; } # hlavni # soubory ke zpracovani @files = (); # soubory ke zpracovani (mapuje plnou cestu -> web cestu) %filesmap = (); # mapa webu (mapuje web cestu -> 1) %webmap = ( "$user_prefix" => 1 ); # prepisuje web cestu dle @user_rewrites sub rewrite_webpath ($) { my ($path) = @_; foreach $rule (@user_rewrites) { my ($mask, $subst) = ($$rule{'mask'}, $$rule{'subst'}); my ($expr) = ('$path'." =~ s/$mask/$subst/"); if (eval $expr) { last if ($$rule{'stop'}); } } return $path; } # nacte adresar rekurzivne do @files, %filesmap a %webmap sub get_files ($$) { my ($dir, $web_path) = @_; my ($f, @f); print "Descending into dir $dir\n" if ($user_debug); opendir (DIR, $dir) || die "Error opening directory $dir : $!\n"; @f = sort grep { $_ !~ /^\.\.?$/ } readdir (DIR); closedir (DIR) || die "Error closing directory $dir : $!\n"; foreach $f (@f) { my ($full_f, $full_web) = ("$dir/$f", "$web_path$f"); if (($user_npathmask ne '') && ($full_f =~ /$user_npathmask/o)) { print "...excluded file $full_f\n" if ($user_debug); next; } if (-d $full_f) { $full_web = rewrite_webpath ($full_web) . '/'; print "... added web path $full_web\n" if ($user_debug); $webmap{$full_web} = 1; get_files ($full_f, $full_web); } else { $full_web = rewrite_webpath ($full_web); print "... added web path $full_web\n" if ($user_debug); $webmap{$full_web} = 1; if (($user_nprocmask ne '') && ($full_f =~ /$user_nprocmask/o)) { print "... file $full_f excluded from processing\n" if ($user_debug); next; } if ($f =~ /$user_filemask/o) { print "... added file $full_f\n" if ($user_debug); $filesmap{$full_f} = $full_web; push (@files, $full_f); } else { print "...passed file $full_f\n" if ($user_debug); } } } print "Ascending from dir $dir\n" if ($user_debug); } get_files ($user_dir, $user_prefix); # vystup sub output_start () { $out_files_num = $out_errors_sum = $out_warnings_sum = 0; $now = time (); if ($user_output eq 'classic') { print "$prog_full_name\nStarted checking directory $user_dir (web path $user_prefix)...\n" if ($user_verbose); } elsif ($user_output eq 'protocol') { print "$prog_full_name\nStarted checking directory $user_dir (web path $user_prefix) on ".localtime (time ())."\n\n"; } } sub output_stop () { if ($user_output eq 'classic') { print "\n$out_files_num files checked in ".(time () - $now)." sec\n" if ($user_verbose); } elsif ($user_output eq 'protocol') { print "$out_errors_sum errors"; print ", $out_warnings_sum warnings" if ($user_warnings); print " found in $out_files_num files checked in ".(time () - $now)." sec\n\n"; } } sub output_start_file ($$) { ($out_file, $out_web) = @_; if ($user_output eq 'classic') { print "Processing file $out_file ($out_web)\n" if ($user_verbose); } elsif ($user_output eq 'protocol') { # nic } %out_infos = (); %out_errors = (); %out_warnings = (); $out_errors_num = $out_warnings_num = 0; $out_files_num++; } sub output_stop_file () { $out_errors_sum += $out_errors_num; $out_warnings_sum += $out_warnings_num; if ($user_output eq 'classic') { # nic } elsif ($user_output eq 'protocol') { if ($user_verbose || ($out_errors_num + $out_warnings_num > 0)) { print "$out_errors_num errors"; print ", $out_warnings_num warnings" if ($user_warnings); print " found in file $out_file (web path $out_web)\n\n"; foreach $err (keys %out_errors) { print "\terror: $err in tags:\n"; foreach $tag (@{$out_errors{$err}}) { print "\t\t$tag\n"; } print "\n"; } foreach $warn (keys %out_warnings) { print "\twarning: $warn in tags:\n"; foreach $tag (@{$out_warnings{$warn}}) { print "\t\t$tag\n"; } print "\n"; } foreach $info (keys %out_infos) { print "\t$info:\n"; foreach $msg (@{$out_infos{$info}}) { print "\t\t$msg\n"; } print "\n"; } } } } sub output_reference ($$) { my ($ref, $norm_ref) = @_; if ($user_verbose > 1) { if ($user_output eq 'classic') { print "...reference to $ref".(defined ($norm_ref) ? " ($norm_ref)" : '')."\n"; } elsif ($user_output eq 'protocol') { push (@{$out_infos{'references'}}, "$ref".(defined ($norm_ref) ? " ($norm_ref)" : '')); } } } sub output_noindexfile ($) { my ($tag) = @_; if (exists $user_warnings{'noindex'}) { if ($user_output eq 'classic') { print "warning: $out_file: non-existent index file for reference in tag $tag\n"; } elsif ($user_output eq 'protocol') { push (@{$out_warnings{'non-existent index file'}}, $tag); } $out_warnings_num++; } } sub output_badref ($) { my ($tag) = @_; if ($user_output eq 'classic') { print "error: $out_file: non-existent reference in tag $tag\n"; } elsif ($user_output eq 'protocol') { push (@{$out_errors{'non-existent reference'}}, $tag); } $out_errors_num++; } sub output_extref ($) { my ($tag) = @_; if (exists $user_warnings{'extref'}) { if ($user_output eq 'classic') { print "warning: $out_file: external reference in tag $tag\n"; } elsif ($user_output eq 'protocol') { push (@{$out_warnings{'external reference'}}, $tag); } $out_warnings_num++; } } # zpracovani souboru sub process_file ($$) { my ($file, $web) = @_; my ($data); output_start_file ($file, $web); open (F, $file) || (warn ("Error opening file $file : $!\n"), return); $data = join ('', <F>); close (F) || warn "Error closing file $file : $!\n"; # normalizuje odkaz sub normalize_ref ($$) { my ($base, $ref) = @_; $ref =~ s,#.*$,,; # odkazy do stranek $ref =~ s,\?.*$,,; # parametry skriptu if ($ref =~ m,^\w+://,) { return undef; } if ($ref eq '') { return $base; } my $norm_ref; if ($ref =~ m,^/,) { $norm_ref = $ref; } else { $norm_ref = "$base/../$ref"; } # zrusi . a .. while ($norm_ref =~ s,(^|/)\.(/|$),,) {}; # . while ($norm_ref =~ s,(^|[^/]+)/\.\.(/|$),,) {}; # .. $norm_ref =~ s,/+,/,g; # ///////////// return $norm_ref; } foreach $refmask (@user_refmasks) { $data =~ /^$/; while ($data =~ /\G.*?($refmask)/gs) { my ($tag, $ref) = ($1, $2); if (($user_nrefmask ne '') && ($ref =~ /$user_nrefmask/o)) { print "...excluded reference $ref\n" if ($user_debug); next; } my $norm_ref = normalize_ref ($web, $ref); if (defined ($norm_ref)) { $norm_ref = rewrite_webpath ($norm_ref); if (($user_nwebmask ne '') && ($norm_ref =~ /$user_nwebmask/o)) { print "...excluded reference $ref ($norm_ref)\n" if ($user_debug); next; } } print "...detected reference tag $tag\n" if ($user_debug); output_reference ($ref, $norm_ref); if (defined ($norm_ref)) { if ($norm_ref =~ /^$user_prefix/o) { print "...checking $norm_ref\n" if ($user_debug); if (!exists ($webmap{$norm_ref})) { print "... direct hit missed\n" if ($user_debug); if (exists ($webmap{"$norm_ref/"})) { print "... directory\n" if ($user_debug); my $is_indexfile = 0; foreach $indexfile (@user_indexfiles) { if (exists ($webmap{"$norm_ref/$indexfile"})) { print "... index file $indexfile\n" if ($user_debug); $is_indexfile = 1; last; } } if (!$is_indexfile) { output_noindexfile ($tag); } } else { output_badref ($tag); } } } else { output_extref ($tag); } } else { output_extref ($tag); } } } output_stop_file (); } output_start (); foreach $f (@files) { process_file ($f, $filesmap{$f}); } output_stop (); 1;
30.591497
121
0.558429
ede103522ee2a2207cdc2cefb89cfa3e91153b13
14,295
pm
Perl
lib/Bio/KBase/Log.pm
syuja/p_contig
0e8defa6dccb3c644fe02c8a3c2bdcd776c0fa25
[ "MIT" ]
null
null
null
lib/Bio/KBase/Log.pm
syuja/p_contig
0e8defa6dccb3c644fe02c8a3c2bdcd776c0fa25
[ "MIT" ]
3
2018-05-10T17:36:20.000Z
2018-11-02T00:14:07.000Z
lib/Bio/KBase/Log.pm
syuja/p_contig
0e8defa6dccb3c644fe02c8a3c2bdcd776c0fa25
[ "MIT" ]
1
2018-03-15T11:59:39.000Z
2018-03-15T11:59:39.000Z
package Bio::KBase::Log; use strict; use warnings; use Config::Simple; use LWP::Simple; use JSON qw( decode_json ); use Cwd 'abs_path'; use Data::Dumper; use Sys::Hostname; use List::Util qw[min max]; use Time::HiRes; use Sys::Syslog qw( :DEFAULT setlogsock); # $ENV{'MLOG_CONFIG_FILE'} should point to an INI-formatted file, or an empty string, or should not exist. our $MLOG_ENV_FILE = "MLOG_CONFIG_FILE"; my $_GLOBAL = "global"; our $MLOG_LOG_LEVEL = "mlog_log_level"; our $MLOG_API_URL = "mlog_api_url"; our $MLOG_LOG_FILE = "mlog_log_file"; our $DEFAULT_LOG_LEVEL = 6; our $MSG_FACILITY = 'local1'; our $EMERG_FACILITY = 'local0'; our $EMERG = 0; our $ALERT = 1; our $CRIT = 2; our $ERR = 3; our $WARNING = 4; our $NOTICE = 5; our $INFO = 6; our $DEBUG = 7; our $DEBUG2 = 8; our $DEBUG3 = 9; my $_MLOG_TEXT_TO_LEVEL = { 'EMERG' => $EMERG, 'ALERT' => $ALERT, 'CRIT' => $CRIT, 'ERR' => $ERR, 'WARNING' => $WARNING, 'NOTICE' => $NOTICE, 'INFO' => $INFO, 'DEBUG' => $DEBUG, 'DEBUG2' => $DEBUG2, 'DEBUG3' => $DEBUG3, }; my @_MLOG_TO_SYSLOG = (0, 1, 2, 3, 4, 5, 6, 7, 7, 7); my $_MLOG_LEVEL_TO_TEXT = {}; foreach my $k (keys %{$_MLOG_TEXT_TO_LEVEL}) { $_MLOG_LEVEL_TO_TEXT->{$_MLOG_TEXT_TO_LEVEL->{$k}} = $k; } our $LOG_LEVEL_MIN = min(keys %{$_MLOG_LEVEL_TO_TEXT}); our $LOG_LEVEL_MAX = max(keys %{$_MLOG_LEVEL_TO_TEXT}); our $USER = $ENV{'USER'}; our $PARENT_FILE = abs_path($0); =pod =head1 NAME Log (message log) =head1 DESCRIPTION A library for sending message logging to syslog. The library checks for the config variables: mlog_log_level, mlog_api_url, and mlog_log_file in an INI-formatted config file that can be specified by setting the environment variable MLOG_CONFIG_FILE. The library first looks for these variables under a 'section' in the INI file which matches the 'subsystem' name in Log->new() call. mlog_log_level can be used to set a global log level for Log. mlog_api_url can be set to provide a control API for setting log levels. mlog_log_file can be set to provide the location of a file to which we can log messages in addition to syslog. The priority that is used to decide which log level setting is used for logging is as follows: =over 10 =item * USER_LOG_LEVEL: log level set within the program that is using Log by calling set_log_level() =item * CONFIG_LOG_LEVEL: log level (mlog_log_level) set within the INI file located at the path set in $ENV{'MLOG_CONFIG_FILE'} =item * API_LOG_LEVEL: log level set by the logging control server in the control API matching the log constraints (if mlog_api_url is specified in config file) =item * DEFAULT_LOG_LEVEL: INFO, log level = 6 =back =head1 METHODS Log->new(string subsystem, hashref constraints): Create a new Log instance. Constraints are optional. log_message(int level, string message): sends log message to syslog. =over 10 =item * level: (0-9) The logging level for this message is compared to the logging level that has been set in Log. If it is <= the set logging level, the message will be sent to syslog (and if specified in the Log configuration, a log file), otherwise it will be ignored. Logging level is set to 6 if message control API cannot be reached and the user does not set the log level. Log level can also be entered as string (e.g. 'DEBUG') =item * message: This is the log message. =back get_log_level(): Returns the current log level as an integer. set_log_level(integer level) : Sets the log level. Only use this if you wish to override the log levels that are defined by the Log configuration file and the control API. Can also be entered as string (e.g. 'DEBUG') =over 10 =item * level : priority =item * 0 : EMERG - system is unusable =item * 1 : ALERT - component must be fixed immediately =item * 2 : CRIT - secondary component must be fixed immediately =item * 3 : ERR - non-urgent failure =item * 4 : WARNING - warning that an error will occur if no action is taken =item * 5 : NOTICE - unusual but safe conditions =item * 6 : INFO - normal operational messages =item * 7 : DEBUG - lowest level of debug =item * 8 : DEBUG2 - second level of debug =item * 9 : DEBUG3 - highest level of debug =back set_log_file(string filename): Used to set or update the path to the file where we would like to have messages logged. Log file set in program with this function will over-ride any log file set in the config file. set_log_msg_check_count(integer count): Used to set the number the messages that Log will log before checking the Log configuration and querying the control API for the log level if mlog_api_url is set in $ENV{'MLOG_CONFIG_FILE'} (default is 100 messages). set_log_msg_check_interval(integer seconds): Used to set the interval, in seconds, that will be allowed to pass before Log will check the Log configuration and query the control API for the log level if mlog_api_url is set in $ENV{'MLOG_CONFIG_FILE'} (default is 300 seconds). update_config() : Checks the Log configuration file at $ENV{'MLOG_CONFIG_FILE'} for mlog_log_level, mlog_api_url, and mlog_log_file and checks the control API for the currently set log level if mlog_api_url is set. clear_user_log_level() : Removes the user-defined log level. =cut sub _get_option { my ($opts, $key) = @_; if(!(defined $opts)) { return undef; } return defined $opts->{$key} ? $opts->{$key} : undef; } sub new { my ($class, $sub, $lc, $options) = @_; unless(defined $sub) { die "ERROR: You must define a subsystem when calling init_log()\n"; } my $self = {}; bless $self, $class; $self->{authuser} = _get_option($options, 'authuser'); $self->{module} = _get_option($options, 'module'); $self->{method} = _get_option($options, 'method'); $self->{call_id} = _get_option($options, 'call_id'); $self->{ip_address} = _get_option($options, 'ip_address'); $self->{tag} = _get_option($options, 'tag'); $self->{_callback} = defined $options->{"changecallback"} ? $options->{"changecallback"} : sub {}; $self->{_subsystem} = $sub; $self->{_mlog_config_file} = _get_option($options, 'config'); if(!(defined $self->{_mlog_config_file})) { $self->{_mlog_config_file} = defined $ENV{$MLOG_ENV_FILE} ? $ENV{$MLOG_ENV_FILE} : undef; } $self->{_user_log_level} = -1; $self->{_config_log_level} = -1; $self->{_user_log_file} = _get_option($options, 'logfile'); $self->{_config_log_file} = undef; $self->{_api_log_level} = -1; $self->{_msgs_since_config_update} = 0; $self->{_time_at_config_update} = ""; $self->{msg_count} = 0; $self->{_recheck_api_msg} = 100; $self->{_recheck_api_time} = 300; # 5 mins if(defined $lc) { $self->{_log_constraints} = $lc; } $self->{_init} = 1; $self->update_config(); $self->{_init} = undef; return $self; } sub _get_time_since_start { my ($self) = @_; my $now = time; my $seconds_duration = $now - $self->{_time_at_config_update}; return $seconds_duration; } sub get_log_level { my ($self) = @_; if($self->{_user_log_level} != -1) { return $self->{_user_log_level}; } elsif($self->{_config_log_level} != -1) { return $self->{_config_log_level}; } elsif($self->{_api_log_level} != -1) { return $self->{_api_log_level}; } else { return $DEFAULT_LOG_LEVEL; } } sub update_config { my ($self) = @_; my $loglevel = $self->get_log_level(); my $logfile = $self->get_log_file(); $self->{_api_log_level} = -1; $self->{_msgs_since_config_update} = 0; $self->{_time_at_config_update} = time; # Retrieving config variables. my $api_url = ""; if(defined $self->{_mlog_config_file} && -e $self->{_mlog_config_file} && -s $self->{_mlog_config_file} > 0) { my $cfg = new Config::Simple($self->{_mlog_config_file}); my $cfgitems = $cfg->get_block($_GLOBAL); my $subitems = $cfg->get_block($self->{_subsystem}); foreach my $k (keys %{$subitems}) { $cfgitems->{$k} = $subitems->{$k}; } if(defined $cfgitems->{$MLOG_LOG_LEVEL}) { if($cfgitems->{$MLOG_LOG_LEVEL} !~ /^\d+$/) { warn "Cannot parse log level " . $cfgitems->{$MLOG_LOG_LEVEL} . " from file " . $self->{_mlog_config_file} . " to int. Keeping current log level."; } else { $self->{_config_log_level} = $cfgitems->{$MLOG_LOG_LEVEL}; } } if(defined $cfgitems->{$MLOG_API_URL}) { $api_url = $cfgitems->{$MLOG_API_URL}; } if(defined $cfgitems->{$MLOG_LOG_FILE}) { $self->{_config_log_file} = $cfgitems->{$MLOG_LOG_FILE} } } elsif (defined $self->{_mlog_config_file}) { warn "Cannot read config file " . $self->{_mlog_config_file}; } unless($api_url eq "") { my $subsystem_api_url = $api_url."/".$self->{_subsystem}; my $json = get($subsystem_api_url); if(defined $json) { my $decoded_json = decode_json($json); my $max_matching_level = -1; foreach my $constraint_set (@{$decoded_json->{'log_levels'}}) { my $level = $constraint_set->{'level'}; my $constraints = $constraint_set->{'constraints'}; if($level <= $max_matching_level) { next; } my $matches = 1; foreach my $constraint (keys %{$constraints}) { if(! exists $self->{_log_constraints}->{$constraint}) { $matches = 0; } elsif($self->{_log_constraints}->{$constraint} ne $constraints->{$constraint}) { $matches = 0; } } if($matches == 1) { $max_matching_level = $level; } } $self->{_api_log_level} = $max_matching_level; } else { warn "Could not retrieve Log subsystem from control API at: $subsystem_api_url"; } } } sub _resolve_log_level { my ($self, $level) = @_; if(defined $_MLOG_TEXT_TO_LEVEL->{$level}) { $level = $_MLOG_TEXT_TO_LEVEL->{$level}; } elsif (!(defined $_MLOG_LEVEL_TO_TEXT->{$level})) { die "Illegal log level"; } return $level; } sub set_log_level { my ($self, $level) = @_; $self->{_user_log_level} = $self->_resolve_log_level($level); $self->{_callback}(); } sub get_log_file { my ($self) = @_; if ($self->{_user_log_file}) { return $self->{_user_log_file}; } if ($self->{_config_log_file}) { return $self->{_config_log_file}; } return undef; } sub set_log_file { my ($self, $filename) = @_; $self->{_user_log_file} = $filename; $self->{_callback}(); } sub set_log_msg_check_count { my ($self, $count) = @_; if($count !~ /^\d+$/ || $count < 0) { die "Format for calling set_log_msg_check_count is set_log_msg_check_count(integer count)\n"; } $self->{_recheck_api_msg} = $count; } sub set_log_msg_check_interval { my ($self, $interval) = @_; if($interval !~ /^\d+$/ || $interval < 0) { die "Format for calling set_log_msg_check_interval is set_log_msg_check_interval(integer seconds)\n"; } $self->{_recheck_api_time} = $interval; } sub clear_user_log_level { my ($self) = @_; $self->{_user_log_level} = -1; } sub _get_ident { my ($self, $level, $authuser, $module, $method, $call_id, $ip_address, $tag) = @_; my @infos = ($self->{_subsystem}, $_MLOG_LEVEL_TO_TEXT->{$level}, Time::HiRes::time(), $USER, $PARENT_FILE, $$); if ($self->{ip_address}) { push @infos, $ip_address || '-'; } if ($self->{authuser}) { push @infos, $authuser || '-'; } if ($self->{module}) { push @infos, $module || '-'; } if ($self->{method}) { push @infos, $method || '-'; } if ($self->{call_id}) { push @infos, $call_id || '-'; } if ($self->{tag}) { push @infos, $tag || '-'; } return "[" . join("] [", @infos). "]"; } sub _syslog { my ($self, $facility, $level, $ident, $message) = @_; openlog($ident, "", $facility); if(ref($message) eq 'ARRAY') { foreach my $m (@{$message}) { syslog($_MLOG_TO_SYSLOG[$level], "$m"); } } else { syslog($_MLOG_TO_SYSLOG[$level], "$message"); } closelog(); } sub _log { my ($self, $ident, $message) = @_; my $time = POSIX::strftime("%Y-%m-%d %H:%M:%S", localtime); my $msg = join(" ", $time, hostname(), $ident . ": "); open LOG, ">>" . $self->get_log_file() || warn "Could not print log message $msg to " . $self->get_log_file() . "\n"; if(ref($message) eq 'ARRAY') { foreach my $m (@{$message}) { print LOG $msg . "$m\n"; } } else { print LOG $msg . "$message\n"; } close LOG; } sub log_message { my ($self, $level, $message, $authuser, $module, $method, $call_id, $ip_address, $tag) = @_; $level = $self->_resolve_log_level($level); ++$self->{msg_count}; ++$self->{_msgs_since_config_update}; if($self->{_msgs_since_config_update} >= $self->{_recheck_api_msg} || $self->_get_time_since_start() >= $self->{_recheck_api_time}) { $self->update_config(); } my $ident = $self->_get_ident($level, $authuser, $module, $method, $call_id, $ip_address, $tag); # If this message is an emergency, send a copy to the emergency facility first. if($level == 0) { $self->_syslog($EMERG_FACILITY, $level, $ident, $message); } if($level <= $self->get_log_level()) { $self->_syslog($MSG_FACILITY, $level, $ident, $message); if($self->get_log_file()) { $self->_log($ident, $message); } } } 1;
31.696231
109
0.602658
73e37a969e3c7852af17f2ab86c4dc015287f18b
4,711
pl
Perl
src/perl/Create_Qiime_tables.pl
jonathancrabtree/ergatis
a587bfa0d30c58dec8855ba5ed45274e4f206ad7
[ "Artistic-1.0" ]
null
null
null
src/perl/Create_Qiime_tables.pl
jonathancrabtree/ergatis
a587bfa0d30c58dec8855ba5ed45274e4f206ad7
[ "Artistic-1.0" ]
null
null
null
src/perl/Create_Qiime_tables.pl
jonathancrabtree/ergatis
a587bfa0d30c58dec8855ba5ed45274e4f206ad7
[ "Artistic-1.0" ]
null
null
null
#!/usr/bin/perl eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; # not running under some shell use strict; use warnings; use Data::Dumper; #********************************************************************* # Create_Qiime_tables.pl* # * This program takes taxonomic tables created in the initial qiime # pipeline and reformats them for comparative analysis with skiff and # metastats. # The output is *.tsv and *.2tsv # Author: james robert white, whitej@umd.edu # Last modified: August 11, 2010 #********************************************************************* use Getopt::Std; use warnings; use vars qw/$opt_t $opt_m $opt_p/; getopts("t:m:p:"); my $usage = "Usage: $0 \ -t otu summary table from qiime pipeline\ -m metadata file describing associations between samples\ -p output prefix [<prefix>.tsv] \n"; die $usage unless defined $opt_m and defined $opt_p and defined $opt_t; my $prefix = $opt_p; #********************************************************************* # GLOBALS #********************************************************************* my @samples = (); my %activesamples = (); my @orderedsamples = (); my %groups = (); my %seqmap = (); my %data = (); my %activefeatures = (); my %groupnames = (); #********************************************************************* #********************************************************************* # Begin parsing files #********************************************************************* my $numfeaturetypes = 0; open IN, "$opt_m" or die "Can't open Meta file for reading!!\n"; while(<IN>){ chomp($_); next if ($_ eq ""); my @A = split /\,/, $_; $A[2] =~s/^\s+|\s+$//g; $numfeaturetypes = $#A-2; if (!defined($A[3])){ # then there are no classes for the samples push @{$groups{"NoClassDef"}}, $A[2]; }else{ for my $i (3 .. $#A){ $A[$i] =~s/^\s+|\s+$//g; push @{$groups{$i-2}{$A[$i]}}, $A[2]; $groupnames{$i-2}{$A[$i]} = 1; } } } close IN; # fill up the data hash, active features, and active samples open IN, "$opt_t" or die; while(<IN>){ chomp($_); next if ($_ =~ /^#/); my @A = split "\t", $_; if ($_ =~ /Taxon/){ for my $i (1 ..$#A){ $activesamples{$A[$i]} = 1; push @samples, $A[$i]; } }else{ my @B = split /\;/, $A[0]; my $f = join("_", @B[($#B-1) .. $#B]); $activefeatures{$f} = 1; for my $i (1 ..$#A){ $data{$samples[$i-1]}{$f} = substr($A[$i], 0, length($A[$i])-2); } } } close IN; if ($numfeaturetypes > 0){ foreach my $type (keys %{$groups{1}}){ foreach my $s (@{$groups{1}{$type}}){ if (defined($activesamples{$s})){ push @orderedsamples, $s; } } } } if (!defined($orderedsamples[0])){ @orderedsamples = keys %activesamples; } printCounts(); for my $f (1 .. $numfeaturetypes){ my @gs = sort keys %{$groupnames{$f}}; for my $i (0 .. $#gs){ for my $j (0 .. $#gs){ next if ($j >= $i); printPairedGroups($f, $gs[$i], $gs[$j]); } } } #********************************************************************* # Subroutines #********************************************************************* sub printCounts { open OUT, ">$prefix.tsv" or die "Can't open $prefix.tsv for writing!\n"; for my $s (@orderedsamples){ print OUT "\t$s"; } print OUT "\n"; foreach my $f (sort keys %activefeatures){ print OUT "$f"; for my $s (@orderedsamples){ print OUT "\t$data{$s}{$f}"; } print OUT "\n"; } close OUT; } sub printPairedGroups { my ($feature, $g1, $g2) = @_; my @pairedorderedsamples = (); my $g1count = 0; foreach my $s (@{$groups{$feature}{$g1}}){ if (defined($activesamples{$s})){ push @pairedorderedsamples, $s; $g1count++; } } my $g2count = 0; foreach my $s (@{$groups{$feature}{$g2}}){ if (defined($activesamples{$s})){ push @pairedorderedsamples, $s; $g2count++; } } return if ($g1count <= 0 or $g2count <=0); return if (($g1count == 1 and $g2count != 1) or ($g1count != 1 and $g2count == 1)); open OUT, ">$prefix.$g1\_vs_$g2.$g1count-$g2count.2tsv" or die "Can't open $prefix.$g1\_vs_$g2.$g1count--$g2count.2tsv for writing!\n"; for my $s (0 .. $#pairedorderedsamples){ print OUT "\t$pairedorderedsamples[$s]"; } print OUT "\n"; foreach my $f (sort keys %activefeatures){ print OUT "$f"; for my $s (0 .. $#pairedorderedsamples){ print OUT "\t$data{$pairedorderedsamples[$s]}{$f}"; } print OUT "\n"; } close OUT; }
25.327957
137
0.46678
ed7ada75484f29e2fc845f35baff39ce47de1634
1,828
t
Perl
xt/04-build-warnings.t
jjatria/uzu
d0712e09105f551ad90d4dfc6a4905bf07eda254
[ "Artistic-2.0" ]
null
null
null
xt/04-build-warnings.t
jjatria/uzu
d0712e09105f551ad90d4dfc6a4905bf07eda254
[ "Artistic-2.0" ]
null
null
null
xt/04-build-warnings.t
jjatria/uzu
d0712e09105f551ad90d4dfc6a4905bf07eda254
[ "Artistic-2.0" ]
null
null
null
use v6; use Test; use Test::Output; use Uzu::Config; use Uzu::Render; use Uzu::Utilities; use File::Temp; # Source project files my $test_root = $*CWD.IO.child('t'); subtest { my $source_root = $test_root.IO.child('example_project_tt'); # Setup tmp project root my $tmp_root = tempdir; # Copy all example project files to tmp project root copy-dir $source_root, $tmp_root.IO; # Add tmp path to project config my $config_path = $tmp_root.IO.child('config.yml'); my $config_file = slurp $config_path; spurt $config_path, $config_file ~ "project_root: $tmp_root\n"; # Expect a warning when i18n yaml is invalid my $yaml = q:to/END/; --- company: Sam Morrison site_name: Uzu Test Project # Need to quote strings that start with numbers copyright: 2016 Sam Morrison @can't start a key with @ END # Save to tmp_build_path i18n yaml file spurt $tmp_root.IO.child('i18n').child('en.yml'), $yaml; # Do not die when theme layout template is missing unlink $tmp_root.IO.child('themes').child('default').child('layout.tt'); my $build_out = output-from { try { Uzu::Render::build Uzu::Config::from-file( config_file => $config_path, :no_livereload ); } } say $build_out if %*ENV<UZUSTDOUT>; # Test warnings like $build_out, / 'Rendered page [empty] is empty' /, 'empty page template warning to stdout'; like $build_out, / 'Invalid i18n yaml file' /, 'invalid i18n yaml warning to stdout'; like $build_out, / 'Theme [default] does not contain a layout template' /, 'theme layout template is missing warning to stdout'; like $build_out, / 'Unable to load Local' /, 'extended library is missing subroutine context()'; }, 'Warnings'; done-testing; # vim: ft=perl6
29.483871
132
0.657549
ed9ae2d4d88e395ead123ea28009f18a7e09a085
348
perl
Perl
jedisim/clean_images.perl
rbliu/Useful_Scripts
677a3cd079aab1df3fef87d2b6c6b1763b5d6d9e
[ "BSD-3-Clause" ]
null
null
null
jedisim/clean_images.perl
rbliu/Useful_Scripts
677a3cd079aab1df3fef87d2b6c6b1763b5d6d9e
[ "BSD-3-Clause" ]
null
null
null
jedisim/clean_images.perl
rbliu/Useful_Scripts
677a3cd079aab1df3fef87d2b6c6b1763b5d6d9e
[ "BSD-3-Clause" ]
null
null
null
#!/usr/dist/bin/perl -w open(OUT,">clean_decam"); for ($i=0; $i<80; $i++){ $name1 = "/Volumes/rliu/jedisim_clusters/trial_" . $i . "/trial" . $i . "_decam_convolved*.fits"; $name2 = "/Volumes/rliu/jedisim_clusters/90_trial_" . $i . "/90_trial" . $i . "_decam_convolved*.fits"; print OUT "rm $name1 \n"; print OUT "rm $name2 \n"; } close(OUT);
23.2
103
0.626437
ed0c6513cfb3ef7f5ed404834ff41ad10c4175e3
14,031
pm
Perl
lib/Excel/Writer/XLSX/Chart/Scatter.pm
robertholl/excel-writer-xlsx
f6624ba598401f57d5d67de0f5db3c76b10266d7
[ "Artistic-1.0-Perl" ]
null
null
null
lib/Excel/Writer/XLSX/Chart/Scatter.pm
robertholl/excel-writer-xlsx
f6624ba598401f57d5d67de0f5db3c76b10266d7
[ "Artistic-1.0-Perl" ]
null
null
null
lib/Excel/Writer/XLSX/Chart/Scatter.pm
robertholl/excel-writer-xlsx
f6624ba598401f57d5d67de0f5db3c76b10266d7
[ "Artistic-1.0-Perl" ]
null
null
null
package Excel::Writer::XLSX::Chart::Scatter; ############################################################################### # # Scatter - A class for writing Excel Scatter charts. # # Used in conjunction with Excel::Writer::XLSX::Chart. # # See formatting note in Excel::Writer::XLSX::Chart. # # Copyright 2000-2019, John McNamara, jmcnamara@cpan.org # # Documentation after __END__ # # perltidy with the following options: -mbl=2 -pt=0 -nola use 5.008002; use strict; use warnings; use Carp; use Excel::Writer::XLSX::Chart; our @ISA = qw(Excel::Writer::XLSX::Chart); our $VERSION = '1.00'; ############################################################################### # # new() # # sub new { my $class = shift; my $self = Excel::Writer::XLSX::Chart->new( @_ ); $self->{_subtype} = $self->{_subtype} || 'marker_only'; $self->{_cross_between} = 'midCat'; $self->{_horiz_val_axis} = 0; $self->{_val_axis_postion} = 'b'; $self->{_smooth_allowed} = 1; $self->{_requires_category} = 1; # Set the available data label positions for this chart type. $self->{_label_position_default} = 'right'; $self->{_label_positions} = { center => 'ctr', right => 'r', left => 'l', above => 't', below => 'b', # For backward compatibility. top => 't', bottom => 'b', }; bless $self, $class; return $self; } ############################################################################### # # combine() # # Override parent method to add a warning. # sub combine { my $self = shift; my $chart = shift; carp 'Combined chart not currently supported with scatter chart ' . 'as the primary chart'; return; } ############################################################################## # # _write_chart_type() # # Override the virtual superclass method with a chart specific method. # sub _write_chart_type { my $self = shift; # Write the c:scatterChart element. $self->_write_scatter_chart( @_ ); } ############################################################################## # # _write_scatter_chart() # # Write the <c:scatterChart> element. # sub _write_scatter_chart { my $self = shift; my %args = @_; my @series; if ( $args{primary_axes} ) { @series = $self->_get_primary_axes_series; } else { @series = $self->_get_secondary_axes_series; } return unless scalar @series; my $style = 'lineMarker'; my $subtype = $self->{_subtype}; # Set the user defined chart subtype. if ($subtype eq 'marker_only') { $style = 'lineMarker'; } if ($subtype eq 'straight_with_markers') { $style = 'lineMarker'; } if ($subtype eq 'straight') { $style = 'lineMarker'; $self->{_default_marker} = { type => 'none' }; } if ($subtype eq 'smooth_with_markers') { $style = 'smoothMarker'; } if ($subtype eq 'smooth') { $style = 'smoothMarker'; $self->{_default_marker} = { type => 'none' }; } # Add default formatting to the series data. $self->_modify_series_formatting(); $self->xml_start_tag( 'c:scatterChart' ); # Write the c:scatterStyle element. $self->_write_scatter_style( $style ); # Write the series elements. $self->_write_ser( $_ ) for @series; # Write the c:axId elements $self->_write_axis_ids( %args ); $self->xml_end_tag( 'c:scatterChart' ); } ############################################################################## # # _write_ser() # # Over-ridden to write c:xVal/c:yVal instead of c:cat/c:val elements. # # Write the <c:ser> element. # sub _write_ser { my $self = shift; my $series = shift; my $index = $self->{_series_index}++; $self->xml_start_tag( 'c:ser' ); # Write the c:idx element. $self->_write_idx( $index ); # Write the c:order element. $self->_write_order( $index ); # Write the series name. $self->_write_series_name( $series ); # Write the c:spPr element. $self->_write_sp_pr( $series ); # Write the c:marker element. $self->_write_marker( $series->{_marker} ); # Write the c:dPt element. $self->_write_d_pt( $series->{_points} ); # Write the c:dLbls element. $self->_write_d_lbls( $series->{_labels} ); # Write the c:trendline element. $self->_write_trendline( $series->{_trendline} ); # Write the c:errBars element. $self->_write_error_bars( $series->{_error_bars} ); # Write the c:xVal element. $self->_write_x_val( $series ); # Write the c:yVal element. $self->_write_y_val( $series ); # Write the c:smooth element. if ( $self->{_subtype} =~ /smooth/ && !defined $series->{_smooth} ) { # Default is on for smooth scatter charts. $self->_write_c_smooth( 1 ); } else { $self->_write_c_smooth( $series->{_smooth} ); } $self->xml_end_tag( 'c:ser' ); } ############################################################################## # # _write_plot_area() # # Over-ridden to have 2 valAx elements for scatter charts instead of # catAx/valAx. # # Write the <c:plotArea> element. # sub _write_plot_area { my $self = shift; $self->xml_start_tag( 'c:plotArea' ); # Write the c:layout element. $self->_write_layout( $self->{_plotarea}->{_layout}, 'plot' ); # Write the subclass chart type elements for primary and secondary axes. $self->_write_chart_type( primary_axes => 1 ); $self->_write_chart_type( primary_axes => 0 ); # Write c:catAx and c:valAx elements for series using primary axes. $self->_write_cat_val_axis( x_axis => $self->{_x_axis}, y_axis => $self->{_y_axis}, axis_ids => $self->{_axis_ids}, position => 'b', ); my $tmp = $self->{_horiz_val_axis}; $self->{_horiz_val_axis} = 1; $self->_write_val_axis( x_axis => $self->{_x_axis}, y_axis => $self->{_y_axis}, axis_ids => $self->{_axis_ids}, position => 'l', ); $self->{_horiz_val_axis} = $tmp; # Write c:valAx and c:catAx elements for series using secondary axes. $self->_write_cat_val_axis( x_axis => $self->{_x2_axis}, y_axis => $self->{_y2_axis}, axis_ids => $self->{_axis2_ids}, position => 'b', ); $self->{_horiz_val_axis} = 1; $self->_write_val_axis( x_axis => $self->{_x2_axis}, y_axis => $self->{_y2_axis}, axis_ids => $self->{_axis2_ids}, position => 'l', ); # Write the c:spPr element for the plotarea formatting. $self->_write_sp_pr( $self->{_plotarea} ); $self->xml_end_tag( 'c:plotArea' ); } ############################################################################## # # _write_x_val() # # Write the <c:xVal> element. # sub _write_x_val { my $self = shift; my $series = shift; my $formula = $series->{_categories}; my $data_id = $series->{_cat_data_id}; my $data = $self->{_formula_data}->[$data_id]; $self->xml_start_tag( 'c:xVal' ); # Check the type of cached data. my $type = $self->_get_data_type( $data ); # TODO. Can a scatter plot have non-numeric data. if ( $type eq 'str' ) { # Write the c:numRef element. $self->_write_str_ref( $formula, $data, $type ); } else { # Write the c:numRef element. $self->_write_num_ref( $formula, $data, $type ); } $self->xml_end_tag( 'c:xVal' ); } ############################################################################## # # _write_y_val() # # Write the <c:yVal> element. # sub _write_y_val { my $self = shift; my $series = shift; my $formula = $series->{_values}; my $data_id = $series->{_val_data_id}; my $data = $self->{_formula_data}->[$data_id]; $self->xml_start_tag( 'c:yVal' ); # Unlike Cat axes data should only be numeric. # Write the c:numRef element. $self->_write_num_ref( $formula, $data, 'num' ); $self->xml_end_tag( 'c:yVal' ); } ############################################################################## # # _write_scatter_style() # # Write the <c:scatterStyle> element. # sub _write_scatter_style { my $self = shift; my $val = shift; my @attributes = ( 'val' => $val ); $self->xml_empty_tag( 'c:scatterStyle', @attributes ); } ############################################################################## # # _modify_series_formatting() # # Add default formatting to the series data unless it has already been # specified by the user. # sub _modify_series_formatting { my $self = shift; my $subtype = $self->{_subtype}; # The default scatter style "markers only" requires a line type. if ( $subtype eq 'marker_only' ) { # Go through each series and define default values. for my $series ( @{ $self->{_series} } ) { # Set a line type unless there is already a user defined type. if ( !$series->{_line}->{_defined} ) { $series->{_line} = { width => 2.25, none => 1, _defined => 1, }; } } } } ############################################################################## # # _write_d_pt_point() # # Write an individual <c:dPt> element. Override the parent method to add # markers. # sub _write_d_pt_point { my $self = shift; my $index = shift; my $point = shift; $self->xml_start_tag( 'c:dPt' ); # Write the c:idx element. $self->_write_idx( $index ); $self->xml_start_tag( 'c:marker' ); # Write the c:spPr element. $self->_write_sp_pr( $point ); $self->xml_end_tag( 'c:marker' ); $self->xml_end_tag( 'c:dPt' ); } 1; __END__ =head1 NAME Scatter - A class for writing Excel Scatter charts. =head1 SYNOPSIS To create a simple Excel file with a Scatter chart using Excel::Writer::XLSX: #!/usr/bin/perl use strict; use warnings; use Excel::Writer::XLSX; my $workbook = Excel::Writer::XLSX->new( 'chart.xlsx' ); my $worksheet = $workbook->add_worksheet(); my $chart = $workbook->add_chart( type => 'scatter' ); # Configure the chart. $chart->add_series( categories => '=Sheet1!$A$2:$A$7', values => '=Sheet1!$B$2:$B$7', ); # Add the worksheet data the chart refers to. my $data = [ [ 'Category', 2, 3, 4, 5, 6, 7 ], [ 'Value', 1, 4, 5, 2, 1, 5 ], ]; $worksheet->write( 'A1', $data ); __END__ =head1 DESCRIPTION This module implements Scatter charts for L<Excel::Writer::XLSX>. The chart object is created via the Workbook C<add_chart()> method: my $chart = $workbook->add_chart( type => 'scatter' ); Once the object is created it can be configured via the following methods that are common to all chart classes: $chart->add_series(); $chart->set_x_axis(); $chart->set_y_axis(); $chart->set_title(); These methods are explained in detail in L<Excel::Writer::XLSX::Chart>. Class specific methods or settings, if any, are explained below. =head1 Scatter Chart Subtypes The C<Scatter> chart module also supports the following sub-types: markers_only (the default) straight_with_markers straight smooth_with_markers smooth These can be specified at creation time via the C<add_chart()> Worksheet method: my $chart = $workbook->add_chart( type => 'scatter', subtype => 'straight_with_markers' ); =head1 EXAMPLE Here is a complete example that demonstrates most of the available features when creating a chart. #!/usr/bin/perl use strict; use warnings; use Excel::Writer::XLSX; my $workbook = Excel::Writer::XLSX->new( 'chart_scatter.xlsx' ); my $worksheet = $workbook->add_worksheet(); my $bold = $workbook->add_format( bold => 1 ); # Add the worksheet data that the charts will refer to. my $headings = [ 'Number', 'Batch 1', 'Batch 2' ]; my $data = [ [ 2, 3, 4, 5, 6, 7 ], [ 10, 40, 50, 20, 10, 50 ], [ 30, 60, 70, 50, 40, 30 ], ]; $worksheet->write( 'A1', $headings, $bold ); $worksheet->write( 'A2', $data ); # Create a new chart object. In this case an embedded chart. my $chart = $workbook->add_chart( type => 'scatter', embedded => 1 ); # Configure the first series. $chart->add_series( name => '=Sheet1!$B$1', categories => '=Sheet1!$A$2:$A$7', values => '=Sheet1!$B$2:$B$7', ); # Configure second series. Note alternative use of array ref to define # ranges: [ $sheetname, $row_start, $row_end, $col_start, $col_end ]. $chart->add_series( name => '=Sheet1!$C$1', categories => [ 'Sheet1', 1, 6, 0, 0 ], values => [ 'Sheet1', 1, 6, 2, 2 ], ); # Add a chart title and some axis labels. $chart->set_title ( name => 'Results of sample analysis' ); $chart->set_x_axis( name => 'Test number' ); $chart->set_y_axis( name => 'Sample length (mm)' ); # Set an Excel chart style. Colors with white outline and shadow. $chart->set_style( 10 ); # Insert the chart into the worksheet (with an offset). $worksheet->insert_chart( 'D2', $chart, 25, 10 ); __END__ =begin html <p>This will produce a chart that looks like this:</p> <p><center><img src="http://jmcnamara.github.io/excel-writer-xlsx/images/examples/scatter1.jpg" width="483" height="291" alt="Chart example." /></center></p> =end html =head1 AUTHOR John McNamara jmcnamara@cpan.org =head1 COPYRIGHT Copyright MM-MMXIX, John McNamara. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
24.52972
157
0.55413
edf9ce21eecde5b0de654963add718e4f8f42d8e
644
pm
Perl
Mojoqq/perl/vendor/lib/Moose/Meta/Method/Accessor/Native/Array/push.pm
ghuan/Mojo-webqq-for-windows
ad44014da4578f99aa3efad0b55f0fc3bc3af322
[ "Unlicense" ]
null
null
null
Mojoqq/perl/vendor/lib/Moose/Meta/Method/Accessor/Native/Array/push.pm
ghuan/Mojo-webqq-for-windows
ad44014da4578f99aa3efad0b55f0fc3bc3af322
[ "Unlicense" ]
null
null
null
Mojoqq/perl/vendor/lib/Moose/Meta/Method/Accessor/Native/Array/push.pm
ghuan/Mojo-webqq-for-windows
ad44014da4578f99aa3efad0b55f0fc3bc3af322
[ "Unlicense" ]
null
null
null
package Moose::Meta::Method::Accessor::Native::Array::push; our $VERSION = '2.1801'; use strict; use warnings; use Moose::Role; with 'Moose::Meta::Method::Accessor::Native::Array::Writer'; sub _adds_members { 1 } sub _potential_value { my $self = shift; my ($slot_access) = @_; return '[ @{ (' . $slot_access . ') }, @_ ]'; } sub _inline_optimized_set_new_value { my $self = shift; my ($inv, $new, $slot_access) = @_; return 'push @{ (' . $slot_access . ') }, @_;'; } sub _return_value { my $self = shift; my ($slot_access) = @_; return 'scalar @{ (' . $slot_access . ') }'; } no Moose::Role; 1;
17.405405
60
0.586957
edcd5a4cf490e30cdb86b940c78731dca9fb2e86
6,937
pm
Perl
perl/vendor/lib/DateTime/TimeZone/America/Swift_Current.pm
Light2027/OnlineCampusSandbox
8dcaaf62af1342470f9e7be6d42bd0f16eb910b8
[ "Apache-2.0" ]
null
null
null
perl/vendor/lib/DateTime/TimeZone/America/Swift_Current.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/Swift_Current.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::Swift_Current; 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::Swift_Current::ISA = ( 'Class::Singleton', 'DateTime::TimeZone' ); my $spans = [ [ DateTime::TimeZone::NEG_INFINITY, # utc_start 60105481880, # utc_end 1905-09-01 07:11:20 (Fri) DateTime::TimeZone::NEG_INFINITY, # local_start 60105456000, # local_end 1905-09-01 00:00:00 (Fri) -25880, 0, 'LMT', ], [ 60105481880, # utc_start 1905-09-01 07:11:20 (Fri) 60503619600, # utc_end 1918-04-14 09:00:00 (Sun) 60105456680, # local_start 1905-09-01 00:11:20 (Fri) 60503594400, # local_end 1918-04-14 02:00:00 (Sun) -25200, 0, 'MST', ], [ 60503619600, # utc_start 1918-04-14 09:00:00 (Sun) 60520550400, # utc_end 1918-10-27 08:00:00 (Sun) 60503598000, # local_start 1918-04-14 03:00:00 (Sun) 60520528800, # local_end 1918-10-27 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 60520550400, # utc_start 1918-10-27 08:00:00 (Sun) 61255472400, # utc_end 1942-02-09 09:00:00 (Mon) 60520525200, # local_start 1918-10-27 01:00:00 (Sun) 61255447200, # local_end 1942-02-09 02:00:00 (Mon) -25200, 0, 'MST', ], [ 61255472400, # utc_start 1942-02-09 09:00:00 (Mon) 61366287600, # utc_end 1945-08-14 23:00:00 (Tue) 61255450800, # local_start 1942-02-09 03:00:00 (Mon) 61366266000, # local_end 1945-08-14 17:00:00 (Tue) -21600, 1, 'MWT', ], [ 61366287600, # utc_start 1945-08-14 23:00:00 (Tue) 61370294400, # utc_end 1945-09-30 08:00:00 (Sun) 61366266000, # local_start 1945-08-14 17:00:00 (Tue) 61370272800, # local_end 1945-09-30 02:00:00 (Sun) -21600, 1, 'MPT', ], [ 61370294400, # utc_start 1945-09-30 08:00:00 (Sun) 61388442000, # utc_end 1946-04-28 09:00:00 (Sun) 61370269200, # local_start 1945-09-30 01:00:00 (Sun) 61388416800, # local_end 1946-04-28 02:00:00 (Sun) -25200, 0, 'MST', ], [ 61388442000, # utc_start 1946-04-28 09:00:00 (Sun) 61402953600, # utc_end 1946-10-13 08:00:00 (Sun) 61388420400, # local_start 1946-04-28 03:00:00 (Sun) 61402932000, # local_end 1946-10-13 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 61402953600, # utc_start 1946-10-13 08:00:00 (Sun) 61419891600, # utc_end 1947-04-27 09:00:00 (Sun) 61402928400, # local_start 1946-10-13 01:00:00 (Sun) 61419866400, # local_end 1947-04-27 02:00:00 (Sun) -25200, 0, 'MST', ], [ 61419891600, # utc_start 1947-04-27 09:00:00 (Sun) 61433193600, # utc_end 1947-09-28 08:00:00 (Sun) 61419870000, # local_start 1947-04-27 03:00:00 (Sun) 61433172000, # local_end 1947-09-28 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 61433193600, # utc_start 1947-09-28 08:00:00 (Sun) 61451341200, # utc_end 1948-04-25 09:00:00 (Sun) 61433168400, # local_start 1947-09-28 01:00:00 (Sun) 61451316000, # local_end 1948-04-25 02:00:00 (Sun) -25200, 0, 'MST', ], [ 61451341200, # utc_start 1948-04-25 09:00:00 (Sun) 61464643200, # utc_end 1948-09-26 08:00:00 (Sun) 61451319600, # local_start 1948-04-25 03:00:00 (Sun) 61464621600, # local_end 1948-09-26 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 61464643200, # utc_start 1948-09-26 08:00:00 (Sun) 61482790800, # utc_end 1949-04-24 09:00:00 (Sun) 61464618000, # local_start 1948-09-26 01:00:00 (Sun) 61482765600, # local_end 1949-04-24 02:00:00 (Sun) -25200, 0, 'MST', ], [ 61482790800, # utc_start 1949-04-24 09:00:00 (Sun) 61496092800, # utc_end 1949-09-25 08:00:00 (Sun) 61482769200, # local_start 1949-04-24 03:00:00 (Sun) 61496071200, # local_end 1949-09-25 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 61496092800, # utc_start 1949-09-25 08:00:00 (Sun) 61504556400, # utc_end 1950-01-01 07:00:00 (Sun) 61496067600, # local_start 1949-09-25 01:00:00 (Sun) 61504531200, # local_end 1950-01-01 00:00:00 (Sun) -25200, 0, 'MST', ], [ 61504556400, # utc_start 1950-01-01 07:00:00 (Sun) 61735597200, # utc_end 1957-04-28 09:00:00 (Sun) 61504531200, # local_start 1950-01-01 00:00:00 (Sun) 61735572000, # local_end 1957-04-28 02:00:00 (Sun) -25200, 0, 'MST', ], [ 61735597200, # utc_start 1957-04-28 09:00:00 (Sun) 61751318400, # utc_end 1957-10-27 08:00:00 (Sun) 61735575600, # local_start 1957-04-28 03:00:00 (Sun) 61751296800, # local_end 1957-10-27 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 61751318400, # utc_start 1957-10-27 08:00:00 (Sun) 61798496400, # utc_end 1959-04-26 09:00:00 (Sun) 61751293200, # local_start 1957-10-27 01:00:00 (Sun) 61798471200, # local_end 1959-04-26 02:00:00 (Sun) -25200, 0, 'MST', ], [ 61798496400, # utc_start 1959-04-26 09:00:00 (Sun) 61814217600, # utc_end 1959-10-25 08:00:00 (Sun) 61798474800, # local_start 1959-04-26 03:00:00 (Sun) 61814196000, # local_end 1959-10-25 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 61814217600, # utc_start 1959-10-25 08:00:00 (Sun) 61829946000, # utc_end 1960-04-24 09:00:00 (Sun) 61814192400, # local_start 1959-10-25 01:00:00 (Sun) 61829920800, # local_end 1960-04-24 02:00:00 (Sun) -25200, 0, 'MST', ], [ 61829946000, # utc_start 1960-04-24 09:00:00 (Sun) 61843248000, # utc_end 1960-09-25 08:00:00 (Sun) 61829924400, # local_start 1960-04-24 03:00:00 (Sun) 61843226400, # local_end 1960-09-25 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 61843248000, # utc_start 1960-09-25 08:00:00 (Sun) 61862000400, # utc_end 1961-04-30 09:00:00 (Sun) 61843222800, # local_start 1960-09-25 01:00:00 (Sun) 61861975200, # local_end 1961-04-30 02:00:00 (Sun) -25200, 0, 'MST', ], [ 61862000400, # utc_start 1961-04-30 09:00:00 (Sun) 61874697600, # utc_end 1961-09-24 08:00:00 (Sun) 61861978800, # local_start 1961-04-30 03:00:00 (Sun) 61874676000, # local_end 1961-09-24 02:00:00 (Sun) -21600, 1, 'MDT', ], [ 61874697600, # utc_start 1961-09-24 08:00:00 (Sun) 62209155600, # utc_end 1972-04-30 09:00:00 (Sun) 61874672400, # local_start 1961-09-24 01:00:00 (Sun) 62209130400, # local_end 1972-04-30 02:00:00 (Sun) -25200, 0, 'MST', ], [ 62209155600, # utc_start 1972-04-30 09:00:00 (Sun) DateTime::TimeZone::INFINITY, # utc_end 62209134000, # local_start 1972-04-30 03:00:00 (Sun) DateTime::TimeZone::INFINITY, # local_end -21600, 0, 'CST', ], ]; sub olson_version {'2019c'} sub has_dst_changes {11} sub _max_year {2029} sub _new_instance { return shift->_init( @_, spans => $spans ); } 1;
25.981273
96
0.647398
edeb3f830685f8590fe07394503a6d8f68b43fb2
39,464
pl
Perl
dataset/strong-noise/04-Browse1/br1gtMovementIndv_new.pl
jasonfilippou/Prob-EC
c6b1a8d4aaf82e7b44efb3329d425cdbf92e0f31
[ "BSD-3-Clause" ]
2
2020-12-29T19:37:19.000Z
2021-05-12T15:46:35.000Z
dataset/strong-noise/04-Browse1/br1gtMovementIndv_new.pl
jasonfilippou/Prob-EC
c6b1a8d4aaf82e7b44efb3329d425cdbf92e0f31
[ "BSD-3-Clause" ]
null
null
null
dataset/strong-noise/04-Browse1/br1gtMovementIndv_new.pl
jasonfilippou/Prob-EC
c6b1a8d4aaf82e7b44efb3329d425cdbf92e0f31
[ "BSD-3-Clause" ]
1
2021-05-12T15:46:52.000Z
2021-05-12T15:46:52.000Z
% Frame number: 0 % Frame number: 1 happensAt( walking( id1 ), 40 ). % Frame number: 2 % Frame number: 3 happensAt( walking( id1 ), 120 ). % Frame number: 4 % Frame number: 5 % Frame number: 6 % Frame number: 7 % Frame number: 8 % Frame number: 9 happensAt( walking( id2 ), 360 ). % Frame number: 10 holdsAt( coord( id2 )=( 84, 186 ), 400 ). % Frame number: 11 % Frame number: 12 % Frame number: 13 holdsAt( coord( id2 )=( 84, 191 ), 520 ). % Frame number: 14 % Frame number: 15 holdsAt( coord( id2 )=( 84, 193 ), 600 ). % Frame number: 16 happensAt( walking( id0 ), 640 ). % Frame number: 17 happensAt( walking( id0 ), 680 ). holdsAt( coord( id2 )=( 84, 194 ), 680 ). % Frame number: 18 % Frame number: 19 happensAt( walking( id0 ), 760 ). % Frame number: 20 holdsAt( coord( id1 )=( 174, 217 ), 800 ). % Frame number: 21 % Frame number: 22 % Frame number: 23 happensAt( walking( id2 ), 920 ). % Frame number: 24 % Frame number: 25 % Frame number: 26 happensAt( walking( id0 ), 1040 ). holdsAt( coord( id1 )=( 163, 210 ), 1040 ). % Frame number: 27 % Frame number: 28 % Frame number: 29 % Frame number: 30 % Frame number: 31 % Frame number: 32 % Frame number: 33 % Frame number: 34 holdsAt( coord( id2 )=( 84, 199 ), 1360 ). % Frame number: 35 happensAt( walking( id1 ), 1400 ). happensAt( walking( id2 ), 1400 ). % Frame number: 36 holdsAt( coord( id0 )=( 229, 203 ), 1440 ). holdsAt( coord( id1 )=( 144, 202 ), 1440 ). happensAt( walking( id2 ), 1440 ). % Frame number: 37 holdsAt( coord( id1 )=( 143, 201 ), 1480 ). % Frame number: 38 % Frame number: 39 % Frame number: 40 % Frame number: 41 % Frame number: 42 % Frame number: 43 % Frame number: 44 holdsAt( coord( id1 )=( 135, 197 ), 1760 ). % Frame number: 45 holdsAt( coord( id1 )=( 133, 196 ), 1800 ). happensAt( walking( id2 ), 1800 ). % Frame number: 46 happensAt( walking( id1 ), 1840 ). % Frame number: 47 holdsAt( coord( id0 )=( 209, 182 ), 1880 ). % Frame number: 48 happensAt( walking( id1 ), 1920 ). % Frame number: 49 % Frame number: 50 happensAt( walking( id0 ), 2000 ). % Frame number: 51 happensAt( walking( id1 ), 2040 ). % Frame number: 52 holdsAt( coord( id2 )=( 86, 207 ), 2080 ). % Frame number: 53 % Frame number: 54 % Frame number: 55 % Frame number: 56 % Frame number: 57 % Frame number: 58 holdsAt( coord( id2 )=( 86, 207 ), 2320 ). % Frame number: 59 happensAt( inactive( id2 ), 2360 ). % Frame number: 60 % Frame number: 61 % Frame number: 62 % Frame number: 63 % Frame number: 64 holdsAt( coord( id0 )=( 184, 158 ), 2560 ). % Frame number: 65 holdsAt( coord( id1 )=( 107, 183 ), 2600 ). % Frame number: 66 % Frame number: 67 % Frame number: 68 % Frame number: 69 holdsAt( coord( id0 )=( 187, 152 ), 2760 ). % Frame number: 70 holdsAt( coord( id0 )=( 187, 151 ), 2800 ). happensAt( inactive( id2 ), 2800 ). % Frame number: 71 % Frame number: 72 happensAt( walking( id0 ), 2880 ). holdsAt( coord( id1 )=( 97, 178 ), 2880 ). % Frame number: 73 happensAt( walking( id0 ), 2920 ). happensAt( inactive( id2 ), 2920 ). % Frame number: 74 % Frame number: 75 happensAt( walking( id1 ), 3000 ). % Frame number: 76 % Frame number: 77 happensAt( inactive( id0 ), 3080 ). % Frame number: 78 % Frame number: 79 % Frame number: 80 % Frame number: 81 % Frame number: 82 happensAt( inactive( id2 ), 3280 ). % Frame number: 83 % Frame number: 84 holdsAt( coord( id1 )=( 87, 171 ), 3360 ). % Frame number: 85 % Frame number: 86 % Frame number: 87 happensAt( inactive( id2 ), 3480 ). % Frame number: 88 happensAt( inactive( id0 ), 3520 ). holdsAt( coord( id0 )=( 183, 141 ), 3520 ). % Frame number: 89 happensAt( walking( id1 ), 3560 ). % Frame number: 90 % Frame number: 91 happensAt( walking( id1 ), 3640 ). % Frame number: 92 % Frame number: 93 % Frame number: 94 % Frame number: 95 % Frame number: 96 happensAt( inactive( id0 ), 3840 ). % Frame number: 97 happensAt( inactive( id0 ), 3880 ). % Frame number: 98 % Frame number: 99 happensAt( walking( id1 ), 3960 ). happensAt( inactive( id2 ), 3960 ). % Frame number: 100 happensAt( inactive( id0 ), 4000 ). happensAt( walking( id1 ), 4000 ). % Frame number: 101 holdsAt( coord( id0 )=( 182, 140 ), 4040 ). % Frame number: 102 % Frame number: 103 % Frame number: 104 % Frame number: 105 happensAt( inactive( id0 ), 4200 ). % Frame number: 106 holdsAt( coord( id0 )=( 183, 141 ), 4240 ). % Frame number: 107 holdsAt( coord( id0 )=( 183, 141 ), 4280 ). % Frame number: 108 holdsAt( coord( id0 )=( 183, 141 ), 4320 ). holdsAt( coord( id1 )=( 69, 165 ), 4320 ). % Frame number: 109 happensAt( walking( id0 ), 4360 ). happensAt( walking( id1 ), 4360 ). % Frame number: 110 % Frame number: 111 happensAt( walking( id0 ), 4440 ). % Frame number: 112 % Frame number: 113 holdsAt( coord( id1 )=( 66, 164 ), 4520 ). % Frame number: 114 % Frame number: 115 % Frame number: 116 happensAt( walking( id0 ), 4640 ). % Frame number: 117 holdsAt( coord( id1 )=( 66, 164 ), 4680 ). % Frame number: 118 happensAt( walking( id1 ), 4720 ). % Frame number: 119 % Frame number: 120 % Frame number: 121 % Frame number: 122 % Frame number: 123 % Frame number: 124 happensAt( walking( id1 ), 4960 ). % Frame number: 125 holdsAt( coord( id0 )=( 200, 157 ), 5000 ). % Frame number: 126 happensAt( inactive( id2 ), 5040 ). % Frame number: 127 % Frame number: 128 happensAt( walking( id0 ), 5120 ). % Frame number: 129 % Frame number: 130 % Frame number: 131 holdsAt( coord( id0 )=( 213, 174 ), 5240 ). happensAt( inactive( id2 ), 5240 ). % Frame number: 132 % Frame number: 133 % Frame number: 134 holdsAt( coord( id1 )=( 55, 161 ), 5360 ). % Frame number: 135 happensAt( inactive( id2 ), 5400 ). % Frame number: 136 happensAt( inactive( id2 ), 5440 ). holdsAt( coord( id2 )=( 86, 207 ), 5440 ). % Frame number: 137 holdsAt( coord( id1 )=( 53, 161 ), 5480 ). % Frame number: 138 happensAt( walking( id0 ), 5520 ). % Frame number: 139 % Frame number: 140 % Frame number: 141 % Frame number: 142 holdsAt( coord( id1 )=( 52, 160 ), 5680 ). % Frame number: 143 % Frame number: 144 happensAt( inactive( id2 ), 5760 ). % Frame number: 145 % Frame number: 146 happensAt( walking( id1 ), 5840 ). % Frame number: 147 happensAt( inactive( id2 ), 5880 ). % Frame number: 148 % Frame number: 149 % Frame number: 150 % Frame number: 151 % Frame number: 152 % Frame number: 153 % Frame number: 154 % Frame number: 155 % Frame number: 156 holdsAt( coord( id2 )=( 86, 207 ), 6240 ). % Frame number: 157 % Frame number: 158 % Frame number: 159 holdsAt( coord( id1 )=( 45, 156 ), 6360 ). % Frame number: 160 % Frame number: 161 % Frame number: 162 happensAt( walking( id1 ), 6480 ). holdsAt( coord( id2 )=( 86, 207 ), 6480 ). % Frame number: 163 happensAt( walking( id0 ), 6520 ). % Frame number: 164 holdsAt( coord( id0 )=( 268, 230 ), 6560 ). happensAt( inactive( id2 ), 6560 ). % Frame number: 165 % Frame number: 166 % Frame number: 167 holdsAt( coord( id1 )=( 43, 156 ), 6680 ). % Frame number: 168 % Frame number: 169 happensAt( walking( id1 ), 6760 ). % Frame number: 170 % Frame number: 171 % Frame number: 172 % Frame number: 173 happensAt( walking( id1 ), 6920 ). % Frame number: 174 happensAt( walking( id1 ), 6960 ). % Frame number: 175 % Frame number: 176 % Frame number: 177 happensAt( walking( id1 ), 7080 ). % Frame number: 178 % Frame number: 179 holdsAt( coord( id2 )=( 86, 207 ), 7160 ). % Frame number: 180 holdsAt( coord( id1 )=( 39, 155 ), 7200 ). % Frame number: 181 happensAt( inactive( id2 ), 7240 ). holdsAt( coord( id2 )=( 86, 207 ), 7240 ). % Frame number: 182 holdsAt( coord( id0 )=( 299, 270 ), 7280 ). % Frame number: 183 % Frame number: 184 % Frame number: 185 holdsAt( coord( id0 )=( 300, 270 ), 7400 ). % Frame number: 186 % Frame number: 187 % Frame number: 188 % Frame number: 189 happensAt( inactive( id2 ), 7560 ). % Frame number: 190 % Frame number: 191 holdsAt( coord( id2 )=( 86, 207 ), 7640 ). % Frame number: 192 holdsAt( coord( id1 )=( 35, 156 ), 7680 ). % Frame number: 193 holdsAt( coord( id0 )=( 300, 278 ), 7720 ). holdsAt( coord( id1 )=( 35, 156 ), 7720 ). % Frame number: 194 holdsAt( coord( id0 )=( 304, 278 ), 7760 ). % Frame number: 195 happensAt( walking( id1 ), 7800 ). % Frame number: 196 % Frame number: 197 % Frame number: 198 happensAt( inactive( id2 ), 7920 ). % Frame number: 199 % Frame number: 200 % Frame number: 201 % Frame number: 202 % Frame number: 203 % Frame number: 204 happensAt( walking( id0 ), 8160 ). happensAt( inactive( id2 ), 8160 ). % Frame number: 205 happensAt( walking( id0 ), 8200 ). holdsAt( coord( id2 )=( 86, 207 ), 8200 ). % Frame number: 206 % Frame number: 207 happensAt( inactive( id2 ), 8280 ). % Frame number: 208 happensAt( walking( id1 ), 8320 ). % Frame number: 209 happensAt( walking( id0 ), 8360 ). holdsAt( coord( id0 )=( 305, 281 ), 8360 ). % Frame number: 210 happensAt( inactive( id2 ), 8400 ). % Frame number: 211 % Frame number: 212 holdsAt( coord( id0 )=( 305, 282 ), 8480 ). % Frame number: 213 holdsAt( coord( id0 )=( 305, 282 ), 8520 ). % Frame number: 214 % Frame number: 215 % Frame number: 216 % Frame number: 217 holdsAt( coord( id0 )=( 307, 282 ), 8680 ). % Frame number: 218 holdsAt( coord( id2 )=( 86, 207 ), 8720 ). % Frame number: 219 happensAt( inactive( id2 ), 8760 ). holdsAt( coord( id2 )=( 86, 207 ), 8760 ). % Frame number: 220 holdsAt( coord( id0 )=( 307, 282 ), 8800 ). happensAt( walking( id1 ), 8800 ). % Frame number: 221 happensAt( inactive( id2 ), 8840 ). % Frame number: 222 % Frame number: 223 happensAt( walking( id0 ), 8920 ). % Frame number: 224 % Frame number: 225 % Frame number: 226 % Frame number: 227 % Frame number: 228 % Frame number: 229 % Frame number: 230 % Frame number: 231 happensAt( walking( id1 ), 9240 ). % Frame number: 232 holdsAt( coord( id0 )=( 309, 282 ), 9280 ). % Frame number: 233 happensAt( walking( id0 ), 9320 ). happensAt( walking( id1 ), 9320 ). % Frame number: 234 % Frame number: 235 % Frame number: 236 % Frame number: 237 holdsAt( coord( id2 )=( 86, 207 ), 9480 ). % Frame number: 238 % Frame number: 239 holdsAt( coord( id0 )=( 314, 285 ), 9560 ). holdsAt( coord( id2 )=( 86, 207 ), 9560 ). % Frame number: 240 holdsAt( coord( id0 )=( 314, 286 ), 9600 ). holdsAt( coord( id1 )=( 26, 168 ), 9600 ). % Frame number: 241 holdsAt( coord( id1 )=( 27, 168 ), 9640 ). happensAt( inactive( id2 ), 9640 ). % Frame number: 242 % Frame number: 243 happensAt( inactive( id2 ), 9720 ). % Frame number: 244 % Frame number: 245 happensAt( inactive( id2 ), 9800 ). % Frame number: 246 % Frame number: 247 % Frame number: 248 % Frame number: 249 happensAt( inactive( id2 ), 9960 ). % Frame number: 250 % Frame number: 251 % Frame number: 252 happensAt( inactive( id2 ), 10080 ). % Frame number: 253 % Frame number: 254 happensAt( inactive( id2 ), 10160 ). % Frame number: 255 % Frame number: 256 holdsAt( coord( id2 )=( 86, 207 ), 10240 ). % Frame number: 257 % Frame number: 258 % Frame number: 259 % Frame number: 260 % Frame number: 261 % Frame number: 262 % Frame number: 263 % Frame number: 264 % Frame number: 265 % Frame number: 266 % Frame number: 267 % Frame number: 268 % Frame number: 269 % Frame number: 270 % Frame number: 271 % Frame number: 272 % Frame number: 273 % Frame number: 274 % Frame number: 275 % Frame number: 276 % Frame number: 277 % Frame number: 278 % Frame number: 279 % Frame number: 280 holdsAt( coord( id2 )=( 86, 207 ), 11200 ). % Frame number: 281 happensAt( inactive( id2 ), 11240 ). % Frame number: 282 happensAt( inactive( id2 ), 11280 ). % Frame number: 283 % Frame number: 284 % Frame number: 285 holdsAt( coord( id2 )=( 86, 207 ), 11400 ). % Frame number: 286 % Frame number: 287 holdsAt( coord( id2 )=( 86, 207 ), 11480 ). % Frame number: 288 % Frame number: 289 % Frame number: 290 % Frame number: 291 % Frame number: 292 % Frame number: 293 % Frame number: 294 % Frame number: 295 happensAt( inactive( id2 ), 11800 ). % Frame number: 296 % Frame number: 297 % Frame number: 298 holdsAt( coord( id2 )=( 86, 207 ), 11920 ). % Frame number: 299 % Frame number: 300 % Frame number: 301 % Frame number: 302 % Frame number: 303 % Frame number: 304 % Frame number: 305 % Frame number: 306 % Frame number: 307 % Frame number: 308 % Frame number: 309 % Frame number: 310 % Frame number: 311 % Frame number: 312 % Frame number: 313 % Frame number: 314 % Frame number: 315 % Frame number: 316 % Frame number: 317 % Frame number: 318 happensAt( inactive( id2 ), 12720 ). % Frame number: 319 % Frame number: 320 % Frame number: 321 holdsAt( coord( id2 )=( 86, 207 ), 12840 ). % Frame number: 322 % Frame number: 323 % Frame number: 324 % Frame number: 325 % Frame number: 326 % Frame number: 327 happensAt( inactive( id2 ), 13080 ). % Frame number: 328 % Frame number: 329 % Frame number: 330 % Frame number: 331 % Frame number: 332 % Frame number: 333 % Frame number: 334 % Frame number: 335 % Frame number: 336 % Frame number: 337 happensAt( walking( id3 ), 13480 ). holdsAt( coord( id3 )=( 26, 164 ), 13480 ). % Frame number: 338 holdsAt( coord( id3 )=( 26, 164 ), 13520 ). % Frame number: 339 % Frame number: 340 % Frame number: 341 % Frame number: 342 % Frame number: 343 % Frame number: 344 % Frame number: 345 holdsAt( coord( id2 )=( 86, 207 ), 13800 ). % Frame number: 346 happensAt( inactive( id2 ), 13840 ). happensAt( walking( id3 ), 13840 ). % Frame number: 347 % Frame number: 348 % Frame number: 349 % Frame number: 350 % Frame number: 351 % Frame number: 352 holdsAt( coord( id3 )=( 29, 163 ), 14080 ). % Frame number: 353 % Frame number: 354 happensAt( walking( id3 ), 14160 ). % Frame number: 355 % Frame number: 356 happensAt( walking( id3 ), 14240 ). % Frame number: 357 % Frame number: 358 % Frame number: 359 happensAt( inactive( id2 ), 14360 ). % Frame number: 360 % Frame number: 361 % Frame number: 362 % Frame number: 363 % Frame number: 364 happensAt( walking( id3 ), 14560 ). % Frame number: 365 % Frame number: 366 % Frame number: 367 holdsAt( coord( id3 )=( 32, 161 ), 14680 ). % Frame number: 368 % Frame number: 369 % Frame number: 370 % Frame number: 371 holdsAt( coord( id3 )=( 34, 159 ), 14840 ). % Frame number: 372 % Frame number: 373 % Frame number: 374 holdsAt( coord( id3 )=( 35, 159 ), 14960 ). % Frame number: 375 % Frame number: 376 % Frame number: 377 % Frame number: 378 % Frame number: 379 % Frame number: 380 % Frame number: 381 happensAt( walking( id3 ), 15240 ). % Frame number: 382 holdsAt( coord( id2 )=( 86, 208 ), 15280 ). % Frame number: 383 holdsAt( coord( id2 )=( 86, 208 ), 15320 ). % Frame number: 384 % Frame number: 385 % Frame number: 386 happensAt( walking( id3 ), 15440 ). holdsAt( coord( id3 )=( 39, 158 ), 15440 ). % Frame number: 387 % Frame number: 388 holdsAt( coord( id2 )=( 86, 208 ), 15520 ). % Frame number: 389 % Frame number: 390 holdsAt( coord( id2 )=( 86, 208 ), 15600 ). % Frame number: 391 % Frame number: 392 % Frame number: 393 % Frame number: 394 % Frame number: 395 % Frame number: 396 happensAt( inactive( id2 ), 15840 ). % Frame number: 397 holdsAt( coord( id2 )=( 84, 207 ), 15880 ). % Frame number: 398 happensAt( inactive( id2 ), 15920 ). % Frame number: 399 % Frame number: 400 holdsAt( coord( id2 )=( 84, 207 ), 16000 ). % Frame number: 401 happensAt( inactive( id2 ), 16040 ). happensAt( walking( id3 ), 16040 ). % Frame number: 402 % Frame number: 403 % Frame number: 404 % Frame number: 405 % Frame number: 406 holdsAt( coord( id2 )=( 84, 208 ), 16240 ). % Frame number: 407 happensAt( walking( id3 ), 16280 ). % Frame number: 408 holdsAt( coord( id2 )=( 84, 208 ), 16320 ). % Frame number: 409 % Frame number: 410 % Frame number: 411 % Frame number: 412 holdsAt( coord( id2 )=( 84, 208 ), 16480 ). % Frame number: 413 happensAt( inactive( id2 ), 16520 ). holdsAt( coord( id3 )=( 49, 156 ), 16520 ). % Frame number: 414 % Frame number: 415 % Frame number: 416 % Frame number: 417 happensAt( inactive( id2 ), 16680 ). % Frame number: 418 % Frame number: 419 % Frame number: 420 happensAt( inactive( id2 ), 16800 ). holdsAt( coord( id2 )=( 86, 208 ), 16800 ). % Frame number: 421 % Frame number: 422 % Frame number: 423 % Frame number: 424 holdsAt( coord( id3 )=( 53, 154 ), 16960 ). % Frame number: 425 % Frame number: 426 % Frame number: 427 % Frame number: 428 % Frame number: 429 % Frame number: 430 happensAt( inactive( id2 ), 17200 ). % Frame number: 431 % Frame number: 432 % Frame number: 433 % Frame number: 434 % Frame number: 435 % Frame number: 436 holdsAt( coord( id2 )=( 86, 208 ), 17440 ). % Frame number: 437 % Frame number: 438 % Frame number: 439 % Frame number: 440 % Frame number: 441 % Frame number: 442 % Frame number: 443 % Frame number: 444 % Frame number: 445 happensAt( inactive( id2 ), 17800 ). % Frame number: 446 % Frame number: 447 holdsAt( coord( id3 )=( 65, 149 ), 17880 ). % Frame number: 448 % Frame number: 449 % Frame number: 450 % Frame number: 451 % Frame number: 452 holdsAt( coord( id2 )=( 86, 208 ), 18080 ). % Frame number: 453 % Frame number: 454 % Frame number: 455 % Frame number: 456 % Frame number: 457 % Frame number: 458 % Frame number: 459 % Frame number: 460 % Frame number: 461 happensAt( walking( id3 ), 18440 ). % Frame number: 462 % Frame number: 463 % Frame number: 464 % Frame number: 465 holdsAt( coord( id2 )=( 86, 208 ), 18600 ). % Frame number: 466 % Frame number: 467 % Frame number: 468 holdsAt( coord( id3 )=( 81, 145 ), 18720 ). % Frame number: 469 % Frame number: 470 % Frame number: 471 happensAt( walking( id3 ), 18840 ). % Frame number: 472 % Frame number: 473 holdsAt( coord( id3 )=( 83, 142 ), 18920 ). % Frame number: 474 % Frame number: 475 % Frame number: 476 % Frame number: 477 happensAt( walking( id3 ), 19080 ). % Frame number: 478 holdsAt( coord( id2 )=( 86, 208 ), 19120 ). % Frame number: 479 % Frame number: 480 % Frame number: 481 holdsAt( coord( id2 )=( 86, 208 ), 19240 ). % Frame number: 482 % Frame number: 483 % Frame number: 484 holdsAt( coord( id2 )=( 86, 208 ), 19360 ). % Frame number: 485 % Frame number: 486 % Frame number: 487 % Frame number: 488 % Frame number: 489 happensAt( walking( id3 ), 19560 ). % Frame number: 490 % Frame number: 491 % Frame number: 492 % Frame number: 493 % Frame number: 494 % Frame number: 495 happensAt( walking( id3 ), 19800 ). % Frame number: 496 % Frame number: 497 holdsAt( coord( id2 )=( 86, 209 ), 19880 ). holdsAt( coord( id3 )=( 103, 136 ), 19880 ). % Frame number: 498 % Frame number: 499 % Frame number: 500 holdsAt( coord( id3 )=( 109, 134 ), 20000 ). % Frame number: 501 % Frame number: 502 % Frame number: 503 % Frame number: 504 % Frame number: 505 % Frame number: 506 happensAt( walking( id3 ), 20240 ). % Frame number: 507 holdsAt( coord( id2 )=( 86, 209 ), 20280 ). % Frame number: 508 % Frame number: 509 happensAt( walking( id3 ), 20360 ). % Frame number: 510 % Frame number: 511 holdsAt( coord( id3 )=( 118, 132 ), 20440 ). % Frame number: 512 happensAt( walking( id3 ), 20480 ). % Frame number: 513 % Frame number: 514 holdsAt( coord( id2 )=( 86, 209 ), 20560 ). % Frame number: 515 % Frame number: 516 % Frame number: 517 % Frame number: 518 % Frame number: 519 % Frame number: 520 % Frame number: 521 holdsAt( coord( id2 )=( 86, 209 ), 20840 ). % Frame number: 522 % Frame number: 523 holdsAt( coord( id3 )=( 136, 126 ), 20920 ). % Frame number: 524 % Frame number: 525 % Frame number: 526 % Frame number: 527 % Frame number: 528 % Frame number: 529 % Frame number: 530 % Frame number: 531 % Frame number: 532 % Frame number: 533 % Frame number: 534 % Frame number: 535 happensAt( inactive( id2 ), 21400 ). % Frame number: 536 % Frame number: 537 happensAt( walking( id3 ), 21480 ). % Frame number: 538 % Frame number: 539 % Frame number: 540 % Frame number: 541 % Frame number: 542 holdsAt( coord( id2 )=( 86, 209 ), 21680 ). % Frame number: 543 % Frame number: 544 happensAt( inactive( id2 ), 21760 ). % Frame number: 545 % Frame number: 546 % Frame number: 547 % Frame number: 548 % Frame number: 549 % Frame number: 550 % Frame number: 551 happensAt( walking( id3 ), 22040 ). % Frame number: 552 happensAt( walking( id3 ), 22080 ). % Frame number: 553 holdsAt( coord( id2 )=( 86, 209 ), 22120 ). % Frame number: 554 % Frame number: 555 happensAt( walking( id3 ), 22200 ). % Frame number: 556 % Frame number: 557 % Frame number: 558 % Frame number: 559 % Frame number: 560 % Frame number: 561 % Frame number: 562 % Frame number: 563 happensAt( inactive( id2 ), 22520 ). % Frame number: 564 % Frame number: 565 % Frame number: 566 % Frame number: 567 % Frame number: 568 % Frame number: 569 % Frame number: 570 % Frame number: 571 holdsAt( coord( id2 )=( 86, 209 ), 22840 ). % Frame number: 572 holdsAt( coord( id2 )=( 86, 209 ), 22880 ). % Frame number: 573 % Frame number: 574 % Frame number: 575 % Frame number: 576 happensAt( inactive( id2 ), 23040 ). % Frame number: 577 % Frame number: 578 holdsAt( coord( id2 )=( 86, 209 ), 23120 ). % Frame number: 579 % Frame number: 580 happensAt( walking( id3 ), 23200 ). % Frame number: 581 holdsAt( coord( id2 )=( 86, 209 ), 23240 ). happensAt( walking( id3 ), 23240 ). % Frame number: 582 happensAt( walking( id3 ), 23280 ). % Frame number: 583 holdsAt( coord( id2 )=( 86, 209 ), 23320 ). % Frame number: 584 % Frame number: 585 % Frame number: 586 % Frame number: 587 holdsAt( coord( id3 )=( 254, 99 ), 23480 ). % Frame number: 588 happensAt( walking( id3 ), 23520 ). % Frame number: 589 % Frame number: 590 % Frame number: 591 holdsAt( coord( id2 )=( 86, 209 ), 23640 ). % Frame number: 592 % Frame number: 593 % Frame number: 594 % Frame number: 595 happensAt( inactive( id2 ), 23800 ). % Frame number: 596 % Frame number: 597 % Frame number: 598 happensAt( inactive( id2 ), 23920 ). % Frame number: 599 % Frame number: 600 % Frame number: 601 % Frame number: 602 % Frame number: 603 % Frame number: 604 % Frame number: 605 happensAt( inactive( id2 ), 24200 ). % Frame number: 606 % Frame number: 607 % Frame number: 608 % Frame number: 609 % Frame number: 610 % Frame number: 611 % Frame number: 612 holdsAt( coord( id3 )=( 291, 95 ), 24480 ). % Frame number: 613 % Frame number: 614 happensAt( inactive( id2 ), 24560 ). holdsAt( coord( id2 )=( 86, 209 ), 24560 ). % Frame number: 615 % Frame number: 616 % Frame number: 617 % Frame number: 618 % Frame number: 619 % Frame number: 620 holdsAt( coord( id2 )=( 86, 209 ), 24800 ). % Frame number: 621 % Frame number: 622 holdsAt( coord( id3 )=( 298, 96 ), 24880 ). % Frame number: 623 % Frame number: 624 % Frame number: 625 happensAt( active( id3 ), 25000 ). % Frame number: 626 % Frame number: 627 holdsAt( coord( id3 )=( 299, 95 ), 25080 ). % Frame number: 628 happensAt( active( id3 ), 25120 ). % Frame number: 629 % Frame number: 630 % Frame number: 631 % Frame number: 632 holdsAt( coord( id2 )=( 86, 209 ), 25280 ). % Frame number: 633 % Frame number: 634 holdsAt( coord( id2 )=( 86, 209 ), 25360 ). % Frame number: 635 % Frame number: 636 % Frame number: 637 % Frame number: 638 % Frame number: 639 happensAt( inactive( id2 ), 25560 ). % Frame number: 640 happensAt( inactive( id2 ), 25600 ). % Frame number: 641 % Frame number: 642 % Frame number: 643 % Frame number: 644 holdsAt( coord( id2 )=( 86, 209 ), 25760 ). % Frame number: 645 % Frame number: 646 % Frame number: 647 happensAt( inactive( id2 ), 25880 ). % Frame number: 648 % Frame number: 649 % Frame number: 650 holdsAt( coord( id3 )=( 299, 93 ), 26000 ). % Frame number: 651 % Frame number: 652 % Frame number: 653 % Frame number: 654 % Frame number: 655 % Frame number: 656 happensAt( inactive( id2 ), 26240 ). % Frame number: 657 % Frame number: 658 happensAt( active( id3 ), 26320 ). % Frame number: 659 % Frame number: 660 happensAt( inactive( id2 ), 26400 ). happensAt( active( id3 ), 26400 ). % Frame number: 661 % Frame number: 662 happensAt( active( id3 ), 26480 ). % Frame number: 663 % Frame number: 664 % Frame number: 665 % Frame number: 666 happensAt( inactive( id2 ), 26640 ). % Frame number: 667 % Frame number: 668 % Frame number: 669 happensAt( inactive( id2 ), 26760 ). % Frame number: 670 % Frame number: 671 % Frame number: 672 % Frame number: 673 % Frame number: 674 % Frame number: 675 % Frame number: 676 holdsAt( coord( id2 )=( 86, 209 ), 27040 ). happensAt( active( id3 ), 27040 ). % Frame number: 677 % Frame number: 678 % Frame number: 679 happensAt( active( id3 ), 27160 ). % Frame number: 680 % Frame number: 681 happensAt( active( id3 ), 27240 ). % Frame number: 682 happensAt( inactive( id2 ), 27280 ). % Frame number: 683 % Frame number: 684 happensAt( active( id3 ), 27360 ). % Frame number: 685 holdsAt( coord( id3 )=( 295, 98 ), 27400 ). % Frame number: 686 % Frame number: 687 % Frame number: 688 % Frame number: 689 holdsAt( coord( id2 )=( 86, 209 ), 27560 ). % Frame number: 690 happensAt( active( id3 ), 27600 ). % Frame number: 691 % Frame number: 692 holdsAt( coord( id2 )=( 86, 209 ), 27680 ). % Frame number: 693 % Frame number: 694 % Frame number: 695 % Frame number: 696 holdsAt( coord( id2 )=( 86, 209 ), 27840 ). % Frame number: 697 % Frame number: 698 holdsAt( coord( id2 )=( 86, 209 ), 27920 ). % Frame number: 699 % Frame number: 700 % Frame number: 701 % Frame number: 702 % Frame number: 703 % Frame number: 704 % Frame number: 705 % Frame number: 706 % Frame number: 707 % Frame number: 708 holdsAt( coord( id2 )=( 86, 209 ), 28320 ). % Frame number: 709 happensAt( active( id3 ), 28360 ). % Frame number: 710 % Frame number: 711 % Frame number: 712 % Frame number: 713 % Frame number: 714 happensAt( active( id3 ), 28560 ). % Frame number: 715 % Frame number: 716 % Frame number: 717 % Frame number: 718 happensAt( active( id3 ), 28720 ). % Frame number: 719 % Frame number: 720 holdsAt( coord( id2 )=( 86, 209 ), 28800 ). % Frame number: 721 % Frame number: 722 % Frame number: 723 % Frame number: 724 happensAt( active( id3 ), 28960 ). % Frame number: 725 % Frame number: 726 % Frame number: 727 holdsAt( coord( id2 )=( 86, 209 ), 29080 ). % Frame number: 728 happensAt( inactive( id2 ), 29120 ). % Frame number: 729 happensAt( inactive( id2 ), 29160 ). % Frame number: 730 happensAt( inactive( id2 ), 29200 ). happensAt( active( id3 ), 29200 ). % Frame number: 731 % Frame number: 732 holdsAt( coord( id2 )=( 86, 209 ), 29280 ). % Frame number: 733 happensAt( inactive( id2 ), 29320 ). % Frame number: 734 % Frame number: 735 % Frame number: 736 holdsAt( coord( id2 )=( 86, 209 ), 29440 ). % Frame number: 737 % Frame number: 738 % Frame number: 739 % Frame number: 740 % Frame number: 741 % Frame number: 742 % Frame number: 743 % Frame number: 744 % Frame number: 745 % Frame number: 746 holdsAt( coord( id2 )=( 86, 209 ), 29840 ). % Frame number: 747 % Frame number: 748 % Frame number: 749 % Frame number: 750 % Frame number: 751 % Frame number: 752 % Frame number: 753 % Frame number: 754 % Frame number: 755 holdsAt( coord( id3 )=( 303, 106 ), 30200 ). % Frame number: 756 % Frame number: 757 % Frame number: 758 % Frame number: 759 % Frame number: 760 happensAt( inactive( id2 ), 30400 ). % Frame number: 761 % Frame number: 762 % Frame number: 763 % Frame number: 764 % Frame number: 765 % Frame number: 766 % Frame number: 767 % Frame number: 768 % Frame number: 769 holdsAt( coord( id2 )=( 86, 209 ), 30760 ). happensAt( walking( id3 ), 30760 ). % Frame number: 770 % Frame number: 771 % Frame number: 772 % Frame number: 773 % Frame number: 774 % Frame number: 775 % Frame number: 776 % Frame number: 777 % Frame number: 778 happensAt( inactive( id2 ), 31120 ). % Frame number: 779 holdsAt( coord( id2 )=( 86, 209 ), 31160 ). % Frame number: 780 % Frame number: 781 % Frame number: 782 % Frame number: 783 % Frame number: 784 happensAt( inactive( id2 ), 31360 ). holdsAt( coord( id3 )=( 301, 151 ), 31360 ). % Frame number: 785 % Frame number: 786 happensAt( inactive( id2 ), 31440 ). % Frame number: 787 happensAt( inactive( id2 ), 31480 ). % Frame number: 788 % Frame number: 789 % Frame number: 790 % Frame number: 791 % Frame number: 792 % Frame number: 793 % Frame number: 794 % Frame number: 795 % Frame number: 796 % Frame number: 797 % Frame number: 798 % Frame number: 799 % Frame number: 800 % Frame number: 801 happensAt( inactive( id2 ), 32040 ). holdsAt( coord( id2 )=( 86, 209 ), 32040 ). % Frame number: 802 % Frame number: 803 % Frame number: 804 % Frame number: 805 % Frame number: 806 happensAt( inactive( id2 ), 32240 ). % Frame number: 807 % Frame number: 808 holdsAt( coord( id2 )=( 86, 209 ), 32320 ). % Frame number: 809 happensAt( walking( id3 ), 32360 ). % Frame number: 810 % Frame number: 811 % Frame number: 812 happensAt( inactive( id2 ), 32480 ). % Frame number: 813 holdsAt( coord( id2 )=( 86, 209 ), 32520 ). % Frame number: 814 % Frame number: 815 % Frame number: 816 % Frame number: 817 % Frame number: 818 happensAt( walking( id3 ), 32720 ). % Frame number: 819 happensAt( walking( id3 ), 32760 ). % Frame number: 820 % Frame number: 821 % Frame number: 822 % Frame number: 823 % Frame number: 824 % Frame number: 825 % Frame number: 826 % Frame number: 827 holdsAt( coord( id3 )=( 280, 212 ), 33080 ). % Frame number: 828 happensAt( inactive( id2 ), 33120 ). % Frame number: 829 holdsAt( coord( id3 )=( 278, 212 ), 33160 ). % Frame number: 830 % Frame number: 831 holdsAt( coord( id3 )=( 278, 212 ), 33240 ). % Frame number: 832 % Frame number: 833 % Frame number: 834 holdsAt( coord( id2 )=( 86, 209 ), 33360 ). % Frame number: 835 happensAt( inactive( id2 ), 33400 ). % Frame number: 836 holdsAt( coord( id3 )=( 279, 209 ), 33440 ). % Frame number: 837 % Frame number: 838 % Frame number: 839 % Frame number: 840 % Frame number: 841 holdsAt( coord( id3 )=( 278, 205 ), 33640 ). % Frame number: 842 % Frame number: 843 holdsAt( coord( id3 )=( 276, 203 ), 33720 ). % Frame number: 844 holdsAt( coord( id3 )=( 277, 203 ), 33760 ). % Frame number: 845 % Frame number: 846 % Frame number: 847 happensAt( walking( id3 ), 33880 ). % Frame number: 848 % Frame number: 849 % Frame number: 850 % Frame number: 851 % Frame number: 852 % Frame number: 853 happensAt( walking( id3 ), 34120 ). % Frame number: 854 % Frame number: 855 holdsAt( coord( id2 )=( 85, 208 ), 34200 ). % Frame number: 856 happensAt( inactive( id2 ), 34240 ). % Frame number: 857 % Frame number: 858 % Frame number: 859 happensAt( inactive( id2 ), 34360 ). % Frame number: 860 % Frame number: 861 % Frame number: 862 % Frame number: 863 happensAt( walking( id3 ), 34520 ). % Frame number: 864 holdsAt( coord( id3 )=( 289, 182 ), 34560 ). % Frame number: 865 % Frame number: 866 % Frame number: 867 % Frame number: 868 % Frame number: 869 holdsAt( coord( id3 )=( 289, 174 ), 34760 ). % Frame number: 870 % Frame number: 871 happensAt( walking( id3 ), 34840 ). % Frame number: 872 % Frame number: 873 % Frame number: 874 holdsAt( coord( id2 )=( 85, 206 ), 34960 ). % Frame number: 875 % Frame number: 876 % Frame number: 877 % Frame number: 878 % Frame number: 879 % Frame number: 880 happensAt( inactive( id2 ), 35200 ). holdsAt( coord( id3 )=( 293, 163 ), 35200 ). % Frame number: 881 % Frame number: 882 holdsAt( coord( id3 )=( 289, 160 ), 35280 ). % Frame number: 883 happensAt( walking( id3 ), 35320 ). % Frame number: 884 holdsAt( coord( id2 )=( 85, 204 ), 35360 ). % Frame number: 885 holdsAt( coord( id3 )=( 289, 152 ), 35400 ). % Frame number: 886 happensAt( walking( id3 ), 35440 ). % Frame number: 887 % Frame number: 888 % Frame number: 889 happensAt( active( id2 ), 35560 ). % Frame number: 890 % Frame number: 891 % Frame number: 892 % Frame number: 893 happensAt( active( id2 ), 35720 ). % Frame number: 894 happensAt( walking( id3 ), 35760 ). % Frame number: 895 holdsAt( coord( id3 )=( 288, 134 ), 35800 ). % Frame number: 896 holdsAt( coord( id3 )=( 288, 134 ), 35840 ). % Frame number: 897 % Frame number: 898 % Frame number: 899 holdsAt( coord( id3 )=( 289, 129 ), 35960 ). % Frame number: 900 % Frame number: 901 % Frame number: 902 % Frame number: 903 happensAt( active( id2 ), 36120 ). % Frame number: 904 % Frame number: 905 holdsAt( coord( id3 )=( 290, 115 ), 36200 ). % Frame number: 906 holdsAt( coord( id2 )=( 85, 200 ), 36240 ). % Frame number: 907 % Frame number: 908 % Frame number: 909 % Frame number: 910 % Frame number: 911 % Frame number: 912 happensAt( active( id2 ), 36480 ). happensAt( walking( id3 ), 36480 ). % Frame number: 913 % Frame number: 914 % Frame number: 915 % Frame number: 916 % Frame number: 917 % Frame number: 918 % Frame number: 919 happensAt( walking( id3 ), 36760 ). % Frame number: 920 happensAt( walking( id3 ), 36800 ). holdsAt( coord( id3 )=( 296, 101 ), 36800 ). % Frame number: 921 % Frame number: 922 % Frame number: 923 % Frame number: 924 happensAt( active( id2 ), 36960 ). % Frame number: 925 % Frame number: 926 % Frame number: 927 % Frame number: 928 % Frame number: 929 % Frame number: 930 % Frame number: 931 % Frame number: 932 % Frame number: 933 holdsAt( coord( id3 )=( 301, 95 ), 37320 ). % Frame number: 934 holdsAt( coord( id2 )=( 86, 199 ), 37360 ). % Frame number: 935 happensAt( walking( id2 ), 37400 ). % Frame number: 936 % Frame number: 937 % Frame number: 938 % Frame number: 939 % Frame number: 940 % Frame number: 941 happensAt( walking( id2 ), 37640 ). % Frame number: 942 % Frame number: 943 % Frame number: 944 holdsAt( coord( id2 )=( 90, 200 ), 37760 ). % Frame number: 945 % Frame number: 946 happensAt( walking( id2 ), 37840 ). holdsAt( coord( id2 )=( 91, 200 ), 37840 ). % Frame number: 947 % Frame number: 948 % Frame number: 949 % Frame number: 950 % Frame number: 951 % Frame number: 952 % Frame number: 953 % Frame number: 954 % Frame number: 955 happensAt( active( id3 ), 38200 ). % Frame number: 956 % Frame number: 957 % Frame number: 958 % Frame number: 959 % Frame number: 960 holdsAt( coord( id2 )=( 94, 202 ), 38400 ). % Frame number: 961 % Frame number: 962 % Frame number: 963 % Frame number: 964 holdsAt( coord( id3 )=( 304, 93 ), 38560 ). % Frame number: 965 % Frame number: 966 % Frame number: 967 % Frame number: 968 holdsAt( coord( id3 )=( 302, 91 ), 38720 ). % Frame number: 969 holdsAt( coord( id2 )=( 99, 206 ), 38760 ). % Frame number: 970 % Frame number: 971 % Frame number: 972 % Frame number: 973 holdsAt( coord( id3 )=( 301, 91 ), 38920 ). % Frame number: 974 happensAt( walking( id2 ), 38960 ). % Frame number: 975 % Frame number: 976 % Frame number: 977 holdsAt( coord( id3 )=( 299, 91 ), 39080 ). % Frame number: 978 % Frame number: 979 % Frame number: 980 % Frame number: 981 % Frame number: 982 happensAt( walking( id2 ), 39280 ). % Frame number: 983 % Frame number: 984 % Frame number: 985 % Frame number: 986 % Frame number: 987 % Frame number: 988 % Frame number: 989 holdsAt( coord( id2 )=( 108, 208 ), 39560 ). % Frame number: 990 % Frame number: 991 % Frame number: 992 holdsAt( coord( id3 )=( 279, 95 ), 39680 ). % Frame number: 993 % Frame number: 994 % Frame number: 995 holdsAt( coord( id2 )=( 109, 209 ), 39800 ). holdsAt( coord( id3 )=( 276, 95 ), 39800 ). % Frame number: 996 % Frame number: 997 happensAt( walking( id3 ), 39880 ). % Frame number: 998 % Frame number: 999 % Frame number: 1000 % Frame number: 1001 happensAt( walking( id3 ), 40040 ). % Frame number: 1002 % Frame number: 1003 % Frame number: 1004 % Frame number: 1005 % Frame number: 1006 % Frame number: 1007 % Frame number: 1008 % Frame number: 1009 % Frame number: 1010 % Frame number: 1011 % Frame number: 1012 holdsAt( coord( id3 )=( 249, 96 ), 40480 ). % Frame number: 1013 holdsAt( coord( id2 )=( 111, 216 ), 40520 ). % Frame number: 1014 holdsAt( coord( id3 )=( 243, 94 ), 40560 ). % Frame number: 1015 happensAt( walking( id2 ), 40600 ). % Frame number: 1016 % Frame number: 1017 happensAt( walking( id2 ), 40680 ). happensAt( walking( id3 ), 40680 ). % Frame number: 1018 holdsAt( coord( id3 )=( 233, 95 ), 40720 ). % Frame number: 1019 % Frame number: 1020 % Frame number: 1021 % Frame number: 1022 % Frame number: 1023 holdsAt( coord( id3 )=( 229, 96 ), 40920 ). % Frame number: 1024 holdsAt( coord( id2 )=( 111, 216 ), 40960 ). % Frame number: 1025 happensAt( walking( id3 ), 41000 ). % Frame number: 1026 % Frame number: 1027 happensAt( walking( id3 ), 41080 ). % Frame number: 1028 happensAt( walking( id3 ), 41120 ). % Frame number: 1029 % Frame number: 1030 happensAt( active( id2 ), 41200 ). % Frame number: 1031 % Frame number: 1032 % Frame number: 1033 % Frame number: 1034 % Frame number: 1035 % Frame number: 1036 % Frame number: 1037 % Frame number: 1038 % Frame number: 1039 happensAt( active( id2 ), 41560 ). holdsAt( coord( id2 )=( 113, 218 ), 41560 ). % Frame number: 1040 % Frame number: 1041 % Frame number: 1042
9.122515
80
0.61048
edf808234d933741410341fbf143eb712678bd66
598
pl
Perl
Manifest/spectector.hooks.pl
zhengyangruc/spectector
839bec7d96cd5b3387377cb42d26eb8ad55ecd4c
[ "Apache-2.0" ]
51
2018-12-20T13:50:50.000Z
2021-11-06T03:04:43.000Z
Manifest/spectector.hooks.pl
zhengyangruc/spectector
839bec7d96cd5b3387377cb42d26eb8ad55ecd4c
[ "Apache-2.0" ]
1
2022-01-27T11:16:58.000Z
2022-02-01T15:58:33.000Z
Manifest/spectector.hooks.pl
spectector/spectector
839bec7d96cd5b3387377cb42d26eb8ad55ecd4c
[ "Apache-2.0" ]
10
2019-01-24T09:16:38.000Z
2021-11-06T04:32:03.000Z
:- module(_, [], [ciaobld(bundlehooks)]). :- doc(title, "Bundle Hooks for spectector"). :- use_module(engine(internals), [ciao_root/1]). :- use_module(library(streams)). :- use_module(library(bundle/bundle_paths)). :- use_module(library(pathnames)). :- use_module(library(sh_process), [sh_process_call/3]). % (hook) '$builder_hook'(custom_run(bindist, [])) :- !, % Create a binary distribution Script = ~bundle_path(spectector, 'Manifest/make_distro.sh'), ThirdParty = ~path_concat(~ciao_root, 'third-party'), Env = ['THIRDPARTY' = ThirdParty], sh_process_call(Script, [], [env(Env)]).
29.9
62
0.695652
ede1322d82e644ca2ab40eac7cc5bb195ee238a1
466
t
Perl
t/fastgenbank.t
mjy/psy
de4840b00c8e1d7b5d8bc3534268ad03f6bd7d27
[ "MIT" ]
null
null
null
t/fastgenbank.t
mjy/psy
de4840b00c8e1d7b5d8bc3534268ad03f6bd7d27
[ "MIT" ]
null
null
null
t/fastgenbank.t
mjy/psy
de4840b00c8e1d7b5d8bc3534268ad03f6bd7d27
[ "MIT" ]
null
null
null
use Test::Simple tests => 5; use strict; use warnings; use lib('lib'); use Psy::Helpers::Fastgenbank; ok(my $o = Psy::Helpers::Fastgenbank->new('-infile' => 't/in/t/sequences.gb' ), 'made new, loaded file'); my @foo = $o->loopTer; ok( $#foo > 0, ' read some records'); ok($o->out_unBoundMx('-outfile' => 't/out/out.fas'), 'call out_unBoundMx'); ok($o->found('DQ022280') == 1, 'found a sequence'); ok($o->found('FOOBALISHOUS') == 0, 'did not find a sequence');
25.888889
105
0.630901
ed6937688da5f630f105b500b35217aa570290bd
3,785
pl
Perl
bin/merge_stocks.pl
labroo2/sgn
c8a1a10e4ac2104d82c5fd2d986f1688d01b20be
[ "MIT" ]
39
2015-02-03T15:47:55.000Z
2022-03-23T13:34:05.000Z
bin/merge_stocks.pl
labroo2/sgn
c8a1a10e4ac2104d82c5fd2d986f1688d01b20be
[ "MIT" ]
2,491
2015-01-07T05:49:17.000Z
2022-03-31T15:31:05.000Z
bin/merge_stocks.pl
labroo2/sgn
c8a1a10e4ac2104d82c5fd2d986f1688d01b20be
[ "MIT" ]
20
2015-06-30T19:10:09.000Z
2022-03-23T13:34:09.000Z
=head1 NAME merge_stocks.pl - merge stocks using a file with stocks to merge =head1 DESCRIPTION merge_stocks.pl -H [database host] -D [database name] [ -x ] mergefile.txt Options: -H the database host -D the database name -x flag; if present, delete the empty remaining accession mergefile.txt: A tab-separated file with two columns. Include the following header as the first line: bad name good name All the metadata of bad name will be transferred to good name. If -x is used, stock with name bad name will be deleted. =head1 AUTHOR Lukas Mueller <lam87@cornell.edu> =cut use strict; use Getopt::Std; use CXGN::DB::InsertDBH; use CXGN::DB::Schemas; use CXGN::Stock; our($opt_H, $opt_D, $opt_x); getopts('H:D:x'); print "Password for $opt_H / $opt_D: \n"; my $pw = (<STDIN>); chomp($pw); my $delete_merged_stock = $opt_x; print STDERR "Note: -x: Deleting stocks that have been merged into other stocks.\n"; print STDERR "Connecting to database...\n"; my $dsn = 'dbi:Pg:database='.$opt_D.";host=".$opt_H.";port=5432"; my $dbh = DBI->connect($dsn, "postgres", $pw, { AutoCommit => 0, RaiseError=>1 }); print STDERR "Connecting to DBI schema...\n"; my $bcs_schema = Bio::Chado::Schema->connect($dsn, "postgres", $pw); my $s = CXGN::DB::Schemas->new({ dbh => $dbh }); my $schema = $s->bcs_schema(); my $file = shift; open(my $F, "<", $file) || die "Can't open file $file.\n"; my $header = <$F>; my @merged_stocks_to_delete = (); print STDERR "Skipping header line $header\n"; eval { while (<$F>) { print STDERR "Read line: $_\n"; chomp; my ($merge_stock_name, $good_stock_name) = split /\t/; print STDERR "bad name: $merge_stock_name, good name: $good_stock_name\n"; # for now, only allow accessions to be merged! my $accession_type_id = SGN::Model::Cvterm->get_cvterm_row($schema, 'accession', 'stock_type')->cvterm_id(); print STDERR "Working with accession type id of $accession_type_id...\n"; my $stock_row = $schema->resultset("Stock::Stock")->find( { uniquename => $good_stock_name, type_id=>$accession_type_id } ); if (!$stock_row) { print STDERR "Stock $good_stock_name (of type accession) not found. Skipping...\n"; next(); } my $merge_row = $schema->resultset("Stock::Stock")->find( { uniquename => $merge_stock_name, type_id => $accession_type_id } ); if (!$merge_row) { print STDERR "Stock $merge_stock_name (of type accession) not available for merging. Skipping\n"; next(); } my $good_stock = CXGN::Stock->new( { schema => $schema, stock_id => $stock_row->stock_id }); my $merge_stock = CXGN::Stock->new( { schema => $schema, stock_id => $merge_row->stock_id }); print STDERR "Merging stock $merge_stock_name into $good_stock_name... "; $good_stock->merge($merge_stock->stock_id()); if ($delete_merged_stock) { push @merged_stocks_to_delete, $merge_stock->stock_id(); } print STDERR "Done.\n"; } if ($delete_merged_stock) { print STDERR "Delete merged stocks ( -x option)...\n"; foreach my $remove_stock_id (@merged_stocks_to_delete) { my $q = "delete from phenome.stock_owner where stock_id=?"; my $h = $dbh->prepare($q); $h->execute($remove_stock_id); $q = "delete from phenome.stock_image where stock_id=?"; $h = $dbh->prepare($q); $h->execute($remove_stock_id); my $row = $schema->resultset('Stock::Stock')->find( { stock_id => $remove_stock_id }); print STDERR "Deleting stock ".$row->uniquename." (id=$remove_stock_id)\n"; $row->delete(); } print STDERR "Done with deletions.\n"; } }; if ($@) { print STDERR "An ERROR occurred ($@). Rolling back changes...\n"; $dbh->rollback(); } else { print STDERR "Script is done. Committing... "; $dbh->commit(); print STDERR "Done.\n"; }
28.458647
129
0.664993
ede747193201b68c88de7a20315b13332d2ca975
7,580
pm
Perl
PostGAP.pm
HaoxiangLin/VEP_plugins
6aded535ed3a7f1a92c3056d03e30bd578392a24
[ "Apache-2.0" ]
1
2019-05-22T07:21:09.000Z
2019-05-22T07:21:09.000Z
PostGAP.pm
HaoxiangLin/VEP_plugins
6aded535ed3a7f1a92c3056d03e30bd578392a24
[ "Apache-2.0" ]
null
null
null
PostGAP.pm
HaoxiangLin/VEP_plugins
6aded535ed3a7f1a92c3056d03e30bd578392a24
[ "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 https://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 <https://www.ensembl.org/Help/Contact>. =cut =head1 NAME PostGAP - Ensembl Post-GWAS analysis pipeline (PostGAP) - Add PostGAP data fields to the VEP output =head1 SYNOPSIS mv PostGAP.pm ~/.vep/Plugins ./vep -i variations.vcf --plugin PostGAP,/path/to/PostGap.gz,col1,col2 =head1 DESCRIPTION A VEP plugin that retrieves data for variants from a tabix-indexed PostGAP file. Please refer to the PostGAP github and wiki for more information: https://github.com/Ensembl/postgap https://github.com/Ensembl/postgap/wiki https://github.com/Ensembl/postgap/wiki/algorithm-pseudo-code The Bio::DB::HTS perl library or tabix utility must be installed in your path to use this plugin. The PostGAP data file can be downloaded from https://storage.googleapis.com/postgap-data. The file must be processed and indexed by tabix before use by this plugin. PostGAP has coordinates for both GRCh38 and GRCh37; the file must be processed differently according to the assembly you use. > wget https://storage.googleapis.com/postgap-data/postgap.txt.gz > gunzip postgap.txt.gz # GRCh38 > (grep ^"ld_snp_rsID" postgap.txt; grep -v ^"ld_snp_rsID" postgap.txt | sort -k4,4 -k5,5n ) | bgzip > postgap_GRCh38.txt.gz > tabix -s 4 -b 5 -e 5 -c l postgap_GRCh38.txt.gz # GRCh37 > (grep ^"ld_snp_rsID" postgap.txt; grep -v ^"ld_snp_rsID" postgap.txt | sort -k2,2 -k3,3n ) | bgzip > postgap_GRCh37.txt.gz > tabix -s 2 -b 3 -e 3 -c l postgap_GRCh37.txt.gz Note that in the last command we tell tabix that the header line starts with "l"; this may change to the default of "#" in future versions of PostGAP. When running the plugin by default 'disease_efo_id', 'disease_name', 'gene_id' and 'score' information is returned e.g. --plugin POSTGAP,/path/to/PostGap.gz You may include all columns with ALL; this fetches a large amount of data per variant!: --plugin POSTGAP,/path/to/PostGap.gz,ALL You may want to select only a specific subset of additional information to be reported, you can do this by specifying the columns as parameters to the plugin e.g. --plugin POSTGAP,/path/to/PostGap.gz,gwas_pmid,gwas_size If a requested column is not found, the error message will report the complete list of available columns in the POSTGAP file. For a brief description of the available information please refer to the 'How do I use POSTGAP output?' section in the POSTGAP wiki. Tabix also allows the data file to be hosted on a remote server. This plugin is fully compatible with such a setup - simply use the URL of the remote file: --plugin PostGAP,http://my.files.com/postgap.txt.gz Note that gene sequences referred to in PostGAP may be out of sync with those in the latest release of Ensembl; this may lead to discrepancies with scores retrieved from other sources. =cut package PostGAP; use strict; use warnings; use Bio::EnsEMBL::Variation::Utils::BaseVepTabixPlugin; use base qw(Bio::EnsEMBL::Variation::Utils::BaseVepTabixPlugin); my @fields_order; my $out_txt = 1; my $out_vcf = 0; my $out_json = 0; my $char_sep = "|"; sub new { my $class = shift; my $self = $class->SUPER::new(@_); $self->expand_left(0); $self->expand_right(0); my $params_hash = $self->params_to_hash(); # get PostGAP file my $file = $self->params->[0]; $self->add_file($file); # get output format $out_vcf = 1 if ($self->{config}->{output_format} eq "vcf"); $out_json = 1 if ($self->{config}->{output_format} eq "json"); $out_txt = 0 if ($out_vcf || $out_json); $char_sep = "+" if $out_vcf; # get headers open HEAD, "tabix -fh $file 1:1-1 2>&1 | "; while(<HEAD>) { chomp; $self->{headers} = [split]; } close HEAD; die "ERROR: Could not read headers from $file\n" unless defined($self->{headers}) && scalar @{$self->{headers}}; my $nDefaultColumns = 4; # get required columns my $all =0; my $i = 1; while(defined($self->params->[$i])) { my $col = $self->params->[$i]; if($col eq 'ALL') { $i = $nDefaultColumns + 1; $self->{cols} = {map {$_ => $i++} grep {!defined($self->{cols}->{$_})} #only the extra columns @{$self->{headers}}}; last; #if ALL is used, then the loop will exit after all existing header elements have been selected } die "ERROR: Column $col not found in header for file $file. Available columns are:\n".join(",", @{$self->{headers}})."\n" unless grep {$_ eq $col} @{$self->{headers}}; $self->{cols}->{$self->params->[$i]} = $nDefaultColumns + $i; $i++; } $i += $nDefaultColumns; #ensure that $i is higher than the number of selected columns #default columns always reported $self->{cols}->{'disease_efo_id'} = 1; $self->{cols}->{'disease_name'} = 2; $self->{cols}->{'gene_id'} = 3; $self->{cols}->{'score'} = 4; # get the order of the output fields into an array, $i is the total number of columns +1 @fields_order = map { $_ } sort { (defined($self->{cols}->{$a}) ? $self->{cols}->{$a} : $i) <=> (defined($self->{cols}->{$b}) ? $self->{cols}->{$b} : $i) || $a cmp $b } keys %{$self->{cols}}; return $self; } sub feature_types { return ['Feature','Intergenic']; } sub get_header_info { my $self = shift; my $header = 'PostGAP data for variation - phenotype association. Format: '; $header .= join($char_sep, @fields_order ); return { PostGAP => $header, } } sub run { my $self = shift; my $tva = shift; my $vf = $tva->variation_feature; # adjust coords for tabix my ($start, $end) = ($vf->{start} - 1, $vf->{end}); my $data = $self->get_data($vf->{chr}, $start, $end); return {} unless $data && scalar @$data; my @result =(); my %result_uniq; my @result_str = (); foreach my $tmp_data(@{$data}) { # get required data my %tmp_return = map {$_ => $tmp_data->{$_}} grep {defined($self->{cols}->{$_})} # only include selected cols keys %$tmp_data; # get only 3 significant digits $tmp_return{score} = sprintf("%.3f", $tmp_return{score}) if defined $tmp_return{score}; # report only unique set of fields my $record_line = join(",", values %tmp_return); next if defined $result_uniq{$record_line}; $result_uniq{$record_line} = 1; push(@result_str, join($char_sep, @tmp_return{@fields_order})); push(@result, \%tmp_return); } return { PostGAP => $self->{config}->{output_format} eq "json" ? \@result : \@result_str } } sub parse_data { my ($self, $line) = @_; my @split = split /\t/, $line; # parse data into hash of col names and values my %data = map {$self->{headers}->[$_] => $split[$_]} (0..(scalar @{$self->{headers}} - 1)); return \%data; } 1;
29.960474
171
0.677309
eded15769144906112f8f79297e3661151be6d6d
127
t
Perl
frontend/_templates/page/new/zformat.ejs.t
tezlopchan/whoowesme
385df64fec1c63dc99defc106bf0924ca68937b5
[ "MIT" ]
26
2019-10-16T17:27:51.000Z
2022-02-25T11:20:20.000Z
frontend/_templates/page/new/zformat.ejs.t
tezlopchan/whoowesme
385df64fec1c63dc99defc106bf0924ca68937b5
[ "MIT" ]
108
2019-10-10T04:36:36.000Z
2022-03-29T11:39:17.000Z
frontend/_templates/page/new/zformat.ejs.t
tezlopchan/whoowesme
385df64fec1c63dc99defc106bf0924ca68937b5
[ "MIT" ]
7
2019-10-10T10:59:31.000Z
2022-03-11T21:51:28.000Z
--- to: null sh: eslint_d --fix \src/App.tsx \src/Pages/index.ts \src/Pages/<%= h.changeCase.pascalCase(name) %>.tsx ---
15.875
53
0.622047
ede69b6fb99052a9e988f497ba5f8b10f5f3105d
2,661
pm
Perl
src/Perl6/Metamodel/BUILDPLAN.pm
kazcw/rakudo
f3c3feb3e962635e6a56f30d95443a7d9daccf5d
[ "Artistic-2.0" ]
null
null
null
src/Perl6/Metamodel/BUILDPLAN.pm
kazcw/rakudo
f3c3feb3e962635e6a56f30d95443a7d9daccf5d
[ "Artistic-2.0" ]
null
null
null
src/Perl6/Metamodel/BUILDPLAN.pm
kazcw/rakudo
f3c3feb3e962635e6a56f30d95443a7d9daccf5d
[ "Artistic-2.0" ]
null
null
null
role Perl6::Metamodel::BUILDPLAN { has @!BUILDALLPLAN; has @!BUILDPLAN; # Creates the plan for building up the object. This works # out what we'll need to do up front, so we can just zip # through the "todo list" each time we need to make an object. # The plan is an array of arrays. The first element of each # nested array is an "op" representing the task to perform: # 0 code = call specified BUILD method # 1 class name attr_name = try to find initialization value # 2 class name attr_name = try to find initialization value, or set nqp::list() # 3 class name attr_name = try to find initialization value, or set nqp::hash() # 4 class attr_name code = call default value closure if needed method create_BUILDPLAN($obj) { # First, we'll create the build plan for just this class. my @plan; my @attrs := $obj.HOW.attributes($obj, :local(1)); # Does it have its own BUILD? my $build := $obj.HOW.find_method($obj, 'BUILD', :no_fallback(1)); if !nqp::isnull($build) && $build { # We'll call the custom one. @plan[+@plan] := [0, $build]; } else { # No custom BUILD. Rather than having an actual BUILD # in Mu, we produce ops here per attribute that may # need initializing. for @attrs { if $_.has_accessor { my $attr_name := $_.name; my $name := nqp::substr($attr_name, 2); @plan[+@plan] := [1, $obj, $name, $attr_name]; } } } # Check if there's any default values to put in place. for @attrs { if nqp::can($_, 'build') { my $default := $_.build; if !nqp::isnull($default) && $default { @plan[+@plan] := [4, $obj, $_.name, $default]; } } } # Install plan for this class. @!BUILDPLAN := @plan; # Now create the full plan by getting the MRO, and working from # least derived to most derived, copying the plans. my @all_plan; my @mro := self.mro($obj); my $i := +@mro; while $i > 0 { $i := $i - 1; my $class := @mro[$i]; for $class.HOW.BUILDPLAN($class) { nqp::push(@all_plan, $_); } } @!BUILDALLPLAN := @all_plan; } method BUILDPLAN($obj) { @!BUILDPLAN } method BUILDALLPLAN($obj) { @!BUILDALLPLAN } }
35.48
85
0.511086
edd9acd85b6c8a7344fc6a6a10ca1d2cba3b3986
282
pl
Perl
sub-projects/fork_test/proctable.pl
Devils-Knight/mycpan-indexer
d4ecb45a17edd938dd8b652bbcbf22246fe96b88
[ "Artistic-2.0" ]
1
2016-05-08T12:59:59.000Z
2016-05-08T12:59:59.000Z
sub-projects/fork_test/proctable.pl
Devils-Knight/mycpan-indexer
d4ecb45a17edd938dd8b652bbcbf22246fe96b88
[ "Artistic-2.0" ]
2
2015-03-09T16:19:00.000Z
2021-07-07T21:53:17.000Z
sub-projects/fork_test/proctable.pl
Devils-Knight/mycpan-indexer
d4ecb45a17edd938dd8b652bbcbf22246fe96b88
[ "Artistic-2.0" ]
7
2015-02-16T14:47:22.000Z
2022-03-13T15:53:45.000Z
use Proc::ProcessTable; $t = new Proc::ProcessTable; foreach $p (@{$t->table}) { next unless $p->{uid} == $< && $p->{ppid} == 1; printf "%6d %6d %s\n", map { $p->{$_} } qw( pid ppid cmndline ); kill 9, $p->{pid} unless $p->{cmndline} =~ /launch|ssh|webdav|Spotlight/; }
21.692308
74
0.549645
ed7e34b26dc7120657bc95a2f5a923263580f654
5,995
pm
Perl
LD.pm
guillermomarco/vep_plugins
c800fca955ac846c49f7b72fecb37322121baa49
[ "Apache-2.0" ]
null
null
null
LD.pm
guillermomarco/vep_plugins
c800fca955ac846c49f7b72fecb37322121baa49
[ "Apache-2.0" ]
null
null
null
LD.pm
guillermomarco/vep_plugins
c800fca955ac846c49f7b72fecb37322121baa49
[ "Apache-2.0" ]
null
null
null
=head1 LICENSE Copyright [1999-2015] 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. =head1 CONTACT Graham Ritchie <grsr@ebi.ac.uk> =cut =head1 NAME LD =head1 SYNOPSIS mv LD.pm ~/.vep/Plugins perl variant_effect_predictor.pl -i variations.vcf --plugin LD,1000GENOMES:pilot_1_CEU_low_coverage_panel,0.8 =head1 DESCRIPTION This is a plugin for the Ensembl Variant Effect Predictor (VEP) that finds variants in linkage disequilibrium with any overlapping existing variants from the Ensembl variation databases. You can configure the population used to calculate the r2 value, and the r2 cutoff used by passing arguments to the plugin via the VEP command line (separated by commas). This plugin adds a single new entry to the Extra column with a comma-separated list of linked variant IDs and the associated r2 values, e.g.: LinkedVariants=rs123:0.879,rs234:0.943 If no arguments are supplied, the default population used is the CEU sample (60 unrelated individuals) from the 1000 Genomes Project pilot 1 low coverage study, and the default r2 cutoff used is 0.8. WARNING: Calculating LD is a relatively slow procedure, so this will slow the VEP down considerably when running on large numbers of variants. Consider using a filter plugin to limit the analysis to 'interesting' variants first. You can do this by supplying a filter plugin as an argument to the VEP before this one, e.g.: perl variant_effect_predictor.pl -i variations.vcf --plugin MyFilter --plugin LD =cut package LD; use strict; use warnings; use Bio::EnsEMBL::Registry; use base qw(Bio::EnsEMBL::Variation::Utils::BaseVepPlugin); sub version { return '2.3'; } sub feature_types { return ['Transcript', 'RegulatoryFeature', 'MotifFeature']; } sub get_header_info { my $self = shift; return { LinkedVariants => "Variants in LD (r2 >= ".$self->{r2_cutoff}. ") with overlapping existing variants from the ". $self->{pop}->name." population", }; } sub new { my $class = shift; my $self = $class->SUPER::new(@_); if ($self->config->{cache}) { warn "Warning: a connection to the database is required to calculate LD\n"; } my $reg = 'Bio::EnsEMBL::Registry'; # turn on the check for existing variants $self->config->{check_existing} = 1; # fetch our population my ($pop_name, $r2_cutoff) = @{ $self->params }; # set some defaults $pop_name ||= '1000GENOMES:pilot_1_CEU_low_coverage_panel'; $r2_cutoff = 0.8 unless defined $r2_cutoff; my $pop_adap = $reg->get_adaptor('human', 'variation', 'population') || die "Failed to get population adaptor\n"; my $pop = $pop_adap->fetch_by_name($pop_name) || die "Failed to fetch population for name '$pop_name'\n"; $self->{pop} = $pop; $self->{r2_cutoff} = $r2_cutoff; # prefetch the necessary adaptors my $ld_adap = $reg->get_adaptor('human', 'variation', 'ldfeaturecontainer') || die "Failed to get LD adaptor\n"; my $var_adap = $reg->get_adaptor('human', 'variation', 'variation') || die "Failed to get variation adaptor\n"; my $var_feat_adap = $reg->get_adaptor('human', 'variation', 'variationfeature') || die "Failed to get variation feature adaptor\n"; $self->{ld_adap} = $ld_adap; $self->{var_adap} = $var_adap; $self->{var_feat_adap} = $var_feat_adap; return $self; } sub run { my ($self, $vfoa, $line_hash) = @_; # fetch the existing variants from the line hash my @vars = split ',', $line_hash->{Existing_variation}; my @linked; for my $var (@vars) { # fetch a variation for each overlapping variant ID if (my $v = $self->{var_adap}->fetch_by_name($var)) { # and fetch the associated variation features for my $vf (@{ $self->{var_feat_adap}->fetch_all_by_Variation($v) }) { # we're only interested in variation features that overlap our variant if ($vf->slice->name eq $vfoa->variation_feature->slice->name) { # fetch an LD feature container for this variation feature and our preconfigured population if (my $ldfc = $self->{ld_adap}->fetch_by_VariationFeature($vf, $self->{pop})) { # loop over all the linked variants for my $result (@{ $ldfc->get_all_r_square_values }) { # apply our r2 cutoff if ($result->{r2} >= $self->{r2_cutoff}) { my $v1 = $result->{variation1}; my $v2 = $result->{variation2}; # I'm not sure which of these are the query variant, so just check the names my $linked = $v1->variation_name eq $var ? $v2 : $v1; push @linked, sprintf("%s:%.3f", $linked->variation_name, $result->{r2}); } } } } } } } # concatenate all our linked variants together my $results = join ',', @linked; return $results ? {LinkedVariants => $results} : {}; } 1;
30.125628
111
0.62035
ed818a6a2576eb9d07f0b429e2d4e7a5bc35fc3b
3,279
pm
Perl
lib/Data/ICal/Entry/TimeZone/Daylight.pm
bestpractical/data-ical
a5b68e8a2840eaa71231d5bdc9239e7bf1618a44
[ "Unlicense" ]
3
2016-05-09T11:05:59.000Z
2020-11-07T04:15:41.000Z
lib/Data/ICal/Entry/TimeZone/Daylight.pm
bestpractical/data-ical
a5b68e8a2840eaa71231d5bdc9239e7bf1618a44
[ "Unlicense" ]
2
2020-01-02T19:00:15.000Z
2021-02-18T21:13:24.000Z
lib/Data/ICal/Entry/TimeZone/Daylight.pm
bestpractical/data-ical
a5b68e8a2840eaa71231d5bdc9239e7bf1618a44
[ "Unlicense" ]
3
2017-02-11T11:08:53.000Z
2020-01-02T16:32:32.000Z
use warnings; use strict; package Data::ICal::Entry::TimeZone::Daylight; use base qw/Data::ICal::Entry/; =head1 NAME Data::ICal::Entry::TimeZone::Daylight - Represents a Daylight Time base offset from UTC for parent TimeZone =head1 DESCRIPTION A time zone is unambiguously defined by the set of time measurement rules determined by the governing body for a given geographic area. These rules describe at a minimum the base offset from UTC for the time zone, often referred to as the Standard Time offset. Many locations adjust their Standard Time forward or backward by one hour, in order to accommodate seasonal changes in number of daylight hours, often referred to as Daylight Saving Time. Some locations adjust their time by a fraction of an hour. Standard Time is also known as Winter Time. Daylight Saving Time is also known as Advanced Time, Summer Time, or Legal Time in certain countries. The following table shows the changes in time zone rules in effect for New York City starting from 1967. Each line represents a description or rule for a particular observance. Effective Observance Rule Date (Date/Time) Offset Abbreviation 1967-* last Sun in Oct, 02:00 -0500 EST 1967-1973 last Sun in Apr, 02:00 -0400 EDT 1974-1974 Jan 6, 02:00 -0400 EDT 1975-1975 Feb 23, 02:00 -0400 EDT 1976-1986 last Sun in Apr, 02:00 -0400 EDT 1987-* first Sun in Apr, 02:00 -0400 EDT Note: The specification of a global time zone registry is not addressed by this document and is left for future study. However, implementers may find the Olson time zone database [TZ] a useful reference. It is an informal, public-domain collection of time zone information, which is currently being maintained by volunteer Internet participants, and is used in several operating systems. This database contains current and historical time zone information for a wide variety of locations around the globe; it provides a time zone identifier for every unique time zone rule set in actual use since 1970, with historical data going back to the introduction of standard time. =head1 METHODS =cut =head2 ical_entry_type Returns C<DAYLIGHT>, its iCalendar entry name. =cut sub ical_entry_type {'DAYLIGHT'} =head2 mandatory_unique_properties According to the iCalendar standard, the following properties must be specified exactly one time in a daylight declaration: dtstart tzoffsetto tzoffsetfrom =cut sub mandatory_unique_properties { qw( dtstart tzoffsetto tzoffsetfrom ); } =head2 optional_repeatable_properties According to the iCalendar standard, the following properties may be specified any number of times for a daylight declaration: comment rdate rrule tzname =cut sub optional_repeatable_properties { qw( comment rdate rrule tzname ); } =head1 AUTHOR Best Practical Solutions, LLC E<lt>modules@bestpractical.comE<gt> =head1 LICENCE AND COPYRIGHT Copyright (c) 2005 - 2020, Best Practical Solutions, LLC. All rights reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See L<perlartistic>. =cut 1;
28.025641
107
0.745349
edb454e183b54f02eb6552fbb863cf8cedede394
4,769
t
Perl
t/server-tests/locations_to_dna_sequences.t
qzzhang/kb_seed
1e596a752e68c44ea7320f6aa32b98aea1e8466a
[ "MIT" ]
2
2015-02-12T21:31:33.000Z
2017-08-11T08:07:21.000Z
t/server-tests/locations_to_dna_sequences.t
qzzhang/kb_seed
1e596a752e68c44ea7320f6aa32b98aea1e8466a
[ "MIT" ]
1
2019-02-15T20:05:44.000Z
2019-02-15T20:05:44.000Z
t/server-tests/locations_to_dna_sequences.t
qzzhang/kb_seed
1e596a752e68c44ea7320f6aa32b98aea1e8466a
[ "MIT" ]
6
2016-04-15T22:40:49.000Z
2020-07-01T18:07:41.000Z
#!/usr/bin/env perl #update 11/29/2012 - landml use strict; use warnings; use Test::More; #use CDMI_APIClient; #use CDMI_EntityAPIClient; use Bio::KBase::CDMI::Client; use lib "t/server-tests"; use CDMITestConfig qw(getHost getPort); ############ # # CONFIGURE THESE # #my $url = 'http://140.221.92.46:5000'; my $test_method = 'locations_to_dna_sequences'; my @additional_args = ( [], ); #ANYTHING EXTRA TO GIVE YOUR TEST METHOD #GIVE IT A LIST OF ARRAYREFS. EACH SUB ARRAYREF IS A SET OF ARGS TO TRY WITH #my $cdmi = CDMI_APIClient->new($url); #my $cdmie = CDMI_EntityAPIClient->new($url); # MAKE A CONNECTION (DETERMINE THE URL TO USE BASED ON THE CONFIG MODULE) my $host=getHost(); my $port=getPort(); print "-> attempting to connect to:'".$host.":".$port."'\n"; my $cdmi = Bio::KBase::CDMI::Client->new($host.":".$port); my $cdmie= Bio::KBase::CDMI::Client->new($host.":".$port); # # CONFIGURE THIS TO LOAD YOUR DATA # my $all_available_data = $cdmie->all_entities_Genome(0,100,['id', 'domain']); my $all_locations = {}; foreach my $key (keys %$all_available_data) { if ($all_available_data->{$key}->{'domain'} ne 'Eukaryota') { next; } my $fids = $cdmi->genomes_to_fids([$key], []); my $throttle = 0; foreach my $fid (@{$fids->{$key}}) { my $locations = $cdmi->fids_to_locations([$fid]); foreach my $key (keys %$locations) { my $val = $locations->{$key}->[0]; $all_locations->{$key} = [$val]; } last if $throttle++ > 10; } } $all_available_data = $all_locations; my @random_subset = (); my @all_available_keys = keys %$all_available_data; my $num_sample = int rand(@all_available_keys); for (0..$num_sample) { push @random_subset, $all_available_data->{ $all_available_keys[int rand @all_available_keys] }; } # # SAMPLE DATA IS OPTIONAL # my $sample_data = [ {'id' => [ [ 'kb|g.1087.c.0', '2111515', '+', '76' ]] , 'expected' => [ [ [ [ 'kb|g.1087.c.0', '2111515', '+', '76' ] ], 'tcctctgtagttcagtcggtagaacggcggactgttaatccgtatgtcactggttcgagtccagtcagaggagcca' ] ]}, ]; # # # ############ my @args_count = @additional_args || 1; plan('tests' => 4 * (scalar keys %$all_available_data) * @args_count + 2 * @$sample_data * @args_count + 1 * @random_subset * @args_count + 5 * @args_count); foreach my $fid (keys %$all_available_data) { my $location = $all_available_data->{$fid}; my $dna_seqs = $cdmi->$test_method([$location]); is(@$dna_seqs, 1, "Just one set of DNA sequences"); is(@{$dna_seqs->[0]}, 2, "Properly sized DNA Sequences"); is_deeply($dna_seqs->[0]->[0], $location, "Location returned"); ok(length $dna_seqs->[0]->[1], "Has dna string"); } foreach my $sample (@$sample_data) { foreach my $args (@additional_args) { ok($sample->{'id'}, "Found known sample $sample->{'id'}"); my $results = $cdmi->$test_method( [ $sample->{'id'} ], @$args ); my $expectations_key = @$args ? $args : 'expected'; is_deeply($results, $sample->{$expectations_key}, "Results match expectations"); } } #give it a few at once. foreach my $args (@additional_args) { my $results = $cdmi->$test_method(\@random_subset, @$args); my $idx = 0; foreach my $datum (@random_subset) { my $single_results = $cdmi->$test_method( [ $datum ], @$args ); is_deeply($single_results->[0], $results->[$idx], "Multi-results matches single results for $datum"); $idx++; } } foreach my $args (@additional_args) { #ok. Now let's try to break it with invalid data. eval {$cdmi->$test_method}; ok($@, "Must give $test_method an arrayref (not scalar) with @$args"); eval {$cdmi->$test_method($sample_data->[0]->{'id'}, $sample_data->[1]->{'id'}, @$args)}; ok($@, "Must give $test_method an arrayref (not array) with @$args"); eval {$cdmi->$test_method('genome' => $sample_data->[0]->{'id'}, @$args)}; ok($@, "Must give $test_method an arrayref (not hash) with @$args"); eval {$cdmi->$test_method({'genome' => $sample_data->[0]->{'id'}}, @$args)}; ok($@, "Must give $test_method an arrayref (not hashref) with @$args"); is(@{$cdmi->$test_method([], @$args)}, 0, "$test_method w/empty arrayref returns empty hashref with @$args"); my $invalid_id = 'q38 exploding space modulator'; }
30.183544
113
0.561963
ed94c38341bcc0c6c1ac90070db5315680d519b6
3,491
pl
Perl
misc-scripts/db/search_dbs.pl
JAlvarezJarreta/ensembl
1af1dce3518d6af00df04983993deefa01ec2276
[ "Apache-2.0" ]
49
2015-01-14T14:03:30.000Z
2022-03-17T22:54:52.000Z
misc-scripts/db/search_dbs.pl
JAlvarezJarreta/ensembl
1af1dce3518d6af00df04983993deefa01ec2276
[ "Apache-2.0" ]
489
2015-01-14T14:53:47.000Z
2022-03-29T18:30:48.000Z
misc-scripts/db/search_dbs.pl
JAlvarezJarreta/ensembl
1af1dce3518d6af00df04983993deefa01ec2276
[ "Apache-2.0" ]
115
2015-01-14T14:31:42.000Z
2022-03-15T16:24:38.000Z
#!/usr/bin/env perl # 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. # this script will lokk through all listed databases for # database names which match given regexp. # This version should be ok if one or more of the given database # servers is not available. use strict; use warnings; use DBI; # seconds before we give up on database my $timeout = 5; my @all_locators = qw { genebuild1:3306:ensro:: genebuild2:3306:ensro:: genebuild3:3306:ensro:: genebuild4:3306:ensro:: genebuild5:3306:ensro:: genebuild6:3306:ensro:: genebuild6:3307:ensro:: compara1:3306:ensro:: compara2:3306:ensro:: compara3:3306:ensro:: mart1:3306:ensro:: mart2:3306:ensro:: ens-genomics1:3306:ensro:: ens-genomics2:3306:ensro:: ens-research:3306:ensro:: ens-research:3309:ensro:: ensdb-1-11:3319:ensro:: ensdb-1-11:3317:ensro:: ens-staging:3306:ensro:: ens-livemirror:3306:ensro:: }; my $pattern=shift; my $size = 0; my %sizes; if( @ARGV ) { $size = 1; } if( !$pattern ) { printf( "You need to supply a regexp as argument.\n" ); printf( "Use -list if you want to see which databases are configured.\n" ); printf( "If you have any parameters after the regexp, the program will print\n" ); printf( " database sizes as well.\n" ); printf( "\nExample: search_dbs.pl \"^stabenau\" -sizes | sort -knr3\n" ); exit; } my $list = 0; if( $pattern eq "-list" ) { $list = 1; } for my $loc ( @all_locators ) { my @elems = split( ":", $loc ); my @dbnames = (); %sizes = (); my $dsn = sprintf( "DBI:mysql:host=%s;port=%s", $elems[0], $elems[1] ); $SIG{ALRM} = sub{die("timeout");}; eval { alarm $timeout; my $db = DBI->connect( $dsn, $elems[2], $elems[3], { RaiseError => 1 } ); my $res = $db->selectall_arrayref( "show databases" ); @dbnames = map { $_->[0] } @$res; $db->disconnect(); alarm 0; }; if( !@dbnames ) { print STDERR "$loc NOT OK\n"; } else { if( $size ) { for my $dbname ( @dbnames ) { if( $dbname =~ /$pattern/ ) { eval { alarm $timeout; my $db = DBI->connect( $dsn, $elems[2], $elems[3], { RaiseError => 1, PrintError=> 0 } ); $db->do( "use $dbname" ); my $t_status = $db->selectall_arrayref( "show table status" ); my $size = 0; map { $size += $_->[6]; $size += $_->[8] } @$t_status; print "$loc $dbname $size\n"; $db->disconnect(); alarm 0; }; if( $@ ) { print( "Problem on $loc $dbname.\n ", $@ ); } } } } else { if( $list ) { print STDERR "$loc ok\n"; } else { for my $dbname ( @dbnames ) { if( $dbname =~ /$pattern/ ) { print "$loc $dbname\n"; } } } } } }
25.115108
102
0.597537
edb88ecfed6994e352b3ee299e320f4dfa69afb6
657
pl
Perl
examples/bin/client.pl
hatena/WorkerManager
2f4c4a12776625f0456ae0a3f649b52b35013b86
[ "Artistic-1.0" ]
1
2016-03-29T16:55:14.000Z
2016-03-29T16:55:14.000Z
examples/bin/client.pl
hatena/WorkerManager
2f4c4a12776625f0456ae0a3f649b52b35013b86
[ "Artistic-1.0" ]
15
2015-03-11T06:25:17.000Z
2021-10-18T09:43:53.000Z
examples/bin/client.pl
hatena/WorkerManager
2f4c4a12776625f0456ae0a3f649b52b35013b86
[ "Artistic-1.0" ]
2
2015-05-18T06:06:28.000Z
2015-06-15T07:57:49.000Z
#! /usr/bin/perl use strict; use warnings; use FindBin; use lib File::Spec->catdir($FindBin::Bin, '..', 'lib'); use lib File::Spec->catdir($FindBin::Bin, '..', '..', 'lib'); use WorkerManager::Client::TheSchwartz; use Time::Piece; my $client = WorkerManager::Client::TheSchwartz->new(); $client->insert('Sandbox::Worker::A' => +{foo => localtime->epoch}); $client->insert('Sandbox::Worker::B' => +{foo => localtime->epoch}, {run_after => time, priority => 1}); $client->insert('Sandbox::Worker::B' => +{foo => localtime->epoch}, {run_after => time + 30}); $client->insert('Sandbox::Worker::B' => +{foo => localtime->epoch}, {run_after => time + 60});
32.85
104
0.633181
eddff37a67fc418057e1ae57e12feacb9d0e231f
413
pm
Perl
Mojoqq/perl/lib/Locale/Codes/LangFam_Retired.pm
ghuan/Mojo-webqq-for-windows
ad44014da4578f99aa3efad0b55f0fc3bc3af322
[ "Unlicense" ]
null
null
null
Mojoqq/perl/lib/Locale/Codes/LangFam_Retired.pm
ghuan/Mojo-webqq-for-windows
ad44014da4578f99aa3efad0b55f0fc3bc3af322
[ "Unlicense" ]
null
null
null
Mojoqq/perl/lib/Locale/Codes/LangFam_Retired.pm
ghuan/Mojo-webqq-for-windows
ad44014da4578f99aa3efad0b55f0fc3bc3af322
[ "Unlicense" ]
null
null
null
package # Locale::Codes::LangFam_Retired; # This file was automatically generated. Any changes to this file will # be lost the next time 'deprecate_codes' is run. # Generated on: Tue Sep 27 15:40:31 EDT 2011 use strict; use warnings; require 5.002; our($VERSION); $VERSION='3.38'; $Locale::Codes::Retired{'langfam'}{'alpha'}{'code'} = { }; $Locale::Codes::Retired{'langfam'}{'alpha'}{'name'} = { }; 1;
17.956522
71
0.675545
edef5603d18e64a6d22c4fc2495afb2fe9065cb7
1,313
t
Perl
t/28-race-sboremove.t
yukiisbored/sboports
0427dd02ea182a2bb0757c908ce4000989d9d0d5
[ "WTFPL" ]
null
null
null
t/28-race-sboremove.t
yukiisbored/sboports
0427dd02ea182a2bb0757c908ce4000989d9d0d5
[ "WTFPL" ]
null
null
null
t/28-race-sboremove.t
yukiisbored/sboports
0427dd02ea182a2bb0757c908ce4000989d9d0d5
[ "WTFPL" ]
null
null
null
#!/usr/bin/env perl use strict; use warnings; use Test::More; use Test::Exit; use FindBin '$RealBin'; use lib $RealBin; use Capture::Tiny qw/ capture_merged /; use File::Temp 'tempdir'; use Cwd; use feature 'state'; use Test::Sboports qw/ set_repo set_lo sboinstall sbosnap load /; if ($ENV{TEST_INSTALL}) { plan tests => 2; } else { plan skip_all => 'Only run these tests if TEST_INSTALL=1'; } set_lo("$RealBin/LO2"); # set up git repo with readme slackbuild my $tempdir = tempdir(CLEANUP => 0); capture_merged { system <<"GIT"; }; cd $tempdir git init mkdir test cp -a "$RealBin/LO/nonexistentslackbuild8/" test git add test git commit -m 'first commit' GIT set_repo("file://$tempdir"); sbosnap 'fetch', { test => 0 }; # install the readme slackbuild sboinstall 'nonexistentslackbuild8', { input => "y\ny", test => 0 }; { package STDINTIE; sub TIEHANDLE { bless {}, shift; } sub READLINE { no warnings 'once', 'redefine'; *_race::cond = sub { unlink "/usr/sbo/repo/test/nonexistentslackbuild8/README"; }; "y\n"; } } tie *STDIN, 'STDINTIE'; my $res = load('sboremove', argv => ['nonexistentslackbuild8']); like ($res->{out}, qr/Unable to open README for nonexistentslackbuild8\./, 'sboremove output with race condition correct'); is ($res->{exit}, 0, 'sboremove did not exit in error');
23.446429
123
0.686976
edceeb25203874c893d7740390b8478d0e7b5b42
1,849
pl
Perl
Year3/Sem_1/IntroToAI/Week 5/FWGC (1).pl
Daniel-Tilley/College
42f055662d9de5dcadf09a189eb994c2f0f8dbb1
[ "MIT" ]
null
null
null
Year3/Sem_1/IntroToAI/Week 5/FWGC (1).pl
Daniel-Tilley/College
42f055662d9de5dcadf09a189eb994c2f0f8dbb1
[ "MIT" ]
null
null
null
Year3/Sem_1/IntroToAI/Week 5/FWGC (1).pl
Daniel-Tilley/College
42f055662d9de5dcadf09a189eb994c2f0f8dbb1
[ "MIT" ]
1
2018-11-11T22:32:25.000Z
2018-11-11T22:32:25.000Z
stack(E, S, [E|S]). % | Joins s to e empty_stack([]). go(Start,Goal) :- empty_stack(Empty_been_stack), stack(Start,Empty_been_stack,Been_stack), path(Start,Goal,Been_stack). run:- go(state(w,w,w,w) , state(e,e,e,e)). path(Goal,Goal,Been_stack) :- write('Solution Path Is:' ), nl, reverse_print_stack(Been_stack). path(State,Goal,Been_stack) :- move(State,Next_state), not(member_stack(Next_state,Been_stack)), stack(Next_state,Been_stack,New_been_stack), path(Next_state,Goal,New_been_stack),!. move(state(X,X,G,C), state(Y,Y,G,C)):- opp(X,Y), not(unsafe(state(Y,Y,G,C))). move(state(X,W,X,C), state(Y,W,Y,C)):- opp(X,Y), not(unsafe(state(Y,W,Y,C))). move(state(X,W,G,X), state(Y,W,G,Y)):- opp(X,Y), not(unsafe(state(Y,W,G,Y))). move(state(X,W,G,C), state(Y,W,G,C)):- opp(X,Y), not(unsafe(state(Y,W,G,C))). move(state(F,W,G,C), state(F,W,G,C)):- fail. unsafe(state(X,Y,Y,C)) :- opp(X,Y). unsafe(state(X,W,Y,Y)) :- opp(X,Y). opp(e,w). opp(w,e). reverse_print_stack(S) :- empty_stack(S). % when the stack is empty. reverse_print_stack(S) :- stack(E, Rest, S), reverse_print_stack(Rest), showState(E), nl. % E being current state(X,X,X,X) showState(S) :- showWest(S), write('|~~~~~~~| '), showEast(S),nl, write(' |~~~~~~~| '). showWest(state(F,W,G,C)) :- (F == w, write('F '), !; write(' ')), (W == w, write('W '), !; write(' ')), (G == w, write('G '), !; write(' ')), (C == w, write('C '), !; write(' ')). showEast(state(F,W,G,C)) :- (F == e, write('F '), !; true), (W == e, write('W '), !; true), (G == e, write('G '), !; true), (C == e, write('C '), !; true).
28.446154
73
0.507301
edf45ded2f642c6a502836d36cb3a621c8acca8f
3,987
pl
Perl
src/test/performance/runtests.pl
blankde/Learning-Postgres
ba70e2079efd2372cc02ea9353ce01b710ca71c8
[ "PostgreSQL" ]
2
2019-05-21T07:08:18.000Z
2020-04-12T03:30:10.000Z
src/test/performance/runtests.pl
blankde/Learning-Postgres
ba70e2079efd2372cc02ea9353ce01b710ca71c8
[ "PostgreSQL" ]
1
2016-06-12T12:31:34.000Z
2016-09-03T22:21:21.000Z
src/test/performance/runtests.pl
blankde/Learning-Postgres
ba70e2079efd2372cc02ea9353ce01b710ca71c8
[ "PostgreSQL" ]
null
null
null
#!/usr/bin/perl # # Accepts one argument - DBMS name (pgsql, ...) and initializes # global variable $TestDBMS with this name. # # Where to run tests $DBNAME = 'perftest'; # This describtion for all DBMS supported by test # DBMS_name => [FrontEnd, DestroyDB command, CreateDB command] %DBMS = ( 'pgsql' => ["psql -q -d $DBNAME", "destroydb $DBNAME", "createdb $DBNAME"] ); # Tests to run: test' script, test' description, ... # Test' script is in form # # script_name[.ntm][ T] # # script_name is name of file in ./sqls # .ntm means that script will be used for some initialization # and should not be timed: runtests.pl opens /dev/null as STDERR # in this case and restore STDERR to result file after script done. # Script shouldn't notice either he is running for test or for # initialization purposes. # T means that all queries in this test (initialization ?) are to be # executed in SINGLE transaction. In this case global variable $XACTBLOCK # is not empty string. Otherwise, each query in test is to be executed # in own transaction ($XACTBLOCK is empty string). In accordance with # $XACTBLOCK, script is to do DBMS specific preparation before execution # of queries. (Look at example in sqls/inssimple for MySQL - it gives # an idea of what can be done for features unsupported by an DBMS.) # @perftests = ( # It speed up things 'connection.ntm', 'DB connection startup (no timing)', # Just connection startup time (echo "" | psql ... - for PgSQL) 'connection', 'DB connection startup', 'crtsimple.ntm', 'Create SIMPLE table (no timing)', # 8192 inserts in single xaction 'inssimple T', '8192 INSERTs INTO SIMPLE (1 xact)', 'drpsimple.ntm', 'Drop SIMPLE table (no timing)', 'crtsimple.ntm', 'Create SIMPLE table (no timing)', # 8192 inserts in 8192 xactions 'inssimple', '8192 INSERTs INTO SIMPLE (8192 xacts)', 'vacuum.ntm', 'Vacuum (no timing)', # Fast (after table filled with data) index creation test 'crtsimpleidx', 'Create INDEX on SIMPLE', 'drpsimple.ntm', 'Drop SIMPLE table (no timing)', 'crtsimple.ntm', 'Create SIMPLE table (no timing)', 'crtsimpleidx.ntm', 'Create INDEX on SIMPLE (no timing)', # 8192 inserts in single xaction into table with index 'inssimple T', '8192 INSERTs INTO SIMPLE with INDEX (1 xact)', # 8192 SELECT * FROM simple WHERE justint = <random_key> in single xaction 'slcsimple T', '8192 random INDEX scans on SIMPLE (1 xact)', # SELECT * FROM simple ORDER BY justint 'orbsimple', 'ORDER BY SIMPLE', ); # # It seems that nothing below need to be changed # $TestDBMS = $ARGV[0]; die "Unsupported DBMS $TestDBMS\n" if !exists $DBMS{$TestDBMS}; $FrontEnd = $DBMS{$TestDBMS}[0]; $DestroyDB = $DBMS{$TestDBMS}[1]; $CreateDB = $DBMS{$TestDBMS}[2]; print "(Re)create DataBase $DBNAME\n"; `$DestroyDB`; # Destroy DB `$CreateDB`; # Create DB $ResFile = "Results.$TestDBMS"; $TmpFile = "Tmp.$TestDBMS"; open (SAVEOUT, ">&STDOUT"); open (STDOUT, ">/dev/null") or die; open (SAVEERR, ">&STDERR"); open (STDERR, ">$TmpFile") or die; select (STDERR); $| = 1; for ($i = 0; $i <= $#perftests; $i++) { $test = $perftests[$i]; ($test, $XACTBLOCK) = split (/ /, $test); $runtest = $test; if ( $test =~ /\.ntm/ ) { # # No timing for this queries # close (STDERR); # close $TmpFile open (STDERR, ">/dev/null") or die; $runtest =~ s/\.ntm//; } else { close (STDOUT); open(STDOUT, ">&SAVEOUT"); print STDOUT "\nRunning: $perftests[$i+1] ..."; close (STDOUT); open (STDOUT, ">/dev/null") or die; select (STDERR); $| = 1; printf "$perftests[$i+1]: "; } do "sqls/$runtest"; # Restore STDERR to $TmpFile if ( $test =~ /\.ntm/ ) { close (STDERR); open (STDERR, ">>$TmpFile") or die; } select (STDERR); $| = 1; $i++; } close (STDERR); open(STDERR, ">&SAVEERR"); open (TMPF, "<$TmpFile") or die; open (RESF, ">$ResFile") or die; while (<TMPF>) { $str = $_; ($test, $rtime) = split (/:/, $str); ($tmp, $rtime, $rest) = split (/[ ]+/, $rtime); print RESF "$test: $rtime\n"; }
28.891304
74
0.661901
edfaaac153348cde05a33515666428e676383493
1,283
pm
Perl
lib/Google/Ads/GoogleAds/V4/Enums/CustomerPayPerConversionEligibilityFailureReasonEnum.pm
PierrickVoulet/google-ads-perl
bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4
[ "Apache-2.0" ]
null
null
null
lib/Google/Ads/GoogleAds/V4/Enums/CustomerPayPerConversionEligibilityFailureReasonEnum.pm
PierrickVoulet/google-ads-perl
bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4
[ "Apache-2.0" ]
null
null
null
lib/Google/Ads/GoogleAds/V4/Enums/CustomerPayPerConversionEligibilityFailureReasonEnum.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::V4::Enums::CustomerPayPerConversionEligibilityFailureReasonEnum; use strict; use warnings; use Const::Exporter enums => [ UNSPECIFIED => "UNSPECIFIED", UNKNOWN => "UNKNOWN", NOT_ENOUGH_CONVERSIONS => "NOT_ENOUGH_CONVERSIONS", CONVERSION_LAG_TOO_HIGH => "CONVERSION_LAG_TOO_HIGH", HAS_CAMPAIGN_WITH_SHARED_BUDGET => "HAS_CAMPAIGN_WITH_SHARED_BUDGET", HAS_UPLOAD_CLICKS_CONVERSION => "HAS_UPLOAD_CLICKS_CONVERSION", AVERAGE_DAILY_SPEND_TOO_HIGH => "AVERAGE_DAILY_SPEND_TOO_HIGH", ANALYSIS_NOT_COMPLETE => "ANALYSIS_NOT_COMPLETE", OTHER => "OTHER" ]; 1;
38.878788
96
0.713952
ed09129938994ba4d14a2d2cc769831d5cf8ab01
3,000
al
Perl
ChickenManagement v4 - (posting)/1_Tables/Chicken Journal Line.al
srenders/AL-Demos
aa28f3886d9da005a35cc6272ef80744e7d4670f
[ "MIT" ]
9
2019-01-18T13:00:37.000Z
2021-03-26T02:47:21.000Z
ChickenManagement v4 - (posting)/1_Tables/Chicken Journal Line.al
srenders/AL-Demos
aa28f3886d9da005a35cc6272ef80744e7d4670f
[ "MIT" ]
null
null
null
ChickenManagement v4 - (posting)/1_Tables/Chicken Journal Line.al
srenders/AL-Demos
aa28f3886d9da005a35cc6272ef80744e7d4670f
[ "MIT" ]
11
2018-06-04T21:33:41.000Z
2021-11-23T00:30:07.000Z
table 50127 "Chicken Journal Line" { // version EXT001 fields { field(1;"Journal Template Name";Code[10]) { CaptionML=ENU='Journal Template Name'; } field(2;"Line No.";Integer) { CaptionML=ENU='Line No.'; } field(3;"Chicken No.";Code[20]) { CaptionML=ENU='Chicken No.'; TableRelation=Chicken; } field(4;"Posting Date";Date) { CaptionML=ENU='Posting Date'; trigger OnValidate(); begin VALIDATE("Document Date","Posting Date"); end; } field(5;"Document Date";Date) { CaptionML=ENU='Document Date'; } field(6;"Entry Type";Option) { CaptionML=ENU='Entry Type'; OptionCaptionML=ENU='EggProduction'; OptionMembers=EggProduction; } field(7;"Document No.";Code[20]) { CaptionML=ENU='Document No.'; } field(8;Description;Text[50]) { CaptionML=ENU='Description'; } field(12;Type;Option) { CaptionML=ENU='Type'; OptionCaptionML=ENU='Chicken,"G/L Account"'; OptionMembers=Chicken,"G/L Account"; } field(13;Quantity;Decimal) { CaptionML=ENU='Quantity'; DecimalPlaces=0:5; } field(21;"Starting Date";Date) { CaptionML=ENU='Starting Date'; } field(22;"Egg Production No.";Code[20]) { CaptionML=ENU='Seminar Registration No.'; } field(30;"Source Type";Option) { CaptionML=ENU='Source Type'; OptionCaptionML=ENU='" ",Chicken'; OptionMembers=" ",Chicken; } field(31;"Source No.";Code[20]) { CaptionML=ENU='Source No.'; } field(32;"Journal Batch Name";Code[10]) { CaptionML=ENU='Journal Batch Name'; } field(33;"Source Code";Code[10]) { CaptionML=ENU='Source Code'; Editable=false; TableRelation="Source Code"; } field(34;"Reason Code";Code[10]) { CaptionML=ENU='Reason Code'; TableRelation="Reason Code"; } field(35;"Posting No. Series";Code[10]) { CaptionML=ENU='Posting No. Series'; TableRelation="No. Series"; } field(51;"Shortcut Dimension 1 Code";Code[20]) { CaptionClass='1,2,1'; CaptionML=ENU='Shortcut Dimension 1 Code'; TableRelation="Dimension Value".Code WHERE ("Global Dimension No."=CONST(1)); } field(52;"Shortcut Dimension 2 Code";Code[20]) { CaptionClass='1,2,2'; CaptionML=ENU='Shortcut Dimension 2 Code'; TableRelation="Dimension Value".Code WHERE ("Global Dimension No."=CONST(2)); } field(480;"Dimension Set ID";Integer) { CaptionML=ENU='Dimension Set ID'; Editable=false; TableRelation="Dimension Set Entry"; } } keys { key(Key1;"Journal Template Name","Journal Batch Name","Line No.") { Clustered=true; } } fieldgroups { } PROCEDURE EmptyLine() : Boolean; begin EXIT( ("Chicken No." = '') AND (Quantity = 0)); end; }
21.89781
83
0.578333
edf7140aaeb904b3060303edf4ddcc255b48ac28
55
al
Perl
examples/typecheck/indirect_write.al
XrXr/alang
212f30adae8aa91aabffc2a2624e4f1ced8549bc
[ "MIT" ]
3
2019-01-21T04:15:10.000Z
2019-08-14T08:26:52.000Z
examples/typecheck/indirect_write.al
XrXr/alang
212f30adae8aa91aabffc2a2624e4f1ced8549bc
[ "MIT" ]
null
null
null
examples/typecheck/indirect_write.al
XrXr/alang
212f30adae8aa91aabffc2a2624e4f1ced8549bc
[ "MIT" ]
null
null
null
main :: proc () { a := 50 ap := &a @ap = "sdfsdf" }
9.166667
17
0.4
edceccd390f7d7cf2d22c4b65a0119c6adf3fd86
521
pl
Perl
examples/subscribe.pl
gitpan/PubNub-PubSub
fe279307ea6140dbc0b35884340418d9f8c6cf47
[ "Apache-2.0" ]
null
null
null
examples/subscribe.pl
gitpan/PubNub-PubSub
fe279307ea6140dbc0b35884340418d9f8c6cf47
[ "Apache-2.0" ]
null
null
null
examples/subscribe.pl
gitpan/PubNub-PubSub
fe279307ea6140dbc0b35884340418d9f8c6cf47
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/perl use strict; use warnings; use FindBin qw/$Bin/; use lib "$Bin/../lib"; use PubNub::PubSub; use Data::Dumper; my $pubnub = PubNub::PubSub->new( sub_key => $ENV{PUBNUB_SUB_KEY} || 'sub-c-a66b65f2-2d96-11e4-875c-02ee2ddab7fe', channel => $ENV{PUBNUB_CHANNEL} || 'sandbox', ); $pubnub->subscribe({ callback => sub { my (@messages) = @_; foreach my $msg (@messages) { print "# Got message: $msg\n"; } return 1; # 1 to continue, 0 to stop } }); 1;
20.84
84
0.577735
ed66c2dc91079c60d0513e387675b52722e8d677
7,559
t
Perl
test/t/17_vg_augment.t
fabbondanza/vg
86edd831bd76b4c33e4cf51134f557c49736cf2b
[ "MIT" ]
null
null
null
test/t/17_vg_augment.t
fabbondanza/vg
86edd831bd76b4c33e4cf51134f557c49736cf2b
[ "MIT" ]
null
null
null
test/t/17_vg_augment.t
fabbondanza/vg
86edd831bd76b4c33e4cf51134f557c49736cf2b
[ "MIT" ]
null
null
null
#!/usr/bin/env bash BASH_TAP_ROOT=../deps/bash-tap . ../deps/bash-tap/bash-tap-bootstrap PATH=../bin:$PATH # for vg plan tests 23 vg view -J -v pileup/tiny.json > tiny.vg # Make sure well-supported edits are augmented in vg view -J -a -G pileup/edits.json > edits.gam vg augment -a direct tiny.vg edits.gam -A edits-embedded.gam > augmented.vg # We want 3 edits with no sequence per read, and we have 12 reads in this file. is "$(vg view -aj edits-embedded.gam | jq -c '.path.mapping[].edit[].sequence' | grep null | wc -l)" "36" "direct augmentation embeds reads fully for well-supported SNPs" is "$(vg stats -N augmented.vg)" "18" "adding a well-supported SNP by direct augmentation adds 3 more nodes" # Run again but with packed logic. output should be identical with min threshold of 1 vg augment -a direct tiny.vg edits.gam -A edits-embedded.gam -m 1 > augmented.m1.vg is "$(vg stats -N augmented.m1.vg)" "18" "adding a well-supported SNP by direct augmentation adds 3 more nodes with -m 1" rm -f edits.gam edits-embedded.gam augmented.vg augmented.m1.vg # Make sure every edit is augmented in vg view -J -a -G pileup/edit.json > edit.gam vg augment -a direct tiny.vg edit.gam -A edit-embedded.gam > augmented.vg # This file only has one read. is "$(vg view -aj edit-embedded.gam | jq -c '.path.mapping[].edit[].sequence' | grep null | wc -l)" "3" "direct augmentation embeds reads fully for probable errors" is "$(vg stats -N augmented.vg)" "18" "adding a probable error by direct augmentation adds 3 more nodes" rm -f edit.gam edit-embedded.gam augmented.vg rm -f tiny.vg # These are tests that used to be in 14_vg_mod.t vg construct -m 1000 -r tiny/tiny.fa >t.vg vg index -k 11 -g t.idx.gcsa -x t.idx.xg t.vg is $(vg map -s CAAATAAGGCTTGGAAATTTTCTGGAGTTCTATTATATTCCAACTCTCTG -d t.idx | vg augment t.vg - -i | vg view - | grep ^S | wc -l) 1 "path inclusion does not modify the graph when alignment is a perfect match" is $(vg map -s CAAATAAGGCTTGGAAATTTTCTGGAGTTCTAATATATTCCAACTCTCTG -d t.idx | vg augment t.vg - -i -m 2 | vg view - | grep ^S | wc -l) 1 "path inclusion does not modify the graph when alignment has a SNP but doesnt meet the coverage threshold" is $(vg map -s CAAATAAGGCTTGGAAATTTTCTGGAGTTCTAATATATTCCAACTCTCTG -V read -d t.idx | vg augment t.vg - -i -m 2 -A read_aug.gam | vg view - | grep ^P | awk '{print $4}' | uniq) "50M" "path inclusion does not modify the included path when alignment has a SNP but doesnt meet the coverage threshold" is $(vg view -a read_aug.gam | jq. | grep edit | wc) 1 "output GAM has single edit when SNP was filtered out due to coverage" is $(vg map -s CAAATAAGGCTTGGAAAGGGTTTCTGGAGTTCTATTATATTCCAACTCTCTG -d t.idx | vg augment t.vg - -i | vg view - | grep ^S | wc -l) 5 "path inclusion with a complex variant introduces the right number of nodes" # checks that we get a node with the id 4, which is the ref-matching dual to the deletion is $(vg map -s CAAAAAGGCTTGGAAAGGGTTTCTGGAGTTCTATTATATTCCAACTCTCTG -d t.idx | vg augment t.vg - -i | vg view - | grep ^S | grep 4 | grep T | wc -l) 1 "path inclusion works for deletions" is $(vg map -s CAAATAAGGCTTGGAAATTTTCTGCAGTTCTATTATATTCCAACTCTCTG -d t.idx | vg augment t.vg - -i | vg view - | grep ^S | wc -l) 4 "SNPs can be included in the graph" rm t.vg rm -rf t.idx.xg t.idx.gcsa read_aug.gam vg construct -v tiny/tiny.vcf.gz -r tiny/tiny.fa >t.vg vg align -s GGGGGGGAAATTTTCTGGAGTTCTATTATATTCCAAAAAAAAAA t.vg >t.gam is $(vg augment -i t.vg t.gam | vg view - | grep ^S | grep $(vg augment -i t.vg t.gam | vg stats -H - | awk '{ print $3}') | cut -f 3) GGGGG "a soft clip at read start becomes a new head of the graph" is $(vg augment -i t.vg t.gam | vg view - | grep ^S | grep $(vg augment -i t.vg t.gam | vg stats -T - | awk '{ print $3}') | cut -f 3) AAAAAAAA "a soft clip at read end becomes a new tail of the graph" vg align -s AAATTTTCTGGAGTTCTAT t.vg >> t.gam vg find -x t.vg -n 9 -c 1 > n9.vg vg augment n9.vg t.gam -s -A n9_aug.gam > /dev/null is $(vg view -a n9_aug.gam | wc -l) "1" "augment -s works as desired" rm -rf t.vg t.gam n9.vg n9_aug.gam vg construct -m 1000 -r small/x.fa -v small/x.vcf.gz >x.vg vg index -x x.xg -g x.gcsa -k 16 x.vg vg map -x x.xg -g x.gcsa -G small/x-s1337-n100-e0.01-i0.005.gam -t 1 >x.gam vg augment -Z x.trans -i x.vg x.gam >x.mod.vg is $(vg view -Z x.trans | wc -l) 1288 "the expected graph translation is exported when the graph is edited" rm -rf x.vg x.xg x.gcsa x.reads x.gam x.mod.vg x.trans vg construct -m 1000 -r tiny/tiny.fa >flat.vg vg view flat.vg| sed 's/CAAATAAGGCTTGGAAATTTTCTGGAGTTCTATTATATTCCAACTCTCTG/CAAATAAGGCTTGGAAATTTTCTGGAGATCTATTATACTCCAACTCTCTG/' | vg view -Fv - >2snp.vg vg index -x 2snp.xg 2snp.vg vg sim -l 30 -x 2snp.xg -n 30 -a >2snp.sim vg index -x flat.xg -g flat.gcsa -k 16 flat.vg vg map -g flat.gcsa -x flat.xg -G 2snp.sim -k 8 >2snp.gam is $(vg augment flat.vg 2snp.gam -i | vg mod -D - | vg mod -n - | vg view - | grep ^S | wc -l) 7 "editing the graph with many SNP-containing alignments does not introduce duplicate identical nodes" vg view flat.vg| sed 's/CAAATAAGGCTTGGAAATTTTCTGGAGTTCTATTATATTCCAACTCTCTG/CAAATAAGGCTTGGAAATTATCTGGAGTTCTATTATATCCCAACTCTCTG/' | vg view -Fv - >2err.vg vg sim -l 30 -x 2err.vg -n 10 -a >2err.sim vg map -g flat.gcsa -x flat.xg -G 2err.sim -k 8 >2err.gam cat 2snp.gam 2err.gam > 4edits.gam vg augment flat.vg 2snp.gam | vg view - | grep S | awk '{print $3}' | sort > 2snp_default.nodes vg augment flat.vg 2snp.gam -m 1 | vg view - | grep S | awk '{print $3}' | sort > 2snp_m1.nodes diff 2snp_default.nodes 2snp_m1.nodes is "$?" 0 "augmenting 2 snps with -m 1 produces the same nodes as default" vg augment flat.vg 4edits.gam -m 11 | vg view - | grep S | awk '{print $3}' | sort > 4edits_m11.nodes diff 2snp_default.nodes 4edits_m11.nodes is "$?" 0 "augmenting 2 snps and 2 errors with -m 11 produces the same nodes as with just the snps" # 2 snps, but one has a low quality, and one has a high quality echo "@read" > qual.fq echo "CAAATAAGGCTTGGAAATTGTCTGGAGTTCTATTATATGCCAACTCTCTG" >> qual.fq echo "+" >> qual.fq echo "BBBBBBBBBBBBBBBBBBB+BBBBBBBBBBBBBBBBBBKBBBBBBBBBBB" >> qual.fq # reverse complement echo "@daer" >> qual.fq echo "CAGAGAGTTGGCATATAATAGAACTCCAGACAATTTCCAAGCCTTATTTG" >> qual.fq echo "+" >> qual.fq echo "BBBBBBBBBBBKBBBBBBBBBBBBBBBBBB+BBBBBBBBBBBBBBBBBBB" >> qual.fq vg map -g flat.gcsa -x flat.xg -f qual.fq -k 8 > 2qual.gam # sanity check: is $(vg augment flat.vg 2qual.gam -m 2 | vg view - | grep ^S | wc -l) 7 "augmenting with 2snps makes correct number of nodes" # test quality filter is $(vg augment flat.vg 2qual.gam -m 2 -q 30 | vg view - | grep ^S | wc -l) 4 "low-quality snp is filtered" vg augment flat.vg 2snp.gam | vg view - | grep S | awk '{print $3}' | sort > vg_augment.nodes vg convert flat.vg -p > flat.pg vg augment flat.pg 2snp.gam | vg convert -v - | vg view - | grep S | awk '{print $3}' | sort > packed_graph_augment.nodes diff vg_augment.nodes packed_graph_augment.nodes is "$?" 0 "augmenting a packed graph produces same results as a vg graph" vg convert flat.vg -a > flat.hg vg augment flat.hg 2snp.gam | vg convert -v - | vg view - | grep S | awk '{print $3}' | sort > hash_graph_augment.nodes diff vg_augment.nodes hash_graph_augment.nodes is "$?" 0 "augmenting a hash graph produces same results as a vg graph" rm -f flat.vg flat.gcsa flat.xg flat.pg flat.hg 2snp.vg 2snp.xg 2snp.sim 2snp.gam vg_augment.nodes packed_graph_augment.nodes hash_graph_augment.nodes rm -f 2err.sim 2err.gam 4edits.gam 2snp_default.nodes 2snp_m1.nodes 4edits_m11.nodes 2qual.gam qual.fq
59.519685
296
0.714777
edf2aa60eb7a92e1b1d2309e300a612b0f8d9d03
541
pl
Perl
tools/webmin/awstats/log_parser.pl
3l3phant/awstats
f316b1fa3d64e9e1eb9edf57a11975fc8ea9e9ec
[ "Unlicense" ]
250
2015-08-16T14:24:30.000Z
2021-01-12T03:31:54.000Z
tools/webmin/awstats/log_parser.pl
3l3phant/awstats
f316b1fa3d64e9e1eb9edf57a11975fc8ea9e9ec
[ "Unlicense" ]
137
2015-08-26T18:12:21.000Z
2021-01-14T09:47:12.000Z
tools/webmin/awstats/log_parser.pl
3l3phant/awstats
f316b1fa3d64e9e1eb9edf57a11975fc8ea9e9ec
[ "Unlicense" ]
107
2015-08-14T17:45:55.000Z
2021-01-07T11:44:16.000Z
# log_parser.pl # Functions for parsing this module's logs do 'awstats-lib.pl'; # parse_webmin_log(user, script, action, type, object, &params) # Converts logged information from this module into human-readable form sub parse_webmin_log { local ($user, $script, $action, $type, $object, $p) = @_; if ($type eq "log") { return &text("log_${action}_log", "<tt>".&html_escape($object)."</tt>"); } elsif ($type eq "global") { return $object eq "-" ? $text{"log_global"} : &text("log_global2", "<tt>".&html_escape($object)."</tt>"); } }
27.05
73
0.659889
edb161378fc371ea4dced603032ff890edce0acb
694
pl
Perl
tools/build/gen-js-runner.pl
Kaiepi/nqp
24f90977a16d6a742e9dd9a083a2933d79da1bf3
[ "MIT" ]
null
null
null
tools/build/gen-js-runner.pl
Kaiepi/nqp
24f90977a16d6a742e9dd9a083a2933d79da1bf3
[ "MIT" ]
null
null
null
tools/build/gen-js-runner.pl
Kaiepi/nqp
24f90977a16d6a742e9dd9a083a2933d79da1bf3
[ "MIT" ]
null
null
null
#!/usr/bin/perl # Copyright (C) 2013, The Perl Foundation. use strict; use warnings; use 5.008; use File::Spec; if ($^O eq 'MSWin32') { my $install_to = 'nqp-js.bat'; open my $fh, ">", $install_to or die "Could not open $install_to: $!"; print $fh '@ node nqp-js-on-js/nqp-bootstrapped.js %*' . "\n"; close $fh or die "Could not close $install_to: $!"; } else { my $install_to = 'nqp-js'; open my $fh, ">", $install_to or die "Could not open $install_to: $!"; print $fh <<'EOS'; #!/bin/sh exec node nqp-js-on-js/nqp-bootstrapped.js "$@" EOS close $fh or die "Could not close $install_to: $!"; chmod 0755, $install_to; }
23.931034
66
0.57781
ed92964aa31cfe0d5db505ba5ba26f5f392c5ed4
475
t
Perl
_templates/component/new/stories.ejs.t
Yelakelly/react-skeleton
4f6adcef19021b6100b6339c4d7c33bdcf680b41
[ "MIT" ]
null
null
null
_templates/component/new/stories.ejs.t
Yelakelly/react-skeleton
4f6adcef19021b6100b6339c4d7c33bdcf680b41
[ "MIT" ]
null
null
null
_templates/component/new/stories.ejs.t
Yelakelly/react-skeleton
4f6adcef19021b6100b6339c4d7c33bdcf680b41
[ "MIT" ]
null
null
null
--- to: src/<%= path %>/stories.js --- import React from 'react'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import { withInfo } from '@storybook/addon-info'; import <%= h.inflection.camelize(name) %> from './index'; storiesOf('elements/<%= h.inflection.camelize(name) %>', module).add( 'default', withInfo()(() => ( <<%= h.inflection.camelize(name) %> onClick={action('onClick')} theme={'default'} /> )), );
27.941176
88
0.633684
73dadbf1b6ab6fd74150af3f84bd6c664e2cd6d6
851
pm
Perl
auto-lib/Paws/ElasticTranscoder/CreatePresetResponse.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/ElasticTranscoder/CreatePresetResponse.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/ElasticTranscoder/CreatePresetResponse.pm
0leksii/aws-sdk-perl
b2132fe3c79a06fd15b6137e8a0eb628de722e0f
[ "Apache-2.0" ]
87
2015-04-22T06:29:47.000Z
2021-09-29T14:45:55.000Z
package Paws::ElasticTranscoder::CreatePresetResponse; use Moose; has Preset => (is => 'ro', isa => 'Paws::ElasticTranscoder::Preset'); has Warning => (is => 'ro', isa => 'Str'); has _request_id => (is => 'ro', isa => 'Str'); 1; ### main pod documentation begin ### =head1 NAME Paws::ElasticTranscoder::CreatePresetResponse =head1 ATTRIBUTES =head2 Preset => L<Paws::ElasticTranscoder::Preset> A section of the response body that provides information about the preset that is created. =head2 Warning => Str If the preset settings don't comply with the standards for the video codec but Elastic Transcoder created the preset, this message explains the reason the preset settings don't meet the standard. Elastic Transcoder created the preset because the settings might produce acceptable output. =head2 _request_id => Str =cut
21.820513
71
0.73443
ede3b30622e7346c7772757794638bfcc5c0517a
8,036
pm
Perl
modules/Bio/EnsEMBL/Variation/Study.pm
MatBarba/ensembl-variation
314c4e3f5708d9060605b7822b5cb8d4d867278c
[ "Apache-2.0" ]
null
null
null
modules/Bio/EnsEMBL/Variation/Study.pm
MatBarba/ensembl-variation
314c4e3f5708d9060605b7822b5cb8d4d867278c
[ "Apache-2.0" ]
null
null
null
modules/Bio/EnsEMBL/Variation/Study.pm
MatBarba/ensembl-variation
314c4e3f5708d9060605b7822b5cb8d4d867278c
[ "Apache-2.0" ]
null
null
null
=head1 LICENSE Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016] 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>. =cut # Ensembl module for Bio::EnsEMBL::Variation::Study # # =head1 NAME Bio::EnsEMBL::Variation::Study - Ensembl representation of a study. =head1 SYNOPSIS # Study $study = Bio::EnsEMBL::Variation::Study->new (-name => 'EGAS00000000001', -external_reference => 'pubmed/17554300', -url => 'http://www.ebi.ac.uk/ega/page.php?page=study&study=EGAS00000000001&cat=www.wtccc.studies.xml.ega&subcat=BD' ); ... =head1 DESCRIPTION This is a class representing a study from the ensembl-variation database. =head1 METHODS =cut use strict; use warnings; package Bio::EnsEMBL::Variation::Study; use Bio::EnsEMBL::Storable; use Bio::EnsEMBL::Utils::Exception qw(throw deprecate warning); use Bio::EnsEMBL::Utils::Argument qw(rearrange); our @ISA = ('Bio::EnsEMBL::Storable'); =head2 new Arg [-dbID] : see superclass constructor Arg [-ADAPTOR] : see superclass constructor Arg [-NAME] : name of the study Arg [-DESCRIPTION] : study description Arg [-URL] : string - url of the database/file where the data are stored Arg [-EXTERNAL_REFERENCE] : string - the pubmed/ids or project/study names Arg [-TYPE] : string - type of the study (e.g. GWAS) Arg [-SOURCE] : string - name of the source Arg [-ASSOCIATE] : array ref - list of the study objects associated with the current study Example : $study = Bio::EnsEMBL::Variation::Study->new (-name => 'EGAS00000000001', -external_reference => 'pubmed/17554300', -url => 'http://www.ebi.ac.uk/ega/page.php?page=study&study=EGAS00000000001&cat=www.wtccc.studies.xml.ega&subcat=BD' ); Description: Constructor. Instantiates a new Study object. Returntype : Bio::EnsEMBL::Variation::Study Exceptions : none Caller : general Status : Stable =cut sub new { my $caller = shift; my $class = ref($caller) || $caller; my $self = $class->SUPER::new(@_); my ($dbID,$adaptor,$study_name,$study_description,$study_url,$external_reference, $study_type,$source_id,$associate) = rearrange([qw(dbID ADAPTOR NAME DESCRIPTION URL EXTERNAL_REFERENCE TYPE _SOURCE_ID ASSOCIATE)], @_); $self = { 'dbID' => $dbID, 'adaptor' => $adaptor, 'name' => $study_name, 'description' => $study_description, 'url' => $study_url, 'external_reference' => $external_reference, 'type' => $study_type, '_source_id' => $source_id, 'associate' => $associate }; return bless $self, $class; } =head2 name Arg [1] : string $newval (optional) The new value to set the name attribute to Example : $name = $obj->name() Description: Getter/Setter for the name attribute Returntype : string Exceptions : none Caller : general Status : Stable =cut sub name{ my $self = shift; return $self->{'name'} = shift if(@_); return $self->{'name'}; } =head2 description Arg [1] : string $newval (optional) The new value to set the description attribute to Example : $name = $obj->description() Description: Getter/Setter for the description attribute Returntype : string Exceptions : none Caller : general Status : Stable =cut sub description{ my $self = shift; return $self->{'description'} = shift if(@_); return $self->{'description'}; } =head2 url Arg [1] : string $newval (optional) The new value to set the url attribute to Example : $name = $obj->url() Description: Getter/Setter for the url attribute Returntype : string Exceptions : none Caller : general Status : Stable =cut sub url{ my $self = shift; return $self->{'url'} = shift if(@_); return $self->{'url'}; } =head2 external_reference Arg [1] : string $newval (optional) The new value to set the external_reference attribute to Example : $name = $obj->external_reference() Description: Getter/Setter for the external_reference attribute Returntype : string Exceptions : none Caller : general Status : At Risk =cut sub external_reference{ my $self = shift; return $self->{'external_reference'} = shift if(@_); return $self->{'external_reference'}; } =head2 type Arg [1] : string $newval (optional) The new value to set the type attribute to Example : $name = $obj->type() Description: Getter/Setter for the type attribute Returntype : string Exceptions : none Caller : general Status : Stable =cut sub type{ my $self = shift; return $self->{'type'} = shift if(@_); return $self->{'type'}; } =head2 source Arg [1] : Bio::EnsEMBL::Variation::Source $src (optional) The new value to set the source attribute to Example : $source = $st->source() Description: Getter/Setter for the source object attribute Returntype : Bio::EnsEMBL::Variation::Source Exceptions : none Caller : general Status : Stable =cut sub source{ my $self = shift; # set if(@_) { if(!ref($_[0]) || !$_[0]->isa('Bio::EnsEMBL::Variation::Source')) { throw("Bio::EnsEMBL::Variation::Source argument expected"); } $self->{'source'} = shift; } # get elsif(!defined($self->{'source'}) && $self->adaptor() && defined($self->{'_source_id'})) { # lazy-load from database on demand my $sa = $self->adaptor->db()->get_SourceAdaptor(); $self->{'source'} = $sa->fetch_by_dbID($self->{'_source_id'}); } return $self->{'source'}; } =head2 source_name Arg [1] : string $source_name (optional) The new value to set the source name attribute to Example : $source_name = $st->source_name() Description: Getter/Setter for the source name attribute Returntype : string Exceptions : none Caller : general Status : Stable =cut sub source_name{ my $self = shift; my $source = $self->source; return unless defined $source; $source->name(@_) if(@_); return $source->name; } =head2 source_version Arg [1] : string $source_version (optional) The new value to set the source version attribute to Example : $source_version = $st->source_version() Description: Getter/Setter for the source version attribute Returntype : string Exceptions : none Caller : general Status : Stable =cut sub source_version{ my $self = shift; my $source = $self->source; return unless defined $source; $source->version(@_) if(@_); return $source->version; } =head2 associated_studies Example : $name = $obj->associate_studies() Description: Getter/Setter for the associated_studies attribute Returntype : reference to list of Bio::EnsEMBL::Variation::Study Exceptions : none Caller : general Status : At Risk =cut sub associated_studies{ my $self = shift; my $results; if (defined($self->{'associate'}) && defined($self->{'adaptor'})) { my $studya = $self->{'adaptor'}->db()->get_StudyAdaptor(); return $studya->fetch_all_by_dbID_list($self->{'associate'}); } else { return []; } }
23.916667
120
0.663016
ede76c01e3d9a994d5ae8625aee4f5bfc71166da
917
t
Perl
YDR418W_YEL054C_estimatedTau_Noinitial/IGCgeo_10.0/sim_87/2NG.t
xji3/IGCCodonSimulation
2daf1e566ec01eb6c59693d5758be7db91edc57b
[ "MIT" ]
null
null
null
YDR418W_YEL054C_estimatedTau_Noinitial/IGCgeo_10.0/sim_87/2NG.t
xji3/IGCCodonSimulation
2daf1e566ec01eb6c59693d5758be7db91edc57b
[ "MIT" ]
null
null
null
YDR418W_YEL054C_estimatedTau_Noinitial/IGCgeo_10.0/sim_87/2NG.t
xji3/IGCCodonSimulation
2daf1e566ec01eb6c59693d5758be7db91edc57b
[ "MIT" ]
null
null
null
13 castelliiYDR418W castelliiYEL054C 0.2600 mikataeYDR418W 0.5383 0.5715 mikataeYEL054C 0.6188 0.5748 0.4880 kluyveriYDR418W 0.3443 0.3378 0.5900 0.6514 paradoxusYDR418W 0.4925 0.5012 0.1656 0.4529 0.5516 paradoxusYEL054C 0.5472 0.5343 0.4127 0.1197 0.5989 0.3785 kudriavzeviiYDR418W 0.5383 0.5388 0.3231 0.5329 0.5585 0.3023 0.4632 kudriavzeviiYEL054C 0.5996 0.5888 0.5636 0.2754 0.6107 0.5016 0.2607 0.4958 bayanusYDR418W 0.4093 0.4252 0.2122 0.5112 0.4642 0.1863 0.4496 0.2192 0.5565 bayanusYEL054C 0.4093 0.4099 0.4501 0.2599 0.4494 0.3909 0.2393 0.3876 0.2472 0.3538 cerevisiaeYDR418W 0.5148 0.5391 0.1721 0.4571 0.5726 0.0685 0.3833 0.3087 0.5056 0.2055 0.3963 cerevisiaeYEL054C 0.5382 0.5237 0.4184 0.1662 0.5741 0.3679 0.1527 0.4475 0.2748 0.4410 0.2395 0.3595
61.133333
117
0.653217
ed7dd4da55c8e9d923a00a6abdf0c4a3491f9509
117,091
pl
Perl
vpx_dsp/vpx_dsp_rtcd_defs.pl
raspbian-packages/libvpx
93800794bb9849aadb8f97b0d021989e12c17386
[ "BSD-3-Clause" ]
1
2019-01-11T06:44:41.000Z
2019-01-11T06:44:41.000Z
vpx_dsp/vpx_dsp_rtcd_defs.pl
raspbian-packages/libvpx
93800794bb9849aadb8f97b0d021989e12c17386
[ "BSD-3-Clause" ]
null
null
null
vpx_dsp/vpx_dsp_rtcd_defs.pl
raspbian-packages/libvpx
93800794bb9849aadb8f97b0d021989e12c17386
[ "BSD-3-Clause" ]
null
null
null
sub vpx_dsp_forward_decls() { print <<EOF /* * DSP */ #include "vpx/vpx_integer.h" #include "vpx_dsp/vpx_dsp_common.h" EOF } forward_decls qw/vpx_dsp_forward_decls/; # functions that are 64 bit only. $mmx_x86_64 = $sse2_x86_64 = $ssse3_x86_64 = $avx_x86_64 = $avx2_x86_64 = ''; if ($opts{arch} eq "x86_64") { $mmx_x86_64 = 'mmx'; $sse2_x86_64 = 'sse2'; $ssse3_x86_64 = 'ssse3'; $avx_x86_64 = 'avx'; $avx2_x86_64 = 'avx2'; } # # Intra prediction # add_proto qw/void vpx_d207_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d207_predictor_4x4 sse2/; add_proto qw/void vpx_d207e_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d45_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d45_predictor_4x4 neon sse2/; add_proto qw/void vpx_d45e_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d63_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d63_predictor_4x4 ssse3/; add_proto qw/void vpx_d63e_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d63f_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_h_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_h_predictor_4x4 neon dspr2 msa sse2/; add_proto qw/void vpx_he_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d117_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d135_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d135_predictor_4x4 neon/; add_proto qw/void vpx_d153_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d153_predictor_4x4 ssse3/; add_proto qw/void vpx_v_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_v_predictor_4x4 neon msa sse2/; add_proto qw/void vpx_ve_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_tm_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_tm_predictor_4x4 neon dspr2 msa sse2/; add_proto qw/void vpx_dc_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_predictor_4x4 dspr2 msa neon sse2/; add_proto qw/void vpx_dc_top_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_top_predictor_4x4 msa neon sse2/; add_proto qw/void vpx_dc_left_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_left_predictor_4x4 msa neon sse2/; add_proto qw/void vpx_dc_128_predictor_4x4/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_128_predictor_4x4 msa neon sse2/; add_proto qw/void vpx_d207_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d207_predictor_8x8 ssse3/; add_proto qw/void vpx_d207e_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d45_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d45_predictor_8x8 neon sse2/; add_proto qw/void vpx_d45e_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d63_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d63_predictor_8x8 ssse3/; add_proto qw/void vpx_d63e_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_h_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_h_predictor_8x8 neon dspr2 msa sse2/; add_proto qw/void vpx_d117_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d135_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d135_predictor_8x8 neon/; add_proto qw/void vpx_d153_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d153_predictor_8x8 ssse3/; add_proto qw/void vpx_v_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_v_predictor_8x8 neon msa sse2/; add_proto qw/void vpx_tm_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_tm_predictor_8x8 neon dspr2 msa sse2/; add_proto qw/void vpx_dc_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_predictor_8x8 dspr2 neon msa sse2/; add_proto qw/void vpx_dc_top_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_top_predictor_8x8 neon msa sse2/; add_proto qw/void vpx_dc_left_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_left_predictor_8x8 neon msa sse2/; add_proto qw/void vpx_dc_128_predictor_8x8/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_128_predictor_8x8 neon msa sse2/; add_proto qw/void vpx_d207_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d207_predictor_16x16 ssse3/; add_proto qw/void vpx_d207e_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d45_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d45_predictor_16x16 neon ssse3/; add_proto qw/void vpx_d45e_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d63_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d63_predictor_16x16 ssse3/; add_proto qw/void vpx_d63e_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_h_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_h_predictor_16x16 neon dspr2 msa sse2/; add_proto qw/void vpx_d117_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d135_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d135_predictor_16x16 neon/; add_proto qw/void vpx_d153_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d153_predictor_16x16 ssse3/; add_proto qw/void vpx_v_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_v_predictor_16x16 neon msa sse2/; add_proto qw/void vpx_tm_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_tm_predictor_16x16 neon msa sse2/; add_proto qw/void vpx_dc_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_predictor_16x16 dspr2 neon msa sse2/; add_proto qw/void vpx_dc_top_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_top_predictor_16x16 neon msa sse2/; add_proto qw/void vpx_dc_left_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_left_predictor_16x16 neon msa sse2/; add_proto qw/void vpx_dc_128_predictor_16x16/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_128_predictor_16x16 neon msa sse2/; add_proto qw/void vpx_d207_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d207_predictor_32x32 ssse3/; add_proto qw/void vpx_d207e_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d45_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d45_predictor_32x32 neon ssse3/; add_proto qw/void vpx_d45e_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d63_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d63_predictor_32x32 ssse3/; add_proto qw/void vpx_d63e_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_h_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_h_predictor_32x32 neon msa sse2/; add_proto qw/void vpx_d117_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; add_proto qw/void vpx_d135_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d135_predictor_32x32 neon/; add_proto qw/void vpx_d153_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_d153_predictor_32x32 ssse3/; add_proto qw/void vpx_v_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_v_predictor_32x32 neon msa sse2/; add_proto qw/void vpx_tm_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_tm_predictor_32x32 neon msa sse2/; add_proto qw/void vpx_dc_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_predictor_32x32 msa neon sse2/; add_proto qw/void vpx_dc_top_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_top_predictor_32x32 msa neon sse2/; add_proto qw/void vpx_dc_left_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_left_predictor_32x32 msa neon sse2/; add_proto qw/void vpx_dc_128_predictor_32x32/, "uint8_t *dst, ptrdiff_t y_stride, const uint8_t *above, const uint8_t *left"; specialize qw/vpx_dc_128_predictor_32x32 msa neon sse2/; # High bitdepth functions if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { add_proto qw/void vpx_highbd_d207_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d207e_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d45_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_d45_predictor_4x4 neon/; add_proto qw/void vpx_highbd_d45e_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d63_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d63e_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_h_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_h_predictor_4x4 neon/; add_proto qw/void vpx_highbd_d117_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d135_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_d135_predictor_4x4 neon/; add_proto qw/void vpx_highbd_d153_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_v_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_v_predictor_4x4 neon sse2/; add_proto qw/void vpx_highbd_tm_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_tm_predictor_4x4 neon sse2/; add_proto qw/void vpx_highbd_dc_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_predictor_4x4 neon sse2/; add_proto qw/void vpx_highbd_dc_top_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_top_predictor_4x4 neon/; add_proto qw/void vpx_highbd_dc_left_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_left_predictor_4x4 neon/; add_proto qw/void vpx_highbd_dc_128_predictor_4x4/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_128_predictor_4x4 neon/; add_proto qw/void vpx_highbd_d207_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d207e_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d45_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_d45_predictor_8x8 neon/; add_proto qw/void vpx_highbd_d45e_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d63_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d63e_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_h_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_h_predictor_8x8 neon/; add_proto qw/void vpx_highbd_d117_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d135_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_d135_predictor_8x8 neon/; add_proto qw/void vpx_highbd_d153_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_v_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_v_predictor_8x8 neon sse2/; add_proto qw/void vpx_highbd_tm_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_tm_predictor_8x8 neon sse2/; add_proto qw/void vpx_highbd_dc_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_predictor_8x8 neon sse2/; add_proto qw/void vpx_highbd_dc_top_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_top_predictor_8x8 neon/; add_proto qw/void vpx_highbd_dc_left_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_left_predictor_8x8 neon/; add_proto qw/void vpx_highbd_dc_128_predictor_8x8/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_128_predictor_8x8 neon/; add_proto qw/void vpx_highbd_d207_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d207e_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d45_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_d45_predictor_16x16 neon/; add_proto qw/void vpx_highbd_d45e_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d63_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d63e_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_h_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_h_predictor_16x16 neon/; add_proto qw/void vpx_highbd_d117_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d135_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_d135_predictor_16x16 neon/; add_proto qw/void vpx_highbd_d153_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_v_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_v_predictor_16x16 neon sse2/; add_proto qw/void vpx_highbd_tm_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_tm_predictor_16x16 neon sse2/; add_proto qw/void vpx_highbd_dc_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_predictor_16x16 neon sse2/; add_proto qw/void vpx_highbd_dc_top_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_top_predictor_16x16 neon/; add_proto qw/void vpx_highbd_dc_left_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_left_predictor_16x16 neon/; add_proto qw/void vpx_highbd_dc_128_predictor_16x16/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_128_predictor_16x16 neon/; add_proto qw/void vpx_highbd_d207_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d207e_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d45_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_d45_predictor_32x32 neon/; add_proto qw/void vpx_highbd_d45e_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d63_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d63e_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_h_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_h_predictor_32x32 neon/; add_proto qw/void vpx_highbd_d117_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_d135_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_d135_predictor_32x32 neon/; add_proto qw/void vpx_highbd_d153_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; add_proto qw/void vpx_highbd_v_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_v_predictor_32x32 neon sse2/; add_proto qw/void vpx_highbd_tm_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_tm_predictor_32x32 neon sse2/; add_proto qw/void vpx_highbd_dc_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_predictor_32x32 neon sse2/; add_proto qw/void vpx_highbd_dc_top_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_top_predictor_32x32 neon/; add_proto qw/void vpx_highbd_dc_left_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_left_predictor_32x32 neon/; add_proto qw/void vpx_highbd_dc_128_predictor_32x32/, "uint16_t *dst, ptrdiff_t y_stride, const uint16_t *above, const uint16_t *left, int bd"; specialize qw/vpx_highbd_dc_128_predictor_32x32 neon/; } # CONFIG_VP9_HIGHBITDEPTH # # Sub Pixel Filters # add_proto qw/void vpx_convolve_copy/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; specialize qw/vpx_convolve_copy neon dspr2 msa sse2/; add_proto qw/void vpx_convolve_avg/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; specialize qw/vpx_convolve_avg neon dspr2 msa sse2/; add_proto qw/void vpx_convolve8/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; specialize qw/vpx_convolve8 sse2 ssse3 avx2 neon dspr2 msa/; add_proto qw/void vpx_convolve8_horiz/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; specialize qw/vpx_convolve8_horiz sse2 ssse3 avx2 neon dspr2 msa/; add_proto qw/void vpx_convolve8_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; specialize qw/vpx_convolve8_vert sse2 ssse3 avx2 neon dspr2 msa/; add_proto qw/void vpx_convolve8_avg/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; specialize qw/vpx_convolve8_avg sse2 ssse3 neon dspr2 msa/; add_proto qw/void vpx_convolve8_avg_horiz/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; specialize qw/vpx_convolve8_avg_horiz sse2 ssse3 neon dspr2 msa/; add_proto qw/void vpx_convolve8_avg_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; specialize qw/vpx_convolve8_avg_vert sse2 ssse3 neon dspr2 msa/; add_proto qw/void vpx_scaled_2d/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; specialize qw/vpx_scaled_2d ssse3/; add_proto qw/void vpx_scaled_horiz/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; add_proto qw/void vpx_scaled_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; add_proto qw/void vpx_scaled_avg_2d/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; add_proto qw/void vpx_scaled_avg_horiz/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; add_proto qw/void vpx_scaled_avg_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h"; if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { # # Sub Pixel Filters # add_proto qw/void vpx_highbd_convolve_copy/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps"; specialize qw/vpx_highbd_convolve_copy sse2 neon/; add_proto qw/void vpx_highbd_convolve_avg/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps"; specialize qw/vpx_highbd_convolve_avg sse2 neon/; add_proto qw/void vpx_highbd_convolve8/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps"; specialize qw/vpx_highbd_convolve8 neon/, "$sse2_x86_64"; add_proto qw/void vpx_highbd_convolve8_horiz/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps"; specialize qw/vpx_highbd_convolve8_horiz neon/, "$sse2_x86_64"; add_proto qw/void vpx_highbd_convolve8_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps"; specialize qw/vpx_highbd_convolve8_vert neon/, "$sse2_x86_64"; add_proto qw/void vpx_highbd_convolve8_avg/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps"; specialize qw/vpx_highbd_convolve8_avg neon/, "$sse2_x86_64"; add_proto qw/void vpx_highbd_convolve8_avg_horiz/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps"; specialize qw/vpx_highbd_convolve8_avg_horiz neon/, "$sse2_x86_64"; add_proto qw/void vpx_highbd_convolve8_avg_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps"; specialize qw/vpx_highbd_convolve8_avg_vert neon/, "$sse2_x86_64"; } # CONFIG_VP9_HIGHBITDEPTH # # Loopfilter # add_proto qw/void vpx_lpf_vertical_16/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh"; specialize qw/vpx_lpf_vertical_16 sse2 neon dspr2 msa/; add_proto qw/void vpx_lpf_vertical_16_dual/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh"; specialize qw/vpx_lpf_vertical_16_dual sse2 neon dspr2 msa/; add_proto qw/void vpx_lpf_vertical_8/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh"; specialize qw/vpx_lpf_vertical_8 sse2 neon dspr2 msa/; add_proto qw/void vpx_lpf_vertical_8_dual/, "uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1"; specialize qw/vpx_lpf_vertical_8_dual sse2 neon dspr2 msa/; add_proto qw/void vpx_lpf_vertical_4/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh"; specialize qw/vpx_lpf_vertical_4 sse2 neon dspr2 msa/; add_proto qw/void vpx_lpf_vertical_4_dual/, "uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1"; specialize qw/vpx_lpf_vertical_4_dual sse2 neon dspr2 msa/; add_proto qw/void vpx_lpf_horizontal_16/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh"; specialize qw/vpx_lpf_horizontal_16 sse2 avx2 neon dspr2 msa/; add_proto qw/void vpx_lpf_horizontal_16_dual/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh"; specialize qw/vpx_lpf_horizontal_16_dual sse2 avx2 neon dspr2 msa/; add_proto qw/void vpx_lpf_horizontal_8/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh"; specialize qw/vpx_lpf_horizontal_8 sse2 neon dspr2 msa/; add_proto qw/void vpx_lpf_horizontal_8_dual/, "uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1"; specialize qw/vpx_lpf_horizontal_8_dual sse2 neon dspr2 msa/; add_proto qw/void vpx_lpf_horizontal_4/, "uint8_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh"; specialize qw/vpx_lpf_horizontal_4 sse2 neon dspr2 msa/; add_proto qw/void vpx_lpf_horizontal_4_dual/, "uint8_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1"; specialize qw/vpx_lpf_horizontal_4_dual sse2 neon dspr2 msa/; if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { add_proto qw/void vpx_highbd_lpf_vertical_16/, "uint16_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd"; specialize qw/vpx_highbd_lpf_vertical_16 sse2 neon/; add_proto qw/void vpx_highbd_lpf_vertical_16_dual/, "uint16_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd"; specialize qw/vpx_highbd_lpf_vertical_16_dual sse2 neon/; add_proto qw/void vpx_highbd_lpf_vertical_8/, "uint16_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd"; specialize qw/vpx_highbd_lpf_vertical_8 sse2 neon/; add_proto qw/void vpx_highbd_lpf_vertical_8_dual/, "uint16_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1, int bd"; specialize qw/vpx_highbd_lpf_vertical_8_dual sse2 neon/; add_proto qw/void vpx_highbd_lpf_vertical_4/, "uint16_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd"; specialize qw/vpx_highbd_lpf_vertical_4 sse2 neon/; add_proto qw/void vpx_highbd_lpf_vertical_4_dual/, "uint16_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1, int bd"; specialize qw/vpx_highbd_lpf_vertical_4_dual sse2 neon/; add_proto qw/void vpx_highbd_lpf_horizontal_16/, "uint16_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd"; specialize qw/vpx_highbd_lpf_horizontal_16 sse2 neon/; add_proto qw/void vpx_highbd_lpf_horizontal_16_dual/, "uint16_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd"; specialize qw/vpx_highbd_lpf_horizontal_16_dual sse2 neon/; add_proto qw/void vpx_highbd_lpf_horizontal_8/, "uint16_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd"; specialize qw/vpx_highbd_lpf_horizontal_8 sse2 neon/; add_proto qw/void vpx_highbd_lpf_horizontal_8_dual/, "uint16_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1, int bd"; specialize qw/vpx_highbd_lpf_horizontal_8_dual sse2 neon/; add_proto qw/void vpx_highbd_lpf_horizontal_4/, "uint16_t *s, int pitch, const uint8_t *blimit, const uint8_t *limit, const uint8_t *thresh, int bd"; specialize qw/vpx_highbd_lpf_horizontal_4 sse2 neon/; add_proto qw/void vpx_highbd_lpf_horizontal_4_dual/, "uint16_t *s, int pitch, const uint8_t *blimit0, const uint8_t *limit0, const uint8_t *thresh0, const uint8_t *blimit1, const uint8_t *limit1, const uint8_t *thresh1, int bd"; specialize qw/vpx_highbd_lpf_horizontal_4_dual sse2 neon/; } # CONFIG_VP9_HIGHBITDEPTH # # Encoder functions. # # # Forward transform # if (vpx_config("CONFIG_VP9_ENCODER") eq "yes") { if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { add_proto qw/void vpx_fdct4x4/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct4x4 sse2/; add_proto qw/void vpx_fdct4x4_1/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct4x4_1 sse2/; add_proto qw/void vpx_fdct8x8/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct8x8 sse2/; add_proto qw/void vpx_fdct8x8_1/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct8x8_1 sse2/; add_proto qw/void vpx_fdct16x16/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct16x16 sse2/; add_proto qw/void vpx_fdct16x16_1/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct16x16_1 sse2/; add_proto qw/void vpx_fdct32x32/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct32x32 sse2/; add_proto qw/void vpx_fdct32x32_rd/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct32x32_rd sse2/; add_proto qw/void vpx_fdct32x32_1/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct32x32_1 sse2/; add_proto qw/void vpx_highbd_fdct4x4/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_highbd_fdct4x4 sse2/; add_proto qw/void vpx_highbd_fdct8x8/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_highbd_fdct8x8 sse2/; add_proto qw/void vpx_highbd_fdct8x8_1/, "const int16_t *input, tran_low_t *output, int stride"; add_proto qw/void vpx_highbd_fdct16x16/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_highbd_fdct16x16 sse2/; add_proto qw/void vpx_highbd_fdct16x16_1/, "const int16_t *input, tran_low_t *output, int stride"; add_proto qw/void vpx_highbd_fdct32x32/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_highbd_fdct32x32 sse2/; add_proto qw/void vpx_highbd_fdct32x32_rd/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_highbd_fdct32x32_rd sse2/; add_proto qw/void vpx_highbd_fdct32x32_1/, "const int16_t *input, tran_low_t *output, int stride"; } else { add_proto qw/void vpx_fdct4x4/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct4x4 sse2 msa/; add_proto qw/void vpx_fdct4x4_1/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct4x4_1 sse2/; add_proto qw/void vpx_fdct8x8/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct8x8 sse2 neon msa/, "$ssse3_x86_64"; add_proto qw/void vpx_fdct8x8_1/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct8x8_1 sse2 neon msa/; add_proto qw/void vpx_fdct16x16/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct16x16 sse2 msa/; add_proto qw/void vpx_fdct16x16_1/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct16x16_1 sse2 msa/; add_proto qw/void vpx_fdct32x32/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct32x32 sse2 avx2 msa/; add_proto qw/void vpx_fdct32x32_rd/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct32x32_rd sse2 avx2 msa/; add_proto qw/void vpx_fdct32x32_1/, "const int16_t *input, tran_low_t *output, int stride"; specialize qw/vpx_fdct32x32_1 sse2 msa/; } # CONFIG_VP9_HIGHBITDEPTH } # CONFIG_VP9_ENCODER # # Inverse transform if (vpx_config("CONFIG_VP9") eq "yes") { if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { # Note as optimized versions of these functions are added we need to add a check to ensure # that when CONFIG_EMULATE_HARDWARE is on, it defaults to the C versions only. add_proto qw/void vpx_iwht4x4_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_iwht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_iwht4x4_16_add sse2/; add_proto qw/void vpx_highbd_idct4x4_1_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; specialize qw/vpx_highbd_idct4x4_1_add neon/; add_proto qw/void vpx_highbd_idct8x8_1_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; specialize qw/vpx_highbd_idct8x8_1_add neon/; add_proto qw/void vpx_highbd_idct16x16_1_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; add_proto qw/void vpx_highbd_idct32x32_1024_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; add_proto qw/void vpx_highbd_idct32x32_34_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; add_proto qw/void vpx_highbd_idct32x32_1_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; specialize qw/vpx_highbd_idct32x32_1_add sse2/; add_proto qw/void vpx_highbd_iwht4x4_1_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; add_proto qw/void vpx_highbd_iwht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; # Force C versions if CONFIG_EMULATE_HARDWARE is 1 if (vpx_config("CONFIG_EMULATE_HARDWARE") eq "yes") { add_proto qw/void vpx_idct4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct4x4_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct8x8_12_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct8x8_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct16x16_256_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct16x16_10_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct16x16_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct32x32_1024_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct32x32_135_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct32x32_34_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct32x32_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_highbd_idct4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; add_proto qw/void vpx_highbd_idct8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; add_proto qw/void vpx_highbd_idct8x8_12_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; add_proto qw/void vpx_highbd_idct16x16_256_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; add_proto qw/void vpx_highbd_idct16x16_10_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; } else { add_proto qw/void vpx_idct4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct4x4_16_add neon sse2/; add_proto qw/void vpx_idct4x4_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct4x4_1_add neon sse2/; add_proto qw/void vpx_idct8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct8x8_64_add neon sse2/, "$ssse3_x86_64"; add_proto qw/void vpx_idct8x8_12_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct8x8_12_add neon sse2/, "$ssse3_x86_64"; add_proto qw/void vpx_idct8x8_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct8x8_1_add neon sse2/; add_proto qw/void vpx_idct16x16_256_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct16x16_256_add neon sse2/; add_proto qw/void vpx_idct16x16_10_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct16x16_10_add neon sse2/; add_proto qw/void vpx_idct16x16_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct16x16_1_add neon sse2/; add_proto qw/void vpx_idct32x32_1024_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct32x32_1024_add neon sse2/, "$ssse3_x86_64"; add_proto qw/void vpx_idct32x32_135_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct32x32_135_add neon sse2/, "$ssse3_x86_64"; # Need to add 135 eob idct32x32 implementations. $vpx_idct32x32_135_add_sse2=vpx_idct32x32_1024_add_sse2; add_proto qw/void vpx_idct32x32_34_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct32x32_34_add neon sse2/, "$ssse3_x86_64"; add_proto qw/void vpx_idct32x32_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct32x32_1_add neon sse2/; add_proto qw/void vpx_highbd_idct4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; specialize qw/vpx_highbd_idct4x4_16_add neon sse2/; add_proto qw/void vpx_highbd_idct8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; specialize qw/vpx_highbd_idct8x8_64_add neon sse2/; add_proto qw/void vpx_highbd_idct8x8_12_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; specialize qw/vpx_highbd_idct8x8_12_add neon sse2/; add_proto qw/void vpx_highbd_idct16x16_256_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; specialize qw/vpx_highbd_idct16x16_256_add sse2/; add_proto qw/void vpx_highbd_idct16x16_10_add/, "const tran_low_t *input, uint8_t *dest, int stride, int bd"; specialize qw/vpx_highbd_idct16x16_10_add sse2/; } # CONFIG_EMULATE_HARDWARE } else { # Force C versions if CONFIG_EMULATE_HARDWARE is 1 if (vpx_config("CONFIG_EMULATE_HARDWARE") eq "yes") { add_proto qw/void vpx_idct4x4_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct8x8_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct8x8_12_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct16x16_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct16x16_256_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct16x16_10_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct32x32_1024_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct32x32_135_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct32x32_34_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_idct32x32_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_iwht4x4_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; add_proto qw/void vpx_iwht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride"; } else { add_proto qw/void vpx_idct4x4_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct4x4_1_add sse2 neon dspr2 msa/; add_proto qw/void vpx_idct4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct4x4_16_add sse2 neon dspr2 msa/; add_proto qw/void vpx_idct8x8_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct8x8_1_add sse2 neon dspr2 msa/; add_proto qw/void vpx_idct8x8_64_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct8x8_64_add sse2 neon dspr2 msa/, "$ssse3_x86_64"; add_proto qw/void vpx_idct8x8_12_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct8x8_12_add sse2 neon dspr2 msa/, "$ssse3_x86_64"; add_proto qw/void vpx_idct16x16_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct16x16_1_add sse2 neon dspr2 msa/; add_proto qw/void vpx_idct16x16_256_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct16x16_256_add sse2 neon dspr2 msa/; add_proto qw/void vpx_idct16x16_10_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct16x16_10_add sse2 neon dspr2 msa/; add_proto qw/void vpx_idct32x32_1024_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct32x32_1024_add sse2 neon dspr2 msa/, "$ssse3_x86_64"; add_proto qw/void vpx_idct32x32_135_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct32x32_135_add sse2 neon dspr2 msa/, "$ssse3_x86_64"; $vpx_idct32x32_135_add_sse2=vpx_idct32x32_1024_add_sse2; $vpx_idct32x32_135_add_dspr2=vpx_idct32x32_1024_add_dspr2; $vpx_idct32x32_135_add_msa=vpx_idct32x32_1024_add_msa; add_proto qw/void vpx_idct32x32_34_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct32x32_34_add sse2 neon dspr2 msa/, "$ssse3_x86_64"; add_proto qw/void vpx_idct32x32_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_idct32x32_1_add sse2 neon dspr2 msa/; add_proto qw/void vpx_iwht4x4_1_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_iwht4x4_1_add msa/; add_proto qw/void vpx_iwht4x4_16_add/, "const tran_low_t *input, uint8_t *dest, int stride"; specialize qw/vpx_iwht4x4_16_add msa sse2/; } # CONFIG_EMULATE_HARDWARE } # CONFIG_VP9_HIGHBITDEPTH } # CONFIG_VP9 # # Quantization # if (vpx_config("CONFIG_VP9_ENCODER") eq "yes") { add_proto qw/void vpx_quantize_b/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan"; specialize qw/vpx_quantize_b sse2/, "$ssse3_x86_64", "$avx_x86_64"; add_proto qw/void vpx_quantize_b_32x32/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan"; specialize qw/vpx_quantize_b_32x32/, "$ssse3_x86_64", "$avx_x86_64"; if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { add_proto qw/void vpx_highbd_quantize_b/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan"; specialize qw/vpx_highbd_quantize_b sse2/; add_proto qw/void vpx_highbd_quantize_b_32x32/, "const tran_low_t *coeff_ptr, intptr_t n_coeffs, int skip_block, const int16_t *zbin_ptr, const int16_t *round_ptr, const int16_t *quant_ptr, const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr, const int16_t *scan, const int16_t *iscan"; specialize qw/vpx_highbd_quantize_b_32x32 sse2/; } # CONFIG_VP9_HIGHBITDEPTH } # CONFIG_VP9_ENCODER if (vpx_config("CONFIG_ENCODERS") eq "yes") { # # Block subtraction # add_proto qw/void vpx_subtract_block/, "int rows, int cols, int16_t *diff_ptr, ptrdiff_t diff_stride, const uint8_t *src_ptr, ptrdiff_t src_stride, const uint8_t *pred_ptr, ptrdiff_t pred_stride"; specialize qw/vpx_subtract_block neon msa sse2/; # # Single block SAD # add_proto qw/unsigned int vpx_sad64x64/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_sad64x64 avx2 neon msa sse2/; add_proto qw/unsigned int vpx_sad64x32/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_sad64x32 avx2 msa sse2/; add_proto qw/unsigned int vpx_sad32x64/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_sad32x64 avx2 msa sse2/; add_proto qw/unsigned int vpx_sad32x32/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_sad32x32 avx2 neon msa sse2/; add_proto qw/unsigned int vpx_sad32x16/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_sad32x16 avx2 msa sse2/; add_proto qw/unsigned int vpx_sad16x32/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_sad16x32 msa sse2/; add_proto qw/unsigned int vpx_sad16x16/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_sad16x16 neon msa sse2/; add_proto qw/unsigned int vpx_sad16x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_sad16x8 neon msa sse2/; add_proto qw/unsigned int vpx_sad8x16/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_sad8x16 neon msa sse2/; add_proto qw/unsigned int vpx_sad8x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_sad8x8 neon msa sse2/; add_proto qw/unsigned int vpx_sad8x4/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_sad8x4 msa sse2/; add_proto qw/unsigned int vpx_sad4x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_sad4x8 msa sse2/; add_proto qw/unsigned int vpx_sad4x4/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_sad4x4 neon msa sse2/; # # Avg # if (vpx_config("CONFIG_VP9_ENCODER") eq "yes") { add_proto qw/unsigned int vpx_avg_8x8/, "const uint8_t *, int p"; specialize qw/vpx_avg_8x8 sse2 neon msa/; add_proto qw/unsigned int vpx_avg_4x4/, "const uint8_t *, int p"; specialize qw/vpx_avg_4x4 sse2 neon msa/; add_proto qw/void vpx_minmax_8x8/, "const uint8_t *s, int p, const uint8_t *d, int dp, int *min, int *max"; specialize qw/vpx_minmax_8x8 sse2 neon/; add_proto qw/void vpx_hadamard_8x8/, "const int16_t *src_diff, int src_stride, int16_t *coeff"; specialize qw/vpx_hadamard_8x8 sse2 neon/, "$ssse3_x86_64"; add_proto qw/void vpx_hadamard_16x16/, "const int16_t *src_diff, int src_stride, int16_t *coeff"; specialize qw/vpx_hadamard_16x16 sse2 neon/; add_proto qw/int vpx_satd/, "const int16_t *coeff, int length"; specialize qw/vpx_satd sse2 neon/; add_proto qw/void vpx_int_pro_row/, "int16_t *hbuf, const uint8_t *ref, const int ref_stride, const int height"; specialize qw/vpx_int_pro_row sse2 neon/; add_proto qw/int16_t vpx_int_pro_col/, "const uint8_t *ref, const int width"; specialize qw/vpx_int_pro_col sse2 neon/; add_proto qw/int vpx_vector_var/, "const int16_t *ref, const int16_t *src, const int bwl"; specialize qw/vpx_vector_var neon sse2/; } # CONFIG_VP9_ENCODER add_proto qw/unsigned int vpx_sad64x64_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_sad64x64_avg avx2 msa sse2/; add_proto qw/unsigned int vpx_sad64x32_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_sad64x32_avg avx2 msa sse2/; add_proto qw/unsigned int vpx_sad32x64_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_sad32x64_avg avx2 msa sse2/; add_proto qw/unsigned int vpx_sad32x32_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_sad32x32_avg avx2 msa sse2/; add_proto qw/unsigned int vpx_sad32x16_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_sad32x16_avg avx2 msa sse2/; add_proto qw/unsigned int vpx_sad16x32_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_sad16x32_avg msa sse2/; add_proto qw/unsigned int vpx_sad16x16_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_sad16x16_avg msa sse2/; add_proto qw/unsigned int vpx_sad16x8_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_sad16x8_avg msa sse2/; add_proto qw/unsigned int vpx_sad8x16_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_sad8x16_avg msa sse2/; add_proto qw/unsigned int vpx_sad8x8_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_sad8x8_avg msa sse2/; add_proto qw/unsigned int vpx_sad8x4_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_sad8x4_avg msa sse2/; add_proto qw/unsigned int vpx_sad4x8_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_sad4x8_avg msa sse2/; add_proto qw/unsigned int vpx_sad4x4_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_sad4x4_avg msa sse2/; # # Multi-block SAD, comparing a reference to N blocks 1 pixel apart horizontally # # Blocks of 3 add_proto qw/void vpx_sad64x64x3/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad64x64x3 msa/; add_proto qw/void vpx_sad32x32x3/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad32x32x3 msa/; add_proto qw/void vpx_sad16x16x3/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad16x16x3 sse3 ssse3 msa/; add_proto qw/void vpx_sad16x8x3/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad16x8x3 sse3 ssse3 msa/; add_proto qw/void vpx_sad8x16x3/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad8x16x3 sse3 msa/; add_proto qw/void vpx_sad8x8x3/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad8x8x3 sse3 msa/; add_proto qw/void vpx_sad4x4x3/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad4x4x3 sse3 msa/; # Blocks of 8 add_proto qw/void vpx_sad64x64x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad64x64x8 msa/; add_proto qw/void vpx_sad32x32x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad32x32x8 msa/; add_proto qw/void vpx_sad16x16x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad16x16x8 sse4_1 msa/; add_proto qw/void vpx_sad16x8x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad16x8x8 sse4_1 msa/; add_proto qw/void vpx_sad8x16x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad8x16x8 sse4_1 msa/; add_proto qw/void vpx_sad8x8x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad8x8x8 sse4_1 msa/; add_proto qw/void vpx_sad8x4x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad8x4x8 msa/; add_proto qw/void vpx_sad4x8x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad4x8x8 msa/; add_proto qw/void vpx_sad4x4x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad4x4x8 sse4_1 msa/; # # Multi-block SAD, comparing a reference to N independent blocks # add_proto qw/void vpx_sad64x64x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t * const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad64x64x4d avx2 neon msa sse2/; add_proto qw/void vpx_sad64x32x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t * const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad64x32x4d msa sse2/; add_proto qw/void vpx_sad32x64x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t * const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad32x64x4d msa sse2/; add_proto qw/void vpx_sad32x32x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t * const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad32x32x4d avx2 neon msa sse2/; add_proto qw/void vpx_sad32x16x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t * const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad32x16x4d msa sse2/; add_proto qw/void vpx_sad16x32x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t * const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad16x32x4d msa sse2/; add_proto qw/void vpx_sad16x16x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t * const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad16x16x4d neon msa sse2/; add_proto qw/void vpx_sad16x8x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t * const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad16x8x4d msa sse2/; add_proto qw/void vpx_sad8x16x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t * const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad8x16x4d msa sse2/; add_proto qw/void vpx_sad8x8x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t * const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad8x8x4d msa sse2/; add_proto qw/void vpx_sad8x4x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t * const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad8x4x4d msa sse2/; add_proto qw/void vpx_sad4x8x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t * const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad4x8x4d msa sse2/; add_proto qw/void vpx_sad4x4x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t * const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_sad4x4x4d msa sse2/; add_proto qw/uint64_t vpx_sum_squares_2d_i16/, "const int16_t *src, int stride, int size"; specialize qw/vpx_sum_squares_2d_i16 sse2/; # # Structured Similarity (SSIM) # if (vpx_config("CONFIG_INTERNAL_STATS") eq "yes") { add_proto qw/void vpx_ssim_parms_8x8/, "const uint8_t *s, int sp, const uint8_t *r, int rp, uint32_t *sum_s, uint32_t *sum_r, uint32_t *sum_sq_s, uint32_t *sum_sq_r, uint32_t *sum_sxr"; specialize qw/vpx_ssim_parms_8x8/, "$sse2_x86_64"; add_proto qw/void vpx_ssim_parms_16x16/, "const uint8_t *s, int sp, const uint8_t *r, int rp, uint32_t *sum_s, uint32_t *sum_r, uint32_t *sum_sq_s, uint32_t *sum_sq_r, uint32_t *sum_sxr"; specialize qw/vpx_ssim_parms_16x16/, "$sse2_x86_64"; } if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { # # Block subtraction # add_proto qw/void vpx_highbd_subtract_block/, "int rows, int cols, int16_t *diff_ptr, ptrdiff_t diff_stride, const uint8_t *src_ptr, ptrdiff_t src_stride, const uint8_t *pred_ptr, ptrdiff_t pred_stride, int bd"; # # Single block SAD # add_proto qw/unsigned int vpx_highbd_sad64x64/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_highbd_sad64x64 sse2/; add_proto qw/unsigned int vpx_highbd_sad64x32/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_highbd_sad64x32 sse2/; add_proto qw/unsigned int vpx_highbd_sad32x64/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_highbd_sad32x64 sse2/; add_proto qw/unsigned int vpx_highbd_sad32x32/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_highbd_sad32x32 sse2/; add_proto qw/unsigned int vpx_highbd_sad32x16/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_highbd_sad32x16 sse2/; add_proto qw/unsigned int vpx_highbd_sad16x32/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_highbd_sad16x32 sse2/; add_proto qw/unsigned int vpx_highbd_sad16x16/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_highbd_sad16x16 sse2/; add_proto qw/unsigned int vpx_highbd_sad16x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_highbd_sad16x8 sse2/; add_proto qw/unsigned int vpx_highbd_sad8x16/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_highbd_sad8x16 sse2/; add_proto qw/unsigned int vpx_highbd_sad8x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_highbd_sad8x8 sse2/; add_proto qw/unsigned int vpx_highbd_sad8x4/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; specialize qw/vpx_highbd_sad8x4 sse2/; add_proto qw/unsigned int vpx_highbd_sad4x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; add_proto qw/unsigned int vpx_highbd_sad4x4/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride"; # # Avg # add_proto qw/unsigned int vpx_highbd_avg_8x8/, "const uint8_t *, int p"; add_proto qw/unsigned int vpx_highbd_avg_4x4/, "const uint8_t *, int p"; add_proto qw/void vpx_highbd_minmax_8x8/, "const uint8_t *s, int p, const uint8_t *d, int dp, int *min, int *max"; add_proto qw/unsigned int vpx_highbd_sad64x64_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_highbd_sad64x64_avg sse2/; add_proto qw/unsigned int vpx_highbd_sad64x32_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_highbd_sad64x32_avg sse2/; add_proto qw/unsigned int vpx_highbd_sad32x64_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_highbd_sad32x64_avg sse2/; add_proto qw/unsigned int vpx_highbd_sad32x32_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_highbd_sad32x32_avg sse2/; add_proto qw/unsigned int vpx_highbd_sad32x16_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_highbd_sad32x16_avg sse2/; add_proto qw/unsigned int vpx_highbd_sad16x32_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_highbd_sad16x32_avg sse2/; add_proto qw/unsigned int vpx_highbd_sad16x16_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_highbd_sad16x16_avg sse2/; add_proto qw/unsigned int vpx_highbd_sad16x8_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_highbd_sad16x8_avg sse2/; add_proto qw/unsigned int vpx_highbd_sad8x16_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_highbd_sad8x16_avg sse2/; add_proto qw/unsigned int vpx_highbd_sad8x8_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_highbd_sad8x8_avg sse2/; add_proto qw/unsigned int vpx_highbd_sad8x4_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; specialize qw/vpx_highbd_sad8x4_avg sse2/; add_proto qw/unsigned int vpx_highbd_sad4x8_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; add_proto qw/unsigned int vpx_highbd_sad4x4_avg/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, const uint8_t *second_pred"; # # Multi-block SAD, comparing a reference to N blocks 1 pixel apart horizontally # # Blocks of 3 add_proto qw/void vpx_highbd_sad64x64x3/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; add_proto qw/void vpx_highbd_sad32x32x3/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; add_proto qw/void vpx_highbd_sad16x16x3/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; add_proto qw/void vpx_highbd_sad16x8x3/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; add_proto qw/void vpx_highbd_sad8x16x3/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; add_proto qw/void vpx_highbd_sad8x8x3/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; add_proto qw/void vpx_highbd_sad4x4x3/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; # Blocks of 8 add_proto qw/void vpx_highbd_sad64x64x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; add_proto qw/void vpx_highbd_sad32x32x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; add_proto qw/void vpx_highbd_sad16x16x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; add_proto qw/void vpx_highbd_sad16x8x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; add_proto qw/void vpx_highbd_sad8x16x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; add_proto qw/void vpx_highbd_sad8x8x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; add_proto qw/void vpx_highbd_sad8x4x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; add_proto qw/void vpx_highbd_sad4x8x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; add_proto qw/void vpx_highbd_sad4x4x8/, "const uint8_t *src_ptr, int src_stride, const uint8_t *ref_ptr, int ref_stride, uint32_t *sad_array"; # # Multi-block SAD, comparing a reference to N independent blocks # add_proto qw/void vpx_highbd_sad64x64x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_highbd_sad64x64x4d sse2/; add_proto qw/void vpx_highbd_sad64x32x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_highbd_sad64x32x4d sse2/; add_proto qw/void vpx_highbd_sad32x64x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_highbd_sad32x64x4d sse2/; add_proto qw/void vpx_highbd_sad32x32x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_highbd_sad32x32x4d sse2/; add_proto qw/void vpx_highbd_sad32x16x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_highbd_sad32x16x4d sse2/; add_proto qw/void vpx_highbd_sad16x32x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_highbd_sad16x32x4d sse2/; add_proto qw/void vpx_highbd_sad16x16x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_highbd_sad16x16x4d sse2/; add_proto qw/void vpx_highbd_sad16x8x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_highbd_sad16x8x4d sse2/; add_proto qw/void vpx_highbd_sad8x16x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_highbd_sad8x16x4d sse2/; add_proto qw/void vpx_highbd_sad8x8x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_highbd_sad8x8x4d sse2/; add_proto qw/void vpx_highbd_sad8x4x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_highbd_sad8x4x4d sse2/; add_proto qw/void vpx_highbd_sad4x8x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_highbd_sad4x8x4d sse2/; add_proto qw/void vpx_highbd_sad4x4x4d/, "const uint8_t *src_ptr, int src_stride, const uint8_t* const ref_ptr[], int ref_stride, uint32_t *sad_array"; specialize qw/vpx_highbd_sad4x4x4d sse2/; # # Structured Similarity (SSIM) # if (vpx_config("CONFIG_INTERNAL_STATS") eq "yes") { add_proto qw/void vpx_highbd_ssim_parms_8x8/, "const uint16_t *s, int sp, const uint16_t *r, int rp, uint32_t *sum_s, uint32_t *sum_r, uint32_t *sum_sq_s, uint32_t *sum_sq_r, uint32_t *sum_sxr"; } } # CONFIG_VP9_HIGHBITDEPTH } # CONFIG_ENCODERS if (vpx_config("CONFIG_ENCODERS") eq "yes" || vpx_config("CONFIG_POSTPROC") eq "yes" || vpx_config("CONFIG_VP9_POSTPROC") eq "yes") { # # Variance # add_proto qw/unsigned int vpx_variance64x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_variance64x64 sse2 avx2 neon msa/; add_proto qw/unsigned int vpx_variance64x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_variance64x32 sse2 avx2 neon msa/; add_proto qw/unsigned int vpx_variance32x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_variance32x64 sse2 neon msa/; add_proto qw/unsigned int vpx_variance32x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_variance32x32 sse2 avx2 neon msa/; add_proto qw/unsigned int vpx_variance32x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_variance32x16 sse2 avx2 msa/; add_proto qw/unsigned int vpx_variance16x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_variance16x32 sse2 msa/; add_proto qw/unsigned int vpx_variance16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_variance16x16 sse2 avx2 neon msa/; add_proto qw/unsigned int vpx_variance16x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_variance16x8 sse2 neon msa/; add_proto qw/unsigned int vpx_variance8x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_variance8x16 sse2 neon msa/; add_proto qw/unsigned int vpx_variance8x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_variance8x8 sse2 neon msa/; add_proto qw/unsigned int vpx_variance8x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_variance8x4 sse2 msa/; add_proto qw/unsigned int vpx_variance4x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_variance4x8 sse2 msa/; add_proto qw/unsigned int vpx_variance4x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_variance4x4 sse2 msa/; # # Specialty Variance # add_proto qw/void vpx_get16x16var/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum"; specialize qw/vpx_get16x16var sse2 avx2 neon msa/; add_proto qw/void vpx_get8x8var/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum"; specialize qw/vpx_get8x8var sse2 neon msa/; add_proto qw/unsigned int vpx_mse16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; specialize qw/vpx_mse16x16 sse2 avx2 neon msa/; add_proto qw/unsigned int vpx_mse16x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; specialize qw/vpx_mse16x8 sse2 msa/; add_proto qw/unsigned int vpx_mse8x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; specialize qw/vpx_mse8x16 sse2 msa/; add_proto qw/unsigned int vpx_mse8x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; specialize qw/vpx_mse8x8 sse2 msa/; add_proto qw/unsigned int vpx_get_mb_ss/, "const int16_t *"; specialize qw/vpx_get_mb_ss sse2 msa/; add_proto qw/unsigned int vpx_get4x4sse_cs/, "const unsigned char *src_ptr, int source_stride, const unsigned char *ref_ptr, int ref_stride"; specialize qw/vpx_get4x4sse_cs neon msa/; add_proto qw/void vpx_comp_avg_pred/, "uint8_t *comp_pred, const uint8_t *pred, int width, int height, const uint8_t *ref, int ref_stride"; # # Subpixel Variance # add_proto qw/uint32_t vpx_sub_pixel_variance64x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_sub_pixel_variance64x64 avx2 neon msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_variance64x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_sub_pixel_variance64x32 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_variance32x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_sub_pixel_variance32x64 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_variance32x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_sub_pixel_variance32x32 avx2 neon msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_variance32x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_sub_pixel_variance32x16 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_variance16x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_sub_pixel_variance16x32 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_variance16x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_sub_pixel_variance16x16 neon msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_variance16x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_sub_pixel_variance16x8 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_variance8x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_sub_pixel_variance8x16 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_variance8x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_sub_pixel_variance8x8 neon msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_variance8x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_sub_pixel_variance8x4 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_variance4x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_sub_pixel_variance4x8 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_sub_pixel_variance4x4 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_avg_variance64x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_sub_pixel_avg_variance64x64 avx2 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_avg_variance64x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_sub_pixel_avg_variance64x32 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_avg_variance32x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_sub_pixel_avg_variance32x64 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_avg_variance32x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_sub_pixel_avg_variance32x32 avx2 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_avg_variance32x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_sub_pixel_avg_variance32x16 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_avg_variance16x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_sub_pixel_avg_variance16x32 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_avg_variance16x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_sub_pixel_avg_variance16x16 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_avg_variance16x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_sub_pixel_avg_variance16x8 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_avg_variance8x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_sub_pixel_avg_variance8x16 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_avg_variance8x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_sub_pixel_avg_variance8x8 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_avg_variance8x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_sub_pixel_avg_variance8x4 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_avg_variance4x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_sub_pixel_avg_variance4x8 msa sse2 ssse3/; add_proto qw/uint32_t vpx_sub_pixel_avg_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_sub_pixel_avg_variance4x4 msa sse2 ssse3/; if (vpx_config("CONFIG_VP9_HIGHBITDEPTH") eq "yes") { add_proto qw/unsigned int vpx_highbd_12_variance64x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_12_variance64x64 sse2/; add_proto qw/unsigned int vpx_highbd_12_variance64x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_12_variance64x32 sse2/; add_proto qw/unsigned int vpx_highbd_12_variance32x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_12_variance32x64 sse2/; add_proto qw/unsigned int vpx_highbd_12_variance32x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_12_variance32x32 sse2/; add_proto qw/unsigned int vpx_highbd_12_variance32x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_12_variance32x16 sse2/; add_proto qw/unsigned int vpx_highbd_12_variance16x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_12_variance16x32 sse2/; add_proto qw/unsigned int vpx_highbd_12_variance16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_12_variance16x16 sse2/; add_proto qw/unsigned int vpx_highbd_12_variance16x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_12_variance16x8 sse2/; add_proto qw/unsigned int vpx_highbd_12_variance8x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_12_variance8x16 sse2/; add_proto qw/unsigned int vpx_highbd_12_variance8x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_12_variance8x8 sse2/; add_proto qw/unsigned int vpx_highbd_12_variance8x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; add_proto qw/unsigned int vpx_highbd_12_variance4x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; add_proto qw/unsigned int vpx_highbd_12_variance4x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; add_proto qw/unsigned int vpx_highbd_10_variance64x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_10_variance64x64 sse2/; add_proto qw/unsigned int vpx_highbd_10_variance64x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_10_variance64x32 sse2/; add_proto qw/unsigned int vpx_highbd_10_variance32x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_10_variance32x64 sse2/; add_proto qw/unsigned int vpx_highbd_10_variance32x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_10_variance32x32 sse2/; add_proto qw/unsigned int vpx_highbd_10_variance32x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_10_variance32x16 sse2/; add_proto qw/unsigned int vpx_highbd_10_variance16x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_10_variance16x32 sse2/; add_proto qw/unsigned int vpx_highbd_10_variance16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_10_variance16x16 sse2/; add_proto qw/unsigned int vpx_highbd_10_variance16x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_10_variance16x8 sse2/; add_proto qw/unsigned int vpx_highbd_10_variance8x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_10_variance8x16 sse2/; add_proto qw/unsigned int vpx_highbd_10_variance8x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_10_variance8x8 sse2/; add_proto qw/unsigned int vpx_highbd_10_variance8x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; add_proto qw/unsigned int vpx_highbd_10_variance4x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; add_proto qw/unsigned int vpx_highbd_10_variance4x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; add_proto qw/unsigned int vpx_highbd_8_variance64x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_8_variance64x64 sse2/; add_proto qw/unsigned int vpx_highbd_8_variance64x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_8_variance64x32 sse2/; add_proto qw/unsigned int vpx_highbd_8_variance32x64/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_8_variance32x64 sse2/; add_proto qw/unsigned int vpx_highbd_8_variance32x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_8_variance32x32 sse2/; add_proto qw/unsigned int vpx_highbd_8_variance32x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_8_variance32x16 sse2/; add_proto qw/unsigned int vpx_highbd_8_variance16x32/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_8_variance16x32 sse2/; add_proto qw/unsigned int vpx_highbd_8_variance16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_8_variance16x16 sse2/; add_proto qw/unsigned int vpx_highbd_8_variance16x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_8_variance16x8 sse2/; add_proto qw/unsigned int vpx_highbd_8_variance8x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_8_variance8x16 sse2/; add_proto qw/unsigned int vpx_highbd_8_variance8x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; specialize qw/vpx_highbd_8_variance8x8 sse2/; add_proto qw/unsigned int vpx_highbd_8_variance8x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; add_proto qw/unsigned int vpx_highbd_8_variance4x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; add_proto qw/unsigned int vpx_highbd_8_variance4x4/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse"; add_proto qw/void vpx_highbd_8_get16x16var/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum"; add_proto qw/void vpx_highbd_8_get8x8var/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum"; add_proto qw/void vpx_highbd_10_get16x16var/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum"; add_proto qw/void vpx_highbd_10_get8x8var/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum"; add_proto qw/void vpx_highbd_12_get16x16var/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum"; add_proto qw/void vpx_highbd_12_get8x8var/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int ref_stride, unsigned int *sse, int *sum"; add_proto qw/unsigned int vpx_highbd_8_mse16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; specialize qw/vpx_highbd_8_mse16x16 sse2/; add_proto qw/unsigned int vpx_highbd_8_mse16x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; add_proto qw/unsigned int vpx_highbd_8_mse8x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; add_proto qw/unsigned int vpx_highbd_8_mse8x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; specialize qw/vpx_highbd_8_mse8x8 sse2/; add_proto qw/unsigned int vpx_highbd_10_mse16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; specialize qw/vpx_highbd_10_mse16x16 sse2/; add_proto qw/unsigned int vpx_highbd_10_mse16x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; add_proto qw/unsigned int vpx_highbd_10_mse8x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; add_proto qw/unsigned int vpx_highbd_10_mse8x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; specialize qw/vpx_highbd_10_mse8x8 sse2/; add_proto qw/unsigned int vpx_highbd_12_mse16x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; specialize qw/vpx_highbd_12_mse16x16 sse2/; add_proto qw/unsigned int vpx_highbd_12_mse16x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; add_proto qw/unsigned int vpx_highbd_12_mse8x16/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; add_proto qw/unsigned int vpx_highbd_12_mse8x8/, "const uint8_t *src_ptr, int source_stride, const uint8_t *ref_ptr, int recon_stride, unsigned int *sse"; specialize qw/vpx_highbd_12_mse8x8 sse2/; add_proto qw/void vpx_highbd_comp_avg_pred/, "uint16_t *comp_pred, const uint8_t *pred8, int width, int height, const uint8_t *ref8, int ref_stride"; # # Subpixel Variance # add_proto qw/uint32_t vpx_highbd_12_sub_pixel_variance64x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_12_sub_pixel_variance64x64 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_variance64x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_12_sub_pixel_variance64x32 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_variance32x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_12_sub_pixel_variance32x64 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_variance32x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_12_sub_pixel_variance32x32 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_variance32x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_12_sub_pixel_variance32x16 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_variance16x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_12_sub_pixel_variance16x32 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_variance16x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_12_sub_pixel_variance16x16 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_variance16x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_12_sub_pixel_variance16x8 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_variance8x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_12_sub_pixel_variance8x16 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_variance8x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_12_sub_pixel_variance8x8 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_variance8x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_12_sub_pixel_variance8x4 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_variance4x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_variance64x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_10_sub_pixel_variance64x64 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_variance64x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_10_sub_pixel_variance64x32 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_variance32x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_10_sub_pixel_variance32x64 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_variance32x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_10_sub_pixel_variance32x32 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_variance32x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_10_sub_pixel_variance32x16 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_variance16x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_10_sub_pixel_variance16x32 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_variance16x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_10_sub_pixel_variance16x16 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_variance16x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_10_sub_pixel_variance16x8 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_variance8x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_10_sub_pixel_variance8x16 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_variance8x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_10_sub_pixel_variance8x8 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_variance8x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_10_sub_pixel_variance8x4 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_variance4x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_variance64x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_8_sub_pixel_variance64x64 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_variance64x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_8_sub_pixel_variance64x32 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_variance32x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_8_sub_pixel_variance32x64 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_variance32x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_8_sub_pixel_variance32x32 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_variance32x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_8_sub_pixel_variance32x16 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_variance16x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_8_sub_pixel_variance16x32 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_variance16x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_8_sub_pixel_variance16x16 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_variance16x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_8_sub_pixel_variance16x8 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_variance8x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_8_sub_pixel_variance8x16 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_variance8x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_8_sub_pixel_variance8x8 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_variance8x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; specialize qw/vpx_highbd_8_sub_pixel_variance8x4 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_variance4x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse"; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_avg_variance64x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_12_sub_pixel_avg_variance64x64 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_avg_variance64x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_12_sub_pixel_avg_variance64x32 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_avg_variance32x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_12_sub_pixel_avg_variance32x64 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_avg_variance32x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_12_sub_pixel_avg_variance32x32 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_avg_variance32x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_12_sub_pixel_avg_variance32x16 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_avg_variance16x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_12_sub_pixel_avg_variance16x32 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_avg_variance16x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_12_sub_pixel_avg_variance16x16 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_avg_variance16x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_12_sub_pixel_avg_variance16x8 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_avg_variance8x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_12_sub_pixel_avg_variance8x16 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_avg_variance8x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_12_sub_pixel_avg_variance8x8 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_avg_variance8x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_12_sub_pixel_avg_variance8x4 sse2/; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_avg_variance4x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; add_proto qw/uint32_t vpx_highbd_12_sub_pixel_avg_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_avg_variance64x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_10_sub_pixel_avg_variance64x64 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_avg_variance64x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_10_sub_pixel_avg_variance64x32 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_avg_variance32x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_10_sub_pixel_avg_variance32x64 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_avg_variance32x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_10_sub_pixel_avg_variance32x32 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_avg_variance32x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_10_sub_pixel_avg_variance32x16 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_avg_variance16x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_10_sub_pixel_avg_variance16x32 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_avg_variance16x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_10_sub_pixel_avg_variance16x16 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_avg_variance16x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_10_sub_pixel_avg_variance16x8 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_avg_variance8x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_10_sub_pixel_avg_variance8x16 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_avg_variance8x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_10_sub_pixel_avg_variance8x8 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_avg_variance8x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_10_sub_pixel_avg_variance8x4 sse2/; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_avg_variance4x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; add_proto qw/uint32_t vpx_highbd_10_sub_pixel_avg_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance64x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_8_sub_pixel_avg_variance64x64 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance64x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_8_sub_pixel_avg_variance64x32 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance32x64/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_8_sub_pixel_avg_variance32x64 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance32x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_8_sub_pixel_avg_variance32x32 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance32x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_8_sub_pixel_avg_variance32x16 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance16x32/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_8_sub_pixel_avg_variance16x32 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance16x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_8_sub_pixel_avg_variance16x16 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance16x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_8_sub_pixel_avg_variance16x8 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance8x16/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_8_sub_pixel_avg_variance8x16 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance8x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_8_sub_pixel_avg_variance8x8 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance8x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; specialize qw/vpx_highbd_8_sub_pixel_avg_variance8x4 sse2/; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance4x8/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; add_proto qw/uint32_t vpx_highbd_8_sub_pixel_avg_variance4x4/, "const uint8_t *src_ptr, int source_stride, int xoffset, int yoffset, const uint8_t *ref_ptr, int ref_stride, uint32_t *sse, const uint8_t *second_pred"; } # CONFIG_VP9_HIGHBITDEPTH # # Post Processing # if (vpx_config("CONFIG_POSTPROC") eq "yes" || vpx_config("CONFIG_VP9_POSTPROC") eq "yes") { add_proto qw/void vpx_plane_add_noise/, "uint8_t *start, const int8_t *noise, int blackclamp, int whiteclamp, int width, int height, int pitch"; specialize qw/vpx_plane_add_noise sse2 msa/; add_proto qw/void vpx_mbpost_proc_down/, "unsigned char *dst, int pitch, int rows, int cols,int flimit"; specialize qw/vpx_mbpost_proc_down sse2 msa/; add_proto qw/void vpx_mbpost_proc_across_ip/, "unsigned char *dst, int pitch, int rows, int cols,int flimit"; specialize qw/vpx_mbpost_proc_across_ip sse2 neon msa/; add_proto qw/void vpx_post_proc_down_and_across_mb_row/, "unsigned char *src, unsigned char *dst, int src_pitch, int dst_pitch, int cols, unsigned char *flimits, int size"; specialize qw/vpx_post_proc_down_and_across_mb_row sse2 neon msa/; } } # CONFIG_ENCODERS || CONFIG_POSTPROC || CONFIG_VP9_POSTPROC 1;
66.265422
365
0.793656
ed7508dbd2b1e93a3bc3285def35946ac236d327
10,353
pm
Perl
apps/voip/3cx/restapi/custom/api.pm
alenorcy/centreon-plugins
d7603030c24766935ed07e6ebe1082e16d6fdb4a
[ "Apache-2.0" ]
null
null
null
apps/voip/3cx/restapi/custom/api.pm
alenorcy/centreon-plugins
d7603030c24766935ed07e6ebe1082e16d6fdb4a
[ "Apache-2.0" ]
2
2016-07-28T10:18:20.000Z
2017-04-11T14:16:48.000Z
apps/voip/3cx/restapi/custom/api.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::voip::3cx::restapi::custom::api; use base qw(centreon::plugins::mode); use strict; use warnings; use centreon::plugins::http; use centreon::plugins::statefile; use JSON::XS; use Digest::MD5 qw(md5_hex); sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; if (!defined($options{output})) { print "Class Custom: Need to specify 'output' argument.\n"; exit 3; } if (!defined($options{options})) { $options{output}->add_option_msg(short_msg => "Class Custom: Need to specify 'options' argument."); $options{output}->option_exit(); } if (!defined($options{noptions})) { $options{options}->add_options(arguments => { "hostname:s" => { name => 'hostname' }, "port:s" => { name => 'port'}, "proto:s" => { name => 'proto' }, "api-username:s" => { name => 'api_username' }, "api-password:s" => { name => 'api_password' }, "timeout:s" => { name => 'timeout', default => 30 }, }); } $options{options}->add_help(package => __PACKAGE__, sections => 'REST API OPTIONS', once => 1); $self->{output} = $options{output}; $self->{mode} = $options{mode}; $self->{http} = centreon::plugins::http->new(%options); $self->{cache} = centreon::plugins::statefile->new(%options); return $self; } sub set_options { my ($self, %options) = @_; $self->{option_results} = $options{option_results}; } sub set_defaults { my ($self, %options) = @_; foreach (keys %{$options{default}}) { if ($_ eq $self->{mode}) { for (my $i = 0; $i < scalar(@{$options{default}->{$_}}); $i++) { foreach my $opt (keys %{$options{default}->{$_}[$i]}) { if (!defined($self->{option_results}->{$opt}[$i])) { $self->{option_results}->{$opt}[$i] = $options{default}->{$_}[$i]->{$opt}; } } } } } } sub check_options { my ($self, %options) = @_; $self->{hostname} = (defined($self->{option_results}->{hostname})) ? $self->{option_results}->{hostname} : undef; $self->{port} = (defined($self->{option_results}->{port})) ? $self->{option_results}->{port} : 443; $self->{proto} = (defined($self->{option_results}->{proto})) ? $self->{option_results}->{proto} : 'https'; $self->{timeout} = (defined($self->{option_results}->{timeout})) ? $self->{option_results}->{timeout} : 30; $self->{ssl_opt} = (defined($self->{option_results}->{ssl_opt})) ? $self->{option_results}->{ssl_opt} : undef; $self->{api_username} = (defined($self->{option_results}->{api_username})) ? $self->{option_results}->{api_username} : undef; $self->{api_password} = (defined($self->{option_results}->{api_password})) ? $self->{option_results}->{api_password} : undef; if (!defined($self->{hostname}) || $self->{hostname} eq '') { $self->{output}->add_option_msg(short_msg => "Need to specify --hostname option."); $self->{output}->option_exit(); } if (!defined($self->{api_username}) || $self->{api_username} eq '') { $self->{output}->add_option_msg(short_msg => "Need to specify --api-username option."); $self->{output}->option_exit(); } if (!defined($self->{api_password}) || $self->{api_password} eq '') { $self->{output}->add_option_msg(short_msg => "Need to specify --api-password option."); $self->{output}->option_exit(); } $self->{cache}->check_options(option_results => $self->{option_results}); return 0; } sub build_options_for_httplib { my ($self, %options) = @_; $self->{option_results}->{hostname} = $self->{hostname}; $self->{option_results}->{port} = $self->{port}; $self->{option_results}->{proto} = $self->{proto}; $self->{option_results}->{ssl_opt} = $self->{ssl_opt}; $self->{option_results}->{timeout} = $self->{timeout}; } sub settings { my ($self, %options) = @_; $self->build_options_for_httplib(); $self->{http}->add_header(key => 'Content-Type', value => 'application/json;charset=UTF-8'); if (defined($self->{cookie}) && defined($self->{xsrf})) { $self->{http}->add_header(key => 'Cookie', value => '.AspNetCore.Cookies=' . $self->{cookie}); $self->{http}->add_header(key => 'X-XSRF-TOKEN', value => $self->{xsrf}); } $self->{http}->set_options(%{$self->{option_results}}); } sub authenticate { my ($self, %options) = @_; my $has_cache_file = $options{statefile}->read(statefile => '3cx_api_' . md5_hex($self->{option_results}->{hostname}) . '_' . md5_hex($self->{option_results}->{api_username})); my $cookie = $options{statefile}->get(name => 'cookie'); my $xsrf = $options{statefile}->get(name => 'xsrf'); my $expires_on = $options{statefile}->get(name => 'expires_on'); if ($has_cache_file == 0 || !defined($cookie) || !defined($xsrf) || (($expires_on - time()) < 10)) { my $post_data = '{"Username":"' . $self->{api_username} . '",' . '"Password":"' . $self->{api_password} . '"}'; $self->settings(); my $content = $self->{http}->request( method => 'POST', query_form_post => $post_data, url_path => '/api/login', warning_status => '', unknown_status => '', critical_status => '%{http_code} < 200 or %{http_code} >= 300' ); my $header = $self->{http}->get_header(name => 'Set-Cookie'); if (defined ($header) && $header =~ /(?:^| ).AspNetCore.Cookies=([^;]+);.*/) { $cookie = $1; } else { $self->{output}->output_add(long_msg => $content, debug => 1); $self->{output}->add_option_msg(short_msg => "Error retrieving cookie"); $self->{output}->option_exit(); } if (defined ($header) && $header =~ /(?:^| )XSRF-TOKEN=([^;]+);.*/) { $xsrf = $1; } else { $self->{output}->output_add(long_msg => $content, debug => 1); $self->{output}->add_option_msg(short_msg => "Error retrieving xsrf-token"); $self->{output}->option_exit(); } my $datas = { last_timestamp => time(), cookie => $cookie, xsrf => $xsrf, expires_on => time() + (3600 * 24) }; $options{statefile}->write(data => $datas); } $self->{cookie} = $cookie; $self->{xsrf} = $xsrf; } sub request_api { my ($self, %options) = @_; if (!defined($self->{cookie})) { $self->authenticate(statefile => $self->{cache}); } $self->settings(); my $content = $self->{http}->request(%options, warning_status => '', unknown_status => '', critical_status => '%{http_code} < 200 or %{http_code} >= 300' ); # Some content may be strangely returned, for example : # 3CX < 16.0.2.910 : "[{\"Category\":\"provider\",\"Count\":1}]" # 3CX >= 16.0.2.910 : {"tcxUpdate":"[{\"Category\":\"provider\",\"Count\":5},{\"Category\":\"sp150\",\"Count\":1}]","perPage":"[]"} if (defined($options{eval_content}) && $options{eval_content} == 1) { if (my $evcontent = eval "$content") { $content = $evcontent; } } my $decoded; eval { $decoded = JSON::XS->new->utf8->decode($content); }; if ($@) { $self->{output}->output_add(long_msg => $content, debug => 1); $self->{output}->add_option_msg(short_msg => "Cannot decode json response: $@"); $self->{output}->option_exit(); } if (!defined($decoded)) { $self->{output}->output_add(long_msg => $decoded, debug => 1); $self->{output}->add_option_msg(short_msg => "Error while retrieving data (add --debug option for detailed message)"); $self->{output}->option_exit(); } return $decoded; } sub internal_single_status { my ($self, %options) = @_; my $status = $self->request_api(method => 'GET', url_path =>'/api/SystemStatus/GetSingleStatus'); return $status; } sub api_single_status { my ($self, %options) = @_; my $status = $self->internal_single_status(); return $status->{Health}; } sub internal_system_status { my ($self, %options) = @_; my $status = $self->request_api(method => 'GET', url_path =>'/api/SystemStatus'); return $status; } sub api_system_status { my ($self, %options) = @_; my $status = $self->internal_system_status(); return $status; } sub internal_update_checker { my ($self, %options) = @_; my $status = $self->request_api(method => 'GET', url_path =>'/api/UpdateChecker/GetFromParams', eval_content => 1); if (ref($status) eq 'HASH') { $status = $status->{tcxUpdate}; if (ref($status) ne 'ARRAY') { # See above note about strange content $status = JSON::XS->new->utf8->decode($status); } } return $status; } sub api_update_checker { my ($self, %options) = @_; my $status = $self->internal_update_checker(); return $status; } 1; __END__ =head1 NAME 3CX Rest API =head1 REST API OPTIONS =over 8 =item B<--hostname> Set hostname or IP of 3CX server. =item B<--port> Set 3CX Port (Default: '443'). =item B<--proto> Specify https if needed (Default: 'https'). =item B<--api-username> Set 3CX Username. =item B<--api-password> Set 3CX Password. =item B<--timeout> Threshold for HTTP timeout (Default: '30'). =back =cut
33.182692
180
0.575196
eda3315d3e3241b399cf3796aec337f7f7357370
798
pl
Perl
src/test/prolog/miscellaneous/63.pl
s-webber/projog
f61d9ad69b454fefe0006d357da691ec04cb5299
[ "Apache-2.0" ]
14
2017-04-15T11:42:17.000Z
2022-03-24T10:30:15.000Z
src/test/prolog/miscellaneous/63.pl
webber-s/projog
b05587cd1d49ba971d1a54737bcf74a7f5cafd84
[ "Apache-2.0" ]
88
2015-09-20T08:57:42.000Z
2022-03-27T13:25:11.000Z
src/test/prolog/miscellaneous/63.pl
webber-s/projog
b05587cd1d49ba971d1a54737bcf74a7f5cafd84
[ "Apache-2.0" ]
5
2018-08-03T11:15:19.000Z
2022-03-21T16:03:30.000Z
word2chars([],[]). word2chars([Word|RestWords],[Chars|RestChars]) :- atom_chars(Word,Chars), word2chars(RestWords,RestChars). test(X, Y) :- word2chars(X, Y). %?- word2chars(X, [[d,o],[o,r,e],[m,a],[l,i,s],[u,r],[a,s],[p,o],[s,o],[p,i,r,u,s],[o,k,e,r],[a,l],[a,d,a,m],[i,k]]) % X=[do,ore,ma,lis,ur,as,po,so,pirus,oker,al,adam,ik] % TODO Remove ! from query once compiled mode is smart eniugh to know that word2chars is not retryable. % Currently interpreted mode does detect this but compiled mode doesn't - which is why without the ! there is a difference % in behaviour when this test is run in the two different modes. %?- test(X, [[d,o],[o,r,e],[m,a],[l,i,s],[u,r],[a,s],[p,o],[s,o],[p,i,r,u,s],[o,k,e,r],[a,l],[a,d,a,m],[i,k]]), ! % X=[do,ore,ma,lis,ur,as,po,so,pirus,oker,al,adam,ik] %NO
46.941176
122
0.62782
ede320fdf961a414a6ba4f97ca5624615c638880
812
pm
Perl
tests/installation/partitioning/no_separate_home.pm
Dawei-Pang/os-autoinst-distri-opensuse
013cccfcdc84edb8faff13eab1ab2e6288aacd26
[ "FSFAP" ]
null
null
null
tests/installation/partitioning/no_separate_home.pm
Dawei-Pang/os-autoinst-distri-opensuse
013cccfcdc84edb8faff13eab1ab2e6288aacd26
[ "FSFAP" ]
5
2019-01-17T03:09:17.000Z
2019-08-20T06:34:48.000Z
tests/installation/partitioning/no_separate_home.pm
Dawei-Pang/os-autoinst-distri-opensuse
013cccfcdc84edb8faff13eab1ab2e6288aacd26
[ "FSFAP" ]
null
null
null
# SUSE's openQA tests # # Copyright © 2019-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. # Summary: The test module goes through the Suggested Partitioning wizard, # keeping all the default values but explicitly disables separate /home # partition. # Maintainer: QE YaST <qa-sle-yast@suse.de> use parent 'y2_installbase'; use strict; use warnings FATAL => 'all'; use testapi; sub run { my $partitioner = $testapi::distri->get_partitioner(); my $multiple_disks = get_var('NUMDISKS', 1) > 1 ? 1 : 0; $partitioner->edit_proposal(has_separate_home => 0, multiple_disks => $multiple_disks); } 1;
30.074074
91
0.736453
ede916218533ae9323f7652c6cd5173c0a1eadc1
8,081
pm
Perl
lib/Kubernetes/Object/V1APIServiceSpec.pm
yue9944882/perl
b6446c40bc7b00a9a5aca8e63532864e922f7f87
[ "Apache-2.0" ]
null
null
null
lib/Kubernetes/Object/V1APIServiceSpec.pm
yue9944882/perl
b6446c40bc7b00a9a5aca8e63532864e922f7f87
[ "Apache-2.0" ]
null
null
null
lib/Kubernetes/Object/V1APIServiceSpec.pm
yue9944882/perl
b6446c40bc7b00a9a5aca8e63532864e922f7f87
[ "Apache-2.0" ]
null
null
null
=begin comment Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) OpenAPI spec version: v1.13.5 Generated by: https://openapi-generator.tech =end comment =cut # # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). # Do not edit the class manually. # Ref: https://openapi-generator.tech # package Kubernetes::Object::V1APIServiceSpec; require 5.6.0; use strict; use warnings; use utf8; use JSON qw(decode_json); use Data::Dumper; use Module::Runtime qw(use_module); use Log::Any qw($log); use Date::Parse; use DateTime; use Kubernetes::Object::V1ServiceReference; use base ("Class::Accessor", "Class::Data::Inheritable"); # #APIServiceSpec contains information for locating and communicating with a server. Only https is supported, though you are able to disable certificate verification. # # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually. # REF: https://openapi-generator.tech # =begin comment Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) OpenAPI spec version: v1.13.5 Generated by: https://openapi-generator.tech =end comment =cut # # NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). # Do not edit the class manually. # Ref: https://openapi-generator.tech # __PACKAGE__->mk_classdata('attribute_map' => {}); __PACKAGE__->mk_classdata('openapi_types' => {}); __PACKAGE__->mk_classdata('method_documentation' => {}); __PACKAGE__->mk_classdata('class_documentation' => {}); # new object sub new { my ($class, %args) = @_; my $self = bless {}, $class; foreach my $attribute (keys %{$class->attribute_map}) { my $args_key = $class->attribute_map->{$attribute}; $self->$attribute( $args{ $args_key } ); } return $self; } # return perl hash sub to_hash { return decode_json(JSON->new->convert_blessed->encode( shift )); } # used by JSON for serialization sub TO_JSON { my $self = shift; my $_data = {}; foreach my $_key (keys %{$self->attribute_map}) { if (defined $self->{$_key}) { $_data->{$self->attribute_map->{$_key}} = $self->{$_key}; } } return $_data; } # from Perl hashref sub from_hash { my ($self, $hash) = @_; # loop through attributes and use openapi_types to deserialize the data while ( my ($_key, $_type) = each %{$self->openapi_types} ) { my $_json_attribute = $self->attribute_map->{$_key}; if ($_type =~ /^array\[/i) { # array my $_subclass = substr($_type, 6, -1); my @_array = (); foreach my $_element (@{$hash->{$_json_attribute}}) { push @_array, $self->_deserialize($_subclass, $_element); } $self->{$_key} = \@_array; } elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime $self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute}); } else { $log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute); } } return $self; } # deserialize non-array data sub _deserialize { my ($self, $type, $data) = @_; $log->debugf("deserializing %s with %s",Dumper($data), $type); if ($type eq 'DateTime') { return DateTime->from_epoch(epoch => str2time($data)); } elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) { return $data; } else { # hash(model) my $_instance = eval "Kubernetes::Object::$type->new()"; return $_instance->from_hash($data); } } __PACKAGE__->class_documentation({description => 'APIServiceSpec contains information for locating and communicating with a server. Only https is supported, though you are able to disable certificate verification.', class => 'V1APIServiceSpec', required => [], # TODO } ); __PACKAGE__->method_documentation({ 'ca_bundle' => { datatype => 'string', base_name => 'caBundle', description => 'CABundle is a PEM encoded CA bundle which will be used to validate an API server&#39;s serving certificate. If unspecified, system trust roots on the apiserver are used.', format => '', read_only => '', }, 'group' => { datatype => 'string', base_name => 'group', description => 'Group is the API group name this server hosts', format => '', read_only => '', }, 'group_priority_minimum' => { datatype => 'int', base_name => 'groupPriorityMinimum', description => 'GroupPriorityMininum is the priority this group should have at least. Higher priority means that the group is preferred by clients over lower priority ones. Note that other versions of this group might specify even higher GroupPriorityMininum values such that the whole group gets a higher priority. The primary sort is based on GroupPriorityMinimum, ordered highest number to lowest (20 before 10). The secondary sort is based on the alphabetical comparison of the name of the object. (v1.bar before v1.foo) We&#39;d recommend something like: *.k8s.io (except extensions) at 18000 and PaaSes (OpenShift, Deis) are recommended to be in the 2000s', format => '', read_only => '', }, 'insecure_skip_tls_verify' => { datatype => 'boolean', base_name => 'insecureSkipTLSVerify', description => 'InsecureSkipTLSVerify disables TLS certificate verification when communicating with this server. This is strongly discouraged. You should use the CABundle instead.', format => '', read_only => '', }, 'service' => { datatype => 'V1ServiceReference', base_name => 'service', description => '', format => '', read_only => '', }, 'version' => { datatype => 'string', base_name => 'version', description => 'Version is the API version this server hosts. For example, \&quot;v1\&quot;', format => '', read_only => '', }, 'version_priority' => { datatype => 'int', base_name => 'versionPriority', description => 'VersionPriority controls the ordering of this API version inside of its group. Must be greater than zero. The primary sort is based on VersionPriority, ordered highest to lowest (20 before 10). Since it&#39;s inside of a group, the number can be small, probably in the 10s. In case of equal version priorities, the version string will be used to compute the order inside a group. If the version string is \&quot;kube-like\&quot;, it will sort above non \&quot;kube-like\&quot; version strings, which are ordered lexicographically. \&quot;Kube-like\&quot; versions start with a \&quot;v\&quot;, then are followed by a number (the major version), then optionally the string \&quot;alpha\&quot; or \&quot;beta\&quot; and another number (the minor version). These are sorted first by GA &gt; beta &gt; alpha (where GA is a version with no suffix such as beta or alpha), and then by comparing major version, then minor version. An example sorted list of versions: v10, v2, v1, v11beta2, v10beta3, v3beta1, v12alpha1, v11alpha2, foo1, foo10.', format => '', read_only => '', }, }); __PACKAGE__->openapi_types( { 'ca_bundle' => 'string', 'group' => 'string', 'group_priority_minimum' => 'int', 'insecure_skip_tls_verify' => 'boolean', 'service' => 'V1ServiceReference', 'version' => 'string', 'version_priority' => 'int' } ); __PACKAGE__->attribute_map( { 'ca_bundle' => 'caBundle', 'group' => 'group', 'group_priority_minimum' => 'groupPriorityMinimum', 'insecure_skip_tls_verify' => 'insecureSkipTLSVerify', 'service' => 'service', 'version' => 'version', 'version_priority' => 'versionPriority' } ); __PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map}); 1;
36.400901
1,059
0.656354
edf098e691a84501ab4867317ddbeaa9d8e341cb
2,057
al
Perl
benchmark/benchmarks/FASP-benchmarks/data/small-world-2/smallworld2-0267-70-130-522.al
krzysg/FaspHeuristic
1929c40e3fbc49e68b04acfc5522539a18758031
[ "MIT" ]
null
null
null
benchmark/benchmarks/FASP-benchmarks/data/small-world-2/smallworld2-0267-70-130-522.al
krzysg/FaspHeuristic
1929c40e3fbc49e68b04acfc5522539a18758031
[ "MIT" ]
null
null
null
benchmark/benchmarks/FASP-benchmarks/data/small-world-2/smallworld2-0267-70-130-522.al
krzysg/FaspHeuristic
1929c40e3fbc49e68b04acfc5522539a18758031
[ "MIT" ]
null
null
null
1 15 19 106 122 2 73 82 120 3 35 76 81 91 4 2 7 14 19 65 75 96 120 125 5 13 61 69 78 129 6 24 7 54 102 110 123 8 6 14 35 78 87 9 2 20 32 124 10 32 93 113 11 10 95 103 110 117 118 12 41 110 119 13 14 27 62 93 129 14 26 37 42 86 86 88 101 123 15 24 41 78 79 95 121 16 80 84 121 17 13 59 18 33 61 90 19 45 46 62 81 116 20 65 83 84 21 10 17 25 51 51 115 22 9 23 22 26 51 55 62 63 118 124 24 63 87 95 107 25 73 110 26 17 60 61 27 3 30 30 32 75 77 88 28 113 29 24 41 44 83 88 30 19 26 31 127 32 9 17 33 13 16 24 41 81 113 124 34 6 10 26 82 110 35 17 41 36 13 25 92 38 63 92 39 84 112 116 40 29 59 101 41 42 45 81 42 32 38 72 92 126 43 21 28 55 58 111 111 44 32 45 38 50 53 120 46 37 67 97 47 5 6 27 75 75 84 91 105 106 48 45 73 89 107 49 57 50 24 57 73 83 85 94 117 124 51 2 6 13 23 35 87 99 52 5 10 24 41 53 57 110 53 4 4 14 16 21 66 68 88 127 54 20 23 39 99 55 22 56 23 33 37 41 63 57 27 72 102 110 58 19 38 80 59 55 85 124 60 16 39 87 119 130 61 4 36 69 73 77 97 111 62 48 48 63 38 85 101 117 64 78 123 65 21 24 54 94 113 66 8 29 31 98 125 128 67 28 44 47 68 34 66 69 29 63 92 70 92 71 1 60 72 19 42 45 98 106 73 88 74 72 99 75 16 40 91 102 76 54 62 77 57 71 93 114 78 3 47 117 79 11 30 31 80 31 48 111 121 81 31 97 82 47 64 68 83 20 57 130 84 57 57 79 120 122 85 6 63 71 86 22 99 87 4 52 116 88 14 35 85 96 106 89 22 67 76 115 115 90 39 63 75 83 86 87 103 128 91 7 9 34 43 50 60 96 129 92 50 79 81 108 116 93 36 65 77 94 12 56 75 87 93 111 95 44 78 88 98 104 96 13 44 75 106 106 97 3 62 90 118 125 98 34 40 40 77 114 99 124 100 47 97 102 111 101 73 102 2 26 124 103 6 25 34 66 104 6 14 31 32 37 41 79 105 64 108 130 106 28 38 68 73 107 37 66 108 98 109 17 22 37 58 60 68 79 121 110 19 24 88 90 100 107 111 12 26 55 60 63 81 86 94 99 121 112 6 10 37 55 95 103 113 113 11 36 78 95 100 104 114 9 49 73 87 115 5 25 34 116 8 33 95 126 117 41 91 118 115 119 64 77 92 104 112 114 130 120 23 91 130 121 20 26 93 116 122 19 20 95 98 118 123 43 76 77 93 100 124 22 39 51 52 53 66 125 15 54 116 120 123 126 114 127 109 128 9 17 64 94 119 129 21 26 36 39 130 57 70 88 117
15.945736
34
0.684006
edd0a193823ee17113ac52329fe87e45172c0873
2,136
t
Perl
t/concurrent.t
srchulo/Mojo-mysql-Database-Role-LoadDataInfile
89eb64f3899336500a5d1688be85f4e491779437
[ "Artistic-1.0" ]
null
null
null
t/concurrent.t
srchulo/Mojo-mysql-Database-Role-LoadDataInfile
89eb64f3899336500a5d1688be85f4e491779437
[ "Artistic-1.0" ]
null
null
null
t/concurrent.t
srchulo/Mojo-mysql-Database-Role-LoadDataInfile
89eb64f3899336500a5d1688be85f4e491779437
[ "Artistic-1.0" ]
null
null
null
use Mojo::Base -strict; use Test::More; use Test::MockModule; use Mojo::mysql; use Mojo::mysql::Database::Role::LoadDataInfile; plan skip_all => q{TEST_ONLINE="mysql://root@/test;mysql_local_infile=1"} unless $ENV{TEST_ONLINE}; my $mysql = Mojo::mysql->new($ENV{TEST_ONLINE}); my $db = $mysql->db; ok $db->ping, 'connected'; $db->query('DROP TABLE IF EXISTS people'); $db->query(q{ CREATE TABLE `people` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `age` INT(11) NOT NULL, `insert_time` DATETIME NULL DEFAULT NULL, PRIMARY KEY (`id`) ) AUTO_INCREMENT=1 }); is $db->query('SELECT COUNT(id) FROM people')->array->[0], 0, 'people table is empty'; my $people = [ { name => 'Bob', age => 23, }, { name => 'Alice', age => 27, }, ]; note q{Hard to test CONCURRENT. Just make sure it doesn't break anything and expected data is present}; my $res = $db->load_data_infile(table => 'people', rows => $people, concurrent => 1); is 2, $res->affected_rows, '2 affected rows'; # add values we expect to get back from DB but didn't use on insert $people->[0]{id} = 1; $people->[1]{id} = 2; $_->{insert_time} = undef for @$people; my $people_from_db = $db->query('SELECT * FROM people ORDER BY id ASC')->hashes; is_deeply $people_from_db, $people, 'expected values in db'; note 'Test CONCURRENT is placed in query where expected'; my $module = Test::MockModule->new('Mojo::mysql::Database'); my $query; $module->mock('query' => sub { $query = $_[1] }); $db->load_data_infile(table => 'people', rows => $people, concurrent => 1); like $query, qr/\s*LOAD DATA\s+CONCURRENT\s+LOCAL INFILE '(.*?)'/, 'query contains CONCURRENT in the correct spot for load_data_infile'; undef $query; is $query, undef, 'query is undef'; $db->load_data_infile_p(table => 'people', rows => $people, concurrent => 1); like $query, qr/\s*LOAD DATA\s+CONCURRENT\s+LOCAL INFILE '(.*?)'/, 'query contains CONCURRENT in the correct spot for load_data_infile_p'; done_testing;
31.880597
139
0.629682
edab2197cfe4da4bc2df70f673a208faf67d86e6
885
pm
Perl
auto-lib/Azure/KeyVaultData/BackupCertificate.pm
pplu/azure-sdk-perl
26cbef2d926f571bc1617c26338c106856f95568
[ "Apache-2.0" ]
null
null
null
auto-lib/Azure/KeyVaultData/BackupCertificate.pm
pplu/azure-sdk-perl
26cbef2d926f571bc1617c26338c106856f95568
[ "Apache-2.0" ]
null
null
null
auto-lib/Azure/KeyVaultData/BackupCertificate.pm
pplu/azure-sdk-perl
26cbef2d926f571bc1617c26338c106856f95568
[ "Apache-2.0" ]
1
2021-04-08T15:26:39.000Z
2021-04-08T15:26:39.000Z
package Azure::KeyVaultData::BackupCertificate; use Moose; use MooseX::ClassAttribute; has 'api_version' => (is => 'ro', required => 1, isa => 'Str', default => '7.0', traits => [ 'Azure::ParamInQuery', 'Azure::LocationInResponse' ], location => 'api-version', ); has 'certificate_name' => (is => 'ro', required => 1, isa => 'Str', traits => [ 'Azure::ParamInPath', 'Azure::LocationInResponse' ], location => 'certificate-name', ); class_has _api_uri => (is => 'ro', default => '/certificates/{certificate-name}/backup'); class_has _returns => (is => 'ro', isa => 'HashRef', default => sub { { 200 => 'Azure::KeyVaultData::BackupCertificateResult', default => 'Azure::KeyVaultData::BackupCertificateResult', } }); class_has _is_async => (is => 'ro', default => 0); class_has _api_method => (is => 'ro', default => 'POST'); 1;
38.478261
100
0.612429
eddb4e15ed4a41e43a47c9558aa3dd0787ab7a6b
8,046
pm
Perl
libs/perllib/LoxBerry/Update.pm
mschlenstedt/Loxberry
d9db9fb936544eddd8ac680db2cd61c00bd1c0ec
[ "Apache-2.0" ]
60
2016-07-14T13:19:30.000Z
2022-03-13T11:46:39.000Z
libs/perllib/LoxBerry/Update.pm
mschlenstedt/Loxberry
d9db9fb936544eddd8ac680db2cd61c00bd1c0ec
[ "Apache-2.0" ]
1,251
2016-07-06T12:41:21.000Z
2022-03-30T13:53:04.000Z
libs/perllib/LoxBerry/Update.pm
mschlenstedt/Loxberry
d9db9fb936544eddd8ac680db2cd61c00bd1c0ec
[ "Apache-2.0" ]
43
2016-07-15T05:56:32.000Z
2021-12-23T16:01:20.000Z
# Please increment version number on EVERY change # Major.Minor represents LoxBerry version (e.g. 2.0.3.2 = LoxBerry V2.0.3 the 2nd change) ################################################################ # LoxBerry::Update # THIS LIBRARY IS EXCLUSIVELY USED BY LoxBerry Update AND # SHOULD NOT BE USED IN PLUGINS ################################################################ use strict; use LoxBerry::System; use LoxBerry::Log; use CGI; our $cgi; our $log; our $logfilename; our $updatedir; our $release; our $errors; ################################################################ package LoxBerry::Update; our $VERSION = "2.0.0.2"; our $DEBUG; ### Exports ### use base 'Exporter'; our @EXPORT = qw ( init delete_directory copy_to_loxberry apt_install apt_update apt_remove ); #################################################################### # Init the update script # Reads parameter, inits the logfile #################################################################### sub init { $main::cgi = CGI->new; # Initialize logfile and parameters my $logfilename; if ($main::cgi->param('logfilename')) { $logfilename = $main::cgi->param('logfilename'); } $main::log = LoxBerry::Log->new( package => 'LoxBerry Update', name => 'update', filename => $logfilename, logdir => "$LoxBerry::System::lbslogdir/loxberryupdate", loglevel => 7, stderr => 1, append => 1, ); $main::logfilename = $main::log->filename; if ($main::cgi->param('updatedir') and -d $main::cgi->param('updatedir')) { $main::updatedir = $main::cgi->param('updatedir'); } $main::release = $main::cgi->param('release'); $main::log->OK("Update script $0 started."); } #################################################################### # Removes a folder (including subfolders) # Parameter: # dir/folder to delete #################################################################### sub delete_directory { require File::Path; my $delfolder = shift; if (-d $delfolder) { File::Path::rmtree($delfolder, {error => \my $err}); if (@$err) { for my $diag (@$err) { my ($file, $message) = %$diag; if ($file eq '') { $main::log->ERR(" Delete folder: general error: $message"); } else { $main::log->ERR(" Delete folder: problem unlinking $file: $message"); } } return undef; } } return 1; } #################################################################### # Copy a file or dir from updatedir to lbhomedir including error handling # Parameter: # file/dir starting from ~ # (without /opt/loxberry, with leading /) # owner #################################################################### sub copy_to_loxberry { my ($destparam, $destowner) = @_; if (!$main::updatedir) { $main::log->ERR("copy_to_loxberry: Updatedir not set. Not started from loxberryupdate? Skipping copy of $destparam"); $main::errors++; return; } my $srcfile = $main::updatedir . $destparam; my $destfile = $LoxBerry::System::lbhomedir . $destparam; # Remove trailing slashes $srcfile =~ s/\/\z//; $destfile =~ s/\/\z//; if (! -e $srcfile ) { $main::log->INF("$srcfile does not exist - This file might have been removed in a later LoxBerry verion. No problem."); return; } # Check if source is a file or a directory if ( -d $srcfile ) { $srcfile .= '/*'; `mkdir --parents $destfile`; } if (!$destowner) {$destowner = "root"}; my $output = qx { cp -rf $srcfile $destfile 2>&1 }; my $exitcode = $? >> 8; if ($exitcode != 0) { $main::log->ERR("Error copying $srcfile to $destfile - Error $exitcode"); $main::log->INF("Message: $output"); $main::errors++; } else { $main::log->OK("$destparam installed."); } $output = qx { chown -R $destowner:$destowner $destfile 2>&1 }; $exitcode = $? >> 8; if ($exitcode != 0) { $main::log->ERR("Error changing owner to $destowner for $destfile - Error $exitcode"); $main::log->INF("Message: $output"); $main::errors++; } else { $main::log->OK("$destfile owner changed to $destowner."); } } #################################################################### # Install one or multiple packages with apt # Parameter: # List of packages #################################################################### sub apt_install { my @packages = @_; my $packagelist = join(' ', @packages); my $bins = LoxBerry::System::get_binaries(); my $aptbin = $bins->{APT}; my $export = "APT_LISTCHANGES_FRONTEND=none DEBIAN_FRONTEND=noninteractive"; my $output = qx { $export $aptbin --no-install-recommends -q -y --allow-unauthenticated --fix-broken --reinstall --allow-downgrades --allow-remove-essential --allow-change-held-packages install $packagelist 2>&1 }; my $exitcode = $? >> 8; if ($exitcode != 0) { $main::log->CRIT("Error installing $packagelist - Error $exitcode"); $main::log->DEB($output); $main::errors++; } else { $main::log->OK("Packages $packagelist successfully installed"); } } #################################################################### # Update and clean apt databases and caches # Parameter: # update or none: Update apt database and clean cache # clean: clean cache only #################################################################### sub apt_update { my $command = shift; if (!$command) { $command = "update" }; my $bins = LoxBerry::System::get_binaries(); my $aptbin = $bins->{APT}; my $export = "APT_LISTCHANGES_FRONTEND=none DEBIAN_FRONTEND=noninteractive"; # Repair and update if ( $command eq "update") { my $output = qx { $export /usr/bin/dpkg --configure -a --force-confdef}; my $exitcode = $? >> 8; if ($exitcode != 0) { $main::log->ERR("Error configuring dkpg with /usr/bin/dpkg --configure -a - Error $exitcode"); $main::log->DEB($output); $main::errors++; } else { $main::log->OK("Configuring dpkg successfully."); } $main::log->INF("Clean up apt-databases and update"); $output = qx { $export $aptbin -y -q --allow-unauthenticated --fix-broken --reinstall --allow-downgrades --allow-remove-essential --allow-change-held-packages --purge autoremove }; $exitcode = $? >> 8; if ($exitcode != 0) { $main::log->ERR("Error autoremoving apt packages - Error $exitcode"); $main::log->DEB($output); $main::errors++; } else { $main::log->OK("Apt packages autoremoved successfully."); } $output = qx { $export $aptbin -q -y --allow-unauthenticated --allow-downgrades --allow-remove-essential --allow-change-held-packages --allow-releaseinfo-change update }; $exitcode = $? >> 8; if ($exitcode != 0) { $main::log->ERR("Error updating apt database - Error $exitcode"); $main::log->DEB($output); $main::errors++; } else { $main::log->OK("Apt database updated successfully."); } } # Clean cache my $output = qx { $export $aptbin -q -y clean }; my $exitcode = $? >> 8; if ($exitcode != 0) { $main::log->ERR("Error cleaning apt cache - Error $exitcode"); $main::log->DEB($output); $main::errors++; } else { $main::log->OK("Apt cache cleaned successfully."); } } #################################################################### # Remove one or multiple packages with apt # Parameter: # List of packages #################################################################### sub apt_remove { my @packages = @_; my $packagelist = join(' ', @packages); my $bins = LoxBerry::System::get_binaries(); my $aptbin = $bins->{APT}; my $export = "APT_LISTCHANGES_FRONTEND=none DEBIAN_FRONTEND=noninteractive"; my $output = qx { $export $aptbin -q -y --purge remove $packagelist 2>&1 }; my $exitcode = $? >> 8; if ($exitcode != 0) { $main::log->CRIT("Error removing $packagelist - Error $exitcode"); $main::log->DEB($output); $main::errors++; } else { $main::log->OK("Packages $packagelist successfully removed"); } } ##################################################### # Finally 1; ######################################## ##################################################### 1;
28.633452
215
0.545861