hexsha
stringlengths 40
40
| size
int64 3
1.05M
| ext
stringclasses 163
values | lang
stringclasses 53
values | max_stars_repo_path
stringlengths 3
945
| max_stars_repo_name
stringlengths 4
112
| max_stars_repo_head_hexsha
stringlengths 40
78
| max_stars_repo_licenses
sequencelengths 1
10
| max_stars_count
float64 1
191k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 3
945
| max_issues_repo_name
stringlengths 4
113
| max_issues_repo_head_hexsha
stringlengths 40
78
| max_issues_repo_licenses
sequencelengths 1
10
| max_issues_count
float64 1
116k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 3
945
| max_forks_repo_name
stringlengths 4
113
| max_forks_repo_head_hexsha
stringlengths 40
78
| max_forks_repo_licenses
sequencelengths 1
10
| max_forks_count
float64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 3
1.05M
| avg_line_length
float64 1
966k
| max_line_length
int64 1
977k
| alphanum_fraction
float64 0
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
edbe9ed45a274c38a43f9f49f3a22522dbf98cde | 7,061 | pm | Perl | perl/vendor/lib/Mojo/Transaction.pm | luiscarlosg27/xampp | c295dbdd435c9c62fbd4cc6fc42097bea7a900a0 | [
"Apache-2.0"
] | 2 | 2021-07-24T12:46:49.000Z | 2021-08-02T08:37:53.000Z | perl/vendor/lib/Mojo/Transaction.pm | luiscarlosg27/xampp | c295dbdd435c9c62fbd4cc6fc42097bea7a900a0 | [
"Apache-2.0"
] | null | null | null | perl/vendor/lib/Mojo/Transaction.pm | luiscarlosg27/xampp | c295dbdd435c9c62fbd4cc6fc42097bea7a900a0 | [
"Apache-2.0"
] | null | null | null | package Mojo::Transaction;
use Mojo::Base 'Mojo::EventEmitter';
use Carp qw(croak);
use Mojo::Message::Request;
use Mojo::Message::Response;
use Mojo::Util qw(deprecated);
has [qw(kept_alive local_address local_port original_remote_address remote_port)];
has req => sub { Mojo::Message::Request->new };
has res => sub { Mojo::Message::Response->new };
sub client_read { croak 'Method "client_read" not implemented by subclass' }
sub client_write { croak 'Method "client_write" not implemented by subclass' }
sub closed { shift->completed->emit('finish') }
sub completed { ++$_[0]{completed} and return $_[0] }
sub connection {
my $self = shift;
return $self->emit(connection => $self->{connection} = shift) if @_;
return $self->{connection};
}
sub error { $_[0]->req->error || $_[0]->res->error }
sub is_finished { !!shift->{completed} }
sub is_websocket {undef}
sub remote_address {
my $self = shift;
return $self->original_remote_address(@_) if @_;
return $self->original_remote_address unless $self->req->reverse_proxy;
# Reverse proxy
return ($self->req->headers->header('X-Forwarded-For') // '') =~ /([^,\s]+)$/ ? $1 : $self->original_remote_address;
}
sub result {
my $self = shift;
my $err = $self->error;
return !$err || $err->{code} ? $self->res : croak $err->{message};
}
sub server_read { croak 'Method "server_read" not implemented by subclass' }
sub server_write { croak 'Method "server_write" not implemented by subclass' }
# DEPRECATED!
sub success {
deprecated 'Mojo::Transaction::success is DEPRECATED'
. ' in favor of Mojo::Transaction::result and Mojo::Transaction::error';
$_[0]->error ? undef : $_[0]->res;
}
1;
=encoding utf8
=head1 NAME
Mojo::Transaction - Transaction base class
=head1 SYNOPSIS
package Mojo::Transaction::MyTransaction;
use Mojo::Base 'Mojo::Transaction';
sub client_read {...}
sub client_write {...}
sub server_read {...}
sub server_write {...}
=head1 DESCRIPTION
L<Mojo::Transaction> is an abstract base class for transactions, like L<Mojo::Transaction::HTTP> and
L<Mojo::Transaction::WebSocket>.
=head1 EVENTS
L<Mojo::Transaction> inherits all events from L<Mojo::EventEmitter> and can emit the following new ones.
=head2 connection
$tx->on(connection => sub {
my ($tx, $connection) = @_;
...
});
Emitted when a connection has been assigned to transaction.
=head2 finish
$tx->on(finish => sub {
my $tx = shift;
...
});
Emitted when transaction is finished.
=head1 ATTRIBUTES
L<Mojo::Transaction> implements the following attributes.
=head2 kept_alive
my $bool = $tx->kept_alive;
$tx = $tx->kept_alive($bool);
Connection has been kept alive.
=head2 local_address
my $address = $tx->local_address;
$tx = $tx->local_address('127.0.0.1');
Local interface address.
=head2 local_port
my $port = $tx->local_port;
$tx = $tx->local_port(8080);
Local interface port.
=head2 original_remote_address
my $address = $tx->original_remote_address;
$tx = $tx->original_remote_address('127.0.0.1');
Remote interface address.
=head2 remote_port
my $port = $tx->remote_port;
$tx = $tx->remote_port(8081);
Remote interface port.
=head2 req
my $req = $tx->req;
$tx = $tx->req(Mojo::Message::Request->new);
HTTP request, defaults to a L<Mojo::Message::Request> object.
# Access request information
my $method = $tx->req->method;
my $url = $tx->req->url->to_abs;
my $info = $tx->req->url->to_abs->userinfo;
my $host = $tx->req->url->to_abs->host;
my $agent = $tx->req->headers->user_agent;
my $custom = $tx->req->headers->header('Custom-Header');
my $bytes = $tx->req->body;
my $str = $tx->req->text;
my $hash = $tx->req->params->to_hash;
my $all = $tx->req->uploads;
my $value = $tx->req->json;
my $foo = $tx->req->json('/23/foo');
my $dom = $tx->req->dom;
my $bar = $tx->req->dom('div.bar')->first->text;
=head2 res
my $res = $tx->res;
$tx = $tx->res(Mojo::Message::Response->new);
HTTP response, defaults to a L<Mojo::Message::Response> object.
# Access response information
my $code = $tx->res->code;
my $message = $tx->res->message;
my $server = $tx->res->headers->server;
my $custom = $tx->res->headers->header('Custom-Header');
my $bytes = $tx->res->body;
my $str = $tx->res->text;
my $value = $tx->res->json;
my $foo = $tx->res->json('/23/foo');
my $dom = $tx->res->dom;
my $bar = $tx->res->dom('div.bar')->first->text;
=head1 METHODS
L<Mojo::Transaction> inherits all methods from L<Mojo::EventEmitter> and implements the following new ones.
=head2 client_read
$tx->client_read($bytes);
Read data client-side, used to implement user agents such as L<Mojo::UserAgent>. Meant to be overloaded in a subclass.
=head2 client_write
my $bytes = $tx->client_write;
Write data client-side, used to implement user agents such as L<Mojo::UserAgent>. Meant to be overloaded in a subclass.
=head2 closed
$tx = $tx->closed;
Same as L</"completed">, but also indicates that all transaction data has been sent.
=head2 completed
$tx = $tx->completed;
Low-level method to finalize transaction.
=head2 connection
my $id = $tx->connection;
$tx = $tx->connection($id);
Connection identifier.
=head2 error
my $err = $tx->error;
Get request or response error and return C<undef> if there is no error.
# Longer version
my $err = $tx->req->error || $tx->res->error;
# Check for 4xx/5xx response and connection errors
if (my $err = $tx->error) {
die "$err->{code} response: $err->{message}" if $err->{code};
die "Connection error: $err->{message}";
}
=head2 is_finished
my $bool = $tx->is_finished;
Check if transaction is finished.
=head2 is_websocket
my $bool = $tx->is_websocket;
False, this is not a L<Mojo::Transaction::WebSocket> object.
=head2 remote_address
my $address = $tx->remote_address;
$tx = $tx->remote_address('127.0.0.1');
Same as L</"original_remote_address"> or the last value of the C<X-Forwarded-For> header if L</"req"> has been
performed through a reverse proxy.
=head2 result
my $res = $tx->result;
Returns the L<Mojo::Message::Response> object from L</"res"> or dies if a connection error has occurred.
# Fine grained response handling (dies on connection errors)
my $res = $tx->result;
if ($res->is_success) { say $res->body }
elsif ($res->is_error) { say $res->message }
elsif ($res->code == 301) { say $res->headers->location }
else { say 'Whatever...' }
=head2 server_read
$tx->server_read($bytes);
Read data server-side, used to implement web servers such as L<Mojo::Server::Daemon>. Meant to be overloaded in a
subclass.
=head2 server_write
my $bytes = $tx->server_write;
Write data server-side, used to implement web servers such as L<Mojo::Server::Daemon>. Meant to be overloaded in a
subclass.
=head1 SEE ALSO
L<Mojolicious>, L<Mojolicious::Guides>, L<https://mojolicious.org>.
=cut
| 24.688811 | 119 | 0.662937 |
ed8f1d6e7f278aa2c4b2103818c5c3deebde55c0 | 532 | pl | Perl | Mojoqq/perl/lib/unicore/lib/Sc/Khmr.pl | ghuan/Mojo-webqq-for-windows | ad44014da4578f99aa3efad0b55f0fc3bc3af322 | [
"Unlicense"
] | null | null | null | Mojoqq/perl/lib/unicore/lib/Sc/Khmr.pl | ghuan/Mojo-webqq-for-windows | ad44014da4578f99aa3efad0b55f0fc3bc3af322 | [
"Unlicense"
] | null | null | null | Mojoqq/perl/lib/unicore/lib/Sc/Khmr.pl | ghuan/Mojo-webqq-for-windows | ad44014da4578f99aa3efad0b55f0fc3bc3af322 | [
"Unlicense"
] | null | null | null | # !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
# This file is machine-generated by ..\lib\unicore\mktables from the Unicode
# database, Version 8.0.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';
V8
6016
6110
6112
6122
6128
6138
6624
6656
END
| 23.130435 | 77 | 0.68797 |
ed8e22cada72c4d531bfe8c8e4cd675fd367cfbb | 1,721 | pl | Perl | Example_Klarna_Capture_UpdateOrder.pl | AltaPay/sdk-perl | 475b6f72aa7f2bbc5b468903d7d282e5a81bf6cd | [
"MIT"
] | null | null | null | Example_Klarna_Capture_UpdateOrder.pl | AltaPay/sdk-perl | 475b6f72aa7f2bbc5b468903d7d282e5a81bf6cd | [
"MIT"
] | 1 | 2021-11-06T18:01:43.000Z | 2021-11-06T18:01:43.000Z | Example_Klarna_Capture_UpdateOrder.pl | AltaPay/sdk-perl | 475b6f72aa7f2bbc5b468903d7d282e5a81bf6cd | [
"MIT"
] | null | null | null | #!/usr/bin/perl
#
# Klarna test script.
#
#
package Pensio::Examples;
use ExampleSettings;
use ExampleStdoutLogger;
use Pensio::PensioAPI;
use Pensio::Request::CaptureRequest;
use Pensio::Request::UpdateOrderRequest;
use Pensio::Request::OrderLines;
use Data::Dumper;
my $api_settings_obj = ExampleSettings->new();
my $api = new Pensio::PensioAPI($api_settings_obj->installation_url, $api_settings_obj->username, $api_settings_obj->password);
$api->setLogger(new ExampleStdoutLogger());
# CAPTURE: =============================================================================
my $paymentId = '1424'; # PUT A PAYMENT ID FROM A PREVIOUSLY CREATED ORDER HERE
my $request = new Pensio::Request::CaptureRequest(paymentId=>$paymentId);
my $response = $api->capture(request => $request);
if (!$response->wasSuccessful()) {
print("Capture was declined: " . $response->getMerchantErrorMessage() . "\n");
}
# UPDATE ORDER: ========================================================================
my $lines = new Pensio::Request::OrderLines();
$lines->add(
description => "description 1",
itemId => "id 01",
quantity => -1,
unitPrice => 1.1,
goodsType => "item"
);
$lines->add(
description => "new item",
itemId => "new id",
quantity => 1,
unitPrice => 1.1,
goodsType => "item"
);
$request = new Pensio::Request::UpdateOrderRequest (paymentId=>$paymentId, orderLines=>$lines);
$response = $api->updateOrder(request => $request);
if (!$response->wasSuccessful()) {
print("Update order error: " . $response->getErrorMessage() . "\n");
print("Update order error code: " . $response->getErrorCode());
}
else {
print("Update order: successful!");
}
| 26.890625 | 127 | 0.614178 |
ed884d55987a791feb63b2a1ffea560700f0829e | 2,923 | pl | Perl | staging/old_hand_layout.pl | lindseyspratt/mosaic-pls | 4d127da8c2cd183ba6bf6c09e0229aca118fd9b7 | [
"MIT"
] | null | null | null | staging/old_hand_layout.pl | lindseyspratt/mosaic-pls | 4d127da8c2cd183ba6bf6c09e0229aca118fd9b7 | [
"MIT"
] | null | null | null | staging/old_hand_layout.pl | lindseyspratt/mosaic-pls | 4d127da8c2cd183ba6bf6c09e0229aca118fd9b7 | [
"MIT"
] | null | null | null | invoke :-
get_number_of_players(NumberOfPlayers),
initial_hands_expanded(NumberOfPlayers, Hands),
setup_hands(Hands, TileIDs).
setup_hands([], []).
setup_hands([_+HandTiles|T], IDs) :-
%writeln(setting_up_hand(HandTiles)),
setup_hand(HandTiles, IDs, IDTail),
setup_hands(T, IDTail).
setup_hand([], Tail, Tail).
setup_hand([x(X, Y, Size,GridX,GridY)-ID|T], [ID|OtherIDs], IDTail) :-
%writeln(setup_hand_tile(x(H,GridX,GridY)-ID)),
update_grid_x(ID, _, GridX),
update_grid_y(ID, _, GridY),
%assert_data(H, ID),
create_tile_view(ID, X, Y, Size),
setup_hand(T, OtherIDs, IDTail).
hand_origin(1).
initial_hands_expanded(NumberOfPlayers, ExpandedHands) :-
initial_hands(NumberOfPlayers, Hands),
expand_hands(Hands, ExpandedHands).
expand_hands([], []).
expand_hands([H|T], [EH|ET]) :-
expand_hand(H, EH),
expand_hands(T, ET).
expand_hand(ID+BriefTiles, ID+ExpandedTiles) :-
get_hand_tile_size(Size),
expand_brief_tiles(BriefTiles, Size, ExpandedTiles).
expand_brief_tiles([], _, []).
expand_brief_tiles([H|T], Size, [EH|ET]) :-
expand_brief_tile(H, Size, EH),
expand_brief_tiles(T, Size, ET).
% [x, y,bx,by,size,colors,container]
expand_brief_tile(t(BoardX, BoardY, TileID),
Size,
x(X, Y, Size, BoardX, BoardY)-TileID) :- % make the TileID and ModelID the same.
X is BoardX * Size,
Y is BoardY * Size.
/*
Fill in gridX and gridY values for the tile models created by game_model_tiles:build_tiles/0
such that the tiles for a hand are grouped together in a vertical rectangle 2 columns wide and 4
rows deep and these two hand rectangles are placed one above the other with a small space
separating them.
*/
initial_hands(2, [1+Player1Tiles, 2+Player2Tiles]) :-
hand_origin(Origin1),
Origin2 is Origin1 + 5,
get_hands([ModelHand1, ModelHand2]),
place_hand(ModelHand1, 1, Origin1, 0, 4, Player1Tiles),
length(Player1Tiles, Player1TilesLength),
place_hand(ModelHand2, 1, Origin2, Player1TilesLength, 4, Player2Tiles).
% place_hand(Hand, BaseCol, BaseRow, PlacedSoFar, MaxColumns, MaxRows, PlacedHand).
place_hand(AbstractHand, BaseCol, BaseRow, PlacedSoFar, MaxRows, PlacedHand) :-
place_hand(AbstractHand, BaseCol, BaseRow, PlacedSoFar, PlacedSoFar, MaxRows, PlacedHand).
place_hand([], _BaseCol, _BaseRow, _Counter, _InitialCounter, _MaxRows, []).
place_hand([H|T], BaseCol, BaseRow, Counter, InitialCounter, MaxRows, [HP|TP]) :-
place_hand1(H, BaseCol, BaseRow, Counter, InitialCounter, MaxRows, HP),
CounterNEXT is Counter + 1,
place_hand(T, BaseCol, BaseRow, CounterNEXT, InitialCounter, MaxRows, TP).
place_hand1(H, BaseCol, BaseRow, Counter, InitialCounter, MaxRows, t(Col, Row, H)) :-
RowIncrement is (Counter-InitialCounter) mod MaxRows,
ColIncrement is (Counter-InitialCounter) // MaxRows,
Col is BaseCol + ColIncrement,
Row is BaseRow + RowIncrement.
| 37.961039 | 96 | 0.716045 |
ed36cc47063c39a99a32aef16b80a8cb3c8c3f4b | 1,806 | pm | Perl | traffic_ops/app/lib/Fixtures/Hwinfo.pm | bakerolls/trafficcontrol | 0d2560d98795202088ea058c095b4ad32cd49840 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"CC0-1.0",
"BSD-3-Clause"
] | 1 | 2021-04-11T16:55:27.000Z | 2021-04-11T16:55:27.000Z | traffic_ops/app/lib/Fixtures/Hwinfo.pm | bakerolls/trafficcontrol | 0d2560d98795202088ea058c095b4ad32cd49840 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"CC0-1.0",
"BSD-3-Clause"
] | 3 | 2021-03-12T22:35:02.000Z | 2021-12-09T23:00:11.000Z | traffic_ops/app/lib/Fixtures/Hwinfo.pm | bakerolls/trafficcontrol | 0d2560d98795202088ea058c095b4ad32cd49840 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"CC0-1.0",
"BSD-3-Clause"
] | 1 | 2020-03-13T00:21:18.000Z | 2020-03-13T00:21:18.000Z | package Fixtures::Hwinfo;
#
#
# 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 = (
hw1 => {
new => 'Hwinfo',
using => {
id => 1,
serverid => 100,
description => 'BACKPLANE FIRMWA',
val => '7.0.0.29',
},
},
hw2 => {
new => 'Hwinfo',
using => {
id => 2,
serverid => 200,
description => 'DRAC FIRMWA',
val => '1.0.0.29',
},
},
hw3 => {
new => 'Hwinfo',
using => {
id => 3,
serverid => 200,
description => 'ServiceTag',
val => 'XXX',
},
},
hw4 => {
new => 'Hwinfo',
using => {
id => 4,
serverid => 200,
description => 'Manufacturer',
val => 'Dell Inc.',
},
},
hw5 => {
new => 'Hwinfo',
using => {
id => 5,
serverid => 200,
description => 'Model',
val => 'Beetle',
},
},
);
sub get_definition {
my ( $self, $name ) = @_;
return $definition_for{$name};
}
sub all_fixture_names {
# sort by db val to guarantee insertion order
return (sort { $definition_for{$a}{using}{val} cmp $definition_for{$b}{using}{val} } keys %definition_for);
}
__PACKAGE__->meta->make_immutable;
1;
| 22.02439 | 108 | 0.581395 |
eda741e05c8f35385633868eda25e6ecf296a075 | 89 | t | Perl | tests/binutils-2.30/src/ld/testsuite/ld-scripts/provide-5.t | sillywalk/GRSan | a0adb1a90d41ff9006d8c1476546263f728b3c83 | [
"Apache-2.0"
] | null | null | null | tests/binutils-2.30/src/ld/testsuite/ld-scripts/provide-5.t | sillywalk/GRSan | a0adb1a90d41ff9006d8c1476546263f728b3c83 | [
"Apache-2.0"
] | null | null | null | tests/binutils-2.30/src/ld/testsuite/ld-scripts/provide-5.t | sillywalk/GRSan | a0adb1a90d41ff9006d8c1476546263f728b3c83 | [
"Apache-2.0"
] | null | null | null | SECTIONS
{
foo = 0x10;
PROVIDE (foo = bar);
.data 0x1000 :
{
*(.data)
}
}
| 8.090909 | 22 | 0.47191 |
ed9e55bb15b532ab2fd3e3e292efbab897427451 | 3,854 | pm | Perl | lib/Crypt/Perl/RSA/PKCS1_v1_5.pm | comewalk/p5-Crypt-Perl | fca0312a3b80c2b45d47a1cddba5d1c62779a7e2 | [
"Artistic-1.0-cl8"
] | 4 | 2018-06-18T19:22:05.000Z | 2021-10-13T15:42:02.000Z | lib/Crypt/Perl/RSA/PKCS1_v1_5.pm | comewalk/p5-Crypt-Perl | fca0312a3b80c2b45d47a1cddba5d1c62779a7e2 | [
"Artistic-1.0-cl8"
] | 15 | 2017-01-01T00:31:56.000Z | 2021-12-15T20:07:34.000Z | lib/Crypt/Perl/RSA/PKCS1_v1_5.pm | comewalk/p5-Crypt-Perl | fca0312a3b80c2b45d47a1cddba5d1c62779a7e2 | [
"Artistic-1.0-cl8"
] | 1 | 2016-12-14T15:32:42.000Z | 2016-12-14T15:32:42.000Z | package Crypt::Perl::RSA::PKCS1_v1_5;
=encoding utf-8
=head1 NAME
Crypt::Perl::RSA::PKCS1_v1_5 - PKCS1 v1.5 signature padding
=head1 SYNOPSIS
my $digest = Digest::SHA::sha256('This is my message.');
my $sig = Crypt::Perl::RSA::PKCS1_v1_5::encode(
$digest,
'sha256', #digest OID; see below
2048, #the bit length of the key’s modulus
);
#This value should match $digest.
my $digest_dec = Crypt::Perl::RSA::PKCS1_v1_5::decode(
$sig,
'sha256',
);
=head1 LIST OF DIGEST OIDs
=over 4
=item * sha512
=item * sha384
=item * sha256
=back
The following are considered too weak for good security now;
they’re included for historical interest.
=over 4
=item * sha1
=item * md5
=item * md2
=back
=cut
use strict;
use warnings;
use Crypt::Perl::X ();
#----------------------------------------------------------------------
#RFC 3447, page 42
#These are too weak for modern hardware, but we’ll include them anyway.
use constant DER_header_md2 => "\x30\x20\x30\x0c\x06\x08\x2a\x86\x48\x86\xf7\x0d\x02\x02\x05\x00\x04\x10";
use constant DER_header_md5 => "\x30\x20\x30\x0c\x06\x08\x2a\x86\x48\x86\xf7\x0d\x02\x05\x05\x00\x04\x10";
use constant DER_header_sha1 => "\x30\x21\x30\x09\x06\x05\x2b\x0e\x03\x02\x1a\x05\x00\x04\x14";
#As of December 2016, the following are considered safe for general use.
use constant DER_header_sha256 => "\x30\x31\x30\x0d\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x01\x05\x00\x04\x20";
use constant DER_header_sha384 => "\x30\x41\x30\x0d\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x02\x05\x00\x04\x30";
use constant DER_header_sha512 => "\x30\x51\x30\x0d\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x03\x05\x00\x04\x40";
#----------------------------------------------------------------------
#RFC 3447, section 9.2
sub encode {
my ($digest, $digest_oid, $emLen) = @_;
#print "encoding: [$digest_oid]\n";
my $encoded = _asn1_DigestInfo( $digest, $digest_oid );
if ( $emLen < length($encoded) + 11 ) {
die Crypt::Perl::X::create('Generic', sprintf "intended encoded message length (%d bytes) is too short--must be at least %d bytes", $emLen, 11 + length $encoded);
}
#NB: The length of $encoded will be a function solely of $digest_oid.
my $PS = "\x{ff}" x ($emLen - length($encoded) - 3);
return "\0\1$PS\0$encoded";
}
#Assume that we already validated the length.
sub decode {
my ($octets, $digest_oid) = @_;
#printf "$digest_oid - %v02x\n", $octets;
my $hdr = _get_der_header($digest_oid);
$octets =~ m<\A \x00 \x01 \xff+ \x00 \Q$hdr\E >x or do {
my $err = sprintf "Invalid EMSA-PKCS1-v1_5/$digest_oid: %v02x", $octets;
die Crypt::Perl::X::create('Generic', $err);
};
return substr( $octets, $+[0] );
}
sub _get_der_header {
my ($oid) = @_;
return __PACKAGE__->can("DER_header_$oid")->();
}
sub _asn1_DigestInfo {
my ($digest, $oid) = @_;
return _get_der_header($oid) . $digest;
}
#sub _asn1_DigestInfo {
# my ($digest, $algorithm_oid) = @_;
#
# #We shouldn’t need Convert::ASN1 for this.
# my $asn1 = Crypt::Sign::RSA::Convert_ASN1->new();
# $asn1->prepare_or_die(
# q<
# AlgorithmIdentifier ::= SEQUENCE {
# algorithm OBJECT IDENTIFIER,
# parameters NULL
# }
#
# DigestInfo ::= SEQUENCE {
# alg AlgorithmIdentifier,
# digest OCTET STRING
# }
# >,
# );
#
# my $parser = $asn1->find_or_die('DigestInfo');
#
# return $parser->encode_or_die(
# digest => $digest,
#
# #RFC 3447 says to use “sha256WithRSAEncryption”, but
# #OpenSSL’s RSA_sign() uses just “sha256”. (??)
# alg => { algorithm => $algorithm_oid, parameters => 1 },
# );
#}
1;
| 25.865772 | 170 | 0.593409 |
ed645a363fe39ba6247d2d665edb0de7cef8f481 | 29,888 | pm | Perl | lib/Mojolicious.pm | schelcj/mojo | 7ef46d78d29fbe37bc951810f0daec3be99e916e | [
"Artistic-2.0"
] | null | null | null | lib/Mojolicious.pm | schelcj/mojo | 7ef46d78d29fbe37bc951810f0daec3be99e916e | [
"Artistic-2.0"
] | null | null | null | lib/Mojolicious.pm | schelcj/mojo | 7ef46d78d29fbe37bc951810f0daec3be99e916e | [
"Artistic-2.0"
] | null | null | null | package Mojolicious;
use Mojo::Base -base;
# "Fry: Shut up and take my money!"
use Carp ();
use Mojo::DynamicMethods -dispatch;
use Mojo::Exception;
use Mojo::Home;
use Mojo::Loader;
use Mojo::Log;
use Mojo::Util;
use Mojo::UserAgent;
use Mojolicious::Commands;
use Mojolicious::Controller;
use Mojolicious::Plugins;
use Mojolicious::Renderer;
use Mojolicious::Routes;
use Mojolicious::Sessions;
use Mojolicious::Static;
use Mojolicious::Types;
use Mojolicious::Validator;
use Scalar::Util ();
has commands => sub { Mojolicious::Commands->new(app => shift) };
has controller_class => 'Mojolicious::Controller';
has home => sub { Mojo::Home->new->detect(ref shift) };
has log => sub {
my $self = shift;
my $mode = $self->mode;
my $log = Mojo::Log->new;
# DEPRECATED!
my $home = $self->home;
if (-d $home->child('log') && -w _) {
$log->path($home->child('log', "$mode.log"));
Mojo::Util::deprecated(qq{Logging to "log/$mode.log" is DEPRECATED});
}
# Reduced log output outside of development mode
return $log->level($ENV{MOJO_LOG_LEVEL}) if $ENV{MOJO_LOG_LEVEL};
return $mode eq 'development' ? $log : $log->level('info');
};
has 'max_request_size';
has mode => sub { $ENV{MOJO_MODE} || $ENV{PLACK_ENV} || 'development' };
has moniker => sub { Mojo::Util::decamelize ref shift };
has plugins => sub { Mojolicious::Plugins->new };
has preload_namespaces => sub { [] };
has renderer => sub { Mojolicious::Renderer->new };
has routes => sub { Mojolicious::Routes->new };
has secrets => sub {
my $self = shift;
# Warn developers about insecure default
$self->log->debug('Your secret passphrase needs to be changed');
# Default to moniker
return [$self->moniker];
};
has sessions => sub { Mojolicious::Sessions->new };
has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };
has ua => sub { Mojo::UserAgent->new };
has validator => sub { Mojolicious::Validator->new };
our $CODENAME = 'Supervillain';
our $VERSION = '8.70';
sub BUILD_DYNAMIC {
my ($class, $method, $dyn_methods) = @_;
return sub {
my $self = shift;
my $dynamic = $dyn_methods->{$self->renderer}{$method};
return $self->build_controller->$dynamic(@_) if $dynamic;
my $package = ref $self;
Carp::croak qq{Can't locate object method "$method" via package "$package"};
};
}
sub build_controller {
my ($self, $tx) = @_;
# Embedded application
my $stash = {};
if ($tx && (my $sub = $tx->can('stash'))) { ($stash, $tx) = ($tx->$sub, $tx->tx) }
# Build default controller
my $defaults = $self->defaults;
@$stash{keys %$defaults} = values %$defaults;
my $c = $self->controller_class->new(app => $self, stash => $stash, tx => $tx);
$c->{tx} ||= $self->build_tx;
return $c;
}
sub build_tx {
my $self = shift;
my $tx = Mojo::Transaction::HTTP->new;
my $max = $self->max_request_size;
$tx->req->max_message_size($max) if defined $max;
$self->plugins->emit_hook(after_build_tx => $tx, $self);
return $tx;
}
sub config { Mojo::Util::_stash(config => @_) }
sub defaults { Mojo::Util::_stash(defaults => @_) }
sub dispatch {
my ($self, $c) = @_;
my $plugins = $self->plugins->emit_hook(before_dispatch => $c);
# Try to find a static file
my $tx = $c->tx;
$self->static->dispatch($c) and $plugins->emit_hook(after_static => $c) unless $tx->res->code;
# Start timer (ignore static files)
my $stash = $c->stash;
$c->helpers->log->debug(sub {
my $req = $c->req;
my $method = $req->method;
my $path = $req->url->path->to_abs_string;
$c->helpers->timing->begin('mojo.timer');
return qq{$method "$path"};
}) unless $stash->{'mojo.static'};
# Routes
$plugins->emit_hook(before_routes => $c);
$c->helpers->reply->not_found
unless $tx->res->code || $self->routes->dispatch($c) || $tx->res->code || $c->stash->{'mojo.rendered'};
}
sub handler {
my $self = shift;
# Dispatcher has to be last in the chain
++$self->{dispatch}
and $self->hook(around_action => \&_action)
and $self->hook(around_dispatch => sub { $_[1]->app->dispatch($_[1]) })
unless $self->{dispatch};
# Process with chain
my $c = $self->build_controller(@_);
$self->plugins->emit_chain(around_dispatch => $c);
# Delayed response
$c->helpers->log->debug('Nothing has been rendered, expecting delayed response') unless $c->stash->{'mojo.rendered'};
}
sub helper { shift->renderer->add_helper(@_) }
sub hook { shift->plugins->on(@_) }
sub new {
my $self = shift->SUPER::new(@_);
my $home = $self->home;
push @{$self->renderer->paths}, $home->child('templates')->to_string;
push @{$self->static->paths}, $home->child('public')->to_string;
# Default to controller and application namespace
my $controller = "@{[ref $self]}::Controller";
my $r = $self->preload_namespaces([$controller])->routes->namespaces([$controller, ref $self]);
# Hide controller attributes/methods
$r->hide(qw(app continue cookie every_cookie every_param every_signed_cookie finish helpers match on param render));
$r->hide(qw(render_later render_maybe render_to_string rendered req res send session signed_cookie stash tx url_for));
$r->hide(qw(write write_chunk));
$self->plugin($_) for qw(HeaderCondition DefaultHelpers TagHelpers EPLRenderer EPRenderer);
# Exception handling should be first in chain
$self->hook(around_dispatch => \&_exception);
$self->startup;
$self->warmup;
return $self;
}
sub plugin {
my $self = shift;
$self->plugins->register_plugin(shift, $self, @_);
}
sub server { $_[0]->plugins->emit_hook(before_server_start => @_[1, 0]) }
sub start {
my $self = shift;
$_->warmup for $self->static, $self->renderer;
return $self->commands->run(@_ ? @_ : @ARGV);
}
sub startup { }
sub warmup { Mojo::Loader::load_classes $_ for @{shift->preload_namespaces} }
sub _action {
my ($next, $c, $action, $last) = @_;
my $val = $action->($c);
$val->catch(sub { $c->helpers->reply->exception(shift) }) if Scalar::Util::blessed $val && $val->isa('Mojo::Promise');
return $val;
}
sub _die { CORE::die ref $_[0] ? $_[0] : Mojo::Exception->new(shift)->trace }
sub _exception {
my ($next, $c) = @_;
local $SIG{__DIE__} = \&_die;
$c->helpers->reply->exception($@) unless eval { $next->(); 1 };
}
1;
=encoding utf8
=head1 NAME
Mojolicious - Real-time web framework
=head1 SYNOPSIS
# Application
package MyApp;
use Mojo::Base 'Mojolicious', -signatures;
# Route
sub startup ($self) {
$self->routes->get('/hello')->to('foo#hello');
}
# Controller
package MyApp::Controller::Foo;
use Mojo::Base 'Mojolicious::Controller', -signatures;
# Action
sub hello ($self) {
$self->render(text => 'Hello World!');
}
=head1 DESCRIPTION
An amazing real-time web framework built on top of the powerful L<Mojo> web development toolkit. With support for
RESTful routes, plugins, commands, Perl-ish templates, content negotiation, session management, form validation,
testing framework, static file server, C<CGI>/C<PSGI> detection, first class Unicode support and much more for you to
discover.
Take a look at our excellent documentation in L<Mojolicious::Guides>!
=head1 HOOKS
L<Mojolicious> will emit the following hooks in the listed order.
=head2 before_command
Emitted right before the application runs a command through the command line interface. Note that this hook is
B<EXPERIMENTAL> and might change without warning!
$app->hook(before_command => sub ($command, $args) {...});
Useful for reconfiguring the application before running a command or to modify the behavior of a command. (Passed the
command object and the command arguments)
=head2 before_server_start
Emitted right before the application server is started, for web servers that support it, which includes all the
built-in ones (except for L<Mojo::Server::CGI>).
$app->hook(before_server_start => sub ($server, $app) {...});
Useful for reconfiguring application servers dynamically or collecting server diagnostics information. (Passed the
server and application objects)
=head2 after_build_tx
Emitted right after the transaction is built and before the HTTP request gets parsed.
$app->hook(after_build_tx => sub ($tx, $app) {...});
This is a very powerful hook and should not be used lightly, it makes some rather advanced features such as upload
progress bars possible. Note that this hook will not work for embedded applications, because only the host application
gets to build transactions. (Passed the transaction and application objects)
=head2 around_dispatch
Emitted right after a new request has been received and wraps around the whole dispatch process, so you have to
manually forward to the next hook if you want to continue the chain. Default exception handling with
L<Mojolicious::Plugin::DefaultHelpers/"reply-E<gt>exception"> is the first hook in the chain and a call to
L</"dispatch"> the last, yours will be in between.
$app->hook(around_dispatch => sub ($next, $c) {
...
$next->();
...
});
This is a very powerful hook and should not be used lightly, it allows you to, for example, customize application-wide
exception handling, consider it the sledgehammer in your toolbox. (Passed a callback leading to the next hook and the
default controller object)
=head2 before_dispatch
Emitted right before the static file server and router start their work.
$app->hook(before_dispatch => sub ($c) {...});
Very useful for rewriting incoming requests and other preprocessing tasks. (Passed the default controller object)
=head2 after_static
Emitted after a static file response has been generated by the static file server.
$app->hook(after_static => sub ($c) {...});
Mostly used for post-processing static file responses. (Passed the default controller object)
=head2 before_routes
Emitted after the static file server determined if a static file should be served and before the router starts its
work.
$app->hook(before_routes => sub ($c) {...});
Mostly used for custom dispatchers and collecting metrics. (Passed the default controller object)
=head2 around_action
Emitted right before an action gets executed and wraps around it, so you have to manually forward to the next hook if
you want to continue the chain. Default action dispatching is the last hook in the chain, yours will run before it.
$app->hook(around_action => sub ($next, $c, $action, $last) {
...
return $next->();
});
This is a very powerful hook and should not be used lightly, it allows you for example to pass additional arguments to
actions or handle return values differently. Note that this hook can trigger more than once for the same request if
there are nested routes. (Passed a callback leading to the next hook, the current controller object, the action
callback and a flag indicating if this action is an endpoint)
=head2 before_render
Emitted before content is generated by the renderer. Note that this hook can trigger out of order due to its dynamic
nature, and with embedded applications will only work for the application that is rendering.
$app->hook(before_render => sub ($c, $args) {...});
Mostly used for pre-processing arguments passed to the renderer. (Passed the current controller object and the render
arguments)
=head2 after_render
Emitted after content has been generated by the renderer that will be assigned to the response. Note that this hook can
trigger out of order due to its dynamic nature, and with embedded applications will only work for the application that
is rendering.
$app->hook(after_render => sub ($c, $output, $format) {...});
Mostly used for post-processing dynamically generated content. (Passed the current controller object, a reference to
the content and the format)
=head2 after_dispatch
Emitted in reverse order after a response has been generated. Note that this hook can trigger out of order due to its
dynamic nature, and with embedded applications will only work for the application that is generating the response.
$app->hook(after_dispatch => sub ($c) {...});
Useful for rewriting outgoing responses and other post-processing tasks. (Passed the current controller object)
=head1 ATTRIBUTES
L<Mojolicious> implements the following attributes.
=head2 commands
my $commands = $app->commands;
$app = $app->commands(Mojolicious::Commands->new);
Command line interface for your application, defaults to a L<Mojolicious::Commands> object.
# Add another namespace to load commands from
push @{$app->commands->namespaces}, 'MyApp::Command';
=head2 controller_class
my $class = $app->controller_class;
$app = $app->controller_class('Mojolicious::Controller');
Class to be used for the default controller, defaults to L<Mojolicious::Controller>. Note that this class needs to have
already been loaded before the first request arrives.
=head2 home
my $home = $app->home;
$app = $app->home(Mojo::Home->new);
The home directory of your application, defaults to a L<Mojo::Home> object which stringifies to the actual path.
# Portably generate path relative to home directory
my $path = $app->home->child('data', 'important.txt');
=head2 log
my $log = $app->log;
$app = $app->log(Mojo::Log->new);
The logging layer of your application, defaults to a L<Mojo::Log> object. The level will default to either the
C<MOJO_LOG_LEVEL> environment variable, C<debug> if the L</mode> is C<development>, or C<info> otherwise. All messages
will be written to C<STDERR> by default.
# Log debug message
$app->log->debug('It works');
=head2 max_request_size
my $max = $app->max_request_size;
$app = $app->max_request_size(16777216);
Maximum request size in bytes, defaults to the value of L<Mojo::Message/"max_message_size">. Setting the value to C<0>
will allow requests of indefinite size. Note that increasing this value can also drastically increase memory usage,
should you for example attempt to parse an excessively large request body with the methods L<Mojo::Message/"dom"> or
L<Mojo::Message/"json">.
=head2 mode
my $mode = $app->mode;
$app = $app->mode('production');
The operating mode for your application, defaults to a value from the C<MOJO_MODE> and C<PLACK_ENV> environment
variables or C<development>.
=head2 moniker
my $moniker = $app->moniker;
$app = $app->moniker('foo_bar');
Moniker of this application, often used as default filename for configuration files and the like, defaults to
decamelizing the application class with L<Mojo::Util/"decamelize">.
=head2 plugins
my $plugins = $app->plugins;
$app = $app->plugins(Mojolicious::Plugins->new);
The plugin manager, defaults to a L<Mojolicious::Plugins> object. See the L</"plugin"> method below if you want to load
a plugin.
# Add another namespace to load plugins from
push @{$app->plugins->namespaces}, 'MyApp::Plugin';
=head2 preload_namespaces
my $namespaces = $app->preload_namespaces;
$app = $app->preload_namespaces(['MyApp:Controller']);
Namespaces to preload classes from during application startup. Note that this attribute is B<EXPERIMENTAL> and might
change without warning!
=head2 renderer
my $renderer = $app->renderer;
$app = $app->renderer(Mojolicious::Renderer->new);
Used to render content, defaults to a L<Mojolicious::Renderer> object. For more information about how to generate
content see L<Mojolicious::Guides::Rendering>.
# Enable compression
$app->renderer->compress(1);
# Add another "templates" directory
push @{$app->renderer->paths}, '/home/sri/templates';
# Add another "templates" directory with higher precedence
unshift @{$app->renderer->paths}, '/home/sri/themes/blue/templates';
# Add another class with templates in DATA section
push @{$app->renderer->classes}, 'Mojolicious::Plugin::Fun';
=head2 routes
my $routes = $app->routes;
$app = $app->routes(Mojolicious::Routes->new);
The router, defaults to a L<Mojolicious::Routes> object. You use this in your startup method to define the url
endpoints for your application.
# Add routes
my $r = $app->routes;
$r->get('/foo/bar')->to('test#foo', title => 'Hello Mojo!');
$r->post('/baz')->to('test#baz');
# Add another namespace to load controllers from
push @{$app->routes->namespaces}, 'MyApp::MyController';
=head2 secrets
my $secrets = $app->secrets;
$app = $app->secrets([$bytes]);
Secret passphrases used for signed cookies and the like, defaults to the L</"moniker"> of this application, which is
not very secure, so you should change it!!! As long as you are using the insecure default there will be debug messages
in the log file reminding you to change your passphrase. Only the first passphrase is used to create new signatures,
but all of them for verification. So you can increase security without invalidating all your existing signed cookies by
rotating passphrases, just add new ones to the front and remove old ones from the back.
# Rotate passphrases
$app->secrets(['new_passw0rd', 'old_passw0rd', 'very_old_passw0rd']);
=head2 sessions
my $sessions = $app->sessions;
$app = $app->sessions(Mojolicious::Sessions->new);
Signed cookie based session manager, defaults to a L<Mojolicious::Sessions> object. You can usually leave this alone,
see L<Mojolicious::Controller/"session"> for more information about working with session data.
# Change name of cookie used for all sessions
$app->sessions->cookie_name('mysession');
# Disable SameSite feature
$app->sessions->samesite(undef);
=head2 static
my $static = $app->static;
$app = $app->static(Mojolicious::Static->new);
For serving static files from your C<public> directories, defaults to a L<Mojolicious::Static> object.
# Add another "public" directory
push @{$app->static->paths}, '/home/sri/public';
# Add another "public" directory with higher precedence
unshift @{$app->static->paths}, '/home/sri/themes/blue/public';
# Add another class with static files in DATA section
push @{$app->static->classes}, 'Mojolicious::Plugin::Fun';
# Remove built-in favicon
delete $app->static->extra->{'favicon.ico'};
=head2 types
my $types = $app->types;
$app = $app->types(Mojolicious::Types->new);
Responsible for connecting file extensions with MIME types, defaults to a L<Mojolicious::Types> object.
# Add custom MIME type
$app->types->type(twt => 'text/tweet');
=head2 ua
my $ua = $app->ua;
$app = $app->ua(Mojo::UserAgent->new);
A full featured HTTP user agent for use in your applications, defaults to a L<Mojo::UserAgent> object.
# Perform blocking request
say $app->ua->get('example.com')->result->body;
=head2 validator
my $validator = $app->validator;
$app = $app->validator(Mojolicious::Validator->new);
Validate values, defaults to a L<Mojolicious::Validator> object.
# Add validation check
$app->validator->add_check(foo => sub ($v, $name, $value) {
return $value ne 'foo';
});
# Add validation filter
$app->validator->add_filter(quotemeta => sub ($v, $name, $value) {
return quotemeta $value;
});
=head1 METHODS
L<Mojolicious> inherits all methods from L<Mojo::Base> and implements the following new ones.
=head2 build_controller
my $c = $app->build_controller;
my $c = $app->build_controller(Mojo::Transaction::HTTP->new);
my $c = $app->build_controller(Mojolicious::Controller->new);
Build default controller object with L</"controller_class">.
# Render template from application
my $foo = $app->build_controller->render_to_string(template => 'foo');
=head2 build_tx
my $tx = $app->build_tx;
Build L<Mojo::Transaction::HTTP> object and emit L</"after_build_tx"> hook.
=head2 config
my $hash = $app->config;
my $foo = $app->config('foo');
$app = $app->config({foo => 'bar', baz => 23});
$app = $app->config(foo => 'bar', baz => 23);
Application configuration.
# Remove value
my $foo = delete $app->config->{foo};
# Assign multiple values at once
$app->config(foo => 'test', bar => 23);
=head2 defaults
my $hash = $app->defaults;
my $foo = $app->defaults('foo');
$app = $app->defaults({foo => 'bar', baz => 23});
$app = $app->defaults(foo => 'bar', baz => 23);
Default values for L<Mojolicious::Controller/"stash">, assigned for every new request.
# Remove value
my $foo = delete $app->defaults->{foo};
# Assign multiple values at once
$app->defaults(foo => 'test', bar => 23);
=head2 dispatch
$app->dispatch(Mojolicious::Controller->new);
The heart of every L<Mojolicious> application, calls the L</"static"> and L</"routes"> dispatchers for every request
and passes them a L<Mojolicious::Controller> object.
=head2 handler
$app->handler(Mojo::Transaction::HTTP->new);
$app->handler(Mojolicious::Controller->new);
Sets up the default controller and emits the L</"around_dispatch"> hook for every request.
=head2 helper
$app->helper(foo => sub {...});
Add or replace a helper that will be available as a method of the controller object and the application object, as well
as a function in C<ep> templates. For a full list of helpers that are available by default see
L<Mojolicious::Plugin::DefaultHelpers> and L<Mojolicious::Plugin::TagHelpers>.
# Helper
$app->helper(cache => sub { state $cache = {} });
# Application
$app->cache->{foo} = 'bar';
my $result = $app->cache->{foo};
# Controller
$c->cache->{foo} = 'bar';
my $result = $c->cache->{foo};
# Template
% cache->{foo} = 'bar';
%= cache->{foo}
=head2 hook
$app->hook(after_dispatch => sub {...});
Extend L<Mojolicious> with hooks, which allow code to be shared with all requests indiscriminately, for a full list of
available hooks see L</"HOOKS">.
# Dispatchers will not run if there's already a response code defined
$app->hook(before_dispatch => sub ($c) {
$c->render(text => 'Skipped static file server and router!')
if $c->req->url->path->to_route =~ /do_not_dispatch/;
});
=head2 new
my $app = Mojolicious->new;
my $app = Mojolicious->new(moniker => 'foo_bar');
my $app = Mojolicious->new({moniker => 'foo_bar'});
Construct a new L<Mojolicious> application and call L</"startup">. Will automatically detect your home directory. Also
sets up the renderer, static file server, a default set of plugins and an L</"around_dispatch"> hook with the default
exception handling.
=head2 plugin
$app->plugin('some_thing');
$app->plugin('some_thing', foo => 23);
$app->plugin('some_thing', {foo => 23});
$app->plugin('SomeThing');
$app->plugin('SomeThing', foo => 23);
$app->plugin('SomeThing', {foo => 23});
$app->plugin('MyApp::Plugin::SomeThing');
$app->plugin('MyApp::Plugin::SomeThing', foo => 23);
$app->plugin('MyApp::Plugin::SomeThing', {foo => 23});
Load a plugin, for a full list of example plugins included in the L<Mojolicious> distribution see
L<Mojolicious::Plugins/"PLUGINS">.
=head2 server
$app->server(Mojo::Server->new);
Emits the L</"before_server_start"> hook.
=head2 start
$app->start;
$app->start(@ARGV);
Start the command line interface for your application. For a full list of commands that are available by default see
L<Mojolicious::Commands/"COMMANDS">. Note that the options C<-h>/C<--help>, C<--home> and C<-m>/C<--mode>, which are
shared by all commands, will be parsed from C<@ARGV> during compile time.
# Always start daemon
$app->start('daemon', '-l', 'http://*:8080');
=head2 startup
$app->startup;
This is your main hook into the application, it will be called at application startup. Meant to be overloaded in a
subclass.
sub startup ($self) {...}
=head2 warmup
$app->warmup;
Preload classes from L</"preload_namespaces"> for future use. Note that this method is B<EXPERIMENTAL> and might change
without warning!
=head1 HELPERS
In addition to the L</"ATTRIBUTES"> and L</"METHODS"> above you can also call helpers on L<Mojolicious> objects. This
includes all helpers from L<Mojolicious::Plugin::DefaultHelpers> and L<Mojolicious::Plugin::TagHelpers>. Note that
application helpers are always called with a new default controller object, so they can't depend on or change
controller state, which includes request, response and stash.
# Call helper
say $app->dumper({foo => 'bar'});
# Longer version
say $app->build_controller->helpers->dumper({foo => 'bar'});
=head1 BUNDLED FILES
The L<Mojolicious> distribution includes a few files with different licenses that have been bundled for internal use.
=head2 Mojolicious Artwork
Copyright (C) 2010-2020, Sebastian Riedel.
Licensed under the CC-SA License, Version 4.0 L<http://creativecommons.org/licenses/by-sa/4.0>.
=head2 jQuery
Copyright (C) jQuery Foundation.
Licensed under the MIT License, L<http://creativecommons.org/licenses/MIT>.
=head2 highlight.js
Copyright (C) 2006, Ivan Sagalaev.
Licensed under the BSD License, L<https://github.com/highlightjs/highlight.js/blob/master/LICENSE>.
=head2 Bootstrap
Copyright 2011-2020 The Bootstrap Authors.
Copyright 2011-2020 Twitter, Inc.
Licensed under the MIT License, L<http://creativecommons.org/licenses/MIT>.
=head2 Font Awesome
Licensed under the CC-BY License, Version 4.0 L<https://creativecommons.org/licenses/by/4.0/> and SIL OFL, Version 1.1
L<https://opensource.org/licenses/OFL-1.1>.
=head1 CODE NAMES
Every major release of L<Mojolicious> has a code name, these are the ones that have been used in the past.
8.0, C<Supervillain> (U+1F9B9)
7.0, C<Doughnut> (U+1F369)
6.0, C<Clinking Beer Mugs> (U+1F37B)
5.0, C<Tiger Face> (U+1F42F)
4.0, C<Top Hat> (U+1F3A9)
3.0, C<Rainbow> (U+1F308)
2.0, C<Leaf Fluttering In Wind> (U+1F343)
1.0, C<Snowflake> (U+2744)
=head1 SPONSORS
=over 2
=item
L<Stix|https://stix.no> sponsored the creation of the Mojolicious logo (designed by Nicolai Graesdal) and transferred
its copyright to Sebastian Riedel.
=item
Some of the work on this distribution has been sponsored by L<The Perl Foundation|https://www.perlfoundation.org>.
=back
=head1 AUTHORS
L<Mojolicious> is an open source project that relies on the tireless support of its contributors.
=head2 Project Founder
Sebastian Riedel, C<[email protected]>
=head2 Core Developers
Current voting members of the core team in alphabetical order:
=over 2
Christopher Rasch-Olsen Raa, C<[email protected]>
Dan Book, C<[email protected]>
Jan Henning Thorsen, C<[email protected]>
Joel Berger, C<[email protected]>
Marcus Ramberg, C<[email protected]>
=back
The following members of the core team are currently on hiatus:
=over 2
Abhijit Menon-Sen, C<[email protected]>
CandyAngel, C<[email protected]>
Glen Hinkle, C<[email protected]>
=back
=head2 Contributors
In alphabetical order:
=over 2
Adam Kennedy
Adriano Ferreira
Al Newkirk
Alex Efros
Alex Salimon
Alexander Karelas
Alexey Likhatskiy
Anatoly Sharifulin
Andre Parker
Andre Vieth
Andreas Guldstrand
Andreas Jaekel
Andreas Koenig
Andrew Fresh
Andrew Nugged
Andrey Khozov
Andrey Kuzmin
Andy Grundman
Aristotle Pagaltzis
Ashley Dev
Ask Bjoern Hansen
Audrey Tang
Ben Tyler
Ben van Staveren
Benjamin Erhart
Bernhard Graf
Breno G. de Oliveira
Brian Duggan
Brian Medley
Burak Gursoy
Ch Lamprecht
Charlie Brady
Chas. J. Owens IV
Chase Whitener
Christian Hansen
chromatic
Curt Tilmes
Daniel Kimsey
Daniel Mantovani
Danijel Tasov
Dagfinn Ilmari Manns�ker
Danny Thomas
David Davis
David Webb
Diego Kuperman
Dmitriy Shalashov
Dmitry Konstantinov
Dominik Jarmulowicz
Dominique Dumont
Dotan Dimet
Douglas Christopher Wilson
Elmar S. Heeb
Ettore Di Giacinto
Eugen Konkov
Eugene Toropov
Flavio Poletti
Gisle Aas
Graham Barr
Graham Knop
Henry Tang
Hideki Yamamura
Hiroki Toyokawa
Ian Goodacre
Ilya Chesnokov
Ilya Rassadin
James Duncan
Jan Jona Javorsek
Jan Schmidt
Jaroslav Muhin
Jesse Vincent
Johannes Plunien
John Kingsley
Jonathan Yu
Josh Leder
Kamen Naydenov
Karen Etheridge
Kazuhiro Shibuya
Kevin Old
Kitamura Akatsuki
Klaus S. Madsen
Knut Arne Bjorndal
Lars Balker Rasmussen
Lee Johnson
Leon Brocard
Magnus Holm
Maik Fischer
Mark Fowler
Mark Grimes
Mark Stosberg
Martin McGrath
Marty Tennison
Matt S Trout
Matthew Lineen
Maksym Komar
Maxim Vuets
Michael Gregorowicz
Michael Harris
Michael Jemmeson
Mike Magowan
Mirko Westermeier
Mons Anderson
Moritz Lenz
Neil Watkiss
Nic Sandfield
Nils Diewald
Oleg Zhelo
Olivier Mengue
Pascal Gaudette
Paul Evans
Paul Robins
Paul Tomlin
Pavel Shaydo
Pedro Melo
Peter Edwards
Pierre-Yves Ritschard
Piotr Roszatycki
Quentin Carbonneaux
Rafal Pocztarski
Randal Schwartz
Richard Elberger
Rick Delaney
Robert Hicks
Robert Rothenberg
Robin Lee
Roland Lammel
Roy Storey
Ryan Jendoubi
Salvador Fandino
Santiago Zarate
Sascha Kiefer
Scott Wiersdorf
Sebastian Paaske Torholm
Sergey Zasenko
Simon Bertrang
Simone Tampieri
Shoichi Kaji
Shu Cho
Skye Shaw
Stanis Trendelenburg
Stefan Adams
Steffen Ullrich
Stephan Kulow
Stephane Este-Gracias
Stevan Little
Steve Atkins
Tatsuhiko Miyagawa
Terrence Brannon
Tianon Gravi
Tomas Znamenacek
Tudor Constantin
Ulrich Habel
Ulrich Kautz
Uwe Voelker
Veesh Goldman
Viacheslav Tykhanovskyi
Victor Engmark
Viliam Pucik
Wes Cravens
William Lindley
Yaroslav Korshak
Yuki Kimoto
Zak B. Elep
Zoffix Znet
=back
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2008-2020, Sebastian Riedel and others.
This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version
2.0.
=head1 SEE ALSO
L<https://github.com/mojolicious/mojo>, L<Mojolicious::Guides>, L<https://mojolicious.org>.
=cut
| 24.721257 | 120 | 0.712259 |
ed9e8c7a83e072009018d4c5a2e862a6ab20fa1b | 3,222 | t | Perl | t/analysis_gatk_haplotypecaller_panel.t | Clinical-Genomics/MIP | db2e89fec2674f5c12dbf6ec89eba181433fc742 | [
"MIT"
] | 22 | 2017-09-04T07:50:54.000Z | 2022-01-01T20:41:45.000Z | t/analysis_gatk_haplotypecaller_panel.t | Clinical-Genomics/MIP | db2e89fec2674f5c12dbf6ec89eba181433fc742 | [
"MIT"
] | 834 | 2017-09-05T07:18:38.000Z | 2022-03-31T15:27:49.000Z | t/analysis_gatk_haplotypecaller_panel.t | Clinical-Genomics/MIP | db2e89fec2674f5c12dbf6ec89eba181433fc742 | [
"MIT"
] | 11 | 2017-09-12T10:53:30.000Z | 2021-11-30T01:40:49.000Z | #!/usr/bin/env perl
use 5.026;
use Carp;
use charnames qw{ :full :short };
use English qw{ -no_match_vars };
use File::Basename qw{ dirname };
use File::Spec::Functions qw{ catdir catfile };
use FindBin qw{ $Bin };
use open qw{ :encoding(UTF-8) :std };
use Params::Check qw{ allow check last_error };
use Test::More;
use utf8;
use warnings qw{ FATAL utf8 };
## CPANM
use autodie qw { :all };
use Modern::Perl qw{ 2018 };
use Test::Trap;
## MIPs lib/
use lib catdir( dirname($Bin), q{lib} );
use MIP::Constants qw{ $COLON $COMMA $SPACE };
use MIP::Test::Fixtures qw{ test_add_io_for_recipe test_log test_mip_hashes };
BEGIN {
use MIP::Test::Fixtures qw{ test_import };
### Check all internal dependency modules and imports
## Modules with import
my %perl_module = (
q{MIP::Recipes::Analysis::Gatk_haplotypecaller} =>
[qw{ analysis_gatk_haplotypecaller_panel }],
q{MIP::Test::Fixtures} => [qw{ test_add_io_for_recipe test_log test_mip_hashes }],
);
test_import( { perl_module_href => \%perl_module, } );
}
use MIP::Recipes::Analysis::Gatk_haplotypecaller
qw{ analysis_gatk_haplotypecaller_panel };
diag( q{Test analysis_gatk_haplotypecaller_panel from Gatk_haplotypecaller.pm}
. $COMMA
. $SPACE . q{Perl}
. $SPACE
. $PERL_VERSION
. $SPACE
. $EXECUTABLE_NAME );
my $log = test_log( { log_name => q{MIP}, no_screen => 1, } );
## Given analysis parameters
my $recipe_name = q{gatk_haplotypecaller};
my $slurm_mock_cmd = catfile( $Bin, qw{ data modules slurm-mock.pl } );
my %active_parameter = test_mip_hashes(
{
mip_hash_name => q{active_parameter},
recipe_name => $recipe_name,
}
);
$active_parameter{$recipe_name} = 1;
$active_parameter{recipe_core_number}{$recipe_name} = 1;
$active_parameter{recipe_time}{$recipe_name} = 1;
my $sample_id = $active_parameter{sample_ids}[0];
$active_parameter{gatk_haplotypecaller_emit_ref_confidence} = q{GVCF};
my %file_info = test_mip_hashes(
{
mip_hash_name => q{file_info},
recipe_name => $recipe_name,
}
);
my %job_id;
my %parameter = test_mip_hashes(
{
mip_hash_name => q{recipe_parameter},
recipe_name => $recipe_name,
}
);
test_add_io_for_recipe(
{
file_info_href => \%file_info,
id => $sample_id,
outfile_suffix => q{.vcf},
parameter_href => \%parameter,
recipe_name => $recipe_name,
step => q{bam},
}
);
my %sample_info = test_mip_hashes(
{
mip_hash_name => q{qc_sample_info},
recipe_name => $recipe_name,
}
);
my $is_ok = analysis_gatk_haplotypecaller_panel(
{
active_parameter_href => \%active_parameter,
file_info_href => \%file_info,
job_id_href => \%job_id,
parameter_href => \%parameter,
profile_base_command => $slurm_mock_cmd,
recipe_name => $recipe_name,
sample_id => $sample_id,
sample_info_href => \%sample_info,
}
);
## Then return TRUE
ok( $is_ok, q{ Executed analysis recipe } . $recipe_name );
done_testing();
| 27.07563 | 90 | 0.628802 |
ed3ffde72b4321c08b4dd0f33c3bf8749d798364 | 2,987 | pm | Perl | auto-lib/Paws/KinesisAnalyticsV2/ListApplicationVersions.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 164 | 2015-01-08T14:58:53.000Z | 2022-02-20T19:16:24.000Z | auto-lib/Paws/KinesisAnalyticsV2/ListApplicationVersions.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 348 | 2015-01-07T22:08:38.000Z | 2022-01-27T14:34:44.000Z | auto-lib/Paws/KinesisAnalyticsV2/ListApplicationVersions.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 87 | 2015-04-22T06:29:47.000Z | 2021-09-29T14:45:55.000Z |
package Paws::KinesisAnalyticsV2::ListApplicationVersions;
use Moose;
has ApplicationName => (is => 'ro', isa => 'Str', required => 1);
has Limit => (is => 'ro', isa => 'Int');
has NextToken => (is => 'ro', isa => 'Str');
use MooseX::ClassAttribute;
class_has _api_call => (isa => 'Str', is => 'ro', default => 'ListApplicationVersions');
class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::KinesisAnalyticsV2::ListApplicationVersionsResponse');
class_has _result_key => (isa => 'Str', is => 'ro');
1;
### main pod documentation begin ###
=head1 NAME
Paws::KinesisAnalyticsV2::ListApplicationVersions - Arguments for method ListApplicationVersions on L<Paws::KinesisAnalyticsV2>
=head1 DESCRIPTION
This class represents the parameters used for calling the method ListApplicationVersions on the
L<Amazon Kinesis Analytics|Paws::KinesisAnalyticsV2> service. Use the attributes of this class
as arguments to method ListApplicationVersions.
You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to ListApplicationVersions.
=head1 SYNOPSIS
my $kinesisanalytics = Paws->service('KinesisAnalyticsV2');
my $ListApplicationVersionsResponse =
$kinesisanalytics->ListApplicationVersions(
ApplicationName => 'MyApplicationName',
Limit => 1, # OPTIONAL
NextToken => 'MyNextToken', # OPTIONAL
);
# Results:
my $ApplicationVersionSummaries =
$ListApplicationVersionsResponse->ApplicationVersionSummaries;
my $NextToken = $ListApplicationVersionsResponse->NextToken;
# Returns a L<Paws::KinesisAnalyticsV2::ListApplicationVersionsResponse> object.
Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics/ListApplicationVersions>
=head1 ATTRIBUTES
=head2 B<REQUIRED> ApplicationName => Str
The name of the application for which you want to list all versions.
=head2 Limit => Int
The maximum number of versions to list in this invocation of the
operation.
=head2 NextToken => Str
If a previous invocation of this operation returned a pagination token,
pass it into this value to retrieve the next set of results. For more
information about pagination, see Using the AWS Command Line
Interface's Pagination Options
(https://docs.aws.amazon.com/cli/latest/userguide/pagination.html).
=head1 SEE ALSO
This class forms part of L<Paws>, documenting arguments for method ListApplicationVersions in L<Paws::KinesisAnalyticsV2>
=head1 BUGS and CONTRIBUTIONS
The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
=cut
| 33.943182 | 249 | 0.741212 |
ed7dbb50ef78ec35392c39898ade43a248505de2 | 6,362 | pm | Perl | lib/LANraragi/Model/Category.pm | winkxx/LANraragi_cn | 416f946fa1b6946a431002cd3109b8bc2cf112a1 | [
"MIT"
] | null | null | null | lib/LANraragi/Model/Category.pm | winkxx/LANraragi_cn | 416f946fa1b6946a431002cd3109b8bc2cf112a1 | [
"MIT"
] | null | null | null | lib/LANraragi/Model/Category.pm | winkxx/LANraragi_cn | 416f946fa1b6946a431002cd3109b8bc2cf112a1 | [
"MIT"
] | null | null | null | package LANraragi::Model::Category;
use strict;
use warnings;
use utf8;
use Redis;
use Encode;
use Mojo::JSON qw(decode_json encode_json);
use LANraragi::Utils::Database qw(redis_decode invalidate_cache);
use LANraragi::Utils::Logging qw(get_logger);
# get_category_list()
# Returns a list of all the category objects.
sub get_category_list {
my $redis = LANraragi::Model::Config->get_redis;
# Categories are represented by SET_[timestamp] in DB. Can't wait for 2038!
my @cats = $redis->keys('SET_??????????');
# Jam categories into an array of hashes
my @result;
foreach my $key (@cats) {
my %data = $redis->hgetall($key);
# redis-decode the name, and the search terms if they exist
( $_ = redis_decode($_) ) for ( $data{name}, $data{search} );
# Deserialize the archives list w. mojo::json
$data{archives} = decode_json( $data{archives} );
# Add the key as well
$data{id} = $key;
push( @result, \%data );
}
return @result;
}
# get_category(id)
# Returns the category matching the given id.
# Returns undef if the id doesn't exist.
sub get_category {
my $cat_id = $_[0];
my $logger = get_logger( "Categories", "lanraragi" );
my $redis = LANraragi::Model::Config->get_redis;
unless ( length($cat_id) == 14 && $redis->exists($cat_id) ) {
$logger->warn("$cat_id doesn't exist in the database!");
return ();
}
my %category = $redis->hgetall($cat_id);
$redis->quit;
return %category;
}
# create_category(name, favtag, pinned, existing_id)
# Create a Category.
# If the "favtag" argument is supplied, the category will be Dynamic.
# Otherwise, it'll be Static.
# If an existing category ID is supplied, said category will be updated with the given parameters.
# Returns the ID of the created/updated Category.
sub create_category {
my ( $name, $favtag, $pinned, $cat_id ) = @_;
my $redis = LANraragi::Model::Config->get_redis;
# Set all fields of the category object
unless ( length($cat_id) ) {
$cat_id = "SET_" . time();
my $isnewkey = 0;
until ($isnewkey) {
# Check if the category ID exists, move timestamp further if it does
if ( $redis->exists($cat_id) ) {
$cat_id = "SET_" . ( time() + 1 );
} else {
$isnewkey = 1;
}
}
# Default values for new category
$redis->hset( $cat_id, "archives", "[]" );
$redis->hset( $cat_id, "last_used", time() );
}
# Set/update name, pin status and favtag
$redis->hset( $cat_id, "name", encode_utf8($name) );
$redis->hset( $cat_id, "search", encode_utf8($favtag) );
$redis->hset( $cat_id, "pinned", $pinned );
$redis->quit;
return $cat_id;
}
# delete_category(id)
# Deletes the category with the given ID.
# Returns 0 if the given ID isn't a category ID, 1 otherwise
sub delete_category {
my $cat_id = $_[0];
my $logger = get_logger( "Categories", "lanraragi" );
my $redis = LANraragi::Model::Config->get_redis;
if ( length($cat_id) != 14 ) {
# Probably not a category ID
$logger->error("$cat_id is not a category ID, doing nothing.");
$redis->quit;
return 0;
}
if ( $redis->exists($cat_id) ) {
$redis->del($cat_id);
$redis->quit;
return 1;
} else {
$logger->warn("$cat_id doesn't exist in the database!");
$redis->quit;
return 1;
}
}
# add_to_category(categoryid, arcid)
# Adds the given archive ID to the given category.
# Only valid if the category is Static.
# Returns 1 on success, 0 on failure alongside an error message.
sub add_to_category {
my ( $cat_id, $arc_id ) = @_;
my $logger = get_logger( "Categories", "lanraragi" );
my $redis = LANraragi::Model::Config->get_redis;
my $err = "";
if ( $redis->exists($cat_id) ) {
unless ( $redis->hget( $cat_id, "search" ) eq "" ) {
$err = "$cat_id is a favorite search, can't add archives to it.";
$logger->error($err);
$redis->quit;
return ( 0, $err );
}
unless ( $redis->exists($arc_id) ) {
$err = "$arc_id does not exist in the database.";
$logger->error($err);
$redis->quit;
return ( 0, $err );
}
my @cat_archives = @{ decode_json( $redis->hget( $cat_id, "archives" ) ) };
if ( "@cat_archives" =~ m/$arc_id/ ) {
$logger->warn("$arc_id already present in category $cat_id, doing nothing.");
$redis->quit;
return ( 1, $err );
}
push @cat_archives, $arc_id;
$redis->hset( $cat_id, "archives", encode_json( \@cat_archives ) );
invalidate_cache();
$redis->quit;
return ( 1, $err );
}
$err = "$cat_id doesn't exist in the database!";
$logger->warn($err);
$redis->quit;
return ( 0, $err );
}
# remove_from_category(categoryid, arcid)
# Removes the given archive ID from the given category.
# Only valid if the category is an Archive Set.
# Returns 1 on success, 0 on failure alongside an error message.
sub remove_from_category {
my ( $cat_id, $arc_id ) = @_;
my $logger = get_logger( "Categories", "lanraragi" );
my $redis = LANraragi::Model::Config->get_redis;
my $err = "";
if ( $redis->exists($cat_id) ) {
unless ( $redis->hget( $cat_id, "search" ) eq "" ) {
$err = "$cat_id is a favorite search, it doesn't contain archives.";
$logger->error($err);
$redis->quit;
return ( 0, $err );
}
# Remove occurences of $cat_id in @cat_archives w. grep and array reassignment
my @cat_archives = @{ decode_json( $redis->hget( $cat_id, "archives" ) ) };
my $index = 0;
$index++ until $cat_archives[$index] eq $arc_id || $index == scalar @cat_archives;
splice( @cat_archives, $index, 1 );
$redis->hset( $cat_id, "archives", encode_json( \@cat_archives ) );
invalidate_cache();
$redis->quit;
return ( 1, $err );
}
$err = "$cat_id doesn't exist in the database!";
$logger->warn($err);
$redis->quit;
return 0;
}
1;
| 28.918182 | 100 | 0.576548 |
ed9c36ed855e7d6d1542d67a7d9abf0354d52b21 | 562 | t | Perl | pkgs/libs/imagick/src/PerlMagick/t/blob.t | cota/parsec2-aarch64 | cdf7da348afd231dbe067266f24dc14d22f5cebf | [
"BSD-3-Clause"
] | 1 | 2020-04-01T22:21:04.000Z | 2020-04-01T22:21:04.000Z | pkgs/libs/imagick/src/PerlMagick/t/blob.t | cota/parsec2-aarch64 | cdf7da348afd231dbe067266f24dc14d22f5cebf | [
"BSD-3-Clause"
] | null | null | null | pkgs/libs/imagick/src/PerlMagick/t/blob.t | cota/parsec2-aarch64 | cdf7da348afd231dbe067266f24dc14d22f5cebf | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/perl
#
# Test image blobs.
#
BEGIN { $| = 1; $test=1, print "1..1\n"; }
END {print "not ok 1\n" unless $loaded;}
use Image::Magick;
$loaded=1;
chdir 't' || die 'Cd failed';
$image = new Image::Magick;
$image->Read( 'input.miff' );
@blob = $image->ImageToBlob();
undef $image;
$image=Image::Magick->new( magick=>'MIFF' );
$image->BlobToImage( @blob );
if ($image->Get('signature') ne
'5a5f94a626ee1945ab1d4d2a621aeec4982cccb94e4d68afe4c784abece91b3e')
{ print "not ok $test\n"; }
else
{ print "ok $test\n"; }
1;
| 20.814815 | 72 | 0.606762 |
edaaa3aac900d2fe057197e1e9394fb0e772d702 | 1,393 | pm | Perl | auto-lib/Paws/IoT/LambdaAction.pm | agimenez/aws-sdk-perl | 9c4dff7d1af2ff0210c28ca44fb9e92bc625712b | [
"Apache-2.0"
] | 2 | 2016-09-22T09:18:33.000Z | 2017-06-20T01:36:58.000Z | auto-lib/Paws/IoT/LambdaAction.pm | cah-rfelsburg/paws | de9ffb8d49627635a2da588066df26f852af37e4 | [
"Apache-2.0"
] | null | null | null | auto-lib/Paws/IoT/LambdaAction.pm | cah-rfelsburg/paws | de9ffb8d49627635a2da588066df26f852af37e4 | [
"Apache-2.0"
] | null | null | null | package Paws::IoT::LambdaAction;
use Moose;
has FunctionArn => (is => 'ro', isa => 'Str', xmlname => 'functionArn', request_name => 'functionArn', traits => ['Unwrapped','NameInRequest'], required => 1);
1;
### main pod documentation begin ###
=head1 NAME
Paws::IoT::LambdaAction
=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::IoT::LambdaAction object:
$service_obj->Method(Att1 => { FunctionArn => $value, ..., FunctionArn => $value });
=head3 Results returned from an API call
Use accessors for each attribute. If Att1 is expected to be an Paws::IoT::LambdaAction object:
$result = $service_obj->Method(...);
$result->Att1->FunctionArn
=head1 DESCRIPTION
Describes an action to invoke a Lambda function.
=head1 ATTRIBUTES
=head2 B<REQUIRED> FunctionArn => Str
The ARN of the Lambda function.
=head1 SEE ALSO
This class forms part of L<Paws>, describing an object used in L<Paws::IoT>
=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
| 24.438596 | 161 | 0.72649 |
ed9e8b21c5236f16401384c02779c74166852e40 | 3,887 | ph | Perl | kernel/base/include/los_multipledlinkhead.ph | g00523441/LiteOS | 76f6819eb0734d01289e0525d93cf37a1cf017f4 | [
"BSD-3-Clause"
] | 128 | 2018-10-29T04:11:47.000Z | 2022-03-07T02:19:14.000Z | kernel/base/include/los_multipledlinkhead.ph | g00523441/LiteOS | 76f6819eb0734d01289e0525d93cf37a1cf017f4 | [
"BSD-3-Clause"
] | 40 | 2018-11-02T00:40:48.000Z | 2021-12-07T09:33:56.000Z | kernel/base/include/los_multipledlinkhead.ph | g00523441/LiteOS | 76f6819eb0734d01289e0525d93cf37a1cf017f4 | [
"BSD-3-Clause"
] | 118 | 2018-10-29T08:43:57.000Z | 2022-01-07T06:49:25.000Z | /*----------------------------------------------------------------------------
* Copyright (c) <2013-2015>, <Huawei Technologies Co., Ltd>
* 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.
*---------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
* Notice of Export Control Law
* ===============================================
* Huawei LiteOS may be subject to applicable export control laws and regulations, which might
* include those applicable to Huawei LiteOS of U.S. and the country in which you are located.
* Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such
* applicable export control laws and regulations.
*---------------------------------------------------------------------------*/
#ifndef _LOS_MULTIPLE_DLINK_HEAD_PH
#define _LOS_MULTIPLE_DLINK_HEAD_PH
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif /* __cplusplus */
#endif /* __cplusplus */
#include "los_list.h"
#define OS_MAX_MULTI_DLNK_LOG2 30
#define OS_MIN_MULTI_DLNK_LOG2 4
#define OS_MULTI_DLNK_NUM ((OS_MAX_MULTI_DLNK_LOG2 - OS_MIN_MULTI_DLNK_LOG2) + 1)
#define OS_DLNK_HEAD_SIZE OS_MULTI_DLNK_HEAD_SIZE
#define OS_DLnkInitHead LOS_DLnkInitMultiHead
#define OS_DLnkHead LOS_DLnkMultiHead
#define OS_DLnkNextHead LOS_DLnkNextMultiHead
#define OS_DLnkFirstHead LOS_DLnkFirstMultiHead
#define OS_MULTI_DLNK_HEAD_SIZE sizeof(LOS_MULTIPLE_DLNK_HEAD)
typedef struct
{
LOS_DL_LIST stListHead[OS_MULTI_DLNK_NUM];
} LOS_MULTIPLE_DLNK_HEAD;
LITE_OS_SEC_ALW_INLINE STATIC_INLINE LOS_DL_LIST *LOS_DLnkNextMultiHead(VOID *pHeadAddr, LOS_DL_LIST *pstListHead)
{
LOS_MULTIPLE_DLNK_HEAD *head = (LOS_MULTIPLE_DLNK_HEAD *)pHeadAddr;
return (&(head->stListHead[OS_MULTI_DLNK_NUM - 1]) == pstListHead) ? NULL : (pstListHead + 1);
}
LITE_OS_SEC_ALW_INLINE STATIC_INLINE LOS_DL_LIST *LOS_DLnkFirstMultiHead(VOID *pHeadAddr)
{
return (LOS_DL_LIST *)pHeadAddr;
}
extern VOID LOS_DLnkInitMultiHead(VOID *pHeadAddr);
extern LOS_DL_LIST *LOS_DLnkMultiHead(VOID *pHeadAddr, UINT32 uwSize);
#ifdef __cplusplus
#if __cplusplus
}
#endif /* __cplusplus */
#endif /* __cplusplus */
#endif /* _LOS_MULTIPLE_DLINK_HEAD_PH */
| 46.831325 | 114 | 0.684847 |
73f54ddc6a0bdd3cea5b86cc820662a3df6f0118 | 8,523 | t | Perl | test/blackbox-tests/test-cases/dune-project-meta/run.t | gares/dune | 77ed8ab727ca3c3cfce9797f6e171012de891028 | [
"MIT"
] | 1 | 2021-04-15T05:05:50.000Z | 2021-04-15T05:05:50.000Z | test/blackbox-tests/test-cases/dune-project-meta/run.t | gares/dune | 77ed8ab727ca3c3cfce9797f6e171012de891028 | [
"MIT"
] | null | null | null | test/blackbox-tests/test-cases/dune-project-meta/run.t | gares/dune | 77ed8ab727ca3c3cfce9797f6e171012de891028 | [
"MIT"
] | null | null | null | Test generation of opam files, as well as handling of versions
Simple test
-----------
The `dune build` should generate the opam file
$ mkdir test1
$ cat >test1/dune-project <<EOF
> (lang dune 1.10)
> (version 1.0.0)
> (name cohttp)
> (source (github mirage/ocaml-cohttp))
> (license ISC)
> (authors "Anil Madhavapeddy" "Rudi Grinberg")
> ;
> (generate_opam_files true)
> ;
> (package
> (name cohttp)
> (synopsis "An OCaml library for HTTP clients and servers")
> (description "A longer description")
> (depends
> (alcotest :with-test)
> (dune (and :build (> 1.5)))
> (foo (and :dev (> 1.5) (< 2.0)))
> (uri (>= 1.9.0))
> (uri (< 2.0.0))
> (fieldslib (> v0.12))
> (fieldslib (< v0.13))))
> ;
> (package
> (name cohttp-async)
> (synopsis "HTTP client and server for the Async library")
> (description "A _really_ long description")
> (depends
> (cohttp (>= 1.0.2))
> (conduit-async (>= 1.0.3))
> (async (>= v0.10.0))
> (async (< v0.12))))
> EOF
$ dune build @install --root test1
Entering directory 'test1'
$ cat test1/cohttp.opam
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
["dune" "build" "-p" name "@doc"] {with-doc}
]
authors: ["Anil Madhavapeddy" "Rudi Grinberg"]
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
homepage: "https://github.com/mirage/ocaml-cohttp"
license: "ISC"
version: "1.0.0"
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
synopsis: "An OCaml library for HTTP clients and servers"
description: "A longer description"
depends: [
"alcotest" {with-test}
"dune" {build & > "1.5"}
"foo" {dev & > "1.5" & < "2.0"}
"uri" {>= "1.9.0"}
"uri" {< "2.0.0"}
"fieldslib" {> "v0.12"}
"fieldslib" {< "v0.13"}
]
$ cat test1/cohttp-async.opam
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
["dune" "build" "-p" name "@doc"] {with-doc}
]
authors: ["Anil Madhavapeddy" "Rudi Grinberg"]
bug-reports: "https://github.com/mirage/ocaml-cohttp/issues"
homepage: "https://github.com/mirage/ocaml-cohttp"
license: "ISC"
version: "1.0.0"
dev-repo: "git+https://github.com/mirage/ocaml-cohttp.git"
synopsis: "HTTP client and server for the Async library"
description: "A _really_ long description"
depends: [
"cohttp" {>= "1.0.2"}
"conduit-async" {>= "1.0.3"}
"async" {>= "v0.10.0"}
"async" {< "v0.12"}
]
Fatal error with opam file that is not listed in the dune-project file:
$ echo "cannot parse me" > test1/foo.opam
$ dune build @install --root test1
Entering directory 'test1'
File "foo.opam", line 1, characters 0-0:
Error: This opam file doesn't have a corresponding (package ...) stanza in
the dune-project_file. Since you have at least one other (package ...) stanza
in your dune-project file, you must a (package ...) stanza for each opam
package in your project.
[1]
Package information fields can be overriden per-package:
$ mkdir test2
$ cat >test2/dune-project <<EOF
> (lang dune 2.5)
> (name foo)
> (version 1.0.0)
> (source (github mirage/ocaml-cohttp))
> (license ISC)
> (authors "Anil Madhavapeddy" "Rudi Grinberg")
> (homepage https://my.home.page)
> ;
> (generate_opam_files true)
> ;
> (package
> (name foo)
> (version 1.0.1)
> (source (github mirage/foo))
> (license MIT)
> (authors "Foo" "Bar"))
> EOF
$ dune build @install --root test2
Entering directory 'test2'
$ cat test2/foo.opam
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "1.0.1"
authors: ["Foo" "Bar"]
license: "MIT"
homepage: "https://my.home.page"
bug-reports: "https://github.com/mirage/foo/issues"
depends: [
"dune" {>= "2.5"}
]
build: [
["dune" "subst"] {pinned}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
dev-repo: "git+https://github.com/mirage/foo.git"
Version generated in opam and META files
----------------------------------------
After calling `dune subst`, dune should embed the version inside the
generated META and opam files.
### With opam files and no package stanzas
$ mkdir version
$ cat > version/dune-project <<EOF
> (lang dune 1.10)
> (name foo)
> EOF
$ cat > version/foo.opam <<EOF
> EOF
$ cat > version/dune <<EOF
> (library (public_name foo))
> EOF
$ (cd version
> git init -q
> git add .
> git commit -qm _
> git tag -a 1.0 -m 1.0
> dune subst)
$ dune build --root version foo.opam META.foo
Entering directory 'version'
$ grep ^version version/foo.opam
version: "1.0"
$ grep ^version version/_build/default/META.foo
version = "1.0"
### With package stanzas and generating the opam files
$ rm -rf version
$ mkdir version
$ cat > version/dune-project <<EOF
> (lang dune 1.10)
> (name foo)
> (generate_opam_files true)
> (package (name foo))
> EOF
$ cat > version/foo.opam <<EOF
> EOF
$ cat > version/dune <<EOF
> (library (public_name foo))
> EOF
$ (cd version
> git init -q
> git add .
> git commit -qm _
> git tag -a 1.0 -m 1.0
> dune subst)
$ dune build --root version foo.opam META.foo
Entering directory 'version'
$ grep ^version version/foo.opam
version: "1.0"
$ grep ^version version/_build/default/META.foo
version = "1.0"
Generation of opam files with lang dune >= 1.11
-----------------------------------------------
$ mkdir gen-v1.11
$ cat > gen-v1.11/dune-project <<EOF
> (lang dune 1.11)
> (name test)
> (generate_opam_files true)
> (package (name test))
> EOF
$ dune build @install --root gen-v1.11
Entering directory 'gen-v1.11'
$ cat gen-v1.11/test.opam
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
depends: [
"dune" {>= "1.11"}
]
build: [
["dune" "subst"] {pinned}
[
"dune"
"build"
"-p"
name
"-j"
jobs
"@install"
"@runtest" {with-test}
"@doc" {with-doc}
]
]
Templates
---------
$ mkdir template
$ cat > template/dune-project <<EOF
> (lang dune 2.0)
> (name foo)
> (generate_opam_files true)
> (package (name foo) (depends bar))
> EOF
Test various fields in the template file. Fields coming from the
template are always put at the end. Fields generated by Dune are
sorted in a way that pleases "opam lint".
$ cat > template/foo.opam.template <<EOF
> x-foo: "blah"
> EOF
$ dune build @install --root template
Entering directory 'template'
$ tail -n 1 template/foo.opam
x-foo: "blah"
$ cat > template/foo.opam.template <<EOF
> libraries: [ "blah" ]
> EOF
$ dune build @install --root template
Entering directory 'template'
$ tail -n 1 template/foo.opam
libraries: [ "blah" ]
$ cat > template/foo.opam.template <<EOF
> depends: [ "overridden" ]
> EOF
$ dune build @install --root template
Entering directory 'template'
$ tail -n 1 template/foo.opam
depends: [ "overridden" ]
Using binary operators for dependencies
---------------------------------------
$ mkdir binops
Not supported before 2.1:
$ cat > binops/dune-project <<EOF
> (lang dune 2.0)
> (name foo)
> (generate_opam_files true)
> (package
> (name foo)
> (depends (conf-libX11 (<> :os win32))))
> EOF
$ dune build @install --root binops
Entering directory 'binops'
File "dune-project", line 6, characters 23-37:
6 | (depends (conf-libX11 (<> :os win32))))
^^^^^^^^^^^^^^
Error: Passing two arguments to <> is only available since version 2.1 of the
dune language. Please update your dune-project file to have (lang dune 2.1).
[1]
Supported since 2.1:
$ cat > binops/dune-project <<EOF
> (lang dune 2.1)
> (name foo)
> (generate_opam_files true)
> (package
> (name foo)
> (depends (conf-libX11 (<> :os win32))))
> EOF
$ dune build @install --root binops
Entering directory 'binops'
$ grep conf-libX11 binops/foo.opam
"conf-libX11" {os != "win32"}
| 24.421203 | 79 | 0.598029 |
ed3411894531ce4b9dbb9985c0a7df2bca5fe56c | 731 | pm | Perl | tests/yast2_cmd/yast_lang.pm | acerv/os-autoinst-distri-opensuse | 0e0cfca02f3a86323682c511a1efa926c7f0df3a | [
"FSFAP"
] | 84 | 2015-02-10T16:01:52.000Z | 2022-03-10T21:20:14.000Z | tests/yast2_cmd/yast_lang.pm | acerv/os-autoinst-distri-opensuse | 0e0cfca02f3a86323682c511a1efa926c7f0df3a | [
"FSFAP"
] | 8,065 | 2015-01-07T07:44:02.000Z | 2022-03-31T12:02:06.000Z | tests/yast2_cmd/yast_lang.pm | acerv/os-autoinst-distri-opensuse | 0e0cfca02f3a86323682c511a1efa926c7f0df3a | [
"FSFAP"
] | 404 | 2015-01-14T14:42:44.000Z | 2022-03-30T07:38:08.000Z | # SUSE's openQA tests
#
# Copyright 2020 SUSE LLC
# SPDX-License-Identifier: FSFAP
# Package: yast2-country
# Summary: yast language test
# List languages, set default and secondary languages
# Maintainer: Michael Grifalconi <[email protected]>
use base 'consoletest';
use strict;
use warnings;
use testapi;
use utils;
sub run {
my $self = shift;
$self->select_serial_terminal;
zypper_call "in yast2-country";
validate_script_output 'yast language list', sub { m/(.*)de_DE(.*)it_IT(.*)/s };
assert_script_run 'yast language set lang=de_DE languages=it_IT';
validate_script_output 'yast language summary', sub { m/(.*)de_DE(.*)it_IT(.*)/s };
assert_script_run 'yast language set lang=en_US';
}
1;
| 26.107143 | 87 | 0.715458 |
edae94224148ee9a12c24e4f788a1beafaf83fad | 243 | pm | Perl | auto-lib/Paws/ELBv2/DeleteRuleOutput.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 164 | 2015-01-08T14:58:53.000Z | 2022-02-20T19:16:24.000Z | auto-lib/Paws/ELBv2/DeleteRuleOutput.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 348 | 2015-01-07T22:08:38.000Z | 2022-01-27T14:34:44.000Z | auto-lib/Paws/ELBv2/DeleteRuleOutput.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 87 | 2015-04-22T06:29:47.000Z | 2021-09-29T14:45:55.000Z |
package Paws::ELBv2::DeleteRuleOutput;
use Moose;
has _request_id => (is => 'ro', isa => 'Str');
1;
### main pod documentation begin ###
=head1 NAME
Paws::ELBv2::DeleteRuleOutput
=head1 ATTRIBUTES
=head2 _request_id => Str
=cut
| 11.045455 | 48 | 0.662551 |
ed786b41038a9995a0bedce021201c2a7b393f20 | 4,198 | pm | Perl | lib/Google/Ads/GoogleAds/V5/Services/GoogleAdsService/MutateOperationResponse.pm | PierrickVoulet/google-ads-perl | bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4 | [
"Apache-2.0"
] | null | null | null | lib/Google/Ads/GoogleAds/V5/Services/GoogleAdsService/MutateOperationResponse.pm | PierrickVoulet/google-ads-perl | bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4 | [
"Apache-2.0"
] | null | null | null | lib/Google/Ads/GoogleAds/V5/Services/GoogleAdsService/MutateOperationResponse.pm | PierrickVoulet/google-ads-perl | bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020, Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
package Google::Ads::GoogleAds::V5::Services::GoogleAdsService::MutateOperationResponse;
use strict;
use warnings;
use base qw(Google::Ads::GoogleAds::BaseEntity);
use Google::Ads::GoogleAds::Utils::GoogleAdsHelper;
sub new {
my ($class, $args) = @_;
my $self = {
adGroupAdLabelResult => $args->{adGroupAdLabelResult},
adGroupAdResult => $args->{adGroupAdResult},
adGroupBidModifierResult => $args->{adGroupBidModifierResult},
adGroupCriterionLabelResult => $args->{adGroupCriterionLabelResult},
adGroupCriterionResult => $args->{adGroupCriterionResult},
adGroupExtensionSettingResult => $args->{adGroupExtensionSettingResult},
adGroupFeedResult => $args->{adGroupFeedResult},
adGroupLabelResult => $args->{adGroupLabelResult},
adGroupResult => $args->{adGroupResult},
adParameterResult => $args->{adParameterResult},
adResult => $args->{adResult},
assetResult => $args->{assetResult},
biddingStrategyResult => $args->{biddingStrategyResult},
campaignAssetResult => $args->{campaignAssetResult},
campaignBidModifierResult => $args->{campaignBidModifierResult},
campaignBudgetResult => $args->{campaignBudgetResult},
campaignCriterionResult => $args->{campaignCriterionResult},
campaignDraftResult => $args->{campaignDraftResult},
campaignExperimentResult => $args->{campaignExperimentResult},
campaignExtensionSettingResult => $args->{campaignExtensionSettingResult},
campaignFeedResult => $args->{campaignFeedResult},
campaignLabelResult => $args->{campaignLabelResult},
campaignResult => $args->{campaignResult},
campaignSharedSetResult => $args->{campaignSharedSetResult},
conversionActionResult => $args->{conversionActionResult},
customerExtensionSettingResult => $args->{customerExtensionSettingResult},
customerFeedResult => $args->{customerFeedResult},
customerLabelResult => $args->{customerLabelResult},
customerNegativeCriterionResult => $args->{customerNegativeCriterionResult},
customerResult => $args->{customerResult},
extensionFeedItemResult => $args->{extensionFeedItemResult},
feedItemResult => $args->{feedItemResult},
feedItemTargetResult => $args->{feedItemTargetResult},
feedMappingResult => $args->{feedMappingResult},
feedResult => $args->{feedResult},
keywordPlanAdGroupKeywordResult => $args->{keywordPlanAdGroupKeywordResult},
keywordPlanAdGroupResult => $args->{keywordPlanAdGroupResult},
keywordPlanCampaignKeywordResult =>
$args->{keywordPlanCampaignKeywordResult},
keywordPlanCampaignResult => $args->{keywordPlanCampaignResult},
keywordPlanResult => $args->{keywordPlanResult},
labelResult => $args->{labelResult},
mediaFileResult => $args->{mediaFileResult},
remarketingActionResult => $args->{remarketingActionResult},
sharedCriterionResult => $args->{sharedCriterionResult},
sharedSetResult => $args->{sharedSetResult},
userListResult => $args->{userListResult}};
# Delete the unassigned fields in this object for a more concise JSON payload
remove_unassigned_fields($self, $args);
bless $self, $class;
return $self;
}
1;
| 51.195122 | 88 | 0.662697 |
ed6caf8c7c8a98aecd10c6a60d110abd38959693 | 2,352 | pm | Perl | auto-lib/Paws/RDS/PromoteReadReplicaDBCluster.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 164 | 2015-01-08T14:58:53.000Z | 2022-02-20T19:16:24.000Z | auto-lib/Paws/RDS/PromoteReadReplicaDBCluster.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 348 | 2015-01-07T22:08:38.000Z | 2022-01-27T14:34:44.000Z | auto-lib/Paws/RDS/PromoteReadReplicaDBCluster.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 87 | 2015-04-22T06:29:47.000Z | 2021-09-29T14:45:55.000Z |
package Paws::RDS::PromoteReadReplicaDBCluster;
use Moose;
has DBClusterIdentifier => (is => 'ro', isa => 'Str', required => 1);
use MooseX::ClassAttribute;
class_has _api_call => (isa => 'Str', is => 'ro', default => 'PromoteReadReplicaDBCluster');
class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::RDS::PromoteReadReplicaDBClusterResult');
class_has _result_key => (isa => 'Str', is => 'ro', default => 'PromoteReadReplicaDBClusterResult');
1;
### main pod documentation begin ###
=head1 NAME
Paws::RDS::PromoteReadReplicaDBCluster - Arguments for method PromoteReadReplicaDBCluster on L<Paws::RDS>
=head1 DESCRIPTION
This class represents the parameters used for calling the method PromoteReadReplicaDBCluster on the
L<Amazon Relational Database Service|Paws::RDS> service. Use the attributes of this class
as arguments to method PromoteReadReplicaDBCluster.
You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to PromoteReadReplicaDBCluster.
=head1 SYNOPSIS
my $rds = Paws->service('RDS');
my $PromoteReadReplicaDBClusterResult = $rds->PromoteReadReplicaDBCluster(
DBClusterIdentifier => 'MyString',
);
# Results:
my $DBCluster = $PromoteReadReplicaDBClusterResult->DBCluster;
# Returns a L<Paws::RDS::PromoteReadReplicaDBClusterResult> object.
Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/rds/PromoteReadReplicaDBCluster>
=head1 ATTRIBUTES
=head2 B<REQUIRED> DBClusterIdentifier => Str
The identifier of the DB cluster read replica to promote. This
parameter isn't case-sensitive.
Constraints:
=over
=item *
Must match the identifier of an existing DB cluster read replica.
=back
Example: C<my-cluster-replica1>
=head1 SEE ALSO
This class forms part of L<Paws>, documenting arguments for method PromoteReadReplicaDBCluster in L<Paws::RDS>
=head1 BUGS and CONTRIBUTIONS
The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
=cut
| 30.153846 | 249 | 0.753401 |
ed332d01353d5a4111b30076e3a1d9b1e1089f28 | 852 | pm | Perl | local/lib/perl5/Date/Manip/Offset/off024.pm | jkb78/extrajnm | 6890e38e15f85ea9c09a141aa14affad0b8e91e7 | [
"MIT"
] | null | null | null | local/lib/perl5/Date/Manip/Offset/off024.pm | jkb78/extrajnm | 6890e38e15f85ea9c09a141aa14affad0b8e91e7 | [
"MIT"
] | null | null | null | local/lib/perl5/Date/Manip/Offset/off024.pm | jkb78/extrajnm | 6890e38e15f85ea9c09a141aa14affad0b8e91e7 | [
"MIT"
] | null | null | null | package #
Date::Manip::Offset::off024;
# Copyright (c) 2008-2015 Sullivan Beck. All rights reserved.
# This program is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
# This file was automatically generated. Any changes to this file will
# be lost the next time 'tzdata' is run.
# Generated on: Wed Nov 25 11:44:43 EST 2015
# Data version: tzdata2015g
# Code version: tzcode2015g
# This module contains data from the zoneinfo time zone database. The original
# data was obtained from the URL:
# ftp://ftp.iana.org/tz
use strict;
use warnings;
require 5.010000;
our ($VERSION);
$VERSION='6.52';
END { undef $VERSION; }
our ($Offset,%Offset);
END {
undef $Offset;
undef %Offset;
}
$Offset = '+01:05:21';
%Offset = (
0 => [
'europe/vienna',
],
);
1;
| 21.3 | 79 | 0.666667 |
edae5585211c165761af6eea35c534e9ac01930c | 958 | t | Perl | t/Policy/Variables/protect_private_vars.t | git-the-cpan/Perl-Lint | adc4e41477dee326dab30abc97bdab3945059e00 | [
"Artistic-1.0"
] | 42 | 2015-01-25T20:42:02.000Z | 2021-12-22T12:57:32.000Z | t/Policy/Variables/protect_private_vars.t | git-the-cpan/Perl-Lint | adc4e41477dee326dab30abc97bdab3945059e00 | [
"Artistic-1.0"
] | 38 | 2015-01-10T13:19:24.000Z | 2019-04-11T13:46:42.000Z | t/Policy/Variables/protect_private_vars.t | git-the-cpan/Perl-Lint | adc4e41477dee326dab30abc97bdab3945059e00 | [
"Artistic-1.0"
] | 12 | 2015-04-20T11:24:37.000Z | 2021-03-02T03:06:00.000Z | use strict;
use warnings;
use Perl::Lint::Policy::Variables::ProtectPrivateVars;
use t::Policy::Util qw/fetch_violations/;
use Test::Base::Less;
my $class_name = 'Variables::ProtectPrivateVars';
filters {
params => [qw/eval/], # TODO wrong!
};
for my $block (blocks) {
my $violations = fetch_violations($class_name, $block->input, $block->params);
is scalar @$violations, $block->failures, $block->dscr;
}
done_testing;
__DATA__
===
--- dscr: Basic failure
--- failures: 6
--- params:
--- input
$Other::Package::_foo;
@Other::Package::_bar;
%Other::Package::_baz;
&Other::Package::_quux;
*Other::Package::_xyzzy;
\$Other::Package::_foo;
===
--- dscr: Basic passing
--- failures: 0
--- params:
--- input
$_foo;
@_bar;
%_baz;
&_quux;
\$_foo;
$::_foo;
===
--- dscr: no lint
--- failures: 4
--- params:
--- input
$Other::Package::_foo;
@Other::Package::_bar;
%Other::Package::_baz; ## no lint
&Other::Package::_quux;
*Other::Package::_xyzzy;
| 17.107143 | 82 | 0.655532 |
edacd268e9acf3663a4784babae97914d62f18b8 | 3,181 | ph | Perl | base/pop/x/pop/include/xt_constants.ph | GetPoplog/Seed | 11cf37589021b232ab7b5b5f87169a694e474031 | [
"MIT"
] | 5 | 2021-06-04T21:18:58.000Z | 2022-03-05T02:45:19.000Z | base/pop/x/pop/include/xt_constants.ph | GetPoplog/Seed | 11cf37589021b232ab7b5b5f87169a694e474031 | [
"MIT"
] | 58 | 2021-06-07T13:36:23.000Z | 2021-09-16T08:39:18.000Z | base/pop/x/pop/include/xt_constants.ph | GetPoplog/Seed | 11cf37589021b232ab7b5b5f87169a694e474031 | [
"MIT"
] | 1 | 2021-06-13T01:50:16.000Z | 2021-06-13T01:50:16.000Z | /* --- Copyright University of Sussex 1995. All rights reserved. ----------
> File: C.x/x/pop/include/xt_constants.ph
> Purpose: Various Xtoolkit constants
> Author: Roger Evans, Oct 10 1990 (see revisions)
> Documentation: REF *XT_CONSTANTS
> Related Files:
*/
#_TERMIN_IF DEF XT_CONSTANTS_INCLUDED
include sysdefs.ph;
section;
;;; NB: this file should be regarded as read-only: it is included in the
;;; poplog image itself, so changing values here will only lead to
;;; inconsistency
iconstant macro (
;;; XrmOptionKind enum type
XrmoptionNoArg = 0,
XrmoptionIsArg = 1,
XrmoptionStickyArg = 2,
XrmoptionSepArg = 3,
XrmoptionResArg = 4,
XrmoptionSkipArg = 5,
XrmoptionSkipLine = 6,
XrmoptionSkipNArgs = 7,
);
iconstant macro (
;;; Special varargs resource names
XtVaNested = copy_fixed('XtVaNested'),
XtVaTypedArg = copy_fixed('XtVaTypedArg'),
);
iconstant macro (
;;; XtAddressMode enum type
XtAddress = 0,
XtBaseOffset = 1,
XtImmediate = 2,
XtResourceString = 3,
XtResourceQuark = 4,
XtWidgetBaseOffset = 5,
XtProcedureArg = 6,
;;; XtGrabKind enum type
XtGrabNone = 0,
XtGrabNonexclusive = 1,
XtGrabExclusive = 2,
;;; Condition mask values for XtAppAddInput
XtInputNoneMask = 0,
XtInputReadMask = 1,
XtInputWriteMask = 2,
XtInputExceptMask = 4,
;;; Event mask values for XtAppPending, XtAppProcessEvent etc.
XtIMXEvent = 1,
XtIMTimer = 2,
XtIMAlternateInput = 4,
XtIMAll = (XtIMXEvent || XtIMTimer || XtIMAlternateInput),
;;; Event handler insertion positions,
XtListHead = 0,
XtListTail = 1,
XtAllEvents = -1,
;;; Resource converter Cache modes (XtSetTypeConverter, etc.)
XtCacheNone = 1,
XtCacheAll = 2,
XtCacheByDisplay = 3,
XtCacheRefCount = 256,
;;; Callback list status (XtHasCallbacks)
XtCallbackNoList = 0,
XtCallbackHasNone = 1,
XtCallbackHasSome = 2,
);
iconstant XT_CONSTANTS_INCLUDED = true;
endsection;
/* --- Revision History ---------------------------------------------------
--- John Gibson, Mar 29 1995
Values for XrmoptionSkipLine and XrmoptionSkipNArgs were swapped --
corrected. Changed XtAllEvents to be -1.
--- John Gibson, Nov 21 1991
Removed VMS #_IF.
--- Adrian Howard, Aug 29 1991 : Added -XtCallback*- constants
--- Jason Handby, Aug 27 1991 : Added XtCache*
--- Adrian Howard, Jul 5 1991 : Added reference to REF *XT_CONSTANTS
--- Jonathan Meyer, Jul 4 1991
Added XtListHead/XtListTail
--- John Gibson, Feb 9 1991
Made all defs macros (better, 'cos they work in more contexts)
--- John Gibson, Feb 2 1991
Corrected VMS condition mask values (same as Unix after all)
--- John Gibson, Jan 24 1991
Added VMS modifications
--- Roger Evans, Oct 17 1990 added XT_CONSTANTS_INCLUDED
--- Roger Evans, Oct 11 1990 moved out of xpt_constants.ph
*/
| 28.657658 | 75 | 0.617416 |
edc3b46b6144a5c90703e3dc917026a10c83f443 | 6,334 | pl | Perl | Scripts/lib/Nova/Old/pilot/edit.pl | vasi/evnova-utils | 709854779e97b85f7e4bfdea73a2210461251f6b | [
"BSD-2-Clause"
] | 7 | 2016-04-26T20:00:48.000Z | 2022-03-15T08:38:13.000Z | Scripts/lib/Nova/Old/pilot/edit.pl | vasi/evnova-utils | 709854779e97b85f7e4bfdea73a2210461251f6b | [
"BSD-2-Clause"
] | null | null | null | Scripts/lib/Nova/Old/pilot/edit.pl | vasi/evnova-utils | 709854779e97b85f7e4bfdea73a2210461251f6b | [
"BSD-2-Clause"
] | 3 | 2016-10-05T04:32:27.000Z | 2020-12-19T18:33:33.000Z | use warnings;
use strict;
sub pilotEdit {
my ($file, $rsrc, $code) = @_;
my $vers = pilotVers($file);
my $spec = { type => $vers->{type}, id => $rsrc };
my ($res) = readResources($file, $spec);
$spec->{name} = $res->{name};
my $data = $res->{data};
$data = simpleCrypt($vers->{key}, $data);
$data = $code->($data);
$data = simpleCrypt($vers->{key}, $data);
$spec->{data} = $data;
writeResources($file, $spec);
}
sub revivePers {
my $alive = 1;
my @systSpecs;
moreOpts(\@_,
'--kill|k' => sub { $alive = 0 },
'--syst|s=s' => \@systSpecs);
my ($file, @find) = @_;
my $pilot = pilotParse($file);
my $posPers = $pilot->{limits}{posPers};
my @pers = map { findRes(pers => $_) } @find;
if (@systSpecs) {
my %bySyst = persBySyst($pilot, 'all');
for my $syst (findRes(syst => @systSpecs)) {
push @pers, @{$bySyst{$syst->{ID}}};
}
}
# Filter out Bounty Hunter
@pers = grep { $_->{ID} != 1150 } @pers;
pilotEdit($file, 129, sub {
my ($data) = @_;
printf "%s:\n", $alive ? 'Reviving' : 'Killing';
for my $p (@pers) {
printf " %4d - %s\n", $p->{ID}, $p->{Name};
my $pos = $posPers + 2 * ($p->{ID} - 128);
substr($data, $pos, 2) = pack('s>', $alive);
}
return $data;
});
}
sub setCash {
my ($file, $cash) = @_;
my $vers = pilotVers($file);
my %limits = pilotLimits($vers);
pilotEdit($file, 128, sub {
my ($data) = @_;
substr($data, $limits{posCash}, 4) = pack('L>', $cash);
return $data;
});
}
sub setBits {
my ($file, @specs) = @_;
@specs = split ' ', join ' ', @specs;
my $vers = pilotVers($file);
my %limits = pilotLimits($vers);
my $posBits = $limits{posBits};
pilotEdit($file, 128, sub {
my ($data) = @_;
print "Changing bits:\n";
for my $spec (@specs) {
my $bit;
my $set = 1;
$spec =~ /(\d+)/ or next;
$bit = $1;
$set = 0 if $spec =~ /!/;
printf " %4d - %s\n", $bit, $set ? "set" : "clear";
my $pos = $posBits + $bit;
substr($data, $pos, 1) = pack('C', $set);
}
return $data;
});
}
sub setOutf {
my ($file, $spec, $count) = @_;
my $outf = findRes('outf' => $spec);
my $vers = pilotVers($file);
my %limits = pilotLimits($vers);
my $posOutf = $limits{posOutf};
my $pos = $posOutf + 2 * ($outf->{ID} - 128);
# Special handling for weapons and ammo
my @wpos;
my %mods = multiPropsHash($outf, 'ModType', 'ModVal');
for my $type (1, 3) {
next unless exists $mods{$type};
for my $val (@{$mods{$type}}) {
my $w = $limits{posWeap} + 2 * ($val - 128);
$w += 2 * $limits{weap} if $type == 3;
push @wpos, $w;
}
}
pilotEdit($file, 128, sub {
my ($data) = @_;
my $cur = unpack('S>', substr($data, $pos, 2));
if (!defined($count)) {
# Default to one more than we have
$count = $cur + 1;
}
my $diff = $count - $cur;
substr($data, $pos, 2) = pack('S>', max($count, 0));
# Handle weapons and ammo
for my $w (@wpos) {
$cur = unpack('S>', substr($data, $w, 2));
my $new = max($cur + $diff, 0);
substr($data, $w, 2) = pack('S>', $new);
}
printf "Pilot now has %d %s\n", $count, resName($outf);
return $data;
});
}
sub setShip {
my ($file, $spec) = @_;
my $ship = findRes('ship' => $spec);
pilotEdit($file, 128, sub {
my ($data) = @_;
substr($data, 2, 2) = pack('S>', $ship->{ID} - 128);
printf "Pilot is now in a %s\n", resName($ship);
return $data;
});
}
sub setRating {
my ($file, $rating) = @_;
pilotEdit($file, 128, sub {
my ($data) = @_;
my $pos = length($data) - 4;
substr($data, $pos, 4) = pack('L>', $rating);
return $data;
});
}
sub setRecord {
my $govt = 0;
moreOpts(\@_, '--govt|g' => \$govt);
my ($file, $record, @spec) = @_;
my $pilot = pilotParse($file);
my %limits = %{$pilot->{limits}};
my @systs;
if ($govt) {
my %govts = map { $_->{ID} => 1 } findRes(govt => \@spec);
my $allSyst = resource('syst');
@systs = grep { $govts{$_->{Govt}} } values %$allSyst;
} else {
@systs = findRes(syst => \@spec);
}
# Filter out invisible systs
@systs = grep { bitTestEvalPilot($_->{Visibility}, $pilot) } @systs;
pilotEdit($file, 128, sub {
my ($data) = @_;
foreach my $syst (@systs) {
my $pos = $limits{posLegal} + 2 * ($syst->{ID} - 128);
substr($data, $pos, 2) = pack('s>', $record);
}
return $data;
});
}
sub setSpob {
my ($file, $spec) = @_;
my $spob = findRes('spob' => $spec);
pilotEdit($file, 128, sub {
my ($data) = @_;
substr($data, 0, 2) = pack('S>', $spob->{ID} - 128);
printf "Pilot is now at %s\n", resName($spob);
return $data;
});
}
sub addExplore {
my ($file, @specs) = @_;
my @origSpecs = @specs;
my @systs = findRes('syst' => \@specs);
my $vers = pilotVers($file);
my %limits = pilotLimits($vers);
if (!@origSpecs) {
# Limit to visible map
my $pilot = pilotParse($file);
@systs = grep { bitTestEvalPilot($_->{Visibility}, $pilot) } @systs;
}
pilotEdit($file, 128, sub {
my ($data) = @_;
for my $syst (@systs) {
my $pos = $limits{posExplore} + 2 * ($syst->{ID} - 128);
my $val = systCanLand($syst) ? 2 : 1;
substr($data, $pos, 2) = pack('S>', $val);
}
return $data;
});
}
sub addEscort {
my $clear = 0;
moreOpts(\@_, '--clear|C' => \$clear);
my ($file, @ships) = @_;
# Figure out what we want added
my @add;
while (my ($spec, $count) = splice(@ships, 0, 2)) {
$count //= 1;
my $ship = findRes(ship => $spec);
push @add, $ship for 1..$count;
}
my $vers = pilotVers($file);
my %limits = pilotLimits($vers);
my $maxEscorts = 6; # Hard max in EV
pilotEdit($file, 128, sub {
my ($data) = @_;
my @free;
my $existing = 0;
for my $i (0..$limits{escort} - 1) {
my $pos = $limits{posEscort} + 2 * $i;
my $val = unpack('s>', substr($data, $pos, 2));
if ($val == -1) {
push @free, $pos;
} elsif ($val < 1000) {
++$existing;
push @free, $pos if $clear;
}
}
# Limit to the allowed number of escorts
my $room = $clear ? $maxEscorts : max(0, $maxEscorts - $existing);
if ($room < scalar(@add)) {
printf "Only more room for %d escorts!\n", $room;
return $data;
}
printf "Removing all %d escorts\n", $existing if $clear;
for my $pos (@free) {
my $ship = shift @add;
printf "Adding an %s escort\n", resName($ship) if $ship;
my $sid = $ship ? $ship->{ID} - 128 : -1;
substr($data, $pos, 2) = pack('s>', $sid);
}
return $data;
});
}
1;
| 22.146853 | 70 | 0.539312 |
ed869f3d2dc813da4c380e7158de5526a37ef559 | 1,626 | pl | Perl | src/qt/qtwebkit/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests.pl | CBitLabs/phantomjs | 3aec07a4026846d0e32d23d4bf4fe55113739a02 | [
"BSD-3-Clause"
] | 1 | 2021-02-09T10:24:31.000Z | 2021-02-09T10:24:31.000Z | src/qt/qtwebkit/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests.pl | hubli/phantomjs | 0bf14a3d0c940b423efd2aeb0549923fc52e8d56 | [
"BSD-3-Clause"
] | null | null | null | src/qt/qtwebkit/Tools/Scripts/webkitperl/prepare-ChangeLog_unittest/resources/perl_unittests.pl | hubli/phantomjs | 0bf14a3d0c940b423efd2aeb0549923fc52e8d56 | [
"BSD-3-Clause"
] | 1 | 2021-07-19T01:48:25.000Z | 2021-07-19T01:48:25.000Z | #!/usr/bin/perl -w
#
# Copyright (C) 2011 Google Inc. All rights reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with this library; see the file COPYING.LIB. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.
#
sub func1
{
}
sub func2
{
return 123;
}
sub func3
{
return 123;
return 456;
}
sub func4()
{
}
sub func5($$$$)
{
}
sub func6(\@\@\$\$\$\$)
{
}
sub func7
{
$str =<< EOF;
EOF
}
sub func8
{
$str =<< "EOF";
EOF
}
sub func9
{
$str =<< 'EOF';
EOF
}
sub func10
{
$str =<< EOF;
sub funcInHereDocument1
{
}
EOF
}
sub func11
{
$str =<< EOF;
sub funcInHereDocument2
{
}
sub funcInHereDocument3
{
}
EOF
}
sub func12
{
$str =<< EOF;
{
{
{
}
}
}
EOF
}
sub func13
{
$str =<< EOF;
$str << DUMMY_EOF
DUMMY_EOF
EOF
}
sub func14
{
push(@array, << EOF);
EOF
}
sub func15
{
print << EOF;
EOF
}
sub func16 {
}
sub prototypeDeclaration1;
sub prototypeDeclaration2();
sub prototypeDeclaration3(\@$$);
if (1) {
}
for (@array) {
}
{}
{
}
| 11.291667 | 75 | 0.649446 |
ed2b470090aabaf9ec76ac40962aa8575ea879b2 | 1,670 | pm | Perl | ISA/lib/perl/StudyAssayEntity.pm | VEuPathDB/CBIL | 92269a7d9f1df07f39eb5eb5d76a9e866c6b0c82 | [
"Apache-2.0"
] | null | null | null | ISA/lib/perl/StudyAssayEntity.pm | VEuPathDB/CBIL | 92269a7d9f1df07f39eb5eb5d76a9e866c6b0c82 | [
"Apache-2.0"
] | 1 | 2020-02-13T16:00:10.000Z | 2020-02-13T16:00:10.000Z | ISA/lib/perl/StudyAssayEntity.pm | VEuPathDB/CBIL | 92269a7d9f1df07f39eb5eb5d76a9e866c6b0c82 | [
"Apache-2.0"
] | null | null | null | package CBIL::ISA::StudyAssayEntity;
use base qw(CBIL::ISA::Commentable);
use strict;
use Data::Dumper;
use Scalar::Util qw(blessed);
# subclasses must implement the following methods
sub isNode { return 0; }
# subclasses must consider these
sub getAttributeNames {
my ($self) = @_;
if($self->isNode()) {
return ["Comment", "FactorValue"];
}
return ["Comment"];
}
sub getParents {
return [];
}
sub qualifierContextMethod {
my ($self) = @_;
return "set" . $self->getEntityName();
}
sub getValue { $_[0]->{_value} }
sub setValue { $_[0]->{_value} = $_[1]}
sub hasAttributes {
return scalar @{$_[0]->getAttributeNames()};
}
sub hasAttribute {
my ($self, $attr) = @_;
my $attributes = $self->getAttributeNames();
foreach my $possible (@$attributes) {
return 1 if($attr eq $possible);
}
return 0;
}
sub getEntityName {
my ($self) = @_;
my $className = blessed($self);
my @sp = split(/::/, $className);
return pop @sp;
}
# For Node Entities do the simple check that the value is the same
# This requires the author of the isatab applied the Node Characteristics correctly
# All other entity types are attributes and should not be thought of as the same entity
sub equals {
my ($self, $obj) = @_;
if($self->isNode() && $self->getEntityName() eq $obj->getEntityName() && $self->getValue() eq $obj->getValue()) {
return 1;
}
return 0;
}
sub addFactorValue {
my ($self, $factorValue) = @_;
if($self->isNode()) {
push @{$self->{_factor_values}}, $factorValue;
}
else {
die "Cannot apply factor value to non node entity";
}
}
sub getFactorValues { $_[0]->{_factor_values} || [] }
1;
| 19.195402 | 115 | 0.641916 |
ed67c07a412e062e4565fc5beae5ae1170da4556 | 149,121 | pm | Perl | tools/fits/0.6.1/tools/exiftool/perl/lib/Image/ExifTool/Lang/fr.pm | opf-attic/ref | a489c09ffc4dccf6e484b21cb2a2655872df9c93 | [
"Apache-2.0"
] | null | null | null | tools/fits/0.6.1/tools/exiftool/perl/lib/Image/ExifTool/Lang/fr.pm | opf-attic/ref | a489c09ffc4dccf6e484b21cb2a2655872df9c93 | [
"Apache-2.0"
] | null | null | null | tools/fits/0.6.1/tools/exiftool/perl/lib/Image/ExifTool/Lang/fr.pm | opf-attic/ref | a489c09ffc4dccf6e484b21cb2a2655872df9c93 | [
"Apache-2.0"
] | null | null | null | #------------------------------------------------------------------------------
# File: fr.pm
#
# Description: ExifTool French language translations
#
# Notes: This file generated automatically by Image::ExifTool::TagInfoXML
#------------------------------------------------------------------------------
package Image::ExifTool::Lang::fr;
use vars qw($VERSION);
$VERSION = '1.06';
%Image::ExifTool::Lang::fr::Translate = (
'AEAperture' => 'Ouverture AE',
'AEBAutoCancel' => {
Description => 'Annulation bracketing auto',
PrintConv => {
'Off' => 'Arrêt',
'On' => 'Marche',
},
},
'AEBSequence' => 'Séquence de bracketing',
'AEBSequenceAutoCancel' => {
Description => 'Séquence auto AEB/annuler',
PrintConv => {
'-,0,+/Disabled' => '-,0,+/Désactivé',
'-,0,+/Enabled' => '-,0,+/Activé',
'0,-,+/Disabled' => '0,-,+/Désactivé',
'0,-,+/Enabled' => '0,-,+/Activé',
},
},
'AEBShotCount' => 'Nombre de vues bracketées',
'AEBXv' => 'Compensation d\'expo. auto en bracketing',
'AEExposureTime' => 'Temps d\'exposition AE',
'AEExtra' => 'Suppléments AE',
'AELock' => {
Description => 'Verrouillage AE',
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'AEMaxAperture' => 'Ouverture maxi AE',
'AEMaxAperture2' => 'Ouverture maxi AE (2)',
'AEMeteringMode' => {
Description => 'Mode de mesure AE',
PrintConv => {
'Multi-segment' => 'Multizone',
},
},
'AEMeteringSegments' => 'Segments de mesure AE',
'AEMinAperture' => 'Ouverture mini AE',
'AEMinExposureTime' => 'Temps d\'exposition mini AE',
'AEProgramMode' => {
Description => 'Mode programme AE',
PrintConv => {
'Av, B or X' => 'Av, B ou X',
'Candlelight' => 'Bougie',
'DOF Program' => 'Programme PdC',
'DOF Program (P-Shift)' => 'Programme PdC (décalage P)',
'Hi-speed Program' => 'Programme grande vitesse',
'Hi-speed Program (P-Shift)' => 'Programme grande vitesse (décalage P)',
'Kids' => 'Enfants',
'Landscape' => 'Paysage',
'M, P or TAv' => 'M, P ou TAv',
'MTF Program' => 'Programme FTM',
'MTF Program (P-Shift)' => 'Programme FTM (décalage P)',
'Museum' => 'Musée',
'Night Scene' => 'Nocturne',
'Night Scene Portrait' => 'Portrait nocturne',
'No Flash' => 'Sans flash',
'Pet' => 'Animaux de compagnie',
'Sunset' => 'Coucher de soleil',
'Surf & Snow' => 'Surf et neige',
'Sv or Green Mode' => 'Sv ou mode vert',
'Text' => 'Texte',
},
},
'AEXv' => 'Compensation d\'exposition auto',
'AE_ISO' => 'Sensibilité ISO AE',
'AFAdjustment' => 'Ajustement AF',
'AFAreaIllumination' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'AFAssist' => {
Description => 'Faisceau d\'assistance AF',
PrintConv => {
'Does not emit/Fires' => 'N\'émet pas/Se déclenche',
'Emits/Does not fire' => 'Emet/Ne se déclenche pas',
'Emits/Fires' => 'Emet/Se déclenche',
'Off' => 'Désactivé',
'On' => 'Activé',
'Only ext. flash emits/Fires' => 'Flash ext émet/Se déclenche',
},
},
'AFAssistBeam' => {
Description => 'Faisceau d\'assistance AF',
PrintConv => {
'Does not emit' => 'Désactivé',
'Emits' => 'Activé',
'Only ext. flash emits' => 'Uniquement par flash ext.',
},
},
'AFAssistIlluminator' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'AFDefocus' => 'Défocalisation AF',
'AFDuringLiveView' => {
Description => 'AF pendant la visée directe',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activé',
'Live mode' => 'Mode visée directe',
'Quick mode' => 'Mode rapide',
},
},
'AFIntegrationTime' => 'Temps d\'intégration AF',
'AFMicroAdjActive' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'AFMicroadjustment' => {
Description => 'Micro-ajustement de l\'AF',
PrintConv => {
'Adjust all by same amount' => 'Ajuster idem tous obj',
'Adjust by lens' => 'Ajuster par objectif',
'Disable' => 'Désactivé',
},
},
'AFMode' => {
Description => 'Mode AF',
PrintConv => {
'Face Detect AF' => 'Dét. visage',
},
},
'AFOnAELockButtonSwitch' => {
Description => 'Permutation touche AF/Mémo',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activé',
},
},
'AFPoint' => {
PrintConv => {
'Bottom' => 'Bas',
'Center' => 'Centre',
'Left' => 'Gauche',
'None' => 'Aucune',
'Right' => 'Droit',
'Top' => 'Haut',
},
},
'AFPointActivationArea' => {
Description => 'Zone activation collimateurs AF',
PrintConv => {
'Automatic expanded (max. 13)' => 'Expansion auto (13 max.)',
'Expanded (TTL. of 7 AF points)' => 'Expansion (TTL 7 collimat.)',
'Single AF point' => 'Un seul collimateur AF',
},
},
'AFPointAreaExpansion' => {
Description => 'Extension de la zone AF',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activé',
'Enable (left/right assist points)' => 'Activé (gauche/droite collimateurs autofocus d\'assistance)',
'Enable (surrounding assist points)' => 'Activée (Collimateurs autofocus d\'assistance environnants)',
},
},
'AFPointAutoSelection' => {
Description => 'Sélecition des collimateurs automatique',
PrintConv => {
'Control-direct:disable/Main:disable' => 'Contrôle rapide-Directe:désactivé/Principale:désactivé',
'Control-direct:disable/Main:enable' => 'Contrôle rapide-Directe:désactivé/Principale:activé',
'Control-direct:enable/Main:enable' => 'Contrôle rapide-Directe:activé/Principale:activé',
},
},
'AFPointBrightness' => {
Description => 'Intensité d\'illumination AF',
PrintConv => {
'Brighter' => 'Forte',
'Normal' => 'Normale',
},
},
'AFPointDisplayDuringFocus' => {
Description => 'Affichage de point AF pendant mise au point',
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
'On (when focus achieved)' => 'Activé (si mise au point effectuée)',
},
},
'AFPointIllumination' => {
Description => 'Eclairage des collimateurs AF',
PrintConv => {
'Brighter' => 'Plus brillant',
'Off' => 'Désactivé',
'On' => 'Activé',
'On without dimming' => 'Activé sans atténuation',
},
},
'AFPointMode' => 'Mode de mise au point AF',
'AFPointRegistration' => {
Description => 'Validation du point AF',
PrintConv => {
'Automatic' => 'Auto',
'Bottom' => 'Bas',
'Center' => 'Centre',
'Extreme Left' => 'Extrême gauche',
'Extreme Right' => 'Extrême droite',
'Left' => 'Gauche',
'Right' => 'Droit',
'Top' => 'Haut',
},
},
'AFPointSelected' => {
Description => 'Point AF sélectionné',
PrintConv => {
'Automatic Tracking AF' => 'AF en suivi auto',
'Bottom' => 'Bas',
'Center' => 'Centre',
'Face Recognition AF' => 'AF en reconnaissance de visage',
'Fixed Center' => 'Fixe au centre',
'Left' => 'Gauche',
'Lower-left' => 'Bas gauche',
'Lower-right' => 'Bas droit',
'Mid-left' => 'Milieu gauche',
'Mid-right' => 'Milieu droit',
'Right' => 'Droit',
'Top' => 'Haut',
'Upper-left' => 'Haut gauche',
'Upper-right' => 'Haut droite',
},
},
'AFPointSelected2' => 'Point AF sélectionné 2',
'AFPointSelection' => 'Méthode sélect. collimateurs AF',
'AFPointSelectionMethod' => {
Description => 'Méthode sélection collim. AF',
PrintConv => {
'Multi-controller direct' => 'Multicontrôleur direct',
'Normal' => 'Normale',
'Quick Control Dial direct' => 'Molette AR directe',
},
},
'AFPointSpotMetering' => {
Description => 'Nombre collimateurs/mesure spot',
PrintConv => {
'11/Active AF point' => '11/collimateur AF actif',
'11/Center AF point' => '11/collimateur AF central',
'45/Center AF point' => '45/collimateur AF central',
'9/Active AF point' => '9/collimateur AF actif',
},
},
'AFPointsInFocus' => {
Description => 'Points AF nets',
PrintConv => {
'All' => 'Tous',
'Bottom' => 'Bas',
'Bottom, Center' => 'Bas + centre',
'Bottom-center' => 'Bas centre',
'Bottom-left' => 'Bas gauche',
'Bottom-right' => 'Bas droit',
'Center' => 'Centre',
'Center (horizontal)' => 'Centre (horizontal)',
'Center (vertical)' => 'Centre (vertical)',
'Center+Right' => 'Centre+droit',
'Fixed Center or Multiple' => 'Centre fixe ou multiple',
'Left' => 'Gauche',
'Left+Center' => 'Gauch+centre',
'Left+Right' => 'Gauche+droit',
'Lower-left, Bottom' => 'Bas gauche + bas',
'Lower-left, Mid-left' => 'Bas gauche + milieu gauche',
'Lower-right, Bottom' => 'Bas droit + bas',
'Lower-right, Mid-right' => 'Bas droit + milieu droit',
'Mid-left' => 'Milieu gauche',
'Mid-left, Center' => 'Milieu gauche + centre',
'Mid-right' => 'Milieu droit',
'Mid-right, Center' => 'Milieu droit + centre',
'None' => 'Aucune',
'None (MF)' => 'Aucune (MF)',
'Right' => 'Droit',
'Top' => 'Haut',
'Top, Center' => 'Haut + centre',
'Top-center' => 'Haut centre',
'Top-left' => 'Haut gauche',
'Top-right' => 'Haut droit',
'Upper-left, Mid-left' => 'Haut gauche + milieu gauche',
'Upper-left, Top' => 'Haut gauche + haut',
'Upper-right, Mid-right' => 'Haut droit + milieu droit',
'Upper-right, Top' => 'Haut droit + haut',
},
},
'AFPointsUnknown1' => {
PrintConv => {
'All' => 'Tous',
'Central 9 points' => '9 points centraux',
},
},
'AFPointsUnknown2' => 'Points AF inconnus 2',
'AFPredictor' => 'Prédicteur AF',
'AIServoContinuousShooting' => 'Priorité vit. méca. AI Servo',
'AIServoImagePriority' => {
Description => '1er Servo Ai/2e priorité déclenchement',
PrintConv => {
'1: AF, 2: Drive speed' => 'Priorité AF/Priorité cadence vues',
'1: AF, 2: Tracking' => 'Priorité AF/Priorité suivi AF',
'1: Release, 2: Drive speed' => 'Déclenchement/Priorité cadence vues',
},
},
'AIServoTrackingMethod' => {
Description => 'Méthode de suivi autofocus AI Servo',
PrintConv => {
'Continuous AF track priority' => 'Priorité suivi AF en continu',
'Main focus point priority' => 'Priorité point AF principal',
},
},
'AIServoTrackingSensitivity' => {
Description => 'Sensibili. de suivi AI Servo',
PrintConv => {
'Fast' => 'Schnell',
'Medium Fast' => 'Moyenne rapide',
'Medium Slow' => 'Moyenne lent',
'Moderately fast' => 'Moyennement rapide',
'Moderately slow' => 'Moyennement lent',
'Slow' => 'Lent',
},
},
'APEVersion' => 'Version APE',
'ARMIdentifier' => 'Identificateur ARM',
'ARMVersion' => 'Version ARM',
'ActionAdvised' => {
Description => 'Action conseillée',
PrintConv => {
'Object Kill' => 'Destruction d\'objet',
'Object Reference' => 'Référence d\'objet',
'Object Replace' => 'Remplacement d\'objet',
'Ojbect Append' => 'Ajout d\'objet',
},
},
'ActiveArea' => 'Zone active',
'ActiveD-Lighting' => {
PrintConv => {
'Low' => 'Bas',
'Normal' => 'Normale',
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ActiveD-LightingMode' => {
PrintConv => {
'Low' => 'Bas',
'Normal' => 'Normale',
'Off' => 'Désactivé',
},
},
'AddAspectRatioInfo' => {
Description => 'Ajouter info ratio d\'aspect',
PrintConv => {
'Off' => 'Désactivé',
},
},
'AddOriginalDecisionData' => {
Description => 'Aj. données décis. origine',
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'AdditionalModelInformation' => 'Modele d\'Information additionnel',
'Address' => 'Adresse',
'AdultContentWarning' => {
PrintConv => {
'Unknown' => 'Inconnu',
},
},
'AdvancedRaw' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'Advisory' => 'Adversité',
'AnalogBalance' => 'Balance analogique',
'Annotations' => 'Annotations Photoshop',
'Anti-Blur' => {
PrintConv => {
'Off' => 'Désactivé',
'n/a' => 'Non établie',
},
},
'AntiAliasStrength' => 'Puissance relative du filtre anticrénelage de l\'appareil',
'Aperture' => 'Nombre F',
'ApertureRange' => {
Description => 'Régler gamme d\'ouvertures',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activée',
},
},
'ApertureRingUse' => {
Description => 'Utilisation de la bague de diaphragme',
PrintConv => {
'Permitted' => 'Autorisée',
'Prohibited' => 'Interdite',
},
},
'ApertureValue' => 'Ouverture',
'ApplicationRecordVersion' => 'Version d\'enregistrement',
'ApplyShootingMeteringMode' => {
Description => 'Appliquer mode de prise de vue/de mesure',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activée',
},
},
'Artist' => 'Artiste',
'ArtworkCopyrightNotice' => 'Notice copyright de l\'Illustration',
'ArtworkCreator' => 'Créateur de l\'Illustration',
'ArtworkDateCreated' => 'Date de création de l\'Illustration',
'ArtworkSource' => 'Source de l\'Illustration',
'ArtworkSourceInventoryNo' => 'No d\'Inventaire du source de l\'Illustration',
'ArtworkTitle' => 'Titre de l\'Illustration',
'AsShotICCProfile' => 'Profil ICC à la prise de vue',
'AsShotNeutral' => 'Balance neutre à la prise de vue',
'AsShotPreProfileMatrix' => 'Matrice de pré-profil à la prise de vue',
'AsShotProfileName' => 'Nom du profil du cliché',
'AsShotWhiteXY' => 'Balance blanc X-Y à la prise de vue',
'AssignFuncButton' => {
Description => 'Changer fonct. touche FUNC.',
PrintConv => {
'Exposure comp./AEB setting' => 'Correct. expo/réglage AEB',
'Image jump with main dial' => 'Saut image par molette principale',
'Image quality' => 'Changer de qualité',
'LCD brightness' => 'Luminosité LCD',
'Live view function settings' => 'Réglages Visée par l’écran',
},
},
'AssistButtonFunction' => {
Description => 'Touche de fonction rapide',
PrintConv => {
'Av+/- (AF point by QCD)' => 'Av+/- (AF par mol. AR)',
'FE lock' => 'Mémo expo. au flash',
'Normal' => 'Normale',
'Select HP (while pressing)' => 'Sélect. HP (en appuyant)',
'Select Home Position' => 'Sélect. position origine',
},
},
'Audio' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'AudioDuration' => 'Durée audio',
'AudioOutcue' => 'Queue audio',
'AudioSamplingRate' => 'Taux d\'échantillonnage audio',
'AudioSamplingResolution' => 'Résolution d\'échantillonnage audio',
'AudioType' => {
Description => 'Type audio',
PrintConv => {
'Mono Actuality' => 'Actualité (audio mono (1 canal))',
'Mono Music' => 'Musique, transmise par elle-même (audio mono (1 canal))',
'Mono Question and Answer Session' => 'Question et réponse (audio mono (1 canal))',
'Mono Raw Sound' => 'Son brut (audio mono (1 canal))',
'Mono Response to a Question' => 'Réponse à une question (audio mono (1 canal))',
'Mono Scener' => 'Scener (audio mono (1 canal))',
'Mono Voicer' => 'Voix (audio mono (1 canal))',
'Mono Wrap' => 'Wrap (audio mono (1 canal))',
'Stereo Actuality' => 'Actualité (audio stéréo (2 canaux))',
'Stereo Music' => 'Musique, transmise par elle-même (audio stéréo (2 canaux))',
'Stereo Question and Answer Session' => 'Question et réponse (audio stéréo (2 canaux))',
'Stereo Raw Sound' => 'Son brut (audio stéréo (2 canaux))',
'Stereo Response to a Question' => 'Réponse à une question (audio stéréo (2 canaux))',
'Stereo Scener' => 'Scener (audio stéréo (2 canaux))',
'Stereo Voicer' => 'Voix (audio stéréo (2 canaux))',
'Stereo Wrap' => 'Wrap (audio stéréo (2 canaux))',
'Text Only' => 'Texte seul (pas de données d\'objet)',
},
},
'Author' => 'Auteur',
'AuthorsPosition' => 'Titre du créateur',
'AutoAperture' => {
Description => 'Auto-diaph',
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'AutoBracketRelease' => {
PrintConv => {
'None' => 'Aucune',
},
},
'AutoBracketing' => {
Description => 'Bracketing auto',
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'AutoExposureBracketing' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'AutoFP' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'AutoFocus' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'AutoISO' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'AutoLightingOptimizer' => {
Description => 'Correction auto de luminosité',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Actif',
'Low' => 'Faible',
'Off' => 'Désactivé',
'Strong' => 'Importante',
'n/a' => 'Non établie',
},
},
'AutoLightingOptimizerOn' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'AutoRedEye' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'AutoRotate' => {
Description => 'Rotation automatique',
PrintConv => {
'None' => 'Aucune',
'Rotate 180' => '180° (bas/droit)',
'Rotate 270 CW' => '90° sens horaire (gauche/bas)',
'Rotate 90 CW' => '90° sens antihoraire (droit/haut)',
'Unknown' => 'Inconnu',
},
},
'AvApertureSetting' => 'Réglage d\'ouverture Av',
'AvSettingWithoutLens' => {
Description => 'Réglage Av sans objectif',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activé',
},
},
'BWMode' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'BackgroundColorIndicator' => 'Indicateur de couleur d\'arrière-plan',
'BackgroundColorValue' => 'Valeur de couleur d\'arrière-plan',
'BackgroundTiling' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'BadFaxLines' => 'Mauvaises lignes de Fax',
'BannerImageType' => {
PrintConv => {
'None' => 'Aucune',
},
},
'BaseExposureCompensation' => 'Compensation d\'exposition de base',
'BaseURL' => 'URL de base',
'BaselineExposure' => 'Exposition de base',
'BaselineNoise' => 'Bruit de base',
'BaselineSharpness' => 'Accentuation de base',
'BatteryADBodyLoad' => 'Tension accu boîtier en charge',
'BatteryADBodyNoLoad' => 'Tension accu boîtier à vide',
'BatteryADGripLoad' => 'Tension accu poignée en charge',
'BatteryADGripNoLoad' => 'Tension accu poignée à vide',
'BatteryLevel' => 'Niveau de batterie',
'BatteryStates' => {
Description => 'Etat des accus',
PrintConv => {
'Body Battery Almost Empty' => 'Accu boîtier : presque vide',
'Body Battery Empty or Missing' => 'Accu boîtier : vide ou absent',
'Body Battery Full' => 'Accu boîtier : plein',
'Body Battery Running Low' => 'Accu boîtier : en baisse',
'Grip Battery Almost Empty' => 'Accu poignée : presque vide',
'Grip Battery Empty or Missing' => 'Accu poignée : vide ou absent',
'Grip Battery Full' => 'Accu poignée : plein',
'Grip Battery Running Low' => 'Accu poignée : en baisse',
},
},
'BayerGreenSplit' => 'Séparation de vert Bayer',
'Beep' => {
PrintConv => {
'High' => 'Bruyant',
'Low' => 'Calme',
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'BestQualityScale' => 'Echelle de meilleure qualité',
'BitsPerComponent' => 'Bits par composante',
'BitsPerExtendedRunLength' => 'Bits par « Run Length » étendue',
'BitsPerRunLength' => 'Bits par « Run Length »',
'BitsPerSample' => 'Nombre de bits par échantillon',
'BlackLevel' => 'Niveau noir',
'BlackLevelDeltaH' => 'Delta H du niveau noir',
'BlackLevelDeltaV' => 'Delta V du niveau noir',
'BlackLevelRepeatDim' => 'Dimension de répétition du niveau noir',
'BlackPoint' => 'Point noir',
'BlueBalance' => 'Balance bleue',
'BlueMatrixColumn' => 'Colonne de matrice bleue',
'BlueTRC' => 'Courbe de reproduction des tons bleus',
'BlurWarning' => {
PrintConv => {
'None' => 'Aucune',
},
},
'BracketMode' => {
PrintConv => {
'Off' => 'Désactivé',
},
},
'BracketShotNumber' => {
Description => 'Numéro de cliché en bracketing',
PrintConv => {
'1 of 3' => '1 sur 3',
'1 of 5' => '1 sur 5',
'2 of 3' => '2 sur 3',
'2 of 5' => '2 sur 5',
'3 of 3' => '3 sur 3',
'3 of 5' => '3 sur 5',
'4 of 5' => '4 sur 5',
'5 of 5' => '5 sur 5',
'n/a' => 'Non établie',
},
},
'BrightnessValue' => 'Luminosité',
'BulbDuration' => 'Durée du pose longue',
'BurstMode' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ButtonFunctionControlOff' => {
Description => 'Fonction de touche si Contrôle Rapide OFF',
PrintConv => {
'Disable main, Control, Multi-control' => 'Désactivés principale, Contrôle rapide, Multicontrôleur',
'Normal (enable)' => 'Normale (activée)',
},
},
'By-line' => 'Créateur',
'By-lineTitle' => 'Fonction du créateur',
'CFALayout' => {
Description => 'Organisation CFA',
PrintConv => {
'Even columns offset down 1/2 row' => 'Organisation décalée A : les colonnes paires sont décalées vers le bas d\'une demi-rangée.',
'Even columns offset up 1/2 row' => 'Organisation décalée B : les colonnes paires sont décalées vers le haut d\'une demi-rangée.',
'Even rows offset left 1/2 column' => 'Organisation décalée D : les rangées paires sont décalées vers la gauche d\'une demi-colonne.',
'Even rows offset right 1/2 column' => 'Organisation décalée C : les rangées paires sont décalées vers la droite d\'une demi-colonne.',
'Rectangular' => 'Plan rectangulaire (ou carré)',
},
},
'CFAPattern' => 'Matrice de filtrage couleur',
'CFAPattern2' => 'Modèle CFA 2',
'CFAPlaneColor' => 'Couleur de plan CFA',
'CFARepeatPatternDim' => 'Dimension du modèle de répétition CFA',
'CMMFlags' => 'Drapeaux CMM',
'CMYKEquivalent' => 'Equivalent CMJK',
'CPUFirmwareVersion' => 'Version de firmware de CPU',
'CPUType' => {
PrintConv => {
'None' => 'Aucune',
},
},
'CalibrationDateTime' => 'Date et heure de calibration',
'CalibrationIlluminant1' => {
Description => 'Illuminant de calibration 1',
PrintConv => {
'Cloudy' => 'Temps nuageux',
'Cool White Fluorescent' => 'Fluorescente type soft',
'Day White Fluorescent' => 'Fluorescente type blanc',
'Daylight' => 'Lumière du jour',
'Daylight Fluorescent' => 'Fluorescente type jour',
'Fine Weather' => 'Beau temps',
'Fluorescent' => 'Fluorescente',
'ISO Studio Tungsten' => 'Tungstène studio ISO',
'Other' => 'Autre source de lumière',
'Shade' => 'Ombre',
'Standard Light A' => 'Lumière standard A',
'Standard Light B' => 'Lumière standard B',
'Standard Light C' => 'Lumière standard C',
'Tungsten' => 'Tungstène (lumière incandescente)',
'Unknown' => 'Inconnu',
'White Fluorescent' => 'Fluorescent blanc',
},
},
'CalibrationIlluminant2' => {
Description => 'Illuminant de calibration 2',
PrintConv => {
'Cloudy' => 'Temps nuageux',
'Cool White Fluorescent' => 'Fluorescente type soft',
'Day White Fluorescent' => 'Fluorescente type blanc',
'Daylight' => 'Lumière du jour',
'Daylight Fluorescent' => 'Fluorescente type jour',
'Fine Weather' => 'Beau temps',
'Fluorescent' => 'Fluorescente',
'ISO Studio Tungsten' => 'Tungstène studio ISO',
'Other' => 'Autre source de lumière',
'Shade' => 'Ombre',
'Standard Light A' => 'Lumière standard A',
'Standard Light B' => 'Lumière standard B',
'Standard Light C' => 'Lumière standard C',
'Tungsten' => 'Tungstène (lumière incandescente)',
'Unknown' => 'Inconnu',
'White Fluorescent' => 'Fluorescent blanc',
},
},
'CameraCalibration1' => 'Calibration d\'appareil 1',
'CameraCalibration2' => 'Calibration d\'appareil 2',
'CameraCalibrationSig' => 'Signature de calibration de l\'appareil',
'CameraOrientation' => {
Description => 'Orientation de l\'image',
PrintConv => {
'Horizontal (normal)' => '0° (haut/gauche)',
'Rotate 270 CW' => '90° sens horaire (gauche/bas)',
'Rotate 90 CW' => '90° sens antihoraire (droit/haut)',
},
},
'CameraSerialNumber' => 'Numéro de série de l\'appareil',
'CameraTemperature' => 'Température de l\'appareil',
'CameraType' => 'Type d\'objectif Pentax',
'CanonExposureMode' => {
PrintConv => {
'Aperture-priority AE' => 'Priorité ouverture',
'Bulb' => 'Pose B',
'Manual' => 'Manuelle',
'Program AE' => 'Programme d\'exposition automatique',
'Shutter speed priority AE' => 'Priorité vitesse',
},
},
'CanonFirmwareVersion' => 'Version de firmware',
'CanonFlashMode' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
'Red-eye reduction' => 'Réduction yeux rouges',
},
},
'CanonImageSize' => {
PrintConv => {
'Large' => 'Grande',
'Medium' => 'Moyenne',
'Medium 1' => 'Moyenne 1',
'Medium 2' => 'Moyenne 2',
'Medium 3' => 'Moyenne 3',
'Small' => 'Petite',
},
},
'Caption-Abstract' => 'Légende / Description',
'CaptionWriter' => 'Rédacteur',
'CaptureXResolutionUnit' => {
PrintConv => {
'um' => 'µm (micromètre)',
},
},
'CaptureYResolutionUnit' => {
PrintConv => {
'um' => 'µm (micromètre)',
},
},
'Categories' => 'Catégories',
'Category' => 'Catégorie',
'CellLength' => 'Longueur de cellule',
'CellWidth' => 'Largeur de cellule',
'CenterWeightedAreaSize' => {
PrintConv => {
'Average' => 'Moyenne',
},
},
'Certificate' => 'Certificat',
'CharTarget' => 'Cible caractère',
'ChromaBlurRadius' => 'Rayon de flou de chromatisme',
'ChromaticAdaptation' => 'Adaptation chromatique',
'ChrominanceNR_TIFF_JPEG' => {
PrintConv => {
'Low' => 'Bas',
'Off' => 'Désactivé',
},
},
'ChrominanceNoiseReduction' => {
PrintConv => {
'Low' => 'Bas',
'Off' => 'Désactivé',
},
},
'CircleOfConfusion' => 'Cercle de confusion',
'City' => 'Ville',
'ClassifyState' => 'Etat de classification',
'CleanFaxData' => 'Données de Fax propres',
'ClipPath' => 'Chemin de rognage',
'CodedCharacterSet' => 'Jeu de caractères codé',
'ColorAberrationControl' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ColorAdjustmentMode' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ColorBalanceAdj' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ColorBooster' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ColorCalibrationMatrix' => 'Table de matrice de calibration de couleur',
'ColorCharacterization' => 'Caractérisation de couleur',
'ColorComponents' => 'Composants colorimétriques',
'ColorEffect' => {
PrintConv => {
'Off' => 'Désactivé',
},
},
'ColorFilter' => {
PrintConv => {
'Blue' => 'Bleu',
'Green' => 'Vert',
'Off' => 'Désactivé',
'Red' => 'Rouge',
'Yellow' => 'Jaune',
},
},
'ColorMap' => 'Charte de couleur',
'ColorMatrix1' => 'Matrice de couleur 1',
'ColorMatrix2' => 'Matrice de couleur 2',
'ColorMode' => {
Description => 'Mode colorimétrique',
PrintConv => {
'Evening' => 'Soir',
'Landscape' => 'Paysage',
'Natural' => 'Naturel',
'Night Scene' => 'Nocturne',
'Normal' => 'Normale',
'Off' => 'Désactivé',
'RGB' => 'RVB',
'Sunset' => 'Coucher de soleil',
},
},
'ColorMoireReduction' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ColorMoireReductionMode' => {
PrintConv => {
'Low' => 'Bas',
'Off' => 'Désactivé',
},
},
'ColorPalette' => 'Palette de couleur',
'ColorRepresentation' => {
Description => 'Représentation de couleur',
PrintConv => {
'3 Components, Frame Sequential in Multiple Objects' => 'Trois composantes, Vue séquentielle dans différents objets',
'3 Components, Frame Sequential in One Object' => 'Trois composantes, Vue séquentielle dans un objet',
'3 Components, Line Sequential' => 'Trois composantes, Ligne séquentielle',
'3 Components, Pixel Sequential' => 'Trois composantes, Pixel séquentiel',
'3 Components, Single Frame' => 'Trois composantes, Vue unique',
'3 Components, Special Interleaving' => 'Trois composantes, Entrelacement spécial',
'4 Components, Frame Sequential in Multiple Objects' => 'Quatre composantes, Vue séquentielle dans différents objets',
'4 Components, Frame Sequential in One Object' => 'Quatre composantes, Vue séquentielle dans un objet',
'4 Components, Line Sequential' => 'Quatre composantes, Ligne séquentielle',
'4 Components, Pixel Sequential' => 'Quatre composantes, Pixel séquentiel',
'4 Components, Single Frame' => 'Quatre composantes, Vue unique',
'4 Components, Special Interleaving' => 'Quatre composantes, Entrelacement spécial',
'Monochrome, Single Frame' => 'Monochrome, Vue unique',
'No Image, Single Frame' => 'Pas d\'image, Vue unique',
},
},
'ColorResponseUnit' => 'Unité de réponse couleur',
'ColorSequence' => 'Séquence de couleur',
'ColorSpace' => {
Description => 'Espace colorimétrique',
PrintConv => {
'RGB' => 'RVB',
'Uncalibrated' => 'Non calibré',
},
},
'ColorSpaceData' => 'Espace de couleur de données',
'ColorTable' => 'Tableau de couleurs',
'ColorTemperature' => 'Température de couleur',
'ColorTone' => {
Description => 'Teinte couleur',
PrintConv => {
'Normal' => 'Normale',
},
},
'ColorType' => {
PrintConv => {
'RGB' => 'RVB',
},
},
'ColorantOrder' => 'Ordre de colorant',
'ColorimetricReference' => 'Référence colorimétrique',
'CommandDialsChangeMainSub' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'CommandDialsMenuAndPlayback' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'CommandDialsReverseRotation' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'CommanderGroupAMode' => {
PrintConv => {
'Manual' => 'Manuelle',
'Off' => 'Désactivé',
},
},
'CommanderGroupBMode' => {
PrintConv => {
'Manual' => 'Manuelle',
'Off' => 'Désactivé',
},
},
'CommanderInternalFlash' => {
PrintConv => {
'Manual' => 'Manuelle',
'Off' => 'Désactivé',
},
},
'Comment' => 'Commentaire',
'Comments' => 'Commentaires',
'Compilation' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'ComponentsConfiguration' => 'Signification de chaque composante',
'CompressedBitsPerPixel' => 'Mode de compression d\'image',
'Compression' => {
Description => 'Schéma de compression',
PrintConv => {
'Epson ERF Compressed' => 'Compression Epson ERF',
'JBIG Color' => 'JBIG Couleur',
'JPEG (old-style)' => 'JPEG (ancien style)',
'Kodak DCR Compressed' => 'Compression Kodak DCR',
'Kodak KDC Compressed' => 'Compression Kodak KDC',
'Next' => 'Encodage NeXT 2 bits',
'Nikon NEF Compressed' => 'Compression Nikon NEF',
'None' => 'Aucune',
'Pentax PEF Compressed' => 'Compression Pentax PEF',
'SGILog' => 'Encodage Log luminance SGI 32 bits',
'SGILog24' => 'Encodage Log luminance SGI 24 bits',
'Sony ARW Compressed' => 'Compression Sony ARW',
'Thunderscan' => 'Encodage ThunderScan 4 bits',
'Uncompressed' => 'Non compressé',
},
},
'CompressionType' => {
PrintConv => {
'None' => 'Aucune',
},
},
'ConditionalFEC' => 'Compensation exposition flash',
'ConnectionSpaceIlluminant' => 'Illuminant d\'espace de connexion',
'ConsecutiveBadFaxLines' => 'Mauvaises lignes de Fax consécutives',
'ContentLocationCode' => 'Code du lieu du contenu',
'ContentLocationName' => 'Nom du lieu du contenu',
'ContentType' => {
PrintConv => {
'Normal' => 'Normale',
},
},
'ContinuousDrive' => {
PrintConv => {
'Movie' => 'Vidéo',
},
},
'ContinuousShootingSpeed' => {
Description => 'Vitesse de prise de vues en continu',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activée',
},
},
'ContinuousShotLimit' => {
Description => 'Limiter nombre de vues en continu',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activée',
},
},
'Contrast' => {
Description => 'Contraste',
PrintConv => {
'High' => 'Dur',
'Low' => 'Doux',
'Med High' => 'Assez fort',
'Med Low' => 'Assez faible',
'Normal' => 'Normale',
'Very High' => 'Très fort',
'Very Low' => 'Très faible',
},
},
'Contributor' => 'Contributeur',
'ControlMode' => {
PrintConv => {
'n/a' => 'Non établie',
},
},
'ConversionLens' => {
PrintConv => {
'Off' => 'Désactivé',
},
},
'Copyright' => 'Propriétaire du copyright',
'CopyrightNotice' => 'Mention de copyright',
'CopyrightStatus' => {
PrintConv => {
'Unknown' => 'Inconnu',
},
},
'Country' => 'Pays',
'Country-PrimaryLocationCode' => 'Code de pays ISO',
'Country-PrimaryLocationName' => 'Pays',
'CountryCode' => 'Code pays',
'Coverage' => 'Couverture',
'CreateDate' => 'Date de la création des données numériques',
'CreationDate' => 'Date de création',
'Creator' => 'Créateur',
'CreatorAddress' => 'Adresse du créateur',
'CreatorCity' => 'Lieu d\'Habitation du créateur',
'CreatorCountry' => 'Pays du créateur',
'CreatorPostalCode' => 'Code postal du créateur',
'CreatorRegion' => 'Région du créateur',
'CreatorTool' => 'Outil de création',
'CreatorWorkEmail' => 'Courriel professionnel du créateur',
'CreatorWorkTelephone' => 'Téléphone professionnel créateur',
'CreatorWorkURL' => 'URL professionnelle du créateur',
'Credit' => 'Fournisseur',
'CropActive' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'CropUnit' => {
PrintConv => {
'inches' => 'Pouce',
},
},
'CropUnits' => {
PrintConv => {
'inches' => 'Pouce',
},
},
'CurrentICCProfile' => 'Profil ICC actuel',
'CurrentIPTCDigest' => 'Sommaire courant IPTC',
'CurrentPreProfileMatrix' => 'Matrice de pré-profil actuelle',
'Curves' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'CustomRendered' => {
Description => 'Traitement d\'image personnalisé',
PrintConv => {
'Custom' => 'Traitement personnalisé',
'Normal' => 'Traitement normal',
},
},
'D-LightingHQ' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'D-LightingHQSelected' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'D-LightingHS' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'DNGBackwardVersion' => 'Version DNG antérieure',
'DNGLensInfo' => 'Distance focale minimale',
'DNGVersion' => 'Version DNG',
'DOF' => 'Profondeur de champ',
'DSPFirmwareVersion' => 'Version de firmware de DSP',
'DataCompressionMethod' => 'Fournisseur/propriétaire de l\'algorithme de compression de données',
'DataDump' => 'Vidage données',
'DataImprint' => {
PrintConv => {
'None' => 'Aucune',
'Text' => 'Texte',
},
},
'DataType' => 'Type de données',
'DateCreated' => 'Date de création',
'DateSent' => 'Date d\'envoi',
'DateStampMode' => {
PrintConv => {
'Date & Time' => 'Date et heure',
'Off' => 'Désactivé',
},
},
'DateTime' => 'Date de modification du fichier',
'DateTimeCreated' => 'Date/heure de création',
'DateTimeDigitized' => 'Date/heure de la numérisation',
'DateTimeOriginal' => 'Date de la création des données originales',
'DaylightSavings' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'DefaultCropOrigin' => 'Origine de rognage par défaut',
'DefaultCropSize' => 'Taille de rognage par défaut',
'DefaultScale' => 'Echelle par défaut',
'DestinationCity' => 'Ville de destination',
'DestinationCityCode' => 'Code ville de destination',
'DestinationDST' => {
Description => 'Heure d\'été de destination',
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'DeviceAttributes' => 'Attributs d\'appareil',
'DeviceManufacturer' => 'Fabricant de l\'appareil',
'DeviceMfgDesc' => 'Description du fabricant d\'appareil',
'DeviceModel' => 'Modèle de l\'appareil',
'DeviceModelDesc' => 'Description du modèle d\'appareil',
'DeviceSettingDescription' => 'Description des réglages du dispositif',
'DialDirectionTvAv' => {
Description => 'Drehung Wählrad bei Tv/Av',
PrintConv => {
'Normal' => 'Normale',
'Reversed' => 'Sens inversé',
},
},
'DigitalCreationDate' => 'Date de numérisation',
'DigitalCreationTime' => 'Heure de numérisation',
'DigitalImageGUID' => 'GUID de l\'image numérique',
'DigitalSourceFileType' => 'Type de fichier de la source numérique',
'DigitalZoom' => {
Description => 'Zoom numérique',
PrintConv => {
'None' => 'Aucune',
'Off' => 'Désactivé',
},
},
'DigitalZoomOn' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'DigitalZoomRatio' => 'Rapport de zoom numérique',
'Directory' => 'Dossier',
'DisplaySize' => {
PrintConv => {
'Normal' => 'Normale',
},
},
'DisplayUnits' => {
PrintConv => {
'inches' => 'Pouce',
},
},
'DisplayXResolutionUnit' => {
PrintConv => {
'um' => 'µm (micromètre)',
},
},
'DisplayYResolutionUnit' => {
PrintConv => {
'um' => 'µm (micromètre)',
},
},
'DisplayedUnitsX' => {
PrintConv => {
'inches' => 'Pouce',
},
},
'DisplayedUnitsY' => {
PrintConv => {
'inches' => 'Pouce',
},
},
'DistortionCorrection' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'DistortionCorrection2' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'DjVuVersion' => 'Version DjVu',
'DocumentHistory' => 'Historique du document',
'DocumentName' => 'Nom du document',
'DocumentNotes' => 'Remarques sur le document',
'DotRange' => 'Étendue de points',
'DriveMode' => {
Description => 'Mode de prise de vue',
PrintConv => {
'Burst' => 'Rafale',
'Continuous' => 'Continu',
'Continuous (Hi)' => 'Continu (ultrarapide)',
'Continuous shooting' => 'Prise de vues en continu',
'Multiple Exposure' => 'Exposition multiple',
'No Timer' => 'Pas de retardateur',
'Off' => 'Désactivé',
'Remote Control' => 'Télécommande',
'Remote Control (3 s delay)' => 'Télécommande (retard 3 s)',
'Self-timer (12 s)' => 'Retardateur (12 s)',
'Self-timer (2 s)' => 'Retardateur (2 s)',
'Self-timer Operation' => 'Retardateur',
'Shutter Button' => 'Déclencheur',
'Single Exposure' => 'Exposition unique',
'Single-frame' => 'Vue par vue',
'Single-frame shooting' => 'Prise de vue unique',
},
},
'DriveMode2' => {
Description => 'Exposition multiple',
PrintConv => {
'Single-frame' => 'Vue par vue',
},
},
'Duration' => 'Durée',
'DynamicRangeExpansion' => {
Description => 'Expansion de la dynamique',
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'DynamicRangeOptimizer' => {
PrintConv => {
'Off' => 'Désactivé',
},
},
'E-DialInProgram' => {
PrintConv => {
'P Shift' => 'Décalage P',
'Tv or Av' => 'Tv ou Av',
},
},
'ETTLII' => {
PrintConv => {
'Average' => 'Moyenne',
'Evaluative' => 'Évaluative',
},
},
'EVSteps' => {
Description => 'Pas IL',
PrintConv => {
'1/2 EV Steps' => 'Pas de 1/2 IL',
'1/2 EV steps' => 'Pas de 1/2 IL',
'1/3 EV Steps' => 'Pas de 1/3 IL',
'1/3 EV steps' => 'Pas de 1/3 IL',
},
},
'EasyExposureCompensation' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'EasyMode' => {
PrintConv => {
'Beach' => 'Plage',
'Color Accent' => 'Couleur contrastée',
'Color Swap' => 'Permuter couleur',
'Fireworks' => 'Feu d\'artifice',
'Foliage' => 'Feuillages',
'Indoor' => 'Intérieur',
'Kids & Pets' => 'Enfants & animaux',
'Landscape' => 'Paysage',
'Manual' => 'Manuelle',
'Night' => 'Scène de nuit',
'Night Snapshot' => 'Mode Nuit',
'Snow' => 'Neige',
'Sports' => 'Sport',
'Super Macro' => 'Super macro',
'Underwater' => 'Sous-marin',
},
},
'EdgeNoiseReduction' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'EditStatus' => 'Statut d\'édition',
'EditorialUpdate' => {
Description => 'Mise à jour éditoriale',
PrintConv => {
'Additional language' => 'Langues supplémentaires',
},
},
'EffectiveLV' => 'Indice de lumination effectif',
'Emphasis' => {
PrintConv => {
'None' => 'Aucune',
},
},
'EncodingProcess' => {
Description => 'Procédé de codage',
PrintConv => {
'Baseline DCT, Huffman coding' => 'Baseline DCT, codage Huffman',
'Extended sequential DCT, Huffman coding' => 'Extended sequential DCT, codage Huffman',
'Extended sequential DCT, arithmetic coding' => 'Extended sequential DCT, codage arithmétique',
'Lossless, Differential Huffman coding' => 'Lossless, codage Huffman différentiel',
'Lossless, Huffman coding' => 'Lossless, codage Huffman',
'Lossless, arithmetic coding' => 'Lossless, codage arithmétique',
'Lossless, differential arithmetic coding' => 'Lossless, codage arithmétique différentiel',
'Progressive DCT, Huffman coding' => 'Progressive DCT, codage Huffman',
'Progressive DCT, arithmetic coding' => 'Progressive DCT, codage arithmétique',
'Progressive DCT, differential Huffman coding' => 'Progressive DCT, codage Huffman différentiel',
'Progressive DCT, differential arithmetic coding' => 'Progressive DCT, codage arithmétique différentiel',
'Sequential DCT, differential Huffman coding' => 'Sequential DCT, codage Huffman différentiel',
'Sequential DCT, differential arithmetic coding' => 'Sequential DCT, codage arithmétique différentiel',
},
},
'Encryption' => 'Chiffrage',
'EndPoints' => 'Points de terminaison',
'EnhanceDarkTones' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'Enhancement' => {
PrintConv => {
'Blue' => 'Bleu',
'Green' => 'Vert',
'Off' => 'Désactivé',
'Red' => 'Rouge',
},
},
'EnvelopeNumber' => 'Numéro d\'enveloppe',
'EnvelopePriority' => {
Description => 'Priorité d\'enveloppe',
PrintConv => {
'0 (reserved)' => '0 (réservé pour utilisation future)',
'1 (most urgent)' => '1 (très urgent)',
'5 (normal urgency)' => '5 (normalement urgent)',
'8 (least urgent)' => '8 (moins urgent)',
'9 (user-defined priority)' => '9 (priorité définie par l\'utilisateur)',
},
},
'EnvelopeRecordVersion' => 'Version d\'enregistrement',
'Error' => 'Erreur',
'Event' => 'Evenement',
'ExcursionTolerance' => {
Description => 'Tolérance d\'excursion ',
PrintConv => {
'Allowed' => 'Possible',
'Not Allowed' => 'Non permis (défaut)',
},
},
'ExifByteOrder' => 'Indicateur d\'ordre des octets Exif',
'ExifCameraInfo' => 'Info d\'appareil photo Exif',
'ExifImageHeight' => 'Hauteur d\'image',
'ExifImageWidth' => 'Largeur d\'image',
'ExifToolVersion' => 'Version ExifTool',
'ExifUnicodeByteOrder' => 'Indicateur d\'ordre des octets Unicode Exif',
'ExifVersion' => 'Version Exif',
'ExpandFilm' => 'Extension film',
'ExpandFilterLens' => 'Extension lentille filtre',
'ExpandFlashLamp' => 'Extension lampe flash',
'ExpandLens' => 'Extension objectif',
'ExpandScanner' => 'Extension Scanner',
'ExpandSoftware' => 'Extension logiciel',
'ExpirationDate' => 'Date d\'expiration',
'ExpirationTime' => 'Heure d\'expiration',
'ExposureBracketStepSize' => 'Intervalle de bracketing d\'exposition',
'ExposureCompensation' => 'Décalage d\'exposition',
'ExposureDelayMode' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ExposureIndex' => 'Indice d\'exposition',
'ExposureLevelIncrements' => {
Description => 'Paliers de réglage d\'expo',
PrintConv => {
'1-stop set, 1/3-stop comp.' => 'Réglage 1 valeur, correction 1/3 val.',
'1/2 Stop' => 'Palier 1/2',
'1/2-stop set, 1/2-stop comp.' => 'Réglage 1/2 valeur, correction 1/2 val.',
'1/3 Stop' => 'Palier 1/3',
'1/3-stop set, 1/3-stop comp.' => 'Réglage 1/3 valeur, correction 1/3 val.',
},
},
'ExposureMode' => {
Description => 'Mode d\'exposition',
PrintConv => {
'Aperture Priority' => 'Priorité ouverture',
'Aperture-priority AE' => 'Priorité ouverture',
'Auto' => 'Exposition automatique',
'Auto bracket' => 'Bracketting auto',
'Bulb' => 'Pose B',
'Landscape' => 'Paysage',
'Manual' => 'Exposition manuelle',
'Night Scene' => 'Nocturne',
'Shutter Priority' => 'Priorité vitesse',
'Shutter speed priority AE' => 'Priorité vitesse',
},
},
'ExposureModeInManual' => {
Description => 'Mode d\'exposition manuelle',
PrintConv => {
'Center-weighted average' => 'Centrale pondérée',
'Evaluative metering' => 'Mesure évaluativ',
'Partial metering' => 'Partielle',
'Specified metering mode' => 'Mode de mesure spécifié',
'Spot metering' => 'Spot',
},
},
'ExposureProgram' => {
Description => 'Programme d\'exposition',
PrintConv => {
'Action (High speed)' => 'Programme action (orienté grandes vitesses d\'obturation)',
'Aperture Priority' => 'Priorité ouverture',
'Aperture-priority AE' => 'Priorité ouverture',
'Creative (Slow speed)' => 'Programme créatif (orienté profondeur de champ)',
'Landscape' => 'Mode paysage',
'Manual' => 'Manuel',
'Not Defined' => 'Non défini',
'Portrait' => 'Mode portrait',
'Program AE' => 'Programme normal',
'Shutter Priority' => 'Priorité vitesse',
'Shutter speed priority AE' => 'Priorité vitesse',
},
},
'ExposureTime' => 'Temps de pose',
'ExposureTime2' => 'Temps de pose 2',
'ExtendedWBDetect' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ExtenderStatus' => {
PrintConv => {
'Attached' => 'Attaché',
'Not attached' => 'Non attaché',
'Removed' => 'Retiré',
},
},
'ExternalFlash' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ExternalFlashBounce' => {
Description => 'Réflexion flash externe',
PrintConv => {
'Bounce' => 'Avec réflecteur',
'No' => 'Non',
'Yes' => 'Oui',
'n/a' => 'Non établie',
},
},
'ExternalFlashExposureComp' => {
Description => 'Compensation d\'exposition flash externe',
PrintConv => {
'-0.5' => '-0.5 IL',
'-1.0' => '-1.0 IL',
'-1.5' => '-1.5 IL',
'-2.0' => '-2.0 IL',
'-2.5' => '-2.5 IL',
'-3.0' => '-3.0 IL',
'0.0' => '0.0 IL',
'0.5' => '0.5 IL',
'1.0' => '1.0 IL',
'n/a' => 'Non établie (éteint ou modes auto)',
'n/a (Manual Mode)' => 'Non établie (mode manuel)',
},
},
'ExternalFlashMode' => {
Description => 'Segment de mesure flash esclave 3',
PrintConv => {
'Off' => 'Désactivé',
'On, Auto' => 'En service, auto',
'On, Contrast-control Sync' => 'En service, synchro contrôle des contrastes',
'On, Flash Problem' => 'En service, problème de flash',
'On, High-speed Sync' => 'En service, synchro haute vitesse',
'On, Manual' => 'En service, manuel',
'On, P-TTL Auto' => 'En service, auto P-TTL',
'On, Wireless' => 'En service, sans cordon',
'On, Wireless, High-speed Sync' => 'En service, sans cordon, synchro haute vitesse',
'n/a - Off-Auto-Aperture' => 'N/c - auto-diaph hors service',
},
},
'ExtraSamples' => 'Echantillons supplémentaires',
'FNumber' => 'Nombre F',
'FOV' => 'Champ de vision',
'FastSeek' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'FaxProfile' => {
PrintConv => {
'Unknown' => 'Inconnu',
},
},
'FaxRecvParams' => 'Paramètres de réception Fax',
'FaxRecvTime' => 'Temps de réception Fax',
'FaxSubAddress' => 'Sous-adresse Fax',
'FileFormat' => 'Format de fichier',
'FileModifyDate' => 'Date/heure de modification du fichier',
'FileName' => 'Nom de fichier',
'FileNumber' => 'Numéro de fichier',
'FileNumberMemory' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'FileNumberSequence' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'FileSize' => 'Taille du fichier',
'FileSource' => {
Description => 'Source du fichier',
PrintConv => {
'Digital Camera' => 'Appareil photo numérique',
'Film Scanner' => 'Scanner de film',
'Reflection Print Scanner' => 'Scanner par réflexion',
},
},
'FileType' => 'Type de fichier',
'FileVersion' => 'Version de format de fichier',
'FillFlashAutoReduction' => {
Description => 'Mesure E-TTL',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activé',
},
},
'FillOrder' => {
Description => 'Ordre de remplissage',
PrintConv => {
'Normal' => 'Normale',
},
},
'Filter' => {
PrintConv => {
'Off' => 'Désactivé',
},
},
'FilterEffect' => {
Description => 'Effet de filtre',
PrintConv => {
'Green' => 'Vert',
'None' => 'Aucune',
'Off' => 'Désactivé',
'Red' => 'Rouge',
'Yellow' => 'Jaune',
'n/a' => 'Non établie',
},
},
'FilterEffectMonochrome' => {
PrintConv => {
'Green' => 'Vert',
'None' => 'Aucune',
'Red' => 'Rouge',
'Yellow' => 'Jaune',
},
},
'FinderDisplayDuringExposure' => {
Description => 'Affich. viseur pendant expo.',
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'FirmwareVersion' => 'Version de firmware',
'FixtureIdentifier' => 'Identificateur d\'installation',
'Flash' => {
PrintConv => {
'Auto, Did not fire' => 'Flash non déclenché, mode auto',
'Auto, Did not fire, Red-eye reduction' => 'Auto, flash non déclenché, mode réduction yeux rouges',
'Auto, Fired' => 'Flash déclenché, mode auto',
'Auto, Fired, Red-eye reduction' => 'Flash déclenché, mode auto, mode réduction yeux rouges, lumière renvoyée détectée',
'Auto, Fired, Red-eye reduction, Return detected' => 'Flash déclenché, mode auto, lumière renvoyée détectée, mode réduction yeux rouges',
'Auto, Fired, Red-eye reduction, Return not detected' => 'Flash déclenché, mode auto, lumière renvoyée non détectée, mode réduction yeux rouges',
'Auto, Fired, Return detected' => 'Flash déclenché, mode auto, lumière renvoyée détectée',
'Auto, Fired, Return not detected' => 'Flash déclenché, mode auto, lumière renvoyée non détectée',
'Did not fire' => 'Flash non déclenché',
'Fired' => 'Flash déclenché',
'Fired, Red-eye reduction' => 'Flash déclenché, mode réduction yeux rouges',
'Fired, Red-eye reduction, Return detected' => 'Flash déclenché, mode réduction yeux rouges, lumière renvoyée détectée',
'Fired, Red-eye reduction, Return not detected' => 'Flash déclenché, mode réduction yeux rouges, lumière renvoyée non détectée',
'Fired, Return detected' => 'Lumière renvoyée sur le capteur détectée',
'Fired, Return not detected' => 'Lumière renvoyée sur le capteur non détectée',
'No Flash' => 'Flash non déclenché',
'No flash function' => 'Pas de fonction flash',
'Off' => 'Désactivé',
'Off, Did not fire' => 'Flash non déclenché, mode flash forcé',
'Off, Did not fire, Return not detected' => 'Éteint, flash non déclenché, lumière renvoyée non détectée',
'Off, No flash function' => 'Éteint, pas de fonction flash',
'Off, Red-eye reduction' => 'Éteint, mode réduction yeux rouges',
'On' => 'Activé',
'On, Did not fire' => 'Hors service, flash non déclenché',
'On, Fired' => 'Flash déclenché, mode flash forcé',
'On, Red-eye reduction' => 'Flash déclenché, mode forcé, mode réduction yeux rouges',
'On, Red-eye reduction, Return detected' => 'Flash déclenché, mode forcé, mode réduction yeux rouges, lumière renvoyée détectée',
'On, Red-eye reduction, Return not detected' => 'Flash déclenché, mode forcé, mode réduction yeux rouges, lumière renvoyée non détectée',
'On, Return detected' => 'Flash déclenché, mode flash forcé, lumière renvoyée détectée',
'On, Return not detected' => 'Flash déclenché, mode flash forcé, lumière renvoyée non détectée',
},
},
'FlashCommanderMode' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'FlashCompensation' => 'Compensation flash',
'FlashControlMode' => {
PrintConv => {
'Manual' => 'Manuelle',
'Off' => 'Désactivé',
},
},
'FlashDevice' => {
PrintConv => {
'None' => 'Aucune',
},
},
'FlashEnergy' => 'Énergie du flash',
'FlashExposureComp' => 'Compensation d\'exposition au flash',
'FlashExposureCompSet' => 'Réglage de compensation d\'exposition au flash',
'FlashExposureLock' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'FlashFired' => {
Description => 'Flash utilisé',
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'FlashFiring' => {
Description => 'Émission de l\'éclair',
PrintConv => {
'Does not fire' => 'Désactivé',
'Fires' => 'Activé',
},
},
'FlashFunction' => 'Fonction flash',
'FlashGroupAControlMode' => {
PrintConv => {
'Manual' => 'Manuelle',
'Off' => 'Désactivé',
},
},
'FlashGroupBControlMode' => {
PrintConv => {
'Manual' => 'Manuelle',
'Off' => 'Désactivé',
},
},
'FlashGroupCControlMode' => {
PrintConv => {
'Manual' => 'Manuelle',
'Off' => 'Désactivé',
},
},
'FlashIntensity' => {
PrintConv => {
'High' => 'Haut',
'Low' => 'Bas',
'Normal' => 'Normale',
'Strong' => 'Forte',
},
},
'FlashMeteringSegments' => 'Segments de mesure flash',
'FlashMode' => {
Description => 'Mode flash',
PrintConv => {
'Auto, Did not fire' => 'Auto, non déclenché',
'Auto, Did not fire, Red-eye reduction' => 'Auto, non déclenché, réduction yeux rouges',
'Auto, Fired' => 'Auto, déclenché',
'Auto, Fired, Red-eye reduction' => 'Auto, déclenché, réduction yeux rouges',
'External, Auto' => 'Externe, auto',
'External, Contrast-control Sync' => 'Externe, synchro contrôle des contrastes',
'External, Flash Problem' => 'Externe, problème de flash ?',
'External, High-speed Sync' => 'Externe, synchro haute vitesse',
'External, Manual' => 'Externe, manuel',
'External, P-TTL Auto' => 'Externe, P-TTL',
'External, Wireless' => 'Externe, sans cordon',
'External, Wireless, High-speed Sync' => 'Externe, sans cordon, synchro haute vitesse',
'Internal' => 'Interne',
'Normal' => 'Normale',
'Off' => 'Désactivé',
'Off, Did not fire' => 'Hors service',
'On' => 'Activé',
'On, Did not fire' => 'En service, non déclenché',
'On, Fired' => 'En service',
'On, Red-eye reduction' => 'En service, réduction yeux rouges',
'On, Slow-sync' => 'En service, synchro lente',
'On, Slow-sync, Red-eye reduction' => 'En service, synchro lente, réduction yeux rouges',
'On, Soft' => 'En service, doux',
'On, Trailing-curtain Sync' => 'En service, synchro 2e rideau',
'On, Wireless (Control)' => 'En service, sans cordon (esclave)',
'On, Wireless (Master)' => 'En service, sans cordon (maître)',
'Red-eye Reduction' => 'Réduction yeux rouges',
'Red-eye reduction' => 'Réduction yeux rouges',
'Unknown' => 'Inconnu',
'n/a - Off-Auto-Aperture' => 'N/c - auto-diaph hors service',
},
},
'FlashModel' => {
PrintConv => {
'None' => 'Aucune',
},
},
'FlashOptions' => {
Description => 'Options de flash',
PrintConv => {
'Auto, Red-eye reduction' => 'Auto, réduction yeux rouges',
'Normal' => 'Normale',
'Red-eye reduction' => 'Réduction yeux rouges',
'Slow-sync' => 'Synchro lente',
'Slow-sync, Red-eye reduction' => 'Synchro lente, réduction yeux rouges',
'Trailing-curtain Sync' => 'Synchro 2e rideau',
'Wireless (Control)' => 'Sans cordon (contrôleur)',
'Wireless (Master)' => 'Sans cordon (maître)',
},
},
'FlashOptions2' => {
Description => 'Options de flash (2)',
PrintConv => {
'Auto, Red-eye reduction' => 'Auto, réduction yeux rouges',
'Normal' => 'Normale',
'Red-eye reduction' => 'Réduction yeux rouges',
'Slow-sync' => 'Synchro lente',
'Slow-sync, Red-eye reduction' => 'Synchro lente, réduction yeux rouges',
'Trailing-curtain Sync' => 'Synchro 2e rideau',
'Wireless (Control)' => 'Sans cordon (contrôleur)',
'Wireless (Master)' => 'Sans cordon (maître)',
},
},
'FlashRedEyeMode' => 'Flash mode anti-yeux rouges',
'FlashReturn' => {
PrintConv => {
'No return detection' => 'Pas de détection de retour',
'Return detected' => 'Retour détecté',
'Return not detected' => 'Retour non détecté',
},
},
'FlashStatus' => {
Description => 'Segment de mesure flash esclave 1',
PrintConv => {
'External, Did not fire' => 'Externe, non déclenché',
'External, Fired' => 'Externe, déclenché',
'Internal, Did not fire' => 'Interne, non déclenché',
'Internal, Fired' => 'Interne, déclenché',
'Off' => 'Désactivé',
},
},
'FlashSyncSpeedAv' => {
Description => 'Vitesse synchro en mode Av',
PrintConv => {
'1/200 Fixed' => '1/200 fixe',
'1/250 Fixed' => '1/250 fixe',
'1/300 Fixed' => '1/300 fixe',
},
},
'FlashType' => {
Description => 'Type de flash',
PrintConv => {
'Built-In Flash' => 'Intégré',
'External' => 'Externe',
'None' => 'Aucune',
},
},
'FlashWarning' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'FlashpixVersion' => 'Version Flashpix supportée',
'FlickerReduce' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'FlipHorizontal' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'FocalLength' => 'Focale de l\'objectif',
'FocalLength35efl' => 'Focale de l\'objectif',
'FocalLengthIn35mmFormat' => 'Distance focale sur film 35 mm',
'FocalPlaneResolutionUnit' => {
Description => 'Unité de résolution de plan focal',
PrintConv => {
'None' => 'Aucune',
'inches' => 'Pouce',
'um' => 'µm (micromètre)',
},
},
'FocalPlaneXResolution' => 'Résolution X du plan focal',
'FocalPlaneYResolution' => 'Résolution Y du plan focal',
'Focus' => {
PrintConv => {
'Manual' => 'Manuelle',
},
},
'FocusContinuous' => {
PrintConv => {
'Manual' => 'Manuelle',
},
},
'FocusMode' => {
Description => 'Mode mise au point',
PrintConv => {
'AF-C' => 'AF-C (prise de vue en rafale)',
'AF-S' => 'AF-S (prise de vue unique)',
'Infinity' => 'Infini',
'Manual' => 'Manuelle',
'Normal' => 'Normale',
'Pan Focus' => 'Hyperfocale',
},
},
'FocusMode2' => {
Description => 'Mode mise au point 2',
PrintConv => {
'AF-C' => 'AF-C (prise de vue en rafale)',
'AF-S' => 'AF-S (prise de vue unique)',
'Manual' => 'Manuelle',
},
},
'FocusModeSetting' => {
PrintConv => {
'AF-C' => 'AF-C (prise de vue en rafale)',
'AF-S' => 'AF-S (prise de vue unique)',
'Manual' => 'Manuelle',
},
},
'FocusPosition' => 'Distance de mise au point',
'FocusRange' => {
PrintConv => {
'Infinity' => 'Infini',
'Manual' => 'Manuelle',
'Normal' => 'Normale',
'Pan Focus' => 'Hyperfocale',
'Super Macro' => 'Super macro',
},
},
'FocusTrackingLockOn' => {
PrintConv => {
'Normal' => 'Normale',
'Off' => 'Désactivé',
},
},
'FocusingScreen' => 'Verre de visée',
'ForwardMatrix1' => 'Matrice forward 1',
'ForwardMatrix2' => 'Matrice forward 2',
'FrameNumber' => 'Numéro de vue',
'FreeByteCounts' => 'Nombre d\'octets libres',
'FreeOffsets' => 'Offsets libres',
'FujiFlashMode' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
'Red-eye reduction' => 'Réduction yeux rouges',
},
},
'GIFVersion' => 'Version GIF',
'GPSAltitude' => 'Altitude',
'GPSAltitudeRef' => {
Description => 'Référence d\'altitude',
PrintConv => {
'Above Sea Level' => 'Au-dessus du niveau de la mer',
'Below Sea Level' => 'En-dessous du niveau de la mer',
},
},
'GPSAreaInformation' => 'Nom de la zone GPS',
'GPSDOP' => 'Précision de mesure',
'GPSDateStamp' => 'Date GPS',
'GPSDateTime' => 'Heure GPS (horloge atomique)',
'GPSDestBearing' => 'Orientation de la destination',
'GPSDestBearingRef' => {
Description => 'Référence de l\'orientation de la destination',
PrintConv => {
'Magnetic North' => 'Nord magnétique',
'True North' => 'Direction vraie',
},
},
'GPSDestDistance' => 'Distance à la destination',
'GPSDestDistanceRef' => {
Description => 'Référence de la distance à la destination',
PrintConv => {
'Kilometers' => 'Kilomètres',
'Nautical Miles' => 'Noeuds',
},
},
'GPSDestLatitude' => 'Latitude de destination',
'GPSDestLatitudeRef' => {
Description => 'Référence de la latitude de destination',
PrintConv => {
'North' => 'Latitude nord',
'South' => 'Latitude sud',
},
},
'GPSDestLongitude' => 'Longitude de destination',
'GPSDestLongitudeRef' => {
Description => 'Référence de la longitude de destination',
PrintConv => {
'East' => 'Longitude est',
'West' => 'Longitude ouest',
},
},
'GPSDifferential' => {
Description => 'Correction différentielle GPS',
PrintConv => {
'Differential Corrected' => 'Correction différentielle appliquée',
'No Correction' => 'Mesure sans correction différentielle',
},
},
'GPSImgDirection' => 'Direction de l\'image',
'GPSImgDirectionRef' => {
Description => 'Référence pour la direction l\'image',
PrintConv => {
'Magnetic North' => 'Direction magnétique',
'True North' => 'Direction vraie',
},
},
'GPSLatitude' => 'Latitude',
'GPSLatitudeRef' => {
Description => 'Latitude nord ou sud',
PrintConv => {
'North' => 'Latitude nord',
'South' => 'Latitude sud',
},
},
'GPSLongitude' => 'Longitude',
'GPSLongitudeRef' => {
Description => 'Longitude est ou ouest',
PrintConv => {
'East' => 'Longitude est',
'West' => 'Longitude ouest',
},
},
'GPSMapDatum' => 'Données de surveillance géodésique utilisées',
'GPSMeasureMode' => {
Description => 'Mode de mesure GPS',
PrintConv => {
'2-D' => 'Mesure à deux dimensions',
'2-Dimensional' => 'Mesure à deux dimensions',
'2-Dimensional Measurement' => 'Mesure à deux dimensions',
'3-D' => 'Mesure à trois dimensions',
'3-Dimensional' => 'Mesure à trois dimensions',
'3-Dimensional Measurement' => 'Mesure à trois dimensions',
},
},
'GPSPosition' => 'Position GPS',
'GPSProcessingMethod' => 'Nom de la méthode de traitement GPS',
'GPSSatellites' => 'Satellites GPS utilisés pour la mesure',
'GPSSpeed' => 'Vitesse du récepteur GPS',
'GPSSpeedRef' => {
Description => 'Unité de vitesse',
PrintConv => {
'km/h' => 'Kilomètres par heure',
'knots' => 'Noeuds',
'mph' => 'Miles par heure',
},
},
'GPSStatus' => {
Description => 'État du récepteur GPS',
PrintConv => {
'Measurement Active' => 'Mesure active',
'Measurement Void' => 'Mesure vide',
},
},
'GPSTimeStamp' => 'Heure GPS (horloge atomique)',
'GPSTrack' => 'Direction de déplacement',
'GPSTrackRef' => {
Description => 'Référence pour la direction de déplacement',
PrintConv => {
'Magnetic North' => 'Direction magnétique',
'True North' => 'Direction vraie',
},
},
'GPSVersionID' => 'Version de tag GPS',
'GainControl' => {
Description => 'Contrôle de gain',
PrintConv => {
'High gain down' => 'Forte atténuation',
'High gain up' => 'Fort gain',
'Low gain down' => 'Faible atténuation',
'Low gain up' => 'Faible gain',
'None' => 'Aucune',
},
},
'GammaCompensatedValue' => 'Valeur de compensation gamma',
'Gapless' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'GeoTiffAsciiParams' => 'Tag de paramètres Ascii GeoTiff',
'GeoTiffDirectory' => 'Tag de répertoire de clé GeoTiff',
'GeoTiffDoubleParams' => 'Tag de paramètres doubles GeoTiff',
'GrayResponseCurve' => 'Courbe de réponse du gris',
'GrayResponseUnit' => {
Description => 'Unité de réponse en gris',
PrintConv => {
'0.0001' => 'Le nombre représente des millièmes d\'unité',
'0.001' => 'Le nombre représente des centièmes d\'unité',
'0.1' => 'Le nombre représente des dixièmes d\'unité',
'1e-05' => 'Le nombre représente des dix-millièmes d\'unité',
'1e-06' => 'Le nombre représente des cent-millièmes d\'unité',
},
},
'GrayTRC' => 'Courbe de reproduction des tons gris',
'GreenMatrixColumn' => 'Colonne de matrice verte',
'GreenTRC' => 'Courbe de reproduction des tons verts',
'GridDisplay' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'HCUsage' => 'Usage HC',
'HalftoneHints' => 'Indications sur les demi-treintes',
'Headline' => 'Titre principal',
'HighISONoiseReduction' => {
Description => 'Réduction du bruit en haute sensibilité ISO',
PrintConv => {
'Disable' => 'Désactivé',
'Low' => 'Bas',
'Normal' => 'Normale',
'Off' => 'Désactivé',
'On' => 'Activé',
'Strong' => 'Importante',
'Weak' => 'Faible',
'Weakest' => 'La plus faible',
},
},
'HighlightTonePriority' => {
Description => 'Priorité hautes lumières',
PrintConv => {
'Disable' => 'Désactivée',
'Enable' => 'Activée',
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'History' => 'Récapitulatif',
'HometownCity' => 'Ville de résidence',
'HometownCityCode' => 'Code ville de résidence',
'HometownDST' => {
Description => 'Heure d\'été de résidence',
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'HostComputer' => 'Ordinateur hôte',
'HyperfocalDistance' => 'Distanace hyperfocale',
'ICCProfileName' => 'Nom du profil ICC',
'ICC_Profile' => 'Profil de couleur ICC d\'entrée',
'ID3Size' => 'Taille ID3',
'IPTC-NAA' => 'Métadonnées IPTC-NAA',
'IPTCBitsPerSample' => 'Nombre de bits par échantillon',
'IPTCImageHeight' => 'Nombre de lignes',
'IPTCImageRotation' => {
Description => 'Rotation d\'image',
PrintConv => {
'0' => 'Pas de rotation',
'180' => 'Rotation de 180 degrés',
'270' => 'Rotation de 270 degrés',
'90' => 'Rotation de 90 degrés',
},
},
'IPTCImageWidth' => 'Pixels par ligne',
'IPTCPictureNumber' => 'Numéro d\'image',
'IPTCPixelHeight' => 'Taille de pixel perpendiculairement à la direction de scan',
'IPTCPixelWidth' => 'Taille de pixel dans la direction de scan',
'ISO' => 'Sensibilité ISO',
'ISOExpansion' => {
Description => 'Extension sensibilité ISO',
PrintConv => {
'Off' => 'Arrêt',
'On' => 'Marche',
},
},
'ISOExpansion2' => {
PrintConv => {
'Off' => 'Désactivé',
},
},
'ISOFloor' => 'Seuil ISO',
'ISOSetting' => {
PrintConv => {
'Manual' => 'Manuelle',
},
},
'ISOSpeedExpansion' => {
Description => 'Extension de sensibilité ISO',
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'ISOSpeedIncrements' => {
Description => 'Incréments de sensibilité ISO',
PrintConv => {
'1/3 Stop' => 'Palier 1/3',
},
},
'ISOSpeedRange' => {
Description => 'Régler l\'extension de sensibilité ISO',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activée',
},
},
'IT8Header' => 'En-tête IT8',
'Identifier' => 'Identifiant',
'Illumination' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ImageAreaOffset' => 'Décalage de zone d\'image',
'ImageAuthentication' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ImageColorIndicator' => 'Indicateur de couleur d\'image',
'ImageColorValue' => 'Valeur de couleur d\'image',
'ImageDepth' => 'Profondeur d\'image',
'ImageDescription' => 'Description d\'image',
'ImageDustOff' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ImageHeight' => 'Hauteur d\'image',
'ImageHistory' => 'Historique de l\'image',
'ImageID' => 'ID d\'image',
'ImageLayer' => 'Couche image',
'ImageNumber' => 'Numéro d\'image',
'ImageOrientation' => {
Description => 'Orientation d\'image',
PrintConv => {
'Landscape' => 'Paysage',
'Square' => 'Carré',
},
},
'ImageProcessing' => {
Description => 'Traitement de l\'image',
PrintConv => {
'Color Filter' => 'Filtre de couleur',
'Cropped' => 'Recadré',
'Digital Filter' => 'Filtre numérique',
'Frame Synthesis?' => 'Synthèse de vue ?',
'Unprocessed' => 'Aucun',
},
},
'ImageProcessingCount' => 'Compteur de traitement d\'image',
'ImageQuality' => {
PrintConv => {
'Normal' => 'Normale',
},
},
'ImageReview' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ImageRotated' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'ImageSize' => 'Taille de l\'Image',
'ImageSourceData' => 'Données source d\'image',
'ImageStabilization' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ImageTone' => {
Description => 'Ton de l\'image',
PrintConv => {
'Bright' => 'Brillant',
'Landscape' => 'Paysage',
'Natural' => 'Naturel',
},
},
'ImageType' => 'Type d\'image',
'ImageUniqueID' => 'Identificateur unique d\'image',
'ImageWidth' => 'Largeur d\'image',
'Indexed' => 'Indexé',
'InfoButtonWhenShooting' => {
Description => 'Touche INFO au déclenchement',
PrintConv => {
'Displays camera settings' => 'Affiche les réglages en cours',
'Displays shooting functions' => 'Affiche les fonctions',
},
},
'InkNames' => 'Nom des encres',
'InkSet' => 'Encrage',
'IntellectualGenre' => 'Genre intellectuel',
'IntensityStereo' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'InterchangeColorSpace' => {
PrintConv => {
'CMY (K) Device Dependent' => 'CMY(K) dépendant de l\'appareil',
'RGB Device Dependent' => 'RVB dépendant de l\'appareil',
},
},
'IntergraphMatrix' => 'Tag de matrice intergraphe',
'Interlace' => 'Entrelacement',
'InternalFlash' => {
PrintConv => {
'Fired' => 'Flash déclenché',
'Manual' => 'Manuelle',
'No' => 'Flash non déclenché',
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'InternalFlashMode' => {
Description => 'Segment de mesure flash esclave 2',
PrintConv => {
'Off, (Unknown 0xf4)' => 'Hors service (inconnue 0xF4)',
'Off, Auto' => 'Hors service, auto',
'Off, Auto, Red-eye reduction' => 'Hors service, auto, réduction yeux rouges',
'Off, Normal' => 'Hors service, normal',
'Off, Red-eye reduction' => 'Hors service, réduction yeux rouges',
'Off, Slow-sync' => 'Hors service, synchro lente',
'Off, Slow-sync, Red-eye reduction' => 'Hors service, synchro lente, réduction yeux rouges',
'Off, Trailing-curtain Sync' => 'Hors service, synchro 2e rideau',
'Off, Wireless (Control)' => 'Hors service, sans cordon (contrôleur)',
'Off, Wireless (Master)' => 'Hors service, sans cordon (maître)',
'On' => 'Activé',
'On, Auto' => 'En service, auto',
'On, Auto, Red-eye reduction' => 'En service, auto, réduction yeux rouges',
'On, Red-eye reduction' => 'En service, réduction yeux rouges',
'On, Slow-sync' => 'En service, synchro lente',
'On, Slow-sync, Red-eye reduction' => 'En service, synchro lente, réduction yeux rouges',
'On, Trailing-curtain Sync' => 'En service, synchro 2e rideau',
'On, Wireless (Control)' => 'En service, sans cordon (contrôleur)',
'On, Wireless (Master)' => 'En service, sans cordon (maître)',
'n/a - Off-Auto-Aperture' => 'N/c - auto-diaph hors service',
},
},
'InternalFlashStrength' => 'Segment de mesure flash esclave 4',
'InternalSerialNumber' => 'Numéro de série interne',
'InteropIndex' => {
Description => 'Identification d\'interopérabilité',
PrintConv => {
'R03 - DCF option file (Adobe RGB)' => 'R03: fichier d\'option DCF (Adobe RGB)',
'R98 - DCF basic file (sRGB)' => 'R98: fichier de base DCF (sRGB)',
'THM - DCF thumbnail file' => 'THM: fichier de vignette DCF',
},
},
'InteropVersion' => 'Version d\'interopérabilité',
'IptcLastEdited' => 'Derniere edition IPTC',
'JFIFVersion' => 'Version JFIF',
'JPEGACTables' => 'Tableaux AC JPEG',
'JPEGDCTables' => 'Tableaux DC JPEG',
'JPEGLosslessPredictors' => 'Prédicteurs JPEG sans perte',
'JPEGPointTransforms' => 'Transformations de point JPEG',
'JPEGProc' => 'Proc JPEG',
'JPEGQTables' => 'Tableaux Q JPEG',
'JPEGRestartInterval' => 'Intervalle de redémarrage JPEG',
'JPEGTables' => 'Tableaux JPEG',
'JobID' => 'ID de la tâche',
'JpgRecordedPixels' => {
Description => 'Pixels enregistrés JPEG',
PrintConv => {
'10 MP' => '10 Mpx',
'2 MP' => '2 Mpx',
'6 MP' => '6 Mpx',
},
},
'Keywords' => 'Mots-clés',
'LC1' => 'Données d\'objectif',
'LC10' => 'Données mv\' nv\'',
'LC11' => 'Données AVC 1/EXP',
'LC12' => 'Données mv1 Avminsif',
'LC14' => 'Données UNT_12 UNT_6',
'LC15' => 'Données d\'adaptation de flash incorporé',
'LC2' => 'Code de distance',
'LC3' => 'Valeur K',
'LC4' => 'Données de correction d\'aberration à courte distance',
'LC5' => 'Données de correction d\'aberration chromatique',
'LC6' => 'Données d\'aberration d\'ouverture',
'LC7' => 'Données de condition minimale de déclenchement AF',
'LCDDisplayAtPowerOn' => {
Description => 'Etat LCD lors de l\'allumage',
PrintConv => {
'Display' => 'Allumé',
'Retain power off status' => 'Etat précédent',
},
},
'LCDDisplayReturnToShoot' => {
Description => 'Affich. LCD -> Prise de vues',
PrintConv => {
'Also with * etc.' => 'Aussi par * etc.',
'With Shutter Button only' => 'Par déclencheur uniq.',
},
},
'LCDIllumination' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'LCDIlluminationDuringBulb' => {
Description => 'Éclairage LCD pendant pose longue',
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'LCDPanels' => {
Description => 'Ecran LCD supérieur/arrière',
PrintConv => {
'ISO/File no.' => 'ISO/No. fichier',
'ISO/Remain. shots' => 'ISO/Vues restantes',
'Remain. shots/File no.' => 'Vues restantes/No. fichier',
'Shots in folder/Remain. shots' => 'Vues dans dossier/Vues restantes',
},
},
'LCHEditor' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'Language' => 'Langage',
'LanguageIdentifier' => 'Identificateur de langue',
'LensAFStopButton' => {
Description => 'Fonct. touche AF objectif',
PrintConv => {
'AE lock' => 'Verrouillage AE',
'AE lock while metering' => 'Verr. AE posemètre actif',
'AF Stop' => 'Arrêt AF',
'AF mode: ONE SHOT <-> AI SERVO' => 'Mode AF: ONE SHOT <-> AI SERVO',
'AF point: M -> Auto / Auto -> Ctr.' => 'Colli: M -> Auto / Auto -> Ctr.',
'AF point: M->Auto/Auto->ctr' => 'Collim.AF: M->Auto/Auto->ctr',
'AF start' => 'Activation AF',
'AF stop' => 'Arrêt AF',
'IS start' => 'Activation stab. image',
'Switch to registered AF point' => 'Activer le collimateur autofocus enregistré',
},
},
'LensDriveNoAF' => {
Description => 'Pilot. obj. si AF impossible',
PrintConv => {
'Focus search off' => 'Pas de recherche du point',
'Focus search on' => 'Recherche du point',
},
},
'LensFStops' => 'Nombre de diaphs de l\'objectif',
'LensID' => 'ID Lens',
'LensInfo' => 'Infos lens',
'LensKind' => 'Sorte d\'objectif / version (LC0)',
'LensType' => 'Sorte d\'objectif',
'LicenseType' => {
PrintConv => {
'Unknown' => 'Inconnu',
},
},
'LightReading' => 'Lecture de la lumière',
'LightSource' => {
Description => 'Source de lumière',
PrintConv => {
'Cloudy' => 'Temps nuageux',
'Cool White Fluorescent' => 'Fluorescente type soft',
'Day White Fluorescent' => 'Fluorescente type blanc',
'Daylight' => 'Lumière du jour',
'Daylight Fluorescent' => 'Fluorescente type jour',
'Fine Weather' => 'Beau temps',
'Fluorescent' => 'Fluorescente',
'ISO Studio Tungsten' => 'Tungstène studio ISO',
'Other' => 'Autre source de lumière',
'Shade' => 'Ombre',
'Standard Light A' => 'Lumière standard A',
'Standard Light B' => 'Lumière standard B',
'Standard Light C' => 'Lumière standard C',
'Tungsten' => 'Tungstène (lumière incandescente)',
'Unknown' => 'Inconnue',
'White Fluorescent' => 'Fluorescent blanc',
},
},
'LightSourceSpecial' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'LightValue' => 'Luminosite',
'LinearResponseLimit' => 'Limite de réponse linéaire',
'LinearizationTable' => 'Table de linéarisation',
'Lit' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'LiveViewExposureSimulation' => {
Description => 'Simulation d\'exposition directe',
PrintConv => {
'Disable (LCD auto adjust)' => 'Désactivée (réglge écran auto)',
'Enable (simulates exposure)' => 'Activée (simulation exposition)',
},
},
'LiveViewShooting' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'LocalizedCameraModel' => 'Nom traduit de modèle d\'appareil',
'Location' => 'Ligne',
'LockMicrophoneButton' => {
Description => 'Fonction de touche microphone',
PrintConv => {
'Protect (holding:sound rec.)' => 'Protéger (maintien: enregistrement sonore)',
'Sound rec. (protect:disable)' => 'Enregistrement sonore (protéger: désactivée)',
},
},
'LongExposureNoiseReduction' => {
Description => 'Réduct. bruit longue expo.',
PrintConv => {
'Off' => 'Arrêt',
'On' => 'Marche',
},
},
'LookupTable' => 'Table de correspondance',
'LoopStyle' => {
PrintConv => {
'Normal' => 'Normale',
},
},
'LuminanceNoiseReduction' => {
PrintConv => {
'Low' => 'Bas',
'Off' => 'Désactivé',
},
},
'MIEVersion' => 'Version MIE',
'MIMEType' => 'Type MIME',
'MSStereo' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'Macro' => {
PrintConv => {
'Manual' => 'Manuelle',
'Normal' => 'Normale',
'Off' => 'Désactivé',
'On' => 'Activé',
'Super Macro' => 'Super macro',
},
},
'MacroMode' => {
PrintConv => {
'Normal' => 'Normale',
'Off' => 'Désactivé',
'On' => 'Activé',
'Super Macro' => 'Super macro',
},
},
'MagnifiedView' => {
Description => 'Agrandissement en lecture',
PrintConv => {
'Image playback only' => 'Lecture image uniquement',
'Image review and playback' => 'Aff. inst. et lecture',
},
},
'MainDialExposureComp' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'Make' => 'Fabricant',
'MakeAndModel' => 'Fabricant et modèle',
'MakerNoteSafety' => {
Description => 'Sécurité de note de fabricant',
PrintConv => {
'Safe' => 'Sûre',
'Unsafe' => 'Pas sûre',
},
},
'ManualFlashOutput' => {
PrintConv => {
'Low' => 'Bas',
'n/a' => 'Non établie',
},
},
'ManualTv' => {
Description => 'Régl. Tv/Av manuel pour exp. M',
PrintConv => {
'Tv=Control/Av=Main' => 'Tv=Contrôle rapide/Av=Principale',
'Tv=Control/Av=Main w/o lens' => 'Tv=Contrôle rapide/Av=Principale sans objectif',
'Tv=Main/Av=Control' => 'Tv=Principale/Av=Contrôle rapide',
'Tv=Main/Av=Main w/o lens' => 'Tv=Principale/Av=Contrôle rapide sans objectif',
},
},
'ManufactureDate' => 'Date de fabrication',
'Marked' => 'Marqué',
'MaskedAreas' => 'Zones masquées',
'MasterDocumentID' => 'ID du document maître',
'Matteing' => 'Matité',
'MaxAperture' => 'Données Avmin',
'MaxApertureValue' => 'Ouverture maximale de l\'objectif',
'MaxAvailHeight' => 'Hauteur max Disponible',
'MaxAvailWidth' => 'Largeur max Disponible',
'MaxSampleValue' => 'Valeur maxi d\'échantillon',
'MaxVal' => 'Valeur max',
'MaximumDensityRange' => 'Etendue maximale de densité',
'MeasurementBacking' => 'Support de mesure',
'MeasurementFlare' => 'Flare de mesure',
'MeasurementGeometry' => {
Description => 'Géométrie de mesure',
PrintConv => {
'0/45 or 45/0' => '0/45 ou 45/0',
'0/d or d/0' => '0/d ou d/0',
},
},
'MeasurementIlluminant' => 'Illuminant de mesure',
'MeasurementObserver' => 'Observateur de mesure',
'MediaBlackPoint' => 'Point noir moyen',
'MediaWhitePoint' => 'Point blanc moyen',
'MenuButtonDisplayPosition' => {
Description => 'Position début touche menu',
PrintConv => {
'Previous' => 'Précédente',
'Previous (top if power off)' => 'Précédente (Haut si dés.)',
'Top' => 'Haut',
},
},
'MenuButtonReturn' => {
PrintConv => {
'Previous' => 'Précédente',
'Top' => 'Haut',
},
},
'MetadataDate' => 'Date des metadonnées',
'MeteringMode' => {
Description => 'Mode de mesure',
PrintConv => {
'Average' => 'Moyenne',
'Center-weighted average' => 'Centrale pondérée',
'Evaluative' => 'Évaluative',
'Multi-segment' => 'Multizone',
'Other' => 'Autre',
'Partial' => 'Partielle',
'Unknown' => 'Inconnu',
},
},
'MeteringMode2' => {
Description => 'Mode de mesure 2',
PrintConv => {
'Multi-segment' => 'Multizone',
},
},
'MeteringMode3' => {
Description => 'Mode de mesure (3)',
PrintConv => {
'Multi-segment' => 'Multizone',
},
},
'MinAperture' => 'Ouverture mini',
'MinSampleValue' => 'Valeur mini d\'échantillon',
'MinoltaQuality' => {
Description => 'Qualité',
PrintConv => {
'Normal' => 'Normale',
},
},
'MirrorLockup' => {
Description => 'Verrouillage du miroir',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activé',
'Enable: Down with Set' => 'Activé: Retour par touche SET',
},
},
'ModDate' => 'Date de modification',
'Model' => 'Modèle d\'appareil photo',
'Model2' => 'Modèle d\'équipement de prise de vue (2)',
'ModelAge' => 'Age du modele',
'ModelTiePoint' => 'Tag de lien d modèle',
'ModelTransform' => 'Tag de transformation de modèle',
'ModelingFlash' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ModifiedPictureStyle' => {
PrintConv => {
'Landscape' => 'Paysage',
'None' => 'Aucune',
},
},
'ModifiedSaturation' => {
PrintConv => {
'Off' => 'Désactivé',
},
},
'ModifiedSharpnessFreq' => {
PrintConv => {
'High' => 'Haut',
'Highest' => 'Plus haut',
'Low' => 'Doux',
'n/a' => 'Non établie',
},
},
'ModifiedToneCurve' => {
PrintConv => {
'Manual' => 'Manuelle',
},
},
'ModifiedWhiteBalance' => {
PrintConv => {
'Cloudy' => 'Temps nuageux',
'Daylight' => 'Lumière du jour',
'Daylight Fluorescent' => 'Fluorescente type jour',
'Fluorescent' => 'Fluorescente',
'Shade' => 'Ombre',
'Tungsten' => 'Tungstène (lumière incandescente)',
},
},
'ModifyDate' => 'Date de modification de fichier',
'MoireFilter' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'MonochromeFilterEffect' => {
PrintConv => {
'Green' => 'Vert',
'None' => 'Aucune',
'Red' => 'Rouge',
'Yellow' => 'Jaune',
},
},
'MonochromeLinear' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'MonochromeToningEffect' => {
PrintConv => {
'Blue' => 'Bleu',
'Green' => 'Vert',
'None' => 'Aucune',
},
},
'MultiExposureAutoGain' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'MultiExposureMode' => {
PrintConv => {
'Off' => 'Désactivé',
},
},
'MultipleExposureSet' => {
Description => 'Exposition multiple',
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'Mute' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'MyColorMode' => {
PrintConv => {
'Off' => 'Désactivé',
},
},
'NDFilter' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'NEFCompression' => {
PrintConv => {
'Uncompressed' => 'Non compressé',
},
},
'Name' => 'Nom',
'NamedColor2' => 'Couleur nommée 2',
'NativeDigest' => 'Sommaire natif',
'NativeDisplayInfo' => 'Information sur l\'affichage natif',
'NewsPhotoVersion' => 'Version d\'enregistrement news photo',
'Nickname' => 'Surnom',
'Noise' => 'Bruit',
'NoiseFilter' => {
PrintConv => {
'Low' => 'Bas',
'Off' => 'Désactivé',
},
},
'NoiseReduction' => {
Description => 'Réduction du bruit',
PrintConv => {
'Low' => 'Bas',
'Normal' => 'Normale',
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'NoiseReductionApplied' => 'Réduction de bruit appliquée',
'NominalMaxAperture' => 'Ouverture maxi nominal',
'NominalMinAperture' => 'Ouverture mini nominal',
'NumIndexEntries' => 'Nombre d\'entrées d\'index',
'NumberofInks' => 'Nombre d\'encres',
'OECFColumns' => 'Colonnes OECF',
'OECFNames' => 'Noms OECF',
'OECFRows' => 'Lignes OECF',
'OECFValues' => 'Valeurs OECF',
'OPIProxy' => 'Proxy OPI',
'ObjectAttributeReference' => 'Genre intellectuel',
'ObjectCycle' => {
Description => 'Cycle d\'objet',
PrintConv => {
'Both Morning and Evening' => 'Les deux',
'Evening' => 'Soir',
'Morning' => 'Matin',
},
},
'ObjectFileType' => {
PrintConv => {
'None' => 'Aucune',
'Unknown' => 'Inconnu',
},
},
'ObjectName' => 'Titre',
'ObjectPreviewData' => 'Données de la miniature de l\'objet',
'ObjectPreviewFileFormat' => 'Format de fichier de la miniature de l\'objet',
'ObjectPreviewFileVersion' => 'Version de format de fichier de la miniature de l\'objet',
'ObjectTypeReference' => 'Référence de type d\'objet',
'OffsetSchema' => 'Schéma de décalage',
'OldSubfileType' => 'Type du sous-fichier',
'OneTouchWB' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'OpticalZoomOn' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'Opto-ElectricConvFactor' => 'Facteur de conversion optoélectrique',
'Orientation' => {
Description => 'Orientation de l\'image',
PrintConv => {
'Horizontal (normal)' => '0° (haut/gauche)',
'Mirror horizontal' => '0° (haut/droit)',
'Mirror horizontal and rotate 270 CW' => '90° sens horaire (gauche/haut)',
'Mirror horizontal and rotate 90 CW' => '90° sens antihoraire (droit/bas)',
'Mirror vertical' => '180° (bas/gauche)',
'Rotate 180' => '180° (bas/droit)',
'Rotate 270 CW' => '90° sens horaire (gauche/bas)',
'Rotate 90 CW' => '90° sens antihoraire (droit/haut)',
},
},
'OriginalRawFileData' => 'Données du fichier raw d\'origine',
'OriginalRawFileDigest' => 'Digest du fichier raw original',
'OriginalRawFileName' => 'Nom du fichier raw d\'origine',
'OriginalTransmissionReference' => 'Identificateur de tâche',
'OriginatingProgram' => 'Programme d\'origine',
'OtherImage' => 'Autre image',
'OutputResponse' => 'Réponse de sortie',
'Owner' => 'Proprietaire',
'OwnerID' => 'ID du propriétaire',
'OwnerName' => 'Nom du propriétaire',
'PDFVersion' => 'Version PDF',
'PEFVersion' => 'Version PEF',
'Padding' => 'Remplissage',
'PageName' => 'Nom de page',
'PageNumber' => 'Page numéro',
'PentaxImageSize' => {
Description => 'Taille d\'image Pentax',
PrintConv => {
'2304x1728 or 2592x1944' => '2304 x 1728 ou 2592 x 1944',
'2560x1920 or 2304x1728' => '2560 x 1920 ou 2304 x 1728',
'2816x2212 or 2816x2112' => '2816 x 2212 ou 2816 x 2112',
'3008x2008 or 3040x2024' => '3008 x 2008 ou 3040 x 2024',
'Full' => 'Pleine',
},
},
'PentaxModelID' => 'Modèle Pentax',
'PentaxVersion' => 'Version Pentax',
'PersonInImage' => 'Personnage sur l\'Image',
'PhotoEffect' => {
PrintConv => {
'Off' => 'Désactivé',
},
},
'PhotoEffects' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'PhotoEffectsType' => {
PrintConv => {
'None' => 'Aucune',
},
},
'PhotometricInterpretation' => {
Description => 'Schéma de pixel',
PrintConv => {
'BlackIsZero' => 'Zéro pour noir',
'Color Filter Array' => 'CFA (Matrice de filtre de couleur)',
'Pixar LogL' => 'CIE Log2(L) (Log luminance)',
'Pixar LogLuv' => 'CIE Log2(L)(u\',v\') (Log luminance et chrominance)',
'RGB' => 'RVB',
'RGB Palette' => 'Palette RVB',
'Transparency Mask' => 'Masque de transparence',
'WhiteIsZero' => 'Zéro pour blanc',
},
},
'PictureControl' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'PictureControlActive' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'PictureFinish' => {
PrintConv => {
'Natural' => 'Naturel',
'Night Scene' => 'Nocturne',
},
},
'PictureMode' => {
Description => 'Mode d\'image',
PrintConv => {
'1/2 EV steps' => 'Pas de 1/2 IL',
'1/3 EV steps' => 'Pas de 1/3 IL',
'Aperture Priority' => 'Priorité ouverture',
'Aperture Priority, Off-Auto-Aperture' => 'Priorité ouverture (auto-diaph hors service)',
'Aperture-priority AE' => 'Priorité ouverture',
'Auto PICT (Landscape)' => 'Auto PICT (paysage)',
'Auto PICT (Macro)' => 'Auto PICT (macro)',
'Auto PICT (Portrait)' => 'Auto PICT (portrait)',
'Auto PICT (Sport)' => 'Auto PICT (sport)',
'Auto PICT (Standard)' => 'Auto PICT (standard)',
'Autumn' => 'Automne',
'Blur Reduction' => 'Réduction du flou',
'Bulb' => 'Pose B',
'Bulb, Off-Auto-Aperture' => 'Pose B (auto-diaph hors service)',
'Candlelight' => 'Bougie',
'DOF Program' => 'Programme PdC',
'DOF Program (HyP)' => 'Programme PdC (Hyper-programme)',
'Dark Pet' => 'Animal foncé',
'Digital Filter' => 'Filtre numérique',
'Fireworks' => 'Feux d\'artifice',
'Flash X-Sync Speed AE' => 'Synchro X flash vitesse AE',
'Food' => 'Nourriture',
'Frame Composite' => 'Vue composite',
'Green Mode' => 'Mode vert',
'Half-length Portrait' => 'Portrait (buste)',
'Hi-speed Program' => 'Programme grande vitesse',
'Hi-speed Program (HyP)' => 'Programme grande vitesse (Hyper-programme)',
'Kids' => 'Enfants',
'Landscape' => 'Paysage',
'Light Pet' => 'Animal clair',
'MTF Program' => 'Programme FTM',
'MTF Program (HyP)' => 'Programme FTM (Hyper-programme)',
'Manual' => 'Manuelle',
'Manual, Off-Auto-Aperture' => 'Manuel (auto-diaph hors service)',
'Medium Pet' => 'Animal demi-teintes',
'Museum' => 'Musée',
'Natural Skin Tone' => 'Ton chair naturel',
'Night Scene' => 'Nocturne',
'Night Scene Portrait' => 'Portrait nocturne',
'No Flash' => 'Sans flash',
'Pet' => 'Animaux de compagnie',
'Program' => 'Programme',
'Program (HyP)' => 'Programme AE (Hyper-programme)',
'Program AE' => 'Priorité vitesse',
'Program Av Shift' => 'Décalage programme Av',
'Program Tv Shift' => 'Décalage programme Tv',
'Self Portrait' => 'Autoportrait',
'Sensitivity Priority AE' => 'Priorité sensibilité AE',
'Shutter & Aperture Priority AE' => 'Priorité vitesse et ouverture AE',
'Shutter Speed Priority' => 'Priorité vitesse',
'Shutter speed priority AE' => 'Priorité vitesse',
'Snow' => 'Neige',
'Soft' => 'Doux',
'Sunset' => 'Coucher de soleil',
'Surf & Snow' => 'Surf et neige',
'Synchro Sound Record' => 'Enregistrement de son synchro',
'Text' => 'Texte',
'Underwater' => 'Sous-marine',
},
},
'PictureMode2' => {
Description => 'Mode d\'image 2',
PrintConv => {
'Aperture Priority' => 'Priorité ouverture',
'Aperture Priority, Off-Auto-Aperture' => 'Priorité ouverture (auto-diaph hors service)',
'Auto PICT' => 'Image auto',
'Bulb' => 'Pose B',
'Bulb, Off-Auto-Aperture' => 'Pose B (auto-diaph hors service)',
'Flash X-Sync Speed AE' => 'Expo auto, vitesse de synchro flash X',
'Green Mode' => 'Mode vert',
'Manual' => 'Manuelle',
'Manual, Off-Auto-Aperture' => 'Manuel (auto-diaph hors service)',
'Program AE' => 'Programme AE',
'Program Av Shift' => 'Décalage programme Av',
'Program Tv Shift' => 'Décalage programme Tv',
'Scene Mode' => 'Mode scène',
'Sensitivity Priority AE' => 'Expo auto, priorité sensibilité',
'Shutter & Aperture Priority AE' => 'Expo auto, priorité vitesse et ouverture',
'Shutter Speed Priority' => 'Priorité vitesse',
},
},
'PictureModeBWFilter' => {
PrintConv => {
'Green' => 'Vert',
'Red' => 'Rouge',
'Yellow' => 'Jaune',
'n/a' => 'Non établie',
},
},
'PictureModeTone' => {
PrintConv => {
'Blue' => 'Bleu',
'Green' => 'Vert',
'n/a' => 'Non établie',
},
},
'PictureStyle' => {
Description => 'Style d\'image',
PrintConv => {
'Faithful' => 'Fidèle',
'High Saturation' => 'Saturation élevée',
'Landscape' => 'Paysage',
'Low Saturation' => 'Faible saturation',
'Neutral' => 'Neutre',
'None' => 'Aucune',
},
},
'PixelIntensityRange' => 'Intervalle d\'intensité de pixel',
'PixelScale' => 'Tag d\'échelle de pixel modèle',
'PixelUnits' => {
PrintConv => {
'Unknown' => 'Inconnu',
},
},
'PlanarConfiguration' => {
Description => 'Arrangement des données image',
PrintConv => {
'Chunky' => 'Format « chunky » (entrelacé)',
'Planar' => 'Format « planar »',
},
},
'PostalCode' => 'Code Postal',
'PowerSource' => {
Description => 'Source d\'alimentation',
PrintConv => {
'Body Battery' => 'Accu boîtier',
'External Power Supply' => 'Alimentation externe',
'Grip Battery' => 'Accu poignée',
},
},
'Predictor' => {
Description => 'Prédicteur',
PrintConv => {
'Horizontal differencing' => 'Différentiation horizontale',
'None' => 'Aucun schéma de prédicteur utilisé avant l\'encodage',
},
},
'Preview0' => 'Aperçu 0',
'Preview1' => 'Aperçu 1',
'Preview2' => 'Aperçu 2',
'PreviewApplicationName' => 'Nom de l\'application d\'aperçu',
'PreviewApplicationVersion' => 'Version de l\'application d\'aperçu',
'PreviewColorSpace' => {
Description => 'Espace de couleur de l\'aperçu',
PrintConv => {
'Unknown' => 'Inconnu',
},
},
'PreviewDateTime' => 'Horodatage d\'aperçu',
'PreviewImage' => 'Aperçu',
'PreviewImageBorders' => 'Limites d\'image miniature',
'PreviewImageLength' => 'Longueur d\'image miniature',
'PreviewImageSize' => 'Taille d\'image miniature',
'PreviewImageStart' => 'Début d\'image miniature',
'PreviewImageValid' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'PreviewQuality' => {
PrintConv => {
'Normal' => 'Normale',
},
},
'PreviewSettingsDigest' => 'Digest des réglages d\'aperçu',
'PreviewSettingsName' => 'Nom des réglages d\'aperçu',
'PrimaryChromaticities' => 'Chromaticité des couleurs primaires',
'PrimaryPlatform' => 'Plateforme primaire',
'ProcessingSoftware' => 'Logiciel de traitement',
'Producer' => 'Producteur',
'ProductID' => 'ID de produit',
'ProductionCode' => 'L\'appareil est passé en SAV',
'ProfileCMMType' => 'Type de profil CMM',
'ProfileCalibrationSig' => 'Signature de calibration de profil',
'ProfileClass' => {
Description => 'Classe de profil',
PrintConv => {
'Abstract Profile' => 'Profil de résumé',
'ColorSpace Conversion Profile' => 'Profil de conversion d\'espace de couleur',
'DeviceLink Profile' => 'Profil de liaison',
'Display Device Profile' => 'Profil d\'appareil d\'affichage',
'Input Device Profile' => 'Profil d\'appareil d\'entrée',
'NamedColor Profile' => 'Profil de couleur nommée',
'Nikon Input Device Profile (NON-STANDARD!)' => 'Profil Nikon ("nkpf")',
'Output Device Profile' => 'Profil d\'appareil de sortie',
},
},
'ProfileConnectionSpace' => 'Espace de connexion de profil',
'ProfileCopyright' => 'Copyright du profil',
'ProfileCreator' => 'Créateur du profil',
'ProfileDateTime' => 'Horodatage du profil',
'ProfileDescription' => 'Description du profil',
'ProfileDescriptionML' => 'Description de profil ML',
'ProfileEmbedPolicy' => {
Description => 'Règles d\'usage du profil incluses',
PrintConv => {
'Allow Copying' => 'Permet la copie',
'Embed if Used' => 'Inclus si utilisé',
'Never Embed' => 'Jamais inclus',
'No Restrictions' => 'Pas de restriction',
},
},
'ProfileFileSignature' => 'Signature de fichier de profil',
'ProfileHueSatMapData1' => 'Données de profil teinte sat. 1',
'ProfileHueSatMapData2' => 'Données de profil teinte sat. 2',
'ProfileHueSatMapDims' => 'Divisions de teinte',
'ProfileID' => 'ID du profil',
'ProfileLookTableData' => 'Données de table de correspondance de profil',
'ProfileLookTableDims' => 'Divisions de teinte',
'ProfileName' => 'Nom du profil',
'ProfileSequenceDesc' => 'Description de séquence du profil',
'ProfileToneCurve' => 'Courbe de ton du profil',
'ProfileVersion' => 'Version de profil',
'ProgramLine' => {
Description => 'Ligne de programme',
PrintConv => {
'Depth' => 'Priorité profondeur de champ',
'Hi Speed' => 'Priorité grande vitesse',
'MTF' => 'Priorité FTM',
'Normal' => 'Normale',
},
},
'ProgramMode' => {
PrintConv => {
'None' => 'Aucune',
'Sunset' => 'Coucher de soleil',
'Text' => 'Texte',
},
},
'ProgramVersion' => 'Version du programme',
'Protect' => 'Protéger',
'Province-State' => 'Région / Département',
'Publisher' => 'Editeur',
'Quality' => {
Description => 'Qualité',
PrintConv => {
'Best' => 'La meilleure',
'Better' => 'Meilleure',
'Good' => 'Bonne',
'Low' => 'Bas',
'Normal' => 'Normale',
},
},
'QualityMode' => {
PrintConv => {
'Normal' => 'Normale',
},
},
'QuantizationMethod' => {
Description => 'Méthode de quantification',
PrintConv => {
'Color Space Specific' => 'Spécifique à l\'espace de couleur',
'Compression Method Specific' => 'Spécifique à la méthode de compression',
'Gamma Compensated' => 'Compensée gamma',
'IPTC Ref B' => 'IPTC réf "B"',
'Linear Density' => 'Densité linéaire',
'Linear Dot Percent' => 'Pourcentage de point linéaire',
'Linear Reflectance/Transmittance' => 'Réflectance/transmittance linéaire',
},
},
'QuickControlDialInMeter' => {
Description => 'Molette de contrôle rapide en mesure',
PrintConv => {
'AF point selection' => 'Sélection collimateur AF',
'Exposure comp/Aperture' => 'Correction exposition/ouverture',
'ISO speed' => 'Sensibilité ISO',
},
},
'QuickShot' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'RAFVersion' => 'Version RAF',
'RasterPadding' => 'Remplissage raster',
'RasterizedCaption' => 'Légende rastérisée',
'Rating' => 'Évaluation',
'RatingPercent' => 'Rapport en pourcentage',
'RawAndJpgRecording' => {
Description => 'Enregistrement RAW et JPEG',
PrintConv => {
'JPEG (Best)' => 'JPEG (le meilleur)',
'JPEG (Better)' => 'JPEG (meilleur)',
'JPEG (Good)' => 'JPEG (bon)',
'RAW (DNG, Best)' => 'RAW (DNG, le meilleur)',
'RAW (DNG, Better)' => 'RAW (DNG, meilleur)',
'RAW (DNG, Good)' => 'RAW (DNG, bon)',
'RAW (PEF, Best)' => 'RAW (PEF, le meilleur)',
'RAW (PEF, Better)' => 'RAW (PEF, meilleur)',
'RAW (PEF, Good)' => 'RAW (PEF, bon)',
'RAW+JPEG (DNG, Best)' => 'RAW+JPEG (DNG, le meilleur)',
'RAW+JPEG (DNG, Better)' => 'RAW+JPEG (DNG, meilleur)',
'RAW+JPEG (DNG, Good)' => 'RAW+JPEG (DNG, bon)',
'RAW+JPEG (PEF, Best)' => 'RAW+JPEG (PEF, le meilleur)',
'RAW+JPEG (PEF, Better)' => 'RAW+JPEG (PEF, meilleur)',
'RAW+JPEG (PEF, Good)' => 'RAW+JPEG (PEF, bon)',
'RAW+Large/Fine' => 'RAW+grande/fine',
'RAW+Large/Normal' => 'RAW+grande/normale',
'RAW+Medium/Fine' => 'RAW+moyenne/fine',
'RAW+Medium/Normal' => 'RAW+moyenne/normale',
'RAW+Small/Fine' => 'RAW+petite/fine',
'RAW+Small/Normal' => 'RAW+petite/normale',
},
},
'RawDataUniqueID' => 'ID unique de données brutes',
'RawDevAutoGradation' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'RawDevPMPictureTone' => {
PrintConv => {
'Blue' => 'Bleu',
'Green' => 'Vert',
},
},
'RawDevPM_BWFilter' => {
PrintConv => {
'Green' => 'Vert',
'Red' => 'Rouge',
'Yellow' => 'Jaune',
},
},
'RawDevPictureMode' => {
PrintConv => {
'Natural' => 'Naturel',
},
},
'RawDevWhiteBalance' => {
PrintConv => {
'Color Temperature' => 'Température de couleur',
},
},
'RawImageDigest' => 'Digest d\'image brute',
'RawImageSize' => 'Taille d\'image RAW',
'RawJpgQuality' => {
PrintConv => {
'Normal' => 'Normale',
},
},
'RawLinear' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'RecordMode' => {
PrintConv => {
'Aperture Priority' => 'Priorité ouverture',
'Manual' => 'Manuelle',
'Shutter Priority' => 'Priorité vitesse',
},
},
'RecordingMode' => {
PrintConv => {
'Landscape' => 'Paysage',
'Manual' => 'Manuelle',
'Night Scene' => 'Nocturne',
},
},
'RedBalance' => 'Balance rouge',
'RedEyeCorrection' => {
PrintConv => {
'Automatic' => 'Auto',
'Off' => 'Désactivé',
},
},
'RedEyeReduction' => {
Description => 'Réduction yeux rouges',
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'RedMatrixColumn' => 'Colonne de matrice rouge',
'RedTRC' => 'Courbe de reproduction des tons rouges',
'ReductionMatrix1' => 'Matrice de réduction 1',
'ReductionMatrix2' => 'Matrice de réduction 2',
'ReferenceBlackWhite' => 'Paire de valeurs de référence noir et blanc',
'ReferenceDate' => 'Date de référence',
'ReferenceNumber' => 'Numéro de référence',
'ReferenceService' => 'Service de référence',
'RelatedImageFileFormat' => 'Format de fichier image apparenté',
'RelatedImageHeight' => 'Hauteur d\'image apparentée',
'RelatedImageWidth' => 'Largeur d\'image apparentée',
'RelatedSoundFile' => 'Fichier audio apparenté',
'ReleaseButtonToUseDial' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'ReleaseDate' => 'Date de version',
'ReleaseTime' => 'Heure de version',
'RenderingIntent' => {
Description => 'Intention de rendu',
PrintConv => {
'ICC-Absolute Colorimetric' => 'Colorimétrique absolu',
'Media-Relative Colorimetric' => 'Colorimétrique relatif',
'Perceptual' => 'Perceptif',
},
},
'ResampleParamsQuality' => {
PrintConv => {
'Low' => 'Bas',
},
},
'Resaved' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'Resolution' => 'Résolution d\'image',
'ResolutionUnit' => {
Description => 'Unité de résolution en X et Y',
PrintConv => {
'None' => 'Aucune',
'inches' => 'Pouce',
},
},
'RetouchHistory' => {
PrintConv => {
'None' => 'Aucune',
},
},
'Rights' => 'Droits',
'RowInterleaveFactor' => 'Facteur d\'entrelacement des lignes',
'RowsPerStrip' => 'Nombre de rangées par bande',
'SMaxSampleValue' => 'Valeur maxi d\'échantillon S',
'SMinSampleValue' => 'Valeur mini d\'échantillon S',
'SPIFFVersion' => 'Version SPIFF',
'SRAWQuality' => {
PrintConv => {
'n/a' => 'Non établie',
},
},
'SRActive' => {
Description => 'Réduction de bougé active',
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'SRFocalLength' => 'Focale de réduction de bougé',
'SRHalfPressTime' => 'Temps entre mesure et déclenchement',
'SRResult' => {
Description => 'Stabilisation',
PrintConv => {
'Not stabilized' => 'Non stabilisé',
},
},
'SVGVersion' => 'Version SVG',
'SafetyShift' => {
Description => 'Décalage de sécurité',
PrintConv => {
'Disable' => 'Désactivé',
'Enable (ISO speed)' => 'Activé (sensibilité ISO)',
'Enable (Tv/Av)' => 'Activé (Tv/Av)',
},
},
'SafetyShiftInAvOrTv' => {
Description => 'Décalage de sécurité Av ou Tv',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activé',
},
},
'SampleFormat' => {
Description => 'Format d\'échantillon',
PrintConv => {
'Complex integer' => 'Entier complexe',
'IEEE floating point' => 'Réel à virgule flottante',
'Two\'s complement signed integer' => 'Entier signé',
'Undefined' => 'Non défini',
'Unsigned integer' => 'Entier non signé',
},
},
'SampleStructure' => {
Description => 'Structure d\'échantillonnage',
PrintConv => {
'CompressionDependent' => 'Définie dans le processus de compression',
'Orthogonal4-2-2Sampling' => 'Orthogonale, avec les fréquences d\'échantillonnage dans le rapport 4:2:2:(4)',
'OrthogonalConstangSampling' => 'Orthogonale, avec les mêmes fréquences d\'échantillonnage relatives sur chaque composante',
},
},
'SamplesPerPixel' => 'Nombre de composantes',
'Saturation' => {
PrintConv => {
'High' => 'Forte',
'Low' => 'Faible',
'Med High' => 'Assez forte',
'Med Low' => 'Assez faible',
'None' => 'Non établie',
'Normal' => 'Normale',
'Very High' => 'Très forte',
'Very Low' => 'Très faible',
},
},
'ScanImageEnhancer' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ScanningDirection' => {
Description => 'Direction de scannage',
PrintConv => {
'Bottom-Top, L-R' => 'De bas en haut, de gauche à droite',
'Bottom-Top, R-L' => 'De bas en haut, de droite à gauche',
'L-R, Bottom-Top' => 'De gauche à droite, de bas en haut',
'L-R, Top-Bottom' => 'De gauche à droite, de haut en bas',
'R-L, Bottom-Top' => 'De droite à gauche, de bas en haut',
'R-L, Top-Bottom' => 'De droite à gauche, de haut en bas',
'Top-Bottom, L-R' => 'De haut en bas, de gauche à droite',
'Top-Bottom, R-L' => 'De haut en bas, de droite à gauche',
},
},
'SceneCaptureType' => {
Description => 'Type de capture de scène',
PrintConv => {
'Landscape' => 'Paysage',
'Night' => 'Scène de nuit',
},
},
'SceneMode' => {
PrintConv => {
'Aperture Priority' => 'Priorité ouverture',
'Candlelight' => 'Bougie',
'Landscape' => 'Paysage',
'Manual' => 'Manuelle',
'Night Scene' => 'Nocturne',
'Normal' => 'Normale',
'Off' => 'Désactivé',
'Shutter Priority' => 'Priorité vitesse',
'Snow' => 'Neige',
'Sunset' => 'Coucher de soleil',
'Super Macro' => 'Super macro',
'Text' => 'Texte',
},
},
'SceneModeUsed' => {
PrintConv => {
'Aperture Priority' => 'Priorité ouverture',
'Candlelight' => 'Bougie',
'Landscape' => 'Paysage',
'Manual' => 'Manuelle',
'Shutter Priority' => 'Priorité vitesse',
'Snow' => 'Neige',
'Sunset' => 'Coucher de soleil',
'Text' => 'Texte',
},
},
'SceneSelect' => {
PrintConv => {
'Night' => 'Scène de nuit',
'Off' => 'Désactivé',
},
},
'SceneType' => {
Description => 'Type de scène',
PrintConv => {
'Directly photographed' => 'Image photographiée directement',
},
},
'SecurityClassification' => {
Description => 'Classement de sécurité',
PrintConv => {
'Confidential' => 'Confidentiel',
'Restricted' => 'Restreint',
'Top Secret' => 'Top secret',
'Unclassified' => 'Non classé',
},
},
'SelectableAFPoint' => {
Description => 'Collimateurs AF sélectionnables',
PrintConv => {
'19 points' => '19 collimateurs',
'Inner 9 points' => '9 collimateurs centraux',
'Outer 9 points' => '9 collimateurs périphériques',
},
},
'SelfTimer' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'SelfTimer2' => 'Retardateur (2)',
'SelfTimerMode' => 'Mode auto-timer',
'SensingMethod' => {
Description => 'Méthode de capture',
PrintConv => {
'Color sequential area' => 'Capteur couleur séquentiel',
'Color sequential linear' => 'Capteur couleur séquentiel linéaire',
'Monochrome area' => 'Capteur monochrome',
'Monochrome linear' => 'Capteur linéaire monochrome',
'Not defined' => 'Non définie',
'One-chip color area' => 'Capteur monochip couleur',
'Three-chip color area' => 'Capteur trois chips couleur',
'Trilinear' => 'Capteur trilinéaire',
'Two-chip color area' => 'Capteur deux chips couleur',
},
},
'SensitivityAdjust' => 'Réglage de sensibilité',
'SensitivitySteps' => {
Description => 'Pas de sensibilité',
PrintConv => {
'1 EV Steps' => 'Pas de 1 IL',
'As EV Steps' => 'Comme pas IL',
},
},
'SensorCleaning' => {
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activé',
},
},
'SequentialShot' => {
PrintConv => {
'None' => 'Aucune',
},
},
'SerialNumber' => 'Numéro de série',
'ServiceIdentifier' => 'Identificateur de service',
'SetButtonCrossKeysFunc' => {
Description => 'Réglage touche SET/joypad',
PrintConv => {
'Cross keys: AF point select' => 'Joypad:Sélec. collim. AF',
'Normal' => 'Normale',
'Set: Flash Exposure Comp' => 'SET:Cor expo flash',
'Set: Parameter' => 'SET:Changer de paramètres',
'Set: Picture Style' => 'SET:Style d’image',
'Set: Playback' => 'SET:Lecture',
'Set: Quality' => 'SET:Qualité',
},
},
'SetButtonWhenShooting' => {
Description => 'Touche SET au déclenchement',
PrintConv => {
'Change parameters' => 'Changer de paramètres',
'Default (no function)' => 'Normal (désactivée)',
'Disabled' => 'Désactivée',
'Flash exposure compensation' => 'Correction expo flash',
'ISO speed' => 'Sensibilité ISO',
'Image playback' => 'Lecture de l\'image',
'Image quality' => 'Changer de qualité',
'Image size' => 'Taille d\'image',
'LCD monitor On/Off' => 'Écran LCD On/Off',
'Menu display' => 'Affichage du menu',
'Normal (disabled)' => 'Normal (désactivée)',
'Picture style' => 'Style d\'image',
'Quick control screen' => 'Écran de contrôle rapide',
'Record func. + media/folder' => 'Fonction enregistrement + média/dossier',
'Record movie (Live View)' => 'Enr. vidéo (visée écran)',
'White balance' => 'Balance des blancs',
},
},
'SetFunctionWhenShooting' => {
Description => 'Touche SET au déclenchement',
PrintConv => {
'Change Parameters' => 'Changer de paramètres',
'Change Picture Style' => 'Style d\'image',
'Change quality' => 'Changer de qualité',
'Default (no function)' => 'Normal (désactivée)',
'Image replay' => 'Lecture de l\'image',
'Menu display' => 'Affichage du menu',
},
},
'ShadingCompensation' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ShadingCompensation2' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ShadowScale' => 'Echelle d\'ombre',
'ShakeReduction' => {
Description => 'Réduction du bougé (réglage)',
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'Sharpness' => {
Description => 'Accentuation',
PrintConv => {
'Hard' => 'Dure',
'Med Hard' => 'Assez dure',
'Med Soft' => 'Assez douce',
'Normal' => 'Normale',
'Soft' => 'Douce',
'Very Hard' => 'Très dure',
'Very Soft' => 'Très douce',
'n/a' => 'Non établie',
},
},
'SharpnessFrequency' => {
PrintConv => {
'High' => 'Haut',
'Highest' => 'Plus haut',
'Low' => 'Doux',
'n/a' => 'Non établie',
},
},
'ShootingMode' => {
PrintConv => {
'Aperture Priority' => 'Priorité ouverture',
'Candlelight' => 'Bougie',
'Manual' => 'Manuelle',
'Normal' => 'Normale',
'Shutter Priority' => 'Priorité vitesse',
'Snow' => 'Neige',
'Sunset' => 'Coucher de soleil',
},
},
'ShortDocumentID' => 'ID court de document',
'ShortReleaseTimeLag' => {
Description => 'Intertie au déclenchement réduite',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activé',
},
},
'Shutter-AELock' => {
Description => 'Déclencheur/Touche verr. AE',
PrintConv => {
'AE lock/AF' => 'Verrouillage AE/autofocus',
'AE/AF, No AE lock' => 'AE/AF, pas de verrou. AE',
'AF/AE lock' => 'Autofocus/verrouillage AE',
'AF/AF lock' => 'Autofocus/verrouillage AF',
'AF/AF lock, No AE lock' => 'AF/verr.AF, pas de verr.AE',
},
},
'ShutterAELButton' => {
Description => 'Déclencheur/Touche verr. AE',
PrintConv => {
'AE lock/AF' => 'Verrouillage AE/Autofocus',
'AE/AF, No AE lock' => 'AE/AF, pad de verrou. AE',
'AF/AE lock stop' => 'Autofocus/Verrouillage AE',
'AF/AF lock, No AE lock' => 'AF/ver.AF, pad de verr.AE',
},
},
'ShutterButtonAFOnButton' => {
Description => 'Déclencheur/Touche AF',
PrintConv => {
'AE lock/Metering + AF start' => 'Mémo expo/lct. mesure+AF',
'Metering + AF start' => 'Mesure + lancement AF',
'Metering + AF start / disable' => 'Lct. mesure+AF/désactivée',
'Metering + AF start/AF stop' => 'Mesure + lancement/arrêt AF',
'Metering start/Meter + AF start' => 'Lct. mesure/lct. mesure+AF',
},
},
'ShutterCount' => 'Comptage des déclenchements',
'ShutterCurtainSync' => {
Description => 'Synchronisation du rideau',
PrintConv => {
'1st-curtain sync' => 'Synchronisation premier rideau',
'2nd-curtain sync' => 'Synchronisation deuxième rideau',
},
},
'ShutterMode' => {
PrintConv => {
'Aperture Priority' => 'Priorité ouverture',
},
},
'ShutterReleaseButtonAE-L' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ShutterReleaseNoCFCard' => {
Description => 'Déclench. obtur. sans carte',
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'ShutterSpeed' => 'Temps de pose',
'ShutterSpeedRange' => {
Description => 'Régler gamme de vitesses',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activée',
},
},
'ShutterSpeedValue' => 'Vitesse d\'obturation',
'SidecarForExtension' => 'Extension',
'SimilarityIndex' => 'Indice de similarité',
'SlaveFlashMeteringSegments' => 'Segments de mesure flash esclave',
'SlideShow' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'SlowShutter' => {
Description => 'Vitesse d\'obturation lente',
PrintConv => {
'Night Scene' => 'Nocturne',
'None' => 'Aucune',
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'SlowSync' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'Software' => 'Logiciel',
'SpatialFrequencyResponse' => 'Réponse spatiale en fréquence',
'SpecialEffectsOpticalFilter' => {
PrintConv => {
'None' => 'Aucune',
},
},
'SpectralSensitivity' => 'Sensibilité spectrale',
'SpotMeterLinkToAFPoint' => {
Description => 'Mesure spot liée au collimateur AF',
PrintConv => {
'Disable (use center AF point)' => 'Désactivée (utiliser collimateur AF central)',
'Enable (use active AF point)' => 'Activé (utiliser collimateur AF actif)',
},
},
'SpotMeteringMode' => {
PrintConv => {
'Center' => 'Centre',
},
},
'State' => 'Etat',
'StreamType' => {
PrintConv => {
'Text' => 'Texte',
},
},
'StripByteCounts' => 'Octets par bande compressée',
'StripOffsets' => 'Emplacement des données image',
'Sub-location' => 'Lieu',
'SubSecCreateDate' => 'Date de la création des données numériques',
'SubSecDateTimeOriginal' => 'Date de la création des données originales',
'SubSecModifyDate' => 'Date de modification de fichier',
'SubSecTime' => 'Fractions de seconde de DateTime',
'SubSecTimeDigitized' => 'Fractions de seconde de DateTimeDigitized',
'SubSecTimeOriginal' => 'Fractions de seconde de DateTimeOriginal',
'SubTileBlockSize' => 'Taille de bloc de sous-tuile',
'SubfileType' => 'Type du nouveau sous-fichier',
'SubimageColor' => {
PrintConv => {
'RGB' => 'RVB',
},
},
'Subject' => 'Sujet',
'SubjectCode' => 'Code sujet',
'SubjectDistance' => 'Distance du sujet',
'SubjectDistanceRange' => {
Description => 'Intervalle de distance du sujet',
PrintConv => {
'Close' => 'Vue rapprochée',
'Distant' => 'Vue distante',
'Unknown' => 'Inconnu',
},
},
'SubjectLocation' => 'Zone du sujet',
'SubjectProgram' => {
PrintConv => {
'None' => 'Aucune',
'Sunset' => 'Coucher de soleil',
'Text' => 'Texte',
},
},
'SubjectReference' => 'Code de sujet',
'Subsystem' => {
PrintConv => {
'Unknown' => 'Inconnu',
},
},
'SuperMacro' => {
PrintConv => {
'Off' => 'Désactivé',
},
},
'SuperimposedDisplay' => {
Description => 'Affichage superposé',
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'SupplementalCategories' => 'Catégorie d\'appoint',
'SupplementalType' => {
Description => 'Type de supplément',
PrintConv => {
'Main Image' => 'Non établi',
'Rasterized Caption' => 'Titre rastérisé',
'Reduced Resolution Image' => 'Image de résolution réduite',
},
},
'SvISOSetting' => 'Réglage ISO Sv',
'SwitchToRegisteredAFPoint' => {
Description => 'Activer collimateur enregistré',
PrintConv => {
'Assist' => 'Touche d\'assistance',
'Assist + AF' => 'Touche d\'assistance + touche AF',
'Disable' => 'Désactivé',
'Enable' => 'Activé',
'Only while pressing assist' => 'Seulement en appuyant touche d\'assistance',
},
},
'T4Options' => 'Bits de remplissage ajoutés',
'T6Options' => 'Options T6',
'TTL_DA_ADown' => 'Segment de mesure flash esclave 6',
'TTL_DA_AUp' => 'Segment de mesure flash esclave 5',
'TTL_DA_BDown' => 'Segment de mesure flash esclave 8',
'TTL_DA_BUp' => 'Segment de mesure flash esclave 7',
'Tagged' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'TargetPrinter' => 'Imprimantte cible',
'Technology' => {
Description => 'Technologie',
PrintConv => {
'Active Matrix Display' => 'Afficheur à matrice active',
'Cathode Ray Tube Display' => 'Afficheur à tube cathodique',
'Digital Camera' => 'Appareil photo numérique',
'Dye Sublimation Printer' => 'Imprimante à sublimation thermique',
'Electrophotographic Printer' => 'Imprimante électrophotographique',
'Electrostatic Printer' => 'Imprimante électrostatique',
'Film Scanner' => 'Scanner de film',
'Flexography' => 'Flexographie',
'Ink Jet Printer' => 'Imprimante à jet d\'encre',
'Offset Lithography' => 'Lithographie offset',
'Passive Matrix Display' => 'Afficheur à matrice passive',
'Photo CD' => 'CD photo',
'Photo Image Setter' => 'Cadre photo',
'Photographic Paper Printer' => 'Imprimante à papier photo',
'Projection Television' => 'Téléviseur à projection',
'Reflective Scanner' => 'Scanner à réflexion',
'Silkscreen' => 'Ecran de soie',
'Thermal Wax Printer' => 'Imprimante thermique à cire',
'Video Camera' => 'Caméra vidéo',
'Video Monitor' => 'Moniteur vidéo',
},
},
'Teleconverter' => {
PrintConv => {
'None' => 'Aucune',
},
},
'Text' => 'Texte',
'TextStamp' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'Thresholding' => 'Seuil',
'ThumbnailHeight' => 'Hauteur de la vignette',
'ThumbnailImage' => 'Vignette',
'ThumbnailWidth' => 'Hauteur de la vignette',
'TileByteCounts' => 'Nombre d\'octets d\'élément',
'TileDepth' => 'Profondeur d\'élément',
'TileLength' => 'Longueur d\'élément',
'TileOffsets' => 'Décalages d\'élément',
'TileWidth' => 'Largeur d\'élément',
'Time' => 'Heure',
'TimeCreated' => 'Heure de création',
'TimeScaleParamsQuality' => {
PrintConv => {
'Low' => 'Bas',
},
},
'TimeSent' => 'Heure d\'envoi',
'TimeZoneOffset' => 'Offset de zone de date',
'TimerLength' => {
Description => 'Durée du retardateur',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activée',
},
},
'Title' => 'Titre',
'ToneCurve' => {
Description => 'Courbe de ton',
PrintConv => {
'Manual' => 'Manuelle',
},
},
'ToneCurveActive' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'ToneCurves' => 'Courbes de ton',
'ToningEffect' => {
PrintConv => {
'Blue' => 'Bleu',
'Green' => 'Vert',
'None' => 'Aucune',
'Red' => 'Rouge',
'Yellow' => 'Jaune',
'n/a' => 'Non établie',
},
},
'ToningEffectMonochrome' => {
PrintConv => {
'Blue' => 'Bleu',
'Green' => 'Vert',
'None' => 'Aucune',
},
},
'TransferFunction' => 'Fonction de transfert',
'TransferRange' => 'Intervalle de transfert',
'Transformation' => {
PrintConv => {
'Horizontal (normal)' => '0° (haut/gauche)',
'Mirror horizontal' => '0° (haut/droit)',
'Mirror horizontal and rotate 270 CW' => '90° sens horaire (gauche/haut)',
'Mirror horizontal and rotate 90 CW' => '90° sens antihoraire (droit/bas)',
'Mirror vertical' => '180° (bas/gauche)',
'Rotate 180' => '180° (bas/droit)',
'Rotate 270 CW' => '90° sens horaire (gauche/bas)',
'Rotate 90 CW' => '90° sens antihoraire (droit/haut)',
},
},
'TransmissionReference' => 'Référence transmission',
'TransparencyIndicator' => 'Indicateur de transparence',
'TrapIndicator' => 'Indicateur de piège',
'Trapped' => {
Description => 'Piégé',
PrintConv => {
'False' => 'Faux',
'True' => 'Vrai',
'Unknown' => 'Inconnu',
},
},
'TvExposureTimeSetting' => 'Réglage de temps de pose Tv',
'USMLensElectronicMF' => {
Description => 'MF électronique à objectif USM',
PrintConv => {
'Always turned off' => 'Toujours débrayé',
'Disable after one-shot AF' => 'Désactivée après One-Shot AF',
'Disable in AF mode' => 'Désactivée en mode AF',
'Enable after one-shot AF' => 'Activée après AF One-Shot',
'Turns off after one-shot AF' => 'Débrayé aprés One-Shot AF',
'Turns on after one-shot AF' => 'Activé aprés One-Shot AF',
},
},
'Uncompressed' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'UniqueCameraModel' => 'Nom unique de modèle d\'appareil',
'UniqueDocumentID' => 'ID unique de document',
'UniqueObjectName' => 'Nom Unique d\'Objet',
'Unsharp1Color' => {
PrintConv => {
'Blue' => 'Bleu',
'Green' => 'Vert',
'RGB' => 'RVB',
'Red' => 'Rouge',
'Yellow' => 'Jaune',
},
},
'Unsharp2Color' => {
PrintConv => {
'Blue' => 'Bleu',
'Green' => 'Vert',
'RGB' => 'RVB',
'Red' => 'Rouge',
'Yellow' => 'Jaune',
},
},
'Unsharp3Color' => {
PrintConv => {
'Blue' => 'Bleu',
'Green' => 'Vert',
'RGB' => 'RVB',
'Red' => 'Rouge',
'Yellow' => 'Jaune',
},
},
'Unsharp4Color' => {
PrintConv => {
'Blue' => 'Bleu',
'Green' => 'Vert',
'RGB' => 'RVB',
'Red' => 'Rouge',
'Yellow' => 'Jaune',
},
},
'UnsharpMask' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'Urgency' => {
Description => 'Urgence',
PrintConv => {
'0 (reserved)' => '0 (réservé pour utilisation future)',
'1 (most urgent)' => '1 (très urgent)',
'5 (normal urgency)' => '5 (normalement urgent)',
'8 (least urgent)' => '8 (moins urgent)',
'9 (user-defined priority)' => '9 (réservé pour utilisation future)',
},
},
'UsableMeteringModes' => {
Description => 'Sélectionner modes de mesure',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activée',
},
},
'UsableShootingModes' => {
Description => 'Sélectionner modes de prise de vue',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activée',
},
},
'UsageTerms' => 'Conditions d\'Utilisation',
'UserComment' => 'Commentaire utilisateur',
'UserDef1PictureStyle' => {
PrintConv => {
'Landscape' => 'Paysage',
},
},
'UserDef2PictureStyle' => {
PrintConv => {
'Landscape' => 'Paysage',
},
},
'UserDef3PictureStyle' => {
PrintConv => {
'Landscape' => 'Paysage',
},
},
'VRDVersion' => 'Version VRD',
'VR_0x66' => {
PrintConv => {
'Off' => 'Désactivé',
},
},
'VibrationReduction' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
'n/a' => 'Non établie',
},
},
'VideoCardGamma' => 'Gamma de la carte vidéo',
'ViewInfoDuringExposure' => {
Description => 'Infos viseur pendant exposition',
PrintConv => {
'Disable' => 'Désactivé',
'Enable' => 'Activé',
},
},
'ViewfinderWarning' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'ViewingCondDesc' => 'Description des conditions de visionnage',
'ViewingCondIlluminant' => 'Illuminant des conditions de visionnage',
'ViewingCondIlluminantType' => 'Type d\'illuminant des conditions de visionnage',
'ViewingCondSurround' => 'Environnement des conditions de visionnage',
'VignetteControl' => {
PrintConv => {
'High' => 'Haut',
'Low' => 'Bas',
'Normal' => 'Normale',
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'VoiceMemo' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'WBAdjLighting' => {
PrintConv => {
'Daylight' => 'Lumière du jour',
'None' => 'Aucune',
},
},
'WBBracketMode' => {
PrintConv => {
'Off' => 'Désactivé',
},
},
'WBFineTuneActive' => {
PrintConv => {
'No' => 'Non',
'Yes' => 'Oui',
},
},
'WBMediaImageSizeSetting' => {
Description => 'Réglage de balance des blancs + taille d\'image',
PrintConv => {
'LCD monitor' => 'Écran LCD',
'Rear LCD panel' => 'Panneau LCD arrièr',
},
},
'WBShiftAB' => 'Décalage bal. blancs ambre-bleu',
'WBShiftGM' => 'Décalage bal. blancs vert-magenta',
'WBShiftMG' => 'Décalage bal. blancs magenta-vert',
'WB_GBRGLevels' => 'Niveaux BB VBRV',
'WB_GRBGLevels' => 'Niveaux BB VRBV',
'WB_GRGBLevels' => 'Niveaux BB VRVB',
'WB_RBGGLevels' => 'Niveaux BB RBVV',
'WB_RBLevels' => 'Niveaux BB RB',
'WB_RBLevels3000K' => 'Niveaux BB RB 3000K',
'WB_RBLevels3300K' => 'Niveaux BB RB 3300K',
'WB_RBLevels3600K' => 'Niveaux BB RB 3600K',
'WB_RBLevels3900K' => 'Niveaux BB RB 3800K',
'WB_RBLevels4000K' => 'Niveaux BB RB 4000K',
'WB_RBLevels4300K' => 'Niveaux BB RB 4300K',
'WB_RBLevels4500K' => 'Niveaux BB RB 4500K',
'WB_RBLevels4800K' => 'Niveaux BB RB 4800K',
'WB_RBLevels5300K' => 'Niveaux BB RB 5300K',
'WB_RBLevels6000K' => 'Niveaux BB RB 6000K',
'WB_RBLevels6600K' => 'Niveaux BB RB 6600K',
'WB_RBLevels7500K' => 'Niveaux BB RB 7500K',
'WB_RBLevelsCloudy' => 'Niveaux BB RB nuageux',
'WB_RBLevelsShade' => 'Niveaux BB RB ombre',
'WB_RBLevelsTungsten' => 'Niveaux BB RB tungstène',
'WB_RGBGLevels' => 'Niveaux BB RVBV',
'WB_RGBLevels' => 'Niveaux BB RVB',
'WB_RGBLevelsCloudy' => 'Niveaux BB RVB nuageux',
'WB_RGBLevelsDaylight' => 'Niveaux BB RVB lumière jour',
'WB_RGBLevelsFlash' => 'Niveaux BB RVB flash',
'WB_RGBLevelsFluorescent' => 'Niveaux BB RVB fluorescent',
'WB_RGBLevelsShade' => 'Niveaux BB RVB ombre',
'WB_RGBLevelsTungsten' => 'Niveaux BB RVB tungstène',
'WB_RGGBLevels' => 'Niveaux BB RVVB',
'WB_RGGBLevelsCloudy' => 'Niveaux BB RVVB nuageux',
'WB_RGGBLevelsDaylight' => 'Niveaux BB RVVB lumière jour',
'WB_RGGBLevelsFlash' => 'Niveaux BB RVVB flash',
'WB_RGGBLevelsFluorescent' => 'Niveaux BB RVVB fluorescent',
'WB_RGGBLevelsFluorescentD' => 'Niveaux BB RVVB fluorescent',
'WB_RGGBLevelsFluorescentN' => 'Niveaux BB RVVB fluo N',
'WB_RGGBLevelsFluorescentW' => 'Niveaux BB RVVB fluo W',
'WB_RGGBLevelsShade' => 'Niveaux BB RVVB ombre',
'WB_RGGBLevelsTungsten' => 'Niveaux BB RVVB tungstène',
'WCSProfiles' => 'Profil Windows Color System',
'Warning' => 'Attention',
'WebStatement' => 'Relevé Web',
'WhiteBalance' => {
Description => 'Balance des blancs',
PrintConv => {
'Black & White' => 'Monochrome',
'Cloudy' => 'Temps nuageux',
'Custom' => 'Personnalisée',
'Custom 1' => 'Personnalisée 1',
'Custom 2' => 'Personnalisée 2',
'Custom 3' => 'Personnalisée 3',
'Custom 4' => 'Personnalisée 4',
'Day White Fluorescent' => 'Fluorescente type blanc',
'Daylight' => 'Lumière du jour',
'Daylight Fluorescent' => 'Fluorescente type jour',
'DaylightFluorescent' => 'Fluorescente type jour',
'DaywhiteFluorescent' => 'Fluorescent blanc jour',
'Fluorescent' => 'Fluorescente',
'Manual' => 'Manuelle',
'Manual Temperature (Kelvin)' => 'Température de couleur (Kelvin)',
'Shade' => 'Ombre',
'Shadow' => 'Ombre',
'Tungsten' => 'Tungstène (lumière incandescente)',
'Unknown' => 'Inconnu',
'User-Selected' => 'Sélectionnée par l\'utilisateur',
'White Fluorescent' => 'Fluorescent blanc',
'WhiteFluorescent' => 'Fluorescent blanc',
},
},
'WhiteBalanceAdj' => {
PrintConv => {
'Cloudy' => 'Temps nuageux',
'Daylight' => 'Lumière du jour',
'Fluorescent' => 'Fluorescente',
'Off' => 'Désactivé',
'On' => 'Activé',
'Shade' => 'Ombre',
'Tungsten' => 'Tungstène (lumière incandescente)',
},
},
'WhiteBalanceMode' => {
Description => 'Mode de balance des blancs',
PrintConv => {
'Auto (Cloudy)' => 'Auto (nuageux)',
'Auto (Daylight)' => 'Auto (lumière du jour)',
'Auto (DaylightFluorescent)' => 'Auto (fluo lum. jour)',
'Auto (DaywhiteFluorescent)' => 'Auto (fluo jour)',
'Auto (Flash)' => 'Auto (flash)',
'Auto (Shade)' => 'Auto (ombre)',
'Auto (Tungsten)' => 'Auto (tungstène)',
'Auto (WhiteFluorescent)' => 'Auto (fluo blanc)',
'Unknown' => 'Inconnu',
'User-Selected' => 'Sélectionnée par l\'utilisateur',
},
},
'WhiteBalanceSet' => {
Description => 'Réglage de balance des blancs',
PrintConv => {
'Cloudy' => 'Temps nuageux',
'Daylight' => 'Lumière du jour',
'DaylightFluorescent' => 'Fluorescente type jour',
'DaywhiteFluorescent' => 'Fluorescent blanc jour',
'Manual' => 'Manuelle',
'Set Color Temperature 1' => 'Température de couleur définie 1',
'Set Color Temperature 2' => 'Température de couleur définie 2',
'Set Color Temperature 3' => 'Température de couleur définie 3',
'Shade' => 'Ombre',
'Tungsten' => 'Tungstène (lumière incandescente)',
'WhiteFluorescent' => 'Fluorescent blanc',
},
},
'WhiteLevel' => 'Niveau blanc',
'WhitePoint' => 'Chromaticité du point blanc',
'WideRange' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
'WorldTimeLocation' => {
Description => 'Position en temps mondial',
PrintConv => {
'Hometown' => 'Résidence',
},
},
'Writer-Editor' => 'Auteur de la légende / description',
'XClipPathUnits' => 'Unités de chemin de rognage en X',
'XPAuthor' => 'Auteur',
'XPComment' => 'Commentaire',
'XPKeywords' => 'Mots clé',
'XPSubject' => 'Sujet',
'XPTitle' => 'Titre',
'XPosition' => 'Position en X',
'XResolution' => 'Résolution d\'image horizontale',
'YCbCrCoefficients' => 'Coefficients de la matrice de transformation de l\'espace de couleurs',
'YCbCrPositioning' => {
Description => 'Positionnement Y et C',
PrintConv => {
'Centered' => 'Centré',
'Co-sited' => 'Côte à côte',
},
},
'YCbCrSubSampling' => 'Rapport de sous-échantillonnage Y à C',
'YClipPathUnits' => 'Unités de chemin de rognage en Y',
'YPosition' => 'Position en Y',
'YResolution' => 'Résolution d\'image verticale',
'Year' => 'Année',
'ZoneMatchingOn' => {
PrintConv => {
'Off' => 'Désactivé',
'On' => 'Activé',
},
},
);
1; # end
__END__
=head1 NAME
Image::ExifTool::Lang::fr.pm - ExifTool French language translations
=head1 DESCRIPTION
This file is used by Image::ExifTool to generate localized tag descriptions
and values.
=head1 AUTHOR
Copyright 2003-2009, Phil Harvey (phil at owl.phy.queensu.ca)
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=head1 ACKNOWLEDGEMENTS
Thanks to Jens Duttke, Bernard Guillotin and Jean Piquemal for providing
this translation.
=head1 SEE ALSO
L<Image::ExifTool(3pm)|Image::ExifTool>,
L<Image::ExifTool::TagInfoXML(3pm)|Image::ExifTool::TagInfoXML>
=cut
| 34.123799 | 154 | 0.521369 |
ed6c9a2ee48184ea3d285a4c926b18995ff9dc58 | 4,157 | pm | Perl | lib/MIP/Program/Bzip2.pm | BuildJet/MIP | f1f63117a7324e37dbcaa16c0298f4b4c857d44c | [
"MIT"
] | null | null | null | lib/MIP/Program/Bzip2.pm | BuildJet/MIP | f1f63117a7324e37dbcaa16c0298f4b4c857d44c | [
"MIT"
] | null | null | null | lib/MIP/Program/Bzip2.pm | BuildJet/MIP | f1f63117a7324e37dbcaa16c0298f4b4c857d44c | [
"MIT"
] | null | null | null | 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 strict;
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::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 };
# Set the version for version checking
our $VERSION = 1.01;
# 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 = 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;
| 24.597633 | 114 | 0.48256 |
edc8d173e2ef2ec7aca47c12442816102cce2822 | 1,887 | pl | Perl | src/curl-7.9.8/src/mkhelp.pl | phochste/srepod | 6dcf220ce96ae7d2f943c27f3533c19e79335144 | [
"BSD-3-Clause"
] | null | null | null | src/curl-7.9.8/src/mkhelp.pl | phochste/srepod | 6dcf220ce96ae7d2f943c27f3533c19e79335144 | [
"BSD-3-Clause"
] | null | null | null | src/curl-7.9.8/src/mkhelp.pl | phochste/srepod | 6dcf220ce96ae7d2f943c27f3533c19e79335144 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/local/bin/perl
# Yeah, I know, probably 1000 other persons already wrote a script like
# this, but I'll tell ya:
# THEY DON'T FIT ME :-)
# Get readme file as parameter:
$README = $ARGV[0];
if($README eq "") {
print "usage: mkreadme.pl <README>\n";
exit;
}
push @out, " _ _ ____ _ \n";
push @out, " Project ___| | | | _ \\| | \n";
push @out, " / __| | | | |_) | | \n";
push @out, " | (__| |_| | _ <| |___ \n";
push @out, " \\___|\\___/|_| \\_\\_____|\n";
$head=0;
loop:
while (<STDIN>) {
$line = $_;
# this kind should be removed first:
$line =~ s/_//g;
# then this:
$line =~ s/.//g;
if($line =~ /^curl/i) {
# cut off the page headers
$head=1;
next loop;
}
if($line =~ /^[ \t]*\n/) {
$wline++;
# we only make one empty line max
next loop;
}
if($wline) {
$wline = 0;
if(!$head) {
push @out, "\n";
}
$head =0;
}
push @out, $line;
}
push @out, "\n"; # just an extra newline
open(READ, "<$README") ||
die "couldn't read the README infile";
while(<READ>) {
push @out, $_;
}
close(READ);
print "/* NEVER EVER edit this manually, fix the mkhelp script instead! */\n"
;
print "#include <stdio.h>\n";
print "void hugehelp(void)\n";
print "{\n";
print "puts (\n";
$outsize=0;
for(@out) {
chop;
$new = $_;
$outsize += length($new)+1; # one for the newline
$new =~ s/\\/\\\\/g;
$new =~ s/\"/\\\"/g;
# gcc 2.96 claims ISO C89 only is required to support 509 letter strings
if($outsize > 500) {
# terminate and make another puts() call here
print ");\n puts(\n";
$outsize=length($new)+1;
}
printf("\"%s\\n\"\n", $new);
}
print " ) ;\n}\n"
| 19.863158 | 77 | 0.470058 |
edb1e5351105c457f99e164f01736ecefb92a337 | 5,976 | pm | Perl | lib/Mojolicious/Renderer.pm | gbarr/mojo | d618f3b4d3c469994054fd4c19fe615eb8cdf478 | [
"Artistic-2.0"
] | 1 | 2016-05-08T16:41:24.000Z | 2016-05-08T16:41:24.000Z | lib/Mojolicious/Renderer.pm | gbarr/mojo | d618f3b4d3c469994054fd4c19fe615eb8cdf478 | [
"Artistic-2.0"
] | null | null | null | lib/Mojolicious/Renderer.pm | gbarr/mojo | d618f3b4d3c469994054fd4c19fe615eb8cdf478 | [
"Artistic-2.0"
] | null | null | null | # Copyright (C) 2008-2009, Sebastian Riedel.
package Mojolicious::Renderer;
use strict;
use warnings;
use base 'MojoX::Renderer';
use File::Spec;
use Mojo::ByteStream 'b';
use Mojo::Command;
use Mojo::Template;
__PACKAGE__->attr(helper => sub { {} });
__PACKAGE__->attr(_epl_cache => sub { {} });
# What do you want?
# I'm here to kick your ass!
# Wishful thinking. We have long since evolved beyond the need for asses.
sub new {
my $self = shift->SUPER::new(@_);
# Add "epl" handler
$self->add_handler(
epl => sub {
my ($r, $c, $output, $options) = @_;
# Template
my $t = $r->template_name($options);
my $path = $r->template_path($options);
my $cache = $options->{cache} || $path;
# Check cache
my $mt = $r->_epl_cache->{$cache};
# Interpret again
if ($mt && $mt->compiled) { $$output = $mt->interpret($c) }
# No cache
else {
# Initialize
$mt ||= Mojo::Template->new;
# Class
my $class =
$c->stash->{template_class}
|| $ENV{MOJO_TEMPLATE_CLASS}
|| 'main';
# Try template
if (-r $path) { $$output = $mt->render_file($path, $c) }
# Try DATA section
elsif (my $d = Mojo::Command->new->get_data($t, $class)) {
$$output = $mt->render($d, $c);
}
# No template
else {
$c->app->log->error(
qq/Template "$t" missing or not readable./)
and return;
}
# Cache
$r->_epl_cache->{$cache} = $mt;
}
# Exception
if (ref $$output) {
my $e = $$output;
$$output = '';
# Log
$c->app->log->error(qq/Template error in "$t": $e/);
# Development mode
if ($c->app->mode eq 'development') {
# Exception template failed
return if $c->stash->{exception};
# Render exception template
$c->stash(exception => $e);
$c->res->code(500);
$c->res->body(
$c->render(
partial => 1,
template => 'exception',
format => 'html'
)
);
return 1;
}
}
# Success or exception?
return ref $$output ? 0 : 1;
}
);
# Add "ep" handler
$self->add_handler(
ep => sub {
my ($r, $c, $output, $options) = @_;
# Generate name
my $path = $r->template_path($options);
my $list = join ', ', sort keys %{$c->stash};
my $cache = $options->{cache} =
b("$path($list)")->md5_sum->to_string;
# Stash defaults
$c->stash->{layout} ||= undef;
# Cache
unless ($r->_epl_cache->{$cache}) {
# Debug
$c->app->log->debug(
qq/Caching template "$path" with stash "$list"./);
# Initialize
my $mt = $r->_epl_cache->{$cache} = Mojo::Template->new;
$mt->namespace("Mojo::Template::$cache");
# Self
my $prepend = 'my $self = shift;';
# Be a bit more relaxed for helpers
$prepend .= q/no strict 'refs'; no warnings 'redefine';/;
# Helpers
for my $name (sort keys %{$self->helper}) {
next unless $name =~ /^\w+$/;
$prepend .= "sub $name;";
$prepend .= " *$name = sub { \$self->app->renderer";
$prepend .= "->helper->{'$name'}->(\$self, \@_) };";
}
# Be less relaxed for everything else
$prepend .= q/use strict; use warnings;/;
# Stash
my $append = '';
for my $var (keys %{$c->stash}) {
next unless $var =~ /^\w+$/;
$prepend .= " my \$$var = \$self->stash->{'$var'};";
$append .= " \$self->stash->{'$var'} = \$$var;";
}
# Prepend
$mt->prepend($prepend);
# Append
$mt->append($append);
}
# Render with epl
return $r->handler->{epl}->($r, $c, $output, $options);
}
);
# Add "url_for" helper
$self->add_helper(url_for => sub { shift->url_for(@_) });
# Set default handler to "epl"
$self->default_handler('epl');
return $self;
}
sub add_helper {
my $self = shift;
# Merge
my $helper = ref $_[0] ? $_[0] : {@_};
$helper = {%{$self->helper}, %$helper};
$self->helper($helper);
return $self;
}
1;
__END__
=head1 NAME
Mojolicious::Renderer - Renderer
=head1 SYNOPSIS
use Mojolicious::Renderer;
my $renderer = Mojolicious::Renderer->new;
=head1 DESCRIPTION
L<Mojolicous::Renderer> is the default L<Mojolicious> renderer.
=head1 ATTRIBUTES
L<Mojolicious::Renderer> inherits all attributes from L<MojoX::Renderer> and
implements the following new ones.
=head2 C<helper>
my $helper = $renderer->helper;
$renderer = $renderer->helper({url_for => sub { ... }});
=head1 METHODS
L<Mojolicious::Renderer> inherits all methods from L<MojoX::Renderer> and
implements the following new ones.
=head2 C<new>
my $renderer = Mojolicious::Renderer->new;
=head2 C<add_helper>
$renderer = $renderer->add_helper(url_for => sub { ... });
=cut
| 26.09607 | 76 | 0.442771 |
ed963f42ab83268ef52fe06a24e88409cb6db66a | 4,106 | t | Perl | t/check_ids_in_dna_vcf.t | Clinical-Genomics/MIP | db2e89fec2674f5c12dbf6ec89eba181433fc742 | [
"MIT"
] | 22 | 2017-09-04T07:50:54.000Z | 2022-01-01T20:41:45.000Z | t/check_ids_in_dna_vcf.t | Clinical-Genomics/MIP | db2e89fec2674f5c12dbf6ec89eba181433fc742 | [
"MIT"
] | 834 | 2017-09-05T07:18:38.000Z | 2022-03-31T15:27:49.000Z | t/check_ids_in_dna_vcf.t | Clinical-Genomics/MIP | db2e89fec2674f5c12dbf6ec89eba181433fc742 | [
"MIT"
] | 11 | 2017-09-12T10:53:30.000Z | 2021-11-30T01:40:49.000Z | #!/usr/bin/env perl
use 5.026;
use Carp;
use charnames qw{ :full :short };
use English qw{ -no_match_vars };
use File::Basename qw{ dirname };
use File::Spec::Functions qw{ catdir catfile };
use FindBin qw{ $Bin };
use open qw{ :encoding(UTF-8) :std };
use Params::Check qw{ allow check last_error };
use Test::More;
use utf8;
use warnings qw{ FATAL utf8 };
## CPANM
use autodie qw { :all };
use Modern::Perl qw{ 2018 };
use Test::Trap qw{ :stderr:output(systemsafe) };
## MIPs lib/
use lib catdir( dirname($Bin), q{lib} );
use MIP::Constants qw{ $COMMA $SPACE };
use MIP::Test::Fixtures qw{ test_constants test_log test_mip_hashes };
BEGIN {
use MIP::Test::Fixtures qw{ test_import };
### Check all internal dependency modules and imports
## Modules with import
my %perl_module = (
q{MIP::Analysis} => [qw{ check_ids_in_dna_vcf }],
q{MIP::Test::Fixtures} => [qw{ test_log test_mip_hashes }],
);
test_import( { perl_module_href => \%perl_module, } );
}
use MIP::Analysis qw{ check_ids_in_dna_vcf };
diag( q{Test check_ids_in_dna_vcf from Analysis.pm}
. $COMMA
. $SPACE . q{Perl}
. $SPACE
. $PERL_VERSION
. $SPACE
. $EXECUTABLE_NAME );
test_log( {} );
## Given matching dna and rna sample ids
my %active_parameter = test_mip_hashes( { mip_hash_name => q{active_parameter} } );
my %sample_info = test_mip_hashes( { mip_hash_name => q{qc_sample_info} } );
my $vcf_file_path = catfile( dirname($Bin),
qw{ t data test_data 643594-miptest_sorted_md_brecal_comb_BOTH.bcf } );
my %test_process_return = (
buffers_ref => [],
error_message => undef,
stderrs_ref => [],
stdouts_ref => [q{ADM1059A1 ADM1059A2 ADM1059A3}],
success => 1,
);
test_constants(
{
test_process_return_href => \%test_process_return,
}
);
my $is_ok = check_ids_in_dna_vcf(
{
active_parameter_href => \%active_parameter,
dna_vcf_file => $vcf_file_path,
sample_info_href => \%sample_info,
}
);
## Then return ok
ok( $is_ok, q{Found matching RNA and DNA samples} );
## Given dna samples that doesn't match the rna samples
@{ $active_parameter{sample_ids} } = qw{ ADM1059A4 ADM1059A5 ADM1059A6 };
SAMPLE_ID:
foreach my $sample_id ( @{ $active_parameter{sample_ids} } ) {
$sample_info{sample}{$sample_id}{subject}{dna_sample_id} = $sample_id;
}
trap {
check_ids_in_dna_vcf(
{
active_parameter_href => \%active_parameter,
dna_vcf_file => $vcf_file_path,
sample_info_href => \%sample_info,
}
)
};
## Then exit and print fatal message
is( $trap->exit, 1, q{Exit when no samples match} );
like(
$trap->stderr,
qr/No\smatching\ssample\sids/xms,
q{Print error message when no samples match}
);
## Given that some dna samples match
@{ $active_parameter{sample_ids} } = qw{ ADM1059A1 ADM1059A5 ADM1059A6 };
$sample_info{sample}{ADM1059A1}{subject}{dna_sample_id} = q{ADM1059A1};
trap {
check_ids_in_dna_vcf(
{
active_parameter_href => \%active_parameter,
dna_vcf_file => $vcf_file_path,
sample_info_href => \%sample_info,
}
)
};
## Then exit and print fatal message
is( $trap->exit, 1, q{Exit on partial sample match} );
like( $trap->stderr, qr/Only\spartial\smatch/xms,
q{Print error message on partial sample match} );
## Given partial match and force flag
$active_parameter{force_dna_ase} = 1;
trap {
check_ids_in_dna_vcf(
{
active_parameter_href => \%active_parameter,
dna_vcf_file => $vcf_file_path,
sample_info_href => \%sample_info,
}
)
};
## Then warn and set no_ase_samples array
is( $trap->leaveby, q{return}, q{Return on partial sample match and force flag} );
like( $trap->stderr, qr/Turning\soff\sASE/xms,
q{Print warning message on partial sample match and force flag} );
is_deeply( \@{ $active_parameter{no_ase_samples} },
[qw{ADM1059A5 ADM1059A6}], q{Set no ASE samples} );
done_testing();
| 28.915493 | 83 | 0.647345 |
ed5504cb1a46e79820ae8bad324c3a73598b2737 | 428 | t | Perl | t/01-Games-Tictactoe-new.t | gitpan/Games-TicTacToe | e0934f47644dc8c65575f1b8640e11aeb57efb46 | [
"Artistic-2.0",
"Unlicense"
] | null | null | null | t/01-Games-Tictactoe-new.t | gitpan/Games-TicTacToe | e0934f47644dc8c65575f1b8640e11aeb57efb46 | [
"Artistic-2.0",
"Unlicense"
] | null | null | null | t/01-Games-Tictactoe-new.t | gitpan/Games-TicTacToe | e0934f47644dc8c65575f1b8640e11aeb57efb46 | [
"Artistic-2.0",
"Unlicense"
] | null | null | null | #!perl
use strict; use warnings;
use Games::TicTacToe;
use Test::More tests => 3;
my ($tictactoe);
eval { $tictactoe = Games::TicTacToe->new(current => 'm'); };
like($@, qr/isa check for "current" failed/);
eval { $tictactoe = Games::TicTacToe->new(board => undef); };
like($@, qr/isa check for "board" failed/);
eval { $tictactoe = Games::TicTacToe->new(players => undef); };
like($@, qr/isa check for "players" failed/);
| 25.176471 | 63 | 0.647196 |
edbbc77adf324c4750dd34276f997cddcd50e76f | 3,444 | pm | Perl | lib/MetaCPAN/Sitemap.pm | skaji/metacpan-web | 8daecc2861cdf96f485d20a03e03d31b5bd833a4 | [
"Artistic-1.0"
] | null | null | null | lib/MetaCPAN/Sitemap.pm | skaji/metacpan-web | 8daecc2861cdf96f485d20a03e03d31b5bd833a4 | [
"Artistic-1.0"
] | null | null | null | lib/MetaCPAN/Sitemap.pm | skaji/metacpan-web | 8daecc2861cdf96f485d20a03e03d31b5bd833a4 | [
"Artistic-1.0"
] | null | null | null | package MetaCPAN::Sitemap;
=head1 DESCRIPTION
Generate an XML file containing URLs use by the robots.txt Sitemap. We use this
module to generate one each for authors, modules and releases.
=cut
use strict;
use warnings;
use MetaCPAN::Moose;
use autodie;
use Carp;
use Search::Elasticsearch;
use File::Spec;
use MetaCPAN::Web::Types qw( HashRef Int Str );
use MooseX::StrictConstructor;
use PerlIO::gzip;
use XML::Simple qw(:strict);
has [ 'cpan_directory', 'object_type', 'field_name', 'xml_file', ] => (
is => 'ro',
isa => Str,
required => 1,
);
has 'filter' => (
is => 'ro',
isa => HashRef,
);
has 'size' => (
is => 'ro',
isa => Int,
);
# Mandatory arguments to this function are
# [] search object_type (author and release)
# [] result field_name (pauseid and distribution)
# [] name of output xml_file (path to the output XML file)
# Optional arguments to this function are
# [] output cpan_directory (author and release)
# [] test_search (search count - if non-zero, limits search to that number of
# items for testing)
# [] filter - contains filter for a field that also needs to be included in
# the list of form fields.
sub process {
my $self = shift;
# Check that a) the directory where the output file wants to be does
# actually exist and b) the directory itself is writeable.
# Get started. Create the ES object and the scrolled search object.
# XXX Remove this hardcoded URL
my $es = Search::Elasticsearch->new(
cxn_pool => 'Static::NoPing',
nodes => ['api.metacpan.org'],
send_get_body_as => 'POST',
);
my $field_name = $self->field_name;
# Start off with standard search parameters ..
my %search_parameters = (
index => 'v0',
size => 5000,
type => $self->object_type,
fields => [$field_name],
);
# ..and augment them if necesary.
if ( $self->filter ) {
# Copy the filter over wholesale into the search parameters, and add
# the filter fields to the field list.
$search_parameters{'body'}{'query'}{'match'} = $self->filter;
push @{ $search_parameters{'fields'} }, keys %{ $self->filter };
}
my $scrolled_search = $es->scroll_helper(%search_parameters);
# Open the output file, get ready to pump out the XML.
open my $fh, '>:gzip', $self->xml_file;
my @urls;
my $metacpan_url = q{};
if ( $self->cpan_directory ) {
$metacpan_url
= 'https://metacpan.org/' . $self->cpan_directory . q{/};
}
while ( $scrolled_search->refill_buffer ) {
push @urls,
map { $metacpan_url . $_->{'fields'}->{$field_name} }
$scrolled_search->drain_buffer;
}
$_ = $_ . q{ } for @urls;
$self->{size} = @urls;
my $xml = XMLout(
{
'xmlns' => 'http://www.sitemaps.org/schemas/sitemap/0.9',
'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
'xsi:schemaLocation' =>
'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/siteindex.xsd',
'url' => [ sort @urls ],
},
'KeyAttr' => [],
'RootName' => 'urlset',
'XMLDecl' => q/<?xml version='1.0' encoding='UTF-8'?>/,
'OutputFile' => $fh,
);
close $fh;
return;
}
__PACKAGE__->meta->make_immutable;
1;
| 26.492308 | 120 | 0.595528 |
edb4cf4501307c20cd57d7d6d0552ac1d308a5bd | 1,804 | pl | Perl | swi_prolog/organize_day.pl | tias/hakank | 87b7f180c9393afce440864eb9e5fb119bdec1a4 | [
"MIT"
] | 279 | 2015-01-10T09:55:35.000Z | 2022-03-28T02:34:03.000Z | swi_prolog/organize_day.pl | tias/hakank | 87b7f180c9393afce440864eb9e5fb119bdec1a4 | [
"MIT"
] | 10 | 2017-10-05T15:48:50.000Z | 2021-09-20T12:06:52.000Z | swi_prolog/organize_day.pl | tias/hakank | 87b7f180c9393afce440864eb9e5fb119bdec1a4 | [
"MIT"
] | 83 | 2015-01-20T03:44:00.000Z | 2022-03-13T23:53:06.000Z | /*
Organize a day in SWI Prolog
From Andy King: "(Finite domain) constraint logic programming"
https://eclipseclp.org/reports/eclipse.ppt
(Slide 38: "How to organise your day")
Model created by Hakan Kjellerstrand, [email protected]
See also my SWI Prolog page: http://www.hakank.org/swi_prolog/
*/
:- use_module(library(clpfd)).
:- use_module(hakank_utils).
go :-
TasksStr = ["Work","Mail","Shop","Bank"],
length(TasksStr,N),
length(Begins,N),
Begins ins 9..17,
length(Ends,N),
Ends ins 9..17,
durations(Durations),
before_tasks(BeforeTasks),
findall([Begins,Ends], organize(Durations,BeforeTasks,Begins, Ends),L),
forall(member([BB,EE],L),
(
forall(between(1,N,Task),
(
nth1(Task,TasksStr,S),
nth1(Task,BB,B),
nth1(Task,EE,E),
format("~w: ~d .. ~d~n",[S,B,E])
)
),
nl
)
),
nl.
organize(Durations,BeforeTasks,Begins,Ends) :-
maplist(begin_plus_duration,Begins,Durations,Ends),
%% no_overlaps
serialized(Begins,Durations),
% handle precendeces
maplist(precedence(Begins,Ends),BeforeTasks),
% Work >= 11 a clock
element(1,Begins,Begins1),
Begins1 #>= 11,
flatten([Begins,Ends],Vars),
label(Vars).
begin_plus_duration(Begin,Duration,End) :-
End #= Begin + Duration.
precedence(Begins,Ends,[A,B]) :-
element(A,Ends,EndsA),
element(B,Begins,BeginsB),
EndsA #=< BeginsB.
% duration of the four tasks
durations(Durations) :-
Durations = [4,1,2,1].
% precedences
% [A,B] : task A must be completed before task B
before_tasks(Before) :-
Before = [[4,3],[2,1]].
| 21.73494 | 74 | 0.57816 |
73f349f7f9d5bf5acd9ca2715fcf5abaab0fa005 | 2,593 | pl | Perl | bin/RNASeq2BigWig.pl | genomecuration/JAM | 8b834d3efe32f79c48887c2797005619ac2c3a1d | [
"BSD-3-Clause"
] | null | null | null | bin/RNASeq2BigWig.pl | genomecuration/JAM | 8b834d3efe32f79c48887c2797005619ac2c3a1d | [
"BSD-3-Clause"
] | null | null | null | bin/RNASeq2BigWig.pl | genomecuration/JAM | 8b834d3efe32f79c48887c2797005619ac2c3a1d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env perl
=pod
=head1 USAGE
Create BigWig files for JBrowse
Mandatory options:
-bam|in s The input BAM file (co-ordinate sorted).
-genome|fasta s The genome assembly FASTA file.
NB: Needs bedGraphToBigWig from Kent's src code
git clone git://genome-source.cse.ucsc.edu/kent.git
=head1 AUTHORS
Alexie Papanicolaou
CSIRO Ecosystem Sciences
[email protected]
=head1 DISCLAIMER & LICENSE
Copyright 2012-2014 the Commonwealth Scientific and Industrial Research Organization.
See LICENSE file for license info
It is provided "as is" without warranty of any kind.
=cut
use strict;
use warnings;
use FindBin qw($RealBin);
use Pod::Usage;
use Getopt::Long;
use lib ("$RealBin/../PerlLib");
$ENV{PATH} .= ":$RealBin:$RealBin/../3rd_party/bin/";
my ( @bamfiles, $genome, $help );
pod2usage $! unless &GetOptions(
'help' => \$help,
'bam|in:s{,}' => \@bamfiles,
'genome|fasta:s' => \$genome,
);
pod2usage if $help;
pod2usage "Cannot find the BAM or genome FASTA file\n"
unless $bamfiles[0]
&& -s $bamfiles[0]
&& $genome
&& ( -s $genome || -s $genome . '.fai' );
my ( $samtools_exec, $bedtools_exec, $bigwig_exec ) = &check_program( 'samtools', 'bedtools','bedGraphToBigWig' );
&process_cmd("$samtools_exec faidx $genome") unless -s $genome . '.fai';
die "Cannot index genome $genome\n" unless -s $genome . '.fai';
my $master_bamfile;
if (scalar(@bamfiles == 1)){
$master_bamfile = $bamfiles[0];
}else{
foreach my $bamfile (@bamfiles){
die "Cannot find $bamfile\n" unless -s $bamfile;
}
$master_bamfile = 'master_bamfile.bam';
&process_cmd("$samtools_exec merge -\@2 -r $master_bamfile ".join(" ",@bamfiles)) unless -s $master_bamfile;
}
&process_cmd("$bedtools_exec genomecov -split -bg -g $genome.fai -ibam $master_bamfile| sort -S 1G -k1,1 -k2,2n > $master_bamfile.coverage.bg");
&process_cmd("$bigwig_exec $master_bamfile.coverage.bg $genome.fai $master_bamfile.coverage.bw");
print "Done. See $master_bamfile.coverage.bw\n";
###
sub check_program() {
my @paths;
foreach my $prog (@_) {
my $path = `which $prog`;
pod2usage "Error, path to a required program ($prog) cannot be found\n\n"
unless $path =~ /^\//;
chomp($path);
#$path = readlink($path) if -l $path;
push( @paths, $path );
}
return @paths;
}
###
sub process_cmd {
my ($cmd) = @_;
print "CMD: $cmd\n";
my $ret = system($cmd);
if ( $ret && $ret != 256 ) {
die "Error, cmd died with ret $ret\n";
}
return $ret;
}
| 24.233645 | 144 | 0.642113 |
ed58d0d4d665696b2d446d5cd8815fb294a25aa3 | 1,476 | pm | Perl | lib/Kharon/InputValidation.pm | elric1/kharon | cbecff4d0938e9c571aceb330360cffcf8c4cfbd | [
"Unlicense"
] | 3 | 2015-12-30T14:42:54.000Z | 2018-10-16T03:54:03.000Z | lib/Kharon/InputValidation.pm | elric1/kharon | cbecff4d0938e9c571aceb330360cffcf8c4cfbd | [
"Unlicense"
] | null | null | null | lib/Kharon/InputValidation.pm | elric1/kharon | cbecff4d0938e9c571aceb330360cffcf8c4cfbd | [
"Unlicense"
] | null | null | null | #
# The InputValidation hierarchy allows for extensible input checks.
#
# Kharon::InputValidation objects are expected to inherit from this
# object and override validate(). Each time a method is called,
# validate() will be called with: $self, $verb, @args. If the input
# is to be rejected, an exception should be thrown describing why the
# input fails to be valid. If the input is acceptable, undef should
# be returned. To change the input to the underlying function, return
# an array ref containing the new argument list.
package Kharon::InputValidation;
use base qw(Kharon);
use Exporter qw/import/;
@EXPORT_OK = qw{
KHARON_IV_NO_ARGS
KHARON_IV_ONE_SCALAR
};
use strict;
use warnings;
sub new {
my ($proto, %args) = @_;
my $class = ref($proto) || $proto;
my $self = {};
bless($self, $class);
return $self;
}
sub validate {
# Base class doesn't modify input parameters
return undef;
}
#
# Shared utility functions:
sub KHARON_IV_NO_ARGS {
my ($self, $verb, @args) = @_;
my $usage = "$verb";
if (@args) {
die [503, "Syntax error: too many args\n$usage"];
}
return undef;
}
sub KHARON_IV_ONE_SCALAR {
my ($self, $verb, @args) = @_;
my $usage = "$verb <arg>";
if (@args < 1) {
die [503, "Syntax error: no args\nusage: $usage"];
}
if (@args > 1) {
die [503, "Syntax error: too many args\nusage: $usage"];
}
if (ref($args[0]) ne '') {
die [503, "Syntax error: arg 1 not a scalar\nusage: $usage"];
}
return undef;
}
1;
| 19.421053 | 70 | 0.668699 |
ed60d7bf816e4afdecfa6dd34fe75980db419714 | 6,472 | pm | Perl | lib/Pod/Elemental/Transformer/Nester.pm | gitpan/Pod-Elemental | c422854e4c3c4ac1019d680aa3d3881bb6bd2051 | [
"Artistic-1.0"
] | null | null | null | lib/Pod/Elemental/Transformer/Nester.pm | gitpan/Pod-Elemental | c422854e4c3c4ac1019d680aa3d3881bb6bd2051 | [
"Artistic-1.0"
] | null | null | null | lib/Pod/Elemental/Transformer/Nester.pm | gitpan/Pod-Elemental | c422854e4c3c4ac1019d680aa3d3881bb6bd2051 | [
"Artistic-1.0"
] | null | null | null | package Pod::Elemental::Transformer::Nester;
# ABSTRACT: group the document into sections
$Pod::Elemental::Transformer::Nester::VERSION = '0.103004';
use Moose;
with 'Pod::Elemental::Transformer';
#pod =head1 OVERVIEW
#pod
#pod The Nester transformer is meant to find potential container elements and make
#pod them into actual containers. It works by being told what elements may be made
#pod into containers and what subsequent elements they should allow to be stuffed
#pod into them.
#pod
#pod For example, given the following nester:
#pod
#pod use Pod::Elemental::Selectors qw(s_command s_flat);
#pod
#pod my $nester = Pod::Elemental::Transformer::Nester->new({
#pod top_selector => s_command('head1'),
#pod content_selectors => [
#pod s_command([ qw(head2 head3 head4) ]),
#pod s_flat,
#pod ],
#pod });
#pod
#pod ..then when we apply the transformation:
#pod
#pod $nester->transform_node($document);
#pod
#pod ...the nester will find all C<=head1> elements in the top-level of the
#pod document. It will ensure that they are represented by objects that perform the
#pod Pod::Elemental::Node role, and then it will move all subsequent elements
#pod matching the C<content_selectors> into the container.
#pod
#pod So, if we start with this input:
#pod
#pod =head1 Header
#pod =head2 Subheader
#pod Pod5::Ordinary <some content>
#pod =head1 New Header
#pod
#pod The nester will convert its structure to look like this:
#pod
#pod =head1 Header
#pod =head2 Subheader
#pod Pod5::Ordinary <some content>
#pod =head1 New Header
#pod
#pod Once an element is reached that does not pass the content selectors, the
#pod nesting ceases until the next potential container.
#pod
#pod =cut
use MooseX::Types::Moose qw(ArrayRef CodeRef);
use Pod::Elemental::Element::Nested;
use Pod::Elemental::Selectors -all;
use namespace::autoclean;
#pod =attr top_selector
#pod
#pod This attribute must be a coderef (presumably made from
#pod Pod::Elemental::Selectors) that will test elements in the transformed node and
#pod return true if the element is a potential new container.
#pod
#pod =cut
has top_selector => (
is => 'ro',
isa => CodeRef,
required => 1,
);
#pod =attr content_selectors
#pod
#pod This attribute must be an arrayref of coderefs (again presumably made from
#pod Pod::Elemental::Selectors) that will test whether paragraphs subsequent to the
#pod top-level container may be moved under the container.
#pod
#pod =cut
has content_selectors => (
is => 'ro',
isa => ArrayRef[ CodeRef ],
required => 1,
);
sub _is_containable {
my ($self, $para) = @_;
for my $sel (@{ $self->content_selectors }) {
return 1 if $sel->($para);
}
return;
}
sub transform_node {
my ($self, $node) = @_;
# We used to say (length -2) because "if we're already at the last element,
# we can't nest anything -- there's nothing subsequent to the potential
# top-level element to nest!" -- my (rjbs's) reasoning in 2009.
#
# This was an unneeded optimization, and therefore stupid. Worse, it was a
# bug. It meant that a nestable element that was the last element in a
# sequence wouldn't be upgraded to a Nested element, so later munging could
# barf. In fact, that's what happened in [rt.cpan.org #69189]
# -- rjbs, 2012-05-04
PASS: for my $i (0 .. @{ $node->children }- 1) {
last PASS if $i >= @{ $node->children };
my $para = $node->children->[ $i ];
next unless $self->top_selector->($para);
if (s_command(undef, $para) and not s_node($para)) {
$para = $node->children->[ $i ] = Pod::Elemental::Element::Nested->new({
command => $para->command,
content => $para->content,
});
}
if (! s_node($para) or @{ $para->children }) {
confess "can't use $para as the top of a nesting";
}
my @to_nest;
NEST: for my $j ($i+1 .. @{ $node->children } - 1) {
last unless $self->_is_containable($node->children->[ $j ]);
push @to_nest, $j;
}
if (@to_nest) {
my @to_nest_elem =
splice @{ $node->children }, $to_nest[0], scalar(@to_nest);
push @{ $para->children }, @to_nest_elem;
next PASS;
}
}
return $node;
}
__PACKAGE__->meta->make_immutable;
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Pod::Elemental::Transformer::Nester - group the document into sections
=head1 VERSION
version 0.103004
=head1 OVERVIEW
The Nester transformer is meant to find potential container elements and make
them into actual containers. It works by being told what elements may be made
into containers and what subsequent elements they should allow to be stuffed
into them.
For example, given the following nester:
use Pod::Elemental::Selectors qw(s_command s_flat);
my $nester = Pod::Elemental::Transformer::Nester->new({
top_selector => s_command('head1'),
content_selectors => [
s_command([ qw(head2 head3 head4) ]),
s_flat,
],
});
..then when we apply the transformation:
$nester->transform_node($document);
...the nester will find all C<=head1> elements in the top-level of the
document. It will ensure that they are represented by objects that perform the
Pod::Elemental::Node role, and then it will move all subsequent elements
matching the C<content_selectors> into the container.
So, if we start with this input:
=head1 Header
=head2 Subheader
Pod5::Ordinary <some content>
=head1 New Header
The nester will convert its structure to look like this:
=head1 Header
=head2 Subheader
Pod5::Ordinary <some content>
=head1 New Header
Once an element is reached that does not pass the content selectors, the
nesting ceases until the next potential container.
=head1 ATTRIBUTES
=head2 top_selector
This attribute must be a coderef (presumably made from
Pod::Elemental::Selectors) that will test elements in the transformed node and
return true if the element is a potential new container.
=head2 content_selectors
This attribute must be an arrayref of coderefs (again presumably made from
Pod::Elemental::Selectors) that will test whether paragraphs subsequent to the
top-level container may be moved under the container.
=head1 AUTHOR
Ricardo SIGNES <[email protected]>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Ricardo SIGNES.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
| 27.540426 | 84 | 0.704419 |
ed87397bf6a21ee11b24058dce5e970ab7e53bc7 | 14,443 | pm | Perl | lib/Chart/Clicker/Axis.pm | brunoV/chart-clicker | 7e88b1b40eb3a789b4602bf46caa2bfd5c88b96e | [
"Artistic-1.0"
] | 1 | 2016-05-09T04:45:05.000Z | 2016-05-09T04:45:05.000Z | lib/Chart/Clicker/Axis.pm | brunoV/chart-clicker | 7e88b1b40eb3a789b4602bf46caa2bfd5c88b96e | [
"Artistic-1.0"
] | null | null | null | lib/Chart/Clicker/Axis.pm | brunoV/chart-clicker | 7e88b1b40eb3a789b4602bf46caa2bfd5c88b96e | [
"Artistic-1.0"
] | null | null | null | package Chart::Clicker::Axis;
use Moose;
extends 'Chart::Clicker::Container';
with 'Chart::Clicker::Positioned';
use Chart::Clicker::Data::Range;
use Graphics::Color::RGB;
use Graphics::Primitive::Font;
use Layout::Manager::Absolute;
use Math::Trig ':pi';
use Moose::Util::TypeConstraints;
use MooseX::AttributeHelpers;
type 'StrOrCodeRef' => where { (ref($_) eq "") || ref($_) eq 'CODE' };
has 'tick_label_angle' => (
is => 'rw',
isa => 'Num'
);
has 'baseline' => (
is => 'rw',
isa => 'Num',
);
# Remove for border...
has 'brush' => (
is => 'rw',
isa => 'Graphics::Primitive::Brush',
default => sub {
Graphics::Primitive::Brush->new(
color => Graphics::Color::RGB->new(
red => 1, green => 0, blue => 1, alpha => 1
),
width => 1
)
}
);
has '+color' => (
default => sub {
Graphics::Color::RGB->new({
red => 0, green => 0, blue => 0, alpha => 1
})
},
coerce => 1
);
has 'font' => (
is => 'rw',
isa => 'Graphics::Primitive::Font',
default => sub { Graphics::Primitive::Font->new }
);
has 'format' => ( is => 'rw', isa => 'StrOrCodeRef' );
has 'fudge_amount' => ( is => 'rw', isa => 'Num', default => 0 );
has 'hidden' => ( is => 'rw', isa => 'Bool', default => 0 );
has 'label' => ( is => 'rw', isa => 'Str' );
has '+layout_manager' => ( default => sub { Layout::Manager::Absolute->new });
has '+orientation' => (
required => 1
);
has '+position' => (
required => 1
);
has 'range' => (
is => 'rw',
isa => 'Chart::Clicker::Data::Range',
default => sub { Chart::Clicker::Data::Range->new }
);
has 'show_ticks' => ( is => 'rw', isa => 'Bool', default => 1 );
has 'staggered' => ( is => 'rw', isa => 'Bool', default => 0 );
has 'tick_brush' => (
is => 'rw',
isa => 'Graphics::Primitive::Brush',
default => sub { Graphics::Primitive::Brush->new }
);
has 'tick_labels' => (
is => 'rw',
isa => 'ArrayRef',
);
has 'tick_length' => ( is => 'rw', isa => 'Num', default => 3 );
has 'tick_values' => (
metaclass => 'Collection::Array',
is => 'rw',
isa => 'ArrayRef',
default => sub { [] },
provides => {
'push' => 'add_to_tick_values',
'clear' => 'clear_tick_values',
'count' => 'tick_value_count'
}
);
has 'ticks' => ( is => 'rw', isa => 'Int', default => 5 );
sub BUILD {
my ($self) = @_;
$self->padding(3);
}
override('prepare', sub {
my ($self, $driver) = @_;
$self->clear_components;
# The BUILD method above establishes a 5px padding at instantiation time.
# That saves us setting it elsewhere, but if 'hidden' feature is used,
# then we have to unset the padding. hidden (as explained below) is
# basically a hack as far as G:P is concerned to render an empty Axis.
# We want it to render because we need it prepared for other elements
# of the chart to work.
if($self->hidden) {
$self->padding(0);
}
super;
if($self->range->span == 0) {
die('This axis has a span of 0, that\'s fatal!');
}
if(defined($self->baseline)) {
if($self->range->lower > $self->baseline) {
$self->range->lower($self->baseline);
}
} else {
$self->baseline($self->range->lower);
}
if($self->fudge_amount) {
my $span = $self->range->span;
my $lower = $self->range->lower;
$self->range->lower($lower - abs($span * $self->fudge_amount));
my $upper = $self->range->upper;
$self->range->upper($upper + ($span * $self->fudge_amount));
}
if(!scalar(@{ $self->tick_values })) {
$self->tick_values($self->range->divvy($self->ticks + 1));
}
# Return now without setting a min height or width and allow
# Layout::Manager to to set it for us, this is how we 'hide'
return if $self->hidden;
my $font = $self->font;
my $bheight = 0;
my $bwidth = 0;
# Determine all this once... much faster.
my $i = 0;
foreach my $val (@{ $self->tick_values }) {
my $label = $val;
if(defined($self->tick_labels)) {
$label = $self->tick_labels->[$i];
} else {
$label = $self->format_value($val);
}
my $tlabel = Graphics::Primitive::TextBox->new(
text => $label,
font => $font,
color => $self->color,
);
if($self->tick_label_angle) {
$tlabel->angle($self->tick_label_angle);
}
my $lay = $driver->get_textbox_layout($tlabel);
$tlabel->prepare($driver);
$tlabel->width($lay->width);
$tlabel->height($lay->height);
$bwidth = $tlabel->width if($tlabel->width > $bwidth);
$bheight = $tlabel->height if($tlabel->height > $bheight);
$self->add_component($tlabel);
$i++;
}
my $big = $bheight;
if($self->is_vertical) {
$big = $bwidth;
}
if($self->show_ticks) {
$big += $self->tick_length;
}
my $label_width = 0;
my $label_height = 0;
if ($self->label) {
my $angle = 0;
if($self->is_vertical) {
if ($self->is_left) {
$angle -= pip2;
} else {
$angle = pip2;
}
}
my $label = Graphics::Primitive::TextBox->new(
name => 'label',
font => $self->font,
text => $self->label,
angle => $angle,
color => Graphics::Color::RGB->new( green => 0, blue => 0, red => 0),
);
$label->font->size($label->font->size);
$label->prepare($driver);
$label->width($label->minimum_width);
$label->height($label->minimum_height);
$label_width = $label->width;
$label_height = $label->height;
$self->add_component($label);
}
if($self->is_vertical) {
$self->minimum_width($self->outside_width + $big + $label_width);
$self->minimum_height($self->outside_height + $self->outside_height + $big);
} else {
$self->minimum_height($self->outside_height + $big + $label_height);
$self->minimum_width($self->outside_width + $big + $self->outside_width);
if($self->staggered) {
$self->minimum_height($self->minimum_height * 2);
}
}
return 1;
});
sub mark {
my ($self, $span, $value) = @_;
# 'caching' this here speeds things up. Calling after changing the
# range would result in a messed up chart anyway...
if(!defined($self->{LOWER})) {
$self->{LOWER} = $self->range->lower;
$self->{RSPAN} = $self->range->span - 1;
if($self->{RSPAN} < 1) {
$self->{RSPAN} = 1;
}
}
return ($span / $self->{RSPAN}) * ($value - $self->{LOWER} || 0);
}
override('finalize', sub {
my ($self) = @_;
super;
return if $self->hidden;
my $x = 0;
my $y = 0;
my $width = $self->width;
my $height = $self->height;
my $ibb = $self->inside_bounding_box;
my $iox = $ibb->origin->x;
my $ioy = $ibb->origin->y;
my $iwidth = $ibb->width;
my $iheight = $ibb->height;
if($self->is_left) {
$x += $width;
} elsif($self->is_right) {
# nuffin
} elsif($self->is_top) {
$y += $height;
} else {
# nuffin
}
my $tick_length = $self->tick_length;
my $lower = $self->range->lower;
my @values = @{ $self->tick_values };
if($self->is_vertical) {
for(0..scalar(@values) - 1) {
my $val = $values[$_];
my $iy = $height - $self->mark($height, $val);
my $label = $self->get_component($_);
if($self->is_left) {
$label->origin->x($iox + $iwidth - $label->width);
$label->origin->y($iy - ($label->height / 2));
} else {
$label->origin->x($iox);
$label->origin->y($iy - ($label->height / 2));
}
}
# Draw the label
# FIXME Not working, rotated text labels...
if($self->label) {
my $label = $self->get_component($self->find_component('label'));
if($self->is_left) {
$label->origin->x($iox);
$label->origin->y(($height - $label->height) / 2);
} else {
$label->origin->x($iox + $iwidth - $label->width);
$label->origin->y(($height - $label->height) / 2);
}
}
} else {
# Draw a tick for each value.
for(0..scalar(@values) - 1) {
my $val = $values[$_];
my $ix = $self->mark($width, $val);
my $label = $self->get_component($_);
my $bump = 0;
if($self->staggered) {
if($_ % 2) {
$bump = $iheight / 2;
}
}
if($self->is_top) {
$label->origin->x($ix - ($label->width / 1.8));
$label->origin->y($ioy + $iheight - $label->height - $bump);
} else {
$label->origin->x($ix - ($label->width / 1.8));
$label->origin->y($ioy + $bump);
}
}
# Draw the label
# FIXME Not working, rotated text labels...
if($self->label) {
my $label = $self->get_component($self->find_component('label'));
my $ext = $self->{'label_extents_cache'};
if ($self->is_bottom) {
$label->origin->x(($width - $label->width) / 2);
$label->origin->y($height - $label->height
- ($self->padding->bottom + $self->margins->bottom
+ $self->border->top->width
)
);
} else {
$label->origin->x(($width - $label->width) / 2);
}
}
}
});
sub format_value {
my $self = shift;
my $value = shift;
my $format = $self->format;
if($format) {
if(ref($format) eq 'CODE') {
return &$format($value);
} else {
return sprintf($format, $value);
}
}
}
__PACKAGE__->meta->make_immutable;
no Moose;
1;
__END__
=head1 NAME
Chart::Clicker::Axis
=head1 DESCRIPTION
Chart::Clicker::Axis represents the plot of the chart.
=head1 SYNOPSIS
use Chart::Clicker::Axis;
use Graphics::Primitive::Font;
use Graphics::Primitive::Brush;
my $axis = Chart::Clicker::Axis->new({
font => Graphics::Primitive::Font->new,
orientation => 'vertical',
position => 'left',
brush = Graphics::Primitive::Brush->new,
tick_length => 2,
tick_brush => Graphics::Primitive::Brush->new,
visible => 1,
});
=head1 METHODS
=head2 new
Creates a new Chart::Clicker::Axis. If no arguments are given then sane
defaults are chosen.
=head2 baseline
Set the 'baseline' value of this axis. This is used by some renderers to
change the way a value is marked. The Bar render, for instance, considers
values below the base to be 'negative'.
=head2 brush
Set/Get the brush for this axis.
=head2 color
Set/Get the color of the axis.
=head2 font
Set/Get the font used for the axis' labels.
=head2 format
Set/Get the format to use for the axis values.
If the format is a string then format is applied to each value 'tick' via
sprintf. See sprintf perldoc for details! This is useful for situations
where the values end up with repeating decimals.
If the format is a coderef then that coderef will be executed and the value
passed to it as an argument.
my $nf = Number::Format->new;
$default->domain_axis->format(sub { return $nf->format_number(shift); });
=head2 fudge_amount
Set/Get the amount to 'fudge' the span of this axis. You should supply a
percentage (in decimal form) and the axis will grow at both ends by the
supplied amount. This is useful when you want a bit of padding above and
below the dataset.
As an example, a fugdge_amount of .10 on an axis with a span of 10 to 50
would add 5 to the top and bottom of the axis.
=head2 height
Set/Get the height of the axis.
=head2 label
Set/Get the label of the axis.
=head2 orientation
Set/Get the orientation of this axis. See L<Chart::Clicker::Drawing>.
=head2 position
Set/Get the position of the axis on the chart.
=head2 range
Set/Get the Range for this axis.
=head2 show_ticks
Set/Get the show ticks flag. If this is value then the small tick marks at
each mark on the axis will not be drawn.
=head2 tick_label_angle
Set the angle (in radians) to rotate the tick's labels.
=head2 tick_length
Set/Get the tick length.
=head2 tick_values
Set/Get the arrayref of values show as ticks on this Axis.
=head2 add_to_tick_values
Add a value to the list of tick values.
=head2 clear_tick_values
Clear all tick values.
=head2 stagger
Set/Get the stagger flag, which causes horizontally labeled axes to 'stagger'
the labels so that half are at the top of the box and the other half are at
the bottom. This makes long, overlapping labels less likely to overlap. It
only does something useful with B<horizontal> labels.
=head2 tick_brush
Set/Get the stroke for the tick markers.
=head2 tick_value_count
Get a count of tick values.
=head2 tick_labels
Set/Get the arrayref of labels to show for ticks on this Axis. This arrayref
is consulted for every tick, in order. So placing a string at the zeroeth
index will result in it being displayed on the zeroeth tick, etc, etc.
=head2 ticks
Set/Get the number of 'ticks' to show. Setting this will divide the
range on this axis by the specified value to establish tick values. This
will have no effect if you specify tick_values.
=head2 mark
Given a span and a value, returns it's pixel position on this Axis.
=head2 format_value
Given a value, returns it formatted using this Axis' formatter.
=head2 prepare
Prepare this Axis by determining the size required. If the orientation is
CC_HORIZONTAL this method sets the height. Otherwise sets the width.
=head2 draw
Draw this axis.
=head2 hidden
Set/Get this axis' hidden flag.
=head2 width
Set/Get this axis' width.
=head2 BUILD
Documening for POD::Coverage tests, Moose stuff.
=head1 AUTHOR
Cory 'G' Watson <[email protected]>
=head1 SEE ALSO
perl(1)
=head1 LICENSE
You can redistribute and/or modify this code under the same terms as Perl
itself.
| 25.031196 | 84 | 0.566641 |
edc8bec0897126ba6b63d1d6b5b8a5b9f17f9f07 | 994 | pm | Perl | openkore-master/src/Network/Send/kRO/Sakexe_2008_11_26a.pm | phuchduong/ro_restart_bot | 41da6e1def82d05341433961ca0f071ad4424b60 | [
"Apache-2.0"
] | null | null | null | openkore-master/src/Network/Send/kRO/Sakexe_2008_11_26a.pm | phuchduong/ro_restart_bot | 41da6e1def82d05341433961ca0f071ad4424b60 | [
"Apache-2.0"
] | null | null | null | openkore-master/src/Network/Send/kRO/Sakexe_2008_11_26a.pm | phuchduong/ro_restart_bot | 41da6e1def82d05341433961ca0f071ad4424b60 | [
"Apache-2.0"
] | null | null | null | #########################################################################
# OpenKore - Packet sending
# This module contains functions for sending packets to the server.
#
# This software is open source, licensed under the GNU General Public
# License, version 2.
# Basically, this means that you're allowed to modify and distribute
# this software. However, if you distribute modified versions, you MUST
# also distribute the source code.
# See http://www.gnu.org/licenses/gpl.html for the full license.
#
# $Revision: 6687 $
# $Id: kRO.pm 6687 2009-04-19 19:04:25Z technologyguild $
########################################################################
# Korea (kRO)
# The majority of private servers use eAthena, this is a clone of kRO
package Network::Send::kRO::Sakexe_2008_11_26a;
use strict;
use base qw(Network::Send::kRO::Sakexe_2008_11_13a);
sub new {
my ($class) = @_;
return $class->SUPER::new(@_);
}
=pod
//2008-11-26aSakexe
0x01a2,37
0x0440,10
0x0441,4
=cut
1; | 28.4 | 73 | 0.620724 |
edc6a66f8625d09844fe050c03fe2606e5c2db99 | 16,031 | pl | Perl | perl/trainTuneScore_jamy.pl | ye-kyaw-thu/tools- | 805e0759cb1b700cb99ce96364e9d8056143df64 | [
"MIT"
] | 11 | 2018-10-01T11:00:12.000Z | 2021-11-20T18:18:17.000Z | perl/trainTuneScore_jamy.pl | ye-kyaw-thu/tools- | 805e0759cb1b700cb99ce96364e9d8056143df64 | [
"MIT"
] | null | null | null | perl/trainTuneScore_jamy.pl | ye-kyaw-thu/tools- | 805e0759cb1b700cb99ce96364e9d8056143df64 | [
"MIT"
] | 4 | 2020-06-12T09:42:18.000Z | 2021-12-12T07:04:28.000Z | #!/usr/bin/perl -w
use strict;
# Perl Scripts for training, tuning and BLEU scoring with moses decoder (for running machines)
# Code by Ye Kyaw Thu, NICT
# Last updated: 22 Dec 2012
#
# Command for running:
# $perl trainTuneScore.pl > trainTuneScore-ar-en.log
# you can also use: 2>&1 | tee
###############################################################
# Variables Preparation for Japanese to Myanmar Translation Training
###############################################################
# home folder
my $nictHome = "/panfs/panltg2/users/ye/";
# translation folder for Source Language to Target Language
my $pathSourceTarget = "ja-my/";
my $sourceExtension = "ja";
my $targetExtension = "my";
#/panfs/panltg2/users/ye/mt/corpus/forICCA2013/123/syl/
my $pathTrain = $nictHome."mt/corpus/forICCA2013/123/syl/";
#my $pathTuneData = $nictHome."mt/corpus/forICCA2013/123/syl/"
# to update
# *** Note: currently, I put all data (i.e. training data, tune data and test data) under
#~/mt/corpus/forICCA2013/123/syl/
#path of moses decoder
my $pathMosesTraining = $nictHome."mt/moses-0.91/scripts/training/";
my $pathMosesBin = $nictHome."mt/moses-0.91/bin/";
my $pathMosesScripts = $nictHome."mt/moses-0.91/scripts/";
#path of IRSTLM
my $pathIRSTLM = $nictHome."mt/irstlm-5.80.01/bin/";
#bin folder
my $pathGIZABin = $nictHome."mt/giza-pp/bin/";
#source language test sentences
my $strTargetLanguage1 = "ဒီ က နေ ဟို တယ် အ ခန်း ကို ဘွတ် ကင် တင် ပေး ပါ လား ။ ";
my $strTargetLanguage2 = "ဘိန်း မုန့် ကို ပေး ပါ ။ ";
my $strTargetLanguage3 = "ကူ ညီ ခဲ့ တဲ့ အ တွက် ကျေး ဇူး တင် ပါ တယ် ။ ";
my $strTargetLanguage4 = "လျှော့ ဈေး နဲ့ ရောင်း တဲ့ လက် မှတ် တွေ ကို ဘယ် မှာ ဝယ် လို့ ရ မ လဲ ။ ";
my $strTargetLanguage5 = "ဆိုဒ် နှစ် သို့ မ ဟုတ် လေး ဖြစ် နိုင် တယ် ။ ";
my $strTargetLanguage6 = "ဘတ်စ် ကား ကို ဆောင် ရွက် ပေး ပါ ။ ";
my $strTargetLanguage7 = "ဟုတ် ကဲ့ ။ ဒါ ပေ မဲ့ ၊ ကျေး ဇူး ပြု ပြီး ၊ ဖ လက် ရှ် မ ဖွင့် ပါ နဲ့ ။ ";
my $strTargetLanguage8 = "ဒီ မှာ ဒေါ် လာ တစ် ရာ တန် ပါ ။ ";
my $strTargetLanguage9 = "၅ ၀ ဆင့် အ ကြွ စေ့ ကို ၂ ၀ စေ့ နဲ့ ၁ ဒေါ် လာ တန် ကို ၁ ၀ ရွက် ၊ ၁ ၀ ဒေါ် လာ တန် ကို ၅ ရွက် လုပ် ပေး ပါ ။ ";
my $strTargetLanguage10 = "ကျ နော့် ရဲ့ ဟော် တယ် က သော့ ကို အ ခိုး ခံ လိုက် ရ ပါ တယ် ။ ";
#target language test sentences
my $strSourceLanguage1 = "おはよう 。";
my $strSourceLanguage2 = "こんばんは 。";
my $strSourceLanguage3 = "おやすみなさい 。";
my $strSourceLanguage4 = "さようなら 。";
my $strSourceLanguage5 = "では また 。";
my $strSourceLanguage6 = "ご き げん いかが です か 。";
my $strSourceLanguage7 = "元気 です 、 ありがとう 。";
my $strSourceLanguage8 = "まあまあ です 。";
my $strSourceLanguage9 = "大丈夫 です か 。";
my $strSourceLanguage10 = "大丈夫 です 。";
###########################
# Data preparation for training
############################
print("\n### Start data preparation for training ...\n\n");
#$pathTrain=/panfs/panltg2/users/ye/mt/corpus/forICCA2013/123/syl/"
chdir($pathTrain);
#system("mkdir -p my-ja");
system("mkdir -p ".$pathSourceTarget);
#chdir("my-ja");
chdir($pathSourceTarget);
#pwd is /panfs/panltg2/users/ye/mt/corpus/forICCA2013/123/my-ja/
system("echo \"pwd:\"; pwd");
#system("cp ~/mt/corpus/forICCA2013/123/123*.my .");
system("cp ".$pathTrain."123*.$sourceExtension .");
system("cp ".$pathTrain."123*.$targetExtension .");
#system("~/mt/moses-0.91/scripts/training/clean-corpus-n.perl ./123train.tkn my ja ./123train.tkn.my-ja.clean 1 80");
system($pathMosesTraining."clean-corpus-n.perl ./123train.tkn ".$sourceExtension." ".$targetExtension." ./123train.tkn.".$sourceExtension."-".$targetExtension.".clean 1 100");
#print("\n### Output of command: wc -l 123train.tkn.my-ja.clean.*\n");
print("\n### Output of command: wc -l 123train.tkn.".$sourceExtension."-".$targetExtension.".clean.*\n\n");
#system("wc -l 123train.tkn.my-ja.clean.*");
system("wc -l 123train.tkn.".$sourceExtension."-".$targetExtension.".clean.*");
#Adding Start and End Tag
print("\n### Adding start and end tag ...\n\n");
#system("~/mt/irstlm-5.80.01/bin/add-start-end.sh < ./123train.tkn.my-ja.clean.my > 123train.tkn.my-ja.sb.my");
system($pathIRSTLM."add-start-end.sh < ./123train.tkn.".$sourceExtension."-".$targetExtension.".clean.".$targetExtension." > 123train.tkn.".$sourceExtension."-".$targetExtension.".sb.".$targetExtension);
#print("\n### Output of command: head 123train.tkn.my-ja.sb.ja\n");
print("\n### Output of command: head 123train.tkn.".$sourceExtension."-".$targetExtension.".sb.".$targetExtension."\n\n");
#system("head 123train.tkn.my-ja.sb.ja");
system("head 123train.tkn.".$sourceExtension."-".$targetExtension.".sb.".$targetExtension);
#########################
# Language Model Building
#########################
print("\n### Start language model building with IRSTLM ...\n\n");
#system("~/mt/irstlm-5.80.01/bin/build-lm.sh -i 123train.tkn.my-ja.sb.ja -t ./tmp -p -s improved-kneser-ney -o 123train.tkn.my-ja.lm.ja");
system($pathIRSTLM."build-lm.sh -i 123train.tkn.".$sourceExtension."-".$targetExtension.".sb.".$targetExtension." -t ./tmp -p -s improved-kneser-ney -o 123train.tkn.".$sourceExtension."-".$targetExtension.".lm.".$targetExtension);
#Compile to get arpa file
print("\n### Start compile to get arpa file ...\n\n");
#system("~/mt/irstlm-5.80.01/bin/compile-lm --text yes 123train.tkn.my-ja.lm.ja.gz 123train.tkn.my-ja.arpa.ja");
system($pathIRSTLM."compile-lm --text yes 123train.tkn.".$sourceExtension."-".$targetExtension.".lm.".$targetExtension.".gz 123train.tkn.".$sourceExtension."-".$targetExtension.".arpa.".$targetExtension);
#Build binary file (i.e. blm file)
print("\n### Build binary file ...\n\n");
#system("~/mt/moses-0.91/bin/build_binary ./123train.tkn.my-ja.arpa.ja ./123train.tkn.my-ja.blm.ja");
system($pathMosesBin."build_binary ./123train.tkn.".$sourceExtension."-".$targetExtension.".arpa.".$targetExtension." ./123train.tkn.".$sourceExtension."-".$targetExtension.".blm.".$targetExtension);
#########################
# Testing language model
#########################
print("\n### Testing language model ...\n\n");
#system("echo \"早上 好 。\" | ~/mt/moses-0.91/bin/query ./123train.tkn.my-ja.blm.ja ");
#system("echo \"早上 好 。\" | ".$pathMosesBin."query ./123train.tkn.my-ja.blm.ja ");
system("echo \"".$strTargetLanguage1."\" | ".$pathMosesBin."query ./123train.tkn.".$sourceExtension."-".$targetExtension.".blm.".$targetExtension);
system("echo \"".$strTargetLanguage2."\" | ".$pathMosesBin."query ./123train.tkn.".$sourceExtension."-".$targetExtension.".blm.".$targetExtension);
system("echo \"".$strTargetLanguage3."\" | ".$pathMosesBin."query ./123train.tkn.".$sourceExtension."-".$targetExtension.".blm.".$targetExtension);
system("echo \"".$strTargetLanguage4."\" | ".$pathMosesBin."query ./123train.tkn.".$sourceExtension."-".$targetExtension.".blm.".$targetExtension);
system("echo \"".$strTargetLanguage5."\" | ".$pathMosesBin."query ./123train.tkn.".$sourceExtension."-".$targetExtension.".blm.".$targetExtension);
system("echo \"".$strTargetLanguage6."\" | ".$pathMosesBin."query ./123train.tkn.".$sourceExtension."-".$targetExtension.".blm.".$targetExtension);
system("echo \"".$strTargetLanguage7."\" | ".$pathMosesBin."query ./123train.tkn.".$sourceExtension."-".$targetExtension.".blm.".$targetExtension);
system("echo \"".$strTargetLanguage8."\" | ".$pathMosesBin."query ./123train.tkn.".$sourceExtension."-".$targetExtension.".blm.".$targetExtension);
system("echo \"".$strTargetLanguage9."\" | ".$pathMosesBin."query ./123train.tkn.".$sourceExtension."-".$targetExtension.".blm.".$targetExtension);
system("echo \"".$strTargetLanguage10."\" | ".$pathMosesBin."query ./123train.tkn.".$sourceExtension."-".$targetExtension.".blm.".$targetExtension);
# ###############################
# Start training with moses decoder
# ###############################
system("mkdir -p working");
chdir("working");
system("echo \"pwd:\"; pwd");
print("\n### Start training with moses decoder ...\n\n");
#system("nohup nice ~/mt/moses-0.91/scripts/training/train-model.perl -external-bin-dir ~/mt/giza-pp/bin/ -root-dir train -corpus ~/mt/corpus/forICCA2013/123/my-ja/123train.tkn.my-ja.clean -f my -e ja -alignment grow-diag-final-and -reordering msd-bidirectional-fe -lm 0:3:~/mt/corpus/forICCA2013/123/my-ja/123train.tkn.my-ja.blm.ja:8 2>&1 | tee training.out &");
# I removed "&" at end of above "nohup nice xxxx ... " command line
system("nohup nice ".$pathMosesTraining."train-model.perl -external-bin-dir ".$pathGIZABin." -root-dir train -corpus ".$pathTrain.$pathSourceTarget."123train.tkn.".$sourceExtension."-".$targetExtension.".clean -f ".$sourceExtension." -e ".$targetExtension." -alignment grow-diag-final-and -reordering msd-bidirectional-fe -lm 0:3:".$pathTrain.$pathSourceTarget."123train.tkn.".$sourceExtension."-".$targetExtension.".blm.".$targetExtension.":8 2>&1 | tee training.out ");
print ("\n### !!!!! Training finished !!!!! \n\n");
# perl -e 'system("charmap &"); print "yes";'
#########################
# Test translation engine
########################
chdir("train/model/");
system("echo \"pwd:\"; pwd");
print ("\n### Let's test translation engine for ".$sourceExtension." to ".$targetExtension." ...\n\n");
print "### moses decoder will start from now on ...\n\n";
print ("### Don't forget to prepare some ".$sourceExtension." sentences in advance for testing ...\n\n");
system("~/mt/moses-0.91/bin/moses -f ./moses.ini");
#################################
# Data preparation for tuning process
#################################
# Preparation for source language mref file:
# --------------------------------
# /media/HDPC-U/backup/BTEC/BTEC1/test/TKN_120131/ja$ cp jpn_set01.mref.ja.TKN.1 ~/mt/corpus/BTEC1/test/ja
# cd ~/mt/corpus/BTEC1/test/ja
# ~/mt/corpus/BTEC1/test/ja$ head jpn_set01.mref.ja.TKN.1
# ~/mt/corpus/BTEC1/test/ja$ cut -d '\' -f 8- jpn_set01.mref.ja.TKN.1 > jpn_set01.mref.ja.TKN_Cut.1
# ~/mt/corpus/BTEC1/test/ja$ head jpn_set01.mref.ja.TKN_Cut.1
# ~/mt/corpus/BTEC1/test/ja$ wc *
chdir($pathTrain);
#chdir($pathTrain.$pathSourceTarget);
chdir($pathSourceTarget);
system("### echo \"pwd:\"; pwd");
# 123dev.tkn.en
#
print("\n### Output of command: head 123dev.tkn.".$sourceExtension."\n\n");
system("head ./123dev.tkn.".$sourceExtension);
##################################################################################################
# Preparation for target language mref file: (just putting for reference!)
# ------------------------------------
# mkdir ~/mt/corpus/BTEC1/test/zh
# cd /media/HDPC-U/backup/BTEC/BTEC1/test/TKN_120131/zh
# cp jpn_set01.mref.zh.TKN.1 ~/mt/corpus/BTEC1/test/zh
# cd ~/mt/corpus/BTEC1/test/zh
# ~/mt/corpus/BTEC1/test/zh$ head jpn_set01.mref.zh.TKN.1
# ~/mt/corpus/BTEC1/test/zh$ cut -d '\' -f 8- jpn_set01.mref.zh.TKN.1 > jpn_set01.mref.zh.TKN_Cut.1
# ~/mt/corpus/BTEC1/test/zh$ head jpn_set01.mref.zh.TKN_Cut.1
# ~/mt/corpus/BTEC1/test/zh$ wc *
###################################################################################################
print("\n### Output of command: head 123dev.tkn.".$targetExtension."\n\n");
system("head ./123dev.tkn.".$targetExtension);
system("wc ./123dev.tkn.*");
# Cleaning Data for tuning process
print("\n### Run clean-corpus-n.perl for \"123dev.tkn.".$sourceExtension."\" and \"123dev.tkn.".$targetExtension."\" \n\n");
#$/panfs/panltg2/users/ye/mt/moses-0.91/scripts/training/clean-corpus-n.perl ./123dev.tkn my ja ./123dev.tkn.my-ja.clean 1 100
system($pathMosesTraining."clean-corpus-n.perl ./123dev.tkn ".$sourceExtension." ".$targetExtension." ./123dev.tkn.".$sourceExtension."-".$targetExtension.".clean 1 100");
#system("ls ".$pathTrain."/123dev.tkn.*");
system("ls ./123dev.tkn.*");
#system("wc -l 123dev.tkn.my-ja.clean.*");
system("wc -l 123dev.tkn.".$sourceExtension."-".$targetExtension.".clean.*");
########################
# Start tuning process
########################
system("echo \"pwd:\"; pwd");
chdir($pathTrain.$pathSourceTarget."working");
system("echo \"pwd:\"; pwd");
#pwd=/panfs/panltg2/users/ye/mt/corpus/forICCA2013/123/syl
# Don't forget to prepare clean mref data file before running tuning process
#nohup nice ~/mt/moses-0.91/scripts/training/mert-moses.pl ~/mt/corpus/forICCA2013/123/syl/123dev.tkn.my-ja.clean.my ~/mt/corpus/forICCA2013/123/syl/123dev.tkn.my-ja.clean.ja ~/mt/moses-0.91/bin/moses ~/mt/corpus/forICCA2013/123/syl/my-ja/train/model/moses.ini --mertdir ~/mt/moses-0.91/bin/ &> mert.out &
print("\n### Start tuning process ...\n\n");
system("nohup nice ".$pathMosesTraining."mert-moses.pl ".$pathTrain.$pathSourceTarget."123dev.tkn.".$sourceExtension."-".$targetExtension.".clean.".$sourceExtension." ".$pathTrain.$pathSourceTarget."123dev.tkn.".$sourceExtension."-".$targetExtension.".clean.".$targetExtension." ".$pathMosesBin."moses ".$pathTrain.$pathSourceTarget."working/train/model/moses.ini --mertdir ".$pathMosesBin." 2>&1 | tee mert.out");
##############################################
# test translation with "mert-work/moses.ini"
##############################################
#$ ~/mt/moses-0.91/bin/moses -f ~/mt/corpus/forICCA2013/123/my-ja/train/model/mert-work/moses.ini
print("\n### Run moses decoder with /working/mert-work/moses.ini \n\n");
#system($pathMosesBin."moses -f ".$pathTrain.$pathSourceTarget."working/mert-work/moses.ini");
system($pathMosesBin."moses -f ./mert-work/moses.ini");
# prepare some test phrases for this stage!
# パスポート を なく し て しまい まし た 。
# まあ 、 たいへん 。
# やめ て 。
# 一 二 三 、 八 七 六 五 です 。
# これ を 新しい もの と 取り替え て いただけ ます か 。
########################################################
# Test Data Preparation (or) preparation for BLEU Score
########################################################
system("echo \"pwd:\"; pwd");
chdir($pathTrain);
system("echo \"pwd:\"; pwd");
#pwd=/panfs/panltg2/users/ye/mt/corpus/forICCA2013/123/syl/"
######################################
# Trained with FILTERED for test data set
######################################
system("echo \"pwd:\"; pwd");
chdir($pathTrain.$pathSourceTarget."working");
system("echo \"Moved to new path.\n pwd:\"; pwd");
#pwd=/panfs/panltg2/users/ye/mt/corpus/forICCA2013/123/syl/my-ja/"
# ~/mt/moses-0.91/scripts/training/filter-model-given-input.pl filtered-123testEn ./mert-work/moses.ini ~/mt/corpus/forICCA2013/123/syl/123test.tkn. -Binarizer ~/mt/moses-0.91/bin/processPhraseTable
print("\n### Trained with FILTERED for test data set \n\n");
system($pathMosesTraining."filter-model-given-input.pl filtered-123testEn ./mert-work/moses.ini ".$pathTrain."123test.tkn.".$sourceExtension." -Binarizer ".$pathMosesBin."processPhraseTable");
#############################################################
# Test moses decoder with test data set (i.e. 123test.tkn.my)
#############################################################
# nohup nice ~/mt/moses-0.91/bin/moses -f ~/mt/corpus/forICCA2013/123/syl/my-ja/train/model/filtered-123testEn/moses.ini < ~/mt/corpus/forICCA2013/123/syl/123test.tkn.my > ~/mt/corpus/forICCA2013/123/syl/my-ja/working/123test.translated.ja 2> ~/mt/corpus/forICCA2013/123/syl/my-ja/working/123test.tkn.test.my-ja.log &
print("\n### Test moses decoder with test data set (i.e. 123test.tkn.".$sourceExtension.") \n\n");
system("nohup nice ".$pathMosesBin."moses -f ".$pathTrain.$pathSourceTarget."working/filtered-123testEn/moses.ini < ".$pathTrain."123test.tkn.".$sourceExtension." > ".$pathTrain.$pathSourceTarget."working/123test.translated.".$targetExtension." 2> ".$pathTrain.$pathSourceTarget."working/123test.tkn.test.my-ja.log ");
##############################
# Evaluation with BLEU Score ...
##############################
# ~/mt/moses-0.91/scripts/generic/multi-bleu.perl -lc ~/mt/corpus/forICCA2013/123/syl/123test.tkn.ja < ~/mt/corpus/forICCA2013/123/syl/my-ja/working/123test.translated.ja
print("\n### Start evaluation with BLEU Score ...\n\n");
system($pathMosesScripts."generic/multi-bleu.perl -lc ".$pathTrain."123test.tkn.".$targetExtension." < ".$pathTrain.$pathSourceTarget."working/123test.translated.".$targetExtension);
# ======================== End Of Script ===================================
| 53.082781 | 471 | 0.634333 |
ed720a1b9728ec47a001519ed83314d2df2b3032 | 39,468 | t | Perl | tests/test.t | mshimizu-kx/protobufkdb-1 | 09a841dbf915baa0207e13948c87cc4e0b543e3a | [
"Apache-2.0"
] | null | null | null | tests/test.t | mshimizu-kx/protobufkdb-1 | 09a841dbf915baa0207e13948c87cc4e0b543e3a | [
"Apache-2.0"
] | null | null | null | tests/test.t | mshimizu-kx/protobufkdb-1 | 09a841dbf915baa0207e13948c87cc4e0b543e3a | [
"Apache-2.0"
] | null | null | null | // test.t
// Test both compliled schema and dynamically imported schema
-1 "\n+----------|| Load protobufkdb library ||----------+\n";
\l q/protobufkdb.q
\l tests/test_helper_function.q
// Move to protobuf namespace
\d .protobufkdb
-1 "\n+----------|| Test import of dynamic schema files ||----------+\n";
addProtoImportPath["proto"];
importProtoFile["tests_dynamic.proto"];
.test.ASSERT_ERROR[importProtoFile; enlist "not_exist.proto"; "Error: not_exist.proto:-1:0: File not found."]
-1 "\n+----------|| Test scalars with file ||----------+\n";
-1 "<--- Pass correct data --->";
scalars_expected:(1i;2i;3j;4j;5f;6e;1b;2i;"string");
saveMessageFromList[`ScalarTest;`scalar_file;scalars_expected];
.test.ASSERT_TRUE[loadMessageToList; (`ScalarTest; `scalar_file); scalars_expected]
saveMessageFromList[`ScalarTestDynamic;`scalar_file;scalars_expected];
.test.ASSERT_TRUE[loadMessageToList; (`ScalarTestDynamic; `scalar_file); scalars_expected]
-1 "<--- Pass enlist for scalar --->";
scalars_enlist:(1i;enlist 2i;3j;4j;5f;6e;1b;1i;"string");
.test.ASSERT_ERROR[saveMessageFromList; (`ScalarTest; `scalar_file; scalars_enlist); "Invalid scalar type"]
.test.ASSERT_ERROR[saveMessageFromList; (`ScalarTestDynamic; `scalar_file; scalars_enlist); "Invalid scalar type"]
-1 "<--- Pass different type scalar --->";
scalars_wrong_type:(1i;2i;3j;4f;5f;6e;1b;0i;"string");
.test.ASSERT_ERROR[saveMessageFromList; (`ScalarTest; `scalar_file; scalars_wrong_type); "Invalid scalar type"]
.test.ASSERT_ERROR[saveMessageFromList; (`ScalarTestDynamic; `scalar_file; scalars_wrong_type); "Invalid scalar type"]
-1 "<--- Pass insufficient data --->";
scalars_short:(2i;3j;4j;5f;6e;1b;0i;"string");
.test.ASSERT_ERROR[saveMessageFromList; (`ScalarTest; `scalar_file; scalars_short); "Incorrect number of fields"]
.test.ASSERT_ERROR[saveMessageFromList; (`ScalarTestDynamic; `scalar_file; scalars_short); "Incorrect number of fields"]
-1 "<--- Pass atom data --->";
scalar_atom:1i;
.test.ASSERT_ERROR[saveMessageFromList; (`ScalarTest; `scalar_file; scalar_atom); "Invalid message type"]
.test.ASSERT_ERROR[saveMessageFromList; (`ScalarTestDynamic; `scalar_file; scalar_atom); "Invalid message type"]
-1 "\n+----------|| Test scalars with file and field name dictionary ||----------+\n";
-1 "<--- Pass correct data --->";
scalar_fields:getMessageFields[`ScalarTest];
scalars_expected_dict:scalar_fields!scalars_expected;
saveMessageFromDict[`ScalarTest;`scalar_file;scalars_expected_dict];
.test.ASSERT_TRUE[loadMessageToDict; (`ScalarTest; `scalar_file); scalars_expected_dict]
saveMessageFromDict[`ScalarTestDynamic;`scalar_file;scalars_expected_dict];
.test.ASSERT_TRUE[loadMessageToDict; (`ScalarTestDynamic; `scalar_file); scalars_expected_dict]
-1 "<--- Pass enlist for scalar --->";
scalars_enlist_dict:scalar_fields!scalars_enlist;
.test.ASSERT_ERROR[saveMessageFromDict; (`ScalarTest; `scalar_file; scalars_enlist_dict); "Invalid scalar type"]
.test.ASSERT_ERROR[saveMessageFromDict; (`ScalarTestDynamic; `scalar_file; scalars_enlist_dict); "Invalid scalar type"]
-1 "<--- Pass different type scalar --->";
scalars_wrong_type_dict:scalar_fields!scalars_wrong_type;
.test.ASSERT_ERROR[saveMessageFromDict; (`ScalarTest; `scalar_file; scalars_wrong_type_dict); "Invalid scalar type"]
.test.ASSERT_ERROR[saveMessageFromDict; (`ScalarTestDynamic; `scalar_file; scalars_wrong_type_dict); "Invalid scalar type"]
-1 "<--- Pass incorrect field names --->";
scalar_fields_bad:getMessageFields[`ScalarTest];
scalar_fields_bad[0]:`bad;
scalars_unknown_field_dict:scalar_fields_bad!scalars_expected;
.test.ASSERT_ERROR[saveMessageFromDict; (`ScalarTest; `scalar_file; scalars_unknown_field_dict); "Unknown message field name"]
.test.ASSERT_ERROR[saveMessageFromDict; (`ScalarTestDynamic; `scalar_file; scalars_unknown_field_dict); "Unknown message field name"]
-1 "<--- Pass atom data as dictionary --->";
.test.ASSERT_ERROR[saveMessageFromList; (`ScalarTest; `scalar_file; scalar_atom); "Invalid message type"]
.test.ASSERT_ERROR[saveMessageFromList; (`ScalarTestDynamic; `scalar_file; scalar_atom); "Invalid message type"]
-1 "\n+----------|| Test scalars with array ||----------+\n";
-1 "<--- Pass correct data --->";
array:serializeArrayFromList[`ScalarTest; scalars_expected];
.test.ASSERT_TRUE[parseArrayToList; (`ScalarTest; array); scalars_expected]
.test.ASSERT_TRUE[parseArrayToList; (`ScalarTestDynamic; array); scalars_expected]
-1 "<--- Pass enlist --->";
.test.ASSERT_ERROR[serializeArrayFromList; (`ScalarTest; scalars_enlist); "Invalid scalar type"]
.test.ASSERT_ERROR[serializeArrayFromList; (`ScalarTestDynamic; scalars_enlist); "Invalid scalar type"]
-1 "<--- Pass wrong type data --->";
.test.ASSERT_ERROR[serializeArrayFromList; (`ScalarTest; scalars_wrong_type); "Invalid scalar type"]
.test.ASSERT_ERROR[serializeArrayFromList; (`ScalarTestDynamic; scalars_wrong_type); "Invalid scalar type"]
-1 "<--- Pass insufficient data --->";
.test.ASSERT_ERROR[serializeArrayFromList; (`ScalarTest; scalars_short); "Incorrect number of fields"]
.test.ASSERT_ERROR[serializeArrayFromList; (`ScalarTestDynamic; scalars_short); "Incorrect number of fields"]
-1 "<--- Pass atom data --->";
.test.ASSERT_ERROR[serializeArrayFromList; (`ScalarTest; scalar_atom); "Invalid message type"]
.test.ASSERT_ERROR[serializeArrayFromList; (`ScalarTestDynamic; scalar_atom); "Invalid message type"]
-1 "\n+----------|| Test scalars with array and field name dictionary ||----------+\n";
-1 "<--- Pass correct data --->";
array:serializeArrayFromDict[`ScalarTest; scalars_expected_dict];
.test.ASSERT_TRUE[parseArrayToDict; (`ScalarTest; array); scalars_expected_dict]
.test.ASSERT_TRUE[parseArrayToDict; (`ScalarTestDynamic; array); scalars_expected_dict]
-1 "<--- Pass enlist --->";
.test.ASSERT_ERROR[serializeArrayFromDict; (`ScalarTest; scalars_enlist_dict); "Invalid scalar type"]
.test.ASSERT_ERROR[serializeArrayFromDict; (`ScalarTestDynamic; scalars_enlist_dict); "Invalid scalar type"]
-1 "<--- Pass wrong type data --->";
.test.ASSERT_ERROR[serializeArrayFromDict; (`ScalarTest; scalars_wrong_type_dict); "Invalid scalar type"]
.test.ASSERT_ERROR[serializeArrayFromDict; (`ScalarTestDynamic; scalars_wrong_type_dict); "Invalid scalar type"]
-1 "<--- Pass incorrect field names --->";
.test.ASSERT_ERROR[serializeArrayFromDict; (`ScalarTest; scalars_unknown_field_dict); "Unknown message field name"]
.test.ASSERT_ERROR[serializeArrayFromDict; (`ScalarTestDynamic; scalars_unknown_field_dict); "Unknown message field name"]
-1 "<--- Pass atom data as dictionary --->";
.test.ASSERT_ERROR[serializeArrayFromDict; (`ScalarTest; scalar_atom); "Invalid message type"]
.test.ASSERT_ERROR[serializeArrayFromDict; (`ScalarTestDynamic; scalar_atom); "Invalid message type"]
-1 "\n+----------|| Test repeated with file ||----------+\n";
-1 "<--- Pass correct data --->";
repeated_from_scalars:{@[x;where 10h=type each x;enlist]}
repeated_scalars:repeated_from_scalars scalars_expected;
repeated_expected:repeated_scalars,'repeated_scalars;
saveMessageFromList[`RepeatedTest; `repeated_file; repeated_expected];
.test.ASSERT_TRUE[loadMessageToList; (`RepeatedTest; `repeated_file); repeated_expected]
saveMessageFromList[`RepeatedTestDynamic; `repeated_file; repeated_expected];
.test.ASSERT_TRUE[loadMessageToList; (`RepeatedTestDynamic; `repeated_file); repeated_expected]
-1 "<--- Pass scalar data --->";
.test.ASSERT_ERROR[saveMessageFromList; (`RepeatedTest; `repeated_file; scalars_expected); "Invalid repeated type"]
.test.ASSERT_ERROR[saveMessageFromList; (`RepeatedTestDynamic; `repeated_file; scalars_expected); "Invalid repeated type"]
-1 "<--- Pass wrong type data --->";
repeated_wrong_type:scalars_wrong_type ,' scalars_wrong_type;
.test.ASSERT_ERROR[saveMessageFromList; (`RepeatedTest; `repeated_file; repeated_wrong_type); "Invalid repeated type"]
.test.ASSERT_ERROR[saveMessageFromList; (`RepeatedTestDynamic; `repeated_file; repeated_wrong_type); "Invalid repeated type"]
-1 "<--- Pass insufficient data --->";
repeated_short:(-1 _ scalars_expected),' -1 _ scalars_expected;
.test.ASSERT_ERROR[saveMessageFromList; (`RepeatedTest; `repeated_file; repeated_short); "Incorrect number of fields"]
.test.ASSERT_ERROR[saveMessageFromList; (`RepeatedTestDynamic; `repeated_file; repeated_short); "Incorrect number of fields"]
-1 "<--- Pass simple list data --->";
repeated_simple:1 2 3i;
.test.ASSERT_ERROR[saveMessageFromList; (`RepeatedTest; `repeated_file; repeated_simple); "Invalid message type"]
.test.ASSERT_ERROR[saveMessageFromList; (`RepeatedTestDynamic; `repeated_file; repeated_simple); "Invalid message type"]
-1 "\n+----------|| Test repeated with file and field name dictionary ||----------+\n";
-1 "<--- Pass correct data --->";
repeated_fields:getMessageFields[`RepeatedTest];
repeated_expected_dict:repeated_fields!repeated_expected;
saveMessageFromDict[`RepeatedTest; `repeated_file; repeated_expected_dict];
.test.ASSERT_TRUE[loadMessageToDict; (`RepeatedTest; `repeated_file); repeated_expected_dict]
saveMessageFromDict[`RepeatedTestDynamic; `repeated_file; repeated_expected_dict];
.test.ASSERT_TRUE[loadMessageToDict; (`RepeatedTestDynamic; `repeated_file); repeated_expected_dict]
-1 "<--- Pass scalar data --->";
repeated_scalar_data_dict:repeated_fields!scalars_expected;
.test.ASSERT_ERROR[saveMessageFromDict; (`RepeatedTest; `repeated_file; repeated_scalar_data_dict); "Invalid repeated type"]
.test.ASSERT_ERROR[saveMessageFromDict; (`RepeatedTestDynamic; `repeated_file; repeated_scalar_data_dict); "Invalid repeated type"]
-1 "<--- Pass wrong type data --->";
repeated_wrong_type_dict:repeated_fields!repeated_wrong_type;
.test.ASSERT_ERROR[saveMessageFromDict; (`RepeatedTest; `repeated_file; repeated_wrong_type_dict); "Invalid repeated type"]
.test.ASSERT_ERROR[saveMessageFromDict; (`RepeatedTestDynamic; `repeated_file; repeated_wrong_type_dict); "Invalid repeated type"]
-1 "<--- Pass incorrect field names --->";
repeated_fields_bad:getMessageFields[`RepeatedTest];
repeated_fields_bad[0]:`bad;
repeated_unknown_field_dict:repeated_fields_bad!repeated_expected;
.test.ASSERT_ERROR[saveMessageFromDict; (`RepeatedTest; `repeated_file; repeated_unknown_field_dict); "Unknown message field name"]
.test.ASSERT_ERROR[saveMessageFromDict; (`RepeatedTestDynamic; `repeated_file; repeated_unknown_field_dict); "Unknown message field name"]
-1 "<--- Pass simple list data as dictionary --->";
.test.ASSERT_ERROR[saveMessageFromDict; (`RepeatedTest; `repeated_file; repeated_simple); "Invalid message type"]
.test.ASSERT_ERROR[saveMessageFromDict; (`RepeatedTestDynamic; `repeated_file; repeated_simple); "Invalid message type"]
-1 "\n+----------|| Test repeated with array ||----------+\n";
-1 "<--- Pass correct data --->";
array:serializeArrayFromList[`RepeatedTest; repeated_expected];
.test.ASSERT_TRUE[parseArrayToList; (`RepeatedTest; array); repeated_expected]
array:serializeArrayFromList[`RepeatedTestDynamic; repeated_expected];
.test.ASSERT_TRUE[parseArrayToList; (`RepeatedTestDynamic; array); repeated_expected]
-1 "<--- Pass scalar data --->";
.test.ASSERT_ERROR[serializeArrayFromList; (`RepeatedTest; scalars_expected); "Invalid repeated type"]
.test.ASSERT_ERROR[serializeArrayFromList; (`RepeatedTestDynamic; scalars_expected); "Invalid repeated type"]
-1 "<--- Pass wrong type data --->";
.test.ASSERT_ERROR[serializeArrayFromList; (`RepeatedTest; repeated_wrong_type); "Invalid repeated type"]
.test.ASSERT_ERROR[serializeArrayFromList; (`RepeatedTestDynamic; repeated_wrong_type); "Invalid repeated type"]
-1 "<--- Pass insufficient data --->";
.test.ASSERT_ERROR[serializeArrayFromList; (`RepeatedTest; repeated_short); "Incorrect number of fields"]
.test.ASSERT_ERROR[serializeArrayFromList; (`RepeatedTestDynamic; repeated_short); "Incorrect number of fields"]
-1 "<--- Pass simple list data --->";
.test.ASSERT_ERROR[serializeArrayFromList; (`RepeatedTest; repeated_simple); "Invalid message type"]
.test.ASSERT_ERROR[serializeArrayFromList; (`RepeatedTestDynamic; repeated_simple); "Invalid message type"]
-1 "\n+----------|| Test repeated with array and field name dictionary ||----------+\n";
-1 "<--- Pass correct data --->";
array:serializeArrayFromDict[`RepeatedTest; repeated_expected_dict];
.test.ASSERT_TRUE[parseArrayToDict; (`RepeatedTest; array); repeated_expected_dict]
array:serializeArrayFromDict[`RepeatedTestDynamic; repeated_expected_dict];
.test.ASSERT_TRUE[parseArrayToDict; (`RepeatedTestDynamic; array); repeated_expected_dict]
-1 "<--- Pass scalar data --->";
.test.ASSERT_ERROR[serializeArrayFromDict; (`RepeatedTest; repeated_scalar_data_dict); "Invalid repeated type"]
.test.ASSERT_ERROR[serializeArrayFromDict; (`RepeatedTestDynamic; repeated_scalar_data_dict); "Invalid repeated type"]
-1 "<--- Pass wrong type data --->";
.test.ASSERT_ERROR[serializeArrayFromDict; (`RepeatedTest; repeated_wrong_type_dict); "Invalid repeated type"]
.test.ASSERT_ERROR[serializeArrayFromDict; (`RepeatedTestDynamic; repeated_wrong_type_dict); "Invalid repeated type"]
-1 "<--- Pass incorrect field names --->";
.test.ASSERT_ERROR[serializeArrayFromDict; (`RepeatedTest; repeated_unknown_field_dict); "Unknown message field name"]
.test.ASSERT_ERROR[serializeArrayFromDict; (`RepeatedTestDynamic; repeated_unknown_field_dict); "Unknown message field name"]
-1 "<--- Pass simple list data as dictionary --->";
.test.ASSERT_ERROR[serializeArrayFromDict; (`RepeatedTest; repeated_simple); "Invalid message type"]
.test.ASSERT_ERROR[serializeArrayFromDict; (`RepeatedTestDynamic; repeated_simple); "Invalid message type"]
-1 "\n+----------|| Test submessage with file ||----------+\n";
-1 "<--- Pass correct data --->";
submessage_expected:(scalars_expected;enlist repeated_expected);
saveMessageFromList[`SubMessageTest; `submessage_file; submessage_expected];
.test.ASSERT_TRUE[loadMessageToList; (`SubMessageTest; `submessage_file); submessage_expected]
saveMessageFromList[`SubMessageTestDynamic; `submessage_file; submessage_expected];
.test.ASSERT_TRUE[loadMessageToList; (`SubMessageTestDynamic; `submessage_file); submessage_expected]
-1 "<--- Pass non-repeated submessage --->";
submessage_nonrepeated:(scalars_expected; repeated_expected);
.test.ASSERT_ERROR[saveMessageFromList; (`SubMessageTest; `submessage_file; submessage_nonrepeated); "Invalid message type"]
.test.ASSERT_ERROR[saveMessageFromList; (`SubMessageTestDynamic; `submessage_file; submessage_nonrepeated); "Invalid message type"]
-1 "<--- Pass insufficient message --->";
submessage_short:enlist scalars_expected;
.test.ASSERT_ERROR[saveMessageFromList; (`SubMessageTest; `submessage_file; submessage_short); "Incorrect number of fields"]
.test.ASSERT_ERROR[saveMessageFromList; (`SubMessageTestDynamic; `submessage_file; submessage_short); "Incorrect number of fields"]
-1 "\n+----------|| Test submessage with file and field name dictionary ||----------+\n";
-1 "<--- Pass correct data --->";
submessage_fields:getMessageFields[`SubMessageTest];
submessage_expected_dict:submessage_fields!(scalars_expected_dict;(enlist repeated_expected_dict));
saveMessageFromDict[`SubMessageTest; `submessage_file; submessage_expected_dict];
.test.ASSERT_TRUE[loadMessageToDict; (`SubMessageTest; `submessage_file); submessage_expected_dict]
saveMessageFromDict[`SubMessageTestDynamic; `submessage_file; submessage_expected_dict];
.test.ASSERT_TRUE[loadMessageToDict; (`SubMessageTestDynamic; `submessage_file); submessage_expected_dict]
-1 "<--- Pass non-repeated submessage --->";
submessage_nonrepeated_dict:submessage_fields!(scalars_expected_dict; repeated_expected_dict);
.test.ASSERT_ERROR[saveMessageFromDict; (`SubMessageTest; `submessage_file; submessage_nonrepeated_dict); "Invalid repeated message type"]
.test.ASSERT_ERROR[saveMessageFromDict; (`SubMessageTestDynamic; `submessage_file; submessage_nonrepeated_dict); "Invalid repeated message type"]
-1 "<--- Pass incorrect field names --->";
submessage_fields_bad:getMessageFields[`SubMessageTest];
submessage_fields_bad[0]:`bad;
submessage_unknown_field_dict:submessage_fields_bad!(scalars_expected_dict;(enlist repeated_expected_dict));
.test.ASSERT_ERROR[saveMessageFromDict; (`SubMessageTest; `submessage_file; submessage_unknown_field_dict); "Unknown message field name"]
.test.ASSERT_ERROR[saveMessageFromDict; (`SubMessageTestDynamic; `submessage_file; submessage_unknown_field_dict); "Unknown message field name"]
-1 "\n+----------|| Test submessage with array ||----------+\n";
-1 "<--- Pass correct data --->";
array:serializeArrayFromList[`SubMessageTest; submessage_expected];
.test.ASSERT_TRUE[parseArrayToList; (`SubMessageTest; array); submessage_expected]
array:serializeArrayFromList[`SubMessageTestDynamic; submessage_expected];
.test.ASSERT_TRUE[parseArrayToList; (`SubMessageTestDynamic; array); submessage_expected]
-1 "<--- Pass non-repeated submessage --->";
.test.ASSERT_ERROR[serializeArrayFromList; (`SubMessageTest; submessage_nonrepeated); "Invalid message type"]
.test.ASSERT_ERROR[serializeArrayFromList; (`SubMessageTestDynamic; submessage_nonrepeated); "Invalid message type"]
-1 "<--- Pass insufficient message --->";
submessage_short:enlist 2#enlist repeated_expected;
.test.ASSERT_ERROR[serializeArrayFromList; (`SubMessageTest; submessage_short); "Incorrect number of fields"]
.test.ASSERT_ERROR[serializeArrayFromList; (`SubMessageTestDynamic; submessage_short); "Incorrect number of fields"]
-1 "\n+----------|| Test submessage with array and field name dictionary ||----------+\n";
-1 "<--- Pass correct data --->";
array:serializeArrayFromDict[`SubMessageTest; submessage_expected_dict];
.test.ASSERT_TRUE[parseArrayToDict; (`SubMessageTest; array); submessage_expected_dict]
array:serializeArrayFromDict[`SubMessageTestDynamic; submessage_expected_dict];
.test.ASSERT_TRUE[parseArrayToDict; (`SubMessageTestDynamic; array); submessage_expected_dict]
-1 "<--- Pass non-repeated submessage --->";
.test.ASSERT_ERROR[serializeArrayFromDict; (`SubMessageTest; submessage_nonrepeated_dict); "Invalid repeated message type"]
.test.ASSERT_ERROR[serializeArrayFromDict; (`SubMessageTestDynamic; submessage_nonrepeated_dict); "Invalid repeated message type"]
-1 "<--- Pass incorrect field names --->";
.test.ASSERT_ERROR[serializeArrayFromDict; (`SubMessageTest; submessage_unknown_field_dict); "Unknown message field name"]
.test.ASSERT_ERROR[serializeArrayFromDict; (`SubMessageTestDynamic; submessage_unknown_field_dict); "Unknown message field name"]
-1 "\n+----------|| Test map with file ||----------+\n";
// Protobuf maps are unordered and unsorted so use single item lists for each dictionary
// element to perform a simple equality check.
map:((enlist 1i)!(enlist 2j);(enlist 3i)!(enlist 4j);(enlist 5j)!(enlist 6f);(enlist 7j)!(enlist 8e);(enlist 0b)!(enlist 1i);(enlist `one)!(enlist scalars_expected);(enlist `three)!(enlist submessage_expected));
saveMessageFromList[`MapTest; `map_file; map];
.test.ASSERT_TRUE[loadMessageToList; (`MapTest; `map_file); map]
saveMessageFromList[`MapTestDynamic;`map_file;map]
.test.ASSERT_TRUE[loadMessageToList; (`MapTestDynamic; `map_file); map]
-1 "<--- Pass wrong type key --->";
map_wrong_key:((enlist 1i)!(enlist 2j);(enlist 0b)!(enlist 4j);(enlist 5j)!(enlist 6f);(enlist 7i)!(enlist 8e);(enlist 0b)!(enlist 1i);(enlist `one)!(enlist scalars_expected);(enlist `three)!(enlist submessage_expected));
.test.ASSERT_ERROR[saveMessageFromList; (`MapTest; `map_file; map_wrong_key); "Invalid map element type"]
.test.ASSERT_ERROR[saveMessageFromList; (`MapTestDynamic; `map_file; map_wrong_key); "Invalid map element type"]
-1 "<--- Pass wrong type value --->";
map_wrong_value:((enlist 1i)!(enlist 2j);(enlist 3i)!(enlist 4j);(enlist 5j)!(enlist 6f);(enlist 7j)!(enlist 8e);(enlist 0b)!(enlist 1i);(enlist `one)!(enlist repeated_expected);(enlist `three)!(enlist submessage_expected));
.test.ASSERT_ERROR[saveMessageFromList; (`MapTest; `map_file; map_wrong_value); "Invalid scalar type"]
.test.ASSERT_ERROR[saveMessageFromList; (`MapTestDynamic; `map_file; map_wrong_value); "Invalid scalar type"]
-1 "\n+----------|| Test map with file and field name dictionary ||----------+\n";
// Protobuf maps are unordered and unsorted so use single item lists for each dictionary
// element to perform a simple equality check.
map_fields:getMessageFields[`MapTest];
map_dict:map_fields!((enlist 1i)!(enlist 2j);(enlist 3i)!(enlist 4j);(enlist 5j)!(enlist 6f);(enlist 7j)!(enlist 8e);(enlist 0b)!(enlist 1i);(enlist `one)!(enlist scalars_expected_dict);(enlist `three)!(enlist submessage_expected_dict));
saveMessageFromDict[`MapTest; `map_file; map_dict];
.test.ASSERT_TRUE[loadMessageToDict; (`MapTest; `map_file); map_dict]
saveMessageFromDict[`MapTestDynamic;`map_file;map_dict]
.test.ASSERT_TRUE[loadMessageToDict; (`MapTestDynamic; `map_file); map_dict]
-1 "<--- Pass wrong type key --->";
map_wrong_key_dict:map_fields!((enlist 1i)!(enlist 2j);(enlist 0b)!(enlist 4j);(enlist 5j)!(enlist 6f);(enlist 7j)!(enlist 8e);(enlist 0b)!(enlist 1i);(enlist `one)!(enlist scalars_expected_dict);(enlist `three)!(enlist submessage_expected_dict));
.test.ASSERT_ERROR[saveMessageFromDict; (`MapTest; `map_file; map_wrong_key_dict); "Invalid map element type"]
.test.ASSERT_ERROR[saveMessageFromDict; (`MapTestDynamic; `map_file; map_wrong_key_dict); "Invalid map element type"]
-1 "<--- Pass wrong type value --->";
map_wrong_value_dict:map_fields!((enlist 1i)!(enlist 2j);(enlist 3i)!(enlist 0b);(enlist 5j)!(enlist 6f);(enlist 7j)!(enlist 8e);(enlist 0b)!(enlist 1i);(enlist `one)!(enlist scalars_expected_dict);(enlist `three)!(enlist submessage_expected_dict));
.test.ASSERT_ERROR[saveMessageFromDict; (`MapTest; `map_file; map_wrong_value_dict); "Invalid map element type"]
.test.ASSERT_ERROR[saveMessageFromDict; (`MapTestDynamic; `map_file; map_wrong_value_dict); "Invalid map element type"]
-1 "\n+----------|| Test map with array ||----------+\n";
-1 "<--- Pass correct data --->";
array:serializeArrayFromList[`MapTest; map];
.test.ASSERT_TRUE[parseArrayToList; (`MapTest; array); map]
array:serializeArrayFromList[`MapTestDynamic; map];
.test.ASSERT_TRUE[parseArrayToList; (`MapTestDynamic; array); map]
-1 "<--- Pass wrong type key --->";
.test.ASSERT_ERROR[serializeArrayFromList; (`MapTest; map_wrong_key); "Invalid map element type"]
.test.ASSERT_ERROR[serializeArrayFromList; (`MapTestDynamic; map_wrong_key); "Invalid map element type"]
-1 "<--- Pass wrong value type --->";
.test.ASSERT_ERROR[serializeArrayFromList; (`MapTest; map_wrong_value); "Invalid scalar type"]
.test.ASSERT_ERROR[serializeArrayFromList; (`MapTestDynamic; map_wrong_value); "Invalid scalar type"]
-1 "\n+----------|| Test map with array and field name dictionary ||----------+\n";
-1 "<--- Pass correct data --->";
array:serializeArrayFromDict[`MapTest; map_dict];
.test.ASSERT_TRUE[parseArrayToDict; (`MapTest; array); map_dict]
array:serializeArrayFromDict[`MapTestDynamic; map_dict];
.test.ASSERT_TRUE[parseArrayToDict; (`MapTestDynamic; array); map_dict]
-1 "<--- Pass wrong type key --->";
.test.ASSERT_ERROR[serializeArrayFromDict; (`MapTest; map_wrong_key_dict); "Invalid map element type"]
.test.ASSERT_ERROR[serializeArrayFromDict; (`MapTestDynamic; map_wrong_key_dict); "Invalid map element type"]
-1 "<--- Pass wrong value type --->";
.test.ASSERT_ERROR[serializeArrayFromDict; (`MapTest; map_wrong_value_dict); "Invalid map element type"]
.test.ASSERT_ERROR[serializeArrayFromDict; (`MapTestDynamic; map_wrong_value_dict); "Invalid map element type"]
-1 "\n+----------|| Test scalar specifiers with file ||----------+\n";
-1 "<--- Pass correct data --->";
scalar_specifiers:(2020.01.01D12:34:56.123456789; 2020.01m; 2020.01.01; 2020.01.01T12:34:56.123; 12:34:56.123456789; 12:34; 12:34:56; 12:34:56.123; (1?0Ng)0);
saveMessageFromList[`ScalarSpecifiersTest; `scalar_specifiers_file; scalar_specifiers];
.test.ASSERT_TRUE[loadMessageToList; (`ScalarSpecifiersTest; `scalar_specifiers_file); scalar_specifiers]
saveMessageFromList[`ScalarSpecifiersTestDynamic; `scalar_specifiers_file; scalar_specifiers];
.test.ASSERT_TRUE[loadMessageToList; (`ScalarSpecifiersTestDynamic; `scalar_specifiers_file); scalar_specifiers]
-1 "<--- Pass wrong type (compatible in q context but not in protobuf) --->";
scalar_specifiers_compatible:(631197296123456789; 240i; 73051; 7305.524; 45296123456789; 754; 45296; 45296123i; (1?0Ng)0);
.test.ASSERT_ERROR[saveMessageFromList; (`ScalarSpecifiersTest; `scalar_specifiers_file; scalar_specifiers_compatible); "Invalid scalar type"]
.test.ASSERT_ERROR[saveMessageFromList; (`ScalarSpecifiersTestDynamic; `scalar_specifiers_file; scalar_specifiers_compatible); "Invalid scalar type"]
-1 "\n+----------|| Test scalar specifiers with file and field name dictionary ||----------+\n";
-1 "<--- Pass correct data --->";
scalar_specifiers_fields:getMessageFields[`ScalarSpecifiersTest];
scalar_specifiers_dict:scalar_specifiers_fields!scalar_specifiers;
saveMessageFromDict[`ScalarSpecifiersTest; `scalar_specifiers_file; scalar_specifiers_dict];
.test.ASSERT_TRUE[loadMessageToDict; (`ScalarSpecifiersTest; `scalar_specifiers_file); scalar_specifiers_dict]
saveMessageFromDict[`ScalarSpecifiersTestDynamic; `scalar_specifiers_file; scalar_specifiers_dict];
.test.ASSERT_TRUE[loadMessageToDict; (`ScalarSpecifiersTestDynamic; `scalar_specifiers_file); scalar_specifiers_dict]
-1 "<--- Pass wrong type (compatible in q context but not in protobuf) --->";
scalar_specifiers_compatible_dict:scalar_specifiers_fields!scalar_specifiers_compatible;
.test.ASSERT_ERROR[saveMessageFromDict; (`ScalarSpecifiersTest; `scalar_specifiers_file; scalar_specifiers_compatible_dict); "Invalid scalar type"]
.test.ASSERT_ERROR[saveMessageFromDict; (`ScalarSpecifiersTestDynamic; `scalar_specifiers_file; scalar_specifiers_compatible_dict); "Invalid scalar type"]
-1 "\n+----------|| Test scalar specifiers with array ||----------+\n";
-1 "<--- Pass correct data --->";
array:serializeArrayFromList[`ScalarSpecifiersTest;scalar_specifiers];
.test.ASSERT_TRUE[parseArrayToList; (`ScalarSpecifiersTest; array); scalar_specifiers]
array:serializeArrayFromList[`ScalarSpecifiersTestDynamic;scalar_specifiers];
.test.ASSERT_TRUE[parseArrayToList; (`ScalarSpecifiersTestDynamic; array); scalar_specifiers]
-1 "<--- Pass wrong type (compatible in q context but not in protobuf) --->";
.test.ASSERT_ERROR[saveMessageFromList; (`ScalarSpecifiersTest; `scalar_specifiers_file; scalar_specifiers_compatible); "Invalid scalar type"]
.test.ASSERT_ERROR[saveMessageFromList; (`ScalarSpecifiersTestDynamic; `scalar_specifiers_file; scalar_specifiers_compatible); "Invalid scalar type"]
-1 "\n+----------|| Test scalar specifiers with array and field name dictionary ||----------+\n";
-1 "<--- Pass correct data --->";
array:serializeArrayFromDict[`ScalarSpecifiersTest;scalar_specifiers_dict];
.test.ASSERT_TRUE[parseArrayToDict; (`ScalarSpecifiersTest; array); scalar_specifiers_dict]
array:serializeArrayFromDict[`ScalarSpecifiersTestDynamic;scalar_specifiers_dict];
.test.ASSERT_TRUE[parseArrayToDict; (`ScalarSpecifiersTestDynamic; array); scalar_specifiers_dict]
-1 "<--- Pass wrong type (compatible in q context but not in protobuf) --->";
.test.ASSERT_ERROR[saveMessageFromDict; (`ScalarSpecifiersTest; `scalar_specifiers_file; scalar_specifiers_compatible_dict); "Invalid scalar type"]
.test.ASSERT_ERROR[saveMessageFromDict; (`ScalarSpecifiersTestDynamic; `scalar_specifiers_file; scalar_specifiers_compatible_dict); "Invalid scalar type"]
-1 "\n+----------|| Test repeated specifiers with file ||----------+\n";
-1 "<--- Pass correct data --->";
repeated_specifiers:scalar_specifiers,'scalar_specifiers;
saveMessageFromList[`RepeatedSpecifiersTest;`repeated_specifiers_file;repeated_specifiers];
.test.ASSERT_TRUE[loadMessageToList; (`RepeatedSpecifiersTest; `repeated_specifiers_file); repeated_specifiers]
saveMessageFromList[`RepeatedSpecifiersTestDynamic;`repeated_specifiers_file;repeated_specifiers];
.test.ASSERT_TRUE[loadMessageToList; (`RepeatedSpecifiersTestDynamic; `repeated_specifiers_file); repeated_specifiers]
-1 "<--- Pass wrong type and correct type (compatible in q context but not in protobuf) --->";
repeated_specifiers_mixture:scalar_specifiers ,' scalar_specifiers_compatible;
.test.ASSERT_ERROR[saveMessageFromList; (`RepeatedSpecifiersTest; `repeated_specifiers_file; repeated_specifiers_mixture); "Invalid repeated type"]
.test.ASSERT_ERROR[saveMessageFromList; (`RepeatedSpecifiersTestDynamic; `repeated_specifiers_file; repeated_specifiers_mixture); "Invalid repeated type"]
-1 "\n+----------|| Test repeated specifiers with file and field name dictionary ||----------+\n";
-1 "<--- Pass correct data --->";
repeated_specifiers_fields:getMessageFields[`RepeatedSpecifiersTest];
repeated_specifiers_dict:repeated_specifiers_fields!(scalar_specifiers,'scalar_specifiers);
saveMessageFromDict[`RepeatedSpecifiersTest;`repeated_specifiers_file;repeated_specifiers_dict];
.test.ASSERT_TRUE[loadMessageToDict; (`RepeatedSpecifiersTest; `repeated_specifiers_file); repeated_specifiers_dict]
saveMessageFromDict[`RepeatedSpecifiersTestDynamic;`repeated_specifiers_file;repeated_specifiers_dict];
.test.ASSERT_TRUE[loadMessageToDict; (`RepeatedSpecifiersTestDynamic; `repeated_specifiers_file); repeated_specifiers_dict]
-1 "<--- Pass wrong type and correct type (compatible in q context but not in protobuf) --->";
repeated_specifiers_mixture_dict:repeated_specifiers_fields!repeated_specifiers_mixture;
.test.ASSERT_ERROR[saveMessageFromDict; (`RepeatedSpecifiersTest; `repeated_specifiers_file; repeated_specifiers_mixture_dict); "Invalid repeated type"]
.test.ASSERT_ERROR[saveMessageFromDict; (`RepeatedSpecifiersTestDynamic; `repeated_specifiers_file; repeated_specifiers_mixture_dict); "Invalid repeated type"]
-1 "\n+----------|| Test repeated specifiers with array ||----------+\n";
-1 "<--- Pass correct data --->";
array:serializeArrayFromList[`RepeatedSpecifiersTest;repeated_specifiers];
.test.ASSERT_TRUE[parseArrayToList; (`RepeatedSpecifiersTest; array); repeated_specifiers]
array:serializeArrayFromList[`RepeatedSpecifiersTestDynamic; repeated_specifiers];
.test.ASSERT_TRUE[parseArrayToList; (`RepeatedSpecifiersTestDynamic; array); repeated_specifiers]
-1 "<--- Pass wrong type and specifiers --->";
.test.ASSERT_ERROR[serializeArrayFromList; (`RepeatedSpecifiersTest; repeated_specifiers_mixture); "Invalid repeated type"]
.test.ASSERT_ERROR[serializeArrayFromList; (`RepeatedSpecifiersTestDynamic; repeated_specifiers_mixture); "Invalid repeated type"]
-1 "\n+----------|| Test repeated specifiers with array and field name dictionary ||----------+\n";
-1 "<--- Pass correct data --->";
array:serializeArrayFromDict[`RepeatedSpecifiersTest;repeated_specifiers_dict];
.test.ASSERT_TRUE[parseArrayToDict; (`RepeatedSpecifiersTest; array); repeated_specifiers_dict]
array:serializeArrayFromDict[`RepeatedSpecifiersTestDynamic; repeated_specifiers_dict];
.test.ASSERT_TRUE[parseArrayToDict; (`RepeatedSpecifiersTestDynamic; array); repeated_specifiers_dict]
-1 "<--- Pass wrong type and specifiers --->";
.test.ASSERT_ERROR[serializeArrayFromDict; (`RepeatedSpecifiersTest; repeated_specifiers_mixture_dict); "Invalid repeated type"]
.test.ASSERT_ERROR[serializeArrayFromDict; (`RepeatedSpecifiersTestDynamic; repeated_specifiers_mixture_dict); "Invalid repeated type"]
-1 "\n+----------|| Test map specifiers with file ||----------+\n";
-1 "<--- Pass correct data --->";
map_specifiers:((enlist 2020.01.01D12:34:56.123456789)!(enlist 2020.01m);(enlist 2020.01.01)!(enlist 2020.01.01T12:34:56.123);(enlist 12:34:56.123456789)!(enlist 12:34);(enlist 12:34:56)!(enlist 12:34:56.123);(1?0Ng)!(1?0Ng));
saveMessageFromList[`MapSpecifiersTest;`map_specifiers_file;map_specifiers];
.test.ASSERT_TRUE[loadMessageToList; (`MapSpecifiersTest; `map_specifiers_file); map_specifiers]
saveMessageFromList[`MapSpecifiersTestDynamic;`map_specifiers_file;map_specifiers];
.test.ASSERT_TRUE[loadMessageToList; (`MapSpecifiersTestDynamic; `map_specifiers_file); map_specifiers]
-1 "<--- Pass wrong type (compatible in q context but not in protobuf) --->";
map_specifiers_compatible:((enlist 631197296123456789)!(enlist 240i);(enlist 7305i)!(enlist 7305.524);(enlist 45296123456789)!(enlist 754);(enlist 45296)!(enlist 45296123i);(1?0Ng)!(1?0Ng));
.test.ASSERT_ERROR[saveMessageFromList; (`MapSpecifiersTest; `map_specifiers_file; map_specifiers_compatible); "Invalid map element type"]
.test.ASSERT_ERROR[saveMessageFromList; (`MapSpecifiersTestDynamic; `map_specifiers_file; map_specifiers_compatible); "Invalid map element type"]
-1 "\n+----------|| Test map specifiers with file and field name dictionary ||----------+\n";
-1 "<--- Pass correct data --->";
map_specifiers_fields:getMessageFields[`MapSpecifiersTest];
map_specifiers_dict:map_specifiers_fields!map_specifiers;
saveMessageFromDict[`MapSpecifiersTest;`map_specifiers_file;map_specifiers_dict];
.test.ASSERT_TRUE[loadMessageToDict; (`MapSpecifiersTest; `map_specifiers_file); map_specifiers_dict]
saveMessageFromDict[`MapSpecifiersTestDynamic;`map_specifiers_file;map_specifiers_dict];
.test.ASSERT_TRUE[loadMessageToDict; (`MapSpecifiersTestDynamic; `map_specifiers_file); map_specifiers_dict]
-1 "<--- Pass wrong type (compatible in q context but not in protobuf) --->";
map_specifiers_compatible_dict:map_specifiers_fields!map_specifiers_compatible;
.test.ASSERT_ERROR[saveMessageFromDict; (`MapSpecifiersTest; `map_specifiers_file; map_specifiers_compatible_dict); "Invalid map element type"]
.test.ASSERT_ERROR[saveMessageFromDict; (`MapSpecifiersTestDynamic; `map_specifiers_file; map_specifiers_compatible_dict); "Invalid map element type"]
-1 "\n+----------|| Test map specifiers with array ||----------+\n";
-1 "<--- Pass correct data --->";
array:serializeArrayFromList[`MapSpecifiersTest; map_specifiers];
.test.ASSERT_TRUE[parseArrayToList; (`MapSpecifiersTest; array); map_specifiers]
array:serializeArrayFromList[`MapSpecifiersTestDynamic;map_specifiers];
.test.ASSERT_TRUE[parseArrayToList; (`MapSpecifiersTestDynamic; array); map_specifiers]
-1 "<--- Pass wrong type (compatible in q context but not in protobuf) --->";
.test.ASSERT_ERROR[serializeArrayFromList; (`MapSpecifiersTest; map_specifiers_compatible); "Invalid map element type"]
.test.ASSERT_ERROR[serializeArrayFromList; (`MapSpecifiersTestDynamic; map_specifiers_compatible); "Invalid map element type"]
-1 "\n+----------|| Test map specifiers with array and field name dictionary ||----------+\n";
-1 "<--- Pass correct data --->";
array:serializeArrayFromDict[`MapSpecifiersTest; map_specifiers_dict];
.test.ASSERT_TRUE[parseArrayToDict; (`MapSpecifiersTest; array); map_specifiers_dict]
array:serializeArrayFromDict[`MapSpecifiersTestDynamic;map_specifiers_dict];
.test.ASSERT_TRUE[parseArrayToDict; (`MapSpecifiersTestDynamic; array); map_specifiers_dict]
-1 "<--- Pass wrong type (compatible in q context but not in protobuf) --->";
.test.ASSERT_ERROR[serializeArrayFromDict; (`MapSpecifiersTest; map_specifiers_compatible_dict); "Invalid map element type"]
.test.ASSERT_ERROR[serializeArrayFromDict; (`MapSpecifiersTestDynamic; map_specifiers_compatible_dict); "Invalid map element type"]
-1 "\n+----------|| Test oneof permutations ||----------+\n";
-1 "<--- Pass correct data --->";
oneof1:(1.1f;();();"str");
oneof2:(();12:34:56;();"str");
oneof3:(();();(1j; 2.1 2.2f);"str");
oneofnone:(();();();"str");
.test.ASSERT_TRUE[parseArrayToList; (`OneofTest; serializeArrayFromList[`OneofTest;oneof1]); oneof1]
.test.ASSERT_TRUE[parseArrayToList; (`OneofTest; serializeArrayFromList[`OneofTest;oneof2]); oneof2]
.test.ASSERT_TRUE[parseArrayToList; (`OneofTest; serializeArrayFromList[`OneofTest;oneof3]); oneof3]
.test.ASSERT_TRUE[parseArrayToList; (`OneofTest; serializeArrayFromList[`OneofTest;oneofnone]); oneofnone]
.test.ASSERT_TRUE[parseArrayToList; (`OneofTestDynamic; serializeArrayFromList[`OneofTest;oneof1]); oneof1]
.test.ASSERT_TRUE[parseArrayToList; (`OneofTestDynamic; serializeArrayFromList[`OneofTest;oneof2]); oneof2]
.test.ASSERT_TRUE[parseArrayToList; (`OneofTestDynamic; serializeArrayFromList[`OneofTest;oneof3]); oneof3]
.test.ASSERT_TRUE[parseArrayToList; (`OneofTestDynamic; serializeArrayFromList[`OneofTest;oneofnone]); oneofnone]
-1 "<--- Pass wrong type data --->";
oneofwrong:(42i; (); (); "str");
.test.ASSERT_ERROR[serializeArrayFromList; (`OneofTest; oneofwrong); "Invalid scalar type"]
oneofwrong2:((); 123456; (); "str");
.test.ASSERT_ERROR[serializeArrayFromList; (`OneofTestDynamic; oneofwrong2); "Invalid scalar type"]
-1 "<--- Pass multiple populated data --->";
// If mulitple oneofs are set, only the last is populated
oneofall:(1.1f;12:34:56;(1j; 2.1 2.2f);"str");
.test.ASSERT_TRUE[parseArrayToList; (`OneofTest; serializeArrayFromList[`OneofTest; oneofall]); oneof3]
.test.ASSERT_TRUE[parseArrayToList; (`OneofTest; serializeArrayFromList[`OneofTestDynamic; oneofall]); oneof3]
-1 "\n+----------|| Test oneof permutations with field name dictionary ||----------+\n";
-1 "<--- Pass correct data --->";
oneof_fields:getMessageFields[`OneofTest];
oneof1_dict:oneof_fields!oneof1;
oneof2_dict:oneof_fields!oneof2;
oneofmsg_fields:getMessageFields[`OneofTest.OneofMsg];
oneof3_dict:oneof_fields!(();();oneofmsg_fields!(1j; 2.1 2.2f);"str");
oneofnone_dict:oneof_fields!oneofnone;
.test.ASSERT_TRUE[parseArrayToDict; (`OneofTest; serializeArrayFromDict[`OneofTest;oneof1_dict]); oneof1_dict]
.test.ASSERT_TRUE[parseArrayToDict; (`OneofTest; serializeArrayFromDict[`OneofTest;oneof2_dict]); oneof2_dict]
.test.ASSERT_TRUE[parseArrayToDict; (`OneofTest; serializeArrayFromDict[`OneofTest;oneof3_dict]); oneof3_dict]
.test.ASSERT_TRUE[parseArrayToDict; (`OneofTest; serializeArrayFromDict[`OneofTest;oneofnone_dict]); oneofnone_dict]
.test.ASSERT_TRUE[parseArrayToDict; (`OneofTestDynamic; serializeArrayFromDict[`OneofTest;oneof1_dict]); oneof1_dict]
.test.ASSERT_TRUE[parseArrayToDict; (`OneofTestDynamic; serializeArrayFromDict[`OneofTest;oneof2_dict]); oneof2_dict]
.test.ASSERT_TRUE[parseArrayToDict; (`OneofTestDynamic; serializeArrayFromDict[`OneofTest;oneof3_dict]); oneof3_dict]
.test.ASSERT_TRUE[parseArrayToDict; (`OneofTestDynamic; serializeArrayFromDict[`OneofTest;oneofnone_dict]); oneofnone_dict]
-1 "<--- Pass wrong type data --->";
onoofwrong_dict:oneof_fields!oneofwrong;
.test.ASSERT_ERROR[serializeArrayFromDict; (`OneofTest; onoofwrong_dict); "Invalid scalar type"]
oneofwrong2_dict:oneof_fields!oneofwrong2;
.test.ASSERT_ERROR[serializeArrayFromDict; (`OneofTestDynamic; oneofwrong2_dict); "Invalid scalar type"]
-1 "<--- Pass multiple populated data --->";
// If mulitple oneofs are set, only the last is populated
oneofall_dict:oneof_fields!(1.1f;12:34:56;oneofmsg_fields!(1j; 2.1 2.2f);"str");
.test.ASSERT_TRUE[parseArrayToDict; (`OneofTest; serializeArrayFromDict[`OneofTest; oneofall_dict]); oneof3_dict]
.test.ASSERT_TRUE[parseArrayToDict; (`OneofTest; serializeArrayFromDict[`OneofTestDynamic; oneofall_dict]); oneof3_dict]
-1 "\n+----------|| Finished testing ||----------+\n";
| 45.627746 | 249 | 0.774425 |
edc633684aade2f10b30627a3dec5173fefc435e | 2,720 | t | Perl | t/field-wer2.t | lucilajuarez/SHenhance | abe9979064b80b002d4933fc57ff7bae5f36dc00 | [
"Artistic-1.0"
] | null | null | null | t/field-wer2.t | lucilajuarez/SHenhance | abe9979064b80b002d4933fc57ff7bae5f36dc00 | [
"Artistic-1.0"
] | null | null | null | t/field-wer2.t | lucilajuarez/SHenhance | abe9979064b80b002d4933fc57ff7bae5f36dc00 | [
"Artistic-1.0"
] | null | null | null | =head1 COPYRIGHT NOTICE
Photonic - A perl package for calculations on photonics and
metamaterials.
Copyright (C) 1916 by W. Luis Mochán
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
[email protected]
Instituto de Ciencias Físicas, UNAM
Apartado Postal 48-3
62251 Cuernavaca, Morelos
México
=cut
use strict;
use warnings;
use PDL;
use PDL::NiceSlice;
use PDL::Complex;
use Photonic::Geometry::FromB;
use Photonic::WE::R2::AllH;
use Photonic::WE::R2::Metric;
use Photonic::WE::R2::Field;
use Machine::Epsilon;
use List::Util;
use Test::More tests => 2;
#my $pi=4*atan2(1,1);
sub Cagree {
my $a=shift;
my $b=shift//0;
return (($a-$b)->Cabs2)->sum<=1e-7;
}
sub Cdif {
my $a=shift;
my $b=shift//0;
return (($a-$b)->Cabs2)->sum;
}
my $ea=1+0*i;
my $eb=3+4*i;
#Check haydock coefficients for simple 1D system. Longitudinal case
my $B=zeroes(11)->xvals<5; #1D system
my $gl=Photonic::Geometry::FromB->new(B=>$B, Direction0=>pdl([1])); #long
my $ml=Photonic::WE::R2::Metric->new(geometry=>$gl, epsilon=>$ea->re,
wavenumber=>pdl(1), wavevector=>pdl([0.01]));
my $nr=Photonic::WE::R2::AllH->new(metric=>$ml, nh=>10, keepStates=>1,
polarization=>pdl([1])->r2C);
my $flo=Photonic::WE::R2::Field->new(nr=>$nr, nh=>10);
my $flv=$flo->evaluate($eb);
my $fla=1/$ea;
my $flb=1/$eb;
my $fproml=$fla*(1-$gl->f)+$flb*($gl->f);
($fla, $flb)=map {$_/$fproml} ($fla, $flb);
my $flx=pdl([$fla*(1-$B)+$flb*$B])->complex->mv(1,-1);
ok(Cagree($flv, $flx), "1D long field");
#View 2D from 1D superlattice. Long wavelength transverse case
my $Bt=zeroes(1,11)->yvals<5; #2D flat system
my $gt=Photonic::Geometry::FromB->new(B=>$Bt, Direction0=>pdl([1,0])); #trans
my $mt=Photonic::WE::R2::Metric->new(geometry=>$gt, epsilon=>pdl(1),
wavenumber=>pdl(0.001), wavevector=>pdl([0,0.0001]));
my $nt=Photonic::WE::R2::AllH->new(metric=>$mt, nh=>10, keepStates=>1,
polarization=>pdl([1,0])->r2C);
my $fto=Photonic::WE::R2::Field->new(nr=>$nt, nh=>10);
my $ftv=$fto->evaluate($eb);
my $ftx=pdl(r2C(1), r2C(0))->complex;
ok(Cagree($ftv, $ftx), "1D trans field");
| 30.561798 | 77 | 0.677574 |
73f112edb5c3b5a419ffa3ac5ed2fac9fec0b9b5 | 7,282 | pl | Perl | make_documentation.pl | gringer/bootstrap-subsampling | 9b794dbcd05e983dfd37bf46e39c5e873ed2ae37 | [
"ISC"
] | null | null | null | make_documentation.pl | gringer/bootstrap-subsampling | 9b794dbcd05e983dfd37bf46e39c5e873ed2ae37 | [
"ISC"
] | null | null | null | make_documentation.pl | gringer/bootstrap-subsampling | 9b794dbcd05e983dfd37bf46e39c5e873ed2ae37 | [
"ISC"
] | 1 | 2021-11-02T11:22:10.000Z | 2021-11-02T11:22:10.000Z | #!/usr/bin/perl
# make_documentation.pl -- creates LaTeX documentation for script files.
# Author: David Eccles (gringer), 2009-2016 <[email protected]>
use strict;
use warnings;
sub usage {
print("usage: ./make_documentation.pl <file name>\n");
print("\n");
}
my @fileNames = ();
# extract command line arguments
while(@ARGV){
my $argument = shift @ARGV;
if(-f $argument){ # file existence check
push(@fileNames, $argument);
} else {
if($argument eq "-help"){
usage();
exit(0);
}
else{
printf(STDERR "Error: Unknown command-line option, '$argument'\n");
usage();
exit(1);
}
}
}
if(!@fileNames){
printf(STDERR "Error: No files specified on command line\n");
usage();
exit(2);
}
while(@fileNames){
my $currentFile = shift(@fileNames);
$currentFile =~ s#^.*(\|/)##; # remove dir names from argument
print(STDERR "Now checking '$currentFile'\n");
open(INFILE, "< $currentFile");
my %foundItems = ();
my $codeLines = 0;
my $oneLinerContinue = 0; # false
my $usageSection = 0; # false
my $usageContinue = 0; # false
my $nameCredit = 0; # false
if($currentFile =~ /\.pl$/){
# Perl specific tests
while(<INFILE>){
if(/David Eccles \(gringer\), 20[0-9][0-9]/){
$nameCredit = 1; # true
}
if(/sub usage \{/){
$foundItems{"usage"} = 1;
$usageSection = 1; # true
}
if($usageSection){
if($usageContinue){
if(/^\s+"(.*?)\\n"/){
$foundItems{"fileUsage"} .= $1;
}
}
if(/^\s+print.*?"usage: (.*?)\\n"/){
$foundItems{"fileUsage"} = $1;
}
if(/^\s+print.*?"usage: (.*?)"\./){
$foundItems{"fileUsage"} = $1;
$usageContinue = 1; # true
}
if(/^\s+print.*?"-(.*?)\s*:\s*(.*?)\\n"/){
my $optionName = $1;
my $optionDesc = $2;
if(!exists($foundItems{"commandLineOptions"})){
$foundItems{"commandLineOptions"} = "";
}
$foundItems{"commandLineOptions"} .=
"\\item[-$optionName] $optionDesc\n";
}
if(/^\s+}/){
$usageSection = 0; #false
}
}
if($oneLinerContinue && (/^# (.*)$/)){
$foundItems{"oneLiner"}.= " ".$1;
} else {
$oneLinerContinue = 0; # false
}
if(/^# $currentFile -- (.*)$/){
$foundItems{"oneLiner"} = $1;
$oneLinerContinue = 1; # true
}
if(/^use warnings;/){
$foundItems{"warningUsed"} = 1;
}
if(/^use strict;/){
$foundItems{"strictUsed"} = 1;
}
if(!(/^\s*$/) && !(/^#/)){
$codeLines++;
}
}
close(INFILE);
# Perl specific warnings
if(!exists($foundItems{"warningUsed"})){
print(STDERR "Error: no 'use warnings;' line found in file\n");
usage();
exit(3);
}
if(!exists($foundItems{"strictUsed"})){
print(STDERR "Error: no 'use strict;' line found in file\n");
usage();
exit(3);
}
}
if($currentFile =~ /\.r$/){
# R specific tests, uses 'cat' instead of print
while(<INFILE>){
if(/David Eccles \(gringer\), 20[0-9][0-9]/){
$nameCredit = 1; # true
}
if(/usage <- function\(\)\{/){
$foundItems{"usage"} = 1;
$usageSection = 1; # true
}
if($usageSection){
if($usageContinue){
if(/^\s+"(.*?)\\n"/){
$foundItems{"fileUsage"} .= $1;
}
}
if(/^\s+cat.*?"usage: (.*?)\\n"/){
$foundItems{"fileUsage"} = $1;
}
if(/^\s+cat.*?"usage: (.*?)",/){
$foundItems{"fileUsage"} = $1;
$usageContinue = 1; # true
}
if(/^\s+cat.*?"-(.*?)\s*:\s*(.*?)\\n"/){
my $optionName = $1;
my $optionDesc = $2;
if(!exists($foundItems{"commandLineOptions"})){
$foundItems{"commandLineOptions"} = "";
}
$foundItems{"commandLineOptions"} .=
"\\item[-$optionName] $optionDesc\n";
}
if(/^\s+}/){
$usageSection = 0; #false
}
}
if($oneLinerContinue && (/^## (.*)$/)){
$foundItems{"oneLiner"}.= " ".$1;
} else {
$oneLinerContinue = 0; # false
}
if(/^## $currentFile -- (.*)$/){
$foundItems{"oneLiner"} = $1;
$oneLinerContinue = 1; # true
}
if(!(/^\s*$/) && !(/^#/)){
$codeLines++;
}
}
close(INFILE);
# R specific warnings
}
# generic warnings and final printing
if(!exists($foundItems{"oneLiner"})){
print(STDERR "Error: no one Liner description found in file\n");
usage();
exit(3);
}
if(!exists($foundItems{"usage"})){
print(STDERR "Error: no usage section found in file\n");
usage();
exit(3);
}
if(!$nameCredit){
print(STDERR "David Eccles (gringer), <date> is not acknowledged as author in file\n");
usage();
exit(3);
}
my $fileSize = qx{wc -c $currentFile};
my $fileSecName = $currentFile;
$fileSecName =~ s/_/-/g;
$fileSize =~ s/ .*$//;
if($fileSize > 1024){
$fileSize = sprintf("%d",$fileSize / 1024)." KiB";
} else {
$fileSize = sprintf("%d",$fileSize)." B";
}
printf("\\section{%s}\n", $currentFile);
printf("\\label{sec:%s}\n\n", $fileSecName);
printf("\\subsection{Overview}\n");
printf("\\label{sec:%s-overview}\n\n", $fileSecName);
printf("\\begin{description}\n");
printf("\\item[Usage] %s\n", $foundItems{"fileUsage"});
printf("\\item[Purpose] %s\n", $foundItems{"oneLiner"});
printf("\\item[Lines of Code] %d\n", $codeLines);
printf("\\item[File size] %s\n", $fileSize);
printf("\\end{description}\n\n");
printf("\\subsection{Command Line Options}\n");
printf("\\label{sec:%s-command-line}\n\n", $fileSecName);
if(exists($foundItems{"commandLineOptions"})){
printf("\\begin{description}\n");
printf($foundItems{"commandLineOptions"});
printf("\\end{description}\n\n");
} else {
printf("This script has no additional command line options.\n\n");
}
printf("\\emph{[Additional Comments]}\n\n");
print(STDERR "Finished checking '$currentFile'\n");
}
| 33.251142 | 95 | 0.438341 |
edb911e997de41289d792041f9dd1e1639d8b407 | 644 | pl | Perl | 3rd year/SRCR/Trabalho-Individual/carreiras/162.pl | luis1ribeiro/LEI-MIEI | e0f7a0ddaae2b11cb376129dc37d8b51e9010204 | [
"MIT"
] | null | null | null | 3rd year/SRCR/Trabalho-Individual/carreiras/162.pl | luis1ribeiro/LEI-MIEI | e0f7a0ddaae2b11cb376129dc37d8b51e9010204 | [
"MIT"
] | null | null | null | 3rd year/SRCR/Trabalho-Individual/carreiras/162.pl | luis1ribeiro/LEI-MIEI | e0f7a0ddaae2b11cb376129dc37d8b51e9010204 | [
"MIT"
] | null | null | null | nodo(629, 626, 19.39188033678643, 162).
nodo(626, 630, 281.7097729934093, 162).
nodo(630, 616, 49.275252340476875, 162).
nodo(616, 639, 1149.3397548723788, 162).
nodo(639, 636, 18.567121478569966, 162).
nodo(636, 12, 200.44675751928992, 162).
nodo(12, 634, 62.22786674794962, 162).
nodo(634, 678, 376.33287472300583, 162).
nodo(678, 669, 42.5278972392698, 162).
nodo(669, 76, 207.33986333960718, 162).
nodo(76, 668, 53.88156085340724, 162).
nodo(668, 674, 224.81356031164503, 162).
nodo(674, 73, 21.617384208091895, 162).
nodo(73, 658, 218.95546500870705, 162).
nodo(658, 666, 102.27834286787207, 162).
nodo(666, 528, 292.38734924753714, 162).
| 37.882353 | 40 | 0.726708 |
ed57feb24d40cdcac9f061eecda253a80e22190e | 1,162 | pm | Perl | lib/Test2/TeamCity/Kit.pm | maxmind/Test2-Formatter-TeamCity | e5fd900d68599d84c607c5a65ef8b2552231555e | [
"Apache-2.0",
"MIT"
] | 1 | 2021-06-04T20:28:34.000Z | 2021-06-04T20:28:34.000Z | lib/Test2/TeamCity/Kit.pm | ThePerlShop/Test2-Formatter-TeamCity | e5fd900d68599d84c607c5a65ef8b2552231555e | [
"Apache-2.0",
"MIT"
] | null | null | null | lib/Test2/TeamCity/Kit.pm | ThePerlShop/Test2-Formatter-TeamCity | e5fd900d68599d84c607c5a65ef8b2552231555e | [
"Apache-2.0",
"MIT"
] | 2 | 2021-06-04T20:26:39.000Z | 2021-06-07T21:14:07.000Z | package Test2::TeamCity::Kit;
use strict;
use warnings;
use Import::Into;
use autodie 2.25 ();
use curry ();
use experimental qw(signatures);
use feature ();
use mro ();
use multidimensional ();
use Object::Tap ();
use open qw( :encoding(UTF-8) :std );
use utf8 ();
sub import {
my $caller_level = 1;
strict->import::into($caller_level);
warnings->import::into($caller_level);
my ($version) = $^V =~ /^v(5\.\d+)/;
feature->import::into( $caller_level, ':' . $version );
feature->unimport::out_of( $caller_level, 'indirect' );
## no critic (Subroutines::ProhibitCallsToUnexportedSubs)
mro::set_mro( scalar caller(), 'c3' );
## use critic
#
utf8->import::into($caller_level);
multidimensional->unimport::out_of($caller_level);
'open'->import::into( $caller_level, ':encoding(UTF-8)' );
autodie->import::into( $caller_level, ':all' );
curry->import::into($caller_level);
Object::Tap->import::into($caller_level);
my @experiments = qw(
lexical_subs
postderef
signatures
);
experimental->import::into( $caller_level, @experiments );
}
1;
| 23.714286 | 62 | 0.622203 |
ed6ed17ac535e61c66c0327185c8c4857a40f8b5 | 158 | pl | Perl | ilpexp/problem/iggp/attrition/metagol.pl | logic-and-learning-lab/Popper-experiments | 94d7499e32c3c9b01da5fd53cddef8a8afa8d509 | [
"MIT"
] | 3 | 2022-01-30T09:51:17.000Z | 2022-03-13T20:04:09.000Z | ilpexp/problem/iggp/attrition/metagol.pl | logic-and-learning-lab/Popper-experiments | 94d7499e32c3c9b01da5fd53cddef8a8afa8d509 | [
"MIT"
] | 5 | 2022-01-30T09:38:12.000Z | 2022-01-31T08:34:49.000Z | ilpexp/problem/iggp/attrition/metagol.pl | logic-and-learning-lab/Popper-experiments | 94d7499e32c3c9b01da5fd53cddef8a8afa8d509 | [
"MIT"
] | null | null | null |
body_pred(my_true_score/3).
body_pred(my_true_control/2).
body_pred(does/3).
body_pred(my_true_claim_made_by/2).
body_pred(my_succ/2).
body_pred(opponent/2). | 22.571429 | 35 | 0.810127 |
ed9529ad2209c8282e10108817cf4f05feb0d589 | 1,802 | pm | Perl | lib/Google/Ads/AdWords/v201409/SharedSetOperation.pm | gitpan/Google-Ads-AdWords-Client | 44c7408a1b7f8f16b22efa359c037d1f986f04f1 | [
"Apache-2.0"
] | null | null | null | lib/Google/Ads/AdWords/v201409/SharedSetOperation.pm | gitpan/Google-Ads-AdWords-Client | 44c7408a1b7f8f16b22efa359c037d1f986f04f1 | [
"Apache-2.0"
] | null | null | null | lib/Google/Ads/AdWords/v201409/SharedSetOperation.pm | gitpan/Google-Ads-AdWords-Client | 44c7408a1b7f8f16b22efa359c037d1f986f04f1 | [
"Apache-2.0"
] | null | null | null | package Google::Ads::AdWords::v201409::SharedSetOperation;
use strict;
use warnings;
__PACKAGE__->_set_element_form_qualified(1);
sub get_xmlns { 'https://adwords.google.com/api/adwords/cm/v201409' };
our $XML_ATTRIBUTE_CLASS;
undef $XML_ATTRIBUTE_CLASS;
sub __get_attr_class {
return $XML_ATTRIBUTE_CLASS;
}
use base qw(Google::Ads::AdWords::v201409::Operation);
# Variety: sequence
use Class::Std::Fast::Storable constructor => 'none';
use base qw(Google::Ads::SOAP::Typelib::ComplexType);
{ # BLOCK to scope variables
my %operator_of :ATTR(:get<operator>);
my %Operation__Type_of :ATTR(:get<Operation__Type>);
my %operand_of :ATTR(:get<operand>);
__PACKAGE__->_factory(
[ qw( operator
Operation__Type
operand
) ],
{
'operator' => \%operator_of,
'Operation__Type' => \%Operation__Type_of,
'operand' => \%operand_of,
},
{
'operator' => 'Google::Ads::AdWords::v201409::Operator',
'Operation__Type' => 'SOAP::WSDL::XSD::Typelib::Builtin::string',
'operand' => 'Google::Ads::AdWords::v201409::SharedSet',
},
{
'operator' => 'operator',
'Operation__Type' => 'Operation.Type',
'operand' => 'operand',
}
);
} # end BLOCK
1;
=pod
=head1 NAME
Google::Ads::AdWords::v201409::SharedSetOperation
=head1 DESCRIPTION
Perl data type class for the XML Schema defined complexType
SharedSetOperation from the namespace https://adwords.google.com/api/adwords/cm/v201409.
=head2 PROPERTIES
The following properties may be accessed using get_PROPERTY / set_PROPERTY
methods:
=over
=item * operand
=back
=head1 METHODS
=head2 new
Constructor. The following data structure may be passed to new():
=head1 AUTHOR
Generated by SOAP::WSDL
=cut
| 16.089286 | 88 | 0.673696 |
eda8912157d93b11ad4ff34bb0df27a4d1ed1485 | 402 | t | Perl | t/10-no-done_testing.t | gitpan/Test-Warnings | a8850add5f7908d97b39ec12c052cf9c0c31d3b4 | [
"Artistic-1.0"
] | null | null | null | t/10-no-done_testing.t | gitpan/Test-Warnings | a8850add5f7908d97b39ec12c052cf9c0c31d3b4 | [
"Artistic-1.0"
] | null | null | null | t/10-no-done_testing.t | gitpan/Test-Warnings | a8850add5f7908d97b39ec12c052cf9c0c31d3b4 | [
"Artistic-1.0"
] | null | null | null | use strict;
use warnings FATAL => 'all';
use Test::More;
END {
final_tests();
}
use Test::Warnings ':no_end_test';
warn 'this warning should not be caught';
pass 'a passing test to keep done_testing happy';
done_testing;
# this is run in the END block
sub final_tests
{
# if there was anything else than 1 test run, then we will fail
exit (Test::Builder->new->current_test <=> 1);
}
| 16.75 | 67 | 0.689055 |
ed79198ddcf27fa57b5fe5496b6bd9b19a71cc7b | 278 | t | Perl | t/00-load.t | duncanmg/WebService-Validator-HTML5-W3C | e946c456ff57b27d3a0db066961a2924bf7e3ca5 | [
"Apache-2.0"
] | null | null | null | t/00-load.t | duncanmg/WebService-Validator-HTML5-W3C | e946c456ff57b27d3a0db066961a2924bf7e3ca5 | [
"Apache-2.0"
] | null | null | null | t/00-load.t | duncanmg/WebService-Validator-HTML5-W3C | e946c456ff57b27d3a0db066961a2924bf7e3ca5 | [
"Apache-2.0"
] | null | null | null | #!perl -T
use 5.006;
use strict;
use warnings;
use Test::More;
plan tests => 1;
BEGIN {
use_ok( 'WebService::Validator::HTML5::W3C' ) || print "Bail out!\n";
}
diag( "Testing WebService::Validator::HTML5::W3C $WebService::Validator::HTML5::W3C::VERSION, Perl $], $^X" );
| 19.857143 | 110 | 0.651079 |
ed93f05808d4ee9700eda537c01de8eebec52bf0 | 5,425 | pm | Perl | lib/Module/Starter.pm | choroba/module-starter | 9689e0f674ef82c44359fe105561451361397d3c | [
"Artistic-1.0"
] | null | null | null | lib/Module/Starter.pm | choroba/module-starter | 9689e0f674ef82c44359fe105561451361397d3c | [
"Artistic-1.0"
] | null | null | null | lib/Module/Starter.pm | choroba/module-starter | 9689e0f674ef82c44359fe105561451361397d3c | [
"Artistic-1.0"
] | null | null | null | package Module::Starter;
use warnings;
use strict;
use Carp qw( croak );
use Module::Runtime qw( require_module );
=head1 NAME
Module::Starter - a simple starter kit for any module
=head1 VERSION
Version 1.76
=cut
our $VERSION = '1.76';
=head1 SYNOPSIS
Nothing in here is meant for public consumption. Use L<module-starter>
from the command line.
module-starter --module=Foo::Bar,Foo::Bat \
--author="Andy Lester" [email protected]
=head1 DESCRIPTION
This is the core module for Module::Starter. If you're not looking to extend
or alter the behavior of this module, you probably want to look at
L<module-starter> instead.
Module::Starter is used to create a skeletal CPAN distribution, including basic
builder scripts, tests, documentation, and module code. This is done through
just one method, C<create_distro>.
=head1 METHODS
=head2 Module::Starter->create_distro(%args)
C<create_distro> is the only method you should need to use from outside this
module; all the other methods are called internally by this one.
This method creates orchestrates all the work; it creates distribution and
populates it with the all the requires files.
It takes a hash of params, as follows:
distro => $distroname, # distribution name (defaults to first module)
modules => [ module names ], # modules to create in distro
dir => $dirname, # directory in which to build distro
builder => 'Module::Build', # defaults to ExtUtils::MakeMaker
# or specify more than one builder in an
# arrayref
license => $license, # type of license; defaults to 'artistic2'
author => $author, # author's full name (taken from C<getpwuid> if not provided)
email => $email, # author's email address (taken from C<EMAIL> if not provided)
ignores_type => $type, # ignores file type ('generic', 'cvs', 'git', 'hg', 'manifest' )
fatalize => $fatalize, # generate code that makes warnings fatal
verbose => $verbose, # bool: print progress messages; defaults to 0
force => $force # bool: overwrite existing files; defaults to 0
The ignores_type is a new feature that allows one to create SCM-specific ignore files.
These are the mappings:
ignores_type => 'generic' # default, creates 'ignore.txt'
ignores_type => 'cvs' # creates .cvsignore
ignores_type => 'git' # creates .gitignore
ignores_type => 'hg' # creates .hgignore
ignores_type => 'manifest' # creates MANIFEST.SKIP
It is also possible to provide an array ref with multiple types wanted:
ignores_type => [ 'git', 'manifest' ]
=head1 PLUGINS
Module::Starter itself doesn't actually do anything. It must load plugins that
implement C<create_distro> and other methods. This is done by the class's C<import>
routine, which accepts a list of plugins to be loaded, in order.
For more information, refer to L<Module::Starter::Plugin>.
=cut
sub import {
my $class = shift;
my @plugins = ((@_ ? @_ : 'Module::Starter::Simple'), $class);
my $parent;
while (my $child = shift @plugins) {
require_module $child;
## no critic
no strict 'refs'; #Violates ProhibitNoStrict
push @{"${child}::ISA"}, $parent if $parent;
use strict 'refs';
## use critic
if ( @plugins && $child->can('load_plugins') ) {
$parent->load_plugins(@plugins);
last;
}
$parent = $child;
}
return;
}
=head1 AUTHORS
Dan Book, C<< <dbook at cpan.org> >>
Sawyer X, C<< <xsawyerx at cpan.org> >>
Andy Lester, C<< <petdance at cpan.org> >>
Ricardo Signes, C<< <rjbs at cpan.org> >>
C.J. Adams-Collier, C<< <cjac at colliertech.org> >>
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Module::Starter
You can also look for information at:
=over 4
=item * Source code at GitHub
L<https://github.com/xsawyerx/module-starter>
=item * AnnoCPAN: Annotated CPAN documentation
L<http://annocpan.org/dist/Module-Starter>
=item * CPAN Ratings
L<http://cpanratings.perl.org/dist/Module-Starter>
=item * GitHub issue tracker
L<https://github.com/xsawyerx/module-starter/issues>
=item * Search CPAN
L<https://metacpan.org/release/Module-Starter>
=back
=head1 BUGS
Please report any bugs or feature requests to the bugtracker for this project
on GitHub at: L<https://github.com/xsawyerx/module-starter/issues>. I will be
notified, and then you'll automatically be notified of progress on your bug
as I make changes.
=head1 COPYRIGHT
Copyright 2005-2009 Andy Lester, Ricardo Signes and C.J. Adams-Collier,
All Rights Reserved.
Copyright 2010 Sawyer X, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=head1 SEE ALSO
=over 4
=item L<mbtiny>
Minimal authoring tool to create and manage distributions using
L<Module::Build::Tiny> as an installer.
=item L<Dist::Milla>
Easy to use and powerful authoring tool using L<Dist::Zilla> to create and
manage distributions.
=item L<Minilla>
Authoring tool similar to L<Dist::Milla> but without using L<Dist::Zilla>.
=item L<Dist::Zilla>
Very complex, fully pluggable and customizable distribution builder.
=back
=cut
1;
# vi:et:sw=4 ts=4
| 26.724138 | 95 | 0.686083 |
edaab0d55750045e0efa52bfcdeea5b9721d43ed | 1,578 | pm | Perl | auto-lib/Paws/Signer/S3SignedObject.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 164 | 2015-01-08T14:58:53.000Z | 2022-02-20T19:16:24.000Z | auto-lib/Paws/Signer/S3SignedObject.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 348 | 2015-01-07T22:08:38.000Z | 2022-01-27T14:34:44.000Z | auto-lib/Paws/Signer/S3SignedObject.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 87 | 2015-04-22T06:29:47.000Z | 2021-09-29T14:45:55.000Z | # Generated by default/object.tt
package Paws::Signer::S3SignedObject;
use Moose;
has BucketName => (is => 'ro', isa => 'Str', request_name => 'bucketName', traits => ['NameInRequest']);
has Key => (is => 'ro', isa => 'Str', request_name => 'key', traits => ['NameInRequest']);
1;
### main pod documentation begin ###
=head1 NAME
Paws::Signer::S3SignedObject
=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::Signer::S3SignedObject object:
$service_obj->Method(Att1 => { BucketName => $value, ..., Key => $value });
=head3 Results returned from an API call
Use accessors for each attribute. If Att1 is expected to be an Paws::Signer::S3SignedObject object:
$result = $service_obj->Method(...);
$result->Att1->BucketName
=head1 DESCRIPTION
The S3 bucket name and key where code signing saved your signed code
image.
=head1 ATTRIBUTES
=head2 BucketName => Str
Name of the S3 bucket.
=head2 Key => Str
Key name that uniquely identifies a signed code image in your bucket.
=head1 SEE ALSO
This class forms part of L<Paws>, describing an object used in L<Paws::Signer>
=head1 BUGS and CONTRIBUTIONS
The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
=cut
| 23.909091 | 106 | 0.719899 |
edbd18a7c7df56e9fcf47988c9cd8e7469b41da0 | 16,881 | pl | Perl | library/thread_pool.pl | sailfishos-mirror/swipl | d715454d15f6a24c0ffddf6fc157a82ac5be9383 | [
"BSD-2-Clause"
] | 725 | 2015-01-01T07:07:49.000Z | 2022-03-29T10:35:31.000Z | library/thread_pool.pl | sailfishos-mirror/swipl | d715454d15f6a24c0ffddf6fc157a82ac5be9383 | [
"BSD-2-Clause"
] | 819 | 2015-01-17T21:18:52.000Z | 2022-03-31T17:35:57.000Z | library/thread_pool.pl | sailfishos-mirror/swipl | d715454d15f6a24c0ffddf6fc157a82ac5be9383 | [
"BSD-2-Clause"
] | 268 | 2015-01-07T04:18:55.000Z | 2022-03-30T06:15:31.000Z | /* Part of SWI-Prolog
Author: Jan Wielemaker
E-mail: [email protected]
WWW: http://www.swi-prolog.org
Copyright (c) 2008-2016, 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(thread_pool,
[ thread_pool_create/3, % +Pool, +Size, +Options
thread_pool_destroy/1, % +Pool
thread_create_in_pool/4, % +Pool, :Goal, -Id, +Options
current_thread_pool/1, % ?Pool
thread_pool_property/2 % ?Pool, ?Property
]).
:- autoload(library(debug),[debug/3]).
:- autoload(library(error),[must_be/2,type_error/2]).
:- autoload(library(lists),[member/2,delete/3]).
:- autoload(library(option),
[meta_options/3,select_option/4,merge_options/3,option/3]).
:- autoload(library(rbtrees),
[ rb_new/1,
rb_insert_new/4,
rb_delete/3,
rb_keys/2,
rb_lookup/3,
rb_update/4
]).
/** <module> Resource bounded thread management
The module library(thread_pool) manages threads in pools. A pool defines
properties of its member threads and the maximum number of threads that
can coexist in the pool. The call thread_create_in_pool/4 allocates a
thread in the pool, just like thread_create/3. If the pool is fully
allocated it can be asked to wait or raise an error.
The library has been designed to deal with server applications that
receive a variety of requests, such as HTTP servers. Simply starting a
thread for each request is a bit too simple minded for such servers:
* Creating many CPU intensive threads often leads to a slow-down
rather than a speedup.
* Creating many memory intensive threads may exhaust resources
* Tasks that require little CPU and memory but take long waiting
for external resources can run many threads.
Using this library, one can define a pool for each set of tasks with
comparable characteristics and create threads in this pool. Unlike the
worker-pool model, threads are not started immediately. Depending on the
design, both approaches can be attractive.
The library is implemented by means of a manager thread with the fixed
thread id =|__thread_pool_manager|=. All state is maintained in this
manager thread, which receives and processes requests to create and
destroy pools, create threads in a pool and handle messages from
terminated threads. Thread pools are _not_ saved in a saved state and
must therefore be recreated using the initialization/1 directive or
otherwise during startup of the application.
@see http_handler/3 and http_spawn/2.
*/
:- meta_predicate
thread_create_in_pool(+, 0, -, :).
:- predicate_options(thread_create_in_pool/4, 4,
[ wait(boolean),
pass_to(system:thread_create/3, 3)
]).
:- multifile
create_pool/1.
%! thread_pool_create(+Pool, +Size, +Options) is det.
%
% Create a pool of threads. A pool of threads is a declaration for
% creating threads with shared properties (stack sizes) and a
% limited number of threads. Threads are created using
% thread_create_in_pool/4. If all threads in the pool are in use,
% the behaviour depends on the =wait= option of
% thread_create_in_pool/4 and the =backlog= option described
% below. Options are passed to thread_create/3, except for
%
% * backlog(+MaxBackLog)
% Maximum number of requests that can be suspended. Default
% is =infinite=. Otherwise it must be a non-negative integer.
% Using backlog(0) will never delay thread creation for this
% pool.
%
% The pooling mechanism does _not_ interact with the =detached=
% state of a thread. Threads can be created both =detached= and
% normal and must be joined using thread_join/2 if they are not
% detached.
thread_pool_create(Name, Size, Options) :-
must_be(list, Options),
pool_manager(Manager),
thread_self(Me),
thread_send_message(Manager, create_pool(Name, Size, Options, Me)),
wait_reply.
%! thread_pool_destroy(+Name) is det.
%
% Destroy the thread pool named Name.
%
% @error existence_error(thread_pool, Name).
thread_pool_destroy(Name) :-
pool_manager(Manager),
thread_self(Me),
thread_send_message(Manager, destroy_pool(Name, Me)),
wait_reply.
%! current_thread_pool(?Name) is nondet.
%
% True if Name refers to a defined thread pool.
current_thread_pool(Name) :-
pool_manager(Manager),
thread_self(Me),
thread_send_message(Manager, current_pools(Me)),
wait_reply(Pools),
( atom(Name)
-> memberchk(Name, Pools)
; member(Name, Pools)
).
%! thread_pool_property(?Name, ?Property) is nondet.
%
% True if Property is a property of thread pool Name. Defined
% properties are:
%
% * options(Options)
% Thread creation options for this pool
% * free(Size)
% Number of free slots on this pool
% * size(Size)
% Total number of slots on this pool
% * members(ListOfIDs)
% ListOfIDs is the list or threads running in this pool
% * running(Running)
% Number of running threads in this pool
% * backlog(Size)
% Number of delayed thread creations on this pool
thread_pool_property(Name, Property) :-
current_thread_pool(Name),
pool_manager(Manager),
thread_self(Me),
thread_send_message(Manager, pool_properties(Me, Name, Property)),
wait_reply(Props),
( nonvar(Property)
-> memberchk(Property, Props)
; member(Property, Props)
).
%! thread_create_in_pool(+Pool, :Goal, -Id, +Options) is det.
%
% Create a thread in Pool. Options overrule default thread
% creation options associated to the pool. In addition, the
% following option is defined:
%
% * wait(+Boolean)
% If =true= (default) and the pool is full, wait until a
% member of the pool completes. If =false=, throw a
% resource_error.
%
% @error resource_error(threads_in_pool(Pool)) is raised if wait
% is =false= or the backlog limit has been reached.
% @error existence_error(thread_pool, Pool) if Pool does not
% exist.
thread_create_in_pool(Pool, Goal, Id, QOptions) :-
meta_options(is_meta, QOptions, Options),
catch(thread_create_in_pool_(Pool, Goal, Id, Options),
Error, true),
( var(Error)
-> true
; Error = error(existence_error(thread_pool, Pool), _),
create_pool_lazily(Pool)
-> thread_create_in_pool_(Pool, Goal, Id, Options)
; throw(Error)
).
thread_create_in_pool_(Pool, Goal, Id, Options) :-
select_option(wait(Wait), Options, ThreadOptions, true),
pool_manager(Manager),
thread_self(Me),
thread_send_message(Manager,
create(Pool, Goal, Me, Wait, Id, ThreadOptions)),
wait_reply(Id).
is_meta(at_exit).
%! create_pool_lazily(+Pool) is semidet.
%
% Call the hook create_pool/1 to create the pool lazily.
create_pool_lazily(Pool) :-
with_mutex(Pool,
( mutex_destroy(Pool),
create_pool_sync(Pool)
)).
create_pool_sync(Pool) :-
current_thread_pool(Pool),
!.
create_pool_sync(Pool) :-
create_pool(Pool).
/*******************************
* START MANAGER *
*******************************/
%! pool_manager(-ThreadID) is det.
%
% ThreadID is the thread (alias) identifier of the manager. Starts
% the manager if it is not running.
pool_manager(TID) :-
TID = '__thread_pool_manager',
( thread_running(TID)
-> true
; with_mutex('__thread_pool', create_pool_manager(TID))
).
thread_running(Thread) :-
catch(thread_property(Thread, status(Status)),
E, true),
( var(E)
-> ( Status == running
-> true
; thread_join(Thread, _),
print_message(warning, thread_pool(manager_died(Status))),
fail
)
; E = error(existence_error(thread, Thread), _)
-> fail
; throw(E)
).
create_pool_manager(Thread) :-
thread_running(Thread),
!.
create_pool_manager(Thread) :-
thread_create(pool_manager_main, _,
[ alias(Thread),
inherit_from(main)
]).
pool_manager_main :-
rb_new(State0),
manage_thread_pool(State0).
/*******************************
* MANAGER LOGIC *
*******************************/
%! manage_thread_pool(+State)
manage_thread_pool(State0) :-
thread_get_message(Message),
( update_thread_pool(Message, State0, State)
-> debug(thread_pool(state), 'Message ~p --> ~p', [Message, State]),
manage_thread_pool(State)
; format(user_error, 'Update failed: ~p~n', [Message])
).
update_thread_pool(create_pool(Name, Size, Options, For), State0, State) :-
!,
( rb_insert_new(State0,
Name, tpool(Options, Size, Size, WP, WP, []),
State)
-> thread_send_message(For, thread_pool(true))
; reply_error(For, permission_error(create, thread_pool, Name)),
State = State0
).
update_thread_pool(destroy_pool(Name, For), State0, State) :-
!,
( rb_delete(State0, Name, State)
-> thread_send_message(For, thread_pool(true))
; reply_error(For, existence_error(thread_pool, Name)),
State = State0
).
update_thread_pool(current_pools(For), State, State) :-
!,
rb_keys(State, Keys),
debug(thread_pool(current), 'Reply to ~w: ~p', [For, Keys]),
reply(For, Keys).
update_thread_pool(pool_properties(For, Name, P), State, State) :-
!,
( rb_lookup(Name, Pool, State)
-> findall(P, pool_property(P, Pool), List),
reply(For, List)
; reply_error(For, existence_error(thread_pool, Name))
).
update_thread_pool(Message, State0, State) :-
arg(1, Message, Name),
( rb_lookup(Name, Pool0, State0)
-> update_pool(Message, Pool0, Pool),
rb_update(State0, Name, Pool, State)
; State = State0,
( Message = create(Name, _, For, _, _, _)
-> reply_error(For, existence_error(thread_pool, Name))
; true
)
).
pool_property(options(Options),
tpool(Options, _Free, _Size, _WP, _WPT, _Members)).
pool_property(backlog(Size),
tpool(_, _Free, _Size, WP, WPT, _Members)) :-
diff_list_length(WP, WPT, Size).
pool_property(free(Free),
tpool(_, Free, _Size, _, _, _)).
pool_property(size(Size),
tpool(_, _Free, Size, _, _, _)).
pool_property(running(Count),
tpool(_, Free, Size, _, _, _)) :-
Count is Size - Free.
pool_property(members(IDList),
tpool(_, _, _, _, _, IDList)).
diff_list_length(List, Tail, Size) :-
'$skip_list'(Length, List, Rest),
( Rest == Tail
-> Size = Length
; type_error(difference_list, List/Tail)
).
%! update_pool(+Message, +Pool0, -Pool) is det.
%
% Deal with create requests and completion messages on a given
% pool. There are two messages:
%
% * create(PoolName, Goal, ForThread, Wait, Id, Options)
% Create a new thread on behalf of ForThread. There are
% two cases:
% * Free slots: create the thread
% * No free slots: error or add to waiting
% * exitted(PoolName, Thread)
% A thread completed. If there is a request waiting,
% create a new one.
update_pool(create(Name, Goal, For, _, Id, MyOptions),
tpool(Options, Free0, Size, WP, WPT, Members0),
tpool(Options, Free, Size, WP, WPT, Members)) :-
succ(Free, Free0),
!,
merge_options(MyOptions, Options, ThreadOptions),
select_option(at_exit(AtExit), ThreadOptions, ThreadOptions1, true),
catch(thread_create(Goal, Id,
[ at_exit(worker_exitted(Name, Id, AtExit))
| ThreadOptions1
]),
E, true),
( var(E)
-> Members = [Id|Members0],
reply(For, Id)
; reply_error(For, E),
Members = Members0
).
update_pool(Create,
tpool(Options, 0, Size, WP, WPT0, Members),
tpool(Options, 0, Size, WP, WPT, Members)) :-
Create = create(Name, _Goal, For, Wait, _, _Options),
!,
option(backlog(BackLog), Options, infinite),
( can_delay(Wait, BackLog, WP, WPT0)
-> WPT0 = [Create|WPT],
debug(thread_pool, 'Delaying ~p', [Create])
; WPT = WPT0,
reply_error(For, resource_error(threads_in_pool(Name)))
).
update_pool(exitted(_Name, Id),
tpool(Options, Free0, Size, WP0, WPT, Members0),
Pool) :-
succ(Free0, Free),
delete(Members0, Id, Members1),
Pool1 = tpool(Options, Free, Size, WP, WPT, Members1),
( WP0 == WPT
-> WP = WP0,
Pool = Pool1
; WP0 = [Waiting|WP],
debug(thread_pool, 'Start delayed ~p', [Waiting]),
update_pool(Waiting, Pool1, Pool)
).
can_delay(true, infinite, _, _) :- !.
can_delay(true, BackLog, WP, WPT) :-
diff_list_length(WP, WPT, Size),
BackLog > Size.
%! worker_exitted(+PoolName, +WorkerId, :AtExit)
%
% It is possible that '__thread_pool_manager' no longer exists
% while closing down the process because the manager was killed
% before the worker.
%
% @tbd Find a way to discover that we are terminating Prolog.
:- public
worker_exitted/3.
worker_exitted(Name, Id, AtExit) :-
catch(thread_send_message('__thread_pool_manager', exitted(Name, Id)),
_, true),
call(AtExit).
/*******************************
* UTIL *
*******************************/
reply(To, Term) :-
thread_send_message(To, thread_pool(true(Term))).
reply_error(To, Error) :-
thread_send_message(To, thread_pool(error(Error, _))).
wait_reply :-
thread_get_message(thread_pool(Result)),
( Result == true
-> true
; Result == fail
-> fail
; throw(Result)
).
wait_reply(Value) :-
thread_get_message(thread_pool(Reply)),
( Reply = true(Value0)
-> Value = Value0
; Reply == fail
-> fail
; throw(Reply)
).
/*******************************
* HOOKS *
*******************************/
%! create_pool(+PoolName) is semidet.
%
% Hook to create a thread pool lazily. The hook is called if
% thread_create_in_pool/4 discovers that the thread pool does not
% exist. If the hook succeeds, thread_create_in_pool/4 retries
% creating the thread. For example, we can use the following
% declaration to create threads in the pool =media=, which holds a
% maximum of 20 threads.
%
% ==
% :- multifile thread_pool:create_pool/1.
%
% thread_pool:create_pool(media) :-
% thread_pool_create(media, 20, []).
% ==
/*******************************
* MESSAGES *
*******************************/
:- multifile
prolog:message/3.
prolog:message(thread_pool(Message)) -->
message(Message).
message(manager_died(Status)) -->
[ 'Thread-pool: manager died on status ~p; restarting'-[Status] ].
| 33.165029 | 75 | 0.620105 |
ed9624e85bda59ffe656bdd870259dd53bca23fa | 2,328 | pm | Perl | src/Unicode/data/perl_source/xad.pm | underkaos/php-sepa-xml-generator | 32635999830c09641924e6911a9f5a0259c9eae3 | [
"MIT"
] | 50 | 2015-01-09T15:02:22.000Z | 2022-03-07T14:30:56.000Z | src/Unicode/data/perl_source/xad.pm | underkaos/php-sepa-xml-generator | 32635999830c09641924e6911a9f5a0259c9eae3 | [
"MIT"
] | 15 | 2015-01-09T13:24:20.000Z | 2019-09-24T10:06:14.000Z | src/Unicode/data/perl_source/xad.pm | underkaos/php-sepa-xml-generator | 32635999830c09641924e6911a9f5a0259c9eae3 | [
"MIT"
] | 33 | 2015-02-06T21:40:04.000Z | 2022-01-25T20:37:38.000Z | # Time-stamp: "Sat Jul 14 00:27:37 2001 by Automatic Bizooty (__blocks2pm.plx)"
$Text::\SEPA\Unicode\Unidecode::Char[0xad] = [
'gwan', 'gwanj', 'gwanh', 'gwad', 'gwal', 'gwalg', 'gwalm', 'gwalb', 'gwals', 'gwalt', 'gwalp', 'gwalh', 'gwam', 'gwab', 'gwabs', 'gwas',
'gwass', 'gwang', 'gwaj', 'gwac', 'gwak', 'gwat', 'gwap', 'gwah', 'gwae', 'gwaeg', 'gwaegg', 'gwaegs', 'gwaen', 'gwaenj', 'gwaenh', 'gwaed',
'gwael', 'gwaelg', 'gwaelm', 'gwaelb', 'gwaels', 'gwaelt', 'gwaelp', 'gwaelh', 'gwaem', 'gwaeb', 'gwaebs', 'gwaes', 'gwaess', 'gwaeng', 'gwaej', 'gwaec',
'gwaek', 'gwaet', 'gwaep', 'gwaeh', 'goe', 'goeg', 'goegg', 'goegs', 'goen', 'goenj', 'goenh', 'goed', 'goel', 'goelg', 'goelm', 'goelb',
'goels', 'goelt', 'goelp', 'goelh', 'goem', 'goeb', 'goebs', 'goes', 'goess', 'goeng', 'goej', 'goec', 'goek', 'goet', 'goep', 'goeh',
'gyo', 'gyog', 'gyogg', 'gyogs', 'gyon', 'gyonj', 'gyonh', 'gyod', 'gyol', 'gyolg', 'gyolm', 'gyolb', 'gyols', 'gyolt', 'gyolp', 'gyolh',
'gyom', 'gyob', 'gyobs', 'gyos', 'gyoss', 'gyong', 'gyoj', 'gyoc', 'gyok', 'gyot', 'gyop', 'gyoh', 'gu', 'gug', 'gugg', 'gugs',
'gun', 'gunj', 'gunh', 'gud', 'gul', 'gulg', 'gulm', 'gulb', 'guls', 'gult', 'gulp', 'gulh', 'gum', 'gub', 'gubs', 'gus',
'guss', 'gung', 'guj', 'guc', 'guk', 'gut', 'gup', 'guh', 'gweo', 'gweog', 'gweogg', 'gweogs', 'gweon', 'gweonj', 'gweonh', 'gweod',
'gweol', 'gweolg', 'gweolm', 'gweolb', 'gweols', 'gweolt', 'gweolp', 'gweolh', 'gweom', 'gweob', 'gweobs', 'gweos', 'gweoss', 'gweong', 'gweoj', 'gweoc',
'gweok', 'gweot', 'gweop', 'gweoh', 'gwe', 'gweg', 'gwegg', 'gwegs', 'gwen', 'gwenj', 'gwenh', 'gwed', 'gwel', 'gwelg', 'gwelm', 'gwelb',
'gwels', 'gwelt', 'gwelp', 'gwelh', 'gwem', 'gweb', 'gwebs', 'gwes', 'gwess', 'gweng', 'gwej', 'gwec', 'gwek', 'gwet', 'gwep', 'gweh',
'gwi', 'gwig', 'gwigg', 'gwigs', 'gwin', 'gwinj', 'gwinh', 'gwid', 'gwil', 'gwilg', 'gwilm', 'gwilb', 'gwils', 'gwilt', 'gwilp', 'gwilh',
'gwim', 'gwib', 'gwibs', 'gwis', 'gwiss', 'gwing', 'gwij', 'gwic', 'gwik', 'gwit', 'gwip', 'gwih', 'gyu', 'gyug', 'gyugg', 'gyugs',
'gyun', 'gyunj', 'gyunh', 'gyud', 'gyul', 'gyulg', 'gyulm', 'gyulb', 'gyuls', 'gyult', 'gyulp', 'gyulh', 'gyum', 'gyub', 'gyubs', 'gyus',
'gyuss', 'gyung', 'gyuj', 'gyuc', 'gyuk', 'gyut', 'gyup', 'gyuh', 'geu', 'geug', 'geugg', 'geugs', 'geun', 'geunj', 'geunh', 'geud',
];
1;
| 110.857143 | 153 | 0.542526 |
edcafd7a2e66836fad171f18eebcaefe5a6bcc78 | 7,156 | pm | Perl | centreon/common/jvm/mode/memory.pm | petneli/centreon-plugins | d131e60a1859fdd0e959623de56e6e7512c669af | [
"Apache-2.0"
] | null | null | null | centreon/common/jvm/mode/memory.pm | petneli/centreon-plugins | d131e60a1859fdd0e959623de56e6e7512c669af | [
"Apache-2.0"
] | null | null | null | centreon/common/jvm/mode/memory.pm | petneli/centreon-plugins | d131e60a1859fdd0e959623de56e6e7512c669af | [
"Apache-2.0"
] | null | null | null | #
# 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 centreon::common::jvm::mode::memory;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'heap', type => 0 },
{ name => 'nonheap', type => 0 },
];
$self->{maps_counters}->{heap} = [
{ label => 'heap', set => {
key_values => [ { name => 'used' }, { name => 'max' }, { name => 'label' } ],
closure_custom_calc => $self->can('custom_usage_calc'),
closure_custom_output => $self->can('custom_usage_output'),
closure_custom_perfdata => $self->can('custom_usage_perfdata'),
closure_custom_threshold_check => $self->can('custom_usage_threshold'),
}
},
];
$self->{maps_counters}->{nonheap} = [
{ label => 'nonheap', set => {
key_values => [ { name => 'used' }, { name => 'max' }, { name => 'label' } ],
closure_custom_calc => $self->can('custom_usage_calc'),
closure_custom_output => $self->can('custom_usage_output'),
closure_custom_perfdata => $self->can('custom_usage_perfdata'),
closure_custom_threshold_check => $self->can('custom_usage_threshold'),
}
},
];
}
sub custom_usage_perfdata {
my ($self, %options) = @_;
my $use_th = 1;
$use_th = 0 if ($self->{instance_mode}->{option_results}->{units} eq '%' && $self->{result_values}->{max} <= 0);
my $value_perf = $self->{result_values}->{used};
my %total_options = ();
if ($self->{instance_mode}->{option_results}->{units} eq '%' && $self->{result_values}->{max} > 0) {
$total_options{total} = $self->{result_values}->{max};
$total_options{cast_int} = 1;
}
$self->{output}->perfdata_add(label => $self->{result_values}->{label}, unit => 'B',
value => $value_perf,
warning => $use_th == 1 ? $self->{perfdata}->get_perfdata_for_output(label => 'warning-' . $self->{label}, %total_options) : undef,
critical => $use_th == 1 ? $self->{perfdata}->get_perfdata_for_output(label => 'critical-' . $self->{label}, %total_options) : undef,
min => 0, max => $self->{result_values}->{max} > 0 ? $self->{result_values}->{max} : undef);
}
sub custom_usage_threshold {
my ($self, %options) = @_;
# Cannot use percent without total
return 'ok' if ($self->{result_values}->{max} <= 0 && $self->{instance_mode}->{option_results}->{units} eq '%');
my ($exit, $threshold_value);
$threshold_value = $self->{result_values}->{used};
if ($self->{instance_mode}->{option_results}->{units} eq '%') {
$threshold_value = $self->{result_values}->{prct_used};
}
$exit = $self->{perfdata}->threshold_check(value => $threshold_value, threshold => [ { label => 'critical-' . $self->{label}, exit_litteral => 'critical' }, { label => 'warning-'. $self->{label}, exit_litteral => 'warning' } ]);
return $exit;
}
sub custom_usage_output {
my ($self, %options) = @_;
my $msg;
my ($total_used_value, $total_used_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{used});
if ($self->{result_values}->{max} > 0) {
my ($total_size_value, $total_size_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{max});
my ($total_free_value, $total_free_unit) = $self->{perfdata}->change_bytes(value => $self->{result_values}->{max} - $self->{result_values}->{used});
$msg = sprintf("%s Total: %s Used: %s (%.2f%%) Free: %s (%.2f%%)", $self->{result_values}->{label},
$total_size_value . " " . $total_size_unit,
$total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used},
$total_free_value . " " . $total_free_unit, 100 - $self->{result_values}->{prct_used});
} else {
$msg = sprintf("%s Used: %s", $self->{result_values}->{label},
$total_used_value . " " . $total_used_unit, $self->{result_values}->{prct_used});
}
return $msg;
}
sub custom_usage_calc {
my ($self, %options) = @_;
$self->{result_values}->{label} = $options{new_datas}->{$self->{label} . '_label'};
$self->{result_values}->{max} = $options{new_datas}->{$self->{instance} . '_max'};
$self->{result_values}->{used} = $options{new_datas}->{$self->{instance} . '_used'};
if ($self->{result_values}->{max} > 0) {
$self->{result_values}->{prct_used} = $self->{result_values}->{used} * 100 / $self->{result_values}->{max};
}
return 0;
}
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$options{options}->add_options(arguments => {
"units:s" => { name => 'units', default => '%' },
});
return $self;
}
sub manage_selection {
my ($self, %options) = @_;
$self->{request} = [
{ mbean => "java.lang:type=Memory" }
];
my $result = $options{custom}->get_attributes(request => $self->{request}, nothing_quit => 1);
$self->{heap} = { label => 'HeapMemory', used => $result->{"java.lang:type=Memory"}->{HeapMemoryUsage}->{used}, max => $result->{"java.lang:type=Memory"}->{HeapMemoryUsage}->{max} };
$self->{nonheap} = { label => 'NonHeapMemoryUsage', used => $result->{"java.lang:type=Memory"}->{NonHeapMemoryUsage}->{used}, max => $result->{"java.lang:type=Memory"}->{NonHeapMemoryUsage}->{max} };
}
1;
__END__
=head1 MODE
Check Java Heap and NonHeap Memory usage (Mbean java.lang:type=Memory).
Example:
perl centreon_plugins.pl --plugin=apps::tomcat::jmx::plugin --custommode=jolokia --url=http://10.30.2.22:8080/jolokia-war --mode=memory --warning-heap 60 --critical-heap 75 --warning-nonheap 65 --critical-nonheap 75
=over 8
=item B<--warning-heap>
Threshold warning of Heap memory usage
=item B<--critical-heap>
Threshold critical of Heap memory usage
=item B<--warning-nonheap>
Threshold warning of NonHeap memory usage
=item B<--critical-nonheap>
Threshold critical of NonHeap memory usage
=item B<--units>
Units of thresholds (Default: '%') ('%', 'B').
=back
=cut
| 38.26738 | 232 | 0.596423 |
edbc92038a167423fd56766f88d01e222673eedc | 1,687 | pl | Perl | examples/chat80/load.pl | GunterMueller/ALSProlog | 7707b94a768cd7c02f0c8767898f3de8f4a1d746 | [
"MIT"
] | 14 | 2015-10-18T00:55:02.000Z | 2022-03-12T08:10:18.000Z | examples/chat80/load.pl | GunterMueller/ALSProlog | 7707b94a768cd7c02f0c8767898f3de8f4a1d746 | [
"MIT"
] | 138 | 2015-10-30T20:38:14.000Z | 2021-08-23T12:43:32.000Z | examples/chat80/load.pl | AppliedLogicSystems/ALSProlog | 2e3dbed5112be75a72882a4714d8f4d6a0fc9a04 | [
"MIT"
] | 6 | 2015-11-06T03:44:46.000Z | 2022-03-14T10:36:50.000Z | % load.pl : Load Chat-80, for Quintus Prolog
/*
_________________________________________________________________________
| Copyright (C) 1982 |
| |
| David Warren, |
| SRI International, 333 Ravenswood Ave., Menlo Park, |
| California 94025, USA; |
| |
| Fernando Pereira, |
| Dept. of Architecture, University of Edinburgh, |
| 20 Chambers St., Edinburgh EH1 1JZ, Scotland |
| |
| This program may be used, copied, altered or included in other |
| programs only for academic purposes and provided that the |
| authorship of the initial program is aknowledged. |
| Use for commercial purposes without the previous written |
| agreement of the authors is forbidden. |
|_________________________________________________________________________|
*/
:- ensure_loaded(als_chat). % misc
:- ensure_loaded(xgrun). % XG runtimes
:- ensure_loaded(newg). % clone + lex
:- ensure_loaded(clotab). % attachment tables
:- ensure_loaded(newdict). % syntactic dictionary
:- ensure_loaded(slots). % fits arguments into predicates
:- ensure_loaded(scopes). % quantification and scoping
:- ensure_loaded(templa). % semantic dictionary
:- ensure_loaded(qplan). % query planning
:- ensure_loaded(talkr). % query evaluation
:- ensure_loaded(ndtabl). % relation info.
:- ensure_loaded(readin). % sentence input
:- ensure_loaded(ptree). % print trees
:- ensure_loaded(aggreg). % aggregation operators
:- ensure_loaded(world0). % data base
:- ensure_loaded(rivers).
:- ensure_loaded(cities).
:- ensure_loaded(countries).
:- ensure_loaded(contain).
:- ensure_loaded(borders).
:- ensure_loaded(newtop). % top level
| 34.428571 | 75 | 0.710136 |
edc6a783e81e78c32623059ad86829d5c2df2b8c | 4,465 | pm | Perl | lib/Neo4j/Bolt/Cxn.pm | majensen/perlbolt | 86a2658e36a84001c0a1f1321fd0c04d6e1e8b0e | [
"Apache-2.0"
] | 4 | 2020-02-23T04:38:29.000Z | 2022-01-10T03:05:28.000Z | lib/Neo4j/Bolt/Cxn.pm | majensen/perlbolt | 86a2658e36a84001c0a1f1321fd0c04d6e1e8b0e | [
"Apache-2.0"
] | 43 | 2019-01-11T21:18:44.000Z | 2022-03-21T22:51:28.000Z | lib/Neo4j/Bolt/Cxn.pm | majensen/perlbolt | 86a2658e36a84001c0a1f1321fd0c04d6e1e8b0e | [
"Apache-2.0"
] | 2 | 2019-01-11T19:33:11.000Z | 2021-09-07T17:36:00.000Z | package Neo4j::Bolt::Cxn;
use Carp qw/croak/;
BEGIN {
our $VERSION = "0.4203";
require Neo4j::Bolt::CTypeHandlers;
require Neo4j::Bolt::ResultStream;
require XSLoader;
XSLoader::load();
}
sub default_db () { $Neo4j::Bolt::DEFAULT_DB // "" }
sub errnum { shift->errnum_ }
sub errmsg { shift->errmsg_ }
sub reset_cxn { shift->reset_ }
sub server_id { shift->server_id_ }
sub protocol_version { shift->protocol_version_ }
sub run_query {
my $self = shift;
my ($query, $parms, $db) = @_;
unless ($query) {
croak "Arg 1 should be Cypher query string";
}
if ($parms && !(ref $parms == 'HASH')) {
croak "Arg 2 should be a hashref of { param => $value, ... }";
}
croak "No connection" unless $self->connected;
utf8::upgrade($query);
return $self->run_query_($query, $parms // {}, 0, $db // default_db);
}
sub send_query {
my $self = shift;
my ($query, $parms) = @_;
unless ($query) {
croak "Arg 1 should be Cypher query string";
}
if ($parms && !(ref $parms == 'HASH')) {
croak "Arg 2 should be a hashref of { param => $value, ... }";
}
croak "No connection" unless $self->connected;
utf8::upgrade($query);
return $self->run_query_($query, $parms ? $parms : {}, 1, $db // default_db );
}
sub do_query {
my $self = shift;
my $stream = $self->run_query(@_);
my @results;
if ($stream->success_) {
while (my @row = $stream->fetch_next_) {
push @results, [@row];
}
}
return wantarray ? ($stream, @results) : $stream;
}
=head1 NAME
Neo4j::Bolt::Cxn - Container for a Neo4j Bolt connection
=head1 SYNOPSIS
use Neo4j::Bolt;
$cxn = Neo4j::Bolt->connect("bolt://localhost:7687");
unless ($cxn->connected) {
die "Problem connecting: ".$cxn->errmsg;
}
$stream = $cxn->run_query(
"MATCH (a) RETURN head(labels(a)) as lbl, count(a) as ct",
);
if ($stream->failure) {
print STDERR "Problem with query run: ".
($stream->client_errmsg || $stream->server_errmsg);
}
=head1 DESCRIPTION
L<Neo4j::Bolt::Cxn> is a container for a Bolt connection, instantiated by
a call to C<< Neo4j::Bolt->connect() >>.
=head1 METHODS
=over
=item connected()
True if server connected successfully. If not, see L</"errnum()"> and
L</"errmsg()">.
=item protocol_version()
Returns a string representing the major and minor Bolt protocol version of the
server, as "<major>.<minor>", or the empty string if not connected.
=item run_query($cypher_query, [$param_hash])
Run a L<Cypher|https://neo4j.com/docs/cypher-manual/current/> query on
the server. Returns a L<Neo4j::Bolt::ResultStream> which can be iterated
to retrieve query results as Perl types and structures. [$param_hash]
is an optional hashref of the form C<{ param =E<gt> $value, ... }>.
=item send_query($cypher_query, [$param_hash])
Send a L<Cypher|https://neo4j.com/docs/cypher-manual/current/> query to
the server. All results (except error info) are discarded.
=item do_query($cypher_query, [$param_hash])
($stream, @rows) = do_query($cypher_query);
$stream = do_query($cypher_query, $param_hash);
Run a L<Cypher|https://neo4j.com/docs/cypher-manual/current/> query on
the server, and iterate the stream to retrieve all result
rows. C<do_query> is convenient for running write queries (e.g.,
C<CREATE (a:Bloog {prop1:"blarg"})> ), since it returns the $stream
with L<Neo4j::Bolt::ResultStream/update_counts> ready for reading.
=item reset_cxn()
Send a RESET message to the Neo4j server. According to the L<Bolt
protocol|https://boltprotocol.org/v1/>, this should force any currently
processing query to abort, forget any pending queries, clear any
failure state, dispose of outstanding result records, and roll back
the current transaction.
=item errnum(), errmsg()
Current error state of the connection. If
$cxn->connected == $cxn->errnum == 0
then you have a virgin Cxn object that came from someplace other than
C<< Neo4j::Bolt->connect() >>, which would be weird.
=item server_id()
print $cxn->server_id; # "Neo4j/3.3.9"
Get the server ID string, including the version number. C<undef> if
connecting wasn't successful or the server didn't identify itself.
=back
=head1 SEE ALSO
L<Neo4j::Bolt>, L<Neo4j::Bolt::ResultStream>.
=head1 AUTHOR
Mark A. Jensen
CPAN: MAJENSEN
majensen -at- cpan -dot- org
=head1 LICENSE
This software is Copyright (c) 2019-2021 by Mark A. Jensen.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
=cut
1;
| 26.577381 | 80 | 0.684882 |
edb06ff8656b566767eb26ad362c3e87c3e83c41 | 922 | t | Perl | t/schema_validation.t | FAANG/sra_xml | 85bafd2dd2631685d6b4cb03afaafe665af60d8d | [
"Apache-2.0"
] | null | null | null | t/schema_validation.t | FAANG/sra_xml | 85bafd2dd2631685d6b4cb03afaafe665af60d8d | [
"Apache-2.0"
] | null | null | null | t/schema_validation.t | FAANG/sra_xml | 85bafd2dd2631685d6b4cb03afaafe665af60d8d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env perl
use strict;
use FindBin qw($Bin);
use lib ( "$Bin/../lib", "$Bin/lib" );
use Bio::SRAXml;
use Test::More;
use Test::Exception;
my $test_dir = "$Bin/xml_files";
throws_ok {
Bio::SRAXml::validate_against_schema(
filename => "$test_dir/non_existent_file.xml" );
}
qr/No such file or directory/, 'Validator rejects non-existent file';
lives_ok {
Bio::SRAXml::validate_against_schema(
filename => "$test_dir/ERZ000001.xml" );
}
'Validator accepts file from ENA';
throws_ok {
Bio::SRAXml::validate_against_schema(
filename => "$test_dir/not_actually.xml" );
}
qr/Start tag expected/, 'Validator rejects non-xml file';
throws_ok {
Bio::SRAXml::validate_against_schema(
filename => "$test_dir/slightly_broken.xml" );
}
qr/Schemas validity error : Element 'BROKEN_TITLE_ELEMENT'/,
'Validator rejects xml file with element not in schema';
done_testing();
| 24.263158 | 69 | 0.693059 |
edc42e4258e0d9bdab48ba785344be6ee1aca182 | 1,282 | pm | Perl | tests/modules/utils.pm | khongsomeo/GPA-OOP | 6605ad08d5c963bbbf0d7e1a235cd924df110bf1 | [
"MIT"
] | null | null | null | tests/modules/utils.pm | khongsomeo/GPA-OOP | 6605ad08d5c963bbbf0d7e1a235cd924df110bf1 | [
"MIT"
] | 9 | 2022-01-27T19:06:11.000Z | 2022-02-13T11:05:28.000Z | tests/modules/utils.pm | khongsomeo/GPA-OOP | 6605ad08d5c963bbbf0d7e1a235cd924df110bf1 | [
"MIT"
] | 4 | 2022-01-27T02:02:08.000Z | 2022-01-30T15:01:59.000Z | #!/usr/bin/perl
use strict;
use warnings;
package utils;
# Using ANSI color code to replace Term::ANSIColor.
sub colored {
(my $string, my $color) = ($_[0], $_[1]);
(my $color_ansi, my $no_color) = (qq(), qq(\033[0m));
if ($color eq qq(red)) {
$color_ansi = qq(\033[91m);
}
elsif ($color eq qq(green)) {
$color_ansi = qq(\033[92m);
}
elsif ($color eq qq(yellow)) {
$color_ansi = qq(\033[93m);
}
elsif ($color eq qq(blue)) {
$color_ansi = qq(\033[96m);
}
else {
$color_ansi = $no_color;
}
$string = $color_ansi . $string . $no_color;
return $string;
}
# Counting files inside a directory (exclude . and ..)
# Stolen from https://www.perlmonks.org/?node_id=606767
sub count_files {
my $dir = $_[0];
opendir D, $dir or die $!;
return scalar grep { ! m{^\.\.?$} } readdir D;
}
# Get a file content
sub get_file_content {
my $file = $_[0];
open my $fh, qq(<), $file or die qq(Cannot open file $file: $!);
read $fh, my $file_content, -s $fh;
close $fh;
return $file_content;
}
# Execute a payload, and return stdout.
sub execute_payload {
my $payload_file = $_[0];
my $payload_content = get_file_content($payload_file);
my $runtime_output = qx{$payload_content};
return $runtime_output;
}
1;
| 17.324324 | 66 | 0.612324 |
ed504df8641b8125b6254f613f0ef7f3095b6273 | 1,249 | pm | Perl | auto-lib/Paws/CloudWatchLogs/FilterLogEventsResponse.pm | cah-rfelsburg/paws | de9ffb8d49627635a2da588066df26f852af37e4 | [
"Apache-2.0"
] | 2 | 2016-09-22T09:18:33.000Z | 2017-06-20T01:36:58.000Z | auto-lib/Paws/CloudWatchLogs/FilterLogEventsResponse.pm | cah-rfelsburg/paws | de9ffb8d49627635a2da588066df26f852af37e4 | [
"Apache-2.0"
] | null | null | null | auto-lib/Paws/CloudWatchLogs/FilterLogEventsResponse.pm | cah-rfelsburg/paws | de9ffb8d49627635a2da588066df26f852af37e4 | [
"Apache-2.0"
] | null | null | null |
package Paws::CloudWatchLogs::FilterLogEventsResponse;
use Moose;
has Events => (is => 'ro', isa => 'ArrayRef[Paws::CloudWatchLogs::FilteredLogEvent]', traits => ['Unwrapped'], xmlname => 'events' );
has NextToken => (is => 'ro', isa => 'Str', traits => ['Unwrapped'], xmlname => 'nextToken' );
has SearchedLogStreams => (is => 'ro', isa => 'ArrayRef[Paws::CloudWatchLogs::SearchedLogStream]', traits => ['Unwrapped'], xmlname => 'searchedLogStreams' );
### main pod documentation begin ###
=head1 NAME
Paws::CloudWatchLogs::FilterLogEventsResponse
=head1 ATTRIBUTES
=head2 Events => ArrayRef[L<Paws::CloudWatchLogs::FilteredLogEvent>]
A list of C<FilteredLogEvent> objects representing the matched events
from the request.
=head2 NextToken => Str
A pagination token obtained from a C<FilterLogEvents> response to
continue paginating the FilterLogEvents results. This token is omitted
from the response when there are no other events to display.
=head2 SearchedLogStreams => ArrayRef[L<Paws::CloudWatchLogs::SearchedLogStream>]
A list of C<SearchedLogStream> objects indicating which log streams
have been searched in this request and whether each has been searched
completely or still has more to be paginated.
=cut
1; | 28.386364 | 160 | 0.742994 |
edc7bcc3d5864ec598da243f9a11cd33d3e90f07 | 171 | pl | Perl | listings/plp-family-prolog.pl | gciatto-unibo/plp-aixia-2021-talk | 031ff67a8528465bc6da7338f35441d818c314ab | [
"LPPL-1.3c"
] | null | null | null | listings/plp-family-prolog.pl | gciatto-unibo/plp-aixia-2021-talk | 031ff67a8528465bc6da7338f35441d818c314ab | [
"LPPL-1.3c"
] | null | null | null | listings/plp-family-prolog.pl | gciatto-unibo/plp-aixia-2021-talk | 031ff67a8528465bc6da7338f35441d818c314ab | [
"LPPL-1.3c"
] | null | null | null | male(john). male(mike). female(anna). female(jane).
parent(mike, john). parent(mike, anna).
parent(mike, anna). parent(jane, anna).
father(X, Y) :- male(X), parent(X, Y).
| 34.2 | 51 | 0.660819 |
ed4066590b9b3236390c13310a6a993764584899 | 1,997 | t | Perl | test/tw-268.t | sheehamj13/task | 67ed9cadfcbccf1f1071fc1b04cde61a2aba2f69 | [
"MIT"
] | null | null | null | test/tw-268.t | sheehamj13/task | 67ed9cadfcbccf1f1071fc1b04cde61a2aba2f69 | [
"MIT"
] | null | null | null | test/tw-268.t | sheehamj13/task | 67ed9cadfcbccf1f1071fc1b04cde61a2aba2f69 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright 2006 - 2015, Paul Beckingham, Federico Hernandez.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
# http://www.opensource.org/licenses/mit-license.php
#
###############################################################################
import sys
import os
import unittest
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from basetest import Task, TestCase
class TestBug268(TestCase):
def setUp(self):
self.t = Task()
def test_add_hyphenated(self):
"""escaped backslashes do not work with 'modify'"""
self.t("add a b or c")
self.t('1 modify "/a b/a\/b/"')
code, out, err = self.t("1 info")
self.assertIn("a/b or c", out)
if __name__ == "__main__":
from simpletap import TAPTestRunner
unittest.main(testRunner=TAPTestRunner())
# vim: ai sts=4 et sw=4 ft=python
| 35.660714 | 79 | 0.667501 |
edbdd4640b4bd00ed63119303ecb4e7864c45031 | 18,673 | al | Perl | Apps/CZ/CoreLocalizationPack/app/Src/Pages/VIESDeclaration.Page.al | bjarkihall/ALAppExtensions | d8243d27e0280dec6e079ab9f1e838f9768c208c | [
"MIT"
] | 1 | 2021-08-16T18:14:49.000Z | 2021-08-16T18:14:49.000Z | Apps/CZ/CoreLocalizationPack/app/Src/Pages/VIESDeclaration.Page.al | bjarkihall/ALAppExtensions | d8243d27e0280dec6e079ab9f1e838f9768c208c | [
"MIT"
] | null | null | null | Apps/CZ/CoreLocalizationPack/app/Src/Pages/VIESDeclaration.Page.al | bjarkihall/ALAppExtensions | d8243d27e0280dec6e079ab9f1e838f9768c208c | [
"MIT"
] | 1 | 2021-02-09T10:23:09.000Z | 2021-02-09T10:23:09.000Z | page 31138 "VIES Declaration CZL"
{
Caption = 'VIES Declaration';
PageType = Document;
RefreshOnActivate = true;
SourceTable = "VIES Declaration Header CZL";
layout
{
area(content)
{
group(General)
{
Caption = 'General';
field("No."; Rec."No.")
{
ApplicationArea = All;
Importance = Promoted;
ToolTip = 'Specifies the number of the VIES Declaration.';
Visible = NoFieldVisible;
trigger OnAssistEdit()
begin
if Rec.AssistEdit(xRec) then
CurrPage.Update();
end;
}
field("Declaration Period"; Rec."Declaration Period")
{
ApplicationArea = Basic, Suite;
Importance = Promoted;
ToolTip = 'Specifies declaration Period (month, quarter).';
}
field("Declaration Type"; Rec."Declaration Type")
{
ApplicationArea = Basic, Suite;
Importance = Promoted;
ToolTip = 'Specifies type of VIES Declaration (Normal, Corrective, Corrective-Supplementary).';
trigger OnValidate()
begin
if xRec."Declaration Type" <> Rec."Declaration Type" then
if Rec."Declaration Type" <> Rec."Declaration Type"::Corrective then
Rec."Corrected Declaration No." := '';
SetControlsEditable();
end;
}
field("Corrected Declaration No."; Rec."Corrected Declaration No.")
{
ApplicationArea = Basic, Suite;
Editable = CorrectedDeclarationNoEditable;
ToolTip = 'Specifies the existing VIES declaration that needs to be corrected.';
}
field(Name; Rec.Name)
{
ApplicationArea = Basic, Suite;
Editable = NameEditable;
ToolTip = 'Specifies company name.';
}
field("VAT Registration No."; Rec."VAT Registration No.")
{
ApplicationArea = Basic, Suite;
Editable = VATRegNoEditable;
ShowMandatory = true;
ToolTip = 'Specifies company VAT Registration No.';
}
field("Tax Office Number"; Rec."Tax Office Number")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the tax office number for reporting.';
}
field("Tax Office Region Number"; Rec."Tax Office Region Number")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the tax office region number for reporting.';
}
field("Trade Type"; Rec."Trade Type")
{
ApplicationArea = Basic, Suite;
Editable = TradeTypeEditable;
ToolTip = 'Specifies trade type for VIES declaration.';
}
field("EU Goods/Services"; Rec."EU Goods/Services")
{
ApplicationArea = Basic, Suite;
Editable = EUGoodsServicesEditable;
ToolTip = 'Specifies goods, services, or both. The EU requires this information for VIES reporting.';
}
field("Company Trade Name Appendix"; Rec."Company Trade Name Appendix")
{
ApplicationArea = Basic, Suite;
Editable = CompanyTradeNameAppendixEditable;
ToolTip = 'Specifies type of the company.';
}
field("Document Date"; Rec."Document Date")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the date on which you created the document.';
}
field("Period No."; Rec."Period No.")
{
ApplicationArea = Basic, Suite;
BlankZero = true;
Editable = PeriodNoEditable;
Importance = Promoted;
ShowMandatory = true;
ToolTip = 'Specifies the VAT period.';
}
field(Year; Rec.Year)
{
ApplicationArea = Basic, Suite;
BlankZero = true;
Editable = YearEditable;
Importance = Promoted;
ShowMandatory = true;
ToolTip = 'Specifies the year of report.';
}
field("Start Date"; Rec."Start Date")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the declaration start date. The field is calculated based on the trade type, period no. and year fields.';
}
field("End Date"; Rec."End Date")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies end date for the declaration, which is calculated based of the values of the period no. and year fields.';
}
field("Amount (LCY)"; Rec."Amount (LCY)")
{
ApplicationArea = Basic, Suite;
DrillDown = false;
ToolTip = 'Specifies total amounts of all reported trades for selected period.';
}
field("Number of Supplies"; Rec."Number of Supplies")
{
ApplicationArea = Basic, Suite;
DrillDown = false;
ToolTip = 'Specifies number of all reported supplies for selected period.';
}
field(Status; Rec.Status)
{
ApplicationArea = Basic, Suite;
Editable = false;
Importance = Promoted;
ToolTip = 'Specifies the status of the declaration. The field will display either a status of open or released.';
}
field("Company Type"; Rec."Company Type")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies company type.';
trigger OnValidate()
begin
SetControlsEditable();
end;
}
}
part(Lines; "VIES Declaration Subform CZL")
{
ApplicationArea = Basic, Suite;
SubPageLink = "VIES Declaration No." = FIELD("No.");
UpdatePropagation = Both;
}
group(Address)
{
Caption = 'Address';
field("Country/Region Name"; Rec."Country/Region Name")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the country/region code.';
}
field(County; Rec.County)
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the country for the tax office.';
}
field("Post Code"; Rec."Post Code")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the postal code.';
}
field(City; Rec.City)
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the city for the tax office.';
}
field(Street; Rec.Street)
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the street for the tax office.';
}
field("House No."; Rec."House No.")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the company''s house number.';
}
field("Municipality No."; Rec."Municipality No.")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the municipality number fot the tax office that receives the VIES declaration.';
}
field("Apartment No."; Rec."Apartment No.")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies apartment number.';
}
}
group(Persons)
{
Caption = 'Persons';
field("Authorized Employee No."; Rec."Authorized Employee No.")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies authorized employee.';
}
field("Filled by Employee No."; Rec."Filled by Employee No.")
{
ApplicationArea = Basic, Suite;
Importance = Promoted;
ToolTip = 'Specifies the employee number for the employee who filled the declaration.';
}
field("Individual Employee No."; Rec."Individual Employee No.")
{
ApplicationArea = Basic, Suite;
Editable = IndividualEmployeeNoEditable;
ToolTip = 'Specifies employee number for the individual employee.';
}
}
}
}
actions
{
area(processing)
{
group("L&ines")
{
Caption = 'L&ines';
action("&Suggest Lines")
{
ApplicationArea = Basic, Suite;
Caption = '&Suggest Lines';
Ellipsis = true;
Image = SuggestLines;
Promoted = true;
PromotedCategory = Process;
PromotedOnly = true;
ToolTip = 'This batch job creates VIES declaration lines from declaration header information and data stored in VAT tables.';
trigger OnAction()
var
VIESDeclarationHeaderCZL: Record "VIES Declaration Header CZL";
begin
Rec.TestField(Status, Rec.Status::Open);
Rec.Testfield("Period No.");
Rec.TestField(Year);
VIESDeclarationHeaderCZL.SetRange("No.", Rec."No.");
Report.RunModal(Report::"Suggest VIES Declaration CZL", true, false, VIESDeclarationHeaderCZL);
end;
}
action("&Get Lines for Correction")
{
ApplicationArea = Basic, Suite;
Caption = '&Get Lines for Correction';
Ellipsis = true;
Image = GetLines;
Promoted = true;
PromotedCategory = Process;
PromotedOnly = true;
ToolTip = 'This batch job allows you get the lines for corrective VIES declaration.';
trigger OnAction()
var
VIESDeclarationLinesCZL: Page "VIES Declaration Lines CZL";
begin
Rec.TestField(Status, Rec.Status::Open);
Rec.TestField("Corrected Declaration No.");
VIESDeclarationLinesCZL.SetToDeclaration(Rec);
VIESDeclarationLinesCZL.LookupMode := true;
if VIESDeclarationLinesCZL.RunModal() = ACTION::LookupOK then
VIESDeclarationLinesCZL.CopyLineToDeclaration();
end;
}
}
group("F&unctions")
{
Caption = 'F&unctions';
action("Re&lease")
{
ApplicationArea = Basic, Suite;
Caption = 'Re&lease';
Image = ReleaseDoc;
Promoted = true;
PromotedCategory = Process;
PromotedOnly = true;
ShortCutKey = 'Ctrl+F9';
ToolTip = 'Release the document to the next stage of processing. When a document is released, it will be possible to print or export declaration. You must reopen the document before you can make changes to it.';
trigger OnAction()
begin
ReleaseVIESDeclarationCZL.Run(Rec);
end;
}
action("Re&open")
{
ApplicationArea = Basic, Suite;
Caption = 'Re&open';
Image = Replan;
Promoted = true;
PromotedCategory = Process;
PromotedOnly = true;
ToolTip = 'Reopen the document to change it after it has been approved. Approved documents have tha Released status and must be opened before they can be changed.';
trigger OnAction()
begin
ReleaseVIESDeclarationCZL.Reopen(Rec);
end;
}
action("&Export")
{
ApplicationArea = Basic, Suite;
Caption = '&Export';
Image = CreateXMLFile;
Promoted = true;
PromotedCategory = Process;
PromotedOnly = true;
ToolTip = 'This batch job is used for VIES declaration results export in XML format.';
trigger OnAction()
begin
Rec.Export();
end;
}
}
}
area(reporting)
{
action("Test Report")
{
ApplicationArea = Basic, Suite;
Caption = 'Test Report';
Ellipsis = true;
Image = TestReport;
Promoted = true;
PromotedCategory = "Report";
PromotedOnly = true;
ToolTip = 'View a test report so that you can find and correct any errors before you issue or export document.';
trigger OnAction()
begin
Rec.PrintTestReport();
end;
}
action("&Declaration")
{
ApplicationArea = Basic, Suite;
Caption = '&Declaration';
Image = Report;
Ellipsis = true;
Promoted = true;
PromotedCategory = "Report";
PromotedOnly = true;
ToolTip = 'View a VIES declaration report.';
trigger OnAction()
begin
Rec.Print();
end;
}
}
}
trigger OnAfterGetRecord()
begin
SetNoFieldVisible();
end;
trigger OnInit()
begin
IndividualEmployeeNoEditable := true;
CompanyTradeNameAppendixEditable := true;
EUGoodsServicesEditable := true;
TradeTypeEditable := true;
VATRegNoEditable := true;
NameEditable := true;
YearEditable := true;
PeriodNoEditable := true;
CorrectedDeclarationNoEditable := true;
end;
trigger OnOpenPage()
begin
SetNoFieldVisible();
end;
var
ReleaseVIESDeclarationCZL: Codeunit "Release VIES Declaration CZL";
DocumentNoVisibility: Codeunit DocumentNoVisibility;
[InDataSet]
CorrectedDeclarationNoEditable: Boolean;
[InDataSet]
PeriodNoEditable: Boolean;
[InDataSet]
YearEditable: Boolean;
[InDataSet]
NameEditable: Boolean;
[InDataSet]
VATRegNoEditable: Boolean;
[InDataSet]
TradeTypeEditable: Boolean;
[InDataSet]
EUGoodsServicesEditable: Boolean;
[InDataSet]
CompanyTradeNameAppendixEditable: Boolean;
[InDataSet]
IndividualEmployeeNoEditable: Boolean;
NoFieldVisible: Boolean;
local procedure SetControlsEditable()
var
Corrective: Boolean;
begin
Corrective := Rec."Declaration Type" in [Rec."Declaration Type"::Corrective, Rec."Declaration Type"::"Corrective-Supplementary"];
CorrectedDeclarationNoEditable := Corrective;
PeriodNoEditable := not Corrective;
YearEditable := not Corrective;
NameEditable := not Corrective;
VATRegNoEditable := not Corrective;
TradeTypeEditable := not Corrective;
EUGoodsServicesEditable := not Corrective;
case Rec."Company Type" of
Rec."Company Type"::Individual:
begin
NameEditable := false;
CompanyTradeNameAppendixEditable := false;
IndividualEmployeeNoEditable := true;
end;
Rec."Company Type"::Corporate:
begin
NameEditable := true;
CompanyTradeNameAppendixEditable := true;
IndividualEmployeeNoEditable := false;
end;
end;
end;
local procedure SetNoFieldVisible()
begin
if Rec."No." <> '' then
NoFieldVisible := false
else
NoFieldVisible := DocumentNoVisibility.ForceShowNoSeriesForDocNo(DetermineVIESDeclarationCZLSeriesNo());
end;
local procedure DetermineVIESDeclarationCZLSeriesNo(): Code[20]
var
StatutoryReportingSetupCZL: Record "Statutory Reporting Setup CZL";
VATCtrlReportHeaderCZL: Record "VAT Ctrl. Report Header CZL";
begin
StatutoryReportingSetupCZL.Get();
DocumentNoVisibility.CheckNumberSeries(VATCtrlReportHeaderCZL, StatutoryReportingSetupCZL."VIES Declaration Nos.", VATCtrlReportHeaderCZL.FieldNo("No."));
exit(StatutoryReportingSetupCZL."VIES Declaration Nos.");
end;
}
| 40.330454 | 231 | 0.477802 |
ed78569ff21217f3cc8949466a4ba9469ab98f3d | 573 | pl | Perl | mXDE-2020/scripts/cat_files.pl | IHE-Tools/fhir_test_support | 074039b28f2742c8a240aa3f085075523a720567 | [
"Apache-2.0"
] | null | null | null | mXDE-2020/scripts/cat_files.pl | IHE-Tools/fhir_test_support | 074039b28f2742c8a240aa3f085075523a720567 | [
"Apache-2.0"
] | null | null | null | mXDE-2020/scripts/cat_files.pl | IHE-Tools/fhir_test_support | 074039b28f2742c8a240aa3f085075523a720567 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/perl
sub read_text_file_single_line {
my ($path) = @_;
my $handle;
unless (open $handle, "<:encoding(utf8)", $path) {
die "Could not open file '$path': $!\n";
}
local $/ = undef;
(my $line = <$handle>);
close $handle;
return $line;
}
sub check_args {
if (scalar(@_) < 2) {
print STDERR
"Usage: file1 file2 [file...]>\n";
die;
}
}
## Main starts here
check_args(@ARGV);
my $output = "";
foreach $f (@ARGV) {
my $content = read_text_file_single_line($f);
chomp $content;
$output .= $content . "\t";
}
chop $output;
print "$output\n";
| 15.078947 | 51 | 0.596859 |
ed76db20051ca61bdb88b44d6d5f82340f162fec | 3,126 | pm | Perl | Shared/lib/perfSONAR_PS/Datatypes/EventTypes/Tools.pm | perfsonar/historical | 9f21b87cb170d1dfe712195e1003b071f8348744 | [
"Apache-2.0"
] | null | null | null | Shared/lib/perfSONAR_PS/Datatypes/EventTypes/Tools.pm | perfsonar/historical | 9f21b87cb170d1dfe712195e1003b071f8348744 | [
"Apache-2.0"
] | null | null | null | Shared/lib/perfSONAR_PS/Datatypes/EventTypes/Tools.pm | perfsonar/historical | 9f21b87cb170d1dfe712195e1003b071f8348744 | [
"Apache-2.0"
] | null | null | null | package perfSONAR_PS::Datatypes::EventTypes::Tools;
use strict;
use warnings;
use version;
our $VERSION = 3.3;
=head1 NAME
perfSONAR_PS::Datatypes::EventTypes::Tools
=head1 DESCRIPTION
A container for various perfSONAR http://ggf.org/ns/nmwg/tools/ eventtypes. The
purpose of this module is to create OO interface for tools eventtypes and
therefore add the layer of abstraction for any tools eventtypes related
operation ( mostly for perfSONAR response). All perfSONAR-PS classes should
work with the instance of this class and avoid using explicit eventtype
declarations.
=head1 Methods
There is accessor mutator for every defined Characteristic
=cut
use Log::Log4perl qw(get_logger);
use Class::Accessor;
use Class::Fields;
use base qw(Class::Accessor Class::Fields);
use fields qw( snmp pinger traceroute ping owamp bwctl iperf);
perfSONAR_PS::Datatypes::EventTypes::Tools->mk_accessors( perfSONAR_PS::Datatypes::EventTypes::Tools->show_fields( 'Public' ) );
use constant {
CLASSPATH => "perfSONAR_PS::Datatypes::EventTypes::Tools",
TOOL => "http://ggf.org/ns/nmwg/tools",
RELEASE => "2.0"
};
=head2 new( )
Creates a new object, pass hash ref as collection of event types for tools namespace
=cut
sub new {
my $that = shift;
my $param = shift;
my $logger = get_logger( CLASSPATH );
if ( $param && ref( $param ) ne 'HASH' ) {
$logger->error( "ONLY hash ref accepted as param " . $param );
return undef;
}
my $class = ref( $that ) || $that;
my $self = fields::new( $class );
foreach my $tool ( $self->show_fields( 'Public' ) ) {
$self->{$tool} = TOOL . "/$tool/" . RELEASE . "/";
}
return $self;
}
1;
__END__
=head1 SYNOPSIS
use perfSONAR_PS::Datatypes::EventTypes::Tools;
# create Tools eventtype object with default URIs
my $tools_event = perfSONAR_PS::Datatypes::EventTypes::Tools->new();
# overwrite only specific Namesapce with custom URI
$tools_event = perfSONAR_PS::Datatypes::EventTypes::Tools->new( {'pinger' => 'http://ggf.org/ns/nmwg/tools/pinger/2.0'});
my $pinger_tool = $tools_event->pinger; ## get URI by key
$tools_event->pinger( 'http://ggf.org/ns/nmwg/tools/pinger/2.0'); ## set URI by key
=head2 Supported Tools:
'pinger' 'traceroute','snmp', 'ping', 'owamp', 'bwctl', 'pinger', 'iperf'
=head1 SEE ALSO
To join the 'perfSONAR-PS Users' mailing list, please visit:
https://lists.internet2.edu/sympa/info/perfsonar-ps-users
The perfSONAR-PS subversion repository is located at:
http://anonsvn.internet2.edu/svn/perfSONAR-PS/trunk
Questions and comments can be directed to the author, or the mailing list.
Bugs, feature requests, and improvements can be directed here:
http://code.google.com/p/perfsonar-ps/issues/list
=head1 VERSION
$Id$
=head1 AUTHOR
Maxim Grigoriev, [email protected]
=head1 LICENSE
You should have received a copy of the Fermitools license
along with this software.
=head1 COPYRIGHT
Copyright (c) 2008-2010, Fermi Research Alliance (FRA)
All rights reserved.
=cut
| 25.209677 | 128 | 0.694178 |
ed9c292a1c785a5d13697a55fb5fcee4dca246de | 4,963 | pm | Perl | os/linux/local/mode/listinterfaces.pm | centreon-lab/centreon-plugins | 68096c697a9e1baf89a712674a193d9a9321503c | [
"Apache-2.0"
] | null | null | null | os/linux/local/mode/listinterfaces.pm | centreon-lab/centreon-plugins | 68096c697a9e1baf89a712674a193d9a9321503c | [
"Apache-2.0"
] | null | null | null | os/linux/local/mode/listinterfaces.pm | centreon-lab/centreon-plugins | 68096c697a9e1baf89a712674a193d9a9321503c | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2022 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package os::linux::local::mode::listinterfaces;
use base qw(centreon::plugins::mode);
use strict;
use warnings;
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$options{options}->add_options(arguments => {
'filter-name:s' => { name => 'filter_name' },
'filter-state:s' => { name => 'filter_state' },
'no-loopback' => { name => 'no_loopback' },
'skip-novalues' => { name => 'skip_novalues' }
});
return $self;
}
sub check_options {
my ($self, %options) = @_;
$self->SUPER::init(%options);
}
sub manage_selection {
my ($self, %options) = @_;
my ($stdout) = $options{custom}->execute_command(
command_path => '/sbin',
command => 'ip',
command_options => '-s addr 2>&1'
);
my $mapping = {
ifconfig => {
get_interface => '^(\S+)(.*?)(\n\n|\n$)',
test => 'RX bytes:\S+.*?TX bytes:\S+'
},
iproute => {
get_interface => '^\d+:\s+(\S+)(.*?)(?=\n\d|\Z$)',
test => 'RX:\s+bytes.*?\d+'
}
};
my $type = 'ifconfig';
if ($stdout =~ /^\d+:\s+\S+:\s+</ms) {
$type = 'iproute';
}
my $results = {};
while ($stdout =~ /$mapping->{$type}->{get_interface}/msg) {
my ($interface_name, $values) = ($1, $2);
$interface_name =~ s/:$//;
my $states = '';
$states .= 'R' if ($values =~ /RUNNING|LOWER_UP/ms);
$states .= 'U' if ($values =~ /UP/ms);
if (defined($self->{option_results}->{no_loopback}) && $values =~ /LOOPBACK/ms) {
$self->{output}->output_add(long_msg => "Skipping interface '" . $interface_name . "': option --no-loopback");
next;
}
if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne '' &&
$interface_name !~ /$self->{option_results}->{filter_name}/) {
$self->{output}->output_add(long_msg => "Skipping interface '" . $interface_name . "': no matching filter name");
next;
}
if (defined($self->{option_results}->{filter_state}) && $self->{option_results}->{filter_state} ne '' &&
$states !~ /$self->{option_results}->{filter_state}/) {
$self->{output}->output_add(long_msg => "Skipping interface '" . $interface_name . "': no matching filter state");
next;
}
if (defined($self->{option_results}->{skip_novalues}) && $values =~ /$mapping->{$type}->{test}/msi) {
$self->{output}->output_add(long_msg => "Skipping interface '" . $interface_name . "': no values");
next;
}
$results->{$interface_name} = { state => $states };
}
return $results;
}
sub run {
my ($self, %options) = @_;
my $results = $self->manage_selection(custom => $options{custom});
foreach my $name (sort(keys %$results)) {
$self->{output}->output_add(long_msg => "'" . $name . "' [state = '" . $results->{$name}->{state} . "']");
}
$self->{output}->output_add(
severity => 'OK',
short_msg => 'List interfaces:'
);
$self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);
$self->{output}->exit();
}
sub disco_format {
my ($self, %options) = @_;
$self->{output}->add_disco_format(elements => ['name', 'state']);
}
sub disco_show {
my ($self, %options) = @_;
my $results = $self->manage_selection(custom => $options{custom});
foreach my $name (sort(keys %$results)) {
$self->{output}->add_disco_entry(
name => $name,
state => $results->{$name}->{state}
);
}
}
1;
__END__
=head1 MODE
List storages.
Command used: /sbin/ip -s addr 2>&1
=over 8
=item B<--filter-name>
Filter interface name (regexp can be used).
=item B<--filter-state>
Filter state (regexp can be used).
Can be: 'R' (running), 'U' (up).
=item B<--no-loopback>
Don't display loopback interfaces.
=item B<--skip-novalues>
Filter interface without in/out byte values.
=back
=cut
| 28.687861 | 126 | 0.568003 |
ed69f65b85af5b7316af62529ea7de1a4bf45e2e | 3,889 | t | Perl | t/unit/request.t | mkirank/Raisin | ec232a0c4d749d977c31df8ea41bea9a5ed4c11a | [
"Artistic-1.0"
] | null | null | null | t/unit/request.t | mkirank/Raisin | ec232a0c4d749d977c31df8ea41bea9a5ed4c11a | [
"Artistic-1.0"
] | null | null | null | t/unit/request.t | mkirank/Raisin | ec232a0c4d749d977c31df8ea41bea9a5ed4c11a | [
"Artistic-1.0"
] | null | null | null |
use strict;
use warnings;
use HTTP::Message::PSGI;
use HTTP::Request::Common qw(GET);
use Test::More;
use Types::Standard qw(Int);
use Raisin;
use Raisin::Param;
use Raisin::Request;
use Raisin::Routes::Endpoint;
{
no strict 'refs';
*Raisin::log = sub { note(sprintf $_[1], @_[2 .. $#_]) };
}
subtest 'precedence' => sub {
my $r = Raisin::Routes::Endpoint->new(
method => 'GET',
path => '/user/:id',
params => [
Raisin::Param->new(
named => 1,
type => 'requires',
spec => { name => 'id', type => Int },
),
Raisin::Param->new(
named => 0,
type => 'optional',
spec => { name => 'id', type => Int },
),
],
code => sub {},
);
my @CASES = (
{
env => {
%{ GET('/user/1?id=2')->to_psgi },
'raisinx.body_params' => { id => 3 },
},
expected => 1,
},
{
env => {
%{ GET('/user/?id=2')->to_psgi },
'raisinx.body_params' => { id => 3 },
},
expected => 2,
},
{
env => {
%{ GET('/user/')->to_psgi },
'raisinx.body_params' => { id => 3 },
},
expected => 3,
},
{
env => {
%{ GET('/user/')->to_psgi },
},
expected => undef,
},
);
for my $case (@CASES) {
my $req = Raisin::Request->new($case->{env});
$r->match($case->{env}{REQUEST_METHOD}, $case->{env}{PATH_INFO});
$req->prepare_params($r->params, $r->named);
is $req->raisin_parameters->{id}, $case->{expected};
}
};
subtest 'validation' => sub {
my $r = Raisin::Routes::Endpoint->new(
method => 'GET',
path => '/user',
params => [
Raisin::Param->new(
type => 'required',
spec => { name => 'req', type => Int },
),
Raisin::Param->new(
type => 'optional',
spec => { name => 'opt1', type => Int },
),
Raisin::Param->new(
type => 'optional',
spec => { name => 'opt2', type => Int, default => 42 },
),
],
code => sub {},
);
my @CASES = (
# required, not set
# optional 1, not set
# optional 2, not set
{
env => GET('/user/')->to_psgi,
expected => {
ret => undef,
pp => {},
},
},
# required, set
# optional 1, not set
# optional 2, not set
{
env => GET('/user/?req=1')->to_psgi,
expected => {
ret => 1,
pp => { req => 1, opt2 => 42 },
},
},
# required, set
# optional 1, set
# optional 2, not set
{
env => GET('/user/?req=1&opt1=2')->to_psgi,
expected => {
ret => 1,
pp => { req => 1, opt1 => 2, opt2 => 42 },
},
},
# required, set
# optional 2, set
{
env => GET('/user/?req=1&opt2=2')->to_psgi,
expected => {
ret => 1,
pp => { req => 1, opt2 => 2 },
},
},
);
for my $case (@CASES) {
my $req = Raisin::Request->new($case->{env});
$r->match($case->{env}{REQUEST_METHOD}, $case->{env}{PATH_INFO});
is $req->prepare_params($r->params, $r->named), $case->{expected}{ret};
next unless $case->{expected}{ret};
is_deeply $req->declared_params, $case->{expected}{pp};
}
};
done_testing;
| 24.929487 | 79 | 0.379275 |
73d7c736ed8abedaa90525719b036928aa6b3118 | 16,441 | pm | Perl | Source/Manip/TZ/asyeka00.pm | ssp/Pester | f2d8ec2f62bfb83656f77f3ee41b54149287904a | [
"BSD-2-Clause"
] | 59 | 2015-01-11T18:44:25.000Z | 2022-03-07T22:56:02.000Z | Source/Manip/TZ/asyeka00.pm | ssp/Pester | f2d8ec2f62bfb83656f77f3ee41b54149287904a | [
"BSD-2-Clause"
] | 11 | 2015-06-19T11:01:00.000Z | 2018-06-05T21:30:17.000Z | Source/Manip/TZ/asyeka00.pm | ssp/Pester | f2d8ec2f62bfb83656f77f3ee41b54149287904a | [
"BSD-2-Clause"
] | 7 | 2015-09-21T21:04:59.000Z | 2022-02-13T18:26:47.000Z | package #
Date::Manip::TZ::asyeka00;
# Copyright (c) 2008-2014 Sullivan Beck. All rights reserved.
# This program is free software; you can redistribute it and/or modify it
# under the same terms as Perl itself.
# This file was automatically generated. Any changes to this file will
# be lost the next time 'tzdata' is run.
# Generated on: Fri Nov 21 10:41:42 EST 2014
# Data version: tzdata2014j
# Code version: tzcode2014j
# This module contains data from the zoneinfo time zone database. The original
# data was obtained from the URL:
# ftp://ftp.iana.org/tz
use strict;
use warnings;
require 5.010000;
our (%Dates,%LastRule);
END {
undef %Dates;
undef %LastRule;
}
our ($VERSION);
$VERSION='6.48';
END { undef $VERSION; }
%Dates = (
1 =>
[
[ [1,1,2,0,0,0],[1,1,2,4,2,33],'+04:02:33',[4,2,33],
'LMT',0,[1916,7,2,19,57,26],[1916,7,2,23,59,59],
'0001010200:00:00','0001010204:02:33','1916070219:57:26','1916070223:59:59' ],
],
1916 =>
[
[ [1916,7,2,19,57,27],[1916,7,2,23,42,32],'+03:45:05',[3,45,5],
'PMT',0,[1919,7,15,0,14,54],[1919,7,15,3,59,59],
'1916070219:57:27','1916070223:42:32','1919071500:14:54','1919071503:59:59' ],
],
1919 =>
[
[ [1919,7,15,0,14,55],[1919,7,15,4,14,55],'+04:00:00',[4,0,0],
'SVET',0,[1930,6,20,19,59,59],[1930,6,20,23,59,59],
'1919071500:14:55','1919071504:14:55','1930062019:59:59','1930062023:59:59' ],
],
1930 =>
[
[ [1930,6,20,20,0,0],[1930,6,21,1,0,0],'+05:00:00',[5,0,0],
'SVET',0,[1981,3,31,18,59,59],[1981,3,31,23,59,59],
'1930062020:00:00','1930062101:00:00','1981033118:59:59','1981033123:59:59' ],
],
1981 =>
[
[ [1981,3,31,19,0,0],[1981,4,1,1,0,0],'+06:00:00',[6,0,0],
'SVEST',1,[1981,9,30,17,59,59],[1981,9,30,23,59,59],
'1981033119:00:00','1981040101:00:00','1981093017:59:59','1981093023:59:59' ],
[ [1981,9,30,18,0,0],[1981,9,30,23,0,0],'+05:00:00',[5,0,0],
'SVET',0,[1982,3,31,18,59,59],[1982,3,31,23,59,59],
'1981093018:00:00','1981093023:00:00','1982033118:59:59','1982033123:59:59' ],
],
1982 =>
[
[ [1982,3,31,19,0,0],[1982,4,1,1,0,0],'+06:00:00',[6,0,0],
'SVEST',1,[1982,9,30,17,59,59],[1982,9,30,23,59,59],
'1982033119:00:00','1982040101:00:00','1982093017:59:59','1982093023:59:59' ],
[ [1982,9,30,18,0,0],[1982,9,30,23,0,0],'+05:00:00',[5,0,0],
'SVET',0,[1983,3,31,18,59,59],[1983,3,31,23,59,59],
'1982093018:00:00','1982093023:00:00','1983033118:59:59','1983033123:59:59' ],
],
1983 =>
[
[ [1983,3,31,19,0,0],[1983,4,1,1,0,0],'+06:00:00',[6,0,0],
'SVEST',1,[1983,9,30,17,59,59],[1983,9,30,23,59,59],
'1983033119:00:00','1983040101:00:00','1983093017:59:59','1983093023:59:59' ],
[ [1983,9,30,18,0,0],[1983,9,30,23,0,0],'+05:00:00',[5,0,0],
'SVET',0,[1984,3,31,18,59,59],[1984,3,31,23,59,59],
'1983093018:00:00','1983093023:00:00','1984033118:59:59','1984033123:59:59' ],
],
1984 =>
[
[ [1984,3,31,19,0,0],[1984,4,1,1,0,0],'+06:00:00',[6,0,0],
'SVEST',1,[1984,9,29,20,59,59],[1984,9,30,2,59,59],
'1984033119:00:00','1984040101:00:00','1984092920:59:59','1984093002:59:59' ],
[ [1984,9,29,21,0,0],[1984,9,30,2,0,0],'+05:00:00',[5,0,0],
'SVET',0,[1985,3,30,20,59,59],[1985,3,31,1,59,59],
'1984092921:00:00','1984093002:00:00','1985033020:59:59','1985033101:59:59' ],
],
1985 =>
[
[ [1985,3,30,21,0,0],[1985,3,31,3,0,0],'+06:00:00',[6,0,0],
'SVEST',1,[1985,9,28,20,59,59],[1985,9,29,2,59,59],
'1985033021:00:00','1985033103:00:00','1985092820:59:59','1985092902:59:59' ],
[ [1985,9,28,21,0,0],[1985,9,29,2,0,0],'+05:00:00',[5,0,0],
'SVET',0,[1986,3,29,20,59,59],[1986,3,30,1,59,59],
'1985092821:00:00','1985092902:00:00','1986032920:59:59','1986033001:59:59' ],
],
1986 =>
[
[ [1986,3,29,21,0,0],[1986,3,30,3,0,0],'+06:00:00',[6,0,0],
'SVEST',1,[1986,9,27,20,59,59],[1986,9,28,2,59,59],
'1986032921:00:00','1986033003:00:00','1986092720:59:59','1986092802:59:59' ],
[ [1986,9,27,21,0,0],[1986,9,28,2,0,0],'+05:00:00',[5,0,0],
'SVET',0,[1987,3,28,20,59,59],[1987,3,29,1,59,59],
'1986092721:00:00','1986092802:00:00','1987032820:59:59','1987032901:59:59' ],
],
1987 =>
[
[ [1987,3,28,21,0,0],[1987,3,29,3,0,0],'+06:00:00',[6,0,0],
'SVEST',1,[1987,9,26,20,59,59],[1987,9,27,2,59,59],
'1987032821:00:00','1987032903:00:00','1987092620:59:59','1987092702:59:59' ],
[ [1987,9,26,21,0,0],[1987,9,27,2,0,0],'+05:00:00',[5,0,0],
'SVET',0,[1988,3,26,20,59,59],[1988,3,27,1,59,59],
'1987092621:00:00','1987092702:00:00','1988032620:59:59','1988032701:59:59' ],
],
1988 =>
[
[ [1988,3,26,21,0,0],[1988,3,27,3,0,0],'+06:00:00',[6,0,0],
'SVEST',1,[1988,9,24,20,59,59],[1988,9,25,2,59,59],
'1988032621:00:00','1988032703:00:00','1988092420:59:59','1988092502:59:59' ],
[ [1988,9,24,21,0,0],[1988,9,25,2,0,0],'+05:00:00',[5,0,0],
'SVET',0,[1989,3,25,20,59,59],[1989,3,26,1,59,59],
'1988092421:00:00','1988092502:00:00','1989032520:59:59','1989032601:59:59' ],
],
1989 =>
[
[ [1989,3,25,21,0,0],[1989,3,26,3,0,0],'+06:00:00',[6,0,0],
'SVEST',1,[1989,9,23,20,59,59],[1989,9,24,2,59,59],
'1989032521:00:00','1989032603:00:00','1989092320:59:59','1989092402:59:59' ],
[ [1989,9,23,21,0,0],[1989,9,24,2,0,0],'+05:00:00',[5,0,0],
'SVET',0,[1990,3,24,20,59,59],[1990,3,25,1,59,59],
'1989092321:00:00','1989092402:00:00','1990032420:59:59','1990032501:59:59' ],
],
1990 =>
[
[ [1990,3,24,21,0,0],[1990,3,25,3,0,0],'+06:00:00',[6,0,0],
'SVEST',1,[1990,9,29,20,59,59],[1990,9,30,2,59,59],
'1990032421:00:00','1990032503:00:00','1990092920:59:59','1990093002:59:59' ],
[ [1990,9,29,21,0,0],[1990,9,30,2,0,0],'+05:00:00',[5,0,0],
'SVET',0,[1991,3,30,20,59,59],[1991,3,31,1,59,59],
'1990092921:00:00','1990093002:00:00','1991033020:59:59','1991033101:59:59' ],
],
1991 =>
[
[ [1991,3,30,21,0,0],[1991,3,31,2,0,0],'+05:00:00',[5,0,0],
'SVEST',1,[1991,9,28,21,59,59],[1991,9,29,2,59,59],
'1991033021:00:00','1991033102:00:00','1991092821:59:59','1991092902:59:59' ],
[ [1991,9,28,22,0,0],[1991,9,29,2,0,0],'+04:00:00',[4,0,0],
'SVET',0,[1992,1,18,21,59,59],[1992,1,19,1,59,59],
'1991092822:00:00','1991092902:00:00','1992011821:59:59','1992011901:59:59' ],
],
1992 =>
[
[ [1992,1,18,22,0,0],[1992,1,19,3,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[1992,3,28,17,59,59],[1992,3,28,22,59,59],
'1992011822:00:00','1992011903:00:00','1992032817:59:59','1992032822:59:59' ],
[ [1992,3,28,18,0,0],[1992,3,29,0,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[1992,9,26,16,59,59],[1992,9,26,22,59,59],
'1992032818:00:00','1992032900:00:00','1992092616:59:59','1992092622:59:59' ],
[ [1992,9,26,17,0,0],[1992,9,26,22,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[1993,3,27,20,59,59],[1993,3,28,1,59,59],
'1992092617:00:00','1992092622:00:00','1993032720:59:59','1993032801:59:59' ],
],
1993 =>
[
[ [1993,3,27,21,0,0],[1993,3,28,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[1993,9,25,20,59,59],[1993,9,26,2,59,59],
'1993032721:00:00','1993032803:00:00','1993092520:59:59','1993092602:59:59' ],
[ [1993,9,25,21,0,0],[1993,9,26,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[1994,3,26,20,59,59],[1994,3,27,1,59,59],
'1993092521:00:00','1993092602:00:00','1994032620:59:59','1994032701:59:59' ],
],
1994 =>
[
[ [1994,3,26,21,0,0],[1994,3,27,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[1994,9,24,20,59,59],[1994,9,25,2,59,59],
'1994032621:00:00','1994032703:00:00','1994092420:59:59','1994092502:59:59' ],
[ [1994,9,24,21,0,0],[1994,9,25,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[1995,3,25,20,59,59],[1995,3,26,1,59,59],
'1994092421:00:00','1994092502:00:00','1995032520:59:59','1995032601:59:59' ],
],
1995 =>
[
[ [1995,3,25,21,0,0],[1995,3,26,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[1995,9,23,20,59,59],[1995,9,24,2,59,59],
'1995032521:00:00','1995032603:00:00','1995092320:59:59','1995092402:59:59' ],
[ [1995,9,23,21,0,0],[1995,9,24,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[1996,3,30,20,59,59],[1996,3,31,1,59,59],
'1995092321:00:00','1995092402:00:00','1996033020:59:59','1996033101:59:59' ],
],
1996 =>
[
[ [1996,3,30,21,0,0],[1996,3,31,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[1996,10,26,20,59,59],[1996,10,27,2,59,59],
'1996033021:00:00','1996033103:00:00','1996102620:59:59','1996102702:59:59' ],
[ [1996,10,26,21,0,0],[1996,10,27,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[1997,3,29,20,59,59],[1997,3,30,1,59,59],
'1996102621:00:00','1996102702:00:00','1997032920:59:59','1997033001:59:59' ],
],
1997 =>
[
[ [1997,3,29,21,0,0],[1997,3,30,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[1997,10,25,20,59,59],[1997,10,26,2,59,59],
'1997032921:00:00','1997033003:00:00','1997102520:59:59','1997102602:59:59' ],
[ [1997,10,25,21,0,0],[1997,10,26,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[1998,3,28,20,59,59],[1998,3,29,1,59,59],
'1997102521:00:00','1997102602:00:00','1998032820:59:59','1998032901:59:59' ],
],
1998 =>
[
[ [1998,3,28,21,0,0],[1998,3,29,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[1998,10,24,20,59,59],[1998,10,25,2,59,59],
'1998032821:00:00','1998032903:00:00','1998102420:59:59','1998102502:59:59' ],
[ [1998,10,24,21,0,0],[1998,10,25,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[1999,3,27,20,59,59],[1999,3,28,1,59,59],
'1998102421:00:00','1998102502:00:00','1999032720:59:59','1999032801:59:59' ],
],
1999 =>
[
[ [1999,3,27,21,0,0],[1999,3,28,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[1999,10,30,20,59,59],[1999,10,31,2,59,59],
'1999032721:00:00','1999032803:00:00','1999103020:59:59','1999103102:59:59' ],
[ [1999,10,30,21,0,0],[1999,10,31,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[2000,3,25,20,59,59],[2000,3,26,1,59,59],
'1999103021:00:00','1999103102:00:00','2000032520:59:59','2000032601:59:59' ],
],
2000 =>
[
[ [2000,3,25,21,0,0],[2000,3,26,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[2000,10,28,20,59,59],[2000,10,29,2,59,59],
'2000032521:00:00','2000032603:00:00','2000102820:59:59','2000102902:59:59' ],
[ [2000,10,28,21,0,0],[2000,10,29,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[2001,3,24,20,59,59],[2001,3,25,1,59,59],
'2000102821:00:00','2000102902:00:00','2001032420:59:59','2001032501:59:59' ],
],
2001 =>
[
[ [2001,3,24,21,0,0],[2001,3,25,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[2001,10,27,20,59,59],[2001,10,28,2,59,59],
'2001032421:00:00','2001032503:00:00','2001102720:59:59','2001102802:59:59' ],
[ [2001,10,27,21,0,0],[2001,10,28,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[2002,3,30,20,59,59],[2002,3,31,1,59,59],
'2001102721:00:00','2001102802:00:00','2002033020:59:59','2002033101:59:59' ],
],
2002 =>
[
[ [2002,3,30,21,0,0],[2002,3,31,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[2002,10,26,20,59,59],[2002,10,27,2,59,59],
'2002033021:00:00','2002033103:00:00','2002102620:59:59','2002102702:59:59' ],
[ [2002,10,26,21,0,0],[2002,10,27,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[2003,3,29,20,59,59],[2003,3,30,1,59,59],
'2002102621:00:00','2002102702:00:00','2003032920:59:59','2003033001:59:59' ],
],
2003 =>
[
[ [2003,3,29,21,0,0],[2003,3,30,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[2003,10,25,20,59,59],[2003,10,26,2,59,59],
'2003032921:00:00','2003033003:00:00','2003102520:59:59','2003102602:59:59' ],
[ [2003,10,25,21,0,0],[2003,10,26,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[2004,3,27,20,59,59],[2004,3,28,1,59,59],
'2003102521:00:00','2003102602:00:00','2004032720:59:59','2004032801:59:59' ],
],
2004 =>
[
[ [2004,3,27,21,0,0],[2004,3,28,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[2004,10,30,20,59,59],[2004,10,31,2,59,59],
'2004032721:00:00','2004032803:00:00','2004103020:59:59','2004103102:59:59' ],
[ [2004,10,30,21,0,0],[2004,10,31,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[2005,3,26,20,59,59],[2005,3,27,1,59,59],
'2004103021:00:00','2004103102:00:00','2005032620:59:59','2005032701:59:59' ],
],
2005 =>
[
[ [2005,3,26,21,0,0],[2005,3,27,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[2005,10,29,20,59,59],[2005,10,30,2,59,59],
'2005032621:00:00','2005032703:00:00','2005102920:59:59','2005103002:59:59' ],
[ [2005,10,29,21,0,0],[2005,10,30,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[2006,3,25,20,59,59],[2006,3,26,1,59,59],
'2005102921:00:00','2005103002:00:00','2006032520:59:59','2006032601:59:59' ],
],
2006 =>
[
[ [2006,3,25,21,0,0],[2006,3,26,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[2006,10,28,20,59,59],[2006,10,29,2,59,59],
'2006032521:00:00','2006032603:00:00','2006102820:59:59','2006102902:59:59' ],
[ [2006,10,28,21,0,0],[2006,10,29,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[2007,3,24,20,59,59],[2007,3,25,1,59,59],
'2006102821:00:00','2006102902:00:00','2007032420:59:59','2007032501:59:59' ],
],
2007 =>
[
[ [2007,3,24,21,0,0],[2007,3,25,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[2007,10,27,20,59,59],[2007,10,28,2,59,59],
'2007032421:00:00','2007032503:00:00','2007102720:59:59','2007102802:59:59' ],
[ [2007,10,27,21,0,0],[2007,10,28,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[2008,3,29,20,59,59],[2008,3,30,1,59,59],
'2007102721:00:00','2007102802:00:00','2008032920:59:59','2008033001:59:59' ],
],
2008 =>
[
[ [2008,3,29,21,0,0],[2008,3,30,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[2008,10,25,20,59,59],[2008,10,26,2,59,59],
'2008032921:00:00','2008033003:00:00','2008102520:59:59','2008102602:59:59' ],
[ [2008,10,25,21,0,0],[2008,10,26,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[2009,3,28,20,59,59],[2009,3,29,1,59,59],
'2008102521:00:00','2008102602:00:00','2009032820:59:59','2009032901:59:59' ],
],
2009 =>
[
[ [2009,3,28,21,0,0],[2009,3,29,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[2009,10,24,20,59,59],[2009,10,25,2,59,59],
'2009032821:00:00','2009032903:00:00','2009102420:59:59','2009102502:59:59' ],
[ [2009,10,24,21,0,0],[2009,10,25,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[2010,3,27,20,59,59],[2010,3,28,1,59,59],
'2009102421:00:00','2009102502:00:00','2010032720:59:59','2010032801:59:59' ],
],
2010 =>
[
[ [2010,3,27,21,0,0],[2010,3,28,3,0,0],'+06:00:00',[6,0,0],
'YEKST',1,[2010,10,30,20,59,59],[2010,10,31,2,59,59],
'2010032721:00:00','2010032803:00:00','2010103020:59:59','2010103102:59:59' ],
[ [2010,10,30,21,0,0],[2010,10,31,2,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[2011,3,26,20,59,59],[2011,3,27,1,59,59],
'2010103021:00:00','2010103102:00:00','2011032620:59:59','2011032701:59:59' ],
],
2011 =>
[
[ [2011,3,26,21,0,0],[2011,3,27,3,0,0],'+06:00:00',[6,0,0],
'YEKT',0,[2014,10,25,19,59,59],[2014,10,26,1,59,59],
'2011032621:00:00','2011032703:00:00','2014102519:59:59','2014102601:59:59' ],
],
2014 =>
[
[ [2014,10,25,20,0,0],[2014,10,26,1,0,0],'+05:00:00',[5,0,0],
'YEKT',0,[9999,12,31,0,0,0],[9999,12,31,5,0,0],
'2014102520:00:00','2014102601:00:00','9999123100:00:00','9999123105:00:00' ],
],
);
%LastRule = (
);
1;
| 47.380403 | 88 | 0.52065 |
eda13aa2a8f4e3946b712329512cb57a7d4aba60 | 1,732 | pl | Perl | mail-perl.pl | wittyfool/linux_amenities | 4988bc690fe2d1179a70d08653737b55fbbd473c | [
"MIT"
] | null | null | null | mail-perl.pl | wittyfool/linux_amenities | 4988bc690fe2d1179a70d08653737b55fbbd473c | [
"MIT"
] | null | null | null | mail-perl.pl | wittyfool/linux_amenities | 4988bc690fe2d1179a70d08653737b55fbbd473c | [
"MIT"
] | null | null | null | #!/usr/bin/perl -s
use Data::Dumper;
my $arg = {
debug => $debug,
src => $src,
};
if(!defined($src)){
die "Need -src=????";
}
#
my $sendmail = '/usr/sbin/sendmail';
my $template = $arg->{src};
use CGI;
use MIME::Base64;
use Jcode;
use strict;
my $uuid = `/usr/bin/uuidgen`;
$uuid =~ s/[\r\n]+//;
my $uuid_short = $uuid;
$uuid_short =~ s/\-.+//;
my $msg;
my $templateText = "";
if(!open(fh, '<', $template)){
die "Can't open config file.";
}
while(<fh>){
$templateText .= $_;
}
close(fh);
{
my $bind = {};
for my $k (keys %ENV){
$bind->{ 'ENV_'.$k } = $ENV{ $k };
}
$bind->{ ENV } = Dumper \%ENV;
$bind->{ uuid } = $uuid;
$bind->{ uuid_short } = $uuid_short;
if(defined($templateText)){
$msg = evalTemplate($templateText, $bind );
# MIME 処理
my $header = 1;
my $message;
my @message = split(/\n/, $msg);
for my $m (@message){
if(/^$/){
$header = 0;
}
if($header && $m =~ /^Subject: (.+)/){
$message .= "Subject: =?utf-8?B?".encode_base64($1, "")."?=";
} else {
$message .= $header ? $m : Jcode::convert($m, 'jis', 'utf-8');
}
$message .="\n";
}
# ----
if( !open(fh, '|'. $sendmail.' -t')){
outputExit("Can't send mail");
} else {
print fh $message;
close(fh);
}
if(1){
if( !open(fh, '>', '/var/tmp/maillog.txt')){
warn "Can't send maillog";
} else {
print fh $message;
close(fh);
}
}
} else {
$msg = qq/Can't open config file./;
}
}
# ---------------------- END of MAIN -----------
sub evalTemplate {
my $temp = shift;
my $hash = shift;
my $evaluated = $temp;
while( $evaluated =~ /\[%\s+(\S+)\s+%\]/){
my $e = ( $hash->{$1} ? $hash->{$1} : '<空欄>' );
$evaluated = $`.$e.$';
}
return $evaluated;
}
| 16.815534 | 66 | 0.493649 |
edb7d0e8037f779a2a2631b6fb0dbd839a3c2d1f | 7,349 | pl | Perl | TAO/CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/run_test_cmd.pl | cflowe/ACE | 5ff60b41adbe1772372d1a43bcc1f2726ff8f810 | [
"DOC"
] | 36 | 2015-01-10T07:27:33.000Z | 2022-03-07T03:32:08.000Z | TAO/CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/run_test_cmd.pl | cflowe/ACE | 5ff60b41adbe1772372d1a43bcc1f2726ff8f810 | [
"DOC"
] | 2 | 2018-08-13T07:30:51.000Z | 2019-02-25T03:04:31.000Z | TAO/CIAO/tests/DAnCE/LocalityManager/CommandlinePassage/run_test_cmd.pl | cflowe/ACE | 5ff60b41adbe1772372d1a43bcc1f2726ff8f810 | [
"DOC"
] | 38 | 2015-01-08T14:12:06.000Z | 2022-01-19T08:33:00.000Z | eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
& eval 'exec perl -S $0 $argv:q'
if 0;
# $Id: run_test_cmd.pl 92902 2010-12-17 15:09:42Z mcorino $
# -*- perl -*-
use lib "$ENV{'ACE_ROOT'}/bin";
use PerlACE::TestTarget;
$CIAO_ROOT = "$ENV{'CIAO_ROOT'}";
$TAO_ROOT = "$ENV{'TAO_ROOT'}";
$DANCE_ROOT = "$ENV{'DANCE_ROOT'}";
$daemons_running = 0;
$em_running = 0;
$ns_running = 0;
$nr_daemon = 1;
@ports = ( 60001 );
@iorbases = ( "CommandlinePassage.ior" );
@iorfiles = 0;
@nodenames = ( "CommandlinePassageNode" );
# ior files other than daemon
# ior files other than daemon
$ior_nsbase = "ns.ior";
$ior_nsfile = 0;
$ior_embase = "EM.ior";
$ior_emfile = 0;
# Processes
$E = 0;
$EM = 0;
$NS = 0;
@DEAMONS = 0;
# targets
@tg_daemons = 0;
$tg_naming = 0;
$tg_exe_man = 0;
$tg_executor = 0;
$status = 0;
$cdp_file = "Component_cmd.cdp";
sub create_targets {
# naming service
$tg_naming = PerlACE::TestTarget::create_target (1) || die "Create target for ns failed\n";
$tg_naming->AddLibPath ('.');
# daemon
for ($i = 0; $i < $nr_daemon; ++$i) {
$tg_daemons[$i] = PerlACE::TestTarget::create_target ($i+1) || die "Create target for daemon $i failed\n";
$tg_daemons[$i]->AddLibPath ('.');
}
# execution manager
$tg_exe_man = PerlACE::TestTarget::create_target (1) || die "Create target for EM failed\n";
$tg_exe_man->AddLibPath ('.');
# executor (plan_launcher)
$tg_executor = PerlACE::TestTarget::create_target (1) || die "Create target for executor failed\n";
$tg_executor->AddLibPath ('.');
}
sub init_ior_files {
$ior_nsfile = $tg_naming->LocalFile ($ior_nsbase);
$ior_emfile = $tg_exe_man->LocalFile ($ior_embase);
for ($i = 0; $i < $nr_daemon; ++$i) {
$iorfiles[$i] = $tg_daemons[$i]->LocalFile ($iorbases[$i]);
}
delete_ior_files ();
}
# Delete if there are any .ior files.
sub delete_ior_files {
for ($i = 0; $i < $nr_daemon; ++$i) {
$tg_daemons[$i]->DeleteFile ($iorbases[$i]);
}
$tg_naming->DeleteFile ($ior_nsbase);
$tg_exe_man->DeleteFile ($ior_embase);
for ($i = 0; $i < $nr_daemon; ++$i) {
$iorfiles[$i] = $tg_daemons[$i]->LocalFile ($iorbases[$i]);
}
}
sub kill_node_daemon {
for ($i = 0; $i < $nr_daemon; ++$i) {
$DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1);
}
}
sub kill_open_processes {
if ($daemons_running == 1) {
kill_node_daemon ();
}
if ($em_running == 1) {
$EM->Kill (); $EM->TimedWait (1);
}
if ($ns_running == 1) {
$NS->Kill (); $NS->TimedWait (1);
}
# in case shutdown did not perform as expected
$tg_executor->KillAll ('dance_locality_manager');
}
sub run_node_daemons {
for ($i = 0; $i < $nr_daemon; ++$i) {
$iorbase = $iorbases[$i];
$iorfile = $iorfiles[$i];
$port = $ports[$i];
$nodename = $nodenames[$i];
$iiop = "iiop://localhost:$port";
$node_app = $tg_daemons[$i]->GetArchDir("$DANCE_ROOT/bin/") . "dance_locality_manager";
$cmd_server_args = "--server-args '\"-ORBSvcConfDirective\" \"static Resource_Factory \\'-ORBConnectionCacheMax 33\\'\"'";
$d_cmd = "$DANCE_ROOT/bin/dance_node_manager";
$d_param = "-ORBEndpoint $iiop -s $node_app -n $nodename=$iorfile -t 30 --domain-nc corbaloc:rir:/NameService $cmd_server_args";
print "Run dance_node_manager with $d_param\n";
$DEAMONS[$i] = $tg_daemons[$i]->CreateProcess ($d_cmd, $d_param);
$DEAMONS[$i]->Spawn ();
if ($tg_daemons[$i]->WaitForFileTimed($iorbase,
$tg_daemons[$i]->ProcessStartWaitInterval ()) == -1) {
print STDERR
"ERROR: The ior $iorfile file of node daemon $i could not be found\n";
for (; $i >= 0; --$i) {
$DEAMONS[$i]->Kill (); $DEAMONS[$i]->TimedWait (1);
}
return -1;
}
}
return 0;
}
create_targets ();
init_ior_files ();
# Invoke naming service
$NS = $tg_naming->CreateProcess ("$TAO_ROOT/orbsvcs/Naming_Service/tao_cosnaming", " -ORBEndpoint iiop://localhost:60003 -o $ior_nsfile");
print STDERR "Starting Naming Service with -ORBEndpoint iiop://localhost:60003 -o ns.ior\n";
$ns_status = $NS->Spawn ();
if ($ns_status != 0) {
print STDERR "ERROR: Unable to execute the naming service\n";
kill_open_processes ();
exit 1;
}
if ($tg_naming->WaitForFileTimed ($ior_nsbase,
$tg_naming->ProcessStartWaitInterval ()) == -1) {
print STDERR "ERROR: cannot find naming service IOR file\n";
$NS->Kill (); $NS->TimedWait (1);
exit 1;
}
$ns_running = 1;
# Set up NamingService environment
$ENV{"NameServiceIOR"} = "corbaloc:iiop:localhost:60003/NameService";
# Invoke node daemon.
print "Invoking node daemon\n";
$status = run_node_daemons ();
if ($status != 0) {
print STDERR "ERROR: Unable to execute the node daemon\n";
kill_open_processes ();
exit 1;
}
$daemons_running = 1;
# Invoke execution manager.
print "Invoking execution manager (dance_execution_manager.exe) with -e$ior_emfile\n";
$EM = $tg_exe_man->CreateProcess ("$DANCE_ROOT/bin/dance_execution_manager",
"-e$ior_emfile --domain-nc corbaloc:rir:/NameService");
$em_status = $EM->Spawn ();
if ($em_status != 0) {
print STDERR "ERROR: dance_execution_manager returned $em_status";
exit 1;
}
if ($tg_exe_man->WaitForFileTimed ($ior_embase,
$tg_exe_man->ProcessStartWaitInterval ()) == -1) {
print STDERR
"ERROR: The ior file of execution manager could not be found\n";
kill_open_processes ();
exit 1;
}
$em_running = 1;
# Invoke executor - start the application -.
print "Invoking executor - launch the application -\n";
print "Start dance_plan_launcher.exe with -x $cdp_file -k file://$ior_emfile\n";
$E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
"-x $cdp_file -k file://$ior_emfile");
$pl_status = $E->SpawnWaitKill (2 * $tg_executor->ProcessStartWaitInterval ());
if ($pl_status != 0) {
print STDERR "ERROR: dance_plan_launcher returned $pl_status\n";
kill_open_processes ();
exit 1;
}
for ($i = 0; $i < $nr_daemon; ++$i) {
if ($tg_daemons[$i]->WaitForFileTimed ($iorbases[$i],
$tg_daemons[$i]->ProcessStopWaitInterval ()) == -1) {
print STDERR "ERROR: The ior file of daemon $i could not be found\n";
kill_open_processes ();
exit 1;
}
}
print "Sleeping 10 seconds to allow task to complete\n";
sleep (10);
# Invoke executor - stop the application -.
print "Invoking executor - stop the application -\n";
print "by running dance_plan_launcher.exe with -k file://$ior_emfile -x $cdp_file\n";
$E = $tg_executor->CreateProcess ("$DANCE_ROOT/bin/dance_plan_launcher",
"-k file://$ior_emfile -x $cdp_file -s");
$pl_status = $E->SpawnWaitKill ($tg_executor->ProcessStartWaitInterval ());
if ($pl_status != 0) {
print STDERR "ERROR: dance_plan_launcher returned $pl_status\n";
kill_open_processes ();
exit 1;
}
print "Executor returned.\n";
print "Shutting down rest of the processes.\n";
delete_ior_files ();
kill_open_processes ();
exit $status;
| 29.753036 | 138 | 0.613417 |
73ef3e7e22f0068163dd695a34075a3bd0a65aa2 | 4,585 | pm | Perl | auto-lib/Paws/ServiceDiscovery/DiscoverInstances.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 164 | 2015-01-08T14:58:53.000Z | 2022-02-20T19:16:24.000Z | auto-lib/Paws/ServiceDiscovery/DiscoverInstances.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 348 | 2015-01-07T22:08:38.000Z | 2022-01-27T14:34:44.000Z | auto-lib/Paws/ServiceDiscovery/DiscoverInstances.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 87 | 2015-04-22T06:29:47.000Z | 2021-09-29T14:45:55.000Z |
package Paws::ServiceDiscovery::DiscoverInstances;
use Moose;
has HealthStatus => (is => 'ro', isa => 'Str');
has MaxResults => (is => 'ro', isa => 'Int');
has NamespaceName => (is => 'ro', isa => 'Str', required => 1);
has OptionalParameters => (is => 'ro', isa => 'Paws::ServiceDiscovery::Attributes');
has QueryParameters => (is => 'ro', isa => 'Paws::ServiceDiscovery::Attributes');
has ServiceName => (is => 'ro', isa => 'Str', required => 1);
use MooseX::ClassAttribute;
class_has _api_call => (isa => 'Str', is => 'ro', default => 'DiscoverInstances');
class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::ServiceDiscovery::DiscoverInstancesResponse');
class_has _result_key => (isa => 'Str', is => 'ro');
1;
### main pod documentation begin ###
=head1 NAME
Paws::ServiceDiscovery::DiscoverInstances - Arguments for method DiscoverInstances on L<Paws::ServiceDiscovery>
=head1 DESCRIPTION
This class represents the parameters used for calling the method DiscoverInstances on the
L<AWS Cloud Map|Paws::ServiceDiscovery> service. Use the attributes of this class
as arguments to method DiscoverInstances.
You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to DiscoverInstances.
=head1 SYNOPSIS
my $servicediscovery = Paws->service('ServiceDiscovery');
my $DiscoverInstancesResponse = $servicediscovery->DiscoverInstances(
NamespaceName => 'MyNamespaceName',
ServiceName => 'MyServiceName',
HealthStatus => 'HEALTHY', # OPTIONAL
MaxResults => 1, # OPTIONAL
OptionalParameters => {
'MyAttrKey' => 'MyAttrValue', # key: max: 255, value: max: 1024
}, # OPTIONAL
QueryParameters => {
'MyAttrKey' => 'MyAttrValue', # key: max: 255, value: max: 1024
}, # OPTIONAL
);
# Results:
my $Instances = $DiscoverInstancesResponse->Instances;
# Returns a L<Paws::ServiceDiscovery::DiscoverInstancesResponse> object.
Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/servicediscovery/DiscoverInstances>
=head1 ATTRIBUTES
=head2 HealthStatus => Str
The health status of the instances that you want to discover. This
parameter is ignored for services that don't have a health check
configured, and all instances are returned.
=over
=item HEALTHY
Returns healthy instances.
=item UNHEALTHY
Returns unhealthy instances.
=item ALL
Returns all instances.
=item HEALTHY_OR_ELSE_ALL
Returns healthy instances, unless none are reporting a healthy state.
In that case, return all instances. This is also called failing open.
=back
Valid values are: C<"HEALTHY">, C<"UNHEALTHY">, C<"ALL">, C<"HEALTHY_OR_ELSE_ALL">
=head2 MaxResults => Int
The maximum number of instances that you want Cloud Map to return in
the response to a C<DiscoverInstances> request. If you don't specify a
value for C<MaxResults>, Cloud Map returns up to 100 instances.
=head2 B<REQUIRED> NamespaceName => Str
The C<HttpName> name of the namespace. It's found in the
C<HttpProperties> member of the C<Properties> member of the namespace.
=head2 OptionalParameters => L<Paws::ServiceDiscovery::Attributes>
Opportunistic filters to scope the results based on custom attributes.
If there are instances that match both the filters specified in both
the C<QueryParameters> parameter and this parameter, all of these
instances are returned. Otherwise, the filters are ignored, and only
instances that match the filters that are specified in the
C<QueryParameters> parameter are returned.
=head2 QueryParameters => L<Paws::ServiceDiscovery::Attributes>
Filters to scope the results based on custom attributes for the
instance (for example, C<{version=v1, az=1a}>). Only instances that
match all the specified key-value pairs are returned.
=head2 B<REQUIRED> ServiceName => Str
The name of the service that you specified when you registered the
instance.
=head1 SEE ALSO
This class forms part of L<Paws>, documenting arguments for method DiscoverInstances in L<Paws::ServiceDiscovery>
=head1 BUGS and CONTRIBUTIONS
The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
=cut
| 32.062937 | 249 | 0.724755 |
edc21c208e0e18cb2a25f78c6c55c0cb2ee119d8 | 7,023 | pm | Perl | lib/Neo4j/Types.pm | johannessen/neo4j-types | 81a181f24aa55851e3764cd95adccb71549c4369 | [
"Artistic-2.0"
] | 1 | 2021-02-24T00:04:26.000Z | 2021-02-24T00:04:26.000Z | lib/Neo4j/Types.pm | johannessen/neo4j-types | 81a181f24aa55851e3764cd95adccb71549c4369 | [
"Artistic-2.0"
] | null | null | null | lib/Neo4j/Types.pm | johannessen/neo4j-types | 81a181f24aa55851e3764cd95adccb71549c4369 | [
"Artistic-2.0"
] | null | null | null | use strict;
use warnings;
package Neo4j::Types;
# ABSTRACT: Common Neo4j type system
use Neo4j::Types::Node;
use Neo4j::Types::Path;
use Neo4j::Types::Point;
use Neo4j::Types::Relationship;
1;
__END__
=head1 SYNOPSIS
# direct use
$node = bless $data, 'Neo4j::Types::Node';
# indirect use
$node = bless $data, 'Local::Node';
package Local::Node;
use parent 'Neo4j::Types::Node';
# override methods as required
=head1 DESCRIPTION
The packages in this distribution offer a Neo4j type system for Perl.
Other distributions for the Neo4j ecosystem such as L<Neo4j::Bolt>
and L<Neo4j::Driver> can (if they so choose) use these packages
either directly or indirectly.
If several such distributions share the same representation of Neo4j
values, sharing data between distributions becomes more efficient and
users may have an easier time alternating between them.
Packages in this distribution primarily define methods. They do not
currently make any particular assumptions about their internal data
structures. This distribution offers default implementations of the
methods it defines; these are designed to work with L<Neo4j::Bolt>
data structures. But inheritors (such as C<Local::Node> in the
synopsis example) are free to use any data structure they like,
provided they override methods as required to not change the API.
The methods defined by this distribution are loosely modelled
on the Neo4j Driver API. They don't match that API precisely
because the official Neo4j drivers don't always use the exact
same method names for their functionality, and the
L<Neo4j Driver API Spec|https://7687.org/driver_api/driver-api-specification.html>
currently doesn't discuss these methods.
The module L<Neo4j::Types> itself currently only contains
documentation, but you can C<use> it as a shortcut to make all
modules that are included in this distribution available to you.
=head1 CYPHER TYPES
The Neo4j Cypher Manual mentions a variety of types. This section
discusses typical ways to implement these in Perl.
=head2 Composite types
Composite types are:
=over
=item * List
=item * Map (also known as Dictionary)
=back
In Perl, these types match simple unblessed array and hash
references very nicely.
=head2 Node, Relationship, Path
Neo4j structural types may be represented as:
=over
=item * L<Neo4j::Types::Node>
=item * L<Neo4j::Types::Relationship>
=item * L<Neo4j::Types::Path>
=back
=head2 Scalar types
Values of the following types can in principle be stored as a Perl
scalar. However, Perl scalars by themselves cannot cleanly separate
between all of these types. This can make it difficult to convert
scalars back to Cypher types (for example for the use in Cypher
statements parameters).
=over
=item Number (Integer or Float)
Both Neo4j and Perl internally distinguish between integer numbers
and floating-point numbers. Neo4j stores these as Java C<long> and
C<double>, which both are signed 64-bit types. In Perl, their
precision is whatever was used by the C compiler to build your
Perl executable (usually 64-bit types as well on modern systems).
Both Neo4j and Perl will automatically convert integers to floats
to calculate an expression if necessary (like for C<1 + 0.5>), so
the distinction between integers and floats often doesn't matter.
However, integers and floats are both just scalars in Perl, which
may make it difficult to create a float with an integer value in
Neo4j (for example, trying to store C<$a = 2.0 + 1> as a property
may result in the integer C<3> being stored in Neo4j).
L<perlnumber> explains further details on type conversions in Perl.
In particular, Perl will also try to automatically convert between
strings and numbers, but Neo4j will not. This may have unintended
consequences, as the following example demonstrates.
$id = get_id_from_node($node); # returns an integer
say "The ID is $id."; # silently turns $id into a string
$node = get_node_by_id($id); # fails: ID must be integer
This latter situation may be solved by using unary coercions.
$string = "$number";
$number = 0 + $string;
In the future, the L<Neo4j::Types> distribution might be extended
to offer ways to better handle the issues described in this section.
=item String
Perl scalars are a good match for Neo4j strings. However, in some
situations, scalar strings may easily be confused with numbers or
byte arrays in Perl.
Neo4j strings are always encoded in UTF-8. Perl supports this as
well (though string scalars that only contain ASCII are usually
not treated as UTF-8 internally for efficiency reasons).
=item Boolean
Perl does not have a native boolean data type. It's trivial to
map from Cypher booleans to truthy or non-truthy Perl scalars,
but the reverse is difficult without additional information.
There are a multitude of modules on CPAN that try to solve
this problem, including L<boolean>, L<Types::Bool>, and
L<Types::Serialiser>. Among them, L<JSON::PP::Boolean> has
the advantage that it has long been in Perl CORE.
=item Null
The Cypher C<null> value can be neatly implemented as Perl C<undef>.
=item Byte array
Byte arrays are not actually Cypher types, but still have some
limited support as pass-through values in Neo4j. In Perl, byte
arrays are most efficiently represented as string scalars with
their C<UTF8> flag turned off (though there may be some gotchas;
see L<perlguts/"Working with SVs"> for details).
However, it usually isn't possible to determine whether such a
scalar actually is supposed to be a byte array or a string; see
L<perlguts/"How can I recognise a UTF-8 string?">. In the future,
the L<Neo4j::Types> distribution might be extended to offer ways
to handle this.
=back
=head2 Spatial types
The only spatial type currently offered by Neo4j is the point.
It may be represented as L<Neo4j::Types::Point>.
It might be possible to (crudely) represent other spatial types by
using a list of points plus external metadata, or in a Neo4j graph
by treating the graph itself as a spatial representation.
The coordinate reference systems of spatial points in Neo4j are
currently severely constrained. There is no way to tag points with
the CRS they actually use, and for geographic coordinates (lat/lon),
only a single, subtly non-standard CRS is even supported. For uses
that don't require the spatial functions that Neo4j offers, it might
be best to eschew the point type completely and store coordinate
pairs as a simple list in the Neo4j database instead.
=head2 Temporal types
Cypher temporal types include: Date, Time, LocalTime, DateTime,
LocalDateTime, and Duration.
This distribution currently does not handle dates, times, or
durations. It is suggested to use the existing packages L<DateTime>
and L<DateTime::Duration>.
=head1 SEE ALSO
=over
=item * L<Neo4j::Bolt/"Return Types">
=item * L<Neo4j::Driver::Record/"get">
=item * L<REST::Neo4p::Entity>
=item * L<"Values and types" in Neo4j Cypher Manual|https://neo4j.com/docs/cypher-manual/current/syntax/values/>
=back
=cut
| 32.215596 | 112 | 0.776306 |
ed6c1b2dcd31fb4669345269709b364d6ca0542b | 16,936 | pl | Perl | nixos/modules/installer/tools/nixos-generate-config.pl | zgraggen/public-nixpkgs | 564d1fff9fed0ce885b43a9b59394d94fb8006ab | [
"MIT"
] | null | null | null | nixos/modules/installer/tools/nixos-generate-config.pl | zgraggen/public-nixpkgs | 564d1fff9fed0ce885b43a9b59394d94fb8006ab | [
"MIT"
] | null | null | null | nixos/modules/installer/tools/nixos-generate-config.pl | zgraggen/public-nixpkgs | 564d1fff9fed0ce885b43a9b59394d94fb8006ab | [
"MIT"
] | null | null | null | #! @perl@
use strict;
use Cwd 'abs_path';
use File::Spec;
use File::Path;
use File::Basename;
use File::Slurp;
use File::stat;
sub uniq {
my %seen;
my @res = ();
foreach my $s (@_) {
if (!defined $seen{$s}) {
$seen{$s} = 1;
push @res, $s;
}
}
return @res;
}
sub runCommand {
my ($cmd) = @_;
open FILE, "$cmd 2>&1 |" or die "Failed to execute: $cmd\n";
my @ret = <FILE>;
close FILE;
return ($?, @ret);
}
# Process the command line.
my $outDir = "/etc/nixos";
my $rootDir = ""; # = /
my $force = 0;
my $noFilesystems = 0;
my $showHardwareConfig = 0;
for (my $n = 0; $n < scalar @ARGV; $n++) {
my $arg = $ARGV[$n];
if ($arg eq "--help") {
exec "man nixos-generate-config" or die;
}
elsif ($arg eq "--dir") {
$n++;
$outDir = $ARGV[$n];
die "$0: ‘--dir’ requires an argument\n" unless defined $outDir;
}
elsif ($arg eq "--root") {
$n++;
$rootDir = $ARGV[$n];
die "$0: ‘--root’ requires an argument\n" unless defined $rootDir;
$rootDir =~ s/\/*$//; # remove trailing slashes
}
elsif ($arg eq "--force") {
$force = 1;
}
elsif ($arg eq "--no-filesystems") {
$noFilesystems = 1;
}
elsif ($arg eq "--show-hardware-config") {
$showHardwareConfig = 1;
}
else {
die "$0: unrecognized argument ‘$arg’\n";
}
}
my @attrs = ();
my @kernelModules = ();
my @initrdKernelModules = ();
my @initrdAvailableKernelModules = ();
my @modulePackages = ();
my @imports;
sub debug {
return unless defined $ENV{"DEBUG"};
print STDERR @_;
}
my $cpuinfo = read_file "/proc/cpuinfo";
sub hasCPUFeature {
my $feature = shift;
return $cpuinfo =~ /^flags\s*:.* $feature( |$)/m;
}
# Detect the number of CPU cores.
my $cpus = scalar (grep {/^processor\s*:/} (split '\n', $cpuinfo));
# Virtualization support?
push @kernelModules, "kvm-intel" if hasCPUFeature "vmx";
push @kernelModules, "kvm-amd" if hasCPUFeature "svm";
# Look at the PCI devices and add necessary modules. Note that most
# modules are auto-detected so we don't need to list them here.
# However, some are needed in the initrd to boot the system.
my $videoDriver;
sub pciCheck {
my $path = shift;
my $vendor = read_file "$path/vendor"; chomp $vendor;
my $device = read_file "$path/device"; chomp $device;
my $class = read_file "$path/class"; chomp $class;
my $module;
if (-e "$path/driver/module") {
$module = basename `readlink -f $path/driver/module`;
chomp $module;
}
debug "$path: $vendor $device $class";
debug " $module" if defined $module;
debug "\n";
if (defined $module) {
# See the bottom of http://pciids.sourceforge.net/pci.ids for
# device classes.
if (# Mass-storage controller. Definitely important.
$class =~ /^0x01/ ||
# Firewire controller. A disk might be attached.
$class =~ /^0x0c00/ ||
# USB controller. Needed if we want to use the
# keyboard when things go wrong in the initrd.
$class =~ /^0x0c03/
)
{
push @initrdAvailableKernelModules, $module;
}
}
# broadcom STA driver (wl.ko)
# list taken from http://www.broadcom.com/docs/linux_sta/README.txt
if ($vendor eq "0x14e4" &&
($device eq "0x4311" || $device eq "0x4312" || $device eq "0x4313" ||
$device eq "0x4315" || $device eq "0x4327" || $device eq "0x4328" ||
$device eq "0x4329" || $device eq "0x432a" || $device eq "0x432b" ||
$device eq "0x432c" || $device eq "0x432d" || $device eq "0x4353" ||
$device eq "0x4357" || $device eq "0x4358" || $device eq "0x4359" ||
$device eq "0x4331" || $device eq "0x43a0" || $device eq "0x43b1"
) )
{
push @modulePackages, "config.boot.kernelPackages.broadcom_sta";
push @kernelModules, "wl";
}
# broadcom FullMac driver
# list taken from
# https://wireless.wiki.kernel.org/en/users/Drivers/brcm80211#brcmfmac
if ($vendor eq "0x14e4" &&
($device eq "0x43a3" || $device eq "0x43df" || $device eq "0x43ec" ||
$device eq "0x43d3" || $device eq "0x43d9" || $device eq "0x43e9" ||
$device eq "0x43ba" || $device eq "0x43bb" || $device eq "0x43bc" ||
$device eq "0xaa52" || $device eq "0x43ca" || $device eq "0x43cb" ||
$device eq "0x43cc" || $device eq "0x43c3" || $device eq "0x43c4" ||
$device eq "0x43c5"
) )
{
# we need e.g. brcmfmac43602-pcie.bin
push @imports, "<nixpkgs/nixos/modules/hardware/network/broadcom-43xx.nix>";
}
# Can't rely on $module here, since the module may not be loaded
# due to missing firmware. Ideally we would check modules.pcimap
# here.
push @attrs, "networking.enableIntel2200BGFirmware = true;" if
$vendor eq "0x8086" &&
($device eq "0x1043" || $device eq "0x104f" || $device eq "0x4220" ||
$device eq "0x4221" || $device eq "0x4223" || $device eq "0x4224");
push @attrs, "networking.enableIntel3945ABGFirmware = true;" if
$vendor eq "0x8086" &&
($device eq "0x4229" || $device eq "0x4230" ||
$device eq "0x4222" || $device eq "0x4227");
# Assume that all NVIDIA cards are supported by the NVIDIA driver.
# There may be exceptions (e.g. old cards).
# FIXME: do we want to enable an unfree driver here?
#$videoDriver = "nvidia" if $vendor eq "0x10de" && $class =~ /^0x03/;
}
foreach my $path (glob "/sys/bus/pci/devices/*") {
pciCheck $path;
}
push @attrs, "services.xserver.videoDrivers = [ \"$videoDriver\" ];" if $videoDriver;
# Idem for USB devices.
sub usbCheck {
my $path = shift;
my $class = read_file "$path/bInterfaceClass"; chomp $class;
my $subclass = read_file "$path/bInterfaceSubClass"; chomp $subclass;
my $protocol = read_file "$path/bInterfaceProtocol"; chomp $protocol;
my $module;
if (-e "$path/driver/module") {
$module = basename `readlink -f $path/driver/module`;
chomp $module;
}
debug "$path: $class $subclass $protocol";
debug " $module" if defined $module;
debug "\n";
if (defined $module) {
if (# Mass-storage controller. Definitely important.
$class eq "08" ||
# Keyboard. Needed if we want to use the
# keyboard when things go wrong in the initrd.
($class eq "03" && $protocol eq "01")
)
{
push @initrdAvailableKernelModules, $module;
}
}
}
foreach my $path (glob "/sys/bus/usb/devices/*") {
if (-e "$path/bInterfaceClass") {
usbCheck $path;
}
}
# Add the modules for all block and MMC devices.
foreach my $path (glob "/sys/class/{block,mmc_host}/*") {
my $module;
if (-e "$path/device/driver/module") {
$module = basename `readlink -f $path/device/driver/module`;
chomp $module;
push @initrdAvailableKernelModules, $module;
}
}
my $virt = `systemd-detect-virt`;
chomp $virt;
# Check if we're a VirtualBox guest. If so, enable the guest
# additions.
if ($virt eq "oracle") {
push @attrs, "virtualisation.virtualbox.guest.enable = true;"
}
# Likewise for QEMU.
if ($virt eq "qemu" || $virt eq "kvm" || $virt eq "bochs") {
push @imports, "<nixpkgs/nixos/modules/profiles/qemu-guest.nix>";
}
# Pull in NixOS configuration for containers.
if ($virt eq "systemd-nspawn") {
push @attrs, "boot.isContainer = true;";
}
# Provide firmware for devices that are not detected by this script,
# unless we're in a VM/container.
push @imports, "<nixpkgs/nixos/modules/installer/scan/not-detected.nix>"
if $virt eq "none";
# For a device name like /dev/sda1, find a more stable path like
# /dev/disk/by-uuid/X or /dev/disk/by-label/Y.
sub findStableDevPath {
my ($dev) = @_;
return $dev if substr($dev, 0, 1) ne "/";
return $dev unless -e $dev;
my $st = stat($dev) or return $dev;
foreach my $dev2 (glob("/dev/disk/by-uuid/*"), glob("/dev/mapper/*"), glob("/dev/disk/by-label/*")) {
my $st2 = stat($dev2) or next;
return $dev2 if $st->rdev == $st2->rdev;
}
return $dev;
}
# Generate the swapDevices option from the currently activated swap
# devices.
my @swaps = read_file("/proc/swaps");
shift @swaps;
my @swapDevices;
foreach my $swap (@swaps) {
$swap =~ /^(\S+)\s/;
next unless -e $1;
my $dev = findStableDevPath $1;
push @swapDevices, "{ device = \"$dev\"; }";
}
# Generate the fileSystems option from the currently mounted
# filesystems.
sub in {
my ($d1, $d2) = @_;
return $d1 eq $d2 || substr($d1, 0, length($d2) + 1) eq "$d2/";
}
my $fileSystems;
my %fsByDev;
foreach my $fs (read_file("/proc/self/mountinfo")) {
chomp $fs;
my @fields = split / /, $fs;
my $mountPoint = $fields[4];
next unless -d $mountPoint;
my @mountOptions = split /,/, $fields[5];
next if !in($mountPoint, $rootDir);
$mountPoint = substr($mountPoint, length($rootDir)); # strip the root directory (e.g. /mnt)
$mountPoint = "/" if $mountPoint eq "";
# Skip special filesystems.
next if in($mountPoint, "/proc") || in($mountPoint, "/dev") || in($mountPoint, "/sys") || in($mountPoint, "/run") || $mountPoint eq "/var/lib/nfs/rpc_pipefs";
next if $mountPoint eq "/var/setuid-wrappers";
# Skip the optional fields.
my $n = 6; $n++ while $fields[$n] ne "-"; $n++;
my $fsType = $fields[$n];
my $device = $fields[$n + 1];
my @superOptions = split /,/, $fields[$n + 2];
# Skip the read-only bind-mount on /nix/store.
next if $mountPoint eq "/nix/store" && (grep { $_ eq "rw" } @superOptions) && (grep { $_ eq "ro" } @mountOptions);
# Maybe this is a bind-mount of a filesystem we saw earlier?
if (defined $fsByDev{$fields[2]}) {
# Make sure this isn't a btrfs subvolume.
my $msg = `btrfs subvol show $rootDir$mountPoint`;
if ($? != 0 || $msg =~ /ERROR:/s) {
my $path = $fields[3]; $path = "" if $path eq "/";
my $base = $fsByDev{$fields[2]};
$base = "" if $base eq "/";
$fileSystems .= <<EOF;
fileSystems.\"$mountPoint\" =
{ device = \"$base$path\";
fsType = \"none\";
options = \[ \"bind\" \];
};
EOF
next;
}
}
$fsByDev{$fields[2]} = $mountPoint;
# We don't know how to handle FUSE filesystems.
if ($fsType eq "fuseblk" || $fsType eq "fuse") {
print STDERR "warning: don't know how to emit ‘fileSystem’ option for FUSE filesystem ‘$mountPoint’\n";
next;
}
# Is this a mount of a loopback device?
my @extraOptions;
if ($device =~ /\/dev\/loop(\d+)/) {
my $loopnr = $1;
my $backer = read_file "/sys/block/loop$loopnr/loop/backing_file";
if (defined $backer) {
chomp $backer;
$device = $backer;
push @extraOptions, "loop";
}
}
# Is this a btrfs filesystem?
if ($fsType eq "btrfs") {
my ($status, @id_info) = runCommand("btrfs subvol show $rootDir$mountPoint");
if ($status != 0 || join("", @id_info) =~ /ERROR:/) {
die "Failed to retrieve subvolume info for $mountPoint\n";
}
my @ids = join("", @id_info) =~ m/Subvolume ID:[ \t\n]*([^ \t\n]*)/;
if ($#ids > 0) {
die "Btrfs subvol name for $mountPoint listed multiple times in mount\n"
} elsif ($#ids == 0) {
my ($status, @path_info) = runCommand("btrfs subvol list $rootDir$mountPoint");
if ($status != 0) {
die "Failed to find $mountPoint subvolume id from btrfs\n";
}
my @paths = join("", @path_info) =~ m/ID $ids[0] [^\n]* path ([^\n]*)/;
if ($#paths > 0) {
die "Btrfs returned multiple paths for a single subvolume id, mountpoint $mountPoint\n";
} elsif ($#paths != 0) {
die "Btrfs did not return a path for the subvolume at $mountPoint\n";
}
push @extraOptions, "subvol=$paths[0]";
}
}
# Emit the filesystem.
$fileSystems .= <<EOF;
fileSystems.\"$mountPoint\" =
{ device = \"${\(findStableDevPath $device)}\";
fsType = \"$fsType\";
EOF
if (scalar @extraOptions > 0) {
$fileSystems .= <<EOF;
options = \[ ${\join " ", map { "\"" . $_ . "\"" } uniq(@extraOptions)} \];
EOF
}
$fileSystems .= <<EOF;
};
EOF
}
# Generate the hardware configuration file.
sub toNixStringList {
my $res = "";
foreach my $s (@_) {
$res .= " \"$s\"";
}
return $res;
}
sub toNixList {
my $res = "";
foreach my $s (@_) {
$res .= " $s";
}
return $res;
}
sub multiLineList {
my $indent = shift;
return " [ ]" if !@_;
my $res = "\n${indent}[ ";
my $first = 1;
foreach my $s (@_) {
$res .= "$indent " if !$first;
$first = 0;
$res .= "$s\n";
}
$res .= "$indent]";
return $res;
}
my $initrdAvailableKernelModules = toNixStringList(uniq @initrdAvailableKernelModules);
my $kernelModules = toNixStringList(uniq @kernelModules);
my $modulePackages = toNixList(uniq @modulePackages);
my $fsAndSwap = "";
if (!$noFilesystems) {
$fsAndSwap = "\n${fileSystems} ";
$fsAndSwap .= "swapDevices =" . multiLineList(" ", @swapDevices) . ";\n";
}
my $hwConfig = <<EOF;
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, ... }:
{
imports =${\multiLineList(" ", @imports)};
boot.initrd.availableKernelModules = [$initrdAvailableKernelModules ];
boot.kernelModules = [$kernelModules ];
boot.extraModulePackages = [$modulePackages ];
$fsAndSwap
nix.maxJobs = lib.mkDefault $cpus;
${\join "", (map { " $_\n" } (uniq @attrs))}}
EOF
if ($showHardwareConfig) {
print STDOUT $hwConfig;
} else {
$outDir = "$rootDir$outDir";
my $fn = "$outDir/hardware-configuration.nix";
print STDERR "writing $fn...\n";
mkpath($outDir, 0, 0755);
write_file($fn, $hwConfig);
# Generate a basic configuration.nix, unless one already exists.
$fn = "$outDir/configuration.nix";
if ($force || ! -e $fn) {
print STDERR "writing $fn...\n";
my $bootLoaderConfig = "";
if (-e "/sys/firmware/efi/efivars") {
$bootLoaderConfig = <<EOF;
# Use the gummiboot efi boot loader.
boot.loader.gummiboot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
EOF
} elsif ($virt ne "systemd-nspawn") {
$bootLoaderConfig = <<EOF;
# Use the GRUB 2 boot loader.
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
# Define on which hard drive you want to install Grub.
# boot.loader.grub.device = "/dev/sda";
EOF
}
write_file($fn, <<EOF);
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
$bootLoaderConfig
# networking.hostName = "nixos"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Select internationalisation properties.
# i18n = {
# consoleFont = "Lat2-Terminus16";
# consoleKeyMap = "us";
# defaultLocale = "en_US.UTF-8";
# };
# Set your time zone.
# time.timeZone = "Europe/Amsterdam";
# List packages installed in system profile. To search by name, run:
# \$ nix-env -qaP | grep wget
# environment.systemPackages = with pkgs; [
# wget
# ];
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable the X11 windowing system.
# services.xserver.enable = true;
# services.xserver.layout = "us";
# services.xserver.xkbOptions = "eurosign:e";
# Enable the KDE Desktop Environment.
# services.xserver.displayManager.kdm.enable = true;
# services.xserver.desktopManager.kde4.enable = true;
# Define a user account. Don't forget to set a password with ‘passwd’.
# users.extraUsers.guest = {
# isNormalUser = true;
# uid = 1000;
# };
# The NixOS release to be compatible with for stateful data such as databases.
system.stateVersion = "${\(qw(@nixosRelease@))}";
}
EOF
} else {
print STDERR "warning: not overwriting existing $fn\n";
}
}
# workaround for a bug in substituteAll
| 29.049743 | 162 | 0.584908 |
edb163a291693c125ee1db624297c9c720b33661 | 8,434 | pm | Perl | bng2/Perl2/MoleculeTypesList.pm | cjarmstrong97/bionetgen | 4f8c64cedd5698c0f6a64b3dc70ed7d6e67fac2b | [
"MIT"
] | 53 | 2015-03-15T20:33:36.000Z | 2022-02-25T12:07:26.000Z | bng2/Perl2/MoleculeTypesList.pm | cjarmstrong97/bionetgen | 4f8c64cedd5698c0f6a64b3dc70ed7d6e67fac2b | [
"MIT"
] | 85 | 2015-03-19T19:58:19.000Z | 2022-02-28T20:38:17.000Z | bng2/Perl2/MoleculeTypesList.pm | cjarmstrong97/bionetgen | 4f8c64cedd5698c0f6a64b3dc70ed7d6e67fac2b | [
"MIT"
] | 34 | 2015-05-02T23:46:57.000Z | 2021-12-22T19:35:58.000Z | # $Id: MoleculeTypesList.pm,v 1.4 2006/09/13 03:44:06 faeder Exp $
# List of MoleculeType objects
package MoleculeTypesList;
# pragmas
use strict;
use warnings;
no warnings 'redefine';
# Perl Modules
use Class::Struct;
use FindBin;
use lib $FindBin::Bin;
# BNG Modules
use MoleculeType;
use SpeciesGraph;
use Molecule;
struct MoleculeTypesList =>
{
MolTypes => '%',
StrictTyping => '$'
};
###
###
###
sub readString
{
my $mtl = shift;
my $entry = shift;
# Check if token is an index
# DEPRECATED as of BNG 2.2.6
if ($entry=~ s/^\s*(\d+)\s+//)
{
return "Leading index detected at '$entry'. This is deprecated as of BNG 2.2.6.";
}
# Remove leading label, if exists
if ($entry =~ s/^\s*(\w+)\s*:\s+//)
{
# Check label for leading number
my $label = $1;
if ($label =~ /^\d/) { return "Syntax error (label begins with a number) at '$label'."; }
}
# Next token is string for species graph
$entry =~ s/^\s*//;
my $mt = MoleculeType->new;
my $err = $mt->readString( \$entry, 1, '', $mtl );
if ($err) { return($err); }
if ($entry =~ /\S+/)
{
return "Syntax error in MoleculeType declaration";
}
# Check if type previously defined
if ( $mtl->MolTypes->{$mt->Name} )
{
$err = sprintf "Molecule type %s previously defined.", $mt->Name;
return $err;
}
# Create new MoleculeType entry
$mtl->MolTypes->{$mt->Name} = $mt;
return '';
}
###
###
###
sub getNumMolTypes
{
my $mtlist = shift;
return scalar keys %{$mtlist->MolTypes};
}
###
###
###
# get a copy of a moleculeTypesList, along with copies of all the moleculeTypes
sub copy
{
my $mtlist = shift;
my $mtlist_copy = MoleculeTypesList::new();
while ( my ($name,$mt) = each %{$mtlist->MolTypes} )
{
my $mt_copy = $mt->copy();
$mtlist_copy->MolTypes->{$mt_copy->Name} = $mt_copy;
}
$mtlist_copy->StrictTyping( $mtlist->StrictTyping );
return $mtlist_copy;
}
###
###
###
# add a moleculeType to the list
sub add
{
my $mtlist = shift;
my $mt = shift;
if ( exists $mtlist->MolTypes->{$mt->Name} )
{ # molecule type is already in list
return 0;
}
else
{ # add molecule type to list
$mtlist->MolTypes->{$mt->Name} = $mt;
return 1;
}
}
###
###
###
# find a moleculeType by name
sub findMoleculeType
{
my $mtl = shift;
my $name = shift;
my $mt = undef;
if ( exists $mtl->MolTypes->{$name} )
{
$mt = $mtl->MolTypes->{$name};
}
return $mt;
}
###
###
###
# Check whether Molecules in SpeciesGraph match declared types
# Set $params->{IsSpecies} to 1 to force all components to be
# declared with defined states (if states are defined for the component)
sub checkSpeciesGraph
{
my $mtl = shift;
my $sg = shift;
my $params = (@_) ? shift : '';
my $IsSpecies = (defined $params->{IsSpecies} ) ? $params->{IsSpecies} : 1;
my $AllowNewTypes = (defined $params->{AllowNewTypes}) ? $params->{AllowNewTypes} : 0;
foreach my $mol (@{$sg->Molecules})
{
my $mtype;
if ($mol->Name =~ /[*]/)
{
my $found_match=0;
# Handle mol names containing wildcards
foreach $mtype (keys %{$mtl->MolTypes})
{
next unless ($mol->Name =~ $mtype);
if ( $mtype->check($mol,$params) eq '' )
{
++$found_match;
}
unless ($found_match)
{
my $err = sprintf "Molecule string %s does not match any declared molecule types", $mol->toString();
return $err;
}
}
}
elsif ( $mtype = $mtl->MolTypes->{$mol->Name} )
{
# Validate against declared type
if ( my $err = $mtype->check($mol,$params) )
{
return $err;
}
}
else
{
# Type not found.
if ($AllowNewTypes)
{
#Define a new type
my $mtype= MoleculeType->new;
$mtype->add($mol);
$mtl->MolTypes->{$mol->Name} = $mtype;
}
else
{
my $err = sprintf "Molecule %s does not match any declared molecule types", $mol->toString();
#$err.= "\n".$mtl->writeBNGL();
return $err;
}
}
}
return '';
}
###
###
###
sub checkMolecule
{
my $mtl = shift @_;
my $mol = shift @_;
my $params = @_ ? shift @_ : {};
my $IsSpecies = exists $params->{IsSpecies} ? $params->{IsSpecies} : 1;
my $AllowNewTypes = exists $params->{AllowNewTypes} ? $params->{AllowNewTypes} : 0;
my $mtype;
if ( $mtype = $mtl->MolTypes->{$mol->Name} )
{
# Validate against declared type
if ( my $err = $mtype->check($mol,$params) )
{ return $err; }
}
else
{
# Type not found.
if ($AllowNewTypes)
{
# Define a new type
my $mtype = MoleculeType->new;
$mtype->add($mol);
$mtl->MolTypes->{$mol->Name} = $mtype;
}
else
{
my $err = sprintf "Molecule %s does not match any declared molecule types", $mol->toString();
return $err;
}
}
return '';
}
###
###
###
sub writeBNGL
{
my $mtlist = shift @_;
my $user_params = @_ ? shift @_ : { 'pretty_formatting'=>0 };
my $max_length = 0;
if ( $user_params->{pretty_formatting} )
{ # find longest molecule type string
while ( my ($name, $mt) = each %{$mtlist->MolTypes} )
{
my $string = $mt->toString();
$max_length = ( length $string > $max_length ) ? length $string : $max_length;
}
}
my $out = "begin molecule types\n";
my $index = 1;
# while ( my ($name, $mt) = each %{$mtlist->MolTypes} )
foreach my $key (sort keys %{$mtlist->MolTypes})
{
my $mt = $mtlist->MolTypes->{$key};
if ( $user_params->{pretty_formatting} )
{ # no molecule type index
$out .= ' ' . $mt->toString($max_length) . "\n";
}
else
{ # include index
$out .= sprintf "%5d %s\n", $index, $mt->toString();
}
++$index;
}
$out .= "end molecule types\n";
return $out;
}
#####
# information used to create speciestype object in sbml multi
#####
sub toSBMLMultiSpeciesType
{
my $mtl = shift @_;
my $sg = shift @_;
my $sid = shift @_;
my $indent = shift @_;
my $sbmlMultiSpeciesInfo_ref = shift @_;
my $speciesIdHash_ref = shift @_;
my $index = 1;
my $ostring = '';
my $mtype;
my $mid = '';
my $n_mol = scalar( @{ $sg->Molecules } );
# molecules can only contain speciestype instances so we dont have to worry about species-level feature type for now
$ostring .= $indent . "<multi:listOfSpeciesTypeInstances>\n";
foreach my $mol (@{$sg->Molecules})
{
if($mtype = $mtl->MolTypes->{$mol->Name}){
$mid = sprintf("%s_M%s", $sid, $index);
# if($n_mol > 1) {
# $mid = sprintf("%s_M%s", $sid, $index);
# }
# else{
# $mid = $sid;
# }
$ostring .= $mtype->toSBMLMultiSpeciesType($sid, $mid, $index, " ". $indent, $sbmlMultiSpeciesInfo_ref, $speciesIdHash_ref);
}
$index += 1;
}
$ostring .= $indent . "</multi:listOfSpeciesTypeInstances>\n";
return $ostring;
}
###
###
###
sub toXML
{
my $mtlist = shift;
my $indent = shift;
my $string = $indent."<ListOfMoleculeTypes>\n";
# loop over molecule types
foreach my $mname (sort keys %{$mtlist->MolTypes})
{
my $mt = $mtlist->MolTypes->{$mname};
$string .= $mt->toXML(" ".$indent);
}
$string .= $indent."</ListOfMoleculeTypes>\n";
return $string;
}
sub writeMDL
{
my $mtlist = shift;
my $indent = shift;
my $string = "";
# loop over molecule types
foreach my $mname (sort keys %{$mtlist->MolTypes})
{
my $mt = $mtlist->MolTypes->{$mname};
$string .= $indent.$mt->writeMDL()."\n";
}
return $string;
}
1;
| 20.92804 | 141 | 0.511145 |
ed4b2e4686c42729d4857995a10811fa6700f18d | 1,732 | pm | Perl | lib/PRC/Form/Settings/PersonalRepos.pm | kyzn/PRC | 7fccf2e31e9b7526af886438db7def3aa409bf3c | [
"MIT"
] | 8 | 2019-02-27T10:36:47.000Z | 2020-06-25T16:10:33.000Z | lib/PRC/Form/Settings/PersonalRepos.pm | kyzn/PRC | 7fccf2e31e9b7526af886438db7def3aa409bf3c | [
"MIT"
] | 50 | 2018-11-04T06:42:03.000Z | 2021-07-01T11:38:35.000Z | lib/PRC/Form/Settings/PersonalRepos.pm | Pull-Request-Club/PRC | 7fccf2e31e9b7526af886438db7def3aa409bf3c | [
"MIT"
] | 7 | 2018-11-04T06:03:01.000Z | 2021-04-18T03:17:56.000Z | package PRC::Form::Settings::PersonalRepos;
use HTML::FormHandler::Moose;
extends 'HTML::FormHandler';
with 'HTML::FormHandler::Field::Role::RequestToken';
use namespace::autoclean;
use PRC::Constants;
has '+widget_wrapper' => ( default => 'Bootstrap3' );
has 'user' => (
is => 'ro',
isa => 'Catalyst::Authentication::Store::DBIx::Class::User',
required => 1,
);
has_field '_token' => (
type => 'RequestToken',
);
has_field 'personal_repo_select' => (
type => 'Select',
label => 'Please check repositories that you want assigned
to contributors.<br>
Then click "Save Personal Repositories" button
at the bottom of the page.<br>
If you want to refresh the list, click "Reload
Personal Repositories" button.',
widget => 'CheckboxGroup',
multiple => 1,
);
sub options_personal_repo_select {
my ($self) = @_;
my $user = $self->user;
my @repos = $user->available_personal_repos;
return [] unless scalar @repos;
my @options = map {{
value => $_->github_id,
selected => $_->accepting_assignees,
name => $_->github_full_name,
url => $_->github_html_url,
lang => $_->github_language,
is_fork => $_->github_is_fork ? "Fork" : "",
issues => $_->github_open_issues_count,
stars => $_->github_stargazers_count,
forks => $_->github_forks_count,
}} sort {
(lc $a->github_full_name) cmp (lc $b->github_full_name)
} @repos;
return \@options;
}
has_field 'submit_personal_repos' => (
type => 'Submit',
value => 'Save Personal Repositories',
element_attr => { class => 'btn btn-success btn-block' },
);
__PACKAGE__->meta->make_immutable;
1;
| 27.492063 | 67 | 0.618938 |
eda4c530558325dfefee17e78f8ad6d2c8efd36e | 598 | pm | Perl | pdu-perl-api/Raritan/RPC/pdumodel/TransferSwitch_4_0_2/WaveformSample.pm | gregoa/raritan-pdu-json-rpc-sdk | 76df982462742b97b52872aa34630140f5df7e58 | [
"BSD-3-Clause"
] | 1 | 2021-04-29T23:04:17.000Z | 2021-04-29T23:04:17.000Z | pdu-perl-api/Raritan/RPC/pdumodel/TransferSwitch_4_0_2/WaveformSample.pm | gregoa/raritan-pdu-json-rpc-sdk | 76df982462742b97b52872aa34630140f5df7e58 | [
"BSD-3-Clause"
] | null | null | null | pdu-perl-api/Raritan/RPC/pdumodel/TransferSwitch_4_0_2/WaveformSample.pm | gregoa/raritan-pdu-json-rpc-sdk | 76df982462742b97b52872aa34630140f5df7e58 | [
"BSD-3-Clause"
] | 2 | 2020-06-20T16:21:23.000Z | 2021-09-28T19:04:44.000Z | # SPDX-License-Identifier: BSD-3-Clause
#
# Copyright 2020 Raritan Inc. All rights reserved.
#
# This file was generated by IdlC from TransferSwitch.idl.
use strict;
package Raritan::RPC::pdumodel::TransferSwitch_4_0_2::WaveformSample;
sub encode {
my ($in) = @_;
my $encoded = {};
$encoded->{'voltage'} = 1 * $in->{'voltage'};
$encoded->{'current'} = 1 * $in->{'current'};
return $encoded;
}
sub decode {
my ($agent, $in) = @_;
my $decoded = {};
$decoded->{'voltage'} = $in->{'voltage'};
$decoded->{'current'} = $in->{'current'};
return $decoded;
}
1;
| 21.357143 | 69 | 0.598662 |
73dee3d8446a3f6c3fee255c08d9678b069d63c5 | 1,739 | pm | Perl | auto-lib/Paws/Schemas/CreateSchemaInput.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 164 | 2015-01-08T14:58:53.000Z | 2022-02-20T19:16:24.000Z | auto-lib/Paws/Schemas/CreateSchemaInput.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 348 | 2015-01-07T22:08:38.000Z | 2022-01-27T14:34:44.000Z | auto-lib/Paws/Schemas/CreateSchemaInput.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 87 | 2015-04-22T06:29:47.000Z | 2021-09-29T14:45:55.000Z | # Generated by default/object.tt
package Paws::Schemas::CreateSchemaInput;
use Moose;
has Content => (is => 'ro', isa => 'Str', required => 1);
has Description => (is => 'ro', isa => 'Str');
has Tags => (is => 'ro', isa => 'Paws::Schemas::Tags', request_name => 'tags', traits => ['NameInRequest']);
has Type => (is => 'ro', isa => 'Str', required => 1);
1;
### main pod documentation begin ###
=head1 NAME
Paws::Schemas::CreateSchemaInput
=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::Schemas::CreateSchemaInput object:
$service_obj->Method(Att1 => { Content => $value, ..., Type => $value });
=head3 Results returned from an API call
Use accessors for each attribute. If Att1 is expected to be an Paws::Schemas::CreateSchemaInput object:
$result = $service_obj->Method(...);
$result->Att1->Content
=head1 DESCRIPTION
This class has no description
=head1 ATTRIBUTES
=head2 B<REQUIRED> Content => Str
The source of the schema definition.
=head2 Description => Str
A description of the schema.
=head2 Tags => L<Paws::Schemas::Tags>
Tags associated with the schema.
=head2 B<REQUIRED> Type => Str
The type of schema.
=head1 SEE ALSO
This class forms part of L<Paws>, describing an object used in L<Paws::Schemas>
=head1 BUGS and CONTRIBUTIONS
The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
=cut
| 22.584416 | 110 | 0.702703 |
edcd5c594fb11c27b54a95f99d2e490abd452f3d | 1,385 | pm | Perl | t/lib/Test/Schema/Album.pm | Altreus/JSON-Schema-Mapper | 058b01167c26ce431e00e8dea9ef61a5f0bbbefb | [
"BSD-3-Clause"
] | 1 | 2020-06-19T07:05:10.000Z | 2020-06-19T07:05:10.000Z | t/lib/Test/Schema/Album.pm | Altreus/JSON-Schema-Mapper | 058b01167c26ce431e00e8dea9ef61a5f0bbbefb | [
"BSD-3-Clause"
] | null | null | null | t/lib/Test/Schema/Album.pm | Altreus/JSON-Schema-Mapper | 058b01167c26ce431e00e8dea9ef61a5f0bbbefb | [
"BSD-3-Clause"
] | null | null | null | package Test::Schema::Album;
use Moose;
with 'JSON::Schema::Mapper';
use List::Util 'sum';
sub _json_schema {
+{
title => 'Album',
properties => {
name => 'string',
artist => {
properties => {
name => 'string',
wikipedia => {
type => 'string',
format => 'uri',
},
}
},
name => 'string',
year => 'number',
}
}
}
sub _map {
+{
title => 'name',
artist => {
artist => {
name => 'name',
wikipedia_url => 'wikipedia',
},
},
tracks => {
tracks => [{
title => 'title',
duration => sub {
my ($obj, $field) = @_;
my $runtime = $obj->$field;
my $s = $runtime % 60;
$runtime -= $s;
$runtime /= 60;
my $m = $runtime % 60;
$runtime -= $m;
$runtime /= 60;
# Probably never going to use hours in this test.
return ($field, sprintf '%d:%02d', $m, $s);
}
}],
},
year => 'year'
}
}
| 23.474576 | 69 | 0.310469 |
edbaec92207014f7439ff174fb4a4cfa75fdc4b0 | 4,924 | pm | Perl | lib/Neo4j/Bolt.pm | majensen/perlbolt | 86a2658e36a84001c0a1f1321fd0c04d6e1e8b0e | [
"Apache-2.0"
] | 4 | 2020-02-23T04:38:29.000Z | 2022-01-10T03:05:28.000Z | lib/Neo4j/Bolt.pm | majensen/perlbolt | 86a2658e36a84001c0a1f1321fd0c04d6e1e8b0e | [
"Apache-2.0"
] | 43 | 2019-01-11T21:18:44.000Z | 2022-03-21T22:51:28.000Z | lib/Neo4j/Bolt.pm | majensen/perlbolt | 86a2658e36a84001c0a1f1321fd0c04d6e1e8b0e | [
"Apache-2.0"
] | 2 | 2019-01-11T19:33:11.000Z | 2021-09-07T17:36:00.000Z | package Neo4j::Bolt;
use Cwd qw/realpath getcwd/;
BEGIN {
our $VERSION = "0.4203";
require Neo4j::Bolt::Cxn;
require Neo4j::Bolt::Txn;
require Neo4j::Bolt::ResultStream;
require Neo4j::Bolt::CTypeHandlers;
require XSLoader;
XSLoader::load();
}
our $DEFAULT_DB = "neo4j";
sub connect {
$_[0]->connect_( $_[1], $_[2] // 0, 0, "", "", "", "" );
}
sub connect_tls {
my $self = shift;
my ($url, $tls) = @_;
unless ($tls && (ref($tls) == 'HASH')) {
die "Arg 1 should URL and Arg 2 a hashref with keys 'ca_dir','ca_file','pk_file','pk_pass'"
}
my %default_ca = ();
eval {
require IO::Socket::SSL;
%default_ca = IO::Socket::SSL::default_ca();
};
eval {
require Mozilla::CA;
$default_ca{SSL_ca_file} = Mozilla::CA::SSL_ca_file();
} unless %default_ca;
return $self->connect_(
$url,
$tls->{timeout},
1, # encrypt
$tls->{ca_dir} // $default_ca{SSL_ca_path} // "",
$tls->{ca_file} // $default_ca{SSL_ca_file} // "",
$tls->{pk_file} || "",
$tls->{pk_pass} || ""
);
}
=head1 NAME
Neo4j::Bolt - query Neo4j using Bolt protocol
=for markdown [](https://travis-ci.org/majensen/perlbolt)
=head1 SYNOPSIS
use Neo4j::Bolt;
$cxn = Neo4j::Bolt->connect("bolt://localhost:7687");
$stream = $cxn->run_query(
"MATCH (a) RETURN head(labels(a)) as lbl, count(a) as ct",
{} # parameter hash required
);
@names = $stream->field_names;
while ( my @row = $stream->fetch_next ) {
print "For label '$row[0]' there are $row[1] nodes.\n";
}
$stream = $cxn->run_query(
"MATCH (a) RETURN labels(a) as lbls, count(a) as ct",
{} # parameter hash required
);
while ( my @row = $stream->fetch_next ) {
print "For label set [".join(',',@{$row[0]})."] there are $row[1] nodes.\n";
}
=head1 DESCRIPTION
L<Neo4j::Bolt> is a Perl wrapper around Chris Leishmann's excellent
L<libneo4j-client|https://github.com/cleishm/libneo4j-client> library
implementing the Neo4j L<Bolt|https://boltprotocol.org/> network
protocol. It uses Ingy's L<Inline::C> to do all the hard XS work.
=head2 Return Types
L<Neo4j::Bolt::ResultStream> returns rows resulting from queries made
via a L<Neo4j::Bolt::Cxn>. These rows are simple arrays of scalars and/or
references. These represent Neo4j types according to the following:
Neo4j type Perl representation
----- ---- ---- --------------
Null undef
Bool JSON::PP::Boolean (acts like 0 or 1)
Int scalar
Float scalar
String scalar
Bytes scalar
List arrayref
Map hashref
Node hashref (Neo4j::Bolt::Node)
Relationship hashref (Neo4j::Bolt::Relationship)
Path arrayref (Neo4j::Bolt::Path)
L<Nodes|Neo4j::Bolt::Node>, L<Relationships|Neo4j::Bolt::Relationship> and
L<Paths|Neo4j::Bolt::Path> are represented in the following formats:
# Node:
bless {
id => $node_id, labels => [$label1, $label2, ...],
properties => {prop1 => $value1, prop2 => $value2, ...}
}, 'Neo4j::Bolt::Node'
# Relationship:
bless {
id => $reln_id, type => $reln_type,
start => $start_node_id, end => $end_node_id,
properties => {prop1 => $value1, prop2 => $value2, ...}
}, 'Neo4j::Bolt::Relationship'
# Path:
bless [
$node1, $reln12, $node2, $reln23, $node3, ...
], 'Neo4j::Bolt::Path'
=head1 METHODS
=over
=item connect($url), connect_tls($url,$tls_hash)
Class method, connect to Neo4j server. The URL scheme must be C<'bolt'>, as in
$url = 'bolt://localhost:7687';
Returns object of type L<Neo4j::Bolt::Cxn>, which accepts Cypher queries and
returns a L<Neo4j::Bolt::ResultStream>.
To connect by SSL/TLS, use connect_tls, with a hashref with keys as follows
ca_dir => <path/to/dir/of/CAs
ca_file => <path/to/file/of/CAs
pk_file => <path/to/private/key.pm
pk_pass => <private/key.pm passphrase>
Example:
$cxn = Neo4j::Bolt->connect_tls('bolt://all-the-young-dudes.us:7687', { ca_cert => '/etc/ssl/cert.pem' });
When neither C<ca_dir> nor C<ca_file> are specified, an attempt will
be made to use the default trust store instead.
This requires L<IO::Socket::SSL> or L<Mozilla::CA> to be installed.
=item set_log_level($LEVEL)
When $LEVEL is set to one of the strings C<ERROR WARN INFO DEBUG> or C<TRACE>,
libneo4j-client native logger will emit log messages at or above the given
level, on STDERR.
Set to C<NONE> to turn off completely (the default).
=back
=head1 SEE ALSO
L<Neo4j::Bolt::Cxn>, L<Neo4j::Bolt::ResultStream>.
=head1 AUTHOR
Mark A. Jensen
CPAN: MAJENSEN
majensen -at- cpan -dot- org
=head1 CONTRIBUTORS
=over
=item Arne Johannessen (@johannessen)
=back
=head1 LICENSE
This software is Copyright (c) 2019-2021 by Mark A. Jensen.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
=cut
1;
| 25.915789 | 131 | 0.646629 |
edc5cbbf26e92b101f2614c4c91fe99d645c6ab6 | 1,340 | pm | Perl | storage/dell/fluidfs/snmp/plugin.pm | centreon-lab/centreon-plugins | 68096c697a9e1baf89a712674a193d9a9321503c | [
"Apache-2.0"
] | null | null | null | storage/dell/fluidfs/snmp/plugin.pm | centreon-lab/centreon-plugins | 68096c697a9e1baf89a712674a193d9a9321503c | [
"Apache-2.0"
] | null | null | null | storage/dell/fluidfs/snmp/plugin.pm | centreon-lab/centreon-plugins | 68096c697a9e1baf89a712674a193d9a9321503c | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2022 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package storage::dell::fluidfs::snmp::plugin;
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} = '1.0';
%{$self->{modes}} = (
'components' => 'storage::dell::fluidfs::snmp::mode::hardware',
'volume-usage' => 'storage::dell::fluidfs::snmp::mode::volumeusage',
);
return $self;
}
1;
__END__
=head1 PLUGIN DESCRIPTION
Check Dell FluidFS (Dell FS8600) in SNMP.
=cut
| 26.8 | 76 | 0.700746 |
ed8e3e82eac0cd4e4a7a9c8f6733bfe1e89c105f | 443 | pl | Perl | examples/ex2.pl | michal-josef-spacek/Dicom-File-Detect | 121ecba29c071c5245afbb73fc9975404ca9a1d4 | [
"BSD-2-Clause"
] | null | null | null | examples/ex2.pl | michal-josef-spacek/Dicom-File-Detect | 121ecba29c071c5245afbb73fc9975404ca9a1d4 | [
"BSD-2-Clause"
] | null | null | null | examples/ex2.pl | michal-josef-spacek/Dicom-File-Detect | 121ecba29c071c5245afbb73fc9975404ca9a1d4 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env perl
use strict;
use warnings;
use Dicom::File::Detect qw(dicom_detect_file);
# Arguments.
if (@ARGV < 1) {
print STDERR "Usage: $0 file\n";
exit 1;
}
my $file = $ARGV[0];
# Check file.
my $dcm_flag = dicom_detect_file($file);
# Print out.
if ($dcm_flag) {
print "File '$file' is DICOM file.\n";
} else {
print "File '$file' isn't DICOM file.\n";
}
# Output:
# Usage: dicom-detect-file file | 17.038462 | 49 | 0.604966 |
ed683bf53e346da5033eafe4c166491975004f3b | 2,174 | al | Perl | Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/SyncDepFldTransShptHdr.Codeunit.al | waldo1001/ALAppExtensions | 935155845bf45b631d1c34b6bcd5aec54308d50f | [
"MIT"
] | 337 | 2019-05-07T06:04:40.000Z | 2022-03-31T10:07:42.000Z | Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/SyncDepFldTransShptHdr.Codeunit.al | waldo1001/ALAppExtensions | 935155845bf45b631d1c34b6bcd5aec54308d50f | [
"MIT"
] | 14,850 | 2019-05-07T06:04:27.000Z | 2022-03-31T19:53:28.000Z | Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/SyncDepFldTransShptHdr.Codeunit.al | waldo1001/ALAppExtensions | 935155845bf45b631d1c34b6bcd5aec54308d50f | [
"MIT"
] | 374 | 2019-05-09T10:08:14.000Z | 2022-03-31T17:48:32.000Z | #if not CLEAN18
#pragma warning disable AL0432, AA0072
codeunit 31232 "Sync.Dep.Fld-TransShptHdr CZA"
{
Access = Internal;
[EventSubscriber(ObjectType::Table, Database::"Transfer Shipment Header", 'OnBeforeInsertEvent', '', false, false)]
local procedure SyncOnBeforeInsertTransferShipmentHeader(var Rec: Record "Transfer Shipment Header")
begin
SyncDeprecatedFields(Rec);
end;
[EventSubscriber(ObjectType::Table, Database::"Transfer Shipment Header", 'OnBeforeModifyEvent', '', false, false)]
local procedure SyncOnBeforeModifyTransferShipmentHeader(var Rec: Record "Transfer Shipment Header")
begin
SyncDeprecatedFields(Rec);
end;
local procedure SyncDeprecatedFields(var Rec: Record "Transfer Shipment Header")
var
PreviousRecord: Record "Transfer Shipment Header";
SyncDepFldUtilities: Codeunit "Sync.Dep.Fld-Utilities";
PreviousRecordRef: RecordRef;
DepFieldTxt, NewFieldTxt : Text;
begin
if SyncDepFldUtilities.GetPreviousRecord(Rec, PreviousRecordRef) then
PreviousRecordRef.SetTable(PreviousRecord);
DepFieldTxt := Rec."Gen. Bus. Post. Group Ship";
NewFieldTxt := Rec."Gen.Bus.Post.Group Ship CZA";
SyncDepFldUtilities.SyncFields(DepFieldTxt, NewFieldTxt, PreviousRecord."Gen. Bus. Post. Group Ship", PreviousRecord."Gen.Bus.Post.Group Ship CZA");
Rec."Gen. Bus. Post. Group Ship" := CopyStr(DepFieldTxt, 1, MaxStrLen(Rec."Gen. Bus. Post. Group Ship"));
Rec."Gen.Bus.Post.Group Ship CZA" := CopyStr(NewFieldTxt, 1, MaxStrLen(Rec."Gen.Bus.Post.Group Ship CZA"));
DepFieldTxt := Rec."Gen. Bus. Post. Group Receive";
NewFieldTxt := Rec."Gen.Bus.Post.Group Receive CZA";
SyncDepFldUtilities.SyncFields(DepFieldTxt, NewFieldTxt, PreviousRecord."Gen. Bus. Post. Group Receive", PreviousRecord."Gen.Bus.Post.Group Receive CZA");
Rec."Gen. Bus. Post. Group Receive" := CopyStr(DepFieldTxt, 1, MaxStrLen(Rec."Gen. Bus. Post. Group Receive"));
Rec."Gen.Bus.Post.Group Receive CZA" := CopyStr(NewFieldTxt, 1, MaxStrLen(Rec."Gen.Bus.Post.Group Receive CZA"));
end;
}
#endif | 51.761905 | 162 | 0.707912 |
ed9967293e12c91e47e5f7f95544b647773e146a | 4,727 | pl | Perl | projects/SATIrE/docs/pldoc/doc_access.pl | michihirohorie/edg4x-rose | 59775dad96db55159c65f9c05bc551ed3b2fe9ca | [
"BSD-3-Clause"
] | 488 | 2015-01-09T08:54:48.000Z | 2022-03-30T07:15:46.000Z | projects/SATIrE/docs/pldoc/doc_access.pl | michihirohorie/edg4x-rose | 59775dad96db55159c65f9c05bc551ed3b2fe9ca | [
"BSD-3-Clause"
] | 174 | 2015-01-28T18:41:32.000Z | 2022-03-31T16:51:05.000Z | projects/SATIrE/docs/pldoc/doc_access.pl | michihirohorie/edg4x-rose | 59775dad96db55159c65f9c05bc551ed3b2fe9ca | [
"BSD-3-Clause"
] | 146 | 2015-04-27T02:48:34.000Z | 2022-03-04T07:32:53.000Z | /* Part of SWI-Prolog
Author: Jan Wielemaker
E-mail: [email protected]
WWW: http://www.swi-prolog.org
Copyright (C): 2008, University of Amsterdam
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 library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
As a special exception, if you link this library with other files,
compiled with a Free Software compiler, to produce an executable, this
library does not by itself cause the resulting executable to be covered
by the GNU General Public License. This exception does not however
invalidate any other reasons why the executable file might be covered by
the GNU General Public License.
*/
:- module(doc_access,
[ host_access_options/2 % +AllOptions, -NoAccessOptions
]).
:- use_module(library(http/http_hook)).
:- use_module(library(http/dcg_basics)).
:- dynamic
can_edit/1,
allow_from/1,
deny_from/1.
% http:authenticate(+Type, +Request, -Extra) is semidet.
%
% PlDoc specific access control. The access control is based on
% these options that are passed from starting PlDoc. If PlDoc runs
% on top of an external dispatch loop, the predicate
% host_access_options/2 can be used to specify access rights.
%
% * allow(+IP)
% * deny(+IP)
% * edit(+Bool)
http:authenticate(pldoc(read), Request, []) :- !,
memberchk(peer(Peer), Request),
allowed_peer(Peer).
http:authenticate(pldoc(edit), Request, []) :- !,
( can_edit(false)
-> fail
; ( memberchk(x_forwarded_for(Forwarded), Request),
primary_forwarded_host(Forwarded, IPAtom),
parse_ip(IPAtom, Peer)
-> true
; memberchk(peer(Peer), Request)
),
match_peer(localhost, +, Peer)
).
%% host_access_options(+AllOptions, -NoAuthOptions) is det.
%
% Filter the authorization options from AllOptions, leaving the
% remaining options in NoAuthOptions.
host_access_options([], []).
host_access_options([H|T0], T) :-
host_access_option(H), !,
host_access_options(T0, T).
host_access_options([H|T0], [H|T]) :-
host_access_options(T0, T).
host_access_option(allow(From)) :-
assert(allow_from(From)).
host_access_option(deny(From)) :-
assert(deny_from(From)).
host_access_option(edit(Bool)) :-
assert(can_edit(Bool)).
%% match_peer(:RuleSet, +PlusMin, +Peer) is semidet.
%
% True if Peer is covered by the ruleset RuleSet. Peer is a term
% ip(A,B,C,D). RuleSet is a predicate with one argument that is
% either a partial ip term, a hostname or a domainname.
% Domainnames start with a '.'.
%
% @param PlusMin Positive/negative test. If IP->Host fails, a
% positive test fails, while a negative succeeds.
% I.e. deny('.com') succeeds for unknown IP
% addresses.
match_peer(Spec, _, Peer) :-
call(Spec, Peer), !.
match_peer(Spec, PM, Peer) :-
( call(Spec, HOrDom), atom(HOrDom)
-> ( catch(tcp_host_to_address(Host, Peer), E, true),
var(E)
-> call(Spec, HostOrDomain),
atom(HostOrDomain),
( sub_atom(HostOrDomain, 0, _, _, '.')
-> sub_atom(Host, _, _, 0, HostOrDomain)
; HostOrDomain == Host
)
; PM == (+)
-> !, fail
; true
)
).
%% allowed_peer(+Peer) is semidet.
%
% True if Peer is allowed according to the rules.
allowed_peer(Peer) :-
match_peer(deny_from, -, Peer), !,
match_peer(allow_from, +, Peer).
allowed_peer(Peer) :-
allow_from(_), !,
match_peer(allow_from, +, Peer).
allowed_peer(_).
:- dynamic
can_edit/1.
%% primary_forwarded_host(+Spec, -Host) is det.
%
% x_forwarded host contains multiple hosts seperated by ', ' if
% there are multiple proxy servers in between. The first one is
% the one the user's browser knows about.
primary_forwarded_host(Spec, Host) :-
sub_atom(Spec, B, _, _, ','), !,
sub_atom(Spec, 0, B, _, Host).
primary_forwarded_host(Host, Host).
localhost(ip(127,0,0,1)).
localhost(localhost).
parse_ip(Atom, IP) :-
atom_codes(Atom, Codes),
phrase(ip(IP), Codes).
%% ip(?IP)// is semidet.
%
% Parses A.B.C.D into ip(A,B,C,D)
ip(ip(A,B,C,D)) -->
integer(A), ".", integer(B), ".", integer(C), ".", integer(D).
| 29.54375 | 77 | 0.678866 |
ed7e3b7ac96f73e34cb4ad47be1375a74e350b52 | 14,257 | pl | Perl | bin/common.pl | aungphyopyaekyaw/gpstrack | 1a59330d84eae957e9487f22ed0c654653694faf | [
"Apache-2.0"
] | 4 | 2018-01-08T13:06:58.000Z | 2018-05-10T13:18:16.000Z | bin/common.pl | aungphyopyaekyaw/gpstrack | 1a59330d84eae957e9487f22ed0c654653694faf | [
"Apache-2.0"
] | null | null | null | bin/common.pl | aungphyopyaekyaw/gpstrack | 1a59330d84eae957e9487f22ed0c654653694faf | [
"Apache-2.0"
] | 3 | 2019-06-05T06:25:10.000Z | 2021-10-12T05:50:49.000Z | # -----------------------------------------------------------------------------
# Project: OpenGTS - Open GPS Tracking System
# URL : http://www.opengts.org
# File : common.pl
# -----------------------------------------------------------------------------
# Description:
# This Perl script is to be included in other Perl scripts and is not intended
# to be executed separately.
# -----------------------------------------------------------------------------
# Environment variables:
# OS [optional] The operating system indicator (ie. "Windows")
# GTS_HOME [required] OpenGTS installation directory (MUST be set)
# GTS_CONF [optional] Full path to OpenGTS runtime config file (ie. 'default.conf')
# GTS_CHARSET [optional] The character set used when starting up the Java proces
# GTS_DEBUG [optional] '1' for debug mode (echoes java command), blank/0 otherwise
# CATALINA_HOME [required] Tomcat installation directory
# CATALINA_BASE [optional] Tomcat installation directory
# DERBY_HOME [optional] Apache Derby installation directory
# JAVA_HOME [required] Java installation directory
# JAVA_MEMORY [optional] JRE memory specification
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# General command startup initialization:
# --- external
use Cwd 'realpath';
use File::Basename;
# --- constants
$true = 1;
$false = 0;
# --- Java path separator
$OS = $ENV{'OS'};
$IS_WINDOWS = ($OS =~ /^Windows/)? $true : $false;
$PATHSEP = $IS_WINDOWS? ";" : ":";
# --- project directories/packaged
$GTS_STD_DIR = "org/opengts";
$GTS_STD_PKG = "org.opengts";
$GTS_OPT_DIR = "org/opengts/opt";
$GTS_OPT_PKG = "org.opengts.opt";
# --- debug mode
$GTS_DEBUG = $ENV{'GTS_DEBUG'};
if ("$GTS_DEBUG" eq "") {
$GTS_DEBUG = 0;
}
# --- CATALINA_HOME
$CATALINA_HOME = $ENV{'CATALINA_HOME'};
$CATALINA_BASE = $ENV{'CATALINA_BASE'};
if ("$CATALINA_BASE" eq "") {
$CATALINA_BASE = $CATALINA_HOME;
}
# --- DERBY_HOME
$DERBY_HOME = $ENV{'DERBY_HOME'};
# --- character set
$GTS_CHARSET = $ENV{'GTS_CHARSET'};
if ("$GTS_CHARSET" ne "") {
$JAVA_CHARSET = "-Dfile.encoding=${GTS_CHARSET}";
} else {
$JAVA_CHARSET = "-Dfile.encoding=UTF-8";
#$JAVA_CHARSET = "-Dfile.encoding=ISO-8859-1";
}
# --- current directory
$PWD = &deblank(`pwd`);
$PWD_ = $PWD . "/";
# --- JAVA_HOME
$JAVA_HOME = $ENV{"JAVA_HOME"};
if ("$JAVA_HOME" eq "") {
print "JAVA_HOME not defined!\n";
}
if (($JAVA_HOME =~ / /) && !($JAVA_HOME =~ /^\"/)) { # && !($JAVA_HOME =~ /\\/))
# - contains embedded spaces, and is not already quoted/escaped
$JAVA_HOME = "\"$JAVA_HOME\""; # - quote for Windows
#$JAVA_HOME =~ s/ /\\ /g; # - escape for Linux
}
# --- memory
$ENV_JAVA_MEMORY = $ENV{"JAVA_MEMORY"};
if ("$ENV_JAVA_MEMORY" eq "") {
# --- JAVA_MEMORY not defined in environment variables
if (!defined($JAVA_MEMORY) || ("$JAVA_MEMORY" eq "")) {
# --- JAVA_MEMORY not already specified by parent script
$JAVA_MEMORY = "300m";
#print "Using default JAVA_MEMORY: ${JAVA_MEMORY}\n";
} else {
# --- JAVA_MEMORY already specified in parent script
#print "Using pre-specified JAVA_MEMORY: ${JAVA_MEMORY}\n";
}
} else {
# --- use JAVA_MEMORY from environment variables
$JAVA_MEMORY = "${ENV_JAVA_MEMORY}";
}
$JAVAMEM = "-Xmx${JAVA_MEMORY}";
# --- Java commands
$cmd_java = (-e "$JAVA_HOME/bin/java")? "$JAVA_HOME/bin/java" : &findCmd("java");
$cmd_java = "$cmd_java $JAVAMEM $JAVA_CHARSET";
#$cmd_jar = (-e "$JAVA_HOME/bin/jar" )? "$JAVA_HOME/bin/jar" : &findCmd("jar" );
$cmd_ant = &findCmd("ant" ,$false);
# --- other commands
$cmd_which = &findCmd("which",$true); # - used for determining a path of a command
$cmd_mkdir = &findCmd("mkdir",$true);
$cmd_cp = &findCmd("cp" ,$true);
$cmd_kill = &findCmd("kill" ,$true);
$cmd_cat = &findCmd("cat" ,$true);
$cmd_rm = &findCmd("rm" ,$true);
$cmd_ps = &findCmd("ps" ,$true);
$cmd_ls = &findCmd("ls" ,$true);
$cmd_uname = &findCmd("uname",$false);
$cmd_grep = &findCmd("grep" ,$false);
$cmd_sed = &findCmd("sed" ,$false);
$cmd_diff = &findCmd("diff" ,$false);
$cmd_date = &findCmd("date" ,$false);
$cmd_tr = &findCmd("tr" ,$false);
# --- Cygwin?
$UNAME = ($cmd_uname ne "")? `$cmd_uname` : ""; chomp $UNAME;
$IS_CYGWIN = ($UNAME =~ /^CYGWIN/)? $true : $false;
if ($IS_CYGWIN) {
$cmd_cygpath = &findCmd("cygpath",$true);
}
# --- Mac OSX?
$IS_MACOSX = ($UNAME =~ /^Darwin/)? $true : $false;
# --- "GTS_HOME" installation directory
# - "GTS_HOME" should already be defined, this just makes sure
if ("$GTS_HOME" eq "") {
$GTS_HOME = $ENV{"GTS_HOME"};
if ("$GTS_HOME" eq "") {
my $home = &getCommandPath($0) . "/..";
$GTS_HOME = realpath($home);
}
}
if ($IS_CYGWIN) {
$GTS_HOME = `$cmd_cygpath --mixed "$GTS_HOME"`; chomp $GTS_HOME;
}
if (($GTS_HOME =~ / /) && !($GTS_HOME =~ /^\"/)) { # && !($GTS_HOME =~ /\\/))
# - contains embedded spaces, and is not already quoted
$GTS_HOME = "\"$GTS_HOME\""; # - quote for Windows
#$GTS_HOME =~ s/ /\\ /g; # - escape for Linux
}
# --- "GTS_CONF" config file name
$GTS_CONF = $ENV{"GTS_CONF"};
if ("$GTS_CONF" eq "") {
my $conf = "$GTS_HOME/default.conf";
$GTS_CONF = $conf;
}
if ($IS_CYGWIN) {
$GTS_CONF = `$cmd_cygpath --mixed "$GTS_CONF"`; chomp $GTS_CONF;
}
if (($GTS_CONF =~ / /) && !($GTS_CONF =~ /^\"/)) { # && !($GTS_CONF =~ /\\/))
# - contains embedded spaces, and is not already quoted
$GTS_CONF = "\"$GTS_CONF\""; # - quote for Windows
#$GTS_CONF =~ s/ /\\ /g; # - escape for Linux
}
# --- JAR directory (modify for production environment)
$JARDIR = "$GTS_HOME/build/lib";
$SCAN_JARDIR_FOR_JARS = $false;
# --- Java classpath (return all jars found in ./build/lib
$CLASSPATH = "";
if ($SCAN_JARDIR_FOR_JARS) {
opendir(JARLIB_DIR, "$JARDIR");
my @JARLIB_LIST = readdir(JARLIB_DIR);
closedir(JARLIB_DIR);
foreach my $JARLIB_FILE (@JARLIB_LIST) {
if ($JARLIB_FILE =~ /.jar$/) {
# print "Found JAR: $JARLIB_FILE\n";
if (("$JARLIB_FILE" eq "dmtpserv.jar") || ("$JARLIB_FILE" eq "gtsdmtp.jar")) {
if ("$CLASSPATH" ne "") { $CLASSPATH .= $PATHSEP; }
$CLASSPATH .= "$JARDIR/$JARLIB_FILE";
}
elsif (("$JARLIB_FILE" eq "icare.jar") || ("$JARLIB_FILE" eq "template.jar")) {
# skip
} else {
if ("$CLASSPATH" ne "") { $CLASSPATH .= $PATHSEP; }
$CLASSPATH .= "$JARDIR/$JARLIB_FILE";
}
}
}
} else {
my @CJARS = (
"gtsdb.jar", # - GTS db tables & utilities
"gtsutils.jar", # - GTS utilities
"optdb.jar", # - optional GTS db tables & utilities
"ruledb.jar", # - optional RuleFactory support
"bcrossdb.jar", # - optional RuleFactory support
"custom.jar", # - custom code
"gtsdmtp.jar", # - GTS DMTP tables/support
"dmtpserv.jar", # - DMTP server
"ctrac.jar", # - ctracgts (not supported)
#"activation.jar", # - JavaMail [optional here]
#"mail.jar", # - JavaMail [optional here]
#"mysql-connector-java-3.1.7-bin.jar", # - MySQL JDBC [optional here]
);
foreach ( @CJARS ) {
if (-f "$JARDIR/$_") {
if ("$CLASSPATH" ne "") { $CLASSPATH .= $PATHSEP; }
$CLASSPATH .= "$JARDIR/$_";
}
}
}
if ("$CATALINA_HOME" ne "") {
# - DBCP - DB Connection Pooling
#if ("$CLASSPATH" ne "") { $CLASSPATH .= $PATHSEP; }
#$CLASSPATH .= "$CATALINA_HOME/common/lib/naming-factory-dbcp.jar";
}
if ("$DERBY_HOME" ne "") {
# -- embedded/network
if ("$CLASSPATH" ne "") { $CLASSPATH .= $PATHSEP; }
$CLASSPATH .= "$DERBY_HOME/lib/derbyrun.jar";
# -- network
#if ("$CLASSPATH" ne "") { $CLASSPATH .= $PATHSEP; }
#$CLASSPATH .= "$DERBY_HOME/lib/derbyclient.jar";
#if ("$CLASSPATH" ne "") { $CLASSPATH .= $PATHSEP; }
#$CLASSPATH .= "$DERBY_HOME/lib/derbytools.jar";
}
#print "CLASSPATH = $CLASSPATH\n";
# -----------------------------------------------------------------------------
# --- remove leading/trailing spaces
sub deblank(\$) {
my ($x) = @_;
$x =~ s/^[ \t\n\r]*//; # --- leading
$x =~ s/[ \t\n\r]*$//; # --- trailing
return $x;
}
# --- execute command
sub sysCmd(\$\$) {
my ($cmd, $verbose) = @_;
if ($verbose) { print "$cmd\n"; }
my $rtn = int(system("$cmd") / 256);
return $rtn;
}
# --- date string
sub getDateString() {
my ($s,$m,$h,$D,$M0,$Y,$WD,$YD,$dst) = localtime(time);
my $M1 = $M0 + 1;
my $date = sprintf("%04d/%02d/%02d %02d:%02d:%02d", ($Y + 1900), $M1, $D, $h, $m, $s);
return $date;
}
# --- fork and execute command
sub forkCmd(\$\$\$\$) {
my ($cmd, $outLog, $restartCode, $verbose) = @_;
if ($verbose) { print "$cmd\n"; }
my $pid = fork();
if ($pid == 0) {
# -- we are now in the subprocess
if ($outLog ne "") {
# - this is done this way to make sure that the 'exec' below
# - doesn't perform another 'fork'. Otherwise we would have
# - just included the redirection in the command string.
if (open(LOGOUT, ">>$outLog")) {
open(STDOUT, ">&LOGOUT"); # redirect stdout
open(STDERR, ">&LOGOUT"); # redirect stderr
} else {
print "ERROR: Unable to redirect STDOUT/STDERR!\n";
exit(99);
}
}
select(STDERR); $|=1;
select(STDOUT); $|=1;
if (($restartCode > 0) && ($restartCode <= 255)) {
my $exitCode = 0;
print "===================================================\n";
print "[".&getDateString()."] Starting command: $cmd\n";
for (;;) {
# - execute command
system("$cmd");
my $EC = $?;
if ($EC == -1) {
print "===================================================\n";
print "[".&getDateString()."] Command failed: $cmd\n";
exit(1);
}
# - check exit code
$exitCode = ($EC >> 8);
if ($exitCode != $restartCode) {
# - no restart
print "===================================================\n";
print "[".&getDateString()."] Command exit code=$exitCode ($EC)\n";
last;
}
# - restart
$dateStr = &getDateString();
print "===================================================\n";
print "[".&getDateString()."] Restarting command: $cmd\n";
}
exit($exitCode);
} else {
exec("$cmd"); # -- does not return if command was started successfully
exit(1); # -- only reaches here if the above 'exec' failed
}
# -- control does not reach here
}
return $pid;
}
# --- read from stdin
sub readStdin(\$) {
my ($msg) = @_;
print "$msg\n";
my $readIn = <>;
chomp $readIn; # --- remove trailing '\r'
return $readIn;
}
# --- find location of specified command
sub findCmd(\$\$) {
my ($cmdLine, $mustFind) = @_;
if ($cmdLine =~ /^\//) {
return $cmdLine; # - already absolute path
} else {
my @CPATH = (
"/sbin",
"/bin",
"/usr/bin",
"/use/local/bin",
"/mysql/bin", # --- laptop
# --- add directories as necessary
);
my @cmdArgs = split(' ', $cmdLine);
my $cmd = $cmdArgs[0];
foreach ( @CPATH ) {
if (-x "$_/$cmd") {
#print "Found: $_/$cmd\n";
$cmdArgs[0] = "$_/$cmd";
return join(' ', @cmdArgs);
}
}
#print "Not found: $cmd\n";
return $mustFind? "" : $cmdLine;
}
}
# --- return the absolute path of the specified command
sub getCommandPath(\$) {
my $cmd = $_[0];
if ("$cmd_which" ne "") {
my $c = `$cmd_which $cmd 2>/dev/null`;
chomp $c;
if ("$c" ne "") {
$cmd = $c;
}
}
return &getFilePath($cmd);
}
# --- return the path of the specified file
sub getFilePath(\$) {
my $x = $_[0];
my $abs = ($x =~ /^\//);
if ($x =~ /^(.*)\/(.*)$/) {
$x =~ s/^(.*)\/(.*)$/\1/;
if ($x ne "") {
return $x;
} else {
return "/";
}
}
return ".";
}
# --- return filename portion of a full file path
sub getFileName(\$) {
my ($x) = @_;
$x =~ s/^(.*)\/(.*)$/$2/;
return $x;
}
# --- return file extension portion of a full file path
sub getFileExtn(\$) {
my $x = $_[0];
my $ext = &getFileName($x);
$ext =~ s/^(.*)\.//;
return $ext;
}
# --- return property value
sub getPropertyString(\$) {
my $k = $_[0];
my $kv = `($cmd_grep '^$k' $GTS_CONF | $cmd_sed 's/^\\(.*\\)=//')`; chomp $kv;
return $kv;
#if ($kv ne "") {
# my $v = $kv;
# $v =~ s/^(.*)=//;
# return $v;
#}
#return "";
}
# General command startup initialization complete
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# --- return 'true'
$true;
| 34.271635 | 91 | 0.470225 |
ed44f764aa7ba16d6581940452a2ab507400c818 | 378 | t | Perl | deep_module_test/t/ModelReturnTest.t | wing328/swagger-petstore-perl | a5655e5b5e7045d634a32c9762f413a616c901a6 | [
"Apache-2.0"
] | null | null | null | deep_module_test/t/ModelReturnTest.t | wing328/swagger-petstore-perl | a5655e5b5e7045d634a32c9762f413a616c901a6 | [
"Apache-2.0"
] | null | null | null | deep_module_test/t/ModelReturnTest.t | wing328/swagger-petstore-perl | a5655e5b5e7045d634a32c9762f413a616c901a6 | [
"Apache-2.0"
] | null | null | null | # NOTE: This class is auto generated by the Swagger Codegen
# Please update the test case below to test the model.
use Test::More tests => 2;
use Test::Exception;
use lib 'lib';
use strict;
use warnings;
use_ok('Something::Deep::Object::ModelReturn');
my $instance = Something::Deep::Object::ModelReturn->new();
isa_ok($instance, 'Something::Deep::Object::ModelReturn');
| 21 | 59 | 0.724868 |
ed9cba866bb307c740ea0742b738c32ef6f80557 | 1,754 | pm | Perl | lib/Workflow/Persister/UUID.pm | ehuelsmann/perl-workflow | 5fa35d986500246552d95b966f7a4e76191b7a44 | [
"Artistic-1.0"
] | null | null | null | lib/Workflow/Persister/UUID.pm | ehuelsmann/perl-workflow | 5fa35d986500246552d95b966f7a4e76191b7a44 | [
"Artistic-1.0"
] | 1 | 2022-03-07T18:45:03.000Z | 2022-03-07T18:45:03.000Z | lib/Workflow/Persister/UUID.pm | ehuelsmann/perl-workflow | 5fa35d986500246552d95b966f7a4e76191b7a44 | [
"Artistic-1.0"
] | null | null | null | package Workflow::Persister::UUID;
use warnings;
use strict;
use 5.006;
use Data::UUID;
$Workflow::Persister::UUID::VERSION = '1.56';
sub new {
my ( $class, $params ) = @_;
my $self = bless { gen => Data::UUID->new() }, $class;
return $self;
}
sub pre_fetch_id {
my ( $self, $dbh ) = @_;
return $self->{gen}->create_str();
}
sub post_fetch_id {return}
1;
__END__
=pod
=head1 NAME
Workflow::Persister::UUID - Persister to generate Universally Unique Identifiers
=head1 VERSION
This documentation describes version 1.56 of this package
=head1 SYNOPSIS
<persister
name="MyPersister"
use_uuid="yes"
...
=head1 DESCRIPTION
Implementation for any persister to generate a UUID/GUID ID
string. The resulting string is 36 characters long and, according to
the implementation docs, "is guaranteed to be different from all other
UUIDs/GUIDs generated until 3400 CE."
This uses the L<Data::UUID> module to generate the UUID string, so
look there if you are curious about the algorithm, efficiency, etc.
=head2 METHODS
=head3 new
Instantiates a Workflow::Persister::UUID object, which is actually an
encapsulation of L<Data::UUID>.
=head3 pre_fetch_id
L</pre_fetch_id> can then be used to generate/retrieve a unique ID, generated
by L<Data::UUID>.
=head3 post_fetch_id
This method is unimplemented at this time, please see the TODO.
=head1 TODO
=over
=item * Implement L</post_fetch_id>
=back
=head1 SEE ALSO
=over
=item L<Data::UUID>
=back
=head1 COPYRIGHT
Copyright (c) 2003-2021 Chris Winters. All rights reserved.
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
Please see the F<LICENSE>
=head1 AUTHORS
Please see L<Workflow>
=cut
| 17.54 | 80 | 0.72805 |
ed93267487370e5888cf9f40f66db44433106ec3 | 6,788 | pm | Perl | modules/EnsEMBL/Draw/VRenderer/svg.pm | pblins/ensembl-webcode | 1b70534380de5e46f3778b03296ffad6eaf739db | [
"Apache-2.0"
] | null | null | null | modules/EnsEMBL/Draw/VRenderer/svg.pm | pblins/ensembl-webcode | 1b70534380de5e46f3778b03296ffad6eaf739db | [
"Apache-2.0"
] | null | null | null | modules/EnsEMBL/Draw/VRenderer/svg.pm | pblins/ensembl-webcode | 1b70534380de5e46f3778b03296ffad6eaf739db | [
"Apache-2.0"
] | null | null | null | =head1 LICENSE
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.
=cut
package EnsEMBL::Draw::VRenderer::svg;
### Renders vertical ideograms in SVG format
### Modeled on EnsEMBL::Draw::Renderer::svg
### Note that owing to the way the rounded ends of chromosomes are
### currently drawn for bitmaps (i.e. as a series of rectangles),
### this module has major shortcomings in its ability to render images
### in an attractive manner!
use strict;
use vars qw(%classes);
use base qw(EnsEMBL::Draw::VRenderer);
sub init_canvas {
my ($self, $config, $im_width, $im_height) = @_;
$im_height = int($im_height * $self->{sf});
$im_width = int($im_width * $self->{sf});
my @colours = keys %{$self->{'colourmap'}};
$self->{'image_width'} = $im_width;
$self->{'image_height'} = $im_height;
$self->{'style_cache'} = {};
$self->{'next_style'} = 'aa';
$self->canvas('');
}
sub svg_rgb_by_name {
my ($self, $name) = @_;
return 'none' if($name eq 'transparent');
return 'rgb('. (join ',',$self->{'colourmap'}->rgb_by_name($name)).')';
}
sub svg_rgb_by_id {
my ($self, $id) = @_;
return 'none' if($id eq 'transparent');
return 'rgb('. (join ',',$self->{'colourmap'}->rgb_by_name($id)).')';
}
sub canvas {
my ($self, $canvas) = @_;
if(defined $canvas) {
$self->{'canvas'} = $canvas;
} else {
my $styleHTML = join "\n", map { '.'.($self->{'style_cache'}->{$_})." { $_ }" } keys %{$self->{'style_cache'}};
return qq(<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN" "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">
<svg width="$self->{'image_width'}" height="$self->{'image_height'}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs><style type="text/css">
poly { stroke-linecap: round }
line, rect, poly { stroke-width: 0.5; }
text { font-family:Helvetica, Arial, sans-serif;font-size:6pt;font-weight:normal;text-align:left;fill:black; }
${styleHTML}
</style></defs>
$self->{'canvas'}
</svg>
);
}
}
sub add_string {
my ($self,$string) = @_;
$self->{'canvas'} .= $string;
}
sub class {
my ($self, $style) = @_;
my $class = $self->{'style_cache'}->{$style};
unless($class) {
$class = $self->{'style_cache'}->{$style} = $self->{'next_style'}++;
}
return qq(class="$class");
}
sub style {
my ($self, $glyph) = @_;
my $gcolour = $glyph->colour();
my $gbordercolour = $glyph->bordercolour();
my $style =
defined $gcolour ? qq(fill:).$self->svg_rgb_by_id($gcolour).qq(;opacity:1;stroke:none;) :
defined $gbordercolour ? qq(fill:none;opacity:1;stroke:).$self->svg_rgb_by_id($gbordercolour).qq(;) :
qq(fill:none;stroke:none;);
return $self->class($style);
}
sub textstyle {
my ($self, $glyph) = @_;
my $gcolour = $glyph->colour() ? $self->svg_rgb_by_id($glyph->colour()) : $self->svg_rgb_by_name('black');
my $style = "stroke:none;opacity:1;fill:$gcolour;";
return $self->class($style);
}
sub linestyle {
my ($self, $glyph) = @_;
my $gcolour = $glyph->colour();
my $dotted = $glyph->dotted();
my $style =
defined $gcolour ? qq(fill:none;stroke:).$self->svg_rgb_by_id($gcolour).qq(;opacity:1;) :
qq(fill:none;stroke:none;);
$style .= qq(stroke-dasharray:1,2,1;) if defined $dotted;
return $self->class($style);
}
sub render_Rect {
my ($self, $glyph) = @_;
my $style = $self->style( $glyph );
my $x = $glyph->pixelx();
my $w = $glyph->pixelwidth();
my $y = $glyph->pixely();
my $h = $glyph->pixelheight();
$x = sprintf("%0.3f",$x*$self->{sf});
$w = sprintf("%0.3f",$w*$self->{sf});
$y = sprintf("%0.3f",$y*$self->{sf});
$h = sprintf("%0.3f",$h*$self->{sf});
$self->add_string(qq(<rect x="$x" y="$y" width="$w" height="$h" $style />\n));
}
sub render_Text {
my ($self, $glyph) = @_;
my $font = $glyph->font();
my $style = $self->textstyle( $glyph );
my $x = $glyph->pixelx()*$self->{sf};
my $y = $glyph->pixely()*$self->{sf}+6*$self->{sf};
my $text = $glyph->text();
$text =~ s/&/&/g;
$text =~ s/</</g;
$text =~ s/>/>/g;
$text =~ s/"/&/g;
my $sz = ($self->{sf}*100).'%';
$self->add_string( qq(<text x="$x" y="$y" text-size="$sz" $style>$text</text>\n) );
}
sub render_Circle {
# die "Not implemented in svg yet!";
}
sub render_Ellipse {
# die "Not implemented in svg yet!";
}
sub render_Intron {
my ($self, $glyph) = @_;
my $style = $self->linestyle( $glyph );
my $x1 = $glyph->pixelx() *$self->{sf};
my $w1 = $glyph->pixelwidth() / 2 * $self->{sf};
my $h1 = $glyph->pixelheight() / 2 * $self->{sf};
my $y1 = $glyph->pixely() * $self->{sf} + $h1;
$h1 = -$h1 if($glyph->strand() == -1);
my $h2 = -$h1;
$self->add_string(qq(<path d="M$x1,$y1 l$w1,$h2 l$w1,$h1" $style />\n));
}
sub render_Line {
my ($self, $glyph) = @_;
my $style = $self->linestyle( $glyph );
$glyph->transform($self->{'transform'});
my $x = $glyph->pixelx() * $self->{sf};
my $w = $glyph->pixelwidth() * $self->{sf};
my $y = $glyph->pixely() * $self->{sf};
my $h = $glyph->pixelheight() * $self->{sf};
$self->add_string(qq(<path d="M$x,$y l$w,$h" $style />\n));
}
sub render_Poly {
my ($self, $glyph) = @_;
my $style = $self->style( $glyph );
my @points = @{$glyph->pixelpoints()};
my $x = shift @points;
my $y = shift @points;
$x*=$self->{sf};$y*=$self->{sf};
my $poly = qq(<path d="M$x,$y);
while(@points) {
$x = shift @points;
$y = shift @points;
$x*=$self->{sf};$y*=$self->{sf};
$poly .= " L$x,$y";
}
$poly .= qq(z" $style />\n);
$self->add_string($poly);
}
sub render_Composite {
my ($self, $glyph) = @_;
#########
# draw & colour the bounding area if specified
#
$self->render_Rect($glyph) if(defined $glyph->colour() || defined $glyph->bordercolour());
#########
# now loop through $glyph's children
#
$self->SUPER::render_Composite($glyph);
}
1;
| 28.64135 | 147 | 0.580731 |
ed771e5d541de4fbeb87ef08d2c68de81d9cd5d0 | 3,919 | pl | Perl | Scrap/backup_dump.pl | m-macnair/Toolbox | 80eff1f0ab1f155302b5a2598c8fbaf613110392 | [
"BSD-3-Clause"
] | null | null | null | Scrap/backup_dump.pl | m-macnair/Toolbox | 80eff1f0ab1f155302b5a2598c8fbaf613110392 | [
"BSD-3-Clause"
] | null | null | null | Scrap/backup_dump.pl | m-macnair/Toolbox | 80eff1f0ab1f155302b5a2598c8fbaf613110392 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/perl
use strict;
use warnings;
use Carp qw/croak confess cluck/;
use DBI;
use Data::Dumper;
use JSON;
use Try::Tiny;
use Digest::MD5;
main( @ARGV );
sub main {
my ( $C_file ) = @_;
my $C = jsonloadfile( $C_file );
my $dsn = "dbi:mysql:$C->{db}";
my $dumpprefix = $C->{dumpprefix};
DUMPPREFIX: {
$dumpprefix ||= ' --skip-comments ';
}
my $rootdir = $C->{path} || './';
if ( $C->{host} ) {
$dsn .= ";host=$C->{host}";
$dumpprefix .= " -h $C->{host} ";
}
if ( $C->{port} ) {
$dsn .= ";port=$C->{port}";
$dumpprefix .= " -P $C->{port} ";
}
my $dbh = DBI->connect( $dsn, $C->{user}, $C->{pass} );
my $port = $C->{port} || 3306;
my @exceptions = $C->{exceptions} || [];
my $sth = $dbh->prepare( "show tables" );
$sth->execute();
my @tables;
while ( my $row = $sth->fetchrow_arrayref() ) {
unless ( $row->[0] =~ @exceptions ) {
push( @tables, $row->[0] );
}
}
for my $table ( @tables ) {
my $table_dir = "$rootdir/$table/";
unless ( -e $table_dir ) {
mkpath( $table_dir );
}
unless ( $C->{skip_schema} ) {
my $newfile = abspath( "$table_dir/schema_[" . time_string() . '].sql' );
my $cmd = "mysqldump $dumpprefix --single-transaction --no-data -u $C->{user} -p$C->{pass} $C->{db} $table";
print ` $cmd > $newfile`;
compare_new( $table_dir, $newfile, 'schema' );
}
DATA: {
my $newfile = abspath( "$table_dir/data_[" . time_string() . '].sql' );
my $cmd = "mysqldump $dumpprefix --single-transaction --no-create-info -u $C->{user} -p$C->{pass} $C->{db} $table";
print ` $cmd > $newfile`;
compare_new( $table_dir, $newfile, 'data' );
}
}
}
sub time_string {
use POSIX qw(strftime);
my $now = time();
return strftime( '%Y-%m-%dT%H:%M:%SZ', gmtime( $now ) );
}
sub digest_file {
my ( $path ) = @_;
open( my $fh, '<:raw', $path )
or die "failed to open digest file [$path] : $!";
my $ctx = Digest::MD5->new;
$ctx->addfile( $fh );
close( $fh );
return $ctx->hexdigest();
}
sub compare_new {
my ( $dir, $newfile, $string ) = @_;
my $newdigest = digest_file( $newfile );
subonfiles(
sub {
my ( $oldfile ) = @_;
#lul
return if $newfile eq $oldfile;
if ( index( $oldfile, $string ) != -1 ) {
my $olddigest = digest_file( $oldfile );
print "Checking $oldfile.$olddigest against $newfile.$newdigest $/";
#duplicate file - delete the newly generated one
if ( $olddigest eq $newdigest ) {
print "$oldfile is identical to new $string$/";
unlink( $newfile );
return 1;
}
}
},
$dir
);
}
=head3 Toolbox:: dupes
torn from my Toolbox namespace on account of the full install is low ROI in some cases
=cut
sub jsonloadfile {
my ( $path ) = @_;
my $buffer = '';
open( my $fh, '<:raw', $path )
or die "failed to open file [$path] : $!";
# :|
while ( my $line = <$fh> ) {
chomp( $line );
$buffer .= $line;
}
close( $fh );
JSON::decode_json( $buffer );
}
sub mkpath {
my ( $path ) = @_;
confess "Path missing" unless $path;
return $path if -d $path;
require File::Path;
my $errors;
File::Path::make_path( $path, {error => \$errors} );
if ( $errors && @{$errors} ) {
my $errstr;
for ( @{$errors} ) {
$errstr .= $_ . $/;
}
confess( "[$path] creation failed : [$/$errstr]$/" );
}
return $path;
}
sub subonfiles {
my ( $sub, $dir ) = @_;
require File::Find::Rule;
confess( "First parameter to subonfiles was not a code reference" )
unless ref( $sub ) eq 'CODE';
my @files = File::Find::Rule->file()->in( $dir );
my $stop;
for ( @files ) {
$stop = &$sub( abspath( $_ ) );
last if $stop;
}
}
sub abspath {
my ( $path ) = @_;
my $return;
if ( -e $path ) {
require Cwd;
$return = Cwd::abs_path( $path );
if ( -d $return ) {
$return .= '/';
}
} else {
require File::Spec;
$return = File::Spec->rel2abs( $path );
}
return $return; #return!
}
| 21.532967 | 122 | 0.54912 |
edc005ede405fc8bd554c6c8386d0a52bfb0e5c2 | 4,215 | pm | Perl | network/hirschmann/standard/snmp/mode/hardware.pm | centreon-lab/centreon-plugins | 68096c697a9e1baf89a712674a193d9a9321503c | [
"Apache-2.0"
] | null | null | null | network/hirschmann/standard/snmp/mode/hardware.pm | centreon-lab/centreon-plugins | 68096c697a9e1baf89a712674a193d9a9321503c | [
"Apache-2.0"
] | null | null | null | network/hirschmann/standard/snmp/mode/hardware.pm | centreon-lab/centreon-plugins | 68096c697a9e1baf89a712674a193d9a9321503c | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2022 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package network::hirschmann::standard::snmp::mode::hardware;
use base qw(centreon::plugins::templates::hardware);
use strict;
use warnings;
sub set_system {
my ($self, %options) = @_;
$self->{regexp_threshold_numeric_check_section_option} = '^(?:temperature)$';
$self->{cb_hook2} = 'snmp_execute';
$self->{thresholds} = {
fan => [
#hios
['not-available', 'OK'],
['available-and-ok', 'OK'],
['available-but-failure', 'CRITICAL'],
# classic
['ok', 'OK'],
['failed', 'CRITICAL']
],
psu => [
# classic
['ok', 'OK'],
['failed', 'CRITICAL'],
['notInstalled', 'OK'],
['unknown', 'UNKNOWN'],
['ignore', 'OK'],
# hios
['present', 'OK'],
['defective', 'CRITICAL']
],
led => [
['off', 'OK'],
['green', 'OK'],
['yellow', 'WARNING'],
['red', 'CRITICAL']
]
};
$self->{myrequest} = {
classic => [],
hios => []
};
$self->{components_path} = 'network::hirschmann::standard::snmp::mode::components';
$self->{components_module} = ['fan', 'led', 'psu', 'temperature'];
}
sub snmp_execute {
my ($self, %options) = @_;
$self->{snmp} = $options{snmp};
my $hios_serial = '.1.3.6.1.4.1.248.11.10.1.1.3.0'; # hm2DevMgmtSerialNumber
my $classic_version = '.1.3.6.1.4.1.248.14.1.1.2.0'; # hmSysVersion
my $snmp_result = $self->{snmp}->get_leef(
oids => [ $hios_serial, $classic_version ],
nothing_quit => 1
);
$self->{os_type} = 'unknown';
$self->{results} = {};
if (defined($snmp_result->{$classic_version})) {
$self->{os_type} = 'classic';
$self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{myrequest}->{classic});
} elsif ($snmp_result->{$hios_serial}) {
$self->{os_type} = 'hios';
$self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{myrequest}->{hios});
}
}
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;
}
1;
__END__
=head1 MODE
Check hardware.
=over 8
=item B<--component>
Which component to check (Default: '.*').
Can be: 'fan', 'psu', 'temperature', 'led'.
=item B<--filter>
Exclude some parts (comma seperated list) (Example: --filter=fan)
Can also exclude specific instance: --filter=fan,1.1
=item B<--absent-problem>
Return an error if an entity is not 'present' (default is skipping) (comma seperated list)
Can be specific or global: --absent-problem=psu,1.1
=item B<--no-component>
Return an error if no compenents are checked.
If total (with skipped) is 0. (Default: 'critical' returns).
=item B<--threshold-overload>
Set to overload default threshold values (syntax: section,[instance,]status,regexp)
It used before default thresholds (order stays).
Example: --threshold-overload='psu,CRITICAL,^(?!(ok)$)'
=item B<--warning>
Set warning threshold for temperatures (syntax: type,regexp,threshold)
Example: --warning='temperature,.*,30'
=item B<--critical>
Set critical threshold for temperatures (syntax: type,regexp,threshold)
Example: --critical='temperature,.*,40'
=back
=cut
| 26.847134 | 100 | 0.608304 |
ed64e973c2e9a8461ccb37de0eba51228c46ca40 | 9,450 | t | Perl | t/96_Tree_Simple_Visitor_VariableDepthClone_test.t | ronsavage/Tree-Simple-VisitorFactory | 275e3892ea354b1e56c54e6e96c62dc4b8a2dda9 | [
"Artistic-1.0"
] | null | null | null | t/96_Tree_Simple_Visitor_VariableDepthClone_test.t | ronsavage/Tree-Simple-VisitorFactory | 275e3892ea354b1e56c54e6e96c62dc4b8a2dda9 | [
"Artistic-1.0"
] | null | null | null | t/96_Tree_Simple_Visitor_VariableDepthClone_test.t | ronsavage/Tree-Simple-VisitorFactory | 275e3892ea354b1e56c54e6e96c62dc4b8a2dda9 | [
"Artistic-1.0"
] | null | null | null | #!/usr/bin/perl
use strict;
use warnings;
use Test::More tests => 36;
use Test::Exception;
BEGIN {
use_ok('Tree::Simple::Visitor::VariableDepthClone');
}
use Tree::Simple;
use Tree::Simple::Visitor::PreOrderTraversal;
my $tree = Tree::Simple->new(Tree::Simple->ROOT)
->addChildren(
Tree::Simple->new("1")
->addChildren(
Tree::Simple->new("1.1"),
Tree::Simple->new("1.2")
->addChildren(
Tree::Simple->new("1.2.1"),
Tree::Simple->new("1.2.2")
),
Tree::Simple->new("1.3")
),
Tree::Simple->new("2")
->addChildren(
Tree::Simple->new("2.1"),
Tree::Simple->new("2.2")
),
Tree::Simple->new("3")
->addChildren(
Tree::Simple->new("3.1"),
Tree::Simple->new("3.2"),
Tree::Simple->new("3.3")
),
Tree::Simple->new("4")
->addChildren(
Tree::Simple->new("4.1")
)
);
isa_ok($tree, 'Tree::Simple');
can_ok("Tree::Simple::Visitor::VariableDepthClone", 'new');
{
my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
isa_ok($visitor, 'Tree::Simple::Visitor::VariableDepthClone');
isa_ok($visitor, 'Tree::Simple::Visitor');
can_ok($visitor, 'setCloneDepth');
can_ok($visitor, 'getClone');
$visitor->setCloneDepth(2);
$tree->accept($visitor);
my $cloned = $visitor->getClone();
my $checker = Tree::Simple::Visitor::PreOrderTraversal->new();
$cloned->accept($checker);
is_deeply(
[ $checker->getResults() ],
[ qw(1 1.1 1.2 1.3 2 2.1 2.2 3 3.1 3.2 3.3 4 4.1) ],
'... our results are as expected');
}
{
my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
isa_ok($visitor, 'Tree::Simple::Visitor::VariableDepthClone');
$visitor->setCloneDepth(1);
$visitor->setNodeFilter(sub {
my ($old, $new) = @_;
$new->setNodeValue($old->getNodeValue() . "new");
});
$tree->accept($visitor);
my $cloned = $visitor->getClone();
my $checker = Tree::Simple::Visitor::PreOrderTraversal->new();
$cloned->accept($checker);
is_deeply(
[ $checker->getResults() ],
[ qw(1new 2new 3new 4new) ],
'... our results are as expected');
}
{
my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
isa_ok($visitor, 'Tree::Simple::Visitor::VariableDepthClone');
$visitor->setCloneDepth(3);
$tree->accept($visitor);
my $cloned = $visitor->getClone();
my $checker = Tree::Simple::Visitor::PreOrderTraversal->new();
$cloned->accept($checker);
is_deeply(
[ $checker->getResults() ],
[ qw(1 1.1 1.2 1.2.1 1.2.2 1.3 2 2.1 2.2 3 3.1 3.2 3.3 4 4.1) ],
'... our results are as expected');
}
{
my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
isa_ok($visitor, 'Tree::Simple::Visitor::VariableDepthClone');
$visitor->setCloneDepth(100);
$tree->accept($visitor);
my $cloned = $visitor->getClone();
my $checker = Tree::Simple::Visitor::PreOrderTraversal->new();
$cloned->accept($checker);
is_deeply(
[ $checker->getResults() ],
[ qw(1 1.1 1.2 1.2.1 1.2.2 1.3 2 2.1 2.2 3 3.1 3.2 3.3 4 4.1) ],
'... our results are as expected');
}
{
my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
isa_ok($visitor, 'Tree::Simple::Visitor::VariableDepthClone');
$visitor->setCloneDepth(0);
$tree->accept($visitor);
my $cloned = $visitor->getClone();
my $checker = Tree::Simple::Visitor::PreOrderTraversal->new();
$cloned->accept($checker);
is_deeply(
[ $checker->getResults() ],
[],
'... our results are as expected');
}
{
my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
isa_ok($visitor, 'Tree::Simple::Visitor::VariableDepthClone');
$visitor->setCloneDepth(-1);
$tree->accept($visitor);
my $cloned = $visitor->getClone();
my $checker = Tree::Simple::Visitor::PreOrderTraversal->new();
$cloned->accept($checker);
is_deeply(
[ $checker->getResults() ],
[],
'... our results are as expected');
}
{
my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
isa_ok($visitor, 'Tree::Simple::Visitor::VariableDepthClone');
$visitor->setCloneDepth(-100);
$tree->accept($visitor);
my $cloned = $visitor->getClone();
my $checker = Tree::Simple::Visitor::PreOrderTraversal->new();
$cloned->accept($checker);
is_deeply(
[ $checker->getResults() ],
[],
'... our results are as expected');
}
# check with trunk
{
my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
isa_ok($visitor, 'Tree::Simple::Visitor::VariableDepthClone');
$visitor->includeTrunk(1);
$visitor->setCloneDepth(2);
$visitor->setNodeFilter(sub {
my ($old, $new) = @_;
$new->setNodeValue($old->getNodeValue() . "new");
});
$tree->getChild(0)->accept($visitor);
my $cloned = $visitor->getClone();
my $checker = Tree::Simple::Visitor::PreOrderTraversal->new();
$cloned->accept($checker);
is_deeply(
[ $checker->getResults() ],
[ qw(1new 1.1new 1.2new 1.2.1new 1.2.2new 1.3new) ],
'... our results are as expected');
}
{
my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
isa_ok($visitor, 'Tree::Simple::Visitor::VariableDepthClone');
$visitor->includeTrunk(1);
$visitor->setCloneDepth(1);
$tree->getChild(0)->accept($visitor);
my $cloned = $visitor->getClone();
my $checker = Tree::Simple::Visitor::PreOrderTraversal->new();
$cloned->accept($checker);
is_deeply(
[ $checker->getResults() ],
[ qw(1 1.1 1.2 1.3) ],
'... our results are as expected');
}
{
my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
isa_ok($visitor, 'Tree::Simple::Visitor::VariableDepthClone');
$visitor->includeTrunk(1);
$visitor->setCloneDepth(0);
$tree->getChild(0)->accept($visitor);
my $cloned = $visitor->getClone();
my $checker = Tree::Simple::Visitor::PreOrderTraversal->new();
$cloned->accept($checker);
is_deeply(
[ $checker->getResults() ],
[ qw(1) ],
'... our results are as expected');
}
{
my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
isa_ok($visitor, 'Tree::Simple::Visitor::VariableDepthClone');
$visitor->includeTrunk(1);
$visitor->setCloneDepth(-1);
$tree->getChild(0)->accept($visitor);
my $cloned = $visitor->getClone();
my $checker = Tree::Simple::Visitor::PreOrderTraversal->new();
$cloned->accept($checker);
is_deeply(
[ $checker->getResults() ],
[ qw(1) ],
'... our results are as expected');
}
{
my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
isa_ok($visitor, 'Tree::Simple::Visitor::VariableDepthClone');
$visitor->includeTrunk(1);
$visitor->setCloneDepth(-100);
$tree->getChild(0)->getChild(0)->accept($visitor);
my $cloned = $visitor->getClone();
my $checker = Tree::Simple::Visitor::PreOrderTraversal->new();
$cloned->accept($checker);
is_deeply(
[ $checker->getResults() ],
[ qw(1.1) ],
'... our results are as expected');
}
# check some errors
# check errors
{
my $visitor = Tree::Simple::Visitor::VariableDepthClone->new();
isa_ok($visitor, 'Tree::Simple::Visitor::VariableDepthClone');
# check visit
throws_ok {
$visitor->visit();
} qr/Insufficient Arguments/, '... got the error we expected';
throws_ok {
$visitor->visit("Fail");
} qr/Insufficient Arguments/, '... got the error we expected';
throws_ok {
$visitor->visit([]);
} qr/Insufficient Arguments/, '... got the error we expected';
throws_ok {
$visitor->visit(bless({}, "Fail"));
} qr/Insufficient Arguments/, '... got the error we expected';
throws_ok {
$visitor->setCloneDepth();
} qr/Insufficient Arguments/, '... got the error we expected';
}
| 30.385852 | 164 | 0.507725 |
ed5c4adb9dbbdfa57ff782ca01d09b856fb0fb42 | 13,483 | pm | Perl | modules/EnsEMBL/Web/Component/Gene/ComparaOrthologs.pm | sanjay-boddu/ensembl-webcode | 2a8f55a9edde3553e705fe0fc1c6ef69e69e7153 | [
"Apache-2.0",
"MIT"
] | null | null | null | modules/EnsEMBL/Web/Component/Gene/ComparaOrthologs.pm | sanjay-boddu/ensembl-webcode | 2a8f55a9edde3553e705fe0fc1c6ef69e69e7153 | [
"Apache-2.0",
"MIT"
] | null | null | null | modules/EnsEMBL/Web/Component/Gene/ComparaOrthologs.pm | sanjay-boddu/ensembl-webcode | 2a8f55a9edde3553e705fe0fc1c6ef69e69e7153 | [
"Apache-2.0",
"MIT"
] | null | null | null | =head1 LICENSE
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=cut
package EnsEMBL::Web::Component::Gene::ComparaOrthologs;
use strict;
use HTML::Entities qw(encode_entities);
use base qw(EnsEMBL::Web::Component::Gene);
sub _init {
my $self = shift;
$self->cacheable(1);
$self->ajaxable(1);
}
## Stub - implement in plugin if you want to display a summary table
## (see public-plugins/ensembl for an example data structure)
sub _species_sets {}
our %button_set = ('download' => 1, 'view' => 0);
sub content {
my $self = shift;
my $hub = $self->hub;
my $object = $self->object;
my $species_defs = $hub->species_defs;
my $cdb = shift || $hub->param('cdb') || 'compara';
my $availability = $object->availability;
my $is_ncrna = ($object->Obj->biotype =~ /RNA/);
my @orthologues = (
$object->get_homology_matches('ENSEMBL_ORTHOLOGUES', undef, undef, $cdb),
);
my %orthologue_list;
my %skipped;
foreach my $homology_type (@orthologues) {
foreach (keys %$homology_type) {
(my $species = $_) =~ tr/ /_/;
$orthologue_list{$species} = {%{$orthologue_list{$species}||{}}, %{$homology_type->{$_}}};
$skipped{$species} += keys %{$homology_type->{$_}} if $hub->param('species_' . lc $species) eq 'off';
}
}
return '<p>No orthologues have been identified for this gene</p>' unless keys %orthologue_list;
my %orthologue_map = qw(SEED BRH PIP RHS);
my $alignview = 0;
my ($html, $columns, @rows);
##--------------------------- SUMMARY TABLE ----------------------------------------
my ($species_sets, $sets_by_species, $set_order) = $self->_species_sets(\%orthologue_list, \%skipped, \%orthologue_map);
if ($species_sets) {
$html .= qq{
<h3>Summary of orthologues of this gene</h3>
<p class="space-below">Click on 'Show details' to display the orthologues for one or more groups of species. Alternatively, click on 'Configure this page' to choose a custom list of species.</p>
};
$columns = [
{ key => 'set', title => 'Species set', align => 'left', width => '26%' },
{ key => 'show', title => 'Show details', align => 'center', width => '10%' },
{ key => '1:1', title => 'With 1:1 orthologues', align => 'center', width => '16%', help => 'Number of species with 1:1 orthologues' },
{ key => '1:many', title => 'With 1:many orthologues', align => 'center', width => '16%', help => 'Number of species with 1:many orthologues' },
{ key => 'many:many', title => 'With many:many orthologues', align => 'center', width => '16%', help => 'Number of species with many:many orthologues' },
{ key => 'none', title => 'Without orthologues', align => 'center', width => '16%', help => 'Number of species without orthologues' },
];
foreach my $set (@$set_order) {
my $set_info = $species_sets->{$set};
push @rows, {
'set' => "<strong>$set_info->{'title'}</strong> (<i>$set_info->{'all'} species</i>)<br />$set_info->{'desc'}",
'show' => qq{<input type="checkbox" class="table_filter" title="Check to show these species in table below" name="orthologues" value="$set" />},
'1:1' => $set_info->{'1-to-1'} || 0,
'1:many' => $set_info->{'1-to-many'} || 0,
'many:many' => $set_info->{'Many-to-many'} || 0,
'none' => $set_info->{'none'} || 0,
};
}
$html .= $self->new_table($columns, \@rows)->render;
}
##----------------------------- FULL TABLE -----------------------------------------
$html .= '<h3>Selected orthologues</h3>' if $species_sets;
my $column_name = $self->html_format ? 'Compare' : 'Description';
$columns = [
{ key => 'Species', align => 'left', width => '10%', sort => 'html' },
{ key => 'Type', align => 'left', width => '5%', sort => 'string' },
{ key => 'dN/dS', align => 'left', width => '5%', sort => 'numeric' },
{ key => 'identifier', align => 'left', width => '15%', sort => 'html', title => $self->html_format ? 'Ensembl identifier & gene name' : 'Ensembl identifier'},
{ key => $column_name, align => 'left', width => '10%', sort => 'none' },
{ key => 'Location', align => 'left', width => '20%', sort => 'position_html' },
{ key => 'Target %id', align => 'left', width => '5%', sort => 'numeric' },
{ key => 'Query %id', align => 'left', width => '5%', sort => 'numeric' },
];
push @$columns, { key => 'Gene name(Xref)', align => 'left', width => '15%', sort => 'html', title => 'Gene name(Xref)'} if(!$self->html_format);
@rows = ();
foreach my $species (sort { ($a =~ /^<.*?>(.+)/ ? $1 : $a) cmp ($b =~ /^<.*?>(.+)/ ? $1 : $b) } keys %orthologue_list) {
next if $skipped{$species};
foreach my $stable_id (sort keys %{$orthologue_list{$species}}) {
my $orthologue = $orthologue_list{$species}{$stable_id};
my ($target, $query);
# (Column 2) Add in Orthologue description
my $orthologue_desc = $orthologue_map{$orthologue->{'homology_desc'}} || $orthologue->{'homology_desc'};
# (Column 3) Add in the dN/dS ratio
my $orthologue_dnds_ratio = $orthologue->{'homology_dnds_ratio'} || 'n/a';
# (Column 4) Sort out
# (1) the link to the other species
# (2) information about %ids
# (3) links to multi-contigview and align view
(my $spp = $orthologue->{'spp'}) =~ tr/ /_/;
my $link_url = $hub->url({
species => $spp,
action => 'Summary',
g => $stable_id,
__clear => 1
});
# Check the target species are on the same portal - otherwise the multispecies link does not make sense
my $target_links = ($link_url =~ /^\//
&& $cdb eq 'compara'
&& $availability->{'has_pairwise_alignments'}
) ? sprintf(
'<ul class="compact"><li class="first"><a href="%s" class="notext">Region Comparison</a></li>',
$hub->url({
type => 'Location',
action => 'Multi',
g1 => $stable_id,
s1 => $spp,
r => undef,
config => 'opt_join_genes_bottom=on',
})
) : '';
if ($orthologue_desc ne 'DWGA') {
($target, $query) = ($orthologue->{'target_perc_id'}, $orthologue->{'query_perc_id'});
my $align_url = $hub->url({
action => 'Compara_Ortholog',
function => 'Alignment' . ($cdb =~ /pan/ ? '_pan_compara' : ''),
hom_id => $orthologue->{'dbID'},
g1 => $stable_id,
});
if ($is_ncrna) {
$target_links .= sprintf '<li><a href="%s" class="notext">Alignment</a></li>', $align_url;
} else {
$target_links .= sprintf '<li><a href="%s" class="notext">Alignment (protein)</a></li>', $align_url;
$target_links .= sprintf '<li><a href="%s" class="notext">Alignment (cDNA)</a></li>', $align_url.';seq=cDNA';
}
$alignview = 1;
}
$target_links .= sprintf(
'<li><a href="%s" class="notext">Gene Tree (image)</a></li></ul>',
$hub->url({
type => 'Gene',
action => 'Compara_Tree' . ($cdb =~ /pan/ ? '/pan_compara' : ''),
g1 => $stable_id,
anc => $orthologue->{'gene_tree_node_id'},
r => undef
})
);
# (Column 5) External ref and description
my $description = encode_entities($orthologue->{'description'});
$description = 'No description' if $description eq 'NULL';
if ($description =~ s/\[\w+:([-\/\w]+)\;\w+:(\w+)\]//g) {
my ($edb, $acc) = ($1, $2);
$description .= sprintf '[Source: %s; acc: %s]', $edb, $hub->get_ExtURL_link($acc, $edb, $acc) if $acc;
}
my @external = (qq{<span class="small">$description</span>});
if ($orthologue->{'display_id'}) {
if ($orthologue->{'display_id'} eq 'Novel Ensembl prediction' && $description eq 'No description') {
@external = ('<span class="small">-</span>');
} else {
unshift @external, $orthologue->{'display_id'};
}
}
my $id_info = qq{<p class="space-below"><a href="$link_url">$stable_id</a></p>} . join '<br />', @external;
## (Column 6) Location - split into elements to reduce horizonal space
my $location_link = $hub->url({
species => $spp,
type => 'Location',
action => 'View',
r => $orthologue->{'location'},
g => $stable_id,
__clear => 1
});
my $table_details = {
'Species' => join('<br />(', split /\s*\(/, $species_defs->species_label($species)),
'Type' => ucfirst $orthologue_desc,
'dN/dS' => $orthologue_dnds_ratio,
'identifier' => $self->html_format ? $id_info : $stable_id,
'Location' => qq{<a href="$location_link">$orthologue->{'location'}</a>},
$column_name => $self->html_format ? qq{<span class="small">$target_links</span>} : $description,
'Target %id' => $target,
'Query %id' => $query,
'options' => { class => join(' ', 'all', @{$sets_by_species->{$species} || []}) }
};
$table_details->{'Gene name(Xref)'}=$orthologue->{'display_id'} if(!$self->html_format);
push @rows, $table_details;
}
}
my $table = $self->new_table($columns, \@rows, { data_table => 1, sorting => [ 'Species asc', 'Type asc' ], id => 'orthologues' });
if ($alignview && keys %orthologue_list) {
$button_set{'view'} = 1;
}
$html .= $table->render;
if (scalar keys %skipped) {
my $count;
$count += $_ for values %skipped;
$html .= '<br />' . $self->_info(
'Orthologues hidden by configuration',
sprintf(
'<p>%d orthologues not shown in the table above from the following species. Use the "<strong>Configure this page</strong>" on the left to show them.<ul><li>%s</li></ul></p>',
$count,
join "</li>\n<li>", map "$_ ($skipped{$_})", sort keys %skipped
)
);
}
return $html;
}
sub export_options { return {'action' => 'Orthologs'}; }
sub get_export_data {
## Get data for export
my ($self, $flag) = @_;
my $hub = $self->hub;
my $object = $self->object || $hub->core_object('gene');
if ($flag eq 'sequence') {
return $object->get_homologue_alignments;
}
else {
my $cdb = $flag || $hub->param('cdb') || 'compara';
my ($homologies) = $object->get_homologies('ENSEMBL_ORTHOLOGUES', undef, undef, $cdb);
my %ok_species;
foreach (grep { /species_/ } $hub->param) {
(my $sp = $_) =~ s/species_//;
$ok_species{$sp} = 1 if $hub->param($_) eq 'yes';
}
if (keys %ok_species) {
return [grep {$ok_species{$_->get_all_Members->[1]->genome_db->name}} @$homologies];
}
else {
return $homologies;
}
}
}
sub buttons {
my $self = shift;
my $hub = $self->hub;
my @buttons;
if ($button_set{'download'}) {
my $gene = $self->object->Obj;
my $dxr = $gene->can('display_xref') ? $gene->display_xref : undef;
my $name = $dxr ? $dxr->display_id : $gene->stable_id;
my $params = {
'type' => 'DataExport',
'action' => 'Orthologs',
'data_type' => 'Gene',
'component' => 'ComparaOrthologs',
'data_action' => $hub->action,
'gene_name' => $name,
};
## Add any species settings
foreach (grep { /^species_/ } $hub->param) {
$params->{$_} = $hub->param($_);
}
push @buttons, {
'url' => $hub->url($params),
'caption' => 'Download orthologues',
'class' => 'export',
'modal' => 1
};
}
if ($button_set{'view'}) {
my $cdb = $hub->param('cdb') || 'compara';
my $params = {
'action' => 'Compara_Ortholog',
'function' => 'Alignment'.($cdb =~ /pan/ ? '_pan_compara' : ''),
};
push @buttons, {
'url' => $hub->url($params),
'caption' => 'View sequence alignments',
'class' => 'view',
'modal' => 0
};
}
return @buttons;
}
1;
| 38.303977 | 200 | 0.515167 |
edb4654c47ac1d84cd134b3cf517dc031c97a408 | 37,543 | pl | Perl | bin/lib/Image/ExifTool/XMPStruct.pl | mceachen/exiftool_vendored.rb | bab2705f32f3b8fc47486ec9ceb6f012972419c2 | [
"MIT"
] | 5 | 2017-02-18T11:03:32.000Z | 2019-01-29T16:04:41.000Z | bin/lib/Image/ExifTool/XMPStruct.pl | mceachen/exiftool_vendored | c154ac88071e480d595fa47140eb65487d4f2b07 | [
"MIT"
] | null | null | null | bin/lib/Image/ExifTool/XMPStruct.pl | mceachen/exiftool_vendored | c154ac88071e480d595fa47140eb65487d4f2b07 | [
"MIT"
] | null | null | null | #------------------------------------------------------------------------------
# File: XMPStruct.pl
#
# Description: XMP structure support
#
# Revisions: 01/01/2011 - P. Harvey Created
#------------------------------------------------------------------------------
package Image::ExifTool::XMP;
use strict;
use vars qw(%specialStruct %stdXlatNS);
use Image::ExifTool qw(:Utils);
use Image::ExifTool::XMP;
sub SerializeStruct($;$);
sub InflateStruct($;$);
sub DumpStruct($;$);
sub CheckStruct($$$);
sub AddNewStruct($$$$$$);
sub ConvertStruct($$$$;$);
#------------------------------------------------------------------------------
# Serialize a structure (or other object) into a simple string
# Inputs: 0) HASH ref, ARRAY ref, or SCALAR, 1) closing bracket (or undef)
# Returns: serialized structure string
# eg) "{field=text with {braces|}|, and a comma, field2=val2,field3={field4=[a,b]}}"
sub SerializeStruct($;$)
{
my ($obj, $ket) = @_;
my ($key, $val, @vals, $rtnVal);
if (ref $obj eq 'HASH') {
# support hashes with ordered keys
my @keys = $$obj{_ordered_keys_} ? @{$$obj{_ordered_keys_}} : sort keys %$obj;
foreach $key (@keys) {
push @vals, $key . '=' . SerializeStruct($$obj{$key}, '}');
}
$rtnVal = '{' . join(',', @vals) . '}';
} elsif (ref $obj eq 'ARRAY') {
foreach $val (@$obj) {
push @vals, SerializeStruct($val, ']');
}
$rtnVal = '[' . join(',', @vals) . ']';
} elsif (defined $obj) {
$obj = $$obj if ref $obj eq 'SCALAR';
# escape necessary characters in string (closing bracket plus "," and "|")
my $pat = $ket ? "\\$ket|,|\\|" : ',|\\|';
($rtnVal = $obj) =~ s/($pat)/|$1/g;
# also must escape opening bracket or whitespace at start of string
$rtnVal =~ s/^([\s\[\{])/|$1/;
} else {
$rtnVal = ''; # allow undefined list items
}
return $rtnVal;
}
#------------------------------------------------------------------------------
# Inflate structure (or other object) from a serialized string
# Inputs: 0) reference to object in string form (serialized using the '|' escape)
# 1) extra delimiter for scalar values delimiters
# Returns: 0) object as a SCALAR, HASH ref, or ARRAY ref (or undef on error),
# 1) warning string (or undef)
# Notes: modifies input string to remove parsed objects
sub InflateStruct($;$)
{
my ($obj, $delim) = @_;
my ($val, $warn, $part);
if ($$obj =~ s/^\s*\{//) {
my %struct;
while ($$obj =~ s/^\s*([-\w:]+#?)\s*=//s) {
my $tag = $1;
my ($v, $w) = InflateStruct($obj, '}');
$warn = $w if $w and not $warn;
return(undef, $warn) unless defined $v;
$struct{$tag} = $v;
# eat comma separator, or all done if there wasn't one
last unless $$obj =~ s/^\s*,//s;
}
# eat closing brace and warn if we didn't find one
unless ($$obj =~ s/^\s*\}//s or $warn) {
if (length $$obj) {
($part = $$obj) =~ s/^\s*//s;
$part =~ s/[\x0d\x0a].*//s;
$part = substr($part,0,27) . '...' if length($part) > 30;
$warn = "Invalid structure field at '${part}'";
} else {
$warn = 'Missing closing brace for structure';
}
}
$val = \%struct;
} elsif ($$obj =~ s/^\s*\[//) {
my @list;
for (;;) {
my ($v, $w) = InflateStruct($obj, ']');
$warn = $w if $w and not $warn;
return(undef, $warn) unless defined $v;
push @list, $v;
last unless $$obj =~ s/^\s*,//s;
}
# eat closing bracket and warn if we didn't find one
$$obj =~ s/^\s*\]//s or $warn or $warn = 'Missing closing bracket for list';
$val = \@list;
} else {
$$obj =~ s/^\s+//s; # remove leading whitespace
# read scalar up to specified delimiter (or "," if not defined)
$val = '';
$delim = $delim ? "\\$delim|,|\\||\$" : ',|\\||$';
for (;;) {
$$obj =~ s/^(.*?)($delim)//s or last;
$val .= $1;
last unless $2;
$2 eq '|' or $$obj = $2 . $$obj, last;
$$obj =~ s/^(.)//s and $val .= $1; # add escaped character
}
}
return($val, $warn);
}
#------------------------------------------------------------------------------
# Get XMP language code from tag name string
# Inputs: 0) tag name string
# Returns: 0) separated tag name, 1) language code (in standard case), or '' if
# language code was 'x-default', or undef if the tag had no language code
sub GetLangCode($)
{
my $tag = shift;
if ($tag =~ /^(\w+)[-_]([a-z]{2,3}|[xi])([-_][a-z\d]{2,8}([-_][a-z\d]{1,8})*)?$/i) {
# normalize case of language codes
my ($tg, $langCode) = ($1, lc($2));
$langCode .= (length($3) == 3 ? uc($3) : lc($3)) if $3;
$langCode =~ tr/_/-/; # RFC 3066 specifies '-' as a separator
$langCode = '' if lc($langCode) eq 'x-default';
return($tg, $langCode);
} else {
return($tag, undef);
}
}
#------------------------------------------------------------------------------
# Debugging routine to dump a structure, list or scalar
# Inputs: 0) scalar, ARRAY ref or HASH ref, 1) indent (or undef)
sub DumpStruct($;$)
{
local $_;
my ($obj, $indent) = @_;
$indent or $indent = '';
if (ref $obj eq 'HASH') {
print "{\n";
foreach (sort keys %$obj) {
print "$indent $_ = ";
DumpStruct($$obj{$_}, "$indent ");
}
print $indent, "},\n";
} elsif (ref $obj eq 'ARRAY') {
print "[\n";
foreach (@$obj) {
print "$indent ";
DumpStruct($_, "$indent ");
}
print $indent, "],\n",
} else {
print "\"$obj\",\n";
}
}
#------------------------------------------------------------------------------
# Recursively validate structure fields (tags)
# Inputs: 0) ExifTool ref, 1) Structure ref, 2) structure table definition ref
# Returns: 0) validated structure ref, 1) error string, or undef on success
# Notes:
# - fixes field names in structure and applies inverse conversions to values
# - copies structure to avoid interdependencies with calling code on referenced values
# - handles lang-alt tags, and '#' on field names
# - resets UTF-8 flag of SCALAR values
# - un-escapes for XML or HTML as per Escape option setting
sub CheckStruct($$$)
{
my ($et, $struct, $strTable) = @_;
my $strName = $$strTable{STRUCT_NAME} || ('XMP ' . RegisterNamespace($strTable));
ref $struct eq 'HASH' or return wantarray ? (undef, "Expecting $strName structure") : undef;
my ($key, $err, $warn, %copy, $rtnVal, $val);
Key:
foreach $key (keys %$struct) {
my $tag = $key;
# allow trailing '#' to disable print conversion on a per-field basis
my ($type, $fieldInfo);
$type = 'ValueConv' if $tag =~ s/#$//;
$fieldInfo = $$strTable{$tag} unless $specialStruct{$tag};
# fix case of field name if necessary
unless ($fieldInfo) {
# (sort in reverse to get lower case (not special) tags first)
my ($fix) = reverse sort grep /^$tag$/i, keys %$strTable;
$fieldInfo = $$strTable{$tag = $fix} if $fix and not $specialStruct{$fix};
}
until (ref $fieldInfo eq 'HASH') {
# generate wildcard fields on the fly (eg. mwg-rs:Extensions)
unless ($$strTable{NAMESPACE}) {
my ($grp, $tg, $langCode);
($grp, $tg) = $tag =~ /^(.+):(.+)/ ? (lc $1, $2) : ('', $tag);
undef $grp if $grp eq 'XMP'; # (a group of 'XMP' is implied)
require Image::ExifTool::TagLookup;
my @matches = Image::ExifTool::TagLookup::FindTagInfo($tg);
# also look for lang-alt tags
unless (@matches) {
($tg, $langCode) = GetLangCode($tg);
@matches = Image::ExifTool::TagLookup::FindTagInfo($tg) if defined $langCode;
}
my ($tagInfo, $priority, $ti, $g1);
# find best matching tag
foreach $ti (@matches) {
my @grps = $et->GetGroup($ti);
next unless $grps[0] eq 'XMP';
next if $grp and $grp ne lc $grps[1];
# must be lang-alt tag if we are writing an alternate language
next if defined $langCode and not ($$ti{Writable} and $$ti{Writable} eq 'lang-alt');
my $pri = $$ti{Priority} || 1;
$pri -= 10 if $$ti{Avoid};
next if defined $priority and $priority >= $pri;
$priority = $pri;
$tagInfo = $ti;
$g1 = $grps[1];
}
$tagInfo or $warn = "'${tag}' is not a writable XMP tag", next Key;
GetPropertyPath($tagInfo); # make sure property path is generated for this tag
$tag = $$tagInfo{Name};
$tag = "$g1:$tag" if $grp;
$tag .= "-$langCode" if $langCode;
$fieldInfo = $$strTable{$tag};
# create new structure field if necessary
$fieldInfo or $fieldInfo = $$strTable{$tag} = {
%$tagInfo, # (also copies the necessary TagID and PropertyPath)
Namespace => $$tagInfo{Namespace} || $$tagInfo{Table}{NAMESPACE},
LangCode => $langCode,
};
# delete stuff we don't need (shouldn't cause harm, but better safe than sorry)
# - need to keep StructType and Table in case we need to call AddStructType later
delete $$fieldInfo{Description};
delete $$fieldInfo{Groups};
last; # write this dynamically-generated field
}
# generate lang-alt fields on the fly (eg. Iptc4xmpExt:AOTitle)
my ($tg, $langCode) = GetLangCode($tag);
if (defined $langCode) {
$fieldInfo = $$strTable{$tg} unless $specialStruct{$tg};
unless ($fieldInfo) {
my ($fix) = reverse sort grep /^$tg$/i, keys %$strTable;
$fieldInfo = $$strTable{$tg = $fix} if $fix and not $specialStruct{$fix};
}
if (ref $fieldInfo eq 'HASH' and $$fieldInfo{Writable} and
$$fieldInfo{Writable} eq 'lang-alt')
{
my $srcInfo = $fieldInfo;
$tag = $tg . '-' . $langCode if $langCode;
$fieldInfo = $$strTable{$tag};
# create new structure field if necessary
$fieldInfo or $fieldInfo = $$strTable{$tag} = {
%$srcInfo,
TagID => $tg,
LangCode => $langCode,
};
last; # write this lang-alt field
}
}
$warn = "'${tag}' is not a field of $strName";
next Key;
}
if (ref $$struct{$key} eq 'HASH') {
$$fieldInfo{Struct} or $warn = "$tag is not a structure in $strName", next Key;
# recursively check this structure
($val, $err) = CheckStruct($et, $$struct{$key}, $$fieldInfo{Struct});
$err and $warn = $err, next Key;
$copy{$tag} = $val;
} elsif (ref $$struct{$key} eq 'ARRAY') {
$$fieldInfo{List} or $warn = "$tag is not a list in $strName", next Key;
# check all items in the list
my ($item, @copy);
my $i = 0;
foreach $item (@{$$struct{$key}}) {
if (not ref $item) {
$item = '' unless defined $item; # use empty string for missing items
if ($$fieldInfo{Struct}) {
# (allow empty structures)
$item =~ /^\s*$/ or $warn = "$tag items are not valid structures", next Key;
$copy[$i] = { }; # create hash for empty structure
} else {
$et->Sanitize(\$item);
($copy[$i],$err) = $et->ConvInv($item,$fieldInfo,$tag,$strName,$type,'');
$copy[$i] = '' unless defined $copy[$i]; # avoid undefined item
$err and $warn = $err, next Key;
$err = CheckXMP($et, $fieldInfo, \$copy[$i]);
$err and $warn = "$err in $strName $tag", next Key;
}
} elsif (ref $item eq 'HASH') {
$$fieldInfo{Struct} or $warn = "$tag is not a structure in $strName", next Key;
($copy[$i], $err) = CheckStruct($et, $item, $$fieldInfo{Struct});
$err and $warn = $err, next Key;
} else {
$warn = "Invalid value for $tag in $strName";
next Key;
}
++$i;
}
$copy{$tag} = \@copy;
} elsif ($$fieldInfo{Struct}) {
$warn = "Improperly formed structure in $strName $tag";
} else {
$et->Sanitize(\$$struct{$key});
($val,$err) = $et->ConvInv($$struct{$key},$fieldInfo,$tag,$strName,$type,'');
$err and $warn = $err, next Key;
next Key unless defined $val; # check for undefined
$err = CheckXMP($et, $fieldInfo, \$val);
$err and $warn = "$err in $strName $tag", next Key;
# turn this into a list if necessary
$copy{$tag} = $$fieldInfo{List} ? [ $val ] : $val;
}
}
if (%copy or not $warn) {
$rtnVal = \%copy;
undef $err;
$$et{CHECK_WARN} = $warn if $warn;
} else {
$err = $warn;
}
return wantarray ? ($rtnVal, $err) : $rtnVal;
}
#------------------------------------------------------------------------------
# Delete matching structures from existing linearized XMP
# Inputs: 0) ExifTool ref, 1) capture hash ref, 2) structure path ref,
# 3) new value hash ref, 4) reference to change counter
# Returns: 0) delete flag, 1) list index of deleted structure if adding to list
# 2) flag set if structure existed
# Notes: updates path to new base path for structure to be added
sub DeleteStruct($$$$$)
{
my ($et, $capture, $pathPt, $nvHash, $changed) = @_;
my ($deleted, $added, $existed, $p, $pp, $val, $delPath);
my (@structPaths, @matchingPaths, @delPaths);
# find all existing elements belonging to this structure
($pp = $$pathPt) =~ s/ \d+/ \\d\+/g;
@structPaths = sort grep(/^$pp(\/|$)/, keys %$capture);
$existed = 1 if @structPaths;
# delete only structures with matching fields if necessary
if ($$nvHash{DelValue}) {
if (@{$$nvHash{DelValue}}) {
my $strTable = $$nvHash{TagInfo}{Struct};
# all fields must match corresponding elements in the same
# root structure for it to be deleted
foreach $val (@{$$nvHash{DelValue}}) {
next unless ref $val eq 'HASH';
my (%cap, $p2, %match);
next unless AddNewStruct(undef, undef, \%cap, $$pathPt, $val, $strTable);
foreach $p (keys %cap) {
if ($p =~ / /) {
($p2 = $p) =~ s/ \d+/ \\d\+/g;
@matchingPaths = sort grep(/^$p2$/, @structPaths);
} else {
push @matchingPaths, $p;
}
foreach $p2 (@matchingPaths) {
$p2 =~ /^($pp)/ or next;
# language attribute must also match if it exists
my $attr = $cap{$p}[1];
if ($$attr{'xml:lang'}) {
my $a2 = $$capture{$p2}[1];
next unless $$a2{'xml:lang'} and $$a2{'xml:lang'} eq $$attr{'xml:lang'};
}
if ($$capture{$p2} and $$capture{$p2}[0] eq $cap{$p}[0]) {
# ($1 contains root path for this structure)
$match{$1} = ($match{$1} || 0) + 1;
}
}
}
my $num = scalar(keys %cap);
foreach $p (keys %match) {
# do nothing unless all fields matched the same structure
next unless $match{$p} == $num;
# delete all elements of this structure
foreach $p2 (@structPaths) {
push @delPaths, $p2 if $p2 =~ /^$p/;
}
# remember path of first deleted structure
$delPath = $p if not $delPath or $delPath gt $p;
}
}
} # (else don't delete anything)
} elsif (@structPaths) {
@delPaths = @structPaths; # delete all
$structPaths[0] =~ /^($pp)/;
$delPath = $1;
}
if (@delPaths) {
my $verbose = $et->Options('Verbose');
@delPaths = sort @delPaths if $verbose > 1;
foreach $p (@delPaths) {
if ($verbose > 1) {
my $p2 = $p;
$p2 =~ s/^(\w+)/$stdXlatNS{$1} || $1/e;
$et->VerboseValue("- XMP-$p2", $$capture{$p}[0]);
}
delete $$capture{$p};
$deleted = 1;
++$$changed;
}
$delPath or warn("Internal error 1 in DeleteStruct\n"), return(undef,undef,$existed);
$$pathPt = $delPath; # return path of first element deleted
} elsif ($$nvHash{TagInfo}{List}) {
# NOTE: we don't yet properly handle lang-alt elements!!!!
if (@structPaths) {
$structPaths[-1] =~ /^($pp)/ or warn("Internal error 2 in DeleteStruct\n"), return(undef,undef,$existed);
my $path = $1;
# delete any improperly formatted xmp
if ($$capture{$path}) {
my $cap = $$capture{$path};
# an error unless this was an empty structure
$et->Error("Improperly structured XMP ($path)",1) if ref $cap ne 'ARRAY' or $$cap[0];
delete $$capture{$path};
}
# (match last index to put in same lang-alt list for Bag of lang-alt items)
$path =~ m/.* (\d+)/g or warn("Internal error 3 in DeleteStruct\n"), return(undef,undef,$existed);
$added = $1;
# add after last item in list
my $len = length $added;
my $pos = pos($path) - $len;
my $nxt = substr($added, 1) + 1;
substr($path, $pos, $len) = length($nxt) . $nxt;
$$pathPt = $path;
} else {
$added = '10';
}
}
return($deleted, $added, $existed);
}
#------------------------------------------------------------------------------
# Add new element to XMP capture hash
# Inputs: 0) ExifTool ref, 1) TagInfo ref, 2) capture hash ref,
# 3) resource path, 4) value ref, 5) hash ref for last used index numbers
sub AddNewTag($$$$$$)
{
my ($et, $tagInfo, $capture, $path, $valPtr, $langIdx) = @_;
my $val = EscapeXML($$valPtr);
my %attrs;
# support writing RDF "resource" values
if ($$tagInfo{Resource}) {
$attrs{'rdf:resource'} = $val;
$val = '';
}
if ($$tagInfo{Writable} and $$tagInfo{Writable} eq 'lang-alt') {
# write the lang-alt tag
my $langCode = $$tagInfo{LangCode};
# add indexed lang-alt list properties
my $i = $$langIdx{$path} || 0;
$$langIdx{$path} = $i + 1; # save next list index
if ($i) {
my $idx = length($i) . $i;
$path =~ s/(.*) \d+/$1 $idx/; # set list index
}
$attrs{'xml:lang'} = $langCode || 'x-default';
}
$$capture{$path} = [ $val, \%attrs ];
# print verbose message
if ($et and $et->Options('Verbose') > 1) {
my $p = $path;
$p =~ s/^(\w+)/$stdXlatNS{$1} || $1/e;
$et->VerboseValue("+ XMP-$p", $val);
}
}
#------------------------------------------------------------------------------
# Add new structure to capture hash for writing
# Inputs: 0) ExifTool object ref (or undef for no warnings),
# 1) tagInfo ref (or undef if no ExifTool), 2) capture hash ref,
# 3) base path, 4) struct ref, 5) struct hash ref
# Returns: number of tags changed
# Notes: Escapes values for XML
sub AddNewStruct($$$$$$)
{
my ($et, $tagInfo, $capture, $basePath, $struct, $strTable) = @_;
my $verbose = $et ? $et->Options('Verbose') : 0;
my ($tag, %langIdx);
my $ns = $$strTable{NAMESPACE} || '';
my $changed = 0;
# add dummy field to allow empty structures (name starts with '~' so it will come
# after all valid structure fields, which is necessary when serializing the XMP later)
%$struct or $$struct{'~dummy~'} = '';
foreach $tag (sort keys %$struct) {
my $fieldInfo = $$strTable{$tag};
unless ($fieldInfo) {
next unless $tag eq '~dummy~'; # check for dummy field
$fieldInfo = { }; # create dummy field info for dummy structure
}
my $val = $$struct{$tag};
my $propPath = $$fieldInfo{PropertyPath};
unless ($propPath) {
$propPath = ($$fieldInfo{Namespace} || $ns) . ':' . ($$fieldInfo{TagID} || $tag);
if ($$fieldInfo{List}) {
$propPath .= "/rdf:$$fieldInfo{List}/rdf:li 10";
}
if ($$fieldInfo{Writable} and $$fieldInfo{Writable} eq 'lang-alt') {
$propPath .= "/rdf:Alt/rdf:li 10";
}
$$fieldInfo{PropertyPath} = $propPath; # save for next time
}
my $path = $basePath . '/' . ConformPathToNamespace($et, $propPath);
my $addedTag;
if (ref $val eq 'HASH') {
my $subStruct = $$fieldInfo{Struct} or next;
$changed += AddNewStruct($et, $tagInfo, $capture, $path, $val, $subStruct);
} elsif (ref $val eq 'ARRAY') {
next unless $$fieldInfo{List};
my $i = 0;
my ($item, $p);
my $level = scalar(() = ($propPath =~ / \d+/g));
# loop through all list items (note: can't yet write multi-dimensional lists)
foreach $item (@{$val}) {
if ($i) {
# update first index in field property (may be list of lang-alt lists)
$p = ConformPathToNamespace($et, $propPath);
my $idx = length($i) . $i;
$p =~ s/ \d+/ $idx/;
$p = "$basePath/$p";
} else {
$p = $path;
}
if (ref $item eq 'HASH') {
my $subStruct = $$fieldInfo{Struct} or next;
AddNewStruct($et, $tagInfo, $capture, $p, $item, $subStruct) or next;
# don't write empty items in upper-level list
} elsif (length $item or (defined $item and $level == 1)) {
AddNewTag($et, $fieldInfo, $capture, $p, \$item, \%langIdx);
$addedTag = 1;
}
++$changed;
++$i;
}
} else {
AddNewTag($et, $fieldInfo, $capture, $path, \$val, \%langIdx);
$addedTag = 1;
++$changed;
}
# this is tricky, but we must add the rdf:type for contained structures
# in the case that a whole hierarchy was added at once by writing a
# flattened tag inside a variable-namespace structure
if ($addedTag and $$fieldInfo{StructType} and $$fieldInfo{Table}) {
AddStructType($et, $$fieldInfo{Table}, $capture, $propPath, $basePath);
}
}
# add 'rdf:type' property if necessary
if ($$strTable{TYPE} and $changed) {
my $path = $basePath . '/' . ConformPathToNamespace($et, "rdf:type");
unless ($$capture{$path}) {
$$capture{$path} = [ '', { 'rdf:resource' => $$strTable{TYPE} } ];
if ($verbose > 1) {
my $p = $path;
$p =~ s/^(\w+)/$stdXlatNS{$1} || $1/e;
$et->VerboseValue("+ XMP-$p", $$strTable{TYPE});
}
}
}
return $changed;
}
#------------------------------------------------------------------------------
# Convert structure field values for printing
# Inputs: 0) ExifTool ref, 1) tagInfo ref for structure tag, 2) value,
# 3) conversion type: PrintConv, ValueConv or Raw (Both not allowed)
# 4) tagID of parent structure (needed only if there was no flattened tag)
# Notes: Makes a copy of the hash so any applied escapes won't affect raw values
sub ConvertStruct($$$$;$)
{
my ($et, $tagInfo, $value, $type, $parentID) = @_;
if (ref $value eq 'HASH') {
my (%struct, $key);
my $table = $$tagInfo{Table};
$parentID = $$tagInfo{TagID} unless $parentID;
foreach $key (keys %$value) {
my $tagID = $parentID . ucfirst($key);
my $flatInfo = $$table{$tagID};
unless ($flatInfo) {
# handle variable-namespace structures
if ($key =~ /^XMP-(.*?:)(.*)/) {
$tagID = $1 . $parentID . ucfirst($2);
$flatInfo = $$table{$tagID};
}
$flatInfo or $flatInfo = $tagInfo;
}
my $v = $$value{$key};
if (ref $v) {
$v = ConvertStruct($et, $flatInfo, $v, $type, $tagID);
} else {
$v = $et->GetValue($flatInfo, $type, $v);
}
$struct{$key} = $v if defined $v; # save the converted value
}
return \%struct;
} elsif (ref $value eq 'ARRAY') {
if (defined $$et{OPTIONS}{ListItem}) {
my $li = $$et{OPTIONS}{ListItem};
return undef unless defined $$value[$li];
undef $$et{OPTIONS}{ListItem}; # only do top-level list
my $val = ConvertStruct($et, $tagInfo, $$value[$li], $type, $parentID);
$$et{OPTIONS}{ListItem} = $li;
return $val;
} else {
my (@list, $val);
foreach $val (@$value) {
my $v = ConvertStruct($et, $tagInfo, $val, $type, $parentID);
push @list, $v if defined $v;
}
return \@list;
}
} else {
return $et->GetValue($tagInfo, $type, $value);
}
}
#------------------------------------------------------------------------------
# Restore XMP structures in extracted information
# Inputs: 0) ExifTool object ref, 1) flag to keep original flattened tags
# Notes: also restores lists (including multi-dimensional)
sub RestoreStruct($;$)
{
local $_;
my ($et, $keepFlat) = @_;
my ($key, %structs, %var, %lists, $si, %listKeys, @siList);
my $valueHash = $$et{VALUE};
my $fileOrder = $$et{FILE_ORDER};
my $tagExtra = $$et{TAG_EXTRA};
foreach $key (keys %{$$et{TAG_INFO}}) {
$$tagExtra{$key} or next;
my $structProps = $$tagExtra{$key}{Struct} or next;
delete $$tagExtra{$key}{Struct}; # (don't re-use)
my $tagInfo = $$et{TAG_INFO}{$key}; # tagInfo for flattened tag
my $table = $$tagInfo{Table};
my $prop = shift @$structProps;
my $tag = $$prop[0];
# get reference to structure tag (or normal list tag if not a structure)
my $strInfo = @$structProps ? $$table{$tag} : $tagInfo;
if ($strInfo) {
ref $strInfo eq 'HASH' or next; # (just to be safe)
if (@$structProps and not $$strInfo{Struct}) {
# this could happen for invalid XMP containing mixed lists
# (or for something like this -- what should we do here?:
# <meta:user-defined meta:name="License">test</meta:user-defined>)
$et->Warn("$$strInfo{Name} is not a structure!") unless $$et{NO_STRUCT_WARN};
next;
}
} else {
# create new entry in tag table for this structure
my $g1 = $$table{GROUPS}{0} || 'XMP';
my $name = $tag;
# tag keys will have a group 1 prefix when coming from import of XML from -X option
if ($tag =~ /(.+):(.+)/) {
my $ns;
($ns, $name) = ($1, $2);
$ns =~ s/^XMP-//; # remove leading "XMP-" if it exists because we add it later
$ns = $stdXlatNS{$ns} if $stdXlatNS{$ns};
$g1 .= "-$ns";
}
$strInfo = {
Name => ucfirst $name,
Groups => { 1 => $g1 },
Struct => 'Unknown',
};
# add Struct entry if this is a structure
if (@$structProps) {
# this is a structure
$$strInfo{Struct} = { STRUCT_NAME => 'XMP Unknown' } if @$structProps;
} elsif ($$tagInfo{LangCode}) {
# this is lang-alt list
$tag = $tag . '-' . $$tagInfo{LangCode};
$$strInfo{LangCode} = $$tagInfo{LangCode};
}
AddTagToTable($table, $tag, $strInfo);
}
# use strInfo ref for base key to avoid collisions
$tag = $strInfo;
my $struct = \%structs;
my $oldStruct = $structs{$strInfo};
# (fyi: 'lang-alt' Writable type will be valid even if tag is not pre-defined)
my $writable = $$tagInfo{Writable} || '';
# walk through the stored structure property information
# to rebuild this structure
my ($err, $i);
for (;;) {
my $index = $$prop[1];
if ($index and not @$structProps) {
# ignore this list if it is a simple lang-alt tag
if ($writable eq 'lang-alt') {
pop @$prop; # remove lang-alt index
undef $index if @$prop < 2;
}
# add language code if necessary
if ($$tagInfo{LangCode} and not ref $tag) {
$tag = $tag . '-' . $$tagInfo{LangCode};
}
}
my $nextStruct = $$struct{$tag};
if (defined $index) {
# the field is a list
$index = substr $index, 1; # remove digit count
if ($nextStruct) {
ref $nextStruct eq 'ARRAY' or $err = 2, last;
$struct = $nextStruct;
} else {
$struct = $$struct{$tag} = [ ];
}
$nextStruct = $$struct[$index];
# descend into multi-dimensional lists
for ($i=2; $$prop[$i]; ++$i) {
if ($nextStruct) {
ref $nextStruct eq 'ARRAY' or last;
$struct = $nextStruct;
} else {
$lists{$struct} = $struct;
$struct = $$struct[$index] = [ ];
}
$nextStruct = $$struct[$index];
$index = substr $$prop[$i], 1;
}
if (ref $nextStruct eq 'HASH') {
$struct = $nextStruct; # continue building sub-structure
} elsif (@$structProps) {
$lists{$struct} = $struct;
$struct = $$struct[$index] = { };
} else {
$lists{$struct} = $struct;
$$struct[$index] = $$valueHash{$key};
last;
}
} else {
if ($nextStruct) {
ref $nextStruct eq 'HASH' or $err = 3, last;
$struct = $nextStruct;
} elsif (@$structProps) {
$struct = $$struct{$tag} = { };
} else {
$$struct{$tag} = $$valueHash{$key};
last;
}
}
$prop = shift @$structProps or last;
$tag = $$prop[0];
if ($tag =~ /(.+):(.+)/) {
# tag in variable-namespace tables will have a leading
# XMP namespace on the tag name. In this case, add
# the corresponding group1 name to the tag ID.
my ($ns, $name) = ($1, $2);
$ns = $stdXlatNS{$ns} if $stdXlatNS{$ns};
$tag = "XMP-$ns:" . ucfirst $name;
} else {
$tag = ucfirst $tag;
}
}
if ($err) {
# this may happen if we have a structural error in the XMP
# (like an improperly contained list for example)
unless ($$et{NO_STRUCT_WARN}) {
my $ns = $$tagInfo{Namespace} || $$tagInfo{Table}{NAMESPACE} || '';
$et->Warn("Error $err placing $ns:$$tagInfo{TagID} in structure or list", 1);
}
delete $structs{$strInfo} unless $oldStruct;
} elsif ($tagInfo eq $strInfo) {
# just a regular list tag (or an empty structure)
if ($oldStruct) {
# keep tag with lowest numbered key (well, not exactly, since
# "Tag (10)" is lt "Tag (2)", but at least "Tag" is lt
# everything else, and this is really what we care about)
my $k = $listKeys{$oldStruct};
if ($k) { # ($k will be undef for an empty structure)
if ($k lt $key) {
# keep lowest file order
$$fileOrder{$k} = $$fileOrder{$key} if $$fileOrder{$k} > $$fileOrder{$key};
$et->DeleteTag($key);
next;
}
$$fileOrder{$key} = $$fileOrder{$k} if $$fileOrder{$key} > $$fileOrder{$k};
$et->DeleteTag($k); # remove tag with greater copy number
}
}
# replace existing value with new list
$$valueHash{$key} = $structs{$strInfo};
$listKeys{$structs{$strInfo}} = $key; # save key for this list tag
} else {
# save strInfo ref and file order
if ($var{$strInfo}) {
# set file order to just before the first associated flattened tag
if ($var{$strInfo}[1] > $$fileOrder{$key}) {
$var{$strInfo}[1] = $$fileOrder{$key} - 0.5;
}
} else {
$var{$strInfo} = [ $strInfo, $$fileOrder{$key} - 0.5 ];
}
# preserve original flattened tags if requested
if ($keepFlat) {
my $extra = $$tagExtra{$key} or next;
# restore list behaviour of this flattened tag
if ($$extra{NoList}) {
$$valueHash{$key} = $$extra{NoList};
delete $$extra{NoList};
} elsif ($$extra{NoListDel}) {
# delete this tag since its value was included another list
$et->DeleteTag($key);
}
} else {
$et->DeleteTag($key); # delete the flattened tag
}
}
}
# fill in undefined items in lists. In theory, undefined list items should
# be fine, but in practice the calling code may not check for this (and
# historically this wasn't necessary, so do this for backward compatibility)
foreach $si (keys %lists) {
defined $_ or $_ = '' foreach @{$lists{$si}};
}
# make a list of all new structures we generated
$var{$_} and push @siList, $_ foreach keys %structs;
# save new structures in the same order they were read from file
foreach $si (sort { $var{$a}[1] <=> $var{$b}[1] } @siList) {
# test to see if a tag for this structure has already been generated
# (this could happen only if one of the structures in a list was empty)
$key = $var{$si}[0]{Name};
my $found;
if ($$valueHash{$key}) {
my @keys = grep /^$key( \(\d+\))?$/, keys %$valueHash;
foreach $key (@keys) {
next unless $$valueHash{$key} eq $structs{$si};
$found = 1;
last;
}
}
unless ($found) {
# otherwise, generate a new tag for this structure
$key = $et->FoundTag($var{$si}[0], '');
$$valueHash{$key} = $structs{$si};
}
$$fileOrder{$key} = $var{$si}[1];
}
}
1; #end
__END__
=head1 NAME
Image::ExifTool::XMPStruct.pl - XMP structure support
=head1 SYNOPSIS
This module is loaded automatically by Image::ExifTool when required.
=head1 DESCRIPTION
This file contains routines to provide read/write support of structured XMP
information.
=head1 AUTHOR
Copyright 2003-2022, Phil Harvey (philharvey66 at gmail.com)
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=head1 SEE ALSO
L<Image::ExifTool::TagNames/XMP Tags>,
L<Image::ExifTool(3pm)|Image::ExifTool>
=cut
| 42.517554 | 117 | 0.472338 |
edb278689bfe90ed789fbf97b8289f9ea218a291 | 4,176 | pl | Perl | scripts/find.unused.limits.pl | ronsavage/Genealogy-Gedcom | 2a91bbc56694c7595ae53efeea89ea78a8940ea0 | [
"Artistic-1.0"
] | null | null | null | scripts/find.unused.limits.pl | ronsavage/Genealogy-Gedcom | 2a91bbc56694c7595ae53efeea89ea78a8940ea0 | [
"Artistic-1.0"
] | null | null | null | scripts/find.unused.limits.pl | ronsavage/Genealogy-Gedcom | 2a91bbc56694c7595ae53efeea89ea78a8940ea0 | [
"Artistic-1.0"
] | null | null | null | #!/usr/bin/env perl
use strict;
use warnings;
use File::Slurper 'read_lines';
# ----------------
# Source of max: Ged551-5.pdf.
# See also Lexer.pm.
my(%max) =
(
address_city => 60,
address_country => 60,
address_email => 120,
address_fax => 60,
address_line => 60,
address_line1 => 60,
address_line2 => 60,
address_line3 => 60,
address_postal_code => 10,
address_state => 60,
address_web_page => 120,
adopted_by_which_parent => 4,
age_at_event => 12,
ancestral_file_number => 12,
approved_system_id => 20,
attribute_descriptor => 90,
attribute_type => 4,
automated_record_id => 12,
caste_name => 90,
cause_of_event => 90,
certainty_assessment => 1,
change_date => 11,
character_set => 8,
child_linkage_status => 15,
copyright_gedcom_file => 90,
copyright_source_data => 90,
count_of_children => 3,
count_of_marriages => 3,
date => 35,
date_approximated => 35,
date_calendar => 35,
date_calendar_escape => 15,
date_exact => 11,
date_fren => 35,
date_greg => 35,
date_hebr => 35,
date_juln => 35,
date_lds_ord => 35,
date_period => 35,
date_phrase => 35,
date_range => 35,
date_value => 35,
day => 2,
descriptive_title => 248,
digit => 1,
entry_recording_date => 90,
event_attribute_type => 15,
event_descriptor => 90,
event_or_fact_classification => 90,
event_type_family => 4,
event_type_individual => 4,
events_recorded => 90,
file_name => 90,
gedcom_content_description => 248,
gedcom_form => 20,
generations_of_ancestors => 4,
generations_of_descendants => 4,
language_id => 15,
language_of_text => 15,
language_preference => 90,
lds_baptism_date_status => 10,
lds_child_sealing_date_status => 10,
lds_endowment_date_status => 10,
lds_spouse_sealing_date_status => 10,
multimedia_file_reference => 30,
multimedia_format => 4,
name_of_business => 90,
name_of_family_file => 120,
name_of_product => 90,
name_of_repository => 90,
name_of_source_data => 90,
name_personal => 120,
name_phonetic_variation => 120,
name_piece => 90,
name_piece_given => 120,
name_piece_nickname => 30,
name_piece_prefix => 30,
name_piece_suffix => 30,
name_piece_surname => 120,
name_piece_surname_prefix => 30,
name_romanized_variation => 120,
name_text => 120,
name_type => 30,
national_id_number => 30,
national_or_tribal_origin => 120,
new_tag => 15,
nobility_type_title => 120,
null => 0,
occupation => 90,
ordinance_process_flag => 3,
pedigree_linkage_type => 7,
permanent_record_file_number => 90,
phone_number => 25,
phonetic_type => 30,
physical_description => 248,
place_hierarchy => 120,
place_latitude => 8,
place_living_ordinance => 120,
place_longitude => 8,
place_name => 120,
place_phonetic_variation => 120,
place_romanized_variation => 120,
place_text => 120,
possessions => 248,
publication_date => 11,
receiving_system_name => 20,
record_identifier => 18,
registered_resource_identifier => 25,
relation_is_descriptor => 25,
religious_affiliation => 90,
responsible_agency => 120,
restriction_notice => 7,
role_descriptor => 25,
role_in_event => 15,
romanized_type => 30,
scholastic_achievement => 248,
sex_value => 7,
social_security_number => 11,
source_call_number => 120,
source_description => 248,
source_descriptive_title => 248,
source_filed_by_entry => 60,
source_jurisdiction_place => 120,
source_media_type => 15,
source_originator => 248,
source_publication_facts => 248,
submitter_name => 60,
submitter_registered_rfn => 30,
submitter_text => 248,
temple_code => 5,
text => 248,
text_from_source => 248,
time_value => 12,
transmission_date => 11,
user_reference_number => 20,
user_reference_type => 40,
version_number => 15,
where_within_source => 248,
year => 4,
year_greg => 7,
);
$max{$_} = 0 for keys %max;
my($input_file_name) = 'lib/Genealogy/Gedcom/Reader/Lexer.pm';
my(@line) = read_lines($input_file_name);
my($last) = $#line;
my($id);
for (my $i = 0; $i <= $last; $i++)
{
if ($line[$i] =~ /^sub tag_(.+)/)
{
$id = $1;
if ($line[$i + 3] =~ /'(.+)'/)
{
$max{$id} = 1;
}
}
}
print "Unused: \n";
for my $i (sort keys %max)
{
print "$i\n" if ($max{$i} == 0);
}
| 22.945055 | 62 | 0.689895 |
ed9d933429c461f5f4fda751569bbee1c9cc9bc5 | 6,405 | al | Perl | benchmark/benchmarks/FASP-benchmarks/data/delaunay-3d/delaunay3d-0222-230-1589.al | krzysg/FaspHeuristic | 1929c40e3fbc49e68b04acfc5522539a18758031 | [
"MIT"
] | null | null | null | benchmark/benchmarks/FASP-benchmarks/data/delaunay-3d/delaunay3d-0222-230-1589.al | krzysg/FaspHeuristic | 1929c40e3fbc49e68b04acfc5522539a18758031 | [
"MIT"
] | null | null | null | benchmark/benchmarks/FASP-benchmarks/data/delaunay-3d/delaunay3d-0222-230-1589.al | krzysg/FaspHeuristic | 1929c40e3fbc49e68b04acfc5522539a18758031 | [
"MIT"
] | null | null | null | 1 10 24 48 51 70 112 163 174 220
2 84 207 217 226
3 6 33 89 109 116 133 145 223 230
4 16 51 59 76 113 114 126 138 145 187
5 12 157 170 203
6 33 230
7 78 96 132 150 179 181 194 197 229
8 4 45 76 126 138 147 163
9 62 66 74 141 213
10 30 63 174
11 15 35 80 84 106
12 14 93 136 157 167 170 203
13 9 61 62 66 74 135 176 200
14 5 46 73 188 203
15 26 71 88 103 106 108 199 222
16 8 35 45 65 114 138 142 145 147 158 161 176
17 81 121 162 165 202
18 3 44 48 70 109 116 154
19 87 90 99 150 182 219 226
20 11 15 35 49 80 92 134 225
21 28 49 56 92 223
22 38 75 111 129 146 148 167 168 169
23 6 55 89 100 102 171
24 10 45 107 124 127 140 146 149 174 192
25 39 79 120
26 11 16 35 54 56 158 161 193 225
27 73 78 132 158 188 219
28 3 18 48 49 112 145 223
29 5 12 94 167 186 203 218
30 1 8 16 24 36 147 174 184 211
31 20 49 80 142 223
32 18 24 31 44 45 80 112
33 23 32 55 143 209 222 223
34 77 149 167 184 211 216
35 2 84 92 108 161
36 13 16 45 54 61 65 66 68 107 138 205
37 2 19 59 78 82 181 182 185 190 208 217 221
38 34 77 97 115 120
39 41 50 79 101 175 187 228
40 50 69 137 165 181 190 221
41 40 52 59 69 101 202
42 9 65 74 106 199 213
43 5 12 14 60 91 110 157 177 188
44 1 24 70 116 133 154 220
45 1 30 112 142 163
46 132 194 203
47 40
48 44 70 109 187
49
50 41 47 69 72 102 104 137 190 202 210 215 228
51 8 48 58 70 174 175
52 17 40 101 139
53 59 61 93 138 157 161 176 224
54 16 42 199
55 6 143 171 180 201
56 4 11 16 20 35 49 142 145
57 12 34 93 94 97 153 167 168 198
58 25 38 64 70 77 111 174 192
59 2 76 86 97 114 117 138 181 187 190 207 216 224
60 9 130 136 144 164 177 200 213
61 30 34 98 107 113 118 147 176 198
62 42 54 106 136 161 164 205
63 8 34 38 51 58 76 77 174 211 216
64 38 52 75 86 105 115 117 120 148 160 169 173 218 227
65 45 54 71 107 199 206
66 42 54 61 62 65 136
67 17 83 121 144 165 218
68 61 65 124 195 198
69 52 72
70 24 109 154 175 192 230
71 20 31 32 45 74 107 112 134 193 213
72 17 25 139 144 152 154 166 196 202 228
73 46 131 157 197
74 36 60 61 65 66 68 124 141 198 200 213
75 122 148 169
76 39 51 101 117
77 22 115 120 127 168 192
78 19 90
79 72 171 175 187 228
80 2 15 33 35 71 143 223 226
81 144 162
82 7 27 78 128 181 197 207 212 221
83 17 75 129
84 80 108 114 123 128 182 219
85 47 99 183 229
86 25 41 52 76 120 181 218
87 7 47 85 150 159 178 179 212 229
88 20 32 71 80 108 199 213 225
89 2 33 80 114 180 187 222
90 7 27 87 99 125 131 155 156 159 189 191 197 219
91 60 119 130 131 144 177
92 2 31 33 49 56 80 89 114 134
93 13 135 136 198 224
94 5 12 22 43 60 91 93 95 129 136 144 156 170 177
95 22 34 77 98 140 168 184
96 87 90 150 156 159
97 12 34 53 113 147 167 216 224 227
98 34 68 124 168 184
99 87 137 150 178 185 210 221
100 39 50 79 89 101 104 187 190 228
101 25 59 64 86 105 175 190
102 55 89 100 104 185
103 19 80 84 88 108 164 191 219 226
104 23 55 79 180 214
105 25 39 52 58 86 120 154 173 175 196
106 16 26 54 164 193 199 213
107 30 32 45 68 74 98 118 140 184
108 11 80 106 164 213 226
109 6 116 133 154 230
110 5 14 46 73 91 131 170 188 203
111 75 77 94 122 144 154 192
112 31 48 49 116 142 145 220 223
113 8 34 53 59 126 135 138
114 2 3 21 35 56 138 145
115 22 58 75 81 105 111 148 154 166 173 192 196
116 1 28 31 32 48 145 220 223
117 38 86 97 120 148 169 216
118 10 16 30 34 36 113 147 184 211
119 60 90 131 155 156 164 172 219
120 51 58 63 76 175 216
121 75 81 83 115 144 160 162 166
122 22 83 125 129 144 156
123 2 37 103 182 208 226
124 95 107 140 168 195
125 83 87 129 159 186 189
126 51 59 76 138
127 22 111 146 192 204 220
128 27 78
129 29 91 156 170 177 186 189 218 227
130 9 43 94 110 136 164
131 27 96 172 179 197
132 37 59 73 82 128 151 194
133 6 18 23 32 33 55 116 143 201 220 223
134 31 49 56
135 34 53 57 61 97 98 118 147 168 176 195
136 9 13 43 74 157 176 200
137 47 87 159 178 202 218 229
138 61 118 176
139 17 69 81 165 166
140 22 34 74 98 146 149 195 204
141 60 93 94 136 200
142 1 8 49 71 134 145
143 19 32 89 99 102 201 208 217
144 17 22 75 83 115 125 129 156 166 189
145 1 8 18 21 48 49 51 187 230
146 111 166 201
147 10 34 63 113 138 163
148 38 168 227
149 77 127 146 184
150 78 82 90 181 183
151 14 27 46 53 59 73 97 128 157 194 224
152 69 139 173 196
153 12 53 59 93 97 135 136
154 24 25 127 133 146 175 192 196 201 220 230
155 96 131
156 91 125 155 159 177
157 14 46 130 161 164 224
158 11 35 53 59 73 84 103 108 114 128 138 151 157 176 219
159 170 177 229
160 52 58 75 81 105 115 139 162 173
161 11 27 42 54 103 106 108 138 158
162 52 64 75 139 169
163 10 16 30 48 51 63 142 145 174
164 9 27 42 73 91 136 158 161 205 213 219
165 50 72 137 144 166 189 202 210
166 17 81 111 127 152 154 160 201
167 38 94 117 129 148 168
168 34 38 94 184 198
169 17 52 67 83 121 122 129 148 167 227
170 29 43 179 186
171 6 25 70 100 104 109 133 154 187 201
172 43 91 96 110 155 156 159
173 52 69 139 166 228
174 70 77 149 211
175 25 58 76 86 171 230
176 36 54 66 93 153 157 161 205
177 5 29 110 125 170 172
178 40 47 50 85 181 190 210 215 221 229
179 96 110 156 159 172 177 181 186 194
180 23 33 102 143
181 41 47 85 132 151 194 212 229
182 78 128 207 208 226
183 7 87 179 181 212
184 24 61 124 140
185 19 143 178 190 210
186 83 137 159 177 181 218
187 2 3 37 51 70 76 101 114 126 175 190 209
188 5 73 90 91 119 130 131 157 164 219
189 67 83 87 99 137 156 159 178 186 201 210 218
190 2 39 41 89 102 181 210 221
191 19 27 78 84 123 128 182 207 219 226
192 25 51 105 149 174 175
193 16 54 56 65 199
194 14 59 110 170 186 197 218
195 22 57 60 74 93 94 95 98 141 168 198
196 25 166 173 192
197 27 46 78 96 110 132 179 181
198 13 98 135 176
199 26 71 213 225
200 93 195 198
201 23 25 72 79 99 102 104 144 165 180 210 215 228
202 40 47 52 69 139 218
203 59 97 151 170 186 194 218 224 227
204 22 34 77 95 146 149
205 13 54 66 136 157 161
206 16 36 45 56 71 134 142 193 225
207 37 78 84 114 123 128 132 151 158
208 19 78 185 212 217 222
209 2 3 21 28 80 89 92 114 145 223
210 47 72 104 137 143 202 215 228
211 10 24 77 147 149 184
212 19 37 78 85 99 150 185
213 15 26 65 103
214 6 23 33 89 100 102 171 187 230
215 102 104 143 180 185 190
216 8 38 76 113 126 147
217 89 102 123 185 190 212 221 226
218 17 40 41 47 52 59 83 122 162 165 169 181 229
219 128 161 213 226
220 24 32 45 146 201
221 85 132 150 181 183 185 212
222 19 32 80 88 103 108 143 185 217
223 32 49 92 143
224 5 12 14 136 153 176
225 11 15 56 71 134 193
226 84 89 208 222
227 12 29 59 86 117 167 218
228 25 41 52 69 101 104 105 152 190 196
229 40 47 179 183 186 189 194
230 18 33 48 51 89 100 133 171 187 | 27.847826 | 57 | 0.716159 |
ed0bdad80af46ed6eabc7ea0c3cb40a3d59d3745 | 669 | al | Perl | benchmark/benchmarks/FASP-benchmarks/data/random/random-0157-90-140.al | krzysg/FaspHeuristic | 1929c40e3fbc49e68b04acfc5522539a18758031 | [
"MIT"
] | null | null | null | benchmark/benchmarks/FASP-benchmarks/data/random/random-0157-90-140.al | krzysg/FaspHeuristic | 1929c40e3fbc49e68b04acfc5522539a18758031 | [
"MIT"
] | null | null | null | benchmark/benchmarks/FASP-benchmarks/data/random/random-0157-90-140.al | krzysg/FaspHeuristic | 1929c40e3fbc49e68b04acfc5522539a18758031 | [
"MIT"
] | null | null | null | 1 36
2 17
3
4 84
5 9
6 17 89
7 12 62 71 81 82
8 1
9 27 62 68
10
11 78
12 11 30 71 76
13
14 13 57 67
15 47
16
17
18 27 34 84
19 21 44 83
20 9 11 82
21
22 42 70 88
23 38 40
24 33
25
26 5 18 39 43
27 15
28 81
29
30 27 32 49 50 80
31 10 43
32
33 71
34
35 5
36 65 88
37 22 45
38 73
39 40
40
41 10 64
42 10 33 53
43 17
44 4 7 16 25 43
45 68 70 82 90
46 63 83
47 31
48 7 36 71 72
49 30 42 73 85
50 43 68
51 62
52 23 48 74
53 59
54 16 56
55 27 61 71
56 32
57
58 15 85
59
60
61 2 24
62 79
63 20 52 88
64 39 56 88
65 9 12 63
66
67 30 77
68 24 27 86
69
70 25 73
71
72 49 50 59 71
73 8 21
74
75
76
77
78 15 33
79
80
81 29 63
82 19 23 72
83 71
84
85
86 61
87 89
88 10 24 28
89 50
90 | 7.433333 | 17 | 0.657698 |
73f68562849afcf9a5b19365ea0305effee2f403 | 2,844 | pm | Perl | lib/Bio/EnsEMBL/DataCheck/Checks/AssemblySeqregion.pm | MatBarba/ensembl-datacheck | 74b93d57ba4e53ba720c12df2d21d8499de46253 | [
"Apache-2.0"
] | 1 | 2018-11-22T15:39:14.000Z | 2018-11-22T15:39:14.000Z | lib/Bio/EnsEMBL/DataCheck/Checks/AssemblySeqregion.pm | MatBarba/ensembl-datacheck | 74b93d57ba4e53ba720c12df2d21d8499de46253 | [
"Apache-2.0"
] | null | null | null | lib/Bio/EnsEMBL/DataCheck/Checks/AssemblySeqregion.pm | MatBarba/ensembl-datacheck | 74b93d57ba4e53ba720c12df2d21d8499de46253 | [
"Apache-2.0"
] | null | null | null | =head1 LICENSE
Copyright [2018] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the 'License');
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an 'AS IS' BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=cut
package Bio::EnsEMBL::DataCheck::Checks::AssemblySeqregion;
use warnings;
use strict;
use Moose;
use Test::More;
use Bio::EnsEMBL::DataCheck::Test::DataCheck;
use Bio::EnsEMBL::DataCheck::Utils qw/sql_count/;
extends 'Bio::EnsEMBL::DataCheck::DbCheck';
use constant {
NAME => 'AssemblySeqregion',
DESCRIPTION => 'assembly and seq_region table are consistent.',
GROUPS => ['assembly', 'core_handover'],
DB_TYPES => ['core'],
TABLES => ['assembly', 'coord_system', 'seq_region'],
PER_DB => 1,
};
sub skip_tests {
my ($self) = @_;
my $sql = 'SELECT COUNT(*) FROM coord_system';
if (! sql_count($self->dba, $sql) ) {
return (1, 'No assembly.');
}
}
sub tests {
my ($self) = @_;
my $desc_1 = 'coord_system table populated';
my $sql_1 = q/
SELECT COUNT(*) FROM coord_system
/;
is_rows_nonzero($self->dba, $sql_1, $desc_1);
my $desc_2 = 'assembly table populated';
my $sql_2 = q/
SELECT COUNT(*) FROM assembly
/;
is_rows_nonzero($self->dba, $sql_2, $desc_2);
my $desc_3 = 'assembly co-ordinates have start and end > 0';
my $sql_3 = q/
SELECT COUNT(*) FROM assembly
WHERE asm_start < 1 OR asm_end < 1 OR cmp_start < 1 OR cmp_end < 1
/;
is_rows_zero($self->dba, $sql_3, $desc_3);
my $desc_4 = 'assembly co-ordinates have end > start';
my $sql_4 = q/
SELECT COUNT(*) FROM assembly
WHERE asm_end < asm_start OR cmp_end < cmp_start
/;
is_rows_zero($self->dba, $sql_4, $desc_4);
my $desc_5 = 'Assembled and component lengths consistent';
my $sql_5 = q/
SELECT COUNT(*) FROM assembly
WHERE (asm_end - asm_start) <> (cmp_end - cmp_start)
/;
is_rows_zero($self->dba, $sql_5, $desc_5);
my $desc_6 = 'assembly and seq_region lengths consistent';
my $diag_6 = 'seq_region length < largest asm_end value';
my $sql_6 = q/
SELECT sr.name AS seq_region_name, sr.length, cs.name AS coord_system_name
FROM
seq_region sr INNER JOIN
coord_system cs ON sr.coord_system_id = cs.coord_system_id INNER JOIN
assembly a ON a.asm_seq_region_id = sr.seq_region_id
GROUP BY a.asm_seq_region_id
HAVING sr.length < MAX(a.asm_end)
/;
is_rows_zero($self->dba, $sql_6, $desc_6, $diag_6);
}
1;
| 28.158416 | 78 | 0.684248 |
ed23d60bdfd946bcdb77031cc64a3029a821537e | 5,952 | t | Perl | perl/src/lib/ExtUtils/t/MM_Unix.t | nokibsarkar/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 2,293 | 2015-01-02T12:46:10.000Z | 2022-03-29T09:45:43.000Z | perl/src/lib/ExtUtils/t/MM_Unix.t | nokibsarkar/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 315 | 2015-05-31T11:55:46.000Z | 2022-01-12T08:36:37.000Z | perl/src/lib/ExtUtils/t/MM_Unix.t | nokibsarkar/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 1,033 | 2015-01-04T07:48:40.000Z | 2022-03-24T09:34:37.000Z | #!/usr/bin/perl -w
BEGIN {
if( $ENV{PERL_CORE} ) {
chdir 't';
@INC = '../lib';
}
else {
unshift @INC, 't/lib';
}
}
chdir 't';
BEGIN {
use Test::More;
if( $^O =~ /^VMS|os2|MacOS|MSWin32|cygwin|beos|netware$/i ) {
plan skip_all => 'Non-Unix platform';
}
else {
plan tests => 110;
}
}
BEGIN { use_ok( 'ExtUtils::MM_Unix' ); }
use strict;
use File::Spec;
my $class = 'ExtUtils::MM_Unix';
# only one of the following can be true
# test should be removed if MM_Unix ever stops handling other OS than Unix
my $os = ($ExtUtils::MM_Unix::Is{OS2} || 0)
+ ($ExtUtils::MM_Unix::Is{Win32} || 0)
+ ($ExtUtils::MM_Unix::Is{Dos} || 0)
+ ($ExtUtils::MM_Unix::Is{VMS} || 0);
cmp_ok ( $os, '<=', 1, 'There can be only one (or none)');
is($ExtUtils::MM_Unix::VERSION, $ExtUtils::MakeMaker::VERSION, 'MM_Unix has a $VERSION');
# when the following calls like canonpath, catdir etc are replaced by
# File::Spec calls, the test's become a bit pointless
foreach ( qw( xx/ ./xx/ xx/././xx xx///xx) ) {
is ($class->canonpath($_), File::Spec->canonpath($_), "canonpath $_");
}
is ($class->catdir('xx','xx'), File::Spec->catdir('xx','xx'),
'catdir(xx, xx) => xx/xx');
is ($class->catfile('xx','xx','yy'), File::Spec->catfile('xx','xx','yy'),
'catfile(xx, xx) => xx/xx');
is ($class->file_name_is_absolute('Bombdadil'),
File::Spec->file_name_is_absolute('Bombdadil'),
'file_name_is_absolute()');
is ($class->path(), File::Spec->path(), 'path() same as File::Spec->path()');
foreach (qw/updir curdir rootdir/)
{
is ($class->$_(), File::Spec->$_(), $_ );
}
foreach ( qw /
c_o
clean
const_cccmd
const_config
const_loadlibs
constants
depend
dist
dist_basics
dist_ci
dist_core
distdir
dist_test
dlsyms
dynamic
dynamic_bs
dynamic_lib
exescan
extliblist
find_perl
fixin
force
guess_name
init_dirscan
init_main
init_others
install
installbin
linkext
lsdir
macro
makeaperl
makefile
manifypods
needs_linking
pasthru
perldepend
pm_to_blib
ppd
prefixify
processPL
quote_paren
realclean
static
static_lib
staticmake
subdir_x
subdirs
test
test_via_harness
test_via_script
tool_autosplit
tool_xsubpp
tools_other
top_targets
writedoc
xs_c
xs_cpp
xs_o
/ )
{
can_ok($class, $_);
}
###############################################################################
# some more detailed tests for the methods above
ok ( join (' ', $class->dist_basics()), 'distclean :: realclean distcheck');
###############################################################################
# has_link_code tests
my $t = bless { NAME => "Foo" }, $class;
$t->{HAS_LINK_CODE} = 1;
is ($t->has_link_code(),1,'has_link_code'); is ($t->{HAS_LINK_CODE},1);
$t->{HAS_LINK_CODE} = 0;
is ($t->has_link_code(),0); is ($t->{HAS_LINK_CODE},0);
delete $t->{HAS_LINK_CODE}; delete $t->{OBJECT};
is ($t->has_link_code(),0); is ($t->{HAS_LINK_CODE},0);
delete $t->{HAS_LINK_CODE}; $t->{OBJECT} = 1;
is ($t->has_link_code(),1); is ($t->{HAS_LINK_CODE},1);
delete $t->{HAS_LINK_CODE}; delete $t->{OBJECT}; $t->{MYEXTLIB} = 1;
is ($t->has_link_code(),1); is ($t->{HAS_LINK_CODE},1);
delete $t->{HAS_LINK_CODE}; delete $t->{MYEXTLIB}; $t->{C} = [ 'Gloin' ];
is ($t->has_link_code(),1); is ($t->{HAS_LINK_CODE},1);
###############################################################################
# libscan
is ($t->libscan('foo/RCS/bar'), '', 'libscan on RCS');
is ($t->libscan('CVS/bar/car'), '', 'libscan on CVS');
is ($t->libscan('SCCS'), '', 'libscan on SCCS');
is ($t->libscan('.svn/something'), '', 'libscan on Subversion');
is ($t->libscan('foo/b~r'), 'foo/b~r', 'libscan on file with ~');
is ($t->libscan('foo/RCS.pm'), 'foo/RCS.pm', 'libscan on file with RCS');
is ($t->libscan('Fatty'), 'Fatty', 'libscan on something not a VC file' );
###############################################################################
# maybe_command
open(FILE, ">command"); print FILE "foo"; close FILE;
SKIP: {
skip("no separate execute mode on VOS", 2) if $^O eq "vos";
ok !$t->maybe_command('command') ,"non executable file isn't a command";
chmod 0755, "command";
ok ($t->maybe_command('command'), "executable file is a command");
}
unlink "command";
###############################################################################
# perl_script (on unix any ordinary, readable file)
my $self_name = $ENV{PERL_CORE} ? '../lib/ExtUtils/t/MM_Unix.t'
: 'MM_Unix.t';
is ($t->perl_script($self_name),$self_name, 'we pass as a perl_script()');
###############################################################################
# PERM_RW and PERM_RWX
$t->init_PERM;
is ($t->{PERM_RW},'644', 'PERM_RW is 644');
is ($t->{PERM_RWX},'755', 'PERM_RWX is 755');
is ($t->{PERM_DIR},'755', 'PERM_DIR is 755');
###############################################################################
# post_constants, postamble, post_initialize
foreach (qw/ post_constants postamble post_initialize/) {
is ($t->$_(),'', "$_() is an empty string");
}
###############################################################################
# replace_manpage_separator
is ($t->replace_manpage_separator('Foo/Bar'),'Foo::Bar','manpage_separator');
###############################################################################
$t->init_linker;
foreach (qw/ EXPORT_LIST PERL_ARCHIVE PERL_ARCHIVE_AFTER /)
{
ok( exists $t->{$_}, "$_ was defined" );
is( $t->{$_}, '', "$_ is empty on Unix");
}
{
$t->{CCFLAGS} = '-DMY_THING';
$t->{LIBPERL_A} = 'libperl.a';
$t->{LIB_EXT} = '.a';
local $t->{NEEDS_LINKING} = 1;
$t->cflags();
# Brief bug where CCFLAGS was being blown away
is( $t->{CCFLAGS}, '-DMY_THING', 'cflags retains CCFLAGS' );
}
| 25.545064 | 89 | 0.53461 |
edb0ad8b8a16260cece4f19abb4b0b4fda2d9368 | 325 | t | Perl | test/blackbox-tests/test-cases/output-obj/run.t | thierry-martinez/dune | e80c901f767a4f904dbbba18d2b5934f33b18e32 | [
"MIT"
] | null | null | null | test/blackbox-tests/test-cases/output-obj/run.t | thierry-martinez/dune | e80c901f767a4f904dbbba18d2b5934f33b18e32 | [
"MIT"
] | null | null | null | test/blackbox-tests/test-cases/output-obj/run.t | thierry-martinez/dune | e80c901f767a4f904dbbba18d2b5934f33b18e32 | [
"MIT"
] | null | null | null | $ dune build @all
$ dune build @runtest
static alias runtest
OK: ./static.exe
dynamic alias runtest
OK: ./dynamic.exe ./test$ext_dll
static alias runtest
OK: ./static.bc
dynamic alias runtest
OK: ./dynamic.exe ./test.bc$ext_dll
# static alias runtest
# OK: ./static.bc.c.exe
| 25 | 37 | 0.624615 |
ed9a244ff6e133d0d7848c22df53a2d20fbbe2e6 | 19,036 | al | Perl | Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/UnreliablePayerMgt.Codeunit.al | AndersLarsenMicrosoft/ALAppExtensions | 31000fa1bb6bedac17a8141e2ac1ab607e466ec5 | [
"MIT"
] | 1 | 2022-03-28T01:20:39.000Z | 2022-03-28T01:20:39.000Z | Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/UnreliablePayerMgt.Codeunit.al | snu-development/ALAppExtensions | 371a27fe48483be776642dde19483a87ae27289c | [
"MIT"
] | null | null | null | Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/UnreliablePayerMgt.Codeunit.al | snu-development/ALAppExtensions | 371a27fe48483be776642dde19483a87ae27289c | [
"MIT"
] | null | null | null | codeunit 11758 "Unreliable Payer Mgt. CZL"
{
var
UnrelPayerServiceSetupCZL: Record "Unrel. Payer Service Setup CZL";
CompanyInformation: Record "Company Information";
UnreliablePayerWSCZL: Codeunit "Unreliable Payer WS CZL";
VATRegNoList: List of [Code[20]];
UnreliablePayerServiceSetupRead: Boolean;
BankAccCodeNotExistQst: Label 'There is no bank account code in the document.\\Do you want to continue?';
BankAccIsForeignQst: Label 'The bank account %1 of vendor %2 is foreign.\\Do you want to continue?', Comment = '%1=Bank Account No.;%2=Vendor No.';
BankAccNotPublicQst: Label 'The bank account %1 of vendor %2 is not public.\\Do you want to continue?', Comment = '%1=Bank Account No.;%2=Vendor No.';
CZCountryCodeTok: Label 'CZ', Locked = true;
ImportSuccessfulMsg: Label 'Import was successful. %1 new entries have been inserted.', Comment = '%1=Processed Entries Count';
VendUnrVATPayerStatusNotCheckedQst: Label 'The unreliability VAT payer status has not been checked for vendor %1 (%2).\\Do you want to continue?', Comment = '%1=Vendor No.;%2=VAT Registration No.';
VendUnrVATPayerQst: Label 'The vendor %1 (%2) is unreliable VAT payer.\\Do you want to continue?', Comment = '%1=Vendor No.;%2=VAT Registration No.';
UnreliablePayerServiceURLTok: Label 'http://adisrws.mfcr.cz/adistc/axis2/services/rozhraniCRPDPH.rozhraniCRPDPHSOAP', Locked = true;
procedure GetUnreliablePayerServiceURL(): Text[250]
begin
GetUnreliablePayerServiceSetup();
exit(UnrelPayerServiceSetupCZL."Unreliable Payer Web Service");
end;
procedure ImportUnrPayerStatus(ShowMessage: Boolean): Boolean
var
ResponseTempBlob: Codeunit "Temp Blob";
InsertEntryCount: Integer;
RemainingRecordCount: Integer;
RecordLimit: Integer;
RecordCountToSend: Integer;
Index: Integer;
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeImportUnrPayerStatus(VATRegNoList, ShowMessage, IsHandled);
if IsHandled then
exit(true);
GetUnreliablePayerServiceSetup();
RemainingRecordCount := GetVATRegNoCount();
if RemainingRecordCount = 0 then
exit(false);
RecordLimit := GetVATRegNoLimit();
Index := 1;
repeat
RecordCountToSend := RecordLimit;
if RemainingRecordCount <= RecordLimit then
RecordCountToSend := RemainingRecordCount;
if not GetUnrPayerStatus(VATRegNoList.GetRange(Index, RecordCountToSend), ResponseTempBlob) then
exit(false);
InsertEntryCount += ImportUnrPayerStatusResponse(ResponseTempBlob);
RemainingRecordCount -= RecordCountToSend;
Index += RecordCountToSend;
until RemainingRecordCount = 0;
OnAfterImportUnrPayerStatusOnBeforeMessage(VATRegNoList, InsertEntryCount);
if ShowMessage then
Message(ImportSuccessfulMsg, InsertEntryCount);
exit(true);
end;
procedure ImportUnrPayerStatusForVendor(Vendor: Record Vendor): Boolean
var
CheckDisabledMsg: Label 'Check is disabled for vendor %1.', Comment = '%1 = Vendor No.';
ServiceNotEnabledMsg: Label 'The unreliable payer service is not enabled.';
VatRegNoEmptyMsg: Label 'Check is not possible.\%1 must not be empty and must match %2 in %3.', Comment = '%1 = VAT Registration No. FieldCaption, %2 = Country/Region CodeFieldCaption, %3 = CompanyInfromation TabeCaption';
begin
GetUnreliablePayerServiceSetup();
if Vendor."Disable Unreliab. Check CZL" then begin
Message(CheckDisabledMsg, Vendor."No.");
exit(false);
end;
if not UnrelPayerServiceSetupCZL.Enabled then begin
Message(ServiceNotEnabledMsg);
exit(false);
end;
if not IsVATRegNoExportPossible(Vendor."VAT Registration No.", Vendor."Country/Region Code") then begin
Message(VatRegNoEmptyMsg, Vendor.FieldCaption("VAT Registration No."), CompanyInformation.FieldCaption("Country/Region Code"), CompanyInformation.TableCaption());
exit(false);
end;
ClearVATRegNoList();
if AddVATRegNoToList(Vendor."VAT Registration No.") then
exit(ImportUnrPayerStatus(true));
end;
procedure ImportUnrPayerList(ShowMessage: Boolean): Boolean
var
ResponseTempBlob: Codeunit "Temp Blob";
InsertEntryCount: Integer;
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeImportUnrPayerList(VATRegNoList, ShowMessage, IsHandled);
if IsHandled then
exit(true);
GetUnreliablePayerServiceSetup();
if not GetUnrPayerList(ResponseTempBlob) then
exit(false);
InsertEntryCount := ImportUnrPayerListResponse(ResponseTempBlob);
OnAfterImportUnrPayerListOnBeforeMessage(InsertEntryCount);
if ShowMessage then
Message(ImportSuccessfulMsg, InsertEntryCount);
exit(true);
end;
local procedure GetUnrPayerStatus(VATRegNoList: List of [Code[20]]; var ResponseTempBlob: Codeunit "Temp Blob"): Boolean
begin
exit(UnreliablePayerWSCZL.GetStatus(VATRegNoList, ResponseTempBlob));
end;
local procedure GetUnrPayerList(var ResponseTempBlob: Codeunit "Temp Blob"): Boolean
begin
exit(UnreliablePayerWSCZL.GetList(ResponseTempBlob));
end;
local procedure ImportUnrPayerStatusResponse(var ResponseTempBlob: Codeunit "Temp Blob"): Integer
var
UnreliablePayerStatusCZL: XMLport "Unreliable Payer Status CZL";
ResponseInStream: InStream;
begin
ResponseTempBlob.CreateInStream(ResponseInStream);
UnreliablePayerStatusCZL.SetSource(ResponseInStream);
UnreliablePayerStatusCZL.Import();
exit(UnreliablePayerStatusCZL.GetInsertEntryCount());
end;
local procedure ImportUnrPayerListResponse(var ResponseTempBlob: Codeunit "Temp Blob"): Integer
var
UnreliablePayerListCZL: XMLport "Unreliable Payer List CZL";
ResponseInStream: InStream;
begin
ResponseTempBlob.CreateInStream(ResponseInStream);
UnreliablePayerListCZL.SetSource(ResponseInStream);
UnreliablePayerListCZL.Import();
exit(UnreliablePayerListCZL.GetInsertEntryCount());
end;
local procedure GetVATRegNoLimit(): Integer
begin
exit(UnreliablePayerWSCZL.GetInputRecordLimit());
end;
local procedure GetUnreliablePayerServiceSetup()
begin
if UnreliablePayerServiceSetupRead then
exit;
if not UnrelPayerServiceSetupCZL.Get() then begin
UnrelPayerServiceSetupCZL.Init();
SetDefaultUnreliablePayerServiceURL(UnrelPayerServiceSetupCZL);
UnrelPayerServiceSetupCZL.Enabled := false;
OnGetUnreliablePayerServiceSetupOnBeforeInsertUnrelPayerServiceSetupCZL(UnrelPayerServiceSetupCZL);
UnrelPayerServiceSetupCZL.Insert();
end;
CompanyInformation.Get();
UnreliablePayerServiceSetupRead := true;
end;
procedure ClearVATRegNoList()
begin
Clear(VATRegNoList);
end;
procedure AddVATRegNoToList(VATRegNo: Code[20]): Boolean
begin
if VATRegNo = '' then
exit(false);
if VATRegNoList.Contains(VATRegNo) then
exit(false);
VATRegNoList.Add(VATRegNo);
exit(true);
end;
procedure GetVATRegNoCount(): Integer
begin
exit(VATRegNoList.Count);
end;
procedure IsVATRegNoExportPossible(VATRegNo: Code[20]; CountryCode: Code[10]) ReturnValue: Boolean
begin
GetUnreliablePayerServiceSetup();
ReturnValue := true;
if ((CountryCode <> '') and (CountryCode <> CompanyInformation."Country/Region Code") and
(CompanyInformation."Country/Region Code" <> '')) or (CopyStr(VATRegNo, 1, 2) <> CZCountryCodeTok) then
ReturnValue := false;
OnAfterIsVATRegNoExportPossible(VATRegNo, CountryCode, ReturnValue);
end;
procedure GetLongVATRegNo(VatRegNo: Code[20]): Code[20]
var
TempCode: Code[1];
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeGetLongVATRegNo(VatRegNo, IsHandled);
if IsHandled then
exit(VatRegNo);
if VatRegNo = '' then
exit;
TempCode := CopyStr(VatRegNo, 1, 1);
if (TempCode >= '0') and (TempCode <= '9') then
exit(CopyStr(CZCountryCodeTok + VatRegNo, 1, 20));
exit(VatRegNo);
end;
procedure GetVendFromVATRegNo(VATRegNo: Code[20]): Code[20]
var
Vendor: Record Vendor;
begin
if VATRegNo = '' then
exit('');
VATRegNo := GetLongVATRegNo(VATRegNo);
Vendor.SetCurrentKey("VAT Registration No.");
Vendor.SetRange("VAT Registration No.", VATRegNo);
Vendor.SetRange(Blocked, Vendor.Blocked::" ");
case true of
Vendor.FindFirst() and (Vendor.Count = 1):
exit(Vendor."No.");
else
exit('');
end;
end;
procedure IsPublicBankAccount(VendNo: Code[20]; VATRegNo: Code[20]; BankAccountNo: Code[30]; IBAN: Code[50]) ReturnValue: Boolean
var
Vendor: Record Vendor;
UnreliablePayerEntryCZL: Record "Unreliable Payer Entry CZL";
begin
if Vendor.Get(VendNo) then
if not Vendor.IsUnreliablePayerCheckPossibleCZL() then
exit;
if VATRegNo = '' then
VATRegNo := Vendor."VAT Registration No.";
if not IsVATRegNoExportPossible(VATRegNo, Vendor."Country/Region Code") then
exit;
UnreliablePayerEntryCZL.SetCurrentKey("VAT Registration No.");
UnreliablePayerEntryCZL.SetRange("VAT Registration No.", VATRegNo);
UnreliablePayerEntryCZL.SetRange("Entry Type", UnreliablePayerEntryCZL."Entry Type"::"Bank Account");
UnreliablePayerEntryCZL.SetRange("End Public Date", 0D);
if BankAccountNo <> '' then begin
UnreliablePayerEntryCZL.SetRange("Full Bank Account No.", BankAccountNo);
ReturnValue := not UnreliablePayerEntryCZL.IsEmpty();
end;
if ReturnValue then
exit;
if IBAN <> '' then begin
UnreliablePayerEntryCZL.SetRange("Full Bank Account No.", IBAN);
ReturnValue := not UnreliablePayerEntryCZL.IsEmpty();
end;
end;
procedure PublicBankAccountCheckPossible(CheckDate: Date; AmountInclVAT: Decimal) CheckIsPossible: Boolean
begin
GetUnreliablePayerServiceSetup();
CheckIsPossible := true;
if UnrelPayerServiceSetupCZL."Public Bank Acc.Chck.Star.Date" <> 0D then
CheckIsPossible := UnrelPayerServiceSetupCZL."Public Bank Acc.Chck.Star.Date" < CheckDate;
if not CheckIsPossible then
exit;
if UnrelPayerServiceSetupCZL."Public Bank Acc.Check Limit" > 0 then
CheckIsPossible := AmountInclVAT >= UnrelPayerServiceSetupCZL."Public Bank Acc.Check Limit";
end;
procedure ForeignBankAccountCheckPossible(VendNo: Code[20]; VendorBankAccountNo: Code[20]): Boolean
var
VendorBankAccount: Record "Vendor Bank Account";
begin
VendorBankAccount.Get(VendNo, VendorBankAccountNo);
exit(not VendorBankAccount.IsStandardFormatBankAccountCZL() and VendorBankAccount.IsForeignBankAccountCZL());
end;
[EventSubscriber(ObjectType::Table, Database::"Service Connection", 'OnRegisterServiceConnection', '', false, false)]
local procedure HandleUnrelPayerServiceConnection(var ServiceConnection: Record "Service Connection")
begin
if not UnrelPayerServiceSetupCZL.Get() then begin
if not UnrelPayerServiceSetupCZL.WritePermission then
exit;
UnrelPayerServiceSetupCZL.Init();
UnrelPayerServiceSetupCZL.Insert();
end;
if UnrelPayerServiceSetupCZL.Enabled then
ServiceConnection.Status := ServiceConnection.Status::Enabled
else
ServiceConnection.Status := ServiceConnection.Status::Disabled;
ServiceConnection.InsertServiceConnection(
ServiceConnection, UnrelPayerServiceSetupCZL.RecordId, UnrelPayerServiceSetupCZL.TableCaption, UnrelPayerServiceSetupCZL."Unreliable Payer Web Service", PAGE::"Unrel. Payer Service Setup CZL");
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Release Purchase Document", 'OnAfterReleasePurchaseDoc', '', false, false)]
local procedure CheckUnreliablePayerOnAfterReleasePurchaseDoc(var PurchaseHeader: Record "Purchase Header"; PreviewMode: Boolean; var LinesWereModified: Boolean)
var
UnreliablePayerEntryCZL: Record "Unreliable Payer Entry CZL";
TotalPurchaseLine: Record "Purchase Line";
TotalLCYPurchaseLine: Record "Purchase Line";
TempPurchaseLine: Record "Purchase Line" temporary;
PurchPost: Codeunit "Purch.-Post";
VATAmount: Decimal;
VATAmountText: Text[30];
begin
GetUnreliablePayerServiceSetup();
PurchaseHeader.CalcFields("Third Party Bank Account CZL", "Amount Including VAT");
if PurchaseHeader."Third Party Bank Account CZL" then
exit;
PurchPost.GetPurchLines(PurchaseHeader, TempPurchaseLine, 0);
Clear(PurchPost);
PurchPost.SumPurchLinesTemp(PurchaseHeader, TempPurchaseLine, 0, TotalPurchaseLine, TotalLCYPurchaseLine, VATAmount, VATAmountText);
if PurchaseHeader.IsUnreliablePayerCheckPossibleCZL() then begin
case PurchaseHeader.GetUnreliablePayerStatusCZL() of
UnreliablePayerEntryCZL."Unreliable Payer"::YES:
ConfirmProcess(StrSubstNo(VendUnrVATPayerQst, PurchaseHeader."Pay-to Vendor No.", PurchaseHeader."VAT Registration No."));
UnreliablePayerEntryCZL."Unreliable Payer"::NOTFOUND:
ConfirmProcess(StrSubstNo(VendUnrVATPayerStatusNotCheckedQst, PurchaseHeader."Pay-to Vendor No.", PurchaseHeader."VAT Registration No."));
end;
if not (PurchaseHeader."Document Type" in [PurchaseHeader."Document Type"::"Credit Memo", PurchaseHeader."Document Type"::"Return Order"]) then begin
if PurchaseHeader."Bank Account Code CZL" = '' then begin
if PublicBankAccountCheckPossible(PurchaseHeader."Posting Date", TotalLCYPurchaseLine."Amount Including VAT") then
ConfirmProcess(BankAccCodeNotExistQst);
exit;
end;
if PublicBankAccountCheckPossible(PurchaseHeader."Posting Date", TotalLCYPurchaseLine."Amount Including VAT") and
not ForeignBankAccountCheckPossible(PurchaseHeader."Pay-to Vendor No.", PurchaseHeader."Bank Account Code CZL") and
not IsPublicBankAccount(PurchaseHeader."Pay-to Vendor No.", PurchaseHeader."VAT Registration No.", PurchaseHeader."Bank Account No. CZL", PurchaseHeader."IBAN CZL")
then
ConfirmProcess(StrSubstNo(BankAccNotPublicQst, PurchaseHeader."Bank Account No. CZL", PurchaseHeader."Pay-to Vendor No."));
if ForeignBankAccountCheckPossible(PurchaseHeader."Pay-to Vendor No.", PurchaseHeader."Bank Account Code CZL") then
ConfirmProcess(StrSubstNo(BankAccIsForeignQst, PurchaseHeader."Bank Account Code CZL", PurchaseHeader."Pay-to Vendor No."));
end;
end;
end;
local procedure ConfirmProcess(ConfirmQuestion: Text)
var
ConfirmManagement: Codeunit "Confirm Management";
IsHandled: Boolean;
begin
OnBeforeConfirmProcess(ConfirmQuestion, IsHandled);
if IsHandled then
exit;
if not IsConfirmDialogAllowed() then
exit;
if not ConfirmManagement.GetResponse(ConfirmQuestion, false) then
Error('');
end;
local procedure IsConfirmDialogAllowed() IsAllowed: Boolean
begin
IsAllowed := GuiAllowed();
OnIsConfirmDialogAllowed(IsAllowed);
end;
procedure CreateUnrelPayerServiceNotSetNotification()
var
ServiceNotSetNotification: Notification;
ServiceNotSetLbl: Label 'Unreliable Payer Service is not set.';
SetupLbl: Label 'Setup';
begin
ServiceNotSetNotification.Message := ServiceNotSetLbl;
ServiceNotSetNotification.Scope := NotificationScope::LocalScope;
ServiceNotSetNotification.AddAction(SetupLbl, Codeunit::"Unreliable Payer Mgt. CZL", 'OpenUnrelPayerServiceSetup');
ServiceNotSetNotification.Send();
end;
procedure OpenUnrelPayerServiceSetup(ServiceNotSetNotification: Notification)
begin
Page.Run(Page::"Unrel. Payer Service Setup CZL");
end;
procedure SetDefaultUnreliablePayerServiceURL(var DefaultUnrelPayerServiceSetupCZL: Record "Unrel. Payer Service Setup CZL")
begin
DefaultUnrelPayerServiceSetupCZL."Unreliable Payer Web Service" := UnreliablePayerServiceURLTok;
OnAfterSetDefaultUnreliablePayerServiceURL(DefaultUnrelPayerServiceSetupCZL);
end;
[IntegrationEvent(false, false)]
local procedure OnAfterIsVATRegNoExportPossible(VATRegNo: Code[20]; CountryCode: Code[10]; var ReturnValue: Boolean)
begin
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeConfirmProcess(ConfirmQuestion: Text; var IsHandled: Boolean);
begin
end;
[IntegrationEvent(false, false)]
local procedure OnIsConfirmDialogAllowed(var IsAllowed: Boolean)
begin
end;
[IntegrationEvent(false, false)]
local procedure OnAfterSetDefaultUnreliablePayerServiceURL(var UnrelPayerServiceSetupCZL: Record "Unrel. Payer Service Setup CZL");
begin
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeImportUnrPayerStatus(VATRegNoList: List of [Code[20]]; ShowMessage: Boolean; var IsHandled: Boolean);
begin
end;
[IntegrationEvent(false, false)]
local procedure OnAfterImportUnrPayerStatusOnBeforeMessage(VATRegNoList: List of [Code[20]]; var InsertEntryCount: Integer);
begin
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeImportUnrPayerList(VATRegNoList: List of [Code[20]]; ShowMessage: Boolean; var IsHandled: Boolean);
begin
end;
[IntegrationEvent(false, false)]
local procedure OnAfterImportUnrPayerListOnBeforeMessage(var InsertEntryCount: Integer);
begin
end;
[IntegrationEvent(false, false)]
local procedure OnGetUnreliablePayerServiceSetupOnBeforeInsertUnrelPayerServiceSetupCZL(var UnrelPayerServiceSetupCZL: Record "Unrel. Payer Service Setup CZL");
begin
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeGetLongVATRegNo(var VatRegNo: Code[20]; var IsHandled: Boolean);
begin
end;
}
| 43.362187 | 231 | 0.688485 |
ed4082ff72a4e61af5df563a58c3181cb5a64752 | 2,099 | pl | Perl | cmd/links.pl | latchdevel/DXspider | e61ab5eeea22241ea8d8f1f6d072f5249901d788 | [
"Artistic-1.0-Perl",
"Artistic-2.0"
] | null | null | null | cmd/links.pl | latchdevel/DXspider | e61ab5eeea22241ea8d8f1f6d072f5249901d788 | [
"Artistic-1.0-Perl",
"Artistic-2.0"
] | null | null | null | cmd/links.pl | latchdevel/DXspider | e61ab5eeea22241ea8d8f1f6d072f5249901d788 | [
"Artistic-1.0-Perl",
"Artistic-2.0"
] | null | null | null | #
# links : which are active
# a complete list of currently connected linked nodes
#
# Created by Iain Philipps G0RDI, based entirely on
# who.pl, which is Copyright (c) 1999 Dirk Koopman G1TLH
# and subsequently plagerized by K1XX.
#
# 16-Jun-2000
#
#
my $self = shift;
my $dxchan;
my @out;
my $nowt = time;
push @out, " Ave Obs Ping Next Filters";
push @out, " Callsign Type Started Uptime RTT Count Int. Ping Iso? In Out PC92? Address";
foreach $dxchan ( sort {$a->call cmp $b->call} DXChannel::get_all ) {
next if $dxchan == $main::me;
next unless $dxchan->is_node || $dxchan->is_rbn;
my $call = $dxchan->call();
my $t = cldatetime($dxchan->startt);
my $sort;
my $name = $dxchan->user->name || " ";
my $obscount = $dxchan->nopings;
my $pingint = $dxchan->pingint;
my $lastt = $dxchan->lastping ? ($dxchan->pingint - ($nowt - $dxchan->lastping)) : $pingint;
my $ping = sprintf("%7.2f", $dxchan->pingave || 0);
my $iso = $dxchan->isolate ? 'Y' : ' ';
my $uptime = difft($dxchan->startt, 1);
my ($fin, $fout, $pc92) = (' ', ' ', ' ');
if ($dxchan->do_pc9x) {
$pc92 = 'Y';
} else {
my $f;
if ($f = $dxchan->inroutefilter) {
$fin = $dxchan->inroutefilter =~ /node_default/ ? 'D' : 'Y';
}
if ($f = $dxchan->routefilter) {
$fout = $dxchan->routefilter =~ /node_default/ ? 'D' : 'Y';
}
}
unless ($pingint && $ping) {
$lastt = 0;
$ping = ' ';
$obscount = ' ';
}
$sort = "DXSP" if $dxchan->is_spider;
$sort = "CLX " if $dxchan->is_clx;
$sort = "DXNT" if $dxchan->is_dxnet;
$sort = "AR-C" if $dxchan->is_arcluster;
$sort = "AK1A" if $dxchan->is_ak1a;
$sort = "RBN " if $dxchan->is_rbn;
my $ipaddr;
my $addr = $dxchan->hostname;
if ($addr) {
$ipaddr = $addr if is_ipaddr($addr);
$ipaddr = 'local' if $addr =~ /^127\./ || $addr =~ /^::[0-9a-f]+$/;
}
$ipaddr = 'ax25' if $dxchan->conn->ax25;
push @out, sprintf "%10s $sort $t%13s$ping $obscount %5d %5d $iso $fin $fout $pc92 $ipaddr", $call, $uptime ,$pingint, $lastt;
}
return (1, @out)
| 27.986667 | 141 | 0.568842 |
edba1632b24e5aef6cdbb072802c3032614db7a9 | 4,185 | pm | Perl | tests/console/systemd_nspawn.pm | dzedro/os-autoinst-distri-opensuse | 716dec60153c8353199cbc25bd478f22dbd41d1e | [
"FSFAP"
] | null | null | null | tests/console/systemd_nspawn.pm | dzedro/os-autoinst-distri-opensuse | 716dec60153c8353199cbc25bd478f22dbd41d1e | [
"FSFAP"
] | 1 | 2015-01-28T09:17:48.000Z | 2015-01-28T13:39:08.000Z | tests/console/systemd_nspawn.pm | dzedro/os-autoinst-distri-opensuse | 716dec60153c8353199cbc25bd478f22dbd41d1e | [
"FSFAP"
] | null | null | null | # SUSE's openQA tests
#
# Copyright © 2021 SUSE LLC
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
# Package: systemd-container
# Summary: Test systemd-nspawn "chroots", booting systemd and starting from OCI bundle
# Maintainer: Dominik Heidler <[email protected]>
use base 'opensusebasetest';
use testapi;
use utils;
use version_utils;
use strict;
use warnings;
sub run {
my ($self) = @_;
$self->select_serial_terminal;
zypper_call 'in systemd-container';
record_info 'setup';
if (script_run("test -d /var/lib/machines/") != 0) {
record_info('workaround', "/var/lib/machines/ wasn't created by systemd-container RPM\nCreating it now.");
assert_script_run("mkdir -p /var/lib/machines/");
}
my $pkg_repo = get_var('MIRROR_HTTP', 'dvd:/?devices=/dev/sr0');
my $release_pkg = (is_sle) ? 'sles-release' : 'openSUSE-release';
my $packages = "systemd shadow zypper $release_pkg";
my $machine = "test1";
my $path = "/var/lib/machines/$machine";
if (is_sle) {
$pkg_repo =~ s/Online/Full/; # only the full image contains the required pkgs
my $rel_repo = $pkg_repo . '/Product-SLES/';
$pkg_repo = $pkg_repo . '/Module-Basesystem/';
zypper_call("--root $path --gpg-auto-import-keys addrepo $rel_repo relrepo");
}
zypper_call("--root $path --gpg-auto-import-keys addrepo $pkg_repo defaultrepo");
zypper_call("--root $path --gpg-auto-import-keys refresh");
zypper_call("--root $path install --no-recommends -ly $packages", exitcode => [0, 107]);
record_info 'chroot';
type_string "systemd-nspawn -M $machine --bind /dev/$serialdev\n";
assert_script_run "date";
assert_script_run "echo foobar | tee /foo.txt";
type_string "exit\n";
assert_script_run "grep foobar $path/foo.txt";
assert_script_run "rm $path/foo.txt";
record_info 'boot';
systemctl 'start systemd-nspawn@' . $machine;
systemctl 'status systemd-nspawn@' . $machine;
# Wait for container to boot
script_retry "systemd-run -tM $machine /bin/bash -c date", retry => 30, delay => 5;
assert_script_run "systemd-run -tM $machine /bin/bash -c 'systemctl status' | grep -A1 test1 | grep State: | grep running";
systemctl 'stop systemd-nspawn@' . $machine;
record_info 'machinectl';
assert_script_run "machinectl list-images | grep -B1 -A2 test1";
assert_script_run "machinectl start test1";
# Wait for container to boot
script_retry "systemd-run -tM $machine /bin/bash -c date", retry => 30, delay => 5;
assert_script_run "machinectl list | grep -B1 -A2 test1";
assert_script_run "machinectl shell $machine /bin/echo foobar | grep foobar";
assert_script_run 'machinectl shell messagebus@' . $machine . ' /usr/bin/whoami | grep messagebus';
assert_script_run "machinectl shell $machine /usr/bin/systemctl status systemd-journald | grep -B100 -A100 'active (running)'";
assert_script_run "machinectl stop test1";
assert_script_run "rm -rf $path";
record_info 'oci bundle';
assert_script_run 'cd /tmp/';
assert_script_run 'wget -O oci_testbundle.tgz ' . data_url('oci_testbundle.tgz');
assert_script_run 'tar xf oci_testbundle.tgz';
assert_script_run 'ls -l oci_testbundle';
if (!check_var('ARCH', 'x86_64')) {
# our bundle is x86_64 but is essentially only busybox
# so we'll simply replace the binary with one of the right arch
zypper_call 'in busybox-static';
assert_script_run 'cp -v /usr/bin/busybox-static ./oci_testbundle/rootfs/bin/busybox';
}
if (script_run('systemd-nspawn --oci-bundle=/tmp/oci_testbundle |& grep "Failed to resolve path rootfs"') == 0) {
record_soft_failure 'bsc#1182598 - Loading rootfs from OCI bundle not according to specification';
assert_script_run 'cd oci_testbundle';
}
assert_script_run 'systemd-nspawn --oci-bundle=/tmp/oci_testbundle | grep "Hello World"';
assert_script_run 'cd';
}
1;
| 44.052632 | 131 | 0.686738 |
edc44abf0155e0e2316cdc62f59b5222d14e538e | 349 | pl | Perl | perl/wiggle.pl | clayne/libunistd | cd7963e4ee14f16bb0ceeab0fa908621580d5c43 | [
"MIT"
] | 103 | 2016-11-12T17:53:59.000Z | 2022-03-26T09:20:17.000Z | perl/wiggle.pl | asokolsky/libunistd | 8002a231e913e56726369d4901486dc7318391f6 | [
"MIT"
] | 7 | 2018-07-18T15:56:02.000Z | 2021-06-23T03:00:08.000Z | perl/wiggle.pl | asokolsky/libunistd | 8002a231e913e56726369d4901486dc7318391f6 | [
"MIT"
] | 26 | 2016-12-05T15:52:17.000Z | 2022-03-15T00:40:37.000Z | #!/usr/bin/perl
# apt-get install libfile-find-rule-perl
# Doesn't work: perl -MCPAN -e'install File::Find::Rule'
use File::Find::Rule;
my @files = File::Find::Rule->file()->name( '*.rej' )->in( '.' );
for my $rej (@files)
{ my $orig = substr($rej,0,-4);
my $cmd = "wiggle --replace $orig $rej";
print "$cmd\n";
system($cmd);
}
print "done\n"
| 23.266667 | 65 | 0.604585 |
Subsets and Splits