code
stringlengths
2
1.05M
repo_name
stringlengths
5
101
path
stringlengths
4
991
language
stringclasses
3 values
license
stringclasses
5 values
size
int64
2
1.05M
# vim:ts=4 # # Copyright (c) 2010 Hypertriton, Inc. <http://hypertriton.com/> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE # USE OF THIS SOFTWARE EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. sub Test { TryCompile 'HAVE_SELECT', << 'EOF'; #include <sys/types.h> #include <sys/time.h> #include <string.h> #include <unistd.h> #include <errno.h> int main(int argc, char *argv[]) { struct timeval tv; int rv; tv.tv_sec = 1; tv.tv_usec = 1; rv = select(0, NULL, NULL, NULL, &tv); return (rv == -1 && errno != EINTR); } EOF } sub Emul { my ($os, $osrel, $machine) = @_; # Note: On Windows, a kind of select() is available of linking # against WinSock (see winsock.pm) MkEmulUnavail('SELECT'); return (1); } BEGIN { $DESCR{'select'} = 'the select() interface'; $DEPS{'select'} = 'cc'; $TESTS{'select'} = \&Test; $EMUL{'select'} = \&Emul; } ;1
stqism/ToxBuild
ToxBuild/select.pm
Perl
bsd-2-clause
2,040
print "Hello World\n"; exit;
VxGB111/Perl-Programming-Homework
SFBHello.pl
Perl
bsd-2-clause
29
#!/usr/bin/env perl use strict; use warnings; use File::Slurp qw/read_file/; use Algorithm::Combinatorics qw/permutations combinations/; use List::Util qw/max/; use Data::Dumper; my $input = 377; my ($a, $b) = (0,0); my @res = (0); my $pos = 0; for (my $i = 1; $i <= 2017; $i++) { $pos = ($pos+$input) % $i; $pos += 1; splice(@res, $pos, 0, $i); } $a = $res[$pos+1]; print "Part One Result: $a\n"; $pos = 0; for (my $i = 1; $i <= 50000000; $i++) { $pos = ($pos+$input) % $i; $pos += 1; $b = $i if $pos == 1; } print "Part Two Result: $b\n";
Aneurysm9/advent
2017/day17/day17.pl
Perl
bsd-3-clause
552
package DBIx::Class::Storage::DBI::Replicated::Pool; use Moose; use DBIx::Class::Storage::DBI::Replicated::Replicant; use List::Util 'sum'; use Scalar::Util 'reftype'; use DBI (); use MooseX::Types::Moose qw/Num Int ClassName HashRef/; use DBIx::Class::Storage::DBI::Replicated::Types 'DBICStorageDBI'; use Try::Tiny; use namespace::clean -except => 'meta'; =head1 NAME DBIx::Class::Storage::DBI::Replicated::Pool - Manage a pool of replicants =head1 SYNOPSIS This class is used internally by L<DBIx::Class::Storage::DBI::Replicated>. You shouldn't need to create instances of this class. =head1 DESCRIPTION In a replicated storage type, there is at least one replicant to handle the read-only traffic. The Pool class manages this replicant, or list of replicants, and gives some methods for querying information about their status. =head1 ATTRIBUTES This class defines the following attributes. =head2 maximum_lag ($num) This is a number which defines the maximum allowed lag returned by the L<DBIx::Class::Storage::DBI/lag_behind_master> method. The default is 0. In general, this should return a larger number when the replicant is lagging behind its master, however the implementation of this is database specific, so don't count on this number having a fixed meaning. For example, MySQL will return a number of seconds that the replicating database is lagging. =cut has 'maximum_lag' => ( is=>'rw', isa=>Num, required=>1, lazy=>1, default=>0, ); =head2 last_validated This is an integer representing a time since the last time the replicants were validated. It's nothing fancy, just an integer provided via the perl L<time|perlfunc/time> built-in. =cut has 'last_validated' => ( is=>'rw', isa=>Int, reader=>'last_validated', writer=>'_last_validated', lazy=>1, default=>0, ); =head2 replicant_type ($classname) Base class used to instantiate replicants that are in the pool. Unless you need to subclass L<DBIx::Class::Storage::DBI::Replicated::Replicant> you should just leave this alone. =cut has 'replicant_type' => ( is=>'ro', isa=>ClassName, required=>1, default=>'DBIx::Class::Storage::DBI', handles=>{ 'create_replicant' => 'new', }, ); =head2 replicants A hashref of replicant, with the key being the dsn and the value returning the actual replicant storage. For example, if the $dsn element is something like: "dbi:SQLite:dbname=dbfile" You could access the specific replicant via: $schema->storage->replicants->{'dbname=dbfile'} This attributes also supports the following helper methods: =over 4 =item set_replicant($key=>$storage) Pushes a replicant onto the HashRef under $key =item get_replicant($key) Retrieves the named replicant =item has_replicants Returns true if the Pool defines replicants. =item num_replicants The number of replicants in the pool =item delete_replicant ($key) Removes the replicant under $key from the pool =back =cut has 'replicants' => ( is=>'rw', traits => ['Hash'], isa=>HashRef['Object'], default=>sub {{}}, handles => { 'set_replicant' => 'set', 'get_replicant' => 'get', 'has_replicants' => 'is_empty', 'num_replicants' => 'count', 'delete_replicant' => 'delete', 'all_replicant_storages' => 'values', }, ); around has_replicants => sub { my ($orig, $self) = @_; return !$self->$orig; }; has next_unknown_replicant_id => ( is => 'rw', traits => ['Counter'], isa => Int, default => 1, handles => { 'inc_unknown_replicant_id' => 'inc', }, ); =head2 master Reference to the master Storage. =cut has master => (is => 'rw', isa => DBICStorageDBI, weak_ref => 1); =head1 METHODS This class defines the following methods. =head2 connect_replicants ($schema, Array[$connect_info]) Given an array of $dsn or connect_info structures suitable for connected to a database, create an L<DBIx::Class::Storage::DBI::Replicated::Replicant> object and store it in the L</replicants> attribute. =cut sub connect_replicants { my $self = shift @_; my $schema = shift @_; my @newly_created = (); foreach my $connect_info (@_) { $connect_info = [ $connect_info ] if reftype $connect_info ne 'ARRAY'; my $connect_coderef = (reftype($connect_info->[0])||'') eq 'CODE' ? $connect_info->[0] : (reftype($connect_info->[0])||'') eq 'HASH' && $connect_info->[0]->{dbh_maker}; my $dsn; my $replicant = do { # yes this is evil, but it only usually happens once (for coderefs) # this will fail if the coderef does not actually DBI::connect no warnings 'redefine'; my $connect = \&DBI::connect; local *DBI::connect = sub { $dsn = $_[1]; goto $connect; }; $self->connect_replicant($schema, $connect_info); }; my $key; if (!$dsn) { if (!$connect_coderef) { $dsn = $connect_info->[0]; $dsn = $dsn->{dsn} if (reftype($dsn)||'') eq 'HASH'; } else { # all attempts to get the DSN failed $key = "UNKNOWN_" . $self->next_unknown_replicant_id; $self->inc_unknown_replicant_id; } } if ($dsn) { $replicant->dsn($dsn); ($key) = ($dsn =~ m/^dbi\:.+\:(.+)$/i); } $replicant->id($key); $self->set_replicant($key => $replicant); push @newly_created, $replicant; } return @newly_created; } =head2 connect_replicant ($schema, $connect_info) Given a schema object and a hashref of $connect_info, connect the replicant and return it. =cut sub connect_replicant { my ($self, $schema, $connect_info) = @_; my $replicant = $self->create_replicant($schema); $replicant->connect_info($connect_info); ## It is undesirable for catalyst to connect at ->conect_replicants time, as ## connections should only happen on the first request that uses the database. ## So we try to set the driver without connecting, however this doesn't always ## work, as a driver may need to connect to determine the DB version, and this ## may fail. ## ## Why this is necessary at all, is that we need to have the final storage ## class to apply the Replicant role. $self->_safely($replicant, '->_determine_driver', sub { $replicant->_determine_driver }); Moose::Meta::Class->initialize(ref $replicant); DBIx::Class::Storage::DBI::Replicated::Replicant->meta->apply($replicant); # link back to master $replicant->master($self->master); return $replicant; } =head2 _safely_ensure_connected ($replicant) The standard ensure_connected method with throw an exception should it fail to connect. For the master database this is desirable, but since replicants are allowed to fail, this behavior is not desirable. This method wraps the call to ensure_connected in an eval in order to catch any generated errors. That way a slave can go completely offline (e.g. the box itself can die) without bringing down your entire pool of databases. =cut sub _safely_ensure_connected { my ($self, $replicant, @args) = @_; return $self->_safely($replicant, '->ensure_connected', sub { $replicant->ensure_connected(@args) }); } =head2 _safely ($replicant, $name, $code) Execute C<$code> for operation C<$name> catching any exceptions and printing an error message to the C<<$replicant->debugobj>>. Returns 1 on success and undef on failure. =cut sub _safely { my ($self, $replicant, $name, $code) = @_; return try { $code->(); 1; } catch { $replicant->debugobj->print(sprintf( "Exception trying to $name for replicant %s, error is %s", $replicant->_dbi_connect_info->[0], $_) ); undef; }; } =head2 connected_replicants Returns true if there are connected replicants. Actually is overloaded to return the number of replicants. So you can do stuff like: if( my $num_connected = $storage->has_connected_replicants ) { print "I have $num_connected connected replicants"; } else { print "Sorry, no replicants."; } This method will actually test that each replicant in the L</replicants> hashref is actually connected, try not to hit this 10 times a second. =cut sub connected_replicants { my $self = shift @_; return sum( map { $_->connected ? 1:0 } $self->all_replicants ); } =head2 active_replicants This is an array of replicants that are considered to be active in the pool. This does not check to see if they are connected, but if they are not, DBIC should automatically reconnect them for us when we hit them with a query. =cut sub active_replicants { my $self = shift @_; return ( grep {$_} map { $_->active ? $_:0 } $self->all_replicants ); } =head2 all_replicants Just a simple array of all the replicant storages. No particular order to the array is given, nor should any meaning be derived. =cut sub all_replicants { my $self = shift @_; return values %{$self->replicants}; } =head2 validate_replicants This does a check to see if 1) each replicate is connected (or reconnectable), 2) that is ->is_replicating, and 3) that it is not exceeding the lag amount defined by L</maximum_lag>. Replicants that fail any of these tests are set to inactive, and thus removed from the replication pool. This tests L</all_replicants>, since a replicant that has been previous marked as inactive can be reactivated should it start to pass the validation tests again. See L<DBIx::Class::Storage::DBI> for more about checking if a replicating connection is not following a master or is lagging. Calling this method will generate queries on the replicant databases so it is not recommended that you run them very often. This method requires that your underlying storage engine supports some sort of native replication mechanism. Currently only MySQL native replication is supported. Your patches to make other replication types work are welcomed. =cut sub validate_replicants { my $self = shift @_; foreach my $replicant($self->all_replicants) { if($self->_safely_ensure_connected($replicant)) { my $is_replicating = $replicant->is_replicating; unless(defined $is_replicating) { $replicant->debugobj->print("Storage Driver ".ref($self)." Does not support the 'is_replicating' method. Assuming you are manually managing.\n"); next; } else { if($is_replicating) { my $lag_behind_master = $replicant->lag_behind_master; unless(defined $lag_behind_master) { $replicant->debugobj->print("Storage Driver ".ref($self)." Does not support the 'lag_behind_master' method. Assuming you are manually managing.\n"); next; } else { if($lag_behind_master <= $self->maximum_lag) { $replicant->active(1); } else { $replicant->active(0); } } } else { $replicant->active(0); } } } else { $replicant->active(0); } } ## Mark that we completed this validation. $self->_last_validated(time); } =head1 FURTHER QUESTIONS? Check the list of L<additional DBIC resources|DBIx::Class/GETTING HELP/SUPPORT>. =head1 COPYRIGHT AND LICENSE This module is free software L<copyright|DBIx::Class/COPYRIGHT AND LICENSE> by the L<DBIx::Class (DBIC) authors|DBIx::Class/AUTHORS>. You can redistribute it and/or modify it under the same terms as the L<DBIx::Class library|DBIx::Class/COPYRIGHT AND LICENSE>. =cut __PACKAGE__->meta->make_immutable; 1;
ray66rus/vndrv
local/lib/perl5/DBIx/Class/Storage/DBI/Replicated/Pool.pm
Perl
apache-2.0
11,439
#!/usr/bin/perl # <copyright> # Copyright (c) 2013-2016 Intel Corporation. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of Intel Corporation nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # </copyright> # Pragmas. use strict; use warnings; use FindBin; use lib "$FindBin::Bin/lib"; # LIBOMP modules. use Platform ":vars"; use tools; our $VERSION = "0.015"; my $pedantic; # -------------------------------------------------------------------------------------------------- # Helper functions # -------------------------------------------------------------------------------------------------- sub run($\$\$;\$) { my ( $cmd, $stdout, $stderr, $path ) = @_; my ( @path, $rc ); @path = which( $cmd->[ 0 ], -all => 1 ); if ( @path > 0 ) { if ( @path > 1 and $pedantic ) { warning( "More than one \"$cmd->[ 0 ]\" found in PATH:", map( " $_", @path ) ); }; # if debug( "\"$cmd->[ 0 ]\" full path is \"$path[ 0 ]\"." ); if ( defined( $path ) ) { $$path = $path[ 0 ]; }; # if debug( "Executing command: \"" . join ( " ", @$cmd ) . "\"." ); $rc = execute( $cmd, -ignore_signal => 1, -ignore_status => 1, -stdout => $stdout, -stderr => $stderr, -stdin => undef ); if ( $rc < 0 ) { warning( "Cannot run \"$cmd->[ 0 ]\": $@" ); }; # if debug( "stdout:", $$stdout, "(eof)", "stderr:", $$stderr, "(eof)" ); } else { warning( "No \"$cmd->[ 0 ]\" found in PATH." ); $rc = -1; }; # if return $rc; }; # sub run sub get_arch($$$) { my ( $name, $str, $exps ) = @_; my ( $arch, $count ); $count = 0; foreach my $re ( keys( %$exps ) ) { if ( $str =~ $re ) { $arch = $exps->{ $re }; ++ $count; }; # if }; # for if ( $count != 1 or not Platform::canon_arch( $arch ) ) { warning( "Cannot detect $name architecture: $str" ); return undef; }; # if return $arch; }; # sub get_arch sub encode($) { my ( $str ) = @_; $str =~ s{ }{_}g; return $str; }; # sub encode # -------------------------------------------------------------------------------------------------- # get_xxx_version subroutines. # -------------------------------------------------------------------------------------------------- # # Some of get_xxx_version() subroutines accept an argument -- a tool name. For example, # get_intel_compiler_version() can report version of C, C++, or Fortran compiler. The tool for # report should be specified by argument, for example: get_intel_compiler_version( "ifort" ). # # get_xxx_version() subroutines returns list of one or two elements: # 1. The first element is short tool name (like "gcc", "g++", "icl", etc). # 2. The second element is version string. # If returned list contain just one element, it means there is a problem with the tool. # sub get_perl_version() { my ( $rc, $stdout, $stderr, $version ); my $tool = "perl"; my ( @ret ) = ( $tool ); $rc = run( [ $tool, "--version" ], $stdout, $stderr ); if ( $rc >= 0 ) { # Typical perl output: # This is perl, v5.10.0 built for x86_64-linux-thread-multi # This is perl, v5.8.8 built for MSWin32-x64-multi-thread # This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi if ( $stdout !~ m{^This is perl.*v(\d+\.\d+(?:\.\d+)).*built for}m ) { warning( "Cannot parse perl output:", $stdout, "(oef)" ); }; # if $version = $1; if ( $target_os eq "win" ) { if ( $stdout !~ m{Binary build (.*) provided by ActiveState } ) { warning( "Perl is not ActiveState one" ); }; # if }; # if }; # if push( @ret, $version ); return @ret; }; # sub get_perl_version sub get_gnu_make_version() { my ( $rc, $stdout, $stderr, $version ); my $tool = "make"; my ( @ret ) = ( $tool ); my ( $path ); $rc = run( [ $tool, "--version" ], $stdout, $stderr, $path ); if ( $rc >= 0 ) { # Typical make output: # GNU Make version 3.79.1, by Richard Stallman and Roland McGrath. # GNU Make 3.81 if ( $stdout =~ m{^GNU Make (?:version )?(\d+\.\d+(?:\.\d+)?)(?:,|\s)} ) { $version = $1; }; # if if ( $target_os eq "win" and $stdout =~ m{built for ([a-z0-9-]+)} ) { my $built_for = $1; debug( "GNU Make built for: \"$built_for\"." ); if ( $built_for =~ m{cygwin}i ) { warning( "\"$path\" is a Cygwin make, it is *not* suitable." ); return @ret; }; # if }; # if }; # if push( @ret, $version ); return @ret; }; # sub get_gnu_make_version sub get_intel_compiler_version($) { my ( $tool ) = @_; # Tool name, like "icc", "icpc", "icl", or "ifort". my ( @ret ) = ( $tool ); my ( $rc, $stdout, $stderr, $tool_re ); my $version; my $ic_archs = { qr{32-bit|IA-32} => "32", qr{Intel\(R\) 64} => "32e", qr{Intel\(R\) [M][I][C] Architecture} => "32e", }; $tool_re = quotemeta( $tool ); $rc = run( [ $tool, ( $target_os eq "win" ? () : ( "-V" ) ) ], $stdout, $stderr ); if ( $rc < 0 ) { return @ret; }; # if # Intel compiler version string is in the first line of stderr. Get it. #$stderr =~ m{\A(.*\n?)}; # AC: Let's look for version string in the first line which contains "Intel" string. # This allows to use 11.1 and 12.0 compilers on new MAC machines by ignoring # huge number of warnings issued by old compilers. $stderr =~ m{^(Intel.*)$}m; my $vstr = $1; my ( $apl, $ver, $bld, $pkg ); if ( 0 ) { } elsif ( $vstr =~ m{^Intel.*?Compiler\s+(.*?),?\s+Version\s+(.*?)\s+Build\s+(\S+)(?:\s+Package ID: (\S+))?} ) { # 9.x, 10.x, 11.0. ( $apl, $ver, $bld, $pkg ) = ( $1, $2, $3, $4 ); } elsif ( $vstr =~ m{^Intel's (.*?) Compiler,?\s+Version\s+(.*?)\s+Build\s+(\S+)} ) { # 11.1 ( $apl, $ver, $bld ) = ( $1, $2, $3 ); } else { warning( "Cannot parse ${tool}'s stderr:", $stderr, "(eof)" ); return @ret; }; # if my $ic_arch = get_arch( "Intel compiler", $apl, $ic_archs ); if ( not defined( $ic_arch ) ) { return @ret; }; # if if ( Platform::canon_arch( $ic_arch ) ne $target_arch and not (Platform::canon_arch($ic_arch) eq "32e" and $target_arch eq "mic" )) { warning( "Target architecture is $target_arch, $tool for $ic_arch found." ); return @ret; }; # if # Normalize version. my $stage; $ver =~ s{\s+}{ }g; $ver = lc( $ver ); if ( $ver =~ m{\A(\d+\.\d+(?:\.\d+)?) ([a-z]+)\a}i ) { ( $version, $stage ) = ( $1, $2 ); } else { ( $version, $stage ) = ( $ver, "" ); }; # if # Parse package. if ( defined( $pkg ) ) { if ( $pkg !~ m{\A[lwm]_[a-z]+_[a-z]_(\d+\.\d+\.\d+)\z}i ) { warning( "Cannot parse Intel compiler package: $pkg" ); return @ret; }; # if $pkg = $1; $version = $pkg; }; # if push( @ret, "$version " . ( $stage ? "$stage " : "" ) . "($bld) for $ic_arch" ); # Ok, version of Intel compiler found successfully. Now look at config file. # Installer of Intel compiler tends to add a path to MS linker into compiler config file. # It leads to troubles. For example, all the environment set up for MS VS 2005, but Intel # compiler uses lnker from MS VS 2003 because it is specified in config file. # To avoid such troubles, make sure: # ICLCFG/IFORTCFG environment variable exists or # compiler config file does not exist, or # compiler config file does not specify linker. if ( $target_os eq "win" ) { if ( not exists( $ENV{ uc( $tool . "cfg" ) } ) ) { # If ICLCFG/IFORTCFG environment varianle exists, everything is ok. # Otherwise check compiler's config file. my $path = which( $tool ); $path =~ s{\.exe\z}{}i; # Drop ".exe" suffix. $path .= ".cfg"; # And add ".cfg" one. if ( -f $path ) { # If no config file exists, it is ok. # Otherwise analyze its content. my $bulk = read_file( $path ); $bulk =~ s{#.*\n}{}g; # Remove comments. my @options = ( "Qvc", "Qlocation,link," ); foreach my $opt ( @options ) { if ( $bulk =~ m{[-/]$opt} ) { warning( "Compiler config file \"$path\" contains \"-$opt\" option." ); }; # if }; # foreach }; # if }; # if }; # if return @ret; }; # sub get_intel_compiler_version sub get_gnu_compiler_version($) { my ( $tool ) = @_; my ( @ret ) = ( $tool ); my ( $rc, $stdout, $stderr, $version ); $rc = run( [ $tool, "--version" ], $stdout, $stderr ); if ( $rc >= 0 ) { my ( $ver, $bld ); if ( $target_os eq "mac" ) { # i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build 5367) # i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5484) # i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00) $stdout =~ m{^.*? \(GCC\) (\d+\.\d+\.\d+) \(.*Apple.*?Inc\. build (\d+)\)}m; ( $ver, $bld ) = ( $1, $2 ); } else { if ( 0 ) { } elsif ( $stdout =~ m{^.*? \(GCC\) (\d+\.\d+\.\d+)(?: (\d+))?}m ) { # g++ (GCC) 3.2.3 20030502 (Red Hat Linux 3.2.3-20) # GNU Fortran (GCC) 4.3.2 20081105 (Red Hat 4.3.2-7) ( $ver, $bld ) = ( $1, $2 ); } elsif ( $stdout =~ m{^.*? \(SUSE Linux\) (\d+\.\d+\.\d+)\s+\[.*? (\d+)\]}m ) { # gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291] ( $ver, $bld ) = ( $1, $2 ); } elsif ( $stdout =~ m{^.*? \(SUSE Linux\) (\d+\.\d+\.\d+)\s+\d+\s+\[.*? (\d+)\]}m ) { # gcc (SUSE Linux) 4.7.2 20130108 [gcc-4_7-branch revision 195012] ( $ver, $bld ) = ( $1, $2 ); } elsif ( $stdout =~ m{^.*? \((Debian|Ubuntu).*?\) (\d+\.\d+\.\d+)}m ) { # gcc (Debian 4.7.2-22) 4.7.2 # Debian support from Sylvestre Ledru # Thanks! $ver = $2; }; # if }; # if if ( defined( $ver ) ) { $version = $ver . ( defined( $bld ) ? " ($bld)" : "" ); } else { warning( "Cannot parse GNU compiler version:", $stdout, "(eof)" ); }; # if }; # if push( @ret, $version ); return @ret; }; # sub get_gnu_compiler_version sub get_clang_compiler_version($) { my ( $tool ) = @_; my ( @ret ) = ( $tool ); my ( $rc, $stdout, $stderr, $version ); $rc = run( [ $tool, "--version" ], $stdout, $stderr ); if ( $rc >= 0 ) { my ( $ver, $bld ); if ( $target_os eq "mac" ) { # Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) $stdout =~ m{^.*? (\d+\.\d+) \(.*-(\d+\.\d+\.\d+)\)}m; ( $ver, $bld ) = ( $1, $2 ); # For custom clang versions. if ( not defined($ver) and $stdout =~ m{^.*? (\d+\.\d+)( \((.*)\))?}m ) { ( $ver, $bld ) = ( $1, $3 ); } } else { if ( 0 ) { } elsif ( $stdout =~ m{^.*? (\d+\.\d+)( \((.*)\))?}m ) { # clang version 3.3 (tags/RELEASE_33/final) ( $ver, $bld ) = ( $1, $3 ); } }; # if if ( defined( $ver ) ) { $version = $ver . ( defined( $bld ) ? " ($bld)" : "" ); } else { warning( "Cannot parse Clang compiler version:", $stdout, "(eof)" ); }; # if }; # if push( @ret, $version ); return @ret; }; # sub get_gnu_compiler_version sub get_ms_compiler_version() { my ( $rc, $stdout, $stderr, $version ); my $tool = "cl"; my ( @ret ) = ( $tool ); my $mc_archs = { qr{80x86|x86} => "IA-32 architecture", qr{AMD64|x64} => "Intel(R) 64", }; $rc = run( [ $tool ], $stdout, $stderr ); if ( $rc < 0 ) { return @ret; }; # if if ( $stderr !~ m{^Microsoft .* Compiler Version (.*?) for (.*)\s*$}m ) { warning( "Cannot parse MS compiler output:", $stderr, "(eof)" ); return @ret; }; # if my ( $ver, $apl ) = ( $1, $2 ); if ( $ver !~ m{\A\d+(?:\.\d+)+\z} ) { warning( "Cannot parse MS compiler version: $ver" ); return @ret; }; # if my $mc_arch = get_arch( "MS compiler", $apl, $mc_archs ); if ( not defined( $mc_arch ) ) { return @ret; }; # if if ( Platform::canon_arch( $mc_arch ) ne $target_arch ) { warning( "Target architecture is $target_arch, $tool for $mc_arch found" ); return @ret; }; # if $version = "$ver for $target_arch"; push( @ret, $version ); return @ret; }; # sub get_ms_compiler_version sub get_ms_linker_version() { my ( $rc, $stdout, $stderr, $version ); my $tool = "link"; my ( @ret ) = ( $tool ); my ( $path ); $rc = run( [ $tool ], $stdout, $stderr, $path ); if ( $rc < 0 ) { return @ret; }; # if if ( $stdout !~ m{^Microsoft \(R\) Incremental Linker Version (\d+(?:\.\d+)+)\s*$}m ) { warning( "Cannot parse MS linker output:", $stdout, "(eof)" ); if ( $stderr =~ m{^link: missing operand} ) { warning( "Seems \"$path\" is a Unix-like \"link\" program, not MS linker." ); }; # if return @ret; }; # if $version = ( $1 ); push( @ret, $version ); return @ret; }; # sub get_ms_linker_version # -------------------------------------------------------------------------------------------------- # "main" program. # -------------------------------------------------------------------------------------------------- my $make; my $intel = 1; # Check Intel compilers. my $fortran = 0; # Check for corresponding Fortran compiler, ifort for intel # gfortran for gnu # gfortran for clang my $clang = 0; # Check Clang Compilers. my $intel_compilers = { "lin" => { c => "icc", cpp => "icpc", f => "ifort" }, "mac" => { c => "icc", cpp => "icpc", f => "ifort" }, "win" => { c => "icl", cpp => undef, f => "ifort" }, }; my $gnu_compilers = { "lin" => { c => "gcc", cpp => "g++", f => "gfortran" }, "mac" => { c => "gcc", cpp => "g++", f => "gfortran" }, }; my $clang_compilers = { "lin" => { c => "clang", cpp => "clang++" }, "mac" => { c => "clang", cpp => "clang++" }, }; get_options( Platform::target_options(), "intel!" => \$intel, "fortran" => \$fortran, "clang" => \$clang, "make" => \$make, "pedantic" => \$pedantic, ); my @versions; push( @versions, [ "Perl", get_perl_version() ] ); push( @versions, [ "GNU Make", get_gnu_make_version() ] ); if ( $intel ) { my $ic = $intel_compilers->{ $target_os }; push( @versions, [ "Intel C Compiler", get_intel_compiler_version( $ic->{ c } ) ] ); if ( defined( $ic->{ cpp } ) ) { # If Intel C++ compiler has a name different from C compiler, check it as well. push( @versions, [ "Intel C++ Compiler", get_intel_compiler_version( $ic->{ cpp } ) ] ); }; # if # fortran check must be explicitly specified on command line with --fortran if ( $fortran ) { if ( defined( $ic->{ f } ) ) { push( @versions, [ "Intel Fortran Compiler", get_intel_compiler_version( $ic->{ f } ) ] ); }; # if }; }; # if if ( $target_os eq "lin" or $target_os eq "mac" ) { # check for clang/gnu tools because touch-test.c is compiled with them. if ( $clang or $target_os eq "mac" ) { # OS X* >= 10.9 discarded GNU compilers. push( @versions, [ "Clang C Compiler", get_clang_compiler_version( $clang_compilers->{ $target_os }->{ c } ) ] ); push( @versions, [ "Clang C++ Compiler", get_clang_compiler_version( $clang_compilers->{ $target_os }->{ cpp } ) ] ); } else { push( @versions, [ "GNU C Compiler", get_gnu_compiler_version( $gnu_compilers->{ $target_os }->{ c } ) ] ); push( @versions, [ "GNU C++ Compiler", get_gnu_compiler_version( $gnu_compilers->{ $target_os }->{ cpp } ) ] ); }; # if intel fortran has been checked then gnu fortran is unnecessary # also, if user specifies clang as build compiler, then gfortran is assumed fortran compiler if ( $fortran and not $intel ) { push( @versions, [ "GNU Fortran Compiler", get_gnu_compiler_version( $gnu_compilers->{ $target_os }->{ f } ) ] ); }; }; if ( $target_os eq "win" ) { push( @versions, [ "MS C/C++ Compiler", get_ms_compiler_version() ] ); push( @versions, [ "MS Linker", get_ms_linker_version() ] ); }; # if my $count = 0; foreach my $item ( @versions ) { my ( $title, $tool, $version ) = @$item; if ( not defined( $version ) ) { $version = "--- N/A ---"; ++ $count; }; # if if ( $make ) { printf( "%s=%s\n", encode( $tool ), encode( $version ) ); } else { printf( "%-25s: %s\n", $title, $version ); }; # if }; # foreach exit( $count == 0 ? 0 : 1 ); __END__ =pod =head1 NAME B<check-tools.pl> -- Check development tools availability and versions. =head1 SYNOPSIS B<check-tools.pl> I<OPTION>... =head1 OPTIONS =over =item B<--make> Produce output suitable for using in makefile: short tool names (e. g. "icc" instead of "Intel C Compiler"), spaces in version strings replaced with underscores. =item Tools selection =over =item B<-->[B<no->]B<-gnu-fortran> Check GNU Fortran compiler. By default, it is not checked. =item B<-->[B<no->]B<intel> Check Intel C, C++ and Fortran compilers. This is default. =back =item Platform selection =over =item B<--architecture=>I<str> Specify target architecture. Used in cross-builds, for example when building 32-bit applications on Intel(R) 64 machine. If architecture is not specified explicitly, value of LIBOMP_ARCH environment variable is used. If LIBOMP_ARCH is not defined, host architecture detected. =item B<--os=>I<str> Specify target OS name. Used in cross-builds, for example when building Intel(R) Many Integrated Core Architecture applications on Windows* OS. If OS is not specified explicitly, value of LIBOMP_OS environment variable is used. If LIBOMP_OS is not defined, host OS detected. =back =back =head2 Standard Options =over =item B<--doc> =item B<--manual> Print full help message and exit. =item B<--help> Print short help message and exit. =item B<--usage> Print very short usage message and exit. =item B<--verbose> Do print informational messages. =item B<--version> Print version and exit. =item B<--quiet> Work quiet, do not print informational messages. =back =head1 DESCRIPTION This script checks availability and versions of development tools. By default, the script checks: Perl, GNU Make, Intel compilers, GNU C and C++ compilers (Linux* OS and OS X*), Microsoft C/C++ compiler and linker (Windows* OS). The sript prints nice looking table or machine-readable strings. =head2 EXIT =over =item * 0 -- All programs found. =item * 1 -- Some of tools are not found. =back =head1 EXAMPLES $ check-tools.pl Perl : 5.8.0 GNU Make : 3.79.1 Intel C Compiler : 11.0 (20080930) for 32e Intel C++ Compiler : 11.0 (20080930) for 32e Intel Fortran Compiler : 10.1.008 (20070913) for 32e GNU C Compiler : 3.2.3 (20030502) GNU C++ Compiler : 3.2.3 (20030502) > check-tools.pl --make perl=5.8.8 make=3.81 icl=10.1_(20070913)_for_32e ifort=10.1_(20070913)_for_32e cl=14.00.40310.41_for_32e link=8.00.40310.39 =back =cut # end of file #
passlab/intel-openmp-runtime
tools/check-tools.pl
Perl
bsd-3-clause
21,858
=head1 NAME toaster.conf - Configuration file for Mail::Toaster =head1 SYNOPSIS man pages for options in toaster.conf =head1 DESCRIPTION toaster.conf - This document provides details on what all them nifty settings do. A current copy of toaster.conf is posted on the Mail::Toaster web site at http://mail-toaster.org/etc/toaster.conf =head2 SITE SETTINGS ####################################### # Mail::Toaster::Logs # ####################################### This section lets you configure the logging behavior on your toaster. This section is used primarily by the maillogs script. Note that there are also settings which affect logs in toaster-watcher.conf logs_base = /var/log/mail If you store your logs somewhere else, change this. (Some people prefer /var/log/qmail, following "Life with Qmail") logs_supervise = /var/qmail/supervise The location of your supervise directory. The supervise directory contains control files for all supervised services available on your machine, even if they aren't running. THE DIFFERENCE BETWEEN SUPERVISE AND SERVICE DIRS The supervise directory is where all the control files are created and where they'll live forever and ever, even if they aren't used. The supervise directory can be the same as the service directory, but it shouldn't be. Per Dan & LWQ docs, the service directory should exist elsewhere. On FreeBSD /var/service is the most appropriate location (man hier for details). In the service directory you create symlinks to the supervised directories you want running. A good example of this is that many toaster run courier-imap's pop3 daemon instead of qmails. Yet, the qmail pop3 daemons supervise directory is still build in /var/qmail/supervise but not symlinked in /var/service and thus not running. Switching from courier to qmail's is typically as easy as: pop3 stop rm /usr/local/etc/rc.d/pop3.sh ln -s /var/qmail/supervise/pop3 /var/service It's important to undertand the difference. logs_user = qmaill logs_group = qnofiles What user and group should own the toaster logfiles? logs_pop3d = qpop3d # courier | qpop3d The toaster used to use the courier pop3 server; now it uses the qmail pop3 server. If you are upgrading an older toaster and wish to continue using courier, make sure you change this. logs_isoqlog = 1 # configure isoqlog first! Will you process your logs with isoqlog? Make sure you heed the warning in the comment-- if you don't configure the isoqlog.conf file, but you leave this set to 1, bad things happen. If you haven't gotten around to configuring isoqlog, change this to 0 until you do. (MATT says: a default isoqlog file is now installed with reasonable defaults). If you have more than 50 domains, you'll have to set up a script that concatenates rcpthosts and morercpthosts to a new file for isoqlog to get its domain list from). logs_taifiles = 1 Today's logfiles will be in filenames timestamped in the tai64n format. For example, a file called @400000004030ff6b05921044.s was created at 2004-02-16 12:35:29.093458500. To view these filenames in a human readable format, go to your log directory and enter ls | tai64nlocal. Be warned, if you disable this option, then qmailanalog processing will fail and your nightly qmail activity log will not work as you would hope and expect. logs_archive = 1 For example, the SMTP log file for February 14, 2004, is called 2004/02/14/smtplog.gz, unless you are looking at todays logs. Prior days log files are automatically compressed. This directory tree lives inside your logs_base directory. If you set this option to 0, old logs are not archived-- they are deleted. qmailanalog_bin = /usr/local/qmailanalog/bin The directory to your qmailanalog bin files. logs_counters = counters A directory inside your logs_base directory, which stores the counter files used by maillogs. logs_rbl_count = smtp_rbl.txt logs_smtp_count = smtp_auth.txt logs_send_count = send.txt logs_pop3_count = pop3.txt logs_imap_count = imap.txt logs_spam_count = spam.txt logs_virus_count = virus.txt logs_web_count = webmail.txt The names of the counter files in the logs_counters directory. =head1 AUTHOR David Chaplin-Loebell <david@klatha.com> Matt Simerson <matt@tnpi.net> David undertook the writing of this documentation for which I (Matt) and the toaster community are VERY grateful. Thank you David, and may the source always be with you. =head1 SEE ALSO Mail::Toaster::Conf toaster-watcher.conf =head1 COPYRIGHT Copyright (c) 2004-2008, The Network People, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the The Network People, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. =cut
msimerson/Mail-Toaster
lib/toaster.conf.pod
Perl
bsd-3-clause
6,125
package Cpanel::Easy::Speed; our $easyconfig = { 'name' => 'mod_pagespeed', 'url' => 'http://www.prajith.in', 'note' => 'mod_pagespeed for Apache 2.x', 'hastargz' => 1, 'ensurepkg' => [qw{rpm cpio}], 'depends' => { 'optmods' => { 'Cpanel::Easy::Apache::Deflate' => 1, 'Cpanel::Easy::Apache::Version' => 0, }, }, 'implies' => { 'Cpanel::Easy::Apache::Deflate' => 1, 'Cpanel::Easy::Apache::Version' => 0, 'Cpanel::Easy::ModRuid2' => 0, }, 'src_cd2' => 'pagespeed/', 'when_i_am_off' => sub { my ($self) = @_; my $unlink_file = "/usr/local/apache/conf/pagespeed.conf"; unlink $unlink_file; if ( -e $unlink_file ) { $self->print_alert( q{unlink '[_1]' failed: [_2]}, $unlink_file, $! ); } $self->strip_from_httpconf( 'Include "/usr/local/apache/conf/pagespeed.conf"' ); }, 'modself' => sub { # we do not need to use 'reverse' when selecting mod_version in # Apache 2.4 because cPanel use './configure --enable-modules=none'. my ( $easy, $self_hr, $profile_hr ) = @_; if ( $profile_hr->{'Apache'}{'version'} eq '2_4' ) { $self_hr->{'implies'} = { 'Cpanel::Easy::Apache::Deflate' => 1, 'Cpanel::Easy::Apache::Version' => 1, 'Cpanel::Easy::ModRuid2' => 0, }; $self_hr->{'depends'} = { 'optmods' => { 'Cpanel::Easy::Apache::Deflate' => 1, 'Cpanel::Easy::Apache::Version' => 1, 'Cpanel::Easy::ModRuid2' => 0, }, }, } }, 'step' => { '0' => { 'name' => 'Installing mod_pagespeed', 'command' => sub { my ($self) = @_; $self->print_alert_color( 'green', 'Starting mod_pagespeed installation' ); my $path = 'speed-install'; if ( !-e $path ) { return ( 0, q{speed-install script is missing in source directory} ); } my @rc = $self->run_system_cmd_returnable( [ './speed-install' ]); return @rc; }, }, '1' => { 'name' => 'Activating mod_pagespeed', 'command' => sub { my ($self) = @_; my $file = '/usr/local/apache/conf/pagespeed.conf'; $self->print_alert_color( 'green', 'Activating mod_pagespeed' ); $self->strip_from_httpconf('<IfModule pagespeed_module>'); return $self->include_directive_handler( { 'include_path' => $file, 'addmodule' => qr{mod_pagespeed}, 'loadmodule' => qr{pagespeed_module}, } ); }, } } # end step } # end easyconfig
Prajithp/cpanel
Easy/Speed.pm
Perl
mit
2,495
=pod =head1 NAME X509_cmp, X509_NAME_cmp, X509_issuer_and_serial_cmp, X509_issuer_name_cmp, X509_subject_name_cmp, X509_CRL_cmp, X509_CRL_match - compare X509 certificates and related values =head1 SYNOPSIS #include <openssl/x509.h> int X509_cmp(const X509 *a, const X509 *b); int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b); int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b); int X509_issuer_name_cmp(const X509 *a, const X509 *b); int X509_subject_name_cmp(const X509 *a, const X509 *b); int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b); int X509_CRL_match(const X509_CRL *a, const X509_CRL *b); =head1 DESCRIPTION This set of functions are used to compare X509 objects, including X509 certificates, X509 CRL objects and various values in an X509 certificate. The X509_cmp() function compares two B<X509> objects indicated by parameters I<a> and I<b>. The comparison is based on the B<memcmp> result of the hash values of two B<X509> objects and the canonical (DER) encoding values. The X509_NAME_cmp() function compares two B<X509_NAME> objects indicated by parameters I<a> and I<b>. The comparison is based on the B<memcmp> result of the canonical (DER) encoding values of the two objects using L<i2d_X509_NAME(3)>. This procedure adheres to the matching rules for Distinguished Names (DN) given in RFC 4517 section 4.2.15 and RFC 5280 section 7.1. In particular, the order of Relative Distinguished Names (RDNs) is relevant. On the other hand, if an RDN is multi-valued, i.e., it contains a set of AttributeValueAssertions (AVAs), its members are effectively not ordered. The X509_issuer_and_serial_cmp() function compares the serial number and issuer values in the given B<X509> objects I<a> and I<b>. The X509_issuer_name_cmp(), X509_subject_name_cmp() and X509_CRL_cmp() functions are effectively wrappers of the X509_NAME_cmp() function. These functions compare issuer names and subject names of the X<509> objects, or issuers of B<X509_CRL> objects, respectively. The X509_CRL_match() function compares two B<X509_CRL> objects. Unlike the X509_CRL_cmp() function, this function compares the whole CRL content instead of just the issuer name. =head1 RETURN VALUES The B<X509> comparison functions return B<-1>, B<0>, or B<1> if object I<a> is found to be less than, to match, or be greater than object I<b>, respectively. X509_NAME_cmp(), X509_issuer_and_serial_cmp(), X509_issuer_name_cmp(), X509_subject_name_cmp(), X509_CRL_cmp(), and X509_CRL_match() may return B<-2> to indicate an error. =head1 NOTES These functions in fact utilize the underlying B<memcmp> of the C library to do the comparison job. Data to be compared varies from DER encoding data, hash value or B<ASN1_STRING>. The sign of the comparison can be used to order the objects but it does not have a special meaning in some cases. X509_NAME_cmp() and wrappers utilize the value B<-2> to indicate errors in some circumstances, which could cause confusion for the applications. =head1 SEE ALSO L<i2d_X509_NAME(3)>, L<i2d_X509(3)> =head1 COPYRIGHT Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at L<https://www.openssl.org/source/license.html>. =cut
jens-maus/amissl
openssl/doc/man3/X509_cmp.pod
Perl
bsd-3-clause
3,404
% Frame number: 230 happens( meeting( grp_ID0, [ id0, id1 ]), 9200). holdsAt( coord( grp_ID0 )=( 52, 160 ), 9200 ). % Frame number: 231 happens( meeting( grp_ID0, [ id0, id1 ]), 9240). holdsAt( coord( grp_ID0 )=( 52, 160 ), 9240 ). % Frame number: 232 happens( meeting( grp_ID0, [ id0, id1 ]), 9280). holdsAt( coord( grp_ID0 )=( 53, 159 ), 9280 ). % Frame number: 233 happens( meeting( grp_ID0, [ id0, id1 ]), 9320). holdsAt( coord( grp_ID0 )=( 53, 159 ), 9320 ). % Frame number: 234 happens( meeting( grp_ID0, [ id0, id1 ]), 9360). holdsAt( coord( grp_ID0 )=( 53, 159 ), 9360 ). % Frame number: 235 happens( meeting( grp_ID0, [ id0, id1 ]), 9400). holdsAt( coord( grp_ID0 )=( 53, 159 ), 9400 ). % Frame number: 236 happens( meeting( grp_ID0, [ id0, id1 ]), 9440). holdsAt( coord( grp_ID0 )=( 53, 160 ), 9440 ). % Frame number: 237 happens( meeting( grp_ID0, [ id0, id1 ]), 9480). holdsAt( coord( grp_ID0 )=( 53, 160 ), 9480 ). % Frame number: 238 happens( meeting( grp_ID0, [ id0, id1 ]), 9520). holdsAt( coord( grp_ID0 )=( 53, 160 ), 9520 ). % Frame number: 239 happens( meeting( grp_ID0, [ id0, id1 ]), 9560). holdsAt( coord( grp_ID0 )=( 54, 160 ), 9560 ). % Frame number: 240 happens( meeting( grp_ID0, [ id0, id1 ]), 9600). holdsAt( coord( grp_ID0 )=( 54, 160 ), 9600 ). % Frame number: 241 happens( meeting( grp_ID0, [ id0, id1 ]), 9640). holdsAt( coord( grp_ID0 )=( 54, 160 ), 9640 ). % Frame number: 242 happens( meeting( grp_ID0, [ id0, id1 ]), 9680). holdsAt( coord( grp_ID0 )=( 54, 160 ), 9680 ). % Frame number: 243 happens( meeting( grp_ID0, [ id0, id1 ]), 9720). holdsAt( coord( grp_ID0 )=( 54, 160 ), 9720 ). % Frame number: 244 happens( meeting( grp_ID0, [ id0, id1 ]), 9760). holdsAt( coord( grp_ID0 )=( 54, 160 ), 9760 ). % Frame number: 245 happens( meeting( grp_ID0, [ id0, id1 ]), 9800). holdsAt( coord( grp_ID0 )=( 55, 159 ), 9800 ). % Frame number: 246 happens( meeting( grp_ID0, [ id0, id1 ]), 9840). holdsAt( coord( grp_ID0 )=( 55, 159 ), 9840 ). % Frame number: 247 happens( meeting( grp_ID0, [ id0, id1 ]), 9880). holdsAt( coord( grp_ID0 )=( 55, 159 ), 9880 ). % Frame number: 248 happens( meeting( grp_ID0, [ id0, id1 ]), 9920). holdsAt( coord( grp_ID0 )=( 55, 159 ), 9920 ). % Frame number: 249 happens( meeting( grp_ID0, [ id0, id1 ]), 9960). holdsAt( coord( grp_ID0 )=( 56, 159 ), 9960 ). % Frame number: 250 happens( meeting( grp_ID0, [ id0, id1 ]), 10000). holdsAt( coord( grp_ID0 )=( 56, 159 ), 10000 ). % Frame number: 251 happens( meeting( grp_ID0, [ id0, id1 ]), 10040). holdsAt( coord( grp_ID0 )=( 56, 159 ), 10040 ). % Frame number: 252 happens( meeting( grp_ID0, [ id0, id1 ]), 10080). holdsAt( coord( grp_ID0 )=( 56, 159 ), 10080 ). % Frame number: 253 happens( meeting( grp_ID0, [ id0, id1 ]), 10120). holdsAt( coord( grp_ID0 )=( 57, 158 ), 10120 ). % Frame number: 254 happens( meeting( grp_ID0, [ id0, id1 ]), 10160). holdsAt( coord( grp_ID0 )=( 57, 159 ), 10160 ). % Frame number: 255 happens( meeting( grp_ID0, [ id0, id1 ]), 10200). holdsAt( coord( grp_ID0 )=( 57, 159 ), 10200 ). % Frame number: 256 happens( meeting( grp_ID0, [ id0, id1 ]), 10240). holdsAt( coord( grp_ID0 )=( 57, 159 ), 10240 ). % Frame number: 257 happens( meeting( grp_ID0, [ id0, id1 ]), 10280). holdsAt( coord( grp_ID0 )=( 58, 159 ), 10280 ). % Frame number: 258 happens( meeting( grp_ID0, [ id0, id1 ]), 10320). holdsAt( coord( grp_ID0 )=( 58, 159 ), 10320 ). % Frame number: 259 happens( meeting( grp_ID0, [ id0, id1 ]), 10360). holdsAt( coord( grp_ID0 )=( 60, 159 ), 10360 ). % Frame number: 260 happens( meeting( grp_ID0, [ id0, id1 ]), 10400). holdsAt( coord( grp_ID0 )=( 60, 159 ), 10400 ). % Frame number: 261 happens( meeting( grp_ID0, [ id0, id1 ]), 10440). holdsAt( coord( grp_ID0 )=( 61, 159 ), 10440 ). % Frame number: 262 happens( meeting( grp_ID0, [ id0, id1 ]), 10480). holdsAt( coord( grp_ID0 )=( 61, 159 ), 10480 ). % Frame number: 263 happens( meeting( grp_ID0, [ id0, id1 ]), 10520). holdsAt( coord( grp_ID0 )=( 62, 159 ), 10520 ). % Frame number: 264 happens( meeting( grp_ID0, [ id0, id1 ]), 10560). holdsAt( coord( grp_ID0 )=( 62, 159 ), 10560 ). % Frame number: 265 happens( meeting( grp_ID0, [ id0, id1 ]), 10600). holdsAt( coord( grp_ID0 )=( 62, 159 ), 10600 ). % Frame number: 266 happens( meeting( grp_ID0, [ id0, id1 ]), 10640). holdsAt( coord( grp_ID0 )=( 62, 159 ), 10640 ). % Frame number: 267 happens( meeting( grp_ID0, [ id0, id1 ]), 10680). holdsAt( coord( grp_ID0 )=( 62, 159 ), 10680 ). % Frame number: 268 happens( meeting( grp_ID0, [ id0, id1 ]), 10720). holdsAt( coord( grp_ID0 )=( 62, 160 ), 10720 ). % Frame number: 269 happens( meeting( grp_ID0, [ id0, id1 ]), 10760). holdsAt( coord( grp_ID0 )=( 62, 159 ), 10760 ). % Frame number: 270 happens( meeting( grp_ID0, [ id0, id1 ]), 10800). holdsAt( coord( grp_ID0 )=( 62, 159 ), 10800 ). % Frame number: 271 happens( meeting( grp_ID0, [ id0, id1 ]), 10840). holdsAt( coord( grp_ID0 )=( 62, 159 ), 10840 ). % Frame number: 272 happens( meeting( grp_ID0, [ id0, id1 ]), 10880). holdsAt( coord( grp_ID0 )=( 63, 159 ), 10880 ). % Frame number: 273 happens( meeting( grp_ID0, [ id0, id1 ]), 10920). holdsAt( coord( grp_ID0 )=( 65, 159 ), 10920 ). % Frame number: 274 happens( meeting( grp_ID0, [ id0, id1 ]), 10960). holdsAt( coord( grp_ID0 )=( 66, 158 ), 10960 ). % Frame number: 275 happens( meeting( grp_ID0, [ id0, id1 ]), 11000). holdsAt( coord( grp_ID0 )=( 66, 158 ), 11000 ). % Frame number: 276 happens( meeting( grp_ID0, [ id0, id1 ]), 11040). holdsAt( coord( grp_ID0 )=( 67, 158 ), 11040 ). % Frame number: 277 happens( meeting( grp_ID0, [ id0, id1 ]), 11080). holdsAt( coord( grp_ID0 )=( 67, 158 ), 11080 ). % Frame number: 278 happens( meeting( grp_ID0, [ id0, id1 ]), 11120). holdsAt( coord( grp_ID0 )=( 67, 157 ), 11120 ). % Frame number: 279 happens( meeting( grp_ID0, [ id0, id1 ]), 11160). holdsAt( coord( grp_ID0 )=( 68, 157 ), 11160 ). % Frame number: 280 happens( meeting( grp_ID0, [ id0, id1 ]), 11200). holdsAt( coord( grp_ID0 )=( 68, 157 ), 11200 ). % Frame number: 281 happens( meeting( grp_ID0, [ id0, id1 ]), 11240). holdsAt( coord( grp_ID0 )=( 68, 157 ), 11240 ). % Frame number: 282 happens( meeting( grp_ID0, [ id0, id1 ]), 11280). holdsAt( coord( grp_ID0 )=( 69, 156 ), 11280 ). % Frame number: 283 happens( meeting( grp_ID0, [ id0, id1 ]), 11320). holdsAt( coord( grp_ID0 )=( 69, 156 ), 11320 ). % Frame number: 284 happens( meeting( grp_ID0, [ id0, id1 ]), 11360). holdsAt( coord( grp_ID0 )=( 69, 156 ), 11360 ). % Frame number: 285 happens( meeting( grp_ID0, [ id0, id1 ]), 11400). holdsAt( coord( grp_ID0 )=( 70, 156 ), 11400 ). % Frame number: 286 happens( meeting( grp_ID0, [ id0, id1 ]), 11440). holdsAt( coord( grp_ID0 )=( 70, 155 ), 11440 ). % Frame number: 287 happens( meeting( grp_ID0, [ id0, id1 ]), 11480). holdsAt( coord( grp_ID0 )=( 71, 155 ), 11480 ). % Frame number: 288 happens( meeting( grp_ID0, [ id0, id1 ]), 11520). holdsAt( coord( grp_ID0 )=( 72, 155 ), 11520 ). % Frame number: 289 happens( meeting( grp_ID0, [ id0, id1 ]), 11560). holdsAt( coord( grp_ID0 )=( 72, 155 ), 11560 ). % Frame number: 290 happens( meeting( grp_ID0, [ id0, id1 ]), 11600). holdsAt( coord( grp_ID0 )=( 73, 155 ), 11600 ). % Frame number: 291 happens( meeting( grp_ID0, [ id0, id1 ]), 11640). holdsAt( coord( grp_ID0 )=( 74, 155 ), 11640 ). % Frame number: 292 happens( meeting( grp_ID0, [ id0, id1 ]), 11680). holdsAt( coord( grp_ID0 )=( 74, 155 ), 11680 ). % Frame number: 293 happens( meeting( grp_ID0, [ id0, id1 ]), 11720). holdsAt( coord( grp_ID0 )=( 75, 155 ), 11720 ). % Frame number: 294 happens( meeting( grp_ID0, [ id0, id1 ]), 11760). holdsAt( coord( grp_ID0 )=( 76, 155 ), 11760 ). % Frame number: 295 happens( meeting( grp_ID0, [ id0, id1 ]), 11800). holdsAt( coord( grp_ID0 )=( 76, 155 ), 11800 ). % Frame number: 296 happens( meeting( grp_ID0, [ id0, id1 ]), 11840). holdsAt( coord( grp_ID0 )=( 76, 154 ), 11840 ). % Frame number: 297 happens( meeting( grp_ID0, [ id0, id1 ]), 11880). holdsAt( coord( grp_ID0 )=( 76, 154 ), 11880 ). % Frame number: 298 happens( meeting( grp_ID0, [ id0, id1 ]), 11920). holdsAt( coord( grp_ID0 )=( 76, 154 ), 11920 ). % Frame number: 299 happens( meeting( grp_ID0, [ id0, id1 ]), 11960). holdsAt( coord( grp_ID0 )=( 77, 154 ), 11960 ). % Frame number: 300 happens( meeting( grp_ID0, [ id0, id1 ]), 12000). holdsAt( coord( grp_ID0 )=( 77, 154 ), 12000 ). % Frame number: 301 happens( meeting( grp_ID0, [ id0, id1 ]), 12040). holdsAt( coord( grp_ID0 )=( 79, 154 ), 12040 ). % Frame number: 302 happens( meeting( grp_ID0, [ id0, id1 ]), 12080). holdsAt( coord( grp_ID0 )=( 80, 154 ), 12080 ). % Frame number: 303 happens( meeting( grp_ID0, [ id0, id1 ]), 12120). holdsAt( coord( grp_ID0 )=( 81, 154 ), 12120 ). % Frame number: 304 happens( meeting( grp_ID0, [ id0, id1 ]), 12160). holdsAt( coord( grp_ID0 )=( 81, 154 ), 12160 ). % Frame number: 305 happens( meeting( grp_ID0, [ id0, id1 ]), 12200). holdsAt( coord( grp_ID0 )=( 82, 154 ), 12200 ). % Frame number: 306 happens( meeting( grp_ID0, [ id0, id1 ]), 12240). holdsAt( coord( grp_ID0 )=( 83, 154 ), 12240 ). % Frame number: 307 happens( meeting( grp_ID0, [ id0, id1 ]), 12280). holdsAt( coord( grp_ID0 )=( 83, 155 ), 12280 ). % Frame number: 308 happens( meeting( grp_ID0, [ id0, id1 ]), 12320). holdsAt( coord( grp_ID0 )=( 83, 154 ), 12320 ). % Frame number: 309 happens( meeting( grp_ID0, [ id0, id1 ]), 12360). holdsAt( coord( grp_ID0 )=( 84, 154 ), 12360 ). % Frame number: 310 happens( meeting( grp_ID0, [ id0, id1 ]), 12400). holdsAt( coord( grp_ID0 )=( 84, 154 ), 12400 ). % Frame number: 311 happens( meeting( grp_ID0, [ id0, id1 ]), 12440). holdsAt( coord( grp_ID0 )=( 84, 155 ), 12440 ). % Frame number: 312 happens( meeting( grp_ID0, [ id0, id1 ]), 12480). holdsAt( coord( grp_ID0 )=( 84, 154 ), 12480 ). % Frame number: 313 happens( meeting( grp_ID0, [ id0, id1 ]), 12520). holdsAt( coord( grp_ID0 )=( 84, 154 ), 12520 ). % Frame number: 314 happens( meeting( grp_ID0, [ id0, id1 ]), 12560). holdsAt( coord( grp_ID0 )=( 84, 154 ), 12560 ). % Frame number: 315 happens( meeting( grp_ID0, [ id0, id1 ]), 12600). holdsAt( coord( grp_ID0 )=( 86, 154 ), 12600 ). % Frame number: 316 happens( meeting( grp_ID0, [ id0, id1 ]), 12640). holdsAt( coord( grp_ID0 )=( 88, 154 ), 12640 ). % Frame number: 317 happens( meeting( grp_ID0, [ id0, id1 ]), 12680). holdsAt( coord( grp_ID0 )=( 89, 154 ), 12680 ). % Frame number: 318 happens( meeting( grp_ID0, [ id0, id1 ]), 12720). holdsAt( coord( grp_ID0 )=( 90, 154 ), 12720 ). % Frame number: 319 happens( meeting( grp_ID0, [ id0, id1 ]), 12760). holdsAt( coord( grp_ID0 )=( 91, 154 ), 12760 ). % Frame number: 320 happens( meeting( grp_ID0, [ id0, id1 ]), 12800). holdsAt( coord( grp_ID0 )=( 91, 154 ), 12800 ). % Frame number: 321 happens( meeting( grp_ID0, [ id0, id1 ]), 12840). holdsAt( coord( grp_ID0 )=( 92, 155 ), 12840 ). % Frame number: 322 happens( meeting( grp_ID0, [ id0, id1 ]), 12880). holdsAt( coord( grp_ID0 )=( 92, 155 ), 12880 ). % Frame number: 323 happens( meeting( grp_ID0, [ id0, id1 ]), 12920). holdsAt( coord( grp_ID0 )=( 93, 155 ), 12920 ). % Frame number: 324 happens( meeting( grp_ID0, [ id0, id1 ]), 12960). holdsAt( coord( grp_ID0 )=( 93, 155 ), 12960 ). % Frame number: 325 happens( meeting( grp_ID0, [ id0, id1 ]), 13000). holdsAt( coord( grp_ID0 )=( 93, 156 ), 13000 ). % Frame number: 326 happens( meeting( grp_ID0, [ id0, id1 ]), 13040). holdsAt( coord( grp_ID0 )=( 93, 156 ), 13040 ). % Frame number: 327 happens( meeting( grp_ID0, [ id0, id1 ]), 13080). holdsAt( coord( grp_ID0 )=( 93, 156 ), 13080 ). % Frame number: 328 happens( meeting( grp_ID0, [ id0, id1 ]), 13120). holdsAt( coord( grp_ID0 )=( 93, 156 ), 13120 ). % Frame number: 329 happens( meeting( grp_ID0, [ id0, id1 ]), 13160). holdsAt( coord( grp_ID0 )=( 96, 156 ), 13160 ). % Frame number: 330 happens( meeting( grp_ID0, [ id0, id1 ]), 13200). holdsAt( coord( grp_ID0 )=( 98, 156 ), 13200 ). % Frame number: 331 happens( meeting( grp_ID0, [ id0, id1 ]), 13240). holdsAt( coord( grp_ID0 )=( 99, 156 ), 13240 ). % Frame number: 332 happens( meeting( grp_ID0, [ id0, id1 ]), 13280). holdsAt( coord( grp_ID0 )=( 100, 156 ), 13280 ). % Frame number: 333 happens( meeting( grp_ID0, [ id0, id1 ]), 13320). holdsAt( coord( grp_ID0 )=( 100, 156 ), 13320 ). % Frame number: 334 happens( meeting( grp_ID0, [ id0, id1 ]), 13360). holdsAt( coord( grp_ID0 )=( 102, 156 ), 13360 ). % Frame number: 335 happens( meeting( grp_ID0, [ id0, id1 ]), 13400). holdsAt( coord( grp_ID0 )=( 103, 156 ), 13400 ). % Frame number: 336 happens( meeting( grp_ID0, [ id0, id1 ]), 13440). holdsAt( coord( grp_ID0 )=( 103, 156 ), 13440 ). % Frame number: 337 happens( meeting( grp_ID0, [ id0, id1 ]), 13480). holdsAt( coord( grp_ID0 )=( 103, 156 ), 13480 ). % Frame number: 338 happens( meeting( grp_ID0, [ id0, id1 ]), 13520). holdsAt( coord( grp_ID0 )=( 104, 156 ), 13520 ). % Frame number: 339 happens( meeting( grp_ID0, [ id0, id1 ]), 13560). holdsAt( coord( grp_ID0 )=( 104, 156 ), 13560 ). % Frame number: 340 happens( meeting( grp_ID0, [ id0, id1 ]), 13600). holdsAt( coord( grp_ID0 )=( 105, 156 ), 13600 ). % Frame number: 341 happens( meeting( grp_ID0, [ id0, id1 ]), 13640). holdsAt( coord( grp_ID0 )=( 105, 155 ), 13640 ). % Frame number: 342 happens( meeting( grp_ID0, [ id0, id1 ]), 13680). holdsAt( coord( grp_ID0 )=( 105, 155 ), 13680 ). % Frame number: 343 happens( meeting( grp_ID0, [ id0, id1 ]), 13720). holdsAt( coord( grp_ID0 )=( 106, 155 ), 13720 ). % Frame number: 344 happens( meeting( grp_ID0, [ id0, id1 ]), 13760). holdsAt( coord( grp_ID0 )=( 109, 155 ), 13760 ). % Frame number: 345 happens( meeting( grp_ID0, [ id0, id1 ]), 13800). holdsAt( coord( grp_ID0 )=( 110, 154 ), 13800 ). % Frame number: 346 happens( meeting( grp_ID0, [ id0, id1 ]), 13840). holdsAt( coord( grp_ID0 )=( 112, 154 ), 13840 ). % Frame number: 347 happens( meeting( grp_ID0, [ id0, id1 ]), 13880). holdsAt( coord( grp_ID0 )=( 113, 154 ), 13880 ). % Frame number: 348 happens( meeting( grp_ID0, [ id0, id1 ]), 13920). holdsAt( coord( grp_ID0 )=( 114, 154 ), 13920 ). % Frame number: 349 happens( meeting( grp_ID0, [ id0, id1 ]), 13960). holdsAt( coord( grp_ID0 )=( 115, 154 ), 13960 ). % Frame number: 350 happens( meeting( grp_ID0, [ id0, id1 ]), 14000). holdsAt( coord( grp_ID0 )=( 116, 154 ), 14000 ). % Frame number: 351 happens( meeting( grp_ID0, [ id0, id1 ]), 14040). holdsAt( coord( grp_ID0 )=( 117, 154 ), 14040 ). % Frame number: 352 happens( meeting( grp_ID0, [ id0, id1 ]), 14080). holdsAt( coord( grp_ID0 )=( 117, 154 ), 14080 ). % Frame number: 353 happens( meeting( grp_ID0, [ id0, id1 ]), 14120). holdsAt( coord( grp_ID0 )=( 117, 154 ), 14120 ). % Frame number: 354 happens( meeting( grp_ID0, [ id0, id1 ]), 14160). holdsAt( coord( grp_ID0 )=( 117, 154 ), 14160 ). % Frame number: 355 happens( meeting( grp_ID0, [ id0, id1 ]), 14200). holdsAt( coord( grp_ID0 )=( 118, 153 ), 14200 ). % Frame number: 356 happens( meeting( grp_ID0, [ id0, id1 ]), 14240). holdsAt( coord( grp_ID0 )=( 118, 153 ), 14240 ). % Frame number: 357 happens( meeting( grp_ID0, [ id0, id1 ]), 14280). holdsAt( coord( grp_ID0 )=( 119, 153 ), 14280 ). % Frame number: 358 happens( meeting( grp_ID0, [ id0, id1 ]), 14320). holdsAt( coord( grp_ID0 )=( 121, 153 ), 14320 ). % Frame number: 359 happens( meeting( grp_ID0, [ id0, id1 ]), 14360). holdsAt( coord( grp_ID0 )=( 123, 153 ), 14360 ). % Frame number: 360 happens( meeting( grp_ID0, [ id0, id1 ]), 14400). holdsAt( coord( grp_ID0 )=( 124, 153 ), 14400 ). % Frame number: 361 happens( meeting( grp_ID0, [ id0, id1 ]), 14440). holdsAt( coord( grp_ID0 )=( 125, 151 ), 14440 ). % Frame number: 362 happens( meeting( grp_ID0, [ id0, id1 ]), 14480). holdsAt( coord( grp_ID0 )=( 126, 151 ), 14480 ). % Frame number: 363 happens( meeting( grp_ID0, [ id0, id1 ]), 14520). holdsAt( coord( grp_ID0 )=( 127, 151 ), 14520 ). % Frame number: 364 happens( meeting( grp_ID0, [ id0, id1 ]), 14560). holdsAt( coord( grp_ID0 )=( 128, 150 ), 14560 ). % Frame number: 365 happens( meeting( grp_ID0, [ id0, id1 ]), 14600). holdsAt( coord( grp_ID0 )=( 128, 150 ), 14600 ). % Frame number: 366 happens( meeting( grp_ID0, [ id0, id1 ]), 14640). holdsAt( coord( grp_ID0 )=( 129, 149 ), 14640 ). % Frame number: 367 happens( meeting( grp_ID0, [ id0, id1 ]), 14680). holdsAt( coord( grp_ID0 )=( 129, 149 ), 14680 ). % Frame number: 368 happens( meeting( grp_ID0, [ id0, id1 ]), 14720). holdsAt( coord( grp_ID0 )=( 129, 149 ), 14720 ). % Frame number: 369 happens( meeting( grp_ID0, [ id0, id1 ]), 14760). holdsAt( coord( grp_ID0 )=( 130, 149 ), 14760 ). % Frame number: 370 happens( meeting( grp_ID0, [ id0, id1 ]), 14800). holdsAt( coord( grp_ID0 )=( 131, 149 ), 14800 ). % Frame number: 371 happens( meeting( grp_ID0, [ id0, id1 ]), 14840). holdsAt( coord( grp_ID0 )=( 132, 148 ), 14840 ). % Frame number: 372 happens( meeting( grp_ID0, [ id0, id1 ]), 14880). holdsAt( coord( grp_ID0 )=( 132, 149 ), 14880 ). % Frame number: 373 happens( meeting( grp_ID0, [ id0, id1 ]), 14920). holdsAt( coord( grp_ID0 )=( 133, 149 ), 14920 ). % Frame number: 374 happens( meeting( grp_ID0, [ id0, id1 ]), 14960). holdsAt( coord( grp_ID0 )=( 133, 149 ), 14960 ). % Frame number: 375 happens( meeting( grp_ID0, [ id0, id1 ]), 15000). holdsAt( coord( grp_ID0 )=( 133, 148 ), 15000 ). % Frame number: 376 happens( meeting( grp_ID0, [ id0, id1 ]), 15040). holdsAt( coord( grp_ID0 )=( 134, 148 ), 15040 ). % Frame number: 377 happens( meeting( grp_ID0, [ id0, id1 ]), 15080). holdsAt( coord( grp_ID0 )=( 136, 148 ), 15080 ). % Frame number: 378 happens( meeting( grp_ID0, [ id0, id1 ]), 15120). holdsAt( coord( grp_ID0 )=( 137, 149 ), 15120 ). % Frame number: 379 happens( meeting( grp_ID0, [ id0, id1 ]), 15160). holdsAt( coord( grp_ID0 )=( 138, 149 ), 15160 ). % Frame number: 380 happens( meeting( grp_ID0, [ id0, id1 ]), 15200). holdsAt( coord( grp_ID0 )=( 138, 149 ), 15200 ). % Frame number: 381 happens( meeting( grp_ID0, [ id0, id1 ]), 15240). holdsAt( coord( grp_ID0 )=( 138, 149 ), 15240 ). % Frame number: 382 happens( meeting( grp_ID0, [ id0, id1 ]), 15280). holdsAt( coord( grp_ID0 )=( 140, 149 ), 15280 ). % Frame number: 383 happens( meeting( grp_ID0, [ id0, id1 ]), 15320). holdsAt( coord( grp_ID0 )=( 141, 149 ), 15320 ). % Frame number: 384 happens( meeting( grp_ID0, [ id0, id1 ]), 15360). holdsAt( coord( grp_ID0 )=( 142, 149 ), 15360 ). % Frame number: 385 happens( meeting( grp_ID0, [ id0, id1 ]), 15400). holdsAt( coord( grp_ID0 )=( 142, 149 ), 15400 ). % Frame number: 386 happens( meeting( grp_ID0, [ id0, id1 ]), 15440). holdsAt( coord( grp_ID0 )=( 142, 149 ), 15440 ). % Frame number: 387 happens( meeting( grp_ID0, [ id0, id1 ]), 15480). holdsAt( coord( grp_ID0 )=( 142, 149 ), 15480 ). % Frame number: 388 happens( meeting( grp_ID0, [ id0, id1 ]), 15520). holdsAt( coord( grp_ID0 )=( 143, 149 ), 15520 ). % Frame number: 389 happens( meeting( grp_ID0, [ id0, id1 ]), 15560). holdsAt( coord( grp_ID0 )=( 143, 149 ), 15560 ). % Frame number: 390 happens( meeting( grp_ID0, [ id0, id1 ]), 15600). holdsAt( coord( grp_ID0 )=( 143, 149 ), 15600 ). % Frame number: 391 happens( meeting( grp_ID0, [ id0, id1 ]), 15640). holdsAt( coord( grp_ID0 )=( 144, 149 ), 15640 ). % Frame number: 392 happens( meeting( grp_ID0, [ id0, id1 ]), 15680). holdsAt( coord( grp_ID0 )=( 144, 149 ), 15680 ). % Frame number: 393 happens( meeting( grp_ID0, [ id0, id1 ]), 15720). holdsAt( coord( grp_ID0 )=( 144, 149 ), 15720 ). % Frame number: 394 happens( meeting( grp_ID0, [ id0, id1 ]), 15760). holdsAt( coord( grp_ID0 )=( 146, 149 ), 15760 ). % Frame number: 395 happens( meeting( grp_ID0, [ id0, id1 ]), 15800). holdsAt( coord( grp_ID0 )=( 145, 150 ), 15800 ). % Frame number: 396 happens( meeting( grp_ID0, [ id0, id1 ]), 15840). holdsAt( coord( grp_ID0 )=( 146, 150 ), 15840 ). % Frame number: 397 happens( meeting( grp_ID0, [ id0, id1 ]), 15880). holdsAt( coord( grp_ID0 )=( 145, 150 ), 15880 ). % Frame number: 398 happens( meeting( grp_ID0, [ id0, id1 ]), 15920). holdsAt( coord( grp_ID0 )=( 145, 150 ), 15920 ). % Frame number: 399 happens( meeting( grp_ID0, [ id0, id1 ]), 15960). holdsAt( coord( grp_ID0 )=( 144, 150 ), 15960 ). % Frame number: 400 happens( meeting( grp_ID0, [ id0, id1 ]), 16000). holdsAt( coord( grp_ID0 )=( 144, 150 ), 16000 ). % Frame number: 401 happens( meeting( grp_ID0, [ id0, id1 ]), 16040). holdsAt( coord( grp_ID0 )=( 144, 150 ), 16040 ). % Frame number: 402 happens( meeting( grp_ID0, [ id0, id1 ]), 16080). holdsAt( coord( grp_ID0 )=( 143, 150 ), 16080 ). % Frame number: 403 happens( meeting( grp_ID0, [ id0, id1 ]), 16120). holdsAt( coord( grp_ID0 )=( 143, 150 ), 16120 ). % Frame number: 404 happens( meeting( grp_ID0, [ id0, id1 ]), 16160). holdsAt( coord( grp_ID0 )=( 142, 151 ), 16160 ). % Frame number: 405 happens( meeting( grp_ID0, [ id0, id1 ]), 16200). holdsAt( coord( grp_ID0 )=( 142, 150 ), 16200 ). % Frame number: 406 happens( meeting( grp_ID0, [ id0, id1 ]), 16240). holdsAt( coord( grp_ID0 )=( 142, 150 ), 16240 ). % Frame number: 407 happens( meeting( grp_ID0, [ id0, id1 ]), 16280). holdsAt( coord( grp_ID0 )=( 141, 151 ), 16280 ). % Frame number: 408 happens( meeting( grp_ID0, [ id0, id1 ]), 16320). holdsAt( coord( grp_ID0 )=( 141, 151 ), 16320 ). % Frame number: 409 happens( meeting( grp_ID0, [ id0, id1 ]), 16360). holdsAt( coord( grp_ID0 )=( 141, 151 ), 16360 ). % Frame number: 410 happens( meeting( grp_ID0, [ id0, id1 ]), 16400). holdsAt( coord( grp_ID0 )=( 141, 150 ), 16400 ). % Frame number: 411 happens( meeting( grp_ID0, [ id0, id1 ]), 16440). holdsAt( coord( grp_ID0 )=( 142, 151 ), 16440 ).
JasonFil/Prob-EC
dataset/strong-noise/22-Meet_Split3rdGuy/ms3ggtContextGrp.pl
Perl
bsd-3-clause
21,700
=head1 NAME Apache2::ServerUtil - Perl API for Apache server record utils =head1 Synopsis use Apache2::ServerUtil (); $s = Apache2::ServerUtil->server; # push config $s->add_config(['ServerTokens off']); # add components to the Server signature $s->add_version_component("MyModule/1.234"); # access PerlSetVar/PerlAddVar values my $srv_cfg = $s->dir_config; # check command line defines print "this is mp2" if Apache2::ServerUtil::exists_config_define('MODPERL2'); # get PerlChildExitHandler configured handlers @handlers = @{ $s->get_handlers('PerlChildExitHandler') || []}; # server build and version info: $when_built = Apache2::ServerUtil::get_server_built(); $description = Apache2::ServerUtil::get_server_description(); $version = Apache2::ServerUtil::get_server_version(); $banner = Apache2::ServerUtil::get_server_banner(); # ServerRoot value $server_root = Apache2::ServerUtil::server_root(); # get 'conf/' dir path (avoid using this function!) my $dir = Apache2::ServerUtil::server_root_relative($r->pool, 'conf'); # set child_exit handlers $r->set_handlers(PerlChildExitHandler => \&handler); # server level PerlOptions flags lookup $s->push_handlers(ChildExit => \&child_exit) if $s->is_perl_option_enabled('ChildExit'); # extend HTTP to support a new method $s->method_register('NEWGET'); # register server shutdown callback Apache2::ServerUtil::server_shutdown_register_cleanup(sub { Apache2::Const::OK }); # do something only when the server restarts my $cnt = Apache2::ServerUtil::restart_count(); do_something_once() if $cnt > 1; # get the resolved ids from Group and User entries my $user_id = Apache2::ServerUtil->user_id; my $group_id = Apache2::ServerUtil->group_id; =head1 Description C<Apache2::ServerUtil> provides the L<Apache server object|docs::2.0::api::Apache2::ServerRec> utilities API. =head1 Methods API C<Apache2::ServerUtil> provides the following functions and/or methods: =head2 C<add_config> Dynamically add Apache configuration: $s->add_config($lines); =over 4 =item obj: C<$s> ( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> ) =item arg1: C<$lines> ( ARRAY ref ) An ARRAY reference containing configuration lines per element, without the new line terminators. =item ret: no return value =item since: 2.0.00 =back See also: C<L<$r-E<gt>add_config|docs::2.0::api::Apache2::RequestUtil/C_add_config_>> For example: Add a configuration section at the server startup (e.g. from I<startup.pl>): use Apache2::ServerUtil (); my $conf = <<'EOC'; PerlModule Apache2::MyExample <Location /perl> SetHandler perl-script PerlResponseHandler Apache2::MyExample </Location> EOC Apache2::ServerUtil->server->add_config([split /\n/, $conf]); =head2 C<add_version_component> Add a component to the version string $s->add_version_component($component); =over 4 =item obj: C<$s> ( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> ) =item arg1: C<$component> ( string ) The string component to add =item ret: no return value =item since: 2.0.00 =back This function is usually used by modules to advertise themselves to the world. It's picked up by such statistics collectors, like netcraft.com, which accomplish that by connecting to various servers and grabbing the server version response header (C<Server>). Some servers choose to fully or partially conceal that header. This method should be invoked in the C<L<PerlPostConfigHandler|docs::2.0::user::handlers::server/C_PerlPostConfigHandler_>> phase, which will ensure that the Apache core version number will appear first. For example let's add a component I<"Hikers, Inc/0.99999"> to the server string at the server startup: use Apache2::ServerUtil (); use Apache2::Const -compile => 'OK'; Apache2::ServerUtil->server->push_handlers( PerlPostConfigHandler => \&add_my_version); sub add_my_version { my ($conf_pool, $log_pool, $temp_pool, $s) = @_; $s->add_version_component("Hikers, Inc/0.99999"); return Apache2::Const::OK; } or of course you could register the C<L<PerlPostConfigHandler|docs::2.0::user::handlers::server/C_PerlPostConfigHandler_>> handler directly in F<httpd.conf> Now when the server starts, you will something like: [Thu Jul 15 12:15:28 2004] [notice] Apache/2.0.51-dev (Unix) mod_perl/1.99_15-dev Perl/v5.8.5 Hikers, Inc/0.99999 configured -- resuming normal operations Also remember that the C<ServerTokens> directive value controls whether the component information is displayed or not. =head2 C<dir_config> C<$s-E<gt>dir_config()> provides an interface for the per-server variables specified by the C<PerlSetVar> and C<PerlAddVar> directives, and also can be manipulated via the C<L<APR::Table|docs::2.0::api::APR::Table>> methods. $table = $s->dir_config(); $value = $s->dir_config($key); @values = $s->dir_config->get($key); $s->dir_config($key, $val); =over 4 =item obj: C<$s> ( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> ) =item opt arg2: C<$key> ( string ) Key string =item opt arg3: C<$val> ( string ) Value string =item ret: ... Depends on the passed arguments, see further discussion =item since: 2.0.00 =back The keys are case-insensitive. $t = $s->dir_config(); dir_config() called in a scalar context without the C<$key> argument returns a I<HASH> reference blessed into the I<APR::Table> class. This object can be manipulated via the I<APR::Table> methods. For available methods see I<APR::Table>. @values = $s->dir_config->get($key); To receive a list of values you must use C<get()> method from the C<L<APR::Table|docs::2.0::api::APR::Table>> class. $value = $s->dir_config($key); If the C<$key> argument is passed in the scalar context only a single value will be returned. Since the table preserves the insertion order, if there is more than one value for the same key, the oldest value assosiated with the desired key is returned. Calling in the scalar context is also much faster, as it'll stop searching the table as soon as the first match happens. $s->dir_config($key => $val); If the C<$key> and the C<$val> arguments are used, the set() operation will happen: all existing values associated with the key C<$key> (and the key itself) will be deleted and C<$value> will be placed instead. $s->dir_config($key => undef); If C<$val> is I<undef> the unset() operation will happen: all existing values associated with the key C<$key> (and the key itself) will be deleted. =head2 C<exists_config_define> Check for a definition from the server startup command line (e.g. C<-DMODPERL2>) $result = Apache2::ServerUtil::exists_config_define($name); =over 4 =item arg1: C<$name> ( string ) The define string to check for =item ret: C<$result> ( boolean ) true if defined, false otherwise =item since: 2.0.00 =back For example: print "this is mp2" if Apache2::ServerUtil::exists_config_define('MODPERL2'); =head2 C<get_handlers> Returns a reference to a list of handlers enabled for a given phase. $handlers_list = $s->get_handlers($hook_name); =over 4 =item obj: C<$s> ( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> ) =item arg1: C<$hook_name> ( string ) a string representing the phase to handle. =item ret: C<$handlers_list> (ref to an ARRAY of CODE refs) a list of references to the handler subroutines =item since: 2.0.00 =back See also: C<L<$r-E<gt>add_config|docs::2.0::api::Apache2::RequestUtil/C_get_handlers_>> For example: A list of handlers configured to run at the I<child_exit> phase: @handlers = @{ $s->get_handlers('PerlChildExitHandler') || []}; =head2 C<get_server_built> Get the date and time that the server was built $when_built = Apache2::ServerUtil::get_server_built(); =over 4 =item ret: C<$when_built> ( string ) The server build time string =item since: 2.0.00 =back =head2 C<get_server_version> Get the server version string $version = Apache2::ServerUtil::get_server_version(); =over 4 =item ret: C<$version> ( string ) The server version string =item since: 2.0.00 =back =head2 C<get_server_banner> Get the server banner $banner = Apache2::ServerUtil::get_server_banner(); =over 4 =item ret: C<$banner> ( string ) The server banner =item since: 2.0.4 =back =head2 C<get_server_description> Get the server description $description = Apache2::ServerUtil::get_server_description(); =over 4 =item ret: C<$description> ( string ) The server description =item since: 2.0.4 =back =head2 C<group_id> Get the group id corresponding to the C<Group> directive in F<httpd.conf>: $gid = Apache2::ServerUtil->group_id; =over 4 =item obj: C<Apache2::ServerUtil> (class name) =item ret: C<$gid> ( integer ) On Unix platforms returns the gid corresponding to the value used in the C<Group> directive in F<httpd.conf>. On other platforms returns 0. =item since: 2.0.03 =back =head2 C<is_perl_option_enabled> check whether a server level C<PerlOptions> flag is enabled or not. $result = $s->is_perl_option_enabled($flag); =over 4 =item obj: C<$s> ( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> ) =item arg1: C<$flag> ( string ) =item ret: C<$result> ( boolean ) =item since: 2.0.00 =back For example to check whether the C<ChildExit> hook is enabled (which can be disabled with C<PerlOptions -ChildExit>) and configure some handlers to run if enabled: $s->push_handlers(ChildExit => \&child_exit) if $s->is_perl_option_enabled('ChildExit'); See also: L<PerlOptions|docs::2.0::user::config::config/C_PerlOptions_> and L<the equivalent function for directory level PerlOptions flags|docs::2.0::api::Apache2::RequestUtil/C_is_perl_option_enabled_>. =head2 C<method_register> Register a new request method, and return the offset that will be associated with that method. $offset = $s->method_register($methname); =over 4 =item obj: C<$s> ( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> ) =item arg1: C<$methname> ( string ) The name of the new method to register (in addition to the already supported C<GET>, C<HEAD>, etc.) =item ret: C<$offset> ( integer ) An int value representing an offset into a bitmask. You can probably ignore it. =item since: 2.0.00 =back This method allows you to extend the HTTP protocol to support new methods, which fit the HTTP paradigm. Of course you will need to write a client that understands that protocol extension. For a good example, refer to the C<MyApache2::SendEmail> example presented in C<L<the PerlHeaderParserHandler section|docs::2.0::user::handlers::http/PerlHeaderParserHandler>>, which demonstrates how a new method C<EMAIL> is registered and used. =head2 C<push_handlers> Add one or more handlers to a list of handlers to be called for a given phase. $ok = $s->push_handlers($hook_name => \&handler); $ok = $s->push_handlers($hook_name => [\&handler, \&handler2]); =over 4 =item obj: C<$s> ( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> ) =item arg1: C<$hook_name> ( string ) the phase to add the handlers to =item arg2: C<$handlers> ( CODE ref or SUB name or an ARRAY ref ) a single handler CODE reference or just a name of the subroutine (fully qualified unless defined in the current package). if more than one passed, use a reference to an array of CODE refs and/or subroutine names. =item ret: C<$ok> ( boolean ) returns a true value on success, otherwise a false value =item since: 2.0.00 =back See also: C<L<$r-E<gt>add_config|docs::2.0::api::Apache2::RequestUtil/C_push_handlers_>> Examples: A single handler: $s->push_handlers(PerlChildExitHandler => \&handler); Multiple handlers: $s->push_handlers(PerlChildExitHandler => ['Foo::Bar::handler', \&handler2]); Anonymous functions: $s->push_handlers(PerlLogHandler => sub { return Apache2::Const::OK }); =head2 C<restart_count> How many times the server was restarted. $restart_count = Apache2::ServerUtil::restart_count(); =over 4 =item ret: C<restart_count> ( number ) =item since: 2.0.00 =back The following demonstration should make it clear what values to expect from this function. Let's add the following code to F<startup.pl>, so it's run every time F<httpd.conf> is parsed: use Apache2::ServerUtil (); my $cnt = Apache2::ServerUtil::restart_count(); open my $fh, ">>/tmp/out" or die "$!"; print $fh "cnt: $cnt\n"; close $fh; Now let's run a series of server starts and restarts and look at what is logged into F</tmp/out>: % httpd -k start cnt: 1 cnt: 2 % httpd -k graceful cnt: 1 cnt: 3 % httpd -k graceful cnt: 1 cnt: 4 % httpd -k stop cnt: 1 Remembering that L<Apache restarts itself immediately after starting|docs::2.0::user::handlers::server/Server_Life_Cycle>, we can see that the C<restart_count> goes from 1 to 2 during the server start. Moreover we can see that every operation forces the parsing of F<httpd.conf> and therefore reinitialization of mod_perl (and running all the code found in F<httpd.conf>). This happens even when the server is shutdown via C<httpd -k stop>. What conclusions can be drawn from this demonstration: =over =item * C<Apache2::ServerUtil::restart_count()> returns 1 every time some C<-k> command is passed to Apache (or C<kill -USR1> or some alternative signal is received). =item * At all other times the count will be 2 or higher. So for example on graceful restart the count will be 3 or higher. =back For example if you want to run something every time C<httpd -k> is run you just need to check whether C<restart_count()> returns 1: my $cnt = Apache2::ServerUtil::restart_count(); do_something() if $cnt == 1; To do something only when server restarts (C<httpd -k start> or C<httpd -k graceful)>, check whether C<restart_count()> is bigger than 1: my $cnt = Apache2::ServerUtil::restart_count(); do_something() if $cnt > 1; =head2 C<server> Get the main server's object $main_s = Apache2::ServerUtil->server(); =over 4 =item obj: C<Apache2::ServerUtil> (class name) =item ret: C<$main_s> ( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> ) =item since: 2.0.00 =back =head2 C<server_root> returns the value set by the top-level C<ServerRoot> directive. $server_root = Apache2::ServerUtil::server_root(); =over 4 =item ret: C<$server_root> ( string ) =item since: 2.0.00 =back =head2 C<server_root_relative> Returns the canonical form of the filename made absolute to C<ServerRoot>: $path = Apache2::ServerUtil::server_root_relative($pool, $fname); =over 4 =item arg1: C<$pool> ( C<L<APR::Pool object|docs::2.0::api::APR::Pool>> ) Make sure that you read the following explanation and understand well which pool object you need to pass before using this function. =item opt arg2: C<$fname> ( string ) =item ret: C<$path> ( string ) The concatenation of C<ServerRoot> and the C<$fname>. If C<$fname> is not specified, the value of C<ServerRoot> is returned with a trailing C</>. (it's the same as using C<''> as C<$fname>'s value). =item since: 2.0.00 =back C<$fname> is appended to the value of C<ServerRoot> and returned. For example: my $dir = Apache2::ServerUtil::server_root_relative($r->pool, 'logs'); You must be extra-careful when using this function. If you aren't sure what you are doing don't use it. It's much safer to build the path by yourself using use C<L<Apache2::ServerUtil::server_root()|/C_Apache2__server_root_>>, For example: use File::Spec::Functions qw(catfile); my $path = catfile Apache2::ServerUtil::server_root, qw(t logs); In this example, no memory allocation happens on the Apache-side and you aren't risking to get a memory leak. The problem with C<server_root_relative> is that Apache allocates memory to concatenate the path string. The memory is allocated from the pool object. If you call this method on the server pool object it'll allocate the memory from it. If you do that at the server startup, it's perfectly right, since you will do that only once. However if you do that from within a request or a connection handler, you create a memory leak every time it is called -- as the memory gets allocated from the server pool, it will be freed only when the server is shutdown. Therefore if you need to build a relative to the root server path for the duration of the request, use the request pool: use Apache2::RequestRec (); Apache2::ServerUtil::server_root_relative($r->pool, $fname); If you need to have the path for the duration of a connection (e.g. inside a protocol handler), you should use: use Apache2::Connection (); Apache2::ServerUtil::server_root_relative($c->pool, $fname); And if you want it for the scope of the server file: use Apache2::Process (); use Apache2::ServerUtil (); Apache2::ServerUtil::server_root_relative($s->process->pool, $fname); Moreover, you could have encountered the opposite problem, where you have used a short-lived pool object to construct the path, but tried to use the resulting path variable, when that pool has been destructed already. In order to avoid mysterious segmentation faults, mod_perl does a wasteful copy of the path string when returning it to you -- another reason to avoid using this function. =head2 C<server_shutdown_cleanup_register> Register server shutdown cleanup callback: Apache2::ServerUtil::server_shutdown_cleanup_register($sub); =over 4 =item arg1: C<$sub> ( CODE ref or SUB name ) =item ret: no return value =item since: 2.0.00 =back This function can be used to register a callback to be run once at the server shutdown (compared to C<L<PerlChildExitHandler|docs::2.0::user::handlers::server/C_PerlChildExitHandler_>> which will execute the callback for each exiting child process). For example in order to arrange the function C<do_my_cleanups()> to be run every time the server shuts down (or restarts), run the following code at the server startup: Apache2::ServerUtil::server_shutdown_cleanup_register(\&do_my_cleanups); It's necessary to run this code at the server startup (normally F<startup.pl>). The function will croak if run after the C<L<PerlPostConfigHandler|docs::2.0::user::handlers::server/C_PerlPostConfigHandler_>> phase. Values returned from cleanup functions are ignored. If a cleanup dies the exception is stringified and passed to C<warn()>. Usually, this results in printing it to the F<error_log>. =head2 C<set_handlers> Set a list of handlers to be called for a given phase. Any previously set handlers are forgotten. $ok = $s->set_handlers($hook_name => \&handler); $ok = $s->set_handlers($hook_name => [\&handler, \&handler2]); $ok = $s->set_handlers($hook_name => []); $ok = $s->set_handlers($hook_name => undef); =over 4 =item obj: C<$s> ( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> ) =item arg1: C<$hook_name> ( string ) the phase to set the handlers in =item arg2: C<$handlers> ( CODE ref or SUB name or an ARRAY ref ) a reference to a single handler CODE reference or just a name of the subroutine (fully qualified unless defined in the current package). if more than one passed, use a reference to an array of CODE refs and/or subroutine names. if the argument is C<undef> or C<[]> the list of handlers is reset to zero. =item ret: C<$ok> ( boolean ) returns a true value on success, otherwise a false value =item since: 2.0.00 =back See also: C<L<$r-E<gt>add_config|docs::2.0::api::Apache2::RequestUtil/C_set_handlers_>> Examples: A single handler: $r->set_handlers(PerlChildExitHandler => \&handler); Multiple handlers: $r->set_handlers(PerlFixupHandler => ['Foo::Bar::handler', \&handler2]); Anonymous functions: $r->set_handlers(PerlLogHandler => sub { return Apache2::Const::OK }); Reset any previously set handlers: $r->set_handlers(PerlCleanupHandler => []); or $r->set_handlers(PerlCleanupHandler => undef); =head2 C<user_id> Get the user id corresponding to the C<User> directive in F<httpd.conf>: $uid = Apache2::ServerUtil->user_id; =over 4 =item obj: C<Apache2::ServerUtil> (class name) =item ret: C<$uid> ( integer ) On Unix platforms returns the uid corresponding to the value used in the C<User> directive in F<httpd.conf>. On other platforms returns 0. =item since: 2.0.03 =back =head1 Unsupported API C<Apache2::ServerUtil> also provides auto-generated Perl interface for a few other methods which aren't tested at the moment and therefore their API is a subject to change. These methods will be finalized later as a need arises. If you want to rely on any of the following methods please contact the L<the mod_perl development mailing list|maillist::dev> so we can help each other take the steps necessary to shift the method to an officially supported API. =head2 C<error_log2stderr> Start sending STDERR to the error_log file $s->error_log2stderr(); =over 4 =item obj: C<$s> ( C<L<Apache2::ServerRec object|docs::2.0::api::Apache2::ServerRec>> ) The current server =item ret: no return value =item since: 2.0.00 =back This method may prove useful if you want to start redirecting STDERR to the error_log file before Apache does that on the startup. =head1 See Also L<mod_perl 2.0 documentation|docs::2.0::index>. =head1 Copyright mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. =head1 Authors L<The mod_perl development team and numerous contributors|about::contributors::people>. =cut
Distrotech/mod_perl
docs/src/docs/2.0/api/Apache2/ServerUtil.pod
Perl
apache-2.0
21,798
#! /usr/bin/env perl ##************************************************************** ## ## Copyright (C) 1990-2007, Condor Team, Computer Sciences Department, ## University of Wisconsin-Madison, WI. ## ## Licensed under the Apache License, Version 2.0 (the "License"); you ## may not use this file except in compliance with the License. You may ## obtain a copy of the License at ## ## http://www.apache.org/licenses/LICENSE-2.0 ## ## Unless required by applicable law or agreed to in writing, software ## distributed under the License is distributed on an "AS IS" BASIS, ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## See the License for the specific language governing permissions and ## limitations under the License. ## ##************************************************************** use CondorTest; use CondorUtils; #BEGIN {$^W=1} #warnings enabled while( <> ) { CondorUtils::fullchomp($_); print "$_\n"; }
djw8605/htcondor
src/condor_tests/job_core_input.pl
Perl
apache-2.0
960
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! # This file is machine-generated by mktables from the Unicode # database, Version 6.1.0. Any changes made here will be lost! # !!!!!!! INTERNAL PERL USE ONLY !!!!!!! # This file is for internal use by core Perl only. The format and even the # name or existence of this file are subject to change without notice. Don't # use it directly. return <<'END'; E000 F8FF F0000 FFFFD 100000 10FFFD END
Dokaponteam/ITF_Project
xampp/perl/lib/unicore/lib/Gc/Co.pl
Perl
mit
447
#! c:\perl\bin\perl.exe #----------------------------------------------------------- # del_tln.pl # # # Change history # 20140807 - created # # References: # # # # copyright 2014 QAR, LLC # Author: H. Carvey #----------------------------------------------------------- package del_tln; use strict; my %config = (hive => "All", hasShortDescr => 1, hasDescr => 0, hasRefs => 0, osmask => 22, category => "deleted", version => 20140807); sub getConfig{return %config} sub getShortDescr { return "Parse hive, print deleted keys/values"; } sub getDescr{} sub getRefs {} sub getHive {return $config{hive};} sub getVersion {return $config{version};} my $VERSION = getVersion(); my %regkeys; sub pluginmain { my $class = shift; my $file = shift; my $reg = Parse::Win32Registry->new($file); my $root_key = $reg->get_root_key; # ::logMsg("Launching del v.".$VERSION); # ::rptMsg("del v.".$VERSION); # banner # ::rptMsg("(".getHive().") ".getShortDescr()."\n"); # banner my $entry_iter = $reg->get_entry_iterator; while (defined(my $entry = $entry_iter->get_next)) { next if $entry->is_allocated; # printf "0x%x ", $entry->get_offset; # print $entry->unparsed()."\n"; my $tag = $entry->get_tag(); my $str = $entry->as_string(); next if ($str eq "(unidentified entry)"); if ($tag eq "nk") { if ($entry->get_length() > 15) { my ($t0,$t1) = unpack("VV",substr($entry->get_raw_bytes(),8,16)); my $lw = ::getTime($t0,$t1); ::rptMsg($lw."|REG|||[Deleted key]: ".parseDelKeyName($str)); } } else {} } } sub parseDelKeyName { my $str = shift; my $name_str = (split(/\s\[/,$str))[0]; my @list = split(/\\/,$name_str); shift(@list); return join('\\',@list); } 1;
APriestman/autopsy
thirdparty/rr-full/plugins/del_tln.pl
Perl
apache-2.0
1,842
# mod_auth.pl sub mod_auth_directives { local $rv = [ [ 'DefaultChdir', 0, 2, 'virtual anon global', 1.20 ], [ 'DefaultRoot', 1, 2, 'virtual global', 0.99 ], [ 'LoginPasswordPrompt', 0, 3, 'virtual anon global', 1.20 ], [ 'RootLogin', 0, 6, 'virtual anon global', 1.15 ] ]; return &make_directives($rv, $_[0], "mod_auth"); } sub edit_DefaultChdir { return (1, $text{'mod_auth_chdir'}, &opt_input($_[0]->{'value'}, "DefaultChdir", $text{'default'}, 20)); } sub save_DefaultChdir { return &parse_opt("DefaultChdir", '^\S+$', $text{'mod_auth_echdir'}); } sub edit_DefaultRoot { local $rv = "<table border>\n". "<tr $tb> <td><b>$text{'mod_auth_dir'}</b></td> ". "<td><b>$text{'mod_auth_groups'}</b></td> </tr>\n"; local $i = 0; foreach $r (@{$_[0]}, { }) { local @w = @{$r->{'words'}}; $rv .= "<tr $cb>\n"; local $dd = $w[0] eq "~" ? 2 : $w[0] ? 0 : 1; $rv .= sprintf "<td nowrap><input name=DefaultRoot_dd_$i type=radio value=1 %s> %s\n", $dd == 1 ? "checked" : "", $text{'mod_auth_none'}; $rv .= sprintf "<input name=DefaultRoot_dd_$i type=radio value=2 %s> %s\n", $dd == 2 ? "checked" : "", $text{'mod_auth_home'}; $rv .= sprintf "<input name=DefaultRoot_dd_$i type=radio value=0 %s>\n", $dd == 0 ? "checked" : ""; $rv .= sprintf "<input name=DefaultRoot_d_$i size=20 value='%s'></td>\n", $dd ? "" : $w[0]; $rv .= sprintf "<td nowrap><input name=DefaultRoot_gd_$i type=radio value=1 %s> %s\n", $w[1] ? "" : "checked", $text{'mod_auth_all'}; $rv .= sprintf "<input name=DefaultRoot_gd_$i type=radio value=0 %s>\n", $w[1] ? "checked" : ""; $rv .= sprintf "<input name=DefaultRoot_g_$i size=12 value='%s'></td>\n", join(" ", split(/,/, $w[1])); $rv .= "</tr>\n"; $i++; } $rv .= "</table>\n"; return (2, $text{'mod_auth_chroot'}, $rv); } sub save_DefaultRoot { for($i=0; defined($in{"DefaultRoot_d_$i"}); $i++) { next if ($in{"DefaultRoot_dd_$i"} == 1); local $v = $in{"DefaultRoot_dd_$i"} == 2 ? "~" :$in{"DefaultRoot_d_$i"}; $v =~ /^\S+$/ || &error($text{'mod_auth_edir'}); if (!$in{"DefaultRoot_gd_$i"}) { local @g = split(/\s+/, $in{"DefaultRoot_g_$i"}); @g || &error($text{'mod_auth_egroups'}); $v .= " ".join(",", @g); } push(@rv, $v); } return ( \@rv ); } sub edit_LoginPasswordPrompt { return (1, $text{'mod_auth_login'}, &choice_input($_[0]->{'value'}, "LoginPasswordPrompt", "", "$text{'yes'},on", "$text{'no'},off", "$text{'default'},")); } sub save_LoginPasswordPrompt { return &parse_choice("LoginPasswordPrompt", ""); } sub edit_RootLogin { return (1, $text{'mod_auth_root'}, &choice_input($_[0]->{'value'}, "RootLogin", "", "$text{'yes'},on", "$text{'no'},off", "$text{'default'},")); } sub save_RootLogin { return &parse_choice("RootLogin", ""); }
HasClass0/webmin
proftpd/mod_auth.pl
Perl
bsd-3-clause
2,745
########################################################################### # # This file is auto-generated by the Perl DateTime Suite locale # generator (0.05). This code generator comes with the # DateTime::Locale distribution in the tools/ directory, and is called # generate-from-cldr. # # This file as generated from the CLDR XML locale data. See the # LICENSE.cldr file included in this distribution for license details. # # This file was generated from the source file kl_GL.xml # The source file version number was 1.44, generated on # 2009/05/05 23:06:37. # # Do not edit this file directly. # ########################################################################### package DateTime::Locale::kl_GL; use strict; use warnings; use utf8; use base 'DateTime::Locale::kl'; sub cldr_version { return "1\.7\.1" } { my $first_day_of_week = "7"; sub first_day_of_week { return $first_day_of_week } } { my $glibc_date_format = "\%d\ \%b\ \%Y"; sub glibc_date_format { return $glibc_date_format } } { my $glibc_date_1_format = "\%a\ \%b\ \%e\ \%H\:\%M\:\%S\ \%Z\ \%Y"; sub glibc_date_1_format { return $glibc_date_1_format } } { my $glibc_datetime_format = "\%a\ \%d\ \%b\ \%Y\ \%T\ \%Z"; sub glibc_datetime_format { return $glibc_datetime_format } } { my $glibc_time_format = "\%T"; sub glibc_time_format { return $glibc_time_format } } 1; __END__ =pod =encoding utf8 =head1 NAME DateTime::Locale::kl_GL =head1 SYNOPSIS use DateTime; my $dt = DateTime->now( locale => 'kl_GL' ); print $dt->month_name(); =head1 DESCRIPTION This is the DateTime locale package for Kalaallisut Greenland. =head1 DATA This locale inherits from the L<DateTime::Locale::kl> locale. It contains the following data. =head2 Days =head3 Wide (format) ataasinngorneq marlunngorneq pingasunngorneq sisamanngorneq tallimanngorneq arfininngorneq sabaat =head3 Abbreviated (format) ata mar pin sis tal arf sab =head3 Narrow (format) 2 3 4 5 6 7 1 =head3 Wide (stand-alone) ataasinngorneq marlunngorneq pingasunngorneq sisamanngorneq tallimanngorneq arfininngorneq sabaat =head3 Abbreviated (stand-alone) ata mar pin sis tal arf sab =head3 Narrow (stand-alone) 2 3 4 5 6 7 1 =head2 Months =head3 Wide (format) januari februari martsi aprili maji juni juli augustusi septemberi oktoberi novemberi decemberi =head3 Abbreviated (format) jan feb mar apr maj jun jul aug sep okt nov dec =head3 Narrow (format) 1 2 3 4 5 6 7 8 9 10 11 12 =head3 Wide (stand-alone) januari februari martsi aprili maji juni juli augustusi septemberi oktoberi novemberi decemberi =head3 Abbreviated (stand-alone) jan feb mar apr maj jun jul aug sep okt nov dec =head3 Narrow (stand-alone) 1 2 3 4 5 6 7 8 9 10 11 12 =head2 Quarters =head3 Wide (format) Q1 Q2 Q3 Q4 =head3 Abbreviated (format) Q1 Q2 Q3 Q4 =head3 Narrow (format) 1 2 3 4 =head3 Wide (stand-alone) Q1 Q2 Q3 Q4 =head3 Abbreviated (stand-alone) Q1 Q2 Q3 Q4 =head3 Narrow (stand-alone) 1 2 3 4 =head2 Eras =head3 Wide BCE CE =head3 Abbreviated BCE CE =head3 Narrow BCE CE =head2 Date Formats =head3 Full 2008-02-05T18:30:30 = marlunngorneq 05 februari 2008 1995-12-22T09:05:02 = tallimanngorneq 22 decemberi 1995 -0010-09-15T04:44:23 = arfininngorneq 15 septemberi -10 =head3 Long 2008-02-05T18:30:30 = 05 februari 2008 1995-12-22T09:05:02 = 22 decemberi 1995 -0010-09-15T04:44:23 = 15 septemberi -10 =head3 Medium 2008-02-05T18:30:30 = feb 05, 2008 1995-12-22T09:05:02 = dec 22, 1995 -0010-09-15T04:44:23 = sep 15, -10 =head3 Short 2008-02-05T18:30:30 = 05/02/08 1995-12-22T09:05:02 = 22/12/95 -0010-09-15T04:44:23 = 15/09/-10 =head3 Default 2008-02-05T18:30:30 = feb 05, 2008 1995-12-22T09:05:02 = dec 22, 1995 -0010-09-15T04:44:23 = sep 15, -10 =head2 Time Formats =head3 Full 2008-02-05T18:30:30 = 6:30:30 PM UTC 1995-12-22T09:05:02 = 9:05:02 AM UTC -0010-09-15T04:44:23 = 4:44:23 AM UTC =head3 Long 2008-02-05T18:30:30 = 6:30:30 PM UTC 1995-12-22T09:05:02 = 9:05:02 AM UTC -0010-09-15T04:44:23 = 4:44:23 AM UTC =head3 Medium 2008-02-05T18:30:30 = 6:30:30 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM =head3 Short 2008-02-05T18:30:30 = 6:30 PM 1995-12-22T09:05:02 = 9:05 AM -0010-09-15T04:44:23 = 4:44 AM =head3 Default 2008-02-05T18:30:30 = 6:30:30 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM =head2 Datetime Formats =head3 Full 2008-02-05T18:30:30 = marlunngorneq 05 februari 2008 6:30:30 PM UTC 1995-12-22T09:05:02 = tallimanngorneq 22 decemberi 1995 9:05:02 AM UTC -0010-09-15T04:44:23 = arfininngorneq 15 septemberi -10 4:44:23 AM UTC =head3 Long 2008-02-05T18:30:30 = 05 februari 2008 6:30:30 PM UTC 1995-12-22T09:05:02 = 22 decemberi 1995 9:05:02 AM UTC -0010-09-15T04:44:23 = 15 septemberi -10 4:44:23 AM UTC =head3 Medium 2008-02-05T18:30:30 = feb 05, 2008 6:30:30 PM 1995-12-22T09:05:02 = dec 22, 1995 9:05:02 AM -0010-09-15T04:44:23 = sep 15, -10 4:44:23 AM =head3 Short 2008-02-05T18:30:30 = 05/02/08 6:30 PM 1995-12-22T09:05:02 = 22/12/95 9:05 AM -0010-09-15T04:44:23 = 15/09/-10 4:44 AM =head3 Default 2008-02-05T18:30:30 = feb 05, 2008 6:30:30 PM 1995-12-22T09:05:02 = dec 22, 1995 9:05:02 AM -0010-09-15T04:44:23 = sep 15, -10 4:44:23 AM =head2 Available Formats =head3 d (d) 2008-02-05T18:30:30 = 5 1995-12-22T09:05:02 = 22 -0010-09-15T04:44:23 = 15 =head3 EEEd (d EEE) 2008-02-05T18:30:30 = 5 mar 1995-12-22T09:05:02 = 22 tal -0010-09-15T04:44:23 = 15 arf =head3 Hm (H:mm) 2008-02-05T18:30:30 = 18:30 1995-12-22T09:05:02 = 9:05 -0010-09-15T04:44:23 = 4:44 =head3 hm (h:mm a) 2008-02-05T18:30:30 = 6:30 PM 1995-12-22T09:05:02 = 9:05 AM -0010-09-15T04:44:23 = 4:44 AM =head3 Hms (H:mm:ss) 2008-02-05T18:30:30 = 18:30:30 1995-12-22T09:05:02 = 9:05:02 -0010-09-15T04:44:23 = 4:44:23 =head3 hms (h:mm:ss a) 2008-02-05T18:30:30 = 6:30:30 PM 1995-12-22T09:05:02 = 9:05:02 AM -0010-09-15T04:44:23 = 4:44:23 AM =head3 M (L) 2008-02-05T18:30:30 = 2 1995-12-22T09:05:02 = 12 -0010-09-15T04:44:23 = 9 =head3 Md (M-d) 2008-02-05T18:30:30 = 2-5 1995-12-22T09:05:02 = 12-22 -0010-09-15T04:44:23 = 9-15 =head3 MEd (E, M-d) 2008-02-05T18:30:30 = mar, 2-5 1995-12-22T09:05:02 = tal, 12-22 -0010-09-15T04:44:23 = arf, 9-15 =head3 MMdd (dd/MM) 2008-02-05T18:30:30 = 05/02 1995-12-22T09:05:02 = 22/12 -0010-09-15T04:44:23 = 15/09 =head3 MMM (LLL) 2008-02-05T18:30:30 = feb 1995-12-22T09:05:02 = dec -0010-09-15T04:44:23 = sep =head3 MMMd (MMM d) 2008-02-05T18:30:30 = feb 5 1995-12-22T09:05:02 = dec 22 -0010-09-15T04:44:23 = sep 15 =head3 MMMEd (E MMM d) 2008-02-05T18:30:30 = mar feb 5 1995-12-22T09:05:02 = tal dec 22 -0010-09-15T04:44:23 = arf sep 15 =head3 MMMMd (MMMM d) 2008-02-05T18:30:30 = februari 5 1995-12-22T09:05:02 = decemberi 22 -0010-09-15T04:44:23 = septemberi 15 =head3 MMMMdd (dd MMMM) 2008-02-05T18:30:30 = 05 februari 1995-12-22T09:05:02 = 22 decemberi -0010-09-15T04:44:23 = 15 septemberi =head3 MMMMEd (E MMMM d) 2008-02-05T18:30:30 = mar februari 5 1995-12-22T09:05:02 = tal decemberi 22 -0010-09-15T04:44:23 = arf septemberi 15 =head3 ms (mm:ss) 2008-02-05T18:30:30 = 30:30 1995-12-22T09:05:02 = 05:02 -0010-09-15T04:44:23 = 44:23 =head3 y (y) 2008-02-05T18:30:30 = 2008 1995-12-22T09:05:02 = 1995 -0010-09-15T04:44:23 = -10 =head3 yM (y-M) 2008-02-05T18:30:30 = 2008-2 1995-12-22T09:05:02 = 1995-12 -0010-09-15T04:44:23 = -10-9 =head3 yMEd (EEE, y-M-d) 2008-02-05T18:30:30 = mar, 2008-2-5 1995-12-22T09:05:02 = tal, 1995-12-22 -0010-09-15T04:44:23 = arf, -10-9-15 =head3 yMMM (y MMM) 2008-02-05T18:30:30 = 2008 feb 1995-12-22T09:05:02 = 1995 dec -0010-09-15T04:44:23 = -10 sep =head3 yMMMEd (EEE, y MMM d) 2008-02-05T18:30:30 = mar, 2008 feb 5 1995-12-22T09:05:02 = tal, 1995 dec 22 -0010-09-15T04:44:23 = arf, -10 sep 15 =head3 yMMMM (y MMMM) 2008-02-05T18:30:30 = 2008 februari 1995-12-22T09:05:02 = 1995 decemberi -0010-09-15T04:44:23 = -10 septemberi =head3 yQ (y Q) 2008-02-05T18:30:30 = 2008 1 1995-12-22T09:05:02 = 1995 4 -0010-09-15T04:44:23 = -10 3 =head3 yQQQ (y QQQ) 2008-02-05T18:30:30 = 2008 Q1 1995-12-22T09:05:02 = 1995 Q4 -0010-09-15T04:44:23 = -10 Q3 =head3 yyMM (MM/yy) 2008-02-05T18:30:30 = 02/08 1995-12-22T09:05:02 = 12/95 -0010-09-15T04:44:23 = 09/-10 =head3 yyQ (Q yy) 2008-02-05T18:30:30 = 1 08 1995-12-22T09:05:02 = 4 95 -0010-09-15T04:44:23 = 3 -10 =head3 yyyyMMMM (MMMM y) 2008-02-05T18:30:30 = februari 2008 1995-12-22T09:05:02 = decemberi 1995 -0010-09-15T04:44:23 = septemberi -10 =head2 Miscellaneous =head3 Prefers 24 hour time? No =head3 Local first day of the week sabaat =head1 SUPPORT See L<DateTime::Locale>. =head1 AUTHOR Dave Rolsky <autarch@urth.org> =head1 COPYRIGHT Copyright (c) 2008 David Rolsky. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This module was generated from data provided by the CLDR project, see the LICENSE.cldr in this distribution for details on the CLDR data's license. =cut
liuyangning/WX_web
xampp/perl/vendor/lib/DateTime/Locale/kl_GL.pm
Perl
mit
9,663
use Win32::OLE 'in'; $Win32::OLE::Warn = 3; #script stopt met foutmelding als er ergens iets niet lukt my $ComputerName = "."; my $NameSpace = "root/cimv2"; my $ClassName = "Win32_Environment"; my $Locator=Win32::OLE->new("WbemScripting.SWbemLocator"); my $WbemServices = $Locator->ConnectServer($ComputerName, $NameSpace); my $Class = $WbemServices->Get($ClassName); my $Instance = $Class->SpawnInstance_(); my $lijn = $ARGV[0]; my ($naam,$waarde)=split("=",$lijn); #OF ingelezen waarden - let op met "\n" op einde van de lijn. #chomp($_=<>); #my ($naam,$waarde)=split "="; $Instance->{UserName} = "<SYSTEM>"; $Instance->{SystemVariable}= 1; #niet verplicht $Instance->{Name} = $naam; $Instance->{VariableValue} = $waarde; my $pad=$Instance->Put_(); #return-waarde is SWbemObjectPath van de nieuwe instantie print "gelukt !\n" unless Win32::OLE->LastError(); print "Absolute path = ",$Instance->{path_}->{path},"\n"; #geen uitvoer print "Absolute path = ",$Instance->{SystemProperties_}->Item("__PATH")->{Value},"\n"; #geen uitvoer #lukt wel print "return = ",$pad->{path},"\n"; #relatieve pad lukt op drie manieren print "Relative path = ",$Instance->{path_}->{relpath},"\n"; print "Relative path = ",$Instance->{SystemProperties_}->Item("__RELPATH")->{Value},"\n"; print "return = ",$pad->{RelPath},"\n"; __DATA__ test=fliepie
VDBBjorn/Besturingssystemen-III
Labo/reeks4/Reeks4_47.pl
Perl
mit
1,423
package App::Sqitch::Engine::oracle; use 5.010; use Moo; use utf8; use Path::Class; use DBI; use Try::Tiny; use App::Sqitch::X qw(hurl); use Locale::TextDomain qw(App-Sqitch); use App::Sqitch::Plan::Change; use List::Util qw(first); use App::Sqitch::Types qw(DBH Dir ArrayRef); use namespace::autoclean; extends 'App::Sqitch::Engine'; our $VERSION = '0.997'; BEGIN { # We tell the Oracle connector which encoding to use. The last part of the # environment variable NLS_LANG is relevant concerning data encoding. $ENV{NLS_LANG} = 'AMERICAN_AMERICA.AL32UTF8'; # Disable SQLPATH so that no start scripts run. $ENV{SQLPATH} = ''; } sub destination { my $self = shift; # Just use the target name if it doesn't look like a URI or if the URI # includes the database name. return $self->target->name if $self->target->name !~ /:/ || $self->target->uri->dbname; # Use the URI sans password, and with the database name added. my $uri = $self->target->uri->clone; $uri->password(undef) if $uri->password; $uri->dbname( $ENV{TWO_TASK} || ( $^O eq 'MSWin32' ? $ENV{LOCAL} : undef ) || $ENV{ORACLE_SID} || $uri->user || $self->sqitch->sysuser ); return $uri->as_string; } has _sqlplus => ( is => 'ro', isa => ArrayRef, lazy => 1, default => sub { my $self = shift; [ $self->client, qw(-S -L /nolog) ]; }, ); sub sqlplus { @{ shift->_sqlplus } } has tmpdir => ( is => 'ro', isa => Dir, lazy => 1, default => sub { require File::Temp; dir File::Temp::tempdir( CLEANUP => 1 ); }, ); sub key { 'oracle' } sub name { 'Oracle' } sub driver { 'DBD::Oracle 1.23' } sub default_registry { '' } sub default_client { file( ($ENV{ORACLE_HOME} || ()), 'sqlplus' )->stringify } has dbh => ( is => 'rw', isa => DBH, lazy => 1, default => sub { my $self = shift; $self->use_driver; my $uri = $self->uri; DBI->connect($uri->dbi_dsn, $uri->user, $uri->password, { PrintError => 0, RaiseError => 0, AutoCommit => 1, FetchHashKeyName => 'NAME_lc', HandleError => sub { my ($err, $dbh) = @_; $@ = $err; @_ = ($dbh->state || 'DEV' => $dbh->errstr); goto &hurl; }, Callbacks => { connected => sub { my $dbh = shift; $dbh->do("ALTER SESSION SET $_='YYYY-MM-DD HH24:MI:SS TZR'") for qw( nls_date_format nls_timestamp_format nls_timestamp_tz_format ); if (my $schema = $self->registry) { try { $dbh->do("ALTER SESSION SET CURRENT_SCHEMA = $schema"); # http://www.nntp.perl.org/group/perl.dbi.dev/2013/11/msg7622.html $dbh->set_err(undef, undef) if $dbh->err; }; } return; }, }, }); } ); # Need to wait until dbh is defined. with 'App::Sqitch::Role::DBIEngine'; sub _log_tags_param { [ map { $_->format_name } $_[1]->tags ]; } sub _log_requires_param { [ map { $_->as_string } $_[1]->requires ]; } sub _log_conflicts_param { [ map { $_->as_string } $_[1]->conflicts ]; } sub _ts2char_format { q{to_char(%1$s AT TIME ZONE 'UTC', '"year":YYYY:"month":MM:"day":DD') || to_char(%1$s AT TIME ZONE 'UTC', ':"hour":HH24:"minute":MI:"second":SS:"time_zone":"UTC"')} } sub _ts_default { 'current_timestamp' } sub _can_limit { 0 } sub _char2ts { my $dt = $_[1]; join ' ', $dt->ymd('-'), $dt->hms(':'), $dt->time_zone->name; } sub _listagg_format { # http://stackoverflow.com/q/16313631/79202 return q{CAST(COLLECT(CAST(%s AS VARCHAR2(512))) AS sqitch_array)}; } sub _regex_op { 'REGEXP_LIKE(%s, ?)' } sub _simple_from { ' FROM dual' } sub _multi_values { my ($self, $count, $expr) = @_; return join "\nUNION ALL ", ("SELECT $expr FROM dual") x $count; } sub _dt($) { require App::Sqitch::DateTime; return App::Sqitch::DateTime->new(split /:/ => shift); } sub _cid { my ( $self, $ord, $offset, $project ) = @_; return try { return $self->dbh->selectcol_arrayref(qq{ SELECT change_id FROM ( SELECT change_id, rownum as rnum FROM ( SELECT change_id FROM changes WHERE project = ? ORDER BY committed_at $ord ) ) WHERE rnum = ? }, undef, $project || $self->plan->project, ($offset // 0) + 1)->[0]; } catch { return if $self->_no_table_error; die $_; }; } sub _cid_head { my ($self, $project, $change) = @_; return $self->dbh->selectcol_arrayref(qq{ SELECT change_id FROM ( SELECT change_id FROM changes WHERE project = ? AND change = ? ORDER BY committed_at DESC ) WHERE rownum = 1 }, undef, $project, $change)->[0]; } sub current_state { my ( $self, $project ) = @_; my $cdtcol = sprintf $self->_ts2char_format, 'c.committed_at'; my $pdtcol = sprintf $self->_ts2char_format, 'c.planned_at'; my $tagcol = sprintf $self->_listagg_format, 't.tag'; my $dbh = $self->dbh; my $state = $dbh->selectrow_hashref(qq{ SELECT * FROM ( SELECT c.change_id , c.change , c.project , c.note , c.committer_name , c.committer_email , $cdtcol AS committed_at , c.planner_name , c.planner_email , $pdtcol AS planned_at , $tagcol AS tags FROM changes c LEFT JOIN tags t ON c.change_id = t.change_id WHERE c.project = ? GROUP BY c.change_id , c.change , c.project , c.note , c.committer_name , c.committer_email , c.committed_at , c.planner_name , c.planner_email , c.planned_at ORDER BY c.committed_at DESC ) WHERE rownum = 1 }, undef, $project // $self->plan->project) or return undef; $state->{committed_at} = _dt $state->{committed_at}; $state->{planned_at} = _dt $state->{planned_at}; return $state; } sub is_deployed_change { my ( $self, $change ) = @_; $self->dbh->selectcol_arrayref( 'SELECT 1 FROM changes WHERE change_id = ?', undef, $change->id )->[0]; } sub initialized { my $self = shift; return $self->dbh->selectcol_arrayref(q{ SELECT 1 FROM all_tables WHERE owner = UPPER(?) AND table_name = 'CHANGES' }, undef, $self->registry || $self->uri->user)->[0]; } sub _log_event { my ( $self, $event, $change, $tags, $requires, $conflicts) = @_; my $dbh = $self->dbh; my $sqitch = $self->sqitch; $tags ||= $self->_log_tags_param($change); $requires ||= $self->_log_requires_param($change); $conflicts ||= $self->_log_conflicts_param($change); # Use the sqitch_array() constructor to insert arrays of values. my $tag_ph = 'sqitch_array('. join(', ', ('?') x @{ $tags }) . ')'; my $req_ph = 'sqitch_array('. join(', ', ('?') x @{ $requires }) . ')'; my $con_ph = 'sqitch_array('. join(', ', ('?') x @{ $conflicts }) . ')'; my $ts = $self->_ts_default; $dbh->do(qq{ INSERT INTO events ( event , change_id , change , project , note , tags , requires , conflicts , committer_name , committer_email , planned_at , planner_name , planner_email , committed_at ) VALUES (?, ?, ?, ?, ?, $tag_ph, $req_ph, $con_ph, ?, ?, ?, ?, ?, $ts) }, undef, $event, $change->id, $change->name, $change->project, $change->note, @{ $tags }, @{ $requires }, @{ $conflicts }, $sqitch->user_name, $sqitch->user_email, $self->_char2ts( $change->timestamp ), $change->planner_name, $change->planner_email, ); return $self; } sub changes_requiring_change { my ( $self, $change ) = @_; # Why CTE: https://forums.oracle.com/forums/thread.jspa?threadID=1005221 return @{ $self->dbh->selectall_arrayref(q{ WITH tag AS ( SELECT tag, committed_at, project, ROW_NUMBER() OVER (partition by project ORDER BY committed_at) AS rnk FROM tags ) SELECT c.change_id, c.project, c.change, t.tag AS asof_tag FROM dependencies d JOIN changes c ON c.change_id = d.change_id LEFT JOIN tag t ON t.project = c.project AND t.committed_at >= c.committed_at WHERE d.dependency_id = ? AND (t.rnk IS NULL OR t.rnk = 1) }, { Slice => {} }, $change->id) }; } sub name_for_change_id { my ( $self, $change_id ) = @_; # Why CTE: https://forums.oracle.com/forums/thread.jspa?threadID=1005221 return $self->dbh->selectcol_arrayref(q{ WITH tag AS ( SELECT tag, committed_at, project, ROW_NUMBER() OVER (partition by project ORDER BY committed_at) AS rnk FROM tags ) SELECT change || COALESCE(t.tag, '') FROM changes c LEFT JOIN tag t ON c.project = t.project AND t.committed_at >= c.committed_at WHERE change_id = ? AND (t.rnk IS NULL OR t.rnk = 1) }, undef, $change_id)->[0]; } sub change_offset_from_id { my ( $self, $change_id, $offset ) = @_; # Just return the object if there is no offset. return $self->load_change($change_id) unless $offset; # Are we offset forwards or backwards? my ( $dir, $op ) = $offset > 0 ? ( 'ASC', '>' ) : ( 'DESC' , '<' ); my $tscol = sprintf $self->_ts2char_format, 'c.planned_at'; my $tagcol = sprintf $self->_listagg_format, 't.tag'; my $change = $self->dbh->selectrow_hashref(qq{ SELECT id, name, project, note, timestamp, planner_name, planner_email, tags FROM ( SELECT id, name, project, note, timestamp, planner_name, planner_email, tags, rownum AS rnum FROM ( SELECT c.change_id AS id, c.change AS name, c.project, c.note, $tscol AS timestamp, c.planner_name, c.planner_email, $tagcol AS tags FROM changes c LEFT JOIN tags t ON c.change_id = t.change_id WHERE c.project = ? AND c.committed_at $op ( SELECT committed_at FROM changes WHERE change_id = ? ) GROUP BY c.change_id, c.change, c.project, c.note, c.planned_at, c.planner_name, c.planner_email, c.committed_at ORDER BY c.committed_at $dir ) ) WHERE rnum = ? }, undef, $self->plan->project, $change_id, abs $offset) || return undef; $change->{timestamp} = _dt $change->{timestamp}; return $change; } sub is_deployed_tag { my ( $self, $tag ) = @_; return $self->dbh->selectcol_arrayref( 'SELECT 1 FROM tags WHERE tag_id = ?', undef, $tag->id )->[0]; } sub initialize { my $self = shift; my $schema = $self->registry; hurl engine => __ 'Sqitch already initialized' if $self->initialized; # Load up our database. (my $file = file(__FILE__)->dir->file('oracle.sql')) =~ s/"/""/g; my $meth = $self->can($self->sqitch->verbosity > 1 ? '_run' : '_capture'); $self->$meth( ( $schema ? ( "DEFINE registry=$schema" ) : ( # Select the current schema into &registry. # http://www.orafaq.com/node/515 'COLUMN sname for a30 new_value registry', q{SELECT SYS_CONTEXT('USERENV', 'SESSION_SCHEMA') AS sname FROM DUAL;}, ) ), qq{\@"$file"} ); $self->dbh->do("ALTER SESSION SET CURRENT_SCHEMA = $schema") if $schema; return $self; } # Override for special handling of regular the expression operator and # LIMIT/OFFSET. sub search_events { my ( $self, %p ) = @_; # Determine order direction. my $dir = 'DESC'; if (my $d = delete $p{direction}) { $dir = $d =~ /^ASC/i ? 'ASC' : $d =~ /^DESC/i ? 'DESC' : hurl 'Search direction must be either "ASC" or "DESC"'; } # Limit with regular expressions? my (@wheres, @params); for my $spec ( [ committer => 'committer_name' ], [ planner => 'planner_name' ], [ change => 'change' ], [ project => 'project' ], ) { my $regex = delete $p{ $spec->[0] } // next; push @wheres => "REGEXP_LIKE($spec->[1], ?)"; push @params => $regex; } # Match events? if (my $e = delete $p{event} ) { my ($in, @vals) = $self->_in_expr( $e ); push @wheres => "event $in"; push @params => @vals; } # Assemble the where clause. my $where = @wheres ? "\n WHERE " . join( "\n ", @wheres ) : ''; # Handle remaining parameters. my ($lim, $off) = (delete $p{limit}, delete $p{offset}); hurl 'Invalid parameters passed to search_events(): ' . join ', ', sort keys %p if %p; # Prepare, execute, and return. my $cdtcol = sprintf $self->_ts2char_format, 'committed_at'; my $pdtcol = sprintf $self->_ts2char_format, 'planned_at'; my $sql = qq{ SELECT event , project , change_id , change , note , requires , conflicts , tags , committer_name , committer_email , $cdtcol AS committed_at , planner_name , planner_email , $pdtcol AS planned_at FROM events$where ORDER BY events.committed_at $dir }; if ($lim || $off) { my @limits; if ($lim) { $off //= 0; push @params => $lim + $off; push @limits => 'rnum <= ?'; } if ($off) { push @params => $off; push @limits => 'rnum > ?'; } $sql = "SELECT * FROM ( SELECT ROWNUM AS rnum, i.* FROM ($sql) i ) WHERE " . join ' AND ', @limits; } my $sth = $self->dbh->prepare($sql); $sth->execute(@params); return sub { my $row = $sth->fetchrow_hashref or return; delete $row->{rnum}; $row->{committed_at} = _dt $row->{committed_at}; $row->{planned_at} = _dt $row->{planned_at}; return $row; }; } # Override to lock the changes table. This ensures that only one instance of # Sqitch runs at one time. sub begin_work { my $self = shift; my $dbh = $self->dbh; # Start transaction and lock changes to allow only one change at a time. $dbh->begin_work; $dbh->do('LOCK TABLE changes IN EXCLUSIVE MODE'); return $self; } sub _file_for_script { my ($self, $file) = @_; # Just use the file if no special character. if ($file !~ /[@?%\$]/) { $file =~ s/"/""/g; return $file; } # Alias or copy the file to a temporary directory that's removed on exit. (my $alias = $file->basename) =~ s/[@?%\$]/_/g; $alias = $self->tmpdir->file($alias); # Remove existing file. if (-e $alias) { $alias->remove or hurl oracle => __x( 'Cannot remove {file}: {error}', file => $alias, error => $! ); } if ($^O eq 'MSWin32') { # Copy it. $file->copy_to($alias) or hurl oracle => __x( 'Cannot copy {file} to {alias}: {error}', file => $file, alias => $alias, error => $! ); } else { # Symlink it. $alias->remove; symlink $file->absolute, $alias or hurl oracle => __x( 'Cannot symlink {file} to {alias}: {error}', file => $file, alias => $alias, error => $! ); } # Return the alias. $alias =~ s/"/""/g; return $alias; } sub run_file { my $self = shift; my $file = $self->_file_for_script(shift); $self->_run(qq{\@"$file"}); } sub run_verify { my $self = shift; my $file = $self->_file_for_script(shift); # Suppress STDOUT unless we want extra verbosity. my $meth = $self->can($self->sqitch->verbosity > 1 ? '_run' : '_capture'); $self->$meth(qq{\@"$file"}); } sub run_handle { my ($self, $fh) = @_; my $conn = $self->_script; open my $tfh, '<:utf8_strict', \$conn; $self->sqitch->spool( [$tfh, $fh], $self->sqlplus ); } # Override to take advantage of the RETURNING expression, and to save tags as # an array rather than a space-delimited string. sub log_revert_change { my ($self, $change) = @_; my $dbh = $self->dbh; my $cid = $change->id; # Delete tags. my $sth = $dbh->prepare( 'DELETE FROM tags WHERE change_id = ? RETURNING tag INTO ?', ); $sth->bind_param(1, $cid); $sth->bind_param_inout_array(2, my $del_tags = [], 0, { ora_type => DBD::Oracle::ORA_VARCHAR2() }); $sth->execute; # Retrieve dependencies. my $depcol = sprintf $self->_listagg_format, 'dependency'; my ($req, $conf) = $dbh->selectrow_array(qq{ SELECT ( SELECT $depcol FROM dependencies WHERE change_id = ? AND type = 'require' ), ( SELECT $depcol FROM dependencies WHERE change_id = ? AND type = 'conflict' ) FROM dual }, undef, $cid, $cid); # Delete the change record. $dbh->do( 'DELETE FROM changes where change_id = ?', undef, $change->id, ); # Log it. return $self->_log_event( revert => $change, $del_tags, $req, $conf ); } sub _ts2char($) { my $col = shift; return qq{to_char($col AT TIME ZONE 'UTC', 'YYYY:MM:DD:HH24:MI:SS')}; } sub _no_table_error { return $DBI::err && $DBI::err == 942; # ORA-00942: table or view does not exist } sub _script { my $self = shift; my $uri = $self->uri; my $conn = $uri->user // ''; if (my $pass = $uri->password) { $pass =~ s/"/""/g; $conn .= qq{/"$pass"}; } if (my $db = $uri->dbname) { $conn .= '@'; $db =~ s/"/""/g; if ($uri->host || $uri->_port) { $conn .= '//' . ($uri->host || ''); if (my $port = $uri->_port) { $conn .= ":$port"; } $conn .= qq{/"$db"}; } else { $conn .= qq{"$db"}; } } my %vars = $self->variables; return join "\n" => ( 'SET ECHO OFF NEWP 0 SPA 0 PAGES 0 FEED OFF HEAD OFF TRIMS ON TAB OFF', 'WHENEVER OSERROR EXIT 9;', 'WHENEVER SQLERROR EXIT SQL.SQLCODE;', (map {; (my $v = $vars{$_}) =~ s/"/""/g; qq{DEFINE $_="$v"} } sort keys %vars), "connect $conn", @_ ); } sub _run { my $self = shift; my $script = $self->_script(@_); open my $fh, '<:utf8_strict', \$script; return $self->sqitch->spool( $fh, $self->sqlplus ); } sub _capture { my $self = shift; my $conn = $self->_script(@_); my @out; require IPC::Run3; IPC::Run3::run3( [$self->sqlplus], \$conn, \@out, undef, { return_if_system_error => 1 }, ); if (my $err = $?) { # Ugh, send everything to STDERR. $self->sqitch->vent(@out); hurl io => __x( '{command} unexpectedly returned exit value {exitval}', command => $self->client, exitval => ($err >> 8), ); } return wantarray ? @out : \@out; } 1; __END__ =head1 Name App::Sqitch::Engine::oracle - Sqitch Oracle Engine =head1 Synopsis my $oracle = App::Sqitch::Engine->load( engine => 'oracle' ); =head1 Description App::Sqitch::Engine::oracle provides the Oracle storage engine for Sqitch. It supports Oracle 10g and higher. =head1 Interface =head2 Instance Methods =head3 C<initialized> $oracle->initialize unless $oracle->initialized; Returns true if the database has been initialized for Sqitch, and false if it has not. =head3 C<initialize> $oracle->initialize; Initializes a database for Sqitch by installing the Sqitch registry schema. =head3 C<sqlplus> Returns a list containing the the C<sqlplus> client and options to be passed to it. Used internally when executing scripts. =head1 Author David E. Wheeler <david@justatheory.com> =head1 License Copyright (c) 2012-2014 iovation Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. =cut
gitpan/App-Sqitch
lib/App/Sqitch/Engine/oracle.pm
Perl
mit
22,526
#!/usr/bin/perl use strict; use warnings; use Getopt::Std; my %opts; getopts('f:d:r:n:',\%opts); checkVars(); my $maxHitCount = $opts{'n'} || 1; open (IN,"head -n 200 $opts{'f'} | sort -k1,1 -k12,12nr |") or die "Can't open $opts{'f'}\n"; my %geneHash; while (my $line = <IN>) { chomp $line; my @lineSplit = split (/\t/,$line); my $query = $lineSplit[0]; #query gene my $hit = $lineSplit[1]; #hit gene my $bitScore = $lineSplit[11]; #hit gene #print "q=$q, h=$h\n"; if ($query ne $hit){ if(!($geneHash{$query}->{'lines'})) { $geneHash{$query}->{'best'} = $lineSplit[1]; push (@{$geneHash{$query}->{'lines'}},\@lineSplit); $geneHash{$query}->{'lastBitScore'} = $lineSplit[11]; $geneHash{$query}->{'count'} = 1; #print "first=$lineSplit[0]\n"; } else { if ($geneHash{$query}->{'count'} < $maxHitCount){ push (@{$geneHash{$query}->{'lines'}},\@lineSplit); if ($geneHash{$query}->{'lastBitScore'} != $lineSplit[11]){ $geneHash{$query}->{'count'} += 1; } $geneHash{$query}->{'lastBitScore'} = $lineSplit[11]; } } } } #print "starthashdump\n"; #print "\n\n"; #foreach my $k (keys %geneHash){ # print "$k\t"; # my @hits = @{$geneHash{$k}->{'lines'}}; # foreach (@hits){ # print join("\t",@{$_})."\n"; # } #} # if ($opts{'d'}){ open (DI,$opts{'d'}); my %geneHash; while (my $line = <DI>){ chomp $line; my ($gene,$diff) = split(/\t/,$line); $geneHash{$gene}->{'group'} = $diff; } close DI; } my (%printedHits,%recipGenes); print "\nReciprocal Best Blast Hits\n"; foreach my $thisGene (keys %geneHash){ my $otherGene = $geneHash{$thisGene}->{'lines'}->[0]->[1]; my $thisGroup = $geneHash{$thisGene}->{'group'}; my $otherGroup = $geneHash{$otherGene}->{'group'}; if ($thisGroup ne $otherGroup && !$printedHits{$thisGene} && !$printedHits{$otherGene}) { print "$thisGene\t$otherGene\n"; $printedHits{$thisGene}=1; $printedHits{$otherGene}=1; $recipGenes{$thisGene}=1; $recipGenes{$otherGene}=1; } } print "\n\nGenes whose best hit was in the reciprocal best list\n"; foreach my $gene (keys %geneHash){ if (!$printedHits{$gene}){ my $bestHit = $geneHash{$gene}->{'best'}; if ($recipGenes{$bestHit}){ print "$gene\t$bestHit\n"; $printedHits{$gene} = 1; } } } if ($opts{'g'}){ print "\n\nBest hits against any gene in group $opts{'g'}\n"; foreach my $gene (keys %geneHash){ if (!$printedHits{$gene}){ my $bestHit = $geneHash{$gene}->{'best'}; my $otherGroup = $geneHash{$bestHit}->{'group'}; if ($otherGroup eq $opts{'g'}){ print "$gene\t$bestHit\n"; $printedHits{$gene} = 1; $printedHits{$bestHit} = 1; } } } print "\n\nGenes in group $opts{'g'} absent in results of prior analyses\n"; my $counter = 0; foreach my $gene (keys %geneHash){ if (!$printedHits{$gene}){ my $group = $geneHash{$gene}->{'group'}; if ($group eq $opts{'g'}){ print "$gene\t".$geneHash{$gene}->{'best'}."\n"; $printedHits{$gene} = 1; $counter++; } } } print "none\n\n" if $counter == 0; } sub checkVars { if ( !$opts{'f'} ) { print "optsf=$opts{'f'}\n"; &usage(); } } sub usage() { print STDERR <<PRINTTHIS; Usage: recipBestBlast.pl -f <blast result> [-g & -d,-r] Prints Best Blast Hits -n Number of best hits to print. Default is 1. -d should be a file with the list of genes in one column and a differentiator in the second (tab delimited) column. For instance the numbers 1 and 2, or the text x and y. -g is a flag that tell the script "I also want the best hit against any gene in this group of genes". A group name is one of the differentiator values in the differentiator files. For instance, if I want to blast genome1 against genome2 and am interested in anything that hits against genome1, I would use -r genome1. -r List of reciprocal best blast hits will be printed separately PRINTTHIS exit; }
sanjuroj/bioscripts
probation/recipBestBlast.pl
Perl
mit
4,096
/* Part of SWI-Prolog Author: Jan Wielemaker E-mail: J.Wielemaker@vu.nl WWW: http://www.swi-prolog.org Copyright (c) 2006-2013, University of Amsterdam, VU University Amsterdam All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ :- module(pldoc_library, [ doc_load_library/0 ]). %! doc_load_library % % Load the SWI-Prolog library, so we can access all comments from % the library. doc_load_library :- set_prolog_flag(verbose_load, false), absolute_file_name(swi(library), Dir, [file_type(directory)]), load_all(Dir). load_all([]) :- !. load_all([H|T]) :- load_all(H), !, load_all(T). load_all(Dir0) :- atom(Dir0), expand_file_name(Dir0, [Dir1]), downcase_atom(Dir1, Dir), % Deal with Windows \+ ( blocked(Blocked), sub_atom(Dir, _, _, 0, Blocked) ), exists_directory(Dir), !, atom_concat(Dir, '/*', Pattern), expand_file_name(Pattern, Contents), load_all(Contents). load_all(File) :- atom(File), file_name_extension(_, pl, File), downcase_atom(File, LwrCase), \+ ( blocked(Blocked), sub_atom(LwrCase, _, _, 0, Blocked) ), !, use_module(File, []). load_all(Spec) :- compound(Spec), !, forall(absolute_file_name(Spec, Path, [ access(read), file_errors(fail) ]), load_all(Path)). load_all(_). %! blocked(+Path) is semidet. % % True if file or directory should not be loaded. Note that file % from the directory chr are already loaded by chr.pl. Similar % arguments apply for a few others. % % @bug We force lowercase to make it also work on Windows blocked('/theme/dark.pl'). blocked('/chr'). blocked('/clpq'). blocked('/clpr'). blocked('/pldoc'). blocked('/ciao'). blocked('/latex2html'). blocked('/checkselect.pl'). blocked('/tabling.pl'). % deprecated file blocked('/checklast.pl'). blocked('/clp/clp_distinct.pl'). % deprecated file %blocked('/jpl.pl'). % should be added blocked('/pldoc.pl'). blocked('/index.pl'). blocked('/ciao.pl'). % is an include-file. We must % find a more general solution here blocked('/commons.pl'). blocked('/swipl-lfr.pl'). blocked('/dcg_basics.pl'). % deprecated file blocked('/readline.pl'). % conflicts with editline.pl blocked('/win_menu.pl'). % Leads to warnings without a console.
TeamSPoon/logicmoo_workspace
docker/rootfs/usr/local/lib/swipl/library/pldoc/doc_library.pl
Perl
mit
3,932
#!/usr/bin/perl #use warnings; # rules: # "compiles" # "no-link" # "compile-error" # "exit=[0-9]+" # "noop" - ignore # # empty implies "exit=0" sub rules_parse; sub rules_assume; sub rules_exclude; sub usage() { die "Usage: $0 dir\n"; } my $dir = shift; die "no dir" unless $dir; usage() if @ARGV; chdir $dir or die; my $dir_nest = do{ my $slashes = ((my $tmp = $dir) =~ s#/##g); "../" x $slashes; }; print "# auto-generated by make_gen.pl\n"; %rules = rules_exclude(rules_gendeps(rules_assume(rules_parse()))); print "EXES = " . join(' ', map { my $t = $rules{$_}->{target}; $t . (defined($rules{$_}->{exit}) ? ' ' . $t . '_TEST' : '') } keys %rules) . "\n"; print "test: \${EXES}\n"; print "clean:\n"; print "\trm -f \${EXES}\n"; for(keys %rules){ print "$rules{$_}->{target}: $_\n"; print "\t"; my $fail_compile = $rules{$_}->{fail}; if($fail_compile){ print "! "; } my $args = $rules{$_}->{args} or ''; print "$dir_nest../../ucc -w $args -o \$@ \$<\n"; unless($fail_compile){ my $ec = $rules{$_}->{exit}; if(defined $ec){ print "$rules{$_}->{target}_TEST: $rules{$_}->{target}\n"; print "\t./\$<"; if($ec){ print "; [ \$\$? -eq $ec ]"; } print "\n"; } } } # ----------------------------------- sub lines { my($f, $must_exist) = @_; open((my $fh), '<', $f) or ($must_exist ? die "open $f: $!\n" : return ()); my @ret = <$fh>; close $fh; return map { chomp; $_ } @ret; } sub rule_new { my $mode = shift; if($mode eq 'compiles'){ return { }; }elsif($mode eq 'no-link'){ return { args => '-c' }; }elsif($mode eq 'compile-error'){ return { fail => 1 } }elsif($mode =~ /^exit=([0-9]+)$/){ return { 'exit' => $1 }; }elsif($mode eq 'noop'){ return { 'noop' => 1 }; }else{ die "bad rule \"$mode\"\n"; } } sub rules_parse { my %rules; for(lines('TestRules')){ /(.*) *: *(.*)/ or die "bad rule: $_\n"; my($ret, $fnames) = ($1, $2); my @fnames = split / *, */, $fnames; for(@fnames){ die "$_ doesn't exist\n" unless -f $_; $rules{$_} = rule_new($ret); } } return %rules; } sub rules_assume { my %rules = @_; for(glob '*.c'){ unless($rules{$_}){ # assume this file should succeed $rules{$_} = rule_new('exit=0'); } } return %rules; } sub rules_gendeps { my %rules = @_; for(keys %rules){ ($rules{$_}->{target} = $_) =~ s/\.c$//; } return %rules; } sub rules_exclude { my %rules = @_; for(keys %rules){ delete $rules{$_} if $rules{$_}->{noop}; } return %rules; }
8l/ucc-c-compiler
test/make_gen.pl
Perl
mit
2,509
#! /usr/bin/perl use strict; use warnings; # Author : Daniel.Amsel@ime.fraunhofer.de # Purpose: Create artificially sequenced microRNA reads # Output : multi-fastq file # group multifasta file of microRNAs into length clusters. # for each group, construct an artificial data set with 1000x coverage with ART # if a length is not represented, no reads are created # path to ART - adapt to your local system my $art = "/opt/art_bin_MountRainier/art_illumina"; my $mir_file = $ARGV[0]; # fasta file of microRNAs my $method = $ARGV[1]; # HS20 MSv1 my @mir_len = (17,18,19,20,21,22,23,24,25,26,27,28,29,30); if( $ARGV[0] eq '-h' || $ARGV[0] eq '-help'|| $ARGV[0] eq '' || $ARGV[0] eq '--h' || $ARGV[0] eq '--help') { help(); exit; } foreach(@mir_len){ my $round_len = $_; my $file_pattern = "$round_len-miRs.fa"; my $mir_id; open(OUT,">",$file_pattern); open(MIR,"<",$mir_file); while(<MIR>){ chomp; my $mir_line = $_; if(/^>/){ $mir_id = $_; } else{ my $mir_seq = $_; my $mir_len = length($mir_seq); next unless ($mir_len == $round_len); print OUT "$mir_id\n$mir_seq\n"; } } close(MIR); close(OUT); # run ART my $art_file = "$round_len-$method-ART"; my $run = "$art -c 1000 -ss $method -i $file_pattern -l $round_len -o $art_file"; system("$run"); } # merge & clean system("cat *ART.fq > $method-all.fq"); system("cat *ART.aln > $method-all.aln"); system("rm -rf *ART.*"); system("rm -rf *-miRs.fa"); my $aln_file = "$method-all.aln"; my $fq_file = "$method-all.fq"; my $fa_file = "$method-all.fa"; system("fastq_to_fasta -i $fq_file -o $fa_file"); my %aln_hash = %{&aln_parser($aln_file)}; my %fa_hash = %{&fasta_parser($fa_file)}; my %redundancy_hash; # save simulated reads into hash --> unify reads my $plus_reads = "$method-all-plusStrand.fa"; open(PLUS,">",$plus_reads); foreach(keys %fa_hash){ my $fa_key = $_; my $fa_seq = $fa_hash{$fa_key}; next unless (exists $aln_hash{$fa_key}); print PLUS "$fa_key\n$fa_seq\n"; # all plus strand reads if(not exists $redundancy_hash{$fa_seq}){ $redundancy_hash{$fa_seq}=$fa_key; } else{ next; } } close(PLUS); my $unique_reads = "$method-all-plusStrand-uniqueReads.fa"; open(OUT,">",$unique_reads); foreach(keys %redundancy_hash){ print OUT "$redundancy_hash{$_}\n$_\n"; } close(OUT); ######################################################################################## sub fasta_parser{ my $fp_file = $_[0]; my %fp_hash; my $fp_header; open(FP,"<",$fp_file); while(<FP>){ chomp; my $fp_line = $_; if($fp_line =~/^>/){ my @fp_split = split(" ",$fp_line); $fp_header = $fp_split[0]; $fp_hash{$fp_header} = ""; } else{ $fp_hash{$fp_header} .= $fp_line; } } close(FP); return(\%fp_hash); } sub aln_parser{ my $ap_file = $_[0]; my %ap_hash; open(AP,"<",$ap_file); while(<AP>){ chomp; next unless (/^>/); my $ap_line = $_; my @ap_split = split("\t",$ap_line); next unless ($ap_split[3] eq "+"); my $ap_key = $ap_split[1]; $ap_key = ">$ap_key"; $ap_hash{$ap_key}=""; } close(AP); return(\%ap_hash); } sub help{ print "###################################################################\n"; print "create_sequencing.pl <multi.fasta> <Method of ART>\n"; print "###################################################################\n"; print "Please note: You have to speicify the path of ART in the sourcecode\n"; print "###################################################################\n"; print "Contact: daniel.amsel\@ime.fraunhofer.de\n"; }
DanielAmsel/isomiR-Benchmark
create_sequencing.pl
Perl
mit
4,059
/* <module> % % PFC is a language extension for prolog. % % It adds a new type of module inheritance % % Dec 13, 2035 % Douglas Miles */ % was_module(header_sane,[]). :- include(test_header). :- begin_pfc. :- set_fileAssertMt(cycKB1). cycKB1:loves(sally,joe). :- mpred_test(clause_u(cycKB1:loves(_,_))). :- mpred_test(\+ clause_u(baseKB:loves(_,_))). :- pfc_test_feature(mt,\+ clause_u(header_sane:loves(_,_))). :- mpred_test(clause_u(loves(_,_))). :- mpred_test(call_u(cycKB1:loves(_,_))). :- pfc_test_feature(mt,\+ call_u(baseKB:loves(_,_))). :- pfc_test_feature(mt,listing(loves)). :- pfc_test_feature(mt,mpred_test(\+ call_u(header_sane:loves(_,_)))). :- pfc_test_feature(mt,mpred_test(call_u(loves(_,_)))).
TeamSPoon/logicmoo_workspace
packs_sys/pfc/t/sanity_base/mt_01c_0b.pl
Perl
mit
737
package Adylay::Controller::Slack; use Mojo::Base 'Mojolicious::Controller'; use Mojo::UserAgent; sub notify { my $self = shift; my $model = $self->stash('model'); my $selection = $self->flash('selection'); my %response = $model->sendMessage("Switched profile to: $selection"); if (!$response{success}) { $self->flash(error => $response{message}); } $self->flash(selection => $selection); $self->redirect_to('/config'); } sub message { my $self = shift; my $model = $self->stash('model'); my $message = $self->req->json->{message}; $self->app->log->info($message); my %response = $model->sendMessage($message); if ($response{success}) { $self->res->code(201); $self->render(json => { sent => $message }); } else { $self->res->code(500); $self->render(json => { error => $response{message} }); } } sub updateWebhook { my $self = shift; my $model = $self->stash('model'); my $webhook = $self->req->body_params->param('webhook'); $self->app->log->info("Updating slack webhook to: $webhook"); my $successful = $model->updateWebhook($webhook); if ($successful) { $self->redirect_to('/config'); } else { $self->flash(error => 'Failed to update config.'); $self->redirect_to('/config'); } } 1;
lackerman/freenas-server-utils
adylay/lib/Adylay/Controller/Slack.pm
Perl
mit
1,276
:- use_module(library(logicmoo_common)). :- multifile(prolog_trace_interception/4). :- dynamic(prolog_trace_interception/4). :- multifile(user:prolog_trace_interception/4). :- dynamic(user:prolog_trace_interception/4). :- use_module(library(plunit)). :- use_module(library(test_cover)). :- use_module(library(listing)). :- set_prolog_flag(must_saftey,3). :- set_prolog_flag(must_debug,0). :- set_prolog_flag(must_speed,0). :- set_prolog_flag(must_type,keep_going). :- listing(prolog_trace_interception/4). :- listing(user:prolog_trace_interception/4). :- prolog_load_context(source,Loader), ( \+ prolog_load_context(file,Loader) -> assert(t_l:santiy_tests_includer(Loader)) ; true). :- current_prolog_flag(toplevel_goal,default) -> set_prolog_flag(toplevel_goal,user:sanity_test_default); true. user:sanity_test_default:- halt(0). term_expansion(EOF,S,Out,S):- nonvar(S), EOF == end_of_file, prolog_load_context(file,Loader), retract(t_l:santiy_tests_includer(Loader)), Out = [(:- set_test_options([silent(false)])), (:- set_test_options([load(never)])), (:- use_module(library(test_wizard))), (:- set_prolog_flag(log_query_file, '/tmp/Queries.pl')), % (:- run_tests(sanity_tests)), (:- show_coverage(run_tests)), end_of_file],!. :- Unit = sanity_tests, prolog_load_context(source,File), plunit:make_unit_module(Unit, Name), plunit:begin_tests(Unit, Name, File:3, []).
TeamSPoon/logicmoo_workspace
packs_sys/logicmoo_ec/test/sanity_tests.pl
Perl
mit
1,418
# # Copyright 2021 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for # service performance. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # package hardware::ups::hp::snmp::mode::inputlines; use base qw(centreon::plugins::templates::counter); use strict; use warnings; sub set_counters { my ($self, %options) = @_; $self->{maps_counters_type} = [ { name => 'global', type => 0, skipped_code => { -10 => 1 } }, { name => 'iline', type => 1, cb_prefix_output => 'prefix_iline_output', message_multiple => 'All input lines are ok', skipped_code => { -10 => 1 } }, ]; $self->{maps_counters}->{global} = [ { label => 'frequence', nlabel => 'lines.input.frequence.hertz', set => { key_values => [ { name => 'upsInputFrequency', no_value => 0 } ], output_template => 'frequence: %.2f Hz', perfdatas => [ { value => 'upsInputFrequency', template => '%.2f', unit => 'Hz' }, ], } }, ]; $self->{maps_counters}->{iline} = [ { label => 'current', nlabel => 'line.input.current.ampere', set => { key_values => [ { name => 'upsInputCurrent', no_value => 0 } ], output_template => 'current: %.2f A', perfdatas => [ { value => 'upsInputCurrent', template => '%.2f', min => 0, unit => 'A', label_extra_instance => 1 }, ], } }, { label => 'voltage', nlabel => 'line.input.voltage.volt', set => { key_values => [ { name => 'upsInputVoltage', no_value => 0 } ], output_template => 'voltage: %s V', perfdatas => [ { value => 'upsInputVoltage', template => '%s', unit => 'V', label_extra_instance => 1 }, ], } }, { label => 'power', nlabel => 'line.input.power.watt', set => { key_values => [ { name => 'upsInputWatts', no_value => 0 } ], output_template => 'power: %s W', perfdatas => [ { value => 'upsInputWatts', template => '%s', unit => 'W', label_extra_instance => 1 }, ], } }, ]; } sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1); bless $self, $class; $options{options}->add_options(arguments => { }); return $self; } sub prefix_iline_output { my ($self, %options) = @_; return "Input Line '" . $options{instance_value}->{display} . "' "; } my $mapping = { upsInputVoltage => { oid => '.1.3.6.1.4.1.232.165.3.3.4.1.2' }, # in V upsInputCurrent => { oid => '.1.3.6.1.4.1.232.165.3.3.4.1.3' }, # in A upsInputWatts => { oid => '.1.3.6.1.4.1.232.165.3.3.4.1.4' }, # in W }; my $mapping2 = { upsInputFrequency => { oid => '.1.3.6.1.4.1.232.165.3.3.1' }, # in dHZ }; my $mapping3 = { upsConfigLowOutputVoltageLimit => { oid => '.1.3.6.1.4.1.232.165.3.9.6' }, upsConfigHighOutputVoltageLimit => { oid => '.1.3.6.1.4.1.232.165.3.9.7' }, }; my $oid_upsInputEntry = '.1.3.6.1.4.1.232.165.3.3.4.1'; my $oid_upsConfig = '.1.3.6.1.4.1.232.165.3.9'; sub manage_selection { my ($self, %options) = @_; my $snmp_result = $options{snmp}->get_multiple_table( oids => [ { oid => $mapping2->{upsInputFrequency}->{oid} }, { oid => $oid_upsInputEntry }, { oid => $oid_upsConfig, start => $mapping3->{upsConfigLowOutputVoltageLimit}->{oid}, end => $mapping3->{upsConfigHighOutputVoltageLimit}->{oid} }, ], return_type => 1, nothing_quit => 1 ); $self->{iline} = {}; foreach my $oid (keys %{$snmp_result}) { next if ($oid !~ /^$oid_upsInputEntry\.\d+\.(.*)$/); my $instance = $1; next if (defined($self->{iline}->{$instance})); my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance); $result->{upsInputCurrent} = 0 if (defined($result->{upsInputCurrent}) && $result->{upsInputCurrent} eq ''); $self->{iline}->{$instance} = { display => $instance, %$result }; } if (scalar(keys %{$self->{iline}}) <= 0) { $self->{output}->add_option_msg(short_msg => "No input lines found."); $self->{output}->option_exit(); } my $result = $options{snmp}->map_instance(mapping => $mapping2, results => $snmp_result, instance => '0'); $result->{upsInputFrequency} = defined($result->{upsInputFrequency}) ? ($result->{upsInputFrequency} * 0.1) : 0; $self->{global} = { %$result }; $result = $options{snmp}->map_instance(mapping => $mapping3, results => $snmp_result, instance => '0'); if ((!defined($self->{option_results}->{'warning-instance-line-input-voltage-volt'}) || $self->{option_results}->{'warning-instance-line-input-voltage-volt'} eq '') && (!defined($self->{option_results}->{'critical-instance-line-input-voltage-volt'}) || $self->{option_results}->{'critical-instance-line-input-voltage-volt'} eq '') ) { my $th = ''; $th .= $result->{upsConfigHighOutputVoltageLimit} if (defined($result->{upsConfigHighOutputVoltageLimit}) && $result->{upsConfigHighOutputVoltageLimit} =~ /\d+/); $th = $result->{upsConfigLowOutputVoltageLimit} . ':' . $th if (defined($result->{upsConfigLowOutputVoltageLimit}) && $result->{upsConfigLowOutputVoltageLimit} =~ /\d+/); $self->{perfdata}->threshold_validate(label => 'critical-instance-line-input-voltage-volt', value => $th) if ($th ne ''); } } 1; __END__ =head1 MODE Check input lines metrics. =over 8 =item B<--warning-*> B<--critical-*> Thresholds. Can be: 'frequence', 'voltage', 'current', 'power'. =back =cut
Tpo76/centreon-plugins
hardware/ups/hp/snmp/mode/inputlines.pm
Perl
apache-2.0
6,581
package Bio::DB::HTS::Kseq::Record; =head1 LICENSE Copyright [2015-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. =head1 NAME Bio::DB::HTS::Kseq::Record -- Entry from a Kseq iterator =head1 SYNOPSIS while(my $r = $iter->next_seq()) { say $r->name; say $r->desc; say $r->seq; say $r->qual; } =head2 METHODS =over 8 =item C<name> The name of a FASTA/Q record =item C<desc> The description from a FASTA/Q record =item C<seq> The sequence from a FASTA/Q record =item C<qual> The quality string from a FASTA/Q record =back =cut use strict; use warnings; $Bio::DB::HTS::Kseq::Record::VERSION = '3.01'; sub name { return $_[0]->{name}; } sub desc { return $_[0]->{desc}; } sub seq { return $_[0]->{seq}; } sub qual { return $_[0]->{qual}; } 1;
Ensembl/Bio-HTS
lib/Bio/DB/HTS/Kseq/Record.pm
Perl
apache-2.0
1,314
#!/usr/bin/env perl =head1 LICENSE Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2020] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =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 use strict; use warnings; use Bio::EnsEMBL::Registry; my $registry = 'Bio::EnsEMBL::Registry'; $registry->load_registry_from_db( -host => 'ensembldb.ensembl.org', -user => 'anonymous' ); my $rfa = $registry->get_adaptor('Human', 'funcgen', 'regulatoryfeature'); #3. Motif Features #Motif features represent putative binding sites based on alignments of PWMs from JASPAR. MotifFeatures are always associated to AnnotatedFeatures representing Transcription Factor (TF) Binding. More information about how we integrate these into the regulatory build process can be found here. #Get the 'motif' regulatory attributes associated to the Human Regulatory Feature 'ENSR00001227187'. Print their properties. #Hint: use 'motif' as a parameter for regulatory_attributes. #Print the properties of the annotated features associated to the motif feature. my $rf = $rfa->fetch_by_stable_id('ENSR00001227187'); foreach my $mf ( @{$rf->regulatory_attributes('motif')}){ print "Display Label: ".$mf->display_label.";"; print " Position: ".$mf->seq_region_name.":".$mf->start."-".$mf->end.";"; print " Score: ".$mf->score.";"; print "\n"; # Print the properties of the annotated features associated to each motif feature. # Print the name of the feature set associated to these annotated features. foreach my $af (@{$mf->associated_annotated_features()}){ print "\tAssociated Feature Set: ".$af->feature_set->name."\n"; print_feature($af); } }; sub print_feature { my $af = shift; print "\tCell: ".(defined($af->cell_type) ? $af->cell_type->name : "Undetermined").";"; print " Feature Type: ".$af->feature_type->name.";"; print " Position: ".$af->seq_region_name.":".$af->start."-".$af->end.";"; print " Score: ".$af->score.";"; print " Summit: ".$af->summit.";"; print "\n"; } __END__ >perl features_3.pl Display Label: CTCF:MA0139.1; Position: 6:132128805-132128823; Score: 0.863; Associated Feature Set: HUVEC_CTCF_ENCODE_Uw_SWEMBL_R015 Cell: HUVEC; Feature Type: CTCF; Position: 6:132128612-132128993; Score: 22.126581; Summit: 132128815; Associated Feature Set: H1ESC_CTCF_ENCODE_Uta_SWEMBL_R015 Cell: H1ESC; Feature Type: CTCF; Position: 6:132128668-132129004; Score: 50.586062; Summit: 132128831; Associated Feature Set: HepG2_CTCF_ENCODE_Uta_SWEmbl_R015_D150 Cell: HepG2; Feature Type: CTCF; Position: 6:132128676-132128987; Score: 27.973154; Summit: 132128824; Associated Feature Set: HepG2_CTCF_ENCODE_Uw_SWEmbl_R015_D150 Cell: HepG2; Feature Type: CTCF; Position: 6:132128678-132129034; Score: 82.49168; Summit: 132128828; Display Label: Nrsf:MA0138.1; Position: 6:132129499-132129517; Score: 0.805; Associated Feature Set: H1ESC_Nrsf_ENCODE_Hudsonalpha_SWEMBL_R015 Cell: H1ESC; Feature Type: Nrsf; Position: 6:132129342-132129713; Score: 103.256328; Summit: 132129519;
Ensembl/ensembl-funcgen
scripts/examples/solutions/features_2.pl
Perl
apache-2.0
3,867
package Zpravostroj::Categorizer::TfIdfThemes; #Zatřídí do kategorií, odpovídajícím tf-idf tématům use strict; use warnings; use Moose; with 'Zpravostroj::Categorizer::Categorizer'; #Kolik vzít témat has 'count'=> ( is=>'ro', isa=>'Int', required=>1 ); #Odignoruje pole, nastaví count sub _create { shift; my $array = shift; my $c = shift; return {count=>$c}; } #Pro každý článek vezme count nejdůležitějších TF-IDF témat sub categorize { my $self = shift; my @articles = @_; my @tagged; for my $article (@articles) { my @t = sort {$b->score <=> $a->score} @{$article->tf_idf_themes}; if (scalar @t > $self->count) { @t=@t[0..$self->count-1]; } push (@tagged, {article=>$article, tags=>[map {$_->{lemma}} @t]}); } return @tagged; } 1;
runn1ng/zpravostroj2
Zpravostroj/Categorizer/TfIdfThemes.pm
Perl
apache-2.0
802
package API::StaticDnsEntry; # # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # # use UI::Utils; use Mojo::Base 'Mojolicious::Controller'; use Data::Dumper; sub index { my $self = shift; my @data; my $orderby = $self->param('orderby') || "deliveryservice"; my $rs_data = $self->db->resultset("Staticdnsentry")->search( undef, { order_by => 'me.' . $orderby } ); while ( my $row = $rs_data->next ) { push( @data, { "deliveryservice" => $row->deliveryservice->xml_id, "host" => $row->host, "ttl" => $row->ttl, "address" => $row->address, "type" => $row->type->name, "cachegroup" => $row->cachegroup->name, } ); } $self->success( \@data ); } 1;
knutsel/traffic_control-1
traffic_ops/app/lib/API/StaticDnsEntry.pm
Perl
apache-2.0
1,235
# # Ensembl module for Bio::EnsEMBL::DBSQL::Funcgen::MirnaTargetFeatureAdaptor # =head1 LICENSE Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2020] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =head1 CONTACT Please email comments or questions to the public Ensembl developers list at <http://lists.ensembl.org/mailman/listinfo/dev>. Questions may also be sent to the Ensembl help desk at <http://www.ensembl.org/Help/Contact>. =head1 NAME Bio::EnsEMBL::DBSQL::Funcgen::MirnaTargetFeatureAdaptor - A database adaptor for fetching and storing MirnaTargetFeature objects. =head1 SYNOPSIS my $afa = $db->get_ExternalFeatureAdaptor(); my $features = $afa->fetch_all_by_Slice($slice); =head1 DESCRIPTION The MirnaTargetFeatureAdaptor is a database adaptor for storing and retrieving MirnaTargetFeature objects. =cut package Bio::EnsEMBL::Funcgen::DBSQL::MirnaTargetFeatureAdaptor; use strict; use warnings; use Bio::EnsEMBL::Utils::Exception qw( throw warning ); use Bio::EnsEMBL::Funcgen::MirnaTargetFeature; use Bio::EnsEMBL::Funcgen::DBSQL::SetFeatureAdaptor; #DBI sql_types import use base qw( Bio::EnsEMBL::Funcgen::DBSQL::BaseFeatureAdaptor ); =head2 fetch_all_by_gene_stable_id Arg [1] : String $gene_stable_id - The stable id of the linked gene Example : my $mirna_target_features = mtf_adaptor->fetch_all_by_gene_stable_id('ENSG00000000001'); Description: Retrieves a list of mirna target features that are linked to the given Gene. Returntype : arrayref of Bio::EnsEMBL::Funcgen::MirnaTargetFeature objects Exceptions : none Caller : general Status : Stable =cut sub fetch_all_by_gene_stable_id { my $self = shift; my $gene_stable_id = shift; throw('Must specify a gene_stable_id') if !defined $gene_stable_id; my $constraint = "mitaf.gene_stable_id = ?"; $self->bind_param_generic_fetch($gene_stable_id, SQL_VARCHAR); my $mirna_target_features = $self->generic_fetch($constraint); return $mirna_target_features; } =head2 _true_tables Args : None Example : None Description: Returns the names and aliases of the tables to use for queries. Returntype : List of listrefs of strings Exceptions : None Caller : Internal Status : At Risk =cut sub _true_tables { return ([ 'mirna_target_feature', 'mitaf' ]); } =head2 _columns Args : None Example : None Description: PROTECTED implementation of superclass abstract method. Returns a list of columns to use for queries. Returntype : List of strings Exceptions : None Caller : Internal Status : At Risk =cut sub _columns { return qw( mitaf.mirna_target_feature_id mitaf.seq_region_id mitaf.seq_region_start mitaf.seq_region_end mitaf.seq_region_strand mitaf.display_label mitaf.feature_type_id mitaf.analysis_id mitaf.gene_stable_id mitaf.accession mitaf.evidence mitaf.method mitaf.supporting_information ); } =head2 _objs_from_sth Arg [1] : DBI statement handle object Example : None Description: PROTECTED implementation of superclass abstract method. Creates MirnaTargetFeature objects from an executed DBI statement handle. Returntype : Listref of Bio::EnsEMBL::MirnaTargetFeature objects Exceptions : None Caller : Internal Status : At Risk =cut sub _objs_from_sth { my ($self, $sth, $mapper) = @_; # Remap the feature coordinates to another coord system if a mapper was provided return [] if ($mapper); # For EFG this has to use a dest_slice from core/dnaDB whether specified or not. # So if it not defined then we need to generate one derived from the species_name and # schema_build of the feature we're retrieving. my (@features, %anal_hash, %slice_hash, %sr_name_hash, %ftype_hash); my $slice_adaptor ||= $self->db->dnadb->get_SliceAdaptor; my $anal_adaptor = $self->db->get_AnalysisAdaptor(); my $ftype_adaptor = $self->db->get_FeatureTypeAdaptor(); my ( $external_feature_id, $seq_region_id, $seq_region_start, $seq_region_end, $seq_region_strand, $anal_id, $gene_stable_id, $display_label, $ftype_id, $accession, $evidence, $method, $supporting_information, ); $sth->bind_columns( \$external_feature_id, \$seq_region_id, \$seq_region_start, \$seq_region_end, \$seq_region_strand, \$display_label, \$ftype_id, \$anal_id, \$gene_stable_id, \$accession, \$evidence, \$method, \$supporting_information, ); FEATURE: while ( $sth->fetch() ) { #Get the FeatureSet/Type objects $anal_hash{$anal_id} = $anal_adaptor->fetch_by_dbID($anal_id) if(! exists $anal_hash{$anal_id}); $ftype_hash{$ftype_id} = $ftype_adaptor->fetch_by_dbID($ftype_id) if(! exists $ftype_hash{$ftype_id}); $slice_hash{$seq_region_id} = $slice_adaptor->fetch_by_seq_region_id($seq_region_id); # Get the slice object push @features, Bio::EnsEMBL::Funcgen::MirnaTargetFeature->new_fast ({ 'start' => $seq_region_start, 'end' => $seq_region_end, 'strand' => $seq_region_strand, 'slice' => $slice_hash{$seq_region_id}, 'analysis' => $anal_hash{$anal_id}, 'gene_stable_id' => $gene_stable_id, 'adaptor' => $self, 'dbID' => $external_feature_id, 'display_label' => $display_label, 'feature_type' => $ftype_hash{$ftype_id}, 'accession' => $accession, 'evidence' => $evidence, 'method' => $method, 'supporting_information' => $supporting_information, }); } return \@features; } =head2 store Args : List of Bio::EnsEMBL::Funcgen::MirnaTargetFeature objects Example : $ofa->store(@features); Description: Stores given MirnaTargetFeature objects in the database. Should only be called once per feature because no checks are made for duplicates. Sets dbID and adaptor on the objects that it stores. Returntype : Arrayref of stored ExternalFeatures Exceptions : Throws if a list of MirnaTargetFeature objects is not provided or if the Analysis, CellType and FeatureType objects are not attached or stored Caller : General Status : At Risk =cut sub store{ my ($self, @mrna_fs) = @_; if (scalar(@mrna_fs) == 0) { throw('Must call store with a list of MirnaTargetFeature objects'); } my $sth = $self->prepare(" INSERT INTO mirna_target_feature ( seq_region_id, seq_region_start, seq_region_end, seq_region_strand, display_label, feature_type_id, analysis_id, gene_stable_id, accession, evidence, method, supporting_information ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) "); my $db = $self->db(); FEATURE: foreach my $mrna_f (@mrna_fs) { if(! (ref($mrna_f) && $mrna_f->isa('Bio::EnsEMBL::Funcgen::MirnaTargetFeature') )) { throw('Feature must be an MirnaTargetFeature object'); } if ( $mrna_f->is_stored($db) ) { #does not accomodate adding Feature to >1 feature_set warning('MirnaTargetFeature [' . $mrna_f->dbID() . '] is already stored in the database'); next FEATURE; } my $seq_region_id; ($mrna_f, $seq_region_id) = $self->_pre_store($mrna_f); $sth->bind_param(1, $seq_region_id, SQL_INTEGER); $sth->bind_param(2, $mrna_f->start, SQL_INTEGER); $sth->bind_param(3, $mrna_f->end, SQL_INTEGER); $sth->bind_param(4, $mrna_f->strand, SQL_TINYINT); $sth->bind_param(5, $mrna_f->display_label, SQL_VARCHAR); $sth->bind_param(6, $mrna_f->get_FeatureType->dbID, SQL_INTEGER); $sth->bind_param(7, $mrna_f->analysis->dbID, SQL_INTEGER); $sth->bind_param(8, $mrna_f->gene_stable_id, SQL_VARCHAR); $sth->bind_param(9, $mrna_f->accession, SQL_VARCHAR); $sth->bind_param(10, $mrna_f->evidence, SQL_VARCHAR); $sth->bind_param(11, $mrna_f->method, SQL_VARCHAR); $sth->bind_param(12, $mrna_f->supporting_information, SQL_VARCHAR); $sth->execute(); $mrna_f->dbID( $self->last_insert_id ); $mrna_f->adaptor($self); } return \@mrna_fs; } sub fetch_all_by_accessions{ my ($self, $accessions) = @_; my $params = {constraints => {accession=>$accessions}}; return $self->generic_fetch($self->compose_constraint_query($params)); } sub _constrain_accession { my ($self, $accessions) = @_; my $constraint = 'mitaf.accession IN(' . join (', ', map { qq!"$_"! } @$accessions).')'; return $constraint; } 1;
Ensembl/ensembl-funcgen
modules/Bio/EnsEMBL/Funcgen/DBSQL/MirnaTargetFeatureAdaptor.pm
Perl
apache-2.0
9,516
package Paws::CloudFront::Restrictions; use Moose; has GeoRestriction => (is => 'ro', isa => 'Paws::CloudFront::GeoRestriction', required => 1); 1; ### main pod documentation begin ### =head1 NAME Paws::CloudFront::Restrictions =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::CloudFront::Restrictions object: $service_obj->Method(Att1 => { GeoRestriction => $value, ..., GeoRestriction => $value }); =head3 Results returned from an API call Use accessors for each attribute. If Att1 is expected to be an Paws::CloudFront::Restrictions object: $result = $service_obj->Method(...); $result->Att1->GeoRestriction =head1 DESCRIPTION A complex type that identifies ways in which you want to restrict distribution of your content. =head1 ATTRIBUTES =head2 B<REQUIRED> GeoRestriction => L<Paws::CloudFront::GeoRestriction> =head1 SEE ALSO This class forms part of L<Paws>, describing an object used in L<Paws::CloudFront> =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
ioanrogers/aws-sdk-perl
auto-lib/Paws/CloudFront/Restrictions.pm
Perl
apache-2.0
1,422
=head1 LICENSE Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute Copyright [2016-2021] EMBL-European Bioinformatics Institute Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =cut package EnsEMBL::Web::Data::Bio::ProbeFeature; ### NAME: EnsEMBL::Web::Data::Bio::ProbeFeature ### Base class - wrapper around a Bio::EnsEMBL::ProbeFeature API object ### STATUS: Under Development ### Replacement for EnsEMBL::Web::Object::ProbeFeature ### DESCRIPTION: ### This module provides additional data-handling ### capabilities on top of those provided by the API use strict; use warnings; no warnings qw(uninitialized); use base qw(EnsEMBL::Web::Data::Bio); sub convert_to_drawing_parameters { ### Converts a set of API objects into simple parameters ### for use by drawing code and HTML components my $self = shift; my $data = $self->data_objects; my $results = []; my %seen; foreach my $probe_feature (@$data) { if (ref($probe_feature) =~ /UnmappedObject/) { my $unmapped = $self->unmapped_object($probe_feature); push(@$results, $unmapped); } else { my $name = join ' ', map { /^(.*):(.*):\2/? "$1:$2" : $_ } sort @{$probe_feature->probe->get_all_probenames()}; my $features = $probe_feature->probe->get_all_ProbeFeatures(); my $f = $features->[0]; my $loc = $f->seq_region_name.':'.$f->start.'-'.$f->end; next if $seen{$loc}; $seen{$loc} = 1; push @$results, { 'region' => $f->seq_region_name, 'start' => $f->start, 'end' => $f->end, 'strand' => $f->strand, 'length' => $f->end-$f->start+1, 'label' => $name, 'name' => $name, 'sequence' => $f->probe->sequence, 'mismatches' => $f->mismatchcount, }; } } my $extra_columns = [ {'key' => 'mismatches', 'title' => 'Mismatches'}, ]; return [$results, $extra_columns]; } 1;
Ensembl/ensembl-webcode
modules/EnsEMBL/Web/Data/Bio/ProbeFeature.pm
Perl
apache-2.0
2,509
#!@PROG_PERL@ # # Copyright (C) 2013 Roger March # my $dir = $ARGV[0]; # # Put the value in the ::main scope. # print "//\n//\t\Change.C\n//\n"; print "#include <Rev.H>\n//\n"; # print "const char *@PACKAGE@_release_change() { return (\"none\"); }\n//\n"; # exit(0);
nicko7i/vcnc
vcnc-server/version/rev/make_norev.TMPL.pl
Perl
apache-2.0
268
# 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::V8::Services::AdGroupAdService::AdGroupAdOperation; use strict; use warnings; use base qw(Google::Ads::GoogleAds::BaseEntity); use Google::Ads::GoogleAds::Utils::GoogleAdsHelper; sub new { my ($class, $args) = @_; my $self = { create => $args->{create}, policyValidationParameter => $args->{policyValidationParameter}, remove => $args->{remove}, update => $args->{update}, updateMask => $args->{updateMask}}; # Delete the unassigned fields in this object for a more concise JSON payload remove_unassigned_fields($self, $args); bless $self, $class; return $self; } 1;
googleads/google-ads-perl
lib/Google/Ads/GoogleAds/V8/Services/AdGroupAdService/AdGroupAdOperation.pm
Perl
apache-2.0
1,285
#!/usr/bin/env perl # Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute # Copyright [2016-2022] 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 is an intentionally broken PipeConfig for testing purposes. # It has a flow_into that goes to an analysis that is not defined # in the pipeline. package TestPipeConfig::AnyFailureBranch_conf; use strict; use warnings; use base ('Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf'); sub pipeline_analyses { my ($self) = @_; return [ { -logic_name => 'first', -module => 'Bio::EnsEMBL::Hive::RunnableDB::Dummy', -input_ids => [ {} ], -meadow_type => 'LOCAL', -flow_into => { # NOTE: this PipeConfig also tests that branch names can be used, e.g. MAIN instead of 1 'MAIN' => [ 'second' ], 'ANYFAILURE' => [ 'third' ], } }, { -logic_name => 'second', -module => 'Bio::EnsEMBL::Hive::RunnableDB::Dummy', -meadow_type => 'LOCAL', }, { -logic_name => 'third', -module => 'Bio::EnsEMBL::Hive::RunnableDB::Dummy', -meadow_type => 'LOCAL', } ]; } 1;
Ensembl/ensembl-hive
t/10.pipeconfig/TestPipeConfig/AnyFailureBranch_conf.pm
Perl
apache-2.0
1,799
#!/usr/bin/perl -w # Solgenomics@BTI # Surya Saha DATE?? # Purpose: unless (@ARGV == ??){ print "USAGE: $0 <??> \n"; exit; } use strict; use warnings; use lib '/home/surya/bin/modules'; use SS; my ($ifname,$rec,$i); $ifname=$ARGV[0]; unless(open(IN,$ifname)){print "not able to open ".$ifname."\n\n";exit;} unless(open(OUT,">$ifname.results")){print "not able to open ".$ifname."results\n\n";exit;} close (IN); close (OUT);
suryasaha/Templates
cmdline.pl
Perl
bsd-2-clause
435
#!%PERL% # Copyright (c) vhffs project and its contributors # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. #2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in # the documentation and/or other materials provided with the # distribution. #3. Neither the name of vhffs nor the names of its contributors # may be used to endorse or promote products derived from this # software without specific prior written permission. # #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS #"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS #FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE #COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, #INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, #BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; #LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER #CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. use strict; use utf8; use Cwd; use File::Path; use File::Basename; use Vhffs::Constants; use Vhffs::Functions; use Vhffs::Robots; use Vhffs::Services::Svn; package Vhffs::Robots::Svn; sub create { my $svn = shift; return undef unless defined $svn and $svn->get_status == Vhffs::Constants::WAITING_FOR_CREATION; my $vhffs = $svn->get_vhffs; my $dir = $svn->get_dir; if( -e $dir ) { $svn->set_status( Vhffs::Constants::CREATION_ERROR ); $svn->commit(); Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while creating svn repository '.$svn->get_reponame.' to the filesystem' ); return undef; } File::Path::make_path( $dir, { error => \my $errors }); if(@$errors) { $svn->set_status( Vhffs::Constants::CREATION_ERROR ); $svn->commit; Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while creating svn repository '.$svn->get_reponame.' to the filesystem: '.join(', ', @$errors) ); return undef; } my $childpid = open( my $output, '-|', 'svnadmin', 'create', '--fs-type', 'fsfs', $dir ); if($childpid) { # read process output then discard while(<$output>) {} # wait for the child to finish waitpid( $childpid, 0 ); # we don't care whether svn succedded, we are going to check that ourself } unless( -f $dir.'/format' ) { $svn->set_status( Vhffs::Constants::CREATION_ERROR ); $svn->commit; Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while creating svn repository '.$svn->get_reponame.' to the filesystem' ); return undef; } Vhffs::Robots::chmod_recur( $dir, 0664, 02775 ); Vhffs::Robots::chown_recur( $dir, $svn->get_owner_uid, $svn->get_owner_gid ); # './hooks' directory must be owned by root to prevent abuse of servers Vhffs::Robots::chmod_recur( $dir.'/hooks', 0644, 0755 ); Vhffs::Robots::chown_recur( $dir.'/hooks', 0, 0 ); Vhffs::Robots::vhffs_log( $vhffs, 'Created svn repository '.$svn->get_reponame ); return undef unless modify( $svn ); $svn->send_created_mail; return 1; } sub delete { my $svn = shift; return undef unless defined $svn and $svn->get_status == Vhffs::Constants::WAITING_FOR_DELETION; my $vhffs = $svn->get_vhffs; my $dir = $svn->get_dir; Vhffs::Robots::archive_targz( $svn, $dir ); File::Path::remove_tree( $dir, { error => \my $errors }); my $groupdir = File::Basename::dirname($dir); rmdir($groupdir); if(@$errors) { $svn->set_status( Vhffs::Constants::DELETION_ERROR ); $svn->commit; Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while removing svn repository '.$svn->get_reponame.' from the filesystem: '.join(', ', @$errors) ); return undef; } if( $svn->delete ) { Vhffs::Robots::vhffs_log( $vhffs, 'Deleted svn repository '.$svn->get_reponame ); } else { $svn->set_status( Vhffs::Constants::DELETION_ERROR ); $svn->commit; Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while deleting svn repository '.$svn->get_reponame.' object' ); return undef; } viewvc_conf( $vhffs ); websvn_conf( $vhffs ); return 1; } sub modify { my $svn = shift; return undef unless defined $svn and ( $svn->get_status == Vhffs::Constants::WAITING_FOR_MODIFICATION or $svn->get_status == Vhffs::Constants::WAITING_FOR_CREATION ); my $vhffs = $svn->get_vhffs; my $dir = $svn->get_dir; my $confpath = $dir.'/conf/svnserve.conf'; # Read configuration file open( my $conffile, '<', $confpath ) or Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while modifying svn repository, cannot open '.$confpath ); unless( defined $conffile ) { $svn->set_status( Vhffs::Constants::MODIFICATION_ERROR ); $svn->commit; return undef; } my @lines; while( <$conffile> ) { push( @lines, $_ ); } close( $conffile ); # Write configuration file open( $conffile, '>', $confpath ) or Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while modifying svn repository, cannot open '.$confpath ); unless( defined $conffile ) { $svn->set_status( Vhffs::Constants::MODIFICATION_ERROR ); $svn->commit; return undef; } foreach( @lines ) { if( $_ =~ /.*anon\-access.*/ ) { if( $svn->is_public == 1 ) { $_ = 'anon-access = read'."\n"; } else{ $_ = 'anon-access = none'."\n"; } } if( $_ =~ /.*\[general\].*/ ) { $_ = '[general]'."\n"; } print $conffile $_; } close( $conffile ); chmod 0664, $conffile; if( $svn->is_public ) { chmod 02775, $dir; Vhffs::Robots::vhffs_log( $vhffs, 'Svn repository '.$svn->get_reponame.' is now public' ); $svn->add_history( 'Is now public'); } else { chmod 02770, $dir; Vhffs::Robots::vhffs_log( $vhffs, 'Svn repository '.$svn->get_reponame.' is now private' ); $svn->add_history( 'Is now private'); } # Commit mail my $svnconf = $svn->get_config; my $mailfrom = $svnconf->{'notify_from'}; my $mailto = $svn->{ml_name}; if( defined $mailfrom and defined $mailto ) { # read template file open( my $postcommit, '<', '%VHFFS_BOTS_DIR%/misc/svn_post-commit.pl' ) or Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while modifying svn repository, cannot open %VHFFS_BOTS_DIR%/misc/svn_post-commit.pl' ); unless( defined $postcommit ) { $svn->set_status( Vhffs::Constants::MODIFICATION_ERROR ); $svn->commit; return undef; } my @lines; while( <$postcommit> ) { push( @lines, $_ ); } close( $postcommit ); # write hook my $postcommitpath = $dir.'/hooks/post-commit'; unlink $postcommitpath; open( $postcommit, '>', $postcommitpath ) or Vhffs::Robots::vhffs_log( $vhffs, 'An error occured while modifying svn repository, cannot open '.$postcommitpath ); unless( defined $postcommit ) { $svn->set_status( Vhffs::Constants::MODIFICATION_ERROR ); $svn->commit; return undef; } foreach( @lines ) { # replace some parameters $_ =~ s/%MAILNOTIFYFROM%/$mailfrom/g; $_ =~ s/%MAILNOTIFYTO%/$mailto/g; print $postcommit $_; } close( $postcommit ); chmod 0755, $postcommitpath; Vhffs::Robots::vhffs_log( $vhffs, 'Svn repository '.$svn->get_reponame.' commit mail set to '.$mailto ); $svn->add_history( 'Commit mail set to '.$mailto ); } $svn->set_status( Vhffs::Constants::ACTIVATED ); $svn->commit; viewvc_conf( $vhffs ); websvn_conf( $vhffs ); return 1; } sub viewvc_conf { require Template; require File::Copy; my $vhffs = shift; my $confdir = $vhffs->get_config->get_datadir.'/svn/conf'; unless( -d $confdir ) { mkdir( $confdir ) or Vhffs::Robots::vhffs_log( $vhffs, 'Unable to create svn confdir '.$confdir.': '.$! ); } my $svnroots = []; my $svns = Vhffs::Services::Svn::getall( $vhffs, Vhffs::Constants::ACTIVATED ); foreach ( @{$svns} ) { next unless $_->is_public; my $svnpath = $_->get_reponame; $svnpath =~ s/\//_/; push @$svnroots, $svnpath.': '.$_->get_dir; } return undef unless $svnroots; my ( $tmpfile, $tmppath ) = Vhffs::Robots::tmpfile( $vhffs ); return undef unless defined $tmpfile; close( $tmpfile ); # TODO: remove hardcoded path my $template = new Template( { INCLUDE_PATH => '/usr/lib/vhffs/bots/misc/' } ); $template->process( 'svn_viewvc.conf.tt', { svnroots => $svnroots }, $tmppath ); chmod 0644, $tmppath; File::Copy::move( $tmppath, $confdir.'/viewvc.conf' ); return 1; } sub websvn_conf { require File::Copy; my $vhffs = shift; my $confdir = $vhffs->get_config->get_datadir.'/svn/conf'; unless( -d $confdir ) { mkdir( $confdir ) or Vhffs::Robots::vhffs_log( $vhffs, 'Unable to create svn confdir '.$confdir.': '.$! ); } my ( $tmpfile, $tmppath ) = Vhffs::Robots::tmpfile( $vhffs ); return undef unless defined $tmpfile; print $tmpfile '<?php'."\n"; my $svns = Vhffs::Services::Svn::getall( $vhffs, Vhffs::Constants::ACTIVATED ); foreach ( @{$svns} ) { print $tmpfile ' $config->addRepository("'.$_->get_reponame.'","file://'.$_->get_dir.'");'."\n" if $_->is_public; } print $tmpfile '?>'."\n"; close( $tmpfile ); chmod 0644, $tmppath; File::Copy::move( $tmppath, $confdir.'/websvn.inc' ); return 1; } 1;
najamelan/vhffs-4.5
vhffs-api/src/Vhffs/Robots/Svn.pm
Perl
bsd-3-clause
9,467
% Domain-independent caching-adapted Crisp-EC engine :- set_prolog_flag(unknown, fail). :- discontiguous holdsAt/2, happensAt/2. :- multifile holdsAt/2, happensAt/2. holdsAt(F=V,0):- \+ sdFluent(F), !, initially(F=V). holdsAt(F=V,T):- \+ sdFluent(F), T > 0, cached(F = V), previousTimePoint(T, Tprev), \+ broken(F = V, Tprev), !. % Cut removed in Prob-EC axiom. holdsAt(F=V,T):- \+ sdFluent(F), T > 0, previousTimePoint(T, Tprev), initiatedAt(F = V,Tprev). broken(F = V1, T) :- initiatedAt(F=V2,T), V1 \= V2. previousTimePoint(T, Tprev):- Tprev is T - 40.
JasonFil/Prob-EC
CAVIAR-Full-Evaluation/Crisp-EC/cached-version/ec_cached.pl
Perl
bsd-3-clause
590
#!/usr/bin/perl # Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, INC # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # 3. Neither the name of the copyright holder nor the names of its # contributors may be used to endorse or promote products derived from this # software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF # THE POSSIBILITY OF SUCH DAMAGE. use strict; use warnings; use Getopt::Long; use Brocade::BSC; my $configfile = ""; GetOptions("config=s" => \$configfile) or die ("Command line args"); print ("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); print ("<<< Demo Start\n"); print ("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); print ("\n<<< Creating Controller instance\n"); my $bvc = new Brocade::BSC(cfgfile => $configfile); print "'Controller':\n"; print $bvc->as_json() . "\n"; print ("<<< Show operational state of a particular configuration module on the Controller\n"); my $moduleType = "opendaylight-rest-connector:rest-connector-impl"; my $moduleName = "rest-connector-default-impl"; print " (module type: $moduleType,\n module name: $moduleName)\n"; my ($status, $result) = $bvc->get_module_operational_state($moduleType, $moduleName); $status->ok or die "!!! Demo terminated, reason: ${\$status->msg}\n"; print "Module:\n"; print JSON->new->canonical->pretty->encode($result); print ("\n"); print (">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); print (">>> Demo End\n"); print (">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
BRCDcomm/perlbscsamples
1.3.0/samplenetconf/demos/ctrl_demo7.pl
Perl
bsd-3-clause
2,768
% Frame number: 0 holdsAt( appearance( id0 )=appear, 0 ). holdsAt( appearance( id1 )=appear, 0 ). holdsAt( appearance( id2 )=appear, 0 ). % Frame number: 1 holdsAt( appearance( id0 )=visible, 40 ). holdsAt( appearance( id1 )=visible, 40 ). holdsAt( appearance( id2 )=visible, 40 ). % Frame number: 2 holdsAt( appearance( id0 )=visible, 80 ). holdsAt( appearance( id1 )=visible, 80 ). holdsAt( appearance( id2 )=visible, 80 ). % Frame number: 3 holdsAt( appearance( id0 )=visible, 120 ). holdsAt( appearance( id1 )=visible, 120 ). holdsAt( appearance( id2 )=visible, 120 ). % Frame number: 4 holdsAt( appearance( id0 )=visible, 160 ). holdsAt( appearance( id1 )=visible, 160 ). holdsAt( orientation( id2 )=142, 160 ). holdsAt( appearance( id2 )=visible, 160 ). % Frame number: 5 holdsAt( appearance( id0 )=visible, 200 ). holdsAt( appearance( id1 )=visible, 200 ). holdsAt( appearance( id2 )=visible, 200 ). % Frame number: 6 holdsAt( orientation( id0 )=159, 240 ). holdsAt( appearance( id0 )=visible, 240 ). holdsAt( appearance( id1 )=visible, 240 ). holdsAt( appearance( id2 )=visible, 240 ). % Frame number: 7 holdsAt( appearance( id0 )=visible, 280 ). holdsAt( appearance( id1 )=visible, 280 ). holdsAt( appearance( id2 )=visible, 280 ). % Frame number: 8 holdsAt( appearance( id0 )=visible, 320 ). holdsAt( appearance( id1 )=visible, 320 ). holdsAt( appearance( id2 )=visible, 320 ). % Frame number: 9 holdsAt( appearance( id0 )=visible, 360 ). holdsAt( appearance( id1 )=visible, 360 ). holdsAt( appearance( id2 )=visible, 360 ). % Frame number: 10 holdsAt( appearance( id0 )=visible, 400 ). holdsAt( appearance( id1 )=visible, 400 ). holdsAt( appearance( id2 )=visible, 400 ). % Frame number: 11 holdsAt( appearance( id0 )=visible, 440 ). holdsAt( appearance( id1 )=visible, 440 ). holdsAt( appearance( id2 )=visible, 440 ). % Frame number: 12 holdsAt( appearance( id0 )=visible, 480 ). holdsAt( orientation( id1 )=147, 480 ). holdsAt( appearance( id1 )=visible, 480 ). holdsAt( appearance( id2 )=visible, 480 ). % Frame number: 13 holdsAt( appearance( id0 )=visible, 520 ). holdsAt( appearance( id1 )=visible, 520 ). holdsAt( orientation( id2 )=142, 520 ). holdsAt( appearance( id2 )=visible, 520 ). % Frame number: 14 holdsAt( appearance( id0 )=visible, 560 ). holdsAt( appearance( id1 )=visible, 560 ). holdsAt( appearance( id2 )=visible, 560 ). % Frame number: 15 holdsAt( appearance( id0 )=visible, 600 ). holdsAt( appearance( id1 )=visible, 600 ). holdsAt( appearance( id2 )=visible, 600 ). % Frame number: 16 holdsAt( appearance( id0 )=visible, 640 ). holdsAt( appearance( id1 )=visible, 640 ). holdsAt( orientation( id2 )=142, 640 ). holdsAt( appearance( id2 )=visible, 640 ). % Frame number: 17 holdsAt( appearance( id0 )=visible, 680 ). holdsAt( appearance( id1 )=visible, 680 ). holdsAt( appearance( id2 )=visible, 680 ). % Frame number: 18 holdsAt( appearance( id0 )=visible, 720 ). holdsAt( appearance( id1 )=visible, 720 ). holdsAt( appearance( id2 )=visible, 720 ). % Frame number: 19 holdsAt( appearance( id0 )=visible, 760 ). holdsAt( orientation( id1 )=147, 760 ). holdsAt( appearance( id1 )=visible, 760 ). holdsAt( appearance( id2 )=visible, 760 ). % Frame number: 20 holdsAt( appearance( id0 )=visible, 800 ). holdsAt( appearance( id1 )=visible, 800 ). holdsAt( appearance( id2 )=visible, 800 ). % Frame number: 21 holdsAt( appearance( id0 )=visible, 840 ). holdsAt( appearance( id1 )=visible, 840 ). holdsAt( appearance( id2 )=visible, 840 ). % Frame number: 22 holdsAt( appearance( id0 )=visible, 880 ). holdsAt( appearance( id1 )=visible, 880 ). holdsAt( appearance( id2 )=visible, 880 ). % Frame number: 23 holdsAt( appearance( id0 )=visible, 920 ). holdsAt( appearance( id1 )=visible, 920 ). holdsAt( appearance( id2 )=visible, 920 ). % Frame number: 24 holdsAt( appearance( id0 )=visible, 960 ). holdsAt( appearance( id1 )=visible, 960 ). holdsAt( appearance( id2 )=visible, 960 ). % Frame number: 25 holdsAt( appearance( id0 )=visible, 1000 ). holdsAt( appearance( id1 )=visible, 1000 ). holdsAt( appearance( id2 )=visible, 1000 ). % Frame number: 26 holdsAt( appearance( id0 )=visible, 1040 ). holdsAt( appearance( id1 )=visible, 1040 ). holdsAt( appearance( id2 )=visible, 1040 ). % Frame number: 27 holdsAt( appearance( id0 )=visible, 1080 ). holdsAt( appearance( id1 )=visible, 1080 ). holdsAt( appearance( id2 )=visible, 1080 ). % Frame number: 28 holdsAt( appearance( id0 )=visible, 1120 ). holdsAt( orientation( id1 )=147, 1120 ). holdsAt( appearance( id1 )=visible, 1120 ). holdsAt( appearance( id2 )=visible, 1120 ). % Frame number: 29 holdsAt( appearance( id0 )=visible, 1160 ). holdsAt( appearance( id1 )=visible, 1160 ). holdsAt( appearance( id2 )=visible, 1160 ). % Frame number: 30 holdsAt( appearance( id0 )=visible, 1200 ). holdsAt( appearance( id1 )=visible, 1200 ). holdsAt( appearance( id2 )=visible, 1200 ). % Frame number: 31 holdsAt( appearance( id0 )=visible, 1240 ). holdsAt( appearance( id1 )=visible, 1240 ). holdsAt( appearance( id2 )=visible, 1240 ). % Frame number: 32 holdsAt( orientation( id0 )=146, 1280 ). holdsAt( appearance( id0 )=visible, 1280 ). holdsAt( appearance( id1 )=visible, 1280 ). holdsAt( appearance( id2 )=visible, 1280 ). % Frame number: 33 holdsAt( appearance( id0 )=visible, 1320 ). holdsAt( appearance( id1 )=visible, 1320 ). holdsAt( appearance( id2 )=visible, 1320 ). % Frame number: 34 holdsAt( appearance( id0 )=visible, 1360 ). holdsAt( appearance( id1 )=visible, 1360 ). holdsAt( appearance( id2 )=visible, 1360 ). % Frame number: 35 holdsAt( orientation( id0 )=155, 1400 ). holdsAt( appearance( id0 )=visible, 1400 ). holdsAt( appearance( id1 )=visible, 1400 ). holdsAt( appearance( id2 )=visible, 1400 ). % Frame number: 36 holdsAt( appearance( id0 )=visible, 1440 ). holdsAt( appearance( id1 )=visible, 1440 ). holdsAt( appearance( id2 )=visible, 1440 ). % Frame number: 37 holdsAt( appearance( id0 )=visible, 1480 ). holdsAt( appearance( id1 )=visible, 1480 ). holdsAt( appearance( id2 )=visible, 1480 ). % Frame number: 38 holdsAt( appearance( id0 )=visible, 1520 ). holdsAt( appearance( id1 )=visible, 1520 ). holdsAt( appearance( id2 )=visible, 1520 ). % Frame number: 39 holdsAt( appearance( id0 )=visible, 1560 ). holdsAt( appearance( id1 )=visible, 1560 ). holdsAt( appearance( id2 )=visible, 1560 ). % Frame number: 40 holdsAt( appearance( id0 )=visible, 1600 ). holdsAt( appearance( id1 )=visible, 1600 ). holdsAt( appearance( id2 )=visible, 1600 ). % Frame number: 41 holdsAt( appearance( id0 )=visible, 1640 ). holdsAt( appearance( id1 )=visible, 1640 ). holdsAt( appearance( id2 )=visible, 1640 ). % Frame number: 42 holdsAt( orientation( id0 )=150, 1680 ). holdsAt( appearance( id0 )=visible, 1680 ). holdsAt( appearance( id1 )=visible, 1680 ). holdsAt( appearance( id2 )=visible, 1680 ). % Frame number: 43 holdsAt( appearance( id0 )=visible, 1720 ). holdsAt( appearance( id1 )=visible, 1720 ). holdsAt( appearance( id2 )=visible, 1720 ). % Frame number: 44 holdsAt( appearance( id0 )=visible, 1760 ). holdsAt( appearance( id1 )=visible, 1760 ). holdsAt( appearance( id2 )=visible, 1760 ). % Frame number: 45 holdsAt( appearance( id0 )=visible, 1800 ). holdsAt( appearance( id1 )=visible, 1800 ). holdsAt( appearance( id2 )=visible, 1800 ). % Frame number: 46 holdsAt( appearance( id0 )=visible, 1840 ). holdsAt( appearance( id1 )=visible, 1840 ). holdsAt( appearance( id2 )=visible, 1840 ). % Frame number: 47 holdsAt( appearance( id0 )=visible, 1880 ). holdsAt( appearance( id1 )=visible, 1880 ). holdsAt( appearance( id2 )=visible, 1880 ). % Frame number: 48 holdsAt( appearance( id0 )=visible, 1920 ). holdsAt( appearance( id1 )=visible, 1920 ). holdsAt( appearance( id2 )=visible, 1920 ). % Frame number: 49 holdsAt( appearance( id0 )=visible, 1960 ). holdsAt( appearance( id1 )=visible, 1960 ). holdsAt( appearance( id2 )=visible, 1960 ). % Frame number: 50 holdsAt( appearance( id0 )=visible, 2000 ). holdsAt( appearance( id1 )=visible, 2000 ). holdsAt( appearance( id2 )=visible, 2000 ). % Frame number: 51 holdsAt( appearance( id0 )=visible, 2040 ). holdsAt( appearance( id1 )=visible, 2040 ). holdsAt( orientation( id2 )=142, 2040 ). holdsAt( appearance( id2 )=visible, 2040 ). % Frame number: 52 holdsAt( appearance( id0 )=visible, 2080 ). holdsAt( appearance( id1 )=visible, 2080 ). holdsAt( appearance( id2 )=visible, 2080 ). % Frame number: 53 holdsAt( appearance( id0 )=visible, 2120 ). holdsAt( appearance( id1 )=visible, 2120 ). holdsAt( appearance( id2 )=visible, 2120 ). % Frame number: 54 holdsAt( appearance( id0 )=visible, 2160 ). holdsAt( appearance( id1 )=visible, 2160 ). holdsAt( appearance( id2 )=visible, 2160 ). % Frame number: 55 holdsAt( appearance( id0 )=visible, 2200 ). holdsAt( appearance( id1 )=visible, 2200 ). holdsAt( appearance( id2 )=visible, 2200 ). % Frame number: 56 holdsAt( appearance( id0 )=visible, 2240 ). holdsAt( appearance( id1 )=visible, 2240 ). holdsAt( appearance( id2 )=visible, 2240 ). % Frame number: 57 holdsAt( appearance( id0 )=visible, 2280 ). holdsAt( appearance( id1 )=visible, 2280 ). holdsAt( appearance( id2 )=visible, 2280 ). % Frame number: 58 holdsAt( appearance( id0 )=visible, 2320 ). holdsAt( appearance( id1 )=visible, 2320 ). holdsAt( appearance( id2 )=visible, 2320 ). % Frame number: 59 holdsAt( appearance( id0 )=visible, 2360 ). holdsAt( appearance( id1 )=visible, 2360 ). holdsAt( appearance( id2 )=visible, 2360 ). % Frame number: 60 holdsAt( orientation( id0 )=148, 2400 ). holdsAt( appearance( id0 )=visible, 2400 ). holdsAt( appearance( id1 )=visible, 2400 ). holdsAt( appearance( id2 )=visible, 2400 ). % Frame number: 61 holdsAt( appearance( id0 )=visible, 2440 ). holdsAt( appearance( id1 )=visible, 2440 ). holdsAt( appearance( id2 )=visible, 2440 ). % Frame number: 62 holdsAt( appearance( id0 )=visible, 2480 ). holdsAt( appearance( id1 )=visible, 2480 ). holdsAt( orientation( id2 )=142, 2480 ). holdsAt( appearance( id2 )=visible, 2480 ). % Frame number: 63 holdsAt( appearance( id0 )=visible, 2520 ). holdsAt( appearance( id1 )=visible, 2520 ). holdsAt( appearance( id2 )=visible, 2520 ). % Frame number: 64 holdsAt( appearance( id0 )=visible, 2560 ). holdsAt( orientation( id1 )=147, 2560 ). holdsAt( appearance( id1 )=visible, 2560 ). holdsAt( appearance( id2 )=visible, 2560 ). % Frame number: 65 holdsAt( orientation( id0 )=148, 2600 ). holdsAt( appearance( id0 )=visible, 2600 ). holdsAt( appearance( id1 )=visible, 2600 ). holdsAt( appearance( id2 )=visible, 2600 ). % Frame number: 66 holdsAt( appearance( id0 )=visible, 2640 ). holdsAt( appearance( id1 )=visible, 2640 ). holdsAt( appearance( id2 )=visible, 2640 ). % Frame number: 67 holdsAt( appearance( id0 )=visible, 2680 ). holdsAt( appearance( id1 )=visible, 2680 ). holdsAt( appearance( id2 )=visible, 2680 ). % Frame number: 68 holdsAt( appearance( id0 )=visible, 2720 ). holdsAt( appearance( id1 )=visible, 2720 ). holdsAt( appearance( id2 )=visible, 2720 ). % Frame number: 69 holdsAt( appearance( id0 )=visible, 2760 ). holdsAt( appearance( id1 )=visible, 2760 ). holdsAt( appearance( id2 )=visible, 2760 ). % Frame number: 70 holdsAt( orientation( id0 )=148, 2800 ). holdsAt( appearance( id0 )=visible, 2800 ). holdsAt( appearance( id1 )=visible, 2800 ). holdsAt( appearance( id2 )=visible, 2800 ). % Frame number: 71 holdsAt( orientation( id0 )=148, 2840 ). holdsAt( appearance( id0 )=visible, 2840 ). holdsAt( appearance( id1 )=visible, 2840 ). holdsAt( orientation( id2 )=142, 2840 ). holdsAt( appearance( id2 )=visible, 2840 ). % Frame number: 72 holdsAt( appearance( id0 )=visible, 2880 ). holdsAt( appearance( id1 )=visible, 2880 ). holdsAt( appearance( id2 )=visible, 2880 ). % Frame number: 73 holdsAt( appearance( id0 )=visible, 2920 ). holdsAt( appearance( id1 )=visible, 2920 ). holdsAt( appearance( id2 )=visible, 2920 ). % Frame number: 74 holdsAt( appearance( id0 )=visible, 2960 ). holdsAt( appearance( id1 )=visible, 2960 ). holdsAt( appearance( id2 )=visible, 2960 ). % Frame number: 75 holdsAt( appearance( id0 )=visible, 3000 ). holdsAt( appearance( id1 )=visible, 3000 ). holdsAt( appearance( id2 )=visible, 3000 ). % Frame number: 76 holdsAt( appearance( id0 )=visible, 3040 ). holdsAt( appearance( id1 )=visible, 3040 ). holdsAt( appearance( id2 )=visible, 3040 ). % Frame number: 77 holdsAt( appearance( id0 )=visible, 3080 ). holdsAt( orientation( id1 )=147, 3080 ). holdsAt( appearance( id1 )=visible, 3080 ). holdsAt( appearance( id2 )=visible, 3080 ). % Frame number: 78 holdsAt( appearance( id0 )=visible, 3120 ). holdsAt( appearance( id1 )=visible, 3120 ). holdsAt( appearance( id2 )=visible, 3120 ). % Frame number: 79 holdsAt( appearance( id0 )=visible, 3160 ). holdsAt( appearance( id1 )=visible, 3160 ). holdsAt( appearance( id2 )=visible, 3160 ). % Frame number: 80 holdsAt( appearance( id0 )=visible, 3200 ). holdsAt( appearance( id1 )=visible, 3200 ). holdsAt( appearance( id2 )=visible, 3200 ). % Frame number: 81 holdsAt( appearance( id0 )=visible, 3240 ). holdsAt( appearance( id1 )=visible, 3240 ). holdsAt( appearance( id2 )=visible, 3240 ). % Frame number: 82 holdsAt( appearance( id0 )=visible, 3280 ). holdsAt( appearance( id1 )=visible, 3280 ). holdsAt( appearance( id2 )=visible, 3280 ). % Frame number: 83 holdsAt( appearance( id0 )=visible, 3320 ). holdsAt( appearance( id1 )=visible, 3320 ). holdsAt( appearance( id2 )=visible, 3320 ). % Frame number: 84 holdsAt( appearance( id0 )=visible, 3360 ). holdsAt( appearance( id1 )=visible, 3360 ). holdsAt( appearance( id2 )=visible, 3360 ). % Frame number: 85 holdsAt( appearance( id0 )=visible, 3400 ). holdsAt( appearance( id1 )=visible, 3400 ). holdsAt( appearance( id2 )=visible, 3400 ). % Frame number: 86 holdsAt( appearance( id0 )=visible, 3440 ). holdsAt( orientation( id1 )=147, 3440 ). holdsAt( appearance( id1 )=visible, 3440 ). holdsAt( appearance( id2 )=visible, 3440 ). % Frame number: 87 holdsAt( appearance( id0 )=visible, 3480 ). holdsAt( appearance( id1 )=visible, 3480 ). holdsAt( appearance( id2 )=visible, 3480 ). % Frame number: 88 holdsAt( appearance( id0 )=visible, 3520 ). holdsAt( orientation( id1 )=147, 3520 ). holdsAt( appearance( id1 )=visible, 3520 ). holdsAt( orientation( id2 )=142, 3520 ). holdsAt( appearance( id2 )=visible, 3520 ). % Frame number: 89 holdsAt( appearance( id0 )=visible, 3560 ). holdsAt( appearance( id1 )=visible, 3560 ). holdsAt( appearance( id2 )=visible, 3560 ). % Frame number: 90 holdsAt( appearance( id0 )=visible, 3600 ). holdsAt( appearance( id1 )=visible, 3600 ). holdsAt( appearance( id2 )=visible, 3600 ). % Frame number: 91 holdsAt( appearance( id0 )=visible, 3640 ). holdsAt( appearance( id1 )=visible, 3640 ). holdsAt( appearance( id2 )=visible, 3640 ). % Frame number: 92 holdsAt( appearance( id0 )=visible, 3680 ). holdsAt( appearance( id1 )=visible, 3680 ). holdsAt( appearance( id2 )=visible, 3680 ). % Frame number: 93 holdsAt( orientation( id0 )=145, 3720 ). holdsAt( appearance( id0 )=visible, 3720 ). holdsAt( appearance( id1 )=visible, 3720 ). holdsAt( appearance( id2 )=visible, 3720 ). % Frame number: 94 holdsAt( appearance( id0 )=visible, 3760 ). holdsAt( orientation( id1 )=148, 3760 ). holdsAt( appearance( id1 )=visible, 3760 ). holdsAt( orientation( id2 )=145, 3760 ). holdsAt( appearance( id2 )=visible, 3760 ). % Frame number: 95 holdsAt( appearance( id0 )=visible, 3800 ). holdsAt( appearance( id1 )=visible, 3800 ). holdsAt( appearance( id2 )=visible, 3800 ). % Frame number: 96 holdsAt( appearance( id0 )=visible, 3840 ). holdsAt( appearance( id1 )=visible, 3840 ). holdsAt( appearance( id2 )=visible, 3840 ). % Frame number: 97 holdsAt( appearance( id0 )=visible, 3880 ). holdsAt( appearance( id1 )=visible, 3880 ). holdsAt( appearance( id2 )=visible, 3880 ). % Frame number: 98 holdsAt( appearance( id0 )=visible, 3920 ). holdsAt( appearance( id1 )=visible, 3920 ). holdsAt( appearance( id2 )=visible, 3920 ). % Frame number: 99 holdsAt( appearance( id0 )=visible, 3960 ). holdsAt( appearance( id1 )=visible, 3960 ). holdsAt( appearance( id2 )=visible, 3960 ). % Frame number: 100 holdsAt( appearance( id0 )=visible, 4000 ). holdsAt( appearance( id1 )=visible, 4000 ). holdsAt( orientation( id2 )=145, 4000 ). holdsAt( appearance( id2 )=visible, 4000 ). % Frame number: 101 holdsAt( appearance( id0 )=visible, 4040 ). holdsAt( appearance( id1 )=visible, 4040 ). holdsAt( appearance( id2 )=visible, 4040 ). % Frame number: 102 holdsAt( appearance( id0 )=visible, 4080 ). holdsAt( appearance( id1 )=visible, 4080 ). holdsAt( appearance( id2 )=visible, 4080 ). % Frame number: 103 holdsAt( appearance( id0 )=visible, 4120 ). holdsAt( appearance( id1 )=visible, 4120 ). holdsAt( appearance( id2 )=visible, 4120 ). % Frame number: 104 holdsAt( appearance( id0 )=visible, 4160 ). holdsAt( appearance( id1 )=visible, 4160 ). holdsAt( appearance( id2 )=visible, 4160 ). % Frame number: 105 holdsAt( appearance( id0 )=visible, 4200 ). holdsAt( appearance( id1 )=visible, 4200 ). holdsAt( appearance( id2 )=visible, 4200 ). % Frame number: 106 holdsAt( appearance( id0 )=visible, 4240 ). holdsAt( appearance( id1 )=visible, 4240 ). holdsAt( appearance( id2 )=visible, 4240 ). % Frame number: 107 holdsAt( appearance( id0 )=visible, 4280 ). holdsAt( appearance( id1 )=visible, 4280 ). holdsAt( appearance( id2 )=visible, 4280 ). % Frame number: 108 holdsAt( appearance( id0 )=visible, 4320 ). holdsAt( appearance( id1 )=visible, 4320 ). holdsAt( appearance( id2 )=visible, 4320 ). % Frame number: 109 holdsAt( appearance( id0 )=visible, 4360 ). holdsAt( appearance( id1 )=visible, 4360 ). holdsAt( appearance( id2 )=visible, 4360 ). % Frame number: 110 holdsAt( appearance( id0 )=visible, 4400 ). holdsAt( appearance( id1 )=visible, 4400 ). holdsAt( appearance( id2 )=visible, 4400 ). % Frame number: 111 holdsAt( appearance( id0 )=visible, 4440 ). holdsAt( appearance( id1 )=visible, 4440 ). holdsAt( appearance( id2 )=visible, 4440 ). % Frame number: 112 holdsAt( appearance( id0 )=visible, 4480 ). holdsAt( appearance( id1 )=visible, 4480 ). holdsAt( appearance( id2 )=visible, 4480 ). % Frame number: 113 holdsAt( orientation( id0 )=151, 4520 ). holdsAt( appearance( id0 )=visible, 4520 ). holdsAt( appearance( id1 )=visible, 4520 ). holdsAt( appearance( id2 )=visible, 4520 ). % Frame number: 114 holdsAt( appearance( id0 )=visible, 4560 ). holdsAt( appearance( id1 )=visible, 4560 ). holdsAt( orientation( id2 )=147, 4560 ). holdsAt( appearance( id2 )=visible, 4560 ). % Frame number: 115 holdsAt( appearance( id0 )=visible, 4600 ). holdsAt( appearance( id1 )=visible, 4600 ). holdsAt( appearance( id2 )=visible, 4600 ). % Frame number: 116 holdsAt( appearance( id0 )=visible, 4640 ). holdsAt( appearance( id1 )=visible, 4640 ). holdsAt( appearance( id2 )=visible, 4640 ). % Frame number: 117 holdsAt( appearance( id0 )=visible, 4680 ). holdsAt( appearance( id1 )=visible, 4680 ). holdsAt( appearance( id2 )=visible, 4680 ). % Frame number: 118 holdsAt( appearance( id0 )=visible, 4720 ). holdsAt( appearance( id1 )=visible, 4720 ). holdsAt( appearance( id2 )=visible, 4720 ). % Frame number: 119 holdsAt( appearance( id0 )=visible, 4760 ). holdsAt( appearance( id1 )=visible, 4760 ). holdsAt( appearance( id2 )=visible, 4760 ). % Frame number: 120 holdsAt( appearance( id0 )=visible, 4800 ). holdsAt( orientation( id1 )=151, 4800 ). holdsAt( appearance( id1 )=visible, 4800 ). holdsAt( appearance( id2 )=visible, 4800 ). % Frame number: 121 holdsAt( appearance( id0 )=visible, 4840 ). holdsAt( appearance( id1 )=visible, 4840 ). holdsAt( appearance( id2 )=visible, 4840 ). % Frame number: 122 holdsAt( appearance( id0 )=visible, 4880 ). holdsAt( appearance( id1 )=visible, 4880 ). holdsAt( appearance( id2 )=visible, 4880 ). % Frame number: 123 holdsAt( appearance( id0 )=visible, 4920 ). holdsAt( appearance( id1 )=visible, 4920 ). holdsAt( appearance( id2 )=visible, 4920 ). % Frame number: 124 holdsAt( appearance( id0 )=visible, 4960 ). holdsAt( appearance( id1 )=visible, 4960 ). holdsAt( appearance( id2 )=visible, 4960 ). % Frame number: 125 holdsAt( appearance( id0 )=visible, 5000 ). holdsAt( orientation( id1 )=151, 5000 ). holdsAt( appearance( id1 )=visible, 5000 ). holdsAt( appearance( id2 )=visible, 5000 ). % Frame number: 126 holdsAt( appearance( id0 )=visible, 5040 ). holdsAt( appearance( id1 )=visible, 5040 ). holdsAt( appearance( id2 )=visible, 5040 ). % Frame number: 127 holdsAt( appearance( id0 )=visible, 5080 ). holdsAt( appearance( id1 )=visible, 5080 ). holdsAt( appearance( id2 )=visible, 5080 ). % Frame number: 128 holdsAt( appearance( id0 )=visible, 5120 ). holdsAt( appearance( id1 )=visible, 5120 ). holdsAt( appearance( id2 )=visible, 5120 ). % Frame number: 129 holdsAt( appearance( id0 )=visible, 5160 ). holdsAt( appearance( id1 )=visible, 5160 ). holdsAt( appearance( id2 )=visible, 5160 ). % Frame number: 130 holdsAt( appearance( id0 )=visible, 5200 ). holdsAt( appearance( id1 )=visible, 5200 ). holdsAt( appearance( id2 )=visible, 5200 ). % Frame number: 131 holdsAt( orientation( id0 )=142, 5240 ). holdsAt( appearance( id0 )=visible, 5240 ). holdsAt( appearance( id1 )=visible, 5240 ). holdsAt( appearance( id2 )=visible, 5240 ). % Frame number: 132 holdsAt( appearance( id0 )=visible, 5280 ). holdsAt( appearance( id1 )=visible, 5280 ). holdsAt( appearance( id2 )=visible, 5280 ). % Frame number: 133 holdsAt( appearance( id0 )=visible, 5320 ). holdsAt( appearance( id1 )=visible, 5320 ). holdsAt( appearance( id2 )=visible, 5320 ). % Frame number: 134 holdsAt( appearance( id0 )=visible, 5360 ). holdsAt( appearance( id1 )=visible, 5360 ). holdsAt( appearance( id2 )=visible, 5360 ). % Frame number: 135 holdsAt( appearance( id0 )=visible, 5400 ). holdsAt( appearance( id1 )=visible, 5400 ). holdsAt( appearance( id2 )=visible, 5400 ). % Frame number: 136 holdsAt( appearance( id0 )=visible, 5440 ). holdsAt( appearance( id1 )=visible, 5440 ). holdsAt( appearance( id2 )=visible, 5440 ). % Frame number: 137 holdsAt( appearance( id0 )=visible, 5480 ). holdsAt( appearance( id1 )=visible, 5480 ). holdsAt( appearance( id2 )=visible, 5480 ). % Frame number: 138 holdsAt( appearance( id0 )=visible, 5520 ). holdsAt( appearance( id1 )=visible, 5520 ). holdsAt( appearance( id2 )=visible, 5520 ). % Frame number: 139 holdsAt( orientation( id0 )=138, 5560 ). holdsAt( appearance( id0 )=visible, 5560 ). holdsAt( appearance( id1 )=visible, 5560 ). holdsAt( appearance( id2 )=visible, 5560 ). % Frame number: 140 holdsAt( appearance( id0 )=visible, 5600 ). holdsAt( appearance( id1 )=visible, 5600 ). holdsAt( appearance( id2 )=visible, 5600 ). % Frame number: 141 holdsAt( appearance( id0 )=visible, 5640 ). holdsAt( appearance( id1 )=visible, 5640 ). holdsAt( appearance( id2 )=visible, 5640 ). % Frame number: 142 holdsAt( appearance( id0 )=visible, 5680 ). holdsAt( appearance( id1 )=visible, 5680 ). holdsAt( appearance( id2 )=visible, 5680 ). % Frame number: 143 holdsAt( appearance( id0 )=visible, 5720 ). holdsAt( appearance( id1 )=visible, 5720 ). holdsAt( appearance( id2 )=visible, 5720 ). % Frame number: 144 holdsAt( appearance( id0 )=visible, 5760 ). holdsAt( appearance( id1 )=visible, 5760 ). holdsAt( appearance( id2 )=visible, 5760 ). % Frame number: 145 holdsAt( orientation( id0 )=136, 5800 ). holdsAt( appearance( id0 )=visible, 5800 ). holdsAt( orientation( id1 )=151, 5800 ). holdsAt( appearance( id1 )=visible, 5800 ). holdsAt( appearance( id2 )=visible, 5800 ). % Frame number: 146 holdsAt( appearance( id0 )=visible, 5840 ). holdsAt( appearance( id1 )=visible, 5840 ). holdsAt( appearance( id2 )=visible, 5840 ). % Frame number: 147 holdsAt( appearance( id0 )=visible, 5880 ). holdsAt( appearance( id1 )=visible, 5880 ). holdsAt( appearance( id2 )=visible, 5880 ). % Frame number: 148 holdsAt( appearance( id0 )=visible, 5920 ). holdsAt( appearance( id1 )=visible, 5920 ). holdsAt( appearance( id2 )=visible, 5920 ). % Frame number: 149 holdsAt( appearance( id0 )=visible, 5960 ). holdsAt( appearance( id1 )=visible, 5960 ). holdsAt( appearance( id2 )=visible, 5960 ). % Frame number: 150 holdsAt( appearance( id0 )=visible, 6000 ). holdsAt( appearance( id1 )=visible, 6000 ). holdsAt( appearance( id2 )=visible, 6000 ). % Frame number: 151 holdsAt( appearance( id0 )=visible, 6040 ). holdsAt( appearance( id1 )=visible, 6040 ). holdsAt( appearance( id2 )=visible, 6040 ). % Frame number: 152 holdsAt( appearance( id0 )=visible, 6080 ). holdsAt( appearance( id1 )=visible, 6080 ). holdsAt( appearance( id2 )=visible, 6080 ). % Frame number: 153 holdsAt( appearance( id0 )=visible, 6120 ). holdsAt( appearance( id1 )=visible, 6120 ). holdsAt( appearance( id2 )=visible, 6120 ). % Frame number: 154 holdsAt( appearance( id0 )=visible, 6160 ). holdsAt( appearance( id1 )=visible, 6160 ). holdsAt( appearance( id2 )=visible, 6160 ). % Frame number: 155 holdsAt( appearance( id0 )=visible, 6200 ). holdsAt( appearance( id1 )=visible, 6200 ). holdsAt( appearance( id2 )=visible, 6200 ). % Frame number: 156 holdsAt( orientation( id0 )=136, 6240 ). holdsAt( appearance( id0 )=visible, 6240 ). holdsAt( appearance( id1 )=visible, 6240 ). holdsAt( appearance( id2 )=visible, 6240 ). % Frame number: 157 holdsAt( appearance( id0 )=visible, 6280 ). holdsAt( appearance( id1 )=visible, 6280 ). holdsAt( appearance( id2 )=visible, 6280 ). % Frame number: 158 holdsAt( appearance( id0 )=visible, 6320 ). holdsAt( appearance( id1 )=visible, 6320 ). holdsAt( appearance( id2 )=visible, 6320 ). % Frame number: 159 holdsAt( appearance( id0 )=visible, 6360 ). holdsAt( appearance( id1 )=visible, 6360 ). holdsAt( appearance( id2 )=visible, 6360 ). % Frame number: 160 holdsAt( appearance( id0 )=visible, 6400 ). holdsAt( appearance( id1 )=visible, 6400 ). holdsAt( appearance( id2 )=visible, 6400 ). % Frame number: 161 holdsAt( appearance( id0 )=visible, 6440 ). holdsAt( appearance( id1 )=visible, 6440 ). holdsAt( appearance( id2 )=visible, 6440 ). % Frame number: 162 holdsAt( appearance( id0 )=visible, 6480 ). holdsAt( appearance( id1 )=visible, 6480 ). holdsAt( appearance( id2 )=visible, 6480 ). % Frame number: 163 holdsAt( appearance( id0 )=visible, 6520 ). holdsAt( appearance( id1 )=visible, 6520 ). holdsAt( appearance( id2 )=visible, 6520 ). % Frame number: 164 holdsAt( appearance( id0 )=visible, 6560 ). holdsAt( appearance( id1 )=visible, 6560 ). holdsAt( appearance( id2 )=visible, 6560 ). % Frame number: 165 holdsAt( appearance( id0 )=visible, 6600 ). holdsAt( orientation( id1 )=151, 6600 ). holdsAt( appearance( id1 )=visible, 6600 ). holdsAt( orientation( id2 )=144, 6600 ). holdsAt( appearance( id2 )=visible, 6600 ). % Frame number: 166 holdsAt( appearance( id0 )=visible, 6640 ). holdsAt( appearance( id1 )=visible, 6640 ). holdsAt( appearance( id2 )=visible, 6640 ). % Frame number: 167 holdsAt( appearance( id0 )=visible, 6680 ). holdsAt( appearance( id1 )=visible, 6680 ). holdsAt( appearance( id2 )=visible, 6680 ). % Frame number: 168 holdsAt( appearance( id0 )=visible, 6720 ). holdsAt( appearance( id1 )=visible, 6720 ). holdsAt( appearance( id2 )=visible, 6720 ). % Frame number: 169 holdsAt( appearance( id0 )=visible, 6760 ). holdsAt( appearance( id1 )=visible, 6760 ). holdsAt( appearance( id2 )=visible, 6760 ). % Frame number: 170 holdsAt( appearance( id0 )=visible, 6800 ). holdsAt( appearance( id1 )=visible, 6800 ). holdsAt( appearance( id2 )=visible, 6800 ). % Frame number: 171 holdsAt( appearance( id0 )=visible, 6840 ). holdsAt( appearance( id1 )=visible, 6840 ). holdsAt( appearance( id2 )=visible, 6840 ). % Frame number: 172 holdsAt( appearance( id0 )=visible, 6880 ). holdsAt( appearance( id1 )=visible, 6880 ). holdsAt( appearance( id2 )=visible, 6880 ). % Frame number: 173 holdsAt( appearance( id0 )=visible, 6920 ). holdsAt( orientation( id1 )=151, 6920 ). holdsAt( appearance( id1 )=visible, 6920 ). holdsAt( appearance( id2 )=visible, 6920 ). % Frame number: 174 holdsAt( appearance( id0 )=visible, 6960 ). holdsAt( appearance( id1 )=visible, 6960 ). holdsAt( appearance( id2 )=visible, 6960 ). % Frame number: 175 holdsAt( orientation( id0 )=136, 7000 ). holdsAt( appearance( id0 )=visible, 7000 ). holdsAt( appearance( id1 )=visible, 7000 ). holdsAt( appearance( id2 )=visible, 7000 ). % Frame number: 176 holdsAt( appearance( id0 )=visible, 7040 ). holdsAt( appearance( id1 )=visible, 7040 ). holdsAt( appearance( id2 )=visible, 7040 ). % Frame number: 177 holdsAt( appearance( id0 )=visible, 7080 ). holdsAt( appearance( id1 )=visible, 7080 ). holdsAt( appearance( id2 )=visible, 7080 ). % Frame number: 178 holdsAt( appearance( id0 )=visible, 7120 ). holdsAt( appearance( id1 )=visible, 7120 ). holdsAt( appearance( id2 )=visible, 7120 ). % Frame number: 179 holdsAt( appearance( id0 )=visible, 7160 ). holdsAt( appearance( id1 )=visible, 7160 ). holdsAt( appearance( id2 )=visible, 7160 ). % Frame number: 180 holdsAt( appearance( id0 )=visible, 7200 ). holdsAt( appearance( id1 )=visible, 7200 ). holdsAt( appearance( id2 )=visible, 7200 ). % Frame number: 181 holdsAt( appearance( id0 )=visible, 7240 ). holdsAt( appearance( id1 )=visible, 7240 ). holdsAt( appearance( id2 )=visible, 7240 ). % Frame number: 182 holdsAt( appearance( id0 )=visible, 7280 ). holdsAt( appearance( id1 )=visible, 7280 ). holdsAt( appearance( id2 )=visible, 7280 ). % Frame number: 183 holdsAt( appearance( id0 )=visible, 7320 ). holdsAt( appearance( id1 )=visible, 7320 ). holdsAt( appearance( id2 )=visible, 7320 ). % Frame number: 184 holdsAt( appearance( id0 )=visible, 7360 ). holdsAt( appearance( id1 )=visible, 7360 ). holdsAt( appearance( id2 )=visible, 7360 ). % Frame number: 185 holdsAt( appearance( id0 )=visible, 7400 ). holdsAt( appearance( id1 )=visible, 7400 ). holdsAt( appearance( id2 )=visible, 7400 ). % Frame number: 186 holdsAt( appearance( id0 )=visible, 7440 ). holdsAt( appearance( id1 )=visible, 7440 ). holdsAt( appearance( id2 )=visible, 7440 ). % Frame number: 187 holdsAt( appearance( id0 )=visible, 7480 ). holdsAt( appearance( id1 )=visible, 7480 ). holdsAt( appearance( id2 )=visible, 7480 ). % Frame number: 188 holdsAt( appearance( id0 )=visible, 7520 ). holdsAt( appearance( id1 )=visible, 7520 ). holdsAt( appearance( id2 )=visible, 7520 ). % Frame number: 189 holdsAt( appearance( id0 )=visible, 7560 ). holdsAt( appearance( id1 )=visible, 7560 ). holdsAt( appearance( id2 )=visible, 7560 ). % Frame number: 190 holdsAt( orientation( id0 )=136, 7600 ). holdsAt( appearance( id0 )=visible, 7600 ). holdsAt( appearance( id1 )=visible, 7600 ). holdsAt( appearance( id2 )=visible, 7600 ). % Frame number: 191 holdsAt( appearance( id0 )=visible, 7640 ). holdsAt( appearance( id1 )=visible, 7640 ). holdsAt( appearance( id2 )=visible, 7640 ). % Frame number: 192 holdsAt( appearance( id0 )=visible, 7680 ). holdsAt( appearance( id1 )=visible, 7680 ). holdsAt( appearance( id2 )=visible, 7680 ). % Frame number: 193 holdsAt( appearance( id0 )=visible, 7720 ). holdsAt( appearance( id1 )=visible, 7720 ). holdsAt( appearance( id2 )=visible, 7720 ). % Frame number: 194 holdsAt( appearance( id0 )=visible, 7760 ). holdsAt( appearance( id1 )=visible, 7760 ). holdsAt( appearance( id2 )=visible, 7760 ). % Frame number: 195 holdsAt( orientation( id0 )=136, 7800 ). holdsAt( appearance( id0 )=visible, 7800 ). holdsAt( appearance( id1 )=visible, 7800 ). holdsAt( appearance( id2 )=visible, 7800 ). % Frame number: 196 holdsAt( appearance( id0 )=visible, 7840 ). holdsAt( appearance( id1 )=visible, 7840 ). holdsAt( appearance( id2 )=visible, 7840 ). % Frame number: 197 holdsAt( appearance( id0 )=visible, 7880 ). holdsAt( appearance( id1 )=visible, 7880 ). holdsAt( appearance( id2 )=visible, 7880 ). % Frame number: 198 holdsAt( appearance( id0 )=visible, 7920 ). holdsAt( appearance( id1 )=visible, 7920 ). holdsAt( appearance( id2 )=visible, 7920 ). % Frame number: 199 holdsAt( appearance( id0 )=visible, 7960 ). holdsAt( appearance( id1 )=visible, 7960 ). holdsAt( appearance( id2 )=visible, 7960 ). % Frame number: 200 holdsAt( appearance( id0 )=visible, 8000 ). holdsAt( appearance( id1 )=visible, 8000 ). holdsAt( appearance( id2 )=visible, 8000 ). % Frame number: 201 holdsAt( orientation( id0 )=136, 8040 ). holdsAt( appearance( id0 )=visible, 8040 ). holdsAt( appearance( id1 )=visible, 8040 ). holdsAt( appearance( id2 )=visible, 8040 ). % Frame number: 202 holdsAt( appearance( id0 )=visible, 8080 ). holdsAt( appearance( id1 )=visible, 8080 ). holdsAt( appearance( id2 )=visible, 8080 ). % Frame number: 203 holdsAt( appearance( id0 )=visible, 8120 ). holdsAt( appearance( id1 )=visible, 8120 ). holdsAt( appearance( id2 )=visible, 8120 ). % Frame number: 204 holdsAt( appearance( id0 )=visible, 8160 ). holdsAt( appearance( id1 )=visible, 8160 ). holdsAt( appearance( id2 )=visible, 8160 ). % Frame number: 205 holdsAt( appearance( id0 )=visible, 8200 ). holdsAt( appearance( id1 )=visible, 8200 ). holdsAt( appearance( id2 )=visible, 8200 ). % Frame number: 206 holdsAt( appearance( id0 )=visible, 8240 ). holdsAt( appearance( id1 )=visible, 8240 ). holdsAt( appearance( id2 )=visible, 8240 ). % Frame number: 207 holdsAt( appearance( id0 )=visible, 8280 ). holdsAt( appearance( id1 )=visible, 8280 ). holdsAt( appearance( id2 )=visible, 8280 ). % Frame number: 208 holdsAt( appearance( id0 )=visible, 8320 ). holdsAt( appearance( id1 )=visible, 8320 ). holdsAt( appearance( id2 )=visible, 8320 ). % Frame number: 209 holdsAt( appearance( id0 )=visible, 8360 ). holdsAt( appearance( id1 )=visible, 8360 ). holdsAt( appearance( id2 )=visible, 8360 ). % Frame number: 210 holdsAt( appearance( id0 )=visible, 8400 ). holdsAt( appearance( id1 )=visible, 8400 ). holdsAt( appearance( id2 )=visible, 8400 ). % Frame number: 211 holdsAt( appearance( id0 )=visible, 8440 ). holdsAt( appearance( id1 )=visible, 8440 ). holdsAt( appearance( id2 )=visible, 8440 ). % Frame number: 212 holdsAt( appearance( id0 )=visible, 8480 ). holdsAt( appearance( id1 )=visible, 8480 ). holdsAt( appearance( id2 )=visible, 8480 ). % Frame number: 213 holdsAt( appearance( id0 )=visible, 8520 ). holdsAt( orientation( id1 )=151, 8520 ). holdsAt( appearance( id1 )=visible, 8520 ). holdsAt( appearance( id2 )=visible, 8520 ). % Frame number: 214 holdsAt( appearance( id0 )=visible, 8560 ). holdsAt( appearance( id1 )=visible, 8560 ). holdsAt( appearance( id2 )=visible, 8560 ). % Frame number: 215 holdsAt( appearance( id0 )=visible, 8600 ). holdsAt( orientation( id1 )=151, 8600 ). holdsAt( appearance( id1 )=visible, 8600 ). holdsAt( appearance( id2 )=visible, 8600 ). % Frame number: 216 holdsAt( appearance( id0 )=visible, 8640 ). holdsAt( appearance( id1 )=visible, 8640 ). holdsAt( appearance( id2 )=visible, 8640 ). % Frame number: 217 holdsAt( appearance( id0 )=visible, 8680 ). holdsAt( appearance( id1 )=visible, 8680 ). holdsAt( appearance( id2 )=visible, 8680 ). % Frame number: 218 holdsAt( appearance( id0 )=visible, 8720 ). holdsAt( appearance( id1 )=visible, 8720 ). holdsAt( appearance( id2 )=visible, 8720 ). % Frame number: 219 holdsAt( appearance( id0 )=visible, 8760 ). holdsAt( orientation( id1 )=151, 8760 ). holdsAt( appearance( id1 )=visible, 8760 ). holdsAt( appearance( id2 )=visible, 8760 ). % Frame number: 220 holdsAt( appearance( id0 )=visible, 8800 ). holdsAt( appearance( id1 )=visible, 8800 ). holdsAt( appearance( id2 )=visible, 8800 ). % Frame number: 221 holdsAt( appearance( id0 )=visible, 8840 ). holdsAt( appearance( id1 )=visible, 8840 ). holdsAt( appearance( id2 )=visible, 8840 ). % Frame number: 222 holdsAt( appearance( id0 )=visible, 8880 ). holdsAt( appearance( id1 )=visible, 8880 ). holdsAt( appearance( id2 )=visible, 8880 ). % Frame number: 223 holdsAt( appearance( id0 )=visible, 8920 ). holdsAt( appearance( id1 )=visible, 8920 ). holdsAt( appearance( id2 )=visible, 8920 ). % Frame number: 224 holdsAt( appearance( id0 )=visible, 8960 ). holdsAt( appearance( id1 )=visible, 8960 ). holdsAt( appearance( id2 )=visible, 8960 ). % Frame number: 225 holdsAt( appearance( id0 )=visible, 9000 ). holdsAt( appearance( id1 )=visible, 9000 ). holdsAt( orientation( id2 )=147, 9000 ). holdsAt( appearance( id2 )=visible, 9000 ). % Frame number: 226 holdsAt( appearance( id0 )=visible, 9040 ). holdsAt( appearance( id1 )=visible, 9040 ). holdsAt( appearance( id2 )=visible, 9040 ). % Frame number: 227 holdsAt( appearance( id0 )=visible, 9080 ). holdsAt( appearance( id1 )=visible, 9080 ). holdsAt( appearance( id2 )=visible, 9080 ). % Frame number: 228 holdsAt( appearance( id0 )=visible, 9120 ). holdsAt( appearance( id1 )=visible, 9120 ). holdsAt( appearance( id2 )=visible, 9120 ). % Frame number: 229 holdsAt( orientation( id0 )=126, 9160 ). holdsAt( appearance( id0 )=visible, 9160 ). holdsAt( appearance( id1 )=visible, 9160 ). holdsAt( appearance( id2 )=visible, 9160 ). % Frame number: 230 holdsAt( appearance( id0 )=visible, 9200 ). holdsAt( appearance( id1 )=visible, 9200 ). holdsAt( appearance( id2 )=visible, 9200 ). % Frame number: 231 holdsAt( orientation( id0 )=126, 9240 ). holdsAt( appearance( id0 )=visible, 9240 ). holdsAt( appearance( id1 )=visible, 9240 ). holdsAt( appearance( id2 )=visible, 9240 ). % Frame number: 232 holdsAt( appearance( id0 )=visible, 9280 ). holdsAt( appearance( id1 )=visible, 9280 ). holdsAt( appearance( id2 )=visible, 9280 ). % Frame number: 233 holdsAt( appearance( id0 )=visible, 9320 ). holdsAt( appearance( id1 )=visible, 9320 ). holdsAt( orientation( id2 )=147, 9320 ). holdsAt( appearance( id2 )=visible, 9320 ). % Frame number: 234 holdsAt( appearance( id0 )=disappear, 9360 ). holdsAt( appearance( id1 )=visible, 9360 ). holdsAt( appearance( id2 )=visible, 9360 ). % Frame number: 235 holdsAt( appearance( id1 )=visible, 9400 ). holdsAt( appearance( id2 )=visible, 9400 ). % Frame number: 236 holdsAt( appearance( id1 )=visible, 9440 ). holdsAt( appearance( id2 )=visible, 9440 ). % Frame number: 237 holdsAt( appearance( id1 )=visible, 9480 ). holdsAt( appearance( id2 )=visible, 9480 ). % Frame number: 238 holdsAt( appearance( id1 )=visible, 9520 ). holdsAt( appearance( id2 )=visible, 9520 ). % Frame number: 239 holdsAt( appearance( id1 )=visible, 9560 ). holdsAt( appearance( id2 )=visible, 9560 ). % Frame number: 240 holdsAt( appearance( id1 )=visible, 9600 ). holdsAt( appearance( id2 )=visible, 9600 ). % Frame number: 241 holdsAt( appearance( id1 )=visible, 9640 ). holdsAt( appearance( id2 )=visible, 9640 ). % Frame number: 242 holdsAt( appearance( id1 )=visible, 9680 ). holdsAt( appearance( id2 )=visible, 9680 ). % Frame number: 243 holdsAt( appearance( id1 )=visible, 9720 ). holdsAt( appearance( id2 )=visible, 9720 ). % Frame number: 244 holdsAt( appearance( id1 )=visible, 9760 ). holdsAt( appearance( id2 )=visible, 9760 ). % Frame number: 245 holdsAt( appearance( id1 )=visible, 9800 ). holdsAt( orientation( id2 )=149, 9800 ). holdsAt( appearance( id2 )=visible, 9800 ). % Frame number: 246 holdsAt( appearance( id1 )=visible, 9840 ). holdsAt( appearance( id2 )=visible, 9840 ). % Frame number: 247 holdsAt( appearance( id1 )=visible, 9880 ). holdsAt( appearance( id2 )=visible, 9880 ). % Frame number: 248 holdsAt( appearance( id1 )=visible, 9920 ). holdsAt( appearance( id2 )=visible, 9920 ). % Frame number: 249 holdsAt( appearance( id1 )=visible, 9960 ). holdsAt( appearance( id2 )=visible, 9960 ). % Frame number: 250 holdsAt( appearance( id1 )=visible, 10000 ). holdsAt( appearance( id2 )=visible, 10000 ). % Frame number: 251 holdsAt( appearance( id1 )=visible, 10040 ). holdsAt( appearance( id2 )=visible, 10040 ). % Frame number: 252 holdsAt( appearance( id1 )=visible, 10080 ). holdsAt( orientation( id2 )=149, 10080 ). holdsAt( appearance( id2 )=visible, 10080 ). % Frame number: 253 holdsAt( appearance( id1 )=visible, 10120 ). holdsAt( appearance( id2 )=visible, 10120 ). % Frame number: 254 holdsAt( appearance( id1 )=visible, 10160 ). holdsAt( appearance( id2 )=visible, 10160 ). % Frame number: 255 holdsAt( appearance( id1 )=visible, 10200 ). holdsAt( appearance( id2 )=visible, 10200 ). % Frame number: 256 holdsAt( orientation( id1 )=151, 10240 ). holdsAt( appearance( id1 )=visible, 10240 ). holdsAt( appearance( id2 )=visible, 10240 ). % Frame number: 257 holdsAt( appearance( id1 )=visible, 10280 ). holdsAt( appearance( id2 )=visible, 10280 ). % Frame number: 258 holdsAt( appearance( id1 )=visible, 10320 ). holdsAt( appearance( id2 )=visible, 10320 ). % Frame number: 259 holdsAt( appearance( id1 )=visible, 10360 ). holdsAt( appearance( id2 )=visible, 10360 ). % Frame number: 260 holdsAt( appearance( id1 )=visible, 10400 ). holdsAt( appearance( id2 )=visible, 10400 ). % Frame number: 261 holdsAt( appearance( id1 )=visible, 10440 ). holdsAt( appearance( id2 )=visible, 10440 ). % Frame number: 262 holdsAt( appearance( id1 )=visible, 10480 ). holdsAt( appearance( id2 )=visible, 10480 ). % Frame number: 263 holdsAt( appearance( id1 )=visible, 10520 ). holdsAt( orientation( id2 )=149, 10520 ). holdsAt( appearance( id2 )=visible, 10520 ). % Frame number: 264 holdsAt( appearance( id1 )=visible, 10560 ). holdsAt( appearance( id2 )=visible, 10560 ). % Frame number: 265 holdsAt( appearance( id1 )=visible, 10600 ). holdsAt( appearance( id2 )=visible, 10600 ). % Frame number: 266 holdsAt( appearance( id1 )=visible, 10640 ). holdsAt( appearance( id2 )=visible, 10640 ). % Frame number: 267 holdsAt( orientation( id1 )=151, 10680 ). holdsAt( appearance( id1 )=visible, 10680 ). holdsAt( appearance( id2 )=visible, 10680 ). % Frame number: 268 holdsAt( appearance( id1 )=visible, 10720 ). holdsAt( appearance( id2 )=visible, 10720 ). % Frame number: 269 holdsAt( appearance( id1 )=visible, 10760 ). holdsAt( appearance( id2 )=visible, 10760 ). % Frame number: 270 holdsAt( appearance( id1 )=visible, 10800 ). holdsAt( appearance( id2 )=visible, 10800 ). % Frame number: 271 holdsAt( appearance( id1 )=visible, 10840 ). holdsAt( appearance( id2 )=visible, 10840 ). % Frame number: 272 holdsAt( appearance( id1 )=visible, 10880 ). holdsAt( appearance( id2 )=visible, 10880 ). % Frame number: 273 holdsAt( appearance( id1 )=visible, 10920 ). holdsAt( appearance( id2 )=visible, 10920 ). % Frame number: 274 holdsAt( appearance( id1 )=visible, 10960 ). holdsAt( appearance( id2 )=visible, 10960 ). % Frame number: 275 holdsAt( appearance( id1 )=visible, 11000 ). holdsAt( orientation( id2 )=146, 11000 ). holdsAt( appearance( id2 )=visible, 11000 ). % Frame number: 276 holdsAt( appearance( id1 )=visible, 11040 ). holdsAt( appearance( id2 )=visible, 11040 ). % Frame number: 277 holdsAt( appearance( id1 )=visible, 11080 ). holdsAt( orientation( id2 )=146, 11080 ). holdsAt( appearance( id2 )=visible, 11080 ). % Frame number: 278 holdsAt( appearance( id1 )=visible, 11120 ). holdsAt( orientation( id2 )=146, 11120 ). holdsAt( appearance( id2 )=visible, 11120 ). % Frame number: 279 holdsAt( appearance( id1 )=visible, 11160 ). holdsAt( appearance( id2 )=visible, 11160 ). % Frame number: 280 holdsAt( appearance( id1 )=visible, 11200 ). holdsAt( appearance( id2 )=visible, 11200 ). % Frame number: 281 holdsAt( appearance( id1 )=visible, 11240 ). holdsAt( appearance( id2 )=visible, 11240 ). % Frame number: 282 holdsAt( appearance( id1 )=visible, 11280 ). holdsAt( appearance( id2 )=visible, 11280 ). % Frame number: 283 holdsAt( appearance( id1 )=visible, 11320 ). holdsAt( appearance( id2 )=visible, 11320 ). % Frame number: 284 holdsAt( appearance( id1 )=visible, 11360 ). holdsAt( appearance( id2 )=visible, 11360 ). % Frame number: 285 holdsAt( appearance( id1 )=visible, 11400 ). holdsAt( appearance( id2 )=visible, 11400 ). % Frame number: 286 holdsAt( orientation( id1 )=151, 11440 ). holdsAt( appearance( id1 )=visible, 11440 ). holdsAt( appearance( id2 )=visible, 11440 ). % Frame number: 287 holdsAt( appearance( id1 )=visible, 11480 ). holdsAt( appearance( id2 )=visible, 11480 ). % Frame number: 288 holdsAt( appearance( id1 )=visible, 11520 ). holdsAt( appearance( id2 )=visible, 11520 ). % Frame number: 289 holdsAt( orientation( id1 )=151, 11560 ). holdsAt( appearance( id1 )=visible, 11560 ). holdsAt( appearance( id2 )=visible, 11560 ). % Frame number: 290 holdsAt( appearance( id1 )=visible, 11600 ). holdsAt( appearance( id2 )=visible, 11600 ). % Frame number: 291 holdsAt( appearance( id1 )=visible, 11640 ). holdsAt( appearance( id2 )=visible, 11640 ). % Frame number: 292 holdsAt( appearance( id1 )=visible, 11680 ). holdsAt( appearance( id2 )=visible, 11680 ). % Frame number: 293 holdsAt( appearance( id1 )=visible, 11720 ). holdsAt( appearance( id2 )=visible, 11720 ). % Frame number: 294 holdsAt( appearance( id1 )=visible, 11760 ). holdsAt( orientation( id2 )=146, 11760 ). holdsAt( appearance( id2 )=visible, 11760 ). % Frame number: 295 holdsAt( orientation( id1 )=151, 11800 ). holdsAt( appearance( id1 )=visible, 11800 ). holdsAt( orientation( id2 )=146, 11800 ). holdsAt( appearance( id2 )=visible, 11800 ). % Frame number: 296 holdsAt( orientation( id1 )=151, 11840 ). holdsAt( appearance( id1 )=visible, 11840 ). holdsAt( appearance( id2 )=visible, 11840 ). % Frame number: 297 holdsAt( appearance( id1 )=visible, 11880 ). holdsAt( appearance( id2 )=visible, 11880 ). % Frame number: 298 holdsAt( appearance( id1 )=visible, 11920 ). holdsAt( appearance( id2 )=visible, 11920 ). % Frame number: 299 holdsAt( appearance( id1 )=visible, 11960 ). holdsAt( appearance( id2 )=visible, 11960 ). % Frame number: 300 holdsAt( orientation( id1 )=151, 12000 ). holdsAt( appearance( id1 )=visible, 12000 ). holdsAt( appearance( id2 )=visible, 12000 ). % Frame number: 301 holdsAt( appearance( id1 )=visible, 12040 ). holdsAt( appearance( id2 )=visible, 12040 ). % Frame number: 302 holdsAt( appearance( id1 )=visible, 12080 ). holdsAt( appearance( id2 )=visible, 12080 ). % Frame number: 303 holdsAt( appearance( id1 )=visible, 12120 ). holdsAt( appearance( id2 )=visible, 12120 ). % Frame number: 304 holdsAt( appearance( id1 )=visible, 12160 ). holdsAt( appearance( id2 )=visible, 12160 ). % Frame number: 305 holdsAt( appearance( id1 )=visible, 12200 ). holdsAt( appearance( id2 )=visible, 12200 ). % Frame number: 306 holdsAt( orientation( id1 )=151, 12240 ). holdsAt( appearance( id1 )=visible, 12240 ). holdsAt( appearance( id2 )=visible, 12240 ). % Frame number: 307 holdsAt( appearance( id1 )=visible, 12280 ). holdsAt( appearance( id2 )=visible, 12280 ). % Frame number: 308 holdsAt( appearance( id1 )=visible, 12320 ). holdsAt( appearance( id2 )=visible, 12320 ). % Frame number: 309 holdsAt( appearance( id1 )=visible, 12360 ). holdsAt( appearance( id2 )=visible, 12360 ). % Frame number: 310 holdsAt( appearance( id1 )=visible, 12400 ). holdsAt( appearance( id2 )=visible, 12400 ). % Frame number: 311 holdsAt( appearance( id1 )=visible, 12440 ). holdsAt( appearance( id2 )=visible, 12440 ). % Frame number: 312 holdsAt( appearance( id1 )=visible, 12480 ). holdsAt( appearance( id2 )=visible, 12480 ). % Frame number: 313 holdsAt( appearance( id1 )=visible, 12520 ). holdsAt( orientation( id2 )=146, 12520 ). holdsAt( appearance( id2 )=visible, 12520 ). % Frame number: 314 holdsAt( appearance( id1 )=visible, 12560 ). holdsAt( appearance( id2 )=visible, 12560 ). % Frame number: 315 holdsAt( appearance( id1 )=visible, 12600 ). holdsAt( appearance( id2 )=visible, 12600 ). % Frame number: 316 holdsAt( appearance( id1 )=visible, 12640 ). holdsAt( appearance( id2 )=visible, 12640 ). % Frame number: 317 holdsAt( appearance( id1 )=visible, 12680 ). holdsAt( appearance( id2 )=visible, 12680 ). % Frame number: 318 holdsAt( appearance( id1 )=visible, 12720 ). holdsAt( appearance( id2 )=visible, 12720 ). % Frame number: 319 holdsAt( orientation( id1 )=151, 12760 ). holdsAt( appearance( id1 )=visible, 12760 ). holdsAt( appearance( id2 )=visible, 12760 ). % Frame number: 320 holdsAt( appearance( id1 )=visible, 12800 ). holdsAt( appearance( id2 )=visible, 12800 ). % Frame number: 321 holdsAt( appearance( id1 )=visible, 12840 ). holdsAt( appearance( id2 )=visible, 12840 ). % Frame number: 322 holdsAt( orientation( id1 )=151, 12880 ). holdsAt( appearance( id1 )=visible, 12880 ). holdsAt( appearance( id2 )=visible, 12880 ). % Frame number: 323 holdsAt( appearance( id1 )=visible, 12920 ). holdsAt( orientation( id2 )=146, 12920 ). holdsAt( appearance( id2 )=visible, 12920 ). % Frame number: 324 holdsAt( appearance( id1 )=visible, 12960 ). holdsAt( appearance( id2 )=visible, 12960 ). % Frame number: 325 holdsAt( appearance( id1 )=visible, 13000 ). holdsAt( appearance( id2 )=visible, 13000 ). % Frame number: 326 holdsAt( appearance( id1 )=visible, 13040 ). holdsAt( appearance( id2 )=visible, 13040 ). % Frame number: 327 holdsAt( appearance( id1 )=visible, 13080 ). holdsAt( appearance( id2 )=visible, 13080 ). % Frame number: 328 holdsAt( appearance( id1 )=visible, 13120 ). holdsAt( appearance( id2 )=visible, 13120 ). % Frame number: 329 holdsAt( appearance( id1 )=visible, 13160 ). holdsAt( appearance( id2 )=visible, 13160 ). % Frame number: 330 holdsAt( appearance( id1 )=visible, 13200 ). holdsAt( appearance( id2 )=visible, 13200 ). % Frame number: 331 holdsAt( appearance( id1 )=visible, 13240 ). holdsAt( appearance( id2 )=visible, 13240 ). % Frame number: 332 holdsAt( appearance( id1 )=visible, 13280 ). holdsAt( appearance( id2 )=visible, 13280 ). % Frame number: 333 holdsAt( appearance( id1 )=visible, 13320 ). holdsAt( appearance( id2 )=visible, 13320 ). % Frame number: 334 holdsAt( appearance( id1 )=visible, 13360 ). holdsAt( orientation( id2 )=146, 13360 ). holdsAt( appearance( id2 )=visible, 13360 ). % Frame number: 335 holdsAt( appearance( id1 )=visible, 13400 ). holdsAt( appearance( id2 )=visible, 13400 ). % Frame number: 336 holdsAt( appearance( id1 )=visible, 13440 ). holdsAt( orientation( id2 )=146, 13440 ). holdsAt( appearance( id2 )=visible, 13440 ). % Frame number: 337 holdsAt( appearance( id1 )=visible, 13480 ). holdsAt( appearance( id2 )=visible, 13480 ). % Frame number: 338 holdsAt( appearance( id1 )=visible, 13520 ). holdsAt( appearance( id2 )=visible, 13520 ). % Frame number: 339 holdsAt( orientation( id1 )=151, 13560 ). holdsAt( appearance( id1 )=visible, 13560 ). holdsAt( appearance( id2 )=visible, 13560 ). % Frame number: 340 holdsAt( appearance( id1 )=visible, 13600 ). holdsAt( appearance( id2 )=visible, 13600 ). % Frame number: 341 holdsAt( appearance( id1 )=visible, 13640 ). holdsAt( appearance( id2 )=visible, 13640 ). % Frame number: 342 holdsAt( appearance( id1 )=visible, 13680 ). holdsAt( appearance( id2 )=visible, 13680 ). % Frame number: 343 holdsAt( appearance( id1 )=visible, 13720 ). holdsAt( appearance( id2 )=visible, 13720 ). % Frame number: 344 holdsAt( appearance( id1 )=visible, 13760 ). holdsAt( appearance( id2 )=visible, 13760 ). % Frame number: 345 holdsAt( appearance( id1 )=visible, 13800 ). holdsAt( appearance( id2 )=visible, 13800 ). % Frame number: 346 holdsAt( appearance( id1 )=visible, 13840 ). holdsAt( appearance( id2 )=visible, 13840 ). % Frame number: 347 holdsAt( appearance( id1 )=visible, 13880 ). holdsAt( appearance( id2 )=visible, 13880 ). % Frame number: 348 holdsAt( appearance( id1 )=visible, 13920 ). holdsAt( appearance( id2 )=visible, 13920 ). % Frame number: 349 holdsAt( appearance( id1 )=visible, 13960 ). holdsAt( orientation( id2 )=146, 13960 ). holdsAt( appearance( id2 )=visible, 13960 ). % Frame number: 350 holdsAt( appearance( id1 )=visible, 14000 ). holdsAt( appearance( id2 )=visible, 14000 ). % Frame number: 351 holdsAt( appearance( id1 )=visible, 14040 ). holdsAt( appearance( id2 )=visible, 14040 ). % Frame number: 352 holdsAt( appearance( id1 )=visible, 14080 ). holdsAt( appearance( id2 )=visible, 14080 ). % Frame number: 353 holdsAt( appearance( id1 )=visible, 14120 ). holdsAt( appearance( id2 )=visible, 14120 ). % Frame number: 354 holdsAt( appearance( id1 )=visible, 14160 ). holdsAt( appearance( id2 )=visible, 14160 ). % Frame number: 355 holdsAt( appearance( id1 )=visible, 14200 ). holdsAt( appearance( id2 )=visible, 14200 ). % Frame number: 356 holdsAt( appearance( id1 )=visible, 14240 ). holdsAt( appearance( id2 )=visible, 14240 ). % Frame number: 357 holdsAt( appearance( id1 )=visible, 14280 ). holdsAt( appearance( id2 )=visible, 14280 ). % Frame number: 358 holdsAt( appearance( id1 )=visible, 14320 ). holdsAt( appearance( id2 )=visible, 14320 ). % Frame number: 359 holdsAt( orientation( id1 )=151, 14360 ). holdsAt( appearance( id1 )=visible, 14360 ). holdsAt( appearance( id2 )=visible, 14360 ). % Frame number: 360 holdsAt( orientation( id1 )=151, 14400 ). holdsAt( appearance( id1 )=visible, 14400 ). holdsAt( appearance( id2 )=visible, 14400 ). % Frame number: 361 holdsAt( appearance( id1 )=visible, 14440 ). holdsAt( appearance( id2 )=visible, 14440 ). % Frame number: 362 holdsAt( appearance( id1 )=visible, 14480 ). holdsAt( appearance( id2 )=visible, 14480 ). % Frame number: 363 holdsAt( appearance( id1 )=visible, 14520 ). holdsAt( orientation( id2 )=146, 14520 ). holdsAt( appearance( id2 )=visible, 14520 ). % Frame number: 364 holdsAt( appearance( id1 )=visible, 14560 ). holdsAt( appearance( id2 )=visible, 14560 ). % Frame number: 365 holdsAt( appearance( id1 )=visible, 14600 ). holdsAt( appearance( id2 )=visible, 14600 ). % Frame number: 366 holdsAt( appearance( id1 )=visible, 14640 ). holdsAt( orientation( id2 )=146, 14640 ). holdsAt( appearance( id2 )=visible, 14640 ). % Frame number: 367 holdsAt( appearance( id1 )=visible, 14680 ). holdsAt( appearance( id2 )=visible, 14680 ). % Frame number: 368 holdsAt( appearance( id1 )=visible, 14720 ). holdsAt( appearance( id2 )=visible, 14720 ). % Frame number: 369 holdsAt( appearance( id1 )=visible, 14760 ). holdsAt( appearance( id2 )=visible, 14760 ). % Frame number: 370 holdsAt( appearance( id1 )=visible, 14800 ). holdsAt( appearance( id2 )=visible, 14800 ). % Frame number: 371 holdsAt( appearance( id1 )=visible, 14840 ). holdsAt( appearance( id2 )=visible, 14840 ). % Frame number: 372 holdsAt( appearance( id1 )=visible, 14880 ). holdsAt( appearance( id2 )=visible, 14880 ). % Frame number: 373 holdsAt( appearance( id1 )=visible, 14920 ). holdsAt( orientation( id2 )=144, 14920 ). holdsAt( appearance( id2 )=visible, 14920 ). % Frame number: 374 holdsAt( orientation( id1 )=151, 14960 ). holdsAt( appearance( id1 )=visible, 14960 ). holdsAt( appearance( id2 )=visible, 14960 ). % Frame number: 375 holdsAt( orientation( id1 )=151, 15000 ). holdsAt( appearance( id1 )=visible, 15000 ). holdsAt( appearance( id2 )=visible, 15000 ). % Frame number: 376 holdsAt( appearance( id1 )=visible, 15040 ). holdsAt( appearance( id2 )=visible, 15040 ). % Frame number: 377 holdsAt( appearance( id1 )=visible, 15080 ). holdsAt( appearance( id2 )=visible, 15080 ). % Frame number: 378 holdsAt( appearance( id1 )=visible, 15120 ). holdsAt( appearance( id2 )=visible, 15120 ). % Frame number: 379 holdsAt( appearance( id1 )=visible, 15160 ). holdsAt( appearance( id2 )=visible, 15160 ). % Frame number: 380 holdsAt( appearance( id1 )=visible, 15200 ). holdsAt( appearance( id2 )=visible, 15200 ). % Frame number: 381 holdsAt( appearance( id1 )=visible, 15240 ). holdsAt( appearance( id2 )=visible, 15240 ). % Frame number: 382 holdsAt( appearance( id1 )=visible, 15280 ). holdsAt( appearance( id2 )=visible, 15280 ). % Frame number: 383 holdsAt( appearance( id1 )=visible, 15320 ). holdsAt( appearance( id2 )=visible, 15320 ). % Frame number: 384 holdsAt( appearance( id1 )=visible, 15360 ). holdsAt( appearance( id2 )=visible, 15360 ). % Frame number: 385 holdsAt( appearance( id1 )=visible, 15400 ). holdsAt( orientation( id2 )=144, 15400 ). holdsAt( appearance( id2 )=visible, 15400 ). % Frame number: 386 holdsAt( appearance( id1 )=visible, 15440 ). holdsAt( appearance( id2 )=visible, 15440 ). % Frame number: 387 holdsAt( orientation( id1 )=151, 15480 ). holdsAt( appearance( id1 )=visible, 15480 ). holdsAt( appearance( id2 )=visible, 15480 ). % Frame number: 388 holdsAt( appearance( id1 )=visible, 15520 ). holdsAt( appearance( id2 )=visible, 15520 ). % Frame number: 389 holdsAt( appearance( id1 )=visible, 15560 ). holdsAt( appearance( id2 )=visible, 15560 ). % Frame number: 390 holdsAt( appearance( id1 )=visible, 15600 ). holdsAt( appearance( id2 )=visible, 15600 ). % Frame number: 391 holdsAt( appearance( id1 )=visible, 15640 ). holdsAt( orientation( id2 )=144, 15640 ). holdsAt( appearance( id2 )=visible, 15640 ). % Frame number: 392 holdsAt( appearance( id1 )=visible, 15680 ). holdsAt( appearance( id2 )=visible, 15680 ). % Frame number: 393 holdsAt( appearance( id1 )=visible, 15720 ). holdsAt( appearance( id2 )=visible, 15720 ). % Frame number: 394 holdsAt( appearance( id1 )=visible, 15760 ). holdsAt( appearance( id2 )=visible, 15760 ). % Frame number: 395 holdsAt( appearance( id1 )=visible, 15800 ). holdsAt( appearance( id2 )=visible, 15800 ). % Frame number: 396 holdsAt( appearance( id1 )=visible, 15840 ). holdsAt( orientation( id2 )=144, 15840 ). holdsAt( appearance( id2 )=visible, 15840 ). % Frame number: 397 holdsAt( appearance( id1 )=visible, 15880 ). holdsAt( appearance( id2 )=visible, 15880 ). % Frame number: 398 holdsAt( appearance( id1 )=visible, 15920 ). holdsAt( appearance( id2 )=visible, 15920 ). % Frame number: 399 holdsAt( appearance( id1 )=visible, 15960 ). holdsAt( appearance( id2 )=visible, 15960 ). % Frame number: 400 holdsAt( appearance( id1 )=visible, 16000 ). holdsAt( orientation( id2 )=144, 16000 ). holdsAt( appearance( id2 )=visible, 16000 ). % Frame number: 401 holdsAt( appearance( id1 )=visible, 16040 ). holdsAt( appearance( id2 )=visible, 16040 ). % Frame number: 402 holdsAt( appearance( id1 )=visible, 16080 ). holdsAt( appearance( id2 )=visible, 16080 ). % Frame number: 403 holdsAt( appearance( id1 )=visible, 16120 ). holdsAt( appearance( id2 )=visible, 16120 ). % Frame number: 404 holdsAt( appearance( id1 )=visible, 16160 ). holdsAt( appearance( id2 )=visible, 16160 ). % Frame number: 405 holdsAt( orientation( id1 )=151, 16200 ). holdsAt( appearance( id1 )=visible, 16200 ). holdsAt( appearance( id2 )=visible, 16200 ). % Frame number: 406 holdsAt( appearance( id1 )=visible, 16240 ). holdsAt( appearance( id2 )=visible, 16240 ). % Frame number: 407 holdsAt( appearance( id1 )=visible, 16280 ). holdsAt( orientation( id2 )=144, 16280 ). holdsAt( appearance( id2 )=visible, 16280 ). % Frame number: 408 holdsAt( orientation( id1 )=151, 16320 ). holdsAt( appearance( id1 )=visible, 16320 ). holdsAt( appearance( id2 )=visible, 16320 ). % Frame number: 409 holdsAt( appearance( id1 )=visible, 16360 ). holdsAt( appearance( id2 )=visible, 16360 ). % Frame number: 410 holdsAt( appearance( id1 )=visible, 16400 ). holdsAt( appearance( id2 )=visible, 16400 ). % Frame number: 411 holdsAt( appearance( id1 )=visible, 16440 ). holdsAt( appearance( id2 )=visible, 16440 ). % Frame number: 412 holdsAt( appearance( id1 )=visible, 16480 ). holdsAt( appearance( id2 )=visible, 16480 ). % Frame number: 413 holdsAt( appearance( id1 )=visible, 16520 ). holdsAt( appearance( id2 )=visible, 16520 ). % Frame number: 414 holdsAt( appearance( id1 )=visible, 16560 ). holdsAt( appearance( id2 )=visible, 16560 ). % Frame number: 415 holdsAt( appearance( id1 )=visible, 16600 ). holdsAt( appearance( id2 )=visible, 16600 ). % Frame number: 416 holdsAt( appearance( id1 )=visible, 16640 ). holdsAt( appearance( id2 )=visible, 16640 ). % Frame number: 417 holdsAt( appearance( id1 )=visible, 16680 ). holdsAt( appearance( id2 )=visible, 16680 ). % Frame number: 418 holdsAt( appearance( id1 )=visible, 16720 ). holdsAt( orientation( id2 )=144, 16720 ). holdsAt( appearance( id2 )=visible, 16720 ). % Frame number: 419 holdsAt( appearance( id1 )=visible, 16760 ). holdsAt( appearance( id2 )=visible, 16760 ). % Frame number: 420 holdsAt( appearance( id1 )=visible, 16800 ). holdsAt( appearance( id2 )=visible, 16800 ). % Frame number: 421 holdsAt( appearance( id1 )=visible, 16840 ). holdsAt( appearance( id2 )=visible, 16840 ). % Frame number: 422 holdsAt( appearance( id1 )=visible, 16880 ). holdsAt( appearance( id2 )=visible, 16880 ). % Frame number: 423 holdsAt( appearance( id1 )=visible, 16920 ). holdsAt( appearance( id2 )=visible, 16920 ). % Frame number: 424 holdsAt( appearance( id1 )=visible, 16960 ). holdsAt( appearance( id2 )=visible, 16960 ). % Frame number: 425 holdsAt( appearance( id1 )=visible, 17000 ). holdsAt( appearance( id2 )=visible, 17000 ). % Frame number: 426 holdsAt( appearance( id1 )=visible, 17040 ). holdsAt( appearance( id2 )=visible, 17040 ). % Frame number: 427 holdsAt( orientation( id1 )=162, 17080 ). holdsAt( appearance( id1 )=visible, 17080 ). holdsAt( appearance( id2 )=visible, 17080 ). % Frame number: 428 holdsAt( appearance( id1 )=visible, 17120 ). holdsAt( appearance( id2 )=visible, 17120 ). % Frame number: 429 holdsAt( appearance( id1 )=visible, 17160 ). holdsAt( appearance( id2 )=visible, 17160 ). % Frame number: 430 holdsAt( appearance( id1 )=visible, 17200 ). holdsAt( appearance( id2 )=visible, 17200 ). % Frame number: 431 holdsAt( appearance( id1 )=visible, 17240 ). holdsAt( appearance( id2 )=visible, 17240 ). % Frame number: 432 holdsAt( appearance( id1 )=visible, 17280 ). holdsAt( appearance( id2 )=visible, 17280 ). % Frame number: 433 holdsAt( appearance( id1 )=visible, 17320 ). holdsAt( appearance( id2 )=visible, 17320 ). % Frame number: 434 holdsAt( appearance( id1 )=visible, 17360 ). holdsAt( appearance( id2 )=visible, 17360 ). % Frame number: 435 holdsAt( appearance( id1 )=visible, 17400 ). holdsAt( appearance( id2 )=visible, 17400 ). % Frame number: 436 holdsAt( appearance( id1 )=visible, 17440 ). holdsAt( orientation( id2 )=144, 17440 ). holdsAt( appearance( id2 )=visible, 17440 ). % Frame number: 437 holdsAt( appearance( id1 )=visible, 17480 ). holdsAt( appearance( id2 )=visible, 17480 ). % Frame number: 438 holdsAt( appearance( id1 )=visible, 17520 ). holdsAt( appearance( id2 )=visible, 17520 ). % Frame number: 439 holdsAt( appearance( id1 )=visible, 17560 ). holdsAt( appearance( id2 )=visible, 17560 ). % Frame number: 440 holdsAt( appearance( id1 )=visible, 17600 ). holdsAt( appearance( id2 )=visible, 17600 ). % Frame number: 441 holdsAt( appearance( id1 )=visible, 17640 ). holdsAt( appearance( id2 )=visible, 17640 ). % Frame number: 442 holdsAt( appearance( id1 )=visible, 17680 ). holdsAt( appearance( id2 )=visible, 17680 ). % Frame number: 443 holdsAt( appearance( id1 )=visible, 17720 ). holdsAt( orientation( id2 )=146, 17720 ). holdsAt( appearance( id2 )=visible, 17720 ). % Frame number: 444 holdsAt( appearance( id1 )=visible, 17760 ). holdsAt( appearance( id2 )=visible, 17760 ). % Frame number: 445 holdsAt( appearance( id1 )=visible, 17800 ). holdsAt( appearance( id2 )=visible, 17800 ). % Frame number: 446 holdsAt( appearance( id1 )=visible, 17840 ). holdsAt( appearance( id2 )=visible, 17840 ). % Frame number: 447 holdsAt( appearance( id1 )=visible, 17880 ). holdsAt( appearance( id2 )=visible, 17880 ). % Frame number: 448 holdsAt( appearance( id1 )=visible, 17920 ). holdsAt( appearance( id2 )=visible, 17920 ). % Frame number: 449 holdsAt( appearance( id1 )=visible, 17960 ). holdsAt( appearance( id2 )=visible, 17960 ). % Frame number: 450 holdsAt( appearance( id1 )=visible, 18000 ). holdsAt( appearance( id2 )=visible, 18000 ). % Frame number: 451 holdsAt( appearance( id1 )=visible, 18040 ). holdsAt( appearance( id2 )=visible, 18040 ). % Frame number: 452 holdsAt( appearance( id1 )=visible, 18080 ). holdsAt( appearance( id2 )=visible, 18080 ). % Frame number: 453 holdsAt( appearance( id1 )=visible, 18120 ). holdsAt( appearance( id2 )=visible, 18120 ). % Frame number: 454 holdsAt( appearance( id1 )=visible, 18160 ). holdsAt( appearance( id2 )=visible, 18160 ). % Frame number: 455 holdsAt( appearance( id1 )=visible, 18200 ). holdsAt( appearance( id2 )=visible, 18200 ). % Frame number: 456 holdsAt( appearance( id1 )=visible, 18240 ). holdsAt( appearance( id2 )=visible, 18240 ). % Frame number: 457 holdsAt( appearance( id1 )=visible, 18280 ). holdsAt( appearance( id2 )=visible, 18280 ). % Frame number: 458 holdsAt( appearance( id1 )=visible, 18320 ). holdsAt( appearance( id2 )=visible, 18320 ). % Frame number: 459 holdsAt( appearance( id1 )=visible, 18360 ). holdsAt( appearance( id2 )=visible, 18360 ). % Frame number: 460 holdsAt( appearance( id1 )=visible, 18400 ). holdsAt( appearance( id2 )=visible, 18400 ). % Frame number: 461 holdsAt( appearance( id1 )=visible, 18440 ). holdsAt( appearance( id2 )=visible, 18440 ). % Frame number: 462 holdsAt( appearance( id1 )=visible, 18480 ). holdsAt( appearance( id2 )=visible, 18480 ). % Frame number: 463 holdsAt( appearance( id1 )=visible, 18520 ). holdsAt( appearance( id2 )=visible, 18520 ). % Frame number: 464 holdsAt( appearance( id1 )=visible, 18560 ). holdsAt( appearance( id2 )=visible, 18560 ). % Frame number: 465 holdsAt( appearance( id1 )=visible, 18600 ). holdsAt( appearance( id2 )=visible, 18600 ). % Frame number: 466 holdsAt( appearance( id1 )=visible, 18640 ). holdsAt( appearance( id2 )=visible, 18640 ). % Frame number: 467 holdsAt( appearance( id1 )=visible, 18680 ). holdsAt( orientation( id2 )=146, 18680 ). holdsAt( appearance( id2 )=visible, 18680 ). % Frame number: 468 holdsAt( appearance( id1 )=visible, 18720 ). holdsAt( appearance( id2 )=visible, 18720 ). % Frame number: 469 holdsAt( appearance( id1 )=visible, 18760 ). holdsAt( appearance( id2 )=visible, 18760 ). % Frame number: 470 holdsAt( appearance( id1 )=visible, 18800 ). holdsAt( appearance( id2 )=visible, 18800 ). % Frame number: 471 holdsAt( appearance( id1 )=visible, 18840 ). holdsAt( appearance( id2 )=visible, 18840 ). % Frame number: 472 holdsAt( appearance( id1 )=visible, 18880 ). holdsAt( appearance( id2 )=visible, 18880 ). % Frame number: 473 holdsAt( orientation( id1 )=12, 18920 ). holdsAt( appearance( id1 )=visible, 18920 ). holdsAt( appearance( id2 )=visible, 18920 ). % Frame number: 474 holdsAt( orientation( id1 )=12, 18960 ). holdsAt( appearance( id1 )=visible, 18960 ). holdsAt( appearance( id2 )=visible, 18960 ). % Frame number: 475 holdsAt( appearance( id1 )=visible, 19000 ). holdsAt( appearance( id2 )=visible, 19000 ). % Frame number: 476 holdsAt( orientation( id1 )=12, 19040 ). holdsAt( appearance( id1 )=visible, 19040 ). holdsAt( appearance( id2 )=visible, 19040 ). % Frame number: 477 holdsAt( appearance( id1 )=visible, 19080 ). holdsAt( appearance( id2 )=visible, 19080 ). % Frame number: 478 holdsAt( appearance( id1 )=visible, 19120 ). holdsAt( orientation( id2 )=160, 19120 ). holdsAt( appearance( id2 )=visible, 19120 ). % Frame number: 479 holdsAt( appearance( id1 )=visible, 19160 ). holdsAt( appearance( id2 )=visible, 19160 ). % Frame number: 480 holdsAt( appearance( id1 )=visible, 19200 ). holdsAt( appearance( id2 )=visible, 19200 ). % Frame number: 481 holdsAt( appearance( id1 )=visible, 19240 ). holdsAt( appearance( id2 )=visible, 19240 ). % Frame number: 482 holdsAt( appearance( id1 )=visible, 19280 ). holdsAt( appearance( id2 )=visible, 19280 ). % Frame number: 483 holdsAt( appearance( id1 )=visible, 19320 ). holdsAt( appearance( id2 )=visible, 19320 ). % Frame number: 484 holdsAt( appearance( id1 )=visible, 19360 ). holdsAt( appearance( id2 )=visible, 19360 ). % Frame number: 485 holdsAt( appearance( id1 )=visible, 19400 ). holdsAt( appearance( id2 )=visible, 19400 ). % Frame number: 486 holdsAt( appearance( id1 )=visible, 19440 ). holdsAt( appearance( id2 )=visible, 19440 ). % Frame number: 487 holdsAt( orientation( id1 )=12, 19480 ). holdsAt( appearance( id1 )=visible, 19480 ). holdsAt( appearance( id2 )=visible, 19480 ). % Frame number: 488 holdsAt( appearance( id1 )=visible, 19520 ). holdsAt( appearance( id2 )=visible, 19520 ). % Frame number: 489 holdsAt( appearance( id1 )=visible, 19560 ). holdsAt( appearance( id2 )=visible, 19560 ). % Frame number: 490 holdsAt( appearance( id1 )=visible, 19600 ). holdsAt( appearance( id2 )=visible, 19600 ). % Frame number: 491 holdsAt( orientation( id1 )=23, 19640 ). holdsAt( appearance( id1 )=visible, 19640 ). holdsAt( appearance( id2 )=visible, 19640 ). % Frame number: 492 holdsAt( appearance( id1 )=visible, 19680 ). holdsAt( appearance( id2 )=visible, 19680 ). % Frame number: 493 holdsAt( appearance( id1 )=visible, 19720 ). holdsAt( appearance( id2 )=visible, 19720 ). % Frame number: 494 holdsAt( appearance( id1 )=visible, 19760 ). holdsAt( appearance( id2 )=visible, 19760 ). % Frame number: 495 holdsAt( appearance( id1 )=visible, 19800 ). holdsAt( appearance( id2 )=visible, 19800 ). % Frame number: 496 holdsAt( appearance( id1 )=visible, 19840 ). holdsAt( appearance( id2 )=visible, 19840 ). % Frame number: 497 holdsAt( appearance( id1 )=visible, 19880 ). holdsAt( appearance( id2 )=visible, 19880 ). % Frame number: 498 holdsAt( appearance( id1 )=visible, 19920 ). holdsAt( appearance( id2 )=visible, 19920 ). % Frame number: 499 holdsAt( appearance( id1 )=visible, 19960 ). holdsAt( appearance( id2 )=visible, 19960 ). % Frame number: 500 holdsAt( appearance( id1 )=visible, 20000 ). holdsAt( appearance( id2 )=visible, 20000 ). % Frame number: 501 holdsAt( appearance( id1 )=visible, 20040 ). holdsAt( appearance( id2 )=visible, 20040 ). % Frame number: 502 holdsAt( appearance( id1 )=visible, 20080 ). holdsAt( appearance( id2 )=visible, 20080 ). % Frame number: 503 holdsAt( appearance( id1 )=visible, 20120 ). holdsAt( appearance( id2 )=visible, 20120 ). % Frame number: 504 holdsAt( appearance( id1 )=visible, 20160 ). holdsAt( appearance( id2 )=visible, 20160 ). % Frame number: 505 holdsAt( appearance( id1 )=visible, 20200 ). holdsAt( appearance( id2 )=visible, 20200 ). % Frame number: 506 holdsAt( appearance( id1 )=visible, 20240 ). holdsAt( appearance( id2 )=visible, 20240 ). % Frame number: 507 holdsAt( appearance( id1 )=visible, 20280 ). holdsAt( appearance( id2 )=visible, 20280 ). % Frame number: 508 holdsAt( appearance( id1 )=visible, 20320 ). holdsAt( appearance( id2 )=visible, 20320 ). % Frame number: 509 holdsAt( appearance( id1 )=visible, 20360 ). holdsAt( appearance( id2 )=visible, 20360 ). % Frame number: 510 holdsAt( orientation( id1 )=65, 20400 ). holdsAt( appearance( id1 )=visible, 20400 ). holdsAt( appearance( id2 )=visible, 20400 ). % Frame number: 511 holdsAt( appearance( id1 )=visible, 20440 ). holdsAt( appearance( id2 )=visible, 20440 ). % Frame number: 512 holdsAt( appearance( id1 )=visible, 20480 ). holdsAt( appearance( id2 )=visible, 20480 ). % Frame number: 513 holdsAt( appearance( id1 )=visible, 20520 ). holdsAt( appearance( id2 )=visible, 20520 ). % Frame number: 514 holdsAt( appearance( id1 )=visible, 20560 ). holdsAt( appearance( id2 )=visible, 20560 ). % Frame number: 515 holdsAt( appearance( id1 )=visible, 20600 ). holdsAt( appearance( id2 )=visible, 20600 ). % Frame number: 516 holdsAt( appearance( id1 )=disappear, 20640 ). holdsAt( appearance( id2 )=visible, 20640 ). % Frame number: 517 holdsAt( appearance( id2 )=visible, 20680 ). % Frame number: 518 holdsAt( appearance( id2 )=visible, 20720 ). % Frame number: 519 holdsAt( appearance( id2 )=visible, 20760 ). % Frame number: 520 holdsAt( appearance( id2 )=visible, 20800 ). % Frame number: 521 holdsAt( appearance( id2 )=visible, 20840 ). % Frame number: 522 holdsAt( appearance( id2 )=visible, 20880 ). % Frame number: 523 holdsAt( appearance( id2 )=visible, 20920 ). % Frame number: 524 holdsAt( appearance( id2 )=visible, 20960 ). % Frame number: 525 holdsAt( appearance( id2 )=visible, 21000 ). % Frame number: 526 holdsAt( appearance( id2 )=visible, 21040 ). % Frame number: 527 holdsAt( appearance( id2 )=visible, 21080 ). % Frame number: 528 holdsAt( appearance( id2 )=visible, 21120 ). % Frame number: 529 holdsAt( appearance( id2 )=visible, 21160 ). % Frame number: 530 holdsAt( appearance( id2 )=visible, 21200 ). % Frame number: 531 holdsAt( appearance( id2 )=visible, 21240 ). % Frame number: 532 holdsAt( appearance( id2 )=visible, 21280 ). % Frame number: 533 holdsAt( appearance( id2 )=visible, 21320 ). % Frame number: 534 holdsAt( appearance( id2 )=visible, 21360 ). % Frame number: 535 holdsAt( orientation( id2 )=10, 21400 ). holdsAt( appearance( id2 )=visible, 21400 ). % Frame number: 536 holdsAt( appearance( id2 )=visible, 21440 ). % Frame number: 537 holdsAt( appearance( id2 )=visible, 21480 ). % Frame number: 538 holdsAt( appearance( id2 )=visible, 21520 ). % Frame number: 539 holdsAt( appearance( id2 )=visible, 21560 ). % Frame number: 540 holdsAt( appearance( id2 )=visible, 21600 ). % Frame number: 541 holdsAt( appearance( id2 )=visible, 21640 ). % Frame number: 542 holdsAt( orientation( id2 )=10, 21680 ). holdsAt( appearance( id2 )=visible, 21680 ). % Frame number: 543 holdsAt( appearance( id2 )=visible, 21720 ). % Frame number: 544 holdsAt( appearance( id2 )=visible, 21760 ). % Frame number: 545 holdsAt( appearance( id2 )=visible, 21800 ). % Frame number: 546 holdsAt( appearance( id2 )=visible, 21840 ). % Frame number: 547 holdsAt( appearance( id2 )=visible, 21880 ). % Frame number: 548 holdsAt( appearance( id2 )=visible, 21920 ). % Frame number: 549 holdsAt( orientation( id2 )=16, 21960 ). holdsAt( appearance( id2 )=visible, 21960 ). % Frame number: 550 holdsAt( appearance( id2 )=visible, 22000 ). % Frame number: 551 holdsAt( appearance( id2 )=visible, 22040 ). % Frame number: 552 holdsAt( appearance( id2 )=visible, 22080 ). % Frame number: 553 holdsAt( appearance( id2 )=visible, 22120 ). % Frame number: 554 holdsAt( orientation( id2 )=32, 22160 ). holdsAt( appearance( id2 )=visible, 22160 ). % Frame number: 555 holdsAt( appearance( id2 )=visible, 22200 ). % Frame number: 556 holdsAt( appearance( id2 )=visible, 22240 ). % Frame number: 557 holdsAt( appearance( id2 )=visible, 22280 ). % Frame number: 558 holdsAt( appearance( id2 )=visible, 22320 ). % Frame number: 559 holdsAt( appearance( id2 )=visible, 22360 ). % Frame number: 560 holdsAt( appearance( id2 )=visible, 22400 ). % Frame number: 561 holdsAt( appearance( id2 )=visible, 22440 ). % Frame number: 562 holdsAt( appearance( id2 )=visible, 22480 ). % Frame number: 563 holdsAt( appearance( id2 )=visible, 22520 ). % Frame number: 564 holdsAt( appearance( id2 )=visible, 22560 ). % Frame number: 565 holdsAt( orientation( id2 )=38, 22600 ). holdsAt( appearance( id2 )=visible, 22600 ). % Frame number: 566 holdsAt( appearance( id2 )=visible, 22640 ). % Frame number: 567 holdsAt( appearance( id2 )=visible, 22680 ). % Frame number: 568 holdsAt( appearance( id2 )=visible, 22720 ). % Frame number: 569 holdsAt( appearance( id2 )=visible, 22760 ). % Frame number: 570 holdsAt( appearance( id2 )=visible, 22800 ). % Frame number: 571 holdsAt( appearance( id2 )=visible, 22840 ). % Frame number: 572 holdsAt( appearance( id2 )=visible, 22880 ). % Frame number: 573 holdsAt( appearance( id2 )=visible, 22920 ). % Frame number: 574 holdsAt( appearance( id2 )=visible, 22960 ). % Frame number: 575 holdsAt( appearance( id2 )=visible, 23000 ). % Frame number: 576 holdsAt( appearance( id2 )=visible, 23040 ). % Frame number: 577 holdsAt( appearance( id2 )=visible, 23080 ). % Frame number: 578 holdsAt( appearance( id2 )=visible, 23120 ). % Frame number: 579 holdsAt( appearance( id2 )=visible, 23160 ). % Frame number: 580 holdsAt( appearance( id2 )=visible, 23200 ). % Frame number: 581 holdsAt( appearance( id2 )=visible, 23240 ). % Frame number: 582 holdsAt( appearance( id2 )=visible, 23280 ). % Frame number: 583 holdsAt( appearance( id2 )=visible, 23320 ). % Frame number: 584 holdsAt( appearance( id2 )=disappear, 23360 ). % Frame number: 757 holdsAt( appearance( id3 )=appear, 30280 ). % Frame number: 758 holdsAt( appearance( id3 )=visible, 30320 ). % Frame number: 759 holdsAt( appearance( id3 )=visible, 30360 ). % Frame number: 760 holdsAt( appearance( id3 )=visible, 30400 ). % Frame number: 761 holdsAt( appearance( id3 )=visible, 30440 ). % Frame number: 762 holdsAt( appearance( id3 )=visible, 30480 ). % Frame number: 763 holdsAt( appearance( id3 )=visible, 30520 ). % Frame number: 764 holdsAt( appearance( id3 )=visible, 30560 ). % Frame number: 765 holdsAt( appearance( id3 )=visible, 30600 ). % Frame number: 766 holdsAt( appearance( id3 )=visible, 30640 ). % Frame number: 767 holdsAt( appearance( id3 )=visible, 30680 ). % Frame number: 768 holdsAt( appearance( id3 )=visible, 30720 ). % Frame number: 769 holdsAt( appearance( id3 )=visible, 30760 ). % Frame number: 770 holdsAt( appearance( id3 )=visible, 30800 ). % Frame number: 771 holdsAt( appearance( id3 )=visible, 30840 ). % Frame number: 772 holdsAt( orientation( id3 )=121, 30880 ). holdsAt( appearance( id3 )=visible, 30880 ). % Frame number: 773 holdsAt( appearance( id3 )=visible, 30920 ). % Frame number: 774 holdsAt( appearance( id3 )=visible, 30960 ). % Frame number: 775 holdsAt( appearance( id3 )=visible, 31000 ). % Frame number: 776 holdsAt( appearance( id3 )=visible, 31040 ). % Frame number: 777 holdsAt( appearance( id3 )=visible, 31080 ). % Frame number: 778 holdsAt( appearance( id3 )=visible, 31120 ). % Frame number: 779 holdsAt( appearance( id3 )=visible, 31160 ). % Frame number: 780 holdsAt( appearance( id3 )=visible, 31200 ). % Frame number: 781 holdsAt( appearance( id3 )=visible, 31240 ). % Frame number: 782 holdsAt( appearance( id3 )=visible, 31280 ). % Frame number: 783 holdsAt( appearance( id3 )=visible, 31320 ). % Frame number: 784 holdsAt( appearance( id3 )=visible, 31360 ). % Frame number: 785 holdsAt( appearance( id3 )=visible, 31400 ). % Frame number: 786 holdsAt( orientation( id3 )=131, 31440 ). holdsAt( appearance( id3 )=visible, 31440 ). % Frame number: 787 holdsAt( orientation( id3 )=131, 31480 ). holdsAt( appearance( id3 )=visible, 31480 ). % Frame number: 788 holdsAt( appearance( id3 )=visible, 31520 ). % Frame number: 789 holdsAt( orientation( id3 )=130, 31560 ). holdsAt( appearance( id3 )=visible, 31560 ). % Frame number: 790 holdsAt( orientation( id3 )=130, 31600 ). holdsAt( appearance( id3 )=visible, 31600 ). % Frame number: 791 holdsAt( orientation( id3 )=130, 31640 ). holdsAt( appearance( id3 )=visible, 31640 ). % Frame number: 792 holdsAt( orientation( id3 )=130, 31680 ). holdsAt( appearance( id3 )=visible, 31680 ). % Frame number: 793 holdsAt( appearance( id3 )=visible, 31720 ). % Frame number: 794 holdsAt( appearance( id3 )=visible, 31760 ). % Frame number: 795 holdsAt( appearance( id3 )=visible, 31800 ). % Frame number: 796 holdsAt( orientation( id3 )=130, 31840 ). holdsAt( appearance( id3 )=visible, 31840 ). % Frame number: 797 holdsAt( appearance( id3 )=visible, 31880 ). % Frame number: 798 holdsAt( orientation( id3 )=130, 31920 ). holdsAt( appearance( id3 )=visible, 31920 ). % Frame number: 799 holdsAt( appearance( id3 )=visible, 31960 ). % Frame number: 800 holdsAt( appearance( id3 )=visible, 32000 ). % Frame number: 801 holdsAt( appearance( id3 )=visible, 32040 ). % Frame number: 802 holdsAt( appearance( id3 )=visible, 32080 ). % Frame number: 803 holdsAt( orientation( id3 )=130, 32120 ). holdsAt( appearance( id3 )=visible, 32120 ). % Frame number: 804 holdsAt( appearance( id3 )=visible, 32160 ). % Frame number: 805 holdsAt( appearance( id3 )=visible, 32200 ). % Frame number: 806 holdsAt( appearance( id3 )=visible, 32240 ). % Frame number: 807 holdsAt( appearance( id3 )=visible, 32280 ). % Frame number: 808 holdsAt( appearance( id3 )=visible, 32320 ). % Frame number: 809 holdsAt( appearance( id3 )=visible, 32360 ). % Frame number: 810 holdsAt( appearance( id3 )=visible, 32400 ). % Frame number: 811 holdsAt( appearance( id3 )=visible, 32440 ). % Frame number: 812 holdsAt( orientation( id3 )=137, 32480 ). holdsAt( appearance( id3 )=visible, 32480 ). % Frame number: 813 holdsAt( appearance( id3 )=visible, 32520 ). % Frame number: 814 holdsAt( appearance( id3 )=visible, 32560 ). % Frame number: 815 holdsAt( appearance( id3 )=visible, 32600 ). % Frame number: 816 holdsAt( appearance( id3 )=visible, 32640 ). % Frame number: 817 holdsAt( orientation( id3 )=134, 32680 ). holdsAt( appearance( id3 )=visible, 32680 ). % Frame number: 818 holdsAt( appearance( id3 )=visible, 32720 ). % Frame number: 819 holdsAt( appearance( id3 )=visible, 32760 ). % Frame number: 820 holdsAt( orientation( id3 )=129, 32800 ). holdsAt( appearance( id3 )=visible, 32800 ). % Frame number: 821 holdsAt( appearance( id3 )=visible, 32840 ). % Frame number: 822 holdsAt( appearance( id3 )=visible, 32880 ). % Frame number: 823 holdsAt( appearance( id3 )=visible, 32920 ). % Frame number: 824 holdsAt( appearance( id3 )=visible, 32960 ). % Frame number: 825 holdsAt( appearance( id3 )=visible, 33000 ). % Frame number: 826 holdsAt( appearance( id3 )=visible, 33040 ). % Frame number: 827 holdsAt( appearance( id3 )=visible, 33080 ). % Frame number: 828 holdsAt( appearance( id3 )=visible, 33120 ). % Frame number: 829 holdsAt( appearance( id3 )=visible, 33160 ). % Frame number: 830 holdsAt( appearance( id3 )=visible, 33200 ). % Frame number: 831 holdsAt( appearance( id3 )=visible, 33240 ). % Frame number: 832 holdsAt( appearance( id3 )=visible, 33280 ). % Frame number: 833 holdsAt( appearance( id3 )=visible, 33320 ). % Frame number: 834 holdsAt( appearance( id3 )=visible, 33360 ). % Frame number: 835 holdsAt( appearance( id3 )=visible, 33400 ). % Frame number: 836 holdsAt( appearance( id3 )=visible, 33440 ). % Frame number: 837 holdsAt( appearance( id3 )=visible, 33480 ). % Frame number: 838 holdsAt( appearance( id3 )=visible, 33520 ). % Frame number: 839 holdsAt( appearance( id3 )=visible, 33560 ). % Frame number: 840 holdsAt( appearance( id3 )=visible, 33600 ). % Frame number: 841 holdsAt( appearance( id3 )=visible, 33640 ). % Frame number: 842 holdsAt( appearance( id3 )=visible, 33680 ). % Frame number: 843 holdsAt( appearance( id3 )=visible, 33720 ). % Frame number: 844 holdsAt( orientation( id3 )=131, 33760 ). holdsAt( appearance( id3 )=visible, 33760 ). % Frame number: 845 holdsAt( appearance( id3 )=visible, 33800 ). % Frame number: 846 holdsAt( appearance( id3 )=visible, 33840 ). % Frame number: 847 holdsAt( appearance( id3 )=visible, 33880 ). % Frame number: 848 holdsAt( appearance( id3 )=visible, 33920 ). % Frame number: 849 holdsAt( appearance( id3 )=visible, 33960 ). % Frame number: 850 holdsAt( orientation( id3 )=131, 34000 ). holdsAt( appearance( id3 )=visible, 34000 ). % Frame number: 851 holdsAt( appearance( id3 )=visible, 34040 ). % Frame number: 852 holdsAt( appearance( id3 )=visible, 34080 ). % Frame number: 853 holdsAt( appearance( id3 )=visible, 34120 ). % Frame number: 854 holdsAt( appearance( id3 )=visible, 34160 ). % Frame number: 855 holdsAt( appearance( id3 )=visible, 34200 ). % Frame number: 856 holdsAt( orientation( id3 )=131, 34240 ). holdsAt( appearance( id3 )=visible, 34240 ). % Frame number: 857 holdsAt( appearance( id3 )=visible, 34280 ). % Frame number: 858 holdsAt( appearance( id3 )=visible, 34320 ). % Frame number: 859 holdsAt( appearance( id3 )=visible, 34360 ). % Frame number: 860 holdsAt( appearance( id3 )=visible, 34400 ). % Frame number: 861 holdsAt( appearance( id3 )=visible, 34440 ). % Frame number: 862 holdsAt( appearance( id3 )=visible, 34480 ). % Frame number: 863 holdsAt( appearance( id3 )=visible, 34520 ). % Frame number: 864 holdsAt( appearance( id3 )=visible, 34560 ). % Frame number: 865 holdsAt( appearance( id3 )=visible, 34600 ). % Frame number: 866 holdsAt( appearance( id3 )=visible, 34640 ). % Frame number: 867 holdsAt( appearance( id3 )=visible, 34680 ). % Frame number: 868 holdsAt( appearance( id3 )=visible, 34720 ). % Frame number: 869 holdsAt( appearance( id3 )=visible, 34760 ). % Frame number: 870 holdsAt( appearance( id3 )=visible, 34800 ). % Frame number: 871 holdsAt( appearance( id3 )=visible, 34840 ). % Frame number: 872 holdsAt( appearance( id3 )=visible, 34880 ). % Frame number: 873 holdsAt( appearance( id3 )=visible, 34920 ). % Frame number: 874 holdsAt( appearance( id3 )=visible, 34960 ). % Frame number: 875 holdsAt( appearance( id3 )=visible, 35000 ). % Frame number: 876 holdsAt( appearance( id3 )=visible, 35040 ). % Frame number: 877 holdsAt( appearance( id3 )=visible, 35080 ). % Frame number: 878 holdsAt( appearance( id3 )=visible, 35120 ). % Frame number: 879 holdsAt( appearance( id3 )=visible, 35160 ). % Frame number: 880 holdsAt( orientation( id3 )=131, 35200 ). holdsAt( appearance( id3 )=visible, 35200 ). % Frame number: 881 holdsAt( orientation( id3 )=131, 35240 ). holdsAt( appearance( id3 )=visible, 35240 ). % Frame number: 882 holdsAt( appearance( id3 )=visible, 35280 ). % Frame number: 883 holdsAt( appearance( id3 )=visible, 35320 ). % Frame number: 884 holdsAt( appearance( id3 )=visible, 35360 ). % Frame number: 885 holdsAt( orientation( id3 )=131, 35400 ). holdsAt( appearance( id3 )=visible, 35400 ). % Frame number: 886 holdsAt( appearance( id3 )=visible, 35440 ). % Frame number: 887 holdsAt( appearance( id3 )=visible, 35480 ). % Frame number: 888 holdsAt( appearance( id3 )=visible, 35520 ). % Frame number: 889 holdsAt( appearance( id3 )=visible, 35560 ). % Frame number: 890 holdsAt( appearance( id3 )=visible, 35600 ). % Frame number: 891 holdsAt( orientation( id3 )=131, 35640 ). holdsAt( appearance( id3 )=visible, 35640 ). % Frame number: 892 holdsAt( appearance( id3 )=visible, 35680 ). % Frame number: 893 holdsAt( appearance( id3 )=visible, 35720 ). % Frame number: 894 holdsAt( appearance( id3 )=visible, 35760 ). % Frame number: 895 holdsAt( appearance( id3 )=visible, 35800 ). % Frame number: 896 holdsAt( appearance( id3 )=visible, 35840 ). % Frame number: 897 holdsAt( appearance( id3 )=visible, 35880 ). % Frame number: 898 holdsAt( appearance( id3 )=visible, 35920 ). % Frame number: 899 holdsAt( appearance( id3 )=visible, 35960 ). % Frame number: 900 holdsAt( appearance( id3 )=visible, 36000 ). % Frame number: 901 holdsAt( appearance( id3 )=visible, 36040 ). % Frame number: 902 holdsAt( appearance( id3 )=visible, 36080 ). % Frame number: 903 holdsAt( appearance( id3 )=visible, 36120 ). % Frame number: 904 holdsAt( appearance( id3 )=visible, 36160 ). % Frame number: 905 holdsAt( appearance( id3 )=visible, 36200 ). % Frame number: 906 holdsAt( appearance( id3 )=visible, 36240 ). % Frame number: 907 holdsAt( appearance( id3 )=visible, 36280 ). % Frame number: 908 holdsAt( appearance( id3 )=visible, 36320 ). % Frame number: 909 holdsAt( appearance( id3 )=visible, 36360 ). % Frame number: 910 holdsAt( appearance( id3 )=visible, 36400 ). % Frame number: 911 holdsAt( appearance( id3 )=visible, 36440 ). % Frame number: 912 holdsAt( appearance( id3 )=visible, 36480 ). % Frame number: 913 holdsAt( appearance( id3 )=visible, 36520 ). % Frame number: 914 holdsAt( appearance( id3 )=visible, 36560 ). % Frame number: 915 holdsAt( orientation( id3 )=121, 36600 ). holdsAt( appearance( id3 )=visible, 36600 ). % Frame number: 916 holdsAt( orientation( id3 )=121, 36640 ). holdsAt( appearance( id3 )=visible, 36640 ). % Frame number: 917 holdsAt( appearance( id3 )=visible, 36680 ). % Frame number: 918 holdsAt( appearance( id3 )=visible, 36720 ). % Frame number: 919 holdsAt( orientation( id3 )=122, 36760 ). holdsAt( appearance( id3 )=visible, 36760 ). % Frame number: 920 holdsAt( appearance( id3 )=visible, 36800 ). % Frame number: 921 holdsAt( orientation( id3 )=121, 36840 ). holdsAt( appearance( id3 )=visible, 36840 ). % Frame number: 922 holdsAt( appearance( id3 )=visible, 36880 ). % Frame number: 923 holdsAt( orientation( id3 )=121, 36920 ). holdsAt( appearance( id3 )=visible, 36920 ). % Frame number: 924 holdsAt( appearance( id3 )=visible, 36960 ). % Frame number: 925 holdsAt( appearance( id3 )=visible, 37000 ). % Frame number: 926 holdsAt( appearance( id3 )=visible, 37040 ). % Frame number: 927 holdsAt( appearance( id3 )=visible, 37080 ). % Frame number: 928 holdsAt( appearance( id3 )=visible, 37120 ). % Frame number: 929 holdsAt( orientation( id3 )=127, 37160 ). holdsAt( appearance( id3 )=visible, 37160 ). % Frame number: 930 holdsAt( appearance( id3 )=visible, 37200 ). % Frame number: 931 holdsAt( appearance( id3 )=visible, 37240 ). % Frame number: 932 holdsAt( appearance( id3 )=visible, 37280 ). % Frame number: 933 holdsAt( appearance( id3 )=visible, 37320 ). % Frame number: 934 holdsAt( appearance( id3 )=visible, 37360 ). % Frame number: 935 holdsAt( appearance( id3 )=visible, 37400 ). % Frame number: 936 holdsAt( orientation( id3 )=146, 37440 ). holdsAt( appearance( id3 )=visible, 37440 ). % Frame number: 937 holdsAt( orientation( id3 )=138, 37480 ). holdsAt( appearance( id3 )=visible, 37480 ). % Frame number: 938 holdsAt( appearance( id3 )=visible, 37520 ). % Frame number: 939 holdsAt( appearance( id3 )=visible, 37560 ). % Frame number: 940 holdsAt( appearance( id3 )=visible, 37600 ). % Frame number: 941 holdsAt( appearance( id3 )=visible, 37640 ). % Frame number: 942 holdsAt( appearance( id3 )=visible, 37680 ). % Frame number: 943 holdsAt( appearance( id3 )=visible, 37720 ). % Frame number: 944 holdsAt( orientation( id3 )=144, 37760 ). holdsAt( appearance( id3 )=visible, 37760 ). % Frame number: 945 holdsAt( appearance( id3 )=visible, 37800 ). holdsAt( appearance( id4 )=appear, 37800 ). % Frame number: 946 holdsAt( appearance( id3 )=visible, 37840 ). holdsAt( appearance( id4 )=visible, 37840 ). % Frame number: 947 holdsAt( appearance( id3 )=visible, 37880 ). holdsAt( appearance( id4 )=visible, 37880 ). % Frame number: 948 holdsAt( appearance( id3 )=visible, 37920 ). holdsAt( appearance( id4 )=visible, 37920 ). % Frame number: 949 holdsAt( appearance( id3 )=visible, 37960 ). holdsAt( appearance( id4 )=visible, 37960 ). % Frame number: 950 holdsAt( appearance( id3 )=visible, 38000 ). holdsAt( orientation( id4 )=90, 38000 ). holdsAt( appearance( id4 )=visible, 38000 ). % Frame number: 951 holdsAt( appearance( id3 )=visible, 38040 ). holdsAt( appearance( id4 )=visible, 38040 ). % Frame number: 952 holdsAt( appearance( id3 )=visible, 38080 ). holdsAt( appearance( id4 )=visible, 38080 ). % Frame number: 953 holdsAt( appearance( id3 )=visible, 38120 ). holdsAt( appearance( id4 )=visible, 38120 ). % Frame number: 954 holdsAt( appearance( id3 )=visible, 38160 ). holdsAt( appearance( id4 )=visible, 38160 ). % Frame number: 955 holdsAt( appearance( id3 )=visible, 38200 ). holdsAt( appearance( id4 )=visible, 38200 ). % Frame number: 956 holdsAt( appearance( id3 )=visible, 38240 ). holdsAt( appearance( id4 )=visible, 38240 ). % Frame number: 957 holdsAt( appearance( id3 )=visible, 38280 ). holdsAt( appearance( id4 )=visible, 38280 ). % Frame number: 958 holdsAt( appearance( id3 )=visible, 38320 ). holdsAt( appearance( id4 )=visible, 38320 ). % Frame number: 959 holdsAt( appearance( id3 )=visible, 38360 ). holdsAt( appearance( id4 )=visible, 38360 ). % Frame number: 960 holdsAt( appearance( id3 )=visible, 38400 ). holdsAt( appearance( id4 )=visible, 38400 ). % Frame number: 961 holdsAt( appearance( id3 )=visible, 38440 ). holdsAt( appearance( id4 )=visible, 38440 ). % Frame number: 962 holdsAt( appearance( id3 )=visible, 38480 ). holdsAt( appearance( id4 )=visible, 38480 ). % Frame number: 963 holdsAt( appearance( id3 )=visible, 38520 ). holdsAt( appearance( id4 )=visible, 38520 ). % Frame number: 964 holdsAt( appearance( id3 )=visible, 38560 ). holdsAt( appearance( id4 )=visible, 38560 ). % Frame number: 965 holdsAt( orientation( id3 )=117, 38600 ). holdsAt( appearance( id3 )=visible, 38600 ). holdsAt( appearance( id4 )=visible, 38600 ). % Frame number: 966 holdsAt( appearance( id3 )=visible, 38640 ). holdsAt( appearance( id4 )=visible, 38640 ). % Frame number: 967 holdsAt( appearance( id3 )=visible, 38680 ). holdsAt( appearance( id4 )=visible, 38680 ). % Frame number: 968 holdsAt( appearance( id3 )=visible, 38720 ). holdsAt( appearance( id4 )=visible, 38720 ). % Frame number: 969 holdsAt( appearance( id3 )=visible, 38760 ). holdsAt( appearance( id4 )=visible, 38760 ). % Frame number: 970 holdsAt( orientation( id3 )=125, 38800 ). holdsAt( appearance( id3 )=visible, 38800 ). holdsAt( appearance( id4 )=visible, 38800 ). % Frame number: 971 holdsAt( appearance( id3 )=visible, 38840 ). holdsAt( appearance( id4 )=visible, 38840 ). % Frame number: 972 holdsAt( appearance( id3 )=visible, 38880 ). holdsAt( appearance( id4 )=visible, 38880 ). % Frame number: 973 holdsAt( appearance( id3 )=visible, 38920 ). holdsAt( appearance( id4 )=visible, 38920 ). % Frame number: 974 holdsAt( appearance( id3 )=visible, 38960 ). holdsAt( appearance( id4 )=visible, 38960 ). % Frame number: 975 holdsAt( orientation( id3 )=125, 39000 ). holdsAt( appearance( id3 )=visible, 39000 ). holdsAt( appearance( id4 )=visible, 39000 ). % Frame number: 976 holdsAt( appearance( id3 )=visible, 39040 ). holdsAt( appearance( id4 )=visible, 39040 ). % Frame number: 977 holdsAt( appearance( id3 )=visible, 39080 ). holdsAt( appearance( id4 )=visible, 39080 ). % Frame number: 978 holdsAt( appearance( id3 )=visible, 39120 ). holdsAt( orientation( id4 )=90, 39120 ). holdsAt( appearance( id4 )=visible, 39120 ). % Frame number: 979 holdsAt( appearance( id3 )=visible, 39160 ). holdsAt( appearance( id4 )=visible, 39160 ). % Frame number: 980 holdsAt( appearance( id3 )=visible, 39200 ). holdsAt( appearance( id4 )=visible, 39200 ). % Frame number: 981 holdsAt( appearance( id3 )=visible, 39240 ). holdsAt( appearance( id4 )=visible, 39240 ). % Frame number: 982 holdsAt( appearance( id3 )=visible, 39280 ). holdsAt( appearance( id4 )=visible, 39280 ). % Frame number: 983 holdsAt( appearance( id3 )=visible, 39320 ). holdsAt( appearance( id4 )=visible, 39320 ). % Frame number: 984 holdsAt( appearance( id3 )=visible, 39360 ). holdsAt( appearance( id4 )=visible, 39360 ). % Frame number: 985 holdsAt( appearance( id3 )=visible, 39400 ). holdsAt( appearance( id4 )=visible, 39400 ). % Frame number: 986 holdsAt( appearance( id3 )=visible, 39440 ). holdsAt( appearance( id4 )=visible, 39440 ). % Frame number: 987 holdsAt( appearance( id3 )=visible, 39480 ). holdsAt( appearance( id4 )=visible, 39480 ). % Frame number: 988 holdsAt( appearance( id3 )=visible, 39520 ). holdsAt( appearance( id4 )=visible, 39520 ). % Frame number: 989 holdsAt( appearance( id3 )=visible, 39560 ). holdsAt( appearance( id4 )=visible, 39560 ). % Frame number: 990 holdsAt( appearance( id3 )=visible, 39600 ). holdsAt( orientation( id4 )=90, 39600 ). holdsAt( appearance( id4 )=visible, 39600 ). % Frame number: 991 holdsAt( appearance( id3 )=visible, 39640 ). holdsAt( appearance( id4 )=visible, 39640 ). % Frame number: 992 holdsAt( appearance( id3 )=visible, 39680 ). holdsAt( appearance( id4 )=visible, 39680 ). % Frame number: 993 holdsAt( appearance( id3 )=visible, 39720 ). holdsAt( appearance( id4 )=visible, 39720 ). % Frame number: 994 holdsAt( appearance( id3 )=visible, 39760 ). holdsAt( appearance( id4 )=visible, 39760 ). % Frame number: 995 holdsAt( appearance( id3 )=visible, 39800 ). holdsAt( appearance( id4 )=visible, 39800 ). % Frame number: 996 holdsAt( appearance( id3 )=visible, 39840 ). holdsAt( orientation( id4 )=90, 39840 ). holdsAt( appearance( id4 )=visible, 39840 ). % Frame number: 997 holdsAt( orientation( id3 )=134, 39880 ). holdsAt( appearance( id3 )=visible, 39880 ). holdsAt( appearance( id4 )=visible, 39880 ). % Frame number: 998 holdsAt( appearance( id3 )=visible, 39920 ). holdsAt( appearance( id4 )=visible, 39920 ). % Frame number: 999 holdsAt( appearance( id3 )=visible, 39960 ). holdsAt( orientation( id4 )=90, 39960 ). holdsAt( appearance( id4 )=visible, 39960 ). % Frame number: 1000 holdsAt( appearance( id3 )=visible, 40000 ). holdsAt( appearance( id4 )=visible, 40000 ). % Frame number: 1001 holdsAt( appearance( id3 )=visible, 40040 ). holdsAt( appearance( id4 )=visible, 40040 ). % Frame number: 1002 holdsAt( appearance( id3 )=visible, 40080 ). holdsAt( appearance( id4 )=visible, 40080 ). % Frame number: 1003 holdsAt( appearance( id3 )=visible, 40120 ). holdsAt( appearance( id4 )=visible, 40120 ). % Frame number: 1004 holdsAt( appearance( id3 )=visible, 40160 ). holdsAt( appearance( id4 )=visible, 40160 ). % Frame number: 1005 holdsAt( appearance( id3 )=visible, 40200 ). holdsAt( appearance( id4 )=visible, 40200 ). % Frame number: 1006 holdsAt( appearance( id3 )=visible, 40240 ). holdsAt( appearance( id4 )=visible, 40240 ). % Frame number: 1007 holdsAt( appearance( id3 )=visible, 40280 ). holdsAt( appearance( id4 )=visible, 40280 ). % Frame number: 1008 holdsAt( appearance( id3 )=visible, 40320 ). holdsAt( appearance( id4 )=visible, 40320 ). % Frame number: 1009 holdsAt( appearance( id3 )=visible, 40360 ). holdsAt( appearance( id4 )=visible, 40360 ). % Frame number: 1010 holdsAt( appearance( id3 )=visible, 40400 ). holdsAt( appearance( id4 )=visible, 40400 ). % Frame number: 1011 holdsAt( appearance( id3 )=visible, 40440 ). holdsAt( appearance( id4 )=visible, 40440 ). % Frame number: 1012 holdsAt( appearance( id3 )=visible, 40480 ). holdsAt( appearance( id4 )=visible, 40480 ). % Frame number: 1013 holdsAt( appearance( id3 )=visible, 40520 ). holdsAt( appearance( id4 )=visible, 40520 ). % Frame number: 1014 holdsAt( appearance( id3 )=visible, 40560 ). holdsAt( appearance( id4 )=visible, 40560 ). % Frame number: 1015 holdsAt( appearance( id3 )=visible, 40600 ). holdsAt( appearance( id4 )=visible, 40600 ). % Frame number: 1016 holdsAt( appearance( id3 )=visible, 40640 ). holdsAt( appearance( id4 )=visible, 40640 ). % Frame number: 1017 holdsAt( appearance( id3 )=visible, 40680 ). holdsAt( appearance( id4 )=visible, 40680 ). % Frame number: 1018 holdsAt( appearance( id3 )=visible, 40720 ). holdsAt( appearance( id4 )=visible, 40720 ). % Frame number: 1019 holdsAt( orientation( id3 )=134, 40760 ). holdsAt( appearance( id3 )=visible, 40760 ). holdsAt( appearance( id4 )=visible, 40760 ). % Frame number: 1020 holdsAt( appearance( id3 )=visible, 40800 ). holdsAt( appearance( id4 )=visible, 40800 ). % Frame number: 1021 holdsAt( appearance( id3 )=visible, 40840 ). holdsAt( appearance( id4 )=visible, 40840 ). % Frame number: 1022 holdsAt( appearance( id3 )=visible, 40880 ). holdsAt( appearance( id4 )=visible, 40880 ). % Frame number: 1023 holdsAt( appearance( id3 )=visible, 40920 ). holdsAt( appearance( id4 )=visible, 40920 ). % Frame number: 1024 holdsAt( appearance( id3 )=visible, 40960 ). holdsAt( appearance( id4 )=visible, 40960 ). % Frame number: 1025 holdsAt( appearance( id3 )=visible, 41000 ). holdsAt( appearance( id4 )=visible, 41000 ). % Frame number: 1026 holdsAt( appearance( id3 )=visible, 41040 ). holdsAt( appearance( id4 )=visible, 41040 ). % Frame number: 1027 holdsAt( appearance( id3 )=visible, 41080 ). holdsAt( appearance( id4 )=visible, 41080 ). % Frame number: 1028 holdsAt( orientation( id3 )=134, 41120 ). holdsAt( appearance( id3 )=visible, 41120 ). holdsAt( appearance( id4 )=visible, 41120 ). % Frame number: 1029 holdsAt( appearance( id3 )=visible, 41160 ). holdsAt( appearance( id4 )=visible, 41160 ). % Frame number: 1030 holdsAt( appearance( id3 )=visible, 41200 ). holdsAt( appearance( id4 )=visible, 41200 ). % Frame number: 1031 holdsAt( orientation( id3 )=134, 41240 ). holdsAt( appearance( id3 )=visible, 41240 ). holdsAt( orientation( id4 )=90, 41240 ). holdsAt( appearance( id4 )=visible, 41240 ). % Frame number: 1032 holdsAt( appearance( id3 )=visible, 41280 ). holdsAt( appearance( id4 )=visible, 41280 ). % Frame number: 1033 holdsAt( appearance( id3 )=visible, 41320 ). holdsAt( appearance( id4 )=visible, 41320 ). % Frame number: 1034 holdsAt( appearance( id3 )=visible, 41360 ). holdsAt( appearance( id4 )=visible, 41360 ). % Frame number: 1035 holdsAt( orientation( id3 )=134, 41400 ). holdsAt( appearance( id3 )=visible, 41400 ). holdsAt( orientation( id4 )=90, 41400 ). holdsAt( appearance( id4 )=visible, 41400 ). % Frame number: 1036 holdsAt( appearance( id3 )=visible, 41440 ). holdsAt( appearance( id4 )=visible, 41440 ). % Frame number: 1037 holdsAt( appearance( id3 )=visible, 41480 ). holdsAt( orientation( id4 )=90, 41480 ). holdsAt( appearance( id4 )=visible, 41480 ). % Frame number: 1038 holdsAt( appearance( id3 )=visible, 41520 ). holdsAt( appearance( id4 )=visible, 41520 ). % Frame number: 1039 holdsAt( appearance( id3 )=visible, 41560 ). holdsAt( appearance( id4 )=visible, 41560 ). % Frame number: 1040 holdsAt( orientation( id3 )=134, 41600 ). holdsAt( appearance( id3 )=visible, 41600 ). holdsAt( appearance( id4 )=visible, 41600 ). % Frame number: 1041 holdsAt( appearance( id3 )=visible, 41640 ). holdsAt( appearance( id4 )=visible, 41640 ). % Frame number: 1042 holdsAt( appearance( id3 )=visible, 41680 ). holdsAt( orientation( id4 )=90, 41680 ). holdsAt( appearance( id4 )=visible, 41680 ). % Frame number: 1043 holdsAt( appearance( id3 )=visible, 41720 ). holdsAt( appearance( id4 )=visible, 41720 ). % Frame number: 1044 holdsAt( appearance( id3 )=visible, 41760 ). holdsAt( appearance( id4 )=visible, 41760 ). % Frame number: 1045 holdsAt( appearance( id3 )=visible, 41800 ). holdsAt( appearance( id4 )=visible, 41800 ). % Frame number: 1046 holdsAt( appearance( id3 )=visible, 41840 ). holdsAt( appearance( id4 )=visible, 41840 ). % Frame number: 1047 holdsAt( appearance( id3 )=visible, 41880 ). holdsAt( appearance( id4 )=visible, 41880 ). % Frame number: 1048 holdsAt( appearance( id3 )=visible, 41920 ). holdsAt( appearance( id4 )=visible, 41920 ). % Frame number: 1049 holdsAt( appearance( id3 )=visible, 41960 ). holdsAt( appearance( id4 )=visible, 41960 ). % Frame number: 1050 holdsAt( appearance( id3 )=visible, 42000 ). holdsAt( orientation( id4 )=90, 42000 ). holdsAt( appearance( id4 )=visible, 42000 ). % Frame number: 1051 holdsAt( appearance( id3 )=visible, 42040 ). holdsAt( appearance( id4 )=visible, 42040 ). % Frame number: 1052 holdsAt( appearance( id3 )=visible, 42080 ). holdsAt( appearance( id4 )=visible, 42080 ). % Frame number: 1053 holdsAt( appearance( id3 )=visible, 42120 ). holdsAt( appearance( id4 )=visible, 42120 ). % Frame number: 1054 holdsAt( appearance( id3 )=visible, 42160 ). holdsAt( orientation( id4 )=90, 42160 ). holdsAt( appearance( id4 )=visible, 42160 ). % Frame number: 1055 holdsAt( appearance( id3 )=visible, 42200 ). holdsAt( appearance( id4 )=visible, 42200 ). % Frame number: 1056 holdsAt( appearance( id3 )=visible, 42240 ). holdsAt( appearance( id4 )=visible, 42240 ). % Frame number: 1057 holdsAt( appearance( id3 )=visible, 42280 ). holdsAt( appearance( id4 )=visible, 42280 ). % Frame number: 1058 holdsAt( appearance( id3 )=visible, 42320 ). holdsAt( appearance( id4 )=visible, 42320 ). % Frame number: 1059 holdsAt( appearance( id3 )=visible, 42360 ). holdsAt( appearance( id4 )=visible, 42360 ). % Frame number: 1060 holdsAt( orientation( id3 )=134, 42400 ). holdsAt( appearance( id3 )=visible, 42400 ). holdsAt( appearance( id4 )=visible, 42400 ). % Frame number: 1061 holdsAt( appearance( id3 )=visible, 42440 ). holdsAt( appearance( id4 )=visible, 42440 ). % Frame number: 1062 holdsAt( appearance( id3 )=visible, 42480 ). holdsAt( appearance( id4 )=visible, 42480 ). % Frame number: 1063 holdsAt( appearance( id3 )=visible, 42520 ). holdsAt( appearance( id4 )=visible, 42520 ). % Frame number: 1064 holdsAt( appearance( id3 )=visible, 42560 ). holdsAt( appearance( id4 )=visible, 42560 ). % Frame number: 1065 holdsAt( appearance( id3 )=visible, 42600 ). holdsAt( appearance( id4 )=visible, 42600 ). % Frame number: 1066 holdsAt( appearance( id3 )=visible, 42640 ). holdsAt( appearance( id4 )=visible, 42640 ). % Frame number: 1067 holdsAt( appearance( id3 )=visible, 42680 ). holdsAt( appearance( id4 )=visible, 42680 ). % Frame number: 1068 holdsAt( appearance( id3 )=visible, 42720 ). holdsAt( appearance( id4 )=visible, 42720 ). % Frame number: 1069 holdsAt( appearance( id3 )=visible, 42760 ). holdsAt( appearance( id4 )=visible, 42760 ). % Frame number: 1070 holdsAt( appearance( id3 )=visible, 42800 ). holdsAt( appearance( id4 )=visible, 42800 ). % Frame number: 1071 holdsAt( appearance( id3 )=visible, 42840 ). holdsAt( appearance( id4 )=visible, 42840 ). % Frame number: 1072 holdsAt( appearance( id3 )=visible, 42880 ). holdsAt( orientation( id4 )=90, 42880 ). holdsAt( appearance( id4 )=visible, 42880 ). % Frame number: 1073 holdsAt( appearance( id3 )=visible, 42920 ). holdsAt( appearance( id4 )=visible, 42920 ). % Frame number: 1074 holdsAt( appearance( id3 )=visible, 42960 ). holdsAt( appearance( id4 )=visible, 42960 ). % Frame number: 1075 holdsAt( appearance( id3 )=visible, 43000 ). holdsAt( appearance( id4 )=visible, 43000 ). % Frame number: 1076 holdsAt( appearance( id3 )=visible, 43040 ). holdsAt( appearance( id4 )=visible, 43040 ). % Frame number: 1077 holdsAt( appearance( id3 )=visible, 43080 ). holdsAt( appearance( id4 )=visible, 43080 ). % Frame number: 1078 holdsAt( orientation( id3 )=134, 43120 ). holdsAt( appearance( id3 )=visible, 43120 ). holdsAt( appearance( id4 )=visible, 43120 ). % Frame number: 1079 holdsAt( appearance( id3 )=visible, 43160 ). holdsAt( appearance( id4 )=visible, 43160 ). % Frame number: 1080 holdsAt( appearance( id3 )=visible, 43200 ). holdsAt( appearance( id4 )=visible, 43200 ). % Frame number: 1081 holdsAt( orientation( id3 )=134, 43240 ). holdsAt( appearance( id3 )=visible, 43240 ). holdsAt( appearance( id4 )=visible, 43240 ). % Frame number: 1082 holdsAt( appearance( id3 )=visible, 43280 ). holdsAt( appearance( id4 )=visible, 43280 ). % Frame number: 1083 holdsAt( appearance( id3 )=visible, 43320 ). holdsAt( appearance( id4 )=visible, 43320 ). % Frame number: 1084 holdsAt( appearance( id3 )=visible, 43360 ). holdsAt( appearance( id4 )=visible, 43360 ). % Frame number: 1085 holdsAt( appearance( id3 )=visible, 43400 ). holdsAt( appearance( id4 )=visible, 43400 ). % Frame number: 1086 holdsAt( appearance( id3 )=visible, 43440 ). holdsAt( appearance( id4 )=visible, 43440 ). % Frame number: 1087 holdsAt( appearance( id3 )=visible, 43480 ). holdsAt( appearance( id4 )=visible, 43480 ). % Frame number: 1088 holdsAt( appearance( id3 )=visible, 43520 ). holdsAt( appearance( id4 )=visible, 43520 ). % Frame number: 1089 holdsAt( appearance( id3 )=visible, 43560 ). holdsAt( orientation( id4 )=90, 43560 ). holdsAt( appearance( id4 )=visible, 43560 ). % Frame number: 1090 holdsAt( appearance( id3 )=visible, 43600 ). holdsAt( appearance( id4 )=visible, 43600 ). % Frame number: 1091 holdsAt( appearance( id3 )=visible, 43640 ). holdsAt( appearance( id4 )=visible, 43640 ). % Frame number: 1092 holdsAt( appearance( id3 )=visible, 43680 ). holdsAt( appearance( id4 )=visible, 43680 ). % Frame number: 1093 holdsAt( appearance( id3 )=disappear, 43720 ). holdsAt( appearance( id4 )=visible, 43720 ). % Frame number: 1094 holdsAt( appearance( id4 )=visible, 43760 ). % Frame number: 1095 holdsAt( appearance( id4 )=visible, 43800 ). % Frame number: 1096 holdsAt( appearance( id4 )=visible, 43840 ). % Frame number: 1097 holdsAt( appearance( id4 )=visible, 43880 ). % Frame number: 1098 holdsAt( appearance( id4 )=visible, 43920 ). % Frame number: 1099 holdsAt( orientation( id4 )=90, 43960 ). holdsAt( appearance( id4 )=visible, 43960 ). % Frame number: 1100 holdsAt( appearance( id4 )=visible, 44000 ). % Frame number: 1101 holdsAt( appearance( id4 )=visible, 44040 ). % Frame number: 1102 holdsAt( orientation( id4 )=90, 44080 ). holdsAt( appearance( id4 )=visible, 44080 ). % Frame number: 1103 holdsAt( appearance( id4 )=visible, 44120 ). % Frame number: 1104 holdsAt( appearance( id4 )=visible, 44160 ). % Frame number: 1105 holdsAt( appearance( id4 )=visible, 44200 ). % Frame number: 1106 holdsAt( appearance( id4 )=visible, 44240 ). % Frame number: 1107 holdsAt( appearance( id4 )=visible, 44280 ). % Frame number: 1108 holdsAt( appearance( id4 )=visible, 44320 ). % Frame number: 1109 holdsAt( appearance( id4 )=visible, 44360 ). % Frame number: 1110 holdsAt( appearance( id4 )=visible, 44400 ). % Frame number: 1111 holdsAt( appearance( id4 )=visible, 44440 ). % Frame number: 1112 holdsAt( appearance( id4 )=visible, 44480 ). % Frame number: 1113 holdsAt( appearance( id4 )=visible, 44520 ). % Frame number: 1114 holdsAt( appearance( id4 )=visible, 44560 ). % Frame number: 1115 holdsAt( appearance( id4 )=visible, 44600 ). % Frame number: 1116 holdsAt( appearance( id4 )=visible, 44640 ). % Frame number: 1117 holdsAt( appearance( id4 )=visible, 44680 ). % Frame number: 1118 holdsAt( appearance( id4 )=visible, 44720 ). % Frame number: 1119 holdsAt( appearance( id4 )=visible, 44760 ). % Frame number: 1120 holdsAt( appearance( id4 )=visible, 44800 ). % Frame number: 1121 holdsAt( appearance( id4 )=visible, 44840 ). % Frame number: 1122 holdsAt( appearance( id4 )=visible, 44880 ). % Frame number: 1123 holdsAt( appearance( id4 )=visible, 44920 ). % Frame number: 1124 holdsAt( appearance( id4 )=visible, 44960 ). % Frame number: 1125 holdsAt( appearance( id4 )=visible, 45000 ). % Frame number: 1126 holdsAt( appearance( id4 )=visible, 45040 ). % Frame number: 1127 holdsAt( appearance( id4 )=visible, 45080 ). % Frame number: 1128 holdsAt( appearance( id4 )=visible, 45120 ). % Frame number: 1129 holdsAt( appearance( id4 )=visible, 45160 ). % Frame number: 1130 holdsAt( appearance( id4 )=visible, 45200 ). % Frame number: 1131 holdsAt( appearance( id4 )=visible, 45240 ). % Frame number: 1132 holdsAt( appearance( id4 )=visible, 45280 ). % Frame number: 1133 holdsAt( appearance( id4 )=visible, 45320 ). % Frame number: 1134 holdsAt( appearance( id4 )=visible, 45360 ). % Frame number: 1135 holdsAt( orientation( id4 )=90, 45400 ). holdsAt( appearance( id4 )=visible, 45400 ). % Frame number: 1136 holdsAt( appearance( id4 )=visible, 45440 ). % Frame number: 1137 holdsAt( appearance( id4 )=visible, 45480 ). % Frame number: 1138 holdsAt( appearance( id4 )=visible, 45520 ). % Frame number: 1139 holdsAt( appearance( id4 )=visible, 45560 ). % Frame number: 1140 holdsAt( appearance( id4 )=visible, 45600 ). % Frame number: 1141 holdsAt( appearance( id4 )=visible, 45640 ). % Frame number: 1142 holdsAt( appearance( id4 )=visible, 45680 ). % Frame number: 1143 holdsAt( appearance( id4 )=visible, 45720 ). % Frame number: 1144 holdsAt( appearance( id4 )=visible, 45760 ). % Frame number: 1145 holdsAt( appearance( id4 )=visible, 45800 ). % Frame number: 1146 holdsAt( appearance( id4 )=visible, 45840 ). % Frame number: 1147 holdsAt( appearance( id4 )=visible, 45880 ). % Frame number: 1148 holdsAt( appearance( id4 )=visible, 45920 ). % Frame number: 1149 holdsAt( appearance( id4 )=visible, 45960 ). % Frame number: 1150 holdsAt( appearance( id4 )=visible, 46000 ). % Frame number: 1151 holdsAt( appearance( id4 )=visible, 46040 ). % Frame number: 1152 holdsAt( appearance( id4 )=visible, 46080 ). % Frame number: 1153 holdsAt( appearance( id4 )=visible, 46120 ). % Frame number: 1154 holdsAt( appearance( id4 )=visible, 46160 ). % Frame number: 1155 holdsAt( appearance( id4 )=visible, 46200 ). % Frame number: 1156 holdsAt( appearance( id4 )=visible, 46240 ). % Frame number: 1157 holdsAt( appearance( id4 )=visible, 46280 ). % Frame number: 1158 holdsAt( appearance( id4 )=visible, 46320 ). % Frame number: 1159 holdsAt( appearance( id4 )=visible, 46360 ). % Frame number: 1160 holdsAt( appearance( id4 )=visible, 46400 ). % Frame number: 1161 holdsAt( appearance( id4 )=visible, 46440 ). % Frame number: 1162 holdsAt( appearance( id4 )=visible, 46480 ). % Frame number: 1163 holdsAt( appearance( id4 )=visible, 46520 ). % Frame number: 1164 holdsAt( appearance( id4 )=visible, 46560 ). % Frame number: 1165 holdsAt( appearance( id4 )=visible, 46600 ). % Frame number: 1166 holdsAt( orientation( id4 )=90, 46640 ). holdsAt( appearance( id4 )=visible, 46640 ). % Frame number: 1167 holdsAt( orientation( id4 )=90, 46680 ). holdsAt( appearance( id4 )=visible, 46680 ). % Frame number: 1168 holdsAt( appearance( id4 )=visible, 46720 ). % Frame number: 1169 holdsAt( appearance( id4 )=visible, 46760 ). % Frame number: 1170 holdsAt( appearance( id4 )=visible, 46800 ). % Frame number: 1171 holdsAt( appearance( id4 )=visible, 46840 ). % Frame number: 1172 holdsAt( appearance( id4 )=visible, 46880 ). % Frame number: 1173 holdsAt( appearance( id4 )=visible, 46920 ). % Frame number: 1174 holdsAt( appearance( id4 )=visible, 46960 ). % Frame number: 1175 holdsAt( appearance( id4 )=visible, 47000 ). % Frame number: 1176 holdsAt( appearance( id4 )=visible, 47040 ). % Frame number: 1177 holdsAt( appearance( id4 )=visible, 47080 ). % Frame number: 1178 holdsAt( appearance( id4 )=visible, 47120 ). % Frame number: 1179 holdsAt( appearance( id4 )=visible, 47160 ). % Frame number: 1180 holdsAt( appearance( id4 )=visible, 47200 ). % Frame number: 1181 holdsAt( appearance( id4 )=visible, 47240 ). % Frame number: 1182 holdsAt( appearance( id4 )=visible, 47280 ). % Frame number: 1183 holdsAt( appearance( id4 )=visible, 47320 ). % Frame number: 1184 holdsAt( appearance( id4 )=visible, 47360 ). % Frame number: 1185 holdsAt( appearance( id4 )=visible, 47400 ). % Frame number: 1186 holdsAt( appearance( id4 )=visible, 47440 ). % Frame number: 1187 holdsAt( appearance( id4 )=visible, 47480 ). % Frame number: 1188 holdsAt( orientation( id4 )=90, 47520 ). holdsAt( appearance( id4 )=visible, 47520 ). % Frame number: 1189 holdsAt( appearance( id4 )=visible, 47560 ). % Frame number: 1190 holdsAt( appearance( id4 )=visible, 47600 ). % Frame number: 1191 holdsAt( orientation( id4 )=90, 47640 ). holdsAt( appearance( id4 )=visible, 47640 ). % Frame number: 1192 holdsAt( appearance( id4 )=visible, 47680 ). % Frame number: 1193 holdsAt( orientation( id4 )=90, 47720 ). holdsAt( appearance( id4 )=visible, 47720 ). % Frame number: 1194 holdsAt( appearance( id4 )=visible, 47760 ). % Frame number: 1195 holdsAt( appearance( id4 )=visible, 47800 ). % Frame number: 1196 holdsAt( appearance( id4 )=visible, 47840 ). % Frame number: 1197 holdsAt( appearance( id4 )=visible, 47880 ). % Frame number: 1198 holdsAt( appearance( id4 )=visible, 47920 ). % Frame number: 1199 holdsAt( appearance( id4 )=visible, 47960 ). % Frame number: 1200 holdsAt( appearance( id4 )=visible, 48000 ). % Frame number: 1201 holdsAt( appearance( id4 )=visible, 48040 ). % Frame number: 1202 holdsAt( appearance( id4 )=visible, 48080 ). % Frame number: 1203 holdsAt( appearance( id4 )=visible, 48120 ). % Frame number: 1204 holdsAt( appearance( id4 )=visible, 48160 ). % Frame number: 1205 holdsAt( appearance( id4 )=visible, 48200 ). % Frame number: 1206 holdsAt( appearance( id4 )=visible, 48240 ). % Frame number: 1207 holdsAt( appearance( id4 )=visible, 48280 ). % Frame number: 1208 holdsAt( orientation( id4 )=90, 48320 ). holdsAt( appearance( id4 )=visible, 48320 ). % Frame number: 1209 holdsAt( appearance( id4 )=visible, 48360 ). % Frame number: 1210 holdsAt( appearance( id4 )=visible, 48400 ). % Frame number: 1211 holdsAt( orientation( id4 )=90, 48440 ). holdsAt( appearance( id4 )=visible, 48440 ). % Frame number: 1212 holdsAt( appearance( id4 )=visible, 48480 ). % Frame number: 1213 holdsAt( appearance( id4 )=visible, 48520 ). % Frame number: 1214 holdsAt( appearance( id4 )=visible, 48560 ). % Frame number: 1215 holdsAt( appearance( id4 )=visible, 48600 ). % Frame number: 1216 holdsAt( appearance( id4 )=visible, 48640 ). holdsAt( appearance( id5 )=appear, 48640 ). % Frame number: 1217 holdsAt( appearance( id4 )=visible, 48680 ). holdsAt( appearance( id5 )=visible, 48680 ). % Frame number: 1218 holdsAt( appearance( id4 )=visible, 48720 ). holdsAt( appearance( id5 )=visible, 48720 ). % Frame number: 1219 holdsAt( appearance( id4 )=visible, 48760 ). holdsAt( appearance( id5 )=visible, 48760 ). % Frame number: 1220 holdsAt( appearance( id4 )=visible, 48800 ). holdsAt( appearance( id5 )=visible, 48800 ). % Frame number: 1221 holdsAt( appearance( id4 )=visible, 48840 ). holdsAt( appearance( id5 )=visible, 48840 ). % Frame number: 1222 holdsAt( appearance( id4 )=visible, 48880 ). holdsAt( appearance( id5 )=visible, 48880 ). % Frame number: 1223 holdsAt( appearance( id4 )=visible, 48920 ). holdsAt( appearance( id5 )=visible, 48920 ). % Frame number: 1224 holdsAt( appearance( id4 )=visible, 48960 ). holdsAt( appearance( id5 )=visible, 48960 ). % Frame number: 1225 holdsAt( appearance( id4 )=visible, 49000 ). holdsAt( appearance( id5 )=visible, 49000 ). % Frame number: 1226 holdsAt( appearance( id4 )=visible, 49040 ). holdsAt( appearance( id5 )=visible, 49040 ). % Frame number: 1227 holdsAt( appearance( id4 )=visible, 49080 ). holdsAt( appearance( id5 )=visible, 49080 ). % Frame number: 1228 holdsAt( appearance( id4 )=visible, 49120 ). holdsAt( appearance( id5 )=visible, 49120 ). % Frame number: 1229 holdsAt( appearance( id4 )=visible, 49160 ). holdsAt( appearance( id5 )=visible, 49160 ). % Frame number: 1230 holdsAt( appearance( id4 )=visible, 49200 ). holdsAt( appearance( id5 )=visible, 49200 ). % Frame number: 1231 holdsAt( appearance( id4 )=visible, 49240 ). holdsAt( appearance( id5 )=visible, 49240 ). % Frame number: 1232 holdsAt( appearance( id4 )=visible, 49280 ). holdsAt( appearance( id5 )=visible, 49280 ). % Frame number: 1233 holdsAt( appearance( id4 )=visible, 49320 ). holdsAt( appearance( id5 )=visible, 49320 ). % Frame number: 1234 holdsAt( appearance( id4 )=visible, 49360 ). holdsAt( appearance( id5 )=visible, 49360 ). % Frame number: 1235 holdsAt( appearance( id4 )=visible, 49400 ). holdsAt( appearance( id5 )=visible, 49400 ). % Frame number: 1236 holdsAt( appearance( id4 )=visible, 49440 ). holdsAt( appearance( id5 )=visible, 49440 ). % Frame number: 1237 holdsAt( appearance( id4 )=visible, 49480 ). holdsAt( appearance( id5 )=visible, 49480 ). % Frame number: 1238 holdsAt( appearance( id4 )=visible, 49520 ). holdsAt( appearance( id5 )=visible, 49520 ). % Frame number: 1239 holdsAt( appearance( id4 )=visible, 49560 ). holdsAt( appearance( id5 )=visible, 49560 ). % Frame number: 1240 holdsAt( appearance( id4 )=visible, 49600 ). holdsAt( appearance( id5 )=visible, 49600 ). % Frame number: 1241 holdsAt( appearance( id4 )=visible, 49640 ). holdsAt( appearance( id5 )=visible, 49640 ). % Frame number: 1242 holdsAt( orientation( id4 )=90, 49680 ). holdsAt( appearance( id4 )=visible, 49680 ). holdsAt( orientation( id5 )=127, 49680 ). holdsAt( appearance( id5 )=visible, 49680 ). % Frame number: 1243 holdsAt( appearance( id4 )=visible, 49720 ). holdsAt( appearance( id5 )=visible, 49720 ). % Frame number: 1244 holdsAt( appearance( id4 )=visible, 49760 ). holdsAt( appearance( id5 )=visible, 49760 ). % Frame number: 1245 holdsAt( appearance( id4 )=visible, 49800 ). holdsAt( orientation( id5 )=127, 49800 ). holdsAt( appearance( id5 )=visible, 49800 ). % Frame number: 1246 holdsAt( orientation( id4 )=90, 49840 ). holdsAt( appearance( id4 )=visible, 49840 ). holdsAt( appearance( id5 )=visible, 49840 ). % Frame number: 1247 holdsAt( appearance( id4 )=visible, 49880 ). holdsAt( appearance( id5 )=visible, 49880 ). % Frame number: 1248 holdsAt( appearance( id4 )=visible, 49920 ). holdsAt( appearance( id5 )=visible, 49920 ). % Frame number: 1249 holdsAt( appearance( id4 )=visible, 49960 ). holdsAt( appearance( id5 )=visible, 49960 ). % Frame number: 1250 holdsAt( appearance( id4 )=visible, 50000 ). holdsAt( appearance( id5 )=visible, 50000 ). % Frame number: 1251 holdsAt( appearance( id4 )=visible, 50040 ). holdsAt( appearance( id5 )=visible, 50040 ). % Frame number: 1252 holdsAt( appearance( id4 )=visible, 50080 ). holdsAt( appearance( id5 )=visible, 50080 ). % Frame number: 1253 holdsAt( appearance( id4 )=visible, 50120 ). holdsAt( appearance( id5 )=visible, 50120 ). % Frame number: 1254 holdsAt( appearance( id4 )=visible, 50160 ). holdsAt( appearance( id5 )=visible, 50160 ). % Frame number: 1255 holdsAt( appearance( id4 )=visible, 50200 ). holdsAt( appearance( id5 )=visible, 50200 ). % Frame number: 1256 holdsAt( appearance( id4 )=visible, 50240 ). holdsAt( appearance( id5 )=visible, 50240 ). % Frame number: 1257 holdsAt( appearance( id4 )=visible, 50280 ). holdsAt( appearance( id5 )=visible, 50280 ). % Frame number: 1258 holdsAt( appearance( id4 )=visible, 50320 ). holdsAt( appearance( id5 )=visible, 50320 ). % Frame number: 1259 holdsAt( appearance( id4 )=visible, 50360 ). holdsAt( appearance( id5 )=visible, 50360 ). % Frame number: 1260 holdsAt( orientation( id4 )=90, 50400 ). holdsAt( appearance( id4 )=visible, 50400 ). holdsAt( appearance( id5 )=visible, 50400 ). % Frame number: 1261 holdsAt( appearance( id4 )=visible, 50440 ). holdsAt( appearance( id5 )=visible, 50440 ). % Frame number: 1262 holdsAt( appearance( id4 )=visible, 50480 ). holdsAt( appearance( id5 )=visible, 50480 ). % Frame number: 1263 holdsAt( orientation( id4 )=90, 50520 ). holdsAt( appearance( id4 )=visible, 50520 ). holdsAt( appearance( id5 )=visible, 50520 ). % Frame number: 1264 holdsAt( appearance( id4 )=visible, 50560 ). holdsAt( appearance( id5 )=visible, 50560 ). % Frame number: 1265 holdsAt( appearance( id4 )=visible, 50600 ). holdsAt( appearance( id5 )=visible, 50600 ). % Frame number: 1266 holdsAt( appearance( id4 )=visible, 50640 ). holdsAt( appearance( id5 )=visible, 50640 ). % Frame number: 1267 holdsAt( appearance( id4 )=visible, 50680 ). holdsAt( appearance( id5 )=visible, 50680 ). % Frame number: 1268 holdsAt( appearance( id4 )=visible, 50720 ). holdsAt( appearance( id5 )=visible, 50720 ). % Frame number: 1269 holdsAt( appearance( id4 )=visible, 50760 ). holdsAt( appearance( id5 )=visible, 50760 ). % Frame number: 1270 holdsAt( appearance( id4 )=visible, 50800 ). holdsAt( appearance( id5 )=visible, 50800 ). % Frame number: 1271 holdsAt( appearance( id4 )=visible, 50840 ). holdsAt( appearance( id5 )=visible, 50840 ). % Frame number: 1272 holdsAt( appearance( id4 )=visible, 50880 ). holdsAt( appearance( id5 )=visible, 50880 ). % Frame number: 1273 holdsAt( appearance( id4 )=visible, 50920 ). holdsAt( appearance( id5 )=visible, 50920 ). % Frame number: 1274 holdsAt( appearance( id4 )=visible, 50960 ). holdsAt( appearance( id5 )=visible, 50960 ). % Frame number: 1275 holdsAt( appearance( id4 )=visible, 51000 ). holdsAt( appearance( id5 )=visible, 51000 ). % Frame number: 1276 holdsAt( appearance( id4 )=visible, 51040 ). holdsAt( appearance( id5 )=visible, 51040 ). % Frame number: 1277 holdsAt( orientation( id4 )=90, 51080 ). holdsAt( appearance( id4 )=visible, 51080 ). holdsAt( appearance( id5 )=visible, 51080 ). % Frame number: 1278 holdsAt( appearance( id4 )=visible, 51120 ). holdsAt( appearance( id5 )=visible, 51120 ). % Frame number: 1279 holdsAt( orientation( id4 )=90, 51160 ). holdsAt( appearance( id4 )=visible, 51160 ). holdsAt( appearance( id5 )=visible, 51160 ). % Frame number: 1280 holdsAt( orientation( id4 )=90, 51200 ). holdsAt( appearance( id4 )=visible, 51200 ). holdsAt( appearance( id5 )=visible, 51200 ). % Frame number: 1281 holdsAt( appearance( id4 )=visible, 51240 ). holdsAt( appearance( id5 )=visible, 51240 ). % Frame number: 1282 holdsAt( appearance( id4 )=visible, 51280 ). holdsAt( appearance( id5 )=visible, 51280 ). % Frame number: 1283 holdsAt( appearance( id4 )=visible, 51320 ). holdsAt( appearance( id5 )=visible, 51320 ). % Frame number: 1284 holdsAt( appearance( id4 )=visible, 51360 ). holdsAt( appearance( id5 )=visible, 51360 ). % Frame number: 1285 holdsAt( appearance( id4 )=visible, 51400 ). holdsAt( appearance( id5 )=visible, 51400 ). % Frame number: 1286 holdsAt( appearance( id4 )=visible, 51440 ). holdsAt( appearance( id5 )=visible, 51440 ). % Frame number: 1287 holdsAt( orientation( id4 )=90, 51480 ). holdsAt( appearance( id4 )=visible, 51480 ). holdsAt( appearance( id5 )=visible, 51480 ). % Frame number: 1288 holdsAt( appearance( id4 )=visible, 51520 ). holdsAt( appearance( id5 )=visible, 51520 ). % Frame number: 1289 holdsAt( appearance( id4 )=visible, 51560 ). holdsAt( appearance( id5 )=visible, 51560 ). % Frame number: 1290 holdsAt( appearance( id4 )=visible, 51600 ). holdsAt( appearance( id5 )=visible, 51600 ). % Frame number: 1291 holdsAt( appearance( id4 )=visible, 51640 ). holdsAt( appearance( id5 )=visible, 51640 ). % Frame number: 1292 holdsAt( appearance( id4 )=visible, 51680 ). holdsAt( orientation( id5 )=133, 51680 ). holdsAt( appearance( id5 )=visible, 51680 ). % Frame number: 1293 holdsAt( appearance( id4 )=visible, 51720 ). holdsAt( appearance( id5 )=visible, 51720 ). % Frame number: 1294 holdsAt( appearance( id4 )=visible, 51760 ). holdsAt( orientation( id5 )=133, 51760 ). holdsAt( appearance( id5 )=visible, 51760 ). % Frame number: 1295 holdsAt( appearance( id4 )=visible, 51800 ). holdsAt( appearance( id5 )=visible, 51800 ). % Frame number: 1296 holdsAt( appearance( id4 )=visible, 51840 ). holdsAt( appearance( id5 )=visible, 51840 ). % Frame number: 1297 holdsAt( appearance( id4 )=visible, 51880 ). holdsAt( orientation( id5 )=133, 51880 ). holdsAt( appearance( id5 )=visible, 51880 ). % Frame number: 1298 holdsAt( appearance( id4 )=visible, 51920 ). holdsAt( orientation( id5 )=133, 51920 ). holdsAt( appearance( id5 )=visible, 51920 ). % Frame number: 1299 holdsAt( appearance( id4 )=visible, 51960 ). holdsAt( appearance( id5 )=visible, 51960 ). % Frame number: 1300 holdsAt( appearance( id4 )=visible, 52000 ). holdsAt( appearance( id5 )=visible, 52000 ). % Frame number: 1301 holdsAt( appearance( id4 )=visible, 52040 ). holdsAt( appearance( id5 )=visible, 52040 ). % Frame number: 1302 holdsAt( appearance( id4 )=visible, 52080 ). holdsAt( appearance( id5 )=visible, 52080 ). % Frame number: 1303 holdsAt( appearance( id4 )=visible, 52120 ). holdsAt( appearance( id5 )=visible, 52120 ). % Frame number: 1304 holdsAt( appearance( id4 )=visible, 52160 ). holdsAt( appearance( id5 )=visible, 52160 ). % Frame number: 1305 holdsAt( appearance( id4 )=visible, 52200 ). holdsAt( appearance( id5 )=visible, 52200 ). % Frame number: 1306 holdsAt( appearance( id4 )=visible, 52240 ). holdsAt( appearance( id5 )=visible, 52240 ). % Frame number: 1307 holdsAt( appearance( id4 )=visible, 52280 ). holdsAt( appearance( id5 )=visible, 52280 ). % Frame number: 1308 holdsAt( appearance( id4 )=visible, 52320 ). holdsAt( orientation( id5 )=133, 52320 ). holdsAt( appearance( id5 )=visible, 52320 ). % Frame number: 1309 holdsAt( appearance( id4 )=visible, 52360 ). holdsAt( appearance( id5 )=visible, 52360 ). % Frame number: 1310 holdsAt( appearance( id4 )=visible, 52400 ). holdsAt( appearance( id5 )=visible, 52400 ). % Frame number: 1311 holdsAt( appearance( id4 )=visible, 52440 ). holdsAt( appearance( id5 )=visible, 52440 ). % Frame number: 1312 holdsAt( appearance( id4 )=visible, 52480 ). holdsAt( appearance( id5 )=visible, 52480 ). % Frame number: 1313 holdsAt( appearance( id4 )=visible, 52520 ). holdsAt( appearance( id5 )=visible, 52520 ). % Frame number: 1314 holdsAt( orientation( id4 )=90, 52560 ). holdsAt( appearance( id4 )=visible, 52560 ). holdsAt( appearance( id5 )=visible, 52560 ). % Frame number: 1315 holdsAt( appearance( id4 )=visible, 52600 ). holdsAt( appearance( id5 )=visible, 52600 ). % Frame number: 1316 holdsAt( appearance( id4 )=visible, 52640 ). holdsAt( appearance( id5 )=visible, 52640 ). % Frame number: 1317 holdsAt( appearance( id4 )=visible, 52680 ). holdsAt( appearance( id5 )=visible, 52680 ). % Frame number: 1318 holdsAt( appearance( id4 )=visible, 52720 ). holdsAt( appearance( id5 )=visible, 52720 ). % Frame number: 1319 holdsAt( orientation( id4 )=90, 52760 ). holdsAt( appearance( id4 )=visible, 52760 ). holdsAt( appearance( id5 )=visible, 52760 ). % Frame number: 1320 holdsAt( appearance( id4 )=visible, 52800 ). holdsAt( appearance( id5 )=visible, 52800 ). % Frame number: 1321 holdsAt( appearance( id4 )=visible, 52840 ). holdsAt( appearance( id5 )=visible, 52840 ). % Frame number: 1322 holdsAt( appearance( id4 )=visible, 52880 ). holdsAt( appearance( id5 )=visible, 52880 ). % Frame number: 1323 holdsAt( appearance( id4 )=visible, 52920 ). holdsAt( appearance( id5 )=visible, 52920 ). % Frame number: 1324 holdsAt( appearance( id4 )=visible, 52960 ). holdsAt( appearance( id5 )=visible, 52960 ). % Frame number: 1325 holdsAt( appearance( id4 )=visible, 53000 ). holdsAt( appearance( id5 )=visible, 53000 ). % Frame number: 1326 holdsAt( appearance( id4 )=visible, 53040 ). holdsAt( appearance( id5 )=visible, 53040 ). % Frame number: 1327 holdsAt( appearance( id4 )=visible, 53080 ). holdsAt( appearance( id5 )=visible, 53080 ). % Frame number: 1328 holdsAt( appearance( id4 )=visible, 53120 ). holdsAt( appearance( id5 )=visible, 53120 ). % Frame number: 1329 holdsAt( orientation( id4 )=90, 53160 ). holdsAt( appearance( id4 )=visible, 53160 ). holdsAt( appearance( id5 )=visible, 53160 ). % Frame number: 1330 holdsAt( appearance( id4 )=visible, 53200 ). holdsAt( appearance( id5 )=visible, 53200 ). % Frame number: 1331 holdsAt( appearance( id4 )=visible, 53240 ). holdsAt( appearance( id5 )=visible, 53240 ). % Frame number: 1332 holdsAt( appearance( id4 )=visible, 53280 ). holdsAt( appearance( id5 )=visible, 53280 ). % Frame number: 1333 holdsAt( appearance( id4 )=visible, 53320 ). holdsAt( appearance( id5 )=visible, 53320 ). % Frame number: 1334 holdsAt( appearance( id4 )=visible, 53360 ). holdsAt( appearance( id5 )=visible, 53360 ). % Frame number: 1335 holdsAt( appearance( id4 )=visible, 53400 ). holdsAt( appearance( id5 )=visible, 53400 ). % Frame number: 1336 holdsAt( appearance( id4 )=visible, 53440 ). holdsAt( appearance( id5 )=visible, 53440 ). % Frame number: 1337 holdsAt( appearance( id4 )=visible, 53480 ). holdsAt( appearance( id5 )=visible, 53480 ). % Frame number: 1338 holdsAt( appearance( id4 )=visible, 53520 ). holdsAt( appearance( id5 )=visible, 53520 ). % Frame number: 1339 holdsAt( appearance( id4 )=visible, 53560 ). holdsAt( appearance( id5 )=visible, 53560 ). % Frame number: 1340 holdsAt( appearance( id4 )=visible, 53600 ). holdsAt( orientation( id5 )=130, 53600 ). holdsAt( appearance( id5 )=visible, 53600 ). % Frame number: 1341 holdsAt( appearance( id4 )=visible, 53640 ). holdsAt( appearance( id5 )=visible, 53640 ). % Frame number: 1342 holdsAt( orientation( id4 )=118, 53680 ). holdsAt( appearance( id4 )=visible, 53680 ). holdsAt( appearance( id5 )=visible, 53680 ). % Frame number: 1343 holdsAt( appearance( id4 )=visible, 53720 ). holdsAt( orientation( id5 )=119, 53720 ). holdsAt( appearance( id5 )=visible, 53720 ). % Frame number: 1344 holdsAt( appearance( id4 )=visible, 53760 ). holdsAt( appearance( id5 )=visible, 53760 ). % Frame number: 1345 holdsAt( appearance( id4 )=visible, 53800 ). holdsAt( appearance( id5 )=visible, 53800 ). % Frame number: 1346 holdsAt( orientation( id4 )=118, 53840 ). holdsAt( appearance( id4 )=visible, 53840 ). holdsAt( appearance( id5 )=visible, 53840 ). % Frame number: 1347 holdsAt( appearance( id4 )=visible, 53880 ). holdsAt( orientation( id5 )=112, 53880 ). holdsAt( appearance( id5 )=visible, 53880 ). % Frame number: 1348 holdsAt( appearance( id4 )=visible, 53920 ). holdsAt( appearance( id5 )=visible, 53920 ). % Frame number: 1349 holdsAt( appearance( id4 )=visible, 53960 ). holdsAt( appearance( id5 )=visible, 53960 ). % Frame number: 1350 holdsAt( appearance( id4 )=visible, 54000 ). holdsAt( appearance( id5 )=visible, 54000 ). % Frame number: 1351 holdsAt( appearance( id4 )=visible, 54040 ). holdsAt( appearance( id5 )=visible, 54040 ). % Frame number: 1352 holdsAt( appearance( id4 )=visible, 54080 ). holdsAt( appearance( id5 )=visible, 54080 ). % Frame number: 1353 holdsAt( appearance( id4 )=visible, 54120 ). holdsAt( appearance( id5 )=visible, 54120 ). % Frame number: 1354 holdsAt( appearance( id4 )=disappear, 54160 ). holdsAt( orientation( id5 )=112, 54160 ). holdsAt( appearance( id5 )=visible, 54160 ). % Frame number: 1355 holdsAt( appearance( id5 )=visible, 54200 ). % Frame number: 1356 holdsAt( appearance( id5 )=visible, 54240 ). % Frame number: 1357 holdsAt( appearance( id5 )=visible, 54280 ). % Frame number: 1358 holdsAt( appearance( id5 )=visible, 54320 ). % Frame number: 1359 holdsAt( appearance( id5 )=visible, 54360 ). % Frame number: 1360 holdsAt( appearance( id5 )=visible, 54400 ). % Frame number: 1361 holdsAt( appearance( id5 )=visible, 54440 ). % Frame number: 1362 holdsAt( appearance( id5 )=visible, 54480 ). % Frame number: 1363 holdsAt( appearance( id5 )=visible, 54520 ). % Frame number: 1364 holdsAt( appearance( id5 )=visible, 54560 ). % Frame number: 1365 holdsAt( appearance( id5 )=visible, 54600 ). % Frame number: 1366 holdsAt( appearance( id5 )=visible, 54640 ). % Frame number: 1367 holdsAt( appearance( id5 )=visible, 54680 ). % Frame number: 1368 holdsAt( appearance( id5 )=visible, 54720 ). % Frame number: 1369 holdsAt( appearance( id5 )=visible, 54760 ). % Frame number: 1370 holdsAt( appearance( id5 )=visible, 54800 ). % Frame number: 1371 holdsAt( appearance( id5 )=visible, 54840 ). % Frame number: 1372 holdsAt( appearance( id5 )=visible, 54880 ). % Frame number: 1373 holdsAt( appearance( id5 )=visible, 54920 ). % Frame number: 1374 holdsAt( appearance( id5 )=visible, 54960 ). % Frame number: 1375 holdsAt( appearance( id5 )=visible, 55000 ). % Frame number: 1376 holdsAt( appearance( id5 )=visible, 55040 ). % Frame number: 1377 holdsAt( appearance( id5 )=visible, 55080 ). % Frame number: 1378 holdsAt( appearance( id5 )=visible, 55120 ). % Frame number: 1379 holdsAt( appearance( id5 )=visible, 55160 ). % Frame number: 1380 holdsAt( appearance( id5 )=visible, 55200 ). % Frame number: 1381 holdsAt( appearance( id5 )=visible, 55240 ). % Frame number: 1382 holdsAt( appearance( id5 )=visible, 55280 ). % Frame number: 1383 holdsAt( appearance( id5 )=visible, 55320 ). % Frame number: 1384 holdsAt( orientation( id5 )=159, 55360 ). holdsAt( appearance( id5 )=visible, 55360 ). % Frame number: 1385 holdsAt( appearance( id5 )=visible, 55400 ). % Frame number: 1386 holdsAt( appearance( id5 )=visible, 55440 ). % Frame number: 1387 holdsAt( appearance( id5 )=visible, 55480 ). % Frame number: 1388 holdsAt( appearance( id5 )=visible, 55520 ). % Frame number: 1389 holdsAt( appearance( id5 )=visible, 55560 ). % Frame number: 1390 holdsAt( appearance( id5 )=visible, 55600 ). % Frame number: 1391 holdsAt( appearance( id5 )=visible, 55640 ). % Frame number: 1392 holdsAt( appearance( id5 )=visible, 55680 ). % Frame number: 1393 holdsAt( appearance( id5 )=visible, 55720 ). % Frame number: 1394 holdsAt( appearance( id5 )=visible, 55760 ). % Frame number: 1395 holdsAt( appearance( id5 )=visible, 55800 ). % Frame number: 1396 holdsAt( appearance( id5 )=visible, 55840 ). % Frame number: 1397 holdsAt( appearance( id5 )=visible, 55880 ). % Frame number: 1398 holdsAt( appearance( id5 )=visible, 55920 ). % Frame number: 1399 holdsAt( appearance( id5 )=visible, 55960 ). % Frame number: 1400 holdsAt( appearance( id5 )=visible, 56000 ). % Frame number: 1401 holdsAt( appearance( id5 )=visible, 56040 ). % Frame number: 1402 holdsAt( appearance( id5 )=visible, 56080 ). % Frame number: 1403 holdsAt( appearance( id5 )=visible, 56120 ). % Frame number: 1404 holdsAt( appearance( id5 )=visible, 56160 ). % Frame number: 1405 holdsAt( appearance( id5 )=visible, 56200 ). % Frame number: 1406 holdsAt( appearance( id5 )=visible, 56240 ). % Frame number: 1407 holdsAt( appearance( id5 )=visible, 56280 ). % Frame number: 1408 holdsAt( appearance( id5 )=visible, 56320 ). % Frame number: 1409 holdsAt( appearance( id5 )=visible, 56360 ). % Frame number: 1410 holdsAt( appearance( id5 )=visible, 56400 ). % Frame number: 1411 holdsAt( appearance( id5 )=visible, 56440 ). % Frame number: 1412 holdsAt( appearance( id5 )=visible, 56480 ). % Frame number: 1413 holdsAt( appearance( id5 )=visible, 56520 ). % Frame number: 1414 holdsAt( appearance( id5 )=visible, 56560 ). % Frame number: 1415 holdsAt( appearance( id5 )=visible, 56600 ). % Frame number: 1416 holdsAt( appearance( id5 )=visible, 56640 ). % Frame number: 1417 holdsAt( appearance( id5 )=visible, 56680 ). % Frame number: 1418 holdsAt( appearance( id5 )=visible, 56720 ). % Frame number: 1419 holdsAt( appearance( id5 )=visible, 56760 ). % Frame number: 1420 holdsAt( orientation( id5 )=63, 56800 ). holdsAt( appearance( id5 )=disappear, 56800 ).
JasonFil/Prob-EC
dataset/strong-noise/14-LeftBag/lb1gtAppearenceIndv.pl
Perl
bsd-3-clause
139,303
#!/usr/bin/perl -w use strict; use warnings; use CGI; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); # CGI my $q = CGI->new; # Redirect print $q->redirect("http://".$ENV{SERVER_NAME}.":6789");
Ximi1970/spksrc-ximi
spk/nzbget/src/app/nzbget.cgi.pl
Perl
bsd-3-clause
201
package NTPPool::Control::API; use strict; use base qw(Combust::Control::API NTPPool::Control::Manage); use NTPPool::API; sub post_process { my $self = shift; $self->request->header_out('Cache-Control' => 'private'); return $self->SUPER::post_process(@_); } 1;
punitvara/ntppool
lib/NTPPool/Control/API.pm
Perl
apache-2.0
276
# please insert nothing before this line: -*- mode: cperl; cperl-indent-level: 4; cperl-continued-statement-offset: 4; indent-tabs-mode: nil -*- # 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. # package ModPerl::FunctionMap; use strict; use warnings FATAL => 'all'; use ModPerl::MapUtil qw(); use ModPerl::ParseSource (); our @ISA = qw(ModPerl::MapBase); sub new { my $class = shift; bless {}, $class; } #for adding to function.map sub generate { my $self = shift; my $missing = $self->check; return unless $missing; print " $_\n" for @$missing; } sub disabled { shift->{disabled} } #look for functions that do not exist in *.map sub check { my $self = shift; my $map = $self->get; my @missing; my $mp_func = ModPerl::ParseSource->wanted_functions; for my $name (map $_->{name}, @{ $self->function_table() }) { next if exists $map->{$name}; push @missing, $name unless $name =~ /^($mp_func)/o; } return @missing ? \@missing : undef; } #look for functions in *.map that do not exist my $special_name = qr{(^DEFINE_|DESTROY$)}; sub check_exists { my $self = shift; my %functions = map { $_->{name}, 1 } @{ $self->function_table() }; my @missing = (); for my $name (keys %{ $self->{map} }) { next if $functions{$name}; push @missing, $name unless $name =~ $special_name; } return @missing ? \@missing : undef; } my $keywords = join '|', qw(MODULE PACKAGE PREFIX BOOT); sub guess_prefix { my $entry = shift; my ($name, $class) = ($entry->{name}, $entry->{class}); my $prefix = ""; $name =~ s/^DEFINE_//; $name =~ s/^mpxs_//i; (my $modprefix = ($entry->{class} || $entry->{module}) . '_') =~ s/::/__/g; (my $guess = lc $modprefix) =~ s/_+/_/g; $guess =~ s/(apache2)_/($1|ap)_{1,2}/; if ($name =~ s/^($guess|$modprefix).*/$1/i) { $prefix = $1; } else { if ($name =~ /^(apr?_)/) { $prefix = $1; } } #print "GUESS prefix=$guess, name=$entry->{name} -> $prefix\n"; return $prefix; } sub parse { my ($self, $fh, $map) = @_; my %cur; my $disabled = 0; while ($fh->readline) { if (/($keywords)=/o) { $disabled = s/^\W//; #module is disabled my %words = $self->parse_keywords($_); if ($words{MODULE}) { %cur = (); } if ($words{PACKAGE}) { delete $cur{CLASS}; } for (keys %words) { $cur{$_} = $words{$_}; } next; } my ($name, $dispatch, $argspec, $alias) = split /\s*\|\s*/; my $return_type; if ($name =~ s/^([^:]+)://) { $return_type = $1; $return_type =~ s/\s+$//; # allow: char * :.... } if ($name =~ s/^(\W)// or not $cur{MODULE} or $disabled) { #notimplemented or cooked by hand die qq[function '$name' appears more than once in xs/maps files] if $map->{$name}; $map->{$name} = undef; push @{ $self->{disabled}->{ $1 || '!' } }, $name; next; } if (my $package = $cur{PACKAGE}) { unless ($package eq 'guess') { $cur{CLASS} = $package; } if ($cur{ISA}) { $self->{isa}->{ $cur{MODULE} }->{$package} = delete $cur{ISA}; } if ($cur{BOOT}) { $self->{boot}->{ $cur{MODULE} } = delete $cur{BOOT}; } } else { $cur{CLASS} = $cur{MODULE}; } #XXX: make_prefix() stuff should be here, not ModPerl::WrapXS if ($name =~ /^DEFINE_/ and $cur{CLASS}) { $name =~ s{^(DEFINE_)(.*)} {$1 . ModPerl::WrapXS::make_prefix($2, $cur{CLASS})}e; } die qq[function '$name' appears more than once in xs/maps files] if $map->{$name}; my $entry = $map->{$name} = { name => $alias || $name, dispatch => $dispatch, argspec => $argspec ? [split /\s*,\s*/, $argspec] : "", return_type => $return_type, alias => $alias, }; for (keys %cur) { $entry->{lc $_} = $cur{$_}; } #avoid 'use of uninitialized value' warnings $entry->{$_} ||= "" for keys %{ $entry }; if ($entry->{dispatch} =~ /_$/) { $entry->{dispatch} .= $name; } } } sub get { my $self = shift; $self->{map} ||= $self->parse_map_files; } sub prefixes { my $self = shift; $self = ModPerl::FunctionMap->new unless ref $self; my $map = $self->get; my %prefix; while (my ($name, $ent) = each %$map) { next unless $ent->{prefix}; $prefix{ $ent->{prefix} }++; } $prefix{$_} = 1 for qw(ap_ apr_); #make sure we get these [keys %prefix] } 1; __END__
dreamhost/dpkg-ndn-perl-mod-perl
lib/ModPerl/FunctionMap.pm
Perl
apache-2.0
5,733
#!/usr/bin/perl # Generate error.c # # Usage: ./generate_errors.pl or scripts/generate_errors.pl without arguments, # or generate_errors.pl include_dir data_dir error_file use strict; my ($include_dir, $data_dir, $error_file); if( @ARGV ) { die "Invalid number of arguments" if scalar @ARGV != 3; ($include_dir, $data_dir, $error_file) = @ARGV; -d $include_dir or die "No such directory: $include_dir\n"; -d $data_dir or die "No such directory: $data_dir\n"; } else { $include_dir = 'include/mbedtls'; $data_dir = 'scripts/data_files'; $error_file = 'library/error.c'; unless( -d $include_dir && -d $data_dir ) { chdir '..' or die; -d $include_dir && -d $data_dir or die "Without arguments, must be run from root or scripts\n" } } my $error_format_file = $data_dir.'/error.fmt'; my @low_level_modules = qw( AES ARC4 ASN1 BASE64 BIGNUM BLOWFISH CAMELLIA CCM CMAC CTR_DRBG DES ENTROPY GCM HMAC_DRBG MD2 MD4 MD5 NET OID PADLOCK PBKDF2 RIPEMD160 SHA1 SHA256 SHA512 THREADING XTEA ); my @high_level_modules = qw( CIPHER DHM ECP MD PEM PK PKCS12 PKCS5 RSA SSL X509 ); my $line_separator = $/; undef $/; open(FORMAT_FILE, "$error_format_file") or die "Opening error format file '$error_format_file': $!"; my $error_format = <FORMAT_FILE>; close(FORMAT_FILE); $/ = $line_separator; my @files = <$include_dir/*.h>; my @matches; foreach my $file (@files) { open(FILE, "$file"); my @grep_res = grep(/^\s*#define\s+MBEDTLS_ERR_\w+\s+\-0x[0-9A-Fa-f]+/, <FILE>); push(@matches, @grep_res); close FILE; } my $ll_old_define = ""; my $hl_old_define = ""; my $ll_code_check = ""; my $hl_code_check = ""; my $headers = ""; my %error_codes_seen; foreach my $line (@matches) { next if ($line =~ /compat-1.2.h/); my ($error_name, $error_code) = $line =~ /(MBEDTLS_ERR_\w+)\s+\-(0x\w+)/; my ($description) = $line =~ /\/\*\*< (.*?)\.? \*\//; die "Duplicated error code: $error_code ($error_name)\n" if( $error_codes_seen{$error_code}++ ); $description =~ s/\\/\\\\/g; if ($description eq "") { $description = "DESCRIPTION MISSING"; warn "Missing description for $error_name\n"; } my ($module_name) = $error_name =~ /^MBEDTLS_ERR_([^_]+)/; # Fix faulty ones $module_name = "BIGNUM" if ($module_name eq "MPI"); $module_name = "CTR_DRBG" if ($module_name eq "CTR"); $module_name = "HMAC_DRBG" if ($module_name eq "HMAC"); my $define_name = $module_name; $define_name = "X509_USE,X509_CREATE" if ($define_name eq "X509"); $define_name = "ASN1_PARSE" if ($define_name eq "ASN1"); $define_name = "SSL_TLS" if ($define_name eq "SSL"); $define_name = "PEM_PARSE,PEM_WRITE" if ($define_name eq "PEM"); my $include_name = $module_name; $include_name =~ tr/A-Z/a-z/; $include_name = "" if ($include_name eq "asn1"); # Fix faulty ones $include_name = "net_sockets" if ($module_name eq "NET"); my $found_ll = grep $_ eq $module_name, @low_level_modules; my $found_hl = grep $_ eq $module_name, @high_level_modules; if (!$found_ll && !$found_hl) { printf("Error: Do not know how to handle: $module_name\n"); exit 1; } my $code_check; my $old_define; my $white_space; my $first; if ($found_ll) { $code_check = \$ll_code_check; $old_define = \$ll_old_define; $white_space = ' '; } else { $code_check = \$hl_code_check; $old_define = \$hl_old_define; $white_space = ' '; } if ($define_name ne ${$old_define}) { if (${$old_define} ne "") { ${$code_check} .= "#endif /* "; $first = 0; foreach my $dep (split(/,/, ${$old_define})) { ${$code_check} .= " || " if ($first++); ${$code_check} .= "MBEDTLS_${dep}_C"; } ${$code_check} .= " */\n\n"; } ${$code_check} .= "#if "; $headers .= "#if " if ($include_name ne ""); $first = 0; foreach my $dep (split(/,/, ${define_name})) { ${$code_check} .= " || " if ($first); $headers .= " || " if ($first++); ${$code_check} .= "defined(MBEDTLS_${dep}_C)"; $headers .= "defined(MBEDTLS_${dep}_C)" if ($include_name ne ""); } ${$code_check} .= "\n"; $headers .= "\n#include \"mbedtls/${include_name}.h\"\n". "#endif\n\n" if ($include_name ne ""); ${$old_define} = $define_name; } if ($error_name eq "MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE") { ${$code_check} .= "${white_space}if( use_ret == -($error_name) )\n". "${white_space}\{\n". "${white_space} mbedtls_snprintf( buf, buflen, \"$module_name - $description\" );\n". "${white_space} return;\n". "${white_space}}\n" } else { ${$code_check} .= "${white_space}if( use_ret == -($error_name) )\n". "${white_space} mbedtls_snprintf( buf, buflen, \"$module_name - $description\" );\n" } }; if ($ll_old_define ne "") { $ll_code_check .= "#endif /* "; my $first = 0; foreach my $dep (split(/,/, $ll_old_define)) { $ll_code_check .= " || " if ($first++); $ll_code_check .= "MBEDTLS_${dep}_C"; } $ll_code_check .= " */\n"; } if ($hl_old_define ne "") { $hl_code_check .= "#endif /* "; my $first = 0; foreach my $dep (split(/,/, $hl_old_define)) { $hl_code_check .= " || " if ($first++); $hl_code_check .= "MBEDTLS_${dep}_C"; } $hl_code_check .= " */\n"; } $error_format =~ s/HEADER_INCLUDED\n/$headers/g; $error_format =~ s/LOW_LEVEL_CODE_CHECKS\n/$ll_code_check/g; $error_format =~ s/HIGH_LEVEL_CODE_CHECKS\n/$hl_code_check/g; open(ERROR_FILE, ">$error_file") or die "Opening destination file '$error_file': $!"; print ERROR_FILE $error_format; close(ERROR_FILE);
gandreello/openthread
third_party/mbedtls/repo/scripts/generate_errors.pl
Perl
bsd-3-clause
6,330
# The SEED Toolkit is free software. You can redistribute # it and/or modify it under the terms of the SEED Toolkit # Public License. # # You should have received a copy of the SEED Toolkit Public License # along with this program; if not write to the University of Chicago # at info@ci.uchicago.edu or the Fellowship for Interpretation of # Genomes at veronika@thefig.info or download a copy from # http://www.theseed.org/LICENSE.TXT. # # # This is a SAS component. # package BBasicLocation; use strict; use base qw(BasicLocation); =head2 Backward Basic BasicLocation Object A I<backward location object> is a location in a contig that is transcribed from right to left. It is a subclass of the B<BasicLocation> object, and contains methods that require different implementation for a forward location than a backward location. =head2 Override Methods =head3 Left my $leftPoint = $loc->Left; Return the offset of the leftmost point of the location. =cut sub Left { return $_[0]->{_end}; } =head3 Right my $rightPoint = $loc->Right; Return the offset of the rightmost point of the location. =cut sub Right { return $_[0]->{_beg}; } =head3 Compare my ($distance, $cmp) = $loc->Compare($point); Determine the relative location of the specified point on the contig. Returns a distance, which indicates the location relative to the leftmost point of the contig, and a comparison number, which is negative if the point is to the left of the location, zero if the point is inside the location, and positive if the point is to the right of the location. =cut sub Compare { # Get the parameters. my ($self, $point) = @_; # Compute the distance from the end (leftmost) point. my $distance = $point - $self->{_end}; # Set the comparison value. The distance works unless it is positive and less than # the length. In that case, it's inside the location so we want to return 0. my $cmp = (defined $self->IfValid($distance) ? 0 : $distance); # Return the results. return ($distance, $cmp); } =head3 Split my $newLocation = $loc->Split($offset); Split this location into two smaller ones at the specified offset from the left endpoint. The new location split off of it will be returned. If the offset is at either end of the location, no split will occur and an underfined value will be returned. =over 4 =item offset Offset into the location from the left endpoint of the point at which it should be split. =item RETURN The new location split off of this one, or an undefined value if no split was necessary. =back =cut sub Split { # Get the parameters. my ($self, $offset) = @_; # Declare the return variable. my $retVal; # Only proceed if a split is necessary. if ($offset > 0 && $offset < $self->{_len}) { # Save the current ending point. my $oldEndpoint = $self->{_end}; # Update this location's ending point and length. $self->{_end} += $offset; $self->{_len} -= $offset; # Create the new location. $retVal = BasicLocation->new($self->{_contigID}, $oldEndpoint + $offset - 1, '-', $offset); } # Return the new location object. return $retVal; } =head3 Peel my $peel = $loc->Peel($length); Peel a specified number of positions off the beginning of the location. Peeling splits a location at a specified offset from the beginning, while splitting takes it at a specified offset from the left point. If the specified length is equal to or longer than the location's length, an undefined value will be returned. =over 4 =item length Number of positions to split from the location. =item RETURN Returns a new location formed by splitting positions off of the existing location, which is shortened accordingly. If the specified length is longer than the location's length, an undefined value is returned and the location is not modified. =back =cut sub Peel { # Get the parameters. my ($self, $length) = @_; # Declare the return variable. my $retVal; # Only proceed if a split is necessary. if ($length < $self->{_len}) { # Save the current begin point. my $oldBegpoint = $self->{_beg}; # Update this location's begin point and length. We're peeling from the beginning, # which for this type of location means the segment is chopped off the right end. $self->{_beg} -= $length; $self->{_len} -= $length; # Create the new location. $retVal = BasicLocation->new($self->{_contigID}, $oldBegpoint, '-', $length); } # Return the new location object. return $retVal; } =head3 Reverse $loc->Reverse; Change the polarity of the location. The location will have the same nucleotide range, but the direction will be changed. =cut sub Reverse { # Get the parameters. my ($self) = @_; # Swap the beginning and end, then update the direction. ($self->{_beg}, $self->{_end}) = ($self->{_end}, $self->{_beg}); $self->{_dir} = '+'; # Re-bless us as a forward location. bless $self, "FBasicLocation"; } =head3 PointIndex my $index = $loc->PointIndex($point); Return the index of the specified point in this location. The value returned is the distance from the beginning. If the specified point is not in the location, an undefined value is returned. =over 4 =item point Offset into the contig of the point in question. =item RETURN Returns the distance of the point from the beginning of the location, or an undefined value if the point is outside the location. =back =cut sub PointIndex { # Get the parameters. my ($self, $point) = @_; # Compute the distance from the beginning. Because we are in a backward location, this # means subtracting the point's offset from the beginning's offset. my $retVal = $self->IfValid($self->{_beg} - $point); # Return the result. return $retVal; } =head3 PointOffset my $offset = $loc->PointOffset($index); Return the offset into the contig of the point at the specified position in the location. A position of 0 will return the beginning point, a position of 1 returns the point next to that, and a position 1 less than the length will return the ending point. =over 4 =item index Index into the location of the relevant point. =item RETURN Returns an offset into the contig of the specified point in the location. =back =cut sub PointOffset { # Get the parameters. my ($self, $index) = @_; # Return the offset. This is a backward location, so we subtract it from the begin point. return $self->{_beg} - $index; } =head3 SetBegin $loc->SetBegin($newBegin); Change the begin point of this location without changing the endpoint. =over 4 =item newBegin Proposed new beginning point. =back =cut sub SetBegin { # Get the parameters. my ($self, $newBegin) = @_; # Update the begin point. $self->{_beg} = $newBegin; # Adjust the length. $self->{_len} = $self->{_beg} - $self->{_end} + 1; } =head3 SetEnd $loc->SetEnd($newEnd); Change the endpoint of this location without changing the begin point. =over 4 =item newEnd Proposed new ending point. =back =cut sub SetEnd { # Get the parameters. my ($self, $newEnd) = @_; # Update the end point. $self->{_end} = $newEnd; # Adjust the length. $self->{_len} = $self->{_beg} - $self->{_end} + 1; } =head3 Widen my = $loc->Widen($distance, $max); Add the specified distance to each end of the location, taking care not to extend past either end of the contig. The contig length must be provided to insure we don't fall off the far end; otherwise, only the leftward expansion is limited. =over 4 =item distance Number of positions to add to both ends of the location. =item max (optional) Maximum possible value for the right end of the location. =back =cut sub Widen { # Get the parameters. my ($self, $distance, $max) = @_; # Subtract the distance from the end point. my $newEnd = BasicLocation::max(1, $self->EndPoint - $distance); $self->SetEnd($newEnd); # Add the distance to the begin point, keeping track of the maximum. my $newBegin = $self->Begin + $distance; if ($max && $newBegin > $max) { $newBegin = $max; } $self->SetBegin($newBegin); } =head3 Upstream my $newLoc = $loc->Upstream($distance, $max); Return a new location upstream of the given location, taking care not to extend past either end of the contig. =over 4 =item distance Number of positions to add to the front (upstream) of the location. =item max (optional) Maximum possible value for the right end of the location. =item RETURN Returns a new location object whose last position is next to the first position of this location. =back =cut sub Upstream { # Get the parameters. my ($self, $distance, $max) = @_; # Add the distance to the begin point, keeping the position safe. my $newBegin = $self->Begin + $distance; if ($max && $newBegin > $max) { $newBegin = $max; } # Compute the new length. It may be zero. my $len = $newBegin - $self->Begin; # Return the result. return BasicLocation->new($self->Contig, $newBegin, "-", $len); } =head3 Truncate $loc->Truncate($len); Truncate the location to a new length. If the length is larger than the location length, then the location is not changed. =over 4 =item len Proposed new length for the location. =back =cut sub Truncate { # Get the parameters. my ($self, $len) = @_; # Only proceed if the new length would be shorter. if ($len < $self->Length) { $self->SetEnd($self->Begin - $len + 1); } } =head3 Adjacent my $okFlag = $loc->Adjacent($other); Return TRUE if the other location is adjacent to this one, else FALSE. The other location must have the same direction and start immediately after this location's endpoint. =over 4 =item other BasicLocation object for the other location. =item RETURN Returns TRUE if the other location is an extension of this one, else FALSE. =back =cut sub Adjacent { # Get the parameters. my ($self, $other) = @_; # Default to non-adjacent. my $retVal = 0; # Only proceed if the contigs and directions are the seme. if ($self->Dir eq $other->Dir && $self->Contig eq $other->Contig) { # Check the begin and end points. $retVal = ($self->EndPoint - 1 == $other->Begin); } # Return the determination indicator. return $retVal; } =head3 Combine $loc->Combine($other); Combine another location with this one. The result will contain all bases in both original locations. Both locations must have the same contig ID and direction. =over 4 =item other Other location to combine with this one. =back =cut sub Combine { # Get the parameters. my ($self, $other) = @_; # If the other location ends past our end, move the endpoint. if ($other->EndPoint < $self->EndPoint) { $self->SetEnd($other->EndPoint); } # If the other location starts before our begin, move the begin point. if ($other->Begin > $self->Begin) { $self->SetBegin($other->Begin); } } =head3 NumDirection my $multiplier = $loc->NumDirection(); Return C<1> if this is a forward location, C<-1> if it is a backward location. =cut sub NumDirection { return -1; } =head3 Lengthen my = $loc->Lengthen($distance, $max); Add the specified distance to the end of the location, taking care not to extend past either end of the contig. The contig length must be provided to insure we don't fall off the far end; otherwise, only the leftward expansion is limited. =over 4 =item distance Number of positions to add to the end of the location. =item max (optional) Maximum possible value for the right end of the location. =back =cut sub Lengthen { # Get the parameters. my ($self, $distance, $max) = @_; # Subtract the distance from the end point, keeping track of the minimum. my $newEnd = $self->EndPoint - $distance; if ($newEnd <= 0) { $newEnd = 1; } $self->SetEnd($newEnd); } =head3 ExtendUpstream $loc->ExtendUpstream($distance, $max); Extend the location upstream by the specified distance, taking care not to go past either end of the contig. =over 4 =item distance Number of base pairs to extend upstream. =item max Length of the contig, used to insure we don't extend too far. =back =cut sub ExtendUpstream { # Get the parameters. my ($self, $distance, $max) = @_; # Compute the new begin point. my $newBegin = BasicLocation::min($self->Begin + $distance, $max); # Update the location. $self->SetBegin($newBegin); } =head3 OverlapRegion my ($start, $len) = $loc->OverlapRegion($loc2); Return the starting offset and length of the overlap region between this location and a specified other location. Both regions must have the same direction. =over 4 =item loc2 Other location to check. =item RETURN Returns a two-element list consisting of the 0-based offset of the first position within this location that the other location overlaps, and the number of overlapping positions. If there is no overlap, the start offset comes back undefined and the overlap length is 0. =back =cut sub OverlapRegion { # Get the parameters. my ($self, $loc2) = @_; # Default to no overlap. my ($start, $len) = (undef, 0); # Check for types of overlap. if ($loc2->Begin > $self->Begin) { if ($loc2->EndPoint <= $self->Begin) { # Here the overlap starts at the beginning and goes to the end of # our region or the end of the other region, whichever comes first. $start = 0; $len = BasicLocation::min($self->Begin - $loc2->EndPoint + 1, $self->Length); } } elsif ($loc2->Begin >= $self->EndPoint) { # Here the overlap starts at the beginning of the other region and goes # to the end of our region or the end of the other region, whichever # comes first. $start = $self->Begin - $loc2->Begin; $len = BasicLocation::min($loc2->Begin - $self->EndPoint + 1, $loc2->Length); } # Return the results. return ($start, $len); } =head3 Gap my $flag = $loc->Gap($loc2); Return the distance between the end of this location and the beginning of the specified other location. This can be used as the gap distance when doing an operon check. =over 4 =item loc2 Specified other location. It is assumed both locations share the same contig. =item RETURN Returns the number of bases downstream from the end of this location to the beginning of the next one. If the next location begins upstream of this location's end point, the returned value will be negative. =back =cut sub Gap { # Get the parameters. my ($self, $loc2) = @_; # Declare the return variable. my $retVal = $self->EndPoint - $loc2->Begin; # Return the result. return $retVal; } =head3 Tail $loc->Tail($len) Reduce the length of the location to the specified amount at the end of the location's span. =over 4 =item len Length of the tail area to keep. =back =cut sub Tail { # Get the parameters. my ($self, $len) = @_; # Move the begin point closer to the end. $self->{_beg} = $self->{_end} + $len - 1; $self->{_len} = $len; } 1;
janakagithub/atomic_regulons
lib/atomic_regulons/BBasicLocation.pm
Perl
mit
15,438
=for maintainers Generated by perlmodlib.PL -- DO NOT EDIT! =head1 NAME perlmodlib - constructing new Perl modules and finding existing ones =head1 THE PERL MODULE LIBRARY Many modules are included in the Perl distribution. These are described below, and all end in F<.pm>. You may discover compiled library files (usually ending in F<.so>) or small pieces of modules to be autoloaded (ending in F<.al>); these were automatically generated by the installation process. You may also discover files in the library directory that end in either F<.pl> or F<.ph>. These are old libraries supplied so that old programs that use them still run. The F<.pl> files will all eventually be converted into standard modules, and the F<.ph> files made by B<h2ph> will probably end up as extension modules made by B<h2xs>. (Some F<.ph> values may already be available through the POSIX, Errno, or Fcntl modules.) The B<pl2pm> file in the distribution may help in your conversion, but it's just a mechanical process and therefore far from bulletproof. =head2 Pragmatic Modules They work somewhat like compiler directives (pragmata) in that they tend to affect the compilation of your program, and thus will usually work well only when used within a C<use>, or C<no>. Most of these are lexically scoped, so an inner BLOCK may countermand them by saying: no integer; no strict 'refs'; no warnings; which lasts until the end of that BLOCK. Some pragmas are lexically scoped--typically those that affect the C<$^H> hints variable. Others affect the current package instead, like C<use vars> and C<use subs>, which allow you to predeclare a variables or subroutines within a particular I<file> rather than just a block. Such declarations are effective for the entire file for which they were declared. You cannot rescind them with C<no vars> or C<no subs>. The following pragmas are defined (and have their own documentation). =over 12 =item arybase Set indexing base via $[ =item attributes Get/set subroutine or variable attributes =item autodie Replace functions with ones that succeed or die with lexical scope =item autodie::exception Exceptions from autodying functions. =item autodie::exception::system Exceptions from autodying system(). =item autodie::hints Provide hints about user subroutines to autodie =item autouse Postpone load of modules until a function is used =item base Establish an ISA relationship with base classes at compile time =item bigint Transparent BigInteger support for Perl =item bignum Transparent BigNumber support for Perl =item bigrat Transparent BigNumber/BigRational support for Perl =item blib Use MakeMaker's uninstalled version of a package =item bytes Force byte semantics rather than character semantics =item charnames Access to Unicode character names and named character sequences; also define character names =item constant Declare constants =item deprecate Perl pragma for deprecating the core version of a module =item diagnostics Produce verbose warning diagnostics =item encoding Allows you to write your script in non-ascii or non-utf8 =item encoding::warnings Warn on implicit encoding conversions =item feature Enable new features =item fields Compile-time class fields =item filetest Control the filetest permission operators =item if C<use> a Perl module if a condition holds =item inc::latest Use modules bundled in inc/ if they are newer than installed ones =item integer Use integer arithmetic instead of floating point =item less Request less of something =item lib Manipulate @INC at compile time =item locale Use or avoid POSIX locales for built-in operations =item mro Method Resolution Order =item open Set default PerlIO layers for input and output =item ops Restrict unsafe operations when compiling =item overload Package for overloading Perl operations =item overloading Lexically control overloading =item parent Establish an ISA relationship with base classes at compile time =item perldoc Look up Perl documentation in Pod format. =item perlfaq Frequently asked questions about Perl =item perlfaq1 General Questions About Perl =item perlfaq2 Obtaining and Learning about Perl =item perlfaq3 Programming Tools =item perlfaq4 Data Manipulation =item perlfaq5 Files and Formats =item perlfaq6 Regular Expressions =item perlfaq7 General Perl Language Issues =item perlfaq8 System Interaction =item perlfaq9 Web, Email and Networking =item perlfunc Perl builtin functions =item perlglossary Perl Glossary =item perlpodspeccopy Plain Old Documentation: format specification and notes =item perlvarcopy Perl predefined variables =item perlxs XS language reference manual =item perlxstut Tutorial for writing XSUBs =item perlxstypemap Perl XS C/Perl type mapping =item re Alter regular expression behaviour =item sigtrap Enable simple signal handling =item sort Control sort() behaviour =item strict Restrict unsafe constructs =item subs Predeclare sub names =item threads Perl interpreter-based threads =item threads::shared Perl extension for sharing data structures between threads =item utf8 Enable/disable UTF-8 (or UTF-EBCDIC) in source code =item vars Predeclare global variable names (obsolete) =item version Perl extension for Version Objects =item vmsish Control VMS-specific language features =item warnings Control optional warnings =item warnings::register Warnings import function =back =head2 Standard Modules Standard, bundled modules are all expected to behave in a well-defined manner with respect to namespace pollution because they use the Exporter module. See their own documentation for details. It's possible that not all modules listed below are installed on your system. For example, the GDBM_File module will not be installed if you don't have the gdbm library. =over 12 =item AnyDBM_File Provide framework for multiple DBMs =item App::Cpan Easily interact with CPAN from the command line =item App::Prove Implements the C<prove> command. =item App::Prove::State State storage for the C<prove> command. =item App::Prove::State::Result Individual test suite results. =item App::Prove::State::Result::Test Individual test results. =item Archive::Extract A generic archive extracting mechanism =item Archive::Tar Module for manipulations of tar archives =item Archive::Tar::File A subclass for in-memory extracted file from Archive::Tar =item Attribute::Handlers Simpler definition of attribute handlers =item AutoLoader Load subroutines only on demand =item AutoSplit Split a package for autoloading =item B The Perl Compiler Backend =item B::Concise Walk Perl syntax tree, printing concise info about ops =item B::Debug Walk Perl syntax tree, printing debug info about ops =item B::Deparse Perl compiler backend to produce perl code =item B::Lint Perl lint =item B::Lint::Debug Adds debugging stringification to B:: =item B::Showlex Show lexical variables used in functions or files =item B::Terse Walk Perl syntax tree, printing terse info about ops =item B::Xref Generates cross reference reports for Perl programs =item Benchmark Benchmark running times of Perl code =item C<Socket> Networking constants and support functions =item CGI Handle Common Gateway Interface requests and responses =item CGI::Apache Backward compatibility module for CGI.pm =item CGI::Carp CGI routines for writing to the HTTPD (or other) error log =item CGI::Cookie Interface to HTTP Cookies =item CGI::Fast CGI Interface for Fast CGI =item CGI::Pretty Module to produce nicely formatted HTML code =item CGI::Push Simple Interface to Server Push =item CGI::Switch Backward compatibility module for defunct CGI::Switch =item CGI::Util Internal utilities used by CGI module =item CORE Namespace for Perl's core routines =item CPAN Query, download and build perl modules from CPAN sites =item CPAN::API::HOWTO A recipe book for programming with CPAN.pm =item CPAN::Distroprefs Read and match distroprefs =item CPAN::FirstTime Utility for CPAN::Config file Initialization =item CPAN::Kwalify Interface between CPAN.pm and Kwalify.pm =item CPAN::Meta The distribution metadata for a CPAN dist =item CPAN::Meta::Converter Convert CPAN distribution metadata structures =item CPAN::Meta::Feature An optional feature provided by a CPAN distribution =item CPAN::Meta::History History of CPAN Meta Spec changes =item CPAN::Meta::Prereqs A set of distribution prerequisites by phase and type =item CPAN::Meta::Requirements A set of version requirements for a CPAN dist =item CPAN::Meta::Spec Specification for CPAN distribution metadata =item CPAN::Meta::Validator Validate CPAN distribution metadata structures =item CPAN::Meta::YAML Read and write a subset of YAML for CPAN Meta files =item CPAN::Nox Wrapper around CPAN.pm without using any XS module =item CPAN::Version Utility functions to compare CPAN versions =item CPANPLUS API & CLI access to the CPAN mirrors =item CPANPLUS::Backend Programmer's interface to CPANPLUS =item CPANPLUS::Backend::RV Return value objects =item CPANPLUS::Config Configuration defaults and heuristics for CPANPLUS =item CPANPLUS::Configure Configuration for CPANPLUS =item CPANPLUS::Dist Base class for plugins =item CPANPLUS::Dist::Autobundle Distribution class for installation snapshots =item CPANPLUS::Dist::Base Base class for custom distribution classes =item CPANPLUS::Dist::Build CPANPLUS plugin to install packages that use Build.PL =item CPANPLUS::Dist::Build::Constants Constants for CPANPLUS::Dist::Build =item CPANPLUS::Dist::MM Distribution class for MakeMaker related modules =item CPANPLUS::Dist::Sample Sample code to create your own Dist::* plugin =item CPANPLUS::Error Error handling for CPANPLUS =item CPANPLUS::FAQ CPANPLUS Frequently Asked Questions =item CPANPLUS::Hacking Developing CPANPLUS =item CPANPLUS::Internals CPANPLUS internals =item CPANPLUS::Internals::Extract Internals for archive extraction =item CPANPLUS::Internals::Fetch Internals for fetching files =item CPANPLUS::Internals::Report Internals for sending test reports =item CPANPLUS::Internals::Search Internals for searching for modules =item CPANPLUS::Internals::Source Internals for updating source files =item CPANPLUS::Internals::Source::Memory In memory implementation =item CPANPLUS::Internals::Source::SQLite SQLite implementation =item CPANPLUS::Internals::Utils Convenience functions for CPANPLUS =item CPANPLUS::Module CPAN module objects for CPANPLUS =item CPANPLUS::Module::Author CPAN author object for CPANPLUS =item CPANPLUS::Module::Author::Fake Dummy author object for CPANPLUS =item CPANPLUS::Module::Checksums Checking the checksum of a distribution =item CPANPLUS::Module::Fake Fake module object for internal use =item CPANPLUS::Selfupdate Self-updating for CPANPLUS =item CPANPLUS::Shell Base class for CPANPLUS shells =item CPANPLUS::Shell::Classic CPAN.pm emulation for CPANPLUS =item CPANPLUS::Shell::Default The default CPANPLUS shell =item CPANPLUS::Shell::Default::Plugins::CustomSource Add custom sources to CPANPLUS =item CPANPLUS::Shell::Default::Plugins::HOWTO Documentation on how to write your own plugins =item CPANPLUS::Shell::Default::Plugins::Remote Connect to a remote CPANPLUS =item CPANPLUS::Shell::Default::Plugins::Source Read in CPANPLUS commands =item Carp Alternative warn and die for modules =item Class::Struct Declare struct-like datatypes as Perl classes =item Compress::Raw::Bzip2 Low-Level Interface to bzip2 compression library =item Compress::Raw::Zlib Low-Level Interface to zlib compression library =item Compress::Zlib Interface to zlib compression library =item Config Access Perl configuration information =item Cwd Get pathname of current working directory =item DB Programmatic interface to the Perl debugging API =item DBM_Filter Filter DBM keys/values =item DBM_Filter::compress Filter for DBM_Filter =item DBM_Filter::encode Filter for DBM_Filter =item DBM_Filter::int32 Filter for DBM_Filter =item DBM_Filter::null Filter for DBM_Filter =item DBM_Filter::utf8 Filter for DBM_Filter =item DB_File Perl5 access to Berkeley DB version 1.x =item Data::Dumper Stringified perl data structures, suitable for both printing and C<eval> =item Devel::InnerPackage Find all the inner packages of a package =item Devel::PPPort Perl/Pollution/Portability =item Devel::Peek A data debugging tool for the XS programmer =item Devel::SelfStubber Generate stubs for a SelfLoading module =item Digest Modules that calculate message digests =item Digest::MD5 Perl interface to the MD5 Algorithm =item Digest::SHA Perl extension for SHA-1/224/256/384/512 =item Digest::base Digest base class =item Digest::file Calculate digests of files =item DirHandle Supply object methods for directory handles =item Dumpvalue Provides screen dump of Perl data. =item DynaLoader Dynamically load C libraries into Perl code =item Encode Character encodings in Perl =item Encode::Alias Alias definitions to encodings =item Encode::Byte Single Byte Encodings =item Encode::CJKConstants Internally used by Encode::??::ISO_2022_* =item Encode::CN China-based Chinese Encodings =item Encode::CN::HZ Internally used by Encode::CN =item Encode::Config Internally used by Encode =item Encode::EBCDIC EBCDIC Encodings =item Encode::Encoder Object Oriented Encoder =item Encode::Encoding Encode Implementation Base Class =item Encode::GSM0338 ESTI GSM 03.38 Encoding =item Encode::Guess Guesses encoding from data =item Encode::JP Japanese Encodings =item Encode::JP::H2Z Internally used by Encode::JP::2022_JP* =item Encode::JP::JIS7 Internally used by Encode::JP =item Encode::KR Korean Encodings =item Encode::KR::2022_KR Internally used by Encode::KR =item Encode::MIME::Header MIME 'B' and 'Q' header encoding =item Encode::MIME::Name Internally used by Encode =item Encode::PerlIO A detailed document on Encode and PerlIO =item Encode::Supported Encodings supported by Encode =item Encode::Symbol Symbol Encodings =item Encode::TW Taiwan-based Chinese Encodings =item Encode::Unicode Various Unicode Transformation Formats =item Encode::Unicode::UTF7 UTF-7 encoding =item English Use nice English (or awk) names for ugly punctuation variables =item Env Perl module that imports environment variables as scalars or arrays =item Errno System errno constants =item Exporter Implements default import method for modules =item Exporter::Heavy Exporter guts =item ExtUtils::CBuilder Compile and link C code for Perl modules =item ExtUtils::CBuilder::Platform::Windows Builder class for Windows platforms =item ExtUtils::Command Utilities to replace common UNIX commands in Makefiles etc. =item ExtUtils::Command::MM Commands for the MM's to use in Makefiles =item ExtUtils::Constant Generate XS code to import C header constants =item ExtUtils::Constant::Base Base class for ExtUtils::Constant objects =item ExtUtils::Constant::Utils Helper functions for ExtUtils::Constant =item ExtUtils::Constant::XS Generate C code for XS modules' constants. =item ExtUtils::Embed Utilities for embedding Perl in C/C++ applications =item ExtUtils::Install Install files from here to there =item ExtUtils::Installed Inventory management of installed modules =item ExtUtils::Liblist Determine libraries to use and how to use them =item ExtUtils::MM OS adjusted ExtUtils::MakeMaker subclass =item ExtUtils::MM_AIX AIX specific subclass of ExtUtils::MM_Unix =item ExtUtils::MM_Any Platform-agnostic MM methods =item ExtUtils::MM_BeOS Methods to override UN*X behaviour in ExtUtils::MakeMaker =item ExtUtils::MM_Cygwin Methods to override UN*X behaviour in ExtUtils::MakeMaker =item ExtUtils::MM_DOS DOS specific subclass of ExtUtils::MM_Unix =item ExtUtils::MM_Darwin Special behaviors for OS X =item ExtUtils::MM_MacOS Once produced Makefiles for MacOS Classic =item ExtUtils::MM_NW5 Methods to override UN*X behaviour in ExtUtils::MakeMaker =item ExtUtils::MM_OS2 Methods to override UN*X behaviour in ExtUtils::MakeMaker =item ExtUtils::MM_QNX QNX specific subclass of ExtUtils::MM_Unix =item ExtUtils::MM_UWIN U/WIN specific subclass of ExtUtils::MM_Unix =item ExtUtils::MM_Unix Methods used by ExtUtils::MakeMaker =item ExtUtils::MM_VMS Methods to override UN*X behaviour in ExtUtils::MakeMaker =item ExtUtils::MM_VOS VOS specific subclass of ExtUtils::MM_Unix =item ExtUtils::MM_Win32 Methods to override UN*X behaviour in ExtUtils::MakeMaker =item ExtUtils::MM_Win95 Method to customize MakeMaker for Win9X =item ExtUtils::MY ExtUtils::MakeMaker subclass for customization =item ExtUtils::MakeMaker Create a module Makefile =item ExtUtils::MakeMaker::Config Wrapper around Config.pm =item ExtUtils::MakeMaker::FAQ Frequently Asked Questions About MakeMaker =item ExtUtils::MakeMaker::Tutorial Writing a module with MakeMaker =item ExtUtils::Manifest Utilities to write and check a MANIFEST file =item ExtUtils::Mkbootstrap Make a bootstrap file for use by DynaLoader =item ExtUtils::Mksymlists Write linker options files for dynamic extension =item ExtUtils::Packlist Manage .packlist files =item ExtUtils::ParseXS Converts Perl XS code into C code =item ExtUtils::ParseXS::Constants Initialization values for some globals =item ExtUtils::ParseXS::Utilities Subroutines used with ExtUtils::ParseXS =item ExtUtils::Typemaps Read/Write/Modify Perl/XS typemap files =item ExtUtils::Typemaps::Cmd Quick commands for handling typemaps =item ExtUtils::Typemaps::InputMap Entry in the INPUT section of a typemap =item ExtUtils::Typemaps::OutputMap Entry in the OUTPUT section of a typemap =item ExtUtils::Typemaps::Type Entry in the TYPEMAP section of a typemap =item ExtUtils::XSSymSet Keep sets of symbol names palatable to the VMS linker =item ExtUtils::testlib Add blib/* directories to @INC =item Fatal Replace functions with equivalents which succeed or die =item Fcntl Load the C Fcntl.h defines =item File::Basename Parse file paths into directory, filename and suffix. =item File::CheckTree Run many filetest checks on a tree =item File::Compare Compare files or filehandles =item File::Copy Copy files or filehandles =item File::DosGlob DOS like globbing and then some =item File::Fetch A generic file fetching mechanism =item File::Find Traverse a directory tree. =item File::Glob Perl extension for BSD glob routine =item File::GlobMapper Extend File Glob to Allow Input and Output Files =item File::Path Create or remove directory trees =item File::Spec Portably perform operations on file names =item File::Spec::Cygwin Methods for Cygwin file specs =item File::Spec::Epoc Methods for Epoc file specs =item File::Spec::Functions Portably perform operations on file names =item File::Spec::Mac File::Spec for Mac OS (Classic) =item File::Spec::OS2 Methods for OS/2 file specs =item File::Spec::Unix File::Spec for Unix, base for other File::Spec modules =item File::Spec::VMS Methods for VMS file specs =item File::Spec::Win32 Methods for Win32 file specs =item File::Temp Return name and handle of a temporary file safely =item File::stat By-name interface to Perl's built-in stat() functions =item FileCache Keep more files open than the system permits =item FileHandle Supply object methods for filehandles =item Filter::Simple Simplified source filtering =item Filter::Util::Call Perl Source Filter Utility Module =item FindBin Locate directory of original perl script =item GDBM_File Perl5 access to the gdbm library. =item Getopt::Long Extended processing of command line options =item Getopt::Std Process single-character switches with switch clustering =item HTTP::Tiny A small, simple, correct HTTP/1.1 client =item Hash::Util A selection of general-utility hash subroutines =item Hash::Util::FieldHash Support for Inside-Out Classes =item I18N::Collate Compare 8-bit scalar data according to the current locale =item I18N::LangTags Functions for dealing with RFC3066-style language tags =item I18N::LangTags::Detect Detect the user's language preferences =item I18N::LangTags::List Tags and names for human languages =item I18N::Langinfo Query locale information =item IO Load various IO modules =item IO::Compress::Base Base Class for IO::Compress modules =item IO::Compress::Bzip2 Write bzip2 files/buffers =item IO::Compress::Deflate Write RFC 1950 files/buffers =item IO::Compress::FAQ Frequently Asked Questions about IO::Compress =item IO::Compress::Gzip Write RFC 1952 files/buffers =item IO::Compress::RawDeflate Write RFC 1951 files/buffers =item IO::Compress::Zip Write zip files/buffers =item IO::Dir Supply object methods for directory handles =item IO::File Supply object methods for filehandles =item IO::Handle Supply object methods for I/O handles =item IO::Pipe Supply object methods for pipes =item IO::Poll Object interface to system poll call =item IO::Seekable Supply seek based methods for I/O objects =item IO::Select OO interface to the select system call =item IO::Socket Object interface to socket communications =item IO::Socket::INET Object interface for AF_INET domain sockets =item IO::Socket::UNIX Object interface for AF_UNIX domain sockets =item IO::Uncompress::AnyInflate Uncompress zlib-based (zip, gzip) file/buffer =item IO::Uncompress::AnyUncompress Uncompress gzip, zip, bzip2 or lzop file/buffer =item IO::Uncompress::Base Base Class for IO::Uncompress modules =item IO::Uncompress::Bunzip2 Read bzip2 files/buffers =item IO::Uncompress::Gunzip Read RFC 1952 files/buffers =item IO::Uncompress::Inflate Read RFC 1950 files/buffers =item IO::Uncompress::RawInflate Read RFC 1951 files/buffers =item IO::Uncompress::Unzip Read zip files/buffers =item IO::Zlib IO:: style interface to L<Compress::Zlib> =item IPC::Cmd Finding and running system commands made easy =item IPC::Msg SysV Msg IPC object class =item IPC::Open2 Open a process for both reading and writing using open2() =item IPC::Open3 Open a process for reading, writing, and error handling using open3() =item IPC::Semaphore SysV Semaphore IPC object class =item IPC::SharedMem SysV Shared Memory IPC object class =item IPC::SysV System V IPC constants and system calls =item JSON::PP JSON::XS compatible pure-Perl module. =item JSON::PP::Boolean Dummy module providing JSON::PP::Boolean =item List::Util A selection of general-utility list subroutines =item List::Util::XS Indicate if List::Util was compiled with a C compiler =item Locale::Codes A distribution of modules to handle locale codes =item Locale::Codes::API A description of the callable function in each module =item Locale::Codes::Changes Details changes to Locale::Codes =item Locale::Codes::Constants Constants for Locale codes =item Locale::Codes::Country Standard codes for country identification =item Locale::Codes::Country_Codes Country codes for the Locale::Codes::Country module =item Locale::Codes::Country_Retired Retired country codes for the Locale::Codes::Country module =item Locale::Codes::Currency Standard codes for currency identification =item Locale::Codes::Currency_Codes Currency codes for the Locale::Codes::Currency module =item Locale::Codes::Currency_Retired Retired currency codes for the Locale::Codes::Currency module =item Locale::Codes::LangExt Standard codes for language extension identification =item Locale::Codes::LangExt_Codes Langext codes for the Locale::Codes::LangExt module =item Locale::Codes::LangExt_Retired Retired langext codes for the Locale::Codes::LangExt module =item Locale::Codes::LangFam Standard codes for language extension identification =item Locale::Codes::LangFam_Codes Langfam codes for the Locale::Codes::LangFam module =item Locale::Codes::LangFam_Retired Retired langfam codes for the Locale::Codes::LangFam module =item Locale::Codes::LangVar Standard codes for language variation identification =item Locale::Codes::LangVar_Codes Langvar codes for the Locale::Codes::LangVar module =item Locale::Codes::LangVar_Retired Retired langvar codes for the Locale::Codes::LangVar module =item Locale::Codes::Language Standard codes for language identification =item Locale::Codes::Language_Codes Language codes for the Locale::Codes::Language module =item Locale::Codes::Language_Retired Retired language codes for the Locale::Codes::Language module =item Locale::Codes::Script Standard codes for script identification =item Locale::Codes::Script_Codes Script codes for the Locale::Codes::Script module =item Locale::Codes::Script_Retired Retired script codes for the Locale::Codes::Script module =item Locale::Country Standard codes for country identification =item Locale::Currency Standard codes for currency identification =item Locale::Language Standard codes for language identification =item Locale::Maketext Framework for localization =item Locale::Maketext::Cookbook Recipes for using Locale::Maketext =item Locale::Maketext::Guts Deprecated module to load Locale::Maketext utf8 code =item Locale::Maketext::GutsLoader Deprecated module to load Locale::Maketext utf8 code =item Locale::Maketext::Simple Simple interface to Locale::Maketext::Lexicon =item Locale::Maketext::TPJ13 Article about software localization =item Locale::Script Standard codes for script identification =item Log::Message A generic message storing mechanism; =item Log::Message::Config Configuration options for Log::Message =item Log::Message::Handlers Message handlers for Log::Message =item Log::Message::Item Message objects for Log::Message =item Log::Message::Simple Simplified interface to Log::Message =item MIME::Base64 Encoding and decoding of base64 strings =item MIME::QuotedPrint Encoding and decoding of quoted-printable strings =item Math::BigFloat Arbitrary size floating point math package =item Math::BigInt Arbitrary size integer/float math package =item Math::BigInt::Calc Pure Perl module to support Math::BigInt =item Math::BigInt::CalcEmu Emulate low-level math with BigInt code =item Math::BigInt::FastCalc Math::BigInt::Calc with some XS for more speed =item Math::BigRat Arbitrary big rational numbers =item Math::Complex Complex numbers and associated mathematical functions =item Math::Trig Trigonometric functions =item Memoize Make functions faster by trading space for time =item Memoize::AnyDBM_File Glue to provide EXISTS for AnyDBM_File for Storable use =item Memoize::Expire Plug-in module for automatic expiration of memoized values =item Memoize::ExpireFile Test for Memoize expiration semantics =item Memoize::ExpireTest Test for Memoize expiration semantics =item Memoize::NDBM_File Glue to provide EXISTS for NDBM_File for Storable use =item Memoize::SDBM_File Glue to provide EXISTS for SDBM_File for Storable use =item Memoize::Storable Store Memoized data in Storable database =item Module::Build Build and install Perl modules =item Module::Build::API API Reference for Module Authors =item Module::Build::Authoring Authoring Module::Build modules =item Module::Build::Base Default methods for Module::Build =item Module::Build::Bundling How to bundle Module::Build with a distribution =item Module::Build::Compat Compatibility with ExtUtils::MakeMaker =item Module::Build::ConfigData Configuration for Module::Build =item Module::Build::Cookbook Examples of Module::Build Usage =item Module::Build::ModuleInfo DEPRECATED =item Module::Build::Notes Create persistent distribution configuration modules =item Module::Build::PPMMaker Perl Package Manager file creation =item Module::Build::Platform::Amiga Builder class for Amiga platforms =item Module::Build::Platform::Default Stub class for unknown platforms =item Module::Build::Platform::EBCDIC Builder class for EBCDIC platforms =item Module::Build::Platform::MPEiX Builder class for MPEiX platforms =item Module::Build::Platform::MacOS Builder class for MacOS platforms =item Module::Build::Platform::RiscOS Builder class for RiscOS platforms =item Module::Build::Platform::Unix Builder class for Unix platforms =item Module::Build::Platform::VMS Builder class for VMS platforms =item Module::Build::Platform::VOS Builder class for VOS platforms =item Module::Build::Platform::Windows Builder class for Windows platforms =item Module::Build::Platform::aix Builder class for AIX platform =item Module::Build::Platform::cygwin Builder class for Cygwin platform =item Module::Build::Platform::darwin Builder class for Mac OS X platform =item Module::Build::Platform::os2 Builder class for OS/2 platform =item Module::Build::Version DEPRECATED =item Module::Build::YAML DEPRECATED =item Module::CoreList What modules shipped with versions of perl =item Module::Load Runtime require of both modules and files =item Module::Load::Conditional Looking up module information / loading at runtime =item Module::Loaded Mark modules as loaded or unloaded =item Module::Metadata Gather package and POD information from perl module files =item Module::Pluggable Automatically give your module the ability to have plugins =item Module::Pluggable::Object Automatically give your module the ability to have plugins =item NDBM_File Tied access to ndbm files =item NEXT Provide a pseudo-class NEXT (et al) that allows method redispatch =item Net::Cmd Network Command class (as used by FTP, SMTP etc) =item Net::Config Local configuration data for libnet =item Net::Domain Attempt to evaluate the current host's internet name and domain =item Net::FTP FTP Client class =item Net::NNTP NNTP Client class =item Net::Netrc OO interface to users netrc file =item Net::POP3 Post Office Protocol 3 Client class (RFC1939) =item Net::Ping Check a remote host for reachability =item Net::SMTP Simple Mail Transfer Protocol Client =item Net::Time Time and daytime network client interface =item Net::hostent By-name interface to Perl's built-in gethost*() functions =item Net::libnetFAQ Libnet Frequently Asked Questions =item Net::netent By-name interface to Perl's built-in getnet*() functions =item Net::protoent By-name interface to Perl's built-in getproto*() functions =item Net::servent By-name interface to Perl's built-in getserv*() functions =item O Generic interface to Perl Compiler backends =item ODBM_File Tied access to odbm files =item Object::Accessor Interface to create per object accessors =item Opcode Disable named opcodes when compiling perl code =item POSIX Perl interface to IEEE Std 1003.1 =item Package::Constants List all constants declared in a package =item Params::Check A generic input parsing/checking mechanism. =item Parse::CPAN::Meta Parse META.yml and META.json CPAN metadata files =item Perl::OSType Map Perl operating system names to generic types =item PerlIO On demand loader for PerlIO layers and root of PerlIO::* name space =item PerlIO::encoding Encoding layer =item PerlIO::mmap Memory mapped IO =item PerlIO::scalar In-memory IO, scalar IO =item PerlIO::via Helper class for PerlIO layers implemented in perl =item PerlIO::via::QuotedPrint PerlIO layer for quoted-printable strings =item Pod::Checker Check pod documents for syntax errors =item Pod::Escapes For resolving Pod EE<lt>...E<gt> sequences =item Pod::Find Find POD documents in directory trees =item Pod::Functions Group Perl's functions a la perlfunc.pod =item Pod::Html Module to convert pod files to HTML =item Pod::InputObjects Objects representing POD input paragraphs, commands, etc. =item Pod::LaTeX Convert Pod data to formatted Latex =item Pod::Man Convert POD data to formatted *roff input =item Pod::ParseLink Parse an LE<lt>E<gt> formatting code in POD text =item Pod::ParseUtils Helpers for POD parsing and conversion =item Pod::Parser Base class for creating POD filters and translators =item Pod::Perldoc Look up Perl documentation in Pod format. =item Pod::Perldoc::BaseTo Base for Pod::Perldoc formatters =item Pod::Perldoc::GetOptsOO Customized option parser for Pod::Perldoc =item Pod::Perldoc::ToANSI Render Pod with ANSI color escapes =item Pod::Perldoc::ToChecker Let Perldoc check Pod for errors =item Pod::Perldoc::ToMan Let Perldoc render Pod as man pages =item Pod::Perldoc::ToNroff Let Perldoc convert Pod to nroff =item Pod::Perldoc::ToPod Let Perldoc render Pod as ... Pod! =item Pod::Perldoc::ToRtf Let Perldoc render Pod as RTF =item Pod::Perldoc::ToTerm Render Pod with terminal escapes =item Pod::Perldoc::ToText Let Perldoc render Pod as plaintext =item Pod::Perldoc::ToTk Let Perldoc use Tk::Pod to render Pod =item Pod::Perldoc::ToXml Let Perldoc render Pod as XML =item Pod::PlainText Convert POD data to formatted ASCII text =item Pod::Select Extract selected sections of POD from input =item Pod::Simple Framework for parsing Pod =item Pod::Simple::Checker Check the Pod syntax of a document =item Pod::Simple::Debug Put Pod::Simple into trace/debug mode =item Pod::Simple::DumpAsText Dump Pod-parsing events as text =item Pod::Simple::DumpAsXML Turn Pod into XML =item Pod::Simple::HTML Convert Pod to HTML =item Pod::Simple::HTMLBatch Convert several Pod files to several HTML files =item Pod::Simple::LinkSection Represent "section" attributes of L codes =item Pod::Simple::Methody Turn Pod::Simple events into method calls =item Pod::Simple::PullParser A pull-parser interface to parsing Pod =item Pod::Simple::PullParserEndToken End-tokens from Pod::Simple::PullParser =item Pod::Simple::PullParserStartToken Start-tokens from Pod::Simple::PullParser =item Pod::Simple::PullParserTextToken Text-tokens from Pod::Simple::PullParser =item Pod::Simple::PullParserToken Tokens from Pod::Simple::PullParser =item Pod::Simple::RTF Format Pod as RTF =item Pod::Simple::Search Find POD documents in directory trees =item Pod::Simple::SimpleTree Parse Pod into a simple parse tree =item Pod::Simple::Subclassing Write a formatter as a Pod::Simple subclass =item Pod::Simple::Text Format Pod as plaintext =item Pod::Simple::TextContent Get the text content of Pod =item Pod::Simple::XHTML Format Pod as validating XHTML =item Pod::Simple::XMLOutStream Turn Pod into XML =item Pod::Text Convert POD data to formatted ASCII text =item Pod::Text::Color Convert POD data to formatted color ASCII text =item Pod::Text::Termcap Convert POD data to ASCII text with format escapes =item Pod::Usage Print a usage message from embedded pod documentation =item SDBM_File Tied access to sdbm files =item Safe Compile and execute code in restricted compartments =item Scalar::Util A selection of general-utility scalar subroutines =item Search::Dict Look - search for key in dictionary file =item SelectSaver Save and restore selected file handle =item SelfLoader Load functions only on demand =item Storable Persistence for Perl data structures =item Symbol Manipulate Perl symbols and their names =item Sys::Hostname Try every conceivable way to get hostname =item Sys::Syslog Perl interface to the UNIX syslog(3) calls =item Sys::Syslog::Win32 Win32 support for Sys::Syslog =item TAP::Base Base class that provides common functionality to L<TAP::Parser> =item TAP::Formatter::Base Base class for harness output delegates =item TAP::Formatter::Color Run Perl test scripts with color =item TAP::Formatter::Console Harness output delegate for default console output =item TAP::Formatter::Console::ParallelSession Harness output delegate for parallel console output =item TAP::Formatter::Console::Session Harness output delegate for default console output =item TAP::Formatter::File Harness output delegate for file output =item TAP::Formatter::File::Session Harness output delegate for file output =item TAP::Formatter::Session Abstract base class for harness output delegate =item TAP::Harness Run test scripts with statistics =item TAP::Object Base class that provides common functionality to all C<TAP::*> modules =item TAP::Parser Parse L<TAP|Test::Harness::TAP> output =item TAP::Parser::Aggregator Aggregate TAP::Parser results =item TAP::Parser::Grammar A grammar for the Test Anything Protocol. =item TAP::Parser::Iterator Base class for TAP source iterators =item TAP::Parser::Iterator::Array Iterator for array-based TAP sources =item TAP::Parser::Iterator::Process Iterator for process-based TAP sources =item TAP::Parser::Iterator::Stream Iterator for filehandle-based TAP sources =item TAP::Parser::IteratorFactory Figures out which SourceHandler objects to use for a given Source =item TAP::Parser::Multiplexer Multiplex multiple TAP::Parsers =item TAP::Parser::Result Base class for TAP::Parser output objects =item TAP::Parser::Result::Bailout Bailout result token. =item TAP::Parser::Result::Comment Comment result token. =item TAP::Parser::Result::Plan Plan result token. =item TAP::Parser::Result::Pragma TAP pragma token. =item TAP::Parser::Result::Test Test result token. =item TAP::Parser::Result::Unknown Unknown result token. =item TAP::Parser::Result::Version TAP syntax version token. =item TAP::Parser::Result::YAML YAML result token. =item TAP::Parser::ResultFactory Factory for creating TAP::Parser output objects =item TAP::Parser::Scheduler Schedule tests during parallel testing =item TAP::Parser::Scheduler::Job A single testing job. =item TAP::Parser::Scheduler::Spinner A no-op job. =item TAP::Parser::Source A TAP source & meta data about it =item TAP::Parser::SourceHandler Base class for different TAP source handlers =item TAP::Parser::SourceHandler::Executable Stream output from an executable TAP source =item TAP::Parser::SourceHandler::File Stream TAP from a text file. =item TAP::Parser::SourceHandler::Handle Stream TAP from an IO::Handle or a GLOB. =item TAP::Parser::SourceHandler::Perl Stream TAP from a Perl executable =item TAP::Parser::SourceHandler::RawTAP Stream output from raw TAP in a scalar/array ref. =item TAP::Parser::Utils Internal TAP::Parser utilities =item TAP::Parser::YAMLish::Reader Read YAMLish data from iterator =item TAP::Parser::YAMLish::Writer Write YAMLish data =item Term::ANSIColor Color screen output using ANSI escape sequences =item Term::Cap Perl termcap interface =item Term::Complete Perl word completion module =item Term::ReadLine Perl interface to various C<readline> packages. =item Term::UI Term::ReadLine UI made easy =item Term::UI::History History function =item Test Provides a simple framework for writing test scripts =item Test::Builder Backend for building test libraries =item Test::Builder::Module Base class for test modules =item Test::Builder::Tester Test testsuites that have been built with =item Test::Builder::Tester::Color Turn on colour in Test::Builder::Tester =item Test::Harness Run Perl standard test scripts with statistics =item Test::More Yet another framework for writing test scripts =item Test::Simple Basic utilities for writing tests. =item Test::Tutorial A tutorial about writing really basic tests =item Text::Abbrev Abbrev - create an abbreviation table from a list =item Text::Balanced Extract delimited text sequences from strings. =item Text::ParseWords Parse text into an array of tokens or array of arrays =item Text::Soundex Implementation of the soundex algorithm. =item Text::Tabs Expand and unexpand tabs per the unix expand(1) and unexpand(1) =item Text::Wrap Line wrapping to form simple paragraphs =item Thread Manipulate threads in Perl (for old code only) =item Thread::Queue Thread-safe queues =item Thread::Semaphore Thread-safe semaphores =item Tie::Array Base class for tied arrays =item Tie::File Access the lines of a disk file via a Perl array =item Tie::Handle Base class definitions for tied handles =item Tie::Hash Base class definitions for tied hashes =item Tie::Hash::NamedCapture Named regexp capture buffers =item Tie::Memoize Add data to hash when needed =item Tie::RefHash Use references as hash keys =item Tie::Scalar Base class definitions for tied scalars =item Tie::StdHandle Base class definitions for tied handles =item Tie::SubstrHash Fixed-table-size, fixed-key-length hashing =item Time::HiRes High resolution alarm, sleep, gettimeofday, interval timers =item Time::Local Efficiently compute time from local and GMT time =item Time::Piece Object Oriented time objects =item Time::Seconds A simple API to convert seconds to other date values =item Time::gmtime By-name interface to Perl's built-in gmtime() function =item Time::localtime By-name interface to Perl's built-in localtime() function =item Time::tm Internal object used by Time::gmtime and Time::localtime =item UNIVERSAL Base class for ALL classes (blessed references) =item Unicode::Collate Unicode Collation Algorithm =item Unicode::Collate::CJK::Big5 Weighting CJK Unified Ideographs =item Unicode::Collate::CJK::GB2312 Weighting CJK Unified Ideographs =item Unicode::Collate::CJK::JISX0208 Weighting JIS KANJI for Unicode::Collate =item Unicode::Collate::CJK::Korean Weighting CJK Unified Ideographs =item Unicode::Collate::CJK::Pinyin Weighting CJK Unified Ideographs =item Unicode::Collate::CJK::Stroke Weighting CJK Unified Ideographs =item Unicode::Collate::Locale Linguistic tailoring for DUCET via Unicode::Collate =item Unicode::Normalize Unicode Normalization Forms =item Unicode::UCD Unicode character database =item User::grent By-name interface to Perl's built-in getgr*() functions =item User::pwent By-name interface to Perl's built-in getpw*() functions =item VMS::DCLsym Perl extension to manipulate DCL symbols =item VMS::Stdio Standard I/O functions via VMS extensions =item Version::Requirements A set of version requirements for a CPAN dist =item Win32API::File Low-level access to Win32 system API calls for files/dirs. =item Win32CORE Win32 CORE function stubs =item XS::APItest Test the perl C API =item XS::Typemap Module to test the XS typemaps distributed with perl =item XSLoader Dynamically load C libraries into Perl code =item version::Internals Perl extension for Version Objects =back To find out I<all> modules installed on your system, including those without documentation or outside the standard release, just use the following command (under the default win32 shell, double quotes should be used instead of single quotes). % perl -MFile::Find=find -MFile::Spec::Functions -Tlwe \ 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC' (The -T is here to prevent '.' from being listed in @INC.) They should all have their own documentation installed and accessible via your system man(1) command. If you do not have a B<find> program, you can use the Perl B<find2perl> program instead, which generates Perl code as output you can run through perl. If you have a B<man> program but it doesn't find your modules, you'll have to fix your manpath. See L<perl> for details. If you have no system B<man> command, you might try the B<perldoc> program. Note also that the command C<perldoc perllocal> gives you a (possibly incomplete) list of the modules that have been further installed on your system. (The perllocal.pod file is updated by the standard MakeMaker install process.) =head2 Extension Modules Extension modules are written in C (or a mix of Perl and C). They are usually dynamically loaded into Perl if and when you need them, but may also be linked in statically. Supported extension modules include Socket, Fcntl, and POSIX. Many popular C extension modules do not come bundled (at least, not completely) due to their sizes, volatility, or simply lack of time for adequate testing and configuration across the multitude of platforms on which Perl was beta-tested. You are encouraged to look for them on CPAN (described below), or using web search engines like Alta Vista or Google. =head1 CPAN CPAN stands for Comprehensive Perl Archive Network; it's a globally replicated trove of Perl materials, including documentation, style guides, tricks and traps, alternate ports to non-Unix systems and occasional binary distributions for these. Search engines for CPAN can be found at http://www.cpan.org/ Most importantly, CPAN includes around a thousand unbundled modules, some of which require a C compiler to build. Major categories of modules are: =over =item * Language Extensions and Documentation Tools =item * Development Support =item * Operating System Interfaces =item * Networking, Device Control (modems) and InterProcess Communication =item * Data Types and Data Type Utilities =item * Database Interfaces =item * User Interfaces =item * Interfaces to / Emulations of Other Programming Languages =item * File Names, File Systems and File Locking (see also File Handles) =item * String Processing, Language Text Processing, Parsing, and Searching =item * Option, Argument, Parameter, and Configuration File Processing =item * Internationalization and Locale =item * Authentication, Security, and Encryption =item * World Wide Web, HTML, HTTP, CGI, MIME =item * Server and Daemon Utilities =item * Archiving and Compression =item * Images, Pixmap and Bitmap Manipulation, Drawing, and Graphing =item * Mail and Usenet News =item * Control Flow Utilities (callbacks and exceptions etc) =item * File Handle and Input/Output Stream Utilities =item * Miscellaneous Modules =back The list of the registered CPAN sites follows. Please note that the sorting order is alphabetical on fields: Continent | |-->Country | |-->[state/province] | |-->ftp | |-->[http] and thus the North American servers happen to be listed between the European and the South American sites. Registered CPAN sites =for maintainers Generated by Porting/make_modlib_cpan.pl =head2 Africa =over 4 =item South Africa http://cpan.mirror.ac.za/ ftp://cpan.mirror.ac.za/ http://mirror.is.co.za/pub/cpan/ ftp://ftp.is.co.za/pub/cpan/ ftp://ftp.saix.net/pub/CPAN/ =back =head2 Asia =over 4 =item China http://cpan.wenzk.com/ =item Hong Kong http://ftp.cuhk.edu.hk/pub/packages/perl/CPAN/ ftp://ftp.cuhk.edu.hk/pub/packages/perl/CPAN/ http://mirrors.geoexpat.com/cpan/ =item India http://perlmirror.indialinks.com/ =item Indonesia http://cpan.biz.net.id/ http://komo.vlsm.org/CPAN/ ftp://komo.vlsm.org/CPAN/ http://cpan.cermin.lipi.go.id/ ftp://cermin.lipi.go.id/pub/CPAN/ http://cpan.pesat.net.id/ =item Japan ftp://ftp.u-aizu.ac.jp/pub/CPAN ftp://ftp.kddilabs.jp/CPAN/ http://ftp.nara.wide.ad.jp/pub/CPAN/ ftp://ftp.nara.wide.ad.jp/pub/CPAN/ http://ftp.jaist.ac.jp/pub/CPAN/ ftp://ftp.jaist.ac.jp/pub/CPAN/ ftp://ftp.dti.ad.jp/pub/lang/CPAN/ ftp://ftp.ring.gr.jp/pub/lang/perl/CPAN/ http://ftp.riken.jp/lang/CPAN/ ftp://ftp.riken.jp/lang/CPAN/ http://ftp.yz.yamagata-u.ac.jp/pub/lang/cpan/ ftp://ftp.yz.yamagata-u.ac.jp/pub/lang/cpan/ =item Republic of Korea http://ftp.kaist.ac.kr/pub/CPAN ftp://ftp.kaist.ac.kr/pub/CPAN http://cpan.mirror.cdnetworks.com/ ftp://cpan.mirror.cdnetworks.com/CPAN/ http://cpan.sarang.net/ ftp://cpan.sarang.net/CPAN/ =item Russia http://cpan.tomsk.ru/ ftp://cpan.tomsk.ru/ =item Singapore http://mirror.averse.net/pub/CPAN ftp://mirror.averse.net/pub/CPAN http://cpan.mirror.choon.net/ http://cpan.oss.eznetsols.org ftp://ftp.oss.eznetsols.org/cpan =item Taiwan http://ftp.cse.yzu.edu.tw/pub/CPAN/ ftp://ftp.cse.yzu.edu.tw/pub/CPAN/ http://cpan.nctu.edu.tw/ ftp://cpan.nctu.edu.tw/ ftp://ftp.ncu.edu.tw/CPAN/ http://cpan.cdpa.nsysu.edu.tw/ ftp://cpan.cdpa.nsysu.edu.tw/Unix/Lang/CPAN/ http://cpan.stu.edu.tw ftp://ftp.stu.edu.tw/CPAN http://ftp.stu.edu.tw/CPAN ftp://ftp.stu.edu.tw/pub/CPAN http://cpan.cs.pu.edu.tw/ ftp://cpan.cs.pu.edu.tw/pub/CPAN =item Thailand http://mirrors.issp.co.th/cpan/ ftp://mirrors.issp.co.th/cpan/ http://mirror.yourconnect.com/CPAN/ ftp://mirror.yourconnect.com/CPAN/ =item Turkey http://cpan.gazi.edu.tr/ =back =head2 Central America =over 4 =item Costa Rica http://mirrors.ucr.ac.cr/CPAN/ ftp://mirrors.ucr.ac.cr/CPAN/ =back =head2 Europe =over 4 =item Austria http://cpan.inode.at/ ftp://cpan.inode.at http://gd.tuwien.ac.at/languages/perl/CPAN/ ftp://gd.tuwien.ac.at/pub/CPAN/ =item Belgium http://ftp.belnet.be/mirror/ftp.cpan.org/ ftp://ftp.belnet.be/mirror/ftp.cpan.org/ http://ftp.easynet.be/pub/CPAN/ http://cpan.weepee.org/ =item Bosnia and Herzegovina http://cpan.blic.net/ =item Bulgaria http://cpan.cbox.biz/ ftp://cpan.cbox.biz/cpan/ http://cpan.digsys.bg/ ftp://ftp.digsys.bg/pub/CPAN =item Croatia http://ftp.carnet.hr/pub/CPAN/ ftp://ftp.carnet.hr/pub/CPAN/ =item Czech Republic ftp://ftp.fi.muni.cz/pub/CPAN/ http://archive.cpan.cz/ =item Denmark http://mirrors.dotsrc.org/cpan ftp://mirrors.dotsrc.org/cpan/ http://www.cpan.dk/ http://mirror.uni-c.dk/pub/CPAN/ =item Finland ftp://ftp.funet.fi/pub/languages/perl/CPAN/ http://mirror.eunet.fi/CPAN =item France http://cpan.enstimac.fr/ ftp://ftp.inria.fr/pub/CPAN/ http://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/cpan/ ftp://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/cpan/ ftp://ftp.lip6.fr/pub/perl/CPAN/ http://mir2.ovh.net/ftp.cpan.org ftp://mir1.ovh.net/ftp.cpan.org ftp://ftp.oleane.net/pub/CPAN/ http://ftp.crihan.fr/mirrors/ftp.cpan.org/ ftp://ftp.crihan.fr/mirrors/ftp.cpan.org/ http://ftp.u-strasbg.fr/CPAN ftp://ftp.u-strasbg.fr/CPAN http://cpan.cict.fr/ ftp://cpan.cict.fr/pub/CPAN/ =item Germany ftp://ftp.fu-berlin.de/unix/languages/perl/ http://mirrors.softliste.de/cpan/ ftp://ftp.rub.de/pub/CPAN/ http://www.planet-elektronik.de/CPAN/ http://ftp.hosteurope.de/pub/CPAN/ ftp://ftp.hosteurope.de/pub/CPAN/ http://www.mirrorspace.org/cpan/ http://mirror.netcologne.de/cpan/ ftp://mirror.netcologne.de/cpan/ ftp://ftp.freenet.de/pub/ftp.cpan.org/pub/CPAN/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/CPAN/ ftp://ftp-stud.hs-esslingen.de/pub/Mirrors/CPAN/ http://mirrors.zerg.biz/cpan/ http://ftp.gwdg.de/pub/languages/perl/CPAN/ ftp://ftp.gwdg.de/pub/languages/perl/CPAN/ http://dl.ambiweb.de/mirrors/ftp.cpan.org/ http://cpan.mirror.clusters.kg/ http://cpan.mirror.iphh.net/ ftp://cpan.mirror.iphh.net/pub/CPAN/ http://cpan.mirroring.de/ http://mirror.informatik.uni-mannheim.de/pub/mirrors/CPAN/ ftp://mirror.informatik.uni-mannheim.de/pub/mirrors/CPAN/ http://www.chemmedia.de/mirrors/CPAN/ http://ftp.cw.net/pub/CPAN/ ftp://ftp.cw.net/pub/CPAN/ http://cpan.cpantesters.org/ ftp://cpan.cpantesters.org/CPAN/ http://cpan.mirrored.de/ ftp://mirror.petamem.com/CPAN/ http://cpan.noris.de/ ftp://cpan.noris.de/pub/CPAN/ ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/ ftp://ftp.gmd.de/mirrors/CPAN/ =item Greece ftp://ftp.forthnet.gr/pub/languages/perl/CPAN ftp://ftp.ntua.gr/pub/lang/perl/ http://cpan.cc.uoc.gr/ ftp://ftp.cc.uoc.gr/mirrors/CPAN/ =item Hungary http://cpan.mirrors.enexis.hu/ ftp://cpan.mirrors.enexis.hu/mirrors/cpan/ http://cpan.hu/ =item Iceland http://ftp.rhnet.is/pub/CPAN/ ftp://ftp.rhnet.is/pub/CPAN/ =item Ireland http://ftp.esat.net/pub/languages/perl/CPAN/ ftp://ftp.esat.net/pub/languages/perl/CPAN/ http://ftp.heanet.ie/mirrors/ftp.perl.org/pub/CPAN ftp://ftp.heanet.ie/mirrors/ftp.perl.org/pub/CPAN =item Italy http://bo.mirror.garr.it/mirrors/CPAN/ http://cpan.panu.it/ ftp://ftp.panu.it/pub/mirrors/perl/CPAN/ =item Latvia http://kvin.lv/pub/CPAN/ =item Lithuania http://ftp.litnet.lt/pub/CPAN/ ftp://ftp.litnet.lt/pub/CPAN/ =item Malta http://cpan.waldonet.net.mt/ =item Netherlands ftp://ftp.quicknet.nl/pub/CPAN/ http://mirror.hostfuss.com/CPAN/ ftp://mirror.hostfuss.com/CPAN/ http://mirrors3.kernel.org/cpan/ ftp://mirrors3.kernel.org/pub/CPAN/ http://cpan.mirror.versatel.nl/ ftp://ftp.mirror.versatel.nl/cpan/ ftp://download.xs4all.nl/pub/mirror/CPAN/ http://mirror.leaseweb.com/CPAN/ ftp://mirror.leaseweb.com/CPAN/ ftp://ftp.cpan.nl/pub/CPAN/ http://archive.cs.uu.nl/mirror/CPAN/ ftp://ftp.cs.uu.nl/mirror/CPAN/ http://luxitude.net/cpan/ =item Norway ftp://ftp.uninett.no/pub/languages/perl/CPAN ftp://ftp.uit.no/pub/languages/perl/cpan/ =item Poland http://piotrkosoft.net/pub/mirrors/CPAN/ ftp://ftp.piotrkosoft.net/pub/mirrors/CPAN/ http://ftp.man.poznan.pl/pub/CPAN ftp://ftp.man.poznan.pl/pub/CPAN ftp://ftp.ps.pl/pub/CPAN/ ftp://sunsite.icm.edu.pl/pub/CPAN/ ftp://ftp.tpnet.pl/d4/CPAN/ =item Portugal http://cpan.dei.uc.pt/ ftp://ftp.dei.uc.pt/pub/CPAN ftp://ftp.ist.utl.pt/pub/CPAN/ http://cpan.perl.pt/ http://cpan.ip.pt/ ftp://cpan.ip.pt/pub/cpan/ http://mirrors.nfsi.pt/CPAN/ ftp://mirrors.nfsi.pt/pub/CPAN/ http://cpan.dcc.fc.up.pt/ =item Romania http://ftp.astral.ro/pub/CPAN/ ftp://ftp.astral.ro/pub/CPAN/ ftp://ftp.lug.ro/CPAN http://mirrors.xservers.ro/CPAN/ http://mirrors.hostingromania.ro/ftp.cpan.org/ ftp://ftp.hostingromania.ro/mirrors/ftp.cpan.org/ ftp://ftp.iasi.roedu.net/pub/mirrors/ftp.cpan.org/ =item Russia ftp://ftp.aha.ru/CPAN/ http://cpan.rinet.ru/ ftp://cpan.rinet.ru/pub/mirror/CPAN/ ftp://ftp.SpringDaemons.com/pub/CPAN/ http://mirror.rol.ru/CPAN/ http://ftp.silvernet.ru/CPAN/ http://ftp.spbu.ru/CPAN/ ftp://ftp.spbu.ru/CPAN/ =item Slovakia http://cpan.fyxm.net/ =item Slovenia http://www.klevze.si/cpan =item Spain http://osl.ugr.es/CPAN/ ftp://ftp.rediris.es/mirror/CPAN/ http://ftp.gui.uva.es/sites/cpan.org/ ftp://ftp.gui.uva.es/sites/cpan.org/ =item Sweden http://mirrors4.kernel.org/cpan/ ftp://mirrors4.kernel.org/pub/CPAN/ =item Switzerland http://cpan.mirror.solnet.ch/ ftp://ftp.solnet.ch/mirror/CPAN/ ftp://ftp.adwired.ch/CPAN/ http://mirror.switch.ch/ftp/mirror/CPAN/ ftp://mirror.switch.ch/mirror/CPAN/ =item Ukraine http://cpan.makeperl.org/ ftp://cpan.makeperl.org/pub/CPAN http://cpan.org.ua/ http://cpan.gafol.net/ ftp://ftp.gafol.net/pub/cpan/ =item United Kingdom http://www.mirrorservice.org/sites/ftp.funet.fi/pub/languages/perl/CPAN/ ftp://ftp.mirrorservice.org/sites/ftp.funet.fi/pub/languages/perl/CPAN/ http://mirror.tje.me.uk/pub/mirrors/ftp.cpan.org/ ftp://mirror.tje.me.uk/pub/mirrors/ftp.cpan.org/ http://www.mirror.8086.net/sites/CPAN/ ftp://ftp.mirror.8086.net/sites/CPAN/ http://cpan.mirror.anlx.net/ ftp://ftp.mirror.anlx.net/CPAN/ http://mirror.bytemark.co.uk/CPAN/ ftp://mirror.bytemark.co.uk/CPAN/ http://cpan.etla.org/ ftp://cpan.etla.org/pub/CPAN ftp://ftp.demon.co.uk/pub/CPAN/ http://mirror.sov.uk.goscomb.net/CPAN/ ftp://mirror.sov.uk.goscomb.net/pub/CPAN/ http://ftp.plig.net/pub/CPAN/ ftp://ftp.plig.net/pub/CPAN/ http://ftp.ticklers.org/pub/CPAN/ ftp://ftp.ticklers.org/pub/CPAN/ http://cpan.mirrors.uk2.net/ ftp://mirrors.uk2.net/pub/CPAN/ http://mirror.ox.ac.uk/sites/www.cpan.org/ ftp://mirror.ox.ac.uk/sites/www.cpan.org/ =back =head2 North America =over 4 =item Bahamas http://www.securehost.com/mirror/CPAN/ =item Canada http://cpan.arcticnetwork.ca ftp://mirror.arcticnetwork.ca/pub/CPAN http://cpan.sunsite.ualberta.ca/ ftp://cpan.sunsite.ualberta.ca/pub/CPAN/ http://theoryx5.uwinnipeg.ca/pub/CPAN/ ftp://theoryx5.uwinnipeg.ca/pub/CPAN/ http://arwen.cs.dal.ca/mirror/CPAN/ ftp://arwen.cs.dal.ca/pub/mirror/CPAN/ http://CPAN.mirror.rafal.ca/ ftp://CPAN.mirror.rafal.ca/pub/CPAN/ ftp://ftp.nrc.ca/pub/CPAN/ http://mirror.csclub.uwaterloo.ca/pub/CPAN/ ftp://mirror.csclub.uwaterloo.ca/pub/CPAN/ =item Mexico http://www.msg.com.mx/CPAN/ ftp://ftp.msg.com.mx/pub/CPAN/ =item United States =over 8 =item Alabama http://mirror.hiwaay.net/CPAN/ ftp://mirror.hiwaay.net/CPAN/ =item Arizona http://cpan.ezarticleinformation.com/ =item California http://cpan.knowledgematters.net/ http://cpan.binkerton.com/ http://cpan.develooper.com/ http://mirrors.gossamer-threads.com/CPAN http://cpan.schatt.com/ http://mirrors.kernel.org/cpan/ ftp://mirrors.kernel.org/pub/CPAN http://mirrors2.kernel.org/cpan/ ftp://mirrors2.kernel.org/pub/CPAN/ http://cpan.mirror.facebook.net/ http://mirrors1.kernel.org/cpan/ ftp://mirrors1.kernel.org/pub/CPAN/ http://cpan-sj.viaverio.com/ ftp://cpan-sj.viaverio.com/pub/CPAN/ http://www.perl.com/CPAN/ =item Florida ftp://ftp.cise.ufl.edu/pub/mirrors/CPAN/ http://mirror.atlantic.net/pub/CPAN/ ftp://mirror.atlantic.net/pub/CPAN/ =item Idaho http://mirror.its.uidaho.edu/pub/cpan/ ftp://mirror.its.uidaho.edu/cpan/ =item Illinois http://cpan.mirrors.hoobly.com/ http://cpan.uchicago.edu/pub/CPAN/ ftp://cpan.uchicago.edu/pub/CPAN/ http://mirrors.servercentral.net/CPAN/ http://www.stathy.com/CPAN/ ftp://www.stathy.com/CPAN/ =item Indiana ftp://ftp.uwsg.iu.edu/pub/perl/CPAN/ http://cpan.netnitco.net/ ftp://cpan.netnitco.net/pub/mirrors/CPAN/ http://ftp.ndlug.nd.edu/pub/perl/ ftp://ftp.ndlug.nd.edu/pub/perl/ =item Massachusetts http://mirrors.ccs.neu.edu/CPAN/ =item Michigan http://ftp.wayne.edu/cpan/ ftp://ftp.wayne.edu/cpan/ =item Minnesota http://cpan.msi.umn.edu/ =item New Jersey http://mirror.datapipe.net/CPAN/ ftp://mirror.datapipe.net/pub/CPAN/ =item New York http://mirrors.24-7-solutions.net/pub/CPAN/ ftp://mirrors.24-7-solutions.net/pub/CPAN/ http://mirror.cc.columbia.edu/pub/software/cpan/ ftp://mirror.cc.columbia.edu/pub/software/cpan/ http://cpan.belfry.net/ http://cpan.erlbaum.net/ ftp://cpan.erlbaum.net/CPAN/ http://cpan.hexten.net/ ftp://cpan.hexten.net/ ftp://mirror.nyi.net/CPAN/ http://mirror.rit.edu/CPAN/ ftp://mirror.rit.edu/CPAN/ =item North Carolina http://www.ibiblio.org/pub/mirrors/CPAN ftp://ftp.ncsu.edu/pub/mirror/CPAN/ =item Oregon http://ftp.osuosl.org/pub/CPAN/ ftp://ftp.osuosl.org/pub/CPAN/ =item Pennsylvania http://ftp.epix.net/CPAN/ ftp://ftp.epix.net/pub/languages/perl/ http://cpan.pair.com/ ftp://cpan.pair.com/pub/CPAN/ =item South Carolina http://cpan.mirror.clemson.edu/ =item Tennessee http://mira.sunsite.utk.edu/CPAN/ =item Texas http://mirror.uta.edu/CPAN =item Utah ftp://mirror.xmission.com/CPAN/ =item Virginia http://cpan-du.viaverio.com/ ftp://cpan-du.viaverio.com/pub/CPAN/ http://perl.secsup.org/ ftp://perl.secsup.org/pub/perl/ ftp://mirror.cogentco.com/pub/CPAN/ =item Washington http://cpan.llarian.net/ ftp://cpan.llarian.net/pub/CPAN/ ftp://ftp-mirror.internap.com/pub/CPAN/ =item Wisconsin http://cpan.mirrors.tds.net ftp://cpan.mirrors.tds.net/pub/CPAN http://mirror.sit.wisc.edu/pub/CPAN/ ftp://mirror.sit.wisc.edu/pub/CPAN/ =back =back =head2 Oceania =over 4 =item Australia http://mirror.internode.on.net/pub/cpan/ ftp://mirror.internode.on.net/pub/cpan/ http://cpan.mirror.aussiehq.net.au/ http://mirror.as24220.net/cpan/ ftp://mirror.as24220.net/cpan/ =item New Zealand ftp://ftp.auckland.ac.nz/pub/perl/CPAN/ http://cpan.inspire.net.nz ftp://cpan.inspire.net.nz/cpan http://cpan.catalyst.net.nz/CPAN/ ftp://cpan.catalyst.net.nz/pub/CPAN/ =back =head2 South America =over 4 =item Argentina http://cpan.patan.com.ar/ http://cpan.localhost.net.ar ftp://mirrors.localhost.net.ar/pub/mirrors/CPAN =item Brazil ftp://cpan.pop-mg.com.br/pub/CPAN/ http://ftp.pucpr.br/CPAN ftp://ftp.pucpr.br/CPAN http://cpan.kinghost.net/ =item Chile http://cpan.dcc.uchile.cl/ ftp://cpan.dcc.uchile.cl/pub/lang/cpan/ =item Colombia http://www.laqee.unal.edu.co/CPAN/ =back =head2 RSYNC Mirrors mirror.as24220.net::cpan cpan.inode.at::CPAN gd.tuwien.ac.at::CPAN ftp.belnet.be::packages/cpan rsync.linorg.usp.br::CPAN rsync.arcticnetwork.ca::CPAN CPAN.mirror.rafal.ca::CPAN mirror.csclub.uwaterloo.ca::CPAN theoryx5.uwinnipeg.ca::CPAN www.laqee.unal.edu.co::CPAN mirror.uni-c.dk::CPAN rsync.nic.funet.fi::CPAN rsync://distrib-coffee.ipsl.jussieu.fr/pub/mirrors/cpan/ mir1.ovh.net::CPAN miroir-francais.fr::cpan ftp.crihan.fr::CPAN rsync://mirror.cict.fr/cpan/ rsync://mirror.netcologne.de/cpan/ ftp-stud.hs-esslingen.de::CPAN/ ftp.gwdg.de::FTP/languages/perl/CPAN/ cpan.mirror.iphh.net::CPAN cpan.cpantesters.org::cpan cpan.hu::CPAN komo.vlsm.org::CPAN mirror.unej.ac.id::cpan ftp.esat.net::/pub/languages/perl/CPAN ftp.heanet.ie::mirrors/ftp.perl.org/pub/CPAN rsync.panu.it::CPAN cpan.fastbull.org::CPAN ftp.kddilabs.jp::cpan ftp.nara.wide.ad.jp::cpan/ rsync://ftp.jaist.ac.jp/pub/CPAN/ rsync://ftp.riken.jp/cpan/ mirror.linuxiso.kz::CPAN rsync://mirrors3.kernel.org/mirrors/CPAN/ rsync://rsync.osmirror.nl/cpan/ mirror.leaseweb.com::CPAN cpan.nautile.nc::CPAN mirror.icis.pcz.pl::CPAN piotrkosoft.net::mirrors/CPAN rsync://cpan.perl.pt/ ftp.kaist.ac.kr::cpan cpan.sarang.net::CPAN mirror.averse.net::cpan rsync.oss.eznetsols.org mirror.ac.za::cpan ftp.is.co.za::IS-Mirror/ftp.cpan.org/ rsync://ftp.gui.uva.es/cpan/ rsync://mirrors4.kernel.org/mirrors/CPAN/ ftp.solnet.ch::CPAN ftp.ulak.net.tr::CPAN gafol.net::cpan rsync.mirrorservice.org::ftp.funet.fi/pub/ rsync://rsync.mirror.8086.net/CPAN/ rsync.mirror.anlx.net::CPAN mirror.bytemark.co.uk::CPAN ftp.plig.net::CPAN rsync://ftp.ticklers.org:CPAN/ mirrors.ibiblio.org::CPAN cpan-du.viaverio.com::CPAN mirror.hiwaay.net::CPAN rsync://mira.sunsite.utk.edu/CPAN/ cpan.mirrors.tds.net::CPAN mirror.its.uidaho.edu::cpan rsync://mirror.cc.columbia.edu::cpan/ ftp.fxcorporate.com::CPAN rsync.atlantic.net::CPAN mirrors.kernel.org::mirrors/CPAN rsync://mirrors2.kernel.org/mirrors/CPAN/ cpan.pair.com::CPAN rsync://mirror.rit.edu/CPAN/ rsync://mirror.facebook.net/cpan/ rsync://mirrors1.kernel.org/mirrors/CPAN/ cpan-sj.viaverio.com::CPAN For an up-to-date listing of CPAN sites, see http://www.cpan.org/SITES or ftp://www.cpan.org/SITES . =head1 Modules: Creation, Use, and Abuse (The following section is borrowed directly from Tim Bunce's modules file, available at your nearest CPAN site.) Perl implements a class using a package, but the presence of a package doesn't imply the presence of a class. A package is just a namespace. A class is a package that provides subroutines that can be used as methods. A method is just a subroutine that expects, as its first argument, either the name of a package (for "static" methods), or a reference to something (for "virtual" methods). A module is a file that (by convention) provides a class of the same name (sans the .pm), plus an import method in that class that can be called to fetch exported symbols. This module may implement some of its methods by loading dynamic C or C++ objects, but that should be totally transparent to the user of the module. Likewise, the module might set up an AUTOLOAD function to slurp in subroutine definitions on demand, but this is also transparent. Only the F<.pm> file is required to exist. See L<perlsub>, L<perlobj>, and L<AutoLoader> for details about the AUTOLOAD mechanism. =head2 Guidelines for Module Creation =over 4 =item * Do similar modules already exist in some form? If so, please try to reuse the existing modules either in whole or by inheriting useful features into a new class. If this is not practical try to get together with the module authors to work on extending or enhancing the functionality of the existing modules. A perfect example is the plethora of packages in perl4 for dealing with command line options. If you are writing a module to expand an already existing set of modules, please coordinate with the author of the package. It helps if you follow the same naming scheme and module interaction scheme as the original author. =item * Try to design the new module to be easy to extend and reuse. Try to C<use warnings;> (or C<use warnings qw(...);>). Remember that you can add C<no warnings qw(...);> to individual blocks of code that need less warnings. Use blessed references. Use the two argument form of bless to bless into the class name given as the first parameter of the constructor, e.g.,: sub new { my $class = shift; return bless {}, $class; } or even this if you'd like it to be used as either a static or a virtual method. sub new { my $self = shift; my $class = ref($self) || $self; return bless {}, $class; } Pass arrays as references so more parameters can be added later (it's also faster). Convert functions into methods where appropriate. Split large methods into smaller more flexible ones. Inherit methods from other modules if appropriate. Avoid class name tests like: C<die "Invalid" unless ref $ref eq 'FOO'>. Generally you can delete the C<eq 'FOO'> part with no harm at all. Let the objects look after themselves! Generally, avoid hard-wired class names as far as possible. Avoid C<< $r->Class::func() >> where using C<@ISA=qw(... Class ...)> and C<< $r->func() >> would work. Use autosplit so little used or newly added functions won't be a burden to programs that don't use them. Add test functions to the module after __END__ either using AutoSplit or by saying: eval join('',<main::DATA>) || die $@ unless caller(); Does your module pass the 'empty subclass' test? If you say C<@SUBCLASS::ISA = qw(YOURCLASS);> your applications should be able to use SUBCLASS in exactly the same way as YOURCLASS. For example, does your application still work if you change: C<< $obj = YOURCLASS->new(); >> into: C<< $obj = SUBCLASS->new(); >> ? Avoid keeping any state information in your packages. It makes it difficult for multiple other packages to use yours. Keep state information in objects. Always use B<-w>. Try to C<use strict;> (or C<use strict qw(...);>). Remember that you can add C<no strict qw(...);> to individual blocks of code that need less strictness. Always use B<-w>. Follow the guidelines in L<perlstyle>. Always use B<-w>. =item * Some simple style guidelines The perlstyle manual supplied with Perl has many helpful points. Coding style is a matter of personal taste. Many people evolve their style over several years as they learn what helps them write and maintain good code. Here's one set of assorted suggestions that seem to be widely used by experienced developers: Use underscores to separate words. It is generally easier to read $var_names_like_this than $VarNamesLikeThis, especially for non-native speakers of English. It's also a simple rule that works consistently with VAR_NAMES_LIKE_THIS. Package/Module names are an exception to this rule. Perl informally reserves lowercase module names for 'pragma' modules like integer and strict. Other modules normally begin with a capital letter and use mixed case with no underscores (need to be short and portable). You may find it helpful to use letter case to indicate the scope or nature of a variable. For example: $ALL_CAPS_HERE constants only (beware clashes with Perl vars) $Some_Caps_Here package-wide global/static $no_caps_here function scope my() or local() variables Function and method names seem to work best as all lowercase. e.g., C<< $obj->as_string() >>. You can use a leading underscore to indicate that a variable or function should not be used outside the package that defined it. =item * Select what to export. Do NOT export method names! Do NOT export anything else by default without a good reason! Exports pollute the namespace of the module user. If you must export try to use @EXPORT_OK in preference to @EXPORT and avoid short or common names to reduce the risk of name clashes. Generally anything not exported is still accessible from outside the module using the ModuleName::item_name (or C<< $blessed_ref->method >>) syntax. By convention you can use a leading underscore on names to indicate informally that they are 'internal' and not for public use. (It is actually possible to get private functions by saying: C<my $subref = sub { ... }; &$subref;>. But there's no way to call that directly as a method, because a method must have a name in the symbol table.) As a general rule, if the module is trying to be object oriented then export nothing. If it's just a collection of functions then @EXPORT_OK anything but use @EXPORT with caution. =item * Select a name for the module. This name should be as descriptive, accurate, and complete as possible. Avoid any risk of ambiguity. Always try to use two or more whole words. Generally the name should reflect what is special about what the module does rather than how it does it. Please use nested module names to group informally or categorize a module. There should be a very good reason for a module not to have a nested name. Module names should begin with a capital letter. Having 57 modules all called Sort will not make life easy for anyone (though having 23 called Sort::Quick is only marginally better :-). Imagine someone trying to install your module alongside many others. If in any doubt ask for suggestions in comp.lang.perl.misc. If you are developing a suite of related modules/classes it's good practice to use nested classes with a common prefix as this will avoid namespace clashes. For example: Xyz::Control, Xyz::View, Xyz::Model etc. Use the modules in this list as a naming guide. If adding a new module to a set, follow the original author's standards for naming modules and the interface to methods in those modules. If developing modules for private internal or project specific use, that will never be released to the public, then you should ensure that their names will not clash with any future public module. You can do this either by using the reserved Local::* category or by using a category name that includes an underscore like Foo_Corp::*. To be portable each component of a module name should be limited to 11 characters. If it might be used on MS-DOS then try to ensure each is unique in the first 8 characters. Nested modules make this easier. =item * Have you got it right? How do you know that you've made the right decisions? Have you picked an interface design that will cause problems later? Have you picked the most appropriate name? Do you have any questions? The best way to know for sure, and pick up many helpful suggestions, is to ask someone who knows. Comp.lang.perl.misc is read by just about all the people who develop modules and it's the best place to ask. All you need to do is post a short summary of the module, its purpose and interfaces. A few lines on each of the main methods is probably enough. (If you post the whole module it might be ignored by busy people - generally the very people you want to read it!) Don't worry about posting if you can't say when the module will be ready - just say so in the message. It might be worth inviting others to help you, they may be able to complete it for you! =item * README and other Additional Files. It's well known that software developers usually fully document the software they write. If, however, the world is in urgent need of your software and there is not enough time to write the full documentation please at least provide a README file containing: =over 10 =item * A description of the module/package/extension etc. =item * A copyright notice - see below. =item * Prerequisites - what else you may need to have. =item * How to build it - possible changes to Makefile.PL etc. =item * How to install it. =item * Recent changes in this release, especially incompatibilities =item * Changes / enhancements you plan to make in the future. =back If the README file seems to be getting too large you may wish to split out some of the sections into separate files: INSTALL, Copying, ToDo etc. =over 4 =item * Adding a Copyright Notice. How you choose to license your work is a personal decision. The general mechanism is to assert your Copyright and then make a declaration of how others may copy/use/modify your work. Perl, for example, is supplied with two types of licence: The GNU GPL and The Artistic Licence (see the files README, Copying, and Artistic, or L<perlgpl> and L<perlartistic>). Larry has good reasons for NOT just using the GNU GPL. My personal recommendation, out of respect for Larry, Perl, and the Perl community at large is to state something simply like: Copyright (c) 1995 Your Name. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This statement should at least appear in the README file. You may also wish to include it in a Copying file and your source files. Remember to include the other words in addition to the Copyright. =item * Give the module a version/issue/release number. To be fully compatible with the Exporter and MakeMaker modules you should store your module's version number in a non-my package variable called $VERSION. This should be a positive floating point number with at least two digits after the decimal (i.e., hundredths, e.g, C<$VERSION = "0.01">). Don't use a "1.3.2" style version. See L<Exporter> for details. It may be handy to add a function or method to retrieve the number. Use the number in announcements and archive file names when releasing the module (ModuleName-1.02.tar.Z). See perldoc ExtUtils::MakeMaker.pm for details. =item * How to release and distribute a module. It's good idea to post an announcement of the availability of your module (or the module itself if small) to the comp.lang.perl.announce Usenet newsgroup. This will at least ensure very wide once-off distribution. If possible, register the module with CPAN. You should include details of its location in your announcement. Some notes about ftp archives: Please use a long descriptive file name that includes the version number. Most incoming directories will not be readable/listable, i.e., you won't be able to see your file after uploading it. Remember to send your email notification message as soon as possible after uploading else your file may get deleted automatically. Allow time for the file to be processed and/or check the file has been processed before announcing its location. FTP Archives for Perl Modules: Follow the instructions and links on: http://www.cpan.org/modules/00modlist.long.html http://www.cpan.org/modules/04pause.html or upload to one of these sites: https://pause.kbx.de/pause/ http://pause.perl.org/ and notify <modules@perl.org>. By using the WWW interface you can ask the Upload Server to mirror your modules from your ftp or WWW site into your own directory on CPAN! Please remember to send me an updated entry for the Module list! =item * Take care when changing a released module. Always strive to remain compatible with previous released versions. Otherwise try to add a mechanism to revert to the old behavior if people rely on it. Document incompatible changes. =back =back =head2 Guidelines for Converting Perl 4 Library Scripts into Modules =over 4 =item * There is no requirement to convert anything. If it ain't broke, don't fix it! Perl 4 library scripts should continue to work with no problems. You may need to make some minor changes (like escaping non-array @'s in double quoted strings) but there is no need to convert a .pl file into a Module for just that. =item * Consider the implications. All Perl applications that make use of the script will need to be changed (slightly) if the script is converted into a module. Is it worth it unless you plan to make other changes at the same time? =item * Make the most of the opportunity. If you are going to convert the script to a module you can use the opportunity to redesign the interface. The guidelines for module creation above include many of the issues you should consider. =item * The pl2pm utility will get you started. This utility will read *.pl files (given as parameters) and write corresponding *.pm files. The pl2pm utilities does the following: =over 10 =item * Adds the standard Module prologue lines =item * Converts package specifiers from ' to :: =item * Converts die(...) to croak(...) =item * Several other minor changes =back Being a mechanical process pl2pm is not bullet proof. The converted code will need careful checking, especially any package statements. Don't delete the original .pl file till the new .pm one works! =back =head2 Guidelines for Reusing Application Code =over 4 =item * Complete applications rarely belong in the Perl Module Library. =item * Many applications contain some Perl code that could be reused. Help save the world! Share your code in a form that makes it easy to reuse. =item * Break-out the reusable code into one or more separate module files. =item * Take the opportunity to reconsider and redesign the interfaces. =item * In some cases the 'application' can then be reduced to a small fragment of code built on top of the reusable modules. In these cases the application could invoked as: % perl -e 'use Module::Name; method(@ARGV)' ... or % perl -mModule::Name ... (in perl5.002 or higher) =back =head1 NOTE Perl does not enforce private and public parts of its modules as you may have been used to in other languages like C++, Ada, or Modula-17. Perl doesn't have an infatuation with enforced privacy. It would prefer that you stayed out of its living room because you weren't invited, not because it has a shotgun. The module and its user have a contract, part of which is common law, and part of which is "written". Part of the common law contract is that a module doesn't pollute any namespace it wasn't asked to. The written contract for the module (A.K.A. documentation) may make other provisions. But then you know when you C<use RedefineTheWorld> that you're redefining the world and willing to take the consequences.
efortuna/AndroidSDKClone
ndk_experimental/prebuilt/linux-x86_64/lib/perl5/5.16.2/pod/perlmodlib.pod
Perl
apache-2.0
80,131
#! /usr/bin/env perl # Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved. # # Licensed under the OpenSSL license (the "License"). You may not use # this file except in compliance with the License. You can obtain a copy # in the file LICENSE in the source distribution or at # https://www.openssl.org/source/license.html # # ==================================================================== # Written by Andy Polyakov <appro@openssl.org> for the OpenSSL # project. The module is, however, dual licensed under OpenSSL and # CRYPTOGAMS licenses depending on where you obtain it. For further # details see http://www.openssl.org/~appro/cryptogams/. # ==================================================================== # # This module implements Poly1305 hash for ARMv8. # # June 2015 # # Numbers are cycles per processed byte with poly1305_blocks alone. # # IALU/gcc-4.9 NEON # # Apple A7 1.86/+5% 0.72 # Cortex-A53 2.69/+58% 1.47 # Cortex-A57 2.70/+7% 1.14 # Denver 1.64/+50% 1.18(*) # X-Gene 2.13/+68% 2.27 # Mongoose 1.77/+75% 1.12 # Kryo 2.70/+55% 1.13 # # (*) estimate based on resources availability is less than 1.0, # i.e. measured result is worse than expected, presumably binary # translator is not almighty; $flavour=shift; $output=shift; $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; ( $xlate="${dir}arm-xlate.pl" and -f $xlate ) or ( $xlate="${dir}../../perlasm/arm-xlate.pl" and -f $xlate) or die "can't locate arm-xlate.pl"; open OUT,"| \"$^X\" $xlate $flavour $output"; *STDOUT=*OUT; my ($ctx,$inp,$len,$padbit) = map("x$_",(0..3)); my ($mac,$nonce)=($inp,$len); my ($h0,$h1,$h2,$r0,$r1,$s1,$t0,$t1,$d0,$d1,$d2) = map("x$_",(4..14)); $code.=<<___; #include "arm_arch.h" .text // forward "declarations" are required for Apple .extern OPENSSL_armcap_P .globl poly1305_blocks .globl poly1305_emit .globl poly1305_init .type poly1305_init,%function .align 5 poly1305_init: cmp $inp,xzr stp xzr,xzr,[$ctx] // zero hash value stp xzr,xzr,[$ctx,#16] // [along with is_base2_26] csel x0,xzr,x0,eq b.eq .Lno_key #ifdef __ILP32__ ldrsw $t1,.LOPENSSL_armcap_P #else ldr $t1,.LOPENSSL_armcap_P #endif adr $t0,.LOPENSSL_armcap_P ldp $r0,$r1,[$inp] // load key mov $s1,#0xfffffffc0fffffff movk $s1,#0x0fff,lsl#48 ldr w17,[$t0,$t1] #ifdef __ARMEB__ rev $r0,$r0 // flip bytes rev $r1,$r1 #endif and $r0,$r0,$s1 // &=0ffffffc0fffffff and $s1,$s1,#-4 and $r1,$r1,$s1 // &=0ffffffc0ffffffc stp $r0,$r1,[$ctx,#32] // save key value tst w17,#ARMV7_NEON adr $d0,poly1305_blocks adr $r0,poly1305_blocks_neon adr $d1,poly1305_emit adr $r1,poly1305_emit_neon csel $d0,$d0,$r0,eq csel $d1,$d1,$r1,eq #ifdef __ILP32__ stp w12,w13,[$len] #else stp $d0,$d1,[$len] #endif mov x0,#1 .Lno_key: ret .size poly1305_init,.-poly1305_init .type poly1305_blocks,%function .align 5 poly1305_blocks: ands $len,$len,#-16 b.eq .Lno_data ldp $h0,$h1,[$ctx] // load hash value ldp $r0,$r1,[$ctx,#32] // load key value ldr $h2,[$ctx,#16] add $s1,$r1,$r1,lsr#2 // s1 = r1 + (r1 >> 2) b .Loop .align 5 .Loop: ldp $t0,$t1,[$inp],#16 // load input sub $len,$len,#16 #ifdef __ARMEB__ rev $t0,$t0 rev $t1,$t1 #endif adds $h0,$h0,$t0 // accumulate input adcs $h1,$h1,$t1 mul $d0,$h0,$r0 // h0*r0 adc $h2,$h2,$padbit umulh $d1,$h0,$r0 mul $t0,$h1,$s1 // h1*5*r1 umulh $t1,$h1,$s1 adds $d0,$d0,$t0 mul $t0,$h0,$r1 // h0*r1 adc $d1,$d1,$t1 umulh $d2,$h0,$r1 adds $d1,$d1,$t0 mul $t0,$h1,$r0 // h1*r0 adc $d2,$d2,xzr umulh $t1,$h1,$r0 adds $d1,$d1,$t0 mul $t0,$h2,$s1 // h2*5*r1 adc $d2,$d2,$t1 mul $t1,$h2,$r0 // h2*r0 adds $d1,$d1,$t0 adc $d2,$d2,$t1 and $t0,$d2,#-4 // final reduction and $h2,$d2,#3 add $t0,$t0,$d2,lsr#2 adds $h0,$d0,$t0 adcs $h1,$d1,xzr adc $h2,$h2,xzr cbnz $len,.Loop stp $h0,$h1,[$ctx] // store hash value str $h2,[$ctx,#16] .Lno_data: ret .size poly1305_blocks,.-poly1305_blocks .type poly1305_emit,%function .align 5 poly1305_emit: ldp $h0,$h1,[$ctx] // load hash base 2^64 ldr $h2,[$ctx,#16] ldp $t0,$t1,[$nonce] // load nonce adds $d0,$h0,#5 // compare to modulus adcs $d1,$h1,xzr adc $d2,$h2,xzr tst $d2,#-4 // see if it's carried/borrowed csel $h0,$h0,$d0,eq csel $h1,$h1,$d1,eq #ifdef __ARMEB__ ror $t0,$t0,#32 // flip nonce words ror $t1,$t1,#32 #endif adds $h0,$h0,$t0 // accumulate nonce adc $h1,$h1,$t1 #ifdef __ARMEB__ rev $h0,$h0 // flip output bytes rev $h1,$h1 #endif stp $h0,$h1,[$mac] // write result ret .size poly1305_emit,.-poly1305_emit ___ my ($R0,$R1,$S1,$R2,$S2,$R3,$S3,$R4,$S4) = map("v$_.4s",(0..8)); my ($IN01_0,$IN01_1,$IN01_2,$IN01_3,$IN01_4) = map("v$_.2s",(9..13)); my ($IN23_0,$IN23_1,$IN23_2,$IN23_3,$IN23_4) = map("v$_.2s",(14..18)); my ($ACC0,$ACC1,$ACC2,$ACC3,$ACC4) = map("v$_.2d",(19..23)); my ($H0,$H1,$H2,$H3,$H4) = map("v$_.2s",(24..28)); my ($T0,$T1,$MASK) = map("v$_",(29..31)); my ($in2,$zeros)=("x16","x17"); my $is_base2_26 = $zeros; # borrow $code.=<<___; .type poly1305_mult,%function .align 5 poly1305_mult: mul $d0,$h0,$r0 // h0*r0 umulh $d1,$h0,$r0 mul $t0,$h1,$s1 // h1*5*r1 umulh $t1,$h1,$s1 adds $d0,$d0,$t0 mul $t0,$h0,$r1 // h0*r1 adc $d1,$d1,$t1 umulh $d2,$h0,$r1 adds $d1,$d1,$t0 mul $t0,$h1,$r0 // h1*r0 adc $d2,$d2,xzr umulh $t1,$h1,$r0 adds $d1,$d1,$t0 mul $t0,$h2,$s1 // h2*5*r1 adc $d2,$d2,$t1 mul $t1,$h2,$r0 // h2*r0 adds $d1,$d1,$t0 adc $d2,$d2,$t1 and $t0,$d2,#-4 // final reduction and $h2,$d2,#3 add $t0,$t0,$d2,lsr#2 adds $h0,$d0,$t0 adcs $h1,$d1,xzr adc $h2,$h2,xzr ret .size poly1305_mult,.-poly1305_mult .type poly1305_splat,%function .align 5 poly1305_splat: and x12,$h0,#0x03ffffff // base 2^64 -> base 2^26 ubfx x13,$h0,#26,#26 extr x14,$h1,$h0,#52 and x14,x14,#0x03ffffff ubfx x15,$h1,#14,#26 extr x16,$h2,$h1,#40 str w12,[$ctx,#16*0] // r0 add w12,w13,w13,lsl#2 // r1*5 str w13,[$ctx,#16*1] // r1 add w13,w14,w14,lsl#2 // r2*5 str w12,[$ctx,#16*2] // s1 str w14,[$ctx,#16*3] // r2 add w14,w15,w15,lsl#2 // r3*5 str w13,[$ctx,#16*4] // s2 str w15,[$ctx,#16*5] // r3 add w15,w16,w16,lsl#2 // r4*5 str w14,[$ctx,#16*6] // s3 str w16,[$ctx,#16*7] // r4 str w15,[$ctx,#16*8] // s4 ret .size poly1305_splat,.-poly1305_splat .type poly1305_blocks_neon,%function .align 5 poly1305_blocks_neon: ldr $is_base2_26,[$ctx,#24] cmp $len,#128 b.hs .Lblocks_neon cbz $is_base2_26,poly1305_blocks .Lblocks_neon: .inst 0xd503233f // paciasp stp x29,x30,[sp,#-80]! add x29,sp,#0 ands $len,$len,#-16 b.eq .Lno_data_neon cbz $is_base2_26,.Lbase2_64_neon ldp w10,w11,[$ctx] // load hash value base 2^26 ldp w12,w13,[$ctx,#8] ldr w14,[$ctx,#16] tst $len,#31 b.eq .Leven_neon ldp $r0,$r1,[$ctx,#32] // load key value add $h0,x10,x11,lsl#26 // base 2^26 -> base 2^64 lsr $h1,x12,#12 adds $h0,$h0,x12,lsl#52 add $h1,$h1,x13,lsl#14 adc $h1,$h1,xzr lsr $h2,x14,#24 adds $h1,$h1,x14,lsl#40 adc $d2,$h2,xzr // can be partially reduced... ldp $d0,$d1,[$inp],#16 // load input sub $len,$len,#16 add $s1,$r1,$r1,lsr#2 // s1 = r1 + (r1 >> 2) and $t0,$d2,#-4 // ... so reduce and $h2,$d2,#3 add $t0,$t0,$d2,lsr#2 adds $h0,$h0,$t0 adcs $h1,$h1,xzr adc $h2,$h2,xzr #ifdef __ARMEB__ rev $d0,$d0 rev $d1,$d1 #endif adds $h0,$h0,$d0 // accumulate input adcs $h1,$h1,$d1 adc $h2,$h2,$padbit bl poly1305_mult ldr x30,[sp,#8] cbz $padbit,.Lstore_base2_64_neon and x10,$h0,#0x03ffffff // base 2^64 -> base 2^26 ubfx x11,$h0,#26,#26 extr x12,$h1,$h0,#52 and x12,x12,#0x03ffffff ubfx x13,$h1,#14,#26 extr x14,$h2,$h1,#40 cbnz $len,.Leven_neon stp w10,w11,[$ctx] // store hash value base 2^26 stp w12,w13,[$ctx,#8] str w14,[$ctx,#16] b .Lno_data_neon .align 4 .Lstore_base2_64_neon: stp $h0,$h1,[$ctx] // store hash value base 2^64 stp $h2,xzr,[$ctx,#16] // note that is_base2_26 is zeroed b .Lno_data_neon .align 4 .Lbase2_64_neon: ldp $r0,$r1,[$ctx,#32] // load key value ldp $h0,$h1,[$ctx] // load hash value base 2^64 ldr $h2,[$ctx,#16] tst $len,#31 b.eq .Linit_neon ldp $d0,$d1,[$inp],#16 // load input sub $len,$len,#16 add $s1,$r1,$r1,lsr#2 // s1 = r1 + (r1 >> 2) #ifdef __ARMEB__ rev $d0,$d0 rev $d1,$d1 #endif adds $h0,$h0,$d0 // accumulate input adcs $h1,$h1,$d1 adc $h2,$h2,$padbit bl poly1305_mult .Linit_neon: and x10,$h0,#0x03ffffff // base 2^64 -> base 2^26 ubfx x11,$h0,#26,#26 extr x12,$h1,$h0,#52 and x12,x12,#0x03ffffff ubfx x13,$h1,#14,#26 extr x14,$h2,$h1,#40 stp d8,d9,[sp,#16] // meet ABI requirements stp d10,d11,[sp,#32] stp d12,d13,[sp,#48] stp d14,d15,[sp,#64] fmov ${H0},x10 fmov ${H1},x11 fmov ${H2},x12 fmov ${H3},x13 fmov ${H4},x14 ////////////////////////////////// initialize r^n table mov $h0,$r0 // r^1 add $s1,$r1,$r1,lsr#2 // s1 = r1 + (r1 >> 2) mov $h1,$r1 mov $h2,xzr add $ctx,$ctx,#48+12 bl poly1305_splat bl poly1305_mult // r^2 sub $ctx,$ctx,#4 bl poly1305_splat bl poly1305_mult // r^3 sub $ctx,$ctx,#4 bl poly1305_splat bl poly1305_mult // r^4 sub $ctx,$ctx,#4 bl poly1305_splat ldr x30,[sp,#8] add $in2,$inp,#32 adr $zeros,.Lzeros subs $len,$len,#64 csel $in2,$zeros,$in2,lo mov x4,#1 str x4,[$ctx,#-24] // set is_base2_26 sub $ctx,$ctx,#48 // restore original $ctx b .Ldo_neon .align 4 .Leven_neon: add $in2,$inp,#32 adr $zeros,.Lzeros subs $len,$len,#64 csel $in2,$zeros,$in2,lo stp d8,d9,[sp,#16] // meet ABI requirements stp d10,d11,[sp,#32] stp d12,d13,[sp,#48] stp d14,d15,[sp,#64] fmov ${H0},x10 fmov ${H1},x11 fmov ${H2},x12 fmov ${H3},x13 fmov ${H4},x14 .Ldo_neon: ldp x8,x12,[$in2],#16 // inp[2:3] (or zero) ldp x9,x13,[$in2],#48 lsl $padbit,$padbit,#24 add x15,$ctx,#48 #ifdef __ARMEB__ rev x8,x8 rev x12,x12 rev x9,x9 rev x13,x13 #endif and x4,x8,#0x03ffffff // base 2^64 -> base 2^26 and x5,x9,#0x03ffffff ubfx x6,x8,#26,#26 ubfx x7,x9,#26,#26 add x4,x4,x5,lsl#32 // bfi x4,x5,#32,#32 extr x8,x12,x8,#52 extr x9,x13,x9,#52 add x6,x6,x7,lsl#32 // bfi x6,x7,#32,#32 fmov $IN23_0,x4 and x8,x8,#0x03ffffff and x9,x9,#0x03ffffff ubfx x10,x12,#14,#26 ubfx x11,x13,#14,#26 add x12,$padbit,x12,lsr#40 add x13,$padbit,x13,lsr#40 add x8,x8,x9,lsl#32 // bfi x8,x9,#32,#32 fmov $IN23_1,x6 add x10,x10,x11,lsl#32 // bfi x10,x11,#32,#32 add x12,x12,x13,lsl#32 // bfi x12,x13,#32,#32 fmov $IN23_2,x8 fmov $IN23_3,x10 fmov $IN23_4,x12 ldp x8,x12,[$inp],#16 // inp[0:1] ldp x9,x13,[$inp],#48 ld1 {$R0,$R1,$S1,$R2},[x15],#64 ld1 {$S2,$R3,$S3,$R4},[x15],#64 ld1 {$S4},[x15] #ifdef __ARMEB__ rev x8,x8 rev x12,x12 rev x9,x9 rev x13,x13 #endif and x4,x8,#0x03ffffff // base 2^64 -> base 2^26 and x5,x9,#0x03ffffff ubfx x6,x8,#26,#26 ubfx x7,x9,#26,#26 add x4,x4,x5,lsl#32 // bfi x4,x5,#32,#32 extr x8,x12,x8,#52 extr x9,x13,x9,#52 add x6,x6,x7,lsl#32 // bfi x6,x7,#32,#32 fmov $IN01_0,x4 and x8,x8,#0x03ffffff and x9,x9,#0x03ffffff ubfx x10,x12,#14,#26 ubfx x11,x13,#14,#26 add x12,$padbit,x12,lsr#40 add x13,$padbit,x13,lsr#40 add x8,x8,x9,lsl#32 // bfi x8,x9,#32,#32 fmov $IN01_1,x6 add x10,x10,x11,lsl#32 // bfi x10,x11,#32,#32 add x12,x12,x13,lsl#32 // bfi x12,x13,#32,#32 movi $MASK.2d,#-1 fmov $IN01_2,x8 fmov $IN01_3,x10 fmov $IN01_4,x12 ushr $MASK.2d,$MASK.2d,#38 b.ls .Lskip_loop .align 4 .Loop_neon: //////////////////////////////////////////////////////////////// // ((inp[0]*r^4+inp[2]*r^2+inp[4])*r^4+inp[6]*r^2 // ((inp[1]*r^4+inp[3]*r^2+inp[5])*r^3+inp[7]*r // \___________________/ // ((inp[0]*r^4+inp[2]*r^2+inp[4])*r^4+inp[6]*r^2+inp[8])*r^2 // ((inp[1]*r^4+inp[3]*r^2+inp[5])*r^4+inp[7]*r^2+inp[9])*r // \___________________/ \____________________/ // // Note that we start with inp[2:3]*r^2. This is because it // doesn't depend on reduction in previous iteration. //////////////////////////////////////////////////////////////// // d4 = h0*r4 + h1*r3 + h2*r2 + h3*r1 + h4*r0 // d3 = h0*r3 + h1*r2 + h2*r1 + h3*r0 + h4*5*r4 // d2 = h0*r2 + h1*r1 + h2*r0 + h3*5*r4 + h4*5*r3 // d1 = h0*r1 + h1*r0 + h2*5*r4 + h3*5*r3 + h4*5*r2 // d0 = h0*r0 + h1*5*r4 + h2*5*r3 + h3*5*r2 + h4*5*r1 subs $len,$len,#64 umull $ACC4,$IN23_0,${R4}[2] csel $in2,$zeros,$in2,lo umull $ACC3,$IN23_0,${R3}[2] umull $ACC2,$IN23_0,${R2}[2] ldp x8,x12,[$in2],#16 // inp[2:3] (or zero) umull $ACC1,$IN23_0,${R1}[2] ldp x9,x13,[$in2],#48 umull $ACC0,$IN23_0,${R0}[2] #ifdef __ARMEB__ rev x8,x8 rev x12,x12 rev x9,x9 rev x13,x13 #endif umlal $ACC4,$IN23_1,${R3}[2] and x4,x8,#0x03ffffff // base 2^64 -> base 2^26 umlal $ACC3,$IN23_1,${R2}[2] and x5,x9,#0x03ffffff umlal $ACC2,$IN23_1,${R1}[2] ubfx x6,x8,#26,#26 umlal $ACC1,$IN23_1,${R0}[2] ubfx x7,x9,#26,#26 umlal $ACC0,$IN23_1,${S4}[2] add x4,x4,x5,lsl#32 // bfi x4,x5,#32,#32 umlal $ACC4,$IN23_2,${R2}[2] extr x8,x12,x8,#52 umlal $ACC3,$IN23_2,${R1}[2] extr x9,x13,x9,#52 umlal $ACC2,$IN23_2,${R0}[2] add x6,x6,x7,lsl#32 // bfi x6,x7,#32,#32 umlal $ACC1,$IN23_2,${S4}[2] fmov $IN23_0,x4 umlal $ACC0,$IN23_2,${S3}[2] and x8,x8,#0x03ffffff umlal $ACC4,$IN23_3,${R1}[2] and x9,x9,#0x03ffffff umlal $ACC3,$IN23_3,${R0}[2] ubfx x10,x12,#14,#26 umlal $ACC2,$IN23_3,${S4}[2] ubfx x11,x13,#14,#26 umlal $ACC1,$IN23_3,${S3}[2] add x8,x8,x9,lsl#32 // bfi x8,x9,#32,#32 umlal $ACC0,$IN23_3,${S2}[2] fmov $IN23_1,x6 add $IN01_2,$IN01_2,$H2 add x12,$padbit,x12,lsr#40 umlal $ACC4,$IN23_4,${R0}[2] add x13,$padbit,x13,lsr#40 umlal $ACC3,$IN23_4,${S4}[2] add x10,x10,x11,lsl#32 // bfi x10,x11,#32,#32 umlal $ACC2,$IN23_4,${S3}[2] add x12,x12,x13,lsl#32 // bfi x12,x13,#32,#32 umlal $ACC1,$IN23_4,${S2}[2] fmov $IN23_2,x8 umlal $ACC0,$IN23_4,${S1}[2] fmov $IN23_3,x10 //////////////////////////////////////////////////////////////// // (hash+inp[0:1])*r^4 and accumulate add $IN01_0,$IN01_0,$H0 fmov $IN23_4,x12 umlal $ACC3,$IN01_2,${R1}[0] ldp x8,x12,[$inp],#16 // inp[0:1] umlal $ACC0,$IN01_2,${S3}[0] ldp x9,x13,[$inp],#48 umlal $ACC4,$IN01_2,${R2}[0] umlal $ACC1,$IN01_2,${S4}[0] umlal $ACC2,$IN01_2,${R0}[0] #ifdef __ARMEB__ rev x8,x8 rev x12,x12 rev x9,x9 rev x13,x13 #endif add $IN01_1,$IN01_1,$H1 umlal $ACC3,$IN01_0,${R3}[0] umlal $ACC4,$IN01_0,${R4}[0] and x4,x8,#0x03ffffff // base 2^64 -> base 2^26 umlal $ACC2,$IN01_0,${R2}[0] and x5,x9,#0x03ffffff umlal $ACC0,$IN01_0,${R0}[0] ubfx x6,x8,#26,#26 umlal $ACC1,$IN01_0,${R1}[0] ubfx x7,x9,#26,#26 add $IN01_3,$IN01_3,$H3 add x4,x4,x5,lsl#32 // bfi x4,x5,#32,#32 umlal $ACC3,$IN01_1,${R2}[0] extr x8,x12,x8,#52 umlal $ACC4,$IN01_1,${R3}[0] extr x9,x13,x9,#52 umlal $ACC0,$IN01_1,${S4}[0] add x6,x6,x7,lsl#32 // bfi x6,x7,#32,#32 umlal $ACC2,$IN01_1,${R1}[0] fmov $IN01_0,x4 umlal $ACC1,$IN01_1,${R0}[0] and x8,x8,#0x03ffffff add $IN01_4,$IN01_4,$H4 and x9,x9,#0x03ffffff umlal $ACC3,$IN01_3,${R0}[0] ubfx x10,x12,#14,#26 umlal $ACC0,$IN01_3,${S2}[0] ubfx x11,x13,#14,#26 umlal $ACC4,$IN01_3,${R1}[0] add x8,x8,x9,lsl#32 // bfi x8,x9,#32,#32 umlal $ACC1,$IN01_3,${S3}[0] fmov $IN01_1,x6 umlal $ACC2,$IN01_3,${S4}[0] add x12,$padbit,x12,lsr#40 umlal $ACC3,$IN01_4,${S4}[0] add x13,$padbit,x13,lsr#40 umlal $ACC0,$IN01_4,${S1}[0] add x10,x10,x11,lsl#32 // bfi x10,x11,#32,#32 umlal $ACC4,$IN01_4,${R0}[0] add x12,x12,x13,lsl#32 // bfi x12,x13,#32,#32 umlal $ACC1,$IN01_4,${S2}[0] fmov $IN01_2,x8 umlal $ACC2,$IN01_4,${S3}[0] fmov $IN01_3,x10 fmov $IN01_4,x12 ///////////////////////////////////////////////////////////////// // lazy reduction as discussed in "NEON crypto" by D.J. Bernstein // and P. Schwabe // // [see discussion in poly1305-armv4 module] ushr $T0.2d,$ACC3,#26 xtn $H3,$ACC3 ushr $T1.2d,$ACC0,#26 and $ACC0,$ACC0,$MASK.2d add $ACC4,$ACC4,$T0.2d // h3 -> h4 bic $H3,#0xfc,lsl#24 // &=0x03ffffff add $ACC1,$ACC1,$T1.2d // h0 -> h1 ushr $T0.2d,$ACC4,#26 xtn $H4,$ACC4 ushr $T1.2d,$ACC1,#26 xtn $H1,$ACC1 bic $H4,#0xfc,lsl#24 add $ACC2,$ACC2,$T1.2d // h1 -> h2 add $ACC0,$ACC0,$T0.2d shl $T0.2d,$T0.2d,#2 shrn $T1.2s,$ACC2,#26 xtn $H2,$ACC2 add $ACC0,$ACC0,$T0.2d // h4 -> h0 bic $H1,#0xfc,lsl#24 add $H3,$H3,$T1.2s // h2 -> h3 bic $H2,#0xfc,lsl#24 shrn $T0.2s,$ACC0,#26 xtn $H0,$ACC0 ushr $T1.2s,$H3,#26 bic $H3,#0xfc,lsl#24 bic $H0,#0xfc,lsl#24 add $H1,$H1,$T0.2s // h0 -> h1 add $H4,$H4,$T1.2s // h3 -> h4 b.hi .Loop_neon .Lskip_loop: dup $IN23_2,${IN23_2}[0] add $IN01_2,$IN01_2,$H2 //////////////////////////////////////////////////////////////// // multiply (inp[0:1]+hash) or inp[2:3] by r^2:r^1 adds $len,$len,#32 b.ne .Long_tail dup $IN23_2,${IN01_2}[0] add $IN23_0,$IN01_0,$H0 add $IN23_3,$IN01_3,$H3 add $IN23_1,$IN01_1,$H1 add $IN23_4,$IN01_4,$H4 .Long_tail: dup $IN23_0,${IN23_0}[0] umull2 $ACC0,$IN23_2,${S3} umull2 $ACC3,$IN23_2,${R1} umull2 $ACC4,$IN23_2,${R2} umull2 $ACC2,$IN23_2,${R0} umull2 $ACC1,$IN23_2,${S4} dup $IN23_1,${IN23_1}[0] umlal2 $ACC0,$IN23_0,${R0} umlal2 $ACC2,$IN23_0,${R2} umlal2 $ACC3,$IN23_0,${R3} umlal2 $ACC4,$IN23_0,${R4} umlal2 $ACC1,$IN23_0,${R1} dup $IN23_3,${IN23_3}[0] umlal2 $ACC0,$IN23_1,${S4} umlal2 $ACC3,$IN23_1,${R2} umlal2 $ACC2,$IN23_1,${R1} umlal2 $ACC4,$IN23_1,${R3} umlal2 $ACC1,$IN23_1,${R0} dup $IN23_4,${IN23_4}[0] umlal2 $ACC3,$IN23_3,${R0} umlal2 $ACC4,$IN23_3,${R1} umlal2 $ACC0,$IN23_3,${S2} umlal2 $ACC1,$IN23_3,${S3} umlal2 $ACC2,$IN23_3,${S4} umlal2 $ACC3,$IN23_4,${S4} umlal2 $ACC0,$IN23_4,${S1} umlal2 $ACC4,$IN23_4,${R0} umlal2 $ACC1,$IN23_4,${S2} umlal2 $ACC2,$IN23_4,${S3} b.eq .Lshort_tail //////////////////////////////////////////////////////////////// // (hash+inp[0:1])*r^4:r^3 and accumulate add $IN01_0,$IN01_0,$H0 umlal $ACC3,$IN01_2,${R1} umlal $ACC0,$IN01_2,${S3} umlal $ACC4,$IN01_2,${R2} umlal $ACC1,$IN01_2,${S4} umlal $ACC2,$IN01_2,${R0} add $IN01_1,$IN01_1,$H1 umlal $ACC3,$IN01_0,${R3} umlal $ACC0,$IN01_0,${R0} umlal $ACC4,$IN01_0,${R4} umlal $ACC1,$IN01_0,${R1} umlal $ACC2,$IN01_0,${R2} add $IN01_3,$IN01_3,$H3 umlal $ACC3,$IN01_1,${R2} umlal $ACC0,$IN01_1,${S4} umlal $ACC4,$IN01_1,${R3} umlal $ACC1,$IN01_1,${R0} umlal $ACC2,$IN01_1,${R1} add $IN01_4,$IN01_4,$H4 umlal $ACC3,$IN01_3,${R0} umlal $ACC0,$IN01_3,${S2} umlal $ACC4,$IN01_3,${R1} umlal $ACC1,$IN01_3,${S3} umlal $ACC2,$IN01_3,${S4} umlal $ACC3,$IN01_4,${S4} umlal $ACC0,$IN01_4,${S1} umlal $ACC4,$IN01_4,${R0} umlal $ACC1,$IN01_4,${S2} umlal $ACC2,$IN01_4,${S3} .Lshort_tail: //////////////////////////////////////////////////////////////// // horizontal add addp $ACC3,$ACC3,$ACC3 ldp d8,d9,[sp,#16] // meet ABI requirements addp $ACC0,$ACC0,$ACC0 ldp d10,d11,[sp,#32] addp $ACC4,$ACC4,$ACC4 ldp d12,d13,[sp,#48] addp $ACC1,$ACC1,$ACC1 ldp d14,d15,[sp,#64] addp $ACC2,$ACC2,$ACC2 //////////////////////////////////////////////////////////////// // lazy reduction, but without narrowing ushr $T0.2d,$ACC3,#26 and $ACC3,$ACC3,$MASK.2d ushr $T1.2d,$ACC0,#26 and $ACC0,$ACC0,$MASK.2d add $ACC4,$ACC4,$T0.2d // h3 -> h4 add $ACC1,$ACC1,$T1.2d // h0 -> h1 ushr $T0.2d,$ACC4,#26 and $ACC4,$ACC4,$MASK.2d ushr $T1.2d,$ACC1,#26 and $ACC1,$ACC1,$MASK.2d add $ACC2,$ACC2,$T1.2d // h1 -> h2 add $ACC0,$ACC0,$T0.2d shl $T0.2d,$T0.2d,#2 ushr $T1.2d,$ACC2,#26 and $ACC2,$ACC2,$MASK.2d add $ACC0,$ACC0,$T0.2d // h4 -> h0 add $ACC3,$ACC3,$T1.2d // h2 -> h3 ushr $T0.2d,$ACC0,#26 and $ACC0,$ACC0,$MASK.2d ushr $T1.2d,$ACC3,#26 and $ACC3,$ACC3,$MASK.2d add $ACC1,$ACC1,$T0.2d // h0 -> h1 add $ACC4,$ACC4,$T1.2d // h3 -> h4 //////////////////////////////////////////////////////////////// // write the result, can be partially reduced st4 {$ACC0,$ACC1,$ACC2,$ACC3}[0],[$ctx],#16 st1 {$ACC4}[0],[$ctx] .Lno_data_neon: .inst 0xd50323bf // autiasp ldr x29,[sp],#80 ret .size poly1305_blocks_neon,.-poly1305_blocks_neon .type poly1305_emit_neon,%function .align 5 poly1305_emit_neon: ldr $is_base2_26,[$ctx,#24] cbz $is_base2_26,poly1305_emit ldp w10,w11,[$ctx] // load hash value base 2^26 ldp w12,w13,[$ctx,#8] ldr w14,[$ctx,#16] add $h0,x10,x11,lsl#26 // base 2^26 -> base 2^64 lsr $h1,x12,#12 adds $h0,$h0,x12,lsl#52 add $h1,$h1,x13,lsl#14 adc $h1,$h1,xzr lsr $h2,x14,#24 adds $h1,$h1,x14,lsl#40 adc $h2,$h2,xzr // can be partially reduced... ldp $t0,$t1,[$nonce] // load nonce and $d0,$h2,#-4 // ... so reduce add $d0,$d0,$h2,lsr#2 and $h2,$h2,#3 adds $h0,$h0,$d0 adcs $h1,$h1,xzr adc $h2,$h2,xzr adds $d0,$h0,#5 // compare to modulus adcs $d1,$h1,xzr adc $d2,$h2,xzr tst $d2,#-4 // see if it's carried/borrowed csel $h0,$h0,$d0,eq csel $h1,$h1,$d1,eq #ifdef __ARMEB__ ror $t0,$t0,#32 // flip nonce words ror $t1,$t1,#32 #endif adds $h0,$h0,$t0 // accumulate nonce adc $h1,$h1,$t1 #ifdef __ARMEB__ rev $h0,$h0 // flip output bytes rev $h1,$h1 #endif stp $h0,$h1,[$mac] // write result ret .size poly1305_emit_neon,.-poly1305_emit_neon .align 5 .Lzeros: .long 0,0,0,0,0,0,0,0 .LOPENSSL_armcap_P: #ifdef __ILP32__ .long OPENSSL_armcap_P-. #else .quad OPENSSL_armcap_P-. #endif .asciz "Poly1305 for ARMv8, CRYPTOGAMS by <appro\@openssl.org>" .align 2 ___ foreach (split("\n",$code)) { s/\b(shrn\s+v[0-9]+)\.[24]d/$1.2s/ or s/\b(fmov\s+)v([0-9]+)[^,]*,\s*x([0-9]+)/$1d$2,x$3/ or (m/\bdup\b/ and (s/\.[24]s/.2d/g or 1)) or (m/\b(eor|and)/ and (s/\.[248][sdh]/.16b/g or 1)) or (m/\bum(ul|la)l\b/ and (s/\.4s/.2s/g or 1)) or (m/\bum(ul|la)l2\b/ and (s/\.2s/.4s/g or 1)) or (m/\bst[1-4]\s+{[^}]+}\[/ and (s/\.[24]d/.s/g or 1)); s/\.[124]([sd])\[/.$1\[/; print $_,"\n"; } close STDOUT or die "error closing STDOUT: $!";
pmq20/ruby-compiler
vendor/openssl/crypto/poly1305/asm/poly1305-armv8.pl
Perl
mit
21,598
If you read this file _as_is_, just ignore the funny characters you see. It is written in the POD format (see pod/perlpod.pod) which is specifically designed to be readable as is. =head1 NAME perlce - Perl for WinCE =head1 Building Perl for WinCE =head2 DESCRIPTION This file gives the instructions for building Perl5.8 and above for WinCE. Please read and understand the terms under which this software is distributed. =head2 General explanations on cross-compiling WinCE =over =item * C<miniperl> is built. This is a single executable (without DLL), intended to run on Win32, and it will facilitate remaining build process; all binaries built after it are foreign and should not run locally. C<miniperl> is built using C<./win32/Makefile>; this is part of normal build process invoked as dependency from wince/Makefile.ce =item * After C<miniperl> is built, C<configpm> is invoked to create right C<Config.pm> in right place and its corresponding Cross.pm. Unlike Win32 build, miniperl will not have C<Config.pm> of host within reach; it rather will use C<Config.pm> from within cross-compilation directories. File C<Cross.pm> is dead simple: for given cross-architecture places in @INC a path where perl modules are, and right C<Config.pm> in that place. That said, C<miniperl -Ilib -MConfig -we 1> should report an error, because it can not find C<Config.pm>. If it does not give an error -- wrong C<Config.pm> is substituted, and resulting binaries will be a mess. C<miniperl -MCross -MConfig -we 1> should run okay, and it will provide right C<Config.pm> for further compilations. =item * During extensions build phase, a script C<./win32/buldext.pl> is invoked, which in turn steps in C<./ext> subdirectories and performs a build of each extension in turn. All invokes of C<Makefile.PL> are provided with C<-MCross> so to enable cross- compile. =back =head2 BUILD This section describes the steps to be performed to build PerlCE. You may find additional information about building perl for WinCE at L<http://perlce.sourceforge.net> and some pre-built binaries. =head3 Tools & SDK For compiling, you need following: =over 4 =item * Microsoft Embedded Visual Tools =item * Microsoft Visual C++ =item * Rainer Keuchel's celib-sources =item * Rainer Keuchel's console-sources =back Needed source files can be downloaded at L<http://www.rainer-keuchel.de/wince/dirlist.html> =head3 Make Normally you only need to edit C<./win32/ce-helpers/compile.bat> to reflect your system and run it. File C<./win32/ce-helpers/compile.bat> is actually a wrapper to call C<nmake -f makefile.ce> with appropriate parameters and it accepts extra parameters and forwards them to C<nmake> command as additional arguments. You should pass target this way. To prepare distribution you need to do following: =over 4 =item * go to C<./win32> subdirectory =item * edit file C<./win32/ce-helpers/compile.bat> =item * run compile.bat =item * run compile.bat dist =back C<Makefile.ce> has C<CROSS_NAME> macro, and it is used further to refer to your cross-compilation scheme. You could assign a name to it, but this is not necessary, because by default it is assigned after your machine configuration name, such as "wince-sh3-hpc-wce211", and this is enough to distinguish different builds at the same time. This option could be handy for several different builds on same platform to perform, say, threaded build. In a following example we assume that all required environment variables are set properly for C cross-compiler (a special *.bat file could fit perfectly to this purpose) and your C<compile.bat> has proper "MACHINE" parameter set, to, say, C<wince-mips-pocket-wce300>. compile.bat compile.bat dist compile.bat CROSS_NAME=mips-wce300-thr "USE_ITHREADS=define" "USE_IMP_SYS=define" "USE_MULTI=define" compile.bat CROSS_NAME=mips-wce300-thr "USE_ITHREADS=define" "USE_IMP_SYS=define" "USE_MULTI=define" dist If all goes okay and no errors during a build, you'll get two independent distributions: C<wince-mips-pocket-wce300> and C<mips-wce300-thr>. Target C<dist> prepares distribution file set. Target C<zipdist> performs same as C<dist> but additionally compresses distribution files into zip archive. NOTE: during a build there could be created a number (or one) of C<Config.pm> for cross-compilation ("foreign" C<Config.pm>) and those are hidden inside C<../xlib/$(CROSS_NAME)> with other auxilary files, but, and this is important to note, there should be B<no> C<Config.pm> for host miniperl. If you'll get an error that perl could not find Config.pm somewhere in building process this means something went wrong. Most probably you forgot to specify a cross-compilation when invoking miniperl.exe to Makefile.PL When building an extension for cross-compilation your command line should look like ..\miniperl.exe -I..\lib -MCross=mips-wce300-thr Makefile.PL or just ..\miniperl.exe -I..\lib -MCross Makefile.PL to refer a cross-compilation that was created last time. All questions related to building for WinCE devices could be asked in F<perlce-user@lists.sourceforge.net> mailing list. =head1 Using Perl on WinCE =head2 DESCRIPTION PerlCE is currently linked with a simple console window, so it also works on non-hpc devices. The simple stdio implementation creates the files C<stdin.txt>, C<stdout.txt> and C<stderr.txt>, so you might examine them if your console has only a liminted number of cols. When exitcode is non-zero, a message box appears, otherwise the console closes, so you might have to catch an exit with status 0 in your program to see any output. stdout/stderr now go into the files C</perl-stdout.txt> and C</perl-stderr.txt.> PerlIDE is handy to deal with perlce. =head2 LIMITATIONS No fork(), pipe(), popen() etc. =head2 ENVIRONMENT All environment vars must be stored in HKLM\Environment as strings. They are read at process startup. =over =item PERL5LIB Usual perl lib path (semi-list). =item PATH Semi-list for executables. =item TMP - Tempdir. =item UNIXROOTPATH - Root for accessing some special files, i.e. C</dev/null>, C</etc/services>. =item ROWS/COLS - Rows/cols for console. =item HOME - Home directory. =item CONSOLEFONTSIZE - Size for console font. =back You can set these with cereg.exe, a (remote) registry editor or via the PerlIDE. =head2 REGISTRY To start perl by clicking on a perl source file, you have to make the according entries in HKCR (see C<ce-helpers/wince-reg.bat>). cereg.exe (which must be executed on a desktop pc with ActiveSync) is reported not to work on some devices. You have to create the registry entries by hand using a registry editor. =head2 XS The following Win32-Methods are built-in: newXS("Win32::GetCwd", w32_GetCwd, file); newXS("Win32::SetCwd", w32_SetCwd, file); newXS("Win32::GetTickCount", w32_GetTickCount, file); newXS("Win32::GetOSVersion", w32_GetOSVersion, file); newXS("Win32::IsWinNT", w32_IsWinNT, file); newXS("Win32::IsWin95", w32_IsWin95, file); newXS("Win32::IsWinCE", w32_IsWinCE, file); newXS("Win32::CopyFile", w32_CopyFile, file); newXS("Win32::Sleep", w32_Sleep, file); newXS("Win32::MessageBox", w32_MessageBox, file); newXS("Win32::GetPowerStatus", w32_GetPowerStatus, file); newXS("Win32::GetOemInfo", w32_GetOemInfo, file); newXS("Win32::ShellEx", w32_ShellEx, file); =head2 BUGS Opening files for read-write is currently not supported if they use stdio (normal perl file handles). If you find bugs or if it does not work at all on your device, send mail to the address below. Please report the details of your device (processor, ceversion, devicetype (hpc/palm/pocket)) and the date of the downloaded files. =head2 INSTALLATION Currently installation instructions are at L<http://perlce.sourceforge.net/>. After installation & testing processes will stabilize, information will be more precise. =head1 ACKNOWLEDGEMENTS The port for Win32 was used as a reference. =head1 History of WinCE port =over =item 5.6.0 Initial port of perl to WinCE. It was performed in separate directory named C<wince>. This port was based on contents of C<./win32> directory. C<miniperl> was not built, user must have HOST perl and properly edit C<makefile.ce> to reflect this. =item 5.8.0 wince port was kept in the same C<./wince> directory, and C<wince/Makefile.ce> was used to invoke native compiler to create HOST miniperl, which then facilitates cross-compiling process. Extension building support was added. =item 5.9.4 Two directories C<./win32> and C<./wince> were merged, so perlce build process comes in C<./win32> directory. =back =head1 AUTHORS =over =item Rainer Keuchel <coyxc@rainer-keuchel.de> provided initial port of Perl, which appears to be most essential work, as it was a breakthrough on having Perl ported at all. Many thanks and obligations to Rainer! =item Vadim Konovalov made further support of WinCE port. =back
leighpauls/k2cro4
third_party/cygwin/lib/perl5/5.10/pods/perlce.pod
Perl
bsd-3-clause
8,951
/* Probabilistic contect-free grammar. 0.2:S->aS 0.2:S->bS 0.3:S->a 0.3:S->b From Taisuke Sato and Keiichi Kubota. Viterbi training in PRISM. Theory and Practice of Logic Programming, doi:10.1017/S1471068413000677. */ :- use_module(library(mcintyre)). :- if(current_predicate(use_rendering/1)). :- use_rendering(c3). :- endif. :- mc. :- begin_lpad. % pcfg(LT): LT is string of terminals accepted by the grammar % pcfg(L,LT,LT0) L is a tring of terminals and not terminals that derives % the list of terminals in LT-LT0 pcfg(L):- pcfg(['S'],[],_Der,L,[]). % L is accepted if it can be derived from the start symbol S and an empty % string of previous terminals pcfg([A|R],Der0,Der,L0,L2):- rule(A,Der0,RHS), pcfg(RHS,[rule(A,RHS)|Der0],Der1,L0,L1), pcfg(R,Der1,Der,L1,L2). % if there is a rule for A (i.e. it is a non-terminal), expand A using the rule % and continue with the rest of the list pcfg([A|R],Der0,Der,[A|L1],L2):- \+ rule(A,_,_), pcfg(R,Der0,Der,L1,L2). % if A is a terminal, move it to the output string pcfg([],Der,Der,L,L). % there are no more symbols to expand rule('S',Der,['S','S']):0.4; rule('S',Der,[a]):0.3; rule('S',Der,[b]):0.3. % encodes the three rules of the grammar :- end_lpad. /** <examples> ?- mc_prob(pcfg([a]),Prob). % expected result ~ 0.2986666666666667. ?- mc_prob(pcfg([b]),Prob). % expected result ~ 0.2976666666666667. ?- mc_prob(pcfg([a,a]),Prob). % expected result ~ 0.035666666666666666. ?- mc_prob(pcfg([b,b]),Prob). % expected result ~ 0.036833333333333336. ?- mc_prob(pcfg([a,b]),Prob). % expected result ~ 0.035833333333333335. ?- mc_prob(pcfg([a,b,a]),Prob). % expected result ~ 0.009. ?- mc_sample(pcfg([a,a]),1000,Prob,[successes(T),failures(F)]). % take 1000 samples of pcfg([a,a]) ?- mc_sample(pcfg([a,a]),1000,Prob),bar(Prob,C). % take 1000 samples of pcfg([a,a]) ?- mc_sample_arg(pcfg(S),20,S,Values). % take 20 samples of S in % findall(S,pcfg(S),L) ?- mc_sample_arg(pcfg(L),20,L,Values),argbar(Values,C). % take 20 samples of S in % findall(S,pcfg(S),L) */
TeamSPoon/logicmoo_workspace
packs_lib/cplint/prolog/examples/pcfglr.pl
Perl
mit
2,052
no_payment_due(student1000,pos). no_payment_due(student999,pos). no_payment_due(student998,pos). no_payment_due(student996,pos). no_payment_due(student994,pos). no_payment_due(student993,pos). no_payment_due(student992,pos). no_payment_due(student990,pos). no_payment_due(student989,pos). no_payment_due(student987,pos). no_payment_due(student985,pos). no_payment_due(student984,pos). no_payment_due(student983,pos). no_payment_due(student981,pos). no_payment_due(student977,pos). no_payment_due(student976,pos). no_payment_due(student975,pos). no_payment_due(student972,pos). no_payment_due(student970,pos). no_payment_due(student969,pos). no_payment_due(student968,pos). no_payment_due(student967,pos). no_payment_due(student963,pos). no_payment_due(student962,pos). no_payment_due(student959,pos). no_payment_due(student958,pos). no_payment_due(student956,pos). no_payment_due(student955,pos). no_payment_due(student953,pos). no_payment_due(student952,pos). no_payment_due(student950,pos). no_payment_due(student949,pos). no_payment_due(student948,pos). no_payment_due(student947,pos). no_payment_due(student946,pos). no_payment_due(student945,pos). no_payment_due(student943,pos). no_payment_due(student942,pos). no_payment_due(student940,pos). no_payment_due(student937,pos). no_payment_due(student936,pos). no_payment_due(student935,pos). no_payment_due(student932,pos). no_payment_due(student928,pos). no_payment_due(student927,pos). no_payment_due(student926,pos). no_payment_due(student924,pos). no_payment_due(student923,pos). no_payment_due(student920,pos). no_payment_due(student918,pos). no_payment_due(student916,pos). no_payment_due(student915,pos). no_payment_due(student913,pos). no_payment_due(student910,pos). no_payment_due(student909,pos). no_payment_due(student908,pos). no_payment_due(student906,pos). no_payment_due(student905,pos). no_payment_due(student904,pos). no_payment_due(student902,pos). no_payment_due(student901,pos). no_payment_due(student897,pos). no_payment_due(student896,pos). no_payment_due(student895,pos). no_payment_due(student894,pos). no_payment_due(student893,pos). no_payment_due(student891,pos). no_payment_due(student890,pos). no_payment_due(student888,pos). no_payment_due(student887,pos). no_payment_due(student885,pos). no_payment_due(student881,pos). no_payment_due(student879,pos). no_payment_due(student877,pos). no_payment_due(student874,pos). no_payment_due(student871,pos). no_payment_due(student870,pos). no_payment_due(student868,pos). no_payment_due(student867,pos). no_payment_due(student866,pos). no_payment_due(student864,pos). no_payment_due(student863,pos). no_payment_due(student859,pos). no_payment_due(student858,pos). no_payment_due(student856,pos). no_payment_due(student855,pos). no_payment_due(student854,pos). no_payment_due(student852,pos). no_payment_due(student850,pos). no_payment_due(student849,pos). no_payment_due(student847,pos). no_payment_due(student846,pos). no_payment_due(student842,pos). no_payment_due(student841,pos). no_payment_due(student840,pos). no_payment_due(student838,pos). no_payment_due(student836,pos). no_payment_due(student835,pos). no_payment_due(student832,pos). no_payment_due(student831,pos). no_payment_due(student830,pos). no_payment_due(student828,pos). no_payment_due(student827,pos). no_payment_due(student825,pos). no_payment_due(student823,pos). no_payment_due(student821,pos). no_payment_due(student820,pos). no_payment_due(student817,pos). no_payment_due(student814,pos). no_payment_due(student812,pos). no_payment_due(student809,pos). no_payment_due(student808,pos). no_payment_due(student807,pos). no_payment_due(student806,pos). no_payment_due(student805,pos). no_payment_due(student804,pos). no_payment_due(student803,pos). no_payment_due(student800,pos). no_payment_due(student798,pos). no_payment_due(student797,pos). no_payment_due(student795,pos). no_payment_due(student794,pos). no_payment_due(student792,pos). no_payment_due(student790,pos). no_payment_due(student789,pos). no_payment_due(student788,pos). no_payment_due(student787,pos). no_payment_due(student785,pos). no_payment_due(student783,pos). no_payment_due(student781,pos). no_payment_due(student780,pos). no_payment_due(student779,pos). no_payment_due(student778,pos). no_payment_due(student776,pos). no_payment_due(student775,pos). no_payment_due(student774,pos). no_payment_due(student773,pos). no_payment_due(student770,pos). no_payment_due(student769,pos). no_payment_due(student768,pos). no_payment_due(student765,pos). no_payment_due(student764,pos). no_payment_due(student762,pos). no_payment_due(student761,pos). no_payment_due(student760,pos). no_payment_due(student758,pos). no_payment_due(student757,pos). no_payment_due(student754,pos). no_payment_due(student753,pos). no_payment_due(student751,pos). no_payment_due(student750,pos). no_payment_due(student749,pos). no_payment_due(student748,pos). no_payment_due(student747,pos). no_payment_due(student746,pos). no_payment_due(student745,pos). no_payment_due(student744,pos). no_payment_due(student743,pos). no_payment_due(student742,pos). no_payment_due(student741,pos). no_payment_due(student740,pos). no_payment_due(student739,pos). no_payment_due(student738,pos). no_payment_due(student735,pos). no_payment_due(student734,pos). no_payment_due(student733,pos). no_payment_due(student732,pos). no_payment_due(student729,pos). no_payment_due(student727,pos). no_payment_due(student724,pos). no_payment_due(student723,pos). no_payment_due(student721,pos). no_payment_due(student719,pos). no_payment_due(student717,pos). no_payment_due(student714,pos). no_payment_due(student712,pos). no_payment_due(student710,pos). no_payment_due(student709,pos). no_payment_due(student705,pos). no_payment_due(student702,pos). no_payment_due(student701,pos). no_payment_due(student700,pos). no_payment_due(student699,pos). no_payment_due(student698,pos). no_payment_due(student697,pos). no_payment_due(student696,pos). no_payment_due(student690,pos). no_payment_due(student689,pos). no_payment_due(student688,pos). no_payment_due(student686,pos). no_payment_due(student684,pos). no_payment_due(student682,pos). no_payment_due(student680,pos). no_payment_due(student679,pos). no_payment_due(student678,pos). no_payment_due(student677,pos). no_payment_due(student676,pos). no_payment_due(student674,pos). no_payment_due(student673,pos). no_payment_due(student672,pos). no_payment_due(student670,pos). no_payment_due(student668,pos). no_payment_due(student667,pos). no_payment_due(student666,pos). no_payment_due(student665,pos). no_payment_due(student664,pos). no_payment_due(student663,pos). no_payment_due(student662,pos). no_payment_due(student661,pos). no_payment_due(student660,pos). no_payment_due(student659,pos). no_payment_due(student658,pos). no_payment_due(student656,pos). no_payment_due(student655,pos). no_payment_due(student652,pos). no_payment_due(student651,pos). no_payment_due(student650,pos). no_payment_due(student649,pos). no_payment_due(student647,pos). no_payment_due(student646,pos). no_payment_due(student645,pos). no_payment_due(student642,pos). no_payment_due(student641,pos). no_payment_due(student638,pos). no_payment_due(student635,pos). no_payment_due(student634,pos). no_payment_due(student632,pos). no_payment_due(student631,pos). no_payment_due(student629,pos). no_payment_due(student628,pos). no_payment_due(student627,pos). no_payment_due(student626,pos). no_payment_due(student625,pos). no_payment_due(student624,pos). no_payment_due(student621,pos). no_payment_due(student620,pos). no_payment_due(student619,pos). no_payment_due(student617,pos). no_payment_due(student616,pos). no_payment_due(student615,pos). no_payment_due(student614,pos). no_payment_due(student613,pos). no_payment_due(student612,pos). no_payment_due(student611,pos). no_payment_due(student610,pos). no_payment_due(student609,pos). no_payment_due(student608,pos). no_payment_due(student607,pos). no_payment_due(student606,pos). no_payment_due(student605,pos). no_payment_due(student603,pos). no_payment_due(student602,pos). no_payment_due(student601,pos). no_payment_due(student600,pos). no_payment_due(student599,pos). no_payment_due(student598,pos). no_payment_due(student596,pos). no_payment_due(student595,pos). no_payment_due(student594,pos). no_payment_due(student593,pos). no_payment_due(student592,pos). no_payment_due(student591,pos). no_payment_due(student590,pos). no_payment_due(student589,pos). no_payment_due(student588,pos). no_payment_due(student587,pos). no_payment_due(student585,pos). no_payment_due(student584,pos). no_payment_due(student583,pos). no_payment_due(student581,pos). no_payment_due(student580,pos). no_payment_due(student579,pos). no_payment_due(student578,pos). no_payment_due(student576,pos). no_payment_due(student575,pos). no_payment_due(student573,pos). no_payment_due(student572,pos). no_payment_due(student570,pos). no_payment_due(student569,pos). no_payment_due(student568,pos). no_payment_due(student567,pos). no_payment_due(student565,pos). no_payment_due(student562,pos). no_payment_due(student560,pos). no_payment_due(student559,pos). no_payment_due(student556,pos). no_payment_due(student555,pos). no_payment_due(student554,pos). no_payment_due(student553,pos). no_payment_due(student550,pos). no_payment_due(student547,pos). no_payment_due(student546,pos). no_payment_due(student544,pos). no_payment_due(student541,pos). no_payment_due(student539,pos). no_payment_due(student538,pos). no_payment_due(student536,pos). no_payment_due(student534,pos). no_payment_due(student533,pos). no_payment_due(student531,pos). no_payment_due(student530,pos). no_payment_due(student529,pos). no_payment_due(student527,pos). no_payment_due(student526,pos). no_payment_due(student523,pos). no_payment_due(student522,pos). no_payment_due(student519,pos). no_payment_due(student517,pos). no_payment_due(student515,pos). no_payment_due(student512,pos). no_payment_due(student511,pos). no_payment_due(student508,pos). no_payment_due(student505,pos). no_payment_due(student504,pos). no_payment_due(student503,pos). no_payment_due(student502,pos). no_payment_due(student500,pos). no_payment_due(student498,pos). no_payment_due(student497,pos). no_payment_due(student496,pos). no_payment_due(student495,pos). no_payment_due(student494,pos). no_payment_due(student493,pos). no_payment_due(student492,pos). no_payment_due(student491,pos). no_payment_due(student490,pos). no_payment_due(student488,pos). no_payment_due(student486,pos). no_payment_due(student485,pos). no_payment_due(student481,pos). no_payment_due(student480,pos). no_payment_due(student479,pos). no_payment_due(student477,pos). no_payment_due(student476,pos). no_payment_due(student475,pos). no_payment_due(student474,pos). no_payment_due(student473,pos). no_payment_due(student472,pos). no_payment_due(student470,pos). no_payment_due(student468,pos). no_payment_due(student467,pos). no_payment_due(student465,pos). no_payment_due(student459,pos). no_payment_due(student458,pos). no_payment_due(student452,pos). no_payment_due(student450,pos). no_payment_due(student448,pos). no_payment_due(student447,pos). no_payment_due(student446,pos). no_payment_due(student444,pos). no_payment_due(student443,pos). no_payment_due(student442,pos). no_payment_due(student441,pos). no_payment_due(student440,pos). no_payment_due(student439,pos). no_payment_due(student438,pos). no_payment_due(student436,pos). no_payment_due(student433,pos). no_payment_due(student432,pos). no_payment_due(student431,pos). no_payment_due(student430,pos). no_payment_due(student429,pos). no_payment_due(student428,pos). no_payment_due(student425,pos). no_payment_due(student423,pos). no_payment_due(student422,pos). no_payment_due(student421,pos). no_payment_due(student420,pos). no_payment_due(student417,pos). no_payment_due(student416,pos). no_payment_due(student415,pos). no_payment_due(student414,pos). no_payment_due(student412,pos). no_payment_due(student411,pos). no_payment_due(student410,pos). no_payment_due(student409,pos). no_payment_due(student407,pos). no_payment_due(student406,pos). no_payment_due(student405,pos). no_payment_due(student404,pos). no_payment_due(student403,pos). no_payment_due(student401,pos). no_payment_due(student400,pos). no_payment_due(student399,pos). no_payment_due(student397,pos). no_payment_due(student396,pos). no_payment_due(student395,pos). no_payment_due(student391,pos). no_payment_due(student389,pos). no_payment_due(student388,pos). no_payment_due(student386,pos). no_payment_due(student385,pos). no_payment_due(student384,pos). no_payment_due(student382,pos). no_payment_due(student380,pos). no_payment_due(student378,pos). no_payment_due(student377,pos). no_payment_due(student376,pos). no_payment_due(student373,pos). no_payment_due(student372,pos). no_payment_due(student371,pos). no_payment_due(student370,pos). no_payment_due(student369,pos). no_payment_due(student368,pos). no_payment_due(student367,pos). no_payment_due(student364,pos). no_payment_due(student361,pos). no_payment_due(student359,pos). no_payment_due(student354,pos). no_payment_due(student352,pos). no_payment_due(student351,pos). no_payment_due(student350,pos). no_payment_due(student349,pos). no_payment_due(student347,pos). no_payment_due(student346,pos). no_payment_due(student342,pos). no_payment_due(student340,pos). no_payment_due(student339,pos). no_payment_due(student338,pos). no_payment_due(student337,pos). no_payment_due(student336,pos). no_payment_due(student334,pos). no_payment_due(student333,pos). no_payment_due(student331,pos). no_payment_due(student330,pos). no_payment_due(student329,pos). no_payment_due(student328,pos). no_payment_due(student324,pos). no_payment_due(student323,pos). no_payment_due(student322,pos). no_payment_due(student318,pos). no_payment_due(student317,pos). no_payment_due(student316,pos). no_payment_due(student315,pos). no_payment_due(student314,pos). no_payment_due(student313,pos). no_payment_due(student309,pos). no_payment_due(student308,pos). no_payment_due(student306,pos). no_payment_due(student305,pos). no_payment_due(student304,pos). no_payment_due(student302,pos). no_payment_due(student301,pos). no_payment_due(student300,pos). no_payment_due(student297,pos). no_payment_due(student296,pos). no_payment_due(student295,pos). no_payment_due(student294,pos). no_payment_due(student293,pos). no_payment_due(student291,pos). no_payment_due(student288,pos). no_payment_due(student286,pos). no_payment_due(student285,pos). no_payment_due(student284,pos). no_payment_due(student283,pos). no_payment_due(student282,pos). no_payment_due(student281,pos). no_payment_due(student280,pos). no_payment_due(student279,pos). no_payment_due(student275,pos). no_payment_due(student274,pos). no_payment_due(student273,pos). no_payment_due(student272,pos). no_payment_due(student271,pos). no_payment_due(student270,pos). no_payment_due(student269,pos). no_payment_due(student267,pos). no_payment_due(student263,pos). no_payment_due(student262,pos). no_payment_due(student261,pos). no_payment_due(student260,pos). no_payment_due(student257,pos). no_payment_due(student255,pos). no_payment_due(student253,pos). no_payment_due(student250,pos). no_payment_due(student248,pos). no_payment_due(student247,pos). no_payment_due(student246,pos). no_payment_due(student244,pos). no_payment_due(student242,pos). no_payment_due(student241,pos). no_payment_due(student238,pos). no_payment_due(student237,pos). no_payment_due(student235,pos). no_payment_due(student234,pos). no_payment_due(student233,pos). no_payment_due(student232,pos). no_payment_due(student231,pos). no_payment_due(student229,pos). no_payment_due(student228,pos). no_payment_due(student227,pos). no_payment_due(student226,pos). no_payment_due(student225,pos). no_payment_due(student224,pos). no_payment_due(student222,pos). no_payment_due(student220,pos). no_payment_due(student219,pos). no_payment_due(student217,pos). no_payment_due(student216,pos). no_payment_due(student214,pos). no_payment_due(student213,pos). no_payment_due(student211,pos). no_payment_due(student210,pos). no_payment_due(student209,pos). no_payment_due(student208,pos). no_payment_due(student207,pos). no_payment_due(student204,pos). no_payment_due(student203,pos). no_payment_due(student199,pos). no_payment_due(student198,pos). no_payment_due(student197,pos). no_payment_due(student196,pos). no_payment_due(student195,pos). no_payment_due(student194,pos). no_payment_due(student193,pos). no_payment_due(student191,pos). no_payment_due(student189,pos). no_payment_due(student184,pos). no_payment_due(student183,pos). no_payment_due(student181,pos). no_payment_due(student179,pos). no_payment_due(student178,pos). no_payment_due(student175,pos). no_payment_due(student174,pos). no_payment_due(student173,pos). no_payment_due(student172,pos). no_payment_due(student171,pos). no_payment_due(student170,pos). no_payment_due(student169,pos). no_payment_due(student168,pos). no_payment_due(student167,pos). no_payment_due(student165,pos). no_payment_due(student164,pos). no_payment_due(student163,pos). no_payment_due(student162,pos). no_payment_due(student159,pos). no_payment_due(student158,pos). no_payment_due(student157,pos). no_payment_due(student156,pos). no_payment_due(student155,pos). no_payment_due(student154,pos). no_payment_due(student153,pos). no_payment_due(student152,pos). no_payment_due(student151,pos). no_payment_due(student150,pos). no_payment_due(student148,pos). no_payment_due(student147,pos). no_payment_due(student145,pos). no_payment_due(student143,pos). no_payment_due(student142,pos). no_payment_due(student140,pos). no_payment_due(student139,pos). no_payment_due(student138,pos). no_payment_due(student136,pos). no_payment_due(student135,pos). no_payment_due(student134,pos). no_payment_due(student133,pos). no_payment_due(student130,pos). no_payment_due(student129,pos). no_payment_due(student128,pos). no_payment_due(student127,pos). no_payment_due(student126,pos). no_payment_due(student125,pos). no_payment_due(student122,pos). no_payment_due(student121,pos). no_payment_due(student120,pos). no_payment_due(student119,pos). no_payment_due(student118,pos). no_payment_due(student117,pos). no_payment_due(student114,pos). no_payment_due(student112,pos). no_payment_due(student109,pos). no_payment_due(student108,pos). no_payment_due(student106,pos). no_payment_due(student105,pos). no_payment_due(student104,pos). no_payment_due(student102,pos). no_payment_due(student100,pos). no_payment_due(student99,pos). no_payment_due(student97,pos). no_payment_due(student96,pos). no_payment_due(student95,pos). no_payment_due(student94,pos). no_payment_due(student93,pos). no_payment_due(student92,pos). no_payment_due(student91,pos). no_payment_due(student90,pos). no_payment_due(student84,pos). no_payment_due(student83,pos). no_payment_due(student82,pos). no_payment_due(student81,pos). no_payment_due(student80,pos). no_payment_due(student79,pos). no_payment_due(student77,pos). no_payment_due(student75,pos). no_payment_due(student73,pos). no_payment_due(student72,pos). no_payment_due(student70,pos). no_payment_due(student69,pos). no_payment_due(student68,pos). no_payment_due(student66,pos). no_payment_due(student65,pos). no_payment_due(student64,pos). no_payment_due(student63,pos). no_payment_due(student62,pos). no_payment_due(student59,pos). no_payment_due(student57,pos). no_payment_due(student52,pos). no_payment_due(student51,pos). no_payment_due(student50,pos). no_payment_due(student49,pos). no_payment_due(student48,pos). no_payment_due(student46,pos). no_payment_due(student45,pos). no_payment_due(student43,pos). no_payment_due(student42,pos). no_payment_due(student41,pos). no_payment_due(student40,pos). no_payment_due(student39,pos). no_payment_due(student37,pos). no_payment_due(student33,pos). no_payment_due(student32,pos). no_payment_due(student31,pos). no_payment_due(student30,pos). no_payment_due(student28,pos). no_payment_due(student26,pos). no_payment_due(student24,pos). no_payment_due(student23,pos). no_payment_due(student22,pos). no_payment_due(student21,pos). no_payment_due(student19,pos). no_payment_due(student17,pos). no_payment_due(student15,pos). no_payment_due(student13,pos). no_payment_due(student12,pos). no_payment_due(student11,pos). no_payment_due(student9,pos). no_payment_due(student8,pos). no_payment_due(student7,pos). no_payment_due(student6,pos). no_payment_due(student4,pos). no_payment_due(student2,pos). no_payment_due(student1,pos). no_payment_due(student997,neg). no_payment_due(student995,neg). no_payment_due(student991,neg). no_payment_due(student988,neg). no_payment_due(student986,neg). no_payment_due(student982,neg). no_payment_due(student980,neg). no_payment_due(student979,neg). no_payment_due(student978,neg). no_payment_due(student974,neg). no_payment_due(student973,neg). no_payment_due(student971,neg). no_payment_due(student966,neg). no_payment_due(student965,neg). no_payment_due(student964,neg). no_payment_due(student961,neg). no_payment_due(student960,neg). no_payment_due(student957,neg). no_payment_due(student954,neg). no_payment_due(student951,neg). no_payment_due(student944,neg). no_payment_due(student941,neg). no_payment_due(student939,neg). no_payment_due(student938,neg). no_payment_due(student934,neg). no_payment_due(student933,neg). no_payment_due(student931,neg). no_payment_due(student930,neg). no_payment_due(student929,neg). no_payment_due(student925,neg). no_payment_due(student922,neg). no_payment_due(student921,neg). no_payment_due(student919,neg). no_payment_due(student917,neg). no_payment_due(student914,neg). no_payment_due(student912,neg). no_payment_due(student911,neg). no_payment_due(student907,neg). no_payment_due(student903,neg). no_payment_due(student900,neg). no_payment_due(student899,neg). no_payment_due(student898,neg). no_payment_due(student892,neg). no_payment_due(student889,neg). no_payment_due(student886,neg). no_payment_due(student884,neg). no_payment_due(student883,neg). no_payment_due(student882,neg). no_payment_due(student880,neg). no_payment_due(student878,neg). no_payment_due(student876,neg). no_payment_due(student875,neg). no_payment_due(student873,neg). no_payment_due(student872,neg). no_payment_due(student869,neg). no_payment_due(student865,neg). no_payment_due(student862,neg). no_payment_due(student861,neg). no_payment_due(student860,neg). no_payment_due(student857,neg). no_payment_due(student853,neg). no_payment_due(student851,neg). no_payment_due(student848,neg). no_payment_due(student845,neg). no_payment_due(student844,neg). no_payment_due(student843,neg). no_payment_due(student839,neg). no_payment_due(student837,neg). no_payment_due(student834,neg). no_payment_due(student833,neg). no_payment_due(student829,neg). no_payment_due(student826,neg). no_payment_due(student824,neg). no_payment_due(student822,neg). no_payment_due(student819,neg). no_payment_due(student818,neg). no_payment_due(student816,neg). no_payment_due(student815,neg). no_payment_due(student813,neg). no_payment_due(student811,neg). no_payment_due(student810,neg). no_payment_due(student802,neg). no_payment_due(student801,neg). no_payment_due(student799,neg). no_payment_due(student796,neg). no_payment_due(student793,neg). no_payment_due(student791,neg). no_payment_due(student786,neg). no_payment_due(student784,neg). no_payment_due(student782,neg). no_payment_due(student777,neg). no_payment_due(student772,neg). no_payment_due(student771,neg). no_payment_due(student767,neg). no_payment_due(student766,neg). no_payment_due(student763,neg). no_payment_due(student759,neg). no_payment_due(student756,neg). no_payment_due(student755,neg). no_payment_due(student752,neg). no_payment_due(student737,neg). no_payment_due(student736,neg). no_payment_due(student731,neg). no_payment_due(student730,neg). no_payment_due(student728,neg). no_payment_due(student726,neg). no_payment_due(student725,neg). no_payment_due(student722,neg). no_payment_due(student720,neg). no_payment_due(student718,neg). no_payment_due(student716,neg). no_payment_due(student715,neg). no_payment_due(student713,neg). no_payment_due(student711,neg). no_payment_due(student708,neg). no_payment_due(student707,neg). no_payment_due(student706,neg). no_payment_due(student704,neg). no_payment_due(student703,neg). no_payment_due(student695,neg). no_payment_due(student694,neg). no_payment_due(student693,neg). no_payment_due(student692,neg). no_payment_due(student691,neg). no_payment_due(student687,neg). no_payment_due(student685,neg). no_payment_due(student683,neg). no_payment_due(student681,neg). no_payment_due(student675,neg). no_payment_due(student671,neg). no_payment_due(student669,neg). no_payment_due(student657,neg). no_payment_due(student654,neg). no_payment_due(student653,neg). no_payment_due(student648,neg). no_payment_due(student644,neg). no_payment_due(student643,neg). no_payment_due(student640,neg). no_payment_due(student639,neg). no_payment_due(student637,neg). no_payment_due(student636,neg). no_payment_due(student633,neg). no_payment_due(student630,neg). no_payment_due(student623,neg). no_payment_due(student622,neg). no_payment_due(student618,neg). no_payment_due(student604,neg). no_payment_due(student597,neg). no_payment_due(student586,neg). no_payment_due(student582,neg). no_payment_due(student577,neg). no_payment_due(student574,neg). no_payment_due(student571,neg). no_payment_due(student566,neg). no_payment_due(student564,neg). no_payment_due(student563,neg). no_payment_due(student561,neg). no_payment_due(student558,neg). no_payment_due(student557,neg). no_payment_due(student552,neg). no_payment_due(student551,neg). no_payment_due(student549,neg). no_payment_due(student548,neg). no_payment_due(student545,neg). no_payment_due(student543,neg). no_payment_due(student542,neg). no_payment_due(student540,neg). no_payment_due(student537,neg). no_payment_due(student535,neg). no_payment_due(student532,neg). no_payment_due(student528,neg). no_payment_due(student525,neg). no_payment_due(student524,neg). no_payment_due(student521,neg). no_payment_due(student520,neg). no_payment_due(student518,neg). no_payment_due(student516,neg). no_payment_due(student514,neg). no_payment_due(student513,neg). no_payment_due(student510,neg). no_payment_due(student509,neg). no_payment_due(student507,neg). no_payment_due(student506,neg). no_payment_due(student501,neg). no_payment_due(student499,neg). no_payment_due(student489,neg). no_payment_due(student487,neg). no_payment_due(student484,neg). no_payment_due(student483,neg). no_payment_due(student482,neg). no_payment_due(student478,neg). no_payment_due(student471,neg). no_payment_due(student469,neg). no_payment_due(student466,neg). no_payment_due(student464,neg). no_payment_due(student463,neg). no_payment_due(student462,neg). no_payment_due(student461,neg). no_payment_due(student460,neg). no_payment_due(student457,neg). no_payment_due(student456,neg). no_payment_due(student455,neg). no_payment_due(student454,neg). no_payment_due(student453,neg). no_payment_due(student451,neg). no_payment_due(student449,neg). no_payment_due(student445,neg). no_payment_due(student437,neg). no_payment_due(student435,neg). no_payment_due(student434,neg). no_payment_due(student427,neg). no_payment_due(student426,neg). no_payment_due(student424,neg). no_payment_due(student419,neg). no_payment_due(student418,neg). no_payment_due(student413,neg). no_payment_due(student408,neg). no_payment_due(student402,neg). no_payment_due(student398,neg). no_payment_due(student394,neg). no_payment_due(student393,neg). no_payment_due(student392,neg). no_payment_due(student390,neg). no_payment_due(student387,neg). no_payment_due(student383,neg). no_payment_due(student381,neg). no_payment_due(student379,neg). no_payment_due(student375,neg). no_payment_due(student374,neg). no_payment_due(student366,neg). no_payment_due(student365,neg). no_payment_due(student363,neg). no_payment_due(student362,neg). no_payment_due(student360,neg). no_payment_due(student358,neg). no_payment_due(student357,neg). no_payment_due(student356,neg). no_payment_due(student355,neg). no_payment_due(student353,neg). no_payment_due(student348,neg). no_payment_due(student345,neg). no_payment_due(student344,neg). no_payment_due(student343,neg). no_payment_due(student341,neg). no_payment_due(student335,neg). no_payment_due(student332,neg). no_payment_due(student327,neg). no_payment_due(student326,neg). no_payment_due(student325,neg). no_payment_due(student321,neg). no_payment_due(student320,neg). no_payment_due(student319,neg). no_payment_due(student312,neg). no_payment_due(student311,neg). no_payment_due(student310,neg). no_payment_due(student307,neg). no_payment_due(student303,neg). no_payment_due(student299,neg). no_payment_due(student298,neg). no_payment_due(student292,neg). no_payment_due(student290,neg). no_payment_due(student289,neg). no_payment_due(student287,neg). no_payment_due(student278,neg). no_payment_due(student277,neg). no_payment_due(student276,neg). no_payment_due(student268,neg). no_payment_due(student266,neg). no_payment_due(student265,neg). no_payment_due(student264,neg). no_payment_due(student259,neg). no_payment_due(student258,neg). no_payment_due(student256,neg). no_payment_due(student254,neg). no_payment_due(student252,neg). no_payment_due(student251,neg). no_payment_due(student249,neg). no_payment_due(student245,neg). no_payment_due(student243,neg). no_payment_due(student240,neg). no_payment_due(student239,neg). no_payment_due(student236,neg). no_payment_due(student230,neg). no_payment_due(student223,neg). no_payment_due(student221,neg). no_payment_due(student218,neg). no_payment_due(student215,neg). no_payment_due(student212,neg). no_payment_due(student206,neg). no_payment_due(student205,neg). no_payment_due(student202,neg). no_payment_due(student201,neg). no_payment_due(student200,neg). no_payment_due(student192,neg). no_payment_due(student190,neg). no_payment_due(student188,neg). no_payment_due(student187,neg). no_payment_due(student186,neg). no_payment_due(student185,neg). no_payment_due(student182,neg). no_payment_due(student180,neg). no_payment_due(student177,neg). no_payment_due(student176,neg). no_payment_due(student166,neg). no_payment_due(student161,neg). no_payment_due(student160,neg). no_payment_due(student149,neg). no_payment_due(student146,neg). no_payment_due(student144,neg). no_payment_due(student141,neg). no_payment_due(student137,neg). no_payment_due(student132,neg). no_payment_due(student131,neg). no_payment_due(student124,neg). no_payment_due(student123,neg). no_payment_due(student116,neg). no_payment_due(student115,neg). no_payment_due(student113,neg). no_payment_due(student111,neg). no_payment_due(student110,neg). no_payment_due(student107,neg). no_payment_due(student103,neg). no_payment_due(student101,neg). no_payment_due(student98,neg). no_payment_due(student89,neg). no_payment_due(student88,neg). no_payment_due(student87,neg). no_payment_due(student86,neg). no_payment_due(student85,neg). no_payment_due(student78,neg). no_payment_due(student76,neg). no_payment_due(student74,neg). no_payment_due(student71,neg). no_payment_due(student67,neg). no_payment_due(student61,neg). no_payment_due(student60,neg). no_payment_due(student58,neg). no_payment_due(student56,neg). no_payment_due(student55,neg). no_payment_due(student54,neg). no_payment_due(student53,neg). no_payment_due(student47,neg). no_payment_due(student44,neg). no_payment_due(student38,neg). no_payment_due(student36,neg). no_payment_due(student35,neg). no_payment_due(student34,neg). no_payment_due(student29,neg). no_payment_due(student27,neg). no_payment_due(student25,neg). no_payment_due(student20,neg). no_payment_due(student18,neg). no_payment_due(student16,neg). no_payment_due(student14,neg). no_payment_due(student10,neg). no_payment_due(student5,neg). no_payment_due(student3,neg).
diyerland/saveAll
algorithm/java-ml/UCI-small/student-loan/no_payment_due.pl
Perl
mit
31,893
package App::WebToy::Server::View; use base 'Prophet::Server::View'; use Template::Declare::Tags; use Prophet::Server::ViewHelpers; use App::WebToy::Collection::WikiPage; template 'abc' => page { my $self = shift; my $c = App::WebToy::Collection::WikiPage->new( app_handle => $self->app_handle ); $c->matching( sub { return 1 } ); my $r = $c->items->[0]; h1 { $r->prop('title') }; form { my $f = function( record => $r, action => 'update' ); my $w = widget( function => $f, prop => 'title' ); widget( function => $f, prop => 'content' ); input { attr { label => 'save', type => 'submit' } }; }; form { my $f = function( record => App::WebToy::Model::WikiPage->new( app_handle => $self->app_handle ), action => 'create' ); widget( function => $f, prop => 'title' ); widget( function => $f, prop => 'content' ); input { attr { label => 'save', type => 'submit' } }; } }; 1;
gitpan/Prophet
t/WebToy/lib/App/WebToy/Server/View.pm
Perl
mit
1,053
package HMF::Pipeline::Functions::Bam; use FindBin::libs; use discipline; use File::Basename; use File::Spec::Functions; use HMF::Pipeline::Functions::Config qw(createDirs); use HMF::Pipeline::Functions::Job qw(fromTemplate checkReportedDoneFile markDone); use HMF::Pipeline::Functions::Sge qw(qsubTemplate jobNative qsubJava); use parent qw(Exporter); our @EXPORT_OK = qw( sorted slice indexed flagstat readCountCheck diff prePostSliceAndDiff operationWithSliceChecks bamOperationWithSliceChecks ); # SABR: "sort" would clash with Perl function sub sorted { my ($step, $bam_path, $sorted_bam_path, $hold_jids, $dirs, $opt) = @_; my $sorted_bam_name = fileparse($sorted_bam_path); return fromTemplate( "BamSort", $sorted_bam_name, 0, qsubTemplate($opt, "MAPPING"), $hold_jids, $dirs, $opt, step => $step, bam_path => $bam_path, sorted_bam_path => $sorted_bam_path, sorted_bam_name => $sorted_bam_name, ); } sub slice { my ($step, $sample_bam, $sliced_bam, $bed_name, $hold_jids, $dirs, $opt) = @_; my $slice_name = fileparse($sliced_bam); return fromTemplate( "BamSlice", $slice_name, 0, qsubTemplate($opt, "FLAGSTAT"), $hold_jids, $dirs, $opt, step => $step, input_bam => catfile($dirs->{mapping}, $sample_bam), bed_file => catfile($opt->{OUTPUT_DIR}, "settings", "slicing", $bed_name), sliced_bam => catfile($dirs->{mapping}, $sliced_bam), slice_name => $slice_name, ); } # SABR: "index" would clash with Perl function sub indexed { my ($step, $bam_path, $bai_path, $hold_jids, $dirs, $opt) = @_; my $bai_name = fileparse($bai_path); return fromTemplate( "BamIndex", $bai_name, 0, qsubTemplate($opt, "MAPPING"), $hold_jids, $dirs, $opt, step => $step, bam_path => $bam_path, bai_path => $bai_path, ); } sub flagstat { my ($step, $bam_path, $flagstat_path, $hold_jids, $dirs, $opt) = @_; my $flagstat_name = fileparse($flagstat_path); return fromTemplate( "BamFlagstat", $flagstat_name, 0, qsubTemplate($opt, "FLAGSTAT"), $hold_jids, $dirs, $opt, step => $step, bam_path => $bam_path, flagstat_path => $flagstat_path, flagstat_name => $flagstat_name, ); } sub readCountCheck { my ($step, $pre_flagstat_paths, $post_flagstat_path, $success_template, $extra_params, $hold_jids, $dirs, $opt) = @_; my $post_flagstat_name = fileparse($post_flagstat_path); return fromTemplate( "BamReadCountCheck", $post_flagstat_name, 0, qsubTemplate($opt, "FLAGSTAT"), $hold_jids, $dirs, $opt, step => $step, pre_flagstat_paths => $pre_flagstat_paths, post_flagstat_path => $post_flagstat_path, post_flagstat_name => $post_flagstat_name, success_template => $success_template, %{$extra_params}, ); } sub diff { my ($step, $input_bam1, $input_bam2, $diff_name, $hold_jids, $dirs, $opt) = @_; return fromTemplate( "BamDiff", $diff_name, 0, qsubTemplate($opt, "FLAGSTAT"), $hold_jids, $dirs, $opt, step => $step, diff_name => $diff_name, input_bam1 => catfile($dirs->{mapping}, $input_bam1), input_bam2 => catfile($dirs->{mapping}, $input_bam2), output_diff => catfile($dirs->{mapping}, $diff_name), ); } sub prePostSliceAndDiff { my ($sample, $operation, $pre_bam, $post_bam, $hold_jids, $dirs, $opt) = @_; (my $pre_sliced_bam = $pre_bam) =~ s/\.bam$/.qc.pre${operation}.sliced.bam/; (my $post_sliced_bam = $pre_bam) =~ s/\.bam$/.qc.post${operation}.sliced.bam/; (my $post_sliced_flagstat = $pre_bam) =~ s/\.bam$/.qc.post${operation}.sliced.flagstat/; (my $pre_post_diff = $pre_bam) =~ s/\.bam$/.qc.prepost${operation}.diff/; my $post_sliced_bam_path = catfile($dirs->{mapping}, $post_sliced_bam); my $post_sliced_flagstat_path = catfile($dirs->{mapping}, $post_sliced_flagstat); my $pre_job_id = slice($sample, $pre_bam, $pre_sliced_bam, "QC_Slicing.bed", $hold_jids, $dirs, $opt); my $post_job_id = slice($sample, $post_bam, $post_sliced_bam, "QC_Slicing.bed", $hold_jids, $dirs, $opt); my $diff_job_id = diff($sample, $pre_sliced_bam, $post_sliced_bam, $pre_post_diff, [ $pre_job_id, $post_job_id ], $dirs, $opt); my $flagstat_job_id = flagstat($sample, $post_sliced_bam_path, $post_sliced_flagstat_path, [$post_job_id], $dirs, $opt); return [ $diff_job_id, $flagstat_job_id ]; } sub operationWithSliceChecks { my ($job_template, $sample, $known_files, $post_tag, $slice_tag, $opt) = @_; my $sample_bam = $opt->{BAM_FILES}->{$sample}; (my $post_bam = $sample_bam) =~ s/\.bam$/.${post_tag}.bam/; $opt->{BAM_FILES}->{$sample} = $post_bam; my (undef, $job_ids) = bamOperationWithSliceChecks($job_template, $sample, $sample_bam, $known_files, $post_tag, $slice_tag, $opt); push @{$opt->{RUNNING_JOBS}->{$sample}}, @{$job_ids}; return; } sub bamOperationWithSliceChecks { my ($job_template, $sample, $sample_bam, $known_files, $post_tag, $slice_tag, $opt) = @_; (my $sample_flagstat = $sample_bam) =~ s/\.bam$/.flagstat/; (my $post_bai = $sample_bam) =~ s/\.bam$/.${post_tag}.bai/; (my $post_flagstat = $sample_bam) =~ s/\.bam$/.${post_tag}.flagstat/; (my $post_bam = $sample_bam) =~ s/\.bam$/.${post_tag}.bam/; my $dirs = createDirs(catfile($opt->{OUTPUT_DIR}, $sample), mapping => "mapping"); my $sample_bam_path = catfile($dirs->{mapping}, $sample_bam); (my $post_bam_path = $sample_bam_path) =~ s/\.bam$/.${post_tag}.bam/; say "\t${sample_bam_path}"; my $done_file = checkReportedDoneFile($job_template, $sample, $dirs, $opt) or return ($post_bam_path, []); my $operation_job_id = fromTemplate( $job_template, $sample, 0, qsubJava($opt, uc $job_template . "_MASTER"), $opt->{RUNNING_JOBS}->{$sample}, $dirs, $opt, sample => $sample, sample_bam => $sample_bam, sample_bam_path => $sample_bam_path, job_native => jobNative($opt, uc $job_template), known_files => $known_files, ) or return ($post_bam_path, []); my $sample_flagstat_path = catfile($dirs->{mapping}, $sample_flagstat); my $post_flagstat_path = catfile($dirs->{mapping}, $post_flagstat); my $flagstat_job_id = flagstat($sample, catfile($dirs->{tmp}, $post_bam), $post_flagstat_path, [$operation_job_id], $dirs, $opt); my $check_job_id = readCountCheck( #<<< no perltidy $sample, [ $sample_flagstat_path ], $post_flagstat_path, "${job_template}Success.tt", { post_bam => $post_bam, post_bai => $post_bai, pre_bam => $sample_bam_path}, [ $flagstat_job_id ], $dirs, $opt, #>>> no perltidy ); my $job_id = markDone($done_file, [ $operation_job_id, $flagstat_job_id, $check_job_id ], $dirs, $opt); my $slicing_job_ids = prePostSliceAndDiff($sample, $slice_tag, $sample_bam, $post_bam, [$job_id], $dirs, $opt); push @{$opt->{RUNNING_JOBS}->{$sample}}, @{$slicing_job_ids}; return ($post_bam_path, [$job_id]); } 1;
hartwigmedical/pipeline
lib/HMF/Pipeline/Functions/Bam.pm
Perl
mit
7,503
#!/usr/bin/env perl =head1 NAME AddImagingEventGeoParamCoordinatesUTMWGSCvterm =head1 SYNOPSIS mx-run AddImagingEventGeoParamCoordinatesUTMWGSCvterm [options] -H hostname -D dbname -u username [-F] this is a subclass of L<CXGN::Metadata::Dbpatch> see the perldoc of parent class for more details. =head1 DESCRIPTION This patch adds cvterm for an imaging event's geoparam coordinates for GeoTIFFs pixel to geo-coordinate position. This subclass uses L<Moose>. The parent class uses L<MooseX::Runnable> =head1 AUTHOR =head1 COPYRIGHT & LICENSE Copyright 2010 Boyce Thompson Institute for Plant Research This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut package AddImagingEventGeoParamCoordinatesUTMWGSCvterm; use Moose; use Bio::Chado::Schema; use Try::Tiny; extends 'CXGN::Metadata::Dbpatch'; has '+description' => ( default => <<'' ); This patch adds cvterm for an imaging event's geoparam coordinates for GeoTIFFs pixel to geo-coordinate position. has '+prereq' => ( default => sub { [], }, ); sub patch { my $self=shift; print STDOUT "Executing the patch:\n " . $self->name . ".\n\nDescription:\n ". $self->description . ".\n\nExecuted by:\n " . $self->username . " ."; print STDOUT "\nChecking if this db_patch was executed before or if previous db_patches have been executed.\n"; print STDOUT "\nExecuting the SQL commands.\n"; my $schema = Bio::Chado::Schema->connect( sub { $self->dbh->clone } ); print STDERR "INSERTING CV TERMS...\n"; my $terms = { 'project_property' => [ 'drone_run_geoparam_coordinates_type', ], }; foreach my $t (keys %$terms){ foreach (@{$terms->{$t}}){ $schema->resultset("Cv::Cvterm")->create_with({ name => $_, cv => $t }); } } print "You're done!\n"; } #### 1; # ####
solgenomics/sgn
db/00144/AddImagingEventGeoParamCoordinatesUTMWGSCvterm.pm
Perl
mit
1,889
%% fuzzy ALC reasoning %% using resolution as inference operator %% %% Author: Stasinos Konstantopoulos <stasinos@users.sourceforge.net> %% Created: 6-2-2007 %% Copyright (C) 2007 Stasinos Konstantopoulos <stasinos@users.sourceforge.net> %% %% This program is free software; you can redistribute it and/or modify %% it under the terms of the GNU General Public License as published by %% the Free Software Foundation; either version 2 of the License, or %% (at your option) any later version. %% %% This program is distributed in the hope that it will be useful, %% but WITHOUT ANY WARRANTY; without even the implied warranty of %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %% GNU General Public License for more details. %% %% You should have received a copy of the GNU 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. :- module( resolution, [prove/5, yadlr_concept/2, yadlr_relation/2, yadlr_instance/2, yadlr_concept_name/2, yadlr_relation_name/2, yadlr_instance_name/2, yadlr_assert/3, yadlr_init/1, retractKB/1, yadlr_retrieve_concept/2, yadlr_retrieve_instance/2, set_debug_msgs/1, set_depth_limit/1, set_proof_tree_log/1, unset_proof_tree_log/0] ). :- user:use_algebra( AlgModule ), use_module( AlgModule ). %% %% SETTINGS %% :- dynamic use_debug_msgs/1, use_proof_tree_log/1, use_depth_limit/1. use_debug_msgs( no ). set_debug_msgs( yes ) :- retractall( use_debug_msgs(_) ), assert_if_new( use_debug_msgs(yes) ). set_debug_msgs( no ) :- retractall( use_debug_msgs(_) ), assert_if_new( use_debug_msgs(no) ). msg_debug( Msg ) :- use_debug_msgs( yes ), fmt( '~q~n', Msg ), !. msg_debug( _ ) :- use_debug_msgs( no ), !. use_proof_tree_log( no ). set_proof_tree_log( no ) :- !, retractall( use_proof_tree_log(_) ), assert_if_new( use_proof_tree_log(no) ). set_proof_tree_log( yes ) :- !, retractall( use_proof_tree_log(_) ), assert_if_new( use_proof_tree_log(yes) ), open( 'resolution.log', write,Stream, [type(text)] ), % ,alias(yadlr_logfile) asserta(yadlr_logfile(Stream)). set_proof_tree_log( File ) :- retractall( use_proof_tree_log(_) ), assert_if_new( use_proof_tree_log(yes) ), open( File, write, Stream, [type(text)] ), % ,alias(yadlr_logfile) asserta(yadlr_logfile(Stream)). unset_proof_tree_log :- set_proof_tree_log( no ), yadlr_logfile(Stream), close( Stream ). msg_proof_tree( Depth, StepType, OpenList, RestrVars ) :- use_proof_tree_log( yes ), yadlr_format_clauses( OpenList, Clauses ), fmt_range( RestrVars, Restr ), fmt( yadlr_logfile, 'derivation(~d, ~q, ~q, ~q).~n', [Depth, StepType, Restr, Clauses] ), !. msg_proof_tree( _, _, _, _ ) :- use_proof_tree_log( no ), !. use_depth_limit( no ). set_depth_limit( N ) :- integer( N ), retractall( use_depth_limit(_) ), assert_if_new( use_depth_limit(N) ). set_depth_limit( no ) :- retractall( use_depth_limit(_) ), assert_if_new( use_depth_limit(no) ). %% %% REPRESENTATION %% % Literals are ylit(Polarity,Symbol) terms yadlr_is_literal( ylit(pos, _) ). yadlr_is_literal( ylit(neg, _) ). yadlr_mk_literal( ylit(P,S), P, S ). yadlr_mk_literals( [], _, [] ). yadlr_mk_literals( [ylit(P,Head)|Rest1], P, [Head|Rest2] ) :- yadlr_mk_literals( Rest1, P, Rest2 ). yadlr_lit_complement( ylit(pos,L), ylit(neg,L) ). yadlr_lit_complement( ylit(neg,L), ylit(pos,L) ). yadlr_lit_list_complement( [], [] ). yadlr_lit_list_complement( [H|Rest], [NotH|NotRest] ) :- yadlr_lit_complement( H, NotH ), yadlr_lit_list_complement( Rest, NotRest ). % Clauses are (Pos,Neg,Degree) tuples. % Pos and Neg are sets of literals % The abstract clause is the disjunction of union(Pos,Neg) % Degree is the fuzzy degree yadlr_mk_clause( [], Range, yclause([],[],Range) ). yadlr_mk_clause( [ylit(pos,L)|Rest], Range, yclause([ylit(pos,L)|RestPos], Neg, Range) ) :- yadlr_mk_clause( Rest, Range, yclause(RestPos,Neg,Range) ). yadlr_mk_clause( [ylit(neg,L)|Rest], Range, yclause(Pos, [ylit(neg,L)|RestNeg], Range) ) :- yadlr_mk_clause( Rest, Range, yclause(Pos,RestNeg,Range) ). yadlr_clause_pos( yclause(Pos,_,_), Pos ). yadlr_clause_neg( yclause(_,Neg,_), Neg ). yadlr_clause_degree( yclause(_,_,Degree), Degree ). yadlr_format_clauses( [], [] ). yadlr_format_clauses( [yclause(Pos,Neg,Deg)|RestIn], [yclause(Pos,Neg,FmtDeg)|RestOut] ) :- fmt_range( [Deg], FmtDeg ), yadlr_format_clauses( RestIn, RestOut ). % The KB is yadlr_kb( Clause ) terms. % TODO1: yadlr_kb( head, clause ) terms. head is redundant, but % helps the prolog engine's index mechanism. % TODO2: store the original abstract form, for log presentation % init kb: cleans KB and asserts built-in relations yadlr_init( KB ) :- retractKB( KB ), % declare reserved symbols yadlr_concept( KB, dlalldifferent ). % place grounds facts at the top yadlr_assert_one( KB, Clause ) :- yadlr_clause_neg( Clause, [] ), !, db_recorda( KB, Clause, _ ). yadlr_assert_one( KB, Clause ) :- db_recordz( KB, Clause, _ ). yadlr_assert_many( _, [] ). yadlr_assert_many( KB, [Head|Rest] ) :- yadlr_assert_one( KB, Head ), yadlr_assert_many( KB, Rest ). % TODO: check if it already exists, and fail yadlr_concept( KB, ConceptName ) :- db_recordz( KB, yconcept(ConceptName), _ ). yadlr_relation( KB, RelationName ) :- db_recordz( KB, yrelation(RelationName), _ ). yadlr_instance( KB, InstanceName ) :- db_recordz( KB, yinstance(InstanceName), _ ). yadlr_concept_name( KB, ConceptName ) :- db_recorded( KB, yconcept(ConceptName), _ ). yadlr_relation_name( KB, RelationName ) :- db_recorded( KB, yrelation(RelationName), _ ). yadlr_instance_name( KB, InstanceName ) :- db_recorded( KB, yinstance(InstanceName), _ ). yadlr_assert( KB, Formula, FuzzyDegree ) :- clausify_abstract( Formula, FuzzyDegree, Clauses ), yadlr_assert_many( KB, Clauses ). % SWI Prolog does not have eraseall/1 retractKB( KB ) :- prolog_engine(swi), db_recorded( KB, _, Ref ), erase( Ref ), fail. retractKB( _ ) :- prolog_engine(swi), !. % SWI Prolog does not have eraseall/1 % retractKB( KB ) :- eraseall( KB ). yadlr_retrieve_concept( KB, ConceptName ) :- db_recorded( KB, yconcept(ConceptName), _ ). yadlr_retrieve_relation( KB, RelationName ) :- db_recorded( KB, yrelation(RelationName), _ ). yadlr_retrieve_instance( KB, InstanceName ) :- db_recorded( KB, yinstance(InstanceName), _ ). yadlr_retrieve_clause( KB, yclause(Pos,Neg,Deg) ) :- db_recorded( KB, yclause(Pos,Neg,Deg), _ ). %% %% UTILITIES %% :- use_module( [library(lists),nfsdl] ). % SWI Prolog does not have remove_duplicates/2 % also consider file_search_path(swi, _) as a test, % as the Prolog interpreter might have been renamed /* :- ( prolog_engine(swi) -> assert_if_new( remove_duplicates([], []) ), assert_if_new( (remove_duplicates([Elem|L], [Elem|NL]) :- delete(L, Elem, Temp), remove_duplicates(Temp, NL)) ) ; true ). */ complement_member( L1, [L2|_]) :- yadlr_lit_complement( L1, L2 ). complement_member(Element, [_|Rest]) :- complement_member(Element, Rest). % complement_intersection/5 (+List1, +List2, ?Intersection1, -Rest1, -Rest2) complement_intersection( [], _, [], _, _ ). complement_intersection( [H|T], L2, [H|I], T, Rest2 ) :- complement_member( H, L2 ), !, yadlr_lit_complement( H, NotH ), complement_intersection( T, L2, I, T, R2 ), select( NotH, R2, Rest2 ). complement_intersection( [H|T], L2, I, [H|R1], R2 ) :- complement_intersection( T, L2, I, R1, R2 ). % straight_intersection/5 (+List1, +List2, ?Intersection, -Rest1, -Rest2) straight_intersection( [], L2, [], [], L2 ). straight_intersection( [H|T], L2, [H|I], T, Rest2 ) :- member( H, L2 ), !, straight_intersection( T, L2, I, T, R2 ), select( H, R2, Rest2 ). straight_intersection( [H|T], L2, I, [H|R1], R2 ) :- straight_intersection( T, L2, I, R1, R2 ). % C1 is a subset of C2, and C1 is more certain fuzzy_subsumes( Clause1, Clause2, Residue ) :- yadlr_clause_degree( Clause1, D1 ), yadlr_clause_degree( Clause2, D2 ), less_fuzzy( D1, D2 ), yadlr_clause_pos( Clause1, Pos1 ), yadlr_clause_pos( Clause2, Pos2 ), permutation( Pos1, P1 ), append( P1, PosRes, Pos2 ), yadlr_clause_neg( Clause1, Neg1 ), yadlr_clause_neg( Clause2, Neg2 ), permutation( Neg1, N1 ), append( N1, NegRes, Neg2 ), append( PosRes, NegRes, Residue ). % clausify_literals( ?[Literals], ?Degree, ?[Clauses] ) % % turns a list of literals into a list of single-literal clauses % all clauses have fuzzy degree Degree clausify_literals( [], _, []). clausify_literals( [L|RestL], Degree, [C|RestC] ) :- yadlr_mk_clause( [L], Degree, C ), clausify_literals( RestL, Degree, RestC ). % clausify_abstract( +Formula, +FuzzyDegree, -[YClauses] ) % % turns an abstract formula into a list of yclauses clausify_abstract( Formula, FuzzyDegree, Clauses ) :- is_fuzzy_degree( FuzzyDegree ), nnf( Formula, NNF ), pnf( NNF, PNF ), cf( PNF, CF ), cf_to_yclauses( CF, FuzzyDegree, Clauses ). cf_to_yclauses( [], _, [] ). cf_to_yclauses( [CF|T1], FuzzyDegree, [Clause|T2] ) :- cf_to_yclause( CF, FuzzyDegree, Clause ), cf_to_yclauses( T1, FuzzyDegree, T2 ). cf_to_yclause( cl(Pos,Neg), FuzzyDegree, Clause ) :- yadlr_mk_literals( PosLits, pos, Pos ), yadlr_mk_literals( NegLits, neg, Neg ), append( PosLits, NegLits, Lits ), yadlr_mk_clause( Lits, FuzzyDegree, Clause ). %% %% RESOLUTION %% % Clause1-Clause2 are instantiated and complement-intersect % % NOTE: implementation guarantees that Clause1 is the one providing % the pos literals. This is needed for fuzzy degree checking, % do not attempt neg(Clause1)-pos(Clause2). compatible( Clause1, Clause2, Inters, Residue ) :- var( Inters ), !, yadlr_clause_pos( Clause1, Pos ), yadlr_clause_neg( Clause2, Neg ), complement_intersection( Pos, Neg, Inters, Rest1, Rest2 ), append( Rest1, Rest2, Residue ). % Clause1-Inters are instantiated and Inters is a subset of Clause1 % TODO: do not require Inters subset Clause1, to get non-definite resolution compatible( Clause1, Clause2, Inters, Residue ) :- var( Clause2 ), !, yadlr_mk_clause( LitList1, _, Clause1 ), yadlr_mk_clause( LitListI, _, Inters ), straight_intersection( LitList1, LitListI, LitListI, R, [] ), yadlr_lit_list_complement( R, NotR ), % union(LitList2,Residue) must be NotR permutation( NotR, A ), append( LitList2, Residue, A ), % make a half-baked Clause2 yadlr_mk_clause( LitList2, _, Clause2 ). resolve( Clause1, Clause2, Res, RestrVarsIn, RestrVarsOut ) :- nonvar( Clause1 ), nonvar( Clause2 ), var( Res ), !, % look for the complement-intersection of Clause1 % and Clause2. compatible( Clause1, Clause2, _Inters, Residue ), % check degrees yadlr_clause_degree( Clause1, Deg1 ), yadlr_clause_degree( Clause2, Deg2 ), less_fuzzy( Deg2, Deg1 ), % calculate degree range for Res clause tnorm( mp, Deg1, Deg2, DegR ), yadlr_mk_clause( Residue, DegR, Res ), (var(Deg1) -> append([Deg1], RestrVarsIn, RestrVars1) ; RestrVars1 = RestrVarsIn), (var(Deg2) -> append([Deg2], RestrVars1, RestrVarsOut) ; RestrVarsOut = RestrVars1). resolve( Clause1, Clause2, Res, RestrVarsIn, RestrVarsOut ) :- nonvar( Clause1 ), var( Clause2 ), nonvar( Res ), !, % Theorize about Clause2: Residue gets unified with % what needs to be proven to prove Res. % Clause2 gets unified with the perfect clause that % would do the job without any residue. compatible( Clause1, Clause2, Res, [] ), % check degrees yadlr_clause_degree( Clause1, Deg1 ), yadlr_clause_degree( Res, DegR ), less_fuzzy( Deg1, DegR ), tnorm( mp, Deg1, Deg2, DegR ), yadlr_clause_degree( Clause2, Deg2 ), (var(Deg1) -> append([Deg1], RestrVarsIn, RestrVarsOut) ; RestrVarsIn = RestrVarsOut ). % resolution_step( +KB, +Clause, -OpenList ) % perform a single resolution step resolution_step( KB, Clause, ResidualClauses, RestrIn, RestrOut ) :- yadlr_retrieve_clause( KB, Clause1 ), resolve( Clause1, Residue, Clause, RestrIn, RestrOut ), % Residue is a pos-only clause that remains to be % proven; turn into a list of atomic clauses yadlr_mk_clause( Literals, Degree, Residue ), % The fuzzy degree of the clause will be the % fuzzy degree of each clausified literal clausify_literals( Literals, Degree, ResidualClauses ). tautology_check( [Clause|RestIn], RestOut ) :- % if a literal appears as both pos and neg, % then the clause is a tautology yadlr_clause_pos( Clause, Pos ), yadlr_clause_neg( Clause, Neg ), \+ complement_intersection( Pos, Neg, [], _, _ ), !, tautology_check( RestIn, RestOut ). tautology_check( [Clause|RestIn], [Clause|RestOut] ) :- tautology_check( RestIn, RestOut ). %% %% makealldiff/1 ( +List ) %% ensures that all elements of are ununifiable %% checkalldiffhelper( _, [] ). checkalldiffhelper( A, [B] ) :- A \= B. checkalldiffhelper( A, [H|R] ) :- A \= H, checkalldiffhelper( A, R ). checkalldiff( [] ). checkalldiff( [_] ). checkalldiff( [H|R] ) :- checkalldiffhelper( H, R ), checkalldiff( R ). has_vars( [H] ) :- var( H ). has_vars( [H|R] ) :- var( H ) ; has_vars( R ). %% %% lr_pass/7 ( +KB, +Depth, +Clauses, +OpenListIn, -OpenListOut, +RestrVarsIn, -RestrVarsOut ) %% % if the restrictions narrow Degree down to zero, the branch % is done for lr_pass( _, Depth, _, Open, Open, RestrVars, RestrVars ) :- check_clause_degree( RestrVars, 0.0 ), NewDepth is Depth + 1, msg_proof_tree( NewDepth, f, Open, _RestrVarsIn ). % nothing left to prove, success lr_pass( _, Depth, [], Open, Open, RestrVars, RestrVars ) :- NewDepth is Depth + 1, msg_proof_tree( NewDepth, t, Open, RestrVars ). % complement lr_pass( KB, Depth, [H|Rest], OpenIn, OpenOut, RestrVarsIn, RestrVarsOut ) :- yadlr_clause_neg( H, [NegLit] ), NewDepth is Depth + 1, yadlr_mk_literal( NegLit, neg, Lit ), yadlr_clause_degree( H, OldDegree ), tnorm( complement, OldDegree, NewDegree ), yadlr_mk_literal( PosLit, pos, Lit ), yadlr_mk_clause( [PosLit], NewDegree, Clause ), once( msg_proof_tree(NewDepth,compl,[Clause|Rest],RestrVarsIn) ), lr_pass( KB, NewDepth, [Clause|Rest], OpenIn, OpenOut, RestrVarsIn, RestrVarsOut ). % defer uninstantiated dlalldifferent/1 literals lr_pass( KB, Depth, [H|Rest], OpenIn, OpenOut, RestrVarsIn, RestrVarsOut ) :- yadlr_clause_pos( H, [Lit] ), yadlr_mk_literal( Lit, pos, dlalldifferent(DiffList) ), has_vars( DiffList ), NewDepth is Depth + 1, append( Rest, [H], NewRest ), once( msg_proof_tree(NewDepth, sp, NewRest, RestrVarsIn) ), lr_pass( KB, NewDepth, NewRest, OpenIn, OpenOut, RestrVarsIn, RestrVarsOut ). % check instantiated dlalldifferent/1 literals lr_pass( KB, Depth, [H|Rest], OpenIn, OpenOut, RestrVarsIn, RestrVarsOut ) :- yadlr_clause_pos( H, [Lit] ), yadlr_mk_literal( Lit, pos, dlalldifferent(DiffList) ), \+ has_vars( DiffList ), NewDepth is Depth + 1, once( msg_proof_tree(NewDepth, sp, [H|Rest], RestrVarsIn) ), checkalldiff( DiffList ), lr_pass( KB, NewDepth, Rest, OpenIn, OpenOut, RestrVarsIn, RestrVarsOut ). % apply resolution step lr_pass( KB, Depth, [H|Rest], OpenIn, OpenOut, RestrVarsIn, RestrVarsOut ) :- NewDepth is Depth + 1, resolution_step( KB, H, ResidualClauses, RestrVarsIn, RestrVars1 ), append( Rest, ResidualClauses, NewRest1 ), remove_duplicates( NewRest1, NewRest ), once( msg_proof_tree(NewDepth, mp, NewRest, RestrVars1) ), lr_pass( KB, NewDepth, NewRest, OpenIn, OpenOut, RestrVars1, RestrVarsOut ), append( [H|Rest], OpenIn, _ToDo ). %msg_proof_tree( NewDepth, mp, ToDo ). lr_pass( KB, Depth, [H|Rest], OpenIn, [H|OpenList], RestrVarsIn, RestrVarsOut ) :- NewDepth is Depth + 1, lr_pass( KB, NewDepth, Rest, [H|OpenIn], OpenList, RestrVarsIn, RestrVarsOut ), append( Rest, [H|OpenIn], ToDo ), msg_proof_tree( NewDepth, s, ToDo, RestrVarsOut ). prove_clauses( KB, Depth, Clauses, Open, RestrVarsIn, RestrVarsOut ) :- msg_proof_tree( 0, i, Clauses, RestrVarsIn ), lr_pass( KB, Depth, Clauses, [], Open, RestrVarsIn, RestrVarsOut ). %% prove/5 ( +KB, +Query, ?FuzzyDegree, -Open, -ExtraRestr ) prove( KB, Query, FuzzyDegree, Open, Restr ) :- var(FuzzyDegree), !, clausify_abstract( Query, FuzzyDegree, Clauses ), prove_clauses( KB, 0, Clauses, Open, [FuzzyDegree], RestrVars ), fmt_range( RestrVars, Restr ), % if FuzzyDegree has not been instantiated, % set to max allowed by restrictions % this is only possible if all inputs are instantiated % (ie, there only one element, d, in RestrVars) (var(FuzzyDegree), length( RestrVars, 1 ) -> nth0( 0, RestrVars, Deg ), get_max(Deg,FuzzyDegree) ; true ). prove( KB, Query, FuzzyDegree, Open, Restr ) :- float(FuzzyDegree), !, clausify_abstract( Query, Degree, Clauses ), less_fuzzy( Degree, FuzzyDegree ), prove_clauses( KB, 0, Clauses, Open, [Degree], RestrVars ), fmt_range( RestrVars, Restr ).
TeamSPoon/logicmoo_workspace
packs_sys/logicmoo_ec/ext/yadlr/pl/resolution.pl
Perl
mit
16,916
#!/usr/bin/perl #AUTHORS # Kaining Hu (c) 2018 # Combine 2 cds fasta by input files v1.0000 2018/05/17 # hukaining@gmail.com use strict; use warnings; use 5.010; use Getopt::Long; use Pod::Usage; use Time::HiRes 'time'; my $verbose; our $cds1 = "/mnt/e/blast/db/BO/v1.0/B.oleracea_v1.0.scaffolds.cds"; our $cds2 = "/mnt/e/blast/db/Bnafra/BnafrCDS.fa"; our $cdsname=""; our %seqfa; our $opdir = "./Getseq2seqcdsOut"; GetOptions("o=s" => \$opdir,"verbose"=>\$verbose,"c1=s"=>\$cds1,"c2=s"=>\$cds2) or die("Error in command line arguments\nUsage: perl Getseq2seqcds.pl [options] -c1 <First_cds_fasta_file> -c2 <Second_cds_fasta_file> <Input 2seq name file>\n options:\n [-o string|output dir default: ./Getseq2seqcdsOut]\n [-c1 string|CDS fasta file1]\n [-c2 string|CDS fasta file2]\n Note: Combine 2 cds fasta by input files v1.0000 2018/05/17\n"); our $loadingstarttime=time(); mkdir $opdir unless -d $opdir; if(!open CDS1,"< $cds1"){ die "$cds1 File not Found\n"; } while(my $seq1 = <CDS1>){ if ($seq1 =~ m/^.*>/) { $seq1=~ m/^.*>([a-zA-Z0-9_.-]+) ?.*/; $cdsname = $1; $seqfa{$cdsname}=">$cdsname\n"; }else { $seqfa{$cdsname}.=$seq1; } } close CDS1; if(!open CDS2,"< $cds2"){ die "$cds1 File not Found\n"; } $cdsname=""; while(my $seq1 = <CDS2>){ if ($seq1 =~ m/^.*>/) { $seq1=~ m/^.*>([a-zA-Z0-9_.-]+) ?.*/; $cdsname = $1; $seqfa{$cdsname}=$seq1; }else { $seqfa{$cdsname}.=$seq1; } } close CDS2; print "Finished loading!\n"; our $count1=0; while(defined(our $seq = <>)){ #while(our $seq = <SEQFILENAME>){ my @sep = split/\t/,$seq; $sep[1] =~ s/\s//g; my $seqname="$sep[0]_2_"."$sep[1]"; open OUTFA, "> $opdir/$seqname.fa" or die ("[-] Error: Can't open or creat $opdir/$seqname.fa\n"); print OUTFA "$seqfa{$sep[0]}"; print OUTFA "$seqfa{$sep[1]}"; close OUTFA; $count1 ++; } print "Finished combining 2CDS! $count1 fas in $opdir\n"; our $loadingendtime=time(); printf "%g Sec %g Min\n",$loadingendtime-$loadingstarttime,($loadingendtime-$loadingstarttime)/60;
dontkme/PersonalScripts
PSG/Getseq2seqcds.pl
Perl
mit
2,047
#!/usr/bin/perl use strict; use lib '../../'; use GAL::Parser::1000_genomes_genotypes; my $parser = GAL::Parser::1000_genomes_genotypes->new(file => '../data/CEU.low_coverage.2010_07.genotypes.short.vcf'); while (my $feature_hash = $parser->next_feature_hash) { print $parser->to_gff3($feature_hash) . "\n"; }
4ureliek/TEanalysis
Lib/GAL/t/devel_scripts/parser_1000_genomes_genotypes.pl
Perl
mit
314
package MIP::Program::Bzip2; use 5.026; use Carp; use charnames qw{ :full :short }; use English qw{ -no_match_vars }; use open qw{ :encoding(UTF-8) :std }; use Params::Check qw{ allow check last_error }; use utf8; use warnings; use warnings qw{ FATAL utf8 }; ## CPANM use autodie qw{ :all }; use Readonly; ## MIPs lib/ use MIP::Constants qw{ $SPACE }; use MIP::Environment::Executable qw{ get_executable_base_command }; use MIP::Unix::Standard_streams qw{ unix_standard_streams }; use MIP::Unix::Write_to_file qw{ unix_write_to_file }; BEGIN { require Exporter; use base qw{ Exporter }; # Functions and variables which can be optionally exported our @EXPORT_OK = qw{ bzip2 }; } sub bzip2 { ## Function : Perl wrapper for writing bzip2 recipe to $filehandle or return commands array. Based on bzip2 v1.0.6 ## Returns : @commands ## Arguments: $decompress => Decompress bzip2 file ## : $filehandle => Filehandle to write to ## : $force => Overwrite of output files ## : $infile_path => Infile path ## : $outfile_path => Path to output file ## : $quiet => Suppress all warnings ## : $stderrfile_path => Stderrfile path ## : $stderrfile_path_append => Append stderr info to file path ## : $stdout => Write on standard output ## : $verbose => Verbosity my ($arg_href) = @_; ## Flatten argument(s) my $decompress; my $filehandle; my $infile_path; my $outfile_path; my $stderrfile_path; my $stderrfile_path_append; ## Default(s) my $force; my $quiet; my $stdout; my $verbose; my $tmpl = { decompress => { store => \$decompress, strict_type => 1, }, filehandle => { store => \$filehandle, }, force => { allow => [ 0, 1 ], default => 0, store => \$force, strict_type => 1, }, infile_path => { defined => 1, required => 1, store => \$infile_path, strict_type => 1, }, outfile_path => { store => \$outfile_path, strict_type => 1, }, quiet => { allow => [ undef, 0, 1 ], default => 0, store => \$quiet, strict_type => 1, }, stderrfile_path => { store => \$stderrfile_path, strict_type => 1, }, stderrfile_path_append => { store => \$stderrfile_path_append, strict_type => 1, }, stdout => { allow => [ 0, 1 ], default => 0, store => \$stdout, strict_type => 1, }, verbose => { allow => [ undef, 0, 1 ], default => 0, store => \$verbose, strict_type => 1, }, }; check( $tmpl, $arg_href, 1 ) or croak q{Could not parse arguments!}; my @commands = ( get_executable_base_command( { base_command => q{bzip2}, } ), ); if ($quiet) { push @commands, q{--quiet}; } if ($verbose) { push @commands, q{--verbose}; } if ($force) { push @commands, q{--force}; } if ($decompress) { push @commands, q{--decompress}; } ## Write to stdout stream if ($stdout) { push @commands, q{--stdout}; } ## Infile push @commands, $infile_path; ## Outfile if ($outfile_path) { push @commands, q{>} . $SPACE . $outfile_path; } push @commands, unix_standard_streams( { stderrfile_path => $stderrfile_path, stderrfile_path_append => $stderrfile_path_append, } ); unix_write_to_file( { commands_ref => \@commands, filehandle => $filehandle, separator => $SPACE, } ); return @commands; } 1;
henrikstranneheim/MIP
lib/MIP/Program/Bzip2.pm
Perl
mit
4,201
package Class::DBI::Search::Basic; =head1 NAME Class::DBI::Search::Basic - Simple Class::DBI search =head1 SYNOPSIS my $searcher = Class::DBI::Search::Basic->new( $cdbi_class, @search_args ); my @results = $searcher->run_search; # Over in your Class::DBI subclass: __PACKAGE__->add_searcher( search => "Class::DBI::Search::Basic", isearch => "Class::DBI::Search::Plugin::CaseInsensitive", ); =head1 DESCRIPTION This is the start of a pluggable Search infrastructure for Class::DBI. At the minute Class::DBI::Search::Basic doubles up as both the default search within Class::DBI as well as the search base class. We will probably need to tease this apart more later and create an abstract base class for search plugins. =head1 METHODS =head2 new my $searcher = Class::DBI::Search::Basic->new( $cdbi_class, @search_args ); A Searcher is created with the class to which the results will belong, and the arguments passed to the search call by the user. =head2 opt if (my $order = $self->opt('order_by')) { ... } The arguments passed to search may contain an options hash. This will return the value of a given option. =head2 run_search my @results = $searcher->run_search; my $iterator = $searcher->run_search; Actually run the search. =head1 SUBCLASSING =head2 sql / bind / fragment The actual mechanics of generating the SQL and executing it split up into a variety of methods for you to override. run_search() is implemented as: return $cdbi->sth_to_objects($self->sql, $self->bind); Where sql() is $cdbi->sql_Retrieve($self->fragment); There are also a variety of private methods underneath this that could be overriden in a pinch, but if you need to do this I'd rather you let me know so that I can make them public, or at least so that I don't remove them from under your feet. =cut use strict; use warnings; use base 'Class::Accessor::Fast'; __PACKAGE__->mk_accessors(qw/class args opts type/); sub new { my ($me, $proto, @args) = @_; my ($args, $opts) = $me->_unpack_args(@args); bless { class => ref $proto || $proto, args => $args, opts => $opts, type => "=", } => $me; } sub opt { my ($self, $option) = @_; $self->{opts}->{$option}; } sub _unpack_args { my ($self, @args) = @_; @args = %{ $args[0] } if ref $args[0] eq "HASH"; my $opts = @args % 2 ? pop @args : {}; return (\@args, $opts); } sub _search_for { my $self = shift; my @args = @{ $self->{args} }; my $class = $self->{class}; my %search_for; while (my ($col, $val) = splice @args, 0, 2) { my $column = $class->find_column($col) || (List::Util::first { $_->accessor eq $col } $class->columns) || $class->_croak("$col is not a column of $class"); $search_for{$column} = $class->_deflated_column($column, $val); } return \%search_for; } sub _qual_bind { my $self = shift; $self->{_qual_bind} ||= do { my $search_for = $self->_search_for; my $type = $self->type; my (@qual, @bind); for my $column (sort keys %$search_for) { # sort for prepare_cached if (defined(my $value = $search_for->{$column})) { push @qual, "$column $type ?"; push @bind, $value; } else { # perhaps _carp if $type ne "=" push @qual, "$column IS NULL"; } } [ \@qual, \@bind ]; }; } sub _qual { my $self = shift; $self->{_qual} ||= $self->_qual_bind->[0]; } sub bind { my $self = shift; $self->{_bind} ||= $self->_qual_bind->[1]; } sub fragment { my $self = shift; my $frag = join " AND ", @{ $self->_qual }; if (my $order = $self->opt('order_by')) { $frag .= " ORDER BY $order"; } return $frag; } sub sql { my $self = shift; return $self->class->sql_Retrieve($self->fragment); } sub run_search { my $self = shift; my $cdbi = $self->class; return $cdbi->sth_to_objects($self->sql, $self->bind); } 1;
carlgao/lenga
images/lenny64-peon/usr/share/perl5/Class/DBI/Search/Basic.pm
Perl
mit
3,812
#!/sw/bin/perl =head1 NAME B<one_bootstrap_ET93.pl> =head1 DESCRIPTION Bootstrap test for two samples, to be run by grid launcher. Following Efron & Tibshirani (1993), "An introduction to the bootstrap", p.220-224. To be used by C<grid_launcher_DE.pl> and it is not supposed to be ran on its own. =cut # # Tested against t-test for normal samples, 30/10/2012 # Modified and tested again, 1/04/2013 # use strict; use warnings; use Getopt::Long; use Pod::Usage; use PDL; use PDL::NiceSlice; use CompBio::Statistics; $| = 1; my ($infile, $outfile); my ($help, $man); my $B = 5000000; GetOptions ( 'infile|i=s' => \$infile, 'outfile|o=s' => \$outfile, 'nboot|n=i' => \$B, help => \$help, man => \$man, ); pod2usage(-verbose => 2) if $man; pod2usage(-verbose => 1) if $help; die "Need -infile\n" unless defined $infile; die "Need -outfile\n" unless defined $outfile; print "Bootstrap with:\n"; print "infile $infile\n"; print "outfile $outfile\n"; print "nboot $B\n"; open IN, $infile or die "Cannot open batch file $infile\n"; open OUT, ">$outfile" or die "Huh? $!\n"; while(my $gene = <IN>) { chomp $gene; my $s1 = <IN>; chomp $s1; my $s2 = <IN>; chomp $s2; my $x1 = pdl(split /\t/, $s1); my $x2 = pdl(split /\t/, $s2); print $gene; my ($p, $m1, $m2) = BootstrapTest($x1, $x2, $B, 1); print "\n"; my $fc = log($m2 / $m1) / log(2); printf OUT "%s\t%.4g\t%.4g\t%.4g\t%.4g\n", $gene, $fc, $p, $m1, $m2; } close IN; close OUT; =head1 OPTIONS =over 5 =item B<-infile>=I<pathname> Name of the input file. =item B<-outfile>=I<pathname> Name of the output file. =item B<-nboot>=I<number> Number of bootstraps. The default value is 5000000. =back =cut
bartongroup/profDGE48
Bootstrapping/one_bootstrap_ET93.pl
Perl
mit
1,711
#!/usr/bin/env perl ##!/usr/bin/perl -w # Author: Charles Tilford # 6/12/2017: xw removed reliance on bioperl # 6/9/2018: xw added title and description; edited sequence key. use strict; use JSON; use FindBin qw($Bin); use lib $Bin; use BMS::TableReader; use BMS::ArgumentParser; #use Bio::PrimarySeq; my $args = BMS::ArgumentParser->new ( -nocgi => $ENV{HTTP_HOST} ? 0 : 1, -errormail => 'charles.tilford@bms.com', -tmpdir => "/tmp", noflags => 1, -perc => 1, -paramalias => { file => [qw(input path)], perc => [qw(percent)], noflag => [qw(noflags)], xxxx => [qw()], xxxx => [qw()], xxxx => [qw()], }, ); my $nocgi = $args->val(qw(nocgi)); if ($nocgi) { $args->shell_coloring(); } else { $args->set_mime( -mail => $args->val('errmail'), ); } my $minPerc = $args->val('perc'); my $noFlags = $args->val('noflags'); my $fh = *STDOUT; my $source = {}; my $cjs = encode_json( &cx_panel_settings() ); my $ejs = encode_json( &cx_callbacks() ); my $counter = 0; my $wid = 1000; my $hgt = 100; my $alnBlkSz = 50; my $trackCol = { WT => "51,102,0", Del => "255,51,51", Ins => "0,0,204", CPX => "96,0,96", Guide => "255,51,255", }; my $allowedAliases = { Wildtype => 'WT', Insertion => 'Ins', Deletion => 'Del', Complex => 'CPX', Guide => 'Guide', }; foreach my $path ($args->each_split_val('/\s*[\n\r\,]+\s*/','file')) { &read_source( $path ); } =pod $source will end up bing a hash structured as: {FPR1-CR2_S18} => Hash with 1 key HASH(0xf6ebc70) {FPR1_52250043} => Array with 12 elements ARRAY(0xf6ebca0) [ 0] = Hash with 11 keys HASH(0xf4c96b0) {Frame} => 0 {Loc} => [52250026,52250036],[52250047,52250061] {Mut} => GCCGTGGCTG {Num} => 1783 {Perc} => 6.91 {Pos} => 52250046 {Sample} => FPR1-CR2_S18 {Seq} => AGTTACCTGAACCTGACTTCTGTTTC {Site} => FPR1_52250043 {Str} => - {Type} => Del [ 1] = Hash with 11 keys HASH(0xf0264d0) {Frame} => 0 {Loc} => [52250026,52250038],[1],[52250039,52250061] {Mut} => C etc =cut my @samples = sort keys %{$source}; if ($#samples == -1) { #$args->msg("[?]","Provide input file with -input"); $args->msg("No data in input file"); exit; } print $fh &HTML_START(); print $fh "<h1>Alignment View of Insertion and Deletion Alleles in CDS</h1> <p> This is an interactive alignment view of the CDS (coding sequence) of sgRNA guide, WT (non-indel), and indel alleles in the gene. The frequencies of WT, deletion and insert reads are shown. Point mutations in reads were not represented here. The CDS sequences before and after indels were reconstructed from reference CDS. The bars can be zoomed in and out, and moved to the left and right. Intronic bases, if present in sgRNA sequence or deleted bases, will not be drawn. Deletion is shown as an arc line connecting neighboring bases. Insertion is shown as a small tick mark between two bases. Please note: the amino acid sequence at or after the insertion was left unchanged from the wild type, due to technical issues. However, the inserted bases and resulting amino acid sequence are shown in the pop-up window. <p> "; foreach my $sample (@samples) { foreach my $site (sort keys %{$source->{$sample}}) { &cx_panel( $source->{$sample}{$site} ); } } print $fh &html_key(); print $fh &HTML_END(); sub dealias { my $val = shift; return $val unless (defined $val); return $allowedAliases->{$val} || $val; } sub cx_panel { my $all = shift; return if (!$all || $#{$all} == -1); my @muts = sort { $b->{Class} <=> $a->{Class} || $b->{Perc} <=> $a->{Perc} } @{$all}; my $sample = $muts[0]{Sample}; my $site = $muts[0]{Site}; my $cid = sprintf("CrispCX%d", ++$counter); # Pre-scan mutation records to collect some aggregate data my $perInDel = 0; my ($wtDNA, $wtPrt) = ("", ""); my %flags; my $stopCounter = 0; foreach my $mut (@muts) { my $perc = $mut->{Perc} || 0; my $clas = $mut->{Class}; my $frm = $mut->{Frame}; my $seq = $mut->{Seq}; if ($seq && defined $frm) { # We can translate the reference #my $dBS = Bio::PrimarySeq->new # (-seq => substr($seq, $frm), -alphabet => 'dna'); #my $pBS = $dBS->translate(); my $protseq = translate($seq); my $pad = (" " x $frm) || ""; # $ps will be a space-padded (for frame / offset) and # square-bracketted (to bring modulus-3 inline with DNA) # protein sequence. #my $ps = $pad . # join('', map { "[$_]" } split('', uc($pBS->seq()))); my $ps = $pad . join('', map { "[$_]" } split('', $protseq)); if ($ps =~ /^([^\*]+\*\])(.+)/) { my ($prot, $pastStop) = ($1, $2); $mut->{hasStop} = 1; # Lower-case amino acids after the stop: $ps = $prot . lc($pastStop); delete $flags{"EarlyStops=".$stopCounter}; $flags{"EarlyStops=".++$stopCounter} = 'qry'; } $mut->{ProtSeq} = $ps; if ($clas == 1) { # Make note of wild type for later comparisons if (! $wtPrt) { $wtPrt = $ps; } elsif ($ps ne $wtPrt) { warn "Multiple translations provided for WT sequence!\n". " $wtPrt (used)\n $ps\n"; } } } if ($clas == 1) { # WT if ($perc >= 5) { # Wild Type alleles are present. Not good. $flags{sprintf("Wild Type %d%%", $perc)} = 'del'; } if (! $wtDNA) { $wtDNA = $seq; } elsif ($seq ne $wtDNA) { warn "Multiple DNA sequences provided for WT!\n". " $wtDNA (used)\n $seq\n"; } } next unless ($perc); next if ($clas); # InDel $perInDel += $perc; my $len = $mut->{MutLen}; if (my $mseq = $mut->{Mut}) { my $ml = CORE::length($mseq); $args->msg("[?]", "Mutation sequence and length disagree", "$sample : $ml vs $len bp") if ($len && $ml != $len); $len = $ml; } if ($len) { $mut->{CalcLen} = $len; unless ($len % 3) { $flags{sprintf("In-frame %dbp %s", $len, $mut->{TypeShown} || "Unknown")} = 'del'; } } } my ($wtLenD, $wtLenP) = map { CORE::length($_) } ($wtDNA, $wtPrt); $flags{sprintf("%d%% InDel", $perInDel)} = $perInDel < 95 ? "del" : "qry"; printf( $fh "<h2>%s : %s", $sample, $site); %flags = () if ($noFlags); foreach my $fb (sort keys %flags) { printf($fh " <span class='%s'>%s</span>", $flags{$fb}, $fb); } print $fh "</h2>\n"; print $fh "<canvas id='$cid' width='$wid' height='$hgt'></canvas>\n"; my $dataData = { tracks => [ ], }; my $tracks = $dataData->{tracks} = []; my $track = { type => 'box', connect => 'true', trackType => 'CRISPR', honorType => 1, }; push @{$tracks}, $track; my $tdata = $track->{data} = []; my $rejects = 0; foreach my $mut (@muts) { my $loc = $mut->{Loc}; my $perc = $mut->{Perc}; my $clas = $mut->{Class}; if ($minPerc && !$clas && (!$perc || ($perc < $minPerc))) { $rejects++; next; } unless ($loc) { $args->msg("[!!]", "No location provided for $sample/$site"); next; } my $srcSeq = $mut->{Seq}; my $srcPrt = $mut->{ProtSeq} || ""; my @hspDat; if ($loc =~ /^\s*\[\s*(.+?)\s*\]\s*$/) { @hspDat = map { [ split(/\s*,\s*/, $_) ] } split(/\s*\]\s*,\s*\[\s*/, $1); } else { $args->msg("[!!]", "Unrecognized location for $sample/$site", $loc); next; } my $str = !$mut->{Str} ? 'right' : $mut->{Str} =~ /^\-/ ? 'left' : 'right'; # Xuning says that strand is just for information only # He will always give me the +1/Fwd/Top representation $str = 'right'; my $off = 0; my $seqs = { show => "", dna => "", prt => "", dnaW => "", prtW => "", }; my (@data, $insBlock); my $parseErr = "!!PARSE ERROR!!"; my $lastRef = 0; for my $i (0..$#hspDat) { my @hsp = map { $_ + 0 } @{$hspDat[$i]}; if ($#hsp == 1) { # Normal [s,e] HSP push @data, \@hsp; my ($s, $e) = @hsp; if ($i) { # Not the first HSP my $glen = $s - $lastRef - 1; if ($glen > 0) { # We are missing part of the reference my $gap = '-' x $glen; $seqs->{prt} .= $gap; $seqs->{dna} .= $gap; $seqs->{dnaW} .= $lastRef < $wtLenD ? substr($wtDNA, $lastRef, $glen) : " " x $glen if ($wtDNA); $seqs->{prtW} .= $lastRef < $wtLenP ? substr($wtPrt, $lastRef, $glen) : " " x $glen if ($wtPrt); } elsif ($glen < 0) { # Should not happen $args->msg("[!!]", "Weird negative gap"); map { $seqs->{$_} .= $parseErr } keys %{$seqs}; next; } } $lastRef = $e; my $len = $e - $s + 1; my $subDna = substr($srcSeq, $off, $len); $seqs->{prt} .= substr($srcPrt, $off, $len); $seqs->{dna} .= $subDna; $seqs->{show} .= $subDna; $seqs->{dnaW} .= $s > $wtLenD ? " " x $len : substr($wtDNA, $s-1, $len) if ($wtDNA); $seqs->{prtW} .= $s > $wtLenP ? " " x $len : substr($wtPrt, $s-1, $len) if ($wtPrt); $off += $len; next; } elsif ($#hsp != 0) { # Should not happen $args->msg("[!!]", "Unexpected HSP", join(',', @hsp)); map { $seqs->{$_} .= $parseErr } keys %{$seqs}; next; } # A single value indicates an insertion if (!$i || $i == $#hspDat) { # We can not do anything here. $args->msg("[!!]","Insertion blocks are not allowed at the start or end of a location definition!"); map { $seqs->{$_} .= $parseErr } keys %{$seqs}; next; } my $s = $hspDat[$i-1][1]; my $e = $hspDat[$i+1][0]; my $len = $hsp[0]; my $subDna = substr($srcSeq, $off, $len); $seqs->{prt} .= substr($srcPrt, $off, $len); $seqs->{dna} .= $subDna; my $gap = '-' x $len; $seqs->{dnaW} .= $gap; $seqs->{prtW} .= $gap; # Until insertion representation is fixed in CX, we can not # put the real sequence into the track: # $seqs->{show} .= $subDna; # Use a separate block instead: $insBlock ||= { label => "INS", name => "INS", data => [], fill => "#ff0000", type => 'Deletion', insertion => 1, dir => $str, w => 0, sequence => "", }; push @{$insBlock->{data}}, [$s, $e]; $insBlock->{sequence} .= $subDna; $off += $len; } my @alnBlk = ([]); my $aPos = 0; my $aLen = CORE::length($seqs->{dna}); my @typs = ('dna', 'prt'); for my $j (0..$#typs) { my $typ = $typs[$j]; my $mutSeq = $seqs->{$typ}; next unless ($mutSeq); my $mlen = CORE::length($mutSeq); my $wtSeq = $seqs->{$typ.'W'}; my $lastCls = "$typ"; for (my $i = 0; $i < $mlen; $i++) { my $row = $alnBlk[int($i/$alnBlkSz)] ||= []; $row->[$j] ||= "<span class='$lastCls'>"; # warn "$typ [$i] vs ($aLen)".CORE::length($mutSeq) unless ($i < CORE::length($mutSeq)); my $char = substr($mutSeq, $i, 1); my $cls = "$typ"; if ($char eq '*') { $cls = 'stop'; } elsif ($cls eq '-') { $cls = 'gap'; } if ($wtSeq) { $cls .= " wt" if ($i < $wtLenD && $char eq substr($wtSeq, $i, 1)); } unless ($cls eq $lastCls) { $row->[$j] .= "</span><span class='$cls'>"; $lastCls = $cls; } $row->[$j] .= $char; } } my $frame = $mut->{Frame}; if ($insBlock) { # push @{$tdata}, $insBlock; my %tags = ("Inserted Sequence" => [$insBlock->{sequence} ]); $insBlock->{tags} = \%tags; # $args->msg_once("[!]","Insertion rows are awaiting enhanced display from Isaac","Ins blocks look WT, they're not. They are missing the 'looped out' inserted segment.","I removed the 'INS' entries since they were confusing and not displaying as intended anyway"); # push @{$tdata}, $insBlock; } my $type = $mut->{Type} || "Unknown"; my $lab = $mut->{TypeShown} || "Unknown"; if ($type eq 'WT') { if ($perc) { $lab = "!! $lab"; } else { $lab = "{Reference} $lab"; } } my %tags = ("Sequence Type" => [$type], "Sample" => [$sample], "Site" => [$site],); if (my $mseq = $mut->{Mut}) { $tags{"Mutation"} = [$mseq]; } if (my $len = $mut->{CalcLen}) { $tags{"Len"} = [$len]; $lab .= sprintf(" %dbp", $len); } if (my $num = $mut->{Num}) { $lab .= " [$num]"; $tags{"Read Depth"} = [ $num ]; } if ($perc) { $lab .= sprintf(" %d%%", int(0.5 + $perc)); $tags{"Percent of Reads"} = [int(0.5 + 100 *$perc)/100]; } if (0 && $str eq 'left') { @data = sort { $b->[0] <=> $a->[0] } @data; } else { @data = sort { $a->[0] <=> $b->[0] } @data; } # print "<pre>".join("\n", map { $seqs->{$_} } qw(dnaW prtW dna prt) )."</pre>\n"; my $bar = { label => $lab, name => $lab, data => \@data, dir => $str, sequence => $seqs->{show}, tags => \%tags, alnBlk => join("\n", map {"$_</span>"} map { @{$_} } @alnBlk), }; if (defined $frame && $clas != 2) { my $s = $frame + 1; $bar->{cds} = [ $frame + 1, CORE::length($bar->{sequence}) ]; } if (my $tc = $trackCol->{$type}) { # $track->{trackNameFontColor} = $tc; my $alpha = $perc ? (0.15 + 0.017 * $perc) : 1; $alpha = 1 if ($alpha > 1); $alpha = 1; # xw disabled gradient $bar->{featureNameFontColor} = sprintf("rgba(%s,%0.2f)", $tc, $alpha); } # push @{$tracks}, $track; push @{$tdata}, $bar; } my $djs = encode_json($dataData); print $fh "<script>\n new CanvasXpress('$cid'" . ",\n $djs" . ",\n $cjs" . ",\n { mousemove: locMouseOver, click: locMouseClick }" . "\n );</script><br style='clear:both' />\n"; printf($fh "<span style=''>Rejected %d class%s with < %s%% representation.</span><br />\n", $rejects, $rejects == 1 ? '' : 'es', $minPerc) if ($minPerc); } # xw added in order to avoid Bioperl sub translate { my $dnaSeq = shift; $dnaSeq = uc($dnaSeq); my %ct = ( TTT=>'F', TTC=>'F', TTA=>'L', TTG=>'L', TCT=>'S', TCC=>'S', TCA=>'S', TCG=>'S', TAT=>'Y', TAC=>'Y', TAA=>'*', TAG=>'*', TGT=>'C', TGC=>'C', TGA=>'*', TGG=>'W', CTT=>'L', CTC=>'L', CTA=>'L', CTG=>'L', CCT=>'P', CCC=>'P', CCA=>'P', CCG=>'P', CAT=>'H', CAC=>'H', CAA=>'Q', CAG=>'Q', CGT=>'R', CGC=>'R', CGA=>'R', CGG=>'R', ATT=>'I', ATC=>'I', ATA=>'I', ATG=>'M', ACT=>'T', ACC=>'T', ACA=>'T', ACG=>'T', AAT=>'N', AAC=>'N', AAA=>'K', AAG=>'K', AGT=>'S', AGC=>'S', AGA=>'R', AGG=>'R', GTT=>'V', GTC=>'V', GTA=>'V', GTG=>'V', GCT=>'A', GCC=>'A', GCA=>'A', GCG=>'A', GAT=>'D', GAC=>'D', GAA=>'E', GAG=>'E', GGT=>'G', GGC=>'G', GGA=>'G', GGG=>'G' ); my $ps; for (my $i=0; $i<length($dnaSeq); $i +=3) { my $codon = substr($dnaSeq, $i, 3); if ( length($codon)==3 ) { $ps .= $ct{$codon}; } } return $ps; } sub read_source { my $path = shift; return unless ($path); my $tr = BMS::TableReader->new( -colmap => { Sample => 'Sample', 'Cleavage Site' => 'Site', 'Cleavage_Site' => 'Site', Sequence => 'Seq', Strand => 'Str', Location => 'Loc', Type => 'TypeShown', Frame => 'Frame', 'Indel Pos' => 'Pos', 'Indel Seq' => 'Mut', 'Indel_Pos' => 'Pos', 'Indel_Seq' => 'Mut', 'Indel_Length' => 'MutLen', 'AAseq' => 'AA', Reads => 'Num', Pct => 'Perc', }); my $format = $tr->format_from_file_name($path); $tr->has_header(1); $tr->format($format); $tr->input($path); my @need = qw(Sample Site Seq Loc); foreach my $sheet ($tr->each_sheet()) { my @missing; foreach my $col (@need) { my ($chk) = $tr->column_name_to_number( $col ); push @missing, $col unless ($chk); } unless ($#missing == -1) { $args->msg("[-]", "Sheet $sheet is missing required columns:", join(', ', @missing)); next; } my @head = $tr->header(); # while (my $hash = $tr->next_clean_hash()) { while (my $row = $tr->next_clean_row()) { my %hash; for my $i (0..$#head) { $hash{ $head[$i] } = $row->[$i]; } my ($samp, $site) = ($hash{Sample}, $hash{Site}); next unless ($samp); if ($samp =~ /^total[_\s]*samples\s*:\s*(\d+)/i) { # This is actually a summary row print $fh "<table class='tab'><caption>Sample Summary</caption><tbody>\n"; foreach my $cell (@{$row}) { next unless ($cell); if ($cell =~ /^(.+)\s*:\s*(\d+|\d+\.\d+)\s*$/) { my ($t, $v) = ($1, $2); $t =~ s/[\s_]+/ /g; print $fh " <tr><th>$t</th><td>$v</td></tr>\n"; } else { print $fh "<tr><td colspan='2'><i>Unrecognized data: '$cell'</i></td></tr>\n"; } } print $fh "</tbody></table>\n"; next; } next unless ($site); $hash{Perc} ||= 0; my $type = $hash{Type} = &dealias($hash{TypeShown} || ""); $hash{Class} = $type eq 'Guide' ? 2 : $type eq 'WT' ? 1 : 0; push @{$source->{$samp}{$site}}, \%hash; } } } sub cx_panel_settings { return { featureStaggered => 0, graphType => 'Genome', featureNameFontColor => 'rgb(29,34,43)', featureNameFontStyle => 'bold', featureNameFontColor => '#999999', featureNameFontSize => 10, xAxisTickColor => 'rgb(29,34,43)', wireColor => 'rgba(29,34,43,0.1)', #autoAdjust => 'true', #adjustAspectRatio => 'true', sequenceFill => '#cccccc', infoTimeOut => 300 * 1000, margin => 2, filterSkipNullKeys => 1, subtracksMaxDefault => 900, }; } sub cx_callbacks { return { mousemove => "locMouseOver", click => "locMouseClick", }; } sub HTML_START { my $colors = ""; while (my ($key, $col) = each %{$trackCol}) { $colors .= sprintf(" .csp%s { font-weight: bold; color: rgb(%s); }\n", $key, $col); } return <<EOF; <!DOCTYPE html> <html lang='en'> <head> <style> .prot { color: purple; } .perc { color: navy; font-weight: bold; } .stop { color: yellow; background-color: red; } .shift { color: yellow; background-color: blue; } .frame { color: white; background-color: black; } .smallnote { width: 25em; color: brown; white-space: normal; } .pophead { font-size: 1.4em; font-weight: bold; color: #f90; } pre.aln { font-size: 0.8em; } pre.aln .wt { opacity: 0.2; } pre.aln .prt { color: purple; } $colors </style> <title>Crsipr Explorr</title> <meta http-equiv="X-UA-Compatible" content="chrome=1"> <!--script type='text/javascript' src='http://canvasxpress.org/js/canvasXpress.min.js'></script--> <script type='text/javascript' src='Assets/canvasXpress.min.js'></script> <!--link type='text/css' rel='stylesheet' href='http://canvasxpress.org/css/canvasXpress.css' /--> <link type='text/css' rel='stylesheet' href='Assets/canvasXpress.min.css'> <link href='Assets/0_MainStyles.css' type='text/css' rel='stylesheet' /> <script src='Assets/0_MainScripts.js' type='text/javascript'></script> <script src='Assets/basic.js' type='text/javascript'></script> <script src='Assets/crispr2cx.js' type='text/javascript'></script> <body> EOF } sub html_key { return <<EOF; <h2>Label Key</h2> <span style='color:red'>Deletion 2bp [42567] 32%</span> : The allele is a deletion of 2 base pairs, with 42,567 reads making up 32% of all reads<br /> <span style='color:purple'>Guide</span> : Shows the location of the Guide sequence, used to target the CRISPR mutations. Bases not in coding sequence will not be shown in the diagram. <br /> <span style='color:green'>{Reference} Wildtype</span> : This row is showing WildType sequence; {Reference} indicates that it was not (significantly) observed and is being shown for comparison purposes only.<br /> <span style='color:green'>!! Wildtype [52932] 98%</span> : This row is WildType; '!!' means it <b>was</b> observed, in this case 52,932 reads (98% of all reads)<br /> <h2>Sequence Key</h2> <i>The shown sequence is a combined DNA/tranlsation for the bar being viewed. It is colored according to its alignment to the wildtype.</i> <pre class='aln'> <span class="dna wt">ATGGAAACCAACTTCTCCACTCCTCTGAATGAATATGAAGAAGTGTCCTA</span> DNA, grayed-out means it agrees with WildType in this part of the alignment <span class="prt"></span><span class="prt wt">[M][E][T][N][F][S][T][P][L][N][E][Y][E][E][V][S][Y</span> Protein, grayed-out as it also matches WildType <span class="dna wt">TTTCATTGCACTGGACCGCTG</span><span class="dna">--</span><span class="dna wt">TTTGTGTCCTGCATCCAGTCTGGGCCC</span> 2bp deletion, but otherwise agrees with WildType <span class="prt wt">][F][I][A][L][D][R][C</span><span class="prt">--][L][C][P][A][S][S][L][G][P</span> The frameshift caused a change of amino acid sequence <span class="prt wt">][F][I][A][L][D][R][</span><span class="stop">*</span><span class="prt">-][f][v][s][c][i][q][s][g][p]</span> Lower-case amino acids indicate any translation after a stop. </pre> EOF } sub HTML_END { return <<EOF; </body></html> EOF }
pinetree1/crispr-dav
crispr2cx.pl
Perl
mit
24,887
# -*- perl -*- # # $Id: Test.pm,v 1.2 1999/08/12 14:28:57 joe Exp $ # # Net::Daemon - Base class for implementing TCP/IP daemons # # Copyright (C) 1998, Jochen Wiedmann # Am Eisteich 9 # 72555 Metzingen # Germany # # Phone: +49 7123 14887 # Email: joe@ispsoft.de # # # This module is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This module 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 module; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # ############################################################################ package Net::Daemon::Test; use strict; require 5.004; use Net::Daemon (); use Symbol (); use File::Basename (); $Net::Daemon::Test::VERSION = '0.02'; @Net::Daemon::Test::ISA = qw(Net::Daemon); =head1 NAME Net::Daemon::Test - support functions for testing Net::Daemon servers =head1 SYNOPSIS # This is the server, stored in the file "servertask". # # Create a subclass of Net::Daemon::Test, which in turn is # a subclass of Net::Daemon use Net::Daemon::Test (); package MyDaemon; @MyDaemon::ISA = qw(Net::Daemon::Test); sub Run { # Overwrite this and other methods, as you like. } my $self = Net::Daemon->new(\%attr, \@options); eval { $self->Bind() }; if ($@) { die "Server cannot bind: $!"; } eval { $self->Run() }; if ($@) { die "Unexpected server termination: $@"; } # This is the client, the real test script, note we call the # "servertask" file below: # # Call the Child method to spawn a child. Don't forget to use # the timeout option. use Net::Daemon::Test (); my($handle, $port) = eval { Net::Daemon::Test->Child(5, # Number of subtests 'servertask', '--timeout', '20') }; if ($@) { print "not ok 1 $@\n"; exit 0; } print "ok 1\n"; # Real tests following here ... # Terminate the server $handle->Terminate(); =head1 DESCRIPTION This module is a frame for creating test scripts of Net::Daemon based server packages, preferrably using Test::Harness, but that's your choice. A test consists of two parts: The client part and the server part. The test is executed by the child part which invokes the server part, by spawning a child process and invoking an external Perl script. (Of course we woultn't need this external file with fork(), but that's the best possibility to make the test scripts portable to Windows without requiring threads in the test script.) The server part is a usual Net::Daemon application, for example a script like dbiproxy. The only difference is that it derives from Net::Daemon::Test and not from Net::Daemon, the main difference is that the B<Bind> method attempts to allocate a port automatically. Once a port is allocated, the number is stored in the file "ndtest.prt". After spawning the server process, the child will wait ten seconds (hopefully sufficient) for the creation of ndtest.prt. =head1 AVAILABLE METHODS =head2 Server part =over 8 =item Options Adds an option B<--timeout> to Net::Daemon: The server's Run method will die after at most 20 seconds. =cut sub Options ($) { my $self = shift; my $options = $self->SUPER::Options(); $options->{'timeout'} = { 'template' => 'timeout=i', 'description' => '--timeout <secs> ' . "The server will die if the test takes longer\n" . ' than this number of seconds.' }; $options; } =pod =item Bind (Instance method) This is mainly the default Bind method, but it attempts to find and allocate a free port in two ways: First of all, it tries to call Bind with port 0, most systems will automatically choose a port in that case. If that seems to fail, ports 30000-30049 are tried. We hope, one of these will succeed. :-) =cut sub Bind ($) { # First try: Pass unmodified options to Net::Daemon::Bind my $self = shift; my($port, $socket); $self->{'proto'} ||= $self->{'localpath'} ? 'unix' : 'tcp'; if ($self->{'proto'} eq 'unix') { $port = $self->{'localpath'} || die "Missing option: localpath"; $socket = eval { IO::Socket::UNIX->new('Local' => $port, 'Listen' => $self->{'listen'} || 10); } } else { my @socket_args = ( 'LocalAddr' => $self->{'localaddr'}, 'LocalPort' => $self->{'localport'}, 'Proto' => $self->{'proto'} || 'tcp', 'Listen' => $self->{'listen'} || 10, 'Reuse' => 1 ); $socket = eval { IO::Socket::INET->new(@socket_args) }; if ($socket) { $port = $socket->sockport(); } else { $port = 30049; while (!$socket && $port++ < 30060) { $socket = eval { IO::Socket::INET->new(@socket_args, 'LocalPort' => $port) }; } } } if (!$socket) { die "Cannot create socket: " . ($@ || $!); } # Create the "ndtest.prt" file so that the child knows to what # port it may connect. my $fh = Symbol::gensym(); if (!open($fh, ">ndtest.prt") || !(print $fh $port) || !close($fh)) { die "Error while creating 'ndtest.prt': $!"; } $self->Debug("Created ndtest.prt with port $port\n"); $self->{'socket'} = $socket; if (my $timeout = $self->{'timeout'}) { eval { alarm $timeout }; } $self->SUPER::Bind(); } =pod =item Run (Instance method) Overwrites the Net::Daemon's method by adding a timeout. =back sub Run ($) { my $self = shift; $self->Run(); } =head2 Client part =over 8 =item Child (Class method) Attempts to spawn a server process. The server process is expected to create the file 'ndtest.prt' with the port number. The method returns a process handle and a port number. The process handle offers a method B<Terminate> that may later be used to stop the server process. =back =cut sub Child ($$@) { my $self = shift; my $numTests = shift; my($handle, $pid); my $args = join(" ", @_); print "Starting server: $args\n"; unlink 'ndtest.prt'; if ($args =~ /\-\-mode=(?:ithread|thread|single)/ && $^O =~ /mswin32/i) { require Win32; require Win32::Process; my $proc = $_[0]; # Win32::Process seems to require an absolute path; this includes # a program extension like ".exe" my $path; my @pdirs; File::Basename::fileparse_set_fstype("MSWin32"); if (File::Basename::basename($proc) !~ /\./) { $proc .= ".exe"; } if ($proc !~ /^\w\:\\/ && $proc !~ /^\\/) { # Doesn't look like an absolute path foreach my $dir (@pdirs = split(/;/, $ENV{'PATH'})) { if (-x "$dir/$proc") { $path = "$dir/$proc"; last; } } if (!$path) { print STDERR ("Cannot find $proc in the following" , " directories:\n"); foreach my $dir (@pdirs) { print STDERR " $dir\n"; } print STDERR "Terminating.\n"; exit 1; } } else { $path = $proc; } print "Starting process: proc = $path, args = ", join(" ", @_), "\n"; if (!&Win32::Process::Create($pid, $path, join(" ", @_), 0, Win32::Process::NORMAL_PRIORITY_CLASS(), ".")) { die "Cannot create child process: " . Win32::FormatMessage(Win32::GetLastError()); } $handle = bless(\$pid, "Net::Daemon::Test::Win32"); } else { $pid = eval { fork() }; if (defined($pid)) { # Aaaah, Unix! :-) if (!$pid) { # This is the child process, spawn the server. exec @_; } $handle = bless(\$pid, "Net::Daemon::Test::Fork"); } else { print "1..0\n"; exit 0; } } print "1..$numTests\n" if defined($numTests); for (my $secs = 20; $secs && ! -s 'ndtest.prt'; $secs -= sleep 1) { } if (! -s 'ndtest.prt') { die "Server process didn't create a file 'ndtest.prt'."; } # Sleep another second in case the server is still creating the # file with the port number ... sleep 1; my $fh = Symbol::gensym(); my $port; if (!open($fh, "<ndtest.prt") || !defined($port = <$fh>)) { die "Error while reading 'ndtest.prt': $!"; } ($handle, $port); } package Net::Daemon::Test::Fork; sub Terminate ($) { my $self = shift; my $pid = $$self; kill 'TERM', $pid; } package Net::Daemon::Test::Win32; sub Terminate ($) { my $self = shift; my $pid = $$self; $pid->Kill(0); } 1; =head1 AUTHOR AND COPYRIGHT Net::Daemon is Copyright (C) 1998, Jochen Wiedmann Am Eisteich 9 72555 Metzingen Germany Phone: +49 7123 14887 Email: joe@ispsoft.de All rights reserved. You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. =head1 SEE ALSO L<Net::Daemon(3)>, L<Test::Harness(3)> =cut
carlgao/lenga
images/lenny64-peon/usr/share/perl5/Net/Daemon/Test.pm
Perl
mit
9,560
#!/usr/bin/perl use warnings; use strict; use Gtk2 -init; use Glib qw(TRUE FALSE); # To get TRUE and FALSE use POSIX qw(locale_h :signal_h :errno_h :sys_wait_h); use IPC::Open3; use IO::Handle; use Readonly; Readonly my $_POLL_INTERVAL => 100; # ms Readonly my $_1KB => 1024; my $EMPTY = q{}; # Create the windows warn qq(Creating window...\n); my $window = Gtk2::Window->new('toplevel'); my $box = Gtk2::VBox->new; my $entry = Gtk2::Entry->new; my $pbar = Gtk2::ProgressBar->new; my $qbutton = Gtk2::Button->new('Quit'); my $sbutton = Gtk2::Button->new('Start'); $window->add($box); $box->add($pbar); $box->add($qbutton); $box->add($sbutton); # We should also link this to the destroy message on the main window, # this is just quick and dirty $qbutton->signal_connect( clicked => sub { Gtk2->main_quit } ); $sbutton->signal_connect( clicked => \&start_process ); $window->show_all; Gtk2->main; sub start_process { warn qq(start_process\n); watch_cmd( cmd => 'for i in `seq 1 5`; do echo $i; sleep 1; done', running_callback => sub { warn qq(pbar->pulse\n); $pbar->pulse; }, started_callback => sub { warn qq(started_callback\n); $pbar->set_text('Started'); }, out_callback => sub { warn qq(out_callback\n); my ($line) = @_; $pbar->set_text($line); }, err_callback => sub { warn qq(err_callback\n); my ($line) = @_; $pbar->set_text("Error: $line"); }, finished_callback => sub { warn qq(finished_callback\n); $pbar->set_text('Finished'); }, ); return; } sub watch_cmd { my (%options) = @_; my $out_finished = FALSE; my $err_finished = FALSE; my $error_flag = FALSE; print "command: $options{cmd}\n"; if ( defined $options{running_callback} ) { my $timer = Glib::Timeout->add( $_POLL_INTERVAL, sub { $options{running_callback}->(); return Glib::SOURCE_REMOVE if ( $out_finished or $err_finished ); return Glib::SOURCE_CONTINUE; } ); } my ( $write, $read ); my $error = IO::Handle->new; my $pid = IPC::Open3::open3( $write, $read, $error, $options{cmd} ); print "IPC::Open3 PID: $pid\n"; if ( defined $options{started_callback} ) { warn qq(calling started_callback\n); $options{started_callback}->() } my ( $stdout, $stderr, $error_message ); add_watch( $read, sub { my ($line) = @_; $stdout .= $line; if ( defined $options{out_callback} ) { warn qq(add_watch, calling out_callback: $line\n); $options{out_callback}->($line); } }, sub { # Don't flag this until after the callback to avoid the race condition # where stdout is truncated by stderr prematurely reaping the process $out_finished = TRUE; }, sub { ($error_message) = @_; $error_flag = TRUE; } ); add_watch( $error, sub { my ($line) = @_; $stderr .= $line; if ( defined $options{err_callback} ) { warn qq(add_watch, calling err_callback: $line\n); $options{err_callback}->($line); } }, sub { # Don't flag this until after the callback to avoid the race condition # where stderr is truncated by stdout prematurely reaping the process $err_finished = TRUE; }, sub { ($error_message) = @_; $error_flag = TRUE; } ); # Watch for the process to hang up before running the finished callback Glib::Child->watch_add( $pid, sub { # Although the process has hung up, we may still have output to read, # so wait until the _watch_add flags that the process has ended first. my $timer = Glib::Timeout->add( $_POLL_INTERVAL, sub { if ($error_flag) { if ( defined $options{error_callback} ) { $options{error_callback}->($error_message); } return Glib::SOURCE_REMOVE; } elsif ( $out_finished and $err_finished ) { if ( defined $options{finished_callback} ) { $options{finished_callback}->( $stdout, $stderr ); } print "Waiting to reap process\n"; # -1 indicates a non-blocking wait for all pending zombie processes print 'Reaped PID ', waitpid( -1, ## no critic (ProhibitMagicNumbers) WNOHANG ), "\n"; return Glib::SOURCE_REMOVE; } return Glib::SOURCE_CONTINUE; } ); } ); return; } sub add_watch { my ( $fh, $line_callback, $finished_callback, $error_callback ) = @_; my $line; Glib::IO->add_watch( fileno($fh), [ 'in', 'hup' ], sub { my ( $fileno, $condition ) = @_; my $buffer; if ( $condition & 'in' ) { # bit field operation. >= would also work # For Linux, this "if" should always return true, as the # callback is only triggered when there is data to read. # MacOS seems to trigger this callback even when there is # nothing to read, and therefore we need this conditional # Only reading one buffer, rather than until sysread gives EOF # because things seem to be strange for stderr if ( sysread $fh, $buffer, $_1KB ) { if ($buffer) { $line .= $buffer } while ( $line =~ /([\r\n])/xsm ) { my $le = $1; if ( defined $line_callback ) { $line_callback->( substr $line, 0, index( $line, $le ) + 1 ); } $line = substr $line, index( $line, $le ) + 1, length $line; } } } # Only allow the hup if sure an empty buffer has been read. if ( ( $condition & 'hup' ) # bit field operation. >= would also work and ( not defined $buffer or $buffer eq $EMPTY ) ) { if ( close $fh ) { $finished_callback->(); } elsif ( defined $error_callback ) { $error_callback->('Error closing filehandle'); } return Glib::SOURCE_REMOVE; } return Glib::SOURCE_CONTINUE; } ); return; }
cpanxaoc/gtk-perl-snippets
signals_mac_os-jeffrey_ratcliffe.2015-03-14.pl
Perl
apache-2.0
7,329
# 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::V10::Services::AdGroupLabelService::AdGroupLabelOperation; use strict; use warnings; use base qw(Google::Ads::GoogleAds::BaseEntity); use Google::Ads::GoogleAds::Utils::GoogleAdsHelper; sub new { my ($class, $args) = @_; my $self = { create => $args->{create}, remove => $args->{remove}}; # Delete the unassigned fields in this object for a more concise JSON payload remove_unassigned_fields($self, $args); bless $self, $class; return $self; } 1;
googleads/google-ads-perl
lib/Google/Ads/GoogleAds/V10/Services/AdGroupLabelService/AdGroupLabelOperation.pm
Perl
apache-2.0
1,081
# # Copyright 2021 Centreon (http://www.centreon.com/) # # Centreon is a full-fledged industry-strength solution that meets # the needs in IT infrastructure and application monitoring for # service performance. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # package network::dell::os10::snmp::mode::components::psu; use strict; use warnings; use network::dell::os10::snmp::mode::components::resources qw($map_oper_status); my $mapping = { os10PowerSupplyOperStatus => { oid => '.1.3.6.1.4.1.674.11000.5000.100.4.1.2.1.1.4', map => $map_oper_status }, }; sub load { my ($self) = @_; push @{$self->{request}}, { oid => $mapping->{os10PowerSupplyOperStatus}->{oid} }; } sub check { my ($self) = @_; $self->{output}->output_add(long_msg => "checking power supplies"); $self->{components}->{psu} = { name => 'psus', total => 0, skip => 0 }; return if ($self->check_filter(section => 'psu')); foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{ $mapping->{os10PowerSupplyOperStatus}->{oid} }})) { $oid =~ /^$mapping->{os10PowerSupplyOperStatus}->{oid}\.(.*)$/; my $instance = $1; my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{ $mapping->{os10PowerSupplyOperStatus}->{oid} }, instance => $instance); next if ($self->check_filter(section => 'psu', instance => $instance)); $self->{components}->{psu}->{total}++; $self->{output}->output_add( long_msg => sprintf( "power supply '%s' status is '%s' [instance: %s].", $instance, $result->{os10PowerSupplyOperStatus}, $instance ) ); my $exit = $self->get_severity(label => 'operational', section => 'psu', value => $result->{os10PowerSupplyOperStatus}); if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) { $self->{output}->output_add( severity => $exit, short_msg => sprintf( "power supply '%s' status is '%s'", $instance, $result->{os10PowerSupplyOperStatus} ) ); } } } 1;
Tpo76/centreon-plugins
network/dell/os10/snmp/mode/components/psu.pm
Perl
apache-2.0
2,761
# # You may distribute this module under the same terms as perl itself # # POD documentation - main docs before the code =pod =head1 NAME Bio::EnsEMBL::Compara::RunnableDB::ProteinTrees::OtherParalogs =cut =head1 SYNOPSIS my $db = Bio::EnsEMBL::Compara::DBAdaptor->new($locator); my $otherparalogs = Bio::EnsEMBL::Compara::RunnableDB::ProteinTrees::OtherParalogs->new ( -db => $db, -input_id => $input_id, -analysis => $analysis ); $otherparalogs->fetch_input(); #reads from DB $otherparalogs->run(); $otherparalogs->output(); $otherparalogs->write_output(); #writes to DB =cut =head1 DESCRIPTION This analysis will load a super protein tree alignment and insert the extra paralogs into the homology tables. =cut =head1 CONTACT Contact Albert Vilella on module implementation/design detail: avilella@ebi.ac.uk Contact Ewan Birney on EnsEMBL in general: birney@sanger.ac.uk =cut =head1 APPENDIX The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ =cut package Bio::EnsEMBL::Compara::RunnableDB::ProteinTrees::OtherParalogs; use strict; use Time::HiRes qw(time gettimeofday tv_interval); use Bio::EnsEMBL::Compara::Member; use Bio::EnsEMBL::Compara::Graph::Link; use Bio::EnsEMBL::Compara::Graph::Node; use Bio::EnsEMBL::Compara::MethodLinkSpeciesSet; use Bio::EnsEMBL::Compara::Homology; use base ('Bio::EnsEMBL::Compara::RunnableDB::BaseRunnable'); sub param_defaults { return { 'store_homologies' => 1, }; } =head2 fetch_input Title : fetch_input Usage : $self->fetch_input Function: Fetches input data from the database Returns : none Args : none =cut sub fetch_input { my $self = shift @_; my $protein_tree_id = $self->param('protein_tree_id') or die "'protein_tree_id' is an obligatory parameter"; my $protein_tree = $self->compara_dba->get_SuperProteinTreeAdaptor->fetch_node_by_node_id( $protein_tree_id ) or die "Could not fetch protein_tree with protein_tree_id='$protein_tree_id'"; $self->param('protein_tree', $protein_tree); $self->param('homology_adaptor', $self->compara_dba->get_HomologyAdaptor); } =head2 run Title : run Usage : $self->run Function: runs something Returns : none Args : none =cut sub run { my $self = shift @_; $self->run_otherparalogs; } =head2 write_output Title : write_output Usage : $self->write_output Function: stores something Returns : none Args : none =cut sub write_output { my $self = shift @_; $self->store_other_paralogs; } ########################################## # # internal methods # ########################################## sub run_otherparalogs { my $self = shift; my $tree = $self->param('protein_tree'); my $tmp_time = time(); my @all_protein_leaves = @{$tree->get_all_leaves}; printf("%1.3f secs to fetch all leaves\n", time()-$tmp_time) if ($self->debug); if($self->debug) { printf("%d proteins in tree\n", scalar(@all_protein_leaves)); } printf("build paralogs graph\n") if($self->debug); my @genepairlinks; my $graphcount = 0; my $tree_node_id = $tree->node_id; while (my $protein1 = shift @all_protein_leaves) { foreach my $protein2 (@all_protein_leaves) { next unless ($protein1->genome_db_id == $protein2->genome_db_id); my $genepairlink = new Bio::EnsEMBL::Compara::Graph::Link ( $protein1, $protein2, 0 ); $genepairlink->add_tag("tree_node_id", $tree_node_id); push @genepairlinks, $genepairlink; print STDERR "build graph $graphcount\n" if ($graphcount++ % 10 == 0); } } printf("%1.3f secs build links and features\n", time()-$tmp_time) if($self->debug>1); foreach my $genepairlink (@genepairlinks) { $self->other_paralog($genepairlink); } if($self->debug) { printf("%d pairings\n", scalar(@genepairlinks)); } $self->param('other_paralog_links', \@genepairlinks); return 1; } sub other_paralog { my $self = shift; my $genepairlink = shift; my ($pep1, $pep2) = $genepairlink->get_nodes; return undef unless($pep1->genome_db_id == $pep2->genome_db_id); $genepairlink->add_tag("orthotree_type", 'other_paralog'); $genepairlink->add_tag("orthotree_subtype", "Undetermined"); return 1; } sub store_other_paralogs { my $self = shift; $self->param('mlss_hash', {}); my $linkscount = 0; foreach my $genepairlink (@{$self->param('other_paralog_links')}) { my $homology = $self->store_gene_link_as_homology($genepairlink); print STDERR "homology links $linkscount\n" if ($linkscount++ % 500 == 0); } } sub store_gene_link_as_homology { my $self = shift; my $genepairlink = shift; my $type = $genepairlink->get_tagvalue('orthotree_type'); return unless($type); my $subtype = $genepairlink->get_tagvalue('orthotree_subtype'); my $tree_node_id = $genepairlink->get_tagvalue('tree_node_id'); warn("Tag tree_node_id undefined\n") unless(defined($tree_node_id) && $tree_node_id ne ''); my ($protein1, $protein2) = $genepairlink->get_nodes; # Check is stored as within_species_paralog my $member_id1 = $protein1->gene_member->member_id; my $member_id2 = $protein2->gene_member->member_id; my $stored_paralog = $self->param('homology_adaptor')->fetch_by_Member_id_Member_id($member_id1,$member_id2,1); return if ($stored_paralog); # Get or create method_link_species_set my $mlss = $self->param('mlss_hash')->{$protein1->genome_db->dbID}; if (!$mlss) { $mlss = new Bio::EnsEMBL::Compara::MethodLinkSpeciesSet; $mlss->method_link_type("ENSEMBL_PARALOGUES"); $mlss->species_set([$protein1->genome_db]); $mlss = $self->compara_dba->get_MethodLinkSpeciesSetAdaptor->store($mlss); $self->param('mlss_hash')->{$protein1->genome_db->dbID} = $mlss; } # create an Homology object my $homology = new Bio::EnsEMBL::Compara::Homology; $homology->description($type); $homology->subtype($subtype); # $homology->node_id($ancestor->node_id); $homology->ancestor_node_id($tree_node_id); $homology->tree_node_id($tree_node_id); $homology->method_link_type($mlss->method_link_type); $homology->method_link_species_set($mlss); #my $key = $mlss->dbID . "_" . $protein1->dbID; #$self->param('_homology_consistency')->{$key}{$type} = 1; #$homology->dbID(-1); # NEED TO BUILD THE Attributes (ie homology_members) my ($cigar_line1, $perc_id1, $perc_pos1, $cigar_line2, $perc_id2, $perc_pos2) = $self->generate_attribute_arguments($protein1, $protein2,$type); # QUERY member # my $attribute; $attribute = new Bio::EnsEMBL::Compara::Attribute; $attribute->peptide_member_id($protein1->dbID); $attribute->cigar_line($cigar_line1); $attribute->perc_cov(100); $attribute->perc_id(int($perc_id1)); $attribute->perc_pos(int($perc_pos1)); my $gene_member1 = $protein1->gene_member; $homology->add_Member_Attribute([$gene_member1, $attribute]); # # HIT member # $attribute = new Bio::EnsEMBL::Compara::Attribute; $attribute->peptide_member_id($protein2->dbID); $attribute->cigar_line($cigar_line2); $attribute->perc_cov(100); $attribute->perc_id(int($perc_id2)); $attribute->perc_pos(int($perc_pos2)); my $gene_member2 = $protein2->gene_member; $homology->add_Member_Attribute([$gene_member2, $attribute]); ## Check if it has already been stored, in which case we dont need to store again my $matching_homology = 0; if ($self->input_job->retry_count > 0) { my $member_id1 = $protein1->gene_member->member_id; my $member_id2 = $protein2->gene_member->member_id; if ($member_id1 == $member_id2) { my $tree_id = $self->param('protein_tree')->node_id; my $pmember_id1 = $protein1->member_id; my $pstable_id1 = $protein1->stable_id; my $pmember_id2 = $protein2->member_id; my $pstable_id2 = $protein2->stable_id; $self->throw("$member_id1 ($pmember_id1 - $pstable_id1) and $member_id2 ($pmember_id2 - $pstable_id2) shouldn't be the same"); } my $stored_homology_list = $self->param('homology_adaptor')->fetch_by_Member_id_Member_id($member_id1,$member_id2); if(my $stored_homology = $stored_homology_list && $stored_homology_list->[0]) { if( ($stored_homology->description ne $homology->description) or ($stored_homology->subtype ne $homology->subtype) or ($stored_homology->ancestor_node_id ne $homology->ancestor_node_id) or ($stored_homology->tree_node_id ne $homology->tree_node_id) or ($stored_homology->method_link_type ne $homology->method_link_type) or ($stored_homology->method_link_species_set->dbID ne $homology->method_link_species_set->dbID) ) { $matching_homology = 0; # Delete old one, then proceed to store new one: my $homology_id = $stored_homology->dbID; my $sql1 = "delete from homology where homology_id=$homology_id"; my $sql2 = "delete from homology_member where homology_id=$homology_id"; my $sth1 = $self->dbc->prepare($sql1); my $sth2 = $self->dbc->prepare($sql2); $sth1->execute; $sth2->execute; $sth1->finish; $sth2->finish; } else { $matching_homology = 1; } } } if($self->param('store_homologies') && 0 == $matching_homology) { print STDERR "Storing new paralogy\n" if ($self->debug); $self->param('homology_adaptor')->store($homology); } return $homology; } sub generate_attribute_arguments { my ($self, $protein1, $protein2, $type) = @_; my $new_aln1_cigarline = ""; my $new_aln2_cigarline = ""; my $perc_id1 = 0; my $perc_pos1 = 0; my $perc_id2 = 0; my $perc_pos2 = 0; my $identical_matches = 0; my $positive_matches = 0; my $m_hash = $self->get_matrix_hash; my ($aln1state, $aln2state); my ($aln1count, $aln2count); # my @aln1 = split(//, $protein1->alignment_string); # Speed up # my @aln2 = split(//, $protein2->alignment_string); my $alignment_string = $protein1->alignment_string; my @aln1 = unpack("A1" x length($alignment_string), $alignment_string); $alignment_string = $protein2->alignment_string; my @aln2 = unpack("A1" x length($alignment_string), $alignment_string); for (my $i=0; $i <= $#aln1; $i++) { next if ($aln1[$i] eq "-" && $aln2[$i] eq "-"); my ($cur_aln1state, $cur_aln2state) = qw(M M); if ($aln1[$i] eq "-") { $cur_aln1state = "D"; } if ($aln2[$i] eq "-") { $cur_aln2state = "D"; } if ($cur_aln1state eq "M" && $cur_aln2state eq "M" && $aln1[$i] eq $aln2[$i]) { $identical_matches++; $positive_matches++; } elsif ($cur_aln1state eq "M" && $cur_aln2state eq "M" && $m_hash->{uc $aln1[$i]}{uc $aln2[$i]} > 0) { $positive_matches++; } unless (defined $aln1state) { $aln1count = 1; $aln2count = 1; $aln1state = $cur_aln1state; $aln2state = $cur_aln2state; next; } if ($cur_aln1state eq $aln1state) { $aln1count++; } else { if ($aln1count == 1) { $new_aln1_cigarline .= $aln1state; } else { $new_aln1_cigarline .= $aln1count.$aln1state; } $aln1count = 1; $aln1state = $cur_aln1state; } if ($cur_aln2state eq $aln2state) { $aln2count++; } else { if ($aln2count == 1) { $new_aln2_cigarline .= $aln2state; } else { $new_aln2_cigarline .= $aln2count.$aln2state; } $aln2count = 1; $aln2state = $cur_aln2state; } } if ($aln1count == 1) { $new_aln1_cigarline .= $aln1state; } else { $new_aln1_cigarline .= $aln1count.$aln1state; } if ($aln2count == 1) { $new_aln2_cigarline .= $aln2state; } else { $new_aln2_cigarline .= $aln2count.$aln2state; } my $seq_length1 = $protein1->seq_length; unless (0 == $seq_length1) { $perc_id1 = $identical_matches*100.0/$seq_length1; $perc_pos1 = $positive_matches*100.0/$seq_length1; } my $seq_length2 = $protein2->seq_length; unless (0 == $seq_length2) { $perc_id2 = $identical_matches*100.0/$seq_length2; $perc_pos2 = $positive_matches*100.0/$seq_length2; } # my $perc_id1 = $identical_matches*100.0/$protein1->seq_length; # my $perc_pos1 = $positive_matches*100.0/$protein1->seq_length; # my $perc_id2 = $identical_matches*100.0/$protein2->seq_length; # my $perc_pos2 = $positive_matches*100.0/$protein2->seq_length; return ($new_aln1_cigarline, $perc_id1, $perc_pos1, $new_aln2_cigarline, $perc_id2, $perc_pos2); } sub get_matrix_hash { my $self = shift; return $self->param('matrix_hash') if ($self->param('matrix_hash')); my $BLOSUM62 = "# Matrix made by matblas from blosum62.iij # * column uses minimum score # BLOSUM Clustered Scoring Matrix in 1/2 Bit Units # Blocks Database = /data/blocks_5.0/blocks.dat # Cluster Percentage: >= 62 # Entropy = 0.6979, Expected = -0.5209 A R N D C Q E G H I L K M F P S T W Y V B Z X * A 4 -1 -2 -2 0 -1 -1 0 -2 -1 -1 -1 -1 -2 -1 1 0 -3 -2 0 -2 -1 0 -4 R -1 5 0 -2 -3 1 0 -2 0 -3 -2 2 -1 -3 -2 -1 -1 -3 -2 -3 -1 0 -1 -4 N -2 0 6 1 -3 0 0 0 1 -3 -3 0 -2 -3 -2 1 0 -4 -2 -3 3 0 -1 -4 D -2 -2 1 6 -3 0 2 -1 -1 -3 -4 -1 -3 -3 -1 0 -1 -4 -3 -3 4 1 -1 -4 C 0 -3 -3 -3 9 -3 -4 -3 -3 -1 -1 -3 -1 -2 -3 -1 -1 -2 -2 -1 -3 -3 -2 -4 Q -1 1 0 0 -3 5 2 -2 0 -3 -2 1 0 -3 -1 0 -1 -2 -1 -2 0 3 -1 -4 E -1 0 0 2 -4 2 5 -2 0 -3 -3 1 -2 -3 -1 0 -1 -3 -2 -2 1 4 -1 -4 G 0 -2 0 -1 -3 -2 -2 6 -2 -4 -4 -2 -3 -3 -2 0 -2 -2 -3 -3 -1 -2 -1 -4 H -2 0 1 -1 -3 0 0 -2 8 -3 -3 -1 -2 -1 -2 -1 -2 -2 2 -3 0 0 -1 -4 I -1 -3 -3 -3 -1 -3 -3 -4 -3 4 2 -3 1 0 -3 -2 -1 -3 -1 3 -3 -3 -1 -4 L -1 -2 -3 -4 -1 -2 -3 -4 -3 2 4 -2 2 0 -3 -2 -1 -2 -1 1 -4 -3 -1 -4 K -1 2 0 -1 -3 1 1 -2 -1 -3 -2 5 -1 -3 -1 0 -1 -3 -2 -2 0 1 -1 -4 M -1 -1 -2 -3 -1 0 -2 -3 -2 1 2 -1 5 0 -2 -1 -1 -1 -1 1 -3 -1 -1 -4 F -2 -3 -3 -3 -2 -3 -3 -3 -1 0 0 -3 0 6 -4 -2 -2 1 3 -1 -3 -3 -1 -4 P -1 -2 -2 -1 -3 -1 -1 -2 -2 -3 -3 -1 -2 -4 7 -1 -1 -4 -3 -2 -2 -1 -2 -4 S 1 -1 1 0 -1 0 0 0 -1 -2 -2 0 -1 -2 -1 4 1 -3 -2 -2 0 0 0 -4 T 0 -1 0 -1 -1 -1 -1 -2 -2 -1 -1 -1 -1 -2 -1 1 5 -2 -2 0 -1 -1 0 -4 W -3 -3 -4 -4 -2 -2 -3 -2 -2 -3 -2 -3 -1 1 -4 -3 -2 11 2 -3 -4 -3 -2 -4 Y -2 -2 -2 -3 -2 -1 -2 -3 2 -1 -1 -2 -1 3 -3 -2 -2 2 7 -1 -3 -2 -1 -4 V 0 -3 -3 -3 -1 -2 -2 -3 -3 3 1 -2 1 -1 -2 -2 0 -3 -1 4 -3 -2 -1 -4 B -2 -1 3 4 -3 0 1 -1 0 -3 -4 0 -3 -3 -2 0 -1 -4 -3 -3 4 1 -1 -4 Z -1 0 0 1 -3 3 4 -2 0 -3 -3 1 -1 -3 -1 0 -1 -3 -2 -2 1 4 -1 -4 X 0 -1 -1 -1 -2 -1 -1 -1 -1 -1 -1 -1 -1 -1 -2 0 0 -2 -1 -1 -1 -1 -1 -4 * -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 -4 1 "; my $matrix_string; my @lines = split(/\n/,$BLOSUM62); foreach my $line (@lines) { next if ($line =~ /^\#/); if ($line =~ /^[A-Z\*\s]+$/) { $matrix_string .= sprintf "$line\n"; } else { my @t = split(/\s+/,$line); shift @t; # print scalar @t,"\n"; $matrix_string .= sprintf(join(" ",@t)."\n"); } } my %matrix_hash; @lines = (); @lines = split /\n/, $matrix_string; my $lts = shift @lines; $lts =~ s/^\s+//; $lts =~ s/\s+$//; my @letters = split /\s+/, $lts; foreach my $letter (@letters) { my $line = shift @lines; $line =~ s/^\s+//; $line =~ s/\s+$//; my @penalties = split /\s+/, $line; die "Size of letters array and penalties array are different\n" unless (scalar @letters == scalar @penalties); for (my $i=0; $i < scalar @letters; $i++) { $matrix_hash{uc $letter}{uc $letters[$i]} = $penalties[$i]; } } return $self->param('matrix_hash', \%matrix_hash); } 1;
adamsardar/perl-libs-custom
EnsemblAPI/ensembl-compara/modules/Bio/EnsEMBL/Compara/RunnableDB/ProteinTrees/OtherParalogs.pm
Perl
apache-2.0
15,968
/* % File used as storage place for all predicates which change as % the world is run. % % props(Obj,height(ObjHt)) == k(height,Obj,ObjHt) == rdf(Obj,height,ObjHt) == height(Obj,ObjHt) % padd(Obj,height(ObjHt)) == padd(height,Obj,ObjHt,...) == add(QueryForm) % kretract[all](Obj,height(ObjHt)) == kretract[all](Obj,height,ObjHt) == pretract[all](height,Obj,ObjHt) == del[all](QueryForm) % keraseall(AnyTerm). % % % Dec 13, 2035 % Douglas Miles */ % File: /opt/PrologMUD/pack/logicmoo_base/prolog/logicmoo/mpred/mpred_kb_ops.pl %:- if(( ( \+ ((current_prolog_flag(logicmoo_include,Call),Call))) )). :- if(current_prolog_flag(xref,true)). :- module(mpred_kb_ops,[]). :- include('mpred_header.pi'). :- endif. %:- user:use_module(library(clpfd),['#='/2]). %% get_arity( :TermTerm, ?F, ?A) is semidet. % % Get Arity. % get_arity(Term,F,A):- atom(Term),F=Term,!,ensure_arity(F,A). get_arity(F/A,F,A):-!,atom(F),ensure_arity(F,A),!,(A>0). get_arity('//'(F , A),F,A2):- must(integer(A)),!, atom(F), is(A2 , A+2), ensure_arity(F,A2),!,(A2>0). get_arity('//'(F , A),F,A2):- use_module(library(clpfd),['#='/2]),!, atom(F), clpfd:call('#='(A2 , A+2)), ensure_arity(F,A2),!,(A2>0). get_arity(M:FA,F,A):-atom(M),!,get_arity(FA,F,A). get_arity(FA,F,A):- get_functor(FA,F,A),must(A>0). % arity_no_bc(F,A):- call_u(arity(F,A)). arity_no_bc(F,A):- clause_b(arity(F,A)). arity_no_bc(F,A):- clause_b(support_hilog(F,A)). arity_no_bc(F,A):- clause_b(functorDeclares(F)),!,A=1. arity_no_bc(completeExtentAsserted,1). arity_no_bc(home,2). arity_no_bc(record,2). arity_no_bc(F,A):- suggest_m(M),clause_b(mpred_prop(M,F,AA,_)),nonvar(AA),A=AA. %arity_no_bc(F,A):- current_predicate(F/A) % arity_no_bc(F,A):- current_predicate(_:F/A),\+(current_predicate(_:F/AA),AA\=A). = %% ensure_arity( ?VALUE1, ?VALUE2) is semidet. % % Ensure Arity. % ensure_arity(F,A):- one_must( arity_no_bc(F,A), one_must( (current_predicate(F/A),(A>0),assert_arity(F,A)), (ground(F:A),(A>0),assert_arity(F,A)))), !. %= %% assert_arity( ?F, :PRED2A) is semidet. % % Assert Arity. % assert_arity(F,A):- sanity(\+ ((bad_arity(F,A), trace_or_throw(assert_arity(F,A))))), arity_no_bc(F,A),!. assert_arity(F,A):- arity_no_bc(F,AA), A\=AA,dmsg_pretty(assert_additional_arity(F,AA->A)),!,ain_fast(arity(F,A)). assert_arity(F,A):- ain_fast(arity(F,A)),!. bad_arity(F,_):- \+ atom(F). bad_arity(_,A):- \+ integer(A). bad_arity('[|]',_). bad_arity(typeProps,0). bad_arity(argIsa,2). bad_arity(isEach,_). bad_arity(_,0). bad_arity(prologDynamic,2). bad_arity(F,A):- \+ good_pred_relation_name(F,A). %= %% good_pred_relation_name( ?F, ?A) is semidet. % % Good Predicate Relation Name. % good_pred_relation_name(F,A):- \+ bad_pred_relation_name0(F,A). %= %% bad_pred_relation_name0( ?V, ?VALUE2) is semidet. % % Bad Predicate Relation Name Primary Helper. % bad_pred_relation_name0(V,_):- \+ atom(V),!. bad_pred_relation_name0('[]',_). bad_pred_relation_name0('',_). bad_pred_relation_name0('!',_). bad_pred_relation_name0('{}',_). bad_pred_relation_name0(',',_). bad_pred_relation_name0('[|]',_). %= %% bad_pred_relation_name1( ?X, ?Y) is semidet. % % Bad Predicate Relation Name Secondary Helper. % bad_pred_relation_name1(X,Y):-bad_pred_relation_name0(X,Y). bad_pred_relation_name1(F,A):-must_det((atom_codes(F,[C|_]),to_upper(C,U))),!, U == C, A>1. bad_pred_relation_name1(F,A):-arity_no_bc(F,AO), A \= AO. % :-after_boot(writeq("Seen Mpred_props at start!\n")),!. %= %% functor_check_univ( ?G1, ?F, ?List) is semidet. % % Functor Check Univ. % functor_check_univ(M:G1,F,List):-atom(M),member(M,[dbase,user]),!,functor_check_univ(G1,F,List),!. functor_check_univ(G1,F,List):-must_det(compound(G1)),must_det(G1 \= _:_),must_det(G1 \= _/_),G1=..[F|List],!. %:- endif. % :- ensure_loaded(library('logicmoo/util/logicmoo_util_bugger.pl')). %:- ensure_loaded(pfc_lib). %:- use_module(mpred_type_isa). %:- use_module(library(util_varnames)). /* :- module_transparent retract_mu/1, assert_mu/4, asserta_mu/2, assertz_mu/2, assert_u/1, asserta_u/1, assertz_u/1, attempt_side_effect/1. */ :- module_transparent(attvar_op/2). :- meta_predicate pred_head(1,*), attempt_side_effect(+), call_s(*), oncely(*), naf(*), call_s2(*), mpred_update_literal(*,*,0,*), mpred_retry(*), % mpred_op(?, ?), mpred_facts_only(*), map_unless(1,:,*,*), pfc_is_callable(*), % deducedSimply(*), cnstrn0(*,+), cnstrn(*), cnstrn(+,*), attvar_op(*,*), % clause_u(+,+,-), % call_u(+), assertz_mu(*), assertz_mu(*,+), if_missing1(*), assert_mu(+), assert_mu(+,+,+,+), ain_minfo_2(1,*), ain_minfo(1,*), % whenAnd(0,0), % mpred_call_0(*), mpred_bc_only(*), mpred_bc_only0(*), mpred_prove_neg(*), call_u_req(*), pfcBC_NoFacts(*). :- meta_predicate mpred_get_support_one(0,*). :- meta_predicate mpred_get_support_precanonical_plus_more(0,*). % :- meta_predicate '__aux_maplist/2_cnstrn0+1'(*,0). :- meta_predicate repropagate_0(*). :- meta_predicate trigger_supporters_list(0,*). :- meta_predicate repropagate_meta_wrapper(*). :- meta_predicate repropagate_0(*). % oncely later will throw an error if there where choice points left over by call :- meta_predicate(oncely(*)). :- was_export(oncely/1). %% oncely( :Goal) is semidet. % % Oncely. % oncely(:-(Call)):-!,Call,!. oncely(:-(Call)):-!,call_u(Call). oncely(Call):-once(Call). % ================================================ % mpred_op/2 % ================================================ /* query(t, call_u, G):- call_u(G). query(_, _, Op, G):- dtrace(call_u(call(Op,G))). once(A,B,C,D):-trace_or_throw(once(A,B,C,D)). */ % ================================================ % pfc_is_callable/call_u/naf % ================================================ %:- was_dynamic(naf/1). :- meta_predicate(naf(*)). :- was_export(naf/1). %% naf( :Goal) is semidet. % % Negation-By-Faliure. % naf(Goal):- (\+ call_u(Goal)). :- meta_predicate(pfc_is_callable(*)). :- was_export(pfc_is_callable/1). %% pfc_is_callable( :GoalC) is semidet. % % If Is A Callable. % pfc_is_callable(C):-current_predicate(_,C),!. :- style_check(+singleton). % TODO READD %:- foreach(arg(_,isEach(prologMultiValued,prologOrdered,prologNegByFailure,prologPTTP,prologKIF,pfcControlled,ttRelationType, % prologHybrid,predCanHaveSingletons,prologDynamic,prologBuiltin,functorIsMacro,prologListValued,prologSingleValued),P),.. ) % TODO ISSUE https://github.com/logicmoo/PrologMUD/issues/7 %% check_context_module is semidet. % % Check Context Module. (throws if it turns out wrong) % check_context_module:- !. % check_context_module:- is_release,!. check_context_module:- sanity((source_context_module(M1),clause_b(mtHybrid(M1)))), sanity((defaultAssertMt(M2),clause_b(mtHybrid(M2)))). %% check_real_context_module is semidet. % % Check Real Context Module (throws if it turns out wrong) % check_real_context_module:- is_release,!. check_real_context_module:-!. check_real_context_module:- sanity((context_module(M1),defaultAssertMt(M2),must(M1==M2))). % ======================= mpred_file('pfcsyntax'). % operator declarations. :- op(1199,fx,('==>')), op(1190,xfx,('::::')), op(1180,xfx,('==>')), op(1170,xfx,'<==>'), op(1160,xfx,('<-')), op(1150,xfx,'=>'), op(1140,xfx,'<='), op(1130,xfx,'<=>'), op(600,yfx,'&'), op(600,yfx,'v'), op(350,xfx,'xor'), op(300,fx,'~'), op(300,fx,'-'). %% mreq( +G) is semidet. % % Mreq. % mreq(G):- if_defined(call_u(G),fail). % ======================= mpred_file('pfccore'). % core of Pfc. % File : pfccore.pl % Author : Tim Finin, finin@prc.unisys.com % Updated: 10/11/87, ... % 4/2/91 by R. McEntire: added calls to valid_dbref as a % workaround for the Quintus 3.1 % bug in the recorded database. % Purpose: core Pfc predicates. /* LogicMOO is mixing Mark Stickel's PTTP (prolog techn theorem prover) to create horn clauses that PFC forwards and helps maintain in visible states ) in prolog knowledge baseable.. We use '$spft'/4 to track deductions Research~wise LogicMOO has a main purpose is to prove that grounded negations (of contrapostives) are of first class in importance in helping with Wff checking/TMS Also alows an inference engine constrain search.. PFC became important since it helps memoize and close off (terminate) transitive closures */ %% is_side_effect_disabled is semidet. % % If Is A Side Effect Disabled. % is_side_effect_disabled:- t_l:no_attempt_side_effects,!. is_side_effect_disabled:- t_l:side_effect_ok,!,fail. is_side_effect_disabled:- t_l:noDBaseMODs(_),!. %% f_to_mfa( +EF, ?R, ?F, ?A) is semidet. % % Functor Converted To Module-functor-arity. % f_to_mfa(EF,R,F,A):-w_get_fa(EF,F,A), (((current_predicate(F/A),functor(P,F,A),predicate_property(_M:P,imported_from(R)))*->true; current_predicate(F/A),functor(P,F,A),source_file(R:P,_SF))), current_predicate(R:F/A). %% w_get_fa( +PI, ?F, ?A) is semidet. % % W Get Functor-arity. % w_get_fa(PI,_F,_A):-is_ftVar(PI),!. w_get_fa(F/A,F,A):- !. w_get_fa(PI,PI,_A):- atomic(PI),!. w_get_fa(PI,F,A):- is_ftCompound(PI),!,functor(PI,F,A). w_get_fa(Mask,F,A):-get_functor(Mask,F,A). :- multifile(baseKB:mpred_hook_rescan_files/0). :- dynamic(baseKB:mpred_hook_rescan_files/0). :- use_module(library(logicmoo_common)). %:- was_dynamic(use_presently/0). % used to annotate a predciate to indicate PFC support %% is_mpred_action( :TermP) is semidet. % % If Is A Managed Predicate Action. % is_mpred_action('$VAR'(_)):-!,fail. is_mpred_action(remove_if_unsupported(_,_)). is_mpred_action(P):-is_static_predicate(P). %% mpred_is_builtin( +P) is semidet. % % PFC If Is A Builtin. % mpred_is_builtin(P):- predicate_property(P,built_in), \+ predicate_property(P,dynamic). mpred_is_builtin(P):- callable(P),functor(P,F,_),clause_b(prologBuiltin(F)). mpred_is_builtin(F):- current_predicate(F/A),A>0,functor(P,F,A),mpred_is_builtin(P). /* UNUSED TODAY :- use_module(library(mavis)). :- use_module(library(type_check)). :- use_module(library(typedef)). */ :- thread_local((t_l:use_side_effect_buffer/0 , t_l:verify_side_effect_buffer/0)). %% record_se is semidet. % % Record Se. % record_se:- (t_l:use_side_effect_buffer ; t_l:verify_side_effect_buffer). %% add_side_effect( +Op, ?Data) is semidet. % % Add Side Effect. % add_side_effect(_,_):- ( \+ record_se ),!. add_side_effect(Op,Data0):- current_why(Why),serialize_attvars(Data0,Data),assert(t_l:side_effect_buffer(Op,Data,Why)). %% attvar_op( +:PRED1, ?Data) is semidet. % % Attribute Variable Oper.. % listing_s(P):-call_s(xlisting(P)). assert_s(H):- assertz_s(H). retractall_s(H):- forall(clause_s(H,_,R),erase(R)). clause_s(H,B):- clause_s(H,B,_). retract_s(H):- lookup_s(H,R),erase(R). lookup_s(H):- lookup_s(H,_). lookup_s(M:(H:-B),R):- !,clause_s(M:H,B,R). lookup_s((H:-B),R):- !,clause_s(H,B,R). lookup_s(H,R):- clause_s(H,true,R). lookq_s(X):-lookq_s(X,_Ref). lookq_s(M:(H:-B),R):- !,clauseq_s(M:H,B,R). lookq_s((H:-B),R):- !, clauseq_s(H,B,R). lookq_s(H,R):- clauseq_s(H,true,R). asserta_s(H):- fix_mp(clause(assert,asserta_s),H,M,H0),asserta_i(M:H0). assertz_s(H):- fix_mp(clause(assert,assertz_s),H,M,H0),assertz_i(M:H0). clause_s(H,B,R):- fix_mp(clause(clause,clause_s),H,M,H0),clause_u(M:H0,B,R). clauseq_s(H,B,R):- fix_mp(clause(clause,clauseq_s),H,M,H0),clause_u(M:H0,B,R),clause(M:HC,BC,R),H0=@=HC,BC=@=B. call_s(G0):- strip_module(G0,_,G),functor(G,F,A), (memberchk(F/A,[(',')/2])-> mpred_METACALL(call_s,G); call_s2(G0)). call_s2(G0):- strip_module(G0,WM,G), defaultAssertMt(U), must(current_predicate(_,U:G)->(CALL=U:G);(current_predicate(_,WM:G0)->CALL=WM:G0; fail)), call(call,( '$set_source_module'(S,U),'$module'(M,U), setup_call_cleanup( % _each ('$set_source_module'(U),'$set_typein_module'(U)), call(CALL), ('$set_source_module'(S),'$set_typein_module'(M))))). :- module_transparent(attvar_op/2). % % attvar_op(Op,Data):- deserialize_attvars(Data,Data0), attvar_op(Op,Data0). attvar_op(Op,MData):- must_det_l(( strip_module(Op,_,OpA), sanity( \+ atom(OpA)), fix_mp(clause(assert,OpA),MData,M,Data), add_side_effect(OpA,M:Data), quietly(current_prolog_flag(assert_attvars,true)->deserialize_attvars(Data,Data0);Data=Data0))),!, attempt_side_effect_mpa(M,OpA,Data0). :- thread_local(t_l:no_attempt_side_effects/0). %% attempt_side_effect( +PSE) is semidet. % % Physical Side Effect. % attempt_side_effect(PSE):- to_physical_mpa(PSE,M,P,A),!,attempt_side_effect_mpa(M,P,A). to_physical_mpa(PSE,M,P,A):- strip_module(PSE,M,PA),to_physical_pa(PA,P,A). to_physical_pa(PA,P,A):-PA=..[P,A],!. to_physical_pa(PA,call,PA). :- meta_predicate(db_op_call(*,1,?)). db_op_call(_What,How,Data):- call(How,Data). % attempt_side_effect_mpa(M,OpA,Data):- record_se,!,add_side_effect(OpA,M:Data). attempt_side_effect_mpa(M,db_op_call(_,retract_u0),Data0):- \+ lookup_u(M:Data0),!,fail. attempt_side_effect_mpa(M,OpA,Data0):- \+ record_se, is_side_effect_disabled,!,mpred_warn('no_attempt_side_effects ~p',[attempt_side_effect_mpa(M,OpA,Data0)]). % @TODO BROKEN phys ical_side_effect_call(M,assertz_i,Data0):- must((compile_aux_clauses(M:Data0))),!. attempt_side_effect_mpa(M,OpA,Data0):- show_failure(M:call(M:OpA,M:Data0)). /* b_setval(th_asserts,[]), call_u(G), b_getval(th_asserts,List). attempt_side_effect_mpa(C) :- b_getval(th_asserts,List), b_setval(th_asserts,[C|List]),!. */ %% erase_w_attvars( +Data0, ?Ref) is semidet. % % Erase W Attribute Variables. % erase_w_attvars(Data0,Ref):- attempt_side_effect(erase(Ref)),add_side_effect(erase,Data0). %% mpred_nochaining( +Goal) is semidet. % % PFC No Chaining. % mpred_nochaining(Goal):- locally_tl(no_attempt_side_effects,call(Goal)). %% with_chaining( +Goal) is semidet. % % PFC No Chaining. % with_chaining(Goal):- locally(- t_l:no_attempt_side_effects,call(Goal)). % TODO ISSUE https://github.com/logicmoo/PrologMUD/issues/7 %% match_source_ref1( :TermARG1) is semidet. % % Match Source Ref Secondary Helper. % match_source_ref1(ax):-!. match_source_ref1(mfl4(_VarNameZ,_,_,_)). %% make_uu_remove( :TermU) is semidet. % % Make Uu Remove. % make_uu_remove((_,ax)). %% has_functor( :TermC) is semidet. % % Has Functor. % % -- % has_functor(_):-!,fail. has_functor(F/A):-!,is_ftNameArity(F,A),!. has_functor(C):- (\+ is_ftCompound(C)),!,fail. has_functor(C):- is_ftCompound(C),\+is_list(C). %% mpred_each_literal( +P, ?E) is semidet. % % PFC Each Literal. % mpred_each_literal(P,E):-is_ftNonvar(P),P=(P1,P2),!,(mpred_each_literal(P1,E);mpred_each_literal(P2,E)). mpred_each_literal(P,P). %:-conjuncts_to_list(P,List),member(E,List). %% retract_eq_quitely( +H) is semidet. % % Retract Using (==/2) (or =@=/2) ) Quitely. % retract_eq_quitely(H):- call_u(retract_eq_quitely_f(H)). %% retract_eq_quitely_f( +H) is semidet. % % Retract Using (==/2) (or =@=/2) ) Quitely False. % retract_eq_quitely_f((H:-B)):- !,clause_asserted_i(H,B,Ref),erase(Ref). retract_eq_quitely_f(pfclog(H)):- retract_eq_quitely_f(H),fail. retract_eq_quitely_f((H)):- clause_asserted_i(H,true,Ref),erase(Ref). %% assert_eq_quitely( +H) is semidet. % % Assert Using (==/2) (or =@=/2) ) Quitely. % assert_eq_quitely(H):- attvar_op(db_op_call(assert,assert_if_new),H). %% mpred_is_tautology( +Var) is semidet. % % PFC If Is A Tautology. % % :- module_transparent( (mpred_is_tautology)/1). mpred_is_tautology(V):- (is_ftVar(V) -> true;(copy_term_nat(V,VC),numbervars(VC),mpred_is_taut(VC))),!. %% mpred_is_taut( :TermA) is semidet. % % PFC If Is A Taut. % mpred_is_taut(A):-var(A),!. mpred_is_taut(A:-B):-!,mpred_is_taut(B==>A). mpred_is_taut(A<-B):-!,mpred_is_taut(B==>A). mpred_is_taut(A<==>B):-!,(mpred_is_taut(A==>B);mpred_is_taut(B==>A)). mpred_is_taut(A==>B):- A==B,!. mpred_is_taut((B,_)==>A):- mpred_is_assertable(B),mpred_is_taut(A==>B),!. mpred_is_taut((_,B)==>A):- mpred_is_assertable(B),mpred_is_taut(A==>B),!. mpred_is_taut(B==>(A,_)):- mpred_is_assertable(A),mpred_is_taut(A==>B),!. mpred_is_taut(B==>(_,A)):- mpred_is_assertable(A),mpred_is_taut(A==>B),!. % baseKB:decl_database_hook(Op,Hook):- loop_check_nr(pfc_provide_storage_op(Op,Hook)). %% is_retract_first( +VALUE1) is semidet. % % If Is A Retract First. % is_retract_first(one). is_retract_first(a). %% pfc_provide_storage_op( +Op, ?I1) is semidet. % % Prolog Forward Chaining Provide Storage Oper.. % pfc_provide_storage_op(Op,(I1,I2)):-!,pfc_provide_storage_op(Op,I1),pfc_provide_storage_op(Op,I2). pfc_provide_storage_op(Op,(nesc(P))):-!,pfc_provide_storage_op(Op,P). %pfc_provide_storage_op(change(assert,_AorZ),Fact):- loop_check_nr(ainPreTermExpansion(Fact)). % pfcRem1 to just get the first pfc_provide_storage_op(change(retract,OneOrA),FactOrRule):- is_retract_first(OneOrA),!, loop_check_nr(mpred_withdraw(FactOrRule)), ignore((ground(FactOrRule),mpred_remove(FactOrRule))). % mpred_remove should be forcefull enough pfc_provide_storage_op(change(retract,all),FactOrRule):- loop_check_nr(mpred_remove(FactOrRule)),!. % pfc_provide_storage_op(clause_u,FactOrRule):- is_ftNonvar(FactOrRule),!,loop_check_nr(clause_u(FactOrRule)). % pfcDatabaseGoal(G):-is_ftCompound(G),get_functor(G,F,A),pfcDatabaseTerm(F/A). %% mpred_pbody( +H, ?B, ?R, ?BIn, ?WHY) is semidet. % % PFC Pbody. % %mpred_pbody(H,B,_R,fail,deduced(backchains)):- get_bc_clause(H,_H,B),!. %mpred_pbody(H,infoF(INFO),R,B,Why):-!,mpred_pbody_f(H,INFO,R,B,Why). %mpred_pbody(H,B,R,BIn,WHY):- is_src_true(B),!,BIn=B,get_why(H,H,R,WHY). %mpred_pbody(H,B,R,B,asserted(R,(H:-B))). %% get_why( +VALUE1, ?CL, ?R, :TermR) is semidet. % % Get Generation Of Proof. % get_why(_,CL,R,asserted(R,CL:-U)):- get_mz(MZ), clause_u('$spft'(MZ,CL, U, ax),true),!. get_why(H,CL,R,deduced(R,WHY)):- (mpred_get_support(H,WH)*->WHY=(H=WH);(mpred_get_support(CL,WH),WHY=(CL=WH))). %% mpred_pbody_f( +H, ?CL, ?R, ?B, ?WHY) is semidet. % % PFC Pbody False. % mpred_pbody_f(H,CL,R,B,WHY):- CL=(B==>HH),sub_term_eq(H,HH),!,get_why(H,CL,R,WHY). mpred_pbody_f(H,CL,R,B,WHY):- CL=(HH<-B),sub_term_eq(H,HH),!,get_why(H,CL,R,WHY). mpred_pbody_f(H,CL,R,B,WHY):- CL=(HH<==>B),sub_term_eq(H,HH),get_why(H,CL,R,WHY). mpred_pbody_f(H,CL,R,B,WHY):- CL=(B<==>HH),sub_term_eq(H,HH),!,get_why(H,CL,R,WHY). mpred_pbody_f(H,CL,R,fail,infoF(CL)):- trace_or_throw(mpred_pbody_f(H,CL,R)). %% sub_term_eq( +H, ?HH) is semidet. % % Sub Term Using (==/2) (or =@=/2) ). % sub_term_eq(H,HH):-H==HH,!. sub_term_eq(H,HH):-each_subterm(HH,ST),ST==H,!. %% sub_term_v( +H, ?HH) is semidet. % % Sub Term V. % sub_term_v(H,HH):-H=@=HH,!. sub_term_v(H,HH):-each_subterm(HH,ST),ST=@=H,!. %% all_different_head_vals(+Clause) is det. % % Enforces All Different Head Vals. % all_different_head_vals(HB):- (\+ compound(HB) ; ground(HB)),!. all_different_head_vals(HB):- mpred_rule_hb(HB,H,B), term_slots(H,Slots), (Slots==[]-> all_different_head_vals(B); (lock_vars(Slots),all_different_head_vals_2(H,Slots),unlock_vars(Slots))),!. all_different_head_vals_2(_H,[]):-!. all_different_head_vals_2(H,[A,R|EST]):-get_assertion_head_arg(_,H,E1),E1 ==A,dif(A,E2),get_assertion_head_arg(_,H,E2),\+ contains_var(A,E2),all_different_vals(dif_matrix,[A,E2,R|EST]),!. all_different_head_vals_2(_H,[A,B|C]):-all_different_vals(dif_matrix,[A,B|C]),!. all_different_head_vals_2(HB,_):- \+ compound(HB),!. all_different_head_vals_2(H,[A]):-get_assertion_head_arg(_,H,E1),E1 ==A, H=..[_|ARGS], all_different_vals(dif_matrix,ARGS),!. all_different_head_vals_2(H,[A]):-get_assertion_head_arg(_,H,E1),E1 ==A, get_assertion_head_arg(_,H,E2), A\==E2, \+ contains_var(A,E2), dif(A,E2),!. all_different_head_vals_2(H,[A]):-get_assertion_head_arg(_,H,E1),E1\==A, compound(E1), contains_var(A,E1), all_different_head_vals_2(E1,[A]),!. all_different_head_vals_2(_,_). %% mpred_rule_hb( +Outcome, ?OutcomeO, ?AnteO) is semidet. % % Calculate PFC Rule Head+body. % mpred_rule_hb(Outcome,OutcomeO,Body):- nonvar(OutcomeO),!,mpred_rule_hb(Outcome,OutcomeN,Body),must(OutcomeO=OutcomeN). mpred_rule_hb(Outcome,OutcomeO,BodyO):- nonvar(BodyO),!,mpred_rule_hb(Outcome,OutcomeO,BodyN),must(BodyN=BodyO). mpred_rule_hb(Outcome,OutcomeO,AnteO):- quietly((mpred_rule_hb_0(Outcome,OutcomeO,Ante), mpred_rule_hb_0(Ante,AnteO,_))). % :-mpred_trace_nochilds(mpred_rule_hb/3). %% mpred_rule_hb_0( +Rule, -Head, -Body) is nondet. % % Calculate PFC rule Head+Body Primary Helper. % mpred_rule_hb_0(Outcome,OutcomeO,true):-is_ftVar(Outcome),!,OutcomeO=Outcome. mpred_rule_hb_0(Outcome,OutcomeO,true):- \+compound(Outcome),!,OutcomeO=Outcome. mpred_rule_hb_0((Outcome1,Outcome2),OutcomeO,AnteO):- mpred_rule_hb(Outcome1,Outcome1O,Ante1),mpred_rule_hb(Outcome2,Outcome2O,Ante2), conjoin(Outcome1O,Outcome2O,OutcomeO), conjoin(Ante1,Ante2,AnteO). mpred_rule_hb_0((Ante1==>Outcome),OutcomeO,(Ante1,Ante2)):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0((Ante1=>Outcome),OutcomeO,(Ante1,Ante2)):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0((Ante1->Outcome),OutcomeO,(Ante1,Ante2)):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0((Ante1*->Outcome),OutcomeO,(Ante1,Ante2)):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). % mpred_rule_hb_0((Outcome/Ante1),OutcomeO,(Ante1,Ante2)):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0(rhs([Outcome]),OutcomeO,Ante2):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). % mpred_rule_hb_0(rhs([OutcomeH|OutcomeT]),OutcomeO,Ante2):- !, mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0({Outcome},OutcomeO,Ante2):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0((Outcome<-Ante1),OutcomeO,(Ante1,Ante2)):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0((Ante1 & Outcome),OutcomeO,(Ante1,Ante2)):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0((Ante1 , Outcome),OutcomeO,(Ante1,Ante2)):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0((Outcome<==>Ante1),OutcomeO,(Ante1,Ante2)):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0((Ante1<==>Outcome),OutcomeO,(Ante1,Ante2)):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0(_::::Outcome,OutcomeO,Ante2):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb_0(Outcome,OutcomeO,Ante2). mpred_rule_hb_0('$bt'(Outcome,Ante1),OutcomeO,(Ante1,Ante2)):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0('$pt'(_MZ,Ante1,Outcome),OutcomeO,(Ante1,Ante2)):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0(pk(Ante1a,Ante1b,Outcome),OutcomeO,(Ante1a,Ante1b,Ante2)):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0('$nt'(Ante1a,Ante1b,Outcome),OutcomeO,(Ante1a,Ante1b,Ante2)):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0('$spft'(_MZ,Outcome,Ante1a,Ante1b),OutcomeO,(Ante1a,Ante1b,Ante2)):- (nonvar(Outcome)-> ! ; true),mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0(que(Outcome,_),OutcomeO,Ante2):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). % mpred_rule_hb_0(pfc Default(Outcome),OutcomeO,Ante2):- (nonvar(Outcome)-> ! ; true), mpred_rule_hb(Outcome,OutcomeO,Ante2). mpred_rule_hb_0((Outcome:-Ante),Outcome,Ante):-(nonvar(Outcome)-> ! ; true). mpred_rule_hb_0(Outcome,Outcome,true). %% ain_minfo( +G) is semidet. % % Assert If New Metainformation. % :- module_transparent(ain_minfo/1). ain_minfo(G):-ain_minfo(assertz_if_new,G). %% ain_minfo( :PRED1How, ?H) is semidet. % % Assert If New Metainformation. % :- module_transparent(ain_minfo/2). ain_minfo(How,(H:-True)):-is_src_true(True),must(is_ftNonvar(H)),!,ain_minfo(How,H). ain_minfo(How,(H<-B)):- !,ain_minfo(How,(H:-infoF(H<-B))),!,get_bc_clause(H,Post),ain_minfo(How,Post),ain_minfo_2(How,(B:-infoF(H<-B))). ain_minfo(How,(B==>H)):- !,ain_minfo(How,(H:-infoF(B==>H))),!,ain_minfo_2(How,(B:-infoF(B==>H))). ain_minfo(How,(B<==>H)):- !,ain_minfo(How,(H:-infoF(B<==>H))),!,ain_minfo(How,(B:-infoF(B<==>H))),!. ain_minfo(How,((A,B):-INFOC)):-mpred_is_info(INFOC),(is_ftNonvar(A);is_ftNonvar(B)),!,ain_minfo(How,((A):-INFOC)),ain_minfo(How,((B):-INFOC)),!. ain_minfo(How,((A;B):-INFOC)):-mpred_is_info(INFOC),(is_ftNonvar(A);is_ftNonvar(B)),!,ain_minfo(How,((A):-INFOC)),ain_minfo(How,((B):-INFOC)),!. ain_minfo(How,(-(A):-infoF(C))):-is_ftNonvar(C),is_ftNonvar(A),!,ain_minfo(How,((A):-infoF((C)))). % attvar_op(How,(-(A):-infoF(C))). ain_minfo(How,(~(A):-infoF(C))):-is_ftNonvar(C),is_ftNonvar(A),!,ain_minfo(How,((A):-infoF((C)))). % attvar_op(How,(-(A):-infoF(C))). ain_minfo(How,(A:-INFOC)):- is_ftNonvar(INFOC), get_bc_clause(A,AA,INFOCC),A=AA,INFOC==INFOCC,!,attvar_op(How,(A:-INFOC)),!. ain_minfo(How,'$bt'(H,_)):-!,get_bc_clause(H,Post),attvar_op(How,Post). ain_minfo(How,'$nt'(H,Test,Body)):-!,attvar_op(How,(H:-fail,'$nt'(H,Test,Body))). ain_minfo(How,'$pt'(MZ,H,Body)):-!,attvar_op(How,(H:-fail,'$pt'(MZ,H,Body))). ain_minfo(How,(A0:-INFOC0)):- mpred_is_info(INFOC0), copy_term_and_varnames((A0:-INFOC0),(A:-INFOC)),!,must((mpred_rewrap_h(A,AA), imploded_copyvars((AA:-INFOC),ALLINFO), attvar_op(How,(ALLINFO)))),!. %ain_minfo(How,G):-mpred_trace_msg(skipped_add_meta_facts(How,G)). ain_minfo(_,_). :- was_export(ain_minfo_2/2). %% ain_minfo_2( :PRED1How, ?G) is semidet. % % Assert If New Metainformation Extended Helper. % :- module_transparent(ain_minfo_2/2). ain_minfo_2(How,G):-ain_minfo(How,G). %% mpred_is_info( :TermC) is semidet. % % PFC If Is A Info. % mpred_is_info((CWC,Info)):- (atom(CWC),is_a_info(CWC));mpred_is_info(Info). mpred_is_info(mpred_bc_only(C)):-is_ftNonvar(C),!. mpred_is_info(infoF(C)):-is_ftNonvar(C),!. mpred_is_info(inherit_above(_,_)). is_a_info(fail). is_a_info(CWC):- is_pfc_chained(CWC). is_pfc_chained(cwc). is_pfc_chained(awc). is_pfc_chained(zwc). is_pfc_chained(fwc). is_pfc_chained(bwc). is_pfc_chained(wac). :- module_transparent(is_ain_clause/2). is_ain_clause( _, Var):- var(Var),!, fail. is_ain_clause( M,(:- Body)):- !, is_ain_body(M,Body),!. is_ain_clause( M,(P:- Body)):- !,(is_ain_head(M,P);is_ain_body(M,Body)),!. is_ain_clause( M,(P)):- !, is_ain_head(M, P). :- module_transparent(is_ain_head/2). is_ain_head(_, P):- var(P),!. is_ain_head(_,(_,_)):- !. is_ain_head(_,(_;_)):- !. is_ain_head(_,not(_)):- !. is_ain_head(_,\+(_)):- !. is_ain_head(M, P):- is_ain_body(M, P),!. is_ain_head(_,==>(_)):- !. is_ain_head(_,==>(_,_)):- !. is_ain_head(_,<==>(_,_)):- !. is_ain_head(_,<==(_)):- !. is_ain_head(_,<==(_,_)):- !. is_ain_head(_,'::::'(_,_)):- !. is_ain_head(baseKB,_). is_ain_head(_,=>(_)):- !. is_ain_head(_,=>(_,_)):- !. is_ain_head(_,_):- get_how_virtualize_file(Lang),!,Lang=heads. :- module_transparent(is_ain_body/2). is_ain_body(_, P):- var(P),!,fail. is_ain_body(M, (P,_)):- !, nonvar(P), is_ain_body(M, P). is_ain_body(_, CWC):- atom(CWC), is_pfc_chained(CWC). is_ain_body(M, P):- functor(P,F,A), \+ \+ mpred_prop(M,F,A,_), !, \+ (mpred_prop(M,F,A,Prop), is_pfc_prolog_only_prop(Prop)). is_ain_body(M, MP):- strip_module(MP,M2,P), M2\==M, !,is_ain_body(M2,P). is_pfc_prolog_only_prop(prologOnly). is_pfc_prolog_only_prop(prologBuiltin). %cwc(Call):- callable(Call),Call. %:- was_dynamic(not_not/1). %% mpred_rewrap_h( +A, ?A) is semidet. % % PFC Rewrap Head. % mpred_rewrap_h(A,A):- is_ftNonvar(A),\+ is_static_predicate(A). mpred_rewrap_h(A,F):- functor(A,F,_),\+ is_static_predicate(F),!. %mpred_rewrap_h(A,not_not(A)):-!. %% cwc is det. % % Cwc. % cwc:-true. %% fwc is det. % % Fwc. % fwc:-true. %% bwc is semidet. % % Bwc. % bwc:-true. %% wac is semidet. % % Wac. % wac:-true. awc:-true. zwc:-true. %% is_fc_body( +P) is semidet. % % If Is A Forward Chaining Body. % is_fc_body(P):- has_body_atom(fwc,P). %% is_bc_body( +P) is semidet. % % If Is A Backchaining Body. % is_bc_body(P):- has_body_atom(bwc,P). %% is_action_body( +P) is semidet. % % If Is A Action Body. % is_action_body(P):- has_body_atom(wac,P). %% has_body_atom( +WAC, ?P) is semidet. % % Has Body Atom. % has_body_atom(WAC,P):- call( WAC==P -> true ; (is_ftCompound(P),get_assertion_head_arg(1,P,E),has_body_atom(WAC,E))),!. /* has_body_atom(WAC,P,Rest):- call(WAC==P -> Rest = true ; (is_ftCompound(P),functor(P,F,A),is_atom_body_pfa(WAC,P,F,A,Rest))). is_atom_body_pfa(WAC,P,F,2,Rest):-get_assertion_head_arg(1,P,E),E==WAC,get_assertion_head_arg(2,P,Rest),!. is_atom_body_pfa(WAC,P,F,2,Rest):-get_assertion_head_arg(2,P,E),E==WAC,get_assertion_head_arg(1,P,Rest),!. */ :- module_transparent( (get_assertion_head_arg)/3). get_assertion_head_arg(N,P,E):-get_assertion_head_unnegated(P,PP),!,arg(N,PP,E). same_functors(Head1,Head2):-must_det(get_unnegated_functor(Head1,F1,A1)),must_det(get_unnegated_functor(Head2,F2,A2)),!,F1=F2,A1=A2. %% mpred_update_literal( +P, ?N, ?Q, ?R) is semidet. % % PFC Update Literal. % mpred_update_literal(P,N,Q,R):- get_assertion_head_arg(N,P,UPDATE),call(replace_arg(P,N,Q_SLOT,Q)), must(call_u(Q)),update_value(Q_SLOT,UPDATE,NEW), replace_arg(Q,N,NEW,R). % '$spft'(MZ,5,5,5). %% update_single_valued_arg(+Module, +P, ?N) is semidet. % % Update Single Valued Argument. % :- module_transparent( (update_single_valued_arg)/3). update_single_valued_arg(M,M:Pred,N):-!,update_single_valued_arg(M,Pred,N). update_single_valued_arg(_,M:Pred,N):-!,update_single_valued_arg(M,Pred,N). update_single_valued_arg(world,P,N):- !, update_single_valued_arg(baseKB,P,N). update_single_valued_arg(M,P,N):- break, \+ clause_b(mtHybrid(M)), trace, clause_b(mtHybrid(M2)),!, update_single_valued_arg(M2,P,N). update_single_valued_arg(M,P,N):- get_assertion_head_arg(N,P,UPDATE), is_relative(UPDATE),!, dtrace, break, replace_arg(P,N,OLD,Q), must_det_l((clause_u(Q),update_value(OLD,UPDATE,NEW),\+ is_relative(NEW), replace_arg(Q,N,NEW,R))),!, update_single_valued_arg(M,R,N). update_single_valued_arg(M,P,N):- call_u((must_det_l(( call_u(mtHybrid(M)), mpred_type_args \= M, mpred_kb_ops \= M, get_assertion_head_arg(N,P,UPDATE), replace_arg(P,N,Q_SLOT,Q), var(Q_SLOT), same_functors(P,Q), % current_why(U), must_det_l(( % rtrace(attvar_op(assert_if_new,M:'$spft'(MZ,P,U,ax))), % (call_u(P)->true;(assertz_mu(P))), assertz_mu(M,P), doall(( lookup_u(M:Q,E), UPDATE \== Q_SLOT, erase(E), mpred_unfwc1(M:Q))))))))). % ======================= % utils % ======================= %% map_literals( +P, ?G) is semidet. % % Map Literals. % map_literals(P,G):-map_literals(P,G,[]). %% map_literals( +VALUE1, :TermH, ?VALUE3) is semidet. % % Map Literals. % map_literals(_,H,_):-is_ftVar(H),!. % skip over it map_literals(_,[],_) :- !. map_literals(Pred,(H,T),S):-!, apply(Pred,[H|S]), map_literals(Pred,T,S). map_literals(Pred,[H|T],S):-!, apply(Pred,[H|S]), map_literals(Pred,T,S). map_literals(Pred,H,S):- mpred_literal(H),must(apply(Pred,[H|S])),!. map_literals(_Pred,H,_S):- \+ is_ftCompound(H),!. % skip over it map_literals(Pred,H,S):-H=..List,!,map_literals(Pred,List,S),!. %% map_unless( :PRED1Test, ?Pred, ?H, ?S) is semidet. % % Map Unless. % map_unless(Test,Pred,H,S):- call(Test,H),ignore(apply(Pred,[H|S])),!. map_unless(_Test,_,[],_) :- !. map_unless(_Test,_Pred,H,_S):- \+ is_ftCompound(H),!. % skip over it map_unless(Test,Pred,(H,T),S):-!, apply(Pred,[H|S]), map_unless(Test,Pred,T,S). map_unless(Test,Pred,[H|T],S):-!, apply(Pred,[H|S]), map_unless(Test,Pred,T,S). map_unless(Test,Pred,H,S):-H=..List,!,map_unless(Test,Pred,List,S),!. :- meta_predicate(map_first_arg(*,+)). %% map_first_arg( +Pred, ?List) is semidet. % % PFC Maptree. % map_first_arg(CMPred,List):- strip_module(CMPred,CM,Pred), map_first_arg(CM,Pred,List,[]). :- meta_predicate(map_first_arg(+,*,+,+)). %% map_first_arg( +Pred, :TermH, ?S) is semidet. % % PFC Maptree. % map_first_arg(CM,Pred,H,S):-is_ftVar(H),!,CM:apply(Pred,[H|S]). map_first_arg(_,_,[],_) :- !. map_first_arg(CM,Pred,(H,T),S):-!, map_first_arg(CM,Pred,H,S), map_first_arg(CM,Pred,T,S). map_first_arg(CM,Pred,(H;T),S):-!, map_first_arg(CM,Pred,H,S) ; map_first_arg(CM,Pred,T,S). map_first_arg(CM,Pred,[H|T],S):-!, CM:apply(Pred,[H|S]), map_first_arg(CM,Pred,T,S). map_first_arg(CM,Pred,H,S):- CM:apply(Pred,[H|S]). %:- fixup_exports. % % :- ensure_loaded(logicmoo(util/rec_lambda)). %example pfcVerifyMissing(mpred_isa(I,D), mpred_isa(I,C), ((mpred_isa(I,C), {D==C});-mpred_isa(I,C))). %example pfcVerifyMissing(mudColor(I,D), mudColor(I,C), ((mudColor(I,C), {D==C});-mudColor(I,C))). %% pfcVerifyMissing( +GC, ?GO, ?GO) is semidet. % % Prolog Forward Chaining Verify Missing. % pfcVerifyMissing(GC, GO, ((GO, {D==C});\+ GO) ):- GC=..[F,A|Args],append(Left,[D],Args),append(Left,[C],NewArgs),GO=..[F,A|NewArgs],!. %example mpred_freeLastArg(mpred_isa(I,C),~(mpred_isa(I,C))):-is_ftNonvar(C),!. %example mpred_freeLastArg(mpred_isa(I,C),(mpred_isa(I,F),C\=F)):-!. %% mpred_freeLastArg( +G, ?GG) is semidet. % % PFC Free Last Argument. % mpred_freeLastArg(G,GG):- G=..[F,A|Args],append(Left,[_],Args),append(Left,[_],NewArgs),GG=..[F,A|NewArgs],!. mpred_freeLastArg(_G,false). %% mpred_current_op_support( +VALUE1) is semidet. % % PFC Current Oper. Support. % mpred_current_op_support((p,p)):-!. %% pfcVersion( +VALUE1) is semidet. % % Prolog Forward Chaining Version. % pfcVersion(6.6). % % :- '$set_source_module'(mpred_kb_ops). %% correctify_support( +S, ?S) is semidet. % % Correctify Support. % correctify_support(U,(U,ax)):-var(U),!. correctify_support((U,U),(U,ax)):-!. correctify_support((S,T),(S,T)):-!. correctify_support((U,_UU),(U,ax)):-!. correctify_support([U],S):-correctify_support(U,S). correctify_support(U,(U,ax)). %% clause_asserted_local( :TermABOX) is semidet. % % Clause Asserted Local. % clause_asserted_local(MCL):- strip_mz(MCL,MZ,CL), must(CL='$spft'(MZ,P,Fact,Trigger )),!, clause_u('$spft'(MZ,P,Fact,Trigger),true,Ref), clause_u('$spft'(MZ,UP,UFact,UTrigger),true,Ref), (((UP=@=P,UFact=@=Fact,UTrigger=@=Trigger))). %% is_already_supported( +P, ?S, ?UU) is semidet. % % If Is A Already Supported. % is_already_supported(P,(S,T),(S,T)):- clause_asserted_local('$spft'(_MZ,P,S,T)),!. is_already_supported(P,_S,UU):- clause_asserted_local('$spft'(_MZ,P,US,UT)),must(get_source_uu(UU)),UU=(US,UT). % TOO UNSAFE % is_already_supported(P,_S):- copy_term_and_varnames(P,PC),sp ftY(PC,_,_),P=@=PC,!. if_missing1(Q):- mpred_literal_nv(Q), call_u( \+ ~ Q), if_missing_mask(Q,R,Test),!, lookup_u(R), Test. %% if_missing_mask( +Q, ?R, ?Test) is semidet. % % If Missing Mask. % if_missing_mask(M:Q,M:R,M:Test):- nonvar(Q),!,if_missing_mask(Q,R,Test). if_missing_mask(Q,~Q,\+Q):- \+ is_ftCompound(Q),!. %if_missing_mask(ISA, ~ ISA, \+ ISA):- functor(ISA,F,1),(F==tSwim;call_u(functorDeclares(F))),!. if_missing_mask(HB,RO,TestO):- once(mpred_rule_hb(HB,H,B)),B\==true,HB\==H,!, if_missing_mask(H,R,TestO),subst(HB,H,R,RO). if_missing_mask(ISA, ISA, \+ ISA):- functor(ISA, _F,1),!.% (F==tSwim;call_u(functorDeclares(F))),!. if_missing_mask(Q,R,Test):- which_missing_argnum(Q,N), if_missing_n_mask(Q,N,R,Test),!. if_missing_mask(ISA, ~ ISA, \+ ISA). %% if_missing_n_mask( +Q, ?N, ?R, ?Test) is semidet. % % If Missing Mask. % if_missing_n_mask(Q,N,R,Test):- get_assertion_head_arg(N,Q,Was), (nonvar(R)-> (which_missing_argnum(R,RN),get_assertion_head_arg(RN,R,NEW));replace_arg(Q,N,NEW,R)),!, Test=dif:dif(Was,NEW). /* Old version if_missing_mask(Q,N,R,dif:dif(Was,NEW)):- must((is_ftNonvar(Q),acyclic_term(Q),acyclic_term(R),functor(Q,F,A),functor(R,F,A))), (singleValuedInArg(F,N) -> (get_assertion_head_arg(N,Q,Was),replace_arg(Q,N,NEW,R)); ((get_assertion_head_arg(N,Q,Was),is_ftNonvar(Was)) -> replace_arg(Q,N,NEW,R); (N=A,get_assertion_head_arg(N,Q,Was),replace_arg(Q,N,NEW,R)))). */ %% which_missing_argnum( +VALUE1, ?VALUE2) is semidet. % % Which Missing Argnum. % which_missing_argnum(Q,N):- compound(Q),\+ compound_name_arity(Q,_,0), must((acyclic_term(Q),is_ftCompound(Q),get_functor(Q,F,A))), F\=t, (call_u(singleValuedInArg(F,N)) -> true; which_missing_argnum(Q,F,A,N)). which_missing_argnum(_,_,1,_):-!,fail. which_missing_argnum(Q,_F,A,N):- between(A,1,N),get_assertion_head_arg(N,Q,Was),is_ftNonvar(Was). mpred_run_pause:- asserta(t_l:mpred_run_paused). mpred_run_resume:- retractall(t_l:mpred_run_paused). without_running(G):- (t_l:mpred_run_paused->G;locally_tl(mpred_run_pause,G)). %mpred_remove_file_support(_File):- !. mpred_remove_file_support(File):- get_mz(MZ), forall((must((filematch(File,File0),atom(File),freeze(Match,contains_var(File0,Match))))), forall(lookup_u('$spft'(MZ, W, Match, AX),Ref), (wdmsg(removing('$spft'(MZ, W, Match, AX))), erase(Ref),remove_if_unsupported(W)))). %% mpred_get_support_precanonical( +F, ?Sup) is semidet. % % PFC Get Support Precanonical. % mpred_get_support_precanonical(F,Sup):-fully_expand(mpred_get_support_precanonical,F,P),mpred_get_support(P,Sup). %% spft_precanonical( +F, ?SF, ?ST) is semidet. % % Spft Precanonical. % spft_precanonical(F,SF,ST):- fully_expand(spft_precanonical,F,P),!,mpred_get_support(P,(SF,ST)). %% trigger_supporters_list( +U, :TermARG2) is semidet. % % Trigger Supports Functor (list Version). % trigger_supporters_list(U,[]) :- match_source_ref1(U),!. trigger_supporters_list(U,[]) :- atom(U),!. trigger_supporters_list(Trigger,[Fact|MoreFacts]) :- mpred_get_support_precanonical_plus_more(Trigger,(Fact,AnotherTrigger)), must(trigger_supporters_list(AnotherTrigger,MoreFacts)). mpred_retry(G):- fail; quietly(G). %% { ?G} is semidet. % % an escape construct for bypassing the FOL''s salient body goals. % % :- meta_predicate('{}'(*)). :- module_transparent( ({})/1). '{}'(G):- call_u(G). :- sexport(({})/1). %% neg_in_code( +G) is semidet. % % Negated In Code. % :- meta_predicate neg_in_code(*). :- export(neg_in_code/1). neg_in_code(G):- nr_lc_ex((neg_in_code0(G))). % :- kb_shared(baseKB:proven_neg/1). :- meta_predicate neg_in_code0(*). :- export(neg_in_code0/1). /* neg_in_code0(G):- cwc, nr_lc_ex(proven_neg(G)). neg_in_code0(G):- cwc, var(G),!,nr_lc_ex(lookup_u(~ G)). neg_in_code0(call_u(G)):- !,neg_in_code0(G). neg_in_code0(~(G)):- nonvar(G),!, \+ nr_lc_ex(~G) ,!. neg_in_code0(G):- is_ftNonvar(G), a(prologSingleValued,G), must((if_missing_mask(G,R,Test),nonvar(R),nonvar(Test))),call_u(R),!,call_u(Test). neg_in_code0(G):- cwc, clause(~G,Call)*-> call_u(Call). */ neg_in_code0(G):- nr_lc_ex(neg_may_naf(G)), \+ nr_lc_ex(G),!. % neg_in_code0(_:G):-!,baseKB:neg_in_code0(G). :- meta_predicate neg_may_naf(*). :- module_transparent(neg_may_naf/1). :- export(neg_may_naf/1). %% neg_may_naf( :GoalP) is semidet. % % Negated May Negation-by-faliure. % neg_may_naf(P):- mpred_non_neg_literal(P),get_functor(P,F),clause_u(prologNegByFailure(F),true),!. neg_may_naf(P):- is_ftCompound(P),is_never_pfc(P). %% call_u_req( +G) is semidet. % % Req. % call_u_req(G):- nr_lc_ex(call_u(G)). %% mpred_call_only_facts(:Fact) is nondet. %% mpred_call_only_facts(+Why,:Fact) is nondet. % % PFC Call Only Facts. % % is true iff Fact is a fact available for forward chaining. % % Note that this has the side effect [maybe] of catching unsupported facts and % assigning them support from God. (g,ax) % mpred_call_only_facts(_Why,Clause):- mpred_call_only_facts(Clause). mpred_call_only_facts(Clause) :- strip_module(Clause,_,H), on_x_debug(nr_lc_ex(locally_tl(infAssertedOnly(H),call_u(H)))). % TODO: test removal %mpred_call_0(prologHybrid(H)):-get_functor(H,F),!,isa_asserted(F,prologHybrid). %% call_with_bc_triggers( +MP) is semidet. % % Call Using Backchaining Triggers. % call_with_bc_triggers(MP) :- strip_module(MP,_,P), functor(P,F,A), \+ t_l:infBackChainPrevented(F/A), lookup_u('$bt'(P,Trigger)), no_repeats(mpred_get_support('$bt'(P,Trigger),S)), once(no_side_effects(P)), locally_tl(infBackChainPrevented(F/A),mpred_eval_lhs(Trigger,S)). :- thread_local t_l:infBackChainPrevented/1. %% mpred_call_with_no_triggers( +Clause) is semidet. % % PFC Call Using No Triggers. % mpred_call_with_no_triggers(Clause) :- strip_module(Clause,_,F), % = this (is_ftVar(F)) is probably not advisable due to extreme inefficiency. (is_ftVar(F) -> mpred_facts_and_universe(F) ; mpred_call_with_no_triggers_bound(F)). %% mpred_call_with_no_triggers_bound( +F) is semidet. % % PFC Call Using No Triggers Bound. % mpred_call_with_no_triggers_bound(F):- mpred_call_with_no_triggers_uncaugth(F). %% mpred_call_with_no_triggers_uncaugth( +Clause) is semidet. % % PFC Call Using No Triggers Uncaugth. % mpred_call_with_no_triggers_uncaugth(Clause) :- strip_module(Clause,_,F), show_failure(mpred_call_with_no_triggers_bound,no_side_effects(F)), (\+ current_predicate(_,F) -> fail;call_u(F)). %= we check for system predicates as well. %has_cl(F) -> (clause_u(F,Condition),(Condition==true->true;call_u(Condition))); %call_u(F). %% mpred_bc_only( +M) is semidet. % % PFC Backchaining Only. % %mpred_bc_only(G):- !,defaultAssertMt(W), nr_lc_ex(mpred_BC_w_cache(W,G)). %mpred_bc_only(M:G):- !, nr_lc_ex(with_umt(M,mpred_bc_only0(G))). mpred_bc_only(G):- nr_lc_ex((mpred_bc_only0(G))). %% mpred_bc_only0( +G) is semidet. % % PFC Backchaining Only Primary Helper. % mpred_bc_only0(G):- mpred_unnegate(G,Pos),!, show_call(why,\+ mpred_bc_only(Pos)). % mpred_bc_only0(G):- pfcBC_NoFacts(G). mpred_bc_only0(G):- mpred_BC_w_cache(G,G). % mpred_bc_only0(G):- mpred_call_only_facts(G). %% mpred_bc_and_with_pfc( +M) is semidet. % % PFC Backchaining + FACTS + Inheritance. % mpred_bc_and_with_pfc(G):- mpred_bc_and_with_pfc_0(G). mpred_bc_and_with_pfc_0(G):- loop_check(mpred_call_only_facts(G)). % was missing mpred_bc_and_with_pfc_0(G):- mpred_bc_only0(G). mpred_bc_and_with_pfc_0(G):- strip_module(G,M,P),inherit_above(M,P). % % :- '$set_source_module'(mpred_kb_ops). %% %= pfcBC_NoFacts(F) is true iff F is a fact available for backward chaining ONLY. %= Note that this has the side effect of catching unsupported facts and %= assigning them support from God. %= this Predicate should hide Facts from mpred_bc_only/1 %% %% pfcBC_NoFacts( +F) is semidet. % % Prolog Forward Chaining Backtackable Class No Facts. % pfcBC_NoFacts(F):- pfcBC_NoFacts_TRY(F)*-> true ; (mpred_slow_search,pfcBC_Cache(F)). %% mpred_slow_search is semidet. % % PFC Slow Search. % mpred_slow_search. /* %% ruleBackward( +R, ?Condition) is semidet. % % Rule Backward. % ruleBackward(R,Condition):- call_u(( ruleBackward0(R,Condition),functor(Condition,F,_), \+ consequent_arg(_,v(call_u_no_bc,call,call_u),F))). %ruleBackward0(F,Condition):-clause_u(F,Condition),\+ (is_src_true(Condition);mpred_is_info(Condition)). %% ruleBackward0( +F, ?Condition) is semidet. % % Rule Backward Primary Helper. % ruleBackward0(F,Condition):- call_u(( '<-'(F,Condition),\+ (is_src_true(Condition);mpred_is_info(Condition)) )). %{X}:-dmsg_pretty(legacy({X})),call_u(X). */ %% pfcBC_NoFacts_TRY( +F) is semidet. % % Prolog Forward Chaining Backtackable Class No Facts Try. % pfcBC_NoFacts_TRY(F) :- no_repeats(ruleBackward(F,Condition,Support)), % neck(F), copy_term((Condition,Support),(CCondition,SupportC)), no_repeats(F,call_u(Condition)), maybe_support_bt(F,CCondition,SupportC). maybe_support_bt(P,_,_):-mpred_ignored_bt(P),!. maybe_support_bt(F,Condition,Support):- doall((no_repeats(Why,call_u('$bt'(F,'$pt'(_MZ,A,Why)))) *-> mpred_add_support_fast(F,(A,Why)))), doall((no_repeats(Why,call_u('$bt'(F,Why))) *-> mpred_add_support_fast(F,('$bt'(F,Why),Support)))), ignore((maybeSupport(F,(Condition,Support)))). :- meta_predicate mpred_why_all(*). mpred_why_all(Call):- !, call_u(Call), doall(( lookup_u(Call), ignore(show_failure(mpred_why(Call))), dmsg_pretty(result=Call),nl)), forall(Call,ignore(show_failure(mpred_why(Call)))). mpred_why_all(Call):- doall(( call_u(Call), ignore(show_failure(mpred_why(Call))), dmsg_pretty(result=Call),nl)). %% pfcBC_Cache( +F) is semidet. % % Prolog Forward Chaining Backtackable Class Cache. % pfcBC_Cache(F) :- mpred_call_only_facts(pfcBC_Cache,F), ignore((ground(F),( (\+call_u(F)), maybeSupport(F,(g,ax))))). %% maybeSupport( +P, ?VALUE2) is semidet. % % Maybe Support. % maybeSupport(P,_):-mpred_ignored_bt(P),!. maybeSupport(P,S):- fail, ( \+ ground(P)-> true; (predicate_property(P,dynamic)->mpred_post(P,S);true)). maybeSupport(P,S):- mpred_add_support_fast(P,S), maybeMaybeAdd(P,S). maybeMaybeAdd(P,_):- \+ predicate_property(P,dynamic),!. maybeMaybeAdd(P,_):- \+ \+ clause_u(P,true),!. maybeMaybeAdd(P,S):- locally_tl(assert_dir(a), assert_u_confirmed_was_missing(P)), mpred_trace_op(add,P,S), mpred_enqueue(P,S). %% mpred_ignored_bt( :TermC) is semidet. % % PFC Ignored. % mpred_ignored_bt(argIsa(F, A, argIsaFn(F, A))). mpred_ignored_bt(genls(A,A)). mpred_ignored_bt(isa(tCol,tCol)). %mpred_ignored_bt(isa(W,tCol)):-mreq(baseKB:hasInstance_dyn(tCol,W)). mpred_ignored_bt(isa(W,_)):-is_ftCompound(W),call_u(isa(W,meta_argtypes)). mpred_ignored_bt(C):-clause_safe(C,true). mpred_ignored_bt(isa(_,Atom)):-atom(Atom),atom_concat(ft,_,Atom),!. mpred_ignored_bt(isa(_,argIsaFn(_, _))). %% has_cl( +H) is semidet. % % Has Clause. % has_cl(H):-predicate_property(H,number_of_clauses(_)). % an action is undoable if there exists a method for undoing it. %% mpred_negation_w_neg( +P, ?NF) is semidet. % % PFC Negation W Negated. % mpred_negation_w_neg(~(P),P):-is_ftNonvar(P),!. mpred_negation_w_neg(P,NF):-mpred_nf1_negation(P,NF). %% hook_one_minute_timer_tick is semidet. % % Hook To [baseKB:hook_one_minute_timer_tick/0] For Module Mpred_pfc. % Hook One Minute Timer Tick. % baseKB:hook_one_minute_timer_tick:-mpred_cleanup. %% mpred_cleanup is semidet. % % PFC Cleanup. % mpred_cleanup:- forall((no_repeats(F-A,(call_u(mpred_prop(M,F,A,pfcRHS)),A>1))),mpred_cleanup(M,F,A)). %% mpred_cleanup(M, +F, ?A) is semidet. % % PFC Cleanup. % mpred_cleanup(M,F,A):-functor(P,F,A),predicate_property(P,dynamic)->mpred_cleanup_0(M,P);true. %% mpred_cleanup_0(M, +P) is semidet. % % PFC cleanup Primary Helper. % mpred_cleanup_0(M,P):- findall(P-B-Ref,M:clause(P,B,Ref),L), M:forall(member(P-B-Ref,L),erase_w_attvars(clause(P,B,Ref),Ref)),forall(member(P-B-Ref,L),M:attvar_op(db_op_call(assertz,assertz_if_new),((P:-B)))). % :-debug. %isInstFn(A):-!,trace_or_throw(isInstFn(A)). %= mpred_unnegate(N,P) is true if N is a negated term and P is the term %= with the negation operator stripped. /* %% mpred_unnegate( +P, ?P) is semidet. % % PFC Negation. % mpred_unnegate((-P),P). % mpred_unnegate((~P),P). mpred_unnegate((\+(P)),P). */ /* %% mpred_negated_literal( +P) is semidet. % % PFC Negated Literal. % mpred_negated_literal(P):-is_reprop(P),!,fail. mpred_negated_literal(P):-mpred_negated_literal(P,_). %% mpred_negated_literal( +P, ?Q) is semidet. % % PFC Negated Literal. % mpred_negated_literal(P,Q) :- is_ftNonvar(P), mpred_unnegate(P,Q), mpred_literal(Q). */ %% mpred_is_assertable( +X) is semidet. % % PFC If Is A Assertable. % mpred_is_assertable(X):- mpred_literal_nv(X),\+ functor(X,{},_). %% mpred_literal_nv( +X) is semidet. % % PFC Literal Nv. % mpred_literal_nv(X):-is_ftNonvar(X),mpred_literal(X). /* %% mpred_literal( +X) is semidet. % % PFC Literal. % mpred_literal(X) :- is_reprop(X),!,fail. mpred_literal(X) :- cyclic_term(X),!,fail. mpred_literal(X) :- atom(X),!. mpred_literal(X) :- mpred_negated_literal(X),!. mpred_literal(X) :- mpred_positive_literal(X),!. mpred_literal(X) :- is_ftVar(X),!. */ %% is_reprop( +X) is semidet. % % If Is A Reprop. % is_reprop(X):- compound(X),is_reprop_0(X). %% is_reprop_0( +X) is semidet. % % If Is A reprop Primary Helper. % is_reprop_0(~(X)):-!,is_reprop(X). is_reprop_0(X):-get_functor(X,repropagate,_). %% mpred_non_neg_literal( +X) is semidet. % % PFC Not Negated Literal. % mpred_non_neg_literal(X):- is_reprop(X),!,fail. mpred_non_neg_literal(X):- atom(X),!. mpred_non_neg_literal(X):- sanity(stack_check), mpred_positive_literal(X), X \= ~(_), X \= mpred_prop(_,_,_,_), X \= conflict(_). % ======================= mpred_file('pfcsupport'). % support maintenance %% is_relative( :TermV) is semidet. % % If Is A Relative. % is_relative(V):- (\+is_ftCompound(V)),!,fail. is_relative(update(_)). is_relative(replace(_)). is_relative(rel(_)). is_relative(+(X)):- \+ is_ftVar(X). is_relative(-(X)):- \+ is_ftVar(X). is_relative(*(X)):- \+ is_ftVar(X). /* % TODO not called yet %= mpred_get_trigger_key(+Trigger,-Key) %= %= Arg1 is a trigger. Key is the best term to index it on. mpred_get_trigger_key('$pt'(MZ,Key,_),Key). mpred_get_trigger_key(pk(Key,_,_),Key). mpred_get_trigger_key('$nt'(Key,_,_),Key). mpred_get_trigger_key(Key,Key). */ /* the FOL i get from SUMO, CycL, UMBEL and many *non* RDF ontologies out there.. i convert to Datalog.. evidently my conversion process is unique as it preserves semantics most by the book conversions gave up on. % TODO not called yet %=^L %= Get a key from the trigger that will be used as the first argument of %= the trigger baseable clause that stores the trigger. %= mpred_trigger_key(X,X) :- is_ftVar(X), !. mpred_trigger_key(chart(word(W),_L),W) :- !. mpred_trigger_key(chart(stem([Char1|_Rest]),_L),Char1) :- !. mpred_trigger_key(chart(Concept,_L),Concept) :- !. mpred_trigger_key(X,X). */ % ======================= mpred_file('pfcdb'). % predicates to manipulate database. % File : pfcdb.pl % Author : Tim Finin, finin@prc.unisys.com % Author : Dave Matuszek, dave@prc.unisys.com % Author : Dan Corpron % Updated: 10/11/87, ... % Purpose: predicates to manipulate a pfc database (e.g. save, % restore, reset, etc). %% clause_or_call( +H, ?B) is semidet. % % Clause Or Call. % clause_or_call(M:H,B):-is_ftVar(M),!,no_repeats(M:F/A,(f_to_mfa(H,M,F,A))),M:clause_or_call(H,B). clause_or_call(isa(I,C),true):-!,call_u(isa_asserted(I,C)). clause_or_call(genls(I,C),true):-!,on_x_log_throw(call_u(genls(I,C))). clause_or_call(H,B):- clause(src_edit(_Before,H),B). clause_or_call(H,B):- predicate_property(H,number_of_clauses(C)),predicate_property(H,number_of_rules(R)),((R*2<C) -> (clause_u(H,B)*->!;fail) ; clause_u(H,B)). clause_or_call(H,true):- call_u(should_call_for_facts(H)),no_repeats(on_x_log_throw(H)). % as opposed to simply using clause(H,true). %% should_call_for_facts( +H) is semidet. % % Should Call For Facts. % should_call_for_facts(H):- get_functor(H,F,A),call_u(should_call_for_facts(H,F,A)). %% should_call_for_facts( +VALUE1, ?F, ?VALUE3) is semidet. % % Should Call For Facts. % should_call_for_facts(_,F,_):- a(prologSideEffects,F),!,fail. should_call_for_facts(H,_,_):- modulize_head(H,HH), \+ predicate_property(HH,number_of_clauses(_)),!. should_call_for_facts(_,F,A):- clause_b(mpred_prop(_M,F,A,pfcRHS)),!,fail. should_call_for_facts(_,F,A):- clause_b(mpred_prop(_M,F,A,pfcMustFC)),!,fail. should_call_for_facts(_,F,_):- a(prologDynamic,F),!. should_call_for_facts(_,F,_):- \+ a(pfcControlled,F),!. %% no_side_effects( +P) is semidet. % % No Side Effects. % no_side_effects(P):- (\+ is_side_effect_disabled->true;(get_functor(P,F,_),a(prologSideEffects,F))). :- was_dynamic(functorIsMacro/1). %% compute_resolve( +NewerP, ?OlderQ, ?SU, ?SU, ?OlderQ) is semidet. % % Compute Resolve. % compute_resolve(NewerP,OlderQ,SU,SU,(mpred_blast(OlderQ),mpred_ain(NewerP,S),mpred_withdraw(conflict(NewerP)))):- must(correctify_support(SU,S)), wdmsg_pfc(compute_resolve(newer(NewerP-S)>older(OlderQ-S))). compute_resolve(NewerP,OlderQ,S1,[U],Resolve):-compute_resolve(OlderQ,NewerP,[U2],S1,Resolve),match_source_ref1(U),match_source_ref1(U2),!. compute_resolve(NewerP,OlderQ,SU,S2,(mpred_blast(OlderQ),mpred_ain(NewerP,S1),mpred_withdraw(conflict(NewerP)))):- must(correctify_support(SU,S1)), wdmsg_pfc(compute_resolve((NewerP-S1)>(OlderQ-S2))). %% compute_resolve( +NewerP, ?OlderQ, ?Resolve) is semidet. % % Compute Resolve. % compute_resolve(NewerP,OlderQ,Resolve):- supporters_list_how(NewerP,S1), supporters_list_how(OlderQ,S2), compute_resolve(NewerP,OlderQ,S1,S2,Resolve). %% is_resolved( +C) is semidet. % % If Is A Resolved. % is_resolved(C):- Why= is_resolved, mpred_call_only_facts(Why,C),\+mpred_call_only_facts(Why,~(C)). is_resolved(C):- Why= is_resolved, mpred_call_only_facts(Why,~(C)),\+mpred_call_only_facts(Why,C). :- must(nop(_)). %% mpred_prove_neg( +G) is semidet. % % PFC Prove Negated. % mpred_prove_neg(G):- (dtrace), \+ mpred_bc_only(G), \+ mpred_fact(G). %% pred_head( :PRED1Type, ?P) is semidet. % % Predicate Head. % pred_head(Type,P):- no_repeats(P,(call(Type,P),\+ nonfact_metawrapper(P),is_ftCompound(P))). %% pred_head_all( +P) is semidet. % % Predicate Head All. % pred_head_all(P):- pred_head(pred_all,P). %% nonfact_metawrapper( :TermP) is semidet. % % Nonfact Metawrapper. % nonfact_metawrapper(~(_)). nonfact_metawrapper('$pt'(_,_,_)). nonfact_metawrapper('$bt'(_,_)). nonfact_metawrapper('$nt'(_,_,_)). nonfact_metawrapper('$spft'(_,_,_,_)). nonfact_metawrapper(added(_)). % we use the arity 1 forms is why nonfact_metawrapper(term_expansion(_,_)). nonfact_metawrapper(P):- \+ current_predicate(_,P). nonfact_metawrapper(M:P):-atom(M),!,nonfact_metawrapper(P). nonfact_metawrapper(P):- get_functor(P,F,_), (a(prologSideEffects,F);a(rtNotForUnboundPredicates,F)). nonfact_metawrapper(P):-rewritten_metawrapper(P). %% rewritten_metawrapper( +C) is semidet. % % Rewritten Metawrapper. % rewritten_metawrapper(_):-!,fail. %rewritten_metawrapper(isa(_,_)). rewritten_metawrapper(C):-is_ftCompound(C),functor(C,t,_). %% meta_wrapper_rule( :TermARG1) is semidet. % % Meta Wrapper Rule. % meta_wrapper_rule((_<-_)). meta_wrapper_rule((_<==>_)). meta_wrapper_rule((_==>_)). meta_wrapper_rule((_:-_)). %% pred_all( +P) is semidet. % % Predicate All. % pred_all(P):-pred_u0(P). pred_all(P):-pred_t0(P). pred_all(P):-pred_r0(P). %% pred_u0( +P) is semidet. % % Predicate For User Code Primary Helper. % pred_u0(P):-pred_u1(P),has_db_clauses(P). pred_u0(P):-pred_u2(P). %% pred_u1( +VALUE1) is semidet. % % Predicate For User Code Secondary Helper. % pred_u1(P):-a(pfcControlled,F),arity_no_bc(F,A),functor(P,F,A). pred_u1(P):-a(prologHybrid,F),arity_no_bc(F,A),functor(P,F,A). pred_u1(P):-a(prologDynamic,F),arity_no_bc(F,A),functor(P,F,A). %% pred_u2( +P) is semidet. % % Predicate For User Code Extended Helper. % pred_u2(P):- compound(P),functor(P,F,A),sanity(no_repeats(arity_no_bc(F,A))),!,has_db_clauses(P). pred_u2(P):- no_repeats(arity_no_bc(F,A)),functor(P,F,A),has_db_clauses(P). %% has_db_clauses( +PI) is semidet. % % Has Database Clauses. % has_db_clauses(PI):-modulize_head(PI,P), predicate_property(P,number_of_clauses(NC)),\+ predicate_property(P,number_of_rules(NC)), \+ \+ clause_u(P,true). %% pred_t0(+ ?P) is semidet. % % Predicate True Stucture Primary Helper. % pred_t0(P):-mreq('==>'(P)). pred_t0(P):-mreq('$pt'(_,P,_)). pred_t0(P):-mreq('$bt'(P,_)). pred_t0(P):-mreq('$nt'(P,_,_)). pred_t0(P):-mreq('$spft'(_,P,_,_)). %pred_r0(-(P)):- call_u(-(P)). %pred_r0(~(P)):- mreq(~(P)). %% pred_r0( :TermP) is semidet. % % Predicate R Primary Helper. % pred_r0(P==>Q):- mreq(P==>Q). pred_r0(P<==>Q):- mreq(P<==>Q). pred_r0(P<-Q):- mreq(P<-Q). %% cnstrn( +X) is semidet. % % Cnstrn. % :- module_transparent(cnstrn/1). cnstrn(X):-term_variables(X,Vs),maplist(cnstrn0(X),Vs),!. %% cnstrn( +V, ?X) is semidet. % % Cnstrn. % :- module_transparent(cnstrn/2). cnstrn(V,X):-cnstrn0(X,V). %% cnstrn0( +X, ?V) is semidet. % % Cnstrn Primary Helper. % :- module_transparent(cnstrn0/2). cnstrn0(X,V):-when(is_ftNonvar(V),X). %% rescan_pfc is semidet. % % Rescan Prolog Forward Chaining. % rescan_pfc:-forall(clause(baseKB:mpred_hook_rescan_files,Body),show_entry(rescan_pfc,Body)). %% mpred_facts_and_universe( +P) is semidet. % % PFC Facts And Universe. % mpred_facts_and_universe(P):- (is_ftVar(P)->pred_head_all(P);true),call_u(P). % (meta_wrapper_rule(P)->call_u(P) ; call_u(P)). %% repropagate( :TermP) is semidet. % % Repropagate. % repropagate(_):- notrace((check_context_module,fail)). repropagate(P):- quietly(repropagate_0(P)). %repropagate(P):- check_real_context_module,fail. repropagate_0(P):- notrace(is_ftVar(P)),!. repropagate_0(USER:P):- USER==user,!,repropagate_0(P). repropagate_0(==>P):- !,repropagate_0(P). repropagate_0(F):- atom(F),!,repropagate_atom(F). repropagate_0(P):- meta_wrapper_rule(P),!,call_u(repropagate_meta_wrapper(P)). repropagate_0(F/A):- is_ftNameArity(F,A),!,functor(P,F,A),!,repropagate_0(P). repropagate_0(F/A):- atom(F),is_ftVar(A),!,repropagate_atom(F). repropagate_0(P0):- p0_to_mp(P0,P), \+ predicate_property(P,_),catch('$find_predicate'(P0,PP),_,fail),PP\=[],!, forall(member(M:F/A,PP),must((functor(Q,F,A),repropagate_0(M:Q)))). repropagate_0(P):- notrace((\+ predicate_property(_:P,_),dmsg_pretty(undefined_repropagate(P)))),dumpST,dtrace,!,fail. repropagate_0(P):- repropagate_meta_wrapper(P). predicates_from_atom(Mt,F,P):- var(Mt),!, ((guess_pos_assert_to(Mt),Mt:current_predicate(F,M:P0)) *-> ((Mt==M)->P=P0;P=M:P0) ; ('$find_predicate'(F,PP),member(Mt:F/A,PP),functor(P0,F,A),P=Mt:P0)), current_predicate(_,Mt:P). predicates_from_atom(Mt,F,P):- (Mt:current_predicate(F,M:P0)*->true; (catch('$find_predicate'(F,PP),_,fail),PP\=[],member(Mt:F/A,PP),accessable_mt(Mt,M),functor(P0,F,A))), ((Mt==M)->P=P0;P=M:P0), current_predicate(_,Mt:P). accessable_mt(Mt,M):- M=Mt. accessable_mt(Mt,M):- clause_b(genlMt(Mt,M)). %accessable_mt(_Mt,baseKB). repropagate_atom(F):- guess_pos_assert_to(ToMt), forall(predicates_from_atom(ToMt,F,P),repropagate_0(P)). %ToMt:catch('$find_predicate'(F,PP),_,fail),PP\=[],!, %forall(member(M:F/A,PP),must((functor(Q,F,A),repropagate_0(M:Q)))). p0_to_mp(MP,SM:P0):- strip_module(MP,M0,P0), ((M0==query;M0==pfc_lib;is_code_module(M0))-> (get_query_from(SM),sanity(pfc_lib\==SM));SM=M0). :- export(repropagate_meta_wrapper/1). :- module_transparent(repropagate_meta_wrapper/1). :- thread_local(t_l:is_repropagating/1). %% repropagate_meta_wrapper( +P) is semidet. % % Repropagate Meta Wrapper Rule. % repropagate_meta_wrapper(P):- call_u(doall((no_repeats((mpred_facts_and_universe(P))), locally_tl(is_repropagating(P),ignore((once(show_failure(fwd_ok(P))),show_call(mpred_fwc(P)))))))). predicate_to_goal(P,Goal):-atom(P),get_arity(P,F,A),functor(Goal,F,A). predicate_to_goal(PF/A,Goal):-atom(PF),get_arity(PF,F,A),functor(Goal,F,A). predicate_to_goal(G,G):-compound(G),!. %% fwd_ok( :TermP) is semidet. % % Forward Repropigated Ok. % fwd_ok(_):-!. fwd_ok(P):-ground(P),!. fwd_ok(if_missing1(_,_)). fwd_ok(idForTest(_,_)). fwd_ok(clif(_)). fwd_ok(pfclog(_)). fwd_ok(X):-compound(X),get_assertion_head_arg(_,X,E),compound(E),functor(E,(:-),_),!. % fwd_ok(P):-must(ground(P)),!. %% mpred_facts_only( +P) is semidet. % % PFC Facts Only. % mpred_facts_only(P):- (is_ftVar(P)->(pred_head_all(P),\+ meta_wrapper_rule(P));true),no_repeats(P). :- thread_local(t_l:user_abox/1). % :- ((prolog_load_context(file,F), prolog_load_context(source,F))-> throw(prolog_load_context(source,F)) ; true). :- include('mpred_header.pi'). :- style_check(+singleton). % TODO READD %:- foreach(arg(_,isEach(prologMultiValued,prologOrdered,prologNegByFailure,prologPTTP,prologKIF,pfcControlled,ttRelationType, % prologHybrid,predCanHaveSingletons,prologDynamic,prologBuiltin,functorIsMacro,prologListValued,prologSingleValued),P),) %% get % ================================================= % ============== UTILS BEGIN ============== % ================================================= %% ruleBackward(+R, ?Condition) is semidet. % % Rule Backward. % ruleBackward(R,Condition,Support):- ruleBackward0(R,Condition,Support), functor(Condition,F,_),\+ arg(_,v(call_u,mpred_bc_only,inherit_above),F). %% ruleBackward0(+F, ?Condition) is semidet. % % Rule Backward Primary Helper. % ruleBackward0(F,Condition,Support):- call_u('<-'(FF,Condition)),copy_term('<-'(FF,Condition),Support),FF=F. %ruleBackward0(F,Condition,(F :- Condition)):- clause_u(F,Condition),\+ (is_src_true(Condition);mpred_is_info(Condition)). % ======================= % user''s program''s database % ======================= %% assert_mu(+X) is semidet. % % Assert For User Code. % assert_mu(MH):- fix_mp(clause(assert,assert_u), MH,M,H),get_unnegated_functor(H,F,A),assert_mu(M,H,F,A). asserta_mu(MH):- fix_mp(clause(assert,asserta_u),MH,M,H),asserta_mu(M,H). assertz_mu(MH):- fix_mp(clause(assert,assertz_u),MH,M,H),assertz_mu(M,H). % :- kb_shared(baseKB:singleValuedInArg/2). :- thread_local(t_l:assert_dir/1). %% assert_mu(+Module, +Pred, ?Functor, ?Arity) is semidet. % % Assert For User Code. % assert_mu(M,M2:Pred,F,A):- M == M2,!, assert_mu(M,Pred,F,A). % maYBE assert_mu(M,(M2:Pred :- B),F,A):- M == M2,!, assert_mu(M,(Pred :- B),F,A). assert_mu(M,_:Pred,F,A):- dtrace,sanity(\+ is_ftVar(Pred)),!, assert_mu(M,Pred,F,A). assert_mu(M,(Pred:- (AWC,More)),_,_):- AWC == awc,!,asserta_mu(M,(Pred:- (AWC,More))). assert_mu(M,(Pred:- (ZWC,More)),_,_):- ZWC == zwc,!,assertz_mu(M,(Pred:- (ZWC,More))). %assert_mu(M,Pred,F,_):- clause_b(singleValuedInArg(F,SV)),!,must(update_single_valued_arg(M,Pred,SV)),!. %assert_mu(M,Pred,F,A):- a(prologSingleValued,F),!,must(update_single_valued_arg(M,Pred,A)),!. assert_mu(M,Pred,F,_):- a(prologOrdered,F),!,assertz_mu(M,Pred). assert_mu(M,Pred,_,_):- t_l:assert_dir(Where),!, (Where = a -> asserta_mu(M,Pred); assertz_mu(M,Pred)). %assert_mu(M,Pred,_,1):- !, assertz_mu(M,Pred),!. assert_mu(M,Pred,_,_):- assertz_mu(M,Pred). :-thread_local(t_l:side_effect_ok/0). %% assertz_mu(+M, ?X) is semidet. % % Assertz Module Unit. % %assertz_mu(abox,X):-!,defaultAssertMt(M),!,assertz_mu(M,X). %assertz_mu(M,X):- check_never_assert(M:X), clause_asserted_u(M:X),!. % assertz_mu(M,X):- correct_module(M,X,T),T\==M,!,assertz_mu(T,X). % assertz_mu(_,X):- must(defaultAssertMt(M)),!,must((expire_tabled_list(M:X),show_call(attvar_op(db_op_call(assertz,assertz_i),M:X)))). assertz_mu(_,X):- check_never_assert(X),fail. %assertz_mu(M,M2:Pred,F,A):- M == M2,!, assertz_mu(M,Pred,F,A). %assertz_mu(M,'$spft'(MZ,P,mfl4(VarNameZ,KB,F,L),T)):-M\==KB,!,assertz_mu(KB,'$spft'(MZ,P,mfl4(VarNameZ,KB,F,L),T)). assertz_mu(M,X):- strip_module(X,_,P), %sanity(check_never_assert(M:P)), must((expire_tabled_list(M:P),show_failure(attvar_op(db_op_call(assertz,assertz_i),M:P)))). %(clause_asserted_u(M:P)-> true; must((expire_tabled_list(M:P),show_failure(attvar_op(db_op_call(assertz,assertz_i),M:P))))). %% asserta_mu(+M, ?X) is semidet. % % Asserta Module Unit. % %asserta_mu(abox,X):-!,defaultAssertMt(M),!,asserta_mu(M,X). % asserta_mu(M,X):- correct_module(M,X,T),T\==M,!,asserta_mu(T,X). % asserta_mu(_,X):- must(defaultAssertMt(M)),!,must((expire_tabled_list(M:X),show_failure(attvar_op(db_op_call(assertz,assertz_i),M:X)))). asserta_mu(_,X):- check_never_assert(X),fail. asserta_mu(M,X):- strip_module(X,_,P),!, %sanity(check_never_assert(M:P)), must((expire_tabled_list(M:P),show_failure(attvar_op(db_op_call(asserta,asserta_i),M:P)))). %(clause_asserted_u(M:P)-> true; must((expire_tabled_list(M:P),show_failure(attvar_op(db_op_call(asserta,asserta_i),M:P))))). %% retract_mu( :TermX) is semidet. % % Retract For User Code. % % retract_mu(que(X,Y)):-!,show_failure(why,retract_eq_quitely_f(que(X,Y))),must((expire_tabled_list(~(X)))),must((expire_tabled_list((X)))). retract_mu(H0):- throw_depricated, strip_module(H0,_,H),defaultAssertMt(M),show_if_debug(attvar_op(db_op_call(retract,retract_i),M:H)),!,must((expire_tabled_list(H))). retract_mu(X):- check_never_retract(X),fail. retract_mu(~(X)):-!,show_success(why,retract_eq_quitely_f(~(X))),must((expire_tabled_list(~(X)))),must((expire_tabled_list((X)))). retract_mu((X)):-!,show_success(why,retract_eq_quitely_f((X))),must((expire_tabled_list(~(X)))),must((expire_tabled_list((X)))). retract_mu(M:(H:-B)):- atom(M),!, clause_u(H,B,R),erase(R). retract_mu((H:-B)):-!, clause_u(H,B,R),erase(R). %retract_mu(~(X)):-must(is_ftNonvar(X)),!,retract_eq_quitely_f(~(X)),must((expire_tabled_list(~(X)))),must((expire_tabled_list((X)))). %retract_mu(hs(X)):-!,retract_eq_quitely_f(hs(X)),must((expire_tabled_list(~(X)))),must((expire_tabled_list((X)))). :- retractall(t_l:mpred_debug_local). :- thread_local(t_l:in_rescan_mpred_hook/0). %:- module_transparent(mpred_call_0/1). :- meta_predicate update_single_valued_arg(+,+,*). :- meta_predicate assert_mu(*,+,*,*). :- meta_predicate mpred_facts_and_universe(*). :- meta_predicate {*}. :- meta_predicate neg_in_code0(*). :- meta_predicate repropagate_meta_wrapper(*). :- meta_predicate mpred_get_support_via_sentence(*,*). :- dynamic(system:infoF/1). mpred_kb_ops_file. %:- fixup_exports.
TeamSPoon/pfc
prolog/dialect/pfc_ext/mpred_database.pl
Perl
bsd-2-clause
65,687
#!/usr/bin/perl # Copyright 2018 Jeffrey Kegler # This file is part of Marpa::R2. Marpa::R2 is free software: you can # redistribute it and/or modify it under the terms of the GNU Lesser # General Public License as published by the Free Software Foundation, # either version 3 of the License, or (at your option) any later version. # # Marpa::R2 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 # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser # General Public License along with Marpa::R2. If not, see # http://www.gnu.org/licenses/. use 5.010001; use File::Spec; use File::Find::Rule; use Pod::Simple::SimpleTree; use Data::Dumper; use autodie; chdir('pod'); my @pod_files = File::Find::Rule->file()->name( '*.pod' )->in('.'); # die join " ", @pod_files; my %headers = (); for my $pod_file (@pod_files) { my (undef, $dir, $file) = File::Spec->splitpath($pod_file); my @dirs = grep { $_; } File::Spec->splitdir($dir); my ($base, $ext) = split m/[.]/xms, $file; my $pod_name = join '::', qw(Marpa R2), @dirs, $base; # say $pod_name; my $tree = Pod::Simple::SimpleTree->new->parse_file($pod_file)->root; find_header($tree, $pod_name); } sub find_header { my ($subtree, $pod_name) = @_; if (ref $subtree eq 'ARRAY') { if (substr($subtree->[0], 0, 4) eq 'head') { $headers{join ' ', $pod_name, $subtree->[2]} = 1; # say $subtree->[2]; } if ($subtree->[0] eq 'L') { my $hash = $subtree->[1]; return if not $hash->{type} eq 'pod'; $to_name = $hash->{to} // $pod_name; return if not exists $hash->{section}; $links{join ' ', $to_name, $hash->{section}} = $pod_name; } find_header($_, $pod_name) for @{$subtree}; } return; } # say Dumper($tree); # say "$_ H" for keys %headers; # say "$_ L" for keys %links; # exit 0; for my $link (keys %links) { if (not exists $headers{$link}) { my $pod_name = $links{$link}; say "$pod_name unresolved link: $link" } }
jddurand/c-marpaESLIF
3rdparty/github/marpaWrapper/3rdparty/github/Marpa--R2/cpan/etc/pod_links.pl
Perl
mit
2,171
package Business::Logic::Shipment; use 5.010001; use strict; use warnings; use Carp; require Exporter; our @ISA = qw(Exporter); # 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. # This allows declaration use Business::Logic::Shipment ':all'; # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK # will save memory. #our %EXPORT_TAGS = ( 'all' => [ qw( # #) ] ); our @EXPORT_OK = ( ); our @EXPORT = qw( ); our $VERSION = '0.01'; # Preloaded methods go here. sub q_map { my ($map,$p,$d) = @_; unless(defined $d){$d = $p;} return defined $map->{$p} ? $map->{$p} : $d; } sub new { my($class, $params,$map) = @_; $map = (defined $map ? $map : {}); my $parameters = { items=>{}, ex_factory=>time, at_port=>time+86400*7, available_to_ship=>time+86400*14, invoice=>undef, shipping_invoice=>undef, shipping_cost=>0, shipped_via=>"unspecified", status=>"", # pending, shipped, received }; my $self = {}; foreach my $parameter (keys %$parameters) { $self->{$parameter} = q_map($params,q_map($map,$parameter),$parameters->{$parameter}); } $self->{"data"} = $params; bless($self, $class); return $self; } sub get_hash { my ($self) = @_; return ($self->{"data"}); } sub received { my ($self) = @_; my $status = $self->{"status"}; if($status eq "R") { return (1); } else { return (0); } } sub qty { my ($self,$item_number) = @_; if(defined $self->{"items"}) { my $item = $self->{"items"}->{$item_number}; return ($item->{"qty"}); } else { return (0); } } sub pending { my ($self) = @_; my $status = $self->{"status"}; if($status eq "S" || $status eq "P" || $status eq "") { return (1); } else { return (0); } } sub date { my ($self) = @_; return ($self->{"available_to_ship"}); } 1; __END__ # Below is stub documentation for your module. You'd better edit it! =head1 NAME Business::Logic::Shipment - Perl extension for blah blah blah =head1 SYNOPSIS use Business::Logic::Shipment; blah blah blah =head1 DESCRIPTION Stub documentation for Business::Logic::Shipment, created by h2xs. It looks like the author of the extension was negligent enough to leave the stub unedited. Blah blah blah. =head2 EXPORT None by default. =head1 SEE ALSO Mention other useful documentation such as the documentation of related modules or operating system documentation (such as man pages in UNIX), or any relevant external documentation such as RFCs or standards. If you have a mailing list set up for your module, mention it here. If you have a web site set up for your module, mention it here. =head1 AUTHOR root, E<lt>root@(none)E<gt> =head1 COPYRIGHT AND LICENSE Copyright (C) 2012 by root This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.1 or, at your option, any later version of Perl 5 you may have available. =cut
benjaminharnett/edi850_export_for_magento
Business-Logic-0.01/lib/Business/Logic/Shipment.pm
Perl
mit
3,246
package Fixtures::Parameter; # # Copyright 2015 Comcast Cable Communications Management, 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. # use Moose; extends 'DBIx::Class::EasyFixture'; use namespace::autoclean; use Digest::SHA1 qw(sha1_hex); my %definition_for = ( domain_name => { new => 'Parameter', using => { id => 3, name => 'domain_name', value => 'foo.com', config_file => 'CRConfig.json', }, }, health_threadhold_loadavg => { new => 'Parameter', using => { id => 4, name => 'health.threshold.loadavg', value => '25.0', config_file => 'rascal.properties', }, }, health_threadhold_available_bandwidth_in_kbps => { new => 'Parameter', using => { id => 5, name => 'health.threshold.availableBandwidthInKbps', value => '>1750000', config_file => 'rascal.properties', }, }, history_count => { new => 'Parameter', using => { id => 6, name => 'history.count', value => '30', config_file => 'rascal.properties', }, }, 'key0' => { new => 'Parameter', using => { id => 7, name => 'key0', config_file => 'url_sig_cdl-c2.config', value => 'HOOJ3Ghq1x4gChp3iQkqVTcPlOj8UCi3', }, }, 'key1' => { new => 'Parameter', using => { id => 8, name => 'key1', config_file => 'url_sig_cdl-c2.config', value => '_9LZYkRnfCS0rCBF7fTQzM9Scwlp2FhO', }, }, 'key2' => { new => 'Parameter', using => { id => 9, name => 'key2', config_file => 'url_sig_cdl-c2.config', value => 'AFpkxfc4oTiyFSqtY6_ohjt3V80aAIxS', }, }, 'key3' => { new => 'Parameter', using => { id => 10, name => 'key3', config_file => 'url_sig_cdl-c2.config', value => 'AL9kzs_SXaRZjPWH8G5e2m4ByTTzkzlc', }, }, 'key4' => { new => 'Parameter', using => { id => 11, name => 'key4', config_file => 'url_sig_cdl-c2.config', value => 'poP3n3szbD1U4vx1xQXV65BvkVgWzfN8', }, }, 'key5' => { new => 'Parameter', using => { id => 12, name => 'key5', config_file => 'url_sig_cdl-c2.config', value => '1ir32ng4C4w137p5oq72kd2wqmIZUrya', }, }, 'key6' => { new => 'Parameter', using => { id => 13, name => 'key6', config_file => 'url_sig_cdl-c2.config', value => 'B1qLptn2T1b_iXeTCWDcVuYvANtH139f', }, }, 'key7' => { new => 'Parameter', using => { id => 14, name => 'key7', config_file => 'url_sig_cdl-c2.config', value => 'PiCV_5OODMzBbsNFMWsBxcQ8v1sK0TYE', }, }, 'key8' => { new => 'Parameter', using => { id => 15, name => 'key8', config_file => 'url_sig_cdl-c2.config', value => 'Ggpv6DqXDvt2s1CETPBpNKwaLk4fTM9l', }, }, 'key9' => { new => 'Parameter', using => { id => 16, name => 'key9', config_file => 'url_sig_cdl-c2.config', value => 'qPlVT_s6kL37aqb6hipDm4Bt55S72mI7', }, }, 'key10' => { new => 'Parameter', using => { id => 17, name => 'key10', config_file => 'url_sig_cdl-c2.config', value => 'BsI5A9EmWrobIS1FeuOs1z9fm2t2WSBe', }, }, 'key11' => { new => 'Parameter', using => { id => 18, name => 'key11', config_file => 'url_sig_cdl-c2.config', value => 'A54y66NCIj897GjS4yA9RrsSPtCUnQXP', }, }, 'key12' => { new => 'Parameter', using => { id => 19, name => 'key12', config_file => 'url_sig_cdl-c2.config', value => '2jZH0NDPSJttIr4c2KP510f47EKqTQAu', }, }, 'key13' => { new => 'Parameter', using => { id => 20, name => 'key13', config_file => 'url_sig_cdl-c2.config', value => 'XduT2FBjBmmVID5JRB5LEf9oR5QDtBgC', }, }, 'key14' => { new => 'Parameter', using => { id => 21, name => 'key14', config_file => 'url_sig_cdl-c2.config', value => 'D9nH0SvK_0kP5w8QNd1UFJ28ulFkFKPn', }, }, 'key15' => { new => 'Parameter', using => { id => 22, name => 'key15', config_file => 'url_sig_cdl-c2.config', value => 'udKXWYNwbXXweaaLzaKDGl57OixnIIcm', }, }, 'url_sig_cdl-c2.config_location' => { new => 'Parameter', using => { id => 23, name => 'location', config_file => 'url_sig_cdl-c2.config', value => '/opt/trafficserver/etc/trafficserver', }, }, 'error_url' => { new => 'Parameter', using => { id => 24, name => 'error_url', config_file => 'url_sig_cdl-c2.config', value => '403', }, }, 'CONFIG-proxy.config.allocator.debug_filter' => { new => 'Parameter', using => { id => 25, name => 'CONFIG proxy.config.allocator.debug_filter', config_file => 'records.config', value => 'INT 0', }, }, 'CONFIG-proxy.config.allocator.enable_reclaim' => { new => 'Parameter', using => { id => 26, name => 'CONFIG proxy.config.allocator.enable_reclaim', config_file => 'records.config', value => 'INT 0', }, }, 'CONFIG-proxy.config.allocator.max_overage' => { new => 'Parameter', using => { id => 27, name => 'CONFIG proxy.config.allocator.max_overage', config_file => 'records.config', value => 'INT 3', }, }, 'CONFIG-proxy.config.diags.show_location' => { new => 'Parameter', using => { id => 28, name => 'CONFIG proxy.config.diags.show_location', config_file => 'records.config', value => 'INT 0', }, }, 'CONFIG-proxy.config.http.cache.allow_empty_doc' => { new => 'Parameter', using => { id => 29, name => 'CONFIG proxy.config.http.cache.allow_empty_doc', config_file => 'records.config', value => 'INT 0', }, }, 'LOCAL-proxy.config.cache.interim.storage' => { new => 'Parameter', using => { id => 30, name => 'LOCAL proxy.config.cache.interim.storage', config_file => 'records.config', value => 'STRING NULL', }, }, 'CONFIG-proxy.config.http.parent_proxy.file' => { new => 'Parameter', using => { id => 31, name => 'CONFIG proxy.config.http.parent_proxy.file', config_file => 'records.config', value => 'STRING parent.config', }, }, '12M_location' => { new => 'Parameter', using => { id => 32, name => 'location', config_file => '12M_facts', value => '/opt/ort', }, }, 'cacheurl_location' => { new => 'Parameter', using => { id => 33, name => 'location', config_file => 'cacheurl.config', value => '/opt/trafficserver/etc/trafficserver/', }, }, 'ip_allow_location' => { new => 'Parameter', using => { id => 34, name => 'location', config_file => 'ip_allow.config', value => '/opt/trafficserver/etc/trafficserver', }, }, 'astats_over_http.so' => { new => 'Parameter', using => { id => 35, name => 'astats_over_http.so', config_file => 'plugin.config', value => '_astats 33.101.99.100,172.39.19.39,172.39.19.49,172.39.19.49,172.39.29.49', }, }, 'crontab_root_location' => { new => 'Parameter', using => { id => 36, name => 'location', config_file => 'crontab_root', value => '/var/spool/cron', }, }, 'hdr_rw_cdl-c2.config_location' => { new => 'Parameter', using => { id => 37, name => 'location', config_file => 'hdr_rw_cdl-c2.config', value => '/opt/trafficserver/etc/trafficserver', }, }, '50-ats.rules_location' => { new => 'Parameter', using => { id => 38, name => 'location', config_file => '50-ats.rules', value => '/etc/udev/rules.d/', }, }, 'parent.config_location' => { new => 'Parameter', using => { id => 39, name => 'location', config_file => 'parent.config', value => '/opt/trafficserver/etc/trafficserver/', }, }, 'remap.config_location' => { new => 'Parameter', using => { id => 40, name => 'location', config_file => 'remap.config', value => '/opt/trafficserver/etc/trafficserver/', }, }, 'drop_qstring.config_location' => { new => 'Parameter', using => { id => 41, name => 'location', config_file => 'drop_qstring.config', value => '/opt/trafficserver/etc/trafficserver', }, }, 'LogFormat.Format' => { new => 'Parameter', using => { id => 42, name => 'LogFormat.Format', config_file => 'logs_xml.config', value => '%<cqtq> chi=%<chi> phn=%<phn> shn=%<shn> url=%<cquuc> cqhm=%<cqhm> cqhv=%<cqhv> pssc=%<pssc> ttms=%<ttms> b=%<pscl> sssc=%<sssc> sscl=%<sscl> cfsc=%<cfsc> pfsc=%<pfsc> crc=%<crc> phr=%<phr> uas="%<{User-Agent}cqh>"', }, }, 'LogFormat.Name' => { new => 'Parameter', using => { id => 43, name => 'LogFormat.Name', config_file => 'logs_xml.config', value => 'custom_ats_2', }, }, 'LogObject.Format' => { new => 'Parameter', using => { id => 44, name => 'LogObject.Format', config_file => 'logs_xml.config', value => 'custom_ats_2', }, }, 'LogObject.Filename' => { new => 'Parameter', using => { id => 45, name => 'LogObject.Filename', config_file => 'logs_xml.config', value => 'custom_ats_2', }, }, 'cache.config_location' => { new => 'Parameter', using => { id => 46, name => 'location', config_file => 'cache.config', value => '/opt/trafficserver/etc/trafficserver/', }, }, 'CONFIG-proxy.config.cache.control.filename' => { new => 'Parameter', using => { id => 47, name => 'CONFIG proxy.config.cache.control.filename', config_file => 'records.config', value => 'STRING cache.config', }, }, 'regex_revalidate.so' => { new => 'Parameter', using => { id => 48, name => 'regex_revalidate.so', config_file => 'plugin.config', value => '--config regex_revalidate.config', }, }, 'regex_revalidate.config_location' => { new => 'Parameter', using => { id => 49, name => 'location', config_file => 'regex_revalidate.config', value => '/opt/trafficserver/etc/trafficserver', }, }, 'hosting.config_location' => { new => 'Parameter', using => { id => 50, name => 'location', config_file => 'hosting.config', value => '/opt/trafficserver/etc/trafficserver/', }, }, 'volume.config_location' => { new => 'Parameter', using => { id => 51, name => 'location', config_file => 'volume.config', value => '/opt/trafficserver/etc/trafficserver/', }, }, 'allow_ip' => { new => 'Parameter', using => { id => 52, name => 'allow_ip', config_file => 'astats.config', value => '127.0.0.1,172.39.0.0/16,33.101.99.0/24', }, }, 'allow_ip6' => { new => 'Parameter', using => { id => 53, name => 'allow_ip6', config_file => 'astats.config', value => '::1,2033:D011:3300::336/64,2033:D011:3300::335/64,2033:D021:3300::333/64,2033:D021:3300::334/64', }, }, 'record_types' => { new => 'Parameter', using => { id => 54, name => 'record_types', config_file => 'astats.config', value => '144', }, }, 'astats.config_location' => { new => 'Parameter', using => { id => 55, name => 'location', config_file => 'astats.config', value => '/opt/trafficserver/etc/trafficserver', }, }, 'astats.config_path' => { new => 'Parameter', using => { id => 56, name => 'path', config_file => 'astats.config', value => '_astats', }, }, 'storage.config_location' => { new => 'Parameter', using => { id => 57, name => 'location', config_file => 'storage.config', value => '/opt/trafficserver/etc/trafficserver/', }, }, 'Drive_Prefix' => { new => 'Parameter', using => { id => 58, name => 'Drive_Prefix', config_file => 'storage.config', value => '/dev/sd', }, }, 'Drive_Letters' => { new => 'Parameter', using => { id => 59, name => 'Drive_Letters', config_file => 'storage.config', value => 'b,c,d,e,f,g,h,i,j,k,l,m,n,o', }, }, 'Disk_Volume' => { new => 'Parameter', using => { id => 60, name => 'Disk_Volume', config_file => 'storage.config', value => '1', }, }, 'CONFIG-proxy.config.hostdb.storage_size' => { new => 'Parameter', using => { id => 61, name => 'CONFIG proxy.config.hostdb.storage_size', config_file => 'records.config', value => 'INT 33554432', }, }, 'regex_revalidate.config_snapshot_dir' => { new => 'Parameter', using => { id => 62, name => 'snapshot_dir', config_file => 'regex_revalidate.config', value => 'public/Trafficserver-Snapshots/', }, }, 'regex_revalidate.config_max_days' => { new => 'Parameter', using => { id => 63, name => 'maxRevalDurationDays', config_file => 'regex_revalidate.config', value => 3, }, }, 'regex_revalidate.config_ttl_max_hours' => { new => 'Parameter', using => { id => 64, name => 'ttl_max_hours', config_file => 'regex_revalidate.config', value => 768, }, }, 'regex_revalidate.config_ttl_min_hours' => { new => 'Parameter', using => { id => 65, name => 'ttl_min_hours', config_file => 'regex_revalidate.config', value => 48, }, }, ); sub get_definition { my ( $self, $name ) = @_; return $definition_for{$name}; } sub all_fixture_names { return keys %definition_for; } __PACKAGE__->meta->make_immutable; 1;
weifensh/traffic_control
traffic_ops/app/lib/Fixtures/Parameter.pm
Perl
apache-2.0
14,839
#!/usr/bin/perl -w use strict; my $working_dir = $0; $working_dir =~ s:/[^/]*$::; require "$working_dir/utils.pl" || die; my $curr_test = 0; my $has_error = 0; sub chk (@) { my ($test, @msg) = @_; my $tn = ++$curr_test; if ($test) { print "PASS: $tn - @msg\n"; } else { print "FAIL: $tn - @msg\n"; $has_error++; } } # fields_in_line() chk fields_in_line('hello,world', ',') == 2, "fields_in_line()"; chk fields_in_line('hello', ',') == 1, "fields_in_line():single-field line"; # field_str() chk field_str('hello', "hello,world\n", ',') == 0, "field_str():first field"; chk field_str('world', "hello,world\n", ',') == 1, "field_str():last field"; chk ! defined field_str('goodbye', "hello,world\n", ','), "field_str(): non-existant field"; # get_line_field() chk get_line_field('1|2|3|4', 0, '|') == 1, "get_line_field(): 1st pos" ; chk get_line_field('1|2|3|4', 3, '|') == 4, "get_line_field(): last pos" ; chk get_line_field('1|2|3|4', 1, '|') == 2, "get_line_field(): middle pos" ; exit $has_error;
dbushong/crush-tools
src/perllib/utils_test.pl
Perl
apache-2.0
1,062
package Buddha::BadFixture; use strict; use warnings; use base qw(Test::FITesque::Fixture); sub chi : Argh { return 'chi'; } 1;
konobi/Test-FITesque
t/lib/Buddha/BadFixture.pm
Perl
bsd-3-clause
133
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!! # This file is machine-generated by lib/unicore/mktables from the Unicode # database, Version 6.2.0. Any changes made here will be lost! # !!!!!!! INTERNAL PERL USE ONLY !!!!!!! # This file is for internal use by core Perl only. The format and even the # name or existence of this file are subject to change without notice. Don't # use it directly. return <<'END'; 0023 0025 00A2 00A5 00B0 00B1 058F 0609 060A 066A 09F2 09F3 09FB 0AF1 0BF9 0E3F 17DB 2030 2034 20A0 20BA 212E 2213 A838 A839 FE5F FE69 FE6A FF03 FF05 FFE0 FFE1 FFE5 FFE6 END
Bjay1435/capstone
rootfs/usr/share/perl/5.18.2/unicore/lib/Bc/ET.pl
Perl
mit
613
package TestAPRlib::threadrwlock; use strict; use warnings FATAL => 'all'; use Apache::Test; use Apache::TestUtil; use APR::Const -compile => qw(EBUSY SUCCESS); use APR::Pool(); sub num_of_tests { return 5; } sub test { require APR::ThreadRWLock; my $pool = APR::Pool->new(); my $mutex = APR::ThreadRWLock->new($pool); ok $mutex; ok t_cmp($mutex->rdlock, APR::Const::SUCCESS, 'rdlock == APR::Const::SUCCESS'); ok t_cmp($mutex->unlock, APR::Const::SUCCESS, 'unlock == APR::Const::SUCCESS'); ok t_cmp($mutex->wrlock, APR::Const::SUCCESS, 'wrlock == APR::Const::SUCCESS'); ok t_cmp($mutex->unlock, APR::Const::SUCCESS, 'unlock == APR::Const::SUCCESS'); } 1;
gitpan/mod_perl
t/lib/TestAPRlib/threadrwlock.pm
Perl
apache-2.0
757
# # Copyright 2017 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 example::plugin_snmp; use strict; use warnings; use base qw(centreon::plugins::script_snmp); sub new { my ($class, %options) = @_; my $self = $class->SUPER::new(package => __PACKAGE__, %options); bless $self, $class; $self->{version} = '0.1'; %{$self->{modes}} = ( 'getvalue' => 'example::mode::getvalue' ); return $self; } 1; __END__ =head1 PLUGIN DESCRIPTION An example of SNMP plugin type. =cut
nichols-356/centreon-plugins
example/plugin_snmp.pm
Perl
apache-2.0
1,249
use strict; use Fcntl; use AnyEvent; use AnyEvent::WebSocket::Client; sysopen my $tuntap, $ARGV[0], O_RDWR; die $! if tell($tuntap) < 0; my $client = AnyEvent::WebSocket::Client->new; my $connection; my $tap_event; $client->connect($ARGV[1])->cb( sub { $connection = eval { shift->recv }; die $@ if $@; print "connected to ".$ARGV[1]."\n"; $tap_event = AnyEvent->io( fh => $tuntap, poll => 'r', cb => sub { my $buf ; sysread $tuntap, $buf, 1500; $connection->send( AnyEvent::WebSocket::Message->new(body =>$buf, opcode => 2 ) ) ; }); $connection->on(each_message => sub { my($connection, $message) = @_; syswrite $tuntap, $message->body, length($message->body); }); } ); AnyEvent->condvar->recv;
faint32/vpn-ws
clients/vpn.pl
Perl
mit
742
package Plack; use strict; use warnings; use 5.008_001; our $VERSION = '1.0029'; $VERSION = eval $VERSION; 1; __END__ =head1 NAME Plack - Perl Superglue for Web frameworks and Web Servers (PSGI toolkit) =head1 DESCRIPTION Plack is a set of tools for using the PSGI stack. It contains middleware components, a reference server and utilities for Web application frameworks. Plack is like Ruby's Rack or Python's Paste for WSGI. See L<PSGI> for the PSGI specification and L<PSGI::FAQ> to know what PSGI and Plack are and why we need them. =head1 MODULES AND UTILITIES =head2 Plack::Handler L<Plack::Handler> and its subclasses contains adapters for web servers. We have adapters for the built-in standalone web server L<HTTP::Server::PSGI>, L<CGI|Plack::Handler::CGI>, L<FCGI|Plack::Handler::FCGI>, L<Apache1|Plack::Handler::Apache1>, L<Apache2|Plack::Handler::Apache2> and L<HTTP::Server::Simple|Plack::Handler::HTTP::Server::Simple> included in the core Plack distribution. There are also many HTTP server implementations on CPAN that have Plack handlers. See L<Plack::Handler> when writing your own adapters. =head2 Plack::Loader L<Plack::Loader> is a loader to load one L<Plack::Handler> adapter and run a PSGI application code reference with it. =head2 Plack::Util L<Plack::Util> contains a lot of utility functions for server implementors as well as middleware authors. =head2 .psgi files A PSGI application is a code reference but it's not easy to pass code reference via the command line or configuration files, so Plack uses a convention that you need a file named C<app.psgi> or similar, which would be loaded (via perl's core function C<do>) to return the PSGI application code reference. # Hello.psgi my $app = sub { my $env = shift; # ... return [ $status, $headers, $body ]; }; If you use a web framework, chances are that they provide a helper utility to automatically generate these C<.psgi> files for you, such as: # MyApp.psgi use MyApp; my $app = sub { MyApp->run_psgi(@_) }; It's important that the return value of C<.psgi> file is the code reference. See C<eg/dot-psgi> directory for more examples of C<.psgi> files. =head2 plackup, Plack::Runner L<plackup> is a command line launcher to run PSGI applications from command line using L<Plack::Loader> to load PSGI backends. It can be used to run standalone servers and FastCGI daemon processes. Other server backends like Apache2 needs a separate configuration but C<.psgi> application file can still be the same. If you want to write your own frontend that replaces, or adds functionalities to L<plackup>, take a look at the L<Plack::Runner> module. =head2 Plack::Middleware PSGI middleware is a PSGI application that wraps an existing PSGI application and plays both side of application and servers. From the servers the wrapped code reference still looks like and behaves exactly the same as PSGI applications. L<Plack::Middleware> gives you an easy way to wrap PSGI applications with a clean API, and compatibility with L<Plack::Builder> DSL. =head2 Plack::Builder L<Plack::Builder> gives you a DSL that you can enable Middleware in C<.psgi> files to wrap existent PSGI applications. =head2 Plack::Request, Plack::Response L<Plack::Request> gives you a nice wrapper API around PSGI C<$env> hash to get headers, cookies and query parameters much like L<Apache::Request> in mod_perl. L<Plack::Response> does the same to construct the response array reference. =head2 Plack::Test L<Plack::Test> is a unified interface to test your PSGI application using standard L<HTTP::Request> and L<HTTP::Response> pair with simple callbacks. =head2 Plack::Test::Suite L<Plack::Test::Suite> is a test suite to test a new PSGI server backend. =head1 CONTRIBUTING =head2 Patches and Bug Fixes Small patches and bug fixes can be either submitted via nopaste on IRC L<irc://irc.perl.org/#plack> or L<the github issue tracker|http://github.com/plack/Plack/issues>. Forking on L<github|http://github.com/plack/Plack> is another good way if you intend to make larger fixes. See also L<http://contributing.appspot.com/plack> when you think this document is terribly outdated. =head2 Module Namespaces Modules added to the Plack:: sub-namespaces should be reasonably generic components which are useful as building blocks and not just simply using Plack. Middleware authors are free to use the Plack::Middleware:: namespace for their middleware components. Middleware must be written in the pipeline style such that they can chained together with other middleware components. The Plack::Middleware:: modules in the core distribution are good examples of such modules. It is recommended that you inherit from L<Plack::Middleware> for these types of modules. Not all middleware components are wrappers, but instead are more like endpoints in a middleware chain. These types of components should use the Plack::App:: namespace. Again, look in the core modules to see excellent examples of these (L<Plack::App::File>, L<Plack::App::Directory>, etc.). It is recommended that you inherit from L<Plack::Component> for these types of modules. B<DO NOT USE> Plack:: namespace to build a new web application or a framework. It's like naming your application under CGI:: namespace if it's supposed to run on CGI and that is a really bad choice and would confuse people badly. =head1 AUTHOR Tatsuhiko Miyagawa =head1 COPYRIGHT The following copyright notice applies to all the files provided in this distribution, including binary files, unless explicitly noted otherwise. Copyright 2009-2013 Tatsuhiko Miyagawa =head1 CORE DEVELOPERS Tatsuhiko Miyagawa (miyagawa) Tokuhiro Matsuno (tokuhirom) Jesse Luehrs (doy) Tomas Doran (bobtfish) Graham Knop (haarg) =head1 CONTRIBUTORS Yuval Kogman (nothingmuch) Kazuhiro Osawa (Yappo) Kazuho Oku Florian Ragwitz (rafl) Chia-liang Kao (clkao) Masahiro Honma (hiratara) Daisuke Murase (typester) John Beppu Matt S Trout (mst) Shawn M Moore (Sartak) Stevan Little Hans Dieter Pearcey (confound) mala Mark Stosberg Aaron Trevena =head1 SEE ALSO The L<PSGI> specification upon which Plack is based. L<http://plackperl.org/> The Plack wiki: L<https://github.com/plack/Plack/wiki> The Plack FAQ: L<https://github.com/plack/Plack/wiki/Faq> =head1 LICENSE This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut
edvakf/isu3pre
perl/local/lib/perl5/Plack.pm
Perl
mit
6,449
use CatalystX::GlobalContext qw( $c ); use strict; use warnings; use English; use XML::Generator; use CXGN::Scrap::AjaxPage; use CXGN::Tools::List qw/str_in/; use CXGN::ITAG::Pipeline; our $itag_feature = $c->enabled_feature('itag') or do { print "\n\nITAG feature not enabled.\n"; exit }; eval { $ENV{CXGNITAGPIPELINEANALYSISTESTING} = 1 unless $c->get_conf('production_server'); my $page = CXGN::Scrap::AjaxPage->new("text/plain"); $page->send_http_header; my ( $op ) = $page->get_encoded_arguments('op'); $op or die "must specify an operation when calling status web service\n"; #hash of operations my %ops = ( astat => sub { analysis_status($page) }, lbs => sub { my ($p,$b) = get_pipe_and_batch($page); $b->seqlist}, lb => sub { get_pipe($page)->list_batches }, la => sub { get_pipe($page)->list_analyses }, lp => sub { map {sprintf("%03d",$_)} $itag_feature->list_pipelines }, ); $ops{$op} or die "unknown operation. valid operations are: ".join(',',sort keys %ops)."\n"; print map "$_\n",$ops{$op}->(); #call the operation and print its results }; if($EVAL_ERROR) { print "\n\nERROR: $EVAL_ERROR\nWeb service documentation can be found at: http://www.ab.wur.nl/TomatoWiki/PipelineStatusWebService\n"; } exit; ############ OPERATION SUBS ############################## sub analysis_status { my $page = shift; my ($pipe,$batch) = get_pipe_and_batch($page); my ($atag) = $page->get_encoded_arguments('atag'); my $a = $pipe->analysis($atag) or die "no analysis found with that tag name\n"; return $a->status($batch); } ######### UTIL SUBS ###################################### sub get_pipe_and_batch { my ( $page ) = @_; my $pipe = get_pipe($page); my ($bnum) = $page->get_encoded_arguments('batch'); $bnum += 0; my $batch = $pipe->batch($bnum) or die "batch number $bnum does not exist"; return ($pipe,$batch); } sub get_pipe { my ( $page ) = @_; my ( $ver ) = $page->get_encoded_arguments('pipe'); my @args = defined $ver ? (version => $ver+0) : (); my $pipe = $itag_feature->pipeline( @args ) or die 'pipeline version $ver not found'; return $pipe; }
solgenomics/sgn
cgi-bin/sequencing/itag/status.pl
Perl
mit
2,240
## Class to convert a pair of a word and yomi #!/usr/bin/env perl package KKCI2Pron::WordkkciConverter; use strict; use warnings; use encoding 'utf-8'; use Carp; our $DEBUG = 0; # Table to refer to a word in converting a yomi # # 助詞: 「は」、「へ」、「を」 my %TABLE_CONVERT_WITH_WORD = ( 'は/ハ' => "は/ワ", 'へ/ヘ' => "へ/エ", 'を/ヲ' => "を/オ", ); # Table to stop converting # 句読点 my @TABLE_STOP_CONVERT = qw/、 , 。 ./; # Constructor # # @param Mixed converter to convert a yomi to a pronunciation sub new { my $class = shift; (@_ == 1) or die $!; my $instances = { 'converter' => shift }; bless $instances, $class; } # Convert a yomi of a word to a pronunciation # # @param String $word a word # @param String $kkci a yomi # @return String a pair of a word and pronunciation sub convert { my $self = shift; (@_ == 2) or croak $!; my ($word, $kkci) = @_; my $wk = "$word/$kkci"; if (defined($TABLE_CONVERT_WITH_WORD{$wk})) { $wk = $TABLE_CONVERT_WITH_WORD{$wk}; } else { if (! grep /$kkci/, @TABLE_STOP_CONVERT) { $kkci = $self->{converter}->convert(\$kkci); } $wk = "$word/$kkci"; } if ($DEBUG) { warn "word=$word, kkci=$kkci"; } return $wk; } 1;
gologo13/kkci2pron
bin/WordkkciConverter.pm
Perl
mit
1,309
#! /usr/bin/perl ############################################################################### # Copyright (C) 1994 - 2009, Performance Dynamics Company # # # # This software is licensed as described in the file COPYING, which # # you should have received as part of this distribution. The terms # # are also available at http://www.perfdynamics.com/Tools/copyright.html. # # # # You may opt to use, copy, modify, merge, publish, distribute and/or sell # # copies of the Software, and permit persons to whom the Software is # # furnished to do so, under the terms of the COPYING file. # # # # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY # # KIND, either express or implied. # ############################################################################### # utiliz1.pl # Array of measured busy periods (min) @busyData = (1.23, 2.01, 3.11, 1.02, 1.54, 2.69, 3.41, 2.87, 2.22, 2.83); # Compute the aggregate busy time foreach $busy (@busyData) { $B_server += $busy; } $T_period = 30; # Measurement period (min) $rho = $B_server / $T_period; # Utilization printf("Busy time (B): %6.2f min\n", $B_server); printf("Utilization (U): %6.2f or %4.2f%%\n", $rho, 100 * $rho); # Output ... # Busy time (B): 22.93 min # Utilization (U): 0.76 or 76.43%
peterlharding/PDQ
examples/ppdq_2005/perl_examples/utiliz1.pl
Perl
mit
1,698
%query: primes(i,o). % From "Programming in Prolog" by Clocksin and Mellish, 1981 primes(Limit, Ps) :- integers(2, Limit, Is), sift(Is, Ps). integers(Low, High, [Low|Rest]) :- Low =< High, !, M is Low+1, integers(M, High, Rest). integers(_, _, []). sift([], []). sift([I|Is],[I|Ps]) :- remove(I, Is, New), sift(New, Ps). remove(P, [], []). remove(P, [I|Is], [I|Nis]):- \+ 0 is I mod P, !, remove(P, Is, Nis). remove(P, [I|Is], Nis) :- 0 is I mod P, !, remove(P, Is, Nis).
ComputationWithBoundedResources/ara-inference
doc/tpdb_trs/Prolog/prolog_mixed/primes.pl
Perl
mit
489
# !!!!!!! 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'; V1218 65 91 97 123 170 171 181 182 186 187 192 215 216 247 248 706 710 722 736 741 748 749 750 751 880 885 886 888 890 894 895 896 902 903 904 907 908 909 910 930 931 1014 1015 1154 1162 1328 1329 1367 1369 1370 1376 1417 1488 1515 1519 1523 1568 1611 1646 1648 1649 1748 1749 1750 1765 1767 1774 1776 1786 1789 1791 1792 1808 1809 1810 1840 1869 1958 1969 1970 1994 2027 2036 2038 2042 2043 2048 2070 2074 2075 2084 2085 2088 2089 2112 2137 2144 2155 2208 2229 2230 2238 2308 2362 2365 2366 2384 2385 2392 2402 2417 2433 2437 2445 2447 2449 2451 2473 2474 2481 2482 2483 2486 2490 2493 2494 2510 2511 2524 2526 2527 2530 2544 2546 2556 2557 2565 2571 2575 2577 2579 2601 2602 2609 2610 2612 2613 2615 2616 2618 2649 2653 2654 2655 2674 2677 2693 2702 2703 2706 2707 2729 2730 2737 2738 2740 2741 2746 2749 2750 2768 2769 2784 2786 2809 2810 2821 2829 2831 2833 2835 2857 2858 2865 2866 2868 2869 2874 2877 2878 2908 2910 2911 2914 2929 2930 2947 2948 2949 2955 2958 2961 2962 2966 2969 2971 2972 2973 2974 2976 2979 2981 2984 2987 2990 3002 3024 3025 3077 3085 3086 3089 3090 3113 3114 3130 3133 3134 3160 3163 3168 3170 3200 3201 3205 3213 3214 3217 3218 3241 3242 3252 3253 3258 3261 3262 3294 3295 3296 3298 3313 3315 3333 3341 3342 3345 3346 3387 3389 3390 3406 3407 3412 3415 3423 3426 3450 3456 3461 3479 3482 3506 3507 3516 3517 3518 3520 3527 3585 3633 3634 3636 3648 3655 3713 3715 3716 3717 3718 3723 3724 3748 3749 3750 3751 3761 3762 3764 3773 3774 3776 3781 3782 3783 3804 3808 3840 3841 3904 3912 3913 3949 3976 3981 4096 4139 4159 4160 4176 4182 4186 4190 4193 4194 4197 4199 4206 4209 4213 4226 4238 4239 4256 4294 4295 4296 4301 4302 4304 4347 4348 4681 4682 4686 4688 4695 4696 4697 4698 4702 4704 4745 4746 4750 4752 4785 4786 4790 4792 4799 4800 4801 4802 4806 4808 4823 4824 4881 4882 4886 4888 4955 4992 5008 5024 5110 5112 5118 5121 5741 5743 5760 5761 5787 5792 5867 5873 5881 5888 5901 5902 5906 5920 5938 5952 5970 5984 5997 5998 6001 6016 6068 6103 6104 6108 6109 6176 6265 6272 6277 6279 6313 6314 6315 6320 6390 6400 6431 6480 6510 6512 6517 6528 6572 6576 6602 6656 6679 6688 6741 6823 6824 6917 6964 6981 6988 7043 7073 7086 7088 7098 7142 7168 7204 7245 7248 7258 7294 7296 7305 7312 7355 7357 7360 7401 7405 7406 7412 7413 7415 7418 7419 7424 7616 7680 7958 7960 7966 7968 8006 8008 8014 8016 8024 8025 8026 8027 8028 8029 8030 8031 8062 8064 8117 8118 8125 8126 8127 8130 8133 8134 8141 8144 8148 8150 8156 8160 8173 8178 8181 8182 8189 8305 8306 8319 8320 8336 8349 8450 8451 8455 8456 8458 8468 8469 8470 8473 8478 8484 8485 8486 8487 8488 8489 8490 8494 8495 8506 8508 8512 8517 8522 8526 8527 8579 8581 11264 11311 11312 11359 11360 11493 11499 11503 11506 11508 11520 11558 11559 11560 11565 11566 11568 11624 11631 11632 11648 11671 11680 11687 11688 11695 11696 11703 11704 11711 11712 11719 11720 11727 11728 11735 11736 11743 11823 11824 12293 12295 12337 12342 12347 12349 12353 12439 12445 12448 12449 12539 12540 12544 12549 12592 12593 12687 12704 12731 12784 12800 13312 19894 19968 40944 40960 42125 42192 42238 42240 42509 42512 42528 42538 42540 42560 42607 42623 42654 42656 42726 42775 42784 42786 42889 42891 42944 42946 42951 42999 43010 43011 43014 43015 43019 43020 43043 43072 43124 43138 43188 43250 43256 43259 43260 43261 43263 43274 43302 43312 43335 43360 43389 43396 43443 43471 43472 43488 43493 43494 43504 43514 43519 43520 43561 43584 43587 43588 43596 43616 43639 43642 43643 43646 43696 43697 43698 43701 43703 43705 43710 43712 43713 43714 43715 43739 43742 43744 43755 43762 43765 43777 43783 43785 43791 43793 43799 43808 43815 43816 43823 43824 43867 43868 43880 43888 44003 44032 55204 55216 55239 55243 55292 63744 64110 64112 64218 64256 64263 64275 64280 64285 64286 64287 64297 64298 64311 64312 64317 64318 64319 64320 64322 64323 64325 64326 64434 64467 64830 64848 64912 64914 64968 65008 65020 65136 65141 65142 65277 65313 65339 65345 65371 65382 65471 65474 65480 65482 65488 65490 65496 65498 65501 65536 65548 65549 65575 65576 65595 65596 65598 65599 65614 65616 65630 65664 65787 66176 66205 66208 66257 66304 66336 66349 66369 66370 66378 66384 66422 66432 66462 66464 66500 66504 66512 66560 66718 66736 66772 66776 66812 66816 66856 66864 66916 67072 67383 67392 67414 67424 67432 67584 67590 67592 67593 67594 67638 67639 67641 67644 67645 67647 67670 67680 67703 67712 67743 67808 67827 67828 67830 67840 67862 67872 67898 67968 68024 68030 68032 68096 68097 68112 68116 68117 68120 68121 68150 68192 68221 68224 68253 68288 68296 68297 68325 68352 68406 68416 68438 68448 68467 68480 68498 68608 68681 68736 68787 68800 68851 68864 68900 69376 69405 69415 69416 69424 69446 69600 69623 69635 69688 69763 69808 69840 69865 69891 69927 69956 69957 69968 70003 70006 70007 70019 70067 70081 70085 70106 70107 70108 70109 70144 70162 70163 70188 70272 70279 70280 70281 70282 70286 70287 70302 70303 70313 70320 70367 70405 70413 70415 70417 70419 70441 70442 70449 70450 70452 70453 70458 70461 70462 70480 70481 70493 70498 70656 70709 70727 70731 70751 70752 70784 70832 70852 70854 70855 70856 71040 71087 71128 71132 71168 71216 71236 71237 71296 71339 71352 71353 71424 71451 71680 71724 71840 71904 71935 71936 72096 72104 72106 72145 72161 72162 72163 72164 72192 72193 72203 72243 72250 72251 72272 72273 72284 72330 72349 72350 72384 72441 72704 72713 72714 72751 72768 72769 72818 72848 72960 72967 72968 72970 72971 73009 73030 73031 73056 73062 73063 73065 73066 73098 73112 73113 73440 73459 73728 74650 74880 75076 77824 78895 82944 83527 92160 92729 92736 92767 92880 92910 92928 92976 92992 92996 93027 93048 93053 93072 93760 93824 93952 94027 94032 94033 94099 94112 94176 94178 94179 94180 94208 100344 100352 101107 110592 110879 110928 110931 110948 110952 110960 111356 113664 113771 113776 113789 113792 113801 113808 113818 119808 119893 119894 119965 119966 119968 119970 119971 119973 119975 119977 119981 119982 119994 119995 119996 119997 120004 120005 120070 120071 120075 120077 120085 120086 120093 120094 120122 120123 120127 120128 120133 120134 120135 120138 120145 120146 120486 120488 120513 120514 120539 120540 120571 120572 120597 120598 120629 120630 120655 120656 120687 120688 120713 120714 120745 120746 120771 120772 120780 123136 123181 123191 123198 123214 123215 123584 123628 124928 125125 125184 125252 125259 125260 126464 126468 126469 126496 126497 126499 126500 126501 126503 126504 126505 126515 126516 126520 126521 126522 126523 126524 126530 126531 126535 126536 126537 126538 126539 126540 126541 126544 126545 126547 126548 126549 126551 126552 126553 126554 126555 126556 126557 126558 126559 126560 126561 126563 126564 126565 126567 126571 126572 126579 126580 126584 126585 126589 126590 126591 126592 126602 126603 126620 126625 126628 126629 126634 126635 126652 131072 173783 173824 177973 177984 178206 178208 183970 183984 191457 194560 195102 END
operepo/ope
client_tools/svc/rc/usr/share/perl5/core_perl/unicore/lib/Gc/L.pl
Perl
mit
7,392
# # $Header: svn://svn/SWM/trunk/web/DeMoron.pm 8251 2013-04-08 09:00:53Z rlee $ # package DeMoron; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(demoronise); @EXPORT_OK = qw(demoronise); use utf8; # # De-moron-ise Text from Microsoft Applications # # by John Walker -- January 1998 # http://www.fourmilab.ch/ # # This program is in the public domain. # # This is the Unmoroniser fork # Changelog: # June 2003: Unicode added by Charlie Loyd sub demoronise { my ($s) = @_; # Eliminate idiot MS-DOS carriage returns from line terminator #$s =~ s/\s+$//; #$s .= "\n"; # Fix strategically non-standard characters 0x82 through 0x9f. # Unicode! #$s =~ s/\x{20AC}/&euro;/g; # Euro currency symbol (looks like e) #$s =~ s/\x82/&sbquo;/g; # single low open quote (looks like ,) #$s =~ s/\x83/&fnof;/g; # function, folder, and florin symbol (looks like f) #$s =~ s/\x84/&bdquo;/g; # double low open quote (looks like ,,) $s =~ s/\x85/.../g; $s =~ s/\x{e280a6}/&hellip;/g; # horizontal ellipsis (looks like ...) #$s =~ s/\x86/&dagger;/g; # dagger symbol (death or second footnote) #$s =~ s/\x87/&Dagger;/g; # double dagger symbol (third footnote) #$s =~ s/\x88/&circ;/g; # empty circumflex accent (looks like ^) #$s =~ s/\x89/&permil;/g; # per-thousand symbol (looks like %0) #$s =~ s/\x8a/&Scaron;/g; # capital s with caron (looks like S + v) #$s =~ s/\x8b/&lsaquo;/g; # left single angle quote (looks like less-than) #$s =~ s/\x8c/&OElig;/g; # capital o-e ligature (looks like Oe) #$s =~ s/\x8e/&#x017d;/g; # capital z with caron (looks like Z + v) $s =~ s/\x{e28098}/&lsquo;/g; # left single quote (looks like `) $s =~ s/\x{e28099}/&rsquo;/g; # right single quote (looks like ') $s =~ s/\x{e2809c}/&ldquo;/g; # left double quote (looks like ``) $s =~ s/\x{e2809d}/&rdquo;/g; # right double quote (looks like ") $s =~ s/\x93/"/g; $s =~ s/\x94/"/g; #$s =~ s/\x95/&bull;/g; # bullet (dot for lists) $s =~ s/\x96/&ndash;/g; # en dash (looks like -) $s =~ s/\x97/&mdash;/g; # em dash (looks like --) #$s =~ s/\x98/&tilde;/g; # small tilde (looks like ~) #$s =~ s/\x99/&trade;/g; # trademark symbol (looks like TM) #$s =~ s/\x9a/&scaron;/g; # lowercase s with caron (looks like s + v) #$s =~ s/\x9b/&rsaquo;/g; # right single angle quote (looks like greater-than) #$s =~ s/\x9c/&oelig;/g; # lowercase o-e ligature (looks like oe) #$s =~ s/\x9e/&#x017e;/g; # lowercase z with caron (looks like z + v) #$s =~ s/\x9f/&Yuml;/g; # capital y with diaeresis or umlaut (looks like Y + ") # That was Unicode. # Now check for any remaining untranslated characters. #if ($s =~ m/[\x00-\x08\x10-\x1F\x80-\x9F]/) { #for (my $i = 0; $i < length($s); $i++) { #my $c = substr($s, $i, 1); #if ($c =~ m/[\x00-\x09\x10-\x1F\x80-\x9F]/) { #printf(STDERR "$ifname: warning--untranslated character 0x%02X in input line %d, output line(s) %d(...).\n", #unpack('C', $c), $iline, $oline + 1); #} #} #} # Supply missing semicolon at end of numeric entity if # Billy's bozos left it out. $s =~ s/(&#[0-2]\d\d)\s/$1; /g; # Fix dimbulb obscure numeric rendering of &lt; &gt; &amp; $s =~ s/&#038;/&amp;/g; $s =~ s/&#060;/&lt;/g; $s =~ s/&#062;/&gt;/g; $s =~s/\x92/'/g; # Fix unquoted non-alphanumeric characters in table tags $s =~ s/(<TABLE\s.*)(WIDTH=)(\d+%)(\D)/$1$2"$3"$4/gi; $s =~ s/(<TD\s.*)(WIDTH=)(\d+%)(\D)/$1$2"$3"$4/gi; $s =~ s/(<TH\s.*)(WIDTH=)(\d+%)(\D)/$1$2"$3"$4/gi; # Correct PowerPoint mis-nesting of tags $s =~ s-(<Font .*>\s*<STRONG>.*)(</FONT>\s*</STRONG>)-$1</STRONG></Font>-gi; # Translate bonehead PowerPoint misuse of <UL> to achieve # paragraph breaks. $s =~ s-<P>\s*<UL>-<p>-gi; $s =~ s-</UL><UL>-<p>-gi; $s =~ s-</UL>\s*</P>--gi; # Repair PowerPoint depredations in "text-only slides" $s =~ s-<P></P>--gi; $s =~ s- <TD HEIGHT=100- <tr><TD HEIGHT=100-ig; $s =~ s-<LI><H2>-<H2>-ig; $s; } 1;
facascante/slimerp
fifs/web/DeMoron.pm
Perl
mit
4,149
#!/usr/bin/env perl # Labels nodes with significant bootstrap values and returns useful pairwise distance statistics use strict; use warnings; use Data::Dumper; use Bio::TreeIO; use Getopt::Long; use File::Basename; use List::Util qw/min max sum/; use FindBin; use Math::Round qw/nearest/; use lib "$FindBin::RealBin/../lib"; use lib "$FindBin::RealBin/../lib/lib/perl5"; use Statistics::Descriptive; use Statistics::Basic qw(median); use LyveSET qw(logmsg); $0=fileparse $0; exit main(); sub main{ my $settings={}; GetOptions($settings,qw(tree=s pairwise=s outprefix=s help outputType=s bootstrap=i)) or die $!; die usage($settings) if($$settings{help}); $$settings{outputType}||="merged"; $$settings{bootstrap}||=70; # required parameters for(qw(tree pairwise outprefix)){ die "ERROR: need parameter for $_\n".usage() if(!$$settings{$_}); } # check for file existence for(qw(tree pairwise)){ die "ERROR: file $$settings{$_} does not exist!" if(!-e $$settings{$_}); } logmsg "Reading the pairwise file"; my $pairwise=readPairwise($$settings{pairwise},$settings); logmsg "Reading the tree and assigning names to high bootstrap nodes"; my ($treeArr, $labelHash, $allLeafArr) = readSigClades($$settings{tree},$$settings{bootstrap},$settings); logmsg "Reading high bootstrap nodes and outputing statistics"; my ($pairwiseCladeStats, $singletonCladeStats, $singletonTaxaStats, $treeStats) = generateSigCladeStats($labelHash, $pairwise, $allLeafArr, $settings); outputTrees([$treeArr],$$settings{outprefix},$settings); outputStatistics($pairwiseCladeStats,$singletonCladeStats,$singletonTaxaStats,$treeStats,$$settings{outprefix},$settings); outputLabels($labelHash,$$settings{outprefix},$settings); return 0; } # Read the pairwise file. sub readPairwise{ my($pairwise,$settings)=@_; my %dist; open(PAIRWISE,$pairwise) or die "ERROR: could not read $pairwise:$!"; while(<PAIRWISE>){ chomp; my($g1,$g2,$dist)=split /\t/; $dist{$g1}{$g2}=$dist; $dist{$g2}{$g1}=$dist; } close PAIRWISE; return \%dist; } # Count how many ancestor nodes are in a tree sub countAncNodes{ my($infile,$settings)=@_; my $in=new Bio::TreeIO(-file=>$infile); my $i=0; my $numTrees=0; while(my $treeIn=$in->next_tree){ $numTrees++; for my $node($treeIn->get_nodes){ next if($node->is_Leaf); next if(defined($node->bootstrap) && $node->bootstrap < 0.7); $i++; } } $in->close; # make sure to close it since it will be opened again soon logmsg "WARNING: the number of trees in the input file is $numTrees, whereas I expected only one." if($numTrees > 1); return $i; } # Generates unique node labels for significant nodes (>70%) # For each significant unique node label, generates a list of descendent leaves # Input: Newick tree with bootstrap values # Returns : Newick tree relabeled with unique node labels # Hash keyed to unique node labels pointing to lists of descendent leaves for each label sub readSigClades{ my($infile,$bootstrapthreshold,$settings)=@_; my @bootTree; # Tree with significant nodes labeled with letters my $i=0; my %labels = (); # Descendent taxa leaf name lists keyed to each significant node's label my @allLeaves; # List of all leaf ids in tree my @labelList; # Each leaf and its leaf names logmsg "Counting nodes in the tree before analyzing..."; my $numAncestorNodes=countAncNodes($infile,$settings); logmsg "I estimate about $numAncestorNodes ancestor nodes (not leaves) that will be analyzed"; logmsg "Compiling leaf list for each high-confidence node"; my $in=new Bio::TreeIO(-file=>$infile); while(my $treeIn=$in->next_tree){ my $labelLetter = 'A'; for my $node($treeIn->get_nodes){ next if($node->is_Leaf); # get all leaves of the node and alpha-sort them my @d; for my $taxon($node->get_all_Descendents){ my $taxonId=$taxon->id; next if(!$taxonId); next if(!$taxon->is_Leaf); push(@d,$taxonId); #if(defined $$pairwise{$taxonId}); } @d=sort{$a cmp $b} @d; my $numDesc=@d; # The bootstrap is the boostrap if it exists, # or it is the node identifier because of Newick weirdness. my $bootstrap=$node->bootstrap || $node->id; $bootstrap=0 if(!$bootstrap); # If the bootstrap is low then skip if($bootstrap < $bootstrapthreshold){ logmsg "Skipping node '$bootstrap' due to the low bootstrap values"; $node->bootstrap(1); # give it a really low fst $node->id(1); # give it a really low fst next; } # Relabel significant tree nodes with node name and bootstrap value my $labelName = $labelLetter; $node->bootstrap($labelName); $node->id($labelName); # Insert descendent node list into label hash $labels{ $labelLetter } = \@d; ++$labelLetter; if(++$i % 100 ==0){ logmsg "Finished with $i ancestor nodes"; } } push(@bootTree,$treeIn); logmsg "Compiling list of all leaves in tree."; foreach my $leaf ($treeIn->get_leaf_nodes){ push(@allLeaves, $leaf->id); } my $numLeaves = @allLeaves; logmsg "There are $numLeaves leafs in this tree."; } return (\@bootTree,\%labels,\@allLeaves); } # Iterates across nodes and generates distance metrics pairwise # with other nodes, and between the node and everything else sub generateSigCladeStats{ my ($labelHashRef,$pairwiseRef,$allLeafArrRef, $settings)=@_; my @treeSummary; my @pairwiseDistances; my @nodeSingletonDistances; my @taxaSingletonDistances; logmsg "Returning significant clade stats"; foreach my $node1 (keys %$labelHashRef) { # 1. Between and within node distances foreach my $node2 (keys %$labelHashRef) { my $distances = distancesBetweenNodes( $$labelHashRef{$node1}, $$labelHashRef{$node2}, $pairwiseRef, $settings ); push(@pairwiseDistances, sprintf("%s\t%s\t%d\t%d\t%d\t%d", $node1, $node2, median(@$distances), min(@$distances), max(@$distances), medianAbsoluteDeviation($distances))); } # 2. Between node leaves and all other leaves my @nodeLeafCopy = @{$$labelHashRef{$node1}}; my @allLeafCopy = @$allLeafArrRef; my %diff; # We set the keys of the diff hash to each label in allLeafCopy # Then we delete out all the keys that match labels in nodeLeafCopy # And what's left in diff is the difference between the two arrays @diff{ @allLeafCopy } = undef; delete @diff{ @nodeLeafCopy }; my @diffLeaf = keys %diff; my $distances = distancesBetweenNodes( $$labelHashRef{$node1}, \@diffLeaf, $pairwiseRef, $settings ); push(@nodeSingletonDistances, sprintf("%s\t%s\t%d\t%d\t%d\t%d", $node1, "Rest", median(@$distances), min(@$distances), max(@$distances), medianAbsoluteDeviation($distances))); } # 3. For each leaf, we also calculate distances to all other leafs foreach my $taxa (@$allLeafArrRef){ my @taxaArr = ($taxa); my @allLeafCopy = @$allLeafArrRef; my %diff; # We set the keys of the diff hash to each label in allLeafCopy # Then we delete out all the keys that match labels in nodeLeafCopy # And what's left in diff is the difference between the two arrays @diff{ @allLeafCopy } = undef; delete @diff{ @taxaArr }; my @diffLeaf = keys %diff; my $distances = distancesBetweenNodes( \@taxaArr, \@diffLeaf, $pairwiseRef, $settings ); push(@taxaSingletonDistances, sprintf("%s\t%s\t%d\t%d\t%d\t%d", $taxa, "Rest", median(@$distances), min(@$distances), max(@$distances), medianAbsoluteDeviation($distances))); } # 4. Calculate overall distances across the entire tree my $treeDistances = distancesBetweenNodes( $allLeafArrRef, $allLeafArrRef, $pairwiseRef, $settings ); push(@treeSummary, sprintf("%s\t%s\t%d\t%d\t%d\t%d", "Tree", "Tree", median(@$treeDistances), min(@$treeDistances), max(@$treeDistances), medianAbsoluteDeviation($treeDistances))); return (\@pairwiseDistances, \@nodeSingletonDistances, \@taxaSingletonDistances,\@treeSummary); } # Distances from the pairwise distance list between any two leaf lists sub distancesBetweenNodes{ my ($leafListRef1, $leafListRef2, $pairwiseRef, $settings)=@_; my @distanceArr = (); # Gather distances between members of list1 and list2 foreach my $name1 (@$leafListRef1) { foreach my $name2 (@$leafListRef2){ push (@distanceArr, ${$pairwiseRef}{$name1}{$name2}) if $name1 ne $name2; } } return \@distanceArr; } # Median absolute deviation (MAD): # 1. All the absolute distances from the median # 2. Take the median of those absolute distances # An LSKatz original sub medianAbsoluteDeviation{ my($data,$settings)=@_; my $stat=Statistics::Descriptive::Full->new(); $stat->add_data(@$data); my $median=$stat->median(); my @deviation; for(my $i=0;$i<@$data;$i++){ push(@deviation,abs($$data[$i] - $median)); } my $stat2=Statistics::Descriptive::Full->new(); $stat2->add_data(@deviation); return $stat2->median; } sub outputTrees{ my($treeArr,$prefix,$settings)=@_; my $numTrees=@{$$treeArr[0]}; my $fstOut=new Bio::TreeIO(-file=>">$prefix.labelednodes.dnd"); #my $pOut= new Bio::TreeIO(-file=>">$prefix.pvalue.dnd"); for(my $i=0;$i<$numTrees;$i++){ my $fstTree=$$treeArr[0][$i]; $fstOut->write_tree($fstTree); my $pvalueTree=$$treeArr[1][$i] || next; #$pOut->write_tree($pvalueTree); } $fstOut->close; #$pOut->close; return 1; } sub outputStatistics{ my($pairwiseCladeStats,$singletonCladeStats,$singletonTaxaStats,$treeStats,$prefix,$settings)=@_; if($$settings{outputType} eq "merged"){ my $out="$prefix.merged.cladestats.tsv"; open(STATS,">",$out) or die "ERROR: could not write to file $out:$!"; print STATS join("\t",qw(Node1 Node2 median min max MAD))."\n"; print STATS join("\n",@$pairwiseCladeStats)."\n"; print STATS join("\n",@$singletonCladeStats)."\n"; print STATS join("\n",@$singletonTaxaStats)."\n"; print STATS join("\n",@$treeStats)."\n"; close STATS; }else{ my $outpairwise="$prefix.pairwise.cladestats.tsv"; my $outsingClade="$prefix.singletonClades.cladestats.tsv"; my $outsingTaxa="$prefix.singletonTaxa.cladestats.tsv"; my $outTree="$prefix.tree.cladestats.tsv"; open(STATS1,">",$outpairwise) or die "ERROR: could not write to file $outpairwise:$!"; print STATS1 join("\t",qw(Node1 Node2 median min max MAD))."\n"; print STATS1 join("\n",@$pairwiseCladeStats)."\n"; close STATS1; open(STATS2,">",$outsingClade) or die "ERROR: could not write to file $outsingClade:$!"; print STATS2 join("\t",qw(Node1 Node2 median min max MAD))."\n"; print STATS2 join("\n",@$singletonCladeStats)."\n"; close STATS2; open(STATS3,">",$outsingTaxa) or die "ERROR: could not write to file $outsingTaxa:$!"; print STATS3 join("\t",qw(Node1 Node2 median min max MAD))."\n"; print STATS3 join("\n",@$singletonTaxaStats); close STATS3; open(STATS4,">",$outTree) or die "ERROR: could not write to file $outTree:$!"; print STATS4 join("\t",qw(Node1 Node2 median min max MAD))."\n"; print STATS4 join("\n",@$treeStats) ."\n"; close STATS4; } return 1; } sub outputLabels{ my($labelHashRef,$prefix,$settings)=@_; my $out="$prefix.labels.tsv"; open(LABELS,">",$out) or die "ERROR: could not write to file $out:$!"; print LABELS join("\t",qw(Label Leaves))."\n"; while ( my ( $key, $value ) = each %$labelHashRef ){ printf LABELS "%s: %s\n", $key, join(", ", @$value); } close LABELS; return 1; } sub usage{ my($settings)=@_; my $help="Labels nodes with significant bootstrap values and returns useful pairwise distance statistics for those nodes and the tree. Usage: $0 -t in.dnd -p pairwise.tsv --outprefix out Outputs Newick tree, list of labels and leaves, and tab delimited files with pairwise distance statistics -t in.dnd The tree file, which will be parsed by BioPerl. Format determined by extension. -p pairwise.tsv The pairwise distances file. NOTE: you can get pairwise distances from pairwiseDistances.pl --outprefix prefix The output prefix. Prefix can have a directory name encoded in it also, e.g. 'tmp/prefix'. Output files are: prefix.labelednodes.dnd, prefix.merged.stats.tsv, and prefix.labels.tsv (using the split option will output: prefix.pairwise.stats.tsv, prefix.singletonClades.stats.tsv, prefix.singletonTaxa.stats.tsv, and prefix.tree.stats.tsv ) -h for additional help"; return $help if(!$$settings{help}); # return shorthand help $help.=" OPTIONAL --outputType merged (default) The type of distance stats output you want. 'merged' for one big file (prefix.merged.stats.tsv) 'split' for separate files for pairwise by node (prefix.pairwise.stats.tsv), individual nodes vs other leaves (prefix.singletonClades.stats.tsv), individual taxa vs other leaves (singletonTaxa.stats.tsv), and overall stats for the entire tree (prefix.tree.stats.tsv) --bootstrap 70 (default) The percent threshold for significant bootstrap values. Only nodes with bootstrap values higher than this number will be included in pairwise by node and individual node statistic calculations. Example: $0 applyFstToTree.pl -p pairwise.tsv -t 4b.dnd --outprefix out --outputType split --bootstrap 80 "; return $help; }
lskatz/lyve-SET
scripts/cladeDistancesFromTree.pl
Perl
mit
13,575
#!/usr/bin/perl #imports use strict; use warnings 'FATAL' => 'all'; use Sys::Hostname; use Cwd 'abs_path'; use Log::Log4perl; #need to install external package/module use LWP::Simple; use Time::HiRes qw(time); use File::stat; #vars my $logConfig = 'log4perl.conf'; Log::Log4perl::init($logConfig); my $logr = Log::Log4perl->get_logger(); my $userName = getlogin || 'undef-user'; my $hostName = hostname || 'undef-hostname'; my $downloadFileUrl = 'http://64.18.29.194/CDP/HHS-SSP-CA-B7.crl'; my $downLoadfile = 'temp/downloaded.file'; #methods sub measureSpeed() { $logr->info("file to download: $downloadFileUrl"); my $timestamp = localtime; my $download_start = time; my $status = getstore( $downloadFileUrl, $downLoadfile ); my $download_duration = time - $download_start; my $filesize = ( stat($downLoadfile)->size ) / ( 1024 * 1024 ); my $speed = sprintf( "%.4f", ( $filesize / $download_duration ) ); $logr->info( 'downlad status: ' . $status ); $logr->info( 'downlad time (secs): ' . $download_duration ); $logr->info( 'file size (MB): ' . $filesize ); $logr->info( 'speed (MB/sec): ' . $speed ); } #main $logr->info('start'); eval { $logr->info('this is a download-speed-measuring tool.'); $logr->info("executed by: $userName\@$hostName"); $logr->info( 'execution path: ' . abs_path($0) ); measureSpeed(); }; if ($@) { $logr->error( 'error: ', $@ ); } $logr->info('stop');
ajeetmurty/ReferenceCode
perl/Network/Speed/Speed.pl
Perl
mit
1,526
# 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::V10::Services::AdGroupAdService::AdGroupAdOperation; use strict; use warnings; use base qw(Google::Ads::GoogleAds::BaseEntity); use Google::Ads::GoogleAds::Utils::GoogleAdsHelper; sub new { my ($class, $args) = @_; my $self = { create => $args->{create}, policyValidationParameter => $args->{policyValidationParameter}, remove => $args->{remove}, update => $args->{update}, updateMask => $args->{updateMask}}; # Delete the unassigned fields in this object for a more concise JSON payload remove_unassigned_fields($self, $args); bless $self, $class; return $self; } 1;
googleads/google-ads-perl
lib/Google/Ads/GoogleAds/V10/Services/AdGroupAdService/AdGroupAdOperation.pm
Perl
apache-2.0
1,286
package Google::Ads::AdWords::v201402::GeoTargetTypeSetting::PositiveGeoTargetType; use strict; use warnings; sub get_xmlns { 'https://adwords.google.com/api/adwords/cm/v201402'}; # derivation by restriction use base qw( SOAP::WSDL::XSD::Typelib::Builtin::string); 1; __END__ =pod =head1 NAME =head1 DESCRIPTION Perl data type class for the XML Schema defined simpleType GeoTargetTypeSetting.PositiveGeoTargetType from the namespace https://adwords.google.com/api/adwords/cm/v201402. The various signals a positive location target may use. This clase is derived from SOAP::WSDL::XSD::Typelib::Builtin::string . SOAP::WSDL's schema implementation does not validate data, so you can use it exactly like it's base type. # Description of restrictions not implemented yet. =head1 METHODS =head2 new Constructor. =head2 get_value / set_value Getter and setter for the simpleType's value. =head1 OVERLOADING Depending on the simple type's base type, the following operations are overloaded Stringification Numerification Boolification Check L<SOAP::WSDL::XSD::Typelib::Builtin> for more information. =head1 AUTHOR Generated by SOAP::WSDL =cut
gitpan/GOOGLE-ADWORDS-PERL-CLIENT
lib/Google/Ads/AdWords/v201402/GeoTargetTypeSetting/PositiveGeoTargetType.pm
Perl
apache-2.0
1,179
# 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. =pod =head1 NAME Bio::EnsEMBL::Analysis::Runnable::ProteinAnnotation::Coil =head1 SYNOPSIS my $seqstream = Bio::SeqIO->new ( -file => $queryfile, -fmt => 'Fasta', ); $seq = $seqstream->next_seq; my $ncoils = Bio::EnsEMBL::Analysis::Runnable::ProteinAnnotation::Coil->new( -analysis => $ana, -query => $query); $ncoils->run; my @list = @{$ncoils->run} =head1 DESCRIPTION =cut package Bio::EnsEMBL::Analysis::Runnable::ProteinAnnotation::Coil; use warnings ; use vars qw(@ISA); use strict; use Bio::EnsEMBL::Utils::Exception qw(throw warning); use Bio::EnsEMBL::Analysis::Runnable::ProteinAnnotation; @ISA = qw(Bio::EnsEMBL::Analysis::Runnable::ProteinAnnotation); sub new { my ($class, @args) = @_; my $self = $class->SUPER::new(@args); if (not $self->database) { throw("You must supply the Coils runnable with a database directory"); } elsif (not -d $self->database) { throw($self->database . " is not a *valid* database directory"); } else { $ENV{'COILSDIR'} = $self->database; } return $self; } sub run_analysis { my ($self) = @_; my $command = $self->program." -f < ".$self->queryfile." > ".$self->resultsfile; # run program throw ("Error running ".$self->program." on ".$self->queryfile) unless (system($command) == 0); } sub parse_results { my ($self) = @_; my ($fh, @pfs); my $resfile = $self->resultsfile; if (-e $resfile) { # it's a filename if (-z $resfile) { return; } else { open($fh, "<$resfile") or throw ("Error opening $resfile"); } } else { # it'a a filehandle $fh = $resfile; } # parse my $seqio = Bio::SeqIO->new(-format => 'fasta', -fh => $fh); while(my $seq = $seqio->next_seq) { my $pep = $seq->seq; while ($pep =~ m/(x+)/g) { my $end = pos($pep); my $start = $end - length($1) + 1; my $fp = $self->create_protein_feature($start, $end, 0, $seq->id, 0, 0, 'ncoils', $self->analysis, 0, 0); push @pfs, $fp; } } $self->output(\@pfs); } 1;
kiwiroy/ensembl-analysis
modules/Bio/EnsEMBL/Analysis/Runnable/ProteinAnnotation/Coil.pm
Perl
apache-2.0
2,972
#!/usr/bin/perl # Copyright 2016 Michael Schlenstedt, michael@loxberry.de # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #use strict; #use warnings; ########################################################################## # Modules ########################################################################## use LoxBerry::System; use LoxBerry::Log; use Getopt::Long; use IO::Socket; # For sending UDP packages use DateTime; ########################################################################## # Read settings ########################################################################## # Version of this script my $version = "4.1.6"; our $pcfg = new Config::Simple("$lbpconfigdir/wu4lox.cfg"); my $udpport = $pcfg->param("SERVER.UDPPORT"); my $senddfc = $pcfg->param("SERVER.SENDDFC"); my $sendhfc = $pcfg->param("SERVER.SENDHFC"); our $sendudp = $pcfg->param("SERVER.SENDUDP"); our $metric = $pcfg->param("SERVER.METRIC"); our $emu = $pcfg->param("SERVER.EMU"); our $stdtheme = $pcfg->param("WEB.THEME"); our $stdiconset = $pcfg->param("WEB.ICONSET"); # Language our $lang = lblanguage(); # Create a logging object my $log = LoxBerry::Log->new ( name => 'fetch', filename => "$lbplogdir/wu4lox.log", append => 1, ); # Commandline options my $verbose = ''; GetOptions ('verbose' => \$verbose, 'quiet' => sub { $verbose = 0 }); # Due to a bug in the Logging routine, set the loglevel fix to 3 $log->loglevel(3); if ($verbose) { $log->stdout(1); $log->loglevel(7); } LOGSTART "WU4Lox DATATOLOXONE process started"; LOGDEB "This is $0 Version $version"; ########################################################################## # Main program ########################################################################## my $i; # Clear HTML databse open(F,">$lbplogdir/weatherdata.html"); print F ""; close(F); # Date Reference: Convert into Loxone Epoche (1.1.2009) my $dateref = DateTime->new( year => 2009, month => 1, day => 1, ); # UDP Queue Limits our $sendqueue = 0; our $sendqueuelimit = 50; # # Print out current conditions # # Read data open(F,"<$lbplogdir/current.dat"); our $curdata = <F>; close(F); chomp $curdata; my @fields = split(/\|/,$curdata); our $value; our $name; our $tmpudp; our $udp; # Check for empty data if (@fields[0] eq "") { @fields[0] = 1230764400; @fields[34] = 0; @fields[35] = 0; @fields[36] = 0; @fields[37] = 0; } # Correct Epoch by Timezone my $tzseconds = (@fields[4] / 100 * 3600); # EpochDate - Corrected by TZ our $epochdate = DateTime->from_epoch( epoch => @fields[0], ); $epochdate->add( seconds => $tzseconds ); $name = "cur_date"; $value = @fields[0] - $dateref->epoch() + (@fields[4] / 100 * 3600); &send; $name = "cur_date_des"; $value = @fields[1]; #&send; $name = "cur_date_tz_des_sh"; $value = @fields[2]; #&send; $name = "cur_date_tz_des"; $value = @fields[3]; #&send; $name = "cur_date_tz"; $value = @fields[4]; #&send; $name = "cur_day"; $value = $epochdate->day; &send; $name = "cur_month"; $value = $epochdate->month; &send; $name = "cur_year"; $value = $epochdate->year; &send; $name = "cur_hour"; $value = $epochdate->hour; &send; $name = "cur_min"; $value = $epochdate->minute; &send; $name = "cur_loc_n"; $value = @fields[5]; #&send; $name = "cur_loc_c"; $value = @fields[6]; #&send; $name = "cur_loc_ccode"; $value = @fields[7]; #&send; $name = "cur_loc_lat"; $value = @fields[8]; &send; $name = "cur_loc_long"; $value = @fields[9]; &send; $name = "cur_loc_el"; $value = @fields[10]; &send; $name = "cur_tt"; if (!$metric) {$value = @fields[11]*1.8+32} else {$value = @fields[11]}; &send; $name = "cur_tt_fl"; if (!$metric) {$value = @fields[12]*1.8+32} else {$value = @fields[12]}; &send; $name = "cur_hu"; $value = @fields[13]; &send; $name = "cur_w_dirdes"; $value = @fields[14]; #&send; $name = "cur_w_dir"; $value = @fields[15]; &send; $name = "cur_w_sp"; if (!$metric) {$value = @fields[16]*0.621371192} else {$value = @fields[16]}; &send; $name = "cur_w_gu"; if (!$metric) {$value = @fields[17]*0.621371192} else {$value = @fields[17]}; &send; $name = "cur_w_ch"; if (!$metric) {$value = @fields[18]*1.8+32} else {$value = @fields[18]}; &send; $name = "cur_pr"; if (!$metric) {$value = @fields[19]*0.0295301} else {$value = @fields[19]}; &send; $name = "cur_dp"; if (!$metric) {$value = @fields[20]*1.8+32} else {$value = @fields[20]}; &send; $name = "cur_vis"; if (!$metric) {$value = @fields[21]*0.621371192} else {$value = @fields[21]}; &send; $name = "cur_sr"; $value = @fields[22]; &send; $name = "cur_hi"; if (!$metric) {$value = @fields[23]*1.8+32} else {$value = @fields[23]}; &send; $name = "cur_uvi"; $value = @fields[24]; &send; $name = "cur_prec_today"; if (!$metric) {$value = @fields[25]*0.0393700787} else {$value = @fields[25]}; &send; $name = "cur_prec_1hr"; if (!$metric) {$value = @fields[26]*0.0393700787} else {$value = @fields[26]}; &send; $name = "cur_we_icon"; $value = @fields[27]; #&send; $name = "cur_we_code"; $value = @fields[28]; &send; $name = "cur_we_des"; $value = @fields[29]; #&send; $name = "cur_moon_p"; $value = @fields[30]; &send; $name = "cur_moon_a"; $value = @fields[31]; &send; $name = "cur_moon_ph"; $value = @fields[32]; #&send; $name = "cur_moon_h"; $value = @fields[33]; #&send; # Create Sunset/rise Date in Loxone Epoch Format (1.1.2009) # Sunrise my $sunrdate = DateTime->new( year => $epochdate -> year(), month => $epochdate -> month(), day => $epochdate -> day(), hour => @fields[34], minute => @fields[35], ); #$sunrdate->add( seconds => $tzseconds ); # Sunset my $sunsdate = DateTime->new( year => $epochdate -> year(), month => $epochdate -> month(), day => $epochdate -> day(), hour => @fields[36], minute => @fields[37], ); #$sunsdate->add( seconds => $tzseconds ); $name = "cur_sun_r"; $value = $sunrdate->epoch() - $dateref->epoch(); &send; $name = "cur_sun_s"; $value = $sunsdate->epoch() - $dateref->epoch(); $udp = 1; # Really send now in one run &send; # # Print out Daily Forecast # # Read data open(F,"<$lbplogdir/dailyforecast.dat"); our @dfcdata = <F>; close(F); foreach (@dfcdata){ s/[\n\r]//g; @fields = split(/\|/); my $per = @fields[0]; # Send values only if we should do so our $send = 0; foreach (split(/;/,$senddfc)){ if ($_ eq $per) { $send = 1; } } if (!$send) { next; } # DFC: Today is dfc0 $per = $per-1; # Check for empty data if (@fields[1] eq "") { @fields[1] = 1230764400; } $name = "dfc$per\_per"; $value = $per; &send; $name = "dfc$per\_date"; $value = @fields[1] - $dateref->epoch(); &send; $name = "dfc$per\_day"; $value = @fields[2]; &send; $name = "dfc$per\_month"; $value = @fields[3]; &send; $name = "dfc$per\_monthn"; $value = @fields[4]; # &send; $name = "dfc$per\_monthn_sh"; $value = @fields[5]; # &send; $name = "dfc$per\_year"; $value = @fields[6]; &send; $name = "dfc$per\_hour"; $value = @fields[7]; &send; $name = "dfc$per\_min"; $value = @fields[8]; &send; $name = "dfc$per\_wday"; $value = @fields[9]; # &send; $name = "dfc$per\_wday_sh"; $value = @fields[10]; # &send; $name = "dfc$per\_tt_h"; if (!$metric) {$value = @fields[11]*1.8+32} else {$value = @fields[11];} &send; $name = "dfc$per\_tt_l"; if (!$metric) {$value = @fields[12]*1.8+32} else {$value = @fields[12];} &send; $name = "dfc$per\_pop"; $value = @fields[13]; &send; $name = "dfc$per\_prec"; if (!$metric) {$value = @fields[14]*0.0393700787} else {$value = @fields[14];} &send; $name = "dfc$per\_snow"; if (!$metric) {$value = @fields[15]*0.393700787} else {$value = @fields[15];} &send; $name = "dfc$per\_w_sp_h"; if (!$metric) {$value = @fields[16]*0.621} else {$value = @fields[16];} &send; $name = "dfc$per\_w_dirdes_h"; $value = @fields[17]; # &send; $name = "dfc$per\_w_dir_h"; $value = @fields[18]; &send; $name = "dfc$per\_w_sp_a"; if (!$metric) {$value = @fields[19]*0.621} else {$value = @fields[19];} &send; $name = "dfc$per\_w_dirdes_a"; $value = @fields[20]; # &send; $name = "dfc$per\_w_dir_a"; $value = @fields[21]; &send; $name = "dfc$per\_hu_a"; $value = @fields[22]; &send; $name = "dfc$per\_hu_h"; $value = @fields[23]; &send; $name = "dfc$per\_hu_l"; $value = @fields[24]; &send; $name = "dfc$per\_we_icon"; $value = @fields[25]; # &send; $name = "dfc$per\_we_code"; $value = @fields[26]; $udp = 1; # Really send now in one run &send; $name = "dfc$per\_we_des"; $value = @fields[27]; # &send; } # # Print out Hourly Forecast # # Read data open(F,"<$lbplogdir/hourlyforecast.dat"); our @hfcdata = <F>; close(F); foreach (@hfcdata){ s/[\n\r]//g; @fields = split(/\|/); my $per = @fields[0]; # Send values only if we should do so $send = 0; foreach (split(/;/,$sendhfc)){ if ($_ eq $per) { $send = 1; } } if (!$send) { next; } # Check for empty data if (@fields[1] eq "") { @fields[1] = 1230764400; } $name = "hfc$per\_per"; $value = @fields[0]; &send; $name = "hfc$per\_date"; $value = @fields[1] - $dateref->epoch(); &send; $name = "hfc$per\_day"; $value = @fields[2]; &send; $name = "hfc$per\_month"; $value = @fields[3]; &send; $name = "hfc$per\_monthn"; $value = @fields[4]; # &send; $name = "hfc$per\_monthn_sh"; $value = @fields[5]; # &send; $name = "hfc$per\_year"; $value = @fields[6]; &send; $name = "hfc$per\_hour"; $value = @fields[7]; &send; $name = "hfc$per\_min"; $value = @fields[8]; &send; $name = "hfc$per\_wday"; $value = @fields[9]; # &send; $name = "hfc$per\_wday_sh"; $value = @fields[10]; # &send; $name = "hfc$per\_tt"; if (!$metric) {$value = @fields[11]*1.8+32} else {$value = @fields[11];} &send; $name = "hfc$per\_tt_fl"; if (!$metric) {$value = @fields[12]*1.8+32} else {$value = @fields[12];} &send; $name = "hfc$per\_hi"; if (!$metric) {$value = @fields[13]*1.8+32} else {$value = @fields[13];} &send; $name = "hfc$per\_hu"; $value = @fields[14]; &send; $name = "hfc$per\_w_dirdes"; $value = @fields[15]; # &send; $name = "hfc$per\_w_dir"; $value = @fields[16]; &send; $name = "hfc$per\_w_sp"; if (!$metric) {$value = @fields[17]*0.621} else {$value = @fields[17];} &send; $name = "hfc$per\_w_ch"; if (!$metric) {$value = @fields[18]*1.8+32} else {$value = @fields[18]}; &send; $name = "hfc$per\_pr"; $value = @fields[19]; &send; $name = "hfc$per\_dp"; $value = @fields[20]; &send; $name = "hfc$per\_sky"; $value = @fields[21]; &send; $name = "hfc$per\_sky\_des"; $value = @fields[22]; # &send; $name = "hfc$per\_uvi"; $value = @fields[23]; &send; $name = "hfc$per\_prec"; if (!$metric) {$value = @fields[24]*0.0393700787} else {$value = @fields[24];} &send; $name = "hfc$per\_snow"; if (!$metric) {$value = @fields[25]*0.393700787} else {$value = @fields[25];} &send; $name = "hfc$per\_pop"; $value = @fields[26]; &send; $name = "hfc$per\_we_code"; $value = @fields[27]; $udp = 1; # Really send now in one run &send; $name = "hfc$per\_we_icon"; $value = @fields[28]; # &send; $name = "hfc$per\_we_des"; $value = @fields[29]; # &send; } # # Print out calculated Forecast values # # Prec within the next hours my $tmpprec4 = 0; my $tmpprec8 = 0; my $tmpprec16 = 0; my $tmpprec24 = 0; my $tmpprec32 = 0; my $tmpprec40 = 0; my $tmpprec48 = 0; # Snow within the next hours my $tmpsnow4 = 0; my $tmpsnow8 = 0; my $tmpsnow16 = 0; my $tmpsnow24 = 0; my $tmpsnow32 = 0; my $tmpsnow40 = 0; my $tmpsnow48 = 0; # Min Temp within the next hours my $tmpttmin4 = 0; my $tmpttmin8 = 0; my $tmpttmin16 = 0; my $tmpttmin24 = 0; my $tmpttmin32 = 0; my $tmpttmin40 = 0; my $tmpttmin48 = 0; # Max Temp within the next hours my $tmpttmax4 = 0; my $tmpttmax8 = 0; my $tmpttmax16 = 0; my $tmpttmax24 = 0; my $tmpttmax32 = 0; my $tmpttmax40 = 0; my $tmpttmax48 = 0; # Min Pop within the next hours my $tmppopmin4 = 0; my $tmppopmin8 = 0; my $tmppopmin16 = 0; my $tmppopmin24 = 0; my $tmppopmin32 = 0; my $tmppopmin40 = 0; my $tmppopmin48 = 0; # Max Pop within the next hours my $tmppopmax4 = 0; my $tmppopmax8 = 0; my $tmppopmax16 = 0; my $tmppopmax24 = 0; my $tmppopmax32 = 0; my $tmppopmax40 = 0; my $tmppopmax48 = 0; foreach (@hfcdata){ s/[\n\r]//g; @fields = split(/\|/); # Default values for min/max if ( @fields[0] == 1 ) { $tmpttmax4 = @fields[11]; $tmpttmin4 = @fields[11]; $tmpttmax8 = @fields[11]; $tmpttmin8 = @fields[11]; $tmpttmax16 = @fields[11]; $tmpttmin16 = @fields[11]; $tmpttmax24 = @fields[11]; $tmpttmin24 = @fields[11]; $tmpttmax32 = @fields[11]; $tmpttmin32 = @fields[11]; $tmpttmax40 = @fields[11]; $tmpttmin40 = @fields[11]; $tmpttmax48 = @fields[11]; $tmpttmin48 = @fields[11]; $tmppopmax4 = @fields[26]; $tmppopmin4 = @fields[26]; $tmppopmax8 = @fields[26]; $tmppopmin8 = @fields[26]; $tmppopmax16 = @fields[26]; $tmppopmin16 = @fields[26]; $tmppopmax24 = @fields[26]; $tmppopmin24 = @fields[26]; $tmppopmax32 = @fields[26]; $tmppopmin32 = @fields[26]; $tmppopmax40 = @fields[26]; $tmppopmin40 = @fields[26]; $tmppopmax48 = @fields[26]; $tmppopmin48 = @fields[26]; } if ( @fields[0] <= 4 ) { $tmpprec4 .+ @fields[24]; $tmpsnow4 .+ @fields[25]; if ( $tmpttmin4 > @fields[11] ) { $tmpttmin4 = @fields[11]; } if ( $tmpttmax4 < @fields[11] ) { $tmpttmax4 = @fields[11]; } if ( $tmppopmin4 > @fields[26] ) { $tmppopmin4 = @fields[26]; } if ( $tmppopmax4 < @fields[26] ) { $tmppopmax4 = @fields[26]; } } if ( @fields[0] <= 8 ) { $tmpprec8 .+ @fields[24]; $tmpsnow8 .+ @fields[25]; if ( $tmpttmin8 > @fields[11] ) { $tmpttmin8 = @fields[11]; } if ( $tmpttmax8 < @fields[11] ) { $tmpttmax8 = @fields[11]; } if ( $tmppopmin8 > @fields[26] ) { $tmppopmin8 = @fields[26]; } if ( $tmppopmax8 < @fields[26] ) { $tmppopmax8 = @fields[26]; } } if ( @fields[0] <= 16 ) { $tmpprec16 .+ @fields[24]; $tmpsnow16 .+ @fields[25]; if ( $tmpttmin16 > @fields[11] ) { $tmpttmin16 = @fields[11]; } if ( $tmpttmax16 < @fields[11] ) { $tmpttmax16 = @fields[11]; } if ( $tmppopmin16 > @fields[26] ) { $tmppopmin16 = @fields[26]; } if ( $tmppopmax16 < @fields[26] ) { $tmppopmax16 = @fields[26]; } } if ( @fields[0] <= 24 ) { $tmpprec24 .+ @fields[24]; $tmpsnow24 .+ @fields[25]; if ( $tmpttmin24 > @fields[11] ) { $tmpttmin24 = @fields[11]; } if ( $tmpttmax24 < @fields[11] ) { $tmpttmax24 = @fields[11]; } if ( $tmppopmin24 > @fields[26] ) { $tmppopmin24 = @fields[26]; } if ( $tmppopmax24 < @fields[26] ) { $tmppopmax24 = @fields[26]; } } if ( @fields[0] <= 32 ) { $tmpprec32 .+ @fields[24]; $tmpsnow32 .+ @fields[25]; if ( $tmpttmin32 > @fields[11] ) { $tmpttmin32 = @fields[11]; } if ( $tmpttmax32 < @fields[11] ) { $tmpttmax32 = @fields[11]; } if ( $tmppopmin32 > @fields[26] ) { $tmppopmin32 = @fields[26]; } if ( $tmppopmax32 < @fields[26] ) { $tmppopmax32 = @fields[26]; } } if ( @fields[0] <= 40 ) { $tmpprec40 .+ @fields[24]; $tmpsnow40 .+ @fields[25]; if ( $tmpttmin40 > @fields[11] ) { $tmpttmin40 = @fields[11]; } if ( $tmpttmax40 < @fields[11] ) { $tmpttmax40 = @fields[11]; } if ( $tmppopmin40 > @fields[26] ) { $tmppopmin40 = @fields[26]; } if ( $tmppopmax40 < @fields[26] ) { $tmppopmax40 = @fields[26]; } } if ( @fields[0] <= 48 ) { $tmpprec48 .+ @fields[24]; $tmpsnow48 .+ @fields[25]; if ( $tmpttmin48 > @fields[11] ) { $tmpttmin48 = @fields[11]; } if ( $tmpttmax48 < @fields[11] ) { $tmpttmax48 = @fields[11]; } if ( $tmppopmin48 > @fields[26] ) { $tmppopmin48 = @fields[26]; } if ( $tmppopmax48 < @fields[26] ) { $tmppopmax48 = @fields[26]; } } } # Add calculated to send queue # ttmax $name = "calc+4\_ttmax"; $value = $tmpttmax4; &send; $name = "calc+8\_ttmax"; $value = $tmpttmax8; &send; $name = "calc+16\_ttmax"; $value = $tmpttmax16; &send; $name = "calc+24\_ttmax"; $value = $tmpttmax24; &send; $name = "calc+32\_ttmax"; $value = $tmpttmax32; &send; $name = "calc+40\_ttmax"; $value = $tmpttmax40; &send; $name = "calc+48\_ttmax"; $value = $tmpttmax48; &send; # ttmin $name = "calc+4\_ttmin"; $value = $tmpttmin4; &send; $name = "calc+8\_ttmin"; $value = $tmpttmin8; &send; $name = "calc+16\_ttmin"; $value = $tmpttmin16; &send; $name = "calc+24\_ttmin"; $value = $tmpttmin24; &send; $name = "calc+32\_ttmin"; $value = $tmpttmin32; &send; $name = "calc+40\_ttmin"; $value = $tmpttmin40; &send; $name = "calc+48\_ttmin"; $value = $tmpttmin48; &send; # popmax $name = "calc+4\_popmax"; $value = $tmppopmax4; &send; $name = "calc+8\_popmax"; $value = $tmppopmax8; &send; $name = "calc+16\_popmax"; $value = $tmppopmax16; &send; $name = "calc+24\_popmax"; $value = $tmppopmax24; &send; $name = "calc+32\_popmax"; $value = $tmppopmax32; &send; $name = "calc+40\_popmax"; $value = $tmppopmax40; &send; $name = "calc+48\_popmax"; $value = $tmppopmax48; &send; # popmin $name = "calc+4\_popmin"; $value = $tmppopmin4; &send; $name = "calc+8\_popmin"; $value = $tmppopmin8; &send; $name = "calc+16\_popmin"; $value = $tmppopmin16; &send; $name = "calc+24\_popmin"; $value = $tmppopmin24; &send; $name = "calc+32\_popmin"; $value = $tmppopmin32; &send; $name = "calc+40\_popmin"; $value = $tmppopmin40; &send; $name = "calc+48\_popmin"; $value = $tmppopmin48; &send; # prec $name = "calc+4\_prec"; $value = $tmpprec4; &send; $name = "calc+8\_prec"; $value = $tmpprec8; &send; $name = "calc+16\_prec"; $value = $tmpprec16; &send; $name = "calc+24\_prec"; $value = $tmpprec24; &send; $name = "calc+32\_prec"; $value = $tmpprec32; &send; $name = "calc+40\_prec"; $value = $tmpprec40; &send; $name = "calc+48\_prec"; $value = $tmpprec48; &send; # snow $name = "calc+4\_snow"; $value = $tmpsnow4; &send; $name = "calc+8\_snow"; $value = $tmpsnow8; &send; $name = "calc+16\_snow"; $value = $tmpsnow16; &send; $name = "calc+24\_snow"; $value = $tmpsnow24; &send; $name = "calc+32\_snow"; $value = $tmpsnow32; &send; $name = "calc+40\_snow"; $value = $tmpsnow40; &send; $name = "calc+48\_snow"; $value = $tmpsnow48; &send; $udp = 1; # Really send now in one run # # Create Webpages # LOGINF "Creating Webpages..."; our $theme = $stdtheme; our $iconset = $stdiconset; our $themeurlmain = "./webpage.html"; our $themeurldfc = "./webpage.dfc.html"; our $themeurlhfc = "./webpage.hfc.html"; our $themeurlmap = "./webpage.map.html"; our $webpath = "/plugins/$lbpplugindir"; ############################################# # CURRENT CONDITIONS ############################################# # Get current weather data from database #open(F,"<$home/data/plugins/$psubfolder/current.dat") || die "Cannot open $home/data/plugins/$psubfolder/current.dat"; # our $curdata = <F>; #close(F); #chomp $curdata; @fields = split(/\|/,$curdata); our $cur_date = @fields[0]; our $cur_date_des = @fields[1]; our $cur_date_tz_des_sh = @fields[2]; our $cur_date_tz_des = @fields[3]; our $cur_date_tz = @fields[4]; #our $epochdate = DateTime->from_epoch( # epoch => @fields[0], # time_zone => 'local', #); our $cur_day = sprintf("%02d", $epochdate->day); our $cur_month = sprintf("%02d", $epochdate->month); our $cur_hour = sprintf("%02d", $epochdate->hour); our $cur_min = sprintf("%02d", $epochdate->minute); our $cur_year = $epochdate->year; our $cur_loc_n = @fields[5]; our $cur_loc_c = @fields[6]; our $cur_loc_ccode = @fields[7]; our $cur_loc_lat = @fields[8]; our $cur_loc_long = @fields[9]; our $cur_loc_el = @fields[10]; our $cur_hu = @fields[13]; our $cur_w_dirdes = @fields[14]; our $cur_w_dir = @fields[15]; our $cur_sr = @fields[22]; our $cur_uvi = @fields[24]; our $cur_we_icon = @fields[27]; our $cur_we_code = @fields[28]; our $cur_we_des = @fields[29]; our $cur_moon_p = @fields[30]; our $cur_moon_a = @fields[31]; our $cur_moon_ph = @fields[32]; our $cur_moon_h = @fields[33]; if (!$metric) { our $cur_tt = @fields[11]*1.8+32; our $cur_tt_fl = @fields[12]*1.8+32; our $cur_w_sp = @fields[16]*0.621371192; our $cur_w_gu = @fields[17]*0.621371192; our $cur_w_ch = @fields[18]*1.8+32; our $cur_pr = @fields[19]*0.0295301; our $cur_dp = @fields[20]*1.8+32; our $cur_vis = @fields[21]*0.621371192; our $cur_hi = @fields[23]*1.8+32; our $cur_prec_today = @fields[25]*0.0393700787; our $cur_prec_1hr = @fields[26]*0.0393700787; } else { our $cur_tt = @fields[11]; our $cur_tt_fl = @fields[12]; our $cur_w_sp = @fields[16]; our $cur_w_gu = @fields[17]; our $cur_w_ch = @fields[18]; our $cur_pr = @fields[19]; our $cur_dp = @fields[20]; our $cur_vis = @fields[21]; our $cur_hi = @fields[23]; our $cur_prec_today = @fields[25]; our $cur_prec_1hr = @fields[26]; } our $cur_sun_r = "@fields[34]:@fields[35]"; our $cur_sun_s = "@fields[36]:@fields[37]"; # Use night icons between sunset and sunrise our $hour_sun_r = @fields[34]; our $hour_sun_s = @fields[36]; if ($cur_hour > $hour_sun_s || $cur_hour < $hour_sun_r) { our $cur_dayornight = "n"; } else { our $cur_dayornight = "d"; } # Write cached weboage $lang = lblanguage(); if (!-e "$lbptemplatedir/themes/$lang/$theme.main.html") { $lang = "en"; } if (!-e "$lbptemplatedir/themes/$lang/$theme.main.html") { $theme = "dark"; } open(F1,">$lbplogdir/webpage.html"); open(F,"<$lbptemplatedir/themes/$lang/$theme.main.html"); while (<F>) { $_ =~ s/<!--\$(.*?)-->/${$1}/g; print F1 $_; } close(F); close(F1); if (-e "$lbplogdir/webpage.html") { LOGDEB "$lbplogdir/webpage.html created."; } ############################################# # MAP VIEW ############################################# # Write cached weboage $lang = lblanguage(); if (!-e "$lbptemplatedir/themes/$lang/$theme.map.html") { $lang = "en"; } if (!-e "$lbptemplatedir/themes/$lang/$theme.map.html") { $theme = "dark"; } open(F1,">$lbplogdir/webpage.map.html"); open(F,"<$lbptemplatedir/themes/$lang/$theme.map.html"); while (<F>) { $_ =~ s/<!--\$(.*?)-->/${$1}/g; print F1 $_; } close(F); close(F1); if (-e "$lbplogdir/webpage.map.html") { LOGDEB "$lbplogdir/webpage.map.html created."; } ############################################# # Daily Forecast ############################################# # Read data #open(F,"<$home/data/plugins/$psubfolder/dailyforecast.dat") || die "Cannot open $home/data/plugins/$psubfolder/dailyforecast.dat"; # our @dfcdata = <F>; #close(F); foreach (@dfcdata){ s/[\n\r]//g; @fields = split(/\|/); $per = @fields[0] - 1; ${dfc.$per._per} = @fields[0] - 1; ${dfc.$per._date} = @fields[1]; ${dfc.$per._day} = @fields[2]; ${dfc.$per._month} = @fields[3]; ${dfc.$per._monthn} = @fields[4]; ${dfc.$per._monthn_sh} = @fields[5]; ${dfc.$per._year} = @fields[6]; ${dfc.$per._hour} = @fields[7]; ${dfc.$per._min} = @fields[8]; ${dfc.$per._wday} = @fields[9]; ${dfc.$per._wday_sh} = @fields[10]; ${dfc.$per._pop} = @fields[13]; ${dfc.$per._w_dirdes_h} = @fields[17]; ${dfc.$per._w_dir_h} = @fields[18]; ${dfc.$per._w_dirdes_a} = @fields[20]; ${dfc.$per._w_dir_a} = @fields[21]; ${dfc.$per._hu_a} = @fields[22]; ${dfc.$per._hu_h} = @fields[23]; ${dfc.$per._hu_l} = @fields[24]; ${dfc.$per._we_icon} = @fields[25]; ${dfc.$per._we_code} = @fields[26]; ${dfc.$per._we_des} = @fields[27]; if (!$metric) { ${dfc.$per._tt_h} = @fields[11]*1.8+32; ${dfc.$per._tt_l} = @fields[12]*1.8+32; ${dfc.$per._prec} = @fields[14]*0.0393700787; ${dfc.$per._snow} = @fields[15]*0.393700787; ${dfc.$per._w_sp_h} = @fields[16]*0.621; ${dfc.$per._w_sp_a} = @fields[19]*0.621; } else { ${dfc.$per._tt_h} = @fields[11]; ${dfc.$per._tt_l} = @fields[12]; ${dfc.$per._prec} = @fields[14]; ${dfc.$per._snow} = @fields[15]; ${dfc.$per._w_sp_h} = @fields[16]; ${dfc.$per._w_sp_a} = @fields[19]; } # Use night icons between sunset and sunrise #if (${dfc.$per._hour} > $hour_sun_s || ${dfc.$per._hour} < $hour_sun_r) { # ${dfc.$per._dayornight} = "n"; #} else { # ${dfc.$per._dayornight} = "d"; #} } # Write cached weboage $lang = lblanguage(); if (!-e "$lbptemplatedir/themes/$lang/$theme.dfc.html") { $lang = "en"; } if (!-e "$lbptemplatedir/themes/$lang/$theme.dfc.html") { $theme = "dark"; } open(F1,">$lbplogdir/webpage.dfc.html"); open(F,"<$lbptemplatedir/themes/$lang/$theme.dfc.html"); while (<F>) { $_ =~ s/<!--\$(.*?)-->/${$1}/g; print F1 $_; } close(F); close(F1); if (-e "$lbplogdir/webpage.dfc.html") { LOGDEB "$lbplogdir/webpage.dfc.html created."; } ############################################# # Hourly Forecast ############################################# # Read data #open(F,"<$home/data/plugins/$psubfolder/hourlyforecast.dat") || die "Cannot open $home/data/plugins/$psubfolder/hourlyforecast.dat"; # our @hfcdata = <F>; #close(F); foreach (@hfcdata){ s/[\n\r]//g; my @fields = split(/\|/); $per = @fields[0]; ${hfc.$per._per} = @fields[0]; ${hfc.$per._date} = @fields[1]; ${hfc.$per._day} = @fields[2]; ${hfc.$per._month} = @fields[3]; ${hfc.$per._monthn} = @fields[4]; ${hfc.$per._monthn_sh} = @fields[5]; ${hfc.$per._year} = @fields[6]; ${hfc.$per._hour} = @fields[7]; ${hfc.$per._min} = @fields[8]; ${hfc.$per._wday} = @fields[9]; ${hfc.$per._wday_sh} = @fields[10]; ${hfc.$per._hu} = @fields[14]; ${hfc.$per._w_dirdes} = @fields[15]; ${hfc.$per._w_dir} = @fields[16]; ${hfc.$per._pr} = @fields[19]; ${hfc.$per._dp} = @fields[20]; ${hfc.$per._sky} = @fields[21]; ${hfc.$per._sky._des} = @fields[22]; ${hfc.$per._uvi} = @fields[23]; ${hfc.$per._pop} = @fields[26]; ${hfc.$per._we_code} = @fields[27]; ${hfc.$per._we_icon} = @fields[28]; ${hfc.$per._we_des} = @fields[29]; if (!$metric) { ${hfc.$per._tt} = @fields[11]*1.8+32; ${hfc.$per._tt_fl} = @fields[12]*1.8+32; ${hfc.$per._hi} = @fields[13]*1.8+32; ${hfc.$per._w_sp} = @fields[17]*0.621; ${hfc.$per._w_ch} = @fields[18]*1.8+32; ${hfc.$per._prec} = @fields[24]*0.0393700787; ${hfc.$per._snow} = @fields[25]*0.393700787; } else { ${hfc.$per._tt} = @fields[11]; ${hfc.$per._tt_fl} = @fields[12]; ${hfc.$per._hi} = @fields[13]; ${hfc.$per._w_sp} = @fields[17]; ${hfc.$per._w_ch} = @fields[18]; ${hfc.$per._prec} = @fields[24]; ${hfc.$per._snow} = @fields[25]; } # Use night icons between sunset and sunrise if (${hfc.$per._hour} > $hour_sun_s || ${hfc.$per._hour} < $hour_sun_r) { ${hfc.$per._dayornight} = "n"; } else { ${hfc.$per._dayornight} = "d"; } } # Write cached weboage $lang = lblanguage(); if (!-e "$lbptemplatedir/themes/$lang/$theme.hfc.html") { $lang = "en"; } if (!-e "$lbptemplatedir/themes/$lang/$theme.hfc.html") { $theme = "dark"; } open(F1,">$lbplogdir/webpage.hfc.html"); open(F,"<$lbptemplatedir/themes/$lang/$theme.hfc.html"); while (<F>) { $_ =~ s/<!--\$(.*?)-->/${$1}/g; print F1 $_; } close(F); close(F1); if (-e "$lbplogdir/webpage.hfc.html") { LOGDEB "$lbplogdir/webpage.hfc.html created."; } LOGOK "Webpages created successfully."; # # Create Cloud Weather Emu # # Original from Loxone Testserver: (ccord changed) # http://weather.loxone.com:6066/forecast/?user=loxone_EEE000CC000F&coord=13.4,54.0768&format=1&asl=115 # ^ ^ ^ ^ ^ ^ # URL Port MS MAC Coord Format Height # # The format could be 1 or 2, although Miniserver only seems to use format=1 # (format=2 is xml-output, but with less weather data) # The height is the geogr. height of your installation (seems to be used for windspeed etc.). You # can give the heights in meter or set this to auto or left blank (=auto). if ($emu) { LOGINF "Creating Files for Cloud Weather Emulator..."; ############################################# # CURRENT CONDITIONS ############################################# # Original file has 169 entrys, but always starts at 0:00 today or 12:00 yesterday. We alsways start with current data # (we don't have historical data) and offer 168 hourly forcast datasets. This seems to be ok for the miniserver. # Get current weather data from database #open(F,"<$home/data/plugins/$psubfolder/current.dat") || die "Cannot open $home/data/plugins/$psubfolder/current.dat"; # $curdata = <F>; #close(F); #chomp $curdata; @fields = split(/\|/,$curdata); open(F,">$lbplogdir/index.txt"); print F "<mb_metadata>\n"; print F "id;name;longitude;latitude;height (m.asl.);country;timezone;utc-timedifference;sunrise;sunset;"; print F "local date;weekday;local time;temperature(C);feeledTemperature(C);windspeed(km/h);winddirection(degr);wind gust(km/h);low clouds(%);medium clouds(%);high clouds(%);precipitation(mm);probability of Precip(%);snowFraction;sea level pressure(hPa);relative humidity(%);CAPE;picto-code;radiation (W/m2);\n"; print F "</mb_metadata><valid_until>2030-12-31</valid_until>\n"; print F "<station>\n"; print F ";@fields[5];@fields[9];@fields[8];@fields[10];@fields[6];@fields[2];UTC" . substr (@fields[4], 0, 3) . "." . substr (@fields[4], 3, 2); print F ";@fields[34]:@fields[35];@fields[36]:@fields[37];\n"; print F $epochdate->dmy('.') . ";"; print F $epochdate->day_abbr() . ";"; printf ( F "%02d",$epochdate->hour() ); print F ";"; printf ( F "%5.1f", @fields[11]); print F ";"; printf ( F "%5.1f", @fields[12]); print F ";"; printf ( F "%3d", @fields[16]); print F ";"; printf ( F "%3d", @fields[15]); print F ";"; printf ( F "%3d", @fields[17]); print F ";"; print F " 0; 0; 0;"; printf ( F "%5.1f", @fields[26]); print F ";"; print F " 0;0.0;"; printf ( F "%4d", @fields[19]); print F ";"; printf ( F "%3d", @fields[13]); print F ";"; print F " 0;"; # Convert WU Weathercode to Lox Weathercode # WU: https://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary # Lox: https://www.loxone.com/dede/kb/weather-service/ seems not to be right (anymore), # correct Loxone Weather Types are: # 1 - wolkenlos # 2 - heiter # 3 - heiter # 4 - heiter # 5 - heiter # 6 - heiter # 7 - wolkig # 8 - wolkig # 9 - wolkig # 10 - wolkig # 11 - wolkig # 12 - wolkig # 13 - wolkenlos # 14 - heiter # 15 - heiter # 16 - Nebel # 17 - Nebel # 18 - Nebel # 19 - stark bewölkt # 20 - stark bewölkt # 21 - stark bewölkt # 22 - bedeckt # 23 - Regen # 24 - Schneefall # 25 - starker Regen # 26 - starker Schneefall # 27 - kräftiges Gewitter # 28 - Gewitter # 29 - starker Schneeschauer # 30 - kräftiges Gewitter # 31 - leichter Regenschauer # 32 - leichter Schneeschauer # 33 - leichter Regen # 34 - leichter Schneeschauer # 35 - Schneeregen my $loxweathercode; #if (@fields[28] eq "16") { # $loxweathercode = "21"; #} elsif (@fields[28] eq "19") { # $loxweathercode = "26"; #} elsif (@fields[28] eq "12") { # $loxweathercode = "10"; #} elsif (@fields[28] eq "13") { # $loxweathercode = "11"; #} elsif (@fields[28] eq "14") { # $loxweathercode = "18"; #} elsif (@fields[28] eq "15") { # $loxweathercode = "18"; #} else { # $loxweathercode = @fields[28]; #} if (@fields[28] eq "2") { $loxweathercode = "7"; } elsif (@fields[28] eq "3") { $loxweathercode = "8"; } elsif (@fields[28] eq "4") { $loxweathercode = "9"; } elsif (@fields[28] eq "5") { $loxweathercode = "10"; } elsif (@fields[28] eq "6") { $loxweathercode = "16"; } elsif (@fields[28] eq "7") { $loxweathercode = "7"; } elsif (@fields[28] eq "8") { $loxweathercode = "7"; } elsif (@fields[28] eq "9") { $loxweathercode = "26"; } elsif (@fields[28] eq "10") { $loxweathercode = "33"; } elsif (@fields[28] eq "11") { $loxweathercode = "33"; } elsif (@fields[28] eq "12") { $loxweathercode = "23"; } elsif (@fields[28] eq "13") { $loxweathercode = "23"; } elsif (@fields[28] eq "14") { $loxweathercode = "28"; } elsif (@fields[28] eq "15") { $loxweathercode = "28"; } elsif (@fields[28] eq "16") { $loxweathercode = "26"; } elsif (@fields[28] eq "18") { $loxweathercode = "32"; } elsif (@fields[28] eq "19") { $loxweathercode = "33"; } elsif (@fields[28] eq "20") { $loxweathercode = "24"; } elsif (@fields[28] eq "21") { $loxweathercode = "24"; } elsif (@fields[28] eq "22") { $loxweathercode = "24"; } elsif (@fields[28] eq "23") { $loxweathercode = "24"; } elsif (@fields[28] eq "24") { $loxweathercode = "24"; } else { $loxweathercode = @fields[28]; } printf ( F "%2d", $loxweathercode); print F ";"; printf ( F "%4d", @fields[22]); print F ";\n"; close(F); ############################################# # HOURLY FORECAST ############################################# # Get current weather data from database #open(F,"<$home/data/plugins/$psubfolder/hourlyforecast.dat") || die "Cannot open $home/data/plugins/$psubfolder/hourlyforecast.dat"; # $hfcdata = <F>; #close(F); # Original file has 169 entrys, but always starts at 0:00 today or 12:00 yesterday. We alsways start with current data # (we don't have historical data) and offer 168 hourly forcast datasets. This seems to be ok for the miniserver. $i = 0; my $hfcdate; open(F,">>$lbplogdir/index.txt"); foreach (@hfcdata) { if ( $i >= 168 ) { last; } # Stop after 168 datasets #chomp $_; @fields = split(/\|/,$_); $hfcdate = DateTime->new( year => @fields[6], month => @fields[3], day => @fields[2], hour => @fields[7], minute => @fields[8], ); # "local date;weekday;local time;temperature(C);feeledTemperature(C);windspeed(km/h);winddirection(degr);wind gust(km/h);low clouds(%);medium clouds(%);high clouds(%);precipitation(mm);probability of Precip(%);snowFraction;sea level pressure(hPa);relative humidity(%);CAPE;picto-code;radiation (W/m2);\n"; print F $hfcdate->dmy('.') . ";"; print F $hfcdate->day_abbr() . ";"; printf ( F "%02d",$hfcdate->hour() ); print F ";"; printf ( F "%5.1f", @fields[11]); print F ";"; printf ( F "%5.1f", @fields[12]); print F ";"; printf ( F "%3d", @fields[17]); print F ";"; printf ( F "%3d", @fields[16]); print F ";"; printf ( F "%3d", @fields[17]); print F ";"; printf ( F "%3d", @fields[21]); print F ";"; printf ( F "%3d", @fields[21]); print F ";"; printf ( F "%3d", @fields[21]); print F ";"; printf ( F "%5.1f", @fields[24]); print F ";"; printf ( F "%3d", @fields[26]); print F ";"; print F "0.0;"; printf ( F "%4d", @fields[19]); print F ";"; printf ( F "%3d", @fields[14]); print F ";"; print F " 0;"; # Convert WU Weathercode to Lox Weathercode # WU: https://www.wunderground.com/weather/api/d/docs?d=resources/phrase-glossary # Lox: https://www.loxone.com/dede/kb/weather-service/ seems not to be right (anymore), # correct Loxone Weather Types are: # 1 - wolkenlos # 2 - heiter # 3 - heiter # 4 - heiter # 5 - heiter # 6 - heiter # 7 - wolkig # 8 - wolkig # 9 - wolkig # 10 - wolkig # 11 - wolkig # 12 - wolkig # 13 - wolkenlos # 14 - heiter # 15 - heiter # 16 - Nebel # 17 - Nebel # 18 - Nebel # 19 - stark bewölkt # 20 - stark bewölkt # 21 - stark bewölkt # 22 - bedeckt # 23 - Regen # 24 - Schneefall # 25 - starker Regen # 26 - starker Schneefall # 27 - kräftiges Gewitter # 28 - Gewitter # 29 - starker Schneeschauer # 30 - kräftiges Gewitter # 31 - leichter Regenschauer # 32 - leichter Schneeschauer # 33 - leichter Regen # 34 - leichter Schneeschauer # 35 - Schneeregen my $loxweathercode; #if (@fields[28] eq "16") { # $loxweathercode = "21"; #} elsif (@fields[28] eq "19") { # $loxweathercode = "26"; #} elsif (@fields[28] eq "12") { # $loxweathercode = "10"; #} elsif (@fields[28] eq "13") { # $loxweathercode = "11"; #} elsif (@fields[28] eq "14") { # $loxweathercode = "18"; #} elsif (@fields[28] eq "15") { # $loxweathercode = "18"; #} else { # $loxweathercode = @fields[28]; #} if (@fields[27] eq "2") { $loxweathercode = "7"; } elsif (@fields[27] eq "3") { $loxweathercode = "8"; } elsif (@fields[27] eq "4") { $loxweathercode = "9"; } elsif (@fields[27] eq "5") { $loxweathercode = "10"; } elsif (@fields[27] eq "6") { $loxweathercode = "16"; } elsif (@fields[27] eq "7") { $loxweathercode = "7"; } elsif (@fields[27] eq "8") { $loxweathercode = "7"; } elsif (@fields[27] eq "9") { $loxweathercode = "26"; } elsif (@fields[27] eq "10") { $loxweathercode = "33"; } elsif (@fields[27] eq "11") { $loxweathercode = "33"; } elsif (@fields[27] eq "12") { $loxweathercode = "23"; } elsif (@fields[27] eq "13") { $loxweathercode = "23"; } elsif (@fields[27] eq "14") { $loxweathercode = "28"; } elsif (@fields[27] eq "15") { $loxweathercode = "28"; } elsif (@fields[27] eq "16") { $loxweathercode = "26"; } elsif (@fields[27] eq "18") { $loxweathercode = "32"; } elsif (@fields[27] eq "19") { $loxweathercode = "33"; } elsif (@fields[27] eq "20") { $loxweathercode = "24"; } elsif (@fields[27] eq "21") { $loxweathercode = "24"; } elsif (@fields[27] eq "22") { $loxweathercode = "24"; } elsif (@fields[27] eq "23") { $loxweathercode = "24"; } elsif (@fields[27] eq "24") { $loxweathercode = "24"; } else { $loxweathercode = @fields[27]; } printf ( F "%2d", $loxweathercode); print F "; 0;\n"; $i++; } print F "</station>\n"; close(F); LOGOK "Files for Cloud Weather Emulator created successfully."; } # Finish LOGOK "We are done. Good bye."; LOGEND "Exit."; exit; # # Subroutines # sub send { # Create HTML webpage LOGINF "Adding value to weatherdata.html. Value:$name\@$value"; open(F,">>$lbplogdir/weatherdata.html"); print F "$name\@$value<br>\n"; close(F); # Send by UDP my %miniservers; %miniservers = LoxBerry::System::get_miniservers(); if ($miniservers{1}{IPAddress} ne "" && $sendudp) { $tmpudp .= "$name\@$value; "; if ($udp == 1) { foreach my $ms (sort keys %miniservers) { LOGINF "$sendqueue: Send Data " . $miniservers{$ms}{Name}; # Send value my $sock = IO::Socket::INET->new( Proto => 'udp', PeerPort => $udpport, PeerAddr => $miniservers{$ms}{IPAddress}, ); $sock->send($tmpudp); LOGOK "$sendqueue: Send OK to " . $miniservers{$ms}{Name} . ". IP:" . $miniservers{$ms}{IPAddress} . " Port:$udpport Value:$name\@$value"; $sendqueue++; } $udp = 0; $tmpudp = ""; } } return(); } LOGEND "Exit."; exit;
mschlenstedt/LoxBerry-Plugin-WU4Lox
bin/datatoloxone.pl
Perl
apache-2.0
40,925
# # 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 hardware::sensors::hwgste::snmp::mode::components::resources; use strict; use warnings; use Exporter; our %map_sens_unit; our %map_sens_state; our $mapping; our @ISA = qw(Exporter); our @EXPORT_OK = qw($mapping); %map_sens_state = ( 0 => 'invalid', 1 => 'normal', 2 => 'outOfRangeLo', 3 => 'outOfRangeHi', 4 => 'alarmLo', 5 => 'alarmHi', ); %map_sens_unit = ( 0 => '', # none 1 => 'C', 2 => 'F', 3 => 'K', 4 => '%', ); $mapping = { sensName => { oid => '.1.3.6.1.4.1.21796.4.1.3.1.2' }, sensState => { oid => '.1.3.6.1.4.1.21796.4.1.3.1.3', map => \%map_sens_state }, sensTemp => { oid => '.1.3.6.1.4.1.21796.4.1.3.1.4' }, sensUnit => { oid => '.1.3.6.1.4.1.21796.4.1.3.1.7', map => \%map_sens_unit }, }; 1;
wilfriedcomte/centreon-plugins
hardware/sensors/hwgste/snmp/mode/components/resources.pm
Perl
apache-2.0
1,544
#!/usr/bin/perl package Trimmer::TrimGalore; use strict; use warnings; use File::Basename; use CQS::PBS; use CQS::ConfigUtils; use CQS::SystemUtils; use CQS::FileUtils; use CQS::Task; use CQS::StringUtils; use HTML::Parser; our @ISA = qw(CQS::Task); sub new { my ($class) = @_; my $self = $class->SUPER::new(); $self->{_name} = __PACKAGE__; $self->{_suffix} = "_cut"; bless $self, $class; return $self; } sub parsePairedSamples { my ($samples) = @_; my @sample_files = @{$samples}; my @result = (); for my $sample (@sample_files) { if ( $sample =~ /,/ ) { my @files = split( ',', $sample ); for my $file (@files) { push( @result, $file ); } } else { push( @result, $sample ); } } return @result; } sub remove_fq_file_extension { my ($fileName) = @_; $fileName=basename($fileName); if ( $fileName =~ /\.gz$/ ) { $fileName =~ s/\.gz$//g; } if ( $fileName =~ /\.fastq$/ ) { $fileName =~ s/\.fastq$//g; } if ( $fileName =~ /\.fq$/ ) { $fileName =~ s/\.fq$//g; } return ($fileName); } sub get_final_files { my ( $self, $ispairend, $sampleFilesRef, $extension, $fastqextension ) = @_; if ($ispairend) { my $sampleFileName1 = remove_fq_file_extension( ${$sampleFilesRef}[0] ); my $sampleFileName2 = remove_fq_file_extension( ${$sampleFilesRef}[1] ); return ( $sampleFileName1 . $extension . "_1" . $fastqextension . ".gz", $sampleFileName2 . $extension . "_2" . $fastqextension . ".gz" ); } else { my $sampleFileName1 = remove_fq_file_extension( ${$sampleFilesRef}[0] ); my $finalName = $sampleFileName1 . $extension . $fastqextension; my $final_file = "${finalName}.gz"; my $finalShortFile = $finalName . ".short.gz"; my $finalLongFile = $finalName . ".long.gz"; return ( $final_file, $finalShortFile, $finalLongFile ); } } sub get_extension { my ( $self, $config, $section ) = @_; my $extension = $config->{$section}{extension} or die "define ${section}::extension first"; if ( $extension =~ /\.gz$/ ) { $extension =~ s/\.gz$//g; } my $fastqextension = ".fastq"; if ( $extension =~ /\.fastq$/ ) { $extension =~ s/\.fastq$//g; } if ( $extension =~ /\.fq$/ ) { $fastqextension = ".fq"; $extension =~ s/\.fq$//g; } return ( $extension, $fastqextension ); } sub perform { my ( $self, $config, $section ) = @_; my ( $task_name, $path_file, $pbs_desc, $target_dir, $log_dir, $pbs_dir, $result_dir, $option, $sh_direct, $cluster ) = $self->init_parameter( $config, $section ); my $ispairend = get_is_paired_end_option( $config, $section, 0 ); my ( $extension, $fastqextension ) = $self->get_extension( $config, $section ); my %raw_files = %{ get_raw_files( $config, $section ) }; my $shfile = $self->get_task_filename( $pbs_dir, $task_name ); open( my $sh, ">$shfile" ) or die "Cannot create $shfile"; print $sh get_run_command($sh_direct); for my $sample_name ( sort keys %raw_files ) { my $pbs_file = $self->get_pbs_filename( $pbs_dir, $sample_name ); my $pbs_name = basename($pbs_file); my $log = $self->get_log_filename( $log_dir, $sample_name ); print $sh "\$MYCMD ./$pbs_name \n"; my $log_desc = $cluster->get_log_description($log); my @sample_files = @{ $raw_files{$sample_name} }; my @final_files = $self->get_final_files( $ispairend, \@sample_files, $extension, $fastqextension ); my $pbs = $self->open_pbs( $pbs_file, $pbs_desc, $log_desc, $path_file, $result_dir, $final_files[0] ); if ($ispairend) { die "should be pair-end data but not!" if ( scalar(@sample_files) != 2 ); #pair-end data my $read1file = $sample_files[0]; my $read2file = $sample_files[1]; print $pbs " trim_galore $option --fastqc --fastqc_args \"--outdir .\" --paired --retain_unpaired --output_dir . $read1file $read2file "; } else { #single end my ( $final_file, $finalShortFile, $finalLongFile ) = $self->get_final_files( $ispairend, $sample_name, $extension, $fastqextension ); if ( scalar(@sample_files) == 1 ) { print $pbs " trim_galore $option --fastqc --fastqc_args \"--outdir .\" --retain_unpaired --output_dir . $sample_files[0] "; } else { die "should be single-end data but not!"; } } $self->close_pbs( $pbs, $pbs_file ); } close $sh; if ( is_linux() ) { chmod 0755, $shfile; } print "!!!shell file $shfile created, you can run this shell file to submit all " . $self->{_name} . " tasks.\n"; #`qsub $pbs_file`; } sub result { my ( $self, $config, $section, $pattern ) = @_; my ( $task_name, $path_file, $pbs_desc, $target_dir, $log_dir, $pbs_dir, $result_dir, $option, $sh_direct ) = $self->init_parameter( $config, $section, 0 ); my $ispairend = get_option( $config, $section, "pairend", 0 ); my ( $extension, $fastqextension ) = $self->get_extension( $config, $section ); my %raw_files = %{ get_raw_files( $config, $section ) }; my $result = {}; for my $sample_name ( keys %raw_files ) { my @sample_files = @{ $raw_files{$sample_name} }; my @result_files = (); if ($ispairend) { my $sampleFileName1 = remove_fq_file_extension( $sample_files[0] ); my $sampleFileName2 = remove_fq_file_extension( $sample_files[1] ); my $resultFile1 = $sampleFileName1 . $extension . "_1" . $fastqextension . ".gz"; push( @result_files, "${result_dir}/${resultFile1}" ); my $resultFile2 = $sampleFileName2 . $extension . "_2" . $fastqextension . ".gz"; push( @result_files, "${result_dir}/${resultFile2}" ); } else { my $sampleFileName1 = remove_fq_file_extension( $sample_files[0] ); my $resultFile1 = $sampleFileName1 . $extension . $fastqextension . ".gz"; push( @result_files, "${result_dir}/${resultFile1}" ); } $result->{$sample_name} = filter_array( \@result_files, $pattern ); } return $result; } 1;
shengqh/ngsperl
lib/Trimmer/TrimGalore.pm
Perl
apache-2.0
5,874
=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. =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 package Bio::EnsEMBL::Variation::Pipeline::ReleaseDataDumps::BaseDataDumpsProcess; use strict; use base ('Bio::EnsEMBL::Hive::Process'); use Bio::EnsEMBL::Registry; sub get_all_species { my $self = shift; my $registry = 'Bio::EnsEMBL::Registry'; $registry->load_all($self->param('registry_file')); my $vdbas = $registry->get_all_DBAdaptors(-group => 'variation'); my $species = {}; foreach my $vdba (@$vdbas) { my $species_name = $vdba->species(); $species->{$species_name} = 1; } return $species; } sub get_species_adaptor { my ($self, $species, $group) = @_; return $self->get_adaptor($species, $group); } sub get_adaptor { my ($self, $species, $group) = @_; my $dba; eval { $dba = Bio::EnsEMBL::Registry->get_DBAdaptor($species, $group); }; unless (defined $dba) { $self->_load_registry(); $dba = Bio::EnsEMBL::Registry->get_DBAdaptor($species, $group); } unless (defined $dba) { die "Failed to a get DBA for $species and group $group"; } return $dba; } sub _load_registry { my ($self) = @_; my $reg_file = $self->param('registry_file'); Bio::EnsEMBL::Registry->load_all($reg_file, 0, 1); return; } 1;
dbolser/ensembl-variation
modules/Bio/EnsEMBL/Variation/Pipeline/ReleaseDataDumps/BaseDataDumpsProcess.pm
Perl
apache-2.0
2,152
package EBiSC::Cursor::hPSCreg; use namespace::autoclean; use Moose; use strict; use warnings; has 'api' => (is => 'ro', isa => 'EBiSC::API::hPSCreg'); has 'i' => (is => 'rw', isa => 'Int', default => 0); sub next { my ($self) = @_; my $i = $self->i; return undef if $i < 0; my $line_names = $self->api->line_names; return undef if $i >= @$line_names; $self->i($i+1); return { name => $line_names->[$i], obj => $self->api->get_line($line_names->[$i]), }; } 1;
EMBL-EBI-GCA/ebisc_tracker_2
tracker/lib/EBiSC/Cursor/hPSCreg.pm
Perl
apache-2.0
487
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of VivoMind Prolog Unicode Resources % SPDX-License-Identifier: CC0-1.0 % % VivoMind Prolog Unicode Resources is free software distributed using the % Creative Commons CC0 1.0 Universal (CC0 1.0) - Public Domain Dedication % license % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Last modified: February 11, 2017 % % Original Unicode file header comments follow /* # DerivedCoreProperties-6.1.0.txt # Date: 2011-12-11, 18:26:55 GMT [MD] # # Unicode Character Database # Copyright (c) 1991-2011 Unicode, Inc. # For terms of use, see http://www.unicode.org/terms_of_use.html # For documentation, see http://www.unicode.org/reports/tr44/ % ================================================ */ :- include('unicode_core_properties/unicode_math'). :- include('unicode_core_properties/unicode_alphabetic'). :- include('unicode_core_properties/unicode_lowercase'). :- include('unicode_core_properties/unicode_uppercase'). :- include('unicode_core_properties/unicode_cased'). :- include('unicode_core_properties/unicode_case_ignorable'). :- include('unicode_core_properties/unicode_changes_when_lowercased'). :- include('unicode_core_properties/unicode_changes_when_uppercased'). :- include('unicode_core_properties/unicode_changes_when_titlecased'). :- include('unicode_core_properties/unicode_changes_when_casefolded'). :- include('unicode_core_properties/unicode_changes_when_casemapped'). :- include('unicode_core_properties/unicode_id_start'). :- include('unicode_core_properties/unicode_id_continue'). :- include('unicode_core_properties/unicode_xid_start'). :- include('unicode_core_properties/unicode_xid_continue'). :- include('unicode_core_properties/unicode_default_ignorable'). :- include('unicode_core_properties/unicode_grapheme_extend'). :- include('unicode_core_properties/unicode_grapheme_base'). :- include('unicode_core_properties/unicode_grapheme_link'). :- include('unicode_core_properties/unicode_range_alphabetic'). % EOF
LogtalkDotOrg/logtalk3
library/unicode_data/unicode_core_properties.pl
Perl
apache-2.0
2,085
package Google::Ads::AdWords::v201402::ExperimentError::Reason; use strict; use warnings; sub get_xmlns { 'https://adwords.google.com/api/adwords/cm/v201402'}; # derivation by restriction use base qw( SOAP::WSDL::XSD::Typelib::Builtin::string); 1; __END__ =pod =head1 NAME =head1 DESCRIPTION Perl data type class for the XML Schema defined simpleType ExperimentError.Reason from the namespace https://adwords.google.com/api/adwords/cm/v201402. The reasons for the target error. This clase is derived from SOAP::WSDL::XSD::Typelib::Builtin::string . SOAP::WSDL's schema implementation does not validate data, so you can use it exactly like it's base type. # Description of restrictions not implemented yet. =head1 METHODS =head2 new Constructor. =head2 get_value / set_value Getter and setter for the simpleType's value. =head1 OVERLOADING Depending on the simple type's base type, the following operations are overloaded Stringification Numerification Boolification Check L<SOAP::WSDL::XSD::Typelib::Builtin> for more information. =head1 AUTHOR Generated by SOAP::WSDL =cut
gitpan/GOOGLE-ADWORDS-PERL-CLIENT
lib/Google/Ads/AdWords/v201402/ExperimentError/Reason.pm
Perl
apache-2.0
1,117
#!/usr/bin/perl # Mingyu @ Apr 18 2013 # use data_NP2DuvNV2D to construct the global word-level MLF (w/o alignment information) # char-level MLF # the MLF contains the "selected (filtered)" detection results from MATLAB GMM writing detector # the vocab of detected words < 1k use strict; use File::Path qw(make_path); use File::stat; my $data_dir = "data_NP2DuvNV2D"; unless (-d $data_dir) { die "needs $data_dir to generate mlf files!\n"; } unless (-d mlf) { make_path("mlf"); } # Create the word level mlf for all detected words open (FILE, '>mlf/word.mlf') or die $!; print FILE "\#!MLF!\#\n"; # Create the char level mlf for all detected words open (WORD_L, ">mlf/word_char.mlf") or die $!; print WORD_L "\#!MLF!\#\n"; # Create the char level + multi ligs fro all detected words open (WORD_ML, ">mlf/word_char_multi_lig2.mlf") or die $!; print WORD_ML "\#!MLF!\#\n"; #================================================== # The cluster I will use for multi-lig(2) models #S1: BDEFHKLMNPRTUVWXYZ #S2: AIJOQ #S3: CGS # #E1: BDSX #E2: ITY #E3: CEGHKLMQRZ #E4: JP #E5: AF #E6: O #E7: NUVW #================================================== # Start points have 3 sets my %S_hash = ( 'A' => 2, 'B' => 1, 'C' => 3, 'D' => 1, 'E' => 1, 'F' => 1, 'G' => 3, 'H' => 1, 'I' => 2, 'J' => 2, 'K' => 1, 'L' => 1, 'M' => 1, 'N' => 1, 'O' => 2, 'P' => 1, 'Q' => 2, 'R' => 1, 'S' => 3, 'T' => 1, 'U' => 1, 'V' => 1, 'W' => 1, 'X' => 1, 'Y' => 1, 'Z' => 1, ); # End points have 3 sets my %E_hash = ( 'A' => 5, 'B' => 1, 'C' => 3, 'D' => 1, 'E' => 3, 'F' => 5, 'G' => 3, 'H' => 3, 'I' => 2, 'J' => 4, 'K' => 3, 'L' => 3, 'M' => 3, 'N' => 7, 'O' => 6, 'P' => 4, 'Q' => 3, 'R' => 3, 'S' => 1, 'T' => 2, 'U' => 7, 'V' => 7, 'W' => 7, 'X' => 1, 'Y' => 2, 'Z' => 3, ); #================================================== #================================================== my $cnt = 0; my @files = glob($data_dir."/*.htk"); foreach my $file (@files) { $cnt += 1; $file =~ m/\/(.*)_([A-Z]+).htk/; my $w = $2; print $1."_".$2."\n"; # word-level mlf print FILE "\"*/$1_$2.lab\"\n"; print FILE "$w\n"; print FILE ".\n"; # char-level mlf print WORD_L "\"*/$1_$2.lab\"\n"; my @sub_chars = split(undef,$w); while (scalar(@sub_chars)>1) { print WORD_L $sub_chars[0]."_\n"; shift(@sub_chars); } print WORD_L $sub_chars[0]."\n"; print WORD_L ".\n"; # char-level mlf + multi ligs print WORD_ML "\"*/$1_$2.lab\"\n"; @sub_chars = split(undef,$w); print WORD_ML $sub_chars[0]."\n"; foreach my $i (1..scalar(@sub_chars)-1) { my $e = $E_hash{$sub_chars[$i-1]}; my $s = $S_hash{$sub_chars[$i]}; my $lig = "lig_E$e"."S$s"; print WORD_ML $lig."\n"; print WORD_ML $sub_chars[$i]."\n"; } print WORD_ML ".\n"; } close(FILE); close(WORD_L); close(WORD_ML); print "Total $cnt detected word segments (filtered)\n";
mingyu623/6DMG
data_htk/airwriting_spot/train/gen_global_mlf.pl
Perl
bsd-2-clause
3,156
#!/usr/bin/perl # Arg1 is the tty device # Arg2 is the base filename open (FILE, "+<" . $ARGV[0]) or die("Grrr"); open (OUTFILEP, ">" . $ARGV[1] . ".txt") or die("Wruuf"); open (OUTFILEb, ">" . $ARGV[1] . "-buckets.txt") or die("Wruuf"); print FILE "P"; while ( $line = <FILE> ) { $line =~ s/\r//; print OUTFILEP $line; if ($line =~ /^\s*$/) { last; } } close(OUTFILEP); # removes junk at end of trace close(FILE); open (FILE, "+<" . $ARGV[0]) or die("Grrr"); print FILE "b"; while ( $line = <FILE> ) { $line =~ s/\r//; print OUTFILEb $line; if ($line =~ /^\s*$/) { last; } } close(OUTFILEp); # removes junk at end of trace close(FILE); open (FILE, "+<" . $ARGV[0]) or die("Grrr"); # If reset fails to return this will hang.. print "Resetting for next run (hangs here if it fails)\n"; print FILE "r"; while ( $line = <FILE> ) { if ($line =~ /Reset/) { last; } } close(FILE);
zengluyang/wsn_tinyos_port
common/lib/logger/getTrace.pl
Perl
bsd-3-clause
931
#!/usr/bin/perl ################################################################################## # # USAGE: perl number_fasta.pl [fasta] # converts headers to autoincremented numbers # # Created by jennifer shelton # ################################################################################## use strict; use warnings; ################################################################################## ############## notes ################## ################################################################################## my $fasta_in=$ARGV[0]; open (FASTA_IN,"<",$fasta_in) or die "can't open $fasta_in !"; $fasta_in =~ /(.*).fa/; my $fasta_out="$1_numbered_scaffold.fasta"; if (-e "$fasta_out") {print "$fasta_out file Exists!\n"; exit;} open (FASTA_OUT,">",$fasta_out) or die "can't open $fasta_out !"; my $n=1; while (<FASTA_IN>) { chomp; if (/>/) { print FASTA_OUT ">$n\n"; ++$n; } else { print FASTA_OUT "$_\n"; } }
kstatebioinfo/Irys-scaffolding
KSU_bioinfo_lab/script_archive/analyze_irys_output/number_fasta.pl
Perl
mit
996
#!/usr/bin/perl -w #v5/h while (<STDIN>) { #chomp; #my @pieces = split("\t"); #next if ( ! $pieces[0] ); #$pieces[0] =~ s/\s+//; #die "\"$_\"" if (@pieces != 2); #print $pieces[0], "\t", $pieces[1], "\n"; print $_ if ( defined $_ ); } 1;
sauloal/projects
probes/hadoop1/wc4.pl
Perl
mit
269
# -*- Mode: perl; indent-tabs-mode: nil -*- # # The contents of this file are subject to the Mozilla Public # License Version 1.1 (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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or # implied. See the License for the specific language governing # rights and limitations under the License. # # The Original Code is the Bugzilla Example Plugin. # # The Initial Developer of the Original Code is Everything Solved, Inc. # Portions created by the Initial Developer are Copyright (C) 2008 # the Initial Developer. All Rights Reserved. # # Contributor(s): Max Kanat-Alexander <mkanat@bugzilla.org> use strict; use warnings; use Bugzilla; my $email = Bugzilla->hook_args->{email}; # If you add a header to an email, it's best to start it with # 'X-Bugzilla-<Extension>' so that you don't conflict with # other extensions. $email->header_set('X-Bugzilla-Example-Header', 'Example');
cognitoedtech/assy
apps/mastishka/mcat/cgi-bin/bugzilla/extensions/example/code/mailer-before_send.pl
Perl
apache-2.0
1,108
package Paws::ECS::DeregisterTaskDefinitionResponse; use Moose; has TaskDefinition => (is => 'ro', isa => 'Paws::ECS::TaskDefinition', traits => ['NameInRequest'], request_name => 'taskDefinition' ); has _request_id => (is => 'ro', isa => 'Str'); ### main pod documentation begin ### =head1 NAME Paws::ECS::DeregisterTaskDefinitionResponse =head1 ATTRIBUTES =head2 TaskDefinition => L<Paws::ECS::TaskDefinition> The full description of the deregistered task. =head2 _request_id => Str =cut 1;
ioanrogers/aws-sdk-perl
auto-lib/Paws/ECS/DeregisterTaskDefinitionResponse.pm
Perl
apache-2.0
512