hexsha
stringlengths 40
40
| size
int64 3
1.05M
| ext
stringclasses 163
values | lang
stringclasses 53
values | max_stars_repo_path
stringlengths 3
945
| max_stars_repo_name
stringlengths 4
112
| max_stars_repo_head_hexsha
stringlengths 40
78
| max_stars_repo_licenses
listlengths 1
10
| max_stars_count
float64 1
191k
⌀ | max_stars_repo_stars_event_min_datetime
stringlengths 24
24
⌀ | max_stars_repo_stars_event_max_datetime
stringlengths 24
24
⌀ | max_issues_repo_path
stringlengths 3
945
| max_issues_repo_name
stringlengths 4
113
| max_issues_repo_head_hexsha
stringlengths 40
78
| max_issues_repo_licenses
listlengths 1
10
| max_issues_count
float64 1
116k
⌀ | max_issues_repo_issues_event_min_datetime
stringlengths 24
24
⌀ | max_issues_repo_issues_event_max_datetime
stringlengths 24
24
⌀ | max_forks_repo_path
stringlengths 3
945
| max_forks_repo_name
stringlengths 4
113
| max_forks_repo_head_hexsha
stringlengths 40
78
| max_forks_repo_licenses
listlengths 1
10
| max_forks_count
float64 1
105k
⌀ | max_forks_repo_forks_event_min_datetime
stringlengths 24
24
⌀ | max_forks_repo_forks_event_max_datetime
stringlengths 24
24
⌀ | content
stringlengths 3
1.05M
| avg_line_length
float64 1
966k
| max_line_length
int64 1
977k
| alphanum_fraction
float64 0
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
73eb4ce9a03d468ffebf51485c86909c85075a4e | 1,698 | pm | Perl | lib/MusicBrainz/WWW/Mechanize.pm | briaguya-ai/musicbrainz-server | e79323df0641f3928333bdd5241b81edc9c0293d | [
"BSD-2-Clause"
]
| 2 | 2021-07-29T00:32:12.000Z | 2021-07-29T04:13:43.000Z | lib/MusicBrainz/WWW/Mechanize.pm | navap/musicbrainz-server | 75162fb76e8a55d6c578a527fbcbfab5d7e4c5c8 | [
"BSD-2-Clause"
]
| null | null | null | lib/MusicBrainz/WWW/Mechanize.pm | navap/musicbrainz-server | 75162fb76e8a55d6c578a527fbcbfab5d7e4c5c8 | [
"BSD-2-Clause"
]
| 1 | 2021-07-28T23:16:30.000Z | 2021-07-28T23:16:30.000Z | package MusicBrainz::WWW::Mechanize;
use Moose;
use LWP::Authen::Digest;
extends 'Test::WWW::Mechanize::Catalyst';
around '_make_request' => sub
{
my $orig = shift;
my $self = shift;
my $request = shift;
my $response = $self->$orig($request, @_);
# Test::WWW::Mechanize::Catalyst doesn't seem to do digest authentication.
# So let's do it ourselves here, every request which results in a '401'
# response is attempted again with the credentials set using ->credentials.
if ($response->headers->{status} eq '401' && defined($response->headers->{'www-authenticate'})) {
my @challenge = $response->headers->header('WWW-Authenticate');
for my $challenge (@challenge) {
$challenge =~ tr/,/;/;
($challenge) = HTTP::Headers::Util::split_header_words($challenge);
my $scheme = shift(@$challenge);
next unless $scheme eq 'digest';
shift(@$challenge); # no value
$challenge = { @$challenge }; # make rest into a hash
my ($username, $password) = $self->credentials(
$request->uri->host.":".$request->uri->port, $challenge->{realm});
my $size = length($request->content);
$response = LWP::Authen::Digest->authenticate(
$self, undef, $challenge, $response, $request, undef, $size);
last;
}
}
return $response;
};
1;
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2010 MetaBrainz Foundation
This file is part of MusicBrainz, the open internet music database,
and is licensed under the GPL version 2, or (at your option) any
later version: http://www.gnu.org/licenses/gpl-2.0.txt
=cut
| 30.872727 | 101 | 0.61543 |
ed031ce28fd6084e8789a71d60c8b28e195d1235 | 1,485 | pl | Perl | scripts/auth_db_to_mysql.pl | Multiplayer-italia/AuthMe-Reloaded | f3e6a1cf639f0bd0ce2fcd041aed4802699cc4b3 | [
"Apache-2.0"
]
| 1 | 2019-01-17T09:12:44.000Z | 2019-01-17T09:12:44.000Z | scripts/auth_db_to_mysql.pl | Multiplayer-italia/AuthMe-Reloaded | f3e6a1cf639f0bd0ce2fcd041aed4802699cc4b3 | [
"Apache-2.0"
]
| 3 | 2015-07-21T15:22:57.000Z | 2015-10-31T17:22:07.000Z | scripts/auth_db_to_mysql.pl | Multiplayer-italia/AuthMe-Reloaded | f3e6a1cf639f0bd0ce2fcd041aed4802699cc4b3 | [
"Apache-2.0"
]
| 2 | 2017-01-09T06:17:55.000Z | 2017-02-24T13:10:49.000Z | #!/usr/bin/perl
use strict;
use warnings;
use DBI;
##############################
# EDIT THESE CONFIG SETTINGS #
##############################
my $host = "localhost";
my $database = "authme";
my $username = "authme";
my $password = "password";
my $auth_file = "/opt/craftbukkit/plugins/auths.db";
###############################
# DO NOT EDIT BELOW THIS LINE #
###############################
open FILE, "$auth_file" or die $!;
my $dbh = DBI->connect("DBI:mysql:$database;host=$host", "$username", "$password") or die "Could not connect to database: $DBI::errstr";
$dbh->do('CREATE TABLE `authme` (
`id` INTEGER AUTO_INCREMENT,
`username` VARCHAR(255) NOT NULL,
`password` VARCHAR(255) NOT NULL,
`ip` VARCHAR(40) NOT NULL,
`lastlogin` BIGINT,
CONSTRAINT `table_const_prim` PRIMARY KEY (`id`));');
my $st = 'INSERT INTO `authme` (`username`, `password`, `ip`, `lastlogin`) VALUES ';
my $i = 0;
while(<FILE>) {
if($i == 1000) {
$i = 0;
$dbh->do($st);
$st = 'INSERT INTO `authme` (`username`, `password`, `ip`, `lastlogin`) VALUES ';
}
my @auth = split(':');
if($i != 0) {
$st .= ", ";
}
$st .= "(\"$auth[0]\", \"$auth[1]\", ";
$st .= "\"" . ($auth[2] || '198.18.0.1') . "\", ";
$st .= ($auth[3] || '0') . ")";
$i++;
}
if($i > 0) {
$dbh->do($st);
}
$dbh->disconnect();
close FILE;
| 24.75 | 137 | 0.461279 |
73f8eb43ead76179d7fccb6ff98150dde7396ad3 | 355,912 | pl | Perl | DB_HISTORY/r160_200502/regbus.pl | Grognak88/GTFS_to_BussTUC | 9fef15cb25a20c0e2090a096865c7d588e233375 | [
"MIT"
]
| null | null | null | DB_HISTORY/r160_200502/regbus.pl | Grognak88/GTFS_to_BussTUC | 9fef15cb25a20c0e2090a096865c7d588e233375 | [
"MIT"
]
| null | null | null | DB_HISTORY/r160_200502/regbus.pl | Grognak88/GTFS_to_BussTUC | 9fef15cb25a20c0e2090a096865c7d588e233375 | [
"MIT"
]
| null | null | null | /* -*- Mode:Prolog; coding:utf-8; -*- */
regbus(1).
regbus(10).
regbus(1001).
regbus(101).
regbus(102).
regbus(103).
regbus(104).
regbus(105).
regbus(106).
regbus(107).
regbus(108).
regbus(109).
regbus(11).
regbus(110).
regbus(111).
regbus(112).
regbus(113).
regbus(114).
regbus(115).
regbus(116).
regbus(12).
regbus(13).
regbus(14).
regbus(15).
regbus(16).
regbus(2).
regbus(20).
regbus(201).
regbus(202).
regbus(203).
regbus(204).
regbus(205).
regbus(206).
regbus(207).
regbus(208).
regbus(209).
regbus(21).
regbus(210).
regbus(211).
regbus(212).
regbus(214).
regbus(215).
regbus(216).
regbus(217).
regbus(22).
regbus(23).
regbus(24).
regbus(25).
regbus(26).
regbus(28).
regbus(3).
regbus(310).
regbus(320).
regbus(330).
regbus(340).
regbus(350).
regbus(40).
regbus(41).
regbus(410).
regbus(4101).
regbus(42).
regbus(420).
regbus(421).
regbus(43).
regbus(44).
regbus(440).
regbus(45).
regbus(450).
regbus(451).
regbus(453).
regbus(455).
regbus(46).
regbus(460).
regbus(470).
regbus(480).
regbus(490).
regbus(50).
regbus(5001).
regbus(5002).
regbus(5003).
regbus(5004).
regbus(5005).
regbus(5006).
regbus(5008).
regbus(5009).
regbus(5010).
regbus(504).
regbus(505).
regbus(51).
regbus(510).
regbus(5100).
regbus(5101).
regbus(5102).
regbus(5103).
regbus(5104).
regbus(5105).
regbus(5106).
regbus(5107).
regbus(5109).
regbus(511).
regbus(5110).
regbus(5111).
regbus(515).
regbus(52).
regbus(5201).
regbus(5202).
regbus(5205).
regbus(5206).
regbus(5207).
regbus(5208).
regbus(5209).
regbus(521).
regbus(5210).
regbus(5212).
regbus(524).
regbus(53).
regbus(5300).
regbus(5301).
regbus(5302).
regbus(5305).
regbus(535).
regbus(54).
regbus(540).
regbus(5400).
regbus(5401).
regbus(5402).
regbus(5403).
regbus(5404).
regbus(5406).
regbus(541).
regbus(543).
regbus(544).
regbus(5471).
regbus(5472).
regbus(5473).
regbus(5474).
regbus(5475).
regbus(5476).
regbus(5501).
regbus(5502).
regbus(5504).
regbus(5505).
regbus(5507).
regbus(552).
regbus(5521).
regbus(5522).
regbus(5523).
regbus(553).
regbus(5530).
regbus(5532).
regbus(5533).
regbus(5534).
regbus(5535).
regbus(5551).
regbus(5552).
regbus(5554).
regbus(5555).
regbus(5556).
regbus(5557).
regbus(5558).
regbus(558).
regbus(5601).
regbus(5602).
regbus(5603).
regbus(5604).
regbus(5605).
regbus(5606).
regbus(5607).
regbus(5608).
regbus(5609).
regbus(561).
regbus(5610).
regbus(5701).
regbus(5702).
regbus(5703).
regbus(5704).
regbus(5705).
regbus(5706).
regbus(5707).
regbus(580).
regbus(5801).
regbus(5802).
regbus(5803).
regbus(5805).
regbus(5901).
regbus(5902).
regbus(5903).
regbus(5904).
regbus(5905).
regbus(5906).
regbus(591).
regbus(592).
regbus(593).
regbus(594).
regbus(595).
regbus(596).
regbus(597).
regbus(5992).
regbus(601).
regbus(603).
regbus(604).
regbus(605).
regbus(606).
regbus(608).
regbus(609).
regbus(610).
regbus(611).
regbus(615).
regbus(630).
regbus(635).
regbus(640).
regbus(660).
regbus(665).
regbus(670).
regbus(680).
regbus(681).
regbus(685).
regbus(686).
regbus(690).
regbus(695).
regbus(70).
regbus(71).
regbus(7101).
regbus(7105).
regbus(7106).
regbus(7109).
regbus(7111).
regbus(72).
regbus(7201).
regbus(7202).
regbus(7203).
regbus(7204).
regbus(7205).
regbus(7206).
regbus(7207).
regbus(7208).
regbus(7209).
regbus(721).
regbus(7210).
regbus(722).
regbus(723).
regbus(73).
regbus(7301).
regbus(7302).
regbus(7303).
regbus(7304).
regbus(7305).
regbus(7306).
regbus(7307).
regbus(7308).
regbus(7309).
regbus(7310).
regbus(7311).
regbus(7312).
regbus(7313).
regbus(7314).
regbus(7315).
regbus(7316).
regbus(7317).
regbus(7318).
regbus(7319).
regbus(732).
regbus(7320).
regbus(7321).
regbus(7322).
regbus(7323).
regbus(7324).
regbus(7327).
regbus(7328).
regbus(7329).
regbus(733).
regbus(7330).
regbus(74).
regbus(7402).
regbus(7403).
regbus(7404).
regbus(7405).
regbus(7406).
regbus(7408).
regbus(7409).
regbus(741).
regbus(7410).
regbus(7411).
regbus(7412).
regbus(7414).
regbus(7415).
regbus(7416).
regbus(7417).
regbus(7418).
regbus(7419).
regbus(742).
regbus(7420).
regbus(7421).
regbus(7422).
regbus(7423).
regbus(7424).
regbus(7425).
regbus(7426).
regbus(7427).
regbus(7429).
regbus(7430).
regbus(7431).
regbus(7432).
regbus(75).
regbus(750).
regbus(7501).
regbus(7502).
regbus(7503).
regbus(7504).
regbus(7505).
regbus(7506).
regbus(7507).
regbus(7510).
regbus(7511).
regbus(7512).
regbus(7514).
regbus(7515).
regbus(7517).
regbus(7519).
regbus(7520).
regbus(7521).
regbus(76).
regbus(7603).
regbus(7604).
regbus(7605).
regbus(7606).
regbus(7607).
regbus(7608).
regbus(7609).
regbus(761).
regbus(762).
regbus(763).
regbus(77).
regbus(770).
regbus(7701).
regbus(7702).
regbus(7703).
regbus(7705).
regbus(7706).
regbus(7707).
regbus(7708).
regbus(7709).
regbus(7710).
regbus(7711).
regbus(7712).
regbus(7720).
regbus(7721).
regbus(7722).
regbus(78).
regbus(7801).
regbus(7802).
regbus(7804).
regbus(7807).
regbus(7808).
regbus(7809).
regbus(781).
regbus(7810).
regbus(7811).
regbus(7813).
regbus(7814).
regbus(7815).
regbus(7816).
regbus(782).
regbus(784).
regbus(785).
regbus(79).
regbus(7901).
regbus(7902).
regbus(7903).
regbus(7904).
regbus(7905).
regbus(7906).
regbus(7908).
regbus(7910).
regbus(7911).
regbus(7913).
regbus(80).
regbus(800).
regbus(805).
regbus(81).
regbus(810).
regbus(82).
regbus(820).
regbus(825).
regbus(83).
regbus(830).
regbus(835).
regbus(85).
regbus(850).
regbus(855).
regbus(86).
regbus(860).
regbus(870).
regbus(88).
regbus(880).
regbus(9).
regbus(910).
regbus(920).
regbus(950).
regbus(963).
regbus(966).
regbus(980).
route(bus_1001_1,1001,1001).
route(bus_1001_11,1001,1001).
route(bus_1001_3,1001,1001).
route(bus_1001_5,1001,1001).
route(bus_1001_7,1001,1001).
route(bus_1001_9,1001,1001).
route(bus_101_6002,101,101).
route(bus_101_6004,101,101).
route(bus_101_6006,101,101).
route(bus_102_6002,102,102).
route(bus_102_6004,102,102).
route(bus_102_6006,102,102).
route(bus_103_6002,103,103).
route(bus_103_6004,103,103).
route(bus_103_6006,103,103).
route(bus_104_6002,104,104).
route(bus_104_6004,104,104).
route(bus_104_6006,104,104).
route(bus_105_6002,105,105).
route(bus_105_6004,105,105).
route(bus_105_6006,105,105).
route(bus_106_6002,106,106).
route(bus_106_6004,106,106).
route(bus_106_6006,106,106).
route(bus_107_6002,107,107).
route(bus_107_6004,107,107).
route(bus_107_6006,107,107).
route(bus_108_6002,108,108).
route(bus_108_6004,108,108).
route(bus_108_6006,108,108).
route(bus_109_6002,109,109).
route(bus_109_6004,109,109).
route(bus_109_6006,109,109).
route(bus_10_1,10,10).
route(bus_10_10,10,10).
route(bus_10_100,10,10).
route(bus_10_101,10,10).
route(bus_10_102,10,10).
route(bus_10_103,10,10).
route(bus_10_104,10,10).
route(bus_10_105,10,10).
route(bus_10_106,10,10).
route(bus_10_107,10,10).
route(bus_10_108,10,10).
route(bus_10_109,10,10).
route(bus_10_11,10,10).
route(bus_10_110,10,10).
route(bus_10_111,10,10).
route(bus_10_112,10,10).
route(bus_10_113,10,10).
route(bus_10_114,10,10).
route(bus_10_115,10,10).
route(bus_10_116,10,10).
route(bus_10_117,10,10).
route(bus_10_118,10,10).
route(bus_10_119,10,10).
route(bus_10_12,10,10).
route(bus_10_120,10,10).
route(bus_10_121,10,10).
route(bus_10_122,10,10).
route(bus_10_123,10,10).
route(bus_10_124,10,10).
route(bus_10_125,10,10).
route(bus_10_126,10,10).
route(bus_10_127,10,10).
route(bus_10_128,10,10).
route(bus_10_129,10,10).
route(bus_10_13,10,10).
route(bus_10_130,10,10).
route(bus_10_131,10,10).
route(bus_10_132,10,10).
route(bus_10_133,10,10).
route(bus_10_134,10,10).
route(bus_10_135,10,10).
route(bus_10_136,10,10).
route(bus_10_137,10,10).
route(bus_10_138,10,10).
route(bus_10_139,10,10).
route(bus_10_14,10,10).
route(bus_10_140,10,10).
route(bus_10_141,10,10).
route(bus_10_142,10,10).
route(bus_10_143,10,10).
route(bus_10_144,10,10).
route(bus_10_145,10,10).
route(bus_10_15,10,10).
route(bus_10_16,10,10).
route(bus_10_17,10,10).
route(bus_10_18,10,10).
route(bus_10_19,10,10).
route(bus_10_2,10,10).
route(bus_10_20,10,10).
route(bus_10_21,10,10).
route(bus_10_22,10,10).
route(bus_10_23,10,10).
route(bus_10_24,10,10).
route(bus_10_25,10,10).
route(bus_10_26,10,10).
route(bus_10_27,10,10).
route(bus_10_28,10,10).
route(bus_10_29,10,10).
route(bus_10_3,10,10).
route(bus_10_30,10,10).
route(bus_10_31,10,10).
route(bus_10_32,10,10).
route(bus_10_33,10,10).
route(bus_10_34,10,10).
route(bus_10_35,10,10).
route(bus_10_36,10,10).
route(bus_10_37,10,10).
route(bus_10_38,10,10).
route(bus_10_39,10,10).
route(bus_10_4,10,10).
route(bus_10_40,10,10).
route(bus_10_41,10,10).
route(bus_10_42,10,10).
route(bus_10_43,10,10).
route(bus_10_44,10,10).
route(bus_10_45,10,10).
route(bus_10_46,10,10).
route(bus_10_47,10,10).
route(bus_10_48,10,10).
route(bus_10_49,10,10).
route(bus_10_5,10,10).
route(bus_10_50,10,10).
route(bus_10_51,10,10).
route(bus_10_52,10,10).
route(bus_10_53,10,10).
route(bus_10_54,10,10).
route(bus_10_55,10,10).
route(bus_10_56,10,10).
route(bus_10_57,10,10).
route(bus_10_58,10,10).
route(bus_10_59,10,10).
route(bus_10_6,10,10).
route(bus_10_60,10,10).
route(bus_10_6001,10,10).
route(bus_10_6002,10,10).
route(bus_10_6003,10,10).
route(bus_10_6004,10,10).
route(bus_10_6005,10,10).
route(bus_10_6006,10,10).
route(bus_10_6007,10,10).
route(bus_10_6008,10,10).
route(bus_10_6009,10,10).
route(bus_10_6010,10,10).
route(bus_10_6011,10,10).
route(bus_10_6012,10,10).
route(bus_10_6013,10,10).
route(bus_10_6014,10,10).
route(bus_10_6015,10,10).
route(bus_10_6016,10,10).
route(bus_10_6017,10,10).
route(bus_10_6018,10,10).
route(bus_10_6019,10,10).
route(bus_10_6020,10,10).
route(bus_10_6021,10,10).
route(bus_10_6022,10,10).
route(bus_10_6023,10,10).
route(bus_10_6024,10,10).
route(bus_10_6025,10,10).
route(bus_10_6026,10,10).
route(bus_10_6027,10,10).
route(bus_10_6028,10,10).
route(bus_10_6029,10,10).
route(bus_10_6030,10,10).
route(bus_10_6031,10,10).
route(bus_10_6032,10,10).
route(bus_10_6033,10,10).
route(bus_10_6034,10,10).
route(bus_10_6035,10,10).
route(bus_10_6036,10,10).
route(bus_10_6037,10,10).
route(bus_10_6038,10,10).
route(bus_10_6039,10,10).
route(bus_10_6040,10,10).
route(bus_10_6041,10,10).
route(bus_10_6042,10,10).
route(bus_10_6043,10,10).
route(bus_10_6044,10,10).
route(bus_10_6045,10,10).
route(bus_10_6046,10,10).
route(bus_10_6047,10,10).
route(bus_10_6048,10,10).
route(bus_10_6049,10,10).
route(bus_10_6050,10,10).
route(bus_10_6051,10,10).
route(bus_10_6052,10,10).
route(bus_10_6053,10,10).
route(bus_10_6054,10,10).
route(bus_10_6055,10,10).
route(bus_10_6056,10,10).
route(bus_10_6057,10,10).
route(bus_10_6058,10,10).
route(bus_10_6059,10,10).
route(bus_10_6060,10,10).
route(bus_10_6061,10,10).
route(bus_10_6062,10,10).
route(bus_10_6063,10,10).
route(bus_10_6064,10,10).
route(bus_10_6065,10,10).
route(bus_10_6066,10,10).
route(bus_10_6067,10,10).
route(bus_10_6068,10,10).
route(bus_10_6069,10,10).
route(bus_10_6070,10,10).
route(bus_10_6071,10,10).
route(bus_10_6072,10,10).
route(bus_10_6073,10,10).
route(bus_10_6074,10,10).
route(bus_10_6075,10,10).
route(bus_10_6076,10,10).
route(bus_10_6077,10,10).
route(bus_10_6078,10,10).
route(bus_10_6079,10,10).
route(bus_10_6080,10,10).
route(bus_10_6081,10,10).
route(bus_10_6082,10,10).
route(bus_10_6083,10,10).
route(bus_10_6084,10,10).
route(bus_10_6085,10,10).
route(bus_10_6086,10,10).
route(bus_10_6087,10,10).
route(bus_10_6088,10,10).
route(bus_10_6089,10,10).
route(bus_10_6090,10,10).
route(bus_10_6091,10,10).
route(bus_10_6092,10,10).
route(bus_10_6093,10,10).
route(bus_10_6094,10,10).
route(bus_10_6095,10,10).
route(bus_10_6096,10,10).
route(bus_10_6097,10,10).
route(bus_10_6098,10,10).
route(bus_10_6099,10,10).
route(bus_10_61,10,10).
route(bus_10_6100,10,10).
route(bus_10_6101,10,10).
route(bus_10_6102,10,10).
route(bus_10_6103,10,10).
route(bus_10_6104,10,10).
route(bus_10_6105,10,10).
route(bus_10_6106,10,10).
route(bus_10_6107,10,10).
route(bus_10_6108,10,10).
route(bus_10_6109,10,10).
route(bus_10_6110,10,10).
route(bus_10_62,10,10).
route(bus_10_63,10,10).
route(bus_10_64,10,10).
route(bus_10_65,10,10).
route(bus_10_66,10,10).
route(bus_10_67,10,10).
route(bus_10_68,10,10).
route(bus_10_69,10,10).
route(bus_10_7,10,10).
route(bus_10_70,10,10).
route(bus_10_7001,10,10).
route(bus_10_7002,10,10).
route(bus_10_7003,10,10).
route(bus_10_7004,10,10).
route(bus_10_7005,10,10).
route(bus_10_7006,10,10).
route(bus_10_7007,10,10).
route(bus_10_7008,10,10).
route(bus_10_7009,10,10).
route(bus_10_7010,10,10).
route(bus_10_7011,10,10).
route(bus_10_7012,10,10).
route(bus_10_7013,10,10).
route(bus_10_7014,10,10).
route(bus_10_7015,10,10).
route(bus_10_7016,10,10).
route(bus_10_7017,10,10).
route(bus_10_7018,10,10).
route(bus_10_7019,10,10).
route(bus_10_7020,10,10).
route(bus_10_7021,10,10).
route(bus_10_7022,10,10).
route(bus_10_7023,10,10).
route(bus_10_7024,10,10).
route(bus_10_7025,10,10).
route(bus_10_7026,10,10).
route(bus_10_7027,10,10).
route(bus_10_7028,10,10).
route(bus_10_7029,10,10).
route(bus_10_7030,10,10).
route(bus_10_7031,10,10).
route(bus_10_7032,10,10).
route(bus_10_7033,10,10).
route(bus_10_7034,10,10).
route(bus_10_7035,10,10).
route(bus_10_7036,10,10).
route(bus_10_7037,10,10).
route(bus_10_7038,10,10).
route(bus_10_7039,10,10).
route(bus_10_7040,10,10).
route(bus_10_7041,10,10).
route(bus_10_7042,10,10).
route(bus_10_7043,10,10).
route(bus_10_7044,10,10).
route(bus_10_7045,10,10).
route(bus_10_7046,10,10).
route(bus_10_7047,10,10).
route(bus_10_7048,10,10).
route(bus_10_7049,10,10).
route(bus_10_7050,10,10).
route(bus_10_7051,10,10).
route(bus_10_7052,10,10).
route(bus_10_7053,10,10).
route(bus_10_7054,10,10).
route(bus_10_7055,10,10).
route(bus_10_7056,10,10).
route(bus_10_7057,10,10).
route(bus_10_7058,10,10).
route(bus_10_7059,10,10).
route(bus_10_7060,10,10).
route(bus_10_7061,10,10).
route(bus_10_7062,10,10).
route(bus_10_7063,10,10).
route(bus_10_7064,10,10).
route(bus_10_7065,10,10).
route(bus_10_7066,10,10).
route(bus_10_7067,10,10).
route(bus_10_7068,10,10).
route(bus_10_7069,10,10).
route(bus_10_7070,10,10).
route(bus_10_7071,10,10).
route(bus_10_7072,10,10).
route(bus_10_7073,10,10).
route(bus_10_7074,10,10).
route(bus_10_7075,10,10).
route(bus_10_7076,10,10).
route(bus_10_7077,10,10).
route(bus_10_7078,10,10).
route(bus_10_7079,10,10).
route(bus_10_7080,10,10).
route(bus_10_7081,10,10).
route(bus_10_7082,10,10).
route(bus_10_7083,10,10).
route(bus_10_7084,10,10).
route(bus_10_7085,10,10).
route(bus_10_7086,10,10).
route(bus_10_7087,10,10).
route(bus_10_7088,10,10).
route(bus_10_7089,10,10).
route(bus_10_7090,10,10).
route(bus_10_7091,10,10).
route(bus_10_7092,10,10).
route(bus_10_71,10,10).
route(bus_10_72,10,10).
route(bus_10_73,10,10).
route(bus_10_74,10,10).
route(bus_10_75,10,10).
route(bus_10_76,10,10).
route(bus_10_77,10,10).
route(bus_10_78,10,10).
route(bus_10_79,10,10).
route(bus_10_8,10,10).
route(bus_10_80,10,10).
route(bus_10_81,10,10).
route(bus_10_82,10,10).
route(bus_10_83,10,10).
route(bus_10_84,10,10).
route(bus_10_85,10,10).
route(bus_10_86,10,10).
route(bus_10_87,10,10).
route(bus_10_88,10,10).
route(bus_10_89,10,10).
route(bus_10_9,10,10).
route(bus_10_90,10,10).
route(bus_10_91,10,10).
route(bus_10_92,10,10).
route(bus_10_93,10,10).
route(bus_10_94,10,10).
route(bus_10_95,10,10).
route(bus_10_96,10,10).
route(bus_10_97,10,10).
route(bus_10_98,10,10).
route(bus_10_99,10,10).
route(bus_110_6002,110,110).
route(bus_110_6004,110,110).
route(bus_111_6002,111,111).
route(bus_111_6004,111,111).
route(bus_111_6006,111,111).
route(bus_112_6002,112,112).
route(bus_113_6002,113,113).
route(bus_113_6004,113,113).
route(bus_113_6006,113,113).
route(bus_114_6002,114,114).
route(bus_115_6002,115,115).
route(bus_115_6004,115,115).
route(bus_115_6006,115,115).
route(bus_116_6002,116,116).
route(bus_116_6004,116,116).
route(bus_11_1,11,11).
route(bus_11_10,11,11).
route(bus_11_100,11,11).
route(bus_11_101,11,11).
route(bus_11_102,11,11).
route(bus_11_103,11,11).
route(bus_11_104,11,11).
route(bus_11_105,11,11).
route(bus_11_106,11,11).
route(bus_11_107,11,11).
route(bus_11_108,11,11).
route(bus_11_109,11,11).
route(bus_11_11,11,11).
route(bus_11_110,11,11).
route(bus_11_111,11,11).
route(bus_11_112,11,11).
route(bus_11_113,11,11).
route(bus_11_114,11,11).
route(bus_11_115,11,11).
route(bus_11_116,11,11).
route(bus_11_117,11,11).
route(bus_11_118,11,11).
route(bus_11_119,11,11).
route(bus_11_12,11,11).
route(bus_11_120,11,11).
route(bus_11_121,11,11).
route(bus_11_122,11,11).
route(bus_11_123,11,11).
route(bus_11_124,11,11).
route(bus_11_125,11,11).
route(bus_11_126,11,11).
route(bus_11_127,11,11).
route(bus_11_128,11,11).
route(bus_11_129,11,11).
route(bus_11_13,11,11).
route(bus_11_130,11,11).
route(bus_11_131,11,11).
route(bus_11_132,11,11).
route(bus_11_133,11,11).
route(bus_11_134,11,11).
route(bus_11_135,11,11).
route(bus_11_136,11,11).
route(bus_11_137,11,11).
route(bus_11_138,11,11).
route(bus_11_139,11,11).
route(bus_11_14,11,11).
route(bus_11_140,11,11).
route(bus_11_141,11,11).
route(bus_11_142,11,11).
route(bus_11_143,11,11).
route(bus_11_144,11,11).
route(bus_11_146,11,11).
route(bus_11_148,11,11).
route(bus_11_15,11,11).
route(bus_11_150,11,11).
route(bus_11_16,11,11).
route(bus_11_17,11,11).
route(bus_11_18,11,11).
route(bus_11_19,11,11).
route(bus_11_2,11,11).
route(bus_11_20,11,11).
route(bus_11_21,11,11).
route(bus_11_22,11,11).
route(bus_11_23,11,11).
route(bus_11_24,11,11).
route(bus_11_25,11,11).
route(bus_11_26,11,11).
route(bus_11_27,11,11).
route(bus_11_28,11,11).
route(bus_11_29,11,11).
route(bus_11_3,11,11).
route(bus_11_30,11,11).
route(bus_11_31,11,11).
route(bus_11_32,11,11).
route(bus_11_33,11,11).
route(bus_11_34,11,11).
route(bus_11_35,11,11).
route(bus_11_36,11,11).
route(bus_11_37,11,11).
route(bus_11_38,11,11).
route(bus_11_39,11,11).
route(bus_11_4,11,11).
route(bus_11_40,11,11).
route(bus_11_41,11,11).
route(bus_11_42,11,11).
route(bus_11_43,11,11).
route(bus_11_44,11,11).
route(bus_11_45,11,11).
route(bus_11_46,11,11).
route(bus_11_47,11,11).
route(bus_11_48,11,11).
route(bus_11_49,11,11).
route(bus_11_5,11,11).
route(bus_11_50,11,11).
route(bus_11_51,11,11).
route(bus_11_52,11,11).
route(bus_11_53,11,11).
route(bus_11_54,11,11).
route(bus_11_55,11,11).
route(bus_11_56,11,11).
route(bus_11_57,11,11).
route(bus_11_58,11,11).
route(bus_11_59,11,11).
route(bus_11_6,11,11).
route(bus_11_60,11,11).
route(bus_11_6001,11,11).
route(bus_11_6002,11,11).
route(bus_11_6003,11,11).
route(bus_11_6004,11,11).
route(bus_11_6005,11,11).
route(bus_11_6006,11,11).
route(bus_11_6007,11,11).
route(bus_11_6008,11,11).
route(bus_11_6009,11,11).
route(bus_11_6010,11,11).
route(bus_11_6011,11,11).
route(bus_11_6012,11,11).
route(bus_11_6013,11,11).
route(bus_11_6014,11,11).
route(bus_11_6015,11,11).
route(bus_11_6016,11,11).
route(bus_11_6017,11,11).
route(bus_11_6018,11,11).
route(bus_11_6019,11,11).
route(bus_11_6020,11,11).
route(bus_11_6021,11,11).
route(bus_11_6022,11,11).
route(bus_11_6023,11,11).
route(bus_11_6024,11,11).
route(bus_11_6025,11,11).
route(bus_11_6026,11,11).
route(bus_11_6027,11,11).
route(bus_11_6028,11,11).
route(bus_11_6029,11,11).
route(bus_11_6030,11,11).
route(bus_11_6031,11,11).
route(bus_11_6032,11,11).
route(bus_11_6033,11,11).
route(bus_11_6034,11,11).
route(bus_11_6035,11,11).
route(bus_11_6036,11,11).
route(bus_11_6037,11,11).
route(bus_11_6038,11,11).
route(bus_11_6039,11,11).
route(bus_11_6040,11,11).
route(bus_11_6041,11,11).
route(bus_11_6042,11,11).
route(bus_11_6043,11,11).
route(bus_11_6044,11,11).
route(bus_11_6045,11,11).
route(bus_11_6046,11,11).
route(bus_11_6047,11,11).
route(bus_11_6048,11,11).
route(bus_11_6049,11,11).
route(bus_11_6050,11,11).
route(bus_11_6051,11,11).
route(bus_11_6052,11,11).
route(bus_11_6053,11,11).
route(bus_11_6054,11,11).
route(bus_11_6055,11,11).
route(bus_11_6056,11,11).
route(bus_11_6057,11,11).
route(bus_11_6058,11,11).
route(bus_11_6059,11,11).
route(bus_11_6060,11,11).
route(bus_11_6061,11,11).
route(bus_11_6062,11,11).
route(bus_11_6063,11,11).
route(bus_11_6064,11,11).
route(bus_11_6065,11,11).
route(bus_11_6066,11,11).
route(bus_11_6067,11,11).
route(bus_11_6068,11,11).
route(bus_11_6069,11,11).
route(bus_11_6070,11,11).
route(bus_11_6071,11,11).
route(bus_11_6072,11,11).
route(bus_11_6073,11,11).
route(bus_11_6074,11,11).
route(bus_11_6075,11,11).
route(bus_11_6076,11,11).
route(bus_11_6077,11,11).
route(bus_11_6078,11,11).
route(bus_11_6079,11,11).
route(bus_11_6080,11,11).
route(bus_11_6081,11,11).
route(bus_11_6082,11,11).
route(bus_11_6083,11,11).
route(bus_11_6084,11,11).
route(bus_11_6085,11,11).
route(bus_11_6086,11,11).
route(bus_11_6087,11,11).
route(bus_11_6088,11,11).
route(bus_11_6089,11,11).
route(bus_11_6090,11,11).
route(bus_11_6091,11,11).
route(bus_11_6092,11,11).
route(bus_11_6093,11,11).
route(bus_11_6094,11,11).
route(bus_11_6095,11,11).
route(bus_11_6096,11,11).
route(bus_11_6097,11,11).
route(bus_11_6098,11,11).
route(bus_11_6099,11,11).
route(bus_11_61,11,11).
route(bus_11_6100,11,11).
route(bus_11_6101,11,11).
route(bus_11_6102,11,11).
route(bus_11_6103,11,11).
route(bus_11_6104,11,11).
route(bus_11_6105,11,11).
route(bus_11_6106,11,11).
route(bus_11_6107,11,11).
route(bus_11_6108,11,11).
route(bus_11_6109,11,11).
route(bus_11_6110,11,11).
route(bus_11_6112,11,11).
route(bus_11_62,11,11).
route(bus_11_63,11,11).
route(bus_11_64,11,11).
route(bus_11_65,11,11).
route(bus_11_66,11,11).
route(bus_11_67,11,11).
route(bus_11_68,11,11).
route(bus_11_69,11,11).
route(bus_11_7,11,11).
route(bus_11_70,11,11).
route(bus_11_7001,11,11).
route(bus_11_7002,11,11).
route(bus_11_7003,11,11).
route(bus_11_7004,11,11).
route(bus_11_7005,11,11).
route(bus_11_7006,11,11).
route(bus_11_7007,11,11).
route(bus_11_7008,11,11).
route(bus_11_7009,11,11).
route(bus_11_7010,11,11).
route(bus_11_7011,11,11).
route(bus_11_7012,11,11).
route(bus_11_7013,11,11).
route(bus_11_7014,11,11).
route(bus_11_7015,11,11).
route(bus_11_7016,11,11).
route(bus_11_7017,11,11).
route(bus_11_7018,11,11).
route(bus_11_7019,11,11).
route(bus_11_7020,11,11).
route(bus_11_7021,11,11).
route(bus_11_7022,11,11).
route(bus_11_7023,11,11).
route(bus_11_7024,11,11).
route(bus_11_7025,11,11).
route(bus_11_7026,11,11).
route(bus_11_7027,11,11).
route(bus_11_7028,11,11).
route(bus_11_7029,11,11).
route(bus_11_7030,11,11).
route(bus_11_7031,11,11).
route(bus_11_7032,11,11).
route(bus_11_7033,11,11).
route(bus_11_7034,11,11).
route(bus_11_7035,11,11).
route(bus_11_7036,11,11).
route(bus_11_7037,11,11).
route(bus_11_7038,11,11).
route(bus_11_7039,11,11).
route(bus_11_7040,11,11).
route(bus_11_7041,11,11).
route(bus_11_7042,11,11).
route(bus_11_7043,11,11).
route(bus_11_7044,11,11).
route(bus_11_7045,11,11).
route(bus_11_7046,11,11).
route(bus_11_7047,11,11).
route(bus_11_7048,11,11).
route(bus_11_7049,11,11).
route(bus_11_7050,11,11).
route(bus_11_7051,11,11).
route(bus_11_7052,11,11).
route(bus_11_7053,11,11).
route(bus_11_7054,11,11).
route(bus_11_7055,11,11).
route(bus_11_7056,11,11).
route(bus_11_7057,11,11).
route(bus_11_7058,11,11).
route(bus_11_7059,11,11).
route(bus_11_7060,11,11).
route(bus_11_7061,11,11).
route(bus_11_7062,11,11).
route(bus_11_7063,11,11).
route(bus_11_7064,11,11).
route(bus_11_7065,11,11).
route(bus_11_7066,11,11).
route(bus_11_7067,11,11).
route(bus_11_7068,11,11).
route(bus_11_7069,11,11).
route(bus_11_7070,11,11).
route(bus_11_7071,11,11).
route(bus_11_7072,11,11).
route(bus_11_7073,11,11).
route(bus_11_7074,11,11).
route(bus_11_7075,11,11).
route(bus_11_7076,11,11).
route(bus_11_7077,11,11).
route(bus_11_7078,11,11).
route(bus_11_7079,11,11).
route(bus_11_7080,11,11).
route(bus_11_7081,11,11).
route(bus_11_7082,11,11).
route(bus_11_7083,11,11).
route(bus_11_7084,11,11).
route(bus_11_7085,11,11).
route(bus_11_7086,11,11).
route(bus_11_7087,11,11).
route(bus_11_7088,11,11).
route(bus_11_7089,11,11).
route(bus_11_7090,11,11).
route(bus_11_7091,11,11).
route(bus_11_7092,11,11).
route(bus_11_71,11,11).
route(bus_11_72,11,11).
route(bus_11_73,11,11).
route(bus_11_74,11,11).
route(bus_11_75,11,11).
route(bus_11_76,11,11).
route(bus_11_77,11,11).
route(bus_11_78,11,11).
route(bus_11_79,11,11).
route(bus_11_8,11,11).
route(bus_11_80,11,11).
route(bus_11_81,11,11).
route(bus_11_82,11,11).
route(bus_11_83,11,11).
route(bus_11_84,11,11).
route(bus_11_85,11,11).
route(bus_11_86,11,11).
route(bus_11_87,11,11).
route(bus_11_88,11,11).
route(bus_11_89,11,11).
route(bus_11_9,11,11).
route(bus_11_90,11,11).
route(bus_11_91,11,11).
route(bus_11_92,11,11).
route(bus_11_93,11,11).
route(bus_11_94,11,11).
route(bus_11_95,11,11).
route(bus_11_96,11,11).
route(bus_11_97,11,11).
route(bus_11_98,11,11).
route(bus_11_99,11,11).
route(bus_12_1,12,12).
route(bus_12_10,12,12).
route(bus_12_100,12,12).
route(bus_12_101,12,12).
route(bus_12_102,12,12).
route(bus_12_103,12,12).
route(bus_12_104,12,12).
route(bus_12_105,12,12).
route(bus_12_106,12,12).
route(bus_12_107,12,12).
route(bus_12_108,12,12).
route(bus_12_109,12,12).
route(bus_12_11,12,12).
route(bus_12_110,12,12).
route(bus_12_111,12,12).
route(bus_12_112,12,12).
route(bus_12_113,12,12).
route(bus_12_114,12,12).
route(bus_12_115,12,12).
route(bus_12_116,12,12).
route(bus_12_117,12,12).
route(bus_12_118,12,12).
route(bus_12_119,12,12).
route(bus_12_12,12,12).
route(bus_12_120,12,12).
route(bus_12_121,12,12).
route(bus_12_122,12,12).
route(bus_12_123,12,12).
route(bus_12_124,12,12).
route(bus_12_125,12,12).
route(bus_12_126,12,12).
route(bus_12_127,12,12).
route(bus_12_128,12,12).
route(bus_12_129,12,12).
route(bus_12_13,12,12).
route(bus_12_130,12,12).
route(bus_12_131,12,12).
route(bus_12_132,12,12).
route(bus_12_133,12,12).
route(bus_12_134,12,12).
route(bus_12_135,12,12).
route(bus_12_136,12,12).
route(bus_12_137,12,12).
route(bus_12_138,12,12).
route(bus_12_139,12,12).
route(bus_12_14,12,12).
route(bus_12_140,12,12).
route(bus_12_141,12,12).
route(bus_12_142,12,12).
route(bus_12_143,12,12).
route(bus_12_144,12,12).
route(bus_12_145,12,12).
route(bus_12_146,12,12).
route(bus_12_147,12,12).
route(bus_12_148,12,12).
route(bus_12_149,12,12).
route(bus_12_15,12,12).
route(bus_12_150,12,12).
route(bus_12_151,12,12).
route(bus_12_152,12,12).
route(bus_12_153,12,12).
route(bus_12_154,12,12).
route(bus_12_155,12,12).
route(bus_12_156,12,12).
route(bus_12_157,12,12).
route(bus_12_158,12,12).
route(bus_12_159,12,12).
route(bus_12_16,12,12).
route(bus_12_160,12,12).
route(bus_12_161,12,12).
route(bus_12_162,12,12).
route(bus_12_163,12,12).
route(bus_12_164,12,12).
route(bus_12_165,12,12).
route(bus_12_166,12,12).
route(bus_12_167,12,12).
route(bus_12_168,12,12).
route(bus_12_169,12,12).
route(bus_12_17,12,12).
route(bus_12_170,12,12).
route(bus_12_171,12,12).
route(bus_12_172,12,12).
route(bus_12_173,12,12).
route(bus_12_174,12,12).
route(bus_12_175,12,12).
route(bus_12_176,12,12).
route(bus_12_177,12,12).
route(bus_12_178,12,12).
route(bus_12_179,12,12).
route(bus_12_18,12,12).
route(bus_12_180,12,12).
route(bus_12_181,12,12).
route(bus_12_182,12,12).
route(bus_12_183,12,12).
route(bus_12_184,12,12).
route(bus_12_185,12,12).
route(bus_12_186,12,12).
route(bus_12_187,12,12).
route(bus_12_188,12,12).
route(bus_12_189,12,12).
route(bus_12_19,12,12).
route(bus_12_190,12,12).
route(bus_12_191,12,12).
route(bus_12_192,12,12).
route(bus_12_193,12,12).
route(bus_12_194,12,12).
route(bus_12_2,12,12).
route(bus_12_20,12,12).
route(bus_12_21,12,12).
route(bus_12_22,12,12).
route(bus_12_23,12,12).
route(bus_12_24,12,12).
route(bus_12_25,12,12).
route(bus_12_26,12,12).
route(bus_12_27,12,12).
route(bus_12_28,12,12).
route(bus_12_29,12,12).
route(bus_12_3,12,12).
route(bus_12_30,12,12).
route(bus_12_31,12,12).
route(bus_12_32,12,12).
route(bus_12_33,12,12).
route(bus_12_34,12,12).
route(bus_12_35,12,12).
route(bus_12_36,12,12).
route(bus_12_37,12,12).
route(bus_12_38,12,12).
route(bus_12_39,12,12).
route(bus_12_4,12,12).
route(bus_12_40,12,12).
route(bus_12_41,12,12).
route(bus_12_42,12,12).
route(bus_12_43,12,12).
route(bus_12_44,12,12).
route(bus_12_45,12,12).
route(bus_12_46,12,12).
route(bus_12_47,12,12).
route(bus_12_48,12,12).
route(bus_12_49,12,12).
route(bus_12_5,12,12).
route(bus_12_50,12,12).
route(bus_12_51,12,12).
route(bus_12_52,12,12).
route(bus_12_53,12,12).
route(bus_12_54,12,12).
route(bus_12_55,12,12).
route(bus_12_56,12,12).
route(bus_12_57,12,12).
route(bus_12_58,12,12).
route(bus_12_59,12,12).
route(bus_12_6,12,12).
route(bus_12_60,12,12).
route(bus_12_6001,12,12).
route(bus_12_6002,12,12).
route(bus_12_6003,12,12).
route(bus_12_6004,12,12).
route(bus_12_6005,12,12).
route(bus_12_6006,12,12).
route(bus_12_6007,12,12).
route(bus_12_6008,12,12).
route(bus_12_6009,12,12).
route(bus_12_6010,12,12).
route(bus_12_6011,12,12).
route(bus_12_6012,12,12).
route(bus_12_6013,12,12).
route(bus_12_6014,12,12).
route(bus_12_6015,12,12).
route(bus_12_6016,12,12).
route(bus_12_6017,12,12).
route(bus_12_6018,12,12).
route(bus_12_6019,12,12).
route(bus_12_6020,12,12).
route(bus_12_6021,12,12).
route(bus_12_6022,12,12).
route(bus_12_6023,12,12).
route(bus_12_6024,12,12).
route(bus_12_6025,12,12).
route(bus_12_6026,12,12).
route(bus_12_6027,12,12).
route(bus_12_6028,12,12).
route(bus_12_6029,12,12).
route(bus_12_6030,12,12).
route(bus_12_6031,12,12).
route(bus_12_6032,12,12).
route(bus_12_6033,12,12).
route(bus_12_6034,12,12).
route(bus_12_6035,12,12).
route(bus_12_6036,12,12).
route(bus_12_6037,12,12).
route(bus_12_6038,12,12).
route(bus_12_6039,12,12).
route(bus_12_6040,12,12).
route(bus_12_6041,12,12).
route(bus_12_6042,12,12).
route(bus_12_6043,12,12).
route(bus_12_6044,12,12).
route(bus_12_6045,12,12).
route(bus_12_6046,12,12).
route(bus_12_6047,12,12).
route(bus_12_6048,12,12).
route(bus_12_6049,12,12).
route(bus_12_6050,12,12).
route(bus_12_6051,12,12).
route(bus_12_6052,12,12).
route(bus_12_6053,12,12).
route(bus_12_6054,12,12).
route(bus_12_6055,12,12).
route(bus_12_6056,12,12).
route(bus_12_6057,12,12).
route(bus_12_6058,12,12).
route(bus_12_6059,12,12).
route(bus_12_6060,12,12).
route(bus_12_6061,12,12).
route(bus_12_6062,12,12).
route(bus_12_6063,12,12).
route(bus_12_6064,12,12).
route(bus_12_6065,12,12).
route(bus_12_6066,12,12).
route(bus_12_6067,12,12).
route(bus_12_6068,12,12).
route(bus_12_6069,12,12).
route(bus_12_6070,12,12).
route(bus_12_6071,12,12).
route(bus_12_6072,12,12).
route(bus_12_6073,12,12).
route(bus_12_6074,12,12).
route(bus_12_6075,12,12).
route(bus_12_6076,12,12).
route(bus_12_6077,12,12).
route(bus_12_6078,12,12).
route(bus_12_6079,12,12).
route(bus_12_6080,12,12).
route(bus_12_6081,12,12).
route(bus_12_6082,12,12).
route(bus_12_6083,12,12).
route(bus_12_6084,12,12).
route(bus_12_6085,12,12).
route(bus_12_6086,12,12).
route(bus_12_6087,12,12).
route(bus_12_6088,12,12).
route(bus_12_6089,12,12).
route(bus_12_6090,12,12).
route(bus_12_6091,12,12).
route(bus_12_6092,12,12).
route(bus_12_6093,12,12).
route(bus_12_6094,12,12).
route(bus_12_6095,12,12).
route(bus_12_6096,12,12).
route(bus_12_6097,12,12).
route(bus_12_6098,12,12).
route(bus_12_6099,12,12).
route(bus_12_61,12,12).
route(bus_12_6100,12,12).
route(bus_12_6101,12,12).
route(bus_12_6102,12,12).
route(bus_12_6103,12,12).
route(bus_12_6104,12,12).
route(bus_12_6105,12,12).
route(bus_12_6106,12,12).
route(bus_12_6107,12,12).
route(bus_12_6108,12,12).
route(bus_12_6109,12,12).
route(bus_12_6110,12,12).
route(bus_12_6111,12,12).
route(bus_12_6112,12,12).
route(bus_12_6113,12,12).
route(bus_12_6114,12,12).
route(bus_12_6115,12,12).
route(bus_12_6116,12,12).
route(bus_12_6117,12,12).
route(bus_12_6118,12,12).
route(bus_12_6119,12,12).
route(bus_12_6120,12,12).
route(bus_12_6121,12,12).
route(bus_12_6122,12,12).
route(bus_12_6123,12,12).
route(bus_12_6124,12,12).
route(bus_12_6125,12,12).
route(bus_12_6126,12,12).
route(bus_12_6127,12,12).
route(bus_12_6128,12,12).
route(bus_12_6129,12,12).
route(bus_12_6130,12,12).
route(bus_12_6131,12,12).
route(bus_12_6132,12,12).
route(bus_12_6133,12,12).
route(bus_12_6134,12,12).
route(bus_12_6135,12,12).
route(bus_12_6136,12,12).
route(bus_12_6137,12,12).
route(bus_12_6138,12,12).
route(bus_12_6139,12,12).
route(bus_12_6140,12,12).
route(bus_12_6141,12,12).
route(bus_12_6142,12,12).
route(bus_12_6143,12,12).
route(bus_12_6144,12,12).
route(bus_12_6145,12,12).
route(bus_12_6146,12,12).
route(bus_12_6147,12,12).
route(bus_12_6148,12,12).
route(bus_12_6149,12,12).
route(bus_12_6150,12,12).
route(bus_12_6151,12,12).
route(bus_12_6152,12,12).
route(bus_12_6153,12,12).
route(bus_12_6154,12,12).
route(bus_12_6155,12,12).
route(bus_12_6156,12,12).
route(bus_12_6157,12,12).
route(bus_12_6158,12,12).
route(bus_12_6159,12,12).
route(bus_12_6160,12,12).
route(bus_12_6161,12,12).
route(bus_12_6162,12,12).
route(bus_12_6163,12,12).
route(bus_12_6164,12,12).
route(bus_12_6165,12,12).
route(bus_12_6166,12,12).
route(bus_12_6167,12,12).
route(bus_12_6168,12,12).
route(bus_12_6169,12,12).
route(bus_12_6170,12,12).
route(bus_12_6171,12,12).
route(bus_12_6172,12,12).
route(bus_12_6173,12,12).
route(bus_12_6174,12,12).
route(bus_12_6175,12,12).
route(bus_12_6176,12,12).
route(bus_12_6177,12,12).
route(bus_12_6178,12,12).
route(bus_12_6179,12,12).
route(bus_12_6180,12,12).
route(bus_12_6181,12,12).
route(bus_12_6183,12,12).
route(bus_12_6189,12,12).
route(bus_12_6191,12,12).
route(bus_12_6195,12,12).
route(bus_12_6199,12,12).
route(bus_12_62,12,12).
route(bus_12_63,12,12).
route(bus_12_64,12,12).
route(bus_12_65,12,12).
route(bus_12_66,12,12).
route(bus_12_67,12,12).
route(bus_12_68,12,12).
route(bus_12_69,12,12).
route(bus_12_7,12,12).
route(bus_12_70,12,12).
route(bus_12_7001,12,12).
route(bus_12_7002,12,12).
route(bus_12_7003,12,12).
route(bus_12_7004,12,12).
route(bus_12_7005,12,12).
route(bus_12_7006,12,12).
route(bus_12_7007,12,12).
route(bus_12_7008,12,12).
route(bus_12_7009,12,12).
route(bus_12_7010,12,12).
route(bus_12_7011,12,12).
route(bus_12_7012,12,12).
route(bus_12_7013,12,12).
route(bus_12_7014,12,12).
route(bus_12_7015,12,12).
route(bus_12_7016,12,12).
route(bus_12_7017,12,12).
route(bus_12_7018,12,12).
route(bus_12_7019,12,12).
route(bus_12_7020,12,12).
route(bus_12_7021,12,12).
route(bus_12_7022,12,12).
route(bus_12_7023,12,12).
route(bus_12_7024,12,12).
route(bus_12_7025,12,12).
route(bus_12_7026,12,12).
route(bus_12_7027,12,12).
route(bus_12_7028,12,12).
route(bus_12_7029,12,12).
route(bus_12_7030,12,12).
route(bus_12_7031,12,12).
route(bus_12_7032,12,12).
route(bus_12_7033,12,12).
route(bus_12_7034,12,12).
route(bus_12_7035,12,12).
route(bus_12_7036,12,12).
route(bus_12_7037,12,12).
route(bus_12_7038,12,12).
route(bus_12_7039,12,12).
route(bus_12_7040,12,12).
route(bus_12_7041,12,12).
route(bus_12_7042,12,12).
route(bus_12_7043,12,12).
route(bus_12_7044,12,12).
route(bus_12_7045,12,12).
route(bus_12_7046,12,12).
route(bus_12_7047,12,12).
route(bus_12_7048,12,12).
route(bus_12_7049,12,12).
route(bus_12_7050,12,12).
route(bus_12_7051,12,12).
route(bus_12_7052,12,12).
route(bus_12_7053,12,12).
route(bus_12_7054,12,12).
route(bus_12_7055,12,12).
route(bus_12_7056,12,12).
route(bus_12_7057,12,12).
route(bus_12_7058,12,12).
route(bus_12_7059,12,12).
route(bus_12_7060,12,12).
route(bus_12_7061,12,12).
route(bus_12_7062,12,12).
route(bus_12_7063,12,12).
route(bus_12_7064,12,12).
route(bus_12_7065,12,12).
route(bus_12_7066,12,12).
route(bus_12_7067,12,12).
route(bus_12_7068,12,12).
route(bus_12_7069,12,12).
route(bus_12_7070,12,12).
route(bus_12_7071,12,12).
route(bus_12_7072,12,12).
route(bus_12_7073,12,12).
route(bus_12_7074,12,12).
route(bus_12_7075,12,12).
route(bus_12_7076,12,12).
route(bus_12_7077,12,12).
route(bus_12_7078,12,12).
route(bus_12_7079,12,12).
route(bus_12_7080,12,12).
route(bus_12_7081,12,12).
route(bus_12_7082,12,12).
route(bus_12_7083,12,12).
route(bus_12_7084,12,12).
route(bus_12_7085,12,12).
route(bus_12_7086,12,12).
route(bus_12_7087,12,12).
route(bus_12_7088,12,12).
route(bus_12_7089,12,12).
route(bus_12_7090,12,12).
route(bus_12_7091,12,12).
route(bus_12_7092,12,12).
route(bus_12_71,12,12).
route(bus_12_72,12,12).
route(bus_12_73,12,12).
route(bus_12_74,12,12).
route(bus_12_75,12,12).
route(bus_12_76,12,12).
route(bus_12_77,12,12).
route(bus_12_78,12,12).
route(bus_12_79,12,12).
route(bus_12_8,12,12).
route(bus_12_80,12,12).
route(bus_12_81,12,12).
route(bus_12_82,12,12).
route(bus_12_83,12,12).
route(bus_12_84,12,12).
route(bus_12_85,12,12).
route(bus_12_86,12,12).
route(bus_12_87,12,12).
route(bus_12_88,12,12).
route(bus_12_89,12,12).
route(bus_12_9,12,12).
route(bus_12_90,12,12).
route(bus_12_91,12,12).
route(bus_12_92,12,12).
route(bus_12_93,12,12).
route(bus_12_94,12,12).
route(bus_12_95,12,12).
route(bus_12_96,12,12).
route(bus_12_97,12,12).
route(bus_12_98,12,12).
route(bus_12_99,12,12).
route(bus_13_1,13,13).
route(bus_13_10,13,13).
route(bus_13_100,13,13).
route(bus_13_101,13,13).
route(bus_13_102,13,13).
route(bus_13_103,13,13).
route(bus_13_104,13,13).
route(bus_13_105,13,13).
route(bus_13_106,13,13).
route(bus_13_107,13,13).
route(bus_13_108,13,13).
route(bus_13_109,13,13).
route(bus_13_11,13,13).
route(bus_13_110,13,13).
route(bus_13_111,13,13).
route(bus_13_112,13,13).
route(bus_13_113,13,13).
route(bus_13_114,13,13).
route(bus_13_115,13,13).
route(bus_13_116,13,13).
route(bus_13_117,13,13).
route(bus_13_118,13,13).
route(bus_13_119,13,13).
route(bus_13_12,13,13).
route(bus_13_120,13,13).
route(bus_13_121,13,13).
route(bus_13_122,13,13).
route(bus_13_123,13,13).
route(bus_13_124,13,13).
route(bus_13_125,13,13).
route(bus_13_126,13,13).
route(bus_13_127,13,13).
route(bus_13_128,13,13).
route(bus_13_129,13,13).
route(bus_13_13,13,13).
route(bus_13_130,13,13).
route(bus_13_131,13,13).
route(bus_13_132,13,13).
route(bus_13_133,13,13).
route(bus_13_134,13,13).
route(bus_13_135,13,13).
route(bus_13_136,13,13).
route(bus_13_137,13,13).
route(bus_13_138,13,13).
route(bus_13_139,13,13).
route(bus_13_14,13,13).
route(bus_13_140,13,13).
route(bus_13_141,13,13).
route(bus_13_142,13,13).
route(bus_13_143,13,13).
route(bus_13_144,13,13).
route(bus_13_145,13,13).
route(bus_13_146,13,13).
route(bus_13_147,13,13).
route(bus_13_148,13,13).
route(bus_13_149,13,13).
route(bus_13_15,13,13).
route(bus_13_150,13,13).
route(bus_13_151,13,13).
route(bus_13_152,13,13).
route(bus_13_153,13,13).
route(bus_13_154,13,13).
route(bus_13_155,13,13).
route(bus_13_156,13,13).
route(bus_13_157,13,13).
route(bus_13_158,13,13).
route(bus_13_159,13,13).
route(bus_13_16,13,13).
route(bus_13_17,13,13).
route(bus_13_18,13,13).
route(bus_13_182304,13,13).
route(bus_13_182305,13,13).
route(bus_13_182306,13,13).
route(bus_13_182307,13,13).
route(bus_13_182308,13,13).
route(bus_13_182309,13,13).
route(bus_13_182310,13,13).
route(bus_13_182311,13,13).
route(bus_13_182312,13,13).
route(bus_13_182313,13,13).
route(bus_13_182314,13,13).
route(bus_13_182315,13,13).
route(bus_13_182316,13,13).
route(bus_13_182317,13,13).
route(bus_13_182318,13,13).
route(bus_13_182319,13,13).
route(bus_13_182320,13,13).
route(bus_13_182321,13,13).
route(bus_13_182322,13,13).
route(bus_13_182323,13,13).
route(bus_13_182324,13,13).
route(bus_13_182325,13,13).
route(bus_13_182326,13,13).
route(bus_13_182327,13,13).
route(bus_13_182328,13,13).
route(bus_13_182329,13,13).
route(bus_13_182330,13,13).
route(bus_13_182331,13,13).
route(bus_13_182332,13,13).
route(bus_13_19,13,13).
route(bus_13_191304,13,13).
route(bus_13_191305,13,13).
route(bus_13_191306,13,13).
route(bus_13_191307,13,13).
route(bus_13_191308,13,13).
route(bus_13_191309,13,13).
route(bus_13_191310,13,13).
route(bus_13_191311,13,13).
route(bus_13_191312,13,13).
route(bus_13_191313,13,13).
route(bus_13_191314,13,13).
route(bus_13_192304,13,13).
route(bus_13_192305,13,13).
route(bus_13_192306,13,13).
route(bus_13_192307,13,13).
route(bus_13_192308,13,13).
route(bus_13_192309,13,13).
route(bus_13_192310,13,13).
route(bus_13_2,13,13).
route(bus_13_20,13,13).
route(bus_13_21,13,13).
route(bus_13_213304,13,13).
route(bus_13_213305,13,13).
route(bus_13_213306,13,13).
route(bus_13_213307,13,13).
route(bus_13_213308,13,13).
route(bus_13_213309,13,13).
route(bus_13_213310,13,13).
route(bus_13_213311,13,13).
route(bus_13_213312,13,13).
route(bus_13_213313,13,13).
route(bus_13_213314,13,13).
route(bus_13_213315,13,13).
route(bus_13_213316,13,13).
route(bus_13_213317,13,13).
route(bus_13_213318,13,13).
route(bus_13_213319,13,13).
route(bus_13_213320,13,13).
route(bus_13_213321,13,13).
route(bus_13_213322,13,13).
route(bus_13_213323,13,13).
route(bus_13_213324,13,13).
route(bus_13_213325,13,13).
route(bus_13_213326,13,13).
route(bus_13_213327,13,13).
route(bus_13_213328,13,13).
route(bus_13_213329,13,13).
route(bus_13_213330,13,13).
route(bus_13_22,13,13).
route(bus_13_23,13,13).
route(bus_13_24,13,13).
route(bus_13_243304,13,13).
route(bus_13_243305,13,13).
route(bus_13_243306,13,13).
route(bus_13_243307,13,13).
route(bus_13_243308,13,13).
route(bus_13_246304,13,13).
route(bus_13_246305,13,13).
route(bus_13_246306,13,13).
route(bus_13_246307,13,13).
route(bus_13_246308,13,13).
route(bus_13_246309,13,13).
route(bus_13_246310,13,13).
route(bus_13_246311,13,13).
route(bus_13_246312,13,13).
route(bus_13_246313,13,13).
route(bus_13_246314,13,13).
route(bus_13_25,13,13).
route(bus_13_26,13,13).
route(bus_13_27,13,13).
route(bus_13_28,13,13).
route(bus_13_29,13,13).
route(bus_13_3,13,13).
route(bus_13_30,13,13).
route(bus_13_31,13,13).
route(bus_13_32,13,13).
route(bus_13_33,13,13).
route(bus_13_34,13,13).
route(bus_13_35,13,13).
route(bus_13_36,13,13).
route(bus_13_37,13,13).
route(bus_13_38,13,13).
route(bus_13_39,13,13).
route(bus_13_4,13,13).
route(bus_13_40,13,13).
route(bus_13_41,13,13).
route(bus_13_42,13,13).
route(bus_13_43,13,13).
route(bus_13_44,13,13).
route(bus_13_45,13,13).
route(bus_13_46,13,13).
route(bus_13_47,13,13).
route(bus_13_48,13,13).
route(bus_13_49,13,13).
route(bus_13_5,13,13).
route(bus_13_50,13,13).
route(bus_13_51,13,13).
route(bus_13_52,13,13).
route(bus_13_53,13,13).
route(bus_13_54,13,13).
route(bus_13_55,13,13).
route(bus_13_56,13,13).
route(bus_13_57,13,13).
route(bus_13_58,13,13).
route(bus_13_59,13,13).
route(bus_13_6,13,13).
route(bus_13_60,13,13).
route(bus_13_6001,13,13).
route(bus_13_6002,13,13).
route(bus_13_6003,13,13).
route(bus_13_6004,13,13).
route(bus_13_6005,13,13).
route(bus_13_6006,13,13).
route(bus_13_6007,13,13).
route(bus_13_6008,13,13).
route(bus_13_6009,13,13).
route(bus_13_6010,13,13).
route(bus_13_6011,13,13).
route(bus_13_6012,13,13).
route(bus_13_6013,13,13).
route(bus_13_6014,13,13).
route(bus_13_6015,13,13).
route(bus_13_6016,13,13).
route(bus_13_6017,13,13).
route(bus_13_6018,13,13).
route(bus_13_6019,13,13).
route(bus_13_6020,13,13).
route(bus_13_6021,13,13).
route(bus_13_6022,13,13).
route(bus_13_6023,13,13).
route(bus_13_6024,13,13).
route(bus_13_6025,13,13).
route(bus_13_6026,13,13).
route(bus_13_6027,13,13).
route(bus_13_6028,13,13).
route(bus_13_6029,13,13).
route(bus_13_6030,13,13).
route(bus_13_6031,13,13).
route(bus_13_6032,13,13).
route(bus_13_6033,13,13).
route(bus_13_6034,13,13).
route(bus_13_6035,13,13).
route(bus_13_6036,13,13).
route(bus_13_6037,13,13).
route(bus_13_6038,13,13).
route(bus_13_6039,13,13).
route(bus_13_6040,13,13).
route(bus_13_6041,13,13).
route(bus_13_6042,13,13).
route(bus_13_6043,13,13).
route(bus_13_6044,13,13).
route(bus_13_6045,13,13).
route(bus_13_6046,13,13).
route(bus_13_6047,13,13).
route(bus_13_6048,13,13).
route(bus_13_6049,13,13).
route(bus_13_6050,13,13).
route(bus_13_6051,13,13).
route(bus_13_6052,13,13).
route(bus_13_6053,13,13).
route(bus_13_6054,13,13).
route(bus_13_6055,13,13).
route(bus_13_6056,13,13).
route(bus_13_6057,13,13).
route(bus_13_6058,13,13).
route(bus_13_6059,13,13).
route(bus_13_6060,13,13).
route(bus_13_6061,13,13).
route(bus_13_6062,13,13).
route(bus_13_6063,13,13).
route(bus_13_6064,13,13).
route(bus_13_6065,13,13).
route(bus_13_6066,13,13).
route(bus_13_6067,13,13).
route(bus_13_6068,13,13).
route(bus_13_6069,13,13).
route(bus_13_6070,13,13).
route(bus_13_6071,13,13).
route(bus_13_6072,13,13).
route(bus_13_6073,13,13).
route(bus_13_6074,13,13).
route(bus_13_6075,13,13).
route(bus_13_6076,13,13).
route(bus_13_6077,13,13).
route(bus_13_6078,13,13).
route(bus_13_6079,13,13).
route(bus_13_6080,13,13).
route(bus_13_6081,13,13).
route(bus_13_6082,13,13).
route(bus_13_6083,13,13).
route(bus_13_6084,13,13).
route(bus_13_6085,13,13).
route(bus_13_6086,13,13).
route(bus_13_6087,13,13).
route(bus_13_6088,13,13).
route(bus_13_6089,13,13).
route(bus_13_6090,13,13).
route(bus_13_6091,13,13).
route(bus_13_6092,13,13).
route(bus_13_6093,13,13).
route(bus_13_6094,13,13).
route(bus_13_6095,13,13).
route(bus_13_6096,13,13).
route(bus_13_6097,13,13).
route(bus_13_6098,13,13).
route(bus_13_6099,13,13).
route(bus_13_61,13,13).
route(bus_13_6100,13,13).
route(bus_13_6101,13,13).
route(bus_13_6102,13,13).
route(bus_13_6103,13,13).
route(bus_13_6104,13,13).
route(bus_13_6105,13,13).
route(bus_13_6106,13,13).
route(bus_13_6107,13,13).
route(bus_13_6108,13,13).
route(bus_13_6109,13,13).
route(bus_13_6110,13,13).
route(bus_13_6111,13,13).
route(bus_13_6112,13,13).
route(bus_13_6113,13,13).
route(bus_13_6114,13,13).
route(bus_13_6115,13,13).
route(bus_13_6116,13,13).
route(bus_13_6117,13,13).
route(bus_13_6118,13,13).
route(bus_13_6119,13,13).
route(bus_13_6120,13,13).
route(bus_13_6121,13,13).
route(bus_13_6122,13,13).
route(bus_13_6123,13,13).
route(bus_13_6124,13,13).
route(bus_13_6125,13,13).
route(bus_13_6126,13,13).
route(bus_13_6127,13,13).
route(bus_13_6128,13,13).
route(bus_13_6129,13,13).
route(bus_13_6130,13,13).
route(bus_13_6131,13,13).
route(bus_13_6132,13,13).
route(bus_13_6133,13,13).
route(bus_13_6134,13,13).
route(bus_13_6185,13,13).
route(bus_13_62,13,13).
route(bus_13_63,13,13).
route(bus_13_64,13,13).
route(bus_13_65,13,13).
route(bus_13_66,13,13).
route(bus_13_67,13,13).
route(bus_13_68,13,13).
route(bus_13_69,13,13).
route(bus_13_7,13,13).
route(bus_13_70,13,13).
route(bus_13_7001,13,13).
route(bus_13_7002,13,13).
route(bus_13_7003,13,13).
route(bus_13_7004,13,13).
route(bus_13_7005,13,13).
route(bus_13_7006,13,13).
route(bus_13_7007,13,13).
route(bus_13_7008,13,13).
route(bus_13_7009,13,13).
route(bus_13_7010,13,13).
route(bus_13_7011,13,13).
route(bus_13_7012,13,13).
route(bus_13_7013,13,13).
route(bus_13_7014,13,13).
route(bus_13_7015,13,13).
route(bus_13_7016,13,13).
route(bus_13_7017,13,13).
route(bus_13_7018,13,13).
route(bus_13_7019,13,13).
route(bus_13_7020,13,13).
route(bus_13_7021,13,13).
route(bus_13_7022,13,13).
route(bus_13_7023,13,13).
route(bus_13_7024,13,13).
route(bus_13_7025,13,13).
route(bus_13_7026,13,13).
route(bus_13_7027,13,13).
route(bus_13_7028,13,13).
route(bus_13_7029,13,13).
route(bus_13_7030,13,13).
route(bus_13_7031,13,13).
route(bus_13_7032,13,13).
route(bus_13_7033,13,13).
route(bus_13_7034,13,13).
route(bus_13_7035,13,13).
route(bus_13_7036,13,13).
route(bus_13_7037,13,13).
route(bus_13_7038,13,13).
route(bus_13_7039,13,13).
route(bus_13_7040,13,13).
route(bus_13_7041,13,13).
route(bus_13_7042,13,13).
route(bus_13_7043,13,13).
route(bus_13_7044,13,13).
route(bus_13_7045,13,13).
route(bus_13_7046,13,13).
route(bus_13_7047,13,13).
route(bus_13_7048,13,13).
route(bus_13_7049,13,13).
route(bus_13_7050,13,13).
route(bus_13_7051,13,13).
route(bus_13_7052,13,13).
route(bus_13_7053,13,13).
route(bus_13_7054,13,13).
route(bus_13_7055,13,13).
route(bus_13_7056,13,13).
route(bus_13_7057,13,13).
route(bus_13_7058,13,13).
route(bus_13_7059,13,13).
route(bus_13_7060,13,13).
route(bus_13_7061,13,13).
route(bus_13_7062,13,13).
route(bus_13_71,13,13).
route(bus_13_72,13,13).
route(bus_13_73,13,13).
route(bus_13_74,13,13).
route(bus_13_75,13,13).
route(bus_13_76,13,13).
route(bus_13_77,13,13).
route(bus_13_78,13,13).
route(bus_13_79,13,13).
route(bus_13_8,13,13).
route(bus_13_80,13,13).
route(bus_13_81,13,13).
route(bus_13_82,13,13).
route(bus_13_83,13,13).
route(bus_13_84,13,13).
route(bus_13_85,13,13).
route(bus_13_86,13,13).
route(bus_13_87,13,13).
route(bus_13_88,13,13).
route(bus_13_89,13,13).
route(bus_13_9,13,13).
route(bus_13_90,13,13).
route(bus_13_91,13,13).
route(bus_13_92,13,13).
route(bus_13_93,13,13).
route(bus_13_94,13,13).
route(bus_13_95,13,13).
route(bus_13_96,13,13).
route(bus_13_97,13,13).
route(bus_13_98,13,13).
route(bus_13_99,13,13).
route(bus_14_1,14,14).
route(bus_14_10,14,14).
route(bus_14_100,14,14).
route(bus_14_101,14,14).
route(bus_14_102,14,14).
route(bus_14_103,14,14).
route(bus_14_104,14,14).
route(bus_14_105,14,14).
route(bus_14_106,14,14).
route(bus_14_107,14,14).
route(bus_14_108,14,14).
route(bus_14_109,14,14).
route(bus_14_11,14,14).
route(bus_14_110,14,14).
route(bus_14_111,14,14).
route(bus_14_112,14,14).
route(bus_14_113,14,14).
route(bus_14_114,14,14).
route(bus_14_115,14,14).
route(bus_14_116,14,14).
route(bus_14_117,14,14).
route(bus_14_118,14,14).
route(bus_14_119,14,14).
route(bus_14_12,14,14).
route(bus_14_120,14,14).
route(bus_14_121,14,14).
route(bus_14_122,14,14).
route(bus_14_123,14,14).
route(bus_14_124,14,14).
route(bus_14_125,14,14).
route(bus_14_126,14,14).
route(bus_14_127,14,14).
route(bus_14_128,14,14).
route(bus_14_129,14,14).
route(bus_14_13,14,14).
route(bus_14_130,14,14).
route(bus_14_131,14,14).
route(bus_14_132,14,14).
route(bus_14_133,14,14).
route(bus_14_134,14,14).
route(bus_14_135,14,14).
route(bus_14_136,14,14).
route(bus_14_137,14,14).
route(bus_14_138,14,14).
route(bus_14_139,14,14).
route(bus_14_14,14,14).
route(bus_14_140,14,14).
route(bus_14_141,14,14).
route(bus_14_142,14,14).
route(bus_14_143,14,14).
route(bus_14_144,14,14).
route(bus_14_145,14,14).
route(bus_14_146,14,14).
route(bus_14_147,14,14).
route(bus_14_148,14,14).
route(bus_14_149,14,14).
route(bus_14_15,14,14).
route(bus_14_150,14,14).
route(bus_14_151,14,14).
route(bus_14_152,14,14).
route(bus_14_153,14,14).
route(bus_14_154,14,14).
route(bus_14_155,14,14).
route(bus_14_156,14,14).
route(bus_14_157,14,14).
route(bus_14_158,14,14).
route(bus_14_159,14,14).
route(bus_14_16,14,14).
route(bus_14_160,14,14).
route(bus_14_161,14,14).
route(bus_14_162,14,14).
route(bus_14_163,14,14).
route(bus_14_164,14,14).
route(bus_14_165,14,14).
route(bus_14_166,14,14).
route(bus_14_167,14,14).
route(bus_14_168,14,14).
route(bus_14_169,14,14).
route(bus_14_17,14,14).
route(bus_14_170,14,14).
route(bus_14_171,14,14).
route(bus_14_172,14,14).
route(bus_14_173,14,14).
route(bus_14_174,14,14).
route(bus_14_175,14,14).
route(bus_14_176,14,14).
route(bus_14_177,14,14).
route(bus_14_178,14,14).
route(bus_14_179,14,14).
route(bus_14_18,14,14).
route(bus_14_180,14,14).
route(bus_14_181,14,14).
route(bus_14_182,14,14).
route(bus_14_183,14,14).
route(bus_14_184,14,14).
route(bus_14_185,14,14).
route(bus_14_186,14,14).
route(bus_14_187,14,14).
route(bus_14_19,14,14).
route(bus_14_2,14,14).
route(bus_14_20,14,14).
route(bus_14_21,14,14).
route(bus_14_22,14,14).
route(bus_14_23,14,14).
route(bus_14_24,14,14).
route(bus_14_25,14,14).
route(bus_14_26,14,14).
route(bus_14_27,14,14).
route(bus_14_28,14,14).
route(bus_14_29,14,14).
route(bus_14_3,14,14).
route(bus_14_30,14,14).
route(bus_14_31,14,14).
route(bus_14_32,14,14).
route(bus_14_33,14,14).
route(bus_14_34,14,14).
route(bus_14_35,14,14).
route(bus_14_36,14,14).
route(bus_14_37,14,14).
route(bus_14_38,14,14).
route(bus_14_39,14,14).
route(bus_14_4,14,14).
route(bus_14_40,14,14).
route(bus_14_41,14,14).
route(bus_14_42,14,14).
route(bus_14_43,14,14).
route(bus_14_44,14,14).
route(bus_14_45,14,14).
route(bus_14_46,14,14).
route(bus_14_47,14,14).
route(bus_14_48,14,14).
route(bus_14_49,14,14).
route(bus_14_5,14,14).
route(bus_14_50,14,14).
route(bus_14_51,14,14).
route(bus_14_52,14,14).
route(bus_14_53,14,14).
route(bus_14_54,14,14).
route(bus_14_55,14,14).
route(bus_14_56,14,14).
route(bus_14_57,14,14).
route(bus_14_58,14,14).
route(bus_14_59,14,14).
route(bus_14_6,14,14).
route(bus_14_60,14,14).
route(bus_14_6001,14,14).
route(bus_14_6002,14,14).
route(bus_14_6003,14,14).
route(bus_14_6004,14,14).
route(bus_14_6005,14,14).
route(bus_14_6006,14,14).
route(bus_14_6007,14,14).
route(bus_14_6008,14,14).
route(bus_14_6009,14,14).
route(bus_14_6010,14,14).
route(bus_14_6011,14,14).
route(bus_14_6012,14,14).
route(bus_14_6013,14,14).
route(bus_14_6014,14,14).
route(bus_14_6015,14,14).
route(bus_14_6016,14,14).
route(bus_14_6017,14,14).
route(bus_14_6018,14,14).
route(bus_14_6019,14,14).
route(bus_14_6020,14,14).
route(bus_14_6021,14,14).
route(bus_14_6022,14,14).
route(bus_14_6023,14,14).
route(bus_14_6024,14,14).
route(bus_14_6025,14,14).
route(bus_14_6026,14,14).
route(bus_14_6027,14,14).
route(bus_14_6028,14,14).
route(bus_14_6029,14,14).
route(bus_14_6030,14,14).
route(bus_14_6031,14,14).
route(bus_14_6032,14,14).
route(bus_14_6033,14,14).
route(bus_14_6034,14,14).
route(bus_14_6035,14,14).
route(bus_14_6036,14,14).
route(bus_14_6037,14,14).
route(bus_14_6038,14,14).
route(bus_14_6039,14,14).
route(bus_14_6040,14,14).
route(bus_14_6041,14,14).
route(bus_14_6042,14,14).
route(bus_14_6043,14,14).
route(bus_14_6044,14,14).
route(bus_14_6045,14,14).
route(bus_14_6046,14,14).
route(bus_14_6047,14,14).
route(bus_14_6048,14,14).
route(bus_14_6049,14,14).
route(bus_14_6050,14,14).
route(bus_14_6051,14,14).
route(bus_14_6052,14,14).
route(bus_14_6053,14,14).
route(bus_14_6054,14,14).
route(bus_14_6055,14,14).
route(bus_14_6056,14,14).
route(bus_14_6057,14,14).
route(bus_14_6058,14,14).
route(bus_14_6059,14,14).
route(bus_14_6060,14,14).
route(bus_14_6061,14,14).
route(bus_14_6062,14,14).
route(bus_14_6063,14,14).
route(bus_14_6064,14,14).
route(bus_14_6065,14,14).
route(bus_14_6066,14,14).
route(bus_14_6067,14,14).
route(bus_14_6068,14,14).
route(bus_14_6069,14,14).
route(bus_14_6070,14,14).
route(bus_14_6071,14,14).
route(bus_14_6072,14,14).
route(bus_14_6073,14,14).
route(bus_14_6074,14,14).
route(bus_14_6075,14,14).
route(bus_14_6076,14,14).
route(bus_14_6077,14,14).
route(bus_14_6078,14,14).
route(bus_14_6079,14,14).
route(bus_14_6080,14,14).
route(bus_14_6081,14,14).
route(bus_14_6082,14,14).
route(bus_14_6083,14,14).
route(bus_14_6084,14,14).
route(bus_14_6085,14,14).
route(bus_14_6086,14,14).
route(bus_14_6087,14,14).
route(bus_14_6088,14,14).
route(bus_14_6089,14,14).
route(bus_14_6090,14,14).
route(bus_14_6091,14,14).
route(bus_14_6092,14,14).
route(bus_14_6093,14,14).
route(bus_14_6094,14,14).
route(bus_14_6095,14,14).
route(bus_14_6096,14,14).
route(bus_14_6097,14,14).
route(bus_14_6098,14,14).
route(bus_14_6099,14,14).
route(bus_14_61,14,14).
route(bus_14_6100,14,14).
route(bus_14_6101,14,14).
route(bus_14_6102,14,14).
route(bus_14_6103,14,14).
route(bus_14_6104,14,14).
route(bus_14_6105,14,14).
route(bus_14_6106,14,14).
route(bus_14_6107,14,14).
route(bus_14_6108,14,14).
route(bus_14_62,14,14).
route(bus_14_63,14,14).
route(bus_14_64,14,14).
route(bus_14_65,14,14).
route(bus_14_66,14,14).
route(bus_14_67,14,14).
route(bus_14_68,14,14).
route(bus_14_69,14,14).
route(bus_14_7,14,14).
route(bus_14_70,14,14).
route(bus_14_7001,14,14).
route(bus_14_7002,14,14).
route(bus_14_7003,14,14).
route(bus_14_7004,14,14).
route(bus_14_7005,14,14).
route(bus_14_7006,14,14).
route(bus_14_7007,14,14).
route(bus_14_7008,14,14).
route(bus_14_7009,14,14).
route(bus_14_7010,14,14).
route(bus_14_7011,14,14).
route(bus_14_7012,14,14).
route(bus_14_7013,14,14).
route(bus_14_7014,14,14).
route(bus_14_7015,14,14).
route(bus_14_7016,14,14).
route(bus_14_7017,14,14).
route(bus_14_7018,14,14).
route(bus_14_7019,14,14).
route(bus_14_7020,14,14).
route(bus_14_7021,14,14).
route(bus_14_7022,14,14).
route(bus_14_7023,14,14).
route(bus_14_7024,14,14).
route(bus_14_7025,14,14).
route(bus_14_7026,14,14).
route(bus_14_7027,14,14).
route(bus_14_7028,14,14).
route(bus_14_7029,14,14).
route(bus_14_7030,14,14).
route(bus_14_7031,14,14).
route(bus_14_7032,14,14).
route(bus_14_7033,14,14).
route(bus_14_7034,14,14).
route(bus_14_7035,14,14).
route(bus_14_7036,14,14).
route(bus_14_7037,14,14).
route(bus_14_7038,14,14).
route(bus_14_7039,14,14).
route(bus_14_7040,14,14).
route(bus_14_7041,14,14).
route(bus_14_7042,14,14).
route(bus_14_7043,14,14).
route(bus_14_7044,14,14).
route(bus_14_7045,14,14).
route(bus_14_7046,14,14).
route(bus_14_7047,14,14).
route(bus_14_7048,14,14).
route(bus_14_7049,14,14).
route(bus_14_7050,14,14).
route(bus_14_7051,14,14).
route(bus_14_7052,14,14).
route(bus_14_7053,14,14).
route(bus_14_7054,14,14).
route(bus_14_7055,14,14).
route(bus_14_7056,14,14).
route(bus_14_7057,14,14).
route(bus_14_7058,14,14).
route(bus_14_7059,14,14).
route(bus_14_7060,14,14).
route(bus_14_7061,14,14).
route(bus_14_7062,14,14).
route(bus_14_7063,14,14).
route(bus_14_7064,14,14).
route(bus_14_7065,14,14).
route(bus_14_7066,14,14).
route(bus_14_7067,14,14).
route(bus_14_7068,14,14).
route(bus_14_7069,14,14).
route(bus_14_7070,14,14).
route(bus_14_7071,14,14).
route(bus_14_7072,14,14).
route(bus_14_7073,14,14).
route(bus_14_7074,14,14).
route(bus_14_7075,14,14).
route(bus_14_7076,14,14).
route(bus_14_7077,14,14).
route(bus_14_7078,14,14).
route(bus_14_7079,14,14).
route(bus_14_7080,14,14).
route(bus_14_7081,14,14).
route(bus_14_7082,14,14).
route(bus_14_7083,14,14).
route(bus_14_7084,14,14).
route(bus_14_7085,14,14).
route(bus_14_7086,14,14).
route(bus_14_7087,14,14).
route(bus_14_7088,14,14).
route(bus_14_7089,14,14).
route(bus_14_7090,14,14).
route(bus_14_7092,14,14).
route(bus_14_71,14,14).
route(bus_14_72,14,14).
route(bus_14_73,14,14).
route(bus_14_74,14,14).
route(bus_14_75,14,14).
route(bus_14_76,14,14).
route(bus_14_77,14,14).
route(bus_14_78,14,14).
route(bus_14_79,14,14).
route(bus_14_8,14,14).
route(bus_14_80,14,14).
route(bus_14_81,14,14).
route(bus_14_82,14,14).
route(bus_14_83,14,14).
route(bus_14_84,14,14).
route(bus_14_85,14,14).
route(bus_14_86,14,14).
route(bus_14_87,14,14).
route(bus_14_88,14,14).
route(bus_14_89,14,14).
route(bus_14_9,14,14).
route(bus_14_90,14,14).
route(bus_14_91,14,14).
route(bus_14_92,14,14).
route(bus_14_93,14,14).
route(bus_14_94,14,14).
route(bus_14_95,14,14).
route(bus_14_96,14,14).
route(bus_14_97,14,14).
route(bus_14_98,14,14).
route(bus_14_99,14,14).
route(bus_15_1,15,15).
route(bus_15_10,15,15).
route(bus_15_11,15,15).
route(bus_15_12,15,15).
route(bus_15_13,15,15).
route(bus_15_14,15,15).
route(bus_15_15,15,15).
route(bus_15_16,15,15).
route(bus_15_17,15,15).
route(bus_15_18,15,15).
route(bus_15_19,15,15).
route(bus_15_2,15,15).
route(bus_15_20,15,15).
route(bus_15_21,15,15).
route(bus_15_22,15,15).
route(bus_15_23,15,15).
route(bus_15_24,15,15).
route(bus_15_25,15,15).
route(bus_15_26,15,15).
route(bus_15_27,15,15).
route(bus_15_28,15,15).
route(bus_15_29,15,15).
route(bus_15_3,15,15).
route(bus_15_30,15,15).
route(bus_15_31,15,15).
route(bus_15_32,15,15).
route(bus_15_33,15,15).
route(bus_15_34,15,15).
route(bus_15_35,15,15).
route(bus_15_36,15,15).
route(bus_15_37,15,15).
route(bus_15_38,15,15).
route(bus_15_39,15,15).
route(bus_15_4,15,15).
route(bus_15_41,15,15).
route(bus_15_43,15,15).
route(bus_15_45,15,15).
route(bus_15_47,15,15).
route(bus_15_49,15,15).
route(bus_15_5,15,15).
route(bus_15_6,15,15).
route(bus_15_7,15,15).
route(bus_15_8,15,15).
route(bus_15_9,15,15).
route(bus_16_1,16,16).
route(bus_16_10,16,16).
route(bus_16_11,16,16).
route(bus_16_12,16,16).
route(bus_16_13,16,16).
route(bus_16_14,16,16).
route(bus_16_15,16,16).
route(bus_16_16,16,16).
route(bus_16_17,16,16).
route(bus_16_18,16,16).
route(bus_16_19,16,16).
route(bus_16_2,16,16).
route(bus_16_20,16,16).
route(bus_16_21,16,16).
route(bus_16_22,16,16).
route(bus_16_23,16,16).
route(bus_16_24,16,16).
route(bus_16_25,16,16).
route(bus_16_26,16,16).
route(bus_16_27,16,16).
route(bus_16_28,16,16).
route(bus_16_29,16,16).
route(bus_16_3,16,16).
route(bus_16_30,16,16).
route(bus_16_31,16,16).
route(bus_16_32,16,16).
route(bus_16_33,16,16).
route(bus_16_34,16,16).
route(bus_16_35,16,16).
route(bus_16_36,16,16).
route(bus_16_37,16,16).
route(bus_16_38,16,16).
route(bus_16_39,16,16).
route(bus_16_4,16,16).
route(bus_16_40,16,16).
route(bus_16_41,16,16).
route(bus_16_42,16,16).
route(bus_16_43,16,16).
route(bus_16_44,16,16).
route(bus_16_45,16,16).
route(bus_16_46,16,16).
route(bus_16_47,16,16).
route(bus_16_48,16,16).
route(bus_16_49,16,16).
route(bus_16_5,16,16).
route(bus_16_50,16,16).
route(bus_16_51,16,16).
route(bus_16_52,16,16).
route(bus_16_53,16,16).
route(bus_16_54,16,16).
route(bus_16_55,16,16).
route(bus_16_56,16,16).
route(bus_16_57,16,16).
route(bus_16_58,16,16).
route(bus_16_59,16,16).
route(bus_16_6,16,16).
route(bus_16_60,16,16).
route(bus_16_6001,16,16).
route(bus_16_6002,16,16).
route(bus_16_6003,16,16).
route(bus_16_6004,16,16).
route(bus_16_6005,16,16).
route(bus_16_6006,16,16).
route(bus_16_6007,16,16).
route(bus_16_6008,16,16).
route(bus_16_6009,16,16).
route(bus_16_6010,16,16).
route(bus_16_6011,16,16).
route(bus_16_6012,16,16).
route(bus_16_6013,16,16).
route(bus_16_6014,16,16).
route(bus_16_6015,16,16).
route(bus_16_6016,16,16).
route(bus_16_6017,16,16).
route(bus_16_6018,16,16).
route(bus_16_6019,16,16).
route(bus_16_6020,16,16).
route(bus_16_6021,16,16).
route(bus_16_6022,16,16).
route(bus_16_6023,16,16).
route(bus_16_6024,16,16).
route(bus_16_6025,16,16).
route(bus_16_6026,16,16).
route(bus_16_6027,16,16).
route(bus_16_6028,16,16).
route(bus_16_6029,16,16).
route(bus_16_6030,16,16).
route(bus_16_6031,16,16).
route(bus_16_6032,16,16).
route(bus_16_6033,16,16).
route(bus_16_6034,16,16).
route(bus_16_6035,16,16).
route(bus_16_6036,16,16).
route(bus_16_6037,16,16).
route(bus_16_6038,16,16).
route(bus_16_6039,16,16).
route(bus_16_6040,16,16).
route(bus_16_6041,16,16).
route(bus_16_6042,16,16).
route(bus_16_6043,16,16).
route(bus_16_6044,16,16).
route(bus_16_6045,16,16).
route(bus_16_6046,16,16).
route(bus_16_6047,16,16).
route(bus_16_6048,16,16).
route(bus_16_6049,16,16).
route(bus_16_6050,16,16).
route(bus_16_6051,16,16).
route(bus_16_6052,16,16).
route(bus_16_6053,16,16).
route(bus_16_6054,16,16).
route(bus_16_6055,16,16).
route(bus_16_6056,16,16).
route(bus_16_6057,16,16).
route(bus_16_6058,16,16).
route(bus_16_61,16,16).
route(bus_16_62,16,16).
route(bus_16_63,16,16).
route(bus_16_64,16,16).
route(bus_16_65,16,16).
route(bus_16_66,16,16).
route(bus_16_67,16,16).
route(bus_16_68,16,16).
route(bus_16_69,16,16).
route(bus_16_7,16,16).
route(bus_16_70,16,16).
route(bus_16_7001,16,16).
route(bus_16_7002,16,16).
route(bus_16_7003,16,16).
route(bus_16_7004,16,16).
route(bus_16_7005,16,16).
route(bus_16_7006,16,16).
route(bus_16_7007,16,16).
route(bus_16_7008,16,16).
route(bus_16_7009,16,16).
route(bus_16_7010,16,16).
route(bus_16_7011,16,16).
route(bus_16_7012,16,16).
route(bus_16_7013,16,16).
route(bus_16_7014,16,16).
route(bus_16_7015,16,16).
route(bus_16_7016,16,16).
route(bus_16_7017,16,16).
route(bus_16_7018,16,16).
route(bus_16_7019,16,16).
route(bus_16_7020,16,16).
route(bus_16_7021,16,16).
route(bus_16_7022,16,16).
route(bus_16_7023,16,16).
route(bus_16_7024,16,16).
route(bus_16_7025,16,16).
route(bus_16_7026,16,16).
route(bus_16_7027,16,16).
route(bus_16_7028,16,16).
route(bus_16_7029,16,16).
route(bus_16_7030,16,16).
route(bus_16_71,16,16).
route(bus_16_72,16,16).
route(bus_16_73,16,16).
route(bus_16_74,16,16).
route(bus_16_75,16,16).
route(bus_16_76,16,16).
route(bus_16_77,16,16).
route(bus_16_78,16,16).
route(bus_16_79,16,16).
route(bus_16_8,16,16).
route(bus_16_80,16,16).
route(bus_16_81,16,16).
route(bus_16_82,16,16).
route(bus_16_84,16,16).
route(bus_16_9,16,16).
route(bus_1_1,1,1).
route(bus_1_10,1,1).
route(bus_1_100,1,1).
route(bus_1_101,1,1).
route(bus_1_102,1,1).
route(bus_1_103,1,1).
route(bus_1_104,1,1).
route(bus_1_105,1,1).
route(bus_1_106,1,1).
route(bus_1_107,1,1).
route(bus_1_108,1,1).
route(bus_1_109,1,1).
route(bus_1_11,1,1).
route(bus_1_110,1,1).
route(bus_1_111,1,1).
route(bus_1_112,1,1).
route(bus_1_113,1,1).
route(bus_1_114,1,1).
route(bus_1_115,1,1).
route(bus_1_116,1,1).
route(bus_1_117,1,1).
route(bus_1_118,1,1).
route(bus_1_119,1,1).
route(bus_1_12,1,1).
route(bus_1_120,1,1).
route(bus_1_121,1,1).
route(bus_1_122,1,1).
route(bus_1_123,1,1).
route(bus_1_124,1,1).
route(bus_1_125,1,1).
route(bus_1_126,1,1).
route(bus_1_127,1,1).
route(bus_1_128,1,1).
route(bus_1_129,1,1).
route(bus_1_13,1,1).
route(bus_1_130,1,1).
route(bus_1_131,1,1).
route(bus_1_132,1,1).
route(bus_1_133,1,1).
route(bus_1_134,1,1).
route(bus_1_135,1,1).
route(bus_1_136,1,1).
route(bus_1_137,1,1).
route(bus_1_138,1,1).
route(bus_1_139,1,1).
route(bus_1_14,1,1).
route(bus_1_140,1,1).
route(bus_1_141,1,1).
route(bus_1_142,1,1).
route(bus_1_143,1,1).
route(bus_1_144,1,1).
route(bus_1_145,1,1).
route(bus_1_146,1,1).
route(bus_1_147,1,1).
route(bus_1_148,1,1).
route(bus_1_149,1,1).
route(bus_1_15,1,1).
route(bus_1_150,1,1).
route(bus_1_151,1,1).
route(bus_1_152,1,1).
route(bus_1_153,1,1).
route(bus_1_154,1,1).
route(bus_1_155,1,1).
route(bus_1_156,1,1).
route(bus_1_157,1,1).
route(bus_1_158,1,1).
route(bus_1_159,1,1).
route(bus_1_16,1,1).
route(bus_1_160,1,1).
route(bus_1_161,1,1).
route(bus_1_162,1,1).
route(bus_1_163,1,1).
route(bus_1_164,1,1).
route(bus_1_165,1,1).
route(bus_1_166,1,1).
route(bus_1_167,1,1).
route(bus_1_168,1,1).
route(bus_1_169,1,1).
route(bus_1_17,1,1).
route(bus_1_170,1,1).
route(bus_1_171,1,1).
route(bus_1_172,1,1).
route(bus_1_173,1,1).
route(bus_1_174,1,1).
route(bus_1_175,1,1).
route(bus_1_176,1,1).
route(bus_1_177,1,1).
route(bus_1_178,1,1).
route(bus_1_179,1,1).
route(bus_1_18,1,1).
route(bus_1_180,1,1).
route(bus_1_181,1,1).
route(bus_1_182,1,1).
route(bus_1_183,1,1).
route(bus_1_184,1,1).
route(bus_1_185,1,1).
route(bus_1_186,1,1).
route(bus_1_187,1,1).
route(bus_1_188,1,1).
route(bus_1_189,1,1).
route(bus_1_19,1,1).
route(bus_1_190,1,1).
route(bus_1_193,1,1).
route(bus_1_194,1,1).
route(bus_1_197,1,1).
route(bus_1_198,1,1).
route(bus_1_199,1,1).
route(bus_1_2,1,1).
route(bus_1_20,1,1).
route(bus_1_200,1,1).
route(bus_1_201,1,1).
route(bus_1_202,1,1).
route(bus_1_203,1,1).
route(bus_1_204,1,1).
route(bus_1_205,1,1).
route(bus_1_206,1,1).
route(bus_1_207,1,1).
route(bus_1_208,1,1).
route(bus_1_209,1,1).
route(bus_1_21,1,1).
route(bus_1_210,1,1).
route(bus_1_211,1,1).
route(bus_1_212,1,1).
route(bus_1_213,1,1).
route(bus_1_214,1,1).
route(bus_1_215,1,1).
route(bus_1_216,1,1).
route(bus_1_217,1,1).
route(bus_1_218,1,1).
route(bus_1_219,1,1).
route(bus_1_22,1,1).
route(bus_1_220,1,1).
route(bus_1_221,1,1).
route(bus_1_222,1,1).
route(bus_1_223,1,1).
route(bus_1_224,1,1).
route(bus_1_225,1,1).
route(bus_1_226,1,1).
route(bus_1_227,1,1).
route(bus_1_228,1,1).
route(bus_1_229,1,1).
route(bus_1_23,1,1).
route(bus_1_230,1,1).
route(bus_1_231,1,1).
route(bus_1_232,1,1).
route(bus_1_233,1,1).
route(bus_1_234,1,1).
route(bus_1_235,1,1).
route(bus_1_236,1,1).
route(bus_1_237,1,1).
route(bus_1_238,1,1).
route(bus_1_239,1,1).
route(bus_1_24,1,1).
route(bus_1_240,1,1).
route(bus_1_241,1,1).
route(bus_1_242,1,1).
route(bus_1_243,1,1).
route(bus_1_244,1,1).
route(bus_1_245,1,1).
route(bus_1_246,1,1).
route(bus_1_247,1,1).
route(bus_1_248,1,1).
route(bus_1_249,1,1).
route(bus_1_25,1,1).
route(bus_1_250,1,1).
route(bus_1_251,1,1).
route(bus_1_252,1,1).
route(bus_1_253,1,1).
route(bus_1_254,1,1).
route(bus_1_255,1,1).
route(bus_1_256,1,1).
route(bus_1_26,1,1).
route(bus_1_27,1,1).
route(bus_1_28,1,1).
route(bus_1_29,1,1).
route(bus_1_3,1,1).
route(bus_1_30,1,1).
route(bus_1_31,1,1).
route(bus_1_32,1,1).
route(bus_1_33,1,1).
route(bus_1_34,1,1).
route(bus_1_35,1,1).
route(bus_1_36,1,1).
route(bus_1_37,1,1).
route(bus_1_38,1,1).
route(bus_1_39,1,1).
route(bus_1_4,1,1).
route(bus_1_40,1,1).
route(bus_1_41,1,1).
route(bus_1_42,1,1).
route(bus_1_43,1,1).
route(bus_1_44,1,1).
route(bus_1_45,1,1).
route(bus_1_46,1,1).
route(bus_1_47,1,1).
route(bus_1_48,1,1).
route(bus_1_49,1,1).
route(bus_1_5,1,1).
route(bus_1_50,1,1).
route(bus_1_51,1,1).
route(bus_1_52,1,1).
route(bus_1_53,1,1).
route(bus_1_54,1,1).
route(bus_1_55,1,1).
route(bus_1_56,1,1).
route(bus_1_57,1,1).
route(bus_1_58,1,1).
route(bus_1_59,1,1).
route(bus_1_6,1,1).
route(bus_1_60,1,1).
route(bus_1_6001,1,1).
route(bus_1_6002,1,1).
route(bus_1_6003,1,1).
route(bus_1_6004,1,1).
route(bus_1_6005,1,1).
route(bus_1_6006,1,1).
route(bus_1_6007,1,1).
route(bus_1_6008,1,1).
route(bus_1_6009,1,1).
route(bus_1_6010,1,1).
route(bus_1_6011,1,1).
route(bus_1_6012,1,1).
route(bus_1_6013,1,1).
route(bus_1_6014,1,1).
route(bus_1_6015,1,1).
route(bus_1_6016,1,1).
route(bus_1_6017,1,1).
route(bus_1_6018,1,1).
route(bus_1_6019,1,1).
route(bus_1_6020,1,1).
route(bus_1_6021,1,1).
route(bus_1_6022,1,1).
route(bus_1_6023,1,1).
route(bus_1_6024,1,1).
route(bus_1_6025,1,1).
route(bus_1_6026,1,1).
route(bus_1_6027,1,1).
route(bus_1_6028,1,1).
route(bus_1_6029,1,1).
route(bus_1_6030,1,1).
route(bus_1_6031,1,1).
route(bus_1_6032,1,1).
route(bus_1_6033,1,1).
route(bus_1_6034,1,1).
route(bus_1_6035,1,1).
route(bus_1_6036,1,1).
route(bus_1_6037,1,1).
route(bus_1_6038,1,1).
route(bus_1_6039,1,1).
route(bus_1_6040,1,1).
route(bus_1_6041,1,1).
route(bus_1_6042,1,1).
route(bus_1_6043,1,1).
route(bus_1_6044,1,1).
route(bus_1_6045,1,1).
route(bus_1_6046,1,1).
route(bus_1_6047,1,1).
route(bus_1_6048,1,1).
route(bus_1_6049,1,1).
route(bus_1_6050,1,1).
route(bus_1_6051,1,1).
route(bus_1_6052,1,1).
route(bus_1_6053,1,1).
route(bus_1_6054,1,1).
route(bus_1_6055,1,1).
route(bus_1_6056,1,1).
route(bus_1_6057,1,1).
route(bus_1_6058,1,1).
route(bus_1_6059,1,1).
route(bus_1_6060,1,1).
route(bus_1_6061,1,1).
route(bus_1_6062,1,1).
route(bus_1_6063,1,1).
route(bus_1_6064,1,1).
route(bus_1_6065,1,1).
route(bus_1_6066,1,1).
route(bus_1_6067,1,1).
route(bus_1_6068,1,1).
route(bus_1_6069,1,1).
route(bus_1_6070,1,1).
route(bus_1_6071,1,1).
route(bus_1_6072,1,1).
route(bus_1_6073,1,1).
route(bus_1_6074,1,1).
route(bus_1_6075,1,1).
route(bus_1_6076,1,1).
route(bus_1_6077,1,1).
route(bus_1_6078,1,1).
route(bus_1_6079,1,1).
route(bus_1_6080,1,1).
route(bus_1_6081,1,1).
route(bus_1_6082,1,1).
route(bus_1_6083,1,1).
route(bus_1_6084,1,1).
route(bus_1_6085,1,1).
route(bus_1_6086,1,1).
route(bus_1_6087,1,1).
route(bus_1_6088,1,1).
route(bus_1_6089,1,1).
route(bus_1_6090,1,1).
route(bus_1_6091,1,1).
route(bus_1_6092,1,1).
route(bus_1_6093,1,1).
route(bus_1_6094,1,1).
route(bus_1_6095,1,1).
route(bus_1_6096,1,1).
route(bus_1_6097,1,1).
route(bus_1_6098,1,1).
route(bus_1_6099,1,1).
route(bus_1_61,1,1).
route(bus_1_6100,1,1).
route(bus_1_6101,1,1).
route(bus_1_6102,1,1).
route(bus_1_6103,1,1).
route(bus_1_6104,1,1).
route(bus_1_6105,1,1).
route(bus_1_6106,1,1).
route(bus_1_6107,1,1).
route(bus_1_6108,1,1).
route(bus_1_6109,1,1).
route(bus_1_6110,1,1).
route(bus_1_6111,1,1).
route(bus_1_6112,1,1).
route(bus_1_6113,1,1).
route(bus_1_6114,1,1).
route(bus_1_6115,1,1).
route(bus_1_6116,1,1).
route(bus_1_6117,1,1).
route(bus_1_6118,1,1).
route(bus_1_6119,1,1).
route(bus_1_6120,1,1).
route(bus_1_6121,1,1).
route(bus_1_6122,1,1).
route(bus_1_6123,1,1).
route(bus_1_6124,1,1).
route(bus_1_6125,1,1).
route(bus_1_6126,1,1).
route(bus_1_6127,1,1).
route(bus_1_6128,1,1).
route(bus_1_6129,1,1).
route(bus_1_6130,1,1).
route(bus_1_6131,1,1).
route(bus_1_6132,1,1).
route(bus_1_6133,1,1).
route(bus_1_6134,1,1).
route(bus_1_6135,1,1).
route(bus_1_6136,1,1).
route(bus_1_6137,1,1).
route(bus_1_6138,1,1).
route(bus_1_6139,1,1).
route(bus_1_6140,1,1).
route(bus_1_6141,1,1).
route(bus_1_6142,1,1).
route(bus_1_6143,1,1).
route(bus_1_6144,1,1).
route(bus_1_6145,1,1).
route(bus_1_6146,1,1).
route(bus_1_6147,1,1).
route(bus_1_6148,1,1).
route(bus_1_6149,1,1).
route(bus_1_6150,1,1).
route(bus_1_6151,1,1).
route(bus_1_6152,1,1).
route(bus_1_6153,1,1).
route(bus_1_6154,1,1).
route(bus_1_6155,1,1).
route(bus_1_6156,1,1).
route(bus_1_6157,1,1).
route(bus_1_6158,1,1).
route(bus_1_6159,1,1).
route(bus_1_6160,1,1).
route(bus_1_6161,1,1).
route(bus_1_6162,1,1).
route(bus_1_6163,1,1).
route(bus_1_6164,1,1).
route(bus_1_6165,1,1).
route(bus_1_6166,1,1).
route(bus_1_6167,1,1).
route(bus_1_6168,1,1).
route(bus_1_6169,1,1).
route(bus_1_6170,1,1).
route(bus_1_6171,1,1).
route(bus_1_6172,1,1).
route(bus_1_6173,1,1).
route(bus_1_6174,1,1).
route(bus_1_6175,1,1).
route(bus_1_6176,1,1).
route(bus_1_6177,1,1).
route(bus_1_6178,1,1).
route(bus_1_6179,1,1).
route(bus_1_6180,1,1).
route(bus_1_6181,1,1).
route(bus_1_62,1,1).
route(bus_1_63,1,1).
route(bus_1_64,1,1).
route(bus_1_65,1,1).
route(bus_1_66,1,1).
route(bus_1_67,1,1).
route(bus_1_68,1,1).
route(bus_1_69,1,1).
route(bus_1_7,1,1).
route(bus_1_70,1,1).
route(bus_1_7001,1,1).
route(bus_1_7002,1,1).
route(bus_1_7003,1,1).
route(bus_1_7004,1,1).
route(bus_1_7005,1,1).
route(bus_1_7006,1,1).
route(bus_1_7007,1,1).
route(bus_1_7008,1,1).
route(bus_1_7009,1,1).
route(bus_1_7010,1,1).
route(bus_1_7011,1,1).
route(bus_1_7012,1,1).
route(bus_1_7013,1,1).
route(bus_1_7014,1,1).
route(bus_1_7015,1,1).
route(bus_1_7016,1,1).
route(bus_1_7017,1,1).
route(bus_1_7018,1,1).
route(bus_1_7019,1,1).
route(bus_1_7020,1,1).
route(bus_1_7021,1,1).
route(bus_1_7022,1,1).
route(bus_1_7023,1,1).
route(bus_1_7024,1,1).
route(bus_1_7025,1,1).
route(bus_1_7026,1,1).
route(bus_1_7027,1,1).
route(bus_1_7028,1,1).
route(bus_1_7029,1,1).
route(bus_1_7030,1,1).
route(bus_1_7031,1,1).
route(bus_1_7032,1,1).
route(bus_1_7033,1,1).
route(bus_1_7034,1,1).
route(bus_1_7035,1,1).
route(bus_1_7036,1,1).
route(bus_1_7037,1,1).
route(bus_1_7038,1,1).
route(bus_1_7039,1,1).
route(bus_1_7040,1,1).
route(bus_1_7041,1,1).
route(bus_1_7042,1,1).
route(bus_1_7043,1,1).
route(bus_1_7044,1,1).
route(bus_1_7045,1,1).
route(bus_1_7046,1,1).
route(bus_1_7047,1,1).
route(bus_1_7048,1,1).
route(bus_1_7049,1,1).
route(bus_1_7050,1,1).
route(bus_1_7051,1,1).
route(bus_1_7052,1,1).
route(bus_1_7053,1,1).
route(bus_1_7054,1,1).
route(bus_1_7055,1,1).
route(bus_1_7056,1,1).
route(bus_1_7057,1,1).
route(bus_1_7058,1,1).
route(bus_1_7059,1,1).
route(bus_1_7060,1,1).
route(bus_1_7061,1,1).
route(bus_1_7062,1,1).
route(bus_1_7063,1,1).
route(bus_1_7064,1,1).
route(bus_1_7065,1,1).
route(bus_1_7066,1,1).
route(bus_1_7067,1,1).
route(bus_1_7068,1,1).
route(bus_1_7069,1,1).
route(bus_1_7070,1,1).
route(bus_1_7071,1,1).
route(bus_1_7072,1,1).
route(bus_1_7073,1,1).
route(bus_1_7074,1,1).
route(bus_1_7075,1,1).
route(bus_1_7076,1,1).
route(bus_1_7077,1,1).
route(bus_1_7078,1,1).
route(bus_1_7079,1,1).
route(bus_1_7080,1,1).
route(bus_1_7081,1,1).
route(bus_1_7082,1,1).
route(bus_1_7083,1,1).
route(bus_1_7084,1,1).
route(bus_1_7085,1,1).
route(bus_1_7086,1,1).
route(bus_1_7087,1,1).
route(bus_1_7088,1,1).
route(bus_1_7089,1,1).
route(bus_1_7090,1,1).
route(bus_1_7091,1,1).
route(bus_1_7092,1,1).
route(bus_1_7093,1,1).
route(bus_1_7094,1,1).
route(bus_1_7095,1,1).
route(bus_1_7096,1,1).
route(bus_1_7097,1,1).
route(bus_1_7098,1,1).
route(bus_1_71,1,1).
route(bus_1_72,1,1).
route(bus_1_73,1,1).
route(bus_1_74,1,1).
route(bus_1_75,1,1).
route(bus_1_76,1,1).
route(bus_1_77,1,1).
route(bus_1_78,1,1).
route(bus_1_79,1,1).
route(bus_1_8,1,1).
route(bus_1_80,1,1).
route(bus_1_81,1,1).
route(bus_1_82,1,1).
route(bus_1_83,1,1).
route(bus_1_84,1,1).
route(bus_1_85,1,1).
route(bus_1_86,1,1).
route(bus_1_87,1,1).
route(bus_1_8739,1,1).
route(bus_1_88,1,1).
route(bus_1_89,1,1).
route(bus_1_9,1,1).
route(bus_1_90,1,1).
route(bus_1_91,1,1).
route(bus_1_92,1,1).
route(bus_1_93,1,1).
route(bus_1_94,1,1).
route(bus_1_95,1,1).
route(bus_1_96,1,1).
route(bus_1_97,1,1).
route(bus_1_98,1,1).
route(bus_1_99,1,1).
route(bus_201_1,201,201).
route(bus_201_2,201,201).
route(bus_201_3,201,201).
route(bus_201_4,201,201).
route(bus_201_5,201,201).
route(bus_201_6,201,201).
route(bus_202_1,202,202).
route(bus_202_3,202,202).
route(bus_202_5,202,202).
route(bus_203_1,203,203).
route(bus_203_11,203,203).
route(bus_203_13,203,203).
route(bus_203_15,203,203).
route(bus_203_17,203,203).
route(bus_203_2,203,203).
route(bus_203_3,203,203).
route(bus_203_4,203,203).
route(bus_203_5,203,203).
route(bus_203_7,203,203).
route(bus_203_9,203,203).
route(bus_204_1,204,204).
route(bus_204_2,204,204).
route(bus_204_4,204,204).
route(bus_204_6,204,204).
route(bus_205_1,205,205).
route(bus_205_2,205,205).
route(bus_205_3,205,205).
route(bus_205_4,205,205).
route(bus_205_7,205,205).
route(bus_205_9,205,205).
route(bus_206_1,206,206).
route(bus_206_2,206,206).
route(bus_206_3,206,206).
route(bus_206_4,206,206).
route(bus_206_6,206,206).
route(bus_206_8,206,206).
route(bus_207_1,207,207).
route(bus_207_3,207,207).
route(bus_207_5,207,207).
route(bus_207_7,207,207).
route(bus_208_2,208,208).
route(bus_208_4,208,208).
route(bus_209_2,209,209).
route(bus_209_4,209,209).
route(bus_20_1,20,20).
route(bus_20_10,20,20).
route(bus_20_11,20,20).
route(bus_20_12,20,20).
route(bus_20_13,20,20).
route(bus_20_14,20,20).
route(bus_20_15,20,20).
route(bus_20_16,20,20).
route(bus_20_17,20,20).
route(bus_20_18,20,20).
route(bus_20_19,20,20).
route(bus_20_2,20,20).
route(bus_20_20,20,20).
route(bus_20_21,20,20).
route(bus_20_22,20,20).
route(bus_20_23,20,20).
route(bus_20_24,20,20).
route(bus_20_25,20,20).
route(bus_20_26,20,20).
route(bus_20_27,20,20).
route(bus_20_28,20,20).
route(bus_20_29,20,20).
route(bus_20_3,20,20).
route(bus_20_30,20,20).
route(bus_20_31,20,20).
route(bus_20_32,20,20).
route(bus_20_33,20,20).
route(bus_20_34,20,20).
route(bus_20_35,20,20).
route(bus_20_36,20,20).
route(bus_20_37,20,20).
route(bus_20_38,20,20).
route(bus_20_39,20,20).
route(bus_20_4,20,20).
route(bus_20_40,20,20).
route(bus_20_41,20,20).
route(bus_20_42,20,20).
route(bus_20_43,20,20).
route(bus_20_44,20,20).
route(bus_20_45,20,20).
route(bus_20_46,20,20).
route(bus_20_47,20,20).
route(bus_20_48,20,20).
route(bus_20_49,20,20).
route(bus_20_5,20,20).
route(bus_20_50,20,20).
route(bus_20_51,20,20).
route(bus_20_52,20,20).
route(bus_20_53,20,20).
route(bus_20_54,20,20).
route(bus_20_55,20,20).
route(bus_20_56,20,20).
route(bus_20_57,20,20).
route(bus_20_58,20,20).
route(bus_20_59,20,20).
route(bus_20_6,20,20).
route(bus_20_60,20,20).
route(bus_20_6001,20,20).
route(bus_20_6002,20,20).
route(bus_20_6003,20,20).
route(bus_20_6004,20,20).
route(bus_20_6005,20,20).
route(bus_20_6006,20,20).
route(bus_20_6007,20,20).
route(bus_20_6008,20,20).
route(bus_20_6009,20,20).
route(bus_20_6010,20,20).
route(bus_20_6011,20,20).
route(bus_20_6012,20,20).
route(bus_20_6013,20,20).
route(bus_20_6014,20,20).
route(bus_20_6015,20,20).
route(bus_20_6016,20,20).
route(bus_20_6017,20,20).
route(bus_20_6018,20,20).
route(bus_20_6019,20,20).
route(bus_20_6020,20,20).
route(bus_20_6021,20,20).
route(bus_20_6022,20,20).
route(bus_20_6023,20,20).
route(bus_20_6024,20,20).
route(bus_20_6025,20,20).
route(bus_20_6026,20,20).
route(bus_20_6027,20,20).
route(bus_20_6028,20,20).
route(bus_20_6029,20,20).
route(bus_20_6030,20,20).
route(bus_20_6031,20,20).
route(bus_20_6032,20,20).
route(bus_20_6033,20,20).
route(bus_20_6034,20,20).
route(bus_20_6035,20,20).
route(bus_20_6036,20,20).
route(bus_20_6037,20,20).
route(bus_20_6038,20,20).
route(bus_20_6039,20,20).
route(bus_20_6040,20,20).
route(bus_20_6041,20,20).
route(bus_20_6042,20,20).
route(bus_20_6043,20,20).
route(bus_20_6044,20,20).
route(bus_20_6045,20,20).
route(bus_20_6046,20,20).
route(bus_20_6047,20,20).
route(bus_20_6048,20,20).
route(bus_20_6049,20,20).
route(bus_20_6050,20,20).
route(bus_20_6051,20,20).
route(bus_20_6052,20,20).
route(bus_20_6053,20,20).
route(bus_20_6054,20,20).
route(bus_20_6055,20,20).
route(bus_20_6056,20,20).
route(bus_20_6057,20,20).
route(bus_20_6058,20,20).
route(bus_20_6059,20,20).
route(bus_20_6060,20,20).
route(bus_20_6061,20,20).
route(bus_20_6062,20,20).
route(bus_20_6063,20,20).
route(bus_20_6064,20,20).
route(bus_20_6065,20,20).
route(bus_20_6066,20,20).
route(bus_20_6067,20,20).
route(bus_20_6068,20,20).
route(bus_20_6069,20,20).
route(bus_20_6070,20,20).
route(bus_20_6071,20,20).
route(bus_20_6072,20,20).
route(bus_20_6073,20,20).
route(bus_20_6074,20,20).
route(bus_20_61,20,20).
route(bus_20_62,20,20).
route(bus_20_63,20,20).
route(bus_20_64,20,20).
route(bus_20_65,20,20).
route(bus_20_66,20,20).
route(bus_20_67,20,20).
route(bus_20_68,20,20).
route(bus_20_69,20,20).
route(bus_20_7,20,20).
route(bus_20_70,20,20).
route(bus_20_7001,20,20).
route(bus_20_7002,20,20).
route(bus_20_7003,20,20).
route(bus_20_7004,20,20).
route(bus_20_7005,20,20).
route(bus_20_7006,20,20).
route(bus_20_7007,20,20).
route(bus_20_7008,20,20).
route(bus_20_7009,20,20).
route(bus_20_7010,20,20).
route(bus_20_7011,20,20).
route(bus_20_7012,20,20).
route(bus_20_7013,20,20).
route(bus_20_7014,20,20).
route(bus_20_7015,20,20).
route(bus_20_7016,20,20).
route(bus_20_7017,20,20).
route(bus_20_7018,20,20).
route(bus_20_7019,20,20).
route(bus_20_7020,20,20).
route(bus_20_7021,20,20).
route(bus_20_7022,20,20).
route(bus_20_7023,20,20).
route(bus_20_7024,20,20).
route(bus_20_7025,20,20).
route(bus_20_7026,20,20).
route(bus_20_7027,20,20).
route(bus_20_7028,20,20).
route(bus_20_7029,20,20).
route(bus_20_7030,20,20).
route(bus_20_7031,20,20).
route(bus_20_7032,20,20).
route(bus_20_7033,20,20).
route(bus_20_7034,20,20).
route(bus_20_7035,20,20).
route(bus_20_7036,20,20).
route(bus_20_7037,20,20).
route(bus_20_7038,20,20).
route(bus_20_7039,20,20).
route(bus_20_7040,20,20).
route(bus_20_7041,20,20).
route(bus_20_7042,20,20).
route(bus_20_7043,20,20).
route(bus_20_7044,20,20).
route(bus_20_7045,20,20).
route(bus_20_7046,20,20).
route(bus_20_7047,20,20).
route(bus_20_7048,20,20).
route(bus_20_7049,20,20).
route(bus_20_7050,20,20).
route(bus_20_7051,20,20).
route(bus_20_7052,20,20).
route(bus_20_7053,20,20).
route(bus_20_7054,20,20).
route(bus_20_7055,20,20).
route(bus_20_7056,20,20).
route(bus_20_7057,20,20).
route(bus_20_7058,20,20).
route(bus_20_7059,20,20).
route(bus_20_7060,20,20).
route(bus_20_7061,20,20).
route(bus_20_7062,20,20).
route(bus_20_71,20,20).
route(bus_20_72,20,20).
route(bus_20_73,20,20).
route(bus_20_74,20,20).
route(bus_20_75,20,20).
route(bus_20_76,20,20).
route(bus_20_77,20,20).
route(bus_20_78,20,20).
route(bus_20_79,20,20).
route(bus_20_8,20,20).
route(bus_20_80,20,20).
route(bus_20_81,20,20).
route(bus_20_82,20,20).
route(bus_20_83,20,20).
route(bus_20_84,20,20).
route(bus_20_85,20,20).
route(bus_20_86,20,20).
route(bus_20_87,20,20).
route(bus_20_88,20,20).
route(bus_20_89,20,20).
route(bus_20_9,20,20).
route(bus_20_90,20,20).
route(bus_20_91,20,20).
route(bus_20_92,20,20).
route(bus_20_93,20,20).
route(bus_20_94,20,20).
route(bus_20_95,20,20).
route(bus_20_96,20,20).
route(bus_20_97,20,20).
route(bus_20_99,20,20).
route(bus_210_1,210,210).
route(bus_210_2,210,210).
route(bus_210_3,210,210).
route(bus_211_2,211,211).
route(bus_211_4,211,211).
route(bus_212_2,212,212).
route(bus_212_4,212,212).
route(bus_214_1,214,214).
route(bus_214_10,214,214).
route(bus_214_11,214,214).
route(bus_214_2,214,214).
route(bus_214_3,214,214).
route(bus_214_4,214,214).
route(bus_214_5,214,214).
route(bus_214_6,214,214).
route(bus_214_7,214,214).
route(bus_214_8,214,214).
route(bus_214_9,214,214).
route(bus_215_1,215,215).
route(bus_215_2,215,215).
route(bus_215_3,215,215).
route(bus_215_4,215,215).
route(bus_215_7,215,215).
route(bus_215_9,215,215).
route(bus_216_1,216,216).
route(bus_216_11,216,216).
route(bus_216_13,216,216).
route(bus_216_15,216,216).
route(bus_216_17,216,216).
route(bus_216_2,216,216).
route(bus_216_3,216,216).
route(bus_216_4,216,216).
route(bus_216_5,216,216).
route(bus_216_6,216,216).
route(bus_216_7,216,216).
route(bus_216_9,216,216).
route(bus_217_1,217,217).
route(bus_21_1,21,21).
route(bus_21_10,21,21).
route(bus_21_11,21,21).
route(bus_21_12,21,21).
route(bus_21_13,21,21).
route(bus_21_14,21,21).
route(bus_21_15,21,21).
route(bus_21_16,21,21).
route(bus_21_17,21,21).
route(bus_21_18,21,21).
route(bus_21_19,21,21).
route(bus_21_2,21,21).
route(bus_21_20,21,21).
route(bus_21_21,21,21).
route(bus_21_22,21,21).
route(bus_21_23,21,21).
route(bus_21_24,21,21).
route(bus_21_25,21,21).
route(bus_21_26,21,21).
route(bus_21_27,21,21).
route(bus_21_28,21,21).
route(bus_21_29,21,21).
route(bus_21_3,21,21).
route(bus_21_30,21,21).
route(bus_21_31,21,21).
route(bus_21_32,21,21).
route(bus_21_33,21,21).
route(bus_21_34,21,21).
route(bus_21_35,21,21).
route(bus_21_36,21,21).
route(bus_21_37,21,21).
route(bus_21_38,21,21).
route(bus_21_39,21,21).
route(bus_21_4,21,21).
route(bus_21_40,21,21).
route(bus_21_41,21,21).
route(bus_21_42,21,21).
route(bus_21_43,21,21).
route(bus_21_44,21,21).
route(bus_21_45,21,21).
route(bus_21_46,21,21).
route(bus_21_47,21,21).
route(bus_21_49,21,21).
route(bus_21_5,21,21).
route(bus_21_51,21,21).
route(bus_21_6,21,21).
route(bus_21_6001,21,21).
route(bus_21_6002,21,21).
route(bus_21_6003,21,21).
route(bus_21_6004,21,21).
route(bus_21_6005,21,21).
route(bus_21_6006,21,21).
route(bus_21_6007,21,21).
route(bus_21_6008,21,21).
route(bus_21_6009,21,21).
route(bus_21_6010,21,21).
route(bus_21_6011,21,21).
route(bus_21_6012,21,21).
route(bus_21_6013,21,21).
route(bus_21_6014,21,21).
route(bus_21_6015,21,21).
route(bus_21_6016,21,21).
route(bus_21_6017,21,21).
route(bus_21_6018,21,21).
route(bus_21_6019,21,21).
route(bus_21_6020,21,21).
route(bus_21_6021,21,21).
route(bus_21_6022,21,21).
route(bus_21_6023,21,21).
route(bus_21_6024,21,21).
route(bus_21_6025,21,21).
route(bus_21_6026,21,21).
route(bus_21_6027,21,21).
route(bus_21_6028,21,21).
route(bus_21_6029,21,21).
route(bus_21_6030,21,21).
route(bus_21_6031,21,21).
route(bus_21_6032,21,21).
route(bus_21_6033,21,21).
route(bus_21_6034,21,21).
route(bus_21_6035,21,21).
route(bus_21_6036,21,21).
route(bus_21_6038,21,21).
route(bus_21_6039,21,21).
route(bus_21_6042,21,21).
route(bus_21_6043,21,21).
route(bus_21_6046,21,21).
route(bus_21_6047,21,21).
route(bus_21_6050,21,21).
route(bus_21_6051,21,21).
route(bus_21_6054,21,21).
route(bus_21_6055,21,21).
route(bus_21_6058,21,21).
route(bus_21_6059,21,21).
route(bus_21_6062,21,21).
route(bus_21_6063,21,21).
route(bus_21_6066,21,21).
route(bus_21_6067,21,21).
route(bus_21_6070,21,21).
route(bus_21_6071,21,21).
route(bus_21_6074,21,21).
route(bus_21_7,21,21).
route(bus_21_7001,21,21).
route(bus_21_7002,21,21).
route(bus_21_7003,21,21).
route(bus_21_7004,21,21).
route(bus_21_7005,21,21).
route(bus_21_7006,21,21).
route(bus_21_7007,21,21).
route(bus_21_7008,21,21).
route(bus_21_7010,21,21).
route(bus_21_7011,21,21).
route(bus_21_7013,21,21).
route(bus_21_7014,21,21).
route(bus_21_7015,21,21).
route(bus_21_7016,21,21).
route(bus_21_7017,21,21).
route(bus_21_7018,21,21).
route(bus_21_7019,21,21).
route(bus_21_7020,21,21).
route(bus_21_7022,21,21).
route(bus_21_7023,21,21).
route(bus_21_7025,21,21).
route(bus_21_7026,21,21).
route(bus_21_7027,21,21).
route(bus_21_7028,21,21).
route(bus_21_7029,21,21).
route(bus_21_7030,21,21).
route(bus_21_7031,21,21).
route(bus_21_7032,21,21).
route(bus_21_7034,21,21).
route(bus_21_7035,21,21).
route(bus_21_7038,21,21).
route(bus_21_7039,21,21).
route(bus_21_7042,21,21).
route(bus_21_7043,21,21).
route(bus_21_7046,21,21).
route(bus_21_7047,21,21).
route(bus_21_7050,21,21).
route(bus_21_7051,21,21).
route(bus_21_7054,21,21).
route(bus_21_7055,21,21).
route(bus_21_7058,21,21).
route(bus_21_7059,21,21).
route(bus_21_7062,21,21).
route(bus_21_7133,21,21).
route(bus_21_8,21,21).
route(bus_21_9,21,21).
route(bus_22_1,22,22).
route(bus_22_10,22,22).
route(bus_22_100,22,22).
route(bus_22_101,22,22).
route(bus_22_102,22,22).
route(bus_22_103,22,22).
route(bus_22_104,22,22).
route(bus_22_105,22,22).
route(bus_22_106,22,22).
route(bus_22_107,22,22).
route(bus_22_108,22,22).
route(bus_22_109,22,22).
route(bus_22_11,22,22).
route(bus_22_110,22,22).
route(bus_22_111,22,22).
route(bus_22_112,22,22).
route(bus_22_113,22,22).
route(bus_22_114,22,22).
route(bus_22_115,22,22).
route(bus_22_116,22,22).
route(bus_22_117,22,22).
route(bus_22_118,22,22).
route(bus_22_119,22,22).
route(bus_22_12,22,22).
route(bus_22_120,22,22).
route(bus_22_121,22,22).
route(bus_22_122,22,22).
route(bus_22_123,22,22).
route(bus_22_124,22,22).
route(bus_22_125,22,22).
route(bus_22_126,22,22).
route(bus_22_127,22,22).
route(bus_22_128,22,22).
route(bus_22_129,22,22).
route(bus_22_13,22,22).
route(bus_22_130,22,22).
route(bus_22_131,22,22).
route(bus_22_132,22,22).
route(bus_22_133,22,22).
route(bus_22_134,22,22).
route(bus_22_135,22,22).
route(bus_22_136,22,22).
route(bus_22_137,22,22).
route(bus_22_138,22,22).
route(bus_22_139,22,22).
route(bus_22_14,22,22).
route(bus_22_140,22,22).
route(bus_22_141,22,22).
route(bus_22_142,22,22).
route(bus_22_143,22,22).
route(bus_22_144,22,22).
route(bus_22_15,22,22).
route(bus_22_16,22,22).
route(bus_22_17,22,22).
route(bus_22_18,22,22).
route(bus_22_19,22,22).
route(bus_22_2,22,22).
route(bus_22_20,22,22).
route(bus_22_21,22,22).
route(bus_22_22,22,22).
route(bus_22_23,22,22).
route(bus_22_24,22,22).
route(bus_22_25,22,22).
route(bus_22_26,22,22).
route(bus_22_27,22,22).
route(bus_22_28,22,22).
route(bus_22_29,22,22).
route(bus_22_3,22,22).
route(bus_22_30,22,22).
route(bus_22_31,22,22).
route(bus_22_32,22,22).
route(bus_22_33,22,22).
route(bus_22_34,22,22).
route(bus_22_35,22,22).
route(bus_22_36,22,22).
route(bus_22_37,22,22).
route(bus_22_38,22,22).
route(bus_22_39,22,22).
route(bus_22_4,22,22).
route(bus_22_40,22,22).
route(bus_22_41,22,22).
route(bus_22_42,22,22).
route(bus_22_43,22,22).
route(bus_22_44,22,22).
route(bus_22_45,22,22).
route(bus_22_46,22,22).
route(bus_22_47,22,22).
route(bus_22_48,22,22).
route(bus_22_49,22,22).
route(bus_22_5,22,22).
route(bus_22_50,22,22).
route(bus_22_51,22,22).
route(bus_22_52,22,22).
route(bus_22_53,22,22).
route(bus_22_54,22,22).
route(bus_22_55,22,22).
route(bus_22_56,22,22).
route(bus_22_57,22,22).
route(bus_22_58,22,22).
route(bus_22_59,22,22).
route(bus_22_6,22,22).
route(bus_22_60,22,22).
route(bus_22_6001,22,22).
route(bus_22_6002,22,22).
route(bus_22_6003,22,22).
route(bus_22_6004,22,22).
route(bus_22_6005,22,22).
route(bus_22_6006,22,22).
route(bus_22_6007,22,22).
route(bus_22_6008,22,22).
route(bus_22_6009,22,22).
route(bus_22_6010,22,22).
route(bus_22_6011,22,22).
route(bus_22_6012,22,22).
route(bus_22_6013,22,22).
route(bus_22_6014,22,22).
route(bus_22_6015,22,22).
route(bus_22_6016,22,22).
route(bus_22_6017,22,22).
route(bus_22_6018,22,22).
route(bus_22_6019,22,22).
route(bus_22_6020,22,22).
route(bus_22_6021,22,22).
route(bus_22_6022,22,22).
route(bus_22_6023,22,22).
route(bus_22_6024,22,22).
route(bus_22_6025,22,22).
route(bus_22_6026,22,22).
route(bus_22_6027,22,22).
route(bus_22_6028,22,22).
route(bus_22_6029,22,22).
route(bus_22_6030,22,22).
route(bus_22_6031,22,22).
route(bus_22_6032,22,22).
route(bus_22_6033,22,22).
route(bus_22_6034,22,22).
route(bus_22_6035,22,22).
route(bus_22_6036,22,22).
route(bus_22_6037,22,22).
route(bus_22_6038,22,22).
route(bus_22_6039,22,22).
route(bus_22_6040,22,22).
route(bus_22_6041,22,22).
route(bus_22_6042,22,22).
route(bus_22_6043,22,22).
route(bus_22_6044,22,22).
route(bus_22_6045,22,22).
route(bus_22_6046,22,22).
route(bus_22_6047,22,22).
route(bus_22_6048,22,22).
route(bus_22_6049,22,22).
route(bus_22_6050,22,22).
route(bus_22_6051,22,22).
route(bus_22_6052,22,22).
route(bus_22_6053,22,22).
route(bus_22_6054,22,22).
route(bus_22_6055,22,22).
route(bus_22_6056,22,22).
route(bus_22_6057,22,22).
route(bus_22_6058,22,22).
route(bus_22_6059,22,22).
route(bus_22_6060,22,22).
route(bus_22_6061,22,22).
route(bus_22_6062,22,22).
route(bus_22_6063,22,22).
route(bus_22_6064,22,22).
route(bus_22_6065,22,22).
route(bus_22_6066,22,22).
route(bus_22_6067,22,22).
route(bus_22_6068,22,22).
route(bus_22_6069,22,22).
route(bus_22_6070,22,22).
route(bus_22_6071,22,22).
route(bus_22_6072,22,22).
route(bus_22_6073,22,22).
route(bus_22_6074,22,22).
route(bus_22_6075,22,22).
route(bus_22_6076,22,22).
route(bus_22_6077,22,22).
route(bus_22_6078,22,22).
route(bus_22_6079,22,22).
route(bus_22_6080,22,22).
route(bus_22_6081,22,22).
route(bus_22_6082,22,22).
route(bus_22_6083,22,22).
route(bus_22_6084,22,22).
route(bus_22_6085,22,22).
route(bus_22_6086,22,22).
route(bus_22_6087,22,22).
route(bus_22_6088,22,22).
route(bus_22_6089,22,22).
route(bus_22_6090,22,22).
route(bus_22_6091,22,22).
route(bus_22_6092,22,22).
route(bus_22_6093,22,22).
route(bus_22_6094,22,22).
route(bus_22_6095,22,22).
route(bus_22_6096,22,22).
route(bus_22_6097,22,22).
route(bus_22_6098,22,22).
route(bus_22_6099,22,22).
route(bus_22_61,22,22).
route(bus_22_6100,22,22).
route(bus_22_6101,22,22).
route(bus_22_6102,22,22).
route(bus_22_6103,22,22).
route(bus_22_6104,22,22).
route(bus_22_6105,22,22).
route(bus_22_6106,22,22).
route(bus_22_6107,22,22).
route(bus_22_6108,22,22).
route(bus_22_6109,22,22).
route(bus_22_6110,22,22).
route(bus_22_6111,22,22).
route(bus_22_62,22,22).
route(bus_22_63,22,22).
route(bus_22_64,22,22).
route(bus_22_65,22,22).
route(bus_22_66,22,22).
route(bus_22_67,22,22).
route(bus_22_68,22,22).
route(bus_22_69,22,22).
route(bus_22_7,22,22).
route(bus_22_70,22,22).
route(bus_22_7001,22,22).
route(bus_22_7002,22,22).
route(bus_22_7003,22,22).
route(bus_22_7004,22,22).
route(bus_22_7005,22,22).
route(bus_22_7006,22,22).
route(bus_22_7007,22,22).
route(bus_22_7008,22,22).
route(bus_22_7009,22,22).
route(bus_22_7010,22,22).
route(bus_22_7011,22,22).
route(bus_22_7012,22,22).
route(bus_22_7013,22,22).
route(bus_22_7014,22,22).
route(bus_22_7015,22,22).
route(bus_22_7016,22,22).
route(bus_22_7017,22,22).
route(bus_22_7018,22,22).
route(bus_22_7019,22,22).
route(bus_22_7020,22,22).
route(bus_22_7021,22,22).
route(bus_22_7022,22,22).
route(bus_22_7023,22,22).
route(bus_22_7024,22,22).
route(bus_22_7025,22,22).
route(bus_22_7026,22,22).
route(bus_22_7027,22,22).
route(bus_22_7028,22,22).
route(bus_22_7029,22,22).
route(bus_22_7030,22,22).
route(bus_22_7031,22,22).
route(bus_22_7032,22,22).
route(bus_22_7033,22,22).
route(bus_22_7034,22,22).
route(bus_22_7035,22,22).
route(bus_22_7036,22,22).
route(bus_22_7037,22,22).
route(bus_22_7038,22,22).
route(bus_22_7039,22,22).
route(bus_22_7040,22,22).
route(bus_22_7041,22,22).
route(bus_22_7042,22,22).
route(bus_22_7043,22,22).
route(bus_22_7044,22,22).
route(bus_22_7045,22,22).
route(bus_22_7046,22,22).
route(bus_22_7047,22,22).
route(bus_22_7048,22,22).
route(bus_22_7049,22,22).
route(bus_22_7050,22,22).
route(bus_22_7051,22,22).
route(bus_22_7052,22,22).
route(bus_22_7053,22,22).
route(bus_22_7054,22,22).
route(bus_22_7055,22,22).
route(bus_22_7056,22,22).
route(bus_22_7057,22,22).
route(bus_22_7058,22,22).
route(bus_22_7059,22,22).
route(bus_22_7060,22,22).
route(bus_22_7061,22,22).
route(bus_22_7062,22,22).
route(bus_22_7063,22,22).
route(bus_22_7064,22,22).
route(bus_22_7065,22,22).
route(bus_22_7066,22,22).
route(bus_22_7067,22,22).
route(bus_22_7068,22,22).
route(bus_22_7069,22,22).
route(bus_22_7070,22,22).
route(bus_22_7071,22,22).
route(bus_22_7072,22,22).
route(bus_22_7073,22,22).
route(bus_22_7074,22,22).
route(bus_22_7075,22,22).
route(bus_22_7076,22,22).
route(bus_22_7077,22,22).
route(bus_22_7078,22,22).
route(bus_22_7079,22,22).
route(bus_22_7080,22,22).
route(bus_22_7081,22,22).
route(bus_22_7082,22,22).
route(bus_22_7083,22,22).
route(bus_22_7084,22,22).
route(bus_22_7085,22,22).
route(bus_22_7086,22,22).
route(bus_22_7087,22,22).
route(bus_22_7088,22,22).
route(bus_22_7089,22,22).
route(bus_22_7090,22,22).
route(bus_22_7091,22,22).
route(bus_22_7092,22,22).
route(bus_22_7093,22,22).
route(bus_22_71,22,22).
route(bus_22_72,22,22).
route(bus_22_73,22,22).
route(bus_22_74,22,22).
route(bus_22_75,22,22).
route(bus_22_76,22,22).
route(bus_22_77,22,22).
route(bus_22_78,22,22).
route(bus_22_79,22,22).
route(bus_22_8,22,22).
route(bus_22_80,22,22).
route(bus_22_81,22,22).
route(bus_22_82,22,22).
route(bus_22_83,22,22).
route(bus_22_84,22,22).
route(bus_22_85,22,22).
route(bus_22_86,22,22).
route(bus_22_87,22,22).
route(bus_22_88,22,22).
route(bus_22_89,22,22).
route(bus_22_9,22,22).
route(bus_22_90,22,22).
route(bus_22_91,22,22).
route(bus_22_92,22,22).
route(bus_22_93,22,22).
route(bus_22_94,22,22).
route(bus_22_95,22,22).
route(bus_22_96,22,22).
route(bus_22_97,22,22).
route(bus_22_98,22,22).
route(bus_22_99,22,22).
route(bus_23_1,23,23).
route(bus_23_10,23,23).
route(bus_23_100,23,23).
route(bus_23_101,23,23).
route(bus_23_102,23,23).
route(bus_23_103,23,23).
route(bus_23_104,23,23).
route(bus_23_105,23,23).
route(bus_23_106,23,23).
route(bus_23_107,23,23).
route(bus_23_108,23,23).
route(bus_23_109,23,23).
route(bus_23_11,23,23).
route(bus_23_110,23,23).
route(bus_23_111,23,23).
route(bus_23_112,23,23).
route(bus_23_113,23,23).
route(bus_23_114,23,23).
route(bus_23_115,23,23).
route(bus_23_116,23,23).
route(bus_23_117,23,23).
route(bus_23_118,23,23).
route(bus_23_119,23,23).
route(bus_23_12,23,23).
route(bus_23_120,23,23).
route(bus_23_121,23,23).
route(bus_23_122,23,23).
route(bus_23_123,23,23).
route(bus_23_124,23,23).
route(bus_23_125,23,23).
route(bus_23_126,23,23).
route(bus_23_127,23,23).
route(bus_23_128,23,23).
route(bus_23_129,23,23).
route(bus_23_13,23,23).
route(bus_23_130,23,23).
route(bus_23_131,23,23).
route(bus_23_132,23,23).
route(bus_23_133,23,23).
route(bus_23_134,23,23).
route(bus_23_135,23,23).
route(bus_23_136,23,23).
route(bus_23_137,23,23).
route(bus_23_138,23,23).
route(bus_23_139,23,23).
route(bus_23_14,23,23).
route(bus_23_140,23,23).
route(bus_23_141,23,23).
route(bus_23_142,23,23).
route(bus_23_143,23,23).
route(bus_23_145,23,23).
route(bus_23_147,23,23).
route(bus_23_15,23,23).
route(bus_23_16,23,23).
route(bus_23_17,23,23).
route(bus_23_18,23,23).
route(bus_23_19,23,23).
route(bus_23_2,23,23).
route(bus_23_20,23,23).
route(bus_23_21,23,23).
route(bus_23_22,23,23).
route(bus_23_23,23,23).
route(bus_23_24,23,23).
route(bus_23_25,23,23).
route(bus_23_26,23,23).
route(bus_23_27,23,23).
route(bus_23_28,23,23).
route(bus_23_29,23,23).
route(bus_23_3,23,23).
route(bus_23_30,23,23).
route(bus_23_31,23,23).
route(bus_23_32,23,23).
route(bus_23_33,23,23).
route(bus_23_34,23,23).
route(bus_23_35,23,23).
route(bus_23_36,23,23).
route(bus_23_37,23,23).
route(bus_23_38,23,23).
route(bus_23_39,23,23).
route(bus_23_4,23,23).
route(bus_23_40,23,23).
route(bus_23_41,23,23).
route(bus_23_42,23,23).
route(bus_23_43,23,23).
route(bus_23_44,23,23).
route(bus_23_45,23,23).
route(bus_23_46,23,23).
route(bus_23_47,23,23).
route(bus_23_48,23,23).
route(bus_23_49,23,23).
route(bus_23_5,23,23).
route(bus_23_50,23,23).
route(bus_23_51,23,23).
route(bus_23_52,23,23).
route(bus_23_53,23,23).
route(bus_23_54,23,23).
route(bus_23_55,23,23).
route(bus_23_56,23,23).
route(bus_23_57,23,23).
route(bus_23_58,23,23).
route(bus_23_59,23,23).
route(bus_23_6,23,23).
route(bus_23_60,23,23).
route(bus_23_6001,23,23).
route(bus_23_6002,23,23).
route(bus_23_6003,23,23).
route(bus_23_6004,23,23).
route(bus_23_6005,23,23).
route(bus_23_6006,23,23).
route(bus_23_6007,23,23).
route(bus_23_6008,23,23).
route(bus_23_6009,23,23).
route(bus_23_6010,23,23).
route(bus_23_6011,23,23).
route(bus_23_6012,23,23).
route(bus_23_6013,23,23).
route(bus_23_6014,23,23).
route(bus_23_6015,23,23).
route(bus_23_6016,23,23).
route(bus_23_6017,23,23).
route(bus_23_6018,23,23).
route(bus_23_6019,23,23).
route(bus_23_6020,23,23).
route(bus_23_6021,23,23).
route(bus_23_6022,23,23).
route(bus_23_6023,23,23).
route(bus_23_6024,23,23).
route(bus_23_6025,23,23).
route(bus_23_6026,23,23).
route(bus_23_6027,23,23).
route(bus_23_6028,23,23).
route(bus_23_6029,23,23).
route(bus_23_6030,23,23).
route(bus_23_6031,23,23).
route(bus_23_6032,23,23).
route(bus_23_6033,23,23).
route(bus_23_6034,23,23).
route(bus_23_6035,23,23).
route(bus_23_6036,23,23).
route(bus_23_6037,23,23).
route(bus_23_6038,23,23).
route(bus_23_6039,23,23).
route(bus_23_6040,23,23).
route(bus_23_6041,23,23).
route(bus_23_6042,23,23).
route(bus_23_6043,23,23).
route(bus_23_6044,23,23).
route(bus_23_6045,23,23).
route(bus_23_6046,23,23).
route(bus_23_6047,23,23).
route(bus_23_6048,23,23).
route(bus_23_6049,23,23).
route(bus_23_6050,23,23).
route(bus_23_6051,23,23).
route(bus_23_6052,23,23).
route(bus_23_6053,23,23).
route(bus_23_6054,23,23).
route(bus_23_6055,23,23).
route(bus_23_6056,23,23).
route(bus_23_6057,23,23).
route(bus_23_6058,23,23).
route(bus_23_6059,23,23).
route(bus_23_6060,23,23).
route(bus_23_6061,23,23).
route(bus_23_6062,23,23).
route(bus_23_6063,23,23).
route(bus_23_6064,23,23).
route(bus_23_6065,23,23).
route(bus_23_6066,23,23).
route(bus_23_6067,23,23).
route(bus_23_6068,23,23).
route(bus_23_6069,23,23).
route(bus_23_6070,23,23).
route(bus_23_6071,23,23).
route(bus_23_6072,23,23).
route(bus_23_6073,23,23).
route(bus_23_6074,23,23).
route(bus_23_6075,23,23).
route(bus_23_6076,23,23).
route(bus_23_6077,23,23).
route(bus_23_6078,23,23).
route(bus_23_6079,23,23).
route(bus_23_6080,23,23).
route(bus_23_6081,23,23).
route(bus_23_6082,23,23).
route(bus_23_6083,23,23).
route(bus_23_6084,23,23).
route(bus_23_6085,23,23).
route(bus_23_6086,23,23).
route(bus_23_6087,23,23).
route(bus_23_6088,23,23).
route(bus_23_6089,23,23).
route(bus_23_6090,23,23).
route(bus_23_6091,23,23).
route(bus_23_6092,23,23).
route(bus_23_6093,23,23).
route(bus_23_6094,23,23).
route(bus_23_6095,23,23).
route(bus_23_6096,23,23).
route(bus_23_6097,23,23).
route(bus_23_6098,23,23).
route(bus_23_6099,23,23).
route(bus_23_61,23,23).
route(bus_23_6100,23,23).
route(bus_23_6101,23,23).
route(bus_23_6102,23,23).
route(bus_23_6103,23,23).
route(bus_23_6104,23,23).
route(bus_23_6105,23,23).
route(bus_23_6106,23,23).
route(bus_23_6107,23,23).
route(bus_23_6108,23,23).
route(bus_23_6110,23,23).
route(bus_23_62,23,23).
route(bus_23_63,23,23).
route(bus_23_64,23,23).
route(bus_23_65,23,23).
route(bus_23_66,23,23).
route(bus_23_67,23,23).
route(bus_23_68,23,23).
route(bus_23_69,23,23).
route(bus_23_7,23,23).
route(bus_23_70,23,23).
route(bus_23_7001,23,23).
route(bus_23_7002,23,23).
route(bus_23_7003,23,23).
route(bus_23_7004,23,23).
route(bus_23_7005,23,23).
route(bus_23_7006,23,23).
route(bus_23_7007,23,23).
route(bus_23_7008,23,23).
route(bus_23_7009,23,23).
route(bus_23_7010,23,23).
route(bus_23_7011,23,23).
route(bus_23_7012,23,23).
route(bus_23_7013,23,23).
route(bus_23_7014,23,23).
route(bus_23_7015,23,23).
route(bus_23_7016,23,23).
route(bus_23_7017,23,23).
route(bus_23_7018,23,23).
route(bus_23_7019,23,23).
route(bus_23_7020,23,23).
route(bus_23_7021,23,23).
route(bus_23_7022,23,23).
route(bus_23_7023,23,23).
route(bus_23_7024,23,23).
route(bus_23_7025,23,23).
route(bus_23_7026,23,23).
route(bus_23_7027,23,23).
route(bus_23_7028,23,23).
route(bus_23_7029,23,23).
route(bus_23_7030,23,23).
route(bus_23_7031,23,23).
route(bus_23_7032,23,23).
route(bus_23_7033,23,23).
route(bus_23_7034,23,23).
route(bus_23_7035,23,23).
route(bus_23_7036,23,23).
route(bus_23_7037,23,23).
route(bus_23_7038,23,23).
route(bus_23_7039,23,23).
route(bus_23_7040,23,23).
route(bus_23_7041,23,23).
route(bus_23_7042,23,23).
route(bus_23_7043,23,23).
route(bus_23_7044,23,23).
route(bus_23_7045,23,23).
route(bus_23_7046,23,23).
route(bus_23_7047,23,23).
route(bus_23_7048,23,23).
route(bus_23_7049,23,23).
route(bus_23_7050,23,23).
route(bus_23_7051,23,23).
route(bus_23_7052,23,23).
route(bus_23_7053,23,23).
route(bus_23_7054,23,23).
route(bus_23_7055,23,23).
route(bus_23_7056,23,23).
route(bus_23_7057,23,23).
route(bus_23_7058,23,23).
route(bus_23_7059,23,23).
route(bus_23_7060,23,23).
route(bus_23_7061,23,23).
route(bus_23_7062,23,23).
route(bus_23_7063,23,23).
route(bus_23_7064,23,23).
route(bus_23_7065,23,23).
route(bus_23_7066,23,23).
route(bus_23_7067,23,23).
route(bus_23_7068,23,23).
route(bus_23_7069,23,23).
route(bus_23_7070,23,23).
route(bus_23_7071,23,23).
route(bus_23_7072,23,23).
route(bus_23_7073,23,23).
route(bus_23_7074,23,23).
route(bus_23_7075,23,23).
route(bus_23_7076,23,23).
route(bus_23_7077,23,23).
route(bus_23_7078,23,23).
route(bus_23_7079,23,23).
route(bus_23_7080,23,23).
route(bus_23_7081,23,23).
route(bus_23_7082,23,23).
route(bus_23_7083,23,23).
route(bus_23_7084,23,23).
route(bus_23_7085,23,23).
route(bus_23_7086,23,23).
route(bus_23_7087,23,23).
route(bus_23_7088,23,23).
route(bus_23_7089,23,23).
route(bus_23_7090,23,23).
route(bus_23_71,23,23).
route(bus_23_72,23,23).
route(bus_23_73,23,23).
route(bus_23_74,23,23).
route(bus_23_75,23,23).
route(bus_23_76,23,23).
route(bus_23_77,23,23).
route(bus_23_78,23,23).
route(bus_23_79,23,23).
route(bus_23_8,23,23).
route(bus_23_80,23,23).
route(bus_23_81,23,23).
route(bus_23_82,23,23).
route(bus_23_83,23,23).
route(bus_23_84,23,23).
route(bus_23_85,23,23).
route(bus_23_86,23,23).
route(bus_23_87,23,23).
route(bus_23_88,23,23).
route(bus_23_89,23,23).
route(bus_23_9,23,23).
route(bus_23_90,23,23).
route(bus_23_91,23,23).
route(bus_23_92,23,23).
route(bus_23_93,23,23).
route(bus_23_94,23,23).
route(bus_23_95,23,23).
route(bus_23_96,23,23).
route(bus_23_97,23,23).
route(bus_23_98,23,23).
route(bus_23_99,23,23).
route(bus_24_1,24,24).
route(bus_24_10,24,24).
route(bus_24_100,24,24).
route(bus_24_101,24,24).
route(bus_24_102,24,24).
route(bus_24_103,24,24).
route(bus_24_104,24,24).
route(bus_24_105,24,24).
route(bus_24_106,24,24).
route(bus_24_107,24,24).
route(bus_24_108,24,24).
route(bus_24_109,24,24).
route(bus_24_11,24,24).
route(bus_24_110,24,24).
route(bus_24_111,24,24).
route(bus_24_112,24,24).
route(bus_24_113,24,24).
route(bus_24_114,24,24).
route(bus_24_115,24,24).
route(bus_24_116,24,24).
route(bus_24_117,24,24).
route(bus_24_118,24,24).
route(bus_24_119,24,24).
route(bus_24_12,24,24).
route(bus_24_120,24,24).
route(bus_24_121,24,24).
route(bus_24_122,24,24).
route(bus_24_123,24,24).
route(bus_24_124,24,24).
route(bus_24_125,24,24).
route(bus_24_126,24,24).
route(bus_24_127,24,24).
route(bus_24_128,24,24).
route(bus_24_129,24,24).
route(bus_24_13,24,24).
route(bus_24_130,24,24).
route(bus_24_131,24,24).
route(bus_24_132,24,24).
route(bus_24_133,24,24).
route(bus_24_134,24,24).
route(bus_24_135,24,24).
route(bus_24_136,24,24).
route(bus_24_137,24,24).
route(bus_24_138,24,24).
route(bus_24_139,24,24).
route(bus_24_14,24,24).
route(bus_24_140,24,24).
route(bus_24_142,24,24).
route(bus_24_15,24,24).
route(bus_24_16,24,24).
route(bus_24_17,24,24).
route(bus_24_18,24,24).
route(bus_24_19,24,24).
route(bus_24_2,24,24).
route(bus_24_20,24,24).
route(bus_24_21,24,24).
route(bus_24_22,24,24).
route(bus_24_23,24,24).
route(bus_24_24,24,24).
route(bus_24_25,24,24).
route(bus_24_26,24,24).
route(bus_24_27,24,24).
route(bus_24_28,24,24).
route(bus_24_29,24,24).
route(bus_24_3,24,24).
route(bus_24_30,24,24).
route(bus_24_31,24,24).
route(bus_24_32,24,24).
route(bus_24_33,24,24).
route(bus_24_34,24,24).
route(bus_24_35,24,24).
route(bus_24_36,24,24).
route(bus_24_37,24,24).
route(bus_24_38,24,24).
route(bus_24_39,24,24).
route(bus_24_4,24,24).
route(bus_24_40,24,24).
route(bus_24_41,24,24).
route(bus_24_42,24,24).
route(bus_24_43,24,24).
route(bus_24_44,24,24).
route(bus_24_45,24,24).
route(bus_24_46,24,24).
route(bus_24_47,24,24).
route(bus_24_48,24,24).
route(bus_24_49,24,24).
route(bus_24_5,24,24).
route(bus_24_50,24,24).
route(bus_24_51,24,24).
route(bus_24_52,24,24).
route(bus_24_53,24,24).
route(bus_24_54,24,24).
route(bus_24_55,24,24).
route(bus_24_56,24,24).
route(bus_24_57,24,24).
route(bus_24_58,24,24).
route(bus_24_59,24,24).
route(bus_24_6,24,24).
route(bus_24_60,24,24).
route(bus_24_6001,24,24).
route(bus_24_6002,24,24).
route(bus_24_6003,24,24).
route(bus_24_6004,24,24).
route(bus_24_6005,24,24).
route(bus_24_6006,24,24).
route(bus_24_6007,24,24).
route(bus_24_6008,24,24).
route(bus_24_6009,24,24).
route(bus_24_6010,24,24).
route(bus_24_6011,24,24).
route(bus_24_6012,24,24).
route(bus_24_6013,24,24).
route(bus_24_6014,24,24).
route(bus_24_6015,24,24).
route(bus_24_6016,24,24).
route(bus_24_6017,24,24).
route(bus_24_6018,24,24).
route(bus_24_6019,24,24).
route(bus_24_6020,24,24).
route(bus_24_6021,24,24).
route(bus_24_6022,24,24).
route(bus_24_6023,24,24).
route(bus_24_6024,24,24).
route(bus_24_6025,24,24).
route(bus_24_6026,24,24).
route(bus_24_6027,24,24).
route(bus_24_6028,24,24).
route(bus_24_6029,24,24).
route(bus_24_6030,24,24).
route(bus_24_6031,24,24).
route(bus_24_6032,24,24).
route(bus_24_6033,24,24).
route(bus_24_6034,24,24).
route(bus_24_6035,24,24).
route(bus_24_6036,24,24).
route(bus_24_6037,24,24).
route(bus_24_6038,24,24).
route(bus_24_6039,24,24).
route(bus_24_6040,24,24).
route(bus_24_6041,24,24).
route(bus_24_6042,24,24).
route(bus_24_6043,24,24).
route(bus_24_6044,24,24).
route(bus_24_6045,24,24).
route(bus_24_6046,24,24).
route(bus_24_6047,24,24).
route(bus_24_6048,24,24).
route(bus_24_6049,24,24).
route(bus_24_6050,24,24).
route(bus_24_6051,24,24).
route(bus_24_6052,24,24).
route(bus_24_6053,24,24).
route(bus_24_6054,24,24).
route(bus_24_6055,24,24).
route(bus_24_6056,24,24).
route(bus_24_6057,24,24).
route(bus_24_6058,24,24).
route(bus_24_6059,24,24).
route(bus_24_6060,24,24).
route(bus_24_6061,24,24).
route(bus_24_6062,24,24).
route(bus_24_6063,24,24).
route(bus_24_6064,24,24).
route(bus_24_6065,24,24).
route(bus_24_6066,24,24).
route(bus_24_6067,24,24).
route(bus_24_6068,24,24).
route(bus_24_6069,24,24).
route(bus_24_6070,24,24).
route(bus_24_6071,24,24).
route(bus_24_6072,24,24).
route(bus_24_6073,24,24).
route(bus_24_6074,24,24).
route(bus_24_6075,24,24).
route(bus_24_6076,24,24).
route(bus_24_6077,24,24).
route(bus_24_6078,24,24).
route(bus_24_6079,24,24).
route(bus_24_6080,24,24).
route(bus_24_6081,24,24).
route(bus_24_6082,24,24).
route(bus_24_6083,24,24).
route(bus_24_6084,24,24).
route(bus_24_6085,24,24).
route(bus_24_6086,24,24).
route(bus_24_6087,24,24).
route(bus_24_6088,24,24).
route(bus_24_6089,24,24).
route(bus_24_6090,24,24).
route(bus_24_6091,24,24).
route(bus_24_6092,24,24).
route(bus_24_6093,24,24).
route(bus_24_6094,24,24).
route(bus_24_6095,24,24).
route(bus_24_6096,24,24).
route(bus_24_6097,24,24).
route(bus_24_6098,24,24).
route(bus_24_6099,24,24).
route(bus_24_61,24,24).
route(bus_24_6100,24,24).
route(bus_24_6101,24,24).
route(bus_24_6102,24,24).
route(bus_24_6103,24,24).
route(bus_24_6104,24,24).
route(bus_24_6106,24,24).
route(bus_24_6108,24,24).
route(bus_24_62,24,24).
route(bus_24_63,24,24).
route(bus_24_64,24,24).
route(bus_24_65,24,24).
route(bus_24_66,24,24).
route(bus_24_67,24,24).
route(bus_24_68,24,24).
route(bus_24_69,24,24).
route(bus_24_7,24,24).
route(bus_24_70,24,24).
route(bus_24_7001,24,24).
route(bus_24_7002,24,24).
route(bus_24_7003,24,24).
route(bus_24_7004,24,24).
route(bus_24_7005,24,24).
route(bus_24_7006,24,24).
route(bus_24_7007,24,24).
route(bus_24_7008,24,24).
route(bus_24_7009,24,24).
route(bus_24_7010,24,24).
route(bus_24_7011,24,24).
route(bus_24_7012,24,24).
route(bus_24_7013,24,24).
route(bus_24_7014,24,24).
route(bus_24_7015,24,24).
route(bus_24_7016,24,24).
route(bus_24_7017,24,24).
route(bus_24_7018,24,24).
route(bus_24_7019,24,24).
route(bus_24_7020,24,24).
route(bus_24_7021,24,24).
route(bus_24_7022,24,24).
route(bus_24_7023,24,24).
route(bus_24_7024,24,24).
route(bus_24_7025,24,24).
route(bus_24_7026,24,24).
route(bus_24_7027,24,24).
route(bus_24_7028,24,24).
route(bus_24_7029,24,24).
route(bus_24_7030,24,24).
route(bus_24_7031,24,24).
route(bus_24_7032,24,24).
route(bus_24_7033,24,24).
route(bus_24_7034,24,24).
route(bus_24_7035,24,24).
route(bus_24_7036,24,24).
route(bus_24_7037,24,24).
route(bus_24_7038,24,24).
route(bus_24_7039,24,24).
route(bus_24_7040,24,24).
route(bus_24_7041,24,24).
route(bus_24_7042,24,24).
route(bus_24_7043,24,24).
route(bus_24_7044,24,24).
route(bus_24_7045,24,24).
route(bus_24_7046,24,24).
route(bus_24_7047,24,24).
route(bus_24_7048,24,24).
route(bus_24_7049,24,24).
route(bus_24_7050,24,24).
route(bus_24_7051,24,24).
route(bus_24_7052,24,24).
route(bus_24_7053,24,24).
route(bus_24_7054,24,24).
route(bus_24_7055,24,24).
route(bus_24_7056,24,24).
route(bus_24_7057,24,24).
route(bus_24_7058,24,24).
route(bus_24_7059,24,24).
route(bus_24_7060,24,24).
route(bus_24_7061,24,24).
route(bus_24_7062,24,24).
route(bus_24_7063,24,24).
route(bus_24_7064,24,24).
route(bus_24_7065,24,24).
route(bus_24_7066,24,24).
route(bus_24_7067,24,24).
route(bus_24_7068,24,24).
route(bus_24_7069,24,24).
route(bus_24_7070,24,24).
route(bus_24_7071,24,24).
route(bus_24_7072,24,24).
route(bus_24_7073,24,24).
route(bus_24_7074,24,24).
route(bus_24_7075,24,24).
route(bus_24_7076,24,24).
route(bus_24_7077,24,24).
route(bus_24_7078,24,24).
route(bus_24_7079,24,24).
route(bus_24_7080,24,24).
route(bus_24_7081,24,24).
route(bus_24_7082,24,24).
route(bus_24_7083,24,24).
route(bus_24_7084,24,24).
route(bus_24_7085,24,24).
route(bus_24_7086,24,24).
route(bus_24_7087,24,24).
route(bus_24_7088,24,24).
route(bus_24_7089,24,24).
route(bus_24_7090,24,24).
route(bus_24_7092,24,24).
route(bus_24_71,24,24).
route(bus_24_72,24,24).
route(bus_24_73,24,24).
route(bus_24_74,24,24).
route(bus_24_75,24,24).
route(bus_24_76,24,24).
route(bus_24_77,24,24).
route(bus_24_78,24,24).
route(bus_24_79,24,24).
route(bus_24_8,24,24).
route(bus_24_80,24,24).
route(bus_24_81,24,24).
route(bus_24_82,24,24).
route(bus_24_83,24,24).
route(bus_24_84,24,24).
route(bus_24_85,24,24).
route(bus_24_86,24,24).
route(bus_24_87,24,24).
route(bus_24_88,24,24).
route(bus_24_89,24,24).
route(bus_24_9,24,24).
route(bus_24_90,24,24).
route(bus_24_91,24,24).
route(bus_24_92,24,24).
route(bus_24_93,24,24).
route(bus_24_94,24,24).
route(bus_24_95,24,24).
route(bus_24_96,24,24).
route(bus_24_97,24,24).
route(bus_24_98,24,24).
route(bus_24_99,24,24).
route(bus_25_1,25,25).
route(bus_25_10,25,25).
route(bus_25_100,25,25).
route(bus_25_101,25,25).
route(bus_25_102,25,25).
route(bus_25_103,25,25).
route(bus_25_104,25,25).
route(bus_25_105,25,25).
route(bus_25_106,25,25).
route(bus_25_107,25,25).
route(bus_25_108,25,25).
route(bus_25_109,25,25).
route(bus_25_11,25,25).
route(bus_25_110,25,25).
route(bus_25_111,25,25).
route(bus_25_112,25,25).
route(bus_25_113,25,25).
route(bus_25_114,25,25).
route(bus_25_115,25,25).
route(bus_25_116,25,25).
route(bus_25_117,25,25).
route(bus_25_118,25,25).
route(bus_25_119,25,25).
route(bus_25_12,25,25).
route(bus_25_120,25,25).
route(bus_25_121,25,25).
route(bus_25_122,25,25).
route(bus_25_123,25,25).
route(bus_25_124,25,25).
route(bus_25_125,25,25).
route(bus_25_126,25,25).
route(bus_25_127,25,25).
route(bus_25_128,25,25).
route(bus_25_129,25,25).
route(bus_25_13,25,25).
route(bus_25_130,25,25).
route(bus_25_131,25,25).
route(bus_25_132,25,25).
route(bus_25_133,25,25).
route(bus_25_134,25,25).
route(bus_25_135,25,25).
route(bus_25_136,25,25).
route(bus_25_137,25,25).
route(bus_25_138,25,25).
route(bus_25_139,25,25).
route(bus_25_14,25,25).
route(bus_25_140,25,25).
route(bus_25_141,25,25).
route(bus_25_142,25,25).
route(bus_25_143,25,25).
route(bus_25_144,25,25).
route(bus_25_145,25,25).
route(bus_25_146,25,25).
route(bus_25_147,25,25).
route(bus_25_148,25,25).
route(bus_25_149,25,25).
route(bus_25_15,25,25).
route(bus_25_150,25,25).
route(bus_25_151,25,25).
route(bus_25_152,25,25).
route(bus_25_153,25,25).
route(bus_25_154,25,25).
route(bus_25_155,25,25).
route(bus_25_156,25,25).
route(bus_25_157,25,25).
route(bus_25_158,25,25).
route(bus_25_159,25,25).
route(bus_25_16,25,25).
route(bus_25_160,25,25).
route(bus_25_161,25,25).
route(bus_25_162,25,25).
route(bus_25_163,25,25).
route(bus_25_164,25,25).
route(bus_25_165,25,25).
route(bus_25_166,25,25).
route(bus_25_167,25,25).
route(bus_25_168,25,25).
route(bus_25_169,25,25).
route(bus_25_17,25,25).
route(bus_25_170,25,25).
route(bus_25_171,25,25).
route(bus_25_172,25,25).
route(bus_25_173,25,25).
route(bus_25_174,25,25).
route(bus_25_175,25,25).
route(bus_25_176,25,25).
route(bus_25_177,25,25).
route(bus_25_178,25,25).
route(bus_25_179,25,25).
route(bus_25_18,25,25).
route(bus_25_180,25,25).
route(bus_25_181,25,25).
route(bus_25_182,25,25).
route(bus_25_183,25,25).
route(bus_25_184,25,25).
route(bus_25_185,25,25).
route(bus_25_186,25,25).
route(bus_25_187,25,25).
route(bus_25_188,25,25).
route(bus_25_189,25,25).
route(bus_25_19,25,25).
route(bus_25_190,25,25).
route(bus_25_192,25,25).
route(bus_25_194,25,25).
route(bus_25_2,25,25).
route(bus_25_20,25,25).
route(bus_25_21,25,25).
route(bus_25_22,25,25).
route(bus_25_23,25,25).
route(bus_25_232253,25,25).
route(bus_25_232254,25,25).
route(bus_25_232255,25,25).
route(bus_25_232256,25,25).
route(bus_25_232257,25,25).
route(bus_25_232258,25,25).
route(bus_25_232259,25,25).
route(bus_25_232260,25,25).
route(bus_25_232261,25,25).
route(bus_25_232262,25,25).
route(bus_25_232263,25,25).
route(bus_25_232264,25,25).
route(bus_25_232265,25,25).
route(bus_25_232266,25,25).
route(bus_25_232267,25,25).
route(bus_25_232268,25,25).
route(bus_25_2322682,25,25).
route(bus_25_2322683,25,25).
route(bus_25_2322684,25,25).
route(bus_25_2322685,25,25).
route(bus_25_2322686,25,25).
route(bus_25_2322687,25,25).
route(bus_25_2322688,25,25).
route(bus_25_2322689,25,25).
route(bus_25_232269,25,25).
route(bus_25_2322690,25,25).
route(bus_25_2322691,25,25).
route(bus_25_2322692,25,25).
route(bus_25_2322693,25,25).
route(bus_25_2322694,25,25).
route(bus_25_2322695,25,25).
route(bus_25_2322696,25,25).
route(bus_25_2322697,25,25).
route(bus_25_2322698,25,25).
route(bus_25_2322699,25,25).
route(bus_25_232270,25,25).
route(bus_25_2322700,25,25).
route(bus_25_2322701,25,25).
route(bus_25_2322702,25,25).
route(bus_25_2322703,25,25).
route(bus_25_2322704,25,25).
route(bus_25_2322705,25,25).
route(bus_25_2322706,25,25).
route(bus_25_2322707,25,25).
route(bus_25_2322708,25,25).
route(bus_25_2322709,25,25).
route(bus_25_232271,25,25).
route(bus_25_2322710,25,25).
route(bus_25_2322711,25,25).
route(bus_25_2322712,25,25).
route(bus_25_2322713,25,25).
route(bus_25_2322714,25,25).
route(bus_25_2322715,25,25).
route(bus_25_232272,25,25).
route(bus_25_232273,25,25).
route(bus_25_232274,25,25).
route(bus_25_232275,25,25).
route(bus_25_232276,25,25).
route(bus_25_232277,25,25).
route(bus_25_232278,25,25).
route(bus_25_232279,25,25).
route(bus_25_232280,25,25).
route(bus_25_232281,25,25).
route(bus_25_232282,25,25).
route(bus_25_232283,25,25).
route(bus_25_232284,25,25).
route(bus_25_232285,25,25).
route(bus_25_232286,25,25).
route(bus_25_24,25,25).
route(bus_25_25,25,25).
route(bus_25_26,25,25).
route(bus_25_27,25,25).
route(bus_25_28,25,25).
route(bus_25_29,25,25).
route(bus_25_3,25,25).
route(bus_25_30,25,25).
route(bus_25_31,25,25).
route(bus_25_32,25,25).
route(bus_25_33,25,25).
route(bus_25_34,25,25).
route(bus_25_35,25,25).
route(bus_25_36,25,25).
route(bus_25_37,25,25).
route(bus_25_38,25,25).
route(bus_25_39,25,25).
route(bus_25_4,25,25).
route(bus_25_40,25,25).
route(bus_25_41,25,25).
route(bus_25_42,25,25).
route(bus_25_43,25,25).
route(bus_25_44,25,25).
route(bus_25_45,25,25).
route(bus_25_46,25,25).
route(bus_25_47,25,25).
route(bus_25_48,25,25).
route(bus_25_49,25,25).
route(bus_25_5,25,25).
route(bus_25_50,25,25).
route(bus_25_51,25,25).
route(bus_25_52,25,25).
route(bus_25_53,25,25).
route(bus_25_54,25,25).
route(bus_25_55,25,25).
route(bus_25_56,25,25).
route(bus_25_57,25,25).
route(bus_25_58,25,25).
route(bus_25_59,25,25).
route(bus_25_6,25,25).
route(bus_25_60,25,25).
route(bus_25_6001,25,25).
route(bus_25_6002,25,25).
route(bus_25_6003,25,25).
route(bus_25_6004,25,25).
route(bus_25_6005,25,25).
route(bus_25_6006,25,25).
route(bus_25_6007,25,25).
route(bus_25_6008,25,25).
route(bus_25_6009,25,25).
route(bus_25_6010,25,25).
route(bus_25_6011,25,25).
route(bus_25_6012,25,25).
route(bus_25_6013,25,25).
route(bus_25_6014,25,25).
route(bus_25_6015,25,25).
route(bus_25_6016,25,25).
route(bus_25_6017,25,25).
route(bus_25_6018,25,25).
route(bus_25_6019,25,25).
route(bus_25_6020,25,25).
route(bus_25_6021,25,25).
route(bus_25_6022,25,25).
route(bus_25_6023,25,25).
route(bus_25_6024,25,25).
route(bus_25_6025,25,25).
route(bus_25_6026,25,25).
route(bus_25_6027,25,25).
route(bus_25_6028,25,25).
route(bus_25_6029,25,25).
route(bus_25_6030,25,25).
route(bus_25_6031,25,25).
route(bus_25_6032,25,25).
route(bus_25_6033,25,25).
route(bus_25_6034,25,25).
route(bus_25_6035,25,25).
route(bus_25_6036,25,25).
route(bus_25_6037,25,25).
route(bus_25_6038,25,25).
route(bus_25_6039,25,25).
route(bus_25_6040,25,25).
route(bus_25_6041,25,25).
route(bus_25_6042,25,25).
route(bus_25_6043,25,25).
route(bus_25_6044,25,25).
route(bus_25_6045,25,25).
route(bus_25_6046,25,25).
route(bus_25_6047,25,25).
route(bus_25_6048,25,25).
route(bus_25_6049,25,25).
route(bus_25_6050,25,25).
route(bus_25_6051,25,25).
route(bus_25_6052,25,25).
route(bus_25_6053,25,25).
route(bus_25_6054,25,25).
route(bus_25_6055,25,25).
route(bus_25_6056,25,25).
route(bus_25_6057,25,25).
route(bus_25_6058,25,25).
route(bus_25_6059,25,25).
route(bus_25_6060,25,25).
route(bus_25_6061,25,25).
route(bus_25_6062,25,25).
route(bus_25_6063,25,25).
route(bus_25_6064,25,25).
route(bus_25_6065,25,25).
route(bus_25_6066,25,25).
route(bus_25_6067,25,25).
route(bus_25_6068,25,25).
route(bus_25_6069,25,25).
route(bus_25_6070,25,25).
route(bus_25_6071,25,25).
route(bus_25_6072,25,25).
route(bus_25_6073,25,25).
route(bus_25_6074,25,25).
route(bus_25_6075,25,25).
route(bus_25_6076,25,25).
route(bus_25_6077,25,25).
route(bus_25_6078,25,25).
route(bus_25_6079,25,25).
route(bus_25_6080,25,25).
route(bus_25_6081,25,25).
route(bus_25_6082,25,25).
route(bus_25_6083,25,25).
route(bus_25_6084,25,25).
route(bus_25_6085,25,25).
route(bus_25_6086,25,25).
route(bus_25_6087,25,25).
route(bus_25_6088,25,25).
route(bus_25_6089,25,25).
route(bus_25_6090,25,25).
route(bus_25_6091,25,25).
route(bus_25_6092,25,25).
route(bus_25_6093,25,25).
route(bus_25_6094,25,25).
route(bus_25_6095,25,25).
route(bus_25_6096,25,25).
route(bus_25_6097,25,25).
route(bus_25_6098,25,25).
route(bus_25_6099,25,25).
route(bus_25_61,25,25).
route(bus_25_6100,25,25).
route(bus_25_6101,25,25).
route(bus_25_6102,25,25).
route(bus_25_6103,25,25).
route(bus_25_6104,25,25).
route(bus_25_6105,25,25).
route(bus_25_6106,25,25).
route(bus_25_6108,25,25).
route(bus_25_6110,25,25).
route(bus_25_6112,25,25).
route(bus_25_62,25,25).
route(bus_25_63,25,25).
route(bus_25_64,25,25).
route(bus_25_65,25,25).
route(bus_25_66,25,25).
route(bus_25_67,25,25).
route(bus_25_68,25,25).
route(bus_25_69,25,25).
route(bus_25_7,25,25).
route(bus_25_70,25,25).
route(bus_25_7001,25,25).
route(bus_25_7002,25,25).
route(bus_25_7003,25,25).
route(bus_25_7004,25,25).
route(bus_25_7005,25,25).
route(bus_25_7006,25,25).
route(bus_25_7007,25,25).
route(bus_25_7008,25,25).
route(bus_25_7009,25,25).
route(bus_25_7010,25,25).
route(bus_25_7011,25,25).
route(bus_25_7012,25,25).
route(bus_25_7013,25,25).
route(bus_25_7014,25,25).
route(bus_25_7015,25,25).
route(bus_25_7016,25,25).
route(bus_25_7017,25,25).
route(bus_25_7018,25,25).
route(bus_25_7019,25,25).
route(bus_25_7020,25,25).
route(bus_25_7021,25,25).
route(bus_25_7022,25,25).
route(bus_25_7023,25,25).
route(bus_25_7024,25,25).
route(bus_25_7025,25,25).
route(bus_25_7026,25,25).
route(bus_25_7027,25,25).
route(bus_25_7028,25,25).
route(bus_25_7029,25,25).
route(bus_25_7030,25,25).
route(bus_25_7031,25,25).
route(bus_25_7032,25,25).
route(bus_25_7033,25,25).
route(bus_25_7034,25,25).
route(bus_25_7035,25,25).
route(bus_25_7036,25,25).
route(bus_25_7037,25,25).
route(bus_25_7038,25,25).
route(bus_25_7039,25,25).
route(bus_25_7040,25,25).
route(bus_25_7041,25,25).
route(bus_25_7042,25,25).
route(bus_25_7043,25,25).
route(bus_25_7044,25,25).
route(bus_25_7045,25,25).
route(bus_25_7046,25,25).
route(bus_25_7047,25,25).
route(bus_25_7048,25,25).
route(bus_25_7049,25,25).
route(bus_25_7050,25,25).
route(bus_25_7051,25,25).
route(bus_25_7052,25,25).
route(bus_25_7053,25,25).
route(bus_25_7054,25,25).
route(bus_25_7055,25,25).
route(bus_25_7056,25,25).
route(bus_25_7057,25,25).
route(bus_25_7058,25,25).
route(bus_25_7059,25,25).
route(bus_25_7060,25,25).
route(bus_25_7061,25,25).
route(bus_25_7062,25,25).
route(bus_25_7063,25,25).
route(bus_25_7064,25,25).
route(bus_25_7065,25,25).
route(bus_25_7066,25,25).
route(bus_25_7067,25,25).
route(bus_25_7068,25,25).
route(bus_25_7069,25,25).
route(bus_25_7070,25,25).
route(bus_25_7071,25,25).
route(bus_25_7072,25,25).
route(bus_25_7073,25,25).
route(bus_25_7074,25,25).
route(bus_25_7075,25,25).
route(bus_25_7076,25,25).
route(bus_25_7077,25,25).
route(bus_25_7078,25,25).
route(bus_25_7079,25,25).
route(bus_25_7080,25,25).
route(bus_25_7081,25,25).
route(bus_25_7082,25,25).
route(bus_25_7083,25,25).
route(bus_25_7084,25,25).
route(bus_25_7085,25,25).
route(bus_25_7086,25,25).
route(bus_25_7087,25,25).
route(bus_25_7088,25,25).
route(bus_25_7089,25,25).
route(bus_25_7090,25,25).
route(bus_25_7092,25,25).
route(bus_25_71,25,25).
route(bus_25_72,25,25).
route(bus_25_73,25,25).
route(bus_25_74,25,25).
route(bus_25_75,25,25).
route(bus_25_76,25,25).
route(bus_25_77,25,25).
route(bus_25_78,25,25).
route(bus_25_79,25,25).
route(bus_25_8,25,25).
route(bus_25_80,25,25).
route(bus_25_81,25,25).
route(bus_25_82,25,25).
route(bus_25_83,25,25).
route(bus_25_84,25,25).
route(bus_25_85,25,25).
route(bus_25_86,25,25).
route(bus_25_87,25,25).
route(bus_25_88,25,25).
route(bus_25_89,25,25).
route(bus_25_9,25,25).
route(bus_25_90,25,25).
route(bus_25_91,25,25).
route(bus_25_92,25,25).
route(bus_25_93,25,25).
route(bus_25_94,25,25).
route(bus_25_95,25,25).
route(bus_25_96,25,25).
route(bus_25_97,25,25).
route(bus_25_98,25,25).
route(bus_25_99,25,25).
route(bus_26_6001,26,26).
route(bus_26_6002,26,26).
route(bus_26_6003,26,26).
route(bus_26_6004,26,26).
route(bus_26_7001,26,26).
route(bus_26_7002,26,26).
route(bus_26_7003,26,26).
route(bus_26_7004,26,26).
route(bus_26_7005,26,26).
route(bus_26_7006,26,26).
route(bus_26_7007,26,26).
route(bus_26_7008,26,26).
route(bus_26_7009,26,26).
route(bus_26_7010,26,26).
route(bus_28_1,28,28).
route(bus_28_10,28,28).
route(bus_28_11,28,28).
route(bus_28_12,28,28).
route(bus_28_14,28,28).
route(bus_28_15,28,28).
route(bus_28_16,28,28).
route(bus_28_17,28,28).
route(bus_28_18,28,28).
route(bus_28_19,28,28).
route(bus_28_2,28,28).
route(bus_28_20,28,28).
route(bus_28_21,28,28).
route(bus_28_22,28,28).
route(bus_28_23,28,28).
route(bus_28_24,28,28).
route(bus_28_25,28,28).
route(bus_28_26,28,28).
route(bus_28_27,28,28).
route(bus_28_28,28,28).
route(bus_28_29,28,28).
route(bus_28_3,28,28).
route(bus_28_30,28,28).
route(bus_28_31,28,28).
route(bus_28_32,28,28).
route(bus_28_33,28,28).
route(bus_28_34,28,28).
route(bus_28_35,28,28).
route(bus_28_36,28,28).
route(bus_28_37,28,28).
route(bus_28_38,28,28).
route(bus_28_39,28,28).
route(bus_28_4,28,28).
route(bus_28_40,28,28).
route(bus_28_41,28,28).
route(bus_28_42,28,28).
route(bus_28_43,28,28).
route(bus_28_44,28,28).
route(bus_28_45,28,28).
route(bus_28_46,28,28).
route(bus_28_47,28,28).
route(bus_28_49,28,28).
route(bus_28_5,28,28).
route(bus_28_50,28,28).
route(bus_28_51,28,28).
route(bus_28_54,28,28).
route(bus_28_55,28,28).
route(bus_28_58,28,28).
route(bus_28_59,28,28).
route(bus_28_6,28,28).
route(bus_28_6001,28,28).
route(bus_28_6002,28,28).
route(bus_28_6003,28,28).
route(bus_28_6004,28,28).
route(bus_28_6005,28,28).
route(bus_28_6006,28,28).
route(bus_28_6007,28,28).
route(bus_28_6008,28,28).
route(bus_28_6009,28,28).
route(bus_28_6010,28,28).
route(bus_28_6011,28,28).
route(bus_28_6012,28,28).
route(bus_28_6013,28,28).
route(bus_28_6014,28,28).
route(bus_28_6015,28,28).
route(bus_28_6016,28,28).
route(bus_28_6017,28,28).
route(bus_28_6018,28,28).
route(bus_28_6019,28,28).
route(bus_28_6020,28,28).
route(bus_28_6021,28,28).
route(bus_28_6022,28,28).
route(bus_28_6023,28,28).
route(bus_28_6024,28,28).
route(bus_28_6025,28,28).
route(bus_28_6026,28,28).
route(bus_28_6027,28,28).
route(bus_28_6028,28,28).
route(bus_28_6029,28,28).
route(bus_28_6030,28,28).
route(bus_28_6031,28,28).
route(bus_28_6032,28,28).
route(bus_28_6033,28,28).
route(bus_28_6034,28,28).
route(bus_28_6035,28,28).
route(bus_28_6036,28,28).
route(bus_28_6037,28,28).
route(bus_28_6040,28,28).
route(bus_28_6041,28,28).
route(bus_28_6044,28,28).
route(bus_28_6045,28,28).
route(bus_28_6048,28,28).
route(bus_28_6049,28,28).
route(bus_28_6052,28,28).
route(bus_28_6053,28,28).
route(bus_28_6056,28,28).
route(bus_28_6057,28,28).
route(bus_28_6060,28,28).
route(bus_28_6061,28,28).
route(bus_28_6064,28,28).
route(bus_28_6065,28,28).
route(bus_28_6068,28,28).
route(bus_28_6069,28,28).
route(bus_28_6072,28,28).
route(bus_28_6073,28,28).
route(bus_28_62,28,28).
route(bus_28_63,28,28).
route(bus_28_66,28,28).
route(bus_28_67,28,28).
route(bus_28_7,28,28).
route(bus_28_70,28,28).
route(bus_28_7001,28,28).
route(bus_28_7002,28,28).
route(bus_28_7003,28,28).
route(bus_28_7004,28,28).
route(bus_28_7005,28,28).
route(bus_28_7006,28,28).
route(bus_28_7008,28,28).
route(bus_28_7009,28,28).
route(bus_28_7011,28,28).
route(bus_28_7012,28,28).
route(bus_28_7013,28,28).
route(bus_28_7014,28,28).
route(bus_28_7015,28,28).
route(bus_28_7016,28,28).
route(bus_28_7017,28,28).
route(bus_28_7020,28,28).
route(bus_28_7021,28,28).
route(bus_28_7022,28,28).
route(bus_28_7023,28,28).
route(bus_28_7024,28,28).
route(bus_28_7025,28,28).
route(bus_28_7026,28,28).
route(bus_28_7027,28,28).
route(bus_28_7028,28,28).
route(bus_28_7029,28,28).
route(bus_28_7032,28,28).
route(bus_28_7033,28,28).
route(bus_28_7036,28,28).
route(bus_28_7037,28,28).
route(bus_28_7040,28,28).
route(bus_28_7041,28,28).
route(bus_28_7044,28,28).
route(bus_28_7045,28,28).
route(bus_28_7048,28,28).
route(bus_28_7049,28,28).
route(bus_28_7052,28,28).
route(bus_28_7053,28,28).
route(bus_28_7056,28,28).
route(bus_28_7057,28,28).
route(bus_28_7060,28,28).
route(bus_28_7061,28,28).
route(bus_28_71,28,28).
route(bus_28_74,28,28).
route(bus_28_75,28,28).
route(bus_28_78,28,28).
route(bus_28_79,28,28).
route(bus_28_8,28,28).
route(bus_28_82,28,28).
route(bus_28_83,28,28).
route(bus_28_86,28,28).
route(bus_28_87,28,28).
route(bus_28_9,28,28).
route(bus_28_90,28,28).
route(bus_28_91,28,28).
route(bus_28_94,28,28).
route(bus_28_95,28,28).
route(bus_28_99,28,28).
route(bus_2_1,2,2).
route(bus_2_10,2,2).
route(bus_2_100,2,2).
route(bus_2_101,2,2).
route(bus_2_102,2,2).
route(bus_2_103,2,2).
route(bus_2_104,2,2).
route(bus_2_105,2,2).
route(bus_2_106,2,2).
route(bus_2_107,2,2).
route(bus_2_108,2,2).
route(bus_2_109,2,2).
route(bus_2_11,2,2).
route(bus_2_110,2,2).
route(bus_2_111,2,2).
route(bus_2_112,2,2).
route(bus_2_113,2,2).
route(bus_2_114,2,2).
route(bus_2_115,2,2).
route(bus_2_116,2,2).
route(bus_2_117,2,2).
route(bus_2_118,2,2).
route(bus_2_119,2,2).
route(bus_2_12,2,2).
route(bus_2_120,2,2).
route(bus_2_121,2,2).
route(bus_2_122,2,2).
route(bus_2_123,2,2).
route(bus_2_124,2,2).
route(bus_2_125,2,2).
route(bus_2_126,2,2).
route(bus_2_127,2,2).
route(bus_2_128,2,2).
route(bus_2_129,2,2).
route(bus_2_13,2,2).
route(bus_2_130,2,2).
route(bus_2_131,2,2).
route(bus_2_132,2,2).
route(bus_2_133,2,2).
route(bus_2_134,2,2).
route(bus_2_135,2,2).
route(bus_2_136,2,2).
route(bus_2_137,2,2).
route(bus_2_138,2,2).
route(bus_2_139,2,2).
route(bus_2_14,2,2).
route(bus_2_140,2,2).
route(bus_2_141,2,2).
route(bus_2_142,2,2).
route(bus_2_143,2,2).
route(bus_2_144,2,2).
route(bus_2_145,2,2).
route(bus_2_146,2,2).
route(bus_2_147,2,2).
route(bus_2_148,2,2).
route(bus_2_149,2,2).
route(bus_2_15,2,2).
route(bus_2_150,2,2).
route(bus_2_151,2,2).
route(bus_2_152,2,2).
route(bus_2_153,2,2).
route(bus_2_154,2,2).
route(bus_2_155,2,2).
route(bus_2_156,2,2).
route(bus_2_157,2,2).
route(bus_2_158,2,2).
route(bus_2_159,2,2).
route(bus_2_16,2,2).
route(bus_2_160,2,2).
route(bus_2_161,2,2).
route(bus_2_162,2,2).
route(bus_2_163,2,2).
route(bus_2_164,2,2).
route(bus_2_165,2,2).
route(bus_2_166,2,2).
route(bus_2_167,2,2).
route(bus_2_168,2,2).
route(bus_2_169,2,2).
route(bus_2_17,2,2).
route(bus_2_170,2,2).
route(bus_2_171,2,2).
route(bus_2_172,2,2).
route(bus_2_173,2,2).
route(bus_2_174,2,2).
route(bus_2_175,2,2).
route(bus_2_176,2,2).
route(bus_2_177,2,2).
route(bus_2_178,2,2).
route(bus_2_179,2,2).
route(bus_2_18,2,2).
route(bus_2_180,2,2).
route(bus_2_181,2,2).
route(bus_2_182,2,2).
route(bus_2_183,2,2).
route(bus_2_184,2,2).
route(bus_2_185,2,2).
route(bus_2_186,2,2).
route(bus_2_187,2,2).
route(bus_2_188,2,2).
route(bus_2_189,2,2).
route(bus_2_19,2,2).
route(bus_2_190,2,2).
route(bus_2_191,2,2).
route(bus_2_192,2,2).
route(bus_2_193,2,2).
route(bus_2_194,2,2).
route(bus_2_195,2,2).
route(bus_2_196,2,2).
route(bus_2_197,2,2).
route(bus_2_198,2,2).
route(bus_2_199,2,2).
route(bus_2_2,2,2).
route(bus_2_20,2,2).
route(bus_2_200,2,2).
route(bus_2_201,2,2).
route(bus_2_202,2,2).
route(bus_2_203,2,2).
route(bus_2_204,2,2).
route(bus_2_205,2,2).
route(bus_2_206,2,2).
route(bus_2_207,2,2).
route(bus_2_208,2,2).
route(bus_2_209,2,2).
route(bus_2_21,2,2).
route(bus_2_210,2,2).
route(bus_2_211,2,2).
route(bus_2_212,2,2).
route(bus_2_213,2,2).
route(bus_2_214,2,2).
route(bus_2_215,2,2).
route(bus_2_216,2,2).
route(bus_2_217,2,2).
route(bus_2_218,2,2).
route(bus_2_219,2,2).
route(bus_2_22,2,2).
route(bus_2_221,2,2).
route(bus_2_23,2,2).
route(bus_2_24,2,2).
route(bus_2_25,2,2).
route(bus_2_26,2,2).
route(bus_2_27,2,2).
route(bus_2_28,2,2).
route(bus_2_29,2,2).
route(bus_2_3,2,2).
route(bus_2_30,2,2).
route(bus_2_31,2,2).
route(bus_2_32,2,2).
route(bus_2_33,2,2).
route(bus_2_34,2,2).
route(bus_2_35,2,2).
route(bus_2_36,2,2).
route(bus_2_37,2,2).
route(bus_2_38,2,2).
route(bus_2_39,2,2).
route(bus_2_4,2,2).
route(bus_2_40,2,2).
route(bus_2_41,2,2).
route(bus_2_42,2,2).
route(bus_2_43,2,2).
route(bus_2_44,2,2).
route(bus_2_45,2,2).
route(bus_2_46,2,2).
route(bus_2_47,2,2).
route(bus_2_48,2,2).
route(bus_2_49,2,2).
route(bus_2_5,2,2).
route(bus_2_50,2,2).
route(bus_2_51,2,2).
route(bus_2_52,2,2).
route(bus_2_53,2,2).
route(bus_2_54,2,2).
route(bus_2_55,2,2).
route(bus_2_56,2,2).
route(bus_2_57,2,2).
route(bus_2_58,2,2).
route(bus_2_59,2,2).
route(bus_2_6,2,2).
route(bus_2_60,2,2).
route(bus_2_6001,2,2).
route(bus_2_6002,2,2).
route(bus_2_6003,2,2).
route(bus_2_6004,2,2).
route(bus_2_6005,2,2).
route(bus_2_6006,2,2).
route(bus_2_6007,2,2).
route(bus_2_6008,2,2).
route(bus_2_6009,2,2).
route(bus_2_6010,2,2).
route(bus_2_6011,2,2).
route(bus_2_6012,2,2).
route(bus_2_6013,2,2).
route(bus_2_6014,2,2).
route(bus_2_6015,2,2).
route(bus_2_6016,2,2).
route(bus_2_6017,2,2).
route(bus_2_6018,2,2).
route(bus_2_6019,2,2).
route(bus_2_6020,2,2).
route(bus_2_6021,2,2).
route(bus_2_6022,2,2).
route(bus_2_6023,2,2).
route(bus_2_6024,2,2).
route(bus_2_6025,2,2).
route(bus_2_6026,2,2).
route(bus_2_6027,2,2).
route(bus_2_6028,2,2).
route(bus_2_6029,2,2).
route(bus_2_6030,2,2).
route(bus_2_6031,2,2).
route(bus_2_6032,2,2).
route(bus_2_6033,2,2).
route(bus_2_6034,2,2).
route(bus_2_6035,2,2).
route(bus_2_6036,2,2).
route(bus_2_6037,2,2).
route(bus_2_6038,2,2).
route(bus_2_6039,2,2).
route(bus_2_6040,2,2).
route(bus_2_6041,2,2).
route(bus_2_6042,2,2).
route(bus_2_6043,2,2).
route(bus_2_6044,2,2).
route(bus_2_6045,2,2).
route(bus_2_6046,2,2).
route(bus_2_6047,2,2).
route(bus_2_6048,2,2).
route(bus_2_6049,2,2).
route(bus_2_6050,2,2).
route(bus_2_6051,2,2).
route(bus_2_6052,2,2).
route(bus_2_6053,2,2).
route(bus_2_6054,2,2).
route(bus_2_6055,2,2).
route(bus_2_6056,2,2).
route(bus_2_6057,2,2).
route(bus_2_6058,2,2).
route(bus_2_6059,2,2).
route(bus_2_6060,2,2).
route(bus_2_6061,2,2).
route(bus_2_6062,2,2).
route(bus_2_6063,2,2).
route(bus_2_6064,2,2).
route(bus_2_6065,2,2).
route(bus_2_6066,2,2).
route(bus_2_6067,2,2).
route(bus_2_6068,2,2).
route(bus_2_6069,2,2).
route(bus_2_6070,2,2).
route(bus_2_6071,2,2).
route(bus_2_6072,2,2).
route(bus_2_6073,2,2).
route(bus_2_6074,2,2).
route(bus_2_6075,2,2).
route(bus_2_6076,2,2).
route(bus_2_6077,2,2).
route(bus_2_6078,2,2).
route(bus_2_6079,2,2).
route(bus_2_6080,2,2).
route(bus_2_6081,2,2).
route(bus_2_6082,2,2).
route(bus_2_6083,2,2).
route(bus_2_6084,2,2).
route(bus_2_6085,2,2).
route(bus_2_6086,2,2).
route(bus_2_6087,2,2).
route(bus_2_6088,2,2).
route(bus_2_6089,2,2).
route(bus_2_6090,2,2).
route(bus_2_6091,2,2).
route(bus_2_6092,2,2).
route(bus_2_6093,2,2).
route(bus_2_6094,2,2).
route(bus_2_6095,2,2).
route(bus_2_6096,2,2).
route(bus_2_6097,2,2).
route(bus_2_6098,2,2).
route(bus_2_6099,2,2).
route(bus_2_61,2,2).
route(bus_2_6100,2,2).
route(bus_2_6101,2,2).
route(bus_2_6102,2,2).
route(bus_2_6103,2,2).
route(bus_2_6104,2,2).
route(bus_2_6105,2,2).
route(bus_2_6106,2,2).
route(bus_2_6107,2,2).
route(bus_2_6108,2,2).
route(bus_2_6109,2,2).
route(bus_2_6110,2,2).
route(bus_2_6111,2,2).
route(bus_2_6112,2,2).
route(bus_2_6113,2,2).
route(bus_2_6114,2,2).
route(bus_2_6115,2,2).
route(bus_2_6116,2,2).
route(bus_2_6117,2,2).
route(bus_2_6118,2,2).
route(bus_2_6119,2,2).
route(bus_2_6120,2,2).
route(bus_2_6121,2,2).
route(bus_2_6122,2,2).
route(bus_2_6123,2,2).
route(bus_2_6124,2,2).
route(bus_2_6125,2,2).
route(bus_2_6126,2,2).
route(bus_2_6127,2,2).
route(bus_2_6128,2,2).
route(bus_2_6129,2,2).
route(bus_2_6130,2,2).
route(bus_2_6131,2,2).
route(bus_2_6132,2,2).
route(bus_2_6133,2,2).
route(bus_2_6134,2,2).
route(bus_2_6135,2,2).
route(bus_2_6136,2,2).
route(bus_2_6137,2,2).
route(bus_2_6138,2,2).
route(bus_2_6139,2,2).
route(bus_2_6140,2,2).
route(bus_2_6141,2,2).
route(bus_2_6142,2,2).
route(bus_2_6143,2,2).
route(bus_2_6144,2,2).
route(bus_2_6145,2,2).
route(bus_2_6146,2,2).
route(bus_2_6147,2,2).
route(bus_2_6148,2,2).
route(bus_2_6149,2,2).
route(bus_2_6150,2,2).
route(bus_2_6151,2,2).
route(bus_2_6152,2,2).
route(bus_2_6153,2,2).
route(bus_2_6154,2,2).
route(bus_2_6155,2,2).
route(bus_2_6156,2,2).
route(bus_2_6157,2,2).
route(bus_2_6158,2,2).
route(bus_2_6159,2,2).
route(bus_2_6160,2,2).
route(bus_2_6161,2,2).
route(bus_2_6162,2,2).
route(bus_2_6163,2,2).
route(bus_2_6164,2,2).
route(bus_2_6165,2,2).
route(bus_2_6166,2,2).
route(bus_2_6167,2,2).
route(bus_2_6168,2,2).
route(bus_2_6169,2,2).
route(bus_2_6170,2,2).
route(bus_2_6171,2,2).
route(bus_2_6172,2,2).
route(bus_2_6173,2,2).
route(bus_2_6174,2,2).
route(bus_2_6175,2,2).
route(bus_2_6176,2,2).
route(bus_2_6177,2,2).
route(bus_2_6178,2,2).
route(bus_2_6179,2,2).
route(bus_2_6180,2,2).
route(bus_2_6181,2,2).
route(bus_2_6182,2,2).
route(bus_2_62,2,2).
route(bus_2_63,2,2).
route(bus_2_64,2,2).
route(bus_2_65,2,2).
route(bus_2_66,2,2).
route(bus_2_67,2,2).
route(bus_2_68,2,2).
route(bus_2_69,2,2).
route(bus_2_7,2,2).
route(bus_2_70,2,2).
route(bus_2_7001,2,2).
route(bus_2_7002,2,2).
route(bus_2_7003,2,2).
route(bus_2_7004,2,2).
route(bus_2_7005,2,2).
route(bus_2_7006,2,2).
route(bus_2_7007,2,2).
route(bus_2_7008,2,2).
route(bus_2_7009,2,2).
route(bus_2_7010,2,2).
route(bus_2_7011,2,2).
route(bus_2_7012,2,2).
route(bus_2_7013,2,2).
route(bus_2_7014,2,2).
route(bus_2_7015,2,2).
route(bus_2_7016,2,2).
route(bus_2_7017,2,2).
route(bus_2_7018,2,2).
route(bus_2_7019,2,2).
route(bus_2_7020,2,2).
route(bus_2_7021,2,2).
route(bus_2_7022,2,2).
route(bus_2_7023,2,2).
route(bus_2_7024,2,2).
route(bus_2_7025,2,2).
route(bus_2_7026,2,2).
route(bus_2_7027,2,2).
route(bus_2_7028,2,2).
route(bus_2_7029,2,2).
route(bus_2_7030,2,2).
route(bus_2_7031,2,2).
route(bus_2_7032,2,2).
route(bus_2_7033,2,2).
route(bus_2_7034,2,2).
route(bus_2_7035,2,2).
route(bus_2_7036,2,2).
route(bus_2_7037,2,2).
route(bus_2_7038,2,2).
route(bus_2_7039,2,2).
route(bus_2_7040,2,2).
route(bus_2_7041,2,2).
route(bus_2_7042,2,2).
route(bus_2_7043,2,2).
route(bus_2_7044,2,2).
route(bus_2_7045,2,2).
route(bus_2_7046,2,2).
route(bus_2_7047,2,2).
route(bus_2_7048,2,2).
route(bus_2_7049,2,2).
route(bus_2_7050,2,2).
route(bus_2_7051,2,2).
route(bus_2_7052,2,2).
route(bus_2_7053,2,2).
route(bus_2_7054,2,2).
route(bus_2_7055,2,2).
route(bus_2_7056,2,2).
route(bus_2_7057,2,2).
route(bus_2_7058,2,2).
route(bus_2_7059,2,2).
route(bus_2_7060,2,2).
route(bus_2_7061,2,2).
route(bus_2_7062,2,2).
route(bus_2_7063,2,2).
route(bus_2_7064,2,2).
route(bus_2_7065,2,2).
route(bus_2_7066,2,2).
route(bus_2_7067,2,2).
route(bus_2_7068,2,2).
route(bus_2_7069,2,2).
route(bus_2_7070,2,2).
route(bus_2_7071,2,2).
route(bus_2_7072,2,2).
route(bus_2_7073,2,2).
route(bus_2_7074,2,2).
route(bus_2_7075,2,2).
route(bus_2_7076,2,2).
route(bus_2_7077,2,2).
route(bus_2_7078,2,2).
route(bus_2_7079,2,2).
route(bus_2_7080,2,2).
route(bus_2_7081,2,2).
route(bus_2_7082,2,2).
route(bus_2_7083,2,2).
route(bus_2_7084,2,2).
route(bus_2_7085,2,2).
route(bus_2_7086,2,2).
route(bus_2_7087,2,2).
route(bus_2_7088,2,2).
route(bus_2_7089,2,2).
route(bus_2_7090,2,2).
route(bus_2_7091,2,2).
route(bus_2_7092,2,2).
route(bus_2_7093,2,2).
route(bus_2_7094,2,2).
route(bus_2_7095,2,2).
route(bus_2_7096,2,2).
route(bus_2_7097,2,2).
route(bus_2_7098,2,2).
route(bus_2_71,2,2).
route(bus_2_72,2,2).
route(bus_2_73,2,2).
route(bus_2_74,2,2).
route(bus_2_75,2,2).
route(bus_2_76,2,2).
route(bus_2_77,2,2).
route(bus_2_78,2,2).
route(bus_2_79,2,2).
route(bus_2_8,2,2).
route(bus_2_80,2,2).
route(bus_2_81,2,2).
route(bus_2_82,2,2).
route(bus_2_83,2,2).
route(bus_2_84,2,2).
route(bus_2_85,2,2).
route(bus_2_86,2,2).
route(bus_2_87,2,2).
route(bus_2_88,2,2).
route(bus_2_89,2,2).
route(bus_2_9,2,2).
route(bus_2_90,2,2).
route(bus_2_91,2,2).
route(bus_2_92,2,2).
route(bus_2_93,2,2).
route(bus_2_94,2,2).
route(bus_2_95,2,2).
route(bus_2_96,2,2).
route(bus_2_97,2,2).
route(bus_2_98,2,2).
route(bus_2_99,2,2).
route(bus_310_1,310,310).
route(bus_310_10,310,310).
route(bus_310_1001,310,310).
route(bus_310_1002,310,310).
route(bus_310_1003,310,310).
route(bus_310_1004,310,310).
route(bus_310_1005,310,310).
route(bus_310_1006,310,310).
route(bus_310_1007,310,310).
route(bus_310_1009,310,310).
route(bus_310_1011,310,310).
route(bus_310_1014,310,310).
route(bus_310_1016,310,310).
route(bus_310_1018,310,310).
route(bus_310_1019,310,310).
route(bus_310_1020,310,310).
route(bus_310_1021,310,310).
route(bus_310_1022,310,310).
route(bus_310_1024,310,310).
route(bus_310_1027,310,310).
route(bus_310_1028,310,310).
route(bus_310_1031,310,310).
route(bus_310_1032,310,310).
route(bus_310_1033,310,310).
route(bus_310_1035,310,310).
route(bus_310_1036,310,310).
route(bus_310_1037,310,310).
route(bus_310_1040,310,310).
route(bus_310_1041,310,310).
route(bus_310_1045,310,310).
route(bus_310_1046,310,310).
route(bus_310_1047,310,310).
route(bus_310_1048,310,310).
route(bus_310_1050,310,310).
route(bus_310_1051,310,310).
route(bus_310_1053,310,310).
route(bus_310_1054,310,310).
route(bus_310_1055,310,310).
route(bus_310_1058,310,310).
route(bus_310_1059,310,310).
route(bus_310_1060,310,310).
route(bus_310_1061,310,310).
route(bus_310_1062,310,310).
route(bus_310_1066,310,310).
route(bus_310_1067,310,310).
route(bus_310_1068,310,310).
route(bus_310_1069,310,310).
route(bus_310_1071,310,310).
route(bus_310_1072,310,310).
route(bus_310_1073,310,310).
route(bus_310_1074,310,310).
route(bus_310_1076,310,310).
route(bus_310_1077,310,310).
route(bus_310_1080,310,310).
route(bus_310_1082,310,310).
route(bus_310_1084,310,310).
route(bus_310_1090,310,310).
route(bus_310_11,310,310).
route(bus_310_12,310,310).
route(bus_310_13,310,310).
route(bus_310_14,310,310).
route(bus_310_15,310,310).
route(bus_310_16,310,310).
route(bus_310_17,310,310).
route(bus_310_18,310,310).
route(bus_310_19,310,310).
route(bus_310_2,310,310).
route(bus_310_20,310,310).
route(bus_310_2039,310,310).
route(bus_310_21,310,310).
route(bus_310_22,310,310).
route(bus_310_23,310,310).
route(bus_310_24,310,310).
route(bus_310_25,310,310).
route(bus_310_26,310,310).
route(bus_310_27,310,310).
route(bus_310_28,310,310).
route(bus_310_29,310,310).
route(bus_310_3,310,310).
route(bus_310_30,310,310).
route(bus_310_31,310,310).
route(bus_310_32,310,310).
route(bus_310_33,310,310).
route(bus_310_34,310,310).
route(bus_310_35,310,310).
route(bus_310_36,310,310).
route(bus_310_37,310,310).
route(bus_310_38,310,310).
route(bus_310_39,310,310).
route(bus_310_4,310,310).
route(bus_310_40,310,310).
route(bus_310_41,310,310).
route(bus_310_42,310,310).
route(bus_310_43,310,310).
route(bus_310_44,310,310).
route(bus_310_45,310,310).
route(bus_310_46,310,310).
route(bus_310_47,310,310).
route(bus_310_48,310,310).
route(bus_310_49,310,310).
route(bus_310_5,310,310).
route(bus_310_50,310,310).
route(bus_310_51,310,310).
route(bus_310_52,310,310).
route(bus_310_53,310,310).
route(bus_310_54,310,310).
route(bus_310_55,310,310).
route(bus_310_56,310,310).
route(bus_310_58,310,310).
route(bus_310_59,310,310).
route(bus_310_6,310,310).
route(bus_310_60,310,310).
route(bus_310_6001,310,310).
route(bus_310_6002,310,310).
route(bus_310_6003,310,310).
route(bus_310_6004,310,310).
route(bus_310_6005,310,310).
route(bus_310_6006,310,310).
route(bus_310_6007,310,310).
route(bus_310_6008,310,310).
route(bus_310_6009,310,310).
route(bus_310_6010,310,310).
route(bus_310_6011,310,310).
route(bus_310_6012,310,310).
route(bus_310_6013,310,310).
route(bus_310_6014,310,310).
route(bus_310_61,310,310).
route(bus_310_62,310,310).
route(bus_310_63,310,310).
route(bus_310_64,310,310).
route(bus_310_65,310,310).
route(bus_310_66,310,310).
route(bus_310_67,310,310).
route(bus_310_68,310,310).
route(bus_310_69,310,310).
route(bus_310_7,310,310).
route(bus_310_70,310,310).
route(bus_310_7001,310,310).
route(bus_310_7002,310,310).
route(bus_310_7003,310,310).
route(bus_310_7004,310,310).
route(bus_310_7005,310,310).
route(bus_310_7006,310,310).
route(bus_310_7007,310,310).
route(bus_310_7008,310,310).
route(bus_310_7010,310,310).
route(bus_310_71,310,310).
route(bus_310_72,310,310).
route(bus_310_73,310,310).
route(bus_310_74,310,310).
route(bus_310_75,310,310).
route(bus_310_76,310,310).
route(bus_310_77,310,310).
route(bus_310_78,310,310).
route(bus_310_79,310,310).
route(bus_310_8,310,310).
route(bus_310_80,310,310).
route(bus_310_8002,310,310).
route(bus_310_8004,310,310).
route(bus_310_8006,310,310).
route(bus_310_8008,310,310).
route(bus_310_8010,310,310).
route(bus_310_8012,310,310).
route(bus_310_8014,310,310).
route(bus_310_81,310,310).
route(bus_310_82,310,310).
route(bus_310_84,310,310).
route(bus_310_9,310,310).
route(bus_310_9002,310,310).
route(bus_310_9004,310,310).
route(bus_310_9006,310,310).
route(bus_310_9008,310,310).
route(bus_310_9010,310,310).
route(bus_320_1,320,320).
route(bus_320_1002,320,320).
route(bus_320_1003,320,320).
route(bus_320_1004,320,320).
route(bus_320_1007,320,320).
route(bus_320_2,320,320).
route(bus_320_3,320,320).
route(bus_320_4,320,320).
route(bus_320_5,320,320).
route(bus_320_6,320,320).
route(bus_320_6001,320,320).
route(bus_320_6002,320,320).
route(bus_320_7,320,320).
route(bus_320_7001,320,320).
route(bus_320_7002,320,320).
route(bus_320_8001,320,320).
route(bus_320_8002,320,320).
route(bus_320_9,320,320).
route(bus_320_9001,320,320).
route(bus_320_9002,320,320).
route(bus_330_1,330,330).
route(bus_330_10,330,330).
route(bus_330_12,330,330).
route(bus_330_14,330,330).
route(bus_330_3,330,330).
route(bus_330_4,330,330).
route(bus_330_5,330,330).
route(bus_330_6,330,330).
route(bus_330_6001,330,330).
route(bus_330_6002,330,330).
route(bus_330_6003,330,330).
route(bus_330_6004,330,330).
route(bus_330_7,330,330).
route(bus_330_7001,330,330).
route(bus_330_7002,330,330).
route(bus_330_8,330,330).
route(bus_330_8001,330,330).
route(bus_330_8002,330,330).
route(bus_330_8003,330,330).
route(bus_330_8004,330,330).
route(bus_330_9,330,330).
route(bus_330_9001,330,330).
route(bus_330_9002,330,330).
route(bus_340_10,340,340).
route(bus_340_1004,340,340).
route(bus_340_1010,340,340).
route(bus_340_1013,340,340).
route(bus_340_1015,340,340).
route(bus_340_1016,340,340).
route(bus_340_1021,340,340).
route(bus_340_1028,340,340).
route(bus_340_1033,340,340).
route(bus_340_13,340,340).
route(bus_340_131,340,340).
route(bus_340_133,340,340).
route(bus_340_15,340,340).
route(bus_340_16,340,340).
route(bus_340_21,340,340).
route(bus_340_28,340,340).
route(bus_340_33,340,340).
route(bus_340_4,340,340).
route(bus_340_6002,340,340).
route(bus_340_6003,340,340).
route(bus_340_6006,340,340).
route(bus_340_6007,340,340).
route(bus_340_7003,340,340).
route(bus_340_7004,340,340).
route(bus_340_7005,340,340).
route(bus_340_7006,340,340).
route(bus_340_8002,340,340).
route(bus_340_8003,340,340).
route(bus_340_8006,340,340).
route(bus_340_8007,340,340).
route(bus_340_9003,340,340).
route(bus_340_9004,340,340).
route(bus_340_9005,340,340).
route(bus_340_9006,340,340).
route(bus_350_1,350,350).
route(bus_350_10,350,350).
route(bus_350_1003,350,350).
route(bus_350_1004,350,350).
route(bus_350_1005,350,350).
route(bus_350_1008,350,350).
route(bus_350_1009,350,350).
route(bus_350_1010,350,350).
route(bus_350_2,350,350).
route(bus_350_3,350,350).
route(bus_350_4,350,350).
route(bus_350_5,350,350).
route(bus_350_6,350,350).
route(bus_350_6001,350,350).
route(bus_350_6002,350,350).
route(bus_350_6003,350,350).
route(bus_350_6004,350,350).
route(bus_350_7,350,350).
route(bus_350_7001,350,350).
route(bus_350_7002,350,350).
route(bus_350_7003,350,350).
route(bus_350_7004,350,350).
route(bus_350_8,350,350).
route(bus_350_8002,350,350).
route(bus_350_8003,350,350).
route(bus_350_8004,350,350).
route(bus_350_9,350,350).
route(bus_350_9001,350,350).
route(bus_350_9002,350,350).
route(bus_350_9003,350,350).
route(bus_350_9004,350,350).
route(bus_3_1,3,3).
route(bus_3_10,3,3).
route(bus_3_100,3,3).
route(bus_3_101,3,3).
route(bus_3_102,3,3).
route(bus_3_103,3,3).
route(bus_3_104,3,3).
route(bus_3_105,3,3).
route(bus_3_106,3,3).
route(bus_3_107,3,3).
route(bus_3_108,3,3).
route(bus_3_109,3,3).
route(bus_3_11,3,3).
route(bus_3_110,3,3).
route(bus_3_111,3,3).
route(bus_3_112,3,3).
route(bus_3_113,3,3).
route(bus_3_114,3,3).
route(bus_3_115,3,3).
route(bus_3_116,3,3).
route(bus_3_117,3,3).
route(bus_3_118,3,3).
route(bus_3_119,3,3).
route(bus_3_12,3,3).
route(bus_3_120,3,3).
route(bus_3_121,3,3).
route(bus_3_122,3,3).
route(bus_3_123,3,3).
route(bus_3_124,3,3).
route(bus_3_125,3,3).
route(bus_3_126,3,3).
route(bus_3_127,3,3).
route(bus_3_128,3,3).
route(bus_3_129,3,3).
route(bus_3_13,3,3).
route(bus_3_130,3,3).
route(bus_3_131,3,3).
route(bus_3_132,3,3).
route(bus_3_133,3,3).
route(bus_3_134,3,3).
route(bus_3_135,3,3).
route(bus_3_136,3,3).
route(bus_3_137,3,3).
route(bus_3_138,3,3).
route(bus_3_139,3,3).
route(bus_3_14,3,3).
route(bus_3_140,3,3).
route(bus_3_141,3,3).
route(bus_3_142,3,3).
route(bus_3_143,3,3).
route(bus_3_144,3,3).
route(bus_3_145,3,3).
route(bus_3_146,3,3).
route(bus_3_147,3,3).
route(bus_3_148,3,3).
route(bus_3_149,3,3).
route(bus_3_15,3,3).
route(bus_3_150,3,3).
route(bus_3_151,3,3).
route(bus_3_152,3,3).
route(bus_3_153,3,3).
route(bus_3_154,3,3).
route(bus_3_155,3,3).
route(bus_3_156,3,3).
route(bus_3_157,3,3).
route(bus_3_158,3,3).
route(bus_3_159,3,3).
route(bus_3_16,3,3).
route(bus_3_160,3,3).
route(bus_3_161,3,3).
route(bus_3_162,3,3).
route(bus_3_163,3,3).
route(bus_3_164,3,3).
route(bus_3_165,3,3).
route(bus_3_166,3,3).
route(bus_3_167,3,3).
route(bus_3_168,3,3).
route(bus_3_169,3,3).
route(bus_3_17,3,3).
route(bus_3_170,3,3).
route(bus_3_171,3,3).
route(bus_3_172,3,3).
route(bus_3_173,3,3).
route(bus_3_174,3,3).
route(bus_3_175,3,3).
route(bus_3_176,3,3).
route(bus_3_177,3,3).
route(bus_3_178,3,3).
route(bus_3_179,3,3).
route(bus_3_18,3,3).
route(bus_3_180,3,3).
route(bus_3_181,3,3).
route(bus_3_182,3,3).
route(bus_3_183,3,3).
route(bus_3_184,3,3).
route(bus_3_185,3,3).
route(bus_3_186,3,3).
route(bus_3_187,3,3).
route(bus_3_188,3,3).
route(bus_3_189,3,3).
route(bus_3_19,3,3).
route(bus_3_190,3,3).
route(bus_3_191,3,3).
route(bus_3_192,3,3).
route(bus_3_193,3,3).
route(bus_3_194,3,3).
route(bus_3_195,3,3).
route(bus_3_196,3,3).
route(bus_3_197,3,3).
route(bus_3_198,3,3).
route(bus_3_199,3,3).
route(bus_3_2,3,3).
route(bus_3_20,3,3).
route(bus_3_200,3,3).
route(bus_3_201,3,3).
route(bus_3_202,3,3).
route(bus_3_203,3,3).
route(bus_3_204,3,3).
route(bus_3_205,3,3).
route(bus_3_206,3,3).
route(bus_3_207,3,3).
route(bus_3_208,3,3).
route(bus_3_209,3,3).
route(bus_3_21,3,3).
route(bus_3_210,3,3).
route(bus_3_211,3,3).
route(bus_3_212,3,3).
route(bus_3_213,3,3).
route(bus_3_214,3,3).
route(bus_3_215,3,3).
route(bus_3_216,3,3).
route(bus_3_217,3,3).
route(bus_3_218,3,3).
route(bus_3_22,3,3).
route(bus_3_23,3,3).
route(bus_3_24,3,3).
route(bus_3_25,3,3).
route(bus_3_26,3,3).
route(bus_3_27,3,3).
route(bus_3_28,3,3).
route(bus_3_29,3,3).
route(bus_3_3,3,3).
route(bus_3_30,3,3).
route(bus_3_31,3,3).
route(bus_3_32,3,3).
route(bus_3_33,3,3).
route(bus_3_34,3,3).
route(bus_3_35,3,3).
route(bus_3_36,3,3).
route(bus_3_37,3,3).
route(bus_3_38,3,3).
route(bus_3_39,3,3).
route(bus_3_4,3,3).
route(bus_3_40,3,3).
route(bus_3_41,3,3).
route(bus_3_42,3,3).
route(bus_3_43,3,3).
route(bus_3_44,3,3).
route(bus_3_45,3,3).
route(bus_3_46,3,3).
route(bus_3_47,3,3).
route(bus_3_48,3,3).
route(bus_3_49,3,3).
route(bus_3_5,3,3).
route(bus_3_50,3,3).
route(bus_3_51,3,3).
route(bus_3_52,3,3).
route(bus_3_53,3,3).
route(bus_3_54,3,3).
route(bus_3_55,3,3).
route(bus_3_56,3,3).
route(bus_3_57,3,3).
route(bus_3_58,3,3).
route(bus_3_59,3,3).
route(bus_3_6,3,3).
route(bus_3_60,3,3).
route(bus_3_6001,3,3).
route(bus_3_6002,3,3).
route(bus_3_6003,3,3).
route(bus_3_6004,3,3).
route(bus_3_6005,3,3).
route(bus_3_6006,3,3).
route(bus_3_6007,3,3).
route(bus_3_6008,3,3).
route(bus_3_6009,3,3).
route(bus_3_6010,3,3).
route(bus_3_6011,3,3).
route(bus_3_6012,3,3).
route(bus_3_6013,3,3).
route(bus_3_6014,3,3).
route(bus_3_6015,3,3).
route(bus_3_6016,3,3).
route(bus_3_6017,3,3).
route(bus_3_6018,3,3).
route(bus_3_6019,3,3).
route(bus_3_6020,3,3).
route(bus_3_6021,3,3).
route(bus_3_6022,3,3).
route(bus_3_6023,3,3).
route(bus_3_6024,3,3).
route(bus_3_6025,3,3).
route(bus_3_6026,3,3).
route(bus_3_6027,3,3).
route(bus_3_6028,3,3).
route(bus_3_6029,3,3).
route(bus_3_6030,3,3).
route(bus_3_6031,3,3).
route(bus_3_6032,3,3).
route(bus_3_6033,3,3).
route(bus_3_6034,3,3).
route(bus_3_6035,3,3).
route(bus_3_6036,3,3).
route(bus_3_6037,3,3).
route(bus_3_6038,3,3).
route(bus_3_6039,3,3).
route(bus_3_6040,3,3).
route(bus_3_6041,3,3).
route(bus_3_6042,3,3).
route(bus_3_6043,3,3).
route(bus_3_6044,3,3).
route(bus_3_6045,3,3).
route(bus_3_6046,3,3).
route(bus_3_6047,3,3).
route(bus_3_6048,3,3).
route(bus_3_6049,3,3).
route(bus_3_6050,3,3).
route(bus_3_6051,3,3).
route(bus_3_6052,3,3).
route(bus_3_6053,3,3).
route(bus_3_6054,3,3).
route(bus_3_6055,3,3).
route(bus_3_6056,3,3).
route(bus_3_6057,3,3).
route(bus_3_6058,3,3).
route(bus_3_6059,3,3).
route(bus_3_6060,3,3).
route(bus_3_6061,3,3).
route(bus_3_6062,3,3).
route(bus_3_6063,3,3).
route(bus_3_6064,3,3).
route(bus_3_6065,3,3).
route(bus_3_6066,3,3).
route(bus_3_6067,3,3).
route(bus_3_6068,3,3).
route(bus_3_6069,3,3).
route(bus_3_6070,3,3).
route(bus_3_6071,3,3).
route(bus_3_6072,3,3).
route(bus_3_6073,3,3).
route(bus_3_6074,3,3).
route(bus_3_6075,3,3).
route(bus_3_6076,3,3).
route(bus_3_6077,3,3).
route(bus_3_6078,3,3).
route(bus_3_6079,3,3).
route(bus_3_6080,3,3).
route(bus_3_6081,3,3).
route(bus_3_6082,3,3).
route(bus_3_6083,3,3).
route(bus_3_6084,3,3).
route(bus_3_6085,3,3).
route(bus_3_6086,3,3).
route(bus_3_6087,3,3).
route(bus_3_6088,3,3).
route(bus_3_6089,3,3).
route(bus_3_6090,3,3).
route(bus_3_6091,3,3).
route(bus_3_6092,3,3).
route(bus_3_6093,3,3).
route(bus_3_6094,3,3).
route(bus_3_6095,3,3).
route(bus_3_6096,3,3).
route(bus_3_6097,3,3).
route(bus_3_6098,3,3).
route(bus_3_6099,3,3).
route(bus_3_61,3,3).
route(bus_3_6100,3,3).
route(bus_3_6101,3,3).
route(bus_3_6102,3,3).
route(bus_3_6103,3,3).
route(bus_3_6104,3,3).
route(bus_3_6105,3,3).
route(bus_3_6106,3,3).
route(bus_3_6107,3,3).
route(bus_3_6108,3,3).
route(bus_3_6109,3,3).
route(bus_3_6110,3,3).
route(bus_3_6111,3,3).
route(bus_3_6112,3,3).
route(bus_3_6113,3,3).
route(bus_3_6114,3,3).
route(bus_3_6115,3,3).
route(bus_3_6116,3,3).
route(bus_3_6117,3,3).
route(bus_3_6118,3,3).
route(bus_3_6119,3,3).
route(bus_3_6120,3,3).
route(bus_3_6121,3,3).
route(bus_3_6122,3,3).
route(bus_3_6123,3,3).
route(bus_3_6124,3,3).
route(bus_3_6125,3,3).
route(bus_3_6126,3,3).
route(bus_3_6127,3,3).
route(bus_3_6128,3,3).
route(bus_3_6129,3,3).
route(bus_3_6130,3,3).
route(bus_3_6131,3,3).
route(bus_3_6132,3,3).
route(bus_3_6133,3,3).
route(bus_3_6134,3,3).
route(bus_3_6135,3,3).
route(bus_3_6136,3,3).
route(bus_3_6137,3,3).
route(bus_3_6138,3,3).
route(bus_3_6139,3,3).
route(bus_3_6140,3,3).
route(bus_3_6141,3,3).
route(bus_3_6142,3,3).
route(bus_3_6143,3,3).
route(bus_3_6144,3,3).
route(bus_3_6145,3,3).
route(bus_3_6146,3,3).
route(bus_3_6147,3,3).
route(bus_3_6148,3,3).
route(bus_3_6149,3,3).
route(bus_3_6150,3,3).
route(bus_3_6151,3,3).
route(bus_3_6152,3,3).
route(bus_3_6153,3,3).
route(bus_3_6154,3,3).
route(bus_3_6155,3,3).
route(bus_3_6156,3,3).
route(bus_3_6157,3,3).
route(bus_3_6158,3,3).
route(bus_3_6159,3,3).
route(bus_3_6160,3,3).
route(bus_3_6161,3,3).
route(bus_3_6162,3,3).
route(bus_3_6163,3,3).
route(bus_3_6164,3,3).
route(bus_3_6165,3,3).
route(bus_3_6166,3,3).
route(bus_3_6167,3,3).
route(bus_3_6168,3,3).
route(bus_3_6169,3,3).
route(bus_3_6170,3,3).
route(bus_3_6171,3,3).
route(bus_3_6172,3,3).
route(bus_3_6173,3,3).
route(bus_3_6174,3,3).
route(bus_3_6175,3,3).
route(bus_3_6176,3,3).
route(bus_3_6177,3,3).
route(bus_3_6178,3,3).
route(bus_3_6179,3,3).
route(bus_3_6180,3,3).
route(bus_3_6181,3,3).
route(bus_3_6182,3,3).
route(bus_3_6183,3,3).
route(bus_3_6184,3,3).
route(bus_3_62,3,3).
route(bus_3_63,3,3).
route(bus_3_64,3,3).
route(bus_3_65,3,3).
route(bus_3_66,3,3).
route(bus_3_67,3,3).
route(bus_3_68,3,3).
route(bus_3_69,3,3).
route(bus_3_7,3,3).
route(bus_3_70,3,3).
route(bus_3_7001,3,3).
route(bus_3_7002,3,3).
route(bus_3_7003,3,3).
route(bus_3_7004,3,3).
route(bus_3_7005,3,3).
route(bus_3_7006,3,3).
route(bus_3_7007,3,3).
route(bus_3_7008,3,3).
route(bus_3_7009,3,3).
route(bus_3_7010,3,3).
route(bus_3_7011,3,3).
route(bus_3_7012,3,3).
route(bus_3_7013,3,3).
route(bus_3_7014,3,3).
route(bus_3_7015,3,3).
route(bus_3_7016,3,3).
route(bus_3_7017,3,3).
route(bus_3_7018,3,3).
route(bus_3_7019,3,3).
route(bus_3_7020,3,3).
route(bus_3_7021,3,3).
route(bus_3_7022,3,3).
route(bus_3_7023,3,3).
route(bus_3_7024,3,3).
route(bus_3_7025,3,3).
route(bus_3_7026,3,3).
route(bus_3_7027,3,3).
route(bus_3_7028,3,3).
route(bus_3_7029,3,3).
route(bus_3_7030,3,3).
route(bus_3_7031,3,3).
route(bus_3_7032,3,3).
route(bus_3_7033,3,3).
route(bus_3_7034,3,3).
route(bus_3_7035,3,3).
route(bus_3_7036,3,3).
route(bus_3_7037,3,3).
route(bus_3_7038,3,3).
route(bus_3_7039,3,3).
route(bus_3_7040,3,3).
route(bus_3_7041,3,3).
route(bus_3_7042,3,3).
route(bus_3_7043,3,3).
route(bus_3_7044,3,3).
route(bus_3_7045,3,3).
route(bus_3_7046,3,3).
route(bus_3_7047,3,3).
route(bus_3_7048,3,3).
route(bus_3_7049,3,3).
route(bus_3_7050,3,3).
route(bus_3_7051,3,3).
route(bus_3_7052,3,3).
route(bus_3_7053,3,3).
route(bus_3_7054,3,3).
route(bus_3_7055,3,3).
route(bus_3_7056,3,3).
route(bus_3_7057,3,3).
route(bus_3_7058,3,3).
route(bus_3_7059,3,3).
route(bus_3_7060,3,3).
route(bus_3_7061,3,3).
route(bus_3_7062,3,3).
route(bus_3_7063,3,3).
route(bus_3_7064,3,3).
route(bus_3_7065,3,3).
route(bus_3_7066,3,3).
route(bus_3_7067,3,3).
route(bus_3_7068,3,3).
route(bus_3_7069,3,3).
route(bus_3_7070,3,3).
route(bus_3_7071,3,3).
route(bus_3_7072,3,3).
route(bus_3_7073,3,3).
route(bus_3_7074,3,3).
route(bus_3_7075,3,3).
route(bus_3_7076,3,3).
route(bus_3_7077,3,3).
route(bus_3_7078,3,3).
route(bus_3_7079,3,3).
route(bus_3_7080,3,3).
route(bus_3_7081,3,3).
route(bus_3_7082,3,3).
route(bus_3_7083,3,3).
route(bus_3_7084,3,3).
route(bus_3_7085,3,3).
route(bus_3_7086,3,3).
route(bus_3_7087,3,3).
route(bus_3_7088,3,3).
route(bus_3_7089,3,3).
route(bus_3_7090,3,3).
route(bus_3_7091,3,3).
route(bus_3_7092,3,3).
route(bus_3_7093,3,3).
route(bus_3_7094,3,3).
route(bus_3_7095,3,3).
route(bus_3_7096,3,3).
route(bus_3_7097,3,3).
route(bus_3_7098,3,3).
route(bus_3_7099,3,3).
route(bus_3_71,3,3).
route(bus_3_7100,3,3).
route(bus_3_72,3,3).
route(bus_3_73,3,3).
route(bus_3_74,3,3).
route(bus_3_75,3,3).
route(bus_3_76,3,3).
route(bus_3_77,3,3).
route(bus_3_78,3,3).
route(bus_3_79,3,3).
route(bus_3_8,3,3).
route(bus_3_80,3,3).
route(bus_3_81,3,3).
route(bus_3_82,3,3).
route(bus_3_83,3,3).
route(bus_3_84,3,3).
route(bus_3_85,3,3).
route(bus_3_86,3,3).
route(bus_3_87,3,3).
route(bus_3_88,3,3).
route(bus_3_89,3,3).
route(bus_3_9,3,3).
route(bus_3_90,3,3).
route(bus_3_91,3,3).
route(bus_3_92,3,3).
route(bus_3_93,3,3).
route(bus_3_94,3,3).
route(bus_3_95,3,3).
route(bus_3_96,3,3).
route(bus_3_97,3,3).
route(bus_3_98,3,3).
route(bus_3_99,3,3).
route(bus_40_1,40,40).
route(bus_40_10,40,40).
route(bus_40_100,40,40).
route(bus_40_101,40,40).
route(bus_40_102,40,40).
route(bus_40_103,40,40).
route(bus_40_104,40,40).
route(bus_40_105,40,40).
route(bus_40_106,40,40).
route(bus_40_107,40,40).
route(bus_40_108,40,40).
route(bus_40_109,40,40).
route(bus_40_11,40,40).
route(bus_40_110,40,40).
route(bus_40_111,40,40).
route(bus_40_112,40,40).
route(bus_40_113,40,40).
route(bus_40_114,40,40).
route(bus_40_115,40,40).
route(bus_40_116,40,40).
route(bus_40_117,40,40).
route(bus_40_118,40,40).
route(bus_40_119,40,40).
route(bus_40_12,40,40).
route(bus_40_120,40,40).
route(bus_40_121,40,40).
route(bus_40_122,40,40).
route(bus_40_123,40,40).
route(bus_40_124,40,40).
route(bus_40_125,40,40).
route(bus_40_126,40,40).
route(bus_40_127,40,40).
route(bus_40_128,40,40).
route(bus_40_129,40,40).
route(bus_40_13,40,40).
route(bus_40_130,40,40).
route(bus_40_131,40,40).
route(bus_40_132,40,40).
route(bus_40_133,40,40).
route(bus_40_134,40,40).
route(bus_40_135,40,40).
route(bus_40_136,40,40).
route(bus_40_137,40,40).
route(bus_40_138,40,40).
route(bus_40_139,40,40).
route(bus_40_14,40,40).
route(bus_40_140,40,40).
route(bus_40_141,40,40).
route(bus_40_142,40,40).
route(bus_40_143,40,40).
route(bus_40_144,40,40).
route(bus_40_145,40,40).
route(bus_40_146,40,40).
route(bus_40_147,40,40).
route(bus_40_148,40,40).
route(bus_40_149,40,40).
route(bus_40_15,40,40).
route(bus_40_150,40,40).
route(bus_40_151,40,40).
route(bus_40_152,40,40).
route(bus_40_153,40,40).
route(bus_40_154,40,40).
route(bus_40_155,40,40).
route(bus_40_156,40,40).
route(bus_40_157,40,40).
route(bus_40_158,40,40).
route(bus_40_159,40,40).
route(bus_40_16,40,40).
route(bus_40_160,40,40).
route(bus_40_161,40,40).
route(bus_40_162,40,40).
route(bus_40_163,40,40).
route(bus_40_164,40,40).
route(bus_40_165,40,40).
route(bus_40_166,40,40).
route(bus_40_167,40,40).
route(bus_40_168,40,40).
route(bus_40_169,40,40).
route(bus_40_17,40,40).
route(bus_40_170,40,40).
route(bus_40_171,40,40).
route(bus_40_172,40,40).
route(bus_40_173,40,40).
route(bus_40_174,40,40).
route(bus_40_175,40,40).
route(bus_40_176,40,40).
route(bus_40_177,40,40).
route(bus_40_178,40,40).
route(bus_40_179,40,40).
route(bus_40_18,40,40).
route(bus_40_180,40,40).
route(bus_40_181,40,40).
route(bus_40_182,40,40).
route(bus_40_183,40,40).
route(bus_40_184,40,40).
route(bus_40_185,40,40).
route(bus_40_186,40,40).
route(bus_40_187,40,40).
route(bus_40_188,40,40).
route(bus_40_189,40,40).
route(bus_40_19,40,40).
route(bus_40_190,40,40).
route(bus_40_191,40,40).
route(bus_40_192,40,40).
route(bus_40_193,40,40).
route(bus_40_194,40,40).
route(bus_40_195,40,40).
route(bus_40_196,40,40).
route(bus_40_197,40,40).
route(bus_40_198,40,40).
route(bus_40_199,40,40).
route(bus_40_2,40,40).
route(bus_40_20,40,40).
route(bus_40_200,40,40).
route(bus_40_201,40,40).
route(bus_40_202,40,40).
route(bus_40_203,40,40).
route(bus_40_204,40,40).
route(bus_40_205,40,40).
route(bus_40_206,40,40).
route(bus_40_207,40,40).
route(bus_40_208,40,40).
route(bus_40_209,40,40).
route(bus_40_21,40,40).
route(bus_40_22,40,40).
route(bus_40_23,40,40).
route(bus_40_24,40,40).
route(bus_40_25,40,40).
route(bus_40_26,40,40).
route(bus_40_27,40,40).
route(bus_40_28,40,40).
route(bus_40_29,40,40).
route(bus_40_29643,40,40).
route(bus_40_3,40,40).
route(bus_40_30,40,40).
route(bus_40_31,40,40).
route(bus_40_32,40,40).
route(bus_40_33,40,40).
route(bus_40_34,40,40).
route(bus_40_35,40,40).
route(bus_40_36,40,40).
route(bus_40_37,40,40).
route(bus_40_38,40,40).
route(bus_40_39,40,40).
route(bus_40_4,40,40).
route(bus_40_40,40,40).
route(bus_40_41,40,40).
route(bus_40_42,40,40).
route(bus_40_43,40,40).
route(bus_40_44,40,40).
route(bus_40_45,40,40).
route(bus_40_46,40,40).
route(bus_40_47,40,40).
route(bus_40_48,40,40).
route(bus_40_49,40,40).
route(bus_40_5,40,40).
route(bus_40_50,40,40).
route(bus_40_51,40,40).
route(bus_40_52,40,40).
route(bus_40_53,40,40).
route(bus_40_54,40,40).
route(bus_40_55,40,40).
route(bus_40_56,40,40).
route(bus_40_57,40,40).
route(bus_40_58,40,40).
route(bus_40_59,40,40).
route(bus_40_6,40,40).
route(bus_40_60,40,40).
route(bus_40_6001,40,40).
route(bus_40_6002,40,40).
route(bus_40_6003,40,40).
route(bus_40_6004,40,40).
route(bus_40_6005,40,40).
route(bus_40_6006,40,40).
route(bus_40_6007,40,40).
route(bus_40_6008,40,40).
route(bus_40_6009,40,40).
route(bus_40_6010,40,40).
route(bus_40_6011,40,40).
route(bus_40_6012,40,40).
route(bus_40_6013,40,40).
route(bus_40_6014,40,40).
route(bus_40_6015,40,40).
route(bus_40_6016,40,40).
route(bus_40_6017,40,40).
route(bus_40_6018,40,40).
route(bus_40_6019,40,40).
route(bus_40_6020,40,40).
route(bus_40_6021,40,40).
route(bus_40_6022,40,40).
route(bus_40_6023,40,40).
route(bus_40_6024,40,40).
route(bus_40_6025,40,40).
route(bus_40_6026,40,40).
route(bus_40_6027,40,40).
route(bus_40_6028,40,40).
route(bus_40_6029,40,40).
route(bus_40_6030,40,40).
route(bus_40_6031,40,40).
route(bus_40_6032,40,40).
route(bus_40_6033,40,40).
route(bus_40_6034,40,40).
route(bus_40_6035,40,40).
route(bus_40_6036,40,40).
route(bus_40_6037,40,40).
route(bus_40_6038,40,40).
route(bus_40_6039,40,40).
route(bus_40_6040,40,40).
route(bus_40_6041,40,40).
route(bus_40_6042,40,40).
route(bus_40_6043,40,40).
route(bus_40_6044,40,40).
route(bus_40_6045,40,40).
route(bus_40_6046,40,40).
route(bus_40_6047,40,40).
route(bus_40_6048,40,40).
route(bus_40_6049,40,40).
route(bus_40_6050,40,40).
route(bus_40_6051,40,40).
route(bus_40_6052,40,40).
route(bus_40_6053,40,40).
route(bus_40_6054,40,40).
route(bus_40_6055,40,40).
route(bus_40_6056,40,40).
route(bus_40_6057,40,40).
route(bus_40_6058,40,40).
route(bus_40_6059,40,40).
route(bus_40_6060,40,40).
route(bus_40_6061,40,40).
route(bus_40_6062,40,40).
route(bus_40_6063,40,40).
route(bus_40_6064,40,40).
route(bus_40_6065,40,40).
route(bus_40_6066,40,40).
route(bus_40_6067,40,40).
route(bus_40_6068,40,40).
route(bus_40_6069,40,40).
route(bus_40_6070,40,40).
route(bus_40_6071,40,40).
route(bus_40_6072,40,40).
route(bus_40_6073,40,40).
route(bus_40_6074,40,40).
route(bus_40_6075,40,40).
route(bus_40_6076,40,40).
route(bus_40_6077,40,40).
route(bus_40_6078,40,40).
route(bus_40_6079,40,40).
route(bus_40_6080,40,40).
route(bus_40_6081,40,40).
route(bus_40_6082,40,40).
route(bus_40_6083,40,40).
route(bus_40_6084,40,40).
route(bus_40_6085,40,40).
route(bus_40_6086,40,40).
route(bus_40_6087,40,40).
route(bus_40_6088,40,40).
route(bus_40_6089,40,40).
route(bus_40_6090,40,40).
route(bus_40_6091,40,40).
route(bus_40_6092,40,40).
route(bus_40_6093,40,40).
route(bus_40_6094,40,40).
route(bus_40_6095,40,40).
route(bus_40_6096,40,40).
route(bus_40_6097,40,40).
route(bus_40_6098,40,40).
route(bus_40_6099,40,40).
route(bus_40_61,40,40).
route(bus_40_6100,40,40).
route(bus_40_6101,40,40).
route(bus_40_6102,40,40).
route(bus_40_6103,40,40).
route(bus_40_6104,40,40).
route(bus_40_6105,40,40).
route(bus_40_6106,40,40).
route(bus_40_6107,40,40).
route(bus_40_6108,40,40).
route(bus_40_62,40,40).
route(bus_40_63,40,40).
route(bus_40_64,40,40).
route(bus_40_65,40,40).
route(bus_40_66,40,40).
route(bus_40_67,40,40).
route(bus_40_68,40,40).
route(bus_40_69,40,40).
route(bus_40_7,40,40).
route(bus_40_70,40,40).
route(bus_40_7001,40,40).
route(bus_40_7002,40,40).
route(bus_40_7003,40,40).
route(bus_40_7004,40,40).
route(bus_40_7005,40,40).
route(bus_40_7006,40,40).
route(bus_40_7007,40,40).
route(bus_40_7008,40,40).
route(bus_40_7009,40,40).
route(bus_40_7010,40,40).
route(bus_40_7011,40,40).
route(bus_40_7012,40,40).
route(bus_40_7013,40,40).
route(bus_40_7014,40,40).
route(bus_40_7015,40,40).
route(bus_40_7016,40,40).
route(bus_40_7017,40,40).
route(bus_40_7018,40,40).
route(bus_40_7019,40,40).
route(bus_40_7020,40,40).
route(bus_40_7021,40,40).
route(bus_40_7022,40,40).
route(bus_40_7023,40,40).
route(bus_40_7024,40,40).
route(bus_40_7025,40,40).
route(bus_40_7026,40,40).
route(bus_40_7027,40,40).
route(bus_40_7028,40,40).
route(bus_40_7029,40,40).
route(bus_40_7030,40,40).
route(bus_40_7031,40,40).
route(bus_40_7032,40,40).
route(bus_40_7033,40,40).
route(bus_40_7034,40,40).
route(bus_40_7035,40,40).
route(bus_40_7036,40,40).
route(bus_40_7037,40,40).
route(bus_40_7038,40,40).
route(bus_40_7039,40,40).
route(bus_40_7040,40,40).
route(bus_40_7041,40,40).
route(bus_40_7042,40,40).
route(bus_40_7043,40,40).
route(bus_40_7044,40,40).
route(bus_40_7045,40,40).
route(bus_40_7046,40,40).
route(bus_40_7047,40,40).
route(bus_40_7048,40,40).
route(bus_40_7049,40,40).
route(bus_40_7050,40,40).
route(bus_40_7051,40,40).
route(bus_40_7052,40,40).
route(bus_40_7053,40,40).
route(bus_40_7054,40,40).
route(bus_40_7055,40,40).
route(bus_40_7056,40,40).
route(bus_40_7057,40,40).
route(bus_40_7058,40,40).
route(bus_40_7059,40,40).
route(bus_40_7060,40,40).
route(bus_40_7061,40,40).
route(bus_40_7062,40,40).
route(bus_40_7063,40,40).
route(bus_40_7064,40,40).
route(bus_40_7065,40,40).
route(bus_40_7066,40,40).
route(bus_40_7067,40,40).
route(bus_40_7068,40,40).
route(bus_40_7069,40,40).
route(bus_40_7070,40,40).
route(bus_40_7071,40,40).
route(bus_40_7072,40,40).
route(bus_40_7073,40,40).
route(bus_40_7074,40,40).
route(bus_40_7075,40,40).
route(bus_40_7076,40,40).
route(bus_40_7077,40,40).
route(bus_40_7078,40,40).
route(bus_40_7079,40,40).
route(bus_40_7080,40,40).
route(bus_40_7081,40,40).
route(bus_40_7082,40,40).
route(bus_40_7083,40,40).
route(bus_40_7084,40,40).
route(bus_40_7085,40,40).
route(bus_40_7086,40,40).
route(bus_40_7087,40,40).
route(bus_40_7088,40,40).
route(bus_40_7089,40,40).
route(bus_40_7090,40,40).
route(bus_40_7092,40,40).
route(bus_40_71,40,40).
route(bus_40_72,40,40).
route(bus_40_73,40,40).
route(bus_40_74,40,40).
route(bus_40_75,40,40).
route(bus_40_76,40,40).
route(bus_40_77,40,40).
route(bus_40_78,40,40).
route(bus_40_79,40,40).
route(bus_40_8,40,40).
route(bus_40_80,40,40).
route(bus_40_81,40,40).
route(bus_40_82,40,40).
route(bus_40_83,40,40).
route(bus_40_84,40,40).
route(bus_40_85,40,40).
route(bus_40_86,40,40).
route(bus_40_87,40,40).
route(bus_40_88,40,40).
route(bus_40_89,40,40).
route(bus_40_9,40,40).
route(bus_40_90,40,40).
route(bus_40_91,40,40).
route(bus_40_92,40,40).
route(bus_40_93,40,40).
route(bus_40_94,40,40).
route(bus_40_95,40,40).
route(bus_40_96,40,40).
route(bus_40_97,40,40).
route(bus_40_98,40,40).
route(bus_40_99,40,40).
route(bus_4101_9002,4101,4101).
route(bus_4101_9004,4101,4101).
route(bus_4101_9006,4101,4101).
route(bus_410_1,410,410).
route(bus_410_10,410,410).
route(bus_410_1001,410,410).
route(bus_410_1003,410,410).
route(bus_410_1004,410,410).
route(bus_410_1005,410,410).
route(bus_410_1006,410,410).
route(bus_410_1007,410,410).
route(bus_410_1008,410,410).
route(bus_410_1009,410,410).
route(bus_410_1010,410,410).
route(bus_410_1011,410,410).
route(bus_410_1012,410,410).
route(bus_410_1013,410,410).
route(bus_410_1015,410,410).
route(bus_410_1016,410,410).
route(bus_410_1017,410,410).
route(bus_410_1018,410,410).
route(bus_410_1019,410,410).
route(bus_410_1020,410,410).
route(bus_410_1022,410,410).
route(bus_410_1023,410,410).
route(bus_410_1025,410,410).
route(bus_410_1026,410,410).
route(bus_410_1028,410,410).
route(bus_410_1029,410,410).
route(bus_410_1030,410,410).
route(bus_410_1031,410,410).
route(bus_410_1032,410,410).
route(bus_410_1034,410,410).
route(bus_410_1040,410,410).
route(bus_410_11,410,410).
route(bus_410_12,410,410).
route(bus_410_13,410,410).
route(bus_410_15,410,410).
route(bus_410_16,410,410).
route(bus_410_17,410,410).
route(bus_410_18,410,410).
route(bus_410_19,410,410).
route(bus_410_2,410,410).
route(bus_410_20,410,410).
route(bus_410_21,410,410).
route(bus_410_22,410,410).
route(bus_410_23,410,410).
route(bus_410_24,410,410).
route(bus_410_25,410,410).
route(bus_410_26,410,410).
route(bus_410_27,410,410).
route(bus_410_28,410,410).
route(bus_410_29,410,410).
route(bus_410_3,410,410).
route(bus_410_30,410,410).
route(bus_410_31,410,410).
route(bus_410_32,410,410).
route(bus_410_34,410,410).
route(bus_410_36,410,410).
route(bus_410_4,410,410).
route(bus_410_5,410,410).
route(bus_410_6,410,410).
route(bus_410_6001,410,410).
route(bus_410_6002,410,410).
route(bus_410_6003,410,410).
route(bus_410_6004,410,410).
route(bus_410_6005,410,410).
route(bus_410_6006,410,410).
route(bus_410_6007,410,410).
route(bus_410_6008,410,410).
route(bus_410_6009,410,410).
route(bus_410_6010,410,410).
route(bus_410_6011,410,410).
route(bus_410_6012,410,410).
route(bus_410_6013,410,410).
route(bus_410_6014,410,410).
route(bus_410_6015,410,410).
route(bus_410_6016,410,410).
route(bus_410_6018,410,410).
route(bus_410_7,410,410).
route(bus_410_7001,410,410).
route(bus_410_7002,410,410).
route(bus_410_7003,410,410).
route(bus_410_7004,410,410).
route(bus_410_7005,410,410).
route(bus_410_7006,410,410).
route(bus_410_7007,410,410).
route(bus_410_7008,410,410).
route(bus_410_7009,410,410).
route(bus_410_7010,410,410).
route(bus_410_8,410,410).
route(bus_410_8001,410,410).
route(bus_410_8002,410,410).
route(bus_410_8003,410,410).
route(bus_410_8004,410,410).
route(bus_410_8005,410,410).
route(bus_410_8006,410,410).
route(bus_410_8007,410,410).
route(bus_410_8008,410,410).
route(bus_410_8009,410,410).
route(bus_410_8010,410,410).
route(bus_410_8011,410,410).
route(bus_410_8012,410,410).
route(bus_410_8013,410,410).
route(bus_410_8014,410,410).
route(bus_410_8015,410,410).
route(bus_410_8016,410,410).
route(bus_410_8018,410,410).
route(bus_410_9,410,410).
route(bus_410_9001,410,410).
route(bus_410_9002,410,410).
route(bus_410_9003,410,410).
route(bus_410_9004,410,410).
route(bus_410_9005,410,410).
route(bus_410_9006,410,410).
route(bus_410_9007,410,410).
route(bus_410_9008,410,410).
route(bus_410_9009,410,410).
route(bus_410_9010,410,410).
route(bus_41_1,41,41).
route(bus_41_10,41,41).
route(bus_41_100,41,41).
route(bus_41_101,41,41).
route(bus_41_102,41,41).
route(bus_41_103,41,41).
route(bus_41_105,41,41).
route(bus_41_107,41,41).
route(bus_41_109,41,41).
route(bus_41_11,41,41).
route(bus_41_111,41,41).
route(bus_41_12,41,41).
route(bus_41_13,41,41).
route(bus_41_14,41,41).
route(bus_41_149280,41,41).
route(bus_41_15,41,41).
route(bus_41_150280,41,41).
route(bus_41_16,41,41).
route(bus_41_17,41,41).
route(bus_41_18,41,41).
route(bus_41_19,41,41).
route(bus_41_2,41,41).
route(bus_41_20,41,41).
route(bus_41_21,41,41).
route(bus_41_22,41,41).
route(bus_41_23,41,41).
route(bus_41_24,41,41).
route(bus_41_25,41,41).
route(bus_41_26,41,41).
route(bus_41_27,41,41).
route(bus_41_28,41,41).
route(bus_41_29,41,41).
route(bus_41_3,41,41).
route(bus_41_30,41,41).
route(bus_41_31,41,41).
route(bus_41_32,41,41).
route(bus_41_33,41,41).
route(bus_41_34,41,41).
route(bus_41_35,41,41).
route(bus_41_36,41,41).
route(bus_41_37,41,41).
route(bus_41_38,41,41).
route(bus_41_39,41,41).
route(bus_41_4,41,41).
route(bus_41_40,41,41).
route(bus_41_41,41,41).
route(bus_41_42,41,41).
route(bus_41_43,41,41).
route(bus_41_44,41,41).
route(bus_41_45,41,41).
route(bus_41_46,41,41).
route(bus_41_47,41,41).
route(bus_41_48,41,41).
route(bus_41_49,41,41).
route(bus_41_5,41,41).
route(bus_41_50,41,41).
route(bus_41_51,41,41).
route(bus_41_52,41,41).
route(bus_41_53,41,41).
route(bus_41_54,41,41).
route(bus_41_55,41,41).
route(bus_41_56,41,41).
route(bus_41_57,41,41).
route(bus_41_58,41,41).
route(bus_41_59,41,41).
route(bus_41_6,41,41).
route(bus_41_60,41,41).
route(bus_41_6001,41,41).
route(bus_41_6002,41,41).
route(bus_41_6003,41,41).
route(bus_41_6004,41,41).
route(bus_41_6005,41,41).
route(bus_41_6006,41,41).
route(bus_41_6007,41,41).
route(bus_41_6008,41,41).
route(bus_41_6009,41,41).
route(bus_41_6010,41,41).
route(bus_41_6011,41,41).
route(bus_41_6012,41,41).
route(bus_41_6013,41,41).
route(bus_41_6014,41,41).
route(bus_41_6015,41,41).
route(bus_41_6016,41,41).
route(bus_41_6017,41,41).
route(bus_41_6018,41,41).
route(bus_41_6019,41,41).
route(bus_41_6020,41,41).
route(bus_41_6021,41,41).
route(bus_41_6022,41,41).
route(bus_41_6023,41,41).
route(bus_41_6024,41,41).
route(bus_41_6025,41,41).
route(bus_41_6026,41,41).
route(bus_41_6027,41,41).
route(bus_41_6028,41,41).
route(bus_41_6029,41,41).
route(bus_41_6030,41,41).
route(bus_41_6031,41,41).
route(bus_41_6032,41,41).
route(bus_41_6033,41,41).
route(bus_41_6034,41,41).
route(bus_41_6035,41,41).
route(bus_41_6036,41,41).
route(bus_41_6037,41,41).
route(bus_41_6038,41,41).
route(bus_41_6039,41,41).
route(bus_41_6040,41,41).
route(bus_41_6041,41,41).
route(bus_41_6042,41,41).
route(bus_41_6043,41,41).
route(bus_41_6044,41,41).
route(bus_41_6045,41,41).
route(bus_41_6046,41,41).
route(bus_41_6047,41,41).
route(bus_41_6048,41,41).
route(bus_41_6049,41,41).
route(bus_41_6050,41,41).
route(bus_41_6051,41,41).
route(bus_41_6052,41,41).
route(bus_41_6053,41,41).
route(bus_41_6054,41,41).
route(bus_41_6055,41,41).
route(bus_41_6056,41,41).
route(bus_41_6057,41,41).
route(bus_41_6058,41,41).
route(bus_41_6059,41,41).
route(bus_41_6060,41,41).
route(bus_41_6061,41,41).
route(bus_41_6062,41,41).
route(bus_41_6063,41,41).
route(bus_41_6064,41,41).
route(bus_41_6065,41,41).
route(bus_41_6066,41,41).
route(bus_41_6067,41,41).
route(bus_41_6068,41,41).
route(bus_41_6069,41,41).
route(bus_41_6070,41,41).
route(bus_41_6071,41,41).
route(bus_41_6072,41,41).
route(bus_41_6073,41,41).
route(bus_41_6074,41,41).
route(bus_41_6075,41,41).
route(bus_41_6076,41,41).
route(bus_41_6077,41,41).
route(bus_41_6078,41,41).
route(bus_41_6079,41,41).
route(bus_41_6080,41,41).
route(bus_41_6081,41,41).
route(bus_41_6082,41,41).
route(bus_41_6083,41,41).
route(bus_41_6084,41,41).
route(bus_41_6085,41,41).
route(bus_41_6086,41,41).
route(bus_41_6087,41,41).
route(bus_41_6088,41,41).
route(bus_41_6089,41,41).
route(bus_41_6090,41,41).
route(bus_41_6091,41,41).
route(bus_41_6092,41,41).
route(bus_41_6093,41,41).
route(bus_41_6095,41,41).
route(bus_41_61,41,41).
route(bus_41_62,41,41).
route(bus_41_63,41,41).
route(bus_41_64,41,41).
route(bus_41_65,41,41).
route(bus_41_66,41,41).
route(bus_41_67,41,41).
route(bus_41_68,41,41).
route(bus_41_69,41,41).
route(bus_41_7,41,41).
route(bus_41_70,41,41).
route(bus_41_7001,41,41).
route(bus_41_7002,41,41).
route(bus_41_7003,41,41).
route(bus_41_7004,41,41).
route(bus_41_7005,41,41).
route(bus_41_7006,41,41).
route(bus_41_7007,41,41).
route(bus_41_7008,41,41).
route(bus_41_7009,41,41).
route(bus_41_7010,41,41).
route(bus_41_7011,41,41).
route(bus_41_7012,41,41).
route(bus_41_7013,41,41).
route(bus_41_7014,41,41).
route(bus_41_7015,41,41).
route(bus_41_7016,41,41).
route(bus_41_7017,41,41).
route(bus_41_7018,41,41).
route(bus_41_7019,41,41).
route(bus_41_7020,41,41).
route(bus_41_7021,41,41).
route(bus_41_7022,41,41).
route(bus_41_7023,41,41).
route(bus_41_7024,41,41).
route(bus_41_7025,41,41).
route(bus_41_7026,41,41).
route(bus_41_7027,41,41).
route(bus_41_7028,41,41).
route(bus_41_7029,41,41).
route(bus_41_7030,41,41).
route(bus_41_7031,41,41).
route(bus_41_7032,41,41).
route(bus_41_7033,41,41).
route(bus_41_7034,41,41).
route(bus_41_7035,41,41).
route(bus_41_7036,41,41).
route(bus_41_7037,41,41).
route(bus_41_7038,41,41).
route(bus_41_7039,41,41).
route(bus_41_7040,41,41).
route(bus_41_7041,41,41).
route(bus_41_7042,41,41).
route(bus_41_7043,41,41).
route(bus_41_7044,41,41).
route(bus_41_7045,41,41).
route(bus_41_71,41,41).
route(bus_41_72,41,41).
route(bus_41_73,41,41).
route(bus_41_74,41,41).
route(bus_41_75,41,41).
route(bus_41_76,41,41).
route(bus_41_77,41,41).
route(bus_41_78,41,41).
route(bus_41_79,41,41).
route(bus_41_8,41,41).
route(bus_41_80,41,41).
route(bus_41_81,41,41).
route(bus_41_82,41,41).
route(bus_41_83,41,41).
route(bus_41_84,41,41).
route(bus_41_85,41,41).
route(bus_41_86,41,41).
route(bus_41_87,41,41).
route(bus_41_88,41,41).
route(bus_41_89,41,41).
route(bus_41_9,41,41).
route(bus_41_90,41,41).
route(bus_41_91,41,41).
route(bus_41_92,41,41).
route(bus_41_93,41,41).
route(bus_41_94,41,41).
route(bus_41_95,41,41).
route(bus_41_96,41,41).
route(bus_41_97,41,41).
route(bus_41_98,41,41).
route(bus_41_99,41,41).
route(bus_420_1,420,420).
route(bus_420_10,420,420).
route(bus_420_1001,420,420).
route(bus_420_1003,420,420).
route(bus_420_1005,420,420).
route(bus_420_1006,420,420).
route(bus_420_1009,420,420).
route(bus_420_1010,420,420).
route(bus_420_1014,420,420).
route(bus_420_1016,420,420).
route(bus_420_1019,420,420).
route(bus_420_1022,420,420).
route(bus_420_11,420,420).
route(bus_420_12,420,420).
route(bus_420_13,420,420).
route(bus_420_14,420,420).
route(bus_420_15,420,420).
route(bus_420_16,420,420).
route(bus_420_18,420,420).
route(bus_420_19,420,420).
route(bus_420_2,420,420).
route(bus_420_20,420,420).
route(bus_420_21,420,420).
route(bus_420_22,420,420).
route(bus_420_23,420,420).
route(bus_420_24,420,420).
route(bus_420_3,420,420).
route(bus_420_4,420,420).
route(bus_420_5,420,420).
route(bus_420_6,420,420).
route(bus_420_6001,420,420).
route(bus_420_6002,420,420).
route(bus_420_6003,420,420).
route(bus_420_6004,420,420).
route(bus_420_7,420,420).
route(bus_420_7001,420,420).
route(bus_420_7002,420,420).
route(bus_420_7003,420,420).
route(bus_420_7004,420,420).
route(bus_420_7006,420,420).
route(bus_420_8001,420,420).
route(bus_420_8002,420,420).
route(bus_420_9,420,420).
route(bus_420_9002,420,420).
route(bus_420_9003,420,420).
route(bus_420_9004,420,420).
route(bus_421_1,421,421).
route(bus_421_10,421,421).
route(bus_421_1003,421,421).
route(bus_421_1010,421,421).
route(bus_421_1012,421,421).
route(bus_421_12,421,421).
route(bus_421_2,421,421).
route(bus_421_3,421,421).
route(bus_421_4,421,421).
route(bus_421_5,421,421).
route(bus_421_6,421,421).
route(bus_421_7,421,421).
route(bus_42_1,42,42).
route(bus_42_10,42,42).
route(bus_42_100,42,42).
route(bus_42_101,42,42).
route(bus_42_102,42,42).
route(bus_42_103,42,42).
route(bus_42_104,42,42).
route(bus_42_105,42,42).
route(bus_42_106,42,42).
route(bus_42_107,42,42).
route(bus_42_108,42,42).
route(bus_42_109,42,42).
route(bus_42_11,42,42).
route(bus_42_110,42,42).
route(bus_42_111,42,42).
route(bus_42_112,42,42).
route(bus_42_113,42,42).
route(bus_42_114,42,42).
route(bus_42_115,42,42).
route(bus_42_116,42,42).
route(bus_42_117,42,42).
route(bus_42_118,42,42).
route(bus_42_119,42,42).
route(bus_42_12,42,42).
route(bus_42_120,42,42).
route(bus_42_121,42,42).
route(bus_42_122,42,42).
route(bus_42_13,42,42).
route(bus_42_14,42,42).
route(bus_42_15,42,42).
route(bus_42_16,42,42).
route(bus_42_17,42,42).
route(bus_42_18,42,42).
route(bus_42_19,42,42).
route(bus_42_2,42,42).
route(bus_42_20,42,42).
route(bus_42_21,42,42).
route(bus_42_22,42,42).
route(bus_42_23,42,42).
route(bus_42_24,42,42).
route(bus_42_25,42,42).
route(bus_42_26,42,42).
route(bus_42_27,42,42).
route(bus_42_28,42,42).
route(bus_42_29,42,42).
route(bus_42_3,42,42).
route(bus_42_30,42,42).
route(bus_42_31,42,42).
route(bus_42_32,42,42).
route(bus_42_33,42,42).
route(bus_42_34,42,42).
route(bus_42_35,42,42).
route(bus_42_36,42,42).
route(bus_42_37,42,42).
route(bus_42_38,42,42).
route(bus_42_39,42,42).
route(bus_42_4,42,42).
route(bus_42_40,42,42).
route(bus_42_41,42,42).
route(bus_42_42,42,42).
route(bus_42_43,42,42).
route(bus_42_44,42,42).
route(bus_42_45,42,42).
route(bus_42_46,42,42).
route(bus_42_47,42,42).
route(bus_42_48,42,42).
route(bus_42_49,42,42).
route(bus_42_5,42,42).
route(bus_42_50,42,42).
route(bus_42_51,42,42).
route(bus_42_52,42,42).
route(bus_42_53,42,42).
route(bus_42_54,42,42).
route(bus_42_55,42,42).
route(bus_42_56,42,42).
route(bus_42_57,42,42).
route(bus_42_58,42,42).
route(bus_42_59,42,42).
route(bus_42_6,42,42).
route(bus_42_60,42,42).
route(bus_42_6001,42,42).
route(bus_42_6002,42,42).
route(bus_42_6003,42,42).
route(bus_42_6004,42,42).
route(bus_42_6005,42,42).
route(bus_42_6006,42,42).
route(bus_42_6007,42,42).
route(bus_42_6008,42,42).
route(bus_42_6009,42,42).
route(bus_42_6010,42,42).
route(bus_42_6011,42,42).
route(bus_42_6012,42,42).
route(bus_42_6013,42,42).
route(bus_42_6014,42,42).
route(bus_42_6015,42,42).
route(bus_42_6016,42,42).
route(bus_42_6017,42,42).
route(bus_42_6018,42,42).
route(bus_42_6019,42,42).
route(bus_42_6020,42,42).
route(bus_42_6021,42,42).
route(bus_42_6022,42,42).
route(bus_42_6023,42,42).
route(bus_42_6024,42,42).
route(bus_42_6025,42,42).
route(bus_42_6026,42,42).
route(bus_42_6027,42,42).
route(bus_42_6028,42,42).
route(bus_42_6029,42,42).
route(bus_42_6030,42,42).
route(bus_42_6031,42,42).
route(bus_42_6032,42,42).
route(bus_42_6033,42,42).
route(bus_42_6034,42,42).
route(bus_42_6035,42,42).
route(bus_42_6036,42,42).
route(bus_42_6037,42,42).
route(bus_42_6038,42,42).
route(bus_42_6039,42,42).
route(bus_42_6040,42,42).
route(bus_42_6041,42,42).
route(bus_42_6042,42,42).
route(bus_42_6043,42,42).
route(bus_42_6044,42,42).
route(bus_42_6045,42,42).
route(bus_42_6046,42,42).
route(bus_42_6047,42,42).
route(bus_42_6048,42,42).
route(bus_42_6049,42,42).
route(bus_42_6050,42,42).
route(bus_42_6051,42,42).
route(bus_42_6052,42,42).
route(bus_42_6053,42,42).
route(bus_42_6054,42,42).
route(bus_42_6055,42,42).
route(bus_42_6056,42,42).
route(bus_42_6057,42,42).
route(bus_42_6058,42,42).
route(bus_42_6059,42,42).
route(bus_42_6060,42,42).
route(bus_42_6061,42,42).
route(bus_42_6062,42,42).
route(bus_42_6063,42,42).
route(bus_42_6064,42,42).
route(bus_42_6065,42,42).
route(bus_42_6066,42,42).
route(bus_42_6067,42,42).
route(bus_42_6068,42,42).
route(bus_42_6069,42,42).
route(bus_42_6070,42,42).
route(bus_42_6071,42,42).
route(bus_42_6072,42,42).
route(bus_42_6073,42,42).
route(bus_42_6074,42,42).
route(bus_42_6075,42,42).
route(bus_42_6076,42,42).
route(bus_42_6077,42,42).
route(bus_42_6078,42,42).
route(bus_42_6079,42,42).
route(bus_42_6080,42,42).
route(bus_42_6081,42,42).
route(bus_42_6082,42,42).
route(bus_42_6083,42,42).
route(bus_42_6084,42,42).
route(bus_42_6085,42,42).
route(bus_42_6086,42,42).
route(bus_42_6087,42,42).
route(bus_42_6088,42,42).
route(bus_42_6089,42,42).
route(bus_42_6090,42,42).
route(bus_42_6091,42,42).
route(bus_42_6092,42,42).
route(bus_42_6093,42,42).
route(bus_42_6094,42,42).
route(bus_42_6095,42,42).
route(bus_42_6096,42,42).
route(bus_42_6097,42,42).
route(bus_42_6098,42,42).
route(bus_42_6099,42,42).
route(bus_42_61,42,42).
route(bus_42_6100,42,42).
route(bus_42_6101,42,42).
route(bus_42_6102,42,42).
route(bus_42_6103,42,42).
route(bus_42_6104,42,42).
route(bus_42_6105,42,42).
route(bus_42_6106,42,42).
route(bus_42_6107,42,42).
route(bus_42_6108,42,42).
route(bus_42_6109,42,42).
route(bus_42_6110,42,42).
route(bus_42_62,42,42).
route(bus_42_63,42,42).
route(bus_42_64,42,42).
route(bus_42_65,42,42).
route(bus_42_66,42,42).
route(bus_42_67,42,42).
route(bus_42_68,42,42).
route(bus_42_69,42,42).
route(bus_42_7,42,42).
route(bus_42_70,42,42).
route(bus_42_7001,42,42).
route(bus_42_7002,42,42).
route(bus_42_7003,42,42).
route(bus_42_7004,42,42).
route(bus_42_7005,42,42).
route(bus_42_7006,42,42).
route(bus_42_7007,42,42).
route(bus_42_7008,42,42).
route(bus_42_7009,42,42).
route(bus_42_7010,42,42).
route(bus_42_7011,42,42).
route(bus_42_7012,42,42).
route(bus_42_7013,42,42).
route(bus_42_7014,42,42).
route(bus_42_7015,42,42).
route(bus_42_7016,42,42).
route(bus_42_7017,42,42).
route(bus_42_7018,42,42).
route(bus_42_7019,42,42).
route(bus_42_7020,42,42).
route(bus_42_7021,42,42).
route(bus_42_7022,42,42).
route(bus_42_7023,42,42).
route(bus_42_7024,42,42).
route(bus_42_7025,42,42).
route(bus_42_7026,42,42).
route(bus_42_7027,42,42).
route(bus_42_7028,42,42).
route(bus_42_7029,42,42).
route(bus_42_7030,42,42).
route(bus_42_7031,42,42).
route(bus_42_7032,42,42).
route(bus_42_7033,42,42).
route(bus_42_7034,42,42).
route(bus_42_7035,42,42).
route(bus_42_7036,42,42).
route(bus_42_7037,42,42).
route(bus_42_7038,42,42).
route(bus_42_7039,42,42).
route(bus_42_7040,42,42).
route(bus_42_7041,42,42).
route(bus_42_7042,42,42).
route(bus_42_7043,42,42).
route(bus_42_7044,42,42).
route(bus_42_7045,42,42).
route(bus_42_7046,42,42).
route(bus_42_7047,42,42).
route(bus_42_7048,42,42).
route(bus_42_7049,42,42).
route(bus_42_7050,42,42).
route(bus_42_7051,42,42).
route(bus_42_7052,42,42).
route(bus_42_7053,42,42).
route(bus_42_7054,42,42).
route(bus_42_7055,42,42).
route(bus_42_7056,42,42).
route(bus_42_7057,42,42).
route(bus_42_7058,42,42).
route(bus_42_7059,42,42).
route(bus_42_7060,42,42).
route(bus_42_7061,42,42).
route(bus_42_7062,42,42).
route(bus_42_7063,42,42).
route(bus_42_7064,42,42).
route(bus_42_7065,42,42).
route(bus_42_7066,42,42).
route(bus_42_7067,42,42).
route(bus_42_7068,42,42).
route(bus_42_7069,42,42).
route(bus_42_7070,42,42).
route(bus_42_7071,42,42).
route(bus_42_7072,42,42).
route(bus_42_7073,42,42).
route(bus_42_7074,42,42).
route(bus_42_7075,42,42).
route(bus_42_7076,42,42).
route(bus_42_7077,42,42).
route(bus_42_7078,42,42).
route(bus_42_7079,42,42).
route(bus_42_7080,42,42).
route(bus_42_7081,42,42).
route(bus_42_7082,42,42).
route(bus_42_7083,42,42).
route(bus_42_7084,42,42).
route(bus_42_7085,42,42).
route(bus_42_7086,42,42).
route(bus_42_7087,42,42).
route(bus_42_7088,42,42).
route(bus_42_7089,42,42).
route(bus_42_7090,42,42).
route(bus_42_7091,42,42).
route(bus_42_7092,42,42).
route(bus_42_7094,42,42).
route(bus_42_71,42,42).
route(bus_42_72,42,42).
route(bus_42_73,42,42).
route(bus_42_74,42,42).
route(bus_42_75,42,42).
route(bus_42_76,42,42).
route(bus_42_77,42,42).
route(bus_42_78,42,42).
route(bus_42_79,42,42).
route(bus_42_8,42,42).
route(bus_42_80,42,42).
route(bus_42_81,42,42).
route(bus_42_82,42,42).
route(bus_42_83,42,42).
route(bus_42_84,42,42).
route(bus_42_85,42,42).
route(bus_42_86,42,42).
route(bus_42_87,42,42).
route(bus_42_88,42,42).
route(bus_42_89,42,42).
route(bus_42_9,42,42).
route(bus_42_90,42,42).
route(bus_42_91,42,42).
route(bus_42_92,42,42).
route(bus_42_93,42,42).
route(bus_42_94,42,42).
route(bus_42_95,42,42).
route(bus_42_96,42,42).
route(bus_42_97,42,42).
route(bus_42_98,42,42).
route(bus_42_99,42,42).
route(bus_43_1,43,43).
route(bus_43_10,43,43).
route(bus_43_11,43,43).
route(bus_43_12,43,43).
route(bus_43_13,43,43).
route(bus_43_14,43,43).
route(bus_43_15,43,43).
route(bus_43_16,43,43).
route(bus_43_17,43,43).
route(bus_43_18,43,43).
route(bus_43_19,43,43).
route(bus_43_2,43,43).
route(bus_43_20,43,43).
route(bus_43_21,43,43).
route(bus_43_22,43,43).
route(bus_43_23,43,43).
route(bus_43_24,43,43).
route(bus_43_25,43,43).
route(bus_43_26,43,43).
route(bus_43_27,43,43).
route(bus_43_28,43,43).
route(bus_43_29,43,43).
route(bus_43_3,43,43).
route(bus_43_30,43,43).
route(bus_43_31,43,43).
route(bus_43_32,43,43).
route(bus_43_33,43,43).
route(bus_43_34,43,43).
route(bus_43_35,43,43).
route(bus_43_36,43,43).
route(bus_43_37,43,43).
route(bus_43_38,43,43).
route(bus_43_39,43,43).
route(bus_43_4,43,43).
route(bus_43_40,43,43).
route(bus_43_41,43,43).
route(bus_43_42,43,43).
route(bus_43_43,43,43).
route(bus_43_44,43,43).
route(bus_43_45,43,43).
route(bus_43_46,43,43).
route(bus_43_47,43,43).
route(bus_43_48,43,43).
route(bus_43_49,43,43).
route(bus_43_5,43,43).
route(bus_43_50,43,43).
route(bus_43_51,43,43).
route(bus_43_52,43,43).
route(bus_43_53,43,43).
route(bus_43_54,43,43).
route(bus_43_55,43,43).
route(bus_43_56,43,43).
route(bus_43_57,43,43).
route(bus_43_58,43,43).
route(bus_43_59,43,43).
route(bus_43_6,43,43).
route(bus_43_60,43,43).
route(bus_43_6001,43,43).
route(bus_43_6002,43,43).
route(bus_43_6003,43,43).
route(bus_43_6004,43,43).
route(bus_43_6005,43,43).
route(bus_43_6006,43,43).
route(bus_43_6007,43,43).
route(bus_43_6008,43,43).
route(bus_43_6009,43,43).
route(bus_43_6010,43,43).
route(bus_43_6011,43,43).
route(bus_43_6012,43,43).
route(bus_43_6013,43,43).
route(bus_43_6014,43,43).
route(bus_43_6015,43,43).
route(bus_43_6016,43,43).
route(bus_43_6017,43,43).
route(bus_43_6018,43,43).
route(bus_43_6019,43,43).
route(bus_43_6020,43,43).
route(bus_43_6021,43,43).
route(bus_43_6022,43,43).
route(bus_43_6023,43,43).
route(bus_43_6024,43,43).
route(bus_43_6025,43,43).
route(bus_43_6026,43,43).
route(bus_43_6027,43,43).
route(bus_43_6028,43,43).
route(bus_43_6029,43,43).
route(bus_43_6030,43,43).
route(bus_43_6031,43,43).
route(bus_43_6032,43,43).
route(bus_43_6033,43,43).
route(bus_43_6034,43,43).
route(bus_43_6035,43,43).
route(bus_43_6036,43,43).
route(bus_43_6037,43,43).
route(bus_43_6038,43,43).
route(bus_43_6039,43,43).
route(bus_43_6040,43,43).
route(bus_43_6041,43,43).
route(bus_43_6042,43,43).
route(bus_43_6043,43,43).
route(bus_43_6044,43,43).
route(bus_43_6045,43,43).
route(bus_43_6046,43,43).
route(bus_43_6047,43,43).
route(bus_43_6048,43,43).
route(bus_43_6049,43,43).
route(bus_43_6050,43,43).
route(bus_43_6051,43,43).
route(bus_43_6052,43,43).
route(bus_43_61,43,43).
route(bus_43_62,43,43).
route(bus_43_63,43,43).
route(bus_43_64,43,43).
route(bus_43_65,43,43).
route(bus_43_66,43,43).
route(bus_43_67,43,43).
route(bus_43_68,43,43).
route(bus_43_69,43,43).
route(bus_43_7,43,43).
route(bus_43_70,43,43).
route(bus_43_7001,43,43).
route(bus_43_7002,43,43).
route(bus_43_7003,43,43).
route(bus_43_7004,43,43).
route(bus_43_7005,43,43).
route(bus_43_7006,43,43).
route(bus_43_7007,43,43).
route(bus_43_7008,43,43).
route(bus_43_7009,43,43).
route(bus_43_7010,43,43).
route(bus_43_7011,43,43).
route(bus_43_7012,43,43).
route(bus_43_7013,43,43).
route(bus_43_7014,43,43).
route(bus_43_7015,43,43).
route(bus_43_7016,43,43).
route(bus_43_7017,43,43).
route(bus_43_7018,43,43).
route(bus_43_7019,43,43).
route(bus_43_7020,43,43).
route(bus_43_7021,43,43).
route(bus_43_7022,43,43).
route(bus_43_7023,43,43).
route(bus_43_7024,43,43).
route(bus_43_7025,43,43).
route(bus_43_7026,43,43).
route(bus_43_7027,43,43).
route(bus_43_7028,43,43).
route(bus_43_7029,43,43).
route(bus_43_7030,43,43).
route(bus_43_7031,43,43).
route(bus_43_7032,43,43).
route(bus_43_7033,43,43).
route(bus_43_7034,43,43).
route(bus_43_7035,43,43).
route(bus_43_7036,43,43).
route(bus_43_7037,43,43).
route(bus_43_7038,43,43).
route(bus_43_7039,43,43).
route(bus_43_71,43,43).
route(bus_43_72,43,43).
route(bus_43_73,43,43).
route(bus_43_74,43,43).
route(bus_43_75,43,43).
route(bus_43_76,43,43).
route(bus_43_8,43,43).
route(bus_43_9,43,43).
route(bus_440_1,440,440).
route(bus_440_1001,440,440).
route(bus_440_1002,440,440).
route(bus_440_1006,440,440).
route(bus_440_1007,440,440).
route(bus_440_1008,440,440).
route(bus_440_1009,440,440).
route(bus_440_1012,440,440).
route(bus_440_1017,440,440).
route(bus_440_1020,440,440).
route(bus_440_1022,440,440).
route(bus_440_1023,440,440).
route(bus_440_1024,440,440).
route(bus_440_1025,440,440).
route(bus_440_1026,440,440).
route(bus_440_1027,440,440).
route(bus_440_1029,440,440).
route(bus_440_1030,440,440).
route(bus_440_1031,440,440).
route(bus_440_1035,440,440).
route(bus_440_11,440,440).
route(bus_440_12,440,440).
route(bus_440_14,440,440).
route(bus_440_17,440,440).
route(bus_440_18,440,440).
route(bus_440_19,440,440).
route(bus_440_2,440,440).
route(bus_440_20,440,440).
route(bus_440_22,440,440).
route(bus_440_23,440,440).
route(bus_440_24,440,440).
route(bus_440_25,440,440).
route(bus_440_26,440,440).
route(bus_440_27,440,440).
route(bus_440_29,440,440).
route(bus_440_3,440,440).
route(bus_440_30,440,440).
route(bus_440_31,440,440).
route(bus_440_32,440,440).
route(bus_440_34,440,440).
route(bus_440_35,440,440).
route(bus_440_5,440,440).
route(bus_440_6,440,440).
route(bus_440_6001,440,440).
route(bus_440_6004,440,440).
route(bus_440_6005,440,440).
route(bus_440_6008,440,440).
route(bus_440_6009,440,440).
route(bus_440_6010,440,440).
route(bus_440_6011,440,440).
route(bus_440_6012,440,440).
route(bus_440_6013,440,440).
route(bus_440_7,440,440).
route(bus_440_7001,440,440).
route(bus_440_7002,440,440).
route(bus_440_8,440,440).
route(bus_440_8001,440,440).
route(bus_440_8004,440,440).
route(bus_440_8005,440,440).
route(bus_440_8008,440,440).
route(bus_440_8009,440,440).
route(bus_440_8010,440,440).
route(bus_440_8013,440,440).
route(bus_440_9,440,440).
route(bus_440_9001,440,440).
route(bus_440_9002,440,440).
route(bus_44_1,44,44).
route(bus_44_10,44,44).
route(bus_44_1002711,44,44).
route(bus_44_1012712,44,44).
route(bus_44_11,44,44).
route(bus_44_12,44,44).
route(bus_44_13,44,44).
route(bus_44_14,44,44).
route(bus_44_15,44,44).
route(bus_44_16,44,44).
route(bus_44_17,44,44).
route(bus_44_18,44,44).
route(bus_44_19,44,44).
route(bus_44_2,44,44).
route(bus_44_20,44,44).
route(bus_44_21,44,44).
route(bus_44_22,44,44).
route(bus_44_23,44,44).
route(bus_44_24,44,44).
route(bus_44_25,44,44).
route(bus_44_26,44,44).
route(bus_44_27,44,44).
route(bus_44_28,44,44).
route(bus_44_29,44,44).
route(bus_44_3,44,44).
route(bus_44_30,44,44).
route(bus_44_31,44,44).
route(bus_44_32,44,44).
route(bus_44_33,44,44).
route(bus_44_34,44,44).
route(bus_44_35,44,44).
route(bus_44_36,44,44).
route(bus_44_37,44,44).
route(bus_44_38,44,44).
route(bus_44_39,44,44).
route(bus_44_4,44,44).
route(bus_44_40,44,44).
route(bus_44_42,44,44).
route(bus_44_44,44,44).
route(bus_44_46,44,44).
route(bus_44_48,44,44).
route(bus_44_5,44,44).
route(bus_44_50,44,44).
route(bus_44_52,44,44).
route(bus_44_6,44,44).
route(bus_44_6001,44,44).
route(bus_44_6002,44,44).
route(bus_44_6003,44,44).
route(bus_44_6004,44,44).
route(bus_44_6005,44,44).
route(bus_44_6006,44,44).
route(bus_44_6007,44,44).
route(bus_44_6008,44,44).
route(bus_44_6009,44,44).
route(bus_44_6010,44,44).
route(bus_44_6011,44,44).
route(bus_44_6012,44,44).
route(bus_44_6013,44,44).
route(bus_44_6014,44,44).
route(bus_44_6015,44,44).
route(bus_44_6016,44,44).
route(bus_44_6017,44,44).
route(bus_44_6018,44,44).
route(bus_44_6019,44,44).
route(bus_44_6020,44,44).
route(bus_44_6021,44,44).
route(bus_44_6022,44,44).
route(bus_44_6023,44,44).
route(bus_44_6024,44,44).
route(bus_44_6025,44,44).
route(bus_44_6026,44,44).
route(bus_44_6027,44,44).
route(bus_44_6028,44,44).
route(bus_44_6029,44,44).
route(bus_44_6030,44,44).
route(bus_44_6031,44,44).
route(bus_44_6032,44,44).
route(bus_44_6033,44,44).
route(bus_44_7,44,44).
route(bus_44_7000,44,44).
route(bus_44_7001,44,44).
route(bus_44_7002,44,44).
route(bus_44_7003,44,44).
route(bus_44_7004,44,44).
route(bus_44_7005,44,44).
route(bus_44_7006,44,44).
route(bus_44_7007,44,44).
route(bus_44_7008,44,44).
route(bus_44_7009,44,44).
route(bus_44_7010,44,44).
route(bus_44_7011,44,44).
route(bus_44_7012,44,44).
route(bus_44_7013,44,44).
route(bus_44_7014,44,44).
route(bus_44_7015,44,44).
route(bus_44_7016,44,44).
route(bus_44_7017,44,44).
route(bus_44_7018,44,44).
route(bus_44_7019,44,44).
route(bus_44_7020,44,44).
route(bus_44_7021,44,44).
route(bus_44_7022,44,44).
route(bus_44_7023,44,44).
route(bus_44_7024,44,44).
route(bus_44_7025,44,44).
route(bus_44_7026,44,44).
route(bus_44_7027,44,44).
route(bus_44_7029,44,44).
route(bus_44_8,44,44).
route(bus_44_9,44,44).
route(bus_450_1,450,450).
route(bus_450_10,450,450).
route(bus_450_1001,450,450).
route(bus_450_1002,450,450).
route(bus_450_1003,450,450).
route(bus_450_1004,450,450).
route(bus_450_1006,450,450).
route(bus_450_1007,450,450).
route(bus_450_1009,450,450).
route(bus_450_1010,450,450).
route(bus_450_1012,450,450).
route(bus_450_1013,450,450).
route(bus_450_1014,450,450).
route(bus_450_1015,450,450).
route(bus_450_1017,450,450).
route(bus_450_1019,450,450).
route(bus_450_1020,450,450).
route(bus_450_1021,450,450).
route(bus_450_11,450,450).
route(bus_450_12,450,450).
route(bus_450_13,450,450).
route(bus_450_14,450,450).
route(bus_450_15,450,450).
route(bus_450_17,450,450).
route(bus_450_19,450,450).
route(bus_450_2,450,450).
route(bus_450_20,450,450).
route(bus_450_21,450,450).
route(bus_450_3,450,450).
route(bus_450_4,450,450).
route(bus_450_5,450,450).
route(bus_450_6,450,450).
route(bus_450_7,450,450).
route(bus_450_7001,450,450).
route(bus_450_7002,450,450).
route(bus_450_8,450,450).
route(bus_450_9,450,450).
route(bus_450_9001,450,450).
route(bus_450_9002,450,450).
route(bus_451_1,451,451).
route(bus_451_10,451,451).
route(bus_451_1002,451,451).
route(bus_451_1003,451,451).
route(bus_451_1005,451,451).
route(bus_451_1006,451,451).
route(bus_451_1007,451,451).
route(bus_451_1008,451,451).
route(bus_451_1009,451,451).
route(bus_451_1011,451,451).
route(bus_451_1013,451,451).
route(bus_451_1014,451,451).
route(bus_451_1015,451,451).
route(bus_451_1018,451,451).
route(bus_451_1020,451,451).
route(bus_451_1022,451,451).
route(bus_451_1024,451,451).
route(bus_451_11,451,451).
route(bus_451_12,451,451).
route(bus_451_13,451,451).
route(bus_451_14,451,451).
route(bus_451_15,451,451).
route(bus_451_16,451,451).
route(bus_451_17,451,451).
route(bus_451_18,451,451).
route(bus_451_2,451,451).
route(bus_451_20,451,451).
route(bus_451_22,451,451).
route(bus_451_24,451,451).
route(bus_451_3,451,451).
route(bus_451_4,451,451).
route(bus_451_5,451,451).
route(bus_451_6,451,451).
route(bus_451_7,451,451).
route(bus_451_7001,451,451).
route(bus_451_7002,451,451).
route(bus_451_7004,451,451).
route(bus_451_8,451,451).
route(bus_451_9,451,451).
route(bus_453_1,453,453).
route(bus_453_12,453,453).
route(bus_453_14,453,453).
route(bus_453_16,453,453).
route(bus_453_2,453,453).
route(bus_453_3,453,453).
route(bus_453_4,453,453).
route(bus_453_5,453,453).
route(bus_453_6,453,453).
route(bus_453_7,453,453).
route(bus_453_8,453,453).
route(bus_455_1,455,455).
route(bus_455_10,455,455).
route(bus_455_1001,455,455).
route(bus_455_1002,455,455).
route(bus_455_1003,455,455).
route(bus_455_1004,455,455).
route(bus_455_1005,455,455).
route(bus_455_1006,455,455).
route(bus_455_1007,455,455).
route(bus_455_1008,455,455).
route(bus_455_1009,455,455).
route(bus_455_1010,455,455).
route(bus_455_1011,455,455).
route(bus_455_11,455,455).
route(bus_455_12,455,455).
route(bus_455_14,455,455).
route(bus_455_16,455,455).
route(bus_455_2,455,455).
route(bus_455_3,455,455).
route(bus_455_38,455,455).
route(bus_455_4,455,455).
route(bus_455_5,455,455).
route(bus_455_6,455,455).
route(bus_455_7,455,455).
route(bus_455_7001,455,455).
route(bus_455_7002,455,455).
route(bus_455_7003,455,455).
route(bus_455_7004,455,455).
route(bus_455_8,455,455).
route(bus_455_9,455,455).
route(bus_455_9001,455,455).
route(bus_455_9002,455,455).
route(bus_45_1,45,45).
route(bus_45_10,45,45).
route(bus_45_100,45,45).
route(bus_45_101,45,45).
route(bus_45_102,45,45).
route(bus_45_103,45,45).
route(bus_45_104,45,45).
route(bus_45_105,45,45).
route(bus_45_106,45,45).
route(bus_45_107,45,45).
route(bus_45_108,45,45).
route(bus_45_109,45,45).
route(bus_45_11,45,45).
route(bus_45_110,45,45).
route(bus_45_111,45,45).
route(bus_45_112,45,45).
route(bus_45_113,45,45).
route(bus_45_114,45,45).
route(bus_45_115,45,45).
route(bus_45_116,45,45).
route(bus_45_117,45,45).
route(bus_45_118,45,45).
route(bus_45_119,45,45).
route(bus_45_12,45,45).
route(bus_45_120,45,45).
route(bus_45_121,45,45).
route(bus_45_122,45,45).
route(bus_45_123,45,45).
route(bus_45_124,45,45).
route(bus_45_125,45,45).
route(bus_45_126,45,45).
route(bus_45_127,45,45).
route(bus_45_128,45,45).
route(bus_45_129,45,45).
route(bus_45_13,45,45).
route(bus_45_130,45,45).
route(bus_45_131,45,45).
route(bus_45_132,45,45).
route(bus_45_133,45,45).
route(bus_45_134,45,45).
route(bus_45_135,45,45).
route(bus_45_136,45,45).
route(bus_45_137,45,45).
route(bus_45_138,45,45).
route(bus_45_139,45,45).
route(bus_45_14,45,45).
route(bus_45_140,45,45).
route(bus_45_141,45,45).
route(bus_45_142,45,45).
route(bus_45_143,45,45).
route(bus_45_144,45,45).
route(bus_45_145,45,45).
route(bus_45_146,45,45).
route(bus_45_147,45,45).
route(bus_45_148,45,45).
route(bus_45_149,45,45).
route(bus_45_15,45,45).
route(bus_45_150,45,45).
route(bus_45_151,45,45).
route(bus_45_152,45,45).
route(bus_45_153,45,45).
route(bus_45_154,45,45).
route(bus_45_155,45,45).
route(bus_45_156,45,45).
route(bus_45_157,45,45).
route(bus_45_158,45,45).
route(bus_45_159,45,45).
route(bus_45_16,45,45).
route(bus_45_160,45,45).
route(bus_45_161,45,45).
route(bus_45_162,45,45).
route(bus_45_163,45,45).
route(bus_45_164,45,45).
route(bus_45_165,45,45).
route(bus_45_166,45,45).
route(bus_45_167,45,45).
route(bus_45_168,45,45).
route(bus_45_169,45,45).
route(bus_45_17,45,45).
route(bus_45_170,45,45).
route(bus_45_171,45,45).
route(bus_45_172,45,45).
route(bus_45_173,45,45).
route(bus_45_174,45,45).
route(bus_45_175,45,45).
route(bus_45_176,45,45).
route(bus_45_177,45,45).
route(bus_45_178,45,45).
route(bus_45_179,45,45).
route(bus_45_18,45,45).
route(bus_45_180,45,45).
route(bus_45_181,45,45).
route(bus_45_182,45,45).
route(bus_45_183,45,45).
route(bus_45_184,45,45).
route(bus_45_185,45,45).
route(bus_45_186,45,45).
route(bus_45_187,45,45).
route(bus_45_188,45,45).
route(bus_45_189,45,45).
route(bus_45_19,45,45).
route(bus_45_190,45,45).
route(bus_45_191,45,45).
route(bus_45_192,45,45).
route(bus_45_193,45,45).
route(bus_45_194,45,45).
route(bus_45_195,45,45).
route(bus_45_196,45,45).
route(bus_45_197,45,45).
route(bus_45_198,45,45).
route(bus_45_199,45,45).
route(bus_45_2,45,45).
route(bus_45_20,45,45).
route(bus_45_200,45,45).
route(bus_45_201,45,45).
route(bus_45_202,45,45).
route(bus_45_203,45,45).
route(bus_45_204,45,45).
route(bus_45_205,45,45).
route(bus_45_206,45,45).
route(bus_45_207,45,45).
route(bus_45_208,45,45).
route(bus_45_21,45,45).
route(bus_45_22,45,45).
route(bus_45_23,45,45).
route(bus_45_24,45,45).
route(bus_45_25,45,45).
route(bus_45_26,45,45).
route(bus_45_27,45,45).
route(bus_45_28,45,45).
route(bus_45_29,45,45).
route(bus_45_3,45,45).
route(bus_45_30,45,45).
route(bus_45_31,45,45).
route(bus_45_32,45,45).
route(bus_45_33,45,45).
route(bus_45_34,45,45).
route(bus_45_35,45,45).
route(bus_45_36,45,45).
route(bus_45_37,45,45).
route(bus_45_38,45,45).
route(bus_45_39,45,45).
route(bus_45_4,45,45).
route(bus_45_40,45,45).
route(bus_45_41,45,45).
route(bus_45_42,45,45).
route(bus_45_43,45,45).
route(bus_45_44,45,45).
route(bus_45_45,45,45).
route(bus_45_46,45,45).
route(bus_45_47,45,45).
route(bus_45_48,45,45).
route(bus_45_49,45,45).
route(bus_45_5,45,45).
route(bus_45_50,45,45).
route(bus_45_51,45,45).
route(bus_45_52,45,45).
route(bus_45_53,45,45).
route(bus_45_54,45,45).
route(bus_45_55,45,45).
route(bus_45_56,45,45).
route(bus_45_57,45,45).
route(bus_45_58,45,45).
route(bus_45_59,45,45).
route(bus_45_6,45,45).
route(bus_45_60,45,45).
route(bus_45_6001,45,45).
route(bus_45_6002,45,45).
route(bus_45_6003,45,45).
route(bus_45_6004,45,45).
route(bus_45_6005,45,45).
route(bus_45_6006,45,45).
route(bus_45_6007,45,45).
route(bus_45_6008,45,45).
route(bus_45_6009,45,45).
route(bus_45_6010,45,45).
route(bus_45_6011,45,45).
route(bus_45_6012,45,45).
route(bus_45_6013,45,45).
route(bus_45_6014,45,45).
route(bus_45_6015,45,45).
route(bus_45_6016,45,45).
route(bus_45_6017,45,45).
route(bus_45_6018,45,45).
route(bus_45_6019,45,45).
route(bus_45_6020,45,45).
route(bus_45_6021,45,45).
route(bus_45_6022,45,45).
route(bus_45_6023,45,45).
route(bus_45_6024,45,45).
route(bus_45_6025,45,45).
route(bus_45_6026,45,45).
route(bus_45_6027,45,45).
route(bus_45_6028,45,45).
route(bus_45_6029,45,45).
route(bus_45_6030,45,45).
route(bus_45_6031,45,45).
route(bus_45_6032,45,45).
route(bus_45_6033,45,45).
route(bus_45_6034,45,45).
route(bus_45_6035,45,45).
route(bus_45_6036,45,45).
route(bus_45_6037,45,45).
route(bus_45_6038,45,45).
route(bus_45_6039,45,45).
route(bus_45_6040,45,45).
route(bus_45_6041,45,45).
route(bus_45_6042,45,45).
route(bus_45_6043,45,45).
route(bus_45_6044,45,45).
route(bus_45_6045,45,45).
route(bus_45_6046,45,45).
route(bus_45_6047,45,45).
route(bus_45_6048,45,45).
route(bus_45_6049,45,45).
route(bus_45_6050,45,45).
route(bus_45_6051,45,45).
route(bus_45_6052,45,45).
route(bus_45_6053,45,45).
route(bus_45_6054,45,45).
route(bus_45_6055,45,45).
route(bus_45_6056,45,45).
route(bus_45_6057,45,45).
route(bus_45_6058,45,45).
route(bus_45_6059,45,45).
route(bus_45_6060,45,45).
route(bus_45_6061,45,45).
route(bus_45_6062,45,45).
route(bus_45_6063,45,45).
route(bus_45_6064,45,45).
route(bus_45_6065,45,45).
route(bus_45_6066,45,45).
route(bus_45_6067,45,45).
route(bus_45_6068,45,45).
route(bus_45_6069,45,45).
route(bus_45_6070,45,45).
route(bus_45_6071,45,45).
route(bus_45_6072,45,45).
route(bus_45_6073,45,45).
route(bus_45_6074,45,45).
route(bus_45_6075,45,45).
route(bus_45_6076,45,45).
route(bus_45_6077,45,45).
route(bus_45_6078,45,45).
route(bus_45_6079,45,45).
route(bus_45_6080,45,45).
route(bus_45_6081,45,45).
route(bus_45_6082,45,45).
route(bus_45_6083,45,45).
route(bus_45_6084,45,45).
route(bus_45_6085,45,45).
route(bus_45_6086,45,45).
route(bus_45_6087,45,45).
route(bus_45_6088,45,45).
route(bus_45_6089,45,45).
route(bus_45_6090,45,45).
route(bus_45_6091,45,45).
route(bus_45_6092,45,45).
route(bus_45_6093,45,45).
route(bus_45_6094,45,45).
route(bus_45_6095,45,45).
route(bus_45_6096,45,45).
route(bus_45_6097,45,45).
route(bus_45_6098,45,45).
route(bus_45_6099,45,45).
route(bus_45_61,45,45).
route(bus_45_6100,45,45).
route(bus_45_6101,45,45).
route(bus_45_6102,45,45).
route(bus_45_6103,45,45).
route(bus_45_6104,45,45).
route(bus_45_6105,45,45).
route(bus_45_6106,45,45).
route(bus_45_6107,45,45).
route(bus_45_6108,45,45).
route(bus_45_6109,45,45).
route(bus_45_6110,45,45).
route(bus_45_6111,45,45).
route(bus_45_6112,45,45).
route(bus_45_6113,45,45).
route(bus_45_6114,45,45).
route(bus_45_6115,45,45).
route(bus_45_6116,45,45).
route(bus_45_6117,45,45).
route(bus_45_6118,45,45).
route(bus_45_6119,45,45).
route(bus_45_6120,45,45).
route(bus_45_6121,45,45).
route(bus_45_6122,45,45).
route(bus_45_6123,45,45).
route(bus_45_6124,45,45).
route(bus_45_6125,45,45).
route(bus_45_6126,45,45).
route(bus_45_6127,45,45).
route(bus_45_6128,45,45).
route(bus_45_6129,45,45).
route(bus_45_6130,45,45).
route(bus_45_6131,45,45).
route(bus_45_6132,45,45).
route(bus_45_6133,45,45).
route(bus_45_6134,45,45).
route(bus_45_6135,45,45).
route(bus_45_6136,45,45).
route(bus_45_6137,45,45).
route(bus_45_6138,45,45).
route(bus_45_6139,45,45).
route(bus_45_6140,45,45).
route(bus_45_6141,45,45).
route(bus_45_6142,45,45).
route(bus_45_6143,45,45).
route(bus_45_6144,45,45).
route(bus_45_6145,45,45).
route(bus_45_6146,45,45).
route(bus_45_6147,45,45).
route(bus_45_6148,45,45).
route(bus_45_6149,45,45).
route(bus_45_6150,45,45).
route(bus_45_6151,45,45).
route(bus_45_6152,45,45).
route(bus_45_6153,45,45).
route(bus_45_6154,45,45).
route(bus_45_6155,45,45).
route(bus_45_6156,45,45).
route(bus_45_6157,45,45).
route(bus_45_6158,45,45).
route(bus_45_6159,45,45).
route(bus_45_6160,45,45).
route(bus_45_6161,45,45).
route(bus_45_6162,45,45).
route(bus_45_6163,45,45).
route(bus_45_6164,45,45).
route(bus_45_6165,45,45).
route(bus_45_6166,45,45).
route(bus_45_6167,45,45).
route(bus_45_6168,45,45).
route(bus_45_6169,45,45).
route(bus_45_6170,45,45).
route(bus_45_6171,45,45).
route(bus_45_6172,45,45).
route(bus_45_6173,45,45).
route(bus_45_6174,45,45).
route(bus_45_6175,45,45).
route(bus_45_6176,45,45).
route(bus_45_6177,45,45).
route(bus_45_6178,45,45).
route(bus_45_6179,45,45).
route(bus_45_6180,45,45).
route(bus_45_6182,45,45).
route(bus_45_6184,45,45).
route(bus_45_62,45,45).
route(bus_45_63,45,45).
route(bus_45_64,45,45).
route(bus_45_65,45,45).
route(bus_45_66,45,45).
route(bus_45_67,45,45).
route(bus_45_68,45,45).
route(bus_45_69,45,45).
route(bus_45_7,45,45).
route(bus_45_70,45,45).
route(bus_45_7001,45,45).
route(bus_45_7002,45,45).
route(bus_45_7003,45,45).
route(bus_45_7004,45,45).
route(bus_45_7005,45,45).
route(bus_45_7006,45,45).
route(bus_45_7007,45,45).
route(bus_45_7008,45,45).
route(bus_45_7009,45,45).
route(bus_45_7010,45,45).
route(bus_45_7011,45,45).
route(bus_45_7012,45,45).
route(bus_45_7013,45,45).
route(bus_45_7014,45,45).
route(bus_45_7015,45,45).
route(bus_45_7016,45,45).
route(bus_45_7017,45,45).
route(bus_45_7018,45,45).
route(bus_45_7019,45,45).
route(bus_45_7020,45,45).
route(bus_45_7021,45,45).
route(bus_45_7022,45,45).
route(bus_45_7023,45,45).
route(bus_45_7024,45,45).
route(bus_45_7025,45,45).
route(bus_45_7026,45,45).
route(bus_45_7027,45,45).
route(bus_45_7028,45,45).
route(bus_45_7029,45,45).
route(bus_45_7030,45,45).
route(bus_45_7031,45,45).
route(bus_45_7032,45,45).
route(bus_45_7033,45,45).
route(bus_45_7034,45,45).
route(bus_45_7035,45,45).
route(bus_45_7036,45,45).
route(bus_45_7037,45,45).
route(bus_45_7038,45,45).
route(bus_45_7039,45,45).
route(bus_45_7040,45,45).
route(bus_45_7041,45,45).
route(bus_45_7042,45,45).
route(bus_45_7043,45,45).
route(bus_45_7044,45,45).
route(bus_45_7045,45,45).
route(bus_45_7046,45,45).
route(bus_45_7047,45,45).
route(bus_45_7048,45,45).
route(bus_45_7049,45,45).
route(bus_45_7050,45,45).
route(bus_45_7051,45,45).
route(bus_45_7052,45,45).
route(bus_45_7053,45,45).
route(bus_45_7054,45,45).
route(bus_45_7055,45,45).
route(bus_45_7056,45,45).
route(bus_45_7057,45,45).
route(bus_45_7058,45,45).
route(bus_45_7059,45,45).
route(bus_45_7060,45,45).
route(bus_45_7061,45,45).
route(bus_45_7062,45,45).
route(bus_45_7063,45,45).
route(bus_45_7064,45,45).
route(bus_45_7065,45,45).
route(bus_45_7066,45,45).
route(bus_45_7067,45,45).
route(bus_45_7068,45,45).
route(bus_45_7069,45,45).
route(bus_45_7070,45,45).
route(bus_45_7071,45,45).
route(bus_45_7072,45,45).
route(bus_45_7073,45,45).
route(bus_45_7074,45,45).
route(bus_45_7075,45,45).
route(bus_45_7076,45,45).
route(bus_45_7077,45,45).
route(bus_45_7078,45,45).
route(bus_45_7079,45,45).
route(bus_45_7080,45,45).
route(bus_45_7081,45,45).
route(bus_45_7082,45,45).
route(bus_45_7083,45,45).
route(bus_45_7084,45,45).
route(bus_45_7085,45,45).
route(bus_45_7086,45,45).
route(bus_45_7087,45,45).
route(bus_45_7088,45,45).
route(bus_45_7089,45,45).
route(bus_45_7090,45,45).
route(bus_45_7091,45,45).
route(bus_45_7092,45,45).
route(bus_45_7094,45,45).
route(bus_45_71,45,45).
route(bus_45_72,45,45).
route(bus_45_73,45,45).
route(bus_45_74,45,45).
route(bus_45_75,45,45).
route(bus_45_76,45,45).
route(bus_45_77,45,45).
route(bus_45_78,45,45).
route(bus_45_79,45,45).
route(bus_45_8,45,45).
route(bus_45_80,45,45).
route(bus_45_81,45,45).
route(bus_45_82,45,45).
route(bus_45_83,45,45).
route(bus_45_84,45,45).
route(bus_45_85,45,45).
route(bus_45_86,45,45).
route(bus_45_87,45,45).
route(bus_45_88,45,45).
route(bus_45_89,45,45).
route(bus_45_9,45,45).
route(bus_45_90,45,45).
route(bus_45_91,45,45).
route(bus_45_92,45,45).
route(bus_45_93,45,45).
route(bus_45_94,45,45).
route(bus_45_95,45,45).
route(bus_45_96,45,45).
route(bus_45_97,45,45).
route(bus_45_98,45,45).
route(bus_45_99,45,45).
route(bus_460_1,460,460).
route(bus_460_10,460,460).
route(bus_460_1001,460,460).
route(bus_460_1004,460,460).
route(bus_460_1005,460,460).
route(bus_460_1009,460,460).
route(bus_460_1010,460,460).
route(bus_460_1011,460,460).
route(bus_460_1012,460,460).
route(bus_460_1013,460,460).
route(bus_460_1014,460,460).
route(bus_460_11,460,460).
route(bus_460_12,460,460).
route(bus_460_13,460,460).
route(bus_460_14,460,460).
route(bus_460_15,460,460).
route(bus_460_16,460,460).
route(bus_460_17,460,460).
route(bus_460_18,460,460).
route(bus_460_19,460,460).
route(bus_460_2,460,460).
route(bus_460_3,460,460).
route(bus_460_4,460,460).
route(bus_460_5,460,460).
route(bus_460_6,460,460).
route(bus_460_6001,460,460).
route(bus_460_6002,460,460).
route(bus_460_7,460,460).
route(bus_460_7001,460,460).
route(bus_460_7002,460,460).
route(bus_460_8,460,460).
route(bus_460_8001,460,460).
route(bus_460_8002,460,460).
route(bus_460_9,460,460).
route(bus_460_9001,460,460).
route(bus_460_9002,460,460).
route(bus_46_1,46,46).
route(bus_46_10,46,46).
route(bus_46_11,46,46).
route(bus_46_12,46,46).
route(bus_46_13,46,46).
route(bus_46_14,46,46).
route(bus_46_15,46,46).
route(bus_46_16,46,46).
route(bus_46_17,46,46).
route(bus_46_18,46,46).
route(bus_46_19,46,46).
route(bus_46_2,46,46).
route(bus_46_20,46,46).
route(bus_46_21,46,46).
route(bus_46_22,46,46).
route(bus_46_23,46,46).
route(bus_46_24,46,46).
route(bus_46_25,46,46).
route(bus_46_26,46,46).
route(bus_46_27,46,46).
route(bus_46_28,46,46).
route(bus_46_29,46,46).
route(bus_46_3,46,46).
route(bus_46_30,46,46).
route(bus_46_31,46,46).
route(bus_46_32,46,46).
route(bus_46_33,46,46).
route(bus_46_34,46,46).
route(bus_46_35,46,46).
route(bus_46_36,46,46).
route(bus_46_37,46,46).
route(bus_46_38,46,46).
route(bus_46_39,46,46).
route(bus_46_4,46,46).
route(bus_46_40,46,46).
route(bus_46_41,46,46).
route(bus_46_42,46,46).
route(bus_46_43,46,46).
route(bus_46_44,46,46).
route(bus_46_45,46,46).
route(bus_46_46,46,46).
route(bus_46_47,46,46).
route(bus_46_48,46,46).
route(bus_46_49,46,46).
route(bus_46_5,46,46).
route(bus_46_50,46,46).
route(bus_46_51,46,46).
route(bus_46_52,46,46).
route(bus_46_53,46,46).
route(bus_46_54,46,46).
route(bus_46_55,46,46).
route(bus_46_56,46,46).
route(bus_46_57,46,46).
route(bus_46_58,46,46).
route(bus_46_59,46,46).
route(bus_46_6,46,46).
route(bus_46_60,46,46).
route(bus_46_6001,46,46).
route(bus_46_6002,46,46).
route(bus_46_6003,46,46).
route(bus_46_6004,46,46).
route(bus_46_6005,46,46).
route(bus_46_6006,46,46).
route(bus_46_6007,46,46).
route(bus_46_6008,46,46).
route(bus_46_6009,46,46).
route(bus_46_6010,46,46).
route(bus_46_6011,46,46).
route(bus_46_6012,46,46).
route(bus_46_6013,46,46).
route(bus_46_6014,46,46).
route(bus_46_6015,46,46).
route(bus_46_6016,46,46).
route(bus_46_6017,46,46).
route(bus_46_6018,46,46).
route(bus_46_6019,46,46).
route(bus_46_6020,46,46).
route(bus_46_6021,46,46).
route(bus_46_6022,46,46).
route(bus_46_6023,46,46).
route(bus_46_6024,46,46).
route(bus_46_6025,46,46).
route(bus_46_6026,46,46).
route(bus_46_6027,46,46).
route(bus_46_6028,46,46).
route(bus_46_6029,46,46).
route(bus_46_6030,46,46).
route(bus_46_6031,46,46).
route(bus_46_6032,46,46).
route(bus_46_6033,46,46).
route(bus_46_6034,46,46).
route(bus_46_6035,46,46).
route(bus_46_6036,46,46).
route(bus_46_6037,46,46).
route(bus_46_6038,46,46).
route(bus_46_6039,46,46).
route(bus_46_6040,46,46).
route(bus_46_6041,46,46).
route(bus_46_6042,46,46).
route(bus_46_6043,46,46).
route(bus_46_6044,46,46).
route(bus_46_6045,46,46).
route(bus_46_6046,46,46).
route(bus_46_6047,46,46).
route(bus_46_6048,46,46).
route(bus_46_6049,46,46).
route(bus_46_6050,46,46).
route(bus_46_6051,46,46).
route(bus_46_6052,46,46).
route(bus_46_6053,46,46).
route(bus_46_6054,46,46).
route(bus_46_6055,46,46).
route(bus_46_6056,46,46).
route(bus_46_6057,46,46).
route(bus_46_6058,46,46).
route(bus_46_6059,46,46).
route(bus_46_6060,46,46).
route(bus_46_6061,46,46).
route(bus_46_6062,46,46).
route(bus_46_6063,46,46).
route(bus_46_6064,46,46).
route(bus_46_61,46,46).
route(bus_46_62,46,46).
route(bus_46_63,46,46).
route(bus_46_64,46,46).
route(bus_46_65,46,46).
route(bus_46_66,46,46).
route(bus_46_67,46,46).
route(bus_46_68,46,46).
route(bus_46_69,46,46).
route(bus_46_7,46,46).
route(bus_46_70,46,46).
route(bus_46_7001,46,46).
route(bus_46_7002,46,46).
route(bus_46_7003,46,46).
route(bus_46_7004,46,46).
route(bus_46_7005,46,46).
route(bus_46_7006,46,46).
route(bus_46_7007,46,46).
route(bus_46_7008,46,46).
route(bus_46_7009,46,46).
route(bus_46_7010,46,46).
route(bus_46_7011,46,46).
route(bus_46_7012,46,46).
route(bus_46_7013,46,46).
route(bus_46_7014,46,46).
route(bus_46_7015,46,46).
route(bus_46_7016,46,46).
route(bus_46_7017,46,46).
route(bus_46_7018,46,46).
route(bus_46_7019,46,46).
route(bus_46_7020,46,46).
route(bus_46_7021,46,46).
route(bus_46_7022,46,46).
route(bus_46_7023,46,46).
route(bus_46_7024,46,46).
route(bus_46_7025,46,46).
route(bus_46_7026,46,46).
route(bus_46_7027,46,46).
route(bus_46_7028,46,46).
route(bus_46_7029,46,46).
route(bus_46_7031,46,46).
route(bus_46_71,46,46).
route(bus_46_72,46,46).
route(bus_46_73,46,46).
route(bus_46_74,46,46).
route(bus_46_75,46,46).
route(bus_46_76,46,46).
route(bus_46_77,46,46).
route(bus_46_78,46,46).
route(bus_46_8,46,46).
route(bus_46_9,46,46).
route(bus_470_1,470,470).
route(bus_470_10,470,470).
route(bus_470_1003,470,470).
route(bus_470_1004,470,470).
route(bus_470_1005,470,470).
route(bus_470_1006,470,470).
route(bus_470_1007,470,470).
route(bus_470_1008,470,470).
route(bus_470_1010,470,470).
route(bus_470_12,470,470).
route(bus_470_2,470,470).
route(bus_470_3,470,470).
route(bus_470_4,470,470).
route(bus_470_5,470,470).
route(bus_470_6,470,470).
route(bus_470_6001,470,470).
route(bus_470_6002,470,470).
route(bus_470_7,470,470).
route(bus_470_7001,470,470).
route(bus_470_7002,470,470).
route(bus_470_7003,470,470).
route(bus_470_7004,470,470).
route(bus_470_8,470,470).
route(bus_470_8001,470,470).
route(bus_470_8002,470,470).
route(bus_470_9002,470,470).
route(bus_470_9003,470,470).
route(bus_480_1,480,480).
route(bus_480_10,480,480).
route(bus_480_1003,480,480).
route(bus_480_1004,480,480).
route(bus_480_1005,480,480).
route(bus_480_1006,480,480).
route(bus_480_1009,480,480).
route(bus_480_1012,480,480).
route(bus_480_11,480,480).
route(bus_480_12,480,480).
route(bus_480_2,480,480).
route(bus_480_3,480,480).
route(bus_480_4,480,480).
route(bus_480_5,480,480).
route(bus_480_6,480,480).
route(bus_480_6001,480,480).
route(bus_480_6002,480,480).
route(bus_480_7,480,480).
route(bus_480_7001,480,480).
route(bus_480_7002,480,480).
route(bus_480_8,480,480).
route(bus_480_8001,480,480).
route(bus_480_8002,480,480).
route(bus_480_9,480,480).
route(bus_480_9001,480,480).
route(bus_480_9002,480,480).
route(bus_490_1,490,490).
route(bus_490_2,490,490).
route(bus_490_3,490,490).
route(bus_490_7001,490,490).
route(bus_490_7002,490,490).
route(bus_5001_1,5001,5001).
route(bus_5001_10,5001,5001).
route(bus_5001_11,5001,5001).
route(bus_5001_13,5001,5001).
route(bus_5001_2,5001,5001).
route(bus_5001_3,5001,5001).
route(bus_5001_4,5001,5001).
route(bus_5001_6,5001,5001).
route(bus_5001_7,5001,5001).
route(bus_5001_8,5001,5001).
route(bus_5001_9,5001,5001).
route(bus_5002_1,5002,5002).
route(bus_5002_2,5002,5002).
route(bus_5002_3,5002,5002).
route(bus_5002_4,5002,5002).
route(bus_5002_5,5002,5002).
route(bus_5002_6,5002,5002).
route(bus_5002_8,5002,5002).
route(bus_5003_12,5003,5003).
route(bus_5003_14,5003,5003).
route(bus_5003_2,5003,5003).
route(bus_5003_4,5003,5003).
route(bus_5003_6,5003,5003).
route(bus_5003_8,5003,5003).
route(bus_5004_1,5004,5004).
route(bus_5004_11,5004,5004).
route(bus_5004_12,5004,5004).
route(bus_5004_14,5004,5004).
route(bus_5004_15,5004,5004).
route(bus_5004_16,5004,5004).
route(bus_5004_2,5004,5004).
route(bus_5004_24,5004,5004).
route(bus_5004_26,5004,5004).
route(bus_5004_28,5004,5004).
route(bus_5004_3,5004,5004).
route(bus_5004_30,5004,5004).
route(bus_5004_32,5004,5004).
route(bus_5004_34,5004,5004).
route(bus_5004_4,5004,5004).
route(bus_5004_5,5004,5004).
route(bus_5004_7,5004,5004).
route(bus_5004_8,5004,5004).
route(bus_5004_9,5004,5004).
route(bus_5005_1,5005,5005).
route(bus_5005_2,5005,5005).
route(bus_5005_3,5005,5005).
route(bus_5005_4,5005,5005).
route(bus_5005_7,5005,5005).
route(bus_5006_1,5006,5006).
route(bus_5006_2,5006,5006).
route(bus_5006_3,5006,5006).
route(bus_5006_4,5006,5006).
route(bus_5006_5,5006,5006).
route(bus_5006_6,5006,5006).
route(bus_5006_7,5006,5006).
route(bus_5006_9,5006,5006).
route(bus_5008_3,5008,5008).
route(bus_5008_5,5008,5008).
route(bus_5009_1,5009,5009).
route(bus_5009_2,5009,5009).
route(bus_5009_4,5009,5009).
route(bus_5010_1,5010,5010).
route(bus_5010_2,5010,5010).
route(bus_5010_4,5010,5010).
route(bus_504_1,504,504).
route(bus_504_10,504,504).
route(bus_504_1002,504,504).
route(bus_504_1003,504,504).
route(bus_504_1004,504,504).
route(bus_504_11,504,504).
route(bus_504_12,504,504).
route(bus_504_13,504,504).
route(bus_504_15,504,504).
route(bus_504_16,504,504).
route(bus_504_17,504,504).
route(bus_504_18,504,504).
route(bus_504_19,504,504).
route(bus_504_2,504,504).
route(bus_504_20,504,504).
route(bus_504_21,504,504).
route(bus_504_22,504,504).
route(bus_504_23,504,504).
route(bus_504_25,504,504).
route(bus_504_3,504,504).
route(bus_504_4,504,504).
route(bus_504_5,504,504).
route(bus_504_6,504,504).
route(bus_504_7,504,504).
route(bus_504_8,504,504).
route(bus_504_9,504,504).
route(bus_505_1,505,505).
route(bus_505_2,505,505).
route(bus_50_1,50,50).
route(bus_50_2,50,50).
route(bus_50_3,50,50).
route(bus_50_4,50,50).
route(bus_50_5,50,50).
route(bus_50_6,50,50).
route(bus_50_8,50,50).
route(bus_5100_1,5100,5100).
route(bus_5100_2,5100,5100).
route(bus_5101_1,5101,5101).
route(bus_5101_2,5101,5101).
route(bus_5101_3,5101,5101).
route(bus_5101_4,5101,5101).
route(bus_5102_1,5102,5102).
route(bus_5102_12,5102,5102).
route(bus_5102_16,5102,5102).
route(bus_5102_2,5102,5102).
route(bus_5102_3,5102,5102).
route(bus_5102_4,5102,5102).
route(bus_5102_6,5102,5102).
route(bus_5102_8,5102,5102).
route(bus_5103_1,5103,5103).
route(bus_5103_2,5103,5103).
route(bus_5104_1,5104,5104).
route(bus_5104_11,5104,5104).
route(bus_5104_2,5104,5104).
route(bus_5104_4,5104,5104).
route(bus_5104_7,5104,5104).
route(bus_5104_9,5104,5104).
route(bus_5105_1,5105,5105).
route(bus_5105_10,5105,5105).
route(bus_5105_14,5105,5105).
route(bus_5105_16,5105,5105).
route(bus_5105_18,5105,5105).
route(bus_5105_2,5105,5105).
route(bus_5105_3,5105,5105).
route(bus_5105_4,5105,5105).
route(bus_5105_5,5105,5105).
route(bus_5105_6,5105,5105).
route(bus_5105_8,5105,5105).
route(bus_5106_10,5106,5106).
route(bus_5106_11,5106,5106).
route(bus_5106_15,5106,5106).
route(bus_5106_2,5106,5106).
route(bus_5106_3,5106,5106).
route(bus_5106_4,5106,5106).
route(bus_5106_5,5106,5106).
route(bus_5106_6,5106,5106).
route(bus_5106_7,5106,5106).
route(bus_5106_8,5106,5106).
route(bus_5106_9,5106,5106).
route(bus_5107_1,5107,5107).
route(bus_5107_2,5107,5107).
route(bus_5109_1,5109,5109).
route(bus_5109_118,5109,5109).
route(bus_5109_18,5109,5109).
route(bus_5109_19,5109,5109).
route(bus_5109_20,5109,5109).
route(bus_5109_3,5109,5109).
route(bus_5109_5,5109,5109).
route(bus_5109_6,5109,5109).
route(bus_5109_7,5109,5109).
route(bus_5109_8,5109,5109).
route(bus_510_10,510,510).
route(bus_510_12,510,510).
route(bus_510_14,510,510).
route(bus_510_16,510,510).
route(bus_510_2,510,510).
route(bus_510_4,510,510).
route(bus_510_6,510,510).
route(bus_510_8,510,510).
route(bus_5110_1,5110,5110).
route(bus_5110_2,5110,5110).
route(bus_5111_1,5111,5111).
route(bus_5111_2,5111,5111).
route(bus_5111_3,5111,5111).
route(bus_5111_4,5111,5111).
route(bus_5111_5,5111,5111).
route(bus_5111_7,5111,5111).
route(bus_511_1,511,511).
route(bus_511_1001,511,511).
route(bus_511_1002,511,511).
route(bus_511_1003,511,511).
route(bus_511_1004,511,511).
route(bus_511_2,511,511).
route(bus_511_3,511,511).
route(bus_511_4,511,511).
route(bus_515_1,515,515).
route(bus_515_1001,515,515).
route(bus_515_1002,515,515).
route(bus_515_1005,515,515).
route(bus_515_1006,515,515).
route(bus_515_2,515,515).
route(bus_515_3,515,515).
route(bus_515_4,515,515).
route(bus_515_5,515,515).
route(bus_515_6,515,515).
route(bus_515_7,515,515).
route(bus_51_1,51,51).
route(bus_51_2,51,51).
route(bus_51_4,51,51).
route(bus_5201_1,5201,5201).
route(bus_5201_2,5201,5201).
route(bus_5201_3,5201,5201).
route(bus_5201_4,5201,5201).
route(bus_5201_6,5201,5201).
route(bus_5201_7,5201,5201).
route(bus_5202_2,5202,5202).
route(bus_5202_4,5202,5202).
route(bus_5202_6,5202,5202).
route(bus_5205_1,5205,5205).
route(bus_5205_2,5205,5205).
route(bus_5205_3,5205,5205).
route(bus_5205_4,5205,5205).
route(bus_5205_5,5205,5205).
route(bus_5205_6,5205,5205).
route(bus_5205_7,5205,5205).
route(bus_5206_1,5206,5206).
route(bus_5206_2,5206,5206).
route(bus_5206_3,5206,5206).
route(bus_5206_4,5206,5206).
route(bus_5206_5,5206,5206).
route(bus_5207_1,5207,5207).
route(bus_5207_10,5207,5207).
route(bus_5207_11,5207,5207).
route(bus_5207_12,5207,5207).
route(bus_5207_14,5207,5207).
route(bus_5207_2,5207,5207).
route(bus_5207_3,5207,5207).
route(bus_5207_4,5207,5207).
route(bus_5207_5,5207,5207).
route(bus_5207_6,5207,5207).
route(bus_5207_7,5207,5207).
route(bus_5207_8,5207,5207).
route(bus_5207_9,5207,5207).
route(bus_5208_10,5208,5208).
route(bus_5208_11,5208,5208).
route(bus_5208_12,5208,5208).
route(bus_5208_13,5208,5208).
route(bus_5208_15,5208,5208).
route(bus_5208_16,5208,5208).
route(bus_5208_18,5208,5208).
route(bus_5208_3,5208,5208).
route(bus_5208_5,5208,5208).
route(bus_5208_7,5208,5208).
route(bus_5208_9,5208,5208).
route(bus_5209_1,5209,5209).
route(bus_5209_10,5209,5209).
route(bus_5209_11,5209,5209).
route(bus_5209_12,5209,5209).
route(bus_5209_13,5209,5209).
route(bus_5209_14,5209,5209).
route(bus_5209_15,5209,5209).
route(bus_5209_16,5209,5209).
route(bus_5209_2,5209,5209).
route(bus_5209_26,5209,5209).
route(bus_5209_28,5209,5209).
route(bus_5209_3,5209,5209).
route(bus_5209_30,5209,5209).
route(bus_5209_32,5209,5209).
route(bus_5209_4,5209,5209).
route(bus_5209_5,5209,5209).
route(bus_5209_6,5209,5209).
route(bus_5209_7,5209,5209).
route(bus_5209_8,5209,5209).
route(bus_5210_1,5210,5210).
route(bus_5210_10,5210,5210).
route(bus_5210_11,5210,5210).
route(bus_5210_12,5210,5210).
route(bus_5210_2,5210,5210).
route(bus_5210_3,5210,5210).
route(bus_5210_4,5210,5210).
route(bus_5210_5,5210,5210).
route(bus_5210_7,5210,5210).
route(bus_5210_8,5210,5210).
route(bus_5210_9,5210,5210).
route(bus_5212_10,5212,5212).
route(bus_5212_11,5212,5212).
route(bus_5212_12,5212,5212).
route(bus_5212_14,5212,5212).
route(bus_5212_2,5212,5212).
route(bus_5212_3,5212,5212).
route(bus_5212_4,5212,5212).
route(bus_5212_5,5212,5212).
route(bus_5212_6,5212,5212).
route(bus_5212_7,5212,5212).
route(bus_5212_8,5212,5212).
route(bus_5212_9,5212,5212).
route(bus_521_1002,521,521).
route(bus_521_1006,521,521).
route(bus_521_2,521,521).
route(bus_521_6,521,521).
route(bus_521_8,521,521).
route(bus_524_1,524,524).
route(bus_524_10,524,524).
route(bus_524_1002,524,524).
route(bus_524_1005,524,524).
route(bus_524_12,524,524).
route(bus_524_1401,524,524).
route(bus_524_1402,524,524).
route(bus_524_16,524,524).
route(bus_524_2,524,524).
route(bus_524_3,524,524).
route(bus_524_4,524,524).
route(bus_524_5,524,524).
route(bus_524_6,524,524).
route(bus_524_7,524,524).
route(bus_524_8,524,524).
route(bus_524_9,524,524).
route(bus_52_7001,52,52).
route(bus_52_7002,52,52).
route(bus_52_7004,52,52).
route(bus_5300_1,5300,5300).
route(bus_5300_2,5300,5300).
route(bus_5300_3,5300,5300).
route(bus_5300_4,5300,5300).
route(bus_5300_6,5300,5300).
route(bus_5301_1,5301,5301).
route(bus_5301_2,5301,5301).
route(bus_5301_3,5301,5301).
route(bus_5301_4,5301,5301).
route(bus_5301_5,5301,5301).
route(bus_5301_6,5301,5301).
route(bus_5302_1,5302,5302).
route(bus_5302_2,5302,5302).
route(bus_5302_5,5302,5302).
route(bus_5302_6,5302,5302).
route(bus_5302_7121,5302,5302).
route(bus_5305_1,5305,5305).
route(bus_5305_2,5305,5305).
route(bus_5305_4,5305,5305).
route(bus_535_1,535,535).
route(bus_535_10,535,535).
route(bus_535_3,535,535).
route(bus_535_4,535,535).
route(bus_535_5,535,535).
route(bus_535_6,535,535).
route(bus_535_6001,535,535).
route(bus_535_6002,535,535).
route(bus_535_8,535,535).
route(bus_535_9,535,535).
route(bus_53_2,53,53).
route(bus_53_6002,53,53).
route(bus_5400_10,5400,5400).
route(bus_5400_12,5400,5400).
route(bus_5400_15,5400,5400).
route(bus_5400_17,5400,5400).
route(bus_5400_2,5400,5400).
route(bus_5400_3,5400,5400).
route(bus_5400_4,5400,5400).
route(bus_5400_5,5400,5400).
route(bus_5400_6,5400,5400).
route(bus_5400_7,5400,5400).
route(bus_5400_8,5400,5400).
route(bus_5400_9,5400,5400).
route(bus_5401_10,5401,5401).
route(bus_5401_2,5401,5401).
route(bus_5401_4,5401,5401).
route(bus_5401_6,5401,5401).
route(bus_5401_8,5401,5401).
route(bus_5402_1,5402,5402).
route(bus_5402_2,5402,5402).
route(bus_5402_3,5402,5402).
route(bus_5402_4,5402,5402).
route(bus_5402_6,5402,5402).
route(bus_5403_1,5403,5403).
route(bus_5403_2,5403,5403).
route(bus_5403_5,5403,5403).
route(bus_5403_8,5403,5403).
route(bus_5404_1,5404,5404).
route(bus_5404_2,5404,5404).
route(bus_5404_3,5404,5404).
route(bus_5404_4,5404,5404).
route(bus_5404_5,5404,5404).
route(bus_5406_1,5406,5406).
route(bus_5406_2,5406,5406).
route(bus_5406_4,5406,5406).
route(bus_5406_6,5406,5406).
route(bus_540_1,540,540).
route(bus_540_1002,540,540).
route(bus_540_1005,540,540).
route(bus_540_1007,540,540).
route(bus_540_1008,540,540).
route(bus_540_1009,540,540).
route(bus_540_1010,540,540).
route(bus_540_1833,540,540).
route(bus_540_2,540,540).
route(bus_540_265,540,540).
route(bus_540_3,540,540).
route(bus_540_4,540,540).
route(bus_540_6004,540,540).
route(bus_540_6007,540,540).
route(bus_540_6009,540,540).
route(bus_540_7005,540,540).
route(bus_540_7006,540,540).
route(bus_540_7008,540,540).
route(bus_540_8001,540,540).
route(bus_540_8002,540,540).
route(bus_540_8007,540,540).
route(bus_540_8008,540,540).
route(bus_540_8010,540,540).
route(bus_540_9001,540,540).
route(bus_540_9002,540,540).
route(bus_540_9003,540,540).
route(bus_540_9004,540,540).
route(bus_540_9009,540,540).
route(bus_541_1,541,541).
route(bus_541_10,541,541).
route(bus_541_1001,541,541).
route(bus_541_1002,541,541).
route(bus_541_2,541,541).
route(bus_541_3,541,541).
route(bus_541_4,541,541).
route(bus_541_5,541,541).
route(bus_541_6,541,541).
route(bus_541_7,541,541).
route(bus_541_8,541,541).
route(bus_543_1,543,543).
route(bus_543_2,543,543).
route(bus_543_3,543,543).
route(bus_543_4,543,543).
route(bus_543_5,543,543).
route(bus_543_6,543,543).
route(bus_544_1,544,544).
route(bus_544_2,544,544).
route(bus_544_3,544,544).
route(bus_544_6,544,544).
route(bus_5471_1,5471,5471).
route(bus_5471_10,5471,5471).
route(bus_5471_14,5471,5471).
route(bus_5471_2,5471,5471).
route(bus_5471_3,5471,5471).
route(bus_5471_4,5471,5471).
route(bus_5471_5,5471,5471).
route(bus_5471_6,5471,5471).
route(bus_5471_7,5471,5471).
route(bus_5471_8,5471,5471).
route(bus_5471_9,5471,5471).
route(bus_5472_1,5472,5472).
route(bus_5472_10,5472,5472).
route(bus_5472_11,5472,5472).
route(bus_5472_12,5472,5472).
route(bus_5472_14,5472,5472).
route(bus_5472_16,5472,5472).
route(bus_5472_2,5472,5472).
route(bus_5472_3,5472,5472).
route(bus_5472_4,5472,5472).
route(bus_5472_5,5472,5472).
route(bus_5472_7,5472,5472).
route(bus_5472_8,5472,5472).
route(bus_5472_9,5472,5472).
route(bus_5473_1,5473,5473).
route(bus_5473_10,5473,5473).
route(bus_5473_11,5473,5473).
route(bus_5473_13,5473,5473).
route(bus_5473_17,5473,5473).
route(bus_5473_18,5473,5473).
route(bus_5473_19,5473,5473).
route(bus_5473_2,5473,5473).
route(bus_5473_21,5473,5473).
route(bus_5473_3,5473,5473).
route(bus_5473_4,5473,5473).
route(bus_5473_5,5473,5473).
route(bus_5473_6,5473,5473).
route(bus_5473_7,5473,5473).
route(bus_5473_8,5473,5473).
route(bus_5473_9,5473,5473).
route(bus_5474_1,5474,5474).
route(bus_5474_2,5474,5474).
route(bus_5474_3,5474,5474).
route(bus_5474_4,5474,5474).
route(bus_5475_1,5475,5475).
route(bus_5475_10,5475,5475).
route(bus_5475_2,5475,5475).
route(bus_5475_3,5475,5475).
route(bus_5475_4,5475,5475).
route(bus_5475_5,5475,5475).
route(bus_5475_6,5475,5475).
route(bus_5475_8,5475,5475).
route(bus_5476_1,5476,5476).
route(bus_5476_2,5476,5476).
route(bus_5476_3,5476,5476).
route(bus_5476_4,5476,5476).
route(bus_5476_5,5476,5476).
route(bus_5476_7,5476,5476).
route(bus_54_2,54,54).
route(bus_54_6002,54,54).
route(bus_5501_1,5501,5501).
route(bus_5501_10,5501,5501).
route(bus_5501_13,5501,5501).
route(bus_5501_3,5501,5501).
route(bus_5501_4,5501,5501).
route(bus_5501_5,5501,5501).
route(bus_5501_6,5501,5501).
route(bus_5501_7,5501,5501).
route(bus_5501_8,5501,5501).
route(bus_5502_1,5502,5502).
route(bus_5502_2,5502,5502).
route(bus_5504_1,5504,5504).
route(bus_5504_2,5504,5504).
route(bus_5504_3,5504,5504).
route(bus_5505_1,5505,5505).
route(bus_5505_12,5505,5505).
route(bus_5505_3,5505,5505).
route(bus_5505_4,5505,5505).
route(bus_5505_5,5505,5505).
route(bus_5505_6,5505,5505).
route(bus_5507_1,5507,5507).
route(bus_5507_2,5507,5507).
route(bus_5521_2,5521,5521).
route(bus_5521_3,5521,5521).
route(bus_5521_4,5521,5521).
route(bus_5521_5,5521,5521).
route(bus_5522_1,5522,5522).
route(bus_5522_2,5522,5522).
route(bus_5522_3,5522,5522).
route(bus_5522_4,5522,5522).
route(bus_5522_5,5522,5522).
route(bus_5522_6,5522,5522).
route(bus_5522_8,5522,5522).
route(bus_5523_1,5523,5523).
route(bus_5523_3,5523,5523).
route(bus_5523_5,5523,5523).
route(bus_552_1,552,552).
route(bus_552_2,552,552).
route(bus_552_3,552,552).
route(bus_552_4,552,552).
route(bus_552_5,552,552).
route(bus_5530_136,5530,5530).
route(bus_5530_142,5530,5530).
route(bus_5532_1,5532,5532).
route(bus_5532_2,5532,5532).
route(bus_5532_6,5532,5532).
route(bus_5533_1,5533,5533).
route(bus_5533_140,5533,5533).
route(bus_5533_2,5533,5533).
route(bus_5533_6,5533,5533).
route(bus_5534_1,5534,5534).
route(bus_5534_2,5534,5534).
route(bus_5535_1,5535,5535).
route(bus_5535_2,5535,5535).
route(bus_5535_3,5535,5535).
route(bus_553_1,553,553).
route(bus_553_10,553,553).
route(bus_553_2,553,553).
route(bus_553_20,553,553).
route(bus_5551_10,5551,5551).
route(bus_5551_12,5551,5551).
route(bus_5551_15,5551,5551).
route(bus_5551_17,5551,5551).
route(bus_5551_19,5551,5551).
route(bus_5551_2,5551,5551).
route(bus_5551_21,5551,5551).
route(bus_5551_3,5551,5551).
route(bus_5551_4,5551,5551).
route(bus_5551_5,5551,5551).
route(bus_5551_6,5551,5551).
route(bus_5551_7,5551,5551).
route(bus_5551_9,5551,5551).
route(bus_5552_1,5552,5552).
route(bus_5552_11,5552,5552).
route(bus_5552_13,5552,5552).
route(bus_5552_15,5552,5552).
route(bus_5552_17,5552,5552).
route(bus_5552_19,5552,5552).
route(bus_5552_25,5552,5552).
route(bus_5552_3,5552,5552).
route(bus_5552_5,5552,5552).
route(bus_5552_7,5552,5552).
route(bus_5554_2,5554,5554).
route(bus_5554_3,5554,5554).
route(bus_5554_4,5554,5554).
route(bus_5555_1,5555,5555).
route(bus_5555_14,5555,5555).
route(bus_5555_16,5555,5555).
route(bus_5555_18,5555,5555).
route(bus_5555_2,5555,5555).
route(bus_5555_20,5555,5555).
route(bus_5555_22,5555,5555).
route(bus_5555_3,5555,5555).
route(bus_5555_4,5555,5555).
route(bus_5555_5,5555,5555).
route(bus_5555_6,5555,5555).
route(bus_5556_1,5556,5556).
route(bus_5556_2,5556,5556).
route(bus_5556_3,5556,5556).
route(bus_5556_4,5556,5556).
route(bus_5556_7,5556,5556).
route(bus_5556_9,5556,5556).
route(bus_5557_1,5557,5557).
route(bus_5557_10,5557,5557).
route(bus_5557_11,5557,5557).
route(bus_5557_12,5557,5557).
route(bus_5557_14,5557,5557).
route(bus_5557_2,5557,5557).
route(bus_5557_3,5557,5557).
route(bus_5557_5,5557,5557).
route(bus_5557_6,5557,5557).
route(bus_5557_7,5557,5557).
route(bus_5557_9,5557,5557).
route(bus_5558_11,5558,5558).
route(bus_5558_13,5558,5558).
route(bus_5558_2,5558,5558).
route(bus_5558_3,5558,5558).
route(bus_5558_4,5558,5558).
route(bus_5558_5,5558,5558).
route(bus_558_1,558,558).
route(bus_558_12,558,558).
route(bus_558_14,558,558).
route(bus_558_2,558,558).
route(bus_558_3,558,558).
route(bus_558_5,558,558).
route(bus_558_6,558,558).
route(bus_558_8,558,558).
route(bus_5601_1,5601,5601).
route(bus_5601_11,5601,5601).
route(bus_5601_2,5601,5601).
route(bus_5601_3,5601,5601).
route(bus_5601_4,5601,5601).
route(bus_5601_5,5601,5601).
route(bus_5601_6,5601,5601).
route(bus_5601_7,5601,5601).
route(bus_5601_9,5601,5601).
route(bus_5602_1,5602,5602).
route(bus_5602_2,5602,5602).
route(bus_5603_12,5603,5603).
route(bus_5603_13,5603,5603).
route(bus_5603_2,5603,5603).
route(bus_5603_3,5603,5603).
route(bus_5603_4,5603,5603).
route(bus_5603_5,5603,5603).
route(bus_5603_6,5603,5603).
route(bus_5603_7,5603,5603).
route(bus_5604_1,5604,5604).
route(bus_5604_13,5604,5604).
route(bus_5604_15,5604,5604).
route(bus_5604_17,5604,5604).
route(bus_5604_2,5604,5604).
route(bus_5604_3,5604,5604).
route(bus_5604_4,5604,5604).
route(bus_5604_5,5604,5604).
route(bus_5604_6,5604,5604).
route(bus_5604_7,5604,5604).
route(bus_5604_9,5604,5604).
route(bus_5605_1,5605,5605).
route(bus_5605_2,5605,5605).
route(bus_5605_3,5605,5605).
route(bus_5605_4,5605,5605).
route(bus_5605_5,5605,5605).
route(bus_5605_6,5605,5605).
route(bus_5605_8,5605,5605).
route(bus_5606_1,5606,5606).
route(bus_5606_2,5606,5606).
route(bus_5607_1,5607,5607).
route(bus_5607_2,5607,5607).
route(bus_5608_1,5608,5608).
route(bus_5608_2,5608,5608).
route(bus_5609_1,5609,5609).
route(bus_5609_2,5609,5609).
route(bus_5609_3,5609,5609).
route(bus_5609_4,5609,5609).
route(bus_5609_5,5609,5609).
route(bus_5609_6,5609,5609).
route(bus_5609_7,5609,5609).
route(bus_5609_8,5609,5609).
route(bus_5609_9,5609,5609).
route(bus_5610_7141,5610,5610).
route(bus_5610_7143,5610,5610).
route(bus_561_1,561,561).
route(bus_561_1001,561,561).
route(bus_561_1002,561,561).
route(bus_561_1003,561,561).
route(bus_561_1004,561,561).
route(bus_561_2,561,561).
route(bus_561_3,561,561).
route(bus_561_4,561,561).
route(bus_561_5,561,561).
route(bus_561_6,561,561).
route(bus_561_7002,561,561).
route(bus_561_9002,561,561).
route(bus_5701_1,5701,5701).
route(bus_5701_10,5701,5701).
route(bus_5701_11,5701,5701).
route(bus_5701_14,5701,5701).
route(bus_5701_2,5701,5701).
route(bus_5701_3,5701,5701).
route(bus_5701_6,5701,5701).
route(bus_5701_7,5701,5701).
route(bus_5701_8,5701,5701).
route(bus_5702_1,5702,5702).
route(bus_5702_11,5702,5702).
route(bus_5702_13,5702,5702).
route(bus_5702_2,5702,5702).
route(bus_5702_4,5702,5702).
route(bus_5702_5,5702,5702).
route(bus_5702_7,5702,5702).
route(bus_5702_9,5702,5702).
route(bus_5703_1,5703,5703).
route(bus_5703_12,5703,5703).
route(bus_5703_14,5703,5703).
route(bus_5703_16,5703,5703).
route(bus_5703_2,5703,5703).
route(bus_5703_20,5703,5703).
route(bus_5703_3,5703,5703).
route(bus_5703_4,5703,5703).
route(bus_5703_5,5703,5703).
route(bus_5703_7,5703,5703).
route(bus_5703_9,5703,5703).
route(bus_5704_1,5704,5704).
route(bus_5704_10,5704,5704).
route(bus_5704_12,5704,5704).
route(bus_5704_2,5704,5704).
route(bus_5704_4,5704,5704).
route(bus_5704_6,5704,5704).
route(bus_5704_8,5704,5704).
route(bus_5705_1,5705,5705).
route(bus_5705_10,5705,5705).
route(bus_5705_12,5705,5705).
route(bus_5705_2,5705,5705).
route(bus_5705_3,5705,5705).
route(bus_5705_4,5705,5705).
route(bus_5705_6,5705,5705).
route(bus_5705_7,5705,5705).
route(bus_5705_8,5705,5705).
route(bus_5706_1,5706,5706).
route(bus_5706_12,5706,5706).
route(bus_5706_2,5706,5706).
route(bus_5706_3,5706,5706).
route(bus_5706_4,5706,5706).
route(bus_5706_5,5706,5706).
route(bus_5706_8,5706,5706).
route(bus_5706_9,5706,5706).
route(bus_5707_1,5707,5707).
route(bus_5707_2,5707,5707).
route(bus_5707_3,5707,5707).
route(bus_5707_4,5707,5707).
route(bus_5707_5,5707,5707).
route(bus_5707_6,5707,5707).
route(bus_5707_7,5707,5707).
route(bus_5801_1,5801,5801).
route(bus_5801_10,5801,5801).
route(bus_5801_11,5801,5801).
route(bus_5801_12,5801,5801).
route(bus_5801_13,5801,5801).
route(bus_5801_15,5801,5801).
route(bus_5801_19,5801,5801).
route(bus_5801_3,5801,5801).
route(bus_5801_5,5801,5801).
route(bus_5801_6,5801,5801).
route(bus_5801_8,5801,5801).
route(bus_5802_11,5802,5802).
route(bus_5802_13,5802,5802).
route(bus_5802_2,5802,5802).
route(bus_5802_3,5802,5802).
route(bus_5802_4,5802,5802).
route(bus_5802_5,5802,5802).
route(bus_5802_9,5802,5802).
route(bus_5803_10,5803,5803).
route(bus_5803_2,5803,5803).
route(bus_5803_3,5803,5803).
route(bus_5803_4,5803,5803).
route(bus_5803_6,5803,5803).
route(bus_5805_1,5805,5805).
route(bus_5805_10,5805,5805).
route(bus_5805_12,5805,5805).
route(bus_5805_3,5805,5805).
route(bus_5805_4,5805,5805).
route(bus_5805_5,5805,5805).
route(bus_5805_8,5805,5805).
route(bus_580_1001,580,580).
route(bus_580_1002,580,580).
route(bus_580_9001,580,580).
route(bus_580_9002,580,580).
route(bus_5901_1,5901,5901).
route(bus_5901_2,5901,5901).
route(bus_5901_3,5901,5901).
route(bus_5901_4,5901,5901).
route(bus_5901_5,5901,5901).
route(bus_5901_6,5901,5901).
route(bus_5901_7,5901,5901).
route(bus_5902_1,5902,5902).
route(bus_5902_3,5902,5902).
route(bus_5902_4,5902,5902).
route(bus_5902_6,5902,5902).
route(bus_5903_1,5903,5903).
route(bus_5903_10,5903,5903).
route(bus_5903_11,5903,5903).
route(bus_5903_12,5903,5903).
route(bus_5903_14,5903,5903).
route(bus_5903_2,5903,5903).
route(bus_5903_3,5903,5903).
route(bus_5903_5,5903,5903).
route(bus_5903_7,5903,5903).
route(bus_5903_8,5903,5903).
route(bus_5903_9,5903,5903).
route(bus_5904_1,5904,5904).
route(bus_5904_2,5904,5904).
route(bus_5904_4,5904,5904).
route(bus_5905_2,5905,5905).
route(bus_5905_3,5905,5905).
route(bus_5905_4,5905,5905).
route(bus_5905_7,5905,5905).
route(bus_5906_1,5906,5906).
route(bus_5906_10,5906,5906).
route(bus_5906_12,5906,5906).
route(bus_5906_4,5906,5906).
route(bus_5906_8,5906,5906).
route(bus_591_1,591,591).
route(bus_591_1001,591,591).
route(bus_591_1002,591,591).
route(bus_591_1003,591,591).
route(bus_591_1004,591,591).
route(bus_591_1005,591,591).
route(bus_591_1006,591,591).
route(bus_591_11,591,591).
route(bus_591_12,591,591).
route(bus_591_14,591,591).
route(bus_591_16,591,591).
route(bus_591_18,591,591).
route(bus_591_2,591,591).
route(bus_591_20,591,591).
route(bus_591_4,591,591).
route(bus_591_5,591,591).
route(bus_591_7,591,591).
route(bus_591_7001,591,591).
route(bus_591_8,591,591).
route(bus_591_9,591,591).
route(bus_591_9001,591,591).
route(bus_592_1002,592,592).
route(bus_592_2,592,592).
route(bus_592_7001,592,592).
route(bus_592_9001,592,592).
route(bus_593_1002,593,593).
route(bus_593_2,593,593).
route(bus_593_7001,593,593).
route(bus_593_9001,593,593).
route(bus_594_1001,594,594).
route(bus_594_2,594,594).
route(bus_594_7001,594,594).
route(bus_594_9001,594,594).
route(bus_595_1,595,595).
route(bus_595_10,595,595).
route(bus_595_1001,595,595).
route(bus_595_1004,595,595).
route(bus_595_1007,595,595).
route(bus_595_1014,595,595).
route(bus_595_11,595,595).
route(bus_595_12,595,595).
route(bus_595_14,595,595).
route(bus_595_2,595,595).
route(bus_595_4,595,595).
route(bus_595_7,595,595).
route(bus_595_7001,595,595).
route(bus_595_7002,595,595).
route(bus_595_8,595,595).
route(bus_595_9,595,595).
route(bus_595_9001,595,595).
route(bus_595_9002,595,595).
route(bus_596_1,596,596).
route(bus_596_1001,596,596).
route(bus_596_1002,596,596).
route(bus_596_1003,596,596).
route(bus_596_1004,596,596).
route(bus_596_2,596,596).
route(bus_596_3,596,596).
route(bus_596_4,596,596).
route(bus_596_7001,596,596).
route(bus_596_7002,596,596).
route(bus_596_9001,596,596).
route(bus_596_9002,596,596).
route(bus_597_2,597,597).
route(bus_597_3,597,597).
route(bus_597_4,597,597).
route(bus_597_5,597,597).
route(bus_597_6,597,597).
route(bus_5992_1,5992,5992).
route(bus_5992_2,5992,5992).
route(bus_601_10,601,601).
route(bus_601_1002,601,601).
route(bus_601_1006,601,601).
route(bus_601_1008,601,601).
route(bus_601_1010,601,601).
route(bus_601_1012,601,601).
route(bus_601_1014,601,601).
route(bus_601_1016,601,601).
route(bus_601_1018,601,601).
route(bus_601_1020,601,601).
route(bus_601_1022,601,601).
route(bus_601_1024,601,601).
route(bus_601_1026,601,601).
route(bus_601_1028,601,601).
route(bus_601_1030,601,601).
route(bus_601_1032,601,601).
route(bus_601_1034,601,601).
route(bus_601_1036,601,601).
route(bus_601_1038,601,601).
route(bus_601_1040,601,601).
route(bus_601_12,601,601).
route(bus_601_14,601,601).
route(bus_601_16,601,601).
route(bus_601_18,601,601).
route(bus_601_2,601,601).
route(bus_601_20,601,601).
route(bus_601_22,601,601).
route(bus_601_24,601,601).
route(bus_601_26,601,601).
route(bus_601_28,601,601).
route(bus_601_30,601,601).
route(bus_601_32,601,601).
route(bus_601_34,601,601).
route(bus_601_36,601,601).
route(bus_601_38,601,601).
route(bus_601_4,601,601).
route(bus_601_40,601,601).
route(bus_601_42,601,601).
route(bus_601_44,601,601).
route(bus_601_46,601,601).
route(bus_601_48,601,601).
route(bus_601_50,601,601).
route(bus_601_52,601,601).
route(bus_601_54,601,601).
route(bus_601_56,601,601).
route(bus_601_58,601,601).
route(bus_601_6,601,601).
route(bus_601_60,601,601).
route(bus_601_6002,601,601).
route(bus_601_6004,601,601).
route(bus_601_6006,601,601).
route(bus_601_6008,601,601).
route(bus_601_6010,601,601).
route(bus_601_6012,601,601).
route(bus_601_6014,601,601).
route(bus_601_6016,601,601).
route(bus_601_6018,601,601).
route(bus_601_6020,601,601).
route(bus_601_62,601,601).
route(bus_601_64,601,601).
route(bus_601_66,601,601).
route(bus_601_68,601,601).
route(bus_601_70,601,601).
route(bus_601_72,601,601).
route(bus_601_74,601,601).
route(bus_601_76,601,601).
route(bus_601_78,601,601).
route(bus_601_8,601,601).
route(bus_601_80,601,601).
route(bus_601_8002,601,601).
route(bus_601_8006,601,601).
route(bus_601_8008,601,601).
route(bus_601_8010,601,601).
route(bus_601_8012,601,601).
route(bus_601_8014,601,601).
route(bus_601_8016,601,601).
route(bus_601_8018,601,601).
route(bus_601_8020,601,601).
route(bus_601_82,601,601).
route(bus_601_84,601,601).
route(bus_601_86,601,601).
route(bus_601_88,601,601).
route(bus_603_1001,603,603).
route(bus_603_1003,603,603).
route(bus_603_1005,603,603).
route(bus_603_1007,603,603).
route(bus_603_273,603,603).
route(bus_603_275,603,603).
route(bus_603_277,603,603).
route(bus_603_279,603,603).
route(bus_603_281,603,603).
route(bus_603_283,603,603).
route(bus_603_285,603,603).
route(bus_603_287,603,603).
route(bus_603_289,603,603).
route(bus_603_291,603,603).
route(bus_603_293,603,603).
route(bus_603_295,603,603).
route(bus_603_297,603,603).
route(bus_603_8002,603,603).
route(bus_603_8004,603,603).
route(bus_603_8006,603,603).
route(bus_603_8008,603,603).
route(bus_603_8010,603,603).
route(bus_604_1002,604,604).
route(bus_604_1004,604,604).
route(bus_604_1006,604,604).
route(bus_604_1008,604,604).
route(bus_604_1010,604,604).
route(bus_604_1012,604,604).
route(bus_604_1014,604,604).
route(bus_604_1016,604,604).
route(bus_604_1018,604,604).
route(bus_604_1020,604,604).
route(bus_604_1022,604,604).
route(bus_604_1024,604,604).
route(bus_604_1026,604,604).
route(bus_604_1028,604,604).
route(bus_604_1030,604,604).
route(bus_604_1032,604,604).
route(bus_604_1034,604,604).
route(bus_604_1036,604,604).
route(bus_604_1038,604,604).
route(bus_604_8002,604,604).
route(bus_604_8004,604,604).
route(bus_604_8006,604,604).
route(bus_604_8008,604,604).
route(bus_604_8010,604,604).
route(bus_604_8012,604,604).
route(bus_605_1,605,605).
route(bus_605_10,605,605).
route(bus_605_11,605,605).
route(bus_605_12,605,605).
route(bus_605_13,605,605).
route(bus_605_14,605,605).
route(bus_605_15,605,605).
route(bus_605_16,605,605).
route(bus_605_17,605,605).
route(bus_605_18,605,605).
route(bus_605_19,605,605).
route(bus_605_2,605,605).
route(bus_605_20,605,605).
route(bus_605_21,605,605).
route(bus_605_22,605,605).
route(bus_605_23,605,605).
route(bus_605_24,605,605).
route(bus_605_25,605,605).
route(bus_605_26,605,605).
route(bus_605_27,605,605).
route(bus_605_28,605,605).
route(bus_605_3,605,605).
route(bus_605_4,605,605).
route(bus_605_5,605,605).
route(bus_605_6,605,605).
route(bus_605_7,605,605).
route(bus_605_8,605,605).
route(bus_605_9,605,605).
route(bus_606_1,606,606).
route(bus_606_10,606,606).
route(bus_606_11,606,606).
route(bus_606_12,606,606).
route(bus_606_13,606,606).
route(bus_606_14,606,606).
route(bus_606_15,606,606).
route(bus_606_16,606,606).
route(bus_606_17,606,606).
route(bus_606_18,606,606).
route(bus_606_19,606,606).
route(bus_606_2,606,606).
route(bus_606_20,606,606).
route(bus_606_21,606,606).
route(bus_606_22,606,606).
route(bus_606_23,606,606).
route(bus_606_24,606,606).
route(bus_606_25,606,606).
route(bus_606_26,606,606).
route(bus_606_3,606,606).
route(bus_606_4,606,606).
route(bus_606_5,606,606).
route(bus_606_6,606,606).
route(bus_606_7,606,606).
route(bus_606_8,606,606).
route(bus_606_9,606,606).
route(bus_608_1,608,608).
route(bus_608_10,608,608).
route(bus_608_1001,608,608).
route(bus_608_1002,608,608).
route(bus_608_1003,608,608).
route(bus_608_1004,608,608).
route(bus_608_1005,608,608).
route(bus_608_1006,608,608).
route(bus_608_1007,608,608).
route(bus_608_1008,608,608).
route(bus_608_1009,608,608).
route(bus_608_1010,608,608).
route(bus_608_1012,608,608).
route(bus_608_11,608,608).
route(bus_608_12,608,608).
route(bus_608_13,608,608).
route(bus_608_14,608,608).
route(bus_608_15,608,608).
route(bus_608_16,608,608).
route(bus_608_17,608,608).
route(bus_608_19,608,608).
route(bus_608_2,608,608).
route(bus_608_21,608,608).
route(bus_608_3,608,608).
route(bus_608_4,608,608).
route(bus_608_5,608,608).
route(bus_608_6,608,608).
route(bus_608_6001,608,608).
route(bus_608_6002,608,608).
route(bus_608_6003,608,608).
route(bus_608_6004,608,608).
route(bus_608_6005,608,608).
route(bus_608_6006,608,608).
route(bus_608_6007,608,608).
route(bus_608_6008,608,608).
route(bus_608_7,608,608).
route(bus_608_8,608,608).
route(bus_608_8001,608,608).
route(bus_608_8002,608,608).
route(bus_608_8004,608,608).
route(bus_608_8006,608,608).
route(bus_608_9,608,608).
route(bus_609_1,609,609).
route(bus_609_10,609,609).
route(bus_609_1001,609,609).
route(bus_609_1002,609,609).
route(bus_609_1003,609,609).
route(bus_609_1004,609,609).
route(bus_609_1005,609,609).
route(bus_609_1006,609,609).
route(bus_609_1007,609,609).
route(bus_609_1008,609,609).
route(bus_609_1009,609,609).
route(bus_609_1010,609,609).
route(bus_609_1011,609,609).
route(bus_609_1012,609,609).
route(bus_609_1013,609,609).
route(bus_609_1014,609,609).
route(bus_609_1015,609,609).
route(bus_609_1016,609,609).
route(bus_609_1017,609,609).
route(bus_609_1018,609,609).
route(bus_609_1019,609,609).
route(bus_609_1020,609,609).
route(bus_609_1021,609,609).
route(bus_609_1022,609,609).
route(bus_609_1023,609,609).
route(bus_609_1024,609,609).
route(bus_609_1025,609,609).
route(bus_609_1026,609,609).
route(bus_609_1027,609,609).
route(bus_609_1028,609,609).
route(bus_609_1029,609,609).
route(bus_609_11,609,609).
route(bus_609_12,609,609).
route(bus_609_13,609,609).
route(bus_609_14,609,609).
route(bus_609_15,609,609).
route(bus_609_16,609,609).
route(bus_609_17,609,609).
route(bus_609_18,609,609).
route(bus_609_19,609,609).
route(bus_609_2,609,609).
route(bus_609_20,609,609).
route(bus_609_21,609,609).
route(bus_609_22,609,609).
route(bus_609_23,609,609).
route(bus_609_24,609,609).
route(bus_609_25,609,609).
route(bus_609_26,609,609).
route(bus_609_27,609,609).
route(bus_609_28,609,609).
route(bus_609_29,609,609).
route(bus_609_3,609,609).
route(bus_609_30,609,609).
route(bus_609_31,609,609).
route(bus_609_32,609,609).
route(bus_609_33,609,609).
route(bus_609_34,609,609).
route(bus_609_35,609,609).
route(bus_609_36,609,609).
route(bus_609_37,609,609).
route(bus_609_38,609,609).
route(bus_609_39,609,609).
route(bus_609_4,609,609).
route(bus_609_40,609,609).
route(bus_609_41,609,609).
route(bus_609_42,609,609).
route(bus_609_43,609,609).
route(bus_609_44,609,609).
route(bus_609_45,609,609).
route(bus_609_46,609,609).
route(bus_609_47,609,609).
route(bus_609_48,609,609).
route(bus_609_49,609,609).
route(bus_609_5,609,609).
route(bus_609_51,609,609).
route(bus_609_6,609,609).
route(bus_609_6001,609,609).
route(bus_609_6002,609,609).
route(bus_609_6003,609,609).
route(bus_609_6004,609,609).
route(bus_609_6005,609,609).
route(bus_609_6006,609,609).
route(bus_609_6007,609,609).
route(bus_609_6008,609,609).
route(bus_609_6009,609,609).
route(bus_609_6010,609,609).
route(bus_609_7,609,609).
route(bus_609_8,609,609).
route(bus_609_8001,609,609).
route(bus_609_8002,609,609).
route(bus_609_8003,609,609).
route(bus_609_8004,609,609).
route(bus_609_8005,609,609).
route(bus_609_8006,609,609).
route(bus_609_8007,609,609).
route(bus_609_8008,609,609).
route(bus_609_8009,609,609).
route(bus_609_8010,609,609).
route(bus_609_9,609,609).
route(bus_610_1,610,610).
route(bus_610_10,610,610).
route(bus_610_1001,610,610).
route(bus_610_1002,610,610).
route(bus_610_1003,610,610).
route(bus_610_1004,610,610).
route(bus_610_1005,610,610).
route(bus_610_11,610,610).
route(bus_610_12,610,610).
route(bus_610_13,610,610).
route(bus_610_14,610,610).
route(bus_610_18,610,610).
route(bus_610_2,610,610).
route(bus_610_20,610,610).
route(bus_610_4,610,610).
route(bus_610_5,610,610).
route(bus_610_6,610,610).
route(bus_610_7,610,610).
route(bus_610_7001,610,610).
route(bus_610_7002,610,610).
route(bus_610_8,610,610).
route(bus_610_9,610,610).
route(bus_611_1,611,611).
route(bus_611_10,611,611).
route(bus_611_1001,611,611).
route(bus_611_1002,611,611).
route(bus_611_1003,611,611).
route(bus_611_11,611,611).
route(bus_611_12,611,611).
route(bus_611_13,611,611).
route(bus_611_2,611,611).
route(bus_611_4,611,611).
route(bus_611_5,611,611).
route(bus_611_6001,611,611).
route(bus_611_6002,611,611).
route(bus_611_7001,611,611).
route(bus_611_7002,611,611).
route(bus_611_8,611,611).
route(bus_611_9,611,611).
route(bus_615_2,615,615).
route(bus_615_4,615,615).
route(bus_615_5,615,615).
route(bus_615_7,615,615).
route(bus_615_7002,615,615).
route(bus_630_1,630,630).
route(bus_630_10,630,630).
route(bus_630_11,630,630).
route(bus_630_12,630,630).
route(bus_630_2,630,630).
route(bus_630_3,630,630).
route(bus_630_4,630,630).
route(bus_630_5,630,630).
route(bus_630_6,630,630).
route(bus_630_7,630,630).
route(bus_630_7001,630,630).
route(bus_630_7002,630,630).
route(bus_630_8,630,630).
route(bus_630_9,630,630).
route(bus_635_1,635,635).
route(bus_635_2,635,635).
route(bus_635_4,635,635).
route(bus_640_1,640,640).
route(bus_640_10,640,640).
route(bus_640_1001,640,640).
route(bus_640_1002,640,640).
route(bus_640_1003,640,640).
route(bus_640_1004,640,640).
route(bus_640_12,640,640).
route(bus_640_14,640,640).
route(bus_640_2,640,640).
route(bus_640_3,640,640).
route(bus_640_4,640,640).
route(bus_640_5,640,640).
route(bus_640_6,640,640).
route(bus_640_7,640,640).
route(bus_640_7047,640,640).
route(bus_640_7049,640,640).
route(bus_640_7051,640,640).
route(bus_640_7053,640,640).
route(bus_640_8,640,640).
route(bus_660_1,660,660).
route(bus_660_10,660,660).
route(bus_660_1001,660,660).
route(bus_660_1002,660,660).
route(bus_660_1003,660,660).
route(bus_660_1004,660,660).
route(bus_660_1005,660,660).
route(bus_660_1006,660,660).
route(bus_660_1007,660,660).
route(bus_660_1008,660,660).
route(bus_660_1009,660,660).
route(bus_660_1010,660,660).
route(bus_660_1011,660,660).
route(bus_660_1012,660,660).
route(bus_660_1013,660,660).
route(bus_660_1014,660,660).
route(bus_660_1015,660,660).
route(bus_660_1017,660,660).
route(bus_660_11,660,660).
route(bus_660_12,660,660).
route(bus_660_13,660,660).
route(bus_660_14,660,660).
route(bus_660_15,660,660).
route(bus_660_16,660,660).
route(bus_660_17,660,660).
route(bus_660_18,660,660).
route(bus_660_19,660,660).
route(bus_660_2,660,660).
route(bus_660_20,660,660).
route(bus_660_21,660,660).
route(bus_660_22,660,660).
route(bus_660_23,660,660).
route(bus_660_24,660,660).
route(bus_660_25,660,660).
route(bus_660_27,660,660).
route(bus_660_3,660,660).
route(bus_660_4,660,660).
route(bus_660_5,660,660).
route(bus_660_6,660,660).
route(bus_660_7,660,660).
route(bus_660_7001,660,660).
route(bus_660_7002,660,660).
route(bus_660_7105,660,660).
route(bus_660_8,660,660).
route(bus_660_9,660,660).
route(bus_660_9001,660,660).
route(bus_660_9002,660,660).
route(bus_665_1,665,665).
route(bus_665_10,665,665).
route(bus_665_1001,665,665).
route(bus_665_1002,665,665).
route(bus_665_1003,665,665).
route(bus_665_1004,665,665).
route(bus_665_18,665,665).
route(bus_665_2,665,665).
route(bus_665_20,665,665).
route(bus_665_24,665,665).
route(bus_665_3,665,665).
route(bus_665_4,665,665).
route(bus_665_5,665,665).
route(bus_665_6,665,665).
route(bus_665_7,665,665).
route(bus_665_7001,665,665).
route(bus_665_7002,665,665).
route(bus_665_8,665,665).
route(bus_665_9,665,665).
route(bus_670_1,670,670).
route(bus_670_10,670,670).
route(bus_670_1001,670,670).
route(bus_670_1002,670,670).
route(bus_670_1003,670,670).
route(bus_670_1004,670,670).
route(bus_670_1005,670,670).
route(bus_670_1006,670,670).
route(bus_670_1008,670,670).
route(bus_670_1009,670,670).
route(bus_670_11,670,670).
route(bus_670_13,670,670).
route(bus_670_2,670,670).
route(bus_670_3,670,670).
route(bus_670_4,670,670).
route(bus_670_5,670,670).
route(bus_670_6,670,670).
route(bus_670_6001,670,670).
route(bus_670_6002,670,670).
route(bus_670_6003,670,670).
route(bus_670_6004,670,670).
route(bus_670_6005,670,670).
route(bus_670_6006,670,670).
route(bus_670_7,670,670).
route(bus_670_7001,670,670).
route(bus_670_7002,670,670).
route(bus_670_8,670,670).
route(bus_670_8001,670,670).
route(bus_670_8002,670,670).
route(bus_670_8005,670,670).
route(bus_670_8006,670,670).
route(bus_670_8671,670,670).
route(bus_670_9,670,670).
route(bus_670_9002,670,670).
route(bus_680_1,680,680).
route(bus_680_10,680,680).
route(bus_680_11,680,680).
route(bus_680_12,680,680).
route(bus_680_13,680,680).
route(bus_680_14,680,680).
route(bus_680_15,680,680).
route(bus_680_16,680,680).
route(bus_680_17,680,680).
route(bus_680_174,680,680).
route(bus_680_176,680,680).
route(bus_680_178,680,680).
route(bus_680_18,680,680).
route(bus_680_180,680,680).
route(bus_680_182,680,680).
route(bus_680_184,680,680).
route(bus_680_186,680,680).
route(bus_680_19,680,680).
route(bus_680_190,680,680).
route(bus_680_192,680,680).
route(bus_680_194,680,680).
route(bus_680_198,680,680).
route(bus_680_2,680,680).
route(bus_680_20,680,680).
route(bus_680_200,680,680).
route(bus_680_21,680,680).
route(bus_680_22,680,680).
route(bus_680_23,680,680).
route(bus_680_24,680,680).
route(bus_680_25,680,680).
route(bus_680_26,680,680).
route(bus_680_27,680,680).
route(bus_680_28,680,680).
route(bus_680_29,680,680).
route(bus_680_3,680,680).
route(bus_680_4,680,680).
route(bus_680_433113,680,680).
route(bus_680_4432,680,680).
route(bus_680_4532,680,680).
route(bus_680_5,680,680).
route(bus_680_50202,680,680).
route(bus_680_50203,680,680).
route(bus_680_50204,680,680).
route(bus_680_50205,680,680).
route(bus_680_56205,680,680).
route(bus_680_6,680,680).
route(bus_680_6001,680,680).
route(bus_680_6002,680,680).
route(bus_680_6003,680,680).
route(bus_680_6004,680,680).
route(bus_680_6005,680,680).
route(bus_680_6006,680,680).
route(bus_680_6007,680,680).
route(bus_680_6008,680,680).
route(bus_680_60220,680,680).
route(bus_680_60221,680,680).
route(bus_680_64220,680,680).
route(bus_680_64221,680,680).
route(bus_680_67220,680,680).
route(bus_680_67221,680,680).
route(bus_680_67222,680,680).
route(bus_680_67223,680,680).
route(bus_680_67224,680,680).
route(bus_680_67225,680,680).
route(bus_680_7,680,680).
route(bus_680_7001,680,680).
route(bus_680_7002,680,680).
route(bus_680_7003,680,680).
route(bus_680_7004,680,680).
route(bus_680_7005,680,680).
route(bus_680_7006,680,680).
route(bus_680_7007,680,680).
route(bus_680_7008,680,680).
route(bus_680_742111,680,680).
route(bus_680_772111,680,680).
route(bus_680_772112,680,680).
route(bus_680_772113,680,680).
route(bus_680_8,680,680).
route(bus_680_822112,680,680).
route(bus_680_9,680,680).
route(bus_681_1,681,681).
route(bus_681_2,681,681).
route(bus_681_3,681,681).
route(bus_681_7002,681,681).
route(bus_685_1,685,685).
route(bus_685_10,685,685).
route(bus_685_1002,685,685).
route(bus_685_1012,685,685).
route(bus_685_11,685,685).
route(bus_685_12,685,685).
route(bus_685_13,685,685).
route(bus_685_14,685,685).
route(bus_685_16,685,685).
route(bus_685_18,685,685).
route(bus_685_21,685,685).
route(bus_685_23,685,685).
route(bus_685_4,685,685).
route(bus_685_5,685,685).
route(bus_685_6,685,685).
route(bus_685_64,685,685).
route(bus_685_66,685,685).
route(bus_685_68,685,685).
route(bus_685_8,685,685).
route(bus_685_9,685,685).
route(bus_686_1,686,686).
route(bus_686_1001,686,686).
route(bus_686_1002,686,686).
route(bus_686_1004,686,686).
route(bus_686_2,686,686).
route(bus_686_3,686,686).
route(bus_686_4,686,686).
route(bus_686_5,686,686).
route(bus_686_7,686,686).
route(bus_686_7001,686,686).
route(bus_686_7002,686,686).
route(bus_690_1,690,690).
route(bus_690_1001,690,690).
route(bus_690_1002,690,690).
route(bus_690_1003,690,690).
route(bus_690_1004,690,690).
route(bus_690_1005,690,690).
route(bus_690_1006,690,690).
route(bus_690_1007,690,690).
route(bus_690_1008,690,690).
route(bus_690_1010,690,690).
route(bus_690_2,690,690).
route(bus_690_3,690,690).
route(bus_690_4,690,690).
route(bus_690_5,690,690).
route(bus_690_6,690,690).
route(bus_690_6001,690,690).
route(bus_690_6002,690,690).
route(bus_690_7,690,690).
route(bus_690_7001,690,690).
route(bus_690_7002,690,690).
route(bus_690_8,690,690).
route(bus_690_8001,690,690).
route(bus_690_8002,690,690).
route(bus_690_9,690,690).
route(bus_690_9001,690,690).
route(bus_690_9002,690,690).
route(bus_695_1,695,695).
route(bus_695_10,695,695).
route(bus_695_1001,695,695).
route(bus_695_1002,695,695).
route(bus_695_1003,695,695).
route(bus_695_1004,695,695).
route(bus_695_1005,695,695).
route(bus_695_1006,695,695).
route(bus_695_1007,695,695).
route(bus_695_1008,695,695).
route(bus_695_1009,695,695).
route(bus_695_1010,695,695).
route(bus_695_1011,695,695).
route(bus_695_1012,695,695).
route(bus_695_1014,695,695).
route(bus_695_11,695,695).
route(bus_695_12,695,695).
route(bus_695_13,695,695).
route(bus_695_14,695,695).
route(bus_695_2,695,695).
route(bus_695_3,695,695).
route(bus_695_4,695,695).
route(bus_695_5,695,695).
route(bus_695_6,695,695).
route(bus_695_6001,695,695).
route(bus_695_6002,695,695).
route(bus_695_6003,695,695).
route(bus_695_6004,695,695).
route(bus_695_7,695,695).
route(bus_695_7001,695,695).
route(bus_695_7002,695,695).
route(bus_695_7003,695,695).
route(bus_695_7004,695,695).
route(bus_695_8,695,695).
route(bus_695_8001,695,695).
route(bus_695_8002,695,695).
route(bus_695_8003,695,695).
route(bus_695_8004,695,695).
route(bus_695_9,695,695).
route(bus_695_9001,695,695).
route(bus_695_9002,695,695).
route(bus_70_1,70,70).
route(bus_70_10,70,70).
route(bus_70_100,70,70).
route(bus_70_101,70,70).
route(bus_70_102,70,70).
route(bus_70_103,70,70).
route(bus_70_104,70,70).
route(bus_70_105,70,70).
route(bus_70_106,70,70).
route(bus_70_107,70,70).
route(bus_70_108,70,70).
route(bus_70_109,70,70).
route(bus_70_11,70,70).
route(bus_70_110,70,70).
route(bus_70_111,70,70).
route(bus_70_112,70,70).
route(bus_70_113,70,70).
route(bus_70_114,70,70).
route(bus_70_115,70,70).
route(bus_70_12,70,70).
route(bus_70_13,70,70).
route(bus_70_14,70,70).
route(bus_70_15,70,70).
route(bus_70_16,70,70).
route(bus_70_17,70,70).
route(bus_70_18,70,70).
route(bus_70_19,70,70).
route(bus_70_2,70,70).
route(bus_70_20,70,70).
route(bus_70_21,70,70).
route(bus_70_22,70,70).
route(bus_70_23,70,70).
route(bus_70_24,70,70).
route(bus_70_25,70,70).
route(bus_70_26,70,70).
route(bus_70_27,70,70).
route(bus_70_28,70,70).
route(bus_70_29,70,70).
route(bus_70_3,70,70).
route(bus_70_30,70,70).
route(bus_70_31,70,70).
route(bus_70_32,70,70).
route(bus_70_33,70,70).
route(bus_70_34,70,70).
route(bus_70_35,70,70).
route(bus_70_36,70,70).
route(bus_70_37,70,70).
route(bus_70_38,70,70).
route(bus_70_39,70,70).
route(bus_70_4,70,70).
route(bus_70_40,70,70).
route(bus_70_41,70,70).
route(bus_70_42,70,70).
route(bus_70_43,70,70).
route(bus_70_44,70,70).
route(bus_70_45,70,70).
route(bus_70_46,70,70).
route(bus_70_47,70,70).
route(bus_70_48,70,70).
route(bus_70_49,70,70).
route(bus_70_5,70,70).
route(bus_70_50,70,70).
route(bus_70_51,70,70).
route(bus_70_52,70,70).
route(bus_70_53,70,70).
route(bus_70_54,70,70).
route(bus_70_55,70,70).
route(bus_70_56,70,70).
route(bus_70_57,70,70).
route(bus_70_58,70,70).
route(bus_70_59,70,70).
route(bus_70_6,70,70).
route(bus_70_60,70,70).
route(bus_70_6001,70,70).
route(bus_70_6002,70,70).
route(bus_70_6003,70,70).
route(bus_70_6004,70,70).
route(bus_70_6005,70,70).
route(bus_70_6006,70,70).
route(bus_70_6007,70,70).
route(bus_70_6008,70,70).
route(bus_70_6009,70,70).
route(bus_70_6010,70,70).
route(bus_70_6011,70,70).
route(bus_70_6012,70,70).
route(bus_70_6013,70,70).
route(bus_70_6014,70,70).
route(bus_70_6015,70,70).
route(bus_70_6016,70,70).
route(bus_70_6017,70,70).
route(bus_70_6018,70,70).
route(bus_70_6019,70,70).
route(bus_70_6020,70,70).
route(bus_70_6021,70,70).
route(bus_70_6022,70,70).
route(bus_70_6023,70,70).
route(bus_70_6024,70,70).
route(bus_70_6025,70,70).
route(bus_70_6026,70,70).
route(bus_70_6027,70,70).
route(bus_70_6028,70,70).
route(bus_70_6029,70,70).
route(bus_70_6030,70,70).
route(bus_70_6031,70,70).
route(bus_70_6032,70,70).
route(bus_70_6033,70,70).
route(bus_70_6034,70,70).
route(bus_70_6035,70,70).
route(bus_70_6036,70,70).
route(bus_70_6037,70,70).
route(bus_70_6038,70,70).
route(bus_70_6039,70,70).
route(bus_70_6040,70,70).
route(bus_70_6041,70,70).
route(bus_70_6042,70,70).
route(bus_70_6043,70,70).
route(bus_70_6044,70,70).
route(bus_70_6045,70,70).
route(bus_70_6046,70,70).
route(bus_70_6047,70,70).
route(bus_70_6048,70,70).
route(bus_70_6049,70,70).
route(bus_70_6050,70,70).
route(bus_70_6051,70,70).
route(bus_70_6052,70,70).
route(bus_70_6053,70,70).
route(bus_70_6054,70,70).
route(bus_70_6055,70,70).
route(bus_70_6056,70,70).
route(bus_70_6057,70,70).
route(bus_70_6058,70,70).
route(bus_70_6059,70,70).
route(bus_70_6060,70,70).
route(bus_70_6061,70,70).
route(bus_70_6062,70,70).
route(bus_70_6063,70,70).
route(bus_70_6064,70,70).
route(bus_70_6065,70,70).
route(bus_70_6066,70,70).
route(bus_70_6067,70,70).
route(bus_70_6068,70,70).
route(bus_70_6069,70,70).
route(bus_70_6070,70,70).
route(bus_70_6071,70,70).
route(bus_70_6072,70,70).
route(bus_70_6073,70,70).
route(bus_70_6074,70,70).
route(bus_70_6075,70,70).
route(bus_70_6076,70,70).
route(bus_70_6077,70,70).
route(bus_70_6078,70,70).
route(bus_70_6079,70,70).
route(bus_70_6080,70,70).
route(bus_70_6081,70,70).
route(bus_70_6082,70,70).
route(bus_70_6083,70,70).
route(bus_70_6084,70,70).
route(bus_70_6085,70,70).
route(bus_70_6086,70,70).
route(bus_70_6087,70,70).
route(bus_70_6088,70,70).
route(bus_70_6089,70,70).
route(bus_70_6090,70,70).
route(bus_70_6091,70,70).
route(bus_70_6092,70,70).
route(bus_70_6093,70,70).
route(bus_70_6094,70,70).
route(bus_70_6095,70,70).
route(bus_70_6096,70,70).
route(bus_70_6097,70,70).
route(bus_70_6098,70,70).
route(bus_70_6099,70,70).
route(bus_70_61,70,70).
route(bus_70_6100,70,70).
route(bus_70_6102,70,70).
route(bus_70_6104,70,70).
route(bus_70_62,70,70).
route(bus_70_63,70,70).
route(bus_70_64,70,70).
route(bus_70_65,70,70).
route(bus_70_66,70,70).
route(bus_70_67,70,70).
route(bus_70_68,70,70).
route(bus_70_69,70,70).
route(bus_70_7,70,70).
route(bus_70_70,70,70).
route(bus_70_7001,70,70).
route(bus_70_7002,70,70).
route(bus_70_7003,70,70).
route(bus_70_7004,70,70).
route(bus_70_7005,70,70).
route(bus_70_7006,70,70).
route(bus_70_7007,70,70).
route(bus_70_7008,70,70).
route(bus_70_7009,70,70).
route(bus_70_7010,70,70).
route(bus_70_7011,70,70).
route(bus_70_7012,70,70).
route(bus_70_7013,70,70).
route(bus_70_7014,70,70).
route(bus_70_7015,70,70).
route(bus_70_7016,70,70).
route(bus_70_7017,70,70).
route(bus_70_7018,70,70).
route(bus_70_7019,70,70).
route(bus_70_7020,70,70).
route(bus_70_7021,70,70).
route(bus_70_7022,70,70).
route(bus_70_7023,70,70).
route(bus_70_7024,70,70).
route(bus_70_7025,70,70).
route(bus_70_7026,70,70).
route(bus_70_7027,70,70).
route(bus_70_7028,70,70).
route(bus_70_7029,70,70).
route(bus_70_7030,70,70).
route(bus_70_7031,70,70).
route(bus_70_7032,70,70).
route(bus_70_7033,70,70).
route(bus_70_7034,70,70).
route(bus_70_7035,70,70).
route(bus_70_7036,70,70).
route(bus_70_7037,70,70).
route(bus_70_7038,70,70).
route(bus_70_7039,70,70).
route(bus_70_7040,70,70).
route(bus_70_7041,70,70).
route(bus_70_7042,70,70).
route(bus_70_7043,70,70).
route(bus_70_7044,70,70).
route(bus_70_7045,70,70).
route(bus_70_7046,70,70).
route(bus_70_7047,70,70).
route(bus_70_7048,70,70).
route(bus_70_7049,70,70).
route(bus_70_7050,70,70).
route(bus_70_7051,70,70).
route(bus_70_7052,70,70).
route(bus_70_7053,70,70).
route(bus_70_7054,70,70).
route(bus_70_7055,70,70).
route(bus_70_7056,70,70).
route(bus_70_7057,70,70).
route(bus_70_7058,70,70).
route(bus_70_7059,70,70).
route(bus_70_7060,70,70).
route(bus_70_7061,70,70).
route(bus_70_71,70,70).
route(bus_70_72,70,70).
route(bus_70_73,70,70).
route(bus_70_74,70,70).
route(bus_70_75,70,70).
route(bus_70_76,70,70).
route(bus_70_77,70,70).
route(bus_70_78,70,70).
route(bus_70_79,70,70).
route(bus_70_8,70,70).
route(bus_70_80,70,70).
route(bus_70_81,70,70).
route(bus_70_82,70,70).
route(bus_70_83,70,70).
route(bus_70_84,70,70).
route(bus_70_85,70,70).
route(bus_70_86,70,70).
route(bus_70_87,70,70).
route(bus_70_88,70,70).
route(bus_70_89,70,70).
route(bus_70_9,70,70).
route(bus_70_90,70,70).
route(bus_70_91,70,70).
route(bus_70_92,70,70).
route(bus_70_93,70,70).
route(bus_70_94,70,70).
route(bus_70_95,70,70).
route(bus_70_96,70,70).
route(bus_70_97,70,70).
route(bus_70_98,70,70).
route(bus_70_99,70,70).
route(bus_7101_1,7101,7101).
route(bus_7101_2,7101,7101).
route(bus_7105_1,7105,7105).
route(bus_7105_2,7105,7105).
route(bus_7105_3,7105,7105).
route(bus_7105_4,7105,7105).
route(bus_7106_1,7106,7106).
route(bus_7106_2,7106,7106).
route(bus_7106_3,7106,7106).
route(bus_7106_4,7106,7106).
route(bus_7106_52,7106,7106).
route(bus_7106_6,7106,7106).
route(bus_7109_1,7109,7109).
route(bus_7109_2,7109,7109).
route(bus_7111_1,7111,7111).
route(bus_7111_2,7111,7111).
route(bus_71_1,71,71).
route(bus_71_10,71,71).
route(bus_71_11,71,71).
route(bus_71_12,71,71).
route(bus_71_13,71,71).
route(bus_71_14,71,71).
route(bus_71_15,71,71).
route(bus_71_16,71,71).
route(bus_71_17,71,71).
route(bus_71_18,71,71).
route(bus_71_19,71,71).
route(bus_71_2,71,71).
route(bus_71_20,71,71).
route(bus_71_21,71,71).
route(bus_71_22,71,71).
route(bus_71_23,71,71).
route(bus_71_24,71,71).
route(bus_71_25,71,71).
route(bus_71_26,71,71).
route(bus_71_27,71,71).
route(bus_71_28,71,71).
route(bus_71_29,71,71).
route(bus_71_3,71,71).
route(bus_71_30,71,71).
route(bus_71_31,71,71).
route(bus_71_32,71,71).
route(bus_71_33,71,71).
route(bus_71_34,71,71).
route(bus_71_35,71,71).
route(bus_71_36,71,71).
route(bus_71_37,71,71).
route(bus_71_38,71,71).
route(bus_71_39,71,71).
route(bus_71_4,71,71).
route(bus_71_40,71,71).
route(bus_71_41,71,71).
route(bus_71_42,71,71).
route(bus_71_43,71,71).
route(bus_71_44,71,71).
route(bus_71_45,71,71).
route(bus_71_46,71,71).
route(bus_71_47,71,71).
route(bus_71_48,71,71).
route(bus_71_49,71,71).
route(bus_71_5,71,71).
route(bus_71_50,71,71).
route(bus_71_51,71,71).
route(bus_71_52,71,71).
route(bus_71_53,71,71).
route(bus_71_54,71,71).
route(bus_71_55,71,71).
route(bus_71_56,71,71).
route(bus_71_57,71,71).
route(bus_71_58,71,71).
route(bus_71_59,71,71).
route(bus_71_6,71,71).
route(bus_71_60,71,71).
route(bus_71_6001,71,71).
route(bus_71_6002,71,71).
route(bus_71_6003,71,71).
route(bus_71_6004,71,71).
route(bus_71_6005,71,71).
route(bus_71_6006,71,71).
route(bus_71_6007,71,71).
route(bus_71_6008,71,71).
route(bus_71_6009,71,71).
route(bus_71_6010,71,71).
route(bus_71_6011,71,71).
route(bus_71_6012,71,71).
route(bus_71_6013,71,71).
route(bus_71_6014,71,71).
route(bus_71_6015,71,71).
route(bus_71_6016,71,71).
route(bus_71_6017,71,71).
route(bus_71_6018,71,71).
route(bus_71_6019,71,71).
route(bus_71_6020,71,71).
route(bus_71_6021,71,71).
route(bus_71_6022,71,71).
route(bus_71_6023,71,71).
route(bus_71_6024,71,71).
route(bus_71_6025,71,71).
route(bus_71_6026,71,71).
route(bus_71_6027,71,71).
route(bus_71_6028,71,71).
route(bus_71_6029,71,71).
route(bus_71_6030,71,71).
route(bus_71_6031,71,71).
route(bus_71_6032,71,71).
route(bus_71_6033,71,71).
route(bus_71_6034,71,71).
route(bus_71_6035,71,71).
route(bus_71_6036,71,71).
route(bus_71_6037,71,71).
route(bus_71_61,71,71).
route(bus_71_62,71,71).
route(bus_71_63,71,71).
route(bus_71_64,71,71).
route(bus_71_65,71,71).
route(bus_71_66,71,71).
route(bus_71_67,71,71).
route(bus_71_68,71,71).
route(bus_71_69,71,71).
route(bus_71_7,71,71).
route(bus_71_70,71,71).
route(bus_71_7001,71,71).
route(bus_71_7002,71,71).
route(bus_71_7003,71,71).
route(bus_71_7004,71,71).
route(bus_71_7005,71,71).
route(bus_71_7006,71,71).
route(bus_71_7007,71,71).
route(bus_71_7008,71,71).
route(bus_71_7009,71,71).
route(bus_71_7010,71,71).
route(bus_71_7011,71,71).
route(bus_71_7012,71,71).
route(bus_71_7013,71,71).
route(bus_71_7014,71,71).
route(bus_71_7015,71,71).
route(bus_71_7016,71,71).
route(bus_71_7017,71,71).
route(bus_71_7018,71,71).
route(bus_71_7019,71,71).
route(bus_71_7020,71,71).
route(bus_71_7021,71,71).
route(bus_71_7022,71,71).
route(bus_71_7023,71,71).
route(bus_71_7024,71,71).
route(bus_71_7025,71,71).
route(bus_71_7026,71,71).
route(bus_71_7027,71,71).
route(bus_71_7028,71,71).
route(bus_71_7029,71,71).
route(bus_71_7030,71,71).
route(bus_71_7031,71,71).
route(bus_71_71,71,71).
route(bus_71_72,71,71).
route(bus_71_73,71,71).
route(bus_71_74,71,71).
route(bus_71_75,71,71).
route(bus_71_76,71,71).
route(bus_71_77,71,71).
route(bus_71_78,71,71).
route(bus_71_79,71,71).
route(bus_71_8,71,71).
route(bus_71_80,71,71).
route(bus_71_81,71,71).
route(bus_71_82,71,71).
route(bus_71_83,71,71).
route(bus_71_84,71,71).
route(bus_71_85,71,71).
route(bus_71_86,71,71).
route(bus_71_88,71,71).
route(bus_71_9,71,71).
route(bus_7201_1,7201,7201).
route(bus_7201_2,7201,7201).
route(bus_7201_3,7201,7201).
route(bus_7201_4,7201,7201).
route(bus_7201_7,7201,7201).
route(bus_7201_8,7201,7201).
route(bus_7202_1,7202,7202).
route(bus_7202_2,7202,7202).
route(bus_7202_3,7202,7202).
route(bus_7202_4,7202,7202).
route(bus_7202_5,7202,7202).
route(bus_7202_7,7202,7202).
route(bus_7203_148,7203,7203).
route(bus_7203_2,7203,7203).
route(bus_7203_4,7203,7203).
route(bus_7204_1,7204,7204).
route(bus_7204_2,7204,7204).
route(bus_7205_1,7205,7205).
route(bus_7205_10,7205,7205).
route(bus_7205_3,7205,7205).
route(bus_7205_5,7205,7205).
route(bus_7205_6,7205,7205).
route(bus_7205_7087,7205,7205).
route(bus_7205_7099,7205,7205).
route(bus_7205_8,7205,7205).
route(bus_7206_1,7206,7206).
route(bus_7206_2,7206,7206).
route(bus_7206_4,7206,7206).
route(bus_7206_6,7206,7206).
route(bus_7207_2,7207,7207).
route(bus_7208_11,7208,7208).
route(bus_7208_13,7208,7208).
route(bus_7208_2,7208,7208).
route(bus_7208_3,7208,7208).
route(bus_7208_4,7208,7208).
route(bus_7208_5,7208,7208).
route(bus_7208_7,7208,7208).
route(bus_7208_8,7208,7208).
route(bus_7208_9,7208,7208).
route(bus_7209_2,7209,7209).
route(bus_7210_1,7210,7210).
route(bus_7210_2,7210,7210).
route(bus_721_1,721,721).
route(bus_721_2,721,721).
route(bus_721_3,721,721).
route(bus_721_4,721,721).
route(bus_722_1,722,722).
route(bus_722_1001,722,722).
route(bus_722_1002,722,722).
route(bus_722_1003,722,722).
route(bus_722_1004,722,722).
route(bus_722_1005,722,722).
route(bus_722_1006,722,722).
route(bus_722_1007,722,722).
route(bus_722_1008,722,722).
route(bus_722_1009,722,722).
route(bus_722_12,722,722).
route(bus_722_14,722,722).
route(bus_722_16,722,722).
route(bus_722_2,722,722).
route(bus_722_3,722,722).
route(bus_722_4,722,722).
route(bus_722_5,722,722).
route(bus_722_6,722,722).
route(bus_722_7,722,722).
route(bus_723_1,723,723).
route(bus_723_1001,723,723).
route(bus_723_1002,723,723).
route(bus_723_2,723,723).
route(bus_723_4,723,723).
route(bus_72_1,72,72).
route(bus_72_10,72,72).
route(bus_72_11,72,72).
route(bus_72_12,72,72).
route(bus_72_13,72,72).
route(bus_72_14,72,72).
route(bus_72_15,72,72).
route(bus_72_16,72,72).
route(bus_72_17,72,72).
route(bus_72_18,72,72).
route(bus_72_19,72,72).
route(bus_72_2,72,72).
route(bus_72_20,72,72).
route(bus_72_21,72,72).
route(bus_72_22,72,72).
route(bus_72_23,72,72).
route(bus_72_24,72,72).
route(bus_72_25,72,72).
route(bus_72_26,72,72).
route(bus_72_27,72,72).
route(bus_72_28,72,72).
route(bus_72_29,72,72).
route(bus_72_3,72,72).
route(bus_72_30,72,72).
route(bus_72_31,72,72).
route(bus_72_32,72,72).
route(bus_72_33,72,72).
route(bus_72_34,72,72).
route(bus_72_35,72,72).
route(bus_72_36,72,72).
route(bus_72_37,72,72).
route(bus_72_38,72,72).
route(bus_72_39,72,72).
route(bus_72_4,72,72).
route(bus_72_40,72,72).
route(bus_72_41,72,72).
route(bus_72_42,72,72).
route(bus_72_43,72,72).
route(bus_72_44,72,72).
route(bus_72_45,72,72).
route(bus_72_46,72,72).
route(bus_72_47,72,72).
route(bus_72_48,72,72).
route(bus_72_49,72,72).
route(bus_72_5,72,72).
route(bus_72_50,72,72).
route(bus_72_51,72,72).
route(bus_72_52,72,72).
route(bus_72_53,72,72).
route(bus_72_54,72,72).
route(bus_72_55,72,72).
route(bus_72_56,72,72).
route(bus_72_57,72,72).
route(bus_72_58,72,72).
route(bus_72_59,72,72).
route(bus_72_6,72,72).
route(bus_72_60,72,72).
route(bus_72_6001,72,72).
route(bus_72_6002,72,72).
route(bus_72_6003,72,72).
route(bus_72_6004,72,72).
route(bus_72_6005,72,72).
route(bus_72_6006,72,72).
route(bus_72_6007,72,72).
route(bus_72_6008,72,72).
route(bus_72_6009,72,72).
route(bus_72_6010,72,72).
route(bus_72_6011,72,72).
route(bus_72_6012,72,72).
route(bus_72_6013,72,72).
route(bus_72_6014,72,72).
route(bus_72_6015,72,72).
route(bus_72_6016,72,72).
route(bus_72_6017,72,72).
route(bus_72_6018,72,72).
route(bus_72_6019,72,72).
route(bus_72_6020,72,72).
route(bus_72_6021,72,72).
route(bus_72_6022,72,72).
route(bus_72_6023,72,72).
route(bus_72_6024,72,72).
route(bus_72_6025,72,72).
route(bus_72_6026,72,72).
route(bus_72_6027,72,72).
route(bus_72_6028,72,72).
route(bus_72_6029,72,72).
route(bus_72_6030,72,72).
route(bus_72_6031,72,72).
route(bus_72_6032,72,72).
route(bus_72_6033,72,72).
route(bus_72_6034,72,72).
route(bus_72_6035,72,72).
route(bus_72_6036,72,72).
route(bus_72_6037,72,72).
route(bus_72_6038,72,72).
route(bus_72_6039,72,72).
route(bus_72_6040,72,72).
route(bus_72_6041,72,72).
route(bus_72_6042,72,72).
route(bus_72_6043,72,72).
route(bus_72_6044,72,72).
route(bus_72_6045,72,72).
route(bus_72_6046,72,72).
route(bus_72_6047,72,72).
route(bus_72_6048,72,72).
route(bus_72_6049,72,72).
route(bus_72_6050,72,72).
route(bus_72_6051,72,72).
route(bus_72_6052,72,72).
route(bus_72_6053,72,72).
route(bus_72_6054,72,72).
route(bus_72_6055,72,72).
route(bus_72_6056,72,72).
route(bus_72_6057,72,72).
route(bus_72_6058,72,72).
route(bus_72_6059,72,72).
route(bus_72_6060,72,72).
route(bus_72_6061,72,72).
route(bus_72_61,72,72).
route(bus_72_62,72,72).
route(bus_72_63,72,72).
route(bus_72_64,72,72).
route(bus_72_65,72,72).
route(bus_72_66,72,72).
route(bus_72_67,72,72).
route(bus_72_68,72,72).
route(bus_72_69,72,72).
route(bus_72_7,72,72).
route(bus_72_70,72,72).
route(bus_72_7001,72,72).
route(bus_72_7002,72,72).
route(bus_72_7003,72,72).
route(bus_72_7004,72,72).
route(bus_72_7005,72,72).
route(bus_72_7006,72,72).
route(bus_72_7007,72,72).
route(bus_72_7008,72,72).
route(bus_72_7009,72,72).
route(bus_72_7010,72,72).
route(bus_72_7011,72,72).
route(bus_72_7012,72,72).
route(bus_72_7013,72,72).
route(bus_72_7014,72,72).
route(bus_72_7015,72,72).
route(bus_72_7016,72,72).
route(bus_72_7017,72,72).
route(bus_72_7018,72,72).
route(bus_72_7019,72,72).
route(bus_72_7020,72,72).
route(bus_72_7021,72,72).
route(bus_72_7022,72,72).
route(bus_72_7023,72,72).
route(bus_72_7024,72,72).
route(bus_72_7025,72,72).
route(bus_72_7026,72,72).
route(bus_72_7027,72,72).
route(bus_72_7028,72,72).
route(bus_72_7029,72,72).
route(bus_72_7030,72,72).
route(bus_72_7031,72,72).
route(bus_72_71,72,72).
route(bus_72_73,72,72).
route(bus_72_75,72,72).
route(bus_72_8,72,72).
route(bus_72_9,72,72).
route(bus_7301_2,7301,7301).
route(bus_7301_3,7301,7301).
route(bus_7301_4,7301,7301).
route(bus_7301_5,7301,7301).
route(bus_7301_6,7301,7301).
route(bus_7301_6278,7301,7301).
route(bus_7302_1,7302,7302).
route(bus_7302_10,7302,7302).
route(bus_7302_15,7302,7302).
route(bus_7302_17,7302,7302).
route(bus_7302_19,7302,7302).
route(bus_7302_2,7302,7302).
route(bus_7302_21,7302,7302).
route(bus_7302_23,7302,7302).
route(bus_7302_25,7302,7302).
route(bus_7302_3,7302,7302).
route(bus_7302_4,7302,7302).
route(bus_7302_5,7302,7302).
route(bus_7302_6,7302,7302).
route(bus_7302_8,7302,7302).
route(bus_7303_1,7303,7303).
route(bus_7303_10,7303,7303).
route(bus_7303_11,7303,7303).
route(bus_7303_12,7303,7303).
route(bus_7303_2,7303,7303).
route(bus_7303_21,7303,7303).
route(bus_7303_3,7303,7303).
route(bus_7303_4,7303,7303).
route(bus_7303_5,7303,7303).
route(bus_7303_6,7303,7303).
route(bus_7303_6280,7303,7303).
route(bus_7303_7,7303,7303).
route(bus_7303_8,7303,7303).
route(bus_7303_9,7303,7303).
route(bus_7304_2,7304,7304).
route(bus_7304_3,7304,7304).
route(bus_7304_4,7304,7304).
route(bus_7304_5,7304,7304).
route(bus_7305_1,7305,7305).
route(bus_7305_11,7305,7305).
route(bus_7305_13,7305,7305).
route(bus_7305_15,7305,7305).
route(bus_7305_17,7305,7305).
route(bus_7305_19,7305,7305).
route(bus_7305_2,7305,7305).
route(bus_7305_21,7305,7305).
route(bus_7305_3,7305,7305).
route(bus_7305_4,7305,7305).
route(bus_7305_5,7305,7305).
route(bus_7305_7,7305,7305).
route(bus_7305_8119,7305,7305).
route(bus_7306_1,7306,7306).
route(bus_7306_2,7306,7306).
route(bus_7306_3,7306,7306).
route(bus_7307_1,7307,7307).
route(bus_7307_2,7307,7307).
route(bus_7308_1,7308,7308).
route(bus_7308_2,7308,7308).
route(bus_7308_3,7308,7308).
route(bus_7308_5,7308,7308).
route(bus_7309_1,7309,7309).
route(bus_7309_2,7309,7309).
route(bus_7309_3,7309,7309).
route(bus_7310_1,7310,7310).
route(bus_7310_2,7310,7310).
route(bus_7310_3,7310,7310).
route(bus_7310_5,7310,7310).
route(bus_7311_1,7311,7311).
route(bus_7311_2,7311,7311).
route(bus_7311_3,7311,7311).
route(bus_7312_1,7312,7312).
route(bus_7312_2,7312,7312).
route(bus_7312_3,7312,7312).
route(bus_7312_4,7312,7312).
route(bus_7313_1,7313,7313).
route(bus_7313_2,7313,7313).
route(bus_7313_3,7313,7313).
route(bus_7313_7117,7313,7313).
route(bus_7313_7119,7313,7313).
route(bus_7313_7121,7313,7313).
route(bus_7314_2,7314,7314).
route(bus_7314_4,7314,7314).
route(bus_7315_1,7315,7315).
route(bus_7315_11,7315,7315).
route(bus_7315_12,7315,7315).
route(bus_7315_13,7315,7315).
route(bus_7315_13312,7315,7315).
route(bus_7315_2,7315,7315).
route(bus_7315_3,7315,7315).
route(bus_7315_4,7315,7315).
route(bus_7315_5,7315,7315).
route(bus_7315_6,7315,7315).
route(bus_7315_7,7315,7315).
route(bus_7315_8,7315,7315).
route(bus_7316_1,7316,7316).
route(bus_7316_2,7316,7316).
route(bus_7317_1,7317,7317).
route(bus_7317_2,7317,7317).
route(bus_7317_3,7317,7317).
route(bus_7318_2,7318,7318).
route(bus_7318_4,7318,7318).
route(bus_7318_6,7318,7318).
route(bus_7318_7109,7318,7318).
route(bus_7319_2,7319,7319).
route(bus_7319_4,7319,7319).
route(bus_7319_6,7319,7319).
route(bus_7320_58,7320,7320).
route(bus_7320_60,7320,7320).
route(bus_7320_8711,7320,7320).
route(bus_7321_1,7321,7321).
route(bus_7321_2,7321,7321).
route(bus_7321_3,7321,7321).
route(bus_7321_4,7321,7321).
route(bus_7321_5,7321,7321).
route(bus_7321_7,7321,7321).
route(bus_7322_1,7322,7322).
route(bus_7322_2,7322,7322).
route(bus_7323_1,7323,7323).
route(bus_7323_2,7323,7323).
route(bus_7324_1,7324,7324).
route(bus_7324_2,7324,7324).
route(bus_7327_1,7327,7327).
route(bus_7327_10,7327,7327).
route(bus_7327_11,7327,7327).
route(bus_7327_12,7327,7327).
route(bus_7327_13,7327,7327).
route(bus_7327_14,7327,7327).
route(bus_7327_16,7327,7327).
route(bus_7327_2,7327,7327).
route(bus_7327_3,7327,7327).
route(bus_7327_4,7327,7327).
route(bus_7327_5,7327,7327).
route(bus_7327_6,7327,7327).
route(bus_7327_7,7327,7327).
route(bus_7327_8,7327,7327).
route(bus_7327_9,7327,7327).
route(bus_7328_1,7328,7328).
route(bus_7328_2,7328,7328).
route(bus_7328_3,7328,7328).
route(bus_7328_5,7328,7328).
route(bus_7328_7,7328,7328).
route(bus_7329_1,7329,7329).
route(bus_7329_2,7329,7329).
route(bus_7329_3,7329,7329).
route(bus_7329_4,7329,7329).
route(bus_7329_5,7329,7329).
route(bus_7329_7,7329,7329).
route(bus_7329_9,7329,7329).
route(bus_732_10,732,732).
route(bus_732_1001,732,732).
route(bus_732_1003,732,732).
route(bus_732_12,732,732).
route(bus_732_2,732,732).
route(bus_732_4,732,732).
route(bus_732_6,732,732).
route(bus_732_8,732,732).
route(bus_7330_1,7330,7330).
route(bus_7330_2,7330,7330).
route(bus_7330_3,7330,7330).
route(bus_7330_4,7330,7330).
route(bus_7330_5,7330,7330).
route(bus_7330_7,7330,7330).
route(bus_7330_9,7330,7330).
route(bus_733_1,733,733).
route(bus_733_1001,733,733).
route(bus_733_1002,733,733).
route(bus_733_2,733,733).
route(bus_733_3,733,733).
route(bus_733_4,733,733).
route(bus_733_5,733,733).
route(bus_73_1,73,73).
route(bus_73_10,73,73).
route(bus_73_11,73,73).
route(bus_73_12,73,73).
route(bus_73_13,73,73).
route(bus_73_14,73,73).
route(bus_73_15,73,73).
route(bus_73_16,73,73).
route(bus_73_17,73,73).
route(bus_73_18,73,73).
route(bus_73_19,73,73).
route(bus_73_2,73,73).
route(bus_73_20,73,73).
route(bus_73_21,73,73).
route(bus_73_22,73,73).
route(bus_73_23,73,73).
route(bus_73_24,73,73).
route(bus_73_25,73,73).
route(bus_73_26,73,73).
route(bus_73_27,73,73).
route(bus_73_28,73,73).
route(bus_73_29,73,73).
route(bus_73_3,73,73).
route(bus_73_30,73,73).
route(bus_73_31,73,73).
route(bus_73_32,73,73).
route(bus_73_33,73,73).
route(bus_73_34,73,73).
route(bus_73_35,73,73).
route(bus_73_36,73,73).
route(bus_73_37,73,73).
route(bus_73_38,73,73).
route(bus_73_39,73,73).
route(bus_73_4,73,73).
route(bus_73_40,73,73).
route(bus_73_41,73,73).
route(bus_73_42,73,73).
route(bus_73_5,73,73).
route(bus_73_6,73,73).
route(bus_73_7,73,73).
route(bus_73_8,73,73).
route(bus_73_9,73,73).
route(bus_7402_1,7402,7402).
route(bus_7402_2,7402,7402).
route(bus_7402_3,7402,7402).
route(bus_7402_6,7402,7402).
route(bus_7402_8,7402,7402).
route(bus_7403_1,7403,7403).
route(bus_7403_3,7403,7403).
route(bus_7403_4,7403,7403).
route(bus_7403_5,7403,7403).
route(bus_7403_6,7403,7403).
route(bus_7403_7,7403,7403).
route(bus_7404_10,7404,7404).
route(bus_7404_12,7404,7404).
route(bus_7404_2,7404,7404).
route(bus_7404_4,7404,7404).
route(bus_7404_6,7404,7404).
route(bus_7404_8,7404,7404).
route(bus_7405_2,7405,7405).
route(bus_7405_4,7405,7405).
route(bus_7406_150,7406,7406).
route(bus_7406_2,7406,7406).
route(bus_7406_4,7406,7406).
route(bus_7406_6,7406,7406).
route(bus_7406_7055,7406,7406).
route(bus_7408_2,7408,7408).
route(bus_7408_4,7408,7408).
route(bus_7408_6,7408,7408).
route(bus_7408_7045,7408,7408).
route(bus_7408_8,7408,7408).
route(bus_7409_1,7409,7409).
route(bus_7409_2,7409,7409).
route(bus_7410_1,7410,7410).
route(bus_7410_2,7410,7410).
route(bus_7410_3,7410,7410).
route(bus_7410_4,7410,7410).
route(bus_7410_5,7410,7410).
route(bus_7410_7,7410,7410).
route(bus_7411_1,7411,7411).
route(bus_7411_2,7411,7411).
route(bus_7411_3,7411,7411).
route(bus_7411_5,7411,7411).
route(bus_7411_7,7411,7411).
route(bus_7412_1,7412,7412).
route(bus_7412_2,7412,7412).
route(bus_7412_4,7412,7412).
route(bus_7412_7057,7412,7412).
route(bus_7412_7059,7412,7412).
route(bus_7412_7061,7412,7412).
route(bus_7414_1,7414,7414).
route(bus_7414_3,7414,7414).
route(bus_7414_5,7414,7414).
route(bus_7415_1,7415,7415).
route(bus_7415_2,7415,7415).
route(bus_7415_3,7415,7415).
route(bus_7415_4,7415,7415).
route(bus_7415_5,7415,7415).
route(bus_7415_6,7415,7415).
route(bus_7415_7,7415,7415).
route(bus_7416_1,7416,7416).
route(bus_7416_2,7416,7416).
route(bus_7416_3,7416,7416).
route(bus_7416_5,7416,7416).
route(bus_7417_12,7417,7417).
route(bus_7417_2,7417,7417).
route(bus_7417_4,7417,7417).
route(bus_7417_6,7417,7417).
route(bus_7417_8,7417,7417).
route(bus_7418_1,7418,7418).
route(bus_7418_2,7418,7418).
route(bus_7419_1,7419,7419).
route(bus_7419_2,7419,7419).
route(bus_741_1,741,741).
route(bus_741_1001,741,741).
route(bus_741_1002,741,741).
route(bus_741_1004,741,741).
route(bus_741_2,741,741).
route(bus_741_3,741,741).
route(bus_741_4,741,741).
route(bus_741_5,741,741).
route(bus_741_7,741,741).
route(bus_741_9,741,741).
route(bus_7420_2,7420,7420).
route(bus_7420_4,7420,7420).
route(bus_7421_2,7421,7421).
route(bus_7421_24,7421,7421).
route(bus_7422_1,7422,7422).
route(bus_7422_2,7422,7422).
route(bus_7423_1,7423,7423).
route(bus_7423_2,7423,7423).
route(bus_7424_1,7424,7424).
route(bus_7424_2,7424,7424).
route(bus_7424_4,7424,7424).
route(bus_7425_1,7425,7425).
route(bus_7425_2,7425,7425).
route(bus_7425_3,7425,7425).
route(bus_7425_4,7425,7425).
route(bus_7425_6,7425,7425).
route(bus_7425_7065,7425,7425).
route(bus_7426_2,7426,7426).
route(bus_7426_4,7426,7426).
route(bus_7426_6,7426,7426).
route(bus_7426_8,7426,7426).
route(bus_7427_1,7427,7427).
route(bus_7427_2,7427,7427).
route(bus_7429_2,7429,7429).
route(bus_7429_26,7429,7429).
route(bus_7429_28,7429,7429).
route(bus_7429_5,7429,7429).
route(bus_742_1001,742,742).
route(bus_742_1002,742,742).
route(bus_742_2,742,742).
route(bus_742_9106,742,742).
route(bus_7430_1,7430,7430).
route(bus_7430_2,7430,7430).
route(bus_7431_1,7431,7431).
route(bus_7431_2,7431,7431).
route(bus_7431_3,7431,7431).
route(bus_7431_5,7431,7431).
route(bus_7432_1,7432,7432).
route(bus_7432_2,7432,7432).
route(bus_7432_3,7432,7432).
route(bus_7432_5,7432,7432).
route(bus_74_1,74,74).
route(bus_74_10,74,74).
route(bus_74_11,74,74).
route(bus_74_12,74,74).
route(bus_74_13,74,74).
route(bus_74_14,74,74).
route(bus_74_15,74,74).
route(bus_74_16,74,74).
route(bus_74_17,74,74).
route(bus_74_18,74,74).
route(bus_74_19,74,74).
route(bus_74_2,74,74).
route(bus_74_20,74,74).
route(bus_74_21,74,74).
route(bus_74_22,74,74).
route(bus_74_23,74,74).
route(bus_74_24,74,74).
route(bus_74_25,74,74).
route(bus_74_26,74,74).
route(bus_74_27,74,74).
route(bus_74_28,74,74).
route(bus_74_29,74,74).
route(bus_74_3,74,74).
route(bus_74_30,74,74).
route(bus_74_31,74,74).
route(bus_74_32,74,74).
route(bus_74_33,74,74).
route(bus_74_34,74,74).
route(bus_74_35,74,74).
route(bus_74_36,74,74).
route(bus_74_37,74,74).
route(bus_74_38,74,74).
route(bus_74_39,74,74).
route(bus_74_4,74,74).
route(bus_74_40,74,74).
route(bus_74_41,74,74).
route(bus_74_42,74,74).
route(bus_74_5,74,74).
route(bus_74_6,74,74).
route(bus_74_6001,74,74).
route(bus_74_6002,74,74).
route(bus_74_6003,74,74).
route(bus_74_6004,74,74).
route(bus_74_6005,74,74).
route(bus_74_6006,74,74).
route(bus_74_6007,74,74).
route(bus_74_6008,74,74).
route(bus_74_6009,74,74).
route(bus_74_6010,74,74).
route(bus_74_6011,74,74).
route(bus_74_6012,74,74).
route(bus_74_6013,74,74).
route(bus_74_6014,74,74).
route(bus_74_6015,74,74).
route(bus_74_6016,74,74).
route(bus_74_6017,74,74).
route(bus_74_6018,74,74).
route(bus_74_6019,74,74).
route(bus_74_6020,74,74).
route(bus_74_6021,74,74).
route(bus_74_6022,74,74).
route(bus_74_6023,74,74).
route(bus_74_6024,74,74).
route(bus_74_6025,74,74).
route(bus_74_6026,74,74).
route(bus_74_6027,74,74).
route(bus_74_6028,74,74).
route(bus_74_6029,74,74).
route(bus_74_6030,74,74).
route(bus_74_6031,74,74).
route(bus_74_6032,74,74).
route(bus_74_6033,74,74).
route(bus_74_6035,74,74).
route(bus_74_7,74,74).
route(bus_74_7001,74,74).
route(bus_74_7002,74,74).
route(bus_74_7003,74,74).
route(bus_74_7004,74,74).
route(bus_74_7005,74,74).
route(bus_74_7006,74,74).
route(bus_74_7007,74,74).
route(bus_74_7008,74,74).
route(bus_74_7009,74,74).
route(bus_74_7010,74,74).
route(bus_74_7011,74,74).
route(bus_74_7012,74,74).
route(bus_74_7013,74,74).
route(bus_74_7014,74,74).
route(bus_74_7015,74,74).
route(bus_74_7016,74,74).
route(bus_74_7017,74,74).
route(bus_74_7018,74,74).
route(bus_74_7019,74,74).
route(bus_74_7020,74,74).
route(bus_74_7021,74,74).
route(bus_74_7022,74,74).
route(bus_74_7023,74,74).
route(bus_74_7024,74,74).
route(bus_74_7025,74,74).
route(bus_74_7026,74,74).
route(bus_74_7027,74,74).
route(bus_74_7028,74,74).
route(bus_74_7030,74,74).
route(bus_74_8,74,74).
route(bus_74_9,74,74).
route(bus_7501_1,7501,7501).
route(bus_7501_11,7501,7501).
route(bus_7501_13,7501,7501).
route(bus_7501_164,7501,7501).
route(bus_7501_2,7501,7501).
route(bus_7501_3,7501,7501).
route(bus_7501_4,7501,7501).
route(bus_7501_6,7501,7501).
route(bus_7501_7,7501,7501).
route(bus_7501_9,7501,7501).
route(bus_7502_1,7502,7502).
route(bus_7502_11,7502,7502).
route(bus_7502_2,7502,7502).
route(bus_7502_3,7502,7502).
route(bus_7502_5,7502,7502).
route(bus_7502_7,7502,7502).
route(bus_7502_9,7502,7502).
route(bus_7503_2,7503,7503).
route(bus_7504_1,7504,7504).
route(bus_7504_11,7504,7504).
route(bus_7504_2,7504,7504).
route(bus_7504_3,7504,7504).
route(bus_7504_4,7504,7504).
route(bus_7504_5,7504,7504).
route(bus_7504_9,7504,7504).
route(bus_7505_10,7505,7505).
route(bus_7505_2,7505,7505).
route(bus_7505_4,7505,7505).
route(bus_7505_6,7505,7505).
route(bus_7505_8,7505,7505).
route(bus_7506_1,7506,7506).
route(bus_7506_2,7506,7506).
route(bus_7506_3,7506,7506).
route(bus_7506_5,7506,7506).
route(bus_7506_9,7506,7506).
route(bus_7507_1,7507,7507).
route(bus_7507_2,7507,7507).
route(bus_750_359,750,750).
route(bus_750_367,750,750).
route(bus_750_373,750,750).
route(bus_750_375,750,750).
route(bus_750_393,750,750).
route(bus_750_395,750,750).
route(bus_750_397,750,750).
route(bus_750_399,750,750).
route(bus_750_7027,750,750).
route(bus_750_7029,750,750).
route(bus_750_7031,750,750).
route(bus_750_7033,750,750).
route(bus_7510_1,7510,7510).
route(bus_7510_2,7510,7510).
route(bus_7510_3,7510,7510).
route(bus_7510_36,7510,7510).
route(bus_7510_5,7510,7510).
route(bus_7510_7,7510,7510).
route(bus_7511_1,7511,7511).
route(bus_7511_3,7511,7511).
route(bus_7511_4,7511,7511).
route(bus_7511_5,7511,7511).
route(bus_7512_1,7512,7512).
route(bus_7512_2,7512,7512).
route(bus_7512_3,7512,7512).
route(bus_7514_1,7514,7514).
route(bus_7514_2,7514,7514).
route(bus_7514_3,7514,7514).
route(bus_7515_1,7515,7515).
route(bus_7515_3,7515,7515).
route(bus_7515_5,7515,7515).
route(bus_7515_7,7515,7515).
route(bus_7517_2,7517,7517).
route(bus_7517_4,7517,7517).
route(bus_7517_6,7517,7517).
route(bus_7517_8,7517,7517).
route(bus_7517_9036,7517,7517).
route(bus_7519_1,7519,7519).
route(bus_7519_1063,7519,7519).
route(bus_7519_11,7519,7519).
route(bus_7519_13,7519,7519).
route(bus_7519_15,7519,7519).
route(bus_7519_2,7519,7519).
route(bus_7519_21,7519,7519).
route(bus_7519_3,7519,7519).
route(bus_7519_4,7519,7519).
route(bus_7519_5,7519,7519).
route(bus_7519_6,7519,7519).
route(bus_7519_9,7519,7519).
route(bus_7519_9044,7519,7519).
route(bus_7519_9046,7519,7519).
route(bus_7520_1,7520,7520).
route(bus_7520_10,7520,7520).
route(bus_7520_13,7520,7520).
route(bus_7520_14,7520,7520).
route(bus_7520_2,7520,7520).
route(bus_7520_3,7520,7520).
route(bus_7520_4,7520,7520).
route(bus_7520_40,7520,7520).
route(bus_7520_5,7520,7520).
route(bus_7520_6,7520,7520).
route(bus_7520_7,7520,7520).
route(bus_7521_1015,7521,7521).
route(bus_7521_2,7521,7521).
route(bus_7521_4,7521,7521).
route(bus_7521_6,7521,7521).
route(bus_75_1,75,75).
route(bus_75_10,75,75).
route(bus_75_11,75,75).
route(bus_75_12,75,75).
route(bus_75_13,75,75).
route(bus_75_14,75,75).
route(bus_75_15,75,75).
route(bus_75_16,75,75).
route(bus_75_17,75,75).
route(bus_75_18,75,75).
route(bus_75_19,75,75).
route(bus_75_2,75,75).
route(bus_75_20,75,75).
route(bus_75_21,75,75).
route(bus_75_22,75,75).
route(bus_75_23,75,75).
route(bus_75_24,75,75).
route(bus_75_25,75,75).
route(bus_75_26,75,75).
route(bus_75_27,75,75).
route(bus_75_28,75,75).
route(bus_75_29,75,75).
route(bus_75_3,75,75).
route(bus_75_30,75,75).
route(bus_75_31,75,75).
route(bus_75_32,75,75).
route(bus_75_35,75,75).
route(bus_75_37,75,75).
route(bus_75_39,75,75).
route(bus_75_4,75,75).
route(bus_75_41,75,75).
route(bus_75_5,75,75).
route(bus_75_6,75,75).
route(bus_75_6001,75,75).
route(bus_75_6002,75,75).
route(bus_75_6003,75,75).
route(bus_75_6004,75,75).
route(bus_75_6005,75,75).
route(bus_75_6006,75,75).
route(bus_75_6007,75,75).
route(bus_75_6008,75,75).
route(bus_75_6009,75,75).
route(bus_75_6010,75,75).
route(bus_75_6011,75,75).
route(bus_75_6012,75,75).
route(bus_75_6013,75,75).
route(bus_75_6014,75,75).
route(bus_75_6015,75,75).
route(bus_75_6016,75,75).
route(bus_75_7,75,75).
route(bus_75_7001,75,75).
route(bus_75_7002,75,75).
route(bus_75_7003,75,75).
route(bus_75_7004,75,75).
route(bus_75_7005,75,75).
route(bus_75_7006,75,75).
route(bus_75_7007,75,75).
route(bus_75_7008,75,75).
route(bus_75_7009,75,75).
route(bus_75_7010,75,75).
route(bus_75_7011,75,75).
route(bus_75_7012,75,75).
route(bus_75_8,75,75).
route(bus_75_9,75,75).
route(bus_7603_1,7603,7603).
route(bus_7603_11,7603,7603).
route(bus_7603_2,7603,7603).
route(bus_7603_3,7603,7603).
route(bus_7603_4,7603,7603).
route(bus_7603_5,7603,7603).
route(bus_7603_6,7603,7603).
route(bus_7603_7,7603,7603).
route(bus_7603_9,7603,7603).
route(bus_7604_1,7604,7604).
route(bus_7604_2,7604,7604).
route(bus_7604_3,7604,7604).
route(bus_7605_1,7605,7605).
route(bus_7605_4,7605,7605).
route(bus_7606_1,7606,7606).
route(bus_7606_2,7606,7606).
route(bus_7606_3,7606,7606).
route(bus_7606_4,7606,7606).
route(bus_7606_5,7606,7606).
route(bus_7606_7,7606,7606).
route(bus_7607_1,7607,7607).
route(bus_7607_10,7607,7607).
route(bus_7607_11,7607,7607).
route(bus_7607_12,7607,7607).
route(bus_7607_2,7607,7607).
route(bus_7607_20,7607,7607).
route(bus_7607_22,7607,7607).
route(bus_7607_24,7607,7607).
route(bus_7607_26,7607,7607).
route(bus_7607_4,7607,7607).
route(bus_7607_5,7607,7607).
route(bus_7607_6,7607,7607).
route(bus_7607_8,7607,7607).
route(bus_7608_1,7608,7608).
route(bus_7608_2,7608,7608).
route(bus_7608_4,7608,7608).
route(bus_7608_74,7608,7608).
route(bus_7609_102,7609,7609).
route(bus_7609_104,7609,7609).
route(bus_7609_106,7609,7609).
route(bus_7609_108,7609,7609).
route(bus_7609_112,7609,7609).
route(bus_7609_116,7609,7609).
route(bus_7609_120,7609,7609).
route(bus_7609_124,7609,7609).
route(bus_7609_128,7609,7609).
route(bus_761_1,761,761).
route(bus_761_2,761,761).
route(bus_761_7001,761,761).
route(bus_762_1,762,762).
route(bus_762_10,762,762).
route(bus_762_1001,762,762).
route(bus_762_1002,762,762).
route(bus_762_1003,762,762).
route(bus_762_11,762,762).
route(bus_762_2,762,762).
route(bus_762_3,762,762).
route(bus_762_4,762,762).
route(bus_762_5,762,762).
route(bus_762_6,762,762).
route(bus_762_7,762,762).
route(bus_762_9,762,762).
route(bus_763_1,763,763).
route(bus_763_2,763,763).
route(bus_763_3,763,763).
route(bus_763_5,763,763).
route(bus_763_6,763,763).
route(bus_763_8,763,763).
route(bus_763_9,763,763).
route(bus_76_1,76,76).
route(bus_76_10,76,76).
route(bus_76_11,76,76).
route(bus_76_12,76,76).
route(bus_76_13,76,76).
route(bus_76_14,76,76).
route(bus_76_15,76,76).
route(bus_76_2,76,76).
route(bus_76_3,76,76).
route(bus_76_4,76,76).
route(bus_76_5,76,76).
route(bus_76_6,76,76).
route(bus_76_6001,76,76).
route(bus_76_6002,76,76).
route(bus_76_6003,76,76).
route(bus_76_7,76,76).
route(bus_76_7001,76,76).
route(bus_76_8,76,76).
route(bus_76_9,76,76).
route(bus_7701_1,7701,7701).
route(bus_7701_10,7701,7701).
route(bus_7701_2,7701,7701).
route(bus_7701_3,7701,7701).
route(bus_7701_4,7701,7701).
route(bus_7701_5,7701,7701).
route(bus_7701_6,7701,7701).
route(bus_7701_8,7701,7701).
route(bus_7701_8713,7701,7701).
route(bus_7702_1,7702,7702).
route(bus_7702_11,7702,7702).
route(bus_7702_13,7702,7702).
route(bus_7702_2,7702,7702).
route(bus_7702_3,7702,7702).
route(bus_7702_4,7702,7702).
route(bus_7702_5,7702,7702).
route(bus_7702_6,7702,7702).
route(bus_7702_7,7702,7702).
route(bus_7702_8,7702,7702).
route(bus_7702_9,7702,7702).
route(bus_7703_1,7703,7703).
route(bus_7703_2,7703,7703).
route(bus_7703_3,7703,7703).
route(bus_7703_4,7703,7703).
route(bus_7703_7,7703,7703).
route(bus_7705_1,7705,7705).
route(bus_7705_2,7705,7705).
route(bus_7705_3,7705,7705).
route(bus_7705_4,7705,7705).
route(bus_7705_5,7705,7705).
route(bus_7705_6,7705,7705).
route(bus_7705_7,7705,7705).
route(bus_7706_1,7706,7706).
route(bus_7706_2,7706,7706).
route(bus_7706_4,7706,7706).
route(bus_7706_7,7706,7706).
route(bus_7707_1,7707,7707).
route(bus_7707_4,7707,7707).
route(bus_7707_6,7707,7707).
route(bus_7708_1,7708,7708).
route(bus_7708_13,7708,7708).
route(bus_7708_2,7708,7708).
route(bus_7708_3,7708,7708).
route(bus_7708_4,7708,7708).
route(bus_7708_5,7708,7708).
route(bus_7708_6,7708,7708).
route(bus_7708_7,7708,7708).
route(bus_7708_8,7708,7708).
route(bus_7709_1,7709,7709).
route(bus_7709_3,7709,7709).
route(bus_770_1,770,770).
route(bus_770_10,770,770).
route(bus_770_1001,770,770).
route(bus_770_1003,770,770).
route(bus_770_1004,770,770).
route(bus_770_1007,770,770).
route(bus_770_1008,770,770).
route(bus_770_1009,770,770).
route(bus_770_1010,770,770).
route(bus_770_12,770,770).
route(bus_770_3,770,770).
route(bus_770_4,770,770).
route(bus_770_7,770,770).
route(bus_770_8,770,770).
route(bus_770_9,770,770).
route(bus_7710_1,7710,7710).
route(bus_7710_2,7710,7710).
route(bus_7710_3,7710,7710).
route(bus_7710_4,7710,7710).
route(bus_7710_6,7710,7710).
route(bus_7711_1,7711,7711).
route(bus_7711_2,7711,7711).
route(bus_7711_4,7711,7711).
route(bus_7711_5,7711,7711).
route(bus_7711_6,7711,7711).
route(bus_7711_8,7711,7711).
route(bus_7712_1,7712,7712).
route(bus_7712_11,7712,7712).
route(bus_7712_3,7712,7712).
route(bus_7712_5,7712,7712).
route(bus_7712_7,7712,7712).
route(bus_7712_9,7712,7712).
route(bus_7720_1,7720,7720).
route(bus_7720_2,7720,7720).
route(bus_7720_3,7720,7720).
route(bus_7720_5,7720,7720).
route(bus_7720_6,7720,7720).
route(bus_7721_4,7721,7721).
route(bus_7721_5,7721,7721).
route(bus_7722_2,7722,7722).
route(bus_7722_3,7722,7722).
route(bus_77_1,77,77).
route(bus_77_10,77,77).
route(bus_77_11,77,77).
route(bus_77_12,77,77).
route(bus_77_13,77,77).
route(bus_77_14,77,77).
route(bus_77_15,77,77).
route(bus_77_16,77,77).
route(bus_77_17,77,77).
route(bus_77_18,77,77).
route(bus_77_19,77,77).
route(bus_77_2,77,77).
route(bus_77_20,77,77).
route(bus_77_21,77,77).
route(bus_77_22,77,77).
route(bus_77_23,77,77).
route(bus_77_24,77,77).
route(bus_77_25,77,77).
route(bus_77_26,77,77).
route(bus_77_27,77,77).
route(bus_77_28,77,77).
route(bus_77_29,77,77).
route(bus_77_3,77,77).
route(bus_77_30,77,77).
route(bus_77_31,77,77).
route(bus_77_32,77,77).
route(bus_77_33,77,77).
route(bus_77_34,77,77).
route(bus_77_35,77,77).
route(bus_77_36,77,77).
route(bus_77_37,77,77).
route(bus_77_38,77,77).
route(bus_77_4,77,77).
route(bus_77_5,77,77).
route(bus_77_6,77,77).
route(bus_77_6001,77,77).
route(bus_77_6002,77,77).
route(bus_77_6003,77,77).
route(bus_77_6004,77,77).
route(bus_77_6005,77,77).
route(bus_77_6006,77,77).
route(bus_77_6007,77,77).
route(bus_77_6008,77,77).
route(bus_77_6009,77,77).
route(bus_77_6010,77,77).
route(bus_77_6011,77,77).
route(bus_77_6012,77,77).
route(bus_77_6013,77,77).
route(bus_77_6014,77,77).
route(bus_77_6015,77,77).
route(bus_77_6016,77,77).
route(bus_77_7,77,77).
route(bus_77_7001,77,77).
route(bus_77_7002,77,77).
route(bus_77_7003,77,77).
route(bus_77_7004,77,77).
route(bus_77_7005,77,77).
route(bus_77_7006,77,77).
route(bus_77_7007,77,77).
route(bus_77_7008,77,77).
route(bus_77_7009,77,77).
route(bus_77_7010,77,77).
route(bus_77_7011,77,77).
route(bus_77_7012,77,77).
route(bus_77_8,77,77).
route(bus_77_9,77,77).
route(bus_7801_1,7801,7801).
route(bus_7801_2,7801,7801).
route(bus_7801_3,7801,7801).
route(bus_7801_4,7801,7801).
route(bus_7802_1,7802,7802).
route(bus_7802_2,7802,7802).
route(bus_7804_1,7804,7804).
route(bus_7804_3,7804,7804).
route(bus_7804_4,7804,7804).
route(bus_7804_5,7804,7804).
route(bus_7804_6,7804,7804).
route(bus_7804_8,7804,7804).
route(bus_7807_1,7807,7807).
route(bus_7807_2,7807,7807).
route(bus_7807_3,7807,7807).
route(bus_7807_4,7807,7807).
route(bus_7807_5,7807,7807).
route(bus_7807_6,7807,7807).
route(bus_7808_1,7808,7808).
route(bus_7808_2,7808,7808).
route(bus_7808_3,7808,7808).
route(bus_7808_4,7808,7808).
route(bus_7808_5,7808,7808).
route(bus_7808_7,7808,7808).
route(bus_7809_1,7809,7809).
route(bus_7809_11,7809,7809).
route(bus_7809_162,7809,7809).
route(bus_7809_3,7809,7809).
route(bus_7809_5,7809,7809).
route(bus_7809_7,7809,7809).
route(bus_7810_1,7810,7810).
route(bus_7810_2,7810,7810).
route(bus_7811_1,7811,7811).
route(bus_7811_2,7811,7811).
route(bus_7813_1,7813,7813).
route(bus_7813_10,7813,7813).
route(bus_7813_12,7813,7813).
route(bus_7813_3,7813,7813).
route(bus_7813_4,7813,7813).
route(bus_7813_5,7813,7813).
route(bus_7813_6,7813,7813).
route(bus_7813_8,7813,7813).
route(bus_7814_2,7814,7814).
route(bus_7814_3,7814,7814).
route(bus_7814_7,7814,7814).
route(bus_7815_1,7815,7815).
route(bus_7815_2,7815,7815).
route(bus_7816_2,7816,7816).
route(bus_7816_3,7816,7816).
route(bus_781_1,781,781).
route(bus_781_11,781,781).
route(bus_781_15,781,781).
route(bus_781_17,781,781).
route(bus_781_2,781,781).
route(bus_781_3,781,781).
route(bus_781_5,781,781).
route(bus_781_7,781,781).
route(bus_781_9,781,781).
route(bus_782_1,782,782).
route(bus_782_10,782,782).
route(bus_782_12,782,782).
route(bus_782_3,782,782).
route(bus_782_8,782,782).
route(bus_784_1,784,784).
route(bus_784_10,784,784).
route(bus_784_2,784,784).
route(bus_784_3,784,784).
route(bus_784_4,784,784).
route(bus_784_5,784,784).
route(bus_784_6134,784,784).
route(bus_784_8,784,784).
route(bus_785_1,785,785).
route(bus_785_1001,785,785).
route(bus_785_1002,785,785).
route(bus_785_1003,785,785).
route(bus_785_1004,785,785).
route(bus_785_11,785,785).
route(bus_785_12,785,785).
route(bus_785_13,785,785).
route(bus_785_14,785,785).
route(bus_785_2,785,785).
route(bus_785_3,785,785).
route(bus_785_4,785,785).
route(bus_785_6,785,785).
route(bus_785_7,785,785).
route(bus_785_8,785,785).
route(bus_785_9,785,785).
route(bus_78_1,78,78).
route(bus_78_10,78,78).
route(bus_78_11,78,78).
route(bus_78_12,78,78).
route(bus_78_13,78,78).
route(bus_78_14,78,78).
route(bus_78_15,78,78).
route(bus_78_16,78,78).
route(bus_78_17,78,78).
route(bus_78_18,78,78).
route(bus_78_19,78,78).
route(bus_78_2,78,78).
route(bus_78_20,78,78).
route(bus_78_21,78,78).
route(bus_78_22,78,78).
route(bus_78_23,78,78).
route(bus_78_24,78,78).
route(bus_78_25,78,78).
route(bus_78_26,78,78).
route(bus_78_27,78,78).
route(bus_78_28,78,78).
route(bus_78_29,78,78).
route(bus_78_3,78,78).
route(bus_78_30,78,78).
route(bus_78_31,78,78).
route(bus_78_32,78,78).
route(bus_78_33,78,78).
route(bus_78_34,78,78).
route(bus_78_35,78,78).
route(bus_78_36,78,78).
route(bus_78_37,78,78).
route(bus_78_39,78,78).
route(bus_78_4,78,78).
route(bus_78_41,78,78).
route(bus_78_43,78,78).
route(bus_78_5,78,78).
route(bus_78_6,78,78).
route(bus_78_6001,78,78).
route(bus_78_6002,78,78).
route(bus_78_6003,78,78).
route(bus_78_6004,78,78).
route(bus_78_6005,78,78).
route(bus_78_6006,78,78).
route(bus_78_6007,78,78).
route(bus_78_6008,78,78).
route(bus_78_6009,78,78).
route(bus_78_6010,78,78).
route(bus_78_6011,78,78).
route(bus_78_6012,78,78).
route(bus_78_6013,78,78).
route(bus_78_6014,78,78).
route(bus_78_6015,78,78).
route(bus_78_6016,78,78).
route(bus_78_6017,78,78).
route(bus_78_6018,78,78).
route(bus_78_6019,78,78).
route(bus_78_6020,78,78).
route(bus_78_6021,78,78).
route(bus_78_6022,78,78).
route(bus_78_6023,78,78).
route(bus_78_7,78,78).
route(bus_78_7001,78,78).
route(bus_78_7002,78,78).
route(bus_78_7003,78,78).
route(bus_78_7004,78,78).
route(bus_78_7005,78,78).
route(bus_78_7006,78,78).
route(bus_78_7007,78,78).
route(bus_78_7008,78,78).
route(bus_78_7009,78,78).
route(bus_78_7010,78,78).
route(bus_78_7011,78,78).
route(bus_78_7012,78,78).
route(bus_78_7013,78,78).
route(bus_78_7014,78,78).
route(bus_78_7015,78,78).
route(bus_78_7016,78,78).
route(bus_78_7017,78,78).
route(bus_78_7018,78,78).
route(bus_78_7019,78,78).
route(bus_78_7020,78,78).
route(bus_78_8,78,78).
route(bus_78_9,78,78).
route(bus_7901_1,7901,7901).
route(bus_7901_2,7901,7901).
route(bus_7902_1,7902,7902).
route(bus_7902_2,7902,7902).
route(bus_7902_3,7902,7902).
route(bus_7902_4,7902,7902).
route(bus_7902_5,7902,7902).
route(bus_7902_6009,7902,7902).
route(bus_7903_1,7903,7903).
route(bus_7903_2,7903,7903).
route(bus_7903_3,7903,7903).
route(bus_7904_1,7904,7904).
route(bus_7904_2,7904,7904).
route(bus_7904_3,7904,7904).
route(bus_7904_6,7904,7904).
route(bus_7905_1,7905,7905).
route(bus_7905_2,7905,7905).
route(bus_7905_3,7905,7905).
route(bus_7905_5,7905,7905).
route(bus_7905_7,7905,7905).
route(bus_7906_1,7906,7906).
route(bus_7906_2,7906,7906).
route(bus_7906_3,7906,7906).
route(bus_7906_4,7906,7906).
route(bus_7906_5,7906,7906).
route(bus_7906_7,7906,7906).
route(bus_7906_8,7906,7906).
route(bus_7908_1,7908,7908).
route(bus_7908_2,7908,7908).
route(bus_7908_3,7908,7908).
route(bus_7908_5,7908,7908).
route(bus_7910_1,7910,7910).
route(bus_7910_2,7910,7910).
route(bus_7910_3,7910,7910).
route(bus_7910_4,7910,7910).
route(bus_7910_5,7910,7910).
route(bus_7910_6,7910,7910).
route(bus_7911_1,7911,7911).
route(bus_7911_2,7911,7911).
route(bus_7911_3,7911,7911).
route(bus_7911_4,7911,7911).
route(bus_7911_5,7911,7911).
route(bus_7911_6140,7911,7911).
route(bus_7913_1,7913,7913).
route(bus_7913_2,7913,7913).
route(bus_79_1,79,79).
route(bus_79_10,79,79).
route(bus_79_11,79,79).
route(bus_79_12,79,79).
route(bus_79_13,79,79).
route(bus_79_14,79,79).
route(bus_79_15,79,79).
route(bus_79_16,79,79).
route(bus_79_17,79,79).
route(bus_79_18,79,79).
route(bus_79_19,79,79).
route(bus_79_2,79,79).
route(bus_79_20,79,79).
route(bus_79_21,79,79).
route(bus_79_22,79,79).
route(bus_79_23,79,79).
route(bus_79_24,79,79).
route(bus_79_25,79,79).
route(bus_79_26,79,79).
route(bus_79_27,79,79).
route(bus_79_28,79,79).
route(bus_79_29,79,79).
route(bus_79_3,79,79).
route(bus_79_30,79,79).
route(bus_79_31,79,79).
route(bus_79_32,79,79).
route(bus_79_33,79,79).
route(bus_79_34,79,79).
route(bus_79_35,79,79).
route(bus_79_36,79,79).
route(bus_79_37,79,79).
route(bus_79_38,79,79).
route(bus_79_39,79,79).
route(bus_79_4,79,79).
route(bus_79_40,79,79).
route(bus_79_41,79,79).
route(bus_79_42,79,79).
route(bus_79_43,79,79).
route(bus_79_44,79,79).
route(bus_79_46,79,79).
route(bus_79_5,79,79).
route(bus_79_6,79,79).
route(bus_79_6001,79,79).
route(bus_79_6002,79,79).
route(bus_79_6003,79,79).
route(bus_79_6004,79,79).
route(bus_79_6005,79,79).
route(bus_79_6006,79,79).
route(bus_79_6007,79,79).
route(bus_79_6008,79,79).
route(bus_79_6009,79,79).
route(bus_79_6010,79,79).
route(bus_79_6011,79,79).
route(bus_79_6012,79,79).
route(bus_79_6013,79,79).
route(bus_79_6014,79,79).
route(bus_79_6015,79,79).
route(bus_79_6016,79,79).
route(bus_79_6017,79,79).
route(bus_79_6018,79,79).
route(bus_79_6019,79,79).
route(bus_79_6020,79,79).
route(bus_79_6021,79,79).
route(bus_79_6022,79,79).
route(bus_79_6023,79,79).
route(bus_79_6024,79,79).
route(bus_79_6025,79,79).
route(bus_79_6026,79,79).
route(bus_79_6027,79,79).
route(bus_79_6028,79,79).
route(bus_79_6029,79,79).
route(bus_79_6030,79,79).
route(bus_79_6031,79,79).
route(bus_79_6032,79,79).
route(bus_79_6033,79,79).
route(bus_79_6034,79,79).
route(bus_79_6035,79,79).
route(bus_79_6036,79,79).
route(bus_79_7,79,79).
route(bus_79_7001,79,79).
route(bus_79_7002,79,79).
route(bus_79_7003,79,79).
route(bus_79_7004,79,79).
route(bus_79_7005,79,79).
route(bus_79_7006,79,79).
route(bus_79_7007,79,79).
route(bus_79_7008,79,79).
route(bus_79_7009,79,79).
route(bus_79_7010,79,79).
route(bus_79_7011,79,79).
route(bus_79_7012,79,79).
route(bus_79_7013,79,79).
route(bus_79_7014,79,79).
route(bus_79_7015,79,79).
route(bus_79_7016,79,79).
route(bus_79_7017,79,79).
route(bus_79_7018,79,79).
route(bus_79_7019,79,79).
route(bus_79_7020,79,79).
route(bus_79_7021,79,79).
route(bus_79_7022,79,79).
route(bus_79_7023,79,79).
route(bus_79_7024,79,79).
route(bus_79_7025,79,79).
route(bus_79_7026,79,79).
route(bus_79_7027,79,79).
route(bus_79_7028,79,79).
route(bus_79_7029,79,79).
route(bus_79_8,79,79).
route(bus_79_9,79,79).
route(bus_800_1,800,800).
route(bus_800_10,800,800).
route(bus_800_14,800,800).
route(bus_800_15,800,800).
route(bus_800_19,800,800).
route(bus_800_2,800,800).
route(bus_800_20,800,800).
route(bus_800_22,800,800).
route(bus_800_5,800,800).
route(bus_800_6,800,800).
route(bus_800_6001,800,800).
route(bus_800_6002,800,800).
route(bus_800_6007,800,800).
route(bus_800_6008,800,800).
route(bus_800_6010,800,800).
route(bus_800_7001,800,800).
route(bus_800_7002,800,800).
route(bus_800_7003,800,800).
route(bus_800_7004,800,800).
route(bus_800_7005,800,800).
route(bus_800_7006,800,800).
route(bus_800_7007,800,800).
route(bus_800_9,800,800).
route(bus_805_11,805,805).
route(bus_805_12,805,805).
route(bus_805_13,805,805).
route(bus_805_16,805,805).
route(bus_805_17,805,805).
route(bus_805_18,805,805).
route(bus_805_23,805,805).
route(bus_805_24,805,805).
route(bus_805_26,805,805).
route(bus_805_27,805,805).
route(bus_805_3,805,805).
route(bus_805_4,805,805).
route(bus_805_6003,805,805).
route(bus_805_6004,805,805).
route(bus_805_6005,805,805).
route(bus_805_6006,805,805).
route(bus_805_7,805,805).
route(bus_805_7008,805,805).
route(bus_805_8,805,805).
route(bus_80_1,80,80).
route(bus_80_10,80,80).
route(bus_80_11,80,80).
route(bus_80_12,80,80).
route(bus_80_13,80,80).
route(bus_80_14,80,80).
route(bus_80_15,80,80).
route(bus_80_16,80,80).
route(bus_80_17,80,80).
route(bus_80_18,80,80).
route(bus_80_19,80,80).
route(bus_80_2,80,80).
route(bus_80_20,80,80).
route(bus_80_21,80,80).
route(bus_80_22,80,80).
route(bus_80_23,80,80).
route(bus_80_24,80,80).
route(bus_80_3,80,80).
route(bus_80_4,80,80).
route(bus_80_5,80,80).
route(bus_80_6,80,80).
route(bus_80_7,80,80).
route(bus_80_8,80,80).
route(bus_80_9,80,80).
route(bus_810_1,810,810).
route(bus_810_10,810,810).
route(bus_810_11,810,810).
route(bus_810_12,810,810).
route(bus_810_13,810,810).
route(bus_810_14,810,810).
route(bus_810_15,810,810).
route(bus_810_16,810,810).
route(bus_810_17,810,810).
route(bus_810_18,810,810).
route(bus_810_19,810,810).
route(bus_810_2,810,810).
route(bus_810_20,810,810).
route(bus_810_21,810,810).
route(bus_810_22,810,810).
route(bus_810_23,810,810).
route(bus_810_24,810,810).
route(bus_810_25,810,810).
route(bus_810_26,810,810).
route(bus_810_3,810,810).
route(bus_810_4,810,810).
route(bus_810_5,810,810).
route(bus_810_6,810,810).
route(bus_810_6001,810,810).
route(bus_810_6002,810,810).
route(bus_810_6003,810,810).
route(bus_810_6004,810,810).
route(bus_810_6005,810,810).
route(bus_810_6006,810,810).
route(bus_810_6007,810,810).
route(bus_810_6008,810,810).
route(bus_810_6009,810,810).
route(bus_810_6010,810,810).
route(bus_810_6011,810,810).
route(bus_810_6012,810,810).
route(bus_810_6013,810,810).
route(bus_810_6014,810,810).
route(bus_810_6015,810,810).
route(bus_810_6016,810,810).
route(bus_810_7,810,810).
route(bus_810_7001,810,810).
route(bus_810_7002,810,810).
route(bus_810_7003,810,810).
route(bus_810_7004,810,810).
route(bus_810_7005,810,810).
route(bus_810_7006,810,810).
route(bus_810_7007,810,810).
route(bus_810_7008,810,810).
route(bus_810_7009,810,810).
route(bus_810_7010,810,810).
route(bus_810_7011,810,810).
route(bus_810_7012,810,810).
route(bus_810_7013,810,810).
route(bus_810_7014,810,810).
route(bus_810_7015,810,810).
route(bus_810_7016,810,810).
route(bus_810_7901,810,810).
route(bus_810_7902,810,810).
route(bus_810_8,810,810).
route(bus_810_9,810,810).
route(bus_81_1,81,81).
route(bus_81_10,81,81).
route(bus_81_2,81,81).
route(bus_81_3,81,81).
route(bus_81_4,81,81).
route(bus_81_5,81,81).
route(bus_81_6,81,81).
route(bus_81_8,81,81).
route(bus_820_10,820,820).
route(bus_820_14,820,820).
route(bus_820_16,820,820).
route(bus_820_18,820,820).
route(bus_820_2,820,820).
route(bus_820_20,820,820).
route(bus_820_22,820,820).
route(bus_820_24,820,820).
route(bus_820_26,820,820).
route(bus_820_28,820,820).
route(bus_820_30,820,820).
route(bus_820_32,820,820).
route(bus_820_34,820,820).
route(bus_820_4,820,820).
route(bus_820_6,820,820).
route(bus_820_6002,820,820).
route(bus_820_6004,820,820).
route(bus_820_6008,820,820).
route(bus_820_6060,820,820).
route(bus_820_7008,820,820).
route(bus_820_7010,820,820).
route(bus_820_7012,820,820).
route(bus_820_7014,820,820).
route(bus_820_7016,820,820).
route(bus_820_7066,820,820).
route(bus_820_7924,820,820).
route(bus_820_7966,820,820).
route(bus_820_8,820,820).
route(bus_820_8097,820,820).
route(bus_820_8099,820,820).
route(bus_825_10,825,825).
route(bus_825_12,825,825).
route(bus_825_14,825,825).
route(bus_825_2,825,825).
route(bus_825_20,825,825).
route(bus_825_4,825,825).
route(bus_825_6002,825,825).
route(bus_825_6004,825,825).
route(bus_825_6006,825,825).
route(bus_825_6060,825,825).
route(bus_825_7002,825,825).
route(bus_825_7004,825,825).
route(bus_825_7010,825,825).
route(bus_825_7012,825,825).
route(bus_825_7014,825,825).
route(bus_825_7016,825,825).
route(bus_825_7060,825,825).
route(bus_825_8,825,825).
route(bus_82_1,82,82).
route(bus_82_10,82,82).
route(bus_82_11,82,82).
route(bus_82_12,82,82).
route(bus_82_13,82,82).
route(bus_82_14,82,82).
route(bus_82_15,82,82).
route(bus_82_16,82,82).
route(bus_82_17,82,82).
route(bus_82_18,82,82).
route(bus_82_19,82,82).
route(bus_82_2,82,82).
route(bus_82_20,82,82).
route(bus_82_21,82,82).
route(bus_82_22,82,82).
route(bus_82_23,82,82).
route(bus_82_24,82,82).
route(bus_82_25,82,82).
route(bus_82_26,82,82).
route(bus_82_27,82,82).
route(bus_82_28,82,82).
route(bus_82_29,82,82).
route(bus_82_3,82,82).
route(bus_82_30,82,82).
route(bus_82_31,82,82).
route(bus_82_32,82,82).
route(bus_82_33,82,82).
route(bus_82_34,82,82).
route(bus_82_35,82,82).
route(bus_82_36,82,82).
route(bus_82_37,82,82).
route(bus_82_38,82,82).
route(bus_82_39,82,82).
route(bus_82_4,82,82).
route(bus_82_40,82,82).
route(bus_82_41,82,82).
route(bus_82_42,82,82).
route(bus_82_43,82,82).
route(bus_82_44,82,82).
route(bus_82_45,82,82).
route(bus_82_47,82,82).
route(bus_82_49,82,82).
route(bus_82_5,82,82).
route(bus_82_6,82,82).
route(bus_82_6001,82,82).
route(bus_82_6002,82,82).
route(bus_82_6003,82,82).
route(bus_82_6004,82,82).
route(bus_82_6005,82,82).
route(bus_82_6006,82,82).
route(bus_82_6007,82,82).
route(bus_82_6008,82,82).
route(bus_82_6009,82,82).
route(bus_82_6010,82,82).
route(bus_82_6011,82,82).
route(bus_82_6012,82,82).
route(bus_82_6013,82,82).
route(bus_82_6014,82,82).
route(bus_82_6015,82,82).
route(bus_82_6016,82,82).
route(bus_82_6017,82,82).
route(bus_82_6018,82,82).
route(bus_82_6019,82,82).
route(bus_82_6020,82,82).
route(bus_82_6021,82,82).
route(bus_82_6022,82,82).
route(bus_82_6023,82,82).
route(bus_82_6024,82,82).
route(bus_82_6025,82,82).
route(bus_82_6026,82,82).
route(bus_82_6027,82,82).
route(bus_82_6028,82,82).
route(bus_82_6029,82,82).
route(bus_82_6030,82,82).
route(bus_82_6031,82,82).
route(bus_82_6033,82,82).
route(bus_82_6035,82,82).
route(bus_82_7,82,82).
route(bus_82_7001,82,82).
route(bus_82_7002,82,82).
route(bus_82_7003,82,82).
route(bus_82_7004,82,82).
route(bus_82_7005,82,82).
route(bus_82_7006,82,82).
route(bus_82_7007,82,82).
route(bus_82_7008,82,82).
route(bus_82_7009,82,82).
route(bus_82_7010,82,82).
route(bus_82_7011,82,82).
route(bus_82_7012,82,82).
route(bus_82_7013,82,82).
route(bus_82_7014,82,82).
route(bus_82_7015,82,82).
route(bus_82_7016,82,82).
route(bus_82_7017,82,82).
route(bus_82_7018,82,82).
route(bus_82_7019,82,82).
route(bus_82_7020,82,82).
route(bus_82_7021,82,82).
route(bus_82_7022,82,82).
route(bus_82_7023,82,82).
route(bus_82_7024,82,82).
route(bus_82_7026,82,82).
route(bus_82_8,82,82).
route(bus_82_9,82,82).
route(bus_830_10,830,830).
route(bus_830_12,830,830).
route(bus_830_14,830,830).
route(bus_830_16,830,830).
route(bus_830_2,830,830).
route(bus_830_4,830,830).
route(bus_830_6,830,830).
route(bus_830_6002,830,830).
route(bus_830_7002,830,830).
route(bus_835_10,835,835).
route(bus_835_12,835,835).
route(bus_835_16,835,835).
route(bus_835_18,835,835).
route(bus_835_2,835,835).
route(bus_835_20,835,835).
route(bus_835_30,835,835).
route(bus_835_4,835,835).
route(bus_835_6002,835,835).
route(bus_835_6004,835,835).
route(bus_835_7002,835,835).
route(bus_835_7006,835,835).
route(bus_83_1,83,83).
route(bus_83_10,83,83).
route(bus_83_11,83,83).
route(bus_83_13,83,83).
route(bus_83_15,83,83).
route(bus_83_2,83,83).
route(bus_83_3,83,83).
route(bus_83_4,83,83).
route(bus_83_5,83,83).
route(bus_83_6,83,83).
route(bus_83_7,83,83).
route(bus_83_8,83,83).
route(bus_83_9,83,83).
route(bus_850_1,850,850).
route(bus_850_10,850,850).
route(bus_850_11,850,850).
route(bus_850_12,850,850).
route(bus_850_2,850,850).
route(bus_850_3,850,850).
route(bus_850_4,850,850).
route(bus_850_5,850,850).
route(bus_850_6,850,850).
route(bus_850_6001,850,850).
route(bus_850_6002,850,850).
route(bus_850_6003,850,850).
route(bus_850_6004,850,850).
route(bus_850_7,850,850).
route(bus_850_7001,850,850).
route(bus_850_7002,850,850).
route(bus_850_7003,850,850).
route(bus_850_7004,850,850).
route(bus_850_7005,850,850).
route(bus_850_7006,850,850).
route(bus_850_8,850,850).
route(bus_850_9,850,850).
route(bus_855_1,855,855).
route(bus_855_10,855,855).
route(bus_855_101213,855,855).
route(bus_855_11,855,855).
route(bus_855_12,855,855).
route(bus_855_13,855,855).
route(bus_855_14,855,855).
route(bus_855_15,855,855).
route(bus_855_16,855,855).
route(bus_855_17,855,855).
route(bus_855_18,855,855).
route(bus_855_19,855,855).
route(bus_855_2,855,855).
route(bus_855_20,855,855).
route(bus_855_21,855,855).
route(bus_855_22,855,855).
route(bus_855_23,855,855).
route(bus_855_24,855,855).
route(bus_855_25,855,855).
route(bus_855_26,855,855).
route(bus_855_27,855,855).
route(bus_855_28,855,855).
route(bus_855_29,855,855).
route(bus_855_3,855,855).
route(bus_855_30,855,855).
route(bus_855_31,855,855).
route(bus_855_32,855,855).
route(bus_855_33,855,855).
route(bus_855_34,855,855).
route(bus_855_35,855,855).
route(bus_855_37,855,855).
route(bus_855_4,855,855).
route(bus_855_5,855,855).
route(bus_855_6,855,855).
route(bus_855_6001,855,855).
route(bus_855_6002,855,855).
route(bus_855_6003,855,855).
route(bus_855_6004,855,855).
route(bus_855_6005,855,855).
route(bus_855_6006,855,855).
route(bus_855_6007,855,855).
route(bus_855_6008,855,855).
route(bus_855_6009,855,855).
route(bus_855_6010,855,855).
route(bus_855_6011,855,855).
route(bus_855_6012,855,855).
route(bus_855_6013,855,855).
route(bus_855_6014,855,855).
route(bus_855_6015,855,855).
route(bus_855_6016,855,855).
route(bus_855_6017,855,855).
route(bus_855_6018,855,855).
route(bus_855_6019,855,855).
route(bus_855_6020,855,855).
route(bus_855_7,855,855).
route(bus_855_7001,855,855).
route(bus_855_7002,855,855).
route(bus_855_7003,855,855).
route(bus_855_7004,855,855).
route(bus_855_7005,855,855).
route(bus_855_7006,855,855).
route(bus_855_7007,855,855).
route(bus_855_7008,855,855).
route(bus_855_7009,855,855).
route(bus_855_7010,855,855).
route(bus_855_7011,855,855).
route(bus_855_7012,855,855).
route(bus_855_7013,855,855).
route(bus_855_7014,855,855).
route(bus_855_7015,855,855).
route(bus_855_7016,855,855).
route(bus_855_7017,855,855).
route(bus_855_7018,855,855).
route(bus_855_7019,855,855).
route(bus_855_7020,855,855).
route(bus_855_7021,855,855).
route(bus_855_7022,855,855).
route(bus_855_7023,855,855).
route(bus_855_7955,855,855).
route(bus_855_8,855,855).
route(bus_855_9,855,855).
route(bus_85_1,85,85).
route(bus_85_2,85,85).
route(bus_860_1,860,860).
route(bus_860_10,860,860).
route(bus_860_11,860,860).
route(bus_860_12,860,860).
route(bus_860_2,860,860).
route(bus_860_3,860,860).
route(bus_860_4,860,860).
route(bus_860_5,860,860).
route(bus_860_6,860,860).
route(bus_860_6001,860,860).
route(bus_860_6002,860,860).
route(bus_860_6003,860,860).
route(bus_860_6004,860,860).
route(bus_860_7,860,860).
route(bus_860_7001,860,860).
route(bus_860_7002,860,860).
route(bus_860_7003,860,860).
route(bus_860_7004,860,860).
route(bus_860_7009,860,860).
route(bus_860_7010,860,860).
route(bus_860_7012,860,860).
route(bus_860_7013,860,860).
route(bus_860_7014,860,860).
route(bus_860_7015,860,860).
route(bus_860_7959,860,860).
route(bus_860_7961,860,860).
route(bus_860_7963,860,860).
route(bus_860_7965,860,860).
route(bus_860_8,860,860).
route(bus_860_9,860,860).
route(bus_86_1,86,86).
route(bus_86_10,86,86).
route(bus_86_11,86,86).
route(bus_86_12,86,86).
route(bus_86_13,86,86).
route(bus_86_2,86,86).
route(bus_86_3,86,86).
route(bus_86_4,86,86).
route(bus_86_5,86,86).
route(bus_86_6,86,86).
route(bus_86_7,86,86).
route(bus_86_8,86,86).
route(bus_86_9,86,86).
route(bus_870_1,870,870).
route(bus_870_10,870,870).
route(bus_870_11,870,870).
route(bus_870_12,870,870).
route(bus_870_13,870,870).
route(bus_870_14,870,870).
route(bus_870_15,870,870).
route(bus_870_16,870,870).
route(bus_870_17,870,870).
route(bus_870_18,870,870).
route(bus_870_19,870,870).
route(bus_870_2,870,870).
route(bus_870_20,870,870).
route(bus_870_21,870,870).
route(bus_870_22,870,870).
route(bus_870_23,870,870).
route(bus_870_24,870,870).
route(bus_870_25,870,870).
route(bus_870_26,870,870).
route(bus_870_27,870,870).
route(bus_870_28,870,870).
route(bus_870_29,870,870).
route(bus_870_3,870,870).
route(bus_870_30,870,870).
route(bus_870_31,870,870).
route(bus_870_32,870,870).
route(bus_870_33,870,870).
route(bus_870_34,870,870).
route(bus_870_35,870,870).
route(bus_870_36,870,870).
route(bus_870_37,870,870).
route(bus_870_38,870,870).
route(bus_870_39,870,870).
route(bus_870_4,870,870).
route(bus_870_40,870,870).
route(bus_870_41,870,870).
route(bus_870_42,870,870).
route(bus_870_43,870,870).
route(bus_870_44,870,870).
route(bus_870_45,870,870).
route(bus_870_46,870,870).
route(bus_870_47,870,870).
route(bus_870_48,870,870).
route(bus_870_49,870,870).
route(bus_870_5,870,870).
route(bus_870_50,870,870).
route(bus_870_51,870,870).
route(bus_870_52,870,870).
route(bus_870_53,870,870).
route(bus_870_56,870,870).
route(bus_870_57,870,870).
route(bus_870_6,870,870).
route(bus_870_60,870,870).
route(bus_870_6001,870,870).
route(bus_870_6002,870,870).
route(bus_870_6003,870,870).
route(bus_870_6004,870,870).
route(bus_870_6005,870,870).
route(bus_870_6006,870,870).
route(bus_870_6007,870,870).
route(bus_870_6008,870,870).
route(bus_870_6009,870,870).
route(bus_870_6010,870,870).
route(bus_870_6011,870,870).
route(bus_870_6012,870,870).
route(bus_870_6013,870,870).
route(bus_870_6014,870,870).
route(bus_870_6015,870,870).
route(bus_870_6016,870,870).
route(bus_870_6018,870,870).
route(bus_870_6019,870,870).
route(bus_870_6020,870,870).
route(bus_870_6021,870,870).
route(bus_870_6022,870,870).
route(bus_870_6023,870,870).
route(bus_870_6024,870,870).
route(bus_870_6025,870,870).
route(bus_870_6026,870,870).
route(bus_870_6027,870,870).
route(bus_870_6028,870,870).
route(bus_870_6029,870,870).
route(bus_870_6030,870,870).
route(bus_870_6031,870,870).
route(bus_870_61,870,870).
route(bus_870_62,870,870).
route(bus_870_64,870,870).
route(bus_870_65,870,870).
route(bus_870_66,870,870).
route(bus_870_67,870,870).
route(bus_870_7,870,870).
route(bus_870_7001,870,870).
route(bus_870_7002,870,870).
route(bus_870_7003,870,870).
route(bus_870_7004,870,870).
route(bus_870_7005,870,870).
route(bus_870_7006,870,870).
route(bus_870_7007,870,870).
route(bus_870_7008,870,870).
route(bus_870_7009,870,870).
route(bus_870_7010,870,870).
route(bus_870_7011,870,870).
route(bus_870_7012,870,870).
route(bus_870_7013,870,870).
route(bus_870_7014,870,870).
route(bus_870_7015,870,870).
route(bus_870_7016,870,870).
route(bus_870_7017,870,870).
route(bus_870_7018,870,870).
route(bus_870_7019,870,870).
route(bus_870_7020,870,870).
route(bus_870_7021,870,870).
route(bus_870_7022,870,870).
route(bus_870_7023,870,870).
route(bus_870_7024,870,870).
route(bus_870_7025,870,870).
route(bus_870_7026,870,870).
route(bus_870_7027,870,870).
route(bus_870_7028,870,870).
route(bus_870_7029,870,870).
route(bus_870_7030,870,870).
route(bus_870_7031,870,870).
route(bus_870_7032,870,870).
route(bus_870_7033,870,870).
route(bus_870_7034,870,870).
route(bus_870_7035,870,870).
route(bus_870_7036,870,870).
route(bus_870_7037,870,870).
route(bus_870_7038,870,870).
route(bus_870_7039,870,870).
route(bus_870_7040,870,870).
route(bus_870_7041,870,870).
route(bus_870_7042,870,870).
route(bus_870_8,870,870).
route(bus_870_9,870,870).
route(bus_880_1,880,880).
route(bus_880_10,880,880).
route(bus_880_11,880,880).
route(bus_880_12,880,880).
route(bus_880_13,880,880).
route(bus_880_14,880,880).
route(bus_880_15,880,880).
route(bus_880_16,880,880).
route(bus_880_17,880,880).
route(bus_880_18,880,880).
route(bus_880_19,880,880).
route(bus_880_2,880,880).
route(bus_880_20,880,880).
route(bus_880_21,880,880).
route(bus_880_22,880,880).
route(bus_880_23,880,880).
route(bus_880_24,880,880).
route(bus_880_25,880,880).
route(bus_880_26,880,880).
route(bus_880_27,880,880).
route(bus_880_28,880,880).
route(bus_880_29,880,880).
route(bus_880_3,880,880).
route(bus_880_30,880,880).
route(bus_880_31,880,880).
route(bus_880_32,880,880).
route(bus_880_33,880,880).
route(bus_880_34,880,880).
route(bus_880_35,880,880).
route(bus_880_36,880,880).
route(bus_880_37,880,880).
route(bus_880_38,880,880).
route(bus_880_39,880,880).
route(bus_880_4,880,880).
route(bus_880_40,880,880).
route(bus_880_41,880,880).
route(bus_880_42,880,880).
route(bus_880_43,880,880).
route(bus_880_44,880,880).
route(bus_880_45,880,880).
route(bus_880_46,880,880).
route(bus_880_47,880,880).
route(bus_880_48,880,880).
route(bus_880_49,880,880).
route(bus_880_5,880,880).
route(bus_880_50,880,880).
route(bus_880_51,880,880).
route(bus_880_52,880,880).
route(bus_880_53,880,880).
route(bus_880_54,880,880).
route(bus_880_55,880,880).
route(bus_880_56,880,880).
route(bus_880_57,880,880).
route(bus_880_58,880,880).
route(bus_880_59,880,880).
route(bus_880_6,880,880).
route(bus_880_60,880,880).
route(bus_880_6001,880,880).
route(bus_880_6002,880,880).
route(bus_880_6003,880,880).
route(bus_880_6004,880,880).
route(bus_880_6005,880,880).
route(bus_880_6006,880,880).
route(bus_880_6007,880,880).
route(bus_880_6008,880,880).
route(bus_880_6009,880,880).
route(bus_880_6010,880,880).
route(bus_880_6011,880,880).
route(bus_880_6012,880,880).
route(bus_880_6013,880,880).
route(bus_880_6014,880,880).
route(bus_880_6015,880,880).
route(bus_880_6016,880,880).
route(bus_880_6017,880,880).
route(bus_880_6018,880,880).
route(bus_880_6019,880,880).
route(bus_880_6020,880,880).
route(bus_880_6021,880,880).
route(bus_880_6022,880,880).
route(bus_880_6023,880,880).
route(bus_880_6024,880,880).
route(bus_880_6025,880,880).
route(bus_880_6026,880,880).
route(bus_880_6027,880,880).
route(bus_880_6028,880,880).
route(bus_880_6029,880,880).
route(bus_880_6030,880,880).
route(bus_880_6031,880,880).
route(bus_880_6032,880,880).
route(bus_880_6033,880,880).
route(bus_880_6034,880,880).
route(bus_880_6035,880,880).
route(bus_880_6036,880,880).
route(bus_880_6037,880,880).
route(bus_880_6038,880,880).
route(bus_880_6039,880,880).
route(bus_880_6040,880,880).
route(bus_880_6041,880,880).
route(bus_880_6042,880,880).
route(bus_880_6043,880,880).
route(bus_880_6044,880,880).
route(bus_880_6045,880,880).
route(bus_880_6046,880,880).
route(bus_880_6047,880,880).
route(bus_880_6048,880,880).
route(bus_880_6049,880,880).
route(bus_880_6050,880,880).
route(bus_880_6051,880,880).
route(bus_880_6052,880,880).
route(bus_880_6053,880,880).
route(bus_880_6054,880,880).
route(bus_880_6055,880,880).
route(bus_880_6056,880,880).
route(bus_880_6057,880,880).
route(bus_880_6058,880,880).
route(bus_880_6059,880,880).
route(bus_880_6060,880,880).
route(bus_880_6061,880,880).
route(bus_880_6062,880,880).
route(bus_880_6063,880,880).
route(bus_880_6064,880,880).
route(bus_880_6065,880,880).
route(bus_880_6066,880,880).
route(bus_880_6067,880,880).
route(bus_880_6068,880,880).
route(bus_880_61,880,880).
route(bus_880_62,880,880).
route(bus_880_63,880,880).
route(bus_880_64,880,880).
route(bus_880_65,880,880).
route(bus_880_66,880,880).
route(bus_880_67,880,880).
route(bus_880_68,880,880).
route(bus_880_69,880,880).
route(bus_880_7,880,880).
route(bus_880_70,880,880).
route(bus_880_7001,880,880).
route(bus_880_7002,880,880).
route(bus_880_7003,880,880).
route(bus_880_7004,880,880).
route(bus_880_7005,880,880).
route(bus_880_7006,880,880).
route(bus_880_7007,880,880).
route(bus_880_7008,880,880).
route(bus_880_7009,880,880).
route(bus_880_7010,880,880).
route(bus_880_7011,880,880).
route(bus_880_7012,880,880).
route(bus_880_7013,880,880).
route(bus_880_7014,880,880).
route(bus_880_7015,880,880).
route(bus_880_7016,880,880).
route(bus_880_7017,880,880).
route(bus_880_7018,880,880).
route(bus_880_7019,880,880).
route(bus_880_7020,880,880).
route(bus_880_7021,880,880).
route(bus_880_7022,880,880).
route(bus_880_7023,880,880).
route(bus_880_7024,880,880).
route(bus_880_7025,880,880).
route(bus_880_7026,880,880).
route(bus_880_7027,880,880).
route(bus_880_7028,880,880).
route(bus_880_7029,880,880).
route(bus_880_7030,880,880).
route(bus_880_7031,880,880).
route(bus_880_7032,880,880).
route(bus_880_7033,880,880).
route(bus_880_7034,880,880).
route(bus_880_7035,880,880).
route(bus_880_7036,880,880).
route(bus_880_7037,880,880).
route(bus_880_7038,880,880).
route(bus_880_7039,880,880).
route(bus_880_7040,880,880).
route(bus_880_7041,880,880).
route(bus_880_7042,880,880).
route(bus_880_7043,880,880).
route(bus_880_7044,880,880).
route(bus_880_7045,880,880).
route(bus_880_7046,880,880).
route(bus_880_7047,880,880).
route(bus_880_7048,880,880).
route(bus_880_7049,880,880).
route(bus_880_7050,880,880).
route(bus_880_7051,880,880).
route(bus_880_7052,880,880).
route(bus_880_7053,880,880).
route(bus_880_7054,880,880).
route(bus_880_7055,880,880).
route(bus_880_7056,880,880).
route(bus_880_7057,880,880).
route(bus_880_7058,880,880).
route(bus_880_7059,880,880).
route(bus_880_7060,880,880).
route(bus_880_7061,880,880).
route(bus_880_7062,880,880).
route(bus_880_7063,880,880).
route(bus_880_7064,880,880).
route(bus_880_7065,880,880).
route(bus_880_7066,880,880).
route(bus_880_7067,880,880).
route(bus_880_7068,880,880).
route(bus_880_7069,880,880).
route(bus_880_7070,880,880).
route(bus_880_7071,880,880).
route(bus_880_7072,880,880).
route(bus_880_7073,880,880).
route(bus_880_7074,880,880).
route(bus_880_7075,880,880).
route(bus_880_7076,880,880).
route(bus_880_7077,880,880).
route(bus_880_7078,880,880).
route(bus_880_71,880,880).
route(bus_880_72,880,880).
route(bus_880_73,880,880).
route(bus_880_74,880,880).
route(bus_880_75,880,880).
route(bus_880_76,880,880).
route(bus_880_77,880,880).
route(bus_880_78,880,880).
route(bus_880_79,880,880).
route(bus_880_8,880,880).
route(bus_880_80,880,880).
route(bus_880_81,880,880).
route(bus_880_82,880,880).
route(bus_880_83,880,880).
route(bus_880_84,880,880).
route(bus_880_85,880,880).
route(bus_880_86,880,880).
route(bus_880_87,880,880).
route(bus_880_88,880,880).
route(bus_880_89,880,880).
route(bus_880_9,880,880).
route(bus_880_90,880,880).
route(bus_880_91,880,880).
route(bus_880_92,880,880).
route(bus_88_1,88,88).
route(bus_88_10,88,88).
route(bus_88_11,88,88).
route(bus_88_12,88,88).
route(bus_88_13,88,88).
route(bus_88_14,88,88).
route(bus_88_15,88,88).
route(bus_88_16,88,88).
route(bus_88_17,88,88).
route(bus_88_18,88,88).
route(bus_88_19,88,88).
route(bus_88_2,88,88).
route(bus_88_20,88,88).
route(bus_88_21,88,88).
route(bus_88_22,88,88).
route(bus_88_23,88,88).
route(bus_88_24,88,88).
route(bus_88_25,88,88).
route(bus_88_26,88,88).
route(bus_88_27,88,88).
route(bus_88_28,88,88).
route(bus_88_29,88,88).
route(bus_88_3,88,88).
route(bus_88_30,88,88).
route(bus_88_31,88,88).
route(bus_88_32,88,88).
route(bus_88_33,88,88).
route(bus_88_34,88,88).
route(bus_88_35,88,88).
route(bus_88_36,88,88).
route(bus_88_37,88,88).
route(bus_88_38,88,88).
route(bus_88_39,88,88).
route(bus_88_40,88,88).
route(bus_88_41,88,88).
route(bus_88_42,88,88).
route(bus_88_43,88,88).
route(bus_88_44,88,88).
route(bus_88_45,88,88).
route(bus_88_46,88,88).
route(bus_88_47,88,88).
route(bus_88_48,88,88).
route(bus_88_49,88,88).
route(bus_88_5,88,88).
route(bus_88_50,88,88).
route(bus_88_51,88,88).
route(bus_88_52,88,88).
route(bus_88_53,88,88).
route(bus_88_54,88,88).
route(bus_88_55,88,88).
route(bus_88_56,88,88).
route(bus_88_57,88,88).
route(bus_88_58,88,88).
route(bus_88_59,88,88).
route(bus_88_6,88,88).
route(bus_88_60,88,88).
route(bus_88_61,88,88).
route(bus_88_62,88,88).
route(bus_88_64,88,88).
route(bus_88_66,88,88).
route(bus_88_7,88,88).
route(bus_88_8,88,88).
route(bus_88_9,88,88).
route(bus_910_104263,910,910).
route(bus_910_104264,910,910).
route(bus_910_104265,910,910).
route(bus_910_104266,910,910).
route(bus_910_104267,910,910).
route(bus_910_104268,910,910).
route(bus_910_104269,910,910).
route(bus_910_104270,910,910).
route(bus_910_113263,910,910).
route(bus_910_113264,910,910).
route(bus_910_113265,910,910).
route(bus_910_113266,910,910).
route(bus_910_113267,910,910).
route(bus_910_113268,910,910).
route(bus_910_113269,910,910).
route(bus_910_113270,910,910).
route(bus_910_113271,910,910).
route(bus_910_65262,910,910).
route(bus_910_65263,910,910).
route(bus_910_65264,910,910).
route(bus_910_65265,910,910).
route(bus_910_65266,910,910).
route(bus_910_65267,910,910).
route(bus_910_71262,910,910).
route(bus_910_71263,910,910).
route(bus_910_75262,910,910).
route(bus_910_75263,910,910).
route(bus_910_75264,910,910).
route(bus_910_75265,910,910).
route(bus_910_75266,910,910).
route(bus_910_75267,910,910).
route(bus_910_75268,910,910).
route(bus_910_75269,910,910).
route(bus_910_75270,910,910).
route(bus_910_8327,910,910).
route(bus_910_8331,910,910).
route(bus_910_8333,910,910).
route(bus_910_8335,910,910).
route(bus_910_8337,910,910).
route(bus_910_8339,910,910).
route(bus_910_8341,910,910).
route(bus_910_8343,910,910).
route(bus_910_8371,910,910).
route(bus_910_8373,910,910).
route(bus_910_8377,910,910).
route(bus_910_8379,910,910).
route(bus_910_8381,910,910).
route(bus_910_8383,910,910).
route(bus_910_8385,910,910).
route(bus_910_8387,910,910).
route(bus_910_8389,910,910).
route(bus_910_8391,910,910).
route(bus_910_8393,910,910).
route(bus_910_8395,910,910).
route(bus_910_8397,910,910).
route(bus_910_8399,910,910).
route(bus_910_8401,910,910).
route(bus_910_8403,910,910).
route(bus_910_8405,910,910).
route(bus_910_8407,910,910).
route(bus_910_8409,910,910).
route(bus_910_8411,910,910).
route(bus_910_8413,910,910).
route(bus_910_8415,910,910).
route(bus_910_8417,910,910).
route(bus_910_8419,910,910).
route(bus_910_8421,910,910).
route(bus_910_8423,910,910).
route(bus_910_8425,910,910).
route(bus_910_8427,910,910).
route(bus_910_8429,910,910).
route(bus_910_8431,910,910).
route(bus_910_8433,910,910).
route(bus_910_8435,910,910).
route(bus_910_8437,910,910).
route(bus_910_8439,910,910).
route(bus_910_8441,910,910).
route(bus_910_8443,910,910).
route(bus_910_8447,910,910).
route(bus_910_8451,910,910).
route(bus_910_8453,910,910).
route(bus_910_8455,910,910).
route(bus_910_8457,910,910).
route(bus_910_8459,910,910).
route(bus_910_8461,910,910).
route(bus_910_8463,910,910).
route(bus_910_8465,910,910).
route(bus_910_8467,910,910).
route(bus_910_8469,910,910).
route(bus_910_8471,910,910).
route(bus_910_8473,910,910).
route(bus_910_8475,910,910).
route(bus_910_8477,910,910).
route(bus_910_8479,910,910).
route(bus_910_8481,910,910).
route(bus_910_8483,910,910).
route(bus_910_8485,910,910).
route(bus_910_8487,910,910).
route(bus_910_8491,910,910).
route(bus_910_8493,910,910).
route(bus_910_8495,910,910).
route(bus_910_8497,910,910).
route(bus_910_8501,910,910).
route(bus_910_8505,910,910).
route(bus_910_85262,910,910).
route(bus_910_85263,910,910).
route(bus_910_85264,910,910).
route(bus_910_85265,910,910).
route(bus_910_85266,910,910).
route(bus_910_85267,910,910).
route(bus_910_85268,910,910).
route(bus_910_85269,910,910).
route(bus_910_94262,910,910).
route(bus_910_94263,910,910).
route(bus_910_94264,910,910).
route(bus_910_94265,910,910).
route(bus_910_94266,910,910).
route(bus_910_94267,910,910).
route(bus_910_94268,910,910).
route(bus_910_94269,910,910).
route(bus_910_94270,910,910).
route(bus_920_110264,920,920).
route(bus_920_110266,920,920).
route(bus_920_110268,920,920).
route(bus_920_110270,920,920).
route(bus_920_110272,920,920).
route(bus_920_110274,920,920).
route(bus_920_110276,920,920).
route(bus_920_110278,920,920).
route(bus_920_110280,920,920).
route(bus_920_110282,920,920).
route(bus_920_110284,920,920).
route(bus_920_110286,920,920).
route(bus_920_110288,920,920).
route(bus_920_110290,920,920).
route(bus_920_110292,920,920).
route(bus_920_110294,920,920).
route(bus_920_202614,920,920).
route(bus_920_202616,920,920).
route(bus_920_202618,920,920).
route(bus_920_202620,920,920).
route(bus_920_202622,920,920).
route(bus_920_22613,920,920).
route(bus_920_22614,920,920).
route(bus_920_22615,920,920).
route(bus_920_22616,920,920).
route(bus_920_22617,920,920).
route(bus_920_22619,920,920).
route(bus_920_22621,920,920).
route(bus_920_22623,920,920).
route(bus_920_22625,920,920).
route(bus_920_22627,920,920).
route(bus_920_22628,920,920).
route(bus_920_22629,920,920).
route(bus_920_22630,920,920).
route(bus_920_22631,920,920).
route(bus_920_22632,920,920).
route(bus_920_22633,920,920).
route(bus_920_22634,920,920).
route(bus_920_22635,920,920).
route(bus_920_272613,920,920).
route(bus_920_272614,920,920).
route(bus_920_272615,920,920).
route(bus_920_272616,920,920).
route(bus_920_322613,920,920).
route(bus_920_322614,920,920).
route(bus_920_322615,920,920).
route(bus_920_322616,920,920).
route(bus_920_322617,920,920).
route(bus_920_372613,920,920).
route(bus_920_372614,920,920).
route(bus_920_372615,920,920).
route(bus_920_372616,920,920).
route(bus_920_372617,920,920).
route(bus_920_372618,920,920).
route(bus_920_372619,920,920).
route(bus_920_372620,920,920).
route(bus_920_462613,920,920).
route(bus_920_462614,920,920).
route(bus_920_462615,920,920).
route(bus_920_462616,920,920).
route(bus_920_462617,920,920).
route(bus_920_532613,920,920).
route(bus_920_532614,920,920).
route(bus_920_532615,920,920).
route(bus_920_532617,920,920).
route(bus_920_532619,920,920).
route(bus_920_532621,920,920).
route(bus_920_532623,920,920).
route(bus_920_532625,920,920).
route(bus_920_532627,920,920).
route(bus_920_532629,920,920).
route(bus_920_532630,920,920).
route(bus_920_532631,920,920).
route(bus_920_532633,920,920).
route(bus_920_532635,920,920).
route(bus_920_532637,920,920).
route(bus_920_532639,920,920).
route(bus_920_532641,920,920).
route(bus_920_532643,920,920).
route(bus_920_532645,920,920).
route(bus_920_73262,920,920).
route(bus_920_73263,920,920).
route(bus_920_73264,920,920).
route(bus_920_73266,920,920).
route(bus_920_73268,920,920).
route(bus_920_73270,920,920).
route(bus_920_73272,920,920).
route(bus_920_73274,920,920).
route(bus_920_73276,920,920).
route(bus_920_73278,920,920).
route(bus_920_73279,920,920).
route(bus_920_73280,920,920).
route(bus_920_73282,920,920).
route(bus_920_73284,920,920).
route(bus_920_73286,920,920).
route(bus_920_73288,920,920).
route(bus_920_73290,920,920).
route(bus_920_73292,920,920).
route(bus_920_73294,920,920).
route(bus_920_8345,920,920).
route(bus_920_8351,920,920).
route(bus_920_8353,920,920).
route(bus_920_8355,920,920).
route(bus_920_8357,920,920).
route(bus_920_8363,920,920).
route(bus_920_8365,920,920).
route(bus_920_8367,920,920).
route(bus_920_8369,920,920).
route(bus_920_93264,920,920).
route(bus_920_93266,920,920).
route(bus_920_93268,920,920).
route(bus_920_93270,920,920).
route(bus_920_93272,920,920).
route(bus_920_93274,920,920).
route(bus_920_93276,920,920).
route(bus_920_93278,920,920).
route(bus_920_93280,920,920).
route(bus_920_93282,920,920).
route(bus_920_93284,920,920).
route(bus_920_93286,920,920).
route(bus_920_93288,920,920).
route(bus_920_93290,920,920).
route(bus_920_93292,920,920).
route(bus_920_93294,920,920).
route(bus_950_1,950,950).
route(bus_950_10,950,950).
route(bus_950_12,950,950).
route(bus_950_14,950,950).
route(bus_950_16,950,950).
route(bus_950_18,950,950).
route(bus_950_20,950,950).
route(bus_950_22,950,950).
route(bus_950_24,950,950).
route(bus_950_24184,950,950).
route(bus_950_24185,950,950).
route(bus_950_24186,950,950).
route(bus_950_24187,950,950).
route(bus_950_24188,950,950).
route(bus_950_24189,950,950).
route(bus_950_24190,950,950).
route(bus_950_24191,950,950).
route(bus_950_24192,950,950).
route(bus_950_3,950,950).
route(bus_950_34185,950,950).
route(bus_950_34186,950,950).
route(bus_950_34187,950,950).
route(bus_950_34188,950,950).
route(bus_950_34189,950,950).
route(bus_950_34190,950,950).
route(bus_950_34191,950,950).
route(bus_950_34192,950,950).
route(bus_950_34193,950,950).
route(bus_950_34194,950,950).
route(bus_950_34195,950,950).
route(bus_950_46185,950,950).
route(bus_950_46186,950,950).
route(bus_950_46187,950,950).
route(bus_950_46188,950,950).
route(bus_950_46189,950,950).
route(bus_950_46190,950,950).
route(bus_950_46191,950,950).
route(bus_950_46192,950,950).
route(bus_950_46193,950,950).
route(bus_950_5,950,950).
route(bus_950_56185,950,950).
route(bus_950_56186,950,950).
route(bus_950_56187,950,950).
route(bus_950_56188,950,950).
route(bus_950_56189,950,950).
route(bus_950_56190,950,950).
route(bus_950_56191,950,950).
route(bus_950_56192,950,950).
route(bus_950_56193,950,950).
route(bus_950_6001,950,950).
route(bus_950_6003,950,950).
route(bus_950_6005,950,950).
route(bus_950_6007,950,950).
route(bus_950_6009,950,950).
route(bus_950_6011,950,950).
route(bus_950_6013,950,950).
route(bus_950_6015,950,950).
route(bus_950_6017,950,950).
route(bus_950_6019,950,950).
route(bus_950_7,950,950).
route(bus_950_8101,950,950).
route(bus_950_8103,950,950).
route(bus_950_8105,950,950).
route(bus_950_8107,950,950).
route(bus_963_27209,963,963).
route(bus_963_28209,963,963).
route(bus_963_8207,963,963).
route(bus_963_8213,963,963).
route(bus_963_8217,963,963).
route(bus_963_8221,963,963).
route(bus_963_8227,963,963).
route(bus_963_8257,963,963).
route(bus_963_8261,963,963).
route(bus_963_8265,963,963).
route(bus_963_8269,963,963).
route(bus_963_8287,963,963).
route(bus_963_8289,963,963).
route(bus_963_8293,963,963).
route(bus_963_8295,963,963).
route(bus_963_8299,963,963).
route(bus_963_8303,963,963).
route(bus_963_8305,963,963).
route(bus_963_8311,963,963).
route(bus_963_8313,963,963).
route(bus_963_8315,963,963).
route(bus_963_8317,963,963).
route(bus_963_8323,963,963).
route(bus_963_8325,963,963).
route(bus_963_8511,963,963).
route(bus_963_8515,963,963).
route(bus_963_8517,963,963).
route(bus_963_8519,963,963).
route(bus_963_8523,963,963).
route(bus_963_8525,963,963).
route(bus_966_8211,966,966).
route(bus_966_8233,966,966).
route(bus_966_8239,966,966).
route(bus_966_8241,966,966).
route(bus_966_8251,966,966).
route(bus_966_8253,966,966).
route(bus_966_8255,966,966).
route(bus_966_8259,966,966).
route(bus_966_8267,966,966).
route(bus_966_8271,966,966).
route(bus_966_8273,966,966).
route(bus_966_8275,966,966).
route(bus_966_8529,966,966).
route(bus_966_8531,966,966).
route(bus_966_8533,966,966).
route(bus_966_8535,966,966).
route(bus_966_8537,966,966).
route(bus_966_8539,966,966).
route(bus_966_8541,966,966).
route(bus_966_8543,966,966).
route(bus_966_8545,966,966).
route(bus_966_8547,966,966).
route(bus_966_8549,966,966).
route(bus_980_8,980,980).
route(bus_980_8187,980,980).
route(bus_980_8190,980,980).
route(bus_980_8195,980,980).
route(bus_980_8197,980,980).
route(bus_980_8201,980,980).
route(bus_980_8203,980,980).
route(bus_980_8205,980,980).
route(bus_980_8603,980,980).
route(bus_980_9002,980,980).
route(bus_980_9004,980,980).
route(bus_980_9006,980,980).
route(bus_980_9012,980,980).
route(bus_9_1,9,9).
route(bus_9_10,9,9).
route(bus_9_100,9,9).
route(bus_9_101,9,9).
route(bus_9_102,9,9).
route(bus_9_103,9,9).
route(bus_9_104,9,9).
route(bus_9_105,9,9).
route(bus_9_106,9,9).
route(bus_9_107,9,9).
route(bus_9_108,9,9).
route(bus_9_109,9,9).
route(bus_9_11,9,9).
route(bus_9_110,9,9).
route(bus_9_111,9,9).
route(bus_9_112,9,9).
route(bus_9_113,9,9).
route(bus_9_114,9,9).
route(bus_9_115,9,9).
route(bus_9_116,9,9).
route(bus_9_117,9,9).
route(bus_9_118,9,9).
route(bus_9_119,9,9).
route(bus_9_12,9,9).
route(bus_9_120,9,9).
route(bus_9_121,9,9).
route(bus_9_122,9,9).
route(bus_9_124,9,9).
route(bus_9_125,9,9).
route(bus_9_126,9,9).
route(bus_9_127,9,9).
route(bus_9_128,9,9).
route(bus_9_129,9,9).
route(bus_9_13,9,9).
route(bus_9_14,9,9).
route(bus_9_15,9,9).
route(bus_9_16,9,9).
route(bus_9_17,9,9).
route(bus_9_18,9,9).
route(bus_9_19,9,9).
route(bus_9_2,9,9).
route(bus_9_20,9,9).
route(bus_9_21,9,9).
route(bus_9_22,9,9).
route(bus_9_23,9,9).
route(bus_9_24,9,9).
route(bus_9_25,9,9).
route(bus_9_26,9,9).
route(bus_9_27,9,9).
route(bus_9_28,9,9).
route(bus_9_29,9,9).
route(bus_9_3,9,9).
route(bus_9_30,9,9).
route(bus_9_31,9,9).
route(bus_9_32,9,9).
route(bus_9_33,9,9).
route(bus_9_34,9,9).
route(bus_9_35,9,9).
route(bus_9_36,9,9).
route(bus_9_37,9,9).
route(bus_9_38,9,9).
route(bus_9_39,9,9).
route(bus_9_4,9,9).
route(bus_9_40,9,9).
route(bus_9_41,9,9).
route(bus_9_42,9,9).
route(bus_9_43,9,9).
route(bus_9_44,9,9).
route(bus_9_45,9,9).
route(bus_9_46,9,9).
route(bus_9_47,9,9).
route(bus_9_48,9,9).
route(bus_9_49,9,9).
route(bus_9_5,9,9).
route(bus_9_50,9,9).
route(bus_9_51,9,9).
route(bus_9_52,9,9).
route(bus_9_53,9,9).
route(bus_9_54,9,9).
route(bus_9_55,9,9).
route(bus_9_56,9,9).
route(bus_9_57,9,9).
route(bus_9_58,9,9).
route(bus_9_59,9,9).
route(bus_9_6,9,9).
route(bus_9_60,9,9).
route(bus_9_6001,9,9).
route(bus_9_6002,9,9).
route(bus_9_6003,9,9).
route(bus_9_6004,9,9).
route(bus_9_6005,9,9).
route(bus_9_6006,9,9).
route(bus_9_6007,9,9).
route(bus_9_6008,9,9).
route(bus_9_6009,9,9).
route(bus_9_6010,9,9).
route(bus_9_6011,9,9).
route(bus_9_6012,9,9).
route(bus_9_6013,9,9).
route(bus_9_6014,9,9).
route(bus_9_6015,9,9).
route(bus_9_6016,9,9).
route(bus_9_6017,9,9).
route(bus_9_6018,9,9).
route(bus_9_6019,9,9).
route(bus_9_6020,9,9).
route(bus_9_6021,9,9).
route(bus_9_6022,9,9).
route(bus_9_6023,9,9).
route(bus_9_6024,9,9).
route(bus_9_6025,9,9).
route(bus_9_6026,9,9).
route(bus_9_6027,9,9).
route(bus_9_6028,9,9).
route(bus_9_6029,9,9).
route(bus_9_6030,9,9).
route(bus_9_6031,9,9).
route(bus_9_6032,9,9).
route(bus_9_6033,9,9).
route(bus_9_6034,9,9).
route(bus_9_6035,9,9).
route(bus_9_6036,9,9).
route(bus_9_6037,9,9).
route(bus_9_6038,9,9).
route(bus_9_6039,9,9).
route(bus_9_6040,9,9).
route(bus_9_6041,9,9).
route(bus_9_6042,9,9).
route(bus_9_6043,9,9).
route(bus_9_6044,9,9).
route(bus_9_6045,9,9).
route(bus_9_6046,9,9).
route(bus_9_6047,9,9).
route(bus_9_6048,9,9).
route(bus_9_6049,9,9).
route(bus_9_6050,9,9).
route(bus_9_6051,9,9).
route(bus_9_6052,9,9).
route(bus_9_6053,9,9).
route(bus_9_6054,9,9).
route(bus_9_6055,9,9).
route(bus_9_6056,9,9).
route(bus_9_6057,9,9).
route(bus_9_6058,9,9).
route(bus_9_6059,9,9).
route(bus_9_6060,9,9).
route(bus_9_6061,9,9).
route(bus_9_6062,9,9).
route(bus_9_6063,9,9).
route(bus_9_6064,9,9).
route(bus_9_6065,9,9).
route(bus_9_6066,9,9).
route(bus_9_6067,9,9).
route(bus_9_6068,9,9).
route(bus_9_6069,9,9).
route(bus_9_6070,9,9).
route(bus_9_6071,9,9).
route(bus_9_6072,9,9).
route(bus_9_6073,9,9).
route(bus_9_6074,9,9).
route(bus_9_6075,9,9).
route(bus_9_6076,9,9).
route(bus_9_6077,9,9).
route(bus_9_6078,9,9).
route(bus_9_6079,9,9).
route(bus_9_6080,9,9).
route(bus_9_6081,9,9).
route(bus_9_6082,9,9).
route(bus_9_6083,9,9).
route(bus_9_6084,9,9).
route(bus_9_6085,9,9).
route(bus_9_6086,9,9).
route(bus_9_6087,9,9).
route(bus_9_6088,9,9).
route(bus_9_6089,9,9).
route(bus_9_6090,9,9).
route(bus_9_6091,9,9).
route(bus_9_6092,9,9).
route(bus_9_6093,9,9).
route(bus_9_6094,9,9).
route(bus_9_6095,9,9).
route(bus_9_6096,9,9).
route(bus_9_6097,9,9).
route(bus_9_6098,9,9).
route(bus_9_6099,9,9).
route(bus_9_61,9,9).
route(bus_9_6100,9,9).
route(bus_9_6101,9,9).
route(bus_9_6102,9,9).
route(bus_9_6103,9,9).
route(bus_9_6104,9,9).
route(bus_9_6105,9,9).
route(bus_9_6106,9,9).
route(bus_9_6107,9,9).
route(bus_9_6108,9,9).
route(bus_9_6109,9,9).
route(bus_9_6110,9,9).
route(bus_9_62,9,9).
route(bus_9_63,9,9).
route(bus_9_64,9,9).
route(bus_9_65,9,9).
route(bus_9_66,9,9).
route(bus_9_67,9,9).
route(bus_9_68,9,9).
route(bus_9_69,9,9).
route(bus_9_7,9,9).
route(bus_9_70,9,9).
route(bus_9_7001,9,9).
route(bus_9_7002,9,9).
route(bus_9_7003,9,9).
route(bus_9_7004,9,9).
route(bus_9_7005,9,9).
route(bus_9_7006,9,9).
route(bus_9_7007,9,9).
route(bus_9_7008,9,9).
route(bus_9_7009,9,9).
route(bus_9_7010,9,9).
route(bus_9_7011,9,9).
route(bus_9_7012,9,9).
route(bus_9_7013,9,9).
route(bus_9_7014,9,9).
route(bus_9_7015,9,9).
route(bus_9_7016,9,9).
route(bus_9_7017,9,9).
route(bus_9_7018,9,9).
route(bus_9_7019,9,9).
route(bus_9_7020,9,9).
route(bus_9_7021,9,9).
route(bus_9_7022,9,9).
route(bus_9_7023,9,9).
route(bus_9_7024,9,9).
route(bus_9_7025,9,9).
route(bus_9_7026,9,9).
route(bus_9_7027,9,9).
route(bus_9_7028,9,9).
route(bus_9_7029,9,9).
route(bus_9_7030,9,9).
route(bus_9_7031,9,9).
route(bus_9_7032,9,9).
route(bus_9_7033,9,9).
route(bus_9_7034,9,9).
route(bus_9_7035,9,9).
route(bus_9_7036,9,9).
route(bus_9_7037,9,9).
route(bus_9_7038,9,9).
route(bus_9_7039,9,9).
route(bus_9_7040,9,9).
route(bus_9_7041,9,9).
route(bus_9_7042,9,9).
route(bus_9_7043,9,9).
route(bus_9_7044,9,9).
route(bus_9_7045,9,9).
route(bus_9_7046,9,9).
route(bus_9_7047,9,9).
route(bus_9_7048,9,9).
route(bus_9_7049,9,9).
route(bus_9_7050,9,9).
route(bus_9_7051,9,9).
route(bus_9_7052,9,9).
route(bus_9_7053,9,9).
route(bus_9_7054,9,9).
route(bus_9_7055,9,9).
route(bus_9_7056,9,9).
route(bus_9_7057,9,9).
route(bus_9_7058,9,9).
route(bus_9_7059,9,9).
route(bus_9_7060,9,9).
route(bus_9_71,9,9).
route(bus_9_72,9,9).
route(bus_9_73,9,9).
route(bus_9_74,9,9).
route(bus_9_75,9,9).
route(bus_9_76,9,9).
route(bus_9_77,9,9).
route(bus_9_78,9,9).
route(bus_9_79,9,9).
route(bus_9_8,9,9).
route(bus_9_80,9,9).
route(bus_9_81,9,9).
route(bus_9_82,9,9).
route(bus_9_83,9,9).
route(bus_9_84,9,9).
route(bus_9_85,9,9).
route(bus_9_86,9,9).
route(bus_9_87,9,9).
route(bus_9_88,9,9).
route(bus_9_89,9,9).
route(bus_9_9,9,9).
route(bus_9_90,9,9).
route(bus_9_91,9,9).
route(bus_9_92,9,9).
route(bus_9_93,9,9).
route(bus_9_94,9,9).
route(bus_9_95,9,9).
route(bus_9_96,9,9).
route(bus_9_97,9,9).
route(bus_9_98,9,9).
route(bus_9_99,9,9).
| 25.451373 | 40 | 0.766518 |
ed46fbe561c7a3ee5f170833fb7132827a2f7d11 | 1,462 | pm | Perl | lib/Accessories/Nodes/IndexByProcess.pm | desertnet/tachikoma | 89c3bdb9dacdcadae553108d1eda8f9a0a5fdf9d | [
"MIT"
]
| 7 | 2018-09-29T15:42:10.000Z | 2019-10-03T17:21:56.000Z | lib/Accessories/Nodes/IndexByProcess.pm | desertnet/tachikoma | 89c3bdb9dacdcadae553108d1eda8f9a0a5fdf9d | [
"MIT"
]
| null | null | null | lib/Accessories/Nodes/IndexByProcess.pm | desertnet/tachikoma | 89c3bdb9dacdcadae553108d1eda8f9a0a5fdf9d | [
"MIT"
]
| 3 | 2018-09-29T07:46:52.000Z | 2020-07-21T00:25:41.000Z | #!/usr/bin/perl
# ----------------------------------------------------------------------
# Accessories::Nodes::IndexByProcess
# ----------------------------------------------------------------------
#
# $Id: IndexByTimestamp.pm 3511 2009-10-08 00:18:42Z chris $
#
package Accessories::Nodes::IndexByProcess;
use strict;
use warnings;
use Tachikoma::Node;
use Tachikoma::Message qw(
TYPE FROM TO ID STREAM TIMESTAMP PAYLOAD
TM_BYTESTREAM TM_PERSIST
);
use parent qw( Tachikoma::Node );
use version; our $VERSION = qv('v2.0.700');
sub fill {
my $self = shift;
my $message = shift;
$self->{counter}++;
return $self->cancel($message)
if ( not $message->[TYPE] & TM_BYTESTREAM );
my $partition = ( $message->[FROM] =~ m{(\d+)$} )[0];
my $offset = ( split m{:}, $message->[ID], 2 )[0] // 0;
my $process = ( split q( ), $message->[PAYLOAD], 6 )[4] // q(-);
$process =~ s{\[\d+\]:$}{};
$process =~ s{--\d+--.*?:tail}{--XXX:tail}g;
$process =~ s{\d}{X}g;
my $response = Tachikoma::Message->new;
$response->[TYPE] = TM_BYTESTREAM | TM_PERSIST;
$response->[FROM] = $message->[FROM];
$response->[TO] = $self->{owner} || $message->[TO];
$response->[ID] = $message->[ID];
$response->[STREAM] = $process;
$response->[TIMESTAMP] = $message->[TIMESTAMP];
$response->[PAYLOAD] = "$partition:$offset\n";
return $self->{sink}->fill($response);
}
1;
| 32.488889 | 72 | 0.514364 |
ed30674eae673a34f5baf70c506b58aff73a3e0b | 386 | pl | Perl | categories/rosalind/afrq-grondilu.pl | amit1999999/amit1 | 658755cf1fbfeaebc82124a93054e0695d087d1a | [
"Artistic-2.0"
]
| 198 | 2015-01-07T17:07:56.000Z | 2019-12-26T17:15:33.000Z | categories/rosalind/afrq-grondilu.pl | amit1999999/amit1 | 658755cf1fbfeaebc82124a93054e0695d087d1a | [
"Artistic-2.0"
]
| 44 | 2015-01-23T08:11:58.000Z | 2020-01-12T13:18:02.000Z | categories/rosalind/afrq-grondilu.pl | amit1999999/amit1 | 658755cf1fbfeaebc82124a93054e0695d087d1a | [
"Artistic-2.0"
]
| 84 | 2015-01-19T04:39:20.000Z | 2019-12-18T18:02:45.000Z | use v6;
=begin pod
=TITLE Counting Disease Carriers
=AUTHOR L. Grondin
L<http://rosalind.info/problems/afrq/>
Expected output from default input data:
0.532 0.75 0.914
=end pod
sub MAIN($data-string = "0.1 0.25 0.5") {
my @A = $data-string.split(' ')».Num;
say @A».&afrq.fmt('%.3g');
}
sub afrq($r) { 1 - (1 - sqrt $r)**2 }
# vim: expandtab shiftwidth=4 ft=perl6
| 14.846154 | 41 | 0.619171 |
ed16737a6a1fb5001b548258297185b8dc5b73db | 7,958 | pl | Perl | src/backend/utils/Gen_fmgrtab.pl | shadowwalker2718/postgres | f89ae34ab8b4d9e9ce8af6bd889238b0ccff17cb | [
"PostgreSQL"
]
| 1 | 2019-05-10T04:17:31.000Z | 2019-05-10T04:17:31.000Z | src/backend/utils/Gen_fmgrtab.pl | shadowwalker2718/postgres | f89ae34ab8b4d9e9ce8af6bd889238b0ccff17cb | [
"PostgreSQL"
]
| null | null | null | src/backend/utils/Gen_fmgrtab.pl | shadowwalker2718/postgres | f89ae34ab8b4d9e9ce8af6bd889238b0ccff17cb | [
"PostgreSQL"
]
| 1 | 2019-01-11T12:13:27.000Z | 2019-01-11T12:13:27.000Z | #! /usr/bin/perl -w
#-------------------------------------------------------------------------
#
# Gen_fmgrtab.pl
# Perl script that generates fmgroids.h, fmgrprotos.h, and fmgrtab.c
# from pg_proc.dat
#
# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# src/backend/utils/Gen_fmgrtab.pl
#
#-------------------------------------------------------------------------
use Catalog;
use strict;
use warnings;
# Collect arguments
my @input_files;
my $output_path = '';
my $include_path;
while (@ARGV)
{
my $arg = shift @ARGV;
if ($arg !~ /^-/)
{
push @input_files, $arg;
}
elsif ($arg =~ /^-o/)
{
$output_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
}
elsif ($arg =~ /^-I/)
{
$include_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
}
else
{
usage();
}
}
# Make sure output_path ends in a slash.
if ($output_path ne '' && substr($output_path, -1) ne '/')
{
$output_path .= '/';
}
# Sanity check arguments.
die "No input files.\n" if !@input_files;
die "No include path; you must specify -I.\n" if !$include_path;
# Read all the input files into internal data structures.
# Note: We pass data file names as arguments and then look for matching
# headers to parse the schema from. This is backwards from genbki.pl,
# but the Makefile dependencies look more sensible this way.
my %catalogs;
my %catalog_data;
foreach my $datfile (@input_files)
{
$datfile =~ /(.+)\.dat$/
or die "Input files need to be data (.dat) files.\n";
my $header = "$1.h";
die "There in no header file corresponding to $datfile"
if !-e $header;
my $catalog = Catalog::ParseHeader($header);
my $catname = $catalog->{catname};
my $schema = $catalog->{columns};
$catalogs{$catname} = $catalog;
$catalog_data{$catname} = Catalog::ParseData($datfile, $schema, 0);
}
# Fetch some values for later.
my $FirstGenbkiObjectId =
Catalog::FindDefinedSymbol('access/transam.h', $include_path,
'FirstGenbkiObjectId');
my $INTERNALlanguageId =
Catalog::FindDefinedSymbolFromData($catalog_data{pg_language},
'INTERNALlanguageId');
# Collect certain fields from pg_proc.dat.
my @fmgr = ();
foreach my $row (@{ $catalog_data{pg_proc} })
{
my %bki_values = %$row;
# Select out just the rows for internal-language procedures.
next if $bki_values{prolang} ne $INTERNALlanguageId;
push @fmgr,
{
oid => $bki_values{oid},
strict => $bki_values{proisstrict},
retset => $bki_values{proretset},
nargs => $bki_values{pronargs},
prosrc => $bki_values{prosrc},
};
}
# Emit headers for both files
my $tmpext = ".tmp$$";
my $oidsfile = $output_path . 'fmgroids.h';
my $protosfile = $output_path . 'fmgrprotos.h';
my $tabfile = $output_path . 'fmgrtab.c';
open my $ofh, '>', $oidsfile . $tmpext
or die "Could not open $oidsfile$tmpext: $!";
open my $pfh, '>', $protosfile . $tmpext
or die "Could not open $protosfile$tmpext: $!";
open my $tfh, '>', $tabfile . $tmpext
or die "Could not open $tabfile$tmpext: $!";
print $ofh <<OFH;
/*-------------------------------------------------------------------------
*
* fmgroids.h
* Macros that define the OIDs of built-in functions.
*
* These macros can be used to avoid a catalog lookup when a specific
* fmgr-callable function needs to be referenced.
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* NOTES
* ******************************
* *** DO NOT EDIT THIS FILE! ***
* ******************************
*
* It has been GENERATED by src/backend/utils/Gen_fmgrtab.pl
*
*-------------------------------------------------------------------------
*/
#ifndef FMGROIDS_H
#define FMGROIDS_H
/*
* Constant macros for the OIDs of entries in pg_proc.
*
* NOTE: macros are named after the prosrc value, ie the actual C name
* of the implementing function, not the proname which may be overloaded.
* For example, we want to be able to assign different macro names to both
* char_text() and name_text() even though these both appear with proname
* 'text'. If the same C function appears in more than one pg_proc entry,
* its equivalent macro will be defined with the lowest OID among those
* entries.
*/
OFH
print $pfh <<PFH;
/*-------------------------------------------------------------------------
*
* fmgrprotos.h
* Prototypes for built-in functions.
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* NOTES
* ******************************
* *** DO NOT EDIT THIS FILE! ***
* ******************************
*
* It has been GENERATED by src/backend/utils/Gen_fmgrtab.pl
*
*-------------------------------------------------------------------------
*/
#ifndef FMGRPROTOS_H
#define FMGRPROTOS_H
#include "fmgr.h"
PFH
print $tfh <<TFH;
/*-------------------------------------------------------------------------
*
* fmgrtab.c
* The function manager's table of internal functions.
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* NOTES
*
* ******************************
* *** DO NOT EDIT THIS FILE! ***
* ******************************
*
* It has been GENERATED by src/backend/utils/Gen_fmgrtab.pl
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "access/transam.h"
#include "utils/fmgrtab.h"
#include "utils/fmgrprotos.h"
TFH
# Emit #define's and extern's -- only one per prosrc value
my %seenit;
foreach my $s (sort { $a->{oid} <=> $b->{oid} } @fmgr)
{
next if $seenit{ $s->{prosrc} };
$seenit{ $s->{prosrc} } = 1;
print $ofh "#define F_" . uc $s->{prosrc} . " $s->{oid}\n";
print $pfh "extern Datum $s->{prosrc}(PG_FUNCTION_ARGS);\n";
}
# Create the fmgr_builtins table, collect data for fmgr_builtin_oid_index
print $tfh "\nconst FmgrBuiltin fmgr_builtins[] = {\n";
my %bmap;
$bmap{'t'} = 'true';
$bmap{'f'} = 'false';
my @fmgr_builtin_oid_index;
my $fmgr_count = 0;
foreach my $s (sort { $a->{oid} <=> $b->{oid} } @fmgr)
{
print $tfh
" { $s->{oid}, $s->{nargs}, $bmap{$s->{strict}}, $bmap{$s->{retset}}, \"$s->{prosrc}\", $s->{prosrc} }";
$fmgr_builtin_oid_index[ $s->{oid} ] = $fmgr_count++;
if ($fmgr_count <= $#fmgr)
{
print $tfh ",\n";
}
else
{
print $tfh "\n";
}
}
print $tfh "};\n";
print $tfh qq|
const int fmgr_nbuiltins = (sizeof(fmgr_builtins) / sizeof(FmgrBuiltin));
|;
# Create fmgr_builtins_oid_index table.
#
# Note that the array has to be filled up to FirstGenbkiObjectId,
# as we can't rely on zero initialization as 0 is a valid mapping.
print $tfh qq|
const uint16 fmgr_builtin_oid_index[FirstGenbkiObjectId] = {
|;
for (my $i = 0; $i < $FirstGenbkiObjectId; $i++)
{
my $oid = $fmgr_builtin_oid_index[$i];
# fmgr_builtin_oid_index is sparse, map nonexistant functions to
# InvalidOidBuiltinMapping
if (not defined $oid)
{
$oid = 'InvalidOidBuiltinMapping';
}
if ($i + 1 == $FirstGenbkiObjectId)
{
print $tfh " $oid\n";
}
else
{
print $tfh " $oid,\n";
}
}
print $tfh "};\n";
# And add the file footers.
print $ofh "\n#endif\t\t\t\t\t\t\t/* FMGROIDS_H */\n";
print $pfh "\n#endif\t\t\t\t\t\t\t/* FMGRPROTOS_H */\n";
close($ofh);
close($pfh);
close($tfh);
# Finally, rename the completed files into place.
Catalog::RenameTempFile($oidsfile, $tmpext);
Catalog::RenameTempFile($protosfile, $tmpext);
Catalog::RenameTempFile($tabfile, $tmpext);
sub usage
{
die <<EOM;
Usage: perl -I [directory of Catalog.pm] Gen_fmgrtab.pl -I [include path] [path to pg_proc.dat]
Gen_fmgrtab.pl generates fmgroids.h, fmgrprotos.h, and fmgrtab.c from
pg_proc.dat
Report bugs to <pgsql-bugs\@postgresql.org>.
EOM
}
exit 0;
| 25.670968 | 108 | 0.603544 |
ed5077be781fe0dda28dda2821e6bf318abf5cb9 | 681 | pm | Perl | auto-lib/Paws/RDS/DescribeDBLogFilesResponse.pm | agimenez/aws-sdk-perl | 9c4dff7d1af2ff0210c28ca44fb9e92bc625712b | [
"Apache-2.0"
]
| null | null | null | auto-lib/Paws/RDS/DescribeDBLogFilesResponse.pm | agimenez/aws-sdk-perl | 9c4dff7d1af2ff0210c28ca44fb9e92bc625712b | [
"Apache-2.0"
]
| null | null | null | auto-lib/Paws/RDS/DescribeDBLogFilesResponse.pm | agimenez/aws-sdk-perl | 9c4dff7d1af2ff0210c28ca44fb9e92bc625712b | [
"Apache-2.0"
]
| null | null | null |
package Paws::RDS::DescribeDBLogFilesResponse;
use Moose;
has DescribeDBLogFiles => (is => 'ro', isa => 'ArrayRef[Paws::RDS::DescribeDBLogFilesDetails]', xmlname => 'DescribeDBLogFilesDetails', traits => ['Unwrapped',]);
has Marker => (is => 'ro', isa => 'Str');
has _request_id => (is => 'ro', isa => 'Str');
1;
### main pod documentation begin ###
=head1 NAME
Paws::RDS::DescribeDBLogFilesResponse
=head1 ATTRIBUTES
=head2 DescribeDBLogFiles => ArrayRef[L<Paws::RDS::DescribeDBLogFilesDetails>]
The DB log files returned.
=head2 Marker => Str
A pagination token that can be used in a subsequent DescribeDBLogFiles
request.
=head2 _request_id => Str
=cut
| 19.457143 | 164 | 0.700441 |
ed48431987914e3922b1b0adf0bc75d58ecfb3df | 485 | pm | Perl | lib/Dancer/Timer.pm | rsp/Dancer | b50b29c5d983aaa6a1adda8d8f3d741f28b4137c | [
"Artistic-1.0"
]
| 1 | 2019-06-27T08:04:22.000Z | 2019-06-27T08:04:22.000Z | lib/Dancer/Timer.pm | rsp/Dancer | b50b29c5d983aaa6a1adda8d8f3d741f28b4137c | [
"Artistic-1.0"
]
| null | null | null | lib/Dancer/Timer.pm | rsp/Dancer | b50b29c5d983aaa6a1adda8d8f3d741f28b4137c | [
"Artistic-1.0"
]
| null | null | null | package Dancer::Timer;
use strict;
use warnings;
use base 'Dancer::Object';
use Time::HiRes 'gettimeofday', 'tv_interval';
use Dancer::ModuleLoader;
Dancer::Timer->attributes('start_time');
sub init {
my ($self) = @_;
$self->start_time([gettimeofday()]);
}
sub tick {
my ($self) = @_;
my $now = [gettimeofday()];
my $delay = tv_interval($self->start_time, $now);
return sprintf('%0f', $delay);
}
sub to_string {
my ($self) = @_;
$self->tick;
}
1;
| 16.724138 | 53 | 0.614433 |
ed3ec8e9a9cd1bb69f1dd9cc079b7adb061846f8 | 112,261 | pm | Perl | src/fhem/trunk/fhem/FHEM/98_DOIFtools.pm | nastymorbol/fhem-docker | c88d13e6fb098a487486b448806048eab1222b81 | [
"MIT"
]
| null | null | null | src/fhem/trunk/fhem/FHEM/98_DOIFtools.pm | nastymorbol/fhem-docker | c88d13e6fb098a487486b448806048eab1222b81 | [
"MIT"
]
| null | null | null | src/fhem/trunk/fhem/FHEM/98_DOIFtools.pm | nastymorbol/fhem-docker | c88d13e6fb098a487486b448806048eab1222b81 | [
"MIT"
]
| null | null | null | #############################################
# $Id: 98_DOIFtools.pm 19948 2019-08-04 15:53:01Z Ellert $
#
# This file is part of fhem.
#
# Fhem is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# Fhem is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with fhem. If not, see <http://www.gnu.org/licenses/>.
#
###############################################
package main;
use strict;
use warnings;
use Time::Local;
use Color;
use vars qw(%FW_rooms %FW_groups);
sub DOIFtools_Initialize($);
sub DOIFtools_Set($@);
sub DOIFtools_Get($@);
sub DOIFtools_Undef;
sub DOIFtools_Define($$$);
sub DOIFtools_Attr(@);
sub DOIFtools_Notify($$);
sub DOIFtoolsRg;
sub DOIFtoolsNxTimer;
sub DOIFtoolsNextTimer;
sub DOIFtoolsGetAssocDev;
sub DOIFtoolsCheckDOIF;
sub DOIFtoolsCheckDOIFcoll;
sub DOIFtools_fhemwebFn($$$$);
sub DOIFtools_eM($$$$);
sub DOIFtools_dO ($$$$);
sub DOIFtoolsSetNotifyDev;
sub DOIFtools_logWrapper($);
sub DOIFtoolsCounterReset($);
sub DOIFtoolsDeleteStatReadings;
my @DOIFtools_we = (0,0,0,0,0,0,0,0,0);
my $DOIFtoolsJSfuncEM = <<'EOF';
<script type="text/javascript">
//functions
function doiftoolsCopyToClipboard() {
var r = $("head").attr("root");
var myFW_root = FW_root;
if(r)
myFW_root = r;
var lang = $('#doiftoolstype').attr('lang');
var txtarea = document.getElementById("console");
var start = txtarea.selectionStart;
var finish = txtarea.selectionEnd;
var txt = $("textarea#console").text().substring(start, finish);
var hlp = lang ? "Bitte, genau eine komplette Eventzeile markieren." : "Please highlight exactly one complete event line.";
$('#console').attr('disabled', 'disabled');
$('#console').removeAttr('disabled');
if(!txt)
return FW_okDialog(hlp);
var redi=/^....-..-..\s..:..:..(\....)?\s([^\s]+)\s([^\s]+)\s([^\s]+:\s)?(.*)([\n]*)?$/;
var retdi = txt.match(redi);
if(!retdi)
return FW_okDialog("\""+txt+"\" "+(lang ? "ist keine gültige Auswahl." : "is not a valid selection.")+"<br>"+hlp);
var evtDev = retdi[3];
var retdi1;
var evtRead ="";
var evtVal ="";
if (retdi[4]) {
retdi1 = retdi[4].match(/(.*):\s$/);
evtRead = retdi1[1];
}
evtVal = retdi[5];
var treffer = evtVal.match(/(-?\d+(\.\d+)?)/);
var evtNum;
try {
evtNum = treffer[1];
} catch (e) {
evtNum = "";
}
var treffer = evtVal.match(/(\d\d:\d\d)/);
var evtHM;
try {
evtHM = treffer[1];
} catch (e) {
evtHM = "";
}
var treffer = evtVal.match(/^(\d\d:\d\d(:\d\d)?)$/);
var evtHMex;
try {
evtHMex = treffer[1];
} catch (e) {
evtHMex = "";
}
var evtEvt = evtVal.replace(/\s/g, ".")
.replace(/[\^\$\[\]\(\)\\]/g, function(s){return"\\"+s});
var diop = [];
var diophlp = [];
var icnt = 0;
diophlp[icnt] = lang ? "a) einfacher auslösender Zugriff auf ein Reading-Wert eines Gerätes oder auf den Wert des Internal STATE, wenn kein Reading im Ereignis vorkommt" : "a) simple triggering access to device reading or internal STATE";
diop[icnt] = "["+evtDev+(evtRead ? ":"+evtRead : "")+"]"; icnt++;
diophlp[icnt] = lang ? "b) wie a), zusätzlich mit Angabe eines Vergleichsoperators für Zeichenketten (eq ≙ equal) und Vergleichswert" : "b) like a) additionally with string operator (eq ≙ equal) and reference value";
diop[icnt] = "["+evtDev+(evtRead ? ":"+evtRead : "")+"] eq \""+evtVal+"\""; icnt++;
if (evtNum != "") {
diophlp[icnt] = lang ? "c) wie a) aber mit Zugriff nur auf die erste Zahl der Wertes und eines Vergleichsoperators für Zahlen (==) und numerischem Vergleichswert" : "c) like a) but with access to the first number and a relational operator for numbers (==) and a numeric reference value";
diop[icnt] = "["+evtDev+(evtRead ? ":"+evtRead : ":state")+":d] == "+evtNum; icnt++;}
if (evtHM != "") {
diophlp[icnt] = lang ? "d) wie a) aber mit Filter für eine Zeitangabe (hh:mm), einer Zeitvorgabe für nicht existierende Readings/Internals, zusätzlich mit Angabe eines Vergleichsoperators für Zeichenketten (ge ≙ greater equal) und Vergleichswert" : "d) like a) with filter for time (hh:mm), default value for nonexisting readings or Internals and a relational string operator (ge ≙ greater equal) and a reference value";
diop[icnt] = "["+evtDev+(evtRead ? ":"+evtRead : ":state")+":\"(\\d\\d:\\d\\d)\",\"00:00\"] ge $hm"; icnt++;
diophlp[icnt] = lang ? "e1) Zeitpunkt (hh:mm) als Auslöser" : "e1) time specification (hh:mm) as trigger";
diop[icnt] = "["+evtHM+"]"; icnt++;}
if (evtHMex != "") {
diophlp[icnt] = lang ? "e2) indirekte Angabe eines Zeitpunktes als Auslöser" : "e2) indirect time specification as trigger";
diop[icnt] = "[["+evtDev+(evtRead ? ":"+evtRead : "")+"]]"; icnt++;}
diophlp[icnt] = lang ? "f) auslösender Zugriff auf ein Gerät mit Angabe eines \"regulären Ausdrucks\" für ein Reading mit beliebigen Reading-Wert" : "f) triggering access to a device with \"regular expression\" for a reading with arbitrary value";
diop[icnt] = "["+evtDev+(evtRead ? ":\"^"+evtRead+": " : ":\"")+"\"]"; icnt++;
diophlp[icnt] = lang ? "g) Zugriff mit Angabe eines \"regulären Ausdrucks\" für ein Gerät und ein Reading mit beliebigen Reading-Wert" : "g) access by a \"regular expression\" for a device and a reading with arbitrary value";
diop[icnt] = "[\"^"+evtDev+(evtRead ? "$:^"+evtRead+": " : "$: ")+"\"]"; icnt++;
diophlp[icnt] = lang ? "h) Zugriff mit Angabe eines \"regulären Ausdrucks\" für ein Gerät und ein Reading mit exaktem Reding-Wert" : "h) access by a \"regular expression\" for a device and a reading with distinct value";
diop[icnt] = "[\"^"+evtDev+(evtRead ? "$:^"+evtRead+": " : "$:^")+evtEvt+"$\"]"; icnt++;
if (evtHM != "") {
diophlp[icnt] = lang ? "i) Zugriff mit Angabe eines \"regulären Ausdrucks\" für ein Gerät und ein Reading mit Filter für eine Zeitangabe (hh:mm), einer Zeitvorgabe falls ein anderer Operand auslöst" : "i) access by a \"regular expression\" for a device and a reading and a filter for a time value (hh:mm), a default value in case a different operator triggers and a relational string operator (ge ≙ greater equal) and a reference value";
diop[icnt] = "[\"^"+evtDev+(evtRead ? "$:^"+evtRead+"\"" : "$:\"")+":\"(\\d\\d:\\d\\d)\",\"00:00\"] ge $hm"; icnt++}
var maxlength = 33;
for (var i = 0; i < diop.length; i++)
maxlength = diop[i].length > maxlength ? diop[i].length : maxlength;
// build the dialog
var txt = '<style type="text/css">\n'+
'div.opdi label { display:block; margin-left:2em; font-family:Courier}\n'+
'div.opdi input { float:left; }\n'+
'</style>\n';
var inputPrf = "<input type='radio' name=";
txt += (lang ? "Bitte einen Opranden wählen." : "Select an Operand please.") + "<br><br>";
for (var i = 0; i < diop.length; i++) {
txt += "<div class='opdi'>"+inputPrf+"'opType' id='di"+i+"' />"+
"<label title='"+diophlp[i]+"' >"+diop[i]+"</label></div><br>";
}
if ($('#doiftoolstype').attr('devtype') == 'doif') {
txt += "<input class='opdi' id='opditmp' type='text' size='"+(maxlength+10)+"' style='font-family:Courier' title='"+
(lang ? "Der gewählte Operand könnte vor dem Kopieren geändert werden." : "The selected operand may be changed before copying.")+
"' ></input>";
} else if ($('#doiftoolstype').attr('devtype') == 'doiftools') {
txt += "<input newdev='' class='opdi' id='opditmp' type='text' size='"+(maxlength+36)+"' style='font-family:Courier' title='"+
(lang ? "Die Definition kann vor der Weiterverarbeitung angepasst werden." : "The definition may be changed before processing.")+
"' ></input>";
}
$('body').append('<div id="evtCoM" style="display:none">'+txt+'</div>');
if ($('#doiftoolstype').attr('devtype') == 'doif') {
$('#evtCoM').dialog(
{ modal:true, closeOnEscape:true, width:"auto",
close:function(){ $('#evtCoM').remove(); },
buttons:[
{ text:"Cancel", click:function(){ $(this).dialog('close'); }},
{ text:"Open DEF-Editor", title:(lang ? "Kopiert die Eingabezeile in die Zwischenablage und öffnet den DEF-Editor der aktuellen Detailansicht. Mit Strg-v kann der Inhalt der Zwischenablage in die Definition eingefügt werden." : "Copies the input line to clipboard and opens the DEF editor of the current detail view. Paste the content of the clipboard to the editor by using ctrl-v"), click:function(){
$("input#opditmp").select();
document.execCommand("copy");
if ($("#edit").css("display") == "none")
$("#DEFa").click();
$(this).dialog('close');
}}],
open:function(){
$("#evtCoM input[name='opType'],#evtCoM select").change(doiftoolsOptChanged);
}
});
} else if ($('#doiftoolstype').attr('devtype') == 'doiftools') {
$('#evtCoM').dialog(
{ modal:true, closeOnEscape:true, width:"auto",
close:function(){ $('#evtCoM').remove(); },
buttons:[
{ text:"Cancel", click:function(){ $(this).dialog('close'); }},
{ text:"Execute Definition", title:(lang ? "Führt den define-Befehl aus und öffnet die Detailansicht des erzeugten Gerätes." : "Executes the define command and opens the detail view of the created device."), click:function(){
FW_cmd(myFW_root+"?cmd="+$("input#opditmp").val()+"&XHR=1");
$("input[class='maininput'][name='cmd']").val($("input#opditmp").val());
var newDev = $("input#opditmp").val();
$(this).dialog('close');
var rex = newDev.match(/define\s+(.*)\s+DOIF/);
try {
location = myFW_root+'?detail='+rex[1];
} catch (e) {
}
}}],
open:function(){
$("#evtCoM input[name='opType'],#evtCoM select").change(doiftoolsOptChanged);
}
});
}
}
function doiftoolsOptChanged() {
if ($('#doiftoolstype').attr('devtype') == 'doif') {
$("input#opditmp").val($("#evtCoM input:checked").next("label").text());
} else if ($('#doiftoolstype').attr('devtype') == 'doiftools') {
var N = 8;
var newDev = Array(N+1).join((Math.random().toString(36)+'00000000000000000').slice(2, 18)).slice(0, N);
$("input#opditmp").val('define newDevice_'+newDev+' DOIF ('+$("#evtCoM input:checked").next("label").text()+') ()');
var inpt = document.getElementById("opditmp");
inpt.focus();
inpt.setSelectionRange(7,17+N);
}
}
function delbutton() {
if ($('#doiftoolstype').attr('embefore') == 1) {
var ins = document.getElementsByClassName('makeTable wide readings');
var del = document.getElementById('doiftoolscons');
if (del) {
ins[0].parentNode.insertBefore(del,ins[0]);
}
}
var del = document.getElementById('addRegexpPart');
if (del) {
$( window ).off( "load", delbutton );
del.parentNode.removeChild(del);
}
}
//execute
$( window ).on( "load", delbutton );
$('#console').on('select', doiftoolsCopyToClipboard);
</script>
EOF
my $DOIFtoolsJSfuncStart = <<'EOF';
<script type="text/javascript">
//functions
function doiftoolsRemoveLookUp () {
$('#addLookUp').dialog( "close" );
}
function doiftoolsAddLookUp () {
var tn = $(this).text();
var target = this;
var txt = "Internals<table class='block wide internals' style='font-size:12px'>";
FW_cmd(FW_root+"?cmd=jsonlist2 "+tn+"&XHR=1", function(data){
var devList = JSON.parse(data);
var dev = devList.Results[0];
var row = 0;
for (var item in dev.Internals) {
if (item == "DEF") {dev.Internals[item] = "<pre>"+dev.Internals[item]+"</pre>"}
var cla = ((row++&1)?"odd":"even");
txt += "<tr class='"+cla+"'><td>"+item+"</td><td>"+dev.Internals[item].replace(/\n/g,"<br>")+"</td></tr>\n";
}
txt += "</table>Readings<table class='block wide readings' style='font-size:12px'><br>";
row = 0;
for (var item in dev.Readings) {
var cla = ((row++&1)?"odd":"even");
txt += "<tr class='"+cla+"'><td>"+item+"</td><td>"+dev.Readings[item].Value+"</td><td>"+dev.Readings[item].Time+"</td></tr>\n";
}
txt += "</table>Attributes<table class='block wide attributes' style='font-size:12px'><br>";
row = 0;
for (var item in dev.Attributes) {
if (item.match(/(userReadings|wait|setList|uiTable)/) ) {dev.Attributes[item] = "<pre>"+dev.Attributes[item]+"</pre>"}
var cla = ((row++&1)?"odd":"even");
txt += "<tr class='"+cla+"'><td>"+item+"</td><td>"+dev.Attributes[item]+"</td></tr>\n";
}
txt += "</table>";
$('#addLookUp').html(txt);
$('#addLookUp').dialog("open");
});
}
$(document).ready(function(){
$('body').append('<div id="addLookUp" style="display:none"></div>');
$('#addLookUp').dialog({
width:"60%",
height:"auto",
maxHeight:900,
modal: false,
position: { at: "right"},
collusion: "fit fit",
buttons: [
{
text: "Ok",
style:"margin-right: 100%",
click: function() {
$( this ).dialog( "close" );
}
}
]
});
$('#addLookUp').dialog( "close" );
$(".assoc").find("a:even").each(function() {
$(this).on("mouseover",doiftoolsAddLookUp);
});
$("table[class*='block wide']").each(function() {
$(this).on("mouseenter",doiftoolsRemoveLookUp);
});
});
</script>
EOF
#########################
sub DOIFtools_Initialize($)
{
my ($hash) = @_;
$hash->{DefFn} = "DOIFtools_Define";
$hash->{SetFn} = "DOIFtools_Set";
$hash->{GetFn} = "DOIFtools_Get";
$hash->{UndefFn} = "DOIFtools_Undef";
$hash->{AttrFn} = "DOIFtools_Attr";
$hash->{NotifyFn} = "DOIFtools_Notify";
$hash->{FW_detailFn} = "DOIFtools_fhemwebFn";
$data{FWEXT}{"/DOIFtools_logWrapper"}{CONTENTFUNC} = "DOIFtools_logWrapper";
my $oldAttr = "target_room:noArg target_group:noArg executeDefinition:noArg executeSave:noArg eventMonitorInDOIF:noArg readingsPrefix:noArg";
$hash->{AttrList} = "DOIFtoolsExecuteDefinition:1,0 DOIFtoolsTargetRoom DOIFtoolsTargetGroup DOIFtoolsExecuteSave:1,0 DOIFtoolsReadingsPrefix DOIFtoolsEventMonitorInDOIF:1,0 DOIFtoolsHideModulShortcuts:1,0 DOIFtoolsHideGetSet:1,0 DOIFtoolsMyShortcuts:textField-long DOIFtoolsMenuEntry:1,0 DOIFtoolsHideStatReadings:1,0 DOIFtoolsEventOnDeleted:1,0 DOIFtoolsEMbeforeReadings:1,0 DOIFtoolsNoLookUp:1,0 DOIFtoolsNoLookUpInDOIF:1,0 DOIFtoolsLogDir disabledForIntervals ".$oldAttr; #DOIFtoolsForceGet:true
}
sub DOIFtools_dO ($$$$){
return "";}
# FW_detailFn for DOIF injecting event monitor
sub DOIFtools_eM($$$$) {
my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn.
my @dtn = devspec2array("TYPE=DOIFtools");
my $lang = AttrVal("global","language","EN");
my $ret = "";
# call DOIF_detailFn
no strict "refs";
my $retfn = &{ReadingsVal($dtn[0],".DOIF_detailFn","")}($FW_wname, $d, $room, $pageHash) if (ReadingsVal($dtn[0],".DOIF_detailFn",""));
$ret .= $retfn if ($retfn);
use strict "refs";
if (!$room) {
# LookUp in probably associated with
$ret .= $DOIFtoolsJSfuncStart if (!AttrVal($dtn[0],"DOIFtoolsNoLookUpInDOIF",""));
# Event Monitor
if (AttrVal($dtn[0],"DOIFtoolsEventMonitorInDOIF","")) {
my $a0 = ReadingsVal($d,".eM", "off") eq "on" ? "off" : "on";
$ret .= "<br>" if (ReadingsVal($dtn[0],".DOIF_detailFn",""));
$ret .= "<table class=\"block\"><tr><td><div class=\"dval\"><span title=\"".($lang eq "DE" ? "toggle schaltet den Event-Monitor ein/aus" : "toggle switches event monitor on/off")."\">Event monitor: <a href=\"$FW_ME?detail=$d&cmd.$d=setreading $d .eM $a0$FW_CSRF\">toggle</a> </span>";
$ret .= "</div></td>";
$ret .= "</tr></table>";
my $a = "";
if (ReadingsVal($d,".eM","off") eq "on") {
$ret .= "<script type=\"text/javascript\" src=\"$FW_ME/pgm2/console.js\"></script>";
my $filter = $a ? ($a eq "log" ? "global" : $a) : ".*";
$ret .= "<div id='doiftoolscons'>";
my $embefore = AttrVal($dtn[0],"DOIFtoolsEMbeforeReadings","0") ? "1" : "";
$ret .= "<div id='doiftoolstype' devtype='doif' embefore='".$embefore."' lang='".($lang eq "DE" ? 1 : 0)."'><br>";
$ret .= "Events (Filter: <a href=\"#\" id=\"eventFilter\">$filter</a>) ".
" <span id=\"doiftoolsdel\" class='fhemlog'>FHEM log ".
"<input id='eventWithLog' type='checkbox'".
($a && $a eq "log" ? " checked":"")."></span>".
" <button id='eventReset'>Reset</button>".($lang eq "DE" ? " <b>Hinweis:</b> Eventzeile markieren, Operanden auswählen, Definition ergänzen" : " <b>Hint:</b> select event line, choose operand, modify definition")."</div>\n";
$ret .= "<textarea id=\"console\" style=\"width:99%; top:.1em; bottom:1em; position:relative;\" readonly=\"readonly\" rows=\"25\" cols=\"60\" title=\"".($lang eq "DE" ? "Die Auswahl einer Event-Zeile zeigt Operanden für DOIF an, sie können im DEF-Editor eingefügt werden (Strg V)." : "Selecting an event line displays operands for DOIFs definition, they can be inserted to DEF-Editor (Ctrl V).")."\" ></textarea>";
$ret .= "</div>";
$ret .= $DOIFtoolsJSfuncEM;
}
}
}
return $ret ? $ret : undef;
}
######################
# Show the content of the log (plain text), or an image and offer a link
# to convert it to an SVG instance
# If text and no reverse required, try to return the data as a stream;
sub DOIFtools_logWrapper($) {
my ($cmd) = @_;
my $d = $FW_webArgs{dev};
my $type = $FW_webArgs{type};
my $file = $FW_webArgs{file};
my $ret = "";
if(!$d || !$type || !$file) {
FW_pO '<div id="content">DOIFtools_logWrapper: bad arguments</div>';
return 0;
}
if(defined($type) && $type eq "text") {
$defs{$d}{logfile} =~ m,^(.*)/([^/]*)$,; # Dir and File
my $path = "$1/$file";
$path =~ s/%L/$attr{global}{logdir}/g
if($path =~ m/%/ && $attr{global}{logdir});
$path = AttrVal($d,"archivedir","") . "/$file" if(!-f $path);
FW_pO "<div id=\"content\">";
FW_pO "<div class=\"tiny\">" if($FW_ss);
FW_pO "<pre class=\"log\"><b>jump to: <a name='top'></a><a href=\"#end_of_file\">the end</a> <a href=\"#listing\">top listing</a></b><br>";
my $suffix = "<br/><b>jump to: <a name='end_of_file'></a><a href='#top'>the top</a> <a href=\"#listing\">top listing</a></b><br/></pre>".($FW_ss ? "</div>" : "")."</div>";
my $reverseLogs = AttrVal($FW_wname, "reverseLogs", 0);
if(!$reverseLogs) {
$suffix .= "</body></html>";
return FW_returnFileAsStream($path, $suffix, "text/html", 0, 0);
}
if(!open(FH, $path)) {
FW_pO "<div id=\"content\">$path: $!</div></body></html>";
return 0;
}
my $cnt = join("", reverse <FH>);
close(FH);
# $cnt = FW_htmlEscape($cnt);
FW_pO $cnt;
FW_pO $suffix;
return 1;
}
return 0;
}
sub DOIFtools_fhemwebFn($$$$) {
my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn.
my $ret = "";
# $ret .= "<script type=\"text/javascript\" src=\"$FW_ME/pgm2/myfunction.js\"></script>";
$ret .= $DOIFtoolsJSfuncStart if ($DOIFtoolsJSfuncStart && !AttrVal($d,"DOIFtoolsNoLookUp",""));
# Logfile Liste
if($FW_ss && $pageHash) {
$ret.= "<div id=\"$d\" align=\"center\" class=\"FileLog col2\">".
"$defs{$d}{STATE}</div>";
} else {
my $row = 0;
$ret .= sprintf("<table class=\"FileLog %swide\">",
$pageHash ? "" : "block ");
foreach my $f (FW_fileList($defs{$d}{logfile})) {
my $class = (!$pageHash ? (($row++&1)?"odd":"even") : "");
$ret .= "<tr class=\"$class\">";
$ret .= "<td><div class=\"dname\">$f</div></td>";
my $idx = 0;
foreach my $ln (split(",", AttrVal($d, "logtype", "text"))) {
if($FW_ss && $idx++) {
$ret .= "</tr><tr class=\"".(($row++&1)?"odd":"even")."\"><td>";
}
my ($lt, $name) = split(":", $ln);
$name = $lt if(!$name);
$ret .= FW_pH("$FW_ME/DOIFtools_logWrapper&dev=$d&type=$lt&file=$f",
"<div class=\"dval\">$name</div>", 1, "dval", 1);
}
}
$ret .= "</table>";
}
# Event Monitor
my $a0 = ReadingsVal($d,".eM", "off") eq "on" ? "off" : "on";
$ret .= "<div class=\"dval\"><table class='block wide'>";
$ret .= "<tr><td><span title=\"toggle to switch event monitor on/off\">Event monitor: <a href=\"$FW_ME?detail=$d&cmd.$d=setreading $d .eM $a0$FW_CSRF\">toggle</a> </span>";
# Shortcuts
if (!AttrVal($d,"DOIFtoolsHideModulShortcuts",0)) {
$ret .= "Shortcuts: ";
$ret .= "<a href=\"$FW_ME?detail=$d&cmd.$d=reload 98_DOIFtools.pm$FW_CSRF\">reload DOIFtools</a> " if(ReadingsVal($d,".debug",""));
$ret .= "<a href=\"$FW_ME?detail=$d&cmd.$d=update check$FW_CSRF\">update check</a> ";
$ret .= "<a href=\"$FW_ME?detail=$d&cmd.$d=update$FW_CSRF\">update</a> ";
$ret .= "<a href=\"$FW_ME?detail=$d&cmd.$d=shutdown restart$FW_CSRF\">shutdown restart</a> ";
$ret .= "<a href=\"$FW_ME?detail=$d&cmd.$d=fheminfo send$FW_CSRF\">fheminfo send</a> ";
}
$ret .= "</td></tr>";
if (AttrVal($d,"DOIFtoolsMyShortcuts","")) {
$ret .= "<tr><td>";
my @sc = split(",",AttrVal($d,"DOIFtoolsMyShortcuts",""));
for (my $i = 0; $i < @sc; $i+=2) {
if ($sc[$i] =~ m/^\#\#(.*)/) {
$ret .= "$1 ";
} else {
$ret .= "<a href=\"/$sc[$i+1]$FW_CSRF\">$sc[$i]</a> " if($sc[$i] and $sc[$i+1]);
}
}
$ret .= "</td></tr>";
}
$ret .= "</table>";
if (!AttrVal($d, "DOIFtoolsHideGetSet", 0)) {
my $a1 = ReadingsVal($d,"doStatistics", "disabled") =~ "disabled|deleted" ? "enabled" : "disabled";
my $a2 = ReadingsVal($d,"specialLog", 0) ? 0 : 1;
$ret .= "<table ><tr>";
# set doStatistics enabled/disabled
$ret .= "<td><form method=\"post\" action=\"$FW_ME\" autocomplete=\"off\">
<input name=\"detail\" value=\"$d\" type=\"hidden\">";
$ret .= FW_hidden("fwcsrf", $defs{$FW_wname}{CSRFTOKEN}) if($FW_CSRF);
$ret .= "<input name=\"dev.set$d\" value=\"$d\" type=\"hidden\">
<input name=\"cmd.set$d\" value=\"set\" class=\"set\" type=\"submit\">
<div class=\"set downText\"> doStatistics $a1 </div>
<div style=\"display:none\" class=\"noArg_widget\" informid=\"$d-doStatistics\">
<input name=\"val.set$d\" value=\"doStatistics $a1\" type=\"hidden\">
</div></form></td>";
# set doStatistics deleted
$ret .= "<td><form method=\"post\" action=\"$FW_ME\" autocomplete=\"off\">
<input name=\"detail\" value=\"$d\" type=\"hidden\">";
$ret .= FW_hidden("fwcsrf", $defs{$FW_wname}{CSRFTOKEN}) if($FW_CSRF);
$ret .= "<input name=\"dev.set$d\" value=\"$d\" type=\"hidden\">
<input name=\"cmd.set$d\" value=\"set\" class=\"set\" type=\"submit\">
<div class=\"set downText\"> doStatistics deleted </div>
<div style=\"display:none\" class=\"noArg_widget\" informid=\"$d-doStatistics\">
<input name=\"val.set$d\" value=\"doStatistics deleted\" type=\"hidden\">
</div></form></td>";
# set specialLog 0/1
$ret .= "<td><form method=\"post\" action=\"$FW_ME\" autocomplete=\"off\">
<input name=\"detail\" value=\"$d\" type=\"hidden\">";
$ret .= FW_hidden("fwcsrf", $defs{$FW_wname}{CSRFTOKEN}) if($FW_CSRF);
$ret .= "<input name=\"dev.set$d\" value=\"$d\" type=\"hidden\">
<input name=\"cmd.set$d\" value=\"set\" class=\"set\" type=\"submit\">
<div class=\"set downText\"> specialLog $a2 </div>
<div style=\"display:none\" class=\"noArg_widget\" informid=\"$d-doStatistics\">
<input name=\"val.set$d\" value=\"specialLog $a2\" type=\"hidden\">
</div></form></td>";
$ret .= "</tr><tr>";
# get statisticsReport
$ret .= "<td><form method=\"post\" action=\"$FW_ME\" autocomplete=\"off\">
<input name=\"detail\" value=\"$d\" type=\"hidden\">
<input name=\"dev.get$d\" value=\"$d\" type=\"hidden\">
<input name=\"cmd.get$d\" value=\"get\" class=\"get\" type=\"submit\">
<div class=\"get downText\"> statisticsReport </div>
<div style=\"display:none\" class=\"noArg_widget\" informid=\"$d-statisticsReport\">
<input name=\"val.get$d\" value=\"statisticsReport\" type=\"hidden\">
</div></form></td>";
# get checkDOIF
$ret .= "<td><form method=\"post\" action=\"$FW_ME\" autocomplete=\"off\">
<input name=\"detail\" value=\"$d\" type=\"hidden\">
<input name=\"dev.get$d\" value=\"$d\" type=\"hidden\">
<input name=\"cmd.get$d\" value=\"get\" class=\"get\" type=\"submit\">
<div class=\"get downText\"> checkDOIF </div>
<div style=\"display:none\" class=\"noArg_widget\" informid=\"$d-checkDOIF\">
<input name=\"val.get$d\" value=\"checkDOIF\" type=\"hidden\">
</div></form></td>";
# get runningTimerInDOIF
$ret .= "<td><form method=\"post\" action=\"$FW_ME\" autocomplete=\"off\">
<input name=\"detail\" value=\"$d\" type=\"hidden\">
<input name=\"dev.get$d\" value=\"$d\" type=\"hidden\">
<input name=\"cmd.get$d\" value=\"get\" class=\"get\" type=\"submit\">
<div class=\"get downText\"> runningTimerInDOIF </div>
<div style=\"display:none\" class=\"noArg_widget\" informid=\"$d-runningTimerInDOIF\">
<input name=\"val.get$d\" value=\"runningTimerInDOIF\" type=\"hidden\">
</div></form></td>";
$ret .= "</tr></table>";
}
$ret .= "</div>";
my $a = "";
if (ReadingsVal($d,".eM","off") eq "on") {
my $lang = AttrVal("global","language","EN");
$ret .= "<script type=\"text/javascript\" src=\"$FW_ME/pgm2/console.js\"></script>";
# $ret .= "<script type=\"text/javascript\" src=\"$FW_ME/pgm2/doiftools.js\"></script>";
my $filter = $a ? ($a eq "log" ? "global" : $a) : ".*";
$ret .= "<div><table><tr><td>";
$ret .= "Events (Filter: <a href=\"#\" id=\"eventFilter\">$filter</a>) ".
" <span id=\"doiftoolsdel\" class='fhemlog'>FHEM log ".
"<input id='eventWithLog' type='checkbox'".
($a && $a eq "log" ? " checked":"")."></span>".
" <button id='eventReset'>Reset</button>".($lang eq "DE" ? " <b>Hinweis:</b> Eventzeile markieren, Operanden auswählen, neue Definition erzeugen" : " <b>Hint:</b> select event line, choose operand, create definition")."</td></tr></table></div>\n";
my $embefore = AttrVal($d,"DOIFtoolsEMbeforeReadings","0") ? "1" : "";
$ret .= "<div id='doiftoolstype' devtype='doiftools' embefore='".$embefore."' lang='".($lang eq "DE" ? 1 : 0)."'>";
$ret .= "<textarea id=\"console\" style=\"width:99%; top:.1em; bottom:1em; position:relative;\" readonly=\"readonly\" rows=\"25\" cols=\"60\" title=\"".($lang eq "DE" ? "Die Auswahl einer Event-Zeile zeigt Operanden für DOIF an, mit ihnen kann eine neue DOIF-Definition erzeugt werden." : "Selecting an event line displays operands for DOIFs definition, they are used to create a new DOIF definition.")."\"></textarea>";
$ret .= "</div>";
$ret .= $DOIFtoolsJSfuncEM;
}
return $ret;
}
sub DOIFtools_Notify($$) {
my ($hash, $source) = @_;
my $pn = $hash->{NAME};
my $sn = $source->{NAME};
my $events = deviceEvents($source,1);
return if( !$events );
# \@DOIFtools_we aktualisieren
if ((",".AttrVal("global","holiday2we","").",") =~ /\,$sn\,/) {
@DOIFtools_we = (0,0,0,0,0,0,0,0,0);
foreach my $item (split(",",AttrVal("global","holiday2we",""))) {
my $val;
my $a;
my $b;
for (my $i = 0; $i < 9; $i++) {
$val = CommandGet(undef,"$item days $i");
if($val) {
($a, $b) = ReplaceEventMap($item, [$item, $val], 0);
$DOIFtools_we[$i] = 1 if($b ne "none");
}
}
}
}
my $ldi = ReadingsVal($pn,"specialLog","") ? ReadingsVal($pn,"doif_to_log","") : "";
foreach my $event (@{$events}) {
$event = "" if(!defined($event));
# add list to DOIFtoolsLog
if ($ldi and $ldi =~ "$sn" and $event =~ m/(^cmd: \d+(\.\d+)?|^wait_timer: \d\d.*)/) {
$hash->{helper}{counter}{0}++;
my $trig = "<a name=\"list$hash->{helper}{counter}{0}\"><a name=\"listing\">";
$trig .= "</a><strong>\[$hash->{helper}{counter}{0}\] +++++ Listing $sn:$1 +++++</strong>\n";
my $prev = $hash->{helper}{counter}{0} - 1;
my $next = $hash->{helper}{counter}{0} + 1;
$trig .= $prev ? "<b>jump to: <a href=\"#list$prev\">prev</a> <a href=\"#list$next\">next</a> Listing</b><br>" : "<b>jump to: prev <a href=\"#list$next\">next</a> Listing</b><br>";
$trig .= "DOIF-Version: ".ReadingsVal($pn,"DOIF_version","n/a")."<br>";
my $trigtmp = CommandList(undef,$sn);
$trigtmp =~ s/\n|\r/<br>/g;
$trig .= $trigtmp;
foreach my $itm (keys %defs) {
$trig =~ s,([\[\" ])$itm([\"\:\] ]),$1<a href="$FW_ME?detail=$itm">$itm</a>$2,g;
}
CommandTrigger(undef,"$hash->{TYPE}Log $trig");
}
# DOIFtools DEF addition
if ($sn eq "global" and $event =~ "^INITIALIZED\$|^MODIFIED|^DEFINED|^DELETED|^RENAMED|^UNDEFINED") {
my @doifList = devspec2array("TYPE=DOIF");
$hash->{DEF} = "associated DOIF: ".join(" ",sort @doifList);
readingsSingleUpdate($hash,"DOIF_version",fhem("version 98_DOIF.pm noheader",1),0);
}
# get DOIF version, FHEM revision and default values
if ($sn eq "global" and $event =~ "^INITIALIZED\$|^MODIFIED $pn") {
readingsBeginUpdate($hash);
readingsBulkUpdate($hash,"DOIF_version",fhem("version 98_DOIF.pm noheader",1));
readingsBulkUpdate($hash,"FHEM_revision",fhem("version revision noheader",1));
readingsBulkUpdate($hash,"sourceAttribute","readingList") unless ReadingsVal($pn,"sourceAttribute","");
readingsBulkUpdate($hash,"recording_target_duration",0) unless ReadingsVal($pn,"recording_target_duration","0");
readingsBulkUpdate($hash,"doStatistics","disabled") unless ReadingsVal($pn,"doStatistics","");
readingsBulkUpdate($hash,".eM", ReadingsVal($pn,".eM","off"));
readingsBulkUpdate($hash,"statisticsDeviceFilterRegex", ".*") unless ReadingsVal($pn,"statisticsDeviceFilterRegex","");
readingsEndUpdate($hash,0);
$defs{$pn}{VERSION} = fhem("version 98_DOIFtools.pm noheader",1);
DOIFtoolsSetNotifyDev($hash,1,1);
#set new attributes and delete old ones
CommandAttr(undef,"$pn DOIFtoolsExecuteDefinition ".AttrVal($pn,"executeDefinition","")) if (AttrVal($pn,"executeDefinition",""));
CommandDeleteAttr(undef,"$pn executeDefinition") if (AttrVal($pn,"executeDefinition",""));
CommandAttr(undef,"$pn DOIFtoolsExecuteSave ".AttrVal($pn,"executeSave","")) if (AttrVal($pn,"executeSave",""));
CommandDeleteAttr(undef,"$pn executeSave") if (AttrVal($pn,"executeSave",""));
CommandAttr(undef,"$pn DOIFtoolsTargetRoom ".AttrVal($pn,"target_room","")) if (AttrVal($pn,"target_room",""));
CommandDeleteAttr(undef,"$pn target_room") if (AttrVal($pn,"target_room",""));
CommandAttr(undef,"$pn DOIFtoolsTargetGroup ".AttrVal($pn,"target_group","")) if (AttrVal($pn,"target_group",""));
CommandDeleteAttr(undef,"$pn target_group") if (AttrVal($pn,"target_group",""));
CommandAttr(undef,"$pn DOIFtoolsReadingsPrefix ".AttrVal($pn,"readingsPrefix","")) if (AttrVal($pn,"readingsPrefix",""));
CommandDeleteAttr(undef,"$pn readingsPrefix") if (AttrVal($pn,"readingsPrefix",""));
CommandAttr(undef,"$pn DOIFtoolsEventMonitorInDOIF ".AttrVal($pn,"eventMonitorInDOIF","")) if (AttrVal($pn,"eventMonitorInDOIF",""));
CommandDeleteAttr(undef,"$pn eventMonitorInDOIF") if (AttrVal($pn,"eventMonitorInDOIF",""));
# CommandSave(undef,undef);
}
# Event monitor in DOIF FW_detailFn
if ($modules{DOIF}{LOADED} and (!$modules{DOIF}->{FW_detailFn} or $modules{DOIF}->{FW_detailFn} and $modules{DOIF}->{FW_detailFn} ne "DOIFtools_eM") and $sn eq "global" and $event =~ "^INITIALIZED\$" ) {
readingsBeginUpdate($hash);
readingsBulkUpdate($hash,".DOIF_detailFn",$modules{DOIF}->{FW_detailFn});
$modules{DOIF}->{FW_detailFn} = "DOIFtools_eM";
readingsBulkUpdate($hash,".DOIFdO",$modules{DOIF}->{FW_deviceOverview});
$modules{DOIF}->{FW_deviceOverview} = 1;
readingsEndUpdate($hash,0);
}
# Statistics event recording
if (ReadingsVal($pn,"doStatistics","disabled") eq "enabled" and !IsDisabled($pn) and $sn ne "global" and (ReadingsVal($pn,"statisticHours",0) <= ReadingsVal($pn,"recording_target_duration",0) or !ReadingsVal($pn,"recording_target_duration",0))) {
my $st = AttrVal($pn,"DOIFtoolsHideStatReadings","") ? ".stat_" : "stat_";
readingsSingleUpdate($hash,"$st$sn",ReadingsVal($pn,"$st$sn",0)+1,0);
}
}
#statistics time counter updating
if (ReadingsVal($pn,"doStatistics","disabled") eq "enabled" and !IsDisabled($pn) and $sn ne "global") {
if (!ReadingsVal($pn,"recording_target_duration",0) or ReadingsVal($pn,"statisticHours",0) <= ReadingsVal($pn,"recording_target_duration",0)) {
my $t = gettimeofday();
my $te = ReadingsVal($pn,".te",gettimeofday()) + $t - ReadingsVal($pn,".t0",gettimeofday());
my $tH = int($te*100/3600 +.5)/100;
readingsBeginUpdate($hash);
readingsBulkUpdate($hash,".te",$te);
readingsBulkUpdate($hash,".t0",$t);
readingsBulkUpdate($hash,"statisticHours",sprintf("%.2f",$tH));
readingsEndUpdate($hash,0);
} else {
DOIFtoolsSetNotifyDev($hash,1,0);
readingsBeginUpdate($hash);
readingsBulkUpdate($hash,"Action","event recording target duration reached");
readingsBulkUpdate($hash,"doStatistics","disabled");
readingsEndUpdate($hash,0);
}
}
return undef;
}
# DOIFtoolsLinColorGrad(start_color,end_color,percent|[$min,max,current])
# start_color, end_color: 6 hexadecimal values as string with or without leading #
# percent: from 0 to 1
# min: minmal value
# max: maximal value
# current: current value
# return: 6 hexadecimal value as string, prefix depends on input
sub DOIFtoolsLinColorGrad {
my ($sc,$ec,$pct,$max,$cur) = @_;
$pct = ($cur-$pct)/($max-$pct) if (@_ == 5);
my $prefix = "";
$prefix = "#" if ("$sc $ec"=~"#");
$sc =~ s/^#//;
$ec =~ s/^#//;
$pct = $pct > 1 ? 1 : $pct;
$pct = $pct < 0 ? 0 : $pct;
$sc =~/([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})/;
my @sc = (hex($1),hex($2),hex($3));
$ec =~/([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})/;
my @ec = (hex($1),hex($2),hex($3));
my @rgb;
for (0..2) {
$rgb[$_] = sprintf("%02X", int(($ec[$_] - $sc[$_])*$pct + $sc[$_] + .5));
}
return $prefix.join("",@rgb);
}
sub DOIFtoolsHsvColorGrad {
my ($cur,$min,$max,$min_s,$max_s,$s,$v)=@_;
my $m=($max_s-$min_s)/($max-$min);
my $n=$min_s-$min*$m;
if ($cur>$max) {
$cur=$max;
} elsif ($cur<$min) {
$cur=$min;
}
my $h=$cur*$m+$n;
$h /=360;
$s /=100;
$v /=100;
my($r,$g,$b)=Color::hsv2rgb ($h,$s,$v);
$r *= 255;
$g *= 255;
$b *= 255;
return sprintf("#%02X%02X%02X", $r+0.5, $g+0.5, $b+0.5);
}
sub DOIFtoolsRg
{
my ($hash,$arg) = @_;
my $pn = $hash->{NAME};
my $pnRg= "rg_$arg";
my $ret = "";
my @ret;
my $defRg = "";
my @defRg;
my $cL = "";
my @rL = split(/ /,AttrVal($arg,"readingList",""));
for (my $i=0; $i<@rL; $i++) {
$defRg .= ",<$rL[$i]>,$rL[$i]";
$cL .= "\"$rL[$i]\"=>\"$rL[$i]:\",";
}
push @defRg, "$pnRg readingsGroup $arg:+STATE$defRg";
my $rooms = AttrVal($pn,"DOIFtoolsTargetRoom","") ? AttrVal($pn,"DOIFtoolsTargetRoom","") : AttrVal($arg,"room","");
push @defRg, "$pnRg room $rooms" if($rooms);
my $groups = AttrVal($pn,"DOIFtoolsTargetGroup","") ? AttrVal($pn,"DOIFtoolsTargetGroup","") : AttrVal($arg,"group","");
push @defRg, "$pnRg group $groups" if($groups);
push @defRg, "$pnRg commands {$cL}" if ($cL);
push @defRg, "$pnRg noheading 1";
$defRg = "defmod $defRg[0]\rattr ".join("\rattr ",@defRg[1..@defRg-1]);
if (AttrVal($pn,"DOIFtoolsExecuteDefinition","")) {
$ret = CommandDefMod(undef,$defRg[0]);
push @ret, $ret if ($ret);
for (my $i = 1; $i < @defRg; $i++) {
$ret = CommandAttr(undef,$defRg[$i]);
push @ret, $ret if ($ret);
}
if (@ret) {
$ret = join("\n", @ret);
return $ret;
} else {
$ret = "Created device <b>$pnRg</b>.\n";
$ret .= CommandSave(undef,undef) if (AttrVal($pn,"DOIFtoolsExecuteSave",""));
return $ret;
}
} else {
$defRg =~ s/</</g;
$defRg =~ s/>/>/g;
return $defRg;
}
}
# calculate real date in userReadings
sub DOIFtoolsNextTimer {
my ($timer_str,$tn) = @_;
$timer_str =~ /(\d\d).(\d\d).(\d\d\d\d) (\d\d):(\d\d):(\d\d)\|?(.*)/;
my $tstr = "$1.$2.$3 $4:$5:$6";
return $tstr if (!$7 && length($7) == 0);
my $timer = timelocal($6,$5,$4,$1,$2-1,$3);
my $weekd = $7;
if ($weekd =~ s/\[(.*):(.*)\]//) {
$weekd .= ReadingsVal($1,length($2)>0?$2:"state","") if($1);
}
my $tdays = "";
$tdays = $tn ? DOIF_weekdays($defs{$tn},$weekd) : $weekd;
$tdays =~/([0-9])/;
return $tstr if (length($1) == 0);
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($timer);
my $ilook = 0;
my $we;
my $twe;
for (my $iday = $wday; $iday < 7; $iday++) {
$we = (($iday==0 || $iday==6) ? 1 : 0);
if(!$we) {
$we = $DOIFtools_we[$ilook + 1];
}
$twe = (($iday==5 || $iday==6) ? 1 : 0);
if(!$twe) {
$twe = $DOIFtools_we[$ilook + 2];
}
if ($tdays =~ /$iday/ or ($tdays =~ /7/ and $we) or ($tdays =~ /8/ and !$we) or ($tdays =~ /9/ and $twe)) {
return strftime("%d.%m.%Y %H:%M:%S",localtime($timer + $ilook * 86400));
}
$ilook++;
}
for (my $iday = 0; $iday < $wday; $iday++) {
$we = (($iday==0 || $iday==6) ? 1 : 0);
if(!$we) {
$we = $DOIFtools_we[$ilook + 1];
}
$twe = (($iday==5 || $iday==6) ? 1 : 0);
if(!$twe) {
$twe = $DOIFtools_we[$ilook + 2];
}
if ($tdays =~ /$iday/ or ($tdays =~ /7/ and $we) or ($tdays =~ /8/ and !$we) or ($tdays =~ /9/ and $twe)) {
return strftime("%d.%m.%Y %H:%M:%S",localtime($timer + $ilook * 86400));
}
$ilook++;
}
return "no timer next 7 days";
}
sub DOIFtoolsNxTimer {
my ($hash,$arg) = @_;
my $pn = $hash->{NAME};
my $tn= $arg;
my $thash = $defs{$arg};
my $ret = "";
my @ret;
foreach my $key (keys %{$thash->{READINGS}}) {
if ($key =~ m/^timer_\d\d_c\d\d/ && $thash->{READINGS}{$key}{VAL} =~ m/\d\d.\d\d.\d\d\d\d \d\d:\d\d:\d\d\|.*/) {
$ret = AttrVal($pn,"DOIFtoolsReadingsPrefix","N_")."$key:$key.* \{DOIFtoolsNextTimer(ReadingsVal(\"$tn\",\"$key\",\"none\"),\"$tn\")\}";
push @ret, $ret if ($ret);
}
}
if (@ret) {
$ret = join(",", @ret);
if (!AttrVal($tn,"userReadings","")) {
CommandAttr(undef,"$tn userReadings $ret");
$ret = "Created userReadings for <b>$tn</b>.\n";
$ret .= CommandSave(undef,undef) if (AttrVal($pn,"DOIFtoolsExecuteSave",""));
return $ret;
} else {
$ret = "A userReadings attribute already exists, adding is not implemented, try it manually.\r\r $ret\r";
return $ret;
}
}
return join("\n", @ret);
}
sub DOIFtoolsGetAssocDev {
my ($hash,$arg) = @_;
my $pn = $hash->{NAME};
my $tn= $arg;
my $thash = $defs{$arg};
my $ret = "";
my @ret = ();
push @ret ,$arg;
$ret .= $thash->{devices}{all} if ($thash->{devices}{all});
$ret =~ s/^\s|\s$//;
push @ret, split(/ /,$ret);
push @ret, getPawList($tn);
return @ret;
}
sub DOIFtoolsCheckDOIFcoll {
my ($hash,$tn) = @_;
my $ret = "";
my $tail = $defs{$tn}{DEF};
if (!$tail) {
$tail="";
} else {
$tail =~ s/(##.*\n)|(##.*$)|\n/ /g;
}
return("") if ($tail =~ /^ *$/);
$ret .= $tn if ($tail =~ m/(DOELSEIF )/ and !($tail =~ m/(DOELSE )/) and AttrVal($tn,"do","") !~ "always");
return $ret;
}
sub DOIFtoolsCheckDOIF {
my ($hash,$tn) = @_;
my $ret = "";
my $tail = $defs{$tn}{DEF};
if (!$tail) {
$tail="";
} else {
$tail =~ s/(##.*\n)|(##.*$)|\n/ /g;
}
return("") if ($tail =~ /^ *$/);
my $DE = AttrVal("global", "language", "") eq "DE" ? 1 : 0;
if ($DE) {
$ret .= "<li>ersetze <b>DOIF name</b> durch <b>\$SELF</b> (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_Ereignissteuerung_ueber_Auswertung_von_Events\">Auswertung von Events</a>)</li>\n" if ($tail =~ m/[\[|\?]($tn)/);
$ret .= "<li>ersetze <b>ReadingsVal(...)</b> durch <b>[</b>name<b>:</b>reading<b>,</b>default value<b>]</b>, wenn es nicht in einem <b><a href=\"https://fhem.de/commandref.html#IF\">IF-Befehl</a></b> verwendet wird, dort ist es nicht anders möglich einen Default-Wert anzugeben. (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_Ereignissteuerung\">Steuerung durch Events</a>)</li>\n" if ($tail =~ m/(ReadingsVal)/);
$ret .= "<li>ersetze <b>ReadingsNum(...)</b> durch <b>[</b>name<b>:</b>reading<b>:d,</b>default value]</b>, wenn es nicht in einem <b><a href=\"https://fhem.de/commandref.html#IF\">IF-Befehl</a></b> verwendet wird, dort ist es nicht anders möglich einen Default-Wert anzugeben. (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_Filtern_nach_Zahlen\">Filtern nach Zahlen</a>)</li>\n" if ($tail =~ m/(ReadingsNum)/);
$ret .= "<li>ersetze <b>InternalVal(...)</b> durch <b>[</b>name<b>:</b>&internal,</b>default value<b>]</b>, wenn es nicht in einem <b><a href=\"https://fhem.de/commandref.html#IF\">IF-Befehl</a></b> verwendet wird, dort ist es nicht anders möglich einen Default-Wert anzugeben. (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_Ereignissteuerung\">Steuerung durch Events</a>)</li>\n" if ($tail =~ m/(InternalVal)/);
$ret .= "<li>ersetze <b>$1...\")}</b> durch <b>$2...</b> (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#command\">FHEM-Befehl</a>)</li>\n" if ($tail =~ m/(\{\s*fhem.*?\"\s*(set|get))/);
$ret .= "<li>ersetze <b>{system \"</b><SHELL-Befehl><b>\"}</b> durch <b>\"</b>\<SHELL-Befehl><b>\"</b> (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#command\">FHEM SHELL-Befehl, nicht blockierend</a>)</li>\n" if ($tail =~ m/(\{\s*system.*?\})/);
$ret .= "<li><b>sleep</b> im DOIF zu nutzen, wird nicht empfohlen, nutze das Attribut <b>wait</b> für (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_wait\">Verzögerungen</a>)</li>\n" if ($tail =~ m/(sleep\s\d+\.?\d+\s*[;|,]?)/);
$ret .= "<li>ersetze <b>[</b>name<b>:?</b>regex<b>]</b> durch <b>[</b>name<b>:\"</b>regex<b>\"]</b> (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_Ereignissteuerung_ueber_Auswertung_von_Events\">Vermeidung veralteter Syntax</a>)</li>\n" if ($tail =~ m/(\[.*?[^"]?:[^"]?\?.*?\])/);
$ret .= "<li>nach <b>DOELSE</b> ist möglicherweise eine <b>Bedingung</b> angegeben, weil <b>$2</b> gefunden wurde, bitte prüfen (ignorieren, wenn der Operator zu einem Befehl gehört).</li>\n" if ($tail =~ m/(DOELSE .*?\]\s*?(\!\S|\=\~|\!\~|and|or|xor|not|\|\||\&\&|\=\=|\!\=|ne|eq|lt|gt|le|ge)\s*?).*?\)/);
my @wait = SplitDoIf(":",AttrVal($tn,"wait",""));
my @sub0 = ();
my @tmp = ();
if (@wait and !AttrVal($tn,"timerWithWait","")) {
for (my $i = 0; $i < @wait; $i++) {
($sub0[$i],@tmp) = SplitDoIf(",",$wait[$i]);
$sub0[$i] =~ s/\s// if($sub0[$i]);
}
if (defined $defs{$tn}{timeCond}) {
foreach my $key (sort keys %{$defs{$tn}{timeCond}}) {
if (defined($defs{$tn}{timeCond}{$key}) and $defs{$tn}{timeCond}{$key} and $sub0[$defs{$tn}{timeCond}{$key}]) {
$ret .= "<li><b>Timer</b> in der <b>Bedingung</b> and <b>Wait-Timer</b> für <b>Befehle</b> im selben <b>DOIF-Zweig</b>.<br>Wenn ein unerwartetes Verhalten beobachtet wird, nutze das Attribut <b>timerWithWait</b> (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_timerWithWait\">Verzögerung von Timern</a>)</li>\n";
last;
}
}
}
}
my $wait = AttrVal($tn,"wait","");
if ($wait) {
$ret .= "<li>Mindestens ein <b>indirekter Timer</b> im Attribut <b>wait</b> bezieht sich auf den <b>DOIF-Namen</b> ( $tn ) und hat keinen <b>Default-Wert</b>, er sollte angegeben werden.</b>. (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_notexist\">Default-Wert</a>)</li>\n"
if($wait =~ m/(\[(\$SELF|$tn).*?(\,.*?)?\])/ and $2 and !$3);
}
if (defined $defs{$tn}{time}) {
foreach my $key (sort keys %{$defs{$tn}{time}}) {
if (defined $defs{$tn}{time}{$key} and $defs{$tn}{time}{$key} =~ m/(\[(\$SELF|$tn).*?(\,.*?)?\])/ and $2 and !$3) {
$ret .= "<li>Mindestens ein <b>indirekter Timer</b> in einer <b>Bedingung</b> bezieht sich auf den <b>DOIF-Namen</b> ( $tn ) und hat keinen <b>Default-Wert</b>, er sollte angegeben werden. (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_notexist\">Default-Wert</a>)</li>\n";
last;
}
}
}
if (defined $defs{$tn}{devices}{all}) {
@tmp = ();
my $devi = $defs{$tn}{devices}{all};
$devi =~ s/^ | $//g;
my @devi = split(/ /,$defs{$tn}{devices}{all});
foreach my $key (@devi) {
push @tmp, $key if (defined $defs{$key} and $defs{$key}{TYPE} eq "dummy");
}
if (@tmp) {
@tmp = keys %{{ map { $_ => 1 } @tmp}};
my $tmp = join(" ",sort @tmp);
$ret .= "<li>Dummy-Geräte ( $tmp ) in der Bedingung von DOIF $tn können durch <b>benutzerdefinierte Readings des DOIF</b> ersetzt werden, wenn sie als Frontend-Elemente genutzt werden. (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#https://fhem.de/commandref_DE.html#DOIF_setList__readingList\">readingList, setList, webCmd</a>)</li>\n";
}
}
if (defined $defs{$tn}{do}) {
@tmp = ();
foreach my $key (keys %{$defs{$tn}{do}}) {
foreach my $subkey (keys %{$defs{$tn}{do}{$key}}) {
push @tmp, $1 if ($defs{$tn}{do}{$key}{$subkey} =~ m/set (.*?) / and defined $defs{$1} and $defs{$1}{TYPE} eq "dummy");
}
}
if (@tmp) {
@tmp = keys %{{ map { $_ => 1 } @tmp}};
my $tmp = join(" ",sort @tmp);
$ret .= "<li>Statt Dummys ( $tmp ) zu setzen, könnte ggf. der Status des DOIF $tn zur Anzeige im Frontend genutzt werden. (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#https://fhem.de/commandref_DE.html#DOIF_cmdState\">DOIF-Status ersetzen</a>)</li>\n";
}
}
} else {
$ret .= "<li>replace <b>DOIF name</b> with <b>\$SELF</b> (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_Ereignissteuerung_ueber_Auswertung_von_Events\">utilization of events</a>)</li>\n" if ($tail =~ m/[\[|\?]($tn)/);
$ret .= "<li>replace <b>ReadingsVal(...)</b> with <b>[</b>name<b>:</b>reading<b>,</b>default value<b>]</b>, if not used in an <b><a href=\"https://fhem.de/commandref.html#IF\">IF command</a></b>, otherwise there is no possibility to use a default value (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_Ereignissteuerung\">controlling by events</a>)</li>\n" if ($tail =~ m/(ReadingsVal)/);
$ret .= "<li>replace <b>ReadingsNum(...)</b> with <b>[</b>name<b>:</b>reading<b>:d,</b>default value]</b>, if not used in an <b><a href=\"https://fhem.de/commandref.html#IF\">IF command</a></b>, otherwise there is no possibility to use a default value (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_Filtern_nach_Zahlen\">filtering numbers</a>)</li>\n" if ($tail =~ m/(ReadingsNum)/);
$ret .= "<li>replace <b>InternalVal(...)</b> with <b>[</b>name<b>:</b>&internal,</b>default value<b>]</b>, if not used in an <b><a href=\"https://fhem.de/commandref.html#IF\">IF command</a></b>, otherwise there is no possibility to use a default value (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_Ereignissteuerung\">controlling by events</a>)</li>\n" if ($tail =~ m/(InternalVal)/);
$ret .= "<li>replace <b>$1...\")}</b> with <b>$2...</b> (<a target=\"_blank\" href=\"https://fhem.de/commandref.html#command\">plain FHEM command</a>)</li>\n" if ($tail =~ m/(\{\s*fhem.*?\"\s*(set|get))/);
$ret .= "<li>replace <b>{system \"</b><shell command><b>\"}</b> with <b>\"</b>\<shell command><b>\"</b> (<a target=\"_blank\" href=\"https://fhem.de/commandref.html#command\">plain FHEM shell command, non blocking</a>)</li>\n" if ($tail =~ m/(\{\s*system.*?\})/);
$ret .= "<li><b>sleep</b> is not recommended in DOIF, use attribute <b>wait</b> for (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_wait\">delay</a>)</li>\n" if ($tail =~ m/(sleep\s\d+\.?\d+\s*[;|,]?)/);
$ret .= "<li>replace <b>[</b>name<b>:?</b>regex<b>]</b> by <b>[</b>name<b>:\"</b>regex<b>\"]</b> (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_Ereignissteuerung_ueber_Auswertung_von_Events\">avoid old syntax</a>)</li>\n" if ($tail =~ m/(\[.*?[^"]?:[^"]?\?.*?\])/);
$ret .= "<li><b>$2</b> found after <b>DOELSE</b>, it seems to be a <b>condition</b>, check it (ignore if it's part of a command).</li>\n" if ($tail =~ m/(DOELSE .*?\]\s*?(\!\S|\=\~|\!\~|and|or|xor|not|\|\||\&\&|\=\=|\!\=|ne|eq|lt|gt|le|ge)\s*?).*?\)/);
my @wait = SplitDoIf(":",AttrVal($tn,"wait",""));
my @sub0 = ();
my @tmp = ();
if (@wait and !AttrVal($tn,"timerWithWait","")) {
for (my $i = 0; $i < @wait; $i++) {
($sub0[$i],@tmp) = SplitDoIf(",",$wait[$i]);
$sub0[$i] =~ s/\s// if($sub0[$i]);
}
if (defined $defs{$tn}{timeCond}) {
foreach my $key (sort keys %{$defs{$tn}{timeCond}}) {
if (defined($defs{$tn}{timeCond}{$key}) and $defs{$tn}{timeCond}{$key} and $sub0[$defs{$tn}{timeCond}{$key}]) {
$ret .= "<li><b>Timer</b> in <b>condition</b> and <b>wait timer</b> for <b>commands</b> in the same <b>DOIF branch</b>.<br>If you observe unexpected behaviour, try attribute <b>timerWithWait</b> (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_timerWithWait\">delay of Timer</a>)</li>\n";
last;
}
}
}
}
my $wait = AttrVal($tn,"wait","");
if ($wait) {
$ret .= "<li>At least one <b>indirect timer</b> in attribute <b>wait</b> is referring <b>DOIF's name</b> ( $tn ) and has no <b>default value</b>, you should add <b>default values</b>. (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_notexist\">default value</a>)</li>\n"
if($wait =~ m/(\[(\$SELF|$tn).*?(\,.*?)?\])/ and $2 and !$3);
}
if (defined $defs{$tn}{time}) {
foreach my $key (sort keys %{$defs{$tn}{time}}) {
if (defined $defs{$tn}{time}{$key} and $defs{$tn}{time}{$key} =~ m/(\[(\$SELF|$tn).*?(\,.*?)?\])/ and $2 and !$3) {
$ret .= "<li>At least one <b>indirect timer</b> in <b>condition</b> is referring <b>DOIF's name</b> ( $tn ) and has no <b>default value</b>, you should add <b>default values</b>. (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_notexist\">default value</a>)</li>\n";
last;
}
}
}
if (defined $defs{$tn}{devices}{all}) {
@tmp = ();
my $devi = $defs{$tn}{devices}{all};
$devi =~ s/^ | $//g;
my @devi = split(/ /,$defs{$tn}{devices}{all});
foreach my $key (@devi) {
push @tmp, $key if (defined $defs{$key} and $defs{$key}{TYPE} eq "dummy");
}
if (@tmp) {
my $tmp = join(" ",sort @tmp);
$ret .= "<li>dummy devices in DOIF $tn condition could replaced by <b>user defined readings</b> in DOIF, if they are used as frontend elements. (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#https://fhem.de/commandref_DE.html#DOIF_setList__readingList\">readingList, setList, webCmd</a>)</li>\n";
}
}
if (defined $defs{$tn}{do}) {
@tmp = ();
foreach my $key (keys %{$defs{$tn}{do}}) {
foreach my $subkey (keys %{$defs{$tn}{do}{$key}}) {
push @tmp, $1 if ($defs{$tn}{do}{$key}{$subkey} =~ m/set (.*?) / and defined $defs{$1} and $defs{$1}{TYPE} eq "dummy");
}
}
if (@tmp) {
my $tmp = join(" ",sort @tmp);
$ret .= "<li>The state of DOIF $tn could be eventually used as display element in frontend, instead of setting a dummy device ( $tmp ). (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#https://fhem.de/commandref_DE.html#DOIF_cmdState\">replace DOIF state</a>)</li>\n";
}
}
}
$ret = $ret ? "$tn\n<ul>$ret</ul> " : "";
return $ret;
}
# param: $hash, doif_to_log, statisticsTypes as 1 or 0
sub DOIFtoolsSetNotifyDev {
my ($hash,@a) = @_;
my $pn = $hash->{NAME};
$hash->{NOTIFYDEV} = "global";
$hash->{NOTIFYDEV} .= ",$attr{global}{holiday2we}" if ($attr{global}{holiday2we});
$hash->{NOTIFYDEV} .= ",".ReadingsVal($pn,"doif_to_log","") if ($a[0] and ReadingsVal($pn,"doif_to_log","") and ReadingsVal($pn,"specialLog",0));
$hash->{NOTIFYDEV} .= ",TYPE=".ReadingsVal($pn,"statisticsTYPEs","") if ($a[1] and ReadingsVal($pn,"statisticsTYPEs","") and ReadingsVal($pn,"doStatistics","deleted") eq "enabled");
return undef;
}
sub DOIFtoolsCounterReset($) {
my ($pn) = @_;
RemoveInternalTimer($pn,"DOIFtoolsCounterReset");
$defs{$pn}->{helper}{counter}{0} = 0;
my $nt = gettimeofday();
my @lt = localtime($nt);
$nt -= ($lt[2]*3600+$lt[1]*60+$lt[0]); # Midnight
$nt += 86400 + 3; # Tomorrow
InternalTimer($nt, "DOIFtoolsCounterReset", $pn, 0);
return undef;
}
sub DOIFtoolsDeleteStatReadings {
my ($hash, @a) = @_;
my $pn = $hash->{NAME};
my $st = AttrVal($pn,"DOIFtoolsHideStatReadings","") ? ".stat_" : "stat_"; readingsBeginUpdate($hash);
readingsBulkUpdate($hash,"Action","event recording stopped and data deleted");
readingsBulkUpdate($hash,"doStatistics","disabled");
readingsBulkUpdate($hash,"statisticHours","0.00");
readingsBulkUpdate($hash,".t0",gettimeofday());
readingsBulkUpdate($hash,".te",0);
readingsEndUpdate($hash,0);
if (AttrVal($pn,"DOIFtoolsEventOnDeleted","")){
readingsBeginUpdate($hash);
foreach my $key (keys %{$hash->{READINGS}}) {
readingsBulkUpdate($hash,"stat_$1",ReadingsVal($pn,"$key",0)) if ($key =~ m/^$st(.*)/);
}
readingsEndUpdate($hash,1);
}
foreach my $key (keys %{$hash->{READINGS}}) {
delete $hash->{READINGS}{$key} if ($key =~ "^(stat_|\.stat_)");
}
}
#################################
sub DOIFtools_Define($$$)
{
my ($hash, $def) = @_;
my ($pn, $type, $cmd) = split(/[\s]+/, $def, 3);
my @Liste = devspec2array("TYPE=DOIFtools");
if (@Liste > 1) {
CommandDelete(undef,$pn);
return "Only one instance of DOIFtools is allowed per FHEM installation. Delete the old one first.";
}
$hash->{logfile} = AttrVal($pn,"DOIFtoolsLogDir",AttrVal("global","logdir","./log/"))."$hash->{TYPE}Log-%Y-%j.log";
DOIFtoolsCounterReset($pn);
readingsSingleUpdate($hash,"state","initialized",0);
return undef;
}
sub DOIFtools_Attr(@)
{
my @a = @_;
my $cmd = $a[0];
my $pn = $a[1];
my $attr = $a[2];
my $value = (defined $a[3]) ? $a[3] : "";
my $hash = $defs{$pn};
my $ret="";
if ($init_done and $attr eq "DOIFtoolsMenuEntry") {
if ($cmd eq "set" and $value) {
if (!(AttrVal($FW_wname, "menuEntries","") =~ m/(DOIFtools\,$FW_ME\?detail\=DOIFtools\,)/)) {
CommandAttr(undef, "$FW_wname menuEntries DOIFtools,$FW_ME?detail=DOIFtools,".AttrVal($FW_wname, "menuEntries",""));
# CommandSave(undef, undef);
}
} elsif ($init_done and $cmd eq "del" or !$value) {
if (AttrVal($FW_wname, "menuEntries","") =~ m/(DOIFtools\,$FW_ME\?detail\=DOIFtools\,)/) {
my $me = AttrVal($FW_wname, "menuEntries","");
$me =~ s/DOIFtools\,$FW_ME\?detail\=DOIFtools\,//;
CommandAttr(undef, "$FW_wname menuEntries $me");
# CommandSave(undef, undef);
}
}
} elsif ($init_done and $attr eq "DOIFtoolsLogDir") {
if ($cmd eq "set") {
if ($value and -d $value) {
$value =~ m,^(.*)/$,;
return "Path \"$value\" needs a final slash." if (!$1);
$hash->{logfile} = "$value$hash->{TYPE}Log-%Y-%j.log";
} else {
return "\"$value\" is not a valid directory";
}
} elsif ($cmd eq "del" or !$value) {
$hash->{logfile} = AttrVal("global","logdir","./log/")."$hash->{TYPE}Log-%Y-%j.log";
}
} elsif ($init_done and $attr eq "DOIFtoolsHideStatReadings") {
DOIFtoolsSetNotifyDev($hash,1,0);
DOIFtoolsDeleteStatReadings($hash);
} elsif ($init_done and $cmd eq "set" and
$attr =~ m/^(executeDefinition|executeSave|target_room|target_group|readingsPrefix|eventMonitorInDOIF)$/) {
$ret .= "\n$1 is an old attribute name use a new one beginning with DOIFtools...";
return $ret;
}
return undef;
}
sub DOIFtools_Undef
{
my ($hash, $pn) = @_;
$hash->{DELETED} = 1;
if (devspec2array("TYPE=DOIFtools") <=1 and defined($modules{DOIF}->{FW_detailFn}) and $modules{DOIF}->{FW_detailFn} eq "DOIFtools_eM") {
$modules{DOIF}->{FW_detailFn} = ReadingsVal($pn,".DOIF_detailFn","");
$modules{DOIF}->{FW_deviceOverview} = ReadingsVal($pn,".DOIFdO","");
}
if (AttrVal($pn,"DOIFtoolsMenuEntry","")) {
CommandDeleteAttr(undef, "$pn DOIFtoolsMenuEntry");
}
RemoveInternalTimer($pn,"DOIFtoolsCounterReset");
return undef;
}
sub DOIFtools_Set($@)
{
my ($hash, @a) = @_;
my $pn = $hash->{NAME};
my $arg = $a[1];
my $value = (defined $a[2]) ? $a[2] : "";
my $ret = "";
my @ret = ();
my @doifList = devspec2array("TYPE=DOIF");
my @deviList = devspec2array("TYPE!=DOIF");
my @ntL =();
my $dL = join(",",sort @doifList);
my $deL = join(",",sort @deviList);
my $st = AttrVal($pn,"DOIFtoolsHideStatReadings","") ? ".stat_" : "stat_";
my %types = ();
foreach my $d (keys %defs ) {
next if(IsIgnored($d));
my $t = $defs{$d}{TYPE};
$types{$t} = "";
}
my $tL = join(",",sort keys %types);
if ($arg eq "sourceAttribute") {
readingsSingleUpdate($hash,"sourceAttribute",$value,0);
return $ret;
} elsif ($arg eq "targetDOIF") {
readingsSingleUpdate($hash,"targetDOIF",$value,0);
FW_directNotify("#FHEMWEB:$FW_wname", "location.reload('".AttrVal($pn,"DOIFtoolsForceGet","")."')", "");
} elsif ($arg eq "deleteReadingsInTargetDOIF") {
if ($value) {
my @i = split(",",$value);
foreach my $i (@i) {
$ret = CommandDeleteReading(undef,ReadingsVal($pn,"targetDOIF","")." $i");
push @ret, $ret if($ret);
}
$ret = join("\n", @ret);
readingsSingleUpdate($hash,"targetDOIF","",0);
return $ret;
} else {
readingsSingleUpdate($hash,"targetDOIF","",0);
return "no reading selected.";
}
} elsif ($arg eq "targetDevice") {
readingsSingleUpdate($hash,"targetDevice",$value,0);
FW_directNotify("#FHEMWEB:$FW_wname", "location.reload('".AttrVal($pn,"DOIFtoolsForceGet","")."')", "");
} elsif ($arg eq "deleteReadingsInTargetDevice") {
if ($value) {
my @i = split(",",$value);
foreach my $i (@i) {
$ret = CommandDeleteReading(undef,ReadingsVal($pn,"targetDevice","")." $i");
push @ret, $ret if($ret);
}
$ret = join("\n", @ret);
readingsSingleUpdate($hash,"targetDevice","",0);
return $ret;
} else {
readingsSingleUpdate($hash,"targetDevice","",0);
return "no reading selected.";
}
} elsif ($arg eq "doStatistics") {
if ($value eq "deleted") {
DOIFtoolsSetNotifyDev($hash,1,0);
DOIFtoolsDeleteStatReadings($hash);
} elsif ($value eq "disabled") {
readingsBeginUpdate($hash);
readingsBulkUpdate($hash,"Action","event recording paused");
readingsBulkUpdate($hash,"doStatistics","disabled");
readingsEndUpdate($hash,0);
DOIFtoolsSetNotifyDev($hash,1,0);
} elsif ($value eq "enabled") {
readingsBeginUpdate($hash);
readingsBulkUpdate($hash,"Action","<html><div style=\"color:red;\" >recording events</div></html>");
readingsBulkUpdate($hash,"doStatistics","enabled");
readingsBulkUpdate($hash,".t0",gettimeofday());
readingsEndUpdate($hash,0);
DOIFtoolsSetNotifyDev($hash,1,1);
}
} elsif ($arg eq "statisticsTYPEs") {
$value =~ s/\,/|/g;
readingsBeginUpdate($hash);
readingsBulkUpdate($hash,"statisticsTYPEs",$value);
readingsEndUpdate($hash,0);
DOIFtoolsDeleteStatReadings($hash);
DOIFtoolsSetNotifyDev($hash,1,0);
} elsif ($arg eq "recording_target_duration") {
$value =~ m/(\d+)/;
readingsSingleUpdate($hash,"recording_target_duration",$1 ? $1 : 0,0);
} elsif ($arg eq "statisticsShowRate_ge") {
$value =~ m/(\d+)/;
readingsSingleUpdate($hash,"statisticsShowRate_ge",$1 ? $1 : 0,0);
} elsif ($arg eq "specialLog") {
if ($value) {
readingsSingleUpdate($hash,"specialLog",1,0);
DOIFtoolsSetNotifyDev($hash,1,1);
} else {
readingsSingleUpdate($hash,"specialLog",0,0);
DOIFtoolsSetNotifyDev($hash,0,1);
}
} elsif ($arg eq "statisticsDeviceFilterRegex") {
$ret = "Bad regexp: starting with *" if($value =~ m/^\*/);
eval { "Hallo" =~ m/^$value$/ };
$ret .= "\nBad regexp: $@" if($@);
if ($ret or !$value) {
readingsSingleUpdate($hash,"statisticsDeviceFilterRegex", ".*",0);
return "$ret\nRegexp is set to: .*";
} else {
readingsSingleUpdate($hash,"statisticsDeviceFilterRegex", $value,0);
}
} else {
my $hardcoded = "doStatistics:disabled,enabled,deleted specialLog:0,1";
my $retL = "unknown argument $arg for $pn, choose one of statisticsTYPEs:multiple-strict,.*,$tL sourceAttribute:readingList targetDOIF:$dL targetDevice:$deL recording_target_duration:0,1,6,12,24,168 statisticsDeviceFilterRegex statisticsShowRate_ge ".(AttrVal($pn,"DOIFtoolsHideGetSet",0) ? $hardcoded :"");
if (ReadingsVal($pn,"targetDOIF","")) {
my $tn = ReadingsVal($pn,"targetDOIF","");
my @rL = ();
foreach my $key (keys %{$defs{$tn}->{READINGS}}) {
push @rL, $key if ($key !~ "^(Device|state|error|cmd|e_|timer_|wait_|matched_|last_cmd|mode|\.eM)");
}
$retL .= " deleteReadingsInTargetDOIF:multiple-strict,".join(",", sort @rL);
}
if (ReadingsVal($pn,"targetDevice","")) {
my $tn = ReadingsVal($pn,"targetDevice","");
my @rL = ();
my $rx = ReadingsVal($pn,".debug","") ? "^(state)" : "^(state|[.])";
foreach my $key (keys %{$defs{$tn}->{READINGS}}) {
push @rL, $key if ($key !~ $rx);
}
$retL .= " deleteReadingsInTargetDevice:multiple-strict,".join(",", sort @rL);
}
return $retL;
}
return $ret;
}
sub DOIFtools_Get($@)
{
my ($hash, @a) = @_;
my $pn = $hash->{NAME};
my $arg = $a[1];
my $value = (defined $a[2]) ? $a[2] : "";
my $ret="";
my @ret=();
my @doifList = devspec2array("TYPE=DOIF");
my @doifListFHEM = devspec2array("TYPE=DOIF" and "MODEL=FHEM");
my @doifListPerl = devspec2array("TYPE=DOIF" and "MODEL=Perl");
my @ntL =();
my $dL = join(",",sort @doifList);
my $DE = AttrVal("global", "language", "") eq "DE" ? 1 : 0;
foreach my $i (@doifList) {
foreach my $key (keys %{$defs{$i}{READINGS}}) {
if ($key =~ m/^timer_\d\d_c\d\d/ && $defs{$i}{READINGS}{$key}{VAL} =~ m/\d\d.\d\d.\d\d\d\d \d\d:\d\d:\d\d\|.*/) {
push @ntL, $i;
last;
}
}
}
my $ntL = join(",",@ntL);
my %types = ();
foreach my $d (keys %defs ) {
next if(IsIgnored($d));
my $t = $defs{$d}{TYPE};
$types{$t} = "";
}
if ($arg eq "readingsGroup_for") {
foreach my $i (split(",",$value)) {
push @ret, DOIFtoolsRg($hash,$i);
}
$ret .= join("\n",@ret);
$ret = "<b>Definition for a simple readingsGroup prepared for import with \"Raw definition\":</b>\r--->\r$ret\r<---\r\r";
$ret = "<b>Die Definition einer einfachen readingsGroup ist für den Import mit \"Raw definition\"</b> vorbereitet:\r--->\r$ret\r<---\r\r" if ($DE);
Log3 $pn, 3, $ret if($ret);
return $ret;
} elsif ($arg eq "DOIF_to_Log") {
my @regex = ();
my $regex = "";
my $pnLog = "$hash->{TYPE}Log";
push @regex, $pnLog;
readingsSingleUpdate($hash,"doif_to_log",$value,0);
readingsSingleUpdate($hash,"specialLog",0,0) if (!$value);
DOIFtoolsSetNotifyDev($hash,0,1);
# return unless($value);
foreach my $i (split(",",$value)) {
push @regex, DOIFtoolsGetAssocDev($hash,$i);
}
@regex = keys %{{ map { $_ => 1 } @regex}};
$regex = join("|",@regex).":.*";
if (AttrVal($pn,"DOIFtoolsExecuteDefinition","")) {
push @ret, "Create device <b>$pnLog</b>.\n";
$ret = CommandDefMod(undef,"$pnLog FileLog ".InternalVal($pn,"logfile","./log/$pnLog-%Y-%j.log")." $regex");
push @ret, $ret if($ret);
$ret = CommandAttr(undef,"$pnLog mseclog ".AttrVal($pnLog,"mseclog","1"));
push @ret, $ret if($ret);
$ret = CommandAttr(undef,"$pnLog nrarchive ".AttrVal($pnLog,"nrarchive","3"));
push @ret, $ret if($ret);
$ret = CommandAttr(undef,"$pnLog disable ".($value ? "0" : "1"));
push @ret, $ret if($ret);
$ret = CommandSave(undef,undef) if (AttrVal($pn,"DOIFtoolsExecuteSave",""));
push @ret, $ret if($ret);
$ret = join("\n", @ret);
Log3 $pn, 3, $ret if($ret);
return $ret;
} else {
$ret = "<b>Definition for a FileLog prepared for import with \"Raw definition\":</b>\r--->\r";
$ret = "<b>Die FileLog-Definition ist zum Import mit \"Raw definition\"</b>vorbereitet:\r--->\r" if ($DE);
$ret .= "defmod $pnLog FileLog ".InternalVal($pn,"logfile","./log/$pnLog-%Y-%j.log")." $regex\r";
$ret .= "attr $pnLog mseclog 1\r<---\r\r";
return $ret;
}
} elsif ($arg eq "userReading_nextTimer_for") {
foreach my $i (split(",",$value)) {
push @ret, DOIFtoolsNxTimer($hash,$i);
}
$ret .= join("\n",@ret);
Log3 $pn, 3, $ret if($ret);
return $ret;
} elsif ($arg eq "statisticsReport") {
# event statistics
my $regex = ReadingsVal($pn,"statisticsDeviceFilterRegex",".*");
my $evtsum = 0;
my $evtlen = 15 + 2;
my $rate = 0;
my $typsum = 0;
my $typlen = 10 + 2;
my $typerate = 0;
my $allattr = "";
my $rx = AttrVal($pn,"DOIFtoolsHideStatReadings","") ? "\.stat_" : "stat_";
my $te = ReadingsVal($pn,".te",0)/3600;
my $compRate = ReadingsNum($pn,"statisticsShowRate_ge",0);
foreach my $typ ( keys %types) {
$typlen = length($typ)+2 > $typlen ? length($typ)+2 : $typlen;
}
foreach my $key (sort keys %{$defs{$pn}->{READINGS}}) {
$rate = ($te ? int($hash->{READINGS}{$key}{VAL}/$te + 0.5) : 0) if ($key =~ m/^$rx($regex)/);
if ($key =~ m/^$rx($regex)/ and $rate >= $compRate) {
$evtlen = length($1)+2 > $evtlen ? length($1)+2 : $evtlen;
}
}
$ret = "<b>".sprintf("%-".$typlen."s","TYPE").sprintf("%-".$evtlen."s","NAME").sprintf("%-12s","Number").sprintf("%-8s","Rate").sprintf("%-12s","<a href=\"https://wiki.fhem.de/wiki/Event#Beschr.C3.A4nken_von_Events\">Restriction</a>")."</b>\n";
$ret = "<b>".sprintf("%-".$typlen."s","TYPE").sprintf("%-".$evtlen."s","NAME").sprintf("%-12s","Anzahl").sprintf("%-8s","Rate").sprintf("%-12s","<a href=\"https://wiki.fhem.de/wiki/Event#Beschr.C3.A4nken_von_Events\">Begrenzung</a>")."</b>\n" if ($DE);
$ret .= sprintf("%-".$typlen."s","").sprintf("%-".$evtlen."s","").sprintf("%-12s","Events").sprintf("%-8s","1/h").sprintf("%-12s","event-on...")."\n";
$ret .= sprintf("-"x($typlen+$evtlen+33))."\n";
my $i = 0;
my $t = 0;
foreach my $typ (sort keys %types) {
$typsum = 0;
$t=0;
foreach my $key (sort keys %{$defs{$pn}->{READINGS}}) {
$rate = ($te ? int($hash->{READINGS}{$key}{VAL}/$te + 0.5) : 0) if ($key =~ m/^$rx($regex)/ and defined($defs{$1}) and $defs{$1}->{TYPE} eq $typ);
if ($key =~ m/^$rx($regex)/ and defined($defs{$1}) and $defs{$1}->{TYPE} eq $typ and $rate >= $compRate) {
$evtsum += $hash->{READINGS}{$key}{VAL};
$typsum += $hash->{READINGS}{$key}{VAL};
$allattr = " ".join(" ",keys %{$attr{$1}});
$ret .= sprintf("%-".$typlen."s",$typ).sprintf("%-".$evtlen."s",$1).sprintf("%-12s",$hash->{READINGS}{$key}{VAL}).sprintf("%-8s",$rate).sprintf("%-12s",($DE ? ($allattr =~ " event-on" ? "ja" : "nein") : ($allattr =~ " event-on" ? "yes" : "no")))."\n";
$i++;
$t++;
}
}
if ($t) {
$typerate = $te ? int($typsum/$te + 0.5) : 0;
if($typerate >= $compRate) {
$ret .= sprintf("%".($typlen+$evtlen+10)."s","="x10).sprintf("%2s"," ").sprintf("="x6)."\n";
if ($DE) {
$ret .= sprintf("%".($typlen+$evtlen)."s","Summe: ").sprintf("%-10s",$typsum).sprintf("%2s","∅:").sprintf("%-8s",$typerate)."\n";
$ret .= sprintf("%".($typlen+$evtlen+1)."s","Geräte: ").sprintf("%-10s",$t)."\n";
$ret .= sprintf("%".($typlen+$evtlen+1)."s","Events/Gerät: ").sprintf("%-10s",int($typsum/$t + 0.5))."\n";
} else {
$ret .= sprintf("%".($typlen+$evtlen)."s","Total: ").sprintf("%-10s",$typsum).sprintf("%2s","∅:").sprintf("%-8s",$typerate)."\n";
$ret .= sprintf("%".($typlen+$evtlen)."s","Devices: ").sprintf("%-10s",$t)."\n";
$ret .= sprintf("%".($typlen+$evtlen)."s","Events/device: ").sprintf("%-10s",int($typsum/$t + 0.5))."\n";
}
$ret .= "<div style=\"color:#d9d9d9\" >".sprintf("-"x($typlen+$evtlen+33))."</div>";
}
}
}
if ($DE) {
$ret .= sprintf("%".($typlen+$evtlen+10)."s","="x10).sprintf("%2s"," ").sprintf("="x6)."\n";
$ret .= sprintf("%".($typlen+$evtlen)."s","Summe: ").sprintf("%-10s",$evtsum).sprintf("%2s","∅:").sprintf("%-8s",$te ? int($evtsum/$te + 0.5) : "")."\n";
$ret .= sprintf("%".($typlen+$evtlen)."s","Dauer: ").sprintf("%d:%02d",int($te),int(($te-int($te))*60+.5))."\n";
$ret .= sprintf("%".($typlen+$evtlen+1)."s","Geräte: ").sprintf("%-10s",$i)."\n";
$ret .= sprintf("%".($typlen+$evtlen+1)."s","Events/Gerät: ").sprintf("%-10s",int($evtsum/$i + 0.5))."\n\n" if ($i);
fhem("count",1) =~ m/(\d+)/;
$ret .= sprintf("%".($typlen+$evtlen+1)."s","Geräte total: ").sprintf("%-10s","$1\n\n");
$ret .= sprintf("%".($typlen+$evtlen+1)."s","<u>Filter</u>\n");
$ret .= sprintf("%".($typlen+$evtlen)."s","TYPE: ").sprintf("%-10s",ReadingsVal($pn,"statisticsTYPEs","")."\n");
$ret .= sprintf("%".($typlen+$evtlen-7)."s","NAME: ").sprintf("%-10s",ReadingsVal($pn,"statisticsDeviceFilterRegex",".*")."\n");
$ret .= sprintf("%".($typlen+$evtlen-7)."s","Rate: ").sprintf("%-10s",">= $compRate\n\n");
} else {
$ret .= sprintf("%".($typlen+$evtlen+10)."s","="x10).sprintf("%2s"," ").sprintf("="x6)."\n";
$ret .= sprintf("%".($typlen+$evtlen)."s","Total: ").sprintf("%-10s",$evtsum).sprintf("%2s","∅:").sprintf("%-8s",$te ? int($evtsum/$te + 0.5) : "")."\n";
$ret .= sprintf("%".($typlen+$evtlen)."s","Duration: ").sprintf("%d:%02d",int($te),int(($te-int($te))*60+.5))."\n";
$ret .= sprintf("%".($typlen+$evtlen)."s","Devices: ").sprintf("%-10s",$i)."\n";
$ret .= sprintf("%".($typlen+$evtlen)."s","Events/device: ").sprintf("%-10s",int($evtsum/$i + 0.5))."\n\n" if ($i);
fhem("count",1) =~ m/(\d+)/;
$ret .= sprintf("%".($typlen+$evtlen)."s","Devices total: ").sprintf("%-10s","$1\n\n");
$ret .= sprintf("%".($typlen+$evtlen+1)."s","<u>Filter</u>\n");
$ret .= sprintf("%".($typlen+$evtlen)."s","TYPE: ").sprintf("%-10s",ReadingsVal($pn,"statisticsTYPEs","")."\n");
$ret .= sprintf("%".($typlen+$evtlen-7)."s","NAME: ").sprintf("%-10s",ReadingsVal($pn,"statisticsDeviceFilterRegex",".*")."\n");
$ret .= sprintf("%".($typlen+$evtlen-7)."s","Rate: ").sprintf("%-10s",">= $compRate\n\n");
}
$ret .= "<div style=\"color:#d9d9d9\" >".sprintf("-"x($typlen+$evtlen+33))."</div>";
# model statistics
if ($DE) {
$ret .= "<b>".sprintf("%-30s","DOIF-Modelle").sprintf("%-12s","Anzahl")."</b>\n";
} else {
$ret .= "<b>".sprintf("%-30s","Models of DOIF").sprintf("%-12s","Number")."</b>\n";
}
$ret .= sprintf("-"x42)."\n";
$ret .= sprintf("%-30s","FHEM").sprintf("%-12s","".@doifListFHEM)."\n";
$ret .= sprintf("%-30s","Perl").sprintf("%-12s","".@doifListPerl)."\n\n";
# attibute statistics
if ($DE) {
$ret .= "<b>".sprintf("%-30s","genutzte Attribute in DOIF").sprintf("%-12s","Anzahl")."</b>\n";
} else {
$ret .= "<b>".sprintf("%-30s","used attributes in DOIF").sprintf("%-12s","Number")."</b>\n";
}
$ret .= sprintf("-"x42)."\n";
my %da = ();
foreach my $di (@doifList) {
foreach my $dia (keys %{$attr{$di}}) {
if ($modules{DOIF}{AttrList} =~ m/(^|\s)$dia(:|\s)/) {
if ($dia =~ "do|selftrigger|checkall") {
$dia = "* $dia ".AttrVal($di,$dia,"");
$da{$dia} = ($da{$dia} ? $da{$dia} : 0) + 1;
} else {
$dia = "* $dia";
$da{$dia} = ($da{$dia} ? $da{$dia} : 0) + 1;
}
} else {
$da{$dia} = ($da{$dia} ? $da{$dia} : 0) + 1;
}
}
}
foreach $i (sort keys %da) {
$ret .= sprintf("%-30s","$i").sprintf("%-12s","$da{$i}")."\n";
}
} elsif ($arg eq "checkDOIF") {
my @coll = ();
my $coll = "";
foreach my $di (@doifListFHEM) {
$coll = DOIFtoolsCheckDOIFcoll($hash,$di);
push @coll, $coll if($coll);
}
$ret .= join(" ",@coll);
if ($DE) {
$ret .= "\n<ul><li><b>DOELSEIF</b> ohne <b>DOELSE</b> ist o.k., wenn der Status wechselt, bevor die selbe Bedingung wiederholt wahr wird,<br> andernfalls sollte <b>do always</b> genutzt werden (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_do_always\">Steuerung durch Events</a>, <a target=\"_blank\" href=\"https://wiki.fhem.de/wiki/DOIF/Einsteigerleitfaden,_Grundfunktionen_und_Erl%C3%A4uterungen#Verhaltensweise_ohne_steuernde_Attribute\">Verhalten ohne Attribute</a>)</li></ul> \n" if (@coll);
} else {
$ret .= "\n<ul><li><b>DOELSEIF</b> without <b>DOELSE</b> is o.k., if state changes between, the same condition becomes true again,<br>otherwise use attribute <b>do always</b> (<a target=\"_blank\" href=\"https://fhem.de/commandref_DE.html#DOIF_do_always\">controlling by events</a>, <a target=\"_blank\" href=\"https://wiki.fhem.de/wiki/DOIF/Einsteigerleitfaden,_Grundfunktionen_und_Erl%C3%A4uterungen#Verhaltensweise_ohne_steuernde_Attribute\">behaviour without attributes</a>)</li></ul> \n" if (@coll);
}
foreach my $di (@doifListFHEM) {
$ret .= DOIFtoolsCheckDOIF($hash,$di);
}
$ret = $DE ? ($ret ? "Empfehlung gefunden für MODEL FHEM:\n\n$ret" : "Keine Empfehlung gefunden.") : ($ret ? "Found recommendation for MODEL FHEM:\n\n$ret" : "No recommendation found.");
return $ret;
} elsif ($arg eq "runningTimerInDOIF") {
my $erg ="";
foreach my $di (@doifList) {
push @ret, sprintf("%-28s","$di").sprintf("%-40s",ReadingsVal($di,"wait_timer",""))."\n" if (ReadingsVal($di,"wait_timer","no timer") ne "no timer");
}
$ret .= join("",@ret);
$ret = $ret ? "Found running wait_timer for:\n\n$ret" : "No running wait_timer found.";
$ret .= "\n\n".fhem("blockinginfo",1);
return $ret;
} elsif ($arg eq "SetAttrIconForDOIF") {
$ret .= CommandAttr(undef,"$value icon helper_doif");
$ret .= CommandSave(undef,undef) if (AttrVal($pn,"DOIFtoolsExecuteSave",""));
return $ret;
} elsif ($arg eq "linearColorGradient") {
my ($sc,$ec,$min,$max,$step) = split(",",$value);
if ($value && $sc =~ /[0-9A-F]{6}/ && $ec =~ /[0-9A-F]{6}/ && $min =~ /(-?\d+(\.\d+)?)/ && $max =~ /(-?\d+(\.\d+)?)/ && $step =~ /(-?\d+(\.\d+)?)/) {
$ret .= "<br></pre><table>";
$ret .= "<tr><td colspan=4 style='font-weight:bold;'>Color Table</td></tr>";
$ret .= "<tr><td colspan=4><div>";
for (my $i=0;$i<=127;$i++) {
my $col = DOIFtoolsLinColorGrad($sc,$ec,0,127,$i);
$ret .= "<span style='background-color:$col;'> </span>";
}
$ret .= "</div></td></tr>";
$ret .= "<tr style='text-align:center;'><td> Value </td><td> Color Number </td><td> RGB values </td><td> Color</td> </tr>";
for (my $i=$min;$i<=$max;$i+=$step) {
my $col = DOIFtoolsLinColorGrad($sc,$ec,$min,$max,$i);
$col =~ /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/;
$ret .= "<tr style='text-align:center;'><td>".sprintf("%.1f",$i)."</td><td>$col</td><td> ".hex($1).",".hex($2).",".hex($3)." </td><td style='background-color:$col;'>      </td></tr>";
}
$ret .= "</table><pre>";
return $ret;
} else {
$ret = $DE ? "<br></pre>
Falsche Eingabe: <code>$value</code><br>
Syntax: <code><Startfarbnummer>,<Endfarbnummer>,<Minimalwert>,<Maximalwert>,<Schrittweite></code><br>
<ul>
<li><code><Startfarbnummer></code>, ist eine HTML-Farbnummer, Beispiel: #0000FF für Blau.</li>
<li><code><Endfarbnummer></code>, ist eine HTML-Farbnummer, Beispiel: #FF0000 für Rot.</li>
<li><code><Minimalwert></code>, der Minimalwert auf den die Startfarbnummer skaliert wird, Beispiel: 7.</li>
<li><code><Maximalwert></code>, der Maximalwert auf den die Endfarbnummer skaliert wird, Beispiel: 30.</li>
<li><code><Schrittweite></code>, für jeden Schritt wird ein Farbwert erzeugt, Beispiel: 1.</li>
</ul>
Beispielangabe: <code>#0000FF,#FF0000,7,30,1</code>
<pre>":"<br></pre>
Wrong input: <code>$value</code><br>
Syntax: <code><start color number>,<end color number>,<minimal value>,<maximal value>,<step width></code><br>
<ul>
<li><code><start color number></code>, a HTML color number, example: #0000FF for blue.</li>
<li><code><end color number></code>, a HTML color number, example: #FF0000 for red.</li>
<li><code><minimal value></code>, the start color number will be scaled to it, example: 7.</li>
<li><code><maximal value></code>, the end color number will be scaled to it, example: 30.</li>
<li><code><step width></code>, for each step a color number will be generated, example: 1.</li>
</ul>
Example specification: <code>#0000FF,#FF0000,7,30,1</code>
<pre>";
return $ret
}
} elsif ($arg eq "hsvColorGradient") {
my ($min_s,$max_s,$min,$max,$step,$s,$v)=split(",",$value);
if ($value && $s >= 0 && $s <= 100 && $v >= 0 && $v <= 100 && $min_s >= 0 && $min_s <= 360 && $max_s >= 0 && $max_s <= 360) {
$ret .= "<br></pre><table>";
$ret .= "<tr><td colspan=4 style='font-weight:bold;'>Color Table</td></tr>";
$ret .= "<tr><td colspan=4><div>";
for (my $i=0;$i<=127;$i++) {
my $col = DOIFtoolsHsvColorGrad($i,0,127,$min_s,$max_s,$s,$v);
$ret .= "<span style='background-color:$col;'> </span>";
}
$ret .= "</div></td></tr>";
$ret .= "<tr style='text-align:center;'><td> Value </td><td> Color Number </td><td> RGB values </td><td> Color</td> </tr>";
for (my $i=$min;$i<=$max;$i+=$step) {
my $col = DOIFtoolsHsvColorGrad($i,$min,$max,$min_s,$max_s,$s,$v);
$col =~ /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/;
$ret .= "<tr style='text-align:center;'><td>".sprintf("%.1f",$i)."</td><td>$col</td><td> ".hex($1).",".hex($2).",".hex($3)." </td><td style='background-color:$col;'>      </td></tr>";
}
$ret .= "</table><pre>";
return $ret;
} else {
$ret = $DE ? "<br></pre>
Falsche Eingabe: <code>$value</code><br>
Syntax: <code><HUE-Startwert>,<HUE-Endwert>,<Minimalwert>,<Maximalwert>,<Schrittweite>,<Sättigung>,<Hellwert></code><br>
<ul>
<li><code><HUE-Startwert></code>, ist ein HUE-Wert <code>0-360</code>, Beispiel: 240 für Blau.</li>
<li><code><HUE-Endwert></code>, ist ein HUE-Wert <code>0-360</code>, Beispiel: 360 für Rot.</li>
<li><code><Minimalwert></code>, der Minimalwert auf den der HUE-Startwert skaliert wird, Beispiel: 7.</li>
<li><code><Maximalwert></code>, der Maximalwert auf den der HUE-Endwert skaliert wird, Beispiel: 30.</li>
<li><code><Schrittweite></code>, für jeden Schritt wird ein Farbwert erzeugt, Beispiel: 1.</li>
<li><code><Sättigung></code>, die verwendete Farbsätigung <code>0-100</code>, Beispiel: 80.</li>
<li><code><Hellwert></code>, Angabe der Helligkeit <code>0-100</code>, Beispiel: 80.</li>
</ul>
Beispielangabe: <code>240,360,7,30,1,80,80</code>
<pre>":"<br></pre>
Wrong input: <code>$value</code><br>
Syntax: <code><HUE start value>,<HUE end value>,<minimal value>,<maximal value>,<step width>,<saturation>,<lightness></code><br>
<ul>
<li><code><HUE start value></code>, a HUE value <code>0-360</code>, example: 240 for blue.</li>
<li><code><HUE end value></code>, a HUE value <code>0-360</code>, example: 360 for red.</li>
<li><code><minimal value></code>, the HUE start value will be scaled to it, example: 7.</li>
<li><code><maximal value></code>, the HUE end value will be scaled to it, example: 30.</li>
<li><code><step width></code>, for each step a color number will be generated, example: 1.</li>
<li><code><saturation></code>, a value of saturation <code>0-100</code>, example: 80.</li>
<li><code><lightness></code>, a value of lightness <code>0-100</code>, example: 80.</li>
</ul>
Example specification: <code>240,360,7,30,1,80,80</code>
<pre>";
return $ret
}
} elsif ($arg eq "modelColorGradient") {
my $err_ret = $DE ? "<br></pre>
Falsche Eingabe: <code>$value</code><br>
Syntax: <code><Minimalwert>,<Zwischenwert>,<Maximalwert>,<Schrittweite><Farbmodel></code><br>
<ul>
<li><code><Minimalwert></code>, der Minimalwert auf den die Startfarbnummer skaliert wird, Beispiel: 7.</li>
<li><code><Zwischenwert></code>, der Fixpunkt zwischen Start- u. Endwert, Beispiel: 20.</li>
<li><code><Maximalwert></code>, der Maximalwert auf den die Endfarbnummer skaliert wird, Beispiel: 30.</li>
<li><code><Schrittweite></code>, für jeden Schritt wird ein Farbwert erzeugt, Beispiel: 1.</li>
<li><code><Farbmodel></code>, die Angabe eines vordefinierten Modells <code><0|1|2></code> oder fünf RGB-Werte <br>als Array <code>[r1,g1,b1,r2,g2,b2,r3,g3,b3,r4,g4,b4,r5,g5,b5]</code> für ein eigenes Model.</li>
</ul>
Beispiele:<br>
<code>30,60,100,5,[255,255,0,127,255,0,0,255,0,0,255,255,0,127,255]</code>, z.B. Luftfeuchte<br>
<code>7,20,30,1,[0,0,255,63,0,192,127,0,127,192,0,63,255,0,0]</code>, z.B. Temperatur<br>
<code>0,2.6,5.2,0.0625,[192,0,0,208,63,0,224,127,0,240,192,0,255,255,0]</code>, z.B. Exponent der Helligkeit<br>
<code>7,20,30,1,0</code>
<pre>":"<br></pre>
Wrong input: <code>$value</code><br>
Syntax: <code><minimal value>,<middle value>,<maximal value>,<step width>,<color model></code><br>
<ul>
<li><code><minimal value></code>, the start color number will be scaled to it, example: 7.</li>
<li><code><middle value></code>, a fix point between min and max, example: 20.</li>
<li><code><maximal value></code>, the end color number will be scaled to it, example: 30.</li>
<li><code><step width></code>, for each step a color number will be generated, example: 1.</li>
<li><code><color model></code>, a predefined number <0|1|2> or an array of five RGB values, <br><code>[r1,g1,b1,r2,g2,b2,r3,g3,b3,r4,g4,b4,r5,g5,b5]</code></li>
</ul>
Example specifications:<br>
<code>0,50,100,5,[255,255,0,127,255,0,0,255,0,0,255,255,0,127,255]</code> e.g. humidity<br>
<code>7,20,30,1,[0,0,255,63,0,192,127,0,127,192,0,63,255,0,0]</code>, e.g. temperature<br>
<code>0,2.6,5.2,0.0625,[192,0,0,208,63,0,224,127,0,240,192,0,255,255,0]</code>, e.g. brightness exponent<br>
<code>7,20,30,1,0</code>
<pre>";
return $err_ret if (!$value);
my ($min,$mid,$max,$step,$colors);
my $err = "";
$value =~ s/,(\[.*\])//;
if ($1) {
$colors = eval($1);
if ($@) {
$err="Error eval 1567: $@\n".$err_ret;
Log3 $hash->{NAME},3,"modelColorGradient \n".$err;
return $err;
}
($min,$mid,$max,$step) = split(",",$value);
} else {
($min,$mid,$max,$step,$colors) = split(",",$value);
}
return $err_ret if ($min>=$mid or $mid >= $max or $step <= 0 or (ref($colors) ne "ARRAY" && $colors !~ "0|1|2"));
my $erg=eval("\"".Color::pahColor($min,$mid,$max,$min+$step,$colors)."\"");
if ($@) {
$err="Error eval 1577: $@\n".$err_ret;
Log3 $hash->{NAME},3,"modelColorGradient \n".$err;
return $err;
}
$ret .= "<br></pre><table>";
$ret .= "<tr><td colspan=4 style='font-weight:bold;'>Color Table</td></tr>";
$ret .= "<tr><td colspan=4><div>";
for (my $i=0;$i<=127;$i++) {
my $col = eval("\"".Color::pahColor($min,$mid,$max,$min+$i*($max-$min)/127,$colors)."\"");
if ($@) {
$err="Error eval 1567: $@\n".$err_ret;
Log3 $hash->{NAME},3,"modelColorGradient \n".$err;
return $err;
}
$col = "#".substr($col,0,6);
$ret .= "<span style='background-color:$col;'> </span>";
}
$ret .= "</div></td></tr>";
$ret .= "<tr style='text-align:center;'><td> Value </td><td> Color Number </td><td> RGB values </td><td> Color</td> </tr>";
for (my $i=$min;$i<=$max;$i+=$step) {
my $col = eval("\"".Color::pahColor($min,$mid,$max,$i,$colors)."\"");
if ($@) {
$err="Error eval 1567: $@\n".$err_ret;
Log3 $hash->{NAME},3,"modelColorGradient \n".$err;
return $err;
}
$col = "#".substr($col,0,6);
$col =~ /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/;
$ret .= "<tr style='text-align:center;'><td>".sprintf("%.1f",$i)."</td><td>$col</td><td> ".hex($1).",".hex($2).",".hex($3)." </td><td style='background-color:$col;'>      </td></tr>";
}
$ret .= "</table><pre>";
return $ret;
} else {
my $hardcoded = "checkDOIF:noArg statisticsReport:noArg runningTimerInDOIF:noArg";
return "unknown argument $arg for $pn, choose one of readingsGroup_for:multiple-strict,$dL DOIF_to_Log:multiple-strict,$dL SetAttrIconForDOIF:multiple-strict,$dL userReading_nextTimer_for:multiple-strict,$ntL ".(AttrVal($pn,"DOIFtoolsHideGetSet",0) ? $hardcoded :"")." linearColorGradient:textField modelColorGradient:textField hsvColorGradient:textField";
}
return $ret;
}
1;
=pod
=item helper
=item summary tools to support DOIF
=item summary_DE Werkzeuge zur Unterstützung von DOIF
=begin html
<a name="DOIFtools"></a>
<h3>DOIFtools</h3>
<ul>
DOIFtools contains tools to support DOIF.<br>
<br>
<ul>
<li>create readingsGroup definitions for labeling frontend widgets.</li>
<li>create a debug logfile for some DOIF and quoted devices with optional device listing each state or wait timer update.</li>
<li>optional device listing in debug logfile each state or wait timer update.</li>
<li>navigation between device listings in logfile if opened via DOIFtools.</li>
<li>create userReadings in DOIF devices displaying real dates for weekday restricted timer.</li>
<li>delete user defined readings in DOIF devices with multiple choice.</li>
<li>delete visible readings in other devices with multiple choice, but not <i>state</i>.</li>
<li>record statistics data about events.</li>
<li>limitting recordig duration.</li>
<li>generate a statistics report.</li>
<li>lists every DOIF definition in <i>probably associated with</i>.</li>
<li>access to DOIFtools from any DOIF device via <i>probably associated with</i></li>
<li>access from DOIFtools to existing DOIFtoolsLog logfiles</li>
<li>show event monitor in device detail view and optionally in DOIFs detail view</li>
<li>convert events to DOIF operands, a selected operand is copied to clipboard and the DEF editor will open</li>
<li>check definitions and offer recommendations for DOIF MODEL FHEM</li>
<li>create shortcuts</li>
<li>optionally create a menu entry</li>
<li>show a list of running wait timer</li>
<li>scale values to color numbers and RGB values for coloration</li>
</ul>
<br>
Just one definition per FHEM-installation is allowed. <a href="https://fhem.de/commandref_DE.html#DOIFtools">More in the german section.</a>
<br>
</ul>
=end html
=begin html_DE
<a name="DOIFtools"></a>
<h3>DOIFtools</h3>
<ul>
DOIFtools stellt Funktionen zur Unterstützung von DOIF-Geräten bereit.<br>
<br>
<ul>
<li>erstellen von readingsGroup Definitionen, zur Beschriftung von Frontendelementen.</li>
<li>erstellen eines Debug-Logfiles, in dem mehrere DOIF und zugehörige Geräte geloggt werden.</li>
<li>optionales DOIF-Listing bei jeder Status und Wait-Timer Aktualisierung im Debug-Logfile.</li>
<li>Navigation zwischen den DOIF-Listings im Logfile, wenn es über DOIFtools geöffnet wird.</li>
<li>erstellen von userReadings in DOIF-Geräten zur Anzeige des realen Datums bei Wochentag behafteten Timern.</li>
<li>löschen von benutzerdefinierten Readings in DOIF-Definitionen über eine Mehrfachauswahl.</li>
<li>löschen von Readings in anderen Geräten über eine Mehrfachauswahl, nicht <i>state</i>.</li>
<li>erfassen statistischer Daten über Events.</li>
<li>Begrenzung der Datenaufzeichnungsdauer.</li>
<li>erstellen eines Statistikreports.</li>
<li>Liste aller DOIF-Definitionen in <i>probably associated with</i>.</li>
<li>Zugriff auf DOIFtools aus jeder DOIF-Definition über die Liste in <i>probably associated with</i>.</li>
<li>Zugriff aus DOIFtools auf vorhandene DOIFtoolsLog-Logdateien.</li>
<li>zeigt den Event Monitor in der Detailansicht von DOIFtools.</li>
<li>ermöglicht den Zugriff auf den Event Monitor in der Detailansicht von DOIF.</li>
<li>erzeugt DOIF-Operanden aus einer Event-Zeile des Event-Monitors.</li>
<ul>
<li>Ist der <b>Event-Monitor in DOIF</b> geöffnet, dann kann die Definition des <b>DOIF geändert</b> werden.</li>
<li>Ist der <b>Event-Monitor in DOIFtools</b> geöffnet, dann kann die Definition eines <b>DOIF erzeugt</b> werden.</li>
</ul>
<li>prüfen der Definitionen mit Empfehlungen für DOIF-Modus FHEM.</li>
<li>erstellen von Shortcuts</li>
<li>optionalen Menüeintrag erstellen</li>
<li>Liste der laufenden Wait-Timer anzeigen</li>
<li>skaliert Werte zu Farbnummern und RGB Werten zum Einfärben, z.B. von Icons.</li>
</ul>
<br>
<b>Inhalt</b><br>
<ul>
<a href="#DOIFtoolsBedienungsanleitung">Bedienungsanleitung</a><br>
<a href="#DOIFtoolsDefinition">Definition</a><br>
<a href="#DOIFtoolsSet">Set-Befehl</a><br>
<a href="#DOIFtoolsGet">Get-Befehl</a><br>
<a href="#DOIFtoolsAttribute">Attribute</a><br>
<a href="#DOIFtoolsReadings">Readings</a><br>
<a href="#DOIFtoolsLinks">Links</a><br>
</ul><br>
<a name="DOIFtoolsBedienungsanleitung"></a>
<b>Bedienungsanleitung</b>
<br>
<ul>
Eine <a href="https://wiki.fhem.de/wiki/DOIFtools">Bedienungsanleitung für DOIFtools</a> gibt es im FHEM-Wiki.
</ul>
<br>
<a name="DOIFtoolsDefinition"></a>
<b>Definition</b>
<br>
<ul>
<code>define <name> DOIFtools</code><br>
Es ist nur eine Definition pro FHEM Installation möglich. Die Definition wird mit den vorhanden DOIF-Namen ergänzt, daher erscheinen alle DOIF-Geräte in der Liste <i>probably associated with</i>. Zusätzlich wird in jedem DOIF-Gerät in dieser Liste auf das DOIFtool verwiesen.<br>
<br>
<u>Definitionsvorschlag</u> zum Import mit <a href="https://wiki.fhem.de/wiki/DOIF/Import_von_Code_Snippets">Raw definition</a>:<br>
<code>
defmod DOIFtools DOIFtools<br>
attr DOIFtools DOIFtoolsEventMonitorInDOIF 1<br>
attr DOIFtools DOIFtoolsExecuteDefinition 1<br>
attr DOIFtools DOIFtoolsExecuteSave 1<br>
attr DOIFtools DOIFtoolsMenuEntry 1<br>
attr DOIFtools DOIFtoolsMyShortcuts ##My Shortcuts:,,list DOIFtools,fhem?cmd=list DOIFtools,remove_DOIFtoolsLog,fhem?cmd=delete DOIFtoolsLog;%22rm ./log/DOIFtoolsLog*.log%22<br>
</code>
</ul>
<br>
<a name="DOIFtoolsSet"></a>
<b>Set</b>
<br>
<ul>
<li><a name="deleteReadingInTargetDOIF"></a>
<code>set <name> deleteReadingInTargetDOIF <readings to delete name></code><br>
<b>deleteReadingInTargetDOIF</b> löscht die benutzerdefinierten Readings im Ziel-DOIF<br>
<br>
</li><li><a name="targetDOIF"></a>
<code>set <name> targetDOIF <target name></code><br>
<b>targetDOIF</b> vor dem Löschen der Readings muss das Ziel-DOIF gesetzt werden.<br>
<br>
</li><li><a name="deleteReadingInTargetDevice"></a>
<code>set <name> deleteReadingInTargetDevice <readings to delete name></code><br>
<b>deleteReadingInTargetDevice</b> löscht sichtbare Readings, ausser <i>state</i> im Ziel-Gerät. Bitte den Gefahrenhinweis zum Befehl <i>deletereading</i> beachten ! <a href="https://fhem.de/commandref_DE.html#deletereading">Commandref#deletereading</a><br>
<br>
</li><li><a name="targetDevice"></a>
<code>set <name> targetDevice <target name></code><br>
<b>targetDevice</b> vor dem Löschen der Readings muss das Ziel-Gerät gesetzt werden.<br>
<br>
</li><li><a name="sourceAttribute"></a>
<code>set <name> sourceAttribute <readingList> </code><br>
<b>sourceAttribute</b> vor dem Erstellen einer ReadingsGroup muss das Attribut gesetzt werden aus dem die Readings gelesen werden, um die ReadingsGroup zu erstellen und zu beschriften. <b>Default, readingsList</b><br>
<br>
</li><li><a name="statisticsDeviceFilterRegex"></a>
<code>set <name> statisticsDeviceFilterRegex <regular expression as device filter></code><br>
<b>statisticsDeviceFilterRegex</b> setzt einen Filter auf Gerätenamen, nur die gefilterten Geräte werden im Bericht ausgewertet. <b>Default, ".*"</b>.<br>
<br>
</li><li><a name="statisticsTYPEs"></a>
<code>set <name> statisticsTYPEs <List of TYPE used for statistics generation></code><br>
<b>statisticsTYPEs</b> setzt eine Liste von TYPE für die Statistikdaten erfasst werden, bestehende Statistikdaten werden gelöscht. <b>Default, ""</b>.<br>
<br>
</li><li><a name="statisticsShowRate_ge"></a>
<code>set <name> statisticsShowRate_ge <integer value for event rate></code><br>
<b>statisticsShowRate_ge</b> setzt eine Event-Rate, ab der ein Gerät in die Auswertung einbezogen wird. <b>Default, 0</b>.<br>
<br>
</li><li><a name="specialLog"></a>
<code>set <name> specialLog <0|1></code><br>
<b>specialLog</b> <b>1</b> DOIF-Listing bei Status und Wait-Timer Aktualisierung im Debug-Logfile. <b>Default, 0</b>.<br>
<br>
</li><li><a name="doStatistics"></a>
<code>set <name> doStatistics <enabled|disabled|deleted></code><br>
<b>doStatistics</b><br>
 <b>deleted</b> setzt die Statistik zurück und löscht alle <i>stat_</i> Readings.<br>
 <b>disabled</b> pausiert die Statistikdatenerfassung.<br>
 <b>enabled</b> startet die Statistikdatenerfassung.<br>
<br>
</li><li><a name="recording_target_duration"></a>
<code>set <name> recording_target_duration <hours></code><br>
<b>recording_target_duration</b> gibt an wie lange Daten erfasst werden sollen. <b>Default, 0</b> die Dauer ist nicht begrenzt.<br>
<br>
</li> </ul>
<a name="DOIFtoolsGet"></a>
<b>Get</b>
<br>
<ul>
<li><a name="DOIF_to_Log"></a>
<code>get <name> DOIF_to_Log <DOIF names for logging></code><br>
<b>DOIF_to_Log</b> erstellt eine FileLog-Definition, die für alle angegebenen DOIF-Definitionen loggt. Der <i>Reguläre Ausdruck</i> wird aus den, direkt in den DOIF-Greräte angegebenen und den wahrscheinlich verbundenen Geräten, ermittelt.<br>
<br>
</li><li><a name="checkDOIF"></a>
<code>get <name> checkDOIF</code><br>
<b>checkDOIF</b> führt eine einfache Syntaxprüfung durch und empfiehlt Änderungen für DOIF-Modus FHEM.<br>
<br>
</li><li><a name="readingsGroup_for"></a>
<code>get <name> readingsGroup_for <DOIF names to create readings groups></code><br>
<b>readingsGroup_for</b> erstellt readingsGroup-Definitionen für die angegebenen DOIF-namen. <b>sourceAttribute</b> verweist auf das Attribut, dessen Readingsliste als Basis verwendet wird. Die Eingabeelemente im Frontend werden mit den Readingsnamen beschriftet.<br>
<br>
</li><li><a name="userReading_nextTimer_for"></a>
<code>get <name> userReading_nextTimer_for <DOIF names where to create real date timer readings></code><br>
<b>userReading_nextTimer_for</b> erstellt userReadings-Attribute für Timer-Readings mit realem Datum für Timer, die mit Wochentagangaben angegeben sind, davon ausgenommen sind indirekte Wochentagsangaben.<br>
<br>
</li><li><a name="statisticsReport"></a>
<code>get <name> statisticsReport </code><br>
<b>statisticsReport</b> erstellt einen Bericht aus der laufenden Datenerfassung.<br><br>Die Statistik kann genutzt werden, um Geräte mit hohen Ereignisaufkommen zu erkennen. Bei einer hohen Rate, sollte im Interesse der Systemperformance geprüft werden, ob die Events eingeschränkt werden können. Werden keine Events eines Gerätes weiterverarbeitet, kann das Attribut <i>event-on-change-reading</i> auf <i>none</i> oder eine andere Zeichenfolge, die im Gerät nicht als Readingname vorkommt, gesetzt werden.<a href="https://wiki.fhem.de/wiki/Event">FHEM-Wiki: Events</a><br>
<br>
</li><li><a name="runningTimerInDOIF"></a>
<code>get <name> runningTimerInDOIF</code><br>
<b>runningTimerInDOIF</b> zeigt eine Liste der laufenden Timer. Damit kann entschieden werden, ob bei einem Neustart wichtige Timer gelöscht werden und der Neustart ggf. verschoben werden sollte. Zeigt nachrichtlich das Ergebnis von blockinginfo an.<br>
<br>
</li><li><a name="SetAttrIconForDOIF"></a>
<code>get <name> SetAttrIconForDOIF <DOIF names for setting the attribute icon to helper_doif></code><br>
<b>SetAttrIconForDOIF</b> setzt für die ausgewählten DOIF das Attribut <i>icon</i> auf <i>helper_doif</i>.<br>
<br>
</li><li><a name="linearColorGradient"></a>
<code>get <name> linearColorGradient <start color number>,<end color number>,<minimal value>,<maximal value>,<step width></code><br>
<b>linearColorGradient</b> erzeugt eine Tabelle mit linear abgestuften Farbnummern und RGB-Werten.<br>
<start color number>, ist eine HTML-Farbnummer, Beispiel: #0000FF für Blau.<br>
<end color number>, , ist eine HTML-Farbnummer, Beispiel: #FF0000 für Rot.<br>
<minimal value>, der Minimalwert auf den die Startfarbnummer skaliert wird, Beispiel: 7.<br>
<maximal value>, der Maximalwert auf den die Endfarbnummer skaliert wird, Beispiel: 30.<br>
<step width>, für jeden Schritt wird ein Farbwert erzeugt, Beispiel: 0.5.
<br>
Beispiel: <code>get DOIFtools linearColorGradient #0000FF,#FF0000,7,30,0.5</code><br>
<br>
</li><li><a name="modelColorGradient"></a>
<code>get <name> modelColorGradient <minimal value>,<middle value>,<maximal value>,<step width>,<color model></code><br>
<b>modelColorGradient</b> erzeugt eine Tabelle mit modellbedingt abgestuften Farbnummern und RGB-Werten, siehe FHEM-Wiki Farbskala mit Color::pahColor<br>
<minimal value>, der Minimalwert auf den die Startfarbnummer skaliert wird, Beispiel: 7.<br>
<middle value>, der Mittenwert ist ein Fixpunkt zwischen Minimal- u. Maximalwert, Beispiel: 20.<br>
<maximal value>, der Maximalwert auf den die Endfarbnummer skaliert wird, Beispiel: 30.<br>
<step width>, für jeden Schritt wird ein Farbwert erzeugt, Beispiel: 1.<br>
<color model>, die Angabe eines vordefinierten Modells <0|1|2> oder fünf RGB-Werte als Array [r1,g1,b1,r2,g2,b2,r3,g3,b3,r4,g4,b4,r5,g5,b5] für ein eigenes Model.<br>
<br>
Beispiele:<br>
<code>get DOIFtools modelColorGradient 7,20,30,1,0</code><br>
<code>get DOIFtools modelColorGradient 0,50,100,5,[255,255,0,127,255,0,0,255,0,0,255,255,0,127,255]</code><br>
<a href="https://wiki.fhem.de/wiki/Color#Farbskala_mit_Color::pahColor"> Farbskala mit Color::pahColor </a><br>
<br>
</li><li><a name="hsvColorGradient"></a>
<code>get <name> hsvColorGradient <HUE start value>,<HUE end value>,<minimal value>,<maximal value>,<step width>,<saturation>,<lightness></code><br>
<b>hsvColorGradient</b> erzeugt eine Tabelle über HUE-Werte abgestufte Farbnummern und RGB-Werten.<br>
<Hue start value>, der HUE-Startwert, Beispiel: 240 für Blau.<br>
<HUE end value>, der HUE-Endwert, Beispiel: 360 für Rot.<br>
<minimal value>, der Minimalwert auf den der HUE-Startwert skaliert wird, Beispiel: 7.<br>
<maximal value>, der Maximalwert auf den der HUE-Endwert skaliert wird, Beispiel: 30.<br>
<step width>, für jeden Schritt wird ein Farbwert erzeugt, Beispiel: 1.<br>
<saturation>, die Angabe eines Wertes für die Farbsättigung <0-100>, Beispiel 80.<br>
<lightness>, die Angabe eines Wertes für die Helligkeit <0-100>, Beispiel 80.<br>
<br>
Beispiele:<br>
<code>get DOIFtools hsvColorGradient 240,360,7,30,1,80,80</code><br>
<br>
</li> </ul>
<a name="DOIFtoolsAttribute"></a>
<b>Attribute</b><br>
<ul>
<li><a name="DOIFtoolsExecuteDefinition"></a>
<code>attr <name> DOIFtoolsExecuteDefinition <0|1></code><br>
<b>DOIFtoolsExecuteDefinition</b> <b>1</b> führt die erzeugten Definitionen aus. <b>Default 0</b>, zeigt die erzeugten Definitionen an, sie können mit <i>Raw definition</i> importiert werden.<br>
<br>
</li><li><a name="DOIFtoolsExecuteSave"></a>
<code>attr <name> DOIFtoolsExecuteSave <0|1></code><br>
<b>DOIFtoolsExecuteSave</b> <b>1</b>, die Definitionen werden automatisch gespeichert. <b>Default 0</b>, der Benutzer kann die Definitionen speichern.<br>
<br>
</li><li><a name="DOIFtoolsTargetGroup"></a>
<code>attr <name> DOIFtoolsTargetGroup <group names for target></code><br>
<b>DOIFtoolsTargetGroup</b> gibt die Gruppen für die zu erstellenden Definitionen an. <b>Default</b>, die Gruppe der Ursprungs Definition.<br>
<br>
</li><li><a name="DOIFtoolsTargetRoom"></a>
<code>attr <name> DOIFtoolsTargetRoom <room names for target></code><br>
<b>DOIFtoolsTargetRoom</b> gibt die Räume für die zu erstellenden Definitionen an. <b>Default</b>, der Raum der Ursprungs Definition.<br>
<br>
</li><li><a name="DOIFtoolsReadingsPrefix"></a>
<code>attr <name> DOIFtoolsReadingsPrefix <user defined prefix></code><br>
<b>DOIFtoolsReadingsPrefix</b> legt den Präfix der benutzerdefinierten Readingsnamen für die Zieldefinition fest. <b>Default</b>, DOIFtools bestimmt den Präfix.<br>
<br>
</li><li><a name="DOIFtoolsEventMonitorInDOIF"></a>
<code>attr <name> DOIFtoolsEventMonitorInDOIF <1|0></code><br>
<b>DOIFtoolsEventMonitorInDOIF</b> <b>1</b>, die Anzeige des Event-Monitors wird in DOIF ermöglicht. <b>Default 0</b>, kein Zugriff auf den Event-Monitor im DOIF.<br>
<br>
</li><li><a name="DOIFtoolsEMbeforeReadings"></a>
<code>attr <name> DOIFtoolsEMbeforeReadings <1|0></code><br>
<b>DOIFtoolsEMbeforeReading</b> <b>1</b>, die Anzeige des Event-Monitors wird in DOIF direkt über den Readings angezeigt. <b>Default 0</b>, anzeige des Event-Monitors über den Internals.<br>
<br>
</li><li><a name="DOIFtoolsHideGetSet"></a>
<code>attr <name> DOIFtoolsHideGetSet <0|1></code><br>
<b>DOIFtoolsHideGetSet</b> <b>1</b>, verstecken der Set- und Get-Shortcuts. <b>Default 0</b>.<br>
<br>
</li><li><a name="DOIFtoolsNoLookUp"></a>
<code>attr <name> DOIFtoolsNoLookUp <0|1></code><br>
<b>DOIFtoolsNoLookUp</b> <b>1</b>, es werden keine Lookup-Fenster in DOIFtools geöffnet. <b>Default 0</b>.<br>
<br>
</li><li><a name="DOIFtoolsNoLookUpInDOIF"></a>
<code>attr <name> DOIFtoolsNoLookUpInDOIF <0|1></code><br>
<b>DOIFtoolsNoLookUpInDOIF</b> <b>1</b>, es werden keine Lookup-Fenster in DOIF geöffnet. <b>Default 0</b>.<br>
<br>
</li><li><a name="DOIFtoolsHideModulShortcuts"></a>
<code>attr <name> DOIFtoolsHideModulShortcuts <0|1></code><br>
<b>DOIFtoolsHideModulShortcuts</b> <b>1</b>, verstecken der DOIFtools Shortcuts. <b>Default 0</b>.<br>
<br>
</li><li><a name="DOIFtoolsHideStatReadings"></a>
<code>attr <name> DOIFtoolsHideStatReadings <0|1></code><br>
<b>DOIFtoolsHideStatReadings</b> <b>1</b>, verstecken der <i>stat_</i> Readings. Das Ändern des Attributs löscht eine bestehende Event-Aufzeichnung. <b>Default 0</b>.<br>
<br>
</li><li><a name="DOIFtoolsEventOnDeleted"></a>
<code>attr <name> DOIFtoolsEventOnDeleted <0|1></code><br>
<b>DOIFtoolsEventOnDeleted</b> <b>1</b>, es werden Events für alle <i>stat_</i> erzeugt, bevor sie gelöscht werden. Damit könnten die erfassten Daten geloggt werden. <b>Default 0</b>.<br>
<br>
</li><li><a name="DOIFtoolsMyShortcuts"></a>
<code>attr <name> DOIFtoolsMyShortcuts <shortcut name>,<command>, ...</code><br>
<b>DOIFtoolsMyShortcuts</b> <Bezeichnung><b>,</b><Befehl><b>,...</b> anzeigen eigener Shortcuts, siehe globales Attribut <i>menuEntries</i>.<br>
Zusätzlich gilt, wenn ein Eintrag mit ## beginnt und mit ,, endet, wird er als HTML interpretiert.<br>
<u>Beispiel:</u><br>
<code>attr DOIFtools DOIFtoolsMyShortcuts ##<br>My Shortcuts:,,list DOIFtools,fhem?cmd=list DOIFtools</code><br>
<a href="#menuEntries">menuEntries</a><br>
</li><li><a name="DOIFtoolsMenuEntry"></a>
<code>attr <name> DOIFtoolsMenuEntry <0|1></code><br>
<b>DOIFtoolsMenuEntry</b> <b>1</b>, erzeugt einen Menüeintrag im FHEM-Menü. <b>Default 0</b>.<br>
<br>
</li><li><a name="DOIFtoolsLogDir"></a>
<code>attr <name> DOIFtoolsLogDir <path to DOIFtools logfile></code><br>
<b>DOIFtoolsLogDir</b> <b><path></b>, gibt den Pfad zum Logfile an <b>Default <i>./log</i> oder der Pfad aus dem Attribut <i>global logdir</i></b>.<br>
<br>
<a href="#disabledForIntervals"><b>disabledForIntervals</b></a> pausiert die Statistikdatenerfassung.<br>
<br>
</li> </ul>
<a name="DOIFtoolsReadings"></a>
<b>Readings</b>
<br>
<ul>
DOIFtools erzeugt bei der Aktualisierung von Readings keine Events, daher muss die Seite im Browser aktualisiert werden, um aktuelle Werte zu sehen.<br>
<br>
<li><b>Action</b> zeigt den Status der Event-Aufzeichnung an.</li>
<li><b>DOIF_version</b> zeigt die Version des DOIF an.</li>
<li><b>FHEM_revision</b> zeigt die Revision von FHEM an.</li>
<li><b>doStatistics</b> zeigt den Status der Statistikerzeugung an</li>
<li><b>logfile</b> gibt den Pfad und den Dateinamen mit Ersetzungszeichen an.</li>
<li><b>recording_target_duration</b> gibt an wie lange Daten erfasst werden sollen.</li>
<li><b>stat_</b><<b>devicename</b>> zeigt die Anzahl der gezählten Ereignisse, die das jeweilige Gerät erzeugt hat.</li>
<li><b>statisticHours</b> zeigt die kumulierte Zeit für den Status <i>enabled</i> an, während der, Statistikdaten erfasst werden.</li>
<li><b>statisticShowRate_ge</b> zeigt die Event-Rate, ab der Geräte in die Auswertung einbezogen werden.</li>
<li><b>statisticsDeviceFilterRegex</b> zeigt den aktuellen Gerätefilterausdruck an.</li>
<li><b>statisticsTYPEs</b> zeigt eine Liste von <i>TYPE</i> an, für deren Geräte die Statistik erzeugt wird.</li>
<li><b>targetDOIF</b> zeigt das Ziel-DOIF, bei dem Readings gelöscht werden sollen.</li>
<li><b>targetDevice</b> zeigt das Ziel-Gerät, bei dem Readings gelöscht werden sollen.</li>
</ul>
</br>
<a name="DOIFtoolsLinks"></a>
<b>Links</b>
<br>
<ul>
<a href="https://forum.fhem.de/index.php/topic,63938.0.html">DOIFtools im FHEM-Forum</a><br>
<a href="https://wiki.fhem.de/wiki/DOIFtools">DOIFtools im FHEM-Wiki</a><br>
<br>
<a href="https://wiki.fhem.de/wiki/DOIF">DOIF im FHEM-Wiki</a><br>
<a href="https://wiki.fhem.de/wiki/DOIF/Einsteigerleitfaden,_Grundfunktionen_und_Erl%C3%A4uterungen#Erste_Schritte_mit_DOIF:_Zeit-_und_Ereignissteuerung">Erste Schritte mit DOIF</a><br>
<a href="https://wiki.fhem.de/wiki/DOIF/Einsteigerleitfaden,_Grundfunktionen_und_Erl%C3%A4uterungen">DOIF: Einsteigerleitfaden, Grundfunktionen und Erläuterungen</a><br>
<a href="https://wiki.fhem.de/wiki/DOIF/Labor_-_ausf%C3%BChrbare,_praxisnahe_Beispiele_als_Probleml%C3%B6sung_zum_Experimentieren">DOIF-Labor - ausführbare, praxisnahe Beispiele als Problemlösung zum Experimentieren</a><br>
<a href="https://wiki.fhem.de/wiki/DOIF/Tipps_zur_leichteren_Bedienung">DOIF: Tipps zur leichteren Bedienung</a><br>
<a href="https://wiki.fhem.de/wiki/DOIF/Tools_und_Fehlersuche">DOIF: Tools und Fehlersuche</a><br>
</ul>
</ul>
=end html_DE
=cut
| 54.075626 | 581 | 0.593287 |
73eda73f754072321174cd8099c03ff09ca72a3e | 187 | t | Perl | t/06_user_rc.t | bayashi/Config-CmdRC | f66b3e9b73f6e3df32224bee1d266902d2baeabb | [
"Artistic-1.0"
]
| 3 | 2015-12-03T02:17:23.000Z | 2020-07-11T16:02:54.000Z | t/06_user_rc.t | bayashi/Config-CmdRC | f66b3e9b73f6e3df32224bee1d266902d2baeabb | [
"Artistic-1.0"
]
| null | null | null | t/06_user_rc.t | bayashi/Config-CmdRC | f66b3e9b73f6e3df32224bee1d266902d2baeabb | [
"Artistic-1.0"
]
| null | null | null | use strict;
use warnings;
use Test::More;
BEGIN {
@ARGV = ('--rc' => 'share/dir1/.akirc');
}
use Config::CmdRC 'share/.foorc';
is RC->{bar}, undef;
is RC->{aki}, 1;
done_testing;
| 12.466667 | 44 | 0.59893 |
ed2b08b06141d4b843abbd87aab867094645e325 | 2,742 | t | Perl | S06-macros/quasi-blocks.t | SirBogman/roast | 0a0835a20951c93fea57a39dec1b2b8789d81fc5 | [
"Artistic-2.0"
]
| 1 | 2019-11-06T05:07:10.000Z | 2019-11-06T05:07:10.000Z | S06-macros/quasi-blocks.t | SirBogman/roast | 0a0835a20951c93fea57a39dec1b2b8789d81fc5 | [
"Artistic-2.0"
]
| null | null | null | S06-macros/quasi-blocks.t | SirBogman/roast | 0a0835a20951c93fea57a39dec1b2b8789d81fc5 | [
"Artistic-2.0"
]
| null | null | null | use v6;
use Test;
use experimental :macros;
plan 14;
# Just to avoid tedium, the macros in this file are
# named after Santa's reindeers.
{ # macro called like a sub
my $macro_visits;
macro dasher() {
$macro_visits++;
quasi {}
}
dasher();
is $macro_visits, 2, "calls to macro are at parse time";
dasher();
my $total_args;
macro dancer($a, $b?) {
$total_args++ if defined $a;
$total_args++ if defined $b;
quasi {}
}
dancer(17);
is $total_args, 3, "macro call with arguments works";
dancer(15, 10);
}
{ # macro called like a list prefix
my $macro_visits;
macro prancer() {
$macro_visits++;
quasi {}
}
prancer;
is $macro_visits, 2, "macro calls without parens work";
prancer;
my $total_args;
macro vixen($a, $b?) {
$total_args++ if defined $a;
$total_args++ if defined $b;
quasi {}
}
vixen 17;
is $total_args, 3, "macro call with arguments works";
vixen 15, 10;
}
# macro defined as an operator, and used as one
{
macro infix:<comet>($rhs, $lhs) { #OK not used
quasi { "comet!" }
}
my $result = 1 comet 2;
is $result, "comet!", "can define an entirely new operator";
}
{
macro infix:<+>($rhs, $lhs) {
quasi { "chickpeas" }
}
my $result = "grasshopper" + "motor oil";
is $result, "chickpeas", "can shadow an existing operator";
}
{
macro cupid {
my $a = "I'm cupid!";
quasi { $a }
}
my $result = cupid;
is $result, "I'm cupid!", "lexical lookup from quasi to macro works";
}
#?rakudo skip "Cannot resolve caller prefix:<++>(Mu)"
{
my $counter = 0;
macro donner {
quasi { ++$counter }
}
is donner, 1, "lexical lookup from quasi to outside macro works";
is donner, 2, "...twice";
}
{
macro blitzen($param) {
quasi { $param }
}
ok blitzen("onwards") ~~ AST,
"lexical lookup from quasi to macro params works";
}
{
macro id($param) { $param };
is id('x'), 'x', 'macro can return its param';
}
{
macro funny_nil { quasi { {;}() } }
is funny_nil(), Nil, 'Nil from an empty block turns into no code';
}
# RT #115500
{
macro rt115500v1() {
my $q1 = quasi { 6 };
my $q2 = quasi { 6 * 10 };
quasi { {{{$q1}}} + {{{$q2}}} }
};
is rt115500v1(), 66,
'addition of two quasis with arithmetical expressions works (1)';
macro rt115500v2() {
my $q1 = quasi { 5 + 1 };
my $q2 = quasi { 6 * 10 };
quasi { {{{$q1}}} + {{{$q2}}} }
};
is rt115500v2(), 66,
'addition of two quasis with arithmetical expressions works (2)';
}
| 20.014599 | 73 | 0.540846 |
ed436145972dae38f124216cd2247864724632d3 | 3,504 | pm | Perl | auto-lib/Paws/GroundStation/ConfigTypeData.pm | torrentalle/aws-sdk-perl | 70cc5c7b7a494e422f8412da619161a99de1f1ec | [
"Apache-2.0"
]
| null | null | null | auto-lib/Paws/GroundStation/ConfigTypeData.pm | torrentalle/aws-sdk-perl | 70cc5c7b7a494e422f8412da619161a99de1f1ec | [
"Apache-2.0"
]
| 1 | 2021-05-26T19:13:58.000Z | 2021-05-26T19:13:58.000Z | auto-lib/Paws/GroundStation/ConfigTypeData.pm | torrentalle/aws-sdk-perl | 70cc5c7b7a494e422f8412da619161a99de1f1ec | [
"Apache-2.0"
]
| null | null | null | package Paws::GroundStation::ConfigTypeData;
use Moose;
has AntennaDownlinkConfig => (is => 'ro', isa => 'Paws::GroundStation::AntennaDownlinkConfig', request_name => 'antennaDownlinkConfig', traits => ['NameInRequest']);
has AntennaDownlinkDemodDecodeConfig => (is => 'ro', isa => 'Paws::GroundStation::AntennaDownlinkDemodDecodeConfig', request_name => 'antennaDownlinkDemodDecodeConfig', traits => ['NameInRequest']);
has AntennaUplinkConfig => (is => 'ro', isa => 'Paws::GroundStation::AntennaUplinkConfig', request_name => 'antennaUplinkConfig', traits => ['NameInRequest']);
has DataflowEndpointConfig => (is => 'ro', isa => 'Paws::GroundStation::DataflowEndpointConfig', request_name => 'dataflowEndpointConfig', traits => ['NameInRequest']);
has TrackingConfig => (is => 'ro', isa => 'Paws::GroundStation::TrackingConfig', request_name => 'trackingConfig', traits => ['NameInRequest']);
has UplinkEchoConfig => (is => 'ro', isa => 'Paws::GroundStation::UplinkEchoConfig', request_name => 'uplinkEchoConfig', traits => ['NameInRequest']);
1;
### main pod documentation begin ###
=head1 NAME
Paws::GroundStation::ConfigTypeData
=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::GroundStation::ConfigTypeData object:
$service_obj->Method(Att1 => { AntennaDownlinkConfig => $value, ..., UplinkEchoConfig => $value });
=head3 Results returned from an API call
Use accessors for each attribute. If Att1 is expected to be an Paws::GroundStation::ConfigTypeData object:
$result = $service_obj->Method(...);
$result->Att1->AntennaDownlinkConfig
=head1 DESCRIPTION
Object containing the parameters for a C<Config>.
See the subtype definitions for what each type of C<Config> contains.
=head1 ATTRIBUTES
=head2 AntennaDownlinkConfig => L<Paws::GroundStation::AntennaDownlinkConfig>
Information about how AWS Ground Station should configure an antenna
for downlink during a contact.
=head2 AntennaDownlinkDemodDecodeConfig => L<Paws::GroundStation::AntennaDownlinkDemodDecodeConfig>
Information about how AWS Ground Station should congure an antenna for
downlink demod decode during a contact.
=head2 AntennaUplinkConfig => L<Paws::GroundStation::AntennaUplinkConfig>
Information about how AWS Ground Station should congure an antenna for
uplink during a contact.
=head2 DataflowEndpointConfig => L<Paws::GroundStation::DataflowEndpointConfig>
Information about the dataflow endpoint C<Config>.
=head2 TrackingConfig => L<Paws::GroundStation::TrackingConfig>
Object that determines whether tracking should be used during a contact
executed with this C<Config> in the mission profile.
=head2 UplinkEchoConfig => L<Paws::GroundStation::UplinkEchoConfig>
Information about an uplink echo C<Config>.
Parameters from the C<AntennaUplinkConfig>, corresponding to the
specified C<AntennaUplinkConfigArn>, are used when this
C<UplinkEchoConfig> is used in a contact.
=head1 SEE ALSO
This class forms part of L<Paws>, describing an object used in L<Paws::GroundStation>
=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
| 36.123711 | 200 | 0.763699 |
73db3c2b4e716b47d2ad26b2d2b409bfe5d4618a | 53,707 | pl | Perl | node_modules/grpc/third_party/boringssl/crypto/bn/asm/rsaz-avx2.pl | bharathappali/carousel-makeover | dd905a12ab6bda280fa79df289827e5f210722d7 | [
"Apache-2.0"
]
| 91 | 2018-11-24T05:33:58.000Z | 2022-03-16T05:58:05.000Z | node_modules/grpc/third_party/boringssl/crypto/bn/asm/rsaz-avx2.pl | bharathappali/carousel-makeover | dd905a12ab6bda280fa79df289827e5f210722d7 | [
"Apache-2.0"
]
| 11 | 2019-06-02T23:50:17.000Z | 2022-02-04T23:58:56.000Z | node_modules/grpc/third_party/boringssl/crypto/bn/asm/rsaz-avx2.pl | bharathappali/carousel-makeover | dd905a12ab6bda280fa79df289827e5f210722d7 | [
"Apache-2.0"
]
| 18 | 2018-11-24T10:35:29.000Z | 2021-04-22T07:22:10.000Z | #!/usr/bin/env perl
##############################################################################
# #
# Copyright (c) 2012, Intel Corporation #
# #
# All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions are #
# met: #
# #
# * Redistributions of source code must retain the above copyright #
# notice, this list of conditions and the following disclaimer. #
# #
# * Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in the #
# documentation and/or other materials provided with the #
# distribution. #
# #
# * Neither the name of the Intel Corporation nor the names of its #
# contributors may be used to endorse or promote products derived from #
# this software without specific prior written permission. #
# #
# #
# THIS SOFTWARE IS PROVIDED BY INTEL CORPORATION ""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 INTEL CORPORATION 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. #
# #
##############################################################################
# Developers and authors: #
# Shay Gueron (1, 2), and Vlad Krasnov (1) #
# (1) Intel Corporation, Israel Development Center, Haifa, Israel #
# (2) University of Haifa, Israel #
##############################################################################
# Reference: #
# [1] S. Gueron, V. Krasnov: "Software Implementation of Modular #
# Exponentiation, Using Advanced Vector Instructions Architectures", #
# F. Ozbudak and F. Rodriguez-Henriquez (Eds.): WAIFI 2012, LNCS 7369, #
# pp. 119?135, 2012. Springer-Verlag Berlin Heidelberg 2012 #
# [2] S. Gueron: "Efficient Software Implementations of Modular #
# Exponentiation", Journal of Cryptographic Engineering 2:31-43 (2012). #
# [3] S. Gueron, V. Krasnov: "Speeding up Big-numbers Squaring",IEEE #
# Proceedings of 9th International Conference on Information Technology: #
# New Generations (ITNG 2012), pp.821-823 (2012) #
# [4] S. Gueron, V. Krasnov: "[PATCH] Efficient and side channel analysis #
# resistant 1024-bit modular exponentiation, for optimizing RSA2048 #
# on AVX2 capable x86_64 platforms", #
# http://rt.openssl.org/Ticket/Display.html?id=2850&user=guest&pass=guest#
##############################################################################
#
# +13% improvement over original submission by <appro@openssl.org>
#
# rsa2048 sign/sec OpenSSL 1.0.1 scalar(*) this
# 2.3GHz Haswell 621 765/+23% 1113/+79%
# 2.3GHz Broadwell(**) 688 1200(***)/+74% 1120/+63%
#
# (*) if system doesn't support AVX2, for reference purposes;
# (**) scaled to 2.3GHz to simplify comparison;
# (***) scalar AD*X code is faster than AVX2 and is preferred code
# path for Broadwell;
$flavour = shift;
$output = shift;
if ($flavour =~ /\./) { $output = $flavour; undef $flavour; }
$win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/);
$0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
( $xlate="${dir}x86_64-xlate.pl" and -f $xlate ) or
( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
die "can't locate x86_64-xlate.pl";
# In upstream, this is controlled by shelling out to the compiler to check
# versions, but BoringSSL is intended to be used with pre-generated perlasm
# output, so this isn't useful anyway.
#
# TODO(davidben): Enable these after testing. $avx goes up to 2 and $addx to 1.
$avx = 0;
$addx = 0;
open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\"";
*STDOUT = *OUT;
if ($avx>1) {{{
{ # void AMS_WW(
my $rp="%rdi"; # BN_ULONG *rp,
my $ap="%rsi"; # const BN_ULONG *ap,
my $np="%rdx"; # const BN_ULONG *np,
my $n0="%ecx"; # const BN_ULONG n0,
my $rep="%r8d"; # int repeat);
# The registers that hold the accumulated redundant result
# The AMM works on 1024 bit operands, and redundant word size is 29
# Therefore: ceil(1024/29)/4 = 9
my $ACC0="%ymm0";
my $ACC1="%ymm1";
my $ACC2="%ymm2";
my $ACC3="%ymm3";
my $ACC4="%ymm4";
my $ACC5="%ymm5";
my $ACC6="%ymm6";
my $ACC7="%ymm7";
my $ACC8="%ymm8";
my $ACC9="%ymm9";
# Registers that hold the broadcasted words of bp, currently used
my $B1="%ymm10";
my $B2="%ymm11";
# Registers that hold the broadcasted words of Y, currently used
my $Y1="%ymm12";
my $Y2="%ymm13";
# Helper registers
my $TEMP1="%ymm14";
my $AND_MASK="%ymm15";
# alu registers that hold the first words of the ACC
my $r0="%r9";
my $r1="%r10";
my $r2="%r11";
my $r3="%r12";
my $i="%r14d"; # loop counter
my $tmp = "%r15";
my $FrameSize=32*18+32*8; # place for A^2 and 2*A
my $aap=$r0;
my $tp0="%rbx";
my $tp1=$r3;
my $tpa=$tmp;
$np="%r13"; # reassigned argument
$code.=<<___;
.text
.globl rsaz_1024_sqr_avx2
.type rsaz_1024_sqr_avx2,\@function,5
.align 64
rsaz_1024_sqr_avx2: # 702 cycles, 14% faster than rsaz_1024_mul_avx2
lea (%rsp), %rax
push %rbx
push %rbp
push %r12
push %r13
push %r14
push %r15
vzeroupper
___
$code.=<<___ if ($win64);
lea -0xa8(%rsp),%rsp
vmovaps %xmm6,-0xd8(%rax)
vmovaps %xmm7,-0xc8(%rax)
vmovaps %xmm8,-0xb8(%rax)
vmovaps %xmm9,-0xa8(%rax)
vmovaps %xmm10,-0x98(%rax)
vmovaps %xmm11,-0x88(%rax)
vmovaps %xmm12,-0x78(%rax)
vmovaps %xmm13,-0x68(%rax)
vmovaps %xmm14,-0x58(%rax)
vmovaps %xmm15,-0x48(%rax)
.Lsqr_1024_body:
___
$code.=<<___;
mov %rax,%rbp
mov %rdx, $np # reassigned argument
sub \$$FrameSize, %rsp
mov $np, $tmp
sub \$-128, $rp # size optimization
sub \$-128, $ap
sub \$-128, $np
and \$4095, $tmp # see if $np crosses page
add \$32*10, $tmp
shr \$12, $tmp
vpxor $ACC9,$ACC9,$ACC9
jz .Lsqr_1024_no_n_copy
# unaligned 256-bit load that crosses page boundary can
# cause >2x performance degradation here, so if $np does
# cross page boundary, copy it to stack and make sure stack
# frame doesn't...
sub \$32*10,%rsp
vmovdqu 32*0-128($np), $ACC0
and \$-2048, %rsp
vmovdqu 32*1-128($np), $ACC1
vmovdqu 32*2-128($np), $ACC2
vmovdqu 32*3-128($np), $ACC3
vmovdqu 32*4-128($np), $ACC4
vmovdqu 32*5-128($np), $ACC5
vmovdqu 32*6-128($np), $ACC6
vmovdqu 32*7-128($np), $ACC7
vmovdqu 32*8-128($np), $ACC8
lea $FrameSize+128(%rsp),$np
vmovdqu $ACC0, 32*0-128($np)
vmovdqu $ACC1, 32*1-128($np)
vmovdqu $ACC2, 32*2-128($np)
vmovdqu $ACC3, 32*3-128($np)
vmovdqu $ACC4, 32*4-128($np)
vmovdqu $ACC5, 32*5-128($np)
vmovdqu $ACC6, 32*6-128($np)
vmovdqu $ACC7, 32*7-128($np)
vmovdqu $ACC8, 32*8-128($np)
vmovdqu $ACC9, 32*9-128($np) # $ACC9 is zero
.Lsqr_1024_no_n_copy:
and \$-1024, %rsp
vmovdqu 32*1-128($ap), $ACC1
vmovdqu 32*2-128($ap), $ACC2
vmovdqu 32*3-128($ap), $ACC3
vmovdqu 32*4-128($ap), $ACC4
vmovdqu 32*5-128($ap), $ACC5
vmovdqu 32*6-128($ap), $ACC6
vmovdqu 32*7-128($ap), $ACC7
vmovdqu 32*8-128($ap), $ACC8
lea 192(%rsp), $tp0 # 64+128=192
vpbroadcastq .Land_mask(%rip), $AND_MASK
jmp .LOOP_GRANDE_SQR_1024
.align 32
.LOOP_GRANDE_SQR_1024:
lea 32*18+128(%rsp), $aap # size optimization
lea 448(%rsp), $tp1 # 64+128+256=448
# the squaring is performed as described in Variant B of
# "Speeding up Big-Number Squaring", so start by calculating
# the A*2=A+A vector
vpaddq $ACC1, $ACC1, $ACC1
vpbroadcastq 32*0-128($ap), $B1
vpaddq $ACC2, $ACC2, $ACC2
vmovdqa $ACC1, 32*0-128($aap)
vpaddq $ACC3, $ACC3, $ACC3
vmovdqa $ACC2, 32*1-128($aap)
vpaddq $ACC4, $ACC4, $ACC4
vmovdqa $ACC3, 32*2-128($aap)
vpaddq $ACC5, $ACC5, $ACC5
vmovdqa $ACC4, 32*3-128($aap)
vpaddq $ACC6, $ACC6, $ACC6
vmovdqa $ACC5, 32*4-128($aap)
vpaddq $ACC7, $ACC7, $ACC7
vmovdqa $ACC6, 32*5-128($aap)
vpaddq $ACC8, $ACC8, $ACC8
vmovdqa $ACC7, 32*6-128($aap)
vpxor $ACC9, $ACC9, $ACC9
vmovdqa $ACC8, 32*7-128($aap)
vpmuludq 32*0-128($ap), $B1, $ACC0
vpbroadcastq 32*1-128($ap), $B2
vmovdqu $ACC9, 32*9-192($tp0) # zero upper half
vpmuludq $B1, $ACC1, $ACC1
vmovdqu $ACC9, 32*10-448($tp1)
vpmuludq $B1, $ACC2, $ACC2
vmovdqu $ACC9, 32*11-448($tp1)
vpmuludq $B1, $ACC3, $ACC3
vmovdqu $ACC9, 32*12-448($tp1)
vpmuludq $B1, $ACC4, $ACC4
vmovdqu $ACC9, 32*13-448($tp1)
vpmuludq $B1, $ACC5, $ACC5
vmovdqu $ACC9, 32*14-448($tp1)
vpmuludq $B1, $ACC6, $ACC6
vmovdqu $ACC9, 32*15-448($tp1)
vpmuludq $B1, $ACC7, $ACC7
vmovdqu $ACC9, 32*16-448($tp1)
vpmuludq $B1, $ACC8, $ACC8
vpbroadcastq 32*2-128($ap), $B1
vmovdqu $ACC9, 32*17-448($tp1)
mov $ap, $tpa
mov \$4, $i
jmp .Lsqr_entry_1024
___
$TEMP0=$Y1;
$TEMP2=$Y2;
$code.=<<___;
.align 32
.LOOP_SQR_1024:
vpbroadcastq 32*1-128($tpa), $B2
vpmuludq 32*0-128($ap), $B1, $ACC0
vpaddq 32*0-192($tp0), $ACC0, $ACC0
vpmuludq 32*0-128($aap), $B1, $ACC1
vpaddq 32*1-192($tp0), $ACC1, $ACC1
vpmuludq 32*1-128($aap), $B1, $ACC2
vpaddq 32*2-192($tp0), $ACC2, $ACC2
vpmuludq 32*2-128($aap), $B1, $ACC3
vpaddq 32*3-192($tp0), $ACC3, $ACC3
vpmuludq 32*3-128($aap), $B1, $ACC4
vpaddq 32*4-192($tp0), $ACC4, $ACC4
vpmuludq 32*4-128($aap), $B1, $ACC5
vpaddq 32*5-192($tp0), $ACC5, $ACC5
vpmuludq 32*5-128($aap), $B1, $ACC6
vpaddq 32*6-192($tp0), $ACC6, $ACC6
vpmuludq 32*6-128($aap), $B1, $ACC7
vpaddq 32*7-192($tp0), $ACC7, $ACC7
vpmuludq 32*7-128($aap), $B1, $ACC8
vpbroadcastq 32*2-128($tpa), $B1
vpaddq 32*8-192($tp0), $ACC8, $ACC8
.Lsqr_entry_1024:
vmovdqu $ACC0, 32*0-192($tp0)
vmovdqu $ACC1, 32*1-192($tp0)
vpmuludq 32*1-128($ap), $B2, $TEMP0
vpaddq $TEMP0, $ACC2, $ACC2
vpmuludq 32*1-128($aap), $B2, $TEMP1
vpaddq $TEMP1, $ACC3, $ACC3
vpmuludq 32*2-128($aap), $B2, $TEMP2
vpaddq $TEMP2, $ACC4, $ACC4
vpmuludq 32*3-128($aap), $B2, $TEMP0
vpaddq $TEMP0, $ACC5, $ACC5
vpmuludq 32*4-128($aap), $B2, $TEMP1
vpaddq $TEMP1, $ACC6, $ACC6
vpmuludq 32*5-128($aap), $B2, $TEMP2
vpaddq $TEMP2, $ACC7, $ACC7
vpmuludq 32*6-128($aap), $B2, $TEMP0
vpaddq $TEMP0, $ACC8, $ACC8
vpmuludq 32*7-128($aap), $B2, $ACC0
vpbroadcastq 32*3-128($tpa), $B2
vpaddq 32*9-192($tp0), $ACC0, $ACC0
vmovdqu $ACC2, 32*2-192($tp0)
vmovdqu $ACC3, 32*3-192($tp0)
vpmuludq 32*2-128($ap), $B1, $TEMP2
vpaddq $TEMP2, $ACC4, $ACC4
vpmuludq 32*2-128($aap), $B1, $TEMP0
vpaddq $TEMP0, $ACC5, $ACC5
vpmuludq 32*3-128($aap), $B1, $TEMP1
vpaddq $TEMP1, $ACC6, $ACC6
vpmuludq 32*4-128($aap), $B1, $TEMP2
vpaddq $TEMP2, $ACC7, $ACC7
vpmuludq 32*5-128($aap), $B1, $TEMP0
vpaddq $TEMP0, $ACC8, $ACC8
vpmuludq 32*6-128($aap), $B1, $TEMP1
vpaddq $TEMP1, $ACC0, $ACC0
vpmuludq 32*7-128($aap), $B1, $ACC1
vpbroadcastq 32*4-128($tpa), $B1
vpaddq 32*10-448($tp1), $ACC1, $ACC1
vmovdqu $ACC4, 32*4-192($tp0)
vmovdqu $ACC5, 32*5-192($tp0)
vpmuludq 32*3-128($ap), $B2, $TEMP0
vpaddq $TEMP0, $ACC6, $ACC6
vpmuludq 32*3-128($aap), $B2, $TEMP1
vpaddq $TEMP1, $ACC7, $ACC7
vpmuludq 32*4-128($aap), $B2, $TEMP2
vpaddq $TEMP2, $ACC8, $ACC8
vpmuludq 32*5-128($aap), $B2, $TEMP0
vpaddq $TEMP0, $ACC0, $ACC0
vpmuludq 32*6-128($aap), $B2, $TEMP1
vpaddq $TEMP1, $ACC1, $ACC1
vpmuludq 32*7-128($aap), $B2, $ACC2
vpbroadcastq 32*5-128($tpa), $B2
vpaddq 32*11-448($tp1), $ACC2, $ACC2
vmovdqu $ACC6, 32*6-192($tp0)
vmovdqu $ACC7, 32*7-192($tp0)
vpmuludq 32*4-128($ap), $B1, $TEMP0
vpaddq $TEMP0, $ACC8, $ACC8
vpmuludq 32*4-128($aap), $B1, $TEMP1
vpaddq $TEMP1, $ACC0, $ACC0
vpmuludq 32*5-128($aap), $B1, $TEMP2
vpaddq $TEMP2, $ACC1, $ACC1
vpmuludq 32*6-128($aap), $B1, $TEMP0
vpaddq $TEMP0, $ACC2, $ACC2
vpmuludq 32*7-128($aap), $B1, $ACC3
vpbroadcastq 32*6-128($tpa), $B1
vpaddq 32*12-448($tp1), $ACC3, $ACC3
vmovdqu $ACC8, 32*8-192($tp0)
vmovdqu $ACC0, 32*9-192($tp0)
lea 8($tp0), $tp0
vpmuludq 32*5-128($ap), $B2, $TEMP2
vpaddq $TEMP2, $ACC1, $ACC1
vpmuludq 32*5-128($aap), $B2, $TEMP0
vpaddq $TEMP0, $ACC2, $ACC2
vpmuludq 32*6-128($aap), $B2, $TEMP1
vpaddq $TEMP1, $ACC3, $ACC3
vpmuludq 32*7-128($aap), $B2, $ACC4
vpbroadcastq 32*7-128($tpa), $B2
vpaddq 32*13-448($tp1), $ACC4, $ACC4
vmovdqu $ACC1, 32*10-448($tp1)
vmovdqu $ACC2, 32*11-448($tp1)
vpmuludq 32*6-128($ap), $B1, $TEMP0
vpaddq $TEMP0, $ACC3, $ACC3
vpmuludq 32*6-128($aap), $B1, $TEMP1
vpbroadcastq 32*8-128($tpa), $ACC0 # borrow $ACC0 for $B1
vpaddq $TEMP1, $ACC4, $ACC4
vpmuludq 32*7-128($aap), $B1, $ACC5
vpbroadcastq 32*0+8-128($tpa), $B1 # for next iteration
vpaddq 32*14-448($tp1), $ACC5, $ACC5
vmovdqu $ACC3, 32*12-448($tp1)
vmovdqu $ACC4, 32*13-448($tp1)
lea 8($tpa), $tpa
vpmuludq 32*7-128($ap), $B2, $TEMP0
vpaddq $TEMP0, $ACC5, $ACC5
vpmuludq 32*7-128($aap), $B2, $ACC6
vpaddq 32*15-448($tp1), $ACC6, $ACC6
vpmuludq 32*8-128($ap), $ACC0, $ACC7
vmovdqu $ACC5, 32*14-448($tp1)
vpaddq 32*16-448($tp1), $ACC7, $ACC7
vmovdqu $ACC6, 32*15-448($tp1)
vmovdqu $ACC7, 32*16-448($tp1)
lea 8($tp1), $tp1
dec $i
jnz .LOOP_SQR_1024
___
$ZERO = $ACC9;
$TEMP0 = $B1;
$TEMP2 = $B2;
$TEMP3 = $Y1;
$TEMP4 = $Y2;
$code.=<<___;
# we need to fix indices 32-39 to avoid overflow
vmovdqu 32*8(%rsp), $ACC8 # 32*8-192($tp0),
vmovdqu 32*9(%rsp), $ACC1 # 32*9-192($tp0)
vmovdqu 32*10(%rsp), $ACC2 # 32*10-192($tp0)
lea 192(%rsp), $tp0 # 64+128=192
vpsrlq \$29, $ACC8, $TEMP1
vpand $AND_MASK, $ACC8, $ACC8
vpsrlq \$29, $ACC1, $TEMP2
vpand $AND_MASK, $ACC1, $ACC1
vpermq \$0x93, $TEMP1, $TEMP1
vpxor $ZERO, $ZERO, $ZERO
vpermq \$0x93, $TEMP2, $TEMP2
vpblendd \$3, $ZERO, $TEMP1, $TEMP0
vpblendd \$3, $TEMP1, $TEMP2, $TEMP1
vpaddq $TEMP0, $ACC8, $ACC8
vpblendd \$3, $TEMP2, $ZERO, $TEMP2
vpaddq $TEMP1, $ACC1, $ACC1
vpaddq $TEMP2, $ACC2, $ACC2
vmovdqu $ACC1, 32*9-192($tp0)
vmovdqu $ACC2, 32*10-192($tp0)
mov (%rsp), %rax
mov 8(%rsp), $r1
mov 16(%rsp), $r2
mov 24(%rsp), $r3
vmovdqu 32*1(%rsp), $ACC1
vmovdqu 32*2-192($tp0), $ACC2
vmovdqu 32*3-192($tp0), $ACC3
vmovdqu 32*4-192($tp0), $ACC4
vmovdqu 32*5-192($tp0), $ACC5
vmovdqu 32*6-192($tp0), $ACC6
vmovdqu 32*7-192($tp0), $ACC7
mov %rax, $r0
imull $n0, %eax
and \$0x1fffffff, %eax
vmovd %eax, $Y1
mov %rax, %rdx
imulq -128($np), %rax
vpbroadcastq $Y1, $Y1
add %rax, $r0
mov %rdx, %rax
imulq 8-128($np), %rax
shr \$29, $r0
add %rax, $r1
mov %rdx, %rax
imulq 16-128($np), %rax
add $r0, $r1
add %rax, $r2
imulq 24-128($np), %rdx
add %rdx, $r3
mov $r1, %rax
imull $n0, %eax
and \$0x1fffffff, %eax
mov \$9, $i
jmp .LOOP_REDUCE_1024
.align 32
.LOOP_REDUCE_1024:
vmovd %eax, $Y2
vpbroadcastq $Y2, $Y2
vpmuludq 32*1-128($np), $Y1, $TEMP0
mov %rax, %rdx
imulq -128($np), %rax
vpaddq $TEMP0, $ACC1, $ACC1
add %rax, $r1
vpmuludq 32*2-128($np), $Y1, $TEMP1
mov %rdx, %rax
imulq 8-128($np), %rax
vpaddq $TEMP1, $ACC2, $ACC2
vpmuludq 32*3-128($np), $Y1, $TEMP2
.byte 0x67
add %rax, $r2
.byte 0x67
mov %rdx, %rax
imulq 16-128($np), %rax
shr \$29, $r1
vpaddq $TEMP2, $ACC3, $ACC3
vpmuludq 32*4-128($np), $Y1, $TEMP0
add %rax, $r3
add $r1, $r2
vpaddq $TEMP0, $ACC4, $ACC4
vpmuludq 32*5-128($np), $Y1, $TEMP1
mov $r2, %rax
imull $n0, %eax
vpaddq $TEMP1, $ACC5, $ACC5
vpmuludq 32*6-128($np), $Y1, $TEMP2
and \$0x1fffffff, %eax
vpaddq $TEMP2, $ACC6, $ACC6
vpmuludq 32*7-128($np), $Y1, $TEMP0
vpaddq $TEMP0, $ACC7, $ACC7
vpmuludq 32*8-128($np), $Y1, $TEMP1
vmovd %eax, $Y1
#vmovdqu 32*1-8-128($np), $TEMP2 # moved below
vpaddq $TEMP1, $ACC8, $ACC8
#vmovdqu 32*2-8-128($np), $TEMP0 # moved below
vpbroadcastq $Y1, $Y1
vpmuludq 32*1-8-128($np), $Y2, $TEMP2 # see above
vmovdqu 32*3-8-128($np), $TEMP1
mov %rax, %rdx
imulq -128($np), %rax
vpaddq $TEMP2, $ACC1, $ACC1
vpmuludq 32*2-8-128($np), $Y2, $TEMP0 # see above
vmovdqu 32*4-8-128($np), $TEMP2
add %rax, $r2
mov %rdx, %rax
imulq 8-128($np), %rax
vpaddq $TEMP0, $ACC2, $ACC2
add $r3, %rax
shr \$29, $r2
vpmuludq $Y2, $TEMP1, $TEMP1
vmovdqu 32*5-8-128($np), $TEMP0
add $r2, %rax
vpaddq $TEMP1, $ACC3, $ACC3
vpmuludq $Y2, $TEMP2, $TEMP2
vmovdqu 32*6-8-128($np), $TEMP1
.byte 0x67
mov %rax, $r3
imull $n0, %eax
vpaddq $TEMP2, $ACC4, $ACC4
vpmuludq $Y2, $TEMP0, $TEMP0
.byte 0xc4,0x41,0x7e,0x6f,0x9d,0x58,0x00,0x00,0x00 # vmovdqu 32*7-8-128($np), $TEMP2
and \$0x1fffffff, %eax
vpaddq $TEMP0, $ACC5, $ACC5
vpmuludq $Y2, $TEMP1, $TEMP1
vmovdqu 32*8-8-128($np), $TEMP0
vpaddq $TEMP1, $ACC6, $ACC6
vpmuludq $Y2, $TEMP2, $TEMP2
vmovdqu 32*9-8-128($np), $ACC9
vmovd %eax, $ACC0 # borrow ACC0 for Y2
imulq -128($np), %rax
vpaddq $TEMP2, $ACC7, $ACC7
vpmuludq $Y2, $TEMP0, $TEMP0
vmovdqu 32*1-16-128($np), $TEMP1
vpbroadcastq $ACC0, $ACC0
vpaddq $TEMP0, $ACC8, $ACC8
vpmuludq $Y2, $ACC9, $ACC9
vmovdqu 32*2-16-128($np), $TEMP2
add %rax, $r3
___
($ACC0,$Y2)=($Y2,$ACC0);
$code.=<<___;
vmovdqu 32*1-24-128($np), $ACC0
vpmuludq $Y1, $TEMP1, $TEMP1
vmovdqu 32*3-16-128($np), $TEMP0
vpaddq $TEMP1, $ACC1, $ACC1
vpmuludq $Y2, $ACC0, $ACC0
vpmuludq $Y1, $TEMP2, $TEMP2
.byte 0xc4,0x41,0x7e,0x6f,0xb5,0xf0,0xff,0xff,0xff # vmovdqu 32*4-16-128($np), $TEMP1
vpaddq $ACC1, $ACC0, $ACC0
vpaddq $TEMP2, $ACC2, $ACC2
vpmuludq $Y1, $TEMP0, $TEMP0
vmovdqu 32*5-16-128($np), $TEMP2
.byte 0x67
vmovq $ACC0, %rax
vmovdqu $ACC0, (%rsp) # transfer $r0-$r3
vpaddq $TEMP0, $ACC3, $ACC3
vpmuludq $Y1, $TEMP1, $TEMP1
vmovdqu 32*6-16-128($np), $TEMP0
vpaddq $TEMP1, $ACC4, $ACC4
vpmuludq $Y1, $TEMP2, $TEMP2
vmovdqu 32*7-16-128($np), $TEMP1
vpaddq $TEMP2, $ACC5, $ACC5
vpmuludq $Y1, $TEMP0, $TEMP0
vmovdqu 32*8-16-128($np), $TEMP2
vpaddq $TEMP0, $ACC6, $ACC6
vpmuludq $Y1, $TEMP1, $TEMP1
shr \$29, $r3
vmovdqu 32*9-16-128($np), $TEMP0
add $r3, %rax
vpaddq $TEMP1, $ACC7, $ACC7
vpmuludq $Y1, $TEMP2, $TEMP2
#vmovdqu 32*2-24-128($np), $TEMP1 # moved below
mov %rax, $r0
imull $n0, %eax
vpaddq $TEMP2, $ACC8, $ACC8
vpmuludq $Y1, $TEMP0, $TEMP0
and \$0x1fffffff, %eax
vmovd %eax, $Y1
vmovdqu 32*3-24-128($np), $TEMP2
.byte 0x67
vpaddq $TEMP0, $ACC9, $ACC9
vpbroadcastq $Y1, $Y1
vpmuludq 32*2-24-128($np), $Y2, $TEMP1 # see above
vmovdqu 32*4-24-128($np), $TEMP0
mov %rax, %rdx
imulq -128($np), %rax
mov 8(%rsp), $r1
vpaddq $TEMP1, $ACC2, $ACC1
vpmuludq $Y2, $TEMP2, $TEMP2
vmovdqu 32*5-24-128($np), $TEMP1
add %rax, $r0
mov %rdx, %rax
imulq 8-128($np), %rax
.byte 0x67
shr \$29, $r0
mov 16(%rsp), $r2
vpaddq $TEMP2, $ACC3, $ACC2
vpmuludq $Y2, $TEMP0, $TEMP0
vmovdqu 32*6-24-128($np), $TEMP2
add %rax, $r1
mov %rdx, %rax
imulq 16-128($np), %rax
vpaddq $TEMP0, $ACC4, $ACC3
vpmuludq $Y2, $TEMP1, $TEMP1
vmovdqu 32*7-24-128($np), $TEMP0
imulq 24-128($np), %rdx # future $r3
add %rax, $r2
lea ($r0,$r1), %rax
vpaddq $TEMP1, $ACC5, $ACC4
vpmuludq $Y2, $TEMP2, $TEMP2
vmovdqu 32*8-24-128($np), $TEMP1
mov %rax, $r1
imull $n0, %eax
vpmuludq $Y2, $TEMP0, $TEMP0
vpaddq $TEMP2, $ACC6, $ACC5
vmovdqu 32*9-24-128($np), $TEMP2
and \$0x1fffffff, %eax
vpaddq $TEMP0, $ACC7, $ACC6
vpmuludq $Y2, $TEMP1, $TEMP1
add 24(%rsp), %rdx
vpaddq $TEMP1, $ACC8, $ACC7
vpmuludq $Y2, $TEMP2, $TEMP2
vpaddq $TEMP2, $ACC9, $ACC8
vmovq $r3, $ACC9
mov %rdx, $r3
dec $i
jnz .LOOP_REDUCE_1024
___
($ACC0,$Y2)=($Y2,$ACC0);
$code.=<<___;
lea 448(%rsp), $tp1 # size optimization
vpaddq $ACC9, $Y2, $ACC0
vpxor $ZERO, $ZERO, $ZERO
vpaddq 32*9-192($tp0), $ACC0, $ACC0
vpaddq 32*10-448($tp1), $ACC1, $ACC1
vpaddq 32*11-448($tp1), $ACC2, $ACC2
vpaddq 32*12-448($tp1), $ACC3, $ACC3
vpaddq 32*13-448($tp1), $ACC4, $ACC4
vpaddq 32*14-448($tp1), $ACC5, $ACC5
vpaddq 32*15-448($tp1), $ACC6, $ACC6
vpaddq 32*16-448($tp1), $ACC7, $ACC7
vpaddq 32*17-448($tp1), $ACC8, $ACC8
vpsrlq \$29, $ACC0, $TEMP1
vpand $AND_MASK, $ACC0, $ACC0
vpsrlq \$29, $ACC1, $TEMP2
vpand $AND_MASK, $ACC1, $ACC1
vpsrlq \$29, $ACC2, $TEMP3
vpermq \$0x93, $TEMP1, $TEMP1
vpand $AND_MASK, $ACC2, $ACC2
vpsrlq \$29, $ACC3, $TEMP4
vpermq \$0x93, $TEMP2, $TEMP2
vpand $AND_MASK, $ACC3, $ACC3
vpermq \$0x93, $TEMP3, $TEMP3
vpblendd \$3, $ZERO, $TEMP1, $TEMP0
vpermq \$0x93, $TEMP4, $TEMP4
vpblendd \$3, $TEMP1, $TEMP2, $TEMP1
vpaddq $TEMP0, $ACC0, $ACC0
vpblendd \$3, $TEMP2, $TEMP3, $TEMP2
vpaddq $TEMP1, $ACC1, $ACC1
vpblendd \$3, $TEMP3, $TEMP4, $TEMP3
vpaddq $TEMP2, $ACC2, $ACC2
vpblendd \$3, $TEMP4, $ZERO, $TEMP4
vpaddq $TEMP3, $ACC3, $ACC3
vpaddq $TEMP4, $ACC4, $ACC4
vpsrlq \$29, $ACC0, $TEMP1
vpand $AND_MASK, $ACC0, $ACC0
vpsrlq \$29, $ACC1, $TEMP2
vpand $AND_MASK, $ACC1, $ACC1
vpsrlq \$29, $ACC2, $TEMP3
vpermq \$0x93, $TEMP1, $TEMP1
vpand $AND_MASK, $ACC2, $ACC2
vpsrlq \$29, $ACC3, $TEMP4
vpermq \$0x93, $TEMP2, $TEMP2
vpand $AND_MASK, $ACC3, $ACC3
vpermq \$0x93, $TEMP3, $TEMP3
vpblendd \$3, $ZERO, $TEMP1, $TEMP0
vpermq \$0x93, $TEMP4, $TEMP4
vpblendd \$3, $TEMP1, $TEMP2, $TEMP1
vpaddq $TEMP0, $ACC0, $ACC0
vpblendd \$3, $TEMP2, $TEMP3, $TEMP2
vpaddq $TEMP1, $ACC1, $ACC1
vmovdqu $ACC0, 32*0-128($rp)
vpblendd \$3, $TEMP3, $TEMP4, $TEMP3
vpaddq $TEMP2, $ACC2, $ACC2
vmovdqu $ACC1, 32*1-128($rp)
vpblendd \$3, $TEMP4, $ZERO, $TEMP4
vpaddq $TEMP3, $ACC3, $ACC3
vmovdqu $ACC2, 32*2-128($rp)
vpaddq $TEMP4, $ACC4, $ACC4
vmovdqu $ACC3, 32*3-128($rp)
___
$TEMP5=$ACC0;
$code.=<<___;
vpsrlq \$29, $ACC4, $TEMP1
vpand $AND_MASK, $ACC4, $ACC4
vpsrlq \$29, $ACC5, $TEMP2
vpand $AND_MASK, $ACC5, $ACC5
vpsrlq \$29, $ACC6, $TEMP3
vpermq \$0x93, $TEMP1, $TEMP1
vpand $AND_MASK, $ACC6, $ACC6
vpsrlq \$29, $ACC7, $TEMP4
vpermq \$0x93, $TEMP2, $TEMP2
vpand $AND_MASK, $ACC7, $ACC7
vpsrlq \$29, $ACC8, $TEMP5
vpermq \$0x93, $TEMP3, $TEMP3
vpand $AND_MASK, $ACC8, $ACC8
vpermq \$0x93, $TEMP4, $TEMP4
vpblendd \$3, $ZERO, $TEMP1, $TEMP0
vpermq \$0x93, $TEMP5, $TEMP5
vpblendd \$3, $TEMP1, $TEMP2, $TEMP1
vpaddq $TEMP0, $ACC4, $ACC4
vpblendd \$3, $TEMP2, $TEMP3, $TEMP2
vpaddq $TEMP1, $ACC5, $ACC5
vpblendd \$3, $TEMP3, $TEMP4, $TEMP3
vpaddq $TEMP2, $ACC6, $ACC6
vpblendd \$3, $TEMP4, $TEMP5, $TEMP4
vpaddq $TEMP3, $ACC7, $ACC7
vpaddq $TEMP4, $ACC8, $ACC8
vpsrlq \$29, $ACC4, $TEMP1
vpand $AND_MASK, $ACC4, $ACC4
vpsrlq \$29, $ACC5, $TEMP2
vpand $AND_MASK, $ACC5, $ACC5
vpsrlq \$29, $ACC6, $TEMP3
vpermq \$0x93, $TEMP1, $TEMP1
vpand $AND_MASK, $ACC6, $ACC6
vpsrlq \$29, $ACC7, $TEMP4
vpermq \$0x93, $TEMP2, $TEMP2
vpand $AND_MASK, $ACC7, $ACC7
vpsrlq \$29, $ACC8, $TEMP5
vpermq \$0x93, $TEMP3, $TEMP3
vpand $AND_MASK, $ACC8, $ACC8
vpermq \$0x93, $TEMP4, $TEMP4
vpblendd \$3, $ZERO, $TEMP1, $TEMP0
vpermq \$0x93, $TEMP5, $TEMP5
vpblendd \$3, $TEMP1, $TEMP2, $TEMP1
vpaddq $TEMP0, $ACC4, $ACC4
vpblendd \$3, $TEMP2, $TEMP3, $TEMP2
vpaddq $TEMP1, $ACC5, $ACC5
vmovdqu $ACC4, 32*4-128($rp)
vpblendd \$3, $TEMP3, $TEMP4, $TEMP3
vpaddq $TEMP2, $ACC6, $ACC6
vmovdqu $ACC5, 32*5-128($rp)
vpblendd \$3, $TEMP4, $TEMP5, $TEMP4
vpaddq $TEMP3, $ACC7, $ACC7
vmovdqu $ACC6, 32*6-128($rp)
vpaddq $TEMP4, $ACC8, $ACC8
vmovdqu $ACC7, 32*7-128($rp)
vmovdqu $ACC8, 32*8-128($rp)
mov $rp, $ap
dec $rep
jne .LOOP_GRANDE_SQR_1024
vzeroall
mov %rbp, %rax
___
$code.=<<___ if ($win64);
movaps -0xd8(%rax),%xmm6
movaps -0xc8(%rax),%xmm7
movaps -0xb8(%rax),%xmm8
movaps -0xa8(%rax),%xmm9
movaps -0x98(%rax),%xmm10
movaps -0x88(%rax),%xmm11
movaps -0x78(%rax),%xmm12
movaps -0x68(%rax),%xmm13
movaps -0x58(%rax),%xmm14
movaps -0x48(%rax),%xmm15
___
$code.=<<___;
mov -48(%rax),%r15
mov -40(%rax),%r14
mov -32(%rax),%r13
mov -24(%rax),%r12
mov -16(%rax),%rbp
mov -8(%rax),%rbx
lea (%rax),%rsp # restore %rsp
.Lsqr_1024_epilogue:
ret
.size rsaz_1024_sqr_avx2,.-rsaz_1024_sqr_avx2
___
}
{ # void AMM_WW(
my $rp="%rdi"; # BN_ULONG *rp,
my $ap="%rsi"; # const BN_ULONG *ap,
my $bp="%rdx"; # const BN_ULONG *bp,
my $np="%rcx"; # const BN_ULONG *np,
my $n0="%r8d"; # unsigned int n0);
# The registers that hold the accumulated redundant result
# The AMM works on 1024 bit operands, and redundant word size is 29
# Therefore: ceil(1024/29)/4 = 9
my $ACC0="%ymm0";
my $ACC1="%ymm1";
my $ACC2="%ymm2";
my $ACC3="%ymm3";
my $ACC4="%ymm4";
my $ACC5="%ymm5";
my $ACC6="%ymm6";
my $ACC7="%ymm7";
my $ACC8="%ymm8";
my $ACC9="%ymm9";
# Registers that hold the broadcasted words of multiplier, currently used
my $Bi="%ymm10";
my $Yi="%ymm11";
# Helper registers
my $TEMP0=$ACC0;
my $TEMP1="%ymm12";
my $TEMP2="%ymm13";
my $ZERO="%ymm14";
my $AND_MASK="%ymm15";
# alu registers that hold the first words of the ACC
my $r0="%r9";
my $r1="%r10";
my $r2="%r11";
my $r3="%r12";
my $i="%r14d";
my $tmp="%r15";
$bp="%r13"; # reassigned argument
$code.=<<___;
.globl rsaz_1024_mul_avx2
.type rsaz_1024_mul_avx2,\@function,5
.align 64
rsaz_1024_mul_avx2:
lea (%rsp), %rax
push %rbx
push %rbp
push %r12
push %r13
push %r14
push %r15
___
$code.=<<___ if ($win64);
vzeroupper
lea -0xa8(%rsp),%rsp
vmovaps %xmm6,-0xd8(%rax)
vmovaps %xmm7,-0xc8(%rax)
vmovaps %xmm8,-0xb8(%rax)
vmovaps %xmm9,-0xa8(%rax)
vmovaps %xmm10,-0x98(%rax)
vmovaps %xmm11,-0x88(%rax)
vmovaps %xmm12,-0x78(%rax)
vmovaps %xmm13,-0x68(%rax)
vmovaps %xmm14,-0x58(%rax)
vmovaps %xmm15,-0x48(%rax)
.Lmul_1024_body:
___
$code.=<<___;
mov %rax,%rbp
vzeroall
mov %rdx, $bp # reassigned argument
sub \$64,%rsp
# unaligned 256-bit load that crosses page boundary can
# cause severe performance degradation here, so if $ap does
# cross page boundary, swap it with $bp [meaning that caller
# is advised to lay down $ap and $bp next to each other, so
# that only one can cross page boundary].
.byte 0x67,0x67
mov $ap, $tmp
and \$4095, $tmp
add \$32*10, $tmp
shr \$12, $tmp
mov $ap, $tmp
cmovnz $bp, $ap
cmovnz $tmp, $bp
mov $np, $tmp
sub \$-128,$ap # size optimization
sub \$-128,$np
sub \$-128,$rp
and \$4095, $tmp # see if $np crosses page
add \$32*10, $tmp
.byte 0x67,0x67
shr \$12, $tmp
jz .Lmul_1024_no_n_copy
# unaligned 256-bit load that crosses page boundary can
# cause severe performance degradation here, so if $np does
# cross page boundary, copy it to stack and make sure stack
# frame doesn't...
sub \$32*10,%rsp
vmovdqu 32*0-128($np), $ACC0
and \$-512, %rsp
vmovdqu 32*1-128($np), $ACC1
vmovdqu 32*2-128($np), $ACC2
vmovdqu 32*3-128($np), $ACC3
vmovdqu 32*4-128($np), $ACC4
vmovdqu 32*5-128($np), $ACC5
vmovdqu 32*6-128($np), $ACC6
vmovdqu 32*7-128($np), $ACC7
vmovdqu 32*8-128($np), $ACC8
lea 64+128(%rsp),$np
vmovdqu $ACC0, 32*0-128($np)
vpxor $ACC0, $ACC0, $ACC0
vmovdqu $ACC1, 32*1-128($np)
vpxor $ACC1, $ACC1, $ACC1
vmovdqu $ACC2, 32*2-128($np)
vpxor $ACC2, $ACC2, $ACC2
vmovdqu $ACC3, 32*3-128($np)
vpxor $ACC3, $ACC3, $ACC3
vmovdqu $ACC4, 32*4-128($np)
vpxor $ACC4, $ACC4, $ACC4
vmovdqu $ACC5, 32*5-128($np)
vpxor $ACC5, $ACC5, $ACC5
vmovdqu $ACC6, 32*6-128($np)
vpxor $ACC6, $ACC6, $ACC6
vmovdqu $ACC7, 32*7-128($np)
vpxor $ACC7, $ACC7, $ACC7
vmovdqu $ACC8, 32*8-128($np)
vmovdqa $ACC0, $ACC8
vmovdqu $ACC9, 32*9-128($np) # $ACC9 is zero after vzeroall
.Lmul_1024_no_n_copy:
and \$-64,%rsp
mov ($bp), %rbx
vpbroadcastq ($bp), $Bi
vmovdqu $ACC0, (%rsp) # clear top of stack
xor $r0, $r0
.byte 0x67
xor $r1, $r1
xor $r2, $r2
xor $r3, $r3
vmovdqu .Land_mask(%rip), $AND_MASK
mov \$9, $i
vmovdqu $ACC9, 32*9-128($rp) # $ACC9 is zero after vzeroall
jmp .Loop_mul_1024
.align 32
.Loop_mul_1024:
vpsrlq \$29, $ACC3, $ACC9 # correct $ACC3(*)
mov %rbx, %rax
imulq -128($ap), %rax
add $r0, %rax
mov %rbx, $r1
imulq 8-128($ap), $r1
add 8(%rsp), $r1
mov %rax, $r0
imull $n0, %eax
and \$0x1fffffff, %eax
mov %rbx, $r2
imulq 16-128($ap), $r2
add 16(%rsp), $r2
mov %rbx, $r3
imulq 24-128($ap), $r3
add 24(%rsp), $r3
vpmuludq 32*1-128($ap),$Bi,$TEMP0
vmovd %eax, $Yi
vpaddq $TEMP0,$ACC1,$ACC1
vpmuludq 32*2-128($ap),$Bi,$TEMP1
vpbroadcastq $Yi, $Yi
vpaddq $TEMP1,$ACC2,$ACC2
vpmuludq 32*3-128($ap),$Bi,$TEMP2
vpand $AND_MASK, $ACC3, $ACC3 # correct $ACC3
vpaddq $TEMP2,$ACC3,$ACC3
vpmuludq 32*4-128($ap),$Bi,$TEMP0
vpaddq $TEMP0,$ACC4,$ACC4
vpmuludq 32*5-128($ap),$Bi,$TEMP1
vpaddq $TEMP1,$ACC5,$ACC5
vpmuludq 32*6-128($ap),$Bi,$TEMP2
vpaddq $TEMP2,$ACC6,$ACC6
vpmuludq 32*7-128($ap),$Bi,$TEMP0
vpermq \$0x93, $ACC9, $ACC9 # correct $ACC3
vpaddq $TEMP0,$ACC7,$ACC7
vpmuludq 32*8-128($ap),$Bi,$TEMP1
vpbroadcastq 8($bp), $Bi
vpaddq $TEMP1,$ACC8,$ACC8
mov %rax,%rdx
imulq -128($np),%rax
add %rax,$r0
mov %rdx,%rax
imulq 8-128($np),%rax
add %rax,$r1
mov %rdx,%rax
imulq 16-128($np),%rax
add %rax,$r2
shr \$29, $r0
imulq 24-128($np),%rdx
add %rdx,$r3
add $r0, $r1
vpmuludq 32*1-128($np),$Yi,$TEMP2
vmovq $Bi, %rbx
vpaddq $TEMP2,$ACC1,$ACC1
vpmuludq 32*2-128($np),$Yi,$TEMP0
vpaddq $TEMP0,$ACC2,$ACC2
vpmuludq 32*3-128($np),$Yi,$TEMP1
vpaddq $TEMP1,$ACC3,$ACC3
vpmuludq 32*4-128($np),$Yi,$TEMP2
vpaddq $TEMP2,$ACC4,$ACC4
vpmuludq 32*5-128($np),$Yi,$TEMP0
vpaddq $TEMP0,$ACC5,$ACC5
vpmuludq 32*6-128($np),$Yi,$TEMP1
vpaddq $TEMP1,$ACC6,$ACC6
vpmuludq 32*7-128($np),$Yi,$TEMP2
vpblendd \$3, $ZERO, $ACC9, $ACC9 # correct $ACC3
vpaddq $TEMP2,$ACC7,$ACC7
vpmuludq 32*8-128($np),$Yi,$TEMP0
vpaddq $ACC9, $ACC3, $ACC3 # correct $ACC3
vpaddq $TEMP0,$ACC8,$ACC8
mov %rbx, %rax
imulq -128($ap),%rax
add %rax,$r1
vmovdqu -8+32*1-128($ap),$TEMP1
mov %rbx, %rax
imulq 8-128($ap),%rax
add %rax,$r2
vmovdqu -8+32*2-128($ap),$TEMP2
mov $r1, %rax
imull $n0, %eax
and \$0x1fffffff, %eax
imulq 16-128($ap),%rbx
add %rbx,$r3
vpmuludq $Bi,$TEMP1,$TEMP1
vmovd %eax, $Yi
vmovdqu -8+32*3-128($ap),$TEMP0
vpaddq $TEMP1,$ACC1,$ACC1
vpmuludq $Bi,$TEMP2,$TEMP2
vpbroadcastq $Yi, $Yi
vmovdqu -8+32*4-128($ap),$TEMP1
vpaddq $TEMP2,$ACC2,$ACC2
vpmuludq $Bi,$TEMP0,$TEMP0
vmovdqu -8+32*5-128($ap),$TEMP2
vpaddq $TEMP0,$ACC3,$ACC3
vpmuludq $Bi,$TEMP1,$TEMP1
vmovdqu -8+32*6-128($ap),$TEMP0
vpaddq $TEMP1,$ACC4,$ACC4
vpmuludq $Bi,$TEMP2,$TEMP2
vmovdqu -8+32*7-128($ap),$TEMP1
vpaddq $TEMP2,$ACC5,$ACC5
vpmuludq $Bi,$TEMP0,$TEMP0
vmovdqu -8+32*8-128($ap),$TEMP2
vpaddq $TEMP0,$ACC6,$ACC6
vpmuludq $Bi,$TEMP1,$TEMP1
vmovdqu -8+32*9-128($ap),$ACC9
vpaddq $TEMP1,$ACC7,$ACC7
vpmuludq $Bi,$TEMP2,$TEMP2
vpaddq $TEMP2,$ACC8,$ACC8
vpmuludq $Bi,$ACC9,$ACC9
vpbroadcastq 16($bp), $Bi
mov %rax,%rdx
imulq -128($np),%rax
add %rax,$r1
vmovdqu -8+32*1-128($np),$TEMP0
mov %rdx,%rax
imulq 8-128($np),%rax
add %rax,$r2
vmovdqu -8+32*2-128($np),$TEMP1
shr \$29, $r1
imulq 16-128($np),%rdx
add %rdx,$r3
add $r1, $r2
vpmuludq $Yi,$TEMP0,$TEMP0
vmovq $Bi, %rbx
vmovdqu -8+32*3-128($np),$TEMP2
vpaddq $TEMP0,$ACC1,$ACC1
vpmuludq $Yi,$TEMP1,$TEMP1
vmovdqu -8+32*4-128($np),$TEMP0
vpaddq $TEMP1,$ACC2,$ACC2
vpmuludq $Yi,$TEMP2,$TEMP2
vmovdqu -8+32*5-128($np),$TEMP1
vpaddq $TEMP2,$ACC3,$ACC3
vpmuludq $Yi,$TEMP0,$TEMP0
vmovdqu -8+32*6-128($np),$TEMP2
vpaddq $TEMP0,$ACC4,$ACC4
vpmuludq $Yi,$TEMP1,$TEMP1
vmovdqu -8+32*7-128($np),$TEMP0
vpaddq $TEMP1,$ACC5,$ACC5
vpmuludq $Yi,$TEMP2,$TEMP2
vmovdqu -8+32*8-128($np),$TEMP1
vpaddq $TEMP2,$ACC6,$ACC6
vpmuludq $Yi,$TEMP0,$TEMP0
vmovdqu -8+32*9-128($np),$TEMP2
vpaddq $TEMP0,$ACC7,$ACC7
vpmuludq $Yi,$TEMP1,$TEMP1
vpaddq $TEMP1,$ACC8,$ACC8
vpmuludq $Yi,$TEMP2,$TEMP2
vpaddq $TEMP2,$ACC9,$ACC9
vmovdqu -16+32*1-128($ap),$TEMP0
mov %rbx,%rax
imulq -128($ap),%rax
add $r2,%rax
vmovdqu -16+32*2-128($ap),$TEMP1
mov %rax,$r2
imull $n0, %eax
and \$0x1fffffff, %eax
imulq 8-128($ap),%rbx
add %rbx,$r3
vpmuludq $Bi,$TEMP0,$TEMP0
vmovd %eax, $Yi
vmovdqu -16+32*3-128($ap),$TEMP2
vpaddq $TEMP0,$ACC1,$ACC1
vpmuludq $Bi,$TEMP1,$TEMP1
vpbroadcastq $Yi, $Yi
vmovdqu -16+32*4-128($ap),$TEMP0
vpaddq $TEMP1,$ACC2,$ACC2
vpmuludq $Bi,$TEMP2,$TEMP2
vmovdqu -16+32*5-128($ap),$TEMP1
vpaddq $TEMP2,$ACC3,$ACC3
vpmuludq $Bi,$TEMP0,$TEMP0
vmovdqu -16+32*6-128($ap),$TEMP2
vpaddq $TEMP0,$ACC4,$ACC4
vpmuludq $Bi,$TEMP1,$TEMP1
vmovdqu -16+32*7-128($ap),$TEMP0
vpaddq $TEMP1,$ACC5,$ACC5
vpmuludq $Bi,$TEMP2,$TEMP2
vmovdqu -16+32*8-128($ap),$TEMP1
vpaddq $TEMP2,$ACC6,$ACC6
vpmuludq $Bi,$TEMP0,$TEMP0
vmovdqu -16+32*9-128($ap),$TEMP2
vpaddq $TEMP0,$ACC7,$ACC7
vpmuludq $Bi,$TEMP1,$TEMP1
vpaddq $TEMP1,$ACC8,$ACC8
vpmuludq $Bi,$TEMP2,$TEMP2
vpbroadcastq 24($bp), $Bi
vpaddq $TEMP2,$ACC9,$ACC9
vmovdqu -16+32*1-128($np),$TEMP0
mov %rax,%rdx
imulq -128($np),%rax
add %rax,$r2
vmovdqu -16+32*2-128($np),$TEMP1
imulq 8-128($np),%rdx
add %rdx,$r3
shr \$29, $r2
vpmuludq $Yi,$TEMP0,$TEMP0
vmovq $Bi, %rbx
vmovdqu -16+32*3-128($np),$TEMP2
vpaddq $TEMP0,$ACC1,$ACC1
vpmuludq $Yi,$TEMP1,$TEMP1
vmovdqu -16+32*4-128($np),$TEMP0
vpaddq $TEMP1,$ACC2,$ACC2
vpmuludq $Yi,$TEMP2,$TEMP2
vmovdqu -16+32*5-128($np),$TEMP1
vpaddq $TEMP2,$ACC3,$ACC3
vpmuludq $Yi,$TEMP0,$TEMP0
vmovdqu -16+32*6-128($np),$TEMP2
vpaddq $TEMP0,$ACC4,$ACC4
vpmuludq $Yi,$TEMP1,$TEMP1
vmovdqu -16+32*7-128($np),$TEMP0
vpaddq $TEMP1,$ACC5,$ACC5
vpmuludq $Yi,$TEMP2,$TEMP2
vmovdqu -16+32*8-128($np),$TEMP1
vpaddq $TEMP2,$ACC6,$ACC6
vpmuludq $Yi,$TEMP0,$TEMP0
vmovdqu -16+32*9-128($np),$TEMP2
vpaddq $TEMP0,$ACC7,$ACC7
vpmuludq $Yi,$TEMP1,$TEMP1
vmovdqu -24+32*1-128($ap),$TEMP0
vpaddq $TEMP1,$ACC8,$ACC8
vpmuludq $Yi,$TEMP2,$TEMP2
vmovdqu -24+32*2-128($ap),$TEMP1
vpaddq $TEMP2,$ACC9,$ACC9
add $r2, $r3
imulq -128($ap),%rbx
add %rbx,$r3
mov $r3, %rax
imull $n0, %eax
and \$0x1fffffff, %eax
vpmuludq $Bi,$TEMP0,$TEMP0
vmovd %eax, $Yi
vmovdqu -24+32*3-128($ap),$TEMP2
vpaddq $TEMP0,$ACC1,$ACC1
vpmuludq $Bi,$TEMP1,$TEMP1
vpbroadcastq $Yi, $Yi
vmovdqu -24+32*4-128($ap),$TEMP0
vpaddq $TEMP1,$ACC2,$ACC2
vpmuludq $Bi,$TEMP2,$TEMP2
vmovdqu -24+32*5-128($ap),$TEMP1
vpaddq $TEMP2,$ACC3,$ACC3
vpmuludq $Bi,$TEMP0,$TEMP0
vmovdqu -24+32*6-128($ap),$TEMP2
vpaddq $TEMP0,$ACC4,$ACC4
vpmuludq $Bi,$TEMP1,$TEMP1
vmovdqu -24+32*7-128($ap),$TEMP0
vpaddq $TEMP1,$ACC5,$ACC5
vpmuludq $Bi,$TEMP2,$TEMP2
vmovdqu -24+32*8-128($ap),$TEMP1
vpaddq $TEMP2,$ACC6,$ACC6
vpmuludq $Bi,$TEMP0,$TEMP0
vmovdqu -24+32*9-128($ap),$TEMP2
vpaddq $TEMP0,$ACC7,$ACC7
vpmuludq $Bi,$TEMP1,$TEMP1
vpaddq $TEMP1,$ACC8,$ACC8
vpmuludq $Bi,$TEMP2,$TEMP2
vpbroadcastq 32($bp), $Bi
vpaddq $TEMP2,$ACC9,$ACC9
add \$32, $bp # $bp++
vmovdqu -24+32*1-128($np),$TEMP0
imulq -128($np),%rax
add %rax,$r3
shr \$29, $r3
vmovdqu -24+32*2-128($np),$TEMP1
vpmuludq $Yi,$TEMP0,$TEMP0
vmovq $Bi, %rbx
vmovdqu -24+32*3-128($np),$TEMP2
vpaddq $TEMP0,$ACC1,$ACC0 # $ACC0==$TEMP0
vpmuludq $Yi,$TEMP1,$TEMP1
vmovdqu $ACC0, (%rsp) # transfer $r0-$r3
vpaddq $TEMP1,$ACC2,$ACC1
vmovdqu -24+32*4-128($np),$TEMP0
vpmuludq $Yi,$TEMP2,$TEMP2
vmovdqu -24+32*5-128($np),$TEMP1
vpaddq $TEMP2,$ACC3,$ACC2
vpmuludq $Yi,$TEMP0,$TEMP0
vmovdqu -24+32*6-128($np),$TEMP2
vpaddq $TEMP0,$ACC4,$ACC3
vpmuludq $Yi,$TEMP1,$TEMP1
vmovdqu -24+32*7-128($np),$TEMP0
vpaddq $TEMP1,$ACC5,$ACC4
vpmuludq $Yi,$TEMP2,$TEMP2
vmovdqu -24+32*8-128($np),$TEMP1
vpaddq $TEMP2,$ACC6,$ACC5
vpmuludq $Yi,$TEMP0,$TEMP0
vmovdqu -24+32*9-128($np),$TEMP2
mov $r3, $r0
vpaddq $TEMP0,$ACC7,$ACC6
vpmuludq $Yi,$TEMP1,$TEMP1
add (%rsp), $r0
vpaddq $TEMP1,$ACC8,$ACC7
vpmuludq $Yi,$TEMP2,$TEMP2
vmovq $r3, $TEMP1
vpaddq $TEMP2,$ACC9,$ACC8
dec $i
jnz .Loop_mul_1024
___
# (*) Original implementation was correcting ACC1-ACC3 for overflow
# after 7 loop runs, or after 28 iterations, or 56 additions.
# But as we underutilize resources, it's possible to correct in
# each iteration with marginal performance loss. But then, as
# we do it in each iteration, we can correct less digits, and
# avoid performance penalties completely. Also note that we
# correct only three digits out of four. This works because
# most significant digit is subjected to less additions.
$TEMP0 = $ACC9;
$TEMP3 = $Bi;
$TEMP4 = $Yi;
$code.=<<___;
vpermq \$0, $AND_MASK, $AND_MASK
vpaddq (%rsp), $TEMP1, $ACC0
vpsrlq \$29, $ACC0, $TEMP1
vpand $AND_MASK, $ACC0, $ACC0
vpsrlq \$29, $ACC1, $TEMP2
vpand $AND_MASK, $ACC1, $ACC1
vpsrlq \$29, $ACC2, $TEMP3
vpermq \$0x93, $TEMP1, $TEMP1
vpand $AND_MASK, $ACC2, $ACC2
vpsrlq \$29, $ACC3, $TEMP4
vpermq \$0x93, $TEMP2, $TEMP2
vpand $AND_MASK, $ACC3, $ACC3
vpblendd \$3, $ZERO, $TEMP1, $TEMP0
vpermq \$0x93, $TEMP3, $TEMP3
vpblendd \$3, $TEMP1, $TEMP2, $TEMP1
vpermq \$0x93, $TEMP4, $TEMP4
vpaddq $TEMP0, $ACC0, $ACC0
vpblendd \$3, $TEMP2, $TEMP3, $TEMP2
vpaddq $TEMP1, $ACC1, $ACC1
vpblendd \$3, $TEMP3, $TEMP4, $TEMP3
vpaddq $TEMP2, $ACC2, $ACC2
vpblendd \$3, $TEMP4, $ZERO, $TEMP4
vpaddq $TEMP3, $ACC3, $ACC3
vpaddq $TEMP4, $ACC4, $ACC4
vpsrlq \$29, $ACC0, $TEMP1
vpand $AND_MASK, $ACC0, $ACC0
vpsrlq \$29, $ACC1, $TEMP2
vpand $AND_MASK, $ACC1, $ACC1
vpsrlq \$29, $ACC2, $TEMP3
vpermq \$0x93, $TEMP1, $TEMP1
vpand $AND_MASK, $ACC2, $ACC2
vpsrlq \$29, $ACC3, $TEMP4
vpermq \$0x93, $TEMP2, $TEMP2
vpand $AND_MASK, $ACC3, $ACC3
vpermq \$0x93, $TEMP3, $TEMP3
vpblendd \$3, $ZERO, $TEMP1, $TEMP0
vpermq \$0x93, $TEMP4, $TEMP4
vpblendd \$3, $TEMP1, $TEMP2, $TEMP1
vpaddq $TEMP0, $ACC0, $ACC0
vpblendd \$3, $TEMP2, $TEMP3, $TEMP2
vpaddq $TEMP1, $ACC1, $ACC1
vpblendd \$3, $TEMP3, $TEMP4, $TEMP3
vpaddq $TEMP2, $ACC2, $ACC2
vpblendd \$3, $TEMP4, $ZERO, $TEMP4
vpaddq $TEMP3, $ACC3, $ACC3
vpaddq $TEMP4, $ACC4, $ACC4
vmovdqu $ACC0, 0-128($rp)
vmovdqu $ACC1, 32-128($rp)
vmovdqu $ACC2, 64-128($rp)
vmovdqu $ACC3, 96-128($rp)
___
$TEMP5=$ACC0;
$code.=<<___;
vpsrlq \$29, $ACC4, $TEMP1
vpand $AND_MASK, $ACC4, $ACC4
vpsrlq \$29, $ACC5, $TEMP2
vpand $AND_MASK, $ACC5, $ACC5
vpsrlq \$29, $ACC6, $TEMP3
vpermq \$0x93, $TEMP1, $TEMP1
vpand $AND_MASK, $ACC6, $ACC6
vpsrlq \$29, $ACC7, $TEMP4
vpermq \$0x93, $TEMP2, $TEMP2
vpand $AND_MASK, $ACC7, $ACC7
vpsrlq \$29, $ACC8, $TEMP5
vpermq \$0x93, $TEMP3, $TEMP3
vpand $AND_MASK, $ACC8, $ACC8
vpermq \$0x93, $TEMP4, $TEMP4
vpblendd \$3, $ZERO, $TEMP1, $TEMP0
vpermq \$0x93, $TEMP5, $TEMP5
vpblendd \$3, $TEMP1, $TEMP2, $TEMP1
vpaddq $TEMP0, $ACC4, $ACC4
vpblendd \$3, $TEMP2, $TEMP3, $TEMP2
vpaddq $TEMP1, $ACC5, $ACC5
vpblendd \$3, $TEMP3, $TEMP4, $TEMP3
vpaddq $TEMP2, $ACC6, $ACC6
vpblendd \$3, $TEMP4, $TEMP5, $TEMP4
vpaddq $TEMP3, $ACC7, $ACC7
vpaddq $TEMP4, $ACC8, $ACC8
vpsrlq \$29, $ACC4, $TEMP1
vpand $AND_MASK, $ACC4, $ACC4
vpsrlq \$29, $ACC5, $TEMP2
vpand $AND_MASK, $ACC5, $ACC5
vpsrlq \$29, $ACC6, $TEMP3
vpermq \$0x93, $TEMP1, $TEMP1
vpand $AND_MASK, $ACC6, $ACC6
vpsrlq \$29, $ACC7, $TEMP4
vpermq \$0x93, $TEMP2, $TEMP2
vpand $AND_MASK, $ACC7, $ACC7
vpsrlq \$29, $ACC8, $TEMP5
vpermq \$0x93, $TEMP3, $TEMP3
vpand $AND_MASK, $ACC8, $ACC8
vpermq \$0x93, $TEMP4, $TEMP4
vpblendd \$3, $ZERO, $TEMP1, $TEMP0
vpermq \$0x93, $TEMP5, $TEMP5
vpblendd \$3, $TEMP1, $TEMP2, $TEMP1
vpaddq $TEMP0, $ACC4, $ACC4
vpblendd \$3, $TEMP2, $TEMP3, $TEMP2
vpaddq $TEMP1, $ACC5, $ACC5
vpblendd \$3, $TEMP3, $TEMP4, $TEMP3
vpaddq $TEMP2, $ACC6, $ACC6
vpblendd \$3, $TEMP4, $TEMP5, $TEMP4
vpaddq $TEMP3, $ACC7, $ACC7
vpaddq $TEMP4, $ACC8, $ACC8
vmovdqu $ACC4, 128-128($rp)
vmovdqu $ACC5, 160-128($rp)
vmovdqu $ACC6, 192-128($rp)
vmovdqu $ACC7, 224-128($rp)
vmovdqu $ACC8, 256-128($rp)
vzeroupper
mov %rbp, %rax
___
$code.=<<___ if ($win64);
movaps -0xd8(%rax),%xmm6
movaps -0xc8(%rax),%xmm7
movaps -0xb8(%rax),%xmm8
movaps -0xa8(%rax),%xmm9
movaps -0x98(%rax),%xmm10
movaps -0x88(%rax),%xmm11
movaps -0x78(%rax),%xmm12
movaps -0x68(%rax),%xmm13
movaps -0x58(%rax),%xmm14
movaps -0x48(%rax),%xmm15
___
$code.=<<___;
mov -48(%rax),%r15
mov -40(%rax),%r14
mov -32(%rax),%r13
mov -24(%rax),%r12
mov -16(%rax),%rbp
mov -8(%rax),%rbx
lea (%rax),%rsp # restore %rsp
.Lmul_1024_epilogue:
ret
.size rsaz_1024_mul_avx2,.-rsaz_1024_mul_avx2
___
}
{
my ($out,$inp) = $win64 ? ("%rcx","%rdx") : ("%rdi","%rsi");
my @T = map("%r$_",(8..11));
$code.=<<___;
.globl rsaz_1024_red2norm_avx2
.type rsaz_1024_red2norm_avx2,\@abi-omnipotent
.align 32
rsaz_1024_red2norm_avx2:
sub \$-128,$inp # size optimization
xor %rax,%rax
___
for ($j=0,$i=0; $i<16; $i++) {
my $k=0;
while (29*$j<64*($i+1)) { # load data till boundary
$code.=" mov `8*$j-128`($inp), @T[0]\n";
$j++; $k++; push(@T,shift(@T));
}
$l=$k;
while ($k>1) { # shift loaded data but last value
$code.=" shl \$`29*($j-$k)`,@T[-$k]\n";
$k--;
}
$code.=<<___; # shift last value
mov @T[-1], @T[0]
shl \$`29*($j-1)`, @T[-1]
shr \$`-29*($j-1)`, @T[0]
___
while ($l) { # accumulate all values
$code.=" add @T[-$l], %rax\n";
$l--;
}
$code.=<<___;
adc \$0, @T[0] # consume eventual carry
mov %rax, 8*$i($out)
mov @T[0], %rax
___
push(@T,shift(@T));
}
$code.=<<___;
ret
.size rsaz_1024_red2norm_avx2,.-rsaz_1024_red2norm_avx2
.globl rsaz_1024_norm2red_avx2
.type rsaz_1024_norm2red_avx2,\@abi-omnipotent
.align 32
rsaz_1024_norm2red_avx2:
sub \$-128,$out # size optimization
mov ($inp),@T[0]
mov \$0x1fffffff,%eax
___
for ($j=0,$i=0; $i<16; $i++) {
$code.=" mov `8*($i+1)`($inp),@T[1]\n" if ($i<15);
$code.=" xor @T[1],@T[1]\n" if ($i==15);
my $k=1;
while (29*($j+1)<64*($i+1)) {
$code.=<<___;
mov @T[0],@T[-$k]
shr \$`29*$j`,@T[-$k]
and %rax,@T[-$k] # &0x1fffffff
mov @T[-$k],`8*$j-128`($out)
___
$j++; $k++;
}
$code.=<<___;
shrd \$`29*$j`,@T[1],@T[0]
and %rax,@T[0]
mov @T[0],`8*$j-128`($out)
___
$j++;
push(@T,shift(@T));
}
$code.=<<___;
mov @T[0],`8*$j-128`($out) # zero
mov @T[0],`8*($j+1)-128`($out)
mov @T[0],`8*($j+2)-128`($out)
mov @T[0],`8*($j+3)-128`($out)
ret
.size rsaz_1024_norm2red_avx2,.-rsaz_1024_norm2red_avx2
___
}
{
my ($out,$inp,$power) = $win64 ? ("%rcx","%rdx","%r8d") : ("%rdi","%rsi","%edx");
$code.=<<___;
.globl rsaz_1024_scatter5_avx2
.type rsaz_1024_scatter5_avx2,\@abi-omnipotent
.align 32
rsaz_1024_scatter5_avx2:
vzeroupper
vmovdqu .Lscatter_permd(%rip),%ymm5
shl \$4,$power
lea ($out,$power),$out
mov \$9,%eax
jmp .Loop_scatter_1024
.align 32
.Loop_scatter_1024:
vmovdqu ($inp),%ymm0
lea 32($inp),$inp
vpermd %ymm0,%ymm5,%ymm0
vmovdqu %xmm0,($out)
lea 16*32($out),$out
dec %eax
jnz .Loop_scatter_1024
vzeroupper
ret
.size rsaz_1024_scatter5_avx2,.-rsaz_1024_scatter5_avx2
.globl rsaz_1024_gather5_avx2
.type rsaz_1024_gather5_avx2,\@abi-omnipotent
.align 32
rsaz_1024_gather5_avx2:
vzeroupper
mov %rsp,%r11
___
$code.=<<___ if ($win64);
lea -0x88(%rsp),%rax
.LSEH_begin_rsaz_1024_gather5:
# I can't trust assembler to use specific encoding:-(
.byte 0x48,0x8d,0x60,0xe0 # lea -0x20(%rax),%rsp
.byte 0xc5,0xf8,0x29,0x70,0xe0 # vmovaps %xmm6,-0x20(%rax)
.byte 0xc5,0xf8,0x29,0x78,0xf0 # vmovaps %xmm7,-0x10(%rax)
.byte 0xc5,0x78,0x29,0x40,0x00 # vmovaps %xmm8,0(%rax)
.byte 0xc5,0x78,0x29,0x48,0x10 # vmovaps %xmm9,0x10(%rax)
.byte 0xc5,0x78,0x29,0x50,0x20 # vmovaps %xmm10,0x20(%rax)
.byte 0xc5,0x78,0x29,0x58,0x30 # vmovaps %xmm11,0x30(%rax)
.byte 0xc5,0x78,0x29,0x60,0x40 # vmovaps %xmm12,0x40(%rax)
.byte 0xc5,0x78,0x29,0x68,0x50 # vmovaps %xmm13,0x50(%rax)
.byte 0xc5,0x78,0x29,0x70,0x60 # vmovaps %xmm14,0x60(%rax)
.byte 0xc5,0x78,0x29,0x78,0x70 # vmovaps %xmm15,0x70(%rax)
___
$code.=<<___;
lea -0x100(%rsp),%rsp
and \$-32, %rsp
lea .Linc(%rip), %r10
lea -128(%rsp),%rax # control u-op density
vmovd $power, %xmm4
vmovdqa (%r10),%ymm0
vmovdqa 32(%r10),%ymm1
vmovdqa 64(%r10),%ymm5
vpbroadcastd %xmm4,%ymm4
vpaddd %ymm5, %ymm0, %ymm2
vpcmpeqd %ymm4, %ymm0, %ymm0
vpaddd %ymm5, %ymm1, %ymm3
vpcmpeqd %ymm4, %ymm1, %ymm1
vmovdqa %ymm0, 32*0+128(%rax)
vpaddd %ymm5, %ymm2, %ymm0
vpcmpeqd %ymm4, %ymm2, %ymm2
vmovdqa %ymm1, 32*1+128(%rax)
vpaddd %ymm5, %ymm3, %ymm1
vpcmpeqd %ymm4, %ymm3, %ymm3
vmovdqa %ymm2, 32*2+128(%rax)
vpaddd %ymm5, %ymm0, %ymm2
vpcmpeqd %ymm4, %ymm0, %ymm0
vmovdqa %ymm3, 32*3+128(%rax)
vpaddd %ymm5, %ymm1, %ymm3
vpcmpeqd %ymm4, %ymm1, %ymm1
vmovdqa %ymm0, 32*4+128(%rax)
vpaddd %ymm5, %ymm2, %ymm8
vpcmpeqd %ymm4, %ymm2, %ymm2
vmovdqa %ymm1, 32*5+128(%rax)
vpaddd %ymm5, %ymm3, %ymm9
vpcmpeqd %ymm4, %ymm3, %ymm3
vmovdqa %ymm2, 32*6+128(%rax)
vpaddd %ymm5, %ymm8, %ymm10
vpcmpeqd %ymm4, %ymm8, %ymm8
vmovdqa %ymm3, 32*7+128(%rax)
vpaddd %ymm5, %ymm9, %ymm11
vpcmpeqd %ymm4, %ymm9, %ymm9
vpaddd %ymm5, %ymm10, %ymm12
vpcmpeqd %ymm4, %ymm10, %ymm10
vpaddd %ymm5, %ymm11, %ymm13
vpcmpeqd %ymm4, %ymm11, %ymm11
vpaddd %ymm5, %ymm12, %ymm14
vpcmpeqd %ymm4, %ymm12, %ymm12
vpaddd %ymm5, %ymm13, %ymm15
vpcmpeqd %ymm4, %ymm13, %ymm13
vpcmpeqd %ymm4, %ymm14, %ymm14
vpcmpeqd %ymm4, %ymm15, %ymm15
vmovdqa -32(%r10),%ymm7 # .Lgather_permd
lea 128($inp), $inp
mov \$9,$power
.Loop_gather_1024:
vmovdqa 32*0-128($inp), %ymm0
vmovdqa 32*1-128($inp), %ymm1
vmovdqa 32*2-128($inp), %ymm2
vmovdqa 32*3-128($inp), %ymm3
vpand 32*0+128(%rax), %ymm0, %ymm0
vpand 32*1+128(%rax), %ymm1, %ymm1
vpand 32*2+128(%rax), %ymm2, %ymm2
vpor %ymm0, %ymm1, %ymm4
vpand 32*3+128(%rax), %ymm3, %ymm3
vmovdqa 32*4-128($inp), %ymm0
vmovdqa 32*5-128($inp), %ymm1
vpor %ymm2, %ymm3, %ymm5
vmovdqa 32*6-128($inp), %ymm2
vmovdqa 32*7-128($inp), %ymm3
vpand 32*4+128(%rax), %ymm0, %ymm0
vpand 32*5+128(%rax), %ymm1, %ymm1
vpand 32*6+128(%rax), %ymm2, %ymm2
vpor %ymm0, %ymm4, %ymm4
vpand 32*7+128(%rax), %ymm3, %ymm3
vpand 32*8-128($inp), %ymm8, %ymm0
vpor %ymm1, %ymm5, %ymm5
vpand 32*9-128($inp), %ymm9, %ymm1
vpor %ymm2, %ymm4, %ymm4
vpand 32*10-128($inp),%ymm10, %ymm2
vpor %ymm3, %ymm5, %ymm5
vpand 32*11-128($inp),%ymm11, %ymm3
vpor %ymm0, %ymm4, %ymm4
vpand 32*12-128($inp),%ymm12, %ymm0
vpor %ymm1, %ymm5, %ymm5
vpand 32*13-128($inp),%ymm13, %ymm1
vpor %ymm2, %ymm4, %ymm4
vpand 32*14-128($inp),%ymm14, %ymm2
vpor %ymm3, %ymm5, %ymm5
vpand 32*15-128($inp),%ymm15, %ymm3
lea 32*16($inp), $inp
vpor %ymm0, %ymm4, %ymm4
vpor %ymm1, %ymm5, %ymm5
vpor %ymm2, %ymm4, %ymm4
vpor %ymm3, %ymm5, %ymm5
vpor %ymm5, %ymm4, %ymm4
vextracti128 \$1, %ymm4, %xmm5 # upper half is cleared
vpor %xmm4, %xmm5, %xmm5
vpermd %ymm5,%ymm7,%ymm5
vmovdqu %ymm5,($out)
lea 32($out),$out
dec $power
jnz .Loop_gather_1024
vpxor %ymm0,%ymm0,%ymm0
vmovdqu %ymm0,($out)
vzeroupper
___
$code.=<<___ if ($win64);
movaps -0xa8(%r11),%xmm6
movaps -0x98(%r11),%xmm7
movaps -0x88(%r11),%xmm8
movaps -0x78(%r11),%xmm9
movaps -0x68(%r11),%xmm10
movaps -0x58(%r11),%xmm11
movaps -0x48(%r11),%xmm12
movaps -0x38(%r11),%xmm13
movaps -0x28(%r11),%xmm14
movaps -0x18(%r11),%xmm15
.LSEH_end_rsaz_1024_gather5:
___
$code.=<<___;
lea (%r11),%rsp
ret
.size rsaz_1024_gather5_avx2,.-rsaz_1024_gather5_avx2
___
}
$code.=<<___;
.extern OPENSSL_ia32cap_P
.globl rsaz_avx2_eligible
.type rsaz_avx2_eligible,\@abi-omnipotent
.align 32
rsaz_avx2_eligible:
mov OPENSSL_ia32cap_P+8(%rip),%eax
___
$code.=<<___ if ($addx);
mov \$`1<<8|1<<19`,%ecx
mov \$0,%edx
and %eax,%ecx
cmp \$`1<<8|1<<19`,%ecx # check for BMI2+AD*X
cmove %edx,%eax
___
$code.=<<___;
and \$`1<<5`,%eax
shr \$5,%eax
ret
.size rsaz_avx2_eligible,.-rsaz_avx2_eligible
.align 64
.Land_mask:
.quad 0x1fffffff,0x1fffffff,0x1fffffff,-1
.Lscatter_permd:
.long 0,2,4,6,7,7,7,7
.Lgather_permd:
.long 0,7,1,7,2,7,3,7
.Linc:
.long 0,0,0,0, 1,1,1,1
.long 2,2,2,2, 3,3,3,3
.long 4,4,4,4, 4,4,4,4
.align 64
___
if ($win64) {
$rec="%rcx";
$frame="%rdx";
$context="%r8";
$disp="%r9";
$code.=<<___
.extern __imp_RtlVirtualUnwind
.type rsaz_se_handler,\@abi-omnipotent
.align 16
rsaz_se_handler:
push %rsi
push %rdi
push %rbx
push %rbp
push %r12
push %r13
push %r14
push %r15
pushfq
sub \$64,%rsp
mov 120($context),%rax # pull context->Rax
mov 248($context),%rbx # pull context->Rip
mov 8($disp),%rsi # disp->ImageBase
mov 56($disp),%r11 # disp->HandlerData
mov 0(%r11),%r10d # HandlerData[0]
lea (%rsi,%r10),%r10 # prologue label
cmp %r10,%rbx # context->Rip<prologue label
jb .Lcommon_seh_tail
mov 152($context),%rax # pull context->Rsp
mov 4(%r11),%r10d # HandlerData[1]
lea (%rsi,%r10),%r10 # epilogue label
cmp %r10,%rbx # context->Rip>=epilogue label
jae .Lcommon_seh_tail
mov 160($context),%rax # pull context->Rbp
mov -48(%rax),%r15
mov -40(%rax),%r14
mov -32(%rax),%r13
mov -24(%rax),%r12
mov -16(%rax),%rbp
mov -8(%rax),%rbx
mov %r15,240($context)
mov %r14,232($context)
mov %r13,224($context)
mov %r12,216($context)
mov %rbp,160($context)
mov %rbx,144($context)
lea -0xd8(%rax),%rsi # %xmm save area
lea 512($context),%rdi # & context.Xmm6
mov \$20,%ecx # 10*sizeof(%xmm0)/sizeof(%rax)
.long 0xa548f3fc # cld; rep movsq
.Lcommon_seh_tail:
mov 8(%rax),%rdi
mov 16(%rax),%rsi
mov %rax,152($context) # restore context->Rsp
mov %rsi,168($context) # restore context->Rsi
mov %rdi,176($context) # restore context->Rdi
mov 40($disp),%rdi # disp->ContextRecord
mov $context,%rsi # context
mov \$154,%ecx # sizeof(CONTEXT)
.long 0xa548f3fc # cld; rep movsq
mov $disp,%rsi
xor %rcx,%rcx # arg1, UNW_FLAG_NHANDLER
mov 8(%rsi),%rdx # arg2, disp->ImageBase
mov 0(%rsi),%r8 # arg3, disp->ControlPc
mov 16(%rsi),%r9 # arg4, disp->FunctionEntry
mov 40(%rsi),%r10 # disp->ContextRecord
lea 56(%rsi),%r11 # &disp->HandlerData
lea 24(%rsi),%r12 # &disp->EstablisherFrame
mov %r10,32(%rsp) # arg5
mov %r11,40(%rsp) # arg6
mov %r12,48(%rsp) # arg7
mov %rcx,56(%rsp) # arg8, (NULL)
call *__imp_RtlVirtualUnwind(%rip)
mov \$1,%eax # ExceptionContinueSearch
add \$64,%rsp
popfq
pop %r15
pop %r14
pop %r13
pop %r12
pop %rbp
pop %rbx
pop %rdi
pop %rsi
ret
.size rsaz_se_handler,.-rsaz_se_handler
.section .pdata
.align 4
.rva .LSEH_begin_rsaz_1024_sqr_avx2
.rva .LSEH_end_rsaz_1024_sqr_avx2
.rva .LSEH_info_rsaz_1024_sqr_avx2
.rva .LSEH_begin_rsaz_1024_mul_avx2
.rva .LSEH_end_rsaz_1024_mul_avx2
.rva .LSEH_info_rsaz_1024_mul_avx2
.rva .LSEH_begin_rsaz_1024_gather5
.rva .LSEH_end_rsaz_1024_gather5
.rva .LSEH_info_rsaz_1024_gather5
.section .xdata
.align 8
.LSEH_info_rsaz_1024_sqr_avx2:
.byte 9,0,0,0
.rva rsaz_se_handler
.rva .Lsqr_1024_body,.Lsqr_1024_epilogue
.LSEH_info_rsaz_1024_mul_avx2:
.byte 9,0,0,0
.rva rsaz_se_handler
.rva .Lmul_1024_body,.Lmul_1024_epilogue
.LSEH_info_rsaz_1024_gather5:
.byte 0x01,0x36,0x17,0x0b
.byte 0x36,0xf8,0x09,0x00 # vmovaps 0x90(rsp),xmm15
.byte 0x31,0xe8,0x08,0x00 # vmovaps 0x80(rsp),xmm14
.byte 0x2c,0xd8,0x07,0x00 # vmovaps 0x70(rsp),xmm13
.byte 0x27,0xc8,0x06,0x00 # vmovaps 0x60(rsp),xmm12
.byte 0x22,0xb8,0x05,0x00 # vmovaps 0x50(rsp),xmm11
.byte 0x1d,0xa8,0x04,0x00 # vmovaps 0x40(rsp),xmm10
.byte 0x18,0x98,0x03,0x00 # vmovaps 0x30(rsp),xmm9
.byte 0x13,0x88,0x02,0x00 # vmovaps 0x20(rsp),xmm8
.byte 0x0e,0x78,0x01,0x00 # vmovaps 0x10(rsp),xmm7
.byte 0x09,0x68,0x00,0x00 # vmovaps 0x00(rsp),xmm6
.byte 0x04,0x01,0x15,0x00 # sub rsp,0xa8
.byte 0x00,0xb3,0x00,0x00 # set_frame r11
___
}
foreach (split("\n",$code)) {
s/\`([^\`]*)\`/eval($1)/ge;
s/\b(sh[rl]d?\s+\$)(-?[0-9]+)/$1.$2%64/ge or
s/\b(vmov[dq])\b(.+)%ymm([0-9]+)/$1$2%xmm$3/go or
s/\b(vmovdqu)\b(.+)%x%ymm([0-9]+)/$1$2%xmm$3/go or
s/\b(vpinsr[qd])\b(.+)%ymm([0-9]+)/$1$2%xmm$3/go or
s/\b(vpextr[qd])\b(.+)%ymm([0-9]+)/$1$2%xmm$3/go or
s/\b(vpbroadcast[qd]\s+)%ymm([0-9]+)/$1%xmm$2/go;
print $_,"\n";
}
}}} else {{{
print <<___; # assembler is too old
.text
.globl rsaz_avx2_eligible
.type rsaz_avx2_eligible,\@abi-omnipotent
rsaz_avx2_eligible:
xor %eax,%eax
ret
.size rsaz_avx2_eligible,.-rsaz_avx2_eligible
.globl rsaz_1024_sqr_avx2
.globl rsaz_1024_mul_avx2
.globl rsaz_1024_norm2red_avx2
.globl rsaz_1024_red2norm_avx2
.globl rsaz_1024_scatter5_avx2
.globl rsaz_1024_gather5_avx2
.type rsaz_1024_sqr_avx2,\@abi-omnipotent
rsaz_1024_sqr_avx2:
rsaz_1024_mul_avx2:
rsaz_1024_norm2red_avx2:
rsaz_1024_red2norm_avx2:
rsaz_1024_scatter5_avx2:
rsaz_1024_gather5_avx2:
.byte 0x0f,0x0b # ud2
ret
.size rsaz_1024_sqr_avx2,.-rsaz_1024_sqr_avx2
___
}}}
close STDOUT;
| 27.598664 | 87 | 0.622638 |
73f049b0588fed2d09062938c416227f7fff4dee | 2,515 | pl | Perl | perl/lib/unicore/lib/Gc/P.pl | luiscarlosg27/xampp | c295dbdd435c9c62fbd4cc6fc42097bea7a900a0 | [
"Apache-2.0"
]
| 2 | 2021-11-19T22:37:28.000Z | 2021-11-22T18:04:55.000Z | perl/lib/unicore/lib/Gc/P.pl | luiscarlosg27/xampp | c295dbdd435c9c62fbd4cc6fc42097bea7a900a0 | [
"Apache-2.0"
]
| 6 | 2021-11-18T00:39:48.000Z | 2021-11-20T00:31:40.000Z | perl/lib/unicore/lib/Gc/P.pl | luiscarlosg27/xampp | c295dbdd435c9c62fbd4cc6fc42097bea7a900a0 | [
"Apache-2.0"
]
| null | null | null | # !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
# This file is machine-generated by ..\lib\unicore\mktables from the Unicode
# database, Version 13.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';
V370
33
36
37
43
44
48
58
60
63
65
91
94
95
96
123
124
125
126
161
162
167
168
171
172
182
184
187
188
191
192
894
895
903
904
1370
1376
1417
1419
1470
1471
1472
1473
1475
1476
1478
1479
1523
1525
1545
1547
1548
1550
1563
1564
1566
1568
1642
1646
1748
1749
1792
1806
2039
2042
2096
2111
2142
2143
2404
2406
2416
2417
2557
2558
2678
2679
2800
2801
3191
3192
3204
3205
3572
3573
3663
3664
3674
3676
3844
3859
3860
3861
3898
3902
3973
3974
4048
4053
4057
4059
4170
4176
4347
4348
4960
4969
5120
5121
5742
5743
5787
5789
5867
5870
5941
5943
6100
6103
6104
6107
6144
6155
6468
6470
6686
6688
6816
6823
6824
6830
7002
7009
7164
7168
7227
7232
7294
7296
7360
7368
7379
7380
8208
8232
8240
8260
8261
8274
8275
8287
8317
8319
8333
8335
8968
8972
9001
9003
10088
10102
10181
10183
10214
10224
10627
10649
10712
10716
10748
10750
11513
11517
11518
11520
11632
11633
11776
11823
11824
11856
11858
11859
12289
12292
12296
12306
12308
12320
12336
12337
12349
12350
12448
12449
12539
12540
42238
42240
42509
42512
42611
42612
42622
42623
42738
42744
43124
43128
43214
43216
43256
43259
43260
43261
43310
43312
43359
43360
43457
43470
43486
43488
43612
43616
43742
43744
43760
43762
44011
44012
64830
64832
65040
65050
65072
65107
65108
65122
65123
65124
65128
65129
65130
65132
65281
65284
65285
65291
65292
65296
65306
65308
65311
65313
65339
65342
65343
65344
65371
65372
65373
65374
65375
65382
65792
65795
66463
66464
66512
66513
66927
66928
67671
67672
67871
67872
67903
67904
68176
68185
68223
68224
68336
68343
68409
68416
68505
68509
69293
69294
69461
69466
69703
69710
69819
69821
69822
69826
69952
69956
70004
70006
70085
70089
70093
70094
70107
70108
70109
70112
70200
70206
70313
70314
70731
70736
70746
70748
70749
70750
70854
70855
71105
71128
71233
71236
71264
71277
71484
71487
71739
71740
72004
72007
72162
72163
72255
72263
72346
72349
72350
72355
72769
72774
72816
72818
73463
73465
73727
73728
74864
74869
92782
92784
92917
92918
92983
92988
92996
92997
93847
93851
94178
94179
113823
113824
121479
121484
125278
125280
END
| 6.532468 | 77 | 0.79006 |
ed13c2e2a2f4269575f951e5783ed382d3bd4909 | 3,747 | pm | Perl | auto-lib/Paws/Lightsail/CreateContainerServiceDeployment.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/Lightsail/CreateContainerServiceDeployment.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/Lightsail/CreateContainerServiceDeployment.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
]
| 87 | 2015-04-22T06:29:47.000Z | 2021-09-29T14:45:55.000Z |
package Paws::Lightsail::CreateContainerServiceDeployment;
use Moose;
has Containers => (is => 'ro', isa => 'Paws::Lightsail::ContainerMap', traits => ['NameInRequest'], request_name => 'containers' );
has PublicEndpoint => (is => 'ro', isa => 'Paws::Lightsail::EndpointRequest', traits => ['NameInRequest'], request_name => 'publicEndpoint' );
has ServiceName => (is => 'ro', isa => 'Str', traits => ['NameInRequest'], request_name => 'serviceName' , required => 1);
use MooseX::ClassAttribute;
class_has _api_call => (isa => 'Str', is => 'ro', default => 'CreateContainerServiceDeployment');
class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::Lightsail::CreateContainerServiceDeploymentResult');
class_has _result_key => (isa => 'Str', is => 'ro');
1;
### main pod documentation begin ###
=head1 NAME
Paws::Lightsail::CreateContainerServiceDeployment - Arguments for method CreateContainerServiceDeployment on L<Paws::Lightsail>
=head1 DESCRIPTION
This class represents the parameters used for calling the method CreateContainerServiceDeployment on the
L<Amazon Lightsail|Paws::Lightsail> service. Use the attributes of this class
as arguments to method CreateContainerServiceDeployment.
You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to CreateContainerServiceDeployment.
=head1 SYNOPSIS
my $lightsail = Paws->service('Lightsail');
my $CreateContainerServiceDeploymentResult =
$lightsail->CreateContainerServiceDeployment(
ServiceName => 'MyContainerServiceName',
Containers => {
'MyContainerName' => {
Command => [ 'Mystring', ... ], # OPTIONAL
Environment => { 'Mystring' => 'Mystring', }, # OPTIONAL
Image => 'Mystring',
Ports => {
'Mystring' => 'HTTP', # , value: values: HTTP, HTTPS, TCP, UDP
}, # OPTIONAL
}, # key: min: 1, max: 53
}, # OPTIONAL
PublicEndpoint => {
ContainerName => 'Mystring',
ContainerPort => 1,
HealthCheck => {
HealthyThreshold => 1,
IntervalSeconds => 1,
Path => 'Mystring',
SuccessCodes => 'Mystring',
TimeoutSeconds => 1,
UnhealthyThreshold => 1,
}, # OPTIONAL
}, # OPTIONAL
);
# Results:
my $ContainerService =
$CreateContainerServiceDeploymentResult->ContainerService;
# Returns a L<Paws::Lightsail::CreateContainerServiceDeploymentResult> 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/lightsail/CreateContainerServiceDeployment>
=head1 ATTRIBUTES
=head2 Containers => L<Paws::Lightsail::ContainerMap>
An object that describes the settings of the containers that will be
launched on the container service.
=head2 PublicEndpoint => L<Paws::Lightsail::EndpointRequest>
An object that describes the settings of the public endpoint for the
container service.
=head2 B<REQUIRED> ServiceName => Str
The name of the container service for which to create the deployment.
=head1 SEE ALSO
This class forms part of L<Paws>, documenting arguments for method CreateContainerServiceDeployment in L<Paws::Lightsail>
=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
| 36.028846 | 249 | 0.680278 |
ed3a44d60137de1dd4ec658e45657a10c72f5af8 | 1,018 | t | Perl | perl/src/lib/ExtUtils/t/maketext_filter.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/maketext_filter.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/maketext_filter.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' if -d 't';
@INC = '../lib';
}
else {
unshift @INC, 't/lib';
}
}
chdir 't';
use Test::More tests => 6;
use ExtUtils::MakeMaker;
use ExtUtils::MM_VMS;
sub test_filter {
my($text, $vms_text) = @_;
local $Test::Builder::Level = $Test::Builder::Level + 1;
is( ExtUtils::MM_Any->maketext_filter($text), $text, 'default filter' );
is( ExtUtils::MM_VMS->maketext_filter($text), $vms_text, 'VMS filter' );
}
# VMS filter puts a space after the target
test_filter(<<'END', <<'VMS');
foo: bar
thing: splat
END
foo : bar
thing: splat
VMS
# And it does it for all targets
test_filter(<<'END', <<'VMS');
foo: bar
thing: splat
up: down
yes
END
foo : bar
thing: splat
up : down
yes
VMS
# And it doesn't mess with macros
test_filter(<<'END', <<'VMS');
CLASS=Foo: Bar
target: stuff
$(PROGRAM) And::Stuff
END
CLASS=Foo: Bar
target : stuff
$(PROGRAM) And::Stuff
VMS
| 15.424242 | 80 | 0.591356 |
ed37dbd698dda9b8b9d412448e044397b1d136c4 | 10,078 | pl | Perl | src/ClusterDB.pl | SamTseng/CATAR | dab8efdebf71fc751e0aaf19f8fc6207fda8af21 | [
"MIT"
]
| 5 | 2019-02-09T17:25:27.000Z | 2021-08-12T10:35:50.000Z | src/ClusterDB.pl | SamTseng/CATAR | dab8efdebf71fc751e0aaf19f8fc6207fda8af21 | [
"MIT"
]
| null | null | null | src/ClusterDB.pl | SamTseng/CATAR | dab8efdebf71fc751e0aaf19f8fc6207fda8af21 | [
"MIT"
]
| null | null | null | #!/usr/bin/perl -s
# https://stackoverflow.com/questions/728597/how-can-my-perl-script-find-its-module-in-the-same-directory
use File::Basename;
use lib dirname (__FILE__);
use SamOpt qw(SamOpt); &SamOpt();
# This program is an example of using the APIs of DocCluster.pm. 2004/01/27
# You need SAM module or SAMtool module.
# You also need ShowDoc4.pl for showing full text content in a CGI environment.
# This program is copied from d:\dem\SAM\cluster\DocCluster.pm
# Except documents in files, this program allow documents in DB.
$Out2File = 0 if not defined $Out2File; # cluster results saved in DBMS
$Ogrp = 'Src_Data' if not defined $Ogrp; # set defualt group
# option $Ogrp is required if you want to change 'group' without changing INI
# if $Out2File is set to 1 then cluster output goes to an HTML file
$RunInCGI = (@ARGV > 0) ? 0 : 1;
$RunInCGI = 0 if $Odel; # this DOS command option needs no arguments
if ($RunInCGI) {
&RunInCGI();
} else { # if run in DOS
($IndexName, $IndexPath, $FileList) = @ARGV;
# $IndexName and $IndexPath are overrided by Cluster.ini
&RunInDOS();
}
exit;
sub RunInCGI {
use CGI qw/:standard/;
print "Content-type: text/html\n\n";
# Get and Set all necessary variables
# $IndexName = param('IndexName');
# $IndexPath = param('IndexPath');
# if ($IndexName eq '' or $IndexPath eq '') { # if not defined
# ($IndexName, $IndexPath) = ('doc', 'Result\doc');
# }
$Ogrp = param('Ogrp'); # this can override $IndexName and $IndexPath
# command options
$Ocut = param('Ocut');
$Odel = param('Odel');
$ORT = param('ORT');
# parameters for DBMS
$Ouid = param('Ouid');
# $Odsn = param('Odsn'); # DSN is set in Cluster.ini, 2005/08/17
# $Odsn = 'File' if $Odsn eq ''; # if not defined
# paramenters for clustering effect
$Oct_low_tf = param('Oct_low_tf');
$Olow_tf = param('Olow_tf');
$Otfc = param('Otfc');
$ONumCatTitleTerms = param('NumCatTitleTerms');
$OMaxCluster = param('MaxCluster');
$Othreshold = param('threshold');
$Ocut = $Othreshold if ($Othreshold >= 0 and $Othreshold <= 1.0);
#print "Ocut=$Ocut, Odsn=$Odsn, Ouid=$Ouid, ($IndexName, $IndexPath)<br>\n";
#print "thre=$Othreshold, MaxClu=$OMaxCluster, NumCat=$ONumCatTitleTerms<br>\n";
$htmlstr = &RunInDOS();
&OutPutResult($htmlstr);
}
# Use global: $Ouid, $Odsn, $Ogrp
sub OutPutResult {
my($htmlstr) = @_;
print <<END_OF_HTML;
<HTML>
<HEAD><META content='text/html; charset=big5'>
<META HTTP-EQUIV="Refresh" Content="0;URL=ListCluster.pl?UID=$Ouid&Action=0&Odsn=$rDC->{DSN}&Otable=$rDC->{Table}">
</HEAD>
<body>
</body></html>
END_OF_HTML
}
# variables begin with $O are options, they are given in command line
sub RunInDOS {
$stime = time();
$Olow_df = 2 if $Olow_df eq '';
$Ohigh_df = 30000 if $Ohigh_df eq '';
$Olow_tf = 1 if $Olow_tf eq '';
$Oct_low_tf = 1 if $Oct_low_tf eq '';
$Ocut = 0.0 if $Ocut eq '';
$ONumCatTitleTerms = 10 if $ONumCatTitleTerms eq '';
$OMaxCluster = 1000 if not $RunInCGI; # in DOS there is no limit
&Init();
# D:\demo\File>perl -s ClusterDB.pl -Odel -Odsn=File -Ouid=10 -Odebug
#print "<br>Ocut=$Ocut, Odel=$Odel<br>\n";
if ($Odel) { &DeleteRecords(@ARGV); &myexit(); }
# perl -s ClusterDB.pl -Oall -Ocut=0.5 -Ouid=20 -Odebug=1 -Ogrp=WG_RK 1 > term2\term2_0.5.html
# perl -s ClusterDB.pl -Oall -Ouid=20 -Odebug=1 -Ogrp=NSC_Seg_Abs6 1
# perl -s ClusterDB.pl -Oall -Ouid=20 -Olow_tf=1 -Oct_low_tf=1
# -Odebug=1 -Ogrp=envi01_dc -ODB=..\Source_Data\envi01\envi01.mdb 1
if ($Oall) { &FromDoc2CutTree(); &myexit(); }
if ($Oidx) { &FromIndex2CutTree(); &myexit(); }
# perl -s ClusterDB.pl -Osim -Ocut=0.9 -Ogrp=Src_Data -Odebug=1 1 > Result\doc5_0.9.html
if ($Osim) { &FromSim2CutTree(); &myexit(); }
# perl -s ClusterDB.pl -Ocut=0.98 -Oct_low_tf=0 -Odsn=File -Ouid=10 doc Result\doc
# perl -s ClusterDB.pl -Ocut=0.0 -Ouid=20 -Odebug=1 -Ogrp=NSC_Seg_Abs6 1
if ($Ocut) { $htmlstr = &FromFile2CutTree(); &myexit(); }
}
sub myexit {
$htmlstr = "<html><head><META content='text/html; charset=big5'></head>"
. "<body bgcolor=white>" . $htmlstr . "\n<br></body></html>";
#print $htmlstr; # comment on 2019/08/27
$etime = time();
print STDERR "\nIt takes ", $etime - $stime, " seconds for all the steps.\n" if $Odebug;
if ($RunInCGI) { return $htmlstr; }
}
# Use global variable : $Odebug, $Odsn, $Ouid, $IndexName, $IndexPath
# set global variables : $pro, $rDC
sub Init {
if ($Out2File) { # output to files
use Cluster;
$rDC = Cluster->new( { 'debug'=>1 } ); # do not support Cluster.ini
$rDC->SetValue('debug', $Odebug) if $Odebug;
} else { # output to DBMS
use ClusterDB;
$rDC = ClusterDB->new( { INI=>'Cluster.ini' } );
$rDC->SetValue('debug', $Odebug) if $Odebug;
# $rDC->InitDBMS($Odsn);
# $rDC->InitDBMS(); # DSN is set in Cluster.ini , 2005/08/17
$rDC->SetValue("MaxCluster", $OMaxCluster);
#print ", MaxCluster=$OMaxCluster<br>\n";
$rDC->SetValue("UID", $Ouid);
}
$rDC->SetValue('DocType', 'doc'); # 'doc' or 'term' (clustering)
# $value = $rDC->GetValue('DocType'); # get attribute's value if needed
$rDC->SetValue('IndexBy', 'me'); # or by 'WG' or 'me' (this program)
$rDC->SetValue('Save2File', 1); # default is 0
# if you want to save the results to files for fast later re-use,
# set 'Save2File' to 1 (0 otherwise), and set the next 2 attributes.
$rDC->SetValue('IndexName', $IndexName);
$rDC->SetValue('IndexPath', $IndexPath); # needed if 'IndexBy' is 'me'
# Next lines must be the last to override the above 2 lines
if ($Ogrp ne '') {
$rDC->SetValue('DefaultGroup', $Ogrp);
}
print STDERR "Ogrp=$Ogrp, ODB=$main::ODB\n" if $Odebug > 0;
$rDC->SetAttributes_by_DefaultGroup();
if (not $Out2File) { # output to files
# $rDC->InitDBMS($Odsn);
# $rDC->InitDBMS(); # DSN is set in Cluster.ini , 2005/08/17
$rDC->InitDBMS('', $main::ODB); # 2010/05/08
}
if ($OEng_Seg_Phrase) {# if using (only) manual-selected terms for indexing
$rDC->SetValue('Eng_Seg_Phrase', $OEng_Seg_Phrase);
if (-f $OEng_Seg_Phrase) {
require "./SetManualTerms.pl"; # You can add terms here
&SetManualTerms($rDC, $rDC->{'Seg'}, $OEng_Seg_Phrase);
} else {
die "Cannot read file:'$OEng_Seg_Phrase'";
}
}
$rDC->SetValue('OutputRelatedTerms', $ORT) if $ORT;
$rDC->SetValue('IdxTnoStem', $IdxTnoStem) if $IdxTnoStem;
# You can add Chinese stop words here
require "./StopWords.pl";
&SetStopWords($rDC, $rDC->{'Seg'});
$pro = Progress->new( {'OUT'=>*STDERR{IO},'Format'=>'percent'} );
}
sub DeleteRecords {
$rDC->DeleteDBMSRecords();
print "Data has been deleted";
exit;
}
# This function shows how to cluster the documents from the begining to the end.
sub FromDoc2CutTree {
# if 'IndexBy' is 'me' and not yet built the index, insert docs for later use
# foreach $term (@Term) { $rDC->AddIndexTerm( $term );#if extra terms needed
my($sot, $eot);
$sot = time();
if ($Osrc eq 'Dir') {
$tfn = $rDC->InitDocSrc('Dir', $FileList);
} else { # if ($Osrc eq 'DB')
# $DSN = 'File'; $sql = "select ID from Src_Data order by ID";
$DSN = $rDC->{DSN}; $sql = "select ID from $rDC->{Table} order by ID";
$tfn = $rDC->InitDocSrc('DB', $DSN, $sql);
}
$sql = "select ID, SNo, Fname, Dname, Dscpt from $rDC->{Table} where ID = ?";
$fi = 0; while (($DocPath, $title, $text) = $rDC->NextDoc($sql)) {
$fi++; last if $DocPath eq '';
# for ($fi = 0; $fi < $tfn; $fi++) {
# ($DocPath, $title, $text) = $rDC->NextDoc($sql);
$rDC->AddDoc($DocPath, $title, $text); # insert those to be clustered
$percent = $pro->ShowProgress($fi/$tfn, $percent) if $Odebug;
}
$percent = $pro->ShowProgress($fi/$tfn, $percent) if $Odebug;
$NumDoc = $rDC->SaveDocIndex() if $rDC->GetValue('Save2File');
$NumDoc = $rDC->GetValue('NumDoc'); # return number of documents inserted
$eot = time();
print STDERR " It takes ", $eot - $sot, " seconds to insert $tfn documents\n" if $Odebug;
&FromIndex2CutTree(); # Use option $Olow_tf, $Oct_low_tf
}
# If you have already saved the results, just read them back to compute
# another ways of clustering using different thresholds.
# Use option $Olow_tf, $Oct_low_tf
sub FromIndex2CutTree {
$rDC->SetValue('Method', 'CompleteLink'); # 'SingleLink', 'Cluto', or 'SOM'
$rDC->SetValue("low_df", $Olow_df); # do not use term whose df <= 1
$rDC->SetValue("high_df", $Ohigh_df); # do not use term whose df >= 30000
$rDC->SetValue("low_tf", $Olow_tf); # do not use those term whose tf in doc is<=0
my $NumDoc = $rDC->ReadDocIndex() if $rDC->GetValue('Save2File');
# $rDC->ReadSimilarity() if $rDC->GetValue('Save2File');
my $root = $rDC->DocSimilarity();
$rDC->SaveSimilarity() if $rDC->GetValue('Save2File');
&FromSim2CutTree(); # Use option $Oct_low_tf
}
# If you have already saved the pairs with similarity sorted,
# just read them back to compute another ways of clustering using different thresholds.
# Use option $Oct_low_tf
sub FromSim2CutTree {
$rDC->ReadSimilarity() if $rDC->GetValue('Save2File');
$rDC->CompleteLink();
$rDC->SaveTree() if $rDC->GetValue('Save2File');
&FromFile2CutTree(); # Use option $Oct_low_tf
}
# Given the clustered index and data in a directory, read these data back
# use a given threshold, cut the single cluster into small clusters.
# Use option $Oct_low_tf, $Ocut, $ONumCatTitleTerms
sub FromFile2CutTree {
$rDC->DeleteDBMSRecords(); # delete DBMS before inserting new records.
$NumDoc = $rDC->ReadDocIndex(); # for computing clusters' title terms
# $root = $rDC->ReadSimilarity(); # no longer needed for re-cluster
$rDC->ReadTree();
# set the URL to show the full content of the inserted file (using its )
$rDC->SetValue("ShowDoc", "http://localhost/cgi-ig/ShowDoc4.pl");
$rDC->SetValue('NumCatTitleTerms', $ONumCatTitleTerms);
$rDC->SetValue("ct_low_tf", $Oct_low_tf); # do not use term whose tf <= 1
$rDC->SetValue('ClusterTitle', $Otfc); # 'TFC');
$htmlstr = $rDC->CutTree($Ocut);
return $htmlstr;
}
| 40.637097 | 117 | 0.65261 |
ed0defe028bb6be94ef14c35a74d0563e515ae64 | 8,547 | pm | Perl | lib/Paubox_Email_SDK.pm | Paubox/paubox-perl-sdk | 01fd01835789cfdbfb33d9cfdcc8a9ad158b94ac | [
"Apache-2.0"
]
| 1 | 2020-07-17T07:15:49.000Z | 2020-07-17T07:15:49.000Z | lib/Paubox_Email_SDK.pm | Paubox/paubox-perl-sdk | 01fd01835789cfdbfb33d9cfdcc8a9ad158b94ac | [
"Apache-2.0"
]
| null | null | null | lib/Paubox_Email_SDK.pm | Paubox/paubox-perl-sdk | 01fd01835789cfdbfb33d9cfdcc8a9ad158b94ac | [
"Apache-2.0"
]
| null | null | null | package Paubox_Email_SDK;
use strict;
use warnings;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(
getEmailDisposition
sendMessage
);
our $VERSION = '1.2';
use Paubox_Email_SDK::ApiHelper;
use Paubox_Email_SDK::Message;
use JSON;
use Config::General;
use TryCatch;
use String::Util qw(trim);
use MIME::Base64;
my $apiKey ="";
my $apiUser="";
my $baseURL = "https://api.paubox.net:443/v1/";
#
# Default Constructor
#
sub new{
my $this = {};
try{
my $conf = Config::General -> new(
-ConfigFile => 'config.cfg',
-InterPolateVars => 1
);
my %config = $conf -> getall;
if(not defined $config{'apiKey'} or
$config{'apiKey'} eq ""
) {
die "apiKey is missing.";
}
if(
not defined $config{'apiUsername'} or
$config{'apiUsername'} eq ""
) {
die "apiUsername is missing.";
}
$apiKey = $config{'apiKey'};
$apiUser = $config{'apiUsername'};
bless $this;
} catch($err) {
die "Error: " .$err;
};
return $this;
}
#
# Private methods
#
sub _getAuthHeader {
return "Token token=" .$apiKey;
}
sub _returnforceSecureNotificationValue {
my ($forceSecureNotification) = @_;
my $forceSecureNotificationValue = "";
if( !defined($forceSecureNotification) || $forceSecureNotification eq "" ) {
return "";
}
else {
$forceSecureNotificationValue = trim ( lc $forceSecureNotification );
if ($forceSecureNotificationValue eq "true") {
return 1;
} elsif ($forceSecureNotificationValue eq "false") {
return 0;
} else {
return "";
}
}
}
sub _convertMsgObjtoJSONReqObj {
my ($msg) = @_;
my %reqObject;
my $encodedHtmlContent = undef;
my $forceSecureNotification = $msg -> {'forceSecureNotification'};
my $forceSecureNotificationValue = _returnforceSecureNotificationValue($forceSecureNotification);
if ( defined($msg -> {'html_content'}) and $msg -> {'html_content'} ne "" ) {
$encodedHtmlContent = trim (encode_base64($msg -> {'html_content'}) );
}
if($forceSecureNotificationValue eq "" ) {
%reqObject = (
data => {
message => {
recipients => $msg -> {'to'},
cc => $msg -> {'cc'},
bcc => $msg -> {'bcc'},
headers => {
subject => $msg -> {'subject'},
from => $msg -> {'from'},
'reply-to' => $msg -> {'replyTo'}
},
allowNonTLS => $msg -> {'allowNonTLS'},
content => {
'text/plain' => $msg -> {'text_content'},
'text/html' => $encodedHtmlContent
},
attachments => $msg -> {'attachments'},
},
});
}
else {
%reqObject = (
data => {
message => {
recipients => $msg -> {'to'},
cc => $msg -> {'cc'},
bcc => $msg -> {'bcc'},
headers => {
subject => $msg -> {'subject'},
from => $msg -> {'from'},
'reply-to' => $msg -> {'replyTo'}
},
allowNonTLS => $msg -> {'allowNonTLS'},
forceSecureNotification => $forceSecureNotificationValue,
content => {
'text/plain' => $msg -> {'text_content'},
'text/html' => $encodedHtmlContent
},
attachments => $msg -> {'attachments'},
},
});
}
return encode_json (\%reqObject);
}
#
# Public methods
#
#
# Get Email Disposition
#
sub getEmailDisposition {
my ($class,$sourceTrackingId) = @_;
my $apiResponseJSON = "";
try{
my $authHeader = _getAuthHeader() ;
my $apiUrl = "/message_receipt?sourceTrackingId=" . $sourceTrackingId;
my $apiHelper = Paubox_Email_SDK::ApiHelper -> new();
$apiResponseJSON = $apiHelper -> callToAPIByGet($baseURL.$apiUser, $apiUrl, $authHeader);
# Converting JSON api response to perl
my $apiResponsePERL = from_json($apiResponseJSON);
if (
!length $apiResponsePERL -> {'data'}
&& !length $apiResponsePERL -> {'sourceTrackingId'}
&& !length $apiResponsePERL -> {'errors'}
)
{
die $apiResponseJSON;
}
if (
defined $apiResponsePERL && defined $apiResponsePERL -> {'data'} && defined $apiResponsePERL -> {'data'} -> {'message'}
&& defined $apiResponsePERL -> {'data'} -> {'message'} -> {'message_deliveries'}
&& (scalar( @{ $apiResponsePERL -> {'data'} -> {'message'} -> {'message_deliveries'} } ) > 0 )
) {
foreach my $message_deliveries ( @{ $apiResponsePERL -> {'data'} -> {'message'} -> {'message_deliveries'} } ) {
if( $message_deliveries -> {'status'} -> {'openedStatus'} eq "" ) {
$message_deliveries -> {'status'} -> {'openedStatus'} = "unopened";
# Converting perl api response back to JSON
$apiResponseJSON = to_json($apiResponsePERL);
}
}
}
} catch($err) {
die $err;
};
return $apiResponseJSON;
}
#
# Send Email Message
#
sub sendMessage {
my ($class,$msgObj) = @_;
my $apiResponseJSON = "";
try{
my $apiUrl = "/messages";
my $reqBody = _convertMsgObjtoJSONReqObj($msgObj);
my $apiHelper = Paubox_Email_SDK::ApiHelper -> new();
$apiResponseJSON = $apiHelper -> callToAPIByPost($baseURL.$apiUser, $apiUrl, _getAuthHeader() , $reqBody);
# Converting JSON api response to perl
my $apiResponsePERL = from_json($apiResponseJSON);
if (
!length $apiResponsePERL -> {'data'}
&& !length $apiResponsePERL -> {'sourceTrackingId'}
&& !length $apiResponsePERL -> {'errors'}
)
{
die $apiResponseJSON;
}
} catch($err) {
die $err;
};
return $apiResponseJSON;
}
1;
__END__
=head1 NAME
Paubox_Email_SDK - Perl wrapper for the Paubox Transactional Email API (https://www.paubox.com/solutions/email-api).
=head1 SYNOPSIS
use strict;
use warnings;
use Paubox_Email_SDK;
my $messageObj = new Paubox_Email_SDK::Message(
'from' => 'sender@domain.com',
'to' => ['recipient@example.com'],
'subject' => 'Testing!',
'text_content' => 'Hello World!',
'html_content' => '<html><body><h1>Hello World!</h1></body></html>'
);
my $service = Paubox_Email_SDK -> new();
my $response = $service -> sendMessage($messageObj);
print $response;
=head1 DESCRIPTION
This is the official Perl wrapper for the Paubox Transactional Email API (https://www.paubox.com/solutions/email-api). It is currently in alpha development.
The Paubox Transactional Email API allows your application to send secure, HIPAA-compliant email via Paubox and track deliveries and opens. The API wrapper allows you to construct and send messages.
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2019 by Paubox Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=cut
| 29.371134 | 198 | 0.511057 |
ed51c751e99a259a9a0831fb2e389b18399b4b1f | 5,217 | pm | Perl | lib/WebService/IPStack.pm | kianmeng/webservice-ipstack | fa88452bf094e0c331276d92fb8c02c6f5b0cc60 | [
"Artistic-2.0"
]
| null | null | null | lib/WebService/IPStack.pm | kianmeng/webservice-ipstack | fa88452bf094e0c331276d92fb8c02c6f5b0cc60 | [
"Artistic-2.0"
]
| null | null | null | lib/WebService/IPStack.pm | kianmeng/webservice-ipstack | fa88452bf094e0c331276d92fb8c02c6f5b0cc60 | [
"Artistic-2.0"
]
| null | null | null | package WebService::IPStack;
use namespace::clean;
use strictures 2;
use utf8;
use Carp qw(confess);
use Moo;
use MooX::Enumeration;
use Types::Common::String qw(StrLength);
use Types::Standard qw(Str Enum);
with 'Role::REST::Client';
our $VERSION = '0.01';
has api_key => (
isa => StrLength[32],
is => 'rw',
required => 1,
);
has api_plan => (
is => 'rw',
isa => Enum[qw(free basic pro pro_plus)],
handles => [qw/ is_free is_basic is_pro is_pro_plus /],
default => sub { 'free' },
);
has api_url => (
isa => Str,
is => 'ro',
default => sub {
my $protocol = (shift->is_free) ? 'http' : 'https';
return qq|$protocol://api.ipstack.com/|;
},
);
sub lookup {
my ($self, $ip, $params) = @_;
return $self->_request($ip, $params);
}
sub bulk_lookup {
my ($self, $ips, $params) = @_;
confess 'Expect an array of IP address' if (ref $ips ne 'ARRAY');
if (!$self->is_pro || !$self->is_pro_plus) {
confess 'Bulk IP lookup only for Professional or Professional Plus subscription plan';
}
my $endpoint = join q|,|, $ips;
return $self->_request($endpoint, $params);
}
sub check {
my ($self, $params) = @_;
return $self->_request('check', $params);
}
sub _request {
my ($self, $endpoint, $params) = @_;
if (exists($params->{security}) && !$self->is_business_pro) {
confess 'Security data only for Professional Plus subscription plan';
}
my $format = exists($params->{output}) ? $params->{output} : 'json';
$self->set_persistent_header(
'User-Agent' => __PACKAGE__ . $WebService::IPStack::VERSION);
$self->server($self->api_url);
$self->type(qq|application/$format|);
my $queries = {access_key => $self->api_key};
$queries = {%{$queries}, %{$params}} if (defined $params);
my $response = $self->get($endpoint, $queries);
return $response->data;
}
1;
__END__
=encoding utf-8
=for stopwords ipstack geolocation hostname
=head1 NAME
WebService::IPStack - Perl library for IPStack's Geolocation API,
https://ipstack.com.
=head1 SYNOPSIS
use WebService::IPStack;
my $ipstack = WebService::IPStack->new(api_key => '1xxxxxxxxxxxxxxxxxxxxxxxxxxxxx32');
$ipstack->lookup('8.8.8.8');
=head1 DESCRIPTION
WebService::IPStack is a Perl library for obtaining Geolocation information on
IPv4 or IPv6 address.
=head1 DEVELOPMENT
Source repository at L<https://github.com/kianmeng/webservice-ipstack|https://github.com/kianmeng/webservice-ipstack>.
How to contribute? Follow through the L<CONTRIBUTING.md|https://github.com/kianmeng/webservice-ipstack/blob/master/CONTRIBUTING.md> document to setup your development environment.
=head1 METHODS
=head2 new($api_key, [$api_plan])
Construct a new WebService::IPStack instance.
=head3 api_key
Compulsory. The API access key used to make request through web service.
=head3 api_plan
Optional. The API subscription plan used when accessing the API. There are four
subscription plans: free, standard, pro, and pro_plus. The default subscription
plan is 'free'. The main difference between free and non-free subscription
plans are HTTPS encryption protocol support and additional information.
# The API request URL is http://api.ipstack.com/
my $ipstack = WebService::IPStack->new(api_key => '1xxxxxxxxxxxxxxxxxxxxxxxxxxxxx32');
print $ipstack->api_url;
# The API request URL is https://api.ipstack.com/
my $ipstack = WebService::IPStack->new(
api_key => '1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx32',
api_plan => 'standard'
);
print $ipstack->api_url;
=head3 api_url
The default API hostname and path. The protocol depends on the subscription plan.
=head2 lookup($ip_address, [%params])
Query and get an IP address information. Optionally you can add more settings
to adjust the output.
my $ipstack = WebService::IPStack->new(api_key => '1xxxxxxxxxxxxxxxxxxxxxxxxxxxxx32');
$ipstack->lookup('8.8.8.8');
# With optional parameters.
$ipstack->lookup('8.8.8.8', {hostname => 1, security => 1, output => 'xml'});
=head2 bulk_lookup($ip_address, [%params])
Only for paid subscription plans (standard, pro, or pro_plus). Query and get
multiple IP addresses information. Optionally you can add more settings to
adjust the output.
my $ipstack = WebService::IPStack->new(
api_key => '1xxxxxxxxxxxxxxxxxxxxxxxxxxxxx32',
api_plan => 'standard'
);
$ipstack->bulk_lookup(['8.8.8.8', '8.8.4.4']);
# With optional parameters.
$ipstack->bulk_lookup(['8.8.8.8', '8.8.4.4'], {language => 'zh'});
=head2 check([%params])
Look up the IP address details of the client which made the web service call.
Optionally you can add more settings to adjust the output.
my $ipstack = WebService::IPStack->new(api_key => '1xxxxxxxxxxxxxxxxxxxxxxxxxxxxx32');
$ipstack->check();
# With optional parameters.
$ipstack->check({hostname => 1, security => 1, output => xml});
=head1 AUTHOR
Kian Meng, Ang E<lt>kianmeng@cpan.orgE<gt>
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2019 Kian Meng, Ang.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
=cut
| 26.348485 | 179 | 0.680084 |
73d32888a3ce8238189e7579347463147aaa256e | 2,083 | pl | Perl | regress/usr.sbin/syslogd/args-client-tcp-octet-nontransp.pl | ArrogantWombatics/openbsd-src | 75721e1d44322953075b7c4b89337b163a395291 | [
"BSD-3-Clause"
]
| 1 | 2019-02-16T13:29:23.000Z | 2019-02-16T13:29:23.000Z | regress/usr.sbin/syslogd/args-client-tcp-octet-nontransp.pl | ArrogantWombatics/openbsd-src | 75721e1d44322953075b7c4b89337b163a395291 | [
"BSD-3-Clause"
]
| 1 | 2018-08-21T03:56:33.000Z | 2018-08-21T03:56:33.000Z | regress/usr.sbin/syslogd/args-client-tcp-octet-nontransp.pl | ArrogantWombaticus/openbsd-src | 75721e1d44322953075b7c4b89337b163a395291 | [
"BSD-3-Clause"
]
| null | null | null | # The syslogd listens on 127.0.0.1 TCP socket.
# The client writes octet counting and non transpatent framing in chunks.
# The syslogd writes it into a file and through a pipe.
# The syslogd passes it via UDP to the loghost.
# The server receives the message on its UDP socket.
# Find the message in client, file, pipe, syslogd, server log.
# Check that the file log contains all the messages.
use strict;
use warnings;
use Socket;
our %args = (
client => {
connect => { domain => AF_INET, proto => "tcp", addr => "127.0.0.1",
port => 514 },
func => sub {
my $self = shift;
local $| = 1;
print "2 ab";
${$self->{syslogd}}->loggrep("octet counting 2", 5, 1)
or die ref($self), " syslogd did not 1 octet counting";
print "2 c";
${$self->{syslogd}}->loggrep("octet counting 2", 5, 2)
or die ref($self), " syslogd did not 2 octet counting";
print "def\n";
${$self->{syslogd}}->loggrep("non transparent framing", 5, 1)
or die ref($self), " syslogd did not 1 non transparent framing";
print "g";
${$self->{syslogd}}->loggrep("non transparent framing", 5, 2)
or die ref($self), " syslogd did not 2 non transparent framing";
print "h\nij\n2 kl";
${$self->{syslogd}}->loggrep("octet counting 2", 5, 4)
or die ref($self), " syslogd did not 4 octet counting";
write_log($self);
},
},
syslogd => {
options => ["-T", "127.0.0.1:514"],
loggrep => {
qr/tcp logger .* octet counting 2, use 2 bytes/ => 3,
qr/tcp logger .* octet counting 2, incomplete frame, /.
qr/buffer 3 bytes/ => 1,
qr/tcp logger .* non transparent framing, use 3 bytes/ => 3,
qr/tcp logger .* non transparent framing, incomplete frame, /.
qr/buffer 1 bytes/ => 1,
qr/tcp logger .* use 0 bytes/ => 0,
qr/tcp logger .* unknown method/ => 0,
}
},
file => {
loggrep => {
qr/localhost ab$/ => 1,
qr/localhost cd$/ => 1,
qr/localhost ef$/ => 1,
qr/localhost gh$/ => 1,
qr/localhost ij$/ => 1,
qr/localhost kl$/ => 1,
get_testgrep() => 1,
},
},
);
1;
| 32.046154 | 73 | 0.596255 |
73f5137ae3dc73508a08feff4ca30a7304e446dc | 3,051 | pm | Perl | lib/pgBackRest/Protocol/Remote/Master.pm | marco44/pgbackrest | d211c2b8b51ae5b796bbb581d21a4a406e3ed972 | [
"MIT"
]
| 1 | 2019-10-24T07:34:30.000Z | 2019-10-24T07:34:30.000Z | lib/pgBackRest/Protocol/Remote/Master.pm | marco44/pgbackrest | d211c2b8b51ae5b796bbb581d21a4a406e3ed972 | [
"MIT"
]
| null | null | null | lib/pgBackRest/Protocol/Remote/Master.pm | marco44/pgbackrest | d211c2b8b51ae5b796bbb581d21a4a406e3ed972 | [
"MIT"
]
| null | null | null | ####################################################################################################################################
# PROTOCOL REMOTE MASTER MODULE
####################################################################################################################################
package pgBackRest::Protocol::Remote::Master;
use parent 'pgBackRest::Protocol::Command::Master';
use strict;
use warnings FATAL => qw(all);
use Carp qw(confess);
use File::Basename qw(dirname);
use pgBackRest::Common::Log;
use pgBackRest::Config::Config;
use pgBackRest::Protocol::Command::Master;
####################################################################################################################################
# CONSTRUCTOR
####################################################################################################################################
sub new
{
my $class = shift;
# Assign function parameters, defaults, and log debug info
my
(
$strOperation,
$strCommandSSH, # SSH client
$strCommand, # Command to execute on local/remote
$iBufferMax, # Maximum buffer size
$iCompressLevel, # Set compression level
$iCompressLevelNetwork, # Set compression level for network only compression
$strHost, # Host to connect to for remote (optional as this can also be used for local)
$strUser, # User to connect to for remote (must be set if strHost is set)
$iSshPort, # Specified if other than default port is needed for ssh
$iProtocolTimeout, # Protocol timeout
) =
logDebugParam
(
__PACKAGE__ . '->new', \@_,
{name => 'strCommandSSH'},
{name => 'strCommand'},
{name => 'iBufferMax'},
{name => 'iCompressLevel'},
{name => 'iCompressLevelNetwork'},
{name => 'strHost'},
{name => 'strUser'},
{name => 'iSshPort', required => false},
{name => 'iProtocolTimeout'},
);
my $strCommandSshPort = defined($iSshPort) ? '-p ' . $iSshPort . ' ' : '';
# Create SSH command
$strCommand =
"${strCommandSSH} -o LogLevel=error -o Compression=no -o PasswordAuthentication=no $strCommandSshPort" .
"${strUser}\@${strHost} '${strCommand}'";
# Init object and store variables
my $self = $class->SUPER::new(
'remote', "remote process on '$strHost'", $strCommand, $iBufferMax, $iCompressLevel, $iCompressLevelNetwork,
$iProtocolTimeout);
bless $self, $class;
# Store the host
$self->{strHost} = $strHost;
# Return from function and log return values if any
return logDebugReturn
(
$strOperation,
{name => 'self', value => $self}
);
}
1;
| 39.623377 | 132 | 0.450016 |
ed4d8321d81fda6cc442ff79bac2e0c01e92da82 | 6,734 | pm | Perl | perl/vendor/lib/LWP/Protocol/https.pm | Light2027/OnlineCampusSandbox | 8dcaaf62af1342470f9e7be6d42bd0f16eb910b8 | [
"Apache-2.0"
]
| 2 | 2021-10-20T00:25:39.000Z | 2021-11-08T12:52:42.000Z | perl/vendor/lib/LWP/Protocol/https.pm | Light2027/OnlineCampusSandbox | 8dcaaf62af1342470f9e7be6d42bd0f16eb910b8 | [
"Apache-2.0"
]
| 5 | 2021-05-20T04:16:14.000Z | 2022-02-12T01:40:02.000Z | webapp/perl/local/lib/perl5/LWP/Protocol/https.pm | matsubara0507/isucon9-kansousen | 77b19085d76add98a3ce7370063a8636cde62499 | [
"MIT"
]
| 1 | 2022-03-14T06:41:16.000Z | 2022-03-14T06:41:16.000Z | package LWP::Protocol::https;
use strict;
our $VERSION = "6.07";
require LWP::Protocol::http;
our @ISA = qw(LWP::Protocol::http);
require Net::HTTPS;
sub socket_type
{
return "https";
}
sub _extra_sock_opts
{
my $self = shift;
my %ssl_opts = %{$self->{ua}{ssl_opts} || {}};
if (delete $ssl_opts{verify_hostname}) {
$ssl_opts{SSL_verify_mode} ||= 1;
$ssl_opts{SSL_verifycn_scheme} = 'www';
}
else {
$ssl_opts{SSL_verify_mode} = 0;
}
if ($ssl_opts{SSL_verify_mode}) {
unless (exists $ssl_opts{SSL_ca_file} || exists $ssl_opts{SSL_ca_path}) {
eval {
require Mozilla::CA;
};
if ($@) {
if ($@ =~ /^Can't locate Mozilla\/CA\.pm/) {
$@ = <<'EOT';
Can't verify SSL peers without knowing which Certificate Authorities to trust
This problem can be fixed by either setting the PERL_LWP_SSL_CA_FILE
environment variable or by installing the Mozilla::CA module.
To disable verification of SSL peers set the PERL_LWP_SSL_VERIFY_HOSTNAME
environment variable to 0. If you do this you can't be sure that you
communicate with the expected peer.
EOT
}
die $@;
}
$ssl_opts{SSL_ca_file} = Mozilla::CA::SSL_ca_file();
}
}
$self->{ssl_opts} = \%ssl_opts;
return (%ssl_opts, $self->SUPER::_extra_sock_opts);
}
#------------------------------------------------------------
# _cn_match($common_name, $san_name)
# common_name: an IA5String
# san_name: subjectAltName
# initially we were only concerned with the dNSName
# and the 'left-most' only wildcard as noted in
# https://tools.ietf.org/html/rfc6125#section-6.4.3
# this method does not match any wildcarding in the
# domain name as listed in section-6.4.3.3
#
sub _cn_match {
my( $me, $common_name, $san_name ) = @_;
# /CN has a '*.' prefix
# MUST be an FQDN -- fishing?
return 0 if( $common_name =~ /^\*\./ );
my $re = q{}; # empty string
# turn a leading "*." into a regex
if( $san_name =~ /^\*\./ ) {
$san_name =~ s/\*//;
$re = "[^.]+";
}
# quotemeta the rest and match anchored
if( $common_name =~ /^$re\Q$san_name\E$/ ) {
return 1;
}
return 0;
}
#-------------------------------------------------------
# _in_san( cn, cert )
# 'cn' of the form /CN=host_to_check ( "Common Name" form )
# 'cert' any object that implements a peer_certificate('subjectAltNames') method
# which will return an array of ( type-id, value ) pairings per
# http://tools.ietf.org/html/rfc5280#section-4.2.1.6
# if there is no subjectAltNames there is nothing more to do.
# currently we have a _cn_match() that will allow for simple compare.
sub _in_san
{
my($me, $cn, $cert) = @_;
# we can return early if there are no SAN options.
my @sans = $cert->peer_certificate('subjectAltNames');
return unless scalar @sans;
(my $common_name = $cn) =~ s/.*=//; # strip off the prefix.
# get the ( type-id, value ) pairwise
# currently only the basic CN to san_name check
while( my ( $type_id, $value ) = splice( @sans, 0, 2 ) ) {
return 'ok' if $me->_cn_match($common_name,$value);
}
return;
}
sub _check_sock
{
my($self, $req, $sock) = @_;
my $check = $req->header("If-SSL-Cert-Subject");
if (defined $check) {
my $cert = $sock->get_peer_certificate ||
die "Missing SSL certificate";
my $subject = $cert->subject_name;
unless ( $subject =~ /$check/ ) {
my $ok = $self->_in_san( $check, $cert);
die "Bad SSL certificate subject: '$subject' !~ /$check/"
unless $ok;
}
$req->remove_header("If-SSL-Cert-Subject"); # don't pass it on
}
}
sub _get_sock_info
{
my $self = shift;
$self->SUPER::_get_sock_info(@_);
my($res, $sock) = @_;
$res->header("Client-SSL-Cipher" => $sock->get_cipher);
my $cert = $sock->get_peer_certificate;
if ($cert) {
$res->header("Client-SSL-Cert-Subject" => $cert->subject_name);
$res->header("Client-SSL-Cert-Issuer" => $cert->issuer_name);
}
if (!$self->{ssl_opts}{SSL_verify_mode}) {
$res->push_header("Client-SSL-Warning" => "Peer certificate not verified");
}
elsif (!$self->{ssl_opts}{SSL_verifycn_scheme}) {
$res->push_header("Client-SSL-Warning" => "Peer hostname match with certificate not verified");
}
$res->header("Client-SSL-Socket-Class" => $Net::HTTPS::SSL_SOCKET_CLASS);
}
# upgrade plain socket to SSL, used for CONNECT tunnel when proxying https
# will only work if the underlying socket class of Net::HTTPS is
# IO::Socket::SSL, but code will only be called in this case
if ( $Net::HTTPS::SSL_SOCKET_CLASS->can('start_SSL')) {
*_upgrade_sock = sub {
my ($self,$sock,$url) = @_;
$sock = LWP::Protocol::https::Socket->start_SSL( $sock,
SSL_verifycn_name => $url->host,
SSL_hostname => $url->host,
$self->_extra_sock_opts,
);
$@ = LWP::Protocol::https::Socket->errstr if ! $sock;
return $sock;
}
}
#-----------------------------------------------------------
package LWP::Protocol::https::Socket;
our @ISA = qw(Net::HTTPS LWP::Protocol::http::SocketMethods);
1;
__END__
=head1 NAME
LWP::Protocol::https - Provide https support for LWP::UserAgent
=head1 SYNOPSIS
use LWP::UserAgent;
$ua = LWP::UserAgent->new(ssl_opts => { verify_hostname => 1 });
$res = $ua->get("https://www.example.com");
# specify a CA path
$ua = LWP::UserAgent->new(
ssl_opts => {
SSL_ca_path => '/etc/ssl/certs',
verify_hostname => 1,
}
);
=head1 DESCRIPTION
The LWP::Protocol::https module provides support for using https schemed
URLs with LWP. This module is a plug-in to the LWP protocol handling, so
you don't use it directly. Once the module is installed LWP is able
to access sites using HTTP over SSL/TLS.
If hostname verification is requested by LWP::UserAgent's C<ssl_opts>, and
neither C<SSL_ca_file> nor C<SSL_ca_path> is set, then C<SSL_ca_file> is
implied to be the one provided by Mozilla::CA. If the Mozilla::CA module
isn't available SSL requests will fail. Either install this module, set up an
alternative C<SSL_ca_file> or disable hostname verification.
This module used to be bundled with the libwww-perl, but it was unbundled in
v6.02 in order to be able to declare its dependencies properly for the CPAN
tool-chain. Applications that need https support can just declare their
dependency on LWP::Protocol::https and will no longer need to know what
underlying modules to install.
=head1 SEE ALSO
L<IO::Socket::SSL>, L<Crypt::SSLeay>, L<Mozilla::CA>
=head1 COPYRIGHT
Copyright 1997-2011 Gisle Aas.
This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
| 30.470588 | 96 | 0.639145 |
ed1233b98c29dd07ac5546f841fd0fc52efa1090 | 1,114 | pm | Perl | WRK-V1.2/TOOLS/TOOLS/perl/site/lib/digest/hmac_md5.pm | intj-t/openvmsft | 0d17fbce8607ab2b880be976c2e86d8cfc3e83bb | [
"Intel"
]
| null | null | null | WRK-V1.2/TOOLS/TOOLS/perl/site/lib/digest/hmac_md5.pm | intj-t/openvmsft | 0d17fbce8607ab2b880be976c2e86d8cfc3e83bb | [
"Intel"
]
| null | null | null | WRK-V1.2/TOOLS/TOOLS/perl/site/lib/digest/hmac_md5.pm | intj-t/openvmsft | 0d17fbce8607ab2b880be976c2e86d8cfc3e83bb | [
"Intel"
]
| null | null | null | package Digest::HMAC_MD5;
$VERSION="1.00";
use strict;
use Digest::MD5 qw(md5);
use Digest::HMAC qw(hmac);
# OO interface
use vars qw(@ISA);
@ISA=qw(Digest::HMAC);
sub new
{
my $class = shift;
$class->SUPER::new($_[0], "Digest::MD5", 64);
}
# Functional interface
require Exporter;
*import = \&Exporter::import;
use vars qw(@EXPORT_OK);
@EXPORT_OK=qw(hmac_md5 hmac_md5_hex);
sub hmac_md5
{
hmac($_[0], $_[1], \&md5, 64);
}
sub hmac_md5_hex
{
unpack("H*", &hmac_md5)
}
1;
__END__
=head1 NAME
Digest::HMAC_MD5 - Keyed-Hashing for Message Authentication
=head1 SYNOPSIS
# Functional style
use Digest::HMAC_MD5 qw(hmac_md5 hmac_md5_hex);
$digest = hmac_md5($data, $key);
print hmac_md5_hex($data, $key);
# OO style
use Digest::HMAC_MD5;
$hmac = Digest::HMAC_MD5->new($key);
$hmac->add($data);
$hmac->addfile(*FILE);
$digest = $hmac->digest;
$digest = $hmac->hexdigest;
$digest = $hmac->b64digest;
=head1 DESCRIPTION
This module provide HMAC-MD5 hashing.
=head1 SEE ALSO
L<Digest::HMAC>, L<Digest::MD5>, L<Digest::HMAC_SHA1>
=head1 AUTHOR
Gisle Aas <gisle@aas.no>
=cut
| 15.472222 | 59 | 0.67325 |
73db01788cc3e958ccef579518885f5fc716e31b | 532 | pl | Perl | Perl/InlineCPP/Template/main.pl | taku-xhift/labo | 89dc28fdb602c7992c6f31920714225f83a11218 | [
"MIT"
]
| null | null | null | Perl/InlineCPP/Template/main.pl | taku-xhift/labo | 89dc28fdb602c7992c6f31920714225f83a11218 | [
"MIT"
]
| null | null | null | Perl/InlineCPP/Template/main.pl | taku-xhift/labo | 89dc28fdb602c7992c6f31920714225f83a11218 | [
"MIT"
]
| null | null | null | use Inline CPP => Config => LIBS => '-L/lib/gcc/i686-pc-cygwin/3.4.4 -lmylib -lstdc++',
INC => '-I/lib/gcc/i686-pc-cygwin/3.4.4/include',
# INC => '-I/D:/PersonalTool/xyzzy/laboratory/Perl/InlineCPP/Include/';
ENABLE => STD_IOSTREAM;
use Inline CPP => <<'END_OF_CPP';
template<typename Type> int getSize() {
return sizeof(Type);
}
void printSize() {
std::cout << getSize<int>() << std::endl;
}
END_OF_CPP
printSize();
| 28 | 99 | 0.528195 |
ed41cd3c9a79190d61063b9e966c398a8f719f95 | 6,103 | pl | Perl | t/examples/set/pSET_ZFC.pl | TeamSPoon/logicmoo_base | 679789ecda03c586f02f642b38e614a2f925720d | [
"MIT"
]
| 13 | 2017-03-03T03:18:53.000Z | 2020-01-18T01:17:10.000Z | t/examples/set/pSET_ZFC.pl | logicmoo/logicmoo_base | 679789ecda03c586f02f642b38e614a2f925720d | [
"MIT"
]
| null | null | null | t/examples/set/pSET_ZFC.pl | logicmoo/logicmoo_base | 679789ecda03c586f02f642b38e614a2f925720d | [
"MIT"
]
| 1 | 2017-10-08T15:13:50.000Z | 2017-10-08T15:13:50.000Z | set2nat(Xs,N):-set2nat(Xs,0,N).
set2nat([],R,R).
set2nat([X|Xs],R1,Rn):-R2 #= R1+(1 << X),set2nat(Xs,R2,Rn).
hfs2nat(N,R):-default_ulimit(D),hfs2nat_(D,N,R).
hfs2nat_(_,[],R):-!,R=0.
hfs2nat_(Ulimit,N,R):-integer(N),N #> 0,N #< Ulimit,!,R=N.
hfs2nat_(Ulimit,Ts,R):-maplist(hfs2nat_(Ulimit),Ts,T),set2nat(T,R).
default_ulimit(1).
nat2set(N,Xs):-findall(X,nat2element(N,X),Xs).
nat2element(N,K):-nat2el(N,0,K).
nat2el(N,K1,Kn):-
N #> 0, B #= /\(N,1), N1 #= N >> 1,
nat2more(B,N1,K1,Kn).
nat2more(1,_,K,K).
nat2more(_,N,K1,Kn):-K2 #= K1+1,nat2el(N,K2,Kn).
nat2hfs_(_,0,R):-!,R=[].
nat2hfs_(Ulimit,N,R):-N #< Ulimit,!,R=N.
nat2hfs_(Ulimit,N,R):-nat2set(N,Ns),maplist(nat2hfs_(Ulimit),Ns,R).
nat2hfs(N,R):-default_ulimit(D),nat2hfs_(D,N,R).
nat(0).
nat(N):-nat(N1),N #= N1+1.
iterative_hfs_generator(HFS):-default_ulimit(D),hfs_with_urelements(D,HFS).
hfs_with_urelements(Ulimit,HFS):-nat(N),nat2hfs_(Ulimit,N,HFS).
all_subsets([],[[]]).
all_subsets([X|Xs],Zss):-all_subsets(Xs,Yss),extend_subsets(Yss,X,Zss).
extend_subsets([],_,[]).
extend_subsets([Ys|Yss],X,[Ys,[X|Ys]|Zss]):-extend_subsets(Yss,X,Zss).
hfs_generator(NewSet):-nat(N),hfs_level(N,NewSet).
hfs_level(N,NewSet):-N1 #= N+1,
subsets_at_stage(N1,[],Hss1),subsets_at_stage(N,[],Hss),
member(NewSet,Hss1),not(member(NewSet,Hss)).
subsets_at_stage(0,X,X).
subsets_at_stage(N,X,Xss):-N #> 0,N1 #= N-1,
all_subsets(X,Xs),
subsets_at_stage(N1,Xs,Xss).
nat2hypergraph(N,Nss):-nat2set(N,Ns),maplist(nat2set,Ns,Nss).
hypergraph2nat(Nss,N):-maplist(set2nat,Nss,Ns),set2nat(Ns,N).
hfold(_,G,N,R):- integer(N),!,call(G,N,R).
hfold(F,G,Xs,R):-maplist(hfold(F,G),Xs,Rs),call(F,Rs,R).
hsize(HFS,Size):-hfold(hsize_f,hsize_g,HFS,Size).
hsize_f(Xs,S):-sumlist(Xs,S1),S #= S1+1.
hsize_g(_,1).
gfold(_,G,Ulimit,_,N,R):- integer(N),N #< Ulimit,!,call(G,N,R).
gfold(F,G,Ulimit,T,N,R):-
call(T,N,TransformedN),
maplist(gfold(F,G,Ulimit,T),TransformedN,Rs),
call(F,Rs,R).
nfold(F,G,Ulimit,N,R):-gfold(F,G,Ulimit,nat2set,N,R).
nfold1(F,G,N,R):-default_ulimit(D),nfold(F,G,D,N,R).
nsize(N,R):-default_ulimit(Ulimit),nsize(Ulimit,N,R).
nsize(Ulimit,N,R):-nfold(hsize_f,hsize_g,Ulimit,N,R).
toNat(F,Hs,R):-maplist(hfs2nat,Hs,Ns),call(F,Ns,N),nat2hfs(N,R).
toNat1(F,X,R):-hfs2nat(X,N),call(F,N,NR),nat2hfs(NR,R).
toNat2(F,X,Y,R):-
hfs2nat(X,NX),hfs2nat(Y,NY),
call(F,NX,NY,NR),
nat2hfs(NR,R).
toHFS(F,Ns,N):-maplist(nat2hfs,Ns,Hs),call(F,Hs,H),hfs2nat(H,N).
toHFS1(F,X,R):-nat2hfs(X,N),call(F,N,NR),hfs2nat(NR,R).
toHFS2(F,X,Y,R):-
nat2hfs(X,NX),nat2hfs(Y,NY),
call(F,NX,NY,NR),hfs2nat(NR,R).
cantor_pair(K1,K2,P):-P #= (((K1+K2)*(K1+K2+1))//2)+K2.
cantor_unpair(Z,K1,K2):-I #= floor((sqrt(8*Z+1)-1)/2),
K1 #= ((I*(3+I))//2)-Z,
K2 #= Z-((I*(I+1))//2).
bitmerge_pair(A,B,P):-up0(A,X),up1(B,Y),P #= X+Y.
bitmerge_unpair(P,A,B):-down0(P,A),down1(P,B).
even_up(A,R):-nat2element(A,X),E #= X << 1,R #= 1 << E.
odd_up(A,R):-nat2element(A,X),E #= 1+(X << 1),R #= 1 << E.
even_down(A,R):-nat2element(A,X),even(X),E #= X >> 1,R #= 1 << E.
odd_down(A,R):-nat2element(A,X),odd(X),E #= (X >> 1), R #= 1 << E.
even(X):- 0 =:= /\(1,X).
odd(X):- 1 =:= /\(1,X).
up0(A,P):-findall(R,even_up(A,R),Rs),sumlist(Rs,P).
up1(A,P):-findall(R,odd_up(A,R),Rs),sumlist(Rs,P).
down0(A,X):-findall(R,even_down(A,R),Rs),sumlist(Rs,X).
down1(A,X):-findall(R,odd_down(A,R),Rs),sumlist(Rs,X).
bitmerge_pair(X-Y,Z):-bitmerge_pair(X,Y,Z).
bitmerge_unpair(Z,X-Y):-bitmerge_unpair(Z,X,Y).
nat_powset(N,PN):-toHFS1(all_subsets,N,PN).
%nat_powset_alt i = product (map (\k- #> 1+(exp2 . exp2) k) (nat2set i))
hfs_ordinal(0,[]).
hfs_ordinal(N,Os):-N #> 0,N1 #= N-1,findall(I,between(0,N1,I),Is),
maplist(hfs_ordinal,Is,Os).
nat_ordinal(N,OrdN):-hfs_ordinal(N,H),hfs2nat(H,OrdN).
nat_choice_fun(N,CFN):-nat2set(N,Es),
maplist(nat2set,Es,Ess),maplist(choice_of_one,Ess,Hs),
maplist(bitmerge_pair,Es,Hs,Ps),set2nat(Ps,CFN).
choice_of_one([X|_],X).
nat2memb(N,XY):-default_ulimit(D),nat2memb(D,N,XY).
nat2memb(Ulimit,N,X-Y):-nat2contains(Ulimit,N,Y-X).
nat2contains(N,XY):-default_ulimit(D),nat2contains(D,N,XY).
nat2contains(Ulimit,N,E):-nat2element(N,X),
( E=N-X
; X #>= Ulimit,nat2contains(Ulimit,X,E)
).
nat2cdag(L,N,G):-
findall(E,nat2contains(L,N,E),Es),
vertices_edges_to_ugraph([],Es,G).
nat2mdag(L,N,G):-
findall(E,nat2memb(L,N,E),Es),
vertices_edges_to_ugraph([],Es,G).
to_dag(N,NewG):-default_ulimit(Ulimit),to_dag(Ulimit,N,NewG).
to_dag(Ulimit,N,NewG):-
findall(E,nat2contains(Ulimit,N,E),Es),
vertices_edges_to_ugraph([],Es,G),
vertices(G,Rs),reverse(Rs,Vs),
empty_assoc(D),remap(Vs,0-D,_RVs,KD),remap(Es,KD,REs,_NewKD),
vertices_edges_to_ugraph([],REs,NewG).
remap(Xs,Rs):-empty_assoc(D),remap(Xs,0-D,Rs,_KD).
remap([],KD,[],KD).
remap([X|Xs],KD1,[A|Rs],KD3):-integer(X),!,
assoc(X,A,KD1,KD2),
remap(Xs,KD2,Rs,KD3).
remap([X-Y|Xs],KD1,[A-B|Rs],KD4):-
assoc(X,A,KD1,KD2),assoc(Y,B,KD2,KD3),
remap(Xs,KD3,Rs,KD4).
assoc(X,R,K-D,KD):-get_assoc(X,D,A),!,R=A,KD=K-D.
assoc(X,K,K-D,NewK-NewD):-NewK #= K+1,put_assoc(X,D,K,NewD).
from_dag(G,N):-vertices(G,[Root|_]),compute_decoration(G,Root,N).
compute_decoration(G,V,Ds):-neighbors(V,G,Es),compute_decorations(G,Es,Ds).
compute_decorations(_,[],0).
compute_decorations(G,[E|Es],N):-
maplist(compute_decoration(G),[E|Es],Ds),
set2nat(Ds,N).
nat2digraph(N,G):-nat2set(N,Ns),
maplist(bitmerge_unpair,Ns,Ps),
vertices_edges_to_ugraph([],Ps,G).
digraph2nat(G,N):-edges(G,Ps),
maplist(bitmerge_pair,Ps,Ns),
set2nat(Ns,N).
transpose_nat(N,TN):-nat2digraph(N,G),transpose(G,T),digraph2nat(T,TN).
setShow(S):-gshow(S,"{,}"),nl.
gshow(0,[L,_C,R]):-put(L),put(R).
gshow(N,_):-integer(N),N #> 0,!,write(N).
gshow(Hs,[L,C,R]):-put(L),gshow_all(Hs,[L,C,R]),put(R).
gshow_all([],_).
gshow_all([H],LCR):-gshow(H,LCR).
gshow_all([H,G|Hs],[L,C,R]):-
gshow(H,[L,C,R]),
([C]\=="~" -> put(C);true),
gshow_all([G|Hs],[L,C,R]).
test:-
G=[0-[1, 2, 5, 6, 7], 1-[7, 9], 2-[7, 10], 3-[7],
4-[8, 10],5-[8, 9], 6- [8], 7-[9], 8-[9], 9-[10], 10-[]],
from_dag(G,N),
to_dag(N,G1),
from_dag(G1,N2),
write(N+G),nl,nl,
write(N2+G1),nl,nl.
c:-['pSET.pro'].
| 27.367713 | 75 | 0.639522 |
ed34ef32b19e2572a525d8ae22344ef3863f2714 | 325 | pl | Perl | GitPortable/App/Git/lib/perl5/5.8.8/unicore/lib/gc_sc/InLetter.pl | garethflowers/git-portable | 2dc793c7db2100afbd4dfad38dd9095e9619973d | [
"MIT"
]
| 12 | 2015-09-13T22:25:49.000Z | 2020-07-15T09:16:00.000Z | GitPortable/App/Git/lib/perl5/5.8.8/unicore/lib/gc_sc/InLetter.pl | garethflowers/git-portable | 2dc793c7db2100afbd4dfad38dd9095e9619973d | [
"MIT"
]
| 1 | 2018-04-24T15:30:47.000Z | 2018-04-24T15:30:47.000Z | GitPortable/App/Git/lib/perl5/5.8.8/unicore/lib/gc_sc/InLetter.pl | garethflowers/git-portable | 2dc793c7db2100afbd4dfad38dd9095e9619973d | [
"MIT"
]
| 4 | 2016-03-17T11:55:36.000Z | 2018-07-19T01:30:01.000Z | # !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
# This file is built by mktables from e.g. UnicodeData.txt.
# Any changes made here will be lost!
#
# This file supports:
# \p{InLetterlikeSymbols} (and fuzzy permutations)
#
# Meaning: Block 'Letterlike Symbols'
#
return <<'END';
2100 214F Letterlike Symbols
END
| 23.214286 | 60 | 0.652308 |
ed598450055d75adf14b36cd9043fb5a9811ee52 | 3,480 | pm | Perl | lib/ViroDB/Result/Derivation.pm | MullinsLab/viroverse | fca0c5f81ce9d5fdcef96d661def0699ba4209cb | [
"MIT"
]
| 7 | 2019-02-04T20:37:19.000Z | 2020-10-07T18:23:09.000Z | lib/ViroDB/Result/Derivation.pm | MullinsLab/viroverse | fca0c5f81ce9d5fdcef96d661def0699ba4209cb | [
"MIT"
]
| 75 | 2019-03-07T20:44:04.000Z | 2020-01-22T11:27:03.000Z | lib/ViroDB/Result/Derivation.pm | MullinsLab/viroverse | fca0c5f81ce9d5fdcef96d661def0699ba4209cb | [
"MIT"
]
| null | null | null | use utf8;
package ViroDB::Result::Derivation;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
ViroDB::Result::Derivation
=cut
use strict;
use warnings;
=head1 BASE CLASS: L<ViroDB::Result>
=cut
use Moose;
use MooseX::NonMoose;
use MooseX::MarkAsMethods autoclean => 1;
extends 'ViroDB::Result';
=head1 TABLE: C<viroserve.derivation>
=cut
__PACKAGE__->table("viroserve.derivation");
=head1 ACCESSORS
=head2 derivation_id
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
sequence: 'viroserve.derivation_derivation_id_seq'
=head2 derivation_protocol_id
data_type: 'integer'
is_foreign_key: 1
is_nullable: 1
=head2 input_sample_id
data_type: 'integer'
is_foreign_key: 1
is_nullable: 1
=head2 uri
data_type: 'text'
is_nullable: 1
=head2 date_completed
data_type: 'date'
is_nullable: 0
=head2 scientist_id
data_type: 'integer'
is_foreign_key: 1
is_nullable: 0
=cut
__PACKAGE__->add_columns(
"derivation_id",
{
data_type => "integer",
is_auto_increment => 1,
is_nullable => 0,
sequence => "viroserve.derivation_derivation_id_seq",
},
"derivation_protocol_id",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
"input_sample_id",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
"uri",
{ data_type => "text", is_nullable => 1 },
"date_completed",
{ data_type => "date", is_nullable => 0 },
"scientist_id",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
);
=head1 PRIMARY KEY
=over 4
=item * L</derivation_id>
=back
=cut
__PACKAGE__->set_primary_key("derivation_id");
=head1 RELATIONS
=head2 input_sample
Type: belongs_to
Related object: L<ViroDB::Result::Sample>
=cut
__PACKAGE__->belongs_to(
"input_sample",
"ViroDB::Result::Sample",
{ sample_id => "input_sample_id" },
{
is_deferrable => 0,
join_type => "LEFT",
on_delete => "NO ACTION",
on_update => "NO ACTION",
},
);
=head2 output_samples
Type: has_many
Related object: L<ViroDB::Result::Sample>
=cut
__PACKAGE__->has_many(
"output_samples",
"ViroDB::Result::Sample",
{ "foreign.derivation_id" => "self.derivation_id" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 protocol
Type: belongs_to
Related object: L<ViroDB::Result::DerivationProtocol>
=cut
__PACKAGE__->belongs_to(
"protocol",
"ViroDB::Result::DerivationProtocol",
{ derivation_protocol_id => "derivation_protocol_id" },
{
is_deferrable => 0,
join_type => "LEFT",
on_delete => "NO ACTION",
on_update => "NO ACTION",
},
);
=head2 scientist
Type: belongs_to
Related object: L<ViroDB::Result::Scientist>
=cut
__PACKAGE__->belongs_to(
"scientist",
"ViroDB::Result::Scientist",
{ scientist_id => "scientist_id" },
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
);
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2019-04-30 16:05:40
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:6e18l3Z+H+V0QFiVx8gMlg
with 'Viroverse::SampleTree::Node';
sub primogenitor {
my $self = shift;
return $self->input_sample->primogenitor;
}
sub parent {
my $self = shift;
return $self->input_sample;
}
sub children {
my $self = shift;
return $self->output_samples
->search({}, { order_by => ["name", "date_collected"] });
}
__PACKAGE__->meta->make_immutable;
1;
| 17.575758 | 77 | 0.674425 |
ed4556bbbfe8fb5ae40078b81f5ba98210505f57 | 47,421 | pl | Perl | openssl/crypto/bn/asm/ppc.pl | juergh/dash-sdk | 16757836f1f96ee3220992f70bffe92c18e08e76 | [
"AMDPLPA"
]
| 13 | 2015-08-06T14:55:10.000Z | 2021-12-26T04:41:54.000Z | openssl/crypto/bn/asm/ppc.pl | juergh/dash-sdk | 16757836f1f96ee3220992f70bffe92c18e08e76 | [
"AMDPLPA"
]
| null | null | null | openssl/crypto/bn/asm/ppc.pl | juergh/dash-sdk | 16757836f1f96ee3220992f70bffe92c18e08e76 | [
"AMDPLPA"
]
| 1 | 2017-06-17T14:15:41.000Z | 2017-06-17T14:15:41.000Z | #!/usr/bin/perl
#
# Implemented as a Perl wrapper as we want to support several different
# architectures with single file. We pick up the target based on the
# file name we are asked to generate.
#
# It should be noted though that this perl code is nothing like
# <openssl>/crypto/perlasm/x86*. In this case perl is used pretty much
# as pre-processor to cover for platform differences in name decoration,
# linker tables, 32-/64-bit instruction sets...
#
# As you might know there're several PowerPC ABI in use. Most notably
# Linux and AIX use different 32-bit ABIs. Good news are that these ABIs
# are similar enough to implement leaf(!) functions, which would be ABI
# neutral. And that's what you find here: ABI neutral leaf functions.
# In case you wonder what that is...
#
# AIX performance
#
# MEASUREMENTS WITH cc ON a 200 MhZ PowerPC 604e.
#
# The following is the performance of 32-bit compiler
# generated code:
#
# OpenSSL 0.9.6c 21 dec 2001
# built on: Tue Jun 11 11:06:51 EDT 2002
# options:bn(64,32) ...
#compiler: cc -DTHREADS -DAIX -DB_ENDIAN -DBN_LLONG -O3
# sign verify sign/s verify/s
#rsa 512 bits 0.0098s 0.0009s 102.0 1170.6
#rsa 1024 bits 0.0507s 0.0026s 19.7 387.5
#rsa 2048 bits 0.3036s 0.0085s 3.3 117.1
#rsa 4096 bits 2.0040s 0.0299s 0.5 33.4
#dsa 512 bits 0.0087s 0.0106s 114.3 94.5
#dsa 1024 bits 0.0256s 0.0313s 39.0 32.0
#
# Same bechmark with this assembler code:
#
#rsa 512 bits 0.0056s 0.0005s 178.6 2049.2
#rsa 1024 bits 0.0283s 0.0015s 35.3 674.1
#rsa 2048 bits 0.1744s 0.0050s 5.7 201.2
#rsa 4096 bits 1.1644s 0.0179s 0.9 55.7
#dsa 512 bits 0.0052s 0.0062s 191.6 162.0
#dsa 1024 bits 0.0149s 0.0180s 67.0 55.5
#
# Number of operations increases by at almost 75%
#
# Here are performance numbers for 64-bit compiler
# generated code:
#
# OpenSSL 0.9.6g [engine] 9 Aug 2002
# built on: Fri Apr 18 16:59:20 EDT 2003
# options:bn(64,64) ...
# compiler: cc -DTHREADS -D_REENTRANT -q64 -DB_ENDIAN -O3
# sign verify sign/s verify/s
#rsa 512 bits 0.0028s 0.0003s 357.1 3844.4
#rsa 1024 bits 0.0148s 0.0008s 67.5 1239.7
#rsa 2048 bits 0.0963s 0.0028s 10.4 353.0
#rsa 4096 bits 0.6538s 0.0102s 1.5 98.1
#dsa 512 bits 0.0026s 0.0032s 382.5 313.7
#dsa 1024 bits 0.0081s 0.0099s 122.8 100.6
#
# Same benchmark with this assembler code:
#
#rsa 512 bits 0.0020s 0.0002s 510.4 6273.7
#rsa 1024 bits 0.0088s 0.0005s 114.1 2128.3
#rsa 2048 bits 0.0540s 0.0016s 18.5 622.5
#rsa 4096 bits 0.3700s 0.0058s 2.7 171.0
#dsa 512 bits 0.0016s 0.0020s 610.7 507.1
#dsa 1024 bits 0.0047s 0.0058s 212.5 173.2
#
# Again, performance increases by at about 75%
#
# Mac OS X, Apple G5 1.8GHz (Note this is 32 bit code)
# OpenSSL 0.9.7c 30 Sep 2003
#
# Original code.
#
#rsa 512 bits 0.0011s 0.0001s 906.1 11012.5
#rsa 1024 bits 0.0060s 0.0003s 166.6 3363.1
#rsa 2048 bits 0.0370s 0.0010s 27.1 982.4
#rsa 4096 bits 0.2426s 0.0036s 4.1 280.4
#dsa 512 bits 0.0010s 0.0012s 1038.1 841.5
#dsa 1024 bits 0.0030s 0.0037s 329.6 269.7
#dsa 2048 bits 0.0101s 0.0127s 98.9 78.6
#
# Same benchmark with this assembler code:
#
#rsa 512 bits 0.0007s 0.0001s 1416.2 16645.9
#rsa 1024 bits 0.0036s 0.0002s 274.4 5380.6
#rsa 2048 bits 0.0222s 0.0006s 45.1 1589.5
#rsa 4096 bits 0.1469s 0.0022s 6.8 449.6
#dsa 512 bits 0.0006s 0.0007s 1664.2 1376.2
#dsa 1024 bits 0.0018s 0.0023s 545.0 442.2
#dsa 2048 bits 0.0061s 0.0075s 163.5 132.8
#
# Performance increase of ~60%
#
# If you have comments or suggestions to improve code send
# me a note at schari@us.ibm.com
#
$opf = shift;
if ($opf =~ /32\.s/) {
$BITS= 32;
$BNSZ= $BITS/8;
$ISA= "\"ppc\"";
$LD= "lwz"; # load
$LDU= "lwzu"; # load and update
$ST= "stw"; # store
$STU= "stwu"; # store and update
$UMULL= "mullw"; # unsigned multiply low
$UMULH= "mulhwu"; # unsigned multiply high
$UDIV= "divwu"; # unsigned divide
$UCMPI= "cmplwi"; # unsigned compare with immediate
$UCMP= "cmplw"; # unsigned compare
$CNTLZ= "cntlzw"; # count leading zeros
$SHL= "slw"; # shift left
$SHR= "srw"; # unsigned shift right
$SHRI= "srwi"; # unsigned shift right by immediate
$SHLI= "slwi"; # shift left by immediate
$CLRU= "clrlwi"; # clear upper bits
$INSR= "insrwi"; # insert right
$ROTL= "rotlwi"; # rotate left by immediate
$TR= "tw"; # conditional trap
} elsif ($opf =~ /64\.s/) {
$BITS= 64;
$BNSZ= $BITS/8;
$ISA= "\"ppc64\"";
# same as above, but 64-bit mnemonics...
$LD= "ld"; # load
$LDU= "ldu"; # load and update
$ST= "std"; # store
$STU= "stdu"; # store and update
$UMULL= "mulld"; # unsigned multiply low
$UMULH= "mulhdu"; # unsigned multiply high
$UDIV= "divdu"; # unsigned divide
$UCMPI= "cmpldi"; # unsigned compare with immediate
$UCMP= "cmpld"; # unsigned compare
$CNTLZ= "cntlzd"; # count leading zeros
$SHL= "sld"; # shift left
$SHR= "srd"; # unsigned shift right
$SHRI= "srdi"; # unsigned shift right by immediate
$SHLI= "sldi"; # shift left by immediate
$CLRU= "clrldi"; # clear upper bits
$INSR= "insrdi"; # insert right
$ROTL= "rotldi"; # rotate left by immediate
$TR= "td"; # conditional trap
} else { die "nonsense $opf"; }
( defined shift || open STDOUT,">$opf" ) || die "can't open $opf: $!";
# function entry points from the AIX code
#
# There are other, more elegant, ways to handle this. We (IBM) chose
# this approach as it plays well with scripts we run to 'namespace'
# OpenSSL .i.e. we add a prefix to all the public symbols so we can
# co-exist in the same process with other implementations of OpenSSL.
# 'cleverer' ways of doing these substitutions tend to hide data we
# need to be obvious.
#
my @items = ("bn_sqr_comba4",
"bn_sqr_comba8",
"bn_mul_comba4",
"bn_mul_comba8",
"bn_sub_words",
"bn_add_words",
"bn_div_words",
"bn_sqr_words",
"bn_mul_words",
"bn_mul_add_words");
if ($opf =~ /linux/) { do_linux(); }
elsif ($opf =~ /aix/) { do_aix(); }
elsif ($opf =~ /osx/) { do_osx(); }
else { do_bsd(); }
sub do_linux {
$d=&data();
if ($BITS==64) {
foreach $t (@items) {
$d =~ s/\.$t:/\
\t.section\t".opd","aw"\
\t.align\t3\
\t.globl\t$t\
$t:\
\t.quad\t.$t,.TOC.\@tocbase,0\
\t.size\t$t,24\
\t.previous\n\
\t.type\t.$t,\@function\
\t.globl\t.$t\
.$t:/g;
}
}
else {
foreach $t (@items) {
$d=~s/\.$t/$t/g;
}
}
# hide internal labels to avoid pollution of name table...
$d=~s/Lppcasm_/.Lppcasm_/gm;
print $d;
}
sub do_aix {
# AIX assembler is smart enough to please the linker without
# making us do something special...
print &data();
}
# MacOSX 32 bit
sub do_osx {
$d=&data();
# Change the bn symbol prefix from '.' to '_'
foreach $t (@items) {
$d=~s/\.$t/_$t/g;
}
# Change .machine to something OS X asm will accept
$d=~s/\.machine.*/.text/g;
$d=~s/\#/;/g; # change comment from '#' to ';'
print $d;
}
# BSD (Untested)
sub do_bsd {
$d=&data();
foreach $t (@items) {
$d=~s/\.$t/_$t/g;
}
print $d;
}
sub data {
local($data)=<<EOF;
#--------------------------------------------------------------------
#
#
#
#
# File: ppc32.s
#
# Created by: Suresh Chari
# IBM Thomas J. Watson Research Library
# Hawthorne, NY
#
#
# Description: Optimized assembly routines for OpenSSL crypto
# on the 32 bitPowerPC platform.
#
#
# Version History
#
# 2. Fixed bn_add,bn_sub and bn_div_words, added comments,
# cleaned up code. Also made a single version which can
# be used for both the AIX and Linux compilers. See NOTE
# below.
# 12/05/03 Suresh Chari
# (with lots of help from) Andy Polyakov
##
# 1. Initial version 10/20/02 Suresh Chari
#
#
# The following file works for the xlc,cc
# and gcc compilers.
#
# NOTE: To get the file to link correctly with the gcc compiler
# you have to change the names of the routines and remove
# the first .(dot) character. This should automatically
# be done in the build process.
#
# Hand optimized assembly code for the following routines
#
# bn_sqr_comba4
# bn_sqr_comba8
# bn_mul_comba4
# bn_mul_comba8
# bn_sub_words
# bn_add_words
# bn_div_words
# bn_sqr_words
# bn_mul_words
# bn_mul_add_words
#
# NOTE: It is possible to optimize this code more for
# specific PowerPC or Power architectures. On the Northstar
# architecture the optimizations in this file do
# NOT provide much improvement.
#
# If you have comments or suggestions to improve code send
# me a note at schari\@us.ibm.com
#
#--------------------------------------------------------------------------
#
# Defines to be used in the assembly code.
#
.set r0,0 # we use it as storage for value of 0
.set SP,1 # preserved
.set RTOC,2 # preserved
.set r3,3 # 1st argument/return value
.set r4,4 # 2nd argument/volatile register
.set r5,5 # 3rd argument/volatile register
.set r6,6 # ...
.set r7,7
.set r8,8
.set r9,9
.set r10,10
.set r11,11
.set r12,12
.set r13,13 # not used, nor any other "below" it...
.set BO_IF_NOT,4
.set BO_IF,12
.set BO_dCTR_NZERO,16
.set BO_dCTR_ZERO,18
.set BO_ALWAYS,20
.set CR0_LT,0;
.set CR0_GT,1;
.set CR0_EQ,2
.set CR1_FX,4;
.set CR1_FEX,5;
.set CR1_VX,6
.set LR,8
# Declare function names to be global
# NOTE: For gcc these names MUST be changed to remove
# the first . i.e. for example change ".bn_sqr_comba4"
# to "bn_sqr_comba4". This should be automatically done
# in the build.
.globl .bn_sqr_comba4
.globl .bn_sqr_comba8
.globl .bn_mul_comba4
.globl .bn_mul_comba8
.globl .bn_sub_words
.globl .bn_add_words
.globl .bn_div_words
.globl .bn_sqr_words
.globl .bn_mul_words
.globl .bn_mul_add_words
# .text section
.machine $ISA
#
# NOTE: The following label name should be changed to
# "bn_sqr_comba4" i.e. remove the first dot
# for the gcc compiler. This should be automatically
# done in the build
#
.align 4
.bn_sqr_comba4:
#
# Optimized version of bn_sqr_comba4.
#
# void bn_sqr_comba4(BN_ULONG *r, BN_ULONG *a)
# r3 contains r
# r4 contains a
#
# Freely use registers r5,r6,r7,r8,r9,r10,r11 as follows:
#
# r5,r6 are the two BN_ULONGs being multiplied.
# r7,r8 are the results of the 32x32 giving 64 bit multiply.
# r9,r10, r11 are the equivalents of c1,c2, c3.
# Here's the assembly
#
#
xor r0,r0,r0 # set r0 = 0. Used in the addze
# instructions below
#sqr_add_c(a,0,c1,c2,c3)
$LD r5,`0*$BNSZ`(r4)
$UMULL r9,r5,r5
$UMULH r10,r5,r5 #in first iteration. No need
#to add since c1=c2=c3=0.
# Note c3(r11) is NOT set to 0
# but will be.
$ST r9,`0*$BNSZ`(r3) # r[0]=c1;
# sqr_add_c2(a,1,0,c2,c3,c1);
$LD r6,`1*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r7,r7,r7 # compute (r7,r8)=2*(r7,r8)
adde r8,r8,r8
addze r9,r0 # catch carry if any.
# r9= r0(=0) and carry
addc r10,r7,r10 # now add to temp result.
addze r11,r8 # r8 added to r11 which is 0
addze r9,r9
$ST r10,`1*$BNSZ`(r3) #r[1]=c2;
#sqr_add_c(a,1,c3,c1,c2)
$UMULL r7,r6,r6
$UMULH r8,r6,r6
addc r11,r7,r11
adde r9,r8,r9
addze r10,r0
#sqr_add_c2(a,2,0,c3,c1,c2)
$LD r6,`2*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r7,r7,r7
adde r8,r8,r8
addze r10,r10
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
$ST r11,`2*$BNSZ`(r3) #r[2]=c3
#sqr_add_c2(a,3,0,c1,c2,c3);
$LD r6,`3*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r7,r7,r7
adde r8,r8,r8
addze r11,r0
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
#sqr_add_c2(a,2,1,c1,c2,c3);
$LD r5,`1*$BNSZ`(r4)
$LD r6,`2*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r7,r7,r7
adde r8,r8,r8
addze r11,r11
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
$ST r9,`3*$BNSZ`(r3) #r[3]=c1
#sqr_add_c(a,2,c2,c3,c1);
$UMULL r7,r6,r6
$UMULH r8,r6,r6
addc r10,r7,r10
adde r11,r8,r11
addze r9,r0
#sqr_add_c2(a,3,1,c2,c3,c1);
$LD r6,`3*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r7,r7,r7
adde r8,r8,r8
addze r9,r9
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
$ST r10,`4*$BNSZ`(r3) #r[4]=c2
#sqr_add_c2(a,3,2,c3,c1,c2);
$LD r5,`2*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r7,r7,r7
adde r8,r8,r8
addze r10,r0
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
$ST r11,`5*$BNSZ`(r3) #r[5] = c3
#sqr_add_c(a,3,c1,c2,c3);
$UMULL r7,r6,r6
$UMULH r8,r6,r6
addc r9,r7,r9
adde r10,r8,r10
$ST r9,`6*$BNSZ`(r3) #r[6]=c1
$ST r10,`7*$BNSZ`(r3) #r[7]=c2
bclr BO_ALWAYS,CR0_LT
.long 0x00000000
#
# NOTE: The following label name should be changed to
# "bn_sqr_comba8" i.e. remove the first dot
# for the gcc compiler. This should be automatically
# done in the build
#
.align 4
.bn_sqr_comba8:
#
# This is an optimized version of the bn_sqr_comba8 routine.
# Tightly uses the adde instruction
#
#
# void bn_sqr_comba8(BN_ULONG *r, BN_ULONG *a)
# r3 contains r
# r4 contains a
#
# Freely use registers r5,r6,r7,r8,r9,r10,r11 as follows:
#
# r5,r6 are the two BN_ULONGs being multiplied.
# r7,r8 are the results of the 32x32 giving 64 bit multiply.
# r9,r10, r11 are the equivalents of c1,c2, c3.
#
# Possible optimization of loading all 8 longs of a into registers
# doesnt provide any speedup
#
xor r0,r0,r0 #set r0 = 0.Used in addze
#instructions below.
#sqr_add_c(a,0,c1,c2,c3);
$LD r5,`0*$BNSZ`(r4)
$UMULL r9,r5,r5 #1st iteration: no carries.
$UMULH r10,r5,r5
$ST r9,`0*$BNSZ`(r3) # r[0]=c1;
#sqr_add_c2(a,1,0,c2,c3,c1);
$LD r6,`1*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r10,r7,r10 #add the two register number
adde r11,r8,r0 # (r8,r7) to the three register
addze r9,r0 # number (r9,r11,r10).NOTE:r0=0
addc r10,r7,r10 #add the two register number
adde r11,r8,r11 # (r8,r7) to the three register
addze r9,r9 # number (r9,r11,r10).
$ST r10,`1*$BNSZ`(r3) # r[1]=c2
#sqr_add_c(a,1,c3,c1,c2);
$UMULL r7,r6,r6
$UMULH r8,r6,r6
addc r11,r7,r11
adde r9,r8,r9
addze r10,r0
#sqr_add_c2(a,2,0,c3,c1,c2);
$LD r6,`2*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
$ST r11,`2*$BNSZ`(r3) #r[2]=c3
#sqr_add_c2(a,3,0,c1,c2,c3);
$LD r6,`3*$BNSZ`(r4) #r6 = a[3]. r5 is already a[0].
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r9,r7,r9
adde r10,r8,r10
addze r11,r0
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
#sqr_add_c2(a,2,1,c1,c2,c3);
$LD r5,`1*$BNSZ`(r4)
$LD r6,`2*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
$ST r9,`3*$BNSZ`(r3) #r[3]=c1;
#sqr_add_c(a,2,c2,c3,c1);
$UMULL r7,r6,r6
$UMULH r8,r6,r6
addc r10,r7,r10
adde r11,r8,r11
addze r9,r0
#sqr_add_c2(a,3,1,c2,c3,c1);
$LD r6,`3*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
#sqr_add_c2(a,4,0,c2,c3,c1);
$LD r5,`0*$BNSZ`(r4)
$LD r6,`4*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
$ST r10,`4*$BNSZ`(r3) #r[4]=c2;
#sqr_add_c2(a,5,0,c3,c1,c2);
$LD r6,`5*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r11,r7,r11
adde r9,r8,r9
addze r10,r0
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
#sqr_add_c2(a,4,1,c3,c1,c2);
$LD r5,`1*$BNSZ`(r4)
$LD r6,`4*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
#sqr_add_c2(a,3,2,c3,c1,c2);
$LD r5,`2*$BNSZ`(r4)
$LD r6,`3*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
$ST r11,`5*$BNSZ`(r3) #r[5]=c3;
#sqr_add_c(a,3,c1,c2,c3);
$UMULL r7,r6,r6
$UMULH r8,r6,r6
addc r9,r7,r9
adde r10,r8,r10
addze r11,r0
#sqr_add_c2(a,4,2,c1,c2,c3);
$LD r6,`4*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
#sqr_add_c2(a,5,1,c1,c2,c3);
$LD r5,`1*$BNSZ`(r4)
$LD r6,`5*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
#sqr_add_c2(a,6,0,c1,c2,c3);
$LD r5,`0*$BNSZ`(r4)
$LD r6,`6*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
$ST r9,`6*$BNSZ`(r3) #r[6]=c1;
#sqr_add_c2(a,7,0,c2,c3,c1);
$LD r6,`7*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r10,r7,r10
adde r11,r8,r11
addze r9,r0
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
#sqr_add_c2(a,6,1,c2,c3,c1);
$LD r5,`1*$BNSZ`(r4)
$LD r6,`6*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
#sqr_add_c2(a,5,2,c2,c3,c1);
$LD r5,`2*$BNSZ`(r4)
$LD r6,`5*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
#sqr_add_c2(a,4,3,c2,c3,c1);
$LD r5,`3*$BNSZ`(r4)
$LD r6,`4*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
$ST r10,`7*$BNSZ`(r3) #r[7]=c2;
#sqr_add_c(a,4,c3,c1,c2);
$UMULL r7,r6,r6
$UMULH r8,r6,r6
addc r11,r7,r11
adde r9,r8,r9
addze r10,r0
#sqr_add_c2(a,5,3,c3,c1,c2);
$LD r6,`5*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
#sqr_add_c2(a,6,2,c3,c1,c2);
$LD r5,`2*$BNSZ`(r4)
$LD r6,`6*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
#sqr_add_c2(a,7,1,c3,c1,c2);
$LD r5,`1*$BNSZ`(r4)
$LD r6,`7*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
$ST r11,`8*$BNSZ`(r3) #r[8]=c3;
#sqr_add_c2(a,7,2,c1,c2,c3);
$LD r5,`2*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r9,r7,r9
adde r10,r8,r10
addze r11,r0
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
#sqr_add_c2(a,6,3,c1,c2,c3);
$LD r5,`3*$BNSZ`(r4)
$LD r6,`6*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
#sqr_add_c2(a,5,4,c1,c2,c3);
$LD r5,`4*$BNSZ`(r4)
$LD r6,`5*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
$ST r9,`9*$BNSZ`(r3) #r[9]=c1;
#sqr_add_c(a,5,c2,c3,c1);
$UMULL r7,r6,r6
$UMULH r8,r6,r6
addc r10,r7,r10
adde r11,r8,r11
addze r9,r0
#sqr_add_c2(a,6,4,c2,c3,c1);
$LD r6,`6*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
#sqr_add_c2(a,7,3,c2,c3,c1);
$LD r5,`3*$BNSZ`(r4)
$LD r6,`7*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
$ST r10,`10*$BNSZ`(r3) #r[10]=c2;
#sqr_add_c2(a,7,4,c3,c1,c2);
$LD r5,`4*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r11,r7,r11
adde r9,r8,r9
addze r10,r0
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
#sqr_add_c2(a,6,5,c3,c1,c2);
$LD r5,`5*$BNSZ`(r4)
$LD r6,`6*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
addc r11,r7,r11
adde r9,r8,r9
addze r10,r10
$ST r11,`11*$BNSZ`(r3) #r[11]=c3;
#sqr_add_c(a,6,c1,c2,c3);
$UMULL r7,r6,r6
$UMULH r8,r6,r6
addc r9,r7,r9
adde r10,r8,r10
addze r11,r0
#sqr_add_c2(a,7,5,c1,c2,c3)
$LD r6,`7*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
addc r9,r7,r9
adde r10,r8,r10
addze r11,r11
$ST r9,`12*$BNSZ`(r3) #r[12]=c1;
#sqr_add_c2(a,7,6,c2,c3,c1)
$LD r5,`6*$BNSZ`(r4)
$UMULL r7,r5,r6
$UMULH r8,r5,r6
addc r10,r7,r10
adde r11,r8,r11
addze r9,r0
addc r10,r7,r10
adde r11,r8,r11
addze r9,r9
$ST r10,`13*$BNSZ`(r3) #r[13]=c2;
#sqr_add_c(a,7,c3,c1,c2);
$UMULL r7,r6,r6
$UMULH r8,r6,r6
addc r11,r7,r11
adde r9,r8,r9
$ST r11,`14*$BNSZ`(r3) #r[14]=c3;
$ST r9, `15*$BNSZ`(r3) #r[15]=c1;
bclr BO_ALWAYS,CR0_LT
.long 0x00000000
#
# NOTE: The following label name should be changed to
# "bn_mul_comba4" i.e. remove the first dot
# for the gcc compiler. This should be automatically
# done in the build
#
.align 4
.bn_mul_comba4:
#
# This is an optimized version of the bn_mul_comba4 routine.
#
# void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
# r3 contains r
# r4 contains a
# r5 contains b
# r6, r7 are the 2 BN_ULONGs being multiplied.
# r8, r9 are the results of the 32x32 giving 64 multiply.
# r10, r11, r12 are the equivalents of c1, c2, and c3.
#
xor r0,r0,r0 #r0=0. Used in addze below.
#mul_add_c(a[0],b[0],c1,c2,c3);
$LD r6,`0*$BNSZ`(r4)
$LD r7,`0*$BNSZ`(r5)
$UMULL r10,r6,r7
$UMULH r11,r6,r7
$ST r10,`0*$BNSZ`(r3) #r[0]=c1
#mul_add_c(a[0],b[1],c2,c3,c1);
$LD r7,`1*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r8,r11
adde r12,r9,r0
addze r10,r0
#mul_add_c(a[1],b[0],c2,c3,c1);
$LD r6, `1*$BNSZ`(r4)
$LD r7, `0*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r8,r11
adde r12,r9,r12
addze r10,r10
$ST r11,`1*$BNSZ`(r3) #r[1]=c2
#mul_add_c(a[2],b[0],c3,c1,c2);
$LD r6,`2*$BNSZ`(r4)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r8,r12
adde r10,r9,r10
addze r11,r0
#mul_add_c(a[1],b[1],c3,c1,c2);
$LD r6,`1*$BNSZ`(r4)
$LD r7,`1*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r8,r12
adde r10,r9,r10
addze r11,r11
#mul_add_c(a[0],b[2],c3,c1,c2);
$LD r6,`0*$BNSZ`(r4)
$LD r7,`2*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r8,r12
adde r10,r9,r10
addze r11,r11
$ST r12,`2*$BNSZ`(r3) #r[2]=c3
#mul_add_c(a[0],b[3],c1,c2,c3);
$LD r7,`3*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r8,r10
adde r11,r9,r11
addze r12,r0
#mul_add_c(a[1],b[2],c1,c2,c3);
$LD r6,`1*$BNSZ`(r4)
$LD r7,`2*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r8,r10
adde r11,r9,r11
addze r12,r12
#mul_add_c(a[2],b[1],c1,c2,c3);
$LD r6,`2*$BNSZ`(r4)
$LD r7,`1*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r8,r10
adde r11,r9,r11
addze r12,r12
#mul_add_c(a[3],b[0],c1,c2,c3);
$LD r6,`3*$BNSZ`(r4)
$LD r7,`0*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r8,r10
adde r11,r9,r11
addze r12,r12
$ST r10,`3*$BNSZ`(r3) #r[3]=c1
#mul_add_c(a[3],b[1],c2,c3,c1);
$LD r7,`1*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r8,r11
adde r12,r9,r12
addze r10,r0
#mul_add_c(a[2],b[2],c2,c3,c1);
$LD r6,`2*$BNSZ`(r4)
$LD r7,`2*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r8,r11
adde r12,r9,r12
addze r10,r10
#mul_add_c(a[1],b[3],c2,c3,c1);
$LD r6,`1*$BNSZ`(r4)
$LD r7,`3*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r8,r11
adde r12,r9,r12
addze r10,r10
$ST r11,`4*$BNSZ`(r3) #r[4]=c2
#mul_add_c(a[2],b[3],c3,c1,c2);
$LD r6,`2*$BNSZ`(r4)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r8,r12
adde r10,r9,r10
addze r11,r0
#mul_add_c(a[3],b[2],c3,c1,c2);
$LD r6,`3*$BNSZ`(r4)
$LD r7,`2*$BNSZ`(r4)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r8,r12
adde r10,r9,r10
addze r11,r11
$ST r12,`5*$BNSZ`(r3) #r[5]=c3
#mul_add_c(a[3],b[3],c1,c2,c3);
$LD r7,`3*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r8,r10
adde r11,r9,r11
$ST r10,`6*$BNSZ`(r3) #r[6]=c1
$ST r11,`7*$BNSZ`(r3) #r[7]=c2
bclr BO_ALWAYS,CR0_LT
.long 0x00000000
#
# NOTE: The following label name should be changed to
# "bn_mul_comba8" i.e. remove the first dot
# for the gcc compiler. This should be automatically
# done in the build
#
.align 4
.bn_mul_comba8:
#
# Optimized version of the bn_mul_comba8 routine.
#
# void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b)
# r3 contains r
# r4 contains a
# r5 contains b
# r6, r7 are the 2 BN_ULONGs being multiplied.
# r8, r9 are the results of the 32x32 giving 64 multiply.
# r10, r11, r12 are the equivalents of c1, c2, and c3.
#
xor r0,r0,r0 #r0=0. Used in addze below.
#mul_add_c(a[0],b[0],c1,c2,c3);
$LD r6,`0*$BNSZ`(r4) #a[0]
$LD r7,`0*$BNSZ`(r5) #b[0]
$UMULL r10,r6,r7
$UMULH r11,r6,r7
$ST r10,`0*$BNSZ`(r3) #r[0]=c1;
#mul_add_c(a[0],b[1],c2,c3,c1);
$LD r7,`1*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
addze r12,r9 # since we didnt set r12 to zero before.
addze r10,r0
#mul_add_c(a[1],b[0],c2,c3,c1);
$LD r6,`1*$BNSZ`(r4)
$LD r7,`0*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
$ST r11,`1*$BNSZ`(r3) #r[1]=c2;
#mul_add_c(a[2],b[0],c3,c1,c2);
$LD r6,`2*$BNSZ`(r4)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r0
#mul_add_c(a[1],b[1],c3,c1,c2);
$LD r6,`1*$BNSZ`(r4)
$LD r7,`1*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
#mul_add_c(a[0],b[2],c3,c1,c2);
$LD r6,`0*$BNSZ`(r4)
$LD r7,`2*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
$ST r12,`2*$BNSZ`(r3) #r[2]=c3;
#mul_add_c(a[0],b[3],c1,c2,c3);
$LD r7,`3*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r0
#mul_add_c(a[1],b[2],c1,c2,c3);
$LD r6,`1*$BNSZ`(r4)
$LD r7,`2*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
#mul_add_c(a[2],b[1],c1,c2,c3);
$LD r6,`2*$BNSZ`(r4)
$LD r7,`1*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
#mul_add_c(a[3],b[0],c1,c2,c3);
$LD r6,`3*$BNSZ`(r4)
$LD r7,`0*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
$ST r10,`3*$BNSZ`(r3) #r[3]=c1;
#mul_add_c(a[4],b[0],c2,c3,c1);
$LD r6,`4*$BNSZ`(r4)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r0
#mul_add_c(a[3],b[1],c2,c3,c1);
$LD r6,`3*$BNSZ`(r4)
$LD r7,`1*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
#mul_add_c(a[2],b[2],c2,c3,c1);
$LD r6,`2*$BNSZ`(r4)
$LD r7,`2*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
#mul_add_c(a[1],b[3],c2,c3,c1);
$LD r6,`1*$BNSZ`(r4)
$LD r7,`3*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
#mul_add_c(a[0],b[4],c2,c3,c1);
$LD r6,`0*$BNSZ`(r4)
$LD r7,`4*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
$ST r11,`4*$BNSZ`(r3) #r[4]=c2;
#mul_add_c(a[0],b[5],c3,c1,c2);
$LD r7,`5*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r0
#mul_add_c(a[1],b[4],c3,c1,c2);
$LD r6,`1*$BNSZ`(r4)
$LD r7,`4*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
#mul_add_c(a[2],b[3],c3,c1,c2);
$LD r6,`2*$BNSZ`(r4)
$LD r7,`3*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
#mul_add_c(a[3],b[2],c3,c1,c2);
$LD r6,`3*$BNSZ`(r4)
$LD r7,`2*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
#mul_add_c(a[4],b[1],c3,c1,c2);
$LD r6,`4*$BNSZ`(r4)
$LD r7,`1*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
#mul_add_c(a[5],b[0],c3,c1,c2);
$LD r6,`5*$BNSZ`(r4)
$LD r7,`0*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
$ST r12,`5*$BNSZ`(r3) #r[5]=c3;
#mul_add_c(a[6],b[0],c1,c2,c3);
$LD r6,`6*$BNSZ`(r4)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r0
#mul_add_c(a[5],b[1],c1,c2,c3);
$LD r6,`5*$BNSZ`(r4)
$LD r7,`1*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
#mul_add_c(a[4],b[2],c1,c2,c3);
$LD r6,`4*$BNSZ`(r4)
$LD r7,`2*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
#mul_add_c(a[3],b[3],c1,c2,c3);
$LD r6,`3*$BNSZ`(r4)
$LD r7,`3*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
#mul_add_c(a[2],b[4],c1,c2,c3);
$LD r6,`2*$BNSZ`(r4)
$LD r7,`4*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
#mul_add_c(a[1],b[5],c1,c2,c3);
$LD r6,`1*$BNSZ`(r4)
$LD r7,`5*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
#mul_add_c(a[0],b[6],c1,c2,c3);
$LD r6,`0*$BNSZ`(r4)
$LD r7,`6*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
$ST r10,`6*$BNSZ`(r3) #r[6]=c1;
#mul_add_c(a[0],b[7],c2,c3,c1);
$LD r7,`7*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r0
#mul_add_c(a[1],b[6],c2,c3,c1);
$LD r6,`1*$BNSZ`(r4)
$LD r7,`6*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
#mul_add_c(a[2],b[5],c2,c3,c1);
$LD r6,`2*$BNSZ`(r4)
$LD r7,`5*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
#mul_add_c(a[3],b[4],c2,c3,c1);
$LD r6,`3*$BNSZ`(r4)
$LD r7,`4*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
#mul_add_c(a[4],b[3],c2,c3,c1);
$LD r6,`4*$BNSZ`(r4)
$LD r7,`3*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
#mul_add_c(a[5],b[2],c2,c3,c1);
$LD r6,`5*$BNSZ`(r4)
$LD r7,`2*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
#mul_add_c(a[6],b[1],c2,c3,c1);
$LD r6,`6*$BNSZ`(r4)
$LD r7,`1*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
#mul_add_c(a[7],b[0],c2,c3,c1);
$LD r6,`7*$BNSZ`(r4)
$LD r7,`0*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
$ST r11,`7*$BNSZ`(r3) #r[7]=c2;
#mul_add_c(a[7],b[1],c3,c1,c2);
$LD r7,`1*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r0
#mul_add_c(a[6],b[2],c3,c1,c2);
$LD r6,`6*$BNSZ`(r4)
$LD r7,`2*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
#mul_add_c(a[5],b[3],c3,c1,c2);
$LD r6,`5*$BNSZ`(r4)
$LD r7,`3*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
#mul_add_c(a[4],b[4],c3,c1,c2);
$LD r6,`4*$BNSZ`(r4)
$LD r7,`4*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
#mul_add_c(a[3],b[5],c3,c1,c2);
$LD r6,`3*$BNSZ`(r4)
$LD r7,`5*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
#mul_add_c(a[2],b[6],c3,c1,c2);
$LD r6,`2*$BNSZ`(r4)
$LD r7,`6*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
#mul_add_c(a[1],b[7],c3,c1,c2);
$LD r6,`1*$BNSZ`(r4)
$LD r7,`7*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
$ST r12,`8*$BNSZ`(r3) #r[8]=c3;
#mul_add_c(a[2],b[7],c1,c2,c3);
$LD r6,`2*$BNSZ`(r4)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r0
#mul_add_c(a[3],b[6],c1,c2,c3);
$LD r6,`3*$BNSZ`(r4)
$LD r7,`6*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
#mul_add_c(a[4],b[5],c1,c2,c3);
$LD r6,`4*$BNSZ`(r4)
$LD r7,`5*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
#mul_add_c(a[5],b[4],c1,c2,c3);
$LD r6,`5*$BNSZ`(r4)
$LD r7,`4*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
#mul_add_c(a[6],b[3],c1,c2,c3);
$LD r6,`6*$BNSZ`(r4)
$LD r7,`3*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
#mul_add_c(a[7],b[2],c1,c2,c3);
$LD r6,`7*$BNSZ`(r4)
$LD r7,`2*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
$ST r10,`9*$BNSZ`(r3) #r[9]=c1;
#mul_add_c(a[7],b[3],c2,c3,c1);
$LD r7,`3*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r0
#mul_add_c(a[6],b[4],c2,c3,c1);
$LD r6,`6*$BNSZ`(r4)
$LD r7,`4*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
#mul_add_c(a[5],b[5],c2,c3,c1);
$LD r6,`5*$BNSZ`(r4)
$LD r7,`5*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
#mul_add_c(a[4],b[6],c2,c3,c1);
$LD r6,`4*$BNSZ`(r4)
$LD r7,`6*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
#mul_add_c(a[3],b[7],c2,c3,c1);
$LD r6,`3*$BNSZ`(r4)
$LD r7,`7*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
$ST r11,`10*$BNSZ`(r3) #r[10]=c2;
#mul_add_c(a[4],b[7],c3,c1,c2);
$LD r6,`4*$BNSZ`(r4)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r0
#mul_add_c(a[5],b[6],c3,c1,c2);
$LD r6,`5*$BNSZ`(r4)
$LD r7,`6*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
#mul_add_c(a[6],b[5],c3,c1,c2);
$LD r6,`6*$BNSZ`(r4)
$LD r7,`5*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
#mul_add_c(a[7],b[4],c3,c1,c2);
$LD r6,`7*$BNSZ`(r4)
$LD r7,`4*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
addze r11,r11
$ST r12,`11*$BNSZ`(r3) #r[11]=c3;
#mul_add_c(a[7],b[5],c1,c2,c3);
$LD r7,`5*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r0
#mul_add_c(a[6],b[6],c1,c2,c3);
$LD r6,`6*$BNSZ`(r4)
$LD r7,`6*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
#mul_add_c(a[5],b[7],c1,c2,c3);
$LD r6,`5*$BNSZ`(r4)
$LD r7,`7*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r10,r10,r8
adde r11,r11,r9
addze r12,r12
$ST r10,`12*$BNSZ`(r3) #r[12]=c1;
#mul_add_c(a[6],b[7],c2,c3,c1);
$LD r6,`6*$BNSZ`(r4)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r0
#mul_add_c(a[7],b[6],c2,c3,c1);
$LD r6,`7*$BNSZ`(r4)
$LD r7,`6*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r11,r11,r8
adde r12,r12,r9
addze r10,r10
$ST r11,`13*$BNSZ`(r3) #r[13]=c2;
#mul_add_c(a[7],b[7],c3,c1,c2);
$LD r7,`7*$BNSZ`(r5)
$UMULL r8,r6,r7
$UMULH r9,r6,r7
addc r12,r12,r8
adde r10,r10,r9
$ST r12,`14*$BNSZ`(r3) #r[14]=c3;
$ST r10,`15*$BNSZ`(r3) #r[15]=c1;
bclr BO_ALWAYS,CR0_LT
.long 0x00000000
#
# NOTE: The following label name should be changed to
# "bn_sub_words" i.e. remove the first dot
# for the gcc compiler. This should be automatically
# done in the build
#
#
.align 4
.bn_sub_words:
#
# Handcoded version of bn_sub_words
#
#BN_ULONG bn_sub_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
#
# r3 = r
# r4 = a
# r5 = b
# r6 = n
#
# Note: No loop unrolling done since this is not a performance
# critical loop.
xor r0,r0,r0 #set r0 = 0
#
# check for r6 = 0 AND set carry bit.
#
subfc. r7,r0,r6 # If r6 is 0 then result is 0.
# if r6 > 0 then result !=0
# In either case carry bit is set.
bc BO_IF,CR0_EQ,Lppcasm_sub_adios
addi r4,r4,-$BNSZ
addi r3,r3,-$BNSZ
addi r5,r5,-$BNSZ
mtctr r6
Lppcasm_sub_mainloop:
$LDU r7,$BNSZ(r4)
$LDU r8,$BNSZ(r5)
subfe r6,r8,r7 # r6 = r7+carry bit + onescomplement(r8)
# if carry = 1 this is r7-r8. Else it
# is r7-r8 -1 as we need.
$STU r6,$BNSZ(r3)
bc BO_dCTR_NZERO,CR0_EQ,Lppcasm_sub_mainloop
Lppcasm_sub_adios:
subfze r3,r0 # if carry bit is set then r3 = 0 else -1
andi. r3,r3,1 # keep only last bit.
bclr BO_ALWAYS,CR0_LT
.long 0x00000000
#
# NOTE: The following label name should be changed to
# "bn_add_words" i.e. remove the first dot
# for the gcc compiler. This should be automatically
# done in the build
#
.align 4
.bn_add_words:
#
# Handcoded version of bn_add_words
#
#BN_ULONG bn_add_words(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n)
#
# r3 = r
# r4 = a
# r5 = b
# r6 = n
#
# Note: No loop unrolling done since this is not a performance
# critical loop.
xor r0,r0,r0
#
# check for r6 = 0. Is this needed?
#
addic. r6,r6,0 #test r6 and clear carry bit.
bc BO_IF,CR0_EQ,Lppcasm_add_adios
addi r4,r4,-$BNSZ
addi r3,r3,-$BNSZ
addi r5,r5,-$BNSZ
mtctr r6
Lppcasm_add_mainloop:
$LDU r7,$BNSZ(r4)
$LDU r8,$BNSZ(r5)
adde r8,r7,r8
$STU r8,$BNSZ(r3)
bc BO_dCTR_NZERO,CR0_EQ,Lppcasm_add_mainloop
Lppcasm_add_adios:
addze r3,r0 #return carry bit.
bclr BO_ALWAYS,CR0_LT
.long 0x00000000
#
# NOTE: The following label name should be changed to
# "bn_div_words" i.e. remove the first dot
# for the gcc compiler. This should be automatically
# done in the build
#
.align 4
.bn_div_words:
#
# This is a cleaned up version of code generated by
# the AIX compiler. The only optimization is to use
# the PPC instruction to count leading zeros instead
# of call to num_bits_word. Since this was compiled
# only at level -O2 we can possibly squeeze it more?
#
# r3 = h
# r4 = l
# r5 = d
$UCMPI 0,r5,0 # compare r5 and 0
bc BO_IF_NOT,CR0_EQ,Lppcasm_div1 # proceed if d!=0
li r3,-1 # d=0 return -1
bclr BO_ALWAYS,CR0_LT
Lppcasm_div1:
xor r0,r0,r0 #r0=0
li r8,$BITS
$CNTLZ. r7,r5 #r7 = num leading 0s in d.
bc BO_IF,CR0_EQ,Lppcasm_div2 #proceed if no leading zeros
subf r8,r7,r8 #r8 = BN_num_bits_word(d)
$SHR. r9,r3,r8 #are there any bits above r8'th?
$TR 16,r9,r0 #if there're, signal to dump core...
Lppcasm_div2:
$UCMP 0,r3,r5 #h>=d?
bc BO_IF,CR0_LT,Lppcasm_div3 #goto Lppcasm_div3 if not
subf r3,r5,r3 #h-=d ;
Lppcasm_div3: #r7 = BN_BITS2-i. so r7=i
cmpi 0,0,r7,0 # is (i == 0)?
bc BO_IF,CR0_EQ,Lppcasm_div4
$SHL r3,r3,r7 # h = (h<< i)
$SHR r8,r4,r8 # r8 = (l >> BN_BITS2 -i)
$SHL r5,r5,r7 # d<<=i
or r3,r3,r8 # h = (h<<i)|(l>>(BN_BITS2-i))
$SHL r4,r4,r7 # l <<=i
Lppcasm_div4:
$SHRI r9,r5,`$BITS/2` # r9 = dh
# dl will be computed when needed
# as it saves registers.
li r6,2 #r6=2
mtctr r6 #counter will be in count.
Lppcasm_divouterloop:
$SHRI r8,r3,`$BITS/2` #r8 = (h>>BN_BITS4)
$SHRI r11,r4,`$BITS/2` #r11= (l&BN_MASK2h)>>BN_BITS4
# compute here for innerloop.
$UCMP 0,r8,r9 # is (h>>BN_BITS4)==dh
bc BO_IF_NOT,CR0_EQ,Lppcasm_div5 # goto Lppcasm_div5 if not
li r8,-1
$CLRU r8,r8,`$BITS/2` #q = BN_MASK2l
b Lppcasm_div6
Lppcasm_div5:
$UDIV r8,r3,r9 #q = h/dh
Lppcasm_div6:
$UMULL r12,r9,r8 #th = q*dh
$CLRU r10,r5,`$BITS/2` #r10=dl
$UMULL r6,r8,r10 #tl = q*dl
Lppcasm_divinnerloop:
subf r10,r12,r3 #t = h -th
$SHRI r7,r10,`$BITS/2` #r7= (t &BN_MASK2H), sort of...
addic. r7,r7,0 #test if r7 == 0. used below.
# now want to compute
# r7 = (t<<BN_BITS4)|((l&BN_MASK2h)>>BN_BITS4)
# the following 2 instructions do that
$SHLI r7,r10,`$BITS/2` # r7 = (t<<BN_BITS4)
or r7,r7,r11 # r7|=((l&BN_MASK2h)>>BN_BITS4)
$UCMP 1,r6,r7 # compare (tl <= r7)
bc BO_IF_NOT,CR0_EQ,Lppcasm_divinnerexit
bc BO_IF_NOT,CR1_FEX,Lppcasm_divinnerexit
addi r8,r8,-1 #q--
subf r12,r9,r12 #th -=dh
$CLRU r10,r5,`$BITS/2` #r10=dl. t is no longer needed in loop.
subf r6,r10,r6 #tl -=dl
b Lppcasm_divinnerloop
Lppcasm_divinnerexit:
$SHRI r10,r6,`$BITS/2` #t=(tl>>BN_BITS4)
$SHLI r11,r6,`$BITS/2` #tl=(tl<<BN_BITS4)&BN_MASK2h;
$UCMP 1,r4,r11 # compare l and tl
add r12,r12,r10 # th+=t
bc BO_IF_NOT,CR1_FX,Lppcasm_div7 # if (l>=tl) goto Lppcasm_div7
addi r12,r12,1 # th++
Lppcasm_div7:
subf r11,r11,r4 #r11=l-tl
$UCMP 1,r3,r12 #compare h and th
bc BO_IF_NOT,CR1_FX,Lppcasm_div8 #if (h>=th) goto Lppcasm_div8
addi r8,r8,-1 # q--
add r3,r5,r3 # h+=d
Lppcasm_div8:
subf r12,r12,r3 #r12 = h-th
$SHLI r4,r11,`$BITS/2` #l=(l&BN_MASK2l)<<BN_BITS4
# want to compute
# h = ((h<<BN_BITS4)|(l>>BN_BITS4))&BN_MASK2
# the following 2 instructions will do this.
$INSR r11,r12,`$BITS/2`,`$BITS/2` # r11 is the value we want rotated $BITS/2.
$ROTL r3,r11,`$BITS/2` # rotate by $BITS/2 and store in r3
bc BO_dCTR_ZERO,CR0_EQ,Lppcasm_div9#if (count==0) break ;
$SHLI r0,r8,`$BITS/2` #ret =q<<BN_BITS4
b Lppcasm_divouterloop
Lppcasm_div9:
or r3,r8,r0
bclr BO_ALWAYS,CR0_LT
.long 0x00000000
#
# NOTE: The following label name should be changed to
# "bn_sqr_words" i.e. remove the first dot
# for the gcc compiler. This should be automatically
# done in the build
#
.align 4
.bn_sqr_words:
#
# Optimized version of bn_sqr_words
#
# void bn_sqr_words(BN_ULONG *r, BN_ULONG *a, int n)
#
# r3 = r
# r4 = a
# r5 = n
#
# r6 = a[i].
# r7,r8 = product.
#
# No unrolling done here. Not performance critical.
addic. r5,r5,0 #test r5.
bc BO_IF,CR0_EQ,Lppcasm_sqr_adios
addi r4,r4,-$BNSZ
addi r3,r3,-$BNSZ
mtctr r5
Lppcasm_sqr_mainloop:
#sqr(r[0],r[1],a[0]);
$LDU r6,$BNSZ(r4)
$UMULL r7,r6,r6
$UMULH r8,r6,r6
$STU r7,$BNSZ(r3)
$STU r8,$BNSZ(r3)
bc BO_dCTR_NZERO,CR0_EQ,Lppcasm_sqr_mainloop
Lppcasm_sqr_adios:
bclr BO_ALWAYS,CR0_LT
.long 0x00000000
#
# NOTE: The following label name should be changed to
# "bn_mul_words" i.e. remove the first dot
# for the gcc compiler. This should be automatically
# done in the build
#
.align 4
.bn_mul_words:
#
# BN_ULONG bn_mul_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w)
#
# r3 = rp
# r4 = ap
# r5 = num
# r6 = w
xor r0,r0,r0
xor r12,r12,r12 # used for carry
rlwinm. r7,r5,30,2,31 # num >> 2
bc BO_IF,CR0_EQ,Lppcasm_mw_REM
mtctr r7
Lppcasm_mw_LOOP:
#mul(rp[0],ap[0],w,c1);
$LD r8,`0*$BNSZ`(r4)
$UMULL r9,r6,r8
$UMULH r10,r6,r8
addc r9,r9,r12
#addze r10,r10 #carry is NOT ignored.
#will be taken care of
#in second spin below
#using adde.
$ST r9,`0*$BNSZ`(r3)
#mul(rp[1],ap[1],w,c1);
$LD r8,`1*$BNSZ`(r4)
$UMULL r11,r6,r8
$UMULH r12,r6,r8
adde r11,r11,r10
#addze r12,r12
$ST r11,`1*$BNSZ`(r3)
#mul(rp[2],ap[2],w,c1);
$LD r8,`2*$BNSZ`(r4)
$UMULL r9,r6,r8
$UMULH r10,r6,r8
adde r9,r9,r12
#addze r10,r10
$ST r9,`2*$BNSZ`(r3)
#mul_add(rp[3],ap[3],w,c1);
$LD r8,`3*$BNSZ`(r4)
$UMULL r11,r6,r8
$UMULH r12,r6,r8
adde r11,r11,r10
addze r12,r12 #this spin we collect carry into
#r12
$ST r11,`3*$BNSZ`(r3)
addi r3,r3,`4*$BNSZ`
addi r4,r4,`4*$BNSZ`
bc BO_dCTR_NZERO,CR0_EQ,Lppcasm_mw_LOOP
Lppcasm_mw_REM:
andi. r5,r5,0x3
bc BO_IF,CR0_EQ,Lppcasm_mw_OVER
#mul(rp[0],ap[0],w,c1);
$LD r8,`0*$BNSZ`(r4)
$UMULL r9,r6,r8
$UMULH r10,r6,r8
addc r9,r9,r12
addze r10,r10
$ST r9,`0*$BNSZ`(r3)
addi r12,r10,0
addi r5,r5,-1
cmpli 0,0,r5,0
bc BO_IF,CR0_EQ,Lppcasm_mw_OVER
#mul(rp[1],ap[1],w,c1);
$LD r8,`1*$BNSZ`(r4)
$UMULL r9,r6,r8
$UMULH r10,r6,r8
addc r9,r9,r12
addze r10,r10
$ST r9,`1*$BNSZ`(r3)
addi r12,r10,0
addi r5,r5,-1
cmpli 0,0,r5,0
bc BO_IF,CR0_EQ,Lppcasm_mw_OVER
#mul_add(rp[2],ap[2],w,c1);
$LD r8,`2*$BNSZ`(r4)
$UMULL r9,r6,r8
$UMULH r10,r6,r8
addc r9,r9,r12
addze r10,r10
$ST r9,`2*$BNSZ`(r3)
addi r12,r10,0
Lppcasm_mw_OVER:
addi r3,r12,0
bclr BO_ALWAYS,CR0_LT
.long 0x00000000
#
# NOTE: The following label name should be changed to
# "bn_mul_add_words" i.e. remove the first dot
# for the gcc compiler. This should be automatically
# done in the build
#
.align 4
.bn_mul_add_words:
#
# BN_ULONG bn_mul_add_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w)
#
# r3 = rp
# r4 = ap
# r5 = num
# r6 = w
#
# empirical evidence suggests that unrolled version performs best!!
#
xor r0,r0,r0 #r0 = 0
xor r12,r12,r12 #r12 = 0 . used for carry
rlwinm. r7,r5,30,2,31 # num >> 2
bc BO_IF,CR0_EQ,Lppcasm_maw_leftover # if (num < 4) go LPPCASM_maw_leftover
mtctr r7
Lppcasm_maw_mainloop:
#mul_add(rp[0],ap[0],w,c1);
$LD r8,`0*$BNSZ`(r4)
$LD r11,`0*$BNSZ`(r3)
$UMULL r9,r6,r8
$UMULH r10,r6,r8
addc r9,r9,r12 #r12 is carry.
addze r10,r10
addc r9,r9,r11
#addze r10,r10
#the above instruction addze
#is NOT needed. Carry will NOT
#be ignored. It's not affected
#by multiply and will be collected
#in the next spin
$ST r9,`0*$BNSZ`(r3)
#mul_add(rp[1],ap[1],w,c1);
$LD r8,`1*$BNSZ`(r4)
$LD r9,`1*$BNSZ`(r3)
$UMULL r11,r6,r8
$UMULH r12,r6,r8
adde r11,r11,r10 #r10 is carry.
addze r12,r12
addc r11,r11,r9
#addze r12,r12
$ST r11,`1*$BNSZ`(r3)
#mul_add(rp[2],ap[2],w,c1);
$LD r8,`2*$BNSZ`(r4)
$UMULL r9,r6,r8
$LD r11,`2*$BNSZ`(r3)
$UMULH r10,r6,r8
adde r9,r9,r12
addze r10,r10
addc r9,r9,r11
#addze r10,r10
$ST r9,`2*$BNSZ`(r3)
#mul_add(rp[3],ap[3],w,c1);
$LD r8,`3*$BNSZ`(r4)
$UMULL r11,r6,r8
$LD r9,`3*$BNSZ`(r3)
$UMULH r12,r6,r8
adde r11,r11,r10
addze r12,r12
addc r11,r11,r9
addze r12,r12
$ST r11,`3*$BNSZ`(r3)
addi r3,r3,`4*$BNSZ`
addi r4,r4,`4*$BNSZ`
bc BO_dCTR_NZERO,CR0_EQ,Lppcasm_maw_mainloop
Lppcasm_maw_leftover:
andi. r5,r5,0x3
bc BO_IF,CR0_EQ,Lppcasm_maw_adios
addi r3,r3,-$BNSZ
addi r4,r4,-$BNSZ
#mul_add(rp[0],ap[0],w,c1);
mtctr r5
$LDU r8,$BNSZ(r4)
$UMULL r9,r6,r8
$UMULH r10,r6,r8
$LDU r11,$BNSZ(r3)
addc r9,r9,r11
addze r10,r10
addc r9,r9,r12
addze r12,r10
$ST r9,0(r3)
bc BO_dCTR_ZERO,CR0_EQ,Lppcasm_maw_adios
#mul_add(rp[1],ap[1],w,c1);
$LDU r8,$BNSZ(r4)
$UMULL r9,r6,r8
$UMULH r10,r6,r8
$LDU r11,$BNSZ(r3)
addc r9,r9,r11
addze r10,r10
addc r9,r9,r12
addze r12,r10
$ST r9,0(r3)
bc BO_dCTR_ZERO,CR0_EQ,Lppcasm_maw_adios
#mul_add(rp[2],ap[2],w,c1);
$LDU r8,$BNSZ(r4)
$UMULL r9,r6,r8
$UMULH r10,r6,r8
$LDU r11,$BNSZ(r3)
addc r9,r9,r11
addze r10,r10
addc r9,r9,r12
addze r12,r10
$ST r9,0(r3)
Lppcasm_maw_adios:
addi r3,r12,0
bclr BO_ALWAYS,CR0_LT
.long 0x00000000
.align 4
EOF
$data =~ s/\`([^\`]*)\`/eval $1/gem;
# if some assembler chokes on some simplified mnemonic,
# this is the spot to fix it up, e.g.:
# GNU as doesn't seem to accept cmplw, 32-bit unsigned compare
$data =~ s/^(\s*)cmplw(\s+)([^,]+),(.*)/$1cmpl$2$3,0,$4/gm;
# assembler X doesn't accept li, load immediate value
#$data =~ s/^(\s*)li(\s+)([^,]+),(.*)/$1addi$2$3,0,$4/gm;
return($data);
}
| 22.809524 | 78 | 0.619936 |
ed3219b9a3e82fbf22ac2d16afd9737d3992ee8d | 251 | pm | Perl | auto-lib/Azure/CertificateRegistration/AppServiceCertificate.pm | pplu/azure-sdk-perl | 26cbef2d926f571bc1617c26338c106856f95568 | [
"Apache-2.0"
]
| null | null | null | auto-lib/Azure/CertificateRegistration/AppServiceCertificate.pm | pplu/azure-sdk-perl | 26cbef2d926f571bc1617c26338c106856f95568 | [
"Apache-2.0"
]
| null | null | null | auto-lib/Azure/CertificateRegistration/AppServiceCertificate.pm | pplu/azure-sdk-perl | 26cbef2d926f571bc1617c26338c106856f95568 | [
"Apache-2.0"
]
| 1 | 2021-04-08T15:26:39.000Z | 2021-04-08T15:26:39.000Z | package Azure::CertificateRegistration::AppServiceCertificate;
use Moose;
has 'keyVaultId' => (is => 'ro', isa => 'Str' );
has 'keyVaultSecretName' => (is => 'ro', isa => 'Str' );
has 'provisioningState' => (is => 'ro', isa => 'Str' );
1;
| 31.375 | 62 | 0.593625 |
ed140a14212da00a40237148298f2ef798bf8aba | 6,184 | pl | Perl | misc-scripts/db/convert_tables_MyISAM_InnoDB.pl | duartemolha/ensembl | 378db18977278a066bd54b41e7afcf1db05d7db3 | [
"Apache-2.0"
]
| null | null | null | misc-scripts/db/convert_tables_MyISAM_InnoDB.pl | duartemolha/ensembl | 378db18977278a066bd54b41e7afcf1db05d7db3 | [
"Apache-2.0"
]
| null | null | null | misc-scripts/db/convert_tables_MyISAM_InnoDB.pl | duartemolha/ensembl | 378db18977278a066bd54b41e7afcf1db05d7db3 | [
"Apache-2.0"
]
| null | null | null | #!/usr/bin/env perl
# Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
# Copyright [2016-2019] EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################################################
# convert_tables_MyISAM_InnoDB.pl script
# given a pattern of databases to query, lists all tables and whether they are InnoDB or MyISAM
# can convert a list of tables, or all tables, to MyISAM, or to InnoDB, as specified
# USAGE : perl convert_tables_MyISAM_InnoDB.pl -dbpattern _core_ -convert_to MyISAM -convert_all
################################################################################################################
# $Source: /cvsroot/ensembl/ensembl-personal/genebuilders/scripts/convert_tables_MyISAM_InnoDB.pl,v $
# $Revision: 1.4 $
use strict;
use warnings;
use Getopt::Long qw(:config no_ignore_case);
use DBI;
my ($host, $user, $pass, $port, $dbpattern, $verbose, $convert_all, $convert_to, $tables);
$user = 'ensro';
$pass = '';
$port = 3306;
$host = 'ens-staging';
$verbose = 0;
$dbpattern = '';
GetOptions( "host|h|dbhost=s" => \$host,
"user|u|dbuser=s" => \$user,
"pass|p|dbpass=s" => \$pass,
"port|P|dbport=i" => \$port,
"dbpattern|pattern=s" => \$dbpattern,
'verbose!' => \$verbose,
'convert_all!' => \$convert_all, # flag to convert all tables
'convert_to=s' => \$convert_to, # engine to covert the tables to ( MyISAM, InnoDB )
'tables=s' => \$tables, # comma-separated list of tables to convert ie exon,exon_transcript
);
my $dsn = "DBI:mysql:host=$host";
if( $port ) {
$dsn .= ";port=$port";
}
my $db = DBI->connect( $dsn, $user, $pass) ;
my @dbnames = map {$_->[0] } @{ $db->selectall_arrayref( "show databases" ) };
for my $dbname ( @dbnames ) {
if( $dbname =~ /$dbpattern/ ) {
print "connecting to $dbname\n" ;
my $dsn_info = sprintf( "DBI:mysql:database=%s;host=%s;port=%s", 'information_schema', $host, $port) ;
my $db_info = DBI->connect( $dsn_info, $user, $pass ) ;
my %engine_tables = %{ check_for_tables($db_info, $dbname, $verbose) } ;
my @tables_to_convert ;
if ( $tables ) {
@tables_to_convert = split /\,/, $tables ;
} elsif ( $convert_all ) {
if ( $convert_to =~m/MyISAM/) {
die('There is no table to convert! Exiting...'."\n") unless (exists $engine_tables{"InnoDB"});
@tables_to_convert = @{$engine_tables{"InnoDB"}};
}elsif ( $convert_to =~ m/InnoDB/ ) {
die('There is no table to convert! Exiting...'."\n") unless (exists $engine_tables{"MyISAM"});
@tables_to_convert = @{$engine_tables{"MyISAM"}} ;
}
}
unless ( $convert_to ) {
print "\n\n\nTo convert selected tables to use a different storage engines, use : \n\n" ;
print "\t\t-convert_to [MyISAM|InnoDB]' -tables exon_transcript,job,exon\n\n\n"
." OR convert all tables with :\n\n\t\t-convert_to MyISAM -convert_all \n" ;
} else {
print "\n\nWill convert these tables : \n" ;
for my $table ( @tables_to_convert ) {
printf "%-10s ===> %-10s\n", $table, $convert_to ;
}
print "\n\n\tARE YOU SURE YOU WANT TO GO AHEAD ??? ( Y / N )" ;
if ( get_input_arg() ) {
convert_all_tables ( $dbname, \@tables_to_convert, $convert_to ) ;
} else {
print "Stopping as you don't want to go ahead. no tables have been converted \n" ;
}
}
$db_info->disconnect() ;
}
}
sub convert_all_tables {
my ( $dbname, $tables_to_convert, $convert_to ) = @_ ;
my $dsn_info = sprintf( "DBI:mysql:database=%s;host=%s;port=%s", $dbname, $host, $port) ;
my $dbh = DBI->connect( $dsn_info, $user, $pass ) ;
for my $table ( @$tables_to_convert ) {
my $sql= "alter table $table engine =\'".$convert_to."\';" ;
$dbh->do($sql) ;
print "table $table converted to $convert_to\n" ;
}
$dbh->disconnect();
}
sub check_for_tables {
my ($db_info, $dbname, $verbose) = @_;
my $sql ="select table_type, table_name, engine from tables where table_schema =\'".$dbname. "\' " ;
my $lines = $db_info->selectall_arrayref($sql) ;
my %engine_types;
for my $r( @$lines) {
my @rows = @$r ;
if ($rows[0] eq 'BASE TABLE') {
push @{ $engine_types{$rows[2]}}, $rows[1] ;
} elsif ($rows[0] eq 'VIEW') {
push @{ $engine_types{$rows[0]}}, $rows[1] ;
}
}
for ( keys %engine_types ) {
print uc($_) . " " . scalar(@{$engine_types{$_}}) . " tables $dbname\n" ;
}
if ( $verbose ) {
print "\n\nTable types found :\n---------------------------------------\n\n" ;
for my $engine( keys %engine_types ) {
for my $table ( @{ $engine_types{$engine}} ) {
printf "%-10s%-10s\n", $engine, $table ;
}
}
}
return \%engine_types ;
}
=head2 get_input_arg ( Bio::EnsEMBL::Analysis::Tools::Utilities)
Function : waits for input from STDIN and returns '1' if input =~m/y/i
and '0' if input matches /n/i.
Returntype: 1 or 0
Exceptions: none
=cut
sub get_input_arg {
while (defined (my $line=<STDIN>)){
chomp($line) ;
if ( $line=~m/y/i){
return 1 ;
}elsif( $line =~m/n/i){
return 0 ;
}
print "Wrong input - only answer 'y' or 'n'\n" ;
}
}
| 35.745665 | 120 | 0.561287 |
ed06baaa64450a1a1b34a65e8e42fedc1df07eef | 1,701 | pm | Perl | t/loader.pm | robkinyon/dbix-class-sims-type-date | ef5abf5407a2a1f25b989cd542262cfc867e9dc4 | [
"MIT"
]
| null | null | null | t/loader.pm | robkinyon/dbix-class-sims-type-date | ef5abf5407a2a1f25b989cd542262cfc867e9dc4 | [
"MIT"
]
| null | null | null | t/loader.pm | robkinyon/dbix-class-sims-type-date | ef5abf5407a2a1f25b989cd542262cfc867e9dc4 | [
"MIT"
]
| null | null | null | # vi:sw=2
package # Hide from PAUSE
t::loader;
use strictures 2;
use base 'Exporter';
our @EXPORT_OK = qw(
build_schema
);
use Data::Dumper;
sub build_schema {
my $def = shift;
my $schema = "MyApp::Schema";
my $prefix = "MyApp::Schema::Result";
my $pkg = '';
my @packages;
while (my $name = shift @{$def//[]}) {
my $defn = shift @$def;
push @packages, $name;
$pkg .= "{ package ${prefix}::$name;\n use base 'DBIx::Class::Core';\n";
$pkg .= " __PACKAGE__->table('$defn->{table}');\n";
local $Data::Dumper::Terse = 1;
(my $v = Dumper($defn->{columns})) =~ s/{\n(.*)}\n/$1/ms;
$pkg .= " __PACKAGE__->add_columns(\n$v );\n";
my $pks = join ',', map { "'$_'" } @{$defn->{primary_keys}};
$pkg .= " __PACKAGE__->set_primary_key($pks);\n";
foreach my $uk (@{$defn->{unique_constraints}//[]}) {
my $key = Dumper($uk);
$pkg .= " __PACKAGE__->add_unique_constraint($key);\n";
}
foreach my $rel_type (qw(has_many belongs_to)) {
while (my ($name, $opts) = each %{$defn->{$rel_type}}) {
while (my ($foreign, $column) = each %{$opts}) {
$column = ref($column) eq 'HASH'
? Dumper($column) : "'$column'";
$pkg .= " __PACKAGE__->$rel_type(\n";
$pkg .= " $name => '${prefix}::$foreign' => $column,\n";
$pkg .= " );\n";
}
}
}
$pkg .= "}\n";
}
$pkg .= "{ package $schema;\n use base 'DBIx::Class::Schema';\n";
$pkg .= " __PACKAGE__->register_class($_ => '${prefix}::$_');\n"
for @packages;
$pkg .= " __PACKAGE__->load_components('Sims');\n}\n";
#print STDERR $pkg;
eval $pkg; if ($@) {
die "$@\n";
}
}
1;
| 24.3 | 77 | 0.511464 |
ed598109184c88b5d277e8f65d7f5b22cbf2900d | 3,259 | pm | Perl | modules/Bio/EnsEMBL/Production/Pipeline/FileDump/Geneset_EMBL.pm | ens-bwalts/ensembl-production | ce2ccecbf5d2a56528e3f77e9a4e930a3d0129db | [
"Apache-2.0"
]
| 9 | 2016-06-24T16:58:52.000Z | 2021-01-27T15:38:00.000Z | modules/Bio/EnsEMBL/Production/Pipeline/FileDump/Geneset_EMBL.pm | ens-bwalts/ensembl-production | ce2ccecbf5d2a56528e3f77e9a4e930a3d0129db | [
"Apache-2.0"
]
| 187 | 2015-01-09T10:27:54.000Z | 2022-03-08T11:28:24.000Z | modules/Bio/EnsEMBL/Production/Pipeline/FileDump/Geneset_EMBL.pm | ens-bwalts/ensembl-production | ce2ccecbf5d2a56528e3f77e9a4e930a3d0129db | [
"Apache-2.0"
]
| 60 | 2015-01-22T16:08:35.000Z | 2022-03-04T17:31:32.000Z | =head1 LICENSE
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2020] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=cut
package Bio::EnsEMBL::Production::Pipeline::FileDump::Geneset_EMBL;
use strict;
use warnings;
use base qw(Bio::EnsEMBL::Production::Pipeline::FileDump::Base_Filetype);
use Bio::EnsEMBL::Utils::SeqDumper;
use Path::Tiny;
sub param_defaults {
my ($self) = @_;
return {
%{$self->SUPER::param_defaults},
data_type => 'genes',
file_type => 'embl',
per_chromosome => 0,
};
}
sub run {
my ($self) = @_;
my $data_type = $self->param_required('data_type');
my $per_chromosome = $self->param_required('per_chromosome');
my $filenames = $self->param_required('filenames');
my $dba = $self->dba;
my $seq_dumper = $self->seq_dumper();
my ($chr, $non_chr, $non_ref) = $self->get_slices($dba);
my $filename = $$filenames{$data_type};
if ($per_chromosome && scalar(@$chr)) {
$self->print_to_file($chr, 'chr', $filename, '>', $seq_dumper);
if (scalar(@$non_chr)) {
$self->print_to_file($non_chr, 'non_chr', $filename, '>>', $seq_dumper);
}
} else {
$self->print_to_file([@$chr, @$non_chr], undef, $filename, '>', $seq_dumper);
}
if (scalar(@$non_ref)) {
my $non_ref_filename = $self->generate_non_ref_filename($filename);
path($filename)->copy($non_ref_filename);
$self->print_to_file($non_ref, undef, $non_ref_filename, '>>', $seq_dumper);
}
}
sub print_to_file {
my ($self, $slices, $region, $filename, $mode, $seq_dumper) = @_;
my $fh = path($filename)->filehandle($mode);
my $non_chr_fh;
if ($region && $region eq 'non_chr') {
my $non_chr_filename = $self->generate_non_chr_filename($filename);
$non_chr_fh = path($non_chr_filename)->filehandle($mode);
}
while (my $slice = shift @{$slices}) {
my $chr_fh;
if ($region && $region eq 'chr') {
my $chr_filename = $self->generate_chr_filename($filename, $slice);
$chr_fh = path($chr_filename)->filehandle($mode);
}
$seq_dumper->dump_embl($slice, $fh);
if ($region && $region eq 'chr') {
$seq_dumper->dump_embl($slice, $chr_fh);
} elsif ($region && $region eq 'non_chr') {
$seq_dumper->dump_embl($slice, $non_chr_fh);
}
}
}
sub seq_dumper {
my ($self) = @_;
my $seq_dumper =
Bio::EnsEMBL::Utils::SeqDumper->new({ chunk_factor => 100000 });
$seq_dumper->disable_feature_type('similarity');
$seq_dumper->disable_feature_type('genscan');
$seq_dumper->disable_feature_type('variation');
$seq_dumper->disable_feature_type('repeat');
$seq_dumper->disable_feature_type('marker');
return $seq_dumper;
}
1;
| 28.587719 | 100 | 0.672292 |
ed4318cf0356220e49e78141e58fac6c3d6d2fa9 | 2,653 | t | Perl | xt/author/no-tabs.t | gitpan/MooseX-Declare | 3d63d569ba39792e224f43e18a13bda5c44364b4 | [
"Artistic-1.0"
]
| null | null | null | xt/author/no-tabs.t | gitpan/MooseX-Declare | 3d63d569ba39792e224f43e18a13bda5c44364b4 | [
"Artistic-1.0"
]
| null | null | null | xt/author/no-tabs.t | gitpan/MooseX-Declare | 3d63d569ba39792e224f43e18a13bda5c44364b4 | [
"Artistic-1.0"
]
| null | null | null | use strict;
use warnings;
# this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.09
use Test::More 0.88;
use Test::NoTabs;
my @files = (
'lib/MooseX/Declare.pm',
'lib/MooseX/Declare/Context.pm',
'lib/MooseX/Declare/Context/Namespaced.pm',
'lib/MooseX/Declare/Context/Parameterized.pm',
'lib/MooseX/Declare/Context/WithOptions.pm',
'lib/MooseX/Declare/StackItem.pm',
'lib/MooseX/Declare/Syntax/EmptyBlockIfMissing.pm',
'lib/MooseX/Declare/Syntax/Extending.pm',
'lib/MooseX/Declare/Syntax/InnerSyntaxHandling.pm',
'lib/MooseX/Declare/Syntax/Keyword/Class.pm',
'lib/MooseX/Declare/Syntax/Keyword/Clean.pm',
'lib/MooseX/Declare/Syntax/Keyword/Method.pm',
'lib/MooseX/Declare/Syntax/Keyword/MethodModifier.pm',
'lib/MooseX/Declare/Syntax/Keyword/Namespace.pm',
'lib/MooseX/Declare/Syntax/Keyword/Role.pm',
'lib/MooseX/Declare/Syntax/Keyword/With.pm',
'lib/MooseX/Declare/Syntax/KeywordHandling.pm',
'lib/MooseX/Declare/Syntax/MethodDeclaration.pm',
'lib/MooseX/Declare/Syntax/MethodDeclaration/Parameterized.pm',
'lib/MooseX/Declare/Syntax/MooseSetup.pm',
'lib/MooseX/Declare/Syntax/NamespaceHandling.pm',
'lib/MooseX/Declare/Syntax/OptionHandling.pm',
'lib/MooseX/Declare/Syntax/RoleApplication.pm',
'lib/MooseX/Declare/Util.pm',
't/00-report-prereqs.dd',
't/00-report-prereqs.t',
't/anon.t',
't/attribute_issues.t',
't/autoclean.t',
't/basic.t',
't/clean.t',
't/import.t',
't/inner_keywords.t',
't/lib/Affe.pm',
't/lib/Foo.pm',
't/lib/ParameterizedRole.pm',
't/lib/Tiger.pm',
't/lib/WithMethod.pm',
't/lib/WithNewline.pm',
't/manual_namespace.t',
't/meta_should_be_signature.t',
't/method_as_default.t',
't/modifier_order.t',
't/modifiers.t',
't/modify_with_invocant.t',
't/nested_anonymous_classes.t',
't/nesting.t',
't/optional_positional.t',
't/override_attribute_from_role.t',
't/recipes/basics/001_point.t',
't/recipes/basics/002_bank_account.t',
't/recipes/basics/006_augment_inner.t',
't/role_application.t',
't/role_parameterized.t',
't/segfault_syntax_error.t',
't/zzz-check-breaks.t',
'xt/author/00-compile.t',
'xt/author/clean-namespaces.t',
'xt/author/eol.t',
'xt/author/no-tabs.t',
'xt/release/changes_has_content.t',
'xt/release/cpan-changes.t',
'xt/release/distmeta.t',
'xt/release/kwalitee.t',
'xt/release/minimum-version.t',
'xt/release/mojibake.t',
'xt/release/pod-syntax.t',
'xt/release/portability.t'
);
notabs_ok($_) foreach @files;
done_testing;
| 32.353659 | 69 | 0.679608 |
ed559eabdd4487b2a10e567d7cae30680d59b062 | 12,487 | pm | Perl | lib/Web/Sitemap.pm | brtastic/perl-web-sitemap | 683a3057eda334d53054a290a458e2737e951a3c | [
"Artistic-1.0-cl8"
]
| 3 | 2015-05-16T19:15:07.000Z | 2021-01-11T17:57:00.000Z | lib/Web/Sitemap.pm | brtastic/perl-web-sitemap | 683a3057eda334d53054a290a458e2737e951a3c | [
"Artistic-1.0-cl8"
]
| 4 | 2015-05-17T23:24:43.000Z | 2021-01-17T20:12:48.000Z | lib/Web/Sitemap.pm | brtastic/perl-web-sitemap | 683a3057eda334d53054a290a458e2737e951a3c | [
"Artistic-1.0-cl8"
]
| 2 | 2015-05-16T19:16:45.000Z | 2021-01-11T15:35:56.000Z | package Web::Sitemap;
our $VERSION = '0.903';
use strict;
use warnings;
use bytes;
use File::Temp;
use File::Copy;
use IO::Compress::Gzip qw/gzip $GzipError/;
use Encode;
use Carp;
use Web::Sitemap::Url;
use constant {
URL_LIMIT => 50000,
FILE_SIZE_LIMIT => 50 * 1024 * 1024,
FILE_SIZE_LIMIT_MIN => 1024 * 1024,
DEFAULT_FILE_PREFIX => 'sitemap.',
DEFAULT_TAG => 'pages',
DEFAULT_INDEX_NAME => 'sitemap',
XML_HEAD => '<?xml version="1.0" encoding="UTF-8"?>',
XML_MAIN_NAMESPACE => 'xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"',
XML_MOBILE_NAMESPACE => 'xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0"',
XML_IMAGES_NAMESPACE => 'xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"'
};
sub new
{
my ($class, %p) = @_;
my %allowed_keys = map { $_ => 1 } qw(
output_dir temp_dir loc_prefix
url_limit file_size_limit file_prefix
file_loc_prefix default_tag index_name
mobile images namespace
charset move_from_temp_action
);
my @bad_keys = grep { !exists $allowed_keys{$_} } keys %p;
croak "Unknown parameters: @bad_keys" if @bad_keys;
my $self = {
loc_prefix => '',
tags => {},
url_limit => URL_LIMIT,
file_size_limit => FILE_SIZE_LIMIT,
file_prefix => DEFAULT_FILE_PREFIX,
file_loc_prefix => '',
default_tag => DEFAULT_TAG,
index_name => DEFAULT_INDEX_NAME,
mobile => 0,
images => 0,
charset => 'utf8',
%p, # actual input values
};
$self->{file_loc_prefix} ||= $self->{loc_prefix};
if ($self->{file_size_limit} < FILE_SIZE_LIMIT_MIN) {
$self->{file_size_limit} = FILE_SIZE_LIMIT_MIN;
}
if ($self->{namespace}) {
$self->{namespace} = [$self->{namespace}]
if !ref $self->{namespace};
croak 'namespace must be scalar or array ref!'
if ref $self->{namespace} ne 'ARRAY';
}
unless ($self->{output_dir}) {
croak 'output_dir expected!';
}
if ($self->{temp_dir} and not -w $self->{temp_dir}) {
croak sprintf "Can't write to temp_dir '%s' (error: %s)", $self->{temp_dir}, $!;
}
if ($self->{move_from_temp_action} and ref $self->{move_from_temp_action} ne 'CODE') {
croak 'move_from_temp_action must be code ref!';
}
return bless $self, $class;
}
sub add
{
my ($self, $url_list, %p) = @_;
my $tag = $p{tag} || $self->{default_tag};
if (ref $url_list ne 'ARRAY') {
croak 'The list of sitemap URLs must be array ref';
}
for my $url (@$url_list) {
my $data = Web::Sitemap::Url->new(
$url,
mobile => $self->{mobile},
loc_prefix => $self->{loc_prefix},
)->to_xml_string;
if ($self->_file_limit_near($tag, bytes::length $data)) {
$self->_next_file($tag);
}
$self->_append_url($tag, $data);
}
}
sub finish
{
my ($self, %p) = @_;
return unless keys %{$self->{tags}};
my $index_temp_file_name = $self->_temp_file->filename;
open my $index_file, '>' . $index_temp_file_name or croak "Can't open file '$index_temp_file_name'! $!\n";
print {$index_file} XML_HEAD;
printf {$index_file} "\n<sitemapindex %s>", XML_MAIN_NAMESPACE;
for my $tag (sort keys %{$self->{tags}}) {
my $data = $self->{tags}{$tag};
$self->_close_file($tag);
for my $page (1 .. $data->{page}) {
printf {$index_file} "\n<sitemap><loc>%s/%s</loc></sitemap>", $self->{file_loc_prefix},
$self->_file_name($tag, $page);
}
}
print {$index_file} "\n</sitemapindex>";
close $index_file;
$self->_move_from_temp(
$index_temp_file_name,
$self->{output_dir} . '/' . $self->{index_name} . '.xml'
);
}
sub _move_from_temp
{
my ($self, $temp_file_name, $public_file_name) = @_;
#printf "move %s -> %s\n", $temp_file_name, $public_file_name;
if ($self->{move_from_temp_action}) {
$self->{move_from_temp_action}($temp_file_name, $public_file_name);
}
else {
File::Copy::move($temp_file_name, $public_file_name)
or croak sprintf 'move %s -> %s error: %s', $temp_file_name, $public_file_name, $!;
}
}
sub _file_limit_near
{
my ($self, $tag, $new_portion_size) = @_;
return 0 unless defined $self->{tags}{$tag};
# printf("tag: %s.%d; url: %d; gzip_size: %d (%d)\n",
# $tag,
# $self->{tags}->{$tag}->{page},
# $self->{tags}->{$tag}->{url_count},
# $self->{tags}->{$tag}->{file_size},
# $self->{file_size_limit}
# );
return (
$self->{tags}{$tag}{url_count} >= $self->{url_limit}
||
# 200 bytes should be well enough for the closing tags at the end of the file
($self->{tags}{$tag}{file_size} + $new_portion_size) >= ($self->{file_size_limit} - 200)
);
}
sub _temp_file
{
my ($self) = @_;
return File::Temp->new(
UNLINK => 1,
$self->{temp_dir} ? (DIR => $self->{temp_dir}) : ()
);
}
sub _set_new_file
{
my ($self, $tag) = @_;
my $temp_file = $self->_temp_file;
$self->{tags}{$tag}{page}++;
$self->{tags}{$tag}{url_count} = 0;
$self->{tags}{$tag}{file_size} = 0;
$self->{tags}{$tag}{file} = IO::Compress::Gzip->new($temp_file->filename)
or croak "gzip failed: $GzipError\n";
$self->{tags}{$tag}{file}->autoflush;
$self->{tags}{$tag}{temp_file} = $temp_file;
# Do not check the file for oversize because it is empty and will likely
# not exceed 1MB with initial tags alone
my @namespaces = (XML_MAIN_NAMESPACE);
push @namespaces, XML_MOBILE_NAMESPACE
if $self->{mobile};
push @namespaces, XML_IMAGES_NAMESPACE
if $self->{images};
push @namespaces, @{$self->{namespace}}
if $self->{namespace};
$self->_append(
$tag,
sprintf("%s\n<urlset %s>", XML_HEAD, join(' ', @namespaces))
);
}
sub _file_handle
{
my ($self, $tag) = @_;
unless (exists $self->{tags}{$tag}) {
$self->_set_new_file($tag);
}
return $self->{tags}{$tag}{file};
}
sub _append
{
my ($self, $tag, $data) = @_;
$self->_file_handle($tag)->print(Encode::encode($self->{charset}, $data));
$self->{tags}{$tag}{file_size} += bytes::length $data;
}
sub _append_url
{
my ($self, $tag, $data) = @_;
$self->_append($tag, $data);
$self->{tags}{$tag}{url_count}++;
}
sub _next_file
{
my ($self, $tag) = @_;
$self->_close_file($tag);
$self->_set_new_file($tag);
}
sub _close_file
{
my ($self, $tag) = @_;
$self->_append($tag, "\n</urlset>");
$self->_file_handle($tag)->close;
$self->_move_from_temp(
$self->{tags}{$tag}{temp_file}->filename,
$self->{output_dir} . '/' . $self->_file_name($tag)
);
}
sub _file_name
{
my ($self, $tag, $page) = @_;
return
$self->{file_prefix}
. $tag
. '.'
. ($page || $self->{tags}{$tag}{page})
. '.xml.gz'
;
}
1;
__END__
=pod
=encoding utf8
=head1 NAME
Web::Sitemap - Simple way to generate sitemap files with paging support
=head1 SYNOPSIS
use Web::Sitemap;
my $sm = Web::Sitemap->new(
output_dir => '/path/for/sitemap',
### Options ###
temp_dir => '/path/to/tmp',
loc_prefix => 'http://my_domain.com',
index_name => 'sitemap',
file_prefix => 'sitemap.',
# mark for grouping urls
default_tag => 'my_tag',
# add <mobile:mobile/> inside <url>, and appropriate namespace (Google standard)
mobile => 1,
# add appropriate namespace (Google standard)
images => 1,
# additional namespaces (scalar or array ref) for <urlset>
namespace => 'xmlns:some_namespace_name="..."',
# location prefix for files-parts of the sitemap (default is loc_prefix value)
file_loc_prefix => 'http://my_domain.com',
# specify data input charset
charset => 'utf8',
move_from_temp_action => sub {
my ($temp_file_name, $public_file_name) = @_;
# ...some action...
#
# default behavior is
# File::Copy::move($temp_file_name, $public_file_name);
}
);
$sm->add(\@url_list);
# When adding a new portion of URL, you can specify a label for the file in which these will be URL
$sm->add(\@url_list1, tag => 'articles');
$sm->add(\@url_list2, tag => 'users');
# If in the process of filling the file number of URL's will exceed the limit of 50 000 URL or the file size is larger than 50MB, the file will be rotate
$sm->add(\@url_list3, tag => 'articles');
# After calling finish() method will create an index file, which will link to files with URL's
$sm->finish;
=head1 DESCRIPTION
This module is an utility for generating indexed sitemaps.
Each sitemap file can have up to 50 000 URLs or up to 50MB in size (after decompression) according to L<sitemaps.org|https://www.sitemaps.org/faq.html#faq_sitemap_size>. Any page that exceeds that limit must use L<sitemap index files|https://www.sitemaps.org/protocol.html#index> instead.
Web::Sitemap generates a single sitemap index with links to multiple sitemap pages. The pages are automatically split when they reach the limit and are always gzip compressed. Files are created in form of temporary files and copied over to the destination directory, but the copy action can be hooked into to change that behavior.
=head1 INTERFACE
Web::Sitemap only provides OO interface.
=head2 Methods
=head3 new
my $sitemap = Web::Sitemap->new(output_dir => $dirname, %options);
Constructs a new Web::Sitemap object that will generate the sitemap.
Files will be put into I<output_dir>. This argument is required.
Other optional arguments include:
=over
=item * C<temp_dir>
Path to a temporary directory. Must already exist and be
writable. If not specified, a new temporary directory will be created using
L<File::Temp>.
=item * C<loc_prefix>
A location prefix for all the urls in the sitemap, like
I<'http://my_domain.com'>. Defaults to an empty string.
=item * C<index_name>
Name of the sitemap index (basename without the extension).
Defaults to I<'sitemap'>.
=item * C<file_prefix>
Prefix for all sitemap files containing URLs. Defaults to
I<'sitemap.'>.
=item * C<default_tag>
A default tag that will be used for grouping URLs in files
when they are added without an explicit tag. Defaults to I<'pages'>.
=item * C<mobile>
Will add a mobile namespace to the sitemap files, and each URL will
contain C<< <mobile:mobile/> >>. This is a Google standard. Disabled by
default.
=item * C<images>
Will add images namespace to the sitemap files. This is a Google
standard. Disabled by default.
=item * C<namespace>
Additional namespaces to be added to the sitemap files. This can
be a string or an array reference containing strings. Empty by default.
=item * C<file_loc_prefix>
A prefix that will be put before the filenames in the
sitemap index. This will not cause files to be put in a different directory,
will only affect the sitemap index. Defaults to the value of C<loc_prefix>.
=item * C<charset>
Encoding to be used for writing the files. Defaults to I<'utf8'>.
=item * C<move_from_temp_action>
A coderef that will change how the files are handled
after successful generation. Will be called once for each generated file and be
passed these arguments: C<$temporary_file_path, $destination_file_path>.
By default it will copy the files using I<File::Copy::move>.
=back
=head3 add
$sitemap->add(\@links, tag => $tagname);
Adds more links to the sitemap under I<$tagname> (can be ommited - defaults to
C<pages> or the one specified in the constructor).
Links can be simple scalars (URL strings) or a hashref. See
L<Web::Sitemap::Url/new> for a list of possible hashref arguments.
Can be called multiple times.
=head3 finish
$sitemap->finish;
Finalizes the sitemap creation and calls the function to move temporary files
to the output directory.
=head1 EXAMPLES
=head2 Support for Google images format
=head3 Format 1
$sitemap->add([{
loc => 'http://test1.ru/',
images => {
caption_format => sub {
my ($iterator_value) = @_;
return sprintf('Vasya - foto %d', $iterator_value);
},
loc_list => [
'http://img1.ru/',
'http://img2.ru'
]
}
}]);
=head3 Format 2
$sitemap->add([{
loc => 'http://test11.ru/',
images => {
caption_format_simple => 'Vasya - foto',
loc_list => ['http://img11.ru/', 'http://img21.ru']
}
}]);
=head3 Format 3
$sitemap->add([{
loc => 'http://test122.ru/',
images => {
loc_list => [
{ loc => 'http://img122.ru/', caption => 'image #1' },
{ loc => 'http://img133.ru/', caption => 'image #2' },
{ loc => 'http://img144.ru/', caption => 'image #3' },
{ loc => 'http://img222.ru', caption => 'image #4' }
]
}
}]);
);
=head1 AUTHOR
Mikhail N Bogdanov C<< <mbogdanov at cpan.org > >>
=head1 CONTRIBUTORS
In no particular order:
Ivan Bessarabov
Bartosz Jarzyna (@brtastic)
=head1 LICENSE
This module and all the packages in this module are governed by the same license as Perl itself.
=cut
| 23.383895 | 330 | 0.662449 |
ed5b931a00257c873e485a1b442232430a45c6f5 | 1,373 | t | Perl | xt/author/00-compile.t | gitpan/CPAN-Meta | 698ad1b33778ae345b4cd75a3ba76b44d9e690b5 | [
"Artistic-1.0"
]
| null | null | null | xt/author/00-compile.t | gitpan/CPAN-Meta | 698ad1b33778ae345b4cd75a3ba76b44d9e690b5 | [
"Artistic-1.0"
]
| null | null | null | xt/author/00-compile.t | gitpan/CPAN-Meta | 698ad1b33778ae345b4cd75a3ba76b44d9e690b5 | [
"Artistic-1.0"
]
| null | null | null | use 5.006;
use strict;
use warnings;
# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.051
use Test::More;
plan tests => 8 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
my @module_files = (
'CPAN/Meta.pm',
'CPAN/Meta/Converter.pm',
'CPAN/Meta/Feature.pm',
'CPAN/Meta/History.pm',
'CPAN/Meta/Merge.pm',
'CPAN/Meta/Prereqs.pm',
'CPAN/Meta/Spec.pm',
'CPAN/Meta/Validator.pm'
);
# fake home for cpan-testers
use File::Temp;
local $ENV{HOME} = File::Temp::tempdir( CLEANUP => 1 );
my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib';
use File::Spec;
use IPC::Open3;
use IO::Handle;
open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
my @warnings;
for my $lib (@module_files)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my $stderr = IO::Handle->new;
my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]");
binmode $stderr, ':crlf' if $^O eq 'MSWin32';
my @_warnings = <$stderr>;
waitpid($pid, 0);
is($?, 0, "$lib loaded ok");
if (@_warnings)
{
warn @_warnings;
push @warnings, @_warnings;
}
}
is(scalar(@warnings), 0, 'no warnings found')
or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING};
| 22.145161 | 147 | 0.601602 |
ed3811eb4e5cf8c2bc1085fa713fa53817f0cd27 | 2,348 | pm | Perl | lib/BRAEMBL/ENA/Submission/Serialiser.pm | BRAEMBL/ena-tools | 96ab52ee77793e3ec61ef819bc5c983e90448a26 | [
"Unlicense"
]
| 6 | 2015-02-15T19:26:25.000Z | 2018-07-30T10:05:37.000Z | lib/BRAEMBL/ENA/Submission/Serialiser.pm | BRAEMBL/ena-tools | 96ab52ee77793e3ec61ef819bc5c983e90448a26 | [
"Unlicense"
]
| null | null | null | lib/BRAEMBL/ENA/Submission/Serialiser.pm | BRAEMBL/ena-tools | 96ab52ee77793e3ec61ef819bc5c983e90448a26 | [
"Unlicense"
]
| null | null | null | package BRAEMBL::ENA::Submission::Serialiser;
use Moose;
has 'no_md5' => (
is => 'rw',
isa => 'Bool',
trigger => sub {
my $self = shift;
$self->compute_md5(!$self->compute_md5);
},
default => 1,
);
has 'compute_md5' => (
is => 'rw',
isa => 'Bool',
default => 1,
);
has 'template_dir' => (
is => 'rw',
isa => 'Str',
required => 1,
);
has 'output_dir' => (
is => 'rw',
isa => 'Str',
required => 1,
);
sub serialise_study {
my $self = shift;
my $param = shift;
my $metadata = $param->{metadata};
my $format = $param->{format};
my $compute_md5 = $param->{compute_md5};
my $reporter = $param->{reporter};
my $template_dir = $self->template_dir;
my $output_dir = $self->output_dir;
my $study = $param->{study};
use BRAEMBL::DefaultLogger;
my $logger = &get_logger;
$logger->info("Creating submission files for: " . $study->alias);
$logger->info("Results will be written to " . $output_dir);
foreach my $current_format (@$format) {
my $current_output_dir = File::Spec->join(
$output_dir,
$current_format
);
my $current_template_dir = File::Spec->join(
$template_dir,
$current_format
);
my $current_generated_file = run_template_engine({
study => $study,
template_dir => $current_template_dir,
output_dir => $current_output_dir,
format => $current_format,
});
$reporter->add($current_format, $current_generated_file);
}
}
sub run_template_engine {
my $param = shift;
my $study = $param->{study};
my $template_dir = $param->{template_dir};
my $output_dir = $param->{output_dir};
my $format = $param->{format};
use BRAEMBL::ENA::Rest::TemplateEngineRunnerFactory;
my $template_engine_runner = BRAEMBL::ENA::Rest::TemplateEngineRunnerFactory
->new
->create_template_engine_runner($format);
$template_engine_runner->template_dir($template_dir);
$template_engine_runner->output_dir($output_dir);
my $generated_file = $template_engine_runner->apply_templates($study);
return $generated_file;
}
1;
| 23.48 | 80 | 0.565162 |
73dc785aebc732200a3194554be4c2bf7dfd525e | 6,648 | pl | Perl | BarBIQ_code_1_0_0.0/BarBIQ_sub_barcode_fix.pl | Shiroguchi-Lab/BarBIQ | 25a3219c67a4ad7f1c1dbcc03b0f207106f8eee5 | [
"Artistic-1.0-Perl"
]
| 1 | 2022-02-24T03:32:56.000Z | 2022-02-24T03:32:56.000Z | BarBIQ_code_1_0_0.0/BarBIQ_sub_barcode_fix.pl | Shiroguchi-Lab/BarBIQ | 25a3219c67a4ad7f1c1dbcc03b0f207106f8eee5 | [
"Artistic-1.0-Perl"
]
| null | null | null | BarBIQ_code_1_0_0.0/BarBIQ_sub_barcode_fix.pl | Shiroguchi-Lab/BarBIQ | 25a3219c67a4ad7f1c1dbcc03b0f207106f8eee5 | [
"Artistic-1.0-Perl"
]
| null | null | null | #! /usr/bin/env perl
##########################################################################################################################################
######Description of this code#####
## This code is used for deleting the barcode according to the fixed base which were designed in the original barcode
## You should prepare a file which contain the designed fixed bases like the BarBIQ_example_fixed_base.txt and for the real sample and standard samples individuely
## You can do at the same time for mutipule files which used the same fixed bases. Finally, you will get a merged file for all files
## Please prepare a file which contain the file names of all inputfiles like the BarBIQ_example_inputfile_name.txt
## The input data should be fasta format and with .fasta, output file will also be fasta format.
##########################################################################################################################################
######how to run this code #####
###command##
## BarBIQ_sub_barcode_fix.pl --in BarBIQ_example_inputfile_name.txt --out outputfile --fixed BarBIQ_example_fixed_base.txt
###interpretation##
## --in: a file which contain the file names of all inputfiles, should be prepared like BarBIQ_example_inputfile_name.txt
## --out: outputfile, please set a name for your outputfile, should end with .fasta
## --fixed: a file which contain the designed fixed bases, should be prepared like the BarBIQ_example_fixed_base.txt
##########################################################################################################################################
#####Install#####
## Please install the perl model: Bio::SeqIO and Bio::Seq before use this code
##########################################################################################################################################
#####code#####
use strict;
use warnings;
use Bio::SeqIO; # for reading the fasta files please install them before run this code
use Bio::Seq;
print "Now you are runing BarBIQ_sub_barcode_fix.pl\n";
print "The parameters are: @ARGV\n";
##read command##
my ($i,$inputfile,$outputfile,$fixed_base);
for($i=0; $i<=$#ARGV; $i=$i+2)
{
if ($ARGV[$i] eq "--in") {$inputfile = $ARGV[$i+1];}
elsif ($ARGV[$i] eq "--out") {$outputfile = $ARGV[$i+1];}
elsif ($ARGV[$i] eq "--fixed") {$fixed_base = $ARGV[$i+1];}
else {die "Your input is wrong!!!\n Please input \"--in example_inputfile_name.txt --out outputfile --fixed example_fixed_base.txt\"\n $!";}
}
if(!$inputfile) {die "Your input is wrong!!!\n Please input \"--in: inputfile\"\n $!";}
if(!$outputfile) {die "Your input is wrong!!!\n Please input \"--out: outputfile\"\n $!";}
if(-e $outputfile){die "Your output file $outputfile is already existed!!! please check!!!\n $!";}
if(!$fixed_base) {die "Your input is wrong!!!\n Please input \"--fixed example_fixed_base.txt\"\n $!";}
##read command##
##check the inputfile##
open (FILE,$inputfile) or die "Could not open file '$inputfile' $!"; # open inputfile
my (@inputfiles, $gi, @Fixed_bases);
print "Your inputfiles are:\n";
while($gi=<FILE>)
{
chomp $gi;
if($gi =~ /.fasta/)
{
my $file_name="$`".".fasta";
push @inputfiles, $file_name;
print "$file_name\n";
}
}
close FILE;
open (FIXED, $fixed_base) or die "Could not open file '$fixed_base' $!"; # open fixed_base file
print "Your fixed bases are:\n";
while($gi=<FIXED>)
{
chomp $gi;print "$gi\n";
push @Fixed_bases, $gi;
}
close FIXED;
for($i=0; $i<=$#inputfiles; $i++)
{
if(!(-e $inputfiles[$i])) {die "Your input file '$inputfiles[$i]' is not existed!!! please check!!!\n $!";}
else {open (FILEFASTA,$inputfiles[$i]) or die "Could not open file '$inputfiles[$i]' $!";
chomp ($gi=<FILEFASTA>);
if($gi=~m/\A>(.*)/s)
{
$gi=<FILEFASTA>; chomp ($gi=<FILEFASTA>);
if(!($gi=~m/\A>(.*)/s)) {die "Your input file $inputfiles[$i] is not fasta format!!! please check!!!\n $!";}
}
else {die "Your input file $inputfiles[$i] is not fasta format!!! please check!!!\n $!";}
close FILEFASTA;
}
}
print "Inputfile is OK!\nStart to calculating:\n";
##check the inputfile##
##find the total reads for printing the progress##
my $reads=0;
for($i=0; $i<=$#inputfiles; $i++)
{
open (FILE,$inputfiles[$i]) or die "Could not open file '$inputfiles[$i]' $!";
$gi=<FILE>;$gi=<FILE>;
my $position_1=tell(FILE);
seek (FILE, 0, 2);
my $position_2=tell(FILE);
$reads=$reads+$position_2/$position_1;
}
$reads=$reads/10;
close FILE;
##find the total reads for printing the progress##
##check each read and delete the unmatched read to the fixed bases##
my ($display_name, $desc, $DNA);
my $No=0; # The No. of total reads
my $keep_read=0; # The No. of ketp reads
my $progress=$reads; # for printing the progress
my $p=10; # for printing the progress
open(OUTF, '>>', $outputfile) or die "Could not open file '$outputfile' $!";
for($i=0; $i<=$#inputfiles; $i++)
{
my $catchseq_seqio_obj = Bio::SeqIO -> new(-file => $inputfiles[$i], #read the fasta file
-format => 'fasta');
while(my $seq_obj = $catchseq_seqio_obj->next_seq)
{
$No++;
if($No>=$progress) { print "$p"; print"%\n"; $progress=$progress+$reads;$p=$p+10;} # print the progress
$display_name = $seq_obj->display_name; # read the display name of each read
$desc = $seq_obj->desc; # read the description of each read
$DNA= $seq_obj->seq; # read the DNA sequence of each read
&Fixed_base_check($display_name, $desc, $DNA);
}
}
close OUTF;
my $del_read=$No-$keep_read; # The No. of deleted reads
my $kep_ratio=$keep_read/$No; # The ratio of kept reads
print "The No. of deleted reads: $del_read\nThe No. of kept reads: $keep_read\nThe ratio of kept reads: $kep_ratio\n";
print "Done!!!\n";
sub Fixed_base_check # check the read's match to the fixed bases or not, and decide to keep or delete
{
my ($j, $delete);
$delete=0;
for($j=0; $j<=$#Fixed_bases; $j++)
{
if($_[2]=~ m{$Fixed_bases[$j]}) {$delete=1; last;}
}
if($delete==1)
{
print OUTF (">$_[0] $_[1]\n$_[2]\n");
$keep_read++;
}
}
##check each read and delete the unmatched read to the fixed bases##
##end##
#####Author#####
#Jianshi Frank Jin
#####Version#####
#V1.002
#2018.08.06
| 43.168831 | 169 | 0.565884 |
ed47f622e303327f3219bb3d853250e0c8c57ea7 | 7,734 | pm | Perl | modules/Bio/EnsEMBL/EGPipeline/Common/RunnableDB/FastaSplit.pm | dbolser-ebi/copy-of-eg-pipelines | ff2bd80571fd5584e1338c96f77f6489e761a44e | [
"Apache-2.0"
]
| null | null | null | modules/Bio/EnsEMBL/EGPipeline/Common/RunnableDB/FastaSplit.pm | dbolser-ebi/copy-of-eg-pipelines | ff2bd80571fd5584e1338c96f77f6489e761a44e | [
"Apache-2.0"
]
| null | null | null | modules/Bio/EnsEMBL/EGPipeline/Common/RunnableDB/FastaSplit.pm | dbolser-ebi/copy-of-eg-pipelines | ff2bd80571fd5584e1338c96f77f6489e761a44e | [
"Apache-2.0"
]
| null | null | null | =head1 LICENSE
Copyright [2009-2014] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
=cut
=head1 Bio::EnsEMBL::EGPipeline::Common::FastaSplit
=cut
package Bio::EnsEMBL::EGPipeline::Common::RunnableDB::FastaSplit;
use strict;
use warnings;
use base ('Bio::EnsEMBL::EGPipeline::Common::RunnableDB::Base');
use Bio::SeqIO;
use File::Basename qw(dirname fileparse);
use File::Path qw(make_path remove_tree);
use POSIX qw(ceil);
sub param_defaults {
my ($self) = @_;
return {
'out_dir' => undef, # Top-level directory for output
'max_seqs_per_file' => 100, # Maximum number of records in a file
'max_seq_length_per_file' => undef, # Maximum sequence length in a file
'max_files_per_directory' => 100, # Maximum number of files in a directory
'max_dirs_per_directory' => 100, # Maximum number of subdirectories
'delete_existing_files' => 1, # Ensure that directories only contains files generated with the latest execution
'unique_file_names' => 0, # Ensure that output file names are unique across all directories?
'delete_original_file' => 0, # After splitting, delete original fasta file?
'file_varname' => 'split_file',
};
}
sub fetch_input {
my ($self) = @_;
my $fasta_file = $self->param_required('fasta_file');
my $out_dir = $self->param('out_dir');
if (!-e $fasta_file) {
$self->throw("Fasta file '$fasta_file' does not exist");
}
if (!defined $out_dir) {
$out_dir = dirname($fasta_file);
$self->param('out_dir', $out_dir)
} else {
if (!-e $out_dir) {
$self->warning("Output directory '$out_dir' does not exist. I shall create it.");
make_path($out_dir) or $self->throw("Failed to create output directory '$out_dir'");
}
}
}
sub run {
my $self = shift @_;
# All these should have appropriate values, either from param_defaults
# or fetch_input. (If the user has provided anything but integers for
# the max_* parameters, the script will automatically fail when it does
# numeric comparisons with those values, so don't bother checking them.)
my $fasta_file = $self->param('fasta_file');
my $max_records = $self->param('max_seqs_per_file');
my $max_seq_length = $self->param('max_seq_length_per_file');
my $max_files = $self->param('max_files_per_directory');
my $max_dirs = $self->param('max_dirs_per_directory');
$self->param('split_files', []);
# Tracking parameters to determine when we need a new file or directory.
my $record_count = 0;
my $seq_length = 0;
my $file_count = 1;
my $dir_index = 0;
# Do nothing if there's nothing to do...
if (-s $fasta_file == 0) {
$self->input_job->autoflow(0);
return;
}
# Need to calculate required degree of subdirectory nesting.
$self->directory_structure();
$self->delete_existing_files() if $self->param('delete_existing_files');
my ($basename, undef, undef) = fileparse($fasta_file, qr/\.[^.]*/);
my $split_file = $self->new_filename($dir_index, $basename, $file_count);
my $original = Bio::SeqIO->new(-format => 'Fasta', -file => $fasta_file);
my $split = Bio::SeqIO->new(-format => 'Fasta', -file => ">$split_file");
while (my $seq = $original->next_seq) {
$record_count++;
$seq_length += $seq->length;
# Checking for record_count > 1 ensures that an empty file isn't created
# if max_records <=0 or max_seq_length < the length of the sequence.
if (
$record_count > 1 &&
( (defined($max_records) && $record_count > $max_records) ||
(defined($max_seq_length) && $seq_length > $max_seq_length)
)
) {
$record_count = 1;
$seq_length = $seq->length;
if (defined($max_files) && $file_count >= $max_files) {
$dir_index++;
$file_count = 1;
} else {
$file_count++;
}
$split_file = $self->new_filename($dir_index, $basename, $file_count);
$split = Bio::SeqIO->new(-format => 'Fasta', -file => ">$split_file");
}
my $success = $split->write_seq($seq);
$self->throw("Failed to write sequence to '$split_file'") unless $success;
}
if ($self->param('delete_original_file')) {
unlink $fasta_file;
}
}
sub write_output {
my ($self) = @_;
my $file_varname = $self->param_required('file_varname');
foreach my $split_file (@{$self->param('split_files')}) {
$self->dataflow_output_id({$file_varname => $split_file}, 2);
}
}
sub new_filename {
my ($self, $dir_index, $basename, $file_count) = @_;
my $out_dir = $self->param('out_dir');
my @dirs = @{$self->param('dirs')};
my $sub_dir = "$out_dir/".$dirs[$dir_index];
if (!-e $sub_dir) {
make_path($sub_dir) or $self->throw("Failed to create output directory '$sub_dir'");
}
my $split_file;
if ($self->param('unique_file_names')) {
$split_file = "$sub_dir/$basename.$dir_index.$file_count.fa";
} else {
$split_file = "$sub_dir/$basename.$file_count.fa";
}
my @split_files = (@{$self->param('split_files')}, $split_file);
$self->param('split_files', \@split_files);
return $split_file;
}
sub directory_structure {
my ($self) = @_;
# This function sets an arrayref paramter with directory paths;
# which is subsequently indexed in the new_filename function by the
# parameter that keeps track of how many directories have been seen.
my $max_files = $self->param('max_files_per_directory');
my $max_dirs = $self->param('max_dirs_per_directory');
my $files_required = $self->files_required();
my $dirs_required = 1;
if (defined $max_files && $max_files > 0) {
$dirs_required = ceil($files_required / $max_files);
}
if (!defined $max_dirs || $max_dirs == 0) {
$max_dirs = 1;
}
my @dirs;
if ($dirs_required < $max_dirs) {
@dirs = (1..$dirs_required);
} else {
@dirs = (1..$max_dirs);
}
while ($dirs_required > $max_dirs) {
$dirs_required = ceil($dirs_required / $max_dirs);
my @new_dirs;
foreach my $dir (@dirs) {
foreach my $sub_dir (1..$max_dirs) {
push @new_dirs, "$dir/$sub_dir";
}
}
@dirs = @new_dirs;
}
$self->param('dirs', \@dirs);
}
sub files_required {
my ($self) = @_;
my $fasta_file = $self->param('fasta_file');
my $max_records = $self->param('max_seqs_per_file');
my $max_seq_length = $self->param('max_seq_length_per_file');
my $record_count = 0;
my $seq_length = 0;
my $files_required = 1;
my $original = Bio::SeqIO->new(-format => 'Fasta', -file => $fasta_file);
while (my $seq = $original->next_seq) {
$record_count++;
$seq_length += $seq->length;
if (
$record_count > 1 &&
( (defined($max_records) && $record_count > $max_records) ||
(defined($max_seq_length) && $seq_length > $max_seq_length)
)
) {
$record_count = 1;
$seq_length = $seq->length;
$files_required++;
}
}
return $files_required;
}
sub delete_existing_files {
my ($self) = @_;
my $out_dir = $self->param('out_dir');
foreach my $dir (@{$self->param('dirs')}) {
remove_tree("$out_dir/$dir", {keep_root => 1});
}
}
1;
| 29.632184 | 122 | 0.64016 |
ed59f106380c1df0584ec94b4182595a6214f32c | 492 | al | Perl | results/alignments/Bo6g108600_exon8.al | naturalis/brassica-genes | e060d0938407566b6a7d0f30d61a61eea0c37f1c | [
"MIT"
]
| null | null | null | results/alignments/Bo6g108600_exon8.al | naturalis/brassica-genes | e060d0938407566b6a7d0f30d61a61eea0c37f1c | [
"MIT"
]
| null | null | null | results/alignments/Bo6g108600_exon8.al | naturalis/brassica-genes | e060d0938407566b6a7d0f30d61a61eea0c37f1c | [
"MIT"
]
| null | null | null | >geneid:Bo6g108600;contig:C6;feature:exon8;seqstart:33887173;seqstop:33887357
ATGGGGAGGGGTAGGGTTCAACTGAAGAGGATAGAGAACAAGATCAATAGACAAGTGACA
TTCTCCAAAAGAAGAGCTGGTCTTTTCAAGAAAGCTCATGAGATCTCTGTTCTCTGTGAT
GCTGAAGTTGCCCTTGTTGTCTTCTCCCATAAGGGGAAACTCTTTGAGTACTCCACTGAT
TCTTG
>seqstart:30119100;seqstop30119284+
ATGGGAAGGGGTAGGGTTCAGTTGAAGAGGATAGAAAACAAGATCAATAGACAAGTGACA
TTCTCGAAAAGAAGAGCTGGTCTTATGAAGAAAGCTCATGAGATCTCTGTTCTGTGTGAT
GCTGAAGTTGCGCTTGTTGTCTTCTCCCATAAGGGGAAACTCTTTGAATACTCCACTGAT
TCTTG
| 44.727273 | 77 | 0.95122 |
ed38d0a642502526ae7b0fe24530caf5a6a94aa2 | 616 | pl | Perl | egs/ksponspeech/asr1/local/remove_punctuation.pl | qianlanwyd/espnet | c5dca0e6e37446947a3545c1e3a8d7c52635701b | [
"Apache-2.0"
]
| 1 | 2019-05-17T03:52:46.000Z | 2019-05-17T03:52:46.000Z | egs/ksponspeech/asr1/local/remove_punctuation.pl | qianlanwyd/espnet | c5dca0e6e37446947a3545c1e3a8d7c52635701b | [
"Apache-2.0"
]
| 2 | 2020-10-26T15:22:48.000Z | 2021-01-15T10:17:57.000Z | egs/ksponspeech/asr1/local/remove_punctuation.pl | qianlanwyd/espnet | c5dca0e6e37446947a3545c1e3a8d7c52635701b | [
"Apache-2.0"
]
| 1 | 2021-10-30T11:42:29.000Z | 2021-10-30T11:42:29.000Z | #!/usr/bin/perl
use warnings;
use strict;
binmode(STDIN,":utf8");
binmode(STDOUT,":utf8");
while(<STDIN>) {
$_ = " $_ ";
# remove punctuation except apostrophe
s/<space>/spacemark/g; # for scoring
s/<unk>/unknown1/g;
s/[unk]/unknown2/g;
s/\+/repeatsym/g;
s/\//fillersym/g;
s/'/apostrophe/g;
s/[[:punct:]]//g;
s/apostrophe/'/g;
s/spacemark/<space>/g; # for scoring
s/fillersym/\//g;
s/repeatsym/\+/g;
s/unknown2/[unk]/g;
s/unknown1/<unk>/g;
# remove consecutive commas and spaces
s/\s+/ /g;
# remove whitespace again
s/\s+/ /g;
s/^\s+//;
s/\s+$//;
print "$_\n";
}
| 16.648649 | 40 | 0.579545 |
ed53928f5906bae2909914f233a891acb563a9d7 | 1,887 | pl | Perl | Task/Sierpinski-triangle-Graphical/Perl/sierpinski-triangle-graphical.pl | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
]
| 1 | 2021-05-05T13:42:20.000Z | 2021-05-05T13:42:20.000Z | Task/Sierpinski-triangle-Graphical/Perl/sierpinski-triangle-graphical.pl | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
]
| null | null | null | Task/Sierpinski-triangle-Graphical/Perl/sierpinski-triangle-graphical.pl | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
]
| null | null | null | my $levels = 6;
my $side = 512;
my $height = get_height($side);
sub get_height { my($side) = @_; $side * sqrt(3) / 2 }
sub triangle {
my($x1, $y1, $x2, $y2, $x3, $y3, $fill, $animate) = @_;
my $svg;
$svg .= qq{<polygon points="$x1,$y1 $x2,$y2 $x3,$y3"};
$svg .= qq{ style="fill: $fill; stroke-width: 0;"} if $fill;
$svg .= $animate
? qq{>\n <animate attributeType="CSS" attributeName="opacity"\n values="1;0;1" keyTimes="0;.5;1" dur="20s" repeatCount="indefinite" />\n</polygon>\n}
: ' />';
return $svg;
}
sub fractal {
my( $x1, $y1, $x2, $y2, $x3, $y3, $r ) = @_;
my $svg;
$svg .= triangle( $x1, $y1, $x2, $y2, $x3, $y3 );
return $svg unless --$r;
my $side = abs($x3 - $x2) / 2;
my $height = get_height($side);
$svg .= fractal( $x1, $y1-$height*2, $x1-$side/2, $y1-3*$height, $x1+$side/2, $y1-3*$height, $r);
$svg .= fractal( $x2, $y1, $x2-$side/2, $y1-$height, $x2+$side/2, $y1-$height, $r);
$svg .= fractal( $x3, $y1, $x3-$side/2, $y1-$height, $x3+$side/2, $y1-$height, $r);
}
open my $fh, '>', 'run/sierpinski_triangle.svg';
print $fh <<'EOD',
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">
<defs>
<radialGradient id="basegradient" cx="50%" cy="65%" r="50%" fx="50%" fy="65%">
<stop offset="10%" stop-color="#ff0" />
<stop offset="60%" stop-color="#f00" />
<stop offset="99%" stop-color="#00f" />
</radialGradient>
</defs>
EOD
triangle( $side/2, 0, 0, $height, $side, $height, 'url(#basegradient)' ),
triangle( $side/2, 0, 0, $height, $side, $height, '#000', 'animate' ),
'<g style="fill: #fff; stroke-width: 0;">',
fractal( $side/2, $height, $side*3/4, $height/2, $side/4, $height/2, $levels ),
'</g></svg>';
| 38.510204 | 159 | 0.553259 |
ed3c517a85a5cfc6be5a57e30ecc00448afed09d | 2,529 | pl | Perl | check_hadoop_yarn_node_manager.pl | adolci/nagios-plugins | 0d8cee0376467922b3315e9b0e08b98454eb9853 | [
"IBM-pibs",
"Apache-1.1"
]
| null | null | null | check_hadoop_yarn_node_manager.pl | adolci/nagios-plugins | 0d8cee0376467922b3315e9b0e08b98454eb9853 | [
"IBM-pibs",
"Apache-1.1"
]
| null | null | null | check_hadoop_yarn_node_manager.pl | adolci/nagios-plugins | 0d8cee0376467922b3315e9b0e08b98454eb9853 | [
"IBM-pibs",
"Apache-1.1"
]
| 3 | 2019-07-25T11:46:32.000Z | 2019-12-17T05:01:03.000Z | #!/usr/bin/perl -T
# nagios: -epn
#
# Author: Hari Sekhon
# Date: 2014-03-05 21:45:08 +0000 (Wed, 05 Mar 2014)
#
# https://github.com/harisekhon/nagios-plugins
#
# License: see accompanying LICENSE file
#
$DESCRIPTION = "Nagios Plugin to check the state of a given Hadoop Yarn Node Manager via the Node Manager's REST API
Checks the given Node Manager 'nodeHealthy' field is true and reports the healthReport status.
Thresholds apply to lag time in seconds for last node report.
See also:
- check_hadoop_yarn_node_manager_via_rm.pl (from Resource Manager's perspective, has more info and can also list node managers)
- check_hadoop_yarn_node_managers.pl (aggregate view of the number of healthy / unhealthy Node Managers)
Tested on Hortonworks HDP 2.1 (Hadoop 2.4.0) and Apache Hadoop 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8";
$VERSION = "0.1";
use strict;
use warnings;
BEGIN {
use File::Basename;
use lib dirname(__FILE__) . "/lib";
}
use HariSekhonUtils;
use Data::Dumper;
use JSON::XS;
use LWP::Simple '$ua';
$ua->agent("Hari Sekhon $progname version $main::VERSION");
set_port_default(8042);
set_threshold_defaults(150, 300);
env_creds(["HADOOP_YARN_NODE_MANAGER", "HADOOP"], "Yarn Node Manager");
%options = (
%hostoptions,
%thresholdoptions,
);
get_options();
$host = validate_host($host);
$port = validate_port($port);
validate_thresholds(0, 0, { "simple" => "upper", "positive" => 1, "integer" => 1 });
vlog2;
set_timeout();
$status = "OK";
my $url = "http://$host:$port/ws/v1/node/info";
my $content = curl $url;
try{
$json = decode_json $content;
};
catch{
quit "invalid json returned by Yarn Resource Manager at '$url'";
};
vlog3(Dumper($json));
my $nodeHealthy = get_field("nodeInfo.nodeHealthy");
my $healthReport = get_field("nodeInfo.healthReport");
my $lastNodeUpdateTime = get_field_float("nodeInfo.lastNodeUpdateTime");
my $node_version = get_field("nodeInfo.nodeManagerVersion");
my $lag = sprintf("%d", time - $lastNodeUpdateTime/1000.0);
# For some reason the content of this is blank when API docs say it should be 'Healthy', but my nodes work so this isn't critical
$healthReport = "<blank>" unless $healthReport;
$msg = sprintf("node $host healthy = %s, healthReport = '%s', %d secs since last node report", ( $nodeHealthy ? "true" : "false"), $healthReport, $lag);
check_thresholds($lag);
$msg .= ", version $node_version" if $verbose;
$msg .= sprintf(" | 'last node update lag'=%ds%s", $lag, msg_perf_thresholds(1));
quit $status, $msg;
| 28.41573 | 152 | 0.702254 |
ed2af5748cfae995d4d24cd0085643ff1b72e315 | 3,088 | pl | Perl | author/mktbl.pl | tokuhirom/HTML-Pictogram-MobileJp | 32ba0de1778691fe0fcf53dcae23ea01afd959b0 | [
"Artistic-1.0"
]
| 1 | 2015-11-09T01:28:34.000Z | 2015-11-09T01:28:34.000Z | author/mktbl.pl | tokuhirom/HTML-Pictogram-MobileJp | 32ba0de1778691fe0fcf53dcae23ea01afd959b0 | [
"Artistic-1.0"
]
| null | null | null | author/mktbl.pl | tokuhirom/HTML-Pictogram-MobileJp | 32ba0de1778691fe0fcf53dcae23ea01afd959b0 | [
"Artistic-1.0"
]
| null | null | null | use strict;
use warnings;
use autodie;
use JSON;
use Data::Dumper;
use LWP::Simple;
use File::Basename;
use File::Spec;
my $c_docomo = slurp_json('http://svn.openpear.org/Text_Pictogram_Mobile/trunk/data/docomo_convert.json')->{docomo};
my $e_docomo = slurp_json('http://svn.openpear.org/Text_Pictogram_Mobile/trunk/data/docomo_emoji.json')->{docomo};
my $e_softbank = slurp_json('http://svn.openpear.org/Text_Pictogram_Mobile/trunk/data/softbank_emoji.json')->{softbank};
&main;exit;
sub main {
make_unicode_number_map();
make_emoji_number_map();
exit;
}
sub make_unicode_number_map {
my $ezweb; # "docomo unicode" to "ez emoji number"
my $softbank; # "docomo unicode" to "softbank unicode"
while (my ($docomo_id, $val) = each %$c_docomo) {
if ($val->{ezweb} =~ /^\d+$/) {
$ezweb->{$e_docomo->{$docomo_id}->{unicode}} = $val->{ezweb};
}
if ($val->{softbank} =~ /^\d+$/) {
$softbank->{$e_docomo->{$docomo_id}->{unicode}} = $e_softbank->{$val->{softbank}}->{unicode};
}
}
my $ofname = File::Spec->catfile(dirname(__FILE__), '..', "lib/HTML/Pictogram/MobileJp/Unicode/Map.pm");
open my $fh, ">:utf8", $ofname;
select $fh;
local $Data::Dumper::Sortkeys = 1;
local $Data::Dumper::Terse = 1;
print "package HTML::Pictogram::MobileJp::Unicode::Map;\n";
print "use strict;\n";
print "use warnings;\n";
print "# This file was generated automatically.\n";
print "use base qw/Exporter/;\n";
print "our \@EXPORT = qw/\$EZWEB \$SOFTBANK/;\n";
print "our \$EZWEB = ";
print Dumper($ezweb);
print ";\n";
print "our \$SOFTBANK = ";
print Dumper($softbank);
print ";\n";
print "1;\n";
close $fh;
}
sub make_emoji_number_map {
my $docomo;
my $ezweb;
my $softbank;
while (my ($docomo_id, $val) = each %$c_docomo) {
$ezweb->{$docomo_id} = $val->{ezweb};
$docomo->{$docomo_id} = $e_docomo->{$docomo_id}->{unicode};
if ($val->{softbank} =~ /^\d+$/) {
$softbank->{$docomo_id} = $e_softbank->{$val->{softbank}}->{unicode};
} else {
$softbank->{$docomo_id} = $val->{softbank};
}
}
my $ofname = File::Spec->catfile(dirname(__FILE__), '..', "lib/HTML/Pictogram/MobileJp/EmojiNumber/Map.pm");
open my $fh, ">:utf8", $ofname;
select $fh;
local $Data::Dumper::Sortkeys = 1;
local $Data::Dumper::Terse = 1;
print "package HTML::Pictogram::MobileJp::EmojiNumber::Map;\n";
print "use strict;\n";
print "use warnings;\n";
print "# This file was generated automatically.\n";
print "use base qw/Exporter/;\n";
print "our \@EXPORT = qw/\$DOCOMO \$EZWEB \$SOFTBANK/;\n";
print "our \$DOCOMO = ";
print Dumper($docomo);
print ";\n\n";
print "our \$EZWEB = ";
print Dumper($ezweb);
print ";\n";
print "our \$SOFTBANK = ";
print Dumper($softbank);
print ";\n";
print "1;\n";
close $fh;
}
sub slurp_json {
my $content = get($_[0]) // die;
decode_json($content);
}
| 30.574257 | 120 | 0.589702 |
ed5d4024b28964c41659c8e8e5559f6d8e60ac25 | 16,328 | pm | Perl | perl/vendor/lib/DateTime/TimeZone/America/Argentina/Mendoza.pm | ifleeyo180/VspriteMoodleWebsite | 38baa924829c83808d2c87d44740ff365927a646 | [
"Apache-2.0"
]
| 2 | 2021-11-19T22:37:28.000Z | 2021-11-22T18:04:55.000Z | perl/vendor/lib/DateTime/TimeZone/America/Argentina/Mendoza.pm | ifleeyo180/VspriteMoodleWebsite | 38baa924829c83808d2c87d44740ff365927a646 | [
"Apache-2.0"
]
| 6 | 2021-11-18T00:39:48.000Z | 2021-11-20T00:31:40.000Z | perl/vendor/lib/DateTime/TimeZone/America/Argentina/Mendoza.pm | ifleeyo180/VspriteMoodleWebsite | 38baa924829c83808d2c87d44740ff365927a646 | [
"Apache-2.0"
]
| null | null | null | # This file is auto-generated by the Perl DateTime Suite time zone
# code generator (0.08) This code generator comes with the
# DateTime::TimeZone module distribution in the tools/ directory
#
# Generated from /tmp/h6QqPsv6Ap/southamerica. Olson data version 2020e
#
# Do not edit this file directly.
#
package DateTime::TimeZone::America::Argentina::Mendoza;
use strict;
use warnings;
use namespace::autoclean;
our $VERSION = '2.46';
use Class::Singleton 1.03;
use DateTime::TimeZone;
use DateTime::TimeZone::OlsonDB;
@DateTime::TimeZone::America::Argentina::Mendoza::ISA = ( 'Class::Singleton', 'DateTime::TimeZone' );
my $spans =
[
[
DateTime::TimeZone::NEG_INFINITY, # utc_start
59763587716, # utc_end 1894-10-31 04:35:16 (Wed)
DateTime::TimeZone::NEG_INFINITY, # local_start
59763571200, # local_end 1894-10-31 00:00:00 (Wed)
-16516,
0,
'LMT',
],
[
59763587716, # utc_start 1894-10-31 04:35:16 (Wed)
60568229808, # utc_end 1920-05-01 04:16:48 (Sat)
59763572308, # local_start 1894-10-31 00:18:28 (Wed)
60568214400, # local_end 1920-05-01 00:00:00 (Sat)
-15408,
0,
'CMT',
],
[
60568229808, # utc_start 1920-05-01 04:16:48 (Sat)
60902251200, # utc_end 1930-12-01 04:00:00 (Mon)
60568215408, # local_start 1920-05-01 00:16:48 (Sat)
60902236800, # local_end 1930-12-01 00:00:00 (Mon)
-14400,
0,
'-04',
],
[
60902251200, # utc_start 1930-12-01 04:00:00 (Mon)
60912702000, # utc_end 1931-04-01 03:00:00 (Wed)
60902240400, # local_start 1930-12-01 01:00:00 (Mon)
60912691200, # local_end 1931-04-01 00:00:00 (Wed)
-10800,
1,
'-03',
],
[
60912702000, # utc_start 1931-04-01 03:00:00 (Wed)
60929726400, # utc_end 1931-10-15 04:00:00 (Thu)
60912687600, # local_start 1931-03-31 23:00:00 (Tue)
60929712000, # local_end 1931-10-15 00:00:00 (Thu)
-14400,
0,
'-04',
],
[
60929726400, # utc_start 1931-10-15 04:00:00 (Thu)
60941646000, # utc_end 1932-03-01 03:00:00 (Tue)
60929715600, # local_start 1931-10-15 01:00:00 (Thu)
60941635200, # local_end 1932-03-01 00:00:00 (Tue)
-10800,
1,
'-03',
],
[
60941646000, # utc_start 1932-03-01 03:00:00 (Tue)
60962817600, # utc_end 1932-11-01 04:00:00 (Tue)
60941631600, # local_start 1932-02-29 23:00:00 (Mon)
60962803200, # local_end 1932-11-01 00:00:00 (Tue)
-14400,
0,
'-04',
],
[
60962817600, # utc_start 1932-11-01 04:00:00 (Tue)
60973182000, # utc_end 1933-03-01 03:00:00 (Wed)
60962806800, # local_start 1932-11-01 01:00:00 (Tue)
60973171200, # local_end 1933-03-01 00:00:00 (Wed)
-10800,
1,
'-03',
],
[
60973182000, # utc_start 1933-03-01 03:00:00 (Wed)
60994353600, # utc_end 1933-11-01 04:00:00 (Wed)
60973167600, # local_start 1933-02-28 23:00:00 (Tue)
60994339200, # local_end 1933-11-01 00:00:00 (Wed)
-14400,
0,
'-04',
],
[
60994353600, # utc_start 1933-11-01 04:00:00 (Wed)
61004718000, # utc_end 1934-03-01 03:00:00 (Thu)
60994342800, # local_start 1933-11-01 01:00:00 (Wed)
61004707200, # local_end 1934-03-01 00:00:00 (Thu)
-10800,
1,
'-03',
],
[
61004718000, # utc_start 1934-03-01 03:00:00 (Thu)
61025889600, # utc_end 1934-11-01 04:00:00 (Thu)
61004703600, # local_start 1934-02-28 23:00:00 (Wed)
61025875200, # local_end 1934-11-01 00:00:00 (Thu)
-14400,
0,
'-04',
],
[
61025889600, # utc_start 1934-11-01 04:00:00 (Thu)
61036254000, # utc_end 1935-03-01 03:00:00 (Fri)
61025878800, # local_start 1934-11-01 01:00:00 (Thu)
61036243200, # local_end 1935-03-01 00:00:00 (Fri)
-10800,
1,
'-03',
],
[
61036254000, # utc_start 1935-03-01 03:00:00 (Fri)
61057425600, # utc_end 1935-11-01 04:00:00 (Fri)
61036239600, # local_start 1935-02-28 23:00:00 (Thu)
61057411200, # local_end 1935-11-01 00:00:00 (Fri)
-14400,
0,
'-04',
],
[
61057425600, # utc_start 1935-11-01 04:00:00 (Fri)
61067876400, # utc_end 1936-03-01 03:00:00 (Sun)
61057414800, # local_start 1935-11-01 01:00:00 (Fri)
61067865600, # local_end 1936-03-01 00:00:00 (Sun)
-10800,
1,
'-03',
],
[
61067876400, # utc_start 1936-03-01 03:00:00 (Sun)
61089048000, # utc_end 1936-11-01 04:00:00 (Sun)
61067862000, # local_start 1936-02-29 23:00:00 (Sat)
61089033600, # local_end 1936-11-01 00:00:00 (Sun)
-14400,
0,
'-04',
],
[
61089048000, # utc_start 1936-11-01 04:00:00 (Sun)
61099412400, # utc_end 1937-03-01 03:00:00 (Mon)
61089037200, # local_start 1936-11-01 01:00:00 (Sun)
61099401600, # local_end 1937-03-01 00:00:00 (Mon)
-10800,
1,
'-03',
],
[
61099412400, # utc_start 1937-03-01 03:00:00 (Mon)
61120584000, # utc_end 1937-11-01 04:00:00 (Mon)
61099398000, # local_start 1937-02-28 23:00:00 (Sun)
61120569600, # local_end 1937-11-01 00:00:00 (Mon)
-14400,
0,
'-04',
],
[
61120584000, # utc_start 1937-11-01 04:00:00 (Mon)
61130948400, # utc_end 1938-03-01 03:00:00 (Tue)
61120573200, # local_start 1937-11-01 01:00:00 (Mon)
61130937600, # local_end 1938-03-01 00:00:00 (Tue)
-10800,
1,
'-03',
],
[
61130948400, # utc_start 1938-03-01 03:00:00 (Tue)
61152120000, # utc_end 1938-11-01 04:00:00 (Tue)
61130934000, # local_start 1938-02-28 23:00:00 (Mon)
61152105600, # local_end 1938-11-01 00:00:00 (Tue)
-14400,
0,
'-04',
],
[
61152120000, # utc_start 1938-11-01 04:00:00 (Tue)
61162484400, # utc_end 1939-03-01 03:00:00 (Wed)
61152109200, # local_start 1938-11-01 01:00:00 (Tue)
61162473600, # local_end 1939-03-01 00:00:00 (Wed)
-10800,
1,
'-03',
],
[
61162484400, # utc_start 1939-03-01 03:00:00 (Wed)
61183656000, # utc_end 1939-11-01 04:00:00 (Wed)
61162470000, # local_start 1939-02-28 23:00:00 (Tue)
61183641600, # local_end 1939-11-01 00:00:00 (Wed)
-14400,
0,
'-04',
],
[
61183656000, # utc_start 1939-11-01 04:00:00 (Wed)
61194106800, # utc_end 1940-03-01 03:00:00 (Fri)
61183645200, # local_start 1939-11-01 01:00:00 (Wed)
61194096000, # local_end 1940-03-01 00:00:00 (Fri)
-10800,
1,
'-03',
],
[
61194106800, # utc_start 1940-03-01 03:00:00 (Fri)
61204651200, # utc_end 1940-07-01 04:00:00 (Mon)
61194092400, # local_start 1940-02-29 23:00:00 (Thu)
61204636800, # local_end 1940-07-01 00:00:00 (Mon)
-14400,
0,
'-04',
],
[
61204651200, # utc_start 1940-07-01 04:00:00 (Mon)
61234801200, # utc_end 1941-06-15 03:00:00 (Sun)
61204640400, # local_start 1940-07-01 01:00:00 (Mon)
61234790400, # local_end 1941-06-15 00:00:00 (Sun)
-10800,
1,
'-03',
],
[
61234801200, # utc_start 1941-06-15 03:00:00 (Sun)
61245345600, # utc_end 1941-10-15 04:00:00 (Wed)
61234786800, # local_start 1941-06-14 23:00:00 (Sat)
61245331200, # local_end 1941-10-15 00:00:00 (Wed)
-14400,
0,
'-04',
],
[
61245345600, # utc_start 1941-10-15 04:00:00 (Wed)
61301934000, # utc_end 1943-08-01 03:00:00 (Sun)
61245334800, # local_start 1941-10-15 01:00:00 (Wed)
61301923200, # local_end 1943-08-01 00:00:00 (Sun)
-10800,
1,
'-03',
],
[
61301934000, # utc_start 1943-08-01 03:00:00 (Sun)
61308417600, # utc_end 1943-10-15 04:00:00 (Fri)
61301919600, # local_start 1943-07-31 23:00:00 (Sat)
61308403200, # local_end 1943-10-15 00:00:00 (Fri)
-14400,
0,
'-04',
],
[
61308417600, # utc_start 1943-10-15 04:00:00 (Fri)
61383409200, # utc_end 1946-03-01 03:00:00 (Fri)
61308406800, # local_start 1943-10-15 01:00:00 (Fri)
61383398400, # local_end 1946-03-01 00:00:00 (Fri)
-10800,
1,
'-03',
],
[
61383409200, # utc_start 1946-03-01 03:00:00 (Fri)
61401902400, # utc_end 1946-10-01 04:00:00 (Tue)
61383394800, # local_start 1946-02-28 23:00:00 (Thu)
61401888000, # local_end 1946-10-01 00:00:00 (Tue)
-14400,
0,
'-04',
],
[
61401902400, # utc_start 1946-10-01 04:00:00 (Tue)
61938356400, # utc_end 1963-10-01 03:00:00 (Tue)
61401891600, # local_start 1946-10-01 01:00:00 (Tue)
61938345600, # local_end 1963-10-01 00:00:00 (Tue)
-10800,
1,
'-03',
],
[
61938356400, # utc_start 1963-10-01 03:00:00 (Tue)
61944840000, # utc_end 1963-12-15 04:00:00 (Sun)
61938342000, # local_start 1963-09-30 23:00:00 (Mon)
61944825600, # local_end 1963-12-15 00:00:00 (Sun)
-14400,
0,
'-04',
],
[
61944840000, # utc_start 1963-12-15 04:00:00 (Sun)
61951489200, # utc_end 1964-03-01 03:00:00 (Sun)
61944829200, # local_start 1963-12-15 01:00:00 (Sun)
61951478400, # local_end 1964-03-01 00:00:00 (Sun)
-10800,
1,
'-03',
],
[
61951489200, # utc_start 1964-03-01 03:00:00 (Sun)
61971192000, # utc_end 1964-10-15 04:00:00 (Thu)
61951474800, # local_start 1964-02-29 23:00:00 (Sat)
61971177600, # local_end 1964-10-15 00:00:00 (Thu)
-14400,
0,
'-04',
],
[
61971192000, # utc_start 1964-10-15 04:00:00 (Thu)
61983025200, # utc_end 1965-03-01 03:00:00 (Mon)
61971181200, # local_start 1964-10-15 01:00:00 (Thu)
61983014400, # local_end 1965-03-01 00:00:00 (Mon)
-10800,
1,
'-03',
],
[
61983025200, # utc_start 1965-03-01 03:00:00 (Mon)
62002728000, # utc_end 1965-10-15 04:00:00 (Fri)
61983010800, # local_start 1965-02-28 23:00:00 (Sun)
62002713600, # local_end 1965-10-15 00:00:00 (Fri)
-14400,
0,
'-04',
],
[
62002728000, # utc_start 1965-10-15 04:00:00 (Fri)
62014561200, # utc_end 1966-03-01 03:00:00 (Tue)
62002717200, # local_start 1965-10-15 01:00:00 (Fri)
62014550400, # local_end 1966-03-01 00:00:00 (Tue)
-10800,
1,
'-03',
],
[
62014561200, # utc_start 1966-03-01 03:00:00 (Tue)
62034264000, # utc_end 1966-10-15 04:00:00 (Sat)
62014546800, # local_start 1966-02-28 23:00:00 (Mon)
62034249600, # local_end 1966-10-15 00:00:00 (Sat)
-14400,
0,
'-04',
],
[
62034264000, # utc_start 1966-10-15 04:00:00 (Sat)
62048862000, # utc_end 1967-04-02 03:00:00 (Sun)
62034253200, # local_start 1966-10-15 01:00:00 (Sat)
62048851200, # local_end 1967-04-02 00:00:00 (Sun)
-10800,
1,
'-03',
],
[
62048862000, # utc_start 1967-04-02 03:00:00 (Sun)
62064590400, # utc_end 1967-10-01 04:00:00 (Sun)
62048847600, # local_start 1967-04-01 23:00:00 (Sat)
62064576000, # local_end 1967-10-01 00:00:00 (Sun)
-14400,
0,
'-04',
],
[
62064590400, # utc_start 1967-10-01 04:00:00 (Sun)
62080916400, # utc_end 1968-04-07 03:00:00 (Sun)
62064579600, # local_start 1967-10-01 01:00:00 (Sun)
62080905600, # local_end 1968-04-07 00:00:00 (Sun)
-10800,
1,
'-03',
],
[
62080916400, # utc_start 1968-04-07 03:00:00 (Sun)
62096644800, # utc_end 1968-10-06 04:00:00 (Sun)
62080902000, # local_start 1968-04-06 23:00:00 (Sat)
62096630400, # local_end 1968-10-06 00:00:00 (Sun)
-14400,
0,
'-04',
],
[
62096644800, # utc_start 1968-10-06 04:00:00 (Sun)
62112366000, # utc_end 1969-04-06 03:00:00 (Sun)
62096634000, # local_start 1968-10-06 01:00:00 (Sun)
62112355200, # local_end 1969-04-06 00:00:00 (Sun)
-10800,
1,
'-03',
],
[
62112366000, # utc_start 1969-04-06 03:00:00 (Sun)
62128094400, # utc_end 1969-10-05 04:00:00 (Sun)
62112351600, # local_start 1969-04-05 23:00:00 (Sat)
62128080000, # local_end 1969-10-05 00:00:00 (Sun)
-14400,
0,
'-04',
],
[
62128094400, # utc_start 1969-10-05 04:00:00 (Sun)
62263825200, # utc_end 1974-01-23 03:00:00 (Wed)
62128083600, # local_start 1969-10-05 01:00:00 (Sun)
62263814400, # local_end 1974-01-23 00:00:00 (Wed)
-10800,
0,
'-03',
],
[
62263825200, # utc_start 1974-01-23 03:00:00 (Wed)
62272288800, # utc_end 1974-05-01 02:00:00 (Wed)
62263818000, # local_start 1974-01-23 01:00:00 (Wed)
62272281600, # local_end 1974-05-01 00:00:00 (Wed)
-7200,
1,
'-02',
],
[
62272288800, # utc_start 1974-05-01 02:00:00 (Wed)
62732631600, # utc_end 1988-12-01 03:00:00 (Thu)
62272278000, # local_start 1974-04-30 23:00:00 (Tue)
62732620800, # local_end 1988-12-01 00:00:00 (Thu)
-10800,
0,
'-03',
],
[
62732631600, # utc_start 1988-12-01 03:00:00 (Thu)
62740749600, # utc_end 1989-03-05 02:00:00 (Sun)
62732624400, # local_start 1988-12-01 01:00:00 (Thu)
62740742400, # local_end 1989-03-05 00:00:00 (Sun)
-7200,
1,
'-02',
],
[
62740749600, # utc_start 1989-03-05 02:00:00 (Sun)
62760106800, # utc_end 1989-10-15 03:00:00 (Sun)
62740738800, # local_start 1989-03-04 23:00:00 (Sat)
62760096000, # local_end 1989-10-15 00:00:00 (Sun)
-10800,
0,
'-03',
],
[
62760106800, # utc_start 1989-10-15 03:00:00 (Sun)
62772199200, # utc_end 1990-03-04 02:00:00 (Sun)
62760099600, # local_start 1989-10-15 01:00:00 (Sun)
62772192000, # local_end 1990-03-04 00:00:00 (Sun)
-7200,
1,
'-02',
],
[
62772199200, # utc_start 1990-03-04 02:00:00 (Sun)
62791646400, # utc_end 1990-10-15 04:00:00 (Mon)
62772184800, # local_start 1990-03-03 22:00:00 (Sat)
62791632000, # local_end 1990-10-15 00:00:00 (Mon)
-14400,
0,
'-04',
],
[
62791646400, # utc_start 1990-10-15 04:00:00 (Mon)
62803479600, # utc_end 1991-03-01 03:00:00 (Fri)
62791635600, # local_start 1990-10-15 01:00:00 (Mon)
62803468800, # local_end 1991-03-01 00:00:00 (Fri)
-10800,
1,
'-03',
],
[
62803479600, # utc_start 1991-03-01 03:00:00 (Fri)
62823182400, # utc_end 1991-10-15 04:00:00 (Tue)
62803465200, # local_start 1991-02-28 23:00:00 (Thu)
62823168000, # local_end 1991-10-15 00:00:00 (Tue)
-14400,
0,
'-04',
],
[
62823182400, # utc_start 1991-10-15 04:00:00 (Tue)
62835102000, # utc_end 1992-03-01 03:00:00 (Sun)
62823171600, # local_start 1991-10-15 01:00:00 (Tue)
62835091200, # local_end 1992-03-01 00:00:00 (Sun)
-10800,
1,
'-03',
],
[
62835102000, # utc_start 1992-03-01 03:00:00 (Sun)
62855064000, # utc_end 1992-10-18 04:00:00 (Sun)
62835087600, # local_start 1992-02-29 23:00:00 (Sat)
62855049600, # local_end 1992-10-18 00:00:00 (Sun)
-14400,
0,
'-04',
],
[
62855064000, # utc_start 1992-10-18 04:00:00 (Sun)
62867152800, # utc_end 1993-03-07 02:00:00 (Sun)
62855056800, # local_start 1992-10-18 02:00:00 (Sun)
62867145600, # local_end 1993-03-07 00:00:00 (Sun)
-7200,
1,
'-02',
],
[
62867152800, # utc_start 1993-03-07 02:00:00 (Sun)
63074602800, # utc_end 1999-10-03 03:00:00 (Sun)
62867142000, # local_start 1993-03-06 23:00:00 (Sat)
63074592000, # local_end 1999-10-03 00:00:00 (Sun)
-10800,
0,
'-03',
],
[
63074602800, # utc_start 1999-10-03 03:00:00 (Sun)
63087735600, # utc_end 2000-03-03 03:00:00 (Fri)
63074592000, # local_start 1999-10-03 00:00:00 (Sun)
63087724800, # local_end 2000-03-03 00:00:00 (Fri)
-10800,
1,
'-03',
],
[
63087735600, # utc_start 2000-03-03 03:00:00 (Fri)
63220964400, # utc_end 2004-05-23 03:00:00 (Sun)
63087724800, # local_start 2000-03-03 00:00:00 (Fri)
63220953600, # local_end 2004-05-23 00:00:00 (Sun)
-10800,
0,
'-03',
],
[
63220964400, # utc_start 2004-05-23 03:00:00 (Sun)
63231854400, # utc_end 2004-09-26 04:00:00 (Sun)
63220950000, # local_start 2004-05-22 23:00:00 (Sat)
63231840000, # local_end 2004-09-26 00:00:00 (Sun)
-14400,
0,
'-04',
],
[
63231854400, # utc_start 2004-09-26 04:00:00 (Sun)
63334666800, # utc_end 2007-12-30 03:00:00 (Sun)
63231843600, # local_start 2004-09-26 01:00:00 (Sun)
63334656000, # local_end 2007-12-30 00:00:00 (Sun)
-10800,
0,
'-03',
],
[
63334666800, # utc_start 2007-12-30 03:00:00 (Sun)
63341316000, # utc_end 2008-03-16 02:00:00 (Sun)
63334659600, # local_start 2007-12-30 01:00:00 (Sun)
63341308800, # local_end 2008-03-16 00:00:00 (Sun)
-7200,
1,
'-02',
],
[
63341316000, # utc_start 2008-03-16 02:00:00 (Sun)
63359982000, # utc_end 2008-10-18 03:00:00 (Sat)
63341305200, # local_start 2008-03-15 23:00:00 (Sat)
63359971200, # local_end 2008-10-18 00:00:00 (Sat)
-10800,
0,
'-03',
],
[
63359982000, # utc_start 2008-10-18 03:00:00 (Sat)
DateTime::TimeZone::INFINITY, # utc_end
63359971200, # local_start 2008-10-18 00:00:00 (Sat)
DateTime::TimeZone::INFINITY, # local_end
-10800,
0,
'-03',
],
];
sub olson_version {'2020e'}
sub has_dst_changes {28}
sub _max_year {2030}
sub _new_instance {
return shift->_init( @_, spans => $spans );
}
1;
| 26.811166 | 101 | 0.636759 |
73ef1b2bc5d360b9904d0fccd7f281353cd487ad | 16,952 | pl | Perl | pimpla_table_merge/pimpla_table_merge.pl | greatfireball/ime_helper_scripts | 4c32673c479d9e9f7b34661dc21faa1bf9c7f70f | [
"MIT"
]
| null | null | null | pimpla_table_merge/pimpla_table_merge.pl | greatfireball/ime_helper_scripts | 4c32673c479d9e9f7b34661dc21faa1bf9c7f70f | [
"MIT"
]
| null | null | null | pimpla_table_merge/pimpla_table_merge.pl | greatfireball/ime_helper_scripts | 4c32673c479d9e9f7b34661dc21faa1bf9c7f70f | [
"MIT"
]
| null | null | null | #!/usr/bin/env perl
use strict;
use warnings;
use Digest::MD5;
use Getopt::Long;
use Log::Log4perl;
# Configuration in a string ...
my $conf = q(
log4perl.category.Foo.Bar = INFO, Logfile, Screen
log4perl.appender.Logfile = Log::Log4perl::Appender::File
log4perl.appender.Logfile.filename = test.log
log4perl.appender.Logfile.layout = Log::Log4perl::Layout::PatternLayout
log4perl.appender.Logfile.layout.ConversionPattern = [%r] %F %L %m%n
log4perl.appender.Screen = Log::Log4perl::Appender::Screen
log4perl.appender.Screen.stderr = 0
log4perl.appender.Screen.layout = Log::Log4perl::Layout::SimpleLayout
);
use version 0.77; our $VERSION = version->declare('v1.2.0');
# ... passed as a reference to init()
Log::Log4perl::init( \$conf );
my $log = Log::Log4perl::get_logger("Foo::Bar");
my $mascot_id_file = "";
my $interproscan_file = "";
my $toxprot_file = "";
my $ncbi_file = "";
my $quantification_file = "";
my $hmmer_file = "";
my $jackhmmer_file = "";
my $deseq_normalized = "";
my @deseq_results = ();
my @manual_annotations = ();
my $interpro_out = "interpro.tsv";
my $table_out = "output.tsv";
GetOptions(
"mascot=s" => \$mascot_id_file,
"interpro=s" => \$interproscan_file,
"toxprot=s" => \$toxprot_file,
"ncbi=s" => \$ncbi_file,
"quantification=s" => \$quantification_file,
"hmmer=s" => \$hmmer_file,
"jackhmmer=s" => \$jackhmmer_file,
"deseqnormal=s" => \$deseq_normalized,
"deseqdiffseq=s@" => \@deseq_results,
"manual=s@" => \@manual_annotations,
"out=s" => \$table_out,
"out_interpro=s" => \$interpro_out
) || die;
@manual_annotations = split(/,/, join(",", @manual_annotations));
@deseq_results = split(/,/, join(",", @deseq_results));
my %mascot_ids = ();
my $ctx = Digest::MD5->new;
open(FH, "<", $mascot_id_file) || die "Unable to open Mascot ID File '$mascot_id_file': $!\n";
while(<FH>)
{
$ctx->add($_);
chomp;
if ($_ =~ /^\S*?(\d+)\.(p\d+)/)
{
my ($id, $protein) = ($1, $2);
push(@{$mascot_ids{$id}{orig}}, $_);
$mascot_ids{$id}{proteins}{$protein}++;
} else {
die "Should never happen for Mascot ID File line $. : '$_'\n";
}
}
close(FH) || die "Unable to close Mascot ID File '$mascot_id_file': $!\n";
$log->info(sprintf("Found %d ids from mascot run (MD5-Input: %s)", (keys %mascot_ids)+0, $ctx->hexdigest));
for my $manual (@manual_annotations)
{
$ctx = Digest::MD5->new;
open(FH, "<", $manual) || die "Unable to open manual annotation file '$manual': $!\n";
while(<FH>)
{
$ctx->add($_);
if ($_ =~ /^\S+_(\d+)\t+(.+)/)
{
my ($id, $annotation) = ($1, $2);
if (exists $mascot_ids{$id})
{
push(@{$mascot_ids{$id}{manual}}, $annotation)
}
}
}
close(FH) || die "Unable to close manual annotation file '$manual': $!\n";
my @ids_with_manual = ();
foreach my $id (keys %mascot_ids)
{
if (exists $mascot_ids{$id}{manual})
{
push(@ids_with_manual, $id);
} else {
$mascot_ids{$id}{manual} = [];
}
}
my $num_manuals = @ids_with_manual+0;
my $percent_manual = $num_manuals/((keys %mascot_ids)+0)*100;
$log->info(sprintf("Found %d entries with manual annoation from file '%s' (%.1f %%) (MD5-Input: %s)", $num_manuals, $manual, $percent_manual, $ctx->hexdigest));
}
$ctx = Digest::MD5->new;
open(FH, "<", $interproscan_file) || die "Unable to open Interproscan file '$interproscan_file': $!\n";
while(<FH>)
{
$ctx->add($_);
if ($_ =~ /^\S*?(\d+)\.(p\d+)/)
{
my ($id, $protein) = ($1, $2);
if (exists $mascot_ids{$id})
{
push(@{$mascot_ids{$id}{interpro}}, $_)
}
}
}
close(FH) || die "Unable to close Interproscan file '$interproscan_file': $!\n";
my @ids_with_interpro = ();
foreach my $id (keys %mascot_ids)
{
if (exists $mascot_ids{$id}{interpro})
{
push(@ids_with_interpro, $id);
} else {
$mascot_ids{$id}{interpro} = [];
}
}
my $num_interpros = @ids_with_interpro+0;
my $percent_interpro = $num_interpros/((keys %mascot_ids)+0)*100;
$log->info(sprintf("Found %d entries with interproscan information (%.1f %%) (MD5-Input: %s)", $num_interpros, $percent_interpro, $ctx->hexdigest));
$ctx = Digest::MD5->new;
open(FH, "<", $hmmer_file) || die "Unable to open hmmer file '$hmmer_file': $!\n";
while(<FH>)
{
$ctx->add($_);
next if (/^#/);
chomp;
my @fields = split(/\s+/, $_);
if ($fields[0] =~ /^\S*?(\d+)\.(p\d+)/)
{
my ($id) = ($1);
if (exists $mascot_ids{$id})
{
my $bitscore = $fields[5];
my $name = $fields[2];
next if ($bitscore < 15);
if ( (! exists $mascot_ids{$id}{hmmer}) || $mascot_ids{$id}{hmmer}{bitscore} < $bitscore)
{
$mascot_ids{$id}{hmmer}= { bitscore => $bitscore, hmmerhit => $name };
}
}
}
}
close(FH) || die "Unable to close hmmer file '$hmmer_file': $!\n";
my @ids_with_hmmer = ();
foreach my $id (keys %mascot_ids)
{
if (exists $mascot_ids{$id}{hmmer})
{
push(@ids_with_hmmer, $id);
} else {
$mascot_ids{$id}{hmmer} = {};
}
}
my $num_hmmer = @ids_with_hmmer+0;
my $percent_hmmer = $num_hmmer/((keys %mascot_ids)+0)*100;
$log->info(sprintf("Found %d entries with hmmer information (%.1f %%) (MD5-Input: %s)", $num_hmmer, $percent_hmmer, $ctx->hexdigest));
$ctx = Digest::MD5->new;
open(FH, "<", $jackhmmer_file) || die "Unable to open jackhmmer file '$jackhmmer_file': $!\n";
while(<FH>)
{
$ctx->add($_);
next if (/^#/);
chomp;
my @fields = split(/\s+/, $_);
if ($fields[0] =~ /^\S*?(\d+)\.(p\d+)/)
{
my ($id) = ($1);
if (exists $mascot_ids{$id})
{
my $bitscore = $fields[5];
my $name = $fields[2];
next if ($bitscore < 15);
if ( (! exists $mascot_ids{$id}{jackhmmer}) || $mascot_ids{$id}{jackhmmer}{bitscore} < $bitscore)
{
$mascot_ids{$id}{jackhmmer}= { bitscore => $bitscore, jackhmmerhit => $name };
}
}
}
}
close(FH) || die "Unable to close jackhmmer file '$jackhmmer_file': $!\n";
my @ids_with_jackhmmer = ();
foreach my $id (keys %mascot_ids)
{
if (exists $mascot_ids{$id}{jackhmmer})
{
push(@ids_with_jackhmmer, $id);
} else {
$mascot_ids{$id}{jackhmmer} = {};
}
}
my $num_jackhmmer = @ids_with_jackhmmer+0;
my $percent_jackhmmer = $num_jackhmmer/((keys %mascot_ids)+0)*100;
$log->info(sprintf("Found %d entries with jackhmmer information (%.1f %%) (MD5-Input: %s)", $num_jackhmmer, $percent_jackhmmer, $ctx->hexdigest));
$ctx = Digest::MD5->new;
open(FH, "<", $quantification_file) || die "Unable to open quantification file '$quantification_file': $!\n";
my @fieldnames = ();
while(<FH>)
{
$ctx->add($_);
if (/^#/)
{
chomp;
$_ =~ s/^#//;
@fieldnames = split(/\t/, $_);
next;
}
chomp;
my @fields = split(/\t/, $_);
my %data = ();
@data{@fieldnames} = @fields;
if ($data{transcript} =~ /^\S+_(\d+)$/)
{
my ($id) = ($1);
if (exists $mascot_ids{$id})
{
die "Double quantification result for $id\n" if (exists $mascot_ids{$id}{quantification});
$mascot_ids{$id}{quantification} = \%data;
}
}
}
close(FH) || die "Unable to close quantification file '$quantification_file': $!\n";
my @ids_with_quantification = ();
foreach my $id (keys %mascot_ids)
{
if (exists $mascot_ids{$id}{quantification})
{
push(@ids_with_quantification, $id);
} else {
$mascot_ids{$id}{quantification} = {};
}
}
my $num_quantification = @ids_with_quantification+0;
my $percent_quantification = $num_quantification/((keys %mascot_ids)+0)*100;
$log->info(sprintf("Found %d entries with quantification information (%.1f %%) (MD5-Input: %s)", $num_quantification, $percent_quantification, $ctx->hexdigest));
$ctx = Digest::MD5->new;
open(FH, "<", $toxprot_file) || die "Unable to open toxprot file '$toxprot_file': $!\n";
while(<FH>)
{
$ctx->add($_);
if (/^#/)
{
chomp;
$_ =~ s/^#//;
@fieldnames = split(/\t/, $_);
next;
}
chomp;
# example line
# #query query_lengh subject subject_length identity similarity query_start query_end subject_start subject_end query_coverage subject_coverage bitscore description
# pitu_v1_bf_011616 1837 sp|J3SDX8|LICH_CROAD 400 36.412 57.18 332 1459 26 397 61.35 92.75 225 Putative lysosomal acid lipase/cholesteryl ester hydrolase OS=Crotalus adamanteus OX=8729 PE=2 SV=1
my @fields = split(/\t/, $_);
my %data = ();
@data{@fieldnames} = @fields;
if ($data{query} =~ /^\S+_(\d+)$/)
{
my ($id) = ($1);
if (exists $mascot_ids{$id})
{
# update if it is a better hit or no toxprot hit was stored
if ( (! exists $mascot_ids{$id}{toxprot}) || ($mascot_ids{$id}{toxprot}{bitscore} < $data{bitscore}))
{
$mascot_ids{$id}{toxprot} = \%data;
}
}
}
}
close(FH) || die "Unable to close toxprot file '$toxprot_file': $!\n";
my @ids_with_toxprot = ();
foreach my $id (keys %mascot_ids)
{
if (exists $mascot_ids{$id}{toxprot})
{
push(@ids_with_toxprot, $id);
} else {
$mascot_ids{$id}{toxprot} = {};
}
}
my $num_toxprot = @ids_with_toxprot+0;
my $percent_toxprot = $num_toxprot/((keys %mascot_ids)+0)*100;
$log->info(sprintf("Found %d entries with toxprot information (%.1f %%) (MD5-Input: %s)", $num_toxprot, $percent_toxprot, $ctx->hexdigest));
$ctx = Digest::MD5->new;
open(FH, "<", $ncbi_file) || die "Unable to open ncbi file '$ncbi_file': $!\n";
while(<FH>)
{
$ctx->add($_);
if (/^#/)
{
chomp;
$_ =~ s/^#//;
@fieldnames = split(/\t/, $_);
next;
}
chomp;
my @fields = split(/\t/, $_);
my %data = ();
@data{@fieldnames} = @fields;
if ($data{query} =~ /^\S+_(\d+)$/)
{
my ($id) = ($1);
if (exists $mascot_ids{$id})
{
# update if it is a better hit or no toxprot hit was stored
if ( (! exists $mascot_ids{$id}{ncbi}) || ($mascot_ids{$id}{ncbi}{bitscore} < $data{bitscore}))
{
$mascot_ids{$id}{ncbi} = \%data;
}
}
}
}
close(FH) || die "Unable to close ncbi file '$ncbi_file': $!\n";
my @ids_with_ncbi = ();
foreach my $id (keys %mascot_ids)
{
if (exists $mascot_ids{$id}{ncbi})
{
push(@ids_with_ncbi, $id);
} else {
$mascot_ids{$id}{ncbi} = {};
}
}
my $num_ncbi = @ids_with_ncbi+0;
my $percent_ncbi = $num_ncbi/((keys %mascot_ids)+0)*100;
$log->info(sprintf("Found %d entries with ncbi information (%.1f %%) (MD5-Input: %s)", $num_ncbi, $percent_ncbi, $ctx->hexdigest));
$ctx = Digest::MD5->new;
@fieldnames = ();
open(FH, "<", $deseq_normalized) || die "Unable to open DESeq normalized file '$deseq_normalized': $!\n";
while(<FH>)
{
$ctx->add($_);
if ($. == 1)
{
chomp;
@fieldnames = split(/\t/, $_);
# add an ID field
unshift(@fieldnames, "id");
next;
}
chomp;
my @fields = split(/\t/, $_);
my %data = ();
@data{@fieldnames} = @fields;
if ($data{id} =~ /^\S+_(\d+)$/)
{
my ($id) = ($1);
if (exists $mascot_ids{$id})
{
$mascot_ids{$id}{deseqnormalized} = \%data;
}
}
}
close(FH) || die "Unable to close DESeq normalized file '$deseq_normalized': $!\n";
my @ids_with_normalized_counts = ();
foreach my $id (keys %mascot_ids)
{
if (exists $mascot_ids{$id}{deseqnormalized})
{
push(@ids_with_normalized_counts, $id);
} else {
$mascot_ids{$id}{deseqnormalized} = {
id => $id,
venomgland => "-",
femalebody => "-",
malebody => "-"
};
}
}
my $num_deseqnormalized = @ids_with_normalized_counts+0;
my $percent_deseqnormalized = $num_deseqnormalized/((keys %mascot_ids)+0)*100;
$log->info(sprintf("Found %d entries with DESeq normalized information (%.1f %%) (MD5-Input: %s)", $num_deseqnormalized, $percent_deseqnormalized, $ctx->hexdigest));
foreach my $diffseq_file (@deseq_results)
{
@fieldnames = ();
my ($experiment) = $diffseq_file =~ /([^_]+)\.mat$/;
$ctx = Digest::MD5->new;
open(FH, "<", $diffseq_file) || die "Unable to open DESeq diffseq file '$diffseq_file': $!\n";
while(<FH>)
{
$ctx->add($_);
if ($. == 1)
{
chomp;
@fieldnames = split(",", $_);
# skip first field
shift @fieldnames;
next;
}
chomp;
my @fields = split(",", $_);
shift @fields;
my %data = ();
@data{@fieldnames} = @fields;
if ($data{id} =~ /^\S+_(\d+)$/)
{
my ($id) = ($1);
if (exists $mascot_ids{$id})
{
$mascot_ids{$id}{diffseq}{$experiment} = {
id => $id,
'log2foldchange' => $data{log2FoldChange},
'significant' => (($data{padj} <= 0.05) ? "YES" : "NO"),
'padj' => $data{padj}
};
}
}
}
close(FH) || die "Unable to close DESeq diffseq '$diffseq_file': $!\n";
my @ids_with_diffseq_counts = ();
foreach my $id (keys %mascot_ids)
{
if (exists $mascot_ids{$id}{diffseq}{$experiment})
{
push(@ids_with_diffseq_counts, $id);
} else {
$mascot_ids{$id}{diffseq}{$experiment} = {
id => $id,
'log2foldchange' => "-",
'significant' => "NO",
'padj' => "-"
};
}
}
my $num_diffseq = @ids_with_diffseq_counts+0;
my $percent_diffseq = $num_diffseq/((keys %mascot_ids)+0)*100;
$log->info(sprintf("Found %d entries with DESeq diffseq information (%.1f %%) for input file '%s' (MD5-Input: %s)", $num_diffseq, $percent_diffseq, $diffseq_file, $ctx->hexdigest));
}
my $ctx_interpro = Digest::MD5->new;
my $ctx_output = Digest::MD5->new;
open(FH, ">", $table_out) || die "Unable to open output table file '$table_out': $!\n";
open(INTERPRO, ">", $interpro_out) || die "Unable to open interpro output table file '$interpro_out': $!\n";
my @diffseq_fields = ();
foreach my $diffseq_file (@deseq_results)
{
my ($experiment) = $diffseq_file =~ /([^_]+)\.mat$/;
push(@diffseq_fields, map { $experiment."_".$_ } (qw(log2foldchange significant padj)));
}
my $line = join("\t",
"transcript",
"vg_cov",
"vg_tpm",
"bf_cov",
"bf_tpm",
"bm_cov",
"bm_tpm",
"vg_DESeq_normalized",
"bf_DESeq_normalized",
"bm_DESeq_normalized",
@diffseq_fields,
"Venom Related Protein Description",
"ToxProt_Subject",
"ToxProt_Description",
"ToxProt_Bitscore",
"NCBI_Subject",
"NCBI_Description",
"NCBI_Bitscore",
"InterproScan result available",
"HMMER subject",
"HMMER bitscore",
"JACKHMMER subject",
"JACKHMMER bitscore"
)."\n";
print FH $line;
$ctx_output->add($line);
foreach my $id (sort {$a <=> $b} (keys %mascot_ids))
{
my $interpro_present = "NO";
if ( @{$mascot_ids{$id}{interpro}} > 0 )
{
$interpro_present = sprintf("YES (%d result lines)", int(@{$mascot_ids{$id}{interpro}}));
foreach (@{$mascot_ids{$id}{interpro}})
{
$_ =~ s/^\S+_(\d+)(\.p\d+)/pitu_v1_$1$2/;
print INTERPRO $_;
$ctx_interpro->add($_);
}
}
my @diffseq_fields = ();
foreach my $diffseq_file (@deseq_results)
{
my ($experiment) = $diffseq_file =~ /([^_]+)\.mat$/;
push(@diffseq_fields, map { $mascot_ids{$id}{diffseq}{$experiment}{$_} } (qw(log2foldchange significant padj)));
}
my $line = join("\t",
"pitu_v1_".$id,
$mascot_ids{$id}{quantification}{'./stringtie/3_8_dta.gtf_cov'},
$mascot_ids{$id}{quantification}{'./stringtie/3_8_dta.gtf_tpm'},
$mascot_ids{$id}{quantification}{'./stringtie/6_dta.gtf_cov'},
$mascot_ids{$id}{quantification}{'./stringtie/6_dta.gtf_tpm'},
$mascot_ids{$id}{quantification}{'./stringtie/7_dta.gtf_cov'},
$mascot_ids{$id}{quantification}{'./stringtie/7_dta.gtf_tpm'},
$mascot_ids{$id}{deseqnormalized}{venomgland},
$mascot_ids{$id}{deseqnormalized}{femalebody},
$mascot_ids{$id}{deseqnormalized}{malebody},
@diffseq_fields,
join(";", @{$mascot_ids{$id}{manual}}),
( map { exists $mascot_ids{$id}{toxprot}{$_} ? $mascot_ids{$id}{toxprot}{$_} : "" } ("subject", "description", "bitscore")),
( map { exists $mascot_ids{$id}{ncbi}{$_} ? $mascot_ids{$id}{ncbi}{$_} : "" } ("subject", "description", "bitscore")),
$interpro_present,
((exists $mascot_ids{$id}{hmmer}{hmmerhit}) ? $mascot_ids{$id}{hmmer}{hmmerhit} : ""),
((exists $mascot_ids{$id}{hmmer}{bitscore}) ? $mascot_ids{$id}{hmmer}{bitscore} : ""),
((exists $mascot_ids{$id}{jackhmmer}{jackhmmerhit}) ? $mascot_ids{$id}{jackhmmer}{jackhmmerhit} : ""),
((exists $mascot_ids{$id}{jackhmmer}{bitscore}) ? $mascot_ids{$id}{jackhmmer}{bitscore} : ""),
)."\n";
print FH $line;
$ctx_output->add($line);
}
close(INTERPRO) || die "Unable to close interpro output table file '$interpro_out': $!\n";
close(FH) || die "Unable to close output table file '$table_out': $!\n";
$log->info(sprintf("Output file MD5: %s", $ctx_output->hexdigest));
$log->info(sprintf("Interpro output file MD5: %s", $ctx_interpro->hexdigest));
| 29.278066 | 241 | 0.589429 |
ed198bf8abbe2719f6cbcdae354f15f85dc0f15a | 5,424 | pm | Perl | tests/yast2_gui/yast2_instserver.pm | DeepthiYV/os-autoinst-distri-opensuse | 563632700f014528b3cd938a6efc2cc566a7aae5 | [
"FSFAP"
]
| null | null | null | tests/yast2_gui/yast2_instserver.pm | DeepthiYV/os-autoinst-distri-opensuse | 563632700f014528b3cd938a6efc2cc566a7aae5 | [
"FSFAP"
]
| 1 | 2015-01-28T09:17:48.000Z | 2015-01-28T13:39:08.000Z | tests/yast2_gui/yast2_instserver.pm | DeepthiYV/os-autoinst-distri-opensuse | 563632700f014528b3cd938a6efc2cc566a7aae5 | [
"FSFAP"
]
| 1 | 2022-02-14T21:05:54.000Z | 2022-02-14T21:05:54.000Z | # SUSE's openQA tests
#
# Copyright © 2019 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: nfs-client yast2-instserver lftp xinetd vsftpd openslp-server yast2-nfs-server nfs-client apache2
# Summary: test yast2-instserver using HTTP, FTP and NFS
# - ensure that all needed packages are installed
# - setup instserver using HTTP
# - check that HTTP instserver is working
# - setup instserver using FTP
# - check that FTP instserver is working
# - setup instserver using NFS
# - check that NFS instserver is working
# Maintainer: Paolo Stivanin <pstivanin@suse.com>
use base "y2_module_guitest";
use strict;
use warnings;
use testapi;
use utils "zypper_call";
use version_utils "is_sle";
sub send_key_and_wait {
my $key = shift;
my $still_time = shift;
my $timeout = shift // 5;
send_key $key;
wait_still_screen $still_time, $timeout;
}
sub clean_env {
send_key_and_wait("alt-t", 2);
send_key_and_wait("alt-f", 2);
x11_start_program "xterm";
wait_still_screen 2, 2;
become_root;
wait_still_screen 1;
my $config_file = "/etc/YaST2/instserver/instserver.xml";
assert_script_run "test -f $config_file && rm -f $config_file";
# exit xterm
send_key_and_wait("ctrl-d", 2);
send_key_and_wait("ctrl-d", 2);
}
sub test_nfs_instserver {
# select server configuration
send_key_and_wait("alt-s", 3);
# select nfs
send_key_and_wait("alt-f", 2);
send_key_and_wait("alt-n", 2);
assert_screen('yast2-instserver-nfs');
# use default nfs config
send_key_and_wait("alt-n", 2);
assert_screen('yast2-instserver-ui', 200);
# finish wizard
send_key_and_wait("alt-f", 3);
# check that the nfs instserver is working
x11_start_program "xterm";
wait_still_screen 2, 2;
become_root;
wait_still_screen 1;
my $dir_path = "/mnt/nfstest";
assert_script_run "showmount -e localhost | grep /srv/install";
assert_script_run "mkdir $dir_path && mount localhost:/srv/install $dir_path/";
assert_script_run "ls $dir_path/instserver/CD1/ | grep README";
script_run "umount $dir_path && rmdir $dir_path";
# exit xterm
send_key_and_wait("ctrl-d", 2);
send_key_and_wait("ctrl-d", 2);
}
sub test_ftp_instserver {
# select server configuration
send_key_and_wait("alt-s", 3);
# select ftp
send_key_and_wait("alt-o", 2);
send_key_and_wait("alt-n", 2);
# select directory alias
send_key_and_wait("alt-i", 2);
type_string "test";
wait_still_screen 2, 2;
send_key_and_wait("alt-n", 3);
assert_screen('yast2-instserver-ui');
# finish wizard
send_key_and_wait("alt-f", 3);
# check that the ftp instserver is working
x11_start_program "xterm";
wait_still_screen 2, 2;
if (is_sle "<=12-SP5") {
become_root;
wait_still_screen 1;
assert_script_run "service xinetd stop";
assert_script_run "service vsftpd start";
}
assert_script_run "lftp -e 'set net:timeout 3; get /srv/install/instserver/CD1/README; bye' -u bernhard,$testapi::password localhost";
assert_script_run "test -f README";
# exit xterm
send_key_and_wait("ctrl-d", 2) if is_sle "<=12-SP5";
send_key_and_wait("ctrl-d", 2);
}
sub test_http_instserver {
# by default "configure http repository" is selected
send_key_and_wait("alt-n", 2);
send_key_and_wait("alt-i", 1);
# directory alias
type_string "test";
wait_still_screen 2, 2;
send_key_and_wait("alt-n", 2);
send_key_and_wait("alt-a", 2);
assert_screen('yast2-instserver-repository-conf');
send_key_and_wait("alt-p", 2);
type_string "instserver";
wait_still_screen 2, 2;
send_key_and_wait("alt-n", 2);
# select sr0
send_key_and_wait("alt-c", 2);
send_key_and_wait("alt-s", 2);
send_key_until_needlematch("yast2-instserver_sr0dev", "down", 3);
send_key_and_wait("alt-n", 2);
send_key_and_wait("alt-o", 2);
assert_screen([qw(yast2-instserver-ui yast2-instserver-change-media)], 300);
# skip "insert next cd" on SLE 12.x
send_key_and_wait("alt-s", 2) if is_sle("<=12-SP5") && match_has_tag('yast2-instserver-change-media');
assert_screen('yast2-instserver-ui');
# finish wizard
send_key_and_wait("alt-f", 3);
# check that the http instserver is working
x11_start_program "xterm";
wait_still_screen 2, 2;
validate_script_output("curl -s http://localhost/test/instserver/CD1/ | grep title", sub { m/.*Index of \/test\/instserver\/CD1.*/ });
# exit xterm
send_key_and_wait("ctrl-d", 2);
}
sub start_yast2_instserver {
my $self = shift;
$self->launch_yast2_module_x11("instserver", match_timeout => 120);
wait_still_screen;
}
sub run {
my $self = shift;
select_console "root-console";
zypper_call("in yast2-instserver openslp-server lftp vsftpd yast2-nfs-server nfs-client apache2{,-prefork}", exitcode => [0, 102, 103]);
select_console "x11";
start_yast2_instserver $self;
test_http_instserver;
start_yast2_instserver $self;
test_ftp_instserver;
start_yast2_instserver $self;
test_nfs_instserver;
# clean existing config
start_yast2_instserver $self;
clean_env;
}
1;
| 31.534884 | 140 | 0.689528 |
73df4ce14f1605f53b4fdd34b395300532794bdd | 25,453 | t | Perl | exercises/practice/meetup/meetup.t | mienaikage/exercism-perl5 | e52b2e6d4a4103e73b596841c8bede08eed14bf6 | [
"MIT"
]
| null | null | null | exercises/practice/meetup/meetup.t | mienaikage/exercism-perl5 | e52b2e6d4a4103e73b596841c8bede08eed14bf6 | [
"MIT"
]
| null | null | null | exercises/practice/meetup/meetup.t | mienaikage/exercism-perl5 | e52b2e6d4a4103e73b596841c8bede08eed14bf6 | [
"MIT"
]
| null | null | null | #!/usr/bin/env perl
use Test2::V0;
use JSON::PP;
use constant JSON => JSON::PP->new;
use FindBin qw<$Bin>;
use lib $Bin, "$Bin/local/lib/perl5";
use Meetup qw<meetup>;
my @test_cases = do { local $/; @{ JSON->decode(<DATA>) }; };
plan 96;
imported_ok qw<meetup> or bail_out;
use constant MONTHS => qw<
January February March April May June
July August September October November December
>;
for my $case (@test_cases) {
my $input_string = sprintf( '%s %s of %s %u',
ucfirst( $case->{input}{week} ),
$case->{input}{dayofweek},
(MONTHS)[ $case->{input}{month} - 1 ],
$case->{input}{year} );
is meetup($input_string), $case->{expected}, $case->{description};
}
__DATA__
[
{
"description": "when teenth Monday is the 13th, the first day of the teenth week",
"expected": "2013-05-13",
"input": {
"dayofweek": "Monday",
"month": 5,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Monday is the 19th, the last day of the teenth week",
"expected": "2013-08-19",
"input": {
"dayofweek": "Monday",
"month": 8,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Monday is some day in the middle of the teenth week",
"expected": "2013-09-16",
"input": {
"dayofweek": "Monday",
"month": 9,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Tuesday is the 19th, the last day of the teenth week",
"expected": "2013-03-19",
"input": {
"dayofweek": "Tuesday",
"month": 3,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Tuesday is some day in the middle of the teenth week",
"expected": "2013-04-16",
"input": {
"dayofweek": "Tuesday",
"month": 4,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Tuesday is the 13th, the first day of the teenth week",
"expected": "2013-08-13",
"input": {
"dayofweek": "Tuesday",
"month": 8,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Wednesday is some day in the middle of the teenth week",
"expected": "2013-01-16",
"input": {
"dayofweek": "Wednesday",
"month": 1,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Wednesday is the 13th, the first day of the teenth week",
"expected": "2013-02-13",
"input": {
"dayofweek": "Wednesday",
"month": 2,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Wednesday is the 19th, the last day of the teenth week",
"expected": "2013-06-19",
"input": {
"dayofweek": "Wednesday",
"month": 6,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Thursday is some day in the middle of the teenth week",
"expected": "2013-05-16",
"input": {
"dayofweek": "Thursday",
"month": 5,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Thursday is the 13th, the first day of the teenth week",
"expected": "2013-06-13",
"input": {
"dayofweek": "Thursday",
"month": 6,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Thursday is the 19th, the last day of the teenth week",
"expected": "2013-09-19",
"input": {
"dayofweek": "Thursday",
"month": 9,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Friday is the 19th, the last day of the teenth week",
"expected": "2013-04-19",
"input": {
"dayofweek": "Friday",
"month": 4,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Friday is some day in the middle of the teenth week",
"expected": "2013-08-16",
"input": {
"dayofweek": "Friday",
"month": 8,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Friday is the 13th, the first day of the teenth week",
"expected": "2013-09-13",
"input": {
"dayofweek": "Friday",
"month": 9,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Saturday is some day in the middle of the teenth week",
"expected": "2013-02-16",
"input": {
"dayofweek": "Saturday",
"month": 2,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Saturday is the 13th, the first day of the teenth week",
"expected": "2013-04-13",
"input": {
"dayofweek": "Saturday",
"month": 4,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Saturday is the 19th, the last day of the teenth week",
"expected": "2013-10-19",
"input": {
"dayofweek": "Saturday",
"month": 10,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Sunday is the 19th, the last day of the teenth week",
"expected": "2013-05-19",
"input": {
"dayofweek": "Sunday",
"month": 5,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Sunday is some day in the middle of the teenth week",
"expected": "2013-06-16",
"input": {
"dayofweek": "Sunday",
"month": 6,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when teenth Sunday is the 13th, the first day of the teenth week",
"expected": "2013-10-13",
"input": {
"dayofweek": "Sunday",
"month": 10,
"week": "teenth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when first Monday is some day in the middle of the first week",
"expected": "2013-03-04",
"input": {
"dayofweek": "Monday",
"month": 3,
"week": "first",
"year": 2013
},
"property": "meetup"
},
{
"description": "when first Monday is the 1st, the first day of the first week",
"expected": "2013-04-01",
"input": {
"dayofweek": "Monday",
"month": 4,
"week": "first",
"year": 2013
},
"property": "meetup"
},
{
"description": "when first Tuesday is the 7th, the last day of the first week",
"expected": "2013-05-07",
"input": {
"dayofweek": "Tuesday",
"month": 5,
"week": "first",
"year": 2013
},
"property": "meetup"
},
{
"description": "when first Tuesday is some day in the middle of the first week",
"expected": "2013-06-04",
"input": {
"dayofweek": "Tuesday",
"month": 6,
"week": "first",
"year": 2013
},
"property": "meetup"
},
{
"description": "when first Wednesday is some day in the middle of the first week",
"expected": "2013-07-03",
"input": {
"dayofweek": "Wednesday",
"month": 7,
"week": "first",
"year": 2013
},
"property": "meetup"
},
{
"description": "when first Wednesday is the 7th, the last day of the first week",
"expected": "2013-08-07",
"input": {
"dayofweek": "Wednesday",
"month": 8,
"week": "first",
"year": 2013
},
"property": "meetup"
},
{
"description": "when first Thursday is some day in the middle of the first week",
"expected": "2013-09-05",
"input": {
"dayofweek": "Thursday",
"month": 9,
"week": "first",
"year": 2013
},
"property": "meetup"
},
{
"description": "when first Thursday is another day in the middle of the first week",
"expected": "2013-10-03",
"input": {
"dayofweek": "Thursday",
"month": 10,
"week": "first",
"year": 2013
},
"property": "meetup"
},
{
"description": "when first Friday is the 1st, the first day of the first week",
"expected": "2013-11-01",
"input": {
"dayofweek": "Friday",
"month": 11,
"week": "first",
"year": 2013
},
"property": "meetup"
},
{
"description": "when first Friday is some day in the middle of the first week",
"expected": "2013-12-06",
"input": {
"dayofweek": "Friday",
"month": 12,
"week": "first",
"year": 2013
},
"property": "meetup"
},
{
"description": "when first Saturday is some day in the middle of the first week",
"expected": "2013-01-05",
"input": {
"dayofweek": "Saturday",
"month": 1,
"week": "first",
"year": 2013
},
"property": "meetup"
},
{
"description": "when first Saturday is another day in the middle of the first week",
"expected": "2013-02-02",
"input": {
"dayofweek": "Saturday",
"month": 2,
"week": "first",
"year": 2013
},
"property": "meetup"
},
{
"description": "when first Sunday is some day in the middle of the first week",
"expected": "2013-03-03",
"input": {
"dayofweek": "Sunday",
"month": 3,
"week": "first",
"year": 2013
},
"property": "meetup"
},
{
"description": "when first Sunday is the 7th, the last day of the first week",
"expected": "2013-04-07",
"input": {
"dayofweek": "Sunday",
"month": 4,
"week": "first",
"year": 2013
},
"property": "meetup"
},
{
"description": "when second Monday is some day in the middle of the second week",
"expected": "2013-03-11",
"input": {
"dayofweek": "Monday",
"month": 3,
"week": "second",
"year": 2013
},
"property": "meetup"
},
{
"description": "when second Monday is the 8th, the first day of the second week",
"expected": "2013-04-08",
"input": {
"dayofweek": "Monday",
"month": 4,
"week": "second",
"year": 2013
},
"property": "meetup"
},
{
"description": "when second Tuesday is the 14th, the last day of the second week",
"expected": "2013-05-14",
"input": {
"dayofweek": "Tuesday",
"month": 5,
"week": "second",
"year": 2013
},
"property": "meetup"
},
{
"description": "when second Tuesday is some day in the middle of the second week",
"expected": "2013-06-11",
"input": {
"dayofweek": "Tuesday",
"month": 6,
"week": "second",
"year": 2013
},
"property": "meetup"
},
{
"description": "when second Wednesday is some day in the middle of the second week",
"expected": "2013-07-10",
"input": {
"dayofweek": "Wednesday",
"month": 7,
"week": "second",
"year": 2013
},
"property": "meetup"
},
{
"description": "when second Wednesday is the 14th, the last day of the second week",
"expected": "2013-08-14",
"input": {
"dayofweek": "Wednesday",
"month": 8,
"week": "second",
"year": 2013
},
"property": "meetup"
},
{
"description": "when second Thursday is some day in the middle of the second week",
"expected": "2013-09-12",
"input": {
"dayofweek": "Thursday",
"month": 9,
"week": "second",
"year": 2013
},
"property": "meetup"
},
{
"description": "when second Thursday is another day in the middle of the second week",
"expected": "2013-10-10",
"input": {
"dayofweek": "Thursday",
"month": 10,
"week": "second",
"year": 2013
},
"property": "meetup"
},
{
"description": "when second Friday is the 8th, the first day of the second week",
"expected": "2013-11-08",
"input": {
"dayofweek": "Friday",
"month": 11,
"week": "second",
"year": 2013
},
"property": "meetup"
},
{
"description": "when second Friday is some day in the middle of the second week",
"expected": "2013-12-13",
"input": {
"dayofweek": "Friday",
"month": 12,
"week": "second",
"year": 2013
},
"property": "meetup"
},
{
"description": "when second Saturday is some day in the middle of the second week",
"expected": "2013-01-12",
"input": {
"dayofweek": "Saturday",
"month": 1,
"week": "second",
"year": 2013
},
"property": "meetup"
},
{
"description": "when second Saturday is another day in the middle of the second week",
"expected": "2013-02-09",
"input": {
"dayofweek": "Saturday",
"month": 2,
"week": "second",
"year": 2013
},
"property": "meetup"
},
{
"description": "when second Sunday is some day in the middle of the second week",
"expected": "2013-03-10",
"input": {
"dayofweek": "Sunday",
"month": 3,
"week": "second",
"year": 2013
},
"property": "meetup"
},
{
"description": "when second Sunday is the 14th, the last day of the second week",
"expected": "2013-04-14",
"input": {
"dayofweek": "Sunday",
"month": 4,
"week": "second",
"year": 2013
},
"property": "meetup"
},
{
"description": "when third Monday is some day in the middle of the third week",
"expected": "2013-03-18",
"input": {
"dayofweek": "Monday",
"month": 3,
"week": "third",
"year": 2013
},
"property": "meetup"
},
{
"description": "when third Monday is the 15th, the first day of the third week",
"expected": "2013-04-15",
"input": {
"dayofweek": "Monday",
"month": 4,
"week": "third",
"year": 2013
},
"property": "meetup"
},
{
"description": "when third Tuesday is the 21st, the last day of the third week",
"expected": "2013-05-21",
"input": {
"dayofweek": "Tuesday",
"month": 5,
"week": "third",
"year": 2013
},
"property": "meetup"
},
{
"description": "when third Tuesday is some day in the middle of the third week",
"expected": "2013-06-18",
"input": {
"dayofweek": "Tuesday",
"month": 6,
"week": "third",
"year": 2013
},
"property": "meetup"
},
{
"description": "when third Wednesday is some day in the middle of the third week",
"expected": "2013-07-17",
"input": {
"dayofweek": "Wednesday",
"month": 7,
"week": "third",
"year": 2013
},
"property": "meetup"
},
{
"description": "when third Wednesday is the 21st, the last day of the third week",
"expected": "2013-08-21",
"input": {
"dayofweek": "Wednesday",
"month": 8,
"week": "third",
"year": 2013
},
"property": "meetup"
},
{
"description": "when third Thursday is some day in the middle of the third week",
"expected": "2013-09-19",
"input": {
"dayofweek": "Thursday",
"month": 9,
"week": "third",
"year": 2013
},
"property": "meetup"
},
{
"description": "when third Thursday is another day in the middle of the third week",
"expected": "2013-10-17",
"input": {
"dayofweek": "Thursday",
"month": 10,
"week": "third",
"year": 2013
},
"property": "meetup"
},
{
"description": "when third Friday is the 15th, the first day of the third week",
"expected": "2013-11-15",
"input": {
"dayofweek": "Friday",
"month": 11,
"week": "third",
"year": 2013
},
"property": "meetup"
},
{
"description": "when third Friday is some day in the middle of the third week",
"expected": "2013-12-20",
"input": {
"dayofweek": "Friday",
"month": 12,
"week": "third",
"year": 2013
},
"property": "meetup"
},
{
"description": "when third Saturday is some day in the middle of the third week",
"expected": "2013-01-19",
"input": {
"dayofweek": "Saturday",
"month": 1,
"week": "third",
"year": 2013
},
"property": "meetup"
},
{
"description": "when third Saturday is another day in the middle of the third week",
"expected": "2013-02-16",
"input": {
"dayofweek": "Saturday",
"month": 2,
"week": "third",
"year": 2013
},
"property": "meetup"
},
{
"description": "when third Sunday is some day in the middle of the third week",
"expected": "2013-03-17",
"input": {
"dayofweek": "Sunday",
"month": 3,
"week": "third",
"year": 2013
},
"property": "meetup"
},
{
"description": "when third Sunday is the 21st, the last day of the third week",
"expected": "2013-04-21",
"input": {
"dayofweek": "Sunday",
"month": 4,
"week": "third",
"year": 2013
},
"property": "meetup"
},
{
"description": "when fourth Monday is some day in the middle of the fourth week",
"expected": "2013-03-25",
"input": {
"dayofweek": "Monday",
"month": 3,
"week": "fourth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when fourth Monday is the 22nd, the first day of the fourth week",
"expected": "2013-04-22",
"input": {
"dayofweek": "Monday",
"month": 4,
"week": "fourth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when fourth Tuesday is the 28th, the last day of the fourth week",
"expected": "2013-05-28",
"input": {
"dayofweek": "Tuesday",
"month": 5,
"week": "fourth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when fourth Tuesday is some day in the middle of the fourth week",
"expected": "2013-06-25",
"input": {
"dayofweek": "Tuesday",
"month": 6,
"week": "fourth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when fourth Wednesday is some day in the middle of the fourth week",
"expected": "2013-07-24",
"input": {
"dayofweek": "Wednesday",
"month": 7,
"week": "fourth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when fourth Wednesday is the 28th, the last day of the fourth week",
"expected": "2013-08-28",
"input": {
"dayofweek": "Wednesday",
"month": 8,
"week": "fourth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when fourth Thursday is some day in the middle of the fourth week",
"expected": "2013-09-26",
"input": {
"dayofweek": "Thursday",
"month": 9,
"week": "fourth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when fourth Thursday is another day in the middle of the fourth week",
"expected": "2013-10-24",
"input": {
"dayofweek": "Thursday",
"month": 10,
"week": "fourth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when fourth Friday is the 22nd, the first day of the fourth week",
"expected": "2013-11-22",
"input": {
"dayofweek": "Friday",
"month": 11,
"week": "fourth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when fourth Friday is some day in the middle of the fourth week",
"expected": "2013-12-27",
"input": {
"dayofweek": "Friday",
"month": 12,
"week": "fourth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when fourth Saturday is some day in the middle of the fourth week",
"expected": "2013-01-26",
"input": {
"dayofweek": "Saturday",
"month": 1,
"week": "fourth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when fourth Saturday is another day in the middle of the fourth week",
"expected": "2013-02-23",
"input": {
"dayofweek": "Saturday",
"month": 2,
"week": "fourth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when fourth Sunday is some day in the middle of the fourth week",
"expected": "2013-03-24",
"input": {
"dayofweek": "Sunday",
"month": 3,
"week": "fourth",
"year": 2013
},
"property": "meetup"
},
{
"description": "when fourth Sunday is the 28th, the last day of the fourth week",
"expected": "2013-04-28",
"input": {
"dayofweek": "Sunday",
"month": 4,
"week": "fourth",
"year": 2013
},
"property": "meetup"
},
{
"description": "last Monday in a month with four Mondays",
"expected": "2013-03-25",
"input": {
"dayofweek": "Monday",
"month": 3,
"week": "last",
"year": 2013
},
"property": "meetup"
},
{
"description": "last Monday in a month with five Mondays",
"expected": "2013-04-29",
"input": {
"dayofweek": "Monday",
"month": 4,
"week": "last",
"year": 2013
},
"property": "meetup"
},
{
"description": "last Tuesday in a month with four Tuesdays",
"expected": "2013-05-28",
"input": {
"dayofweek": "Tuesday",
"month": 5,
"week": "last",
"year": 2013
},
"property": "meetup"
},
{
"description": "last Tuesday in another month with four Tuesdays",
"expected": "2013-06-25",
"input": {
"dayofweek": "Tuesday",
"month": 6,
"week": "last",
"year": 2013
},
"property": "meetup"
},
{
"description": "last Wednesday in a month with five Wednesdays",
"expected": "2013-07-31",
"input": {
"dayofweek": "Wednesday",
"month": 7,
"week": "last",
"year": 2013
},
"property": "meetup"
},
{
"description": "last Wednesday in a month with four Wednesdays",
"expected": "2013-08-28",
"input": {
"dayofweek": "Wednesday",
"month": 8,
"week": "last",
"year": 2013
},
"property": "meetup"
},
{
"description": "last Thursday in a month with four Thursdays",
"expected": "2013-09-26",
"input": {
"dayofweek": "Thursday",
"month": 9,
"week": "last",
"year": 2013
},
"property": "meetup"
},
{
"description": "last Thursday in a month with five Thursdays",
"expected": "2013-10-31",
"input": {
"dayofweek": "Thursday",
"month": 10,
"week": "last",
"year": 2013
},
"property": "meetup"
},
{
"description": "last Friday in a month with five Fridays",
"expected": "2013-11-29",
"input": {
"dayofweek": "Friday",
"month": 11,
"week": "last",
"year": 2013
},
"property": "meetup"
},
{
"description": "last Friday in a month with four Fridays",
"expected": "2013-12-27",
"input": {
"dayofweek": "Friday",
"month": 12,
"week": "last",
"year": 2013
},
"property": "meetup"
},
{
"description": "last Saturday in a month with four Saturdays",
"expected": "2013-01-26",
"input": {
"dayofweek": "Saturday",
"month": 1,
"week": "last",
"year": 2013
},
"property": "meetup"
},
{
"description": "last Saturday in another month with four Saturdays",
"expected": "2013-02-23",
"input": {
"dayofweek": "Saturday",
"month": 2,
"week": "last",
"year": 2013
},
"property": "meetup"
},
{
"description": "last Sunday in a month with five Sundays",
"expected": "2013-03-31",
"input": {
"dayofweek": "Sunday",
"month": 3,
"week": "last",
"year": 2013
},
"property": "meetup"
},
{
"description": "last Sunday in a month with four Sundays",
"expected": "2013-04-28",
"input": {
"dayofweek": "Sunday",
"month": 4,
"week": "last",
"year": 2013
},
"property": "meetup"
},
{
"description": "when last Wednesday in February in a leap year is the 29th",
"expected": "2012-02-29",
"input": {
"dayofweek": "Wednesday",
"month": 2,
"week": "last",
"year": 2012
},
"property": "meetup"
},
{
"description": "last Wednesday in December that is also the last day of the year",
"expected": "2014-12-31",
"input": {
"dayofweek": "Wednesday",
"month": 12,
"week": "last",
"year": 2014
},
"property": "meetup"
},
{
"description": "when last Sunday in February in a non-leap year is not the 29th",
"expected": "2015-02-22",
"input": {
"dayofweek": "Sunday",
"month": 2,
"week": "last",
"year": 2015
},
"property": "meetup"
},
{
"description": "when first Friday is the 7th, the last day of the first week",
"expected": "2012-12-07",
"input": {
"dayofweek": "Friday",
"month": 12,
"week": "first",
"year": 2012
},
"property": "meetup"
}
]
| 23.589435 | 90 | 0.520449 |
73ea15fc5053109ff9fe34d1a56530ecf4d40575 | 1,238 | pm | Perl | src/how/NQPNativeHOW.pm | KrisShannon/nqp | 2e578b5d4a122e0c75db9d74e8669132be4990d1 | [
"Artistic-2.0"
]
| null | null | null | src/how/NQPNativeHOW.pm | KrisShannon/nqp | 2e578b5d4a122e0c75db9d74e8669132be4990d1 | [
"Artistic-2.0"
]
| null | null | null | src/how/NQPNativeHOW.pm | KrisShannon/nqp | 2e578b5d4a122e0c75db9d74e8669132be4990d1 | [
"Artistic-2.0"
]
| null | null | null | knowhow NQPNativeHOW {
has $!name;
has $!composed;
my $archetypes := Archetypes.new( :nominal(1) );
method archetypes() {
$archetypes
}
method new(:$name) {
my $obj := pir::repr_instance_of__PP(self);
$obj.BUILD(:name($name));
$obj
}
method BUILD(:$name) {
$!name := $name;
}
# Create a new meta-class instance, and then a new type object
# to go with it, and return that.
# XXX Should check that this is an inlineable REPR.
method new_type(:$name = '<anon>', :$repr!) {
my $metaclass := self.new(:name($name));
pir::set_who__0PP(
pir::repr_type_object_for__PPS($metaclass, $repr),
{});
}
method add_method($obj, $name, $code_obj) {
pir::die("Native types may not have methods (must be boxed to call method)");
}
method add_multi_method($obj, $name, $code_obj) {
pir::die("Native types may not have methods (must be boxed to call method)");
}
method add_attribute($obj, $meta_attr) {
pir::die("Native types may not have attributes");
}
method compose($obj) {
$!composed := 1;
}
method name($obj) {
$!name
}
}
| 24.76 | 85 | 0.560582 |
ed1a9c03121da21da20a281d420ccc86fb8edcb4 | 2,212 | pm | Perl | lib/App/cpm/Resolver/Snapshot.pm | sklukin/cpm | f2d6193483d8d0450b706332a52665236204387a | [
"Artistic-1.0"
]
| 2 | 2018-12-07T17:38:10.000Z | 2021-02-16T09:22:14.000Z | lib/App/cpm/Resolver/Snapshot.pm | sklukin/cpm | f2d6193483d8d0450b706332a52665236204387a | [
"Artistic-1.0"
]
| 1 | 2020-01-13T18:23:26.000Z | 2020-01-13T18:23:26.000Z | lib/App/cpm/Resolver/Snapshot.pm | sklukin/cpm | f2d6193483d8d0450b706332a52665236204387a | [
"Artistic-1.0"
]
| 2 | 2018-12-27T07:34:43.000Z | 2020-07-13T16:42:37.000Z | package App::cpm::Resolver::Snapshot;
use strict;
use warnings;
use App::cpm::DistNotation;
use App::cpm::Git;
use App::cpm::Resolver::Git;
use App::cpm::version;
use Carton::Snapshot;
sub new {
my ($class, %option) = @_;
my $snapshot = Carton::Snapshot->new(path => $option{path} || "cpanfile.snapshot");
$snapshot->load;
my $mirror = $option{mirror} || ["https://cpan.metacpan.org/"];
s{/*$}{/} for @$mirror;
bless {
%option,
mirror => $mirror,
snapshot => $snapshot
}, $class;
}
sub snapshot { shift->{snapshot} }
sub resolve {
my ($self, $job) = @_;
my $package = $job->{package};
my $found = $self->snapshot->find($package);
if (!$found) {
return { error => "not found, @{[$self->snapshot->path]}" };
}
my $version = $found->version_for($package);
if (my $version_range = $job->{version_range}) {
if (!App::cpm::version->parse($version)->satisfy($version_range)) {
return { error => "found version $version, but it does not satisfy $version_range, @{[$self->snapshot->path]}" };
}
}
my @provides = map {
my $package = $_;
my $version = $found->provides->{$_}{version};
+{ package => $package, version => $version };
} sort keys %{$found->provides};
if (App::cpm::Git->is_git_uri($found->pathname)) {
my $uri = $found->pathname;
$uri =~ s/@(\p{IsXDigit}{40})$//;
my $rev = $1;
if (my ($want_rev) = App::cpm::Resolver::Git->fetch_rev($job->{uri}, $job->{ref})) {
return unless index($rev, $want_rev) == 0;
}
return {
source => "git",
uri => $uri,
ref => $job->{ref},
rev => $1,
version => $version || 0,
provides => \@provides,
};
} elsif ($job->{source} && $job->{source} eq 'git') {
return;
}
my $dist = App::cpm::DistNotation->new_from_dist($found->distfile);
return {
source => "cpan",
distfile => $dist->distfile,
uri => [map { $dist->cpan_uri($_) } @{$self->{mirror}}],
version => $version || 0,
provides => \@provides,
};
}
1;
| 28.727273 | 125 | 0.516727 |
ed1e3406a7a62c9d6799f592c0b9872532aaac56 | 1,036 | t | Perl | t/00-compile.t | git-the-cpan/MooseX-Blessed-Reconstruct | e2bfb253393f9d2f18316ab555b7aee220bed382 | [
"Artistic-1.0"
]
| null | null | null | t/00-compile.t | git-the-cpan/MooseX-Blessed-Reconstruct | e2bfb253393f9d2f18316ab555b7aee220bed382 | [
"Artistic-1.0"
]
| null | null | null | t/00-compile.t | git-the-cpan/MooseX-Blessed-Reconstruct | e2bfb253393f9d2f18316ab555b7aee220bed382 | [
"Artistic-1.0"
]
| null | null | null | use 5.006;
use strict;
use warnings;
# this test was generated with Dist::Zilla::Plugin::Test::Compile 2.046
use Test::More tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
my @module_files = (
'MooseX/Blessed/Reconstruct.pm'
);
# no fake home requested
my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib';
use File::Spec;
use IPC::Open3;
use IO::Handle;
open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
my @warnings;
for my $lib (@module_files)
{
# see L<perlfaq8/How can I capture STDERR from an external command?>
my $stderr = IO::Handle->new;
my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]");
binmode $stderr, ':crlf' if $^O eq 'MSWin32';
my @_warnings = <$stderr>;
waitpid($pid, 0);
is($?, 0, "$lib loaded ok");
if (@_warnings)
{
warn @_warnings;
push @warnings, @_warnings;
}
}
is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', explain \@warnings if $ENV{AUTHOR_TESTING};
| 20.313725 | 115 | 0.610039 |
73d68f39cc08ee8768488d1807084b9d331a75c8 | 6,878 | pl | Perl | windows/cperl/lib/unicore/lib/Gc/Lo.pl | SCOTT-HAMILTON/Monetcours | 66a2970218a31e9987a4e7eb37443c54f22e6825 | [
"MIT"
]
| null | null | null | windows/cperl/lib/unicore/lib/Gc/Lo.pl | SCOTT-HAMILTON/Monetcours | 66a2970218a31e9987a4e7eb37443c54f22e6825 | [
"MIT"
]
| null | null | null | windows/cperl/lib/unicore/lib/Gc/Lo.pl | SCOTT-HAMILTON/Monetcours | 66a2970218a31e9987a4e7eb37443c54f22e6825 | [
"MIT"
]
| null | null | null | # !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
# This file is machine-generated by ..\lib\unicore\mktables from the Unicode
# database, Version 12.1.0. Any changes made here will be lost!
# !!!!!!! INTERNAL PERL USE ONLY !!!!!!!
# This file is for internal use by core Perl only. The format and even the
# name or existence of this file are subject to change without notice. Don't
# use it directly. Use Unicode::UCD to access the Unicode character data
# base.
return <<'END';
V952
170
171
186
187
443
444
448
452
660
661
1488
1515
1519
1523
1568
1600
1601
1611
1646
1648
1649
1748
1749
1750
1774
1776
1786
1789
1791
1792
1808
1809
1810
1840
1869
1958
1969
1970
1994
2027
2048
2070
2112
2137
2144
2155
2208
2229
2230
2238
2308
2362
2365
2366
2384
2385
2392
2402
2418
2433
2437
2445
2447
2449
2451
2473
2474
2481
2482
2483
2486
2490
2493
2494
2510
2511
2524
2526
2527
2530
2544
2546
2556
2557
2565
2571
2575
2577
2579
2601
2602
2609
2610
2612
2613
2615
2616
2618
2649
2653
2654
2655
2674
2677
2693
2702
2703
2706
2707
2729
2730
2737
2738
2740
2741
2746
2749
2750
2768
2769
2784
2786
2809
2810
2821
2829
2831
2833
2835
2857
2858
2865
2866
2868
2869
2874
2877
2878
2908
2910
2911
2914
2929
2930
2947
2948
2949
2955
2958
2961
2962
2966
2969
2971
2972
2973
2974
2976
2979
2981
2984
2987
2990
3002
3024
3025
3077
3085
3086
3089
3090
3113
3114
3130
3133
3134
3160
3163
3168
3170
3200
3201
3205
3213
3214
3217
3218
3241
3242
3252
3253
3258
3261
3262
3294
3295
3296
3298
3313
3315
3333
3341
3342
3345
3346
3387
3389
3390
3406
3407
3412
3415
3423
3426
3450
3456
3461
3479
3482
3506
3507
3516
3517
3518
3520
3527
3585
3633
3634
3636
3648
3654
3713
3715
3716
3717
3718
3723
3724
3748
3749
3750
3751
3761
3762
3764
3773
3774
3776
3781
3804
3808
3840
3841
3904
3912
3913
3949
3976
3981
4096
4139
4159
4160
4176
4182
4186
4190
4193
4194
4197
4199
4206
4209
4213
4226
4238
4239
4352
4681
4682
4686
4688
4695
4696
4697
4698
4702
4704
4745
4746
4750
4752
4785
4786
4790
4792
4799
4800
4801
4802
4806
4808
4823
4824
4881
4882
4886
4888
4955
4992
5008
5121
5741
5743
5760
5761
5787
5792
5867
5873
5881
5888
5901
5902
5906
5920
5938
5952
5970
5984
5997
5998
6001
6016
6068
6108
6109
6176
6211
6212
6265
6272
6277
6279
6313
6314
6315
6320
6390
6400
6431
6480
6510
6512
6517
6528
6572
6576
6602
6656
6679
6688
6741
6917
6964
6981
6988
7043
7073
7086
7088
7098
7142
7168
7204
7245
7248
7258
7288
7401
7405
7406
7412
7413
7415
7418
7419
8501
8505
11568
11624
11648
11671
11680
11687
11688
11695
11696
11703
11704
11711
11712
11719
11720
11727
11728
11735
11736
11743
12294
12295
12348
12349
12353
12439
12447
12448
12449
12539
12543
12544
12549
12592
12593
12687
12704
12731
12784
12800
13312
19894
19968
40944
40960
40981
40982
42125
42192
42232
42240
42508
42512
42528
42538
42540
42606
42607
42656
42726
42895
42896
42999
43000
43003
43010
43011
43014
43015
43019
43020
43043
43072
43124
43138
43188
43250
43256
43259
43260
43261
43263
43274
43302
43312
43335
43360
43389
43396
43443
43488
43493
43495
43504
43514
43519
43520
43561
43584
43587
43588
43596
43616
43632
43633
43639
43642
43643
43646
43696
43697
43698
43701
43703
43705
43710
43712
43713
43714
43715
43739
43741
43744
43755
43762
43763
43777
43783
43785
43791
43793
43799
43808
43815
43816
43823
43968
44003
44032
55204
55216
55239
55243
55292
63744
64110
64112
64218
64285
64286
64287
64297
64298
64311
64312
64317
64318
64319
64320
64322
64323
64325
64326
64434
64467
64830
64848
64912
64914
64968
65008
65020
65136
65141
65142
65277
65382
65392
65393
65438
65440
65471
65474
65480
65482
65488
65490
65496
65498
65501
65536
65548
65549
65575
65576
65595
65596
65598
65599
65614
65616
65630
65664
65787
66176
66205
66208
66257
66304
66336
66349
66369
66370
66378
66384
66422
66432
66462
66464
66500
66504
66512
66640
66718
66816
66856
66864
66916
67072
67383
67392
67414
67424
67432
67584
67590
67592
67593
67594
67638
67639
67641
67644
67645
67647
67670
67680
67703
67712
67743
67808
67827
67828
67830
67840
67862
67872
67898
67968
68024
68030
68032
68096
68097
68112
68116
68117
68120
68121
68150
68192
68221
68224
68253
68288
68296
68297
68325
68352
68406
68416
68438
68448
68467
68480
68498
68608
68681
68864
68900
69376
69405
69415
69416
69424
69446
69600
69623
69635
69688
69763
69808
69840
69865
69891
69927
69956
69957
69968
70003
70006
70007
70019
70067
70081
70085
70106
70107
70108
70109
70144
70162
70163
70188
70272
70279
70280
70281
70282
70286
70287
70302
70303
70313
70320
70367
70405
70413
70415
70417
70419
70441
70442
70449
70450
70452
70453
70458
70461
70462
70480
70481
70493
70498
70656
70709
70727
70731
70751
70752
70784
70832
70852
70854
70855
70856
71040
71087
71128
71132
71168
71216
71236
71237
71296
71339
71352
71353
71424
71451
71680
71724
71935
71936
72096
72104
72106
72145
72161
72162
72163
72164
72192
72193
72203
72243
72250
72251
72272
72273
72284
72330
72349
72350
72384
72441
72704
72713
72714
72751
72768
72769
72818
72848
72960
72967
72968
72970
72971
73009
73030
73031
73056
73062
73063
73065
73066
73098
73112
73113
73440
73459
73728
74650
74880
75076
77824
78895
82944
83527
92160
92729
92736
92767
92880
92910
92928
92976
93027
93048
93053
93072
93952
94027
94032
94033
94208
100344
100352
101107
110592
110879
110928
110931
110948
110952
110960
111356
113664
113771
113776
113789
113792
113801
113808
113818
123136
123181
123214
123215
123584
123628
124928
125125
126464
126468
126469
126496
126497
126499
126500
126501
126503
126504
126505
126515
126516
126520
126521
126522
126523
126524
126530
126531
126535
126536
126537
126538
126539
126540
126541
126544
126545
126547
126548
126549
126551
126552
126553
126554
126555
126556
126557
126558
126559
126560
126561
126563
126564
126565
126567
126571
126572
126579
126580
126584
126585
126589
126590
126591
126592
126602
126603
126620
126625
126628
126629
126634
126635
126652
131072
173783
173824
177973
177984
178206
178208
183970
183984
191457
194560
195102
END
| 7.11272 | 78 | 0.698168 |
ed36de4c17db3b942fc46e4e731354910c856e40 | 2,100 | pl | Perl | test/experiment/bernoulli.pl | gfis/ramath | 400cb699d9271c90685d2005e5be0f6b12991619 | [
"ECL-2.0",
"Apache-2.0"
]
| 2 | 2020-10-13T07:59:31.000Z | 2022-03-26T06:05:20.000Z | test/experiment/bernoulli.pl | gfis/ramath | 400cb699d9271c90685d2005e5be0f6b12991619 | [
"ECL-2.0",
"Apache-2.0"
]
| null | null | null | test/experiment/bernoulli.pl | gfis/ramath | 400cb699d9271c90685d2005e5be0f6b12991619 | [
"ECL-2.0",
"Apache-2.0"
]
| null | null | null | #!/usr/bin/perl
#------------------------------------------------------------------
# Print Bernoulli numbers
# @(#) $Id: bernoulli.pl 221 2009-08-11 06:08:05Z gfis $
# 2009-06-26: Georg Fischer: copied from parm2.pl
# Usage:
# perl bernoulli.pl power maxpoly
#------------------------------------------------------------------
#
# Copyright 2009 Dr. Georg Fischer <punctum at punctum dot kom>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
use strict;
my $power = shift(@ARGV); # k = take the polynom to this exponent
my $maxpoly = shift(@ARGV); # m = degree of polynom
# determine coefficients of (xm + xm-1 + ... + x1 + x0)**k
my %hash = ();
my $level = 0;
&iterate("");
exit;
# ...
my $key;
foreach $key (sort(keys(%hash))) {
my $old;
my $new;
my @list = sort(split(/ /, $hash{$key}));
push (@list, "}}}}}}}}}}}}}}"); # high value
$old = $list[0];
my $ind = 1;
my $count = 1;
while ($ind < scalar(@list)) {
if ($old ne $new) { # control break
} else { # same
} # same
$old = $new;
$ind ++;
}
} # foreach
sub iterate {
my ($parm) = @_;
if ($level < $power) { # need more recursion
$level ++;
my $ind = 0;
while ($ind <= $maxpoly) {
&iterate("$parm $ind");
$ind ++
} # while $ind
$level --;
} else { # max. iteration level reached
my $sum = 0;
my @list = map {
$sum += $_;
$_
} sort{$b <=> $a} split(/\s/, substr($parm, 1));
my $elem = "x" . join("*x", @list) . "\t$sum";
&store($elem);
}
} # iterate
sub store {
my ($elem) = @_;
print "$elem\n";
} # store
| 25.301205 | 76 | 0.548095 |
73d0d27cbe53afb6d386cc0c157f9384c1f8080f | 1,275 | t | Perl | t/security-exceptions.t | gitpan/Mojolicious-Plugin-Images | a56f00d4ee91fb8b513cd26dd2d4dc5108cbeec2 | [
"Artistic-1.0"
]
| null | null | null | t/security-exceptions.t | gitpan/Mojolicious-Plugin-Images | a56f00d4ee91fb8b513cd26dd2d4dc5108cbeec2 | [
"Artistic-1.0"
]
| null | null | null | t/security-exceptions.t | gitpan/Mojolicious-Plugin-Images | a56f00d4ee91fb8b513cd26dd2d4dc5108cbeec2 | [
"Artistic-1.0"
]
| null | null | null | use Mojo::Base -strict;
BEGIN {
$ENV{MOJO_MODE} = 'testing';
$ENV{IMAGES_ALLOW_INSECURE_IDS} = 1;
$ENV{IMAGES_ALLOW_INSECURE_DIRS} = 1;
}
use Test::More;
use IO::All;
use Mojolicious;
use Mojolicious::Plugin::Images::Test ':all';
use Mojolicious::Plugin::Images::Util ':all';
my $tmpdir = io->tmpdir . "/images_tmp";
my $id = uniq_id;
my $options = {first => {dir => $tmpdir}};
my $app = Mojolicious->new;
$app->plugin('Images', $options);
my $c = $app->build_controller;
my $first = $c->images->first;
# IDS
foreach my $meth (qw(url canonpath exists read)) {
ok eval { $first->$meth('ff/../ff'); 1 }, "not died on insecure $meth";
}
ok eval { $first->write('ff/../ff', test_image); 1 },
"not died on insecure write";
ok eval { $first->upload('ff/../ff', test_upload); 1 },
"not died on insecure upload";
# dir is root /
foreach my $dir (('/', $app->home, '', undef)) {
$first->dir($dir);
foreach my $meth (qw(canonpath exists read)) {
ok eval { $first->$meth('ff'); 1 }, "not dead";
}
}
ok eval { expand_static('/images', '/images', $app); 1 }, "not dead";
ok eval { expand_static('/', '', $app); 1 }, "not dead";
ok eval { expand_static($app->home, '/', $app); 1 }, "not dead";
done_testing;
| 26.5625 | 73 | 0.592157 |
ed24e7817678b03c48c870e5f2d3041f1c03757d | 595 | pm | Perl | lib/Data/Object/Float/Func/Gt.pm | srchulo/do | d3c4ccecf33d1cf83d64b1c15666d0282a89e4f3 | [
"Apache-2.0"
]
| null | null | null | lib/Data/Object/Float/Func/Gt.pm | srchulo/do | d3c4ccecf33d1cf83d64b1c15666d0282a89e4f3 | [
"Apache-2.0"
]
| null | null | null | lib/Data/Object/Float/Func/Gt.pm | srchulo/do | d3c4ccecf33d1cf83d64b1c15666d0282a89e4f3 | [
"Apache-2.0"
]
| null | null | null | package Data::Object::Float::Func::Gt;
use 5.014;
use strict;
use warnings;
use Data::Object 'Class';
extends 'Data::Object::Float::Func';
# VERSION
# BUILD
has arg1 => (
is => 'ro',
isa => 'NumberLike',
req => 1
);
has arg2 => (
is => 'ro',
isa => 'StringLike',
req => 1
);
# METHODS
sub execute {
my ($self) = @_;
my ($arg1, $arg2) = $self->unpack;
unless (Scalar::Util::looks_like_number("$arg2")) {
return $self->throw("Argument is not number-like");
}
return (("$arg1" + 0) > ("$arg2" + 0)) ? 1 : 0;
}
sub mapping {
return ('arg1', 'arg2');
}
1;
| 12.395833 | 55 | 0.552941 |
ed49a068883686d34320df87669af78fc3666e54 | 2,036 | pm | Perl | cloud/aws/rds/plugin.pm | garnier-quentin/centreon-plugins | 51c16b4419d640709d3352a260e4cd63cd96db14 | [
"Apache-2.0"
]
| null | null | null | cloud/aws/rds/plugin.pm | garnier-quentin/centreon-plugins | 51c16b4419d640709d3352a260e4cd63cd96db14 | [
"Apache-2.0"
]
| null | null | null | cloud/aws/rds/plugin.pm | garnier-quentin/centreon-plugins | 51c16b4419d640709d3352a260e4cd63cd96db14 | [
"Apache-2.0"
]
| null | null | null | #
# Copyright 2018 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package cloud::aws::rds::plugin;
use strict;
use warnings;
use base qw(centreon::plugins::script_custom);
sub new {
my ( $class, %options ) = @_;
my $self = $class->SUPER::new( package => __PACKAGE__, %options );
bless $self, $class;
$self->{version} = '0.1';
%{ $self->{modes} } = (
'connections' => 'cloud::aws::rds::mode::connections',
'cpu' => 'cloud::aws::rds::mode::cpu',
'diskio' => 'cloud::aws::rds::mode::diskio',
'instance-status' => 'cloud::aws::rds::mode::instancestatus',
'list-clusters' => 'cloud::aws::rds::mode::listclusters',
'list-instances' => 'cloud::aws::rds::mode::listinstances',
'network' => 'cloud::aws::rds::mode::network',
'queries' => 'cloud::aws::rds::mode::queries',
'transactions' => 'cloud::aws::rds::mode::transactions',
'volume' => 'cloud::aws::rds::mode::volume',
);
$self->{custom_modes}{paws} = 'cloud::aws::custom::paws';
$self->{custom_modes}{awscli} = 'cloud::aws::custom::awscli';
return $self;
}
1;
__END__
=head1 PLUGIN DESCRIPTION
Check Amazon Relational Database Service (Amazon RDS).
=cut
| 33.933333 | 75 | 0.620334 |
73f9c09b4a61d0a541b2d2ff1654789ba24ed910 | 2,529 | pm | Perl | lib/Yancy/Plugin/Auth/Role/RequireUser.pm | kiwiroy/Yancy | 42111830eccb514f5dbacba2fb6b358d79bf1860 | [
"Artistic-1.0"
]
| null | null | null | lib/Yancy/Plugin/Auth/Role/RequireUser.pm | kiwiroy/Yancy | 42111830eccb514f5dbacba2fb6b358d79bf1860 | [
"Artistic-1.0"
]
| null | null | null | lib/Yancy/Plugin/Auth/Role/RequireUser.pm | kiwiroy/Yancy | 42111830eccb514f5dbacba2fb6b358d79bf1860 | [
"Artistic-1.0"
]
| null | null | null | package Yancy::Plugin::Auth::Role::RequireUser;
our $VERSION = '1.070';
# ABSTRACT: Add authorization based on user attributes
=head1 SYNOPSIS
use Mojolicious::Lite;
plugin Yancy => ...;
# Require any user
my $require_user = app->yancy->auth->require_user;
my $user = app->routes->under( '/user', $require_user );
# Require a user with the `is_admin` field set to true
my $require_admin = app->yancy->auth->require_user( { is_admin => 1 } );
my $admin = app->routes->under( '/admin', $require_admin );
=head1 DESCRIPTION
B<Note:> This module is C<EXPERIMENTAL> and its API may change before
Yancy v2.000 is released.
This plugin adds a simple authorization method to your site. All default
Yancy auth plugins use this role to provide the C<yancy.auth.require_user>
helper.
=head1 SEE ALSO
L<Yancy::Plugin::Auth>
=cut
use Mojo::Base '-role';
use Yancy::Util qw( currym match );
=method require_user
my $subref = $c->yancy->auth->require_user( \%match );
Build a callback to validate there is a logged-in user, and optionally
that the current user has certain fields set. C<\%match> is optional and
is a L<SQL::Abstract where clause|SQL::Abstract/WHERE CLAUSES> matched
with L<Yancy::Util/match>.
# Ensure the user is logged-in
my $user_cb = $app->yancy->auth->require_user;
my $user_only = $app->routes->under( $user_cb );
# Ensure the user's "is_admin" field is set to 1
my $admin_cb = $app->yancy->auth->require_user( { is_admin => 1 } );
my $admin_only = $app->routes->under( $admin_cb );
=cut
sub require_user {
my ( $self, $c, $where ) = @_;
return sub {
my ( $c ) = @_;
#; say "Are you authorized? " . $c->yancy->auth->current_user;
my $user = $c->yancy->auth->current_user;
# If where isn't specified, or it's a plain scalar truth value
if ( ( !$where || ( !ref $where && $where ) ) && $user ) {
return 1;
}
if ( $where && match( $where, $user ) ) {
return 1;
}
$c->stash(
template => 'yancy/auth/unauthorized',
status => 401,
logout_route => $self->logout_route->render,
);
$c->respond_to(
json => {},
html => {},
);
return undef;
};
}
around register => sub {
my ( $orig, $self, $app, $config ) = @_;
$app->helper(
'yancy.auth.require_user' => currym( $self, 'require_user' ),
);
$self->$orig( $app, $config );
};
1;
| 28.1 | 76 | 0.599842 |
ed1eb20ddfd577384dc043f0c06ff2f23bcdb811 | 4,199 | pm | Perl | Unit/INTOBILL.pm | greg-kennedy/dot_scr | 5d185d2322ba4dcf96407688ed553cad6054d15c | [
"Artistic-2.0"
]
| 24 | 2019-09-23T08:35:57.000Z | 2022-03-07T11:18:54.000Z | Unit/INTOBILL.pm | greg-kennedy/dot_scr | 5d185d2322ba4dcf96407688ed553cad6054d15c | [
"Artistic-2.0"
]
| null | null | null | Unit/INTOBILL.pm | greg-kennedy/dot_scr | 5d185d2322ba4dcf96407688ed553cad6054d15c | [
"Artistic-2.0"
]
| null | null | null | package Unit::INTOBILL;
use strict;
use warnings;
sub _pick { return $_[ rand @_ ]; }
# Opus n Bill Brain Saver
# based on Delrina Intermission 4.0
# Most modules are .ASA animation files, and don't
# need any config. For the rest, defaults are good.
# See ANTSW.INI in payload/WINDOWS.
my @modules = (
'OB-Basselope',
'OB-Brief Insights',
'OB-Bungee',
'OB-Death Toasters',
'OB-Fish Bowl',
'OB-Full Moon',
'OB-Microboost 10,000',
'OB-Night Cat',
'OB-Opus Clock',
'OB-Penguins',
'OB-Puddy Passion',
'OB-Quality Time',
'OB-Silicone Bill',
'OB-Swinger',
'OB-System Bugs',
'OB-Velociraptor',
);
# Info routine: return basic details about this module
sub info {
return (
name => 'INTOBILL',
fullname => "Opus 'n Bill Brain Saver",
author => 'Delrina Software',
payload => ['INTOBILL.zip'],
files => {
'WINDOWS/SYSTEM.INI' => \&edit_systemini,
'WINDOWS/WIN.INI' => \&edit_winini,
'WINDOWS/ANTSW.INI' => \&edit_antswini,
},
weight => scalar @modules,
);
}
# Create an instance of module.
# This should also generate settings for a specific run.
sub new {
my $class = shift;
my $basepath = shift;
# parse the module input file
# antsw.ini is annoying because it uses Saver Selected=offset
# into the Intermission Extensions list
# so we need the IDs...
my %data;
for (my $i = 0; $i < scalar @modules; $i ++)
{
$data{$modules[$i]}{offset} = $i;
}
open( my $fpi, '<:crlf', "$basepath/WINDOWS/ANTSW.INI" )
or die "Couldn't open antsw.ini: $!";
my $sec = '';
my $id = 0;
while ( my $line = <$fpi> ) {
if ( $line =~ m/\[Intermission Extensions\]/i ) {
$sec = 'ext';
} elsif ( $line =~ m/^\[/ ) {
$sec = '';
} elsif ( $sec eq 'ext' ) {
if ( $line =~ m/^(.+)=(.+)$/ ) {
my $ini_modfilename = $1;
my ( $ini_modunknown, $ini_modname ) = split /~/, $2;
if ( exists $data{$ini_modname} ) {
$data{$ini_modname}{id} = $id;
$data{$ini_modname}{filename} = $ini_modfilename;
} else {
print "Skipping unknown module $ini_modname ($ini_modfilename)\n";
}
$id++;
}
}
}
close $fpi;
# choose module (name)
my $module = _pick( keys %data );
if ( !defined $data{$module}{id} ) {
die "Error: selected module $module but no ID exists!";
}
my $self = {
module => $module,
module_file => $data{$module}{filename},
id => $data{$module}{id},
offset => $data{$module}{offset},
sound => 1,
dosbox => {
start => 8000,
# cycles => 5000
},
};
return bless( $self, $class );
}
# Return stringified version of settings
sub detail {
my $self = shift;
#module names all start with "DB-"
my $name = substr $self->{module}, 3;
return "Module: " . $name;
}
##############################################################################
sub edit_systemini {
my ( $self, $line ) = @_;
# append the 386 driver
if ( $line && $line =~ m/^\[386Enh\]$/i ) {
$line .= "\ndevice=ANTHOOK.386";
}
return $line;
}
sub edit_winini {
my ( $self, $line ) = @_;
if ( $line && $line =~ m/^load=(.*)$/ ) {
$line = "load=c:\\saver\\intermis.exe $1";
}
return $line;
}
sub edit_antswini {
my ( $self, $line ) = @_;
# AS FAR AS I KNOW, the only one of these necessary is Saver Offset.
# But set the rest anyway.
if ( $line ) {
if ( $line =~ m/^Saver Selected=/i ) {
$line = "Saver Selected=$self->{id}";
} elsif ($line =~ m/^Saver Offset=/i) {
$line = "Saver Offset=$self->{offset}"
} elsif ($line =~ m/^Last Saver=/i) {
$line = "Last Saver=$self->{module_file}"
} elsif ($line =~ m/^Last Module=/i) {
$line = "Last Module=$self->{module}"
}
}
return $line;
}
1;
| 25.603659 | 86 | 0.498214 |
ed1306fc6331b4daf68363b00b4cb917fa9a8f76 | 97,994 | pm | Perl | third_party/cygwin/lib/perl5/5.10/ExtUtils/MM_Unix.pm | riverar/v8 | 16397d242258b97f107e742e37cc585e77b9b3d0 | [
"BSD-3-Clause"
]
| 1 | 2021-07-29T03:46:04.000Z | 2021-07-29T03:46:04.000Z | third_party/cygwin/lib/perl5/5.10/ExtUtils/MM_Unix.pm | riverar/v8 | 16397d242258b97f107e742e37cc585e77b9b3d0 | [
"BSD-3-Clause"
]
| null | null | null | third_party/cygwin/lib/perl5/5.10/ExtUtils/MM_Unix.pm | riverar/v8 | 16397d242258b97f107e742e37cc585e77b9b3d0 | [
"BSD-3-Clause"
]
| null | null | null | package ExtUtils::MM_Unix;
require 5.006;
use strict;
use Carp;
use ExtUtils::MakeMaker::Config;
use File::Basename qw(basename dirname);
use DirHandle;
our %Config_Override;
use ExtUtils::MakeMaker qw($Verbose neatvalue);
# If we make $VERSION an our variable parse_version() breaks
use vars qw($VERSION);
$VERSION = '6.44';
require ExtUtils::MM_Any;
our @ISA = qw(ExtUtils::MM_Any);
my %Is;
BEGIN {
$Is{OS2} = $^O eq 'os2';
$Is{Win32} = $^O eq 'MSWin32' || $Config{osname} eq 'NetWare';
$Is{Dos} = $^O eq 'dos';
$Is{VMS} = $^O eq 'VMS';
$Is{OSF} = $^O eq 'dec_osf';
$Is{IRIX} = $^O eq 'irix';
$Is{NetBSD} = $^O eq 'netbsd';
$Is{Interix} = $^O eq 'interix';
$Is{SunOS4} = $^O eq 'sunos';
$Is{Solaris} = $^O eq 'solaris';
$Is{SunOS} = $Is{SunOS4} || $Is{Solaris};
$Is{BSD} = ($^O =~ /^(?:free|net|open)bsd$/ or
grep( $^O eq $_, qw(bsdos interix dragonfly) )
);
}
BEGIN {
if( $Is{VMS} ) {
# For things like vmsify()
require VMS::Filespec;
VMS::Filespec->import;
}
}
=head1 NAME
ExtUtils::MM_Unix - methods used by ExtUtils::MakeMaker
=head1 SYNOPSIS
C<require ExtUtils::MM_Unix;>
=head1 DESCRIPTION
The methods provided by this package are designed to be used in
conjunction with ExtUtils::MakeMaker. When MakeMaker writes a
Makefile, it creates one or more objects that inherit their methods
from a package C<MM>. MM itself doesn't provide any methods, but it
ISA ExtUtils::MM_Unix class. The inheritance tree of MM lets operating
specific packages take the responsibility for all the methods provided
by MM_Unix. We are trying to reduce the number of the necessary
overrides by defining rather primitive operations within
ExtUtils::MM_Unix.
If you are going to write a platform specific MM package, please try
to limit the necessary overrides to primitive methods, and if it is not
possible to do so, let's work out how to achieve that gain.
If you are overriding any of these methods in your Makefile.PL (in the
MY class), please report that to the makemaker mailing list. We are
trying to minimize the necessary method overrides and switch to data
driven Makefile.PLs wherever possible. In the long run less methods
will be overridable via the MY class.
=head1 METHODS
The following description of methods is still under
development. Please refer to the code for not suitably documented
sections and complain loudly to the makemaker@perl.org mailing list.
Better yet, provide a patch.
Not all of the methods below are overridable in a
Makefile.PL. Overridable methods are marked as (o). All methods are
overridable by a platform specific MM_*.pm file.
Cross-platform methods are being moved into MM_Any. If you can't find
something that used to be in here, look in MM_Any.
=cut
# So we don't have to keep calling the methods over and over again,
# we have these globals to cache the values. Faster and shrtr.
my $Curdir = __PACKAGE__->curdir;
my $Rootdir = __PACKAGE__->rootdir;
my $Updir = __PACKAGE__->updir;
=head2 Methods
=over 4
=item os_flavor
Simply says that we're Unix.
=cut
sub os_flavor {
return('Unix');
}
=item c_o (o)
Defines the suffix rules to compile different flavors of C files to
object files.
=cut
sub c_o {
# --- Translation Sections ---
my($self) = shift;
return '' unless $self->needs_linking();
my(@m);
my $command = '$(CCCMD)';
my $flags = '$(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE)';
if (my $cpp = $Config{cpprun}) {
my $cpp_cmd = $self->const_cccmd;
$cpp_cmd =~ s/^CCCMD\s*=\s*\$\(CC\)/$cpp/;
push @m, qq{
.c.i:
$cpp_cmd $flags \$*.c > \$*.i
};
}
push @m, qq{
.c.s:
$command -S $flags \$*.c
.c\$(OBJ_EXT):
$command $flags \$*.c
.cpp\$(OBJ_EXT):
$command $flags \$*.cpp
.cxx\$(OBJ_EXT):
$command $flags \$*.cxx
.cc\$(OBJ_EXT):
$command $flags \$*.cc
};
push @m, qq{
.C\$(OBJ_EXT):
$command \$*.C
} if !$Is{OS2} and !$Is{Win32} and !$Is{Dos}; #Case-specific
return join "", @m;
}
=item cflags (o)
Does very much the same as the cflags script in the perl
distribution. It doesn't return the whole compiler command line, but
initializes all of its parts. The const_cccmd method then actually
returns the definition of the CCCMD macro which uses these parts.
=cut
#'
sub cflags {
my($self,$libperl)=@_;
return $self->{CFLAGS} if $self->{CFLAGS};
return '' unless $self->needs_linking();
my($prog, $uc, $perltype, %cflags);
$libperl ||= $self->{LIBPERL_A} || "libperl$self->{LIB_EXT}" ;
$libperl =~ s/\.\$\(A\)$/$self->{LIB_EXT}/;
@cflags{qw(cc ccflags optimize shellflags)}
= @Config{qw(cc ccflags optimize shellflags)};
my($optdebug) = "";
$cflags{shellflags} ||= '';
my(%map) = (
D => '-DDEBUGGING',
E => '-DEMBED',
DE => '-DDEBUGGING -DEMBED',
M => '-DEMBED -DMULTIPLICITY',
DM => '-DDEBUGGING -DEMBED -DMULTIPLICITY',
);
if ($libperl =~ /libperl(\w*)\Q$self->{LIB_EXT}/){
$uc = uc($1);
} else {
$uc = ""; # avoid warning
}
$perltype = $map{$uc} ? $map{$uc} : "";
if ($uc =~ /^D/) {
$optdebug = "-g";
}
my($name);
( $name = $self->{NAME} . "_cflags" ) =~ s/:/_/g ;
if ($prog = $Config{$name}) {
# Expand hints for this extension via the shell
print STDOUT "Processing $name hint:\n" if $Verbose;
my(@o)=`cc=\"$cflags{cc}\"
ccflags=\"$cflags{ccflags}\"
optimize=\"$cflags{optimize}\"
perltype=\"$cflags{perltype}\"
optdebug=\"$cflags{optdebug}\"
eval '$prog'
echo cc=\$cc
echo ccflags=\$ccflags
echo optimize=\$optimize
echo perltype=\$perltype
echo optdebug=\$optdebug
`;
foreach my $line (@o){
chomp $line;
if ($line =~ /(.*?)=\s*(.*)\s*$/){
$cflags{$1} = $2;
print STDOUT " $1 = $2\n" if $Verbose;
} else {
print STDOUT "Unrecognised result from hint: '$line'\n";
}
}
}
if ($optdebug) {
$cflags{optimize} = $optdebug;
}
for (qw(ccflags optimize perltype)) {
$cflags{$_} ||= '';
$cflags{$_} =~ s/^\s+//;
$cflags{$_} =~ s/\s+/ /g;
$cflags{$_} =~ s/\s+$//;
$self->{uc $_} ||= $cflags{$_};
}
if ($self->{POLLUTE}) {
$self->{CCFLAGS} .= ' -DPERL_POLLUTE ';
}
my $pollute = '';
if ($Config{usemymalloc} and not $Config{bincompat5005}
and not $Config{ccflags} =~ /-DPERL_POLLUTE_MALLOC\b/
and $self->{PERL_MALLOC_OK}) {
$pollute = '$(PERL_MALLOC_DEF)';
}
$self->{CCFLAGS} = quote_paren($self->{CCFLAGS});
$self->{OPTIMIZE} = quote_paren($self->{OPTIMIZE});
return $self->{CFLAGS} = qq{
CCFLAGS = $self->{CCFLAGS}
OPTIMIZE = $self->{OPTIMIZE}
PERLTYPE = $self->{PERLTYPE}
MPOLLUTE = $pollute
};
}
=item const_cccmd (o)
Returns the full compiler call for C programs and stores the
definition in CONST_CCCMD.
=cut
sub const_cccmd {
my($self,$libperl)=@_;
return $self->{CONST_CCCMD} if $self->{CONST_CCCMD};
return '' unless $self->needs_linking();
return $self->{CONST_CCCMD} =
q{CCCMD = $(CC) -c $(PASTHRU_INC) $(INC) \\
$(CCFLAGS) $(OPTIMIZE) \\
$(PERLTYPE) $(MPOLLUTE) $(DEFINE_VERSION) \\
$(XS_DEFINE_VERSION)};
}
=item const_config (o)
Defines a couple of constants in the Makefile that are imported from
%Config.
=cut
sub const_config {
# --- Constants Sections ---
my($self) = shift;
my @m = <<"END";
# These definitions are from config.sh (via $INC{'Config.pm'}).
# They may have been overridden via Makefile.PL or on the command line.
END
my(%once_only);
foreach my $key (@{$self->{CONFIG}}){
# SITE*EXP macros are defined in &constants; avoid duplicates here
next if $once_only{$key};
$self->{uc $key} = quote_paren($self->{uc $key});
push @m, uc($key) , ' = ' , $self->{uc $key}, "\n";
$once_only{$key} = 1;
}
join('', @m);
}
=item const_loadlibs (o)
Defines EXTRALIBS, LDLOADLIBS, BSLOADLIBS, LD_RUN_PATH. See
L<ExtUtils::Liblist> for details.
=cut
sub const_loadlibs {
my($self) = shift;
return "" unless $self->needs_linking;
my @m;
push @m, qq{
# $self->{NAME} might depend on some other libraries:
# See ExtUtils::Liblist for details
#
};
for my $tmp (qw/
EXTRALIBS LDLOADLIBS BSLOADLIBS
/) {
next unless defined $self->{$tmp};
push @m, "$tmp = $self->{$tmp}\n";
}
# don't set LD_RUN_PATH if empty
for my $tmp (qw/
LD_RUN_PATH
/) {
next unless $self->{$tmp};
push @m, "$tmp = $self->{$tmp}\n";
}
return join "", @m;
}
=item constants (o)
my $make_frag = $mm->constants;
Prints out macros for lots of constants.
=cut
sub constants {
my($self) = @_;
my @m = ();
$self->{DFSEP} = '$(DIRFILESEP)'; # alias for internal use
for my $macro (qw(
AR_STATIC_ARGS DIRFILESEP DFSEP
NAME NAME_SYM
VERSION VERSION_MACRO VERSION_SYM DEFINE_VERSION
XS_VERSION XS_VERSION_MACRO XS_DEFINE_VERSION
INST_ARCHLIB INST_SCRIPT INST_BIN INST_LIB
INST_MAN1DIR INST_MAN3DIR
MAN1EXT MAN3EXT
INSTALLDIRS INSTALL_BASE DESTDIR PREFIX
PERLPREFIX SITEPREFIX VENDORPREFIX
),
(map { ("INSTALL".$_,
"DESTINSTALL".$_)
} $self->installvars),
qw(
PERL_LIB
PERL_ARCHLIB
LIBPERL_A MYEXTLIB
FIRST_MAKEFILE MAKEFILE_OLD MAKE_APERL_FILE
PERLMAINCC PERL_SRC PERL_INC
PERL FULLPERL ABSPERL
PERLRUN FULLPERLRUN ABSPERLRUN
PERLRUNINST FULLPERLRUNINST ABSPERLRUNINST
PERL_CORE
PERM_RW PERM_RWX
) )
{
next unless defined $self->{$macro};
# pathnames can have sharp signs in them; escape them so
# make doesn't think it is a comment-start character.
$self->{$macro} =~ s/#/\\#/g;
push @m, "$macro = $self->{$macro}\n";
}
push @m, qq{
MAKEMAKER = $self->{MAKEMAKER}
MM_VERSION = $self->{MM_VERSION}
MM_REVISION = $self->{MM_REVISION}
};
push @m, q{
# FULLEXT = Pathname for extension directory (eg Foo/Bar/Oracle).
# BASEEXT = Basename part of FULLEXT. May be just equal FULLEXT. (eg Oracle)
# PARENT_NAME = NAME without BASEEXT and no trailing :: (eg Foo::Bar)
# DLBASE = Basename part of dynamic library. May be just equal BASEEXT.
};
for my $macro (qw/
MAKE
FULLEXT BASEEXT PARENT_NAME DLBASE VERSION_FROM INC DEFINE OBJECT
LDFROM LINKTYPE BOOTDEP
/ )
{
next unless defined $self->{$macro};
push @m, "$macro = $self->{$macro}\n";
}
push @m, "
# Handy lists of source code files:
XS_FILES = ".$self->wraplist(sort keys %{$self->{XS}})."
C_FILES = ".$self->wraplist(@{$self->{C}})."
O_FILES = ".$self->wraplist(@{$self->{O_FILES}})."
H_FILES = ".$self->wraplist(@{$self->{H}})."
MAN1PODS = ".$self->wraplist(sort keys %{$self->{MAN1PODS}})."
MAN3PODS = ".$self->wraplist(sort keys %{$self->{MAN3PODS}})."
";
push @m, q{
# Where is the Config information that we are using/depend on
CONFIGDEP = $(PERL_ARCHLIB)$(DFSEP)Config.pm $(PERL_INC)$(DFSEP)config.h
};
push @m, qq{
# Where to build things
INST_LIBDIR = $self->{INST_LIBDIR}
INST_ARCHLIBDIR = $self->{INST_ARCHLIBDIR}
INST_AUTODIR = $self->{INST_AUTODIR}
INST_ARCHAUTODIR = $self->{INST_ARCHAUTODIR}
INST_STATIC = $self->{INST_STATIC}
INST_DYNAMIC = $self->{INST_DYNAMIC}
INST_BOOT = $self->{INST_BOOT}
};
push @m, qq{
# Extra linker info
EXPORT_LIST = $self->{EXPORT_LIST}
PERL_ARCHIVE = $self->{PERL_ARCHIVE}
PERL_ARCHIVE_AFTER = $self->{PERL_ARCHIVE_AFTER}
};
push @m, "
TO_INST_PM = ".$self->wraplist(sort keys %{$self->{PM}})."
PM_TO_BLIB = ".$self->wraplist(%{$self->{PM}})."
";
join('',@m);
}
=item depend (o)
Same as macro for the depend attribute.
=cut
sub depend {
my($self,%attribs) = @_;
my(@m,$key,$val);
while (($key,$val) = each %attribs){
last unless defined $key;
push @m, "$key : $val\n";
}
join "", @m;
}
=item init_DEST
$mm->init_DEST
Defines the DESTDIR and DEST* variables paralleling the INSTALL*.
=cut
sub init_DEST {
my $self = shift;
# Initialize DESTDIR
$self->{DESTDIR} ||= '';
# Make DEST variables.
foreach my $var ($self->installvars) {
my $destvar = 'DESTINSTALL'.$var;
$self->{$destvar} ||= '$(DESTDIR)$(INSTALL'.$var.')';
}
}
=item init_dist
$mm->init_dist;
Defines a lot of macros for distribution support.
macro description default
TAR tar command to use tar
TARFLAGS flags to pass to TAR cvf
ZIP zip command to use zip
ZIPFLAGS flags to pass to ZIP -r
COMPRESS compression command to gzip --best
use for tarfiles
SUFFIX suffix to put on .gz
compressed files
SHAR shar command to use shar
PREOP extra commands to run before
making the archive
POSTOP extra commands to run after
making the archive
TO_UNIX a command to convert linefeeds
to Unix style in your archive
CI command to checkin your ci -u
sources to version control
RCS_LABEL command to label your sources rcs -Nv$(VERSION_SYM): -q
just after CI is run
DIST_CP $how argument to manicopy() best
when the distdir is created
DIST_DEFAULT default target to use to tardist
create a distribution
DISTVNAME name of the resulting archive $(DISTNAME)-$(VERSION)
(minus suffixes)
=cut
sub init_dist {
my $self = shift;
$self->{TAR} ||= 'tar';
$self->{TARFLAGS} ||= 'cvf';
$self->{ZIP} ||= 'zip';
$self->{ZIPFLAGS} ||= '-r';
$self->{COMPRESS} ||= 'gzip --best';
$self->{SUFFIX} ||= '.gz';
$self->{SHAR} ||= 'shar';
$self->{PREOP} ||= '$(NOECHO) $(NOOP)'; # eg update MANIFEST
$self->{POSTOP} ||= '$(NOECHO) $(NOOP)'; # eg remove the distdir
$self->{TO_UNIX} ||= '$(NOECHO) $(NOOP)';
$self->{CI} ||= 'ci -u';
$self->{RCS_LABEL}||= 'rcs -Nv$(VERSION_SYM): -q';
$self->{DIST_CP} ||= 'best';
$self->{DIST_DEFAULT} ||= 'tardist';
($self->{DISTNAME} = $self->{NAME}) =~ s{::}{-}g unless $self->{DISTNAME};
$self->{DISTVNAME} ||= $self->{DISTNAME}.'-'.$self->{VERSION};
}
=item dist (o)
my $dist_macros = $mm->dist(%overrides);
Generates a make fragment defining all the macros initialized in
init_dist.
%overrides can be used to override any of the above.
=cut
sub dist {
my($self, %attribs) = @_;
my $make = '';
foreach my $key (qw(
TAR TARFLAGS ZIP ZIPFLAGS COMPRESS SUFFIX SHAR
PREOP POSTOP TO_UNIX
CI RCS_LABEL DIST_CP DIST_DEFAULT
DISTNAME DISTVNAME
))
{
my $value = $attribs{$key} || $self->{$key};
$make .= "$key = $value\n";
}
return $make;
}
=item dist_basics (o)
Defines the targets distclean, distcheck, skipcheck, manifest, veryclean.
=cut
sub dist_basics {
my($self) = shift;
return <<'MAKE_FRAG';
distclean :: realclean distcheck
$(NOECHO) $(NOOP)
distcheck :
$(PERLRUN) "-MExtUtils::Manifest=fullcheck" -e fullcheck
skipcheck :
$(PERLRUN) "-MExtUtils::Manifest=skipcheck" -e skipcheck
manifest :
$(PERLRUN) "-MExtUtils::Manifest=mkmanifest" -e mkmanifest
veryclean : realclean
$(RM_F) *~ */*~ *.orig */*.orig *.bak */*.bak *.old */*.old
MAKE_FRAG
}
=item dist_ci (o)
Defines a check in target for RCS.
=cut
sub dist_ci {
my($self) = shift;
return q{
ci :
$(PERLRUN) "-MExtUtils::Manifest=maniread" \\
-e "@all = keys %{ maniread() };" \\
-e "print(qq{Executing $(CI) @all\n}); system(qq{$(CI) @all});" \\
-e "print(qq{Executing $(RCS_LABEL) ...\n}); system(qq{$(RCS_LABEL) @all});"
};
}
=item dist_core (o)
my $dist_make_fragment = $MM->dist_core;
Puts the targets necessary for 'make dist' together into one make
fragment.
=cut
sub dist_core {
my($self) = shift;
my $make_frag = '';
foreach my $target (qw(dist tardist uutardist tarfile zipdist zipfile
shdist))
{
my $method = $target.'_target';
$make_frag .= "\n";
$make_frag .= $self->$method();
}
return $make_frag;
}
=item B<dist_target>
my $make_frag = $MM->dist_target;
Returns the 'dist' target to make an archive for distribution. This
target simply checks to make sure the Makefile is up-to-date and
depends on $(DIST_DEFAULT).
=cut
sub dist_target {
my($self) = shift;
my $date_check = $self->oneliner(<<'CODE', ['-l']);
print 'Warning: Makefile possibly out of date with $(VERSION_FROM)'
if -e '$(VERSION_FROM)' and -M '$(VERSION_FROM)' < -M '$(FIRST_MAKEFILE)';
CODE
return sprintf <<'MAKE_FRAG', $date_check;
dist : $(DIST_DEFAULT) $(FIRST_MAKEFILE)
$(NOECHO) %s
MAKE_FRAG
}
=item B<tardist_target>
my $make_frag = $MM->tardist_target;
Returns the 'tardist' target which is simply so 'make tardist' works.
The real work is done by the dynamically named tardistfile_target()
method, tardist should have that as a dependency.
=cut
sub tardist_target {
my($self) = shift;
return <<'MAKE_FRAG';
tardist : $(DISTVNAME).tar$(SUFFIX)
$(NOECHO) $(NOOP)
MAKE_FRAG
}
=item B<zipdist_target>
my $make_frag = $MM->zipdist_target;
Returns the 'zipdist' target which is simply so 'make zipdist' works.
The real work is done by the dynamically named zipdistfile_target()
method, zipdist should have that as a dependency.
=cut
sub zipdist_target {
my($self) = shift;
return <<'MAKE_FRAG';
zipdist : $(DISTVNAME).zip
$(NOECHO) $(NOOP)
MAKE_FRAG
}
=item B<tarfile_target>
my $make_frag = $MM->tarfile_target;
The name of this target is the name of the tarball generated by
tardist. This target does the actual work of turning the distdir into
a tarball.
=cut
sub tarfile_target {
my($self) = shift;
return <<'MAKE_FRAG';
$(DISTVNAME).tar$(SUFFIX) : distdir
$(PREOP)
$(TO_UNIX)
$(TAR) $(TARFLAGS) $(DISTVNAME).tar $(DISTVNAME)
$(RM_RF) $(DISTVNAME)
$(COMPRESS) $(DISTVNAME).tar
$(POSTOP)
MAKE_FRAG
}
=item zipfile_target
my $make_frag = $MM->zipfile_target;
The name of this target is the name of the zip file generated by
zipdist. This target does the actual work of turning the distdir into
a zip file.
=cut
sub zipfile_target {
my($self) = shift;
return <<'MAKE_FRAG';
$(DISTVNAME).zip : distdir
$(PREOP)
$(ZIP) $(ZIPFLAGS) $(DISTVNAME).zip $(DISTVNAME)
$(RM_RF) $(DISTVNAME)
$(POSTOP)
MAKE_FRAG
}
=item uutardist_target
my $make_frag = $MM->uutardist_target;
Converts the tarfile into a uuencoded file
=cut
sub uutardist_target {
my($self) = shift;
return <<'MAKE_FRAG';
uutardist : $(DISTVNAME).tar$(SUFFIX)
uuencode $(DISTVNAME).tar$(SUFFIX) $(DISTVNAME).tar$(SUFFIX) > $(DISTVNAME).tar$(SUFFIX)_uu
MAKE_FRAG
}
=item shdist_target
my $make_frag = $MM->shdist_target;
Converts the distdir into a shell archive.
=cut
sub shdist_target {
my($self) = shift;
return <<'MAKE_FRAG';
shdist : distdir
$(PREOP)
$(SHAR) $(DISTVNAME) > $(DISTVNAME).shar
$(RM_RF) $(DISTVNAME)
$(POSTOP)
MAKE_FRAG
}
=item dlsyms (o)
Used by some OS' to define DL_FUNCS and DL_VARS and write the *.exp files.
Normally just returns an empty string.
=cut
sub dlsyms {
return '';
}
=item dynamic_bs (o)
Defines targets for bootstrap files.
=cut
sub dynamic_bs {
my($self, %attribs) = @_;
return '
BOOTSTRAP =
' unless $self->has_link_code();
my $target = $Is{VMS} ? '$(MMS$TARGET)' : '$@';
return sprintf <<'MAKE_FRAG', ($target) x 5;
BOOTSTRAP = $(BASEEXT).bs
# As Mkbootstrap might not write a file (if none is required)
# we use touch to prevent make continually trying to remake it.
# BOOTSTRAP only gets installed if non-empty.
$(BOOTSTRAP) : $(FIRST_MAKEFILE) $(BOOTDEP) $(INST_ARCHAUTODIR)$(DFSEP).exists
$(NOECHO) $(ECHO) "Running Mkbootstrap for $(NAME) ($(BSLOADLIBS))"
$(NOECHO) $(PERLRUN) \
"-MExtUtils::Mkbootstrap" \
-e "Mkbootstrap('$(BASEEXT)','$(BSLOADLIBS)');"
$(NOECHO) $(TOUCH) %s
$(CHMOD) $(PERM_RW) %s
MAKE_FRAG
}
=item dynamic_lib (o)
Defines how to produce the *.so (or equivalent) files.
=cut
sub dynamic_lib {
my($self, %attribs) = @_;
return '' unless $self->needs_linking(); #might be because of a subdir
return '' unless $self->has_link_code;
my($otherldflags) = $attribs{OTHERLDFLAGS} || "";
my($inst_dynamic_dep) = $attribs{INST_DYNAMIC_DEP} || "";
my($armaybe) = $attribs{ARMAYBE} || $self->{ARMAYBE} || ":";
my($ldfrom) = '$(LDFROM)';
$armaybe = 'ar' if ($Is{OSF} and $armaybe eq ':');
my(@m);
my $ld_opt = $Is{OS2} ? '$(OPTIMIZE) ' : ''; # Useful on other systems too?
my $ld_fix = $Is{OS2} ? '|| ( $(RM_F) $@ && sh -c false )' : '';
push(@m,'
# This section creates the dynamically loadable $(INST_DYNAMIC)
# from $(OBJECT) and possibly $(MYEXTLIB).
ARMAYBE = '.$armaybe.'
OTHERLDFLAGS = '.$ld_opt.$otherldflags.'
INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
INST_DYNAMIC_FIX = '.$ld_fix.'
$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVE) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
');
if ($armaybe ne ':'){
$ldfrom = 'tmp$(LIB_EXT)';
push(@m,' $(ARMAYBE) cr '.$ldfrom.' $(OBJECT)'."\n");
push(@m,' $(RANLIB) '."$ldfrom\n");
}
$ldfrom = "-all $ldfrom -none" if $Is{OSF};
# The IRIX linker doesn't use LD_RUN_PATH
my $ldrun = $Is{IRIX} && $self->{LD_RUN_PATH} ?
qq{-rpath "$self->{LD_RUN_PATH}"} : '';
# For example in AIX the shared objects/libraries from previous builds
# linger quite a while in the shared dynalinker cache even when nobody
# is using them. This is painful if one for instance tries to restart
# a failed build because the link command will fail unnecessarily 'cos
# the shared object/library is 'busy'.
push(@m,' $(RM_F) $@
');
my $libs = '$(LDLOADLIBS)';
if (($Is{NetBSD} || $Is{Interix}) && $Config{'useshrplib'} eq 'true') {
# Use nothing on static perl platforms, and to the flags needed
# to link against the shared libperl library on shared perl
# platforms. We peek at lddlflags to see if we need -Wl,-R
# or -R to add paths to the run-time library search path.
if ($Config{'lddlflags'} =~ /-Wl,-R/) {
$libs .= ' -L$(PERL_INC) -Wl,-R$(INSTALLARCHLIB)/CORE -Wl,-R$(PERL_ARCHLIB)/CORE -lperl';
} elsif ($Config{'lddlflags'} =~ /-R/) {
$libs .= ' -L$(PERL_INC) -R$(INSTALLARCHLIB)/CORE -R$(PERL_ARCHLIB)/CORE -lperl';
}
}
my $ld_run_path_shell = "";
if ($self->{LD_RUN_PATH} ne "") {
$ld_run_path_shell = 'LD_RUN_PATH="$(LD_RUN_PATH)" ';
}
push @m, sprintf <<'MAKE', $ld_run_path_shell, $ldrun, $ldfrom, $libs;
%s$(LD) %s $(LDDLFLAGS) %s $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) \
$(PERL_ARCHIVE) %s $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST) \
$(INST_DYNAMIC_FIX)
MAKE
# copy .bs only if non-empty
push @m, <<'MAKE';
$(CHMOD) $(PERM_RWX) $@
$(NOECHO) $(RM_RF) $(BOOTSTRAP)
- $(TEST_S) $(BOOTSTRAP) && $(CP) $(BOOTSTRAP) $(INST_BOOT) && \
$(CHMOD) $(PERM_RW) $(INST_BOOT)
MAKE
return join('',@m);
}
=item exescan
Deprecated method. Use libscan instead.
=cut
sub exescan {
my($self,$path) = @_;
$path;
}
=item extliblist
Called by init_others, and calls ext ExtUtils::Liblist. See
L<ExtUtils::Liblist> for details.
=cut
sub extliblist {
my($self,$libs) = @_;
require ExtUtils::Liblist;
$self->ext($libs, $Verbose);
}
=item find_perl
Finds the executables PERL and FULLPERL
=cut
sub find_perl {
my($self, $ver, $names, $dirs, $trace) = @_;
if ($trace >= 2){
print "Looking for perl $ver by these names:
@$names
in these dirs:
@$dirs
";
}
my $stderr_duped = 0;
local *STDERR_COPY;
unless ($Is{BSD}) {
# >& and lexical filehandles together give 5.6.2 indigestion
if( open(STDERR_COPY, '>&STDERR') ) { ## no critic
$stderr_duped = 1;
}
else {
warn <<WARNING;
find_perl() can't dup STDERR: $!
You might see some garbage while we search for Perl
WARNING
}
}
foreach my $name (@$names){
foreach my $dir (@$dirs){
next unless defined $dir; # $self->{PERL_SRC} may be undefined
my ($abs, $val);
if ($self->file_name_is_absolute($name)) { # /foo/bar
$abs = $name;
} elsif ($self->canonpath($name) eq
$self->canonpath(basename($name))) { # foo
$abs = $self->catfile($dir, $name);
} else { # foo/bar
$abs = $self->catfile($Curdir, $name);
}
print "Checking $abs\n" if ($trace >= 2);
next unless $self->maybe_command($abs);
print "Executing $abs\n" if ($trace >= 2);
my $version_check = qq{$abs -le "require $ver; print qq{VER_OK}"};
$version_check = "$Config{run} $version_check"
if defined $Config{run} and length $Config{run};
# To avoid using the unportable 2>&1 to suppress STDERR,
# we close it before running the command.
# However, thanks to a thread library bug in many BSDs
# ( http://www.freebsd.org/cgi/query-pr.cgi?pr=51535 )
# we cannot use the fancier more portable way in here
# but instead need to use the traditional 2>&1 construct.
if ($Is{BSD}) {
$val = `$version_check 2>&1`;
} else {
close STDERR if $stderr_duped;
$val = `$version_check`;
# 5.6.2's 3-arg open doesn't work with >&
open STDERR, ">&STDERR_COPY" ## no critic
if $stderr_duped;
}
if ($val =~ /^VER_OK/m) {
print "Using PERL=$abs\n" if $trace;
return $abs;
} elsif ($trace >= 2) {
print "Result: '$val' ".($? >> 8)."\n";
}
}
}
print STDOUT "Unable to find a perl $ver (by these names: @$names, in these dirs: @$dirs)\n";
0; # false and not empty
}
=item fixin
$mm->fixin(@files);
Inserts the sharpbang or equivalent magic number to a set of @files.
=cut
sub fixin { # stolen from the pink Camel book, more or less
my ( $self, @files ) = @_;
my ($does_shbang) = $Config{'sharpbang'} =~ /^\s*\#\!/;
for my $file (@files) {
my $file_new = "$file.new";
my $file_bak = "$file.bak";
open( my $fixin, '<', $file ) or croak "Can't process '$file': $!";
local $/ = "\n";
chomp( my $line = <$fixin> );
next unless $line =~ s/^\s*\#!\s*//; # Not a shbang file.
# Now figure out the interpreter name.
my ( $cmd, $arg ) = split ' ', $line, 2;
$cmd =~ s!^.*/!!;
# Now look (in reverse) for interpreter in absolute PATH (unless perl).
my $interpreter;
if ( $cmd eq "perl" ) {
if ( $Config{startperl} =~ m,^\#!.*/perl, ) {
$interpreter = $Config{startperl};
$interpreter =~ s,^\#!,,;
}
else {
$interpreter = $Config{perlpath};
}
}
else {
my (@absdirs)
= reverse grep { $self->file_name_is_absolute } $self->path;
$interpreter = '';
foreach my $dir (@absdirs) {
if ( $self->maybe_command($cmd) ) {
warn "Ignoring $interpreter in $file\n"
if $Verbose && $interpreter;
$interpreter = $self->catfile( $dir, $cmd );
}
}
}
# Figure out how to invoke interpreter on this machine.
my ($shb) = "";
if ($interpreter) {
print STDOUT "Changing sharpbang in $file to $interpreter"
if $Verbose;
# this is probably value-free on DOSISH platforms
if ($does_shbang) {
$shb .= "$Config{'sharpbang'}$interpreter";
$shb .= ' ' . $arg if defined $arg;
$shb .= "\n";
}
$shb .= qq{
eval 'exec $interpreter $arg -S \$0 \${1+"\$\@"}'
if 0; # not running under some shell
} unless $Is{Win32}; # this won't work on win32, so don't
}
else {
warn "Can't find $cmd in PATH, $file unchanged"
if $Verbose;
next;
}
open( my $fixout, ">", "$file_new" ) or do {
warn "Can't create new $file: $!\n";
next;
};
# Print out the new #! line (or equivalent).
local $\;
local $/;
print $fixout $shb, <$fixin>;
close $fixin;
close $fixout;
chmod 0666, $file_bak;
unlink $file_bak;
unless ( _rename( $file, $file_bak ) ) {
warn "Can't rename $file to $file_bak: $!";
next;
}
unless ( _rename( $file_new, $file ) ) {
warn "Can't rename $file_new to $file: $!";
unless ( _rename( $file_bak, $file ) ) {
warn "Can't rename $file_bak back to $file either: $!";
warn "Leaving $file renamed as $file_bak\n";
}
next;
}
unlink $file_bak;
}
continue {
system("$Config{'eunicefix'} $file") if $Config{'eunicefix'} ne ':';
}
}
sub _rename {
my($old, $new) = @_;
foreach my $file ($old, $new) {
if( $Is{VMS} and basename($file) !~ /\./ ) {
# rename() in 5.8.0 on VMS will not rename a file if it
# does not contain a dot yet it returns success.
$file = "$file.";
}
}
return rename($old, $new);
}
=item force (o)
Writes an empty FORCE: target.
=cut
sub force {
my($self) = shift;
'# Phony target to force checking subdirectories.
FORCE :
$(NOECHO) $(NOOP)
';
}
=item guess_name
Guess the name of this package by examining the working directory's
name. MakeMaker calls this only if the developer has not supplied a
NAME attribute.
=cut
# ';
sub guess_name {
my($self) = @_;
use Cwd 'cwd';
my $name = basename(cwd());
$name =~ s|[\-_][\d\.\-]+\z||; # this is new with MM 5.00, we
# strip minus or underline
# followed by a float or some such
print "Warning: Guessing NAME [$name] from current directory name.\n";
$name;
}
=item has_link_code
Returns true if C, XS, MYEXTLIB or similar objects exist within this
object that need a compiler. Does not descend into subdirectories as
needs_linking() does.
=cut
sub has_link_code {
my($self) = shift;
return $self->{HAS_LINK_CODE} if defined $self->{HAS_LINK_CODE};
if ($self->{OBJECT} or @{$self->{C} || []} or $self->{MYEXTLIB}){
$self->{HAS_LINK_CODE} = 1;
return 1;
}
return $self->{HAS_LINK_CODE} = 0;
}
=item init_dirscan
Scans the directory structure and initializes DIR, XS, XS_FILES,
C, C_FILES, O_FILES, H, H_FILES, PL_FILES, EXE_FILES.
Called by init_main.
=cut
sub init_dirscan { # --- File and Directory Lists (.xs .pm .pod etc)
my($self) = @_;
my(%dir, %xs, %c, %h, %pl_files, %pm);
my %ignore = map {( $_ => 1 )} qw(Makefile.PL Build.PL test.pl t);
# ignore the distdir
$Is{VMS} ? $ignore{"$self->{DISTVNAME}.dir"} = 1
: $ignore{$self->{DISTVNAME}} = 1;
@ignore{map lc, keys %ignore} = values %ignore if $Is{VMS};
foreach my $name ($self->lsdir($Curdir)){
next if $name =~ /\#/;
next if $name eq $Curdir or $name eq $Updir or $ignore{$name};
next unless $self->libscan($name);
if (-d $name){
next if -l $name; # We do not support symlinks at all
next if $self->{NORECURS};
$dir{$name} = $name if (-f $self->catfile($name,"Makefile.PL"));
} elsif ($name =~ /\.xs\z/){
my($c); ($c = $name) =~ s/\.xs\z/.c/;
$xs{$name} = $c;
$c{$c} = 1;
} elsif ($name =~ /\.c(pp|xx|c)?\z/i){ # .c .C .cpp .cxx .cc
$c{$name} = 1
unless $name =~ m/perlmain\.c/; # See MAP_TARGET
} elsif ($name =~ /\.h\z/i){
$h{$name} = 1;
} elsif ($name =~ /\.PL\z/) {
($pl_files{$name} = $name) =~ s/\.PL\z// ;
} elsif (($Is{VMS} || $Is{Dos}) && $name =~ /[._]pl$/i) {
# case-insensitive filesystem, one dot per name, so foo.h.PL
# under Unix appears as foo.h_pl under VMS or fooh.pl on Dos
local($/); open(my $pl, '<', $name); my $txt = <$pl>; close $pl;
if ($txt =~ /Extracting \S+ \(with variable substitutions/) {
($pl_files{$name} = $name) =~ s/[._]pl\z//i ;
}
else {
$pm{$name} = $self->catfile($self->{INST_LIBDIR},$name);
}
} elsif ($name =~ /\.(p[ml]|pod)\z/){
$pm{$name} = $self->catfile($self->{INST_LIBDIR},$name);
}
}
$self->{PL_FILES} ||= \%pl_files;
$self->{DIR} ||= [sort keys %dir];
$self->{XS} ||= \%xs;
$self->{C} ||= [sort keys %c];
$self->{H} ||= [sort keys %h];
$self->{PM} ||= \%pm;
my @o_files = @{$self->{C}};
$self->{O_FILES} = [grep s/\.c(pp|xx|c)?\z/$self->{OBJ_EXT}/i, @o_files];
}
=item init_MANPODS
Determines if man pages should be generated and initializes MAN1PODS
and MAN3PODS as appropriate.
=cut
sub init_MANPODS {
my $self = shift;
# Set up names of manual pages to generate from pods
foreach my $man (qw(MAN1 MAN3)) {
if ( $self->{"${man}PODS"}
or $self->{"INSTALL${man}DIR"} =~ /^(none|\s*)$/
) {
$self->{"${man}PODS"} ||= {};
}
else {
my $init_method = "init_${man}PODS";
$self->$init_method();
}
}
}
sub _has_pod {
my($self, $file) = @_;
my($ispod)=0;
if (open( my $fh, '<', $file )) {
while (<$fh>) {
if (/^=(?:head\d+|item|pod)\b/) {
$ispod=1;
last;
}
}
close $fh;
} else {
# If it doesn't exist yet, we assume, it has pods in it
$ispod = 1;
}
return $ispod;
}
=item init_MAN1PODS
Initializes MAN1PODS from the list of EXE_FILES.
=cut
sub init_MAN1PODS {
my($self) = @_;
if ( exists $self->{EXE_FILES} ) {
foreach my $name (@{$self->{EXE_FILES}}) {
next unless $self->_has_pod($name);
$self->{MAN1PODS}->{$name} =
$self->catfile("\$(INST_MAN1DIR)",
basename($name).".\$(MAN1EXT)");
}
}
}
=item init_MAN3PODS
Initializes MAN3PODS from the list of PM files.
=cut
sub init_MAN3PODS {
my $self = shift;
my %manifypods = (); # we collect the keys first, i.e. the files
# we have to convert to pod
foreach my $name (keys %{$self->{PM}}) {
if ($name =~ /\.pod\z/ ) {
$manifypods{$name} = $self->{PM}{$name};
} elsif ($name =~ /\.p[ml]\z/ ) {
if( $self->_has_pod($name) ) {
$manifypods{$name} = $self->{PM}{$name};
}
}
}
my $parentlibs_re = join '|', @{$self->{PMLIBPARENTDIRS}};
# Remove "Configure.pm" and similar, if it's not the only pod listed
# To force inclusion, just name it "Configure.pod", or override
# MAN3PODS
foreach my $name (keys %manifypods) {
if ($self->{PERL_CORE} and $name =~ /(config|setup).*\.pm/is) {
delete $manifypods{$name};
next;
}
my($manpagename) = $name;
$manpagename =~ s/\.p(od|m|l)\z//;
# everything below lib is ok
unless($manpagename =~ s!^\W*($parentlibs_re)\W+!!s) {
$manpagename = $self->catfile(
split(/::/,$self->{PARENT_NAME}),$manpagename
);
}
$manpagename = $self->replace_manpage_separator($manpagename);
$self->{MAN3PODS}->{$name} =
$self->catfile("\$(INST_MAN3DIR)", "$manpagename.\$(MAN3EXT)");
}
}
=item init_PM
Initializes PMLIBDIRS and PM from PMLIBDIRS.
=cut
sub init_PM {
my $self = shift;
# Some larger extensions often wish to install a number of *.pm/pl
# files into the library in various locations.
# The attribute PMLIBDIRS holds an array reference which lists
# subdirectories which we should search for library files to
# install. PMLIBDIRS defaults to [ 'lib', $self->{BASEEXT} ]. We
# recursively search through the named directories (skipping any
# which don't exist or contain Makefile.PL files).
# For each *.pm or *.pl file found $self->libscan() is called with
# the default installation path in $_[1]. The return value of
# libscan defines the actual installation location. The default
# libscan function simply returns the path. The file is skipped
# if libscan returns false.
# The default installation location passed to libscan in $_[1] is:
#
# ./*.pm => $(INST_LIBDIR)/*.pm
# ./xyz/... => $(INST_LIBDIR)/xyz/...
# ./lib/... => $(INST_LIB)/...
#
# In this way the 'lib' directory is seen as the root of the actual
# perl library whereas the others are relative to INST_LIBDIR
# (which includes PARENT_NAME). This is a subtle distinction but one
# that's important for nested modules.
unless( $self->{PMLIBDIRS} ) {
if( $Is{VMS} ) {
# Avoid logical name vs directory collisions
$self->{PMLIBDIRS} = ['./lib', "./$self->{BASEEXT}"];
}
else {
$self->{PMLIBDIRS} = ['lib', $self->{BASEEXT}];
}
}
#only existing directories that aren't in $dir are allowed
# Avoid $_ wherever possible:
# @{$self->{PMLIBDIRS}} = grep -d && !$dir{$_}, @{$self->{PMLIBDIRS}};
my (@pmlibdirs) = @{$self->{PMLIBDIRS}};
@{$self->{PMLIBDIRS}} = ();
my %dir = map { ($_ => $_) } @{$self->{DIR}};
foreach my $pmlibdir (@pmlibdirs) {
-d $pmlibdir && !$dir{$pmlibdir} && push @{$self->{PMLIBDIRS}}, $pmlibdir;
}
unless( $self->{PMLIBPARENTDIRS} ) {
@{$self->{PMLIBPARENTDIRS}} = ('lib');
}
return if $self->{PM} and $self->{ARGS}{PM};
if (@{$self->{PMLIBDIRS}}){
print "Searching PMLIBDIRS: @{$self->{PMLIBDIRS}}\n"
if ($Verbose >= 2);
require File::Find;
File::Find::find(sub {
if (-d $_){
unless ($self->libscan($_)){
$File::Find::prune = 1;
}
return;
}
return if /\#/;
return if /~$/; # emacs temp files
return if /,v$/; # RCS files
my $path = $File::Find::name;
my $prefix = $self->{INST_LIBDIR};
my $striplibpath;
my $parentlibs_re = join '|', @{$self->{PMLIBPARENTDIRS}};
$prefix = $self->{INST_LIB}
if ($striplibpath = $path) =~ s{^(\W*)($parentlibs_re)\W}
{$1}i;
my($inst) = $self->catfile($prefix,$striplibpath);
local($_) = $inst; # for backwards compatibility
$inst = $self->libscan($inst);
print "libscan($path) => '$inst'\n" if ($Verbose >= 2);
return unless $inst;
$self->{PM}{$path} = $inst;
}, @{$self->{PMLIBDIRS}});
}
}
=item init_DIRFILESEP
Using / for Unix. Called by init_main.
=cut
sub init_DIRFILESEP {
my($self) = shift;
$self->{DIRFILESEP} = '/';
}
=item init_main
Initializes AR, AR_STATIC_ARGS, BASEEXT, CONFIG, DISTNAME, DLBASE,
EXE_EXT, FULLEXT, FULLPERL, FULLPERLRUN, FULLPERLRUNINST, INST_*,
INSTALL*, INSTALLDIRS, LIB_EXT, LIBPERL_A, MAP_TARGET, NAME,
OBJ_EXT, PARENT_NAME, PERL, PERL_ARCHLIB, PERL_INC, PERL_LIB,
PERL_SRC, PERLRUN, PERLRUNINST, PREFIX, VERSION,
VERSION_SYM, XS_VERSION.
=cut
sub init_main {
my($self) = @_;
# --- Initialize Module Name and Paths
# NAME = Foo::Bar::Oracle
# FULLEXT = Foo/Bar/Oracle
# BASEEXT = Oracle
# PARENT_NAME = Foo::Bar
### Only UNIX:
### ($self->{FULLEXT} =
### $self->{NAME}) =~ s!::!/!g ; #eg. BSD/Foo/Socket
$self->{FULLEXT} = $self->catdir(split /::/, $self->{NAME});
# Copied from DynaLoader:
my(@modparts) = split(/::/,$self->{NAME});
my($modfname) = $modparts[-1];
# Some systems have restrictions on files names for DLL's etc.
# mod2fname returns appropriate file base name (typically truncated)
# It may also edit @modparts if required.
if (defined &DynaLoader::mod2fname) {
$modfname = &DynaLoader::mod2fname(\@modparts);
}
($self->{PARENT_NAME}, $self->{BASEEXT}) = $self->{NAME} =~ m!(?:([\w:]+)::)?(\w+)\z! ;
$self->{PARENT_NAME} ||= '';
if (defined &DynaLoader::mod2fname) {
# As of 5.001m, dl_os2 appends '_'
$self->{DLBASE} = $modfname;
} else {
$self->{DLBASE} = '$(BASEEXT)';
}
# --- Initialize PERL_LIB, PERL_SRC
# *Real* information: where did we get these two from? ...
my $inc_config_dir = dirname($INC{'Config.pm'});
my $inc_carp_dir = dirname($INC{'Carp.pm'});
unless ($self->{PERL_SRC}){
foreach my $dir_count (1..8) { # 8 is the VMS limit for nesting
my $dir = $self->catdir(($Updir) x $dir_count);
if (-f $self->catfile($dir,"config_h.SH") &&
-f $self->catfile($dir,"perl.h") &&
-f $self->catfile($dir,"lib","strict.pm")
) {
$self->{PERL_SRC}=$dir ;
last;
}
}
}
warn "PERL_CORE is set but I can't find your PERL_SRC!\n" if
$self->{PERL_CORE} and !$self->{PERL_SRC};
if ($self->{PERL_SRC}){
$self->{PERL_LIB} ||= $self->catdir("$self->{PERL_SRC}","lib");
if (defined $Cross::platform) {
$self->{PERL_ARCHLIB} =
$self->catdir("$self->{PERL_SRC}","xlib",$Cross::platform);
$self->{PERL_INC} =
$self->catdir("$self->{PERL_SRC}","xlib",$Cross::platform,
$Is{Win32}?("CORE"):());
}
else {
$self->{PERL_ARCHLIB} = $self->{PERL_LIB};
$self->{PERL_INC} = ($Is{Win32}) ?
$self->catdir($self->{PERL_LIB},"CORE") : $self->{PERL_SRC};
}
# catch a situation that has occurred a few times in the past:
unless (
-s $self->catfile($self->{PERL_SRC},'cflags')
or
$Is{VMS}
&&
-s $self->catfile($self->{PERL_SRC},'perlshr_attr.opt')
or
$Is{Win32}
){
warn qq{
You cannot build extensions below the perl source tree after executing
a 'make clean' in the perl source tree.
To rebuild extensions distributed with the perl source you should
simply Configure (to include those extensions) and then build perl as
normal. After installing perl the source tree can be deleted. It is
not needed for building extensions by running 'perl Makefile.PL'
usually without extra arguments.
It is recommended that you unpack and build additional extensions away
from the perl source tree.
};
}
} else {
# we should also consider $ENV{PERL5LIB} here
my $old = $self->{PERL_LIB} || $self->{PERL_ARCHLIB} || $self->{PERL_INC};
$self->{PERL_LIB} ||= $Config{privlibexp};
$self->{PERL_ARCHLIB} ||= $Config{archlibexp};
$self->{PERL_INC} = $self->catdir("$self->{PERL_ARCHLIB}","CORE"); # wild guess for now
my $perl_h;
if (not -f ($perl_h = $self->catfile($self->{PERL_INC},"perl.h"))
and not $old){
# Maybe somebody tries to build an extension with an
# uninstalled Perl outside of Perl build tree
my $lib;
for my $dir (@INC) {
$lib = $dir, last if -e $self->catdir($dir, "Config.pm");
}
if ($lib) {
# Win32 puts its header files in /perl/src/lib/CORE.
# Unix leaves them in /perl/src.
my $inc = $Is{Win32} ? $self->catdir($lib, "CORE" )
: dirname $lib;
if (-e $self->catdir($inc, "perl.h")) {
$self->{PERL_LIB} = $lib;
$self->{PERL_ARCHLIB} = $lib;
$self->{PERL_INC} = $inc;
$self->{UNINSTALLED_PERL} = 1;
print STDOUT <<EOP;
... Detected uninstalled Perl. Trying to continue.
EOP
}
}
}
}
# We get SITELIBEXP and SITEARCHEXP directly via
# Get_from_Config. When we are running standard modules, these
# won't matter, we will set INSTALLDIRS to "perl". Otherwise we
# set it to "site". I prefer that INSTALLDIRS be set from outside
# MakeMaker.
$self->{INSTALLDIRS} ||= "site";
$self->{MAN1EXT} ||= $Config{man1ext};
$self->{MAN3EXT} ||= $Config{man3ext};
# Get some stuff out of %Config if we haven't yet done so
print STDOUT "CONFIG must be an array ref\n"
if ($self->{CONFIG} and ref $self->{CONFIG} ne 'ARRAY');
$self->{CONFIG} = [] unless (ref $self->{CONFIG});
push(@{$self->{CONFIG}}, @ExtUtils::MakeMaker::Get_from_Config);
push(@{$self->{CONFIG}}, 'shellflags') if $Config{shellflags};
my(%once_only);
foreach my $m (@{$self->{CONFIG}}){
next if $once_only{$m};
print STDOUT "CONFIG key '$m' does not exist in Config.pm\n"
unless exists $Config{$m};
$self->{uc $m} ||= $Config{$m};
$once_only{$m} = 1;
}
# This is too dangerous:
# if ($^O eq "next") {
# $self->{AR} = "libtool";
# $self->{AR_STATIC_ARGS} = "-o";
# }
# But I leave it as a placeholder
$self->{AR_STATIC_ARGS} ||= "cr";
# These should never be needed
$self->{OBJ_EXT} ||= '.o';
$self->{LIB_EXT} ||= '.a';
$self->{MAP_TARGET} ||= "perl";
$self->{LIBPERL_A} ||= "libperl$self->{LIB_EXT}";
# make a simple check if we find strict
warn "Warning: PERL_LIB ($self->{PERL_LIB}) seems not to be a perl library directory
(strict.pm not found)"
unless -f $self->catfile("$self->{PERL_LIB}","strict.pm") ||
$self->{NAME} eq "ExtUtils::MakeMaker";
}
=item init_others
Initializes EXTRALIBS, BSLOADLIBS, LDLOADLIBS, LIBS, LD_RUN_PATH, LD,
OBJECT, BOOTDEP, PERLMAINCC, LDFROM, LINKTYPE, SHELL, NOOP,
FIRST_MAKEFILE, MAKEFILE_OLD, NOECHO, RM_F, RM_RF, TEST_F, TEST_S,
TOUCH, CP, MV, CHMOD, UMASK_NULL, ECHO, ECHO_N
=cut
sub init_others { # --- Initialize Other Attributes
my($self) = shift;
$self->{LD} ||= 'ld';
# Compute EXTRALIBS, BSLOADLIBS and LDLOADLIBS from $self->{LIBS}
# Lets look at $self->{LIBS} carefully: It may be an anon array, a string or
# undefined. In any case we turn it into an anon array:
# May check $Config{libs} too, thus not empty.
$self->{LIBS} = [$self->{LIBS}] unless ref $self->{LIBS};
$self->{LIBS} = [''] unless @{$self->{LIBS}} && defined $self->{LIBS}[0];
$self->{LD_RUN_PATH} = "";
foreach my $libs ( @{$self->{LIBS}} ){
$libs =~ s/^\s*(.*\S)\s*$/$1/; # remove leading and trailing whitespace
my(@libs) = $self->extliblist($libs);
if ($libs[0] or $libs[1] or $libs[2]){
# LD_RUN_PATH now computed by ExtUtils::Liblist
($self->{EXTRALIBS}, $self->{BSLOADLIBS},
$self->{LDLOADLIBS}, $self->{LD_RUN_PATH}) = @libs;
last;
}
}
if ( $self->{OBJECT} ) {
$self->{OBJECT} =~ s!\.o(bj)?\b!\$(OBJ_EXT)!g;
} else {
# init_dirscan should have found out, if we have C files
$self->{OBJECT} = "";
$self->{OBJECT} = '$(BASEEXT)$(OBJ_EXT)' if @{$self->{C}||[]};
}
$self->{OBJECT} =~ s/\n+/ \\\n\t/g;
$self->{BOOTDEP} = (-f "$self->{BASEEXT}_BS") ? "$self->{BASEEXT}_BS" : "";
$self->{PERLMAINCC} ||= '$(CC)';
$self->{LDFROM} = '$(OBJECT)' unless $self->{LDFROM};
# Sanity check: don't define LINKTYPE = dynamic if we're skipping
# the 'dynamic' section of MM. We don't have this problem with
# 'static', since we either must use it (%Config says we can't
# use dynamic loading) or the caller asked for it explicitly.
if (!$self->{LINKTYPE}) {
$self->{LINKTYPE} = $self->{SKIPHASH}{'dynamic'}
? 'static'
: ($Config{usedl} ? 'dynamic' : 'static');
};
$self->{NOOP} ||= '$(SHELL) -c true';
$self->{NOECHO} = '@' unless defined $self->{NOECHO};
$self->{FIRST_MAKEFILE} ||= $self->{MAKEFILE} || 'Makefile';
$self->{MAKEFILE} ||= $self->{FIRST_MAKEFILE};
$self->{MAKEFILE_OLD} ||= $self->{MAKEFILE}.'.old';
$self->{MAKE_APERL_FILE} ||= $self->{MAKEFILE}.'.aperl';
# Some makes require a wrapper around macros passed in on the command
# line.
$self->{MACROSTART} ||= '';
$self->{MACROEND} ||= '';
# Not everybody uses -f to indicate "use this Makefile instead"
$self->{USEMAKEFILE} ||= '-f';
$self->{SHELL} ||= $Config{sh} || '/bin/sh';
$self->{ECHO} ||= 'echo';
$self->{ECHO_N} ||= 'echo -n';
$self->{RM_F} ||= "rm -f";
$self->{RM_RF} ||= "rm -rf";
$self->{TOUCH} ||= "touch";
$self->{TEST_F} ||= "test -f";
$self->{TEST_S} ||= "test -s";
$self->{CP} ||= "cp";
$self->{MV} ||= "mv";
$self->{CHMOD} ||= "chmod";
$self->{MKPATH} ||= '$(ABSPERLRUN) "-MExtUtils::Command" -e mkpath';
$self->{EQUALIZE_TIMESTAMP} ||=
'$(ABSPERLRUN) "-MExtUtils::Command" -e eqtime';
$self->{UNINST} ||= 0;
$self->{VERBINST} ||= 0;
$self->{MOD_INSTALL} ||=
$self->oneliner(<<'CODE', ['-MExtUtils::Install']);
install({@ARGV}, '$(VERBINST)', 0, '$(UNINST)');
CODE
$self->{DOC_INSTALL} ||=
'$(ABSPERLRUN) "-MExtUtils::Command::MM" -e perllocal_install';
$self->{UNINSTALL} ||=
'$(ABSPERLRUN) "-MExtUtils::Command::MM" -e uninstall';
$self->{WARN_IF_OLD_PACKLIST} ||=
'$(ABSPERLRUN) "-MExtUtils::Command::MM" -e warn_if_old_packlist';
$self->{FIXIN} ||=
q{$(PERLRUN) "-MExtUtils::MY" -e "MY->fixin(shift)"};
$self->{UMASK_NULL} ||= "umask 0";
$self->{DEV_NULL} ||= "> /dev/null 2>&1";
return 1;
}
=item init_linker
Unix has no need of special linker flags.
=cut
sub init_linker {
my($self) = shift;
$self->{PERL_ARCHIVE} ||= '';
$self->{PERL_ARCHIVE_AFTER} ||= '';
$self->{EXPORT_LIST} ||= '';
}
=begin _protected
=item init_lib2arch
$mm->init_lib2arch
=end _protected
=cut
sub init_lib2arch {
my($self) = shift;
# The user who requests an installation directory explicitly
# should not have to tell us an architecture installation directory
# as well. We look if a directory exists that is named after the
# architecture. If not we take it as a sign that it should be the
# same as the requested installation directory. Otherwise we take
# the found one.
for my $libpair ({l=>"privlib", a=>"archlib"},
{l=>"sitelib", a=>"sitearch"},
{l=>"vendorlib", a=>"vendorarch"},
)
{
my $lib = "install$libpair->{l}";
my $Lib = uc $lib;
my $Arch = uc "install$libpair->{a}";
if( $self->{$Lib} && ! $self->{$Arch} ){
my($ilib) = $Config{$lib};
$self->prefixify($Arch,$ilib,$self->{$Lib});
unless (-d $self->{$Arch}) {
print STDOUT "Directory $self->{$Arch} not found\n"
if $Verbose;
$self->{$Arch} = $self->{$Lib};
}
print STDOUT "Defaulting $Arch to $self->{$Arch}\n" if $Verbose;
}
}
}
=item init_PERL
$mm->init_PERL;
Called by init_main. Sets up ABSPERL, PERL, FULLPERL and all the
*PERLRUN* permutations.
PERL is allowed to be miniperl
FULLPERL must be a complete perl
ABSPERL is PERL converted to an absolute path
*PERLRUN contains everything necessary to run perl, find it's
libraries, etc...
*PERLRUNINST is *PERLRUN + everything necessary to find the
modules being built.
=cut
sub init_PERL {
my($self) = shift;
my @defpath = ();
foreach my $component ($self->{PERL_SRC}, $self->path(),
$Config{binexp})
{
push @defpath, $component if defined $component;
}
# Build up a set of file names (not command names).
my $thisperl = $self->canonpath($^X);
$thisperl .= $Config{exe_ext} unless
# VMS might have a file version # at the end
$Is{VMS} ? $thisperl =~ m/$Config{exe_ext}(;\d+)?$/i
: $thisperl =~ m/$Config{exe_ext}$/i;
# We need a relative path to perl when in the core.
$thisperl = $self->abs2rel($thisperl) if $self->{PERL_CORE};
my @perls = ($thisperl);
push @perls, map { "$_$Config{exe_ext}" }
('perl', 'perl5', "perl$Config{version}");
# miniperl has priority over all but the cannonical perl when in the
# core. Otherwise its a last resort.
my $miniperl = "miniperl$Config{exe_ext}";
if( $self->{PERL_CORE} ) {
splice @perls, 1, 0, $miniperl;
}
else {
push @perls, $miniperl;
}
$self->{PERL} ||=
$self->find_perl(5.0, \@perls, \@defpath, $Verbose );
# don't check if perl is executable, maybe they have decided to
# supply switches with perl
# When built for debugging, VMS doesn't create perl.exe but ndbgperl.exe.
my $perl_name = 'perl';
$perl_name = 'ndbgperl' if $Is{VMS} &&
defined $Config{usevmsdebug} && $Config{usevmsdebug} eq 'define';
# XXX This logic is flawed. If "miniperl" is anywhere in the path
# it will get confused. It should be fixed to work only on the filename.
# Define 'FULLPERL' to be a non-miniperl (used in test: target)
($self->{FULLPERL} = $self->{PERL}) =~ s/miniperl/$perl_name/i
unless $self->{FULLPERL};
# Little hack to get around VMS's find_perl putting "MCR" in front
# sometimes.
$self->{ABSPERL} = $self->{PERL};
my $has_mcr = $self->{ABSPERL} =~ s/^MCR\s*//;
if( $self->file_name_is_absolute($self->{ABSPERL}) ) {
$self->{ABSPERL} = '$(PERL)';
}
else {
$self->{ABSPERL} = $self->rel2abs($self->{ABSPERL});
$self->{ABSPERL} = 'MCR '.$self->{ABSPERL} if $has_mcr;
}
# Are we building the core?
$self->{PERL_CORE} = $ENV{PERL_CORE} unless exists $self->{PERL_CORE};
$self->{PERL_CORE} = 0 unless defined $self->{PERL_CORE};
# How do we run perl?
foreach my $perl (qw(PERL FULLPERL ABSPERL)) {
my $run = $perl.'RUN';
$self->{$run} = "\$($perl)";
# Make sure perl can find itself before it's installed.
$self->{$run} .= q{ "-I$(PERL_LIB)" "-I$(PERL_ARCHLIB)"}
if $self->{UNINSTALLED_PERL} || $self->{PERL_CORE};
$self->{$perl.'RUNINST'} =
sprintf q{$(%sRUN) "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"}, $perl;
}
return 1;
}
=item init_platform
=item platform_constants
Add MM_Unix_VERSION.
=cut
sub init_platform {
my($self) = shift;
$self->{MM_Unix_VERSION} = $VERSION;
$self->{PERL_MALLOC_DEF} = '-DPERL_EXTMALLOC_DEF -Dmalloc=Perl_malloc '.
'-Dfree=Perl_mfree -Drealloc=Perl_realloc '.
'-Dcalloc=Perl_calloc';
}
sub platform_constants {
my($self) = shift;
my $make_frag = '';
foreach my $macro (qw(MM_Unix_VERSION PERL_MALLOC_DEF))
{
next unless defined $self->{$macro};
$make_frag .= "$macro = $self->{$macro}\n";
}
return $make_frag;
}
=item init_PERM
$mm->init_PERM
Called by init_main. Initializes PERL_*
=cut
sub init_PERM {
my($self) = shift;
$self->{PERM_RW} = 644 unless defined $self->{PERM_RW};
$self->{PERM_RWX} = 755 unless defined $self->{PERM_RWX};
return 1;
}
=item init_xs
$mm->init_xs
Sets up macros having to do with XS code. Currently just INST_STATIC,
INST_DYNAMIC and INST_BOOT.
=cut
sub init_xs {
my $self = shift;
if ($self->has_link_code()) {
$self->{INST_STATIC} =
$self->catfile('$(INST_ARCHAUTODIR)', '$(BASEEXT)$(LIB_EXT)');
$self->{INST_DYNAMIC} =
$self->catfile('$(INST_ARCHAUTODIR)', '$(DLBASE).$(DLEXT)');
$self->{INST_BOOT} =
$self->catfile('$(INST_ARCHAUTODIR)', '$(BASEEXT).bs');
} else {
$self->{INST_STATIC} = '';
$self->{INST_DYNAMIC} = '';
$self->{INST_BOOT} = '';
}
}
=item install (o)
Defines the install target.
=cut
sub install {
my($self, %attribs) = @_;
my(@m);
push @m, q{
install :: all pure_install doc_install
$(NOECHO) $(NOOP)
install_perl :: all pure_perl_install doc_perl_install
$(NOECHO) $(NOOP)
install_site :: all pure_site_install doc_site_install
$(NOECHO) $(NOOP)
install_vendor :: all pure_vendor_install doc_vendor_install
$(NOECHO) $(NOOP)
pure_install :: pure_$(INSTALLDIRS)_install
$(NOECHO) $(NOOP)
doc_install :: doc_$(INSTALLDIRS)_install
$(NOECHO) $(NOOP)
pure__install : pure_site_install
$(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
doc__install : doc_site_install
$(NOECHO) $(ECHO) INSTALLDIRS not defined, defaulting to INSTALLDIRS=site
pure_perl_install ::
$(NOECHO) $(MOD_INSTALL) \
read }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
write }.$self->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{ \
$(INST_LIB) $(DESTINSTALLPRIVLIB) \
$(INST_ARCHLIB) $(DESTINSTALLARCHLIB) \
$(INST_BIN) $(DESTINSTALLBIN) \
$(INST_SCRIPT) $(DESTINSTALLSCRIPT) \
$(INST_MAN1DIR) $(DESTINSTALLMAN1DIR) \
$(INST_MAN3DIR) $(DESTINSTALLMAN3DIR)
$(NOECHO) $(WARN_IF_OLD_PACKLIST) \
}.$self->catdir('$(SITEARCHEXP)','auto','$(FULLEXT)').q{
pure_site_install ::
$(NOECHO) $(MOD_INSTALL) \
read }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \
write }.$self->catfile('$(DESTINSTALLSITEARCH)','auto','$(FULLEXT)','.packlist').q{ \
$(INST_LIB) $(DESTINSTALLSITELIB) \
$(INST_ARCHLIB) $(DESTINSTALLSITEARCH) \
$(INST_BIN) $(DESTINSTALLSITEBIN) \
$(INST_SCRIPT) $(DESTINSTALLSITESCRIPT) \
$(INST_MAN1DIR) $(DESTINSTALLSITEMAN1DIR) \
$(INST_MAN3DIR) $(DESTINSTALLSITEMAN3DIR)
$(NOECHO) $(WARN_IF_OLD_PACKLIST) \
}.$self->catdir('$(PERL_ARCHLIB)','auto','$(FULLEXT)').q{
pure_vendor_install ::
$(NOECHO) $(MOD_INSTALL) \
read }.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{ \
write }.$self->catfile('$(DESTINSTALLVENDORARCH)','auto','$(FULLEXT)','.packlist').q{ \
$(INST_LIB) $(DESTINSTALLVENDORLIB) \
$(INST_ARCHLIB) $(DESTINSTALLVENDORARCH) \
$(INST_BIN) $(DESTINSTALLVENDORBIN) \
$(INST_SCRIPT) $(DESTINSTALLVENDORSCRIPT) \
$(INST_MAN1DIR) $(DESTINSTALLVENDORMAN1DIR) \
$(INST_MAN3DIR) $(DESTINSTALLVENDORMAN3DIR)
doc_perl_install ::
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
-$(NOECHO) $(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLPRIVLIB)" \
LINKTYPE "$(LINKTYPE)" \
VERSION "$(VERSION)" \
EXE_FILES "$(EXE_FILES)" \
>> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{
doc_site_install ::
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
-$(NOECHO) $(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLSITELIB)" \
LINKTYPE "$(LINKTYPE)" \
VERSION "$(VERSION)" \
EXE_FILES "$(EXE_FILES)" \
>> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{
doc_vendor_install ::
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
-$(NOECHO) $(DOC_INSTALL) \
"Module" "$(NAME)" \
"installed into" "$(INSTALLVENDORLIB)" \
LINKTYPE "$(LINKTYPE)" \
VERSION "$(VERSION)" \
EXE_FILES "$(EXE_FILES)" \
>> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{
};
push @m, q{
uninstall :: uninstall_from_$(INSTALLDIRS)dirs
$(NOECHO) $(NOOP)
uninstall_from_perldirs ::
$(NOECHO) $(UNINSTALL) }.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{
uninstall_from_sitedirs ::
$(NOECHO) $(UNINSTALL) }.$self->catfile('$(SITEARCHEXP)','auto','$(FULLEXT)','.packlist').q{
uninstall_from_vendordirs ::
$(NOECHO) $(UNINSTALL) }.$self->catfile('$(VENDORARCHEXP)','auto','$(FULLEXT)','.packlist').q{
};
join("",@m);
}
=item installbin (o)
Defines targets to make and to install EXE_FILES.
=cut
sub installbin {
my($self) = shift;
return "" unless $self->{EXE_FILES} && ref $self->{EXE_FILES} eq "ARRAY";
my @exefiles = @{$self->{EXE_FILES}};
return "" unless @exefiles;
@exefiles = map vmsify($_), @exefiles if $Is{VMS};
my %fromto;
for my $from (@exefiles) {
my($path)= $self->catfile('$(INST_SCRIPT)', basename($from));
local($_) = $path; # for backwards compatibility
my $to = $self->libscan($path);
print "libscan($from) => '$to'\n" if ($Verbose >=2);
$to = vmsify($to) if $Is{VMS};
$fromto{$from} = $to;
}
my @to = values %fromto;
my @m;
push(@m, qq{
EXE_FILES = @exefiles
pure_all :: @to
\$(NOECHO) \$(NOOP)
realclean ::
});
# realclean can get rather large.
push @m, map "\t$_\n", $self->split_command('$(RM_F)', @to);
push @m, "\n";
# A target for each exe file.
while (my($from,$to) = each %fromto) {
last unless defined $from;
push @m, sprintf <<'MAKE', $to, $from, $to, $from, $to, $to, $to;
%s : %s $(FIRST_MAKEFILE) $(INST_SCRIPT)$(DFSEP).exists $(INST_BIN)$(DFSEP).exists
$(NOECHO) $(RM_F) %s
$(CP) %s %s
$(FIXIN) %s
-$(NOECHO) $(CHMOD) $(PERM_RWX) %s
MAKE
}
join "", @m;
}
=item linkext (o)
Defines the linkext target which in turn defines the LINKTYPE.
=cut
sub linkext {
my($self, %attribs) = @_;
# LINKTYPE => static or dynamic or ''
my($linktype) = defined $attribs{LINKTYPE} ?
$attribs{LINKTYPE} : '$(LINKTYPE)';
"
linkext :: $linktype
\$(NOECHO) \$(NOOP)
";
}
=item lsdir
Takes as arguments a directory name and a regular expression. Returns
all entries in the directory that match the regular expression.
=cut
sub lsdir {
my($self) = shift;
my($dir, $regex) = @_;
my(@ls);
my $dh = new DirHandle;
$dh->open($dir || ".") or return ();
@ls = $dh->read;
$dh->close;
@ls = grep(/$regex/, @ls) if $regex;
@ls;
}
=item macro (o)
Simple subroutine to insert the macros defined by the macro attribute
into the Makefile.
=cut
sub macro {
my($self,%attribs) = @_;
my(@m,$key,$val);
while (($key,$val) = each %attribs){
last unless defined $key;
push @m, "$key = $val\n";
}
join "", @m;
}
=item makeaperl (o)
Called by staticmake. Defines how to write the Makefile to produce a
static new perl.
By default the Makefile produced includes all the static extensions in
the perl library. (Purified versions of library files, e.g.,
DynaLoader_pure_p1_c0_032.a are automatically ignored to avoid link errors.)
=cut
sub makeaperl {
my($self, %attribs) = @_;
my($makefilename, $searchdirs, $static, $extra, $perlinc, $target, $tmp, $libperl) =
@attribs{qw(MAKE DIRS STAT EXTRA INCL TARGET TMP LIBPERL)};
my(@m);
push @m, "
# --- MakeMaker makeaperl section ---
MAP_TARGET = $target
FULLPERL = $self->{FULLPERL}
";
return join '', @m if $self->{PARENT};
my($dir) = join ":", @{$self->{DIR}};
unless ($self->{MAKEAPERL}) {
push @m, q{
$(MAP_TARGET) :: static $(MAKE_APERL_FILE)
$(MAKE) $(USEMAKEFILE) $(MAKE_APERL_FILE) $@
$(MAKE_APERL_FILE) : $(FIRST_MAKEFILE) pm_to_blib
$(NOECHO) $(ECHO) Writing \"$(MAKE_APERL_FILE)\" for this $(MAP_TARGET)
$(NOECHO) $(PERLRUNINST) \
Makefile.PL DIR=}, $dir, q{ \
MAKEFILE=$(MAKE_APERL_FILE) LINKTYPE=static \
MAKEAPERL=1 NORECURS=1 CCCDLFLAGS=};
foreach (@ARGV){
if( /\s/ ){
s/=(.*)/='$1'/;
}
push @m, " \\\n\t\t$_";
}
# push @m, map( " \\\n\t\t$_", @ARGV );
push @m, "\n";
return join '', @m;
}
my($cccmd, $linkcmd, $lperl);
$cccmd = $self->const_cccmd($libperl);
$cccmd =~ s/^CCCMD\s*=\s*//;
$cccmd =~ s/\$\(INC\)/ "-I$self->{PERL_INC}" /;
$cccmd .= " $Config{cccdlflags}"
if ($Config{useshrplib} eq 'true');
$cccmd =~ s/\(CC\)/\(PERLMAINCC\)/;
# The front matter of the linkcommand...
$linkcmd = join ' ', "\$(CC)",
grep($_, @Config{qw(ldflags ccdlflags)});
$linkcmd =~ s/\s+/ /g;
$linkcmd =~ s,(perl\.exp),\$(PERL_INC)/$1,;
# Which *.a files could we make use of...
my %static;
require File::Find;
File::Find::find(sub {
return unless m/\Q$self->{LIB_EXT}\E$/;
# Skip perl's libraries.
return if m/^libperl/ or m/^perl\Q$self->{LIB_EXT}\E$/;
# Skip purified versions of libraries
# (e.g., DynaLoader_pure_p1_c0_032.a)
return if m/_pure_\w+_\w+_\w+\.\w+$/ and -f "$File::Find::dir/.pure";
if( exists $self->{INCLUDE_EXT} ){
my $found = 0;
(my $xx = $File::Find::name) =~ s,.*?/auto/,,s;
$xx =~ s,/?$_,,;
$xx =~ s,/,::,g;
# Throw away anything not explicitly marked for inclusion.
# DynaLoader is implied.
foreach my $incl ((@{$self->{INCLUDE_EXT}},'DynaLoader')){
if( $xx eq $incl ){
$found++;
last;
}
}
return unless $found;
}
elsif( exists $self->{EXCLUDE_EXT} ){
(my $xx = $File::Find::name) =~ s,.*?/auto/,,s;
$xx =~ s,/?$_,,;
$xx =~ s,/,::,g;
# Throw away anything explicitly marked for exclusion
foreach my $excl (@{$self->{EXCLUDE_EXT}}){
return if( $xx eq $excl );
}
}
# don't include the installed version of this extension. I
# leave this line here, although it is not necessary anymore:
# I patched minimod.PL instead, so that Miniperl.pm won't
# enclude duplicates
# Once the patch to minimod.PL is in the distribution, I can
# drop it
return if $File::Find::name =~ m:auto/$self->{FULLEXT}/$self->{BASEEXT}$self->{LIB_EXT}\z:;
use Cwd 'cwd';
$static{cwd() . "/" . $_}++;
}, grep( -d $_, @{$searchdirs || []}) );
# We trust that what has been handed in as argument, will be buildable
$static = [] unless $static;
@static{@{$static}} = (1) x @{$static};
$extra = [] unless $extra && ref $extra eq 'ARRAY';
for (sort keys %static) {
next unless /\Q$self->{LIB_EXT}\E\z/;
$_ = dirname($_) . "/extralibs.ld";
push @$extra, $_;
}
s/^(.*)/"-I$1"/ for @{$perlinc || []};
$target ||= "perl";
$tmp ||= ".";
# MAP_STATIC doesn't look into subdirs yet. Once "all" is made and we
# regenerate the Makefiles, MAP_STATIC and the dependencies for
# extralibs.all are computed correctly
push @m, "
MAP_LINKCMD = $linkcmd
MAP_PERLINC = @{$perlinc || []}
MAP_STATIC = ",
join(" \\\n\t", reverse sort keys %static), "
MAP_PRELIBS = $Config{perllibs} $Config{cryptlib}
";
if (defined $libperl) {
($lperl = $libperl) =~ s/\$\(A\)/$self->{LIB_EXT}/;
}
unless ($libperl && -f $lperl) { # Ilya's code...
my $dir = $self->{PERL_SRC} || "$self->{PERL_ARCHLIB}/CORE";
$dir = "$self->{PERL_ARCHLIB}/.." if $self->{UNINSTALLED_PERL};
$libperl ||= "libperl$self->{LIB_EXT}";
$libperl = "$dir/$libperl";
$lperl ||= "libperl$self->{LIB_EXT}";
$lperl = "$dir/$lperl";
if (! -f $libperl and ! -f $lperl) {
# We did not find a static libperl. Maybe there is a shared one?
if ($Is{SunOS}) {
$lperl = $libperl = "$dir/$Config{libperl}";
# SUNOS ld does not take the full path to a shared library
$libperl = '' if $Is{SunOS4};
}
}
print STDOUT "Warning: $libperl not found
If you're going to build a static perl binary, make sure perl is installed
otherwise ignore this warning\n"
unless (-f $lperl || defined($self->{PERL_SRC}));
}
# SUNOS ld does not take the full path to a shared library
my $llibperl = $libperl ? '$(MAP_LIBPERL)' : '-lperl';
push @m, "
MAP_LIBPERL = $libperl
LLIBPERL = $llibperl
";
push @m, '
$(INST_ARCHAUTODIR)/extralibs.all : $(INST_ARCHAUTODIR)$(DFSEP).exists '.join(" \\\n\t", @$extra).'
$(NOECHO) $(RM_F) $@
$(NOECHO) $(TOUCH) $@
';
foreach my $catfile (@$extra){
push @m, "\tcat $catfile >> \$\@\n";
}
push @m, "
\$(MAP_TARGET) :: $tmp/perlmain\$(OBJ_EXT) \$(MAP_LIBPERL) \$(MAP_STATIC) \$(INST_ARCHAUTODIR)/extralibs.all
\$(MAP_LINKCMD) -o \$\@ \$(OPTIMIZE) $tmp/perlmain\$(OBJ_EXT) \$(LDFROM) \$(MAP_STATIC) \$(LLIBPERL) `cat \$(INST_ARCHAUTODIR)/extralibs.all` \$(MAP_PRELIBS)
\$(NOECHO) \$(ECHO) 'To install the new \"\$(MAP_TARGET)\" binary, call'
\$(NOECHO) \$(ECHO) ' \$(MAKE) \$(USEMAKEFILE) $makefilename inst_perl MAP_TARGET=\$(MAP_TARGET)'
\$(NOECHO) \$(ECHO) 'To remove the intermediate files say'
\$(NOECHO) \$(ECHO) ' \$(MAKE) \$(USEMAKEFILE) $makefilename map_clean'
$tmp/perlmain\$(OBJ_EXT): $tmp/perlmain.c
";
push @m, "\t".$self->cd($tmp, qq[$cccmd "-I\$(PERL_INC)" perlmain.c])."\n";
push @m, qq{
$tmp/perlmain.c: $makefilename}, q{
$(NOECHO) $(ECHO) Writing $@
$(NOECHO) $(PERL) $(MAP_PERLINC) "-MExtUtils::Miniperl" \\
-e "writemain(grep s#.*/auto/##s, split(q| |, q|$(MAP_STATIC)|))" > $@t && $(MV) $@t $@
};
push @m, "\t", q{$(NOECHO) $(PERL) $(INSTALLSCRIPT)/fixpmain
} if (defined (&Dos::UseLFN) && Dos::UseLFN()==0);
push @m, q{
doc_inst_perl :
$(NOECHO) $(ECHO) Appending installation info to $(DESTINSTALLARCHLIB)/perllocal.pod
-$(NOECHO) $(MKPATH) $(DESTINSTALLARCHLIB)
-$(NOECHO) $(DOC_INSTALL) \
"Perl binary" "$(MAP_TARGET)" \
MAP_STATIC "$(MAP_STATIC)" \
MAP_EXTRA "`cat $(INST_ARCHAUTODIR)/extralibs.all`" \
MAP_LIBPERL "$(MAP_LIBPERL)" \
>> }.$self->catfile('$(DESTINSTALLARCHLIB)','perllocal.pod').q{
};
push @m, q{
inst_perl : pure_inst_perl doc_inst_perl
pure_inst_perl : $(MAP_TARGET)
}.$self->{CP}.q{ $(MAP_TARGET) }.$self->catfile('$(DESTINSTALLBIN)','$(MAP_TARGET)').q{
clean :: map_clean
map_clean :
}.$self->{RM_F}.qq{ $tmp/perlmain\$(OBJ_EXT) $tmp/perlmain.c \$(MAP_TARGET) $makefilename \$(INST_ARCHAUTODIR)/extralibs.all
};
join '', @m;
}
=item makefile (o)
Defines how to rewrite the Makefile.
=cut
sub makefile {
my($self) = shift;
my $m;
# We do not know what target was originally specified so we
# must force a manual rerun to be sure. But as it should only
# happen very rarely it is not a significant problem.
$m = '
$(OBJECT) : $(FIRST_MAKEFILE)
' if $self->{OBJECT};
my $newer_than_target = $Is{VMS} ? '$(MMS$SOURCE_LIST)' : '$?';
my $mpl_args = join " ", map qq["$_"], @ARGV;
$m .= sprintf <<'MAKE_FRAG', $newer_than_target, $mpl_args;
# We take a very conservative approach here, but it's worth it.
# We move Makefile to Makefile.old here to avoid gnu make looping.
$(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP)
$(NOECHO) $(ECHO) "Makefile out-of-date with respect to %s"
$(NOECHO) $(ECHO) "Cleaning current config before rebuilding Makefile..."
-$(NOECHO) $(RM_F) $(MAKEFILE_OLD)
-$(NOECHO) $(MV) $(FIRST_MAKEFILE) $(MAKEFILE_OLD)
- $(MAKE) $(USEMAKEFILE) $(MAKEFILE_OLD) clean $(DEV_NULL)
$(PERLRUN) Makefile.PL %s
$(NOECHO) $(ECHO) "==> Your Makefile has been rebuilt. <=="
$(NOECHO) $(ECHO) "==> Please rerun the $(MAKE) command. <=="
false
MAKE_FRAG
return $m;
}
=item maybe_command
Returns true, if the argument is likely to be a command.
=cut
sub maybe_command {
my($self,$file) = @_;
return $file if -x $file && ! -d $file;
return;
}
=item needs_linking (o)
Does this module need linking? Looks into subdirectory objects (see
also has_link_code())
=cut
sub needs_linking {
my($self) = shift;
my $caller = (caller(0))[3];
confess("needs_linking called too early") if
$caller =~ /^ExtUtils::MakeMaker::/;
return $self->{NEEDS_LINKING} if defined $self->{NEEDS_LINKING};
if ($self->has_link_code or $self->{MAKEAPERL}){
$self->{NEEDS_LINKING} = 1;
return 1;
}
foreach my $child (keys %{$self->{CHILDREN}}) {
if ($self->{CHILDREN}->{$child}->needs_linking) {
$self->{NEEDS_LINKING} = 1;
return 1;
}
}
return $self->{NEEDS_LINKING} = 0;
}
=item parse_abstract
parse a file and return what you think is the ABSTRACT
=cut
sub parse_abstract {
my($self,$parsefile) = @_;
my $result;
local $/ = "\n";
open(my $fh, '<', $parsefile) or die "Could not open '$parsefile': $!";
my $inpod = 0;
my $package = $self->{DISTNAME};
$package =~ s/-/::/g;
while (<$fh>) {
$inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod;
next if !$inpod;
chop;
next unless /^($package\s-\s)(.*)/;
$result = $2;
last;
}
close $fh;
return $result;
}
=item parse_version
my $version = MM->parse_version($file);
Parse a $file and return what $VERSION is set to by the first assignment.
It will return the string "undef" if it can't figure out what $VERSION
is. $VERSION should be for all to see, so C<our $VERSION> or plain $VERSION
are okay, but C<my $VERSION> is not.
parse_version() will try to C<use version> before checking for C<$VERSION> so the following will work.
$VERSION = qv(1.2.3);
=cut
sub parse_version {
my($self,$parsefile) = @_;
my $result;
local $/ = "\n";
local $_;
open(my $fh, '<', $parsefile) or die "Could not open '$parsefile': $!";
my $inpod = 0;
while (<$fh>) {
$inpod = /^=(?!cut)/ ? 1 : /^=cut/ ? 0 : $inpod;
next if $inpod || /^\s*#/;
chop;
next unless /(?<!\\)([\$*])(([\w\:\']*)\bVERSION)\b.*\=/;
my $eval = qq{
package ExtUtils::MakeMaker::_version;
no strict;
BEGIN { eval {
# Ensure any version() routine which might have leaked
# into this package has been deleted. Interferes with
# version->import()
undef *version;
require version;
"version"->import;
} }
local $1$2;
\$$2=undef;
do {
$_
};
\$$2;
};
local $^W = 0;
$result = eval($eval); ## no critic
warn "Could not eval '$eval' in $parsefile: $@" if $@;
last;
}
close $fh;
$result = "undef" unless defined $result;
return $result;
}
=item pasthru (o)
Defines the string that is passed to recursive make calls in
subdirectories.
=cut
sub pasthru {
my($self) = shift;
my(@m);
my(@pasthru);
my($sep) = $Is{VMS} ? ',' : '';
$sep .= "\\\n\t";
foreach my $key (qw(LIB LIBPERL_A LINKTYPE OPTIMIZE
PREFIX INSTALL_BASE)
)
{
next unless defined $self->{$key};
push @pasthru, "$key=\"\$($key)\"";
}
foreach my $key (qw(DEFINE INC)) {
next unless defined $self->{$key};
push @pasthru, "PASTHRU_$key=\"\$(PASTHRU_$key)\"";
}
push @m, "\nPASTHRU = ", join ($sep, @pasthru), "\n";
join "", @m;
}
=item perl_script
Takes one argument, a file name, and returns the file name, if the
argument is likely to be a perl script. On MM_Unix this is true for
any ordinary, readable file.
=cut
sub perl_script {
my($self,$file) = @_;
return $file if -r $file && -f _;
return;
}
=item perldepend (o)
Defines the dependency from all *.h files that come with the perl
distribution.
=cut
sub perldepend {
my($self) = shift;
my(@m);
my $make_config = $self->cd('$(PERL_SRC)', '$(MAKE) lib/Config.pm');
push @m, sprintf <<'MAKE_FRAG', $make_config if $self->{PERL_SRC};
# Check for unpropogated config.sh changes. Should never happen.
# We do NOT just update config.h because that is not sufficient.
# An out of date config.h is not fatal but complains loudly!
$(PERL_INC)/config.h: $(PERL_SRC)/config.sh
-$(NOECHO) $(ECHO) "Warning: $(PERL_INC)/config.h out of date with $(PERL_SRC)/config.sh"; false
$(PERL_ARCHLIB)/Config.pm: $(PERL_SRC)/config.sh
$(NOECHO) $(ECHO) "Warning: $(PERL_ARCHLIB)/Config.pm may be out of date with $(PERL_SRC)/config.sh"
%s
MAKE_FRAG
return join "", @m unless $self->needs_linking;
push @m, q{
PERL_HDRS = \
$(PERL_INC)/EXTERN.h \
$(PERL_INC)/INTERN.h \
$(PERL_INC)/XSUB.h \
$(PERL_INC)/av.h \
$(PERL_INC)/cc_runtime.h \
$(PERL_INC)/config.h \
$(PERL_INC)/cop.h \
$(PERL_INC)/cv.h \
$(PERL_INC)/dosish.h \
$(PERL_INC)/embed.h \
$(PERL_INC)/embedvar.h \
$(PERL_INC)/fakethr.h \
$(PERL_INC)/form.h \
$(PERL_INC)/gv.h \
$(PERL_INC)/handy.h \
$(PERL_INC)/hv.h \
$(PERL_INC)/intrpvar.h \
$(PERL_INC)/iperlsys.h \
$(PERL_INC)/keywords.h \
$(PERL_INC)/mg.h \
$(PERL_INC)/nostdio.h \
$(PERL_INC)/op.h \
$(PERL_INC)/opcode.h \
$(PERL_INC)/patchlevel.h \
$(PERL_INC)/perl.h \
$(PERL_INC)/perlio.h \
$(PERL_INC)/perlsdio.h \
$(PERL_INC)/perlsfio.h \
$(PERL_INC)/perlvars.h \
$(PERL_INC)/perly.h \
$(PERL_INC)/pp.h \
$(PERL_INC)/pp_proto.h \
$(PERL_INC)/proto.h \
$(PERL_INC)/regcomp.h \
$(PERL_INC)/regexp.h \
$(PERL_INC)/regnodes.h \
$(PERL_INC)/scope.h \
$(PERL_INC)/sv.h \
$(PERL_INC)/thread.h \
$(PERL_INC)/unixish.h \
$(PERL_INC)/util.h
$(OBJECT) : $(PERL_HDRS)
} if $self->{OBJECT};
push @m, join(" ", values %{$self->{XS}})." : \$(XSUBPPDEPS)\n" if %{$self->{XS}};
join "\n", @m;
}
=item perm_rw (o)
Returns the attribute C<PERM_RW> or the string C<644>.
Used as the string that is passed
to the C<chmod> command to set the permissions for read/writeable files.
MakeMaker chooses C<644> because it has turned out in the past that
relying on the umask provokes hard-to-track bug reports.
When the return value is used by the perl function C<chmod>, it is
interpreted as an octal value.
=cut
sub perm_rw {
return shift->{PERM_RW};
}
=item perm_rwx (o)
Returns the attribute C<PERM_RWX> or the string C<755>,
i.e. the string that is passed
to the C<chmod> command to set the permissions for executable files.
See also perl_rw.
=cut
sub perm_rwx {
return shift->{PERM_RWX};
}
=item pm_to_blib
Defines target that copies all files in the hash PM to their
destination and autosplits them. See L<ExtUtils::Install/DESCRIPTION>
=cut
sub pm_to_blib {
my $self = shift;
my($autodir) = $self->catdir('$(INST_LIB)','auto');
my $r = q{
pm_to_blib : $(TO_INST_PM)
};
my $pm_to_blib = $self->oneliner(<<CODE, ['-MExtUtils::Install']);
pm_to_blib({\@ARGV}, '$autodir', '\$(PM_FILTER)')
CODE
my @cmds = $self->split_command($pm_to_blib, %{$self->{PM}});
$r .= join '', map { "\t\$(NOECHO) $_\n" } @cmds;
$r .= qq{\t\$(NOECHO) \$(TOUCH) pm_to_blib\n};
return $r;
}
=item post_constants (o)
Returns an empty string per default. Dedicated to overrides from
within Makefile.PL after all constants have been defined.
=cut
sub post_constants{
"";
}
=item post_initialize (o)
Returns an empty string per default. Used in Makefile.PLs to add some
chunk of text to the Makefile after the object is initialized.
=cut
sub post_initialize {
"";
}
=item postamble (o)
Returns an empty string. Can be used in Makefile.PLs to write some
text to the Makefile at the end.
=cut
sub postamble {
"";
}
=item ppd
Defines target that creates a PPD (Perl Package Description) file
for a binary distribution.
=cut
sub ppd {
my($self) = @_;
my ($pack_ver) = join ",", (split (/\./, $self->{VERSION}), (0)x4)[0..3];
my $abstract = $self->{ABSTRACT} || '';
$abstract =~ s/\n/\\n/sg;
$abstract =~ s/</</g;
$abstract =~ s/>/>/g;
my $author = $self->{AUTHOR} || '';
$author =~ s/</</g;
$author =~ s/>/>/g;
my $ppd_xml = sprintf <<'PPD_HTML', $pack_ver, $abstract, $author;
<SOFTPKG NAME="$(DISTNAME)" VERSION="%s">
<TITLE>$(DISTNAME)</TITLE>
<ABSTRACT>%s</ABSTRACT>
<AUTHOR>%s</AUTHOR>
PPD_HTML
$ppd_xml .= " <IMPLEMENTATION>\n";
foreach my $prereq (sort keys %{$self->{PREREQ_PM}}) {
my $pre_req = $prereq;
$pre_req =~ s/::/-/g;
my ($dep_ver) = join ",", (split (/\./, $self->{PREREQ_PM}{$prereq}),
(0) x 4) [0 .. 3];
$ppd_xml .= sprintf <<'PPD_OUT', $pre_req, $dep_ver;
<DEPENDENCY NAME="%s" VERSION="%s" />
PPD_OUT
}
my $archname = $Config{archname};
if ($] >= 5.008) {
# archname did not change from 5.6 to 5.8, but those versions may
# not be not binary compatible so now we append the part of the
# version that changes when binary compatibility may change
$archname .= "-". substr($Config{version},0,3);
}
$ppd_xml .= sprintf <<'PPD_OUT', $archname;
<OS NAME="$(OSNAME)" />
<ARCHITECTURE NAME="%s" />
PPD_OUT
if ($self->{PPM_INSTALL_SCRIPT}) {
if ($self->{PPM_INSTALL_EXEC}) {
$ppd_xml .= sprintf qq{ <INSTALL EXEC="%s">%s</INSTALL>\n},
$self->{PPM_INSTALL_EXEC}, $self->{PPM_INSTALL_SCRIPT};
}
else {
$ppd_xml .= sprintf qq{ <INSTALL>%s</INSTALL>\n},
$self->{PPM_INSTALL_SCRIPT};
}
}
my ($bin_location) = $self->{BINARY_LOCATION} || '';
$bin_location =~ s/\\/\\\\/g;
$ppd_xml .= sprintf <<'PPD_XML', $bin_location;
<CODEBASE HREF="%s" />
</IMPLEMENTATION>
</SOFTPKG>
PPD_XML
my @ppd_cmds = $self->echo($ppd_xml, '$(DISTNAME).ppd');
return sprintf <<'PPD_OUT', join "\n\t", @ppd_cmds;
# Creates a PPD (Perl Package Description) for a binary distribution.
ppd :
%s
PPD_OUT
}
=item prefixify
$MM->prefixify($var, $prefix, $new_prefix, $default);
Using either $MM->{uc $var} || $Config{lc $var}, it will attempt to
replace it's $prefix with a $new_prefix.
Should the $prefix fail to match I<AND> a PREFIX was given as an
argument to WriteMakefile() it will set it to the $new_prefix +
$default. This is for systems whose file layouts don't neatly fit into
our ideas of prefixes.
This is for heuristics which attempt to create directory structures
that mirror those of the installed perl.
For example:
$MM->prefixify('installman1dir', '/usr', '/home/foo', 'man/man1');
this will attempt to remove '/usr' from the front of the
$MM->{INSTALLMAN1DIR} path (initializing it to $Config{installman1dir}
if necessary) and replace it with '/home/foo'. If this fails it will
simply use '/home/foo/man/man1'.
=cut
sub prefixify {
my($self,$var,$sprefix,$rprefix,$default) = @_;
my $path = $self->{uc $var} ||
$Config_Override{lc $var} || $Config{lc $var} || '';
$rprefix .= '/' if $sprefix =~ m|/$|;
print STDERR " prefixify $var => $path\n" if $Verbose >= 2;
print STDERR " from $sprefix to $rprefix\n" if $Verbose >= 2;
if( $self->{ARGS}{PREFIX} && $self->file_name_is_absolute($path) &&
$path !~ s{^\Q$sprefix\E\b}{$rprefix}s )
{
print STDERR " cannot prefix, using default.\n" if $Verbose >= 2;
print STDERR " no default!\n" if !$default && $Verbose >= 2;
$path = $self->catdir($rprefix, $default) if $default;
}
print " now $path\n" if $Verbose >= 2;
return $self->{uc $var} = $path;
}
=item processPL (o)
Defines targets to run *.PL files.
=cut
sub processPL {
my $self = shift;
my $pl_files = $self->{PL_FILES};
return "" unless $pl_files;
my $m = '';
foreach my $plfile (sort keys %$pl_files) {
my $list = ref($pl_files->{$plfile})
? $pl_files->{$plfile}
: [$pl_files->{$plfile}];
foreach my $target (@$list) {
if( $Is{VMS} ) {
$plfile = vmsify($self->eliminate_macros($plfile));
$target = vmsify($self->eliminate_macros($target));
}
# Normally a .PL file runs AFTER pm_to_blib so it can have
# blib in its @INC and load the just built modules. BUT if
# the generated module is something in $(TO_INST_PM) which
# pm_to_blib depends on then it can't depend on pm_to_blib
# else we have a dependency loop.
my $pm_dep;
my $perlrun;
if( defined $self->{PM}{$target} ) {
$pm_dep = '';
$perlrun = 'PERLRUN';
}
else {
$pm_dep = 'pm_to_blib';
$perlrun = 'PERLRUNINST';
}
$m .= <<MAKE_FRAG;
all :: $target
\$(NOECHO) \$(NOOP)
$target :: $plfile $pm_dep
\$($perlrun) $plfile $target
MAKE_FRAG
}
}
return $m;
}
=item quote_paren
Backslashes parentheses C<()> in command line arguments.
Doesn't handle recursive Makefile C<$(...)> constructs,
but handles simple ones.
=cut
sub quote_paren {
my $arg = shift;
$arg =~ s{\$\((.+?)\)}{\$\\\\($1\\\\)}g; # protect $(...)
$arg =~ s{(?<!\\)([()])}{\\$1}g; # quote unprotected
$arg =~ s{\$\\\\\((.+?)\\\\\)}{\$($1)}g; # unprotect $(...)
return $arg;
}
=item replace_manpage_separator
my $man_name = $MM->replace_manpage_separator($file_path);
Takes the name of a package, which may be a nested package, in the
form 'Foo/Bar.pm' and replaces the slash with C<::> or something else
safe for a man page file name. Returns the replacement.
=cut
sub replace_manpage_separator {
my($self,$man) = @_;
$man =~ s,/+,::,g;
return $man;
}
=item cd
=cut
sub cd {
my($self, $dir, @cmds) = @_;
# No leading tab and no trailing newline makes for easier embedding
my $make_frag = join "\n\t", map { "cd $dir && $_" } @cmds;
return $make_frag;
}
=item oneliner
=cut
sub oneliner {
my($self, $cmd, $switches) = @_;
$switches = [] unless defined $switches;
# Strip leading and trailing newlines
$cmd =~ s{^\n+}{};
$cmd =~ s{\n+$}{};
my @cmds = split /\n/, $cmd;
$cmd = join " \n\t -e ", map $self->quote_literal($_), @cmds;
$cmd = $self->escape_newlines($cmd);
$switches = join ' ', @$switches;
return qq{\$(ABSPERLRUN) $switches -e $cmd --};
}
=item quote_literal
=cut
sub quote_literal {
my($self, $text) = @_;
# I think all we have to quote is single quotes and I think
# this is a safe way to do it.
$text =~ s{'}{'\\''}g;
return "'$text'";
}
=item escape_newlines
=cut
sub escape_newlines {
my($self, $text) = @_;
$text =~ s{\n}{\\\n}g;
return $text;
}
=item max_exec_len
Using POSIX::ARG_MAX. Otherwise falling back to 4096.
=cut
sub max_exec_len {
my $self = shift;
if (!defined $self->{_MAX_EXEC_LEN}) {
if (my $arg_max = eval { require POSIX; &POSIX::ARG_MAX }) {
$self->{_MAX_EXEC_LEN} = $arg_max;
}
else { # POSIX minimum exec size
$self->{_MAX_EXEC_LEN} = 4096;
}
}
return $self->{_MAX_EXEC_LEN};
}
=item static (o)
Defines the static target.
=cut
sub static {
# --- Static Loading Sections ---
my($self) = shift;
'
## $(INST_PM) has been moved to the all: target.
## It remains here for awhile to allow for old usage: "make static"
static :: $(FIRST_MAKEFILE) $(INST_STATIC)
$(NOECHO) $(NOOP)
';
}
=item static_lib (o)
Defines how to produce the *.a (or equivalent) files.
=cut
sub static_lib {
my($self) = @_;
return '' unless $self->has_link_code;
my(@m);
push(@m, <<'END');
$(INST_STATIC) : $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists
$(RM_RF) $@
END
# If this extension has its own library (eg SDBM_File)
# then copy that to $(INST_STATIC) and add $(OBJECT) into it.
push(@m, <<'MAKE_FRAG') if $self->{MYEXTLIB};
$(CP) $(MYEXTLIB) $@
MAKE_FRAG
my $ar;
if (exists $self->{FULL_AR} && -x $self->{FULL_AR}) {
# Prefer the absolute pathed ar if available so that PATH
# doesn't confuse us. Perl itself is built with the full_ar.
$ar = 'FULL_AR';
} else {
$ar = 'AR';
}
push @m, sprintf <<'MAKE_FRAG', $ar;
$(%s) $(AR_STATIC_ARGS) $@ $(OBJECT) && $(RANLIB) $@
$(CHMOD) $(PERM_RWX) $@
$(NOECHO) $(ECHO) "$(EXTRALIBS)" > $(INST_ARCHAUTODIR)/extralibs.ld
MAKE_FRAG
# Old mechanism - still available:
push @m, <<'MAKE_FRAG' if $self->{PERL_SRC} && $self->{EXTRALIBS};
$(NOECHO) $(ECHO) "$(EXTRALIBS)" >> $(PERL_SRC)/ext.libs
MAKE_FRAG
join('', @m);
}
=item staticmake (o)
Calls makeaperl.
=cut
sub staticmake {
my($self, %attribs) = @_;
my(@static);
my(@searchdirs)=($self->{PERL_ARCHLIB}, $self->{SITEARCHEXP}, $self->{INST_ARCHLIB});
# And as it's not yet built, we add the current extension
# but only if it has some C code (or XS code, which implies C code)
if (@{$self->{C}}) {
@static = $self->catfile($self->{INST_ARCHLIB},
"auto",
$self->{FULLEXT},
"$self->{BASEEXT}$self->{LIB_EXT}"
);
}
# Either we determine now, which libraries we will produce in the
# subdirectories or we do it at runtime of the make.
# We could ask all subdir objects, but I cannot imagine, why it
# would be necessary.
# Instead we determine all libraries for the new perl at
# runtime.
my(@perlinc) = ($self->{INST_ARCHLIB}, $self->{INST_LIB}, $self->{PERL_ARCHLIB}, $self->{PERL_LIB});
$self->makeaperl(MAKE => $self->{MAKEFILE},
DIRS => \@searchdirs,
STAT => \@static,
INCL => \@perlinc,
TARGET => $self->{MAP_TARGET},
TMP => "",
LIBPERL => $self->{LIBPERL_A}
);
}
=item subdir_x (o)
Helper subroutine for subdirs
=cut
sub subdir_x {
my($self, $subdir) = @_;
my $subdir_cmd = $self->cd($subdir,
'$(MAKE) $(USEMAKEFILE) $(FIRST_MAKEFILE) all $(PASTHRU)'
);
return sprintf <<'EOT', $subdir_cmd;
subdirs ::
$(NOECHO) %s
EOT
}
=item subdirs (o)
Defines targets to process subdirectories.
=cut
sub subdirs {
# --- Sub-directory Sections ---
my($self) = shift;
my(@m);
# This method provides a mechanism to automatically deal with
# subdirectories containing further Makefile.PL scripts.
# It calls the subdir_x() method for each subdirectory.
foreach my $dir (@{$self->{DIR}}){
push(@m, $self->subdir_x($dir));
#### print "Including $dir subdirectory\n";
}
if (@m){
unshift(@m, "
# The default clean, realclean and test targets in this Makefile
# have automatically been given entries for each subdir.
");
} else {
push(@m, "\n# none")
}
join('',@m);
}
=item test (o)
Defines the test targets.
=cut
sub test {
# --- Test and Installation Sections ---
my($self, %attribs) = @_;
my $tests = $attribs{TESTS} || '';
if (!$tests && -d 't') {
$tests = $self->find_tests;
}
# note: 'test.pl' name is also hardcoded in init_dirscan()
my(@m);
push(@m,"
TEST_VERBOSE=0
TEST_TYPE=test_\$(LINKTYPE)
TEST_FILE = test.pl
TEST_FILES = $tests
TESTDB_SW = -d
testdb :: testdb_\$(LINKTYPE)
test :: \$(TEST_TYPE) subdirs-test
subdirs-test ::
\$(NOECHO) \$(NOOP)
");
foreach my $dir (@{ $self->{DIR} }) {
my $test = $self->cd($dir, '$(MAKE) test $(PASTHRU)');
push @m, <<END
subdirs-test ::
\$(NOECHO) $test
END
}
push(@m, "\t\$(NOECHO) \$(ECHO) 'No tests defined for \$(NAME) extension.'\n")
unless $tests or -f "test.pl" or @{$self->{DIR}};
push(@m, "\n");
push(@m, "test_dynamic :: pure_all\n");
push(@m, $self->test_via_harness('$(FULLPERLRUN)', '$(TEST_FILES)'))
if $tests;
push(@m, $self->test_via_script('$(FULLPERLRUN)', '$(TEST_FILE)'))
if -f "test.pl";
push(@m, "\n");
push(@m, "testdb_dynamic :: pure_all\n");
push(@m, $self->test_via_script('$(FULLPERLRUN) $(TESTDB_SW)',
'$(TEST_FILE)'));
push(@m, "\n");
# Occasionally we may face this degenerate target:
push @m, "test_ : test_dynamic\n\n";
if ($self->needs_linking()) {
push(@m, "test_static :: pure_all \$(MAP_TARGET)\n");
push(@m, $self->test_via_harness('./$(MAP_TARGET)', '$(TEST_FILES)')) if $tests;
push(@m, $self->test_via_script('./$(MAP_TARGET)', '$(TEST_FILE)')) if -f "test.pl";
push(@m, "\n");
push(@m, "testdb_static :: pure_all \$(MAP_TARGET)\n");
push(@m, $self->test_via_script('./$(MAP_TARGET) $(TESTDB_SW)', '$(TEST_FILE)'));
push(@m, "\n");
} else {
push @m, "test_static :: test_dynamic\n";
push @m, "testdb_static :: testdb_dynamic\n";
}
join("", @m);
}
=item test_via_harness (override)
For some reason which I forget, Unix machines like to have
PERL_DL_NONLAZY set for tests.
=cut
sub test_via_harness {
my($self, $perl, $tests) = @_;
return $self->SUPER::test_via_harness("PERL_DL_NONLAZY=1 $perl", $tests);
}
=item test_via_script (override)
Again, the PERL_DL_NONLAZY thing.
=cut
sub test_via_script {
my($self, $perl, $script) = @_;
return $self->SUPER::test_via_script("PERL_DL_NONLAZY=1 $perl", $script);
}
=item tools_other (o)
my $make_frag = $MM->tools_other;
Returns a make fragment containing definitions for the macros init_others()
initializes.
=cut
sub tools_other {
my($self) = shift;
my @m;
# We set PM_FILTER as late as possible so it can see all the earlier
# on macro-order sensitive makes such as nmake.
for my $tool (qw{ SHELL CHMOD CP MV NOOP NOECHO RM_F RM_RF TEST_F TEST_S TOUCH
UMASK_NULL DEV_NULL MKPATH EQUALIZE_TIMESTAMP
ECHO ECHO_N
UNINST VERBINST
MOD_INSTALL DOC_INSTALL UNINSTALL
WARN_IF_OLD_PACKLIST
MACROSTART MACROEND
USEMAKEFILE
PM_FILTER
FIXIN
} )
{
next unless defined $self->{$tool};
push @m, "$tool = $self->{$tool}\n";
}
return join "", @m;
}
=item tool_xsubpp (o)
Determines typemaps, xsubpp version, prototype behaviour.
=cut
sub tool_xsubpp {
my($self) = shift;
return "" unless $self->needs_linking;
my $xsdir;
my @xsubpp_dirs = @INC;
# Make sure we pick up the new xsubpp if we're building perl.
unshift @xsubpp_dirs, $self->{PERL_LIB} if $self->{PERL_CORE};
foreach my $dir (@xsubpp_dirs) {
$xsdir = $self->catdir($dir, 'ExtUtils');
if( -r $self->catfile($xsdir, "xsubpp") ) {
last;
}
}
my $tmdir = File::Spec->catdir($self->{PERL_LIB},"ExtUtils");
my(@tmdeps) = $self->catfile($tmdir,'typemap');
if( $self->{TYPEMAPS} ){
foreach my $typemap (@{$self->{TYPEMAPS}}){
if( ! -f $typemap ) {
warn "Typemap $typemap not found.\n";
}
else {
push(@tmdeps, $typemap);
}
}
}
push(@tmdeps, "typemap") if -f "typemap";
my(@tmargs) = map("-typemap $_", @tmdeps);
if( exists $self->{XSOPT} ){
unshift( @tmargs, $self->{XSOPT} );
}
if ($Is{VMS} &&
$Config{'ldflags'} &&
$Config{'ldflags'} =~ m!/Debug!i &&
(!exists($self->{XSOPT}) || $self->{XSOPT} !~ /linenumbers/)
)
{
unshift(@tmargs,'-nolinenumbers');
}
$self->{XSPROTOARG} = "" unless defined $self->{XSPROTOARG};
return qq{
XSUBPPDIR = $xsdir
XSUBPP = \$(XSUBPPDIR)\$(DFSEP)xsubpp
XSUBPPRUN = \$(PERLRUN) \$(XSUBPP)
XSPROTOARG = $self->{XSPROTOARG}
XSUBPPDEPS = @tmdeps \$(XSUBPP)
XSUBPPARGS = @tmargs
XSUBPP_EXTRA_ARGS =
};
};
=item all_target
Build man pages, too
=cut
sub all_target {
my $self = shift;
return <<'MAKE_EXT';
all :: pure_all manifypods
$(NOECHO) $(NOOP)
MAKE_EXT
}
=item top_targets (o)
Defines the targets all, subdirs, config, and O_FILES
=cut
sub top_targets {
# --- Target Sections ---
my($self) = shift;
my(@m);
push @m, $self->all_target, "\n" unless $self->{SKIPHASH}{'all'};
push @m, '
pure_all :: config pm_to_blib subdirs linkext
$(NOECHO) $(NOOP)
subdirs :: $(MYEXTLIB)
$(NOECHO) $(NOOP)
config :: $(FIRST_MAKEFILE) blibdirs
$(NOECHO) $(NOOP)
';
push @m, '
$(O_FILES): $(H_FILES)
' if @{$self->{O_FILES} || []} && @{$self->{H} || []};
push @m, q{
help :
perldoc ExtUtils::MakeMaker
};
join('',@m);
}
=item writedoc
Obsolete, deprecated method. Not used since Version 5.21.
=cut
sub writedoc {
# --- perllocal.pod section ---
my($self,$what,$name,@attribs)=@_;
my $time = localtime;
print "=head2 $time: $what C<$name>\n\n=over 4\n\n=item *\n\n";
print join "\n\n=item *\n\n", map("C<$_>",@attribs);
print "\n\n=back\n\n";
}
=item xs_c (o)
Defines the suffix rules to compile XS files to C.
=cut
sub xs_c {
my($self) = shift;
return '' unless $self->needs_linking();
'
.xs.c:
$(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $(XSUBPP_EXTRA_ARGS) $*.xs > $*.xsc && $(MV) $*.xsc $*.c
';
}
=item xs_cpp (o)
Defines the suffix rules to compile XS files to C++.
=cut
sub xs_cpp {
my($self) = shift;
return '' unless $self->needs_linking();
'
.xs.cpp:
$(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.xsc && $(MV) $*.xsc $*.cpp
';
}
=item xs_o (o)
Defines suffix rules to go from XS to object files directly. This is
only intended for broken make implementations.
=cut
sub xs_o { # many makes are too dumb to use xs_c then c_o
my($self) = shift;
return '' unless $self->needs_linking();
'
.xs$(OBJ_EXT):
$(XSUBPPRUN) $(XSPROTOARG) $(XSUBPPARGS) $*.xs > $*.xsc && $(MV) $*.xsc $*.c
$(CCCMD) $(CCCDLFLAGS) "-I$(PERL_INC)" $(PASTHRU_DEFINE) $(DEFINE) $*.c
';
}
1;
=back
=head1 SEE ALSO
L<ExtUtils::MakeMaker>
=cut
__END__
| 26.257771 | 158 | 0.581821 |
ed462b73738b69151caece3de97528bac79029d4 | 1,894 | pm | Perl | perun-rpc/src/main/perl/Perun/beans/ContactGroup.pm | tauceti2/perun | 81c34a7f249dfafdcbe982b750e687df4570c419 | [
"BSD-2-Clause"
]
| null | null | null | perun-rpc/src/main/perl/Perun/beans/ContactGroup.pm | tauceti2/perun | 81c34a7f249dfafdcbe982b750e687df4570c419 | [
"BSD-2-Clause"
]
| null | null | null | perun-rpc/src/main/perl/Perun/beans/ContactGroup.pm | tauceti2/perun | 81c34a7f249dfafdcbe982b750e687df4570c419 | [
"BSD-2-Clause"
]
| null | null | null | package Perun::beans::ContactGroup;
use strict;
use warnings;
use Perun::Common;
sub new
{
bless({});
}
sub fromHash
{
my $contactGroup = Perun::Common::fromHash(@_);
for my $owner (@{$contactGroup->{_owners}}) {
$owner = Perun::beans::Owner::fromHash("Perun::beans::Owner", $owner);
}
for my $user (@{$contactGroup->{_users}}) {
$user = Perun::beans::RichUser::fromHash("Perun::beans::RichUser", $user);
}
for my $group (@{$contactGroup->{_groups}}) {
$group = Perun::beans::Group::fromHash("Perun::beans::Group", $group);
}
my $facility = $contactGroup->{_facility};
$contactGroup->{_facility} = Perun::beans::Facility::fromHash("Perun::beans::Facility", $facility);
return $contactGroup;
}
sub TO_JSON
{
my $self = shift;
return {name => $self->{_name}, facility => $self->{_facility}, groups => $self->{_groups}, owners => $self->{_owners}, users => $self->{_users}};
}
sub getName
{
my $self = shift;
return $self->{_name};
}
sub setName
{
my $self = shift;
$self->{_name} = shift;
return;
}
sub getFacility
{
my $self = shift;
return $self->{_facility};
}
sub setFacility
{
my $self = shift;
$self->{_facility} = shift;
return;
}
sub getGroups
{
my $self = shift;
return @{$self->{_groups}};
}
sub setGroups
{
my $self = shift;
$self->{_groups} = shift;
return;
}
sub getOwners
{
my $self = shift;
return @{$self->{_owners}};
}
sub setOwners
{
my $self = shift;
$self->{_owners} = shift;
return;
}
sub getUsers
{
my $self = shift;
return @{$self->{_users}};
}
sub setUsers
{
my $self = shift;
$self->{_users} = shift;
return;
}
sub getCommonArrayRepresentation {
my $self = shift;
return ($self->{_name}, $self->{_facility});
}
sub getCommonArrayRepresentationHeading {
return ('Name', 'Facility');
}
1;
| 15.398374 | 154 | 0.597677 |
73ece0233b98a616cb08f064e8f960724d3a98b8 | 43,637 | pm | Perl | lib/Moose/Util/TypeConstraints.pm | rjbs/Moose | 82ecc2ca7ca84ec4b35c8ea69eafda6de92f78a4 | [
"Artistic-1.0"
]
| null | null | null | lib/Moose/Util/TypeConstraints.pm | rjbs/Moose | 82ecc2ca7ca84ec4b35c8ea69eafda6de92f78a4 | [
"Artistic-1.0"
]
| null | null | null | lib/Moose/Util/TypeConstraints.pm | rjbs/Moose | 82ecc2ca7ca84ec4b35c8ea69eafda6de92f78a4 | [
"Artistic-1.0"
]
| null | null | null | package Moose::Util::TypeConstraints;
our $VERSION = '2.2015';
use Carp ();
use Scalar::Util qw( blessed );
use Moose::Exporter;
use Moose::Deprecated;
## --------------------------------------------------------
# Prototyped subs must be predeclared because we have a
# circular dependency with Moose::Meta::Attribute et. al.
# so in case of us being use'd first the predeclaration
# ensures the prototypes are in scope when consumers are
# compiled.
# dah sugah!
sub where (&);
sub via (&);
sub message (&);
sub inline_as (&);
## --------------------------------------------------------
use Moose::Meta::TypeConstraint;
use Moose::Meta::TypeConstraint::Union;
use Moose::Meta::TypeConstraint::Parameterized;
use Moose::Meta::TypeConstraint::Parameterizable;
use Moose::Meta::TypeConstraint::Class;
use Moose::Meta::TypeConstraint::Role;
use Moose::Meta::TypeConstraint::Enum;
use Moose::Meta::TypeConstraint::DuckType;
use Moose::Meta::TypeCoercion;
use Moose::Meta::TypeCoercion::Union;
use Moose::Meta::TypeConstraint::Registry;
use Moose::Util 'throw_exception';
Moose::Exporter->setup_import_methods(
as_is => [
qw(
type subtype class_type role_type maybe_type duck_type
as where message inline_as
coerce from via
enum union
find_type_constraint
register_type_constraint
match_on_type )
],
);
## --------------------------------------------------------
## type registry and some useful functions for it
## --------------------------------------------------------
my $REGISTRY = Moose::Meta::TypeConstraint::Registry->new;
sub get_type_constraint_registry {$REGISTRY}
sub list_all_type_constraints { keys %{ $REGISTRY->type_constraints } }
sub export_type_constraints_as_functions {
my $pkg = caller();
no strict 'refs';
foreach my $constraint ( keys %{ $REGISTRY->type_constraints } ) {
my $tc = $REGISTRY->get_type_constraint($constraint)
->_compiled_type_constraint;
*{"${pkg}::${constraint}"}
= sub { $tc->( $_[0] ) ? 1 : undef }; # the undef is for compat
}
}
sub create_type_constraint_union {
_create_type_constraint_union(\@_);
}
sub create_named_type_constraint_union {
my $name = shift;
_create_type_constraint_union($name, \@_);
}
sub _create_type_constraint_union {
my $name;
$name = shift if @_ > 1;
my @tcs = @{ shift() };
my @type_constraint_names;
if ( scalar @tcs == 1 && _detect_type_constraint_union( $tcs[0] ) ) {
@type_constraint_names = _parse_type_constraint_union( $tcs[0] );
}
else {
@type_constraint_names = @tcs;
}
( scalar @type_constraint_names >= 2 )
|| throw_exception("UnionTakesAtleastTwoTypeNames");
my @type_constraints = map {
find_or_parse_type_constraint($_)
|| throw_exception( CouldNotLocateTypeConstraintForUnion => type_name => $_ );
} @type_constraint_names;
my %options = (
type_constraints => \@type_constraints
);
$options{name} = $name if defined $name;
return Moose::Meta::TypeConstraint::Union->new(%options);
}
sub create_parameterized_type_constraint {
my $type_constraint_name = shift;
my ( $base_type, $type_parameter )
= _parse_parameterized_type_constraint($type_constraint_name);
( defined $base_type && defined $type_parameter )
|| throw_exception( InvalidTypeGivenToCreateParameterizedTypeConstraint => type_name => $type_constraint_name );
if ( $REGISTRY->has_type_constraint($base_type) ) {
my $base_type_tc = $REGISTRY->get_type_constraint($base_type);
return _create_parameterized_type_constraint(
$base_type_tc,
$type_parameter
);
}
else {
throw_exception( InvalidBaseTypeGivenToCreateParameterizedTypeConstraint => type_name => $base_type );
}
}
sub _create_parameterized_type_constraint {
my ( $base_type_tc, $type_parameter ) = @_;
if ( $base_type_tc->can('parameterize') ) {
return $base_type_tc->parameterize($type_parameter);
}
else {
return Moose::Meta::TypeConstraint::Parameterized->new(
name => $base_type_tc->name . '[' . $type_parameter . ']',
parent => $base_type_tc,
type_parameter =>
find_or_create_isa_type_constraint($type_parameter),
);
}
}
#should we also support optimized checks?
sub create_class_type_constraint {
my ( $class, $options ) = @_;
# too early for this check
#find_type_constraint("ClassName")->check($class)
# || __PACKAGE__->_throw_error("Can't create a class type constraint because '$class' is not a class name");
my $pkg_defined_in = $options->{package_defined_in} || scalar( caller(1) );
if (my $type = $REGISTRY->get_type_constraint($class)) {
if (!($type->isa('Moose::Meta::TypeConstraint::Class') && $type->class eq $class)) {
throw_exception( TypeConstraintIsAlreadyCreated => package_defined_in => $pkg_defined_in,
type_name => $type->name,
);
}
else {
return $type;
}
}
my %options = (
class => $class,
name => $class,
package_defined_in => $pkg_defined_in,
%{ $options || {} }, # overrides options from above
);
$options{name} ||= "__ANON__";
my $tc = Moose::Meta::TypeConstraint::Class->new(%options);
$REGISTRY->add_type_constraint($tc);
return $tc;
}
sub create_role_type_constraint {
my ( $role, $options ) = @_;
# too early for this check
#find_type_constraint("ClassName")->check($class)
# || __PACKAGE__->_throw_error("Can't create a class type constraint because '$class' is not a class name");
my $pkg_defined_in = $options->{package_defined_in} || scalar( caller(1) );
if (my $type = $REGISTRY->get_type_constraint($role)) {
if (!($type->isa('Moose::Meta::TypeConstraint::Role') && $type->role eq $role)) {
throw_exception( TypeConstraintIsAlreadyCreated => type_name => $type->name,
package_defined_in => $pkg_defined_in
);
}
else {
return $type;
}
}
my %options = (
role => $role,
name => $role,
package_defined_in => $pkg_defined_in,
%{ $options || {} },
);
$options{name} ||= "__ANON__";
my $tc = Moose::Meta::TypeConstraint::Role->new(%options);
$REGISTRY->add_type_constraint($tc);
return $tc;
}
sub find_or_create_type_constraint {
my ( $type_constraint_name, $options_for_anon_type ) = @_;
if ( my $constraint
= find_or_parse_type_constraint($type_constraint_name) ) {
return $constraint;
}
elsif ( defined $options_for_anon_type ) {
# NOTE:
# if there is no $options_for_anon_type
# specified, then we assume they don't
# want to create one, and return nothing.
# otherwise assume that we should create
# an ANON type with the $options_for_anon_type
# options which can be passed in. It should
# be noted that these don't get registered
# so we need to return it.
# - SL
return Moose::Meta::TypeConstraint->new(
name => '__ANON__',
%{$options_for_anon_type}
);
}
return;
}
sub find_or_create_isa_type_constraint {
my ($type_constraint_name, $options) = @_;
find_or_parse_type_constraint($type_constraint_name)
|| create_class_type_constraint($type_constraint_name, $options);
}
sub find_or_create_does_type_constraint {
my ($type_constraint_name, $options) = @_;
find_or_parse_type_constraint($type_constraint_name)
|| create_role_type_constraint($type_constraint_name, $options);
}
sub find_or_parse_type_constraint {
my $type_constraint_name = normalize_type_constraint_name(shift);
my $constraint;
if ( $constraint = find_type_constraint($type_constraint_name) ) {
return $constraint;
}
elsif ( _detect_type_constraint_union($type_constraint_name) ) {
$constraint = create_type_constraint_union($type_constraint_name);
}
elsif ( _detect_parameterized_type_constraint($type_constraint_name) ) {
$constraint
= create_parameterized_type_constraint($type_constraint_name);
}
else {
return;
}
$REGISTRY->add_type_constraint($constraint);
return $constraint;
}
sub normalize_type_constraint_name {
my $type_constraint_name = shift;
$type_constraint_name =~ s/\s//g;
return $type_constraint_name;
}
sub _confess {
my $error = shift;
local $Carp::CarpLevel = $Carp::CarpLevel + 1;
Carp::confess($error);
}
## --------------------------------------------------------
## exported functions ...
## --------------------------------------------------------
sub find_type_constraint {
my $type = shift;
if ( blessed $type and $type->isa("Moose::Meta::TypeConstraint") ) {
return $type;
}
else {
return unless $REGISTRY->has_type_constraint($type);
return $REGISTRY->get_type_constraint($type);
}
}
sub register_type_constraint {
my $constraint = shift;
throw_exception( CannotRegisterUnnamedTypeConstraint => type => $constraint )
unless defined $constraint->name;
$REGISTRY->add_type_constraint($constraint);
return $constraint;
}
# type constructors
sub type {
my $name = shift;
my %p = map { %{$_} } @_;
return _create_type_constraint(
$name, undef, $p{where}, $p{message},
$p{inline_as},
);
}
sub subtype {
if ( @_ == 1 && !ref $_[0] ) {
throw_exception( NoParentGivenToSubtype => name => $_[0] );
}
# The blessed check is mostly to accommodate MooseX::Types, which
# uses an object which overloads stringification as a type name.
my $name = ref $_[0] && !blessed $_[0] ? undef : shift;
my %p = map { %{$_} } @_;
# subtype Str => where { ... };
if ( !exists $p{as} ) {
$p{as} = $name;
$name = undef;
}
return _create_type_constraint(
$name, $p{as}, $p{where}, $p{message},
$p{inline_as},
);
}
sub class_type {
create_class_type_constraint(@_);
}
sub role_type ($;$) {
create_role_type_constraint(@_);
}
sub maybe_type {
my ($type_parameter) = @_;
register_type_constraint(
$REGISTRY->get_type_constraint('Maybe')->parameterize($type_parameter)
);
}
sub duck_type {
my ( $type_name, @methods ) = @_;
if ( ref $type_name eq 'ARRAY' && !@methods ) {
@methods = ($type_name);
$type_name = undef;
}
if ( @methods == 1 && ref $methods[0] eq 'ARRAY' ) {
@methods = @{ $methods[0] };
}
else {
Moose::Deprecated::deprecated(
feature => 'non-arrayref form of duck_type',
message => "Passing a list of values to duck_type is deprecated. "
. "The method names should be wrapped in an arrayref.",
);
}
register_type_constraint(
create_duck_type_constraint(
$type_name,
\@methods,
)
);
}
sub coerce {
my ( $type_name, @coercion_map ) = @_;
_install_type_coercions( $type_name, \@coercion_map );
}
# The trick of returning @_ lets us avoid having to specify a
# prototype. Perl will parse this:
#
# subtype 'Foo'
# => as 'Str'
# => where { ... }
#
# as this:
#
# subtype( 'Foo', as( 'Str', where { ... } ) );
#
# If as() returns all its extra arguments, this just works, and
# preserves backwards compatibility.
sub as { +{ as => shift }, @_ }
sub where (&) { +{ where => $_[0] } }
sub message (&) { +{ message => $_[0] } }
sub inline_as (&) { +{ inline_as => $_[0] } }
sub from { @_ }
sub via (&) { $_[0] }
sub enum {
my ( $type_name, @values ) = @_;
# NOTE:
# if only an array-ref is passed then
# you get an anon-enum
# - SL
if ( ref $type_name eq 'ARRAY' ) {
@values == 0
|| throw_exception( EnumCalledWithAnArrayRefAndAdditionalArgs => array => $type_name,
args => \@values
);
@values = ($type_name);
$type_name = undef;
}
if ( @values == 1 && ref $values[0] eq 'ARRAY' ) {
@values = @{ $values[0] };
}
else {
Moose::Deprecated::deprecated(
feature => 'non-arrayref form of enum',
message => "Passing a list of values to enum is deprecated. "
. "Enum values should be wrapped in an arrayref.",
);
}
register_type_constraint(
create_enum_type_constraint(
$type_name,
\@values,
)
);
}
sub union {
my ( $type_name, @constraints ) = @_;
if ( ref $type_name eq 'ARRAY' ) {
@constraints == 0
|| throw_exception( UnionCalledWithAnArrayRefAndAdditionalArgs => array => $type_name,
args => \@constraints
);
@constraints = @$type_name;
$type_name = undef;
}
if ( @constraints == 1 && ref $constraints[0] eq 'ARRAY' ) {
@constraints = @{ $constraints[0] };
}
if ( defined $type_name ) {
return register_type_constraint(
create_named_type_constraint_union( $type_name, @constraints )
);
}
return create_type_constraint_union( @constraints );
}
sub create_enum_type_constraint {
my ( $type_name, $values ) = @_;
Moose::Meta::TypeConstraint::Enum->new(
name => $type_name || '__ANON__',
values => $values,
);
}
sub create_duck_type_constraint {
my ( $type_name, $methods ) = @_;
Moose::Meta::TypeConstraint::DuckType->new(
name => $type_name || '__ANON__',
methods => $methods,
);
}
sub match_on_type {
my ($to_match, @cases) = @_;
my $default;
if (@cases % 2 != 0) {
$default = pop @cases;
(ref $default eq 'CODE')
|| throw_exception( DefaultToMatchOnTypeMustBeCodeRef => to_match => $to_match,
default_action => $default,
cases_to_be_matched => \@cases
);
}
while (@cases) {
my ($type, $action) = splice @cases, 0, 2;
unless (blessed $type && $type->isa('Moose::Meta::TypeConstraint')) {
$type = find_or_parse_type_constraint($type)
|| throw_exception( CannotFindTypeGivenToMatchOnType => type => $type,
to_match => $to_match,
action => $action
);
}
(ref $action eq 'CODE')
|| throw_exception( MatchActionMustBeACodeRef => type_name => $type->name,
action => $action,
to_match => $to_match
);
if ($type->check($to_match)) {
local $_ = $to_match;
return $action->($to_match);
}
}
(defined $default)
|| throw_exception( NoCasesMatched => to_match => $to_match,
cases_to_be_matched => \@cases
);
{
local $_ = $to_match;
return $default->($to_match);
}
}
## --------------------------------------------------------
## desugaring functions ...
## --------------------------------------------------------
sub _create_type_constraint ($$$;$) {
my $name = shift;
my $parent = shift;
my $check = shift;
my $message = shift;
my $inlined = shift;
my $pkg_defined_in = scalar( caller(1) );
if ( defined $name ) {
my $type = $REGISTRY->get_type_constraint($name);
( $type->_package_defined_in eq $pkg_defined_in )
|| throw_exception( TypeConstraintIsAlreadyCreated => package_defined_in => $pkg_defined_in,
type_name => $type->name,
)
if defined $type;
if( $name !~ /^[\w:\.]+$/ ) {
throw_exception( InvalidNameForType => name => $name );
}
}
my %opts = (
name => $name,
package_defined_in => $pkg_defined_in,
( $check ? ( constraint => $check ) : () ),
( $message ? ( message => $message ) : () ),
( $inlined ? ( inlined => $inlined ) : () ),
);
my $constraint;
if (
defined $parent
and $parent
= blessed $parent
? $parent
: find_or_create_isa_type_constraint($parent)
) {
$constraint = $parent->create_child_type(%opts);
}
else {
$constraint = Moose::Meta::TypeConstraint->new(%opts);
}
$REGISTRY->add_type_constraint($constraint)
if defined $name;
return $constraint;
}
sub _install_type_coercions ($$) {
my ( $type_name, $coercion_map ) = @_;
my $type = find_type_constraint($type_name);
( defined $type )
|| throw_exception( CannotFindType => type_name => $type_name );
if ( $type->has_coercion ) {
$type->coercion->add_type_coercions(@$coercion_map);
}
else {
my $type_coercion = Moose::Meta::TypeCoercion->new(
type_coercion_map => $coercion_map,
type_constraint => $type
);
$type->coercion($type_coercion);
}
}
## --------------------------------------------------------
## type notation parsing ...
## --------------------------------------------------------
{
# All I have to say is mugwump++ cause I know
# do not even have enough regexp-fu to be able
# to have written this (I can only barely
# understand it as it is)
# - SL
use re "eval";
my $valid_chars = qr{[\w:\.]};
my $type_atom = qr{ (?>$valid_chars+) }x;
my $ws = qr{ (?>\s*) }x;
my $op_union = qr{ $ws \| $ws }x;
my ($type, $type_capture_parts, $type_with_parameter, $union, $any);
if (Class::MOP::IS_RUNNING_ON_5_10) {
my $type_pattern
= q{ (?&type_atom) (?: \[ (?&ws) (?&any) (?&ws) \] )? };
my $type_capture_parts_pattern
= q{ ((?&type_atom)) (?: \[ (?&ws) ((?&any)) (?&ws) \] )? };
my $type_with_parameter_pattern
= q{ (?&type_atom) \[ (?&ws) (?&any) (?&ws) \] };
my $union_pattern
= q{ (?&type) (?> (?: (?&op_union) (?&type) )+ ) };
my $any_pattern
= q{ (?&type) | (?&union) };
my $defines = qr{(?(DEFINE)
(?<valid_chars> $valid_chars)
(?<type_atom> $type_atom)
(?<ws> $ws)
(?<op_union> $op_union)
(?<type> $type_pattern)
(?<type_capture_parts> $type_capture_parts_pattern)
(?<type_with_parameter> $type_with_parameter_pattern)
(?<union> $union_pattern)
(?<any> $any_pattern)
)}x;
$type = qr{ $type_pattern $defines }x;
$type_capture_parts = qr{ $type_capture_parts_pattern $defines }x;
$type_with_parameter = qr{ $type_with_parameter_pattern $defines }x;
$union = qr{ $union_pattern $defines }x;
$any = qr{ $any_pattern $defines }x;
}
else {
$type
= qr{ $type_atom (?: \[ $ws (??{$any}) $ws \] )? }x;
$type_capture_parts
= qr{ ($type_atom) (?: \[ $ws ((??{$any})) $ws \] )? }x;
$type_with_parameter
= qr{ $type_atom \[ $ws (??{$any}) $ws \] }x;
$union
= qr{ $type (?> (?: $op_union $type )+ ) }x;
$any
= qr{ $type | $union }x;
}
sub _parse_parameterized_type_constraint {
{ no warnings 'void'; $any; } # force capture of interpolated lexical
$_[0] =~ m{ $type_capture_parts }x;
return ( $1, $2 );
}
sub _detect_parameterized_type_constraint {
{ no warnings 'void'; $any; } # force capture of interpolated lexical
$_[0] =~ m{ ^ $type_with_parameter $ }x;
}
sub _parse_type_constraint_union {
{ no warnings 'void'; $any; } # force capture of interpolated lexical
my $given = shift;
my @rv;
while ( $given =~ m{ \G (?: $op_union )? ($type) }gcx ) {
push @rv => $1;
}
( pos($given) eq length($given) )
|| throw_exception( CouldNotParseType => type => $given,
position => pos($given)
);
@rv;
}
sub _detect_type_constraint_union {
{ no warnings 'void'; $any; } # force capture of interpolated lexical
$_[0] =~ m{^ $type $op_union $type ( $op_union .* )? $}x;
}
}
## --------------------------------------------------------
# define some basic built-in types
## --------------------------------------------------------
# By making these classes immutable before creating all the types in
# Moose::Util::TypeConstraints::Builtin , we avoid repeatedly calling the slow
# MOP-based accessors.
$_->make_immutable(
inline_constructor => 1,
constructor_name => "_new",
# these are Class::MOP accessors, so they need inlining
inline_accessors => 1
) for grep { $_->is_mutable }
map { Class::MOP::class_of($_) }
qw(
Moose::Meta::TypeConstraint
Moose::Meta::TypeConstraint::Union
Moose::Meta::TypeConstraint::Parameterized
Moose::Meta::TypeConstraint::Parameterizable
Moose::Meta::TypeConstraint::Class
Moose::Meta::TypeConstraint::Role
Moose::Meta::TypeConstraint::Enum
Moose::Meta::TypeConstraint::DuckType
Moose::Meta::TypeConstraint::Registry
);
require Moose::Util::TypeConstraints::Builtins;
Moose::Util::TypeConstraints::Builtins::define_builtins($REGISTRY);
my @PARAMETERIZABLE_TYPES
= map { $REGISTRY->get_type_constraint($_) } qw[ScalarRef ArrayRef HashRef Maybe];
sub get_all_parameterizable_types {@PARAMETERIZABLE_TYPES}
sub add_parameterizable_type {
my $type = shift;
( blessed $type
&& $type->isa('Moose::Meta::TypeConstraint::Parameterizable') )
|| throw_exception( AddParameterizableTypeTakesParameterizableType => type_name => $type );
push @PARAMETERIZABLE_TYPES => $type;
}
## --------------------------------------------------------
# end of built-in types ...
## --------------------------------------------------------
{
my @BUILTINS = list_all_type_constraints();
sub list_all_builtin_type_constraints {@BUILTINS}
}
1;
# ABSTRACT: Type constraint system for Moose
__END__
=pod
=head1 SYNOPSIS
use Moose::Util::TypeConstraints;
subtype 'Natural',
as 'Int',
where { $_ > 0 };
subtype 'NaturalLessThanTen',
as 'Natural',
where { $_ < 10 },
message { "This number ($_) is not less than ten!" };
coerce 'Num',
from 'Str',
via { 0+$_ };
class_type 'DateTimeClass', { class => 'DateTime' };
role_type 'Barks', { role => 'Some::Library::Role::Barks' };
enum 'RGBColors', [qw(red green blue)];
union 'StringOrArray', [qw( String ArrayRef )];
no Moose::Util::TypeConstraints;
=head1 DESCRIPTION
This module provides Moose with the ability to create custom type
constraints to be used in attribute definition.
=head2 Important Caveat
This is B<NOT> a type system for Perl 5. These are type constraints,
and they are not used by Moose unless you tell it to. No type
inference is performed, expressions are not typed, etc. etc. etc.
A type constraint is at heart a small "check if a value is valid"
function. A constraint can be associated with an attribute. This
simplifies parameter validation, and makes your code clearer to read,
because you can refer to constraints by name.
=head2 Slightly Less Important Caveat
It is B<always> a good idea to quote your type names.
This prevents Perl from trying to execute the call as an indirect
object call. This can be an issue when you have a subtype with the
same name as a valid class.
For instance:
subtype DateTime => as Object => where { $_->isa('DateTime') };
will I<just work>, while this:
use DateTime;
subtype DateTime => as Object => where { $_->isa('DateTime') };
will fail silently and cause many headaches. The simple way to solve
this, as well as future proof your subtypes from classes which have
yet to have been created, is to quote the type name:
use DateTime;
subtype 'DateTime', as 'Object', where { $_->isa('DateTime') };
=head2 Default Type Constraints
This module also provides a simple hierarchy for Perl 5 types, here is
that hierarchy represented visually.
Any
Item
Bool
Maybe[`a]
Undef
Defined
Value
Str
Num
Int
ClassName
RoleName
Ref
ScalarRef[`a]
ArrayRef[`a]
HashRef[`a]
CodeRef
RegexpRef
GlobRef
FileHandle
Object
B<NOTE:> Any type followed by a type parameter C<[`a]> can be
parameterized, this means you can say:
ArrayRef[Int] # an array of integers
HashRef[CodeRef] # a hash of str to CODE ref mappings
ScalarRef[Int] # a reference to an integer
Maybe[Str] # value may be a string, may be undefined
If Moose finds a name in brackets that it does not recognize as an
existing type, it assumes that this is a class name, for example
C<ArrayRef[DateTime]>.
B<NOTE:> Unless you parameterize a type, then it is invalid to include
the square brackets. I.e. C<ArrayRef[]> will be treated as a new type
name, I<not> as a parameterization of C<ArrayRef>.
B<NOTE:> The C<Undef> type constraint for the most part works
correctly now, but edge cases may still exist, please use it
sparingly.
B<NOTE:> The C<ClassName> type constraint does a complex package
existence check. This means that your class B<must> be loaded for this
type constraint to pass.
B<NOTE:> The C<RoleName> constraint checks a string is a I<package
name> which is a role, like C<'MyApp::Role::Comparable'>.
=head2 Type Constraint Naming
Type names declared via this module can only contain alphanumeric
characters, colons (:), and periods (.).
Since the types created by this module are global, it is suggested
that you namespace your types just as you would namespace your
modules. So instead of creating a I<Color> type for your
B<My::Graphics> module, you would call the type
I<My::Graphics::Types::Color> instead.
=head2 Use with Other Constraint Modules
This module can play nicely with other constraint modules with some
slight tweaking. The C<where> clause in types is expected to be a
C<CODE> reference which checks its first argument and returns a
boolean. Since most constraint modules work in a similar way, it
should be simple to adapt them to work with Moose.
For instance, this is how you could use it with
L<Declare::Constraints::Simple> to declare a completely new type.
type 'HashOfArrayOfObjects',
where {
IsHashRef(
-keys => HasLength,
-values => IsArrayRef(IsObject)
)->(@_);
};
For more examples see the F<t/examples/example_w_DCS.t> test
file.
Here is an example of using L<Test::Deep> and its non-test
related C<eq_deeply> function.
type 'ArrayOfHashOfBarsAndRandomNumbers',
where {
eq_deeply($_,
array_each(subhashof({
bar => isa('Bar'),
random_number => ignore()
})))
};
For a complete example see the
F<t/examples/example_w_TestDeep.t> test file.
=head2 Error messages
Type constraints can also specify custom error messages, for when they fail to
validate. This is provided as just another coderef, which receives the invalid
value in C<$_>, as in:
subtype 'PositiveInt',
as 'Int',
where { $_ > 0 },
message { "$_ is not a positive integer!" };
If no message is specified, a default message will be used, which indicates
which type constraint was being used and what value failed. If
L<Devel::PartialDump> (version 0.14 or higher) is installed, it will be used to
display the invalid value, otherwise it will just be printed as is.
=head1 FUNCTIONS
=head2 Type Constraint Constructors
The following functions are used to create type constraints. They
will also register the type constraints your create in a global
registry that is used to look types up by name.
See the L</SYNOPSIS> for an example of how to use these.
=head3 subtype 'Name', as 'Parent', where { } ...
This creates a named subtype.
If you provide a parent that Moose does not recognize, it will
automatically create a new class type constraint for this name.
When creating a named type, the C<subtype> function should either be
called with the sugar helpers (C<where>, C<message>, etc), or with a
name and a hashref of parameters:
subtype( 'Foo', { where => ..., message => ... } );
The valid hashref keys are C<as> (the parent), C<where>, C<message>,
and C<inline_as>.
=head3 subtype as 'Parent', where { } ...
This creates an unnamed subtype and will return the type
constraint meta-object, which will be an instance of
L<Moose::Meta::TypeConstraint>.
When creating an anonymous type, the C<subtype> function should either
be called with the sugar helpers (C<where>, C<message>, etc), or with
just a hashref of parameters:
subtype( { where => ..., message => ... } );
=head3 class_type ($class, ?$options)
Creates a new subtype of C<Object> with the name C<$class> and the
metaclass L<Moose::Meta::TypeConstraint::Class>.
# Create a type called 'Box' which tests for objects which ->isa('Box')
class_type 'Box';
By default, the name of the type and the name of the class are the same, but
you can specify both separately.
# Create a type called 'Box' which tests for objects which ->isa('ObjectLibrary::Box');
class_type 'Box', { class => 'ObjectLibrary::Box' };
=head3 role_type ($role, ?$options)
Creates a C<Role> type constraint with the name C<$role> and the
metaclass L<Moose::Meta::TypeConstraint::Role>.
# Create a type called 'Walks' which tests for objects which ->does('Walks')
role_type 'Walks';
By default, the name of the type and the name of the role are the same, but
you can specify both separately.
# Create a type called 'Walks' which tests for objects which ->does('MooseX::Role::Walks');
role_type 'Walks', { role => 'MooseX::Role::Walks' };
=head3 maybe_type ($type)
Creates a type constraint for either C<undef> or something of the
given type.
=head3 duck_type ($name, \@methods)
This will create a subtype of Object and test to make sure the value
C<can()> do the methods in C<\@methods>.
This is intended as an easy way to accept non-Moose objects that
provide a certain interface. If you're using Moose classes, we
recommend that you use a C<requires>-only Role instead.
=head3 duck_type (\@methods)
If passed an ARRAY reference as the only parameter instead of the
C<$name>, C<\@methods> pair, this will create an unnamed duck type.
This can be used in an attribute definition like so:
has 'cache' => (
is => 'ro',
isa => duck_type( [qw( get_set )] ),
);
=head3 enum ($name, \@values)
This will create a basic subtype for a given set of strings.
The resulting constraint will be a subtype of C<Str> and
will match any of the items in C<\@values>. It is case sensitive.
See the L</SYNOPSIS> for a simple example.
B<NOTE:> This is not a true proper enum type, it is simply
a convenient constraint builder.
=head3 enum (\@values)
If passed an ARRAY reference as the only parameter instead of the
C<$name>, C<\@values> pair, this will create an unnamed enum. This
can then be used in an attribute definition like so:
has 'sort_order' => (
is => 'ro',
isa => enum([qw[ ascending descending ]]),
);
=head3 union ($name, \@constraints)
This will create a basic subtype where any of the provided constraints
may match in order to satisfy this constraint.
=head3 union (\@constraints)
If passed an ARRAY reference as the only parameter instead of the
C<$name>, C<\@constraints> pair, this will create an unnamed union.
This can then be used in an attribute definition like so:
has 'items' => (
is => 'ro',
isa => union([qw[ Str ArrayRef ]]),
);
This is similar to the existing string union:
isa => 'Str|ArrayRef'
except that it supports anonymous elements as child constraints:
has 'color' => (
isa => 'ro',
isa => union([ 'Int', enum([qw[ red green blue ]]) ]),
);
=head3 as 'Parent'
This is just sugar for the type constraint construction syntax.
It takes a single argument, which is the name of a parent type.
=head3 where { ... }
This is just sugar for the type constraint construction syntax.
It takes a subroutine reference as an argument. When the type
constraint is tested, the reference is run with the value to be tested
in C<$_>. This reference should return true or false to indicate
whether or not the constraint check passed.
=head3 message { ... }
This is just sugar for the type constraint construction syntax.
It takes a subroutine reference as an argument. When the type
constraint fails, then the code block is run with the value provided
in C<$_>. This reference should return a string, which will be used in
the text of the exception thrown.
=head3 inline_as { ... }
This can be used to define a "hand optimized" inlinable version of your type
constraint.
You provide a subroutine which will be called I<as a method> on a
L<Moose::Meta::TypeConstraint> object. It will receive a single parameter, the
name of the variable to check, typically something like C<"$_"> or C<"$_[0]">.
The subroutine should return a code string suitable for inlining. You can
assume that the check will be wrapped in parentheses when it is inlined.
The inlined code should include any checks that your type's parent types
do. If your parent type constraint defines its own inlining, you can simply use
that to avoid repeating code. For example, here is the inlining code for the
C<Value> type, which is a subtype of C<Defined>:
sub {
$_[0]->parent()->_inline_check($_[1])
. ' && !ref(' . $_[1] . ')'
}
=head3 type 'Name', where { } ...
This creates a base type, which has no parent.
The C<type> function should either be called with the sugar helpers
(C<where>, C<message>, etc), or with a name and a hashref of
parameters:
type( 'Foo', { where => ..., message => ... } );
The valid hashref keys are C<where>, C<message>, and C<inlined_as>.
=head2 Type Constraint Utilities
=head3 match_on_type $value => ( $type => \&action, ... ?\&default )
This is a utility function for doing simple type based dispatching similar to
match/case in OCaml and case/of in Haskell. It is not as featureful as those
languages, nor does not it support any kind of automatic destructuring
bind. Here is a simple Perl pretty printer dispatching over the core Moose
types.
sub ppprint {
my $x = shift;
match_on_type $x => (
HashRef => sub {
my $hash = shift;
'{ '
. (
join ", " => map { $_ . ' => ' . ppprint( $hash->{$_} ) }
sort keys %$hash
) . ' }';
},
ArrayRef => sub {
my $array = shift;
'[ ' . ( join ", " => map { ppprint($_) } @$array ) . ' ]';
},
CodeRef => sub {'sub { ... }'},
RegexpRef => sub { 'qr/' . $_ . '/' },
GlobRef => sub { '*' . B::svref_2object($_)->NAME },
Object => sub { $_->can('to_string') ? $_->to_string : $_ },
ScalarRef => sub { '\\' . ppprint( ${$_} ) },
Num => sub {$_},
Str => sub { '"' . $_ . '"' },
Undef => sub {'undef'},
=> sub { die "I don't know what $_ is" }
);
}
Or a simple JSON serializer:
sub to_json {
my $x = shift;
match_on_type $x => (
HashRef => sub {
my $hash = shift;
'{ '
. (
join ", " =>
map { '"' . $_ . '" : ' . to_json( $hash->{$_} ) }
sort keys %$hash
) . ' }';
},
ArrayRef => sub {
my $array = shift;
'[ ' . ( join ", " => map { to_json($_) } @$array ) . ' ]';
},
Num => sub {$_},
Str => sub { '"' . $_ . '"' },
Undef => sub {'null'},
=> sub { die "$_ is not acceptable json type" }
);
}
The matcher is done by mapping a C<$type> to an C<\&action>. The C<$type> can
be either a string type or a L<Moose::Meta::TypeConstraint> object, and
C<\&action> is a subroutine reference. This function will dispatch on the
first match for C<$value>. It is possible to have a catch-all by providing an
additional subroutine reference as the final argument to C<match_on_type>.
=head2 Type Coercion Constructors
You can define coercions for type constraints, which allow you to
automatically transform values to something valid for the type
constraint. If you ask your accessor to coerce by adding the option C<< coerce => 1 >>, then Moose will run
the type-coercion code first, followed by the type constraint
check. This feature should be used carefully as it is very powerful
and could easily take off a limb if you are not careful.
See the L</SYNOPSIS> for an example of how to use these.
=head3 coerce 'Name', from 'OtherName', via { ... }
This defines a coercion from one type to another. The C<Name> argument
is the type you are coercing I<to>.
To define multiple coercions, supply more sets of from/via pairs:
coerce 'Name',
from 'OtherName', via { ... },
from 'ThirdName', via { ... };
=head3 from 'OtherName'
This is just sugar for the type coercion construction syntax.
It takes a single type name (or type object), which is the type being
coerced I<from>.
=head3 via { ... }
This is just sugar for the type coercion construction syntax.
It takes a subroutine reference. This reference will be called with
the value to be coerced in C<$_>. It is expected to return a new value
of the proper type for the coercion.
=head2 Creating and Finding Type Constraints
These are additional functions for creating and finding type
constraints. Most of these functions are not available for
importing. The ones that are importable as specified.
=head3 find_type_constraint($type_name)
This function can be used to locate the L<Moose::Meta::TypeConstraint>
object for a named type.
This function is importable.
=head3 register_type_constraint($type_object)
This function will register a L<Moose::Meta::TypeConstraint> with the
global type registry.
This function is importable.
=head3 normalize_type_constraint_name($type_constraint_name)
This method takes a type constraint name and returns the normalized
form. This removes any whitespace in the string.
=head3 create_type_constraint_union($pipe_separated_types | @type_constraint_names)
=head3 create_named_type_constraint_union($name, $pipe_separated_types | @type_constraint_names)
This can take a union type specification like C<'Int|ArrayRef[Int]'>,
or a list of names. It returns a new
L<Moose::Meta::TypeConstraint::Union> object.
=head3 create_parameterized_type_constraint($type_name)
Given a C<$type_name> in the form of C<'BaseType[ContainerType]'>,
this will create a new L<Moose::Meta::TypeConstraint::Parameterized>
object. The C<BaseType> must already exist as a parameterizable
type.
=head3 create_class_type_constraint($class, $options)
Given a class name this function will create a new
L<Moose::Meta::TypeConstraint::Class> object for that class name.
The C<$options> is a hash reference that will be passed to the
L<Moose::Meta::TypeConstraint::Class> constructor (as a hash).
=head3 create_role_type_constraint($role, $options)
Given a role name this function will create a new
L<Moose::Meta::TypeConstraint::Role> object for that role name.
The C<$options> is a hash reference that will be passed to the
L<Moose::Meta::TypeConstraint::Role> constructor (as a hash).
=head3 create_enum_type_constraint($name, $values)
Given a enum name this function will create a new
L<Moose::Meta::TypeConstraint::Enum> object for that enum name.
=head3 create_duck_type_constraint($name, $methods)
Given a duck type name this function will create a new
L<Moose::Meta::TypeConstraint::DuckType> object for that enum name.
=head3 find_or_parse_type_constraint($type_name)
Given a type name, this first attempts to find a matching constraint
in the global registry.
If the type name is a union or parameterized type, it will create a
new object of the appropriate, but if given a "regular" type that does
not yet exist, it simply returns false.
When given a union or parameterized type, the member or base type must
already exist.
If it creates a new union or parameterized type, it will add it to the
global registry.
=head3 find_or_create_isa_type_constraint($type_name)
=head3 find_or_create_does_type_constraint($type_name)
These functions will first call C<find_or_parse_type_constraint>. If
that function does not return a type, a new type object will
be created.
The C<isa> variant will use C<create_class_type_constraint> and the
C<does> variant will use C<create_role_type_constraint>.
=head3 get_type_constraint_registry
Returns the L<Moose::Meta::TypeConstraint::Registry> object which
keeps track of all type constraints.
=head3 list_all_type_constraints
This will return a list of type constraint names in the global
registry. You can then fetch the actual type object using
C<find_type_constraint($type_name)>.
=head3 list_all_builtin_type_constraints
This will return a list of builtin type constraints, meaning those
which are defined in this module. See the L<Default Type Constraints>
section for a complete list.
=head3 export_type_constraints_as_functions
This will export all the current type constraints as functions into
the caller's namespace (C<Int()>, C<Str()>, etc). Right now, this is
mostly used for testing, but it might prove useful to others.
=head3 get_all_parameterizable_types
This returns all the parameterizable types that have been registered,
as a list of type objects.
=head3 add_parameterizable_type($type)
Adds C<$type> to the list of parameterizable types
=head1 BUGS
See L<Moose/BUGS> for details on reporting bugs.
=cut
| 31.598117 | 120 | 0.611064 |
ed129965f17e75be57fa041e4de2a10917c8d0cb | 8,856 | pl | Perl | models/MITgcm_annulus/shell_scripts/coseq.pl | zhangshixuan1987/DART | 60e1a7deda82fc27542395f5625ea1e8ae48fa0c | [
"Apache-2.0"
]
| 65 | 2019-10-16T13:31:06.000Z | 2022-03-14T11:52:58.000Z | models/MITgcm_annulus/shell_scripts/coseq.pl | zhangshixuan1987/DART | 60e1a7deda82fc27542395f5625ea1e8ae48fa0c | [
"Apache-2.0"
]
| 283 | 2019-09-23T15:48:34.000Z | 2022-03-31T21:44:41.000Z | models/MITgcm_annulus/shell_scripts/coseq.pl | zhangshixuan1987/DART | 60e1a7deda82fc27542395f5625ea1e8ae48fa0c | [
"Apache-2.0"
]
| 67 | 2019-09-19T22:13:24.000Z | 2022-03-20T15:58:26.000Z | #!/usr/bin/perl
#
# DART software - Copyright UCAR. This open source software is provided
# by UCAR, "as is", without charge, subject to all terms of use at
# http://www.image.ucar.edu/DAReS/DART/DART_download
#
# DART $Id$
#
# This perl script generates a file that can be redirected into
# create_obs_seequence. For the MITgcm annulus the script
# requires 10 pieces of information from STDIN. As the MITgcm
# configuration currently stands, there are 5 different variables
# that are assimilated, and the user is free to specify the
# observational density and error covariance for each of the five
# variables independently. The script assumes that the output
# filename is set_def.out, and it assumes a single uniqe observation
# set.
#
# The user inputs are the spacing between observations for each
# of the five variable types (the script figures
# out the resulting observation locations under the assumption
# that the first observation is at location 1) and the observational
# variance for each of the five variables (the script assumes all
# observations of that variable have the same error variance).
#
# After running this script, the user runs the command:
#
# ./create_obs_sequence < coseq.dat
# specify the dimensions in the different directions
$naz=120;
$nrad=31;
$nzed=29;
# specify the number of elements per variable = naz*nrad*nzed
$statesize = $naz*$nrad*$nzed;
# construct a mask for where the fluid is!
$icount=0;
for ($k = 1; $k <= $nzed; $k++) {
for ($j = 1; $j <= 8; $j++) {
for ($i = 1; $i <= $naz; $i++) {
$icount++;
$mask[$icount]=0;
}
}
for ($j = 9; $j <= $nrad; $j++) {
for ($i = 1; $i <= $naz; $i++) {
$icount++;
$mask[$icount]=1;
}
}
}
# open output file
open(OUT,'>coseq.dat');
# Output a large number for memory allocation purposes.
# If the subsequent running of ./create_obs_sequence doesn't
# end with the line:
# write_obs_seq opening formatted file set_def.out
# then this number must be made larger.
print OUT "100000\n";
# Output the number of copies of data. Since only creating
# a definition here, output 0
print OUT "0\n";
# Output the number of quality control values per field. There
# is not QC used here.
print OUT "0\n";
# Obtain spacing between observations, assuming you start at point 1
print "Enter observation information for the U variable.\n";
print "This script assumes that the first observation is at U(1).\n";
print "Input the subsequent spacing between obs: ";
$spaceobs=<STDIN>;
# Figure out how many U observation locations this implies
$a=1;
$numobs=0;
while($a + $spaceobs < $statesize) {
$a = $a + $spaceobs;
$numobs++;
}
$numobsout=$numobs+1;
print "Resulting number of obs is: ";
print "$numobsout.\n";
# Obtain error variances
print "This script assumes that all U observations have the same error variance.\n";
print "Input this observational error variance: ";
$var=<STDIN>;
# Put variance and observation location information
# into output file
$loc=1;
if ($mask[$loc] > 0) {
print OUT "0\n"; # enter another ob info
print OUT "-$loc\n"; # identity ob at $loc
print OUT "0, 0\n"; # time (meaningless here)
print OUT $var; # error variance
}
for ($i=0; $i < $numobs; $i++) {
$loc = $loc + $spaceobs;
if ($mask[$loc] > 0) {
print OUT "0\n"; # enter another ob info
print OUT "-$loc\n"; # identity ob at $loc
print OUT "0, 0\n"; # time (meaningless here)
print OUT $var; # error variance
}
}
#-------
# Obtain spacing between observations, assuming you start at point 1
print "Enter observation information for the V variable.\n";
print "This script assumes that the first observation is at V(1).\n";
print "Input the subsequent spacing between obs: ";
$spaceobs=<STDIN>;
# Figure out how many V observation locations this implies
$a=1;
$numobs=0;
while($a + $spaceobs < $statesize) {
$a = $a + $spaceobs;
$numobs++;
}
$numobsout=$numobs+1;
print "Resulting number of obs is: ";
print "$numobsout.\n";
# Obtain error variances
print "This script assumes that all V observations have the same error variance.\n";
print "Input this observational error variance: ";
$var=<STDIN>;
# Put variance and observation location information
# into output file
$loc = $statesize + 1;
if ($mask[$loc] > 0) {
print OUT "0\n"; # enter another ob info
print OUT "-$loc\n"; # identity ob at $loc
print OUT "0, 0\n"; # time (meaningless here)
print OUT $var; # error variance
}
for ($i=0; $i < $numobs; $i++) {
$loc = $loc + $spaceobs;
if ($mask[$loc] > 0) {
print OUT "0\n"; # enter another ob info
print OUT "-$loc\n"; # identity ob at $loc
print OUT "0, 0\n"; # time (meaningless here)
print OUT $var; # error variance
}
}
#-------
# Obtain spacing between observations, assuming you start at point 1
print "Enter observation information for the W variable.\n";
print "This script assumes that the first observation is at W(1).\n";
print "Input the subsequent spacing between obs: ";
$spaceobs=<STDIN>;
# Figure out how many W observation locations this implies
$a=1;
$numobs=0;
while($a + $spaceobs < $statesize) {
$a = $a + $spaceobs;
$numobs++;
}
$numobsout=$numobs+1;
print "Resulting number of obs is: ";
print "$numobsout.\n";
# Obtain error variances
print "This script assumes that all W observations have the same error variance.\n";
print "Input this observational error variance: ";
$var=<STDIN>;
# Put variance and observation location information
# into output file
$loc = 2*$statesize + 1;
if ($mask[$loc] > 0) {
print OUT "0\n"; # enter another ob info
print OUT "-$loc\n"; # identity ob at $loc
print OUT "0, 0\n"; # time (meaningless here)
print OUT $var; # error variance
}
for ($i=0; $i < $numobs; $i++) {
$loc = $loc + $spaceobs;
if ($mask[$loc] > 0) {
print OUT "0\n"; # enter another ob info
print OUT "-$loc\n"; # identity ob at $loc
print OUT "0, 0\n"; # time (meaningless here)
print OUT $var; # error variance
}
}
#-------
# Obtain spacing between observations, assuming you start at point 1
print "Enter observation information for the T variable.\n";
print "This script assumes that the first observation is at T(1).\n";
print "Input the subsequent spacing between obs: ";
$spaceobs=<STDIN>;
# Figure out how many T observation locations this implies
$a=1;
$numobs=0;
while($a + $spaceobs < $statesize) {
$a = $a + $spaceobs;
$numobs++;
}
$numobsout=$numobs+1;
print "Resulting number of obs is: ";
print "$numobsout.\n";
# Obtain error variances
print "This script assumes that all T observations have the same error variance.\n";
print "Input this observational error variance: ";
$var=<STDIN>;
# Put variance and observation location information
# into output file
$loc = 3*$statesize + 1;
if ($mask[$loc] > 0) {
print OUT "0\n"; # enter another ob info
print OUT "-$loc\n"; # identity ob at $loc
print OUT "0, 0\n"; # time (meaningless here)
print OUT $var; # error variance
}
for ($i=0; $i < $numobs; $i++) {
$loc = $loc + $spaceobs;
if ($mask[$loc] > 0) {
print OUT "0\n"; # enter another ob info
print OUT "-$loc\n"; # identity ob at $loc
print OUT "0, 0\n"; # time (meaningless here)
print OUT $var; # error variance
}
}
#-------
# Obtain spacing between observations, assuming you start at point 1
print "Enter observation information for the P variable.\n";
print "This script assumes that the first observation is at P(1).\n";
print "Input the subsequent spacing between obs: ";
$spaceobs=<STDIN>;
# Figure out how many P observation locations this implies
$a=1;
$numobs=0;
while($a + $spaceobs < $statesize) {
$a = $a + $spaceobs;
$numobs++;
}
$numobsout=$numobs+1;
print "Resulting number of obs is: ";
print "$numobsout.\n";
# Obtain error variances
print "This script assumes that all P observations have the same error variance.\n";
print "Input this observational error variance: ";
$var=<STDIN>;
# Put variance and observation location information
# into output file
$loc = 4*$statesize + 1;
if ($mask[$loc] > 0) {
print OUT "0\n"; # enter another ob info
print OUT "-$loc\n"; # identity ob at $loc
print OUT "0, 0\n"; # time (meaningless here)
print OUT $var; # error variance
}
for ($i=0; $i < $numobs; $i++) {
$loc = $loc + $spaceobs;
if ($mask[$loc] > 0) {
print OUT "0\n"; # enter another ob info
print OUT "-$loc\n"; # identity ob at $loc
print OUT "0, 0\n"; # time (meaningless here)
print OUT $var; # error variance
}
}
# Output that we are done entering obs info
print OUT "-1\n";
# Output the input file name
print OUT "set_def.out\n";
# Clean up
print "Done.\n";
print "\n";
print "Note, if you are entering huge numbers of observations, it might be\n";
print "necessary to enter coseq.pl and alter the first print OUT statement.\n";
close(OUT);
exit 0
# <next few lines under version control, do not edit>
# $URL$
# $Revision$
# $Date$
| 28.941176 | 84 | 0.681572 |
ed3291037316553919477c4f634fb7c20528f8f2 | 2,192 | pm | Perl | lib/Biblio/Zotero/DB/Schema/Result/CreatorType.pm | gitpan/Biblio-Zotero-DB | 7eb0381b14ca6b968a305a80210227633c1df0b4 | [
"Artistic-1.0"
]
| null | null | null | lib/Biblio/Zotero/DB/Schema/Result/CreatorType.pm | gitpan/Biblio-Zotero-DB | 7eb0381b14ca6b968a305a80210227633c1df0b4 | [
"Artistic-1.0"
]
| null | null | null | lib/Biblio/Zotero/DB/Schema/Result/CreatorType.pm | gitpan/Biblio-Zotero-DB | 7eb0381b14ca6b968a305a80210227633c1df0b4 | [
"Artistic-1.0"
]
| null | null | null | use utf8;
package Biblio::Zotero::DB::Schema::Result::CreatorType;
$Biblio::Zotero::DB::Schema::Result::CreatorType::VERSION = '0.004';
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
use strict;
use warnings;
use base 'DBIx::Class::Core';
__PACKAGE__->table("creatorTypes");
__PACKAGE__->add_columns(
"creatortypeid",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"creatortype",
{ data_type => "text", is_nullable => 1 },
);
__PACKAGE__->set_primary_key("creatortypeid");
__PACKAGE__->has_many(
"item_creators",
"Biblio::Zotero::DB::Schema::Result::ItemCreator",
{ "foreign.creatortypeid" => "self.creatortypeid" },
{ cascade_copy => 0, cascade_delete => 0 },
);
__PACKAGE__->has_many(
"item_type_creator_types",
"Biblio::Zotero::DB::Schema::Result::ItemTypeCreatorType",
{ "foreign.creatortypeid" => "self.creatortypeid" },
{ cascade_copy => 0, cascade_delete => 0 },
);
# Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-07-02 23:02:38
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SWeXs7jA21XVReAIWrm9Eg
# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
Biblio::Zotero::DB::Schema::Result::CreatorType
=head1 VERSION
version 0.004
=head1 NAME
Biblio::Zotero::DB::Schema::Result::CreatorType
=head1 TABLE: C<creatorTypes>
=head1 ACCESSORS
=head2 creatortypeid
data_type: 'integer'
is_auto_increment: 1
is_nullable: 0
=head2 creatortype
data_type: 'text'
is_nullable: 1
=head1 PRIMARY KEY
=over 4
=item * L</creatortypeid>
=back
=head1 RELATIONS
=head2 item_creators
Type: has_many
Related object: L<Biblio::Zotero::DB::Schema::Result::ItemCreator>
=head2 item_type_creator_types
Type: has_many
Related object: L<Biblio::Zotero::DB::Schema::Result::ItemTypeCreatorType>
=head1 AUTHOR
Zakariyya Mughal <zmughal@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Zakariyya Mughal.
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
| 18.576271 | 98 | 0.728558 |
73dc1debe1e774529082be8fbf72aa81357ad7d4 | 6,353 | pm | Perl | clients/perl/OpenXPKI-Client-Enrollment/lib/OpenXPKI/Client/Enrollment/Upload.pm | takerukoushirou/openxpki | 17845b6e853d1a75c91352d79d9c33a90f5e6148 | [
"Apache-2.0"
]
| null | null | null | clients/perl/OpenXPKI-Client-Enrollment/lib/OpenXPKI/Client/Enrollment/Upload.pm | takerukoushirou/openxpki | 17845b6e853d1a75c91352d79d9c33a90f5e6148 | [
"Apache-2.0"
]
| null | null | null | clients/perl/OpenXPKI-Client-Enrollment/lib/OpenXPKI/Client/Enrollment/Upload.pm | takerukoushirou/openxpki | 17845b6e853d1a75c91352d79d9c33a90f5e6148 | [
"Apache-2.0"
]
| 1 | 2019-10-04T16:01:45.000Z | 2019-10-04T16:01:45.000Z | package OpenXPKI::Client::Enrollment::Upload;
use Mojo::Base 'Mojolicious::Controller';
use Data::Dumper;
use FindBin;
use IO::File;
use POSIX qw(tmpnam);
use Proc::SafeExec;
has 'sscep_conf' => ( lazy => 1, default => 'etc/sscep.conf' );
# Max size for upload
my $upload_max_size = 3 * 1024;
# this is for entire module so it is visible in END{}
my ( $csr_filename, $crt_filename );
# This action will render a template
sub upload {
my $self = shift;
my $group = $self->param('group');
my $config = $self->param('config');
if ( not ref( $config->{groups} ) ) {
$self->render(
template => 'error',
message => 'System configuration error',
details => 'configuration file does not contain "groups" entry',
);
return;
}
if ( not exists $config->{groups}->{$group} ) {
$self->render(
template => 'error',
message => 'Unknown Group',
details =>
'Please consult your support contact for the correct URL',
);
return;
}
my $scep_params = {};
my $sscep_cmd
= $ENV{ENROLL_FORWARD_CMD}
|| $config->{groups}->{$group}->{enroll_forward_cmd}
|| $config->{enroll_forward_cmd}
|| "$FindBin::Bin/../script/sscep-wrapper";
my $sscep_cfg
= $ENV{ENROLL_FORWARD_CFG}
|| $config->{groups}->{$group}->{enroll_forward_cfg}
|| $config->{enroll_forward_cfg}
|| "$FindBin::Bin/../etc/sscep-wrapper.cfg";
# Uploaded image(Mojo::Upload object)
my $data = $self->req->upload('csr');
# Nothing uploaded
unless ($data) {
return $self->render(
template => 'error',
message => 'Upload failed. No data was specified',
details => ''
);
}
# Exceed max size
if ( $data->size > $upload_max_size ) {
return $self->render(
template => 'error',
message => 'Upload failed. Data is too large.',
details => '',
);
}
# Check file type
my $data_type = $data->headers->content_type;
my %valid_types = map { $_ => 1 } qw( application/octet-stream );
# Create the temporary CSR file
# try new temp filenames until we get one that didn't already exist
my $csr_fh;
do { $csr_filename = tmpnam() }
until $csr_fh
= IO::File->new( $csr_filename, O_RDWR | O_CREAT | O_EXCL );
# Create the temporary Cert file (just in case the issuance for this CSR
# # is already complete.
# Try new temp filenames until we get one that didn't already exist
my $crt_fh;
do { $crt_filename = tmpnam() }
until $crt_fh
= IO::File->new( $crt_filename, O_RDWR | O_CREAT | O_EXCL );
# install atexit-style handler so that when we exit or die,
# we automatically delete these temporary files
END {
if ($csr_filename) {
unlink($csr_filename) or die "Couldn't unlink $csr_filename: $!";
}
if ($crt_filename) {
unlink($crt_filename) or die "Couldn't unlink $crt_filename: $!";
}
}
$csr_fh->autoflush(1);
print $csr_fh $data->slurp;
seek( $csr_fh, 0, 0 );
my $output;
my @exec_args = (
$sscep_cmd,
'-c' => $sscep_cfg,
'-w' => $crt_filename,
);
my $metadata = $config->{groups}->{$group}->{'metadata'};
if ( ref($metadata) eq 'HASH' ) {
my @meta = ();
foreach my $key ( keys %{$metadata} ) {
my $val = $metadata->{$key};
if ( ref($val) eq 'HASH' ) {
my @val_array = %{$val};
if ( $val_array[0] eq 'env' ) {
push @meta,
$key . '='
. (
defined $ENV{ $val_array[1] }
? $ENV{ $val_array[1] }
: ''
);
}
}
elsif ( not ref($val) ) {
push @meta, join( '=', $key, $val );
}
else {
push @meta, join( '=', 'ERR_IGN_' . $key, ref($val) );
}
}
push @exec_args, '-M', join( '&', @meta );
}
push @exec_args, 'enroll' => $csr_filename;
warn "### DEBUG exec_args=", join( ', ', @exec_args );
my $fwd = new Proc::SafeExec(
{ exec => \@exec_args,
stdout => 'new',
stderr => 'new'
}
);
# Perl doesn't understand <$fwd->stdout()>
my $fwd_stdout = $fwd->stdout();
my $fwd_stderr = $fwd->stderr();
my @stdout = <$fwd_stdout>;
my @stderr = <$fwd_stderr>;
$fwd->wait();
my $exit_status = $fwd->exit_status() >> 8;
close $csr_fh;
if ( $exit_status == 0 ) {
seek( $crt_fh, 0, 0 );
my $crt = join( '', <$crt_fh> );
close $crt_fh;
$self->render(
# template => 'upload',
message => "Certificate has beeen issued.",
certpem => $crt,
details => 'The certificate for your request has been issued.',
);
}
elsif ( $exit_status == 3 ) {
$self->render(
# template => 'upload',
message => "Accepted CSR for further processing. ",
certpem => undef,
details => <<EOF,
Your CSR has been accepted and submitted for approval and you will
be receiving an e-mail confirmation shortly.
EOF
);
}
elsif ( $exit_status == 93 ) {
$self->render(
template => 'error',
message => "Error processing CSR: ($exit_status) ",
details => <<EOF,
There was an error processing your request file. Please check
its contents and file format. Tip: The CSR file should begin
with the line '-----BEGIN CERTIFICATE REQUEST-----'. If it
contains the string 'PRIVATE KEY', you uploaded the WRONG file.
EOF
);
}
else {
$self->render(
template => 'error',
message => "Error processing CSR: ($exit_status) ",
details => join( '',
"\nCOMMAND:\n", "\t",
join(', ', @exec_args),
"\n\nSTDERR:\n", @stderr,
"\n\nSTDOUT:\n", @stdout),
);
}
}
1;
| 29.009132 | 77 | 0.504329 |
ed1b1d4524f5d6fd3458817628d5479a8db63ddd | 89 | al | Perl | benchmark/benchmarks/FASP-benchmarks/data/tournaments/tournament-0063-9-36.al | krzysg/FaspHeuristic | 1929c40e3fbc49e68b04acfc5522539a18758031 | [
"MIT"
]
| null | null | null | benchmark/benchmarks/FASP-benchmarks/data/tournaments/tournament-0063-9-36.al | krzysg/FaspHeuristic | 1929c40e3fbc49e68b04acfc5522539a18758031 | [
"MIT"
]
| null | null | null | benchmark/benchmarks/FASP-benchmarks/data/tournaments/tournament-0063-9-36.al | krzysg/FaspHeuristic | 1929c40e3fbc49e68b04acfc5522539a18758031 | [
"MIT"
]
| null | null | null | 1 7 9
2 1 6 8
3 1 2 4 7 8
4 1 2 5 6 7 8 9
5 1 2 3 7
6 1 3 5 8
7 2 6 8 9
8 1 5 9
9 2 3 5 6 | 9.888889 | 15 | 0.505618 |
ed4f2714b294023f2ec52f02206865996c43a0b3 | 495 | t | Perl | t/0.90/can/Data_Object_Hash_Func_Delete_mapping.t | srchulo/do | d3c4ccecf33d1cf83d64b1c15666d0282a89e4f3 | [
"Apache-2.0"
]
| null | null | null | t/0.90/can/Data_Object_Hash_Func_Delete_mapping.t | srchulo/do | d3c4ccecf33d1cf83d64b1c15666d0282a89e4f3 | [
"Apache-2.0"
]
| null | null | null | t/0.90/can/Data_Object_Hash_Func_Delete_mapping.t | srchulo/do | d3c4ccecf33d1cf83d64b1c15666d0282a89e4f3 | [
"Apache-2.0"
]
| null | null | null | use 5.014;
use strict;
use warnings;
use Test::More;
# POD
=name
mapping
=usage
my @data = $self->mapping;
=description
Returns the ordered list of named function object arguments.
=signature
mapping() : (Str)
=type
method
=cut
# TESTING
use Data::Object::Hash::Func::Delete;
can_ok "Data::Object::Hash::Func::Delete", "mapping";
my @data;
@data = Data::Object::Hash::Func::Delete->mapping();
is @data, 2;
is $data[0], 'arg1';
is $data[1], 'arg2';
ok 1 and done_testing;
| 10.3125 | 60 | 0.660606 |
ed0de149ae03a144c9eff3dd616d67ad65ecb099 | 23,523 | pm | Perl | perl/lib/Pod/Simple/RTF.pm | luiscarlosg27/xampp | c295dbdd435c9c62fbd4cc6fc42097bea7a900a0 | [
"Apache-2.0"
]
| 1,318 | 2019-07-11T10:34:39.000Z | 2022-03-29T15:05:19.000Z | perl/lib/Pod/Simple/RTF.pm | luiscarlosg27/xampp | c295dbdd435c9c62fbd4cc6fc42097bea7a900a0 | [
"Apache-2.0"
]
| 387 | 2019-09-05T16:33:09.000Z | 2022-03-31T10:43:39.000Z | perl/lib/Pod/Simple/RTF.pm | luiscarlosg27/xampp | c295dbdd435c9c62fbd4cc6fc42097bea7a900a0 | [
"Apache-2.0"
]
| 66 | 2019-11-11T15:33:12.000Z | 2022-03-01T07:55:55.000Z |
require 5;
package Pod::Simple::RTF;
#sub DEBUG () {4};
#sub Pod::Simple::DEBUG () {4};
#sub Pod::Simple::PullParser::DEBUG () {4};
use strict;
use vars qw($VERSION @ISA %Escape $WRAP %Tagmap);
$VERSION = '3.40';
use Pod::Simple::PullParser ();
BEGIN {@ISA = ('Pod::Simple::PullParser')}
use Carp ();
BEGIN { *DEBUG = \&Pod::Simple::DEBUG unless defined &DEBUG }
sub to_uni ($) { # Convert native code point to Unicode
my $x = shift;
# Broken for early EBCDICs
$x = chr utf8::native_to_unicode(ord $x) if $] ge 5.007_003
&& ord("A") != 65;
return $x;
}
# We escape out 'F' so that we can send RTF files thru the mail without the
# slightest worry that paragraphs beginning with "From" will get munged.
# We also escape '\', '{', '}', and '_'
my $map_to_self = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEGHIJKLMNOPQRSTUVWXYZ[]^`abcdefghijklmnopqrstuvwxyz|~';
$WRAP = 1 unless defined $WRAP;
%Escape = (
# Start with every character mapping to its hex equivalent
map( (chr($_) => sprintf("\\'%02x", $_)), 0 .. 0xFF),
# Override most ASCII printables with themselves (or on non-ASCII platforms,
# their ASCII values. This is because the output is UTF-16, which is always
# based on Unicode code points)
map( ( substr($map_to_self, $_, 1)
=> to_uni(substr($map_to_self, $_, 1))), 0 .. length($map_to_self) - 1),
# And some refinements:
"\r" => "\n",
"\cj" => "\n",
"\n" => "\n\\line ",
"\t" => "\\tab ", # Tabs (altho theoretically raw \t's are okay)
"\f" => "\n\\page\n", # Formfeed
"-" => "\\_", # Turn plaintext '-' into a non-breaking hyphen
$Pod::Simple::nbsp => "\\~", # Latin-1 non-breaking space
$Pod::Simple::shy => "\\-", # Latin-1 soft (optional) hyphen
# CRAZY HACKS:
"\n" => "\\line\n",
"\r" => "\n",
"\cb" => "{\n\\cs21\\lang1024\\noproof ", # \\cf1
"\cc" => "}",
);
# Generate a string of all the characters in %Escape that don't map to
# themselves. First, one without the hyphen, then one with.
my $escaped_sans_hyphen = "";
$escaped_sans_hyphen .= $_ for grep { $_ ne $Escape{$_} && $_ ne '-' }
sort keys %Escape;
my $escaped = "-$escaped_sans_hyphen";
# Then convert to patterns
$escaped_sans_hyphen = qr/[\Q$escaped_sans_hyphen \E]/;
$escaped= qr/[\Q$escaped\E]/;
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub _openclose {
return map {;
m/^([-A-Za-z]+)=(\w[^\=]*)$/s or die "what's <$_>?";
( $1, "{\\$2\n", "/$1", "}" );
} @_;
}
my @_to_accept;
%Tagmap = (
# 'foo=bar' means ('foo' => '{\bar'."\n", '/foo' => '}')
_openclose(
'B=cs18\b',
'I=cs16\i',
'C=cs19\f1\lang1024\noproof',
'F=cs17\i\lang1024\noproof',
'VerbatimI=cs26\i',
'VerbatimB=cs27\b',
'VerbatimBI=cs28\b\i',
map {; m/^([-a-z]+)/s && push @_to_accept, $1; $_ }
qw[
underline=ul smallcaps=scaps shadow=shad
superscript=super subscript=sub strikethrough=strike
outline=outl emboss=embo engrave=impr
dotted-underline=uld dash-underline=uldash
dot-dash-underline=uldashd dot-dot-dash-underline=uldashdd
double-underline=uldb thick-underline=ulth
word-underline=ulw wave-underline=ulwave
]
# But no double-strikethrough, because MSWord can't agree with the
# RTF spec on whether it's supposed to be \strikedl or \striked1 (!!!)
),
# Bit of a hack here:
'L=pod' => '{\cs22\i'."\n",
'L=url' => '{\cs23\i'."\n",
'L=man' => '{\cs24\i'."\n",
'/L' => '}',
'Data' => "\n",
'/Data' => "\n",
'Verbatim' => "\n{\\pard\\li#rtfindent##rtfkeep#\\plain\\s20\\sa180\\f1\\fs18\\lang1024\\noproof\n",
'/Verbatim' => "\n\\par}\n",
'VerbatimFormatted' => "\n{\\pard\\li#rtfindent##rtfkeep#\\plain\\s20\\sa180\\f1\\fs18\\lang1024\\noproof\n",
'/VerbatimFormatted' => "\n\\par}\n",
'Para' => "\n{\\pard\\li#rtfindent#\\sa180\n",
'/Para' => "\n\\par}\n",
'head1' => "\n{\\pard\\li#rtfindent#\\s31\\keepn\\sb90\\sa180\\f2\\fs#head1_halfpoint_size#\\ul{\n",
'/head1' => "\n}\\par}\n",
'head2' => "\n{\\pard\\li#rtfindent#\\s32\\keepn\\sb90\\sa180\\f2\\fs#head2_halfpoint_size#\\ul{\n",
'/head2' => "\n}\\par}\n",
'head3' => "\n{\\pard\\li#rtfindent#\\s33\\keepn\\sb90\\sa180\\f2\\fs#head3_halfpoint_size#\\ul{\n",
'/head3' => "\n}\\par}\n",
'head4' => "\n{\\pard\\li#rtfindent#\\s34\\keepn\\sb90\\sa180\\f2\\fs#head4_halfpoint_size#\\ul{\n",
'/head4' => "\n}\\par}\n",
# wordpad borks on \tc\tcl1, or I'd put that in =head1 and =head2
'item-bullet' => "\n{\\pard\\li#rtfindent##rtfitemkeepn#\\sb60\\sa150\\fi-120\n",
'/item-bullet' => "\n\\par}\n",
'item-number' => "\n{\\pard\\li#rtfindent##rtfitemkeepn#\\sb60\\sa150\\fi-120\n",
'/item-number' => "\n\\par}\n",
'item-text' => "\n{\\pard\\li#rtfindent##rtfitemkeepn#\\sb60\\sa150\\fi-120\n",
'/item-text' => "\n\\par}\n",
# we don't need any styles for over-* and /over-*
);
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub new {
my $new = shift->SUPER::new(@_);
$new->nix_X_codes(1);
$new->nbsp_for_S(1);
$new->accept_targets( 'rtf', 'RTF' );
$new->{'Tagmap'} = {%Tagmap};
$new->accept_codes(@_to_accept);
$new->accept_codes('VerbatimFormatted');
DEBUG > 2 and print STDERR "To accept: ", join(' ',@_to_accept), "\n";
$new->doc_lang(
( $ENV{'RTFDEFLANG'} || '') =~ m/^(\d{1,10})$/s ? $1
: ($ENV{'RTFDEFLANG'} || '') =~ m/^0?x([a-fA-F0-9]{1,10})$/s ? hex($1)
# yes, tolerate hex!
: ($ENV{'RTFDEFLANG'} || '') =~ m/^([a-fA-F0-9]{4})$/s ? hex($1)
# yes, tolerate even more hex!
: '1033'
);
$new->head1_halfpoint_size(32);
$new->head2_halfpoint_size(28);
$new->head3_halfpoint_size(25);
$new->head4_halfpoint_size(22);
$new->codeblock_halfpoint_size(18);
$new->header_halfpoint_size(17);
$new->normal_halfpoint_size(25);
return $new;
}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__PACKAGE__->_accessorize(
'doc_lang',
'head1_halfpoint_size',
'head2_halfpoint_size',
'head3_halfpoint_size',
'head4_halfpoint_size',
'codeblock_halfpoint_size',
'header_halfpoint_size',
'normal_halfpoint_size',
'no_proofing_exemptions',
);
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub run {
my $self = $_[0];
return $self->do_middle if $self->bare_output;
return
$self->do_beginning && $self->do_middle && $self->do_end;
}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Match something like an identifier. Prefer XID if available, then plain ID,
# then just ASCII
my $id_re = Pod::Simple::BlackBox::my_qr('[\'_\p{XIDS}][\'\p{XIDC}]+', "ab");
$id_re = Pod::Simple::BlackBox::my_qr('[\'_\p{IDS}][\'\p{IDC}]+', "ab")
unless $id_re;
$id_re = qr/['_a-zA-Z]['a-zA-Z0-9_]+/ unless $id_re;
sub do_middle { # the main work
my $self = $_[0];
my $fh = $self->{'output_fh'};
my($token, $type, $tagname, $scratch);
my @stack;
my @indent_stack;
$self->{'rtfindent'} = 0 unless defined $self->{'rtfindent'};
while($token = $self->get_token) {
if( ($type = $token->type) eq 'text' ) {
if( $self->{'rtfverbatim'} ) {
DEBUG > 1 and print STDERR " $type " , $token->text, " in verbatim!\n";
rtf_esc(0, $scratch = $token->text); # 0 => Don't escape hyphen
print $fh $scratch;
next;
}
DEBUG > 1 and print STDERR " $type " , $token->text, "\n";
$scratch = $token->text;
$scratch =~ tr/\t\cb\cc/ /d;
$self->{'no_proofing_exemptions'} or $scratch =~
s/(?:
^
|
(?<=[\r\n\t "\[\<\(])
) # start on whitespace, sequence-start, or quote
( # something looking like a Perl token:
(?:
[\$\@\:\<\*\\_]\S+ # either starting with a sigil, etc.
)
|
# or starting alpha, but containing anything strange:
(?:
${id_re}[\$\@\:_<>\(\\\*]\S+
)
)
/\cb$1\cc/xsg
;
rtf_esc(1, $scratch); # 1 => escape hyphen
$scratch =~
s/(
[^\r\n]{65} # Snare 65 characters from a line
[^\r\n ]{0,50} # and finish any current word
)
(\ {1,10})(?![\r\n]) # capture some spaces not at line-end
/$1$2\n/gx # and put a NL before those spaces
if $WRAP;
# This may wrap at well past the 65th column, but not past the 120th.
print $fh $scratch;
} elsif( $type eq 'start' ) {
DEBUG > 1 and print STDERR " +$type ",$token->tagname,
" (", map("<$_> ", %{$token->attr_hash}), ")\n";
if( ($tagname = $token->tagname) eq 'Verbatim'
or $tagname eq 'VerbatimFormatted'
) {
++$self->{'rtfverbatim'};
my $next = $self->get_token;
next unless defined $next;
my $line_count = 1;
if($next->type eq 'text') {
my $t = $next->text_r;
while( $$t =~ m/$/mg ) {
last if ++$line_count > 15; # no point in counting further
}
DEBUG > 3 and print STDERR " verbatim line count: $line_count\n";
}
$self->unget_token($next);
$self->{'rtfkeep'} = ($line_count > 15) ? '' : '\keepn' ;
} elsif( $tagname =~ m/^item-/s ) {
my @to_unget;
my $text_count_here = 0;
$self->{'rtfitemkeepn'} = '';
# Some heuristics to stop item-*'s functioning as subheadings
# from getting split from the things they're subheadings for.
#
# It's not terribly pretty, but it really does make things pretty.
#
while(1) {
push @to_unget, $self->get_token;
pop(@to_unget), last unless defined $to_unget[-1];
# Erroneously used to be "unshift" instead of pop! Adds instead
# of removes, and operates on the beginning instead of the end!
if($to_unget[-1]->type eq 'text') {
if( ($text_count_here += length ${$to_unget[-1]->text_r}) > 150 ){
DEBUG > 1 and print STDERR " item-* is too long to be keepn'd.\n";
last;
}
} elsif (@to_unget > 1 and
$to_unget[-2]->type eq 'end' and
$to_unget[-2]->tagname =~ m/^item-/s
) {
# Bail out here, after setting rtfitemkeepn yea or nay.
$self->{'rtfitemkeepn'} = '\keepn' if
$to_unget[-1]->type eq 'start' and
$to_unget[-1]->tagname eq 'Para';
DEBUG > 1 and printf STDERR " item-* before %s(%s) %s keepn'd.\n",
$to_unget[-1]->type,
$to_unget[-1]->can('tagname') ? $to_unget[-1]->tagname : '',
$self->{'rtfitemkeepn'} ? "gets" : "doesn't get";
last;
} elsif (@to_unget > 40) {
DEBUG > 1 and print STDERR " item-* now has too many tokens (",
scalar(@to_unget),
(DEBUG > 4) ? (q<: >, map($_->dump, @to_unget)) : (),
") to be keepn'd.\n";
last; # give up
}
# else keep while'ing along
}
# Now put it aaaaall back...
$self->unget_token(@to_unget);
} elsif( $tagname =~ m/^over-/s ) {
push @stack, $1;
push @indent_stack,
int($token->attr('indent') * 4 * $self->normal_halfpoint_size);
DEBUG and print STDERR "Indenting over $indent_stack[-1] twips.\n";
$self->{'rtfindent'} += $indent_stack[-1];
} elsif ($tagname eq 'L') {
$tagname .= '=' . ($token->attr('type') || 'pod');
} elsif ($tagname eq 'Data') {
my $next = $self->get_token;
next unless defined $next;
unless( $next->type eq 'text' ) {
$self->unget_token($next);
next;
}
DEBUG and print STDERR " raw text ", $next->text, "\n";
printf $fh "\n" . $next->text . "\n";
next;
}
defined($scratch = $self->{'Tagmap'}{$tagname}) or next;
$scratch =~ s/\#([^\#]+)\#/${$self}{$1}/g; # interpolate
print $fh $scratch;
if ($tagname eq 'item-number') {
print $fh $token->attr('number'), ". \n";
} elsif ($tagname eq 'item-bullet') {
print $fh "\\'", ord("_"), "\n";
#for funky testing: print $fh '', rtf_esc(1, "\x{4E4B}\x{9053}");
}
} elsif( $type eq 'end' ) {
DEBUG > 1 and print STDERR " -$type ",$token->tagname,"\n";
if( ($tagname = $token->tagname) =~ m/^over-/s ) {
DEBUG and print STDERR "Indenting back $indent_stack[-1] twips.\n";
$self->{'rtfindent'} -= pop @indent_stack;
pop @stack;
} elsif( $tagname eq 'Verbatim' or $tagname eq 'VerbatimFormatted') {
--$self->{'rtfverbatim'};
}
defined($scratch = $self->{'Tagmap'}{"/$tagname"}) or next;
$scratch =~ s/\#([^\#]+)\#/${$self}{$1}/g; # interpolate
print $fh $scratch;
}
}
return 1;
}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sub do_beginning {
my $self = $_[0];
my $fh = $self->{'output_fh'};
return print $fh join '',
$self->doc_init,
$self->font_table,
$self->stylesheet,
$self->color_table,
$self->doc_info,
$self->doc_start,
"\n"
;
}
sub do_end {
my $self = $_[0];
my $fh = $self->{'output_fh'};
return print $fh '}'; # that should do it
}
###########################################################################
sub stylesheet {
return sprintf <<'END',
{\stylesheet
{\snext0 Normal;}
{\*\cs10 \additive Default Paragraph Font;}
{\*\cs16 \additive \i \sbasedon10 pod-I;}
{\*\cs17 \additive \i\lang1024\noproof \sbasedon10 pod-F;}
{\*\cs18 \additive \b \sbasedon10 pod-B;}
{\*\cs19 \additive \f1\lang1024\noproof\sbasedon10 pod-C;}
{\s20\ql \li0\ri0\sa180\widctlpar\f1\fs%s\lang1024\noproof\sbasedon0 \snext0 pod-codeblock;}
{\*\cs21 \additive \lang1024\noproof \sbasedon10 pod-computerese;}
{\*\cs22 \additive \i\lang1024\noproof\sbasedon10 pod-L-pod;}
{\*\cs23 \additive \i\lang1024\noproof\sbasedon10 pod-L-url;}
{\*\cs24 \additive \i\lang1024\noproof\sbasedon10 pod-L-man;}
{\*\cs25 \additive \f1\lang1024\noproof\sbasedon0 pod-codelbock-plain;}
{\*\cs26 \additive \f1\lang1024\noproof\sbasedon25 pod-codelbock-ital;}
{\*\cs27 \additive \f1\lang1024\noproof\sbasedon25 pod-codelbock-bold;}
{\*\cs28 \additive \f1\lang1024\noproof\sbasedon25 pod-codelbock-bold-ital;}
{\s31\ql \keepn\sb90\sa180\f2\fs%s\ul\sbasedon0 \snext0 pod-head1;}
{\s32\ql \keepn\sb90\sa180\f2\fs%s\ul\sbasedon0 \snext0 pod-head2;}
{\s33\ql \keepn\sb90\sa180\f2\fs%s\ul\sbasedon0 \snext0 pod-head3;}
{\s34\ql \keepn\sb90\sa180\f2\fs%s\ul\sbasedon0 \snext0 pod-head4;}
}
END
$_[0]->codeblock_halfpoint_size(),
$_[0]->head1_halfpoint_size(),
$_[0]->head2_halfpoint_size(),
$_[0]->head3_halfpoint_size(),
$_[0]->head4_halfpoint_size(),
;
}
###########################################################################
# Override these as necessary for further customization
sub font_table {
return <<'END'; # text font, code font, heading font
{\fonttbl
{\f0\froman Times New Roman;}
{\f1\fmodern Courier New;}
{\f2\fswiss Arial;}
}
END
}
sub doc_init {
return <<'END';
{\rtf1\ansi\deff0
END
}
sub color_table {
return <<'END';
{\colortbl;\red255\green0\blue0;\red0\green0\blue255;}
END
}
sub doc_info {
my $self = $_[0];
my $class = ref($self) || $self;
my $tag = __PACKAGE__ . ' ' . $VERSION;
unless($class eq __PACKAGE__) {
$tag = " ($tag)";
$tag = " v" . $self->VERSION . $tag if defined $self->VERSION;
$tag = $class . $tag;
}
return sprintf <<'END',
{\info{\doccomm
%s
using %s v%s
under Perl v%s at %s GMT}
{\author [see doc]}{\company [see doc]}{\operator [see doc]}
}
END
# None of the following things should need escaping, I dare say!
$tag,
$ISA[0], $ISA[0]->VERSION(),
$], scalar(gmtime),
;
}
sub doc_start {
my $self = $_[0];
my $title = $self->get_short_title();
DEBUG and print STDERR "Short Title: <$title>\n";
$title .= ' ' if length $title;
$title =~ s/ *$/ /s;
$title =~ s/^ //s;
$title =~ s/ $/, /s;
# make sure it ends in a comma and a space, unless it's 0-length
my $is_obviously_module_name;
$is_obviously_module_name = 1
if $title =~ m/^\S+$/s and $title =~ m/::/s;
# catches the most common case, at least
DEBUG and print STDERR "Title0: <$title>\n";
$title = rtf_esc(1, $title); # 1 => escape hyphen
DEBUG and print STDERR "Title1: <$title>\n";
$title = '\lang1024\noproof ' . $title
if $is_obviously_module_name;
return sprintf <<'END',
\deflang%s\plain\lang%s\widowctrl
{\header\pard\qr\plain\f2\fs%s
%s
p.\chpgn\par}
\fs%s
END
($self->doc_lang) x 2,
$self->header_halfpoint_size,
$title,
$self->normal_halfpoint_size,
;
}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#-------------------------------------------------------------------------
use integer;
my $question_mark_code_points =
Pod::Simple::BlackBox::my_qr('([^\x00-\x{D7FF}\x{E000}-\x{10FFFF}])',
"\x{110000}");
my $plane0 =
Pod::Simple::BlackBox::my_qr('([\x{100}-\x{FFFF}])', "\x{100}");
my $other_unicode =
Pod::Simple::BlackBox::my_qr('([\x{10000}-\x{10FFFF}])', "\x{10000}");
sub esc_uni($) {
use if $] le 5.006002, 'utf8';
my $x = shift;
# The output is expected to be UTF-16. Surrogates and above-Unicode get
# mapped to '?'
$x =~ s/$question_mark_code_points/?/g if $question_mark_code_points;
# Non-surrogate Plane 0 characters get mapped to their code points. But
# the standard calls for a 16bit SIGNED value.
$x =~ s/$plane0/'\\uc1\\u'.((ord($1)<32768)?ord($1):(ord($1)-65536)).'?'/eg
if $plane0;
# Use surrogate pairs for the rest
$x =~ s/$other_unicode/'\\uc1\\u' . ((ord($1) >> 10) + 0xD7C0 - 65536) . '\\u' . (((ord$1) & 0x03FF) + 0xDC00 - 65536) . '?'/eg if $other_unicode;
return $x;
}
sub rtf_esc ($$) {
# The parameter is true if we should escape hyphens
my $escape_re = ((shift) ? $escaped : $escaped_sans_hyphen);
# When false, it doesn't change "-" to hard-hyphen.
# We don't want to change the "-" to hard-hyphen, because we want to
# be able to paste this into a file and run it without there being
# dire screaming about the mysterious hard-hyphen character (which
# looks just like a normal dash character).
# XXX The comments used to claim that when false it didn't apply computerese
# style-smarts, but khw didn't see this actually
my $x; # scratch
if(!defined wantarray) { # void context: alter in-place!
for(@_) {
s/($escape_re)/$Escape{$1}/g; # ESCAPER
$_ = esc_uni($_);
}
return;
} elsif(wantarray) { # return an array
return map {; ($x = $_) =~
s/($escape_re)/$Escape{$1}/g; # ESCAPER
$x = esc_uni($x);
$x;
} @_;
} else { # return a single scalar
($x = ((@_ == 1) ? $_[0] : join '', @_)
) =~ s/($escape_re)/$Escape{$1}/g; # ESCAPER
# Escape \, {, }, -, control chars, and 7f-ff.
$x = esc_uni($x);
return $x;
}
}
1;
__END__
=head1 NAME
Pod::Simple::RTF -- format Pod as RTF
=head1 SYNOPSIS
perl -MPod::Simple::RTF -e \
"exit Pod::Simple::RTF->filter(shift)->any_errata_seen" \
thingy.pod > thingy.rtf
=head1 DESCRIPTION
This class is a formatter that takes Pod and renders it as RTF, good for
viewing/printing in MSWord, WordPad/write.exe, TextEdit, etc.
This is a subclass of L<Pod::Simple> and inherits all its methods.
=head1 FORMAT CONTROL ATTRIBUTES
You can set these attributes on the parser object before you
call C<parse_file> (or a similar method) on it:
=over
=item $parser->head1_halfpoint_size( I<halfpoint_integer> );
=item $parser->head2_halfpoint_size( I<halfpoint_integer> );
=item $parser->head3_halfpoint_size( I<halfpoint_integer> );
=item $parser->head4_halfpoint_size( I<halfpoint_integer> );
These methods set the size (in half-points, like 52 for 26-point)
that these heading levels will appear as.
=item $parser->codeblock_halfpoint_size( I<halfpoint_integer> );
This method sets the size (in half-points, like 21 for 10.5-point)
that codeblocks ("verbatim sections") will appear as.
=item $parser->header_halfpoint_size( I<halfpoint_integer> );
This method sets the size (in half-points, like 15 for 7.5-point)
that the header on each page will appear in. The header
is usually just "I<modulename> p. I<pagenumber>".
=item $parser->normal_halfpoint_size( I<halfpoint_integer> );
This method sets the size (in half-points, like 26 for 13-point)
that normal paragraphic text will appear in.
=item $parser->no_proofing_exemptions( I<true_or_false> );
Set this value to true if you don't want the formatter to try
putting a hidden code on all Perl symbols (as best as it can
notice them) that labels them as being not in English, and
so not worth spellchecking.
=item $parser->doc_lang( I<microsoft_decimal_language_code> )
This sets the language code to tag this document as being in. By
default, it is currently the value of the environment variable
C<RTFDEFLANG>, or if that's not set, then the value
1033 (for US English).
Setting this appropriately is useful if you want to use the RTF
to spellcheck, and/or if you want it to hyphenate right.
Here are some notable values:
1033 US English
2057 UK English
3081 Australia English
4105 Canada English
1034 Spain Spanish
2058 Mexico Spanish
1031 Germany German
1036 France French
3084 Canada French
1035 Finnish
1044 Norwegian (Bokmal)
2068 Norwegian (Nynorsk)
=back
If you are particularly interested in customizing this module's output
even more, see the source and/or write to me.
=head1 SEE ALSO
L<Pod::Simple>, L<RTF::Writer>, L<RTF::Cookbook>, L<RTF::Document>,
L<RTF::Generator>
=head1 SUPPORT
Questions or discussion about POD and Pod::Simple should be sent to the
pod-people@perl.org mail list. Send an empty email to
pod-people-subscribe@perl.org to subscribe.
This module is managed in an open GitHub repository,
L<https://github.com/perl-pod/pod-simple/>. Feel free to fork and contribute, or
to clone L<git://github.com/perl-pod/pod-simple.git> and send patches!
Patches against Pod::Simple are welcome. Please send bug reports to
<bug-pod-simple@rt.cpan.org>.
=head1 COPYRIGHT AND DISCLAIMERS
Copyright (c) 2002 Sean M. Burke.
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
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.
=head1 AUTHOR
Pod::Simple was created by Sean M. Burke <sburke@cpan.org>.
But don't bother him, he's retired.
Pod::Simple is maintained by:
=over
=item * Allison Randal C<allison@perl.org>
=item * Hans Dieter Pearcey C<hdp@cpan.org>
=item * David E. Wheeler C<dwheeler@cpan.org>
=back
=cut
| 31.616935 | 150 | 0.56838 |
ed3bf4499a85443bb5d9092ee44269e7bd0638dc | 29,598 | pl | Perl | src/Applications/GEOSdas_App/monthly_means.pl | GEOS-ESM/GEOSadas | 8e3665af71eb37c48573c65ed0e9daa5ca429535 | [
"NASA-1.3",
"Apache-2.0"
]
| 2 | 2019-09-07T09:00:32.000Z | 2021-03-12T02:25:56.000Z | src/Applications/GEOSdas_App/monthly_means.pl | GEOS-ESM/GEOSadas | 8e3665af71eb37c48573c65ed0e9daa5ca429535 | [
"NASA-1.3",
"Apache-2.0"
]
| 81 | 2019-07-05T19:28:50.000Z | 2022-03-04T19:37:47.000Z | src/Applications/GEOSdas_App/monthly_means.pl | GEOS-ESM/GEOSadas | 8e3665af71eb37c48573c65ed0e9daa5ca429535 | [
"NASA-1.3",
"Apache-2.0"
]
| null | null | null | #!/usr/bin/env perl
#=======================================================================
# name - monthly_means.pl
# purpose - script for calculating monthly means of fvDAS products
#
# NOTES:
# 1. Typical monthly means processing will pass through this program twice
# - 1st pass: prefetch inputs
# - 2nd pass: check inputs and perform monthly means
# 2. The $IN_TAR_INFO and/or $OUT_TAR_INFO files are written in the $workdir
# during the 1st pass when inputs are fetched. They are text files which
# are used for passing information to the clean inputs job, where tarring
# occurs.
# 3. The $IN_TAR_INFO file is written if inputs are extracted from an archived
# tarfile.
# $IN_TAR_INFO contains one record:
# == "full" if inputs are retrieved from a full tarfile
# == "partial" if inputs are retrieved from a partial tarfile
# 4. The $OUT_TAR_INFO file is written if some or all inputs are fetched
# individually from the archives.
# $OUT_TAR_INFO contains three records:
# 1st: $local_dir = location to write tarfile when tarring inputs
# 2nd: $remote_dir = location of individual archived inputs to be deleted
# after successful completion of tar operation
# 3rd: == "full" if all inputs are available
# == "partial" if some inputs are missing
# == "empty" if no inputs are found (i.e. no need to tar)
# 5. The $IN_TAR_INFO and/or $OUT_TAR_INFO files are read in the
# clean_inputs.$ftype.$yyyymm.j job scripts, if tarring is requested.
# > If the $IN_TAR_INFO file is found, then no tarring will occur if the
# input archived tarfile is "full", i.e. it already contains all inputs.
# Tarring again would just re-tar all the inputs extracted from the
# archived tarfile.
# > If the input archived tarfile is "partial", then the inputs will be
# tarred again, creating either a new partial tarfile to overwrite the
# one in the archive or a new full tarfile to add to the archive.
# > The $OUT_TAR_INFO indicates
# - where to write the tarfile locally, prior to archival ($local_dir)
# - where to delete individual archived inputs ($remote_dir)
# - whether to write a full tarfile, a partial tarfile, or to not write
# a tarfile at all.
#
# !REVISION HISTORY:
# 20160123 Stassi Modified version of monthly_means_mpi.pl
#=======================================================================
use strict;
use warnings;
my (@SEARCH_PATH, $fvhome, $fvroot);
# pre-process to define @SEARCH_PATH
#-----------------------------------
BEGIN {
use FindBin qw($Bin);
use Getopt::Long (":config", "pass_through");
# get fvhome and fvroot directories
#----------------------------------
GetOptions( "H=s" => \$fvhome,
"R=s" => \$fvroot );
$fvhome = $ENV{"FVHOME"} unless $fvhome;
$fvroot = $ENV{"FVROOT"} unless $fvroot;
die "ERROR: No FVHOME is set. Use -H;" unless $fvhome;
die "ERROR: No FVROOT is set. Use -R;" unless $fvroot;
die "ERROR: Cannot find FVHOME, $fvhome;" unless -e $fvhome;
die "ERROR: Cannot find FVROOT, $fvroot;" unless -e $fvroot;
@SEARCH_PATH = ("$fvhome/run", $Bin, "$fvroot/bin");
}
use lib @SEARCH_PATH;
# global variables
#-----------------
my ($archive, $date, $delete, $dmget_bin, $do_dmput, $do_tar, $endday, $expid);
my ($fileToken, $ftype, $hm, $htype, $ignore, $links, $localflg, $local_dir);
my ($monitorloc, $monthly_means_x, $nodiurnal, $num_days, $prefetch, $rcfile);
my ($remote_dir, $remote_machine, $remote_user, $run_config, $silo_dir);
my ($silo_work, $script, $startday, @times, $verbose, $workdir, $yyyymm);
my (@mean_files, @remote_file_list, @remove);
# main program
#-------------
{
my ($op);
print "\nDATE at start\n";
system("date"); print "\n";
init();
fetch_inputs();
calculate_means() unless $prefetch;
if ($prefetch) { $op = "PREFETCH" }
else { $op = "CALCULATION" }
wrapup(0, $delete, "Monthly Means $op successful for $ftype");
}
#=======================================================================
# name - init
# purpose - get runtime parameters
#=======================================================================
sub init {
use File::Basename qw(basename dirname);
use File::Path qw(mkpath);
use Getopt::Long (":config", "no_ignore_case");
use Manipulate_time qw(get_hours num_days_in_month token_resolve);
use Remote_utils qw(splitrfile);
use Perl_Config qw(perl_config);
my ($filestring, $help, $null, $SILO_DIR);
my (%opts, $fvarch, $fpathToken, @parts);
my (@remote_info, $remote_file_path);
my ($year, $month);
$script = basename($0);
# get run options
#----------------
# NOTE: -H and -R flags are retrieved in BEGIN block
#---------------------------------------------------
GetOptions( "C" => \$delete,
"c=s" => \$rcfile,
"D=i" => \$date,
"f=s" => \$filestring,
"h" => \$help,
"i" => \$ignore,
"L" => \$localflg,
"l" => \$links,
"M=s" => \$monthly_means_x,
"m=s" => \$monitorloc,
"nd" => \$nodiurnal,
"prefetch" => \$prefetch,
"p" => \$do_dmput,
"r=s" => \$run_config,
"S=s" => \$SILO_DIR,
"T=s" => \$htype,
"t" => \$do_tar,
"v" => \$verbose,
"w=s" => \$workdir );
usage() if $help;
# check for required inputs
#--------------------------
die "Error: Date (yyyymm) is required; Use -D;" unless $date;
die "Error: Filestring is required; Use -f;" unless $filestring;
$rcfile = "$fvroot/etc/time_ave.rc" unless $rcfile;
unless ($prefetch) {
die "Error: time_ave.rc file is required. Use -c;" unless $rcfile;
die "Error: time_ave.rc file not found;" unless -e $rcfile;
# check monthly means program
#----------------------------
$monthly_means_x = "$fvroot/bin/time_ave.x" unless $monthly_means_x;
die "Error: monthly_means_x is required. Use -M;" unless -e $monthly_means_x;
die "Error: $monthly_means_x not executable;" unless -x $monthly_means_x;
}
# get environment variables
#--------------------------
$opts{"config_file"} = "$fvhome/run/FVDAS_Run_Config";
perl_config(%opts);
$expid = $ENV{"EXPID"};
$dmget_bin = $ENV{"FVDMGET"};
$fvarch = $ENV{"FVARCH"};
# extract values from $filestring
#--------------------------------
$fileToken = basename($filestring);
$fpathToken = dirname($filestring);
if ($fileToken =~ /%h2%n2/) { $hm = "m" }
else { $hm = "h" }
# get $ftype by removing expid, datetime, and ext segments
#---------------------------------------------------------
@parts = split /[\.]/, $fileToken;
shift(@parts); pop(@parts); pop(@parts);
$ftype = join ".", @parts;
# get $htype from $ftype, unless alternate htype value given
#-----------------------------------------------------------
unless ($htype) {
if ($ftype =~ /\./) { $htype = $ftype }
else { $htype = (split(/_/, $ftype))[0] }
}
$archive = "$fvarch/$expid/$fpathToken";
$silo_dir = "$fvhome/$fpathToken";
# determine dates and times
#--------------------------
$yyyymm = substr($date,0,6);
$year = substr($yyyymm,0,4);
$month = substr($yyyymm,4,2);
$num_days = num_days_in_month($year, $month);
$startday = $yyyymm."01";
$endday = $yyyymm.$num_days;
@times = ();
@times = get_hours($htype, "0", "all", $hm);
@times = get_hours_HIST($ftype) unless @times;
die "Error. Unrecognized hour type $htype;" unless @times;
# defaults
#---------
$localflg = 0 if $prefetch;
$delete = 0 unless $delete;
$dmget_bin = "" unless $dmget_bin;
$run_config = "DEFAULT" unless $run_config;
if ($SILO_DIR) {
$delete = 0;
$links = 0;
$silo_work = 1;
$silo_dir = $SILO_DIR;
$workdir = token_resolve($SILO_DIR, $startday);
}
($remote_user, $remote_machine, $remote_file_path) = splitrfile($archive);
$remote_dir = token_resolve($remote_file_path, $startday);
print "\$remote_dir = $remote_dir\n" if $verbose;
# define working directory, if not already defined
#-------------------------------------------------
unless ($workdir) {
if ($ENV{"SCRATCH"}) { $workdir = "$ENV{SCRATCH}/monthly/$$" }
else { $workdir = "$ENV{TMPDIR}/monthly/$$" }
}
# create work directory, if necessary
#------------------------------------
unless (-d $workdir) {
print "$workdir does not exist - creating...\n" if $verbose;
mkpath($workdir, 1, 0755) or die "Error. Could not create $workdir;";
}
# environment variables
#----------------------
$ENV{"PATH"} = join ":", @SEARCH_PATH, $ENV{"PATH"};
$ENV{"PATH"} = join ":", $ENV{"PATH"}, $ENV{"PBS_O_PATH"} if $ENV{"PBS_O_PATH"};
$ENV{"SHELL"} = "/bin/csh";
# parse location data
#--------------------
$local_dir = token_resolve($silo_dir, $startday);
die "Error. Unable to define local_dir variable;" unless $local_dir;
print "\$local_dir = $local_dir\n" if $verbose;
# create local directory, if necessary
#-------------------------------------
unless (-d $local_dir ) {
print "local_dir, $local_dir, does not exist - creating...\n" if $verbose;
my $status = mkpath($local_dir, 1, 0755);
die "Error. Could not create $local_dir;" unless -d $local_dir;
}
}
#=======================================================================
# name - get_hours_HIST
# purpose - get ftype hours based on its frequency and duration
# in the HISTORY.rc file.
#=======================================================================
sub get_hours_HIST {
my ($ftype, $HISTORY, $freq, $dur, @hours);
$ftype = shift;
$HISTORY = "$fvhome/run/HISTORY.rc.tmpl";
$freq = extract_value($HISTORY, "$ftype.frequency");
$dur = extract_value($HISTORY, "$ftype.duration");
$dur = $freq unless $dur;
@hours = ();
if ($dur eq "010000") { @hours = qw(00 01 02 03 04 05 06 07 08 09 10 11
12 13 14 15 16 17 18 19 20 21 22 23 ) }
if ($dur eq "030000") { @hours = qw(00 03 06 09 12 15 18 21) }
if ($dur eq "060000") { @hours = qw(00 06 12 18) }
if ($dur eq "240000") { @hours = qw(00 03 06 09 12 15 18 21) }
return @hours;
}
#=======================================================================
# name - fetch_inputs
# purpose - make input files local prior to calculating monthly means
# and/or tarring
#=======================================================================
sub fetch_inputs {
use File::Basename qw(basename);
use File::Compare qw(compare);
use Remote_utils qw(rm_remote_file);
use Sys::Hostname ("hostname");
my ($stem, $full_tarfile, $partial_tarfile, $check_inputs);
my ($IN_TAR_INFO, $OUT_TAR_INFO);
$stem = "$expid.$ftype.$yyyymm";
$full_tarfile = "$stem.tar";
$partial_tarfile = "$stem.partial.tar";
$IN_TAR_INFO = "$workdir/IN_TAR.$ftype";
$OUT_TAR_INFO = "$workdir/OUT_TAR.$ftype";
# change directory to work directory
#-----------------------------------
chdir $workdir or die "Error. Cannot change directory to $workdir;\n";
print "Current work directory is $workdir\n" if $verbose;
print "Fetching $ftype files for $num_days days of $yyyymm\n";
# check for archived inputs tarfile
#----------------------------------
$check_inputs = 1;
unless ($localflg) {
# look for full month tarfile
#----------------------------
if (get_inputs_from_tarfile($full_tarfile)) {
print "Full tarfile found in archives\n\n" if $verbose;
open IFO, "> $IN_TAR_INFO" or die "Error opening $IN_TAR_INFO";
print IFO "full\n";
close IFO;
$check_inputs = 0;
}
# look for partial month tarfile
#-------------------------------
elsif (get_inputs_from_tarfile($partial_tarfile)) {
print "Partial tarfile found in archives\n\n" if $verbose;
open IFO, "> $IN_TAR_INFO" or die "Error opening $IN_TAR_INFO";
print IFO "partial\n";
close IFO;
}
else { print "No tarfile found in archives\n\n" if $verbose }
}
# check for individual inputs
#----------------------------
if ($check_inputs) {
fetch_individual_inputs($OUT_TAR_INFO);
}
}
#=======================================================================
# name - get_files_from_tarfile
# purpose - look for archived tarfile and if found, then retrieve it,
# untar it, and then remove it
#
# input parameter
# => $tarfile: name of tarfile from which to get files
#
# return values
# => success if ==1, then tarfile was retrieved and untarred
# if ==0, then tarfile not found or not successfully untarred
#=======================================================================
sub get_inputs_from_tarfile {
use Remote_utils qw(rget);
my ($tarfile, $remote_ref, %opts, $rc, $success);
$tarfile = shift;
$success = 0;
$remote_ref = "$remote_user\@$remote_machine:$remote_dir/$tarfile";
print "\nLooking for tarfile in archive: $remote_ref\n" if $verbose;
%opts = ();
$opts{"debug"} = $verbose if $verbose;
$opts{"run_config"} = $run_config;
rget($remote_ref, $tarfile, \%opts);
# if found, then extract inputs from tarfile
#-------------------------------------------
if (-f $tarfile and -s $tarfile) {
print "Tarfile acquired from archive: $tarfile\n" if $verbose;
$rc = system_("tar xf $tarfile");
die "Unable to extract inputs from tarfile: $tarfile;" if $rc;
print "Inputs extracted from tarfile: $tarfile\n" if $verbose;
print "removing $tarfile from workdir\n" if $verbose;
unlink($tarfile);
$success = 1;
}
return $success;
}
#=======================================================================
# name - fetch_individual_inputs
# purpose -
#=======================================================================
sub fetch_individual_inputs {
use Manipulate_time qw(token_resolve);
use Remote_utils qw(rdmget rget);
my ($currday, $filename, $full_local_host_name, $host, $local_ref);
my ($local_tarfile, $missing_inputs, $rc, $rget_rc, $rdmget_rc);
my ($remote_file, $remote_ref, $time, $times_addr, $try);
my (%opts, $OUT_TAR_INFO);
$OUT_TAR_INFO = shift;
# look for individual file inputs
#--------------------------------
print "Looking for individual $ftype inputs\n" if $verbose;
foreach $currday ($startday..$endday) {
foreach $time (@times) {
$filename = token_resolve($fileToken, $currday, $time);
print "\$filename = $filename\n" if $verbose;
push @remove, $filename if $delete;
# look for file in work directory
#--------------------------------
unless (-f $filename and -s $filename) {
print "$filename not found in work directory\n" if $verbose;
wrapup(1, $delete, "Running $script failed missing $filename.") if $silo_work;
# look for file in stage directory
#---------------------------------
print "Checking for $local_dir/$filename\n" if $verbose;
if (-f "$local_dir/$filename") {
# create symlink
#---------------
if ($links) {
print "linking $local_dir/$filename to $filename\n" if $verbose;
$rc = symlink "$local_dir/$filename", $filename;
wrapup(1, $delete, "Cannot create symbolic link to $filename") unless $rc;
}
# or rget to work dir
#--------------------
else {
%opts = ();
$opts{"debug"} = $verbose if $verbose;
$opts{"run_config"} = $run_config;
$opts{"preserve"} = 1;
$host = hostname();
$full_local_host_name = (gethostbyname($host))[0];
$local_ref = "$ENV{USER}\@$full_local_host_name:$local_dir/$filename";
print "rget($local_ref, $filename, \%opts)\n" if $verbose;
$rget_rc = rget($local_ref, $filename, \%opts);
print "\$rget_rc = $rget_rc\n" if $verbose;
}
} elsif ($localflg) {
wrapup(1, $delete,"Running $script failed missing $filename.");
}
}
# if file still not found, then add it to list to pull from archive
#------------------------------------------------------------------
unless (-f $filename and -s $filename) {
if ($archive) {
print "Adding $remote_dir/$filename to list to be retrieved.\n" if $verbose;
push @remote_file_list, "$remote_dir/$filename";
}
}
}
}
# get files from archive
#-----------------------
if (@remote_file_list) {
# dmget files
#------------
%opts = ();
$opts{"dmget_bin"} = $dmget_bin if $dmget_bin;
$opts{"run_config"} = $run_config;
$opts{"verbose"} = $verbose if $verbose;
print "rdmget($remote_user, $remote_machine, \@remote_file_list, \%opts)\n" if $verbose;
$rdmget_rc = rdmget($remote_user, $remote_machine, \@remote_file_list, \%opts);
print "ERROR in DMGET on $remote_machine\n" unless $rdmget_rc;
# retrieve files from archive
#----------------------------
unless ($silo_work) {
%opts = ();
$opts{"debug"} = $verbose if $verbose;
$opts{"run_config"} = $run_config;
$opts{"preserve"} = 1;
foreach $remote_file (@remote_file_list) {
$filename = basename $remote_file;
$remote_ref = "$remote_user\@$remote_machine:$remote_file";
foreach $try (1..2) {
$rget_rc = rget($remote_ref, $filename, \%opts);
last if $rget_rc and -f $filename and -s $filename;
if ($ignore) {
warn "WARNING: Cannot acquire $remote_file\n";
$missing_inputs++;
last;
}
if ($try < 2) {
sleep 10;
print "RETRYING $remote_file\n";
next;
}
wrapup(1, $delete, "FATAL ERROR cannot acquire $remote_file");
}
}
}
}
# final check for files
#----------------------
foreach $currday ($startday..$endday) {
foreach $time (@times) {
$filename = token_resolve($fileToken, $currday, $time);
if (-f $filename and -s $filename) {
push @mean_files, $filename;
}
elsif ($ignore) {
warn "WARNING: $filename cannot be found\n";
$missing_inputs++;
}
else {
wrapup(1, $delete, "FATAL ERROR: $filename cannot be found");
}
}
}
# after prefetch, store info in workdir files for tar job
#--------------------------------------------------------
if ($prefetch) {
# write info for output tarfile
#------------------------------
if ($do_tar) {
open OFO, "> $OUT_TAR_INFO" or die "Error opening $OUT_TAR_INFO: $!";
print OFO "$local_dir\n";
print OFO "$remote_dir\n";
}
if ($missing_inputs) {
if (@mean_files) {
print OFO "partial\n" if $do_tar;
print "\n$missing_inputs $ftype $yyyymm inputs are missing.\n";
print "Will create partial tarfile for $ftype inputs.\n" if $do_tar;
} else {
print OFO "empty\n" if $do_tar;
print "\nNo $ftype $yyyymm inputs were found.\n";
print "No tarfile will be created for $ftype inputs.\n" if $do_tar;
wrapup(1, $delete, "FATAL ERROR: no $ftype inputs were found");
}
}
else {
print OFO "full\n" if $do_tar;
print "\nAll $ftype $yyyymm inputs were found.\n";
print "Will create full tarfile for $ftype inputs.\n" if $do_tar;
}
close OFO if $do_tar;
}
}
#=======================================================================
# name - calculate_means
# purpose - calculate monthly means
#=======================================================================
sub calculate_means {
use File::Copy ("copy");
use lib @SEARCH_PATH;
use Manipulate_time qw(token_resolve);
use Remote_utils qw(rput splitrfile);
my ($mtag, $dtag, $atag, $mfile, $dfile, $afile);
my ($local_afile, $local_mfile, $dflag, $strict);
my ($mpirun_mm, $cmd, $rc, @outfiles, $outfile);
my (%opts, $remote_ref, $local_ref);
my ($monitor_dir, $monitor_machine, $monitor_path);
my ($monitor_ref, $monitor_user);
my $notfound = 0;
# set output filename tokens
#---------------------------
$mtag = "$expid.$ftype.monthly";
$dtag = "$expid.$ftype.diurnal";
$atag = "$expid.$ftype.ave";
$mfile = "$mtag.$yyyymm.nc4";
$dfile = "$dtag.$yyyymm.nc4";
$afile = "$atag.$yyyymm.nc4";
if ($nodiurnal) { @outfiles = ($mfile) }
else { @outfiles = ($mfile, $dfile) }
foreach $outfile (@outfiles) {
if (-e $outfile) { unlink($outfile) or warn "unable to delete $outfile\n" }
}
# get mpirun command from environment
#------------------------------------
$mpirun_mm = $ENV{"MPIRUN_MM"};
delete $ENV{"SLURM_MEM_PER_GPU"} if $ENV{"SLURM_MEM_PER_GPU"};
delete $ENV{"SLURM_MEM_PER_NODE"} if $ENV{"SLURM_MEM_PER_NODE"};
if ($ignore) { $strict = "-strict .false." }
else { $strict = "" }
if ($nodiurnal) { $dflag = "" }
else { $dflag = "-d $dtag" }
#===============
# RUN EXECUTABLE
#===============
$cmd = "$mpirun_mm $monthly_means_x -rc $rcfile $strict -ops -tag $mtag $dflag -hdf";
foreach (@mean_files) { $cmd .= " $_" }
$rc = system_($cmd);
#===============
# push files to local directory
#------------------------------
foreach $outfile (@outfiles) { $notfound = 1 unless -e $outfile }
if ($notfound or $rc) {
# report error and wrap up
#-------------------------
print "rc = $rc\n";
foreach $outfile (@outfiles) {
unless (-e $outfile) {
print "$outfile not found\n";
wrapup(1, $delete, "Running $monthly_means_x failed for $outfile.");
}
}
} else {
%opts = ();
$opts{"debug"} = $verbose if $verbose;
$opts{"direct"} = 1;
$opts{"run_config"} = $run_config;
foreach $outfile ( @outfiles ) {
# copy to local directory
#------------------------
unless ($silo_work) {
$local_ref = "$local_dir/$outfile";
copy $outfile, $local_ref;
}
# rput to remote location
#------------------------
unless ($localflg) {
$remote_ref = "$remote_user\@$remote_machine:$remote_dir/$outfile";
rput($outfile, $remote_ref, \%opts)
}
# rput to monitor location
#-------------------------
if ($monitorloc) {
($monitor_user, $monitor_machine, $monitor_path) = splitrfile($monitorloc);
$monitor_dir = token_resolve($monitor_path, $startday);
$monitor_ref = "$monitor_user\@$monitor_machine:$monitor_dir/$outfile";
rput($outfile, $monitor_ref, \%opts);
}
# add to list of files to be deleted on wrapup
#----------------------------------------------
push @remove, $outfile if $delete;
}
# link monthly file to ave to maintain compatibility with plotting
#-----------------------------------------------------------------
$local_afile = "$local_dir/$afile";
$local_mfile = "$local_dir/$mfile";
symlink $local_mfile, $local_afile unless -e $local_afile;
}
}
#=======================================================================
# name - wrapup
# purpose - Wrap up by doing dmput on archive; delete files, if requested
#=======================================================================
sub wrapup{
use Remote_utils qw(rdmget);
my ($die_away, $delete, $message);
my (%opts, $rc, $rdmget_rc);
($die_away, $delete, $message) = @_;
if ($delete and @remove) {
$rc = unlink (@remove) or warn "unable to delete working files\n" ;
print "$rc files removed \n" if $verbose;
rmdir $workdir or warn "unable to rmdir $workdir\n";
}
die "FATAL ERROR: $message \n" if $die_away;
if ($do_dmput and @remote_file_list) {
%opts = ();
$opts{"dmget_bin"} = $dmget_bin if $dmget_bin;
$opts{"do_dmput"} = 1,
$opts{"run_config"} = $run_config;
$opts{"verbose"} = $verbose if $verbose;
print "rdmget($remote_user, $remote_machine, \@remote_file_list, \%opts)\n" if $verbose;
$rdmget_rc = rdmget($remote_user, $remote_machine, \@remote_file_list, \%opts);
print "ERROR in DMPUT on $remote_machine\n" unless $rdmget_rc;
}
print "$message\n";
exit(0);
}
#=======================================================================
# name - extract_value
# purpose - extract value for variable from a file where the record
# has format, $variable: $value
#
# input parameters
# => $fname: name of file from which to extract value
# => $var: name of variable whose value to extract
#=======================================================================
sub extract_value {
my ($fname, $var, $val);
$fname = shift;
$var = shift;
$val = "";
open(FNAME, "< $fname") or die "Error opening $fname: $!";
while (<FNAME>) {
$val = $1 if /\s*$var\s*:\s*(\S+)\s*/;
last if $val;
}
return $val;
}
#=======================================================================
# name - system_
# purpose - print $cmd and then execute it
#=======================================================================
sub system_ {
my ($cmd, $rc);
$cmd = shift;
print "$cmd\n";
$rc = system($cmd);
return $rc;
}
#=======================================================================
# name - usage
# purpose - print usage information
#=======================================================================
sub usage {
print <<"EOF";
USAGE
$script -D YYYYMMDD -f fvdas_file [ -C -H FVHOME -i -l -m mon_loc -R FVROOT -r Run_Config -S SILO_DIR -v -w workdir ]
DESCRIPTION
$script - calculate monthly mean and quadratics for a GEOS-5 DAS output file
OPTIONS
-C clean flag - Remove local working copy of file after means calculation
-c configuration file for time_ave.x Default is FVROOT/etc/time_ave.rc
-D date Date of data to convert, in YYYYMMDD format.
-f filestring filestring entry from monthly.rc
-H FVHOME The home directory for this fvDAS run. monthly_means will
place FVHOME/run in the executable search path. If not specified
script will attempt to get value from FVHOME environment variable.
-h Prints this usage notice
-i (non-strict mode) ignore missing files
-L Flag to toggle local processing without pulling from or pushing to archive
-l Flag to use links to local data files rather than copying them
-M time_ave.x Optional binary to compute monthly means. Default is FVROOT/bin/time_ave.x
-m mon_loc Optional remote location to distribute means files for operational
-nd Do not produce diurnal means.
-prefetch Fetch files but do not calculate monthly means
-R FVROOT The installation directory of the fvDAS software. If not specified,
then script will attempt to get the value from FVROOT environment variable.
-r run_config Run_Config file for file transfer options if not DEFAULT
-S SILO_DIR If silo is supplied with -S all work is done on files in situ
-v Flag to enable verbose output to STDOUT
-w workdir User defined work space for monthly processing.
REQUIRED FILES
Manipulate_time.pm
Remote_utils.pm
time_ave.x
EOF
exit(1)
}
| 37.418458 | 122 | 0.508784 |
ed563ff5c62d55675347fec9d0214191a42b37fb | 277 | t | Perl | examples/lists.t | bbonf/matcha | dd38f9e487e02e086969735a0e6a16ddeea8e51f | [
"MIT"
]
| null | null | null | examples/lists.t | bbonf/matcha | dd38f9e487e02e086969735a0e6a16ddeea8e51f | [
"MIT"
]
| null | null | null | examples/lists.t | bbonf/matcha | dd38f9e487e02e086969735a0e6a16ddeea8e51f | [
"MIT"
]
| null | null | null | $ python $TESTDIR/../main.py js $TESTDIR/lists.tea 2>/dev/null | node
[1, 2, 3]
[1, 2, 3]
$ python $TESTDIR/../main.py java $TESTDIR/lists.tea 2>/dev/null > Program.java
$ javac Program.java >/dev/null 2>/dev/null
$ java Program 2>/dev/null
[1, 2, 3]
[1, 2, 3]
| 30.777778 | 81 | 0.602888 |
ed5617fb84ce338cc67c6e0152487c0dee71dedb | 23,394 | pm | Perl | lib/Bio/KBase/ObjectAPI/KBaseFBA/ModelReaction.pm | samseaver/KBaseFBAModeling | 22e9b9ac89be4db4bbac362d557c1145766e23ef | [
"MIT"
]
| null | null | null | lib/Bio/KBase/ObjectAPI/KBaseFBA/ModelReaction.pm | samseaver/KBaseFBAModeling | 22e9b9ac89be4db4bbac362d557c1145766e23ef | [
"MIT"
]
| null | null | null | lib/Bio/KBase/ObjectAPI/KBaseFBA/ModelReaction.pm | samseaver/KBaseFBAModeling | 22e9b9ac89be4db4bbac362d557c1145766e23ef | [
"MIT"
]
| null | null | null | ########################################################################
# Bio::KBase::ObjectAPI::KBaseFBA::ModelReaction - This is the moose object corresponding to the ModelReaction object
# Authors: Christopher Henry, Scott Devoid, Paul Frybarger
# Contact email: chenry@mcs.anl.gov
# Development location: Mathematics and Computer Science Division, Argonne National Lab
# Date of module creation: 2012-03-26T23:22:35
########################################################################
use strict;
use Bio::KBase::ObjectAPI::KBaseFBA::DB::ModelReaction;
package Bio::KBase::ObjectAPI::KBaseFBA::ModelReaction;
use Moose;
use Bio::KBase::ObjectAPI::utilities;
use namespace::autoclean;
extends 'Bio::KBase::ObjectAPI::KBaseFBA::DB::ModelReaction';
#***********************************************************************************************************
# ADDITIONAL ATTRIBUTES:
#***********************************************************************************************************
has equation => ( is => 'rw', isa => 'Str',printOrder => '-1', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildequation' );
has code => ( is => 'rw', isa => 'Str',printOrder => '-1', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildequationcode' );
has definition => ( is => 'rw', isa => 'Str',printOrder => '3', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_builddefinition' );
has revEquationCode => ( is => 'rw', isa => 'Str', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildrevequationcode' );
has name => ( is => 'rw', isa => 'Str',printOrder => '2', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildname' );
has abbreviation => ( is => 'rw', isa => 'Str',printOrder => '2', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildabbreviation' );
has modelCompartmentLabel => ( is => 'rw', isa => 'Str',printOrder => '4', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildmodelCompartmentLabel' );
has gprString => ( is => 'rw', isa => 'Str',printOrder => '6', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildgprString' );
has exchangeGPRString => ( is => 'rw', isa => 'Str',printOrder => '-1', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildexchangeGPRString' );
has missingStructure => ( is => 'rw', isa => 'Bool',printOrder => '-1', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildmissingStructure' );
has biomassTransporter => ( is => 'rw', isa => 'Bool',printOrder => '-1', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildbiomassTransporter' );
has isTransporter => ( is => 'rw', isa => 'Bool',printOrder => '-1', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildisTransporter' );
has translatedDirection => ( is => 'rw', isa => 'Str',printOrder => '-1', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildtranslatedDirection' );
has featureIDs => ( is => 'rw', isa => 'ArrayRef',printOrder => '-1', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildfeatureIDs' );
has featureUUIDs => ( is => 'rw', isa => 'ArrayRef',printOrder => '-1', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildfeatureUUIDs' );
has equationCode => ( is => 'rw', isa => 'Str', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildequationcode' );
has revEquationCode => ( is => 'rw', isa => 'Str', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildrevequationcode' );
has equationCompFreeCode => ( is => 'rw', isa => 'Str', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildcompfreeequationcode' );
has revEquationCompFreeCode => ( is => 'rw', isa => 'Str', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildrevcompfreeequationcode' );
has genEquationCode => ( is => 'rw', isa => 'Str', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildgenequationcode' );
has revGenEquationCode => ( is => 'rw', isa => 'Str', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildgenrevequationcode' );
has equationFormula => ( is => 'rw', isa => 'Str', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildequationformula' );
has complexString => ( is => 'rw', isa => 'Str', type => 'msdata', metaclass => 'Typed', lazy => 1, builder => '_buildcomplexString' );
#***********************************************************************************************************
# BUILDERS:
#***********************************************************************************************************
sub _buildname {
my ($self) = @_;
return $self->reaction->name()."_".$self->modelCompartmentLabel();
}
sub _buildabbreviation {
my ($self) = @_;
return $self->reaction->abbreviation()."_".$self->modelCompartmentLabel();
}
sub _builddefinition {
my ($self) = @_;
return $self->createEquation({format=>"name"});
}
sub _buildequation {
my ($self) = @_;
return $self->createEquation({format=>"id"});
}
sub _buildequationcode {
my ($self) = @_;
return $self->createEquation({indecies => 0,format=>"id",hashed=>1,protons=>0,direction=>0});
}
sub _buildrevequationcode {
my ($self) = @_;
return $self->createEquation({indecies => 0,format=>"id",hashed=>1,protons=>0,reverse=>1,direction=>0});
}
sub _buildgenequationcode {
my ($self) = @_;
return $self->createEquation({format=>"id",hashed=>1,protons=>0,direction=>0,generalized=>1});
}
sub _buildgenrevequationcode {
my ($self) = @_;
return $self->createEquation({format=>"id",hashed=>1,protons=>0,reverse=>1,direction=>0,generalized=>1});
}
sub _buildcompfreeequationcode {
my ($self) = @_;
return $self->createEquation({indecies => 0,format=>"id",hashed=>1,compts=>0});
}
sub _buildrevcompfreeequationcode {
my ($self) = @_;
return $self->createEquation({indecies => 0,format=>"id",hashed=>1,compts=>0,reverse=>1});
}
sub _buildequationformula {
my ($self,$args) = @_;
return $self->createEquation({indecies => 0,format=>"formula",hashed=>0,water=>0});
}
sub _buildmodelCompartmentLabel {
my ($self) = @_;
return $self->modelcompartment()->id();
}
sub _buildgprString {
my ($self) = @_;
my $gprs = [];
my $allUnknown = 1;
foreach my $protein (@{$self->modelReactionProteins()}) {
my $one_gpr = $protein->gprString();
if ( $one_gpr ne "Unknown" ) {
$allUnknown = 0;
}
push(@$gprs, $protein->gprString());
}
my $gpr = "";
# Account for possibility that all of the multiple reaction proteins are empty.
if ( $allUnknown == 1 ) {
$gpr = "Unknown";
return $gpr;
}
foreach my $one_gpr (@$gprs) {
# Avoid printing GPRs that look like (unknown or GENE) if one modelReactionProtein is empty and another has genes in it.
if ( $one_gpr eq "Unknown" ) { next; }
if (length($gpr) > 0) {
$gpr .= " or ";
}
$gpr .= $one_gpr;
}
if (@{$self->modelReactionProteins()} > 1) {
$gpr = "(".$gpr.")";
}
if (length($gpr) == 0) {
$gpr = "Unknown";
}
return $gpr;
}
sub _buildexchangeGPRString {
my ($self) = @_;
my $gpr = "MSGPR{";
foreach my $protein (@{$self->modelReactionProteins()}) {
if (length($gpr) > 6) {
$gpr .= "/";
}
$gpr .= $protein->exchangeGPRString();
}
$gpr .= "}";
return $gpr;
}
sub _buildmissingStructure {
my ($self) = @_;
my $rgts = $self->modelReactionReagents();
for (my $i=0; $i < @{$rgts}; $i++) {
my $rgt = $rgts->[$i];
if (@{$rgt->modelcompound()->compound()->structures()} == 0) {
return 1;
}
}
return 0;
}
sub _buildbiomassTransporter {
my ($self) = @_;
my $rgts = $self->modelReactionReagents();
for (my $i=0; $i < @{$rgts}; $i++) {
my $rgt = $rgts->[$i];
if ($rgt->modelcompound()->isBiomassCompound() == 1) {
for (my $j=$i+1; $j < @{$rgts}; $j++) {
my $rgtc = $rgts->[$j];
if ($rgt->modelcompound()->compound_ref() eq $rgtc->modelcompound()->compound_ref()) {
if ($rgt->modelcompound()->modelcompartment_ref() ne $rgtc->modelcompound()->modelcompartment_ref()) {
return 1;
}
}
}
}
}
return 0;
}
sub _buildisTransporter {
my ($self) = @_;
my $rgts = $self->modelReactionReagents();
my $initrgt = $rgts->[0];
for (my $i=1; $i < @{$rgts}; $i++) {
my $rgt = $rgts->[$i];
if ($rgt->modelcompound()->modelcompartment_ref() ne $initrgt->modelcompound()->modelcompartment_ref()) {
return 1;
}
}
return 0;
}
sub _buildtranslatedDirection {
my ($self) = @_;
if ($self->direction() eq "=") {
return "<=>";
} elsif ($self->direction() eq ">") {
return "=>";
} elsif ($self->direction() eq "<") {
return "<=";
}
return $self->direction();
}
sub _buildfeatureIDs {
my ($self) = @_;
my $featureHash = {};
foreach my $protein (@{$self->modelReactionProteins()}) {
foreach my $subunit (@{$protein->modelReactionProteinSubunits()}) {
foreach my $gene (@{$subunit->features()}) {
$featureHash->{$gene->id()} = 1;
}
}
}
return [keys(%{$featureHash})];
}
sub _buildfeatureUUIDs {
my ($self) = @_;
my $featureHash = {};
foreach my $protein (@{$self->modelReactionProteins()}) {
foreach my $subunit (@{$protein->modelReactionProteinSubunits()}) {
foreach my $gene (@{$subunit->features()}) {
$featureHash->{$gene->_reference()} = 1;
}
}
}
return [keys(%{$featureHash})];
}
sub _buildcomplexString {
my ($self) = @_;
my $complexString = "";
foreach my $protein (@{$self->modelReactionProteins()}) {
my $sustring = "";
foreach my $subunit (@{$protein->modelReactionProteinSubunits()}) {
my $genestring = "";
foreach my $gene (@{$subunit->features()}) {
if (length($genestring) > 0) {
$genestring .= "=";
}
$genestring .= $gene->id();
}
if (length($genestring) > 0) {
if (length($sustring) > 0) {
$sustring .= "+";
}
$sustring .= $genestring;
}
}
if (length($sustring) > 0) {
if (length($complexString) > 0) {
$complexString .= "&";
}
$complexString .= $sustring;
}
}
return $complexString;
}
#***********************************************************************************************************
# CONSTANTS:
#***********************************************************************************************************
#***********************************************************************************************************
# FUNCTIONS:
#***********************************************************************************************************
sub getAlias {
my ($self,$set) = @_;
my $aliases = $self->getAliases($set);
return (@$aliases) ? $aliases->[0] : undef;
}
sub getAliases {
my ($self,$setName) = @_;
return [] unless(defined($setName));
my $output = [];
my $aliases = $self->aliases();
for (my $i=0; $i < @{$aliases}; $i++) {
if ($aliases->[$i] =~ m/$setName:(.+)/) {
push(@{$output},$1);
} elsif ($aliases->[$i] !~ m/:/ && $setName eq "name") {
push(@{$output},$aliases->[$i]);
}
}
return $output;
}
sub allAliases {
my ($self) = @_;
my $output = [];
my $aliases = $self->aliases();
for (my $i=0; $i < @{$aliases}; $i++) {
if ($aliases->[$i] =~ m/(.+):(.+)/) {
push(@{$output},$2);
} else {
push(@{$output},$aliases->[$i]);
}
}
return $output;
}
sub hasAlias {
my ($self,$alias,$setName) = @_;
my $aliases = $self->aliases();
for (my $i=0; $i < @{$aliases}; $i++) {
if (defined($setName) && $aliases->[$i] eq $setName.":".$alias) {
return 1;
} elsif (!defined($setName) && $aliases->[$i] eq $alias) {
return 1;
}
}
return 0;
}
sub addAlias {
my ($self,$alias,$setName) = @_;
my $aliases = $self->aliases();
for (my $i=0; $i < @{$aliases}; $i++) {
if (defined($setName) && $aliases->[$i] eq $setName.":".$alias) {
return ;
} elsif (!defined($setName) && $aliases->[$i] eq $alias) {
return ;
}
}
if (defined($setName)) {
push(@{$aliases},$setName.":".$alias);
} else {
push(@{$aliases},$alias);
}
}
=head3 createEquation
Definition:
string = Bio::KBase::ObjectAPI::KBaseFBA::ModelReaction->createEquation({
format => string(id),
hashed => 0/1(0)
});
Description:
Creates an equation for the model reaction with compounds specified according to the input format
=cut
sub createEquation {
my ($self,$args) = @_;
$args = Bio::KBase::ObjectAPI::utilities::args([], { indecies => 1,
format => 'id',
hashed => 0,
water => 1,
compts=>1,
reverse=>0,
direction=>1,
protons => 1,
generalized => 0}, $args);
my $rgts = $self->modelReactionReagents();
my $rgtHash;
my $rxnCompID = $self->modelcompartment()->compartment()->id();
my $hcpd = $self->parent()->biochemistry()->checkForProton();
if (!defined($hcpd) && $args->{hashed}==1) {
Bio::KBase::ObjectAPI::utilities::error("Could not find proton in biochemistry!");
}
my $wcpd = $self->parent()->biochemistry()->checkForWater();
if (!defined($wcpd) && $args->{water}==1) {
Bio::KBase::ObjectAPI::utilities::error("Could not find water in biochemistry!");
}
for (my $i=0; $i < @{$rgts}; $i++) {
my $rgt = $rgts->[$i];
my $id = $rgt->modelcompound()->compound()->id();
if ($id eq "cpd00000") {
$id = $rgt->modelcompound()->id();
}
next if $args->{protons} == 0 && $id eq $hcpd->id() && !$self->isTransporter();
next if $args->{water} == 0 && $id eq $wcpd->id();
if ($args->{format} eq "name") {
my $function = $args->{format};
$id = $rgt->modelcompound()->compound()->$function();
} elsif ($args->{format} ne "uuid" && $args->{format} ne "id") {
if($args->{format} ne "formula"){
$id = $rgt->modelcompound()->compound()->getAlias($args->{format});
}
}
if (!defined($rgtHash->{$id}->{$rgt->modelcompound()->modelcompartment()->id()})) {
$rgtHash->{$id}->{$rgt->modelcompound()->modelcompartment()->id()} = 0;
}
$rgtHash->{$id}->{$rgt->modelcompound()->modelcompartment()->id()} += $rgt->coefficient();
}
my @reactcode = ();
my @productcode = ();
my $sign = " <=> ";
if($args->{direction}==1){
$sign = " => " if $self->direction() eq ">";
$sign = " <= " if $self->direction() eq "<";
}
my %FoundComps=();
my $CompCount=0;
my $sortedCpd = [sort(keys(%{$rgtHash}))];
for (my $i=0; $i < @{$sortedCpd}; $i++) {
my $printId = $sortedCpd->[$i];
if($args->{format} eq "formula"){
$printId = $self->parent()->biochemistry()->getObject("compounds",$sortedCpd->[$i])->formula();
}
my $comps = [sort(keys(%{$rgtHash->{$sortedCpd->[$i]}}))];
for (my $j=0; $j < @{$comps}; $j++) {
if ($comps->[$j] =~ m/([a-z])(\d+)/) {
my $comp = $1;
my $index = $2;
my $compartment = $comp;
if($args->{generalized} && !exists($FoundComps{$comp})){
$compartment = $CompCount;
$FoundComps{$comp}=$CompCount;
$CompCount++;
}elsif($args->{generalized} && exists($FoundComps{$comp})){
$compartment = $FoundComps{$comp};
}
if ($args->{indecies} == 0) {
$compartment = "[".$compartment."]";
}else{
$compartment = "[".$compartment.$index."]";
}
$compartment= "" if !$args->{compts};
if ($rgtHash->{$sortedCpd->[$i]}->{$comps->[$j]} < 0) {
my $coef = -1*$rgtHash->{$sortedCpd->[$i]}->{$comps->[$j]};
my $reactcode = "(".$coef.") ".$printId.$compartment;
push(@reactcode,$reactcode);
} elsif ($rgtHash->{$sortedCpd->[$i]}->{$comps->[$j]} > 0) {
my $coef = $rgtHash->{$sortedCpd->[$i]}->{$comps->[$j]};
my $productcode .= "(".$coef.") ".$printId.$compartment;
push(@productcode, $productcode);
}
}
}
}
my $reaction_string = join(" + ",@reactcode).$sign.join(" + ",@productcode);
if($args->{reverse}==1){
$reaction_string = join(" + ",@productcode).$sign.join(" + ",@reactcode);
}
if ($args->{hashed} == 1) {
return Digest::MD5::md5_hex($reaction_string);
}
return $reaction_string;
}
=head3 hasModelReactionReagent
Definition:
boolean = Bio::KBase::ObjectAPI::KBaseFBA::ModelReaction->hasModelReactionReagent(string(uuid));
Description:
Checks to see if a model reaction contains a reagent
=cut
sub hasModelReactionReagent {
my ($self,$mdlcpd_id) = @_;
my $rgts = $self->modelReactionReagents();
if (!defined($rgts->[0])) {
return 0;
}
for (my $i=0; $i < @{$rgts}; $i++) {
if ($rgts->[$i]->modelcompound()->id() eq $mdlcpd_id) {
return 1;
}
}
return 0;
}
=head3 addReagentToReaction
Definition:
Bio::KBase::ObjectAPI::KBaseFBA::FBAModel = Bio::KBase::ObjectAPI::KBaseFBA::FBAModel->addReagentToReaction({
coefficient => REQUIRED,
modelcompound_ref => REQUIRED
});
Description:
Add a new ModelCompound object to the ModelReaction if the ModelCompound is not already in the reaction
=cut
sub addReagentToReaction {
my $self = shift;
my $args = Bio::KBase::ObjectAPI::utilities::args(["coefficient","modelcompound_ref"],{}, @_);
my $rgts = $self->modelReactionReagents();
for (my $i=0; $i < @{$rgts}; $i++) {
if ($rgts->[$i]->modelcompound_ref() eq $args->{modelcompound_ref}) {
return $rgts->[$i];
}
}
my $mdlrxnrgt = $self->add("modelReactionReagents",{
coefficient => $args->{coefficient},
modelcompound_ref => $args->{modelcompound_ref}
});
return $mdlrxnrgt;
}
=head3 addModelReactionProtein
Definition:
Bio::KBase::ObjectAPI::KBaseFBA::FBAModel = Bio::KBase::ObjectAPI::KBaseFBA::FBAModel->addModelReactionProtein({
proteinDataTree => REQUIRED:{},
complex_uuid => REQUIRED:ModelSEED::uuid
});
Description:
Adds a new protein to the reaction based on the input data tree
=cut
sub addModelReactionProtein {
my $self = shift;
my $args = Bio::KBase::ObjectAPI::utilities::args(["proteinDataTree"], {complex_ref => ""}, @_);
my $prots = $self->modelReactionProteins();
for (my $i=0; $i < @{$prots}; $i++) {
if ($prots->[$i]->complex_ref() eq $args->{complex_ref}) {
return $prots->[$i];
}
}
my $protdata = {complex_ref => $args->{complex_ref},modelReactionProteinSubunits => []};
if (defined($args->{proteinDataTree}->{note})) {
$protdata->{note} = $args->{proteinDataTree}->{note};
}
if (defined($args->{proteinDataTree}->{subunits})) {
foreach my $subunit (keys(%{$args->{proteinDataTree}->{subunits}})) {
my $data = {
triggering => $args->{proteinDataTree}->{subunits}->{$subunit}->{triggering},
optionalSubunit => $args->{proteinDataTree}->{subunits}->{$subunit}->{optionalRole},
role => $subunit,
feature_refs => [],
note => ""
};
if (defined($args->{proteinDataTree}->{subunits}->{$subunit}->{note})) {
$data->{note} = $args->{proteinDataTree}->{subunits}->{$subunit}->{note};
}
if (defined($args->{proteinDataTree}->{subunits}->{$subunit}->{genes})) {
foreach my $gene (keys(%{$args->{proteinDataTree}->{subunits}->{$subunit}->{genes}})) {
push(@{$data->{feature_refs}},$gene);
}
}
push(@{$protdata->{modelReactionProteinSubunits}},$data);
}
}
return $self->add("modelReactionProteins",$protdata);
}
=head3 setGPRFromArray
Definition:
Bio::KBase::ObjectAPI::KBaseFBA::FBAModel = Bio::KBase::ObjectAPI::KBaseFBA::FBAModel->setGPRFromArray({
gpr => []
});
Description:
Sets the GPR of the reaction from three nested arrays
=cut
sub setGPRFromArray {
my $self = shift;
my $args = Bio::KBase::ObjectAPI::utilities::args(["gpr"],{}, @_);
$self->modelReactionProteins([]);
foreach my $prot (@{$self->modelReactionProteins()}) {
$self->remove("modelReactionProteins",$prot);
}
for (my $i=0; $i < @{$args->{gpr}}; $i++) {
if (defined($args->{gpr}->[$i]) && ref($args->{gpr}->[$i]) eq "ARRAY") {
my $prot = $self->add("modelReactionProteins",{
complex_ref => "",
note => "Manually specified GPR"
});
for (my $j=0; $j < @{$args->{gpr}->[$i]}; $j++) {
if (defined($args->{gpr}->[$i]->[$j]) && ref($args->{gpr}->[$i]->[$j]) eq "ARRAY") {
for (my $k=0; $k < @{$args->{gpr}->[$i]->[$j]}; $k++) {
if (defined($args->{gpr}->[$i]->[$j]->[$k])) {
my $featureId = $args->{gpr}->[$i]->[$j]->[$k];
my $ftrObj = $self->genome()->getObject("features",$featureId);
if (!defined($ftrObj)) {
$prot->note($featureId);
}
else {
my $subunit = $prot->add("modelReactionProteinSubunits",{
role => "",
triggering => 0,
optionalSubunit => 0,
note => "Manually specified GPR",
feature_refs => [$ftrObj->_reference()]
});
}
}
}
}
}
}
}
}
sub ImportExternalEquation {
my $self = shift;
my $args = Bio::KBase::ObjectAPI::utilities::args(["reagents"],{}, @_);
my $bio = $self->parent()->template()->biochemistry();
my $rxncpds = $self->modelReactionReagents();
for (my $i=0; $i < @{$rxncpds}; $i++){
$self->remove("modelReactionReagents",$rxncpds->[$i])
}
$self->modelReactionReagents([]);
foreach my $key (keys(%{$args->{reagents}})) {
$self->add("modelReactionReagents",{
modelcompound_ref => "~/modelcompounds/id/".$key,
coefficient => $args->{reagents}->{$key}
});
}
my $output = $bio->searchForReactionByCode($self->equationCode());
if (defined($output)) {
$self->reaction_ref($bio->_reference()."/reactions/id/".$output->{rxnobj}->id());
if ($output->{dir} eq "r") {
if ($self->direction() eq ">") {
$self->direction("<");
} elsif ($self->direction() eq "<") {
$self->direction(">");
}
my $rgts = $self->modelReactionReagents();
for (my $i=0; $i < @{$rgts}; $i++) {
$rgts->[$i]->coefficient(-1*$rgts->[$i]->coefficient());
}
}
} else {
print "Not found:".$self->id()."\n";
my $array = [split(/_/,$self->id())];
my $rxn = $bio->searchForReaction($array->[0]);
if (defined($rxn)) {
print $rxn->createEquation({format=>"id",protons=>0,direction=>0})."\n";
print $self->createEquation({indecies => 0,format=>"id",hashed=>0,protons=>0,direction=>0})."\n";
}
$self->reaction_ref($bio->_reference()."/reactions/id/rxn00000");
}
}
sub loadGPRFromString {
my $self = shift;
my $gprstring = shift;
my $geneAliases = $self->parent()->genome()->geneAliasHash();
my $gpr = Bio::KBase::ObjectAPI::utilities::translateGPRHash(Bio::KBase::ObjectAPI::utilities::parseGPR($gprstring));
my $missingGenes;
for (my $m=0; $m < @{$gpr}; $m++) {
my $protObj = $self->add("modelReactionProteins",{
complex_ref => "",
note => "Imported GPR",
modelReactionProteinSubunits => []
});
for (my $j=0; $j < @{$gpr->[$m]}; $j++) {
my $subObj = $protObj->add("modelReactionProteinSubunits",{
role => "",
triggering => 0,
optionalSubunit => 0,
note => "Imported GPR",
feature_refs => []
});
for (my $k=0; $k < @{$gpr->[$m]->[$j]}; $k++) {
my $ftrID = $gpr->[$m]->[$j]->[$k];
if (!defined($geneAliases->{$ftrID})) {
$missingGenes->{$ftrID} = 1;
} else {
$subObj->addLinkArrayItem("features",$geneAliases->{$ftrID});
}
}
}
}
}
__PACKAGE__->meta->make_immutable;
1;
| 34.916418 | 169 | 0.554416 |
ed34eb2295c2282290ffc6e3d0fb1221b2def397 | 9,866 | t | Perl | t/AnnotationSourceAdaptor.t | HDRUK/ensembl-vep | 10932fab1e9c113e8e5d317e1f668413390344ac | [
"Apache-2.0"
]
| null | null | null | t/AnnotationSourceAdaptor.t | HDRUK/ensembl-vep | 10932fab1e9c113e8e5d317e1f668413390344ac | [
"Apache-2.0"
]
| null | null | null | t/AnnotationSourceAdaptor.t | HDRUK/ensembl-vep | 10932fab1e9c113e8e5d317e1f668413390344ac | [
"Apache-2.0"
]
| null | null | null | # Copyright [2016-2020] EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
use strict;
use warnings;
use Test::More;
use Test::Exception;
use FindBin qw($Bin);
use lib $Bin;
use VEPTestingConfig;
my $test_cfg = VEPTestingConfig->new();
## BASIC TESTS
##############
# use test
use_ok('Bio::EnsEMBL::VEP::AnnotationSourceAdaptor');
my $asa = Bio::EnsEMBL::VEP::AnnotationSourceAdaptor->new();
ok($asa, 'new is defined');
is(ref($asa), 'Bio::EnsEMBL::VEP::AnnotationSourceAdaptor', 'check class');
# need to get a config object for further tests
use_ok('Bio::EnsEMBL::VEP::Config');
my $cfg_hash = $test_cfg->base_testing_cfg;
my $cfg = Bio::EnsEMBL::VEP::Config->new($cfg_hash);
ok($cfg, 'get new config object');
ok($asa = Bio::EnsEMBL::VEP::AnnotationSourceAdaptor->new({config => $cfg}), 'new with config');
## METHOD CALLS
###############
my $exp = [
bless( {
'_config' => $cfg,
'serializer_type' => undef,
'dir' => $test_cfg->{cache_dir},
'cache_region_size' => $cfg->param('cache_region_size'),
'gencode_basic' => undef,
'all_refseq' => undef,
'source_type' => 'ensembl',
'sift' => undef,
'polyphen' => undef,
'everything' => undef,
'filter' => [],
'info' => {
'sift' => 'sift5.2.2',
'polyphen' => '2.2.2',
'1000genomes' => 'phase3',
'COSMIC' => '80',
'ESP' => 'V2-SSA137',
'gnomAD' => '170228',
'gencode' => 'GENCODE 24',
'genebuild' => '2014-07',
'HGMD-PUBLIC' => '20164',
'regbuild' => '13.0',
'dbSNP' => '149',
'ClinVar' => '201704',
'assembly' => 'GRCh38.p5'
},
'valid_chromosomes' => [21, 22, 'LRG_485'],
'bam' => undef,
'use_transcript_ref' => undef,
'nearest' => undef,
}, 'Bio::EnsEMBL::VEP::AnnotationSource::Cache::Transcript' )
];
is_deeply($asa->get_all_from_cache(), $exp, 'get_all_from_cache');
is_deeply($asa->get_all(), $exp, 'get_all');
$asa->param('check_existing', 1);
is_deeply(ref($asa->get_all()->[0]), 'Bio::EnsEMBL::VEP::AnnotationSource::Cache::Variation', 'get_all - var comes first');
$asa->param('check_existing', 0);
$asa->param('custom', [$test_cfg->{custom_vcf}]);
throws_ok {$asa->get_all_custom} qr/No format/, 'get_all_custom - no format';
$asa->param('custom', [$test_cfg->{custom_vcf}.',test,foo,exact']);
throws_ok {$asa->get_all_custom} qr/Unknown or unsupported format foo/, 'get_all_custom - invalid format';
$asa->param('no_remote', 1);
$asa->param('custom', ['http://foo.bar.com/file,test,foo,exact']);
throws_ok {$asa->get_all_custom} qr/Access to remote data files disabled/, 'get_all_custom - no_remote';
$asa->param('no_remote', 0);
# use test
use_ok('Bio::EnsEMBL::VEP::AnnotationSource::File');
SKIP: {
no warnings 'once';
## REMEMBER TO UPDATE THIS SKIP NUMBER IF YOU ADD MORE TESTS!!!!
skip 'Bio::DB::HTS::Tabix module not available', 4 unless $Bio::EnsEMBL::VEP::AnnotationSource::File::CAN_USE_TABIX_PM;
$asa->param('custom', [$test_cfg->{custom_vcf}.',test,vcf,exact']);
is_deeply(
$asa->get_all_custom(),
[
bless( {
'short_name' => 'test',
'_config' => $asa->config,
'report_coords' => 0,
'file' => $test_cfg->{custom_vcf},
'type' => 'exact',
'custom_multi_allelic' => undef,
'info' => {
'custom_info' => {
'short_name' => 'test',
'report_coords' => undef,
'file' => $test_cfg->{custom_vcf},
'type' => 'exact'
}
}
}, 'Bio::EnsEMBL::VEP::AnnotationSource::File::VCF' )
],
'get_all_custom'
);
$asa->param('custom', [$test_cfg->{custom_vcf}.',test,vcf']);
is_deeply(
$asa->get_all_custom(),
[
bless( {
'short_name' => 'test',
'_config' => $asa->config,
'report_coords' => 0,
'file' => $test_cfg->{custom_vcf},
'type' => 'overlap',
'custom_multi_allelic' => undef,
'info' => {
'custom_info' => {
'short_name' => 'test',
'report_coords' => undef,
'file' => $test_cfg->{custom_vcf},
'type' => 'overlap'
}
}
}, 'Bio::EnsEMBL::VEP::AnnotationSource::File::VCF' )
],
'get_all_custom - default overlap type'
);
$asa->param('custom', [$test_cfg->{custom_vcf}.',test,vcf,overlap,1']);
is_deeply(
$asa->get_all_custom(),
[
bless( {
'short_name' => 'test',
'_config' => $asa->config,
'report_coords' => 1,
'file' => $test_cfg->{custom_vcf},
'type' => 'overlap',
'custom_multi_allelic' => undef,
'info' => {
'custom_info' => {
'short_name' => 'test',
'report_coords' => 1,
'file' => $test_cfg->{custom_vcf},
'type' => 'overlap',
}
}
}, 'Bio::EnsEMBL::VEP::AnnotationSource::File::VCF' )
],
'get_all_custom - report_coords'
);
$asa->param('custom', [$test_cfg->{custom_vcf}.',test,vcf,overlap,1,FOO,BAR']);
is_deeply(
$asa->get_all_custom(),
[
bless( {
'short_name' => 'test',
'_config' => $asa->config,
'report_coords' => 1,
'fields' => ['FOO', 'BAR'],
'file' => $test_cfg->{custom_vcf},
'type' => 'overlap',
'custom_multi_allelic' => undef,
'info' => {
'custom_info' => {
'short_name' => 'test',
'report_coords' => 1,
'fields' => ['FOO', 'BAR'],
'file' => $test_cfg->{custom_vcf},
'type' => 'overlap',
}
}
}, 'Bio::EnsEMBL::VEP::AnnotationSource::File::VCF' )
],
'get_all_custom - fields'
);
}
$asa->param('custom', []);
## DATABASE TESTS
#################
SKIP: {
my $db_cfg = $test_cfg->db_cfg;
eval q{
use Bio::EnsEMBL::Test::TestUtils;
use Bio::EnsEMBL::Test::MultiTestDB;
1;
};
my $can_use_db = $db_cfg && scalar keys %$db_cfg && !$@;
## REMEMBER TO UPDATE THIS SKIP NUMBER IF YOU ADD MORE TESTS!!!!
skip 'No local database configured', 9 unless $can_use_db;
my $multi = Bio::EnsEMBL::Test::MultiTestDB->new('homo_vepiens') if $can_use_db;
$asa = Bio::EnsEMBL::VEP::AnnotationSourceAdaptor->new({
config => Bio::EnsEMBL::VEP::Config->new({
%$db_cfg,
database => 1,
offline => 0,
species => 'homo_vepiens',
})
});
$exp = [
bless( {
'polyphen' => undef,
'sift' => undef,
'everything' => undef,
'uniprot' => undef,
'_config' => $asa->config,
'xref_refseq' => undef,
'cache_region_size' => 50000,
'protein' => undef,
'domains' => undef,
'gencode_basic' => undef,
'source_type' => 'ensembl',
'core_type' => 'core',
'all_refseq' => undef,
'assembly' => undef,
'_species' => 'homo_vepiens',
'filter' => [],
'bam' => undef,
'use_transcript_ref' => undef,
'no_prefetch' => undef,
'merged' => undef,
'info' => {
'genebuild' => '2014-07',
'gencode' => 'GENCODE 24',
'assembly' => 'GRCh38.p5'
}
}, 'Bio::EnsEMBL::VEP::AnnotationSource::Database::Transcript' )
];
my $asas = $asa->get_all_from_database();
delete $asas->[0]->{_adaptors};
is_deeply($asas, $exp, 'get_all_from_database');
$asas = $asa->get_all();
delete $asas->[0]->{_adaptors};
is_deeply($asas, $exp, 'get_all - DB');
$asa->param('check_existing', 1);
is_deeply(
$asa->get_all_from_database()->[1],
bless( {
'_config' => $asa->config,
'cache_region_size' => 50000,
'failed' => 0,
'no_check_alleles' => undef,
'exclude_null_alleles' => undef,
}, 'Bio::EnsEMBL::VEP::AnnotationSource::Database::Variation' ),
'get_all_from_database - variation'
);
$asa->param('check_existing', 0);
$asa->param('regulatory', 1);
is_deeply(
$asa->get_all_from_database()->[1],
bless( {
'_config' => $asa->config,
'cache_region_size' => 50000,
'cell_type' => undef,
}, 'Bio::EnsEMBL::VEP::AnnotationSource::Database::RegFeat' ),
'get_all_from_database - regfeat'
);
$asa->param('regulatory', 0);
$asa->param('check_svs', 1);
is_deeply(
$asa->get_all_from_database()->[1],
bless( {
'_config' => $asa->config,
'cache_region_size' => 50000,
}, 'Bio::EnsEMBL::VEP::AnnotationSource::Database::StructuralVariation' ),
'get_all_from_database - SV'
);
$asa->param('check_svs', 0);
## check species with no var or reg db
$multi = Bio::EnsEMBL::Test::MultiTestDB->new('homo_vepiens_coreonly');
$asa = Bio::EnsEMBL::VEP::AnnotationSourceAdaptor->new({
config => Bio::EnsEMBL::VEP::Config->new({
%$db_cfg,
database => 1,
offline => 0,
species => 'homo_vepiens_coreonly',
})
});
is(scalar @{$asa->get_all_from_database}, 1, 'get_all_from_database - no var/reg 1');
$asa->param('check_existing', 1);
is(scalar @{$asa->get_all_from_database}, 1, 'get_all_from_database - no var/reg 2');
$asa->param('regulatory', 1);
is(scalar @{$asa->get_all_from_database}, 1, 'get_all_from_database - no var/reg 3');
$asa->param('check_svs', 1);
is(scalar @{$asa->get_all_from_database}, 1, 'get_all_from_database - no var/reg 4');
};
done_testing();
| 28.269341 | 123 | 0.574802 |
ed4f37bf5fd4bebc87bb2b02ea9263161a291687 | 17,328 | pm | Perl | perl/vendor/lib/DateTime/TimeZone/Asia/Yekaterinburg.pm | DDMoReFoundation/PortableNonmem | 7e40b30887537f24fed12421935b58325ba2e5c3 | [
"BSD-3-Clause-Clear"
]
| null | null | null | perl/vendor/lib/DateTime/TimeZone/Asia/Yekaterinburg.pm | DDMoReFoundation/PortableNonmem | 7e40b30887537f24fed12421935b58325ba2e5c3 | [
"BSD-3-Clause-Clear"
]
| null | null | null | perl/vendor/lib/DateTime/TimeZone/Asia/Yekaterinburg.pm | DDMoReFoundation/PortableNonmem | 7e40b30887537f24fed12421935b58325ba2e5c3 | [
"BSD-3-Clause-Clear"
]
| null | null | null | # This file is auto-generated by the Perl DateTime Suite time zone
# code generator (0.07) This code generator comes with the
# DateTime::TimeZone module distribution in the tools/ directory
#
# Generated from /tmp/_mzyzyR3wa/europe. Olson data version 2014g
#
# Do not edit this file directly.
#
package DateTime::TimeZone::Asia::Yekaterinburg;
$DateTime::TimeZone::Asia::Yekaterinburg::VERSION = '1.74';
use strict;
use Class::Singleton 1.03;
use DateTime::TimeZone;
use DateTime::TimeZone::OlsonDB;
@DateTime::TimeZone::Asia::Yekaterinburg::ISA = ( 'Class::Singleton', 'DateTime::TimeZone' );
my $spans =
[
[
DateTime::TimeZone::NEG_INFINITY, # utc_start
60447412647, # utc_end 1916-07-02 19:57:27 (Sun)
DateTime::TimeZone::NEG_INFINITY, # local_start
60447427200, # local_end 1916-07-03 00:00:00 (Mon)
14553,
0,
'LMT',
],
[
60447412647, # utc_start 1916-07-02 19:57:27 (Sun)
60543072895, # utc_end 1919-07-15 00:14:55 (Tue)
60447426152, # local_start 1916-07-02 23:42:32 (Sun)
60543086400, # local_end 1919-07-15 04:00:00 (Tue)
13505,
0,
'PMT',
],
[
60543072895, # utc_start 1919-07-15 00:14:55 (Tue)
60888139200, # utc_end 1930-06-20 20:00:00 (Fri)
60543087295, # local_start 1919-07-15 04:14:55 (Tue)
60888153600, # local_end 1930-06-21 00:00:00 (Sat)
14400,
0,
'SVET',
],
[
60888139200, # utc_start 1930-06-20 20:00:00 (Fri)
62490596400, # utc_end 1981-03-31 19:00:00 (Tue)
60888157200, # local_start 1930-06-21 01:00:00 (Sat)
62490614400, # local_end 1981-04-01 00:00:00 (Wed)
18000,
0,
'SVET',
],
[
62490596400, # utc_start 1981-03-31 19:00:00 (Tue)
62506404000, # utc_end 1981-09-30 18:00:00 (Wed)
62490618000, # local_start 1981-04-01 01:00:00 (Wed)
62506425600, # local_end 1981-10-01 00:00:00 (Thu)
21600,
1,
'SVEST',
],
[
62506404000, # utc_start 1981-09-30 18:00:00 (Wed)
62522132400, # utc_end 1982-03-31 19:00:00 (Wed)
62506422000, # local_start 1981-09-30 23:00:00 (Wed)
62522150400, # local_end 1982-04-01 00:00:00 (Thu)
18000,
0,
'SVET',
],
[
62522132400, # utc_start 1982-03-31 19:00:00 (Wed)
62537940000, # utc_end 1982-09-30 18:00:00 (Thu)
62522154000, # local_start 1982-04-01 01:00:00 (Thu)
62537961600, # local_end 1982-10-01 00:00:00 (Fri)
21600,
1,
'SVEST',
],
[
62537940000, # utc_start 1982-09-30 18:00:00 (Thu)
62553668400, # utc_end 1983-03-31 19:00:00 (Thu)
62537958000, # local_start 1982-09-30 23:00:00 (Thu)
62553686400, # local_end 1983-04-01 00:00:00 (Fri)
18000,
0,
'SVET',
],
[
62553668400, # utc_start 1983-03-31 19:00:00 (Thu)
62569476000, # utc_end 1983-09-30 18:00:00 (Fri)
62553690000, # local_start 1983-04-01 01:00:00 (Fri)
62569497600, # local_end 1983-10-01 00:00:00 (Sat)
21600,
1,
'SVEST',
],
[
62569476000, # utc_start 1983-09-30 18:00:00 (Fri)
62585290800, # utc_end 1984-03-31 19:00:00 (Sat)
62569494000, # local_start 1983-09-30 23:00:00 (Fri)
62585308800, # local_end 1984-04-01 00:00:00 (Sun)
18000,
0,
'SVET',
],
[
62585290800, # utc_start 1984-03-31 19:00:00 (Sat)
62601022800, # utc_end 1984-09-29 21:00:00 (Sat)
62585312400, # local_start 1984-04-01 01:00:00 (Sun)
62601044400, # local_end 1984-09-30 03:00:00 (Sun)
21600,
1,
'SVEST',
],
[
62601022800, # utc_start 1984-09-29 21:00:00 (Sat)
62616747600, # utc_end 1985-03-30 21:00:00 (Sat)
62601040800, # local_start 1984-09-30 02:00:00 (Sun)
62616765600, # local_end 1985-03-31 02:00:00 (Sun)
18000,
0,
'SVET',
],
[
62616747600, # utc_start 1985-03-30 21:00:00 (Sat)
62632472400, # utc_end 1985-09-28 21:00:00 (Sat)
62616769200, # local_start 1985-03-31 03:00:00 (Sun)
62632494000, # local_end 1985-09-29 03:00:00 (Sun)
21600,
1,
'SVEST',
],
[
62632472400, # utc_start 1985-09-28 21:00:00 (Sat)
62648197200, # utc_end 1986-03-29 21:00:00 (Sat)
62632490400, # local_start 1985-09-29 02:00:00 (Sun)
62648215200, # local_end 1986-03-30 02:00:00 (Sun)
18000,
0,
'SVET',
],
[
62648197200, # utc_start 1986-03-29 21:00:00 (Sat)
62663922000, # utc_end 1986-09-27 21:00:00 (Sat)
62648218800, # local_start 1986-03-30 03:00:00 (Sun)
62663943600, # local_end 1986-09-28 03:00:00 (Sun)
21600,
1,
'SVEST',
],
[
62663922000, # utc_start 1986-09-27 21:00:00 (Sat)
62679646800, # utc_end 1987-03-28 21:00:00 (Sat)
62663940000, # local_start 1986-09-28 02:00:00 (Sun)
62679664800, # local_end 1987-03-29 02:00:00 (Sun)
18000,
0,
'SVET',
],
[
62679646800, # utc_start 1987-03-28 21:00:00 (Sat)
62695371600, # utc_end 1987-09-26 21:00:00 (Sat)
62679668400, # local_start 1987-03-29 03:00:00 (Sun)
62695393200, # local_end 1987-09-27 03:00:00 (Sun)
21600,
1,
'SVEST',
],
[
62695371600, # utc_start 1987-09-26 21:00:00 (Sat)
62711096400, # utc_end 1988-03-26 21:00:00 (Sat)
62695389600, # local_start 1987-09-27 02:00:00 (Sun)
62711114400, # local_end 1988-03-27 02:00:00 (Sun)
18000,
0,
'SVET',
],
[
62711096400, # utc_start 1988-03-26 21:00:00 (Sat)
62726821200, # utc_end 1988-09-24 21:00:00 (Sat)
62711118000, # local_start 1988-03-27 03:00:00 (Sun)
62726842800, # local_end 1988-09-25 03:00:00 (Sun)
21600,
1,
'SVEST',
],
[
62726821200, # utc_start 1988-09-24 21:00:00 (Sat)
62742546000, # utc_end 1989-03-25 21:00:00 (Sat)
62726839200, # local_start 1988-09-25 02:00:00 (Sun)
62742564000, # local_end 1989-03-26 02:00:00 (Sun)
18000,
0,
'SVET',
],
[
62742546000, # utc_start 1989-03-25 21:00:00 (Sat)
62758270800, # utc_end 1989-09-23 21:00:00 (Sat)
62742567600, # local_start 1989-03-26 03:00:00 (Sun)
62758292400, # local_end 1989-09-24 03:00:00 (Sun)
21600,
1,
'SVEST',
],
[
62758270800, # utc_start 1989-09-23 21:00:00 (Sat)
62773995600, # utc_end 1990-03-24 21:00:00 (Sat)
62758288800, # local_start 1989-09-24 02:00:00 (Sun)
62774013600, # local_end 1990-03-25 02:00:00 (Sun)
18000,
0,
'SVET',
],
[
62773995600, # utc_start 1990-03-24 21:00:00 (Sat)
62790325200, # utc_end 1990-09-29 21:00:00 (Sat)
62774017200, # local_start 1990-03-25 03:00:00 (Sun)
62790346800, # local_end 1990-09-30 03:00:00 (Sun)
21600,
1,
'SVEST',
],
[
62790325200, # utc_start 1990-09-29 21:00:00 (Sat)
62806050000, # utc_end 1991-03-30 21:00:00 (Sat)
62790343200, # local_start 1990-09-30 02:00:00 (Sun)
62806068000, # local_end 1991-03-31 02:00:00 (Sun)
18000,
0,
'SVET',
],
[
62806050000, # utc_start 1991-03-30 21:00:00 (Sat)
62821778400, # utc_end 1991-09-28 22:00:00 (Sat)
62806068000, # local_start 1991-03-31 02:00:00 (Sun)
62821796400, # local_end 1991-09-29 03:00:00 (Sun)
18000,
1,
'SVEST',
],
[
62821778400, # utc_start 1991-09-28 22:00:00 (Sat)
62831455200, # utc_end 1992-01-18 22:00:00 (Sat)
62821792800, # local_start 1991-09-29 02:00:00 (Sun)
62831469600, # local_end 1992-01-19 02:00:00 (Sun)
14400,
0,
'SVET',
],
[
62831455200, # utc_start 1992-01-18 22:00:00 (Sat)
62837488800, # utc_end 1992-03-28 18:00:00 (Sat)
62831473200, # local_start 1992-01-19 03:00:00 (Sun)
62837506800, # local_end 1992-03-28 23:00:00 (Sat)
18000,
0,
'YEKT',
],
[
62837488800, # utc_start 1992-03-28 18:00:00 (Sat)
62853210000, # utc_end 1992-09-26 17:00:00 (Sat)
62837510400, # local_start 1992-03-29 00:00:00 (Sun)
62853231600, # local_end 1992-09-26 23:00:00 (Sat)
21600,
1,
'YEKST',
],
[
62853210000, # utc_start 1992-09-26 17:00:00 (Sat)
62868949200, # utc_end 1993-03-27 21:00:00 (Sat)
62853228000, # local_start 1992-09-26 22:00:00 (Sat)
62868967200, # local_end 1993-03-28 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
62868949200, # utc_start 1993-03-27 21:00:00 (Sat)
62884674000, # utc_end 1993-09-25 21:00:00 (Sat)
62868970800, # local_start 1993-03-28 03:00:00 (Sun)
62884695600, # local_end 1993-09-26 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
62884674000, # utc_start 1993-09-25 21:00:00 (Sat)
62900398800, # utc_end 1994-03-26 21:00:00 (Sat)
62884692000, # local_start 1993-09-26 02:00:00 (Sun)
62900416800, # local_end 1994-03-27 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
62900398800, # utc_start 1994-03-26 21:00:00 (Sat)
62916123600, # utc_end 1994-09-24 21:00:00 (Sat)
62900420400, # local_start 1994-03-27 03:00:00 (Sun)
62916145200, # local_end 1994-09-25 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
62916123600, # utc_start 1994-09-24 21:00:00 (Sat)
62931848400, # utc_end 1995-03-25 21:00:00 (Sat)
62916141600, # local_start 1994-09-25 02:00:00 (Sun)
62931866400, # local_end 1995-03-26 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
62931848400, # utc_start 1995-03-25 21:00:00 (Sat)
62947573200, # utc_end 1995-09-23 21:00:00 (Sat)
62931870000, # local_start 1995-03-26 03:00:00 (Sun)
62947594800, # local_end 1995-09-24 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
62947573200, # utc_start 1995-09-23 21:00:00 (Sat)
62963902800, # utc_end 1996-03-30 21:00:00 (Sat)
62947591200, # local_start 1995-09-24 02:00:00 (Sun)
62963920800, # local_end 1996-03-31 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
62963902800, # utc_start 1996-03-30 21:00:00 (Sat)
62982046800, # utc_end 1996-10-26 21:00:00 (Sat)
62963924400, # local_start 1996-03-31 03:00:00 (Sun)
62982068400, # local_end 1996-10-27 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
62982046800, # utc_start 1996-10-26 21:00:00 (Sat)
62995352400, # utc_end 1997-03-29 21:00:00 (Sat)
62982064800, # local_start 1996-10-27 02:00:00 (Sun)
62995370400, # local_end 1997-03-30 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
62995352400, # utc_start 1997-03-29 21:00:00 (Sat)
63013496400, # utc_end 1997-10-25 21:00:00 (Sat)
62995374000, # local_start 1997-03-30 03:00:00 (Sun)
63013518000, # local_end 1997-10-26 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
63013496400, # utc_start 1997-10-25 21:00:00 (Sat)
63026802000, # utc_end 1998-03-28 21:00:00 (Sat)
63013514400, # local_start 1997-10-26 02:00:00 (Sun)
63026820000, # local_end 1998-03-29 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
63026802000, # utc_start 1998-03-28 21:00:00 (Sat)
63044946000, # utc_end 1998-10-24 21:00:00 (Sat)
63026823600, # local_start 1998-03-29 03:00:00 (Sun)
63044967600, # local_end 1998-10-25 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
63044946000, # utc_start 1998-10-24 21:00:00 (Sat)
63058251600, # utc_end 1999-03-27 21:00:00 (Sat)
63044964000, # local_start 1998-10-25 02:00:00 (Sun)
63058269600, # local_end 1999-03-28 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
63058251600, # utc_start 1999-03-27 21:00:00 (Sat)
63077000400, # utc_end 1999-10-30 21:00:00 (Sat)
63058273200, # local_start 1999-03-28 03:00:00 (Sun)
63077022000, # local_end 1999-10-31 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
63077000400, # utc_start 1999-10-30 21:00:00 (Sat)
63089701200, # utc_end 2000-03-25 21:00:00 (Sat)
63077018400, # local_start 1999-10-31 02:00:00 (Sun)
63089719200, # local_end 2000-03-26 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
63089701200, # utc_start 2000-03-25 21:00:00 (Sat)
63108450000, # utc_end 2000-10-28 21:00:00 (Sat)
63089722800, # local_start 2000-03-26 03:00:00 (Sun)
63108471600, # local_end 2000-10-29 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
63108450000, # utc_start 2000-10-28 21:00:00 (Sat)
63121150800, # utc_end 2001-03-24 21:00:00 (Sat)
63108468000, # local_start 2000-10-29 02:00:00 (Sun)
63121168800, # local_end 2001-03-25 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
63121150800, # utc_start 2001-03-24 21:00:00 (Sat)
63139899600, # utc_end 2001-10-27 21:00:00 (Sat)
63121172400, # local_start 2001-03-25 03:00:00 (Sun)
63139921200, # local_end 2001-10-28 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
63139899600, # utc_start 2001-10-27 21:00:00 (Sat)
63153205200, # utc_end 2002-03-30 21:00:00 (Sat)
63139917600, # local_start 2001-10-28 02:00:00 (Sun)
63153223200, # local_end 2002-03-31 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
63153205200, # utc_start 2002-03-30 21:00:00 (Sat)
63171349200, # utc_end 2002-10-26 21:00:00 (Sat)
63153226800, # local_start 2002-03-31 03:00:00 (Sun)
63171370800, # local_end 2002-10-27 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
63171349200, # utc_start 2002-10-26 21:00:00 (Sat)
63184654800, # utc_end 2003-03-29 21:00:00 (Sat)
63171367200, # local_start 2002-10-27 02:00:00 (Sun)
63184672800, # local_end 2003-03-30 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
63184654800, # utc_start 2003-03-29 21:00:00 (Sat)
63202798800, # utc_end 2003-10-25 21:00:00 (Sat)
63184676400, # local_start 2003-03-30 03:00:00 (Sun)
63202820400, # local_end 2003-10-26 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
63202798800, # utc_start 2003-10-25 21:00:00 (Sat)
63216104400, # utc_end 2004-03-27 21:00:00 (Sat)
63202816800, # local_start 2003-10-26 02:00:00 (Sun)
63216122400, # local_end 2004-03-28 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
63216104400, # utc_start 2004-03-27 21:00:00 (Sat)
63234853200, # utc_end 2004-10-30 21:00:00 (Sat)
63216126000, # local_start 2004-03-28 03:00:00 (Sun)
63234874800, # local_end 2004-10-31 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
63234853200, # utc_start 2004-10-30 21:00:00 (Sat)
63247554000, # utc_end 2005-03-26 21:00:00 (Sat)
63234871200, # local_start 2004-10-31 02:00:00 (Sun)
63247572000, # local_end 2005-03-27 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
63247554000, # utc_start 2005-03-26 21:00:00 (Sat)
63266302800, # utc_end 2005-10-29 21:00:00 (Sat)
63247575600, # local_start 2005-03-27 03:00:00 (Sun)
63266324400, # local_end 2005-10-30 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
63266302800, # utc_start 2005-10-29 21:00:00 (Sat)
63279003600, # utc_end 2006-03-25 21:00:00 (Sat)
63266320800, # local_start 2005-10-30 02:00:00 (Sun)
63279021600, # local_end 2006-03-26 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
63279003600, # utc_start 2006-03-25 21:00:00 (Sat)
63297752400, # utc_end 2006-10-28 21:00:00 (Sat)
63279025200, # local_start 2006-03-26 03:00:00 (Sun)
63297774000, # local_end 2006-10-29 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
63297752400, # utc_start 2006-10-28 21:00:00 (Sat)
63310453200, # utc_end 2007-03-24 21:00:00 (Sat)
63297770400, # local_start 2006-10-29 02:00:00 (Sun)
63310471200, # local_end 2007-03-25 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
63310453200, # utc_start 2007-03-24 21:00:00 (Sat)
63329202000, # utc_end 2007-10-27 21:00:00 (Sat)
63310474800, # local_start 2007-03-25 03:00:00 (Sun)
63329223600, # local_end 2007-10-28 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
63329202000, # utc_start 2007-10-27 21:00:00 (Sat)
63342507600, # utc_end 2008-03-29 21:00:00 (Sat)
63329220000, # local_start 2007-10-28 02:00:00 (Sun)
63342525600, # local_end 2008-03-30 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
63342507600, # utc_start 2008-03-29 21:00:00 (Sat)
63360651600, # utc_end 2008-10-25 21:00:00 (Sat)
63342529200, # local_start 2008-03-30 03:00:00 (Sun)
63360673200, # local_end 2008-10-26 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
63360651600, # utc_start 2008-10-25 21:00:00 (Sat)
63373957200, # utc_end 2009-03-28 21:00:00 (Sat)
63360669600, # local_start 2008-10-26 02:00:00 (Sun)
63373975200, # local_end 2009-03-29 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
63373957200, # utc_start 2009-03-28 21:00:00 (Sat)
63392101200, # utc_end 2009-10-24 21:00:00 (Sat)
63373978800, # local_start 2009-03-29 03:00:00 (Sun)
63392122800, # local_end 2009-10-25 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
63392101200, # utc_start 2009-10-24 21:00:00 (Sat)
63405406800, # utc_end 2010-03-27 21:00:00 (Sat)
63392119200, # local_start 2009-10-25 02:00:00 (Sun)
63405424800, # local_end 2010-03-28 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
63405406800, # utc_start 2010-03-27 21:00:00 (Sat)
63424155600, # utc_end 2010-10-30 21:00:00 (Sat)
63405428400, # local_start 2010-03-28 03:00:00 (Sun)
63424177200, # local_end 2010-10-31 03:00:00 (Sun)
21600,
1,
'YEKST',
],
[
63424155600, # utc_start 2010-10-30 21:00:00 (Sat)
63436856400, # utc_end 2011-03-26 21:00:00 (Sat)
63424173600, # local_start 2010-10-31 02:00:00 (Sun)
63436874400, # local_end 2011-03-27 02:00:00 (Sun)
18000,
0,
'YEKT',
],
[
63436856400, # utc_start 2011-03-26 21:00:00 (Sat)
63549950400, # utc_end 2014-10-25 20:00:00 (Sat)
63436878000, # local_start 2011-03-27 03:00:00 (Sun)
63549972000, # local_end 2014-10-26 02:00:00 (Sun)
21600,
0,
'YEKT',
],
[
63549950400, # utc_start 2014-10-25 20:00:00 (Sat)
DateTime::TimeZone::INFINITY, # utc_end
63549968400, # local_start 2014-10-26 01:00:00 (Sun)
DateTime::TimeZone::INFINITY, # local_end
18000,
0,
'YEKT',
],
];
sub olson_version { '2014g' }
sub has_dst_changes { 30 }
sub _max_year { 2024 }
sub _new_instance
{
return shift->_init( @_, spans => $spans );
}
1;
| 26.990654 | 93 | 0.644391 |
73fa5749f92a6ffdf9456903ee57fe626e96527f | 3,313 | pm | Perl | modules/Bio/EnsEMBL/Hive/Examples/FailureTest/PipeConfig/MemlimitTest_conf.pm | ens-bwalts/ensembl-hive | 9f5f2ab71f506f68233d06c704c2ca23d80ef1f6 | [
"Apache-2.0"
]
| 45 | 2015-01-14T14:12:42.000Z | 2021-11-04T19:19:53.000Z | modules/Bio/EnsEMBL/Hive/Examples/FailureTest/PipeConfig/MemlimitTest_conf.pm | ens-bwalts/ensembl-hive | 9f5f2ab71f506f68233d06c704c2ca23d80ef1f6 | [
"Apache-2.0"
]
| 174 | 2015-01-08T16:47:17.000Z | 2022-03-01T10:09:31.000Z | modules/Bio/EnsEMBL/Hive/Examples/FailureTest/PipeConfig/MemlimitTest_conf.pm | ens-bwalts/ensembl-hive | 9f5f2ab71f506f68233d06c704c2ca23d80ef1f6 | [
"Apache-2.0"
]
| 37 | 2015-03-27T10:08:01.000Z | 2022-03-21T12:54:51.000Z | =pod
=head1 NAME
Bio::EnsEMBL::Hive::Examples::FailureTest::PipeConfig::MemlimitTest_conf
=head1 SYNOPSIS
init_pipeline.pl Bio::EnsEMBL::Hive::Examples::FailureTest::PipeConfig::MemlimitTest_conf -password <your_password>
=head1 DESCRIPTION
This is another example pipeline built around FailureTest.pm RunnableDB. It consists of two analyses:
Analysis_1: JobFactory.pm is used to create an array of jobs -
these jobs are sent down the branch #2 into the second analysis
Analysis_2: FailureTest.pm in "memory grab" mode may overrun the current resource's memory limit and be killed by the LSF
=head1 LICENSE
Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
Copyright [2016-2021] EMBL-European Bioinformatics Institute
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License.
=head1 CONTACT
Please subscribe to the Hive mailing list: http://listserver.ebi.ac.uk/mailman/listinfo/ehive-users to discuss Hive-related questions or to be notified of our updates
=cut
package Bio::EnsEMBL::Hive::Examples::FailureTest::PipeConfig::MemlimitTest_conf;
use strict;
use warnings;
use base ('Bio::EnsEMBL::Hive::PipeConfig::HiveGeneric_conf'); # All Hive databases configuration files should inherit from HiveGeneric, directly or indirectly
sub resource_classes {
my ($self) = @_;
return {
%{$self->SUPER::resource_classes}, # inherit 'default' from the parent class
'default' => {'LSF' => '-C0 -M100 -R"select[mem>100] rusage[mem=100]"' }, # to make sure it fails similarly on both farms
'200Mb_job' => {'LSF' => '-C0 -M200 -R"select[mem>200] rusage[mem=200]"' },
'400Mb_job' => {'LSF' => '-C0 -M400 -R"select[mem>400] rusage[mem=400]"' },
'1Gb_job' => {'LSF' => '-C0 -M1000 -R"select[mem>1000] rusage[mem=1000]"' },
};
}
sub pipeline_analyses {
my ($self) = @_;
return [
{ -logic_name => 'generate_jobs',
-module => 'Bio::EnsEMBL::Hive::RunnableDB::JobFactory',
-meadow_type => 'LOCAL',
-parameters => {
'column_names' => [ 'grab_mln' ],
},
-input_ids => [
{ 'inputlist' => [ 0.6 , 0.8 , 1.0 , 1.2 , 1.4 , 1.6 , 1.8 , 2.0, 2.5, 3.0, 5.0, 7.0, 10 ], },
],
-flow_into => {
2 => [ 'failure_test' ],
},
},
{ -logic_name => 'failure_test',
-module => 'Bio::EnsEMBL::Hive::Examples::FailureTest::RunnableDB::FailureTest',
-parameters => {
'time_RUN' => 30,
},
-rc_name => 'default', # pick a valid value from resource_classes() section
},
];
}
1;
| 35.623656 | 172 | 0.626924 |
ed5663b9b661849058d09edf06264c84d6bf3e76 | 1,754 | pl | Perl | algt_tests/pl/dicom_iod.pl | dg1an3/ALGT | 1ab895aa56b89c261b04ef636459ccfb2a7b2285 | [
"BSD-2-Clause"
]
| 7 | 2017-10-17T14:46:32.000Z | 2020-12-29T20:20:04.000Z | algt_tests/pl/dicom_iod.pl | dg1an3/ALGT | 1ab895aa56b89c261b04ef636459ccfb2a7b2285 | [
"BSD-2-Clause"
]
| 2 | 2015-08-30T16:06:36.000Z | 2015-08-30T16:08:50.000Z | algt_tests/pl/dicom_iod.pl | dg1an3/ALGT | 1ab895aa56b89c261b04ef636459ccfb2a7b2285 | [
"BSD-2-Clause"
]
| 2 | 2019-03-07T16:37:13.000Z | 2019-03-28T00:51:49.000Z |
dcm_iod_module('CT Image', 'Patient', mandatory).
dcm_iod_module('CT Image', 'General Study', mandatory).
dcm_iod_module('RT Plan', 'Patient', mandatory).
dcm_module_attr('Patient', 'Patient ID', type1).
dcm_module_attr('Patient', 'Patient Name', type1).
dcm_module_attr('Patient', 'Patient DOB', type2).
dcm_module_attr('Patient', 'Patient Gender', type2).
dcm_module_attr('General Image', 'Slice Number', type2c(dcm_slice_number_ok)).
dcm_slice_number_ok([dcm_attr('Slice Number', SliceNumber), Image | _]) :-
dcm_attr_find(Image, dcm_attr('Slice Location', _, SliceLocation)),
SliceNumber = SliceLocation.
dcm_ok(Instance) :-
dcm_iod(IOD),
forall(dcm_iod_module(IOD, Module),
(
%%
%% check type 1 attribute
dcm_module_attr(Module, Attr, type1),
dcm_attr_find(dcm_attr(Attr, Content), Instance),
not(dcm_null(Content)))
;
%%
%% check type 1c attribute
dcm_module_attr(Module, Attr, type1c(CondPred)),
(
%% check the condition
Cond =.. [CondPred, [Instance | _]],
Cond,
dcm_attr_find(dcm_attr(Attr, Content)),
not(dcm_null(Content)) ;
%% condition fails, check attribute not present
not(dcm_attr_find(dcm_attr(Attr, _)))
)
;
%%
%% check type 2 attribute
dcm_module_attr(Module, Attr, type2),
dcm_attr_find(dcm_attr(Attr, Content), Instance)
;
%%
%% check type 2c attribute
dcm_module_attr(Module, Attr, type2c(CondPred)),
%% check the condition
Cond =.. [CondPred, [Instance | _]],
Cond,
dcm_attr_find(dcm_attr(Attr, Content))
),
once.
| 26.984615 | 78 | 0.607184 |
ed2ddbe16ad414267181e06dcd4c41fa770c3704 | 4,869 | al | Perl | Apps/W1/AMCBanking365Fundamentals/app/Tables/AMCBankingSetup.Table.al | bjarkihall/ALAppExtensions | d8243d27e0280dec6e079ab9f1e838f9768c208c | [
"MIT"
]
| 1 | 2021-08-16T18:14:49.000Z | 2021-08-16T18:14:49.000Z | Apps/W1/AMCBanking365Fundamentals/app/Tables/AMCBankingSetup.Table.al | bjarkihall/ALAppExtensions | d8243d27e0280dec6e079ab9f1e838f9768c208c | [
"MIT"
]
| null | null | null | Apps/W1/AMCBanking365Fundamentals/app/Tables/AMCBankingSetup.Table.al | bjarkihall/ALAppExtensions | d8243d27e0280dec6e079ab9f1e838f9768c208c | [
"MIT"
]
| 1 | 2021-02-09T10:23:09.000Z | 2021-02-09T10:23:09.000Z | table 20101 "AMC Banking Setup"
{
Caption = 'AMC Banking Setup';
fields
{
field(20100; "Primary Key"; Code[10])
{
Caption = 'Primary Key';
DataClassification = CustomerContent;
}
field(20101; "User Name"; Text[50])
{
Caption = 'User Name';
DataClassification = EndUserIdentifiableInformation;
Editable = true;
}
field(20102; "Password Key"; Guid)
{
Caption = 'Password Key';
DataClassification = EndUserIdentifiableInformation;
}
field(20103; "Sign-up URL"; Text[250])
{
Caption = 'Sign-up URL';
ExtendedDatatype = URL;
DataClassification = CustomerContent;
}
field(20104; "Service URL"; Text[250])
{
Caption = 'Service URL';
DataClassification = CustomerContent;
trigger OnValidate()
var
WebRequestHelper: Codeunit "Web Request Helper";
begin
if "Service URL" <> '' then
WebRequestHelper.IsSecureHttpUrl("Service URL");
end;
}
field(20105; "Support URL"; Text[250])
{
Caption = 'Support URL';
ExtendedDatatype = URL;
DataClassification = CustomerContent;
}
field(20106; "Namespace API Version"; Text[10])
{
Caption = 'Namespace API Version';
DataClassification = CustomerContent;
}
field(20107; "Solution"; Text[50])
{
Caption = 'Solution';
DataClassification = CustomerContent;
}
}
keys
{
key(Key1; "Primary Key")
{
Clustered = true;
}
}
fieldgroups
{
}
trigger OnDelete()
begin
DeletePassword();
end;
trigger OnInsert()
var
AMCBankServMgt: Codeunit "AMC Banking Mgt.";
begin
if "User Name" = '' then begin
"User Name" := GetUserName(); // Set username to demo user, if new record for user to try the funtionality
if "User Name" <> '' then
SavePassword(GetPassword()); // Set Password to demo password, if new record for user to try the funtionality
if "User Name" = GetDemoUserName() then
Solution := AMCBankServMgt.GetDemoSolutionCode();
end;
AMCBankServMgt.InitDefaultURLs(Rec);
end;
var
DemoUserNameTxt: Label 'demouser', Locked = true;
DemoPasswordTxt: Label 'DemoPassword', Locked = true;
internal procedure SavePassword(PasswordText: Text)
begin
if IsNullGuid("Password Key") then
"Password Key" := CreateGuid();
if (PasswordText <> '') then begin
if not EncryptionEnabled() then
IsolatedStorage.Set(CopyStr("Password Key", 1, 200), PasswordText, Datascope::Company)
else
IsolatedStorage.SetEncrypted(CopyStr("Password Key", 1, 200), PasswordText, Datascope::Company);
end
else
if HasPassword() then
DeletePassword();
end;
internal procedure GetUserName(): Text[50]
var
ServiceUserName: Text[50];
begin
if ("User Name" = '') then
exit(GetDemoUserName());
ServiceUserName := "User Name";
OnGetUserName(ServiceUserName);
exit(ServiceUserName);
end;
internal procedure GetPassword(): Text
var
Value: Text;
begin
if ("User Name" = GetDemoUserName()) then
exit(GetDemoPass());
IsolatedStorage.Get(CopyStr("Password Key", 1, 200), Datascope::Company, Value);
exit(Value);
end;
internal procedure DeletePassword()
begin
if IsolatedStorage.Contains(CopyStr("Password Key", 1, 200), Datascope::Company) then
IsolatedStorage.Delete(CopyStr("Password Key", 1, 200), DataScope::Company);
end;
procedure HasUserName(): Boolean
begin
exit("User Name" <> '');
end;
internal procedure HasPassword(): Boolean
begin
if ("User Name" = GetDemoUserName()) then
exit(true);
exit(IsolatedStorage.Contains(CopyStr("Password Key", 1, 200), Datascope::Company));
end;
procedure SetURLsToDefault()
var
AMCBankServMgt: Codeunit "AMC Banking Mgt.";
begin
AMCBankServMgt.SetURLsToDefault(Rec);
end;
procedure GetDemoUserName(): Text[50]
var
begin
exit(CopyStr(DemoUserNameTxt, 1, 50));
end;
local procedure GetDemoPass(): Text
var
begin
exit(DemoPasswordTxt);
end;
[IntegrationEvent(false, false)]
procedure OnGetUserName(var UserName: Text[50])
begin
end;
}
| 27.201117 | 125 | 0.562744 |
ed59243517028fc3c49e61541757e40500f4e1b6 | 300 | t | Perl | t/02compile.t | TheOpenRepository/Algorithm-Diff-Any | 953ac1d3ac8c8926f8a2b7a55ce4ba934b968353 | [
"Artistic-2.0"
]
| 1 | 2020-01-21T11:36:22.000Z | 2020-01-21T11:36:22.000Z | t/02compile.t | TheOpenRepository/Algorithm-Diff-Any | 953ac1d3ac8c8926f8a2b7a55ce4ba934b968353 | [
"Artistic-2.0"
]
| null | null | null | t/02compile.t | TheOpenRepository/Algorithm-Diff-Any | 953ac1d3ac8c8926f8a2b7a55ce4ba934b968353 | [
"Artistic-2.0"
]
| null | null | null | #!/usr/bin/perl
# t/02compile.t
# Check that the module can be compiled and loaded properly.
#
# $Id$
use strict;
use warnings;
use Test::More tests => 3;
use Test::NoWarnings; # 1 test
# Check that we can load the module
BEGIN {
use_ok('Algorithm::Diff');
use_ok('Algorithm::Diff::Any');
}
| 15.789474 | 61 | 0.676667 |
73f3f8bfc309af896353268f74fc13e8dd01de9c | 2,536 | pl | Perl | remote.pl | E-Mulas/WittyJsCAD | b527c1a0c8f2fae06df96569642781486a830166 | [
"MIT"
]
| 1 | 2021-02-13T11:05:45.000Z | 2021-02-13T11:05:45.000Z | remote.pl | E-Mulas/WittyJsCAD | b527c1a0c8f2fae06df96569642781486a830166 | [
"MIT"
]
| 5 | 2020-09-08T03:23:51.000Z | 2022-02-26T09:55:04.000Z | remote.pl | E-Mulas/WittyJsCAD | b527c1a0c8f2fae06df96569642781486a830166 | [
"MIT"
]
| 1 | 2021-04-18T20:05:40.000Z | 2021-04-18T20:05:40.000Z | #!/usr/bin/perl
# -- Fetch Remote File into Cache, written by Rene K. Mueller <spiritdude@gmail.com>
#
$VERSION = '0.005';
#
# History:
# 2017/09/23: 0.005: fix vulnerability: disallow file://
# 2017/03/20: 0.004: allows insecure ssl connections (invalid/outdated ssl)
# 2013/04/08: 0.003: support of amf
# 2013/03/31: 0.002: checking content, enforcing jscad, scad or stl
# 2013/03/30: 0.001: first version
use CGI;
my $dir = 'cache';
my $q = new CGI;
my $maxSize = 10_000_000; # [bytes], max size of file
my $maxTime = 60; # [s], max download time
cacheLocal($q->param('url'));
opendir(D,$dir);
foreach(readdir(D)) {
next if(/^\./);
if((stat("$dir/$_"))[9]<(time()-24*60*60)) {
unlink("$dir/$_");
}
}
closedir(D);
sub cacheLocal {
my($u) = @_;
return unless($u=~/^https?:\/\//i); # -- must be http:// or https://
my($fn) = ($u=~/\/([^\/]+)$/);
my($local) = time()."-".sprintf("%05d",rand()*10_000);
my($ext) = ($fn=~/\.([^\.]+)$/);
if($ext eq 'jscad'||$ext eq 'scad'||$ext eq 'stl') {
; # -- valid
} else {
$ext = 'jscad';
}
$local = "$dir/$local.$ext";
$fn =~ s/\.\.//g;
$fn =~ s/[\\'"]//g;
$fn =~ s/[^!-~\s]//g; # -- non-ascii away
if(fork()==0) {
exec('curl',
'-k', # -- allow insecure ssl connections (invalid certs)
'-L', # -- follow redirects (e.g. thingiverse.com)
'--max-filesize',$maxSize, # -- max file size
'--max-time',$maxTime, # -- max time of download
'-s',$u, # -- server with URL
'-o',"$local"); # -- save locally
} else {
wait;
}
my $extNew;
my $buff;
open(F,$local);
read(F,$buff,1024);
if($ext eq 'jscad'&&$buff=~/^\/\/!OpenSCAD/i) { # -- content is SCAD?
$extNew = 'scad';
} elsif($ext eq 'jscad'&&($buff=~/^<\?xml/i&&$buff=~/[\n\r]<amf/)) { # -- content is AMF?
$extNew = 'amf';
} elsif($ext eq 'jscad'&&($buff=~/^solid/i||-B $buff||$buff=~/\0/)) { # -- content is STL?
$extNew = 'stl';
}
if($extNew) {
my $new = $local;
$fn =~ s/\.jscad$/.$extNew/; # -- filename
$new =~ s/\.jscad$/.$extNew/; # -- internal cache
rename($local,$new);
$local = $new;
}
close(F);
$u =~ s/(["\\])/\\$1/g;
print "Content-type: text/plain\n\n";
print "{ \"filename\": \"$fn\", \"file\": \"$local\", \"url\": \"$u\" }\n";
}
| 27.868132 | 95 | 0.46806 |
ed12ed986e867f7c7150273f42a18f9c220ed437 | 1,258 | pl | Perl | main/lilys-homework/lilys-homework.pl | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
]
| null | null | null | main/lilys-homework/lilys-homework.pl | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
]
| null | null | null | main/lilys-homework/lilys-homework.pl | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
]
| null | null | null | #!/usr/bin/env perl
use strict;
use warnings;
use feature qw(say);
use List::Util qw(min);
use constant VISITED => -1;
sub normalize_to_permutation {
my ($values) = @_;
my @permutation = sort { $values->[$a] <=> $values->[$b] }
(0..$#{$values});
return @permutation;
}
# Traverses the cycle of the permutation that begins at the index start,
# marking each element visited and returning the number of positions traversed
# (always at least 1).
sub traverse_and_mark_cycle {
my ($permutation, $start) = @_;
my $i = $start;
my $cycle_length = 1;
while (1) {
# advance to the next value in the cycle
($permutation->[$i], $i) = (VISITED, $permutation->[$i]);
if ($i == $start) { return $cycle_length }
++$cycle_length;
}
}
sub compute_min_swaps {
my ($values) = @_;
my @permutation = normalize_to_permutation $values;
my $swaps = 0;
for my $i (0..$#permutation) {
if ($permutation[$i] != VISITED) {
$swaps += traverse_and_mark_cycle(\@permutation, $i) - 1;
}
}
return $swaps;
}
<>; # don't need n
my @values = split /\s+/msx, <>;
say min(compute_min_swaps(\@values), compute_min_swaps([reverse @values]));
| 23.296296 | 78 | 0.59062 |
ed43d2bc19023884b93ee7d6e81724cf50e8f84a | 20,383 | pm | Perl | iXhash.pm | mailbaby/spamassassin-rules | 467ed99bc5292fb77a9884cebe17fb727e05401c | [
"Apache-2.0"
]
| 3 | 2020-11-23T16:29:37.000Z | 2022-02-11T12:45:26.000Z | iXhash.pm | mailbaby/spamassassin-rules | 467ed99bc5292fb77a9884cebe17fb727e05401c | [
"Apache-2.0"
]
| null | null | null | iXhash.pm | mailbaby/spamassassin-rules | 467ed99bc5292fb77a9884cebe17fb727e05401c | [
"Apache-2.0"
]
| null | null | null | =head1 NAME
Mail::SpamAssassin::Plugin::iXhash - compute fuzzy checksums from mail bodies and compare to known spam ones via DNS
=head1 SYNOPSIS
loadplugin Mail::SpamAssassin::Plugin::iXhash /path/to/iXhash.pm
# Timeout in seconds - default is 10 seconds
ixhash_timeout 10
# Should we add the hashes to the messages' metadata for later re-use
# Default is not to cache hashes (i.e. re-compute them for every check)
use_ixhash_cache 0
# wether to only use perl (ixhash_pureperl = 1) or the system's 'tr' and 'md5sum'
# Default is to use Perl only
ixhash_pureperl 1
# If you should have 'tr' and/or 'md5sum' in some weird place (e.g on a Windows server)
# or you want to specify which version to use you can specifiy the exact paths here
# Default is to have SpamAssassin find the executables
ixhash_tr_path "/usr/bin/tr"
ixhash_md5sum_path "/usr/bin/md5sum"
# The actual rule
body IXHASH eval:ixhashtest('ix.dnsbl.manitu.net')
describe IXHASH This mail has been classified as spam @ iX Magazine, Germany
tflags IXHASH net
score IXHASH 1.5
=head1 DESCRIPTION
iXhash.pm is a plugin for SpamAssassin 3.0.0 and up. It takes the body of a mail, strips parts from it and then computes a hash value
from the rest. These values will then be looked up via DNS to see if the hashes have already been categorized as spam by others.
This plugin is based on parts of the procmail-based project 'NiX Spam', developed by Bert Ungerer.(un@ix.de)
For more information see http://www.heise.de/ix/nixspam/. The procmail code producing the hashes only can be found here:
ftp://ftp.ix.de/pub/ix/ix_listings/2004/05/checksums
To see which DNS zones are currently available see http://www.ixhash.net
=cut
package Mail::SpamAssassin::Plugin::iXhash;
use strict;
use Mail::SpamAssassin::Plugin;
use Mail::SpamAssassin::Logger;
use Mail::SpamAssassin::Timeout;
use Digest::MD5 qw(md5 md5_hex md5_base64);
use Net::DNS;
use vars qw(@ISA);
@ISA = qw(Mail::SpamAssassin::Plugin);
my $VERSION = "1.5.5";
sub new {
my ($class, $mailsa, $server) = @_;
$class = ref($class) || $class;
my $self = $class->SUPER::new($mailsa);
bless ($self, $class);
# Are network tests enabled?
if ($mailsa->{local_tests_only}) {
dbg("IXHASH: local tests only, not using iXhash plugin");
$self->{iXhash_available} = 0;
}
else {
dbg("IXHASH: Using iXhash plugin $VERSION");
$self->{iXhash_available} = 1;
}
$self->set_config($mailsa->{conf});
$self->register_eval_rule ("ixhashtest");
return $self;
}
sub set_config {
my ($self, $conf) = @_;
my @cmds = ();
# implements iXhash_timeout config option - by dallase@uribl.com
push(@cmds, {
setting => 'ixhash_timeout',
default => 10,
type => $Mail::SpamAssassin::Conf::CONF_TYPE_NUMERIC,
}
);
push(@cmds, {
setting => 'use_ixhash_cache',
default => 0,
type => $Mail::SpamAssassin::Conf::CONF_TYPE_NUMERIC,
}
);
push(@cmds, {
setting => 'ixhash_pureperl',
default => 1,
type => $Mail::SpamAssassin::Conf::CONF_TYPE_NUMERIC,
}
);
push(@cmds, {
setting => 'ixhash_tr_path',
type => $Mail::SpamAssassin::Conf::CONF_TYPE_STRING,
}
);
push(@cmds, {
setting => 'ixhash_md5sum_path',
type => $Mail::SpamAssassin::Conf::CONF_TYPE_STRING,
}
);
$conf->{parser}->register_commands(\@cmds);
}
sub ixhashtest {
my ($self, $permsgstatus,$full,$dnszone) = @_;
dbg("IXHASH: IxHash querying $dnszone");
if ($permsgstatus->{main}->{conf}->{'ixhash_pureperl'} == 0){
# Return subito if we are do not find the tools we need
# Only relevant if we are those tools in the 1st way
return 0 unless $self->is_md5sum_available();
return 0 unless $self->is_tr_available();
}
my ($answer,$ixdigest) = "";
# Changed to use get_pristine_body returning a scalar
my $body = $permsgstatus->{msg}->get_pristine_body();
my $resolver = Net::DNS::Resolver->new;
my $body_copy = "";
my $rr;
my $tmpfile = '';
my $tmpfh = undef;
my $hits = 0;
my $digest = 0;
# alarm the dns query - dallase@uribl.com
# --------------------------------------------------------------------------
# here we implement proper alarms, ala Pyzor, Razor2 plugins.
# keep the alarm as $oldalarm, so we dont loose the timeout-child alarm
# see http://issues.apache.org/SpamAssassin/show_bug.cgi?id=3828#c123
my $oldalarm = 0;
my $timer = Mail::SpamAssassin::Timeout->new({ secs => $permsgstatus->{main}->{conf}->{'ixhash_timeout'}});
my $time_err = $timer->run_and_catch(sub {
# create a temporary file unless we are to use only Perl code and we don't find a hash value in metadata
# If we use the system's 'tr' and 'md5sum' utilities we need this.
if ($permsgstatus->{main}->{conf}->{'ixhash_pureperl'} == 0){
unless ($permsgstatus->{msg}->get_metadata('X-iXhash-hash-1') or $permsgstatus->{msg}->get_metadata('X-iXhash-hash-2') or $permsgstatus->{msg}->get_metadata('X-iXhash-hash-3')) {
($tmpfile, $tmpfh) = Mail::SpamAssassin::Util::secure_tmpfile();
$body_copy = $body;
$body_copy =~ s/\r\n/\n/g;
print $tmpfh $body_copy;
close $tmpfh;
dbg ("IXHASH: Writing body to temporary file $tmpfile");
}
else {
dbg ("IXHASH: Not writing body to temporary file - reusing stored hashes");
}
}
my $digest = compute1sthash($permsgstatus,$body, $tmpfile);
if ($digest){
dbg ("IXHASH: Now checking $digest.$dnszone");
# Now check via DNS query
$answer = $resolver->search($digest.'.'.$dnszone, "A", "IN");
if ($answer) {
foreach $rr ($answer->answer) {
next unless $rr->type eq "A";
dbg ("IXHASH: Received reply from $dnszone:". $rr->address);
$hits = 1 if $rr->address =~ /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
}
}
}
# Only go ahead if $hits ist still 0 - i.e hash #1 didn't score a hit
if ($hits == 0 ){
$digest = compute2ndhash($permsgstatus,$body, $tmpfile);
if ($digest){
dbg ("IXHASH: Now checking $digest.$dnszone");
# Now check via DNS query
$answer = $resolver->search($digest.'.'.$dnszone, "A", "IN");
if ($answer) {
foreach $rr ($answer->answer) {
next unless $rr->type eq "A";
dbg ("IXHASH: Received reply from $dnszone:". $rr->address);
$hits = 1 if $rr->address =~ /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
} # end foreach
} # end if $answer
} # end if $digest
} # end if $hits
if ( $hits == 0 ){
$digest = compute3rdhash($permsgstatus,$body, $tmpfile);
if (length($digest) == 32){
dbg ("IXHASH: Now checking $digest.$dnszone");
# Now check via DNS query
$answer = $resolver->search($digest.'.'.$dnszone, "A", "IN");
if ($answer) {
foreach $rr ($answer->answer) {
next unless $rr->type eq "A";
dbg ("IXHASH: Received reply from $dnszone:". $rr->address);
$hits = 1 if $rr->address =~ /^127\.\d{1,3}\.\d{1,3}\.\d{1,3}/;
} # foreach $answer
} # end if $anser
} # end if $digest
} # end if $hits
} # end of sub{
); # end of timer->run_and_catch
if ($timer->timed_out()) {
dbg("IXHASH: ".$permsgstatus->{main}->{conf}->{'ixhash_timeout'}." second timeout exceeded while checking ".$digest.".".$dnszone."!");
}
elsif ($time_err) {
chomp $time_err;
dbg("IXHASH: iXhash lookup failed: $time_err");
}
unlink $tmpfile;
return $hits;
}
sub compute1sthash {
my ($permsgstatus, $body, $tmpfile) = @_;
my $body_copy = '';
my $digest = '';
# Creation of hash # 1 if following conditions are met:
# - mail contains 20 spaces or tabs or more - changed follwoing a suggestion by Karsten Br▒ckelmann
# - mail consists of at least 2 lines
# This should generate the most hits (according to Bert Ungerer about 70%)
# This also is where you can tweak your plugin if you have problems with short mails FP'ing -
# simply raise that barrier here.
# We'll try to find the required hash in this message's metadata first.
# This might be the case if another zone has been queried already
if (($permsgstatus->{main}->{conf}->{'use_ixhash_cache'} == 1 ) && ($permsgstatus->{msg}->get_metadata('X-iXhash-hash-1'))) {
dbg ("IXHASH: Hash value for method #1 found in metadata, re-using that one");
$digest = $permsgstatus->{msg}->get_metadata('X-iXhash-hash-1');
}
else
{
if (($body =~ /(?>\s.+?){20}/g) || ( $body =~ /\n.*\n/ ) ){
if ($permsgstatus->{main}->{conf}->{'ixhash_pureperl'} == 1 ){
# All space class chars just one time
# Do this in two steps to avoid Perl segfaults
# if there are more than x identical chars to be replaced
# Thanks to Martin Blapp for finding that out and suggesting this workaround concerning spaces only
# Thanks to Karsten Br▒ckelmann for pointing out this would also be the case with _any_ characater, not only spaces
$body_copy = $body;
$body_copy =~ s/\r\n/\n/g;
# Step One
$body_copy =~ s/([[:space:]]{100})(?:\1+)/$1/g;
# Step Two
$body_copy =~ s/([[:space:]])(?:\1+)/$1/g;
# remove graph class chars and some specials
$body_copy =~ s/[[:graph:]]+//go;
# Create actual digest
$digest = md5_hex($body_copy);
dbg ("IXHASH: Computed hash-value ".$digest." via method 1, using perl exclusively");
$permsgstatus->{msg}->put_metadata('X-iXhash-hash-1', $digest) if ($permsgstatus->{main}->{conf}->{'use_ixhash_cache'} == 1) ;
} else {
$digest = `cat $tmpfile | $permsgstatus->{main}->{conf}->{ixhash_tr_path} -s '[:space:]' | $permsgstatus->{main}->{conf}->{ixhash_tr_path} -d '[:graph:]' | $permsgstatus->{main}->{conf}->{ixhash_md5sum_path} | $permsgstatus->{main}->{conf}->{ixhash_tr_path} -d ' -'`;
chop($digest);
dbg ("IXHASH: Computed hash-value ".$digest." via method 1, using system utilities");
$permsgstatus->{msg}->put_metadata('X-iXhash-hash-1', $digest) if ($permsgstatus->{main}->{conf}->{'use_ixhash_cache'} == 1) ;
}
}
else
{
dbg ("IXHASH: Hash value #1 not computed, requirements not met");
}
}
return $digest;
}
sub compute2ndhash{
my ($permsgstatus, $body, $tmpfile) = @_;
my $body_copy = '';
my $digest = '';
# See if this hash has been computed already
if (($permsgstatus->{main}->{conf}->{'use_ixhash_cache'} == 1) && ($permsgstatus->{msg}->get_metadata('X-iXhash-hash-2'))) {
dbg ("IXHASH: Hash value for method #2 found in metadata, re-using that one");
$digest = $permsgstatus->{msg}->get_metadata('X-iXhash-hash-2');
}
else
{
# Creation of hash # 2 if mail contains at least 3 of the following characters:
# '[<>()|@*'!?,]' or the combination of ':/'
# (To match something like "Already seen? http:/host.domain.tld/")
if ($body =~ /((([<>\(\)\|@\*'!?,])|(:\/)).*?){3,}/m ) {
if ($permsgstatus->{main}->{conf}->{'ixhash_pureperl'} == 1 ){
$body_copy = $body;
# remove redundant stuff
$body_copy =~ s/[[:cntrl:][:alnum:]%&#;=]+//g;
# replace '_' with '.'
$body_copy =~ tr/_/./;
# replace duplicate chars. This too suffers from a bug in perl
# so we do it in two steps
# Step One
$body_copy =~ s/([[:print:]]{100})(?:\1+)/$1/g;
# Step Two
$body_copy =~ s/([[:print:]])(?:\1+)/$1/g;
# Computing hash...
$digest = md5_hex($body_copy);
dbg ("IXHASH: Computed hash-value $digest via method 2, using perl exclusively");
$permsgstatus->{msg}->put_metadata('X-iXhash-hash-2', $digest) if ($permsgstatus->{main}->{conf}->{'use_ixhash_cache'} == 1) ;
}
else {
$digest = `cat $tmpfile | $permsgstatus->{main}->{conf}->{ixhash_tr_path} -d '[:cntrl:][:alnum:]%&#;=' | $permsgstatus->{main}->{conf}->{ixhash_tr_path} '_' '.' | $permsgstatus->{main}->{conf}->{ixhash_tr_path} -s '[:print:]' | $permsgstatus->{main}->{conf}->{ixhash_md5sum_path} | $permsgstatus->{main}->{conf}->{ixhash_tr_path} -d ' -'`;
chop($digest);
dbg ("IXHASH: Computed hash-value ".$digest." via method 2, using system utilities");
$permsgstatus->{msg}->put_metadata('X-iXhash-hash-2', $digest) if ($permsgstatus->{main}->{conf}->{'use_ixhash_cache'} == 1) ;
}
}
else
{
dbg ("IXHASH: Hash value #2 not computed, requirements not met");
}
}
return $digest;
}
sub compute3rdhash{
my ($permsgstatus, $body, $tmpfile ) = @_;
my $body_copy = '';
my $digest = '';
# See if this hash has been computed already
if (($permsgstatus->{main}->{conf}->{'use_ixhash_cache'} == 1) && ($permsgstatus->{msg}->get_metadata('X-iXhash-hash-3'))) {
dbg ("IXHASH: Hash value for method #3 found in metadata, re-using that one");
$digest = $permsgstatus->{msg}->get_metadata('X-iXhash-hash-3');
}
else
{
# Compute hash # 3 if
# - there are at least 8 non-space characters in the body and
# - neither hash #1 nor hash #2 have been computed
# (which means $digest is still empty, in any case < 32)
if (($body =~ /[\S]{8}/) && (length($digest) < 32)) {
if ($permsgstatus->{main}->{conf}->{'ixhash_pureperl'} == 1){
$body_copy = $body;
$body_copy =~ s/[[:cntrl:][:space:]=]+//g;
# replace duplicate chars. This too suffers from a bug in perl
# so we do it in two steps
# Step One
$body_copy =~ s/([[:print:]]{100})(?:\1+)/$1/g;
# Step Two
$body_copy =~ s/([[:graph:]])(?:\1+)/$1/g;
# Computing actual hash
$digest = md5_hex($body_copy);
dbg ("IXHASH: Computed hash-value $digest via method 3");
$permsgstatus->{msg}->put_metadata('X-iXhash-hash-3', $digest) if ($permsgstatus->{main}->{conf}->{'use_ixhash_cache'} == 1) ;
}
else {
# shellcode
$digest = `cat $tmpfile | $permsgstatus->{main}->{conf}->{ixhash_tr_path} -d '[:cntrl:][:space:]=' | $permsgstatus->{main}->{conf}->{ixhash_tr_path} -s '[:graph:]' | $permsgstatus->{main}->{conf}->{ixhash_md5sum_path} | $permsgstatus->{main}->{conf}->{ixhash_tr_path} -d ' -'`;
chop($digest);
dbg ("IXHASH: Computed hash-value ".$digest." via method 3, using system utilities");
$permsgstatus->{msg}->put_metadata('X-iXhash-hash-3', $digest) if ($permsgstatus->{main}->{conf}->{'use_ixhash_cache'} == 1) ;
}
}
else
{
dbg ("IXHASH: Hash value #3 not computed, requirements not met");
}
}
return $digest;
}
sub is_tr_available {
# Find out where your 'tr' lives
# shamelessly stolen from the Pyzor plugin code
my ($self) = @_;
my $tr = $self->{main}->{conf}->{ixhash_tr_path} || '';
unless ($tr) {
$tr = Mail::SpamAssassin::Util::find_executable_in_env_path('tr');
}
unless ($tr && -x $tr) {
dbg("IXHASH: tr is not available: no tr executable found");
return 0;
}
# remember any found tr
$self->{main}->{conf}->{ixhash_tr_path} = $tr;
dbg("IXHASH: tr is available: " . $self->{main}->{conf}->{ixhash_tr_path});
return 1;
}
sub is_md5sum_available {
# Find out where your 'md5sum' lives
# again shamelessly stolen from the Pyzor plugin code
my ($self) = @_;
my $md5sum = $self->{main}->{conf}->{ixhash_md5sum_path} || '';
unless ($md5sum) {
$md5sum = Mail::SpamAssassin::Util::find_executable_in_env_path('md5sum');
}
unless ($md5sum && -x $md5sum) {
dbg("IXHASH: md5sum is not available: no md5sum executable found");
return 0;
}
# remember any found md5sum
$self->{main}->{conf}->{ixhash_md5sum_path} = $md5sum;
dbg("IXHASH: md5sum is available: " . $self->{main}->{conf}->{ixhash_md5sum_path});
return 1;
}
| 50.45297 | 380 | 0.473139 |
ed345c6a425f715f83e2fc3756f089cd2f614aa2 | 7,145 | pl | Perl | misc-scripts/xref_mapping/xref_config2sql.pl | dbolser-ebi/ensembl | d60bb4562d2c82637a7befdee5a4ebe6b9795a3d | [
"Apache-2.0"
]
| null | null | null | misc-scripts/xref_mapping/xref_config2sql.pl | dbolser-ebi/ensembl | d60bb4562d2c82637a7befdee5a4ebe6b9795a3d | [
"Apache-2.0"
]
| null | null | null | misc-scripts/xref_mapping/xref_config2sql.pl | dbolser-ebi/ensembl | d60bb4562d2c82637a7befdee5a4ebe6b9795a3d | [
"Apache-2.0"
]
| null | null | null | #!/usr/bin/env perl
# Copyright [1999-2014] 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.
# $Id$
########################################################################
# #
# This script will take the 'xref_config.ini' configuration #
# file (or whatever file name given on the command line) and #
# convert it into a SQL file that can be used in place of the old #
# 'populate_metadata.sql' file found in the 'sql' subdirectory. #
# #
# The output from this script should be redirected to a file that #
# you manually run to populate your Xref database, just as was done #
# with 'populate_metadata.sql'. The safest thing to do is just to #
# overwrite 'sql/populate_metadata.sql' with the output of this #
# script. This will ensure that 'xref_parser.pl populates the Xref #
# database with the correct data. #
# #
########################################################################
use strict;
use warnings;
use Config::IniFiles;
my $file = ( defined $ARGV[0] && -f $ARGV[0]) ? $ARGV[0] : 'xref_config.ini';
warn $file;
my $config =Config::IniFiles->new(-file =>$file);
if(! defined $config) {
foreach my $e (@Config::IniFiles::errors) {
warn "errors found";
warn $e;
}
die "No Xref config made from $file. Check STDERR";
}
my %source_ids;
# Do the species.
print( '#' x 80, "\n" );
print("# SPECIES\n");
print("\n");
foreach my $section ( $config->GroupMembers('species') ) {
my $species_name = substr( $section, 8 );
my @taxonomy_ids =
split( /\n/, $config->val( $section, 'taxonomy_id' ) );
my $species_id = $taxonomy_ids[0];
printf( "# Species '%s' (id = %d)\n", $species_name, $species_id );
foreach my $taxonomy_id (@taxonomy_ids) {
print( "INSERT INTO species "
. "(species_id, taxonomy_id, name, aliases)\n" );
printf( "VALUES (%d, %d, '%s', '%s');\n",
$species_id, $taxonomy_id, $species_name,
$config->val( $section, 'aliases' ) );
}
print("\n");
}
# Do the sources.
print( '#' x 80, "\n" );
print("# SOURCES\n");
print("\n");
my $source_id = 0;
foreach my $source_section ( sort( $config->GroupMembers('source') ) ) {
my ( $spaces, $source_name ) =
$source_section =~ /^source(\s+)(\S+)\s*$/;
if ( length($spaces) > 1 ) {
die( sprintf("Too many spaces between the words 'source' and '%s'\n"
. "while reading source section '[%s]'\n",
$source_name, $source_section ) );
}
# if ( exists( $source_ids{$source_section} ) ) {
# # Won't happen because Config::IniFile will combine the configs
# # of multiple sections with the same name into one section with
# # multi-value values. Sigh...
# die( sprintf( "The source section '[%s]' occurs more than once\n",
# $source_section ) );
# }
if ( index( $config->val( $source_section, 'name' ), "\n" ) != -1 ) {
die( sprintf( "The source section '[%s]' occurs more\n"
. "than once in the configuration file\n",
$source_section ) );
}
$source_ids{$source_section} = ++$source_id;
printf( "# Source '%s' (id = %d)\n", $source_name, $source_id );
print( "INSERT INTO source "
. "(name, source_release, download, ordered, "
. "priority, priority_description, status)\n" );
printf( "VALUES ('%s', '1', '%s', %d, %d, '%s', '%s');\n",
$config->val( $source_section, 'name' ),
$config->val( $source_section, 'download' ),
$config->val( $source_section, 'order' ),
$config->val( $source_section, 'priority' ),
$config->val( $source_section, 'prio_descr' ),
$config->val($source_section, 'status', 'NOIDEA') );
print("\n");
my @dependents =
split( /\,/, $config->val( $source_section, 'dependent_on', '' ) );
foreach my $dep (@dependents){
print "# adding source dependency that $source_section needs $dep loaded first\n";
print "INSERT IGNORE INTO dependent_source (master_source_id, dependent_name)\n";
printf( "VALUES (%d, '%s');\n\n", $source_ids{$source_section}, $dep);
}
} ## end foreach my $source_section ...
# Do the data files.
print( '#' x 80, "\n" );
print("# DATA FILES\n");
print("\n");
foreach my $species_section ( sort( $config->GroupMembers('species') ) )
{
my ( $spaces, $species_name ) =
$species_section =~ /^species(\s+)(\S+)\s*$/;
if ( length($spaces) > 1 ) {
die( sprintf(
"Too many spaces between the words 'species' and '%s'\n"
. "while reading species section '[%s]'\n",
$species_name, $species_section ) );
}
my @taxonomy_ids =
split( /\n/, $config->val( $species_section, 'taxonomy_id' ) );
my $species_id = $taxonomy_ids[0];
print( '#', '-' x 79, "\n" );
printf( "# Data for species '%s' (id = %d)\n",
$species_name, $species_id );
print( '#', '-' x 79, "\n" );
print("\n");
foreach my $source_name (
sort( split( /\n/, $config->val( $species_section, 'source' ) ) ) )
{
my $source_section = sprintf( "source %s", $source_name );
if ( !exists( $source_ids{$source_section} ) ) {
die( sprintf( "Can not find source section '[%s]'\n"
. "while reading species section '[%s]'\n",
$source_section, $species_section ) );
}
printf( "# Data from source '%s' (id = %d)\n",
$source_name, $source_ids{$source_section} );
print( "INSERT INTO source_url "
. "(source_id, species_id, url, release_url, "
. "file_modified_date, upload_date, parser)\n" );
my @uris =
split( /\n/, $config->val( $source_section, 'data_uri', '' ) );
my $release_uri = $config->val( $source_section, 'release_uri' );
if ( !defined($release_uri) or $release_uri !~ /\w/ ) {
$release_uri = '\N';
} else {
$release_uri = "'$release_uri'";
}
printf( "VALUES (%d, %d, '%s', %s, now(), now(), '%s');\n",
$source_ids{$source_section}, $species_id,
join( ' ', @uris ), $release_uri,
$config->val( $source_section, 'parser' ) );
print("\n");
} ## end foreach my $source_name ( sort...)
} ## end foreach my $species_section...
print "# FINISHED SUCCESSFULLY\n"
| 34.186603 | 102 | 0.560252 |
73d7f408a74a87ab3b5b3f7f754c8376610874f8 | 286 | pl | Perl | src/org/apache/fop/viewer/resources/resources.pl | tanvir-ahmed-m4/fop-0.20.5 | 61290f6667d57ae483a58991c417dce91673386f | [
"Apache-1.1"
]
| null | null | null | src/org/apache/fop/viewer/resources/resources.pl | tanvir-ahmed-m4/fop-0.20.5 | 61290f6667d57ae483a58991c417dce91673386f | [
"Apache-1.1"
]
| null | null | null | src/org/apache/fop/viewer/resources/resources.pl | tanvir-ahmed-m4/fop-0.20.5 | 61290f6667d57ae483a58991c417dce91673386f | [
"Apache-1.1"
]
| 1 | 2021-12-21T15:27:19.000Z | 2021-12-21T15:27:19.000Z | File=Plik
Print=Drukuj
Exit=Zakoñcz
View=Widok
First page=Pierwsza strona
Previous page=Poprzednia strona
Next page=Nastêpna strona
Last page=Ostatnia strona
Zoom=Powiêkszenie
Default zoom=Domy¶lne powiekszenie
Help=Pomoc
Index=Indeks
Introduction=Wstêp
About=O programie
Page=Strona
| 15.888889 | 34 | 0.846154 |
ed3407bdf829dcdc5c6c66e1eccc3ad21ebd92a3 | 1,853 | pm | Perl | storage/fujitsu/eternus/dx/ssh/plugin.pm | dalfo77/centreon-plugins | 3cb2011c46a45b5e4a785ca6bab439142f882d45 | [
"Apache-2.0"
]
| null | null | null | storage/fujitsu/eternus/dx/ssh/plugin.pm | dalfo77/centreon-plugins | 3cb2011c46a45b5e4a785ca6bab439142f882d45 | [
"Apache-2.0"
]
| null | null | null | storage/fujitsu/eternus/dx/ssh/plugin.pm | dalfo77/centreon-plugins | 3cb2011c46a45b5e4a785ca6bab439142f882d45 | [
"Apache-2.0"
]
| null | null | null | #
# Copyright 2020 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::fujitsu::eternus::dx::ssh::plugin;
use strict;
use warnings;
use base qw(centreon::plugins::script_simple);
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options);
bless $self, $class;
$self->{version} = '1.0';
%{$self->{modes}} = (
'physicaldisk' => 'storage::fujitsu::eternus::dx::ssh::mode::physicaldisk',
'psu' => 'storage::fujitsu::eternus::dx::ssh::mode::psu',
'raid-groups' => 'storage::fujitsu::eternus::dx::ssh::mode::raidgroups',
'volume-stats' => 'storage::fujitsu::eternus::dx::ssh::mode::volumestats',
'cpu' => 'storage::fujitsu::eternus::dx::ssh::mode::cpu',
'port-stats' => 'storage::fujitsu::eternus::dx::ssh::mode::portstats',
);
return $self;
}
1;
__END__
=head1 PLUGIN DESCRIPTION
Check Fujitsu Eternnus DX storage in SSH.
=cut
| 34.314815 | 105 | 0.610362 |
73e9aeed8591095e3187874c533c2adff55c7a7c | 993 | al | Perl | Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/UpgradeTagDefinitions.Codeunit.al | waldo1001/ALAppExtensions | 935155845bf45b631d1c34b6bcd5aec54308d50f | [
"MIT"
]
| 337 | 2019-05-07T06:04:40.000Z | 2022-03-31T10:07:42.000Z | Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/UpgradeTagDefinitions.Codeunit.al | waldo1001/ALAppExtensions | 935155845bf45b631d1c34b6bcd5aec54308d50f | [
"MIT"
]
| 14,850 | 2019-05-07T06:04:27.000Z | 2022-03-31T19:53:28.000Z | Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/UpgradeTagDefinitions.Codeunit.al | waldo1001/ALAppExtensions | 935155845bf45b631d1c34b6bcd5aec54308d50f | [
"MIT"
]
| 374 | 2019-05-09T10:08:14.000Z | 2022-03-31T17:48:32.000Z | codeunit 31089 "Upgrade Tag Definitions CZZ"
{
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Upgrade Tag", 'OnGetPerDatabaseUpgradeTags', '', false, false)]
local procedure RegisterPerDatabaseTags(var PerDatabaseUpgradeTags: List of [Code[250]])
begin
PerDatabaseUpgradeTags.Add(GetDataVersion190PerDatabaseUpgradeTag());
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Upgrade Tag", 'OnGetPerCompanyUpgradeTags', '', false, false)]
local procedure RegisterPerCompanyTags(var PerCompanyUpgradeTags: List of [Code[250]])
begin
PerCompanyUpgradeTags.Add(GetDataVersion190PerCompanyUpgradeTag());
end;
procedure GetDataVersion190PerDatabaseUpgradeTag(): Code[250]
begin
exit('CZZ-UpgradeAdvancePaymentsLocalizationForCzech-PerDatabase-19.0');
end;
procedure GetDataVersion190PerCompanyUpgradeTag(): Code[250]
begin
exit('CZZ-UpgradeAdvancePaymentsLocalizationForCzech-PerCompany-19.0');
end;
}
| 39.72 | 117 | 0.753273 |
ed58c4a6a52a716a86f2937378ac2c868f3d6c7c | 944 | t | Perl | t/basic.t | sdondley/Mac-Applications-List | d3003318bb41dfebdde7063b394a6c8bdbe9c80c | [
"Artistic-2.0"
]
| 1 | 2022-01-17T14:54:16.000Z | 2022-01-17T14:54:16.000Z | t/basic.t | sdondley/Mac-Applications-List | d3003318bb41dfebdde7063b394a6c8bdbe9c80c | [
"Artistic-2.0"
]
| null | null | null | t/basic.t | sdondley/Mac-Applications-List | d3003318bb41dfebdde7063b394a6c8bdbe9c80c | [
"Artistic-2.0"
]
| null | null | null | use v6.d;
use Test;
use lib 'lib';
use Mac::Applications::List;
plan 10;
# check OS
is 'darwin', VM.osname(), 'running macOS';
# no arg
my @apps = MacAppList.new.find_apps;
is @apps.Bool, True, 'returns a list of apps';
is ('Safari' ~~ any @apps), True, 'finds Safari';
my $app_list = MacAppList.new();
$app_list.find_apps;
is True, $app_list.exists('Safari'), 'exists method works';
is apps.Bool, True, 'functional interface works';
# with args
my @path = < /Applications >;
@apps = MacAppList.new.find_apps(@path);
is @apps.Bool, True, 'returns a list of apps';
is apps(@path).Bool, True, 'returns a list of apps with functional interface';
@apps = MacAppList.new.find_apps(< /Applications >);
is @apps.Bool, True, 'returns a list with list argument';
@apps = MacAppList.new.find_apps('/Applications');
is @apps.Bool, True, 'returns a list of apps';
is True, MacAppList.new.exists('Safari'), 'exists method works';
done-testing;
| 23.6 | 78 | 0.695975 |
ed3c9db7791e6f1a51460b8fe9002326791a583a | 5,119 | pl | Perl | scripts/GeneComparison/exon_length_Coverage.pl | vsitnik/ensembl-pipeline | 3d12427eb0536812906fe5fd0cf5e90cc27d89ad | [
"Apache-2.0"
]
| 51 | 2015-01-09T06:15:42.000Z | 2022-01-09T19:03:36.000Z | scripts/GeneComparison/exon_length_Coverage.pl | vsitnik/ensembl-pipeline | 3d12427eb0536812906fe5fd0cf5e90cc27d89ad | [
"Apache-2.0"
]
| 4 | 2017-08-03T11:06:57.000Z | 2022-01-21T17:23:19.000Z | scripts/GeneComparison/exon_length_Coverage.pl | vsitnik/ensembl-pipeline | 3d12427eb0536812906fe5fd0cf5e90cc27d89ad | [
"Apache-2.0"
]
| 31 | 2015-01-11T08:22:41.000Z | 2022-03-10T00:48:24.000Z | #!/usr/bin/env perl
# Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
# Copyright [2016-2020] EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
=head1 NAME
comapre_Exons
=head1 DESCRIPTION
reads the config options from Bi::Ensembl::Pipeline::GeneComparison::GeneCompConf
and reads as input an input_id in the style of other Runnables, i.e. -input_id chr_name.chr_start-chr_end
=head1 OPTIONS
-input_id The input id: chrname.chrstart-chrend
=cut
use warnings ;
use strict;
use diagnostics;
use Bio::EnsEMBL::DBSQL::DBAdaptor;
use Bio::EnsEMBL::Pipeline::GeneComparison::GeneComparison;
use Getopt::Long;
## load all the parameters
use Bio::EnsEMBL::Pipeline::GeneComparison::GeneCompConf;
# annotation
my $host1 = $DBHOST1;
my $dbname1 = $DBNAME1;
my $path1 = $PATH1;
my $type1 = $GENETYPES1;
my $user1 = $DBUSER1;
# reference db
my $ref_host1 = $REF_DBHOST1;
my $ref_dbname1 = $REF_DBNAME1;
my $ref_path1 = $REF_PATH1;
my $ref_user1 = $REF_DBUSER1;
# prediction
my $host2 = $DBHOST2;
my $dbname2 = $DBNAME2;
my $path2 = $PATH2;
my $type2 = $GENETYPES2;
my $user2 = $DBUSER2;
# reference db
my $ref_host2 = $REF_DBHOST2;
my $ref_dbname2 = $REF_DBNAME2;
my $ref_path2 = $REF_PATH2;
my $ref_user2 = $REF_DBUSER2;
my $runnable;
my $input_id;
my $write = 0;
my $check = 0;
my $params;
my $pepfile;
my $lower_bound = 0;
# can override db options on command line
&GetOptions(
'input_id:s' => \$input_id,
);
unless( $input_id){
print STDERR "Usage: exon_Coverage.pl -input_id <chrname>.<chrstart>-<chrend>\n";
exit(0);
}
# get genomic region
my $chr = $input_id;
$chr =~ s/\.(.*)-(.*)//;
my $chrstart = $1;
my $chrend = $2;
unless ( $chr && $chrstart && $chrend ){
print STDERR "bad input_id option, try something like 20.1-5000000\n";
}
# connect to the databases
my $dna_db1= new Bio::EnsEMBL::DBSQL::DBAdaptor(-host => $ref_host1,
-user => $ref_user1,
-dbname=> $ref_dbname1);
$dna_db1->static_golden_path_type($ref_path1);
my $dna_db2= new Bio::EnsEMBL::DBSQL::DBAdaptor(-host => $ref_host2,
-user => $ref_user2,
-dbname=> $ref_dbname2);
$dna_db2->static_golden_path_type($ref_path2);
my $db1= new Bio::EnsEMBL::DBSQL::DBAdaptor(-host => $host1,
-user => $user1,
-dbname=> $dbname1,
-dnadb => $dna_db1,
);
print STDERR "Connected to database $dbname1 : $host1 : $user1 \n";
my $db2= new Bio::EnsEMBL::DBSQL::DBAdaptor(-host => $host2,
-user => $user2,
-dbname=> $dbname2,
-dnadb => $dna_db2);
print STDERR "Connected to database $dbname2 : $host2 : $user2 \n";
# use different golden paths
$db1->static_golden_path_type($path1);
$db2->static_golden_path_type($path2);
my $sgp1 = $db1->get_StaticGoldenPathAdaptor;
my $sgp2 = $db2->get_StaticGoldenPathAdaptor;
# get a virtual contig with a piece-of chromosome #
my ($vcontig1,$vcontig2);
print STDERR "Fetching region $chr, $chrstart - $chrend\n";
$vcontig1 = $sgp1->fetch_VirtualContig_by_chr_start_end($chr,$chrstart,$chrend);
$vcontig2 = $sgp2->fetch_VirtualContig_by_chr_start_end($chr,$chrstart,$chrend);
# get the genes of type @type1 and @type2 from $vcontig1 and $vcontig2, respectively #
my (@genes1,@genes2);
foreach my $type ( @{ $type1 } ){
print STDERR "Fetching genes of type $type\n";
my @more_genes = $vcontig1->get_Genes_by_Type($type);
my @more_trans = ();
foreach my $gene ( @more_genes ){
push ( @more_trans, $gene->each_Transcript );
}
push ( @genes1, @more_genes );
print STDERR scalar(@more_genes)." genes found\n";
print STDERR "with ".scalar(@more_trans)." transcripts\n";
}
foreach my $type ( @{ $type2 } ){
print STDERR "Fetching genes of type $type\n";
my @more_genes = $vcontig2->get_Genes_by_Type($type);
my @more_trans = ();
foreach my $gene ( @more_genes ){
push ( @more_trans, $gene->each_Transcript );
}
push ( @genes2, @more_genes );
print STDERR scalar(@more_genes)." genes found\n";
print STDERR "with ".scalar(@more_trans)." transcripts\n";
}
# get a GeneComparison object
my $gene_comparison =
Bio::EnsEMBL::Pipeline::GeneComparison::GeneComparison->new(
'-annotation_genes' => \@genes1,
'-prediction_genes' => \@genes2,
'-input_id' => $input_id,
);
#########################################################
$gene_comparison->exon_Coverage_by_Length(\@genes1, \@genes2);
| 27.67027 | 105 | 0.663997 |
73eb781d7184ae17c1da9fa9d639a47f1c360494 | 804 | pl | Perl | apps/httpd-2.2.23/tests/perl-framework/t/htdocs/modules/cgi/nph-foldhdr.pl | vusec/firestarter | 2048c1f731b8f3c5570a920757f9d7730d5f716a | [
"Apache-2.0"
]
| 3 | 2021-04-29T07:59:16.000Z | 2021-12-10T02:23:05.000Z | apps/lighttpd-1.4.45/tests/perl-framework/t/htdocs/modules/cgi/nph-foldhdr.pl | vusec/firestarter | 2048c1f731b8f3c5570a920757f9d7730d5f716a | [
"Apache-2.0"
]
| null | null | null | apps/lighttpd-1.4.45/tests/perl-framework/t/htdocs/modules/cgi/nph-foldhdr.pl | vusec/firestarter | 2048c1f731b8f3c5570a920757f9d7730d5f716a | [
"Apache-2.0"
]
| null | null | null | #!/usr/bin/perl
# WARNING: this file is generated, do not edit
# generated on Wed May 27 03:01:20 2020
# 01: Apache-Test/lib/Apache/TestConfig.pm:1007
# 02: Apache-Test/lib/Apache/TestConfig.pm:1099
# 03: Apache-Test/lib/Apache/TestMM.pm:142
# 04: Makefile.PL:46
BEGIN { eval { require blib && blib->import; } }
$Apache::TestConfig::Argv{'apxs'} = q|/mnt/hdd/koustubha/repos/apprecovery/apps/httpd-2.2.23/install/bin/apxs|;
$Apache::TestConfig::Argv{'limitrequestline'} = q|128|;
$Apache::TestConfig::Argv{'limitrequestlinex2'} = q|256|;
# produces output with folded response headers
print "HTTP/1.0 200 OK\r\n";
for (1..50) {
print "X-Foo-Bar-$_:\n " . 'x'x($_*10) . "\n";
print "X-Bar-$_:\n gamm\r\n beta\n theta\r\n";
}
print "Content-type: \n text/plain\n\n";
print "hello, world";
| 28.714286 | 111 | 0.676617 |
73d6c1e8ddb6c1067f4b8fc93a45488cb35076f5 | 1,203 | pl | Perl | contrib/preauth-pipe-server.pl | karenetheridge/Net-IMAP-Simple | c78b718df03d4828998208d478e9e95166a68761 | [
"FSFAP"
]
| 6 | 2015-04-01T17:46:26.000Z | 2020-01-08T13:40:53.000Z | contrib/preauth-pipe-server.pl | karenetheridge/Net-IMAP-Simple | c78b718df03d4828998208d478e9e95166a68761 | [
"FSFAP"
]
| 6 | 2015-09-19T17:22:35.000Z | 2021-11-22T16:45:07.000Z | contrib/preauth-pipe-server.pl | karenetheridge/Net-IMAP-Simple | c78b718df03d4828998208d478e9e95166a68761 | [
"FSFAP"
]
| 6 | 2015-06-26T17:15:34.000Z | 2021-01-23T12:32:22.000Z | #!/usr/bin/perl
use strict;
use Net::Server;
use base 'Net::Server::PreFork';
use IPC::Open3;
use IO::Select;
my $port = shift;
my @cmd = @ARGV;
die "port cmd cmd cmd cmd cmd cmd cmd" unless $port and @cmd;
sub process_request {
my $this = shift;
my ($wtr, $rdr, $err);
my $pid = open3($wtr, $rdr, $err, @cmd);
$rdr->blocking(0);
STDIN->blocking(0);
my $select = IO::Select->new($rdr, \*STDIN);
TOP: while(1) {
if( my @handles = $select->can_read(1) ) {
for(@handles) {
my $at_least_one = 0;
while( my $line = $_->getline ) {
if( $_ == $rdr ) {
print STDOUT $line;
$this->log(1, "[IMAP] $line");
} else {
print $wtr $line;
$this->log(1, "[CLNT] $line");
}
$at_least_one ++;
}
last TOP unless $at_least_one;
}
}
}
$this->log(1, "[KILL] $pid must die");
kill -1, $pid;
kill -2, $pid;
waitpid $pid, 0;
return;
}
main->run(port=>$port, log_file=>"ppsc.log");
| 21.482143 | 61 | 0.436409 |
73f9873c2d501c80500aad5234208aad9169b8f4 | 1,093 | pm | Perl | Test-Sites/css-zen-test/lib/MyManageNews.pm | thewml/latemp | a51ef0f20be63b5dec92d4218dd94f01c9762f40 | [
"MIT"
]
| 1 | 2020-04-07T07:06:04.000Z | 2020-04-07T07:06:04.000Z | Test-Sites/css-zen-test/lib/MyManageNews.pm | thewml/latemp | a51ef0f20be63b5dec92d4218dd94f01c9762f40 | [
"MIT"
]
| 2 | 2016-10-20T22:37:02.000Z | 2019-09-10T20:03:01.000Z | Test-Sites/css-zen-test/lib/MyManageNews.pm | thewml/latemp | a51ef0f20be63b5dec92d4218dd94f01c9762f40 | [
"MIT"
]
| 2 | 2016-10-21T08:35:06.000Z | 2019-09-10T10:43:40.000Z | package MyManageNews;
use base 'Exporter';
our @EXPORT=(qw(get_news_manager));
use strict;
use warnings;
use HTML::Latemp::News;
my @news_items =
(
(map
{
+{%$_,
'author' => "John Smith",
'category' => "My Site Category",
}
}
(
# TODO: Fill Items Here.
),
)
);
sub gen_news_manager
{
return
HTML::Latemp::News->new(
'news_items' => \@news_items,
'title' => "My Site News",
'link' => "http://www.link-to-my-site.tld/",
'language' => "en-US",
'copyright' => "Copyright by John Smith, (c) 2005",
'webmaster' => "John Smith <author\@domain.org>",
'managing_editor' => "John Smith <author\@domain.org>",
'description' => "News of the My Site",
);
}
# A singleton.
{
my $news_manager;
sub get_news_manager
{
if (!defined($news_manager))
{
$news_manager = gen_news_manager();
}
return $news_manager;
}
}
1;
| 19.175439 | 67 | 0.481244 |
ed1e69485d1289ab8762224c159f567f607f9270 | 4,019 | pm | Perl | auto-lib/Paws/IoTData.pm | agimenez/aws-sdk-perl | 9c4dff7d1af2ff0210c28ca44fb9e92bc625712b | [
"Apache-2.0"
]
| null | null | null | auto-lib/Paws/IoTData.pm | agimenez/aws-sdk-perl | 9c4dff7d1af2ff0210c28ca44fb9e92bc625712b | [
"Apache-2.0"
]
| null | null | null | auto-lib/Paws/IoTData.pm | agimenez/aws-sdk-perl | 9c4dff7d1af2ff0210c28ca44fb9e92bc625712b | [
"Apache-2.0"
]
| null | null | null | package Paws::IoTData;
use Moose;
sub service { 'data.iot' }
sub version { '2015-05-28' }
sub flattened_arrays { 0 }
has max_attempts => (is => 'ro', isa => 'Int', default => 5);
has retry => (is => 'ro', isa => 'HashRef', default => sub {
{ base => 'rand', type => 'exponential', growth_factor => 2 }
});
has retriables => (is => 'ro', isa => 'ArrayRef', default => sub { [
] });
with 'Paws::API::Caller', 'Paws::API::EndpointResolver', 'Paws::Net::V4Signature', 'Paws::Net::RestJsonCaller', 'Paws::Net::RestJsonResponse';
sub DeleteThingShadow {
my $self = shift;
my $call_object = $self->new_with_coercions('Paws::IoTData::DeleteThingShadow', @_);
return $self->caller->do_call($self, $call_object);
}
sub GetThingShadow {
my $self = shift;
my $call_object = $self->new_with_coercions('Paws::IoTData::GetThingShadow', @_);
return $self->caller->do_call($self, $call_object);
}
sub Publish {
my $self = shift;
my $call_object = $self->new_with_coercions('Paws::IoTData::Publish', @_);
return $self->caller->do_call($self, $call_object);
}
sub UpdateThingShadow {
my $self = shift;
my $call_object = $self->new_with_coercions('Paws::IoTData::UpdateThingShadow', @_);
return $self->caller->do_call($self, $call_object);
}
sub operations { qw/DeleteThingShadow GetThingShadow Publish UpdateThingShadow / }
1;
### main pod documentation begin ###
=head1 NAME
Paws::IoTData - Perl Interface to AWS AWS IoT Data Plane
=head1 SYNOPSIS
use Paws;
my $obj = Paws->service('IoTData');
my $res = $obj->Method(
Arg1 => $val1,
Arg2 => [ 'V1', 'V2' ],
# if Arg3 is an object, the HashRef will be used as arguments to the constructor
# of the arguments type
Arg3 => { Att1 => 'Val1' },
# if Arg4 is an array of objects, the HashRefs will be passed as arguments to
# the constructor of the arguments type
Arg4 => [ { Att1 => 'Val1' }, { Att1 => 'Val2' } ],
);
=head1 DESCRIPTION
AWS IoT
AWS IoT-Data enables secure, bi-directional communication between
Internet-connected things (such as sensors, actuators, embedded
devices, or smart appliances) and the AWS cloud. It implements a broker
for applications and things to publish messages over HTTP (Publish) and
retrieve, update, and delete thing shadows. A thing shadow is a
persistent representation of your things and their state in the AWS
cloud.
=head1 METHODS
=head2 DeleteThingShadow(ThingName => Str)
Each argument is described in detail in: L<Paws::IoTData::DeleteThingShadow>
Returns: a L<Paws::IoTData::DeleteThingShadowResponse> instance
Deletes the thing shadow for the specified thing.
For more information, see DeleteThingShadow in the I<AWS IoT Developer
Guide>.
=head2 GetThingShadow(ThingName => Str)
Each argument is described in detail in: L<Paws::IoTData::GetThingShadow>
Returns: a L<Paws::IoTData::GetThingShadowResponse> instance
Gets the thing shadow for the specified thing.
For more information, see GetThingShadow in the I<AWS IoT Developer
Guide>.
=head2 Publish(Topic => Str, [Payload => Str, Qos => Int])
Each argument is described in detail in: L<Paws::IoTData::Publish>
Returns: nothing
Publishes state information.
For more information, see HTTP Protocol in the I<AWS IoT Developer
Guide>.
=head2 UpdateThingShadow(Payload => Str, ThingName => Str)
Each argument is described in detail in: L<Paws::IoTData::UpdateThingShadow>
Returns: a L<Paws::IoTData::UpdateThingShadowResponse> instance
Updates the thing shadow for the specified thing.
For more information, see UpdateThingShadow in the I<AWS IoT Developer
Guide>.
=head1 PAGINATORS
Paginator methods are helpers that repetively call methods that return partial results
=head1 SEE ALSO
This service class forms part of L<Paws>
=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
| 27.155405 | 144 | 0.706146 |
ed331f41871713a2ad42fb91663b0df0447ef303 | 11,360 | pm | Perl | lib/Monitoring/GLPlugin/SNMP/MibsAndOids/CISCOPROCESSMIB.pm | bgeels/GLPlugin | e157e89015796f45699f6936cc694798e2b95299 | [
"Artistic-2.0",
"Unlicense"
]
| 13 | 2016-07-26T12:07:04.000Z | 2021-11-08T08:18:35.000Z | lib/Monitoring/GLPlugin/SNMP/MibsAndOids/CISCOPROCESSMIB.pm | bgeels/GLPlugin | e157e89015796f45699f6936cc694798e2b95299 | [
"Artistic-2.0",
"Unlicense"
]
| 13 | 2016-04-04T21:10:41.000Z | 2022-03-03T10:44:26.000Z | lib/Monitoring/GLPlugin/SNMP/MibsAndOids/CISCOPROCESSMIB.pm | bgeels/GLPlugin | e157e89015796f45699f6936cc694798e2b95299 | [
"Artistic-2.0",
"Unlicense"
]
| 38 | 2015-08-27T08:39:15.000Z | 2021-11-08T08:33:01.000Z | package Monitoring::GLPlugin::SNMP::MibsAndOids::CISCOPROCESSMIB;
$Monitoring::GLPlugin::SNMP::MibsAndOids::origin->{'CISCO-PROCESS-MIB'} = {
url => '',
name => 'CISCO-PROCESS-MIB',
};
$Monitoring::GLPlugin::SNMP::MibsAndOids::mib_ids->{'CISCO-PROCESS-MIB'} =
'1.3.6.1.4.1.9.9.109';
$Monitoring::GLPlugin::SNMP::MibsAndOids::mibs_and_oids->{'CISCO-PROCESS-MIB'} = {
'ciscoProcessMIB' => '1.3.6.1.4.1.9.9.109',
'ciscoProcessMIBObjects' => '1.3.6.1.4.1.9.9.109.1',
'cpmCPU' => '1.3.6.1.4.1.9.9.109.1.1',
'cpmCPUTotalTable' => '1.3.6.1.4.1.9.9.109.1.1.1',
'cpmCPUTotalEntry' => '1.3.6.1.4.1.9.9.109.1.1.1.1',
'cpmCPUTotalIndex' => '1.3.6.1.4.1.9.9.109.1.1.1.1.1',
'cpmCPUTotalPhysicalIndex' => '1.3.6.1.4.1.9.9.109.1.1.1.1.2',
'cpmCPUTotal5sec' => '1.3.6.1.4.1.9.9.109.1.1.1.1.3',
'cpmCPUTotal1min' => '1.3.6.1.4.1.9.9.109.1.1.1.1.4',
'cpmCPUTotal5min' => '1.3.6.1.4.1.9.9.109.1.1.1.1.5',
'cpmCPUTotal5secRev' => '1.3.6.1.4.1.9.9.109.1.1.1.1.6',
'cpmCPUTotal1minRev' => '1.3.6.1.4.1.9.9.109.1.1.1.1.7',
'cpmCPUTotal5minRev' => '1.3.6.1.4.1.9.9.109.1.1.1.1.8',
'cpmCPUMonInterval' => '1.3.6.1.4.1.9.9.109.1.1.1.1.9',
'cpmCPUTotalMonIntervalValue' => '1.3.6.1.4.1.9.9.109.1.1.1.1.10',
'cpmCPUInterruptMonIntervalValue' => '1.3.6.1.4.1.9.9.109.1.1.1.1.11',
'cpmCPUMemoryUsed' => '1.3.6.1.4.1.9.9.109.1.1.1.1.12',
'cpmCPUMemoryFree' => '1.3.6.1.4.1.9.9.109.1.1.1.1.13',
'cpmCPUMemoryKernelReserved' => '1.3.6.1.4.1.9.9.109.1.1.1.1.14',
'cpmCPUMemoryLowest' => '1.3.6.1.4.1.9.9.109.1.1.1.1.15',
'cpmCPUMemoryUsedOvrflw' => '1.3.6.1.4.1.9.9.109.1.1.1.1.16',
'cpmCPUMemoryHCUsed' => '1.3.6.1.4.1.9.9.109.1.1.1.1.17',
'cpmCPUMemoryFreeOvrflw' => '1.3.6.1.4.1.9.9.109.1.1.1.1.18',
'cpmCPUMemoryHCFree' => '1.3.6.1.4.1.9.9.109.1.1.1.1.19',
'cpmCPUMemoryKernelReservedOvrflw' => '1.3.6.1.4.1.9.9.109.1.1.1.1.20',
'cpmCPUMemoryHCKernelReserved' => '1.3.6.1.4.1.9.9.109.1.1.1.1.21',
'cpmCPUMemoryLowestOvrflw' => '1.3.6.1.4.1.9.9.109.1.1.1.1.22',
'cpmCPUMemoryHCLowest' => '1.3.6.1.4.1.9.9.109.1.1.1.1.23',
'cpmCPULoadAvg1min' => '1.3.6.1.4.1.9.9.109.1.1.1.1.24',
'cpmCPULoadAvg5min' => '1.3.6.1.4.1.9.9.109.1.1.1.1.25',
'cpmCPULoadAvg15min' => '1.3.6.1.4.1.9.9.109.1.1.1.1.26',
'cpmCPUMemoryCommitted' => '1.3.6.1.4.1.9.9.109.1.1.1.1.27',
'cpmCPUMemoryCommittedOvrflw' => '1.3.6.1.4.1.9.9.109.1.1.1.1.28',
'cpmCPUMemoryHCCommitted' => '1.3.6.1.4.1.9.9.109.1.1.1.1.29',
'cpmCoreTable' => '1.3.6.1.4.1.9.9.109.1.1.2',
'cpmCoreEntry' => '1.3.6.1.4.1.9.9.109.1.1.2.1',
'cpmCoreIndex' => '1.3.6.1.4.1.9.9.109.1.1.2.1.1',
'cpmCorePhysicalIndex' => '1.3.6.1.4.1.9.9.109.1.1.2.1.2',
'cpmCore5sec' => '1.3.6.1.4.1.9.9.109.1.1.2.1.3',
'cpmCore1min' => '1.3.6.1.4.1.9.9.109.1.1.2.1.4',
'cpmCore5min' => '1.3.6.1.4.1.9.9.109.1.1.2.1.5',
'cpmCoreLoadAvg1min' => '1.3.6.1.4.1.9.9.109.1.1.2.1.6',
'cpmCoreLoadAvg5min' => '1.3.6.1.4.1.9.9.109.1.1.2.1.7',
'cpmCoreLoadAvg15min' => '1.3.6.1.4.1.9.9.109.1.1.2.1.8',
'cpmProcess' => '1.3.6.1.4.1.9.9.109.1.2',
'cpmProcessTable' => '1.3.6.1.4.1.9.9.109.1.2.1',
'cpmProcessEntry' => '1.3.6.1.4.1.9.9.109.1.2.1.1',
'cpmProcessPID' => '1.3.6.1.4.1.9.9.109.1.2.1.1.1',
'cpmProcessName' => '1.3.6.1.4.1.9.9.109.1.2.1.1.2',
'cpmProcessuSecs' => '1.3.6.1.4.1.9.9.109.1.2.1.1.4',
'cpmProcessTimeCreated' => '1.3.6.1.4.1.9.9.109.1.2.1.1.5',
'cpmProcessAverageUSecs' => '1.3.6.1.4.1.9.9.109.1.2.1.1.6',
'cpmProcessExtTable' => '1.3.6.1.4.1.9.9.109.1.2.2',
'cpmProcessExtEntry' => '1.3.6.1.4.1.9.9.109.1.2.2.1',
'cpmProcExtMemAllocated' => '1.3.6.1.4.1.9.9.109.1.2.2.1.1',
'cpmProcExtMemFreed' => '1.3.6.1.4.1.9.9.109.1.2.2.1.2',
'cpmProcExtInvoked' => '1.3.6.1.4.1.9.9.109.1.2.2.1.3',
'cpmProcExtRuntime' => '1.3.6.1.4.1.9.9.109.1.2.2.1.4',
'cpmProcExtUtil5Sec' => '1.3.6.1.4.1.9.9.109.1.2.2.1.5',
'cpmProcExtUtil1Min' => '1.3.6.1.4.1.9.9.109.1.2.2.1.6',
'cpmProcExtUtil5Min' => '1.3.6.1.4.1.9.9.109.1.2.2.1.7',
'cpmProcExtPriority' => '1.3.6.1.4.1.9.9.109.1.2.2.1.8',
'cpmProcExtPriorityDefinition' => 'CISCO-PROCESS-MIB::cpmProcExtPriority',
'cpmProcessExtRevTable' => '1.3.6.1.4.1.9.9.109.1.2.3',
'cpmProcessExtRevEntry' => '1.3.6.1.4.1.9.9.109.1.2.3.1',
'cpmProcExtMemAllocatedRev' => '1.3.6.1.4.1.9.9.109.1.2.3.1.1',
'cpmProcExtMemFreedRev' => '1.3.6.1.4.1.9.9.109.1.2.3.1.2',
'cpmProcExtInvokedRev' => '1.3.6.1.4.1.9.9.109.1.2.3.1.3',
'cpmProcExtRuntimeRev' => '1.3.6.1.4.1.9.9.109.1.2.3.1.4',
'cpmProcExtUtil5SecRev' => '1.3.6.1.4.1.9.9.109.1.2.3.1.5',
'cpmProcExtUtil1MinRev' => '1.3.6.1.4.1.9.9.109.1.2.3.1.6',
'cpmProcExtUtil5MinRev' => '1.3.6.1.4.1.9.9.109.1.2.3.1.7',
'cpmProcExtPriorityRev' => '1.3.6.1.4.1.9.9.109.1.2.3.1.8',
'cpmProcExtPriorityRevDefinition' => 'CISCO-PROCESS-MIB::cpmProcExtPriorityRev',
'cpmProcessType' => '1.3.6.1.4.1.9.9.109.1.2.3.1.9',
'cpmProcessTypeDefinition' => 'CISCO-PROCESS-MIB::cpmProcessType',
'cpmProcessRespawn' => '1.3.6.1.4.1.9.9.109.1.2.3.1.10',
'cpmProcessRespawnCount' => '1.3.6.1.4.1.9.9.109.1.2.3.1.11',
'cpmProcessRespawnAfterLastPatch' => '1.3.6.1.4.1.9.9.109.1.2.3.1.12',
'cpmProcessMemoryCore' => '1.3.6.1.4.1.9.9.109.1.2.3.1.13',
'cpmProcessMemoryCoreDefinition' => 'CISCO-PROCESS-MIB::cpmProcessMemoryCore',
'cpmProcessLastRestartUser' => '1.3.6.1.4.1.9.9.109.1.2.3.1.14',
'cpmProcessTextSegmentSize' => '1.3.6.1.4.1.9.9.109.1.2.3.1.15',
'cpmProcessDataSegmentSize' => '1.3.6.1.4.1.9.9.109.1.2.3.1.16',
'cpmProcessStackSize' => '1.3.6.1.4.1.9.9.109.1.2.3.1.17',
'cpmProcessDynamicMemorySize' => '1.3.6.1.4.1.9.9.109.1.2.3.1.18',
'cpmProcExtMemAllocatedRevOvrflw' => '1.3.6.1.4.1.9.9.109.1.2.3.1.19',
'cpmProcExtHCMemAllocatedRev' => '1.3.6.1.4.1.9.9.109.1.2.3.1.20',
'cpmProcExtMemFreedRevOvrflw' => '1.3.6.1.4.1.9.9.109.1.2.3.1.21',
'cpmProcExtHCMemFreedRev' => '1.3.6.1.4.1.9.9.109.1.2.3.1.22',
'cpmProcessTextSegmentSizeOvrflw' => '1.3.6.1.4.1.9.9.109.1.2.3.1.23',
'cpmProcessHCTextSegmentSize' => '1.3.6.1.4.1.9.9.109.1.2.3.1.24',
'cpmProcessDataSegmentSizeOvrflw' => '1.3.6.1.4.1.9.9.109.1.2.3.1.25',
'cpmProcessHCDataSegmentSize' => '1.3.6.1.4.1.9.9.109.1.2.3.1.26',
'cpmProcessStackSizeOvrflw' => '1.3.6.1.4.1.9.9.109.1.2.3.1.27',
'cpmProcessHCStackSize' => '1.3.6.1.4.1.9.9.109.1.2.3.1.28',
'cpmProcessDynamicMemorySizeOvrflw' => '1.3.6.1.4.1.9.9.109.1.2.3.1.29',
'cpmProcessHCDynamicMemorySize' => '1.3.6.1.4.1.9.9.109.1.2.3.1.30',
'cpmCPUThresholdTable' => '1.3.6.1.4.1.9.9.109.1.2.4',
'cpmCPUThresholdEntry' => '1.3.6.1.4.1.9.9.109.1.2.4.1',
'cpmCPUThresholdClass' => '1.3.6.1.4.1.9.9.109.1.2.4.1.1',
'cpmCPUThresholdClassDefinition' => 'CISCO-PROCESS-MIB::cpmCPUThresholdClass',
'cpmCPURisingThresholdValue' => '1.3.6.1.4.1.9.9.109.1.2.4.1.2',
'cpmCPURisingThresholdPeriod' => '1.3.6.1.4.1.9.9.109.1.2.4.1.3',
'cpmCPUFallingThresholdValue' => '1.3.6.1.4.1.9.9.109.1.2.4.1.4',
'cpmCPUFallingThresholdPeriod' => '1.3.6.1.4.1.9.9.109.1.2.4.1.5',
'cpmCPUThresholdEntryStatus' => '1.3.6.1.4.1.9.9.109.1.2.4.1.6',
'cpmCPUHistory' => '1.3.6.1.4.1.9.9.109.1.2.5',
'cpmCPUHistoryThreshold' => '1.3.6.1.4.1.9.9.109.1.2.5.1',
'cpmCPUHistorySize' => '1.3.6.1.4.1.9.9.109.1.2.5.2',
'cpmCPUHistoryTable' => '1.3.6.1.4.1.9.9.109.1.2.5.3',
'cpmCPUHistoryEntry' => '1.3.6.1.4.1.9.9.109.1.2.5.3.1',
'cpmCPUHistoryReportId' => '1.3.6.1.4.1.9.9.109.1.2.5.3.1.1',
'cpmCPUHistoryReportSize' => '1.3.6.1.4.1.9.9.109.1.2.5.3.1.2',
'cpmCPUHistoryTotalUtil' => '1.3.6.1.4.1.9.9.109.1.2.5.3.1.3',
'cpmCPUHistoryInterruptUtil' => '1.3.6.1.4.1.9.9.109.1.2.5.3.1.4',
'cpmCPUHistoryCreatedTime' => '1.3.6.1.4.1.9.9.109.1.2.5.3.1.5',
'cpmCPUProcessHistoryTable' => '1.3.6.1.4.1.9.9.109.1.2.5.4',
'cpmCPUProcessHistoryEntry' => '1.3.6.1.4.1.9.9.109.1.2.5.4.1',
'cpmCPUProcessHistoryIndex' => '1.3.6.1.4.1.9.9.109.1.2.5.4.1.1',
'cpmCPUHistoryProcId' => '1.3.6.1.4.1.9.9.109.1.2.5.4.1.2',
'cpmCPUHistoryProcName' => '1.3.6.1.4.1.9.9.109.1.2.5.4.1.3',
'cpmCPUHistoryProcCreated' => '1.3.6.1.4.1.9.9.109.1.2.5.4.1.4',
'cpmCPUHistoryProcUtil' => '1.3.6.1.4.1.9.9.109.1.2.5.4.1.5',
'cpmThread' => '1.3.6.1.4.1.9.9.109.1.3',
'cpmThreadTable' => '1.3.6.1.4.1.9.9.109.1.3.1',
'cpmThreadEntry' => '1.3.6.1.4.1.9.9.109.1.3.1.1',
'cpmThreadID' => '1.3.6.1.4.1.9.9.109.1.3.1.1.1',
'cpmThreadName' => '1.3.6.1.4.1.9.9.109.1.3.1.1.2',
'cpmThreadPriority' => '1.3.6.1.4.1.9.9.109.1.3.1.1.3',
'cpmThreadState' => '1.3.6.1.4.1.9.9.109.1.3.1.1.4',
'cpmThreadStateDefinition' => 'CISCO-PROCESS-MIB::cpmThreadState',
'cpmThreadBlockingProcess' => '1.3.6.1.4.1.9.9.109.1.3.1.1.5',
'cpmThreadCpuUtilization' => '1.3.6.1.4.1.9.9.109.1.3.1.1.6',
'cpmThreadStackSize' => '1.3.6.1.4.1.9.9.109.1.3.1.1.7',
'cpmThreadStackSizeOvrflw' => '1.3.6.1.4.1.9.9.109.1.3.1.1.8',
'cpmThreadHCStackSize' => '1.3.6.1.4.1.9.9.109.1.3.1.1.9',
'cpmVirtualProcess' => '1.3.6.1.4.1.9.9.109.1.4',
'cpmVirtualProcessTable' => '1.3.6.1.4.1.9.9.109.1.4.1',
'cpmVirtualProcessEntry' => '1.3.6.1.4.1.9.9.109.1.4.1.1',
'cpmVirtualProcessID' => '1.3.6.1.4.1.9.9.109.1.4.1.1.1',
'cpmVirtualProcessName' => '1.3.6.1.4.1.9.9.109.1.4.1.1.2',
'cpmVirtualProcessUtil5Sec' => '1.3.6.1.4.1.9.9.109.1.4.1.1.3',
'cpmVirtualProcessUtil1Min' => '1.3.6.1.4.1.9.9.109.1.4.1.1.4',
'cpmVirtualProcessUtil5Min' => '1.3.6.1.4.1.9.9.109.1.4.1.1.5',
'cpmVirtualProcessMemAllocated' => '1.3.6.1.4.1.9.9.109.1.4.1.1.6',
'cpmVirtualProcessMemFreed' => '1.3.6.1.4.1.9.9.109.1.4.1.1.7',
'cpmVirtualProcessInvokeCount' => '1.3.6.1.4.1.9.9.109.1.4.1.1.8',
'cpmVirtualProcessRuntime' => '1.3.6.1.4.1.9.9.109.1.4.1.1.9',
'cpmVirtualProcessMemAllocatedOvrflw' => '1.3.6.1.4.1.9.9.109.1.4.1.1.10',
'cpmVirtualProcessHCMemAllocated' => '1.3.6.1.4.1.9.9.109.1.4.1.1.11',
'cpmVirtualProcessMemFreedOvrflw' => '1.3.6.1.4.1.9.9.109.1.4.1.1.12',
'cpmVirtualProcessHCMemFreed' => '1.3.6.1.4.1.9.9.109.1.4.1.1.13',
'ciscoProcessMIBNotifPrefix' => '1.3.6.1.4.1.9.9.109.2',
'ciscoProcessMIBNotifs' => '1.3.6.1.4.1.9.9.109.2.0',
'ciscoProcessMIBConformance' => '1.3.6.1.4.1.9.9.109.3',
'cpmCompliances' => '1.3.6.1.4.1.9.9.109.3.1',
'cpmGroups' => '1.3.6.1.4.1.9.9.109.3.2',
};
$Monitoring::GLPlugin::SNMP::MibsAndOids::definitions->{'CISCO-PROCESS-MIB'} = {
'cpmThreadState' => {
'1' => 'other',
'2' => 'dead',
'3' => 'running',
'4' => 'ready',
'5' => 'stopped',
'6' => 'send',
'7' => 'receive',
'8' => 'reply',
'9' => 'stack',
'10' => 'waitpage',
'11' => 'sigsuspend',
'12' => 'sigwaitinfo',
'13' => 'nanosleep',
'14' => 'mutex',
'15' => 'condvar',
'16' => 'join',
'17' => 'intr',
'18' => 'sem',
},
'cpmProcExtPriority' => {
'1' => 'critical',
'2' => 'high',
'3' => 'normal',
'4' => 'low',
'5' => 'notAssigned',
},
'cpmProcExtPriorityRev' => {
'1' => 'critical',
'2' => 'high',
'3' => 'normal',
'4' => 'low',
'5' => 'notAssigned',
},
'cpmProcessType' => {
'1' => 'other',
'2' => 'posix',
'3' => 'ios',
},
'cpmProcessMemoryCore' => {
'1' => 'other',
'2' => 'mainmem',
'3' => 'mainmemSharedmem',
'4' => 'mainmemText',
'5' => 'mainmemTextSharedmem',
'6' => 'sharedmem',
'7' => 'sparse',
'8' => 'off',
},
'cpmCPUThresholdClass' => {
'1' => 'total',
'2' => 'interrupt',
'3' => 'process',
},
};
| 49.824561 | 82 | 0.589437 |
73e49c5710b62e4113feadd48905c910aec5d588 | 2,642 | pm | Perl | Slim/Plugin/RandomPlay/DontStopTheMusic.pm | justifiably/slimserver | 6a6440dc801e31915ec04df28e4c1494ec121931 | [
"BSD-3-Clause"
]
| null | null | null | Slim/Plugin/RandomPlay/DontStopTheMusic.pm | justifiably/slimserver | 6a6440dc801e31915ec04df28e4c1494ec121931 | [
"BSD-3-Clause"
]
| null | null | null | Slim/Plugin/RandomPlay/DontStopTheMusic.pm | justifiably/slimserver | 6a6440dc801e31915ec04df28e4c1494ec121931 | [
"BSD-3-Clause"
]
| null | null | null | package Slim::Plugin::RandomPlay::DontStopTheMusic;
# Originally written by Kevin Deane-Freeman (slim-mail (A_t) deane-freeman.com).
# New world order by Dan Sully - <dan | at | slimdevices.com>
# Fairly substantial rewrite by Max Spicer
# This code is derived from code with the following copyright message:
#
# Logitech Media Server Copyright 2005-2019 Logitech.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License,
# version 2.
use strict;
use Scalar::Util qw(blessed);
use URI::Escape qw(uri_escape_utf8);
use Slim::Plugin::DontStopTheMusic::Plugin;
use Slim::Plugin::RandomPlay::Plugin;
use Slim::Utils::Cache;
use Slim::Utils::Log;
use Slim::Utils::Prefs;
my $cache = Slim::Utils::Cache->new();
my $log = logger('plugin.randomplay');
my $prefs = preferences('plugin.randomplay');
sub init {
Slim::Plugin::DontStopTheMusic::Plugin->registerHandler('PLUGIN_RANDOM_TITLEMIX_WITH_GENRES', sub {
mixWithGenres('track', @_);
});
Slim::Plugin::DontStopTheMusic::Plugin->registerHandler('PLUGIN_RANDOM_TRACK', sub {
my ($client, $cb) = @_;
$client->execute(['randomplaygenreselectall', 0]);
$cb->($client, ['randomplay://track']);
});
Slim::Plugin::DontStopTheMusic::Plugin->registerHandler('PLUGIN_RANDOM_ALBUM_MIX_WITH_GENRES', sub {
mixWithGenres('album', @_);
});
Slim::Plugin::DontStopTheMusic::Plugin->registerHandler('PLUGIN_RANDOM_ALBUM_ITEM', sub {
my ($client, $cb) = @_;
$client->execute(['randomplaygenreselectall', 0]);
$cb->($client, ['randomplay://album']);
});
Slim::Plugin::DontStopTheMusic::Plugin->registerHandler('PLUGIN_RANDOM_CONTRIBUTOR_ITEM', sub {
my ($client, $cb) = @_;
$client->execute(['randomplaygenreselectall', 0]);
$cb->($client, ['randomplay://contributor']);
});
Slim::Plugin::DontStopTheMusic::Plugin->registerHandler('PLUGIN_RANDOM_YEAR_ITEM', sub {
my ($client, $cb) = @_;
$client->execute(['randomplaygenreselectall', 0]);
$cb->($client, ['randomplay://year']);
});
}
sub mixWithGenres {
my ($type, $client, $cb) = @_;
return unless $client;
my %genres;
foreach my $track (@{ Slim::Player::Playlist::playList($client) }) {
if (!blessed $track) {
$track = Slim::Schema->objectForUrl($track);
}
next unless blessed $track;
if ( $track->remote ) {
$genres{$track->genre}++ if $track->genre;
}
else {
foreach ( $track->genres ) {
$genres{$_->name}++
}
}
}
my $genres = '';
if (keys %genres) {
$genres = '?genres=' . join(',', map {
uri_escape_utf8($_);
} keys %genres);
}
$cb->($client, ['randomplay://' . $type . $genres]);
}
1; | 27.520833 | 101 | 0.677517 |
ed0de500241113f3794cea5249c96187d4d9fbd3 | 6,576 | t | Perl | demo/stereo_core.t | jameshegarty/rigel | 63bae94d8f2df675e0e36d1416f3f10c0b607368 | [
"MIT"
]
| 56 | 2016-07-27T01:23:42.000Z | 2022-03-20T08:22:54.000Z | demo/stereo_core.t | jameshegarty/rigel | 63bae94d8f2df675e0e36d1416f3f10c0b607368 | [
"MIT"
]
| 87 | 2017-04-01T00:35:37.000Z | 2019-09-17T19:11:00.000Z | demo/stereo_core.t | jameshegarty/rigel | 63bae94d8f2df675e0e36d1416f3f10c0b607368 | [
"MIT"
]
| 7 | 2016-12-08T03:05:07.000Z | 2019-11-08T04:29:14.000Z | local R = require "rigel"
local RM = require "modules"
local types = require "types"
local S = require "systolic"
local C = require "examplescommon"
-- This function is used to select and format the output we want to display to the user
-- (either the index, or SAD value)
local function displayOutput(TRESH)
assert(type(TRESH)=="number")
local ITYPE = types.tuple{types.uint(8),types.uint(16)}
local OTYPE = types.array2d(types.uint(8),1)
local inp = S.parameter( "inp", ITYPE )
local out = S.cast(S.tuple{S.index(inp,0)},OTYPE)
if TRESH~=0 then
local reduceType = types.uint(16)
out = S.cast(S.tuple{S.select(S.gt(S.index(inp,1),S.constant(TRESH,reduceType)),S.constant(0,types.uint(8)),S.index(inp,0))},OTYPE)
end
return RM.lift("displayOutput",ITYPE, OTYPE, 0,
terra(a:&ITYPE:toTerraType(), out:&uint8[1])
@out = array(a._0)
if TRESH~=0 and a._1>TRESH then @out = array([uint8](0)) end
end, inp,
out
)
end
-- argmin expects type Stateful(A[2][SADWidth,SADWidth][SearchWindow])->StatefulV
-- which corresponds to [leftEye,rightEye]. rightEye should be the same window 'perCycleSearch' times. leftEye has the windows we're searching for the match in.
-- returns: Handshake{index,SADvalu@index} (valid every T cycles)
local function argmin( SearchWindow, SADWidth, OffsetX, X)
assert(type(SearchWindow)=="number")
assert(type(SADWidth)=="number")
assert(type(OffsetX)=="number")
assert(X==nil)
local A = types.uint(8)
local ITYPE = types.array2d( types.array2d( types.array2d(A,2), SADWidth, SADWidth ), SearchWindow )
local inp = R.input( ITYPE )
local idx = {}
for i=1,SearchWindow do
-- index gives us the distance to the right hand side of the window
idx[i] = SearchWindow+OffsetX-(i-1)
end
local indices = R.constant( "convKernel", idx, types.array2d( types.uint(8), SearchWindow ) ) -- uint8[SearchWindow]
local sadout = R.apply("sadvalues", RM.map( C.SAD( A, types.uint(16), SADWidth ), SearchWindow), inp ) -- uint16[SearchWindow]
local packed = R.apply("SOS", C.SoAtoAoS( SearchWindow, 1, {types.uint(8), types.uint(16)} ), R.tuple("stup",{indices, sadout}) )
local AM = C.argmin(types.uint(8),types.uint(16))
local out = R.apply("argmin", RM.reduce(AM,SearchWindow,1),packed)
return RM.lambda("argmin", inp, out )
end
local function makeStereo(W,H,OffsetX,SearchWindow,SADWidth,NOSTALL,TRESH,X)
assert(type(W)=="number")
assert(type(SADWidth)=="number")
assert(type(NOSTALL)=="boolean")
assert(type(TRESH)=="number")
assert(X==nil)
local fifos = {}
local statements = {}
local A = types.uint(8)
local ATYPE = types.array2d(A,2)
local TYPE = types.array2d(ATYPE,4)
local STENCIL_TYPE = types.array2d(A,SADWidth,SADWidth)
local hsfninp = R.input( R.Handshake(TYPE) )
local LRTYPE = types.array2d(A,2)
local inp = R.apply("reducerate", RM.liftHandshake(RM.changeRate(LRTYPE,1,4,1)), hsfninp ) -- A[2][1]
local internalW, internalH = W+OffsetX+SearchWindow, H+SADWidth-1
local inp = R.apply("pad", RM.liftHandshake(RM.padSeq(LRTYPE, W, H, 1, OffsetX+SearchWindow, 0, 3, 4, {0,0})), inp)
local inp = R.apply("oi0", RM.makeHandshake(C.index(types.array2d(LRTYPE,1),0)), inp) -- A[2]
local inp_broadcast = R.apply("inp_broadcast", RM.broadcastStream(LRTYPE,2), inp)
-------------
local left = R.apply("left", RM.makeHandshake(C.index(types.array2d(A,2),0)), R.selectStream("i0",inp_broadcast,0) )
-- theoretically, the left and right branch may have the same delay, so may not need a fifo.
-- but, fifo one of the branches to be safe.
table.insert( fifos, R.instantiateRegistered("f1",RM.fifo(A,128)) )
table.insert( statements, R.applyMethod("s1",fifos[1],"store",left) )
left = R.applyMethod("l1",fifos[1],"load")
local left = R.apply("AO",RM.makeHandshake(C.arrayop(types.uint(8),1)),left)
local left = R.apply( "LB", RM.makeHandshake(C.stencilLinebuffer( types.uint(8), internalW, internalH, 1, -(SearchWindow+SADWidth+OffsetX)+2, 0, -SADWidth+1, 0 )), left)
local left = R.apply( "lslice", RM.makeHandshake(C.slice( types.array2d(types.uint(8),SearchWindow+SADWidth+OffsetX-1,SADWidth), 0, SearchWindow+SADWidth-2, 0, SADWidth-1)), left)
left = R.apply( "llb", RM.makeHandshake( C.unpackStencil( A, SADWidth, SADWidth, SearchWindow) ), left) -- A[SADWidth,SADWidth][SearchWindow]
--------
local right = R.apply("right", RM.makeHandshake( C.index(types.array2d(A,2),1)), R.selectStream("i1",inp_broadcast,1) )
table.insert( fifos, R.instantiateRegistered("f2",RM.fifo(A,128)) )
table.insert( statements, R.applyMethod( "s2", fifos[2], "store", right ) )
right = R.applyMethod("r1",fifos[#fifos],"load")
local right = R.apply("AOr", RM.makeHandshake( C.arrayop(types.uint(8),1)),right) -- uint8[1]
local right = R.apply( "rightLB", RM.makeHandshake( C.stencilLinebuffer( A, internalW, internalH, 1, -SADWidth+1, 0, -SADWidth+1, 0 )), right)
right = R.apply("rb", RM.makeHandshake( C.broadcast( STENCIL_TYPE, SearchWindow ) ), right ) -- A[SADWidth,SADWidth][SearchWindow]
-------
local merged = R.apply("merge", C.SoAtoAoSHandshake( SearchWindow, 1, {STENCIL_TYPE,STENCIL_TYPE} ), R.tuple("mtup",{left,right},false)) -- {A[SADWidth,SADWidth],A[SADWidth,SADWidth]}[SearchWindow]
local packStencils = C.SoAtoAoS( SADWidth, SADWidth, {A,A}, true ) -- {A[SADWidth,SADWidth],A[SADWidth,SADWidth]} to A[2][SADWidth,SADWidth]
local merged = R.apply("mer", RM.makeHandshake(RM.map(packStencils, SearchWindow) ), merged ) -- A[2][SADWidth, SADWidth][SearchWindow]
local res = R.apply("AM",RM.makeHandshake(argmin(SearchWindow,SADWidth,OffsetX)),merged) -- {uint8,uint16}
local res = R.apply("display",RM.makeHandshake(displayOutput(TRESH)), res)
-- FIFO to improve timing
if false then
else
local sz = 128
if NOSTALL then sz = 2048 end
table.insert( fifos, R.instantiateRegistered("f_timing",RM.fifo(types.array2d(types.uint(8),1),sz,NOSTALL)) )
table.insert( statements, R.applyMethod( "s_timing", fifos[#fifos], "store", res ) )
res = R.applyMethod("r_timing",fifos[#fifos],"load")
end
res = R.apply("CRP", RM.liftHandshake(RM.liftDecimate(RM.cropSeq(types.uint(8), internalW, internalH, 1, OffsetX+SearchWindow,0,SADWidth-1,0))), res)
local res = R.apply("incrate", RM.liftHandshake(RM.changeRate(types.uint(8),1,1,8)), res )
table.insert(statements,1,res)
local hsfn = RM.lambda( "hsfn", hsfninp, R.statements(statements), fifos )
return hsfn
end
return makeStereo | 48.352941 | 199 | 0.688412 |
73dd4bf3ba7fdfdc4b2bcde17a4e96b845cc7402 | 982 | t | Perl | t/normalize.t | Corion/BackPAN-Index | cf57139e46a6c1edebd8813aaa85e4368766a7a1 | [
"Artistic-1.0"
]
| 1 | 2016-05-08T22:43:07.000Z | 2016-05-08T22:43:07.000Z | t/normalize.t | Corion/BackPAN-Index | cf57139e46a6c1edebd8813aaa85e4368766a7a1 | [
"Artistic-1.0"
]
| 1 | 2016-05-27T16:39:46.000Z | 2016-05-27T16:39:46.000Z | t/normalize.t | Corion/BackPAN-Index | cf57139e46a6c1edebd8813aaa85e4368766a7a1 | [
"Artistic-1.0"
]
| 6 | 2015-05-09T11:39:03.000Z | 2022-03-06T18:46:55.000Z | #!/usr/bin/perl -w
use strict;
use warnings;
use lib 't/lib';
use TestUtils;
use Test::More;
my $b = new_backpan();
subtest "distribution name normalization" => sub {
my $v200 = $b->release("URIC", '2.00');
my $v201 = $b->release("URIC", '2.01');
my $v202 = $b->release("URIC", '2.02');
is $v200->filename, 'uri-2.00.tar.gz';
is $v200->distvname, 'uri-2.00';
is $v201->filename, 'uri-2.01.tar.gz';
is $v201->distvname, 'uri-2.01';
is $v202->filename, 'URIC-2.02.tar.gz';
is $v202->distvname, 'URIC-2.02';
for my $release ($v200, $v201, $v202) {
is $release->dist, 'URIC', $release->path." has been normalized";
}
};
subtest "per release dist normalization" => sub {
my $release = $b->release("Bi", '0.01');
is $release->filename, '-0.01.tar.gz';
is $release->cpanid, 'MARCEL';
is $release->dist, 'Bi';
is $release->version, '0.01';
is $release->distvname,'Bi-0.01';
};
done_testing;
| 22.318182 | 73 | 0.57332 |
73dbf000490b6b1516af946e031803f41251b2bb | 1,355 | pm | Perl | auto-lib/Paws/AutoScaling/Alarm.pm | galenhuntington/aws-sdk-perl | 13b775dcb5f0b3764f0a82f3679ed5c7721e67d3 | [
"Apache-2.0"
]
| null | null | null | auto-lib/Paws/AutoScaling/Alarm.pm | galenhuntington/aws-sdk-perl | 13b775dcb5f0b3764f0a82f3679ed5c7721e67d3 | [
"Apache-2.0"
]
| 1 | 2021-05-26T19:13:58.000Z | 2021-05-26T19:13:58.000Z | auto-lib/Paws/AutoScaling/Alarm.pm | galenhuntington/aws-sdk-perl | 13b775dcb5f0b3764f0a82f3679ed5c7721e67d3 | [
"Apache-2.0"
]
| null | null | null | package Paws::AutoScaling::Alarm;
use Moose;
has AlarmARN => (is => 'ro', isa => 'Str');
has AlarmName => (is => 'ro', isa => 'Str');
1;
### main pod documentation begin ###
=head1 NAME
Paws::AutoScaling::Alarm
=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::AutoScaling::Alarm object:
$service_obj->Method(Att1 => { AlarmARN => $value, ..., AlarmName => $value });
=head3 Results returned from an API call
Use accessors for each attribute. If Att1 is expected to be an Paws::AutoScaling::Alarm object:
$result = $service_obj->Method(...);
$result->Att1->AlarmARN
=head1 DESCRIPTION
Describes an alarm.
=head1 ATTRIBUTES
=head2 AlarmARN => Str
The Amazon Resource Name (ARN) of the alarm.
=head2 AlarmName => Str
The name of the alarm.
=head1 SEE ALSO
This class forms part of L<Paws>, describing an object used in L<Paws::AutoScaling>
=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
| 21.507937 | 102 | 0.712915 |
73e0c41650712a2e55bb7ce886d3e23677a37ddb | 11,682 | pl | Perl | S32-io/IO-Socket-INET.pl | b2gills/roast | 4b689b3c9cc2642fdeb8176a24415ec1540f013f | [
"Artistic-2.0"
]
| null | null | null | S32-io/IO-Socket-INET.pl | b2gills/roast | 4b689b3c9cc2642fdeb8176a24415ec1540f013f | [
"Artistic-2.0"
]
| null | null | null | S32-io/IO-Socket-INET.pl | b2gills/roast | 4b689b3c9cc2642fdeb8176a24415ec1540f013f | [
"Artistic-2.0"
]
| null | null | null | # t/spec/S32-io/IO-Socket-INET.pl
# run by IO-Socket-INET.sh, which is run by IO-Socket-INET.t
# May 2009: script laden with commented out warnings that
# can be removed after stability of tests has been confirmed
# on multiple operating systems.
use v6;
constant PF_INET = 2; # these should move into a file,
constant SOCK_STREAM = 1; # but what name and directory?
constant TCP = 6;
my ( $test, $port, $server_or_client ) = @*ARGS;
$port = $port.Int;
my $host = '127.0.0.1';
my $server_ready_flag_fn = 't/spec/S32-io/server-ready-flag';
given $test {
when 2 { # test number 2 - echo protocol, RFC 862
if $server_or_client eq 'server' {
# warn "SERVER TEST=$test PORT=$port";
my $server = IO::Socket::INET.new(:localhost($host), :localport($port), :listen);
# warn "SERVER LISTENING";
my $fd = open( $server_ready_flag_fn, :w );
$fd.close();
while my $client = $server.accept() {
# warn "SERVER ACCEPTED";
my $received = $client.recv();
# warn "SERVER RECEIVED '$received'";
$client.print( $received );
# warn "SERVER REPLIED";
$client.close();
}
}
else { # $server_or_client eq 'client'
# warn "CLIENT TEST=$test PORT=$port";
# avoid a race condition, where the client tries to
# open() before the server gets to accept().
until $server_ready_flag_fn.IO ~~ :e { sleep(0.1) }
unlink $server_ready_flag_fn;
my $client = IO::Socket::INET.new(:$host, :$port);
# warn "CLIENT OPENED";
$client.print( [~] flat '0'..'9', 'a'..'z' );
# warn "CLIENT SENT";
my $received = $client.recv();
# warn "CLIENT RECEIVED '$received'";
# let IO-Socket-INET.t judge the pass/fail
say "echo '$received' received";
$client.close();
}
}
when 3 { # test number 3 - discard protocol, RFC 863
if $server_or_client eq 'server' {
# warn "SERVER TEST=$test PORT=$port";
my $server = IO::Socket::INET.new(:localhost($host), :localport($port), :listen);
my $fd = open( $server_ready_flag_fn, :w );
$fd.close();
# warn "SERVER LISTENING";
while my $client = $server.accept() {
# warn "SERVER ACCEPTED";
my $received = $client.recv();
# warn "SERVER RECEIVED '$received'";
$client.close(); # without sending anything back
}
}
else { # $server_or_client eq 'client'
# warn "CLIENT TEST=$test PORT=$port";
until $server_ready_flag_fn.IO ~~ :e { sleep(0.1) }
unlink $server_ready_flag_fn;
my $client = IO::Socket::INET.new(:$host, :$port);
# warn "CLIENT OPENED";
$client.print( [~] flat '0'..'9', 'a'..'z' );
# warn "CLIENT SENT";
my $received = $client.recv();
# warn "CLIENT RECEIVED '$received'";
# let IO-Socket-INET.t judge the pass/fail
say "discard '$received' received";
$client.close();
}
}
when 4 { # test number 4 - recv with parameter
if $server_or_client eq 'server' {
my $server = IO::Socket::INET.new(:localhost($host), :localport($port), :listen);
my $fd = open( $server_ready_flag_fn, :w );
$fd.close();
while my $client = $server.accept() {
# Also sends two 3 byte unicode characters
$client.print(join '', '0'..'9', 'a'..'z',
chr(0xA001), chr(0xA002) );
$client.close();
}
}
else {
until $server_ready_flag_fn.IO ~~ :e { sleep(0.1) }
unlink $server_ready_flag_fn;
my $sock = IO::Socket::INET.new(:$host, :$port);
# Tests that if we do not receive all the data available
# it is buffered correctly for when we do request it
say $sock.recv(7); # 0123456
say $sock.recv(3); # 789
say $sock.recv(26); # a-z
# All is left are the two 3 byte characters
my $unifirst = $sock.recv(1);
say $unifirst;
say $unifirst.chars;
# get second character
my $unisecond = $sock.recv(1);
say $unisecond.chars;
# join it together
say $unisecond;
$sock.close();
}
}
when 5 { # test number 5 - get()
if $server_or_client eq 'server' {
my $server = IO::Socket::INET.new(:localhost($host), :localport($port), :listen);
my $fd = open($server_ready_flag_fn, :w);
$fd.close();
while my $client = $server.accept() {
# default line separator
use newline :lf;
$client.print("'Twas brillig, and the slithy toves\n");
$client.print("Did gyre and gimble in the wabe;\n");
# custom line separator: \r\n
$client.print("All mimsy were the borogoves,\r\n");
# another custom separator: .
$client.print("And the mome raths outgrabe.");
# separator not at the end of the sent data: !
$client.print("O frabjous day! Callooh! Callay!");
$client.close();
}
} else { # client
until $server_ready_flag_fn.IO ~~ :e { sleep(0.1) }
unlink $server_ready_flag_fn;
my $sock = IO::Socket::INET.new(:$host, :$port);
# Default separator should handle \n and \r\n
say $sock.get();
say $sock.get();
my $crlf-line = $sock.get();
say $crlf-line;
say $crlf-line.encode('ascii').elems;
$sock.nl-in = '.';
say $sock.get();
$sock.nl-in = '!';
say $sock.get();
say $sock.get(); # will begin
say $sock.get(); # with a space
$sock.close();
}
}
when 6 { # RT #116288, test number 6 - read with parameter
if $server_or_client eq 'server' {
my $server = IO::Socket::INET.new(:localhost($host), :localport($port), :listen);
my $fd = open( $server_ready_flag_fn, :w );
$fd.close();
while my $client = $server.accept() {
# send 4 packets á 4096 bytes
for ^4 {
$client.print( $_ x 4096 );
sleep 1;
}
$client.close();
}
}
else {
until $server_ready_flag_fn.IO ~~ :e { sleep(0.1) }
unlink $server_ready_flag_fn;
my $sock = IO::Socket::INET.new(:$host, :$port);
# .read will give us 16kB of data even it recvs several chunks of smaller size
my $collected = $sock.read( 4096 * 4 );
say $collected[0].chr;
say $collected[ 4096 * 4 - 1 ].chr;
say $collected.bytes;
$sock.close();
}
}
# for test 7 and 8
my Buf $binary = slurp( 't/spec/S32-io/socket-test.bin', bin => True );
when 7 { # test number 7 - write/read binary data
if $server_or_client eq 'server' {
my $server = IO::Socket::INET.new(:localhost($host), :localport($port), :listen);
my $fd = open( $server_ready_flag_fn, :w );
$fd.close();
if my $client = $server.accept() {
# send binary data á 4096 bytes
$client.write( $binary );
$client.close();
}
}
else {
until $server_ready_flag_fn.IO ~~ :e { sleep(0.1) }
unlink $server_ready_flag_fn;
my $sock = IO::Socket::INET.new(:$host, :$port);
my $recv = $sock.read( $binary.elems() );
say $binary eqv $recv ?? 'OK-7' !! 'NOK-7';
$sock.close();
}
}
when 8 { # test number 8 - write/recv binary data
if $server_or_client eq 'server' {
my $server = IO::Socket::INET.new(:localhost($host), :localport($port), :listen);
my $fd = open( $server_ready_flag_fn, :w );
$fd.close();
if my $client = $server.accept() {
# send binary data á 4096 bytes
$client.write( $binary );
$client.close();
}
}
else {
until $server_ready_flag_fn.IO ~~ :e { sleep(0.1) }
unlink $server_ready_flag_fn;
my $sock = IO::Socket::INET.new(:$host, :$port);
my Buf $recv = Buf.new;
my Buf $chunk;
# in binary mode it will return a Buf, not Str
while $chunk = $sock.recv( 4096, bin => True ) {
$recv ~= $chunk;
}
say $binary.elems eqv $recv.elems ?? 'OK-8' !! 'NOK-8';
$sock.close();
}
}
when 9 { # test number 9 - recv one byte at a time
if $server_or_client eq 'server' {
my $server = IO::Socket::INET.new(:localhost($host), :localport($port), :listen);
my $fd = open( $server_ready_flag_fn, :w );
$fd.close();
while my $client = $server.accept() {
# send 4 byte string in one packet
$client.print( 'xxxx' );
$client.close();
}
}
else {
until $server_ready_flag_fn.IO ~~ :e { sleep(0.1) }
unlink $server_ready_flag_fn;
my $sock = IO::Socket::INET.new(:$host, :$port);
# .read one byte at a time
my $collected = $sock.read( 1 );
$collected ~= $sock.read( 1 );
$collected ~= $sock.read( 1 );
$collected ~= $sock.read( 1 );
say $collected[0].chr;
say $collected[3].chr;
say $collected.bytes;
$sock.close();
}
}
when 10 { # test number 10 - echo protocol, RFC 862, with connect/listen methods
if $server_or_client eq 'server' {
# warn "SERVER TEST=$test PORT=$port";
my $server = IO::Socket::INET.listen($host, $port);
# warn "SERVER LISTENING";
my $fd = open( $server_ready_flag_fn, :w );
$fd.close();
while my $client = $server.accept() {
# warn "SERVER ACCEPTED";
my $received = $client.recv();
# warn "SERVER RECEIVED '$received'";
$client.print( $received );
# warn "SERVER REPLIED";
$client.close();
}
}
else { # $server_or_client eq 'client'
# warn "CLIENT TEST=$test PORT=$port";
# avoid a race condition, where the client tries to
# open() before the server gets to accept().
until $server_ready_flag_fn.IO ~~ :e { sleep(0.1) }
unlink $server_ready_flag_fn;
my $client = IO::Socket::INET.connect($host, $port);
# warn "CLIENT OPENED";
$client.print( [~] flat '0'..'9', 'a'..'z' );
# warn "CLIENT SENT";
my $received = $client.recv();
# warn "CLIENT RECEIVED '$received'";
# let IO-Socket-INET.t judge the pass/fail
say "echo '$received' received";
$client.close();
}
}
}
=begin pod
=end pod
| 39.070234 | 93 | 0.491183 |
ed41196add0edc57e6d911c288099692092f01f4 | 474 | t | Perl | t/001basic/093refs-fnptr.t | ChengCat/dale | 4a764895611679cd1670d9a43ffdbee136661759 | [
"BSD-3-Clause"
]
| 1,083 | 2015-03-18T09:42:49.000Z | 2022-03-29T03:17:47.000Z | t/001basic/093refs-fnptr.t | ChengCat/dale | 4a764895611679cd1670d9a43ffdbee136661759 | [
"BSD-3-Clause"
]
| 195 | 2015-01-04T03:06:41.000Z | 2022-03-18T18:16:27.000Z | t/001basic/093refs-fnptr.t | ChengCat/dale | 4a764895611679cd1670d9a43ffdbee136661759 | [
"BSD-3-Clause"
]
| 56 | 2015-03-18T20:02:13.000Z | 2022-01-22T19:35:27.000Z | #!/usr/bin/env perl
use warnings;
use strict;
$ENV{"DALE_TEST_ARGS"} ||= "";
my $test_dir = $ENV{"DALE_TEST_DIR"} || ".";
$ENV{PATH} .= ":.";
use Data::Dumper;
use Test::More tests => 3;
my @res = `dalec $ENV{"DALE_TEST_ARGS"} $test_dir/t/src/refs-fnptr.dt -o refs-fnptr`;
is(@res, 0, 'No compilation errors');
@res = `./refs-fnptr`;
is($?, 0, 'Program executed successfully');
chomp for @res;
is_deeply(\@res, [
'100'
], 'Got expected results');
`rm refs-fnptr`;
1;
| 18.230769 | 85 | 0.624473 |
ed4c8da1b59a290fe779a7a957018c0ae8ff87a6 | 2,681 | pl | Perl | tcp_and_proxy/tcprdr.pl | mmmonk/crap | 96ba81723f043503e7ed2f96ea727b524d22b83f | [
"MIT"
]
| 14 | 2015-01-14T15:53:22.000Z | 2019-06-21T06:15:47.000Z | tcp_and_proxy/tcprdr.pl | mmmonk/crap | 96ba81723f043503e7ed2f96ea727b524d22b83f | [
"MIT"
]
| 1 | 2018-04-01T08:40:17.000Z | 2020-06-24T10:05:33.000Z | tcp_and_proxy/tcprdr.pl | mmmonk/crap | 96ba81723f043503e7ed2f96ea727b524d22b83f | [
"MIT"
]
| 12 | 2015-05-13T10:52:04.000Z | 2020-10-07T14:49:37.000Z | #!/usr/bin/perl
# $Id$
#use warnings;
use strict;
use Socket;
use POSIX qw(setuid setgid setsid);
die "Only r00t can run this script\n" if ($> != 0);
sub logwr;
my $uid=getpwnam('nobody');
my $gid=getgrnam('nobody');
logwr("changing dir to /");
chdir("/");
#my $chroot="/var/tmp";
#logwr("chroot to $chroot");
#chroot $chroot or die "$!";
my $sin = sockaddr_in (443,&INADDR_ANY);
socket(sock,&AF_INET,&SOCK_STREAM,getprotobyname('tcp')) or die "socket: $!";
bind(sock,$sin) or die "bind: $!";
listen(sock,5) or die "listen: $!";
logwr("droping privilges to user=nobody, uid=$uid, group=nobody, gid=$gid");
setgid($gid) or die "Can't setgid: $!";
setuid($uid) or die "Can't setuid: $!";
logwr("redirecting STDIN and STDOUT to /dev/null");
open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
open STDOUT, '>/dev/null' or die "Can't write to /dev/null: $!";
logwr("becoming a deamon");
defined(my $pid = fork) or die "Can't fork: $!";
if ($pid){
logwr("PID:$pid");
exit;
}
setsid;
while ( 1 ){
my $addr;
($addr = accept(peer,sock)) or die "accept: $!";
if ( fork ){
next;
}else{
my $dat;
my $datnr=sysread peer, $dat, 500;
my @rdrp;
if ( $dat =~/^testssh/ ){
@rdrp=("127.0.0.1","22");
}else{
@rdrp=("127.0.0.1","80");
}
my ($peerport,$peeraddr)=sockaddr_in($addr);
my $sin = sockaddr_in ($rdrp[1],inet_aton($rdrp[0]));
socket(rdr,&AF_INET,&SOCK_STREAM,getprotobyname('tcp')) or die "socket: $!";
connect(rdr,$sin) or die "connect: $!";
unless ($rdrp[0] eq "127.0.0.1" and $rdrp[1] eq "22"){
syswrite rdr,$dat,$datnr;
}
logwr("O ".inet_ntoa($peeraddr).":".$peerport." > ".$rdrp[0].":".$rdrp[1]);
if ( my $pid = fork ) {
my $data;
while ( 1 ) {
my $bl = sysread peer, $data, 1300;
if ( not $bl ) {
shutdown(rdr,&SHUT_RDWR);
shutdown(peer,&SHUT_RDWR);
exit 0;
}
syswrite rdr, $data, $bl;
}
}else{
my $data;
while ( 1 ) {
my $bl = sysread rdr, $data, 1300;
if ( not $bl ) {
logwr("C ".inet_ntoa($peeraddr).":".$peerport." > ".$rdrp[0].":".$rdrp[1]);
exit 0;
}
syswrite peer, $data, $bl;
}
}
exit 0;
}
}
shutdown(sock,&SHUT_RDWR);
sub timer{
my ($sec,$min,$hour,$mday,$mon);
my @abbr = qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec );
($sec,$min,$hour,$mday,$mon,undef,undef,undef,undef) = localtime(time);
$mon=$abbr[$mon];
$sec="0$sec" if ($sec < 10);
$min="0$min" if ($min < 10);
$hour="0$hour" if ($hour < 10);
$mday=" $mday" if $mday < 10;
my $ret="$mon $mday $hour:$min:$sec";
return $ret;
}
sub logwr{
my $ts=timer();
my $msg=shift;
warn "$ts tcprdr: $msg\n";
}
| 21.796748 | 80 | 0.569191 |
73fa47e8ce86441889e8969484ef4b6dcbf1c2d6 | 642 | pm | Perl | Chj/Net/Server/ConnectionHandlerBase.pm | pflanze/chj-perllib | 910dfb1c4b531ec02d9d6d554a1ad544c5776d7c | [
"MIT"
]
| null | null | null | Chj/Net/Server/ConnectionHandlerBase.pm | pflanze/chj-perllib | 910dfb1c4b531ec02d9d6d554a1ad544c5776d7c | [
"MIT"
]
| null | null | null | Chj/Net/Server/ConnectionHandlerBase.pm | pflanze/chj-perllib | 910dfb1c4b531ec02d9d6d554a1ad544c5776d7c | [
"MIT"
]
| null | null | null | # Sun Sep 23 17:53:13 2007 Christian Jaeger, christian at jaeger mine nu
#
# Copyright 2007 by Christian Jaeger
# Published under the same terms as perl itself
#
# $Id$
=head1 NAME
Chj::Net::Server::ConnectionHandlerBase
=head1 SYNOPSIS
=head1 DESCRIPTION
Must be completed with a handle_connection method.
=cut
package Chj::Net::Server::ConnectionHandlerBase;
use strict;
use Class::Array -fields=>
-publica=>
#'connectionclass', # parent. ? nope?
'handler', # object/class with handle_connection method
;
sub new {
my $class=shift;
my $s= $class->SUPER::new;
(@$s[Handler])=@_;
$s
}
end Class::Array;
| 16.05 | 73 | 0.693146 |
73d20a0aee6ac4ab0340519aafa1a6fe0ae06cfc | 1,116 | t | Perl | S12-methods/delegation.t | perl6/roast | 30e8226c1a0562b9364ee9ea2730763374d79a3d | [
"Artistic-2.0"
]
| 99 | 2015-03-03T13:01:44.000Z | 2020-03-05T15:21:43.000Z | S12-methods/delegation.t | perl6/roast | 30e8226c1a0562b9364ee9ea2730763374d79a3d | [
"Artistic-2.0"
]
| 331 | 2015-02-17T15:26:22.000Z | 2020-03-16T18:29:49.000Z | S12-methods/delegation.t | perl6/roast | 30e8226c1a0562b9364ee9ea2730763374d79a3d | [
"Artistic-2.0"
]
| 136 | 2015-02-02T13:34:10.000Z | 2020-02-18T02:26:59.000Z | use v6;
use Test;
plan 7;
class A {
method Str() handles 'uc' {
'test';
}
method Num() handles <sqrt floor> {
4e0;
}
method Int() handles 'base' {
255
}
}
my $a = A.new;
is $a.uc, 'TEST', 'simple method delegation';
is-approx $a.sqrt, 2, 'delegation to multiple names (1)';
is $a.floor, 4, 'delegation to multiple names (2)';
is $a.base(16), 'FF', 'delegation and arguments';
is A.base(16), 'FF', '... same with type object invocant';
{
role R {
method foo { self.bar(42) };
method bar($x) { $x };
};
class C does R {
method foo { self.R::foo };
};
is C.new.foo, 42, 'role method calls works through role delegation independent of declaration order.';
role Rr {
method bar($x) { $x };
method foo { self.bar(42) };
};
class Cc does Rr {
method foo { self.Rr::foo };
};
is Cc.new.foo, 42, 'role method calls works through role delegation independent of declaration order.';
}
# vim: expandtab shiftwidth=4
| 22.32 | 107 | 0.531362 |
ed293283528e7ea43f402306af5e68e067fca58b | 4,931 | pm | Perl | lib/Template/Mojo.pm | tadzik/Template-Mojo | 3d38f92636a0c44dfd4cec2e7b8b67f12e43c026 | [
"MIT"
]
| 5 | 2015-02-07T01:09:15.000Z | 2020-01-16T19:24:25.000Z | lib/Template/Mojo.pm | tadzik/Template-Mojo | 3d38f92636a0c44dfd4cec2e7b8b67f12e43c026 | [
"MIT"
]
| 18 | 2015-02-01T14:37:20.000Z | 2020-12-24T10:53:23.000Z | lib/Template/Mojo.pm | tadzik/Template-Mojo | 3d38f92636a0c44dfd4cec2e7b8b67f12e43c026 | [
"MIT"
]
| 17 | 2015-03-01T23:48:15.000Z | 2021-03-07T14:32:41.000Z | use MONKEY-SEE-NO-EVAL;
grammar Template::Mojo::Grammar {
token TOP {
^ <expression>* $
}
token expression {
|| <perlline>
|| <perlcapture-begin>
|| <perlcapture-end>
|| <perlexpr>
|| <characters>
}
token perlline {
^^ \h* '%' $<get-result>=['=']? $<expr>=[ <-[\n]>* ] [\n | $]
}
rule perlcapture-begin {
'<%' 'my' $<name>=<var> '=' 'begin' '%>'
}
rule perlcapture-end {
'<%' 'end' '%>'
}
token perlexpr {
'<%' $<get-result>=['=']? $<expr>=[ [ <!before '%>' > . ]* ] '%>'
}
token var {
<sigil> [ \w+ ]
}
token sigil {
'&' | '$'
}
token characters {
\n | [ <!before '<%' || \n > . ]+ \n?
}
}
class Template::Mojo::Actions {
method TOP($/) {
my @exprs = $<expression>».ast;
@exprs.unshift: 'my $_M = "";';
@exprs.push: ';return $_M;';
my $code = 'sub ' ~ $*TMPLNAME ~ ' { ' ~ @exprs.join ~ '}';
make $code;
}
method expression($/) {
if $<perlline> {
make $<perlline>.ast
}
elsif $<perlcapture-begin> {
make $<perlcapture-begin>.ast
}
elsif $<perlcapture-end> {
make $<perlcapture-end>.ast
}
elsif $<perlexpr> {
make $<perlexpr>.ast
}
else {
make sprintf q[;$_M ~= '%s';],
$<characters>.Str.subst(/"'"/, "\\'", :g)
}
}
method perlline($/) {
make expr($/) ~ "\n"
}
method perlcapture-begin($/) {
make 'my ' ~ $<name> ~ ' = sub {temp $_M = "";';
}
method perlcapture-end($/) {
make ';return $_M};';
}
method perlexpr($/) {
make expr($/)
}
sub expr($/) {
if $<expr> ne '' {
if $<get-result> ne '' {
return ';$_M ~= ' ~ $<expr> ~ ';'
}
else {
return $<expr>.Str
}
}
else {
return ''
}
}
}
class X::Template::Mojo::ParseError is Exception {
}
my $*TMPLNAME = "anon";
class Template::Mojo {
has &.code;
method from-file(Str $filename) {
my $tmpl = $filename.IO.slurp;
self.new($tmpl, name => $filename.IO.basename.split(".")[0]);
}
method new(Str $tmpl, :$name = "anon") {
my $*TMPLNAME = $name;
my $m = Template::Mojo::Grammar.parse(
$tmpl, :actions(Template::Mojo::Actions.new)
);
unless $m {
die X::Template::Mojo::ParseError.new(message => "Failed to parse the template")
}
self.bless: :code(EVAL $m.ast)
}
method render(*@a, *%a) {
&.code.(|@a, |%a)
}
}
=begin pod
=TITLE class Template::Mojo
A templating system modeled after the Perl 5 L<https://metacpan.org/module/Mojo::Template>
=head1 Synopsis
my $tmpl = slurp 'eg/template.tm';
my $t = Template::Mojo.new($tmpl);
$t.render()
my $ot = Template::Mojo.from-file('eg/template.tm');
=head1 Examples
=head2 Loop
=head3 Template
% for 1..3 {
hello
% }
=head3 Code
my $tmpl = slurp 'eg/template.tm';
my $t = Template::Mojo.new($tmpl);
$t.render()
=head3 Output
hello
hello
hello
=head2 Parameters
=head3 Template
% my ($x) = @_;
<%= $x %>
% for 1..$x {
hello
% }
See, on the first row of the template we accept a parameter as if this was a generic function call. Then we use the veriable in two different ways.
=head3 Code
The value to that subroutione can be passed in the render call:
my $tmpl = slurp 'eg/template.tm';
my $t = Template::Mojo.new($tmpl);
$t.render(5)
=head3 Output:
5
hello
hello
hello
hello
hello
=head2 Passing hash
=head3 Template
% my ($x) = @_;
Fname: <%= $x<fname> %>
Lname: <%= $x<lname> %>
=head3 Code
my %params = (
fname => 'Foo',
lname => 'Bar',
);
my $tmpl = slurp 'eg/template.tm';
my $t = Template::Mojo.new($tmpl);
$t.render(%params)
=head3 Output
Fname: Foo
Lname: Bar
=head2 Complex examples
=head3 Template
% my (%h) = @_;
<h1><%= %h<title> %>
<ul>
% for %h<pages>.values -> $p {
<li><a href="<%= $p<url> %>"><%= $p<title> %></a></li>
% }
</ul>
=head3 Code
my %params = (
title => "Perl 6 Links",
pages => [
{
"title" => "Rakudo",
"url" => "http://rakudo.org/",
},
{
title => 'Perl 6',
url => 'http://perl6.org/',
}
],
);
my $tmpl = slurp 'eg/template.tm';
my $t = Template::Mojo.new($tmpl);
$t.render(%params)
=head3 Output
<h1>Perl 6 Links
<ul>
<li><a href="http://rakudo.org/">Rakudo</a></li>
<li><a href="http://perl6.org/">Perl 6</a></li>
</ul>
=head1 Copyright
Tadeusz Sośnierz
=end pod
| 17.801444 | 147 | 0.472115 |
73e79b43db5eaf81e85cab20e9432436cc776f45 | 16,868 | pm | Perl | lib/Mojo/IOLoop.pm | Acidburn0zzz/mojo | 2f8f742595e22c6cdd321a84163235bb4f3e07d8 | [
"Artistic-2.0"
]
| 1 | 2017-07-17T07:31:52.000Z | 2017-07-17T07:31:52.000Z | lib/Mojo/IOLoop.pm | Acidburn0zzz/mojo | 2f8f742595e22c6cdd321a84163235bb4f3e07d8 | [
"Artistic-2.0"
]
| null | null | null | lib/Mojo/IOLoop.pm | Acidburn0zzz/mojo | 2f8f742595e22c6cdd321a84163235bb4f3e07d8 | [
"Artistic-2.0"
]
| null | null | null | package Mojo::IOLoop;
use Mojo::Base -base;
# "Professor: Amy, technology isn't intrinsically good or evil. It's how it's
# used. Like the death ray."
use Carp 'croak';
use Mojo::IOLoop::Client;
use Mojo::IOLoop::Delay;
use Mojo::IOLoop::Server;
use Mojo::IOLoop::Stream;
use Mojo::Reactor::Poll;
use Mojo::Util qw(md5_sum steady_time);
use Scalar::Util qw(blessed weaken);
use constant DEBUG => $ENV{MOJO_IOLOOP_DEBUG} || 0;
has accept_interval => 0.025;
has [qw(lock unlock)];
has max_accepts => 0;
has max_connections => 1000;
has multi_accept => 50;
has reactor => sub {
my $class = Mojo::Reactor::Poll->detect;
warn "-- Reactor initialized ($class)\n" if DEBUG;
my $reactor = $class->new;
$reactor->on(error => sub { warn "@{[blessed $_[0]]}: $_[1]" });
return $reactor;
};
# Ignore PIPE signal
$SIG{PIPE} = 'IGNORE';
# Initialize singleton reactor early
__PACKAGE__->singleton->reactor;
sub acceptor {
my ($self, $acceptor) = (_instance(shift), @_);
# Find acceptor for id
return $self->{acceptors}{$acceptor} unless ref $acceptor;
# Connect acceptor with reactor
my $id = $self->_id;
$self->{acceptors}{$id} = $acceptor;
weaken $acceptor->reactor($self->reactor)->{reactor};
$self->{accepts} = $self->max_accepts if $self->max_accepts;
# Allow new acceptor to get picked up
$self->_not_accepting;
return $id;
}
sub client {
my ($self, $cb) = (_instance(shift), pop);
# Make sure timers are running
$self->_recurring;
my $id = $self->_id;
my $client = $self->{connections}{$id}{client} = Mojo::IOLoop::Client->new;
weaken $client->reactor($self->reactor)->{reactor};
weaken $self;
$client->on(
connect => sub {
delete $self->{connections}{$id}{client};
my $stream = Mojo::IOLoop::Stream->new(pop);
$self->_stream($stream => $id);
$self->$cb(undef, $stream);
}
);
$client->on(
error => sub {
$self->_remove($id);
$self->$cb(pop, undef);
}
);
$client->connect(@_);
return $id;
}
sub delay {
my $delay = Mojo::IOLoop::Delay->new;
weaken $delay->ioloop(_instance(shift))->{ioloop};
return @_ ? $delay->steps(@_) : $delay;
}
sub generate_port { Mojo::IOLoop::Server->generate_port }
sub is_running { _instance(shift)->reactor->is_running }
sub next_tick { _instance(shift)->reactor->next_tick(@_) }
sub one_tick { _instance(shift)->reactor->one_tick }
sub recurring { shift->_timer(recurring => @_) }
sub remove {
my ($self, $id) = (_instance(shift), @_);
my $c = $self->{connections}{$id};
if ($c && (my $stream = $c->{stream})) { return $stream->close_gracefully }
$self->_remove($id);
}
sub server {
my ($self, $cb) = (_instance(shift), pop);
my $server = Mojo::IOLoop::Server->new;
weaken $self;
$server->on(
accept => sub {
my $stream = Mojo::IOLoop::Stream->new(pop);
$self->$cb($stream, $self->stream($stream));
}
);
$server->listen(@_);
return $self->acceptor($server);
}
sub singleton { state $loop = shift->SUPER::new }
sub start {
my $self = shift;
croak 'Mojo::IOLoop already running' if $self->is_running;
_instance($self)->reactor->start;
}
sub stop { _instance(shift)->reactor->stop }
sub stream {
my ($self, $stream) = (_instance(shift), @_);
# Find stream for id
return ($self->{connections}{$stream} || {})->{stream} unless ref $stream;
# Release accept mutex
$self->_not_accepting;
# Enforce connection limit (randomize to improve load balancing)
$self->max_connections(0)
if defined $self->{accepts} && ($self->{accepts} -= int(rand 2) + 1) <= 0;
return $self->_stream($stream, $self->_id);
}
sub timer { shift->_timer(timer => @_) }
sub _accepting {
my $self = shift;
# Check if we have acceptors
my $acceptors = $self->{acceptors} ||= {};
return $self->_remove(delete $self->{accept}) unless keys %$acceptors;
# Check connection limit
my $i = keys %{$self->{connections}};
my $max = $self->max_connections;
return unless $i < $max;
# Acquire accept mutex
if (my $cb = $self->lock) { return unless $self->$cb(!$i) }
$self->_remove(delete $self->{accept});
# Check if multi-accept is desirable
my $multi = $self->multi_accept;
$_->multi_accept($max < $multi ? 1 : $multi)->start for values %$acceptors;
$self->{accepting}++;
}
sub _id {
my $self = shift;
my $id;
do { $id = md5_sum('c' . steady_time . rand 999) }
while $self->{connections}{$id} || $self->{acceptors}{$id};
return $id;
}
sub _instance { ref $_[0] ? $_[0] : $_[0]->singleton }
sub _not_accepting {
my $self = shift;
# Make sure timers are running
$self->_recurring;
# Release accept mutex
return unless delete $self->{accepting};
return unless my $cb = $self->unlock;
$self->$cb;
$_->stop for values %{$self->{acceptors} || {}};
}
sub _recurring {
my $self = shift;
$self->{accept} ||= $self->recurring($self->accept_interval => \&_accepting);
$self->{stop} ||= $self->recurring(1 => \&_stop);
}
sub _remove {
my ($self, $id) = @_;
# Timer
return unless my $reactor = $self->reactor;
return if $reactor->remove($id);
# Acceptor
if (delete $self->{acceptors}{$id}) { $self->_not_accepting }
# Connection
else { delete $self->{connections}{$id} }
}
sub _stop {
my $self = shift;
return if keys %{$self->{connections}};
$self->stop if $self->max_connections == 0;
return if keys %{$self->{acceptors}};
$self->{$_} && $self->_remove(delete $self->{$_}) for qw(accept stop);
}
sub _stream {
my ($self, $stream, $id) = @_;
# Make sure timers are running
$self->_recurring;
# Connect stream with reactor
$self->{connections}{$id}{stream} = $stream;
weaken $stream->reactor($self->reactor)->{reactor};
weaken $self;
$stream->on(close => sub { $self && $self->_remove($id) });
$stream->start;
return $id;
}
sub _timer {
my ($self, $method, $after, $cb) = (_instance(shift), @_);
weaken $self;
return $self->reactor->$method($after => sub { $self->$cb });
}
1;
=encoding utf8
=head1 NAME
Mojo::IOLoop - Minimalistic event loop
=head1 SYNOPSIS
use Mojo::IOLoop;
# Listen on port 3000
Mojo::IOLoop->server({port => 3000} => sub {
my ($loop, $stream) = @_;
$stream->on(read => sub {
my ($stream, $bytes) = @_;
# Process input chunk
say $bytes;
# Write response
$stream->write('HTTP/1.1 200 OK');
});
});
# Connect to port 3000
my $id = Mojo::IOLoop->client({port => 3000} => sub {
my ($loop, $err, $stream) = @_;
$stream->on(read => sub {
my ($stream, $bytes) = @_;
# Process input
say "Input: $bytes";
});
# Write request
$stream->write("GET / HTTP/1.1\x0d\x0a\x0d\x0a");
});
# Add a timer
Mojo::IOLoop->timer(5 => sub {
my $loop = shift;
$loop->remove($id);
});
# Start event loop if necessary
Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
=head1 DESCRIPTION
L<Mojo::IOLoop> is a very minimalistic event loop based on L<Mojo::Reactor>,
it has been reduced to the absolute minimal feature set required to build
solid and scalable non-blocking TCP clients and servers.
Depending on operating system, the default per-process and system-wide file
descriptor limits are often very low and need to be tuned for better
scalability. The C<LIBEV_FLAGS> environment variable should also be used to
select the best possible L<EV> backend, which usually defaults to the not very
scalable C<select>.
LIBEV_FLAGS=1 # select
LIBEV_FLAGS=2 # poll
LIBEV_FLAGS=4 # epoll (Linux)
LIBEV_FLAGS=8 # kqueue (*BSD, OS X)
The event loop will be resilient to time jumps if a monotonic clock is
available through L<Time::HiRes>. A TLS certificate and key are also built
right in, to make writing test servers as easy as possible. Also note that for
convenience the C<PIPE> signal will be set to C<IGNORE> when L<Mojo::IOLoop>
is loaded.
For better scalability (epoll, kqueue) and to provide IPv6 as well as TLS
support, the optional modules L<EV> (4.0+), L<IO::Socket::IP> (0.20+) and
L<IO::Socket::SSL> (1.84+) will be used automatically if they are installed.
Individual features can also be disabled with the C<MOJO_NO_IPV6> and
C<MOJO_NO_TLS> environment variables.
See L<Mojolicious::Guides::Cookbook/"REAL-TIME WEB"> for more.
=head1 ATTRIBUTES
L<Mojo::IOLoop> implements the following attributes.
=head2 accept_interval
my $interval = $loop->accept_interval;
$loop = $loop->accept_interval(0.5);
Interval in seconds for trying to reacquire the accept mutex, defaults to
C<0.025>. Note that changing this value can affect performance and idle CPU
usage.
=head2 lock
my $cb = $loop->lock;
$loop = $loop->lock(sub {...});
A callback for acquiring the accept mutex, used to sync multiple server
processes. The callback should return true or false. Note that exceptions in
this callback are not captured.
$loop->lock(sub {
my ($loop, $blocking) = @_;
# Got the accept mutex, start accepting new connections
return 1;
});
=head2 max_accepts
my $max = $loop->max_accepts;
$loop = $loop->max_accepts(1000);
The maximum number of connections this event loop is allowed to accept before
shutting down gracefully without interrupting existing connections, defaults
to C<0>. Setting the value to C<0> will allow this event loop to accept new
connections indefinitely. Note that up to half of this value can be subtracted
randomly to improve load balancing between multiple server processes.
=head2 max_connections
my $max = $loop->max_connections;
$loop = $loop->max_connections(1000);
The maximum number of concurrent connections this event loop is allowed to
handle before stopping to accept new incoming connections, defaults to
C<1000>. Setting the value to C<0> will make this event loop stop accepting
new connections and allow it to shut down gracefully without interrupting
existing connections.
=head2 multi_accept
my $multi = $loop->multi_accept;
$loop = $loop->multi_accept(100);
Number of connections to accept at once, defaults to C<50>.
=head2 reactor
my $reactor = $loop->reactor;
$loop = $loop->reactor(Mojo::Reactor->new);
Low-level event reactor, usually a L<Mojo::Reactor::Poll> or
L<Mojo::Reactor::EV> object with a default subscriber to the event
L<Mojo::Reactor/"error">.
# Watch if handle becomes readable or writable
$loop->reactor->io($handle => sub {
my ($reactor, $writable) = @_;
say $writable ? 'Handle is writable' : 'Handle is readable';
});
# Change to watching only if handle becomes writable
$loop->reactor->watch($handle, 0, 1);
=head2 unlock
my $cb = $loop->unlock;
$loop = $loop->unlock(sub {...});
A callback for releasing the accept mutex, used to sync multiple server
processes. Note that exceptions in this callback are not captured.
=head1 METHODS
L<Mojo::IOLoop> inherits all methods from L<Mojo::Base> and implements the
following new ones.
=head2 acceptor
my $server = Mojo::IOLoop->acceptor($id);
my $server = $loop->acceptor($id);
my $id = $loop->acceptor(Mojo::IOLoop::Server->new);
Get L<Mojo::IOLoop::Server> object for id or turn object into an acceptor.
=head2 client
my $id
= Mojo::IOLoop->client(address => '127.0.0.1', port => 3000, sub {...});
my $id = $loop->client(address => '127.0.0.1', port => 3000, sub {...});
my $id = $loop->client({address => '127.0.0.1', port => 3000} => sub {...});
Open TCP connection with L<Mojo::IOLoop::Client>, takes the same arguments as
L<Mojo::IOLoop::Client/"connect">.
# Connect to localhost on port 3000
Mojo::IOLoop->client({port => 3000} => sub {
my ($loop, $err, $stream) = @_;
...
});
=head2 delay
my $delay = Mojo::IOLoop->delay;
my $delay = $loop->delay;
my $delay = $loop->delay(sub {...});
my $delay = $loop->delay(sub {...}, sub {...});
Build L<Mojo::IOLoop::Delay> object to manage callbacks and control the flow
of events, which can help you avoid deep nested closures that often result
from continuation-passing style. Callbacks will be passed along to
L<Mojo::IOLoop::Delay/"steps">.
# Synchronize multiple events
my $delay = Mojo::IOLoop->delay(sub { say 'BOOM!' });
for my $i (1 .. 10) {
my $end = $delay->begin;
Mojo::IOLoop->timer($i => sub {
say 10 - $i;
$end->();
});
}
$delay->wait unless Mojo::IOLoop->is_running;
# Sequentialize multiple events
my $delay = Mojo::IOLoop->delay(
# First step (simple timer)
sub {
my $delay = shift;
Mojo::IOLoop->timer(2 => $delay->begin);
say 'Second step in 2 seconds.';
},
# Second step (concurrent timers)
sub {
my $delay = shift;
Mojo::IOLoop->timer(1 => $delay->begin);
Mojo::IOLoop->timer(3 => $delay->begin);
say 'Third step in 3 seconds.';
},
# Third step (the end)
sub { say 'And done after 5 seconds total.' }
);
$delay->wait unless Mojo::IOLoop->is_running;
=head2 generate_port
my $port = Mojo::IOLoop->generate_port;
my $port = $loop->generate_port;
Find a free TCP port, this is a utility function primarily used for tests.
=head2 is_running
my $bool = Mojo::IOLoop->is_running;
my $bool = $loop->is_running;
Check if event loop is running.
exit unless Mojo::IOLoop->is_running;
=head2 next_tick
my $undef = Mojo::IOLoop->next_tick(sub {...});
my $undef = $loop->next_tick(sub {...});
Invoke callback as soon as possible, but not before returning, always returns
C<undef>.
# Perform operation on next reactor tick
Mojo::IOLoop->next_tick(sub {
my $loop = shift;
...
});
=head2 one_tick
Mojo::IOLoop->one_tick;
$loop->one_tick;
Run event loop until an event occurs. Note that this method can recurse back
into the reactor, so you need to be careful.
# Don't block longer than 0.5 seconds
my $id = Mojo::IOLoop->timer(0.5 => sub {});
Mojo::IOLoop->one_tick;
Mojo::IOLoop->remove($id);
=head2 recurring
my $id = Mojo::IOLoop->recurring(3 => sub {...});
my $id = $loop->recurring(0 => sub {...});
my $id = $loop->recurring(0.25 => sub {...});
Create a new recurring timer, invoking the callback repeatedly after a given
amount of time in seconds.
# Perform operation every 5 seconds
Mojo::IOLoop->recurring(5 => sub {
my $loop = shift;
...
});
=head2 remove
Mojo::IOLoop->remove($id);
$loop->remove($id);
Remove anything with an id, connections will be dropped gracefully by allowing
them to finish writing all data in their write buffers.
=head2 server
my $id = Mojo::IOLoop->server(port => 3000, sub {...});
my $id = $loop->server(port => 3000, sub {...});
my $id = $loop->server({port => 3000} => sub {...});
Accept TCP connections with L<Mojo::IOLoop::Server>, takes the same arguments
as L<Mojo::IOLoop::Server/"listen">.
# Listen on port 3000
Mojo::IOLoop->server({port => 3000} => sub {
my ($loop, $stream, $id) = @_;
...
});
=head2 singleton
my $loop = Mojo::IOLoop->singleton;
The global L<Mojo::IOLoop> singleton, used to access a single shared event
loop object from everywhere inside the process.
# Many methods also allow you to take shortcuts
Mojo::IOLoop->timer(2 => sub { Mojo::IOLoop->stop });
Mojo::IOLoop->start;
# Restart active timer
my $id = Mojo::IOLoop->timer(3 => sub { say 'Timeout!' });
Mojo::IOLoop->singleton->reactor->again($id);
=head2 start
Mojo::IOLoop->start;
$loop->start;
Start the event loop, this will block until L</"stop"> is called. Note that
some reactors stop automatically if there are no events being watched anymore.
# Start event loop only if it is not running already
Mojo::IOLoop->start unless Mojo::IOLoop->is_running;
=head2 stop
Mojo::IOLoop->stop;
$loop->stop;
Stop the event loop, this will not interrupt any existing connections and the
event loop can be restarted by running L</"start"> again.
=head2 stream
my $stream = Mojo::IOLoop->stream($id);
my $stream = $loop->stream($id);
my $id = $loop->stream(Mojo::IOLoop::Stream->new);
Get L<Mojo::IOLoop::Stream> object for id or turn object into a connection.
# Increase inactivity timeout for connection to 300 seconds
Mojo::IOLoop->stream($id)->timeout(300);
=head2 timer
my $id = Mojo::IOLoop->timer(3 => sub {...});
my $id = $loop->timer(0 => sub {...});
my $id = $loop->timer(0.25 => sub {...});
Create a new timer, invoking the callback after a given amount of time in
seconds.
# Perform operation in 5 seconds
Mojo::IOLoop->timer(5 => sub {
my $loop = shift;
...
});
=head1 DEBUGGING
You can set the C<MOJO_IOLOOP_DEBUG> environment variable to get some advanced
diagnostics information printed to C<STDERR>.
MOJO_IOLOOP_DEBUG=1
=head1 SEE ALSO
L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicio.us>.
=cut
| 26.397496 | 79 | 0.655205 |
Subsets and Splits