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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ed2d735f27eb4cc5db0db6b4976dacd25afefaba | 1,232 | t | Perl | cgview_comparison_tool/lib/bioperl-1.2.3/t/MicrosatelliteMarker.t | kellyhuang21/CircularGenomeVizApp | 4f241aded41258285c7b063cb9728fea459f6400 | [
"MIT"
] | 1 | 2021-04-27T18:17:33.000Z | 2021-04-27T18:17:33.000Z | cgview_comparison_tool/lib/bioperl-1.2.3/t/MicrosatelliteMarker.t | kellyhuang21/CircularGenomeVizApp | 4f241aded41258285c7b063cb9728fea459f6400 | [
"MIT"
] | 2 | 2020-06-20T15:59:50.000Z | 2021-04-25T17:50:35.000Z | cgview_comparison_tool/lib/bioperl-1.2.3/t/MicrosatelliteMarker.t | kellyhuang21/CircularGenomeVizApp | 4f241aded41258285c7b063cb9728fea459f6400 | [
"MIT"
] | null | null | null | # -*-Perl-*-
## Bioperl Test Harness Script for Modules
## $Id: MicrosatelliteMarker.t,v 1.1 2002/02/11 09:31:34 heikki Exp $
#
use strict;
BEGIN {
use vars qw($DEBUG);
$DEBUG = $ENV{'BIOPERLDEBUG'};
# to handle systems with no installed Test module
# we include the t dir (where a copy of Test.pm is located)
# as a fallback
eval { require Test; };
if( $@ ) {
use lib 't';
}
use Test;
plan tests => 6;
}
END {
}
require 'dumpvar.pl';
use Bio::Map::SimpleMap;
use Bio::Map::Position;
use Bio::Map::Microsatellite;
ok(1);
my $map = new Bio::Map::SimpleMap(-units => 'MB',
-type => 'oo-121');
my $position = new Bio::Map::Position(-map => $map,
-value => 20
);
my $o_usat = new Bio::Map::Microsatellite
(-name=>'Chad Super Marker 2',
-sequence => 'gctgactgatcatatatatatatatatatatatatatatatcgcgatcgtgatttt',
-motif => 'at',
-repeats => 15,
-repeat_start_position => 12,
-position => $position,
);
ok($o_usat->get_leading_flank(), "gctgactgatc");
ok($o_usat->get_trailing_flank(), "cgcgatcgtgatttt");
ok($o_usat->motif(), 'at');
ok($o_usat->repeats(), 15);
ok($o_usat->repeat_start_position, 12);
#dumpValue($o_usat);
| 22.814815 | 77 | 0.612013 |
ed12a251ab639633b5d6c7ed65c130a724612396 | 841 | pm | Perl | lib/EpiRR/Model/Sample.pm | EMBL-EBI-GCA/EpiRR | e231f27b33a27ec15e37a75e61f36a4af7be9302 | [
"Apache-2.0"
] | 5 | 2018-02-27T22:29:48.000Z | 2021-04-08T10:59:16.000Z | lib/EpiRR/Model/Sample.pm | Ensembl/EpiRR | e231f27b33a27ec15e37a75e61f36a4af7be9302 | [
"Apache-2.0"
] | null | null | null | lib/EpiRR/Model/Sample.pm | Ensembl/EpiRR | e231f27b33a27ec15e37a75e61f36a4af7be9302 | [
"Apache-2.0"
] | 1 | 2016-08-25T16:49:08.000Z | 2016-08-25T16:49:08.000Z | # Copyright 2013 European Molecular Biology Laboratory - 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.
package EpiRR::Model::Sample;
use Moose;
use namespace::autoclean;
with 'EpiRR::Roles::HasMetaData';
has 'sample_id' => (is => 'rw', isa => 'Str');
__PACKAGE__->meta->make_immutable;
1; | 36.565217 | 90 | 0.740785 |
ed8714afe74c75c0ff1808963face8603813cb7f | 7,391 | pm | Perl | framework/core/Coverage.pm | dericp/defects4j | 252f7b0e259678dfd1074679c7974c6eb384ad02 | [
"MIT"
] | null | null | null | framework/core/Coverage.pm | dericp/defects4j | 252f7b0e259678dfd1074679c7974c6eb384ad02 | [
"MIT"
] | null | null | null | framework/core/Coverage.pm | dericp/defects4j | 252f7b0e259678dfd1074679c7974c6eb384ad02 | [
"MIT"
] | null | null | null | #-------------------------------------------------------------------------------
# Copyright (c) 2014-2015 René Just, Darioush Jalali, and Defects4J contributors.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#-------------------------------------------------------------------------------
=pod
=head1 NAME
Coverage.pm -- helper subroutines for code coverage analysis.
=head1 DESCRIPTION
This module provides helper subroutines for code coverage analysis using Cobertura.
=cut
# TODO: Clean up this module and provide a ".ser" parser for Cobertura's coverage results.
package Coverage;
use warnings;
use strict;
use Constants;
use Utils;
use DB;
# Cache column names for table coverage
my @COLS = DB::get_tab_columns($TAB_COVERAGE) or die "Cannot obtain table columns!";
# Default paths
my $SER_FILE = "cobertura.ser";
my $XML_FILE = "coverage.xml";
# Corbetura scripts
my $CORBETURA_MERGE = "$SCRIPT_DIR/projects/lib/cobertura-merge.sh";
my $CORBETURA_REPORT = "$SCRIPT_DIR/projects/lib/cobertura-report.sh";
=pod
=head2 Static subroutines
Coverage::coverage(project_ref, instrument_classes, src_dir, log_file, relevant_tests, [single_test, [merge_with]])
Measures code coverage for a provided L<Project> reference. F<instrument_classes>
is the name of a file that lists all the classes which should be instrumented. F<src_dir>
provides the root directory of the source code, which is necessary to generate reports.
The test results are written to F<log_file>, and the boolean parameter C<relevant_tests>
indicates whether only relevant test cases are executed.
If C<single_test> is specified, only that test is run. This is meant to be used
in conjunction with C<merge_with>, which is the path to another .ser file obtained by
running coverage. This enables incremental analyses.
=cut
sub coverage {
@_ >= 5 or die $ARG_ERROR;
my ($project, $instrument_classes, $src_dir, $log_file, $relevant_tests, $single_test, $merge_with) = @_;
my $root = $project->{prog_root};
my $datafile = "$root/datafile";
my $xmlfile = "$root/$XML_FILE";
my $serfile = "$root/$SER_FILE";
# Remove stale data file
system("rm -f $serfile");
# Instrument all classes provided
$project->coverage_instrument($instrument_classes) or return undef;
# Execute test suite
if ($relevant_tests) {
$project->run_relevant_tests($log_file) or return undef;
} else {
$project->run_tests($log_file, $single_test) or return undef;
}
# Generate coverage report
my $result_xml;
if (defined $merge_with) {
print(STDERR "Merging & creating new report via shell script..\n");
# Remove stale data files
system("rm -f $datafile") if -e $datafile;
system("rm -f $xmlfile") if -e $xmlfile ;
system("sh $CORBETURA_MERGE --datafile $datafile $merge_with $serfile >/dev/null 2>&1") == 0 or die "could not merge results";
system("sh $CORBETURA_REPORT --format xml --datafile $datafile --destination $root >/dev/null 2>&1") == 0 or die "could not create report";
} else {
# Generate XML directly if merge is not needed.
$project->coverage_report($src_dir) or die "Could not create coverage report";
}
return _get_info_from_xml($xmlfile);
}
=pod
Coverage::coverage_ext(project, instrument_classes, src_dir, test_dir, include_pattern, log_file)
Determines code coverage for an external test suite.
F<instrument_classes> is the name of a file that lists all the classes which
should be instrumented. C<src_dir> provides the root directory of the source
code, which is necessary to generate reports.
=cut
sub coverage_ext {
@_ == 6 or die $ARG_ERROR;
my ($project, $instrument_classes, $src_dir, $test_dir, $include, $log_file) = @_;
# Instrument all classes provided
$project->coverage_instrument($instrument_classes) or return undef;
# Execute test suite
$project->run_ext_tests($test_dir, $include, $log_file) or die "Could not run test suite";
# Generate coverage report
$project->coverage_report($src_dir) or die "Could not create report";
# Parse xml output and return coverage ratios
my $xmlfile = "$project->{prog_root}/$XML_FILE";
return _get_info_from_xml($xmlfile);
}
=pod
Coverage::insert_row(hashref, [out_dir])
Insert a row into the database table L<TAB_COVERAGE|DB>. C<hashref> points to a
hash holding all key-value pairs of the data row. F<out_dir> is the optional
alternative database directory to use.
=cut
sub insert_row {
my ($data, $out_dir) = @_;
# Get proper output db handle: check whether a different output directory is provided
my $dbh;
if (defined $out_dir) {
$dbh = DB::get_db_handle($TAB_COVERAGE, $out_dir);
} else {
$dbh = DB::get_db_handle($TAB_COVERAGE);
}
my @tmp;
foreach (@COLS) {
push (@tmp, $dbh->quote((defined $data->{$_} ? $data->{$_} : "-")));
}
my $row = join(",", @tmp);
$dbh->do("INSERT INTO $TAB_COVERAGE VALUES ($row)");
}
=pod
Coverage::copy_coverage_logs(project, vid, suite, test_id, log_dir)
Copies the coverage log files to a permanent directory F<log_dir>. C<project>
is the reference to a L<Project>, C<vid> is the version id, C<suite> specifies
the suite tag (e.g., manual, randoop, evosuite-branch), and C<test_id> provides
the id of the test suite.
=cut
sub copy_coverage_logs {
my ($project, $vid, $suite, $test_id, $log_dir) = @_;
# Copy coverage log files to log directory
system("cp $project->{prog_root}/$SER_FILE $log_dir/$suite/$vid.$test_id.ser") == 0
or die "Cannot copy .ser file";
system("cp $project->{prog_root}/$XML_FILE $log_dir/$suite/$vid.$test_id.xml") == 0
or die "Cannot copy .xml file";
}
#
# Parse coverage log file and return reference to a hash that holds all results
#
sub _get_info_from_xml {
my ($xml, ) = @_;
my ($lt, $lc, $bt, $bc);
-e $xml or die "Result xml file does not exist: $xml!";
# Parse XML file
open FH, $xml;
while (<FH>) {
if (/lines-covered="(\d+)" lines-valid="(\d+)" branches-covered="(\d+)" branches-valid="(\d+)"/) {
($lc, $lt, $bc, $bt) = ($1, $2, $3, $4);
}
}
close FH;
die "values not set" unless defined $lt;
# Set all values and return hash reference
return {
$LINES_TOTAL => $lt,
$LINES_COVERED => $lc,
$BRANCHES_TOTAL => $bt,
$BRANCHES_COVERED => $bc,
};
}
1;
| 33.292793 | 141 | 0.690976 |
ed8aef90d54ae2617ade9b11240412a8b520c359 | 7,262 | pm | Perl | apps/cisco/ssms/restapi/mode/licenses.pm | centreon-lab/centreon-plugins | 68096c697a9e1baf89a712674a193d9a9321503c | [
"Apache-2.0"
] | null | null | null | apps/cisco/ssms/restapi/mode/licenses.pm | centreon-lab/centreon-plugins | 68096c697a9e1baf89a712674a193d9a9321503c | [
"Apache-2.0"
] | null | null | null | apps/cisco/ssms/restapi/mode/licenses.pm | centreon-lab/centreon-plugins | 68096c697a9e1baf89a712674a193d9a9321503c | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2022 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package apps::cisco::ssms::restapi::mode::licenses;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
sub custom_status_output {
my ($self, %options) = @_;
return sprintf(
"status: '%s'",
$self->{result_values}->{status}
);
}
sub custom_license_output {
my ($self, %options) = @_;
return sprintf(
"usage total: %s used: %s (%.2f%%) free: %s (%.2f%%)",
$self->{result_values}->{total},
$self->{result_values}->{used},
$self->{result_values}->{prct_used},
$self->{result_values}->{free},
$self->{result_values}->{prct_free}
);
}
sub account_long_output {
my ($self, %options) = @_;
return "checking account '" . $options{instance_value}->{display} . "'";
}
sub prefix_account_output {
my ($self, %options) = @_;
return "account '" . $options{instance_value}->{display} . "' ";
}
sub prefix_license_output {
my ($self, %options) = @_;
return "license '" . $options{instance_value}->{display} . "' ";
}
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'accounts', type => 3, cb_prefix_output => 'prefix_account_output', cb_long_output => 'account_long_output', indent_long_output => ' ', message_multiple => 'All accounts are ok',
group => [
{ name => 'licenses', display_long => 1, cb_prefix_output => 'prefix_license_output', message_multiple => 'licenses are ok', type => 1, skipped_code => { -10 => 1 } }
]
}
];
$self->{maps_counters}->{licenses} = [
{ label => 'license-status', type => 2, critical_default => '%{status} !~ /in compliance/i', set => {
key_values => [ { name => 'status' }, { name => 'display' } ],
closure_custom_output => $self->can('custom_status_output'),
closure_custom_perfdata => sub { return 0; },
closure_custom_threshold_check => \&catalog_status_threshold_ng
}
},
{ label => 'usage', nlabel => 'licenses.usage.count', set => {
key_values => [ { name => 'used' }, { name => 'free' }, { name => 'prct_used' }, { name => 'prct_free' }, { name => 'total' } ],
closure_custom_output => $self->can('custom_license_output'),
perfdatas => [
{ template => '%d', min => 0, max => 'total', label_extra_instance => 1 }
]
}
},
{ label => 'usage-free', display_ok => 0, nlabel => 'licenses.free.count', set => {
key_values => [ { name => 'free' }, { name => 'used' }, { name => 'prct_used' }, { name => 'prct_free' }, { name => 'total' } ],
closure_custom_output => $self->can('custom_license_output'),
perfdatas => [
{ template => '%d', min => 0, max => 'total', label_extra_instance => 1 }
]
}
},
{ label => 'usage-prct', display_ok => 0, nlabel => 'licenses.usage.percentage', set => {
key_values => [ { name => 'prct_used' }, { name => 'used' }, { name => 'free' }, { name => 'prct_free' }, { name => 'total' } ],
closure_custom_output => $self->can('custom_license_output'),
perfdatas => [
{ template => '%d', min => 0, max => 'total', label_extra_instance => 1 }
]
}
}
];
}
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
bless $self, $class;
$options{options}->add_options(arguments => {
'account:s@' => { name => 'account' },
'filter-license-name:s' => { name => 'filter_license_name' }
});
return $self;
}
sub check_options {
my ($self, %options) = @_;
$self->SUPER::check_options(%options);
$self->{account_names} = [];
if (defined($self->{option_results}->{account})) {
foreach my $account (@{$self->{option_results}->{account}}) {
push @{$self->{account_names}}, $account if ($account ne '');
}
}
if (scalar(@{$self->{account_names}}) <= 0) {
$self->{output}->add_option_msg(short_msg => 'need to specify --account option.');
$self->{output}->option_exit();
}
}
sub manage_selection {
my ($self, %options) = @_;
$self->{accounts} = {};
foreach my $account (@{$self->{account_names}}) {
my $results = $options{custom}->get_licenses(
account => $account
);
next if (!defined($results->{licenses}));
$self->{accounts}->{$account} = {
display => $account,
licenses => {}
};
foreach (@{$results->{licenses}}) {
next if (defined($self->{option_results}->{filter_license_name}) && $self->{option_results}->{filter_license_name} ne '' &&
$_->{license} !~ /$self->{option_results}->{filter_license_name}/);
$self->{accounts}->{$account}->{licenses}->{ $_->{license} } = {
display => $_->{license},
status => $_->{status},
used => $_->{inUse},
free => $_->{available},
total => $_->{quantity},
prct_used => $_->{quantity} > 0 ? ($_->{inUse} * 100 / $_->{quantity}) : undef,
prct_free => $_->{quantity} > 0 ? ($_->{available} * 100 / $_->{quantity}) : undef
};
}
}
}
1;
__END__
=head1 MODE
Check licenses.
=over 8
=item B<--filter-counters>
Only display some counters (regexp can be used).
Example: --filter-counters='status'
=item B<--account>
Check account name (Required. Multiple option).
=item B<--filter-license-name>
Filter license name (can be a regexp).
=item B<--unknown-license-status>
Set unknown threshold for status.
Can used special variables like: %{status}, %{display}
=item B<--warning-license-status>
Set warning threshold for status.
Can used special variables like: %{status}, %{display}
=item B<--critical-license-status>
Set critical threshold for status (Default: '%{status} !~ /in compliance/i').
Can used special variables like: %{status}, %{display}
=item B<--warning-*> B<--critical-*>
Thresholds.
Can be: 'usage' (B), 'usage-free' (B), 'usage-prct' (%).
=back
=cut
| 32.711712 | 199 | 0.56293 |
ed42a3e1bd3351504bcf3d266d7c0e7753f28aff | 645 | pl | Perl | src/main/resources/project/collaborator_management.pl | electric-cloud-community/EC-Heroku | 9b7db03f76df63a5523514cd7a2aecdbfc3288c9 | [
"Apache-2.0"
] | null | null | null | src/main/resources/project/collaborator_management.pl | electric-cloud-community/EC-Heroku | 9b7db03f76df63a5523514cd7a2aecdbfc3288c9 | [
"Apache-2.0"
] | null | null | null | src/main/resources/project/collaborator_management.pl | electric-cloud-community/EC-Heroku | 9b7db03f76df63a5523514cd7a2aecdbfc3288c9 | [
"Apache-2.0"
] | null | null | null | use ElectricCommander;
my $ec = new ElectricCommander();
my $code = $ec->getProperty("/myProject/Heroku")->findvalue("//value")->value();
eval($code) or die("Error loading Heroku library code: $@\n");
my $ConfigName = ($ec->getProperty("ConfigName"))->findvalue('//value')->string_value;
my $Action = ($ec->getProperty("Action"))->findvalue('//value')->string_value;
my $AppName = ($ec->getProperty("AppName"))->findvalue('//value')->string_value;
my $EmailAccount = ($ec->getProperty("EmailAccount"))->findvalue('//value')->string_value;
plugin_info();
collaborator_management($ConfigName, $Action, $AppName, $EmailAccount);
| 43 | 90 | 0.686822 |
ed88b07a926be87edd9091ece332dca833de4dd6 | 9,083 | t | Perl | t/15-request.t | killerfish/duckduckgo | 173f91a9a0b3834d2eee48a0bf0e29492040f63b | [
"Apache-2.0"
] | 2 | 2019-05-23T20:37:06.000Z | 2019-05-24T14:10:56.000Z | t/15-request.t | killerfish/duckduckgo | 173f91a9a0b3834d2eee48a0bf0e29492040f63b | [
"Apache-2.0"
] | null | null | null | t/15-request.t | killerfish/duckduckgo | 173f91a9a0b3834d2eee48a0bf0e29492040f63b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env perl
use strict;
use warnings;
use Test::More;
use utf8;
use DDG::Request;
BEGIN {
my @t = (
'' => {
query_raw => '',
query => '',
query_lc => '',
query_nowhitespace => '',
query_nowhitespace_nodash => '',
query_clean => '',
wordcount => 0,
query_raw_parts => [],
query_parts => [],
words => [],
triggers => {},
},
' !bang test' => {
query_raw => ' !bang test',
query => '!bang test',
query_lc => '!bang test',
query_nowhitespace => '!bangtest',
query_nowhitespace_nodash => '!bangtest',
query_clean => 'bang test',
wordcount => 2,
query_raw_parts => ['',' ','!bang',' ','test'],
query_parts => [qw( !bang test )],
words => [qw( bang test )],
triggers => {
2 => [qw( !bang bang )],
4 => [qw( test )],
},
},
'!bang test-test' => {
query_raw => '!bang test-test',
query => '!bang test-test',
query_lc => '!bang test-test',
query_nowhitespace => '!bangtest-test',
query_nowhitespace_nodash => '!bangtesttest',
query_clean => 'bang testtest',
wordcount => 2,
query_raw_parts => ['!bang',' ','test-test'],
query_parts => [qw( !bang test-test )],
words => [qw( bang test-test )],
triggers => {
0 => [qw( !bang bang )],
2 => ["test", "test test", "test-test", "testtest"],
},
},
'other !bang test' => {
query_raw => 'other !bang test',
query => 'other !bang test',
query_lc => 'other !bang test',
query_nowhitespace => 'other!bangtest',
query_nowhitespace_nodash => 'other!bangtest',
query_clean => 'other bang test',
wordcount => 3,
query_raw_parts => ['other',' ','!bang',' ','test'],
query_parts => [qw( other !bang test )],
words => [qw( other bang test )],
triggers => {
0 => [qw( other )],
2 => [qw( !bang bang )],
4 => [qw( test )],
},
},
'%"test %)()%!%§ +##+tesfsd' => {
query_raw => '%"test %)()%!%§ +##+tesfsd',
query => '%"test %)()%!%§ +##+tesfsd',
query_lc => '%"test %)()%!%§ +##+tesfsd',
query_nowhitespace => '%"test%)()%!%§+##+tesfsd',
query_nowhitespace_nodash => '%"test%)()%!%§+##+tesfsd',
query_clean => 'test tesfsd',
wordcount => 2,
query_parts => ['%"test',qq{%\)\(\)%!%§},'+##+tesfsd'],
words => [qw( test tesfsd )],
triggers => {
0 => ['', ' test', '%"test', 'test'],
2 => ['', '%)()%!%§'],
4 => ['', ' tesfsd', '+##+tesfsd', 'tesfsd' ],
},
},
'test...test test...Test?' => {
query_raw => 'test...test test...Test?',
query => 'test...test test...Test?',
query_lc => 'test...test test...test?',
query_nowhitespace => 'test...testtest...Test?',
query_nowhitespace_nodash => 'test...testtest...Test?',
query_clean => 'testtest testtest',
wordcount => 2,
query_parts => [qw( test...test test...Test? )],
words => [qw( test test test Test )],
},
' %%test %%%%% %%%TeSFsd%%% ' => {
query_raw => ' %%test %%%%% %%%TeSFsd%%% ',
query => '%%test %%%%% %%%TeSFsd%%%',
query_lc => '%%test %%%%% %%%tesfsd%%%',
query_nowhitespace => '%%test%%%%%%%%TeSFsd%%%',
query_nowhitespace_nodash => '%%test%%%%%%%%TeSFsd%%%',
query_clean => 'test tesfsd',
wordcount => 2,
query_parts => [qw( %%test %%%%% %%%TeSFsd%%% )],
words => [qw( test tesfsd )],
},
'reverse bla' => {
query_raw => 'reverse bla',
query => 'reverse bla',
query_lc => 'reverse bla',
query_nowhitespace => 'reversebla',
query_nowhitespace_nodash => 'reversebla',
query_clean => 'reverse bla',
wordcount => 2,
query_parts => [qw( reverse bla )],
words => [qw( reverse bla )],
},
' !reverse bla ' => {
query_raw => ' !reverse bla ',
query => '!reverse bla',
query_lc => '!reverse bla',
query_nowhitespace => '!reversebla',
query_nowhitespace_nodash => '!reversebla',
query_clean => 'reverse bla',
wordcount => 2,
query_parts => [qw( !reverse bla )],
query_raw_parts => ['',' ','!reverse',' ','bla',' '],
words => [qw( reverse bla )],
},
' !REVerse BLA ' => {
query_raw => ' !REVerse BLA ',
query => '!REVerse BLA',
query_lc => '!reverse bla',
query_nowhitespace => '!REVerseBLA',
query_nowhitespace_nodash => '!REVerseBLA',
query_clean => 'reverse bla',
wordcount => 2,
query_parts => [qw( !REVerse BLA )],
words => [qw( reverse bla )],
},
'a really very very very very very long query 0123456789abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' => {
query_raw => 'a really very very very very very long query 0123456789abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
query => 'a really very very very very very long query 0123456789abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
query_lc => 'a really very very very very very long query 0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789',
query_nowhitespace => 'areallyveryveryveryveryverylongquery0123456789abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
query_nowhitespace_nodash => 'areallyveryveryveryveryverylongquery0123456789abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
query_clean => 'a really very very very very very long query 0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789',
wordcount => 10,
query_raw_parts => [ 'a', ' ', 'really', ' ', 'very', ' ', 'very', ' ', 'very', ' ', 'very', ' ', 'very', ' ', 'long',
' ', 'query', ' ', '0123456789abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' ],
query_parts => [qw( a really very very very very very long query 0123456789abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789)],
words => [qw( a really very very very very very long query 0123456789abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789)],
triggers => {
0 => ["a"],
2 => ["really"],
4 => ["very"],
6 => ["very"],
8 => ["very"],
10 => ["very"],
12 => ["very"],
14 => ["long"],
16 => ["query"],
18 => ["0123456789abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz0123456789"],
}
},
);
while (@t) {
my $query = shift @t;
my %result = %{shift @t};
my %args;
%args = $result{args} if defined $result{args};
my $req = DDG::Request->new({ query_raw => $query, %args });
isa_ok($req,'DDG::Request');
is($req->query_raw,$query,'Testing query_raw of "'.$query.'"');
for (qw/ query_raw query query_lc query_nowhitespace query_nowhitespace_nodash query_clean wordcount /) {
is($req->$_,$result{$_},'Testing '.$_.' of "'.$query.'"') if defined $result{$_};
}
for (qw/ query_parts query_raw_parts /) {
is_deeply($req->$_,$result{$_},'Testing '.$_.' of "'.$query.'"') if defined $result{$_};
}
for (qw/ combined_lc_words_2 /) {
my $result_key = $_;
my ( $param ) = $_ =~ m/_(\w)+$/;
is_deeply($req->combined_lc_words($param),$result{$result_key},'Testing '.$result_key.' of "'.$query.'"') if defined $result{$result_key};
}
if (defined $result{triggers}) {
is_deeply($req->triggers,$result{triggers},'Test trigger of "'.$query.'"');
}
}
}
done_testing;
| 45.189055 | 167 | 0.479577 |
ed0efc938622dc06672700ab343fae62a3531d95 | 3,108 | pm | Perl | lib/Crypt/PKCS11/Attribute/AttributeArray.pm | dotse/p5-Crypt-PKCS11 | 19398fb1a11bf818370334b5ffee7708f97288cf | [
"BSD-2-Clause"
] | 2 | 2015-01-22T15:49:00.000Z | 2015-09-01T07:48:23.000Z | lib/Crypt/PKCS11/Attribute/AttributeArray.pm | jelu/p5-Crypt-PKCS11 | 19398fb1a11bf818370334b5ffee7708f97288cf | [
"BSD-2-Clause"
] | 4 | 2016-06-21T08:53:49.000Z | 2019-09-09T18:00:11.000Z | lib/Crypt/PKCS11/Attribute/AttributeArray.pm | jelu/p5-Crypt-PKCS11 | 19398fb1a11bf818370334b5ffee7708f97288cf | [
"BSD-2-Clause"
] | 2 | 2015-01-22T15:13:11.000Z | 2015-01-27T08:31:38.000Z | # Copyright (c) 2015-2016 Jerry Lundström <lundstrom.jerry@gmail.com>
# Copyright (c) 2016 make install AB
# Copyright (c) 2015 .SE (The Internet Infrastructure Foundation)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package Crypt::PKCS11::Attribute::AttributeArray;
use common::sense;
use Carp;
use Scalar::Util qw(blessed);
use base qw(Crypt::PKCS11::Attribute);
sub push {
my ($self) = CORE::shift;
CORE::foreach (@_) {
unless (blessed($_) and $_->isa('Crypt::PKCS11::Attribute')) {
confess 'Value to push is not a Crypt::PKCS11::Attribute object';
}
}
CORE::push(@{$self->{attributes}}, @_);
return $self;
}
sub pop {
return CORE::pop(@{$_[0]->{attributes}});
}
sub shift {
return CORE::shift(@{$_[0]->{attributes}});
}
sub unshift {
my ($self) = CORE::shift;
CORE::foreach (@_) {
unless (blessed($_) and $_->isa('Crypt::PKCS11::Attribute')) {
confess 'Value to unshift is not a Crypt::PKCS11::Attribute object';
}
}
CORE::unshift(@{$self->{attributes}}, @_);
return $self;
}
sub foreach {
my ($self, $cb) = @_;
unless (ref($cb) eq 'CODE') {
confess '$cb argument is not CODE';
}
CORE::foreach (@{$self->{attributes}}) {
$cb->($_);
}
return $self;
}
sub toArray {
my ($self) = @_;
my @array;
CORE::foreach (@{$self->{attributes}}) {
CORE::push(@array, { type => $_->type, pValue => $_->pValue });
}
return \@array;
}
sub set {
my $self = CORE::shift;
foreach (@_) {
unless (blessed($_) and $_->isa('Crypt::PKCS11::Attribute')) {
confess 'Value to set is not a Crypt::PKCS11::Attribute object';
}
}
$self->{attributes} = [ @_ ];
return $self;
}
sub pValue {
return $_[0]->toArray;
}
1;
__END__
| 27.263158 | 80 | 0.655084 |
ed5e6b5efe12532b06598641130bb9d18ba6667b | 426 | t | Perl | perl/src/ext/IO-Compress/t/108anyunc-deflate.t | nokibsarkar/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 2,293 | 2015-01-02T12:46:10.000Z | 2022-03-29T09:45:43.000Z | perl/src/ext/IO-Compress/t/108anyunc-deflate.t | nokibsarkar/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 315 | 2015-05-31T11:55:46.000Z | 2022-01-12T08:36:37.000Z | perl/src/ext/IO-Compress/t/108anyunc-deflate.t | nokibsarkar/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 1,033 | 2015-01-04T07:48:40.000Z | 2022-03-24T09:34:37.000Z | BEGIN {
if ($ENV{PERL_CORE}) {
chdir 't' if -d 't';
@INC = ("../lib", "lib/compress");
}
}
use lib qw(t t/compress);
use strict;
use warnings;
use IO::Uncompress::AnyUncompress qw($AnyUncompressError) ;
use IO::Compress::Deflate qw($DeflateError) ;
use IO::Uncompress::Inflate qw($InflateError) ;
sub getClass
{
'AnyUncompress';
}
sub identify
{
'IO::Compress::Deflate';
}
require "any.pl" ;
run();
| 14.2 | 59 | 0.631455 |
ed843f3342a652bf90c2d1c65b072bb203071b7e | 2,500 | pm | Perl | lib/HTML/Mason/Component/Subcomponent.pm | rentrak/HTML-Mason | fe5b918ecea137768de750b0d24703ec06d66e09 | [
"Artistic-1.0-cl8"
] | null | null | null | lib/HTML/Mason/Component/Subcomponent.pm | rentrak/HTML-Mason | fe5b918ecea137768de750b0d24703ec06d66e09 | [
"Artistic-1.0-cl8"
] | null | null | null | lib/HTML/Mason/Component/Subcomponent.pm | rentrak/HTML-Mason | fe5b918ecea137768de750b0d24703ec06d66e09 | [
"Artistic-1.0-cl8"
] | null | null | null | # Copyright (c) 1998-2005 by Jonathan Swartz. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the same terms as Perl itself.
package HTML::Mason::Component::Subcomponent;
use strict;
use warnings;
use HTML::Mason::Component;
use vars qw(@ISA);
@ISA = qw(HTML::Mason::Component);
use HTML::Mason::MethodMaker ( read_only => [ qw( comp_id is_method name owner path ) ] );
#
# Assign parent, name, and is_method flag when owner component is created.
#
sub assign_subcomponent_properties {
my $self = shift;
($self->{owner}, $self->{name}, $self->{is_method}) = @_;
}
#
# Override path that would be set by parent's version of method.
#
sub assign_runtime_properties {
my ($self, $interp, $source) = @_;
$self->SUPER::assign_runtime_properties($interp, $source);
$self->{comp_id} = sprintf("[%s '%s' of %s]", $self->{is_method} ? 'method' : 'subcomponent',
$self->name, $self->owner->comp_id);
$self->{path} = $self->owner->path . ":" . $self->name;
}
sub cache_file { return $_[0]->owner->cache_file }
sub load_time { return $_[0]->owner->load_time }
sub compiler_id { return $_[0]->owner->compilation_params }
sub dir_path { return $_[0]->owner->dir_path }
sub is_subcomp { 1 }
sub object_file { return $_[0]->owner->object_file }
sub parent { return $_[0]->owner->parent }
sub persistent { return $_[0]->owner->persistent }
sub title { return $_[0]->owner->title . ":" . $_[0]->name }
1;
__END__
=head1 NAME
HTML::Mason::Component::Subcomponent - Mason Subcomponent Class
=head1 DESCRIPTION
This is a subclass of
L<HTML::Mason::Component|HTML::Mason::Component>. Mason uses it to
implement both subcomponents (defined by C<< <%def> >>) and methods (defined
by C<< <%method> >>).
A subcomponent/method gets most of its properties from its owner. Note
that the link from the subcomponent to its owner is a weak reference
(to prevent circular references), so if you grab a subcomponent/method
object, you should also grab and hold a reference to its owner. If the
owner goes out of scope, the subcomponent/method object will become unusable.
=head1 METHODS
=over 4
=item is_method
Returns 1 if this is a method (declared by C<< <%method> >>), 0 if it is a
subcomponent (defined by c<< <%def> >>).
=item owner
Returns the component object within which this subcomponent or method
was defined.
=back
=head1 SEE ALSO
L<HTML::Mason::Component|HTML::Mason::Component>
=cut
| 28.089888 | 97 | 0.6952 |
ed8e7fcc493e4dfc8e8c4dd381758eb83deba3de | 3,942 | t | Perl | modules/t/syntenyRegion.t | manuelcarbajo/ensembl-compara | 0ffe653215a20e6921c5f4983ea9e4755593a491 | [
"Apache-2.0"
] | null | null | null | modules/t/syntenyRegion.t | manuelcarbajo/ensembl-compara | 0ffe653215a20e6921c5f4983ea9e4755593a491 | [
"Apache-2.0"
] | null | null | null | modules/t/syntenyRegion.t | manuelcarbajo/ensembl-compara | 0ffe653215a20e6921c5f4983ea9e4755593a491 | [
"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-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 Bio::EnsEMBL::Utils::Exception qw (warning verbose);
use Bio::EnsEMBL::Test::MultiTestDB;
use Bio::EnsEMBL::Test::TestUtils;
use Bio::EnsEMBL::Compara::SyntenyRegion;
my $multi = Bio::EnsEMBL::Test::MultiTestDB->new( "multi" );
my $compara_db_adaptor = $multi->get_DBAdaptor( "compara" );
my $synteny_region_adaptor = $compara_db_adaptor->get_SyntenyRegionAdaptor();
my $dnafrag_region_adaptor = $compara_db_adaptor->get_DnaFragRegionAdaptor();
my $sth = $compara_db_adaptor->dbc->prepare("SELECT synteny_region_id, method_link_species_set_id FROM synteny_region LIMIT 1");
$sth->execute();
my ($synteny_region_id, $method_link_species_set_id) = $sth->fetchrow_array();
$sth->finish();
#
# 1
#
subtest "Test Bio::EnsEMBL::Compara::SytenyRegion new(void) method", sub {
my $synteny_region = new Bio::EnsEMBL::Compara::SyntenyRegion();
isa_ok($synteny_region, "Bio::EnsEMBL::Compara::SyntenyRegion", "check object");
done_testing();
};
subtest "Test Bio::EnsEMBL::Compara::SyntenyRegion new(ALL) method", sub {
my $synteny_region = new Bio::EnsEMBL::Compara::SyntenyRegion(-adaptor => $synteny_region_adaptor,
-dbID => $synteny_region_id,
-method_link_species_set_id => $method_link_species_set_id);
isa_ok($synteny_region, "Bio::EnsEMBL::Compara::SyntenyRegion", "check object");
is($synteny_region->adaptor, $synteny_region_adaptor, "adaptor");
is($synteny_region->dbID, $synteny_region_id, "synteny_region_id");
is($synteny_region->method_link_species_set_id, $method_link_species_set_id, "method_link_species_set_id");
done_testing();
};
subtest "Test getter/setter Bio::EnsEMBL::Compara::SyntenyRegion methods", sub {
my $synteny_region = new Bio::EnsEMBL::Compara::SyntenyRegion();
ok(test_getter_setter($synteny_region, "adaptor", $synteny_region_adaptor));
ok(test_getter_setter($synteny_region, "dbID", $synteny_region_id));
ok(test_getter_setter($synteny_region, "method_link_species_set_id", $method_link_species_set_id));
my $regions = $dnafrag_region_adaptor->fetch_all_by_synteny_region_id($synteny_region_id);
ok(test_getter_setter($synteny_region, "_regions", $regions));
done_testing();
};
subtest "Test Bio::EnsEMBL::Compara::SyntenyRegion::get_all_DnaFragRegions method", sub {
my $regions = $dnafrag_region_adaptor->fetch_all_by_synteny_region_id($synteny_region_id);
my $synteny_region = new Bio::EnsEMBL::Compara::SyntenyRegion(-adaptor => $synteny_region_adaptor,
-dbID => $synteny_region_id,
-regions => $regions);
my $dnafrag_regions = $synteny_region->get_all_DnaFragRegions();
foreach my $dnafrag_region (@$dnafrag_regions) {
foreach my $region (@$regions) {
if ($dnafrag_region->dnafrag_id == $region->dnafrag_id) {
is_deeply($dnafrag_region, $region);
}
}
}
done_testing();
};
done_testing();
| 40.22449 | 128 | 0.693303 |
ed7594696e7c3240a1bf534be089f8149d2fe632 | 2,669 | pl | Perl | protein/protein_batch_compute_pI.pl | shenwei356/bio_scripts | 703cec8d21903516346e2aae4d77d23385c30905 | [
"MIT"
] | 94 | 2015-03-26T04:32:29.000Z | 2022-03-22T13:44:11.000Z | protein/protein_batch_compute_pI.pl | xinwang-bio/bio_scripts | 64fda3a72ba14edf87952a809c3d52871f155cca | [
"MIT"
] | null | null | null | protein/protein_batch_compute_pI.pl | xinwang-bio/bio_scripts | 64fda3a72ba14edf87952a809c3d52871f155cca | [
"MIT"
] | 70 | 2015-04-01T10:27:05.000Z | 2021-11-08T01:46:39.000Z | #!/usr/bin/env perl
# Function: Batch compute pI (isoelectric point) and Mw (molecular weight)
# via submiting sequences to Compute pI/Mw tool at ExPASy.
# Author : Wei Shen <shenwei356#gmail.com> http://shenwei.me
# Date : 2013-10-16
# Update : 2014-07-29
use strict;
use BioUtil::Seq;
my $usage = <<"USAGE";
Function: Batch compute pI (isoelectric point) and Mw (molecular weight)
via submiting sequences to Compute pI/Mw tool at ExPASy
Contact: Wei Shen <shenwei356#gmail.com>
Usage: $0 amino_acid_fasta_file
USAGE
die $usage
unless @ARGV == 1;
my $aa_file = shift @ARGV;
# initialize fasta file parser
my $next_seq = FastaReader($aa_file);
# initialize pI request
my $PI = &compute_pi();
my ( $head, $seq );
my ( $success, $pi, $mw );
my $out_file = "$aa_file.result.txt";
open OUT, ">", $out_file
or die "fail to write file $out_file\n";
while ( my $fa = &$next_seq() ) {
my ( $header, $seq ) = @$fa;
( $success, $pi, $mw ) = &$PI($seq);
unless ($success) {
print
"$pi. Please check whether the amino acid sequence contains illegal characters.\r\n"
; # here $pi is the status_line of response
next;
}
print "$header\t$pi\t$mw\r\n";
print OUT "$header\t$pi\t$mw\r\n";
}
close OUT;
# Compute pI/Mw via submiting sequence to Compute pI/Mw tool at ExPASy.
#
# See more: http://web.expasy.org/compute_pi/
#
# Example:
#
# my @proteins = qw/AYYAYYAYAYAY ACACAGACG ---/;
# my $PI = &compute_pi();
# my ( $success, $pi, $mw );
# for my $protein (@proteins) {
# ( $success, $pi, $mw ) = &$PI($protein, "average");
# # ( $success, $pi, $mw ) = &$PI($protein, "monoisotopic");
# unless ($success) {
# print "$pi\n"; # here $pi is the status_line of response
# next;
# }
# print "($pi, $mw)\n";
# }
sub compute_pi() {
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $url = "http://web.expasy.org/cgi-bin/compute_pi/pi_tool";
my ( $res, $formdata, $result );
return sub($$) {
my ( $protein, $resolution ) = @_;
$resolution = "average" unless defined $resolution; # or monoisotopic
$formdata = [
protein => $protein,
resolution => $resolution,
file => ""
];
$res = $ua->post( $url, $formdata );
# 0 means failed
return ( 0, $res->status_line )
unless $res->is_success;
$result = $res->content;
$result =~ /Theoretical pI\/Mw: ([\d\.]+)\s\/\s([\d\.]+)/;
# 1 means success
return ( 1, $1, $2 );
}
}
| 26.959596 | 96 | 0.56051 |
ed4ba88b8dac212528cf4e682d7bf1372f77398f | 1,914 | t | Perl | t/04-possible.t | vrurg/p6-Game-Sudoku | fbc1768eea68c09f0cf554d3a0a962ec87ee713a | [
"Artistic-2.0"
] | null | null | null | t/04-possible.t | vrurg/p6-Game-Sudoku | fbc1768eea68c09f0cf554d3a0a962ec87ee713a | [
"Artistic-2.0"
] | 1 | 2019-10-03T19:34:13.000Z | 2019-10-03T19:34:13.000Z | t/04-possible.t | vrurg/p6-Game-Sudoku | fbc1768eea68c09f0cf554d3a0a962ec87ee713a | [
"Artistic-2.0"
] | 1 | 2019-10-03T19:03:19.000Z | 2019-10-03T19:03:19.000Z | use v6.c;
use Test;
use Game::Sudoku;
my $game = Game::Sudoku.new();
is $game.Str,( "0" x 81 ), "Nothing to see here";
is $game.possible(0,0).sort,(1...9),"Everything is possible";
is $game.cell(0,0,1).Str,"1" ~ ( "0" x 80 ), "Setting returns the updated object";
is $game.cell(0,0),1,"Can also get a cells current value";
is $game.cell(0,1),Nil,"Requesting an unset cell returns Nil";
is $game.possible(0,0).sort,(),"We have no options";
is $game.possible(0,1).sort,(2...9),"We have options";
is $game.possible(0,1).WHAT,Seq,"We have a sequence";
is $game.possible(0,1,:set).WHAT,Set,"We have a set";
is $game.possible(0,0).WHAT,List,"We have a list when there's no options";
is $game.possible(0,0,:set).WHAT,Set,"We have a set";
is $game.valid, True, "Game state is valid";
is $game.cell(0,0,2).Str,"2" ~ ( "0" x 80 ), "Now we have a cell";
is $game.possible(0,0).sort,(),"We have no options";
is $game.possible(0,1).sort,(1,3,4,5,6,7,8,9),"We have options";
is $game.valid, True, "Game state is valid";
is $game.cell(1,0,2).Str,"22" ~ ( 0 x 79 ), "Still getting games";
is $game.valid, False, "Game state is invalid as we have 2 2's";
my $code = "003020600900305001001806400008102900700000008006708200002609500800203009005010300",
$game = Game::Sudoku.new( :code($code) );
is $game.Str, $code, "Game as expected";
is $game.cell(2,0,5).Str, $code, "Can't modify initial values";
is $game.possible(5,0),(1,4,7),"Got expected possibilites";
while [+] (^9 X ^9).map( -> ($x,$y) { ($x,$y) => $game.possible($x,$y) } ).grep( *.value.elems == 1 ).map( -> $p { my ( $x, $y ) = $p.key; $game.cell($x,$y,$p.value[0]); 1; } ) {
ok $game.valid, "Game is valid"
}
ok $game.complete, "Game is complete";
ok $game.valid, "Game is valid";
ok $game.full, "Game is full";
is $game.Str, "483921657967345821251876493548132976729564138136798245372689514814253769695417382", "Got expected solution";
done-testing;
| 44.511628 | 178 | 0.655695 |
ed3c02a6eefe73e50ab8ad7b38c301e869341bfc | 13,243 | pl | Perl | regular-expressions-for-asd-reviews.pl | djireland/ASDReviews | 74d834530f11a3b130fca0e66207e16d1d578246 | [
"MIT"
] | null | null | null | regular-expressions-for-asd-reviews.pl | djireland/ASDReviews | 74d834530f11a3b130fca0e66207e16d1d578246 | [
"MIT"
] | null | null | null | regular-expressions-for-asd-reviews.pl | djireland/ASDReviews | 74d834530f11a3b130fca0e66207e16d1d578246 | [
"MIT"
] | null | null | null | #!/usr/bin/env perl
use strict;
use DBI;
use Lingua::Sentence;
use Lingua::EN::Tagger qw(add_tags);
use HTML::Restrict;
use Data::Dumper;
use constant ASD => "(asd|aspergers|aspie|autie|autistic|autism|on the spectrum)";
use constant HELPS => "(gets (so)? much out of it|helps|helped|assists|enables|engages)";
use constant LIKES => "(obesse(s|ed)|like(s|ed)|love(s|d)|interest(ed|s)|appeal(s|ing))";
use constant RELATIONSHIP => "(boy|girl|[0-9] *yearold|toddler|twins|[0-9] *yr|caregiver|kid|preschooler|school|" .
"year old|[0-9] *y.o.|[0-9 ] *yo|my little one|I(m| am| have| suffer)|famil(ies|y)|" .
"child|children|(god|grand)(son|daughter)|teen|adult|cuz|cousin|bro|brother|sis|" .
"sister|son|daughter|niece|nephew|brother|sister|mother|father|student|classroom)";
use constant EVIDENCE_BASED => "(evidence( |-)based)|(research( |-)based)|developed|consulted|professional|pathologist|therapist";
# Specific ASD Information
use constant FEEDBACK => "(feedback|results|graph|answers|response)";
use constant MOTIVATION => "(encourages|helps|incentive)";
use constant CUSTOM => "(customi(s|z)ation|custom|changing|adapting|personali(s|z)ation|personali(s|z)e)";
use constant INDEPENDENCE => "(by (him|her)self|on (his|her) own|independent|independence|victory|triumph)";
use constant TRIAL => "(part of a clinical trial)";
# Helps With --------
use constant HYGIENE => "(wash(ing)? hands|brush(ing)? (teeth)?|potty|toilet)";
use constant BEHAVIOR => "(compliant|calm down|meltdown|emotion|tantrum|attention|behavior|behaved)";
use constant TRACKER => "(monitor|tracker|track|diary|log)";
use constant LANGUAGE => "(augmentative communication|words|(sounds|sound) out|language|speak|speaking|talk|speech|" .
"aac|picture exchange|words|communicating|communicate|pecs|communication|vocabulary)";
use constant EDUCATION => "((match|matching) (shapes|learning|objects|items|colors)|concepts|animals|alphabet|education|" .
"colors|count|colours|learning|spelling|maths|letters|arithmetic|multiplication|addition|" .
"mathematics|numbers|reading|read|grammar|history|" .
"english|books|maths|sentence)";
use constant ATTENTION => "(engage(s|d)|focuse(d|s)|keeps (his|her) focus|concentration|attention|focus)";
use constant MOTOR => "((fine|gross)? motor|coordination|hand eye coordination|motor skills)";
use constant FOOD => "(eating|eats|food|eaten|diet)";
use constant IMAGINATION => "(writing|imagine|visualize|creating|visualise|story sequencing|imagining|imagination|story telling|comics)";
use constant SENSORY => "(block(s)? (out)? (external|outside)? noise(s)?|visual|sensor|sensory|music|sound|image|touch|" .
"haptic|backgrounds distracting)";
use constant EYE_CONTACT => "(eye contact)";
use constant SOCIAL => "(interact|social|social(ize|ise)|friend(s)?|participate|join in)";
use constant SLEEP => "(sleep|bedtime|nap|bed time)";
use constant EMOTION => "(feelings|calm down|anxieties|anxiety|decrease(s)? (stress(ful)?|anger|depression|sadness|" .
"anxiety)|control(s)? (his|her)? emotion(s)?|clear (his|her) mind)";
# Bad Reviews
use constant ADS => "(ads|advertisement)";
use constant COST => "(price|cost|(waste of|not worth) (the)? money|ripped off|expensive| (can not|can t|cant) (afford|pricey))";
use constant FUNCTION => "((isn t|is not) (opening|working)|broken|bugs|needs fixing|frozen|freezes|confusing|crash(es)?|" .
"crashed|shuts off|bad design|not user friendly)";
use constant CONSIST => "(drama|frustrat(ion|ed)|tantrum(s)?|scream(s|ing))";
use constant MONTHS => "(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)";
use constant YEARS => "(2008|2009|2010|2011|2012|2013|2014|2015|2016)";
sub st # Speech Tagger
{
my $postagger = new Lingua::EN::Tagger;
my $tag = $postagger->add_tags($_[0]);
return $tag;
}
sub sp # splits sentence
{
my $splitter = Lingua::Sentence->new("en");
my $text = $_[0];
my $res = $splitter->split($text);
my @t = split /\n/, $res;
return @t;
}
sub openDatabase
{
# define database name and driver
my $driver = "SQLite";
my $db_name = $_[0]; # Database name
my $dbd = "DBI:$driver:dbname=$db_name";
# sqlite does not have a notion of username/password
my $username = "";
my $password = "";
print STDERR "Openning $db_name\n";
# create and connect to the database.
my $dbh = DBI->connect($dbd, $username, $password, { RaiseError => 0 }) or die $DBI::errstr;
print STDERR "Database opened successfully\n";
return $dbh
}
sub wc # word count
{
my $str = shift;
return 1 + ($str =~ tr{ }{ });
}
sub findApps
{
my $hr = HTML::Restrict->new(); # Removes unwanted HTML
my $dbh = $_[0]; # Database handler
my $dbn = $_[1]; # Databasename
my $stmt = ($dbn =~ m/apple/) ?
qq(SELECT AppleID, Description,Price, HasInAppPurchases from Details;) :
qq(SELECT AppID, Long, Hash, Price, InAppPurchases from Details;);
my $obj = $dbh->prepare($stmt);
my $ret = $obj->execute() or die $DBI::errstr;
my %apps;
while(my @row = $obj->fetchrow_array()) {
my $appID = $row[0];
my $des = $row[1];
my $price = $row[2];
my $inapp = $row[3];
my $hash = $appID . $des;
$des = $hr->process($des);
$des =~ s/[^[a-zA-Z0-9 -!.$]]//g;
my $keywords = ASD;
if ($des =~ /\b$keywords\b/i) { # Match words and be case insensitive
$apps{$appID} = $des . "|" . $price . "|" . $inapp;
}
}
my $size = keys %apps;
print "Found " . $size . " apps" . "\n";
return %apps;
}
sub findEvidenceBased
{
my ($dbh, $dbn) = @_;
my %apps = findApps($dbh, $dbn);
my %eb;
foreach my $key (keys %apps) {
my $app = $apps{$key};
$eb{$key} = $app if match($app, EVIDENCE_BASED);
}
return %eb;
}
sub printHashSize
{
my %hash = @_;
my $size = keys %hash;
print "Hash Size " . $size . "\n";
}
sub findReviews_forApps # Finds the reviews only for apps given
{
my ($dbh, $dbn, %apps) = @_;
my %reviews = findReviews($dbh, $dbn);
my %filtered;
foreach my $key (keys %reviews) {
my ($appID, $title, $body, $rating) = split(/\|/, $reviews{$key});
$filtered{$key} = $reviews{$key} if exists $apps{$appID};
}
printHashSize(%filtered);
return %filtered;
}
sub findReviews_ByAuthor
{
my $dbh = $_[0]; # Database handler
my $dbn = $_[1]; # Databasename
my $aut = $_[2];
my $stmt = $dbn eq "apple.db" ?
qq(SELECT AppleID, Subject,Body,Hash,Rating,Date,AuthorID from Reviews;) :
qq(SELECT AppID, ReviewTitle, Comments, Hash, Rating,Date,UserName from Reviews;);
my $obj = $dbh->prepare($stmt);
my $ret = $obj->execute() or die $DBI::errstr;
my %appData;
while(my @row = $obj->fetchrow_array()) {
my $appID = $row[0];
my $title = lc $row[1];
my $body = lc $row[2];
my $hash = $row[3];
my $rating = $row[4];
my $date = $row[5];
my $authid = $row[6];
$title =~ s/[^[a-zA-Z0-9 !.$]]//g;
$body =~ s/[^[a-zA-Z0-9 !.$]]//g;
my $keywords = ASD;
if ($authid eq $aut) { # Match words and be case insensitive
$keywords = RELATIONSHIP;
my $data= $appID . "|" . $title . "|" . $body . "|" . $rating . "|" . $date . "|" . $authid;
if ($body =~ /\b$keywords\b/i) {
next if wc($body) < 3;
$appData{$hash} = $data;
# print $date . "\n";
} else {
#print $data;
}
}
}
return %appData;
}
sub findReviews
{
my $dbh = $_[0]; # Database handler
my $dbn = $_[1]; # Databasename
my $stmt = $dbn eq "apple.db" ?
qq(SELECT AppleID, Subject,Body,Hash,Rating,Date,AuthorID from Reviews;) :
qq(SELECT AppID, ReviewTitle, Comments, Hash, Rating,Date,UserName from Reviews;);
my $obj = $dbh->prepare($stmt);
my $ret = $obj->execute() or die $DBI::errstr;
my %appData;
while(my @row = $obj->fetchrow_array()) {
my $appID = $row[0];
my $title = lc $row[1];
my $body = lc $row[2];
my $hash = $row[3];
my $rating = $row[4];
my $date = $row[5];
my $authid = $row[6];
$title =~ s/[^[a-zA-Z0-9 !.$]]//g;
$body =~ s/[^[a-zA-Z0-9 !.$]]//g;
my $keywords = ASD;
if ($body =~ /\b$keywords/i) { # Match words and be case insensitive
$keywords = RELATIONSHIP;
my $data= $appID . "|" . $title . "|" . $body . "|" . $rating . "|" . $date . "|" . $authid;
if ($body =~ /\b$keywords\b/i) {
next if wc($body) < 3;
$appData{$hash} = $data;
# print $date . "\n";
} else {
#print $data;
}
}
}
return %appData;
}
sub printRatings
{
my %data = @_;
foreach my $key (keys %data) {
my $row = $data{$key};
my @t = split /\|/, $row;
print $t[3];
}
}
sub dates
{
my %data = @_;
my %years;
foreach my $key (keys %data) {
my $review = $data{$key};
my ($id, $title, $body, $rating, $date) = split(/\|/, $review);
my $regx = YEARS;
if ($date =~ /$regx/i) {
my $ye = $1;
$regx = MONTHS;
if ($date =~ /$regx/i) {
my $mo = $1;
my $key = "01/" . $mo . "/" . $ye;
$years{$key}++;
}
}
}
return %years;
}
sub badReviews
{
my ($max, %data) = @_;
my %bad;
my $cnt = 0;
foreach my $key ( keys %data ) {
my $review = $data{$key};
my ($id, $title, $body, $rating) = split(/\|/, $review);
if ($rating le $max) {
$cnt++;
#print $review . " -> " . $rating . "->" . $max . "\n";
$bad{"ADS"}++ if match($review, ADS);
$bad{"CONSIST"}++ if match($review, FUNCTION) && match($review, CONSIST);
$bad{"COST"}++ if match($review, COST);
$bad{"FUNCTION"}++ if match($review, FUNCTION);
}
}
print STDERR "Found " . $cnt . "\n";
return %bad;
}
sub printBody
{
my %data = @_;
foreach my $key (keys %data) {
my $row = $data{$key};
my @t = split /\|/, $row;
print $t[2];
}
}
sub match
{
my $line = $_[0];
my $regx = $_[1];
return $line =~ /\b$regx\b/i;
}
sub helpsWith
{
my %data = @_;
my $size = keys %data;
my %helps;
my $cnt = 0;
foreach my $key ( keys %data ) {
my $in = $data{$key};
my $review = $in;
my $regx = HELPS;
if ($review =~ /$regx/i) {
$cnt++;
$review = substr($review, $-[0]);
$helps{"SOCIAL"}++ if match($review, SOCIAL);
$helps{"SLEEP"}++ if match($review, SLEEP);
$helps{"HYGIENE"}++ if match($review, HYGIENE);
$helps{"BEHAVIOR"}++ if match($review, BEHAVIOR);
$helps{"TRACKER"}++ if match($review, TRACKER);
$helps{"LANGUAGE"}++ if match($review, LANGUAGE);
$helps{"EDUCATION"}++ if match($review, EDUCATION);
$helps{"ATTENTION"}++ if match($review, ATTENTION);
$helps{"MOTOR"}++ if match($review, MOTOR);
$helps{"FOOD"}++ if match($review, FOOD);
$helps{"IMAGINATION"}++ if match($review, IMAGINATION);
$helps{"SENSORY"}++ if match($review, SENSORY);
$helps{"EYE_CONTACT"}++ if match($review, EYE_CONTACT);
$helps{"EMOTION"}++ if match($review, EMOTION);
}
}
print STDERR "Found " . $cnt . "\n";
return %helps;
}
sub main
{
my $dbn = $ARGV[0];
my $dbh = openDatabase($dbn);
# my %data = findReviews($dbh, $dbn);
#my %data = findReviews_ByAuthor($dbh, $dbn, "184066223");
#my %reviews = findReviews($dbh, $dbn);
#my %data = dates(%reviews);
#my %data = badReviews(5, %reviews);
#my %data = helpsWith(%reviews);
my %data = findEvidenceBased($dbh, $dbn);
#my %apps = findApps($dbh, $dbn);
#my %data = findReviews_forApps($dbh, $dbn, %apps);
# %data = helpsWith(%data);
my @keys = keys %data;
for my $key (@keys) {
print $key . "|" . $data{$key}. "\n";
}
my $size = keys %data;
#print "Size: " . $size . "\n";
$dbh->disconnect();
}
# MAIN ENTRY
main();
| 32.458333 | 137 | 0.527146 |
ed8f6f00495f6616b27e179e404385cd4d77068a | 729 | pm | Perl | lib/BTDT/IM/Command/Tags.pm | whitten/hiveminder | 85f63d2a37e035f1400178990d7759a4885bad06 | [
"Artistic-1.0-Perl"
] | 34 | 2015-05-01T13:40:57.000Z | 2021-12-21T13:01:25.000Z | lib/BTDT/IM/Command/Tags.pm | whitten/hiveminder | 85f63d2a37e035f1400178990d7759a4885bad06 | [
"Artistic-1.0-Perl"
] | 1 | 2021-03-03T18:41:07.000Z | 2021-03-03T18:41:07.000Z | lib/BTDT/IM/Command/Tags.pm | whitten/hiveminder | 85f63d2a37e035f1400178990d7759a4885bad06 | [
"Artistic-1.0-Perl"
] | 20 | 2015-05-01T13:39:53.000Z | 2021-12-21T13:02:10.000Z | package BTDT::IM::Command::Tags;
use strict;
use warnings;
use base 'BTDT::IM::Command';
=head2 run
Runs the 'tags' command, which displays tags.
=cut
sub run {
my $self = shift;
my %args = @_;
my $tasks = BTDT::Model::TaskCollection->new;
$tasks->from_tokens(qw(owner me not complete));
$self->apply_filters($tasks, %args);
$tasks->smart_search($args{message}) if $args{message} ne '';
$tasks->columns('tags', 'owner_id', 'requestor_id', 'group_id');
my $tag_count = $tasks->tags;
delete $tag_count->{''}; # untagged tasks
if (keys %$tag_count == 0) {
return "You have no tags.";
}
return "Tags: " . join ', ', sort { lc($a) cmp lc($b) } keys %$tag_count;
}
1;
| 20.828571 | 77 | 0.603567 |
ed52bcd7f470c6d03027d4d8209832802ca9a3ca | 3,010 | pm | Perl | auto-lib/Paws/S3/CopyObjectOutput.pm | shogo82148/aws-sdk-perl | a87555a9d30dd1415235ebacd2715b2f7e5163c7 | [
"Apache-2.0"
] | null | null | null | auto-lib/Paws/S3/CopyObjectOutput.pm | shogo82148/aws-sdk-perl | a87555a9d30dd1415235ebacd2715b2f7e5163c7 | [
"Apache-2.0"
] | null | null | null | auto-lib/Paws/S3/CopyObjectOutput.pm | shogo82148/aws-sdk-perl | a87555a9d30dd1415235ebacd2715b2f7e5163c7 | [
"Apache-2.0"
] | null | null | null |
package Paws::S3::CopyObjectOutput;
use Moose;
has CopyObjectResult => (is => 'ro', isa => 'Paws::S3::CopyObjectResult', traits => ['ParamInBody']);
has CopySourceVersionId => (is => 'ro', isa => 'Str', header_name => 'x-amz-copy-source-version-id', traits => ['ParamInHeader']);
has Expiration => (is => 'ro', isa => 'Str', header_name => 'x-amz-expiration', traits => ['ParamInHeader']);
has RequestCharged => (is => 'ro', isa => 'Str', header_name => 'x-amz-request-charged', traits => ['ParamInHeader']);
has ServerSideEncryption => (is => 'ro', isa => 'Str', header_name => 'x-amz-server-side-encryption', traits => ['ParamInHeader']);
has SSECustomerAlgorithm => (is => 'ro', isa => 'Str', header_name => 'x-amz-server-side-encryption-customer-algorithm', traits => ['ParamInHeader']);
has SSECustomerKeyMD5 => (is => 'ro', isa => 'Str', header_name => 'x-amz-server-side-encryption-customer-key-MD5', traits => ['ParamInHeader']);
has SSEKMSEncryptionContext => (is => 'ro', isa => 'Str', header_name => 'x-amz-server-side-encryption-context', traits => ['ParamInHeader']);
has SSEKMSKeyId => (is => 'ro', isa => 'Str', header_name => 'x-amz-server-side-encryption-aws-kms-key-id', traits => ['ParamInHeader']);
has VersionId => (is => 'ro', isa => 'Str', header_name => 'x-amz-version-id', traits => ['ParamInHeader']);
has _request_id => (is => 'ro', isa => 'Str');
1;
### main pod documentation begin ###
=head1 NAME
Paws::S3::CopyObjectOutput
=head1 ATTRIBUTES
=head2 CopyObjectResult => L<Paws::S3::CopyObjectResult>
Container for all response elements.
=head2 CopySourceVersionId => Str
Version of the copied object in the destination bucket.
=head2 Expiration => Str
If the object expiration is configured, the response includes this
header.
=head2 RequestCharged => Str
Valid values are: C<"requester">
=head2 ServerSideEncryption => Str
The server-side encryption algorithm used when storing this object in
Amazon S3 (for example, AES256, aws:kms).
Valid values are: C<"AES256">, C<"aws:kms">
=head2 SSECustomerAlgorithm => Str
If server-side encryption with a customer-provided encryption key was
requested, the response will include this header confirming the
encryption algorithm used.
=head2 SSECustomerKeyMD5 => Str
If server-side encryption with a customer-provided encryption key was
requested, the response will include this header to provide round-trip
message integrity verification of the customer-provided encryption key.
=head2 SSEKMSEncryptionContext => Str
If present, specifies the AWS KMS Encryption Context to use for object
encryption. The value of this header is a base64-encoded UTF-8 string
holding JSON with the encryption context key-value pairs.
=head2 SSEKMSKeyId => Str
If present, specifies the ID of the AWS Key Management Service (AWS
KMS) symmetric customer managed customer master key (CMK) that was used
for the object.
=head2 VersionId => Str
Version ID of the newly created copy.
=cut
| 29.80198 | 152 | 0.710631 |
ed93314bf6cffc3a626f59f7f4c01347e2ebcf9b | 2,284 | pl | Perl | release/src/btools/uversion.pl | ghsecuritylab/tomato-sabai | 9027a38297d32e97dd386499cca4a583e25d1f9d | [
"Apache-2.0"
] | null | null | null | release/src/btools/uversion.pl | ghsecuritylab/tomato-sabai | 9027a38297d32e97dd386499cca4a583e25d1f9d | [
"Apache-2.0"
] | null | null | null | release/src/btools/uversion.pl | ghsecuritylab/tomato-sabai | 9027a38297d32e97dd386499cca4a583e25d1f9d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/perl
#
# uversion.pl
# Copyright (C) 2006 Jonathan Zarate
#
# - update the build number for Tomato
# !!TB - Added version suffix
#
use POSIX qw(strftime);
sub error
{
print "\nuversion error: $_\n";
exit(1);
}
sub help
{
print "Usage: uversion --bump|--gen\n";
exit(1);
}
#
#
if ($#ARGV < 0) {
help();
}
$path = "router/shared";
$major = 0;
$minor = 0;
$build = 0;
$space = "";
$suffix = "";
open(F, "$path/tomato_version") || error("opening tomato_version: $!");
$_ = <F>;
if (!(($major, $minor, $build, $space, $suffix) = /^(\d+)\.(\d+)\.(\d+)(\s+)?(.+)?$/)) {
error("Invalid version: '$_'");
}
close(F);
if ($ARGV[0] eq "--bump") {
++$build;
open(F, ">$path/tomato_version.~") || error("creating temp file: $!");
printf F "%d.%02d.%04d %s", $major, $minor, $build, $suffix;
close(F);
rename("$path/tomato_version.~", "$path/tomato_version") || error("renaming: $!");
exit(0);
}
if ($ARGV[0] ne "--gen") {
help();
}
$time = strftime("%a, %d %b %Y %H:%M:%S %z", localtime());
$minor = sprintf("%02d", $minor);
$build = sprintf("%04d", $build);
# read the build number from the command line
if ($#ARGV > 0) {
if ($ARGV[1] ne "--def") {
$build = sprintf("%04d", $ARGV[1]);
}
}
# read the version suffix from the command line
if ($#ARGV > 1) {
$start = 2;
$stop = $#ARGV;
$suffix = "";
for ($i=$start; $i <= $stop; $i++) {
if ($suffix eq "") {
$suffix = $ARGV[$i];
}
elsif ($ARGV[$i] ne "") {
$suffix = sprintf("%s %s", $suffix, $ARGV[$i]);
}
}
}
open(F, ">$path/tomato_version.h~") || error("creating temp file: $!");
print F <<"END";
#ifndef __TOMATO_VERSION_H__
#define __TOMATO_VERSION_H__
#define TOMATO_MAJOR "$major"
#define TOMATO_MINOR "$minor"
#define TOMATO_BUILD "$build"
#define TOMATO_BUILDTIME "$time"
#define TOMATO_VERSION "$major.$minor.$build $suffix"
#define TOMATO_SHORTVER "$major.$minor"
#endif
END
close(F);
rename("$path/tomato_version.h~", "$path/tomato_version.h") || error("renaming: $!");
open(F, ">$path/tomato_version.~") || error("creating temp file: $!");
printf F "%d.%02d.%04d %s", $major, $minor, $build, $suffix;
close(F);
rename("$path/tomato_version.~", "$path/tomato_version") || error("renaming: $!");
print "Version: $major.$minor.$build $suffix ($time)\n";
exit(0);
| 21.54717 | 88 | 0.588004 |
ed87edb4823bd72af3f9cf9447064ee1f5bfcf07 | 7,190 | pm | Perl | perl/lib/WWW/OpenAPIClientcom.spoonacular.client.model/InlineResponse20016.pm | ddsky/spoonacular-api-clients | 63f955ceb2c356fefdd48ec634deb3c3e16a6ae7 | [
"MIT"
] | 21 | 2019-08-09T18:53:26.000Z | 2022-03-14T22:10:10.000Z | perl/lib/WWW/OpenAPIClientcom.spoonacular.client.model/InlineResponse20016.pm | ddsky/spoonacular-api-clients | 63f955ceb2c356fefdd48ec634deb3c3e16a6ae7 | [
"MIT"
] | null | null | null | perl/lib/WWW/OpenAPIClientcom.spoonacular.client.model/InlineResponse20016.pm | ddsky/spoonacular-api-clients | 63f955ceb2c356fefdd48ec634deb3c3e16a6ae7 | [
"MIT"
] | 55 | 2019-08-13T17:52:47.000Z | 2022-03-27T04:29:34.000Z | =begin comment
spoonacular API
The spoonacular Nutrition, Recipe, and Food API allows you to access over 380,000 recipes, thousands of ingredients, 800,000 food products, and 100,000 menu items. Our food ontology and semantic recipe search engine makes it possible to search for recipes using natural language queries, such as \"gluten free brownies without sugar\" or \"low fat vegan cupcakes.\" You can automatically calculate the nutritional information for any recipe, analyze recipe costs, visualize ingredient lists, find recipes for what's in your fridge, find recipes based on special diets, nutritional requirements, or favorite ingredients, classify recipes into types and cuisines, convert ingredient amounts, or even compute an entire meal plan. With our powerful API, you can create many kinds of food and especially nutrition apps. Special diets/dietary requirements currently available include: vegan, vegetarian, pescetarian, gluten free, grain free, dairy free, high protein, whole 30, low sodium, low carb, Paleo, ketogenic, FODMAP, and Primal.
The version of the OpenAPI document: 1.0
Contact: mail@spoonacular.com
Generated by: https://openapi-generator.tech
=end comment
=cut
#
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# Do not edit the class manually.
# Ref: https://openapi-generator.tech
#
package WWW::OpenAPIClient::Object::InlineResponse20016;
require 5.6.0;
use strict;
use warnings;
use utf8;
use JSON qw(decode_json);
use Data::Dumper;
use Module::Runtime qw(use_module);
use Log::Any qw($log);
use Date::Parse;
use DateTime;
use base ("Class::Accessor", "Class::Data::Inheritable");
#
#
#
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). Do not edit the class manually.
# REF: https://openapi-generator.tech
#
=begin comment
spoonacular API
The spoonacular Nutrition, Recipe, and Food API allows you to access over 380,000 recipes, thousands of ingredients, 800,000 food products, and 100,000 menu items. Our food ontology and semantic recipe search engine makes it possible to search for recipes using natural language queries, such as \"gluten free brownies without sugar\" or \"low fat vegan cupcakes.\" You can automatically calculate the nutritional information for any recipe, analyze recipe costs, visualize ingredient lists, find recipes for what's in your fridge, find recipes based on special diets, nutritional requirements, or favorite ingredients, classify recipes into types and cuisines, convert ingredient amounts, or even compute an entire meal plan. With our powerful API, you can create many kinds of food and especially nutrition apps. Special diets/dietary requirements currently available include: vegan, vegetarian, pescetarian, gluten free, grain free, dairy free, high protein, whole 30, low sodium, low carb, Paleo, ketogenic, FODMAP, and Primal.
The version of the OpenAPI document: 1.0
Contact: mail@spoonacular.com
Generated by: https://openapi-generator.tech
=end comment
=cut
#
# NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
# Do not edit the class manually.
# Ref: https://openapi-generator.tech
#
__PACKAGE__->mk_classdata('attribute_map' => {});
__PACKAGE__->mk_classdata('openapi_types' => {});
__PACKAGE__->mk_classdata('method_documentation' => {});
__PACKAGE__->mk_classdata('class_documentation' => {});
# new plain object
sub new {
my ($class, %args) = @_;
my $self = bless {}, $class;
$self->init(%args);
return $self;
}
# initialize the object
sub init
{
my ($self, %args) = @_;
foreach my $attribute (keys %{$self->attribute_map}) {
my $args_key = $self->attribute_map->{$attribute};
$self->$attribute( $args{ $args_key } );
}
}
# return perl hash
sub to_hash {
my $self = shift;
my $_hash = decode_json(JSON->new->convert_blessed->encode($self));
return $_hash;
}
# used by JSON for serialization
sub TO_JSON {
my $self = shift;
my $_data = {};
foreach my $_key (keys %{$self->attribute_map}) {
if (defined $self->{$_key}) {
$_data->{$self->attribute_map->{$_key}} = $self->{$_key};
}
}
return $_data;
}
# from Perl hashref
sub from_hash {
my ($self, $hash) = @_;
# loop through attributes and use openapi_types to deserialize the data
while ( my ($_key, $_type) = each %{$self->openapi_types} ) {
my $_json_attribute = $self->attribute_map->{$_key};
if ($_type =~ /^array\[(.+)\]$/i) { # array
my $_subclass = $1;
my @_array = ();
foreach my $_element (@{$hash->{$_json_attribute}}) {
push @_array, $self->_deserialize($_subclass, $_element);
}
$self->{$_key} = \@_array;
} elsif ($_type =~ /^hash\[string,(.+)\]$/i) { # hash
my $_subclass = $1;
my %_hash = ();
while (my($_key, $_element) = each %{$hash->{$_json_attribute}}) {
$_hash{$_key} = $self->_deserialize($_subclass, $_element);
}
$self->{$_key} = \%_hash;
} elsif (exists $hash->{$_json_attribute}) { #hash(model), primitive, datetime
$self->{$_key} = $self->_deserialize($_type, $hash->{$_json_attribute});
} else {
$log->debugf("Warning: %s (%s) does not exist in input hash\n", $_key, $_json_attribute);
}
}
return $self;
}
# deserialize non-array data
sub _deserialize {
my ($self, $type, $data) = @_;
$log->debugf("deserializing %s with %s",Dumper($data), $type);
if ($type eq 'DateTime') {
return DateTime->from_epoch(epoch => str2time($data));
} elsif ( grep( /^$type$/, ('int', 'double', 'string', 'boolean'))) {
return $data;
} else { # hash(model)
my $_instance = eval "WWW::OpenAPIClient::Object::$type->new()";
return $_instance->from_hash($data);
}
}
__PACKAGE__->class_documentation({description => '',
class => 'InlineResponse20016',
required => [], # TODO
} );
__PACKAGE__->method_documentation({
'parsed_instructions' => {
datatype => 'ARRAY[object]',
base_name => 'parsedInstructions',
description => '',
format => '',
read_only => '',
},
'ingredients' => {
datatype => 'ARRAY[object]',
base_name => 'ingredients',
description => '',
format => '',
read_only => '',
},
'equipment' => {
datatype => 'ARRAY[object]',
base_name => 'equipment',
description => '',
format => '',
read_only => '',
},
});
__PACKAGE__->openapi_types( {
'parsed_instructions' => 'ARRAY[object]',
'ingredients' => 'ARRAY[object]',
'equipment' => 'ARRAY[object]'
} );
__PACKAGE__->attribute_map( {
'parsed_instructions' => 'parsedInstructions',
'ingredients' => 'ingredients',
'equipment' => 'equipment'
} );
__PACKAGE__->mk_accessors(keys %{__PACKAGE__->attribute_map});
1;
| 35.418719 | 1,032 | 0.645758 |
ed69205ff3af61436dfeaa8e103c3ca6cd04b7e5 | 4,226 | pl | Perl | webapp/perl/local/lib/perl5/auto/share/dist/DateTime-Locale/vo.pl | tomoyanp/isucon9-qualify-20210912 | f84b5d1c82f9d41bbba02422c1a6acd358d9c41a | [
"MIT"
] | null | null | null | webapp/perl/local/lib/perl5/auto/share/dist/DateTime-Locale/vo.pl | tomoyanp/isucon9-qualify-20210912 | f84b5d1c82f9d41bbba02422c1a6acd358d9c41a | [
"MIT"
] | 5 | 2021-05-20T04:16:14.000Z | 2022-02-12T01:40:02.000Z | webapp/perl/local/lib/perl5/auto/share/dist/DateTime-Locale/vo.pl | matsubara0507/isucon9-kansousen | 77b19085d76add98a3ce7370063a8636cde62499 | [
"MIT"
] | null | null | null | {
am_pm_abbreviated => [
"AM",
"PM",
],
available_formats => {
Bh => "h B",
Bhm => "h:mm B",
Bhms => "h:mm:ss B",
E => "ccc",
EBhm => "E h:mm B",
EBhms => "E h:mm:ss B",
EHm => "E HH:mm",
EHms => "E HH:mm:ss",
Ed => "d, E",
Ehm => "E h:mm a",
Ehms => "E h:mm:ss a",
Gy => "G y",
GyMMM => "G y MMM",
GyMMMEd => "G y MMM d, E",
GyMMMd => "G y MMM d",
H => "HH",
Hm => "HH:mm",
Hms => "HH:mm:ss",
Hmsv => "HH:mm:ss v",
Hmv => "HH:mm v",
M => "L",
MEd => "MM-dd, E",
MMM => "LLL",
MMMEd => "MMM d, E",
"MMMMW-count-other" => "'week' W 'of' MMMM",
MMMMd => "MMMM d",
MMMd => "MMM d",
Md => "MM-dd",
d => "d",
h => "h a",
hm => "h:mm a",
hms => "h:mm:ss a",
hmsv => "h:mm:ss a v",
hmv => "h:mm a v",
ms => "mm:ss",
y => "y",
yM => "y-MM",
yMEd => "y-MM-dd, E",
yMMM => "y MMM",
yMMMEd => "y MMM d, E",
yMMMM => "y MMMM",
yMMMd => "y MMM d",
yMd => "y-MM-dd",
yQQQ => "y QQQ",
yQQQQ => "y QQQQ",
"yw-count-other" => "'week' w 'of' Y",
},
code => "vo",
date_format_full => "y MMMM d, EEEE",
date_format_long => "y MMMM d",
date_format_medium => "y MMM d",
date_format_short => "y-MM-dd",
datetime_format_full => "{1} {0}",
datetime_format_long => "{1} {0}",
datetime_format_medium => "{1} {0}",
datetime_format_short => "{1} {0}",
day_format_abbreviated => [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun",
],
day_format_narrow => [
"M",
"T",
"W",
"T",
"F",
"S",
"S",
],
day_format_wide => [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun",
],
day_stand_alone_abbreviated => [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun",
],
day_stand_alone_narrow => [
"M",
"T",
"W",
"T",
"F",
"S",
"S",
],
day_stand_alone_wide => [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun",
],
era_abbreviated => [
"BCE",
"CE",
],
era_narrow => [
"BCE",
"CE",
],
era_wide => [
"BCE",
"CE",
],
first_day_of_week => 1,
glibc_date_1_format => "%a %b %e %H:%M:%S %Z %Y",
glibc_date_format => "%m/%d/%y",
glibc_datetime_format => "%a %b %e %H:%M:%S %Y",
glibc_time_12_format => "%I:%M:%S %p",
glibc_time_format => "%H:%M:%S",
language => "Volap\N{U+00fc}k",
month_format_abbreviated => [
"M01",
"M02",
"M03",
"M04",
"M05",
"M06",
"M07",
"M08",
"M09",
"M10",
"M11",
"M12",
],
month_format_narrow => [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
],
month_format_wide => [
"M01",
"M02",
"M03",
"M04",
"M05",
"M06",
"M07",
"M08",
"M09",
"M10",
"M11",
"M12",
],
month_stand_alone_abbreviated => [
"M01",
"M02",
"M03",
"M04",
"M05",
"M06",
"M07",
"M08",
"M09",
"M10",
"M11",
"M12",
],
month_stand_alone_narrow => [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
],
month_stand_alone_wide => [
"M01",
"M02",
"M03",
"M04",
"M05",
"M06",
"M07",
"M08",
"M09",
"M10",
"M11",
"M12",
],
name => "Volap\N{U+00fc}k",
native_language => "vo",
native_name => "vo",
native_script => undef,
native_territory => undef,
native_variant => undef,
quarter_format_abbreviated => [
"Q1",
"Q2",
"Q3",
"Q4",
],
quarter_format_narrow => [
1,
2,
3,
4,
],
quarter_format_wide => [
"Q1",
"Q2",
"Q3",
"Q4",
],
quarter_stand_alone_abbreviated => [
"Q1",
"Q2",
"Q3",
"Q4",
],
quarter_stand_alone_narrow => [
1,
2,
3,
4,
],
quarter_stand_alone_wide => [
"Q1",
"Q2",
"Q3",
"Q4",
],
script => undef,
territory => undef,
time_format_full => "HH:mm:ss zzzz",
time_format_long => "HH:mm:ss z",
time_format_medium => "HH:mm:ss",
time_format_short => "HH:mm",
variant => undef,
version => 35,
}
| 15.594096 | 51 | 0.421912 |
ed7ca4555d863b39538a9d5bf06667411a8ceb4c | 1,849 | pl | Perl | flow/main.pl | necavit/li-sat-encoded | cf15a0acc580ae4feaeb3ac03268269fd44c1add | [
"MIT"
] | null | null | null | flow/main.pl | necavit/li-sat-encoded | cf15a0acc580ae4feaeb3ac03268269fd44c1add | [
"MIT"
] | null | null | null | flow/main.pl | necavit/li-sat-encoded | cf15a0acc580ae4feaeb3ac03268269fd44c1add | [
"MIT"
] | null | null | null | :-dynamic(varNumber/3).
% ========== No need to change the following: =====================================
main:- symbolicOutput(1), !, writeClauses, halt. % escribir bonito, no ejecutar
main:- assert(numClauses(0)), assert(numVars(0)),
tell(clauses), writeClauses, told,
tell(header), writeHeader, told,
unix('cat header clauses > infile.cnf'),
unix('picosat -v -o model infile.cnf'),
unix('rm header'), unix('rm clauses'), unix('rm infile.cnf'),
see(model), readModel(M), seen,
unix('rm model'),
displaySol(M),
halt.
var2num(T,N):- hash_term(T,Key), varNumber(Key,T,N),!.
var2num(T,N):- retract(numVars(N0)), N is N0+1, assert(numVars(N)), hash_term(T,Key),
assert(varNumber(Key,T,N)), assert( num2var(N,T) ), !.
writeHeader:- numVars(N),numClauses(C),write('p cnf '),write(N), write(' '),write(C),nl.
countClause:- retract(numClauses(N)), N1 is N+1, assert(numClauses(N1)),!.
writeClause([]):- symbolicOutput(1),!, nl.
writeClause([]):- countClause, write(0), nl.
writeClause([Lit|C]):- w(Lit), writeClause(C),!.
w( Lit ):- symbolicOutput(1), write(Lit), write(' '),!.
w(\+Var):- var2num(Var,N), write(-), write(N), write(' '),!.
w( Var):- var2num(Var,N), write(N), write(' '),!.
unix(Comando):-shell(Comando),!.
unix(_).
readModel(L):- get_code(Char), readWord(Char,W), readModel(L1), addIfPositiveInt(W,L1,L),!.
readModel([]).
addIfPositiveInt(W,L,[N|L]):- W = [C|_], between(48,57,C), number_codes(N,W), N>0, !.
addIfPositiveInt(_,L,L).
readWord(99,W):- repeat, get_code(Ch), member(Ch,[-1,10]), !, get_code(Ch1), readWord(Ch1,W),!.
readWord(-1,_):-!, fail. %end of file
readWord(C,[]):- member(C,[10,32]), !. % newline or white space marks end of word
readWord(Char,[Char|W]):- get_code(Char1), readWord(Char1,W), !.
%========================================================================================
| 41.088889 | 95 | 0.59762 |
ed0a68271d49500f30cfa87c9be8b3bb5116f70b | 8,770 | pm | Perl | tools/scitools/bin/linux64/Perl/Module/Build/Platform/VMS.pm | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | 1 | 2020-01-20T21:26:46.000Z | 2020-01-20T21:26:46.000Z | tools/scitools/bin/linux64/Perl/Module/Build/Platform/VMS.pm | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | tools/scitools/bin/linux64/Perl/Module/Build/Platform/VMS.pm | brucegua/moocos | 575c161cfa35e220f10d042e2e5ca18773691695 | [
"Apache-2.0"
] | null | null | null | package Module::Build::Platform::VMS;
use strict;
use vars qw($VERSION);
$VERSION = '0.2808_01';
$VERSION = eval $VERSION;
use Module::Build::Base;
use vars qw(@ISA);
@ISA = qw(Module::Build::Base);
=head1 NAME
Module::Build::Platform::VMS - Builder class for VMS platforms
=head1 DESCRIPTION
This module inherits from C<Module::Build::Base> and alters a few
minor details of its functionality. Please see L<Module::Build> for
the general docs.
=head2 Overridden Methods
=over 4
=item _set_defaults
Change $self->{build_script} to 'Build.com' so @Build works.
=cut
sub _set_defaults {
my $self = shift;
$self->SUPER::_set_defaults(@_);
$self->{properties}{build_script} = 'Build.com';
}
=item cull_args
'@Build foo' on VMS will not preserve the case of 'foo'. Rather than forcing
people to write '@Build "foo"' we'll dispatch case-insensitively.
=cut
sub cull_args {
my $self = shift;
my($action, $args) = $self->SUPER::cull_args(@_);
my @possible_actions = grep { lc $_ eq lc $action } $self->known_actions;
die "Ambiguous action '$action'. Could be one of @possible_actions"
if @possible_actions > 1;
return ($possible_actions[0], $args);
}
=item manpage_separator
Use '__' instead of '::'.
=cut
sub manpage_separator {
return '__';
}
=item prefixify
Prefixify taking into account VMS' filepath syntax.
=cut
# Translated from ExtUtils::MM_VMS::prefixify()
sub _prefixify {
my($self, $path, $sprefix, $type) = @_;
my $rprefix = $self->prefix;
$self->log_verbose(" prefixify $path from $sprefix to $rprefix\n");
# Translate $(PERLPREFIX) to a real path.
$rprefix = VMS::Filespec::vmspath($rprefix) if $rprefix;
$sprefix = VMS::Filespec::vmspath($sprefix) if $sprefix;
$self->log_verbose(" rprefix translated to $rprefix\n".
" sprefix translated to $sprefix\n");
if( length $path == 0 ) {
$self->log_verbose(" no path to prefixify.\n")
}
elsif( !File::Spec->file_name_is_absolute($path) ) {
$self->log_verbose(" path is relative, not prefixifying.\n");
}
elsif( $sprefix eq $rprefix ) {
$self->log_verbose(" no new prefix.\n");
}
else {
my($path_vol, $path_dirs) = File::Spec->splitpath( $path );
my $vms_prefix = $self->config('vms_prefix');
if( $path_vol eq $vms_prefix.':' ) {
$self->log_verbose(" $vms_prefix: seen\n");
$path_dirs =~ s{^\[}{\[.} unless $path_dirs =~ m{^\[\.};
$path = $self->_catprefix($rprefix, $path_dirs);
}
else {
$self->log_verbose(" cannot prefixify.\n");
return $self->prefix_relpaths($self->installdirs, $type);
}
}
$self->log_verbose(" now $path\n");
return $path;
}
=item _quote_args
Command-line arguments (but not the command itself) must be quoted
to ensure case preservation.
=cut
sub _quote_args {
# Returns a string that can become [part of] a command line with
# proper quoting so that the subprocess sees this same list of args,
# or if we get a single arg that is an array reference, quote the
# elements of it and return the reference.
my ($self, @args) = @_;
my $got_arrayref = (scalar(@args) == 1
&& UNIVERSAL::isa($args[0], 'ARRAY'))
? 1
: 0;
map { $_ = q(").$_.q(") if !/^\"/ && length($_) > 0 }
($got_arrayref ? @{$args[0]}
: @args
);
return $got_arrayref ? $args[0]
: join(' ', @args);
}
=item have_forkpipe
There is no native fork(), so some constructs depending on it are not
available.
=cut
sub have_forkpipe { 0 }
=item _backticks
Override to ensure that we quote the arguments but not the command.
=cut
sub _backticks {
# The command must not be quoted but the arguments to it must be.
my ($self, @cmd) = @_;
my $cmd = shift @cmd;
my $args = $self->_quote_args(@cmd);
return `$cmd $args`;
}
=item do_system
Override to ensure that we quote the arguments but not the command.
=cut
sub do_system {
# The command must not be quoted but the arguments to it must be.
my ($self, @cmd) = @_;
$self->log_info("@cmd\n");
my $cmd = shift @cmd;
my $args = $self->_quote_args(@cmd);
return !system("$cmd $args");
}
=item _infer_xs_spec
Inherit the standard version but tweak the library file name to be
something Dynaloader can find.
=cut
sub _infer_xs_spec {
my $self = shift;
my $file = shift;
my $spec = $self->SUPER::_infer_xs_spec($file);
# Need to create with the same name as DynaLoader will load with.
if (defined &DynaLoader::mod2fname) {
my $file = $$spec{module_name} . '.' . $self->{config}->get('dlext');
$file =~ tr/:/_/;
$file = DynaLoader::mod2fname([$file]);
$$spec{lib_file} = File::Spec->catfile($$spec{archdir}, $file);
}
return $spec;
}
=item rscan_dir
Inherit the standard version but remove dots at end of name. This may not be
necessary if File::Find has been fixed or DECC$FILENAME_UNIX_REPORT is in effect.
=cut
sub rscan_dir {
my ($self, $dir, $pattern) = @_;
my $result = $self->SUPER::rscan_dir( $dir, $pattern );
for my $file (@$result) { $file =~ s/\.$//; }
return $result;
}
=item dist_dir
Inherit the standard version but replace embedded dots with underscores because
a dot is the directory delimiter on VMS.
=cut
sub dist_dir {
my $self = shift;
my $dist_dir = $self->SUPER::dist_dir;
$dist_dir =~ s/\./_/g;
return $dist_dir;
}
=item man3page_name
Inherit the standard version but chop the extra manpage delimiter off the front if
there is one. The VMS version of splitdir('[.foo]') returns '', 'foo'.
=cut
sub man3page_name {
my $self = shift;
my $mpname = $self->SUPER::man3page_name( shift );
my $sep = $self->manpage_separator;
$mpname =~ s/^$sep//;
return $mpname;
}
=item expand_test_dir
Inherit the standard version but relativize the paths as the native glob() doesn't
do that for us.
=cut
sub expand_test_dir {
my ($self, $dir) = @_;
my @reldirs = $self->SUPER::expand_test_dir( $dir );
for my $eachdir (@reldirs) {
my ($v,$d,$f) = File::Spec->splitpath( $eachdir );
my $reldir = File::Spec->abs2rel( File::Spec->catpath( $v, $d, '' ) );
$eachdir = File::Spec->catfile( $reldir, $f );
}
return @reldirs;
}
=item _detildefy
The home-grown glob() does not currently handle tildes, so provide limited support
here. Expect only UNIX format file specifications for now.
=cut
sub _detildefy {
my ($self, $arg) = @_;
# Apparently double ~ are not translated.
return $arg if ($arg =~ /^~~/);
# Apparently ~ followed by whitespace are not translated.
return $arg if ($arg =~ /^~ /);
if ($arg =~ /^~/) {
my $spec = $arg;
# Remove the tilde
$spec =~ s/^~//;
# Remove any slash folloing the tilde if present.
$spec =~ s#^/##;
# break up the paths for the merge
my $home = VMS::Filespec::unixify($ENV{HOME});
# Trivial case of just ~ by it self
if ($spec eq '') {
return $home;
}
my ($hvol, $hdir, $hfile) = File::Spec::Unix->splitpath($home);
if ($hdir eq '') {
# Someone has tampered with $ENV{HOME}
# So hfile is probably the directory since this should be
# a path.
$hdir = $hfile;
}
my ($vol, $dir, $file) = File::Spec::Unix->splitpath($spec);
my @hdirs = File::Spec::Unix->splitdir($hdir);
my @dirs = File::Spec::Unix->splitdir($dir);
my $newdirs;
# Two cases of tilde handling
if ($arg =~ m#^~/#) {
# Simple case, just merge together
$newdirs = File::Spec::Unix->catdir(@hdirs, @dirs);
} else {
# Complex case, need to add an updir - No delimiters
my @backup = File::Spec::Unix->splitdir(File::Spec::Unix->updir);
$newdirs = File::Spec::Unix->catdir(@hdirs, @backup, @dirs);
}
# Now put the two cases back together
$arg = File::Spec::Unix->catpath($hvol, $newdirs, $file);
} else {
return $arg;
}
}
=item find_perl_interpreter
On VMS, $^X returns the fully qualified absolute path including version
number. It's logically impossible to improve on it for getting the perl
we're currently running, and attempting to manipulate it is usually
lossy.
=cut
sub find_perl_interpreter { return $^X; }
=back
=head1 AUTHOR
Michael G Schwern <schwern@pobox.com>
Ken Williams <kwilliams@cpan.org>
Craig A. Berry <craigberry@mac.com>
=head1 SEE ALSO
perl(1), Module::Build(3), ExtUtils::MakeMaker(3)
=cut
1;
__END__
| 23.324468 | 83 | 0.616648 |
ed3802b8813474d28927aeca040c1502433c5d2c | 2,008 | t | Perl | test/pull.t | jameswalmsley/git-subrepo | 678c8dcde1061f5f32753662b13fc915ae7f62fa | [
"MIT"
] | 2,695 | 2015-01-07T06:59:42.000Z | 2022-03-30T08:50:21.000Z | test/pull.t | jameswalmsley/git-subrepo | 678c8dcde1061f5f32753662b13fc915ae7f62fa | [
"MIT"
] | 506 | 2015-01-06T19:43:16.000Z | 2022-03-24T15:12:54.000Z | test/pull.t | jameswalmsley/git-subrepo | 678c8dcde1061f5f32753662b13fc915ae7f62fa | [
"MIT"
] | 285 | 2015-01-26T22:46:43.000Z | 2022-03-29T16:03:22.000Z | #!/usr/bin/env bash
set -e
source test/setup
use Test::More
clone-foo-and-bar
subrepo-clone-bar-into-foo
(
cd "$OWNER/bar"
add-new-files Bar2
git push
) &> /dev/null || die
# Do the pull and check output:
{
is "$(
cd "$OWNER/foo"
git subrepo pull bar
)" \
"Subrepo 'bar' pulled from '$UPSTREAM/bar' (master)." \
'subrepo pull command output is correct'
}
# Test subrepo file content:
gitrepo=$OWNER/foo/bar/.gitrepo
{
test-exists \
"$OWNER/foo/bar/Bar2" \
"$gitrepo"
}
# Test foo/bar/.gitrepo file contents:
{
foo_pull_commit=$(cd "$OWNER/foo"; git rev-parse HEAD^)
bar_head_commit=$(cd "$OWNER/bar"; git rev-parse HEAD)
test-gitrepo-comment-block
test-gitrepo-field "remote" "$UPSTREAM/bar"
test-gitrepo-field "branch" "master"
test-gitrepo-field "commit" "$bar_head_commit"
test-gitrepo-field "parent" "$foo_pull_commit"
test-gitrepo-field "cmdver" "$(git subrepo --version)"
}
# Check commit messages
{
foo_new_commit_message=$(cd "$OWNER/foo"; git log --format=%B -n 1)
like "$foo_new_commit_message" \
"git subrepo pull bar" \
"Subrepo pull commit message OK"
bar_commit_short=$(git rev-parse --short "$bar_head_commit")
like "$foo_new_commit_message" \
"merged: \"$bar_commit_short" \
"Pull commit contains merged"
}
# Check that we detect that we don't need to pull
{
is "$(
cd "$OWNER/foo"
git subrepo pull bar
)" \
"Subrepo 'bar' is up to date." \
'subrepo detects that we dont need to pull'
}
# Test pull if we have rebased the original subrepo so that our clone
# commit is no longer present in the history
(
cd "$OWNER/bar"
git reset --hard master^^
add-new-files Bar3
git push --force
) &> /dev/null || die
{
test-exists \
!"$OWNER/foo/pull_failed"
}
(
cd "$OWNER/foo"
git subrepo pull bar || touch pull_failed
) &> /dev/null || die
# We check that the control file was created
{
test-exists \
"$OWNER/foo/pull_failed"
}
done_testing # 9
teardown
| 20.08 | 69 | 0.659363 |
ed911528ac476cd62fc8b8b9de829a42ffbb8902 | 3,846 | pm | Perl | lib/MooseX/Storage/Basic.pm | git-the-cpan/MooseX-Storage | 5b2e16f8f92c4c4f5e5fa6fe66fb01eeb18a2627 | [
"Artistic-1.0"
] | null | null | null | lib/MooseX/Storage/Basic.pm | git-the-cpan/MooseX-Storage | 5b2e16f8f92c4c4f5e5fa6fe66fb01eeb18a2627 | [
"Artistic-1.0"
] | null | null | null | lib/MooseX/Storage/Basic.pm | git-the-cpan/MooseX-Storage | 5b2e16f8f92c4c4f5e5fa6fe66fb01eeb18a2627 | [
"Artistic-1.0"
] | null | null | null | package MooseX::Storage::Basic;
# ABSTRACT: The simplest level of serialization
our $VERSION = '0.51'; # TRIAL
use Moose::Role;
use MooseX::Storage::Engine;
use String::RewritePrefix;
use namespace::autoclean;
sub pack {
my ( $self, %args ) = @_;
my $e = $self->_storage_get_engine_class(%args)->new( object => $self );
$e->collapse_object(%args);
}
sub unpack {
my ($class, $data, %args) = @_;
my $e = $class->_storage_get_engine_class(%args)->new(class => $class);
$class->_storage_construct_instance(
$e->expand_object($data, %args),
\%args
);
}
sub _storage_get_engine_class {
my ($self, %args) = @_;
return 'MooseX::Storage::Engine'
unless (
exists $args{engine_traits}
&& ref($args{engine_traits}) eq 'ARRAY'
&& scalar(@{$args{engine_traits}})
);
my @roles = String::RewritePrefix->rewrite(
{
'' => 'MooseX::Storage::Engine::Trait::',
'+' => '',
},
@{$args{engine_traits}}
);
Moose::Meta::Class->create_anon_class(
superclasses => ['MooseX::Storage::Engine'],
roles => [ @roles ],
cache => 1,
)->name;
}
sub _storage_construct_instance {
my ($class, $args, $opts) = @_;
my %i = defined $opts->{'inject'} ? %{ $opts->{'inject'} } : ();
$class->new( %$args, %i );
}
no Moose::Role;
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
MooseX::Storage::Basic - The simplest level of serialization
=head1 VERSION
version 0.51
=head1 SYNOPSIS
package Point;
use Moose;
use MooseX::Storage;
with Storage;
has 'x' => (is => 'rw', isa => 'Int');
has 'y' => (is => 'rw', isa => 'Int');
1;
my $p = Point->new(x => 10, y => 10);
## methods to pack/unpack an
## object in perl data structures
# pack the class into a hash
$p->pack(); # { __CLASS__ => 'Point-0.01', x => 10, y => 10 }
# unpack the hash into a class
my $p2 = Point->unpack({ __CLASS__ => 'Point-0.01', x => 10, y => 10 });
# unpack the hash, with injection of additional paramaters
my $p3 = Point->unpack( $p->pack, inject => { x => 11 } );
=head1 DESCRIPTION
This is the most basic form of serialization. This is used by default
but the exported C<Storage> function.
=head1 METHODS
=over 4
=item B<pack ([ disable_cycle_check => 1])>
Providing the C<disable_cycle_check> argument disables checks for any cyclical
references. The current implementation for this check is rather naive, so if
you know what you are doing, you can bypass this check.
This trait is applied on a perl-case basis. To set this flag for all objects
that inherit from this role, see L<MooseX::Storage::Traits::DisableCycleDetection>.
=item B<unpack ($data [, inject => { key => val, ... } ] )>
Providing the C<inject> argument lets you supply additional arguments to
the class' C<new> function, or override ones from the serialized data.
=back
=head1 SUPPORT
Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Storage>
(or L<bug-MooseX-Storage@rt.cpan.org|mailto:bug-MooseX-Storage@rt.cpan.org>).
There is also a mailing list available for users of this distribution, at
L<http://lists.perl.org/list/moose.html>.
There is also an irc channel available for users of this distribution, at
L<C<#moose> on C<irc.perl.org>|irc://irc.perl.org/#moose>.
=head1 AUTHORS
=over 4
=item *
Chris Prather <chris.prather@iinteractive.com>
=item *
Stevan Little <stevan.little@iinteractive.com>
=item *
יובל קוג'מן (Yuval Kogman) <nothingmuch@woobling.org>
=back
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2007 by Infinity Interactive, Inc.
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
| 23.168675 | 116 | 0.652626 |
ed7ea979a5c55ba489bb8e2df7ee57dc50c203e5 | 1,243 | t | Perl | _build/debian/perl-framework/t/modules/proxy_websockets.t | pkgstore/linux-deb-apache2 | ae53a72b87adfeb59815cbbd9ef7291699689a04 | [
"Apache-2.0"
] | 5 | 2020-06-20T03:50:03.000Z | 2021-11-16T10:57:30.000Z | _build/debian/perl-framework/t/modules/proxy_websockets.t | pkgstore/linux-deb-apache2 | ae53a72b87adfeb59815cbbd9ef7291699689a04 | [
"Apache-2.0"
] | null | null | null | _build/debian/perl-framework/t/modules/proxy_websockets.t | pkgstore/linux-deb-apache2 | ae53a72b87adfeb59815cbbd9ef7291699689a04 | [
"Apache-2.0"
] | 4 | 2020-04-10T21:16:56.000Z | 2021-12-24T04:10:12.000Z | use strict;
use warnings FATAL => 'all';
use Apache::Test;
use Apache::TestRequest;
use Apache::TestUtil;
use Apache::TestConfig ();
my $total_tests = 1;
plan tests => $total_tests, need 'AnyEvent::WebSocket::Client',
need_module('proxy_http', 'lua'), need_min_apache_version('2.4.47');
require AnyEvent;
require AnyEvent::WebSocket::Client;
my $config = Apache::Test::config();
my $hostport = Apache::TestRequest::hostport();
my $client = AnyEvent::WebSocket::Client->new(timeout => 5);
my $quit_program = AnyEvent->condvar;
my $pingok = 0;
$client->connect("ws://$hostport/proxy/wsoc")->cb(sub {
our $connection = eval { shift->recv };
t_debug("wsoc connected");
if($@) {
# handle error...
warn $@;
$quit_program->send();
return;
}
$connection->send('ping');
# recieve message from the websocket...
$connection->on(each_message => sub {
# $connection is the same connection object
# $message isa AnyEvent::WebSocket::Message
my($connection, $message) = @_;
t_debug("wsoc msg received: " . $message->body);
if ("ping" eq $message->body) {
$pingok = 1;
}
$connection->send('quit');
$quit_program->send();
});
});
$quit_program->recv;
ok t_cmp($pingok, 1);
| 23.018519 | 72 | 0.645213 |
73ef6451e57c9c206271ec0e36c36f5ce99147cc | 6,674 | pl | Perl | zxidnewuser.pl | marek-knappe/zxid-ubuntu | 7f7de3f0d1f7e97ef58e6738d33a53b06c584d76 | [
"curl",
"Apache-2.0",
"OpenSSL",
"ECL-2.0"
] | null | null | null | zxidnewuser.pl | marek-knappe/zxid-ubuntu | 7f7de3f0d1f7e97ef58e6738d33a53b06c584d76 | [
"curl",
"Apache-2.0",
"OpenSSL",
"ECL-2.0"
] | null | null | null | zxidnewuser.pl | marek-knappe/zxid-ubuntu | 7f7de3f0d1f7e97ef58e6738d33a53b06c584d76 | [
"curl",
"Apache-2.0",
"OpenSSL",
"ECL-2.0"
] | 1 | 2019-01-27T14:40:41.000Z | 2019-01-27T14:40:41.000Z | #!/usr/bin/perl
# Copyright (c) 2012-2014 Synergetics SA (sampo@synergetics.be), All Rights Reserved.
# Copyright (c) 2010 Sampo Kellomaki (sampo@iki.fi), All Rights Reserved.
# This is confidential unpublished proprietary source code of the author.
# NO WARRANTY, not even implied warranties. Contains trade secrets.
# Distribution prohibited unless authorized in writing.
# Licensed under Apache License 2.0, see file COPYING.
# $Id$
#
# 8.3.2010, created --Sampo
# 5.2.2012, changed zxpasswd to use -n instead of -c --Sampo
# 9.2.2014, changed to use zxpasswd -new
#
# Web GUI for creating new user, possibly in middle of login sequence.
# The AuthnRequest is preserved through new user creation by passing ar.
$from = 'sampo-pwbot-noreply@zxid.org';
$admin_mail = 'sampo-pwadm@zxid.org';
$dir = '/var/zxid/idp';
$usage = <<USAGE;
Web GUI for creating new user, possibly in middle of login sequence.
Usage: http://localhost:8081/zxidnewuser.pl?QUERY_STRING
./zxidnewuser.pl -a QUERY_STRING
-a Ascii mode
-t Test mode
USAGE
;
die $usage if $ARGV[0] =~ /^-[Hh?]/;
if ($ARGV[0] eq '-t') {
warn "Sending...";
send_detail("Test $$");
exit;
}
use Data::Dumper;
use MIME::Base64;
close STDERR;
open STDERR, ">>/var/tmp/zxid.stderr" or die "Cant open error log: $!";
select STDERR; $|=1; select STDOUT;
($sec,$min,$hour,$mday,$mon,$year) = gmtime(time);
$ts = sprintf "%04d%02d%02d-%02d%02d%02d", $year+1900, $mon+1, $mday, $hour, $min, $sec;
#warn "$$: START env: " . Dumper(\%ENV);
$ENV{QUERY_STRING} ||= shift;
cgidec($ENV{QUERY_STRING});
if ($ENV{CONTENT_LENGTH}) {
sysread STDIN, $data, $ENV{CONTENT_LENGTH};
#warn "GOT($data) $ENV{CONTENT_LENGTH}";
cgidec($data);
}
warn "$$: cgi: " . Dumper(\%cgi);
sub uridec {
my ($val) = @_;
$val =~ s/\+/ /g;
$val =~ s/%([0-9a-f]{2})/chr(hex($1))/gsexi; # URI decode
return $val;
}
sub urienc {
my ($val) = @_;
$val =~ s/([^A-Za-z0-9.,_-])/sprintf("%%%02x",ord($1))/gsex; # URI enc
return $val;
}
sub cgidec {
my ($d) = @_;
for $nv (split '&', $d) {
($n, $v) = split '=', $nv, 2;
$cgi{$n} = uridec($v);
}
}
sub readall {
my ($f) = @_;
my ($pkg, $srcfile, $line) = caller;
undef $/; # Read all in, without breaking on lines
open F, "<$f" or die "$srcfile:$line: Cant read($f): $!";
binmode F;
my $x = <F>;
close F;
return $x;
}
sub show_templ {
my ($templ, $hr) = @_;
$templ = readall($templ);
$templ =~ s/!!(\w+)/$$hr{$1}/gs;
my $len = length $templ;
syswrite STDOUT, "Content-Type: text/html\r\nContent-Length: $len\r\n\r\n$templ";
exit;
}
sub redirect {
my ($url) = @_;
syswrite STDOUT, "Location: $url\r\n\r\n";
exit;
}
sub send_mail {
my ($to, $subj, $body) = @_;
open S, "|/usr/sbin/sendmail -i -B 8BITMIME -t" or die "No sendmail in path: $! $?";
$msg = <<MAIL;
From: $from
To: $to
Subject: $subj
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
$body
MAIL
;
warn "msr($msg)";
print S $msg;
close S;
}
sub send_detail {
my ($subj) = @_;
send_mail($admin_mail, $subj, <<BODY);
uid: $cgi{'au'}
ip: $ENV{REMOTE_ADDR}
title: $cgi{'title'}
o: $cgi{'o'}
ou: $cgi{'ou'}
email: $cgi{'email'}
im: $cgi{'im'}
tel: $cgi{'tel'}
tag: $cgi{'tag'}
Comments or special requests:
$cgi{'comment'}
BODY
;
}
if (length $cgi{'continue'}) {
if ($cgi{'zxidpurl'} && $cgi{'zxrfr'} && $cgi{'ar'}) {
warn "Redirecting back to IdP";
redirect("$cgi{'zxidpurl'}?o=$cgi{'zxrfr'}&ar=$cgi{'ar'}");
} else {
warn "Redirecting back to index page.";
redirect("/");
}
}
### MAIN
if (length $cgi{'ok'}) {
if (length $cgi{'au'} < 3 || length $cgi{'au'} > 40) {
$cgi{'ERR'} = "Username must be at least 3 characters long (and no longer than 40 chars).";
} elsif ($cgi{'au'} !~ /^[A-Za-z0-9_-]+$/s) {
$cgi{'ERR'} = "Username can only contain characters [A-Za-z0-9_-]";
} elsif (length $cgi{'ap'} < 5 || length $cgi{'ap'} > 80) {
$cgi{'ERR'} = "Password must be at least 5 characters long (and no longer than 80 chars).";
} elsif (-e "${dir}uid/$cgi{'au'}") {
$cgi{'ERR'} = "Username already taken.";
} else {
warn "Creating new user($cgi{'au'})";
open P, "|./zxpasswd -new $cgi{'au'} ${dir}uid" or die "Cant open pipe to zxpasswd: $! $?";
print P $cgi{'ap'};
close P;
warn "Populating user($cgi{'au'})";
if (-e "${dir}uid/$cgi{'au'}") {
open LOG, ">${dir}uid/$cgi{'au'}/.log" or die "Cant open write .log: $!";
print LOG "$ts Created $cgi{'au'} ip=$ENV{REMOTE_ADDR}\n" or die "Cant write .log: $!";
close LOG or die "Cant close write .log: $!";
open IP, ">${dir}uid/$cgi{'au'}/.regip" or die "Cant open write .regip: $!";
print IP $ENV{REMOTE_ADDR} or die "Cant write .regip: $!";
close IP or die "Cant close write .regip: $!";
if ($cgi{'humanintervention'} > 0) {
open HUMAN, ">${dir}uid/$cgi{'au'}/.human" or die "Cant open write .human: $!";
print HUMAN $cgi{'humanintervention'} or die "Cant write .human: $!";
close HUMAN or die "Cant close write .human: $!";
}
#mkdir "${dir}uid/$cgi{'au'}/.bs" or warn "Cant mkdir .bs: $!"; zxpasswd creates .bs
open AT, ">${dir}uid/$cgi{'au'}/.bs/.at" or die "Cant write .bs/.at: $!";
open OPTAT, ">${dir}uid/$cgi{'au'}/.bs/.optat" or die "Cant write .bs/.optat: $!";
for $at (qw(cn title taxno o ou street citystc email im tel lang tag)) {
$val = $cgi{$at};
$val =~ s/[\r\n]//g;
next if !length $val;
if ($cgi{"${at}share"}) {
print AT "$at: $val\n";
} else {
print OPTAT "$at: $val\n";
}
}
close AT;
close OPTAT;
send_detail("New User $cgi{'au'}");
if ($cgi{'zxidpurl'} && $cgi{'zxrfr'} && $cgi{'ar'}) {
warn "Created user($cgi{'au'})";
$cgi{MSG} = "Success! Created user $cgi{'au'}. Click Continue to get back to IdP login.";
show_templ("newuser-status.html", \%cgi);
} else {
warn "Created user($cgi{'au'})";
$cgi{MSG} = "Success! Created user $cgi{'au'}. Click Continue to get back to top.";
show_templ("newuser-status.html", \%cgi);
}
} else {
$cgi{'ERR'} = "User creation failed. System error (${dir}uid/$cgi{'au'}).";
}
}
}
$cgi{'humaninterventionchecked'} = $cgi{'humanintervention'} eq '1' ? ' checked':'';
$cgi{'ip'} = $ENV{REMOTE_ADDR};
if (!length $cgi{'ap'}) {
open R, "</dev/urandom" or die "Cant open read /dev/urandom: $!";
sysread R, $pw, 9;
close R;
$cgi{'ap'} = encode_base64($pw,''); # Just a suggestion
}
show_templ("newuser-main.html", \%cgi);
__END__
| 29.144105 | 92 | 0.578214 |
ed928212bb7a9ed2df614cb929f1c5aaddf078a0 | 13,448 | pm | Perl | Website/workshop/slides/pinney/LoadSageResults.pm | EuPathDB-Infra/GusAppFramework | f9ad75276f3314fc310f8047b9a769eb75f63fca | [
"Apache-2.0"
] | null | null | null | Website/workshop/slides/pinney/LoadSageResults.pm | EuPathDB-Infra/GusAppFramework | f9ad75276f3314fc310f8047b9a769eb75f63fca | [
"Apache-2.0"
] | null | null | null | Website/workshop/slides/pinney/LoadSageResults.pm | EuPathDB-Infra/GusAppFramework | f9ad75276f3314fc310f8047b9a769eb75f63fca | [
"Apache-2.0"
] | 1 | 2020-11-10T15:43:42.000Z | 2020-11-10T15:43:42.000Z | # $Id: LoadSageResults.pm 3041 2005-06-24 21:56:03Z pinney $
package GUS::Community::Plugin::LoadSageResults;
@ISA = qw(GUS::PluginMgr::Plugin);
use strict;
use GUS::PluginMgr::Plugin;
use GUS::Model::Study::Study;
use GUS::Model::RAD::ArrayDesign;
use GUS::Model::RAD::Acquisition;
use GUS::Model::RAD::Assay;
use GUS::Model::RAD::StudyAssay;
use GUS::Model::RAD::Quantification;
use GUS::Model::RAD::SAGETag;
use GUS::Model::RAD::SAGETagResult;
use GUS::Model::SRes::Contact;
$| = 1;
# ---------------------------------------------------------------------------
# Load Arguments
# ---------------------------------------------------------------------------
sub getArgumentsDeclaration{
my $argsDeclaration =
[
stringArg({name => 'contact',
descr => 'name,first,last as they should appear in sres.contact',
constraintFunc => undef,
reqd => 1,
isList => 1
}),
stringArg({name => 'arrayDesignName',
descr => 'rad.ArrayDesign.name used for this set of sage tags',
constraintFunc => undef,
reqd => 1,
isList => 0
}),
stringArg({name => 'arrayDesignVersion',
descr => 'rad.ArrayDesign.version used for this set of sage tags',
constraintFunc => undef,
reqd => 1,
isList => 0
}),
stringArg({name => 'studyName',
descr => 'value for study.name',
constraintFunc => undef,
reqd => 1,
isList => 0
}),
stringArg({name => 'studyDescription',
descr => 'value for study.description',
constraintFunc => undef,
reqd => 0,
isList => 0
}),
fileArg({name => 'freqFile',
descr => 'full path of the sage tag frequency filw, tab delimited with tissue/strains as tab delimite header.',
constraintFunc=> undef,
reqd => 1,
isList => 0,
mustExist => 1,
format => 'tab delimited, first column contains tag sequences, first row contains the label tag followed by sample source names'
}),
integerArg({name => 'testnum',
descr => 'The number of data lines to read when testing this plugin. Not to be used in commit mode.',
constraintFunc=> undef,
reqd => 0,
isList => 0
})
];
return $argsDeclaration;
}
# --------------------------------------------------------------------------
# Documentation
# --------------------------------------------------------------------------
sub getDocumentation {
my $purposeBrief = <<PURPOSEBRIEF;
Plug_in to populate RAD.SAGETagResult.
PURPOSEBRIEF
my $purpose = <<PLUGIN_PURPOSE;
plug_in that inserts frequency results into RAD.SAGETagResult and retrieves or creates supporting objects.
PLUGIN_PURPOSE
my $syntax = <<SYNTAX;
Standard plugin syntax.
SYNTAX
#check the documentation for this
my $tablesAffected = [['GUS::Model::Study::Study', 'inserts a single row for entire set of results'],['GUS::Model::RAD::Assay', 'inserts a row for each tissue/organism source included in result file'],['GUS::Model::RAD::StudyAssay','inserts a linking row for each Assay row'],['GUS::Model::RAD::Acquisition','inserts a single row for each Assay'],['GUS::Model::RAD::Quantification','inserts a single row for each Assay row'],['GUS::Model::RAD::SAGETagResult','inserts frequencies from input file'],['GUS::Model::SRes::Contact','inserts a row if row cannot be retrieved using contact arg']];
my $tablesDependedOn = [['GUS::Model::RAD::ArrayDesign', 'Gets an existing ArrayDesign row'],['GUS::Model::RAD::SAGETag', 'Gets existing sage tag rows for each row in the input file']];
my $howToRestart = <<PLUGIN_RESTART;
Explicit restart is not needed as frequency files are relatively short and rows in the db will not be clobbered.
PLUGIN_RESTART
my $failureCases = <<PLUGIN_FAILURE_CASES;
no ArrayDesign or SAGETag rows corresponding to previously entered and required tags.
PLUGIN_FAILURE_CASES
my $notes = <<PLUGIN_NOTES;
SAGETag with tag sequences must have been previously entered along with the required ArrayDesign row. Input file must be in the correct tab delimited format. First row must contain a beginning label called tag followed by the names of the frequency sources. Subsequent rows must start with the tag sequence followed by the integers representing the frequencies in each of the data sources.
PLUGIN_NOTES
my $documentation = {purposeBrief => $purposeBrief,
purpose => $purpose,
syntax => $syntax,
tablesAffected => $tablesAffected,
tablesDependedOn => $tablesDependedOn,
howToRestart => $howToRestart,
failureCases => $failureCases,
notes => $notes
};
return ($documentation);
}
#############################################################################
# Create a new instance of a SageResultLoader object
#############################################################################
sub new {
my ($class) = @_;
my $self = {};
bless($self,$class);
my $documentation = &getDocumentation();
my $arguments = &getArgumentsDeclaration();
my $configuration = {requiredDbVersion => 3.5,
cvsRevision => '$Revision: 3041 $', # cvs fills this in!
name => ref($self),
revisionNotes => 'make consistent with GUS 3.5',
argsDeclaration => $arguments,
documentation => $documentation
};
$self->initialize($configuration);
return $self;
}
########################################################################
# Main Program
########################################################################
sub run {
my ($self) = @_;
$self->logArgs();
$self->logAlgInvocationId();
$self->logCommit();
$self->checkFileFormat();
my $contact = $self->getContact();
my $study = $self->getStudy($contact);
my $assayNames = $self->getAssayNames();
my $arrayDesign = $self->getArrayDesign();
my $quantificationIds = $self->getQuantificationIds($assayNames,$study,$contact,$arrayDesign);
my $numFreqsInserted = $self->insertSageTagResults($quantificationIds, $arrayDesign);
my $resultDescrip = "$$numFreqsInserted rows inserted into SageTageResults";
$self->setResultDescr($resultDescrip);
$self->logData($resultDescrip);
}
sub checkFileFormat {
my ($self) = @_;
my $file = $self->getArg('freqFile');
open(FILE,$file);
my $assayNum;
while(<FILE>) {
chomp;
my @assays = split (/\t/,$_);
if ($. == 1) {
$self->userError("Frequency file does not contain a well formatted heading, tab delimited, 'tag' followed by sources of RNA \n") unless ($_ =~ /^tag/ && @assays > 1);
$assayNum = @assays;
}
if ($. != 1) {
$self->userError("Frequency file does not contain the correct number of columns\n") unless (@assays == $assayNum);
$self->userError("The first column of the frequency file does not contain a tag sequence\n") unless ($assays[0] =~ /[ACTGNactgn]+/);
for (my $i=1;$i<$assayNum;$i++) {
$self->userError("At least one frequency in the frequency file does not contain an integer\n") unless ($assays[$i] =~ /\d*/);
}
}
}
$self->log("Frequency file format is correct\n");
close (FILE);
}
sub getContact {
my ($self) = @_;
my $contactHash;
if(defined $self->getArg('contact')->[0]) { $contactHash->{name}=$self->getArg('contact')->[0];}
if(defined $self->getArg('contact')->[1]) { $contactHash->{first}=$self->getArg('contact')->[1];}
if(defined $self->getArg('contact')->[2]) { $contactHash->{last}=$self->getArg('contact')->[2];}
my $contact = GUS::Model::SRes::Contact->new($contactHash);
if ($contact) {
$self->log("Obtained contact object\n");
}
else {
$self->userError("Unable to obtain contact object\n");
}
if (! $contact->retrieveFromDB()) {
$contact->submit();
}
return $contact
}
sub getStudy {
my ($self, $contact) = @_;
my $study = GUS::Model::Study::Study->new({'name'=>$self->getArg('studyName')});
$study->retrieveFromDB();
if ($self->getArg('studyDescription') && ($study->getDescription() ne $self->getArg('studyDescription'))) {
$study->setDescription($self->getArg('studyDescription'));
}
$study->setParent($contact);
my $subNum = $study->submit();
$self->log("$subNum rows submitted with study\n");
return $study;
}
sub getAssayNames{
my ($self) = @_;
my $file = $self->getArg('freqFile');
open(FILE,$file);
my @assayNames;
while(<FILE>) {
if ($_ =~ /tag/) {
@assayNames = split (/\t/,$_);
}
}
my $num = @assayNames;
$self->log("$num assay names found\n");
close (FILE);
return \@assayNames;
}
sub getArrayDesign {
my ($self) = @_;
my $arrayDesign = GUS::Model::RAD::ArrayDesign->new({'name'=>$self->getArg('arrayDesignName'),'version'=>$self->getArg('arrayDesignVersion')});
if (! $arrayDesign->retrieveFromDB()) {
$self->userError("--arrayDesignName " . $self->getArg('arrayDesignName') . "and --arrayDesignVersion " . $self->getArg('arrayDesignVersion') . " do not return a valid ArrayDesign object\n");
}
else {
$self->log("ArrayDesign row located\n");
}
return $arrayDesign;
}
sub getQuantificationIds {
my ($self,$assayNames,$study,$contact,$arrayDesign) = @_;
my $tableId = $self->getTableId();
my @quantificationIds;
for (my $i = 1;$i < @$assayNames;$i++) {
my $assayName = $assayNames->[$i];
my $assay = $self->getAssay($assayName,$arrayDesign,$contact);
$assay->getChild('GUS::Model::RAD::StudyAssay',1) ? $assay->getChild('GUS::Model::RAD::StudyAssay') : $self->makeStudyAssay($assay,$study);
my $acquisition = $assay->getChild('GUS::Model::RAD::Acquisition',1) ? $assay->getChild('GUS::Model::RAD::Acquisition') : $self->makeAcquisition($assay,$assayName);
my $quantification = $acquisition->getChild('GUS::Model::RAD::Quantification',1) ? $acquisition->getChild('GUS::Model::RAD::Quantification') : $self->makeQuantification($acquisition,$assayName,$tableId);
$assay->submit();
my $quantificationId = $quantification->getId();
$quantificationIds[$i] = $quantificationId;
}
my $num = @quantificationIds;
$self->log("$num quantification_ids obtained\n");
$self->undefPointerCache();
return \@quantificationIds;
}
sub getAssay {
my ($self,$assayName,$arrayDesign,$contact) = @_;
my $assay = GUS::Model::RAD::Assay->new({'name' => $assayName});
$assay->retrieveFromDB();
$assay->setParent($arrayDesign);
$assay->setParent($contact);
return $assay;
}
sub makeStudyAssay {
my ($self,$assay,$study) = @_;
my $studyAssay = GUS::Model::RAD::StudyAssay->new();
if ($studyAssay) {
$self->log("Obtained StudyAssay object\n");
}
else {
$self->userError("Unable to obtain StudyAssay object\n");
}
$studyAssay->setParent($assay);
$studyAssay->setParent($study);
}
sub makeAcquisition {
my ($self,$assay,$assayName) = @_;
my $acquisition = GUS::Model::RAD::Acquisition->new({'name'=>$assayName});
if ($acquisition) {
$self->log("Obtained acquisition object\n");
}
else {
$self->userError("Unable to obtain acquisition object\n");
}
$acquisition->setParent($assay);
return $acquisition;
}
sub makeQuantification {
my ($self,$acquisition,$assayName,$tableId) = @_;
my $quantification = GUS::Model::RAD::Quantification->new({'name'=>$assayName,'uri'=>$self->getArg('freqFile'),'result_table_id'=>$tableId});
if ($quantification) {
$self->log("Obtained quantification object\n");
}
else {
$self->userError("Unable to obtain quantification object\n");
}
$quantification->setParent($acquisition);
return $quantification;
}
sub getTableId {
my ($self) = @_;
my $query="select t.table_id from core.tableinfo t, core.databaseinfo d where t.name='SAGETagResult' and d.name = 'RAD' and t.database_id = d.database_id";
my $dbh = $self->getQueryHandle();
my $sth = $dbh->prepare($query);
$sth->execute();
my ($id) = $sth->fetchrow_array();
$sth->finish();
if (defined $id) {
return $id;
}
else {
$self->log("Can't retrieve table_id for SAGETagResult\n");
}
}
sub insertSageTagResults {
my ($self,$quantificationIds, $arrayDesign) = @_;
my $file = $self->getArg('freqFile');
my $num;
open(FILE,$file);
my $linenum = 0;
while(<FILE>) {
chomp;
if ($_ =~ /tag/) {
next;
}
if ($self->getArg('testnum') && $linenum >= $self->getArg('testnum')) {
return \$num;
}
my @line = split(/\t/, $_);
$self->processLine(\@line,$arrayDesign,$quantificationIds,\$num);
$linenum++;
$self->log("$linenum lines from the frequency file have been processed\n") if $linenum % 1000 == 0;
}
$self->log("$linenum lines from the frequency file have been processed\n");
return \$num;
}
sub processLine {
my ($self,$line,$arrayDesign,$quantificationIds,$num) = @_;
my $numQ = @$quantificationIds;
my $arrayDesignId = $arrayDesign->get('array_design_id');
for (my $i=1;$i < @$line;$i++) {
my $sageTag = GUS::Model::RAD::SAGETag->new({'tag'=>$line->[0], 'array_design_id'=>$arrayDesignId});
if (! $sageTag->retrieveFromDB()) {
$self->userError("SAGE tag $line->[0] with array_design_id = $arrayDesignId not in db\n");
}
my $sageTagResult = GUS::Model::RAD::SAGETagResult->new({'subclass_view'=>"SAGETagResult", 'quantification_id'=>$quantificationIds->[$i],'tag_count'=>$line->[$i]});
$sageTagResult->setParent($sageTag);
$$num += $sageTagResult->submit();
}
$self->undefPointerCache();
}
| 27.004016 | 590 | 0.621133 |
ed4646a7b5d90b1e0147c71702481e62b9c1a277 | 11,582 | al | Perl | Apps/DK/OIOUBL/app/src/Reminder/ExportIssuedReminder.Codeunit.al | manjulchauhan/ALAppExtensions | 3f2f1d6e5337188b1af9c0275420f1c1de036a7f | [
"MIT"
] | 127 | 2018-04-17T18:03:03.000Z | 2019-05-06T18:54:17.000Z | Apps/DK/OIOUBL/app/src/Reminder/ExportIssuedReminder.Codeunit.al | snu-development/ALAppExtensions | 371a27fe48483be776642dde19483a87ae27289c | [
"MIT"
] | 2,279 | 2018-09-12T12:01:49.000Z | 2019-05-06T13:59:35.000Z | Apps/DK/OIOUBL/app/src/Reminder/ExportIssuedReminder.Codeunit.al | snu-development/ALAppExtensions | 371a27fe48483be776642dde19483a87ae27289c | [
"MIT"
] | 41 | 2018-05-17T11:19:52.000Z | 2019-04-30T17:30:38.000Z | // ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
codeunit 13639 "OIOUBL-Export Issued Reminder"
{
TableNo = "Issued Reminder Header";
Permissions = tabledata "Issued Reminder Header" = rm;
var
GLSetup: Record "General Ledger Setup";
CompanyInfo: Record "Company Information";
IssuedReminder: Record "Issued Reminder Header";
IssuedReminderLine: Record "Issued Reminder Line";
SalesSetup: Record "Sales & Receivables Setup";
OIOUBLDocumentEncode: Codeunit "OIOUBL-Document Encode";
OIOUBLCommonLogic: Codeunit "OIOUBL-Common Logic";
DocNameSpace: Text[250];
DocNameSpace2: Text[250];
local procedure InsertReminderTaxTotal(var ReminderElement: XmlElement; var IssuedReminderLine: Record "Issued Reminder Line"; TotalTaxAmount: Decimal; CurrencyCode: Code[10]);
var
TaxTotalElement: XmlElement;
TaxableAmount: Decimal;
TaxAmount: Decimal;
VATPercentage: Decimal;
begin
TaxTotalElement := XmlElement.Create('TaxTotal', DocNameSpace2);
TaxTotalElement.Add(
XmlElement.Create('TaxAmount', DocNameSpace,
XmlAttribute.Create('currencyID', CurrencyCode),
OIOUBLDocumentEncode.DecimalToText(TotalTaxAmount)));
// Invoice->TaxTotal (for ("Normal VAT" AND "VAT %" <> 0) OR "Full VAT")
IssuedReminderLine.SETFILTER(
"VAT Calculation Type", '%1|%2',
IssuedReminderLine."VAT Calculation Type"::"Normal VAT",
IssuedReminderLine."VAT Calculation Type"::"Full VAT");
if IssuedReminderLine.FINDFIRST() then begin
TaxableAmount := 0;
TaxAmount := 0;
IssuedReminderLine.SETFILTER("VAT %", '<>0');
if IssuedReminderLine.FINDSET() then begin
VATPercentage := IssuedReminderLine."VAT %";
repeat
UpdateTaxAmtAndTaxableAmt(IssuedReminderLine.Amount, IssuedReminderLine."VAT Amount", TaxableAmount, TaxAmount);
until IssuedReminderLine.NEXT() = 0;
OIOUBLCommonLogic.InsertTaxSubtotal(
TaxTotalElement,
IssuedReminderLine."VAT Calculation Type".AsInteger(),
TaxableAmount,
TaxAmount,
VATPercentage,
CurrencyCode);
end;
TaxableAmount := 0;
TaxAmount := 0;
IssuedReminderLine.SETRANGE("VAT %", 0);
IssuedReminderLine.SETRANGE("VAT Calculation Type", IssuedReminderLine."VAT Calculation Type"::"Normal VAT");
if IssuedReminderLine.FINDSET() then begin
VATPercentage := IssuedReminderLine."VAT %";
repeat
UpdateTaxAmtAndTaxableAmt(IssuedReminderLine.Amount, IssuedReminderLine."VAT Amount", TaxableAmount, TaxAmount);
until IssuedReminderLine.NEXT() = 0;
// Invoice->TaxTotal->TaxSubtotal
OIOUBLCommonLogic.InsertTaxSubtotal(
TaxTotalElement,
IssuedReminderLine."VAT Calculation Type".AsInteger(),
TaxableAmount,
TaxAmount,
VATPercentage,
CurrencyCode);
end;
end;
// Invoice->TaxTotal (for "Reverse Charge VAT")
IssuedReminderLine.SETRANGE("VAT %");
IssuedReminderLine.SETRANGE("VAT Calculation Type", IssuedReminderLine."VAT Calculation Type"::"Reverse Charge VAT");
if IssuedReminderLine.FINDSET() then begin
TaxableAmount := 0;
TaxAmount := 0;
VATPercentage := IssuedReminderLine."VAT %";
repeat
UpdateTaxAmtAndTaxableAmt(IssuedReminderLine.Amount, IssuedReminderLine."VAT Amount", TaxableAmount, TaxAmount);
until IssuedReminderLine.NEXT() = 0;
OIOUBLCommonLogic.InsertTaxSubtotal(
TaxTotalElement,
IssuedReminderLine."VAT Calculation Type".AsInteger(),
TaxableAmount,
TaxAmount,
VATPercentage,
CurrencyCode);
end;
ReminderElement.Add(TaxTotalElement);
end;
trigger OnRun();
var
IssuedReminderLine2: Record "Issued Reminder Line";
ContactStandardAddress: Record "Standard Address";
ContactInfo: Record Contact;
OIOUBLManagement: Codeunit "OIOUBL-Management";
TempBlob: Codeunit "Temp Blob";
XMLdocOut: XmlDocument;
XMLCurrNode: XmlElement;
CurrencyCode: Code[10];
TaxableAmount: Decimal;
TaxAmount: Decimal;
TotalTaxAmount: Decimal;
TotalAmount: Decimal;
FileOutstream: Outstream;
begin
CODEUNIT.RUN(CODEUNIT::"OIOUBL-Check Issued Reminder", Rec);
GLSetup.GET();
CompanyInfo.GET();
if "Currency Code" = '' then
CurrencyCode := GLSetup."LCY Code"
else
CurrencyCode := "Currency Code";
IssuedReminderLine.SETRANGE("Reminder No.", "No.");
IssuedReminderLine.SETFILTER(Type, '>%1', 0);
IssuedReminderLine.SETFILTER("No.", '<>%1', ' ');
if NOT IssuedReminderLine.FINDSET() then
EXIT;
// Reminder
XmlDocument.ReadFrom(OIOUBLCommonLogic.GetReminderHeader(), XMLdocOut);
XMLdocOut.GetRoot(XMLCurrNode);
OIOUBLCommonLogic.init(DocNameSpace, DocNameSpace2);
XMLCurrNode.Add(XmlElement.Create('UBLVersionID', DocNameSpace, '2.0'));
XMLCurrNode.Add(XmlElement.Create('CustomizationID', DocNameSpace, 'OIOUBL-2.02'));
XMLCurrNode.Add(
XmlElement.Create('ProfileID', DocNameSpace,
XmlAttribute.Create('schemeID', 'urn:oioubl:id:profileid-1.2'),
XmlAttribute.Create('schemeAgencyID', '320'),
'Procurement-BilSim-1.0'));
XMLCurrNode.Add(XmlElement.Create('ID', DocNameSpace, "No."));
XMLCurrNode.Add(XmlElement.Create('CopyIndicator', DocNameSpace,
OIOUBLDocumentEncode.BooleanToText("OIOUBL-Electronic Reminder Created")));
XMLCurrNode.Add(XmlElement.Create('IssueDate', DocNameSpace,
OIOUBLDocumentEncode.DateToText("Posting Date")));
XMLCurrNode.Add(
XmlElement.Create('ReminderTypeCode', DocNameSpace,
XmlAttribute.Create('listID', 'urn:oioubl.codelist:remindertypecode-1.1'),
XmlAttribute.Create('listAgencyID', '320'),
'Advis'));
XMLCurrNode.Add(XmlElement.Create('ReminderSequenceNumeric', DocNameSpace, '1'));
XMLCurrNode.Add(XmlElement.Create('DocumentCurrencyCode', DocNameSpace, CurrencyCode));
XMLCurrNode.Add(XmlElement.Create('AccountingCostCode', DocNameSpace, "OIOUBL-Account Code"));
// Reminder->AccountingSupplierParty
OIOUBLCommonLogic.InsertAccountingSupplierParty(XMLCurrNode, '');
// Reminder->AccountingCustomerParty
ContactStandardAddress.Address := "Address";
ContactStandardAddress."Address 2" := "Address 2";
ContactStandardAddress.City := "City";
ContactStandardAddress."Post Code" := "Post Code";
ContactStandardAddress."Country/Region Code" := "Country/Region Code";
ContactInfo.Name := "Contact";
ContactInfo."Phone No." := "OIOUBL-Contact Phone No.";
ContactInfo."Fax No." := "OIOUBL-Contact Fax No.";
ContactInfo."E-Mail" := "OIOUBL-Contact E-Mail";
OIOUBLCommonLogic.InsertAccountingCustomerParty(XMLCurrNode,
"OIOUBL-GLN",
"VAT Registration No.",
"Name",
ContactStandardAddress,
ContactInfo);
// Reminder->PaymentMeans
OIOUBLCommonLogic.InsertPaymentMeans(XMLCurrNode, "Due Date");
// Reminder->PaymentTerms
TotalAmount := 0;
IssuedReminderLine2.RESET();
IssuedReminderLine2.COPY(IssuedReminderLine);
if IssuedReminderLine2.FINDSET() then
repeat
TotalAmount := TotalAmount + IssuedReminderLine2.Amount + IssuedReminderLine2."VAT Amount";
until IssuedReminderLine2.NEXT() = 0;
OIOUBLCommonLogic.InsertPaymentTerms(XMLCurrNode,
'',
0,
CurrencyCode,
CalcDate('<0D>'),
"Due Date",
TotalAmount);
// Reminder->TaxTotal (for ("Normal VAT" AND "VAT %" <> 0) OR "Full VAT")
IssuedReminderLine2.RESET();
IssuedReminderLine2.COPY(IssuedReminderLine);
IssuedReminderLine2.SETFILTER(
"VAT Calculation Type", '%1|%2|%3',
IssuedReminderLine2."VAT Calculation Type"::"Normal VAT",
IssuedReminderLine2."VAT Calculation Type"::"Full VAT",
IssuedReminderLine2."VAT Calculation Type"::"Reverse Charge VAT");
if IssuedReminderLine2.FINDFIRST() then begin
TotalTaxAmount := 0;
IssuedReminderLine2.CALCSUMS(Amount, Amount);
TotalTaxAmount := IssuedReminderLine2.Amount - IssuedReminderLine2.Amount;
InsertReminderTaxTotal(XMLCurrNode, IssuedReminderLine2, TotalTaxAmount, CurrencyCode);
end;
// Reminder->LegalMonetaryTotal
TaxableAmount := 0;
TaxAmount := 0;
IssuedReminderLine2.RESET();
IssuedReminderLine2.COPY(IssuedReminderLine);
if IssuedReminderLine2.FINDSET() then
repeat
TaxableAmount := TaxableAmount + IssuedReminderLine2.Amount;
TaxAmount := TaxAmount + IssuedReminderLine2."VAT Amount";
until IssuedReminderLine2.NEXT() = 0;
OIOUBLCommonLogic.InsertLegalMonetaryTotal(XMLCurrNode, TaxableAmount, TaxAmount, TotalAmount, 0, CurrencyCode);
// Reminder->ReminderLine
repeat
if IssuedReminderLine.Amount <> 0 then begin
IssuedReminderLine.TESTFIELD(Description);
OIOUBLCommonLogic.InsertReminderLine(XMLCurrNode,
IssuedReminderLine."Line No.",
IssuedReminderLine.Description,
IssuedReminderLine.Amount,
CurrencyCode,
IssuedReminderLine."OIOUBL-Account Code");
end;
until IssuedReminderLine.NEXT() = 0;
SalesSetup.GET();
TempBlob.CreateOutStream(FileOutstream);
OnRunOnBeforeXmlDocumentWriteToFileStream(XMLdocOut, Rec, DocNameSpace, DocNameSpace2);
XMLdocOut.WriteTo(FileOutstream);
OIOUBLManagement.ExportXMLFile("No.", TempBlob, SalesSetup."OIOUBL-Reminder Path", '');
IssuedReminder.GET("No.");
IssuedReminder."OIOUBL-Electronic Reminder Created" := TRUE;
IssuedReminder.MODIFY();
end;
procedure UpdateTaxAmtAndTaxableAmt(Amount: Decimal; VATAmount: Decimal; var TaxableAmountParam: Decimal; var TaxAmountParam: Decimal);
begin
TaxableAmountParam := TaxableAmountParam + Amount;
TaxAmountParam := TaxAmountParam + VATAmount
end;
[IntegrationEvent(false, false)]
local procedure OnRunOnBeforeXmlDocumentWriteToFileStream(var XMLdocOut: XmlDocument; IssuedReminderHeader: Record "Issued Reminder Header"; DocNameSpace: Text[250]; DocNameSpace2: Text[250])
begin
end;
} | 43.216418 | 195 | 0.626144 |
ed91bd0b04337828da90f5d16cbc262f1dbc47f5 | 23,908 | pm | Perl | lib/Mail/SpamAssassin/ArchiveIterator.pm | yuvarajbora/demo | 82edce9b2f40611e59207787fb71806c4e8a37fc | [
"Apache-2.0"
] | null | null | null | lib/Mail/SpamAssassin/ArchiveIterator.pm | yuvarajbora/demo | 82edce9b2f40611e59207787fb71806c4e8a37fc | [
"Apache-2.0"
] | 4 | 2021-04-28T20:02:39.000Z | 2021-04-29T00:59:20.000Z | lib/Mail/SpamAssassin/ArchiveIterator.pm | yuvarajbora/demo | 82edce9b2f40611e59207787fb71806c4e8a37fc | [
"Apache-2.0"
] | 1 | 2021-07-05T18:55:19.000Z | 2021-07-05T18:55:19.000Z | # iterate over mail archives, calling a function on each message.
#
# <@LICENSE>
# Copyright 2004 Apache Software Foundation
#
# 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.
# </@LICENSE>
package Mail::SpamAssassin::ArchiveIterator;
use strict;
use bytes;
use IO::Select;
use IO::Socket;
use Mail::SpamAssassin::Util;
use Mail::SpamAssassin::Constants qw(:sa);
use constant BIG_BYTES => 256*1024; # 256k is a big email
use constant BIG_LINES => BIG_BYTES/65; # 65 bytes/line is a good approximation
my $no = 1;
use vars qw {
$MESSAGES
};
my @ISA = qw($MESSAGES);
=head1 NAME
Mail::SpamAssassin::ArchiveIterator - find and process messages one at a time
=head1 SYNOPSIS
my $iter = new Mail::SpamAssassin::ArchiveIterator(
{
'opt_j' => 0,
'opt_n' => 1,
'opt_all' => 1,
}
);
$iter->set_functions( \&wanted, sub { } );
eval { $iter->run(@ARGV); };
sub wanted {
my($class, $filename, $recv_date, $msg_array) = @_;
...
}
=head1 DESCRIPTION
The Mail::SpamAssassin::ArchiveIterator module will go through a set
of mbox files, mbx files, and directories (with a single message per
file) and generate a list of messages. It will then call the wanted
and results functions appropriately per message.
=head1 METHODS
=over 4
=cut
###########################################################################
=item $item = new Mail::SpamAssassin::ArchiveIterator( [ { opt => val, ... } ] )
Constructs a new C<Mail::SpamAssassin::ArchiveIterator> object. You may
pass the following attribute-value pairs to the constructor. The pairs are
optional unless otherwise noted.
=over 4
=item opt_all
Typically messages over 250k are skipped by ArchiveIterator. Use this option
to keep from skipping messages based on size.
=item opt_j (required)
Specifies how many messages should be run at the same time, as well as the
method with which to scan for the messages.
If the value is 0, the list of messages to process will be kept in memory,
and only 1 message at a time will be processed by the wanted subroutine.
Restarting is not allowed.
If the value is 1, the list of messages to process will be kept in a
temporary file, and only 1 message at a time will be processed by the
wanted subroutine. Restarting is not allowed.
If the value is 2 or higher, the list of messages to process will be kept
in a temporary file, and the process will split into a parent/child mode.
The option value number of children will be forked off and each child
will process messages via the wanted subroutine in parallel. Restarting
is allowed.
B<NOTE:> For C<opt_j> >= 1, an extra child process will be created to
determine the list of messages, sort the list, everything as appropriate.
This will keep the list in memory (possibly multiple copies) before
writing the final list to a temporary file which will be used for
processing. The list generation child will exit, freeing up the memory.
=item opt_n
ArchiveIterator is typically used to simulate ham and spam moving through
SpamAssassin. By default, the list of messages is sorted by received date so
that the mails can be passed through in order. If opt_n is true, the sorting
will not occur. This is useful if you don't care about the order of the
messages.
=item opt_restart
If set to a positive integer value, children processes (see opt_j w/ value 2
or higher above) will restart after the option value number of messages, in
total, have been processed.
=item opt_head
Only use the first N ham and N spam (or if the value is -N, only use the first
N total messages regardless of class).
=item opt_tail
Only use the last N ham and N spam (or if the value is -N, only use the last
N total messages regardless of class).
=item opt_before
Only use messages which are received after the given time_t value.
Negative values are an offset from the current time, e.g. -86400 =
last 24 hours; or as parsed by Time::ParseDate (e.g. '-6 months')
=item opt_after
Same as opt_before, except the messages are only used if after the given
time_t value.
=item wanted_sub
Reference to a subroutine which will process message data. Usually set
via set_functions(). The routine will be passed 4 values: class (scalar),
filename (scalar), received date (scalar), and message content (array
reference, one message line per element).
=item result_sub
Reference to a subroutine which will process the results of the wanted_sub
for each message processed. Usually set via set_functions().
The routine will be passed 3 values: class (scalar), result (scalar, returned
from wanted_sub), and received date (scalar).
=back
=cut
sub new {
my $class = shift;
$class = ref($class) || $class;
my $self = shift;
if (!defined $self) { $self = { }; }
bless ($self, $class);
$self->{s} = { }; # spam, of course
$self->{h} = { }; # ham, as if you couldn't guess
$self;
}
###########################################################################
=item set_functions( \&wanted_sub, \&result_sub )
Sets the subroutines used for message processing (wanted_sub), and result
reporting. For more information, see I<new()> above.
=cut
sub set_functions {
my ($self, $wanted, $result) = @_;
$self->{wanted_sub} = $wanted;
$self->{result_sub} = $result;
}
###########################################################################
=item run ( @target_paths )
Generates the list of messages to process, then runs each message through the
configured wanted subroutine. Files which have a name ending in C<.gz> or
C<.bz2> will be properly uncompressed via call to C<gzip -dc> and C<bzip2 -dc>
respectively.
The target_paths array is expected to be one element per path in the following
format: class:format:raw_location
=over 4
=item class
Either 'h' for ham or 's' for spam. If the class is longer than 1 character,
it will be truncated. If blank, 'h' is default.
=item format
Specifies the format of the raw_location. C<dir> is a directory whose
files are individual messages, C<file> a file with a single message,
C<mbox> an mbox formatted file, or C<mbx> for an mbx formatted directory.
C<detect> can also be used; assumes C<file> for STDIN and anything that is not
a directory, or C<directory> otherwise.
=item raw_location
Path to file or directory. Can be "-" for STDIN. File globbing is allowed
using the standard csh-style globbing (see C<perldoc -f glob>). C<~> at the
front of the value will be replaced by the C<HOME> environment variable.
Escaped whitespace is protected as well.
=back
=cut
sub run {
my ($self, @targets) = @_;
if (!defined $self->{wanted_sub}) {
die "set_functions never called";
}
# non-forking model (generally sa-learn), everything in a single process
if ($self->{opt_j} == 0) {
my $message;
my $class;
my $result;
my $messages;
# message-array
($MESSAGES, $messages) = $self->message_array(\@targets);
while ($message = shift @{$messages}) {
my ($class, undef, $date) = index_unpack($message);
$result = $self->run_message($message);
&{$self->{result_sub}}($class, $result, $date) if $result;
}
}
# forking model (generally mass-check), avoid extended memory usage
else {
my $tmpf;
($tmpf, $self->{messageh}) = Mail::SpamAssassin::Util::secure_tmpfile();
unlink $tmpf;
undef $tmpf;
# forked child process scans messages
if ($tmpf = fork()) {
# parent
waitpid($tmpf, 0);
}
elsif (defined $tmpf) {
# child
$self->message_array(\@targets, $self->{messageh});
exit;
}
else {
die "cannot fork: $!";
}
# we now have a temp file with the messages to process
seek ($self->{messageh}, 0, 0);
$MESSAGES = $self->next_message();
# only do 1 process, message list in a temp file, no restarting
if ($self->{opt_j} == 1 && !defined $self->{opt_restart}) {
my $message;
my $class;
my $result;
my $messages;
my $total_count = 0;
while (($MESSAGES > $total_count) && ($message = $self->next_message()))
{
my ($class, undef, $date) = index_unpack($message);
$result = $self->run_message($message);
&{$self->{result_sub}}($class, $result, $date) if $result;
$total_count++;
}
}
# more than one process or one process with restarts
else {
my $select = IO::Select->new();
my $total_count = 0;
my $needs_restart = 0;
my @child = ();
my @pid = ();
my $messages;
# start children processes
$self->start_children($self->{opt_j}, \@child, \@pid, $select);
# feed childen, make them work for it, repeat
while ($select->count()) {
foreach my $socket ($select->can_read()) {
my $result = '';
my $line;
while ($line = readline $socket) {
if ($line =~ /^RESULT (.+)$/) {
my ($class,$type,$date) = index_unpack($1);
#warn ">> RESULT: $class, $type, $date\n";
if (defined $self->{opt_restart} &&
($total_count % $self->{opt_restart}) == 0)
{
$needs_restart = 1;
}
# if messages remain, and we don't need to restart, send message
if (($MESSAGES > $total_count) && !$needs_restart) {
print { $socket } $self->next_message() . "\n";
$total_count++;
#warn ">> recv: $MESSAGES $total_count\n";
}
else {
# stop listening on this child since we're done with it
#warn ">> removeresult: $needs_restart $MESSAGES $total_count\n";
$select->remove($socket);
}
# deal with the result we received
if ($result) {
chop $result; # need to chop the \n before RESULT
&{$self->{result_sub}}($class, $result, $date);
}
last; # this will avoid the read for this client
}
elsif ($line eq "START\n") {
if ($MESSAGES > $total_count) {
# we still have messages, send one to child
print { $socket } $self->next_message() . "\n";
$total_count++;
#warn ">> new: $MESSAGES $total_count\n";
}
else {
# no more messages, so stop listening on this child
#warn ">> removestart: $needs_restart $MESSAGES $total_count\n";
$select->remove($socket);
}
last; # this will avoid the read for this client
}
else {
# result line, remember it
$result .= $line;
}
}
# some error happened during the read!
if (!defined $line || !$line) {
$needs_restart = 1;
warn "readline failed, attempting to recover\n";
$select->remove($socket);
}
}
#warn ">> out of loop, $MESSAGES $total_count $needs_restart ".$select->count()."\n";
# If there are still messages to process, and we need to restart
# the children, and all of the children are idle, let's go ahead.
if ($needs_restart && $select->count == 0 && $MESSAGES > $total_count)
{
$needs_restart = 0;
#warn "debug: Needs restart, $MESSAGES total, $total_count done.\n";
$self->reap_children($self->{opt_j}, \@child, \@pid);
@child=();
@pid=();
$self->start_children($self->{opt_j}, \@child, \@pid, $select);
}
}
# reap children
$self->reap_children($self->{opt_j}, \@child, \@pid);
}
# close tempfile so it will be unlinked
close($self->{messageh});
}
}
############################################################################
sub message_array {
my ($self, $targets, $fh) = @_;
foreach my $target (@${targets}) {
my ($class, $format, $rawloc) = split(/:/, $target, 3);
# use ham by default, things like "spamassassin" can't specify the type
$class = substr($class, 0, 1) || 'h';
my @locations = $self->fix_globs($rawloc);
foreach my $location (@locations) {
my $method;
if ($format eq 'detect') {
# detect the format
if ($location eq '-' || !(-d $location)) {
# stdin is considered a file if not passed as mbox
$method = \&scan_file;
}
else {
# it's a directory
$method = \&scan_directory;
}
}
else {
if ($format eq "dir") {
$method = \&scan_directory;
}
elsif ($format eq "file") {
$method = \&scan_file;
}
elsif ($format eq "mbox") {
$method = \&scan_mailbox;
}
elsif ($format eq "mbx") {
$method = \&scan_mbx;
}
}
if(defined($method)) {
&{$method}($self, $class, $location);
}
else {
warn "format $format unknown!";
}
}
}
my @messages;
if ($self->{opt_n}) {
my %both = (%{ $self->{s} }, %{$self->{h}});
undef $self->{s};
undef $self->{h};
@messages = sort({ $both{$a} <=> $both{$b} } keys %both);
splice(@messages, $self->{opt_head}) if $self->{opt_head};
splice(@messages, 0, -$self->{opt_tail}) if $self->{opt_tail};
}
else {
my @s = sort({ $self->{s}->{$a} <=> $self->{s}->{$b} } keys %{$self->{s}});
undef $self->{s};
my @h = sort({ $self->{h}->{$a} <=> $self->{h}->{$b} } keys %{$self->{h}});
undef $self->{h};
splice(@s, $self->{opt_head}) if $self->{opt_head};
splice(@s, 0, -$self->{opt_tail}) if $self->{opt_tail};
splice(@h, $self->{opt_head}) if $self->{opt_head};
splice(@h, 0, -$self->{opt_tail}) if $self->{opt_tail};
while (@s && @h) {
push @messages, (shift @s);
push @messages, (shift @h);
}
push @messages, (splice @s), (splice @h);
}
if (defined $fh) {
print { $fh } map { "$_\n" } scalar(@messages), @messages;
return;
}
return scalar(@messages), \@messages;
}
sub next_message {
my ($self) = @_;
my $line = readline $self->{messageh};
chomp $line if defined $line;
return $line;
}
sub start_children {
my ($self, $count, $child, $pid, $socket) = @_;
my $io = IO::Socket->new();
my $parent;
# create children
for (my $i = 0; $i < $count; $i++) {
($child->[$i],$parent) = $io->socketpair(AF_UNIX,SOCK_STREAM,PF_UNSPEC)
or die "socketpair failed: $!";
if ($pid->[$i] = fork) {
close $parent;
# disable caching for parent<->child relations
my ($old) = select($child->[$i]);
$|++;
select($old);
$socket->add($child->[$i]);
#warn "debug: starting new child $i (pid ",$pid->[$i],")\n";
next;
}
elsif (defined $pid->[$i]) {
my $result;
my $line;
close $self->{messageh} if defined $self->{messageh};
close $child->[$i];
select($parent);
$| = 1; # print to parent by default, turn off buffering
print "START\n";
while ($line = readline $parent) {
chomp $line;
if ($line eq "exit") {
print "END\n";
close $parent;
exit;
}
$result = $self->run_message($line);
$result ||= '';
print "$result\nRESULT $line\n";
}
exit;
}
else {
die "cannot fork: $!";
}
}
}
sub reap_children {
my ($self, $count, $socket, $pid) = @_;
# If the child died, sending it the exit will generate a SIGPIPE, but we
# don't really care since the readline will go undef (which is fine),
# then we do the waitpid which will finish it off. So we end up in the
# right state, in theory.
local $SIG{'PIPE'} = 'IGNORE';
for (my $i = 0; $i < $count; $i++) {
#warn "debug: killing child $i (pid ",$pid->[$i],")\n";
print { $socket->[$i] } "exit\n"; # tell the child to die.
my $line = readline $socket->[$i]; # read its END statement.
close $socket->[$i];
waitpid($pid->[$i], 0); # wait for the signal ...
}
}
sub mail_open {
my ($file) = @_;
my $expr;
if ($file =~ /\.gz$/) {
$expr = "gunzip -cd $file |";
}
elsif ($file =~ /\.bz2$/) {
$expr = "bzip2 -cd $file |";
}
else {
$expr = "$file";
}
if (!open (INPUT, $expr)) {
warn "Unable to open $file: $!\n";
return 0;
}
return 1;
}
############################################################################
sub message_is_useful_by_date {
my ($self, $date) = @_;
return 0 unless $date; # undef or 0 date = unusable
if (!$self->{opt_after} && !$self->{opt_before}) {
# Not using the feature
return 1;
}
elsif (!$self->{opt_before}) {
# Just case about after
return $date > $self->{opt_after};
}
else {
return (($date < $self->{opt_before}) && ($date > $self->{opt_after}));
}
}
############################################################################
sub index_pack {
return join("\000", @_);
}
sub index_unpack {
return split(/\000/, $_[0]);
}
sub scan_directory {
my ($self, $class, $folder) = @_;
my @files;
opendir(DIR, $folder) || die "Can't open '$folder' dir: $!";
if (-f "$folder/cyrus.header") {
# cyrus metadata: http://unix.lsa.umich.edu/docs/imap/imap-lsa-srv_3.html
@files = grep { /^\S+$/ && !/^cyrus\.(?:index|header|cache|seen)/ }
readdir(DIR);
}
else {
# ignore ,234 (deleted or refiled messages) and MH metadata dotfiles
@files = grep { !/^[,.]/ } readdir(DIR);
}
closedir(DIR);
@files = grep { -f } map { "$folder/$_" } @files;
foreach my $mail (@files) {
if ($self->{opt_n}) {
$self->{$class}->{index_pack($class, "f", $no, $mail)} = $no;
$no++;
next;
}
my $header;
mail_open($mail) or next;
while (<INPUT>) {
last if /^$/;
$header .= $_;
}
close(INPUT);
my $date = Mail::SpamAssassin::Util::receive_date($header);
next if !$self->message_is_useful_by_date($date);
$self->{$class}->{index_pack($class, "f", $date, $mail)} = $date;
}
}
sub scan_file {
my ($self, $class, $mail) = @_;
if ($self->{opt_n}) {
$self->{$class}->{index_pack($class, "f", $no, $mail)} = $no;
$no++;
return;
}
my $header;
mail_open($mail) or return;
while (<INPUT>) {
last if /^$/;
$header .= $_;
}
close(INPUT);
my $date = Mail::SpamAssassin::Util::receive_date($header);
return if !$self->message_is_useful_by_date($date);
$self->{$class}->{index_pack($class, "f", $date, $mail)} = $date;
}
sub scan_mailbox {
my ($self, $class, $folder) = @_;
my @files;
if ($folder ne '-' && -d $folder) {
# passed a directory of mboxes
$folder =~ s/\/\s*$//; #Remove trailing slash, if there
opendir(DIR, $folder) || die "Can't open '$folder' dir: $!";
while($_ = readdir(DIR)) {
if(/^[^\.]\S*$/ && ! -d "$folder/$_") {
push(@files, "$folder/$_");
}
}
closedir(DIR);
}
else {
push(@files, $folder);
}
foreach my $file (@files) {
if ($file =~ /\.(?:gz|bz2)$/) {
die "compressed mbox folders are not supported at this time\n";
}
mail_open($file) or return;
my $start = 0; # start of a message
my $where = 0; # current byte offset
my $first = ''; # first line of message
my $header = ''; # header text
my $in_header = 0; # are in we a header?
while (!eof INPUT) {
my $offset = $start; # byte offset of this message
my $header = $first; # remember first line
while (<INPUT>) {
if ($in_header) {
if (/^$/) {
$in_header = 0;
}
else {
$header .= $_;
}
}
if (substr($_,0,5) eq "From ") {
$in_header = 1;
$first = $_;
$start = $where;
$where = tell INPUT;
last;
}
$where = tell INPUT;
}
if ($header) {
my $t;
if ($self->{opt_n}) {
$t = $no++;
}
else {
$t = Mail::SpamAssassin::Util::receive_date($header);
next if !$self->message_is_useful_by_date($t);
}
$self->{$class}->{index_pack($class, "m", $t, "$file.$offset")} = $t;
}
}
close INPUT;
}
}
sub scan_mbx {
my ($self, $class, $folder) = @_ ;
my (@files, $fp) ;
if ($folder ne '-' && -d $folder) {
# got passed a directory full of mbx folders.
$folder =~ s/\/\s*$//; # remove trailing slash, if there is one
opendir(DIR, $folder) || die "Can't open '$folder' dir: $!" ;
while($_ = readdir(DIR)) {
if(/^[^\.]\S*$/ && ! -d "$folder/$_") {
push(@files, "$folder/$_");
}
}
closedir(DIR);
} else {
push(@files, $folder) ;
}
foreach my $file (@files) {
if ($folder =~ /\.(?:gz|bz2)$/) {
die "compressed mbx folders are not supported at this time\n" ;
}
mail_open($file) or return ;
# check the mailbox is in mbx format
$fp = <INPUT> ;
if ($fp !~ /\*mbx\*/) {
die "Error, mailbox not in mbx format!\n" ;
}
# skip mbx headers to the first email...
seek(INPUT, 2048, 0) ;
my $sep = MBX_SEPARATOR;
while (<INPUT>) {
if ($_ =~ /$sep/) {
my $offset = tell INPUT ;
my $size = $2 ;
# gather up the headers...
my $header = '' ;
while (<INPUT>) {
last if (/^$/) ;
$header .= $_ ;
}
my $t;
if ($self->{opt_n}) {
$t = $no++;
} else {
$t = Mail::SpamAssassin::Util::receive_date($header);
next if !$self->message_is_useful_by_date($t);
}
$self->{$class}->{index_pack($class, "b", $t, "$file.$offset")} = $t;
seek(INPUT, $offset + $size, 0) ;
} else {
die "Error, failure to read message body!\n" ;
}
}
close INPUT;
}
}
############################################################################
sub run_message {
my ($self, $msg) = @_;
my ($class, $format, $date, $mail) = index_unpack($msg);
if ($format eq "f") {
return $self->run_file($class, $mail, $date);
}
elsif ($format eq "m") {
return $self->run_mailbox($class, $mail, $date);
}
elsif ($format eq "b") {
return $self->run_mbx($class, $mail, $date);
}
}
sub run_file {
my ($self, $class, $where, $date) = @_;
mail_open($where) or return;
# skip too-big mails
if (! $self->{opt_all} && -s INPUT > BIG_BYTES) {
close INPUT;
return;
}
my @msg = (<INPUT>);
close INPUT;
&{$self->{wanted_sub}}($class, $where, $date, \@msg);
}
sub run_mailbox {
my ($self, $class, $where, $date) = @_;
my ($file, $offset) = ($where =~ m/(.*)\.(\d+)$/);
my @msg;
mail_open($file) or return;
seek(INPUT,$offset,0);
my $past = 0;
while (<INPUT>) {
if ($past) {
last if substr($_,0,5) eq "From ";
}
else {
$past = 1;
}
# skip too-big mails
if (! $self->{opt_all} && @msg > BIG_LINES) {
close INPUT;
return;
}
push (@msg, $_);
}
close INPUT;
&{$self->{wanted_sub}}($class, $where, $date, \@msg);
}
sub run_mbx {
my ($self, $class, $where, $date) = @_ ;
my ($file, $offset) = ($where =~ m/(.*)\.(\d+)$/) ;
my @msg ;
mail_open($file) or return ;
seek(INPUT, $offset, 0) ;
while (<INPUT>) {
last if ($_ =~ MBX_SEPARATOR) ;
# skip mails that are too big
if (! $self->{opt_all} && @msg > BIG_LINES) {
close INPUT ;
return ;
}
push (@msg, $_) ;
}
close INPUT ;
&{$self->{wanted_sub}}($class, $where, $date, \@msg) ;
}
############################################################################
sub fix_globs {
my ($self, $path) = @_;
# replace leading tilde with home dir: ~/abc => /home/jm/abc
$path =~ s/^~/$ENV{'HOME'}/;
# protect/escape spaces: ./Mail/My Letters => ./Mail/My\ Letters
$path =~ s/([^\\])(\s)/$1\\$2/g;
my @paths;
# apply csh-style globs: ./corpus/*.mbox => er, you know what it does ;)
@paths = glob $path;
return @paths;
}
############################################################################
1;
__END__
=back
=head1 SEE ALSO
C<Mail::SpamAssassin>
C<spamassassin>
C<mass-check>
| 25.986957 | 93 | 0.577296 |
ed7b7d47f4da0967b94194abbfb8026b07332c4b | 2,381 | pm | Perl | tests/installation/setup_zdup.pm | akedroutek/os-autoinst-distri-opensuse | ad49c51e979f5d2654d084b5c5ae0425da9a66c9 | [
"FSFAP"
] | null | null | null | tests/installation/setup_zdup.pm | akedroutek/os-autoinst-distri-opensuse | ad49c51e979f5d2654d084b5c5ae0425da9a66c9 | [
"FSFAP"
] | null | null | null | tests/installation/setup_zdup.pm | akedroutek/os-autoinst-distri-opensuse | ad49c51e979f5d2654d084b5c5ae0425da9a66c9 | [
"FSFAP"
] | null | null | null | # SUSE's openQA tests
#
# Copyright © 2009-2013 Bernhard M. Wiedemann
# Copyright © 2012-2017 SUSE LLC
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
# Summary: Preparation step for zypper dup. Making sure that a console is available and selected.
# Maintainer: Ludwig Nussel <lnussel@suse.com>
use base "installbasetest";
use strict;
use warnings;
use testapi;
use utils;
use version_utils qw(is_jeos is_desktop_installed);
use Utils::Backends 'is_pvm';
sub run {
my ($self) = @_;
$self->wait_boot(textmode => !is_desktop_installed(), bootloader_time => 300, ready_time => 600) unless is_jeos;
if (get_var('ZDUP_IN_X')) {
x11_start_program('xterm');
become_root;
}
else {
# Remove the graphical stuff
# This do not work in 13.2
# script_sudo "/sbin/init 3";
select_console('root-console');
# Create a snapshot with specified description to do snapper rollback
# This action is concerned about following points:
# 1. Source image could be original installation or updated
# 2. Source image may apply patches before migration
# 3. Hard to assert similar snapshots in grub2
# 4. Menu of each snapshot is long with openSUSE leap, use short and unique description
# 5. Avoid rollback to snapshot without graphical target
# snapper is not available at least on our version of openSUSE 13.1
# HDD used for upgrade.
if (get_var('HDDVERSION', '') !~ /13.1/) {
assert_script_run "snapper create --type pre --cleanup-algorithm=number --print-number --userdata important=yes --description 'b_zdup migration'";
}
if (!is_jeos) {
# Remove the --force when this is fixed:
# https://bugzilla.redhat.com/show_bug.cgi?id=1075131
systemctl 'set-default --force multi-user.target';
# The CD was ejected in the bootloader test
type_string("/sbin/reboot\n");
reset_consoles;
reconnect_mgmt_console if is_pvm;
$self->wait_boot(textmode => 1, bootloader_time => 200);
select_console('root-console');
}
}
}
1;
| 35.014706 | 158 | 0.660227 |
ed6dabafc752ce685915115fe3c6013ea2757f6b | 17,713 | pm | Perl | tmac/tmac.pm | dnjp/plan9port | 58b6cd89771303f5c49414b7dcef43883433a840 | [
"MIT"
] | null | null | null | tmac/tmac.pm | dnjp/plan9port | 58b6cd89771303f5c49414b7dcef43883433a840 | [
"MIT"
] | null | null | null | tmac/tmac.pm | dnjp/plan9port | 58b6cd89771303f5c49414b7dcef43883433a840 | [
"MIT"
] | null | null | null | .\" 10/22/92 activate next line before installing
.pi /Users/daniel/plan9/bin/auxpm
.
. \" IZ - initialization
.de IZ
.fp 10 S \" force a font out into prefix
.nr PS 10 \" point size
.nr VS 12 \" line spacing
.ps \\n(PS
.ie \\n(VS>=41 .vs \\n(VSu
.el .vs \\n(VSp
.nr LL 6i \" line length
.ll \\n(LLu
.nr LT \\n(.l \" title length
.lt \\n(LTu
.if !\\n(HM .nr HM 1i \" top of page
.if !\\n(FM .nr FM 1i \" footer margin
.if !\\n(FO .nr FO \\n(.p-\\n(FM \" bottom of page
. \" to set text ht to N, set FO to N + \n(HM. default is 10i
.pl 32767u \" safety first: big pages for pm
.if !\\n(PO .nr PO \\n(.ou \" page offset
.nr PI 5n \" .PP paragraph indent
.nr QI 5n \" .QS indent
.nr DI 5n \" .DS indent
.nr PD 0.3v \" paragraph vertical separation
.nr TS 0.5v \" space around tables
.nr Kf 0.5v \" space around .KF/.KE
.nr Ks 0.5v \" space around .KS/.KE
.
.nr P1 .4i \" indent for .P1/.P2
.nr dP 1 \" delta point size for programs in .P1/.P2
.nr dV 2p \" delta vertical for programs
.nr dT 8 \" delta tab stop for programs
.nr DV .5v \" space before start of program
.nr IP 0 \" ?
.nr IR 0 \" ?
.nr I1 \\n(PIu
.ev 1
.if !\\n(FL .nr FL \\n(LLu \" footnote length
.ll \\n(FLu
.ps 8 \" text size & leading in footnote
.vs 10p
.ev
.if \\*(CH .ds CH "\(hy \\\\n(PN \(hy
.ds # #\\\\n(.c \\\\n(.F
.
.
.ME \" initialize date strings
.rm ME
. \" accents: \*'e \*`e \*:u \*^e \*~n \*va \*,c
.ds ' \h'\w'e'u*4/10'\z\(aa\h'-\w'e'u*4/10'
.ds ` \h'\w'e'u*4/10'\z\(ga\h'-\w'e'u*4/10'
.ds : \\v'-0.6m'\\h'(1u-(\\\\n(.fu%2u))*0.13m+0.00m'\\z.\\h'0.2m'\\z.\\h'-((1u-(\\\\n(.fu%2u))*0.13m+0.20m)'\\v'0.6m'
.ds ^ \\\\k:\\h'-\\\\n(.fu+1u/2u*2u+\\\\n(.fu-1u*0.13m+0.06m'\\z^\\h'|\\\\n:u'
.ds ~ \\\\k:\\h'-\\\\n(.fu+1u/2u*2u+\\\\n(.fu-1u*0.13m+0.06m'\\z~\\h'|\\\\n:u'
.ds v \\\\k:\\\\h'+\\\\w'e'u/4u'\\\\v'-0.6m'\\\\s6v\\\\s0\\\\v'0.6m'\\\\h'|\\\\n:u'
.ds , \\\\k:\\\\h'\\\\w'c'u*0.4u'\\\\z,\\\\h'|\\\\n:u'
..
.
.
. \" SP - generate paddable space
.de SP
.br
.nr X 1v
.if \\n(.$ .nr X \\$1v
.ie '\\$2'exactly' \{\
\v'\\nXu'\ \h'-\w'\ 'u'\c
.sp \\$1\}
.el .X "SP \\nX \\$2"
..
. \" NE - need space on this page
.de NE
.nr X 1v
.if \\n(.$ .nr X \\$1v
.X "NE \\nX \\$2"
..
. \" BP, FL, FC - begin page, flush figures, flush column
.de BP
.br
.X CMD BP
..
.de FL
.br
.X CMD FL
..
.de FC
.br
.X CMD FC
..
. \" X - generate an x X ... command in the output
.de X
....ie '\\n(.z'' \\!x X \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
....el \\!.X "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
...
.if !'\\n(.z'' .if \\n(.$=1 \\!.X "\\$1
.if !'\\n(.z'' .if \\n(.$=2 \\!.X "\\$1 \\$2
.if !'\\n(.z'' .if \\n(.$=3 \\!.X "\\$1 \\$2 \\$3
.if !'\\n(.z'' .if \\n(.$>3 \\!.X "\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
.if '\\n(.z'' .if \\n(.$=1 \\!x X \\$1 \\*#
.if '\\n(.z'' .if \\n(.$=2 \\!x X \\$1 \\$2 \\*#
.if '\\n(.z'' .if \\n(.$=3 \\!x X \\$1 \\$2 \\$3 \\*#
.if '\\n(.z'' .if \\n(.$=4 \\!x X \\$1 \\$2 \\$3 \\$4 \\*#
.if '\\n(.z'' .if \\n(.$>4 \\!x X \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 \\*#
..
. \" DA - force date
.de DA
.if \\n(.$ .ds DY \\$1 \\$2 \\$3 \\$4
.ds CF \\*(DY
..
. \" ND - set new or no date
.de ND
.ds DY \\$1 \\$2 \\$3 \\$4
.rm CF
..
.de ME \" ME - set month strings
.if \\n(mo-0 .ds MO January
.if \\n(mo-1 .ds MO February
.if \\n(mo-2 .ds MO March
.if \\n(mo-3 .ds MO April
.if \\n(mo-4 .ds MO May
.if \\n(mo-5 .ds MO June
.if \\n(mo-6 .ds MO July
.if \\n(mo-7 .ds MO August
.if \\n(mo-8 .ds MO September
.if \\n(mo-9 .ds MO October
.if \\n(mo-10 .ds MO November
.if \\n(mo-11 .ds MO December
.if \\n(dw-0 .ds DW Sunday
.if \\n(dw-1 .ds DW Monday
.if \\n(dw-2 .ds DW Tuesday
.if \\n(dw-3 .ds DW Wednesday
.if \\n(dw-4 .ds DW Thursday
.if \\n(dw-5 .ds DW Friday
.if \\n(dw-6 .ds DW Saturday
.if "\\*(DY"" .ds DY \\*(MO \\n(dy, 19\\n(yr
..
. \" FP - font position for a family
.de FP
.if '\\$1'palatino'\{\
. fp 1 PA
. fp 2 PI
. fp 3 PB
. fp 4 PX\}
.if '\\$1'lucidasans'\{\
. fp 1 R LucidaSans
. fp 2 I LucidaSansI
. fp 3 B LucidaSansB
. fp 5 CW LucidaCW\}
.if '\\$1'century'\{\
. ie '\\*(.T'202'\{\
. fp 1 NR Centsb
. fp 2 NI CentI
. fp 3 NB CentB
. fp 4 NX CentBI\}
. el \{\
. fp 1 NR
. fp 2 NI
. fp 3 NB
. fp 4 NX\}\}
.if '\\$1'helvetica'\{\
. fp 1 H
. fp 2 HI
. fp 3 HB
. fp 4 HX\}
.if '\\$1'bembo'\{\
. ie '\\*(.T'202'\{\
. fp 1 B1 Bembo
. fp 2 B2 BemboI
. fp 3 B3 BemboB
. fp 4 B4 BemboBI\}
. el \{\
. fp 1 B1
. fp 2 B2
. fp 3 B3
. fp 4 B4\}\}
.if '\\$1'optima'\{\
. fp 1 R Optima
. fp 2 I OptimaI
. fp 3 B OptimaB
. fp 4 BI OptimaBI\}
.if '\\$1'souvenir'\{\
. fp 1 R Souvenir
. fp 2 I SouvenirI
. fp 3 B SouvenirB
. fp 4 BI SouvenirBI\}
.if '\\$1'melior'\{\
. fp 1 R Melior
. fp 2 I MeliorI
. fp 3 B MeliorB
. fp 4 BI MeliorBI\}
.if '\\$1'times'\{\
. fp 1 R
. fp 2 I
. fp 3 B
. fp 4 BI\}
..
. \" TL - title
.de TL
.br
.if !\\n(1T .BG
....hy 0
.ft 3
.ps \\n(PS+2p
.vs \\n(VS+2p
.ll \\n(LLu
.ce 100 \" turned off in .RT
.sp .5i
..
. \" AU - remember author(s)
.de AU
.ft 1
.ps \\n(PS
.ie \\n(VS>=41 .vs \\n(VSu
.el .vs \\n(VSp
.SP .5
..
. \" AI - author's institution
.de AI
.SP .25
.ft 2
..
. \" AB - begin abstract
.de AB
.nr AB 1 \" we're in abstract
.if !\\n(1T .BG
.ft 1
.ps \\n(PS
.vs \\n(VSp
.ce
.in +\\n(.lu/12u
.ll -\\n(.lu/12u
.SP 1
.ie \\n(.$ \\$1
.el ABSTRACT
.SP .75
.RT
..
. \" AE - end of abstract
.de AE
.br
.nr AB 0
.in 0
.ll \\n(LLu
.ps \\n(PS
.ie \\n(VS>=41 .vs \\n(VSu
.el .vs \\n(VSp
.SP
..
. \" 2C - 2 columns
.de 2C
.MC 2
..
. \" 1C - 1 column
.de 1C
.MC 1
..
. \" MC - multiple columns
.de MC
.br
.if \\n(1T .RT
.if \\n(1T .NP
.if !\\n(OL .nr OL \\n(LL
.if \\n(CW=0 .nr CW \\n(LL*7/15
.if \\n(GW=0 .nr GW \\n(LL-(2*\\n(CW)
.nr x \\n(CW+\\n(GW
.if "\\$1"" .MC 2
.if \\$1=1 \{\
. X MC 1 0
. nr LL \\n(OLu\}
.if \\$1=2 \{\
. X MC 2 \\nx
. nr LL \\n(CWu\}
.ll \\n(LLu
.if \\$1>2 .tm -mpm can't handle more than two columns
.if \\n(1T .RT
..
. \" TS - table start, TE - table end; also TC, TQ, TH
.de TS
.br
.if !\\n(1T .RT
.SP \\n(TSu TS
.X "US TS
.if \\$1H .TQ
.nr IX 1
..
.de TC
.nr TZ \\n(.lu
.if \\n(.$ .nr TZ \\$1n
.ta \\n(TZuR
..
.de TD
.LP
.nr TZ 0
..
.de TQ
.di TT
.nr IT 1
..
.de TH
.if \\n(.d>0.5v \{\
. nr T. 0
. T# 0\}
.di
.nr TQ \\n(.i
.nr HT 1
.in 0
.mk #a
.mk #b
.mk #c
.mk #d
.mk #e
.mk #f
.TT
.in \\n(TQu
.mk #T
..
. \" TE - table end
.de TE
.nr IX 0
.if \\n(IT .if !\\n(HT \{\
. di
. nr EF \\n(.u
. nf
. TT
. if \\n(EF .fi\}
.nr IT 0
.nr HT 0
.rm a+ b+ c+ d+ e+ f+ g+ h+ i+ j+ k+ l+ n+ m+
.rr 32 33 34 35 36 37 38 40 79 80 81 82
.rr a| b| c| d| e| f| g| h| i| j| k| l| m|
.rr a- b- c- d- e- f- g- h- i- j- k- l- m-
.X "END US TE
.SP \\n(TSu TE
.bp
..
. \" EQ - equation, breakout and display
.de EQ
.nr EF \\n(.u
.rm EE
.nr LE 1 \" 1 is center
.ds EL \\$1
.if "\\$1"L" \{\
. ds EL \\$2
. nr LE 0\}
.if "\\$1"C" .ds EL \\$2
.if "\\$1"R" \{\
. ds EL \\$2 \" 2 is right adjust
. nr LE 2\}
.if "\\$1"I" \{\
. nr LE 0
. if "\\$3"" .ds EE \\h'|10n'
. el .ds EE \\h'\\$3'
. ds EL \\$2\}
.if \\n(YE .nf
.di EZ
..
. \" EN - end of equation
.de EN
.br
.di
.rm EZ
.nr ZN \\n(dn
.if \\n(ZN .if !\\n(YE .LP
.if !\\n(ZN .if !"\\*(EL"" .nr ZN 1
.if \\n(ZN \{\
. SP .5v EQ
. X "US EQ"\}
'pc
.if \\n(BD .nr LE 0 \" don't center if block display or mark/lineup
.if \\n(MK \{\
. if \\n(LE=1 .ds EE \\h'|10n'
. nr LE 0\}
'lt \\n(.lu
.if !\\n(EP .if \\n(ZN \{\
. if \\n(LE=1 .tl \(ts\(ts\\*(10\(ts\\*(EL\(ts
. if \\n(LE=2 .tl \(ts\(ts\(ts\\*(10\\*(EL\(ts
. if !\\n(LE \{\
. if !\\n(BD .tl \(ts\\*(EE\\*(10\(ts\(ts\\*(EL\(ts
. if \\n(BD .if \\n(BD<\\w\(ts\\*(10\(ts .nr BD \\w\(ts\\*(10\(ts
. if \\n(BD \!\\*(10\\t\\*(EL\}\}
.if \\n(EP .if \\n(ZN \{\
. if \\n(LE=1 .tl \(ts\\*(EL\(ts\\*(10\(ts\(ts
. if \\n(LE=2 .tl \(ts\\*(EL\(ts\(ts\\*(10\(ts
. if !\\n(LE \{\
. if !\\n(BD .tl \(ts\\*(EL\\*(EE\\*(10\(ts\(ts\(ts
. if \\n(BD .if \\n(BD<\\w\(ts\\*(10\(ts .nr BD \\w\(ts\\*(10\(ts
. if \\n(BD \!\\h'-\\\\n(.iu'\\*(EL\\h'|0'\\*(10\}\}
'lt \\n(LLu
'pc %
.if \\n(YE .if \\n(EF .fi
.if \\n(ZN .X "END US EQ"
.if \\n(ZN .SP .5v EN
.if \\n(ZN .bp
..
. \" PS - start picture
.de PS \" $1 is height, $2 is width, in inches
.br
.nr X 0.35v
.if \\$1>0 .X "SP \\nX PS"
.ie \\$1>0 .nr $1 \\$1
.el .nr $1 0
.X "US PS \\$1
.in (\\n(.lu-\\$2)/2u
..
. \" PE - end of picture
.de PE
.in
.X "END US PE
.nr X .65v
.if \\n($1>0 .X "SP \\nX PE"
.bp
..
.de IS \" for -mpm only
.KS
..
.de IE
.KE
.bp
..
. \" NP - new page
.de NP
.ev 2
.bp
.if \\n(KF=0 \{\
. nr PX \\n(.s
. nr PF \\n(.f
. nr PV \\n(.v
. lt \\n(LTu
. ps \\n(PS
. vs \\n(PS+2
. ft 1
. if \\n(PO .po \\n(POu \" why isn't this reset???
. PT \\$1
. bp
. rs
. BT
. bp
. nr %# +1
. ps \\n(PX
. vs \\n(PVu
. ft \\n(PF \}
.ev
..
.
.ds %e .tl '\\*(LH'\\*(CH'\\*(RH'
.ds %o .tl '\\*(LH'\\*(CH'\\*(RH'
.ds %E .tl '\\*(LF'\\*(CF'\\*(RF'
.ds %O .tl '\\*(LF'\\*(CF'\\*(RF'
.
. \" PT - page title
.de PT
.nr PN \\n(%#
.X "PT \\n(%#
.sp \\n(HMu/2u
.if \\n(OL .lt \\n(OLu \" why isn't this reset???
.if \\n(BT>0 .if \\n(%#%2 \\*(%o
.if \\n(BT>0 .if !\\n(%#%2 \\*(%e
.if \\n(BT=0 .tl '\0''' \" put out something or spacing is curdled
.X "END PT \\n(%#
..
. \" BT - bottom title
.de BT
.X "BT \\n(%#
.sp |\\n(FMu/2u+\\n(FOu-1v
.if \\n(%#%2 \\*(%O
.if !\\n(%#%2 \\*(%E
.nr BT \\n(BT+1
.X "END BT \\n(%#
..
. \" KS - non-floating keep
.de KS
.br
.if "\\n(.z"" .NP \" defends poorly against including ht of page stuff in diversion for .B1
.X "US KS 0
.nr KS +1
.SP \\n(Ksu
..
. \" KF - floating keep
.de KF
.ev 1
.br
.if \\n(KS>0 .tm KF won't work inside KS, line \\n(.c, file \\n(.F
.if \\n(KF>0 .tm KF won't work inside KF, line \\n(.c, file \\n(.F
.nr KF 1
.nr 10 0
. if !'\\$1'' .nr 10 \\$1u
. if '\\$1'bottom' .nr 10 \\n(FOu-1u
. if '\\$1'top' .nr 10 \\n(HM
. if \\n(10 .X "UF \\n(10 KF"
. if !\\n(10 .X "UF \\n(HM KF"
. nr X \\n(FOu-2u
. if \\n(10 .X "UF \\n(10 KF"
. if !\\n(10 .X "UF \\nX KF"
.nr SJ \\n(.u
.ps \\n(PS
.if \\n(VS>40 .vs \\n(VSu
.if \\n(VS<=39 .vs \\n(VSp
.ll \\n(LLu
.lt \\n(LTu
.SP \\n(Kfu
..
. \" KE - end of KS/KF
.de KE
.bp
.ie \\n(KS>0 \{\
. SP \\n(Ksu
. X "END US KS
. nr KS -1 \}
.el .ie \\n(KF>0 \{\
. SP \\n(Kfu
. nr KF 0
. X "END UF KF"
. if \\n(SJ .fi
. ev \}
.el .tm .KE without preceding .KS or .KF, line \\n(.c, file \\n(.F
..
.
. \" DS - display. .DS C center; L left-adjust; I indent (default)
.de DS \" $2 = amount of indent
.KS
.nf
.\\$1D \\$2 \\$1
.ft 1
.if !\\n(IF \{\
. ps \\n(PS
. if \\n(VS>40 .vs \\n(VSu
. if \\n(VS<=39 .vs \\n(VSp\}
..
.de D
.ID \\$1
..
.de CD
.XD
.ce 1000
..
.de ID
.XD
.if \\n(.$=0 .in +\\n(DIu
.if \\n(.$=1 .if "\\$1"I" .in +\\n(DIu
.if \\n(.$=1 .if !"\\$1"I" .in +\\$1n
.if \\n(.$>1 .in +\\$2n
.....in +0.5i
.....if \\n(.$ .if !"\\$1"I" .if !"\\$1"" .in \\n(DIu
.....if \\n(.$ .if !"\\$1"I" .if !"\\$1"" .in +\\$1n
..
.de LD
.XD
..
.de XD
.nf
.nr OI \\n(.i
.SP \\n(DVu
..
. \" BD - block display: save everything, then center it.
.de BD
.XD
.nr BD 1
.nf
.in \\n(OIu
.di DD
..
. \" DE - display end
.de DE
.ce 0
.if \\n(BD>0 .XF
.nr BD 0
.in \\n(OIu
.SP \\n(DVu
.KE
.fi
..
. \" XF - finish a block display to be recentered.
.de XF
.di
.if \\n(dl>\\n(BD .nr BD \\n(dl
.if \\n(BD<\\n(.l .in (\\n(.lu-\\n(BDu)/2u
.nr EI \\n(.l-\\n(.i
.ta \\n(EIuR
.nf
.DD
.in \\n(OIu
..
.
.
. \" SH - (unnumbered) section heading
.de SH
.RT
.nr X 1v
.nr Y 3v
.if \\n(1T .NP
.if \\n(1T .X "NE \\nY SH" \" should these be reversed, change Y to 4v
.if \\n(1T .X "SP \\nX SH
.ft 3
..
. \" NH - numbered heading
.de NH
.RT
.nr X 1v
.nr Y 3v
.if \\n(1T .NP
.if \\n(1T .X "NE \\nY NH" \" should these be reversed, change Y to 4v
.if \\n(1T .X "SP \\nX NH
.ft 3
.nr NS \\$1
.if !\\n(.$ .nr NS 1
.if !\\n(NS .nr NS 1
.nr H\\n(NS +1
.if !\\n(NS-4 .nr H5 0
.if !\\n(NS-3 .nr H4 0
.if !\\n(NS-2 .nr H3 0
.if !\\n(NS-1 .nr H2 0
.if !\\$1 .if \\n(.$ .nr H1 1
.ds SN \\n(H1.
.if \\n(NS-1 .as SN \\n(H2.
.if \\n(NS-2 .as SN \\n(H3.
.if \\n(NS-3 .as SN \\n(H4.
.if \\n(NS-4 .as SN \\n(H5.
\\*(SN
..
. \" RT - reset at beginning of each PP, LP, etc.
.de RT
.if !\\n(AB .if !\\n(1T .BG
.ce 0
.if !\\n(AB .if !\\n(KF .if !\\n(IF .if !\\n(IX .if !\\n(BE .di
.if \\n(QP \{\
. ll +\\n(QIu
. in -\\n(QIu
. nr QP -1\}
.if !\\n(AB \{\
. ll \\n(LLu\}
.if !\\n(IF .if !\\n(AB \{\
. ps \\n(PS
. ie \\n(VS>=41 .vs \\n(VSu
. el .vs \\n(VSp\}
.ie \\n(IP \{\
. in \\n(I\\n(IRu
. nr IP -1\}
.el .if !\\n(IR \{\
. nr I1 \\n(PIu
. nr I2 0
. nr I3 0
. nr I4 0
. nr I5 0\}
.if !\\n(AB .ft 1
.ta 5n 10n 15n 20n 25n 30n 35n 40n 45n 50n 55n 60n 65n 70n 75n 80n
.fi
..
. \" BG - begin, execute at first TL, AB, NH, SH, PP, etc.
.de BG \" IZ has been called, so registers have some value
.br
.if \\n(CW>0 .if \\n(LL=0 .nr LL \\n(CW+\\n(CW+\\n(GW
.ll \\n(LLu
.lt \\n(LLu
.po \\n(POu
.nr YE 1 \" ok to cause break in .EQ (earlier ones won't)
.ev 0
.hy 14
.ev
.ev 1
.hy 14
.ev
.ev 2
.hy 14
.ev
.nr 1T 1
.X "PARM NP \\n(HM
.X "PARM FO \\n(FO
.if !\\n(%# .nr %# 1
..
. \" PP - paragraph
.de PP
.RT
.if \\n(1T .NP
.if \\n(1T .X "SP \\n(PD PP"
.if \\n(1T .X "BS 2 PP"
.ti +\\n(PIu
..
. \" LP - left aligned paragraph
.de LP
.RT
.if \\n(1T .NP
.if \\n(1T .X "SP \\n(PD LP"
.if \\n(1T .X "BS 2 LP"
..
. \" IP - indented paragraph
.de IP
.RT
.if !\\n(IP .nr IP +1
.if \\n(1T .NP
.if \\n(1T .X "SP \\n(PD PP"
.if \\n(1T .X "BS 2 IP"
.nr IU \\n(IR+1
.if \\n(.$>1 .nr I\\n(IU \\$2n+\\n(I\\n(IRu
.if \\n(I\\n(IU=0 .nr I\\n(IU \\n(PIu+\\n(I\\n(IRu
.in \\n(I\\n(IUu
.nr TY \\n(TZ-\\n(.i
.nr JQ \\n(I\\n(IU-\\n(I\\n(IR
.ta \\n(JQu \\n(TYuR
.if \\n(.$ \{\
.ti \\n(I\\n(IRu
\&\\$1\t\c\}
..
. \" QP - quoted paragraph (within IP)
.de QP
.RT
.if \\n(1T .NP
.if \\n(1T .X "SP \\n(PD QP"
.if \\n(1T .X "BS 2 QP"
.nr QP 1
.in +\\n(QIu
.ll -\\n(QIu
.ti \\n(.iu
..
. \" RS - prepare for double indenting
.de RS
.nr IS \\n(IP
.RT
.nr IP \\n(IS
.nr IU \\n(IR
.nr IR +1
.if !\\n(I\\n(IR .nr I\\n(IR \\n(I\\n(IU+\\n(PIu
.in \\n(I\\n(IRu
.nr TY \\n(TZ-\\n(.i
.ta \\n(TYuR
..
. \" RE - retreat to the left
.de RE
.nr IS \\n(IP
.RT
.nr IP \\n(IS
.if \\n(IR>0 .nr IR -1
.in \\n(I\\n(IRu
..
. \" B - bold font
.de B
.nr PQ \\n(.f
.ft 3
.if \\n(.$ \&\\$1\\f\\n(PQ\\$2
..
. \" BI - bold italic
.de BI
.nr PQ \\n(.f
.ft 4
.if \\n(.$ \&\\$1\\f\\n(PQ\\$2
..
. \" R - Roman font
.de R
.nr PQ \\n(.f
.ft 1
.if \\n(.$ \&\\$1\f\\n(PQ\\$2
..
. \" I - italic font
.de I
.nr PQ \\n(.f
.ft 2
.if \\n(.$ \&\\$1\^\f\\n(PQ\\$2
..
. \" CW - constant width font from -ms
.de CW
.nr PQ \\n(.f
.if \\n(.$=0 .ft CW
.if \\n(.$>0 \%\&\\$3\f(CW\\$1\\f\\n(PQ\\$2
..
.de IT \" ditto to italicize argument
.nr Sf \\n(.f
\%\&\\$3\f2\\$1\f\\n(Sf\&\\$2
..
. \" TA - tabs set in ens or chars
.de TA
.ta \\$1n \\$2n \\$3n \\$4n \\$5n \\$6n \\$7n \\$8n \\$9n
..
. \" SM - make smaller size
.de SM
.ie \\n(.$ \&\\$3\s-2\\$1\s0\\$2
.el .ps -2
..
. \" LG - make larger size
.de LG
.ie \\n(.$ \&\\$3\s+2\\$1\s0\\$2
.el .ps +2
..
. \" NL - return to normal size
.de NL
.ps \\n(PS
..
. \" FS - begin footnote
.de FS
.if \\n(IF>0 .tm .FS within .FS/.FE, line \\n(.c, file \\n(.F
.if \\n(KF>0 .tm .FS won't work inside .KF, line \\n(.c, file \\n(.F
.if \\n(KS>0 .tm .FS won't work inside .KS, line \\n(.c, file \\n(.F
.nr IF 1
.ev 1
.ps \\n(PS-2
.ie \\n(VS>=41 .vs \\n(VSu-2p
.el .vs \\n(VSp-2p
.ll \\n(LLu
.br
.nr X \\n(FOu
.X "BF \\nX FS
.SP .3v
....FA \" deleted by authority of cvw, 10/17/88
..
. \" FE - end footnote
.de FE
.if !\\n(IF .tm .FE without .FS, line \\n(.c, file \\n(.F
.br
.X "END BF FE
.bp
.ev
.nr IF 0
..
. \" FA - the line for a footnote
.de FA
\l'1i'
.br
..
. \" Tm - message to be passed on
.de Tm
.ev 2
.if \\n(.$=1 .X "TM \\$1
.if \\n(.$=2 .X "TM \\$1 \\$2
.if \\n(.$=3 .X "TM \\$1 \\$2 \\$3
.if \\n(.$=4 .X "TM \\$1 \\$2 \\$3 \\$4
.if \\n(.$=5 .X "TM \\$1 \\$2 \\$3 \\$4 \\$5
.if \\n(.$=6 .X "TM \\$1 \\$2 \\$3 \\$4 \\$5 \\$6
.if \\n(.$=7 .X "TM \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7
.if \\n(.$=8 .X "TM \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
.if \\n(.$=9 .X "TM \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
.br
.ev
..
.de MH
AT&T Bell Laboratories
Murray Hill, New Jersey 07974
..
.de HO
AT&T Bell Laboratories
Holmdel, New Jersey 07733
..
.de WH
AT&T Bell Laboratories
Whippany, New Jersey 07981
..
.de IH
AT&T Bell Laboratories
Naperville, Illinois 60540
..
. \" UL - underline argument, don't italicize
.de UL
\\$1\l'|0\(ul'\\$2
..
. \" UX - print $2 UNIX $1
.de UX
.ie \\n(UX \\$2\s-1UNIX\s0\\$1
.el \{\
\\$2\s-1UNIX\\s0\\$1\(rg
.nr UX 1\}
..
. \" QS - start quote
.de QS
.br
.LP
.in +\\n(QIu
.ll -\\n(QIu
..
. \" QE - end quote
.de QE
.br
.ll +\\n(QIu
.in -\\n(QIu
.LP
..
. \" B1 - begin boxed stuff
.de B1
.br
.di BB
.nr BC 0
.if "\\$1"C" .nr BC 1
.nr BE 1
..
. \" B2 - end boxed stuff
.de B2
.br
.nr BI 1n
.if \\n(.$>0 .nr BI \\$1n
.di
.nr BE 0
.nr BW \\n(dl
.nr BH \\n(dn
.ne \\n(BHu+\\n(.Vu
.nr BQ \\n(.j
.nf
.ti 0
.if \\n(BC>0 .in +(\\n(.lu-\\n(BWu)/2u
.in +\\n(BIu
.ls 1
.BB
.ls
.in -\\n(BIu
.nr BW +2*\\n(BI
.sp -1
\l'\\n(BWu\(ul'\L'-\\n(BHu'\l'|0\(ul'\h'|0'\L'\\n(BHu'
.if \\n(BC>0 .in -(\\n(.lu-\\n(BWu)/2u
.if \\n(BQ .fi
.br
..
. \" BX - boxed stuff
.de BX
\(br\|\\$1\|\(br\l'|0\(rn'\l'|0\(ul'
..
.
. \" macros for programs, etc.
.
.ig
programs are displayed between .P1/.P2 pairs
default is to indent by 1/2 inch, nofill, dP smaller
.P1 x causes an indent of x instead.
.P3 can be used to specify optional page-break points
inside .P1/.P2
..
.
. \" P1 - start of program
.de P1
.nr $1 \\n(P1
.if \\n(.$ .nr $1 \\$1n
.br
.X "SP \\n(DV P1"
.X "US P1"
.in \\n($1u
.nf
.nr v \\n(.v
.ps -\\n(dP
.vs -\\n(dVu
.ft CW
.nr t \\n(dT*\\w'x'u
.ta 1u*\\ntu 2u*\\ntu 3u*\\ntu 4u*\\ntu 5u*\\ntu 6u*\\ntu 7u*\\ntu 8u*\\ntu 9u*\\ntu 10u*\\ntu 11u*\\ntu 12u*\\ntu 13u*\\ntu 14u*\\ntu
..
. \" P2 - end of program
.de P2
.br
.ps \\n(PS
.vs \\nvu
.ft 1
.in
.X "END US P1
.X "SP \\n(DV P2"
.fi
..
. \" P3 - provides optional unpadded break in P1/P2
.de P3
.nr x \\n(DV
.nr DV 0
.P2
.P1 \\n($1u
.nr DV \\nx
..
.de [
[
..
.de ]
]
..
.IZ
.rm IZ
.so /Users/daniel/plan9/tmac/tmac.srefs
| 18.317477 | 134 | 0.479648 |
ed7c10343f72055b19cf2e8bc17844ba9973ff43 | 317 | t | Perl | lib/modernish/cap/ARITHPP.t | tabulon-ext/modernish | 6a0382d02cb53ad9b4b65a1ae97007e117378eb3 | [
"0BSD"
] | 677 | 2016-02-22T04:11:07.000Z | 2022-03-25T07:57:47.000Z | lib/modernish/cap/ARITHPP.t | tabulon-ext/modernish | 6a0382d02cb53ad9b4b65a1ae97007e117378eb3 | [
"0BSD"
] | 13 | 2016-11-05T05:43:50.000Z | 2022-02-17T16:58:35.000Z | lib/modernish/cap/ARITHPP.t | tabulon-ext/modernish | 6a0382d02cb53ad9b4b65a1ae97007e117378eb3 | [
"0BSD"
] | 19 | 2017-04-17T15:21:13.000Z | 2022-01-17T02:33:14.000Z | #! /shell/capability/test/for/moderni/sh
# See the file LICENSE in the main modernish directory for the licence.
# ARITHPP: shell arith supports the ++ and -- unary operators.
# (Subshell needed because shells that don't support it exit.)
( : $((i=0)) $((i++)) $((++i)) $((i--)) $((--i))
) 2>| /dev/null || return 1
| 39.625 | 71 | 0.637224 |
ed562291316054992d37001b170912010028a9e5 | 6,372 | al | Perl | Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/AccountSchedule.PageExt.al | manjulchauhan/ALAppExtensions | 3f2f1d6e5337188b1af9c0275420f1c1de036a7f | [
"MIT"
] | 127 | 2018-04-17T18:03:03.000Z | 2019-05-06T18:54:17.000Z | Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/AccountSchedule.PageExt.al | snu-development/ALAppExtensions | 371a27fe48483be776642dde19483a87ae27289c | [
"MIT"
] | 2,279 | 2018-09-12T12:01:49.000Z | 2019-05-06T13:59:35.000Z | Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/AccountSchedule.PageExt.al | snu-development/ALAppExtensions | 371a27fe48483be776642dde19483a87ae27289c | [
"MIT"
] | 41 | 2018-05-17T11:19:52.000Z | 2019-04-30T17:30:38.000Z | pageextension 11782 "Account Schedule CZL" extends "Account Schedule"
{
layout
{
addfirst(Control1)
{
field("Row Correction CZL"; Rec."Row Correction CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the row code for the correction.';
Visible = false;
trigger OnLookup(var Text: Text): Boolean
var
AccScheduleLine: Record "Acc. Schedule Line";
begin
AccScheduleLine.SetRange("Schedule Name", Rec."Schedule Name");
AccScheduleLine.SetFilter("Row No.", '<>%1', Rec."Row No.");
if Page.RunModal(Page::"Acc. Schedule Line List CZL", AccScheduleLine) = Action::LookupOK then
Rec."Row Correction CZL" := AccScheduleLine."Row No.";
end;
}
field("Source Table CZL"; Rec."Source Table CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the selected source table (VAT entry, Value entry, Customer or vendor entry).';
}
}
addafter(Show)
{
field("Calc CZL"; Rec."Calc CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies when the value can be calculated in the Account Schedule - Always, Never, When Positive, When Negative.';
}
}
addlast(Control1)
{
field("Assets/Liabilities Type CZL"; Rec."Assets/Liabilities Type CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the assets or liabilities type for the account schedule line.';
Visible = false;
}
}
modify(Totaling)
{
trigger OnLookup(var Text: Text): Boolean
var
AccScheduleExtensionCZL: Record "Acc. Schedule Extension CZL";
AccSchedManagement: Codeunit "AccSchedManagement";
GLAccountList: Page "G/L Account List";
AccScheduleExtensionsCZL: Page "Acc. Schedule Extensions CZL";
begin
if Rec."Totaling Type" in [Rec."Totaling Type"::"Posting Accounts", Rec."Totaling Type"::"Total Accounts"] then begin
GLAccountList.LookupMode(true);
if not (GLAccountList.RunModal() = Action::LookupOK) then
exit(false);
Text := GLAccountList.GetSelectionFilter();
exit(true);
end;
if Rec."Totaling Type" = Rec."Totaling Type"::"Custom CZL" then begin
if Rec.Totaling <> '' then begin
AccScheduleExtensionCZL.SetFilter(Code, Rec.Totaling);
AccScheduleExtensionCZL.FindFirst();
AccScheduleExtensionsCZL.SetRecord(AccScheduleExtensionCZL);
end;
AccScheduleExtensionsCZL.SetLedgType(Rec."Source Table CZL");
AccScheduleExtensionsCZL.LookupMode(true);
if not (AccScheduleExtensionsCZL.RunModal() = Action::LookupOK) then
exit(false);
AccScheduleExtensionsCZL.GetRecord(AccScheduleExtensionCZL);
Text := AccScheduleExtensionCZL.Code;
exit(true);
end;
Rec.LookupTotaling();
if Rec."Totaling Type" = Rec."Totaling Type"::"Account Category" then
Text := AccSchedManagement.GLAccCategoryText(Rec)
else
Text := Rec.Totaling;
exit(true);
end;
}
}
actions
{
#if CLEAN19
addafter("F&unctions")
{
group("Other CZL")
{
Caption = 'O&ther';
#else
#pragma warning disable AL0432
addlast("O&ther")
#pragma warning restore AL0432
{
#endif
action("Set up Custom Functions CZL")
{
ApplicationArea = Basic, Suite;
Caption = 'Set up Custom Functions';
Ellipsis = true;
Image = NewSum;
RunObject = Page "Acc. Schedule Extensions CZL";
ToolTip = 'Specifies acc. schedule extensions page';
}
action("File Mapping CZL")
{
ApplicationArea = Basic, Suite;
Caption = 'File Mapping';
Image = ExportToExcel;
ToolTip = 'File Mapping allows to set up export to Excel. You can see three dots next to the field with Amount.';
trigger OnAction()
var
AccScheuledFileMappingCZL: Page "Acc. Schedule File Mapping CZL";
begin
AccScheuledFileMappingCZL.SetAccSchedName(Rec."Schedule Name");
AccScheuledFileMappingCZL.RunModal();
end;
}
}
#if CLEAN19
}
#endif
addlast(processing)
{
group("Results Group CZL")
{
Caption = 'Results';
action("Save Results CZL")
{
ApplicationArea = Basic, Suite;
Caption = 'Save Results';
Ellipsis = true;
Image = Save;
ToolTip = 'Opens window for saving results of acc. schedule';
trigger OnAction()
var
AccSchedExtensionMgtCZL: Codeunit "Acc. Sched. Extension Mgt. CZL";
begin
AccSchedExtensionMgtCZL.CreateResults(Rec, '', false);
end;
}
action("Results CZL")
{
ApplicationArea = Basic, Suite;
Caption = 'Results';
Image = ViewDetails;
RunObject = Page "Acc. Sched. Res. Hdr. List CZL";
RunPageLink = "Acc. Schedule Name" = field("Schedule Name");
ToolTip = 'Opens acc. schedule res. header list';
}
}
}
}
}
| 37.928571 | 142 | 0.494036 |
ed4676190c8d9355a03a40fdce869a1fb83ba756 | 63 | t | Perl | fig/newkernelstack.t | pdav/xv6-book | 3cb96cffcfe76f10b4fd8fc0d932ebbe66573198 | [
"MIT"
] | 206 | 2016-09-16T18:09:29.000Z | 2022-03-26T20:15:51.000Z | fig/newkernelstack.t | pdav/xv6-book | 3cb96cffcfe76f10b4fd8fc0d932ebbe66573198 | [
"MIT"
] | 11 | 2017-02-05T15:28:38.000Z | 2020-04-09T16:19:37.000Z | fig/newkernelstack.t | pdav/xv6-book | 3cb96cffcfe76f10b4fd8fc0d932ebbe66573198 | [
"MIT"
] | 85 | 2016-10-18T08:52:26.000Z | 2022-03-25T12:43:36.000Z | .F1
.EPS fig/newkernelstack.eps 50
.F2
A new kernel stack.
.F3
| 10.5 | 30 | 0.730159 |
ed8ec72b06baab6ce200091e487813586f9c330b | 6,110 | pm | Perl | modules/EnsEMBL/Web/Document/HTML/ToolsTable.pm | amonida/ensembl-webcode | 284a8c633fdcf72575f18c11ac0657ee0919e270 | [
"Apache-2.0",
"MIT"
] | null | null | null | modules/EnsEMBL/Web/Document/HTML/ToolsTable.pm | amonida/ensembl-webcode | 284a8c633fdcf72575f18c11ac0657ee0919e270 | [
"Apache-2.0",
"MIT"
] | null | null | null | modules/EnsEMBL/Web/Document/HTML/ToolsTable.pm | amonida/ensembl-webcode | 284a8c633fdcf72575f18c11ac0657ee0919e270 | [
"Apache-2.0",
"MIT"
] | null | null | null | =head1 LICENSE
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.
=cut
package EnsEMBL::Web::Document::HTML::ToolsTable;
### Allows easy removal of items from template
use strict;
use EnsEMBL::Web::Document::Table;
use base qw(EnsEMBL::Web::Document::HTML);
sub render {
my $self = shift;
my $hub = EnsEMBL::Web::Hub->new;
my $sd = $hub->species_defs;
my $img_url = $sd->img_url;
my $table = EnsEMBL::Web::Document::Table->new([
{ key => 'name', title => 'Name', width => '20%', align => 'left' },
{ key => 'desc', title => 'Description', width => '50%', align => 'left' },
{ key => 'tool', title => 'Online tool', width => '10%', align => 'center' },
{ key => 'code', title => 'Download code', width => '10%', align => 'center' },
{ key => 'docs', title => 'Documentation', width => '10%', align => 'center' },
], [], { cellpadding => 4 }
);
## VEP
my $new_vep = $sd->ENSEMBL_VEP_ENABLED;
my $vep_link = $hub->url({'species' => $sd->ENSEMBL_PRIMARY_SPECIES, $new_vep ? qw(type Tools action VEP) : qw(type UserData action UploadVariations)});
$table->add_row({
'name' => sprintf('<a href="%s" class="%snodeco"><b>Variant Effect Predictor</b><br /><img src="%svep_logo_sm.png" alt="[logo]" /></a>', $vep_link, $new_vep ? '' : 'modal_link ', $img_url),
'desc' => 'Analyse your own variants and predict the functional consequences of known and unknown variants via our Variant Effect Predictor (VEP) tool.',
'tool' => sprintf('<a href="%s" class="%snodeco"><img src="%s16/tool.png" alt="Tool" title="Go to online tool" /></a>', $vep_link, $new_vep ? '' : 'modal_link ', $img_url),
'code' => sprintf('<a href="https://github.com/Ensembl/ensembl-tools/archive/release/%s.zip" rel="external" class="nodeco"><img src="%s16/download.png" alt="Download" title="Download Perl script" /></a>', $sd->ENSEMBL_VERSION, $img_url),
'docs' => sprintf('<a href="/info/docs/tools/vep/index.html"><img src="%s16/info.png" alt="Documentation" /></a>', $img_url)
});
## BLAST
if ($sd->ENSEMBL_BLAST_ENABLED) {
$table->add_row({
'name' => '<b><a class="nodeco" href="/Multi/blastview">BLAST/BLAT</a></b>',
'desc' => 'Search our genomes for your DNA or protein sequence.',
'tool' => sprintf('<a href="/Multi/blastview" class="nodeco"><img src="%s16/tool.png" alt="Tool" title="Go to online tool" /></a>', $img_url),
'code' => '',
'docs' => sprintf('<a href="%s" class="popup"><img src="%s16/info.png" alt="Documentation" /></a>', $hub->url({'species' => '', 'type' => 'Help', 'action' => 'View', 'id' => { $sd->multiX('ENSEMBL_HELP') }->{'Multi/blastview'}}), $img_url)
});
}
## BIOMART
if ($sd->ENSEMBL_MART_ENABLED) {
$table->add_row({
'name' => '<b><a href="/biomart/martview">BioMart</a></b>',
'desc' => 'Use this data-mining tool to export custom datasets from Ensembl.',
'tool' => sprintf('<a href="/biomart/martview" class="nodeco"><img src="%s16/tool.png" alt="Tool" title="Go to online tool" /></a>', $img_url),
'code' => sprintf('<a href="http://biomart.org" rel="external" class="nodeco"><img src="%s16/download.png" alt="Download" title="Download code from biomart.org" /></a>', $img_url),
'docs' => sprintf('<a href="http://www.biomart.org/biomart/mview/help.html" class="popup"><img src="%s16/info.png" alt="Documentation" /></a>', $img_url)
});
}
## ASSEMBLY CONVERTER
$table->add_row({
'name' => '<b>Assembly converter</b>',
'desc' => "Map (liftover) your data's coordinates to the current assembly.",
'tool' => sprintf('<a href="%s" class="modal_link nodeco"><img src="%s16/tool.png" alt="Tool" title="Go to online tool" /></a>', $hub->url({'species' => $sd->ENSEMBL_PRIMARY_SPECIES, 'type' => 'UserData', 'action' => 'SelectFeatures'}), $img_url),
'code' => sprintf('<a href="https://github.com/Ensembl/ensembl-tools/tree/release/%s/scripts/assembly_converter" rel="external" class="nodeco"><img src="%s16/download.png" alt="Download" title="Download Perl script" /></a>', $sd->ENSEMBL_VERSION, $img_url),
'docs' => '',
});
## ID HISTORY CONVERTER
$table->add_row({
'name' => '<b>ID History converter</b>',
'desc' => 'Convert a set of Ensembl IDs from a previous release into their current equivalents.',
'tool' => sprintf('<a href="%s" class="modal_link nodeco"><img src="%s16/tool.png" alt="Tool" title="Go to online tool" /></a>', $hub->url({'species' => $sd->ENSEMBL_PRIMARY_SPECIES, 'type' => 'UserData', 'action' => 'UploadStableIDs'}), $img_url),
'code' => sprintf('<a href="https://github.com/Ensembl/ensembl-tools/tree/release/%s/scripts/id_history_converter" rel="external" class="nodeco"><img src="%s16/download.png" alt="Download" title="Download Perl script" /></a>', $sd->ENSEMBL_VERSION, $img_url),
'docs' => '',
});
## VIRTUAL MACHINE
$table->add_row({
'name' => '<b>Ensembl Virtual Machine</b>',
'desc' => 'VirtualBox virtual Machine with Ubuntu desktop and pre-configured with the latest Ensembl API plus Variant Effect Predictor (VEP). <b>NB: download is >1 GB</b>',
'tool' => '-',
'code' => sprintf('<a href="ftp://ftp.ensembl.org/pub/current_virtual_machine" rel="external" class="nodeco"><img src="%s16/download.png" alt="Download" title="Download Virtual Machine" /></a>', $img_url),
'docs' => sprintf('<a href="/info/data/virtual_machine.html"><img src="%s16/info.png" alt="Documentation" /></a>', $img_url)
});
return $table->render;
}
1;
| 56.574074 | 263 | 0.639771 |
ed8bda43721f51da687624ff336c1a02e922fcf3 | 8,065 | t | Perl | bundle/ngx_stream_lua-0.0.3/t/023-preread/tcp-socket.t | zyqCSL/openresty-1.13.6.1-instrumented | 21be1c9e8e57a894a38865e34bccb2d3a97a6c18 | [
"BSD-2-Clause"
] | null | null | null | bundle/ngx_stream_lua-0.0.3/t/023-preread/tcp-socket.t | zyqCSL/openresty-1.13.6.1-instrumented | 21be1c9e8e57a894a38865e34bccb2d3a97a6c18 | [
"BSD-2-Clause"
] | null | null | null | bundle/ngx_stream_lua-0.0.3/t/023-preread/tcp-socket.t | zyqCSL/openresty-1.13.6.1-instrumented | 21be1c9e8e57a894a38865e34bccb2d3a97a6c18 | [
"BSD-2-Clause"
] | null | null | null | # vim:set ft= ts=4 sw=4 et fdm=marker:
use Test::Nginx::Socket::Lua::Stream;
repeat_each(2);
plan tests => repeat_each() * 24;
our $HtmlDir = html_dir;
$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211;
$ENV{TEST_NGINX_RESOLVER} ||= '8.8.8.8';
#log_level 'warn';
no_long_string();
#no_diff();
run_tests();
__DATA__
=== TEST 1: sanity
--- stream_config
server {
listen 127.0.0.1:9988;
return testing\npreread\n;
}
--- stream_server_config
preread_by_lua_block {
local sock = ngx.socket.tcp()
local port = 9988
local ok, err = sock:connect("127.0.0.1", port)
if not ok then
ngx.say("failed to connect: ", err)
return
end
ngx.say("connected: ", ok)
local req = "GET /foo HTTP/1.0\r\nHost: localhost\r\nConnection: close\r\n\r\n"
-- req = "OK"
local bytes, err = sock:send(req)
if not bytes then
ngx.say("failed to send request: ", err)
return
end
ngx.say("request sent: ", bytes)
while true do
local line, err, part = sock:receive()
if line then
ngx.say("received: ", line)
else
ngx.say("failed to receive a line: ", err, " [", part, "]")
break
end
end
ok, err = sock:close()
ngx.say("close: ", ok, " ", err)
}
content_by_lua return;
--- stream_response
connected: 1
request sent: 57
received: testing
received: preread
failed to receive a line: connection reset by peer []
close: 1 nil
--- error_log
recv() failed (104: Connection reset by peer
=== TEST 3: no resolver defined
--- stream_server_config
preread_by_lua_block {
local sock = ngx.socket.tcp()
local port = ngx.var.port
local ok, err = sock:connect("agentzh.org", 1234)
if not ok then
ngx.say("failed to connect: ", err)
end
ngx.say("connected: ", ok)
local req = "GET /foo HTTP/1.0\\r\\nHost: localhost\\r\\nConnection: close\\r\\n\\r\\n"
-- req = "OK"
local bytes, err = sock:send(req)
if not bytes then
ngx.say("failed to send request: ", err)
return
end
ngx.say("request sent: ", bytes)
}
content_by_lua return;
--- stream_response
failed to connect: no resolver defined to resolve "agentzh.org"
connected: nil
failed to send request: closed
--- error_log
attempt to send data on a closed socket:
=== TEST 4: with resolver
--- timeout: 10
--- stream_server_config
resolver $TEST_NGINX_RESOLVER ipv6=off;
resolver_timeout 3s;
preread_by_lua_block {
local sock = ngx.socket.tcp()
local port = 80
local ok, err = sock:connect("agentzh.org", port)
if not ok then
ngx.say("failed to connect: ", err)
return
end
ngx.say("connected: ", ok)
local req = "GET / HTTP/1.0\r\nHost: agentzh.org\r\nConnection: close\r\n\r\n"
-- req = "OK"
local bytes, err = sock:send(req)
if not bytes then
ngx.say("failed to send request: ", err)
return
end
ngx.say("request sent: ", bytes)
local line, err = sock:receive()
if line then
ngx.say("first line received: ", line)
else
ngx.say("failed to receive the first line: ", err)
end
line, err = sock:receive()
if line then
ngx.say("second line received: ", line)
else
ngx.say("failed to receive the second line: ", err)
end
}
content_by_lua return;
--- stream_response
connected: 1
request sent: 56
first line received: HTTP/1.1 200 OK
second line received: Server: openresty
--- no_error_log
[error]
=== TEST 5: connection refused (tcp)
--- stream_server_config
preread_by_lua_block {
local sock = ngx.socket.tcp()
local ok, err = sock:connect("127.0.0.1", 16787)
ngx.say("connect: ", ok, " ", err)
local bytes
bytes, err = sock:send("hello")
ngx.say("send: ", bytes, " ", err)
local line
line, err = sock:receive()
ngx.say("receive: ", line, " ", err)
ok, err = sock:close()
ngx.say("close: ", ok, " ", err)
}
content_by_lua return;
--- stream_response
connect: nil connection refused
send: nil closed
receive: nil closed
close: nil closed
--- error_log eval
qr/connect\(\) failed \(\d+: Connection refused\)/
=== TEST 6: connection timeout (tcp)
--- stream_server_config
resolver $TEST_NGINX_RESOLVER ipv6=off;
lua_socket_connect_timeout 100ms;
lua_socket_send_timeout 100ms;
lua_socket_read_timeout 100ms;
resolver_timeout 3s;
preread_by_lua_block {
local sock = ngx.socket.tcp()
local ok, err = sock:connect("agentzh.org", 12345)
ngx.say("connect: ", ok, " ", err)
local bytes
bytes, err = sock:send("hello")
ngx.say("send: ", bytes, " ", err)
local line
line, err = sock:receive()
ngx.say("receive: ", line, " ", err)
ok, err = sock:close()
ngx.say("close: ", ok, " ", err)
}
content_by_lua return;
--- stream_response
connect: nil timeout
send: nil closed
receive: nil closed
close: nil closed
--- error_log
lua tcp socket connect timed out
--- timeout: 10
=== TEST 7: not closed manually
--- stream_server_config
preread_by_lua_block {
local sock = ngx.socket.tcp()
local port = $TEST_NGINX_SERVER_PORT
local ok, err = sock:connect("127.0.0.1", port)
if not ok then
ngx.say("failed to connect: ", err)
return
end
ngx.say("connected: ", ok)
}
content_by_lua return;
--- stream_response
connected: 1
--- no_error_log
[error]
=== TEST 8: resolver error (host not found)
--- stream_server_config
resolver $TEST_NGINX_RESOLVER ipv6=off;
resolver_timeout 3s;
preread_by_lua_block {
local sock = ngx.socket.tcp()
local port = 80
local ok, err = sock:connect("blah-blah-not-found.agentzh.org", 1234)
print("connected: ", ok, " ", err, " ", not ok)
if not ok then
ngx.say("failed to connect: ", err)
end
ngx.say("connected: ", ok)
local req = "GET / HTTP/1.0\\r\\nHost: agentzh.org\\r\\nConnection: close\\r\\n\\r\\n"
-- req = "OK"
local bytes, err = sock:send(req)
if not bytes then
ngx.say("failed to send request: ", err)
return
end
ngx.say("request sent: ", bytes)
}
content_by_lua return;
--- stream_response_like
^failed to connect: blah-blah-not-found\.agentzh\.org could not be resolved(?: \(3: Host not found\))?
connected: nil
failed to send request: closed$
--- error_log
attempt to send data on a closed socket
--- timeout: 10
=== TEST 9: resolver error (timeout)
--- stream_server_config
resolver $TEST_NGINX_RESOLVER ipv6=off;
resolver_timeout 1ms;
preread_by_lua_block {
local sock = ngx.socket.tcp()
local port = 80
local ok, err = sock:connect("blah-blah-not-found.agentzh.org", port)
print("connected: ", ok, " ", err, " ", not ok)
if not ok then
ngx.say("failed to connect: ", err)
end
ngx.say("connected: ", ok)
local req = "GET / HTTP/1.0\\r\\nHost: agentzh.org\\r\\nConnection: close\\r\\n\\r\\n"
-- req = "OK"
local bytes, err = sock:send(req)
if not bytes then
ngx.say("failed to send request: ", err)
return
end
ngx.say("request sent: ", bytes)
}
content_by_lua return;
--- stream_response_like
^failed to connect: blah-blah-not-found\.agentzh\.org could not be resolved(?: \(\d+: (?:Operation timed out|Host not found)\))?
connected: nil
failed to send request: closed$
--- error_log
attempt to send data on a closed socket
| 24.292169 | 128 | 0.582021 |
ed559cff8b7a24cc2ffeb8199d9f0e5065ef85eb | 1,131 | pm | Perl | templates/Perl/Catalyst/Ufimisms/Member Site/Utils/Utils.pm | jmcveigh/p5-komodo-tools | e9ecfc9e3db2291530963257287ee44d3ce38435 | [
"BSD-2-Clause"
] | 1 | 2016-05-10T13:13:43.000Z | 2016-05-10T13:13:43.000Z | templates/Perl/Catalyst/Ufimisms/Member Site/Utils/Utils.pm | jmcveigh/p5-komodo-tools | e9ecfc9e3db2291530963257287ee44d3ce38435 | [
"BSD-2-Clause"
] | null | null | null | templates/Perl/Catalyst/Ufimisms/Member Site/Utils/Utils.pm | jmcveigh/p5-komodo-tools | e9ecfc9e3db2291530963257287ee44d3ce38435 | [
"BSD-2-Clause"
] | null | null | null | package MemberSite::Model::Utils;
use base 'Catalyst::Model::Adaptor';
__PACKAGE__->config({ class => 'MemberSite::Model::Utils' });
sub add_flag {
my $self = shift;
my $flagstr = shift;
my $flag_to_add = shift;
return(_add_letter($flag_to_add, $flagstr));
}
sub add_achievment {
my $self = shift;
my $achievmentstr = shift;
my $achievment_to_add = shift;
return(_add_letter($achievment_to_add, $achievmentstr));
}
sub del_flag {
my $self = shift;
my $flagstr = shift;
my $flag_to_del = shift;
return(_del_letter($flag_to_del, $flagstr));
}
sub del_achievment {
my $self = shift;
my $achievmentstr = shift;
my $achievment_to_del = shift;
return(_del_letter($achievment_to_del, $achievmentstr));
}
sub _add_letter {
my $self = shift;
my $atom_to_add = shift;
my $atomstr = shift;
@atoms = sort split(//, $atomstr . $atom_to_add);
return "@atoms";
}
sub _del_letter {
my $self = shift;
my $atom_to_del = shift;
my $str = shift;
my $ret = $str;
$ret =~ s/$atom_to_del//;
return $ret;
}
1; | 19.842105 | 61 | 0.617153 |
ed037725c269bac5aa12f8ede77a006d43c1c88b | 7,112 | pm | Perl | posda/posdatools/Posda/include/Posda/Rtog.pm | UAMS-DBMI/PosdaTools | 7d33605da1b88e4787a1368dbecaffda1df95e5b | [
"Apache-2.0"
] | 6 | 2019-01-17T15:47:44.000Z | 2022-02-02T16:47:25.000Z | posda/posdatools/Posda/include/Posda/Rtog.pm | UAMS-DBMI/PosdaTools | 7d33605da1b88e4787a1368dbecaffda1df95e5b | [
"Apache-2.0"
] | 23 | 2016-06-08T21:51:36.000Z | 2022-03-02T08:11:44.000Z | posda/posdatools/Posda/include/Posda/Rtog.pm | UAMS-DBMI/PosdaTools | 7d33605da1b88e4787a1368dbecaffda1df95e5b | [
"Apache-2.0"
] | null | null | null | #
#Copyright 2008, Bill Bennett
# Part of the Posda package
# Posda may be copied only under the terms of either the Artistic License or the
# GNU General Public License, which may be found in the Posda Distribution,
# or at http://posda.com/License.html
#
use strict;
package Posda::Rtog;
{
package Posda::Rtog::FilesetDesc;
sub NewFromFileSet{
my($class, $base_file, $image_dir, $tar_file_id) = @_;
unless(-d $image_dir) { die "$image_dir is not a directory" };
open DIRFILE, "<", "$image_dir/${base_file}0000" or
die "Can't find RTOG directory (${base_file}0000) file " .
"in dir $image_dir";
my $this = {
base_file => $base_file,
storage_root => $image_dir,
tar_file_id => $tar_file_id,
};
my $currecord;
while(my $line = <DIRFILE>){
$line =~ s/\r//g;
$line =~ s/\0//g;
chomp $line;
# print "line: $line\n";
if($line =~ /^\s*$/) {next}
unless($line =~ /^\s*(.*)\s*:=\s*(.*)\s*$/){
print "non matching: '$line'\n";
return undef;
# next;
}
my $key = $1;
my $value = $2;
$key =~ s/\s//g;
$key =~ s/#/number/g;
$key =~ tr/a-z/A-Z/;
# print "$key = $value\n";
if($key eq "IMAGENUMBER"){
if(defined $currecord){
push(@{$this->{records}}, $currecord);
}
$currecord = {
IMAGENUMBER => $value,
};
} else {
if(defined $currecord){
$currecord->{$key} = $value;
} else {
$this->{$key} = $value;
}
}
}
push(@{$this->{records}}, $currecord);
return bless $this, $class;
}
sub InstantiateFileSet{
my($this, $db) = @_;
my $q = $db->prepare(
"insert into rtog_fileset(rtog_tar_file_id, rtog_base_file) values (?, ?)"
);
$q->execute($this->{tar_file_id}, $this->{base_file});
$q = $db->prepare(
"select currval('rtog_fileset_rtog_fileset_id_seq') as id");
$q->execute();
my $h = $q->fetchrow_hashref();
$q->finish();
unless($h && ref($h) eq "HASH") { die "can't get fileset_id" }
my $id = $h->{id};
$this->{fileset_id} = $id;
{
my $from_file = "$this->{base_file}0000";
unless(-f $from_file) {
die "directory file disappeared";
}
my $to_dir = "$this->{storage_root}/$id";
unless(-d $to_dir) { `mkdir $to_dir` }
unless(-d $to_dir) { die "mkdir apparently failed" }
my $to_file = "$to_dir/0000.dir";
`cp \"$from_file\" \"$to_file\"`;
my $q = $db->prepare(
"insert into rtog_dir_file(rtog_fileset_id, rd_path)\n" .
"values (?, ?)"
);
$q->execute($id, $to_file);
}
for my $i (keys %$this){
if(ref($this->{$i}) eq "ARRAY"){
unless($i eq "records") { die "key \"$i\" is ARRAY" }
next;
}
$q = $db->prepare(
"insert into rtog_fileset_attr(\n" .
" rtog_fileset_id, fs_key, fs_value\n" .
") values (?, ?, ?)");
$q->execute($id, $i, $this->{$i});
}
my $rec_num = 0;
image:
for my $r (@{$this->{records}}){
$rec_num += 1;
unless($r->{IMAGENUMBER} eq $rec_num){
print STDERR
"nonmatching image_number: $rec_num vs $r->{IMAGENUMBER}\n";
$rec_num = $r->{IMAGENUMBER};
}
$q = $db->prepare(
"insert into rtog_image(\n" .
" rtog_fileset_id, image_number\n" .
")values(?, ?)"
);
$q->execute($id, $rec_num);
for my $i (keys %$r){
$q = $db->prepare(
"insert into rtog_image_attr(\n" .
" rtog_fileset_id, image_number, im_key, im_value\n" .
") values (?, ?, ?, ?)"
);
$q->execute($id, $rec_num, $i, $r->{$i});
}
my $from_file = sprintf("$this->{base_file}%04d", $rec_num);
unless(-f $from_file) {
print STDERR "non_existent image_file: $from_file\n";
next image;
}
my $to_dir = "$this->{storage_root}/$id";
unless(-d $to_dir) { `mkdir $to_dir` }
unless(-d $to_dir) { die "mkdir apparently failed" }
my $to_file = "$to_dir/$rec_num.img";
`cp \"$from_file\" \"$to_file\"`;
$q = $db->prepare(
"insert into rtog_image_file(\n " .
" rtog_fileset_id, image_number, im_path\n" .
") values (?, ?, ?)"
);
$q->execute($id, $rec_num, $to_file);
}
}
}
{
package Posda::Rtog;
sub NewFromDir{
my($class, $dir) = @_;
my $base_file;
opendir DIR, "$dir" or die "can't opendir $dir";
my $rf;
my $this = {};
while(my $file = readdir(DIR)){
if($file =~ /^(.*)(\d\d\d\d)$/){
my $b_file = $1;
my $index = $2;
unless(defined $base_file){ $base_file = $b_file }
if ($base_file ne $b_file) {
die "Two potential basefiles:\n" .
"\t\"${base_file}0000\" and\n" .
"\t\"$file\"";
}
if($index == 0){
$rf =
Posda::Rtog::FilesetDesc->NewFromFileSet("$base_file", $dir, 0);
} else {
my $i = $index + 0;
$this->{image_file}->{$i} = "$dir/$file";
}
}
}
unless($rf) { die "didn't find or parse basefile" }
for my $i (keys %$rf){
unless($i eq "records"){
$this->{fileset_attr}->{$i} = $rf->{$i};
}
}
for my $r (@{$rf->{records}}){
my $fi = $r->{IMAGENUMBER};
$this->{image_attr}->{$fi} = $r;
}
$this->{dir_path} = "";
return bless $this, $class;
}
sub NewFromId{
my($class, $db, $id) = @_;
my $q = $db->prepare(
"select rd_path as dir_path from rtog_dir_file where rtog_fileset_id = ?"
);
$q->execute($id);
my $h = $q->fetchrow_hashref();
$q->finish();
unless($h && ref($h) eq "HASH") { die "couldn't get a dir file for id: $id" }
my $dir_path = $q->{dir_path};
$q = $db->prepare(
"select fs_key as key, fs_value as value from rtog_fileset_attr\n" .
"where rtog_fileset_id = ?"
);
my %fileset_attr;
$q->execute($id);
while (my $h = $q->fetchrow_hashref()){
$fileset_attr{$h->{key}} = $h->{value};
}
my %image_attr;
$q = $db->prepare(
"select image_number, im_key as key, im_value as value\n" .
"from rtog_image_attr\n" .
"where rtog_fileset_id = ?"
);
$q->execute($id);
while (my $h = $q->fetchrow_hashref()){
$image_attr{$h->{image_number}}->{$h->{key}} = $h->{value};
}
my %image_files;
$q = $db->prepare(
"select image_number, im_path as file_path\n" .
"from rtog_image_file\n" .
"where rtog_fileset_id = ?"
);
$q->execute($id);
while(my $h = $q->fetchrow_hashref()){
$image_files{$h->{image_number}} = $h->{file_path};
}
my $this = {
dir_path => $dir_path,
fileset_attr => \%fileset_attr,
image_attr => \%image_attr,
image_file => \%image_files,
};
for my $i (sort { $a <=> $b } keys %image_attr){
unless(exists ($image_files{$i})){ die "image %i has no file" }
}
return bless $this, $class;
}
}
1;
| 30.26383 | 81 | 0.512092 |
ed948073c2f51b590d5bf5235b10c3ce15653360 | 3,643 | pl | Perl | included_software/KronaTools-2.5/scripts/ImportPhymmBL.pl | MetAnnotate/MetAnnotate | d8a68b3a135d7186f1f98fda43fcb8fac929c8a3 | [
"Apache-2.0"
] | 2 | 2021-03-26T11:31:12.000Z | 2021-05-21T01:57:07.000Z | included_software/KronaTools-2.5/scripts/ImportPhymmBL.pl | Metannotate/Metannotate | d8a68b3a135d7186f1f98fda43fcb8fac929c8a3 | [
"Apache-2.0"
] | 34 | 2017-08-14T17:48:43.000Z | 2018-04-07T02:38:38.000Z | included_software/KronaTools-2.5/scripts/ImportPhymmBL.pl | MetAnnotate/MetAnnotate | d8a68b3a135d7186f1f98fda43fcb8fac929c8a3 | [
"Apache-2.0"
] | 2 | 2017-08-14T19:10:08.000Z | 2017-08-14T19:23:05.000Z | #! /usr/bin/perl
# Copyright © 2011, Battelle National Biodefense Institute (BNBI);
# all rights reserved. Authored by: Brian Ondov, Nicholas Bergman, and
# Adam Phillippy
#
# See the LICENSE.txt file included with this software for license information.
use strict;
use lib (`ktGetLibPath`);
use KronaTools;
setOption('name', 'all');
setOption('key', 0);
my @options =
qw(
out
name
minConfidence
combine
depth
hueBad
hueGood
phymm
local
standalone
url
postUrl
);
getKronaOptions(@options);
if ( @ARGV < 1 )
{
setOption('out', 'phymm(bl).krona.html');
printUsage
(
'Creates a Krona chart of Phymm or PhymmBL results.
Note: Since confidence scores are not given for species/subspecies
classifications, they inheret confidence scores from genus classifications.',
'phymmbl_results',
'PhymmBL results files (results.03.*). Results can also be from Phymm
alone (results.01.*), but ' . getOptionString('phymm') . ' must be specified.',
1,
1,
\@options
);
exit 0;
}
if ( ! defined getOption('out') )
{
if ( getOption('phymm') )
{
setOption('out', 'phymm.krona.html');
}
else
{
setOption('out', 'phymmbl.krona.html');
}
}
my @ranks =
(
'Phylum',
'Class',
'Order',
'Family',
'Genus',
'Species/Subspecies'
);
my $tree = newTree();
my $set = 0;
my @datasetNames;
my $useMag;
foreach my $input ( @ARGV )
{
my ($fileName, $magFile, $name) = parseDataset($input);
if ( ! getOption('combine') )
{
push @datasetNames, $name;
}
my %magnitudes;
print "Importing $fileName...\n";
if ( defined $magFile )
{
print " Loading magnitudes from $magFile...\n";
loadMagnitudes($magFile, \%magnitudes);
$useMag = 1;
}
print " Reading classifications from $fileName...\n";
open INFILE, "<$fileName" or die $!;
<INFILE>; # eat header
while ( my $line = <INFILE> )
{
chomp $line;
my @values = split /\t/, $line;
my @lineage;
my $scores;
my $readID = shift @values;
if ( getOption('phymm') )
{
my ($species, $score);
($species, $score, @lineage) = @values;
$scores = $score;
@lineage = reverse @lineage;
push @lineage, $species;
}
else
{
if ( @values < 12 )
{
my $phymm = getOptionString('phymm');
ktDie("Not enough fields in $fileName. Is it a PhymmBL result file (see $phymm)?");
}
$scores = ();
$values[1] = $values[3]; # use genus conf for species
for ( my $i = 0; $i < @values; $i += 2 )
{
unshift @lineage, $values[$i];
unshift @$scores, $values[$i + 1];
}
}
for ( my $i = 0; $i < @lineage; $i++ )
{
$lineage[$i] = decode($lineage[$i]);
}
map { if ( $_ eq '' ) { $_ = 'unknown' } } @lineage;
addByLineage($tree, $set, \@lineage, $readID, $magnitudes{$readID}, $scores, \@ranks);
}
close INFILE;
if ( ! getOption('combine') )
{
$set++;
}
}
# tree output
my @attributeNames =
(
'magnitude',
'count',
'unassigned',
'rank',
'score'
);
my @attributeDisplayNames =
(
$useMag ? 'Magnitude' : undef,
'Count',
'Unassigned',
'Rank',
getOption('phymm') ? 'Avg. score' : 'Avg. confidence'
);
writeTree
(
$tree,
\@attributeNames,
\@attributeDisplayNames,
\@datasetNames,
getOption('hueBad'),
getOption('hueGood')
);
# subroutines
sub decode
{
# return special characters in place of their Phymm placeholders
my ($string) = @_;
$string =~ s/_/ /g;
$string =~ s/UNDERSCORE/_/g;
$string =~ s/SLASH/\//g;
$string =~ s/LPAREN/\(/g;
$string =~ s/RPAREN/\)/g;
$string =~ s/SINGLEQUOTE/'/g;
$string =~ s/DOUBLEQUOTE/"/g;
$string =~ s/COLONCOLON/:/g;
$string =~ s/SEMICOLON/;/g;
return $string;
}
| 16.484163 | 88 | 0.608839 |
73fe81af9f794e2db5a238255790a8bdfdbbf145 | 508,284 | t | Perl | doc/uguide.t | muparkkra/mup | ac46d4b25de20203b48b849fd311fe9c9505ce6e | [
"Mup"
] | 5 | 2020-12-01T20:35:21.000Z | 2022-02-15T02:16:20.000Z | doc/uguide.t | muparkkra/mup | ac46d4b25de20203b48b849fd311fe9c9505ce6e | [
"Mup"
] | 1,129 | 2019-02-25T00:55:24.000Z | 2022-03-06T02:18:11.000Z | doc/uguide.t | muparkkra/mup | ac46d4b25de20203b48b849fd311fe9c9505ce6e | [
"Mup"
] | 4 | 2019-09-29T13:39:12.000Z | 2022-03-22T22:13:30.000Z | .\" .if \n(.g .warn \n[.warn]-512
.\" turning off warnings doesn't seem to work on all versions
.\" of groff, so explicitly initialize null strings to pacify it.
.sp -3
.\" This also avoids ignoring valid warnings
.ds aA
.ds aB
.ds aC
.ds aD
.ds aE
.ds aF
.ds aG
.ds aH
.ds aI
.ds aJ
.ds aK
.ds aL
.ds aM
.ds aN
.ds aO
.ds aP
.ds aQ
.ds aR
.ds aS
.ds aT
.ds aU
.ds aV
.ds aW
.ds aX
.ds aY
.ds aZ
.ds bA
.ds bB
.ds bC
.ds bD
.ds bE
.ds bF
.ds bG
.ds bH
.ds bI
.ds bJ
.ds bK
.ds bL
.ds bM
.ds bN
.ds bO
.ds bP
.ds bQ
.ds bR
.ds bS
.ds bT
.ds bU
.ds bV
.ds bW
.ds bX
.ds bY
.ds bZ
.ds cA
.ds cB
.ds cC
.ds cD
.ds cE
.ds cF
.ds cG
.ds cH
.ds cI
.ds cJ
.ds cK
.ds cL
.ds cM
.ds cN
.ds cO
.ds cP
.ds cQ
.ds cR
.ds cS
.ds cT
.ds cU
.ds cV
.ds cW
.ds cX
.ds cY
.ds cZ
.ds dA
.ds dB
.ds dC
.ds dD
.ds dE
.ds dF
.ds dG
.ds dH
.ds dI
.ds dJ
.ds dK
.ds dL
.ds dM
.ds dN
.ds dO
.ds dP
.ds dQ
.ds dR
.ds dS
.ds dT
.ds dU
.ds dV
.ds dW
.ds dX
.ds dY
.ds dZ
.ds eA
.ds eB
.ds eC
.ds eD
.ds eE
.ds eF
.ds eG
.ds eH
.ds eI
.ds eJ
.ds eK
.ds eL
.ds eM
.ds eN
.ds eO
.ds eP
.ds eQ
.ds eR
.ds eS
.ds eT
.ds eU
.ds eV
.ds eW
.ds eX
.ds eY
.ds eZ
.ds fA
.ds fB
.ds fC
.ds fD
.ds fE
.ds fF
.ds fG
.ds fH
.ds fI
.ds fJ
.ds fK
.ds fL
.ds fM
.ds fN
.ds fO
.ds fP
.ds fQ
.ds fR
.ds fS
.ds fT
.ds fU
.ds fV
.ds fW
.ds fX
.ds fY
.ds fZ
.ds gA
.ds gB
.ds gC
.ds gD
.ds gE
.ds gF
.ds gG
.ds gH
.ds gI
.ds gJ
.ds gK
.ds gL
.ds gM
.ds gN
.ds gO
.ds gP
.ds gQ
.ds gR
.ds gS
.ds gT
.ds gU
.ds gV
.ds gW
.ds gX
.ds gY
.ds gZ
.ds hA
.ds hB
.ds hC
.ds hD
.ds hE
.ds hF
.ds hG
.ds hH
.ds hI
.ds hJ
.ds hK
.ds hL
.ds hM
.ds hN
.ds hO
.ds hP
.ds hQ
.ds hR
.ds hS
.ds hT
.ds hU
.ds hV
.ds hW
.ds hX
.ds hY
.ds hZ
.ds iA
.ds iB
.ds iC
.ds iD
.ds iE
.ds iF
.ds iG
.ds iH
.ds iI
.ds iJ
.ds iK
.ds iL
.ds iM
.ds iN
.ds iO
.ds iP
.ds iQ
.ds iR
.ds iS
.ds iT
.ds iU
.ds iV
.ds iW
.ds iX
.ds iY
.ds iZ
.ds jA
.ds jB
.ds jC
.ds jD
.ds jE
.ds jF
.ds jG
.ds jH
.ds jI
.ds jJ
.ds jK
.ds jL
.ds jM
.ds jN
.ds jO
.ds jP
.ds jQ
.ds jR
.ds jS
.ds jT
.ds jU
.ds jV
.ds jW
.ds jX
.ds jY
.ds jZ
.\" These next few macros are used by HTML post-processor; no-ops for troff
.de Hi
..
.de He
..
.de Hd
..
.de Ht
..
.de Hr
..
.de Hm
..
.de Hh
..
.de pI
..
.Hd /dev/null
.rm )k
.de Ex
.br
.ev 1
.nr Fn \\n(.f
.ft CW
.if n .sp1
.DS
.in +0.5i
..
.de HY
.if \\n(.g \X'ps: exec 0 0.1 0.5 setrgbcolor'
..
.de HZ
.if \\n(.g \X'ps: exec 0 0 0 setrgbcolor'
..
.nr Nn 1
.de Pt
.if \\n(.g \{
.sp -3.7
.psbb \\$1
.nr pict-width \\n[urx]-\\n[llx]
.nr pict-offset \\n[.l]-\\n[.i]-\\n[pict-width]p/2
.nr pict-height \\n[ury]-\\n[lly]
.nr ps-pict-width \\n[pict-width]p
.if \\n[Nn] .ne \\n[pict-height]p
\h'\\n[pict-offset]u'
.if \\n[Boxpict] \X'ps: exec gsave 0 0.25 0.75 setrgbcolor 0 \\n[pict-height] rlineto \\n[pict-width] 0 rlineto 0 \\n[pict-height] neg rlineto closepath stroke grestore'
\v'\\n[pict-height]p'\h'-6p'
\X'ps: import \\$1 \\n[llx] \\n[lly] \\n[urx] \\n[ury] \\n[ps-pict-width]'
.br
.sp \\n[pict-height]p \}
..
.de Ee
.in -0.5i
.DE
.ft \\n(Fn
.if n .sp1
.br
.ev
.if t \{
.if \\n(.$=5 \{
.ie \\n(.g .Pt \\$1
.el \{
.rs
.ne \\$4p
.br
.nr oF (\\n(.l-\\$5p)/2.0
.ie \\n(oF<0 \{
.nr oF 0
.nr Po 200u \}
.el .nr Po \\n(.o
.if \\n(.P \\!x X PI:\\n(Po:\\n(.i:\\n(.l:\\n(.t:\\$1:\\$2,\\$3,0.2,\\n(oFu:to:
\ \ \
.br
.rs
.sp \\$4p-\n(.sp
\ \ \
.br \}
\}
.sp -\n(.sp \}
..
.de Ix
.if !'\\*(\\$1'' .as \\$1 ",
.as \\$1 \\n%
..
\ \ \
.sp 3
.ev 1
\X'ps: exec 0 0.15 0.65 setrgbcolor'
.ft BI
.ps 24
.vs 32
.ce 3
M u p
M\|u\|s\|i\|c P\|u\|b\|l\|i\|s\|h\|e\|r
U\|s\|e\|r\|'\|s G\|u\|i\|d\|e
.sp 1i
.ft P
\X'ps: exec 0 0 0 setrgbcolor'
.nr Boxpict 0
\ \ \
.br
.Ex 1
.\"score leftmargin=3; rightmargin=3
.\"music
.\"1: 4e; 4d; 2c;
.\"bar
.Ee
.sp 2i
\X'ps: exec 0 0.15 0.65 setrgbcolor'
.ps 14
.nr Boxpict 1
.ce
Mup Version 6.9
.ps
.vs
.ev
.pn 0
.if \n(.g \{
\X'ps: exec 0 0 0 setrgbcolor'
.pg@disable-top-trap
.nr % 0
.nr P 0
.hd@set-page 0 \}
.SK
\ \ \
.sp 5.5i
Mup Music Publisher User's Guide \(em Mup Version 6.9
.sp 0.5
\(co Copyright 1995-2021 by Arkkra Enterprises
.sp 0.5
All rights reserved.
.sp
Trademarks: All brand names and product names included in this User's Guide
are trademarks, registered trademarks, or trade names of their respective
holders.
.if \n(.g \{
\X'ps: exec %-marker1-'
.nr N 2
.nr % 0
.nr P 0
.pg@enable-top-trap
.hd@set-page 0 \}
.SK
.nr Cl 4
.ft B
.ps 16
.ce 2
Mup \(em Music Publisher
.sp
User's Guide
.sp 2
.ps 12
.ds HP +5 +4 +3 +2 +1
.ds HF 3 3 2 2 2
.nr Hb 4
.ft P
.\" for HTML
.ig
.Ht Mup User's Guide
.Hd index.html
.P
This is the on-line version of the Mup User's Guide, giving information
about how to use the Mup Music Publication program.
.H 2 "Mup Background Information"
.Hr intro.html
Introduction to Mup
.br
.Hr basics.html
Quick tutorial on Mup basics
.br
.Hr running.html
Running Mup
.br
.Hr cmdargs.html
Mup Options
.br
.Hr utilpgms.html
Mup utility programs for displaying and printing music
.br
.Hr gensyn.html
Mup General syntax information
.br
.Hr contexts.html
Mup contexts
.br
<HR>
.H 2 "Basic Standard Music Notation"
.Hr music.html
Specifying Mup music input
.br
.Hr chordinp.html
Chords (pitch, duration, and other attributes)
.br
.DL
.LI
.Hr chordinp.html#letter
Notes, rests, or spaces
.LI
.Hr chordinp.html#measdur
Measure duration
.LI
.Hr chordinp.html#acc
Accidentals
.LI
.Hr chordinp.html#oct
Octave
.LI
.Hr chordinp.html#shorthnd
Shorthand notations
.LI
.Hr noteattr.html
Note attributes
.DL
.LI
.Hr noteattr.html#small
Small notehead
.LI
.Hr noteattr.html#ntie
Note ties
.LI
.Hr noteattr.html#nslur
Slurs
.LI
.Hr noteattr.html#ntag
Note location tag
.LE
.LI
.Hr chrdattr.html
Chord attributes
.DL
.LI
.Hr chrdattr.html#chstyle
Chord style (grace, cue, xnote, diamond)
.LI
.Hr chrdattr.html#shaped
Shaped notes
.LI
.Hr chrdattr.html#withlist
Symbols to be printed with a chord
.LI
.Hr chrdattr.html#slashes
Slashes
.LI
.Hr chrdattr.html#stemdir
Stem direction
.LI
.Hr chrdattr.html#stemlen
Stem length
.LI
.Hr chrdattr.html#pad
Chord padding
.LI
.Hr chrdattr.html#ctag
Chord location tag
.LI
.Hr chrdattr.html#hoffset
Horizontal offset
.LI
.Hr chrdattr.html#dist
Rest distance
.LI
.Hr chrdattr.html#rptattr
Shorthand for repeated attributes
.LE
.LI
.Hr midmeas.html
Mid-measure parameter changes
.LI
.Hr crossst.html
Cross-staff stems
.LI
.Hr ichdattr.html
Inter-chord attributes
.DL
.LI
.Hr ichdattr.html#tie
Chord ties
.LI
.Hr ichdattr.html#slur
Chord slurs
.LI
.Hr ichdattr.html#custbeam
Custom beaming
.LI
.Hr ichdattr.html#crossbm
Cross-staff beams
.LI
.Hr ichdattr.html#alt
Alternation groups
.LE
.LI
.Hr tuplets.html
Tuplets
.LE
.br
.Hr altinp.html
Chord-at-a-time input style
.br
.Hr bars.html
Bar lines
.br
.DL
.LI
.Hr bars.html#bpad
Bar line padding
.LI
.Hr bars.html#btag
Bar line location tag
.LI
.Hr bars.html#endings
Endings
.LI
.Hr bars.html#reh
Rehearsal marks
.LI
.Hr bars.html#setmnum
Setting the measure number
.LI
.Hr bars.html#hide
Hiding time/key signature and clef changes
.LE
.Hr bars.html#subbar
Subbars
.br
.Hr multirst.html
Multirests
.br
.Hr lyrics.html
Lyrics
<HR>
.H 2 "Tablature"
.Hr tabstaff.html
Tablature notation
<HR>
.H 2 "Shaped notes"
.Hr shaped.html
Shaped notes
<HR>
.H 2 "Text Strings"
.Hr textstr.html
Mup text strings
<HR>
.H 2 Tempo, dynamic marks, ornaments, etc.
.Hr stuff.html
General Information
.br
.Hr textmark.html
Text
.br
.Hr textmark.html#grids
Guitar grids
.br
.Hr mussym.html
Music symbols
.br
.Hr phrase.html
Phrase marks
.br
.Hr cres.html
Crescendo and decrescendo marks
.br
.Hr octave.html
Octave marks
.br
.Hr pedal.html
Piano pedal marks
.br
.Hr roll.html
Rolls
<HR>
.H 2 "Tags, printing text, lines and curves"
.Hr tags.html
Location tags
.br
.Hr prnttext.html
Printing text
.br
.Hr linecurv.html
Lines and curves
<HR>
.H 2 "Miscellaneous Mup features"
.Hr newscore.html
Newscore and newpage, samescore and samepage
.br
.Hr headfoot.html
Page headers and footers
.br
.Hr macros.html
Macros
.br
.Hr ifclause.html
Generalized if clauses
.br
.Hr include.html
Include files
.br
.Hr exit.html
Exit
.br
.Hr udefsym.html
User-defined symbols
.br
.Hr fontfile.html
Installing other fonts
.br
<HR>
.H 2 "Custom Accidentals and Alternate Tunings"
.Hr tuning.html
Custom Accidentals and Alternate Tunings
<HR>
.H 2 "Mup Parameters"
.Hr param.html
Mup parameters
<HR>
.H 2 "Hints"
.Hr debug.html
Debugging
.br
.Hr adjust.html
Adjusting output
.br
.Hr invisbar.html
Special uses of invisible bars
.br
.Hr chant.html
Chant
.br
.Hr sharehd.html
Forcing shared noteheads
.br
.Hr mantup.html
Manually placed tuplet numbers
.br
.Hr manual.html
Manual placement of notes
.br
.Hr trillacc.html
Trill with accidental
.br
.Hr tieacc.html
Accidental on tied-to note
.br
.Hr brackmac.html
Bracketing notes across staffs
.br
.Hr crossbar.html
Cross-bar beaming
.br
.Hr lyrtag.html
Printing relative to lyric syllables
.br
.Hr slantxt.html
Printing slanted text
.br
.Hr mixtsig.html
Mixed time signatures
.br
.Hr nestmac.html
Defining a macro inside another macro
.br
.Hr tempochg.html
Marking complicated tempo changes
.br
.Hr multsong.html
Placing several songs on one page
.br
.Hr cadenza.html
Cadenzas
.br
.Hr trnspose.html
Transposition
.br
.Hr verses.html
Placing verses below the scores
.br
.Hr pianored.html
Automatic piano reduction
.br
.Hr autocue.html
Deriving cue notes from another staff
.br
.Hr slashmrk.html
Diagonal slash marks
.br
.Hr breathmk.html
Breath marks
.br
.Hr breaks.html
Breaks
.br
.Hr heeltoe.html
Organ pedal heel and toe marks
.br
.Hr muspaper.html
Generating blank staff paper
.br
.Hr pscoord.html
Passing multiple coordinates to PostScript
.br
.Hr brace.html
Printing braces
.br
.Hr pstools.html
Converting Mup files to other formats
<HR>
.H 2 "MIDI output"
.Hr midi.html
Basic Information
.br
.Hr gradmidi.html
Gradual MIDI Changes
<BR>
<HR>
<P>
.Hr mupindex.html
Index
</P>
<HR>
<P>
<ADDRESS>
Arkkra Enterprises
.br
.Hr mailto:support@arkkra.com
support@arkkra.com
.br
.Hr http://www.arkkra.com
http://www.arkkra.com
</ADDRESS>
</P>
<HR>
<P>
Copyright (c) 1995-2021 by Arkkra Enterprises
</P>
..
.Ht Introduction to Mup
.Hd intro.html
.H 1 "INTRODUCTION"
.nr Ej 1
.P
The music publisher program called "Mup" takes a text file describing
music as input, and generates PostScript*
.Hi
.FS *
PostScript is a trademark of Adobe Systems Incorporated
.FE
.He
.Ix cF
.Ix hA
output for printing that music.
After being available as shareware for 17 years, as of version 6.1,
it is now available as free, open-source software.
The input file can be created using your favorite text editor, or with the
help of the companion Mupmate program, or generated
from any other source, such as another program. The input must be written
in a special language designed especially for describing music. The majority
of the Mup User's Guide is the explanation of this language and how to use it.
.P
Mup has the power to print almost any kind of music, everything from
a single melody line to full orchestral or choral scores complete with
.Ix hJ
tempo and dynamic marks. In addition to standard 5-line staffs, it can handle
1-line staffs (typically used for percussion),
and tablature notation (typically used for guitar).
Because Mup can do so much, it takes a while to
.Ix cH
.Ix fR
master its entire language. However, it has built-in default values for
many things, so that you can start using it for simple songs after
.Hr basics.html
learning just the basics,
then learn the more complicated features as you need them.
Mup also has an option to produce
.Hr midi.html
output in the standard Musical Instrument Digital Interface (MIDI) format.
.Ix aA
.Hi
.P
The User's Guide begins by introducing the basics and describing the
general framework of the language. Then it gives detailed information
about all the features of Mup.
Appendix A gives a sample input file.
There is a Quick Reference available that may be useful for jogging your
memory after you've had a little experience using Mup.
.P
This User's Guide is for Mup version 6.9.
.\" Add copyright. Probably better way to do this, but this will work
.FS " "
.ce
\(co Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 by Arkkra Enterprises
.FE
.He
.ig
<BR>
<HR>
* PostScript is a trademark of Adobe Systems Incorporated
..
.Ht "Mup Basics"
.Hd basics.html
.H 1 "MUP BASICS"
.P
This section introduces the Mup language, giving some simple examples to
give you the flavor of a Mup input file.
Subsequent sections will go into greater detail.
.H 2 "Notes and chords"
.Ix gW
.P
Music is described one measure at a time. Each note is specified by its pitch
.Ix fM
.Ix hG
.Ix hL
value, "a" to "g." As an example, the first measure of "Three Blind
Mice" can be described like this:
.Ex 1
.\"score leftmargin=3; rightmargin=3
.\"music
1: 4e; 4d; 2c;
.\"bar
.Ee
The "1:" at the beginning of the line tells Mup that we are describing
the notes on staff number 1. In this very simple example, we only have one
staff, but later we'll do songs with more than one.
Each staff of each measure is normally put on a separate line.
.P
The first three notes of "Three Blind Mice" are E, D, and C. For Mup
input, these pitches are given in lowercase to avoid having to use the shift
key. No octave information was specified in this simple example, so Mup
.Ix gA
would use its default, which in this case would be the octave beginning
with middle C.
.P
The first two notes are quarter notes, and the last note is a half
note. Time values of notes are given as shown in the example. A quarter
note is marked by a 4, a half note by 2, a sixteenth note by a 16, etc.
.P
A semicolon is used to separate chords. In this simple example, each chord
.Ix hH
has only a single note in it, but it is possible to have lots of notes in one
.Hr chordinp.html
chord.
.P
At the end of each measure, we have to tell Mup what kind of
.Hr bars.html
bar line
.Ix gG
to draw. The standard bar line is just called "bar." So a complete
description of the first measure would be:
.Ex
1: 4e; 4d; 2c;
bar
.Ee
.P
To save typing, Mup allows a lot of shortcuts. One such shortcut is that
it assumes that unless you tell it otherwise, each note in the measure is
like the note before. You can leave out the second 4, because if you
don't specify a time value, Mup will assume the note is the same length
.Ix gT
as the previous note.
.P
The same sort of idea works with pitches. The third measure of "Three Blind
Mice" could be stated like this:
.Ex 1
.\"score leftmargin=2;rightmargin=2
.\"music
1: 4g;8f;;2e;
bar
.Ee
The third note has no information given at all in this example\(emthere is
only a semicolon. In this case, Mup will get both pitch and time value from
the previous note, so the actual third note in this measure would be an
eighth note with pitch F.
.P
You may have noticed that this example doesn't have spaces between chords.
.Ix gZ
There are only a few places where the Mup language requires you to put spaces.
However, you can always put some in other places to make things easier to read.
.H 2 "Parameters"
.P
.Ix aD
Printed music contains a lot more than just notes and bar lines. Among other
things, each staff normally begins with a clef, key signature, and time
.Ix cG
.Ix fI
.Ix gU
signature. Mup provides default values for these, which you can then
override if you want something different. In the examples so far, we didn't
override anything, so Mup would assume its default values, which are
treble clef, a key signature with no sharps or flats, and a time signature
.Ix fC
of 4/4.
.P
There is a long
.Hr param.html
list of "parameters" that can be set.
Things like clef
and key signature are among them. Parameters can be changed with a line of the
form:
.Ex
\fIparameter_name\fP=\fIvalue\fP
.Ee
For example, suppose we have a song written in 6/8 time in the key of D major.
We can convey this information to Mup like this:
.Ex 1
score
.\"rightmargin=2; leftmargin=2
time=6/8
key=2#
music
1: 4d;8e;4f;8d;
bar
.Ee
.P
Note that in this example, the key was specified as two sharps.
You can also specify the key by name:
.Ex
key = d major
.Ee
.P
These parameters give a very different sort of information than the notes of
a measure, so they go in a separate section of the input file.
Each section of the file describes information for a specific
.Hr contexts.html
\&"context."
.Ix fQ
Information about musical notes is given in "music" context,
.Ix hM
while things that apply in general to the whole
score are given in "score" context.
.Ix hJ
Once you start a measure in music context, you have to complete that measure
before switching to another context, but otherwise you can pretty much
change from one context to another as necessary.
Each new context section is headed by its name (e.g.,
\&"music" or "score").
At the beginning of input, music context is assumed.
.P
Here is a more complicated example:
.Ex 1
score
staffs=2
key=3&
time=2/4
.\" rightmargin=2.5
.\" leftmargin=2.5
music
1: ceg;;
2: 2c;
bar
.Ee
This example starts by setting some parameters. First it states that this
piece of music should be printed with two staffs, instead of the default of
only one. Then it gives a key signature. Since there is no "flat" symbol
on a standard computer keyboard, Mup uses the "&" symbol for flat.
.Ix fC
The time signature is then set to 2/4.
.P
Next we find the keyword "music," which indicates the end of parameters
and the beginning of the music. Data is given for both staff 1 and staff 2.
Staff 1 has two chords in the measure. The first is a C minor triad (it's
minor since the key is three flats). No time value is specified for this
chord. Since it is the very first chord of the piece, Mup cannot use the
previous chord's time value, because there is no previous chord.
In this case, Mup falls back to using the denominator (bottom number)
.Ix gN
of the time signature,
so the chord is a quarter note. Incidentally, if Mup has to back up to
previous notes to deduce pitch and/or time values, it only goes back as far
as the beginning of the current measure. That means the default time value
for the first chord of every measure in this piece would be quarter note.
The second chord on staff 1 is the same as the first, since only a semicolon
is specified.
.P
Staff 2 has only a single chord, consisting of a half note with pitch C.
Mup checks to make sure the time values on each staff add up to the time
signature\(emno more or less. It is an error to specify too much time.
For too little time, Mup will print
a warning message (unless warnings are turned off via the
.Hr param.html#warn
warn parameter).
.Ix hF
If you have something like a "pickup" measure, which doesn't add up to the
.Ix aV
time signature, you can specify "space" rather than a chord,
.Ix gZ
to account for the rest of the time.
.P
Some parameters can be set on a per-staff basis as well as for the entire
score. Mup also allows for
.Hr param.html#vscheme
up to three independent voices on each staff,
.Ix bF
.Ix hJ
and each voice can have parameters
set that apply to only that voice. To get the
value of a parameter, Mup always starts at the most specific place it could
be defined and works toward the most general. In other words, it will first
see if the parameter is set for the current voice. If not, it will see if
it is set for the current staff. If not, it will use the value set for the
entire score. Staff parameters are set in "staff" context, and voice parameters
are set in "voice" context.
As an example:
.Ex 1
score
staffs=3
key=1&
.\" rightmargin=2
.\" leftmargin=2
staff 2
key=2&
clef=bass
music
1: 2f;a;
2: 2c;f;
3: 1f;
bar
.Ee
Staff 2 will have two flats, whereas the other staffs will have one flat.
Staff 2 will use the bass clef, whereas the other staffs will use treble
clef (since that is the default when none is specified).
.ig
.Hr param.html
The complete list of Mup parameters
includes
..
.Hi
All the available parameters are listed later in this User's Guide,
along with
.He
information about whether they can be set for an individual staff
or voice, or just for the score as a whole.
.Ix hJ
.H 2 "Page headers and footers"
.P
Mup allows you to specify a
.Hr headfoot.html
header and/or footer
.Ix aS
.Ix aT
to put on the first page,
as well as a header and/or footer to use on subsequent pages. These can
include a page number that will be incremented automatically as pages are
printed. The headers and footers can be customized as you like, with
.Ix bG
.Ix bH
.Ix dN
.Ix fY
different fonts and sizes of text and items centered or left or right
justified. There is also a shortcut
.Hr prnttext.html
\&"title" command
.Ix gC
that can be used to create a canned format title. For example:
.Ex
title "Three Blind Mice"
.Ee
will create a centered title. You can also get left and right justified titles.
.H 2 "Lyrics"
.P
You can specify
.Hr lyrics.html
lyrics
.Ix aE
.Ix cJ
for as many verses as you like. They are specified
somewhat like notes. As an example:
.Ex 1
.\"score leftmargin=2 ; rightmargin=2
.\"music
1: 4e;d;2c;
lyrics 1: 4;;2; "Three blind mice,";
bar
.Ee
This example describes the lyrics to go with staff 1. There are three lyric
syllables, having time values of quarter note, quarter note, and half note.
.Ix gF
The actual syllables are given inside the double quotes.
Incidentally, since in this example the time values for the lyrics
are the same as those of the notes, the time values don't actually need to
be specified; if no lyrics time values are given, Mup assumes they
match the note time values.
.H 2 Miscellaneous
.P
Mup provides a way to
.Hr textmark.html
print arbitrary text
(like "allegro") and
.Hr mussym.html
musical symbols
(like a fermata). It can also print
.Hr phrase.html
phrase marks,
.Ix fJ
.Hr pedal.html
piano pedal marks,
.Ix fL
etc. The placement of these items is specified in terms
of "counts" into the measure. For example:
.Ex 1
.\"score leftmargin=2 ; rightmargin=2
.\"music
.\"1: 4e;d;2c;
boldital below 1: 3 "mf";
.\"bar
.Ee
.Ix dL
tells Mup to print "mf" in bold-italics below staff 1, at count 3 of the
measure.
You can also print
.Hr chrdattr.html#withlist
marks associated with specific chords.
All of these facilities are described in detail in following sections.
.H 2 "Displaying, printing, and playing music"
.P
.Ix hA
Once you have an input file, you can run Mup on it to get the printed
version of the music. Entering:
.Ex
mup \fImyfile\fP
.Ee
from a command line prompt or selecting Run > Display from Mupmate
will cause Mup to read \fImyfile\fP, which should contain text in the Mup
input language. If there are no errors in \fImyfile\fP, PostScript output
.Ix hF
.Ix cF
will be produced, which can be displayed on the screen or printed via
Mupmate or other programs. Mup can also produce
.Hr midi.html
MIDI output,
which can then be played on your speakers.
.P
.Ix cE
If you are using Ghostscript, but without Mupmate,
two utility programs are included with Mup
for
.Hr utilpgms.html
displaying and printing music
using Ghostscript.
These are described in more detail in the next section.
.Ht Running Mup
.Hd running.html
.H 1 "RUNNING MUP"
.P
There are two basic ways to run Mup: directly from a command line or via
the Mupmate program. You can use either approach, or switch between them
as you wish. The Mupmate program just
provides a more menu-driven environment on top of the Mup program itself.
.P
You can create a Mup file using any ordinary text editor,
and then run the Mup program on the file you created.
On Windows, Notepad is a typical editor choice, and on Linux, editors like
vim and emacs are commonly used, but pretty much any text editor (not
word processor) can be used. Many people, however, prefer to be able to
edit, display, and play from a single integrated and more graphical
interface, and for them, a helper program called "Mupmate" is provided.
The Mupmate program helps lead you through some of the steps,
and you can easily access this User's Guide from its Help menu.
.H 2 Mupmate
.P
Mupmate is currently only supported on Microsoft Windows, Apple Mac OS X, and Linux.
Since the source code is
available, and it is based on the cross-platform FLTK toolkit, it
would probably be fairly easy to make it run on any system supported by FLTK.
.P
Once you have installed Mup and Mupmate on Windows, double clicking
a .mup file in Windows Explorer will run Mupmate on that file.
Or, you can run Mupmate by going to the Start menu, and choosing
Programs, then Arkkra, and then Mupmate. If you would like an icon
on the desktop, you can create one by right clicking the Mupmate choice
in the Arkkra menu, choosing "copy",
right clicking somewhere on the desktop, and choosing "paste".
.P
On Linux, you can just type the mupmate command in a terminal window,
optionally followed by the name of a Mup input file.
Or you can add mupmate to your favorite window manager's menus.
.P
On Mac OS X, you can double click on the MupMate.app in Finder.
You should also be able to double click any file with a .mup suffix,
which should then run Mupmate on that file.
For setting paths in the Preferences, several "magic" variables are set
automatically, if you have not already set them to something else.
$APPL is set to the top of the application directory hierarchy.
$RSRC is effectively set to $APPL/MupMate.app/Contents/Resources.
$HOME is set to your home directory.
$SUPP is set to your applications support folder
(which is typically $HOME/Library/Application Support).
$DOCS is set to your document folder (which is typically $HOME/Documents).
.P
Mupmate provides five top level menus: File, Edit, Run, Config, and Help.
The File menu provides commands for opening new files and saving the
file you are working on, as well as exiting the program. The Edit menu
provides the kinds of things you would expect in a editor: commands to find
a pattern, or find and replace; to select text; to copy, cut, and paste;
to go to a specific line; and to undo the previous operation, if you make
a mistake or change your mind.
The Run menu lets you set runtime options,
and then run the Mup program on your input in various
ways. You can either just generate a PostScript, PDF, or MIDI file,
or display the PostScript or play the MIDI.
The Config menu lets you specify what application program you want
to use to view PostScript files and which you want to use to play MIDI files,
and well as specify locations for other Mup files. Mupmate will try to
find reasonable default values, but you may want to check that they are
what you want, and tweak them if they aren't.
For paths, you can include environment variables to be expanded,
by giving their name preceded by a dollar sign.
A tilde by itself will be expanded to your home directory, whereas a tilde
followed by the name of a user will be expanded to that user's home directory.
The Help menu lets you browse this User's Guide, view some startup hints,
view the Mup license, or see the current version number of Mup and Mupmate.
.P
Mupmate does not directly provide a print facility. Almost any PostScript
viewer already provides this ability, so you can simply select "Display"
from the Run menu and use the viewer's print capabilities.
Alternately you can use "Write PostScript File" from the Run menu
to create a PostScript file that you can print as you would any other
PostScript file.
.Ht Mup Options
.Hd cmdargs.html
.H 2 "Mup Options"
.P
Mup accepts a number
.Ix hA
of options.
When invoking Mup from a command line,
the options are specified by a dash followed by a letter.
On Windows/MS-DOS
.Ix aI
systems, you can substitute a slash instead of the dash.
If you are using Mupmate, you will use the "Set Options" form off
of the "Run" menu to set the options.
You just fill values into the form, and Mupmate will
take care of the details of running Mup with your values,
so you won't use the dash and letter shown below at all.
Some of the options listed below are not available from Mupmate,
either because they are meant for debugging, and thus not generally
of interest to most users, or because Mupmate handles the appropriate
details automatically.
.Ix cA
The options to the mup command (in alphabetical order) are:
.Hi
.de Co
.in -0.4i
.ne 1i
.sp
.ft CW
Command line:\
.ft P
..
.de Mo
.br
.ft CW
Mupmate:\ \ \ \ \ \
.ft P
..
.de Op
.sp 0.3
.in +0.4i
..
.He
.in +0.4i
.Co
.Hi
\fB-c\fP \fIN\fP
.He
.ig
.Hm coption
<B>-c</B> <I>N</I>
..
.Mo
Run > Set Options > Enable Auto Multirest and Min Measures to Combine
.Op
Combine consecutive measures of all rests or spaces into
.Ix gZ
.Ix hC
.Ix hG
.Hr multirst.html
multirests
.Ix aW
(multiple measures of rest printed as a single measure,
usually with the number of
.Hr param.html#prmultn
measures of rest printed
above the staff).
Any time there
are \fIN\fP or more measures in a row that consist entirely of rests or spaces,
they will be replaced by a multirest. The combining of measures
stops when there is a visible staff that contains notes
.Ix gL
.Ix hL
or lyrics, or that contain
.Hr textmark.html
text
or
.Hr mussym.html
musical symbols
after the first beat of the measure,
or when there are
.Hr param.html
parameter changes
on a visible staff or in score context that
.Ix fQ
.Ix gL
.Ix hJ
.Hr param.html#visible
change
.Hr param.html#clef
clef,
.Ix fI
.Hr param.html#key
key,
.Ix cG
or
.Hr param.html#time
time signature,
.Ix gU
or when there is a
.Hr bars.html
bar line
.Ix gG
other than an ordinary bar.
This option is most likely to be useful when printing a subset of staffs,
where the particular staff(s) you are printing have long periods of rests.
See information about
.Hr cmdargs.html#soption
the -s option
and the
.Hr param.html#visible
\&"visible" parameter
below.
.Ix gL
This option overrides the
.Hr param.html#restcomb
restcombine parameter.
.Co
.Hi
\fB-C\fP
.He
.ig
.Hm C_option
<B>-C</B>
..
.Mo
Option not available (only used for debugging).
.Op
This option is only used in connection with
.Hr cmdargs.html#Eoption
the -E option.
It specifies that comments
.Ix aF
are to be passed through rather than deleted.
.Co
.Hi
\fB-d\fP \fIN\fP
.He
.ig
.Hm dbgoption
<B>-d</B> <I>N</I>
..
.Mo
Option not available (only used for debugging).
.Op
Print debugging information. \fIN\fP is a bitmap, so you can turn on multiple
.Ix aP
debugging levels by adding up the flag values. For example, if you want to
turn on both level 2 and level 4 tracing, \fIN\fP would be 6 (because 2+4=6).
.Hi
.VL 5
.LI 1
input syntax/grammar analysis tracing
.LI 2
high level parse phase tracing
.LI 4
low level parse phase tracing
.LI 8
reserved
.LI 16
high level placement phase tracing
.LI 32
low level placement phase tracing
.LI 64
reserved
.LI 128
contents of the main internal list
.LI 256
high level print or MIDI phase tracing
.LI 512
low level print or MIDI phase tracing
.LE
.He
.ig
<DL>
<DT>1
<DD>
input syntax/grammar analysis tracing
<DT>2
<DD>
high level parse phase tracing
<DT>4
<DD>
low level parse phase tracing
<DT>8
<DD>
reserved
<DT>16
<DD>
high level placement phase tracing
<DT>32
<DD>
low level placement phase tracing
<DT>64
<DD>
reserved
<DT>128
<DD>
contents of the main internal list
<DT>256
<DD>
high level print or MIDI phase tracing
<DT>512
<DD>
low level print or MIDI phase tracing
</DL>
..
.sp
\fIN\fP can be specified in decimal, octal
(by using a leading zero), or hex (by using a leading 0x).
This information is intended for debugging of
Mup itself and thus is not likely to be of use to the average user,
and is not available from Mupmate.
.Co
.Hi
\fB-D\fP \fIMACRO[=macro-def]\fP
.He
.ig
.Hm doption
<B>-D</B> <I>MACRO[=macro-def]</I>
..
.Mo
Run > Set Options > Macro Definitions
.Op
Define
the
.Hr macros.html
macro
.Ix aM
\fIMACRO\fP. The macro name must consist of
uppercase letters, digits, and underscores, beginning
.Ix fW
with an uppercase letter. The \fImacro_def\fP is optional, and gives the
text of the macro. On UNIX, Linux, or similar
.Ix aJ
.Hi
.FS *
UNIX is a registered trademark of X/Open Company Limited.
.FE
.He
systems, if it contains any white space
or other special characters, it must be quoted. On other systems, white
space may not be allowed.
The -D option can be specified multiple times, if you wish to
define more than one macro.
.Co
\fB-e\fP \fIerrfile\fP
.Mo
Option not needed. Mupmate automatically saves and displays error output.
.Op
Place the error message output into \fIerrfile\fP instead of writing it to
the standard error output stream.
.Co
.Hi
\fB-E\fP
.He
.ig
.Hm Eoption
<B>-E</B>
..
.Mo
Option not needed (only used for debugging).
.Op
Rather than produce PostScript or MIDI output, just expand
.Ix aM
macros
.Ix aO
and includes,
and write the result to the standard output stream.
Comments in the input are deleted, unless the -C option is also specified.
.Co
\fB-f\fP \fIoutfile\fP
.Mo
Option not needed. Mupmate automatically creates appropriate output file.
.Op
Place the PostScript output into \fIoutfile\fP instead of writing to
the standard output.
.Co
.Hi
\fB-F\fP
.He
.ig
.Hm Foption
<B>-F</B>
..
.Mo
Run > Write PostScript File
.Op
This is like the \fB-f\fP option, except the name of the output file is
derived from the name of the Mup input file. If the name of the Mup input
file ends with a ".mup" suffix, the generated PostScript output
file will end with a ".ps" suffix instead.
If the name of the Mup input file ends with
a ".MUP" suffix, the PostScript file will end with a ".PS" suffix.
Otherwise, a ".ps" suffix will be appended to the end of the Mup
input file name. If multiple input files are listed, the last is used.
If none are specified (input is read from standard input),
the name "stdin.ps" will be used for the output file.
.Co
.Hi
\fB-l\fP
.He
.ig
.Hm loption
<B>-l</B>
..
.Mo
Help -> License
.Op
Show the Mup license and exit.
.Co
.Hi
\fB-m\fP \fImidifile\fP
.He
.ig
.Hm moption
<B>-m</B> <I>midifile</I>
..
.Mo
Option not needed. Mupmate automatically creates appropriate output file.
.Op
Instead of generating PostScript output,
generate standard
.Hr midi.html
MIDI (Musical Instrument Digital Interface) output,
.Ix aA
and put it in \fImidifile\fP.
This option also causes the
.Hr macros.html
macro
"MIDI" to become defined.
.Co
\fB-M\fP
.Mo
Run > Write MIDI File
.Op
This is like the \fB-m\fP option, except the name of the MIDI file is
derived from the name of the Mup input file. If the name of the Mup input
file ends with a ".mup" suffix, the generated MIDI file will end with
a ".mid" suffix instead. If the name of the Mup input file ends with
a ".MUP" suffix, the MIDI file will end with a ".MID" suffix.
Otherwise, a ".mid" suffix will be appended to the end of the Mup
input file name. If multiple input files are listed, the last is used.
If none are specified (input is read from standard input),
the name "stdin.mid" will be used for the MIDI file.
.Co
.Hi
\fB-o\fP \fIpagelist\fP
.He
.ig
.Hm ooption
<B>-o</B> <I>pagelist</I>
..
.Mo
Run > Set Options > Pages to Display
.Op
Print only the pages given in \fIpagelist\fP.
The \fIpagelist\fP can begin or end with optional qualifiers.
.Ix dC
A qualifier of "odd" will restrict printing to only odd numbered pages,
while a qualifier of "even" will restrict to even numbered pages.
A qualifier of "reversed" will cause pages to be printed in reverse order,
which may be useful for printers that stack output in backwards order.
A comma-separated list of pages and/or page number ranges
can also be specified, where a range is two numbers separated by a dash.
For example, -o1,7-9,12-14 would print pages 1, 7, 8,
9, 12, 13, and 14. Adding a qualifier, -oodd,1,7-9,12-14 would print pages
1, 7, 9, and 13, while -o1,7-9,12-14,even,reversed would print pages
14, 12, and 8 in those orders. -oreversed would print all pages backwards,
while -oreversed,odd would print all odd pages backwards.
There is also a special page number of "blank" which will result in a
completely blank page being output. This is most likely to be useful
when the
.Hr param.html#panels
panelsperpage parameter.
is set to 2. For example, to print a one-page song on the right-hand panel
rather than the left, you could use -oblank,1
.Co
.Hi
\fB-p\fP \fIN\fP
.He
.ig
.Hm poption
<B>-p</B> <I>N</I><B>,</B><I>pageside</I>
..
.Mo
Run > Set Options > First Page's Page Number
.Op
Start numbering pages
at \fIN\fP instead of at 1.
This can be set inside the Mup input file
with
.Hr param.html#firstpg
the "firstpage" parameter,
but the command line option will override the parameter.
The page number can optionally be followed by a comma and either leftpage
or rightpage, to specify whether any header, footer,
top, or bottom on the first page should use the left or right page versions,
if they are different. This would, of course, also control whether the
left or right versions of header2, footer2, top2, and bottom2 are used
on subsequent pages.
.Ix aU
If \fB-o\fP and \fB-p\fP are used together, the page numbers given in the
\fB-o\fP\fIpagelist\fP must be the printed page numbers. For example, if you
use -p10 and want to print just the second page,
you would need to specify -o11.
.Co
.Hi
\fB-q\fP
.He
.ig
.Hm qoption
<B>-q</B>
..
.Mo
Option not needed.
.Op
Quiet mode. Omits printing of version and copyright notice at startup.
.Co
.Hi
\fB-s\fP \fIstafflist\fP
.He
.ig
.Hm soption
<B>-s</B> <I>stafflist</I>
..
.Mo
Run > Set Options > Staffs to Display/Play
.Op
Only print the staffs that are included in \fIstafflist\fP.
The \fIstafflist\fP can be a
comma-separated list of staff numbers or ranges, such as "1,5" or "1-3,7-8"
but no spaces are allowed in the list.
If the -m or -M option is also used, to produce
.Hr midi.html
MIDI output,
this option controls which staffs are played rather than which
are printed.
If you want only a single voice to be printed or played, you can follow
a staff number or range with \fBv1\fP or \fBv2\fP or \fBv3\fP
to restrict to voice 1, 2 or 3
respectively, such as "1v2" or "1-4v1,5-6v2". Otherwise
all voices on the staff are printed or played.
You can't specify a list or range for voices;
if you only want to make two out of three voices visible,
you have to specify them separately, like "1v2,1v3".
.Hr param.html#visible
See also the "visible" parameter.
.Co
\fB-v\fP
.Mo
Help > About Mupmate
.Op
Print the Mup version number. When invoked from command line,
Mup will then exit. This document is for version 6.9.
.Co
.Hi
\fB-x\fP\fIM\fP\fB,\fP\fIN\fP
.He
.ig
.Hm xoption
<B>-x</B><I>M</I><B>,</B><I>N</I>
..
.Mo
Run > Set Options > Extract Measures
.Op
Extract measures \fIM\fP through \fIN\fP of the song. This allows you to print
or play a part of a song. The comma and second value are optional;
if not specified, the default is to go to the end of the piece.
Positive values specify the number of measures from the beginning of the piece,
while negative values are relative to the end, with -1 referring to the
last measure of the song.
So -x1,-1 means the entire song, if the song doesn't have a pickup measure.
.Ix aV
If the song has a pickup measure, that is specified by 0.
So for a song with a pickup, -x0,-1 would mean the entire song,
and -x0,0 would mean just the pickup measure.
As other examples, -x-1,-1 means just the final measure of the song,
-x2 means starting after the first full measure, -x3,4 means only
measures 3 and 4, and -x6,6 means just measure 6.
The starting measure is not allowed to be inside an ending.
A common use for this option might be to
.Hr midi.html
generate a MIDI file
for just a few measures. For example, if you were
trying to tweak tempo values for a ritard in the last 2 measures of a song,
you could use -x-2 to listen to just those measures.
.in -0.4i
.ig
<HR>
..
.P
When invoked from command line, the options, if any,
can be followed by one or more \fIfiles\fP in the format
described in this User's Guide. If no \fIfiles\fP are specified,
standard input is read.
If several \fIfiles\fP are listed, they are effectively concatenated together
and treated as one big file. Since there are some things (such as
.Hr headfoot.html
header and footer)
.Ix aS
.Ix aT
that are only allowed to occur once, if you have several independent
pieces, Mup should be called on each individually rather than trying to
print them all with one command.
If a specified file does not exist, and its name does not already end
with .mup or .MUP, then Mup will append .mup to the specified name and
attempt to open that.
.P
If you just want to create a PostScript output file, for printing on a
PostScript printer, or viewing with a tool such as GSview, you can
use the -f option, as in:
.Ex
mup -f outfile.ps infile.mup
.Ee
Or on Unix, Linux or MS-DOS command window,
you could redirect the output into a
file using the > character, as in:
.Ex
mup infile.mup > outfile.ps
.Ee
.P
For more debugging, in addition to the
.Hr cmdargs.html#dbgoption
-d option,
if the environment variable MUP_BB is set to "bcfgnsu" or any subset
of those letters, the generated output will include "bounding
boxes" for the things Mup internally calls bars (b), chords (c), feeds (f),
grpsyls (g), header/footer and top/bottom (h),
notes (n), staffs (s), and stuff (u).
While this is intended for use in debugging Mup itself, it may also
help you understand why Mup places things the way it does,
since in general, Mup only allows bounding boxes to overlap according
to specific rules. If viewed with a color PostScript viewer (not
.Hr utilpgms.html
Mupdisp,
which is covered below), these boxes will be in color.
.ig
<BR>
<HR>
* UNIX is a registered trademark of X/Open Company Limited
.br
MS-DOS and Windows are registered trademarks of Microsoft Corporation
.br
PostScript is a trademark of Adobe Systems Incorporated
..
.Ht Mup Utilities for displaying and printing output
.Hd utilpgms.html
.H 2 "Mupdisp and Mupprnt utility programs"
.P
.Ix cE
If you are using Ghostscript, but prefer to not use Mupmate,
there are two utility programs included with
Mup for displaying and printing music.
.Ix hA
.Ex
mupdisp \fIMup_options myfile\fP
.Ee
.Ix aG
will display music to your screen, while
.Ex
mupprnt \fIMup_options myfile\fP
.Ee
will print the output to your printer.
.Ix aH
See the installation instructions for more details on configuring the
Mupprnt program for your printer.
.P
The \fIMup_options\fP can be any of the options listed in the
section on
.Hr cmdargs.html
\&"Command line arguments"
.Ix bN
except -C, -E, -f, -F, -l -m, -M, or -v, which don't
send PostScript output to the standard output.
.Ix cF
.P
The Mupdisp program allows you to view pages in any order, with either a
version small enough to fit on your screen or a near-actual-size version
.Ix gY
that you can scroll if it doesn't fit on your screen.
.Ix bZ
Mupdisp will run under MS-DOS/Windows or will run under
.Ix aI
UNIX with TERM of AT386, linux, or xterm (under X windows).
.Ix aJ
.P
Mupdisp begins in partial page mode,
which displays output at approximately actual size (depending
on the size of your monitor). In this mode, it is possible that
not all of the page fits on the
screen, so the scrolling commands can be used to move up and down to view
different parts of the page. In full page mode, a small version of the
entire page is displayed. This is useful
for seeing overall page layout, but is generally too small to see much detail.
This mode is now somewhat of a relic of the days when screens were typically
much smaller than they are today, and is thus becoming less useful.
.P
Once the music has been drawn on the screen, you can enter various commands
to view different pages or parts of the current page.
The commands are:
.Hi
.VL 15
.LI "\fInum\fP<Enter>"
Go to page number \fInum\fP.
.LI "+ or <space> or <control-E> or <control-F>"
move forward on the page by about 1/8 of an inch
(partial page mode only)
.LI "- or <backspace> or <control-Y> or <control-B>"
move backward on the page by about 1/8 of an inch
(partial page mode only)
.LI "b or <control-U> or <control-P> or <upward-arrow-key>"
move backward on the page by about an inch
(partial page mode only)
.LI "f or <Enter> or <control-D> or <control-N> or <downward-arrow-key>"
move forward on the page by about an inch
(partial page mode only)
.LI "h or ?"
display help screen
.LI "m"
toggle between partial page and full page modes.
.LI "n or <PageDown>"
go to next page
.LI "p or <PageUp>"
go to previous page
.LI "q or ZZ"
quit
.LI "r"
Repaint the page (useful for exiting help page)
.LE
.He
.ig
<DL>
<DT>\fInum\fP <Enter>
<DD>
Go to page number \fInum\fP.
<DT>+ or <space> or <control-E> or <control-F>
<DD>
move forward on the page by about 1/8 of an inch
(partial page mode only)
<DT>- or <backspace> or <control-Y> or <control-B>
<DD>
move backward on the page by about 1/8 of an inch
(partial page mode only)
<DT>b or <control-U> or <control-P>
<DD>
move backward on the page by about an inch
(partial page mode only)
<DT>f or <Enter> or <control-D> or <control-N>
<DD>
move forward on the page by about an inch
(partial page mode only)
<DT>h or ?
<DD>
display help screen
<DT>m
<DD>
toggle between partial page and full page modes.
<DT>n
<DD>
go to next page
<DT>p
<DD>
go to previous page
<DT>q or ZZ
<DD>
quit
<DT>r
<DD>
Repaint the page (useful for exiting help page)
</DL>
..
.P
When in X windows, the mouse can be used for scrolling. The left button scrolls
.Ix cX
downward like the f command, while the right button scrolls backwards like
the b command.
.ig
<HR>
UNIX is a registered trademark of X/Open Company Limited
.br
MS-DOS and Windows are registered trademarks of Microsoft Corporation
.br
Apple and Mac OS X are registered trademarks of Apple, Inc.
..
.Ht Mup General Syntax
.Hd gensyn.html
.H 1 "MUP FILE STRUCTURE"
.P
Mup files do not have to follow any naming convention,
although on systems that use file name suffixes to associate a file
with an application, it is traditional to use .mup for the suffix.
It can also be useful to put a special "magic string"
on the first line of Mup files.
This magic string is completely optional, but having it there
makes it easy for both people
and programs to identify the file as Mup input.
The standard recommended value for this string is:
.Ex
//!Mup-Arkkra
.Ee
with exactly that spacing and capitalization.
If the file uses features of newer versions of Mup, and thus would
not work with older versions, you can add a dash and
the minimim version number the file requires, as in:
.Ex
//!Mup-Arkkra-6.9
.Ee
.H 2 "Mup General Syntax"
.P
Any number of spaces and tabs can be put in
.Ix gZ
almost anywhere except in the middle of a word.
Each statement goes on a separate line.
If for some reason you wish to split a statement onto several lines,
each but the last must end with a "\e" (backslash) character, to
.Ix bC
tell Mup to treat the next line as a continuation of the current line.
Blank lines can be put between statements to make things easier to read.
.P
Comments begin with two slashes and continue to end of line. All comments
.Ix aF
will be totally ignored by Mup, and are for your own use to remind yourself
of something. For example:
.Ex
// Note: in some early manuscripts, this chord had an accent
.Ee
.P
Staffs are numbered from top to bottom, starting at staff 1.
.Ix gM
.Ix gN
.Ix hK
.P
Several different units are used for distances. One is inches or
centimeters. (There is a
.Hr param.html#units
units parameter
that is used to select which you want to use.) Another
.Ix fO
is "stepsizes." One stepsize is half the distance between two staff lines.
In the horizontal dimension, "counts" are sometimes used. A "count"
refers to the musical duration of a note with a duration of the denominator
.Ix fP
.Ix gN
(bottom number) of the time signature.
The actual distance on the page will vary depending
on how Mup determines notes should be placed.
When you use a
.Hr param.html#time
time signature
with two or more fractions added together,
as in 3/4 + 3/8, the "count" is the largest denominator, which would be
8 in the example just given.
.P
Uppercase and lowercase letters are not interchangeable. Thus, for example,
\&"SCORE" is not the same as "score."
.P
Most lines of input end with a semicolon. There are some kinds of input that
.Ix hH
do not require an ending semicolon, but Mup will allow semicolons
on most of those
too, so that if you can't
remember if a given command requires a semicolon or not, you can just use one
anyway. For the examples in this User's Guide, semicolons are not used when
.Hi
they are not necessary.*
.FS *
.Ix aD
.Ix aW
.Ix cC
.Ix cD
.Ix cV
.Ix cW
.Ix fD
.Ix fE
.Ix fY
.Ix gC
.Ix gG
.Ix hA
For setting, unsetting, saving, or restoring of parameters,
either a semicolon or a newline
is required. For bar, multirest, print, left, right, center, title,
line, curve, newscore, newpage, postscript, and paragraph a newline is
required, but it may optionally be preceded by a semicolon.
For commands for changing context, semicolon and newline are both optional,
but a newline is traditionally used to improve readability.
.FE
.He
.ig
they are not necessary.
For
.Hr param.html
setting, unsetting, saving, or restoring of parameters,
either a semicolon or a newline
is required. For
.Hr bars.html
bar,
.Hr multirst.html
multirest,
.Hr prnttext.html
print, left, right, center, title,
.Hr linecurv.html
line, curve,
.Hr newscore.html
newscore, newpage,
.Hr prnttext.html#postscript
postscript,
and
.Hr prnttext.html#paragrph
paragraph,
a newline is required, but it may optionally be preceded by a semicolon.
For commands for changing
.Hr contexts.html
context,
semicolon and newline are both optional,
but a newline is traditionally used to improve readability.
..
.P
In
.Hr music.html
music context,
newlines are required to separate commands: music data, bar lines, rolls,
commands to print strings, dynamic marks, lyrics, etc. all must each
end with a newline. In
.Hr textmark.html#grids
grids context
and
.Hr shaped.html#hdshape
headshape context,
each pair of strings must end with a newline.
In other contexts, there are a few cases where newlines between commands
are optional, although you may wish to use them anyway to improve readability.
.P
Mup supports
.Hr macros.html
macros and conditionals (like 'if' and 'ifdef')
that can be placed anywhere in input, except in the middle of words,
numbers, or strings; they needn't be on separate lines.
.P
In a number of statements, Mup expects a text string. All strings must be
.Ix hB
enclosed in double quotes. For example:
.Ex
\&"This is a string."
\&"Allegro"
.Ee
.P
A string can contain any combination of letters, numbers, spaces,
and punctuation.
It can also contain various things that will cause printing of special music
characters, change font and size, and so forth. Those things are covered in
.Hr textstr.html
the chapter on text strings.
.Ht Mup Contexts
.Hd contexts.html
.H 2 "Contexts"
.Ix fQ
.P
There is always a current Mup "context" that is in effect.
When Mup begins reading input, it is operating in "music" context, which
is where music, lyrics, barlines, and other related things
.Ix aE
are described. You can change to another
context by entering its name. A context remains in effect until
another context is named.
The contexts are:
.Hi
.VL 18
.LI \fBheader\fP
to define what goes at the top of the first page, typically
the title, composer, etc.
.Ix aS
.Ix gC
.LI \fBfooter\fP
to define what goes at the bottom of the first page,
.Ix gN
typically a copyright notice, performance notes, etc.
.Ix bO
.LI \fBheader2\fP
to define what is to be printed on the top of pages after the first page.
.LI \fBfooter2\fP
to define what is to be printed on the bottom of pages after the first page.
.LI \fBtop\fP
to define what is to be printed on the top of page.
.Ix gM
This gets printed below the header (or header2), if any.
If the output is not already at the beginning of a new page,
a new page is started.
Unlike header, which can only be used once, and is used only on the very
first page, top can be used multiple times. In a song with multiple movements,
you might use top to put a title at the beginning of each movement.
.LI \fBbottom\fP
to define what is to be printed on the bottom of page.
.Ix gN
This gets printed above the footer (or footer2), if any.
If the output is not already at the beginning of a new page,
a new page is started.
Unlike footer, which can only be used once, and is used only on the very
first page, bottom can be used multiple times.
.LI \fBtop2\fP
to define what is to be printed on the top of pages,
after the page that uses "top."
If the output is not already at the beginning of a new page,
a new page is started.
.LI \fBbottom2\fP
to define what is to be printed on the bottom of pages
after the page that uses "bottom."
If the output is not already at the beginning of a new page,
a new page is started.
.LI \fBblock\fP
to define a
.Hr prnttext.html#block
block
.Ix jC
that contains text rather than music.
.LI \fBscore\fP
to define parameters that apply to the entire score.
.Ix aD
.Ix hJ
.LI "\fBstaff\fP \fIS\fP"
to define parameters to be used for staff \fIS\fP,
where \fIS\fP is a number from 1 to 40.
You can also specify a comma-separated list of staffs or staff ranges:
.br
.in +0.5i
staff 3,7 // staffs 3 and 7
.br
staff 1-2, 5-8, 10 // staffs 1, 2, 5, 6, 7, 8, and 10
.in -0.5i
.Ix hK
.LI "\fBvoice\fP \fIS V\fP"
to define parameters for a
particular voice \fIV\fP on staff \fIS\fP.
.Ix bF
The voice \fIV\fP can be either 1, 2, or 3.
\fIS\fP is a staff number from 1 to 40.
Multiple staffs and/or voices can be specified:
.br
.in +0.5i
voice 1-4 1 // voice 1 on staffs 1 through 4
.br
voice 1-2 2 & 3 1 // voice 2 on staffs 1 and 2 and voice 1 on staff 3
.in -0.5i
.LI "\fBcontrol\fP"
to save and restore parameter settings
.LI \fBgrids\fP
to define
.Hr textmark.html#grids
grids
(typically for guitar)
.Ix iW
.LI \fBheadshapes\fP
to define what notehead shapes to use for notes of various durations.
This context is rarely used, and is described in the chapter on
.Hr shaped.html
shaped notes.
.Ix jG
.LI "\fBsymbol \(dq\fIname\fB\(dq\fR"
to define
.Hr udefsym.html
user-defined symbols,
or override the appearance of
.Hr textstr.html#symlist
built-in music symbols.
.LI "\fBaccidentals \(dq\fIname\fB\(dq\fR"
.Ix bL
to define symbols and frequency adjustments to use for accidentals.
More details are given in the chapter on
.Hr tuning.html
Custom Accidentals and Alternate Tunings.
.LI "\fBkeymap \(dq\fIname\fB\(dq\fR"
.Ix jL
to define a mapping from what you type in to other symbols.
This is typically used to make it easier to enter strings that you want
printed in another alphabet, like Cyrillic or Greek.
More details are given in the
.Hr textstr.html#keymaps
keymap section
of the chapter on
.Hr textstr.html
text strings.
.LI \fBmusic\fP
to define everything else. This includes notes, lyrics, bar lines,
.Ix aE
.Ix cH
.Ix fJ
.Ix fR
.Ix hL
.Ix hM
phrase marks, tempo and dynamic marks, etc.
.LE
.He
.ig
<DL>
<DT>
.Hr headfoot.html
header
<DD>
to define what goes at the top of the first page, typically
the title, composer, etc.
<DT>
.Hr headfoot.html
footer
<DD>
to define what goes at the bottom of the first page,
typically a copyright notice, performance notes, etc.
<DT>
.Hr headfoot.html
header2
<DD>
to define what is to be printed on the top of pages after the first page.
<DT>
.Hr headfoot.html
footer2
<DD>
to define what is to be printed on the bottom of pages after the first page.
<DT>
.Hr headfoot.html
top
<DD>
to define what is to be printed on the top of page.
This gets printed below the header (or header2), if any.
If the output is not already at the beginning of a new page,
a new page is started.
Unlike header, which can only be used once, and is used only on the very
first page, top can be used multiple times. In a song with multiple movements,
you might use top to put a title at the beginning of each movement.
<DT>
.Hr headfoot.html
bottom
<DD>
to define what is to be printed on the bottom of page.
This gets printed above the footer (or footer2), if any.
If the output is not already at the beginning of a new page,
a new page is started.
Unlike footer, which can only be used once, and is used only on the very
first page, bottom can be used multiple times.
<DT>
.Hr headfoot.html
top2
<DD>
to define what is to be printed on the top of pages
after the page that uses "top."
If the output is not already at the beginning of a new page,
a new page is started.
<DT>
.Hr headfoot.html
bottom2
<DD>
to define what is to be printed on the bottom of pages
after the page that uses "bottom."
If the output is not already at the beginning of a new page,
a new page is started.
<DT>
.Hr prnttext.html#block
block
<DD>
to define a block that contains text rather than music.
<DT>
score
<DD>
to define
.Hr param.html
parameters
that apply to the entire score.
<DT>
staff \fIS\fP
<DD>
to define
.Hr param.html
parameters
to be used for staff \fIS\fP,
where \fIS\fP is a number from 1 to 40.
You can also specify a comma-separated list of staffs or staff ranges:
<PRE>
staff 3,7 // staffs 3 and 7
staff 1-2, 5-8, 10 // staffs 1, 2, 5, 6, 7, 8, and 10
</PRE>
<DT>
voice \fIS V\fP
<DD>
to define
.Hr param.html
parameters
for a particular voice \fIV\fP on staff \fIS\fP.
The voice \fIV\fP can be either 1, 2, or 3.
\fIS\fP is a staff number from 1 to 40.
Multiple staffs and/or voices can be specified:
<PRE>
voice 1-4 1 // voice 1 on staffs 1 through 4
voice 1-2 2 & 3 1 // voice 2 on staffs 1 and 2 and voice 1 on staff 3
</PRE>
<DT>
.Hr textmark.html#grids
grids
<DD>
to define grids (typically for guitar)
<DT>
.Hr shaped.html
headshapes
<DD>
to define what notehead shapes to use for notes of various durations.
This context is rarely used, and is described in the chapter on
.Hr shaped.html
shaped notes.
<DT>
.Hr udefsym.html
symbol
<DD>
to define
user-defined symbols,
or override the appearance of
.Hr textstr.html#symlist
built-in music symbols.
<DT>
accidentals "\fIname\fP"
<DD>
to define symbols and frequency adjustments to use for accidentals.
More details are given in the chapter on
.Hr tuning.html
Custom Accidentals and Alternate Tunings.
<DT>
keymap "\fIname\fP"
<DD>
to define a mapping from what you type in to other symbols.
This is typically used to make it easier to enter strings that you want
printed in another alphabet, like Cyrillic or Greek.
More details are given in the
.Hr textstr.html#keymaps
keymap section
of the chapter on
.Hr textstr.html
text strings.
<DT>
.Hr music.html
music
<DD>
to define everything else. This includes
.Hr chordinp.html
notes,
.Hr lyrics.html
lyrics,
.Hr bars.html
bar lines,
.Hr phrase.html
phrase marks,
.Hr textmark.html
tempo and dynamic marks, etc.
</DL>
..
.P
Most contexts are optional. An input file
just needs to contain either at least one measure of music
or at least one
.Ix jC
.Hr prnttext.html#block
block.
.P
All the contexts for things that go at the tops or bottoms of pages
(i.e., header, footer, header2, footer2, top, bottom, top2, bottom2) can
have different versions for left and right pages, by following their name
with a modifier of "leftpage" or "rightpage." This is described more
fully in the section on
.Hr headfoot.html
Headers and Footers.
Each of the three variations of header, footer, header2, or footer2
contexts can be used only once, although they can be placed anywhere
in the file. The other contexts may appear any number of times
in any order, and the order in which they occur is significant in
determining the output produced.
.Ht Mup music context
.Hd music.html
.H 1 "BASIC STANDARD MUSIC NOTATION"
.P
Music data is given in the
.Hr contexts.html
\&"music" context.
.Ix fQ
.Ix hG
.Ix hM
For each measure, there is usually
one line of input for each voice.
.Ix bF
At the end of the measure, the kind of
.Hr bars.html
bar line
.Ix gG
to be used to end the measure is specified.
This section describes the input for generating standard music notation.
Mup can also generate
.Hr tabstaff.html
tablature notation,
and that is covered in the next section.
.ig
.br
.Hr chordinp.html
Chords
.br
.Hr bars.html
Bar lines
.br
.Hr multirst.html
Multirests
.br
.Hr lyrics.html
Lyrics
..
.Ht Specifying chords
.Hd chordinp.html
.H 2 "Specifying chords"
.Ix gW
.H 3 "Staff and voice"
.P
The description of the music for one voice begins with the staff and voice
.Ix bF
.Ix hK
number, followed by a colon. For example:
.Ex
3 1:
.Ee
indicates that the remainder of the line contains musical information for voice
1 of staff 3. If the "voice" number is omitted, voice 1 is assumed. Thus
.Ex
3:
.Ee
is equivalent to the previous example.
Both the staff and voice can be given as a list. This may be useful if
several staffs have the same notes, or multiple voices on a staff have the
same notes. For example:
.Ex
1-4 2: // voice 2 of staffs 1, 2, 3, and 4
1,2,4: // voice 1 of staffs 1, 2, and 4,
1,3,6-7 1-2: // voices 1 and 2 on staffs 1, 3, 6 and 7
5-8 1,2: // voices 1 and 2 on staffs 5, 6, 7, and 8
.Ee
.P
If you want notes to go to one voice on some staffs
and a different voice on others,
this can be specified using an ampersand. For example:
.Ex
1 1 & 3 2:
.Ee
will cause the music to go to voice 1 of staff 1 as well as to voice
2 of staff 3. Various styles can be combined:
.Ex
// Voices 1 and 2 on staff 2,
// as well as voice 2 on staff 4
// and voice 1 on staffs 6, 7, and 9
2 1-2 & 4 2 & 6-7,9 1:
.Ee
.P
It is possible to have up to
40
.Hr param.html#staffs
staffs
and up to
.Hr param.html#vscheme
three voices per staff.
While there can be voice crossings, in general voice 1 should be the "top"
voice, voice 2 the "bottom" voice, and voice 3 the "middle" or "extra" voice.
With the first two voices, Mup tries hard to avoid any "collisions"
between notes, rests, and other things. Since voice 3 is an extra voice,
there are some cases when overlap with the other voices
is basically unavoidable, but there are some techniques
discussed later that let you
.Hr chrdattr.html
tweak placement
when necessary.
.P
As an alternative to this voice-at-a-time input style, there is
also a chord-at-a-time input style, which will be covered
.Hr altinp.html
later.
.Hh duration
.H 3 "Chord duration information"
.Ix fP
.P
The rest of the line contains a list of chords, with a semicolon at the
.Ix hH
end of each chord. Each chord has a
time value.
The time values of all
.Ix gT
the chords in the line must add up to no more than the
.Hr param.html#time
time signature.
.Ix gU
Time values are given as follows:
.Hi
.DS
.He
.TS
center;
c c
c l.
\fBInput\fP \fBMeaning\fP
_
1/8 octuple whole
1/4 quadruple whole
1/2 double whole
1 whole
2 half
4 quarter
8 eighth
16 sixteenth
32 thirty-second
64 sixty-fourth
128 128th
256 256th
.TE
.Hi
.DE
.He
.P
Any of these time values can be followed by one or more dots, to indicate
.Ix gX
.Ix hL
a dotted note. Each dot increases the time value by 50% of the preceding
note or dot.
.P
It is also possible to specify time as two or more times to be added together.
For example, 2+8 would indicate the time of a half note plus the time of
an eighth note, or in other words, a half note tied to an eighth note.
The expression can also include subtractions, like 2.-16. When subtractions
are present, it isn't clear what time values you want Mup to use,
so it will start with the largest possible time value and add enough
additional chords to add up to the total. For example, if you were to use
1-4, indicating a whole note minus a quarter note,
Mup will use a dotted half note, even though there are a number of
other ways to represent that total time, such as a half note tied to a
quarter note.
.P
If a time value is not specified for the first chord in a measure for a
given voice, the default timeunit value
.Ix cT
is used. You can set the default value using the
.Hr param.html#timeunit
\&"timeunit" parameter
as described in the
.Hr param.html
\&"Parameters" section.
If that parameter is not set, the default is the denominator (bottom
number) of the
.Ix gN
.Hr param.html#time
time signature.
For chords after the first, if a time value is not specified, the time
value for the previous chord is used.
.Hh letter
.H 3 "Notes, rests, or spaces"
.P
There are three kinds of "chords."
The first type consists of one or more
pitches, given by the letters "a" through "g".
.Hm pitchpar
Parentheses
.Ix iA
can be placed around the pitch if you want
the note to be printed in parentheses.
(If the pitch is modified by an
.Hr chordinp.html#acc
accidental
or
.Hr chordinp.html#oct
octave,
which will be
discussed later, those must also be included inside the parentheses.)
.Ix fM
.Ix hC
.Hm restspc
The second is a rest, which
is designated by the letter r. The third type is a "space," designated
.Ix gZ
by the letter s. Space is basically
a placeholder that takes up time, but doesn't print anything. It is useful
when a certain voice only has notes during part of the measure. It can also
be useful for specifying "pickup" measures to account for the time before
.Ix aV
the first note in the measure. For example:
.Ex 1
.\"score leftmargin=2 ; rightmargin=2
.\"music
// a pickup measure
1: 2.s;8.c;16d;
bar
1: e;g;e;c;
endbar
.Ee
.P
If all voices contain spaces, no space is actually taken up on output.
Most of the time, this will be what you want. For example,
when you are using space for a pickup, the
space is just to add up to a measure, and you don't want any actual blank space
at the beginning of the piece. Once in a while, however, you
may want space to actually be allocated on output, perhaps
to be able to allow space for some special notation. In that case,
.Ix iX
you prefix the "s" with a "u" to indicate an uncollapsible space.
For
.Hr midi.html
MIDI,
normal space is squeezed out to take no time, whereas uncollapsible space
essentially becomes a rest.
.P
If a given voice is omitted for a particular measure,
Mup normally defaults to a measure of space,
but you can make it default to something else (most commonly a measure
of rest) by setting the
.Hr param.html#emptym
emptymeas parameter.
.Hh measdur
.H 4 "Measure duration"
.P
.Ix hG
There is a special duration of "m," which means an entire measure.
It can only be used with a rest, space, or "rpt" (repeat). For example:
.Ex
1 1: mr;
1 2: ms;
.Ee
.P
A measure rest looks like a whole rest, but is centered in the measure.
.Ix hD
It should be used when an entire measure is a rest, regardless of the time
signature.
.Ix gU
However, if you want to force use of a symbol other than the whole rest
symbol, you can specify a duration before the mr, and the rest symbol for that
duration will be drawn instead.
.Ex
4mr; // use a quarter rest symbol
1/4mr; // use a quadruple whole rest symbol
2.. mr; // use a double-dotted half rest
.Ee
.P
Using "m rpt" will cause the
.Ix hE
measure repeat symbol to be printed, indicating
the measure is just like the previous measure. Measures repeats
will automatically be numbered, unless the
.Hr param.html#nummrpt
numbermrpt parameter
is set to n. If there is more than one voice, you only need to
specify the mrpt on voice 1. If you do specify other voices as well,
they must be either a mrpt or ms.
.Ex 1
.\"score leftmargin=2 ; rightmargin=2
.\"music
1: c;d;e;f;
bar
// another measure just like the first
1: m rpt;
bar
// the space between m and rpt is optional
1: mrpt;
bar
.Ee
.P
.Hm multrpt
It is also possible to specify "dbl m rpt" for a double measure repeat,
or "quad m rpt" for a quad measure repeat.
The subsequent measures that are part of a multi-measure repeat must be
either all spaces ("ms" or "mus") or not specified at all.
There must, of course, be at least two measures of music before a dbl and
at least four before a quad, as well as at least one measure after a dbl
and at least three measures after a quad.
.P
The measures associated with a mprt are not allowed to contain
changes in time signature, key, clef, transpose, addtranspose, or vscheme,
and the number of staffs cannot be reduced to eliminate the staff with the mrpt.
For the purposes of counting measures, invisbar counts just like visible ones.
Bar types of repeatstart, repeatend, or repeatboth are not allowed.
.Hh acc
.H 4 "Accidentals"
.P
Each pitch letter in a chord may be followed by up to 4 accidentals,
although typically no more than one is used. (Probably the most common uses
of more than one would be either something like n# to remind the user that the
note had had a double sharp earlier, or when using
.Hr tuning.html
non-standard tunings.)
.Ix bL
.Ix fM
The standard accidentals are:
.Hi
.DS
.He
.TS
center;
c c
c l.
\fBInput\fP \fBMeaning\fP
_
\f(CW#\fP sharp
.Ix fC
\f(CW&\fP flat
\f(CWx\fP double sharp
\f(CW&&\fP double flat
\f(CWn\fP natural
.TE
.Hi
.DE
.He
.P
Note that a double flat or double sharp counts as a single accidental,
so this is one place where the use of spaces matters: & & with a space between
is two flat accidentals, whereas && with no space between
is one double flat accidental.
It is possible to define your own custom accidentals,
which is covered in the chapter on
.Hr tuning.html
Custom Accidentals and Alternate Tunings.
The accidental(s) can be placed inside
.Ix iA
parentheses if you want them to be printed
within parentheses.
All accidentals have to be within a single set of parentheses in that case;
you can't put just a subset in parentheses.
.Hh oct
.H 4 "Octave"
.P
An octave indicator may be specified after the pitch letter
or optional accidentals.
.Ix gA
The octave can be specified in either of two ways:
absolute or relative. A number from 0 to 9 is
used to specify an absolute octave. Octaves run from C up to B. Octave 4 is
the octave starting on middle C. Octave 3 is the octave below that, etc.
.Ix dL
A relative octave is specified by one or more plus or minus signs, and
indicates that number of octaves above or below the default octave. For
example:
.Ex
c // c in the default octave
e++ // e two octaves above default octave
f#--- // f# three octaves below default octave
b&6 // b flat in octave 6
.Ee
.P
The default octave can be set using the
.Hr param.html#defoct
\&"defoct" parameter,
.Ix cU
which is described in the
.Hr param.html
\&"Parameters" section.
If that parameter is not
set, the default octave is the octave containing the note associated with
the middle line of the staff, based on the current
.Hr param.html#clef
clef.
.Ix fI
In other words, the default octaves are:
.Hi
.DS
.He
.TS
center;
c c
l c.
\fBClef\fP \fBOctave\fP
_
frenchviolin 5
8treble 5
treble 4
soprano 4
mezzosoprano 4
alto 4
8bass 4
treble8 3
tenor 3
baritone 3
bass 3
bass8 2
subbass 2
.TE
.Hi
.DE
.He
.Hh shorthnd
.H 3 "Shorthand notations"
.P
If a chord is omitted, then most of the values for the previous chord
are reused. This includes duration, pitch/rest/space, and octave, as well
as notehead size and shape (which are described in the
.Hr noteattr.html
next section).
For normal,
.Ix fM
.Ix gZ
.Ix hC
.Hr param.html#stlines
5-line staffs,
the pitches for the first chord of every measure
.Ix hG
must always be specified, since there is no previous chord.
.P
Putting all these things together, here are some examples:
.Ex 1
.\"score leftmargin=2 ; rightmargin=2 ; staffs = 2
.\"staff 1 vscheme=2o
.\"music
// Two eighth notes, each b#, followed by an eighth
// note d, eighth note e, and half note e, with the
// last 3 notes being in the next higher octave.
1 1: 8b#; ; d+; e+; 2;
// Whole note C-E-G chord in default octave
// for voice 2 of staff 1
1 2: 1ceg;
// Four quarter notes on staff 2, voice 1.
// The last is in the octave above the default octave.
2: 4g; a; b; c+;
.\"bar
.Ee
.P
For
.Hr param.html#stlines
1-line staffs,
it is never necessary to specify a pitch, since all notes
.Ix fM
go on the single staff line. You can, however, specify a pitch if you wish.
The pitch will be ignored for the purposes of printing, but will be
used for
.Hr midi.html
MIDI output.
.Ix aA
If you don't specify a pitch, it is arbitrarily set to middle C.
.P
If you have several notes in a chord, it is generally convenient to input
them in order, either top-down, or bottom-up, as you prefer. If you like to
always use a particular order, there is an alternate input mode, set via the
.Hr param.html#inputdir
noteinputdir parameter,
that may save some typing. If this is set to "up" or "down" then the octave
of each note in a chord after the first is determined relative to the
previous note in that chord. If a note letter is an octave or less from
the previous, you list it without any octave specified. Mup will then use
the next instance of that letter in the appropriate direction.
If it is farther than that,
you use plus signs (when noteinputdir=up) or minus signs
(when noteinputdir=down) to say how many octaves away it should be.
Here is an example:
.Ex 1
score
.\" leftmargin=2
.\" rightmargin=2
noteinputdir=up
music
1: ceg;ece;a-a;a-e+;
bar
1: acfc;c+c;2cgec;
bar
.Ee
.Ht Note attributes
.Hd noteattr.html
.H 3 "Note attributes"
.Ix hL
.P
There are several optional attributes that can be specified for each note.
Any or all of these may appear on any note in any order
after the
.Hr chordinp.html#letter
letter,
.Hr chordinp.html#acc
accidental,
and
.Hr chordinp.html#oct
octave specifications.
They include:
.DL
.LI
.Hr noteattr.html#small
small notehead
.LI
.Hr noteattr.html#ntie
tie
.LI
.Hr noteattr.html#nslur
slurs
.LI
.Hr noteattr.html#shaped
headshape
.LI
.Hr noteattr.html#ntag
location tag
.LE
.Hh small
.H 4 "Small notehead"
.P
A note specification can be followed by a "?"
to indicate the note is to be printed with a small notehead,
.Ix gY
rather than the normal
size. (Note: if you have several notes in a chord and want all of them to
be small,
.Hr chrdattr.html#cue
the "cue" construct, described later,
may be preferable.)
.P
Examples:
.Ex 1
.\"score leftmargin = 2 ; rightmargin = 2
.\"music
// print the "e" as a small note
1: 1c e? g;
bar
// make the second note small
1: f; ?; g; ;
bar
.Ee
.Hh ntie
.H 4 "Note ties"
.P
A "~" can be used to indicate the note is to be tied
to the note of the same
.Ix aK
.Ix fM
pitch in the following chord. That following chord need not be in the same
.Ix hG
measure, but it must contain a matching note.
(Note: if a chord with several notes is to have all the notes tied
to the following chord,
.Hr ichdattr.html#tie
the "tie" construct
described later may be preferable.)
The ~ may be preceded by the word "dotted" or "dashed" if you want
a dotted or dashed tie; otherwise a normal, solid tie is drawn.
The ~ may be followed by the word "up" or "down" to specify the
direction for the curve's bulge. If neither is specified, Mup will
determine an appropriate direction, so you only need to give a direction
if you wish to override Mup's choice.
After the aforementioned items (if any),
you may put "to voice \fIN\fP" to tie to the matching note in
voice \fIN\fP rather than in the current voice.
.Ix iJ
.P
Examples
.Ex 1
.\"score leftmargin=2 ; rightmargin = 2; time=3/4
.\"music
1: d~; 8; e~; ; f;
bar
// tie the g (which also happens
// to be a "small" note)
1: 2g+g?~; 4eg?;
bar
.Ee
.Hh nslur
.H 4 "Slurs"
.P
A note can also be followed by a list of notes to be slurred to,
enclosed in angle brackets.
.Ix cB
.Ix dX
A slur will be drawn from the note to each of the notes
listed in the angle brackets. The notes inside the brackets
.Ix fM
.Ix gA
are specified by a pitch and optional octave. No
.Hr chordinp.html#acc
accidentals
.Ix bL
are specified, even if the note to be slurred
to has an accidental. Examples:
.Ex 1
.\"score leftmargin=2 ; rightmargin=2
.\"music
// slur from c of first chord to e of second chord
1: c<e>; e; f; g;
bar
// slur from c+ of first chord to a& of second chord
// and from c+ of first chord to d&+ of second chord
1: 2cc+<ad+>; a&d&+;
bar
.Ee
.P
If there is only one note in the following chord, it isn't necessary to
explicitly state it within the angle brackets; "<>" will suffice.
.Ex 1
.\"score leftmargin=2.5 ; rightmargin=2.5
.\"music
// slur from c to d, and f to g
1: c<>; d; f<>; g;
bar
.Ee
.P
The < may be preceded by the word 'dotted' or 'dashed' if you want
a dotted or dashed slur, otherwise a normal, solid slur is drawn.
.Ix iJ
The > may be followed by the word "up" or "down" to specify the
direction for the curve's bulge. If neither is specified, Mup will
determine an appropriate direction, so you only need to give a direction
if you wish to override Mup's choice.
After the aforementioned items (if any),
you may put "to voice \fIN\fP" to slur to the matching note in
voice \fIN\fP rather than in the current voice.
.P
There are four special "slurs" which are really slides to/from an
indefinite note. They are most commonly used on
.Hr tabstaff.html
tablature staffs,
but are allowed on ordinary staffs too.
They are: </n> <\en> <n/> and <n\e> for sliding upward into the note,
downward into the note, upward out from the note, and downward out from
the note respectively. These have to be in angle brackets by themselves,
so if you want to have both one of these slides and another slur on the
same note, multiple sets of angle brackets must be used, as in
.Ex
1: 2c</n><d>;d;
.Ee
.Hh shaped
.H 4 "Head shape"
.P
Sometimes you may want to mix head shapes on a single stem.
.Ix jG
For example, you might want to use a diamond to designate a harmonic,
with other notes in the same chord being normal shape.
.Hi
There will be an entire
.He
.ig
There is an entire
..
.Hr shaped.html
section on head shapes,
so only a simple example is given here.
To make a single note have a different head shape,
use hs followed by the name of the shape in quotes.
.Ex
1: 2e e+ hs "diam";g;
.Ee
.Hh ntag
.H 4 "Note location tag"
.P
Finally, a
.Hr tags.html
\&"location tag"
.Ix bE
can be associated with a note. This would
enable you to draw things relative to the note.
A note location tag
is set by using an "=" followed by a name. The name can be either:
.DL
.LI
a single lowercase letter
.LI
an underscore followed by one or more
letters, numbers, and underscores in any combination.
.LE
.sp
The name is arbitrary, and is used as
a tag that can be referred to later. Examples:
.Ex
// associate tag p with note e&
3: 2c; e& =p g;
// associate tag _end with note f
2: 1f =_end;
.Ee
Location tags can only be used when defining a single voice.
.Ht Chord attributes
.Hd chrdattr.html
.H 3 "Chord attributes"
.Ix gW
.P
There are optional attributes that are associated with an entire chord
rather than an individual note. These are put inside square brackets
.Ix dW
before the list of notes and the time value.
There are several classes of information:
.DL
.LI
.Hr chrdattr.html#chstyle
chord style (grace, cue, diam, or xnote)
.LI
.Hr chrdattr.html#shaped
head shape
.LI
.Hr chrdattr.html#withlist
symbols to be printed with a chord
.LI
.Hr chrdattr.html#slashes
slashes
.LI
.Hr chrdattr.html#stemdir
stem direction
.LI
.Hr chrdattr.html#stemlen
stem length
.LI
.Hr chrdattr.html#pad
padding
.LI
.Hr chrdattr.html#ctag
chord location tag
.LI
.Hr chrdattr.html#hoffset
horizontal offset
.LI
.Hr chrdattr.html#dist
rest distance
.LE
.P
Each class of information is
separated from the other by a semicolon. All classes are optional, and can
.Ix hH
occur in any order.
.Hh chstyle
.H 4 "Chord style"
.P
Several chord styles can be specified.
.Hm cue
Grace note chords are designated by the word "grace," or cue note chords by "cue."
.Ix aL
.Ix bB
Grace notes can be specified as any undotted time value of eighth note or
.Ix gT
.Ix gX
shorter, but are treated as taking no time. The time value given is merely used
.Ix dH
to specify how many flags or beams to put on the grace note.
You can also specify a quarter note or longer grace note,
which will be printed as a
small, stemless note, as is used to show
.Hr tabstaff.html#prebend
a "prebend" in guitar music.
(Actually, you can force a stem if you want, by specifying a
.Hr chrdattr.html#stemlen
len, as is described later.)
Cue notes have time like regular notes, but they are printed smaller.
.Ix gY
If there are several grace notes in a row, they will be beamed automatically.
However, you cannot mix quarter (stemless) grace notes with shorter ones.
Cue notes follow the same beaming rules as regular notes.
.Ix bA
.P
It is also possible to specify "diam," or "xnote."
.Ix bS
.Ix bT
In the case of "diam," the chords will be drawn with diamond-shaped notes,
while with "xnote," the chords will be
drawn with X-shaped notes. A diamond shaped
notehead will be used for xnotes that are half note or longer.
Here are some examples:
.Ex
[grace]
.br
[xnote]
.br
[cue; xnote]
.br
[diam]
.Ee
.Hh shaped
.H 4 "Head shape"
.P
If you want to have the
noteheads in a chord
.Ix jG
use a shape other than the
normal shapes, you use hs followed by the name of the head shape in quotes.
.Hi
There will be an entire
.He
.ig
There is an entire
..
.Hr shaped.html
section on shaped notes,
so only the basics are covered here. The xnote and diam
.Hr chrdattr.html#chstyle
described above
are really just shorthands for two common head shapes.
The method using hs lets you use many other notehead styles,
.Ix cA
such as a slash, or triangle.
.Ex
1: [hs "righttri"]cf; [hs "slash"]fa;
.Ee
.P
The
.Hr shaped.html
section on shaped notes
lists all the built-in head shape names,
and explains how you can define your own.
.Hh withlist
.H 4 "Symbols to be printed with a chord"
.P
It is possible to specify one or more musical symbols or text strings to be printed with a chord.
.Ix hB
This is typically used for
things like staccato and accent marks. The word "with"
.Ix bK
.Ix bU
.Ix fZ
is followed by one or more things to print. If there are more than one, they
are separated by commas. They will be printed outwards from the notes in
the order specified.
.P
The "with" list is not allowed on space groups.
On rests, the side on which the items are printed is determined as if
the rests had a stem, so if they are not placed on the side
you want, in some cases
.Hr chrdattr.html#stemdir
forcing the "stem" direction
will produce what you want.
.P
.Ix hC
The list can include symbols from the following table:
.Hi
.DS
.He
.TS
center;
c c.
\fBSymbol\fP \fBMeaning\fP
_
\f(CW.\fP staccato
\f(CW-\fP legato
.Ix bV
\f(CW>\fP accent
\f(CW^\fP accent
.TE
.Hi
.DE
.He
.P
.Hr textstr.html
A quoted string
.Ix hB
can also be specified (e.g., "ff", "adagio", etc.).
This will be printed in the font and size specified by the
.Hr param.html#withfam
\&"withfontfamily,"
.Hr param.html#withfont
\&"withfont,"
and
.Hr param.html#withsize
\&"withsize"
parameters. Any of the
.Hr textstr.html#symlist
special music characters can be printed by using the usual convention,
e.g., \e(ferm) for a fermata.
(This is described in a
.Hr textstr.html
later section.)
However, it is usually preferable to use the printing of
.Hr textmark.html
text strings relative to beats.
.Ix dJ
.Ix hB
.Hi
This will be described in a later section.
.He
.P
Here are some examples:
.Ex
[with ., -]
[with ^, "\e(ferm)"]
[with "sfz"; cue]
.Ee
.P
If the symbols acc_hat, ferm, or wedge are used by themselves in a "with"
list item, they are handled specially. If the stem direction is such that
.Ix hI
.Ix iH
the upside-down versions of these characters should be used, the upside-down
version will be used.
.P
At the end of the list, you can specify "above" or "below" to force
a side. Otherwise Mup will normally place them on the notehead side, unless
there is more than one voice.
.Ex
[with . below; with sfz above]
.Ee
.Hh slashes
.H 4 "Slashes"
.P
Diagonal lines to be drawn through the stem of the group
.Ix cA
can be specified using
.Ex
slash \fIN\fP
.Ee
where \fIN\fP is the number of slashes to draw. In the case of
.Hr chrdattr.html#chstyle
grace notes,
.Ix aL
\fIN\fP can only be 1, which will produce a grace note with a slash through it.
In the case of other notes, \fIN\fP can be 1 or greater, and is used to
specify tremolo or repetition of the note group. Examples:
.Ex
[slash 2]
[grace; slash 1]
.Ee
.Hh stemdir
.H 4 "Stem direction"
.P
.Ix hI
.Ix iH
The chord stem direction can be specified as "up" or "down".
Normally Mup chooses the stem direction, but once in a while you
may want to override its choice. There are some restrictions.
All chords beamed together and the pair of chords in an
.Hr ichdattr.html#alt
alternation pair
(described later)
must have the same stem direction.
Examples:
.Ex
[up]
[down]
.Ee
.P
For voice 3, stem direction works a little differently. By default, the
stem direction for voice 3 is up,
but for voice 3 on any given staff, when you specify a stem
direction, that direction will remain in effect until explicitly changed.
Thus, for example, if you want all voice 3 stems on a given staff
in an entire song to
be down, you only need to specify "[down]" on the first chord.
Grace notes on voice 3, however, are always stem up unless explicitly forced
down.
.Hh stemlen
.H 4 "Stem length"
.P
Normally, Mup sets stem lengths as appropriate, but sometimes you might
want to make a stem longer or shorter than normal. This is done with
.Ix iB
the keyword "len" followed by a length in stepsizes.
Some examples:
.Ex
[ len 14 ]
[ len 7; up ]
.Ee
.P
You cannot specify stem length on chords inside of beams.
The len can be set to 0 to produce a notehead with no stem at all.
.P
There is a
.Hr param.html#stemlen
stemlen parameter
that can be used to set the default stem length.
If you don't want any stems, setting that parameter to 0 is more
convenient than setting len to 0 on each chord individually.
.P
There are certain circumstances in which Mup will normally shorten stems
slightly on beamed chords or on chords whose stems protrude from the staff.
There is a
.Hr param.html#sshorten
stemshorten parameter
that allows you to control how Mup handles those cases.
.Hh pad
.H 4 "Padding"
.P
Sometimes it may be desirable to space notes somewhat differently than
.Ix gZ
Mup would normally place them.
It is possible to specify "padding" before any note group.
.Ix bD
This is done by specifying the word "pad" followed
by a number of stepsizes of white space padding to add before the chord.
.Ix fO
The number can be fractional, as in 0.5 or 2.25.
For example:
.Ex
[ pad 2.5 ]
.Ee
.P
The padding can also be negative. Padding affects the minimum amount of
width allocated to a chord, so you can use positive padding values to
force additional room in front of a chord, or negative padding to allow
things closer together.
.Hh ctag
.H 4 "Chord location tag"
.P
It is possible to set a location tag
.Ix bE
which is
associated with an entire chord
rather than an individual note. This
.Hr tags.html
tag
is specified like
.Hr noteattr.html#ntag
location tags for notes,
with an "=" followed by a name, but is inside
the square brackets rather than after a note.
.Ex
3: 2cf; [=h] egc+;
1: [cue; with >; =_ch] fa;
.Ee
.Hh hoffset
.H 4 "Horizontal offset"
.P
A horizontal offset can be applied to a chord by specifying "ho" followed
by a number of stepsizes. The number can be positive or negative,
and can include a fractional part. A positive number will cause the chord to
be placed that far right of where the horizontal center of the chord
would normally be; a negative number will place it that far to the left.
It is also possible to simply specify a "+" or "-" which says to place the
chord to the right or left,
as close as possible without running into something.
.P
A horizontal offset is most commonly used on the third voice of a staff,
although it can be used on other voices too.
By default, Mup places third
voice chords as close as it thinks is safe for avoiding
most collisions. Sometimes it may actually be okay visually
to place the chord a little closer than that,
or perhaps there is a better "nook" to tuck it into on the left side.
By specifying a horizontal offset, you can place chords anywhere you want.
Mup makes no checks to avoid collisions when you specify a horizontal
offset, so this attribute needs to be used with some care.
.P
The ho can be used on grace groups, and has generally similar effects.
It only has an effect if there are multiple voices having grace notes at
the same point in time, and specifies how to move the grace note
relative to where it would be if no ho had been specified.
.P
Here is an example of the use of horizontal offset and stem direction
on voice 3.
.Ex 1
score
vscheme=3f
.\"rightmargin=2
.\"leftmargin=2
music
1 1: c+;b;a;c+;
1 2: e;d;e;f;
1 3: [ho+1] g; [ho-5.2; down]; [ho-] f; [ho+; up] a;
bar
.Ee
.Hh dist
.H 4 "Rest distance"
.P
Usually Mup's placement of rests is satisfactory, but once in a while
you might want to force a rest to be placed a little higher or lower
than Mup would place it. You can specify a "dist" which is the number
of stepsizes from the center of the staff to place the rest symbol,
with positive numbers being above the center and negative numbers below.
If the staff is
.Hr param.html#xpose
transposed,
the placement of the rest symbol will be adjusted accordingly.
.Ex 1
.\"score
.\" leftmargin=2
.\" rightmargin=2
.\"music
.\"
// The first and last rests are in normal position.
// The second is forced higher, the third is forced lower.
1: r; [dist 6]; [dist -4]; r;
bar
.Ee
.P
Note that the
.Hr param.html#alignrst
alignrests parameter
can also be used to affect how rests are placed.
.Hh rptattr
.H 4 "Repeated attributes"
.P
If two or more chords in a row have the same bracketed attributes,
.Ix dW
there are two shorthand notations. Specifying an empty set of brackets "[]"
means to use the same attributes as were specified on the previous chord.
The previous chord must be within the same measure.
.Ix hG
Some examples:
.Ex 1
.\"score leftmargin=2 ; rightmargin=2
.\"music
1: [cue] 4c;[]d;[grace; slash 1] 8f;2e;
bar
1: d; [with .,-]d; []e; []f;
bar
.Ee
.P
The other shorthand is to put 3 dots after a set of bracketed items.
This means to repeat the same bracketed items on all chords for the
rest of the measure, or until a new set of bracketed items is specified.
Items in a "with" list are omitted on rests, since usually they are things
that don't make sense for rests.
If you wish to cancel this before the end of a measure but without
specifying a new set, the special set "[-]" can be used.
.Ex 1
.\"score leftmargin=2 ; rightmargin=2
.\"music
// put staccato marks on all notes
1: [with .]... c; d; e; g;
bar
// put several cue size notes in the middle of a measure
1: c; [cue]... 8d; f; e; g; [-] 4c+;
bar
.Ee
.P
You can use more than one set of brackets on a single chord.
For example "[len 5][down]" and "[len 5;down]" are equivalent.
However, [-] can only be used by itself, and if you want to use [] along
with another bracketed set of items (to duplicate the items on the previous
chord plus add some more), the empty [] needs to be first, before the
other set of items.
.Ht Mid-measure parameter changes
.Hd midmeas.html
.H 3 "Mid-measure parameter changes"
.P
The group attributes can optionally be preceded by mid-measure
parameter changes.
.Ix jF
This is not used very often, but the most common
use is to change the
.Hr param.html#clef
clef
.Ix fI
in the middle of a measure. There are only a few
other parameters that can be changed inside a measure:
.Hr param.html#alignrst
alignrests,
.Hr param.html#defoct
defoct,
.Ix cU
.Hr param.html#release
release,
.Ix jE
and
.Hr param.html#vcombine
vcombine.
The change is enclosed in double angle brackets.
After the opening angle bracket is the
.Hr contexts.html
context
to which the changes apply (score, staff, or voice),
followed by one or more parameter changes.
.Ex 1
.\" score
.\" leftmargin=1.5
.\" rightmargin=1.5
.\" music
1: c; e; <<score clef=bass>> 2g;
bar
.Ee
If there is more than one parameter listed, they are separated by semicolons.
.Ex
<< staff clef = tenor ; defoct = 4 >>
.Ee
.P
If you wish to change parameters in more than one context, multiple
angle-bracketed items can be given:
.Ex
2-3 2: 2c; <<score release=100>><<staff clef=alto>><<voice defoct=3>> c;
.Ee
.P
If you specify "staff" or "voice" context, the specific staff(s) or voice(s)
to which the changes apply is based on which staff(s) or voice(s)
are being described on the input line. So in the example above,
the clef is changed to alto on staffs 2 and 3, and the defoct is
changed to 3 for voice 2 on both of those staffs. The release change
applies to the entire score.
.Ht Cross-staff stems
.Hd crossst.html
.H 3 "Cross-staff stems"
.P
Sometimes, on music for instruments that use more than one staff,
.Ix jI
you may want some of the notes of a chord to be printed on
the staff above or below, rather than using a lot of ledger lines.
You can specify this by putting the word "with" before the notes that
are to go on the other staff, and following those notes with "above" or "below"
to specify which is the other staff.
For example:
.Ex 1
score
.\" leftmargin=1.5
.\" rightmargin=1.5
.\" staffpad=-8
staffs=2
staff 2
clef=bass
music
1: 1e+g+c++;
2: cc+; ee+; g with g+ above; with c+c++ above;
bar
1: cc+; g with g- below; e with e- below; with cc- below;
2: 1c-e-g-;
bar
.Ee
.P
The notes for the other staff have to follow the notes on the normal staff in
the input. As is shown in the example,
it is possible to have \fIall\fR the notes on the "other" staff, if you wish.
The octave is specified as if the note were on the normal staff;
Mup will automatically adjust appropriately for the other staff's clef.
Once in a while, Mup may not be able to figure out how to completely
avoid colliding with other notes; in that case you can use the
.Hr chrdattr.html#hoffset
horizontal offset
that was described earlier.
.P
For
.Hr midi.html
MIDI
purposes, only the normal staff's key signature and accidentals are
considered, so if the other staff has a different
.Hr param.html#key
key signature
or accidentals that should really apply to these notes, you will have
to supply accidentals explicitly.
.Ht Inter-chord attributes
.Hd ichdattr.html
.H 3 "Inter-chord attributes"
.P
In addition to the
.Hr chrdattr.html
chord attributes
that can appear in the square brackets
before time and pitch information, there are a few attributes that are
.Ix fM
specified after the time and pitch information. These are attributes that
start or end on the chord but also affect other chords. There are several
such attributes:
.DL
.LI
.Hr ichdattr.html#tie
chord ties
.LI
.Hr ichdattr.html#slur
chord slurs
.LI
.Hr ichdattr.html#custbeam
custom beaming
.LI
.Hr ichdattr.html#crossbm
cross-staff beams
.LI
.Hr ichdattr.html#alt
alternation
.LI
.Hr ichdattr.html#slope
slope
.LI
.Hr ichdattr.html#phrase
phrase
.LE
.P
If several of these are specified on a single chord, they may be in any
order, separated by commas.
.Hh tie
.H 4 "Chord ties"
.P
If all notes in a chord are to be tied to the following chord,
the keyword "tie"
.Ix aK
can be placed at the end of the chord. As was mentioned earlier,
.Hr noteattr.html#ntie
individual notes can be tied using a "~" symbol.
Thus:
.Ex
ceg tie;
.Ee
is equivalent to
.Ex
c~e~g~;
.Ee
The word "tie" may be preceded by the word "dotted" or "dashed" to
produce dotted or dashed ties. Otherwise, normal, solid ties are drawn.
.Ix iJ
The word "tie" may be followed by the word "up" or "down" to specify the
direction of each curve's bulge. If neither is specified, Mup will
determine an appropriate direction, so you only need to give a direction
if you wish to override Mup's choice.
After the aforementioned items (if any),
you may put "to voice \fIN\fP" to tie to the chord in
voice \fIN\fP rather than in the current voice.
.P
You can also produce the effect of tying chords by using additive time
values. For example, the following lines produce the same output:
.Ex
1: 2ceg tie;8;;4; // explicit tie
1: 2+8ceg;8;4; // tie implied by added time values
.Ee
.Hh slur
.H 4 "Chord slurs"
.P
The keyword "slur" can be placed at the end of a chord to indicate
.Ix cB
that each note in the chord is to be slurred to the corresponding
note in the following chord. In other words, the top note of the chord
is slurred to the top note of the following chord, the second from the
top note in the first chord to the second from the top note in the
second chord, etc.
Thus the following 2 measures give equivalent output:
.Ex 1
.\"score leftmargin=3; rightmargin=3
.\" label=" "
.\"music
1: 2f<d> a<b> c+<d+>; dbd+;
bar
1: 2fac+ slur; dbd+;
bar
.Ee
.P
The chord with the "slur" keyword
and the chord that follows it must have the same number of notes.
The word "slur" may be preceded by the word "dotted" or "dashed" to
produce dotted or dashed slurs. Otherwise, normal, solid slurs are drawn.
.Ix iJ
The word "slur" may be followed by the word "up" or "down" to specify the
direction of each curve's bulge. If neither is specified, Mup will
determine an appropriate direction, so you only need to give a direction
if you wish to override Mup's choice.
After the aforementioned items (if any),
you may put "to voice \fIN\fP" to slur to the chord in
voice \fIN\fP rather than in the current voice.
.Hh custbeam
.H 4 "Custom beaming"
.P
.Ix dI
Normally, notes of eighth or shorter duration are automatically beamed
.Ix fP
according to the specification of
.Hr param.html#beamstyl
the "beamstyle" parameter.
.Ix dE
Occasionally, you may wish to
override the default beaming style for a particular situation.
.Ix bA
This is done using the "bm" and "ebm" keywords. The "bm" (short for "beam")
is placed at the end of the chord that is the first to be beamed.
The "ebm" (short for "end beam") is placed at the end of the last chord.
Both chords must be in the same measure. If there is any custom beaming
.Ix hG
specified for a given voice in a given measure, only
what you explicitly specify to be beamed will be beamed.
An example:
.Ex 1
.\"score leftmargin=2; rightmargin=2
.\"music
// The d, e, and f will be beamed together,
// but other 8th notes will not be.
1: 4c; 8; d bm; e; f ebm; g; a;
bar
// First two chords beamed together.
// Second chord is tied to third chord.
1: 8.fa bm; 16gc+ tie, ebm; 2; 8a; g;
bar
.Ee
.P
In the absence of custom beaming, Mup will beam notes together
using the
.Hr param.html#beamstyl
beamstyle parameter,
.Ix dE
if that parameter is set.
The beamstyle parameter is a list of time values that add up to
a measure. Each time value tells how many chords to beam together.
For example, a 2 means to beam a half note worth of chords together,
whereas 1.. would indicate that a double dotted whole note worth of
chords should be beamed together.
Here are some examples of how the beamstyle parameter works.
.Ex 1
.\"score leftmargin=1.5; rightmargin=1.5
.\"scoresep=10,14
.\" label=" "
// beam each quarter note worth of notes together,
// breaking the beaming at each quarter note boundary
score beamstyle = 4,4,4,4
music
1: 8c;d;e;f;g;a;b;c+;
bar
1: 8c;d;4e;f;8g;c;
bar
// beam each half note worth of notes together,
// breaking the beaming at each half note boundary
score beamstyle = 2,2
music
1: 8c;d;e;f;g;a;b;c+;
bar
// the middle two eighth notes will not be beamed together,
// because they are on opposite sides of the half note boundary
1: 8c;4d;8e;f;4g;8c;
bar
// beam each whole note worth of notes together
score beamstyle = 1
music
1: 8c;d;e;f;g;a;b;c+;
bar
1: 8c;4d;8e;f;4g;8c;
bar
// in 9/8 time, beam each dotted quarter note worth of notes together
score time = 9/8 ; beamstyle = 4., 4., 4.
music
1: 8c;d;e;d;e;f;e;f;g;
bar
// the eighth notes will not be beamed together,
// because they are on opposite sides of the dotted quarter boundary
1: 4.c;4d;8e;8f;4g;
bar
// in each measure, beam the first dotted half worth of notes together,
// then beam the remaining dotted quarter worth of notes together
score beamstyle = 2., 4.
music
1: 8c;d;e;d;e;f;e;f;g;
bar
// in each measure, beam the first dotted quarter worth of notes together
// then beam the remaining dotted half worth of notes together
score beamstyle = 4., 2.;
music
1: 8c;d;e;d;e;f;e;f;g;
bar
.Ee
.P
It is possible to apply the automatic beaming to just a portion of a measure,
by specifying abm ("automatic beaming") on the first group
where it is to be applied, and eabm ("end automatic beaming")
on the last such group.
.Ex 1
.\"score leftmargin=1; rightmargin=1
score beamstyle=2,2
music
1: 8c;d;e;f;g abm;a;b;c+ eabm;
bar
1: 8c abm;d;e;f eabm;g;a;b bm;c+ ebm;
bar
.Ee
.P
The value of the beamstyle parameter is remembered for
any later changes back to the same time signature.
For example, suppose you set
.Ex
time=4/4
beamstyle=4,4,4,4
.Ee
then later in the piece switched to
.Ex
time=3/4
beamstyle=4,4,4
.Ee
Then any time you went back to 4/4 or 3/4, the beamstyle you had set for that
time signature would automatically be set as well.
You could, of course, override the automatic setting
with a new beamstyle if you wished.
.P
Normally Mup will break beams whenever it encounters a rest or space,
but if you specify an "r" at the end of the
beamstyle parameter, it will beam across rests
of eighth note or shorter duration. Similarly, specifying an "s" at the
end of the beamstyle parameter will cause it to beam across spaces of
eighth note or shorter. Specifying both (in either order) will result
in beaming across both. Mup will also beam across eighth note or
shorter rests or spaces inside of custom beams.
.P
Sometimes, if there are many short notes beamed together, you may wish to
subdivide the beams into smaller groupings, where the outer, or primary
beam remains unbroken, but the inner, or secondary beams are broken
periodically. When using custom beaming, this is specified by "esbm"
("end subbeam" or "end secondary beam")
on the chord after which you want the break to occur.
When using beamstyle, parentheses are used to indicate what sets of
secondary beams are to be included in a given outer beam.
.Ex 1
score
.\"leftmargin=1.5
.\"rightmargin=1.5
.\"scoresep=10,14
beamstyle=(4,4),(4,4)
music
// use the beamstyle parameter
1: 16c;d;e;f; g;a;b;c+; c+;b;a;g; 32f;e;f;e;d;c;d;c;
bar
// use custom beaming
1: 16c bm;d;e;f;g;a esbm;b;c+;c+;b;a;g esbm;f;e;d;c ebm;
bar
.Ee
.Hh crossbm
.H 4 "Cross-staff beams"
.P
In keyboard music,
sometimes notes on adjacent staffs are beamed together.
.Ix iC
Mup will do this with a variation on
.Hr ichdattr.html#custbeam
custom beaming.
A bm and ebm must be specified on both staffs, and in each case the
bm is followed by a qualifier:
on the first of the two staffs, "bm with staff below" must
be specified, while on the second staff you use "bm with staff above".
For every point in time for the duration of the beam, one staff
must have a chord with notes in it, and the other staff must have
a space chord. (This is somewhat different than ordinary,
non-cross-staff beams controlled by the
.Hr param.html#beamstyl
beamstyle parameter,
where spaces are not allowed unless beaming across spaces
is specifically requested.)
The two "bm" marks must occur at the same time in the
measure. Similarly, the two "ebm" marks must
occur at the same time in each staff.
Grouping subbeams using "esbm" is not supported on cross-staff beams.
.P
Some examples:
.Ex 1
.\" score staffs=2
.\" leftmargin=1.5
.\" rightmargin=1.5
.\" staff 2 clef=bass
.\" music
1: 8f bm with staff below; a; 4s ebm; 4s bm with staff below; 8b; d ebm;
2: 4s bm with staff above; 8a; b ebm; b bm with staff above; d; 4s ebm;
bar
.Ee
.P
Normally the beam will be drawn between the staffs, but
you can force the beam to be above or below all the notes by specifying a
.Hr chrdattr.html#stemdir
stem direction.
.Ix iH
You can also adjust the appearance of the beam by giving
.Hr chrdattr.html#stemlen
stems lengths
for the first and last chords in the beam.
.Ex 1
.\" score staffs=2
.\" leftmargin=1.5
.\" rightmargin=1.5
.\" staff 2 clef=bass
.\" music
1: [up]8f bm with staff below;a;4s ebm;4s bm with staff below;8b;[len 11]d ebm;
2: 4s bm with staff above;8a;b ebm;[down;len 14]b bm with staff above;d;4s ebm;
bar
.Ee
.P
If a cross-staff beam includes
.Hr tuplets.html
tuplets,
the tuplet numbers will not
be printed. You would have to print them yourself using either
.Hr prnttext.html
a "print" statement
or
.Hr stuff.html
a "boldital" statement.
.P
It is possible for cross-staff beams to collide with other items, such as
.Hr stuff.html
dynamic marks.
In these cases, you may need to move the other items. Another
thing you might try is
.Hr chrdattr.html#stemlen
specifying stem lengths
to alter where the beams get placed, or
.Hr prnttext.html
printing
a blank string between the staffs to cause them to get placed further apart.
If you specify a
.Hr ichdattr.html#slope
slope,
you have to specify it on the staff having notes in the first chord,
not the staff with space.
.Hr chrdattr.html#slashes
Slashes
are not allowed on cross-staff beams.
.P
Mup doesn't directly allow cross-staff grace note beams.
However, you may be able simulate the effect by using cue note chords
along with invisible time signature changes and possibly invisible bar lines.
See the
.Hr invisbar.html
section on "Special uses of invisbar"
for more details.
.P
You may want to also look at the section on
.Hr crossst.html
cross-staff stems,
for an alternate way to handles some cases where you might
use cross-staff beams.
.Hh alt
.H 4 "Alternation"
.P
Alternation pairs
.Ix aZ
can be specified using "alt \fIN\fP" where \fIN\fP
is a number. An alternation
pair is two chords that are to be played alternately in quick succession
but are not written out as such. This is shown by drawing \fIN\fP beams
between the stems of the chords. The note value you specify for each
.Ix hI
chord must be the same, and the time value of each must equal the time
.Ix gT
taken by the pair. For example, if the pair takes up the time of a half
note, each chord would be a half note.
Here is an example:
.Ex 1
.\"score leftmargin=2 ; rightmargin=2
.\"music
// Alternate between c and c an octave
// higher. Total time taken is that of
// a half note. Two "beam-like" lines
// will be drawn to show the alternation.
1: 2c alt 2; 2c+;2g;
bar
.Ee
.P
Alternation is not allowed on cross-staff beams.
.Hh slope
.H 4 "Slope"
.P
On the first chord of a set of chords that are beamed together,
you can specify a
.Ix jJ
beam angle from -45 to 45 degrees.
This will override whatever angle Mup would have used.
.Ex 1
.\" score time=3/4 ; beamstyle=4,4,4
.\" leftmargin=2 ; rightmargin = 2
.\" music
1: 8g slope 11; b; g slope 0; b; g slope -5.75; b;
bar
.Ee
.Hh phrase
.H 4 "Phrase marks"
.Ix fJ
.P
Phrase marks
can be specified by putting "ph" on the chord where you want the phrase
to begin, and "eph" on the chord where you want it to end.
The ph can optionally be followed by "above" or "below"
to specify the side for the phrase mark.
The "ph" and its matching "eph do not have to be in the same measure.
There is also an alternate way to specify phrase marks,
described in the section on
.Hr phrase.html
Tempo, Dynamic Marks, Ornaments, etc.
.Ht Tuplets
.Hd tuplets.html
.H 3 "Tuplets"
.P
Tuplets are specified by giving a list of chords within curly braces.
.Ix aX
.Ix dV
The ending brace is optionally followed by a side ("above" or "below").
.Ix bJ
.Ix dL
This is followed by a number or pair of numbers, and a semicolon.
.P
The "side" tells Mup whether to print the tuplet number and bracket above
or below the chords. It only applies on voice 1 or 2
when the other voice (1 or 2) is nonexistent or a space.
If there are at least two voices, the number and bracket
will always be put above on voice 1 and below on voice 2.
You can always force the side on voice 3.
If you don't specify a side for a tuplet,
Mup will choose the side that seems best.
.P
.Ix hH
The first number is the number that should be printed with the tuplet.
If it is followed by an "n," the number (and bracket) will not actually be
.Ix dW
printed.
If it is followed by a "y," the number and bracket will always be printed,
unless there is only a single chord in the tuplet, in which case only
the number will be printed.
If it is followed by "num," the number will always be printed,
but the bracket will never be printed.
If none of those modifiers are specified,
the number will always be printed, but
the bracket will be omitted in cases where all the notes in the tuplet
are beamed together and the beam does not include any notes not in the tuplet.
.P
The second number, if any, is separated from the first by a comma,
and tells the time unit that the tuplet is to
.Ix gT
take up. This number can be dotted if necessary.
It can also be a time expression, like 2+8,
although that is very rarely likely to be useful.
.Ix gX
If no second number is given, the default is to fit in the next shorter
un-dotted note. For example, three eighth notes would be fitted into
the time of a quarter note, or five eighth notes would be fitted into the
time of a half note.
.P
Occasionally in music, as a shorthand,
a single note or chord is printed with a tuplet number to
indicate the note or chord is to be repeated several times as a tuplet.
.Ix dZ
.Ix hL
Mup will allow this; simply use a tuplet with only one chord, and add
one or more
.Hr chrdattr.html#slashes
slashes.
.Ix cA
.P
The final item that can optionally be specified is the word "slope," followed
by an angle in degrees, for the the angle of the tuplet bracket, if any. If
that is omitted, the angle is calculated based on the
.Hr param.html#tupslope
tupletslope parameter.
.P
Nested tuplets are not allowed.
.P
Here are some examples of tuplets:
.Ex 1
.\"score leftmargin=1.5 ; rightmargin=1.5 ; time=2/4 ; beamstyle=2
.\"music
// This has a triplet, where 3 eighth
// notes take as much time as a
// normal quarter note.
1: { 8ce; df; eg;}3; 4fa;
bar
// This has a dublet, in which 2 quarter notes
// take the time of a normal dotted quarter
1: { 4f; g; } 2, 4.;8a;
bar
// A quarter note and eighth note that
// make up a triplet the length of a
// normal quarter note,
// with the 3 printed above the notes
1: { 4c+; 8b; } above 3; 4c+;
bar
// A septuplet in the time of a half note
// with the "7" printed below the notes
1: { 8c; b-; c; e; d; f; a; } below 7;
bar
// A single chord tuplet
1: { [slash 1] 4.ceg;}3; 4;
bar
// Forcing a tuplet bracket to be flat
1: {g-;c+;a+;}3 slope 0;
bar
.Ee
.Ht Chord-at-a-time input style
.Hd altinp.html
.H 2 "Chord-at-a-time input style
.P
There is an alternate input style, in which you enter music
.Ix gW
a chord-at-a-time, rather than a voice-at-a-time. In this style, the
specification before the colon gives one or more patterns that tells
.Ix iV
how to map notes to staffs and voices.
.P
Suppose you want to print some
music in a style common for many traditional hymns:
it is to be printed on two staffs, each staff will always have
exactly two notes, and the rhythm is exactly the same for all voices.
With chord-at-a-time input, you specify, for each note in a chord,
which staff and voice to map that note. Since there are four notes in
each chord, there will be four mappings listed. You want the bottom
two notes to get mapped to staff 2, and the top two notes to staff 1.
This is shown as
.Ex
// Bass to staff 2 voice 1
// | Tenor to staff 2 voice 1
// | | Alto to staff 1 voice 1
// | | | Soprano to staff 1 voice 1
[ 2 1; 2 1; 1 1; 1 1 ]
.Ee
Each item in the semicolon-separated list tells how to map one note.
So the first note in each chord will get mapped to staff 2 voice 1.
The second note in each chord will also get mapped to staff 2 voice 1.
The third and fourth notes will get mapped to staff 1 voice 1.
.P
Since voice 1 is, as always, the default, this could be written more
compactly as just:
.Ex
[ 2; 2; 1; 1 ]
.Ee
If you wanted to input notes from top to bottom instead
(in soprano-alto-tenor-bass order, rather than bass-tenor-alto-soprano order),
you could use:
.Ex
// Soprano
// Alto
// Tenor
// Bass
[ 1; 1; 2; 2 ]
.Ee
If you wanted to use two separate voices on each staff (going
back to bottom-to-top order), you could specify:
.Ex
// Bass to staff 2 voice 2
// | Tenor to staff 2 voice 1
// | | Alto to staff 1 voice 2
// | | | Soprano to staff 1 voice 1
[ 2 2; 2 1; 1 2; 1 1 ]
.Ee
.P
Now let's put these mappings with music data.
.Ex 1
score
.\" leftmargin=2
.\" rightmargin=2
staffs=2
vscheme=2f
staff 2
clef=bass
music
[ 2; 2; 1; 1 ] : facf;dgfb;2cgec+;
bar
[ 1 1; 1 2; 2 1; 2 2 ] : fcaf;bfgd;2c+egc;
bar
.Ee
In the first measure, the first two notes listed in each chord are mapped
to staff 2, voice 1, while the third and fourth notes listed in each chord
are mapped to staff 1 voice 1. In the second measure, two voices are
used and notes are entered in descending order. Note that each note takes
on the correct default octave for whichever staff it is mapped to.
.P
It is also possible to use rests or spaces for some of the voices.
.Ex 1
score
.\" leftmargin=1.5
.\" rightmargin=1.5
key=3&
vscheme=2f
music
[ 1 2; 1 1 ]: rb; eg; ca; gr;
bar
[ 1 2; 1 1 ]: er; sr; 8sf; se; 4sg;
bar
.Ee
.P
Chord attributes and interchord attributes (like tie, slur, xnote,
len, and alt) can be specified just like
for voice-at-a-time input. Note attributes (like ? and ~) apply to
the note wherever it gets mapped, and items that apply to the chord as
a whole will be applied to all the notes.
.Ex 1
.\"score
.\" leftmargin=2
.\" rightmargin=2
.\" vscheme=2f
.\"music
.\"
[1 2; 1 1] : [cue; xnote; len 6] b-e; [with > ] ce& slur; dg~; c?g;
.\"bar
.Ee
.P
It is possible to map a note to more than one place by using ranges,
and/or by giving a list of staffs and voices,
separated by ampersands. This may be useful,
for example, if several voices are in unison.
In the next example, the first note in each chord will be mapped to voice
1 of staffs 1 through 3, as well as to voice 2 of staff 1, while the
second note in each chord will be mapped to voice 2 of staffs 2 and 3.
.Ex 1
.\"score
.\" rightmargin=2
.\" leftmargin=2
.\" staffs=3
.\" vscheme=2f
.\"music
[ 1-3 1 & 1 2; 2-3 2 ] : ec;fd;ge;af;
.\"bar
.Ee
.P
It is also possible to specify more than one bracketed mapping.
Each must include a mapping for a different number of notes.
So, for example, if some chords in a measure have two notes and
others have three, you can define two maps: one for two notes,
and one for three. The example below demonstrates placing alto
and soprano as two voices on one staff, but sometimes the alto
part splits.
.Ex 1
.\"score
.\" rightmargin=2
.\" leftmargin=2
.\" vscheme=2f
.\"music
// For chords with two notes,
// map the first to staff 1 voice 2 (alto),
// and the second to staff 1 voice 1 (soprano).
// For chords with three notes,
// map the first two notes to staff 1 voice 2
// (first and second alto part),
// and the third to staff 1 voice 1 (soprano).
[ 1 2; 1 1 ] [ 1 2; 1 2; 1 1 ]: cec+;df;eg;a-fc+;
.\"bar
.Ee
If mappings of different chords need to vary by something other than
the number of notes in the chord, then you will have to use
the voice-at-a-time input style.
.P
Since the mapping specifications can get rather complex,
and they may be used many times during a song,
it is usually best to define
.Hr macros.html
macros
for them, and possibly even put the macro definitions in
.Hr include.html
an "include" file.
.Hi
Macros and include files are described in a later section.
.He
.P
You can use the different input styles in different measures of a single
song, and use different mappings in different measures.
You can even mix the two input styles within a measure,
but a given staff/voice
can only appear on one line of input per measure. So, for example,
you could choose to input staffs 1 and 2 of a song in chord-at-a-time
input style, and staff 3 in voice-at-a-time style.
The
.Hr param.html#inputdir
noteinputdir parameter
is ignored on chord-at-a-time input.
Location tags cannot be used with chord-at-a-time input, since often that
would be ambiguous.
.Ht Bar Lines
.Hd bars.html
.H 2 "Bar lines"
.P
.Ix hG
Each measure must be ended with a "bar" of some kind. There are several kinds:
.Ix gG
.Hi
.DS
.He
.TS
center;
c c
l l.
\fBKeyword\fP \fBMeaning\fP
_
bar ordinary bar line
dblbar double bar
repeatstart beginning of repeated section
.Ix dZ
repeatboth end of one repeated section and beginning of another
repeatend end of repeated section
endbar heavy double bar line used at end of song
.Ix fH
invisbar no bar line printed
restart end staffs and begin anew
.TE
.Hi
.DE
.He
.P
In addition, the bar and dblbar types can be preceded
.Ix fF
.Ix fG
by the word "dashed" or "dotted" to produce dashed or dotted bar lines.
.P
.Ex 1
.\"score leftmargin=2;rightmargin=2
.\" label=" "
.\"music
1: mr;
bar
1: mr;
dblbar
1: mr;
dashed bar
1: mr;
dotted dblbar
1: mr;
repeatstart
1: mr;
repeatboth
1: mr;
repeatend
1: mr;
endbar
.Ee
.P
When a repeatstart would end up at the end of a score,
it will automatically get moved to the beginning of the following score.
In that case, it isn't clear what kind of bar line you would like to
have put at the end of the original score. By default, Mup will use
an ordinary bar, but in some cases\(emlike if the repeatstart begins
a new section, or there is also a key change\(emyou might want to have
a dblbar instead. You can get a dblbar there by specifying dblbar in
parentheses before the repeatstart:
.Ex
(dblbar) repeatstart
.Ee
Actually, you are allowed to specify any bar type in the parentheses,
including dashed or dotted types,
but dblbar or possibly invisbar are probably the only ones likely to be useful.
If the repeatstart ends up in the middle of a score, so that it doesn't
need to get moved to the beginning of the next score, the parenthesized
bar type is not needed, so it is just ignored.
.P
There is a
.Hr param.html#brktrpts
bracketrepeats parameter
that can be set that will cause Mup to draw brackets around repeated sections,
to make them more obvious to the performer, which may be helpful when
playing in dimly lit areas.
.P
Sometimes music is printed without bar lines. The "invisbar" can be used in
this case, to fulfill Mup's requirement to specify some sort of bar after
every measure without actually printing bar lines.
.P
.Hm restart
The restart is a special kind of bar.
.Ix iS
It follows immediately after another
bar line without any intervening music data. (That is, you can't have
any notes. You can use score or staff context things, like changing time or
key signature.) It would be most commonly used for something like a short coda.
.Ex 1
score
.\" leftmargin=1.5
.\" rightmargin=1.5
staffs=2
brace=1-2
staff 2
clef=bass
music
1-2: c;d;e;f;
rom above 1: 3 "D.C. al Coda";
dblbar
// The restart follows a bar
// without any music data in between.
restart
rom above 1: 1 "Coda";
1-2: f;e;d;c;
endbar
.Ee
.P
There are several optional directives that can follow the bar line keyword.
They can be specified in any order and are described below.
.Hh bpad
.H 3 "Bar line padding"
.P
One optional directive is padding.
.Ix bD
It can be used to force Mup to place extra white space to
.Ix gZ
the left of the bar line. It is specified by the keyword "pad" followed
.Ix fO
by a number of stepsizes of padding to add. For example:
.Ex
dblbar pad 3
.Ee
would add 3 stepsizes of padding.
One possible use would be if you wanted a different amount of gap on a restart
than what Mup uses by default:
.Ex
restart pad 10
.Ee
.Hh btag
.H 3 "Bar line location tag"
.P
It is also possible to associate a
.Hr tags.html
location tag
.Ix bE
with a bar line.
For example:
.Ex
// Associate tag "_bar6" with bar line
bar =_bar6
// Do double bar with an extra stepsize of
// padding, and associate tag "q"
// with the bar line
dblbar pad 1 =q
.Ee
.fi
.ad
.P
The y coordinate of a bar line is not very useful. Special rules apply if
a bar line happens to be placed at the end of a score. Any locations taken
.Ix hJ
relative to the bar that would be to the right of the bar are treated as
if the bar line were at the beginning of the following score,
just beyond the clef and time and key signatures, if any.
.Ix cG
.Ix fI
.Ix gU
.Hh endings
.H 3 Endings
.P
First and second endings, etc. can be designated at bar lines.
.Ix aR
This is done with the keyword "ending," followed by a
quoted string to use as the label for the ending that should begin at the
.Ix dP
.Ix hB
bar line. An ending will span bars until either another ending is specified,
the piece ends, or the
special keyword "endending" is used. Examples:
.Ex
bar ending "1."
repeatend ending "2-3"
endbar endending
.Ee
.P
The ending label will always be
forced into 12-point Times roman font. If you change font or size or include
.Ix bG
.Ix bH
.Ix gJ
special characters in the ending label,
the output is not likely to be aligned properly.
.P
.Hr param.html#endingst
The "endingstyle" parameter
.Ix dG
.Hi
(described in the section on parameters)
.He
controls where endings are placed.
Endings cannot start at or cross over a restart bar.
.P
When doing an endending, Mup will draw a vertical line at the end unless
it is at a plain bar or an invisbar that is not at the end of the piece.
Once in a while, you may want to override that. To do so, instead of
specifying endending, you can specify openendending (to force Mup to not draw
the final vertical), or closedendending (to force it
to draw the final vertical).
.Hh reh
.H 3 "Rehearsal marks"
.P
Rehearsal letters or numbers
.Ix aQ
can be specified on any bar line. There are four formats:
.nf
.na
.in +0.5i
.br
\fBrehearsal let\fP
.br
\fBrehearsal num\fP
.br
\fBrehearsal mnum\fP
.br
\fBrehearsal "\fP\fIlabel\fP\fB"\fP
.in -0.5i
.fi
.ad
.Ix dP
.P
In the first example, a rehearsal letter will be placed on the bar. The
first occurrence of this will become rehearsal "A", the next "B", and so
forth. The second format works in a similar fashion except that numbers are
used rather than letters. With the third format, the current measure
.Ix dY
number is used. With the last format, any arbitrary string
.Ix hB
within the quotes will be used. The keyword "rehearsal" can be
abbreviated to "reh" if you wish. Only one rehearsal mark is allowed on
any one bar, but the types can be mixed throughout the composition.
Note, however, that mixing "num" with "mnum" is likely to be very confusing,
as would using "num" while the
.Hr param.html#measnum
measnum parameter
is set to "every \fIN\fP."
The rehearsal marks can be intermixed with other bar options:
.Ex 1
.\"score leftmargin=2;rightmargin=2
.\" warn=n
.\"music
1: 1c;
dblbar reh num ending "1"
1: 1e;
repeatend pad 1 =_xyz reh let ending "2."
1: 1g;
bar rehearsal "Duet"
1: 1ce;
endbar endending
.Ee
.P
The rehearsal marks are normally put directly above the bar
line. However, if the bar line falls at the end of a score, the rehearsal
.Ix hJ
mark will be placed at the beginning of the following score, after the
.Hr param.html#clef
clef,
.Ix fI
.Ix gU
.Hr param.html#key
key signature,
and
.Hr param.html#time
time signature.
.Hr param.html#endingst
The "endingstyle" parameter
.Ix dG
.Hi
(described in the section on parameters)
.He
is used to determine which staffs get rehearsal marks.
.Hr param.html#rehstyle
The "rehstyle" parameter
specifies whether to put rehearsal marks inside a box or a circle
or leave them plain.
.P
By default, rehearsal marks are printed in 12-point Times bold, but
the rehearsal keyword may be followed by a specification for \fIfontfamily\fP,
\fIfont\fP, and/or \fB(\fP\fIsize\fP\fB)\fP.
Once specified, these remain in effect
for any future rehearsal marks, until explicitly changed. Some examples:
.Ex
bar rehearsal helvetica bold (14) let
repeatend reh newcentury num
invisbar reh rom (10) mnum
.Ee
.P
After all the options listed above, you may specify "dist \fIN\fP" where
\fIN\fP is some number of stepsizes. This will override the
.Hr param.html#dist
dist parameter
for determining how close to the staff to place the rehearsal mark.
If the number is followed by a "!" Mup will place the mark exactly
that far from the top of the staff, even if it overwrites other things;
otherwise the value specifies a minimum distance.
.Ex
rehearsal num dist 5 // at least 5 stepsizes away
reh bold "A1" dist 2 ! // exactly 2 stepsizes away
.Ee
.Hh setmnum
.H 3 "Setting the measure number"
.P
Mup keeps track of
.Hr param.html#measnum
measure numbers
.Ix dY
automatically, but sometimes you may want
to override this to set the current measure number to some specific value.
This is done by adding mnum=\fInumber\fP on a bar line,
which will set the current measure number to the given \fInumber\fP.
.Ex
// Set the current measure number to 50
dblbar mnum=50
.Ee
You can also tell Mup to adjust up or down from what it would otherwise count,
by using a plus or minus sign instead of the equals sign, following by the
number of measures to adjust by. So, for example, suppose you use
.Hr invisbar.html
invisbar
in some way that causes Mup to not count something as a measure that you
actually want to be counted. You could then use
.Ex
invisbar mnum+1
.Ee
.Hh setreh
.H 3 "Setting rehearsal letter or number"
.P
If you are using the "rehearsal let" or "rehearsal num" styles,
you can set those to specific values too, similarly to how mnum can be set.
This might be useful, for example, if you have a single input file that
contains multiple songs or movements, and you want the rehearsal marks
to start over at the beginning of each song or movement.
.P
The rehearsal number can be set on any bar line using num=\fIN\fP, where
\fIN\fP is a number, typically 1.
.Ex
bar num=1
.Ee
The rehearsal letter can be set in a similar way, using let="\fIX\fP" where
\fIX\fP is either a single uppercase letter, A to Z, or two uppercase
letters, AA to ZZ.
.Ex
dblbar let="A" reh let
.Ee
.Hh hide
.H 3 "Hiding time/key signature and clef changes"
.P
Generally in printed music, when a
.Hr param.html#time
time signature
.Ix gU
.Hr param.html#key
or key signature
.Ix cG
change occurs at the beginning of a score, these changes are also printed at
the very end of the previous score,
to make it clear there is a change coming up.
Mup normally does this, but occasionally you may not want that behavior.
Sometimes you may want to make a new score appear like the beginning
of a new piece. If you wish to suppress the printing of time signature,
key signature, and clef
changes at the end of the preceding score,
you can use the "hidechanges"
.Ix hR
keyword on the bar line at which the changes occur.
Hidechanges cannot be used on a restart bar.
.Ex 1
.\"score leftmargin=2 ; rightmargin=2
.\"scoresep=10,14
.\" label=" "
.\"music
1: c;d;e;f;
bar
// change time/key with normal treatment
newscore
score time=5/4 ; key = 1&
music
1: d;e;f;2g;
// don't show changes at end of previous score
bar hidechanges
newscore
score time=6/4 ; key = 2#
music
1: d;e;f;2.g;
bar
.Ee
.Hh subbar
.H 2 "Subbars"
.P
Sometimes you may want to mark subdivisions of measures.
For example, you may want to indicate that something in 7/4 time is to be
interpreted as 3+4 or 4+3. Although you could indicate that with the
.Hr param.html#time
time signature,
this can also be done using the
.Hr param.html#subbar
subbarstyle parameter.
The general syntax of this parameter is
.Ex
\fBsubbarstyle = \fP\fIlinestyle bartype appearance ranges \fP\fBtime \fP\fIcounts\fP
.Ee
The \fIlinestyle\fP is optional, and can be dashed or dotted.
The \fIbartype\fP is either bar or dblbar, and indicates whether to draw
a single line or two lines.
.P
The \fIappearance\fP is optional. When specified, it is in parentheses,
describing where the subbar should end vertically. Top and bottom specifications
are given, with the word "to" between them. Each specification consists of
the word "top," "middle," or "bottom," indicating which line of the staff to draw
relative to, optionally followed by a plus or minus sign and a number of
stepsizes.
.Ex
(top to bottom)
.Ee
means draw from the top line of the top staff in each range to the bottom
line of the bottom staff in the range. This is the default if no appearance
is given.
.Ex
(middle to middle)
.Ee
would mean draw from the middle line of the top staff in each range to
the middle line of the bottom staff in the range. As mentioned earlier,
you can also specify adding or subtacting some number of stepsizes on each. So
.Ex
(top-2 to bottom+2)
.Ee
would draw from 2 stepsizes below the top line of the top staff to
2 stepsizes above the bottom line of the bottom staff.
.P
The \fIrange\fP is similar to ranges for the barstyle parameter, so things like
1-2 or 1-4,8-12 or all.
.P
Often you may want the subbar marks to span just a part of each individual
staff, so the "ranges" will be just individual staffs.
.P
The "time" keyword is required and must be followed by at least one
count at which to draw the subbar. The time can include a decimal part.
Multiple times are separated by commas. Examples would be
time 3 or time 2.5,4.75
.P
Subbars are only drawn on staffs where there is actually a note or
rest at that count.
.P
Multiple styles can be given. For example:
.Ex
subbarstyle=bar 1-4 time 2 dotted dblbar (top-1 to bottom+1) 5,6 time 4
.Ee
.P
Finally, you can use "between" as the appearance,
to draw between staffs in the range.
.Ex
subbarstyle=dotted bar between all time 3
.Ee
Once between is specified, it applies to all future styles
in the parameter value,
so if you want a mixture of between and not, specify all the not between first.
.Ht Multirests
.Hd multirst.html
.H 2 "Multirest"
.Ix hG
.P
Multiple measure rests can be indicated using the "multirest" statement.
.Ix aW
.Ix hC
.Ix hD
It is followed by the number of measures of rest.
The number must be greater than 1, and no larger than 1000.
There must not be any note or lyric information specified for
.Ix hL
a multirest measure.
Examples:
.Ex 1
.\"score leftmargin=1.5; rightmargin=1.5
.\"music
multirest 15
bar
1: 2c;4;;
bar
1: 2.c;4r;
bar
multirest 5
bar
.Ee
.P
See also
.Hr cmdargs.html#coption
the -c command line option,
and
.Hr param.html#restcomb
the restcombine parameter.
.P
Normally, the number of measures of rest is printed, but
it is possible to turn this off using
.Hr param.html#prmultn
the printmultnum parameter.
An alternate notation can be specified using
.Hr param.html#restsymm
the restsymmult parameter.
.Ht Lyrics
.Hd lyrics.html
.H 2 "Lyrics"
.P
.Ix aE
Lyrics are specified in a somewhat similar manner to
.Hr chordinp.html
note groups.
Lyrics for each staff are specified with the word "lyrics"
.Ix hK
optionally followed by a \fIplace\fP,
followed by the \fIstaff number\fP, followed by a colon, then the timing and
syllable information.
.Ix gF
.P
The \fIplace\fP, if specified, can be "above" or "below," to
.Ix bJ
.Ix dL
indicate whether the lyrics are to be printed above or below the given
staff. The default is below.
.P
The \fIstaff number\fP can be a single number or list of ranges of numbers.
It can also be given as the keyword "all," which will place the lyrics
above the top visible staff or below the bottom visible staff.
.Ix gL
.Ix gM
.Ix gN
.P
The place can also be specified as "between \fIM\fP\fB&\fP\fIN\fP"
where \fIM\fP and \fIN\fP are numbers.
.Ix dM
This will cause the lyrics to printed approximately halfway between staff
\fIM\fP and staff \fIN\fP. \fIN\fP must be exactly one greater than \fIM\fP.
.Ex
lyrics 1:
lyrics above 2,3:
lyrics between 1&2, 3&4:
.Ee
.P
If you want the same lyrics above some staffs but below others,
you can specify several places and list of staffs, separated by semicolons.
For example:
.Ex
lyrics above 1,3 ; below 2,4 ; between 5&6 :
.Ee
.P
After the colon comes a list of
time values.
.Ix gT
Time values are separated by semicolons and are specified as they are
.Ix hH
for notes: "2" for half notes, "8." for dotted eighth, etc.
.Ix gX
.P
If the time values for lyrics are the same as the time values for the notes
on the staff, the time values need not be specified. If you don't
specify them, Mup will derive the appropriate values from the music input.
If you list more than one staff, the time values will be derived from the
first staff you list. Usually, the time values will be derived from voice 1,
but if voice 1 music data doesn't exist or is invisible,
or if the lyrics are explicitly specified as "below"
and there is a visible voice 2, then voice 2 will be used.
Voice 3, if any, is never used for automatically
deriving time values for lyrics.
Some examples:
.Ex
1: c;d;e;f;
lyrics 1: "The sun will shine";
// The time values will be all quarter notes,
// as derived from the music on staff 1
bar
1: 8g;4.f;4g;a;
lyrics 1: "up-on the earth.";
// The derived time values will be 8;4.;4;;
bar
// In these examples, time values will be taken
// from staff 4, since it is the first one listed.
// In the last case, because "below" is specified explicitly,
// the times will be taken from voice 2
// if there is a visible voice 2; in all the other cases
// it will be taken from voice 1 if voice 1 music
// has been entered and is visible.
lyrics 4,7,9: "for-ev-er";
lyrics above 4-6: "nev-er-more";
lyrics between 4&5,6&7: "this is it";
lyrics below 4,2: "and so forth";
.Ee
The line describing the music from which to derive the times
must appear in the input prior to the lyrics line that is deriving the times.
If chords in the music are tied or slurred together, Mup will
treat those chords as being for a single syllable.
However, there may be some
circumstances in which the rules Mup uses to derive time values may not
yield what you want, in which case you will have to explicitly specify the times
for that measure.
.P
Or if there is some other voice in the measure that has the times you want,
you can tell Mup to use that one, by adding the keyword "using" and the staff
and voice of that other voice. As usual, an omitted voice defaults to 1.
This can even let you use voice 3 for time derivation, which would otherwise
not be possible. Here is a simple example:
.Ex 1
score
vscheme=3f
.\" leftmargin=1.3
.\" rightmargin=1.3
music
1: g+;;;;
1 2: 2c;;
1 3: 8e;;;;;;;;
lyrics 1 using 1 3: "This de-rives from voice num-ber three.";
bar
.Ee
.P
Following the time values is a list of one or more
verse numbers and lyric strings containing the words of the lyrics.
.Ix cJ
.Ix hB
The verse number(s) are given within square brackets. If no verse is
.Ix dW
specified on the first set of lyrics for a staff and
place, verse 1 is assumed.
On subsequent lyrics strings for that staff and place,
the verse number is assumed to be one more than the previous verse number.
Thus you only need to explicitly specify a verse
number if you want to skip over a verse or supply them out of order.
.P
Verse numbers need not be consecutive.
The staff number and verse number can be given as lists or ranges.
Another example:
.Ex 1
.\"score leftmargin=2 ; rightmargin = 2; staffs=2
.\"music
1-2: 4.c+;8c;{4e;f;g;}3;
lyrics below 1-2: 4.;8;{4;;;}3; \e
"This is some-thing else."; \e
[4,5] "How do you like this?"; \e
[2-3,6] "Now try this out too.";
bar
.Ee
.P
In this example, the lyrics will go below staffs 1 and 2. There are
5 syllables. The first is a dotted quarter in length, the second is
an eighth, and the last three make up a quarter note triplet. The first
string is for verse 1, since no verse number was specified. The second
string will be used for verses 4 and 5, and the last string for verses
2, 3, and 6.
.P
.Hm centered
You can also specify a verse number of "c" which means the verse is
.Ix cV
to be centered vertically. This is useful if you have a refrain that
is identical for several verses, and you don't want to have it printed
multiple times.
.Ex 1
.\"score
.\" leftmargin=2.5
.\" rightmargin=2.5
.\"music
1: c;;e;;
lyrics 1: ;;2s; [1] "verse one"; [2] "verse two";
lyrics 1: 2s;4;; [c] "The refrain"; // centered lyrics
bar
.Ee
.P
The lyrics string is followed by a semicolon.
There must normally be one syllable in the lyrics string for each time value.
.Hr lyrics.html#except
(There is one exception,
discussed later.)
Syllables are separated in the lyrics string by white space,
.Ix gZ
a dash, or an underscore.
.Ix fW
.P
Sometimes a syllable is to be held out for several counts
or over several notes. This can be indicated by dashes or underscores.
.Ix hL
If the syllable in the lyric string ends with a dash, on output the dash
will be placed halfway between the given syllable and the next syllable.
If the distance between the two syllables is long, several evenly spaced
dashes will be printed.
If a syllable in the lyric string ends with an underscore,
an underscore line will be printed from the end of the
current syllable to the edge of the last note associated with the syllable.
.Ix hC
.P
Here are some examples:
.Ex 1
.\"score leftmargin=2 ; rightmargin=2
.\"music
// Verse 1. The first two words have the
// duration of a quarter note each.
// The last word lasts a half note.
1: e;d;2c;
lyrics 1: 4;;2; [1] "Three blind mice";
bar
.Ee
.Ex 1
.\"score leftmargin=2 ; rightmargin = 2;
.\"music
// examples of above lyrics with dash and underscore
1: 4d<>;e;8g;b;4a;
lyrics above 1: "now_ or nev-er";
bar
.Ee
.P
Mup does its best to figure out where to end dashes or underscores. However,
if there isn't a following syllable after a dash or underscore, Mup would
extend the dash or underscore to the end of the piece, which may not be
what you want. There are a few other cases where Mup may be unable to
properly deduce where you had intended an underscore to end.
You can manually halt the dash or underscore by adding in
.Ix fU
an "empty syllable," consisting of "<>". Normally, the angle brackets are
.Ix dX
used inside lyrics to enclose special non-lyrics items, as will be
.Hr lyrics.html#lyrext
described a bit later.
However, if they are used by themselves with nothing between them,
they essentially mean a syllable with no text.
.Ex 1
.\"score leftmargin=1.5; rightmargin=1.5
.\"music
1: 2c;4d<>;e;
lyrics 1: "last word._";
bar
1: 4d;e;f;g;
// add empty syllable to end the underscore
lyrics 1: 1; "<>";
bar
.Ee
.P
Occasionally, a single chord is used for more than one syllable.
If the syllables are within the same word, it is sufficient to omit the
dashes between syllables, so that Mup will treat them as a single syllable.
However, if the syllables are in separate words,
a "~" can be used in place of a space between the syllables.
On output, Mup will replace the "~"
with a space and a small, curved line below the space, indicating that the
.Ix fD
syllables on either side are to be joined. For example:
.Ex 1
.\"score leftmargin=2; rightmargin=2
.\"music
1: b;a;2g;
lyrics 1: ;;2; "man-y~a day";
bar
.Ee
If you don't want the curved line,
you can use the special character name "\e(space)" instead of a
.Ix gZ
literal space.
.Hr textstr.html#space
That special space character
is printed like a normal space on output,
but is not considered a space for the purposes of determining syllable
boundaries. Alternately,
.Hr lyrics.html#lyrext
a technique using angle brackets,
described later, can be used.
.P
If several verses use the same time values, you can specify them all on
one input line.
For example:
.Ex 1
.\"score leftmargin=2; rightmargin=2
.\"music
1: d;f;a;g;
lyrics 1: [1] "this is verse one"; \e
[2] "this is verse two";
bar
.Ee
.P
In this example,
because of the \e at the end of the first line, both verses are effectively
on the same input line.
.P
.Hm except
Occasionally, lyrics may occur during only part of a measure.
.Ix hG
This case can be handled by specifying "space"
.Ix gZ
by using an "s" after time values that have no
lyric syllable associated with them. For example:
.Ex 1
.\"score leftmargin=2; rightmargin=2
.\"music
1: 2r;g;
lyrics 1: 2s;; [1] "Now";
bar
.Ee
.P
In this example, the first half note of the measure is a space, so there will
be no lyric there. The second half note of the measure will have the word "Now"
as its lyric. Note that the "s" does not work quite the same way with lyrics
as it does with notes. With notes, "2s;;" would mean two half note spaces,
because the space would be used as default for the following chord where no
notes were specified. With lyrics, "2s;;" means a half note space, followed
by a half note lyric; the space is not carried forward as a default.
.P
If you don't specify any time values, relying on Mup to derive the time values
from the corresponding music time values, any rests and spaces in the music
will be translated to lyric spaces. If the first note entered in a chord
is tied to or slurred to the following chord, that following chord
will also be translated to a lyric space, since you most likely want
a single syllable to span both chords in that case.
.P
In addition, if you set the
.Hr param.html#xtendlyr
extendlyrics parameter,
Mup will deduce where to add in underscores,
based on the locations of ties and slurs.
.P
.Hm lyrext
Occasionally, you may want to print something within a lyric string
which isn't really a lyric syllable.
The most common example of this would be
that you may want to print verse numbers. Other possibilities may include
associating a dynamic mark (e.g., "mf") with a particular verse, or
.Ix fR
marking a section for a subset of the singers (e.g., "Men:" or "Solo:").
These extra things are specified within angle brackets. They can be placed
.Ix dX
immediately before or after any syllable.
Mup will not consider them when lining up the syllable with notes.
.Ix hL
Normally, it will assume there is enough
space to print them rather than reserving space for them. If you want Mup
to ensure there is enough space to print them, put a "^" immediately
after the "<".
.P
Some examples:
.Ex 1
.\"score leftmargin=2;rightmargin=2
.\"music
1: f;e;d;c;
lyrics 1: "<1. >This is verse one.";
bar
1: 2g;4;;
lyrics 1: 2s;4;; "<^\ef(TX)ff\ef(PV) >Loud-er";
bar
.Ee
.P
The < > construct can also be used to fine-tune the placement of syllables.
The placement of syllables is governed in general by the
.Hr param.html#lyralign
lyricsalign parameter.
.Ix hT
Sometimes, however, you may want to adjust the placement of specific syllables.
Suppose you have a long syllable, like "strength" and would like
to shift it leftward somewhat. Entering it as "<str>ength" would
cause Mup to move the syllable farther to the left than it normally would.
.Ex 1
.\"score leftmargin=2;rightmargin=2
.\"music
1: c;d;e;f;
lyrics 1: "This strength not moved."; \e
"This <str>ength was moved.";
bar
.Ee
.P
Angle brackets may also be useful for entering
.Ix iK
chant, where many words
are to be associated with a single note. For example:
.Ex
lyrics 1: "All<^ these words will be treated like one syllable.>";
.Ee
.P
The font and size to use for lyrics is initially determined
.Ix bG
.Ix bH
from the
.Hr param.html#lyrfam
\&"lyricsfontfamily,"
.Ix gB
.Hr param.html#lyrfont
\&"lyricsfont"
and
.Hr param.html#lyrsize
\&"lyricssize"
parameters for the appropriate staff.
If "all" is used for the staff number, the score parameters are used.
.Ix cQ
.Ix hJ
In the case of "between," the parameters for the staff above are used for
determining the font and size.
The usual \ef and \es forms can be used to
.Hr textstr.html
change these values
for a given verse. Lyrics fontfamily, font and size values
are maintained separately for each
combination of staff number, verse number, and place, and are carried forward
from one measure to the next. Thus, for example, if you want one verse to
be printed in roman and another in italics (perhaps one is in English and the
.Ix gJ
.Ix gK
other in another language), you need only put a "\ef(TI)" at the beginning of
the syllable string for the first measure of the second verse, and all
subsequent syllables for that verse will be in italics.
Setting the
.Hr param.html#lyrfam
\&"lyricsfontfamily,"
.Hr param.html#lyrfont
\&"lyricsfont"
or
.Hr param.html#lyrsize
\&"lyricssize"
parameters will reset the values for
all verses of the staff (if set in
.Hr contexts.html
staff context),
.Ix hK
or the entire score (if set in
.Hr contexts.html
score context).
.Ix hJ
.P
Another way to align a syllable in a particular way is to precede the
syllable with a |. If the | is preceded by a number (optionally signed),
the left edge of the syllable will be placed that many points from the
horizontal "middle" of the chord.
.Ix jB
If there isn't a number before it, the value is obtained from the
.Hr param.html#sylpos
sylposition parameter.
Negative values are to the left, and will usually be what you want.
This alignment method is particularly useful for lining up multiple verses,
either to get verse numbers to line up or to align words at the beginning
of a poetic line. The | goes after anything in angle brackets.
.Ex 1
.\"score
.\" leftmargin=2
.\" rightmargin=2
.\"music
1: 8c;d;4e;8e;g;4c+;
lyrics 1: "<1. >|\e"How are you?\e" -7|He asked her."; \e
"<2. >|\e"I am fine,\e" -7|She re-plied.";
bar
.Ee
.P
.Hm ltag
Location tags can be set on lyrics syllables
.Ix bE
by adding \e=(\fItagname\fR)
to the syllable. As with all tags, the \fItagname\fP must be either a
single lowercase letter, or an underscore followed by any number
of uppercase or lowercase letters, digits, or underscores.
The area associated with the tag will include the syllable itself
and anything inside <^ >, but excluding things inside < >.
While Mup will recognize a tag like this almost anywhere within a syllable
(except inside < > or before any initial < >), it is recommended that it
be placed at the end of the syllable, before the dash or underscore, if any,
because that's less confusing to read than putting it
in the middle of a syllable. An
.Hr lyrtag.html
example showing common uses of lyric tags
in given in the Hints section.
.P
A few more examples of lyrics:
.Ex 1
.\"score leftmargin=2;rightmargin=2;staffs=4
.\"music
1,3-4: c;8e;;4d;r;
2: c+;8g;;4b;;
lyrics between 1&2,3&4: 4;8;;4;s; "This is a test.";
lyrics above 2: 2s;4;; "The end.";
bar
.Ee
.Ht Tablature notation
.Hd tabstaff.html
.H 1 "TABLATURE NOTATION"
.P
.Ix hU
Mup can print tablature staffs. Tablature notation is commonly used for
.Ix hY
guitar and several other instruments. Mup supports tablature for 1 to 9
strings.
.P
Mup will automatically create a normal 5-line staff above each tablature
staff, giving the equivalant music on that staff.
This staff will be referred to as the "tabnote
staff." Normally, you will input music just for the tablature staff, and
the tabnote staff will be derived from that. However, for any given measure,
you can explicitly input music for a tabnote staff,
which will turn off the automatic
translation for that measure. If you only want either the tab or tabnote
staff to be printed, you can mark the other one as invisible
.Ix gL
.Hr param.html#visible
(see the "visible" parameter).
You should specify the appropriate
.Hr param.html#clef
clef
and
.Hr param.html#key
key signature
for the tabnote staff, so that Mup can make the best derivation.
.H 2 "Specifying a tablature staff"
.P
To set up a tablature staff, you use the
.Ix fX
.Hr param.html#stlines
stafflines parameter.
To get a standard 6-line guitar tablature staff, you can just say
.Ex
score
staffs=2
staff 2
stafflines = tab
.Ee
There are 2 staffs, because there is both the tablature staff and the
automatically generated tabnote staff. The tablature staff is always
immediately below the corresponding tabnote staff.
Setting the
.Hr param.html#stlines
stafflines parameter
to "tab" marks staff 2 as a tablature staff.
.P
If you want tablature for an instrument other than a 6-string guitar with
standard tuning, you specify
the pitches of the strings from top to bottom
within parentheses after the "tab." For example:
.Ex
stafflines = tab (e a d& g)
.Ee
would define some instrument that had 4 strings, with the string on the
top line of tablature staff being an e string, the next a, the next d flat,
and the bottom g.
As shown in the example, pitches can include a # or & if necessary.
Strings are assumed to be in octave 4 unless otherwise marked.
You can specify a different octave by specifying an
.Hr chordinp.html#oct
octave number
after the
string's pitch (using either an absolute octave number or pluses or minuses).
If the instrument
has more than one string with the same pitch
(even if they are in different octaves),
they must be distinguished by adding one or more ' marks after the
pitch. The tablature definition for standard guitar is
.Ex
stafflines = tab (e5 b g d a3 e'3)
.Ee
This specifies that the top string on the staff is e in octave 5.
The next three strings
are in the default octave of 4, and the last two strings are in octave 3.
Since there are two different strings with pitch letter of e, the lower e is
marked as e'. Note that the octaves given are how they
should be printed on the tabnote staff. A standard guitar actually sounds
an octave lower than written. If you just use "stafflines = tab" without
specifying any strings, Mup not only assumes the standard guitar layout,
and prints in the appropriate octave,
.Hm autotran
but it also automatically
.Ix fB
.Hr trnspose.html
transposes
the
.Ix aA
.Hr midi.html
MIDI output
to the actual pitches an octave lower. If you specify
strings explicitly, you will have to specify the octaves and any
desired MIDI transposition values yourself. Stated another way,
.Ex
score
staffs = 2
staff 2
stafflines = tab
.Ee
is equivalent to
.Ex
score
staffs=2
staff 2
stafflines = tab (e5 b g d a3 e'3)
staff 1
ifdef MIDI transpose = down perfect 8 endif
.Ee
Note from this last example that MIDI is taken from the tabnote staff,
not the tablature staff, so MIDI directives should be placed with the
tabnote staff.
.P
Mup should be able to handle almost any instrument with up to 9 strings.
Several strings can have the same pitch; you just need to distinguish
them with ' marks.
The strings must be listed in whatever order the strings are to appear
on the tablature staff.
As another example,
.Ex
stafflines = tab (g3 d3 a2 e2)
.Ee
would define a standard bass guitar. Note that a bass guitar also sounds
an octave lower than written, so it should be transposed for MIDI purposes.
.P
The list of strings, if any, can optionally be followed by y or n. Using y
will cause the word TAB to be printed vertically at the beginning of every
score. Using n will cause that to never to be printed. Not specifying either
will cause it to be printed only on the very first staff, which is the most
common way of printing tablature.
.H 2 "Music input on tablature staffs"
.P
Input of tablature is similar to that on regular staffs. Each note in a
chord is specified by a string and a
.Ix hZ
fret.
So fret 3 on the g string
is designated by g3, or fret 0 on the e' string is designated by e'0.
If your open string pitch includes an accidental, that would be included
as well, so if you had an instrument with an f# string and wanted to
play the 6th fret on that string, it would be f#6.
Fret numbers can range from 0 to 99.
If you want fret numbers to be placed inside parentheses,
.Ix iA
put parentheses
around them in the input.
You can also put both the string and fret within a set of parentheses,
in which case, the note generated on the tabnote staff will have parentheses
around it.
Here are some examples of chords:
.Ex 1
.\"score staffs=2
.\"leftmargin=2.5 ; rightmargin=2.5
.\"staff 2 stafflines=tab
.\"music
2: d4; d5a3; b0 d(5); e2(b3)g2;
bar
.Ee
.P
.Hr chordinp.html#duration
Time values
are specified just like on non-tablature staffs: a number
optionally followed by one or more dots (like 4 or 8..),
or a list of such numbers added together (like 2+8),
preceding the chord pitches. Tablature staffs follow the same
rules as non-tablature staffs for using time values from the previous
chord if no time value is specified on the current chord. Similarly,
if no notes are specified for a chord, the same notes used in the previous
chord are reused. As an example:
.Ex 1
.\"score staffs=2
.\"leftmargin=2.5 ; rightmargin=2.5
.\"staff 2 stafflines=tab
.\"music
2: 4.e5; ;8;b2;
bar
.Ee
Since nothing is specified for the second chord, both time value (dotted
quarter) and note (e string fret 5) are copied from the first chord.
The third chord in the measure has only a time value
(an eighth note) so the note (string/fret) is repeated.
The final chord has only a note,
so the previous time value is used.
.P
Rests and spaces can be specified with r and s, just like on non-tablature
staffs. They result in nothing being printed on the tablature staff, and
rest or space being printed on the tabnote staff.
.H 2 "Chord attributes"
.P
Any chord on a tablature staff can be preceded by a list of
.Hr chrdattr.html#chstyle
chord attributes
in brackets, just like with non-tablature staffs. If you want a chord to be
printed with X (for a muffled string) rather than a fret number,
.Ix bS
use [xnote].
In this case, the fret number will be used only to determine where to put
the X on the tabnote staff, and what note to use for
.Hr midi.html
MIDI.
Using [diam]
.Ix bT
will have no effect on the tablature staff, but will cause
diamond notes to be used on the tabnote staff.
.Ix aL
.Ix bB
Using [grace] or [cue] will cause the fret numbers to printed in a smaller
size, and the corresponding notes on the tabnote staff to be printed
in a smaller size. Using [slash \fIN\fP]
will cause \fIN\fP slashes to be printed below the chord on the tablature
staff, as well as
.Ix cA
.Hr chrdattr.html#slashes
slashes
on the corresponding chord on the tabnote staff.
You can use the other chord attributes (with, pad, and =tag) just
like on a non-tablature staff.
.H 2 "Ties"
.P
From an input point of view,
.Ix aK
.Hr noteattr.html#ntie
ties
work much the same on tablature staffs as on other staffs.
On output, tie marks on tablature staffs are normally not printed,
and the frets are not printed on the tied-to chord. If a tie goes across
to a new score, the frets are printed, but in parentheses, to indicate the
chord is really just the continuation of a tie.
.H 2 "Slides"
.P
In Mup input,
.Ix hX
slides are shown with <>, rather like
.Hr noteattr.html#nslur
slurs
on non-tablature staffs.
There is a special variation used for slides that come from nowhere in
particular or go to nowhere in particular.
These are shown with <\en>, </n>, <n\e>, or <n/>.
A slide is indicated on output on tablature staffs
as a slanted line between 2 fret numbers on a string.
On tabnote staffs, they as drawn as a slanted line between 2 notes.
See the examples below:
.Ex 1
.\"score staffs=2
.\"leftmargin=1.5 ; rightmargin=1.5
.\"staff 2 stafflines=tab
.\"music
2: a5<>; a6; d3<>; d2;
bar
2: b4</n>; e3<\en>; a2<n/>; e'5<n\e>;
bar
.Ee
.H 2 "Bends"
.P
A bend (stretching a string to make it sound higher than normal)
.Ix hW
is specified on tablature staffs
by putting a text string after the string. The
text string can be the word "full" or a number and/or fraction.
Some examples:
.Ex 1
.\"score staffs=2
.\"leftmargin=2 ; rightmargin=2
.\"staff 2 stafflines=tab
.\"music
2: e4 "full"; e "1/2"; 2e "1 1/2";
bar
.Ee
.P
If you want to bend back down to having no bend (a release),
the text string specifying
the bend is just an empty string of "".
Note that if both a fret and bend other than "" are specified,
.Hm prebend
this indicates a prebend,
whereas if only a bend is specified, this indicates a normal bend.
.P
Bends need not be a whole number of half steps, but if you specify a bend
that falls between half steps, when it is used on the tabnote
staff, the bend is rounded to the nearest half step, or rounded downward
if it is exactly in the middle of a half step.
When possible, bends of 1/4 step or less are shown on the tabnote staff
by a small curve rather than by a separate note.
.P
You can specify bends on more than one string at once, but a continuation
bend (bending to a new distance without replucking the string) is only
allowed on a single string at a time. Here are some examples:
.Ex 1
.\" score staffs=2
.\" leftmargin=1.7; rightmargin=1.7
.\" staff 2 stafflines=tab
.\" music
.\"
2: g0b2e'0; e' "1/2" g "full" b "3/4"; e' ""; a2;
bar
2: a "1/2"; a "full"; a "1/2"; a "";
bar
.Ee
.P
If you have more than one voice on a tablature staff,
bends on other than the top voice may collide with other voices in some
cases, and if there are bends from more than one voice simultaneously,
they may collide.
.P
On non-tablature staffs, bends are specified with a ^ symbol followed
by the note to bend to. The note to bend to is specified by letter and
optional octave (accidentals are not specified). If you want just a small
bend (1/4 step), this is specified by ^/. For example:
.Ex 1
.\"score
.\"leftmargin=2 ; rightmargin=2
.\"music
1: e ^f; f; b ^c5; c#5;
bar
1: d+^e+ g^a; e+a; g ^/; c ^/ c+^/;
bar
.Ee
.H 2 "Miscellaneous"
.P
Note attributes of ~ for tie, ? for a small note, and = for a tag work the
same on tablature staffs as on non-tablature staffs.
.P
If bm, ebm, esbm, abm, or eabm are given on tablature staffs they are
transferred to the tabnote staff and used for
.Ix dI
.Hr ichdattr.html#custbeam
custom beaming
or automatic beaming there, as appropriate.
.Ix fZ
.Hr chrdattr.html#withlist
Items in "with" lists inside [ ]
are also copied to the tabnote staff.
In general, unless otherwise specified here,
if you want items such as
.Hr stuff.html
tempo and dynamic marks
to appear on both tablature and tabnote staff, you
have to specify them for both staffs.
.P
The
.Hr ichdattr.html#alt
\&"alt" inter-chord attribute
is not allowed on tablature staffs.
.P
When there is a tablature staff, the
.Hr midi.html
MIDI
is actually generated from the
tabnote staff. There are some limitations.
Currently, no MIDI pitch bends are generated; slides and
bends are instantaneous rather than gradual.
.P
If a
.Ix hV
capo is being used, it probably better to declare a
.Ix fB
.Hr trnspose.html
transposition
of the tabnote staff rather than declaring the strings to be different
notes. This is because most people would rather think of the original
string letters when entering the tab staff information; and if you decide to
put the capo on a different fret later,
you only have to change the "transpose" line.
.Hr tabstaff.html#autotran
The automatic MIDI octave transposition for standard guitar
will also then still apply, on top of your transposition.
.P
If you specify an
.Hr octave.html
octave mark
(discussed in a later section)
on a tabnote staff, the derived music will be printed with the notes
raised or lowered the appropriate number of octaves to correspond to the given
octave mark interval.
.P
Since ties are not printed on tablature staff, and input notation for
tablature slides is like what is used for slurs on ordinary staffs, if
you want a curved line like a tie or slur on a tablature or tabnote staff,
you have to use a phrase mark. See the section on
.Hr phrase.html
phrase marks
for more details.
.P
The chord-at-a-time input style can also be used for tablature.
The staffs being mapped to from a single input line must either be
all tablature or all non-tablature, however.
.Ex 1
score
staffs=4
.\" leftmargin=2.2
.\" rightmargin=2.2
brace=1-2, 3-4
.\" scale=0.9
tabwhitebox=y
staff 2
stafflines=tab
staff 4
stafflines=tab
music
// The first two notes in each chord go to staff 2,
// and the last two go to staff 4.
[ 2; 2; 4; 4] : a2d0 g0b3; e'0a2 g0e0; 2 e'0d2 b0e3;
bar
.Ee
.Ht Shaped notes
.Hd shaped.html
.H 1 "SHAPED NOTES"
.P
If you intend to only use the usual system of noteheads,
you can skip over this section on shaped notes.
.Ix jG
If you wish to use less common notehead shapes, like X-shaped notes,
rather than normal noteheads, or want "shaped note" music that is often used
for "Sacred Harp" style music, sometimes also called "fasola notation,"
then this section will explain how you can do that.
.Hh hdshape
.H 2 "Headshapes context"
.P
The headshapes context
is used in conjuction with the
.Hr param.html#notehead
noteheads parameter
to determine what shapes will be used when printing noteheads.
It is rarely necessary to include a headshapes context in your music,
since Mup already has the most common values built in,
so generally you just need to use the
.Hr param.html#notehead
noteheads parameter
to access them. However, it is still important to understand
what the headshapes context can contain,
to understand how the built-in values work.
.P
The headshapes context defines, for
a given head shape name, what specific notehead characters
to use for the notes of various durations.
It contains one or more pairs of strings.
The first string in the pair gives a name for a set of notehead shapes.
The second string contains a space-separated list of the names
of 4, 5, or 6 notehead characters to use for that head shape name.
The first shape in the list is used for quarter notes and shorter,
the second for half notes,
the third for whole notes, and the fourth for double whole notes.
If there is a fifth, that is used for quadruple whole notes.
If there is a sixth, that is used for octuple whole notes.
.P
If an upside-down version of the character is to be used for stem-down notes,
the name is prefixed by "u?" (The "u" stands for "upside-down" and the
question mark is intended to be mnemonic for the fact
that the upside-down version
will only be used part of the time, namely for stem-down notes.)
.P
As was mentioned above, the most common mappings are already built into Mup.
Here is the list of the pre-defined values.
Pay particular attention to the first string on each line,
since those are the names you will use in the
.Hr param.html#notehead
noteheads parameter
and for
.Hr shaped.html#chord
overriding chord
and
.Hr shaped.html#note
note shapes.
.br
.ne 3i
.TS
l l.
\&"norm" "4n 2n 1n dblwhole quadwhole octwhole"
\&"x" "xnote diamond diamond dwhdiamond quadwhole octwhole"
\&"allx" "xnote xnote xnote xnote xnote xnote"
\&"diam" "filldiamond diamond diamond dwhdiamond quadwhole octwhole"
\&"blank" "blankhead blankhead blankhead blankhead"
\&"righttri" "u?fillrighttriangle u?righttriangle u?righttriangle u?dwhrighttriangle quadwhole octwhole"
\&"isostri" "fillisostriangle isostriangle isostriangle dwhisostriangle quadwhole octwhole"
\&"rect" "fillrectangle rectangle rectangle dwhrectangle quadwhole octwhole"
\&"pie" "fillpiewedge piewedge piewedge dwhpiewedge quadwhole octwhole"
\&"semicirc" "fillsemicircle semicircle semicircle dwhsemicircle quadwhole octwhole"
\&"slash" "fillslashhead slashhead slashhead dwhslashhead quadwhole octwhole"
\&"allslash" "fillslashhead fillslashhead fillslashhead fillslashhead fillslashhead fillshlashhead"
.TE
.P
You can redefine these or define new ones if you wish.
The name (the first of the two strings in the pair)
can be almost anything you want.
The four to six names in the second string must be taken from the list of
valid notehead characters given below, or be characters you have defined
yourself and for which you have provided a ystemoffset value (described in the
.Hr udefsym.html
section on user-defined symbols).
.br
.Hi
.ne 3i
.TS
center;
l l l.
4n 2n 1n
dblwhole quadwhole octwhole
filldiamond diamond dwhdiamond
fillisostriangle isostriangle dwhisostriangle
fillpiewedge piewedge dwhpiewedge
fillrectangle rectangle dwhrectangle
fillrighttriangle righttriangle dwhrighttriangle
ufillrighttriangle urighttriangle udwhrighttriangle
fillsemicircle semicircle dwhsemicircle
fillslashhead slashhead dwhslashhead
xnote altdblwhole blankhead
.TE
.He
.ig
<PRE>
4n 2n 1n
dblwhole quadwhole octwhole
filldiamond diamond dwhdiamond
fillisostriangle isostriangle dwhisostriangle
fillpiewedge piewedge dwhpiewedge
fillrectangle rectangle dwhrectangle
fillrighttriangle righttriangle dwhrighttriangle
ufillrighttriangle urighttriangle udwhrighttriangle
fillsemicircle semicircle dwhsemicircle
fillslashhead slashhead dwhslashhead
xnote altdblwhole blankhead
</PRE>
..
The righttriangle shape names can be prefixed by u? when
used in the headshapes context, to indicate the upside-down version of them should
be used when the stem is down. Note that u? cannot be used on any other
notehead characters, since none of the others have a corresponding
upside-down version.
.P
As an example of how you could use the headshapes context,
suppose you wished to use xnote for half notes and shorter,
and diamond for longer notes.
That is different than either of the built-in values "x" or "allx,"
but you could override one of them:
.Ex
headshapes
"x" "xnote xnote diamond diamond"
.Ee
.P
Another common case is if you want to use the alternate double whole
note symbol. There are two very commonly used forms for double whole.
One has a single vertical line on either side of an ellipse, the other has two
vertical lines. Mup uses the one-line form by default, but if you prefer the
two-line form, you can get that via:
.Ex
headshapes
"norm" "4n 2n 1n altdblwhole"
.Ee
.P
The blankhead does not print any head at all, it just leaves space as if
there were a notehead. It might be used if for some reason you just want
stems.
.H 2 "Noteheads parameter"
.P
.Hr param.html#notehead
The noteheads parameter
describes which notehead shape to use for each pitch
in the scale. It can be specified in score, staff, or voice contexts.
If you want to use the same shape for all pitches,
(as is the case with standard notation), only one shape name is specified.
Thus the default value for this parameter is
.Ex
noteheads = "norm"
.Ee
.P
If you want to use different shapes for different pitches,
the noteheads value needs to be a string containing a list of 7 shape names.
They are listed from the "tonic" of the major key up the scale,
with the key based on the number of sharps or flats in the
.Hr param.html#key
key signature.
The shape names must be from the list of pre-defined head shapes (norm,
xnote, diam, blank, righttri, isostri, rect, pie, semicirc, slash),
or names that you have given as the first in a pair of strings
in the headshapes context.
.P
You can get the most common shaped note system using 4 shapes using:
.Ex
noteheads = "righttri norm rect righttri norm rect diam"
.Ee
There are several shaped notes systems using 7 different shapes.
One such system is specified by:
.Ex
noteheads = "isostri semicirc diam righttri norm rect pie"
.Ee
.P
Once the noteheads parameter is set,
you specify your music just like you would for standard notation,
but Mup will use the appropriate noteheads based on your specifications.
.P
.Ex 1
score
.\" leftmargin=2
.\" rightmargin=2
// Use a 7-shaped system.
noteheads = "isostri semicirc diam righttri norm rect pie"
// Noteheads are given in order for the major key,
// so we'll start out with an example in major.
key = d major
music
// Do a descending scale in D major
1: d+;c+;b;a;
bar
1: g;f;e;d;
dblbar
score
// Now we switch to D minor, where the "tonic"
// will start at the rect and then wrap around.
key = d minor
music
// Do a descending scale in D minor
1: d+;c+;b;a;
bar
1: g;f;e;d;
bar
.Ee
.Hh chord
.H 2 "Overriding chord noteheads"
.P
It is possible to override what note shape to use for a chord,
by giving "hs" followed by a head shape name from the headshapes context,
inside square brackets.
Thus
.Ex
[hs "righttri"]
.Ee
would use the "righttri" headshape. The specific character to use would be
based on the group's duration. In other words, if the chord was a
quarter note or shorter, the "fillrighttriangle" notehead would be used,
but if the chord was a half or whole note, a "righttriangle" notehead would be
used, and a "dwhrighttriangle" would be used for a double whole note.
.P
The hs specification can be used along with other things that can go in the
square brackets. For example,
.Ex
[hs "blank"; len 0]
.Ee
would use blankheads and no stem, resulting in no chord being printed at all!
.Hh note
.H 2 "Overriding individual noteheads"
.P
If you want to override the notehead shape to be used for one specific
note in a chord, you use hs followed by the head shape name
as a string after the note.
.Ex 1
.\" score
.\" leftmargin=2
.\" rightmargin=2
.\" music
1: cg e+ hs "diam"; f a hs "x" c+; 2ge+;
bar
.Ee
.H 2 "Putting it all together to use shaped notes"
.P
In summary,
notehead shapes can be specified in five different places: per note,
per chord, in voice context, in staff context, and in score context.
When deciding what notehead shape to use, Mup checks for specifications
in that order, using the first it finds.
.P
Since fret numbers are used rather than noteheads on
.Hr tabstaff.html
tablature staffs,
the only head shape name that is allowed is "allx."
which is used for "muffled" notes.
.P
Here is a simple example of shaped notes, using the common 4-shape system.
.Ex 1
score
.\" leftmargin=2.5
.\" rightmargin=2.5
noteheads = "righttri norm rect righttri norm rect diam"
staffs=4
key=2#
bracket=1-4
staff 3
clef=treble8
staff 4
clef=bass
music
1: 2c+;4d+;e+;
2: 2e;4a;f;
3: 2e;4f;c;
4: 2a-;4f-;a-;
bar
1: 1d+;
2: 1f;
3: 1d;
4: 1d;
endbar
.Ee
.P
Here is an example of using the same notehead shape for all pitches,
illustrating how the proper version\(emfilled or open\(emof the notehead
is used, based on the note's duration.
.Ex 1
score
.\" leftmargin=2
.\" rightmargin=2
.\" label=""
time=8/4
beamstyle=2,2,2,2
music
1: 8cf;;4;2;1;
bar
score noteheads="isostri"
music
1: 4ec+;8;;2;1;
bar
score noteheads="rect"
music
1: 1gc+;4;2;8;;
bar
score noteheads="pie"
music
1: 8cf;;4;2;1;
bar
score noteheads="x"
music
1: 4ec+;8;;2;1;
bar
score noteheads="slash"
music
1: 1gc+;4;2;8;;
bar
.Ee
.P
And finally, here is a somewhat silly example that demonstrates how
you can use the various shaped notes features to get any kind of
notehead that Mup supports anywhere you want.
.Ex 1
.\" score
.\" leftmargin=1.7
.\" rightmargin=1.7
headshapes
// Make some user-defined head shapes.
// These combinations don't really make sense;
// they are just to demonstrate what you can do.
"reg" "4n 2n 2n 2n"
"other" "fillrectangle diamond isostriangle dblwhole"
score
// Set notesheads, using an arbitrary mixture of built-in
// and user-defined head shapes.
noteheads="norm reg other reg reg other righttri"
music
1: c;d;2e;
bar
1: 2g;f;
bar
1: {b;a;g;}3;2c+;
bar
1: 1d;
bar
// do some shape overrides, both on group and note
1: [ hs "pie" ]2ce; [hs "isostri"] c e g hs "righttri";
endbar
.Ee
.Ht Text Strings
.Hd textstr.html
.H 1 "TEXT STRINGS"
.P
Text strings are used in many different ways.
A text string is enclosed in double quotes,
and can contain any combination of letters, numbers, spaces,
and punctuation.
It can contain a \en to indicate a newline or \eb to indicate a backspace,
.Ix bI
but otherwise cannot contain tabs or other
control characters. If you want a double quote mark inside a string, it
has to be preceded by a backslash, to indicate it is not ending the string:
.Ex
\&"A \e"word\e" in quotes"
.Ee
.P
If you want an actual backslash in a string, it must be entered as two
backslashes.
.P
.Hm strcat
You can concatenate strings with a + sign. Thus the following are equivalent:
.Ix jM
.Ex
\&"this is a string"
\&"this is " + "a string"
.Ee
.Hh symlist
.H 2 "Special characters"
.P
A string can also contain special
music characters.
These are specified
by \e(\fIxxx\fP), where the \fIxxx\fP is a name from the following table:
.Hi
.TS
center;
l l l.
type name music symbol
_
clef gclef G clef (treble clef)
.Ix fI
fclef F clef (bass clef)
cclef C clef (used for alto clef, tenor clef, etc.)
time sig com common time
.Ix gT
cut cut time
accidental flat flat
.Ix bL
.Ix fC
dblflat double flat
sharp sharp
dblsharp double sharp
nat natural
note 4n quarter (and shorter) note notehead
.Ix hL
2n half note notehead
1n whole note
dblwhole double whole note
altdblwhole alternate double whole
quadwhole quadruple whole note (longa)
octwhole octuple whole note (maxima)
dn2n half note with stem down
.Ix hI
dn4n quarter note with stem down
dn8n eighth note with stem down
dn16n 16th note with stem down
dn32n 32nd note with stem down
dn64n 64th note with stem down
dn128n 128th note with stem down
dn256n 256th note with stem down
up2n half note with stem up
up4n quarter note with stem up
up8n eighth note with stem up
up16n 16th note with stem up
up32n 32nd note with stem up
up64n 64th note with stem up
up128n 128th note with stem up
up256n 256th note with stem up
.Ix dH
upflag upward flag
dnflag downward flag
notehead
xnote X-shaped notehead
.Ix bS
diamond open diamond-shaped notehead
.Ix bT
filldiamond filled diamond-shaped notehead
dwhdiamond double whole diamond-shaped notehead
isostriangle open isosceles triangle notehead
fillisostriangle filled isosceles triangle notehead
dwhisostriangle double whole isosceles triangle notehead
piewedge open piewedge notehead
fillpiewedge filled piewedge notehead
dwhpiewedge double whole piewedge notehead
rectangle open rectangle notehead
fillrectangle filled rectangle notehead
dwhrectangle double whole rectangle notehead
righttriangle open right triangle notehead
fillrighttriangle filled right triangle notehead
dwhrighttriangle double whole right triangle notehead
urighttriangle upside-down open right triangle notehead
ufillrighttriangle upside-down filled right triangle notehead
udwhrighttriangle upside-down double whole right triangle notehead
semicircle open semicircle notehead
fillsemicircle filled semicircle notehead
dwhsemicircle double whole semicircle notehead
slashhead open slash notehead
fillslashhead filled slash notehead
dwhslashhead double whole slash notehead
blankhead blank notehead
rest owhrest octuple whole rest
qwhrest quadruple whole rest
dwhrest double whole rest
.Ix hC
1rest whole rest
2rest half rest
4rest quarter rest
8rest eighth rest
16rest sixteenth rest
32rest thirty-second rest
64rest sixty-fourth rest
128rest 128th rest
256rest 256th rest
pedal begped begin pedal mark
.Ix fL
endped end pedal mark
pedal pedal up/down mark
ornaments tr trill
.Ix bX
.Ix fS
.Ix gD
mor mordent
invmor inverted mordent
.Ix gE
turn turn
invturn inverted turn
misc ferm fermata
uferm upside-down fermata
acc_gt accent like a greater-than sign
.Ix bK
acc_hat accent like a "hat" (circumflex or "up-arrow")
acc_uhat accent like an upside-down hat
leg legato mark
.Ix bV
.Ix gX
dot dot
wedge wedge
uwedge upside-down wedge
sign sign for D. S.
.Ix hN
coda coda mark
upbow up bow
dnbow down bow
rr "railroad tracks" or caesura (2 slanted lines sometimes put
at the top of a staff to indicate the end of a musical thought)
measrpt measure repeat
.Ix dZ
.Ix hE
.Ix bO
dblmeasrpt double measure repeat
quadmeasrpt quadruple measure repeat
copyright C-in-circle copyright symbol
dim diminished
.Ix iQ
halfdim half diminished
triangle triangle
perfmaior perfectum maior
perfminor perfectum minor
imperfmaior imperfectum maior
imperfminor imperfectum minor
perfmaiordim perfectum maior diminutum
perfminordim perfectum minor diminutum
imperfmaiordim imperfectum maior diminutum
imperfminordim imperfectum minor diminutum
.TE
.He
.ig
.H 3 Clef
<PRE>
gclef G clef (treble clef)
fclef F clef (bass clef)
cclef C clef (used for alto clef, tenor clef, etc.)
</PRE>
.H 3 Time Signature
<PRE>
com common time
cut cut time
</PRE>
.H 3 Accidentals
<PRE>
flat flat
dblflat double flat
sharp sharp
dblsharp double sharp
nat natural
</PRE>
.H 3 Notes
<PRE>
dn2n half note with stem down
dn4n quarter note with stem down
dn8n eighth note with stem down
dn16n 16th note with stem down
dn32n 32nd note with stem down
dn64n 64th note with stem down
dn128n 128th note with stem down
dn256n 256th note with stem down
up2n half note with stem up
up4n quarter note with stem up
up8n eighth note with stem up
up16n 16th note with stem up
up32n 32nd note with stem up
up64n 64th note with stem up
up128n 128th note with stem up
up256n 256th note with stem up
upflag upward flag
dnflag downward flag
</PRE>
.H 3 Noteheads
<PRE>
4n quarter (and shorter) note notehead
2n half note notehead
1n whole note
dblwhole double whole note
altdoublewhole alternate double whole
quadwhole quadruple whole note (longa)
octwhole octuple whole note (maxima)
xnote X-shaped notehead
diamond open diamond-shaped notehead
filldiamond filled diamond-shaped notehead
dwhdiamond double whole diamond-shaped notehead
isostriangle open isosceles triangle notehead
fillisostriangle filled isosceles triangle notehead
dwhisostriangle double whole isosceles triangle notehead
piewedge open piewedge notehead
fillpiewedge filled piewedge notehead
dwhpiewedge double whole piewedge notehead
rectangle open rectangle notehead
fillrectangle filled rectangle notehead
dwhrectangle double whole rectangle notehead
righttriangle open right triangle notehead
fillrighttriangle filled right triangle notehead
dwhrighttriangle double whole right triangle notehead
urighttriangle upside-down open right triangle notehead
ufillrighttriangle upside-down filled right triangle notehead
udwhrighttriangle upside-down double whole right triangle notehead
semicircle open semicircle notehead
fillsemicircle filled semicircle notehead
dwhsemicircle double whole semicircle notehead
slashhead open slash notehead
fillslashhead filled slash notehead
dwhslashhead double whole slash notehead
blankhead blank notehead
</PRE>
.H 3 Rests
<PRE>
owhrest octuple whole rest
qwhrest quadruple whole rest
dwhrest double whole rest
1rest whole rest
2rest half rest
4rest quarter rest
8rest eighth rest
16rest sixteenth rest
32rest thirty-second rest
64rest sixty-fourth rest
128rest 128th rest
256rest 256th rest
</PRE>
.H 3 Pedal
<PRE>
begped begin pedal mark
endped end pedal mark
pedal pedal up/down mark
</PRE>
.H 3 Ornaments
<PRE>
tr trill
mor mordent
invmor inverted mordent
turn turn
invturn inverted turn
</PRE>
.H 3 Miscellaneous
<PRE>
ferm fermata
uferm upside-down fermata
acc_gt accent like a greater-than sign
acc_hat accent like a "hat" or ^ (circumflex or "up-arrow")
acc_uhat accent like an upside-down hat
leg legato mark
dot dot
wedge wedge
uwedge upside-down wedge
sign sign for D. S.
coda coda mark
upbow up bow
dnbow down bow
rr "railroad tracks" or caesura (2 slanted lines sometimes put
at the top of a staff to indicate the end of a musical thought)
measrpt measure repeat
dblmeasrpt double measure repeat
quadmeasrpt quadruple measure repeat
copyright C-in-circle copyright symbol
dim diminished
halfdim half diminished
triangle triangle
perfmaior perfectum maior
perfminor perfectum minor
imperfmaior imperfectum maior
imperfminor imperfectum minor
perfmaiordim perfectum maior diminutum
perfminordim perfectum minor diminutum
imperfmaiordim imperfectum maior diminutum
imperfminordim imperfectum minor diminutum
</PRE>
..
.Hi
.SK
.if \n(.P \{
.ie \n(.g \{
.nr Boxpict 0
.nr Nn 0
.Pt muschar.ps
.nr Boxpict 1
.nr Nn 1
.nop \}
.el \{
\!x X PI:\n(.o:\n(.i:\n(.l:\n(.t:muschar.ps:9,6.3,0,0:t:
\ \ \ \}
.He
.ig
<BR>
<IMG SRC="muschar.gif" ALT="music characters">
<BR>
..
.P
Any of these music character names can be prefixed by "sm" to indicate a
smaller version of the character. For example, "smup4n" is a small quarter
.Ix gY
note, as might be used for a "cue" note.
.Ix bB
.Ix hL
Small music characters are 0.65 times as big as regular characters.
.P
.Hm special
Various non-ASCII characters
can be included in text strings. If you have a non-United States keyboard
which can produce characters listed in the table below
from the "Latin-1" alphabet, you can simply type them into strings as
you normally would. If you want a character that your keyboard does not
support, you can put them in strings
by using their names in a manner similar to the music characters.
For example, you can include an "a" with an acute accent on it in
.Ix bK
.Ix hB
a string by using \e(aacute), or an upside-down question mark
using \e(questiondown).
.P
There are 2-character shortcut names for many
of the letters with diacritical marks. The shortcut names
consist of the letter and a character representing the diacritical mark.
So, for example, \e(aacute) can also be specified
by just \e(a'), \e(Egrave) can also be specified by \e(E`), \e(ntilde)
can be specified as \e(n~), and \e(Ocircumflex)
can be specified as \e(O^). The following table lists the diacritical mark
names, their shortcut symbols, and the list of available shortcut names
using those symbols:
.TS
center, allbox;
l c l.
acute ' A' a' C' c' E' e' I' i' L' l' N' n' O' o' R' r' S' s' U' u' Y' y' Z' z'
breve ( A( a( E( e( G( g( I( i( O( o( U( u(
caron v Cv cv Dv dv Ev ev Lv lv Nv nv Rv rv Sv sv Tv tv Zv zv
cedilla , C, c, S, s,
circumflex ^ A^ a^ C^ c^ E^ e^ G^ g^ H^ h^ I^ i^ J^ j^ O^ o^ S^ s^ U^ u^ W^ w^ Y^ y^
dieresis : A: a: E: e: I: i: O: o: U: u: Y: y:
dotaccent . C. c. E. e. G. g. I. A. z.
grave ` A` a` E` e` I` i` O` o` U` u`
macron - A- a- E- e- I- i- O- o- U- u-
ogonek c Ac ac Ec ec Ic ic Uc uc
ring o Ao ao Uo uo
slash / L/ l/ O/ o/
tilde ~ A~ a~ I~ i~ N~ n~ O~ o~ U~ u~
.TE
.P
There are also a few special case shortcut names:
.TS
center, allbox;
l c.
germandbls ss
quotedblleft ``
quotedblright ''
guillemotleft <<
guillemotright >>
.TE
.P
The following charts list the full names of
all of the available named characters, and shows what they look like.
.Hi
.nr Boxpict 0
.sp -6
.Pt ext_1.ps
.sp -6
.Pt ext_2.ps
.sp -6
.Pt ext_3.ps
.sp -6
.Pt ext_4.ps
.nr Boxpict 1
.He
.ig
<P>
<IMG SRC="ext_1.gif" ALT="extended characters">
</P>
<P>
<IMG SRC="ext_2.gif" ALT="extended characters">
</P>
<P>
<IMG SRC="ext_3.gif" ALT="extended characters">
</P>
<P>
<IMG SRC="ext_4.gif" ALT="extended characters">
..
.P
.Hm space
One of the special characters
is specified by \e(space).
.Ix gZ
This character appears as a normal space on output, but is not treated
like a space when Mup is looking for word or syllable boundaries.
The most common use for this is probably in
.Hr lyrics.html
lyrics
when you want several words to be sung on a single note.
Another use would be in cases where Mup would normally split up a long
string between words in order to avoid running off the edge of a page,
but you want to prevent that split.
.Hh keymaps
.H 2 "Keymaps"
.P
Typing in the names for the non-ASCII characters can become tedious,
so if you are using some of them often,
.Ix jL
defining a keymap may be helpful.
The keymap context is typically used to take the letters you type in,
and map them to some other alphabet, but it could be used for
other kinds of mapping inside strings as well.
You can define up to 100 different keymaps, and you
can assign different mappings to different kinds of text. You give each
keymap a name, and then can set parameters to that name to cause mapping.
.P
A keymap context begins with a line with the word "keymap," followed by
a string in double quotes, giving a name for the map.
The name can be anything you like.
This is followed by lines containing pairs of strings. The first in each
pair is a pattern to be matched, and the second is the replacement.
The pattern strings can only contain letters (uppercase or lowercase) and
the equals sign. The replacement strings can only contain
regular characters or the special named characters of the form \e(XXX).
They cannot contain other "backslash escapes" like changes in font or size.
Mapping is done as strings are parsed, not when they are printed.
.P
As an example, you could set up a mapping to allow something close to
phonetic spelling on an English keyboard,
but have the results come out in Cyrillic.
The Mup distribution has an "include" file for one possible mapping
of the full Cyrillic alphabet, but as a small example,
to get the Russian word for "song" you could do
.Ex 1
keymap "Russian"
// map approximate phonetic equivalents to their Cyrillic symbols
"e" "\e(afii10070)"
"n" "\e(afii10079)"
"p" "\e(afii10081)"
"s" "\e(afii10083)"
"q" "\e(afii10097)"
score
.\" leftmargin=2
.\" rightmargin=2
defaultkeymap="Russian"
.\" fontfamily=courier
music
// enter Russian string phonetically
title "pesnq"
.\" block
.\"paragraph ""
.Ee
.P
In the previous example, the text string to be matched
was only a single character, and the replacement string
was also a single character, albeit one that normally has
to be specified by a long name. Either or both can actually be
multiple characters. So you could do something like
.Ex
keymap "names"
"Ted" "Theodore"
"Liz" "Elizabeth"
.Ee
and then "Ted and Liz" would become "Theodore and Elizabeth"
.P
As another example, suppose you want to use various styles of arrows
in different places, and would like to have shorter names.
You could do something like this:
.Ex 1
keymap "arrows"
"=l" "\e(arrowleft)"
"=r" "\e(arrowright)"
"==l" "\e(arrowdblleft)"
"==r" "\e(arrowdblright)"
"=ll" "\e(arrowleft)\e(arrowleft)"
"=rr" "\e(arrowright)\e(arrowright)"
score
.\" leftmargin=3
.\" rightmargin=3
defaultkeymap="arrows"
block
paragraph "=r between arrows =l";
paragraph "==r between double arrows ==l";
paragraph "=rr between pairs of arrows =ll";
.Ee
.P
Patterns are matched left to right, using the longest pattern that matches.
Thus for a pattern/replacement list of
.Ex
"a" "X"
"b" "Y"
"ab" "Z"
.Ee
the string "abba" would become "ZYX"
.P
There are a number of parameters that specify what kind of text strings
to map. These parameters are:
.TS
center, allbox;
c c
l l.
PARAMETER WHEN USED
_
defaultkeymap when nothing else applies
endingkeymap text on endings
labelkeymap staff and group labels
lyricskeymap lyrics
printkeymap print, left, right, center, title
rehearsalkeymap user-defined rehearsal marks
textkeymap rom, ital, bold, boldital
withkeymap "with" lists on chords
.TE
.P
Having these different parameters generally makes it easy to do things
like set a mapping for lyrics and titles,
but leave musical directions like "Allegro" unmapped.
To determine which mapping to use, Mup first looks up the specific
parameter, and if that is not set, then it will fall back to using
the value of the defaultkeymap parameter. Thus, for example, if you
wanted only lyrics to be in Greek, with everything else left unmapped,
you could define a Greek keymap and set
.Ex
lyricskeymap="Greek"
.Ee
Or if you wanted everything except "with" lists to be Cyrillic, you could do
something like
.Ex
defaultkeymap="Cyrillic"
withkeymap=""
.Ee
Note that the special name "" is used to mean "no mapping."
You can also set these parameters to nothing at all,
which effectively "unsets" them. So if you later wanted "with" lists
to also be in Cyrillic like everything else, you could just do
.Ex
withkeymap=
.Ee
which basically "unhides" the defaultkeymap value that had been
overridden by the withkeymap value.
.P
It is possible to change keymaps in the middle of a string
by using \em(keymap_name). This might be used if you want just part of
a sentence in a different alphabet:
.Ex
"This would be written \em(Russian)pesnq \em() in Russian."
.Ee
As shown, an empty keymap name of \em() means to return to normal literal text,
without any mapping.
.Hh fonts
.H 2 "Font and size changes"
.P
Strings can contain special codes to indicate changes in font or size.
.Ix bG
.Ix bH
The font codes begin with \ef, and
can either be spelled out, as in the first column of
the table below, or as the abbreviations given in the second column.
.Hi
.DS
.TS
center;
c c c
l l l.
Code Abbr Meaning
_
\ef(avantgarde rom) \ef(AR) change to \f(ARAvant Garde roman font\fP
\ef(avantgarde bold) \ef(AB) change to \f(ABAvant Garde bold font\fP
.Ix gH
.Ix gI
.Ix gJ
.Ix gK
\ef(avantgarde ital) \ef(AI) change to \f(AIAvant Garde italic font\fP
\ef(avantgarde boldital) \ef(AX) change to \f(AXAvant Garde bold-italic font\fP
_
\ef(bookman rom) \ef(BR) change to \f(KRBookman roman font\fP
\ef(bookman bold) \ef(BB) change to \f(KBBookman bold font\fP
\ef(bookman ital) \ef(BI) change to \f(KIBookman italic font\fP
\ef(bookman boldital) \ef(BX) change to \f(KXBookman bold-italic font\fP
_
\ef(courier rom) \ef(CR) change to \f(CWCourier roman font\fP
\ef(courier bold) \ef(CB) change to \f(CBCourier bold font\fP
\ef(courier ital) \ef(CI) change to \f(CICourier italic font\fP
\ef(courier boldital) \ef(CX) change to \f(CXCourier bold-italic font\fP
_
\ef(helvetica rom) \ef(HR) change to \fHHelvetica* roman font\fP
\ef(helvetica bold) \ef(HB) change to \f(HBHelvetica bold font\fP
\ef(helvetica ital) \ef(HI) change to \f(HIHelvetica italic font\fP
\ef(helvetica boldital) \ef(HX) change to \f(HXHelvetica bold-italic font\fP
_
\ef(newcentury rom) \ef(NR) change to \f(NRNew Century roman font\fP
\ef(newcentury bold) \ef(NB) change to \f(NBNew Century bold font\fP
\ef(newcentury ital) \ef(NI) change to \f(NINew Century italic font\fP
\ef(newcentury boldital) \ef(NX) change to \f(NXNew Century bold-italic\fP
_
\ef(palatino rom) \ef(PR) change to \f(PAPalatino roman font\fP
\ef(palatino bold) \ef(PB) change to \f(PBPalatino bold font\fP
\ef(palatino ital) \ef(PI) change to \f(PIPalatino italic font\fP
\ef(palatino boldital) \ef(PX) change to \f(PXPalatino bold-italic font\fP
_
\ef(times rom) \ef(TR) change to Times* roman font
\ef(times bold) \ef(TB) change to \fBTimes bold font\fP
\ef(times ital) \ef(TI) change to \fITimes italic font\fP
\ef(times boldital) \ef(TX) change to \f(BITimes bold-italic font\fP
_
\ef(previous) \ef(PV) change back to previous font
\ef(rom) \ef(R) change to roman in the current family
\ef(ital) \ef(I) change to \fIitalics\fP in the current family
\ef(bold) \ef(B) change to \fBbold\fP in the current family
\ef(boldital) \ef(X) change to \f(BIbold italics\fP in the current family
.TE
.DE
.FS *
Times is a trademark and Helvetica is a registered trademark of Allied Corporation.
.FE
.He
.ig
<PRE>
Code Abbr Meaning
\f(avantgarde rom) \f(AR) Avant Garde roman font
\f(avantgarde bold) \f(AB) Avant Garde bold font
\f(avantgarde ital) \f(AI) Avant Garde italic font
\f(avantgarde boldital) \f(AX) Avant Garde bold-italic font
\f(bookman rom) \f(BR) Bookman roman font
\f(bookman bold) \f(BB) Bookman bold font
\f(bookman ital) \f(BI) Bookman italic font
\f(bookman boldital) \f(BX) Bookman bold-italic font
\f(courier rom) \f(CR) Courier roman font
\f(courier bold) \f(CB) Courier bold font
\f(courier ital) \f(CI) Courier italic font
\f(courier boldital) \f(CX) Courier bold-italic font
\f(helvetica rom) \f(HR) Helvetica* roman font
\f(helvetica bold) \f(HB) Helvetica bold font
\f(helvetica ital) \f(HI) Helvetica italic font
\f(helvetica boldital) \f(HX) Helvetica bold-italic font
\f(newcentury rom) \f(NR) New Century roman font
\f(newcentury bold) \f(NB) New Century bold font
\f(newcentury ital) \f(NI) New Century italic font
\f(newcentury boldital) \f(NX) New Century bold-italic
\f(palatino rom) \f(PR) Palatino roman font
\f(palatino bold) \f(PB) Palatino bold font
\f(palatino ital) \f(PI) Palatino italic font
\f(palatino boldital) \f(PX) Palatino bold-italic font
\f(times rom) \f(TR) Times* roman font
\f(times bold) \f(TB) Times bold font
\f(times ital) \f(TI) Times italic font
\f(times boldital) \f(TX) Times bold-italic font
\f(previous) \f(PV) previous font
\f(rom) \f(R) change to roman in the current family
\f(ital) \f(I) change to italics in the current family
\f(bold) \f(B) change to bold in the current family
\f(boldital) \f(X) change to bold italics in the current family
</PRE>
..
Some of the
.Hr textstr.html#special
special characters
look better in some fonts than others. We have found that
.Ix cE
.Ix cF
a few older PostScript interpreters unfortunately don't always
implement all the special characters in all fonts, so if you have
one of those, you may want to see if a newer version is available
that corrects the problem.
.P
If you need a font other than those Mup supports directly,
it is possible to override Mup's built-in fonts with other fonts.
This is described later in the
.Hr fontfile.html
section on "Installing other fonts."
.P
.Hm size
The point size can also be changed. (A "point" is about 1/72 of an inch.)
.Ix bH
.Hi
.DS
.TS
center;
c c
l l.
Code Meaning
_
\es(\fIN)\fP change to point size \fIN\fP
\es(+\fIN)\fP increase point size by \fIN\fP points
\es(-\fIN)\fP decrease point size by \fIN\fP points
\es(PV) or \es(previous) revert to previous size
.TE
.DE
.He
.ig
<PRE>
Code Meaning
\s(\fIN)\fP change to point size \fIN\fP
\s(+\fIN)\fP increase point size by \fIN\fP points
\s(-\fIN)\fP decrease point size by \fIN\fP points
\s(PV) or \s(previous) revert to previous size
</PRE>
..
The point size can range from 1 to 100. A font or size change will last until
changed or until the end of the string. Any subsequent strings will begin
with default font and size values, except in the case of
.Hr lyrics.html
lyrics,
.Ix aE
where font and size information is maintained separately
for each staff and verse, and carried forward from measure to measure, and
.Hr bars.html#reh
rehearsal marks,
where the information is also carried forward.
.Ix cJ
.Ix hG
.Ix hK
The default values can be set as described in
.Hr param.html
the "Parameters" section.
The
.Hr textstr.html#symlist
music symbols
are affected by size changes.
If a music symbol follows a specification for italics, bold, or bolditalics,
it will be slanted and/or made bold, as appropriate.
.P
Here are some examples of strings:
.Ex
\&"hello"
\&"( \e(up2n) = 100 )"
\&"\ef(TB)this will be bold. \ef(TI)this will be italics"
\&"A \ef(TX)\es(+12)BIG\ef(PV)\es(-12) word"
\&"\ef(newcentury boldital)Allegro"
.Ee
.H 2 "Horizontal and vertical motion"
.P
It is also possible to specify a string that takes up more than one line,
by putting a "\en" where you want to move to a new line. The place where
this is most likely to be useful is for
.Hr param.html#label
staff labels,
.Ix dP
which you may want
to make multi-line, to keep them from becoming excessively wide.
For example:
.Ex
\&"Violins\enI&II"
.Ee
.P
.Ix bI
A "\eb" can be used to specify a backspace. This might be useful for
.Ix hO
adding underlines to text.
If you wish to use letters with diacritical marks,
.Ix cR
you will probably want to use the
.Hr textstr.html#special
special characters,
described earlier in this section,
rather than trying to construct them using the plain letter,
a backspace, and the mark.
.P
You are not allowed to back up to before the beginning of a line.
Note that in all fonts except Courier,
different characters have different widths, so
using backspaces can be a bit tricky. For example, underlining a 5-letter
word might require more than 5 underscores, if the characters in the word
.Ix fW
are wider than an underscore character. In general, it works better to
enter an entire string, then backspace to add underscoring or accents, rather
than doing them along the way. For example, "My\eb\eb___" will line up
much better than "M\eb_y\eb_".
.P
.Hm vert
Vertical motion within a string
can be specified using "\ev(\fIN\fP)"
.Ix iR
where \fIN\fP is some percentage of the current font height.
The distance may be negative for downward motion
or positive for upward motion, ranging from -100 to 100.
.Ix iL
This might be used for creating superscripts and subscripts, although
the next section describes an alternate way of doing that which is
usually better. It might also be used just to line something up differently
than Mup normally would.
You cannot put newlines (with \en) in the same string with vertical
motion.
.H 2 "Piled text, for superscripts, subscripts, etc."
.P
It is also possible to "pile up" lines of text in a string.
Some common uses of this could be for superscripts and subscripts or for
.Ix iN
figured bass notation.
Some facilities to specifically deal with
.Hr textmark.html#chordmod
figured bass
will be described in a later section, but
here we describe the general-purpose constructs for piling text.
.Ix iO
A \e: is used to indicate the beginning of piling. Any subsequent
instances of \e: in the same string will alternately turn piling off and on.
When a pile is begun, the text size is automatically made smaller, and
the text baseline is moved up, so that the first line of piled text is
like a superscript, and the next like a subscript. If there are additional
lines, they are placed below the subscript.
By default, the lines in a pile are placed such that the last digit
in each line will line up, or if there is no digit, the last character.
However, you can force different alignment.
.Ix iP
A \e| will force alignment at that point, or a \e^ will force alignment
at the center of the following character. A maximum of one alignment marker
can be specified on each line of a pile.
You cannot put newlines (with \en) in the same string with piling.
A new line of the pile is started at each <space> character in the input string.
If you want an actual literal space inside a piled line, it must be
preceded with a backslash. As an example:
.Ex 1
.\" block
.\" paragraph rom (18) \e
"Text\e:superscript subscript\e: back to normal.";
.\" paragraph rom (8) " "
.\" paragraph rom (18) \e
"This pile \e:has\e literal spaces\e in\e it.";
.\" paragraph rom (8) " "
.\" paragraph rom (18) \e
"This pile \e:h\e^as align\e|ment spec\e^ified.";
.Ee
.H 2 "Slash through number"
.P
Another thing which is common in figured bass notation
.Ix cA
is to draw a slash through a number. Again, the section on
.Hr textmark.html#chordmod
figured bass
will describe how to do that inside figured bass,
but it is possible to put a slash through a number elsewhere by
placing a backslashed slash after a number, like this:
.Ex
"6\e/"
"10\e/"
.Ee
.Hh boxed
.H 2 "Boxed or circled text"
.P
You can cause the text to be
.Ix iG
printed inside a box by placing a \e[ at
the beginning of the string and a \e] at the end of the string.
Similarly you can cause text to be placed inside a circle (or ellipse
for strings that are wide) by placing a \e{ at
the beginning of the string and a \e} at the end of the string.
Boxed or circled text are not allowed in
.Hr lyrics.html
lyrics.
.Ex 1
.\" block
.\" paragraph rom (16) \e
"\e[This is in a box\e]"
.\" paragraph rom (20) " "
.\" paragraph rom (14) \e
"\e{This is in an ellipse\e}"
.Ee
.ig
<HR>
* Times is a trademark and Helvetica is a registered trademark of Allied Corporation.
..
.Ht "Tempo, dynamic marks, ornaments, etc."
.Hd stuff.html
.H 1 "TEMPO, DYNAMIC MARKS, ORNAMENTS, ETC."
.Ix fR
.Ix fS
.H 2 "General information"
.P
There are a number of symbols and other markings that appear frequently
in music and are normally associated with a particular time or place in the
.Ix gT
composition. There are several classes of such symbols, all of which are
handled by Mup in a somewhat similar fashion. The general format of these
statements is:
.Ex
\fImark_type place staff(s) distance aligntag : begintime text duration;\fP
.Ee
.Ix dK
.Ix fP
.Ix hK
.P
The \fImark_type\fP can be any of the following:
.Hi
.DS
.TS
center;
c c
l l.
Mark_type Meaning
_
.Ix gH
.Ix gI
.Ix gJ
.Ix gK
rom text in roman font
ital text in italic font
bold text in bold font
boldital text in bold-italic font
.Ix fT
mussym music symbol (fermata, coda sign, etc.)
phrase phrase mark
.Ix cL
.Ix cM
.Ix fJ
.Ix gA
< crescendo "hairpin"
> decrescendo "hairpin"
octave play 1 or more octaves higher or lower
pedal piano pedal marks
.Ix fL
.TE
.DE
.He
.ig
<PRE>
Mark_type Meaning
rom text in roman font
ital text in italic font
bold text in bold font
boldital text in bold-italic font
mussym music symbol (fermata, coda sign, etc.)
phrase phrase mark
< crescendo "hairpin"
> decrescendo "hairpin"
octave play 1 or more octaves higher or lower
pedal piano pedal marks
</PRE>
..
.Ix bG
.P
The \fIplace\fP is as for
.Hr lyrics.html
lyrics:
above, below, or between.
.Ix bJ
.Ix dL
.Ix dM
There are some restrictions, as summarized below:
.Hi
.DS
.TS
center;
c c s s c
c c c c c
l c c c l.
place allowed
mark_type above below between default
_
rom yes yes yes above
bold yes yes yes above
ital yes yes yes above
boldital yes yes yes above
mussym yes yes yes above
phrase yes yes no varies
< yes yes yes above
> yes yes yes above
octave yes yes no none
pedal no yes no below
.TE
.DE
.He
.ig
<PRE>
place allowed
mark_type above below between default
rom yes yes yes above
bold yes yes yes above
ital yes yes yes above
boldital yes yes yes above
mussym yes yes yes above
phrase yes yes no varies
< yes yes yes above
> yes yes yes above
octave yes yes no none
pedal no yes no below
</PRE>
..
.P
.Hr octave.html
Octave marks
must include a \fIplace\fP of above or below.
For all the other mark_types, the \fIplace\fP is optional. For
.Hr phrase.html
phrase,
if \fIplace\fP is not specified, Mup determines it
on a case-by-case basis, depending on the location of the notes,
unless the
.Hr param.html#defphside
defaultphraseside parameter
is set to force a side.
.P
As with musical data or lyrics, the \fIstaff\fP can be a single
number or may include lists and ranges. In the case of "between",
staff numbers must be in pairs, separated by an "&", with the second
staff number one greater than the first.
.P
The \fIstaff\fP can also be specified by the keyword "all," in which
.Ix cQ
.Ix gL
case the mark will be placed above the top visible staff or below the
.Ix gM
.Ix gN
bottom visible staff.
.P
Here are some examples:
.Ex
rom 3:
boldital below 1:
< between 3&4:
pedal below 2:
octave above 3:
phrase 3,4:
mussym above 2-3, 5:
ital between 1&2, 3&4:
.Ee
.P
.Hm dist
The
\fIdistance\fP is optional. It is specified by the keyword "dist" followed
by a number. This number overrides the
.Hr param.html#dist
dist,
.Hr param.html#chdist
chorddist,
or
.Hr param.html#dyndist
dyndist
parameter value that would normally apply, and is given in stepsizes.
If the number is followed by a ! the items will be placed at exactly that
distance from the edge of the staff,
without regard for anything they might overwrite.
Otherwise the normal rules apply: the dist is a minimum value, and items
may be placed farther away than this to avoid colliding with other things.
If the ! is used, the number is allowed to be negative,
which allows you to place items inside the staff.
A dist cannot be specified with phrase or between.
.Ex 1
score
.\" leftmargin=1.5
.\" rightmargin=1.5
dist=2
music
rom above 1: 1 "normal dist";
rom above 1 dist 4: 2 "dist 4"; // higher than usual
rom above 1 dist 0! : 3 "forced 0"; // lower than normal
mussym above 1 dist -2! : 4.5 "rr"; // forced down into staff
1: c;;;;
endbar
.Ee
.P
The \fIaligntag\fP is optional, and allows forcing several items to
be placed at the same vertical position. This will be covered in more detail
.Hr stuff.html#aligntag
a bit later.
.P
After the colon comes one or more items to be printed. Each item contains
at least a begintime specification. Some may also contain a
.Ix dK
.Ix hA
.Ix hB
.Hr textstr.html
text string
and/or
a duration. Each item ends with a semicolon. A newline ends the list of items.
.Ix hH
.P
The begintime describes where in time the item should be printed. It is
a number ranging from 0 to the numerator (top number)
.Ix gM
of the
.Hr param.html#time
time signature
.Ix gU
plus one.
0 refers to the bar line at the beginning of the current measure, 1 refers
to the first beat of the measure, 2 to the second beat, etc., with the
.Ix dJ
.Ix gG
.Ix hG
maximum value referring to the bar line which ends the measure. A "beat"
is whatever time value is given by the denominator (bottom number)
.Ix gN
of the time signature.
For example, in 4/4 or 3/4 time, a beat is a quarter note, whereas in 6/8
.Ix hL
or 9/8 time, a beat is an eighth note. Fractional values can be specified
using a decimal number. Thus 1.5 is halfway between beats 1 and 2,
while 2.66 is about 2/3 of the way between beats 2 and 3.
For
.Hr param.html#time
time signatures
that are the addition of two or more fractions, like 4/4 + 3/8,
a "beat" is given by the largest denominator.
.P
.Ix aL
.Ix dJ
.Ix hL
Since grace notes effectively take zero time, special notation is used
.Ix gT
to place something relative to a grace note. The \fIbegintime\fP can be
.Ix dK
followed by a number of grace notes to "back up" from the beat.
The number is a negative number enclosed in parentheses.
.P
The beat time value can optionally be followed by
.Hm stepoff
an offset, in stepsizes.
This offset is a number in square brackets.
The number must begin with a + or - sign.
It can optionally include a decimal point and fractional part.
A negative offset will cause the item to
be moved to the left, while a positive offset will cause it
to be moved to the right.
This offset is used as a final adjustment after all the other placement
has been done. A common use for this would be if you want to place something
slightly before the beginning of the first measure of a song. You could
then specify something like:
.Ex
rom above all: 0 [-3.5] "Allegro";
.Ee
which would place the "Allegro" 3.5 stepsizes left of the beginning
of the measure.
.P
The grace note backup, if any, must occur before the
stepsize offset, if any.
For example:
.Ex 1
.\"score leftmargin=2; rightmargin=2
.\"music
1: c; [grace] 8d; []e; []f; 2.g;
ital above 1: 2(-3)[+1] "cresc.";
bar
.Ee
would find the chord at or closest to count 2,
.Ix gW
and back up 3 grace notes from there, then move right by 1 stepsize.
.P
For items that include a duration, the duration tells the ending point of
the item. A duration is specified by:
.Ex
\fBtil\fP \fIM\fP\fBm\fP + \fIN\fP
.Ee
.Ix gV
where \fIM\fP is a number of
.Hr bars.html
bar lines
to cross, and \fIN\fP is a number of additional beats.
(An "m" is used because it counts the number of measures.)
If either of them is 0, it can be omitted,
but at least one of them must be non-zero.
.P
This can optionally be followed by
a grace backup and/or an offset, like the start time.
The grace backup is a negative number in parentheses,
telling how many grace notes to back up. The steps
offset is a number in square brackets,
which must begin with a + or - sign,
and can optionally include a decimal point and fractional part.
A negative offset will cause the item to
be moved to the left, while a positive offset will cause it
to be moved to the right.
This offset is used as a final adjustment after all the other placement
has been done.
Here are some examples:
.Ex
til 3 // until beat 3 of current measure
til 1m+2 // until beat 2 of next measure
til 1m // until next bar line
til 3m+2.8[-1.5] // 3 bar lines and 2.8 beats, then left 1.5 stepsizes
.Ee
.P
Whether the text and duration are allowed or required depends on the mark_type,
as summarized below:
.Hi
.DS
.TS
center, box;
c|c|c
l|l|l.
mark_type text duration
=
rom required optional
bold required optional
ital required optional
boldital required optional
mussym required allowed on tr only
phrase not allowed required
< not allowed required
> not allowed required
octave required optional
pedal * or nothing not allowed
.TE
.DE
.He
.ig
<PRE>
mark_type text duration
rom required optional
bold required optional
ital required optional
boldital required optional
mussym required allowed on tr only
phrase not allowed required
< not allowed required
> not allowed required
octave required optional
pedal * or nothing not allowed
</PRE>
..
.P
If there are several items, such that they have to be stacked on top
.Ix gM
.Ix gN
of each other, all items of a particular class are placed from top to bottom
according to input order. The classes are done in the order
shown in the table below, unless the order is overridden by
the
.Hr param.html#aboveord
aboveorder,
.Hr param.html#beloword
beloworder,
or
.Hr param.html#betwnord
betweenorder
parameters.
.Hi
.DS
.TS
center, box;
c|c
l|l.
Place mark_type order
=
above (from bottom up)
.Ix bJ
phrase
.Ix fT
.Ix gH
.Ix gI
.Ix gJ
.Ix gK
mussym
octave
rom bold ital boldital < >
lyrics
endings
rehearsal marks
_
below (from top down)
phrase
mussym
octave
rom bold ital boldital < >
lyrics
pedal
_
between (from bottom up)
.Ix dM
mussym
rom bold ital boldital < >
lyrics
.TE
.DE
.He
.ig
<PRE>
above (from bottom up)
phrase
mussym
octave
rom bold ital boldital < >
lyrics
endings
rehearsal marks
below (from top down)
.Ix dL
phrase
mussym
octave
rom bold ital boldital < >
lyrics
pedal
between (from bottom up)
mussym
rom bold ital boldital < >
lyrics
</PRE>
..
.P
.Ix aE
.Ix aQ
.Ix aR
For example, for the above items, all phrases will be placed as close to the
staff as possible, then mussym items above them, then octave marks above
.Ix hK
them, etc. However, if there are several mussym items that belong at the
same horizontal position, the first one entered in the input will be printed
above the second, the second one entered will be printed above the third, etc.
All of the "above all" items of a given class will be above the
items of that class for the top visible staff,
and all "below all" items of a given class will be below the
items of that class for the bottom visible staff.
.Ix cQ
.P
Additional control of placement can be imposed by the
.Hm aligntag
optional align tag.
.Ix iP
This is the keyword "align" followed by a number between 0 and 10000 inclusive.
On a given score, all marks in the same placement order level and
having the same align tag value will be placed together,
so that they will all be aligned at the same vertical position.
An align tag can only be applied to text (rom, ital, bold, boldital)
and crescendo and decrescendo marks.
It can also be used on pedal, but only when the
.Hr param.html#alignped
alignped parameter
is set to n.
Among marks with the same placement order level,
those without alignment are placed first. Then those with alignment
are placed, in ascending numerical order of the align tag.
If any of the aligned marks also have a dist specified, the rightmost
such dist applies to all with that alignment tag, otherwise the
largest default distance is used. If any also have ! specified,
to force an exact distance, that applies to all.
.P
If after placing a set of aligned marks, Mup determines that any of them
overlap horizontally, it will squeeze
the one on the left in an attempt to avoid the overlap\(emto a point.
If some overlap remains even after squeezing as much as is allowed by the
.Hr param.html#minalign
minalignscale parameter,
Mup will issue a warning. You can then adjust things yourself if you wish.
.P
Here is an example showing the impact of using alignment. The two measures
are the same, except the second uses alignment tags.
Note that since in this example only a single align tag value
is used for above and one for below, there is no need for specifying an
order among alignment tags, so the numeric values can be arbitrary.
.Ex 1
score
beamstyle=2,2
.\"leftmargin=1.5
.\"rightmargin=1.5
music
rom above 1: 1 "Allegro con brio";
ital above 1: 3 "dolce";
1: [with .]... 8g-;a-;b-;c;g;a;g;a;
< below 1: 1 til 2.8;
boldital dyn below 1: 3 "mf";
> below 1: 3.3 til 4.8;
bar
rom above 1 align 17: 1 "Allegro con brio";
ital above 1 align 17: 3 "dolce";
1: [with .]... 8g-;a-;b-;c;g;a;g;a;
< below 1 align 3: 1 til 2.8;
boldital dyn below 1 align 3: 3 "mf";
> below 1 align 3: 3.3 til 4.8;
bar
.Ee
.Hi
.P
We now discuss each of the mark_types in more detail.
.He
.ig
.br
.Hr textmark.html
Text
.br
.Hr mussym.html
Music symbols
.br
.Hr phrase.html
Phrase marks
.br
.Hr cres.html
Crescendo and decrescendo marks
.br
.Hr octave.html
Octave marks
.br
.Hr pedal.html
Piano pedal marks
.br
.Hr roll.html
Rolls
..
.Ht Mup Text Marks
.Hd textmark.html
.H 2 "Text"
.P
The four forms of Mup text statements
(rom, bold, ital, and boldital) operate identically except for the font
.Ix gH
.Ix gI
.Ix gJ
.Ix gK
.Ix bG
which is used.
.P
The text statements can have several additional qualifiers. The first is a
.Ix gB
fontfamily, given before the font. It can have any of the values of
.Hr param.html#fontfam
the "fontfamily" parameter
(avantgarde, bookman, courier, helvetica,
newcentury, palatino, or times), with the default being the value of
the "fontfamily" parameter.
.P
The next optional qualifier is a
.Ix bH
point size, given in parentheses after the font type of rom, bold, etc.
If this is omitted, the size is obtained from
.Hr param.html#size
the "size" parameter
for the given staff, or for the score if the staff is specified by "all."
.Ix cQ
.Ix hJ
.Hh chordmod
.H 3 "Chord, analysis, figured bass, and dynamics"
.P
The final optional qualifier specifies special treatment of the text.
.Ix iM
.Ix iN
The qualifier can be "chord", "analysis", "figbass", or "dyn".
.Ix gW
The "chord" modifier is typically used for marking chords that might be
played by a guitar or other instrument. The "analysis" modifier is
typically used when marking harmonic analysis like "IV" or "vii".
The "figbass" modifier is for figured bass notation.
For all three, distance from the staff is affected by
.Hr param.html#chdist
the "chorddist" parameter.
.Ix dO
The "dyn" modifier is to mark the text as something that specifies
dynamics. Mup only uses it when deciding where to place the text;
something marked "dyn" will be treated like crescendo
and decrescendo "hairpins."
The default \fIplace\fP for chord and dyn is above, whereas the default
for the others is below.
.P
The text strings used with these chord, analysis, or figbass modifiers can
contain any characters, but
characters that indicate accidentals ("#", "&", "x", "&&", and "n")
.Ix fC
are translated to the appropriate music character, while "o", "o/",
.Ix iQ
and "^" are translated to "\e(dim)", "\e(halfdim)", and "\e(triangle)"
respectively. However, with "chord," the
translation of "n" to natural sign is not done, so you have to
use \e(nat) if you want a natural sign. This is because a literal letter "n"
tends to occur more often in chords than natural signs.
.P
If you want to turn off the translation, to treat one of these characters
literally, you can precede it with two backslashes.
Thus, for example, "\e\e&" would yield a literal ampersand rather than
a flat symbol.
.P
If the
.Hr param.html#xpose
transpose
or
.Hr param.html#addxpose
addtranspose
parameters are set, chords are transposed to match the new key:
.Ix fB
the letters "A" through "G"
and any following accidentals will be transposed appropriately.
The accidental can be either something like "#" or "&" or any of the special
.Hr textstr.html#symlist
music characters
for accidentals (\e(sharp), \e(flat), etc.).
If the staff is specified as "all," the score transposition value is used.
Transposition has no effect on analysis or figbass.
.P
.Hr param.html#chordxlate
The "chordtranslation" parameter
can be used to translate chords to something like DO/RE/MI, or to apply
the German usage of H for B, and B for B flat.
.P
In figbass, the string starts out in piled mode, which means that
.Ix iO
each space in the input string will cause a new line on output, and,
.Ix iP
unless you specify other alignment, each line will be aligned on
the last digit in the line. Also, the meanings of
/ and \e/ are reversed from the normal meaning. This is done since
.Ix cA
drawing a slash through a number is very common in
figured bass, so you can just use a / to indicate this,
but if you really want a real slash,
you can still get one by entering \e/.
.P
With all three special qualifiers, the usual meanings
of : and \e: are reversed. This is
because piling is very common in these strings, so it's handier to just
put a : to indicate this, and for those rare cases when you want a
literal colon, you can still get one by entering a \e:.
.P
Here is an example showing chord, analysis, and figbass:
.Ex 1
.\"score
.\" rightmargin=1.5
.\" leftmargin=1.5
.\" size=14
.\" chorddist=3
.\" label=" "
.\"music
.\"
1: egc+;dgb;dfa;dgb;
bold chord above 1: 1 "C"; 2 "G"; 3 "Dm"; 4 "G";
rom analysis below 1: 1 "I"; 2 "V"; 3 "ii"; 4 "V";
bar
1: egc+;dgb;df#a;dgb;
rom figbass below 1: 1 "6 3"; 2 "6 4"; 3 "3/"; 4 "6 4";
bar
.\"newscore
.\"
1: 1cegb;
rom chord above 1: 1 "C^7";
bar
1: 1ce&g&b&;
rom chord above 1: 1 "Co/";
bar
1: 1ce&g&b&&;
rom chord above 1: 1 "Co:7";
bar
1: 1e&g&b&;
rom chord above 1: 1 "E&m";
bar
.Ee
.P
If a music symbol occurs inside an ital, bold, or boldital string,
.Hm italmus
the music symbol will automatically be made
to match the rest of the string.
.P
It is possible to supply a duration on text statements. When this is done,
.Ix fP
Mup will draw a dashed line from the end of the text to the
.Ix fF
end of the duration.
This may be useful if you want to indicate how long
an action such as an accelerando or crescendo is to last.
.Ix cL
If the last character of the string is a "~",
a wavy line will be drawn instead of a dashed line.
.Ix dF
If the last character of the string is an underscore, an underscore
.Ix fW
line will be drawn.
.P
Here are some examples of text:
.Ex 1
.\"score leftmargin=2; rightmargin=2; key=3&; staffs=2
.\"staff 2 clef=bass
.\"music
1: e;g;b;d+;
2: 2e;b-;
rom (12) above 1: 0 "Andante ( \e(smup4n) = 88 )";
boldital (12) below 1: 1 "mf"; 3.5 "mp";
newcentury bold (12) chord above 1: 1 "E&7"; 3 "B&9";
ital between 1&2: 2 "rit.";
palatino ital below 2: 2 "cresc." til 1m+2;
bar
1: 1egc+;
2: 1c;
bold (12) chord above 1: 1 "Cm";
bar
.Ee
.Hh grids
.H 2 Grids
.P
If the
.Hr param.html#gridused
gridswhereused parameter
is set to "y," chords will also have a grid printed.
.Ix iW
For this to work, a grid with the same name as the chord must be
defined in "grids" context elsewhere in the input file.
.P
The grids context contains lines each consisting of two text strings.
The first is the name of the chord, matching the name you want to
use in printing text with the "chord" qualifier. The second describes
the fret pattern for that chord. It is a space-separated list, with
each list element being either a fret number from 1 to 99, which will result in
a dot being printed at that fret, or an "o" or "x"
which will result in a circle or x respectively being printed above the
grid, or a "-" in which case no mark at all will be made.
The fret pattern may also contain an open and closing
parenthesis to mark where a curve is to be drawn, indicating the use
of a single finger to span several strings. For example:
.Ex 1
score
.\" leftmargin=1.3
.\" rightmargin=1.3
gridswhereused=y
gridfret=3
grids
"C" " - 3 2 o 1 o "
"C5" " - 3 x o 1 3 "
"Em" " o 2 2 o o o "
"A&" "(4 6 6 5 4 4)"
"A11" " - o o o o o "
music
rom chord 1: 1 "C"; 2 "C5"; 3 "Em";
1: 2c;e;
bar
rom chord 1: 1 "A&"; 3 "A11";
1: 2a&;an;
bar
.Ee
.P
If
.Hr param.html#xpose
transposition
is in effect,
the chord names in the grids context have to match the transposed names.
So, for example, if you use an "A" chord in a chord statement, then
transpose the staff up a major second, Mup will look for and use the grid
definition called "B" to match the transposed chord name.
.P
If you supply more than one grid definition for the same chord name,
Mup uses the last one. This allows you to easily
.Hr include.html
\&"include" a file
of standard chords, but override a few of them with a special fingering for a
particular song. If you really want to use more than one fingering in
different places in the same song for the same chord name, you need to make
the names look different, so Mup will treat them as different chords.
One way to do this would be to put a space and backspace in the name.
So, for example, "Am" and "Am \eb" would count as separate chords and could
have different grid definitions, but the chord names would still look
the same on output.
.Ht Music symbols
.Hd mussym.html
.H 2 "Mussym"
.Ix fT
.P
While it is possible to place musical symbols
such as fermatas and coda signs using
.Hr textmark.html
text statements,
it is perhaps a bit confusing, since music
symbols are really not part of any particular font. So there is a "mussym"
statement that can be used. The text strings after the colon must each
consist of a single musical symbol whose name can be given without the
usual \e() wrapper. The following two lines produce identical results,
but the second is perhaps a bit clearer:
.Ex
rom above 1: 1 "\e(ferm)";
mussym above 1: 1 "ferm";
.Ee
.P
A duration is not allowed on mussym statements
.Ix fP
except in one special case\(emif the
.Ix bX
symbol is "tr" (trill). In that case, the duration tells Mup how long a
wavy line to draw from the end of the "tr" symbol.
.Ex 1
.\"score leftmargin=2;rightmargin=2
.\"music
1: 2e;g;
mussym above 1: 1 "tr" til 2; 3 "ferm";
endbar
.Ee
.P
.Ix bH
A size can optionally be specified, inside parentheses:
.Ex
mussym (15) above 2: "turn";
.Ee
.Ht Phrase marks
.Hd phrase.html
.H 2 "Phrase marks"
.Ix fJ
.P
While it may often be more convenient to
.Hr ichdattr.html#phrase
specify phrase marks using "ph" and "eph" in the music input,
you can also use the phrase statement.
.P
If there is only one voice, specifying \fIplace\fP for a phrase just tells
.Ix bF
Mup where to draw the phrase mark. If there are
.Hr param.html#vscheme
two or more voices,
and a \fIplace\fP is specified, "above"
.Ix bJ
.Ix cO
indicates to Mup that the phrase is associated with voice 1,
and "below" indicates to Mup that the phrase is associated with voice 2.
.Ix dL
.P
If no \fIplace\fP is specified and there is only one voice with notes,
Mup will decide which side would be better based on the musical data.
This means the phrase mark may come out above or below.
In the case where there are two voices and
there are notes present in both voices, phrase marks will be drawn both
above and below.
.P
Each phrase statement item must include a begintime and duration.
.Ix dK
.Ix fP
A phrase mark must begin and end on a chord, so Mup first takes the begintime
.Ix gW
and duration and finds the chords nearest to each of them. It then draws a
phrase mark between them, shaping it to be out of the way of other things as
much as possible.
It is possible to specify a "grace backup" on the begintime or endtime
to make the phrase start or end on a grace note.
This is done by giving a negative number in parentheses,
specifying how many grace notes to back up.
It is possible to "nest" phrase marks (i.e., have one phrase on a subset of
the chords of another phrase).
.P
Some examples:
.Ex 1
.\"score leftmargin=2; rightmargin=2; staffs=3
staff 2
vscheme=2o
music
1: d;f;a;b;
2,3 1: a;f;d;g;
2 2: 4.c;8b-;4d;g;
phrase 1: 1 til 4;
phrase above 2,3: 1 til 2; 3 til 4;
phrase below 2: 2.5 til 1m + 1.5;
bar
1: b;c+;d+;e+;
2,3 1: g;a;f;c;
2 2: 4.e;8f;4b-;g;
bar
.Ee
.P
Phrase marks are sometimes used on
.Ix hU
tablature staffs in conjunction with slides.
.Ex 1
score staffs=2
.\"leftmargin=2 ; rightmargin=2
staff 2 stafflines=tab
music
2: a3<>;a4;e4<>;e2;
phrase above 2: 1 til 2; 3 til 4;
bar
.Ee
.P
The word "phrase" can be preceded by a line type modifier: dotted or dashed.
The dotted or dashed styles might be used for phrase marks
that were added by an editor rather than the composer, or to show a phrase
that doesn't apply to all verses.
.Ht Crescendo and decrescendo marks
.Hd cres.html
.H 2 "Crescendo and decrescendo marks"
.P
.Ix cL
.Ix cM
The "<" and ">" statements are used to specify crescendo and decrescendo marks
respectively. Each mark must include a begintime and duration.
The begintime and duration can include a grace backup specification,
to make the mark begin or end on a grace note.
Some examples:
.Ix dK
.Ix fP
.Ex 1
.\"score leftmargin=1.5;rightmargin=1.5;staffs=3
.\"staff 3 clef=bass
.\"music
1-2: c;d;e;f;
< below 1: 1 til 2; 3 til 4.5;
3: 2c;g;
> between 2&3: 1.7 til 2m + 1;
bar
1-2: d;e;2g;
3: 2d;a;
< 2,3: 2 til 3.8;
bar
1-2: e;g;2c;
3: 2.e;4c;
endbar
.Ee
.P
The placement of crescendo and decrescendo marks can be controlled
by setting the
.Hr param.html#dyndist
dyndist parameter.
.Ht Octave marks
.Hd octave.html
.H 2 "Octave marks"
.Ix gA
.P
Octave statements are used to mark notes that are to be played one or more
.Ix hL
octaves higher or lower than written. An "octave above" statement is
.Ix bJ
used to specify playing higher than written, or "octave below" for playing
lower than written. Each item must include a begintime
.Ix dK
.Ix dL
.Ix hB
and a text string. The text string is most typically "8va" although Mup
will print whatever you say. For
.Hr midi.html
MIDI
purposes, up to two digits at the beginning of the string are examined,
and a string starting with 8 will be treated as one octave,
15 or 16 will be treated as two octaves
(15 is really "correct," but a few publishers may use 16), 22 or 24 as three
octaves, etc. It will always default to be printed in 12-point
Times ital font, although you can override that using the usual \ef
and \es conventions. If the octave
.Ix gK
shifting applies to more than a single chord, there should also be a
duration specified, reaching to include the last affected note. In this
case, Mup will draw a dashed line to mark the span affected. Note that
.Ix fF
.Ix fP
.Ix gW
specifying the exact beat of a chord indicates the horizontal center of the
chord, so if you want the dashed line to reach a bit past the note, it
will be necessary to specify a duration slightly beyond the point of
the last chord to be included. Examples:
.Ex 1
.\"score leftmargin=2;rightmargin=2; staffs=3
.\"music
1: 2f;g;
2: 2d+;g;
3: 2g;ce;
octave above 1: 2 "8va" til 1m + 1.3;
bar
1: 2a;c;
2: 2f;e;
3: 4f;;c;;
octave below 2: 1 "8va";
octave below 3: 1 "8va" til 2.5; 3 "15" til 4.5;
bar
.Ee
.Ht Piano pedal marks
.Hd pedal.html
.H 2 "Piano pedal marks"
.Ix fL
.P
Piano pedal marks are somewhat different than
.Hi
other statements described in this section.
.He
.ig
.Hr textmark.html
other similar Mup statements.
..
Rather than having begintime, text, and duration, each
.Ix fP
item is just a time offset value, plus an optional "*". If no pedal mark
is currently in progress, the first time offset value indicates where the
pedal is depressed. Any subsequent pedal items on that staff will then
.Ix hK
indicate a "blip"\(emlifting and then immediately depressing the pedal
(which is indicated on the printed music by a "^"), unless there is a "*",
in which case it means to lift the pedal and leave it up.
.P
Some examples may help:
.Ex 1
.\"score leftmargin=2;rightmargin=2;time=6/4; staffs=2; brace=1-2
.\"staff 2 clef=bass
.\"music
1: c;d;e;2.g;
2: 1.ceg;
// depress pedal on beat 1, release on 3
pedal 2: 1; 3*;
bar
1: g;d;e;f;g;;
2: 1.gdb-;
// depress pedal on 2, release and depress
// on 4, release on 6
pedal below 2: 2; 4; 6*;
bar
.Ee
.P
.Hr param.html#pedstyle
See also the "pedstyle" parameter.
.Ix dS
.Ht Rolls
.Hd roll.html
.H 2 "Rolls"
.P
.Ix aY
Rolls can be specified with the "roll" statement, which has a format:
.Ex
\fBroll\fP \fIstaff voice\fP \fB:\fP \fItimeval\fP\fB;\fP
.Ee
.Ix bF
.P
A simple example would be:
.Ex
roll 2 1: 3;
.Ee
which indicates that a roll is to be placed on the chord at count 3 of
.Ix gW
staff 2 voice 1.
As usual, if the \fIvoice\fP is omitted, voice 1 is assumed.
.P
Multiple rolls in a measure can be listed on a single statement if they are
.Ix hG
associated with the same voice. For example:
.Ex 1
.\"score leftmargin=2; rightmargin=2
.\"music
1: ceg;dfa;egb;fac+;
// rolls on 3 chords: on the first,
// second, and third beats of the measure
roll 1: 1;2;3;
bar
.Ee
would produce rolls on the chords on counts 1, 2, and 3.
.P
A roll can extend over several chords on different voices, or even
different staffs. This is specified
.Ix hK
by giving the top and bottom staffs and voices, with the keyword "to"
.Ix gM
.Ix gN
between them. For example:
.Ex 1
.\"score leftmargin=2; rightmargin=2; staffs=3
.\"staff 3 clef=bass
.\"music
1: 4.r;8g+b+d++ tie;2;
2-3: 4.ceg;8gbd+ tie;2;
roll 1 1 to 3 1: 2.5;
bar
.Ee
The roll would extend from voice 1 of staff 1 to voice 1 of staff 3.
.P
If you wish the roll to be downward, the keyword "down" can be placed
after "roll." This will result in a downward arrow being drawn on the
bottom end of the roll.
.Ex 1
score
.\"leftmargin=2; rightmargin=2;
vscheme=2o
music
1 1: c+e+g+;;;;
1 2: ceg;;;;
// downward roll on staff 1
// on beats 2 and 4
roll down 1 1 to 1 2: 2; 4;
bar
.Ee
.P
You can also explicitly say "up" to cause an upward arrow to be
drawn at the top of the roll. If no direction is specified, no arrow is drawn.
.Hi
.H 1 "TAGS, PRINTING, LINES, AND CURVES"
.He
.Ht Location Tags
.Hd tags.html
.H 2 "Location tags"
.Hi
.P
.Ix bE
The concept of "location tags" has been mentioned several times. We now
describe this facility in more detail.
.He
.P
A location tag is associated with a
.Hr noteattr.html#ntag
note,
.Ix hL
.Hr chrdattr.html#ctag
chord,
.Ix aE
.Hr lyrics.html#ltag
lyric syllable
or
.Hr bars.html#btag
barline.
.Ix gG
It can then be referenced in order to place a second object, like a comment
or dotted line, relative to the first object.
.P
A tag name can be either a single lowercase letter, or an underscore
folowed by one or more letters, digits, or underscores.
.Ix fG
Each location tag is really a collection of six values,
namely the north, south, east,
.Ix cY
.Ix cZ
.Ix dA
.Ix dB
west, x, and y values of the tagged object. These are referenced by giving
the tag name followed by a dot, followed by the letter n, s, e, w, x, or y.
For example:
.Ex
c.n // north of tag c
_xyz.e // east of tag _xyz
x.x // x coordinate of tag x
.Ee
.P
The n, s, e, and w values describe the smallest rectangle that will
completely enclose the object being tagged.
The north refers to the top of the object, the south to the bottom, the
.Ix gM
.Ix gN
west to the left edge, and the east the right edge. The x and y values
.Ix cW
.Ix fY
correspond to the "center" coordinate of the object. This is not necessarily
the geometric center, but more of a "logical center." In the case of a tag
associated with an individual note, it is the geometric center of the notehead.
.Ix hL
However, on tags associated with a chord, the x is at the center line of
noteheads that are on the "normal" side of the stem. (Normally, when a stem
.Ix hI
is up, notes are put on the left side of the stem, and when the stem is
down they are placed on the right side. However, when two notes adjacent
on the staff have to be printed in a single chord, one has to be moved to the
opposite side.) The y of a chord is always the middle line of the staff
.Ix hK
containing the chord. The x of a bar line is its geometric center. The y
of a bar line is the center line of the top visible staff.
.Ix gL
For lyrics, the n, s, e, and w give the boundaries of the smallest
box that encloses the syllable, including anything
inside <^ >, but excluding anything inside < >, while
the x and y are the center of that box.
.P
Tag names can be reused. The value of a tag will always be its most
recent definition.
.P
There are also several "pre-defined" tags. They are:
.Hi
.DS
.TS
l l.
_page the entire page
_win the available part of the page
_cur the current location
_score the current score
_staff.\fIN\fP staff \fIN\fP of the current score
.TE
.DE
.He
.ig
<DL>
<DT>
_page
<DD>
the entire page
<DT>
_win
<DD>
the available part of the page
<DT>
_cur
<DD>
the current location
<DT>
_score
<DD>
the current score
<DT>
_staff.\fIN\fP
<DD>
staff \fIN\fP of the current score
</DL>
..
.P
.Ix jN
The _page tag refers to the entire page.
The x and y values of _page are at the geometric center of the page.
This tag is
seldom useful, but is provided in case you want to force something to
a specific place on a page.
.P
.Hm wintag
The _win tag
.Ix jO
refers to the area of the page available for printing.
The name comes from the idea that it provides a view, as if through a window,
of a portion of the page. Its precise meaning depends upon the current
context.
.Ix aS
.Ix aT
.Ix gM
.Ix gN
In header, footer, top, bottom,
header2, footer2, top2, bottom2, and block contexts,
it refers to the area of the
.Ix gS
page taken up by the corresponding element. In music context, it refers
.Ix hM
to the area of the page that remains after excluding the margins and the
header, footer, top and bottom for the page.
There is no way to access location tags in any other
contexts, so _win (and all other location tags)
are meaningless in other contexts.
.P
.Ix jP
The _cur tag refers to the current location on the page. This is a single
point, such that east and west values are the same as x, and north and
south values are the same as y. It is only useful immediately
after a command that explicitly sets the current location, that is, after
a printing command or line or curve command. Since Mup places musical
.Ix fD
.Ix fE
data in an arbitrary order, trying to use _cur at other times is likely
to cause output at a seemingly random place.
.P
.Ix jQ
The _score built-in tag refers to the current or most recent score.
_score.x will be at the position of the left edge of the staffs.
_score.y will be at the middle line of the top visible staff.
_score.w will be the left margin.
_score.e will be the right margin.
_score.n will be the farthest upward that anything
associated with the score protrudes.
_score.s will be the farthest downward that anything
associated with the score protrudes.
.P
.Ix jR
There are also built-in tags for each staff in the current or most recent score.
Since there is one per staff, there is a special notation: _staff followed
by a dot and the staff number.
Only staff numbers that exist (i.e., are between 1 and the value of the
.Hr param.html#staffs
staffs parameter)
and that are currently visible can be referenced.
_staff.2.x will be the place on staff 2 between
where the clef and time signature end and the first measure of the score begins.
(Actually all staffs have the same x value.)
_staff.5.y will be the middle line of the staff 5.
_staff.7.w will the left edge of the staff label if it has a staff label;
otherwise the left edge of the staff (the same as _score.x).
_staff.10.e will be the right margin of staff 10
(or really any staff, since they will all be the same).
_staff.4.n will be the farthest upward protrusion
of anything associated with staff 4.
_staff.15.s will be the farthest downward protrusion of anything
associated with staff 15.
.P
Location tags can be referenced by a number of commands, including those
for
.Hr prnttext.html
printing text,
.Ix hA
or
.Hr linecurv.html
drawing lines or curves,
or in
.Hr prnttext.html#postscript
user-defined PostScript code.
In the simplest case, two
tag references are given in parentheses. The first tag
will refer to a horizontal direction (the "x" direction for mathematicians),
namely a tag with a w, e, or x after the dot. The second tag is then a
vertical tag, having n, s, or y. For example:
.Ex
(g.x, g.y) // x and y of tag "g"
(_tag.w, _item.n) // west of tag "_tag" and
// north of tag "_item"
.Ee
The first example refers to the x,y coordinate of tag "g". The second item
refers to two different tags. The point referenced has its horizontal
location aligned with
the west side of the object having the tag "_tag," while its vertical
position is in line with the north side of the object having the tag "_item".
In other words, if a line were drawn along the west side of the object
tagged with "_tag" and another line were drawn along the top edge of the
object with tag "_item", the point where those two lines crossed would be
the point referenced.
.P
Frequently, you may want to place something relative to a tagged object.
You can add offsets in both the x and y dimensions. These offsets are given
in stepsizes.
.Ix fO
As was mentioned earlier, a stepsize is half the distance between two staff
lines.
.Ex
(g.x + 4.5, g.y + 4.5)
.Ee
refers to the point 4.5 stepsizes to the right and above the point (g.x, g.y).
Adding an offset moves to the right in the horizontal direction and
upward in the vertical direction. You can also subtract an offset:
.Ex
(k.w - 1.3, m.n - 2)
.Ee
refers to a point 1.3 stepsizes to the left of the
west edge of k and 2 stepsizes below the top of m.
.P
In the horizontal direction, offsets can be given in terms of "time". This
.Ix gT
is specified by using the keyword "time" followed by a number of beats.
As an example, suppose we have the tag reference:
.Ex
(q.x + time 1, q.y + 2)
.Ee
If the
.Hr param.html#time
time signature
.Ix gU
is 4/4 and tag "q" happens
to be associated with a half note, this tag reference
would refer to a point halfway between that note and the following chord,
since it includes an offset of a quarter note. If "q" had been associated
with a whole note, the point would be only 1/4 of the way between the
note and the following chord. Since notes are placed based on various
constraints and aesthetic considerations, the actual distance will vary
depending on which tag is referenced.
.P
In the case of a
.Hr bars.html#btag
tag associated with a bar line,
the time to distance mapping
is done based on the distance between the bar (at count "0") and the first
.Ix hG
chord in the measure (at count "1"). So, for example, in 4/4 time, a reference
to a bar line tag + time 0.5 would indicate a place halfway between the bar
line and the first chord, whereas tag + time 0.25 would be one fourth of the
way.
.P
The mapping of time to distance is done based
on the note, rest, lyric syllable, or bar
.Ix gG
.Ix hC
.Ix hL
line associated with the most recent horizontal tag in the expression.
For example, if the most recent horizontal tag is associated with a
quarter note, and the distance between that note and the next was 0.5 inches,
specifying "+ time 2" (a half note) would mean 1.0 inch to the right, or
specifying "- time 2" would mean 1.0 inch to the left, even if the notes to
the left or right happened to be spread somewhat differently than 0.5 inches
.Ix cW
per quarter note. Thus it is usually advisable not to specify a time offset
greater than the time value of the note or rest associated with the tag,
nor to subtract a time value. Stated another way, when specifying the X
portion of a coordinate using a time offset, it is best to use a location tag
based on whichever note, rest, or bar is immediately to the left of the
X location you are trying to specify.
.P
If the first horizontal tag in a horizontal expression is associated with
a bar, and that bar happens to be at the end of a score other than the
final score, and the result of evaluating the expression is a location that
would be out in the right margin or off the right edge of the page, it will
be moved to act as if the bar was at the beginning of the following score.
.P
The various kinds of offsets can be combined.
.Ex
( _pp + 1.2 - time 3.5, _zz + 2)
.Ee
.P
If no tag is specified, the reference becomes an absolute reference,
giving an exact page location. For example:
.Ex
(10, 20)
.Ee
is 10 stepsizes from the left edge and 20 stepsizes
above the bottom of the page.
.P
While usually the horizontal and vertical specifications
will each be just a tag and direction, possibly plus or minus some offset,
they can be more complicated arithmetic expressions.
The expressions can involve * for multiplication, / for division, or %
for modulo. These operators have higher precedence than addition or subtraction,
but you can use parentheses to force different precendence.
You can also use + or - as a unary operator, which has the highest
precedence of all. The unary + is rarely useful, but unary - is used
if you want to have a negative number.
There are also several functions available that you can use, namely:
.Hi
.DS
.He
.TS
center, box;
c|c|c
l|l|l.
Name Description Parameters
_
sqrt square root 1
sin sine 1
cos cosine 1
tan tangent 1
asin arc sine 1
acos arc cosine 1
atan arc tangent 1
atan2 arc tangent y/x 2
hypot hypotenuse 2
.TE
.Hi
.DE
.He
.P
A function name must be followed by parentheses containing its parameter(s).
For functions with two parameters, the parameters are separated by a comma.
Function parameters can themselves be arithmetic expressions.
The sin, cos, and tan function parameters are expected to be in degrees.
The return values of the asin, acos, atan, and atan2 functions are in degrees.
For the most part, expressions are allowed to include
operators and functions in any order.
This makes it possible to do things like calculate a horizontal
location based on some vertical attribute, if you really want to do that.
But it also means Mup will not stop you from creating an expression
that may not make any logical sense.
Mup will do its best to try to do whatever you say,
even if that wasn't what you meant.
.P
A common use for an expression more complicated
than just a simple tag reference and
offset would be to place something in the middle of a measure. You could set
location tags on the bars at either end of the measure, and then use the
average to get the midpoint of the measure.
.Ex 1
.\" score
.\" leftmargin=2
.\" rightmargin=2
.\"music
1: 2g;e;
// Note that be able to set a tag on the left of the very first measure,
// we could make an invisible bar, just to set a tag on it. But here,
// we can use the actual bar line at the left of the measure of interest.
bar =_firstbar
1: c;d;e;f;
bar =_secondbar
// Print a centered string at the average of the X values of
// the bars on either side of the measure,
// 6 stepsizes above the middle of the top staff of the score.
center ((_firstbar.x + _secondbar.x) / 2, _firstbar.y + 6) "mid measure";
.Ee
.P
A much more complicated example is presented later, in the
.Hr macros.html#arrow
section on macros,
demonstrating use of the trigonometric functions.
.Ht "Mup commands for printing text
.Hd prnttext.html
.H 2 "Printing commands"
.Ix hA
.P
There are several commands for printing text.
There are four commands that have similar formats,
differing only in how they justify text.
.Ex
\fBprint\fP \fIlocation\fP "\fItext\fP"
\fBleft\fP \fIlocation\fP "\fItext\fP"
\fBright\fP \fIlocation\fP "\fItext\fP"
\fBcenter\fP \fIlocation\fP "\fItext\fP"
.Ee
.Ix cV
.Ix cW
.Ix dN
.Ix fY
.P
The \fIlocation\fP is optional. If the \fIlocation\fP is omitted, the "print"
command will cause the \fItext\fP to be printed beginning at the current
horizontal and vertical location. The other commands will cause the text to
be placed vertically at the current vertical position, but left justified,
right justified, or centered within the current margins of the page.
.Ix gS
.P
The \fIlocation\fP can be specified using the special keyword of "nl"
which means "next line." This moves the current location to the beginning
of the following line before placing the text. In other words, the current
vertical position is moved downward by the height of the current text
.Ix bH
point size (or by as much as necessary
if the string is taller than that). Then
the \fItext\fP is printed on that line with the given justification style.
.P
The other way to specify a \fIlocation\fP is by using coordinates.
The justification then takes place relative to the referenced location.
For example, consider the following "right" command containing a reference
to an absolute location:
.Ex
right (25, 4) "something"
.Ee
The y location given is 4. Since this is an absolute location with no location
tags being referenced, this means the vertical position will be 4 stepsizes from
the bottom of the page. The x location given is 25. Again, this is an
absolute location, so the current horizontal position will be 25 stepsizes from
the left edge of the page. Since right justification is indicated,
the word "something" will be placed such that the right edge of the final "g"
will be 25 stepsizes from the left edge of the page. If "center" had been
specified, the middle of the word "something" would be at the 25 stepsize point.
.P
Here are some other examples:
.Ex
print "Author unknown"
center nl "subtitle"
left (h.x - 1.5, h.n + 2.3) "Ad lib"
right (_fine.e + time 3, _note.n + 5) "Duet"
.Ee
.P
Another type of print command
is "title." The full format of this command is:
.Ix gC
.Ex
\fBtitle\fP \fIfontfamily font size "text1" "text2" "text3"\fP
.Ee
However, only the word "title" and one quoted text string are required.
.Ix hB
The \fIfontfamily\fP, if specified, has one of the values valid for
.Hr param.html#fontfam
the "fontfamily" parameter
(avantgarde, bookman, courier, helvetica,
newcentury, palatino, or times). The default is the value of the "fontfamily"
parameter.
.Ix bG
The \fIfont\fP, if specified, has one of the values valid for the "font"
parameter (rom, bold, ital, or boldital). If no \fIfont\fP is specified,
.Ix gH
.Ix gI
.Ix gJ
.Ix gK
the default is the value of
.Hr param.html#font
the "font" parameter.
The optional \fIsize\fP is a point size within parentheses.
.Ix bH
If not specified, the default is the value of
.Hr param.html#size
the "size" parameter.
.P
In all cases, the location will be like that obtained via the "nl"
location to a print command. In other words, the title text string(s)
will be printed on the line below the location that was current when the
title command was encountered. If there is only one string given, it will
be centered between the margins. If two strings are given, both will be
printed on the same line, but the first will be left justified and the
second will be right justified. If three strings are given, they will all
be printed on the same line, with the first left justified, the second
centered, and the last right justified.
.P
Some samples:
.Ex
title bold (12) "Sonata 12"
title (18) "Song Without Words"
title ital (12) "Text: John Doe" "Tune: Jane Doe"
title "Suite in C" "Trumpet I" "Waltz"
title "" "A. Composer"
.Ee
.P
.Hm paragrph
The final command for printing text is
.Ix jD
the "paragraph" command.
This is used when you have a long section of text,
and you would like it to automatically wrap around onto as many
lines as necessary.
You can specify whether you want the right margin to be "justified" or "ragged."
If you don't specify, the type of the previous paragraph is used.
The default for the very first paragraph is to be justified.
By default, the values of the
.Hr param.html#fontfam
fontfamily,
.Hr param.html#font
font,
and
.Hr param.html#size
size
parameters are used to determine the text style, but any or all of those
parameters can be overridden on the paragraph command. The complete syntax is:
.ig
<BR>
..
.DS
\fIjustify_type\fR \fBparagraph\fR \fIfontfamily font\fR \fB(\fR\fIsize\fR\fB) "\fR\fIstring\fR\fB"\fR
.DE
.ig
<BR>
..
Only the keyword "paragraph" and the string are required.
Here are some example paragraphs:
.Ex 1
.\"score
.\" leftmargin=2
.\" rightmargin=2
.\"block
paragraph "This is an example of a paragraph. Since no justification
type was specified, and this is the very first paragraph, the default
(justified) is used. A paragraph will wrap around
to as many lines as needed.
An explicit newline is given at the end of this paragraph,
to force a blank line between it and the following paragraph.\en"
ragged paragraph avantgarde ital (15) "This paragraph
is ragged rather than flush right. It is in a different font and size.
Ragged paragraphs are split onto multiple lines if necessary,
but they are not spread out to make lines go all the way to
the right margin."
justified paragraph (14) " Here is another paragraph.
This one is justified.
Only the size was specified for this paragraph; the font was not,
so the current default will be used.
Some spaces are included at the beginning of the paragraph text,
to create an indented first line for the paragraph."
paragraph "Here is the final paragraph.
Since no justification type was given,
that of the previous paragraph (justified in this case) was used.
A paragraph may be used for many things,
such as describing how you want a piece to be performed,
or a biography of the composer."
.Ee
.P
.Hm block
Sometimes you may want to mix
blocks of text with music.
.Ix jC
This can be done by specifying a "block" context. The block context
will typically contain one or more "paragraph" commands, although any
of the printing commands (paragraph, print, left, center, right, or title)
can be used. The block can also contain changes in certain parameters, namely
.Hr param.html#font
font,
.Hr param.html#size
size,
and
.Hr param.html#fontfam
fontfamily,
which will affect the appearance of
the following text. A block can also contain
.Hr newscore.html
\&"newscore" or "newpage" commands.
Using "newscore" will cause vertical space to be added,
as would be used to separate scores. The amount of space is affected
by the
.Hr param.html#scoresep
scoresep
and
.Hr param.html#scorepad
scorepad
parameters. Using "newpage" will cause a new page to be started.
If a newscore or newpage includes a "leftmargin" specification,
that will alter the left margin on the block text that follows.
A "rightmargin" specification will alter the right margin
of the block text that precedes it.
.P
Here is an example of a block.
.Ex 1
.\"score
.\" leftmargin=2
.\" rightmargin=2
.\" scoresep=6,8
.\" label=""
.\" fontfamily=helvetica
block
title bold "Notation in Simple and Compound Meters"
title ""
paragraph "It is common for a person familiar
with mathematics but not with music to assume
that 3/4 and 6/8 time are equivalent,
but that is not the case.
In 3/4 time (which is known as simple triple meter),
a measure containing 3 quarter notes
would be notated like this:"
score time=3/4
music
1: c;;;
bar hidechanges
block
paragraph "whereas in 6/8 time
(which is compound duple meter),
a measure with 3 quarter notes should be notated thus:"
score time=6/8
music
1: 4c;8~;;4;
bar
.Ee
.P
The printing commands may occur in the
.Hr headfoot.html
header, footer, header2, footer2, top, bottom, top2, bottom2,
.Ix aS
.Ix aT
.Ix gM
.Ix gN
.Hr prnttext.html#block
block,
and
.Hr music.html
music
contexts.
.Ix fQ
.Ix hM
After each printing command,
the current location is set to the right edge of the last character printed
horizontally and at the baseline of the current line vertically.
.Hh postscript
.H 2 "Including raw PostScript"
.P
There is another command that looks a lot like the printing commands,
but gives you a way to insert raw PostScript into the Mup output.
This might be used, for example,
to include a picture or logo along with your music.
The syntax is
.Ex
\fBpostscript\fP \fIoptional_location optional_exports\fP \fB"\fP\fIraw PostScript\fP\fB"\fP
.Ee
As with the other print commands, if the location is omitted,
the current location is used.
.P
Instead of specifying an (x, y) coordinate location,
you can declare various PostScript "hooks" that will be called at specific
times:
.Hi
.VL 15
.LI afterprolog
.He
.ig
<DL>
<DT>afterprolog
<DD>
..
The PostScript code you specify will be placed in the generated Mup output
right after the %EndProlog, and before the first page.
The current location will be the upper left corner of the page.
A typical usage might be to set up some global things that you would
then use later in other hooks. Or it could be used to override things
defined in the Mup prolog.
.Hi
.LI beforetrailer
.He
.ig
<DT>beforetrailer
<DD>
..
The PostScript code you specify will be placed in the generated Mup output
right after the final page, and before the %Trailer.
The current location will be the lower right corner of the page.
One possible use might be to write out some data gathered
to some other file.
.Hi
.LI atpagebegin
.He
.ig
<DT>atpagebegin
<DD>
..
The PostScript code you specify will be placed in the generated Mup output
on every page, before anything is written to the page.
The current location will be the upper left corner of the page.
Some possible uses would be to paint the page some background color or add a
fancy border. Or it could be used to add a red "Do not copy" watermark,
where the music output would still be completely readable,
since it would get drawn on top of the mark.
.Hi
.LI atpageend
.He
.ig
<DT>atpageend
<DD>
..
The PostScript code you specify will be placed in the generated Mup output
on every page, after everything else has been written to the page.
The current location will be the lower right corner of the page.
An example of a possible use would be to write "SAMPLE"
in huge letters across each page.
to leave enough music readable that a potential user can get an idea
of what the music is like, but overwrite enough that it isn't really usable,
to encourage paying for a copy without the mark.
.Hi
.LI atscorebegin
.He
.ig
<DT>atscorebegin
<DD>
..
The PostScript code you specify will be placed in the generated Mup output
just before the output for each score.
The current location will be the upper left corner of the score.
A possible usage would be to put a different color background behind each
score, so they would really stand out even on a very crowded page.
Another would be to put yellow highlighting behind a particular staff on
each score.
.Hi
.LI atscoreend
.He
.ig
<DT>atscoreend
<DD>
..
The PostScript code you specify will be placed in the generated Mup output
just after the output for each score.
The current location will be the lower right corner of the score.
One possible use would be to "white-out" something Mup printed that you
don't like, but have no other way to prevent.
With enough work, you could probably even create an ossia.
.Hi
.LE
.He
.ig
</DL>
..
.P
It should be noted that since a postscript command can contain arbitrary
PostScript code that is merely passed through by Mup, any tools that try to
transform Mup input to some other music notation format (e.g., Music XML)
will most likely be unable to understand any of that PostScript code,
and any information in it will almost certainly be completely lost during
the transformation. So while it is provided as an "escape hatch" to allow
you to do things Mup does not support natively, its usage is discouraged,
unless you really need to do something that Mup does not
support directly, and if you are willing to accept the fact that doing
so will compromise portability.
.P
The \fIoptional_exports\fP let you specify a list of
.Hr tags.html
Mup location tags
whose values you want to pass to your PostScript code.
If you list a tag by itself, all six values (x, y, n, s, e, w) are passed to
Postscript, or you can list just a specific direction:
.Ex
postscript atscorebegin with _score, _mytag.y, "...PostScript... "
.Ee
As a special case, you can specify _staff, which will pass all six values for
all visible staffs.
The PostScript name will be the Mup name with Mup prepended to it.
So _tag.x in the Mup input will become Mup_tag.x in the PostScript output.
Often it is useful to use a more generic name in your Postscript code,
and then pass the values from different tags to it at different times.
You can do this by specifying an alias tag.
.Ex
postscript atpagebegin with _value = _staff.2 "...PostScript... "
.Ee
In that example, _value will be an alias, and the PostScript
name will be Mup_value, but its value will be
that of _staff.2. So suppose the value of _staff.2.x is 3.8. If you say:
.Hi
.DS
with _staff.2.x
.DE
the output would be:
.DS
/Mup_staff.2.x 3.8 def
.DE
but if you say:
.DS
with _value.x = _staff.2.x
.DE
the output would be:
.DS
/Mup_value.x 3.8 def
.DE
and you can later use the exact same PostScript code (that uses Mup_value.x),
but pass it the value from some other tag, like _staff.5.x or your own tag.
Note that you don't have to use the same direction for both, so you could say
.DS
with _value.x = _another_tag.w
.DE
.He
.ig
<PRE>
with _staff.2.x
</PRE>
the output would be
<PRE>
/Mup_staff.2.x 3.8 def
</PRE>
but if you say
<PRE>
with _value.x = _staff.2.x
</PRE>
the output would be
<PRE>
/Mup_value.x 3.8 def
</PRE>
and you can later use the exact same PostScript code (that uses Mup_value.x),
but pass it the value from some other tag, like _staff.5.x or your own tag.
Note that you don't have to use the same direction for both, so you could say
<PRE>
with _value.x = _another_tag.w
</PRE>
..
.P
The string containing raw Postscript is copied directly to the Mup output.
You can use the usual \e" to embed a double quote in the string,
but otherwise the string is copied exactly as it is,
enclosed inside a PostScript save/restore.
After the restore, the current location is reset back to where it
was originally.
.P
Alternately, you can use the keyword "file" and then give a file name
as the string. The contents of the file are copied to the output verbatim,
so it is not necessary to use backslashes before double quotes to preserve them.
.P
Since the PostScript code is copied without any interpretation,
Mup does not reserve any space on the page for it,
and it is your responsibility to provide valid PostScript.
The PostScript language is beyond the scope of this User's Guide;
consult a book on PostScript if you need more information.
.P
As a simple example, you might include an Encapsulated PostScript file
near the lower left corner of the current page, using:
.Ex
postscript "50 50 translate (file.eps) run"
.Ee
.P
Or you could print a message in red italics
near the bottom of the page, like this:
.Ex
postscript (70, 20) "
1 0 0 setrgbcolor
/NewCenturySchlbk-Italic findfont
16 scalefont setfont
(Photocopying prohibited) show
"
.Ee
.P
Next we show an example of a hook that allows you to do the equivalent of
a yellow highlighting pen on a particular staff.
.Ex 1
score
staffs=2
.\" leftmargin=2
.\" rightmargin=2
music
define SOPRANO 1 @
define ALTO 2 @
.\" define HIGHLIGHT ALTO @
ifdef HIGHLIGHT
// If HIGHLIGHT is set to a staff number,
// highlight that staff by drawing a yellow box behind it.
postscript atscorebegin with _box = _staff.HIGHLIGHT "
newpath
Mup_box.w Mup_box.n moveto
Mup_box.e Mup_box.n lineto
Mup_box.e Mup_box.s lineto
Mup_box.w Mup_box.s lineto
closepath 0.9 0.9 0.0 setrgbcolor fill stroke"
endif
SOPRANO: g;8c+;;4;;
ALTO: e;8g;;4a;e;
lyrics below SOPRANO,ALTO: "This is a sam-ple";
bar
newscore
SOPRANO: e+;d+;b;c+;
ALTO: g;b;g;e;
lyrics below SOPRANO,ALTO: "of high-light-ing.";
bar
.Ee
If you invoke Mup with -DHIGHLIGHT=SOPRANO, the top score will be highlighted.
If you invoke with -DHIGHLIGHT=ALTO (as shown), the second will be highlighted.
Otherwise nothing will be.
.Ht Lines and curves
.Hd linecurv.html
.H 2 "Lines and curves"
.P
The "line" statement is used for drawing lines. Its format is:
.Ix fE
.Ex
\fIlinetype\fP \fBline (\fP\fIX1, Y1\fP\fB) to (\fP\fIX2, Y2\fP\fB)\fP
.Ee
The \fIlinetype\fP can be "wide," "medium," "wavy," "dotted," "dashed,"
.Ix dF
.Ix fF
or it can be omitted, which means narrow.
.Ix bQ
The wavy line could be used for glissandos. It could also be used
for manually drawing rolls and trills, although it should rarely, if ever,
.Ix bX
.Ix fU
be necessary to resort to this, since the
.Hr roll.html
roll
.Ix aY
and
.Hr mussym.html
mussym
.Ix fT
statements will usually suffice and are much easier to use.
Narrow, dashed, or dotted lines would typically be used for voice crossings.
.Ix bF
.Ix fG
The medium line is about twice as wide as a
narrow line, and a wide line is about twice as wide as a medium line.
.P
The x and y coordinates are specified as was described
in the section on
.Hr tags.html
\&"Location tags."
.Ex 1
score
.\"leftmargin=2; rightmargin=2; staffs=2
vscheme=2f
staff2 clef=bass
music
1 1: c+ =c;e =e;g;c+;
1 2: e =_e;g =_g;c =_c;s;
2 1: 2.s;4g =_gg;
2 2: 1ce;
line (c.e + 2, c.y) to (e.w - 2, e.y)
line (_e.e + 2, _e.y) to (_g.w - 2, _g.y)
dashed line (_c.e + 1, _c.y) to (_gg.w - 1, _gg.y)
bar
.Ee
.P
It is possible to print a text string by the line by adding
.Ex
\fBwith \fP\fIfontfamily font \fP\fB(\fP\fIsize\fP\fB) "\fP\fIstring\fP\fB"\fP
.Ee
at the end of the "line" statement. Only the keyword "with" and the
text string itself are required; the font and size information is optional.
As usual, the
.Hr param.html#fontfam
fontfamily,
.Hr param.html#font
font,
and
.Hr param.html#size
size
parameter values are used to get values if the optional items are
omitted. The most common usage for printing a string with a line is probably
for glissandos.
.Ex 1
.\"score
.\" leftmargin=2
.\" rightmargin=2
.\"music
1: 2d =n; g+ =m;
wavy line (n.e + 1.5, n.y) to (m.w - 1.5, m.y) with ital (9) "gliss."
bar
.Ee
.P
Arbitrary curves can be drawn using the "curve" statement:
.Ix fD
.Ex
\fIlinetype\fP \fBcurve (\fP\fIX1,Y1\fP\fB) to (\fP\fIX2,Y2\fP\fB) to (\fP\fIX3,Y3\fP\fB)\fP \fI...\fP
.Ee
When using this form of the "curve" statement,
at least three coordinates must be specified; more are permitted.
The \fIlinetype\fP can be "medium," "wide," "dashed,"
or "dotted," or omitted.
A curve will be drawn through the specified points in the specified order.
.Ex 1
score
.\"leftmargin=2; rightmargin=2
staffs=2
staff 2
clef=bass
music
1: 4.s;[=c] 8e; [=d] g; [=e] e;4s;
2: [=a] 8c;g; [=b] c+;4.s; [=f] 8c+; [=g] c;
medium curve (a.x, a.n+1) to (b.x, b.n+15) to (c.x, c.n+4) \e
to (d.x, d.n+3) to (e.x, e.n+3) \e
to (f.x, f.n+11) to (g.x, g.n+1)
bar
.Ee
.P
An alternative way to specify a curve is to only specify the two endpoints,
along one or more "bulge" values, given in stepsizes.
Suppose a single bulge value \fIn\fP is given. To find the midpoint of
the resulting curve, imagine a line is drawn between the two endpoints,
then from the midpoint of that line, move perpendicular to the line for
\fIn\fP stepsizes.
A positive \fIn\fP will cause the curve to bulge
to the left as you move from the start point to the end point,
while a negative \fIn\fP will make it bulge to the right.
If two bulge values are given, bulges are calculated from the 1/3 and
2/3 point of the line between the endpoints; with three points, at 1/4,
1/2, and 3/4, and so forth. Multiple bulge values are separated by commas.
.Ex 1
.\"score
.\"leftmargin=1.7
.\"rightmargin=1.7
.\"music
1: c =_c1; f; f; d =_d1;
medium curve (_c1.x, _c1.y + 8) to (_d1.x, _d1.y + 10) bulge 3
bar
1: g =_g1; e+; d+; a =_a1;
dotted curve (_g1.x, _g1.y - 2) to (_a1.x, _a1.y - 2) bulge -4.3
bar
1: g =_g2; a; d+; c+ =_c2;
curve (_g2.x, _g2.y - 2) to (_c2.x, _c2.y + 2) bulge -2.5, 4
bar
.Ee
.Hi
.H 1 "MISCELLANEOUS FEATURES"
.He
.Ht Newscore and newpage, samescore and samepage
.Hd newscore.html
.H 2 "Newscore and newpage, samescore and samepage"
.P
Normally, Mup determines how many measures to put on each score and how many
.Ix hG
.Ix hJ
scores to put on each page. You can force Mup to move to the next score with
the "newscore" statement, or to the next page with a "newpage" statement.
.Ix cC
.Ix cD
Here is an example:
.Ex
1: c;d;e;f;
bar
1: e;f;g;;
bar
newscore // go to next score
1: 2c;;
bar
1: e;f;g;;
bar
newpage // go to next page
1: e;g;2c;
bar
.Ee
.P
You can temporarily change the indent for the new score
by specifying "leftmargin=\fInum\fP," where \fInum\fP is a
number of inches or centimeters (depending on the current setting of
.Hr param.html#units
the "units" parameter.)
The number may include a decimal fraction part (e.g., 8.5).
The number can optionally be preceded by a plus or minus sign,
in which case the number is taken as an amount to add or subtract from
the normal margin, rather than as the actual margin value.
.Ix gQ
The new score will then be indented by that much, overriding the value
of
.Hr param.html#leftmar
the leftmargin parameter.
.P
In a similar way, you can specify "rightmargin=\fInum\fP," which
.Ix gR
will affect
.Hr param.html#rightmar
the right margin
on the \fBprevious\fP score. This might
be used, for example, if you want a piece to end with a
shorter than normal score.
.Ex
newscore leftmargin=1.2 rightmargin=2.7
.Ee
The equals sign is optional in these margin overrides.
.P
For rightmargin, you can specify rightmargin=auto rather than giving a
number. In that case, Mup will calculate the appropriate value to use
to make the music on the previous score spaced based on the
.Hr param.html#packexp
packexp
and
.Hr param.html#packfact
packfact
parameters, without spreading to fill the line.
.Ex 1
.\"score packfact=1.5
.\" leftmargin=2
.\" rightmargin=2
.\"music
.\"
1: c;d;e;f;
bar
1: g;f;e;g;
bar
1: c;d;e;f;
bar
1: g;f;e;g;
bar
1: 2e;c;
endbar
newscore rightmargin=auto
.Ee
.P
On a "newscore" line you can also specify the separation between the preceding
and following scores.
The separation is the distance between the bottom line of the bottom visible
staff of the preceding score, and the top line of the top visible staff
of the following score.
It is measured in step sizes.
An example is:
.Ex
newscore scoresep = 10.5
.Ee
This distance will be enforced, regardless of the values of the
.Hr param.html#scorepad
scorepad
and
.Hr param.html#scoresep
scoresep
parameters.
The distance can even be negative, which will force them to overlap.
If there is not room on the page for both scores with the stated distance
between them, the second score will be put on the next page instead.
.P
This scoresep option also works if the preceding and/or following item is a
.Hr prnttext.html#block
block
instead of a score.
The distance is then measured from the boundaries of the block(s).
.P
Also, a newscore can be put in the middle of a block, which effectively
breaks the block into two blocks, and the scoresep option can be used there.
This can be especially useful with a big block.
Suppose you would normally like it to appear as one big block,
but if the page is mostly full of music already,
and the whole block doesn't fit,
you may prefer to break it in half, so that the first half will still go
on the first page in this case, rather than forcing it all to the next page.
To do this, at the place you would like to allow the break to occur,
put this line:
.Ex
newscore scoresep = 0
.Ee
.P
Sometimes it may be useful to tell Mup where you do \fInot\fP want a new
score to begin. This is done by:
.Ex
samescorebegin
// ... two or more measures of Mup input
samescoreend
.Ee
.P
Similarly, to specify that certain measures and/or
.Hr prnttext.html#block
blocks
should all be kept on the same page:
.Ex
samepagebegin
// ... two or more measures of Mup input or blocks
samepageend
.Ee
.Ht Mup header and footers
.Hd headfoot.html
.H 2 "Headers and footers"
.P
.Ix aS
.Ix aT
.Ix fQ
Mup provides ways to put headers and footers on pages of output.
Often you may want a certain kind of header and footer on the first
page, but a different kind on any subsequent pages, so Mup makes it
easy to do that. Mup also offers two different "layers" of headers and
footers. These layers may be particularly useful if you have a single Mup
file that contains multiple songs, or multiple movements of a song.
In that case, there may be certain things that you want printed in
headers and footers throughout,
like the current page number and the name of the entire collection,
but other things that you want to have change with each new song or
movement.
.P
The "outer" layer is specified by four contexts: header, footer, header2,
and footer2. The "inner" layer is specified by four contexts:
top, bottom, top2, and bottom2.
.Ix gM
.Ix gN
.P
All of these contexts
can have different versions for left and right pages, by following their name
with a modifier of "leftpage" or "rightpage." So, for example, you can
have both a "top leftpage" and a "top rightpage." These will override
any corresponding version without a page side modifier. So if you also
defined a plain "top" in addition to ones for leftpage and rightpage,
it wouldn't actually ever get used. If, on the other hand,
you defined only a "top leftpage" and a plain "top," then
the plain top would get used for right-hand pages, and if you only
define "top rightpage," and nothing for the other two, nothing would be
used on left-hand pages. Pages will always alternate between left and right,
but you can control which to start with, using the
.Hr param.html#firstpg
firstpage parameter.
.P
All of these contexts are optional.
Each of the three variations (leftpage, rightpage, and unmodified)
of each outer context (header, footer, header2, footer2)
can only be specified once per file.
The inner contexts can be specified more than once per file, and
each time a set of them occurs, a new page is started.
On output pages, all of these contexts are placed horizontally
between the left and right margins, and vertically the
elements appear in the following order:
.DS
(topmargin)
header
top
(one or more scores of music or blocks of text)
bottom
footer
(bottommargin)
.DE
.P
Which version is used\(emthe one with or without the "2" suffix\(emdepends
on which page is being printed. The items in header and footer
appear on only the very first page,
while those in header2 and footer2 appear on all subsequent pages.
Somewhat similarly, the items in top and bottom will appear on the page
that is started when they are encountered in the input,
while top2 and bottom2 will then be used on all subsequent pages.
However, you can specify a new top and/or bottom later,
which will then be used for one page, and you can specify
a new top2 and/or bottom2 later, which will replace the previous top2/bottom2.
Note, however, that if you change top2 but not top,
that new top2 is used immediately on the new page,
whereas if you change both, the new top applies
to the immediately following new page,
and the new top2 isn't used until the following page. Subsequent pages
will use top2 in either case.
.P
Some examples may help.
First a simple case: suppose you have a single song, and you'd like a title
at the top of the first page. This is straightforward:
.Ex
top
title "Here is the Title"
.Ee
For this simple example, it would work just as well to use "header" instead
of "top," so you can use either one, although top is slightly more flexible.
Later we'll see some examples where you might use both header and top in
the same file, for different kinds of titles.
.P
Now suppose you'd like to make the title bigger and bolder, and would like
to add a subtitle and composer information, as well as add a copyright
notice to the bottom of the page.
.Ex
top
title bold (18) "Here is the Title"
title ital (14) "Here is a subtitle"
title "Lyrics: Ann Author" "Composer: Me"
bottom
title "\e(copyright) Copyright 2003 by Ann Author and Me"
.Ee
Again, in this simple example,
you could use "header" and "footer" rather than "top" and "bottom."
.P
Now suppose the song is long enough to take several pages,
and you would like to repeat the title along with the page number on
all pages after the first. To accomplish this, you could add:
.Ex
top2
title "Here is the Title - \e%"
.Ee
.Ix aU
The \e% is a special marker that will get replaced on each page
with the current page number. While it can be used in any text string,
it is probably only likely to be useful in these header and footer kinds
of contexts.
.Hm pagenum
Another special marker
is \e#, which will be replaced by the page number of the final page.
This could be useful for doing something like "page \e% of \e#."
.P
As a variation, perhaps you'd prefer the information at the bottom of
the page.
.Ex
bottom2
title "This is the title" "Page \e%"
.Ee
In this variation, two separate text strings are specified,
so the first string will be left justified and the second will be
right justified.
.P
Note that if you give a top2 or bottom2,
but it turns out there aren't any additional pages,
they would never actually get used.
But it wouldn't hurt to have set them.
.P
Now let's consider a more complicated example, using both outer and inner
contexts. Suppose you are publishing a book of songs,
entitled "My Favorite Songs," and you want to put that title at the top
of every page throughout the book, and you want a page number at the bottom
of each page except the first.
You could get that much using:
.Ex
header
title "My Favorite Songs"
header2
title "My Favorite Songs"
footer2
title "\e%"
.Ee
But suppose that in addition, you want each song to have its title on its
first page in big print, and on subsequent pages in regular size print.
To get this, at the beginning of each song, you could use top and top2:
.Ex
top
title (18) "This is the Song Title"
top2
title "This is the Song Title"
.Ee
.P
Now suppose you'd prefer to have the page numbers at the left margin of
left-hand pages and at the right margin of right-hand pages. Instead of
the single unmodified footer2 shown above, you would make two:
.Ex
footer2 leftpage
title "page \e%" ""
footer2 rightpage
title "" "page \e%"
.Ee
.P
A composition with multiple movements can be handled similarly,
by giving header, footer, header2, and footer2 (or any subset thereof)
for the composition as a whole,
and then giving new top, bottom, top2, and bottom2 definition (or any subset)
at the beginning of each new movement.
.P
These contexts are conceptually in a separate coordinate space,
which will be overlaid on each page coordinate space.
When in these contexts,
.Hr tags.html#wintag
the _win special tag
applies to
the header or footer window rather than the space between the header and
footer as it does in the music context.
.Ix hM
.P
Since headers or footers will expand as necessary, the
.Hr tags.html#wintag
value of _win.s and _win.y
may be changed by any of the statements in the context. At any given
time, they refer to the boundaries as defined by what has been printed
so far. Thus, if the first line of a header contains an 18-point title,
after that, _win.s would be 18 points below _win.n.
If the header then contained a 12-point title, after that it
would be 31 points below _win.n (12 points for the title string, plus 1 point
of padding that is added between lines printed).
.P
In addition to the "title" commands used in the examples above,
you can also use
.Hr prnttext.html
the "print," "left," "right," or "center" commands.
.Ix cV
.Ix cW
.Ix fY
In most
cases you will want to use "nl" for the \fIlocation\fP on those commands
to place things. If you don't specify a \fIlocation\fP for the first of these
commands in a header or footer, Mup will start at the left margin, just far
enough down from the top to accommodate the text string to be printed.
.Ix hB
These contexts can also contain settings of the
.Hr param.html#font
font,
.Ix bG
.Hr param.html#fontfam
fontfamily,
.Ix gB
and
.Hr param.html#size
size
parameters.
These parameter values will be used until the end of the context or until
set again to some other value.
.Ht Mup macros
.Hd macros.html
.H 2 "Macros"
.H 3 "Simple Macros (without parameters)"
.P
.Ix aM
.Ix cS
Macros can be defined to avoid retyping or to give mnemonic names to
things. A macro is defined with the following syntax:
.Ex
\fBdefine\fP \fI macro_name macro_text\fP \fB@\fP
.Ee
.P
The \fImacro_name\fP consists of one or more uppercase letters, digits,
and underscores, with the first character being a letter.
.Ix fW
The \fImacro_text\fP can be any text. It can be any length from empty
to many pages. The "@" terminates the macro. A literal "@" can be
placed in the \fImacro_text\fP by preceding it with a backslash.
.Ix bC
If you want a literal backslash in the \fImacro_text\fP, it also must
be preceded by a backslash.
.P
A macro is called by stating the \fImacro_name\fP in the input. The
\fImacro_name\fP is replaced by the \fImacro_text\fP.
A macro can be defined at any point in the input. It can be used as
often as desired any time after it has been defined. A given \fImacro_name\fP
can be redefined as many times as desired, with each new definition
overwriting the previous definition.
.P
As an example, suppose you are printing an orchestral score, and the oboe
.Ix hJ
part happens to be on staff 5. Rather than having to remember which staff
it is, you could define a macro:
.Ex
define OBOE 5: @
.Ee
Not only is the name easier to remember than a number, but if you later
decide to move the oboe part to a different place in the score, only the
macro definition and perhaps a few other things would have to be changed.
.P
Another common use of macros might be if a musical motif occurs several
times. You could define a macro for the motive:
.Ex
define SCALE 8c;d;e;f;g;a;b;c+; @
.Ee
then do something like:
.Ex
OBOE SCALE
.Ee
.P
It is possible to remove the definition of a macro using the "undef"
.Ix bY
statement:
.Ex
undef OBOE
.Ee
.P
It is possible to have parts of the input skipped over depending on whether
certain macros are defined or not. This is done using
\&"ifdef," "else," and "endif." The keyword "ifdef" is followed by
.Ix aN
a macro name. If a macro by that name is currently defined,
Mup will continue
reading and processing input normally. If it finds a matching "else,"
it will skip over input until the matching "endif."
If the macro is not currently defined, Mup will skip over the input
until it finds a matching "else" or "endif." There is also
an "ifndef" command that uses the opposite logic: it will read the input
up to the "else" or "endif" only if the macro is NOT defined.
.P
The ifdefs can be sprinkled between other items in the input;
they need not be on separate lines. They can be nested. Examples:
.Ex
// make last c an octave higher if macro "FRED" is defined
1: c;e;g;c ifdef FRED + endif;
ifdef PIANO
staff 1 visible=n
else
ifdef VIOLIN
staff 2 visible=n
staff 3 visible=n
endif
endif
.Ee
.P
.Hr cmdargs.html#doption
Macros can also be set from the command line using the -D option.
Only ordinary macros can be defined using the -D option,
not macros with parameters.
.P
Macro text cannot begin or end in the middle of a token, like a keyword or
a number or a string. Usually it will be clear what things are tokens;
generally tokens end where you are allowed to have white space.
But there are a few obscure cases. For historical reasons that are now hard to
change, "dashed tie" or "dashed slur" or the
per-note versions of "dashed ~" and " dashed <>" (or the "dotted" counterparts
of any of these) are treated as a single token. That means
you can't define one macro for "dashed" and another for "tie"
and put them together and have that be recognized.
.Hh macparm
.H 3 "Macros with parameters"
.P
Macros defined within Mup input can be defined to have "parameters."
.Ix aD
This may be useful
when you have something that is repeated with small variations.
When defining a macro with parameters, the macro name must be followed
immediately by a ( with no space between the end of the name and the
parenthesis. The opening parenthesis is followed by one or more
parameter names, separated by commas, and ending with a close parenthesis.
Parameter names have the same rules as macro names: they consist of
uppercase letters, numbers, and underscores, starting with an uppercase
letter. The parameter names can then appear in the text of the macro
definition where you want a value to be substituted.
.P
As an example, suppose you are doing a score with staffs 1 through 4
for vocal parts, and staffs 5 and 6 for a piano accompaniment, and that
you frequently want to mark a dynamics change at the same point in time
below each of the vocal scores and between the two piano staffs.
You could typically do this with something like:
.Ex
boldital below 1-4: 1 "ff";
boldital between 5&6: 1 "ff";
.Ee
but if you needed to do this lots of times, it could get tedious.
So let's define a macro with parameters:
.Ex
define DYN( COUNT, VOLUME )
boldital below 1-4: COUNT VOLUME;
boldital between 5&6: COUNT VOLUME;
@
.Ee
This macro has two parameters,
which have been given the names COUNT and VOLUME.
When you call the macro, you will give them values.
For example,
.Ex
DYN(1,"ff")
.Ee
would give a VOLUME of "ff" at COUNT 1, whereas
.Ex
DYN(3.5,"mp")
.Ee
would give a VOLUME of "mp" at COUNT 3.5.
.P
When calling a macro with parameters, the values to give the parameters
are given inside parentheses. The values are separated by commas.
The values in the parentheses are copied exactly as they are,
including any spaces, newlines, macro names, etc.
There are only a few exceptions to this:
you can include a comma, closing parenthesis, or backslash
as part of a parameter value by preceding it with a backslash, and
a backslash followed by a newline
in a parameter value will be discarded. Thus a macro call of
.Ex
MAC(\e\e\e,\e))
.Ee
has one parameter, the text of which is 3 characters long: a backslash,
comma, and closing parenthesis.
If you backslash other characters, they will be copied without the backslash,
but doing this on anything other than a double quote will produce a warning,
because it seems unlikely the backslash was really needed.
.P
.Hm quoting
If in a macro definition a parameter is used inside backticks,
as in \(gaNAME\(ga, the value of the parameter will be placed
.Ix iT
inside double quotes. Thus, another way to do the example above would be:
.Ex
define DYN( COUNT, VOLUME )
boldital below 1-4: COUNT \(gaVOLUME\(ga;
boldital between 5&6: COUNT \(gaVOLUME\(ga;
@
DYN(1,ff)
DYN(3.5,mp)
.Ee
.P
Conceptually, when the macro is expanded, the backticks are replaced
by double quote marks, but in addition,
any double quote mark found in the value being passed to the parameter will
have a backslash inserted before it, and any backslash that occurs
within double quotes in the value will also have a backslash inserted
before it. Thus, for example:
.Ex
// If we define a macro like this:
define QUOTED(X) \(gaX\(ga @
// then for input value passed is \(gaX\(ga would be which would print as
print QUOTED(hello) hello "hello" hello
print QUOTED("hello") "hello" "\e"hello\e"" "hello"
print QUOTED(\e\en) \en "\en" a literal newline
print QUOTED("\e\en") "\en" "\e"\e\en\e"" "\en"
.Ee
.P
Sometimes it can be a little tricky to get the number of backslashes right,
or other details like that.
.Hr cmdargs.html#Eoption
The -E Mup command line option
shows how macros will expand, which may help you figure out what to do.
.Hh concat
.H 3 "Concatenating macro names"
.P
Inside the ` ` it is possible to use ##
to concatenate the values of two or more macros to form a macro name,
whose value is then converted to a string.
This is probably easiest to understand from an example.
This example shows a way to print
.Ix hV
capo
and real chords.
.Ex 1
// Define some guitar chords
define D d0 g2 b3 e2 @
define F e'1 a3 d3 g2 b1 e1 @
define A a0 d2 g2 b2 e0 @
define C a3 d2 g0 b1 e0 @
// Define the mapping of F and C transposed by a minor third
define TR_F D@
define TR_C A@
// This is used by the K macro below to derive a pasted-together macro name
define TR TR_@
// Define a macro that will print both real and capo chords,
// when given a count at which to print, and the real chord name.
define K(COUNT, NAME)
bold chord all align 2: COUNT `TR##NAME`; // capo chords
ital(9) chord all align 1: COUNT `NAME`; // real chords
@
score
.\" leftmargin=2
.\" rightmargin=2
staffs = 3
key = 1&
staff 2
transpose = up min 3
staff 3
stafflines = tab
music
// Use the K macro to print the real and capo chords
K(1,F)
K(3,C)
1: 2f;c;
// Enter the chords as you would think about them, but transpose them.
3: 2 TR_F;TR_C;
bar
.Ee
.P
The capo chords line is the one of interest here, which has the `TR##NAME`.
The TR macro will be evaluated, and found to have a value of TR_.
At the first place the K macro is called, the value being passed to the NAME
parameter is F. Those two values (TR_ and F) are concatenated
to form TR_F and that macro is then looked up, and found to have the value D.
That is then made into a string (because of the ` ` enclosing the construct)
and printed. On the second call to K, a C is passed to NAME,
so the pasted-together name will be TR_C, which then yields "A" to be printed.
On the second-last line, the TR_F gets replaced by the correct notes for
a transposed F, namely a D chord, and the TR_C gets replaced by the
correct notes for an A chord. Thus the various TR_F macros,
along with the K macro, adjust the music for having capo.
In a real example, there would likely be more chords,
with an additional TR_ macro to map each one.
.P
It is possible to paste more than two macro names together,
as in `AA##BB##CC##DD` but each component must represent a valid defined name,
and the result of pasting them all together must also yield a valid defined
macro name.
.Hh arrow
.H 3 "A complex macro example"
.P
Let's look at an example of much more complicated use of macros.
This example demostrates the use of arithmetic functions described in the
.Hr tags.html
section on location tags.
We will draw a line with an arrow between notes
on two different staffs.
While it may be possible to write the expressions directly,
the result would be very hard to read and understand,
so using macros to build up the pieces of the expression can be very helpful.
.Ex 1
define HEAD_LENGTH 5 @
define HEAD_WIDTH 3 @
define ANGLE(X1,Y1,X2,Y2) atan2((Y2) - (Y1), (X2) - (X1)) @
define COS(X1,Y1,X2,Y2) cos(ANGLE(X1,Y1,X2,Y2)) @
define SIN(X1,Y1,X2,Y2) sin(ANGLE(X1,Y1,X2,Y2)) @
define HEAD_X(X1,Y1,X2,Y2) (HEAD_LENGTH * COS(X1,Y1,X2,Y2)) @
define HEAD_Y(X1,Y1,X2,Y2) (HEAD_LENGTH * SIN(X1,Y1,X2,Y2)) @
define HB_X(X1,Y1,X2,Y2) ((X2) - HEAD_X(X1,Y1,X2,Y2)) @
define HB_Y(X1,Y1,X2,Y2) ((Y2) - HEAD_Y(X1,Y1,X2,Y2)) @
define THICK_LEN (HEAD_WIDTH / 2) @
define THICK_X(X1,Y1,X2,Y2) (THICK_LEN * SIN(X1,Y1,X2,Y2)) @
define THICK_Y(X1,Y1,X2,Y2) (THICK_LEN * COS(X1,Y1,X2,Y2)) @
define FEATH_UP_X(X1,Y1,X2,Y2) (HB_X(X1,X2,Y1,Y2) - THICK_X(X1,Y1,X2,Y2)) @
define FEATH_UP_Y(X1,Y1,X2,Y2) (HB_Y(X1,X2,Y1,Y2) + THICK_Y(X1,Y1,X2,Y2)) @
define FEATH_DN_X(X1,Y1,X2,Y2) (HB_X(X1,X2,Y1,Y2) + THICK_X(X1,Y1,X2,Y2)) @
define FEATH_DN_Y(X1,Y1,X2,Y2) (HB_Y(X1,X2,Y1,Y2) - THICK_Y(X1,Y1,X2,Y2)) @
define ARROW(X1,Y1,X2,Y2)
medium line (X1, Y1) to (X2, Y2)
medium line (X2, Y2) to (FEATH_UP_X(X1,Y1,X2,Y2), FEATH_UP_Y(X1,Y1,X2,Y2))
medium line (X2, Y2) to (FEATH_DN_X(X1,Y1,X2,Y2), FEATH_DN_Y(X1,Y1,X2,Y2))
@
score
staffs = 2
.\" leftmargin=1.5
.\" rightmargin=1.5
staff 2
clef = bass
music
1: c =h; r; 2;
2: r; g =k; e; g;
bar
ARROW(h.x + 2, h.y - 1, k.x - 2, k.y + 1)
.Ee
.Hh saverest
.H 3 "Saving and restoring macros"
.P
You can take a snapshot of all your current macro definitions by using
the savemacros command, and then restore that set of definitions later
using the restoremacros command. These are both followed by a quoted
string, which is a name you give to the saved definitions.
This might be useful if, for example, you had a multi-movement piece,
and wanted to use one set of macros on the first and third movements,
but a completely different set on the second movement. You could save
the macro state at the very beginning under one name,
and after the first movement under a different name. Before the second
movement, you could restore to the original state with no macros defined,
and define your second set. Before the third movement, you could restore
the macros as they had been at the end of the first movement.
.P
Another possible use would be if you have several standalone files,
each containing a complete song, and you want to "include" those files
in another file. By putting a save/restore around each
.Hr include.html
include,
you can prevent any macro definitions in one file from interacting with
those from another file.
.P
Here is a very simple example, using single measures rather than a whole
movement or song.
.Ex 1
.\" score leftmargin=2 ; rightmargin=2
// Define one "global" macro that will stay around,
// by defining it before doing any savemacros.
define ONE_MEAS
score
BSTYLE
music
1: 8c;;e;;A 2g;
bar
@
// Save just that one macro as the "default."
savemacros "default"
// Now define a couple other macros and save the macros.
define BSTYLE beamstyle=2,2 @
define A [with >] @
// Note that the name can be any arbitrary text string.
savemacros "2,2 >"
// Restore the default setting and set macros
// with the same names to different values.
restoremacros "default"
define BSTYLE beamstyle=4,4,4,4 @
define A [with ^] @
savemacros "4,4,4,4 ^"
// Now use the "global" macro with each saved macro state.
restoremacros "2,2 >"
ONE_MEAS
restoremacros "4,4,4,4 ^"
ONE_MEAS
.Ee
.P
If you do another savemacros using the same name as you had already used,
the old state is forgotten and replaced with the new.
.P
Often, though not always, you may want to use
.Hr param.html#saverest
saveparms/restoreparms
at the same places as you use savemacros/restoremacros.
.Ht Generalized conditionals
.Hd ifclause.html
.H 3 "Generalized conditionals"
.P
Mup also supports more general "if" clauses. If you happen to be
familiar with the preprocessors for the C and C++ programming
languages, Mup "if" clauses are very similar.
If you're not, that's okay, since things are explained below.
Also, some of the operations are really very rarely needed, so if
you find some of them confusing, you just can skip past this section;
you'll likely never have a need for the complicated operations anyway.
.P
The general form is
.Ex
\fBif\fR \fIcondition\fR \fBthen\fR \fIMup statements\fR \fBelse\fR \fIMup statements\fR \fBendif\fR
.Ee
As with the "ifdef," the "else" and second set of Mup statements is optional.
.P
One form of "if" is really just a variation of ifdef. It uses the
keyword "defined" followed by a macro name. So
.Ex
ifdef DUET
.Ee
could also be written
.Ex
if defined DUET then
.Ee
You may put a set of parentheses around the macro name for clarity
if you wish:
.Ex
if defined(DUET) then
.Ee
.P
The ! is used to mean "not," so
.Ex
ifndef TRIO
.Ee
could also be written as
.Ex
if ! defined(TRIO) then
.Ee
.P
So far, this just looks longer, so what's the advantage?
The difference is that ifdef and ifndef can only be used to check if a single
macro is defined or not, whereas the "if" condition is much more general,
and therefore much more powerful.
Decisions can be based on the values of macros, not just whether they are
defined or not, and can also be based on more than one macro at a time,
Here is an example of a condition based on several macros at once:
.Ex
if defined(FULL_SCORE) && defined(TRANSPOSE_UP) && ! defined(MIDI) then
.Ee
would be true only if both FULL_SCORE and TRANSPOSE_UP were defined,
but MIDI was not defined. The && means "and."
There is also || which means "or," so
.Ex
if defined(CELLO) || defined(STRINGBASS)
.Ee
would be true as long as at least one of the macros was defined.
.P
The condition can also include numbers and macros used as numeric values
in arithmetic and comparisons. For example,
.Ex
define STAFFS 3 @
define S 5 @
if STAFFS > 5 then
// ... this would not be executed, since 3 is not greater than 5
endif
if 2 <= STAFFS then
// ... This would be executed, since 2 is less than or equal to 3
endif
if STAFFS + 1 == S - 1 then
// ... This would be executed, since 3+1 equals 5-1
endif
.Ee
Note that the symbol to test for "equals" is two equals signs, not just
one. This is to be consistent with what is used in the C and C++ languages.
The operators for comparisons are:
.TS
l l.
< less than
> greater than
<= less than or equal
>= greater than or equal
== equal
!= not equal
.TE
.P
Note that the values in the conditions can only be either literal numbers
or macros whose values evaluate to a number. They cannot be things like
.Hr param.html
Mup parameters.
A macro that is not defined is treated as having a value of zero.
Macro values are substituted for macro names just as elsewhere in Mup,
so if you use a macro whose resulting value does not evaulate to a number,
you may get an error or other unexpected result.
.P
If you are familiar with "octal" and "hexadecimal" numbers, they can be
used, following the C language convention of a leading zero for octal
or a leading 0x for hexadecimal. (If you're not familiar with these
numbers or conventions, don't worry about it; it's never really necessary
to use them. Just make sure you don't accidentally start a number other
than a zero with a zero).
.P
Values are limited to 32-bit signed whole numbers. (If you don't know
what that means, what you need to know is that you
can only use numbers between -2147483648 and 2147483647, and cannot
use fractions.) Results of arithmetic on values will also be whole
numbers, so division will result in either rounding
or truncation to a whole number,
and the exact characteristics may be system dependent.
.P
Before we introduce the remaining operators, it would be good to discuss
two concepts, called precedence and associativity. These determine the
order in which operations are done. Consider the following expression:
.Ex
5 + 3 * 8
.Ee
What is its value? If we just went left to right, we would add 5 and 3,
getting 8, then multiply by 8, for a final value of 64. However,
multiplication is generally considered to have higher "precedence"
than addition, meaning that multiplications should be done before additions.
In other words, the expression should actually be treated as
.Ex
5 + (3 * 8)
.Ee
so we would first multiply 3 by 8, getting 24, and then add 5 and 24,
obtaining a final answer of 29.
.P
If you really intended the 64 meaning, that could be shown by parentheses,
indicating you want the addition to be done first:
.Ex
(5 + 3) * 8
.Ee
.P
Associativity determines whether operators of equal precedence are done
left to right or right to left. Parentheses and
all of the operators that have two
operands associate left to right, while all the others
associate right to left. For example, since addition and subtraction
associate left to right, the expression
.Ex
10 - 6 - 1
.Ee
would be evaluated by first subtracting 6 from 10 to get 4,
then subtracting 1, yielding 3.
If they associated right to left, first 1 would be subtracted from 6
to get 5, which would then be subtracted from 10, yielding 5.
So using different associativity can lead to different answers!
.P
Since the "not" operator and unary minus associate right to left,
in the expression
.Ex
! - (5)
.Ee
the unary minus would be applied first to get -5, then the "not" would be
applied. But what does "not -5" mean? The "not" operator will treat its
operand as a Boolean value, with a value of zero meaning false, and
any non-zero value being true. Since -5 is not zero, it represents "true,"
and "not true" would be "false," or zero. By the way,
any operator that yields a Boolean result
(not, logical and, logical or, less than, greater than,
less than or equal, greater than or equal, equal, or not equal) will
always yield 1 for true, even though any non-zero value could mean true.
.P
The operators are listed below. Those on the same line have the same
precedence, with those on each line having higher precedence than the
lines below.
.TS
center, allbox;
l l l.
\fBoperators\fP \fBoperations\fP \fBassociativity\fP
_
\f(CW( )\fP grouping left to right
\f(CW! ~ - +\fP not, one's complement, unary minus, unary plus right to left
\f(CW* / %\fP multiply, divide, modulo left to right
\f(CW+ -\fP add, subtract left to right
\f(CW<< >>\fP left shift, right shift left to right
\f(CW< <= > >=\fP less than, less or equal, greater than, greater or equal left to right
\f(CW== !=\fP equal, not equal left to right
\f(CW&\fP bitwise AND left to right
\f(CW^\fP bitwise XOR left to right
\f(CW|\fP bitwise OR left to right
\f(CW&&\fP logical AND left to right
\f(CW||\fP logical OR left to right
\f(CW? :\fP interrogation right to left
.TE
.Ht Mup include files
.Hd include.html
.H 2 "Include"
.P
.Ix aO
The "include" statement can be used to include the contents of one file
inside another.
.Ex
\fBinclude "\fP\fIfilename\fP\fB"\fP
.Ee
causes input to be read from the specified \fIfilename\fP. When the end
of that file is reached, reading of input resumes from the original file
after the include statement.
.P
If the \fIfilename\fP cannot be found as is, and it is not an absolute
path, and if the environment variable MUPPATH is set, Mup will search
for the file in each directory listed in MUPPATH. On Unix systems, the
directories are separated by colons. On systems with DOS-like file naming
conventions, they are separated by semicolons.
The MUPPATH may be useful if, for example, you have a number of "boilerplate"
files that you want to include in lots of songs. You can put them in
some directory and set MUPPATH to list that directory; then any Mup
files you have can refer to them.
If a file by the name given is not found, and that name
does not already have a .mup or .MUP suffix,
the MUPPATH is searched again with suffix added.
On systems where file names are case sensitive, .mup takes precedence
over .MUP.
If the file is not found in MUPPATH, then the directory of the "including"
file is searched.
.Ht Exit
.Hd exit.html
.H 2 Exit
.P
The exit statement will cause the rest of the input to be ignored. This
might be useful if you haven't finished cleaning up the end of a piece,
but would like to take a look at (or listen to) everything before that.
Anything after the exit statement will be ignored.
.Ht User-defined symbols
.Hd udefsym.html
.H 2 "User-defined symbols"
.P
Mup provides the most common musical symbols, but there are various other
symbols that have been used over the centuries. If Mup doesn't provide
some specific symbol that you would like, you can define up to 160
of your own symbols, as well as override any of the
.Hr textstr.html#symlist
built-in music symbols
with your own versions. Most people will never need this facility,
so feel free to skip past this section unless you feel you do need it.
.P
To define your own symbols, the description of how to draw those symbols
must be provided as PostScript code.
On the one hand, that means that unless you can find someone else's
definition of just what you want, you will need to understand PostScript
at least well enough to define your own. On the other hand, this gives
access to the full power of the PostScript language, which lets you define
essentially any kind of symbol you want. The PostScript language is beyond
the scope of this User's Guide, but there are many books and Internet
resources to help you learn, if you are interested. You can also look at
the output that Mup generates for examples. If you want something
similar to an existing Mup symbol, looking at its definition is probably
the best place to start.
.P
A user-defined symbol or override is put in "symbol" context.
The general format of this context is as follows:
.Ex
\fBsymbol "\fP\fIname\fP\fB"
postscript = "\fP\fIPostScript code to draw the symbol\fP\fB"
bbox = \fP\fIllx, lly, urx, ury\fP
\fBystemoffset = \fP\fIup, down\fP\fR
.Ee
The three parameters can be supplied in any order,
but only once each per symbol. The ystemoffset parameter is optional,
and only used for symbols that will be used as noteheads.
This is described in more detail
.Hr udefsym.html#notehead
later.
The name and the postscript and bbox parameters are mandatory.
.P
The name for a user-defined symbol must include at least one letter,
and can include letters, numbers, and underscores. It must be
different than existing names for
.Hr textstr.html#special
non-ASCII characters.
.P
You can refer to user-defined symbols just like the built-in symbols,
using their name in a
.Hr mussym.html
mussym statement, or in a
.Hr textstr.html#symlist
text string
using the name inside \e( ).
Adding the prefix "sm" to a name will result in a "small" version,
just like with the built-in symbols.
.P
In addition to naming and defining your own symbols, you can also
override the definitions of existing music symbols. Suppose, for example,
you want a different style of C clef. You can then supply a symbol
context for "cclef" and provide your own PostScript.
.P
A symbol definition applies to the entire file, no matter where in the file
it is defined. If you try to define the same symbol more than once, a warning
will be issued, and the last definition will be used.
A user-defined symbol must have its "symbol" context before it is
referenced.
.P
The symbols you define will become part of a PostScript Type 3 font.
Symbols must be defined in a 1000 unit scale coordinate space,
where 300 units equals one stepsize,
with the symbol's "logical center" at (0, 0).
Limitations of Type 3 fonts apply. For example,
since PostScript does not allow using setrgbcolor or
sethsbcolor after a setcachedevice operation in a BuildChar procedure,
it is not possible to change the color of a symbol.
The PostScript code will be written to the output exactly as it is,
so you will have to provide any escaping needed by PostScript.
The normal Mup text string escape rule of needing to put a backslash
before a double quote inside a text string also applies.
So, for example, suppose you wanted to output a PostScript
style string containing a parenthesis inside double quotes. Since PostScript
requires a parenthesis inside a string to be preceded by a backslash,
the Mup input would require the backslash as well,
and since Mup requires double quotes to be backslashed,
that would need to be done. So Mup input of:
.Ex
postscript="(\e"\e(\e")"
.Ee
would result in:
.Ex
("\e(")
.Ee
being copied to the PostScript output.
(Of course, that is not a good symbol definition; it is just intended
to show needed escapes.)
As with any Mup text string, the postscript string can be as many lines
long as you wish. But note that the
.br
.nf
.na
postscript = "
.fi
.ad
.br
part must all be on one line.
.P
There isn't currently any good way to call a PostScript procedure from
within a symbol definition. So if you have some some code that is common
to several symbols, probably the best way to handle that is to define a Mup
.Hr macros.html
macro
for the common code, and then use the macro in the postscript string:
.Ex
define COMMONCODE \fI....the common code....\fP @
postscript = "\fI...some specific code\fP " + `COMMONCODE` + " \fImore specific code\fP"
.Ee
.P
The bounding box lists four numbers, giving the (x,y) coordinates of
the lower left and upper right corners
of the smallest box that can contain the symbol. It is in the same units
as the symbol itself: 300 units per stepsize.
Normally you should define the bounding box to include
a small amount of white space padding around what is actually drawn,
typically about 100 units,
so that if it is printed right next to another symbol, they won't touch.
However, in the case of a symbol you want to use as a
.Hr udefsym.html#notehead
notehead,
you should not include any padding, so that stems
will touch the notehead.
.P
.Hm notehead
If you want to use a user-defined symbol as a
.Hr param.html#notehead
notehead,
you need to specify the "ystemoffset" parameter.
If the symbol is not to be used as a notehead,
you should omit that. The ystemoffset is given as two numbers, the first
for when the stem is up, the second for when it is down. They specify,
in the same units as the symbol itself (300 units per stepsize), where
on the y axis the stem should begin.
Any notehead should be defined with its vertical center at y of zero.
So if you want the stem to start at the vertical center of the note,
the ystemoffset would also be zero. A stepsize below the center of the note
would be -300, a half stepsize above would be 150, etc.
In the x dimension, the stem is always placed at the edge of the note,
as given by the bbox.
.P
If you need an "upside-down" version of a notehead,
just name the upside version of the symbol
with a "u" prefix on the name of the right side up version.
Then you can use the normal u? convention in
.Hr shaped.html#hdshape
headshapes context,
and Mup will take care of the rest.
.P
Once defined, a user-defined symbol can be used just
like the built-in symbols.
There are only a few places where Mup uses some special knowledge of the
characteristics of music symbols, but in those cases, if you redefine the
symbol to have different characteristics, Mup may not place things quite as
perfectly as you would like. One place where this might happen is if you
redefine the symbol for flat, natural, or dblflat, to make them
significantly different, since Mup tries very hard to pack accidentals
as tightly as possible, based on some intimate knowledge of
the shapes of the built-in versions.
.P
Here is an example that shows both overriding a built-in symbol and
defining a completely new symbol, and then using them.
.Ex 1
.\"score
.\" leftmargin=1.5
.\" rightmargin=1.5
.\" scale=1.5
// Override the built-in xnote to have thicker lines
symbol "xnote"
bbox=-435, -365, 435, 375
postscript="gsave
% normal xnote has 120 linewidth; we set to 300 here
1.15 1 scale 300 setlinewidth 1 setlinecap
-300 -300 moveto 300 300 lineto stroke
-300 300 moveto 300 -300 lineto stroke
grestore"
ystemoffset=300, -300
// Define a smiley face symbol.
symbol "Smiley"
bbox=-700, -700, 700, 700
postscript="gsave
100 setlinewidth
% the face
0 0 600 0 360 arc stroke
% the mouth
0 0 300 -160 -20 arc stroke
% the eyes
-200 200 100 0 360 arc fill
200 200 100 0 360 arc fill
grestore"
ystemoffset = 0, 0
headshapes
// Set up to use the extra-thick xnote
// for quarter or shorter, and Smiley for longer.
"boldxnote" "xnote Smiley Smiley Smiley"
music
1: [hs "boldxnote"]...g;8b;d+;2g;
// You can use the user-defined symbol just like a built-in
mussym above 1: 1.5 "Smiley";
// You can apply size just like for a built-in
rom below 1: 2 "\e(Smiley) \es(+5)\e(Smiley) \es(+5)\e(Smiley)";
bar
.Ee
.Ht Mup font files
.Hd fontfile.html
.H 2 "Installing other fonts"
.P
The "fontfile" statement is used to override a Mup font with
some other font. You may place one or more of these anywhere in Mup input.
This might be used either because you'd like a different
style of printing, or because you need a different alphabet.
.Hr ../mkmupfnt.ps
The "mkmupfnt" program
that is distributed with Mup
can be used to generate a font description file. You can then use
.Ex
fontfile "file"
.Ee
in your Mup program, where the given "file" is the name of the font
description file. The manual page for mkmupfnt describes how to use that
program. It also describes the format of the font description file,
in case you wish to generate it by some means
other than the mkmupfnt program.
.P
Mup searches for fontfiles via the MUPPATH mechanism, just like for
.Hr include.html
included files.
.Ht Custom Accidentals and Alternate Tunings
.Hd tuning.html
.H 1 "CUSTOM ACCIDENTALS AND ALTERNATE TUNINGS"
.P
Mup supports custom accidentals: the ability to use any character,
including a
.Hr udefsym.html
user-defined symbol,
as an
.Ix bL
accidental.
They can be placed on notes, though not in key signatures.
Feel free to skip this section; many Mup users will probably never use the
features described here.
.P
.Ix aA
If you want to generate
.Hr midi.html
MIDI
for a piece using custom accidentals,
a method is provided for defining their frequency offsets.
You can also override the default frequency offsets of the
standard (built-in) accidentals (#, &, n, x, &&).
Also, you can specify a
.Hr param.html#tuning
tuning other than the standard equal temperament tuning,
and you can
.Hr param.html#a4freq
define a pitch level different from the standard of the note a4 being 440 Hz.
.P
Note that some MIDI players, including the standard
Microsoft Windows Media Player,
do not support the special MIDI commands that are needed for these features.
.H 2 "Printing custom accidentals"
.P
Although you can use an existing character as a custom accidental, typically
you would want to define a new one, as explained in the
.Hr udefsym.html
section on user-defined symbols.
When you put a custom accidental on a note,
the x axis of the symbol (the place where y is 0) will be aligned vertically
with the note.
The position of the y axis (the place where x is 0)
does not affect the positioning.
.P
The Mup distribution contains two "include" files of symbol definitions
that can be used as custom accidentals.
The file "quarterstep_accs" defines accidentals intended for use
as quarter steps and three quarter steps.
The file "helmholtz_accs" defines many of the accidentals needed for
a system called the Extended Helmholtz-Ellis Just Intonation Pitch Notation.
Even if you don't intend to use these files in your music,
you can use them as examples of how to define symbols.
.P
In a Mup input file, a custom accidental is put after a note letter
similarly to a standard accidental.
It is specified by the name of the accidental as a string inside braces.
.Ex 1
.\"score leftmargin=2; rightmargin=2; time = 6/8; beamstyle = 4., 4.
include "quarterstep_accs"
music
1: 8f{"qsharp"}; f#; f{"tqsharp"}; g{"qflat"}; g&; g{"tqflat"};
bar
.Ee
To reduce the amount of typing, you can define
.Hr macros.html
macros
for the accidentals.
For example:
.Ex
define QS {"qsharp"} @
.Ee
You can put up to four accidentals on a note.
They can be any combination of standard and custom accidentals.
You can put parentheses around the entire set, and parentheses will
be drawn around the set.
You cannot put parentheses around just a subset of them.
.H 2 "MIDI for custom accidentals and alternate tunings"
.P
The parameters and the accidentals context described in this section
need not be used if you do not intend to generate MIDI.
In that case it is only necessary to define the symbols for the
custom accidentals you are using.
.H 3 "Defining custom accidentals for MIDI"
.P
To generate MIDI for a piece that uses custom accidentals,
their frequency offsets must be defined in an "accidentals" context.
A frequency offset tells how much the accidental alters the pitch of the note.
It can be specified in any of these ways:
.DL
.LI
A positive number by which the note's frequency is to
be multiplied. It may include a decimal fraction part (e.g., 0.97 or 1.5).
Of course, a number greater than 1 will raise the pitch, and a number
less than 1 will lower the pitch.
.LI
A ratio of two positive numbers; that is, two numbers with a / between them.
Mup will divide the numbers and multiply the note's frequency by the result.
The numbers may include decimal fraction parts,
though whole numbers are more often used
when stating ratios for this.
.LI
A + or - sign followed by a number and the word "cents".
The number may include a decimal fraction.
A cent is 1/100 of an equally tempered halfstep, or in other words,
1/1200 of an octave.
The note's frequency will be multiplied by 2 to the cents/1200 power.
So a positive cents value will raise the pitch, and a negative cents value
will lower the pitch.
.LE
.P
Each line in an accidentals context contains a symbol name in quotes
followed by either the word "all" followed by a single offset,
or a list of 1 to 7 note letter / offset pairs.
In the single offset case, this same offset will be applied when the accidental
is used on any of the 7 notes, a through g.
In the other case, each offset follows the note letter it is to be applied to.
Not all note letters need to be listed, but a custom accidental
cannot be used if the value for its note letter has not been defined.
.P
Any of the standard accidentals can also be listed in an accidentals context:
"sharp", "flat", "nat", "dblsharp", "dblflat".
Offsets are set for them the same way as for custom accidentals.
If any notes are not specified in a list of note letter / offset pairs,
the default offset (as described in the section below on tuning)
is used for them.
A standard accidental for which no line is provided will use the default
value for all notes.
.P
By default a natural has a ratio of 1 and it doesn't change the pitch.
But you can define a different ratio for it.
Note also that when a note has no accidental, it is treated the same
as if it had a natural on it.
.P
The first line of an accidentals context consists of the word "accidentals"
followed by a name you provide in quotes.
To make use of it, in a score context you set
.Hr param.html#acctable
the acctable parameter
equal its name in quotes.
It will be used starting at that point in the file until such time as
you change acctable.
The accidentals context must occur earlier in the file than the place
it is referenced.
You can define any number of accidentals contexts.
If "acctable" is not set, only standard accidentals can be used, and
they will have their default offsets.
.P
The following is an example of an accidentals context:
.Ex
accidentals "mine"
"acc1" all 23/22
"acc2" all 1.0873
"acc3" all +87 cents
"acc4" c 17/18 f 0.9103 g -93 cents
.Ee
.P
It is possible to define an invisible accidental.
This is useful in cases where you want to alter the pitch of a note for MIDI
but you don't want it to print anything.
In the symbol definition for an invisible accidental, you print nothing,
and you need to set the bounding box to all zeros.
.H 3 "Setting the pitch level"
.P
The standard pitch of the note a4, the A above middle C, is 440 Hz.
With the
.Hr param.html#a4freq
a4freq parameter,
you can set this to a different number.
The frequencies of all other notes are figured relative to a4, so if
you set a4freq to frequency X, their frequencies will be
multiplied by X/440.
.H 3 "Setting the type of tuning"
.P
The
.Hr param.html#tuning
tuning parameter
lets you set the tuning system to "equal",
"pythagorean", or "meantone".
Each tuning sets differently the frequencies of the "white" notes (a through g)
and the default offsets of the standard accidentals.
Naturals, however, have default ratio 1 (or 0 cents) in all of these tunings.
.H 4 "Equal temperament"
.P
The default value of "tuning" is "equal", which means equal temperament,
the modern standard for Western music.
In this system, all half steps are equal.
Since there are 12 half steps in an octave, each has a ratio of
the twelfth root of 2, about 1.05946, which is 100 cents by definition.
When this tuning is set, the default value of a sharp is this ratio,
and a flat is the inverse, 0.94387, or -100 cents.
For a double sharp you square the sharp ratio (1.12246) or double the
number of cents (200).
For a double flat you square the flat ratio (0.890900) or double the
number of cents (-200).
.H 4 "Pythagorean tuning"
.P
Pythagorean tuning is based on a perfect fifth having a ratio of 3/2 (1.5),
which works out to about 702 cents.
Starting from the reference note a4, the other notes are determined by
going around the circle of fifths, using this ratio.
So, if you are using the default 440 for a4, e5 would be 660, b5 would be
990, etc.
To get from any natural note to its sharp version in the same octave
(like f4 to f#4), you go up 7 fifths and down 4 octaves:
(3/2)^7 / 2^4 = 2187/2048, about 1.06787 or 114 cents.
So a sharp is defined to be that ratio.
A flat is the inverse, 0.93644, or -114 cents.
For a double sharp, square the sharp ratio (1.14035) or double the cents (227).
For a double flat, square the flat ratio (0.87692) or double the cents (-227).
.P
Pythagorean tuning is usually not used with only its default intervals
and accidentals.
It is usually used with custom accidentals or redefining the ratios for
standard accidentals, as shown in examples below.
.H 4 "Meantone tuning"
.P
Meantone tuning is based on a major third being 5/4 (1.25), or about 386 cents.
Perfect fifths are the fourth root of 5,
so that if you go up 4 fifths and down 2 octaves, you get the 5/4 for
the major third.
Using this value for a fifth (about 1.49535 or 697 cents),
the other notes are determined by
going around the circle of fifths, using this ratio.
To get from any natural note to its sharp version in the same octave
(like f4 to f#4), you go up 7 fifths and down 4 octaves:
(5^(1/4))^7 / 2^4, about 1.044907 or 76 cents.
So a sharp is defined to be that ratio.
A flat is the inverse, 0.95702, or -76 cents.
For a double sharp, square the sharp ratio (1.09183) or double the cents (152).
For a double flat, square the flat ratio (0.91589) or double the cents (-152).
.P
Meantone is a compromise that lets you approximate the sound of
just intonation in any key, without having to use custom accidentals
or redefining standard accidentals.
.H 3 "Using just intonation"
.P
This section illustrates the use of custom accidentals and the related
parameters by showing two ways to set up standard just intonation scales,
with all the major, minor and perfect intervals, plus the augmented fourth.
For an example, we will use a key note of c, and we will have a4 be 440 Hz.
.P
Here are the ratios for the just intervals from c up to each other note:
.Ex 1
.\"score leftmargin=1.25; rightmargin=1.25; time = 13/1n
.\"music
.\"rom above 1: 1 "P1"; 2 "m2"; 3 "M2"; 4 "m3"; 5 "M3"; 6 "P4"; 7 "A4";
.\"rom below 1 dist 5: 1[-1] "1/1"; 2[-3] "16/15"; 3 "9/8"; 4[-1] "6/5";
.\"rom below 1 dist 5: 5[-1] "5/4"; 6[-1] "4/3"; 7[-2] "45/32";
.\"rom above 1: 8 "P5"; 9 "m6"; 10 "M6"; 11 "m7"; 12 "M7"; 13 "P8";
.\"rom below 1 dist 5: 8 "3/2"; 9[-1] "8/5"; 10[-1] "5/3"; 11[-1] "16/9";
.\"rom below 1 dist 5: 12[-1] "15/8"; 13[-1] "2/1";
.\"1: 1cn; d&; dn; e&; en; fn; f#; gn; a&; an; b&; bn; cn+;
.\"bar
.Ee
.P
For both methods, we'll start with pythagorean tuning.
Going around the circle of fifths starting from c,
we find that this g and d agree with pythagorean.
But a would be 27/16.
To arrive at 5/3, we need to multiply the 27/16 by 80/81.
This lowers it by a "syntonic comma".
It turns out that e, b, and f# also need to be lowered by that amount.
Going the other direction, we find that f and b& agree, but
e&, a&, and d& need to be raised by 81/80, a syntonic comma.
.P
For the just a to be 440 Hz, the pythagorean a has to be 445.5
(multiply by 81/80).
So we set a4freq to 445.5.
.H 4 "First method: redefine standard accidentals"
.P
For the first method, we use normal notation (standard accidentals),
but redefine their offsets as necessary to achieve the ratios shown above.
.P
Consider e&. The pythagorean e is 81/64.
(Up four fifths from c, then down two octaves.)
To get to the 6/5 that we need for e&, we have to multiply 81/64 by 128/135.
So when they are used on the note e, flats should be 128/135.
.P
Using similar reasoning, we find that flats on a and d should also be 128/135.
But flats on b should be 2048/2187.
The sharp on f should be 135/128.
.P
Naturals also need to be redefined when they differ from their pythagorean
values.
We have already found those values: naturals on a, e, and b need to be 80/81.
The other natural notes agree, and we can let them default to 1/1.
Remember, when a note appears without any accidental on it, is is treated
the same as if it had a natural.
.P
So, the following will set up everything as required:
.Ex
accidentals "key_of_c_just"
"flat" d 128/135 e 128/135 a 128/135 b 2048/2187
"sharp" f 135/128
"nat" e 80/81 a 80/81 b 80/81
score
a4freq = 445.5
tuning = pythagorean
acctable = "key_of_c_just"
.Ee
.P
Notes not defined in this table will default to their pythagorean values.
We have found that those are the correct values for naturals.
But they are probably wrong for sharps, flats, double sharps, and double flats.
If you wanted to use any of those notes, you would have to decide what its
ratio should be, and then figure out what offset should be put in the table.
Especially for notes far from the key center (c), it is not obvious
what ratio you would want.
.P
This brings up a problem.
You may need multiple versions of some notes, even for ones not far
from the key center.
For example, the ratio 5/3 is used for a.
That works well if you are playing an F major chord, fac+.
But if you are playing a D minor chord, dfa, that is not the right ratio.
To get a perfect 3/2 fifth from d to a, you would want a to be 27/16.
This leads us to the second method.
.H 4 "Second method: use custom accidentals"
.P
This method also uses pythagorean tuning as a basis, but instead of
redefining the standard accidentals to different values for different notes,
it defines custom accidentals for offsets that differ from the
pythagorean defaults.
Each accidental, standard or custom, has the same offset no matter what
note it is applied to.
.P
In simple cases such as the scales we are defining in this section,
it turns out that each note either agrees with the pythagorean ratio,
or else is higher or lower by a syntonic comma, 81/80 or 80/81.
You could define accidentals for up and down commas, and use them
alone or together with standard accidentals, as follows:
.Ex 1
.\"score leftmargin=1.5; rightmargin=1.5; time = 8/1n; label = ""
symbol "commaup"
bbox = -350, -700, 350, 700
postscript = "gsave
0 600 moveto -250 135 lineto -230 135 lineto
0 420 lineto 230 135 lineto 250 135 lineto fill
70 setlinewidth 0 500 moveto 0 -600 lineto stroke
grestore"
symbol "commadn"
bbox = -350, -700, 350, 700
postscript = "gsave
0 -600 moveto -250 -135 lineto -230 -135 lineto
0 -420 lineto 230 -135 lineto 250 -135 lineto fill
70 setlinewidth 0 -500 moveto 0 600 lineto stroke
grestore"
accidentals "just"
"commaup" all 81/80
"commadn" all 80/81
score
a4freq = 445.5
tuning = pythagorean
acctable = "just"
define CU {"commaup"} @
define CD {"commadn"} @
music
rom 1: 1 "C Lydian";
1: 1c; d; eCD; fCD#; g; aCD; bCD; c+;
bar
rom 1: 1 "C Phrygian";
1: 1c; dCU&; eCU&; f; g; aCU&; b&; c+;
bar
.Ee
Or, you may instead want to define a set of custom accidentals that
act as combinations of standard accidentals and commas, and perhaps
some accidentals for other ratios.
One such set was mentioned earlier: the set defined in the "helmholtz_accs"
file that is in the Mup distribution.
Using those definitions, the above example looks like this:
.Ex 1
.\"score leftmargin=1.5; rightmargin=1.5; time = 8/1n; label = ""
include "helmholtz_accs"
score
a4freq = 445.5
tuning = pythagorean
acctable = "helmholtz"
define SD {"sharpdn"} @
define ND {"natdn"} @
define FU {"flatup"} @
music
rom 1: 1 "C Lydian";
1: 1c; d; eND; fSD; g; aND; bND; c+;
bar
rom 1: 1 "C Phrygian";
1: 1c; dFU; eFU; f; g; aFU; b&; c+;
bar
.Ee
.H 3 "Debugging tuning settings"
.P
To help verify that you have specified the correct input,
you can run the "mup" command with the
.Hr cmdargs.html#dbgoption
debugging option
of "-d 512", along with an
.Hr cmdargs.html#moption
option to generate MIDI.
In addition to some other debugging output, it will print tables to standard
error output,
which show the frequency being used for each note in your piece.
If you change any of the parameters along the way, it will print a table for
each section of your piece as delimited by the places where the
parameters change.
.Ht Mup Parameters
.Hd param.html
.H 1 PARAMETERS
.P
.Ix aD
Parameters can be set in various contexts. All parameters
.Ix fQ
have default values, so that you need to explicitly set them only if you
want some value other than the default value.
.P
Some parameters can be set only in the score context. Others can be set in
.Ix hJ
.Ix hK
either score or staff contexts. A few can be set in score, staff, or voice
.Ix bF
context. If a given parameter can be set in several
.Hr contexts.html
contexts,
the value is that of the parameter at the
most specific context in which it is set. For example, if Mup is working
on musical data for voice 2 of staff 5, and it needs to
look up the value of a parameter, it will first see if that parameter has
been set in context "voice 5 2".
If so, it will use that value. If not,
it will see if the parameter was set in context "staff 5". If that has not
been set either, it will use the value from the score context. The score
context initially has all parameters set to their default values.
There are a few parameters, mostly related to font and text size,
that can also be set in
.Hr headfoot.html
header, footer, and similiar contexts.
.P
Parameters are set by the following syntax:
.Ex
\fIparameter_name\fP\fB=\fP\fIvalue\fP
.Ee
.P
Several parameters can be set on a single line by separating them with
a semicolon. For example:
.Ix hH
.Ex
staffs=2 ; key=2& ; time=2/4
.Ee
.P
Parameters can be unset in staff or voice context using
.Ex
\fBunset\fR\fI parameter_name\fR
.Ee
Unsetting a parameter in staff context will cause it
to revert to its value in score context (unless overridden in voice context).
Unsetting a parameter in voice context will cause it
to revert to its value in staff context if that is set,
otherwise to its value in score context.
.P
There are a few parameter that can be changed
.Hr midmeas.html
mid-measure.
That is noted in their descriptions.
.P
.Hm saverest
It is possible to take a "snapshot" of the current state of all the parameters,
and then restore that state later. This is done in the "control" context.
When you want to take a snapshot, you do
.Ex
control
saveparms "some name"
.Ee
and then to restore, you do
.Ex
control
restoreparms "some name"
.Ee
using whatever name you used for the save.
The name can be anything you like. You can save as often as you like.
You can restore from any previous save.
.P
Here is a simple example that saves the default parameter settings,
changes three parameters, and saves again under a different name.
It then uses the changed parameters for one measure, restores
the defaults for one measure, then restores
to the changed values for a measure.
.Ex 1
.\"score
.\" leftmargin=1
.\" rightmargin=1
.\" scale=0.9
control
saveparms "default"
score
time=cut
beamstyle=2,2
key=3&
control
saveparms "22"
music
1: 8c;;;;2e;
bar
control
restoreparms "default"
music
1: 8d;;;;2f;
bar
control
restoreparms "22"
music
1: 8e;;;;2g;
endbar
.Ee
.P
Sometimes when you use saveparms/restoreparms, you may want to use
.Hr macros.html#saverest
savemacros/restoremacros
as well.
.P
The parameters are listed below in alphabetical order. For each,
the description includes the parameter's name,
legal values, default value, when it takes effect,
and contexts in which the parameter can be
set, along with an example of its usage.
If there are other related parameters, they are referenced as well.
.\" include Parameter index here for html
.pI
.\"
.\"
.Hi
.ft B
.nr Pa \wDescription.....
.ft P
.de bP
.br
.di pA
.ev 1
.ft R
.ps 10
.ta \n(Pau
.in +(\n(Pau+0.1i)
.fi
..
.de eP
.br
.in 0
.ev
.di
.ne \\n(dnu
.ev 1
.nf
.na
.pA
.fi
.ev
..
.de Na
.sp 3
.ti 0
\fBName\fP
..
.de Va
.br
.ti 0
\fBValue\fP
..
.de Df
.br
.ti 0
\fBDefault\fP
..
.de Cn
.br
.ti 0
\fBContext\fP
..
.de mM
.br
It is possible to change this parameter
in the middle of a measure, using << >>.
..
.de Te
.br
.ti 0
\fBTakes effect\fP
..
.de Nm
.Te
at next music context
..
.de Ni
.Te
at next music context, or immediately if mid-measure
..
.de Im
.Te
immediately
..
.de Ns
.Te
at start of next score
..
.de Pm
.Te
immediately for purposes of checking for interactions with other parameters,
at next music context for printing
..
.de Ps
.Te
immediately for purposes of checking for interactions with other parameters,
at start of next score for printing
..
.de Oo
.Te
applies to entire input, and cannot be changed after music input
..
.de Mn
.Te
at next music context if measnum parameter is "every N," else start of next score
..
.de Bw
.Te
between the current score and the next score
..
.de eX
.br
.ti 0
\fBExample\fP
..
.de eS
.br
.ti 0
\fBExamples\fP
..
.de De
.br
.ti 0
\fBDescription\fP
..
.de Sa
.br
.ti 0
\fBSee also\fP
..
.He
.\"
.\"
.\"
.\"-------------------------
.bP
.Na
.Hm a4freq
a4freq
.De
This parameter specifies the frequency, in Hertz, of the A in octave 4,
which is the A above middle C.
.Va
100.0 to 1000.0
.Df
440.00
.Cn
score
.Nm
.eX
a4freq = 420.15
.Sa
.Hr param.html#acctable
acctable,
.Hr param.html#tuning
tuning
.eP
.\"-------------------------
.bP
.Na
.Hm aboveord
aboveorder
.De
This parameter specifies in what order to stack items that are printed above a staff.
The value is a comma-separated list of all the types of things that
can be printed above a staff. Items are stacked in the order listed,
starting from just above the staff and working upward.
If you want several types to be handled as a single
category, with all types in the category
having the same stacking priority, separate
them with an ampersand rather than a comma. The ampersand cannot
be used with lyrics, ending, or reh. The dyn category applies to
crescendo and decrescendo marks (from "<" and ">" statements)
as well as text with the dyn modifier.
The chord category applies to text with chord, analysis, or figbass
modifiers. The othertext category applies to rom, bold, ital, and
boldital items that do not have a chord, analysis, figbass, or dyn modifier.
If you omit any categories, they will be stacked last, in their default order.
.Va
.Hr mussym.html
mussym,
.Hr octave.html
octave,
.Hr textmark.html#chordmod
dyn, othertext, chord,
.Hr lyrics.html
lyrics,
.Hr bars.html#endings
ending,
.Hr bars.html#reh
reh
.Df
mussym, octave, dyn & othertext & chord, lyrics, ending, reh
.Cn
score, staff
.Ns
.eX
aboveorder = mussym, lyrics, dyn, octave, othertext, chord, ending, reh
.Sa
.Hr param.html#beloword
beloworder,
.Hr param.html#betwnord
betweenorder,
.Hr param.html#chdist
chorddist,
.Hr param.html#dist
dist,
.Hr param.html#dyndist
dyndist
.Ix fT
.Ix gA
.Ix aE
.Ix gW
.Ix fR
.Ix iN
.Ix iM
.Ix aR
.Ix aQ
.Ix gH
.Ix gI
.Ix gJ
.Ix gK
.Ix cL
.Ix cM
.eP
.\"-------------------------
.bP
.Na
.Hm acctable
acctable
.De
This parameter specifies which table of accidentals, as defined in an
accidentals context,
to use. It can be set to nothing, to mean to use only the normal standard
accidentals (#, &, x, &&, n) with their default meanings as implied by the
.Hr param.html#tuning
tuning parameter.
.Va
a quoted string that matches the name used for an accidental context
.Df
not set
.Cn
score
.Nm
.eS
acctable = "my_accs"
.br
acctable = // set back to default
.Sa
.Hr param.html#a4freq
a4freq,
.Hr param.html#tuning
tuning
.eP
.\"-------------------------
.bP
.Na
.Hm addxpose
addtranspose
.De
This parameter specifies by what additional interval to transpose the music data.
There is another parameter called just
.Hr param.html#xpose
transpose.
Typically you would use the transpose parameter to change the key of
individual staffs (for transposing instruments), and then use the
addtranspose parameter if you want to change the key of the entire score.
But either of these parameters can be used either way.
In any case, for each staff, and for the score, the values of
transpose and addtranspose are both applied, one after the other,
to the current key signature, notes, and chords
to determine their resulting values.
The interval can be
larger than an octave, but must be a valid interval (e.g., there is no
such thing as a perfect 6th). It is an error to specify a transposition value
that would result in a key signature with more than 7 flats or sharps.
.Ix cG
It is also an error if transposition would result in a note requiring a
triple sharp or triple flat.
.Va
the word "up" or "down," followed by an interval and a whole number greater than 0.
You can optionally add the keyword "notes" or "chords" at the end, to restrict the
transposition to just notes or just chord symbols; by default, both are
transposed.
The interval is one of major, minor, augmented, diminished, or perfect.
.Ix iQ
The intervals can be abbreviated to their first three letters (maj,
min, aug, dim, or per).
The
.Hr trnspose.html
section on transposition
lists transposition intervals and gives further details.
Depending on which key signature you are
transposing from, some transposition intervals may not work, because they
result in more than 7 flats or sharps.
.Df
up perfect 1 (i.e., no transposition)
.Cn
score, staff
.Nm
.eS
addtranspose = down major 3
.br
addtranspose = up perfect 5
.br
addtranspose = up minor 2 notes
.Sa
.Hr param.html#a4freq
a4freq,
.Hr param.html#key
key,
.Hr param.html#xpose
transpose,
.Hr param.html#useaccs
useaccs
.Ix fB
.Ix fC
.Ix gA
.Ix cG
.Ix hF
.eP
.\"-----------------
.bP
.Na
.Hm alignlabels
alignlabels
.De
This parmaeter specifies how to align labels for staffs,
including those for brace and brackets group.
Each nesting level will be aligned independently.
This applies to labels relative to each other,
not to lines within a single multi-line label.
.Va
center, left, or right
.Df
right
.Cn
score
.Ns
.eX
alignlabels = center
.Sa
.Hr param.html#brace
brace,
.Hr param.html#bracket
bracket,
.Hr param.html#label
label,
.Hr param.html#label2
label2
.eP
.\"-----------------
.bP
.Na
.Hm alignped
alignped
.De
If set to n, this parameter allows pedal marks to individually move
closer to the staff. If set to y, all pedal marks on a score are aligned.
If set to n, you can use
.Hr stuff.html#aligntag
align
on pedal marks, and in either case, you can use
.Hr stuff.html#dist
dist,
to force them to a particular place.
.Va
y or n
.Df
y
.Cn
score, staff
.Ns
.eX
alignped=n
.Sa
.Hr param.html#pedstyle
pedstyle
.eP
.\"-----------------
.bP
.Na
.Hm alignrst
alignrests
.De
This parameter controls whether rests stay as close to the middle of the
staff as possible, or whether they are adjusted to align with the notes
surrounding them. If the value is "n," no alignment to the notes is done.
If the value is "y," rests are moved to try to follow the flow of the voice.
The alignment of rests with notes is only done when the
.Hr param.html#vscheme
vscheme parameter
is something other than 1, and if there are no non-space chords in voice 3.
It is not used on voice 3.
This parameter can be changed in mid-measure. Only notes that are inside the
time period when this parameter is set to y will affect alignment.
.Va
y or n
.Df
n
.Cn
score, staff, voice
.mM
.Ni
.eX
alignrests=y
.Sa
.Hr param.html#vscheme
vscheme
.eP
.\"-----------------
.bP
.Na
.Hm barstyle
barstyle
.De
This parameter
specifies which staffs are to have their bar lines connected together.
When drawing bar lines, a continuous vertical line will be drawn from
the top line of the top staff in a range to the bottom line of the bottom
staff of the range.
Any staff not listed will be barred by itself, with the bar line spanning
only the height of the staff.
.Va
a comma-separated list of staff numbers and/or ranges of staff numbers.
Staff numbers can be from 1 to the value of the
.Hr param.html#staffs
\&"staffs" parameter.
A range is a pair of numbers separated by a dash.
You can also specify all, which means to bars all staffs together regardless
of how many there are.
You can specify between, which causes the bar lines to be drawn between
adjacent staffs and not through them. If you want a mixture of between and
not between, all the non-between ranges must be specified first, then the
word between, then the between ranges.
A given staff number can be specified only once,
and there can be no overlapping between ranges.
.Df
each visible staff barred individually
.Cn
score
.Nm
.eX
barstyle = 1-2, 5-8
.br
barstyle = all
.br
barstyle 1-4,10-12, between 5-9,13-17
.br
barstyle = between all
.Sa
.Hr param.html#staffs
staffs,
.Hr param.html#subbar
subbarstyle,
.Hr param.html#visible
visible
.Ix dD
.Ix gG
.Ix gL
.Ix gM
.Ix gN
.eP
.\"------------------------------------------
.bP
.Na
.Hm beamslp
beamslope
.De
This parameter
allows you to control the slope of beams.
Two values must be given, separated by a comma.
Mup calculates an appropriate slope for beams by applying a linear
regression algorithm that uses the positions of the noteheads within
the beam. The first value supplied for the beamslope parameter
is a factor by which to multiply the default slope that Mup calculates.
The minimum value of 0.0 would cause all beams to be horizontal,
whereas the maximum value of 1.0 will use the slope Mup calculates.
Intermediate values will yield beams that are less slanted than the
default slope calculation. The second value given to the beamslope parameter
is the maximum angle for the beam, in degrees.
If the originally calculated value multiplied by the
factor yields an angle of greater than this maximum angle,
the maximum angle will be used.
.Hr ichdattr.html#crossbm
Cross-staff beams that are between staffs
are allowed to have a slope up to 1.4 times the value
of the slope of the maximum angle, since they face more constraints.
The slope can be overridden on a particular beam by specifying a
.Hr ichdattr.html#slope
slope as an interchord attribute
on the first chord of the beamed set.
.Va
0.0 to 1.0 for the factor, and 0.0 to 45.0 for the maximum angle
.Df
0.7, 20.0
.Cn
score, staff, voice
.Nm
.eX
beamslope=0.8,20
.Ix jJ
.Sa
.Hr param.html#tupslope
tupletslope
.eP
.\"------------------------------------------
.bP
.Na
.Hm beamstyl
beamstyle
.De
This parameter
specifies how to beam eighth notes or shorter. It is specified
as a list of time values. Any number of notes up to each time value
will be beamed together. For example, in 4/4 time, with beamstyle=4,4,4,4
each quarter note worth of shorter notes would be beamed together.
However, beams would not span across beats. As another example, for an input
of 4.; 8; 8; 4.; the two eighth notes
would not be beamed together, because they span beats. If beamstyle
had been specified as 4,2,4 then the eighth notes would be beamed.
Normally, beams also end whenever a rest or space is encountered.
However, if an "r" is placed at the end of the list of time values,
Mup will beam across rests of less than quarter note duration.
Similarly, if an "s" is placed at the end of the list,
Mup will beam across spaces of less than quarter note duration.
You can specify both r and s in either order.
It is possible to specify subbeams, or secondary groupings within a beam,
by enclosing a list of time values in parentheses. In this case,
the outer beam extends for the sum of the values in the parentheses,
while inner beams extend only for the individual values within the parentheses.
For example, if you set
beamstyle=(4,4),(4,4) and then have a measure that consists of all 16th notes,
the first eight notes would be connected by an outer beam, as would the last
eight notes, but the second (inner) beams would cover only four notes each.
The parentheses cannot be nested.
It is possible to override this default beaming style within a specific
measure. See the section on
.Hr ichdattr.html#custbeam
Custom Beaming
for examples of how to obtain various kinds of beaming.
The value of the beamstyle parameter is remembered for
any later changes back to the same time signature.
In other words, if you set the value of the
.Hr param.html#time
time parameter
and the beamstyle parameter in the same context, then later set only
the time, the beamstyle that you had set earlier
will be used again.
.Va
a comma-separated list of time values that add up to a measure. Time values
are specified as 4 for a quarter note, 2 for half note, etc, and
can be dotted if necessary, or an expression with added and/or subtracted
times. The list can optionally be followed by an "r"
to indicate beams should span rests.
It can optionally be followed by "s" to indicate beams should span spaces.
Two or more of the time values may be enclosed in parentheses, to indicate
sub-groupings of inner (secondary) beams within outer (primary) beams.
If the value is empty, automatic beaming is turned off.
.Df
no beams; each note of eighth or shorter duration is individually flagged.
.Cn
score, staff, and voice
.Pm
.eS
beamstyle = 4,4,4,4
.br
beamstyle = 2.
.br
beamstyle=4+16, 4+16
.br
beamstyle = 2, 2 rs // beam across rests and spaces
.br
beamstyle = (4., 4., 4.) // one outer beam per measure,
.br
// with inner beams broken at each dotted quarter duration
.br
beamstyle = // turn off beaming
.Ix bA
.Ix dE
.Ix dH
.Ix dI
.Ix dJ
.Ix fP
.Ix gT
.Ix gX
.Ix hG
.Ix hL
.eP
.\"-------------------------
.bP
.Na
.Hm beloword
beloworder
.De
This parameter specifies in what order to stack items that are printed below a staff.
The value is a comma-separated list of all the types of things that
can be printed below a staff. Items are stacked in the order listed,
starting from just below the staff and working downward.
If you want several types to be handled as a single
category, with all types in the category
having the same stacking priority, separate
them with an ampersand rather than a comma. The ampersand cannot
be used with lyrics or pedal. The dyn category applies to
crescendo and decrescendo marks (from "<" and ">" statements)
as well as text with the dyn modifier.
The chord category applies to text with chord, analysis, or figbass
modifiers. The othertext category applies to rom, bold, ital, and
boldital items that do not have a chord, analysis, figbass, or dyn modifier.
If you omit any categories, they will be stacked last, in their default order.
.Va
.Hr mussym.html
mussym,
.Hr octave.html
octave,
.Hr textmark.html#chordmod
dyn, othertext, chord,
.Hr lyrics.html
lyrics,
.Hr pedal.html
pedal
.Df
mussym, octave, dyn & othertext & chord, lyrics, pedal
.Cn
score, staff
.Ns
.eX
beloworder = mussym, lyrics, dyn, octave, othertext, chord, pedal
.Sa
.Hr param.html#aboveord
aboveorder,
.Hr param.html#betwnord
betweenorder,
.Hr param.html#chdist
chorddist,
.Hr param.html#dist
dist,
.Hr param.html#dyndist
dyndist
.Ix fT
.Ix gA
.Ix aE
.Ix gW
.Ix fR
.Ix iN
.Ix iM
.Ix fL
.Ix gH
.Ix gI
.Ix gJ
.Ix gK
.Ix cL
.Ix cM
.eP
.\"-------------------------
.bP
.Na
.Hm betwnord
betweenorder
.De
This parameter specifies in what order to stack items that are printed between two staffs.
The value is a comma-separated list of all the types of things that
can be printed between staffs. Items are stacked in the order listed,
starting from a baseline and working upward.
If you want several types to be handled as a single
category, with all types in the category
having the same stacking priority, separate
them with an ampersand rather than a comma. The ampersand cannot
be used with lyrics. The dyn category applies to
crescendo and decrescendo marks (from "<" and ">" statements)
as well as text with the dyn modifier.
The chord category applies to text with chord, analysis, or figbass
modifiers. The othertext category applies to rom, bold, ital, and
boldital items that do not have a chord, analysis, figbass, or dyn modifier.
If you omit any categories, they will be stacked last, in their default order.
.Va
.Hr mussym.html
mussym,
.Hr textmark.html#chordmod
dyn, othertext, chord,
.Hr lyrics.html
lyrics,
.Df
mussym, dyn & othertext & chord, lyrics
.Cn
score, staff
.Ns
.eX
betweenorder = mussym, lyrics, dyn & othertext, chord
.Sa
.Hr param.html#aboveord
aboveorder,
.Hr param.html#beloword
beloworder,
.Hr param.html#chdist
chorddist,
.Hr param.html#dist
dist,
.Hr param.html#dyndist
dyndist
.Ix fT
.Ix aE
.Ix gW
.Ix fR
.Ix iN
.Ix iM
.Ix gH
.Ix gI
.Ix gJ
.Ix gK
.Ix cL
.Ix cM
.eP
.\"-------------------------
.bP
.Na
.Hm botmar
bottommargin
.De
This parameter
sets the amount of white space margin to put at the bottom of each page.
It is specified in inches if the
.Hr param.html#units
units parameter
is set to inches, or in centimeters if the units parameter is set to cm.
This parameter can only be specified before any music or
.Ix jC
.Hr prnttext.html#block
block input.
Margins are unaffected by
.Hr param.html#scale
the "scale" parameter.
The parameter name can be abbreviated to just "botmargin" if you wish.
.Va
0.0 to pageheight minus 0.5 inches
.Df
0.5 inches
.Cn
score
.Oo
.eX
bottommargin = 0.8
.Sa
.Hr param.html#leftmar
leftmargin,
.Hr param.html#rightmar
rightmargin,
.Hr param.html#topmar
topmargin,
.Hr param.html#pgheight
pageheight,
.Hr param.html#units
units
.Ix gM
.Ix gN
.Ix gO
.Ix gS
.eP
.\"------------------------------------
.bP
.Na
.Hm brace
brace
.De
This parameter
specifies which staffs are to be grouped together with a brace to the left
of the score. If there is a string given in parentheses, that string
will be used as the label to print on the next score,
left of the bracket at its vertical center.
If there is a second string,
that will be used as the label for succeeding scores.
.Va
a comma-separated list of staffs and/or staff ranges, each optionally followed
by one or two double-quoted strings enclosed in parentheses.
If there are two strings, they are separated by a comma.
Staff numbers can range from 1 to the value of
.Hr param.html#staffs
the "staffs" parameter.
A given staff number can be specified only once,
and there can be no overlapping between ranges.
Giving no value will result in no braces on any staffs.
.Df
no staffs are grouped by braces.
.Cn
score
.Ps
.eS
brace = 3-4
.br
brace = 1, 2-3, 4, 5-6
.br
brace = 1-2 ("piano"), 3 ("cello")
.br
brace = 1-2 ("Primo", "I")
.br
brace = // no braces at all (the default)
.Sa
.Hr param.html#bracket
bracket,
.Hr param.html#label
label,
.Hr param.html#label2
label2,
.Hr param.html#staffs
staffs
.Ix dP
.Ix dV
.Ix hB
.Ix hJ
.Ix hK
.eP
.\"------------------------------------
.bP
.Na
.Hm bracket
bracket
.De
This parameter
specifies which staffs are to be grouped together with a bracket to the left
of the score. If there is a string given in parentheses, that string
will be used as the label to print on the next score,
left of the bracket at its vertical center.
If there is a second string,
that will be used as the label for succeeding scores.
.Va
a comma-separated list of staffs and/or staff ranges, each optionally followed
by one or two double-quoted strings enclosed in parentheses.
If there are two strings, they are separated by a comma.
Staff numbers can range from 1 to the value of
.Hr param.html#staffs
the "staffs" parameter.
A bracket range can overlap another bracket range, as long as one range
is a proper subset of the other.
Giving no value will result in no brackets on any staffs.
.Df
no staffs are grouped by brackets.
.Cn
score
.Ps
.eS
bracket = 6-7
.br
bracket = 17, 21-23
.br
bracket = 8-9 ("SATB")
.br
bracket = 10-12 ("Strings", "Str")
.br
bracket = // no brackets at all (the default)
.Sa
.Hr param.html#brace
brace,
.Hr param.html#label
label,
.Hr param.html#label2
label2,
.Hr param.html#staffs
staffs
.Ix dW
.eP
.\"------------------------------------
.bP
.Na
.Hm brktrpts
bracketrepeats
.De
When set to "y," brackets are drawn at repeat signs to make it more
obvious to the performer where the repeated section begins and ends,
which may be helpful when playing in a dimly lit area. Which staffs are
bracketed together is controlled by the
.Hr param.html#endingst
endingstyle parameter.
.Va
\fBy\fP or \fBn\fP
.Df
n
.Cn
score
.Nm
.eX
bracketrepeats=y
.Sa
.Hr param.html#endingst
endingstyle,
.Hr param.html#rptdots
repeatdots
.eP
.bP
.Na
.Hm canclkey
cancelkey
.De
When set to "y," when a key changes, any sharps or flats in the
previous key that are not part of the new key will be canceled by printing
natural signs, before printing the new key signature. When
set to "n," the naturals will only be printed if the new key has no
sharps or flats.
.Va
y or n
.Df
n
.Cn
score, staff
.Nm
.eX
cancelkey=y
.Sa
.Hr param.html#key
key,
.Hr param.html#useaccs
useaccs
.Ix iI
.eP
.\"--------------------
.bP
.Na
.Hm carryacc
carryaccs
.De
This parameter specifies, for
.Hr midi.html
MIDI,
whether accidentals follow the normal notation rules of carrying through
the remainder of the current measure until explicitly changed. If set to n,
each accidental will apply only to the specific chord where it was specified.
.Va
y or n
.Df
y
.Cn
score, staff
.Nm
.eX
carryaccs = n
.Sa
.Hr param.html#useaccs
useaccs
.eP
.\"--------------------
.bP
.Na
.Hm chdist
chorddist
.De
This parameter sets the minimum distance from staffs to place chords. When
chord marks are printed, they will be placed
no closer to the staff than the value
of this parameter. This can be used to reduce the ragged effect of having
some chord marks much higher than others, because other things were in
their way.
If a specific chord mark has to be
moved farther away than this parameter to avoid running into something,
that will still happen,
but any others will come out at the level specified by this parameter.
This parameter may be overridden on specific items. The section on
.Hr stuff.html
tempo, dynamic marks, ornaments, etc.
gives details on how to do this.
.Va
a number between 0.0 and 50.0 inclusive, given in stepsizes
.Df
3.0
.Cn
score, staff
.Nm
.eX
chorddist = 4
.Sa
.Hr param.html#dyndist
dyndist,
.Hr param.html#dist
dist,
.Hr param.html#lyrdist
lyricsdist,
.Hr param.html#scorepad
scorepad,
.Hr param.html#scoresep
scoresep
.Ix dO
.Ix fO
.Ix gW
.Ix hK
.eP
.\"------------------------------------
.bP
.Na
.Hm chordxlate
chordtranslation
.De
If set to "German" a B in a chord will be printed as H, while a B flat in a
chord will be printed as B. If set to a string containing 7 syllables, those
syllables will be substituted for pitches in chords, beginning
with C. I.e., a C will be replaced by the first syllable, a D by the second
syllable, etc.
.Va
\&"German" or a string like "do re mi fa sol la si" or nothing.
.Df
nothing
.Cn
score, staff
.Nm
.eX
chordtranslation = "DO RE MI FA SOL LA TI"
.eP
.\"------------------------------------
.bP
.Na
.Hm clef
clef
.De
This parameter
sets the clef to use.
Changing a clef may also change the default octave
.Hr param.html#defoct
(see the "defoct" parameter below).
However, if clef and defoct are both changed in the same context,
the defoct overrides what the clef would have set.
If the clef name is followed by a y that means to force printing
the clef even if it isn't different from the previous clef.
.Va
treble, treble8, 8treble, frenchviolin, soprano, mezzosoprano,
alto, tenor, baritone, bass, 8bass, bass8, or subbass.
Can optionally be followed by y, which will force the clef to be printed,
even if it is the same as the previous clef.
The treble8 clef looks like a treble clef with an 8 below it,
and refers to notes that are an octave lower than a normal treble clef.
The 8treble clef looks like a treble clef with an 8 above it,
and refers to notes that are an octave higher than a normal treble clef.
The bass8 clef looks like a bass clef with an 8 below it,
and refers to notes that are an octave lower than a normal bass clef.
The 8bass clef looks like a bass clef with an 8 above it,
and refers to notes that are an octave higher than a normal bass clef.
The subbass clef looks like a bass clef, but placed two stepsizes higher
on the staff.
If the
.Hr param.html#stlines
stafflines parameter
includes the "drum"
.Ix iE
keyword, then the value of this clef parameter is
only used for determining the placement of notes on the staff, with the
drum (or "neutral") clef actually printed.
Clef can be changed in
.Hr midmeas.html
the middle of a measure
using a construct like <<staff clef=bass>> before a note group.
.Df
treble
.Cn
score, staff
.mM
.Ni
.eX
clef = alto
.Sa
.Hr param.html#defoct
defoct,
.Hr param.html#stlines
stafflines
.Ix fI
.eP
.\"--------------------
.bP
.Na
.Hm cue
cue
.De
If set to y, all notes are made cue size. This
lets you have a long passage of cue notes without having
to specific [cue]... over and over.
.Va
y or n
.Df
n
.Cn
score, staff, voice
.Im
.eX
cue=y
.eP
.bP
.Na
.Hm defkmap
defaultkeymap
.De
This parameter
specifies which keymap to use if none of the other keymap parameters applies.
See the
.Hr textstr.html#keymaps
section on keymaps
in the
.Hr textstr.html
Text Strings chapter
for more details.
.Va
a string matching the name of a keymap defined earlier, or nothing.
An empty string ("") or nothing means don't do any mapping.
.Df
nothing
.Cn
score, staff
.Im
.eS
defaultkeymap="Cyrillic"
.br
defaultkeymap=
.Sa
.Hr param.html#endkmap
endingkeymap,
.Hr param.html#labkmap
labelkeymap,
.Hr param.html#lyrkmap
lyricskeymap,
.Hr param.html#prntkmap
printkeymap,
.Hr param.html#rehkmap
rehearsalkeymap,
.Hr param.html#textkmap
textkeymap,
.Hr param.html#withkmap
withkeymap
.Ix jL
.eP
.\"------------------------
.bP
.Na
.Hm defphside
defaultphraseside
.De
For cases where the side on which to place a phrase mark is not otherwise
already determined (and thus Mup would normally choose the side that seemed
best), this parameter can be set to force choosing above or below.
.Va
above, below, or not set
.Df
not set
.Cn
score, staff, voice
.Im
.eS
defaultphraseside=above
.br
defaultphraseside= // Let Mup choose
.eP
.\"------------------------
.bP
.Na
.Hm defoct
defoct
.De
This parameter
sets the default octave for any note
that does not have an explicit octave specified.
An octave goes from C up to the next B, with octave 4 being the octave
beginning on middle C.
If the
.Hr param.html#clef
clef
is changed on a staff, but defoct is not set in that same context,
the default octave is changed to match the new clef.
defoct can be changed in
.Hr midmeas.html
the middle of a measure
using a construct like <<staff defoct=5>> before a note group.
.Va
a number from 0 to 9 inclusive. Octave 4 is the octave beginning at middle C.
.Df
the octave containing the note represented by the middle line of the staff
given the current
.Hr param.html#clef
clef.
(Octave 5 for frenchviolin and 8treble;
octave 4 for treble, soprano, mezzosoprano,
alto and 8bass clefs; octave 3 for treble8, tenor, baritone and bass clefs;
octave 2 for bass8 and subbass clefs.)
.Cn
score, staff, voice
.Pm
.mM
.eX
defoct = 3
.Ix cU
.Ix fI
.Ix gA
.Ix hL
.eP
.\"--------------------
.bP
.Na
.Hm dist
dist
.De
This parameter
sets minimum distance from staff to place
.Hr textmark.html
rom, bold, ital, and boldital items,
and
.Hr bars.html#reh
rehearsal marks.
When these items are printed,
they will be placed no closer to the staff than the value
of this parameter. This can be used to reduce the ragged effect of having
some items much higher than others, because other things were in their way.
If a specific item has to be
moved farther away than this parameter to avoid running into something,
that will still happen,
but any others will come out at the level specified by this parameter.
If an item is also a chord,
.Hr param.html#chdist
the chorddist parameter
will be used instead of dist.
This parameter may be overridden on specific items. The sections on
.Hr stuff.html
tempo, dynamic marks, ornaments, etc.
and on
.Hr bars.html#reh
rehearsal marks
give details on how to do this.
.Va
a number between 0.0 and 50.0 inclusive, given in stepsizes
.Df
2.0
.Cn
score, staff
.Nm
.eX
dist = 6
.Sa
.Hr param.html#chdist
chorddist,
.Hr param.html#dyndist
dyndist,
.Hr param.html#lyrdist
lyricsdist,
.Hr param.html#scorepad
scorepad,
.Hr param.html#scoresep
scoresep
.Ix dO
.Ix fK
.Ix fO
.Ix gH
.Ix gI
.Ix gK
.eP
.\"-----------------
.bP
.Na
.Hm division
division
.De
This parameter sets the
.Hr midi.html
MIDI
division (number of clock ticks per quarter note). This typically
has a value of 192 or 384.
This parameter can only be specified before any music or block input.
.Va
1 to 1536
.Df
192
.Cn
score
.Oo
.eX
division = 384
.Ix aA
.Ix bR
.Ix hL
.eP
.\"--------------------
.bP
.Na
.Hm dyndist
dyndist
.De
This parameter
sets minimum distance from staff to place
.Ix cL
.Ix cM
.Hr cres.html
crescendo and decrescendo marks.
and text that is marked "dyn."
When these items are printed,
they will be placed no closer to the staff than the value
of this parameter. This can be used to reduce the ragged effect of having
some items much higher than others, because other things were in their way.
If a specific item has to be
moved farther away than this parameter to avoid running into something,
that will still happen,
but any others will come out at the level specified by this parameter.
This parameter may be overridden on specific items. The section on
.Hr stuff.html
tempo, dynamic marks, ornaments, etc.
gives details on how to do this.
.Va
a number between 0.0 and 50.0 inclusive, given in stepsizes
.Df
2.0
.Cn
score, staff
.Nm
.eX
dyndist = 4
.Sa
.Hr param.html#chdist
chorddist,
.Hr param.html#dist
dist,
.Hr param.html#lyrdist
lyricsdist,
.Hr param.html#scorepad
scorepad,
.Hr param.html#scoresep
scoresep
.Ix dO
.Ix fK
.Ix fO
.eP
.\"------------------
.bP
.Na
.Hm emptym
emptymeas
.De
By default, if you don't specify any music input for a given voice,
Mup just leaves a measure of space.
This parameter lets you specify what Mup should use.
The most common value other than space would be a measure of rest,
but you can supply any valid music input. So, for example, if your music
has a measure-long pattern that repeats frequently in some voice, you could
set this parameter to that pattern, and Mup will fill in that music
for every measure where you don't override with something else.
The value is a string, and is effectively placed in the input as if you
had typed it yourself. Note that since errors in the string will generally
not be caught until it is actually used, error messages may reference a line
a long ways away from the line where the parameter is defined.
Note also that since the value is a text string, all the usual rules for
.Hr textstr.html
text strings
apply; for example, any double quotes inside the string must
be backslashed. Since the processing of emptymeas happens before the
derivation of music on tabnote staffs,
you probably do not want to set a
.Hr tabstaff.html
tabnote staff
to something like emptymeas="mr;" unless the tab staff is also going to be
all rests, because that would override the music derivation.
Also, when you have set the
.Hr param.html#vscheme
vscheme
to have two or three voices just because there are a few spots in
the song that need more than one, you probably only want to set
emptymeas="mr;" on voice 1, or you will likely get more rests than you intended.
.Va
a text string (enclosed in double quotes, as usual), containing music input
.Df
ms;
.Cn
score, staff, voice
.Nm
.eS
emptymeas="mr;"
.br
emptymeas="8.c;16;8.e;16;8.f;16;{8g;f;g;}3;"
.eP
.bP
.Na
.Hm endkmap
endingkeymap
.De
This parameter
specifies which keymap to use for labels of endings
See the
.Hr textstr.html#keymaps
section on keymaps
in the
.Hr textstr.html
Text Strings chapter
for more details.
.Va
a string matching the name of a keymap defined earlier, or nothing.
An empty string ("") means don't do any mapping.
Setting to nothing unsets any previous value, which effectively causes the
.Hr param.html#defkmap
defaultkeymap
value to be used.
.Df
nothing
.Cn
score, staff
.Nm
.eS
endingkeymap="Greek"
.br
endingkeymap=
.Sa
.Hr param.html#defkmap
defaultkeymap,
.Hr param.html#labkmap
labelkeymap,
.Hr param.html#lyrkmap
lyricskeymap,
.Hr param.html#prntkmap
printkeymap,
.Hr param.html#rehkmap
rehearsalkeymap,
.Hr param.html#textkmap
textkeymap,
.Hr param.html#withkmap
withkeymap
.Ix jL
.eP
.\"------------------
.bP
.Na
.Hm endingst
endingstyle
.De
This parameter
controls how
.Hr bars.html#endings
first and second endings
are placed.
This parameter also controls where
.Hr param.html#measnum
measure numbers
and
.Hr bars.html#reh
rehearsal marks
are placed, as well as which staffs are bracketed together if the
.Hr param.html#brktrpts
bracketrepeats parameter
is set.
A value of "top" means that the endings and similar marks
will be shown only above the top
.Hr param.html#visible
visible staff.
A value of "barred"
means these marks will be shown above each set of staffs
that is barred together. Each staff that is barred individually will also
have the ending shown above it.
.Hr param.html#barstyle
(See the "barstyle" parameter above.)
A value of "grouped" means the marks
will be shown above the top visible
staff of each range of staffs that are joined by a
.Hr param.html#brace
brace
or
.Hr param.html#bracket
bracket.
In all cases, at least the top visible staff will
have endings shown above it.
.Va
top, barred, or grouped
.Df
top
.Cn
score
.Nm
.eX
endingstyle = grouped
.Sa
.Hr param.html#barstyle
barstyle,
.Hr param.html#brace
brace,
.Hr param.html#bracket
bracket,
.Hr param.html#brktrpts
bracketrepeats,
.Hr param.html#measnum
measnum,
.Hr param.html#rehstyle
rehstyle,
.Hr param.html#visible
visible
.Ix aQ
.Ix aR
.Ix dD
.Ix dG
.Ix dV
.Ix dW
.Ix dY
.Ix gG
.Ix gL
.Ix gM
.Ix hG
.Ix hK
.eP
.\"----------------------
.bP
.Na
.Hm xtendlyr
extendlyrics
.De
This parameter specifies whether Mup should automatically add
.Ix fW
underscore "extender lines"
to lyrics. This parameter only has effect when you let Mup derive
the time values for
.Hr lyrics.html
lyrics,
rather than specifying them explicitly.
When the parameter is set to y, and Mup finds a tie or slur in
the voice from which lyrics time values are being derived,
an underscore will be added to the corresponding syllable, if that syllable
doesn't already end with a dash or underscore.
.Va
y or n
.Df
n
.Cn
score, staff, voice
.Nm
.eX
extendlyrics=y
.Sa
.Hr param.html#sylpos
sylposition
.eP
.\"----------------------
.bP
.Na
.Hm firstpg
firstpage
.De
This parameter
specifies what to number the first page.
This value can be overridden by the
.Hr cmdargs.html#poption
-p command line option.
The number can be optionally followed by "leftpage" or "rightpage"
to say whether any header, footer, top, or bottom block on the
first page should use the left or right page versions, if those are
different.
This parameter can only be set before any music or block input.
.Va
1 to 5000
.Df
1 rightpage (unless panelsperpage=2, in which case the page side will be leftpage)
.Cn
score
.Oo
.eS
firstpage = 12
.br
firstpage = 1 leftpage
.Sa
.Hr param.html#panels
panelsperpage
.eP
.\"----------------------
.bP
.Na
.Hm flipmarg
flipmargins
.De
This parameter
specifies if the left and right margins are to be interchanged
on every other page. This may be useful if you want extra space for
book binding. If set to y, the first physical page will use the values
of
.Hr param.html#leftmar
leftmargin
and
.Hr param.html#rightmar
rightmargin
as is, but on the second page, and every other
page thereafter, the value for rightmargin will be used for the left margin
and the value for leftmargin will be used for the right margin.
The settings of the
.Hr param.html#firstpg
firstpage parameter
or the
.Hr cmdargs.html#ooption
option to print only selected pages
have no effect on this parameter.
.Va
y or n
.Df
n
.Cn
score
.Te
at next page
.eX
flipmargins = y
.Sa
.Hr param.html#leftmar
leftmargin,
.Hr param.html#rightmar
rightmargin
.eP
.\"----------------------
.bP
.Na
.Hm font
font
.De
This parameter
specifies which font to use for
.Hr prnttext.html
print, left, right, center, and title statements.
.Va
rom, ital, bold, or boldital
.Df
rom
.Cn
score, staff, header, footer, header2, footer2, top, bottom, top2, bottom2, block
.Im
.eX
font = boldital
.Sa
.Hr param.html#fontfam
fontfamily,
.Hr param.html#lyrfont
lyricsfont,
.Hr param.html#lyrfam
lyricsfontfamily,
.Hr param.html#size
size,
.Hr param.html#withfont
withfont
.Ix aS
.Ix aT
.Ix bG
.Ix gH
.Ix gI
.Ix gJ
.Ix gK
.Ix gW
.Ix hA
.Ix hB
.eP
.\"---------------------
.bP
.Na
.Hm fontfam
fontfamily
.De
This parameter
specifies what font family to use for
.Hr prnttext.html
print, left, right, center, and title statements.
It also provides the default for rom, bold, ital, and boldital statements.
.Va
avantgarde, bookman, courier, helvetica, newcentury, palatino, times
.Df
times
.Cn
score, staff, header, footer, header2, footer2, top, bottom, top2, bottom2, block
.Im
.eX
fontfamily=palatino
.Sa
.Hr param.html#font
font,
.Hr param.html#lyrfont
lyricsfont,
.Hr param.html#lyrfam
lyricsfontfamily,
.Hr param.html#withfam
withfontfamily
.Ix gB
.eP
.\"------------------------------------
.bP
.Na
.Hm gridfret
gridfret
.De
This parameter
specifies when to print fret numbers on grids.
.Ix iW
Normally, the top line of
a grid represents the nut. However, if the fingering for a chord is rather
far up the neck, it is customary to have the top line of the grid represent
some other fret, and print a fret number and "fr" next to the grid,
showing the actual fret of the lowest fret mark. This parameter controls
when Mup begins using this alternate format. Whenever all the frets of
a chord are greater than or equal to
the value specified for this parameter, and there are no strings marked "o",
the "fr" notation is used. If no value is set for this parameter,
the grid will just be made as tall
as necessary to accommodate the chord's frets;
but in any case, the grid will always be at least as high as the value of
.Hr param.html#mingrid
the mingridheight parameter.
.Va
2 to 99, or not set
.Df
4
.Cn
score, staff
.Nm
.eS
gridfret = 3
.br
gridfret =
.Sa
.Hr param.html#gridend
gridsatend,
.Hr param.html#gridscl
gridscale,
.Hr param.html#gridused
gridswhereused,
.Hr param.html#mingrid
mingridheight
.eP
.\"------------------------------------
.bP
.Na
.Hm gridend
gridsatend
.De
This parameter
specifies whether to print guitar grids at the end of the song.
If set to "y,"
grids for all of the chords used in the song will be printed.
Grids only associated with particular staffs will only be printed if that
staff is visible. Grids associated with "all" will use the score level value
of this parameter.
.Va
y or n
.Df
n
.Cn
score, staff
.Te
During each music context where this has been set to "y,"
it accumulates chords that are used. If you later set
it to n, it stops accumulating, but doesn't forget the
ones it accumulated earlier. At the end, it prints out
whatever ones it has accumulated, even if the flag is
n at that time.
.eX
gridsatend = y
.Sa
.Hr param.html#gridfret
gridfret,
.Hr param.html#gridscl
gridscale,
.Hr param.html#gridused
gridswhereused,
.Hr param.html#mingrid
mingridheight
.eP
.\"------------------------------------
.bP
.Na
.Hm gridscl
gridscale
.De
This parameter
specifies how large to make grids, relative to their default size.
For example, a value of 0.5 will make them 1/2 their default size.
The default size for grids summarized at the end
of the song
.Hr param.html#gridend
(the gridsatend parameter)
is larger than the default size for those printed with the music
.Hr param.html#gridused
(the gridswhereused parameter).
.Va
0.1 to 10.0
.Df
1.0
.Cn
score, staff
.Nm
.eX
gridscale = 0.5
.Sa
.Hr param.html#gridend
gridsatend,
.Hr param.html#gridfret
gridfret,
.Hr param.html#gridused
gridswhereused,
.Hr param.html#mingrid
mingridheight,
.Hr param.html#scale
scale,
.Hr param.html#stscale
staffscale
.eP
.\"------------------------------------
.bP
.Na
.Hm gridused
gridswhereused
.De
This parameter
specifies whether to print guitar grids along with chords
where they appear in the song. If set to "y," each
.Hr textmark.html#chordmod
text item with the chord modifier
will have a grid printed below its name.
.Va
y or n
.Df
n
.Cn
score, staff
.Nm
.eX
gridswhereused = y
.Sa
.Hr param.html#gridfret
gridfret,
.Hr param.html#gridend
gridsatend,
.Hr param.html#gridscl
gridscale,
.Hr param.html#mingrid
mingridheight
.eP
.\"------------------------------------
.bP
.Na
.Hm indentrs
indentrestart
.De
This parameter
specifies whether a restart should be indented when it occurs at the
beginning of a new score. It does not affect restarts that occur in
the middle of a score.
.Va
y or n
.Df
n
.Cn
score
.Nm
.eX
indentrestart = y
.eP
.\"------------------------------------
.bP
.Na
.Hm key
key
.De
This parameter
sets the key signature. This can be specified either by giving the
number of sharps (#) or flats (&), or by giving the name of the key.
.Va
If using the number of sharps/flats format, the value is
a number from 0 to 7, followed by "#" or "&," optionally followed by "major"
or "minor." 0& and 0# are equivalent.
If using the name of the key, the value is a letter "a" through "g,"
optionally followed by a "#" or "&," optionally followed by "major" or "minor."
The "major" and "minor" can be abbreviated to "maj" or "min."
The "major" or "minor" is used for
.Hr midi.html
MIDI file
purposes, and is optional; if omitted, it defaults to major.
If you wish to use a mode other than major or minor,
you have to specify the number of sharps or flats.
.Df
c major
.Cn
score, staff
.Nm
.eS
key = 3&
.br
key = 6#
.br
key = c# minor
.br
key = d major
.Sa
.Hr param.html#addxpose
addtranspose,
.Hr param.html#canclkey
cancelkey,
.Hr param.html#carryacc
carryaccs,
.Hr param.html#stlines
stafflines,
.Hr param.html#xpose
transpose,
.Hr param.html#useaccs
useaccs
.Ix aA
.Ix cG
.Ix fC
.eP
.\"------------------------
.bP
.Na
.Hm label
label
.De
This parameter specifies a label to be printed to the left of the staff on the next
score. If there is also a
.Hr param.html#brace
brace
or
.Hr param.html#bracket
bracket
label, that label will
be to the left of this label.
There is a
.Hr param.html#label2
label2
parameter that is used on subsequent scores.
In addition to being used for the very first score of a song,
this label parameter might be used to clearly mark a change in instrumentation
or voices for a particular staff. The label2 would typically be changed at
the same time, giving a more abbreviated label. For example,
you might set label="Tenor/Bass" and label2="TB"
.Va
.Hr textstr.html
a text string
enclosed in double quotes
.Df
enough spaces to produce an indent of 1/2 inch
.Cn
score, staff
.Ns
.eX
label = "oboe"
.Sa
.Hr param.html#alignlabels
alignlabels,
.Hr param.html#brace
brace,
.Hr param.html#bracket
bracket,
.Hr param.html#label
label2
.Ix dP
.Ix dV
.Ix dW
.Ix hB
.Ix hJ
.Ix hK
.eP
.\"-------------------------
.bP
.Na
.Hm label2
label2
.De
This parameter specifies a label to be printed to the left of the staff on all scores after
the first. If there is also a
.Hr param.html#brace
brace
or
.Hr param.html#bracket
bracket
label, that label will be to the left of this label.
If both the
.Hr param.html#label
label
and label2 parameters are set at the same time,
the label value will be used for the immediately
following score, with the label2 value used for subsequent scores.
If however, after the first score, only the label2 is changed,
then the label2 value will be used on the immediately following score
as well as subsequent scores.
.Va
.Hr textstr.html
a text string
enclosed in double quotes
.Df
no label
.Cn
score, staff
.Ns
.eX
label2 = "Solo"
.Sa
.Hr param.html#alignlabels
alignlabels,
.Hr param.html#brace
brace,
.Hr param.html#bracket
bracket,
.Hr param.html#label
label
.eP
.bP
.Na
.Hm labkmap
labelkeymap
.De
This parameter
specifies which keymap to use for labels to the left of staffs.
See the
.Hr textstr.html#keymaps
section on keymaps
in the
.Hr textstr.html
Text Strings chapter
for more details.
.Va
a string matching the name of a keymap defined earlier, or nothing.
An empty string ("") means don't do any mapping.
Setting to nothing unsets any previous value, which effectively causes the
.Hr param.html#defkmap
defaultkeymap
value to be used.
.Df
nothing
.Cn
score, staff
.Im
.eS
labelkeymap="Cyrillic"
.br
labelkeymap=
.Sa
.Hr param.html#defkmap
defaultkeymap,
.Hr param.html#endkmap
endingkeymap,
.Hr param.html#lyrkmap
lyricskeymap,
.Hr param.html#prntkmap
printkeymap,
.Hr param.html#rehkmap
rehearsalkeymap,
.Hr param.html#textkmap
textkeymap,
.Hr param.html#withkmap
withkeymap
.Ix jL
.eP
.\"-------------------------
.bP
.Na
.Hm leftmar
leftmargin
.De
This parameter
sets the amount of white space margin to put at the left side of each page.
It is specified in inches if the
.Hr param.html#units
units parameter
is set to inches, or in centimeters if the units parameter is set to cm.
This parameter can only be specified before any music or block input.
Margins are unaffected by
.Hr param.html#scale
the "scale" parameter.
You can use the
.Hr param.html#flipmarg
flipmargins parameter
to adjust alternating pages to allow room for book binding.
.Va
0.0 to pagewidth minus 0.5 inches
.Df
0.5 inches
.Cn
score
.Oo
.eX
leftmargin = 0.3
.Sa
.Hr param.html#botmar
bottommargin,
.Hr param.html#flipmarg
flipmargins,
.Hr param.html#rightmar
rightmargin,
.Hr param.html#topmar
topmargin,
.Hr param.html#pgwidth
pagewidth,
.Hr param.html#units
units
.Ix cW
.Ix gQ
.Ix gS
.eP
.bP
.Na
.Hm leftspc
leftspace
.De
This parameter
specifies what portion of the white space around a chord is placed
on its left side. Usually
(unless packexp is zero), longer notes will have more white space around
them than shorter notes, which means that the white space to their left
is also larger. The parameter allows you to control how pronounced that
effect is, or even specify to put all the space on the right. Two numbers
must be specified, separated by a comma.
They may include decimal fraction parts. The first specifies what
portion of the white space should go on the left. The second specifies
a maximum amount of white space, in stepsizes. So if the amount calculated
by the first number is greater than the second number, the second number
will be used.
.Va
first number 0.0 to 0.5 and second number 0.0 to 100.0
.Df
0.15, 5.0
.Cn
score
.Nm
.eX
leftspace = 0.2, 4
.Sa
.Hr param.html#lyralign
lyricsalign,
.Hr param.html#packexp
packexp,
.Hr param.html#packfact
packfact
.eP
.\"------------------
.bP
.Na
.Hm lyralign
lyricsalign
.De
This parameter
specifies how to align lyric syllables with chords. Its value is the
proportion of each syllable to place to the left of the syllable's chord.
Thus, for example, a value of 0.0 causes
the left edge of syllables to be aligned with
the chords, whereas a value of 0.5 causes syllables to be centered with
the chord, and 1.0 causes the right edge of the syllables to be aligned
with the chord.
.Va
0.0 to 1.0
.Df
0.25
.Cn
score, staff
.Nm
.eX
lyricsalign = 0.1
.Sa
.Hr param.html#sylpos
sylposition
.Ix hT
.eP
.\"--------------------
.bP
.Na
.Hm lyrdist
lyricsdist
.De
This parameter sets the minimum distance from staffs to place lyrics. When
lyrics are printed, they will be placed
no closer to the staff than the value of this parameter.
This only affects lyrics above and below, not between.
.Va
a number between 0.0 and 50.0 inclusive, given in stepsizes.
.Df
2.0
.Cn
score, staff
.Ns
.eX
lyricsdist = 4
.Sa
.Hr param.html#chdist
chorddist,
.Hr param.html#dyndist
dyndist,
.Hr param.html#dist
dist,
.Hr param.html#scorepad
scorepad,
.Hr param.html#scoresep
scoresep
.eP
.\"------------------
.bP
.Na
.Hm lyrfont
lyricsfont
.De
This parameter
sets which font to use for
.Hr lyrics.html
lyrics.
.Va
rom, ital, bold, boldital
.Df
rom
.Cn
score, staff
.Im
.eX
lyricsfont = ital
.Sa
.Hr param.html#font
font,
.Hr param.html#lyrsize
lyricssize
.Ix aE
.Ix bG
.Ix gH
.Ix gJ
.Ix gK
.eP
.\"---------------------
.bP
.Na
.Hm lyrfam
lyricsfontfamily
.De
This parameter
specifies what font family to use for
.Hr lyrics.html
lyrics.
.Va
avantgarde, bookman, courier, helvetica, newcentury, palatino, times
.Df
times
.Cn
score, staff
.Im
.eX
lyricsfontfamily=helvetica
.Sa
.Hr param.html#font
font,
.Hr param.html#fontfam
fontfamily,
.Hr param.html#lyrfont
lyricsfont
.eP
.bP
.Na
.Hm lyrkmap
lyricskeymap
.De
This parameter
specifies which keymap to use for lyrics.
See the
.Hr textstr.html#keymaps
section on keymaps
in the
.Hr textstr.html
Text Strings chapter
for more details.
.Va
a string matching the name of a keymap defined earlier, or nothing.
An empty string ("") means don't do any mapping.
Setting to nothing unsets any previous value, which effectively causes the
.Hr param.html#defkmap
defaultkeymap
value to be used.
.Df
nothing
.Cn
score, staff
.Nm
.eS
lyricskeymap="Cyrillic"
.br
lyricskeymap=
.Sa
.Hr param.html#defkmap
defaultkeymap,
.Hr param.html#endkmap
endingkeymap,
.Hr param.html#labkmap
labelkeymap,
.Hr param.html#prntkmap
printkeymap,
.Hr param.html#rehkmap
rehearsalkeymap,
.Hr param.html#textkmap
textkeymap,
.Hr param.html#withkmap
withkeymap
.Ix jL
.eP
.\"---------------------
.bP
.Na
.Hm lyrsize
lyricssize
.De
This parameter
sets point size to use for
.Hr lyrics.html
lyrics.
.Va
a number from 1 to 100
.Df
12
.Cn
score, staff
.Nm
.eX
lyricssize = 10
.Sa
.Hr param.html#lyrfont
lyricsfont,
.Hr param.html#lyrfam
lyricsfontfamily,
.Hr param.html#size
size
.Ix bH
.eP
.\"---------------------
.bP
.Na
.Hm maxmeas
maxmeasures
.De
This parameter
specifies the maximum number of measures to put on any score.
.Va
a number from 1 to 1000
.Df
1000
.Cn
score
.Ns
.eX
maxmeasures = 3
.Sa
.Hr param.html#leftmar
leftmargin,
.Hr param.html#maxscore
maxscores,
.Hr param.html#packexp
packexp,
.Hr param.html#packfact
packfact,
.Hr param.html#rightmar
rightmargin,
.Hr param.html#scale
scale,
.Hr param.html#stscale
staffscale
.eP
.\"---------------------
.bP
.Na
.Hm maxscore
maxscores
.De
This parameter
specifies the maximum number of scores to print per page.
.Va
1 to 1000
.Df
1000
.Cn
score
.Nm
.eX
maxscores=2
.Sa
.Hr param.html#scorepad
scorepad,
.Hr param.html#scoresep
scoresep
.eP
.\"---------------
.bP
.Na
.Hm measnum
measnum
.De
This parameter
specifies whether or not to print measure numbers.
If set to "y,"
the current measure number will be printed at the beginning of each score
other than the first. The number will be printed above any scores that
would receive ending marks
.Hr param.html#endingst
(see "endingstyle" parameter).
If set to "n," no measure numbers will be printed.
If set to "every \fIN\fP," measure numbers will be printed
on every Nth bar line
unless some other
.Hr bars.html#reh
rehearsal mark
has been specified on that bar.
.Va
y, n, or every N, where N can be from 1 to 10000
.Df
n
.Cn
score
.Te
at next music context if "every N," else start of next score
.eS
measnum = y
.br
measnum = every 1 // number all measures
.br
measnum = every 5
.Sa
.Hr param.html#endingst
endingstyle,
.Hr param.html#mnumfont
measnumfont,
.Hr param.html#mnumfam
measnumfontfamily,
.Hr param.html#mnumsize
measnumsize,
.Hr param.html#mnumstyl
measnumstyle,
.Hr param.html#rehstyle
rehstyle
.Ix aQ
.Ix dG
.Ix dY
.Ix hG
.Ix hJ
.eP
.\"---------------
.bP
.Na
.Hm mnumfont
measnumfont
.De
This parameter specifies which font type to use for the automatic measure numbers,
if they are turned on via the
.Hr param.html#measnum
measnum parameter.
.Va
rom, ital, bold, or boldital
.Df
rom
.Cn
score
.Mn
.eX
measnumfont=boldital
.Sa
.Hr param.html#measnum
measnum,
.Hr param.html#mnumfam
measnumfontfamily,
.Hr param.html#mnumsize
measnumsize,
.Hr param.html#mnumstyl
measnumstyle
.eP
.\"---------------
.bP
.Na
.Hm mnumfam
measnumfontfamily
.De
This parameter specifies which font family to use for the automatic measure numbers,
if they are turned on via the
.Hr param.html#measnum
measnum parameter.
.Va
avantegarde, bookman, courier, helvetica, newcentry, palatino, or times
.Df
times
.Cn
score
.Mn
.eX
measnumfontfamily=helvetica
.Sa
.Hr param.html#measnum
measnum,
.Hr param.html#mnumfont
measnumfont,
.Hr param.html#mnumsize
measnumsize,
.Hr param.html#mnumstyl
measnumstyle
.eP
.\"---------------
.bP
.Na
.Hm mnumsize
measnumsize
.De
This parameter specifies what size to use for the automatic measure numbers,
in points, if they are turned on via the
.Hr param.html#measnum
measnum parameter.
.Va
1 to 100
.Df
11
.Cn
score
.Mn
.eX
measnumsize=15
.Sa
.Hr param.html#measnum
measnum,
.Hr param.html#mnumfont
measnumfont,
.Hr param.html#mnumfam
measnumfontfamily,
.Hr param.html#mnumstyl
measnumstyle
.eP
.\"---------------
.bP
.Na
.Hm mnumstyl
measnumstyle
.De
This parameter specifies whether to put automatic measure numbers inside boxes
or circles, or leave them plain.
.Va
plain, boxed, or circled
.Df
plain
.Cn
score
.Mn
.eX
measnumstyle=boxed
.Sa
.Hr param.html#measnum
measnum,
.Hr param.html#mnumfont
measnumfont,
.Hr param.html#mnumfam
measnumfontfamily,
.Hr param.html#mnumsize
measnumsize,
.Hr param.html#rehstyle
rehstyle
.eP
.\"---------------
.bP
.Na
.Hm midline
midlinestemfloat
.De
This parameter controls the stem direction of chords whose notes are centered
on the middle line of the staff, for cases where it is free to point in
either direction. It is not free (and thus midlinestemfloat does not apply) when
the direction is forced by the user, or by the vscheme, or another voice,
or for chords that are part of a beamed set of chords, or for grace notes
or for voice 3. When midlinestemfloat applies, if it is set to n, the stem
will always be down. When set to y, the stem will be up in the case where
the neighboring chords on either side, if any, have stems up.
.Va
y or n
.Df
n
.Cn
score, staff, voice
.Im
.eX
midlinestemfloat=y
.eP
.\"---------------
.bP
.Na
.Hm minalign
minalignscale
.De
This parameter specifies how much aligned strings can be compressed, in an effort to
prevent them from running in the next item at the same alignment level.
Only aligned things are ever compressed, and then only if they would collide
with the the next item at the same level, and only as much as needed to
make them fit, up the the limit of this parameter.
Multiplying this value by the normal width of an item will tell the
shortest width Mup will compress to before giving up and printing a warning.
A value of 1.0 means nothing will ever be compressed at all.
.Va
0.1 to 1.0
.Df
0.667
.Cn
score, staff
.Ns
.eX
minalignscale = 0.85
.eP
.\"---------------
.bP
.Na
.Hm mingrid
mingridheight
.De
This parameter specifies the minimum number of frets to print on grids. Grids will
be made taller than this when necessary, but will never be shorter than this.
.Va
A number from 2 to 99
.Df
4
.Cn
score, staff
.Nm
.eX
mingridheight=6
.Sa
.Hr param.html#gridfret
gridfret,
.Hr param.html#gridend
gridsatend,
.Hr param.html#gridscl
gridscale,
.Hr param.html#gridused
gridswhereused
.eP
.\"---------------
.bP
.Na
.Hm notehead
noteheads
.De
This parameter describes which notehead shape(s)
to use for each pitch in the scale.
If you want to use the same shape for all pitches,
as is the case with standard notation, the value is a string
containing a single shape name (e.g., "norm" for standard notation).
If you want to use different shapes for different pitches,
the noteheads parameter value is a string containing a list of 7 shape names.
They are listed in order starting from the "tonic"
of the major key as indicated by the number of sharps or flats in the
.Hr param.html#key
key signature.
There are pre-defined head shapes:
norm, x, allx, diam, blank, righttri, isostri, rect, pie, semicirc, slash,
and allslash.
Additional head shapes can be defined in the
.Hr shaped.html#hdshape
headshapes context.
See the examples below for the most common settings for
this parameter. Head shape can be
.Hr shaped.html#chord
overridden on an individual chord
by using [hs "shapename"]
before the chord. It can also be
.Hr shaped.html#note
overridden on an individual note
by putting hs "shapename" after the note.
.Va
a string containing either 1 or 7 head shape names
.Df
\&"norm"
.Cn
score, staff, voice
.Nm
.eS
// This is the setting for the most common shaped note system using 4 shapes.
.br
noteheads = "righttri norm rect righttri norm rect diam"
.br
// This is the setting for a shaped notes system that uses 7 different shapes.
.br
noteheads = "isostri semicirc diam righttri norm rect pie"
.Ix jG
.eP
.\"---------------
.bP
.Na
.Hm inputdir
noteinputdir
.De
If set to "any," then when there are multiple notes in a chord, the notes
can be entered in any order, but any notes not in the
.Hr param.html#defoct
default octave
must have their octave specified, either by octave number, or the appropriate
number of plus or minus signs, based on their distance from the default octave.
When set to "up," notes in a chord must be entered in pitch order from
bottom up. When set to "down," they must be entered in pitch order from
top down. When in up or down mode, the first note's octave is specified as
with any, but subsequent notes in the chord are relative to the previous
note. Note letters less than or equal to an octave away
from their preceding note's letter have
no octave specified. For notes an octave or more away, in up mode,
only plus signs can be used, and in down mode, only
minus signs can be used, to specify how many octaves away they are.
For example, for up mode, default octave of 4, and input of gbe,
the b will be in octave 4, but the e will be in octave
5, because that is the next e that is upward from b4.
In down mode with default octave of 4, and the same input of gbe,
the b and e would both be in octave 3.
This parameter is ignored on tablature staff input and when using
chord-at-a-time input mode.
.Va
up, down, or any
.Df
any
.Cn
score, staff, voice
.Nm
.eX
noteinputdir=up
.eP
.\"---------------
.bP
.Na
.Hm nummrpt
numbermrpt
.De
If set to "y"
.Hr chordinp.html#measdur
measure repeats
are numbered; if set to "n" they aren't.
.Va
y or n
.Df
y
.Cn
score, staff
.Nm
.eX
numbermrpt = n
.eP
.\"---------------
.bP
.Na
.Hm nummultrpt
numbermultrpt
.De
If set to "y"
.Hr chordinp.html#multrpt
dbl and quad measure repeats
are numbered with "2" or "4" respectively,
printed above the middle bar line of the group;
if set to "n" they aren't.
The number will be printed in the same font as a time signature.
.Va
y or n
.Df
y
.Cn
score, staff
.Nm
.eX
numbermulrpt = n
.eP
.\"-------------------
.bP
.Na
.Hm ontheline
ontheline
.De
This parameter
specifies whether notes for voices 1 and 2
on a 1-line staff are to be placed on the line.
If this is set to n, notes with stem up will be placed above the line
and notes with stem down will be placed below the line; otherwise both
will be placed on the line. For notes that don't have a stem, the rules
are applied using the direction the stem would be if there were a stem.
This parameter has no effect on
.Hr param.html#stlines
5-line staffs
or
.Hr tabstaff.html
tablature staffs.
Notes for voice 3 are always placed on the line on 1-line staffs,
regardless of the value of this parameter.
.Va
y or n
.Df
y
.Cn
score, staff, voice
.Nm
.eX
ontheline=n
.Sa
.Hr param.html#stlines
stafflines
.eP
.\"-------------------
.bP
.Na
.Hm packexp
packexp
.De
This parameter
sets note expansion factor. This factor controls spacing of notes relative
to their time values. If set to 1.0, Mup will try to give a half note twice
as much space as a quarter note, a whole note twice as much as a half note,
etc. If set to 0.0, a chord's time value will have no impact on its placement.
Intermediate values will cause relative spacing
between the two extremes. Note that individual chords may get more space
than they would theoretically "deserve" if they happen to need extra space
to accommodate accidentals, dots, etc.
.Va
a number from 0.0 to 1.0 inclusive
.Df
0.8
.Cn
score
.Nm
.eX
packexp = 0.95
.Sa
.Hr param.html#packfact
packfact,
.Hr param.html#pad
pad
.Ix dU
.Ix gT
.Ix gW
.Ix gX
.Ix gZ
.Ix hL
.eP
.\"-----------------
.bP
.Na
.Hm packfact
packfact
.De
This parameter
specifies how tightly to pack notes together on output. The smaller
the value, the more tightly notes are packed together.
.Va
a number from 0.0 to 10.0
.Df
1.0
.Cn
score
.Ns
.eX
packfact = 1.4
.Sa
.Hr param.html#packexp
packexp,
.Hr param.html#pad
pad
.Ix dT
.eP
.\"-------------------------
.bP
.Na
.Hm pad
pad
.De
This parameter
specifies the amount of padding to be added to notes.
This can be used to control how tightly things are packed together.
Especially if
.Hr param.html#packexp
packexp
and
.Hr param.html#packfact
packfact
are very small, notes can get placed very close together.
This parameter can be used to always force a minimum amount of space
between horizontally adjacent note groups.
A value of zero means notes will be allowed to just touch.
More positive values cause more space around notes.
A negative value will let things
actually overlap, so most people will probably never want to use a
negative value, but the option is there if you want to do something unusual.
This parameter works somewhat like
.Hr chrdattr.html#pad
the "pad" value that can be specified for individual note groups,
except that it applies to all groups.
.Va
a number of stepsizes, -5.0 to 50.0
.Df
0.3333
.Cn
score, staff, voice
.Nm
.eX
pad = 1.76
.Sa
.Hr param.html#packexp
packexp,
.Hr param.html#packfact
packfact
.eP
.\"-------------------------
.bP
.Na
.Hm pgheight
pageheight
.De
This parameter sets the page height. If the
.Hr param.html#units
units parameter
is inches, the value of pageheight is given in inches,
or if the units parameter is cm, it is given in centimeters.
This parameter can only be specified before any music or block input.
If the
.Hr param.html#pgwidth
pagewidth
and pageheight parameters are set to values that match
a standard paper size in landscape mode, the Mup output will be rotated
to print properly in landscape mode.
If pageheight and pagesize are both set in the same context,
whichever is specified last will override the previous.
.Va
2.0 to 24.0 inches or 5.0 to 61.0 cm
.Df
11.0 inches
.Cn
score
.Oo
.eX
pageheight = 9
.Sa
.Hr param.html#pgwidth
pagewidth,
.Hr param.html#botmar
bottommargin
.Hr param.html#topmar
topmargin,
.Hr param.html#units
units
.Ix hP
.eP
.\"-------------------------
.bP
.Na
.Hm pgsize
pagesize
.De
This parameter sets the page size. This is just an alternate way of specifying
.Hr param.html#pgheight
pageheight
and
.Hr param.html#pgwidth
pagewidth
using the common names for paper sizes rather than specifying in
.Hr param.html#units
inches or cm.
An orientation (portrait or landscape) can also be specified;
the default is portrait.
This parameter can only be specified before any music or block input.
If pageheight and/or pagewidth are set in the same context as pagesize,
whichever is specified last will override the previous.
.Va
letter, legal, flsa, halfletter, a4, a5, a6; optionally followed by
portrait or landscape.
.Df
letter
.Cn
score
.Oo
.eS
pagesize = a4
.br
pagesize = legal landscape
.Sa
.Hr param.html#pgheight
pageheight,
.Hr param.html#pgwidth
pagewidth,
.Hr param.html#panels
panelsperpage
.eP
.\"-------------------------
.bP
.Na
.Hm pgwidth
pagewidth
.De
This parameter sets the page width. If the
.Hr param.html#units
units parameter
is inches, the value of pagewidth is given in inches,
or if the units parameter is cm, it is given in centimeters.
This parameter can only be specified before any music or block input.
If the pagewidth and
.Hr param.html#pgheight
pageheight
parameters are set to values that match
a standard paper size in landscape mode, the Mup output will be rotated
to print properly in landscape mode.
If pagewidth and pagesize are both set in the same context,
whichever is specified last will override the previous.
.Va
2.0 to 24.0 inches or 5.0 to 61.0 cm
.Df
8.5 inches
.Cn
score
.Oo
.eX
pagewidth = 6.5
.Sa
.Hr param.html#pgheight
pageheight,
.Hr param.html#flipmarg
flipmargins,
.Hr param.html#leftmar
leftmargin,
.Hr param.html#rightmar
rightmargin,
.Hr param.html#units
units
.Ix hQ
.eP
.\"-------------------------
.bP
.Na
.Hm panels
panelsperpage
.De
This parameter specifies how many pages of music to print on each physical page.
This parameter can only be specified before any music or block input.
Note that the
.Hr param.html#pgheight
pageheight
and
.Hr param.html#pgwidth
pagewidth
parameters still apply to the physical paper size viewed in portrait mode,
even when the panelsperpage value causes the printing to be landscape mode,
so you should continue to leave those set as you normally would.
The
.Hr cmdargs.html#ooption
-o command line option
may be useful for getting pages printed in desired order.
For example, to make a 4-page booklet from a single sheet of paper
folded in half, you can use panelsperpage=2, then use -o4,1 to print one side
of the paper, and -o2,3 to print the other side.
When panelsperpage is 2, the first page side is always left.
.Va
1 or 2
.Df
1
.Cn
score
.Oo
.eX
panelsperpage=2
.Sa
.Hr param.html#firstpg
firstpage,
.Hr param.html#pgheight
pageheight,
.Hr param.html#pgwidth
pagewidth
.eP
.\"-------------------------
.bP
.Na
.Hm pedstyle
pedstyle
.De
This parameter specifies whether to display
.Hr pedal.html
piano pedal marks
with lines or with the word "Ped" and "*".
With the "pedstar" style, a "bounce" of the pedal is shown by a "* Ped,"
whereas with the "alt pedstar" style, only a "Ped" is printed.
.Va
line, pedstar, or alt pedstar
.Df
line
.Cn
score, staff
.Nm
.eX
pedstyle = pedstar
.Ix dS
.Ix fL
.eP
\"----------------------------------
.bP
.Na
.Hm printedtime
printedtime
.De
This parameter defines what to print as a key signature,
if you want that to be something other than the actual time signature.
.Va
There are three possible formats for the value. The first is just like for
the "time" parameter, except that alternating time is not allowed.
An example usage might be if most staffs are in 3/4
time, but one is really in 6/8, so you could set that staff's printedtime
parameter to 6/8. Another example would be to set the actual time signature
to 7/4, but set individual staffs to 3/4+4/4 or 4/4+3/4 as appropriate.
The second format is a single string. One usage might be to set it to "3"
and assume the reader can deduce what the time unit is. The third format is
two strings, which will be centered one on top of the other. A possible usage
would be to put a "3" for the numerator, and an actual note symbol
for the "denominator." It is also possible to set to nothing, to revert
to using the actual time signature.
Default size and font are set to match what normal time signatures would be;
you can change those inside the string(s) if you wish.
.Df
nothing
.Cn
score, staff
.Nm
.eS
printedtime = 3/4
.br
printedtime = 3/4+4/4
.br
printedtime = "3"
.br
printedtime = "4" "\e(dn4n)"
.br
printedtime = // revert to actual time signature
.Sa
.Hr param.html#time
time
.eP
.\"-------------------------
.bP
.Na
.Hm prntkmap
printkeymap
.De
This parameter
specifies which keymap to use for
.Hr prnttext.html
print, left, right, center, and title commands.
See the
.Hr textstr.html#keymaps
section on keymaps
in the
.Hr textstr.html
Text Strings chapter
for more details.
.Va
a string matching the name of a keymap defined earlier, or nothing.
An empty string ("") means don't do any mapping.
Setting to nothing unsets any previous value, which effectively causes the
.Hr param.html#defkmap
defaultkeymap
value to be used.
.Df
nothing
.Cn
score, block
.Im
.eS
printkeymap="Cyrillic"
.br
printkeymap=
.Sa
.Hr param.html#defkmap
defaultkeymap,
.Hr param.html#endkmap
endingkeymap,
.Hr param.html#labkmap
labelkeymap,
.Hr param.html#lyrkmap
lyricskeymap,
.Hr param.html#rehkmap
rehearsalkeymap,
.Hr param.html#textkmap
textkeymap,
.Hr param.html#withkmap
withkeymap
.Ix jL
.eP
.\"---------------
.bP
.Na
.Hm prmultn
printmultnum
.De
If set to "y,"
.Hr multirst.html
multirests
are labeled with the number of measures of rest they represent;
if set to "n," they aren't.
This would allow you to print some other commentary in place of the
number, print it in a different style, etc.
.Va
y or n
.Df
y
.Cn
score, staff
.Nm
.eX
printmultnum = n
.eP
.bP
.Na
.Hm rehkmap
rehearsalkeymap
.De
This parameter
specifies which keymap to use for rehearsal mark strings. This does not
apply to lettered or numbered rehersal marks.
See the
.Hr textstr.html#keymaps
section on keymaps
in the
.Hr textstr.html
Text Strings chapter
for more details.
.Va
a string matching the name of a keymap defined earlier, or nothing.
An empty string ("") means don't do any mapping.
Setting to nothing unsets any previous value, which effectively causes the
.Hr param.html#defkmap
defaultkeymap
value to be used.
.Df
nothing
.Cn
score, staff
.Nm
.eS
rehearsalkeymap="Cyrillic"
.br
rehearsalkeymap=
.Sa
.Hr param.html#defkmap
defaultkeymap,
.Hr param.html#endkmap
endingkeymap,
.Hr param.html#labkmap
labelkeymap,
.Hr param.html#lyrkmap
lyricskeymap,
.Hr param.html#prntkmap
printkeymap,
.Hr param.html#textkmap
textkeymap,
.Hr param.html#withkmap
withkeymap
.Ix jL
.eP
.\"-------------------------
.bP
.Na
.Hm rehstyle
rehstyle
.De
This parameter specifies whether to enclose
.Hr bars.html#reh
rehearsal marks
inside box, inside a circle, or just as plain text.
.Va
boxed, circled, or plain
.Df
boxed
.Cn
score, staff
.Nm
.eX
rehstyle = circled
.Sa
.Hr param.html#endingst
endingstyle
.Ix aQ
.eP
.\"-------------------------
.bP
.Na
.Hm release
release
.De
This parameter specifies how soon (in milliseconds) before the full time value of note
to release the note when generating
.Hr midi.html
MIDI output.
This controls how legato (smooth) the music is.
A value of 0 will make it very legato. The larger the value, the
more detached notes will be. This parameter specifies a
maximum amount to shorten notes; a note will never be shortened
to less than 75% of its full value, unless it has a dot or wedge on it,
it which case the shortening can be a maximum of half or 2/3 respectively.
The release value can be changed in
.Hr midmeas.html
the middle of a measure,
using a construct like <<score release=50>> before a note group.
.Va
0 to 500
.Df
20
.Cn
score, staff, voice
.Ni
.mM
.eX
release = 40
.eP
.\"-------------------------
.bP
.Na
.Hm rptdots
repeatdots
.De
If set to "standard," repeat signs are printed using the standard convention
of two dots. If set to "all," repeat signs are printed with dots between all
the lines of the staff.
.Va
standard or all
.Df
standard
.Cn
score, staff
.Nm
.eX
repeatdots = all
.Sa
.Hr param.html#brktrpts
bracketrepeats
.eP
.\"-------------------------
.bP
.Na
.Hm restcomb
restcombine
.De
If the given number of measures of rest occur in a row,
they will be replaced by a
.Hr multirst.html
multirest.
This parameter can be overridden by the
-c command line option.
See the
.Hr cmdargs.html#coption
description of the -c option
for more complete information on how the combining is done.
.Va
2 to 1000 or nothing
.Df
not set
.Cn
score
.Te
whatever the value is at the end of a series of rest measures is what is used
.eS
restcombine = 5
.br
restcombine = // turn off combining
.eP
.\"---------------
.bP
.Na
.Hm restsymm
restsymmult
.De
This parameter specifies how to print multirests.
Multirests are normally drawn as a horizontal line on the middle line
of the staff, with two vertical lines at the end. But there is an
alternate notation style that uses rest symbols (whole, double whole,
and quad whole) when the number of measures is short.
If this parameter is set to "y," that alternate style will be used for
multirests of eight measures or less.
.Va
y or n
.Df
n
.Cn
score, staff
.Te
at next multirest. When used with restcombine, if you set this after the
first rest measure, it has no effect
.eX
restsymmult = y
.Sa
.Hr param.html#prmultn
printmultnum
.eP
.\"-------------------------
.bP
.Na
.Hm rightmar
rightmargin
.De
This parameter
sets the amount of white space margin to put at the right side of each page.
It is specified in inches if the
.Hr param.html#units
units parameter
is set to inches, or in centimeters if the units parameter is set to cm.
This parameter can only be specified before any music or block input.
Margins are unaffected by
.Hr param.html#scale
the "scale" parameter.
You can use the
.Hr param.html#flipmarg
flipmargins parameter
to adjust alternating pages to allow room for book binding.
.Va
0.0 to pagewidth minus 0.5 inches
.Df
0.5 inches
.Cn
score
.Oo
.eX
rightmargin = 0.3
.Sa
.Hr param.html#botmar
bottommargin,
.Hr param.html#flipmarg
flipmargins,
.Hr param.html#leftmar
leftmargin,
.Hr param.html#topmar
topmargin,
.Hr param.html#pgwidth
pagewidth,
.Hr param.html#units
units
.Ix fY
.Ix gR
.Ix gS
.eP
.\"-----------------
.bP
.Na
.Hm scale
scale
.De
This parameter specifies by what factor to scale the printed output. For example,
scale=2 prints everything twice as large as normal, while scale=0.5
prints everything at half size.
This parameter can only be specified before any music or block input.
.Va
a number between 0.1 and 10.0
.Df
1.0
.Cn
score
.Oo
.eX
scale=0.95
.Sa
.Hr param.html#packfact
packfact,
.Hr param.html#packexp
packexp,
.Hr param.html#stscale
staffscale
.Ix fV
.eP
.\"-----------------
.bP
.Na
.Hm scorepad
scorepad
.De
This parameter
sets the amount of padding (white space) to leave between scores,
accounting for all the things that protrude from both scores.
Either a single number, giving a minimum
amount, or two numbers, giving a minimum and maximum,
can be specified. They are specified in stepsizes.
If only the minimum is specified, and it is larger than the default
maximum of 2.0, the maximum will be adjusted to equal the minimum.
Depending on the setting of the
.Hr param.html#scoresep
scoresep parameter,
the maximum may be exceeded; see the description of
scoresep for how these parameters interact to determine the placement
of the scores.
If a negative value is specified for scorepad, some overlap may occur
(subject to the interaction with scoresep).
Specifying a negative value may be particularly useful when things
protrude downward from the top score and upward from the bottom score,
but at different places horizontally, such that it is actually safe
to put the scores closer together without collision, even though Mup
can't tell that it is safe.
Note, however, that this overrides Mup's protection against real
collisions, so this must be used with care to avoid undesired overlaps.
.Va
one or two numbers, in the range from
negative the height of the page and the height of a page, in stepsizes.
If there are two numbers, they are separated by a comma, and the second
must be greater than or equal to the first.
This parameter also applies to
.Hr prnttext.html#block
blocks,
but is simpler in that case,
since nothing can actually protrude from a block.
.Df
2.0, 2.0
.Cn
score
.Bw
.eS
scorepad = 5
.br
scorepad = -1
.br
scorepad = 3.5,10.75
.Sa
.Hr param.html#scoresep
scoresep,
.Hr param.html#staffpad
staffpad,
.Hr param.html#staffsep
staffsep
.Ix dQ
.Ix fO
.Ix gZ
.Ix hJ
.eP
.\"------------------
.bP
.Na
.Hm scoresep
scoresep
.De
This parameter
sets how much space to leave between scores;
i.e., between the bottom line of the
bottom staff of one score and the top line of the top staff of the
following score. Either a single number, giving a minimum
amount, or two numbers, giving a minimum and maximum,
can be specified. They are specified in stepsizes.
If only the minimum is specified, and it is larger than the default
maximum of 20.0, the maximum will be adjusted to equal the minimum.
Depending on the setting of the
.Hr param.html#scorepad
scorepad parameter,
the maximum may be exceeded.
The parameters interact as follows in determining the layout of a page:
As many scores are allocated to the page as will fit (or until
.Hr newscore.html
a "newpage" command
is encountered). Initially, they are packed together
as tightly as they can be without violating
the minimum values of scorepad and scoresep between any neighboring scores.
Next, if there is extra space available at the bottom of the page,
the scores are spread out, increasing the white space between them, but
not increasing any beyond the maximum scorepad value.
(Some may, however, already be beyond the maximum scorepad value, because
the minimum scoresep value required it.)
This spreading is done without regard for the maximum scoresep value.
If any of the inter-score gaps start narrower than others
(because of the minimum scoresep), they are increased first, in an
attempt to even out the differences.
If the maximum scorepad value is reached or exceeded between all the scores,
and there is still extra space available at the bottom of the page,
then the scores are spread out some more, increasing the white space between
them, this time ignoring the scorepad values, but not increasing any
beyond the maximum scoresep value.
(Some may however already be beyond the maximum scoresep value, because
of the previous steps.)
If still not all the space is used up, it remains as extra space at the
bottom of the page.
This parameter also applies to
.Hr prnttext.html#block
blocks,
but is simpler in that case,
since nothing can actually protrude from a block.
.Va
one or two numbers, in the range from 6.0
to the height of the page in stepsizes.
If there are two numbers, they are separated by a comma, and the second
must be greater than or equal to the first.
.Df
12.0, 20.0
.Cn
score
.Bw
.eS
scoresep = 25
.br
scoresep = 9.6, 15.3
.Sa
.Hr param.html#scorepad
scorepad,
.Hr param.html#staffpad
staffpad,
.Hr param.html#staffsep
staffsep
.Ix dR
.Ix fO
.Ix gM
.Ix gN
.eP
.\"----------------
.bP
.Na
.Hm size
size
.De
This parameter
specifies what point size to use for text in
.Hr prnttext.html
print, title, left, right, and center statements.
It also provides the default for rom, bold, ital, and boldital statements.
.Va
a number from 1 to 100 inclusive
.Df
12
.Cn
score, staff, header, footer, header2, footer2, top, bottom, top2, bottom2, block
.Im
.eX
size = 9
.Sa
.Hr param.html#font
font,
.Hr param.html#fontfam
fontfamily,
.Hr param.html#lyrsize
lyricssize,
.Hr param.html#withsize
withsize
.Ix aS
.Ix aT
.Ix bH
.Ix gW
.Ix hA
.Ix hB
.eP
.\"------------------------
.bP
.Na
.Hm slashbet
slashesbetween
.De
This parameter
specifies whether to put two thick slanted lines between scores at the
left edge of the staffs. These are often used when there are a lot of staffs,
or when the number of scores per page varies, to help the musicians see clearly
where the next score begins.
.Va
y or n
.Df
n
.Cn
score
.Bw
.eX
slashesbetween=y
.eP
.\"------------------------
.bP
.Na
.Hm stlines
stafflines
.De
This parameter
specifies how many lines to draw for the staff. Normally, there are 5 lines
per staff, but a single-line staff is sometimes used for percussion,
and tablature staffs for various instruments
may have different numbers of lines.
Setting this parameter to 1 will produce a single line staff.
The number of lines can be followed by "n" to indicate that
.Hr param.html#clef
clef
and
.Hr param.html#key
key signature
are not to be printed. The "n" also implies that accidentals are to
be ignored and that notes are never to be transposed.
If the number of lines is 1, the clef and
key signature are never printed,
regardless of whether you add the "n," so the "n" is really only
meaningful when used with 5. When stafflines=1, you can only have one note
per chord, and the pitch of that note is irrelevant, except for
.Hr midi.html
MIDI output.
.Ix iE
Alternately, rather than specifying "n," you can specify "drum," which
means to use the drum clef (also sometimes called the "neutral" clef).
With the drum clef, no key signature is printed, accidentals are
ignored, and notes are never transposed. The value used for the
.Hr param.html#clef
clef parameter
is used to determine the pitch for placement of notes in this case,
but the drum clef of two vertical lines is printed.
.sp
For a tablature staff, rather than specifying a number of staff lines as the
value, the keyword "tab" is used, optionally followed by a list of strings
in parentheses. The strings are listed in order from the top line of the
tablature staff to the bottom.
.Ix hU
Each item in the list has at least a string pitch, which is
a letter from a to g, optionally followed by # or &. If there is more than
one string having the same letter/accidental, they are distinguished by
adding one or more single quote marks ("ticks"). An octave number can also
be specified.
If the list of strings is omitted, standard guitar strings are used,
which is tab( e5 b4 g4 d4 a3 e'3 ).
Tablature can only be specified in staff context, not score or voice, and
when a tablature staff is specified, the staff above it becomes a "tabnote"
staff, which is a normal 5-line staff containing music derived from the
tablature staff.
The list of strings, if any, can optionally be followed by y or n. Using y
will cause the word TAB to be printed vertically at the beginning of every
score. Using n will cause that to never to be printed. Not specifying either
will cause it to be printed only on the very first staff, which is the most
common way of printing tablature.
.Va
1 or 5, optionally followed by "n" or "drum";
or for tablature staff, the keyword "tab" optionally followed by a
list of strings, in parentheses, optionally followed by y or n.
Setting the stafflines parameter will also reinitialize other parameters:
.Hr param.html#key
key,
.Hr param.html#xpose
transpose,
.Hr param.html#addxpose
addtranspose,
.Hr param.html#clef
clef,
.Hr param.html#beamstyl
beamstyle,
and
.Hr param.html#defoct
defoct.
.Df
5
.Cn
score, staff
.Te
immediately for purposes of checking for interactions with other parameters.
Forces new score if the number part of it changed.
In any case, the "n" part takes effect at the next score.
.eS
stafflines=1
.br
stafflines=5n
.br
stafflines = tab // standard guitar tablature staff
.br
stafflines = tab ( g3 d3 a2 e2 ) // standard bass guitar
.br
stafflines = tab (d# g b3 g'3)
.br
stafflines = tab y // print TAB "clef" on every score
.Sa
.Hr param.html#clef
clef,
.Hr param.html#key
key,
.Hr param.html#xpose
transpose,
.Hr param.html#addxpose
addtranspose
.Ix cG
.Ix gW
.Ix hA
.Ix aA
.Ix bL
.Ix bW
.Ix cG
.Ix fB
.Ix fI
.Ix fM
.Ix fX
.Ix gU
.eP
.\"-----------------
.bP
.Na
.Hm staffpad
staffpad
.De
This parameter
sets the minimum amount of space to leave between staffs,
accounting for all the things that protrude from both staffs.
If a negative value is specified, some overlap may occur, although
it will still be limited by the value of the
.Hr param.html#staffsep
staffsep parameter.
Specifying a negative value may be particularly useful when things
protrude downward from the top staff and upward from the bottom staff,
but at different places horizontally, such that it is actually safe
to put the staffs closer together without collision, even though Mup
can't tell that it is safe.
Note, however, that this overrides Mup's protection against real
collisions, so this must be used with care to avoid undesired overlaps.
If this parameter is set in staff context for staff N, it affects
the distance from staff N to staff N+1.
.Va
a number between negative the height of the page
and the height of a page, in stepsizes
.Df
0
.Cn
score, staff
.Ns
.eX
staffpad = -2
.br
staffpad = 1.6
.Sa
.Hr param.html#scorepad
scorepad,
.Hr param.html#scoresep
scoresep,
.Hr param.html#staffsep
staffsep
.Ix jA
.Ix fO
.Ix gZ
.Ix hK
.eP
.\"------------------------
.bP
.Na
.Hm staffs
staffs
.De
This parameter
specifies the number of staffs. It is possible that not all of these staffs
will be printed (see
.Hr param.html#visible
the "visible" parameter
below and
.Hr cmdargs.html#soption
the -s command line argument).
Changing the number
of staffs causes all parameters that had been
set in staff and voice context to be set back to their default values.
It is usually preferable to only set the staff parameter once at the beginning
of a song, and use
.Hr param.html#visible
the "visible" parameter
when you want to change which staffs are actually printed,
rather than changing the number of staffs.
.Va
a number between 1 and 40 inclusive.
.Df
1
.Cn
score
.Te
forces new score if it changed
.eX
staffs = 12
.Sa
.Hr param.html#visible
visible
.Ix gL
.Ix hK
.eP
.\"------------------------
.bP
.Na
.Hm stscale
staffscale
.De
This parameter specifies how to scale the size of a staff relative to the size of other
staffs. A value of 1.0 yields the normal size, whereas 0.5 yields a staff
that is half as high, and 2.0 one that is twice as high as normal,
and so forth. This might be used, for example, for a piece written for
two instruments, say piano and violin, where you want the piano part to
be written in normal size, but want to show the violin part in smaller
size, such that while the pianist will have the violin part available
for reference, it won't take up a lot of space.
Another possible use is to set staffscale in score context, to make
all staff-related things a different size, but leave other things, like
.Hr headfoot.html
headers and footers,
unaffected.
.Va
0.1 to 10.0
.Df
1.0
.Cn
score, staff
.Te
forces new score if it changed
.eX
staffscale=0.75
.Sa
.Hr param.html#scale
scale
.eP
.\"----------------------
.bP
.Na
.Hm staffsep
staffsep
.De
This parameter
specifies the minimum amount of space to leave between
any two adjacent staffs within the same score. It is specified in stepsizes,
and is measured from the bottom line of the staff above to the top line
of the staff below. Staffs will be spread
wider than this minimum if necessary to prevent things from colliding.
If this parameter is set in staff context for staff N, it affects
the distance from staff N to staff N+1.
.Va
a number from 6.0 to the height of the page in stepsizes
.Df
10
.Cn
score, staff
.Ns
.eX
staffsep = 14
.br
staffsep = 17.8
.Sa
.Hr param.html#scorepad
scorepad,
.Hr param.html#scoresep
scoresep,
.Hr param.html#staffpad
staffpad
.Ix fA
.Ix fO
.Ix gM
.Ix gN
.eP
.\"------------------------
.bP
.Na
.Hm stemlen
stemlen
.De
This parameter specifies how long stems should be, in stepsizes.
This is for normal-sized chords; grace or cue size chords
will gets stems that are 5/7 of this length.
This length can be overridden on specific chords, using
.Hr chrdattr.html#stemlen
the len attribute in brackets before the chord.
Stem lengths can also be affected by the
.Hr param.html#sshorten
stemshorten parameter.
.Va
0.0 to 100.0
.Df
7.0
.Cn
score, staff, voice
.Nm
.eX
stemlen = 0 // to make all notes stemless
.Sa
.Hr param.html#sshorten
stemshorten
.Ix iB
.eP
.\"------------------------
.bP
.Na
.Hm sshorten
stemshorten
.De
There are several circumstances in which Mup normally shortens stems
slightly in an attempt to improve appearance. This parameter will accept
one, two, or four values to control how stems are affected in those cases.
On beamed chords, Mup will sometimes shorten stems slightly.
This first value of this parameter lets you control
the maximum amount of shortening that will ever be done on beamed notes.
It is specified in stepsizes.
The remaining three (optional) values control how Mup shortens stems that
protrude from the staff. Most publishers of music shorten such stems somewhat,
but there is some inconsistency in exactly how much. The second value to
this parameter specifies the maximum amount to shorten any protruding stem,
in stepsizes. The third and fourth specify at what point
to begin shortening and at what point to reach the maximum shortening.
These are specified in number of stepsizes from the middle line of the staff.
Note that Mup will still lengthen stems from this value if necessary to
accommodate things like dots or flags.
By default, Mup will use full-length stems (normally 7.0 stepsizes)
for any stem-up note at or below the middle line of the staff,
and for any stem-down note at or above the middle line of the staff.
Beyond there, it will gradually shorten stems
until they get down to 5.0 stepsizes in length
(2.0 stepsizes worth of shortening) for notes 6 stepsizes or more
away from the middle line.
So using a treble clef staff as an example,
stem-up notes b or lower will normally get stems 7.0 stepsizes long (or even
longer if necessary), but the c right above there will be a little shorter,
and so on until the a on the first ledger line above the staff is
the maximum shortening of 2.0 stepsizes.
You can always override on individual chords using
.Hr chrdattr.html#stemlen
[len=N]
to force a particular length.
.Va
0.0 to 2.0 for maximum beam shortening, 0.0 to 7.0 for maximum shortening
of stems that protrude from the staff, and -4 to 50 for where to begin and end
shortening of protruding stems
.Df
1.0, 2.0, 1, 6
.Cn
score, staff, voice
.Nm
.eS
stemshorten = 0 // never shorten any beamed stems
.br
stemshorten = 0, 0 // never shorten any stems
.br
// For beams, allow shortening up to 1.5 stepsizes.
.br
// For protruding, start shortening 4 stepsizes from the
.br
// middle line (i.e., f+ assuming treble clef),
.br
// and reach maximum shortening of 3.5 stepsizes
.br
// at 12 stepsizes from the middle line (g++).
.br
stemshorten = 1.5, 3.5, 4, 12
.Sa
.Hr param.html#stemlen
stemlen
.eP
.\"------------------------
.bP
.Na
.Hm subbar
subbarstyle
.De
This parameter controls where subdivisions of bars, if any,
are drawn and how they look.
You might consider using this instead of or in connection with an additive
.Hr param.html#time
time signature.
.Va
Multiple specifications can be given. Each specification optionally begins with
a linestyle of "dashed" or "dotted." If neither is given, then
normal solid lines will be used. Next is the bartype, which may be
either "bar," for a single line, or "dblbar," for double lines.
Next comes the appearance, which is two values in parentheses, and separated
by the word "to." The first value in the pair tells where
to start drawing relative to the top staff in each range, and the second
tells where to stop drawing relative to the bottom staff in each range.
Each of the values is the word "top"
(meaning relative to the top line of the staff), "middle" (meaning
relative to the middle line of the staff), or "bottom" (meaning relative
to the bottom line of the staff), optionally followed by
a plus or minus sign and a number of stepsizes to add or subtract to
get to the endpoint. The appearance can instead be just the word "between,"
meaning to draw from the bottom line of a staff to the top line of the
staff below it, and applies to all subsequent specifications on the line.
Or the appearance can be omitted, which will result in something that
looks like normal bar lines (in which case you'll likely want to be using
dashed or dotted to distinguish from normal bars). The appearance is followed
by one or more ranges of staffs, like for the
.Hr param.html#barstyle
barstyle parameter,
so things like 1-3 or 1-4,5-8,9,12 or the word "all."
Finally there is the keyword "time" followed by one or more counts at
which to draw the subbars. The counts may include decimal parts.
Note that subbars are only drawn on a staff
when a note or rest actually occurs on that count on that staff.
.Df
not set
.Cn
score
.Nm
.eS
subbarstyle=bar all time 4
.br
subbarstyle=dotted dblbar (top-2 to bottom-2) 1-5 time 3.5
.br
subbarstyle=bar 3-7 between time 2 dotted dblbar 1-2 time 3, 5.75
.Sa
.Hr param.html#barstyle
bar,
.Hr param.html#time
time
.eP
.\"------------------------
.bP
.Na
.Hm swing
swingunit
.De
This parameter only affects
.Hr midi.html
MIDI output.
Some styles of music are often
written in "swing time," meaning the
players are expected to play pairs of notes with the first twice
as long as the second, even though they are written as if they were the
same duration, or as if the first was three times as long as the second.
The most common example would be where the written notation shows
two eighth notes like 8;; or a dotted rhythm like 8.;16;
but the musician "knows" that the composer really intended it
to be played as if it were a triplet {4;8;}3;
This parameter adjusts the Mup MIDI output
to follow this performance convention.
If this parameter is set,
each measure is divided into segments of durations of "swingunit," starting
at the beginning. (Usually the
.Hr param.html#time
time signature
divided by swingunit
will be a whole number, but if not, the last piece will be shorter.)
Then within each segment, the time where one group ends
and the next group starts will be
altered in either of these two circumstances:
(1) The current boundary time is halfway into a swingunit, and
each group is at least half a swingunit long, or
(2) The current boundary time is 3/4 of the way into a swingunit,
and the first group is at least 3/4 of a swingunit long, and
the second group is at least 1/4 of a swingunit long.
In both of these cases, the durations are altered so that the
meeting point is 2/3 of the way into the swingunit.
.Va
a time value, like 2, 4, or 8, or not set to anything.
It can be a dotted value like 2. or 16.. although dotted values
are rarely likely to be useful.
It can even be a time expression like 2.-32 although that is even
less likely to be useful.
.Df
not set
.Cn
score, staff, voice
.Nm
.eS
swingunit = 4
.br
swingunit = // turn off swing
.Sa
.Hr param.html#timeunit
timeunit
.Ix jH
.eP
.\"------------------------
.bP
.Na
.Hm sylpos
sylposition
.De
A | can be used in lyrics at the beginning of a syllable (after
anything in angle brackets) to indicate syllable alignment.
This will override the
.Hr param.html#lyralign
lyricsalign parameter,
and may be useful for aligning verse numbers or to make syllables at
the beginning of poetic lines line up.
If the | is not preceded by a number, the sylposition parameter specifies the
default alignment value to use. It is the number of points (1 point
is 1/72 of an inch) from the horizontal "middle" of the chord to place the
left edge of the syllable. Negative values are to the left of the middle,
positive to the right, so this value is usually negative.
.Va
-100 to 100
.Df
-5
.Cn
score, staff
.Nm
.eX
sylposition = -4
.Sa
.Hr param.html#lyralign
lyricsalign
.Ix jB
.eP
.\"------------------------
.bP
.Na
.Hm tabwhite
tabwhitebox
.De
This parameter specifies whether or not to put a small white box behind each fret number on
.Hr tabstaff.html
tablature staffs.
This may make the music a little easier to read, since the staff lines
won't be going through the middle of the fret numbers.
.Va
y or n
.Df
n
.Cn
score, staff, voice
.Nm
.eS
tabwhitebox = y
.Sa
.Hr param.html#stlines
stafflines
.eP
.bP
.Na
.Hm textkmap
textkeymap
.De
This parameter
specifies which keymap to use for
.Hr textmark.html
rom, ital, bold, and boldital commands.
See the
.Hr textstr.html#keymaps
section on keymaps
in the
.Hr textstr.html
Text Strings chapter
for more details.
.Va
a string matching the name of a keymap defined earlier, or nothing.
An empty string ("") means don't do any mapping.
Setting to nothing unsets any previous value, which effectively causes the
.Hr param.html#defkmap
defaultkeymap
value to be used.
.Df
nothing
.Cn
score, staff
.Nm
.eS
textkeymap="Cyrillic"
.br
textkeymap=
.Sa
.Hr param.html#defkmap
defaultkeymap,
.Hr param.html#endkmap
endingkeymap,
.Hr param.html#labkmap
labelkeymap,
.Hr param.html#lyrkmap
lyricskeymap,
.Hr param.html#prntkmap
printkeymap,
.Hr param.html#rehkmap
rehearsalkeymap,
.Hr param.html#withkmap
withkeymap
.Ix jL
.eP
.\"------------------------
.bP
.Na
.Hm time
time
.De
This parameter
sets the time signature. Music data for each measure is checked to ensure
that the total time in the measure for each voice and verse
adds up to exactly the time signature, though supplying too little will
be allowed with a warning. Setting the time parameter will
also reinitialize
.Hr param.html#timeunit
the timeunit parameter
and
.Hr param.html#beamstyl
the beamstyle parameter
to their most recent values for the same time signature
(which would be their default values if they had never been explicitly
set for this time signature), unless they are also set in the same context.
The
.Hr param.html#printedtime
printedtime parameter
value is not reset.
.Va
either a ratio of the form \fIN/D\fP or the word "cut" or "common." If the ratio
form is used, \fIN\fP must be between 1 and 99 inclusive,
and \fID\fP must be 1, 2, 4, 8, 16, 32, or 64.
If followed by "y," the time signature will be printed even if it didn't change.
The numerator of the time signature can be the sum of several numbers,
as in 3+4/4 or 2+3+2/2. You can also have several fractions added
together, as in 3/4 + 4/4. It is also possible to provide "alternating"
time signatures, where you list two (or more, although two is typical)
time signatures separated by white space. Each measure then uses
the next time signature in the list. For example, for
3/4 4/4, the first measure would be in 3/4 time, the second measure in 4/4,
the third back in 3/4, the fourth in 4/4, and so forth.
It is possible to combine all the various complexities,
with things like 3+4/8 + 2+3/4 4+3/4, although that would be very uncommon.
The time signature can optionally be followed by the
letter "n" to specify that the time signature is not to be printed.
Or it can be followed by the letter "y," which causes
alternating time signatures to be treated differently.
By default, the alternating signatures are printed just once, as a list,
and the performer has to remember
that each subsequent measure has a different time signature.
Using y forces Mup to print the appropriate time signature on each measure.
.Df
4/4
.Cn
score
.Im
.eS
time = 6/8
.br
time = cut
.br
time = 13/16n
.br
time = 2+3+4 / 8 // additive numerator
.br
time = 3/4 + 4/4 // fractions added together
.br
time = 4/4 3/4 // alternating
.br
time = 3/4 6/8 y // alternating, printing time sig on every measure
.Sa
.Hr param.html#beamstyl
beamstyle,
.Hr param.html#printedtime
printedtime,
.Hr param.html#subbar
subbarstyle,
.Hr param.html#timeunit
timeunit
.Ix gT
.Ix gU
.Ix hA
.Ix hG
.eP
.\"-------------------------
.bP
.Na
.Hm timeunit
timeunit
.De
This parameter
sets the default time unit. If the first note of a measure has no time
value specified, the value of the timeunit parameter will be used.
If the
.Hr param.html#time
time signature
is changed in a context where timeunit is not also set,
the timeunit parameter reverts back
to its previous value for that time signature, which defaults to the
value of the denominator (bottom number) of the new time signature.
.Va
1/8, 1/4, 1/2, 1, 2, 4, 8, 16, 32, 64, 128, or 256
representing octuple whole, quadruple whole, double whole, whole, half,
quarter, eighth, sixteenth, thirty-second,
sixty-fourth, 128th, or 256th. (Each represents one half the time of the
one before it in the list). This can be
followed by zero or more dots. Each dot adds 50% of the previous note or dot
to the time.
It can also be a time expression, like 2+8 or 1-4+16.
The time value must be less than or equal to
the time signature.
The timeunit value can be reinitialized indirectly by setting
.Hr param.html#time
the time parameter.
Setting the time parameter will set the timeunit to the value
used most recently for that time signature.
.Df
the denominator (bottom number) of the time signature
.Cn
score, staff, voice
.Nm
.eS
timeunit = 2
.br
timeunit = 4.
.br
timeunit = 2 + 8
.Sa
.Hr param.html#swing
swingunit,
.Hr param.html#time
time
.Ix cT
.Ix gN
.Ix gX
.eP
.\"-------------------------
.bP
.Na
.Hm topmar
topmargin
.De
This parameter
sets the amount of white space margin to put at the top of each page.
It is specified in inches if the
.Hr param.html#units
units parameter
is set to inches, or in centimeters if the units parameter is set to cm.
This parameter can only be specified before any music or block input.
Margins are unaffected by
.Hr param.html#scale
the "scale" parameter.
.Va
0.0 to pageheight minus 0.5 inches
.Df
0.5 inches
.Cn
score
.Oo
.eX
topmargin = 0.8
.Sa
.Hr param.html#botmar
bottommargin,
.Hr param.html#leftmar
leftmargin,
.Hr param.html#rightmar
rightmargin,
.Hr param.html#pgheight
pageheight,
.Hr param.html#units
units
.Ix gM
.Ix gP
.Ix gS
.eP
.\"-------------------------
.bP
.Na
.Hm xpose
transpose
.De
This parameter
specify by what interval to transpose the music data. The interval can be
larger than an octave, but must be a valid interval (e.g., there is no
such thing as a perfect 6th). It is an error to specify a transposition value
that would result in a key signature with more than 7 flats or sharps.
.Ix cG
It is also an error if transposition would result in a note requiring a
triple sharp or triple flat.
.Va
the word "up" or "down," followed by an interval and a whole number greater than 0.
You can optionally add the keyword "notes" or "chords" at the end, to restrict the
transposition to just notes or just chord symbols; by default, both are
transposed.
The interval is one of major, minor, augmented, diminished, or perfect.
.Ix iQ
The intervals can be abbreviated to their first 3 letters (maj,
min, aug, dim, or per).
The
.Hr trnspose.html
section on transposition
lists transposition intervals and gives further details.
Depending on which key signature you are
transposing from, some transposition intervals may not work because they
result in more than 7 flats or sharps.
There is also another parameter called
.Hr param.html#addxpose
addtranspose.
Typically you would use the transpose parameter to change the key of
individual staffs (for transposing instruments), and then use the
addtranspose parameter if you want to change the key of the entire score.
But either of these parameters can be used either way.
In any case, for each staff, and for the score, the values of
transpose and addtranspose are both applied, one after the other,
to the current key signature, notes, and chords
to determine their resulting values.
.Df
up perfect 1 (i.e., no transposition)
.Cn
score, staff
.Nm
.eS
transpose = up minor 3
.br
transpose = down perfect 4
.br
transpose = up minor 3 chords
.Sa
.Hr param.html#a4freq
a4freq,
.Hr param.html#addxpose
addtranspose,
.Hr param.html#key
key,
.Hr param.html#useaccs
useaccs
.Ix fB
.Ix fC
.Ix gA
.Ix cG
.Ix hF
.eP
.\"-------------------------
.bP
.Na
.Hm tuning
tuning
.De
This parameter specifies what tuning system to use for the "white" notes" (a through g)
and the standard accidentals. In equal temperament, each octave is
divided into 12 equally spaced half steps, with the frequency of each note
being the twelfth root of 2 times that of the note below it.
In pythagorean tuning, perfect fifths have a ratio of 3/2. In meantone,
major thirds have a ratio of 5/4. See the chapter on
.Hr tuning.html
Custom Accidentals and Alternate Tunings
for more information.
.Va
equal, pythagorean, or meantone
.Df
equal
.Cn
score
.Nm
.eX
tuning = meantone
.Sa
.Hr param.html#a4freq
a4freq,
.Hr param.html#acctable
acctable
.eP
.\"----------------------------
.bP
.Na
.Hm tupslope
tupletslope
.De
This parameter allows you to control the slope of tuplet brackets.
Two values must be given, separated by a comma.
Mup calculates an appropriate slope for tuplet brackets by applying a linear
regression algorithm. The first value supplied for the beamslope parameter
is a factor by which to multiply the default slope that Mup calculates.
The minimum value of 0.0 would cause all brackets to be horizontal,
whereas the maximum value of 1.0 will use the slope Mup calculates.
Intermediate values will yield brackets that are less slanted than the
default slope calculation. The second value given to the tupletslope parameter
is the maximum angle for the bracket, in degrees.
If the originally calculated value multiplied by the
factor yields an angle of greater than this maximum angle,
the maximum angle will be used.
.Va
0.0 to 1.0 for the factor, and 0.0 to 45.0 for the maximum angle
.Df
0.7, 20
.Cn
score, staff, voice
.Im
.eX
tupletslope=0.5,15
.Sa
.Hr param.html#beamslp
beamslope
.eP
.\"----------------------------
.bP
.Na
.Hm units
units
.De
This parameter specifies whether margin and page size parameters are specified
in inches or in centimeters.
.Va
inches or cm
.Df
inches
.Cn
score
.Im
.eX
units = cm
.Sa
.Hr param.html#topmar
topmargin,
.Hr param.html#botmar
bottommargin
.Hr param.html#leftmar
leftmargin,
.Hr param.html#rightmar
rightmargin,
.Hr param.html#pgheight
pageheight,
.Hr param.html#pgwidth
pagewidth
.Ix hS
.eP
.\"----------------------------
.bP
.Na
.Hm useaccs
useaccs
.De
This parameter
specifies whether to use accidentals throughout rather than a normal
.Hr param.html#key
key signature.
A value of "n" means to use a key signature, and only use accidentals
where specified by the user. A value of "y none" means to not use a key
signature, but instead add accidentals everywhere as would be required
by the key signature, using the standard practice that an accidental
remains in effect for the remainder of the current measure.
A value of "y all" causes accidentals to be placed on every single note.
A value of "y nonnat" causes accidentals to be placed on every
single note except when the accidental would be a natural, with
naturals only printed when they would be required when using none.
A value of "y noneremuser" is like "y none"
but removes unnecessary user accidentals.
A value of "y nonnatremuser" is like "y nonnat"
but removes unnecessary user accidentals.
A "y" by itself
without a qualifier is an abbreviation for the "y none" value.
When using this parameter, you may sometimes want to use the
.Hr param.html#carryacc
carryaccs parameter
as well.
.Va
n, y none, y all, y nonnat, y noneremuser, y nonnatremuser
.Df
n
.Cn
score, staff
.Te
at next music context. If you turn it on in the middle of a score,
it prints a key signature of naturals to cancel the key signature.
.eX
useaccs = y all
.Sa
.Hr param.html#addxpose
addtranspose,
.Hr param.html#carryacc
carryaccs,
.Hr param.html#key
key,
.Hr param.html#canclkey
cancelkey,
.Hr param.html#xpose
transpose
.eP
.\"---------------------------------
.bP
.Na
.Hm vcombine
vcombine
.De
This parameter tells Mup to combine the specified
voices onto a single stem whenever possible.
One common use would be if you want multiple voices for
.Hr midi.html
MIDI
purposes, but want them printed on the same stems.
Another typical use would be to obtain a printing style common for hymns
and certain other styles of music, where the two voices on each staff are
printed on one common stem whenever possible, but when a note
is shared between two voices, two opposing stems are used to make it clear the
note is indeed shared.
The value of this parameter is a list of voices plus an optional qualifier.
The list format is like elsewhere for voices; common examples would be
\f(CW1,2\fR or \f(CW1-3\fR or \f(CW2-3\fR.
Order of voices is significant: sometimes Mup may have to choose between
two possible combinations, so voices listed first get priority.
The list of voices can be followed by a qualifier to specify what
happens when voices overlap. If the qualifier is "nooverlap,"
voices will only be combined if the bottom note of the higher voice
is higher than the top note of the lower voice.
If the qualifier is "stepsapart," voices will only be combined if the
bottom note of the higher voice is at least two steps higher than
the top note of the lower voice.
(That is the typical value for getting the hymn style described above.)
If the qualifier is "shareone," the bottom note of the top voice must be
no lower than than top note of the lower voice for combining to occur.
If the qualifier is "overlap," combining will occur without regard for
how the voices overlap. For the purpose of the qualifier, voice 1 is assumed
to be the highest voice, voice 3 the middle voice, and voice 2 the lowest.
If the qualifier is "restsonly", notes will never be combined, but rests
will be combined whenever possible.
If no qualifier is specified, the default is nooverlap.
Finally, an independent qualifier of "bymeas" can be specified,
in which case combining will only be done in measures
where the combining can be done on all chords in the measure.
While the vcombine
parameter is allowed to be used with any
.Hr param.html#vscheme
vscheme parameter
value, using it with vscheme=1 is pointless, and only
vscheme values of 2f and 3f are really appropriate.
This parameters can be used with both voice-at-a-time and chord-at-a-time
input styles. It has no effect on tablature or 1-line staffs.
Note that there are various cases where combining will not be done, such
as when time values or beamings are different in different voices, and cases
where combining would cause information loss, such as when a shared note is
tied in one voice but not another. In such cases,
the usual non-combined format will be used.
.Va
comma-separated list of voices or voice ranges, or nothing,
optionally followed by nooverlap, stepsapart, shareone, overlap, or restsonly,
optionally followed by bymeas
.Df
not set
.Cn
score, staff
.mM
.Nm
.eS
vcombine=3,1-2 shareone bymeas
.br
vcombine= // turn off combining
.Sa
.Hr param.html#vscheme
vscheme
.eP
.\"----------------------------
.bP
.Na
.Hm visible
visible
.De
This parameter
specifies whether a staff or voice is actually to be printed.
This can be useful for
printing a subset of a full score. The value is either y or n, for yes or no,
or whereused. When whereused is specified,
if a staff has no notes or lyrics or other associated things on an entire score,
that staff is not printed. This might be used, for example,
to save paper on an orchestral score by only printing staffs for
instruments when they are actually playing.
At least one staff must be visible at all times.
When an individual voice is made invisible, but the other voice(s) on that staff
remains visible, all the
.Hr stuff.html
tempo, dynamics, and similar marks
associated with the staff will still be printed, since Mup cannot know for sure
whether you meant them to be associated with
a particular voice or with the staff as a whole.
When
.Hr midi.html
MIDI output
is generated, this parameter controls whether the staff or voice
is audible, so you can control which voices are played.
.Hr cmdargs.html#soption
The -s command line argument can also be used
to control which staffs are printed or played.
.Va
y, n, or whereused
.Df
y
.Cn
score, staff, voice
.Te
at next music context. If it results in a staff becoming visible or
invisible, it forces a new score.
.eX
visible = n
.Sa
.Hr param.html#brace
brace,
.Hr param.html#bracket
bracket,
.Hr param.html#endingst
endingstyle,
.Hr param.html#staffs
staffs
.Ix bN
.Ix gL
.Ix hA
.Ix hK
.eP
.\"---------------------------------
.bP
.Na
.Hm vscheme
vscheme
.De
This parameter
sets voice scheme. A value of 1 means there is only a single voice on a
staff. The direction of note stems will be determined based on how high
or low the notes are on the staff. A value of 2o means there are two voices
with "opposing" stems. In other words, the stems of voice 1 will always
point upward, and the stems of voice 2 will always point downward,
unless they are
.Hr chrdattr.html#stemdir
explicitly forced
the other way. A
value of 2f means there are two voices with "free" or "floating" stems.
That means in places where there are notes or rests in both
.Ix iH
voices, stem directions will be as if 2o were set. However, if one of the
voices has "space" where there are no notes or rests, the stem directions of the
other voice will be determined as if there were only a single voice.
2o is useful if you want to force stem directions a certain way. 2f is
generally preferable when there are two voices only part of the time.
The values 3o and 3f are like 2o and 2f except that a third voice is
allowed. The third voice's stem defaults to up,
but the direction can be changed at any chord. The
.Hr chrdattr.html#stemdir
stem direction
remains in effect on subsequent chords of voice 3 until explicitly changed.
While there can be voice crossings, in general voice 1 should be the "top"
voice, voice 2 the "bottom" voice, and voice 3 the "middle" or "extra" voice.
Mup does not use voice 3 when associating things like phrase marks and
lyrics with chords.
Setting vscheme to a different number of voices
will reinitialize all voice level parameters for the
affected staffs.
.Va
1, 2o, 2f, 3o, or 3f
.Df
1
.Cn
score, staff
.eX
vscheme = 2f
.Pm
.Sa
.Hr param.html#vcombine
vcombine
.Ix bF
.Ix cO
.Ix gZ
.Ix hC
.Ix hI
.Ix hJ
.Ix hL
.eP
.\"---------------------------------
.bP
.Na
.Hm warn
warn
.De
This parameter
specifies whether to print warning messages or not.
Normally, Mup will print warnings when it encounters input that
it considers somewhat dubious. Sometimes, however, that input will really
be what you want, so this parameter allows you to turn off warning messages.
.Va
y or n
.Df
y
.Cn
score
.Im
.eX
warn = n
.eP
.\"---------------
.bP
.Na
.Hm withfont
withfont
.De
This parameter specifies which font type to use for text strings printed with chords
using [with "string"].
.Va
rom, ital, bold, or boldital
.Df
rom
.Cn
score, staff, voice
.Nm
.eX
withfont=boldital
.Sa
.Hr param.html#font
font,
.Hr param.html#fontfam
fontfamily,
.Hr param.html#size
size,
.Hr param.html#withfam
withfontfamily,
.Hr param.html#withsize
withsize
.eP
.\"---------------
.bP
.Na
.Hm withfam
withfontfamily
.De
This parameter specifies which font family to use for text strings printed with chords
using [with "string"].
.Va
avantgarde, bookman, courier, helvetica, newcentury, palatino, or times
.Df
times
.Cn
score, staff, voice
.Nm
.eX
withfontfamily=helvetica
.Sa
.Hr param.html#font
font,
.Hr param.html#fontfam
fontfamily,
.Hr param.html#size
size,
.Hr param.html#withfont
withfont,
.Hr param.html#withsize
withsize
.eP
.bP
.Na
.Hm withkmap
withkeymap
.De
This parameter
specifies which keymap to use for text strings printed with chords
using [with "string"].
See the
.Hr textstr.html#keymaps
section on keymaps
in the
.Hr textstr.html
Text Strings chapter
for more details.
.Va
a string matching the name of a keymap defined earlier, or nothing.
An empty string ("") means don't do any mapping.
Setting to nothing unsets any previous value, which effectively causes the
.Hr param.html#defkmap
defaultkeymap
value to be used.
.Df
nothing
.Cn
score, staff
.Nm
.eS
withkeymap="Cyrillic"
.br
withkeymap=
.Sa
.Hr param.html#defkmap
defaultkeymap,
.Hr param.html#endkmap
endingkeymap,
.Hr param.html#labkmap
labelkeymap,
.Hr param.html#lyrkmap
lyricskeymap,
.Hr param.html#prntkmap
printkeymap,
.Hr param.html#rehkmap
rehearsalkeymap,
.Hr param.html#textkmap
textkeymap
.Ix jL
.eP
.\"---------------
.bP
.Na
.Hm withsize
withsize
.De
This parameter specifies which size to use for text strings printed with chords
using [with "string"], specified in points.
.Va
1 to 100
.Df
12
.Cn
score, staff, voice
.Nm
.eX
withsize=15
.Sa
.Hr param.html#font
font,
.Hr param.html#fontfam
fontfamily,
.Hr param.html#size
size,
.Hr param.html#withfont
withfont,
.Hr param.html#withfam
withfontfamily
.eP
.Hi
.H 1 "HINTS"
.P
This section contains hints on how you can use Mup to
accomplish various things that have not been covered up to this point.
It doesn't introduce any new language features,
but describes some additional ways to apply what you have already learned,
and mentions some other tools you may find useful.
.He
.Ht Mup debugging
.Hd debug.html
.H 2 Debugging
.P
.Ix aP
Since Mup requires its input in a fairly strict format, when a song is put
in, it may contain "typos." Generally, the error messages that Mup prints
.Ix hF
will give you an idea of what is wrong. However, sometimes Mup is not able
to recognize that something is wrong until some distance beyond the actual
error. If you can't find anything wrong with the line that Mup lists as
being in error, try looking at the end of the previous line, or even earlier
lines. Some of the most common problems are missing semicolons and missing
.Ix hH
quotes. Missing quote marks tend to be especially confusing to Mup, and may
cause many error messages, even though there is only one problem.
Another common problem that may cause a very large number of error messages is
forgetting to state "music" to enter music context.
.Ix fQ
.Ix hM
.P
Often listening to
.Hr midi.html
MIDI output
is much more effective at spotting things like wrong notes and missing
accidentals than trying to find them by eye.
.Ht Adjusting Mup output
.Hd adjust.html
.H 2 "Adjusting Output"
.P
.Ix cP
Mup does its best to lay out the music in an aesthetically pleasing way.
Often, however, you may want to make adjustments. Perhaps the last part of
a piece spilled over onto a third page and you'd like to squeeze it all on
two pages, or a page turn falls at an awkward spot. There are several
mechanisms available for making adjustments. They have already been discussed
individually in various sections of this document, but this section tries to
pull things together.
.P
.Hr newscore.html
The "newscore," "newpage," "samescorebegin / samescoreend,"
and "samepagebegin / samepageend" commands
.Ix cC
.Ix cD
can be used to force where breaks do or do not occur.
This may be useful for ensuring a section ends at the end of a score or page.
.P
If you want to get a little more or less on each page, it is usually best
to start with changing the
.Hr param.html#scale
scale,
.Hr param.html#stscale
staffscale,
.Ix fV
.Hr param.html#packfact
packfact,
.Ix dT
and/or
.Hr param.html#packexp
packexp
.Ix dU
parameters.
.Ix aD
You may want to experiment with changing these individually first, to get
a feel for how they work, as trying to change all of them at once may lead to
interactions that change things more radically than you might expect.
Changing staffscale in score context lets you adjust the size of the
music without affecting the size of the text in headers and footers.
Adjusting the margins is sometimes helpful as well. Other parameters that
.Ix gS
might be useful in some situations are:
.Hr param.html#maxscore
maxscores,
.Hr param.html#scorepad
scorepad,
.Ix dQ
.Hr param.html#scoresep
scoresep,
.Ix jA
.Hr param.html#staffpad
staffpad,
and
.Hr param.html#staffsep
staffsep.
.Ix fA
.P
The
.Hr param.html#dist
dist,
.Ix fK
.Hr param.html#dyndist
dyndist,
and
.Hr param.html#chdist
chorddist
.Ix dO
parameters are useful if
you want items to line up vertically.
The "align" and "dist" option can be used
on rom, bold, ital, boldital, octave, mussym, crescendo and decrescendo
statements, to force something where you want it.
(The "dist" option can be used on rehearsal marks as well.)
.P
The appearance of lyrics can be adjusted using the
.Hr param.html#lyrdist
lyricsdist,
.Ix hT
.Hr param.html#lyrfont
lyricsfont,
.Hr param.html#lyrfam
lyricsfontfamily,
.Hr param.html#lyrsize
lyricssize,
and
.Hr param.html#lyralign
lyricsalign
parameters.
.P
Printers often cannot print all the way to the edges of the paper,
and sometimes print at some fixed offset from the actual corner of the page.
Ghostscript includes an "align.ps" file that you can print that gives you
instructions on how to compensate for that, by adding a special "setpagedevice"
line to your PostScript files. That special line can be added
to Mup output using the postscript afterprolog hook.
Since hooks are wrapped in save/restore blocks,
and the setpagedevice has to not be in such a block, restore and save
lines have to be used to undo the block that Mup adds:
.Ex
postscript afterprolog "
restore
<< /.HWMargins [18 18 18 12.5] /Margins [-75 0] >> setpagedevice
save"
.Ee
Replace the numbers with those calculated by following the align.ps
instructions. Note that the spacing may need to be exactly as align.ps says.
.Ht Special uses of invisbar
.Hd invisbar.html
.H 2 "Special uses of invisbar"
.P
.Ix fH
The "invisbar" can be used
to force Mup into
doing something in the middle of a bar that it normally would allow
to happen only at a bar line.
Suppose, for example, you wish to place a
.Hr bars.html#reh
rehearsal letter
in the middle of a measure. This could be accomplished as follows:
.Ex 1
.\"score leftmargin=2;rightmargin=2
.\"music
// assume we are in 4/4 time, but want
// a rehearsal letter by count 3
// of the measure
// do first part of measure and use "space"
// for last part so time values will add up
// properly to a full measure
1: 4c;d;2s;
// put in invisible bar with rehearsal letter
invisbar rehearsal let
// now do the last half of the measure,
// this time with space at the beginning
1: 2s;4e;c;
bar
.Ee
.P
As another example of invisbar use, suppose you want to add a "courtesy"
key signature at the end of a repeated section to remind the player that the
beginning of the repeated section is in a different key. This can be done
by adding an empty measure whose sole purpose is to produce this key signature.
.Ex 1
score key=3&
.\"leftmargin=2
.\"rightmargin=2
music
1: g;f;e;d;
repeatstart
1: c;e;f;g;
dblbar
score key=0&
music
1: g;f;e;d;
bar ending "1."
1: f;e;2c;
// add a courtesy key signature,
// to remind player the beginning
// of the repeated section is in
// a different key
invisbar
score key=3&
music
1: ms;
repeatend ending "2."
1: e;d;2c;
endbar
.Ee
.P
You can use a similar technique to insert time signatures, clefs, etc.
at unusual places.
.Ht Chant
.Hd chant.html
.H 2 Chant
.P
Chant typically uses an irregular number of beats per measure, or often
no measures at all in the normal sense. Mup checks to make sure you
provide enough notes to fill the time signature, but will allow you to use
less, filling the remainder with space. So one possible approach to writing
chant is to specify a large time signature\(emat least as big as you will
ever have on any given line of music\(emand then supplying as many notes
as you need, letting Mup pad with space as needed. If the warnings are
annoying, you can set the
.Hr param.html#warn
warn parameter
to turn the warnings off.
.P
Here is an example that shows some other techniques you might use when
.Ix iK
writing chant.
.Ex 1
.\" score
.\" leftmargin=1.7
.\" rightmargin=1.7
.\" music
1: 1a;
lyrics 1: "This<^ is an example of one way>";
bar
1: d;e;2f;
lyrics 1: "to do chant.";
bar
1: 1f;
lyrics 1: "when<^ there are many words for a>";
bar
1: d;f;2;
lyrics 1: "sin-gle note.";
dblbar
newscore
// Note use of 'n' to not print the time signature
score time=7/4n
music
1: a;;;b;g;2a;
lyrics 1: "When there are man-y notes,";
bar
score time=8/4n
music
1: d;e;f;e;f;8e;;2;
lyrics 1: "You might change the time sig-na-ture";
bar
score time=5/4n
music
1: a;e;;2d;
lyrics 1: "on ev-ery bar,";
bar
score time=7/4n
music
1: e;f;e;d;c;2d;
lyrics 1: "to match the syl-la-bles.";
dblbar
newscore
score time=8/4n
music
// Note use of 'n' to not print tuplet number/bracket
1: {d;e;f;g;e;2d;;}10n,1/2;
lyrics 1: "You can al-so use tup-lets,";
invisbar
1: {f;g;e;2d;e;2.d;}9n,1/2;
lyrics 1: "A-long with in-vis-bars.";
dblbar
newscore
score stemlen=0
music
1: d+;c+;b;g;2a;;
lyrics 1: "Set stem-len to ze-ro,";
invisbar
1: {f;2e;4d;c;1d;}9n,1/2;
lyrics 1: "to get stem-less notes.";
endbar
.Ee
.Ht Forcing shared noteheads
.Hd sharehd.html
.H 2 "Forcing shared noteheads"
.P
Mup will automatically share noteheads when it can figure out it is safe
and proper to do so. However, there may be some unusual cases where you would
like to force the notes from two voices to share noteheads even when Mup
would not do that. That can be done by specifying a horizontal offset of zero,
i.e., [ho 0], on one or both of the voices.
.Ht Manually placed tuplet numbers
.Hd mantup.html
.H 2 "Manually placed tuplet numbers"
.P
Generally, Mup will place
.Hr tuplets.html
tuplet
.Ix aX
numbers for you.
However, you do need to print them yourself on
.Hr ichdattr.html#crossbm
cross-staff beams.
.Ix iC
And there may be cases where you choose
to use 'n' to turn off Mup's automatic printing of tuplet numbers,
.Ix fU
in order to print them manually in a different place than Mup would.
Mup normally uses newcentury boldital font for tuplet numbers, in 11-point
size for regular notes and 9-point for cue notes.
So to make your manually placed tuplet numbers
look the same as automatic ones, you might use a
.Hr macros.html
macro
something like this:
.Ex
define TUPNUM(NUM) "\ef(NX)\es(11)" +`NUM` @
1: { 8c; d; e; } 3n; 2.us;
rom above 1 dist0: 1.34 TUPNUM(3);
bar
.Ee
Or another approach would be something like this:
.Ex
define TN(NUM,WHERE,D,N) newcentury boldital WHERE dist D: N `NUM`;@
1: { 8c; d; e; } 3n; 2.us;
TN(3,above 1,0,1.34)
bar
.Ee
.Ht Manual placement of notes
.Hd manual.html
.H 2 "Manual placement of notes"
.Ix fU
.Ix hL
.P
Mup supports up to three voices per staff. If you need more than that, such as
.Ix bF
when 4 notes of different lengths occur on the same beat, it is possible
.Ix dJ
to position extra notes manually.
Manually positioned notes will not be included in
.Hr midi.html
MIDI output.
.Ix aA
.P
First of all, unless the fourth voice is vertically far away from the other two,
you'll probably need to reserve some
extra space to the left or right of the other chords. This can be done
.Ix gZ
by adding a bit of
.Hr chrdattr.html#pad
padding to the chord.
.Ix bD
If you want the extra note on the left of the regular
voices, add padding to whichever regular voice is leftmost. If you want it
on the right, the padding will have to go on the following note, or on
the bar line if you are on the last chord of a measure. The amount of
padding to add may have to be determined by trial and error; 5 stepsizes
.Ix fO
is a good first guess. Next, set a
.Hr tags.html
location tag
.Ix bE
.Hr noteattr.html#ntag
on one of the notes
in one of the regular groups.
The manually positioned note will be placed relative to
that location tag. The x will be slightly left or right of the
west or east of the existing group; something like 3 stepsizes might be
a good first guess. The y can be specified in terms of
stepsizes up from the note you used for the location tag. You can use a
.Hr prnttext.html
print statement
.Ix hA
using one of the special
.Hr textstr.html#symlist
music characters,
such as:
dblwhole, 1n, up2n, dn2n, up4n, up32n, etc. If the note needs ledger lines,
dots, or accidentals, these too have to be manually positioned,
.Ix bL
.Ix gX
which can be a bit tricky. Here is a simple example:
.Ex 1
score
.\"leftmargin=1.6; rightmargin=1.6
vscheme=3o
beamstyle=4,4,4,4
music
1 1: [pad 4] 4g =h; a; b; a;
1 2: 4.c;8;2;
1 3: [down] 8e;; [ho 0] 2.f;
print (h.w - 2.3, h.y + 3) "\e(up2n)"
bar
.Ee
In this example, 4 stepsizes of padding
was added to the quarter note g of voice 1
on staff 1. A location tag "h" was set to this note. After the information
about the second voice on staff 1, a half note was manually placed
2.3 stepsizes left of the first voice and at pitch c+ (3 steps up from the g).
.P
If you also need to place an accidental and/or dots, more padding should be
requested, and additional print statements used for each item. For example,
you could specify perhaps 5 stepsizes of padding, then add:
.Ex 1
.\"score
.\"leftmargin=1.6; rightmargin=1.6
.\"beamstyle=4,4,4,4
.\"vscheme=3o
.\"music
.\"1 1: [pad 5] 4g =h; a; b; a;
.\"1 2: 4.c;8;2;
.\"1 3: [down]... 8e;; [ho 0] 2.f;
.\"print (h.w - 2.3, h.y + 3) "\e(up2n)"
print (h.w - 5, h.y + 3) "\e(flat)"
.\"bar
.Ee
to place a flat sign in front of the c.
.P
Ledger lines needed by the notes also have to be
placed manually, using the "line"
command. If the note is more than three steps above or below the staff, more
than one ledger line would be needed, and each would need to be specified
separately. The y coordinate of the each ledger line would be the same
as the y coordinate of the note,
plus or minus some number of step sizes. The length of
the line depends on the notehead. About 4.5 stepsizes is a good estimate for
most notes, but a double whole needs more like 6 stepsizes.
.Ht Trill with accidental
.Hd trillacc.html
.H 2 "Trill with accidental"
.P
Sometimes when notating a trill,
.Ix bX
you may want to place an accidental between the "tr" and the wavy line.
The typical way of getting a trill, something like
.Ex
mussym above 1: 1 "tr" til 3;
.Ee
doesn't allow for such an accidental.
However, the desired output can be achieved with a slightly different input:
.Ex
rom above 1: 1 "\e(tr)\es(-2)\e(flat)~" til 3;
.Ee
The \es(-2) makes the flat a little smaller; you can adjust the actual size
to your taste. The tilde at the end of the string tells Mup to use a wavy
line for the til clause.
.Ht Accidental on tied-to note
.Hd tieacc.html
.H 2 "Accidental on tied-to note"
.P
When a note with an accidental is tied across a bar line, the standard
convention is to not print the accidental on the tied-to note, and Mup
uses that convention. If you really want to have the accidental printed,
you can specify a slur rather than a tie. If you want the MIDI output to be
correct, you can use an
.Hr macros.html
ifdef
to use slur for printing and tie for MIDI.
.Ex 1
.\" score
.\" leftmargin=2
.\" rightmargin=2
.\" music
1: 2c;e& ifdef MIDI ~ else <> endif ;
bar
1: 1e&;
bar
.Ee
.Ht Bracketing notes across staffs
.Hd brackmac.html
.H 2 "Bracketing notes across staffs"
.P
In keyboard music, sometimes a bracket is drawn to indicate that
notes from two staffs are to be played
.Ix dW
with the same hand. The bracket is really just a vertical line with short
horizontal lines at each end. But if you need to make lots of brackets,
a macro with parameters can be very helpful.
.Ex 1
score
.\" rightmargin=2
.\" leftmargin=2
staffs=2
staff 2
clef=bass
vscheme=2f
// Define a macro to draw a bracket to show that notes on two
// different staffs are to be played with the same hand.
// The parameters are location tags for the top and bottom notes
// to be included in the bracket.
define BRACK(TOP, BOT)
// Draw a short horizontal line 0.5 stepsizes above the top note
line (TOP.w - 2, TOP.n + 0.5) to (TOP.w - 1, TOP.n + 0.5)
// Draw a vertical line from 0.5 stepsizes above the top note
// to 0.5 stepsizes below the bottom note.
// Do all the 'x' coordinates relative to the same note (in
// this case the top), so that if the top and bottom chord happen
// to be different widths, the line will still be vertical.
line (TOP.w - 2, TOP.n + 0.5) to (TOP.w - 2, BOT.s - 0.5)
// Draw short horizontal line just below and left of the bottom note.
line (TOP.w - 2, BOT.s - 0.5) to (TOP.w - 1, BOT.s - 0.5)
@
music
// For each chord that is to get a bracket, add some padding to
// make sure there is enough room, and set a location tag
// on the top and bottom notes.
1: [pad 2] ce =a;[] df =b; [] d =c; [] ce =d;
2: [pad 2] g =e; [] a =f; [] af =g; [] g =h;
2 2: 2cc-; 4g-; cc-;
// Now draw the brackets, using the tags as parameters
BRACK (a, e)
BRACK (b, f)
BRACK (c, g)
BRACK (d, h)
bar
.Ee
.P
Note that Mup supports
.Hr crossst.html
cross-staff stems,
which is another way to notate a chord that is split
across two staffs, and may often be a better choice.
.Ht Cross-bar beaming
.Hd crossbar.html
.H 2 "Cross-bar beaming"
.P
Generally, beams do not cross bar lines, and Mup follows that rule.
However, if you want beams to cross a bar line, there are at least two
possible approaches to getting the
desired effect. The first is to explicitly specify
.Hr chrdattr.html#stemlen
stem lengths
such that all the beams in the various measures will lie on the same line.
You can then use the
.Hr linecurv.html
line command
to fill in the gaps in the beams across the bar lines.
.P
The other approach is to draw in the bar line using the "line" construct.
.Ix gG
.Ix hG
.Ix bA
.Ix dE
.Ix fE
To do this you first tell Mup that a measure is twice as long as is really
is, so that you can put two actual measures inside what Mup thinks is a
single measure. Here is an example.
.Ex 1
.\"score rightmargin=1.5; leftmargin=1.5
.\"music
// First make an empty measure ending with an
// invisible bar. This is for the sole purpose
// of allowing the real time signature to be
// printed and would not be necessary if we
// wanted to cross a bar line other than
// the very first bar line of the piece.
1: ms;
invisbar
// Now, make the effective time signature twice
// as long as the real time signature, but use "n" so this fake
// time signature is not actually printed.
// Set up for beaming across the entire double-length measure.
// (You could could use other beamstyles if you wish, or custom beaming.)
score time=8/4n
beamstyle=1/2
music
// Now do the double-length measure. On the chord
// just after where we want a bar line, add some extra
// padding and set a location tag so that we can draw
// a bar line relative to the tag.
1: 8c;e;f;d;g;e;f;a; [pad 3; =a]g;e;f;a;g;d+;4c+;
// Also set a location tag on the next bar line,
// so that we can get the vertical endpoints of the
// bar line that we draw from the endpoints of the
// normal Mup-supplied bar line.
bar =b
// Now draw the bar line that goes through the beam.
// Use the horizontal position relative to the "a"
// location tag on the chord in the second actual measure,
// and get the vertical endpoints from the "b" tag
// associated with the next bar line.
line (a.w + 1, b.y + 4) to (a.w + 1, b.y - 4)
.Ee
.Ht Printing relative to lyric syllables
.Hd lyrtag.html
.H 2 "Printing relative to lyric syllables"
.P
Here is an example that shows how location tags associated with lyric syllables
might be useful:
.Ex 1
.\"score
.\" leftmargin=2
.\" rightmargin=2
.\"music
1: g;a;2g;
lyrics below 1 : 4;;2; "\ev(+40)Yo,\ev(-40)\e=(_yo) sin<^ tu a>\e=(_words)-mor";
// Print an alternate word with brackets.
print (_yo.w, _yo.y - 2.5) "\e(E')l,"
print (_yo.w - 4, _yo.y - 1.3) "\es(+12){"
print (_yo.e - 1, _yo.y - 1.3) "\es(+12)}"
// print curve to join three syllables
curve (_words.w, _words.y - 1) to (_words.e - 1, _words.y - 1) bulge -1
bar
.Ee
.Ht Printing slanted text
.Hd slantxt.html
.H 2 "Printing slanted text"
.P
While Mup doesn't have a command for directly printing text at some
particular angle, it does allow printing text above a line, and that line can
be at an angle. The original intent was to use that for
printing "glissando," but it can be used for other things too.
So to print arbitrary text at an arbitrary angle,
you can make the line so tiny it can hardly be seen.
Because of roundoff, it is generally not possible to make it so small
that you can't see it at all, but it can be small enough to look like
just a stray ink dot. By adjusting the relative location
of the endpoints of the tiny line, you can control the angle.
.Ex 1
.\" score
.\" leftmargin=2
.\" rightmargin=2
.\" music
1: 2c =c; =q;
line (c.x, c.y - 14) to (c.x + 0.05, c.y -14.05) with "Slanted text";
line (q.x, q.y - 14) to (q.x + 0.04, q.y -14.02) with "Different angle";
bar
.Ee
.Ht Mixed time signatures
.Hd mixtsig.html
.H 2 "Mixed time signatures"
.P
Once in a while, music is written with different
.Ix gU
time signatures
on different staffs. Starting with Version 6.8, there is a
.Hr param.html#printedtime
printedtime parameter
to do that, so this section is probably not really necessary anymore,
but it provides an example of how to print things manually
for the case where the time signatures reduce to the same value, for example,
3/4 and 6/8 time (since 6/8 taken as a fraction and reduced to lowest terms
is 3/4). You can make the output use both 3/4 and 6/8 by using a non-printing
time signature, then placing the time signatures manually.
Here is an example of how to do that:
.Ex 1
score
.\" leftmargin=2
.\" rightmargin=2
// set time signature to 3/4 but don't print it
time=3/4n
staffs=2
staff 1
// We want this staff to be in 3/4 time,
// so beam things in groups of
// quarter note times.
beamstyle=4,4,4
staff 2
// We want this staff to effectively be
// in 6/8 time, so we'll beam things
// in groups of dotted quarters.
beamstyle=4., 4.
// In real 6/8 time, the time unit would
// be eighth note, so make that the default
timeunit=8
music
// Add padding to the first chord on at least one
// of the staffs, to make room for the manually placed
// time signatures, and set location tags
1: [pad 5; =t] c; 8d; e; f; g;
2: [=s] g; f; g; 4.c;
// Manually place the time signatures
// They are printed in 16-point newcentury bold font,
// relative to the location tags that were set.
// First print the 3/4
print (t.w - 4, t.y) "\ef(newcentury bold)\es(16)3";
print (t.w - 4, t.y - 4) "\ef(newcentury bold)\es(16)4";
// Then print the 6/8
print (t.w - 4, s.y) "\ef(newcentury bold)\es(16)6";
print (t.w - 4, s.y - 4) "\ef(newcentury bold)\es(16)8";
bar
.Ee
.Ht Defining a macro inside another macro
.Hd nestmac.html
.H 2 "Defining a macro inside another macro"
.P
.Ix aM
One possible use for defining one
.Hr macros.html
macro
inside another is to make it
act differently depending on how many times it has been called.
.P
.Ix fL
Suppose you want to have
.Hr pedal.html
pedal
on the first and third count of each
measure, but instead of having that printed for the whole song, you'd rather
just print pedal marks for a couple measures, and then say "simile."
.In aA
However, for
.Hr midi.html
MIDI,
you would want the pedal to apply to the entire song,
as well as both staffs, not just the one it is printed under.
One way to accomplish that is given below. A PED macro is defined.
Each time it is called, it defines another macro (ONCE, TWICE, and THRICE)
to keep track of how many times it has been called. On the third time,
it prints the "simile." In any case, if it is not doing MIDI and has not yet
reached THRICE, it prints the pedal marks. If it is doing MIDI,
it always applies pedal to both staffs.
.Ex 1
score
staffs=2
pedstyle=pedstar
alignped=n
.\" rightmargin=1.5
.\" leftmargin=1.5
staff 2
clef=bass
define PED
ifndef ONCE
define ONCE \@
else
ifndef TWICE
define TWICE \@
else
ifndef THRICE
define THRICE \@
rom below 2: 1 "simile";
endif
endif
endif
ifdef MIDI
pedal below 1-2: 1;3;
else
ifndef THRICE
pedal below 2: 1;3;
endif
endif
@
music
1: c;e;f;a;
2: ceg;;cfa;;
PED
bar
1: e;g;f;a;
2: ceg;;cfa;;
PED
bar
1: c;e;f;a;
2: ceg;;cfa;;
PED
bar
.Ee
.Ht Marking complicated tempo changes
.Hd tempochg.html
.H 2 "Marking complicated tempo changes"
.P
Sometimes you may wish to indicate tempo changes by showing two note
values with an equals sign between them. For simple cases, this is
fairly straightforward, but if you want to include beamed notes or a triplet,
a little more work is required. Another use of this notation is to
show that the music is to be played in "swing time," as in this example,
which has two ordinary eighth notes on one side of the equals sign,
and a triplet made up of a quarter and eighth note on the other:
.Ex 1
score
// This example assumes "size" is set to 15
size=15
.\" leftmargin=2.3
.\" rightmargin=2.3
.\" time=2/4
beamstyle=4,4
music
// set a location tag
1: [=c] 8c+;a;g;f;
// set X and Y to where the first note will be placed
define X c.x - 3 @
define Y c.y + 5 @
// print "straight 8ths = triplet quarter plus 8th"
// print the basic notes and equal sign
print (X, Y) "\e(smup4n) \e(smup4n) = \e(smup4n) \e(smup8n)"
// print the beam between the straight 8th notes
wide line (X + 2.1, Y + 5.5) to (X + 7.2, Y + 5.5)
// now do the triplet bracket
line (X + 14.7, Y + 7.0) to (X + 17.6, Y + 7.0) // horz left top segment
line (X + 19.4, Y + 7.0) to (X + 22.5, Y + 7.0) // horz right top segment
line (X + 14.7, Y + 7.05) to (X + 14.7, Y + 5.3) // vert left side segment
line (X + 22.5, Y + 7.05) to (X + 22.5, Y + 5.3) // vert right side segment
// print the 3 in the middle of the bracket
print (X + 17.9, Y + 6.1) "\es(8)\ef(TI)3" // the 3 for the triplet
bar
.Ee
.P
Note that if you want a piece to be played in swing time,
you may also want to set the
.Hr param.html#swing
swingunit parameter,
which will make the MIDI output use swing time.
.Ht Placing several songs on one page
.Hd multsong.html
.H 2 "Placing several songs on one page"
.P
Sometimes you may wish to print more than one song on the same page.
While Mup considers all of its input to be a single song,
it is possible to get the effect of separate songs.
First of all, on the last bar line of first song, use "hidechanges."
That way, if the key or anything is
different in the next song, Mup won't print the changes at the
end of the first song. Then
.Ix jC
.Hr prnttext.html#block
use a "block"
for printing the titles
for the second song.
Here is an example:
.Ex 1
score
.\" leftmargin=2
.\" rightmargin=2
.\" packfact=2
scoresep=10,14
label=""
header
title (18) "Title for first song"
music
1: c;d;e;f;
bar
1: f;e;d;c;
bar
1: c;d;e;f;
bar
1: f;d;2c;
endbar
// force time signature to be printed on next score
// by changing the time, but only for an invisible measure
score time=5/4n
music
1: ms;
invisbar hidechanges
// Force the block closer to next score,
// so it will better match the spacing of
// the title of the first song.
score scoresep=6,6
// print title for second song
block
title (30) " " // Allow some extra room above title
title (18) "Title for second song"
score
// Set up for second song
time=4/4
key=1&
music
1: d;e;2f;
bar
// Put score spacing back to original
score scoresep=10,14
music
1: a;2g;4f;
bar
1: 2e;4c;d;
bar
1: 2g;f;
endbar
.Ee
.P
The use of
.Hr param.html#saverest
saveparms and restoreparms,
and/or
.Hr macros.html#saverest
savemacs and restoremacs
may be useful in some cases, particularly if you want similar settings for
several songs that are separated by songs where you want different settings.
.Ht Cadenzas
.Hd cadenza.html
.H 2 "Cadenzas"
.P
.Ix iZ
Cadenzas or cadenza-like passages are often written
with an arbitrary number of notes per measure.
One way to accomplish this is to use a
.Hr tuplets.html
tuplet
with the appropriate number of notes.
.Ex 1
score
.\" leftmargin=2
.\" rightmargin=2
time = 3/4
music
1: { [cue]... 16g- bm;b-;c;d;e;f;g;a;b;a;g;f;e;d;c;b-;g- ebm;} 17n,2.;
bar
.Ee
.Ht Transposition
.Hd trnspose.html
.H 2 "Transposition"
.P
.Ix fB
The
.Hr param.html#xpose
transpose
and
.Hr param.html#addxpose
addtranspose
parameters
can be used to transpose the pitches for a staff or the whole score.
The following table shows what transposition values to use for different
intervals.
.TS
center, box;
c|c|c
l|l|l.
\fBhalfsteps\fP \fBtransposition\fP \fBalternate transposition\fP
_
0 perfect 1 diminished 2
1 augmented 1 minor 2
2 major 2 diminished 3
3 augmented 2 minor 3
4 major 3 diminished 4
5 augmented 3 perfect 4
6 augmented 4 diminished 5
7 perfect 5 diminished 6
8 augmented 5 minor 6
9 major 6 diminished 7
10 augmented 6 minor 7
11 major 7 diminished 8
.TE
.P
This table continues in a similar way for intervals beyond an octave.
For each number of halfsteps you want to transpose, there
is more than one way the
.Hr param.html#xpose
transpose
and
.Hr param.html#addxpose
addtranspose
parameters can be
specified, as shown by this table. This allows to you control
whether a sharp key or a flat key is to be used in cases where there is
a choice. For example, if the key signature has three sharps, and you
want to transpose up two halfsteps, you could say either
.Ex
transpose = up maj 2
.Ee
or
.Ex
transpose = up dim 3
.Ee
The first will result in a key of five sharps, and the second will
result in seven flats. These are equivalent keys; in major for
example, they are B and C flat, which are the same note. It is up to
you to choose the way you would like it to be printed.
But no key is allowed to have more than seven sharps or flats, so in
most cases only one of the ways will result in a valid key, and the
other way will result in an error message.
.P
The transpose and addtranspose parameters are allowed
in score and staff contexts, so they can
be set to different values on different staffs, and on the score as a whole.
This is useful for printing scores where some of the instruments are
transposing instruments (like B-flat clarinet).
You can set the transpose parameter on specific staffs to appropriate
values for the transposing instruments. Then if you decide you want to
move the entire score to a new key, you can set the addtranspose parameter
in score context.
You can enter all the music at true pitch, but print the score and/or
the individual parts with the correct transposition.
.P
Another use for setting different transposition values is the following
trick, useful in guitar music for printing both the real chords and chords
.Ix hV
for capo.
Say, for example, you have a song that is in B flat, but the guitar is
to use a capo on the third fret, and play in the key of G.
You could define the following macro to print both versions of a chord,
the capo version above the real version:
.Ex
define CHORD(COUNT, NAME)
bold chord all: COUNT[-1.3] \(gaNAME\(ga; // chord for capo
ital(8) chord 1: COUNT \(gaNAME\(ga; // real chord
@
.Ee
Then, set these transpositions:
.Ex
score transpose = down minor 3 // transpose score for capo
staff 1 transpose = up perfect 1 // override score transposition
.Ee
and similarly for any other staffs.
Then, wherever you want to print a chord, say (for example)
.Ex
CHORD(3,Dm)
.Ee
This will print both versions of the chord above count 3 of the measure.
For the top chord it will transpose this to Bm, the capo chord.
For the bottom chord it will leave it as Dm, the real chord.
.P
For
.Hr midi.html
MIDI
purposes, if your MIDI player supports altered tunings, the
.Hr param.html#a4freq
a4freq parameter
could be used to get the effect of transposing all the voices.
See also the section on
.Hr macros.html#concat
Concatenating macro names
for another approach.
.Ht Placing verses below the scores
.Hd verses.html
.H 2 "Placing verses below the scores"
.P
Sometimes, particularly with songs that have a lot of verses,
.Ix cJ
you may want to put some verses of lyrics as blocks of
text below the music. Probably the easiest way to do this
is using "print" or "paragraph" statements inside
.Ix jC
.Hr prnttext.html#block
a "block."
.Ex
block
print (_win.w + 30, _win.n - 15) "2. "
print "\e
Here is the first line
and the second line
and the third line.
\&"
print (_win.w + 90, _win.n - 15) "3. "
print "\e
Here is another verse's first line
and its second line
and its third line.
\&"
.Ee
.P
You may need to use a little trial-and-error to determine the
coordinates to use on the print statements,
but you only have to determine one coordinate per verse,
and with a bit of practice it gets easier to find the right values.
Since the "print" statement is being used, the font and size will be
determined by the
.Hr param.html#size
size parameter
and
.Hr param.html#font
font parameter,
rather than by
.Hr param.html#lyrsize
lyricssize
and
.Hr param.html#lyrfont
lyricsfont.
.P
If you also want chord symbols with these verses,
you can do that too. It is easiest if you use Courier font,
as shown in the example below, since its constant-width characters
make it easy to line things up. If you use a proportional-width font,
you will have to determine how to place the chords by trial and error.
.Ex
print (_win.w + 50, _win.n - 35) "3. "
print "\ef(CR)\e
C D7 G7
This is the first line
C F
of the next verse
B\e(smflat)
of the song.
\&"
.Ee
.Ht Automatic piano reduction
.Hd pianored.html
.H 2 "Automatic piano reduction"
.P
Perhaps you'd like a four part vocal piece written on four separate staffs,
.Ix iU
as well as a piano reduction on two staffs with two voices.
This could be done using:
.Ex 1
score
.\" rightmargin=2
.\" leftmargin=2
staffs=6
bracket=1-4
brace=5-6
staff 3
clef=treble8
staff 4
clef=bass
staff 5
vscheme=2o
staffscale=0.75 // make piano staffs a little smaller
staff 6
clef=bass
vscheme=2o
staffscale=0.75
// Define macros to put each voice on its own staff
// plus the appropriate staff/voice of the piano staffs.
define S 1 1 & 5 1: @ // soprano
define A 2 1 & 5 2: @ // alto
define T 3 1 & 6 1: @ // tenor
define B 4 1 & 6 2: @ // bass
music
S 2c+;;
A 2f;e;
T 2a;g;
B 2c;;
bar
.Ee
.P
This can also be done using
.Hr altinp.html
chord-at-a-time input style:
.Ex
// Define a macro to put each voice on its own staff
// plus the appropriate staff/voice of the piano staffs.
// This example assumes inputting notes from bottom to top.
define M [ 4 1 & 6 2; \e
3 1 & 6 1; \e
2 1 & 5 2; \e
1 1 & 5 1 ] : @
music
M 2cafc+;cgec+;
bar
.Ee
.Ht Deriving cue notes from another staff
.Hd autocue.html
.H 2 "Deriving cue notes from another staff"
.P
Sometimes you may want to have the notes on one staff be used as cue notes
on another staff, typically to help the players of one instrument know when
they should come in, by showing what another instrument will be playing just
before their entrance. One way to do this is to define a
.Hr macros.html
macro.
In this example, the macro is called NAC, for "normal and cue."
The first parameter is the staff/voice that should get normal sized notes,
the second is the staff/voice that should get cue sized notes, and the third
is the Mup input for the notes themselves.
Since REG and CUE parameters could each be passed a list, if
multiple instruments are playing in unison, they could all in be listed as
REG, and if you wanted multiple staffs to get the same cues,
they could all be listed as CUE, as shown in this example:
.Ex 1
define NAC(REG, CUE, INPUT)
REG: INPUT
CUE: [cue]... INPUT
@
score
staffs=4
.\" leftmargin=2
.\" rightmargin=2
staff 3
// it's okay if some of the staffs are invisible
visible=n
music
NAC(1&3, 2&4, c;f;a;g;)
bar
.Ee
.Ht Diagonal slash marks
.Hd slashmrk.html
.H 2 "Diagonal slash marks"
.P
Sometimes, instead of a note or notes,
.Ix cA
a diagonal slash mark is printed on a staff.
This is used for various purposes,
.Ix iY
such as strumming a chord (in a
.Ix hY
guitar part), or to mean that the previous beat should be
.Ix dZ
repeated or
that a note should be improvised.
You can get slash marks for all notes by setting the
.Hr param.html#notehead
noteheads parameter.
.Ex
noteheads = "allslash"
.Ee
or if you want to use hollow slashes for half notes and longer
.Ex
noteheads = "slash"
.Ee
Usually such slash marks do not include a stem,
so you may wish to also set
.Ex
stemlen=0
.Ee
.P
If you just want specific chords to be slashes, you can use the
chord head shape override:
.Ex 1
.\" score leftmargin=2 ; rightmargin=2
.\" time=4/4n
.\" music
1: b;[ hs "allslash"; len 0 ]... ;;;
bar
.Ee
.Ht Breath marks
.Hd breathmk.html
.H 2 "Breath marks"
.P
A comma in a large font can be used as a breath mark.
.Ix jK
Something in the range of 20 to 30 points usually looks good;
you can adjust to your preference.
.Ex 1
.\" score
.\" leftmargin=1.5
.\" rightmargin=1.5
.\" music
.\"
1: c;d;2e;
rom (24) above all dist 0: 4.5 ",";
bar
1: e;d;2c;
bar
.Ee
.Ht Breaks
.Hd breaks.html
.H 2 "Breaks"
.P
As an alternate to a breath mark, sometimes a short vertical line is
drawn through the top line of the staff. Another thing that is sometimes
seen is something like a short bar line, just spanning the two middle spaces.
That might be used in music that wasn't originally written with true bar
lines. It might also be used to subdivide a bar,
when there are an odd number of beats, to show the intended grouping of beats.
These could be done using
.Hr macros.html
macros.
Here is one possible implementation. Note that you could apply to
multiple staffs by setting the STAFF argument to the list of desired staffs.
.Ex 1
// short vertical line through top line of staff
define BREAK(X,STAFF) rom above STAFF dist -2.3 ! : X "|"; @
// line spanning two middle spaces of the staff
define SB(X,STAFF)
rom above STAFF dist -7.2 ! : X "|";
rom above STAFF dist -5.8 ! : X "|";
@
.\" score
.\" rightmargin=2
.\" leftmargin=2
.\" music
1: f;g;a;c;
BREAK(1.5,1)
SB(3.5,1)
bar
.Ee
.Ht Organ pedal heel/toe marks
.Hd heeltoe.html
.H 2 "Organ pedal heel and toe marks"
.P
Mup does not include characters specially for the standard organ pedal
.Ix iD
heel and toe indications, but a U in helvetica font and the acc_hat
music symbol can be used. You may want to make them a bit smaller than
the default size, so defining macros for them may be useful.
.Ex 1
score
.\" leftmargin=2 ; rightmargin=2
clef = bass
// define strings for the organ pedal heel and toe marks
define HEEL "\es(-3)\ef(HB)U" @
define TOE "\es(-1)\e(acc_hat)" @
music
1: a-;b-;e;f;
rom below 1: 1 HEEL; 2 TOE;
rom above 1: 3 TOE; 4 HEEL;
bar
.Ee
.Ht Generating blank staff paper
.Hd muspaper.html
.H 2 "Generating blank staff paper"
.P
It is possible to use Mup to generate
.Ix iF
blank music staff paper.
You simply use an input file that contains
.Hr chordinp.html#measdur
measure spaces,
each ending with an
.Hr invisbar.html
invisbar.
You can control whether you want
.Hr param.html#clef
clefs,
.Hr param.html#time
time signatures,
.Hr param.html#brace
braces,
etc., and can control the spacing of staffs using
.Hr param.html#scoresep
the scoresep parameter.
Here is a simple input that will generate a page with 8 completely
blank staffs.
.Ex
score
scoresep=9,100 // spread staffs out nicely
stafflines=5n // don't print any clefs
label="" // make sure left edges line up both on first
label2="" // and on subsequent lines
topmargin=1 // allow extra margin to write in header/footer
bottommargin=1
time=4/4n // don't print any time signature
music
define SCORE
1: ms;
invisbar // no bar line at the end of the staff
@
define SCORE_NEWSCORE
SCORE
newscore
@
// print 8 staffs, with newscore between each
SCORE_NEWSCORE
SCORE_NEWSCORE
SCORE_NEWSCORE
SCORE_NEWSCORE
SCORE_NEWSCORE
SCORE_NEWSCORE
SCORE_NEWSCORE
SCORE
.Ee
.Ht Passing multiple coordinates to PostScript
.Hd pscoord.html
.H 2 "Passing multiple coordinates to PostScript"
.P
Now that Mup supports exporting tag information to
.Hr prnttext.html#postscript
user PostScript code,
this hint is probably mostly obsolete, but it may still be useful for
demonstrating how to do some unusual things.
.P
When you use a "postscript" section to add arbitrary PostScript code to
the Mup output, you specify a current point, but sometimes it would be
useful for the PostScript code to know about the location of more than
one thing on the page, for example, to draw a line between two points, or
to draw a box or oval around several chords. One way to do that is to
have one postscript section to save away the x,y values of each point of
interest, and then have a final postscript section that uses the points to
draw something. Since Mup puts the contents of postscript sections inside
a save/restore block, saving coordinate information for later use is a
little tricky, but the following example shows one way it can be done.
Earlier, in the
.Hr macros.html#arrow
section on macros,
we showed how to draw a line with an arrow using macros
and arithmetic expressions.
Here we will show how to accomplish a similar thing using a postscript section.
.vs -1
.Ex 1
score
staffs=2
.\" leftmargin=2 ; rightmargin=2
staff 2
clef=bass
music
1: c =c;r;e;f;
2: r;e =e;g;d;
// This PostScript saves the (X,Y) coordinate of a point
// near c in PostScript variables beginX and beginY
postscript (c.x + 3, c.y) "
% Save current point on the stack
currentpoint
% Since Mup did a save operation, move that save object
% to the top of the stack and do a restore,
% leaving the currentpoint values on the stack,
% so we can then save them in beginX and beginY.
3 -1 roll
restore
/beginY exch def
/beginX exch def
% Push a 'save' object for Mup's restore to use
save";
// This PostScript retrieves the beginX and beginY that were saved by the
// previous PostScript, along with the given current point coordinate,
// and from that, calculates and prints an arrow.
postscript (e.x - 3, e.y) "
% Similar to above, save the specified coord in endX and endY
currentpoint 3 -1 roll restore
/endY exch def /endX exch def
% Calculate length of the line, sin and cos to get arrowhead angle, etc.
/fullX endX beginX sub def /fullY endY beginY sub def
/fulllen fullX fullX mul fullY fullY mul add sqrt def
/cosine fullX fulllen div def /sine fullY fulllen div def
/headlen 15 def /headwidth 10 def
/headX headlen cosine mul def /headY headlen sine mul def
/hbX endX headX sub def /hbY endY headY sub def
/thicklen headwidth 2.0 div def
/thickX thicklen sine mul def /thickY thicklen cosine mul def
/feathupx hbX thickX sub def /feathupy hbY thickY add def
/feathdnx hbX thickX add def /feathdny hbY thickY sub def
% Make the arrow wide, a shade of red, and with rounded ends
gsave 3 setlinewidth 0.8 0.2 0.2 setrgbcolor 1 setlinecap
% Draw the line and its arrowhead lines
newpath beginX beginY moveto endX endY lineto stroke
newpath endX endY moveto feathupx feathupy lineto stroke
newpath endX endY moveto feathdnx feathdny lineto stroke
grestore
% Push a save object to match the one we undid earlier
save";
bar
.Ee
.vs +1
.Ht Printing braces
.Hd brace.html
.H 2 "Printing braces"
.P
Mup prints braces to the left of scores via the
brace parameter,
but it may sometimes be desired to print a brace somewhere else,
and have it scale appropriately for its height.
This can be done using an escape to PostScript.
Here is a macro definition that can be used to print a brace,
and an example of how to use it:
.Ex 1
// brace expects an x value and bottom and top y values
define BRACE(TOP, BOTTOM)
postscript (TOP.w - 1, BOTTOM.s) with _top.y = TOP.n "
currentpoint Mup_top.y brace"
@
score
.\" leftmargin=2 ; rightmargin=2
staffs=2
music
1: c+ =_t;;;;
2: c =_b;;;;
BRACE(_t, _b)
bar
.Ee
.P
A somewhat more complicated version, which would print a string before the
brace, might be:
.Ex 1
define BRACE(TOP, BOTTOM, STRING)
postscript (TOP.w - 1, BOTTOM.s) with _top.y = TOP.n "
currentpoint /yloc exch def /xloc exch def
currentpoint Mup_top.y brace
/TimesRoman findfont 12 scalefont setfont
xloc 7.5 sub (" + STRING + ") stringwidth pop sub
yloc Mup_top.y add 2 div 1.5 sub moveto (" + STRING +") show"
@
score
.\" leftmargin=1.7 ; rightmargin=1.7
staffs=2
music
1: [pad 10] c+ =_t;;;;
2: c =_b;;;;
BRACE(_t, _b, "Label")
bar
.Ee
.P
That still wouldn't handle things like special characters in the string,
or different font sizes, but could handle simple cases, and be a starting
point for more complicated ones.
.Ht Converting Mup files to other formats
.Hd pstools.html
.H 2 "Converting Mup files to other formats"
.P
Since Mup generates PostScript, almost any PostScript tool can be used
on its output. In particular, the "ps2pdf" tool that comes with Ghostscript can
convert Mup output to PDF format, and the "ps2epsi" tool, which also
comes with Ghostscript, converts a PostScript file to an Encapsulated
PostScript (EPS) file. Many text processing and graphics programs will
let you import EPS files, so this can let you insert Mup output into
some other document.
.P
There is a "psutils" package, available from most Linux archives,
that contains various Postscript tools. These include "psnup," which lets
you print multiple pages on one sheet of paper with more flexibility
than Mup's
.Hr param.html#panels
panelsperpage parameter,
and "psselect," which prints a subset of pages.
.P
You can check the
.Hr http://www.arkkra.com/doc/userpgms.html
user-donated programs page on Arkkra's website
for other programs for processing Mup input or output.
.Ht Mup MIDI output
.Hd midi.html
.H 1 "MIDI OUTPUT"
.H 2 "Basic information"
.P
.Ix aA
Mup will optionally produce MIDI output
.Hr cmdargs.html#moption
(using the -m or -M command line argument).
.Ix bN
Mup is first and foremost a music publication program,
so its MIDI capabilities have a few limitations.
However, the MIDI output is quite useful for "proofreading"
(or perhaps we should say "proof-listening").
It is often easier to spot a typo in Mup input by
listening to it than to look at the output. Mup provides enough MIDI
control to do virtually all of what MIDI supports, and will be adequate
for many people. Others, however, may find they want a separate MIDI editor
for really serious MIDI work.
.P
The following section assumes a general knowledge of MIDI. If you are not
familiar with MIDI, there are many books available on the subject
at most music stores or computer book stores.
There are also many online resources and tutorials.
You could start at
.Hi
http://www.midi.org
.He
.ig
.Hr http://www.midi.org
http://www.midi.org
..
or use your favorite search engine.
.P
Each
.Hr param.html#vscheme
voice
.Ix bF
is put on a separate MIDI track. The first track contains
.Ix cI
.Ix gU
general information such as key and time signature. The next track will be for
staff 1, voice 1. If staff 1 has a second voice, that will be the next
.Ix hK
track, otherwise it will be voice 1 of staff 2, if any, and so forth,
one track for each voice, top to bottom.
.Ix gM
.Ix gN
.P
Output is in MIDI file format 1, with a default of 120 quarter notes
per minute, 192 ticks per quarter note. MIDI channel 1 is used by default for
all voices. If you want to use different instrument sounds for different
voices, you will need to specify a different channel for each voice, then
specify the MIDI "program" for that voice. This is demonstrated in some
of the examples later in this section.
.Ix cK
.Ix hL
.P
Mup MIDI output will handle
.Hr bars.html
repeats
.Ix dZ
and
.Hr bars.html#endings
first and second endings,
.Ix aR
but it does not know anything about "D.S. al coda" or anything of that sort.
.Ix hN
It is possible to work around this limitation to some extent using
.Hr macros.html
macros.
.Ix aM
For example, a section between a "sign" and a "jump to coda" symbol could
be put inside a macro definition; then the macro can be called. Then later
in the piece, where the "D. S." occurs, the macro can be called again if MIDI
is defined. For example:
.Ex
// an introductory section, ends with a sign
1: c;d;e;f;
mussym above all: 5 "sign";
bar
// define macro for section between sign and
// symbol to "jump to coda"
define SECTION
1: g;a;g;;
mussym above all: 5 "coda";
bar
@
// print/play the section just defined by
// the macro
SECTION
// now do the music up to the D.S.
1: e;f;2g;
ital above 1: 1 "D. S. al Coda";
dblbar
// human player would now flip back to
// the sign, so do the MIDI equivalent:
// play that section again.
ifdef MIDI
SECTION
endif
// now do the coda
1: e;d;2c;
rom above 1: 0 "Coda";
endbar
.Ee
.Ix aN
.P
Mup mainly just outputs the note information.
Mup will recognize
.Hr octave.html
octave marks,
.Ix gA
.Ix hL
and move notes up or down appropriately.
It recognizes
.Hr pedal.html
piano pedal marks.
.Ix fL
It does not attempt to interpret tempo or dynamics marks
.Ix cH
.Ix fR
.Ix fS
specified by
.Hr textmark.html
\&"rom," "boldital," etc. or ornaments in
.Hr mussym.html
\&"mussym" statement.
.Ix fT
It does not handle ties to a different voice.
It does interpret
.Hr bars.html#reh
rehearsal marks
.Ix aQ
as cue points.
It handles
.Hr chrdattr.html#chstyle
grace notes,
.Ix aL
.Hr roll.html
rolls,
.Hr chrdattr.html#slashes
slashes,
.Ix cA
and
.Hr ichdattr.html#alt
alternation groups.
.Ix aZ
You can control how legato the music is by using
.Hr param.html#release
the Mup "release" parameter.
.P
Some styles of music are often
.Ix jH
written in "swing time," meaning the
players are expected to play pairs of notes with the first twice
as long as the second, even though they are written as if they were the
same duration, or as if the first were three times as long as the second.
The most common example would be where the written notation shows
two eighth notes like 8;; or a dotted rhythm like 8.;16;
but the musician "knows" that the composer really intended it
to be played as if it were a triplet {4;8;}3;
The
.Hr param.html#swing
swingunit
parameter can be used to get Mup MIDI output to automatically follow
that performance convention.
.P
A separate MIDI editing program may be useful
for adding really complicated effects,
but it is possible to specify MIDI directives to do almost anything you want.
They are of the form:
.Ex
\fBmidi\fP \fIS V\fP\fB:\fP \fIbegintime "keyword=value";\fP
.Ee
.Ix dK
The \fIS\fP and \fIV\fP specify the staff and voice for which the directive is
.Ix hK
to apply. As elsewhere in Mup, an omitted voice will default to voice 1,
and both staff and voice can be given as a list.
Certain keywords apply to the entire score. In that case the form
.Ix cQ
.Ix hJ
.Ex
\fBmidi all:\fP \fIbegintime "keyword=value";\fP
.Ee
is used instead.
The items specified using "all" are placed on the first track, the track
containing score-wide information. They are not applied to the
voices on the other tracks.
.P
The \fIbegintime\fP, as elsewhere in Mup,
gives the beat into the measure where the MIDI output is to be placed.
.Ix dJ
.Ix hG
If notes are to be turned on or off at the same instant in time as the
\fIbegintime\fP, first all "note off" commands are generated, then the "midi"
command events, then "note on" commands.
.P
The \fIkeyword=value\fP gives specific information of
what MIDI output to generate. The following keywords are currently supported:
.Hi
.DS
.He
.ft R
.TS
c c c c c
l l l c c.
\fBkeyword\fP \fBvalues\fP \fBmeaning\fP \fBmidi S V\fP \fBmidi all\fP
_
program 0-127 program change (new instrument) yes no
parameter 0-127,0-127 parameter yes yes
.Ix cK
channel 1-16 channel yes no
chanpressure 0-127 channel pressure (after touch) yes yes
.Ix cH
tempo 10-1000 tempo, quarter notes per minute no yes
seqnum 0-65535 sequence number yes yes
text text text meta event yes yes
.Ix bO
copyright text copyright notice yes yes
name text sequence/track name yes yes
instrument text instrument name yes yes
marker text marker meta event yes yes
cue text cue point yes yes
port 0-127 MIDI port yes yes
.Ix cN
onvelocity 1-127 note on velocity yes no
offvelocity 0-127 note off velocity yes no
hex hex data arbitrary MIDI data yes yes
.TE
.Hi
.DE
.He
.P
The keywords can be abbreviated to their first three or more letters,
except "chanpressure" which requires at least five letters to differentiate
it from "channel" ("cha" or "chan" will be interpreted as channel).
In most cases, the "=" is followed by either a number or some text. Exceptions
to this are discussed in the next few paragraphs.
.P
The "parameter" keyword is followed by two numbers, separated by a comma.
.Ix aD
The first is the parameter number, the second is the parameter value.
Thus to set parameter 7 (which is the volume parameter) to 90 for voice
2 of staff 3, starting at the beginning of the measure, you can use:
.Ex
midi 3 2: 0 "parameter=7,90";
.Ee
.P
The "onvelocity" and "offvelocity" keywords can have one or more values,
separated by commas. If there is only one value, it applies to all notes
in each chord. If there is more than one value, the first value applies
to the top note of the chord, the second value to the second-from-the-top
note, and so forth. If there are more notes in a chord than there are
values specified, the last value specified applies to all of the remaining
notes. So, for example, if you want to emphasize the top note of each
chord because it is the melody, you can specify two values, as in
.Ex
midi 1: 1 "onvelocity=76, 60";
.Ee
which would cause the top note to have a velocity of 76 and all other
notes to have a velocity of 60.
.P
The "hex" form can be used to insert any arbitrary MIDI data into
the MIDI file. The value consists of any even number of hexadecimal digits.
Spaces and tabs can be included in the value field for readability.
.P
Note that Mup uses the MIDI standard,
which numbers instruments from 0 through 127,
but some MIDI playback programs follow a convention of numbering them
from 1 through 128.
.P
Here are some examples:
.Ex
midi all: 0 "tempo=72";
midi 1-2 1-2: 0 "channel=2"; 0 "program=14"; 3.5 "program=76";
midi all: 3 "hex= ff 00 02 00 01"; // sequence number 1
midi 3,6: 0 "channel=5"; 0 "prog=15"; 0 "instr=dulcimer";
// set parameter 7 (usually volume) to 100
midi 2: "par = 7, 100";
.Ee
.P
Here is a more extensive example of how midi commands might be used
in a song:
.Ex
score
staffs=2
vscheme=2o
staff 2
clef=bass
voice 2 2
// Make the bottom voice more staccato
release=50
music
// Set the tempo.
// Start out at 108 quarter notes per minute,
// but on count 4, slow down to 96 per minute.
midi all: 0 "tempo=108"; 4 "tempo=96";
// Put each voice on a different channel
// using a different instrument sound.
// The program numbers correspond to the
// General MIDI sounds as noted.
midi 1 1: 0 "channel=1"; 0 "program=68"; //oboe
midi 1 2: 0 "channel=2"; 0 "program=11"; //vibraphone
midi 2 1: 0 "channel=6"; 0 "program=60"; //french horn
midi 2 2: 0 "channel=4"; 0 "program=35"; //fretless bass
// Make the top voice louder, and put an
// accent on the third beat
midi 1 1: 0 "onvelocity=86"; 3 "onvelocity=100"; 4 "onvel=86";
// Set maximum reverb on french horn part,
// starting at the second beat.
// (Reverb is parameter 91)
midi 2 1: 2 "parameter=91, 127";
// Set chorus on oboe to 75, from the beginning.
// (Chorus is parameter 93)
midi 1 1: 0 "param=93, 75";
// Pan the bass part to middle of left side.
// (Pan is parameter 10, with a value of 0 being hard left,
// 64 in the center, and 127 being hard right, so 32 is
// half way to the left.)
midi 2 2: 0 "parameter=10, 32";
// Now the music to be played...
1 1: e;d;2c;
1 2: c;b-;2g-;
2 1: g;f;2e;
2 2: c;g-;2c;
bar
.Ee
.Ht Gradual MIDI changes
.Hd gradmidi.html
.H 2 "Gradual MIDI changes"
.P
Often you may like to have gradual changes in things like tempo or volume
or onvelocity. You can, of course, tell Mup exactly what you want for each
individual note, but you can also just specify beginning and ending values
and optionally some intermediate values, and Mup will do interpolation,
creating as many midi commands as necessary to produce smooth gradual changes.
.P
As a common example, suppose you want to do a ritard. You could do
something like:
.Ex
midi all: 3 "tempo=120 to 96" til 1m+4;
.Ee
This would start the tempo at 120 quarter notes per minutes at beat 3 of
the current measure and ritard to 96 per minutes at beat 4 of the following
measure. If only two values are given, as in that example, the change is
done linearly, but you can also specify multiple points that make up a curve.
The curve is divided into equal segments: if there are three points, it will
be treated as two equal segments; if four points, as three segments, etc.
As an example, you could slow down and then speed back up:
.Ex
midi all: 2 "tempo = 112 to 92 to 112" til 2m+4;
.Ee
or increase onvelocity slowly at first and then more so:
.Ex
midi 1: 1 "onvelocity= 40 to 50 to 70 to 105" til 4.5;
.Ee
.P
Changes in time signature are not allowed during a single gradual change,
because it may not be entirely clear what is wanted in that case.
So you have to tell Mup what you want by starting a new gradual change
at each time signature change.
.P
Note that all midi commands must either include both a "to" and a "til"
or neither. The to/til are only allowed on midi commands where the
values are numbers, namely channel, chanpressure, offvelocity, onvelocity,
parameter, port, program, and tempo.
Note that a few of those may be of rather dubious usefulness,
particularly channel and port, and perhaps program.
For a parameter, the parameter number is specified just once, as in:
.Ex
midi 1: 1 "parameter=7, 40 to 60 to 70 to 90 to 65" til 4.5;
.Ee
In the case on onvelocity or offvelocity, the items between "to" can be
lists that work like those without "to," with the first applying to the
top note, and so forth. The number of comma-separated items does not need
to be the same in all lists, since the last value in each list will apply
to any remaining notes. So to play a C major chord, accenting each note
in turn from bottom to top, you could do:
.Ex
midi 1: 1 "onvelocity=60,60,60,120 to 60,60,120,60 to 60,120,60 to 120,60" til 4;
1: cegc+;;;;
bar
.Ee
.Hi
.H 1 CONCLUSION
.P
.ig
.\" special flag to tr2html to not process Ix items
.Nx
..
The Mup program provides a convenient way to produce high-quality
musical scores. We hope you enjoy using it.
.Ix hJ
Appendix A gives a sample input file, demonstrating many of the features
of Mup. You can download additional sample songs from the Arkkra Enterprises
website listed below.
The website also includes several programs written by Mup users
that may make Mup even more useful for you.
Once you've used Mup for a while, you may find the Quick
Reference helpful for remembering details of the Mup language.
.P
If you have comments or questions, please contact:
.Ix aF
.Ix bM
.in +1i
Arkkra Enterprises
.sp
support@arkkra.com
.sp
http://www.arkkra.com
.in -1i
.SK
\ \ \
.sp 3i
.ps 16
.ft B
.ce
Appendix A
.sp 3
.ce
Example of a Mup input file
.ft P
.ps 10
.Ex 1
//!Mup-Arkkra
// sample of a Mup input file
header
title (18) "The Star Spangled Banner"
title ital (12) "(The United States National Anthem)"
title (9) "Text: Francis Scott Key" "Tune: J. S. Smith"
title (9) "" "arr: William J. Krauss"
score
topmargin = 0.5
bottommargin = 0.5
leftmargin = 0.65
rightmargin = 0.65
scale = 0.65
packfact = 1.3
key = 3#
time = 3/4
staffs = 2
brace = 1-2
barstyle = 1-2
measnum = y
vscheme = 2o
beamstyle = 4,4,4
endingstyle = top
staff 2
clef = bass
define LYRICS lyrics between 1&2: @
music
// Starts on a pickup, so use space
// at beginning of measure.
// Voices are in unison for the first
// few notes, so specify two voices
// at once.
1 1-2: 2s; 8.e<>; 16c;
2 1-2: 2s; 8.e<>; 16c;
LYRICS 2s; 4; [1] "Oh_";
// Since the first two sections are
// almost the same, use a repeat
repeatstart
1 1: a-; c; e;
1 2: a-; c; b-;
2 1: a-; a; b;
2 2: a-; a; g;
LYRICS [1] "say. can you"; \e
[2] "stripes and bright";
bar
1 1: 2a; 8.c+; 16b;
1 2: 2c; 8.; 16;
2 1: 2a; 8.g; 16;
2 2: 2f; 8.e#; 16;
LYRICS [1] "see, by the"; \e
[2] "stars, through the";
bar
1 1: a; c; d#;
1 2: c; ; b-;
2 1: a; ; ;
2 2: f; ; b-;
LYRICS [1] "dawn's ear-ly"; \e
[2] "per-il-ous";
bar
1 1: e; r; 8e; ;
1 2: b-; r; 8b-; ;
2 1: g; r; 8g; ;
2 2: e; r; 8e; ;
LYRICS [1] "light what so"; \e
[2] "fight, o'er the";
bar
1 1: 4.c+; 8b; 4a;
1 2: 4.e; 8; 4;
2 1: 4.a; 8g; 4a;
2 2: 4.a-; 8b-; 4c;
LYRICS [1] "proud-ly we"; \e
[2] "ram-parts we";
bar
1 1: 2g; 8.f; 16g;
1 2: 2e; 8.; 16;
2 1: 2b; 8.; 16;
2 2: 2e; 8.d; 16;
LYRICS [1] "hailed, At the"; \e
[2] "watched, were so";
bar
1 1: a; ; e;
1 2: e; ; ;
2 1: a; ; e;
2 2: c; ; e;
LYRICS [1] "twi-light's last"; \e
[2] "gal-lant-ly";
bar ending "1."
1-2 1-2: c; 8a-; r; 8.e; 16c;
LYRICS [1] "gleam-ing, whose broad";
repeatend ending "2."
1 1: c; 8a-; r; 8.c+; 16;
1 2: c; 8a-; r; 8.e; 16;
2 1: c; 8a-; r; 8.a; 16;
2 2: c; 8a-; r; 8.a-; 16;
LYRICS [2] "stream-ing? And the";
bar endending
1 1: c+; d+; e+;
1 2: e; ; ;
2 1: a; b; c+;
2 2: a-; ; ;
// continue to mark as verse 2 from now on,
// so that the lyrics will line up properly
// with the lyrics of the second ending.
LYRICS [2] "rock-ets' red";
bar
// Define a mapping, and use the chord-at-a-time input method for the
// next several measures. Specify the voices in bottom to top order.
define M [ 2 2; 2 1; 1 2; 1 1 ] @
M: a-c+ee+; rrrr; 8a-bed+; a-aec+;
LYRICS [2] "glare, the bombs";
bar
M: egeb; egec+; eged+;
LYRICS [2] "burst-ing in";
bar
M: eged+; rrrr; eged+;
LYRICS [2] "air, gave";
bar
M: 4.a-aec+; 8b-geb; 4caea;
LYRICS [2] "proof through the";
bar
M: 2ebeg; 8.ebdf; 16ebdg;
LYRICS [2] "night that our";
bar
M: faca; facc; b-ab-d#;
LYRICS [2] "flag was still";
bar
M: egb-e; rrrr; egb-e;
LYRICS [2] "there. Oh";
bar
1 1: 4a; ; 8<>; g;
1 2: 4c; b-; 4a-;
2 1: e; ; ;
2 2: a-; b-; c;
LYRICS [2] "say, does that";
bar
1 1: f; ; ;
1 2: d; ; e;
2 1: a; ; a#;
2 2: d; ; c;
LYRICS [2] "star-span-gled";
bar
1 1: 4b; 8d+<>; c+; b<>; a;
1 2: 4d; 4f; ;
2 1: b; 8<>; a#; b<>; b#;
2 2: b-; 8<>; c; d<>; d#;
LYRICS [2] "ban-ner yet";
bar
mussym(12) 1-2: 2 "ferm";
1 1: a<>; 8g; r; e; ;
1 2: 4.e; 8r; e; ;
2 1: c+<>; 8b; r; g; ;
2 2: 4.e; 8r; d; ;
LYRICS [2] "wave_ o'er the";
bar
1 1: 4.a<>; 8b; c+; d+;
1 2: 4.e<>; 8; ; ;
2 1: 4.a<>; 8g; a; ;
2 2: 4.c<>; 8e; a-; b-;
LYRICS [2] "land_ of the";
bar
mussym(12) 1-2: 1 "ferm";
1 1: e+; r; 8a; b;
1 2: e; r; 8d; ;
2 1: a; r; 8a; ;
2 2: c; r; 8f; fn;
LYRICS [2] "free and the";
bar
1 1: 4.c+; 8d+; 4b;
1 2: 4.e; 8; 4d;
2 1: 4.a; 8; 4g;
2 2: 4.e; 8; 4;
LYRICS [2] "home of the";
bar
1 1: 2a; 4s;
1 2: 2c; 4s;
2 1: 2e; 4s;
2 2: 2a-; 4s;
LYRICS [2] "brave?";
endbar
.Ee
.br
.ne 4i
.ce
.He
INDEX
.sp
.nf
.na
.ta 6iR
above\*(bJ
accents\*(bK
accidentals\*(bL
adjusting output\*(cP
alignment of lyrics\*(hT
alignment of text\*(iP
all\*(cQ
alternation\*(aZ
analysis\*(iM
angle brackets\*(dX
arguments, command line\*(bN
Arkkra Enterprises\*(bM
backslash\*(bC
backspace\*(bI
bar\*(gG
barstyle\*(dD
beaming\*(bA
beamstyle\*(dE
beats\*(dJ
begintime\*(dK
below\*(dL
bend\*(hW
between\*(dM
block\*(jC
bold\*(gH
boldital\*(gI
bottom\*(gN
bottommargin\*(gO
boxed text\*(iG
brace\*(dV
bracket\*(dW
breath marks\*(jK
cadenza\*(iZ
cancelkey\*(iI
capo\*(hV
center\*(cV
channel\*(cK
chant\*(iK
chord\*(gW
chorddist\*(dO
circled text\*(iG
clef\*(fI
coda\*(hN
command line arguments\*(bN
comments\*(aF
concatenate strings\*(jM
contexts\*(fQ
copyright\*(bO
crescendo\*(cL
cross-staff beams\*(iC
cross-staff stems\*(jI
cue notes\*(bB
_cur tag\*(jP
curve\*(fD
custom beaming\*(dI
dashed line\*(fF
dashed ties and slurs\*(iJ
debugging\*(aP
decrescendo\*(cM
define\*(cS
defoct\*(cU
diacritical marks\*(cR
diamond-shaped notes\*(bT
diminished\*(iQ
dist\*(fK
division\*(bR
dotted line\*(fG
dotted note\*(gX
dotted ties and slurs\*(iJ
drum clef\*(iE
D. S.\*(hN
duration\*(fP
dynamics\*(fR
east\*(dA
endings\*(aR
endingstyle\*(dG
error messages\*(hF
even pages\*(dC
figured bass\*(iN
flags\*(dH
flat\*(fC
font\*(bG
fontfamily\*(gB
footer\*(aT
fret\*(hZ
Ghostscript\*(cE
glissando\*(bQ
grace notes\*(aL
grids\*(iW
guitar\*(hY
header\*(aS
heel\*(iD
hidechanges\*(hR
ifdef\*(aN
improvisation\*(iY
include\*(aO
invisbar\*(fH
italics\*(gK
justification\*(dN
key signature\*(cG
keymap\*(jL
labels\*(dP
.\" left\*(cW
leftmargin\*(gQ
legato\*(bV
length\*(iB
line\*(fE
lyrics\*(aE
lyricsalign\*(hT
macros\*(aM
manual placement\*(fU
map\*(iV
margin\*(gS
measure\*(hG
measure numbers\*(dY
measure repeat\*(hE
measure rest\*(hD
MIDI\*(aA
mid-measure parameter changes\*(jF
mordent\*(gD
mouse\*(cX
MS-DOS\*(aI
multirest\*(aW
mupdisp\*(aG
mupprnt\*(aH
music context\*(hM
mussym\*(fT
neutral clef\*(iE
newpage\*(cC
newscore\*(cD
north\*(cY
notes\*(hL
numbering pages\*(aU
octave\*(gA
odd pages\*(dC
ornaments\*(fS
packexp\*(dU
packfact\*(dT
padding\*(bD
_page tag\*(jN
page footer\*(aT
page header\*(aS
pageheight\*(hP
page number\*(aU
pagewidth\*(hQ
paragraph\*(jD
parameters\*(aD
parentheses\*(iA
pedal\*(fL
pedstyle\*(dS
percussion\*(bW
phrase\*(fJ
piano reduction\*(iU
pickup measure\*(aV
piled text\*(iO
pitch\*(fM
PostScript\*(cF
print\*(hA
quoting\*(iT
reduction\*(iU
rehearsal marks\*(aQ
release\*(jE
repeat\*(dZ
rest\*(hC
restart\*(iS
.\" right\*(fY
rightmargin\*(gR
roll\*(aY
roman\*(gJ
scale\*(fV
_score tag\*(jQ
score\*(hJ
scorepad\*(dQ
scoresep\*(dR
scrolling\*(bZ
semicolon\*(hH
shaped notes\*(jG
sharp\*(fC
size\*(bH
slash\*(cA
slide\*(hX
slope\*(jJ
slur\*(cB
small\*(gY
south\*(cZ
space\*(gZ
spacing(see padding)
staccato\*(bU
_staff tags\*(jR
staff\*(hK
staff paper\*(iF
stafflines\*(fX
staffpad\*(jA
staffsep\*(fA
stem\*(hI
stem direction\*(iH
stem length\*(iB
stepsize\*(fO
strings\*(hB
strum\*(iY
subscript/superscript\*(iL
swing time\*(jH
syllable\*(gF
sylposition\*(jB
tablature\*(hU
tag\*(bE
tempo\*(cH
text strings\*(hB
tie\*(aK
til\*(gV
time\*(gT
time signature\*(gU
timeunit\*(cT
title\*(gC
toe.\*(iD
top\*(gM
topmargin\*(gP
track\*(cI
transpose\*(fB
trill\*(bX
triplets(see tuplets)
tuplets\*(aX
turn\*(gE
uncollapsible space\*(iX
undef\*(bY
underline\*(hO
underscore\*(fW
units\*(hS
UNIX\*(aJ
velocity\*(cN
verse\*(cJ
visible\*(gL
voice\*(bF
vertical motion\*(iR
vscheme\*(cO
wavy lines\*(dF
west\*(dB
_win tag\*(jO
with\*(fZ
X-shaped notes\*(bS
.\" next string to use is jS
.fi
.ad
.if \n(.g \X'ps: exec %-marker2-'
.TC 1 1 3
| 27.610625 | 197 | 0.743157 |
ed11af24bd52c85282c4c1e5dab0c54c33951358 | 489 | t | Perl | t/apocalypse.t | gitpan/POE-Component-SSLify | 979d24c36f1647fe5d03f5f162beb0502b982d15 | [
"Artistic-1.0"
] | null | null | null | t/apocalypse.t | gitpan/POE-Component-SSLify | 979d24c36f1647fe5d03f5f162beb0502b982d15 | [
"Artistic-1.0"
] | null | null | null | t/apocalypse.t | gitpan/POE-Component-SSLify | 979d24c36f1647fe5d03f5f162beb0502b982d15 | [
"Artistic-1.0"
] | null | null | null | #!perl
#
# This file is part of POE-Component-SSLify
#
# This software is copyright (c) 2014 by Apocalypse.
#
# This is free software; you can redistribute it and/or modify it under
# the same terms as the Perl 5 programming language system itself.
#
use strict; use warnings;
use strict; use warnings;
use Test::More;
eval "use Test::Apocalypse 1.000";
if ( $@ ) {
plan skip_all => 'Test::Apocalypse required for validating the distribution';
} else {
is_apocalypse_here( {
} );
}
| 22.227273 | 78 | 0.713701 |
ed5cd5e41ff00cdda3263309593c499a8dad61e9 | 9,958 | pl | Perl | bin/prepare_evm_calls_from_maker_output.pl | genomecuration/JAM | 8b834d3efe32f79c48887c2797005619ac2c3a1d | [
"BSD-3-Clause"
] | null | null | null | bin/prepare_evm_calls_from_maker_output.pl | genomecuration/JAM | 8b834d3efe32f79c48887c2797005619ac2c3a1d | [
"BSD-3-Clause"
] | null | null | null | bin/prepare_evm_calls_from_maker_output.pl | genomecuration/JAM | 8b834d3efe32f79c48887c2797005619ac2c3a1d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env perl
=pod
=head1 USAGE
Use EVM to call new Maker models
Mandatory:
-maker_output_dir :s Directory that hosts maker output
-genome :s FASTA file with genome sequences
Optional:
-weights :s A weight file for EVM. Defaults created
-verbose Be slighly verbose
=head1 AUTHORS
Brian Haas, Alexie Papanicolaou
=cut
use strict;
use warnings;
use Getopt::Long;
use Pod::Usage;
use POSIX qw(ceil);
use FindBin qw($RealBin);
use lib ("$RealBin/../PerlLib");
$ENV{PATH} .= ":$RealBin:$RealBin/../3rd_party/bin/:$RealBin:$RealBin/../3rd_party/evidencemodeler/";
use Gene_obj;
use Gene_validator;
my ( $maker_dir, $genome_sequence, $evm_weights_file, $debug );
my %allowed_types =
( 'augustus_masked' => 1, 'genemark' => 1, 'snap_masked' => 1 );
my $outdir = 'maker_output.' . $$;
my ($evm_exec) = &check_program("evidence_modeler.pl");
pod2usage $! unless GetOptions(
'maker_output_dir:s' => \$maker_dir,
'genome:s' => \$genome_sequence,
'weights' => \$evm_weights_file,
'debug|verbose' => \$debug
);
pod2usage "Cannot find $maker_dir\n" unless $maker_dir && -d $maker_dir;
pod2usage "No genome provided...\n"
unless $genome_sequence && -s $genome_sequence;
$evm_weights_file = &create_evm_weights()
unless -s $evm_weights_file && $evm_weights_file;
mkdir $outdir unless -d $outdir;
my $maker_gff = $maker_dir . '.gff';
&process_cmd("find . -name '*.gff' -exec cat '{}' \+ | cut -s -f 1-9 | grep -vP '\tcontig\t1' > $maker_gff");
open( IN, $maker_gff ) || die;
my %hash;
while ( my $ln = <IN> ) {
next if $ln =~ /^#/;
my @data = split( "\t", $ln );
next unless $data[8];
$ln = "\n" . $ln if $data[2] eq 'gene';
push( @{ $hash{ $data[1] } }, $ln );
}
close IN;
my (@abinitio_files);
foreach my $type ( keys %hash ) {
open( OUT, ">$outdir/$type" );
foreach my $ln ( @{ $hash{$type} } ) {
print OUT $ln;
}
close OUT;
next unless $allowed_types{$type};
my $gene_gff = &maker_match_gff_to_gene_gff3("$outdir/$type");
push( @abinitio_files, $gene_gff );
}
%hash = ();
open( OUTGP, ">$outdir/gene_predictions.gff3" );
foreach my $file (@abinitio_files) {
open( IN, $file );
while ( my $ln = <IN> ) {
print OUT $ln;
}
print "\n";
close IN;
}
close OUTGP;
my $evm_output = $outdir . '/evm.out';
&process_cmd( $evm_exec
. " --gene_predictions $outdir/gene_predictions.gff3 "
. " --transcript_alignments $outdir/est2genome.gff "
. " --protein_alignments $outdir/protein2genome.gff "
. " --weights $evm_weights_file "
. " --genome $genome_sequence "
. " --trellis_search_limit 200 "
. " > $evm_output " );
print "Done.\n See $evm_output\n\n";
##########################################################
sub read_fasta() {
my $fasta = shift;
my %hash;
my $orig_sep = $/;
$/ = '>';
open( IN, $fasta ) || confess( "Cannot open $fasta : " . $! );
while ( my $record = <IN> ) {
chomp($record);
next unless $record;
my @lines = split( "\n", $record );
my $id = shift(@lines);
my $seq = join( '', @lines );
$seq =~ s/\s+//g;
if ( $id && $seq && $id =~ /^(\S+)/ ) {
$hash{$1} = $seq;
}
}
close IN;
$/ = $orig_sep;
return \%hash;
}
sub evm_to_gff_gtf() {
my $evm_file = shift;
my $genome_sequences_hashref = &read_fasta($genome_sequence);
open( GFFOUT, ">$evm_file.gff" );
open( GTF, ">$evm_file.gtf" );
foreach my $contig_id ( keys @{$genome_sequences_hashref} ) {
my ( %model_num_to_coords, %model_id_to_ev_type, %end5_to_phase );
my $model_id = 1;
open( my $fh, $evm_file ) or die "Error, cannot open $evm_file\n";
while (<$fh>) {
if (/^\!/) { next; } ## comment line
if (/^\#/) {
my $ev_type;
if (/ELIMINATED/) {
$ev_type = "EVM_elm";
}
else {
$ev_type = "EVM";
}
$model_id_to_ev_type{$model_id} = $ev_type;
next;
}
chomp;
unless (/\w/) {
$model_id++;
next;
}
my @x = split(/\t/);
if ( scalar(@x) == 6 && $x[0] =~ /^\d+$/ && $x[1] =~ /^\d+$/ ) {
if ( $x[2] eq 'INTRON' ) { next; }
my $coords_ref = $model_num_to_coords{$model_id};
unless ( ref $coords_ref ) {
$coords_ref = $model_num_to_coords{$model_id} = {};
}
$coords_ref->{ $x[0] } = $x[1];
$end5_to_phase{ $x[0] } = $x[3];
}
}
close $fh;
my %phase_conversion = (
1 => 0,
2 => 1,
3 => 2,
4 => 0,
5 => 1,
6 => 2
);
my @gene_objs;
foreach my $model_id ( sort { $a <=> $b } keys %model_num_to_coords ) {
my $ev_type = $model_id_to_ev_type{$model_id};
# if ($ev_type ne "EVM") { next; } #ignoring the EVM_elm for now.
my $coords_ref = $model_num_to_coords{$model_id};
my $gene_obj = new Gene_obj();
$gene_obj->populate_gene_obj( $coords_ref, $coords_ref );
## set phase:
foreach my $exon ( $gene_obj->get_exons() ) {
my $cds_obj = $exon->get_CDS_obj();
my ( $end5, $end3 ) = $cds_obj->get_coords();
$cds_obj->set_phase( $phase_conversion{ $end5_to_phase{$end5} } );
}
$gene_obj->{Model_feat_name} = "evm.model.$contig_id.$model_id";
$gene_obj->{TU_feat_name} = "evm.TU.$contig_id.$model_id";
$gene_obj->{com_name} = "EVM prediction $contig_id.$model_id";
$gene_obj->{asmbl_id} = "$contig_id";
print GFFOUT $gene_obj->to_GFF3_format( source => $ev_type ) . "\n";
my $gtf_text = "";
eval {
$gtf_text =
$gene_obj->to_GTF_format( \$genome_sequences_hashref->$contig_id );
};
if ($@) {
# do it in pseudogene mode - if not then UTR is printed as CDS... not good!
$gene_obj->{is_pseudogene} = 1;
$gtf_text =
$gene_obj->to_GTF_format( \$genome_sequences_hashref->$contig_id );
}
print GTF "$gtf_text\n";
}
}
close GFFOUT;
close GTF;
}
sub process_cmd {
my ($cmd) = @_;
print "CMD: $cmd\n" if $debug;
my $ret = system($cmd);
if ( $ret && $ret != 256 ) {
die "Error, cmd died with ret $ret\n";
}
return $ret;
}
sub check_program() {
my @paths;
foreach my $prog (@_) {
my $path = `which $prog`;
die "Error, path to required $prog cannot be found\n"
unless $path =~ /^\//;
chomp($path);
#$path = readlink($path) if -l $path;
push( @paths, $path );
}
return @paths;
}
sub splitfasta() {
my @files;
my $file2split = shift;
my $outdir = shift;
my $how_many_in_a_file = shift;
my $pattern = shift;
my $shuffle = shift;
return unless $file2split && -s $file2split && $outdir && $how_many_in_a_file;
return if -d $outdir;
mkdir($outdir) unless -d $outdir;
my $filecount;
my $seqcount = int(0);
my $shuffled_file = $shuffle ? &shuffle_fasta($file2split) : $file2split;
open( FILE, $shuffled_file ) || die;
my $orig_sep = $/;
$/ = ">";
while ( my $record = <FILE> ) {
chomp($record);
next unless $record;
my @lines = split( "\n", $record );
my $id = shift @lines;
next if ( $pattern && $id !~ /$pattern/ );
$id =~ /^(\S+)/;
$id = $1 || die "Cannot find ID for a sequence in $file2split";
chomp(@lines);
my $seq = join( '', @lines );
$seq =~ s/\s+//g;
$seq =~ s/\*$//; # for protein stop codons
next unless $seq;
$seqcount++;
if ( !$filecount
|| $how_many_in_a_file == 1
|| $seqcount > $how_many_in_a_file )
{
$seqcount = int(0);
$filecount++;
my $outfile =
$how_many_in_a_file == 1 ? $id : $file2split . "_" . $filecount;
$outfile = $outdir . '/' . $outfile;
close(OUT);
open( OUT, ">$outfile" ) || die("Cannot open $outfile");
push( @files, $outfile );
}
print OUT $/ . $id . "\n" . &wrap_text($seq);
}
close(FILE);
close(OUT);
$/ = $orig_sep;
unlink($shuffled_file) if $shuffle;
return \@files;
}
sub maker_match_gff_to_gene_gff3 {
my $match_gff = shift;
my $out = $match_gff . '.gene.gff3';
#from brian;
my %genes;
open( my $fh, $match_gff ) or die "Error, cannot open file $match_gff";
open( OUT, ">$out" );
while (<$fh>) {
unless (/\w/) { next; }
if (/^\#/) { next; }
chomp;
my @x = split(/\t/);
my $scaff = $x[0];
my $source = $x[1];
my $feat_type = $x[2];
my $lend = $x[3];
my $rend = $x[4];
my $orient = $x[6];
my $info = $x[8];
( $lend, $rend ) = sort { $a <=> $b } ( $lend, $rend );
my ( $end5, $end3 ) =
( $orient eq '+' ) ? ( $lend, $rend ) : ( $rend, $lend );
my %tags = &get_tags($info);
if ( my $parent = $tags{Parent} ) {
$genes{$parent}->{coords}->{$end5} = $end3;
}
elsif ( my $id = $tags{ID} ) {
my $name = $tags{Name} || "No name";
$genes{$id}->{name} = $name;
$genes{$id}->{scaffold} = $scaff;
$genes{$id}->{source} = $source;
}
}
close $fh;
foreach my $gene_id ( keys %genes ) {
my $data_href = $genes{$gene_id};
my $coords_href = $data_href->{coords};
my $gene_obj = new Gene_obj();
$gene_obj->populate_gene_object( $coords_href, $coords_href );
$gene_obj->{asmbl_id} = $data_href->{scaffold};
$gene_obj->{com_name} = $data_href->{name};
$gene_obj->{TU_feat_name} = $gene_id;
$gene_obj->{Model_feat_name} = "m.$gene_id";
print OUT $gene_obj->to_GFF3_format( source => $data_href->{source} ) . "\n";
}
return $out;
}
####
sub get_tags {
my ($info) = @_;
my %tags;
my @fields = split( /;/, $info );
foreach my $field (@fields) {
my ( $key, $val ) = split( /=/, $field );
$tags{$key} = $val;
}
return (%tags);
}
sub create_evm_weights() {
my $out = "$outdir/evm_weights";
open( OUT, ">$out" );
print OUT
"ABINITIO_PREDICTION\taugustus_masked\t1\nABINITIO_PREDICTION\tsnap_masked\t1\nABINITIO_PREDICTION\tgenemark\t1\nPROTEIN\tprotein2genome\t1\nTRANSCRIPT\test2genome\t1\n";
close OUT;
return $out;
}
| 24.832918 | 170 | 0.560554 |
73d9073235f30bc63bfae3d73dee2723c7b5b4c2 | 3,674 | t | Perl | t/tar.t | BuildJet/MIP | f1f63117a7324e37dbcaa16c0298f4b4c857d44c | [
"MIT"
] | null | null | null | t/tar.t | BuildJet/MIP | f1f63117a7324e37dbcaa16c0298f4b4c857d44c | [
"MIT"
] | null | null | null | t/tar.t | BuildJet/MIP | f1f63117a7324e37dbcaa16c0298f4b4c857d44c | [
"MIT"
] | null | null | null | #!/usr/bin/env perl
use 5.026;
use Carp;
use charnames qw{ :full :short };
use English qw{ -no_match_vars };
use File::Basename qw{ dirname };
use File::Spec::Functions qw{ catdir catfile };
use FindBin qw{ $Bin };
use open qw{ :encoding(UTF-8) :std };
use Params::Check qw{ allow check last_error };
use Test::More;
use utf8;
use warnings qw{ FATAL utf8 };
## CPANM
use autodie qw{ :all };
use Modern::Perl qw{ 2018 };
use Readonly;
## MIPs lib/
use lib catdir( dirname($Bin), q{lib} );
use MIP::Constants qw{ $COMMA $SPACE };
use MIP::Test::Commands qw{ test_function };
use MIP::Test::Fixtures qw{ test_standard_cli };
my $VERBOSE = 1;
our $VERSION = 1.04;
$VERBOSE = test_standard_cli(
{
verbose => $VERBOSE,
version => $VERSION,
}
);
BEGIN {
use MIP::Test::Fixtures qw{ test_import };
### Check all internal dependency modules and imports
## Modules with import
my %perl_module = (
q{MIP::Program::Tar} => [qw{ tar }],
q{MIP::Test::Fixtures} => [qw{ test_standard_cli }],
);
test_import( { perl_module_href => \%perl_module, } );
}
use MIP::Program::Tar qw{ tar };
diag( q{Test tar from Tar.pm v}
. $MIP::Program::Tar::VERSION
. $COMMA
. $SPACE . q{Perl}
. $SPACE
. $PERL_VERSION
. $SPACE
. $EXECUTABLE_NAME );
## Base arguments
my @function_base_commands = qw{ tar };
my %base_argument = (
filehandle => {
input => undef,
expected_output => \@function_base_commands,
},
stderrfile_path => {
input => q{stderrfile.test},
expected_output => q{2> stderrfile.test},
},
stderrfile_path_append => {
input => q{stderrfile.test},
expected_output => q{2>> stderrfile.test},
},
stdoutfile_path => {
input => q{stdoutfile.test},
expected_output => q{1> stdoutfile.test},
},
);
## Can be duplicated with %base_argument and/or %specific_argument
## to enable testing of each individual argument
my %required_argument = (
filehandle => {
input => undef,
expected_output => \@function_base_commands,
},
);
my %specific_argument = (
create => {
input => 1,
expected_output => q{--create},
},
extract => {
input => 1,
expected_output => q{--extract},
},
filter_gzip => {
input => 1,
expected_output => q{-z},
},
file_path => {
input => catfile(qw{ path to file }),
expected_output => q{--file=} . catfile(qw{ path to file }),
},
filehandle => {
input => undef,
expected_output => \@function_base_commands,
},
in_paths_ref => {
inputs_ref => [qw{file_1 file_2}],
expected_output => q{file_1 file_2},
},
outdirectory_path => {
input => catdir(qw{ a test dir }),
expected_output => q{--directory=} . catdir(qw{a test dir}),
},
);
## Coderef - enables generalized use of generate call
my $module_function_cref = \&tar;
## Test both base and function specific arguments
my @arguments = ( \%base_argument, \%specific_argument );
ARGUMENT_HASH_REF:
foreach my $argument_href (@arguments) {
my @commands = test_function(
{
argument_href => $argument_href,
do_test_base_command => 1,
function_base_commands_ref => \@function_base_commands,
module_function_cref => $module_function_cref,
required_argument_href => \%required_argument,
}
);
}
done_testing();
| 25.513889 | 68 | 0.573762 |
73edefcb189899c9a1f939ee10f11b9c9418fb76 | 6,374 | pm | Perl | apps/automation/ansible/tower/mode/schedules.pm | petneli/centreon-plugins | d131e60a1859fdd0e959623de56e6e7512c669af | [
"Apache-2.0"
] | 316 | 2015-01-18T20:37:21.000Z | 2022-03-27T00:20:35.000Z | apps/automation/ansible/tower/mode/schedules.pm | petneli/centreon-plugins | d131e60a1859fdd0e959623de56e6e7512c669af | [
"Apache-2.0"
] | 2,333 | 2015-04-26T19:10:19.000Z | 2022-03-31T15:35:21.000Z | apps/automation/ansible/tower/mode/schedules.pm | petneli/centreon-plugins | d131e60a1859fdd0e959623de56e6e7512c669af | [
"Apache-2.0"
] | 371 | 2015-01-18T20:37:23.000Z | 2022-03-22T10:10:16.000Z | #
# Copyright 2021 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package apps::automation::ansible::tower::mode::schedules;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);
use DateTime;
use centreon::plugins::misc;
sub custom_start_output {
my ($self, %options) = @_;
return sprintf(
'last start: %s',
$self->{result_values}->{start_last_time} >= 0 ? centreon::plugins::misc::change_seconds(value => $self->{result_values}->{start_last_time}) : 'never'
);
}
sub prefix_output_global {
my ($self, %options) = @_;
return 'Schedules ';
}
sub prefix_output_schedule {
my ($self, %options) = @_;
return "Schedule '" . $options{instance_value}->{display} . "' ";
}
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'global', type => 0, cb_prefix_output => 'prefix_output_global' },
{ name => 'schedules', type => 1, cb_prefix_output => 'prefix_output_schedule', message_multiple => 'All schedules are ok', skipped_code => { -10 => 1 } }
];
$self->{maps_counters}->{global} = [
{ label => 'total', nlabel => 'schedules.total.count', set => {
key_values => [ { name => 'total' } ],
output_template => 'total: %d',
perfdatas => [
{ value => 'total', template => '%d', min => 0 }
]
}
}
];
foreach ((['successful', 1], ['failed', 1], ['running', 1], ['canceled', 0], ['pending', 0], ['default', 0], ['never', 0])) {
push @{$self->{maps_counters}->{global}}, {
label => $_->[0], nlabel => 'schedules.' . $_->[0] . '.count', display_ok => $_->[1], set => {
key_values => [ { name => $_->[0] }, { name => 'total' } ],
output_template => $_->[0] . ': %d',
perfdatas => [
{ template => '%d', min => 0, max => 'total' }
]
}
};
}
$self->{maps_counters}->{schedules} = [
{
label => 'job-status', type => 2,
unknown_default => '%{last_job_status} =~ /default/',
critical_default => '%{last_job_status} =~ /failed/',
set => {
key_values => [ { name => 'last_job_status' }, { name => 'display' } ],
output_template => "last job status is '%s'",
closure_custom_perfdata => sub { return 0; },
closure_custom_threshold_check => \&catalog_status_threshold_ng
}
},
{ label => 'start-last-time', nlabel => 'schedule.start.last.time.seconds', set => {
key_values => [ { name => 'start_last_time' }, { name => 'display' } ],
closure_custom_output => $self->can('custom_start_output'),
perfdatas => [
{ template => '%d', min => 0, unit => 's', label_extra_instance => 1, instance_use => 'display' }
]
}
}
];
}
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
bless $self, $class;
$options{options}->add_options(arguments => {
'filter-name:s' => { name => 'filter_name' }
});
return $self;
}
sub manage_selection {
my ($self, %options) = @_;
my $schedules = $options{custom}->tower_list_schedules(add_job_status => 1);
$self->{global} = { total => 0, failed => 0, successful => 0, canceled => 0, default => 0, pending => 0, running => 0, never => 0 };
$self->{schedules} = {};
foreach my $schedule (@$schedules) {
next if (defined($self->{option_results}->{filter_name}) && $self->{option_results}->{filter_name} ne ''
&& $schedule->{name} !~ /$self->{option_results}->{filter_name}/);
my $start_last_time = -1;
if (defined($schedule->{last_job}->{started})) {
#2020-07-30T09:36:28.806283Z
if ($schedule->{last_job}->{started} =~ /^(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)/) {
my $dt = DateTime->new(year => $1, month => $2, day => $3, hour => $4, minute => $5, second => $6);
$start_last_time = time() - $dt->epoch();
}
}
$self->{schedules}->{ $schedule->{id} } = {
display => $schedule->{name},
last_job_status => defined($schedule->{last_job}->{status}) ? $schedule->{last_job}->{status} : 'never',
start_last_time => $start_last_time
};
$self->{global}->{total}++;
if (defined($schedule->{last_job}->{status})) {
$self->{global}->{ $schedule->{last_job}->{status} }++;
} else {
$self->{global}->{never}++;
}
}
}
1;
__END__
=head1 MODE
Check schedules.
=over 8
=item B<--filter-name>
Filter schedule name (Can use regexp).
=item B<--unknown-job-status>
Set unknown threshold for status (Default: '%{last_job_status} =~ /default/').
Can used special variables like: %{last_job_status}, %{display}
=item B<--warning-job-status>
Set warning threshold for status.
Can used special variables like: %{last_job_status}, %{display}
=item B<--critical-job-status>
Set critical threshold for status (Default: '%{last_job_status} =~ /failed/').
Can used special variables like: %{last_job_status}, %{display}
=item B<--warning-*> B<--critical-*>
Thresholds.
Can be: 'total', 'successful', 'failed', 'running', 'canceled', 'pending', 'default', 'never', 'start-last-time' (s).
=back
=cut
| 33.547368 | 162 | 0.562127 |
ed1389c769a62555c8cfce2ab7add151416bff9d | 2,595 | pl | Perl | t/test_utils.pl | recogni/Verilog-Perl | 0faa7e5faf9e93ef61d342bb57b431cd93c49e2b | [
"Artistic-2.0"
] | null | null | null | t/test_utils.pl | recogni/Verilog-Perl | 0faa7e5faf9e93ef61d342bb57b431cd93c49e2b | [
"Artistic-2.0"
] | null | null | null | t/test_utils.pl | recogni/Verilog-Perl | 0faa7e5faf9e93ef61d342bb57b431cd93c49e2b | [
"Artistic-2.0"
] | null | null | null | # DESCRIPTION: Perl ExtUtils: Common routines required by package tests
#
# Copyright 2000-2019 by Wilson Snyder. This program is free software;
# you can redistribute it and/or modify it under the terms of either the GNU
# Lesser General Public License Version 3 or the Perl Artistic License Version 2.0.
use IO::File;
use File::Copy;
use strict;
use vars qw($PERL);
$PERL = "$^X -Iblib/arch -Iblib/lib -IPreproc/blib/arch -IPreproc/blib/lib";
mkdir 'test_dir',0777;
unlink "test_dir/verilog"; # Symlink made in vpassert test will mess up others
if (!$ENV{HARNESS_ACTIVE}) {
use lib '.';
use lib '..';
use lib "blib/lib";
use lib "blib/arch";
use lib "Preproc/blib/lib";
use lib "Preproc/blib/arch";
}
sub run_system {
# Run a system command, check errors
my $command = shift;
print "\t$command\n";
system "$command";
my $status = $?;
($status == 0) or die "%Error: Command Failed $command, $status, stopped";
}
sub run_system_no_die {
# Run a system command, check errors
my $command = shift;
print "\t$command\n";
system "$command";
return $?;
}
sub wholefile {
my $file = shift;
my $fh = IO::File->new ($file) or die "%Error: $! $file";
my $wholefile = join('',$fh->getlines());
$fh->close();
return $wholefile;
}
sub files_identical {
my $fn1 = shift; # got
my $fn2 = shift; # expected
my $f1 = IO::File->new ($fn1) or die "%Error: $! $fn1,";
my $f2 = IO::File->new ($fn2) or die "%Error: $! $fn2,";
my @l1 = $f1->getlines();
my @l2 = $f2->getlines();
my $nl = $#l1; $nl = $#l2 if ($#l2 > $nl);
for (my $l=0; $l<=$nl; $l++) {
$l1[$l] =~ s/\r\n/\n/g if defined $l1[$l]; # Cleanup if on Windows
$l2[$l] =~ s/\r\n/\n/g if defined $l2[$l];
if (($l1[$l]||"") ne ($l2[$l]||"")) {
next if ($l1[$l]||"") =~ /Generated by vrename on/;
warn ("%Warning: Line ".($l+1)." mismatches; $fn1 $fn2\n"
."GOT: ".($l1[$l]||"*EOF*\n")
."EXP: ".($l2[$l]||"*EOF*\n"));
if ($ENV{HARNESS_UPDATE_GOLDEN}) { # Update golden files with current
warn "%Warning: HARNESS_UPDATE_GOLDEN set: cp $fn1 $fn2\n";
copy($fn1,$fn2);
} else {
warn "To update reference: HARNESS_UPDATE_GOLDEN=1 ".join(" ",$0,@ARGV)."\n";
}
return 0;
}
}
return 1;
}
sub get_memory_usage {
# Return memory usage. Return 0 if the system doesn't look quite right.
my $fh = IO::File->new("</proc/self/statm");
return 0 if !$fh;
my $stat = $fh->getline || "";
my @stats = split /\s+/, $stat;
return ($stats[0]||0)*4096; # vmsize
}
1;
| 28.833333 | 83 | 0.581888 |
ed020894055df1024a2274e1a68efb8d90f6ebda | 2,660 | pm | Perl | lib/Chart/Plotly/Trace/Scatterpolargl/Stream.pm | hstejas/p5-Chart-Plotly | c1666613369ff44d0ec984935b02b4024638aacf | [
"MIT"
] | 11 | 2017-01-08T12:08:24.000Z | 2021-12-14T15:27:56.000Z | lib/Chart/Plotly/Trace/Scatterpolargl/Stream.pm | hstejas/p5-Chart-Plotly | c1666613369ff44d0ec984935b02b4024638aacf | [
"MIT"
] | 28 | 2016-11-21T20:25:21.000Z | 2021-04-20T16:58:38.000Z | lib/Chart/Plotly/Trace/Scatterpolargl/Stream.pm | hstejas/p5-Chart-Plotly | c1666613369ff44d0ec984935b02b4024638aacf | [
"MIT"
] | 3 | 2016-12-14T15:59:41.000Z | 2020-07-30T04:39:43.000Z | package Chart::Plotly::Trace::Scatterpolargl::Stream;
use Moose;
use MooseX::ExtraArgs;
use Moose::Util::TypeConstraints qw(enum union);
if (!defined Moose::Util::TypeConstraints::find_type_constraint('PDL')) {
Moose::Util::TypeConstraints::type('PDL');
}
# VERSION
# ABSTRACT: This attribute is one of the possible options for the trace scatterpolargl.
=encoding utf-8
=head1 SYNOPSIS
# EXAMPLE: examples/traces/scatterpolargl.pl
=head1 DESCRIPTION
This attribute is part of the possible options for the trace scatterpolargl.
This file has been autogenerated from the official plotly.js source.
If you like Plotly, please support them: L<https://plot.ly/>
Open source announcement: L<https://plot.ly/javascript/open-source-announcement/>
Full reference: L<https://plot.ly/javascript/reference/#scatterpolargl>
=head1 DISCLAIMER
This is an unofficial Plotly Perl module. Currently I'm not affiliated in any way with Plotly.
But I think plotly.js is a great library and I want to use it with perl.
=head1 METHODS
=cut
=head2 TO_JSON
Serialize the trace to JSON. This method should be called only by L<JSON> serializer.
=cut
sub TO_JSON {
my $self = shift;
my $extra_args = $self->extra_args // {};
my $meta = $self->meta;
my %hash = %$self;
for my $name (sort keys %hash) {
my $attr = $meta->get_attribute($name);
if (defined $attr) {
my $value = $hash{$name};
my $type = $attr->type_constraint;
if ($type && $type->equals('Bool')) {
$hash{$name} = $value ? \1 : \ 0;
}
}
}
%hash = (%hash, %$extra_args);
delete $hash{'extra_args'};
if ($self->can('type') && (!defined $hash{'type'})) {
$hash{type} = $self->type();
}
return \%hash;
}
=head1 ATTRIBUTES
=over
=cut
=item * maxpoints
Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to *50*, only the newest 50 points will be displayed on the plot.
=cut
has maxpoints => (
is => "rw",
isa => "Num",
documentation => "Sets the maximum number of points to keep on the plots from an incoming stream. If `maxpoints` is set to *50*, only the newest 50 points will be displayed on the plot.",
);
=item * token
The stream id number links a data trace on a plot with a stream. See https://plot.ly/settings for more details.
=cut
has token => (
is => "rw",
isa => "Str",
documentation => "The stream id number links a data trace on a plot with a stream. See https://plot.ly/settings for more details.",
);
=pod
=back
=cut
__PACKAGE__->meta->make_immutable();
1;
| 24.40367 | 191 | 0.664662 |
ed65cf7b06d565a77eee4a7ef6c2be7aaa39e127 | 2,365 | pl | Perl | src/FR-Hit_cleanChimera.pl | dantaslab/parfums_dev | 85d783077381fe945a23a48d16c8c8cece83e317 | [
"MIT"
] | null | null | null | src/FR-Hit_cleanChimera.pl | dantaslab/parfums_dev | 85d783077381fe945a23a48d16c8c8cece83e317 | [
"MIT"
] | null | null | null | src/FR-Hit_cleanChimera.pl | dantaslab/parfums_dev | 85d783077381fe945a23a48d16c8c8cece83e317 | [
"MIT"
] | 2 | 2017-04-25T13:44:31.000Z | 2019-12-17T18:54:59.000Z | #!/usr/bin/perl -w
use strict;
die ("Usage: FR-Hit_cleanChimera.pl <Output_FR-Hit> <Contigs> > <output>\n") unless (scalar(@ARGV) == 2);
my $file = shift @ARGV;
my $fna = shift @ARGV;
my $prefix = shift @ARGV;
my @seqs=();
open (IN, "<$file") or die ("Couldn't open file: $file\n");
open (FNA, "<$fna") or die ("Couldn't open file: $fna\n");
my %length=();
my %seqs=();
my $name="";
while (my $j = <FNA>){
chomp($j);
if ($j =~ /^>(.*)$/){
$name=$1;
$name =~ s/\s+//;
}else{
$seqs{$name}.=$j;
$length{$name}=length($seqs{$name});
}
}
close FNA;
my %genomes=();
my $old="";
my $n="";
while (my $l = <IN>){
chomp ($l);
my @array = split /\t/, $l;
$n = $array[0];
$n =~ s/\_\d$//;
$array[7] =~ s/\%$//;
$array[1] =~ s/nt$//;
next if ($array[7] < 95); # Next if the percent id is less than 95%
next unless ((($array[3]/$array[1]) >= 0.95) or ($array[-2]< 5) or ($array[-1] > ($length{$array[8]}-5))); # Next unless the percent covered is over 95% of the read or is in the first or last 30bp
for (my $i=$array[-2]; $i<=$array[-1]; $i++){
$genomes{$array[8]}[$i-1][0]++; # Marks the coverage of all sequences
if ($i > ($array[-2]+10) && $i < ($array[-1]-10)){
$genomes{$array[8]}[$i-1][1]++;
}elsif (($i <= 12) && $i < ($array[-1]-10)){
$genomes{$array[8]}[$i-1][1]++;
}elsif (($i > ($array[-2]+10)) && ($i > ($length{$array[8]}-15))){
$genomes{$array[8]}[$i-1][1]++;
}
}
}
close IN;
foreach my $k (keys(%genomes)){
die ("Unknown genome >$k<\n") unless ($length{$k});
# print "\n$k\n";
#next unless ($k =~ /NODE_1_length_2354_cov_40.158878/);
for (my $i=0; $i<$length{$k}; $i++){
$genomes{$k}[$i][0]=0 unless ($genomes{$k}[$i][0]);
$genomes{$k}[$i][1]=1 unless ($genomes{$k}[$i][1]);
$genomes{$k}[$i][2]=$genomes{$k}[$i][0]/$genomes{$k}[$i][1];
# print "$i\t$genomes{$k}[$i][0]\t$genomes{$k}[$i][1]\t$genomes{$k}[$i][2]\n";
substr $seqs{$k}, $i, 1, "N" if ((($genomes{$k}[$i][1] < 20) && ($genomes{$k}[$i][2] > 10)) or ($genomes{$k}[$i][2] > 100));
}
my @split = split /N+/, $seqs{$k};
for (my $h =0; $h<@split; $h++){
print ">$k\_$h\n$split[$h]\n" if (length($split[$h]) > 50);
}
}
| 28.493976 | 219 | 0.463848 |
ed4de486424ca6f5c07619c261293357918d84a8 | 604 | pl | Perl | BASL_tsp_etc/tabulate_basl_seqs_21nov2014.pl | SchwarzEM/ems_perl | 0c20b1fe1d215689ee8db3677b23175bd968841f | [
"BSD-3-Clause"
] | 2 | 2021-07-19T09:00:17.000Z | 2021-08-30T02:45:18.000Z | BASL_tsp_etc/tabulate_basl_seqs_21nov2014.pl | Superboy666/ems_perl | ce78eb5c2120566e6e55a786ebd15382cb38736f | [
"BSD-3-Clause"
] | null | null | null | BASL_tsp_etc/tabulate_basl_seqs_21nov2014.pl | Superboy666/ems_perl | ce78eb5c2120566e6e55a786ebd15382cb38736f | [
"BSD-3-Clause"
] | 1 | 2021-07-19T09:00:18.000Z | 2021-07-19T09:00:18.000Z | #!/usr/bin/env perl
use strict;
use warnings;
use autodie;
while (my $input = <>) {
chomp $input;
my $species = 'TBD';
if ( $input =~ /\A > (\S+) \s+ (.+) \z/xms ) {
my $name = $1;
my $data = $2;
if ( $data =~ /\A (.+) \s+ \[ (.+) \] \s* /xms ) {
$species = $2;
$data = $1;
}
elsif ( $name =~ /\A Aquca_ /xms ) {
$species = 'Aquilegia coerulea';
}
elsif ( $name =~ /\A Spipo /xms ) {
$species = 'Spirodela polyrhiza';
}
print "$name\t$data\t$species\n";
}
}
| 22.37037 | 59 | 0.395695 |
ed84f2959521b528483f9fbb9c340eb168628d38 | 9,157 | pm | Perl | Services/Email/Email.pm | kukam/PWE | 104a80e0bdcc6ac4a12c807c6fbb85134718e844 | [
"Apache-2.0"
] | null | null | null | Services/Email/Email.pm | kukam/PWE | 104a80e0bdcc6ac4a12c807c6fbb85134718e844 | [
"Apache-2.0"
] | null | null | null | Services/Email/Email.pm | kukam/PWE | 104a80e0bdcc6ac4a12c807c6fbb85134718e844 | [
"Apache-2.0"
] | null | null | null | package Services::Email::Email;
use strict;
use Libs::Send;
use MIME::Base64;
use Archive::Tar;
my ($CONF, $LOG, $VALIDATE, $DBI, $ENTITIES, $USER, $WEB);
sub new {
my ($class, $conf, $log, $validate, $dbi, $entities, $user, $web) = @_;
$DBI = $dbi;
$LOG = $log;
$WEB = $web;
$CONF = $conf;
$USER = $user;
$VALIDATE = $validate;
$ENTITIES = $entities;
my $self = {
'timeout_for_result_E' => ((3600 * 24) * 3), # 3 days, za jak dlouhou dobu se email oznaci 'E' v pripade ze ho mailserver stale odmita.
};
bless $self, $class;
return $self;
}
=head2 B<[Public] sendAllEmail()>
Metoda se pokusi odeslat vsechny maily ve fronte.
=cut
sub sendAllEmail {
my $self = shift;
# TODO : Metoda nerozlisuje nedostupnost postovniho servru a chyby pri konstrukci email (rejecting)
# To muze zpusobit ze validni emaily pri dlouhodobem vypadku mailservru budou invalidovany a nasledne zahozeny!!!
my $SQL = undef;
my $error = undef;
if (($DBI->getDbDriver("db1") eq "mysql") or ($DBI->getDbDriver("db1") eq "maria")) {
$SQL = $DBI->select("db1", "mid,mailfrom,mailto,replyto,cc,bcc,returnpath,errorto,subject,text,textalt,attachment, TIME_TO_SEC(TIMEDIFF(NOW(),started)) as `timedif` FROM mailqueue WHERE sendstatus = ? AND started < NOW()", ["N"]);
} elsif ($DBI->getDbDriver("db1") eq "Postgres") {
# TODO : Slo by pouzit tuto funkci age(NOW(), started), ale nevim jak prevest tento format na secundy
$SQL = $DBI->select("db1","mid,mailfrom,mailto,replyto,cc,bcc,returnpath,errorto,subject,text,textalt,attachment, (extract(epoch from NOW() at time zone 'utc' at time zone 'utc') - extract(epoch from started at time zone 'utc' at time zone 'utc')) as timedif FROM mailqueue WHERE sendstatus = ? AND started < NOW()",["N"]);
}
NEXT: while (my ($mid, $from, $to, $replyto, $cc, $bcc, $returnpath, $errorto, $sub, $text, $textalt, $attachment, $timedif) = $SQL->fetchrow()) {
foreach my $smtp_server (@{$CONF->getValue("pwe", "smtp_servers", ["smtp_primary"])}) {
my $config = $CONF->getValue($smtp_server, undef, undef);
if (ref($config) ne "HASH") {
$LOG->error("smtp server '$smtp_server' config is not defined");
next;
}
my $send = new Libs::Send($config);
foreach (split(/,/, $from)) { $send->setFrom($_); }
foreach (split(/,/, $to)) { $send->setTo($_); }
foreach (split(/,/, $cc)) { $send->setCc($_); }
foreach (split(/,/, $bcc)) { $send->setBcc($_); }
foreach (split(/,/, $replyto)) { $send->setReplyTo($_); }
foreach (split(/,/, $returnpath)) { $send->setReturnPath($_); }
foreach (split(/,/, $errorto)) { $send->setErrorTo($_); }
$send->setSubjectUTF8($sub);
$send->setBody($textalt);
$send->setBody($text);
my @tarfiles;
my $extract = $CONF->getValue('pwe', 'home', '/tmp/') . $CONF->getValue('pwe', 'upload_dir', 'upload/') . "extract/";
if ($attachment) {
open(ZIP, '<', \decode_base64($attachment));
binmode ZIP;
my $tar = Archive::Tar->new(\*ZIP);
$tar->setcwd($extract);
foreach my $oldpath ($tar->list_files()) {
my $newpath = $oldpath;
$newpath =~ s/.*\///;
$tar->rename($oldpath,$newpath);
$send->setAttachment($extract.$newpath);
push(@tarfiles,$extract.$newpath);
}
$tar->extract();
close (ZIP);
}
my $result = $send->send();
# CLER ATTACHMENT
foreach my $path (@tarfiles) { unlink($path); }
if ($result) {
$LOG->error("Traing send email to:$to id:$mid FAIL, msg:$result");
sleep(1);
} else {
$self->updateSendResult($mid, "Y");
$LOG->info("Send mail id:$mid to:$to is completed.");
next NEXT;
}
}
# POKUD SE EMAIL NEDARI ODESLAT DELSI DOBU, OZNACIME JEJ STAVEM 'E' + ODESLEME INFO ADMINISTRATOROVY.
if ($timedif > $self->getValue('timeout_for_result_E', 3600)) {
$self->updateSendResult($mid, "E");
$error->{$mid} = $to;
$LOG->error("Send error report email to administrator. Error email is '$to' mid: $mid");
}
}
$SQL->finish;
$self->sendErrorEmail($error) if (defined($error));
}
=head2 B<[Public] addEmailToQueue(%HASH)>
Metoda prida novy email do fronty.
$EMAIL->addEmailToQueue(
to => 'to@email.com',
from => 'from@email.com',
subject => "Sujbect",
text => "Content-Type: text/plain; charset=UTF-8\n TEXT",
# Nepovine hodnoty
textalt => "ALTERNATIVE BODY",
cc => 'cc@email.com',
bcc => 'bcc@email.com',
replyto => 'replyto@email.com',
returnpath => 'returnpath@email.com',
errorto => 'errorto@email.com',
attachments => [ '/path/filename1.txt', '/path/filename2.txt' ],
started => '2003-09-13 13:13:13'
);
=cut
sub addEmailToQueue {
my ($self, %values) = @_;
my $MAILQ = $ENTITIES->createEntityObject('MailQueue');
$MAILQ->mailfrom($values{'from'});
$MAILQ->mailto($values{'to'});
$MAILQ->subject($values{'subject'});
$MAILQ->text($values{'text'});
$MAILQ->replyto($values{'replyto'});
$MAILQ->cc($values{'cc'});
$MAILQ->bcc($values{'bcc'});
$MAILQ->returnpath($values{'returnpath'});
$MAILQ->errorto($values{'errorto'});
($values{'started'} ? $MAILQ->started($values{'started'}) : $MAILQ->started('NOW()'));
if (exists($values{'attachments'})) {
my $tar = Archive::Tar->new;
foreach my $file (@{$values{'attachments'}}) {
if (-f $file) {
$tar->add_files($file);
} else {
$LOG->error("File '$file' not exist!");
}
}
$MAILQ->attachment($tar->write);
}
$MAILQ->flush;
$MAILQ->logit;
if ($MAILQ->error) {
$MAILQ->rollback;
return undef;
} else {
$MAILQ->commit;
$LOG->info("ADD email to queue from:$values{'from'} to:$values{'to'}");
return 1;
}
}
=head2 B<[Public] updateSendResult($mid,$result)>
Metoda prepne stav emailu.
MID = id v mail_queue
Stavy ($result):
Y = "Email byl v poradku servrem prijat a je povazovany za odeslany.
E = "Email se nepodarilo odeslat a byl vyrazen z fronty.
N = "Email je novy, jeste neni odeslan.
=cut
sub updateSendResult {
my ($self, $mid, $result) = @_;
my $EMAIL = $ENTITIES->createEntityObject('MailQueue', $mid);
$EMAIL->sendstatus($result);
$EMAIL->flush;
$EMAIL->logit;
if ($EMAIL->error) {
$EMAIL->rollback;
} else {
$EMAIL->commit;
}
}
=head2 B<[Private] sendErrorEmail($error)>
Metoda odesle informace o emailech ktere se nepodarilo odeslat po stanovenou dobu.
$error = {
id => email,
....
};
=cut
sub sendErrorEmail {
my ($self, $error) = @_;
my $from = $CONF->getValue("web", "email_admin", "root\@localhost");
my $to = $CONF->getValue("web", "email_admin", "root\@localhost");
my $sub = $CONF->getValue("web", "email_subtitle", "Pwe error Report") . " : Seznam emailu ktere se po nekolika pokusech nepodarilo odeslat!";
my $text = "\nTyto emaily nebylo mozne odeslat, jsou vyrazeny z fronty.\n";
$text .= "=========================================================\n\n";
while (my ($id, $email) = each(%{$error})) {
$text .= "id: $id to: $email\n";
}
$text .= "\nTimto prikaze vratis emaily zpet do fronty\n";
$text .= "==========================================\n\n";
while (my ($id, $email) = each(%{$error})) {
$text .= "UPDATE mail_queue SET sendstatus = 'N', started = NOW() WHERE mid = $id;\n";
}
$self->addEmailToQueue(to => $to, from => $from, subject => $sub, text => $text);
}
=head2 B<[Private] getValue($key,$def)>
Metoda vraci obsah atributu ($key), pokud atribut neexistuje
vraci metoda hodnotu $def.
=cut
sub getValue {
my ($self, $key, $def) = @_;
return $def unless (exists($self->{$key}));
return $def unless ($self->{$key});
return $self->{$key};
}
# KOMODO-IDE/KOMODO-EDIT
sub KOMODO {
return;
require Libs::Config;
require Libs::Log;
require Libs::Validate;
require Libs::DBI;
require Libs::User;
require Libs::Web;
require Libs::Entities;
$CONF = new Libs::Config;
$LOG = new Libs::Log;
$VALIDATE = new Libs::Validate;
$DBI = new Libs::DBI;
$USER = new Libs::User;
$WEB = new Libs::Web;
$ENTITIES = new Libs::Entities;
}
1;
| 31.685121 | 331 | 0.537075 |
73e3b24021827302b246b002d14a75f6c1657de3 | 1,479 | pl | Perl | examples/introspect_nb.pl | FGasper/p5-Protocol-DBus | 8330c2414480fd0e8d2d48d139a3f9b1837aae4d | [
"Artistic-1.0-cl8"
] | 11 | 2018-10-28T18:44:44.000Z | 2021-03-03T20:02:19.000Z | examples/introspect_nb.pl | FGasper/p5-Protocol-DBus | 8330c2414480fd0e8d2d48d139a3f9b1837aae4d | [
"Artistic-1.0-cl8"
] | 7 | 2018-09-30T15:08:24.000Z | 2021-04-18T12:27:56.000Z | examples/introspect_nb.pl | FGasper/p5-Protocol-DBus | 8330c2414480fd0e8d2d48d139a3f9b1837aae4d | [
"Artistic-1.0-cl8"
] | 3 | 2018-09-29T22:46:10.000Z | 2021-04-18T08:35:23.000Z | #!/usr/bin/env perl
use strict;
use warnings;
use autodie;
use Socket;
use Data::Dumper;
use FindBin;
use lib "$FindBin::Bin/../lib";
use Protocol::DBus::Client;
my $dbus = $> ? Protocol::DBus::Client::login_session() : Protocol::DBus::Client::system();
$SIG{'PIPE'} = 'IGNORE';
# Just for demonstration purposes. Endianness
# should not matter.
$dbus->big_endian(1);
$dbus->blocking(0);
my $fileno = $dbus->fileno();
# You can use whatever polling method you prefer;
# the following is quick and easy:
vec( my $mask, $fileno, 1 ) = 1;
while (!$dbus->initialize()) {
if ($dbus->init_pending_send()) {
select( undef, my $wout = $mask, undef, undef );
}
else {
select( my $rout = $mask, undef, undef, undef );
}
}
printf "done authn; unique bus name: %s\n", $dbus->get_unique_bus_name();
#----------------------------------------------------------------------
my $got_response;
$dbus->send_call(
path => '/org/freedesktop/DBus',
interface => 'org.freedesktop.DBus.Properties',
destination => 'org.freedesktop.DBus',
signature => 's',
member => 'GetAll',
body => ['org.freedesktop.DBus'],
)->then( sub {
$got_response = 1;
print "got getall response\n";
print Dumper shift;
} );
while (!$got_response) {
my $win = $dbus->pending_send() || q<>;
$win &&= $mask;
select( my $rout = $mask, $win, undef, undef );
$dbus->flush_write_queue() if $win;
1 while $dbus->get_message();
}
| 21.75 | 91 | 0.588911 |
ed5254647c4e191f5f108c4aefd6f21fd8bd20a7 | 1,465 | pm | Perl | t/lib/t/MusicBrainz/Server/Edit/Artist/AddAlias.pm | kellnerd/musicbrainz-server | 9e058e10219ea6b8942cfd64160ffe19769f747b | [
"BSD-2-Clause"
] | 577 | 2015-01-15T12:18:50.000Z | 2022-03-16T20:41:57.000Z | t/lib/t/MusicBrainz/Server/Edit/Artist/AddAlias.pm | kellnerd/musicbrainz-server | 9e058e10219ea6b8942cfd64160ffe19769f747b | [
"BSD-2-Clause"
] | 1,227 | 2015-04-16T01:00:29.000Z | 2022-03-30T15:08:46.000Z | t/lib/t/MusicBrainz/Server/Edit/Artist/AddAlias.pm | kellnerd/musicbrainz-server | 9e058e10219ea6b8942cfd64160ffe19769f747b | [
"BSD-2-Clause"
] | 280 | 2015-01-04T08:39:41.000Z | 2022-03-10T17:09:59.000Z | package t::MusicBrainz::Server::Edit::Artist::AddAlias;
use Test::Routine;
use Test::More;
with 't::Edit';
with 't::Context';
BEGIN { use MusicBrainz::Server::Edit::Artist::AddAlias }
use MusicBrainz::Server::Constants qw( $EDIT_ARTIST_ADD_ALIAS );
use MusicBrainz::Server::Test qw( accept_edit reject_edit );
test all => sub {
my $test = shift;
my $c = $test->c;
MusicBrainz::Server::Test->prepare_test_database($c, '+artistalias');
my $alias_set = $c->model('Artist')->alias->find_by_entity_id(1);
is(@$alias_set, 2);
my $edit = _create_edit($c);
isa_ok($edit, 'MusicBrainz::Server::Edit::Artist::AddAlias');
ok(defined $edit->alias_id);
ok($edit->alias_id > 0);
my ($edits) = $c->model('Edit')->find({ artist => 1 }, 10, 0);
is(@$edits, 1);
is($edits->[0]->id, $edit->id);
$c->model('Edit')->load_all($edit);
is($edit->display_data->{artist}{id}, 1);
is($edit->display_data->{alias}, 'Another alias');
my $artist = $c->model('Artist')->get_by_id(1);
is($artist->edits_pending, 0, 'Alias addition was an autoedit');
$alias_set = $c->model('Artist')->alias->find_by_entity_id(1);
is(@$alias_set, 3);
};
sub _create_edit {
my $c = shift;
return $c->model('Edit')->create(
edit_type => $EDIT_ARTIST_ADD_ALIAS,
editor_id => 1,
entity => $c->model('Artist')->get_by_id(1),
name => 'Another alias',
sort_name => 'Another alias sort name',
primary_for_locale => 0,
ended => 0
);
}
1;
| 25.258621 | 69 | 0.634812 |
ed90d619da63a9d6ae6a1b37002018fb5b4b4e2e | 7,960 | pm | Perl | modules/Bio/EnsEMBL/Analysis/Runnable/Lastz.pm | jmgonzmart/ensembl-analysis | 41c1d362bc0abce91a81a6615b3d61a6b82b7da5 | [
"Apache-2.0"
] | null | null | null | modules/Bio/EnsEMBL/Analysis/Runnable/Lastz.pm | jmgonzmart/ensembl-analysis | 41c1d362bc0abce91a81a6615b3d61a6b82b7da5 | [
"Apache-2.0"
] | null | null | null | modules/Bio/EnsEMBL/Analysis/Runnable/Lastz.pm | jmgonzmart/ensembl-analysis | 41c1d362bc0abce91a81a6615b3d61a6b82b7da5 | [
"Apache-2.0"
] | null | null | null | =head1 LICENSE
# Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
# Copyright [2016-2022] EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
=head1 CONTACT
Please email comments or questions to the public Ensembl
developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.
Questions may also be sent to the Ensembl help desk at
<http://www.ensembl.org/Help/Contact>.
=cut
=head1 AUTHORS
Abel Ureta-Vidal <abel@ebi.ac.uk>
=head1 NAME
Bio::EnsEMBL::Analysis::Runnable::Lastz -
=head1 SYNOPSIS
# To run a lastz job from scratch do the following.
my $query = new Bio::SeqIO(-file => 'somefile.fa',
-format => 'fasta')->next_seq;
my $database = 'multifastafile.fa';
my $lastz = Bio::EnsEMBL::Analysis::Runnable::Lastz->new
('-query' => $query,
'-database' => $database,
'-options' => 'T=2');
$lastz->run();
@featurepairs = $last->output();
foreach my $fp (@featurepairs) {
print $fp->gffstring . "\n";
}
# Additionally if you have lastz runs lying around that need parsing
# you can use the EnsEMBL blastz parser module
# perldoc Bio::EnsEMBL::Analysis::Runnable::Parser::Blastz
=head1 DESCRIPTION
Lastz takes a Bio::Seq (or Bio::PrimarySeq) object and runs lastz with against
the specified multi-FASTA file database. Tthe output is parsed by
Bio::EnsEMBL::Analysis::Runnable::Parser::Lastz and stored as Bio::EnsEMBL::DnaDnaAlignFeature
Other options can be passed to the lastz program using the -options method
=head1 METHODS
=cut
package Bio::EnsEMBL::Analysis::Runnable::Lastz;
use warnings ;
use vars qw(@ISA);
use strict;
# Object preamble
use Bio::EnsEMBL::Analysis::Runnable;
use Bio::EnsEMBL::DnaDnaAlignFeature;
use Bio::EnsEMBL::Analysis::Tools::Blastz;
use Bio::EnsEMBL::Utils::Argument qw(rearrange);
use Bio::EnsEMBL::Utils::Exception;
@ISA = qw(Bio::EnsEMBL::Analysis::Runnable);
sub new {
my ($class,@args) = @_;
my $self = $class->SUPER::new(@args);
my ($database) = rearrange(['DATABASE'], @args);
$self->database($database) if defined $database;
throw("You must supply a database") if not $self->database;
throw("You must supply a query") if not $self->query;
$self->program("lastz") if not $self->program;
return $self;
}
=head2 run
Title : run
Usage : $obj->run()
Function: Runs lastz and BPLite and creates array of feature pairs
Returns : none
Args : none
=cut
sub run{
my ($self, $dir) = @_;
$self->workdir($dir) if($dir);
throw("Can't run ".$self." without a query sequence")
unless($self->query);
$self->write_seq_files();
$self->run_analysis();
$self->delete_files;
return 1;
}
sub run_analysis {
my $self = shift;
my $cmd = $self->program ." ".
$self->query ." ".
$self->database ." ".
$self->options;
my $BlastzParser;
my $blastz_output_pipe = undef;
if($self->results_to_file) {
if (not $self->resultsfile) {
my $resfile = $self->create_filename("lastz", "results");
$self->resultsfile($resfile);
$self->files_to_delete($resfile);
}
$cmd .= " > ". $self->resultsfile;
info("Running lastz...\n$cmd\n");
throw("Error runing lastz cmd\n$cmd\n." .
" Returned error $? LASTZ EXIT: '" .
($? >> 8) . "'," ." SIGNAL '" . ($? & 127) .
"', There was " . ($? & 128 ? 'a' : 'no') .
" core dump") unless(system($cmd) == 0);
$BlastzParser = Bio::EnsEMBL::Analysis::Tools::Blastz->
new('-file' => $self->resultsfile);
} else {
info("Running lastz to pipe...\n$cmd\n");
my $stderr_file = $self->workdir()."/lastz_$$.stderr";
open($blastz_output_pipe, "$cmd 2>$stderr_file |") ||
throw("Error opening lasts cmd <$cmd>." .
" Returned error $? LAST EXIT: '" .
($? >> 8) . "'," ." SIGNAL '" . ($? & 127) .
"', There was " . ($? & 128 ? 'a' : 'no') .
" core dump");
$BlastzParser = Bio::EnsEMBL::Analysis::Tools::Blastz->
new('-fh' => $blastz_output_pipe) || print_error($stderr_file, "Unable to parse blastz_output_pipe");
}
my @results;
while (defined (my $alignment = $BlastzParser->nextAlignment)) { # nextHSP-like
push @results, $alignment;
}
close($blastz_output_pipe) if(defined($blastz_output_pipe));
$self->output(\@results);
}
sub print_error {
my ($stderr_file, $text) = @_;
my $msg;
if (-e $stderr_file) {
print "$stderr_file\n";
open FH, $stderr_file or die("Unable to open $stderr_file");
while (<FH>) {
$msg .= $_;
}
unlink($stderr_file);
}
$msg .= $text;
throw($msg);
}
#################
# get/set methods
#################
=head2 query
Title : query
Usage : $self->query($seq)
Function: Get/set method for query. If set with a Bio::Seq object it
will get written to the local tmp directory
Returns : filename
Args : Bio::PrimarySeqI, or filename
=cut
sub query {
my ($self, $val) = @_;
if (defined $val) {
if (not ref($val)) {
throw("[$val] : file does not exist\n") unless -e $val;
} elsif (not $val->isa("Bio::PrimarySeqI")) {
throw("[$val] is neither a Bio::Seq not a file");
}
$self->{_query} = $val;
}
return $self->{_query}
}
=head2 database
Title : database
Usage : $self->database($seq)
Function: Get/set method for database. If set with a Bio::Seq object it
will get written to the local tmp directory
Returns : filename
Args : Bio::PrimarySeqI, or filename
=cut
sub database {
my ($self, $val) = @_;
if (defined $val) {
if ($val eq "--self") {
$self->{_database} = $val;
return $self->{_database};
}
if (not ref($val)) {
throw("[$val] : file does not exist\n") unless -e $val;
} else {
if (ref($val) eq 'ARRAY') {
foreach my $el (@$val) {
throw("All elements of given database array should be Bio::PrimarySeqs")
if not ref($el) or not $el->isa("Bio::PrimarySeq");
}
} elsif (not $val->isa("Bio::PrimarySeq")) {
throw("[$val] is neither a file nor array of Bio::Seq");
} else {
$val = [$val];
}
}
$self->{_database} = $val;
}
return $self->{_database};
}
sub write_seq_files {
my ($self) = @_;
if (ref($self->query)) {
# write the query
my $query_file = $self->create_filename("lastz", "query");
my $seqio = Bio::SeqIO->new(-format => "fasta",
-file => ">$query_file");
$seqio->write_seq($self->query);
$seqio->close;
$self->query($query_file);
$self->files_to_delete($query_file);
}
if (ref($self->database)) {
my $db_file = $self->create_filename("lastz", "database");
my $seqio = Bio::SeqIO->new(-format => "fasta",
-file => ">$db_file");
foreach my $seq (@{$self->database}) {
$seqio->write_seq($seq);
}
$seqio->close;
$self->database($db_file);
$self->files_to_delete($db_file);
}
}
sub results_to_file {
my ($self, $val) = @_;
if (defined $val) {
$self->{_results_to_file} = $val;
}
return $self->{_results_to_file};
}
1;
| 25.11041 | 109 | 0.59397 |
ed5c89d83e77cbf5b5e87774f0b9ef81436ecd9d | 1,545 | pm | Perl | auto-lib/Paws/DevOpsGuru/AnomalyTimeRange.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/DevOpsGuru/AnomalyTimeRange.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/DevOpsGuru/AnomalyTimeRange.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 87 | 2015-04-22T06:29:47.000Z | 2021-09-29T14:45:55.000Z | # Generated by default/object.tt
package Paws::DevOpsGuru::AnomalyTimeRange;
use Moose;
has EndTime => (is => 'ro', isa => 'Str');
has StartTime => (is => 'ro', isa => 'Str', required => 1);
1;
### main pod documentation begin ###
=head1 NAME
Paws::DevOpsGuru::AnomalyTimeRange
=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::DevOpsGuru::AnomalyTimeRange object:
$service_obj->Method(Att1 => { EndTime => $value, ..., StartTime => $value });
=head3 Results returned from an API call
Use accessors for each attribute. If Att1 is expected to be an Paws::DevOpsGuru::AnomalyTimeRange object:
$result = $service_obj->Method(...);
$result->Att1->EndTime
=head1 DESCRIPTION
A time range that specifies when the observed unusual behavior in an
anomaly started and ended.
=head1 ATTRIBUTES
=head2 EndTime => Str
The time when the anomalous behavior ended.
=head2 B<REQUIRED> StartTime => Str
The time when the anomalous behavior started.
=head1 SEE ALSO
This class forms part of L<Paws>, describing an object used in L<Paws::DevOpsGuru>
=head1 BUGS and CONTRIBUTIONS
The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
=cut
| 23.409091 | 105 | 0.732039 |
ed731d50d1de6b41867ff1e24674f6965abfd1de | 1,142 | ph | Perl | components/type/include/cgv/type/traits/function_pointer.ph | tobias-haenel/cgv-density-estimation | 3be1b07a7b21d1cfd956fb19b5f0d83fb51bd308 | [
"BSD-3-Clause"
] | null | null | null | components/type/include/cgv/type/traits/function_pointer.ph | tobias-haenel/cgv-density-estimation | 3be1b07a7b21d1cfd956fb19b5f0d83fb51bd308 | [
"BSD-3-Clause"
] | null | null | null | components/type/include/cgv/type/traits/function_pointer.ph | tobias-haenel/cgv-density-estimation | 3be1b07a7b21d1cfd956fb19b5f0d83fb51bd308 | [
"BSD-3-Clause"
] | null | null | null | #pragma once
@exclude <components/config/ppp.ppp>
#include <cgv/type/invalid_type.h>
namespace cgv {
namespace type {
namespace traits {
/** defines for a function_pointer pointer type the return type and the
list of argument types. Only functions up to a maximum number of
eight arguments are supported. */
template <typename T> struct function_pointer
{
static const bool is_function_pointer = false;
typedef invalid_type return_type;
static const unsigned int nr_arguments = 0;
};
template <typename T, int> struct function_pointer_argument_list { typedef invalid_type type; };
@for (i=0; i<=N_ARG; i=i+1) @{
/// specialize function_pointer template for @(i) argument@if(i!=1)@{s@}
template <typename R@[", typename T1"; ""; ", typename T".i]>
struct function_pointer<R (*)(@["T1"; ","; "T".i])>
{
static const bool is_function_pointer = true;
typedef R return_type;
static const unsigned int nr_arguments = @(i);
};
@for(j=1; j<=i; ++j)@{
template <typename R@[", typename T1"; ""; ", typename T".i]>
struct function_pointer_argument_list<R (*)(@["T1"; ","; "T".i]), @(j-1)> { typedef T@(j) type; };
@}
@}
}
}
}
| 27.190476 | 98 | 0.687391 |
ed245e6502a4aaf5d24fd2bc58842ac0395a4b81 | 597 | pl | Perl | perl/src/lib/Net/t/libnet_t.pl | nokibsarkar/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 2,293 | 2015-01-02T12:46:10.000Z | 2022-03-29T09:45:43.000Z | perl/src/lib/Net/t/libnet_t.pl | nokibsarkar/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 315 | 2015-05-31T11:55:46.000Z | 2022-01-12T08:36:37.000Z | perl/src/lib/Net/t/libnet_t.pl | nokibsarkar/sl4a | d3c17dca978cbeee545e12ea240a9dbf2a6999e9 | [
"Apache-2.0"
] | 1,033 | 2015-01-04T07:48:40.000Z | 2022-03-24T09:34:37.000Z |
my $number = 0;
sub ok {
my ($condition, $name) = @_;
my $message = $condition ? "ok " : "not ok ";
$message .= ++$number;
$message .= " # $name" if defined $name;
print $message, "\n";
return $condition;
}
sub is {
my ($got, $expected, $name) = @_;
for ($got, $expected) {
$_ = 'undef' unless defined $_;
}
unless (ok($got eq $expected, $name)) {
warn "Got: '$got'\nExpected: '$expected'\n" . join(' ', caller) . "\n";
}
}
sub skip {
my ($reason, $num) = @_;
$reason ||= '';
$number ||= 1;
for (1 .. $num) {
$number++;
print "ok $number # skip $reason\n";
}
}
1;
| 15.710526 | 73 | 0.520938 |
ed109fecdcd76085f292549db422518c5026dce4 | 4,027 | pm | Perl | MT_systems/squoia/esde/addPronouns.pm | dan-zeman/squoia | 096868f96bd4c19b45b1d69251321c85c71c6c3b | [
"Apache-2.0"
] | 9 | 2016-04-27T16:48:58.000Z | 2021-01-17T21:55:55.000Z | MT_systems/squoia/esde/addPronouns.pm | dan-zeman/squoia | 096868f96bd4c19b45b1d69251321c85c71c6c3b | [
"Apache-2.0"
] | null | null | null | MT_systems/squoia/esde/addPronouns.pm | dan-zeman/squoia | 096868f96bd4c19b45b1d69251321c85c71c6c3b | [
"Apache-2.0"
] | 6 | 2016-03-29T22:26:50.000Z | 2021-01-17T21:56:21.000Z | #!/usr/bin/perl
# add pronoun chunks: add/guess the pronouns needed for German but absent in Spanish (pro-drop language)
package squoia::esde::addPronouns;
use strict;
use utf8;
sub main{
my $dom = ${$_[0]};
my $verbose = $_[1];
print STDERR "#VERBOSE ". (caller(0))[3]."\n" if $verbose;
my $maxChunkRef = squoia::util::getMaxChunkRef($dom);
my $subject = "suj";
# get the nodes of VP chunks with no dependent "subject" chunks
my $xpathexpr = '//CHUNK[(@type="VP" or @type="CVP") and count(CHUNK[starts-with(@si,"'.$subject.'")])=0]/NODE';
my @specialnodes = $dom->findnodes($xpathexpr);
foreach my $node (@specialnodes) {
my $parentChunk = squoia::util::getParentChunk($node); # VP chunk
if ($parentChunk->getAttribute('si') =~ /^S|sn/) { # TODO other possibilities?
if ($node->exists('./NODE[@smi="CS" and @pos="KOUS"]')) {
print STDERR "subordinated clause needs an extra pronoun\n" if $verbose;
}
else {
# do not add any pronoun in a relative clause TODO if it is the subject, but it could be the object!!!
print STDERR "relative clause does not necessarily need any extra pronoun\n" if $verbose;
# get person of finite verb
my $finverb = @{$node->findnodes('descendant-or-self::NODE[contains(@pos,"FIN") or contains(@spos,"FIN")]')}[0];
if ($finverb and $finverb->getAttribute('mi') =~ /^3\.(Sg|Pl)/) {
my $verbperson = $1;
print STDERR "verb in 3rd person $verbperson...\n" if $verbose;
# TODO: the verb is in 3rd person; relative could be the object...CHECK antecedent: la casa que tienen : mismatch Sg/Pl => add pronoun
my $antecedent = squoia::util::getParentChunk($parentChunk);
print STDERR "antecedent: ". ${$antecedent->findnodes('NODE')}[0]->getAttribute('slem') ."\n" if $verbose;
if ($antecedent->getAttribute('mi') =~ /\.$verbperson/) {
print STDERR "antecedent of relative clause also $verbperson; relpronoun could still be the object...\n" if $verbose;
next;
}
} # else the finite verb has no explicit subject but has the form of a 1st or 2nd person => add pronoun
print STDERR "add subject pronoun anyway!\n" if $verbose;
}
}
my $pronounChunk = XML::LibXML::Element->new('CHUNK');
$maxChunkRef++;
$pronounChunk->setAttribute('ref',"$maxChunkRef");
$pronounChunk->setAttribute('type','NP');
$pronounChunk->setAttribute('si',$subject);
$pronounChunk->setAttribute('comment','added pronoun');
my $pronounNode = XML::LibXML::Element->new('NODE');
$pronounNode->setAttribute('pos','PPER');
$pronounNode->setAttribute('cas','Nom');
my $finVerb;
if ($node->getAttribute('pos') =~ m/FIN/ or ($node->getAttribute('pos') =~ m/VV/ and $node->hasAttribute('spos') and $node->getAttribute('spos')=~ m/VVFIN/) ) {
# "spos" for reflexiv German verbs; example: charlar -> unterhalten_sich, where VP-CHUNK has 2 children that are sibling nodes after split
$finVerb = $node;
}
else {
my @children = $node->findnodes('descendant::NODE');
foreach my $child (@children) {
if ($child->getAttribute('pos') =~ m/V.FIN/ or $child->getAttribute('spos') =~ m/V.FIN/) {
# "spos" for verbs from periphrase whose pos tag has been switched; example: seguir|estar +gerund, where seguir|estar becomes an adverb
$finVerb = $child;
last;
}
}
}
if ($finVerb) {
print STDERR "finite verb form " . $finVerb->getAttribute('sform') ."\n" if $verbose;
my $verbMorph = "3.Sg.Pres.Ind"; # arbitrary default value
if ($finVerb->hasAttribute('mi')) {
$verbMorph = $finVerb->getAttribute('mi');
}
else {
print STDERR $finVerb->serialize."Finite verb node has no morphological information (mi attribute)...
this shouldn't be the case! Please check your diccionary and transfer rules\n" if $verbose;
}
my ($pers,$num) = split(/\./,$verbMorph);
my $pronounMorph = $pers . "." . $num;
$pronounNode->setAttribute('mi',$pronounMorph);
$node->parentNode->addChild($pronounChunk);
$pronounChunk->addChild($pronounNode);
}
}
}
1;
| 43.771739 | 162 | 0.659796 |
ed80b8b4aa0d98b3510d70cf6547b33b4406e705 | 2,908 | pl | Perl | functional/MBCS_Tests/CLDR_11/tap_compare.pl | Haroon-Khel/openjdk-tests | 565191efde062aa5337befdd943611c75aff6d42 | [
"Apache-2.0"
] | null | null | null | functional/MBCS_Tests/CLDR_11/tap_compare.pl | Haroon-Khel/openjdk-tests | 565191efde062aa5337befdd943611c75aff6d42 | [
"Apache-2.0"
] | null | null | null | functional/MBCS_Tests/CLDR_11/tap_compare.pl | Haroon-Khel/openjdk-tests | 565191efde062aa5337befdd943611c75aff6d42 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/perl
################################################################################
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
use Test::Simple tests => 35;
use File::Compare;
@a = ('DEFAULT','CLDR','JRE','SPI');
$langtag = $ENV{'LANGTAG'};
$prefix = 'expected_';
$t1 = 'DecimalFormatSymbolsTest-';
$f1 = $t1.$langtag.'-DEFAULT.log';
$f2 = $t1.$langtag.'-CLDR,JRE.log';
ok(compare($f1, $f2) == 0, $f2);
foreach $s (@a) {
$f = $t1.$langtag.'-'.$s.'.log';
ok(compare($f, $prefix.$f) == 0, 'diff '.$f.' '.$prefix.$f);
}
$t1 = 'DateFormatSymbolsTest-';
$f1 = $t1.$langtag.'-DEFAULT.log';
$f2 = $t1.$langtag.'-CLDR,JRE.log';
ok(compare($f1, $f2) == 0, $f2);
foreach $s (@a) {
$f = $t1.$langtag.'-'.$s.'.log';
ok(compare($f, $prefix.$f) == 0, 'diff '.$f.' '.$prefix.$f);
}
$t1 = 'DecimalStyleTest-';
$f1 = $t1.$langtag.'-DEFAULT.log';
$f2 = $t1.$langtag.'-CLDR,JRE.log';
ok(compare($f1, $f2) == 0, $f2);
foreach $s (@a) {
$f = $t1.$langtag.'-'.$s.'.log';
ok(compare($f, $f2) == 0, 'diff '.$f.' '.$f2);
}
$t1 = 'CurrencyTest-';
$f1 = $t1.$langtag.'-DEFAULT.log';
$f2 = $t1.$langtag.'-CLDR,JRE.log';
ok(compare($f1, $f2) == 0, $f2);
foreach $s (@a) {
$f = $t1.$langtag.'-'.$s.'.log';
ok(compare($f, $prefix.$f) == 0, 'diff '.$f.' '.$prefix.$f);
}
$t1 = 'LocaleTest-';
$f1 = $t1.$langtag.'-DEFAULT.log';
$f2 = $t1.$langtag.'-CLDR,JRE.log';
ok(compare($f1, $f2) == 0, $f2);
foreach $s (@a) {
$f = $t1.$langtag.'-'.$s.'.log';
ok(compare($f, $prefix.$f) == 0, 'diff '.$f.' '.$prefix.$f);
}
$t1 = 'TimeZoneTestA-';
$f1 = $t1.$langtag.'-DEFAULT.log';
$f2 = $t1.$langtag.'-CLDR,JRE.log';
ok(compare($f1, $f2) == 0, $f2);
foreach $s (('DEFAULT','JRE')) {
$f = $t1.$langtag.'-'.$s.'.log';
ok(compare($f, $f2) == 0, 'diff '.$f.' '.$f2);
}
### Skip this testcase on 11.0.7 ###
if ($ENV{'JAVAVERSION'} ge '11000007') {
ok(1==1, 'Skip TimeZoneTestA SPI on 11.0.7');
} else {
$f = $t1.$langtag.'-SPI.log';
ok(compare($f, $f2) == 0, 'diff '.$f.' '.$f2);
}
$f = $t1.$langtag.'-CLDR.log';
ok(compare($f, $prefix.$f) == 0, 'diff '.$f.' '.$prefix.$f);
$t1 = 'TimeZoneTestB-';
$f1 = $t1.$langtag.'-DEFAULT.log';
$f2 = $t1.$langtag.'-CLDR,JRE.log';
ok(compare($f1, $f2) == 0, $f2);
foreach $s (@a) {
$f = $t1.$langtag.'-'.$s.'.log';
ok(compare($f, $prefix.$f) == 0, 'diff '.$f.' '.$prefix.$f);
}
| 30.610526 | 80 | 0.538171 |
73fa2068c6235e29fdd6552a0b7f1e93404415ca | 2,561 | pm | Perl | auto-lib/Paws/S3/GetObjectTorrent.pm | galenhuntington/aws-sdk-perl | 13b775dcb5f0b3764f0a82f3679ed5c7721e67d3 | [
"Apache-2.0"
] | null | null | null | auto-lib/Paws/S3/GetObjectTorrent.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/S3/GetObjectTorrent.pm | galenhuntington/aws-sdk-perl | 13b775dcb5f0b3764f0a82f3679ed5c7721e67d3 | [
"Apache-2.0"
] | null | null | null |
package Paws::S3::GetObjectTorrent;
use Moose;
has Bucket => (is => 'ro', isa => 'Str', uri_name => 'Bucket', traits => ['ParamInURI'], required => 1);
has Key => (is => 'ro', isa => 'Str', uri_name => 'Key', traits => ['ParamInURI'], required => 1);
has RequestPayer => (is => 'ro', isa => 'Str', header_name => 'x-amz-request-payer', traits => ['ParamInHeader']);
use MooseX::ClassAttribute;
class_has _api_call => (isa => 'Str', is => 'ro', default => 'GetObjectTorrent');
class_has _api_uri => (isa => 'Str', is => 'ro', default => '/{Bucket}/{Key+}?torrent');
class_has _api_method => (isa => 'Str', is => 'ro', default => 'GET');
class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::S3::GetObjectTorrentOutput');
class_has _result_key => (isa => 'Str', is => 'ro');
1;
### main pod documentation begin ###
=head1 NAME
Paws::S3::GetObjectTorrent - Arguments for method GetObjectTorrent on L<Paws::S3>
=head1 DESCRIPTION
This class represents the parameters used for calling the method GetObjectTorrent on the
L<Amazon Simple Storage Service|Paws::S3> service. Use the attributes of this class
as arguments to method GetObjectTorrent.
You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to GetObjectTorrent.
=head1 SYNOPSIS
my $s3 = Paws->service('S3');
my $GetObjectTorrentOutput = $s3->GetObjectTorrent(
Bucket => 'MyBucketName',
Key => 'MyObjectKey',
RequestPayer => 'requester', # OPTIONAL
);
# Results:
my $Body = $GetObjectTorrentOutput->Body;
my $RequestCharged = $GetObjectTorrentOutput->RequestCharged;
# Returns a L<Paws::S3::GetObjectTorrentOutput> 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/s3/GetObjectTorrent>
=head1 ATTRIBUTES
=head2 B<REQUIRED> Bucket => Str
=head2 B<REQUIRED> Key => Str
=head2 RequestPayer => Str
Valid values are: C<"requester">
=head1 SEE ALSO
This class forms part of L<Paws>, documenting arguments for method GetObjectTorrent in L<Paws::S3>
=head1 BUGS and CONTRIBUTIONS
The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
=cut
| 30.488095 | 249 | 0.679422 |
ed0b0492ef0f47c14f9cca48fc2cda27bfae08b1 | 4,500 | pm | Perl | lib/sdk/Com/Vmware/Esx/Settings/Clusters/Software/AddOn.pm | bince-criticalcase/vsphere-automation-sdk-perl | da3330bf66dc6c853e9a23062146d54afc299955 | [
"MIT"
] | 26 | 2017-04-24T19:20:08.000Z | 2021-12-06T23:15:09.000Z | lib/sdk/Com/Vmware/Esx/Settings/Clusters/Software/AddOn.pm | bince-criticalcase/vsphere-automation-sdk-perl | da3330bf66dc6c853e9a23062146d54afc299955 | [
"MIT"
] | 7 | 2017-05-25T04:49:56.000Z | 2020-10-12T09:13:16.000Z | lib/sdk/Com/Vmware/Esx/Settings/Clusters/Software/AddOn.pm | DamonLiang2021/vsphere-automation-sdk-perl | da3330bf66dc6c853e9a23062146d54afc299955 | [
"MIT"
] | 11 | 2017-05-05T11:52:12.000Z | 2021-12-06T23:14:59.000Z | ########################################################################
# Copyright (C) 2013 - 2014 VMware, Inc.
########################################################################
## @file AddOn.pm
# Auto generated vAPI skeleton file.
# DO NOT MODIFY!
#
#
#use Com::Vmware::Vapi::Std::Errors;
#use Com::Vmware::Esx::Settings;
## @class Com::Vmware::Esx::Settings::Clusters::Software::AddOn
# The ``Com::Vmware::Esx::Settings::Clusters::Software::AddOn`` *interface* provides
# *methods* to manage desired OEM add-on specification for a given cluster.
#
#
# Constant String::RESOURCE_TYPE #
#Resource type for add-on resource
package Com::Vmware::Esx::Settings::Clusters::Software::AddOn;
#
# Core Perl modules
#
use strict;
use warnings;
use Carp;
#
# Vapi Perl modules
#
use Com::Vmware::Vapi::Bindings::Type::StructType;
use Com::Vmware::Esx::Settings::Clusters::Software::AddOnStub;
#
# Base class
#
use base qw(Com::Vmware::Vapi::Bindings::VapiInterface);
#
# Identifier of the service
#
use constant _VAPI_SERVICE_ID => 'com.vmware.esx.settings.clusters.software.add_on';
## @method new ()
# Constructor to initialize the object
#
# @param api_provider - protocol connection to use with
# stubs created by this factory
# @param StubConfig - Stub's additional configuration
#
# @retval
# Blessed object
#
sub new {
my ($class, %args) = @_;
$class = ref($class) || $class;
my $stub_config = $args {stub_config};
my $api_provider = $args {api_provider};
my $self = $class->SUPER::new('stub_config' => $stub_config,
'api_provider' => $api_provider);
bless $self, $class;
return $self;
}
## @method get ()
# Returns the desired OEM add-on specification for a given cluster.
#
# Note:
# Privileges required for this operation are VcIntegrity.lifecycleSoftwareSpecification.Read.
#
# @param cluster [REQUIRED] Identifier of the cluster.
# The value must be an identifier for the resource type
# getQualifiedName(ClusterComputeResource).
# . The value must be str.
#
# @retval
# Desired OEM add-on specification.
# The return type will be Com::Vmware::Esx::Settings::AddOnInfo
#
# @throw Com::Vmware::Vapi::Std::Errors::Error
# If there is unknown internal error. The accompanying error message will give more
# details about the failure.
#
# @throw Com::Vmware::Vapi::Std::Errors::NotFound
# If there is no cluster associated with ``cluster`` in the system or if desired OEM
# add-on specification is not found.
#
# @throw Com::Vmware::Vapi::Std::Errors::ServiceUnavailable
# If the service is not available.
#
# @throw Com::Vmware::Vapi::Std::Errors::Unauthenticated
# if the caller is not authenticated.
# @throw Com::Vmware::Vapi::Std::Errors::Unauthorized
# if you do not have all of the privileges described as follows: <ul>
# <li> *Method* execution requires
# ``VcIntegrity.lifecycleSoftwareSpecification.Read`` . </li>
# <li> The resource ``ClusterComputeResource`` referenced by the *parameter*
# ``cluster`` requires ``VcIntegrity.lifecycleSoftwareSpecification.Read`` . </li>
# </ul>
#
sub get {
my ($self, %args) = @_;
my $cluster = $args {cluster};
$self->validate_args (method_name => 'get',
method_args => \%args);
return $self->invoke (method_name => 'get',
method_args => \%args);
}
1;
#########################################################################################
# Begins enumerations for the Com::Vmware::Esx::Settings::Clusters::Software::AddOn service
#########################################################################################
#########################################################################################
# Ends enumerations for the Com::Vmware::Esx::Settings::Clusters::Software::AddOn service
#########################################################################################
#########################################################################################
# Begins structures for the Com::Vmware::Esx::Settings::Clusters::Software::AddOn service
#########################################################################################
#########################################################################################
# Ends structures for the Com::Vmware::Esx::Settings::Clusters::Software::AddOn service
#########################################################################################
| 32.846715 | 93 | 0.554222 |
ed85ef11234e0186bca9825ec8a14ac4e4400038 | 864 | pm | Perl | lib/Moose/Meta/Method/Accessor/Native/Array.pm | dolmen/p5-Moose | 77fe8566f8cf21712481e1208b002e142d643993 | [
"Artistic-1.0"
] | null | null | null | lib/Moose/Meta/Method/Accessor/Native/Array.pm | dolmen/p5-Moose | 77fe8566f8cf21712481e1208b002e142d643993 | [
"Artistic-1.0"
] | null | null | null | lib/Moose/Meta/Method/Accessor/Native/Array.pm | dolmen/p5-Moose | 77fe8566f8cf21712481e1208b002e142d643993 | [
"Artistic-1.0"
] | null | null | null | package Moose::Meta::Method::Accessor::Native::Array;
our $VERSION = '2.1606';
use strict;
use warnings;
use Moose::Role;
sub _inline_check_var_is_valid_index {
my $self = shift;
my ($var) = @_;
return (
'if (!defined(' . $var . ') || ' . $var . ' !~ /^-?\d+$/) {',
$self->_inline_throw_exception( InvalidArgumentToMethod =>
'argument => '.$var.','.
'method_name => "'.$self->delegate_to_method.'",'.
'type_of_argument => "integer",'.
'type => "Int",'.
'argument_noun => "index"',
) . ';',
'}',
);
}
no Moose::Role;
1;
| 29.793103 | 106 | 0.365741 |
73f55211e5bd8f52f667d53940e287f4b5db5be2 | 9,967 | pl | Perl | scripts/misc/update_predicted_data.pl | fergalmartin/ensembl-variation | 858de3ee083fd066bc0b8a78e8a449176dd51bce | [
"Apache-2.0"
] | null | null | null | scripts/misc/update_predicted_data.pl | fergalmartin/ensembl-variation | 858de3ee083fd066bc0b8a78e8a449176dd51bce | [
"Apache-2.0"
] | 1 | 2020-04-20T12:11:56.000Z | 2020-04-20T12:11:56.000Z | scripts/misc/update_predicted_data.pl | dglemos/ensembl-variation | 7cd20531835b45b1842476606b4fd0856e3843e0 | [
"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-2018] EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
=head1 CONTACT
Please email comments or questions to the public Ensembl
developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.
Questions may also be sent to the Ensembl help desk at
<http://www.ensembl.org/Help/Contact>.
=cut
# Script to update the documentation page "Data description".
use strict;
use warnings;
use Bio::EnsEMBL::Registry;
use Getopt::Long;
# Print the usage instructions if run without parameters
usage() unless (scalar(@ARGV));
my ($version,$input_file,$output_file,$help,$hlist,$user,$port,$pswd,$species,$web_colour_file,$web_mapping_colour);
GetOptions(
'v=i' => \$version,
'i=s' => \$input_file,
'o=s' => \$output_file,
'help!' => \$help,
'hlist=s' => \$hlist,
'user=s' => \$user,
'port=i' => \$port,
'species|s=s' => \$species,
# 'colour_file=s' => \$web_colour_file,
# 'mapping_file=s' => \$web_mapping_colour
);
usage("input and output files must be specified") unless ($input_file && $output_file);
usage("Hosts list, user must be specified") unless ($hlist && $user && $version);
$species ||= 'Homo_sapiens';
$port ||= 3306;
$pswd ||= '';
my @hostnames = split /,/, $hlist;
my $tmp_file = 'predicted_data_tmp.html';
my $tmp_section = 'section_tmp.html';
`cp $input_file $tmp_file`;
my $section;
my ($content_before, $new_content, $content_after);
# Generates the "List of consequences" table documentation
#$section = 'consequences';
#$content_before = get_content($section,'start');
#$content_after = get_content($section,'end');
#`perl generate_consequence_table.pl -o $tmp_section -colour_file $web_colour_file -mapping_file $web_mapping_colour`;
#$new_content = `cat $tmp_section`;
#`rm -f $tmp_section`;
#print_into_tmp_file($tmp_file,$content_before,$new_content,$content_after);
## SIFT and PolyPhen ##
my @versions = ('sift_version', 'sift_protein_db_version', 'polyphen_version', 'polyphen_release');
my %tool_versions;
my %sift_species;
my %polyphen_species;
my $sql = qq{SHOW DATABASES LIKE '\%variation\_$version%'};
my $sql2 = qq{SELECT meta_key,meta_value FROM meta WHERE meta_key IN ('}.join("','",@versions).qq{')};
my $sql3 = qq{SELECT meta_value FROM meta WHERE meta_key=?};
foreach my $hostname (@hostnames) {
my $database = "";
my $sth = get_connection_and_query($database, $hostname, $sql);
# loop over databases
while (my ($dbname) = $sth->fetchrow_array) {
next if ($dbname =~ /^master_schema/);
next if ($dbname =~ /sample$/);
print "$dbname\n";
$database = $dbname;
$dbname =~ /^(.+)_variation/;
my $s_name = $1;
if ($s_name eq lc($species)) {
my $sth2 = get_connection_and_query($database, $hostname, $sql2);
while (my ($key,$value) = $sth2->fetchrow_array) {
$tool_versions{$key} = $value;
}
$sth2->finish();
}
# SIFT
my $sth_sift = get_connection_and_query($database, $hostname, $sql3, [$versions[0]]);
if ($sth_sift->fetchrow_array) {
$sift_species{$s_name} = 1;
}
$sth_sift->finish();
# PolyPhen
my $sth_polyphen = get_connection_and_query($database, $hostname, $sql3, [$versions[2]]);
if ($sth_polyphen->fetchrow_array) {
$polyphen_species{$s_name} = 1;
}
$sth_polyphen->finish();
}
}
# Update SIFT
$section = 'sift_version';
if ($tool_versions{$section}) {
$content_before = get_content($section,'start');
$content_after = get_content($section,'end');
my $sift_version = $tool_versions{$section};
$sift_version =~ s/sift//;
$new_content = $sift_version;
print_into_tmp_file($tmp_file,$content_before,$new_content,$content_after);
}
$section = 'sift_protein_db_version';
if ($tool_versions{$section}) {
$content_before = get_content($section,'start');
$content_after = get_content($section,'end');
my $sift_pr_version = $tool_versions{$section};
if ($sift_pr_version =~ /UniRef90/) {
$sift_pr_version =~ s/UniRef90/UniRef90 (release/;
$sift_pr_version .= ')';
}
$new_content = $sift_pr_version;
print_into_tmp_file($tmp_file,$content_before,$new_content,$content_after);
}
# Update SIFT species list
$section = 'sift_species';
if (scalar(%sift_species)) {
$content_before = get_content($section,'start');
$content_after = get_content($section,'end');
$new_content = print_list_of_species(\%sift_species);
print_into_tmp_file($tmp_file,$content_before,$new_content,$content_after);
}
# Update PolyPhen
$section = 'polyphen_version';
if ($tool_versions{$section}) {
$content_before = get_content($section,'start');
$content_after = get_content($section,'end');
my $polyphen_version = $tool_versions{$section};
$new_content = $polyphen_version;
print_into_tmp_file($tmp_file,$content_before,$new_content,$content_after);
}
# Update PolyPhen
$section = 'polyphen_release';
if ($tool_versions{$section}) {
$content_before = get_content($section,'start');
$content_after = get_content($section,'end');
my $polyphen_release = $tool_versions{$section};
$new_content = $polyphen_release;
print_into_tmp_file($tmp_file,$content_before,$new_content,$content_after);
}
# Update PolyPhen species list
$section = 'polyphen_species';
if (scalar(%polyphen_species)) {
$content_before = get_content($section,'start');
$content_after = get_content($section,'end');
$new_content = print_list_of_species(\%polyphen_species);
print_into_tmp_file($tmp_file,$content_before,$new_content,$content_after);
}
`cp $tmp_file $output_file`;
`rm -f $tmp_file`;
sub get_content {
my $section = shift;
my $type = shift;
my $anchor = "<!-- $section - $type -->";
my $line = `grep -m1 -n '$anchor' $tmp_file`;
die "Can't find the anchor '$anchor' in the file" if (!$line || $line eq '');
$line =~ /^(\d+):/;
my $line_number = $1;
my $content;
if ($type eq 'start') {
$content = `head -n$line_number $tmp_file`;
if ($content !~ /$anchor(\n?)$/) {
$content = (split("$anchor", $content))[0].$anchor;
}
}
else {
my $lines_count = (split(' ',`wc -l $tmp_file`))[0];
$line_number = $lines_count - $line_number + 1;
$content = `tail -n$line_number $tmp_file`;
if ($content !~ /^$anchor/) {
$content = $anchor.(split("$anchor", $content))[1];
}
}
return $content;
}
sub print_list_of_species {
my $spe_list = shift;
my $max_row = 5;
my $header = qq{
<div style="float:left;font-style:italic">
<ul style="margin-bottom:0px">};
my $html = $header;
my $count_row = 1;
foreach my $species (sort(keys(%$spe_list))) {
$species =~ s/_/ /g;
$species = ucfirst($species);
if ($count_row == $max_row) {
$html .= qq{ </ul>\n</div>$header};
$count_row = 1;
}
$html .= ($count_row == 1) ? qq{ <li style="margin-top:0px">} : ' <li>';
$html .= qq{$species</li>};
$count_row ++;
}
$html .= qq{ </ul>\n</div>};
return $html;
}
sub print_into_tmp_file {
my $tmp = shift;
my $before = shift;
my $new = shift;
my $after = shift;
open TMP, "> $tmp" or die $!;
print TMP $before;
print TMP $new;
print TMP $after;
}
# Connects and execute a query
sub get_connection_and_query {
my $dbname = shift;
my $host = shift;
my $sql = shift;
my $params = shift;
# DBI connection
my $dsn = "DBI:mysql:$dbname:$host:$port";
my $dbh = DBI->connect($dsn, $user, $pswd) or die "Connection failed";
my $sth = $dbh->prepare($sql);
if ($params) {
$sth->execute(join(',',@$params));
}
else {
$sth->execute;
}
return $sth;
}
sub usage {
my $msg = shift;
print qq{
$msg
Usage: perl update_data_description.pl [OPTION]
Update the page "data_description.html" (under public-plugins/ensembl/htdocs/info/genome/variation/).
Options:
-help Print this message
-v Ensembl version, e.g. 65 (Required)
-i Path to the data_description.html file (Required)
-o An HTML output file name (Required)
-species Species name. 'Homo_sapiens' by default (optional)
-hlist The list of host names where the new databases are stored, separated by a coma,
e.g. ensembldb.ensembl.org1, ensembldb.ensembl.org2 (Required)
-user MySQL user name (Required)
-port MySQL port. 3306 by default (optional)
} . "\n";
# -colour_file If you want to use directly the colours from the web colours configuration file
# instead of the almost-up-to-date-colour-hash \%colour hash. (optional)
# Usually, you can find the colour configuration file in:
# ensembl-webcode/conf/ini-files/COLOUR.ini
# -mapping_file Web module to map the colour names to the corresponding hexadecimal code. (optional)
# Useful because some colour names are internal to Ensembl and won't be displayed in the
# documentation pages (i.e. not using the perl modules).
# The module ColourMap.pm can be find in:
# ensembl-webcode/modules/Sanger/Graphics/ColourMap.pm
# } . "\n";
exit(0);
}
| 31.541139 | 118 | 0.649945 |
ed795a2cf0b7174fd4f943ea8139fa4b32fca941 | 968 | t | Perl | feedgenerator/t/feedgen.t | flaithbheartaigh/jaikuengine-mobile-client | c47100ec009d47a4045b3d98addc9b8ad887b132 | [
"MIT"
] | null | null | null | feedgenerator/t/feedgen.t | flaithbheartaigh/jaikuengine-mobile-client | c47100ec009d47a4045b3d98addc9b8ad887b132 | [
"MIT"
] | null | null | null | feedgenerator/t/feedgen.t | flaithbheartaigh/jaikuengine-mobile-client | c47100ec009d47a4045b3d98addc9b8ad887b132 | [
"MIT"
] | null | null | null | #!/usr/bin/perl
use Test::More tests=>8;
use Jaiku::FeedGenerator;
my @items;
{
package FeedTest;
sub new {
return bless {}, shift;
}
sub fetch_last_known {
return "";
}
sub new_item {
my ($self, $nick, $type, $xml)=@_;
push(@items, [ $nick, $type, $xml ]);
}
1;
}
my $cb=new FeedTest;
my $feedgen=new Jaiku::FeedGenerator($cb);
ok(1, "created");
my $xml1="<presence><status>20060101T120000<presencev2></presencev2></status></presence>";
$feedgen->handle_next("mikie", $xml1);
ok(1, "handle didn't crash");
ok($#items==-1, "no items yet");
my $xml2="<presence><status>20060101T120000<presencev2><a>a</a></presencev2></status></presence>";
$feedgen->handle_next("mikie", $xml2);
ok($#items==0, "one item");
ok($items[0]->[0] eq "mikie", "right nick");
ok($items[0]->[1] eq "a", "right type");
ok($items[0]->[2] eq "<a>a</a>", "right content");
$feedgen->handle_next("mikie", $xml2);
ok($#items==0, "no items from no change");
| 22.511628 | 110 | 0.629132 |
ed5ae4e40e666cb30954f56ebcf7067c07619c59 | 11,582 | pl | Perl | utilities/page-test.pl | Ensembl/webvm | cd3d91bfa7ff953237320c0d2c7358cde369f366 | [
"ECL-2.0",
"Apache-2.0"
] | 2 | 2022-02-03T00:20:01.000Z | 2022-02-14T11:09:49.000Z | utilities/page-test.pl | Ensembl/webvm | cd3d91bfa7ff953237320c0d2c7358cde369f366 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-05-20T14:45:07.000Z | 2019-06-20T12:55:45.000Z | utilities/page-test.pl | Ensembl/webvm | cd3d91bfa7ff953237320c0d2c7358cde369f366 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/perl
# Copyright [2018-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.
## Look in SVN for all static content pages (.html) and then use CURL to request them all
##
##
## Author : js5
## Maintainer : js5
## Created : 2009-08-12
## Last commit by : $Author: js5 $
## Last modified : $Date: 2013-06-24 08:18:34 +0100 (Mon, 24 Jun 2013) $
## Revision : $Revision: 804 $
## Repository URL : $HeadURL: svn+ssh://pagesmith-core@web-wwwsvn.internal.sanger.ac.uk/repos/svn/pagesmith/pagesmith-core/trunk/utilities/page-test.pl $
use strict;
use warnings;
use utf8;
use version qw(qv); our $VERSION = qv('0.1.0');
use HTML::Entities qw(encode_entities);
use English qw(-no_match_vars $PROGRAM_NAME $EVAL_ERROR $INPUT_RECORD_SEPARATOR);
use File::Basename qw(dirname basename);
use Cwd qw(abs_path);
use Readonly qw(Readonly);
use Getopt::Long qw(GetOptions);
use Time::HiRes qw(time sleep);
use YAML::Loader;
use Data::Dumper qw(Dumper);
# Define constants and data-structures
Readonly my $URL_MAX_LENGTH => 120;
Readonly my $SLEEP_PERIOD => 0.001;
Readonly my $RATE => 5;
Readonly my $TIME_OUT => 60;
Readonly my $MAX_TRIES => 5;
my $ROOT_PATH;
BEGIN { $ROOT_PATH = dirname(dirname(abs_path($PROGRAM_NAME))); }
use lib "$ROOT_PATH/lib";
use Pagesmith::Utils::Core;
use Pagesmith::Utils::Curl::Fetcher;
my $help = 0;
my $ajax = 0;
my $flush = 0;
my $rate = $RATE;
my $time_out = $TIME_OUT;
my $max_tries = $MAX_TRIES;
my $xhtml = 0;
my $verbose = 0;
my $local = 0;
my $dev = 0;
my $staging = 0;
my @headers;
my @cookies;
GetOptions(
'help' => \$help,
'flush+' => \$flush,
'ajax' => \$ajax,
'concurrency=i' => \$rate,
'timeout=i' => \$time_out,
'maxtries=i' => \$max_tries,
'verbose+' => \$verbose,
'xhtml' => \$xhtml,
'local' => \$local,
'dev' => \$dev,
'staging' => \$staging,
);
my $type_to_test = $staging ? 'staging'
: $dev ? 'dev'
: $local ? 'local'
: 'live'
;
_docs() if $help;
push @cookies, 'PageSmith=%7B%22a%22%3A%22e%22%7D' if $ajax;
push @headers, 'Pragma: no-cache' if $flush;
push @headers, $xhtml ? 'Accept: text/html,application/xhtml+xml,application/xml' : 'Accept: text/html';
my %return_vals;
my @urls;
if( opendir my $dh, "$ROOT_PATH/sites" ) {
my @sites_list = grep { ! m{\A[.]}mxs && -e "$ROOT_PATH/sites/$_/data/urls" } readdir $dh;
closedir $dh;
_get_urls( \%return_vals, \@urls, @sites_list );
} else {
die "Unable to open sites directory...\n";
}
_munge_urls( $type_to_test, \@urls, \%return_vals ) unless $type_to_test eq 'live';
my $start_time = time;
_fetch( {
'rate' => $rate,
'urls' => \@urls,
'cookies' => \@cookies,
'headers' => \@headers,
'timeout' => $time_out,
});
## no critic (ImplicitNewlines)
printf '
--------------------------------------
Total: %10.3f
--------------------------------------
', time-$start_time if $verbose > 1;
## use critic
## no critic (DeepNests ExcessComplexity)
sub _munge_urls {
my( $type, $urls, $ret_vals ) = @_;
my $local_sites = {};
$local_sites = get_yaml( "$ROOT_PATH/my-sites.yaml" ) if $type eq 'local';
my $apache = get_apache_sites( "$ROOT_PATH/apache2/sites-enabled" );
my $mapper = {};
my @new_urls;
foreach my $url (@{$urls}) {
if( $url =~m{\A(https?)://([^/]+)(/.*)}mxs ) {
my( $protocol, $site, $rest ) = ($1,$2,$3);
unless( exists $mapper->{$site} ) {
if( $type eq 'local' ) {
foreach my $local ( sort keys $local_sites ) {
if( exists $apache->{$local} && $apache->{$local}[1] eq $site ) {
$mapper->{$site} = $local;
last;
} else {
( my $munged = $local ) =~ s{\A\w+-}{*-}mxs;
if( exists $apache->{$munged} && $apache->{$munged}[1] eq $site ) {
$mapper->{$site} = $local;
last;
}
}
}
} else {
foreach my $s (sort keys %{$apache}) {
next unless index $s, q(*);
my $reg = '\A(?:\w+[.])?'.$type.'[.]';
if( $s =~ m{$reg}mxs && $apache->{$s}[1] eq $site ) {
$mapper->{$site} = $s;
last;
}
}
}
}
$mapper->{$site}||=q();
unless( $mapper->{$site} ) {
printf "-skip: : %s\n", $url if $verbose > 1;
next;
}
my $new_url = "$protocol://$mapper->{$site}$rest";
push @new_urls, $new_url;
next if $new_url eq $url;
$ret_vals->{$new_url} = $ret_vals->{$url};
delete $ret_vals->{$url};
}
}
@{$urls} = @new_urls;
return;
}
## use critic
sub _get_urls {
my ($ref_ret, $ref_urls, @sites) = @_;
foreach my $site ( @sites ) {
my $dirname = "$ROOT_PATH/sites/$site/data/urls";
my $dh;
unless( opendir $dh, $dirname ) {
next;
}
my @files = grep { ! m{\A[.]}mxs && m{https?(?:-\S+)?[.]txt\Z}mxs } readdir $dh;
foreach my $file (@files) {
my ($protocol,$site_name) = $file =~ m{\A(https?)(?:-(\S+))?[.]txt}mxs ? ($1,$2) : ($file);
$site_name ||= $site;
my @url_details;
if( open my $fh, q(<), "$dirname/$file" ) {
@url_details = grep { m{\S}mxs && ! m{\A\s*[#]}mxs } <$fh>;
close $fh; ## no critic (RequireChecked)
} else {
next;
}
chomp @url_details;
my $det = shift @url_details;
while( $det || @url_details ) {
my( $url, $code ) = split m{[ ]}mxs, $det;
$code ||= q(200);
unless( $url ) {
$det = shift @url_details;
next;
}
$url = "$protocol://$site$url" unless $url =~ m{\Ahttps?://}mxs;
push @{$ref_urls}, $url;
$ref_ret->{ $url } = [ $code ];
$det = shift @url_details;
while( defined $det && ! index $det, q( ) ) {
$det =~ s{\A\s+}{}mxs;
push @{$ref_ret->{$url}}, $det;
$det = shift @url_details;
}
}
}
}
return;
}
## no critic (ExcessComplexity DeepNests)
sub _fetch {
my( $params ) = @_;
my $c = Pagesmith::Utils::Curl::Fetcher->new();
my $init = time;
my $failed_urls = {};
my $start = {};
## no critic (LongChainsOfMethodCalls)
foreach( 1..$params->{'rate'}) {
last unless @{$params->{'urls'}};
my $url = $c->new_request( shift @{$params->{'urls'}} )
->set_cookies( $params->{'cookies'} )
->set_headers( $params->{'headers'} )
->set_timeouts( $params->{'timeout'} )
->init->url;
next if $verbose <= 1;
$start->{$url} = time;
printf "-----: : %s\n", $url;
}
my $out = 0;
while( $c->has_active ) {
next if $c->active_transfers == $c->active_handles;
while( my $req = $c->next_request ) {
$out++;
my $end = time;
my $rc = $req->response->code;
my ($exp_rc,@exp_content) = @{$return_vals{$req->url}};
if( $rc ) {
delete $failed_urls->{ $req->url };
if( $exp_rc == $rc ) {
(my $content = $req->response->body) =~ s{\s+}{ }mxsg;
my $extra = $verbose > 1 ? sprintf ' %10.3f :', time-$start->{$req->url} : q();
printf "Match:%s %s\n", $extra, $req->url if $verbose;
foreach my $exp ( @exp_content ) {
if( 0 <= index $content, $exp ) {
printf " Good:%s %s (%s)\n", $extra, $req->url, $exp if $verbose;
} else {
printf " Bad:%s %s (%s)\n", $extra, $req->url, $exp;
}
}
} else {
my $extra = $verbose > 1 ? sprintf ' %10.3f :', time-$start->{$req->url} : q();
printf "Error:%s %s [ %d != %d ]\n", $extra, $req->url, $rc, $exp_rc;
}
} else {
push @{$params->{'urls'}}, $req->url if $failed_urls->{ $req->url }++ < $max_tries;
}
$c->remove( $req );
## Retry a URL if failed with timeout!
next unless @{$params->{'urls'}};
## If we have any more URLs add the new one!
my $url = $c->new_request( shift @{$params->{'urls'}} )
->set_cookies( $params->{'cookies'} )
->set_headers( $params->{'headers'} )
->set_timeouts( $params->{'timeout'} )
->init->url;
if( $verbose > 1 ) {
printf "-----: : %s\n", $url;
$start->{$url} = time;
}
sleep $SLEEP_PERIOD;
}
}
foreach ( sort keys %{$failed_urls} ) {
printf "Fatal: : $_\n";
}
return;
}
## use critic
sub _docs {
## no critic (ImplicitNewlines CheckedSyscalls)
print '
Loads a list of URLS from a file...
utilities/load-all-pages.pl
-h|--help
-f|--flush
-a|--ajax
-c|--concurrency {rate}
-m|--maxtries {no}
-t|--timeout {seconds}
Options:
-h, --help : Display this message
-f, --flush : Send flush page header
: If TWO -f are supplied flush template as well
-a, --ajax : Send ajax cookie - so ajax page is cached
-m, --maxtries : Max no of times to try each url if timed out...
-c, --concurrency : Concurrency : default 5
-t, --timeout : cURL timeout : default 60 seconds
';
## use critic
exit;
}
## use critic
sub get_yaml {
my $filename = shift;
if( open my $fh, '<', $filename ) {
local $INPUT_RECORD_SEPARATOR = undef;
my $contents = <$fh>;
close $fh; ## no critic (RequireChecked)
my $yl = YAML::Loader->new;
my $hash = eval { $yl->load( $contents ); };
if( $EVAL_ERROR ) {
warn "YAML error $filename - $EVAL_ERROR\n";
return;
}
return $hash;
}
warn "Unable to open config file\n";
return;
}
sub get_apache_sites {
my $apache_sites_dir = shift;
my $dh;
opendir $dh, $apache_sites_dir;
return unless $dh;
my @conf_files = grep { ! m{\A[.]}mxs && ! -d "$apache_sites_dir/$_" } readdir $dh;
closedir $dh;
my $domains = {};
foreach my $fn ( @conf_files ) {
## no critic (BriefOpen)
if( open my $fh, q(<), "$apache_sites_dir/$fn" ) {
my $server_name;
my $server_aliases = [];
my $docroot = q();
while(<$fh>) {
if( m{</VirtualHost>}mxs) {
if( $server_name ) {
$domains->{$_} = [ $docroot, $server_name ] foreach (@{$server_aliases},$server_name);
}
$server_name = undef;
$server_aliases = [];
$docroot = q();
} elsif( m{\A\s*Server(Name|Alias)\s+(.*?)\s+\Z}mxs ) {
my ($type,$list) = ($1,$2);
if( $type eq 'Name' ) {
$server_name = $list;
} else {
push @{$server_aliases}, $_ foreach split m{\s+}mxs, $list;
}
} elsif( m{\A\s*DocumentRoot\s*\$[{]PAGESMITH_SERVER_PATH[}]/(\S+)}mxs ) {
$docroot = $1;
}
}
close $fh; ##no critic (RequireChecked)
}
## use critic
}
return $domains;
}
| 30.083117 | 153 | 0.521067 |
ed39f13f28b16a67fa28df583800c288704ff2c4 | 6,889 | pm | Perl | hxnyclassifierMP/pipelines/lib/util/Random.pm | VirusBRC/Clade_Classification | 61727e6da624ff241f702cbe8fb408c263d39b79 | [
"MIT"
] | 6 | 2019-07-19T05:34:16.000Z | 2021-05-29T20:31:09.000Z | hxnyclassifierMP/pipelines/lib/util/Random.pm | DamieFC/Clade_Classification | c2f1cc552675bc34019b346d5b816dff70484abd | [
"MIT"
] | 1 | 2020-07-27T05:22:13.000Z | 2020-07-27T05:22:13.000Z | hxnyclassifierMP/pipelines/lib/util/Random.pm | DamieFC/Clade_Classification | c2f1cc552675bc34019b346d5b816dff70484abd | [
"MIT"
] | 1 | 2020-12-22T23:30:31.000Z | 2020-12-22T23:30:31.000Z | package util::Random;
################################################################################
#
# Required Modules
#
################################################################################
use strict;
use FileHandle;
use Pod::Usage;
use util::Constants;
use util::ErrMsgs;
use util::PathSpecifics;
use fields qw(
error_mgr
population
population_size
sample_size
);
################################################################################
#
# Constants
#
################################################################################
###
### Error Class
###
sub ERR_CAT { return util::ErrMsgs::RANDOM_CAT; }
###
### Mapping Record Tag
###
sub SAMPLE_SIZE { return 2000; }
################################################################################
#
# Private Methods
#
################################################################################
sub _getPopulation {
my util::Random $this = shift;
my ($file) = @_;
$file = getPath($file);
$this->{error_mgr}
->exitProgram( ERR_CAT, 3, [$file], !-e $file || !-f $file || !-r $file );
my $fh = new FileHandle;
$this->{error_mgr}
->exitProgram( ERR_CAT, 4, [$file], !$fh->open( $file, '<' ) );
my $whitespace = util::Constants::WHITESPACE;
my $population = [];
while ( !$fh->eof ) {
my $input_line = $fh->getline;
chomp($input_line);
next
if ( $input_line eq util::Constants::EMPTY_STR
|| $input_line =~ /^$whitespace$/
|| $input_line =~ /^#/ );
push( @{$population}, $input_line );
}
$fh->close;
return $population;
}
sub _initClass {
my util::Random $this = shift;
my ($population) = @_;
$this->{error_mgr}->exitProgram( ERR_CAT, 1, [],
!defined($population)
|| ref($population) ne 'ARRAY'
|| @{$population} == 0 );
$this->{population_size} = scalar @{$population};
$this->{population} = [ @{$population} ];
$this->{sample_size} = SAMPLE_SIZE;
}
################################################################################
#
# Constructor Methods
#
################################################################################
sub new {
my util::Random $this = shift;
my ( $population, $error_mgr ) = @_;
$this = fields::new($this) unless ref($this);
$this->{error_mgr} = $error_mgr;
$this->_initClass($population);
###
### Return the object
###
return $this;
}
sub newByFile {
my util::Random $this = shift;
my ( $file, $error_mgr ) = @_;
$this = fields::new($this) unless ref($this);
$this->{error_mgr} = $error_mgr;
$this->_initClass( $this->_getPopulation($file) );
###
### Return the object
###
return $this;
}
################################################################################
#
# Setter Methods
#
################################################################################
sub setSampleSize {
my util::Random $this = shift;
my ($sample_size) = @_;
$this->{error_mgr}->exitProgram( ERR_CAT, 2, [$sample_size],
!defined($sample_size)
|| $sample_size !~ /^\+?\d+$/
|| int($sample_size) == 0 );
$this->{sample_size} = int($sample_size);
}
sub setPopulationToSample {
my util::Random $this = shift;
$this->{population} = [ $this->getSample ];
$this->{population_size} = scalar @{ $this->{population} };
}
################################################################################
#
# Getter Methods
#
################################################################################
sub population {
my util::Random $this = shift;
return @{ $this->{population} };
}
sub populationByPrefix {
my util::Random $this = shift;
my ($prefix) = @_;
my @population = ();
foreach my $population_id ( @{ $this->{population} } ) {
next if ( $population_id !~ /^$prefix/ );
$population_id =~ s/^$prefix//;
push( @population, $population_id );
}
return @population;
}
sub getSample {
my util::Random $this = shift;
return @{ $this->{population} }
if ( $this->{sample_size} >= $this->{population_size} );
my %sample = ();
my $sample_size = 0;
while ( $sample_size < $this->{sample_size} ) {
$sample{ $this->{population}
->[ int( rand( $this->{population_size} ) - 1 ) ] } =
util::Constants::EMPTY_STR;
my @keys = keys %sample;
$sample_size = scalar @keys;
}
return keys %sample;
}
sub storeFile {
my util::Random $this = shift;
my ($file) = @_;
$file = getPath($file);
my $fh = new FileHandle;
$this->{error_mgr}
->exitProgram( ERR_CAT, 5, [$file], !$fh->open( $file, '>' ) );
foreach my $pop_id ( @{ $this->{population} } ) {
$fh->print("$pop_id\n");
}
$fh->close;
}
################################################################################
1;
__END__
=head1 NAME
Random.pm
=head1 DESCRIPTION
This class defines the mechanism for determination of a random sample
from a population of a given size.
=head1 METHODS
These methods are used for creating this class.
=head2 B<new util::Random(population, error_mgr)>
This method is the constructor for this class. The B<population> is a
non empty referenced array of the entity identifiers composing the
population. The B<error_mgr> is the the error messaging object of
L<util::ErrMgr>. By default, the sample size is set to B<2000>.
=head2 B<newByFile util::Random(file, error_mgr)>
This method is the constructor for this class. The B<file> contains
the population ids. Each population id is on a line and lines that
are empty or whitespace or start with B<#> are ignored. It is a fatal
error for the file to be inaccessible or contain no population ids.
The B<error_mgr> is the the error messaging object of L<util::ErrMgr>.
By default, the sample size is set to B<2000>.
=head1 SETTER METHODS
The following setter methods are exported for this class.
=head2 B<setSampleSize(sample_size)>
This method sets the sample_size of the object. B<sample_size> must
be a positive integer. By default, the sample_size is set to B<2000>.
=head2 B<setPopulationToSample>
This special method sets the population to a random sample as
generated by a call to L<"getSample">.
=head1 GETTER METHODS
The following getter methods are exported by this class.
=head2 B<@sample = getSample>
This method returns random sample of sample_size from the population.
If the sample_size is larger than the size of the population, then the
whole population is returned.
=head2 B<@population = population>
This method returns population as a list.
=head2 B<@population = populationByPrefix(prefix)>
This method returns sub-population with the given prefix as a list.
Each population_id will have the prefix removed.
=head2 B<storeFile(file)>
This method stores the population into the file (one population id per
line) so that it can be read by B<newByFile>.
=cut
| 26.394636 | 80 | 0.551169 |
ed46464e566dd672e979bdaf0e4274f8aa75da25 | 12,360 | pm | Perl | lib/Actium/DB/FileMaker_ODBC.pm | aaronpriven/actium | 08b26b9372a302a1470e8387a8d8a96ed43df399 | [
"Artistic-1.0"
] | 1 | 2017-01-30T04:22:33.000Z | 2017-01-30T04:22:33.000Z | lib/Actium/DB/FileMaker_ODBC.pm | aaronpriven/actium | 08b26b9372a302a1470e8387a8d8a96ed43df399 | [
"Artistic-1.0"
] | 39 | 2015-07-10T22:52:17.000Z | 2020-05-20T03:45:02.000Z | lib/Actium/DB/FileMaker_ODBC.pm | aaronpriven/actium | 08b26b9372a302a1470e8387a8d8a96ed43df399 | [
"Artistic-1.0"
] | null | null | null | package Actium::DB::FileMaker_ODBC 0.012;
# FileMaker database read via ODBC
# Specific databases will (usually) be subclasses of this one
use Actium ('class');
const my $META_TABLES => 'FileMaker_Tables';
const my $META_FIELDS => 'FileMaker_Fields';
has [qw/db_name db_user db_password/] => (
is => 'ro',
isa => 'Str',
);
has keycolumns_of_table_r => (
traits => ['Hash'],
is => 'rwp',
isa => 'HashRef[Maybe[Str]]',
handles => { keycolumn_of_table => 'get' },
);
method _connect {
my $db_name = $self->db_name;
my $cry = env->cry("Connecting to database $db_name");
my $dbh
= DBI->connect( "dbi:ODBC:$db_name", $self->db_user, $self->db_password,
{ RaiseError => 1, PrintError => 1, AutoCommit => 0 } );
$dbh->{odbc_utf8_on} = 1;
# ODBC driver has to be set to return utf-8
$cry->done;
return $dbh;
}
# ActiumDB should use an "after connect" to populate keycolumns_of_table_r
# from the FMTableKeys table in the ActiumDB
method _fetch_table_names {
my $statement
= "SELECT TableName from $META_TABLES WHERE TableName = BaseTableName";
my $ary_ref = $self->dbh->selectall_arrayref($statement);
my @tables = Actium::flatten $ary_ref;
my %is_a_table = map { $_, undef } @tables;
return \%is_a_table;
}
method _make_table_obj ($tablename, :$keycolumn? ) {
croak "No such table $tablename in database " . $self->db_name
unless $self->is_a_table($tablename);
if ( not defined $keycolumn ) {
$keycolumn = $self->keycolumn_of_table($tablename);
}
my $quoted_tablename = $self->quote_identifiers($tablename);
my $dbh = $self->dbh;
my $query
= "SELECT FieldName from $META_FIELDS WHERE TableName = $quoted_tablename";
my $ary_ref = $dbh->selectall_arrayref($query);
my @columns = Actium::flatten $ary_ref;
my $class = $self->class_of_table($tablename);
my %table_spec = (
name => $tablename,
db => $self->dbh,
columns => \@columns,
);
$table_spec{keycolumn} = $keycolumn if $keycolumn;
return $class->new(%table_spec);
}
method class_of_table {
return 'Actium::DB::Table';
}
# subclasses will override class_of_table to allow specific tables to
# be associated with particular classes, e.g., Actium::DB::ActiumDB::Signs
# or whatever
with 'Actium::DB';
Actium::immut;
__END__
=encoding utf8
=head1 NAME
Actium::DB::FileMaker_ODBC - class for using FileMaker databases via ODBC drivers
=head1 VERSION
This documentation refers to version 0.015
=head1 SYNOPSIS
use <name>;
# do something with <name>
=head1 DESCRIPTION
A full description of the module and its features.
=head1 SUBROUTINES or METHODS or ATTRIBUTES
=head2 subroutine
Description of subroutine.
=back
=head1 DIAGNOSTICS
A list of every error and warning message that the application can
generate (even the ones that will "never happen"), with a full
explanation of each problem, one or more likely causes, and any
suggested remedies. If the application generates exit status codes,
then list the exit status associated with each error.
=head1 CONFIGURATION AND ENVIRONMENT
A full explanation of any configuration system(s) used by the
application, including the names and locations of any configuration
files, and the meaning of any environment variables or properties that
can be se. These descriptions must also include details of any
configuration language used.
=head1 DEPENDENCIES
The Actium system, and...
=head1 INCOMPATIBILITIES
None known.
=head1 BUGS AND LIMITATIONS
None known. Issues are tracked on Github at
L<https://github.com/aaronpriven/actium/issues|https://github.com/aaronpriven/actium/issues>.
=head1 AUTHOR
Aaron Priven <apriven@actransit.org>
=head1 COPYRIGHT & LICENSE
Copyright 2018
This program is free software; you can redistribute it and/or modify it under
the terms of either:
=over 4
=item *
the GNU General Public License as published by the Free Software Foundation;
either version 1, or (at your option) any later version, or
=item *
the Artistic License version 2.0.
=back
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 NAME
Actium::Files::FileMaker_ODBC - role for reading from a FileMaker database
via ODBC drivers
=head1 VERSION
This documentation refers to version 0.003
=head1 SYNOPSIS
use Actium::Files::RoleComposer;
my $db = Actium::Files::RoleComposer->new();
$row_hr = $db->row('Column' , 'Keyvalue');
$othervalue = $row_hr->{OtherValue};
=head1 DESCRIPTION
Actium::Files::FileMaker_ODBC is a role for reading data from a
FileMaker database, over the network using ODBC. It uses L<DBI|DBI> and
L<DBD::ODBC|DBD::ODBC>.
=head1 METHODS
=head2 Methods that must be provided by the consuming class
=over
=item B<db_name>
The name used in the ODBC driver.
=item B<db_user>
The user name passed to the ODBC driver.
=item B<db_password>
The password passed to the ODBC driver.
=item B<key_of_table(I<table>)>
This method returns the name of the key column, if any, associated with
he given table. It must be a regular column that comes from the data,
although someday it may be allowed to provide multiple columns that are
combined to form the key.
This method, as defined in the consuming role, can assume that the
database has been connected first. This allows the keys to be defined
in the database itself rather than in the program or in other
configuration files.
=back
=head2 Methods in Actium::Files::FileMaker_ODBC
=over
=item B<dbh()>
Provides the database handle associated with this database. See
L<DBI|DBI> for information on the database handle.
=item B<row(I<table>, I<keyvalue>)>
Fetches the row of the table where the value of the key column is the
specified value. (DBI will be happy to provide the "first" row if
there is more than one row with that value, but which row is first is
undefined. It is recommended for use only on rows with unique values in
the key.)
The row is provided as a hash reference, where the keys are the column
names and the values are the values for this row.
=item B<each_row(I<table>)>
=item B<each_row_eq(I<table>, I<column>, I<value>)>
=item B<each_row_like(I<table>, I<column>, I<match>)>
=item B<each_row_where(I<table>, I<where>, I<match> ...)>
The each_row routines return an subroutine reference allowing iteration
through each row. Intended for use in C<while> loops:
my $eachtable = $database->each_row("table");
while (my $row_hr = $eachtable->() ) {
do_something_with_value($row_hr->{SomeColumn});
}
The rows are provided as hash references, where the keys are the column
names and the values are the values for this row.
each_row provides every row in the table.
each_row_eq provides every row where the column specified is equal to
the value specified.
each_row_like provides every row where the column specified matches the
SQL LIKE pattern matching characters. ("%" matches a sequence of zero
or more characters, and "_" matches any single character.)
each_row_where is more flexible, allowing the user to specify any WHERE
clause. It accepts multiple values for matching. It is necessary to
specify the WHERE keyword in the SQL.
=item B<each_columns_in_row_where(I<...>)>
Similar to the other I<each_> routines, I<each_columns_in_row_where>
returns a subroutine reference allowing iteration through each row.
Unlike those routines, this allows the specification of specific
columns, and returns an array reference instead of a hash reference.
(Note: the array reference is B<the same for each row>, so to retain
the data between calls you must copy the data and not merely keep the a
reference.)
It takes a hash or a hashref of named parameters:
=over
=item table
The required name of the SQL table.
=item where
An optional SQL "WHERE" clause. It accepts multiple values for
matching. It is necessary to specify the WHERE keyword in the SQL.
=item columns
A (required) reference to an array of column names.
=item bind_values
Optional reference to array of values to be put into placeholders in
the SQL WHERE statement.
=back
=item B<all_in_column_key(I<table>, I<column> )>
=item B<all_in_column_key(I<hashref_of_arguments>)>
all_in_column_key provides a convenient way of getting data in a hash.
It is used where only one field is required from the database, and
where the amount of data desired can be loaded into memory. It is
normally used this way:
my $hashref = $database->all_in_column_key(qw/table column/);
$value = $hashref->{$row_value};
The method returns a hashref. The keys are the key value from the
column, and the values are the values of the column specified.
The results are undefined if there is no valid key for this table.
Normally, it is invoked with a flat list of arguments: the first
argument is the table and the remaining argument is a column from the
table. Alternatively, it can be invoked with named arguments in a hash
reference:
my $hashref = $database->all_in_column_key( {
TABLE => 'table' ,
COLUMN => 'column' ,
WHERE => 'COLUMN = ?',
BIND_VALUES => [ $value ] ,
});
TABLE is the name of the table. COLUMN is the column from the table.
WHERE is optional, and allows specifying a subset of rows using an
SQLite WHERE clause. BIND_VALUES is also optional, but if present must
be an array reference of one or more values, which will be passed
through to SQLite unchanged. It is only useful if the WHERE clause will
take advantage of the bound values.
=item B<all_in_columns_key>(I<table>, I<column>, I<column> , ... )
=item B<all_in_columns_key>(I<hashref_of_arguments>)
all_in_columns_key provides a convenient way of getting data in a
two-level hash structure, and is commonly used where the amount of data
desired can be loaded into memory. It is normally used this way:
my $hashref = $database->all_in_columns_key(qw/table column_one column_two/);
$column_one_value = $hashref->{$row_value}{'column_one'}
The method returns a hashref. The keys are the key value from the
column, and the values are themselves hashrefs. In that second layer
hashref, the keys are the column names, and the values are the values.
It can be thought of as a two-dimensional hash, where the first
dimension is the key value of the row, and the second dimension the
column name.
The results are undefined if there is no valid key for this table.
Normally, it is invoked with a flat list of arguments: the first
argument is the table and the remaining arguments are columns from the
table. Alternatively, it can be invoked with named arguments in a hash
reference:
my $hashref = $database->all_in_columns_key( {
TABLE => 'table' ,
COLUMNS => [ qw/column_one column_two/ ] ,
WHERE => 'COLUMN = ?',
BIND_VALUES => [ $value ] ,
});
TABLE is the name of the table. COLUMNS must be an array reference with
a list of columns from the table. WHERE is optional, and allows
specifying a subset of rows using an SQLite WHERE clause. BIND_VALUES
is also optional, but if present must be an array reference of one or
more values, which will be passed through to SQLite unchanged. It is
only useful if the WHERE clause will take advantage of the bound
values.
=item load_tables
Documentation to be done...
Call with
load_tables (
requests => {
table1 => {
index_field => 'index_field',
array => \@array,
hash => \%hash,
ignoredupe => 0, # or 1
},
table2 => { etc. },
},
)
=back
=head1 DIAGNOSTICS
=over
=item Can't use row() on table $table with no key
Another module called the B<row> method, specifying a table with no
key. This is not valid.
=item Invalid column $column for table $table
A request specified a column that was not found in the specified table.
=item Invalid table $table for database $db_name
A request specified a table that was not found for the specified
database type.
=back
=head1 DEPENDENCIES
=over
=item perl 5.012
=item DBI
=item DBD::ODBC
=item Actium
=item Moose and Moose::Role
=item FileMaker Pro or FileMaker Server Advanced. Tested with version 12.
=back
| 26.81128 | 93 | 0.730583 |
ed65ea52239ed81ee6a767838e1dad90cc36b656 | 8,777 | al | Perl | benchmark/benchmarks/FASP-benchmarks/data/delaunay-3d-2/delaunay3d-0236-240-2223.al | krzysg/FaspHeuristic | 1929c40e3fbc49e68b04acfc5522539a18758031 | [
"MIT"
] | null | null | null | benchmark/benchmarks/FASP-benchmarks/data/delaunay-3d-2/delaunay3d-0236-240-2223.al | krzysg/FaspHeuristic | 1929c40e3fbc49e68b04acfc5522539a18758031 | [
"MIT"
] | null | null | null | benchmark/benchmarks/FASP-benchmarks/data/delaunay-3d-2/delaunay3d-0236-240-2223.al | krzysg/FaspHeuristic | 1929c40e3fbc49e68b04acfc5522539a18758031 | [
"MIT"
] | null | null | null | 1 6 16 23 27 30 75 120 129 131 139 177 217
2 26 111 202 228 232
3 10 31 109 122 156 171 190
4 6 74 125 136 161 198 200 221
5 3 18 41 85 92 109 138 153 171 203 225 230 238
6 1 4 27 30 125 129 131 187 198 200 217 221
7 97 119 222
8 24 32 61 74 78 161 189 206
9 12 64 65 66 73 87 99 150 182
10 3 55 81 112 145 156 190
11 15 39 49 81 112 143 159 160 176 203 225 230 240
12 57 66 99 100 117 182 227
13 37 64 67 89 140 173 204
14 60 88 97 98 116 143 153 159 160 176 185
15 11 25 42 61 63 73 83 107 114 143 211 236 240
16 1 23 38 75 104 105 113 177 213
17 71 90 108 196 199 229
18 41 43 109 115 122 238
19 20 27 82 95 96 129 136 164 183 200
20 23 28 45 53 69 82 96 170 183 186
21 29 33 79 96 136 148 164 165 168 183 193 215 224 227
22 32 101 108 124 149 154 180 218
23 16 28 38 45 75 82 167 177 186 192
24 8 59 61 78 80 91 121 161 189 201
25 49 55 81 83 87 93 112 141
26 2 56 202 216 218 228 232
27 1 19 20 23 30 53 129 136 167 177 186 188 221
28 29 33 53 82 130 186 193 234
29 32 130 135 158 165 183 194 195 221 229
30 1 6 27 53 71 129 131 188 194 196 221
31 3 72 91 133 155 156 157 166 171 174 184 225
32 8 17 29 42 108 114 158 187 199 211
33 21 28 29 90 124 126 130 132 146 158 195 212 239
34 37 52 76 103 147 175 181 184 209 213
35 21 86 121 128 132 165 215 224 227
36 47 58 102 178 179 181 204
37 13 50 52 64 76 77 89 152 175 179 192
38 23 41 75 92 104 105 113 152 177 220 238
39 14 59 72 98 153 159 176 203
40 35 46 54 62 100 127 182 208 227
41 18 38 85 103 104 105 109 115 138 161 175 184 198 220 238
42 15 22 32 61 94 101 108 124 180 211
43 18 38 41 92 152 175 184 192 230 238
44 116 144 199 206 207
45 20 23 28 71 186 234
46 35 36 62 86 102 123 127 178 215 227 233
47 36 79 127 134 168 178 179 204 205
48 56 117 124 126 146 172 197 228 237
49 15 39 63 81 87 112 143 159 225 240
50 37 47 75 79 82 96 134 164 168 170 204 205 234
51 8 24 59 72 78 114 159
52 65 67 76 77 103 133 155 166 173 184
53 28 29 30 45 96 183 186 193 194
54 26 48 117 121 126 128 172 195 197 201 208 232 235 239
55 10 25 93 145 157 190
56 48 54 87 101 126 172 201 202
57 40 117 182 197 210 227 235
58 13 34 36 37 52 64 76 77 102 123 175 179 181 213
59 24 72 85 91 98 153 159 161 174 189
60 44 70 88 137 144 196 199 206 207
61 15 24 32 42 51 94 101 107 114 135 240
62 57 66 100 128 155 226 235
63 7 11 15 49 114 116 143 160 176 185
64 9 13 52 65 66 67 77 84 100 102 118 123 140 141 173 179 182 190
65 9 52 66 100 102 111 133 141 151 173 190
66 12 57 62 64 118 182 226
67 76 77 89 173
68 75 119 120 131 137 169 231
69 20 28 29 45 53 234
70 14 60 88 97 98 143 207
71 28 29 30 53 130 186 194
72 24 61 80 219 225 236
73 2 9 15 25 26 87 107 151 162
74 6 8 32 131 135 137 138 139 144 187 189 196 199
75 16 38 50 120 131 152 163 169 170 177 192 204 222
76 34 37 43 77 89 115 122 173 175 184
77 13 37 67 76 89
78 24 51 59 159 161 189 206
79 134 147 168 181 205 215 233
80 61 72 83 107 145 201 202 214 216 219 223
81 10 49 55 110 112 141 156 225
82 19 69 95 96 167
83 25 49 73 80 93 107 145 162 236
84 13 36 46 100 102 123 182 204
85 31 91 109 138 161 174
86 34 35 46 52 58 102 103 123 155 161 165 184
87 15 26 48 56 94 107 180 182 218 237
88 7 14 39 60 70 98 116 119 120 137 142 144 153 207
89 13 37 67 92 152 173
90 17 29 130 149 154 188 194 212 229
91 24 59 61 72 80 85 155 161 184 201 219 223
92 5 18 38 43 89 115 122 140 152 222 230 238
93 55 73 83 110 141 145 151 157 216
94 15 26 42 87 107 121 211 236
95 50 82 129 134 147 164 167 177 205 213 224
96 20 50 69 95 148 164 170 234
97 14 60 70 88 116 119 143 160 185 207
98 14 39 51 59 60 78 137 143 185 189 206
99 57 65 66 151 197 226 228 232 235 237
100 46 57 62 64 66 102 118 182
101 22 32 42 56 61 124 126 154 158 218 229
102 36 52 62 65 84 86 118 123 128 179 215
103 4 52 105 165 191 198 233
104 16 38 41 163 169 217 220 222 230 231 238
105 4 16 41 125 139 147 175 209 220
106 80 93 110 111 141 145 151 216 219
107 15 26 61 73 87 202 236 240
108 130 154 180 199 207 211 212 229
109 5 31 85 115 138 171 174 184
110 25 55 81 141 157 190
111 2 65 118 133 151 214 223 232 235
112 25 49 55 145 157 225
113 38 75 104 169 192 217
114 32 44 51 143 159 180 185 206 211 240
115 43 122 152 184
116 7 14 88 97 143 176 180 185 207
117 54 124 150 182 227 237
118 62 64 65 102 111 128 226
119 14 39 68 75 88 97 116 120 137 160 196 207 230
120 1 30 71 75 119 131 137 186 196 207
121 24 32 35 54 56 61 101 126 135 195 201 202 208 218
122 3 5 18 89 92 109 115 140 152 156 166 230
123 34 36 58 64 179 181 215
124 15 26 56 87 94 108 117 126 130 172 218 234 239
125 4 6 105 135 139 221
126 90 121 124 146 158 172 195 212
127 21 35 46 79 132 148 164 178 182 204 215 227
128 35 40 46 54 62 86 118 132 155 208 235
129 1 16 19 27 30 95 125 136 167 177 200 217 221
130 17 29 33 45 71 108 124 149 154 194 212 234
131 6 68 74 75 137 163 169 187 196 220 231
132 21 29 40 54 121 127 208 210 227
133 31 52 65 106 141 151 155 156 157 166 173 219 223
134 47 95 164 224
135 4 8 24 29 32 103 121 161 165 188 189 206
136 21 27 103 129 165 183 191 224 233
137 68 88 98 144 187
138 153 161 189 220 238
139 6 74 131 217 220 231
140 64 65 81 89 152 173 190 222
141 9 65 66 73 81 87 93 106 110 151
142 39 68 98 119 137 153 163 203 220 222 230 231 238
143 49 51 70 97 114 159 176 185 206 240
144 8 32 44 60 98 189 196 199 206
145 25 49 72 93 106 157 159 225
146 117 124 126 172 212 239
147 34 79 95 103 105 134 136 181 200 205 209 213 215 224 233
148 21 50 96 164 168 170 239
149 17 22 32 108 154 199 212 229
150 12 48 87 124 182 204
151 2 9 93 106 111 216 226
152 37 43 76 77 89 92 115 140 192 204 222 230
153 14 39 59 74 85 98 137 138 144 163 220 231 238
154 90 108 124 126 130 229
155 31 62 65 91 102 103 111 118 133 161 166 208 219 223 235
156 3 81 122 140 166 190 225
157 3 10 31 55 72 80 106 110 133 219 225
158 29 32 33 90 121 126 135 165
159 11 14 39 49 59 61 72 78 98 145 176 225 240
160 7 11 39 97 116 119 176 230
161 24 59 85 86 91 103 135 138 189 198 208
162 73 80 93 106 107 145 202 236
163 68 104 131 142 153 169 230
164 21 50 79 96 127 136 148 183 193
165 4 29 86 121 132 136 183 191 208 221 224 233
166 3 31 67 76 109 115 184
167 19 20 23 95 177 183 186
168 21 79 127 164 178 182 204 239
169 75 104 113 163 217 222
170 20 23 28 45 82 95 148 177 192 205
171 3 203 225
172 54 117 124
173 13 52 64 77 122 133 156 166 190
174 5 39 59 72 91 153 171 184
175 34 152 184 192
176 14 160 203
177 16 23 27 38 82 95 170 186 192
178 46 47 79 84 204 215
179 13 37 47 50 58 84 102 123 181
180 15 44 63 124 130 185 199 207 211
181 34 36 37 47 50 58 79 147 170 179 191 204 213
182 36 46 66 84 117 127 150 168 178 227
183 19 21 27 29 96 164 167 188 194 221
184 41 43 52 76 85 103 109 155 161 166 174 209
185 14 44 60 63 70 97 98 180 207
186 1 23 30 53 75 120 167 177 196
187 4 6 30 74 125 131 135 188 199 221
188 17 27 29 32 183 187 207 221 229
189 4 8 24 78 85 98 138 144 153 161 198 206
190 13 31 55 64 65 81 106 133 140 141 151 156 157 219
191 34 86 103 123 147 165 181 215 224 233
192 16 38 41 50 58 105 152 181 205 209 213 222
193 21 29 33 69 96 127 130 148 164 168 183 227 234
194 17 27 30 53 130 186 188 196 207
195 29 54 121 126 132 146 158 165 172 197
196 6 17 30 60 71 74 88 120 131 137 186 187 188 199 207
197 12 40 48 57 117 132 232 237
198 4 74 105 125 138 139 161 189 200 220
199 32 44 108 114 180 187 188 196 211
200 4 6 16 95 103 105 125 136 139 177 213 217 221 224
201 24 26 54 61 155 202 208 214 223 235
202 2 26 61 73 80 94 162 201 214
203 11 72 119 142 153 160 171 174 176 225 230 238
204 37 64 84 127 148 179 181 182 192 227 234 239
205 34 95 134 177 181 192 213 215
206 8 32 44 51 61 70 74 135 143 185 199
207 17 60 71 97 120 130 149 180 185 188 196 199
208 24 35 40 54 86 91 103 121 135 161 165 201 214 223 235
209 41 103 105 175 184 213
210 40 54 117 132 150 172 182 197 204 239
211 15 22 61 94 108 114 180 199 206 236
212 90 124 126 130 149 154 180
213 16 34 58 105 175 177 209
214 2 26 80 106 151 155 202 208 223 232 235
215 36 46 47 86 147 181 191 224
216 2 73 93 107 162 202 214 236
217 1 16 38 41 75 105 131 139 200
218 15 22 26 42 48 56 61 87 94 101 124 126 202
219 31 72 106 157 174
220 6 41 74 105 131 137 139 153 189 198 217 231 238
221 4 27 29 30 103 129 135 136 165 188
222 38 68 104 113 119 120 122 142 160 163 169 204
223 80 91 106 133 155 201 208 219
224 19 79 95 134 164 200 233
225 3 5 10 11 39 122 156 157 159 160 174 203 219 230
226 65 232 235
227 40 57 117 127 168 182 197 210
228 9 54 56 73 87 151 197 232 237
229 22 32 90 126 149 158 188
230 5 18 38 104 152 160 163 169 203 222 225
231 131 137 139 142 163 169 217 220
232 2 65 111 118 151 201 214 226 228 235 237
233 35 46 86 103 215 224
234 20 28 33 50 82 124 148 170 204
235 40 54 62 66 111 118 197 201 226 232 237
236 15 49 51 61 72 80 94 107 114 145 159 216 240
237 9 12 54 57 87 99 117 150 232 235
238 5 18 43 163 230 231
239 21 54 117 124 132 146 148 150 172 193 195 197 227 234
240 15 83 107 114 145 | 36.570833 | 65 | 0.719494 |
ed977c7084d5c81693031633155de5cc4eb4ab49 | 524 | t | Perl | integration/passing-pair-class-to-sub.t | patrickbkr/roast | 0a56b31fd42cf0acda2af1788d9ce091840047da | [
"Artistic-2.0"
] | null | null | null | integration/passing-pair-class-to-sub.t | patrickbkr/roast | 0a56b31fd42cf0acda2af1788d9ce091840047da | [
"Artistic-2.0"
] | null | null | null | integration/passing-pair-class-to-sub.t | patrickbkr/roast | 0a56b31fd42cf0acda2af1788d9ce091840047da | [
"Artistic-2.0"
] | null | null | null | use v6;
use Test;
# L<S02/Mutable types/A single key-to-value association>
# There ought to be a better reference for this.
# And this test is also a candidate to be moved with other subroutine tests.
plan 2;
{
my sub foo ($x) { $x.raku }
my $pair = (a => 1);
my $Pair = $pair.WHAT;
lives-ok { foo($Pair) }, "passing ::Pair to a sub works";
}
{
my sub foo ($x) { $x.raku }
my $int = 42;
my $Int = $int.WHAT;
lives-ok { foo($Int) }, "passing ::Int to a sub works";
}
# vim: ft=perl6
| 17.466667 | 76 | 0.585878 |
ed1d99c725e420db385198ee04f77aed89a59aac | 5,003 | pm | Perl | hardware/telephony/avaya/cm/snmp/mode/trunks.pm | petneli/centreon-plugins | d131e60a1859fdd0e959623de56e6e7512c669af | [
"Apache-2.0"
] | 316 | 2015-01-18T20:37:21.000Z | 2022-03-27T00:20:35.000Z | hardware/telephony/avaya/cm/snmp/mode/trunks.pm | petneli/centreon-plugins | d131e60a1859fdd0e959623de56e6e7512c669af | [
"Apache-2.0"
] | 2,333 | 2015-04-26T19:10:19.000Z | 2022-03-31T15:35:21.000Z | hardware/telephony/avaya/cm/snmp/mode/trunks.pm | petneli/centreon-plugins | d131e60a1859fdd0e959623de56e6e7512c669af | [
"Apache-2.0"
] | 371 | 2015-01-18T20:37:23.000Z | 2022-03-22T10:10:16.000Z | #
# Copyright 2021 Centreon (http://www.centreon.com/)
#
# Centreon is a full-fledged industry-strength solution that meets
# the needs in IT infrastructure and application monitoring for
# service performance.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package hardware::telephony::avaya::cm::snmp::mode::trunks;
use base qw(centreon::plugins::templates::counter);
use strict;
use warnings;
use centreon::plugins::templates::catalog_functions qw(catalog_status_threshold catalog_status_calc);
sub custom_sig_status_output {
my ($self, %options) = @_;
my $msg = sprintf(
"state: %s [far node: %s]",
$self->{result_values}->{state},
$self->{result_values}->{far_node}
);
return $msg;
}
sub set_counters {
my ($self, %options) = @_;
$self->{maps_counters_type} = [
{ name => 'sig', type => 1, cb_prefix_output => 'prefix_sig_output', message_multiple => 'All signaling groups are ok', skipped_code => { -10 => 1 } },
];
$self->{maps_counters}->{sig} = [
{ label => 'sig-status', threshold => 0, set => {
key_values => [ { name => 'state' }, { name => 'far_node' }, { name => 'display' } ],
closure_custom_calc => \&catalog_status_calc,
closure_custom_output => $self->can('custom_sig_status_output'),
closure_custom_perfdata => sub { return 0; },
closure_custom_threshold_check => \&catalog_status_threshold,
}
},
];
}
sub prefix_sig_output {
my ($self, %options) = @_;
return "Signaling group '" . $options{instance_value}->{display} . "' ";
}
sub new {
my ($class, %options) = @_;
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
bless $self, $class;
$options{options}->add_options(arguments => {
'filter-sigid:s' => { name => 'filter_sigid' },
'unknown-sig-status:s' => { name => 'unknown_sig_status', default => '' },
'warning-sig-status:s' => { name => 'warning_sig_status', default => '' },
'critical-sig-status:s' => { name => 'critical_sig_status', default => '%{state} =~ /out-of-service/' },
});
return $self;
}
sub check_options {
my ($self, %options) = @_;
$self->SUPER::check_options(%options);
$self->change_macros(macros => [
'unknown_sig_status', 'warning_sig_status', 'critical_sig_status',
]);
}
my $mapping = {
avCmListSigGrpFarNode => { oid => '.1.3.6.1.4.1.6889.2.73.8.1.84.1.1.12' },
avCmStatusSigGrpGrpState => { oid => '.1.3.6.1.4.1.6889.2.73.8.1.85.1.1.4' },
};
sub manage_selection {
my ($self, %options) = @_;
$self->{sig} = {};
my $snmp_result = $options{snmp}->get_multiple_table(
oids => [
{ oid => $mapping->{avCmListSigGrpFarNode}->{oid} },
{ oid => $mapping->{avCmStatusSigGrpGrpState}->{oid} },
],
return_type => 1,
nothing_quit => 1
);
foreach my $oid (keys %$snmp_result) {
next if ($oid !~ /^$mapping->{avCmStatusSigGrpGrpState}->{oid}\.(.*)$/);
my $instance = $1;
my $result = $options{snmp}->map_instance(mapping => $mapping, results => $snmp_result, instance => $instance);
if (defined($self->{option_results}->{filter_sigid}) && $self->{option_results}->{filter_sigid} ne '' &&
$instance !~ /$self->{option_results}->{filter_sigid}/) {
$self->{output}->output_add(long_msg => "skipping signaling group '" . $instance . "': no matching filter.", debug => 1);
next;
}
$self->{sig}->{$instance} = {
display => $instance,
state => $result->{avCmStatusSigGrpGrpState},
far_node => defined($result->{avCmListSigGrpFarNode}) && $result->{avCmListSigGrpFarNode} ne '' ? $result->{avCmListSigGrpFarNode} : '-',
};
}
}
1;
__END__
=head1 MODE
Check trunks.
=over 8
=item B<--filter-sigid>
Filter signaling group instance (can be a regexp).
=item B<--unknown-sig-status>
Set unknown threshold for status.
Can used special variables like: %{state}, %{far_node}, %{display}
=item B<--warning-sig-status>
Set warning threshold for status.
Can used special variables like: %{state}, %{far_node}, %{display}
=item B<--critical-sig-status>
Set critical threshold for status (Default: '%{state} =~ /out-of-service/').
Can used special variables like: %{state}, %{far_node}, %{display}
=back
=cut
| 31.465409 | 159 | 0.613432 |
ed5ebe9f1e20aec484cc1fa9748312e961368a9b | 132 | t | Perl | t6/21-test.t | lablua/Perlito | 97c296f63f395ce6a9aa3cac1baeeed076b753a3 | [
"Artistic-2.0"
] | 279 | 2015-01-10T22:22:27.000Z | 2022-03-11T00:00:26.000Z | t6/21-test.t | lablua/Perlito | 97c296f63f395ce6a9aa3cac1baeeed076b753a3 | [
"Artistic-2.0"
] | 38 | 2015-07-12T20:06:59.000Z | 2022-02-01T09:23:58.000Z | t6/21-test.t | lablua/Perlito | 97c296f63f395ce6a9aa3cac1baeeed076b753a3 | [
"Artistic-2.0"
] | 31 | 2015-02-18T14:55:57.000Z | 2022-02-24T16:53:19.000Z | use v6;
class Main {
use Perlito6::Test;
Perlito6::Test::plan 1;
Perlito6::Test::ok( 1==1, "Perlito6::Test works");
}
| 14.666667 | 54 | 0.598485 |
ed760b50697abd1bacf4f2efb27ccf3205f49b54 | 42 | pl | Perl | examples/prolog/onlyRules.pl | fs191/secure-logic-programming | f7d5a7770ba6f322a12d47ddecb7844ef8a8c066 | [
"MIT"
] | null | null | null | examples/prolog/onlyRules.pl | fs191/secure-logic-programming | f7d5a7770ba6f322a12d47ddecb7844ef8a8c066 | [
"MIT"
] | 1 | 2020-11-17T13:23:49.000Z | 2020-11-17T13:23:49.000Z | examples/prolog/onlyRules.pl | fs191/secure-logic-programming | f7d5a7770ba6f322a12d47ddecb7844ef8a8c066 | [
"MIT"
] | 1 | 2020-10-26T11:52:47.000Z | 2020-10-26T11:52:47.000Z | f(X,Y) :-
X > Y,
X < 10.
?-f(10, 3).
| 7 | 11 | 0.285714 |
73dac3c2d9db56442a55755dba76c7eee6ee1ac3 | 1,341 | al | Perl | Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/BankExportImportSetup.TableExt.al | waldo1001/ALAppExtensions | 935155845bf45b631d1c34b6bcd5aec54308d50f | [
"MIT"
] | 337 | 2019-05-07T06:04:40.000Z | 2022-03-31T10:07:42.000Z | Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/BankExportImportSetup.TableExt.al | snu-development/ALAppExtensions | 371a27fe48483be776642dde19483a87ae27289c | [
"MIT"
] | 14,850 | 2019-05-07T06:04:27.000Z | 2022-03-31T19:53:28.000Z | Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/BankExportImportSetup.TableExt.al | snu-development/ALAppExtensions | 371a27fe48483be776642dde19483a87ae27289c | [
"MIT"
] | 374 | 2019-05-09T10:08:14.000Z | 2022-03-31T17:48:32.000Z | tableextension 31284 "Bank Export/Import Setup CZB" extends "Bank Export/Import Setup"
{
fields
{
field(11710; "Processing Report ID CZB"; Integer)
{
Caption = 'Processing Report ID';
TableRelation = AllObjWithCaption."Object ID" where("Object Type" = const(Report));
DataClassification = CustomerContent;
trigger OnValidate()
begin
CalcFields("Processing Report Name CZB");
end;
}
field(11711; "Processing Report Name CZB"; Text[249])
{
CalcFormula = lookup(AllObjWithCaption."Object Caption" where("Object Type" = const(Report), "Object ID" = field("Processing Report ID CZB")));
Caption = 'Processing Report Name';
Editable = false;
FieldClass = FlowField;
}
field(11712; "Default File Type CZB"; Text[10])
{
Caption = 'Default File Type';
DataClassification = CustomerContent;
}
}
procedure GetFilterTextCZB(): Text
var
FileManagement: Codeunit "File Management";
FileFilterTok: Label '*.%1', Comment = '%1 = Default File Type', Locked = true;
begin
exit(FileManagement.GetToFilterText('', StrSubstNo(FileFilterTok, "Default File Type CZB")));
end;
}
| 35.289474 | 155 | 0.590604 |
ed859afecaa714e2cf6cf5853824015c6f512ceb | 343 | t | Perl | example-perl-psgi/.cpanm/work/1459817744.11/Devel-StackTrace-AsHTML-0.15/t/release-podspell.t | NINGONDA/apcera | 60ccb872a56566bde41594546ba4e97e0d73eae0 | [
"MIT"
] | null | null | null | example-perl-psgi/.cpanm/work/1459817744.11/Devel-StackTrace-AsHTML-0.15/t/release-podspell.t | NINGONDA/apcera | 60ccb872a56566bde41594546ba4e97e0d73eae0 | [
"MIT"
] | null | null | null | example-perl-psgi/.cpanm/work/1459817744.11/Devel-StackTrace-AsHTML-0.15/t/release-podspell.t | NINGONDA/apcera | 60ccb872a56566bde41594546ba4e97e0d73eae0 | [
"MIT"
] | null | null | null |
BEGIN {
unless ($ENV{RELEASE_TESTING}) {
require Test::More;
Test::More::plan(skip_all => 'these tests are for release candidate testing');
}
}
use Test::More;
use Test::Spelling;
add_stopwords(<DATA>);
set_spell_cmd("aspell -l en list");
all_pod_files_spelling_ok('lib');
__DATA__
Tatsuhiko
Miyagawa
Kazuho
Matsuno
Oku
Tokuhiro
| 16.333333 | 82 | 0.725948 |
ed1ee424856728d8b43f64552aae1d06e632ea46 | 6,067 | pm | Perl | lib/CIHM/Meta/Hammer2/Worker.pm | crkn-rcdr/CIHM-Meta | 0c78a83ad049900b4aba060595c9002967fdee21 | [
"Artistic-2.0",
"Unlicense"
] | null | null | null | lib/CIHM/Meta/Hammer2/Worker.pm | crkn-rcdr/CIHM-Meta | 0c78a83ad049900b4aba060595c9002967fdee21 | [
"Artistic-2.0",
"Unlicense"
] | 54 | 2019-02-14T15:40:03.000Z | 2022-02-22T20:27:38.000Z | lib/CIHM/Meta/Hammer2/Worker.pm | crkn-rcdr/CIHM-Meta | 0c78a83ad049900b4aba060595c9002967fdee21 | [
"Artistic-2.0",
"Unlicense"
] | null | null | null | package CIHM::Meta::Hammer2::Worker;
use strict;
use Carp;
use AnyEvent;
use Try::Tiny;
use JSON;
use Config::General;
use Log::Log4perl;
use CIHM::Swift::Client;
use CIHM::Meta::REST::cantaloupe;
use CIHM::Meta::REST::access;
use CIHM::Meta::REST::canvas;
use CIHM::Meta::REST::internalmeta;
use CIHM::Meta::Hammer2::Process;
our $self;
sub initworker {
my $configpath = shift;
our $self;
AE::log debug => "Initworker ($$): $configpath";
$self = bless {};
Log::Log4perl->init_once("/etc/canadiana/tdr/log4perl.conf");
$self->{logger} = Log::Log4perl::get_logger("CIHM::TDR");
my %confighash = new Config::General( -ConfigFile => $configpath, )->getall;
# Undefined if no <cantaloupe> config block
if ( exists $confighash{cantaloupe} ) {
$self->{cantaloupe} = new CIHM::Meta::REST::cantaloupe(
url => $confighash{cantaloupe}{url},
jwt_secret => $confighash{cantaloupe}{password},
jwt_payload => '{"uids":[".*"]}',
type => 'application/json',
conf => $configpath,
clientattrs => { timeout => 3600 },
);
}
else {
croak "Missing <cantaloupe> configuration block in config\n";
}
# Undefined if no <access> config block
if ( exists $confighash{access} ) {
$self->{accessdb} = new CIHM::Meta::REST::access(
server => $confighash{access}{server},
database => $confighash{access}{database},
type => 'application/json',
conf => $configpath,
clientattrs => { timeout => 3600 },
);
}
else {
croak "Missing <access> configuration block in config\n";
}
# Undefined if no <canvas> config block
if ( exists $confighash{canvas} ) {
$self->{canvasdb} = new CIHM::Meta::REST::canvas(
server => $confighash{canvas}{server},
database => $confighash{canvas}{database},
type => 'application/json',
conf => $configpath,
clientattrs => { timeout => 3600 },
);
}
else {
croak "Missing <canvas> configuration block in config\n";
}
# Undefined if no <swift> config block
if ( exists $confighash{swift} ) {
my %swiftopt = ( furl_options => { timeout => 120 } );
foreach ( "server", "user", "password", "account", "furl_options" ) {
if ( exists $confighash{swift}{$_} ) {
$swiftopt{$_} = $confighash{swift}{$_};
}
}
$self->{swift} = CIHM::Swift::Client->new(%swiftopt);
$self->{preservation_files} = $confighash{swift}{container};
$self->{access_metadata} = $confighash{swift}{access_metadata};
$self->{access_files} = $confighash{swift}{access_files};
}
else {
croak "No <swift> configuration block in " . $self->configpath . "\n";
}
# Undefined if no <internalmeta2> config block
if ( exists $confighash{internalmeta2} ) {
$self->{internalmetadb} = new CIHM::Meta::REST::internalmeta(
server => $confighash{internalmeta2}{server},
database => $confighash{internalmeta2}{database},
type => 'application/json',
conf => $configpath,
clientattrs => { timeout => 3600 },
);
}
else {
croak "Missing <internalmeta2> configuration block in config\n";
}
}
# Simple accessors for now -- Do I want to Moo?
sub log {
my $self = shift;
return $self->{logger};
}
sub swift {
my $self = shift;
return $self->{swift};
}
sub cantaloupe {
my $self = shift;
return $self->{cantaloupe};
}
sub accessdb {
my $self = shift;
return $self->{accessdb};
}
sub canvasdb {
my $self = shift;
return $self->{canvasdb};
}
sub internalmetadb {
my $self = shift;
return $self->{internalmetadb};
}
sub warnings {
my $warning = shift;
our $self;
my $noid = "unknown";
# Strip wide characters before trying to log
( my $stripped = $warning ) =~ s/[^\x00-\x7f]//g;
if ($self) {
$self->{message} .= $warning;
$noid = $self->{noid};
$self->log->warn( $noid . ": $stripped" );
}
else {
say STDERR "$warning\n";
}
}
sub swing {
my ( $noid, $configpath ) = @_;
our $self;
# Capture warnings
local $SIG{__WARN__} = sub { &warnings };
if ( !$self ) {
initworker($configpath);
}
# Debugging: http://lists.schmorp.de/pipermail/anyevent/2017q2/000870.html
# $SIG{CHLD} = 'IGNORE';
$self->{noid} = $noid;
$self->{message} = '';
$self->log->info("Processing $noid");
AE::log debug => "$noid Before ($$)";
my $status;
# Handle and record any errors
try {
$status = JSON::true;
new CIHM::Meta::Hammer2::Process(
{
noid => $noid,
log => $self->log,
swift => $self->swift,
preservation_files => $self->{preservation_files},
access_metadata => $self->{access_metadata},
access_files => $self->{access_files},
cantaloupe => $self->cantaloupe,
accessdb => $self->accessdb,
canvasdb => $self->canvasdb,
internalmetadb => $self->internalmetadb,
}
)->process;
}
catch {
$status = JSON::false;
$self->log->error("$noid: $_");
$self->{message} .= "Caught: " . $_;
};
$self->postResults( $noid, $status, $self->{message} );
AE::log debug => "$noid After ($$)";
return ($noid);
}
sub postResults {
my ( $self, $noid, $status, $message ) = @_;
$self->accessdb->hammerResult(
$noid,
{
"succeeded" => $status,
"message" => $message,
}
);
}
1;
| 27.206278 | 80 | 0.524147 |
73fe29d08efdbbdce14083edd79ba8b5974a8d77 | 4,022 | t | Perl | t/11-b2revolutejoint.t | PerlGameDev/Box2D-perl | aa2eeb27fd41360d12c6c0200518aa22ed421a97 | [
"Artistic-1.0"
] | 3 | 2018-06-22T14:31:27.000Z | 2022-03-06T15:17:08.000Z | t/11-b2revolutejoint.t | PerlGameDev/Box2D-perl | aa2eeb27fd41360d12c6c0200518aa22ed421a97 | [
"Artistic-1.0"
] | null | null | null | t/11-b2revolutejoint.t | PerlGameDev/Box2D-perl | aa2eeb27fd41360d12c6c0200518aa22ed421a97 | [
"Artistic-1.0"
] | 3 | 2017-10-23T16:05:59.000Z | 2022-02-01T18:19:06.000Z | use strict;
use warnings;
use Box2D;
use Test::More;
my $gravity = Box2D::b2Vec2->new( 0.0, 0.0 );
my $world = Box2D::b2World->new( $gravity, 1 );
my ( $xA, $yA, $xB, $yB ) = ( 10.0, 20.0, 30.0, 40.0 );
my $bodyDefA = Box2D::b2BodyDef->new();
$bodyDefA->position->Set( $xA, $yA );
my $bodyA = $world->CreateBody($bodyDefA);
my $circleA = Box2D::b2CircleShape->new();
$circleA->m_radius(50.0);
$bodyA->CreateFixture( $circleA, 0.0 );
my $bodyDefB = Box2D::b2BodyDef->new();
$bodyDefB->position->Set( $xB, $yB );
$bodyDefB->type(Box2D::b2_dynamicBody);
my $bodyB = $world->CreateBody($bodyDefB);
my $circleB = Box2D::b2CircleShape->new();
$circleB->m_radius(50.0);
$bodyB->CreateFixture( $circleB, 1.0 );
my $anchor = Box2D::b2Vec2->new( ( $xA + $xB ) / 2.0, ( $yA + $yB ) / 2.0 );
my $jointDef = Box2D::b2RevoluteJointDef->new();
ok( $jointDef, "new" );
isa_ok( $jointDef, "Box2D::b2RevoluteJointDef" );
$jointDef->Initialize( $bodyA, $bodyB, $anchor );
pass("Initialize");
is( $jointDef->localAnchorA->x,
$anchor->x - $bodyA->GetWorldCenter->x,
"get localAnchorA->x"
);
is( $jointDef->localAnchorA->y,
$anchor->y - $bodyA->GetWorldCenter->y,
"get localAnchorA->y"
);
is( $jointDef->localAnchorB->x,
$anchor->x - $bodyB->GetWorldCenter->x,
"get localAnchorB->x"
);
is( $jointDef->localAnchorB->y,
$anchor->y - $bodyB->GetWorldCenter->y,
"get localAnchorB->y"
);
my ($referenceAngle, $lowerAngle, $upperAngle,
$motorSpeed, $maxMotorTorque
) = ( 0.5, 1.0, 2.0, 11.0, 13.0 );
$jointDef->referenceAngle($referenceAngle);
pass("set referenceAngle");
is( $jointDef->referenceAngle, $referenceAngle, "get referenceAngle" );
$jointDef->enableLimit(1);
pass("set enableLimit");
ok( $jointDef->enableLimit, "get enableLimit" );
$jointDef->enableLimit(0);
ok( !$jointDef->enableLimit, "get enableLimit" );
$jointDef->enableLimit(1);
$jointDef->lowerAngle($lowerAngle);
pass("set lowerAngle");
is( $jointDef->lowerAngle, $lowerAngle, "get lowerAngle" );
$jointDef->upperAngle($upperAngle);
pass("set upperAngle");
is( $jointDef->upperAngle, $upperAngle, "get upperAngle" );
$jointDef->enableMotor(1);
pass("set enableMotor");
ok( $jointDef->enableMotor, "get enableMotor" );
$jointDef->enableMotor(0);
ok( !$jointDef->enableMotor, "get enableMotor" );
$jointDef->enableMotor(1);
$jointDef->motorSpeed($motorSpeed);
pass("set motorSpeed");
is( $jointDef->motorSpeed, $motorSpeed, "get motorSpeed" );
$jointDef->maxMotorTorque($maxMotorTorque);
pass("set maxMotorTorque");
is( $jointDef->maxMotorTorque, $maxMotorTorque, "get maxMotorTorque" );
my $joint = $world->CreateJoint($jointDef);
ok( $joint, "Box2D::b2World->CreateJoint" );
isa_ok( $joint, "Box2D::b2Joint" );
bless $joint, "Box2D::b2RevoluteJoint";
isa_ok( $joint, "Box2D::b2RevoluteJoint" );
is( $joint->GetAnchorA->x, $anchor->x, "GetAnchorA->x" );
is( $joint->GetAnchorA->y, $anchor->y, "GetAnchorA->y" );
is( $joint->GetAnchorB->x, $anchor->x, "GetAnchorB->x" );
is( $joint->GetAnchorB->y, $anchor->y, "GetAnchorB->y" );
ok( $joint->IsLimitEnabled(), "IsLimitEnabled" );
$joint->EnableLimit(0);
pass("EnableLimit");
ok( !$joint->IsLimitEnabled(), "IsLimitEnabled" );
$joint->EnableLimit(1);
ok( $joint->IsLimitEnabled(), "IsLimitEnabled" );
is( $joint->GetLowerLimit(), $lowerAngle, "GetLowerLimit" );
is( $joint->GetUpperLimit(), $upperAngle, "GetUpperLimit" );
my ( $lowerLimit, $upperLimit ) = ( 1.0, 2.0 );
$joint->SetLimits( $lowerLimit, $upperLimit );
is( $joint->GetLowerLimit(), $lowerLimit, "GetLowerLimit" );
is( $joint->GetUpperLimit(), $upperLimit, "GetUpperLimit" );
ok( $joint->IsMotorEnabled(), "IsMotorEnabled" );
$joint->EnableMotor(0);
pass("EnableMotor");
ok( !$joint->IsMotorEnabled(), "IsMotorEnabled" );
$joint->EnableMotor(1);
ok( $joint->IsMotorEnabled(), "IsMotorEnabled" );
is( $joint->GetMotorSpeed(), $motorSpeed, "GetMotorSpeed" );
my $speed = 15.0;
$joint->SetMotorSpeed($speed);
pass("SetMotorSpeed");
is( $joint->GetMotorSpeed(), $speed, "GetMotorSpeed" );
done_testing;
| 30.70229 | 76 | 0.676032 |
ed91bb508aed78166f866b06eda90d29cd5fbdf1 | 408 | pl | Perl | ex-07-01.pl | ology/MIDI-Perl-HOWTO | 96a42505c1398470e78ff8c8609bdc6d221d63ac | [
"Artistic-2.0"
] | 10 | 2020-11-29T16:30:40.000Z | 2022-02-05T11:06:44.000Z | ex-07-01.pl | ology/MIDI-Perl-HOWTO | 96a42505c1398470e78ff8c8609bdc6d221d63ac | [
"Artistic-2.0"
] | null | null | null | ex-07-01.pl | ology/MIDI-Perl-HOWTO | 96a42505c1398470e78ff8c8609bdc6d221d63ac | [
"Artistic-2.0"
] | null | null | null | #!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper::Compact qw(ddc);
use Music::Scales qw(get_scale_MIDI);
use Music::VoiceGen;
my @pitches = (
get_scale_MIDI('C', 4, 'minor'),
get_scale_MIDI('C', 5, 'minor'),
);
my $voice = Music::VoiceGen->new(
pitches => \@pitches,
intervals => [qw(-4 -3 -2 -1 1 2 3 4)],
);
my @notes = map { $voice->rand } 1 .. 8;
print ddc(\@notes);
| 18.545455 | 43 | 0.60049 |
ed85d872bd0202eea5f1b0beb46f3f6d0879bc2b | 15,308 | pl | Perl | examples/crypto.pl | flub78/FTF | 4303d3106608a5228e14bdeae363c7fdbc81eff5 | [
"MIT"
] | null | null | null | examples/crypto.pl | flub78/FTF | 4303d3106608a5228e14bdeae363c7fdbc81eff5 | [
"MIT"
] | null | null | null | examples/crypto.pl | flub78/FTF | 4303d3106608a5228e14bdeae363c7fdbc81eff5 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------
# Title: Cryptography example
#
# Source - <file:../script.pl.html>
#
# Abstract:
#
# This is a script template. It derives from the <Script> class, look
# to the script class documentation for details.
#
# This example parse directories and files to count the number of
# occurence of a given pattern.
#
# Place to customize are identified by a "To customize: comment"
#
# API Example:
# Fill this section to demonstrate how to use the code.
#
# (Start code)
# (end)
#
# Usage:
# (Start code)
# usage: perl ServerTemplate.pl [options] [filenames]*
# -verbose flag, switch on verbose mode.
# -help flag, display the online help.
# -outputDirectory string, directory for outputs
# (end)
#
# Output:
# (Start code)
# (end)
# ------------------------------------------------------------------------
# To customize: replace the package name
package ScriptTemplate;
use 5.010;
use strict;
use lib "$ENV{'FTF'}/lib";
use vars qw($VERSION @ISA @EXPORT);
use Exporter;
use Script;
# Assertions are on.
use Carp::Assert;
$VERSION = 1;
@ISA = qw(Script);
# To customize: add your own libraries
use Data::Dumper;
use ExecutionContext;
use ScriptConfiguration;
use Protocol::Utilities;
use Digest::SHA1 qw(sha1 sha1_hex sha1_base64);
use Crypt::CBC;
use Crypt::Ctr;
use Crypt::OpenSSL::AES;
use IPC::Open2;
use Openssl;
use Crypt::OpenSSL::RSA;
use Crypt::OpenSSL::Random;
use Crypt::OpenSSL::DSA;
use Crypt::OpenSSL::X509;
use Crypt::DES_EDE3;
# ------------------------------------------------------------------------
# routine: random_ex
#
# Example of random generation
# ------------------------------------------------------------------------
sub random_ex {
print "Pseudo random generation\n";
my $range = 100;
srand(100);
for ( my $i = 0 ; $i < 10 ; $i++ ) {
my $random_number = int( rand($range) );
print $random_number . ", ";
}
print "\n";
srand(100);
for ( my $i = 0 ; $i < 10 ; $i++ ) {
my $random_number = int( rand($range) );
print $random_number . ", ";
}
print "\n" x 2;
}
# ------------------------------------------------------------------------
# routine: sha1_ex
#
# Example of SHA1 computation
# ------------------------------------------------------------------------
sub sha1_ex {
print "SHA1\n";
my $data = "Hello world";
$data = hexa2bin("0123456789ABCDEF");
$data = ("0123456789ABCDEF");
my $sha1 = sha1($data);
my $sha1_hexa = bin2hexa($sha1);
print "sha1 length " . length($sha1) . "\n";
print "sha1_hexa length " . length($sha1_hexa) . "\n";
print( "data = " . bin2hexa($data) . "\n" );
print( "sha1 = " . $sha1_hexa . "\n" );
print( "sha1_hex = " . sha1_hex($data) . "\n" );
print( "sha1_base64 = " . sha1_base64($data) . "\n" x 2 );
}
# ------------------------------------------------------------------------
# routine: aes_ecb
#
# Example of AES 128 in ECB mode
# ------------------------------------------------------------------------
sub aes_ecb_ex {
print "AES-ecb\n";
my $plaintext = "0123456789ABCDEF";
my $key = hexa2bin("000102030405060708090A0B0C0D0E0F");
my $cipher = new Crypt::OpenSSL::AES($key);
my $encrypted = $cipher->encrypt($plaintext);
print "plaintext = " . $plaintext . "\n";
print "encrypted = " . bin2hexa($encrypted) . "\n";
print "decrypted = " . $cipher->decrypt($encrypted) . "\n";
}
# ------------------------------------------------------------------------
# routine: aes_cbc
#
# Example of AES 128 in CBC mode
# ------------------------------------------------------------------------
sub aes_cbc_ex {
my $plaintext = "0123456789ABCDEF";
my $key = hexa2bin("000102030405060708090A0B0C0D0E0F");
print "AES-cbc\n";
my $iv = hexa2bin("00000000000000000000000000000000");
my $cbcCipher = Crypt::CBC->new(
-literal_key => 1,
-key => $key,
-iv => $iv,
-header => "none",
-keysize => 16,
-cipher => "Crypt::OpenSSL::AES"
);
print "iv = " . bin2hexa( $cbcCipher->iv() ) . "\n";
print "key = " . bin2hexa( $cbcCipher->key() ) . "\n";
$plaintext .= $plaintext . $plaintext;
print "plaintext = " . $plaintext . "\n";
my $encrypted = $cbcCipher->encrypt($plaintext);
print "encrypted = " . bin2hexa($encrypted) . "\n";
print "decrypted = " . $cbcCipher->decrypt($encrypted) . "\n";
}
sub image {
my $key = shift;
my $res = "";
while ( length($key) > 16 ) {
my $start = substr( $key, 0, 16 );
$res .= bin2hexa($start) . " ";
$key = substr( $key, 16, length($key) - 16 );
}
return $res . bin2hexa($key);
}
# ------------------------------------------------------------------------
# routine: aes_ctr_ex
#
# Example of AES 128 in CTR mode
# ------------------------------------------------------------------------
sub aes_ctr_ex {
print "\nAES-ctr\n";
my $plaintext = hexa2bin("00000000000000000000000000000000");
my $key = hexa2bin("5724C47024A1D44DC50C866FC59C21F7");
$key = hexa2bin("D17955D6B0F887D116FA635FF8D1024C");
my $iv = hexa2bin("00000000000000000000000000000000");
my $cipher = new Crypt::Ctr( $key, "Crypt::OpenSSL::AES" );
my $aes = new Crypt::OpenSSL::AES($key);
my $ciphertext2 = $aes->encrypt($plaintext);
print "ciphertext = " . image($ciphertext2) . "\n";
$plaintext = $plaintext x 4;
my $ciphertext = $cipher->encrypt($plaintext);
print "\nciphertext = " . image($ciphertext) . "\n";
$ciphertext = $cipher->encrypt($plaintext);
print "\nciphertext a second time = " . image($ciphertext) . "\n";
$cipher->reset();
$ciphertext = $cipher->encrypt($plaintext);
print "\nciphertext after reset = " . image($ciphertext) . "\n";
# Byte by byte
# Warning! I had the erroneous assumption that with a stream cipher, the concatenation
# of block of ciphered text was equal to the cipher of the concatenated block. It is wrong
# and it even seems the different cryptographic libraries have different behaviors in this
# case. So encryption have to be done for the whole block.
# So the following test is useless
# $ciphertext = "";
# for (my $i = 0; $i < length($plaintext); $i++) {
# $ciphertext .= $cipher->encrypt(substr($plaintext, $i, 1));
# }
# print "\nciphertext byte by byte = " . image($ciphertext) . "\n";
$cipher = new Crypt::Ctr( $key, "Crypt::OpenSSL::AES", 4 );
$ciphertext = $cipher->encrypt($plaintext);
print "\nciphertext initialized at 4 = " . image($ciphertext) . "\n";
$cipher->reset(4);
my $clear = $cipher->decrypt($ciphertext);
print "\nclear = " . image($clear) . "\n";
}
# ------------------------------------------------------------------------
# routine: rsa_ex
#
# Example of RSA
# ------------------------------------------------------------------------
sub rsa_ex {
print "\nRSA\n";
my ( $fd, $good_entropy );
open( $fd, "</dev/random" ) or die("cannot open /dev/random");
binmode( $fd, ":raw" );
read( $fd, $good_entropy, 16 );
close($fd);
print "entropy=" . bin2hexa($good_entropy) . "\n";
Crypt::OpenSSL::Random::random_seed($good_entropy);
Crypt::OpenSSL::RSA->import_random_seed();
print "Generation of a private/public key pair\n";
# ------------------------------------------------
my $rsa = Crypt::OpenSSL::RSA->generate_key(1024); # or
# $rsa = Crypt::OpenSSL::RSA->generate_key( 1024, $prime );
print "private key is:\n", $rsa->get_private_key_string(), "\n";
print "public key (in PKCS1 format) is:\n", $rsa->get_public_key_string(),
"\n";
print "public key (in X509 format) is:\n",
$rsa->get_public_key_x509_string();
my $private = "-----BEGIN RSA PRIVATE KEY-----
MIICXQIBAAKBgQC6/teAe7FfDKNHi+YEhKGujwKypcCrDhja/H0tpUlx0pj14jR8
9w7Bs1IYHN+3Rl2KcB0F4kxtZi4fFeoa2YDV2A1baX2FRcIDOePEkWcFpxfA+v8w
CprKPgRJZTxe/CgtKjtKYxSpHtv2++pgH5UQ2eZIUyIFOsZEtWZOCk2YKwIDAQAB
AoGAVzUqg70sB0v5ihBwgYLpdGM1uuMaa6vzY42FQ5hmHDM/Ks0H9Y+yzhs3Gg+9
NdgXH80RfAEB67NPpyetOkBdmJE1b6mGwa9dZ86xNiTDw4izJKKNryIOQeWrrjSk
7KxEca2ISHP9yCwhLDsXOymH7zYYzruPbtmiH/P51RYxiuECQQDhCZ+eDMieyc4X
EbzlkaOv7e/cm758rS34Vtbbh3nCf7cMR/zvgFA9TYJw67S8r7QjeYtNuoEZnflC
yHJ1cbTPAkEA1LlIFRggeYvl1R4K1maEZzXENKYZ8eyjpL9FtSJoP0+PdmqopUeo
CKTMjeoDMUjtoa+ateHq6MNNTmr9llg15QJBAMbDNj1l8yj0+9e6bgqiiV5RnWNQ
GH6Mg6buJJX/4dad8XKiftCXl8edl1HfjmJ+GnCe4SCFU5PpyQhofVgoV1cCQQDL
SOjWp8DZBtUzbctDiqK7EwmWmqkupUrZNKSD7gabggeCTXkuwaSV5g9JCznTznKw
0eTSLbxUhdcJunruQwv1AkA0T3ywLpoJTk/bf8nBK7jtCe2jVvSltv7CORkZk78i
+5YMlLgv65w2t6vcI8/qiUok3tluaWlwAqueS8+YDVI1
-----END RSA PRIVATE KEY-----";
my $public = "-----BEGIN RSA PUBLIC KEY-----
MIGJAoGBALr+14B7sV8Mo0eL5gSEoa6PArKlwKsOGNr8fS2lSXHSmPXiNHz3DsGz
Uhgc37dGXYpwHQXiTG1mLh8V6hrZgNXYDVtpfYVFwgM548SRZwWnF8D6/zAKmso+
BEllPF78KC0qO0pjFKke2/b76mAflRDZ5khTIgU6xkS1Zk4KTZgrAgMBAAE=
-----END RSA PUBLIC KEY-----";
my $plaintext = "The quick brown fox jumps over the lazy dog";
# $plaintext = $plaintext x 8;
print "plain text: " . " length=" . length($plaintext)
. ", text = " . $plaintext . "\n";
# Encrypt a message using the public key
my $rsa_pub = Crypt::OpenSSL::RSA->new_public_key($public);
# $rsa_pub->use_sslv23_padding(); # use_pkcs1_oaep_padding is the default
$rsa_pub->use_pkcs1_padding();
$rsa_pub->use_md5_hash();
my $ciphertext = $rsa_pub->encrypt($plaintext);
print "cipher text: length="
. length($ciphertext) . "\n"
. bin2hexa($ciphertext) . "\n";
# Decrypt it using the private key
my $rsa_priv = Crypt::OpenSSL::RSA->new_private_key($private);
$rsa_priv->use_pkcs1_padding();
$rsa_priv->use_md5_hash(); # use_sha1_hash is the default
$plaintext = $rsa_priv->decrypt($ciphertext);
print "plain text again = " . $plaintext . "\n";
# Sign the message
my $signature = $rsa_priv->sign($plaintext);
print "signature = "
. length($signature) . "\n"
. bin2hexa($signature) . "\n";
if ( $rsa_priv->verify( $plaintext, $signature ) ) {
print "Signed correctly\n";
}
else {
print "bad signature\n";
}
# Encrypt with private, decrypt with public
$ciphertext = $rsa_priv->private_encrypt($plaintext);
print "cipher text = "
. length($ciphertext) . "\n"
. bin2hexa($ciphertext) . "\n";
my $bin = $rsa_pub->public_decrypt($ciphertext);
print "(clear again) $bin\n";
if ( $rsa_pub->verify( $bin, $signature ) ) {
print "Signed correctly\n";
}
else {
print "bad signature\n";
}
}
# ------------------------------------------------------------------------
# routine: rsa_ex
#
# Example of DSA
# ------------------------------------------------------------------------
sub dsa_ex {
print "\nDSA\n";
my $dsa = Crypt::OpenSSL::DSA->generate_parameters(1024);
$dsa->generate_key;
$dsa->write_pub_key("pub.txt");
$dsa = Crypt::OpenSSL::DSA->read_pub_key("pub.txt");
$dsa->write_priv_key("priv.txt");
$dsa->write_params("params.txt");
my $pemfile = "cryptotestkey-cert.pem";
$pemfile = "pub.txt";
my $cmd = "cat $pemfile;";
print "reading $pemfile $cmd\n";
`$cmd`;
$dsa = Crypt::OpenSSL::DSA->read_pub_key($pemfile);
if ($@) {
die "error $@";
}
print Dumper($dsa);
return;
( -e $pemfile ) or die "Cannot find $pemfile";
my $dsa_priv = Crypt::OpenSSL::DSA->read_priv_key($pemfile);
print Dumper($dsa_priv);
my $dsa_pub = Crypt::OpenSSL::DSA->read_pub_key($pemfile);
if ($@) {
die "error $@";
}
print Dumper($dsa_pub);
# c key from certificate = " . bin2hexa($pub_key) . "\n";
}
# ------------------------------------------------------------------------
# routine: rsa_ex
#
# Example of DSA
# ------------------------------------------------------------------------
sub x509_ex {
print "\nX509\n";
my $pemfile = "cryptotestkey-cert.pem";
my $x509 = Crypt::OpenSSL::X509->new_from_file($pemfile);
print "pubkey=" . $x509->pubkey() . "\n";
print "subject=" . $x509->subject() . "\n";
print "issuer=" . $x509->issuer() . "\n";
print "email=". $x509->email() . "\n";
print "hash=" . $x509->hash() . "\n";
print "notBefore=" . $x509->notBefore() . "\n";
print "notAfter=" . $x509->notAfter() . "\n";
print "modulus=" . $x509->modulus() . "\n";
# print $x509->exponent() . "\n";
print "fingerprint_sha1=" . $x509->fingerprint_sha1() . "\n";
print "fingerprint_md5=" . $x509->fingerprint_md5() . "\n";
# print "fingerprint_md2=" . $x509->fingerprint_md2() . "\n";
print "as_string=" . $x509->as_string(Crypt::OpenSSL::X509::FORMAT_TEXT) . "\n";
my $pubkey = $x509->pubkey();
print "pubkey = $pubkey\n";
my $rsa_pub = Crypt::OpenSSL::RSA->new_public_key($pubkey);
print Dumper($rsa_pub);
}
# ------------------------------------------------------------------------
# routine: tdes
#
# Example of TDES
# ------------------------------------------------------------------------
sub tdes {
say "TDES";
my $clear = hexa2bin("CC0200CE0002181A");
my $key16 = hexa2bin("DE1A3AA37229FF4EB9B1AB04ECFC7D53");
my $key24 = hexa2bin("DE1A3AA37229FF4EB9B1AB04ECFC7D53DE1A3AA37229FF4E");
my $ede3 = Crypt::DES_EDE3->new($key24);
say ("clear=" . bin2hexa($clear));
say ("TDES key =" . bin2hexa($key24));
say ("length=" . length($clear));
my $encrypted = $ede3->encrypt($clear);
say("encrypted=" . bin2hexa($encrypted));
my $clear2 = $ede3->decrypt($encrypted);
say ("decrypted=" . bin2hexa($clear2));
}
# ------------------------------------------------------------------------
# routine: run
#
# Scrip main method. It is an example which recursively parse a
# set of directories and apply a treatement to each file.
# To customize:
# ------------------------------------------------------------------------
sub run {
my $Self = shift;
my $name = ExecutionContext::basename();
print "Hello I am a cryptographic example\n\n";
$Self->info("starting $name");
assert( $name ne "" );
tdes();
return;
random_ex();
sha1_ex();
aes_ecb_ex();
aes_cbc_ex();
aes_ctr_ex();
dsa_ex();
x509_ex();
rsa_ex();
$Self->info("$name is completed");
}
# ------------------------------------------------------------------------
# On line help and options.
# The full online help is the catenation of the header,
# the parameters description and the footer. Parameters description
# is automatically computed.
# To customize: you can remove help specification, remove the
# configuration file, remove additional parameters and even remove
# everything related to configuration.
my $help_header = '
Script template.
usage: perl ScriptTemplate.pl [options]';
my $help_footer = "
Exemple:
perl ScriptTemplate.pl -help
perl ScriptTemplate.pl -pattern 'o customize' my_script.pl
";
# If you specify a configuration file, it must exist.
my $configFile = ExecutionContext::configFile();
my $config = new ScriptConfiguration(
'header' => $help_header,
'footer' => $help_footer,
'scheme' => SCRIPT,
'parameters' => {
pattern => {
type => "string",
description => "pattern to search",
default => "pattern"
},
fail => {
type => "flag",
description => "force some assertions to fail",
}
},
);
# create and run the script
# To customize: replace by your package name
my $script = new ScriptTemplate( pattern => $config->value('pattern') );
$script->{'fail'} = $config->value('fail');
$script->run();
| 29.609284 | 90 | 0.58329 |
73e6134fd7c9ef676de7ae8ee0c1a88e6fb52d6a | 19,781 | t | Perl | debian/modules/http-lua/t/120-re-find.t | Metztli/debian-modsecurity-nginx-connector | 1993c8c9b1549915702d0de8df12d000673a9de0 | [
"BSD-2-Clause"
] | 16 | 2018-06-19T13:44:06.000Z | 2021-07-06T02:39:12.000Z | debian/modules/http-lua/t/120-re-find.t | Metztli/debian-modsecurity-nginx-connector | 1993c8c9b1549915702d0de8df12d000673a9de0 | [
"BSD-2-Clause"
] | 1 | 2019-03-07T09:15:47.000Z | 2019-03-10T11:23:14.000Z | debian/modules/http-lua/t/120-re-find.t | Metztli/debian-modsecurity-nginx-connector | 1993c8c9b1549915702d0de8df12d000673a9de0 | [
"BSD-2-Clause"
] | 9 | 2018-06-19T15:04:13.000Z | 2021-07-06T02:39:17.000Z | # vim:set ft= ts=4 sw=4 et fdm=marker:
use Test::Nginx::Socket::Lua;
#worker_connections(1014);
#master_on();
#workers(2);
#log_level('warn');
repeat_each(2);
plan tests => repeat_each() * (blocks() * 3 + 1);
#no_diff();
no_long_string();
run_tests();
__DATA__
=== TEST 1: sanity
--- config
location /re {
content_by_lua '
local s = "hello, 1234"
local from, to, err = ngx.re.find(s, "([0-9]+)", "jo")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
if err then
ngx.say("error: ", err)
end
ngx.say("not matched!")
end
';
}
--- request
GET /re
--- response_body
from: 8
to: 11
matched: 1234
--- no_error_log
[error]
=== TEST 2: empty matched string
--- config
location /re {
content_by_lua '
local s = "hello, world"
local from, to, err = ngx.re.find(s, "[0-9]*")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
if err then
ngx.say("error: ", err)
end
ngx.say("not matched!")
end
';
}
--- request
GET /re
--- response_body
from: 1
to: 0
matched:
--- no_error_log
[error]
=== TEST 3: multiple captures (with o)
--- config
location /re {
content_by_lua '
local s = "hello, 1234"
local from, to, err = ngx.re.find(s, "([a-z]+).*?([0-9]{2})[0-9]+", "o")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
ngx.say("not matched!")
end
';
}
--- request
GET /re
--- response_body
from: 1
to: 11
matched: hello, 1234
--- no_error_log
[error]
=== TEST 4: not matched
--- config
location /re {
content_by_lua '
local s = "hello, 1234"
local from, to, err = ngx.re.find(s, "foo")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
ngx.say("not matched.")
end
';
}
--- request
GET /re
--- response_body
not matched.
--- no_error_log
[error]
=== TEST 5: case sensitive by default
--- config
location /re {
content_by_lua '
local from = ngx.re.find("hello, 1234", "HELLO")
if from then
ngx.say(from)
else
ngx.say("not matched.")
end
';
}
--- request
GET /re
--- response_body
not matched.
--- no_error_log
[error]
=== TEST 6: case insensitive
--- config
location /re {
content_by_lua '
local s = "hello, 1234"
local from, to, err = ngx.re.find(s, "HELLO", "i")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
ngx.say("not matched.")
end
';
}
--- request
GET /re
--- response_body
from: 1
to: 5
matched: hello
--- no_error_log
[error]
=== TEST 7: UTF-8 mode
--- config
location /re {
content_by_lua '
local s = "hello章亦春"
local from, to, err = ngx.re.find(s, "HELLO.{2}", "iu")
if not from then
ngx.say("FAIL: ", err)
return
end
ngx.say(string.sub(s, from, to))
';
}
--- request
GET /re
--- response_body_like chop
^(?:FAIL: bad argument \#2 to '\?' \(pcre_compile\(\) failed: this version of PCRE is not compiled with PCRE_UTF8 support in "HELLO\.\{2\}" at "HELLO\.\{2\}"\)|hello章亦)$
--- no_error_log
[error]
=== TEST 8: multi-line mode (^ at line head)
--- config
location /re {
content_by_lua '
local s = "hello\\nworld"
local from, to, err = ngx.re.find(s, "^world", "m")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
ngx.say("not matched.")
end
';
}
--- request
GET /re
--- response_body
from: 7
to: 11
matched: world
--- no_error_log
[error]
=== TEST 9: multi-line mode (. does not match \n)
--- config
location /re {
content_by_lua '
local s = "hello\\nworld"
local from, to, err = ngx.re.find(s, ".*", "m")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
ngx.say("not matched.")
end
';
}
--- request
GET /re
--- response_body
from: 1
to: 5
matched: hello
--- no_error_log
[error]
=== TEST 10: single-line mode (^ as normal)
--- config
location /re {
content_by_lua '
local s = "hello\\nworld"
local from, to, err = ngx.re.find(s, "^world", "s")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
ngx.say("not matched.")
end
';
}
--- request
GET /re
--- response_body
not matched.
--- no_error_log
[error]
=== TEST 11: single-line mode (dot all)
--- config
location /re {
content_by_lua '
local s = "hello\\nworld"
local from, to, err = ngx.re.find(s, ".*", "s")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
ngx.say("not matched.")
end
';
}
--- request
GET /re
--- response_body
from: 1
to: 11
matched: hello
world
--- no_error_log
[error]
=== TEST 12: extended mode (ignore whitespaces)
--- config
location /re {
content_by_lua '
local s = "hello\\nworld"
local from, to, err = ngx.re.find(s, "\\\\w \\\\w", "x")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
ngx.say("not matched.")
end
';
}
--- request
GET /re
--- response_body
from: 1
to: 2
matched: he
--- no_error_log
[error]
=== TEST 13: bad pattern
--- config
location /re {
content_by_lua '
local s = "hello\\nworld"
local from, to, err = ngx.re.find(s, "(abc")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
if err then
ngx.say("error: ", err)
else
ngx.say("not matched.")
end
end
';
}
--- request
GET /re
--- response_body
error: pcre_compile() failed: missing ) in "(abc"
--- no_error_log
[error]
=== TEST 14: bad option
--- config
location /re {
content_by_lua '
local s = "hello\\nworld"
local from, to, err = ngx.re.find(s, ".*", "H")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
if err then
ngx.say("error: ", err)
return
end
ngx.say("not matched.")
end
';
}
--- request
GET /re
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log
unknown flag "H"
=== TEST 15: anchored match (failed)
--- config
location /re {
content_by_lua '
local s = "hello, 1234"
local from, to, err = ngx.re.find(s, "([0-9]+)", "a")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
if err then
ngx.say("error: ", err)
return
end
ngx.say("not matched.")
end
';
}
--- request
GET /re
--- response_body
not matched.
--- no_error_log
[error]
=== TEST 16: anchored match (succeeded)
--- config
location /re {
content_by_lua '
local s = "1234, hello"
local from, to, err = ngx.re.find(s, "([0-9]+)", "a")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
if err then
ngx.say("error: ", err)
return
end
ngx.say("not matched.")
end
';
}
--- request
GET /re
--- response_body
from: 1
to: 4
matched: 1234
--- no_error_log
[error]
=== TEST 17: match with ctx but no pos
--- config
location /re {
content_by_lua '
local ctx = {}
local from, to = ngx.re.find("1234, hello", "([0-9]+)", "", ctx)
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("pos: ", ctx.pos)
else
ngx.say("not matched!")
ngx.say("pos: ", ctx.pos)
end
';
}
--- request
GET /re
--- response_body
from: 1
to: 4
pos: 5
--- no_error_log
[error]
=== TEST 18: match with ctx and a pos
--- config
location /re {
content_by_lua '
local ctx = { pos = 3 }
local from, to, err = ngx.re.find("1234, hello", "([0-9]+)", "", ctx)
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("pos: ", ctx.pos)
else
ngx.say("not matched!")
ngx.say("pos: ", ctx.pos)
end
';
}
--- request
GET /re
--- response_body
from: 3
to: 4
pos: 5
--- no_error_log
[error]
=== TEST 19: named subpatterns w/ extraction
--- config
location /re {
content_by_lua '
local s = "hello, 1234"
local from, to, err = ngx.re.find(s, "(?<first>[a-z]+), [0-9]+")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
if err then
ngx.say("error: ", err)
return
end
ngx.say("not matched.")
end
';
}
--- request
GET /re
--- response_body
from: 1
to: 11
matched: hello, 1234
--- no_error_log
[error]
=== TEST 20: bad UTF-8
--- config
location = /t {
content_by_lua '
local target = "你好"
local regex = "你好"
local from, to, err = ngx.re.find(string.sub(target, 1, 4), regex, "u")
if err then
ngx.say("error: ", err)
return
end
if m then
ngx.say("matched: ", from)
else
ngx.say("not matched")
end
';
}
--- request
GET /t
--- response_body_like chop
^error: pcre_exec\(\) failed: -10$
--- no_error_log
[error]
=== TEST 21: UTF-8 mode without UTF-8 sequence checks
--- config
location /re {
content_by_lua '
local s = "你好"
local from, to, err = ngx.re.find(s, ".", "U")
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
ngx.say("not matched.")
end
';
}
--- stap
probe process("$LIBPCRE_PATH").function("pcre_compile") {
printf("compile opts: %x\n", $options)
}
probe process("$LIBPCRE_PATH").function("pcre_exec") {
printf("exec opts: %x\n", $options)
}
--- stap_out
compile opts: 800
exec opts: 2000
--- request
GET /re
--- response_body
from: 1
to: 3
matched: 你
--- no_error_log
[error]
=== TEST 22: just hit match limit
--- http_config
lua_regex_match_limit 5000;
--- config
location /re {
content_by_lua_file html/a.lua;
}
--- user_files
>>> a.lua
local re = [==[(?i:([\s'\"`´’‘\(\)]*)?([\d\w]+)([\s'\"`´’‘\(\)]*)?(?:=|<=>|r?like|sounds\s+like|regexp)([\s'\"`´’‘\(\)]*)?\2|([\s'\"`´’‘\(\)]*)?([\d\w]+)([\s'\"`´’‘\(\)]*)?(?:!=|<=|>=|<>|<|>|\^|is\s+not|not\s+like|not\s+regexp)([\s'\"`´’‘\(\)]*)?(?!\6)([\d\w]+))]==]
s = string.rep([[ABCDEFG]], 10)
local start = ngx.now()
local from, to, err = ngx.re.find(s, re, "o")
--[[
ngx.update_time()
local elapsed = ngx.now() - start
ngx.say(elapsed, " sec elapsed.")
]]
if not from then
if err then
ngx.say("error: ", err)
return
end
ngx.say("failed to match.")
return
end
--- request
GET /re
--- response_body
error: pcre_exec() failed: -8
--- no_error_log
[error]
=== TEST 23: just not hit match limit
--- http_config
lua_regex_match_limit 5100;
--- config
location /re {
content_by_lua_file html/a.lua;
}
--- user_files
>>> a.lua
local re = [==[(?i:([\s'\"`´’‘\(\)]*)?([\d\w]+)([\s'\"`´’‘\(\)]*)?(?:=|<=>|r?like|sounds\s+like|regexp)([\s'\"`´’‘\(\)]*)?\2|([\s'\"`´’‘\(\)]*)?([\d\w]+)([\s'\"`´’‘\(\)]*)?(?:!=|<=|>=|<>|<|>|\^|is\s+not|not\s+like|not\s+regexp)([\s'\"`´’‘\(\)]*)?(?!\6)([\d\w]+))]==]
s = string.rep([[ABCDEFG]], 10)
local start = ngx.now()
local from, to, err = ngx.re.find(s, re, "o")
--[[
ngx.update_time()
local elapsed = ngx.now() - start
ngx.say(elapsed, " sec elapsed.")
]]
if not from then
if err then
ngx.say("error: ", err)
return
end
ngx.say("failed to match")
return
end
--- request
GET /re
--- response_body
failed to match
--- no_error_log
[error]
=== TEST 24: specify the group (1)
--- config
location /re {
content_by_lua '
local s = "hello, 1234"
local from, to, err = ngx.re.find(s, "([0-9])([0-9]+)", "jo", nil, 1)
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
if err then
ngx.say("error: ", err)
end
ngx.say("not matched!")
end
';
}
--- request
GET /re
--- response_body
from: 8
to: 8
matched: 1
--- no_error_log
[error]
=== TEST 25: specify the group (0)
--- config
location /re {
content_by_lua '
local s = "hello, 1234"
local from, to, err = ngx.re.find(s, "([0-9])([0-9]+)", "jo", nil, 0)
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
if err then
ngx.say("error: ", err)
end
ngx.say("not matched!")
end
';
}
--- request
GET /re
--- response_body
from: 8
to: 11
matched: 1234
--- no_error_log
[error]
=== TEST 26: specify the group (2)
--- config
location /re {
content_by_lua '
local s = "hello, 1234"
local from, to, err = ngx.re.find(s, "([0-9])([0-9]+)", "jo", nil, 2)
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
if err then
ngx.say("error: ", err)
end
ngx.say("not matched!")
end
';
}
--- request
GET /re
--- response_body
from: 9
to: 11
matched: 234
--- no_error_log
[error]
=== TEST 27: specify the group (3)
--- config
location /re {
content_by_lua '
local s = "hello, 1234"
local from, to, err = ngx.re.find(s, "([0-9])([0-9]+)", "jo", nil, 3)
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
if err then
ngx.say("error: ", err)
return
end
ngx.say("not matched!")
end
';
}
--- request
GET /re
--- response_body
error: nth out of bound
--- no_error_log
[error]
=== TEST 28: specify the group (4)
--- config
location /re {
content_by_lua '
local s = "hello, 1234"
local from, to, err = ngx.re.find(s, "([0-9])([0-9]+)", "jo", nil, 4)
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
if err then
ngx.say("error: ", err)
return
end
ngx.say("not matched!")
end
';
}
--- request
GET /re
--- response_body
error: nth out of bound
--- no_error_log
[error]
=== TEST 29: nil submatch (2nd)
--- config
location /re {
content_by_lua '
local s = "hello, 1234"
local from, to, err = ngx.re.find(s, "([0-9])|(hello world)", "jo", nil, 2)
if from or to then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
if err then
ngx.say("error: ", err)
return
end
ngx.say("not matched!")
end
';
}
--- request
GET /re
--- response_body
not matched!
--- no_error_log
[error]
=== TEST 30: nil submatch (1st)
--- config
location /re {
content_by_lua '
local s = "hello, 1234"
local from, to, err = ngx.re.find(s, "(hello world)|([0-9])", "jo", nil, 1)
if from or to then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("matched: ", string.sub(s, from, to))
else
if err then
ngx.say("error: ", err)
return
end
ngx.say("not matched!")
end
';
}
--- request
GET /re
--- response_body
not matched!
--- no_error_log
[error]
=== TEST 31: match with ctx and a pos (anchored by \G)
--- config
location /re {
content_by_lua '
local ctx = { pos = 3 }
local from, to, err = ngx.re.find("1234, hello", [[(\G[0-9]+)]], "", ctx)
if from then
ngx.say("from: ", from)
ngx.say("to: ", to)
ngx.say("pos: ", ctx.pos)
else
ngx.say("not matched!")
ngx.say("pos: ", ctx.pos)
end
';
}
--- request
GET /re
--- response_body
from: 3
to: 4
pos: 5
--- no_error_log
[error]
| 21.501087 | 266 | 0.446085 |
73e3bcd22f48401cbbe5873f4856055fd170cb41 | 1,762 | pm | Perl | perl5/lib/perl5/HTML/FormHandler/Moose/Role.pm | jinnks/printevolve | 8c54f130000cd6ded290f5905bdc2093d9f264da | [
"Apache-2.0"
] | null | null | null | perl5/lib/perl5/HTML/FormHandler/Moose/Role.pm | jinnks/printevolve | 8c54f130000cd6ded290f5905bdc2093d9f264da | [
"Apache-2.0"
] | null | null | null | perl5/lib/perl5/HTML/FormHandler/Moose/Role.pm | jinnks/printevolve | 8c54f130000cd6ded290f5905bdc2093d9f264da | [
"Apache-2.0"
] | null | null | null | package HTML::FormHandler::Moose::Role;
# ABSTRACT: to add sugar to roles
$HTML::FormHandler::Moose::Role::VERSION = '0.40068';
use Moose::Role;
use Moose::Exporter;
Moose::Exporter->setup_import_methods(
with_caller => [ 'has_field', 'has_block', 'apply' ],
also => 'Moose::Role',
);
sub init_meta {
my $class = shift;
my %options = @_;
Moose::Role->init_meta(%options);
my $meta = Moose::Util::MetaRole::apply_metaroles(
for => $options{for_class},
role_metaroles => { role => ['HTML::FormHandler::Meta::Role'] }
);
return $meta;
}
sub has_field {
my ( $class, $name, %options ) = @_;
$class->meta->add_to_field_list( { name => $name, %options } );
}
sub has_block {
my ( $class, $name, %options ) = @_;
$class->meta->add_to_block_list( { name => $name, %options } );
}
sub apply {
my ( $class, $arrayref ) = @_;
$class->meta->add_to_apply_list( @{$arrayref} );
}
use namespace::autoclean;
1;
__END__
=pod
=encoding UTF-8
=head1 NAME
HTML::FormHandler::Moose::Role - to add sugar to roles
=head1 VERSION
version 0.40068
=head1 SYNOPSIS
Enables the use of field specification sugar (has_field) in roles.
Use this module instead of C< use Moose::Role; >
package MyApp::Form::Foo;
use HTML::FormHandler::Moose::Role;
has_field 'username' => ( type => 'Text', ... );
has_field 'something_else' => ( ... );
no HTML::FormHandler::Moose::Role;
1;
=head1 AUTHOR
FormHandler Contributors - see HTML::FormHandler
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2017 by Gerda Shank.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
| 20.729412 | 71 | 0.646992 |
ed31330e7323e11090ceb4a347890e95fd3cf992 | 1,898 | pm | Perl | auto-lib/Paws/WorkMail/Member.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/WorkMail/Member.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/WorkMail/Member.pm | 0leksii/aws-sdk-perl | b2132fe3c79a06fd15b6137e8a0eb628de722e0f | [
"Apache-2.0"
] | 87 | 2015-04-22T06:29:47.000Z | 2021-09-29T14:45:55.000Z | # Generated by default/object.tt
package Paws::WorkMail::Member;
use Moose;
has DisabledDate => (is => 'ro', isa => 'Str');
has EnabledDate => (is => 'ro', isa => 'Str');
has Id => (is => 'ro', isa => 'Str');
has Name => (is => 'ro', isa => 'Str');
has State => (is => 'ro', isa => 'Str');
has Type => (is => 'ro', isa => 'Str');
1;
### main pod documentation begin ###
=head1 NAME
Paws::WorkMail::Member
=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::WorkMail::Member object:
$service_obj->Method(Att1 => { DisabledDate => $value, ..., Type => $value });
=head3 Results returned from an API call
Use accessors for each attribute. If Att1 is expected to be an Paws::WorkMail::Member object:
$result = $service_obj->Method(...);
$result->Att1->DisabledDate
=head1 DESCRIPTION
The representation of a user or group.
=head1 ATTRIBUTES
=head2 DisabledDate => Str
The date indicating when the member was disabled from Amazon WorkMail
use.
=head2 EnabledDate => Str
The date indicating when the member was enabled for Amazon WorkMail
use.
=head2 Id => Str
The identifier of the member.
=head2 Name => Str
The name of the member.
=head2 State => Str
The state of the member, which can be ENABLED, DISABLED, or DELETED.
=head2 Type => Str
A member can be a user or group.
=head1 SEE ALSO
This class forms part of L<Paws>, describing an object used in L<Paws::WorkMail>
=head1 BUGS and CONTRIBUTIONS
The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
=cut
| 20.857143 | 102 | 0.692835 |
ed45f1547f221e7df75a3623119155db5bb01230 | 4,425 | pl | Perl | src/perl/FileConversionService/bin/fileconverter-service.pl | gaybro8777/CiteSeerX | 49ecb503fb1ced8e2c2e94c3e100e5d4dc410ea6 | [
"Apache-2.0"
] | 108 | 2015-01-05T09:22:50.000Z | 2022-03-15T23:59:53.000Z | src/perl/FileConversionService/bin/fileconverter-service.pl | gaybro8777/CiteSeerX | 49ecb503fb1ced8e2c2e94c3e100e5d4dc410ea6 | [
"Apache-2.0"
] | 26 | 2015-01-04T10:35:53.000Z | 2021-11-01T04:41:19.000Z | src/perl/FileConversionService/bin/fileconverter-service.pl | gaybro8777/CiteSeerX | 49ecb503fb1ced8e2c2e94c3e100e5d4dc410ea6 | [
"Apache-2.0"
] | 48 | 2015-01-16T02:03:48.000Z | 2022-03-15T23:59:55.000Z | #!/opt/ActivePerl-5.8/bin/perl
#
# Copyright 2007 Penn State University
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Starts a web service using SOAP::Lite that handles requests
# for file conversion. For message details, see the WSDL file
# in the wsdl/ directory of the FileConverter distribution.
#
# Input messages must include a pointer to the location of a
# file to be converted. There must be local access to this
# file via a standard or networked file system.
#
# Isaac Councill, 09/07/07
#
exit(0) if fork;
use strict;
#use SOAP::Lite +trace=>'debug';
use SOAP::Transport::HTTP;
use FindBin;
use lib "$FindBin::Bin/../lib";
use FileConverter::Config;
use Log::Log4perl qw(get_logger :levels);
$SIG{'PIPE'} = $SIG{'INT'} = 'IGNORE';
open (STDERR, ">>$FindBin::Bin/../fileconv.err");
my $serverURL = $FileConverter::Config::serverURL;
my $serverPort = $FileConverter::Config::serverPort;
my $daemon = SOAP::Transport::HTTP::Daemon
->new ('LocalAddr' => $serverURL, 'LocalPort' => $serverPort)
->dispatch_to('FileConverter');
## Initialize Logging
my $logger = get_logger("FileConverter");
$logger->level($INFO);
my $appender = Log::Log4perl::Appender
->new("Log::Dispatch::File",
filename => "$FindBin::Bin/../fileconv.log",
mode => "append",
);
my $layout = Log::Log4perl::Layout::PatternLayout
->new("%d %p> %F{1}:%L - %m%n");
$appender->layout($layout);
$logger->add_appender($appender);
$logger->info("Server started at ".$daemon->url);
$daemon->handle;
##
# Service Module
#
# Passes control to the FileConverter::Controller module and provides
# a SOAP wrapping for the response.
#
##
package FileConverter;
use FindBin;
use lib "$FindBin::Bin/../lib";
use FileConverter::Controller;
use FileConverter::Config;
use Time::HiRes qw(tv_interval gettimeofday);
use Log::Log4perl qw(get_logger);
sub extractText {
my ($class, $filePath, $repositoryID) = @_;
my $logger = get_logger("FileConverter");
my $t0 = [gettimeofday];
my $repositoryLocation;
if ($repositoryID ne "LOCAL") {
$repositoryLocation =
$FileConverter::Config::repositories{$repositoryID};
if (!defined $repositoryLocation) {
my $msg = "Unknown repository: $repositoryID";
$logger->error($msg);
die_with_fileconvfault('Sender', $msg);
} else {
$filePath = "$repositoryLocation/$filePath";
}
}
if (! -e $filePath) {
my $msg = "File does not exist: $filePath";
$logger->error($msg);
die_with_fileconvfault('Sender', $msg);
}
if (-d $filePath) {
my $msg = "Specified file is a directory: $filePath";
$logger->error($msg);
die_with_fileconvfault('Sender', $msg);
}
my ($status, $msg, $textFilePath, $rTrace) =
FileConverter::Controller::extractText($filePath);
if ($status > 0) {
my $relTextPath = makeRelative($textFilePath, $repositoryLocation);
my $trace = join ",", @$rTrace;
my $elapsed = tv_interval($t0, [gettimeofday]);
$logger->info("extractText: $elapsed");
my $uri = $FileConverter::Config::URI;
return SOAP::Data->name('filePath' =>
$relTextPath),
SOAP::Data->name('conversionTrace' =>
$trace);
} else {
$logger->error($msg);
die_with_fileconvfault('Receiver', $msg);
}
} # extractText
sub die_with_fileconvfault {
my ($faultcode, $msg) = @_;
my $uri = $FileConverter::Config::URI;
my $obj = SOAP::Data
->name('FileConversionFault' =>
\SOAP::Data->value(SOAP::Data->name('message' => $msg)))
->uri($uri);
my $serverURL = $FileConverter::Config::serverURL;
die SOAP::Fault
->faultcode($faultcode)
->faultstring($msg)
->faultdetail($obj)
->faultactor($serverURL);
} # die_with_fileconvfault
sub makeRelative {
my ($fpath, $repLoc) = @_;
if (!defined $repLoc || $repLoc =~ /^\s*$/) {
return $fpath;
}
my $newPath = substr $fpath, length($repLoc);
$newPath =~ s/^\/+//;
return $newPath;
} # makeRelative
1;
| 26.029412 | 74 | 0.672542 |
ed216dea9855f6f3932f8f416d4ba71f78637b2e | 2,416 | t | Perl | t/sass.t | Martchus/mojolicious-plugin-assetpack | 347b7e6dd9a8c5813d02e02e44440f2c9eec1bef | [
"ClArtistic"
] | null | null | null | t/sass.t | Martchus/mojolicious-plugin-assetpack | 347b7e6dd9a8c5813d02e02e44440f2c9eec1bef | [
"ClArtistic"
] | null | null | null | t/sass.t | Martchus/mojolicious-plugin-assetpack | 347b7e6dd9a8c5813d02e02e44440f2c9eec1bef | [
"ClArtistic"
] | null | null | null | use lib '.';
use t::Helper;
plan skip_all => 'cpanm CSS::Sass' unless eval 'use CSS::Sass 3.3.0;1';
my $t = t::Helper->t(pipes => [qw(Sass Css)]);
$t->app->asset->process('app.css' => ('sass-one.sass', 'sass-two.scss'));
$t->get_ok('/')->status_is(200)->element_exists(qq(link[href="/asset/5660087922/sass-one.css"]))
->element_exists(qq(link[href="/asset/a2245cadf4/sass-two.css"]));
my $html = $t->tx->res->dom;
$t->get_ok($html->at('link:nth-of-child(1)')->{href})->status_is(200)->content_like(qr{\.sass\W+color:\s+\#aaa}s);
$t->get_ok($html->at('link:nth-of-child(2)')->{href})->status_is(200)
->content_like(qr{body\W+background:.*\.scss \.nested\W+color:\s+\#9\d9\d9\d}s);
$ENV{MOJO_MODE} = 'Test_minify_from_here';
# Assets from __DATA__
$t = t::Helper->t(pipes => [qw(Sass Css Combine)]);
$t->app->asset->process('app.css' => ('sass-one.sass', 'sass-two.scss'));
$t->get_ok('/')->status_is(200)->element_exists(qq(link[href="/asset/08eb78e42a/app.css"]));
$t->get_ok($t->tx->res->dom->at('link')->{href})->status_is(200)->content_like(qr/\nbody\{background:#fff\}/);
if (-e '.test-everything') {
my @content = split /[\r?\n]/, $t->tx->res->text;
is $content[0], '.sass{color:#aaa}', 'line1';
is $content[1], 'body{background:#fff}.scss{color:#aaa}.scss .nested{color:#939393}', 'line2';
}
Mojo::Util::monkey_patch('CSS::Sass', sass2scss => sub { die 'Nope!' });
$t = t::Helper->t(pipes => [qw(Sass Css Combine)]);
ok eval { $t->app->asset->process('app.css' => ('sass-one.sass', 'sass-two.scss')) }, 'using cached assets' or diag $@;
# Assets from disk
$t = t::Helper->t(pipes => [qw(Sass Css Combine)]);
$t->app->asset->process('app.css' => 'sass/sass-1.scss');
$t->get_ok('/')->status_is(200)->element_exists(qq(link[href="/asset/4abbb4a8c8/app.css"]));
$t->get_ok($t->tx->res->dom->at('link')->{href})->status_is(200)->content_like(qr{footer.*\#aaa.*body.*\#222}s);
# Duplicate @import
$t = t::Helper->t(pipes => [qw(Sass Css Combine)]);
ok eval { $t->app->asset->process('dup.css' => 'sass/sass-2-dup.scss') }, 'sass with duplicate @imports' or diag $@;
done_testing;
__DATA__
@@ index.html.ep
%= asset 'app.css'
@@ sass-one.sass
$color: #aaa;
.sass
color: $color;
@@ sass-two.scss
// .foo { @import "sass-two.scss"; }`).
@import "sass-0-include";
$color: #aaa;
.scss {
color: $color;
.nested { color: darken($color, 9%); }
}
@@ sass-0-include.scss
body { background: #fff; }
| 38.349206 | 119 | 0.625414 |
ed6d1618819c7e5252aebb96c12d6d58a383086b | 129,742 | t | Perl | S15-normalization/nfkc-7.t | mryan/perl6-roast | 513da79cd0522e041d76c0845b3069f28e7d8e6c | [
"Artistic-2.0"
] | null | null | null | S15-normalization/nfkc-7.t | mryan/perl6-roast | 513da79cd0522e041d76c0845b3069f28e7d8e6c | [
"Artistic-2.0"
] | null | null | null | S15-normalization/nfkc-7.t | mryan/perl6-roast | 513da79cd0522e041d76c0845b3069f28e7d8e6c | [
"Artistic-2.0"
] | null | null | null | use v6;
# Unicode normalization tests, generated from NormalizationTests.txt in the
# Unicode database by S15-normalization/test-gen.p6.
# Generated from Unicode version 9.0.0.
use Test;
plan 2000;
ok Uni.new(0xFAD9).NFKC.list ~~ (0x9F8E,), 'FAD9 -> 9F8E';
ok Uni.new(0xFB00).NFKC.list ~~ (0x0066, 0x0066,), 'FB00 -> 0066 0066';
ok Uni.new(0xFB01).NFKC.list ~~ (0x0066, 0x0069,), 'FB01 -> 0066 0069';
ok Uni.new(0xFB02).NFKC.list ~~ (0x0066, 0x006C,), 'FB02 -> 0066 006C';
ok Uni.new(0xFB03).NFKC.list ~~ (0x0066, 0x0066, 0x0069,), 'FB03 -> 0066 0066 0069';
ok Uni.new(0xFB04).NFKC.list ~~ (0x0066, 0x0066, 0x006C,), 'FB04 -> 0066 0066 006C';
ok Uni.new(0xFB05).NFKC.list ~~ (0x0073, 0x0074,), 'FB05 -> 0073 0074';
ok Uni.new(0xFB06).NFKC.list ~~ (0x0073, 0x0074,), 'FB06 -> 0073 0074';
ok Uni.new(0xFB13).NFKC.list ~~ (0x0574, 0x0576,), 'FB13 -> 0574 0576';
ok Uni.new(0xFB14).NFKC.list ~~ (0x0574, 0x0565,), 'FB14 -> 0574 0565';
ok Uni.new(0xFB15).NFKC.list ~~ (0x0574, 0x056B,), 'FB15 -> 0574 056B';
ok Uni.new(0xFB16).NFKC.list ~~ (0x057E, 0x0576,), 'FB16 -> 057E 0576';
ok Uni.new(0xFB17).NFKC.list ~~ (0x0574, 0x056D,), 'FB17 -> 0574 056D';
ok Uni.new(0xFB1D).NFKC.list ~~ (0x05D9, 0x05B4,), 'FB1D -> 05D9 05B4';
ok Uni.new(0xFB1F).NFKC.list ~~ (0x05F2, 0x05B7,), 'FB1F -> 05F2 05B7';
ok Uni.new(0xFB20).NFKC.list ~~ (0x05E2,), 'FB20 -> 05E2';
ok Uni.new(0xFB21).NFKC.list ~~ (0x05D0,), 'FB21 -> 05D0';
ok Uni.new(0xFB22).NFKC.list ~~ (0x05D3,), 'FB22 -> 05D3';
ok Uni.new(0xFB23).NFKC.list ~~ (0x05D4,), 'FB23 -> 05D4';
ok Uni.new(0xFB24).NFKC.list ~~ (0x05DB,), 'FB24 -> 05DB';
ok Uni.new(0xFB25).NFKC.list ~~ (0x05DC,), 'FB25 -> 05DC';
ok Uni.new(0xFB26).NFKC.list ~~ (0x05DD,), 'FB26 -> 05DD';
ok Uni.new(0xFB27).NFKC.list ~~ (0x05E8,), 'FB27 -> 05E8';
ok Uni.new(0xFB28).NFKC.list ~~ (0x05EA,), 'FB28 -> 05EA';
ok Uni.new(0xFB29).NFKC.list ~~ (0x002B,), 'FB29 -> 002B';
ok Uni.new(0xFB2A).NFKC.list ~~ (0x05E9, 0x05C1,), 'FB2A -> 05E9 05C1';
ok Uni.new(0xFB2B).NFKC.list ~~ (0x05E9, 0x05C2,), 'FB2B -> 05E9 05C2';
ok Uni.new(0xFB2C).NFKC.list ~~ (0x05E9, 0x05BC, 0x05C1,), 'FB2C -> 05E9 05BC 05C1';
ok Uni.new(0xFB2D).NFKC.list ~~ (0x05E9, 0x05BC, 0x05C2,), 'FB2D -> 05E9 05BC 05C2';
ok Uni.new(0xFB2E).NFKC.list ~~ (0x05D0, 0x05B7,), 'FB2E -> 05D0 05B7';
ok Uni.new(0xFB2F).NFKC.list ~~ (0x05D0, 0x05B8,), 'FB2F -> 05D0 05B8';
ok Uni.new(0xFB30).NFKC.list ~~ (0x05D0, 0x05BC,), 'FB30 -> 05D0 05BC';
ok Uni.new(0xFB31).NFKC.list ~~ (0x05D1, 0x05BC,), 'FB31 -> 05D1 05BC';
ok Uni.new(0xFB32).NFKC.list ~~ (0x05D2, 0x05BC,), 'FB32 -> 05D2 05BC';
ok Uni.new(0xFB33).NFKC.list ~~ (0x05D3, 0x05BC,), 'FB33 -> 05D3 05BC';
ok Uni.new(0xFB34).NFKC.list ~~ (0x05D4, 0x05BC,), 'FB34 -> 05D4 05BC';
ok Uni.new(0xFB35).NFKC.list ~~ (0x05D5, 0x05BC,), 'FB35 -> 05D5 05BC';
ok Uni.new(0xFB36).NFKC.list ~~ (0x05D6, 0x05BC,), 'FB36 -> 05D6 05BC';
ok Uni.new(0xFB38).NFKC.list ~~ (0x05D8, 0x05BC,), 'FB38 -> 05D8 05BC';
ok Uni.new(0xFB39).NFKC.list ~~ (0x05D9, 0x05BC,), 'FB39 -> 05D9 05BC';
ok Uni.new(0xFB3A).NFKC.list ~~ (0x05DA, 0x05BC,), 'FB3A -> 05DA 05BC';
ok Uni.new(0xFB3B).NFKC.list ~~ (0x05DB, 0x05BC,), 'FB3B -> 05DB 05BC';
ok Uni.new(0xFB3C).NFKC.list ~~ (0x05DC, 0x05BC,), 'FB3C -> 05DC 05BC';
ok Uni.new(0xFB3E).NFKC.list ~~ (0x05DE, 0x05BC,), 'FB3E -> 05DE 05BC';
ok Uni.new(0xFB40).NFKC.list ~~ (0x05E0, 0x05BC,), 'FB40 -> 05E0 05BC';
ok Uni.new(0xFB41).NFKC.list ~~ (0x05E1, 0x05BC,), 'FB41 -> 05E1 05BC';
ok Uni.new(0xFB43).NFKC.list ~~ (0x05E3, 0x05BC,), 'FB43 -> 05E3 05BC';
ok Uni.new(0xFB44).NFKC.list ~~ (0x05E4, 0x05BC,), 'FB44 -> 05E4 05BC';
ok Uni.new(0xFB46).NFKC.list ~~ (0x05E6, 0x05BC,), 'FB46 -> 05E6 05BC';
ok Uni.new(0xFB47).NFKC.list ~~ (0x05E7, 0x05BC,), 'FB47 -> 05E7 05BC';
ok Uni.new(0xFB48).NFKC.list ~~ (0x05E8, 0x05BC,), 'FB48 -> 05E8 05BC';
ok Uni.new(0xFB49).NFKC.list ~~ (0x05E9, 0x05BC,), 'FB49 -> 05E9 05BC';
ok Uni.new(0xFB4A).NFKC.list ~~ (0x05EA, 0x05BC,), 'FB4A -> 05EA 05BC';
ok Uni.new(0xFB4B).NFKC.list ~~ (0x05D5, 0x05B9,), 'FB4B -> 05D5 05B9';
ok Uni.new(0xFB4C).NFKC.list ~~ (0x05D1, 0x05BF,), 'FB4C -> 05D1 05BF';
ok Uni.new(0xFB4D).NFKC.list ~~ (0x05DB, 0x05BF,), 'FB4D -> 05DB 05BF';
ok Uni.new(0xFB4E).NFKC.list ~~ (0x05E4, 0x05BF,), 'FB4E -> 05E4 05BF';
ok Uni.new(0xFB4F).NFKC.list ~~ (0x05D0, 0x05DC,), 'FB4F -> 05D0 05DC';
ok Uni.new(0xFB50).NFKC.list ~~ (0x0671,), 'FB50 -> 0671';
ok Uni.new(0xFB51).NFKC.list ~~ (0x0671,), 'FB51 -> 0671';
ok Uni.new(0xFB52).NFKC.list ~~ (0x067B,), 'FB52 -> 067B';
ok Uni.new(0xFB53).NFKC.list ~~ (0x067B,), 'FB53 -> 067B';
ok Uni.new(0xFB54).NFKC.list ~~ (0x067B,), 'FB54 -> 067B';
ok Uni.new(0xFB55).NFKC.list ~~ (0x067B,), 'FB55 -> 067B';
ok Uni.new(0xFB56).NFKC.list ~~ (0x067E,), 'FB56 -> 067E';
ok Uni.new(0xFB57).NFKC.list ~~ (0x067E,), 'FB57 -> 067E';
ok Uni.new(0xFB58).NFKC.list ~~ (0x067E,), 'FB58 -> 067E';
ok Uni.new(0xFB59).NFKC.list ~~ (0x067E,), 'FB59 -> 067E';
ok Uni.new(0xFB5A).NFKC.list ~~ (0x0680,), 'FB5A -> 0680';
ok Uni.new(0xFB5B).NFKC.list ~~ (0x0680,), 'FB5B -> 0680';
ok Uni.new(0xFB5C).NFKC.list ~~ (0x0680,), 'FB5C -> 0680';
ok Uni.new(0xFB5D).NFKC.list ~~ (0x0680,), 'FB5D -> 0680';
ok Uni.new(0xFB5E).NFKC.list ~~ (0x067A,), 'FB5E -> 067A';
ok Uni.new(0xFB5F).NFKC.list ~~ (0x067A,), 'FB5F -> 067A';
ok Uni.new(0xFB60).NFKC.list ~~ (0x067A,), 'FB60 -> 067A';
ok Uni.new(0xFB61).NFKC.list ~~ (0x067A,), 'FB61 -> 067A';
ok Uni.new(0xFB62).NFKC.list ~~ (0x067F,), 'FB62 -> 067F';
ok Uni.new(0xFB63).NFKC.list ~~ (0x067F,), 'FB63 -> 067F';
ok Uni.new(0xFB64).NFKC.list ~~ (0x067F,), 'FB64 -> 067F';
ok Uni.new(0xFB65).NFKC.list ~~ (0x067F,), 'FB65 -> 067F';
ok Uni.new(0xFB66).NFKC.list ~~ (0x0679,), 'FB66 -> 0679';
ok Uni.new(0xFB67).NFKC.list ~~ (0x0679,), 'FB67 -> 0679';
ok Uni.new(0xFB68).NFKC.list ~~ (0x0679,), 'FB68 -> 0679';
ok Uni.new(0xFB69).NFKC.list ~~ (0x0679,), 'FB69 -> 0679';
ok Uni.new(0xFB6A).NFKC.list ~~ (0x06A4,), 'FB6A -> 06A4';
ok Uni.new(0xFB6B).NFKC.list ~~ (0x06A4,), 'FB6B -> 06A4';
ok Uni.new(0xFB6C).NFKC.list ~~ (0x06A4,), 'FB6C -> 06A4';
ok Uni.new(0xFB6D).NFKC.list ~~ (0x06A4,), 'FB6D -> 06A4';
ok Uni.new(0xFB6E).NFKC.list ~~ (0x06A6,), 'FB6E -> 06A6';
ok Uni.new(0xFB6F).NFKC.list ~~ (0x06A6,), 'FB6F -> 06A6';
ok Uni.new(0xFB70).NFKC.list ~~ (0x06A6,), 'FB70 -> 06A6';
ok Uni.new(0xFB71).NFKC.list ~~ (0x06A6,), 'FB71 -> 06A6';
ok Uni.new(0xFB72).NFKC.list ~~ (0x0684,), 'FB72 -> 0684';
ok Uni.new(0xFB73).NFKC.list ~~ (0x0684,), 'FB73 -> 0684';
ok Uni.new(0xFB74).NFKC.list ~~ (0x0684,), 'FB74 -> 0684';
ok Uni.new(0xFB75).NFKC.list ~~ (0x0684,), 'FB75 -> 0684';
ok Uni.new(0xFB76).NFKC.list ~~ (0x0683,), 'FB76 -> 0683';
ok Uni.new(0xFB77).NFKC.list ~~ (0x0683,), 'FB77 -> 0683';
ok Uni.new(0xFB78).NFKC.list ~~ (0x0683,), 'FB78 -> 0683';
ok Uni.new(0xFB79).NFKC.list ~~ (0x0683,), 'FB79 -> 0683';
ok Uni.new(0xFB7A).NFKC.list ~~ (0x0686,), 'FB7A -> 0686';
ok Uni.new(0xFB7B).NFKC.list ~~ (0x0686,), 'FB7B -> 0686';
ok Uni.new(0xFB7C).NFKC.list ~~ (0x0686,), 'FB7C -> 0686';
ok Uni.new(0xFB7D).NFKC.list ~~ (0x0686,), 'FB7D -> 0686';
ok Uni.new(0xFB7E).NFKC.list ~~ (0x0687,), 'FB7E -> 0687';
ok Uni.new(0xFB7F).NFKC.list ~~ (0x0687,), 'FB7F -> 0687';
ok Uni.new(0xFB80).NFKC.list ~~ (0x0687,), 'FB80 -> 0687';
ok Uni.new(0xFB81).NFKC.list ~~ (0x0687,), 'FB81 -> 0687';
ok Uni.new(0xFB82).NFKC.list ~~ (0x068D,), 'FB82 -> 068D';
ok Uni.new(0xFB83).NFKC.list ~~ (0x068D,), 'FB83 -> 068D';
ok Uni.new(0xFB84).NFKC.list ~~ (0x068C,), 'FB84 -> 068C';
ok Uni.new(0xFB85).NFKC.list ~~ (0x068C,), 'FB85 -> 068C';
ok Uni.new(0xFB86).NFKC.list ~~ (0x068E,), 'FB86 -> 068E';
ok Uni.new(0xFB87).NFKC.list ~~ (0x068E,), 'FB87 -> 068E';
ok Uni.new(0xFB88).NFKC.list ~~ (0x0688,), 'FB88 -> 0688';
ok Uni.new(0xFB89).NFKC.list ~~ (0x0688,), 'FB89 -> 0688';
ok Uni.new(0xFB8A).NFKC.list ~~ (0x0698,), 'FB8A -> 0698';
ok Uni.new(0xFB8B).NFKC.list ~~ (0x0698,), 'FB8B -> 0698';
ok Uni.new(0xFB8C).NFKC.list ~~ (0x0691,), 'FB8C -> 0691';
ok Uni.new(0xFB8D).NFKC.list ~~ (0x0691,), 'FB8D -> 0691';
ok Uni.new(0xFB8E).NFKC.list ~~ (0x06A9,), 'FB8E -> 06A9';
ok Uni.new(0xFB8F).NFKC.list ~~ (0x06A9,), 'FB8F -> 06A9';
ok Uni.new(0xFB90).NFKC.list ~~ (0x06A9,), 'FB90 -> 06A9';
ok Uni.new(0xFB91).NFKC.list ~~ (0x06A9,), 'FB91 -> 06A9';
ok Uni.new(0xFB92).NFKC.list ~~ (0x06AF,), 'FB92 -> 06AF';
ok Uni.new(0xFB93).NFKC.list ~~ (0x06AF,), 'FB93 -> 06AF';
ok Uni.new(0xFB94).NFKC.list ~~ (0x06AF,), 'FB94 -> 06AF';
ok Uni.new(0xFB95).NFKC.list ~~ (0x06AF,), 'FB95 -> 06AF';
ok Uni.new(0xFB96).NFKC.list ~~ (0x06B3,), 'FB96 -> 06B3';
ok Uni.new(0xFB97).NFKC.list ~~ (0x06B3,), 'FB97 -> 06B3';
ok Uni.new(0xFB98).NFKC.list ~~ (0x06B3,), 'FB98 -> 06B3';
ok Uni.new(0xFB99).NFKC.list ~~ (0x06B3,), 'FB99 -> 06B3';
ok Uni.new(0xFB9A).NFKC.list ~~ (0x06B1,), 'FB9A -> 06B1';
ok Uni.new(0xFB9B).NFKC.list ~~ (0x06B1,), 'FB9B -> 06B1';
ok Uni.new(0xFB9C).NFKC.list ~~ (0x06B1,), 'FB9C -> 06B1';
ok Uni.new(0xFB9D).NFKC.list ~~ (0x06B1,), 'FB9D -> 06B1';
ok Uni.new(0xFB9E).NFKC.list ~~ (0x06BA,), 'FB9E -> 06BA';
ok Uni.new(0xFB9F).NFKC.list ~~ (0x06BA,), 'FB9F -> 06BA';
ok Uni.new(0xFBA0).NFKC.list ~~ (0x06BB,), 'FBA0 -> 06BB';
ok Uni.new(0xFBA1).NFKC.list ~~ (0x06BB,), 'FBA1 -> 06BB';
ok Uni.new(0xFBA2).NFKC.list ~~ (0x06BB,), 'FBA2 -> 06BB';
ok Uni.new(0xFBA3).NFKC.list ~~ (0x06BB,), 'FBA3 -> 06BB';
ok Uni.new(0xFBA4).NFKC.list ~~ (0x06C0,), 'FBA4 -> 06C0';
ok Uni.new(0xFBA5).NFKC.list ~~ (0x06C0,), 'FBA5 -> 06C0';
ok Uni.new(0xFBA6).NFKC.list ~~ (0x06C1,), 'FBA6 -> 06C1';
ok Uni.new(0xFBA7).NFKC.list ~~ (0x06C1,), 'FBA7 -> 06C1';
ok Uni.new(0xFBA8).NFKC.list ~~ (0x06C1,), 'FBA8 -> 06C1';
ok Uni.new(0xFBA9).NFKC.list ~~ (0x06C1,), 'FBA9 -> 06C1';
ok Uni.new(0xFBAA).NFKC.list ~~ (0x06BE,), 'FBAA -> 06BE';
ok Uni.new(0xFBAB).NFKC.list ~~ (0x06BE,), 'FBAB -> 06BE';
ok Uni.new(0xFBAC).NFKC.list ~~ (0x06BE,), 'FBAC -> 06BE';
ok Uni.new(0xFBAD).NFKC.list ~~ (0x06BE,), 'FBAD -> 06BE';
ok Uni.new(0xFBAE).NFKC.list ~~ (0x06D2,), 'FBAE -> 06D2';
ok Uni.new(0xFBAF).NFKC.list ~~ (0x06D2,), 'FBAF -> 06D2';
ok Uni.new(0xFBB0).NFKC.list ~~ (0x06D3,), 'FBB0 -> 06D3';
ok Uni.new(0xFBB1).NFKC.list ~~ (0x06D3,), 'FBB1 -> 06D3';
ok Uni.new(0xFBD3).NFKC.list ~~ (0x06AD,), 'FBD3 -> 06AD';
ok Uni.new(0xFBD4).NFKC.list ~~ (0x06AD,), 'FBD4 -> 06AD';
ok Uni.new(0xFBD5).NFKC.list ~~ (0x06AD,), 'FBD5 -> 06AD';
ok Uni.new(0xFBD6).NFKC.list ~~ (0x06AD,), 'FBD6 -> 06AD';
ok Uni.new(0xFBD7).NFKC.list ~~ (0x06C7,), 'FBD7 -> 06C7';
ok Uni.new(0xFBD8).NFKC.list ~~ (0x06C7,), 'FBD8 -> 06C7';
ok Uni.new(0xFBD9).NFKC.list ~~ (0x06C6,), 'FBD9 -> 06C6';
ok Uni.new(0xFBDA).NFKC.list ~~ (0x06C6,), 'FBDA -> 06C6';
ok Uni.new(0xFBDB).NFKC.list ~~ (0x06C8,), 'FBDB -> 06C8';
ok Uni.new(0xFBDC).NFKC.list ~~ (0x06C8,), 'FBDC -> 06C8';
ok Uni.new(0xFBDD).NFKC.list ~~ (0x06C7, 0x0674,), 'FBDD -> 06C7 0674';
ok Uni.new(0xFBDE).NFKC.list ~~ (0x06CB,), 'FBDE -> 06CB';
ok Uni.new(0xFBDF).NFKC.list ~~ (0x06CB,), 'FBDF -> 06CB';
ok Uni.new(0xFBE0).NFKC.list ~~ (0x06C5,), 'FBE0 -> 06C5';
ok Uni.new(0xFBE1).NFKC.list ~~ (0x06C5,), 'FBE1 -> 06C5';
ok Uni.new(0xFBE2).NFKC.list ~~ (0x06C9,), 'FBE2 -> 06C9';
ok Uni.new(0xFBE3).NFKC.list ~~ (0x06C9,), 'FBE3 -> 06C9';
ok Uni.new(0xFBE4).NFKC.list ~~ (0x06D0,), 'FBE4 -> 06D0';
ok Uni.new(0xFBE5).NFKC.list ~~ (0x06D0,), 'FBE5 -> 06D0';
ok Uni.new(0xFBE6).NFKC.list ~~ (0x06D0,), 'FBE6 -> 06D0';
ok Uni.new(0xFBE7).NFKC.list ~~ (0x06D0,), 'FBE7 -> 06D0';
ok Uni.new(0xFBE8).NFKC.list ~~ (0x0649,), 'FBE8 -> 0649';
ok Uni.new(0xFBE9).NFKC.list ~~ (0x0649,), 'FBE9 -> 0649';
ok Uni.new(0xFBEA).NFKC.list ~~ (0x0626, 0x0627,), 'FBEA -> 0626 0627';
ok Uni.new(0xFBEB).NFKC.list ~~ (0x0626, 0x0627,), 'FBEB -> 0626 0627';
ok Uni.new(0xFBEC).NFKC.list ~~ (0x0626, 0x06D5,), 'FBEC -> 0626 06D5';
ok Uni.new(0xFBED).NFKC.list ~~ (0x0626, 0x06D5,), 'FBED -> 0626 06D5';
ok Uni.new(0xFBEE).NFKC.list ~~ (0x0626, 0x0648,), 'FBEE -> 0626 0648';
ok Uni.new(0xFBEF).NFKC.list ~~ (0x0626, 0x0648,), 'FBEF -> 0626 0648';
ok Uni.new(0xFBF0).NFKC.list ~~ (0x0626, 0x06C7,), 'FBF0 -> 0626 06C7';
ok Uni.new(0xFBF1).NFKC.list ~~ (0x0626, 0x06C7,), 'FBF1 -> 0626 06C7';
ok Uni.new(0xFBF2).NFKC.list ~~ (0x0626, 0x06C6,), 'FBF2 -> 0626 06C6';
ok Uni.new(0xFBF3).NFKC.list ~~ (0x0626, 0x06C6,), 'FBF3 -> 0626 06C6';
ok Uni.new(0xFBF4).NFKC.list ~~ (0x0626, 0x06C8,), 'FBF4 -> 0626 06C8';
ok Uni.new(0xFBF5).NFKC.list ~~ (0x0626, 0x06C8,), 'FBF5 -> 0626 06C8';
ok Uni.new(0xFBF6).NFKC.list ~~ (0x0626, 0x06D0,), 'FBF6 -> 0626 06D0';
ok Uni.new(0xFBF7).NFKC.list ~~ (0x0626, 0x06D0,), 'FBF7 -> 0626 06D0';
ok Uni.new(0xFBF8).NFKC.list ~~ (0x0626, 0x06D0,), 'FBF8 -> 0626 06D0';
ok Uni.new(0xFBF9).NFKC.list ~~ (0x0626, 0x0649,), 'FBF9 -> 0626 0649';
ok Uni.new(0xFBFA).NFKC.list ~~ (0x0626, 0x0649,), 'FBFA -> 0626 0649';
ok Uni.new(0xFBFB).NFKC.list ~~ (0x0626, 0x0649,), 'FBFB -> 0626 0649';
ok Uni.new(0xFBFC).NFKC.list ~~ (0x06CC,), 'FBFC -> 06CC';
ok Uni.new(0xFBFD).NFKC.list ~~ (0x06CC,), 'FBFD -> 06CC';
ok Uni.new(0xFBFE).NFKC.list ~~ (0x06CC,), 'FBFE -> 06CC';
ok Uni.new(0xFBFF).NFKC.list ~~ (0x06CC,), 'FBFF -> 06CC';
ok Uni.new(0xFC00).NFKC.list ~~ (0x0626, 0x062C,), 'FC00 -> 0626 062C';
ok Uni.new(0xFC01).NFKC.list ~~ (0x0626, 0x062D,), 'FC01 -> 0626 062D';
ok Uni.new(0xFC02).NFKC.list ~~ (0x0626, 0x0645,), 'FC02 -> 0626 0645';
ok Uni.new(0xFC03).NFKC.list ~~ (0x0626, 0x0649,), 'FC03 -> 0626 0649';
ok Uni.new(0xFC04).NFKC.list ~~ (0x0626, 0x064A,), 'FC04 -> 0626 064A';
ok Uni.new(0xFC05).NFKC.list ~~ (0x0628, 0x062C,), 'FC05 -> 0628 062C';
ok Uni.new(0xFC06).NFKC.list ~~ (0x0628, 0x062D,), 'FC06 -> 0628 062D';
ok Uni.new(0xFC07).NFKC.list ~~ (0x0628, 0x062E,), 'FC07 -> 0628 062E';
ok Uni.new(0xFC08).NFKC.list ~~ (0x0628, 0x0645,), 'FC08 -> 0628 0645';
ok Uni.new(0xFC09).NFKC.list ~~ (0x0628, 0x0649,), 'FC09 -> 0628 0649';
ok Uni.new(0xFC0A).NFKC.list ~~ (0x0628, 0x064A,), 'FC0A -> 0628 064A';
ok Uni.new(0xFC0B).NFKC.list ~~ (0x062A, 0x062C,), 'FC0B -> 062A 062C';
ok Uni.new(0xFC0C).NFKC.list ~~ (0x062A, 0x062D,), 'FC0C -> 062A 062D';
ok Uni.new(0xFC0D).NFKC.list ~~ (0x062A, 0x062E,), 'FC0D -> 062A 062E';
ok Uni.new(0xFC0E).NFKC.list ~~ (0x062A, 0x0645,), 'FC0E -> 062A 0645';
ok Uni.new(0xFC0F).NFKC.list ~~ (0x062A, 0x0649,), 'FC0F -> 062A 0649';
ok Uni.new(0xFC10).NFKC.list ~~ (0x062A, 0x064A,), 'FC10 -> 062A 064A';
ok Uni.new(0xFC11).NFKC.list ~~ (0x062B, 0x062C,), 'FC11 -> 062B 062C';
ok Uni.new(0xFC12).NFKC.list ~~ (0x062B, 0x0645,), 'FC12 -> 062B 0645';
ok Uni.new(0xFC13).NFKC.list ~~ (0x062B, 0x0649,), 'FC13 -> 062B 0649';
ok Uni.new(0xFC14).NFKC.list ~~ (0x062B, 0x064A,), 'FC14 -> 062B 064A';
ok Uni.new(0xFC15).NFKC.list ~~ (0x062C, 0x062D,), 'FC15 -> 062C 062D';
ok Uni.new(0xFC16).NFKC.list ~~ (0x062C, 0x0645,), 'FC16 -> 062C 0645';
ok Uni.new(0xFC17).NFKC.list ~~ (0x062D, 0x062C,), 'FC17 -> 062D 062C';
ok Uni.new(0xFC18).NFKC.list ~~ (0x062D, 0x0645,), 'FC18 -> 062D 0645';
ok Uni.new(0xFC19).NFKC.list ~~ (0x062E, 0x062C,), 'FC19 -> 062E 062C';
ok Uni.new(0xFC1A).NFKC.list ~~ (0x062E, 0x062D,), 'FC1A -> 062E 062D';
ok Uni.new(0xFC1B).NFKC.list ~~ (0x062E, 0x0645,), 'FC1B -> 062E 0645';
ok Uni.new(0xFC1C).NFKC.list ~~ (0x0633, 0x062C,), 'FC1C -> 0633 062C';
ok Uni.new(0xFC1D).NFKC.list ~~ (0x0633, 0x062D,), 'FC1D -> 0633 062D';
ok Uni.new(0xFC1E).NFKC.list ~~ (0x0633, 0x062E,), 'FC1E -> 0633 062E';
ok Uni.new(0xFC1F).NFKC.list ~~ (0x0633, 0x0645,), 'FC1F -> 0633 0645';
ok Uni.new(0xFC20).NFKC.list ~~ (0x0635, 0x062D,), 'FC20 -> 0635 062D';
ok Uni.new(0xFC21).NFKC.list ~~ (0x0635, 0x0645,), 'FC21 -> 0635 0645';
ok Uni.new(0xFC22).NFKC.list ~~ (0x0636, 0x062C,), 'FC22 -> 0636 062C';
ok Uni.new(0xFC23).NFKC.list ~~ (0x0636, 0x062D,), 'FC23 -> 0636 062D';
ok Uni.new(0xFC24).NFKC.list ~~ (0x0636, 0x062E,), 'FC24 -> 0636 062E';
ok Uni.new(0xFC25).NFKC.list ~~ (0x0636, 0x0645,), 'FC25 -> 0636 0645';
ok Uni.new(0xFC26).NFKC.list ~~ (0x0637, 0x062D,), 'FC26 -> 0637 062D';
ok Uni.new(0xFC27).NFKC.list ~~ (0x0637, 0x0645,), 'FC27 -> 0637 0645';
ok Uni.new(0xFC28).NFKC.list ~~ (0x0638, 0x0645,), 'FC28 -> 0638 0645';
ok Uni.new(0xFC29).NFKC.list ~~ (0x0639, 0x062C,), 'FC29 -> 0639 062C';
ok Uni.new(0xFC2A).NFKC.list ~~ (0x0639, 0x0645,), 'FC2A -> 0639 0645';
ok Uni.new(0xFC2B).NFKC.list ~~ (0x063A, 0x062C,), 'FC2B -> 063A 062C';
ok Uni.new(0xFC2C).NFKC.list ~~ (0x063A, 0x0645,), 'FC2C -> 063A 0645';
ok Uni.new(0xFC2D).NFKC.list ~~ (0x0641, 0x062C,), 'FC2D -> 0641 062C';
ok Uni.new(0xFC2E).NFKC.list ~~ (0x0641, 0x062D,), 'FC2E -> 0641 062D';
ok Uni.new(0xFC2F).NFKC.list ~~ (0x0641, 0x062E,), 'FC2F -> 0641 062E';
ok Uni.new(0xFC30).NFKC.list ~~ (0x0641, 0x0645,), 'FC30 -> 0641 0645';
ok Uni.new(0xFC31).NFKC.list ~~ (0x0641, 0x0649,), 'FC31 -> 0641 0649';
ok Uni.new(0xFC32).NFKC.list ~~ (0x0641, 0x064A,), 'FC32 -> 0641 064A';
ok Uni.new(0xFC33).NFKC.list ~~ (0x0642, 0x062D,), 'FC33 -> 0642 062D';
ok Uni.new(0xFC34).NFKC.list ~~ (0x0642, 0x0645,), 'FC34 -> 0642 0645';
ok Uni.new(0xFC35).NFKC.list ~~ (0x0642, 0x0649,), 'FC35 -> 0642 0649';
ok Uni.new(0xFC36).NFKC.list ~~ (0x0642, 0x064A,), 'FC36 -> 0642 064A';
ok Uni.new(0xFC37).NFKC.list ~~ (0x0643, 0x0627,), 'FC37 -> 0643 0627';
ok Uni.new(0xFC38).NFKC.list ~~ (0x0643, 0x062C,), 'FC38 -> 0643 062C';
ok Uni.new(0xFC39).NFKC.list ~~ (0x0643, 0x062D,), 'FC39 -> 0643 062D';
ok Uni.new(0xFC3A).NFKC.list ~~ (0x0643, 0x062E,), 'FC3A -> 0643 062E';
ok Uni.new(0xFC3B).NFKC.list ~~ (0x0643, 0x0644,), 'FC3B -> 0643 0644';
ok Uni.new(0xFC3C).NFKC.list ~~ (0x0643, 0x0645,), 'FC3C -> 0643 0645';
ok Uni.new(0xFC3D).NFKC.list ~~ (0x0643, 0x0649,), 'FC3D -> 0643 0649';
ok Uni.new(0xFC3E).NFKC.list ~~ (0x0643, 0x064A,), 'FC3E -> 0643 064A';
ok Uni.new(0xFC3F).NFKC.list ~~ (0x0644, 0x062C,), 'FC3F -> 0644 062C';
ok Uni.new(0xFC40).NFKC.list ~~ (0x0644, 0x062D,), 'FC40 -> 0644 062D';
ok Uni.new(0xFC41).NFKC.list ~~ (0x0644, 0x062E,), 'FC41 -> 0644 062E';
ok Uni.new(0xFC42).NFKC.list ~~ (0x0644, 0x0645,), 'FC42 -> 0644 0645';
ok Uni.new(0xFC43).NFKC.list ~~ (0x0644, 0x0649,), 'FC43 -> 0644 0649';
ok Uni.new(0xFC44).NFKC.list ~~ (0x0644, 0x064A,), 'FC44 -> 0644 064A';
ok Uni.new(0xFC45).NFKC.list ~~ (0x0645, 0x062C,), 'FC45 -> 0645 062C';
ok Uni.new(0xFC46).NFKC.list ~~ (0x0645, 0x062D,), 'FC46 -> 0645 062D';
ok Uni.new(0xFC47).NFKC.list ~~ (0x0645, 0x062E,), 'FC47 -> 0645 062E';
ok Uni.new(0xFC48).NFKC.list ~~ (0x0645, 0x0645,), 'FC48 -> 0645 0645';
ok Uni.new(0xFC49).NFKC.list ~~ (0x0645, 0x0649,), 'FC49 -> 0645 0649';
ok Uni.new(0xFC4A).NFKC.list ~~ (0x0645, 0x064A,), 'FC4A -> 0645 064A';
ok Uni.new(0xFC4B).NFKC.list ~~ (0x0646, 0x062C,), 'FC4B -> 0646 062C';
ok Uni.new(0xFC4C).NFKC.list ~~ (0x0646, 0x062D,), 'FC4C -> 0646 062D';
ok Uni.new(0xFC4D).NFKC.list ~~ (0x0646, 0x062E,), 'FC4D -> 0646 062E';
ok Uni.new(0xFC4E).NFKC.list ~~ (0x0646, 0x0645,), 'FC4E -> 0646 0645';
ok Uni.new(0xFC4F).NFKC.list ~~ (0x0646, 0x0649,), 'FC4F -> 0646 0649';
ok Uni.new(0xFC50).NFKC.list ~~ (0x0646, 0x064A,), 'FC50 -> 0646 064A';
ok Uni.new(0xFC51).NFKC.list ~~ (0x0647, 0x062C,), 'FC51 -> 0647 062C';
ok Uni.new(0xFC52).NFKC.list ~~ (0x0647, 0x0645,), 'FC52 -> 0647 0645';
ok Uni.new(0xFC53).NFKC.list ~~ (0x0647, 0x0649,), 'FC53 -> 0647 0649';
ok Uni.new(0xFC54).NFKC.list ~~ (0x0647, 0x064A,), 'FC54 -> 0647 064A';
ok Uni.new(0xFC55).NFKC.list ~~ (0x064A, 0x062C,), 'FC55 -> 064A 062C';
ok Uni.new(0xFC56).NFKC.list ~~ (0x064A, 0x062D,), 'FC56 -> 064A 062D';
ok Uni.new(0xFC57).NFKC.list ~~ (0x064A, 0x062E,), 'FC57 -> 064A 062E';
ok Uni.new(0xFC58).NFKC.list ~~ (0x064A, 0x0645,), 'FC58 -> 064A 0645';
ok Uni.new(0xFC59).NFKC.list ~~ (0x064A, 0x0649,), 'FC59 -> 064A 0649';
ok Uni.new(0xFC5A).NFKC.list ~~ (0x064A, 0x064A,), 'FC5A -> 064A 064A';
ok Uni.new(0xFC5B).NFKC.list ~~ (0x0630, 0x0670,), 'FC5B -> 0630 0670';
ok Uni.new(0xFC5C).NFKC.list ~~ (0x0631, 0x0670,), 'FC5C -> 0631 0670';
ok Uni.new(0xFC5D).NFKC.list ~~ (0x0649, 0x0670,), 'FC5D -> 0649 0670';
ok Uni.new(0xFC5E).NFKC.list ~~ (0x0020, 0x064C, 0x0651,), 'FC5E -> 0020 064C 0651';
ok Uni.new(0xFC5F).NFKC.list ~~ (0x0020, 0x064D, 0x0651,), 'FC5F -> 0020 064D 0651';
ok Uni.new(0xFC60).NFKC.list ~~ (0x0020, 0x064E, 0x0651,), 'FC60 -> 0020 064E 0651';
ok Uni.new(0xFC61).NFKC.list ~~ (0x0020, 0x064F, 0x0651,), 'FC61 -> 0020 064F 0651';
ok Uni.new(0xFC62).NFKC.list ~~ (0x0020, 0x0650, 0x0651,), 'FC62 -> 0020 0650 0651';
ok Uni.new(0xFC63).NFKC.list ~~ (0x0020, 0x0651, 0x0670,), 'FC63 -> 0020 0651 0670';
ok Uni.new(0xFC64).NFKC.list ~~ (0x0626, 0x0631,), 'FC64 -> 0626 0631';
ok Uni.new(0xFC65).NFKC.list ~~ (0x0626, 0x0632,), 'FC65 -> 0626 0632';
ok Uni.new(0xFC66).NFKC.list ~~ (0x0626, 0x0645,), 'FC66 -> 0626 0645';
ok Uni.new(0xFC67).NFKC.list ~~ (0x0626, 0x0646,), 'FC67 -> 0626 0646';
ok Uni.new(0xFC68).NFKC.list ~~ (0x0626, 0x0649,), 'FC68 -> 0626 0649';
ok Uni.new(0xFC69).NFKC.list ~~ (0x0626, 0x064A,), 'FC69 -> 0626 064A';
ok Uni.new(0xFC6A).NFKC.list ~~ (0x0628, 0x0631,), 'FC6A -> 0628 0631';
ok Uni.new(0xFC6B).NFKC.list ~~ (0x0628, 0x0632,), 'FC6B -> 0628 0632';
ok Uni.new(0xFC6C).NFKC.list ~~ (0x0628, 0x0645,), 'FC6C -> 0628 0645';
ok Uni.new(0xFC6D).NFKC.list ~~ (0x0628, 0x0646,), 'FC6D -> 0628 0646';
ok Uni.new(0xFC6E).NFKC.list ~~ (0x0628, 0x0649,), 'FC6E -> 0628 0649';
ok Uni.new(0xFC6F).NFKC.list ~~ (0x0628, 0x064A,), 'FC6F -> 0628 064A';
ok Uni.new(0xFC70).NFKC.list ~~ (0x062A, 0x0631,), 'FC70 -> 062A 0631';
ok Uni.new(0xFC71).NFKC.list ~~ (0x062A, 0x0632,), 'FC71 -> 062A 0632';
ok Uni.new(0xFC72).NFKC.list ~~ (0x062A, 0x0645,), 'FC72 -> 062A 0645';
ok Uni.new(0xFC73).NFKC.list ~~ (0x062A, 0x0646,), 'FC73 -> 062A 0646';
ok Uni.new(0xFC74).NFKC.list ~~ (0x062A, 0x0649,), 'FC74 -> 062A 0649';
ok Uni.new(0xFC75).NFKC.list ~~ (0x062A, 0x064A,), 'FC75 -> 062A 064A';
ok Uni.new(0xFC76).NFKC.list ~~ (0x062B, 0x0631,), 'FC76 -> 062B 0631';
ok Uni.new(0xFC77).NFKC.list ~~ (0x062B, 0x0632,), 'FC77 -> 062B 0632';
ok Uni.new(0xFC78).NFKC.list ~~ (0x062B, 0x0645,), 'FC78 -> 062B 0645';
ok Uni.new(0xFC79).NFKC.list ~~ (0x062B, 0x0646,), 'FC79 -> 062B 0646';
ok Uni.new(0xFC7A).NFKC.list ~~ (0x062B, 0x0649,), 'FC7A -> 062B 0649';
ok Uni.new(0xFC7B).NFKC.list ~~ (0x062B, 0x064A,), 'FC7B -> 062B 064A';
ok Uni.new(0xFC7C).NFKC.list ~~ (0x0641, 0x0649,), 'FC7C -> 0641 0649';
ok Uni.new(0xFC7D).NFKC.list ~~ (0x0641, 0x064A,), 'FC7D -> 0641 064A';
ok Uni.new(0xFC7E).NFKC.list ~~ (0x0642, 0x0649,), 'FC7E -> 0642 0649';
ok Uni.new(0xFC7F).NFKC.list ~~ (0x0642, 0x064A,), 'FC7F -> 0642 064A';
ok Uni.new(0xFC80).NFKC.list ~~ (0x0643, 0x0627,), 'FC80 -> 0643 0627';
ok Uni.new(0xFC81).NFKC.list ~~ (0x0643, 0x0644,), 'FC81 -> 0643 0644';
ok Uni.new(0xFC82).NFKC.list ~~ (0x0643, 0x0645,), 'FC82 -> 0643 0645';
ok Uni.new(0xFC83).NFKC.list ~~ (0x0643, 0x0649,), 'FC83 -> 0643 0649';
ok Uni.new(0xFC84).NFKC.list ~~ (0x0643, 0x064A,), 'FC84 -> 0643 064A';
ok Uni.new(0xFC85).NFKC.list ~~ (0x0644, 0x0645,), 'FC85 -> 0644 0645';
ok Uni.new(0xFC86).NFKC.list ~~ (0x0644, 0x0649,), 'FC86 -> 0644 0649';
ok Uni.new(0xFC87).NFKC.list ~~ (0x0644, 0x064A,), 'FC87 -> 0644 064A';
ok Uni.new(0xFC88).NFKC.list ~~ (0x0645, 0x0627,), 'FC88 -> 0645 0627';
ok Uni.new(0xFC89).NFKC.list ~~ (0x0645, 0x0645,), 'FC89 -> 0645 0645';
ok Uni.new(0xFC8A).NFKC.list ~~ (0x0646, 0x0631,), 'FC8A -> 0646 0631';
ok Uni.new(0xFC8B).NFKC.list ~~ (0x0646, 0x0632,), 'FC8B -> 0646 0632';
ok Uni.new(0xFC8C).NFKC.list ~~ (0x0646, 0x0645,), 'FC8C -> 0646 0645';
ok Uni.new(0xFC8D).NFKC.list ~~ (0x0646, 0x0646,), 'FC8D -> 0646 0646';
ok Uni.new(0xFC8E).NFKC.list ~~ (0x0646, 0x0649,), 'FC8E -> 0646 0649';
ok Uni.new(0xFC8F).NFKC.list ~~ (0x0646, 0x064A,), 'FC8F -> 0646 064A';
ok Uni.new(0xFC90).NFKC.list ~~ (0x0649, 0x0670,), 'FC90 -> 0649 0670';
ok Uni.new(0xFC91).NFKC.list ~~ (0x064A, 0x0631,), 'FC91 -> 064A 0631';
ok Uni.new(0xFC92).NFKC.list ~~ (0x064A, 0x0632,), 'FC92 -> 064A 0632';
ok Uni.new(0xFC93).NFKC.list ~~ (0x064A, 0x0645,), 'FC93 -> 064A 0645';
ok Uni.new(0xFC94).NFKC.list ~~ (0x064A, 0x0646,), 'FC94 -> 064A 0646';
ok Uni.new(0xFC95).NFKC.list ~~ (0x064A, 0x0649,), 'FC95 -> 064A 0649';
ok Uni.new(0xFC96).NFKC.list ~~ (0x064A, 0x064A,), 'FC96 -> 064A 064A';
ok Uni.new(0xFC97).NFKC.list ~~ (0x0626, 0x062C,), 'FC97 -> 0626 062C';
ok Uni.new(0xFC98).NFKC.list ~~ (0x0626, 0x062D,), 'FC98 -> 0626 062D';
ok Uni.new(0xFC99).NFKC.list ~~ (0x0626, 0x062E,), 'FC99 -> 0626 062E';
ok Uni.new(0xFC9A).NFKC.list ~~ (0x0626, 0x0645,), 'FC9A -> 0626 0645';
ok Uni.new(0xFC9B).NFKC.list ~~ (0x0626, 0x0647,), 'FC9B -> 0626 0647';
ok Uni.new(0xFC9C).NFKC.list ~~ (0x0628, 0x062C,), 'FC9C -> 0628 062C';
ok Uni.new(0xFC9D).NFKC.list ~~ (0x0628, 0x062D,), 'FC9D -> 0628 062D';
ok Uni.new(0xFC9E).NFKC.list ~~ (0x0628, 0x062E,), 'FC9E -> 0628 062E';
ok Uni.new(0xFC9F).NFKC.list ~~ (0x0628, 0x0645,), 'FC9F -> 0628 0645';
ok Uni.new(0xFCA0).NFKC.list ~~ (0x0628, 0x0647,), 'FCA0 -> 0628 0647';
ok Uni.new(0xFCA1).NFKC.list ~~ (0x062A, 0x062C,), 'FCA1 -> 062A 062C';
ok Uni.new(0xFCA2).NFKC.list ~~ (0x062A, 0x062D,), 'FCA2 -> 062A 062D';
ok Uni.new(0xFCA3).NFKC.list ~~ (0x062A, 0x062E,), 'FCA3 -> 062A 062E';
ok Uni.new(0xFCA4).NFKC.list ~~ (0x062A, 0x0645,), 'FCA4 -> 062A 0645';
ok Uni.new(0xFCA5).NFKC.list ~~ (0x062A, 0x0647,), 'FCA5 -> 062A 0647';
ok Uni.new(0xFCA6).NFKC.list ~~ (0x062B, 0x0645,), 'FCA6 -> 062B 0645';
ok Uni.new(0xFCA7).NFKC.list ~~ (0x062C, 0x062D,), 'FCA7 -> 062C 062D';
ok Uni.new(0xFCA8).NFKC.list ~~ (0x062C, 0x0645,), 'FCA8 -> 062C 0645';
ok Uni.new(0xFCA9).NFKC.list ~~ (0x062D, 0x062C,), 'FCA9 -> 062D 062C';
ok Uni.new(0xFCAA).NFKC.list ~~ (0x062D, 0x0645,), 'FCAA -> 062D 0645';
ok Uni.new(0xFCAB).NFKC.list ~~ (0x062E, 0x062C,), 'FCAB -> 062E 062C';
ok Uni.new(0xFCAC).NFKC.list ~~ (0x062E, 0x0645,), 'FCAC -> 062E 0645';
ok Uni.new(0xFCAD).NFKC.list ~~ (0x0633, 0x062C,), 'FCAD -> 0633 062C';
ok Uni.new(0xFCAE).NFKC.list ~~ (0x0633, 0x062D,), 'FCAE -> 0633 062D';
ok Uni.new(0xFCAF).NFKC.list ~~ (0x0633, 0x062E,), 'FCAF -> 0633 062E';
ok Uni.new(0xFCB0).NFKC.list ~~ (0x0633, 0x0645,), 'FCB0 -> 0633 0645';
ok Uni.new(0xFCB1).NFKC.list ~~ (0x0635, 0x062D,), 'FCB1 -> 0635 062D';
ok Uni.new(0xFCB2).NFKC.list ~~ (0x0635, 0x062E,), 'FCB2 -> 0635 062E';
ok Uni.new(0xFCB3).NFKC.list ~~ (0x0635, 0x0645,), 'FCB3 -> 0635 0645';
ok Uni.new(0xFCB4).NFKC.list ~~ (0x0636, 0x062C,), 'FCB4 -> 0636 062C';
ok Uni.new(0xFCB5).NFKC.list ~~ (0x0636, 0x062D,), 'FCB5 -> 0636 062D';
ok Uni.new(0xFCB6).NFKC.list ~~ (0x0636, 0x062E,), 'FCB6 -> 0636 062E';
ok Uni.new(0xFCB7).NFKC.list ~~ (0x0636, 0x0645,), 'FCB7 -> 0636 0645';
ok Uni.new(0xFCB8).NFKC.list ~~ (0x0637, 0x062D,), 'FCB8 -> 0637 062D';
ok Uni.new(0xFCB9).NFKC.list ~~ (0x0638, 0x0645,), 'FCB9 -> 0638 0645';
ok Uni.new(0xFCBA).NFKC.list ~~ (0x0639, 0x062C,), 'FCBA -> 0639 062C';
ok Uni.new(0xFCBB).NFKC.list ~~ (0x0639, 0x0645,), 'FCBB -> 0639 0645';
ok Uni.new(0xFCBC).NFKC.list ~~ (0x063A, 0x062C,), 'FCBC -> 063A 062C';
ok Uni.new(0xFCBD).NFKC.list ~~ (0x063A, 0x0645,), 'FCBD -> 063A 0645';
ok Uni.new(0xFCBE).NFKC.list ~~ (0x0641, 0x062C,), 'FCBE -> 0641 062C';
ok Uni.new(0xFCBF).NFKC.list ~~ (0x0641, 0x062D,), 'FCBF -> 0641 062D';
ok Uni.new(0xFCC0).NFKC.list ~~ (0x0641, 0x062E,), 'FCC0 -> 0641 062E';
ok Uni.new(0xFCC1).NFKC.list ~~ (0x0641, 0x0645,), 'FCC1 -> 0641 0645';
ok Uni.new(0xFCC2).NFKC.list ~~ (0x0642, 0x062D,), 'FCC2 -> 0642 062D';
ok Uni.new(0xFCC3).NFKC.list ~~ (0x0642, 0x0645,), 'FCC3 -> 0642 0645';
ok Uni.new(0xFCC4).NFKC.list ~~ (0x0643, 0x062C,), 'FCC4 -> 0643 062C';
ok Uni.new(0xFCC5).NFKC.list ~~ (0x0643, 0x062D,), 'FCC5 -> 0643 062D';
ok Uni.new(0xFCC6).NFKC.list ~~ (0x0643, 0x062E,), 'FCC6 -> 0643 062E';
ok Uni.new(0xFCC7).NFKC.list ~~ (0x0643, 0x0644,), 'FCC7 -> 0643 0644';
ok Uni.new(0xFCC8).NFKC.list ~~ (0x0643, 0x0645,), 'FCC8 -> 0643 0645';
ok Uni.new(0xFCC9).NFKC.list ~~ (0x0644, 0x062C,), 'FCC9 -> 0644 062C';
ok Uni.new(0xFCCA).NFKC.list ~~ (0x0644, 0x062D,), 'FCCA -> 0644 062D';
ok Uni.new(0xFCCB).NFKC.list ~~ (0x0644, 0x062E,), 'FCCB -> 0644 062E';
ok Uni.new(0xFCCC).NFKC.list ~~ (0x0644, 0x0645,), 'FCCC -> 0644 0645';
ok Uni.new(0xFCCD).NFKC.list ~~ (0x0644, 0x0647,), 'FCCD -> 0644 0647';
ok Uni.new(0xFCCE).NFKC.list ~~ (0x0645, 0x062C,), 'FCCE -> 0645 062C';
ok Uni.new(0xFCCF).NFKC.list ~~ (0x0645, 0x062D,), 'FCCF -> 0645 062D';
ok Uni.new(0xFCD0).NFKC.list ~~ (0x0645, 0x062E,), 'FCD0 -> 0645 062E';
ok Uni.new(0xFCD1).NFKC.list ~~ (0x0645, 0x0645,), 'FCD1 -> 0645 0645';
ok Uni.new(0xFCD2).NFKC.list ~~ (0x0646, 0x062C,), 'FCD2 -> 0646 062C';
ok Uni.new(0xFCD3).NFKC.list ~~ (0x0646, 0x062D,), 'FCD3 -> 0646 062D';
ok Uni.new(0xFCD4).NFKC.list ~~ (0x0646, 0x062E,), 'FCD4 -> 0646 062E';
ok Uni.new(0xFCD5).NFKC.list ~~ (0x0646, 0x0645,), 'FCD5 -> 0646 0645';
ok Uni.new(0xFCD6).NFKC.list ~~ (0x0646, 0x0647,), 'FCD6 -> 0646 0647';
ok Uni.new(0xFCD7).NFKC.list ~~ (0x0647, 0x062C,), 'FCD7 -> 0647 062C';
ok Uni.new(0xFCD8).NFKC.list ~~ (0x0647, 0x0645,), 'FCD8 -> 0647 0645';
ok Uni.new(0xFCD9).NFKC.list ~~ (0x0647, 0x0670,), 'FCD9 -> 0647 0670';
ok Uni.new(0xFCDA).NFKC.list ~~ (0x064A, 0x062C,), 'FCDA -> 064A 062C';
ok Uni.new(0xFCDB).NFKC.list ~~ (0x064A, 0x062D,), 'FCDB -> 064A 062D';
ok Uni.new(0xFCDC).NFKC.list ~~ (0x064A, 0x062E,), 'FCDC -> 064A 062E';
ok Uni.new(0xFCDD).NFKC.list ~~ (0x064A, 0x0645,), 'FCDD -> 064A 0645';
ok Uni.new(0xFCDE).NFKC.list ~~ (0x064A, 0x0647,), 'FCDE -> 064A 0647';
ok Uni.new(0xFCDF).NFKC.list ~~ (0x0626, 0x0645,), 'FCDF -> 0626 0645';
ok Uni.new(0xFCE0).NFKC.list ~~ (0x0626, 0x0647,), 'FCE0 -> 0626 0647';
ok Uni.new(0xFCE1).NFKC.list ~~ (0x0628, 0x0645,), 'FCE1 -> 0628 0645';
ok Uni.new(0xFCE2).NFKC.list ~~ (0x0628, 0x0647,), 'FCE2 -> 0628 0647';
ok Uni.new(0xFCE3).NFKC.list ~~ (0x062A, 0x0645,), 'FCE3 -> 062A 0645';
ok Uni.new(0xFCE4).NFKC.list ~~ (0x062A, 0x0647,), 'FCE4 -> 062A 0647';
ok Uni.new(0xFCE5).NFKC.list ~~ (0x062B, 0x0645,), 'FCE5 -> 062B 0645';
ok Uni.new(0xFCE6).NFKC.list ~~ (0x062B, 0x0647,), 'FCE6 -> 062B 0647';
ok Uni.new(0xFCE7).NFKC.list ~~ (0x0633, 0x0645,), 'FCE7 -> 0633 0645';
ok Uni.new(0xFCE8).NFKC.list ~~ (0x0633, 0x0647,), 'FCE8 -> 0633 0647';
ok Uni.new(0xFCE9).NFKC.list ~~ (0x0634, 0x0645,), 'FCE9 -> 0634 0645';
ok Uni.new(0xFCEA).NFKC.list ~~ (0x0634, 0x0647,), 'FCEA -> 0634 0647';
ok Uni.new(0xFCEB).NFKC.list ~~ (0x0643, 0x0644,), 'FCEB -> 0643 0644';
ok Uni.new(0xFCEC).NFKC.list ~~ (0x0643, 0x0645,), 'FCEC -> 0643 0645';
ok Uni.new(0xFCED).NFKC.list ~~ (0x0644, 0x0645,), 'FCED -> 0644 0645';
ok Uni.new(0xFCEE).NFKC.list ~~ (0x0646, 0x0645,), 'FCEE -> 0646 0645';
ok Uni.new(0xFCEF).NFKC.list ~~ (0x0646, 0x0647,), 'FCEF -> 0646 0647';
ok Uni.new(0xFCF0).NFKC.list ~~ (0x064A, 0x0645,), 'FCF0 -> 064A 0645';
ok Uni.new(0xFCF1).NFKC.list ~~ (0x064A, 0x0647,), 'FCF1 -> 064A 0647';
ok Uni.new(0xFCF2).NFKC.list ~~ (0x0640, 0x064E, 0x0651,), 'FCF2 -> 0640 064E 0651';
ok Uni.new(0xFCF3).NFKC.list ~~ (0x0640, 0x064F, 0x0651,), 'FCF3 -> 0640 064F 0651';
ok Uni.new(0xFCF4).NFKC.list ~~ (0x0640, 0x0650, 0x0651,), 'FCF4 -> 0640 0650 0651';
ok Uni.new(0xFCF5).NFKC.list ~~ (0x0637, 0x0649,), 'FCF5 -> 0637 0649';
ok Uni.new(0xFCF6).NFKC.list ~~ (0x0637, 0x064A,), 'FCF6 -> 0637 064A';
ok Uni.new(0xFCF7).NFKC.list ~~ (0x0639, 0x0649,), 'FCF7 -> 0639 0649';
ok Uni.new(0xFCF8).NFKC.list ~~ (0x0639, 0x064A,), 'FCF8 -> 0639 064A';
ok Uni.new(0xFCF9).NFKC.list ~~ (0x063A, 0x0649,), 'FCF9 -> 063A 0649';
ok Uni.new(0xFCFA).NFKC.list ~~ (0x063A, 0x064A,), 'FCFA -> 063A 064A';
ok Uni.new(0xFCFB).NFKC.list ~~ (0x0633, 0x0649,), 'FCFB -> 0633 0649';
ok Uni.new(0xFCFC).NFKC.list ~~ (0x0633, 0x064A,), 'FCFC -> 0633 064A';
ok Uni.new(0xFCFD).NFKC.list ~~ (0x0634, 0x0649,), 'FCFD -> 0634 0649';
ok Uni.new(0xFCFE).NFKC.list ~~ (0x0634, 0x064A,), 'FCFE -> 0634 064A';
ok Uni.new(0xFCFF).NFKC.list ~~ (0x062D, 0x0649,), 'FCFF -> 062D 0649';
ok Uni.new(0xFD00).NFKC.list ~~ (0x062D, 0x064A,), 'FD00 -> 062D 064A';
ok Uni.new(0xFD01).NFKC.list ~~ (0x062C, 0x0649,), 'FD01 -> 062C 0649';
ok Uni.new(0xFD02).NFKC.list ~~ (0x062C, 0x064A,), 'FD02 -> 062C 064A';
ok Uni.new(0xFD03).NFKC.list ~~ (0x062E, 0x0649,), 'FD03 -> 062E 0649';
ok Uni.new(0xFD04).NFKC.list ~~ (0x062E, 0x064A,), 'FD04 -> 062E 064A';
ok Uni.new(0xFD05).NFKC.list ~~ (0x0635, 0x0649,), 'FD05 -> 0635 0649';
ok Uni.new(0xFD06).NFKC.list ~~ (0x0635, 0x064A,), 'FD06 -> 0635 064A';
ok Uni.new(0xFD07).NFKC.list ~~ (0x0636, 0x0649,), 'FD07 -> 0636 0649';
ok Uni.new(0xFD08).NFKC.list ~~ (0x0636, 0x064A,), 'FD08 -> 0636 064A';
ok Uni.new(0xFD09).NFKC.list ~~ (0x0634, 0x062C,), 'FD09 -> 0634 062C';
ok Uni.new(0xFD0A).NFKC.list ~~ (0x0634, 0x062D,), 'FD0A -> 0634 062D';
ok Uni.new(0xFD0B).NFKC.list ~~ (0x0634, 0x062E,), 'FD0B -> 0634 062E';
ok Uni.new(0xFD0C).NFKC.list ~~ (0x0634, 0x0645,), 'FD0C -> 0634 0645';
ok Uni.new(0xFD0D).NFKC.list ~~ (0x0634, 0x0631,), 'FD0D -> 0634 0631';
ok Uni.new(0xFD0E).NFKC.list ~~ (0x0633, 0x0631,), 'FD0E -> 0633 0631';
ok Uni.new(0xFD0F).NFKC.list ~~ (0x0635, 0x0631,), 'FD0F -> 0635 0631';
ok Uni.new(0xFD10).NFKC.list ~~ (0x0636, 0x0631,), 'FD10 -> 0636 0631';
ok Uni.new(0xFD11).NFKC.list ~~ (0x0637, 0x0649,), 'FD11 -> 0637 0649';
ok Uni.new(0xFD12).NFKC.list ~~ (0x0637, 0x064A,), 'FD12 -> 0637 064A';
ok Uni.new(0xFD13).NFKC.list ~~ (0x0639, 0x0649,), 'FD13 -> 0639 0649';
ok Uni.new(0xFD14).NFKC.list ~~ (0x0639, 0x064A,), 'FD14 -> 0639 064A';
ok Uni.new(0xFD15).NFKC.list ~~ (0x063A, 0x0649,), 'FD15 -> 063A 0649';
ok Uni.new(0xFD16).NFKC.list ~~ (0x063A, 0x064A,), 'FD16 -> 063A 064A';
ok Uni.new(0xFD17).NFKC.list ~~ (0x0633, 0x0649,), 'FD17 -> 0633 0649';
ok Uni.new(0xFD18).NFKC.list ~~ (0x0633, 0x064A,), 'FD18 -> 0633 064A';
ok Uni.new(0xFD19).NFKC.list ~~ (0x0634, 0x0649,), 'FD19 -> 0634 0649';
ok Uni.new(0xFD1A).NFKC.list ~~ (0x0634, 0x064A,), 'FD1A -> 0634 064A';
ok Uni.new(0xFD1B).NFKC.list ~~ (0x062D, 0x0649,), 'FD1B -> 062D 0649';
ok Uni.new(0xFD1C).NFKC.list ~~ (0x062D, 0x064A,), 'FD1C -> 062D 064A';
ok Uni.new(0xFD1D).NFKC.list ~~ (0x062C, 0x0649,), 'FD1D -> 062C 0649';
ok Uni.new(0xFD1E).NFKC.list ~~ (0x062C, 0x064A,), 'FD1E -> 062C 064A';
ok Uni.new(0xFD1F).NFKC.list ~~ (0x062E, 0x0649,), 'FD1F -> 062E 0649';
ok Uni.new(0xFD20).NFKC.list ~~ (0x062E, 0x064A,), 'FD20 -> 062E 064A';
ok Uni.new(0xFD21).NFKC.list ~~ (0x0635, 0x0649,), 'FD21 -> 0635 0649';
ok Uni.new(0xFD22).NFKC.list ~~ (0x0635, 0x064A,), 'FD22 -> 0635 064A';
ok Uni.new(0xFD23).NFKC.list ~~ (0x0636, 0x0649,), 'FD23 -> 0636 0649';
ok Uni.new(0xFD24).NFKC.list ~~ (0x0636, 0x064A,), 'FD24 -> 0636 064A';
ok Uni.new(0xFD25).NFKC.list ~~ (0x0634, 0x062C,), 'FD25 -> 0634 062C';
ok Uni.new(0xFD26).NFKC.list ~~ (0x0634, 0x062D,), 'FD26 -> 0634 062D';
ok Uni.new(0xFD27).NFKC.list ~~ (0x0634, 0x062E,), 'FD27 -> 0634 062E';
ok Uni.new(0xFD28).NFKC.list ~~ (0x0634, 0x0645,), 'FD28 -> 0634 0645';
ok Uni.new(0xFD29).NFKC.list ~~ (0x0634, 0x0631,), 'FD29 -> 0634 0631';
ok Uni.new(0xFD2A).NFKC.list ~~ (0x0633, 0x0631,), 'FD2A -> 0633 0631';
ok Uni.new(0xFD2B).NFKC.list ~~ (0x0635, 0x0631,), 'FD2B -> 0635 0631';
ok Uni.new(0xFD2C).NFKC.list ~~ (0x0636, 0x0631,), 'FD2C -> 0636 0631';
ok Uni.new(0xFD2D).NFKC.list ~~ (0x0634, 0x062C,), 'FD2D -> 0634 062C';
ok Uni.new(0xFD2E).NFKC.list ~~ (0x0634, 0x062D,), 'FD2E -> 0634 062D';
ok Uni.new(0xFD2F).NFKC.list ~~ (0x0634, 0x062E,), 'FD2F -> 0634 062E';
ok Uni.new(0xFD30).NFKC.list ~~ (0x0634, 0x0645,), 'FD30 -> 0634 0645';
ok Uni.new(0xFD31).NFKC.list ~~ (0x0633, 0x0647,), 'FD31 -> 0633 0647';
ok Uni.new(0xFD32).NFKC.list ~~ (0x0634, 0x0647,), 'FD32 -> 0634 0647';
ok Uni.new(0xFD33).NFKC.list ~~ (0x0637, 0x0645,), 'FD33 -> 0637 0645';
ok Uni.new(0xFD34).NFKC.list ~~ (0x0633, 0x062C,), 'FD34 -> 0633 062C';
ok Uni.new(0xFD35).NFKC.list ~~ (0x0633, 0x062D,), 'FD35 -> 0633 062D';
ok Uni.new(0xFD36).NFKC.list ~~ (0x0633, 0x062E,), 'FD36 -> 0633 062E';
ok Uni.new(0xFD37).NFKC.list ~~ (0x0634, 0x062C,), 'FD37 -> 0634 062C';
ok Uni.new(0xFD38).NFKC.list ~~ (0x0634, 0x062D,), 'FD38 -> 0634 062D';
ok Uni.new(0xFD39).NFKC.list ~~ (0x0634, 0x062E,), 'FD39 -> 0634 062E';
ok Uni.new(0xFD3A).NFKC.list ~~ (0x0637, 0x0645,), 'FD3A -> 0637 0645';
ok Uni.new(0xFD3B).NFKC.list ~~ (0x0638, 0x0645,), 'FD3B -> 0638 0645';
ok Uni.new(0xFD3C).NFKC.list ~~ (0x0627, 0x064B,), 'FD3C -> 0627 064B';
ok Uni.new(0xFD3D).NFKC.list ~~ (0x0627, 0x064B,), 'FD3D -> 0627 064B';
ok Uni.new(0xFD50).NFKC.list ~~ (0x062A, 0x062C, 0x0645,), 'FD50 -> 062A 062C 0645';
ok Uni.new(0xFD51).NFKC.list ~~ (0x062A, 0x062D, 0x062C,), 'FD51 -> 062A 062D 062C';
ok Uni.new(0xFD52).NFKC.list ~~ (0x062A, 0x062D, 0x062C,), 'FD52 -> 062A 062D 062C';
ok Uni.new(0xFD53).NFKC.list ~~ (0x062A, 0x062D, 0x0645,), 'FD53 -> 062A 062D 0645';
ok Uni.new(0xFD54).NFKC.list ~~ (0x062A, 0x062E, 0x0645,), 'FD54 -> 062A 062E 0645';
ok Uni.new(0xFD55).NFKC.list ~~ (0x062A, 0x0645, 0x062C,), 'FD55 -> 062A 0645 062C';
ok Uni.new(0xFD56).NFKC.list ~~ (0x062A, 0x0645, 0x062D,), 'FD56 -> 062A 0645 062D';
ok Uni.new(0xFD57).NFKC.list ~~ (0x062A, 0x0645, 0x062E,), 'FD57 -> 062A 0645 062E';
ok Uni.new(0xFD58).NFKC.list ~~ (0x062C, 0x0645, 0x062D,), 'FD58 -> 062C 0645 062D';
ok Uni.new(0xFD59).NFKC.list ~~ (0x062C, 0x0645, 0x062D,), 'FD59 -> 062C 0645 062D';
ok Uni.new(0xFD5A).NFKC.list ~~ (0x062D, 0x0645, 0x064A,), 'FD5A -> 062D 0645 064A';
ok Uni.new(0xFD5B).NFKC.list ~~ (0x062D, 0x0645, 0x0649,), 'FD5B -> 062D 0645 0649';
ok Uni.new(0xFD5C).NFKC.list ~~ (0x0633, 0x062D, 0x062C,), 'FD5C -> 0633 062D 062C';
ok Uni.new(0xFD5D).NFKC.list ~~ (0x0633, 0x062C, 0x062D,), 'FD5D -> 0633 062C 062D';
ok Uni.new(0xFD5E).NFKC.list ~~ (0x0633, 0x062C, 0x0649,), 'FD5E -> 0633 062C 0649';
ok Uni.new(0xFD5F).NFKC.list ~~ (0x0633, 0x0645, 0x062D,), 'FD5F -> 0633 0645 062D';
ok Uni.new(0xFD60).NFKC.list ~~ (0x0633, 0x0645, 0x062D,), 'FD60 -> 0633 0645 062D';
ok Uni.new(0xFD61).NFKC.list ~~ (0x0633, 0x0645, 0x062C,), 'FD61 -> 0633 0645 062C';
ok Uni.new(0xFD62).NFKC.list ~~ (0x0633, 0x0645, 0x0645,), 'FD62 -> 0633 0645 0645';
ok Uni.new(0xFD63).NFKC.list ~~ (0x0633, 0x0645, 0x0645,), 'FD63 -> 0633 0645 0645';
ok Uni.new(0xFD64).NFKC.list ~~ (0x0635, 0x062D, 0x062D,), 'FD64 -> 0635 062D 062D';
ok Uni.new(0xFD65).NFKC.list ~~ (0x0635, 0x062D, 0x062D,), 'FD65 -> 0635 062D 062D';
ok Uni.new(0xFD66).NFKC.list ~~ (0x0635, 0x0645, 0x0645,), 'FD66 -> 0635 0645 0645';
ok Uni.new(0xFD67).NFKC.list ~~ (0x0634, 0x062D, 0x0645,), 'FD67 -> 0634 062D 0645';
ok Uni.new(0xFD68).NFKC.list ~~ (0x0634, 0x062D, 0x0645,), 'FD68 -> 0634 062D 0645';
ok Uni.new(0xFD69).NFKC.list ~~ (0x0634, 0x062C, 0x064A,), 'FD69 -> 0634 062C 064A';
ok Uni.new(0xFD6A).NFKC.list ~~ (0x0634, 0x0645, 0x062E,), 'FD6A -> 0634 0645 062E';
ok Uni.new(0xFD6B).NFKC.list ~~ (0x0634, 0x0645, 0x062E,), 'FD6B -> 0634 0645 062E';
ok Uni.new(0xFD6C).NFKC.list ~~ (0x0634, 0x0645, 0x0645,), 'FD6C -> 0634 0645 0645';
ok Uni.new(0xFD6D).NFKC.list ~~ (0x0634, 0x0645, 0x0645,), 'FD6D -> 0634 0645 0645';
ok Uni.new(0xFD6E).NFKC.list ~~ (0x0636, 0x062D, 0x0649,), 'FD6E -> 0636 062D 0649';
ok Uni.new(0xFD6F).NFKC.list ~~ (0x0636, 0x062E, 0x0645,), 'FD6F -> 0636 062E 0645';
ok Uni.new(0xFD70).NFKC.list ~~ (0x0636, 0x062E, 0x0645,), 'FD70 -> 0636 062E 0645';
ok Uni.new(0xFD71).NFKC.list ~~ (0x0637, 0x0645, 0x062D,), 'FD71 -> 0637 0645 062D';
ok Uni.new(0xFD72).NFKC.list ~~ (0x0637, 0x0645, 0x062D,), 'FD72 -> 0637 0645 062D';
ok Uni.new(0xFD73).NFKC.list ~~ (0x0637, 0x0645, 0x0645,), 'FD73 -> 0637 0645 0645';
ok Uni.new(0xFD74).NFKC.list ~~ (0x0637, 0x0645, 0x064A,), 'FD74 -> 0637 0645 064A';
ok Uni.new(0xFD75).NFKC.list ~~ (0x0639, 0x062C, 0x0645,), 'FD75 -> 0639 062C 0645';
ok Uni.new(0xFD76).NFKC.list ~~ (0x0639, 0x0645, 0x0645,), 'FD76 -> 0639 0645 0645';
ok Uni.new(0xFD77).NFKC.list ~~ (0x0639, 0x0645, 0x0645,), 'FD77 -> 0639 0645 0645';
ok Uni.new(0xFD78).NFKC.list ~~ (0x0639, 0x0645, 0x0649,), 'FD78 -> 0639 0645 0649';
ok Uni.new(0xFD79).NFKC.list ~~ (0x063A, 0x0645, 0x0645,), 'FD79 -> 063A 0645 0645';
ok Uni.new(0xFD7A).NFKC.list ~~ (0x063A, 0x0645, 0x064A,), 'FD7A -> 063A 0645 064A';
ok Uni.new(0xFD7B).NFKC.list ~~ (0x063A, 0x0645, 0x0649,), 'FD7B -> 063A 0645 0649';
ok Uni.new(0xFD7C).NFKC.list ~~ (0x0641, 0x062E, 0x0645,), 'FD7C -> 0641 062E 0645';
ok Uni.new(0xFD7D).NFKC.list ~~ (0x0641, 0x062E, 0x0645,), 'FD7D -> 0641 062E 0645';
ok Uni.new(0xFD7E).NFKC.list ~~ (0x0642, 0x0645, 0x062D,), 'FD7E -> 0642 0645 062D';
ok Uni.new(0xFD7F).NFKC.list ~~ (0x0642, 0x0645, 0x0645,), 'FD7F -> 0642 0645 0645';
ok Uni.new(0xFD80).NFKC.list ~~ (0x0644, 0x062D, 0x0645,), 'FD80 -> 0644 062D 0645';
ok Uni.new(0xFD81).NFKC.list ~~ (0x0644, 0x062D, 0x064A,), 'FD81 -> 0644 062D 064A';
ok Uni.new(0xFD82).NFKC.list ~~ (0x0644, 0x062D, 0x0649,), 'FD82 -> 0644 062D 0649';
ok Uni.new(0xFD83).NFKC.list ~~ (0x0644, 0x062C, 0x062C,), 'FD83 -> 0644 062C 062C';
ok Uni.new(0xFD84).NFKC.list ~~ (0x0644, 0x062C, 0x062C,), 'FD84 -> 0644 062C 062C';
ok Uni.new(0xFD85).NFKC.list ~~ (0x0644, 0x062E, 0x0645,), 'FD85 -> 0644 062E 0645';
ok Uni.new(0xFD86).NFKC.list ~~ (0x0644, 0x062E, 0x0645,), 'FD86 -> 0644 062E 0645';
ok Uni.new(0xFD87).NFKC.list ~~ (0x0644, 0x0645, 0x062D,), 'FD87 -> 0644 0645 062D';
ok Uni.new(0xFD88).NFKC.list ~~ (0x0644, 0x0645, 0x062D,), 'FD88 -> 0644 0645 062D';
ok Uni.new(0xFD89).NFKC.list ~~ (0x0645, 0x062D, 0x062C,), 'FD89 -> 0645 062D 062C';
ok Uni.new(0xFD8A).NFKC.list ~~ (0x0645, 0x062D, 0x0645,), 'FD8A -> 0645 062D 0645';
ok Uni.new(0xFD8B).NFKC.list ~~ (0x0645, 0x062D, 0x064A,), 'FD8B -> 0645 062D 064A';
ok Uni.new(0xFD8C).NFKC.list ~~ (0x0645, 0x062C, 0x062D,), 'FD8C -> 0645 062C 062D';
ok Uni.new(0xFD8D).NFKC.list ~~ (0x0645, 0x062C, 0x0645,), 'FD8D -> 0645 062C 0645';
ok Uni.new(0xFD8E).NFKC.list ~~ (0x0645, 0x062E, 0x062C,), 'FD8E -> 0645 062E 062C';
ok Uni.new(0xFD8F).NFKC.list ~~ (0x0645, 0x062E, 0x0645,), 'FD8F -> 0645 062E 0645';
ok Uni.new(0xFD92).NFKC.list ~~ (0x0645, 0x062C, 0x062E,), 'FD92 -> 0645 062C 062E';
ok Uni.new(0xFD93).NFKC.list ~~ (0x0647, 0x0645, 0x062C,), 'FD93 -> 0647 0645 062C';
ok Uni.new(0xFD94).NFKC.list ~~ (0x0647, 0x0645, 0x0645,), 'FD94 -> 0647 0645 0645';
ok Uni.new(0xFD95).NFKC.list ~~ (0x0646, 0x062D, 0x0645,), 'FD95 -> 0646 062D 0645';
ok Uni.new(0xFD96).NFKC.list ~~ (0x0646, 0x062D, 0x0649,), 'FD96 -> 0646 062D 0649';
ok Uni.new(0xFD97).NFKC.list ~~ (0x0646, 0x062C, 0x0645,), 'FD97 -> 0646 062C 0645';
ok Uni.new(0xFD98).NFKC.list ~~ (0x0646, 0x062C, 0x0645,), 'FD98 -> 0646 062C 0645';
ok Uni.new(0xFD99).NFKC.list ~~ (0x0646, 0x062C, 0x0649,), 'FD99 -> 0646 062C 0649';
ok Uni.new(0xFD9A).NFKC.list ~~ (0x0646, 0x0645, 0x064A,), 'FD9A -> 0646 0645 064A';
ok Uni.new(0xFD9B).NFKC.list ~~ (0x0646, 0x0645, 0x0649,), 'FD9B -> 0646 0645 0649';
ok Uni.new(0xFD9C).NFKC.list ~~ (0x064A, 0x0645, 0x0645,), 'FD9C -> 064A 0645 0645';
ok Uni.new(0xFD9D).NFKC.list ~~ (0x064A, 0x0645, 0x0645,), 'FD9D -> 064A 0645 0645';
ok Uni.new(0xFD9E).NFKC.list ~~ (0x0628, 0x062E, 0x064A,), 'FD9E -> 0628 062E 064A';
ok Uni.new(0xFD9F).NFKC.list ~~ (0x062A, 0x062C, 0x064A,), 'FD9F -> 062A 062C 064A';
ok Uni.new(0xFDA0).NFKC.list ~~ (0x062A, 0x062C, 0x0649,), 'FDA0 -> 062A 062C 0649';
ok Uni.new(0xFDA1).NFKC.list ~~ (0x062A, 0x062E, 0x064A,), 'FDA1 -> 062A 062E 064A';
ok Uni.new(0xFDA2).NFKC.list ~~ (0x062A, 0x062E, 0x0649,), 'FDA2 -> 062A 062E 0649';
ok Uni.new(0xFDA3).NFKC.list ~~ (0x062A, 0x0645, 0x064A,), 'FDA3 -> 062A 0645 064A';
ok Uni.new(0xFDA4).NFKC.list ~~ (0x062A, 0x0645, 0x0649,), 'FDA4 -> 062A 0645 0649';
ok Uni.new(0xFDA5).NFKC.list ~~ (0x062C, 0x0645, 0x064A,), 'FDA5 -> 062C 0645 064A';
ok Uni.new(0xFDA6).NFKC.list ~~ (0x062C, 0x062D, 0x0649,), 'FDA6 -> 062C 062D 0649';
ok Uni.new(0xFDA7).NFKC.list ~~ (0x062C, 0x0645, 0x0649,), 'FDA7 -> 062C 0645 0649';
ok Uni.new(0xFDA8).NFKC.list ~~ (0x0633, 0x062E, 0x0649,), 'FDA8 -> 0633 062E 0649';
ok Uni.new(0xFDA9).NFKC.list ~~ (0x0635, 0x062D, 0x064A,), 'FDA9 -> 0635 062D 064A';
ok Uni.new(0xFDAA).NFKC.list ~~ (0x0634, 0x062D, 0x064A,), 'FDAA -> 0634 062D 064A';
ok Uni.new(0xFDAB).NFKC.list ~~ (0x0636, 0x062D, 0x064A,), 'FDAB -> 0636 062D 064A';
ok Uni.new(0xFDAC).NFKC.list ~~ (0x0644, 0x062C, 0x064A,), 'FDAC -> 0644 062C 064A';
ok Uni.new(0xFDAD).NFKC.list ~~ (0x0644, 0x0645, 0x064A,), 'FDAD -> 0644 0645 064A';
ok Uni.new(0xFDAE).NFKC.list ~~ (0x064A, 0x062D, 0x064A,), 'FDAE -> 064A 062D 064A';
ok Uni.new(0xFDAF).NFKC.list ~~ (0x064A, 0x062C, 0x064A,), 'FDAF -> 064A 062C 064A';
ok Uni.new(0xFDB0).NFKC.list ~~ (0x064A, 0x0645, 0x064A,), 'FDB0 -> 064A 0645 064A';
ok Uni.new(0xFDB1).NFKC.list ~~ (0x0645, 0x0645, 0x064A,), 'FDB1 -> 0645 0645 064A';
ok Uni.new(0xFDB2).NFKC.list ~~ (0x0642, 0x0645, 0x064A,), 'FDB2 -> 0642 0645 064A';
ok Uni.new(0xFDB3).NFKC.list ~~ (0x0646, 0x062D, 0x064A,), 'FDB3 -> 0646 062D 064A';
ok Uni.new(0xFDB4).NFKC.list ~~ (0x0642, 0x0645, 0x062D,), 'FDB4 -> 0642 0645 062D';
ok Uni.new(0xFDB5).NFKC.list ~~ (0x0644, 0x062D, 0x0645,), 'FDB5 -> 0644 062D 0645';
ok Uni.new(0xFDB6).NFKC.list ~~ (0x0639, 0x0645, 0x064A,), 'FDB6 -> 0639 0645 064A';
ok Uni.new(0xFDB7).NFKC.list ~~ (0x0643, 0x0645, 0x064A,), 'FDB7 -> 0643 0645 064A';
ok Uni.new(0xFDB8).NFKC.list ~~ (0x0646, 0x062C, 0x062D,), 'FDB8 -> 0646 062C 062D';
ok Uni.new(0xFDB9).NFKC.list ~~ (0x0645, 0x062E, 0x064A,), 'FDB9 -> 0645 062E 064A';
ok Uni.new(0xFDBA).NFKC.list ~~ (0x0644, 0x062C, 0x0645,), 'FDBA -> 0644 062C 0645';
ok Uni.new(0xFDBB).NFKC.list ~~ (0x0643, 0x0645, 0x0645,), 'FDBB -> 0643 0645 0645';
ok Uni.new(0xFDBC).NFKC.list ~~ (0x0644, 0x062C, 0x0645,), 'FDBC -> 0644 062C 0645';
ok Uni.new(0xFDBD).NFKC.list ~~ (0x0646, 0x062C, 0x062D,), 'FDBD -> 0646 062C 062D';
ok Uni.new(0xFDBE).NFKC.list ~~ (0x062C, 0x062D, 0x064A,), 'FDBE -> 062C 062D 064A';
ok Uni.new(0xFDBF).NFKC.list ~~ (0x062D, 0x062C, 0x064A,), 'FDBF -> 062D 062C 064A';
ok Uni.new(0xFDC0).NFKC.list ~~ (0x0645, 0x062C, 0x064A,), 'FDC0 -> 0645 062C 064A';
ok Uni.new(0xFDC1).NFKC.list ~~ (0x0641, 0x0645, 0x064A,), 'FDC1 -> 0641 0645 064A';
ok Uni.new(0xFDC2).NFKC.list ~~ (0x0628, 0x062D, 0x064A,), 'FDC2 -> 0628 062D 064A';
ok Uni.new(0xFDC3).NFKC.list ~~ (0x0643, 0x0645, 0x0645,), 'FDC3 -> 0643 0645 0645';
ok Uni.new(0xFDC4).NFKC.list ~~ (0x0639, 0x062C, 0x0645,), 'FDC4 -> 0639 062C 0645';
ok Uni.new(0xFDC5).NFKC.list ~~ (0x0635, 0x0645, 0x0645,), 'FDC5 -> 0635 0645 0645';
ok Uni.new(0xFDC6).NFKC.list ~~ (0x0633, 0x062E, 0x064A,), 'FDC6 -> 0633 062E 064A';
ok Uni.new(0xFDC7).NFKC.list ~~ (0x0646, 0x062C, 0x064A,), 'FDC7 -> 0646 062C 064A';
ok Uni.new(0xFDF0).NFKC.list ~~ (0x0635, 0x0644, 0x06D2,), 'FDF0 -> 0635 0644 06D2';
ok Uni.new(0xFDF1).NFKC.list ~~ (0x0642, 0x0644, 0x06D2,), 'FDF1 -> 0642 0644 06D2';
ok Uni.new(0xFDF2).NFKC.list ~~ (0x0627, 0x0644, 0x0644, 0x0647,), 'FDF2 -> 0627 0644 0644 0647';
ok Uni.new(0xFDF3).NFKC.list ~~ (0x0627, 0x0643, 0x0628, 0x0631,), 'FDF3 -> 0627 0643 0628 0631';
ok Uni.new(0xFDF4).NFKC.list ~~ (0x0645, 0x062D, 0x0645, 0x062F,), 'FDF4 -> 0645 062D 0645 062F';
ok Uni.new(0xFDF5).NFKC.list ~~ (0x0635, 0x0644, 0x0639, 0x0645,), 'FDF5 -> 0635 0644 0639 0645';
ok Uni.new(0xFDF6).NFKC.list ~~ (0x0631, 0x0633, 0x0648, 0x0644,), 'FDF6 -> 0631 0633 0648 0644';
ok Uni.new(0xFDF7).NFKC.list ~~ (0x0639, 0x0644, 0x064A, 0x0647,), 'FDF7 -> 0639 0644 064A 0647';
ok Uni.new(0xFDF8).NFKC.list ~~ (0x0648, 0x0633, 0x0644, 0x0645,), 'FDF8 -> 0648 0633 0644 0645';
ok Uni.new(0xFDF9).NFKC.list ~~ (0x0635, 0x0644, 0x0649,), 'FDF9 -> 0635 0644 0649';
ok Uni.new(0xFDFA).NFKC.list ~~ (0x0635, 0x0644, 0x0649, 0x0020, 0x0627, 0x0644, 0x0644, 0x0647, 0x0020, 0x0639, 0x0644, 0x064A, 0x0647, 0x0020, 0x0648, 0x0633, 0x0644, 0x0645,), 'FDFA -> 0635 0644 0649 0020 0627 0644 0644 0647 0020 0639 0644 064A 0647 0020 0648 0633 0644 0645';
ok Uni.new(0xFDFB).NFKC.list ~~ (0x062C, 0x0644, 0x0020, 0x062C, 0x0644, 0x0627, 0x0644, 0x0647,), 'FDFB -> 062C 0644 0020 062C 0644 0627 0644 0647';
ok Uni.new(0xFDFC).NFKC.list ~~ (0x0631, 0x06CC, 0x0627, 0x0644,), 'FDFC -> 0631 06CC 0627 0644';
ok Uni.new(0xFE10).NFKC.list ~~ (0x002C,), 'FE10 -> 002C';
ok Uni.new(0xFE11).NFKC.list ~~ (0x3001,), 'FE11 -> 3001';
ok Uni.new(0xFE12).NFKC.list ~~ (0x3002,), 'FE12 -> 3002';
ok Uni.new(0xFE13).NFKC.list ~~ (0x003A,), 'FE13 -> 003A';
ok Uni.new(0xFE14).NFKC.list ~~ (0x003B,), 'FE14 -> 003B';
ok Uni.new(0xFE15).NFKC.list ~~ (0x0021,), 'FE15 -> 0021';
ok Uni.new(0xFE16).NFKC.list ~~ (0x003F,), 'FE16 -> 003F';
ok Uni.new(0xFE17).NFKC.list ~~ (0x3016,), 'FE17 -> 3016';
ok Uni.new(0xFE18).NFKC.list ~~ (0x3017,), 'FE18 -> 3017';
ok Uni.new(0xFE19).NFKC.list ~~ (0x002E, 0x002E, 0x002E,), 'FE19 -> 002E 002E 002E';
ok Uni.new(0xFE30).NFKC.list ~~ (0x002E, 0x002E,), 'FE30 -> 002E 002E';
ok Uni.new(0xFE31).NFKC.list ~~ (0x2014,), 'FE31 -> 2014';
ok Uni.new(0xFE32).NFKC.list ~~ (0x2013,), 'FE32 -> 2013';
ok Uni.new(0xFE33).NFKC.list ~~ (0x005F,), 'FE33 -> 005F';
ok Uni.new(0xFE34).NFKC.list ~~ (0x005F,), 'FE34 -> 005F';
ok Uni.new(0xFE35).NFKC.list ~~ (0x0028,), 'FE35 -> 0028';
ok Uni.new(0xFE36).NFKC.list ~~ (0x0029,), 'FE36 -> 0029';
ok Uni.new(0xFE37).NFKC.list ~~ (0x007B,), 'FE37 -> 007B';
ok Uni.new(0xFE38).NFKC.list ~~ (0x007D,), 'FE38 -> 007D';
ok Uni.new(0xFE39).NFKC.list ~~ (0x3014,), 'FE39 -> 3014';
ok Uni.new(0xFE3A).NFKC.list ~~ (0x3015,), 'FE3A -> 3015';
ok Uni.new(0xFE3B).NFKC.list ~~ (0x3010,), 'FE3B -> 3010';
ok Uni.new(0xFE3C).NFKC.list ~~ (0x3011,), 'FE3C -> 3011';
ok Uni.new(0xFE3D).NFKC.list ~~ (0x300A,), 'FE3D -> 300A';
ok Uni.new(0xFE3E).NFKC.list ~~ (0x300B,), 'FE3E -> 300B';
ok Uni.new(0xFE3F).NFKC.list ~~ (0x3008,), 'FE3F -> 3008';
ok Uni.new(0xFE40).NFKC.list ~~ (0x3009,), 'FE40 -> 3009';
ok Uni.new(0xFE41).NFKC.list ~~ (0x300C,), 'FE41 -> 300C';
ok Uni.new(0xFE42).NFKC.list ~~ (0x300D,), 'FE42 -> 300D';
ok Uni.new(0xFE43).NFKC.list ~~ (0x300E,), 'FE43 -> 300E';
ok Uni.new(0xFE44).NFKC.list ~~ (0x300F,), 'FE44 -> 300F';
ok Uni.new(0xFE47).NFKC.list ~~ (0x005B,), 'FE47 -> 005B';
ok Uni.new(0xFE48).NFKC.list ~~ (0x005D,), 'FE48 -> 005D';
ok Uni.new(0xFE49).NFKC.list ~~ (0x0020, 0x0305,), 'FE49 -> 0020 0305';
ok Uni.new(0xFE4A).NFKC.list ~~ (0x0020, 0x0305,), 'FE4A -> 0020 0305';
ok Uni.new(0xFE4B).NFKC.list ~~ (0x0020, 0x0305,), 'FE4B -> 0020 0305';
ok Uni.new(0xFE4C).NFKC.list ~~ (0x0020, 0x0305,), 'FE4C -> 0020 0305';
ok Uni.new(0xFE4D).NFKC.list ~~ (0x005F,), 'FE4D -> 005F';
ok Uni.new(0xFE4E).NFKC.list ~~ (0x005F,), 'FE4E -> 005F';
ok Uni.new(0xFE4F).NFKC.list ~~ (0x005F,), 'FE4F -> 005F';
ok Uni.new(0xFE50).NFKC.list ~~ (0x002C,), 'FE50 -> 002C';
ok Uni.new(0xFE51).NFKC.list ~~ (0x3001,), 'FE51 -> 3001';
ok Uni.new(0xFE52).NFKC.list ~~ (0x002E,), 'FE52 -> 002E';
ok Uni.new(0xFE54).NFKC.list ~~ (0x003B,), 'FE54 -> 003B';
ok Uni.new(0xFE55).NFKC.list ~~ (0x003A,), 'FE55 -> 003A';
ok Uni.new(0xFE56).NFKC.list ~~ (0x003F,), 'FE56 -> 003F';
ok Uni.new(0xFE57).NFKC.list ~~ (0x0021,), 'FE57 -> 0021';
ok Uni.new(0xFE58).NFKC.list ~~ (0x2014,), 'FE58 -> 2014';
ok Uni.new(0xFE59).NFKC.list ~~ (0x0028,), 'FE59 -> 0028';
ok Uni.new(0xFE5A).NFKC.list ~~ (0x0029,), 'FE5A -> 0029';
ok Uni.new(0xFE5B).NFKC.list ~~ (0x007B,), 'FE5B -> 007B';
ok Uni.new(0xFE5C).NFKC.list ~~ (0x007D,), 'FE5C -> 007D';
ok Uni.new(0xFE5D).NFKC.list ~~ (0x3014,), 'FE5D -> 3014';
ok Uni.new(0xFE5E).NFKC.list ~~ (0x3015,), 'FE5E -> 3015';
ok Uni.new(0xFE5F).NFKC.list ~~ (0x0023,), 'FE5F -> 0023';
ok Uni.new(0xFE60).NFKC.list ~~ (0x0026,), 'FE60 -> 0026';
ok Uni.new(0xFE61).NFKC.list ~~ (0x002A,), 'FE61 -> 002A';
ok Uni.new(0xFE62).NFKC.list ~~ (0x002B,), 'FE62 -> 002B';
ok Uni.new(0xFE63).NFKC.list ~~ (0x002D,), 'FE63 -> 002D';
ok Uni.new(0xFE64).NFKC.list ~~ (0x003C,), 'FE64 -> 003C';
ok Uni.new(0xFE65).NFKC.list ~~ (0x003E,), 'FE65 -> 003E';
ok Uni.new(0xFE66).NFKC.list ~~ (0x003D,), 'FE66 -> 003D';
ok Uni.new(0xFE68).NFKC.list ~~ (0x005C,), 'FE68 -> 005C';
ok Uni.new(0xFE69).NFKC.list ~~ (0x0024,), 'FE69 -> 0024';
ok Uni.new(0xFE6A).NFKC.list ~~ (0x0025,), 'FE6A -> 0025';
ok Uni.new(0xFE6B).NFKC.list ~~ (0x0040,), 'FE6B -> 0040';
ok Uni.new(0xFE70).NFKC.list ~~ (0x0020, 0x064B,), 'FE70 -> 0020 064B';
ok Uni.new(0xFE71).NFKC.list ~~ (0x0640, 0x064B,), 'FE71 -> 0640 064B';
ok Uni.new(0xFE72).NFKC.list ~~ (0x0020, 0x064C,), 'FE72 -> 0020 064C';
ok Uni.new(0xFE74).NFKC.list ~~ (0x0020, 0x064D,), 'FE74 -> 0020 064D';
ok Uni.new(0xFE76).NFKC.list ~~ (0x0020, 0x064E,), 'FE76 -> 0020 064E';
ok Uni.new(0xFE77).NFKC.list ~~ (0x0640, 0x064E,), 'FE77 -> 0640 064E';
ok Uni.new(0xFE78).NFKC.list ~~ (0x0020, 0x064F,), 'FE78 -> 0020 064F';
ok Uni.new(0xFE79).NFKC.list ~~ (0x0640, 0x064F,), 'FE79 -> 0640 064F';
ok Uni.new(0xFE7A).NFKC.list ~~ (0x0020, 0x0650,), 'FE7A -> 0020 0650';
ok Uni.new(0xFE7B).NFKC.list ~~ (0x0640, 0x0650,), 'FE7B -> 0640 0650';
ok Uni.new(0xFE7C).NFKC.list ~~ (0x0020, 0x0651,), 'FE7C -> 0020 0651';
ok Uni.new(0xFE7D).NFKC.list ~~ (0x0640, 0x0651,), 'FE7D -> 0640 0651';
ok Uni.new(0xFE7E).NFKC.list ~~ (0x0020, 0x0652,), 'FE7E -> 0020 0652';
ok Uni.new(0xFE7F).NFKC.list ~~ (0x0640, 0x0652,), 'FE7F -> 0640 0652';
ok Uni.new(0xFE80).NFKC.list ~~ (0x0621,), 'FE80 -> 0621';
ok Uni.new(0xFE81).NFKC.list ~~ (0x0622,), 'FE81 -> 0622';
ok Uni.new(0xFE82).NFKC.list ~~ (0x0622,), 'FE82 -> 0622';
ok Uni.new(0xFE83).NFKC.list ~~ (0x0623,), 'FE83 -> 0623';
ok Uni.new(0xFE84).NFKC.list ~~ (0x0623,), 'FE84 -> 0623';
ok Uni.new(0xFE85).NFKC.list ~~ (0x0624,), 'FE85 -> 0624';
ok Uni.new(0xFE86).NFKC.list ~~ (0x0624,), 'FE86 -> 0624';
ok Uni.new(0xFE87).NFKC.list ~~ (0x0625,), 'FE87 -> 0625';
ok Uni.new(0xFE88).NFKC.list ~~ (0x0625,), 'FE88 -> 0625';
ok Uni.new(0xFE89).NFKC.list ~~ (0x0626,), 'FE89 -> 0626';
ok Uni.new(0xFE8A).NFKC.list ~~ (0x0626,), 'FE8A -> 0626';
ok Uni.new(0xFE8B).NFKC.list ~~ (0x0626,), 'FE8B -> 0626';
ok Uni.new(0xFE8C).NFKC.list ~~ (0x0626,), 'FE8C -> 0626';
ok Uni.new(0xFE8D).NFKC.list ~~ (0x0627,), 'FE8D -> 0627';
ok Uni.new(0xFE8E).NFKC.list ~~ (0x0627,), 'FE8E -> 0627';
ok Uni.new(0xFE8F).NFKC.list ~~ (0x0628,), 'FE8F -> 0628';
ok Uni.new(0xFE90).NFKC.list ~~ (0x0628,), 'FE90 -> 0628';
ok Uni.new(0xFE91).NFKC.list ~~ (0x0628,), 'FE91 -> 0628';
ok Uni.new(0xFE92).NFKC.list ~~ (0x0628,), 'FE92 -> 0628';
ok Uni.new(0xFE93).NFKC.list ~~ (0x0629,), 'FE93 -> 0629';
ok Uni.new(0xFE94).NFKC.list ~~ (0x0629,), 'FE94 -> 0629';
ok Uni.new(0xFE95).NFKC.list ~~ (0x062A,), 'FE95 -> 062A';
ok Uni.new(0xFE96).NFKC.list ~~ (0x062A,), 'FE96 -> 062A';
ok Uni.new(0xFE97).NFKC.list ~~ (0x062A,), 'FE97 -> 062A';
ok Uni.new(0xFE98).NFKC.list ~~ (0x062A,), 'FE98 -> 062A';
ok Uni.new(0xFE99).NFKC.list ~~ (0x062B,), 'FE99 -> 062B';
ok Uni.new(0xFE9A).NFKC.list ~~ (0x062B,), 'FE9A -> 062B';
ok Uni.new(0xFE9B).NFKC.list ~~ (0x062B,), 'FE9B -> 062B';
ok Uni.new(0xFE9C).NFKC.list ~~ (0x062B,), 'FE9C -> 062B';
ok Uni.new(0xFE9D).NFKC.list ~~ (0x062C,), 'FE9D -> 062C';
ok Uni.new(0xFE9E).NFKC.list ~~ (0x062C,), 'FE9E -> 062C';
ok Uni.new(0xFE9F).NFKC.list ~~ (0x062C,), 'FE9F -> 062C';
ok Uni.new(0xFEA0).NFKC.list ~~ (0x062C,), 'FEA0 -> 062C';
ok Uni.new(0xFEA1).NFKC.list ~~ (0x062D,), 'FEA1 -> 062D';
ok Uni.new(0xFEA2).NFKC.list ~~ (0x062D,), 'FEA2 -> 062D';
ok Uni.new(0xFEA3).NFKC.list ~~ (0x062D,), 'FEA3 -> 062D';
ok Uni.new(0xFEA4).NFKC.list ~~ (0x062D,), 'FEA4 -> 062D';
ok Uni.new(0xFEA5).NFKC.list ~~ (0x062E,), 'FEA5 -> 062E';
ok Uni.new(0xFEA6).NFKC.list ~~ (0x062E,), 'FEA6 -> 062E';
ok Uni.new(0xFEA7).NFKC.list ~~ (0x062E,), 'FEA7 -> 062E';
ok Uni.new(0xFEA8).NFKC.list ~~ (0x062E,), 'FEA8 -> 062E';
ok Uni.new(0xFEA9).NFKC.list ~~ (0x062F,), 'FEA9 -> 062F';
ok Uni.new(0xFEAA).NFKC.list ~~ (0x062F,), 'FEAA -> 062F';
ok Uni.new(0xFEAB).NFKC.list ~~ (0x0630,), 'FEAB -> 0630';
ok Uni.new(0xFEAC).NFKC.list ~~ (0x0630,), 'FEAC -> 0630';
ok Uni.new(0xFEAD).NFKC.list ~~ (0x0631,), 'FEAD -> 0631';
ok Uni.new(0xFEAE).NFKC.list ~~ (0x0631,), 'FEAE -> 0631';
ok Uni.new(0xFEAF).NFKC.list ~~ (0x0632,), 'FEAF -> 0632';
ok Uni.new(0xFEB0).NFKC.list ~~ (0x0632,), 'FEB0 -> 0632';
ok Uni.new(0xFEB1).NFKC.list ~~ (0x0633,), 'FEB1 -> 0633';
ok Uni.new(0xFEB2).NFKC.list ~~ (0x0633,), 'FEB2 -> 0633';
ok Uni.new(0xFEB3).NFKC.list ~~ (0x0633,), 'FEB3 -> 0633';
ok Uni.new(0xFEB4).NFKC.list ~~ (0x0633,), 'FEB4 -> 0633';
ok Uni.new(0xFEB5).NFKC.list ~~ (0x0634,), 'FEB5 -> 0634';
ok Uni.new(0xFEB6).NFKC.list ~~ (0x0634,), 'FEB6 -> 0634';
ok Uni.new(0xFEB7).NFKC.list ~~ (0x0634,), 'FEB7 -> 0634';
ok Uni.new(0xFEB8).NFKC.list ~~ (0x0634,), 'FEB8 -> 0634';
ok Uni.new(0xFEB9).NFKC.list ~~ (0x0635,), 'FEB9 -> 0635';
ok Uni.new(0xFEBA).NFKC.list ~~ (0x0635,), 'FEBA -> 0635';
ok Uni.new(0xFEBB).NFKC.list ~~ (0x0635,), 'FEBB -> 0635';
ok Uni.new(0xFEBC).NFKC.list ~~ (0x0635,), 'FEBC -> 0635';
ok Uni.new(0xFEBD).NFKC.list ~~ (0x0636,), 'FEBD -> 0636';
ok Uni.new(0xFEBE).NFKC.list ~~ (0x0636,), 'FEBE -> 0636';
ok Uni.new(0xFEBF).NFKC.list ~~ (0x0636,), 'FEBF -> 0636';
ok Uni.new(0xFEC0).NFKC.list ~~ (0x0636,), 'FEC0 -> 0636';
ok Uni.new(0xFEC1).NFKC.list ~~ (0x0637,), 'FEC1 -> 0637';
ok Uni.new(0xFEC2).NFKC.list ~~ (0x0637,), 'FEC2 -> 0637';
ok Uni.new(0xFEC3).NFKC.list ~~ (0x0637,), 'FEC3 -> 0637';
ok Uni.new(0xFEC4).NFKC.list ~~ (0x0637,), 'FEC4 -> 0637';
ok Uni.new(0xFEC5).NFKC.list ~~ (0x0638,), 'FEC5 -> 0638';
ok Uni.new(0xFEC6).NFKC.list ~~ (0x0638,), 'FEC6 -> 0638';
ok Uni.new(0xFEC7).NFKC.list ~~ (0x0638,), 'FEC7 -> 0638';
ok Uni.new(0xFEC8).NFKC.list ~~ (0x0638,), 'FEC8 -> 0638';
ok Uni.new(0xFEC9).NFKC.list ~~ (0x0639,), 'FEC9 -> 0639';
ok Uni.new(0xFECA).NFKC.list ~~ (0x0639,), 'FECA -> 0639';
ok Uni.new(0xFECB).NFKC.list ~~ (0x0639,), 'FECB -> 0639';
ok Uni.new(0xFECC).NFKC.list ~~ (0x0639,), 'FECC -> 0639';
ok Uni.new(0xFECD).NFKC.list ~~ (0x063A,), 'FECD -> 063A';
ok Uni.new(0xFECE).NFKC.list ~~ (0x063A,), 'FECE -> 063A';
ok Uni.new(0xFECF).NFKC.list ~~ (0x063A,), 'FECF -> 063A';
ok Uni.new(0xFED0).NFKC.list ~~ (0x063A,), 'FED0 -> 063A';
ok Uni.new(0xFED1).NFKC.list ~~ (0x0641,), 'FED1 -> 0641';
ok Uni.new(0xFED2).NFKC.list ~~ (0x0641,), 'FED2 -> 0641';
ok Uni.new(0xFED3).NFKC.list ~~ (0x0641,), 'FED3 -> 0641';
ok Uni.new(0xFED4).NFKC.list ~~ (0x0641,), 'FED4 -> 0641';
ok Uni.new(0xFED5).NFKC.list ~~ (0x0642,), 'FED5 -> 0642';
ok Uni.new(0xFED6).NFKC.list ~~ (0x0642,), 'FED6 -> 0642';
ok Uni.new(0xFED7).NFKC.list ~~ (0x0642,), 'FED7 -> 0642';
ok Uni.new(0xFED8).NFKC.list ~~ (0x0642,), 'FED8 -> 0642';
ok Uni.new(0xFED9).NFKC.list ~~ (0x0643,), 'FED9 -> 0643';
ok Uni.new(0xFEDA).NFKC.list ~~ (0x0643,), 'FEDA -> 0643';
ok Uni.new(0xFEDB).NFKC.list ~~ (0x0643,), 'FEDB -> 0643';
ok Uni.new(0xFEDC).NFKC.list ~~ (0x0643,), 'FEDC -> 0643';
ok Uni.new(0xFEDD).NFKC.list ~~ (0x0644,), 'FEDD -> 0644';
ok Uni.new(0xFEDE).NFKC.list ~~ (0x0644,), 'FEDE -> 0644';
ok Uni.new(0xFEDF).NFKC.list ~~ (0x0644,), 'FEDF -> 0644';
ok Uni.new(0xFEE0).NFKC.list ~~ (0x0644,), 'FEE0 -> 0644';
ok Uni.new(0xFEE1).NFKC.list ~~ (0x0645,), 'FEE1 -> 0645';
ok Uni.new(0xFEE2).NFKC.list ~~ (0x0645,), 'FEE2 -> 0645';
ok Uni.new(0xFEE3).NFKC.list ~~ (0x0645,), 'FEE3 -> 0645';
ok Uni.new(0xFEE4).NFKC.list ~~ (0x0645,), 'FEE4 -> 0645';
ok Uni.new(0xFEE5).NFKC.list ~~ (0x0646,), 'FEE5 -> 0646';
ok Uni.new(0xFEE6).NFKC.list ~~ (0x0646,), 'FEE6 -> 0646';
ok Uni.new(0xFEE7).NFKC.list ~~ (0x0646,), 'FEE7 -> 0646';
ok Uni.new(0xFEE8).NFKC.list ~~ (0x0646,), 'FEE8 -> 0646';
ok Uni.new(0xFEE9).NFKC.list ~~ (0x0647,), 'FEE9 -> 0647';
ok Uni.new(0xFEEA).NFKC.list ~~ (0x0647,), 'FEEA -> 0647';
ok Uni.new(0xFEEB).NFKC.list ~~ (0x0647,), 'FEEB -> 0647';
ok Uni.new(0xFEEC).NFKC.list ~~ (0x0647,), 'FEEC -> 0647';
ok Uni.new(0xFEED).NFKC.list ~~ (0x0648,), 'FEED -> 0648';
ok Uni.new(0xFEEE).NFKC.list ~~ (0x0648,), 'FEEE -> 0648';
ok Uni.new(0xFEEF).NFKC.list ~~ (0x0649,), 'FEEF -> 0649';
ok Uni.new(0xFEF0).NFKC.list ~~ (0x0649,), 'FEF0 -> 0649';
ok Uni.new(0xFEF1).NFKC.list ~~ (0x064A,), 'FEF1 -> 064A';
ok Uni.new(0xFEF2).NFKC.list ~~ (0x064A,), 'FEF2 -> 064A';
ok Uni.new(0xFEF3).NFKC.list ~~ (0x064A,), 'FEF3 -> 064A';
ok Uni.new(0xFEF4).NFKC.list ~~ (0x064A,), 'FEF4 -> 064A';
ok Uni.new(0xFEF5).NFKC.list ~~ (0x0644, 0x0622,), 'FEF5 -> 0644 0622';
ok Uni.new(0xFEF6).NFKC.list ~~ (0x0644, 0x0622,), 'FEF6 -> 0644 0622';
ok Uni.new(0xFEF7).NFKC.list ~~ (0x0644, 0x0623,), 'FEF7 -> 0644 0623';
ok Uni.new(0xFEF8).NFKC.list ~~ (0x0644, 0x0623,), 'FEF8 -> 0644 0623';
ok Uni.new(0xFEF9).NFKC.list ~~ (0x0644, 0x0625,), 'FEF9 -> 0644 0625';
ok Uni.new(0xFEFA).NFKC.list ~~ (0x0644, 0x0625,), 'FEFA -> 0644 0625';
ok Uni.new(0xFEFB).NFKC.list ~~ (0x0644, 0x0627,), 'FEFB -> 0644 0627';
ok Uni.new(0xFEFC).NFKC.list ~~ (0x0644, 0x0627,), 'FEFC -> 0644 0627';
ok Uni.new(0xFF01).NFKC.list ~~ (0x0021,), 'FF01 -> 0021';
ok Uni.new(0xFF02).NFKC.list ~~ (0x0022,), 'FF02 -> 0022';
ok Uni.new(0xFF03).NFKC.list ~~ (0x0023,), 'FF03 -> 0023';
ok Uni.new(0xFF04).NFKC.list ~~ (0x0024,), 'FF04 -> 0024';
ok Uni.new(0xFF05).NFKC.list ~~ (0x0025,), 'FF05 -> 0025';
ok Uni.new(0xFF06).NFKC.list ~~ (0x0026,), 'FF06 -> 0026';
ok Uni.new(0xFF07).NFKC.list ~~ (0x0027,), 'FF07 -> 0027';
ok Uni.new(0xFF08).NFKC.list ~~ (0x0028,), 'FF08 -> 0028';
ok Uni.new(0xFF09).NFKC.list ~~ (0x0029,), 'FF09 -> 0029';
ok Uni.new(0xFF0A).NFKC.list ~~ (0x002A,), 'FF0A -> 002A';
ok Uni.new(0xFF0B).NFKC.list ~~ (0x002B,), 'FF0B -> 002B';
ok Uni.new(0xFF0C).NFKC.list ~~ (0x002C,), 'FF0C -> 002C';
ok Uni.new(0xFF0D).NFKC.list ~~ (0x002D,), 'FF0D -> 002D';
ok Uni.new(0xFF0E).NFKC.list ~~ (0x002E,), 'FF0E -> 002E';
ok Uni.new(0xFF0F).NFKC.list ~~ (0x002F,), 'FF0F -> 002F';
ok Uni.new(0xFF10).NFKC.list ~~ (0x0030,), 'FF10 -> 0030';
ok Uni.new(0xFF11).NFKC.list ~~ (0x0031,), 'FF11 -> 0031';
ok Uni.new(0xFF12).NFKC.list ~~ (0x0032,), 'FF12 -> 0032';
ok Uni.new(0xFF13).NFKC.list ~~ (0x0033,), 'FF13 -> 0033';
ok Uni.new(0xFF14).NFKC.list ~~ (0x0034,), 'FF14 -> 0034';
ok Uni.new(0xFF15).NFKC.list ~~ (0x0035,), 'FF15 -> 0035';
ok Uni.new(0xFF16).NFKC.list ~~ (0x0036,), 'FF16 -> 0036';
ok Uni.new(0xFF17).NFKC.list ~~ (0x0037,), 'FF17 -> 0037';
ok Uni.new(0xFF18).NFKC.list ~~ (0x0038,), 'FF18 -> 0038';
ok Uni.new(0xFF19).NFKC.list ~~ (0x0039,), 'FF19 -> 0039';
ok Uni.new(0xFF1A).NFKC.list ~~ (0x003A,), 'FF1A -> 003A';
ok Uni.new(0xFF1B).NFKC.list ~~ (0x003B,), 'FF1B -> 003B';
ok Uni.new(0xFF1C).NFKC.list ~~ (0x003C,), 'FF1C -> 003C';
ok Uni.new(0xFF1D).NFKC.list ~~ (0x003D,), 'FF1D -> 003D';
ok Uni.new(0xFF1E).NFKC.list ~~ (0x003E,), 'FF1E -> 003E';
ok Uni.new(0xFF1F).NFKC.list ~~ (0x003F,), 'FF1F -> 003F';
ok Uni.new(0xFF20).NFKC.list ~~ (0x0040,), 'FF20 -> 0040';
ok Uni.new(0xFF21).NFKC.list ~~ (0x0041,), 'FF21 -> 0041';
ok Uni.new(0xFF22).NFKC.list ~~ (0x0042,), 'FF22 -> 0042';
ok Uni.new(0xFF23).NFKC.list ~~ (0x0043,), 'FF23 -> 0043';
ok Uni.new(0xFF24).NFKC.list ~~ (0x0044,), 'FF24 -> 0044';
ok Uni.new(0xFF25).NFKC.list ~~ (0x0045,), 'FF25 -> 0045';
ok Uni.new(0xFF26).NFKC.list ~~ (0x0046,), 'FF26 -> 0046';
ok Uni.new(0xFF27).NFKC.list ~~ (0x0047,), 'FF27 -> 0047';
ok Uni.new(0xFF28).NFKC.list ~~ (0x0048,), 'FF28 -> 0048';
ok Uni.new(0xFF29).NFKC.list ~~ (0x0049,), 'FF29 -> 0049';
ok Uni.new(0xFF2A).NFKC.list ~~ (0x004A,), 'FF2A -> 004A';
ok Uni.new(0xFF2B).NFKC.list ~~ (0x004B,), 'FF2B -> 004B';
ok Uni.new(0xFF2C).NFKC.list ~~ (0x004C,), 'FF2C -> 004C';
ok Uni.new(0xFF2D).NFKC.list ~~ (0x004D,), 'FF2D -> 004D';
ok Uni.new(0xFF2E).NFKC.list ~~ (0x004E,), 'FF2E -> 004E';
ok Uni.new(0xFF2F).NFKC.list ~~ (0x004F,), 'FF2F -> 004F';
ok Uni.new(0xFF30).NFKC.list ~~ (0x0050,), 'FF30 -> 0050';
ok Uni.new(0xFF31).NFKC.list ~~ (0x0051,), 'FF31 -> 0051';
ok Uni.new(0xFF32).NFKC.list ~~ (0x0052,), 'FF32 -> 0052';
ok Uni.new(0xFF33).NFKC.list ~~ (0x0053,), 'FF33 -> 0053';
ok Uni.new(0xFF34).NFKC.list ~~ (0x0054,), 'FF34 -> 0054';
ok Uni.new(0xFF35).NFKC.list ~~ (0x0055,), 'FF35 -> 0055';
ok Uni.new(0xFF36).NFKC.list ~~ (0x0056,), 'FF36 -> 0056';
ok Uni.new(0xFF37).NFKC.list ~~ (0x0057,), 'FF37 -> 0057';
ok Uni.new(0xFF38).NFKC.list ~~ (0x0058,), 'FF38 -> 0058';
ok Uni.new(0xFF39).NFKC.list ~~ (0x0059,), 'FF39 -> 0059';
ok Uni.new(0xFF3A).NFKC.list ~~ (0x005A,), 'FF3A -> 005A';
ok Uni.new(0xFF3B).NFKC.list ~~ (0x005B,), 'FF3B -> 005B';
ok Uni.new(0xFF3C).NFKC.list ~~ (0x005C,), 'FF3C -> 005C';
ok Uni.new(0xFF3D).NFKC.list ~~ (0x005D,), 'FF3D -> 005D';
ok Uni.new(0xFF3E).NFKC.list ~~ (0x005E,), 'FF3E -> 005E';
ok Uni.new(0xFF3F).NFKC.list ~~ (0x005F,), 'FF3F -> 005F';
ok Uni.new(0xFF40).NFKC.list ~~ (0x0060,), 'FF40 -> 0060';
ok Uni.new(0xFF41).NFKC.list ~~ (0x0061,), 'FF41 -> 0061';
ok Uni.new(0xFF42).NFKC.list ~~ (0x0062,), 'FF42 -> 0062';
ok Uni.new(0xFF43).NFKC.list ~~ (0x0063,), 'FF43 -> 0063';
ok Uni.new(0xFF44).NFKC.list ~~ (0x0064,), 'FF44 -> 0064';
ok Uni.new(0xFF45).NFKC.list ~~ (0x0065,), 'FF45 -> 0065';
ok Uni.new(0xFF46).NFKC.list ~~ (0x0066,), 'FF46 -> 0066';
ok Uni.new(0xFF47).NFKC.list ~~ (0x0067,), 'FF47 -> 0067';
ok Uni.new(0xFF48).NFKC.list ~~ (0x0068,), 'FF48 -> 0068';
ok Uni.new(0xFF49).NFKC.list ~~ (0x0069,), 'FF49 -> 0069';
ok Uni.new(0xFF4A).NFKC.list ~~ (0x006A,), 'FF4A -> 006A';
ok Uni.new(0xFF4B).NFKC.list ~~ (0x006B,), 'FF4B -> 006B';
ok Uni.new(0xFF4C).NFKC.list ~~ (0x006C,), 'FF4C -> 006C';
ok Uni.new(0xFF4D).NFKC.list ~~ (0x006D,), 'FF4D -> 006D';
ok Uni.new(0xFF4E).NFKC.list ~~ (0x006E,), 'FF4E -> 006E';
ok Uni.new(0xFF4F).NFKC.list ~~ (0x006F,), 'FF4F -> 006F';
ok Uni.new(0xFF50).NFKC.list ~~ (0x0070,), 'FF50 -> 0070';
ok Uni.new(0xFF51).NFKC.list ~~ (0x0071,), 'FF51 -> 0071';
ok Uni.new(0xFF52).NFKC.list ~~ (0x0072,), 'FF52 -> 0072';
ok Uni.new(0xFF53).NFKC.list ~~ (0x0073,), 'FF53 -> 0073';
ok Uni.new(0xFF54).NFKC.list ~~ (0x0074,), 'FF54 -> 0074';
ok Uni.new(0xFF55).NFKC.list ~~ (0x0075,), 'FF55 -> 0075';
ok Uni.new(0xFF56).NFKC.list ~~ (0x0076,), 'FF56 -> 0076';
ok Uni.new(0xFF57).NFKC.list ~~ (0x0077,), 'FF57 -> 0077';
ok Uni.new(0xFF58).NFKC.list ~~ (0x0078,), 'FF58 -> 0078';
ok Uni.new(0xFF59).NFKC.list ~~ (0x0079,), 'FF59 -> 0079';
ok Uni.new(0xFF5A).NFKC.list ~~ (0x007A,), 'FF5A -> 007A';
ok Uni.new(0xFF5B).NFKC.list ~~ (0x007B,), 'FF5B -> 007B';
ok Uni.new(0xFF5C).NFKC.list ~~ (0x007C,), 'FF5C -> 007C';
ok Uni.new(0xFF5D).NFKC.list ~~ (0x007D,), 'FF5D -> 007D';
ok Uni.new(0xFF5E).NFKC.list ~~ (0x007E,), 'FF5E -> 007E';
ok Uni.new(0xFF5F).NFKC.list ~~ (0x2985,), 'FF5F -> 2985';
ok Uni.new(0xFF60).NFKC.list ~~ (0x2986,), 'FF60 -> 2986';
ok Uni.new(0xFF61).NFKC.list ~~ (0x3002,), 'FF61 -> 3002';
ok Uni.new(0xFF62).NFKC.list ~~ (0x300C,), 'FF62 -> 300C';
ok Uni.new(0xFF63).NFKC.list ~~ (0x300D,), 'FF63 -> 300D';
ok Uni.new(0xFF64).NFKC.list ~~ (0x3001,), 'FF64 -> 3001';
ok Uni.new(0xFF65).NFKC.list ~~ (0x30FB,), 'FF65 -> 30FB';
ok Uni.new(0xFF66).NFKC.list ~~ (0x30F2,), 'FF66 -> 30F2';
ok Uni.new(0xFF67).NFKC.list ~~ (0x30A1,), 'FF67 -> 30A1';
ok Uni.new(0xFF68).NFKC.list ~~ (0x30A3,), 'FF68 -> 30A3';
ok Uni.new(0xFF69).NFKC.list ~~ (0x30A5,), 'FF69 -> 30A5';
ok Uni.new(0xFF6A).NFKC.list ~~ (0x30A7,), 'FF6A -> 30A7';
ok Uni.new(0xFF6B).NFKC.list ~~ (0x30A9,), 'FF6B -> 30A9';
ok Uni.new(0xFF6C).NFKC.list ~~ (0x30E3,), 'FF6C -> 30E3';
ok Uni.new(0xFF6D).NFKC.list ~~ (0x30E5,), 'FF6D -> 30E5';
ok Uni.new(0xFF6E).NFKC.list ~~ (0x30E7,), 'FF6E -> 30E7';
ok Uni.new(0xFF6F).NFKC.list ~~ (0x30C3,), 'FF6F -> 30C3';
ok Uni.new(0xFF70).NFKC.list ~~ (0x30FC,), 'FF70 -> 30FC';
ok Uni.new(0xFF71).NFKC.list ~~ (0x30A2,), 'FF71 -> 30A2';
ok Uni.new(0xFF72).NFKC.list ~~ (0x30A4,), 'FF72 -> 30A4';
ok Uni.new(0xFF73).NFKC.list ~~ (0x30A6,), 'FF73 -> 30A6';
ok Uni.new(0xFF74).NFKC.list ~~ (0x30A8,), 'FF74 -> 30A8';
ok Uni.new(0xFF75).NFKC.list ~~ (0x30AA,), 'FF75 -> 30AA';
ok Uni.new(0xFF76).NFKC.list ~~ (0x30AB,), 'FF76 -> 30AB';
ok Uni.new(0xFF77).NFKC.list ~~ (0x30AD,), 'FF77 -> 30AD';
ok Uni.new(0xFF78).NFKC.list ~~ (0x30AF,), 'FF78 -> 30AF';
ok Uni.new(0xFF79).NFKC.list ~~ (0x30B1,), 'FF79 -> 30B1';
ok Uni.new(0xFF7A).NFKC.list ~~ (0x30B3,), 'FF7A -> 30B3';
ok Uni.new(0xFF7B).NFKC.list ~~ (0x30B5,), 'FF7B -> 30B5';
ok Uni.new(0xFF7C).NFKC.list ~~ (0x30B7,), 'FF7C -> 30B7';
ok Uni.new(0xFF7D).NFKC.list ~~ (0x30B9,), 'FF7D -> 30B9';
ok Uni.new(0xFF7E).NFKC.list ~~ (0x30BB,), 'FF7E -> 30BB';
ok Uni.new(0xFF7F).NFKC.list ~~ (0x30BD,), 'FF7F -> 30BD';
ok Uni.new(0xFF80).NFKC.list ~~ (0x30BF,), 'FF80 -> 30BF';
ok Uni.new(0xFF81).NFKC.list ~~ (0x30C1,), 'FF81 -> 30C1';
ok Uni.new(0xFF82).NFKC.list ~~ (0x30C4,), 'FF82 -> 30C4';
ok Uni.new(0xFF83).NFKC.list ~~ (0x30C6,), 'FF83 -> 30C6';
ok Uni.new(0xFF84).NFKC.list ~~ (0x30C8,), 'FF84 -> 30C8';
ok Uni.new(0xFF85).NFKC.list ~~ (0x30CA,), 'FF85 -> 30CA';
ok Uni.new(0xFF86).NFKC.list ~~ (0x30CB,), 'FF86 -> 30CB';
ok Uni.new(0xFF87).NFKC.list ~~ (0x30CC,), 'FF87 -> 30CC';
ok Uni.new(0xFF88).NFKC.list ~~ (0x30CD,), 'FF88 -> 30CD';
ok Uni.new(0xFF89).NFKC.list ~~ (0x30CE,), 'FF89 -> 30CE';
ok Uni.new(0xFF8A).NFKC.list ~~ (0x30CF,), 'FF8A -> 30CF';
ok Uni.new(0xFF8B).NFKC.list ~~ (0x30D2,), 'FF8B -> 30D2';
ok Uni.new(0xFF8C).NFKC.list ~~ (0x30D5,), 'FF8C -> 30D5';
ok Uni.new(0xFF8D).NFKC.list ~~ (0x30D8,), 'FF8D -> 30D8';
ok Uni.new(0xFF8E).NFKC.list ~~ (0x30DB,), 'FF8E -> 30DB';
ok Uni.new(0xFF8F).NFKC.list ~~ (0x30DE,), 'FF8F -> 30DE';
ok Uni.new(0xFF90).NFKC.list ~~ (0x30DF,), 'FF90 -> 30DF';
ok Uni.new(0xFF91).NFKC.list ~~ (0x30E0,), 'FF91 -> 30E0';
ok Uni.new(0xFF92).NFKC.list ~~ (0x30E1,), 'FF92 -> 30E1';
ok Uni.new(0xFF93).NFKC.list ~~ (0x30E2,), 'FF93 -> 30E2';
ok Uni.new(0xFF94).NFKC.list ~~ (0x30E4,), 'FF94 -> 30E4';
ok Uni.new(0xFF95).NFKC.list ~~ (0x30E6,), 'FF95 -> 30E6';
ok Uni.new(0xFF96).NFKC.list ~~ (0x30E8,), 'FF96 -> 30E8';
ok Uni.new(0xFF97).NFKC.list ~~ (0x30E9,), 'FF97 -> 30E9';
ok Uni.new(0xFF98).NFKC.list ~~ (0x30EA,), 'FF98 -> 30EA';
ok Uni.new(0xFF99).NFKC.list ~~ (0x30EB,), 'FF99 -> 30EB';
ok Uni.new(0xFF9A).NFKC.list ~~ (0x30EC,), 'FF9A -> 30EC';
ok Uni.new(0xFF9B).NFKC.list ~~ (0x30ED,), 'FF9B -> 30ED';
ok Uni.new(0xFF9C).NFKC.list ~~ (0x30EF,), 'FF9C -> 30EF';
ok Uni.new(0xFF9D).NFKC.list ~~ (0x30F3,), 'FF9D -> 30F3';
ok Uni.new(0xFF9E).NFKC.list ~~ (0x3099,), 'FF9E -> 3099';
ok Uni.new(0xFF9F).NFKC.list ~~ (0x309A,), 'FF9F -> 309A';
ok Uni.new(0xFFA0).NFKC.list ~~ (0x1160,), 'FFA0 -> 1160';
ok Uni.new(0xFFA1).NFKC.list ~~ (0x1100,), 'FFA1 -> 1100';
ok Uni.new(0xFFA2).NFKC.list ~~ (0x1101,), 'FFA2 -> 1101';
ok Uni.new(0xFFA3).NFKC.list ~~ (0x11AA,), 'FFA3 -> 11AA';
ok Uni.new(0xFFA4).NFKC.list ~~ (0x1102,), 'FFA4 -> 1102';
ok Uni.new(0xFFA5).NFKC.list ~~ (0x11AC,), 'FFA5 -> 11AC';
ok Uni.new(0xFFA6).NFKC.list ~~ (0x11AD,), 'FFA6 -> 11AD';
ok Uni.new(0xFFA7).NFKC.list ~~ (0x1103,), 'FFA7 -> 1103';
ok Uni.new(0xFFA8).NFKC.list ~~ (0x1104,), 'FFA8 -> 1104';
ok Uni.new(0xFFA9).NFKC.list ~~ (0x1105,), 'FFA9 -> 1105';
ok Uni.new(0xFFAA).NFKC.list ~~ (0x11B0,), 'FFAA -> 11B0';
ok Uni.new(0xFFAB).NFKC.list ~~ (0x11B1,), 'FFAB -> 11B1';
ok Uni.new(0xFFAC).NFKC.list ~~ (0x11B2,), 'FFAC -> 11B2';
ok Uni.new(0xFFAD).NFKC.list ~~ (0x11B3,), 'FFAD -> 11B3';
ok Uni.new(0xFFAE).NFKC.list ~~ (0x11B4,), 'FFAE -> 11B4';
ok Uni.new(0xFFAF).NFKC.list ~~ (0x11B5,), 'FFAF -> 11B5';
ok Uni.new(0xFFB0).NFKC.list ~~ (0x111A,), 'FFB0 -> 111A';
ok Uni.new(0xFFB1).NFKC.list ~~ (0x1106,), 'FFB1 -> 1106';
ok Uni.new(0xFFB2).NFKC.list ~~ (0x1107,), 'FFB2 -> 1107';
ok Uni.new(0xFFB3).NFKC.list ~~ (0x1108,), 'FFB3 -> 1108';
ok Uni.new(0xFFB4).NFKC.list ~~ (0x1121,), 'FFB4 -> 1121';
ok Uni.new(0xFFB5).NFKC.list ~~ (0x1109,), 'FFB5 -> 1109';
ok Uni.new(0xFFB6).NFKC.list ~~ (0x110A,), 'FFB6 -> 110A';
ok Uni.new(0xFFB7).NFKC.list ~~ (0x110B,), 'FFB7 -> 110B';
ok Uni.new(0xFFB8).NFKC.list ~~ (0x110C,), 'FFB8 -> 110C';
ok Uni.new(0xFFB9).NFKC.list ~~ (0x110D,), 'FFB9 -> 110D';
ok Uni.new(0xFFBA).NFKC.list ~~ (0x110E,), 'FFBA -> 110E';
ok Uni.new(0xFFBB).NFKC.list ~~ (0x110F,), 'FFBB -> 110F';
ok Uni.new(0xFFBC).NFKC.list ~~ (0x1110,), 'FFBC -> 1110';
ok Uni.new(0xFFBD).NFKC.list ~~ (0x1111,), 'FFBD -> 1111';
ok Uni.new(0xFFBE).NFKC.list ~~ (0x1112,), 'FFBE -> 1112';
ok Uni.new(0xFFC2).NFKC.list ~~ (0x1161,), 'FFC2 -> 1161';
ok Uni.new(0xFFC3).NFKC.list ~~ (0x1162,), 'FFC3 -> 1162';
ok Uni.new(0xFFC4).NFKC.list ~~ (0x1163,), 'FFC4 -> 1163';
ok Uni.new(0xFFC5).NFKC.list ~~ (0x1164,), 'FFC5 -> 1164';
ok Uni.new(0xFFC6).NFKC.list ~~ (0x1165,), 'FFC6 -> 1165';
ok Uni.new(0xFFC7).NFKC.list ~~ (0x1166,), 'FFC7 -> 1166';
ok Uni.new(0xFFCA).NFKC.list ~~ (0x1167,), 'FFCA -> 1167';
ok Uni.new(0xFFCB).NFKC.list ~~ (0x1168,), 'FFCB -> 1168';
ok Uni.new(0xFFCC).NFKC.list ~~ (0x1169,), 'FFCC -> 1169';
ok Uni.new(0xFFCD).NFKC.list ~~ (0x116A,), 'FFCD -> 116A';
ok Uni.new(0xFFCE).NFKC.list ~~ (0x116B,), 'FFCE -> 116B';
ok Uni.new(0xFFCF).NFKC.list ~~ (0x116C,), 'FFCF -> 116C';
ok Uni.new(0xFFD2).NFKC.list ~~ (0x116D,), 'FFD2 -> 116D';
ok Uni.new(0xFFD3).NFKC.list ~~ (0x116E,), 'FFD3 -> 116E';
ok Uni.new(0xFFD4).NFKC.list ~~ (0x116F,), 'FFD4 -> 116F';
ok Uni.new(0xFFD5).NFKC.list ~~ (0x1170,), 'FFD5 -> 1170';
ok Uni.new(0xFFD6).NFKC.list ~~ (0x1171,), 'FFD6 -> 1171';
ok Uni.new(0xFFD7).NFKC.list ~~ (0x1172,), 'FFD7 -> 1172';
ok Uni.new(0xFFDA).NFKC.list ~~ (0x1173,), 'FFDA -> 1173';
ok Uni.new(0xFFDB).NFKC.list ~~ (0x1174,), 'FFDB -> 1174';
ok Uni.new(0xFFDC).NFKC.list ~~ (0x1175,), 'FFDC -> 1175';
ok Uni.new(0xFFE0).NFKC.list ~~ (0x00A2,), 'FFE0 -> 00A2';
ok Uni.new(0xFFE1).NFKC.list ~~ (0x00A3,), 'FFE1 -> 00A3';
ok Uni.new(0xFFE2).NFKC.list ~~ (0x00AC,), 'FFE2 -> 00AC';
ok Uni.new(0xFFE3).NFKC.list ~~ (0x0020, 0x0304,), 'FFE3 -> 0020 0304';
ok Uni.new(0xFFE4).NFKC.list ~~ (0x00A6,), 'FFE4 -> 00A6';
ok Uni.new(0xFFE5).NFKC.list ~~ (0x00A5,), 'FFE5 -> 00A5';
ok Uni.new(0xFFE6).NFKC.list ~~ (0x20A9,), 'FFE6 -> 20A9';
ok Uni.new(0xFFE8).NFKC.list ~~ (0x2502,), 'FFE8 -> 2502';
ok Uni.new(0xFFE9).NFKC.list ~~ (0x2190,), 'FFE9 -> 2190';
ok Uni.new(0xFFEA).NFKC.list ~~ (0x2191,), 'FFEA -> 2191';
ok Uni.new(0xFFEB).NFKC.list ~~ (0x2192,), 'FFEB -> 2192';
ok Uni.new(0xFFEC).NFKC.list ~~ (0x2193,), 'FFEC -> 2193';
ok Uni.new(0xFFED).NFKC.list ~~ (0x25A0,), 'FFED -> 25A0';
ok Uni.new(0xFFEE).NFKC.list ~~ (0x25CB,), 'FFEE -> 25CB';
ok Uni.new(0x1109A).NFKC.list ~~ (0x1109A,), '1109A -> 1109A';
ok Uni.new(0x1109C).NFKC.list ~~ (0x1109C,), '1109C -> 1109C';
ok Uni.new(0x110AB).NFKC.list ~~ (0x110AB,), '110AB -> 110AB';
ok Uni.new(0x1112E).NFKC.list ~~ (0x1112E,), '1112E -> 1112E';
ok Uni.new(0x1112F).NFKC.list ~~ (0x1112F,), '1112F -> 1112F';
ok Uni.new(0x1134B).NFKC.list ~~ (0x1134B,), '1134B -> 1134B';
ok Uni.new(0x1134C).NFKC.list ~~ (0x1134C,), '1134C -> 1134C';
ok Uni.new(0x114BB).NFKC.list ~~ (0x114BB,), '114BB -> 114BB';
ok Uni.new(0x114BC).NFKC.list ~~ (0x114BC,), '114BC -> 114BC';
ok Uni.new(0x114BE).NFKC.list ~~ (0x114BE,), '114BE -> 114BE';
ok Uni.new(0x115BA).NFKC.list ~~ (0x115BA,), '115BA -> 115BA';
ok Uni.new(0x115BB).NFKC.list ~~ (0x115BB,), '115BB -> 115BB';
ok Uni.new(0x1D15E).NFKC.list ~~ (0x1D157, 0x1D165,), '1D15E -> 1D157 1D165';
ok Uni.new(0x1D15F).NFKC.list ~~ (0x1D158, 0x1D165,), '1D15F -> 1D158 1D165';
ok Uni.new(0x1D160).NFKC.list ~~ (0x1D158, 0x1D165, 0x1D16E,), '1D160 -> 1D158 1D165 1D16E';
ok Uni.new(0x1D161).NFKC.list ~~ (0x1D158, 0x1D165, 0x1D16F,), '1D161 -> 1D158 1D165 1D16F';
ok Uni.new(0x1D162).NFKC.list ~~ (0x1D158, 0x1D165, 0x1D170,), '1D162 -> 1D158 1D165 1D170';
ok Uni.new(0x1D163).NFKC.list ~~ (0x1D158, 0x1D165, 0x1D171,), '1D163 -> 1D158 1D165 1D171';
ok Uni.new(0x1D164).NFKC.list ~~ (0x1D158, 0x1D165, 0x1D172,), '1D164 -> 1D158 1D165 1D172';
ok Uni.new(0x1D1BB).NFKC.list ~~ (0x1D1B9, 0x1D165,), '1D1BB -> 1D1B9 1D165';
ok Uni.new(0x1D1BC).NFKC.list ~~ (0x1D1BA, 0x1D165,), '1D1BC -> 1D1BA 1D165';
ok Uni.new(0x1D1BD).NFKC.list ~~ (0x1D1B9, 0x1D165, 0x1D16E,), '1D1BD -> 1D1B9 1D165 1D16E';
ok Uni.new(0x1D1BE).NFKC.list ~~ (0x1D1BA, 0x1D165, 0x1D16E,), '1D1BE -> 1D1BA 1D165 1D16E';
ok Uni.new(0x1D1BF).NFKC.list ~~ (0x1D1B9, 0x1D165, 0x1D16F,), '1D1BF -> 1D1B9 1D165 1D16F';
ok Uni.new(0x1D1C0).NFKC.list ~~ (0x1D1BA, 0x1D165, 0x1D16F,), '1D1C0 -> 1D1BA 1D165 1D16F';
ok Uni.new(0x1D400).NFKC.list ~~ (0x0041,), '1D400 -> 0041';
ok Uni.new(0x1D401).NFKC.list ~~ (0x0042,), '1D401 -> 0042';
ok Uni.new(0x1D402).NFKC.list ~~ (0x0043,), '1D402 -> 0043';
ok Uni.new(0x1D403).NFKC.list ~~ (0x0044,), '1D403 -> 0044';
ok Uni.new(0x1D404).NFKC.list ~~ (0x0045,), '1D404 -> 0045';
ok Uni.new(0x1D405).NFKC.list ~~ (0x0046,), '1D405 -> 0046';
ok Uni.new(0x1D406).NFKC.list ~~ (0x0047,), '1D406 -> 0047';
ok Uni.new(0x1D407).NFKC.list ~~ (0x0048,), '1D407 -> 0048';
ok Uni.new(0x1D408).NFKC.list ~~ (0x0049,), '1D408 -> 0049';
ok Uni.new(0x1D409).NFKC.list ~~ (0x004A,), '1D409 -> 004A';
ok Uni.new(0x1D40A).NFKC.list ~~ (0x004B,), '1D40A -> 004B';
ok Uni.new(0x1D40B).NFKC.list ~~ (0x004C,), '1D40B -> 004C';
ok Uni.new(0x1D40C).NFKC.list ~~ (0x004D,), '1D40C -> 004D';
ok Uni.new(0x1D40D).NFKC.list ~~ (0x004E,), '1D40D -> 004E';
ok Uni.new(0x1D40E).NFKC.list ~~ (0x004F,), '1D40E -> 004F';
ok Uni.new(0x1D40F).NFKC.list ~~ (0x0050,), '1D40F -> 0050';
ok Uni.new(0x1D410).NFKC.list ~~ (0x0051,), '1D410 -> 0051';
ok Uni.new(0x1D411).NFKC.list ~~ (0x0052,), '1D411 -> 0052';
ok Uni.new(0x1D412).NFKC.list ~~ (0x0053,), '1D412 -> 0053';
ok Uni.new(0x1D413).NFKC.list ~~ (0x0054,), '1D413 -> 0054';
ok Uni.new(0x1D414).NFKC.list ~~ (0x0055,), '1D414 -> 0055';
ok Uni.new(0x1D415).NFKC.list ~~ (0x0056,), '1D415 -> 0056';
ok Uni.new(0x1D416).NFKC.list ~~ (0x0057,), '1D416 -> 0057';
ok Uni.new(0x1D417).NFKC.list ~~ (0x0058,), '1D417 -> 0058';
ok Uni.new(0x1D418).NFKC.list ~~ (0x0059,), '1D418 -> 0059';
ok Uni.new(0x1D419).NFKC.list ~~ (0x005A,), '1D419 -> 005A';
ok Uni.new(0x1D41A).NFKC.list ~~ (0x0061,), '1D41A -> 0061';
ok Uni.new(0x1D41B).NFKC.list ~~ (0x0062,), '1D41B -> 0062';
ok Uni.new(0x1D41C).NFKC.list ~~ (0x0063,), '1D41C -> 0063';
ok Uni.new(0x1D41D).NFKC.list ~~ (0x0064,), '1D41D -> 0064';
ok Uni.new(0x1D41E).NFKC.list ~~ (0x0065,), '1D41E -> 0065';
ok Uni.new(0x1D41F).NFKC.list ~~ (0x0066,), '1D41F -> 0066';
ok Uni.new(0x1D420).NFKC.list ~~ (0x0067,), '1D420 -> 0067';
ok Uni.new(0x1D421).NFKC.list ~~ (0x0068,), '1D421 -> 0068';
ok Uni.new(0x1D422).NFKC.list ~~ (0x0069,), '1D422 -> 0069';
ok Uni.new(0x1D423).NFKC.list ~~ (0x006A,), '1D423 -> 006A';
ok Uni.new(0x1D424).NFKC.list ~~ (0x006B,), '1D424 -> 006B';
ok Uni.new(0x1D425).NFKC.list ~~ (0x006C,), '1D425 -> 006C';
ok Uni.new(0x1D426).NFKC.list ~~ (0x006D,), '1D426 -> 006D';
ok Uni.new(0x1D427).NFKC.list ~~ (0x006E,), '1D427 -> 006E';
ok Uni.new(0x1D428).NFKC.list ~~ (0x006F,), '1D428 -> 006F';
ok Uni.new(0x1D429).NFKC.list ~~ (0x0070,), '1D429 -> 0070';
ok Uni.new(0x1D42A).NFKC.list ~~ (0x0071,), '1D42A -> 0071';
ok Uni.new(0x1D42B).NFKC.list ~~ (0x0072,), '1D42B -> 0072';
ok Uni.new(0x1D42C).NFKC.list ~~ (0x0073,), '1D42C -> 0073';
ok Uni.new(0x1D42D).NFKC.list ~~ (0x0074,), '1D42D -> 0074';
ok Uni.new(0x1D42E).NFKC.list ~~ (0x0075,), '1D42E -> 0075';
ok Uni.new(0x1D42F).NFKC.list ~~ (0x0076,), '1D42F -> 0076';
ok Uni.new(0x1D430).NFKC.list ~~ (0x0077,), '1D430 -> 0077';
ok Uni.new(0x1D431).NFKC.list ~~ (0x0078,), '1D431 -> 0078';
ok Uni.new(0x1D432).NFKC.list ~~ (0x0079,), '1D432 -> 0079';
ok Uni.new(0x1D433).NFKC.list ~~ (0x007A,), '1D433 -> 007A';
ok Uni.new(0x1D434).NFKC.list ~~ (0x0041,), '1D434 -> 0041';
ok Uni.new(0x1D435).NFKC.list ~~ (0x0042,), '1D435 -> 0042';
ok Uni.new(0x1D436).NFKC.list ~~ (0x0043,), '1D436 -> 0043';
ok Uni.new(0x1D437).NFKC.list ~~ (0x0044,), '1D437 -> 0044';
ok Uni.new(0x1D438).NFKC.list ~~ (0x0045,), '1D438 -> 0045';
ok Uni.new(0x1D439).NFKC.list ~~ (0x0046,), '1D439 -> 0046';
ok Uni.new(0x1D43A).NFKC.list ~~ (0x0047,), '1D43A -> 0047';
ok Uni.new(0x1D43B).NFKC.list ~~ (0x0048,), '1D43B -> 0048';
ok Uni.new(0x1D43C).NFKC.list ~~ (0x0049,), '1D43C -> 0049';
ok Uni.new(0x1D43D).NFKC.list ~~ (0x004A,), '1D43D -> 004A';
ok Uni.new(0x1D43E).NFKC.list ~~ (0x004B,), '1D43E -> 004B';
ok Uni.new(0x1D43F).NFKC.list ~~ (0x004C,), '1D43F -> 004C';
ok Uni.new(0x1D440).NFKC.list ~~ (0x004D,), '1D440 -> 004D';
ok Uni.new(0x1D441).NFKC.list ~~ (0x004E,), '1D441 -> 004E';
ok Uni.new(0x1D442).NFKC.list ~~ (0x004F,), '1D442 -> 004F';
ok Uni.new(0x1D443).NFKC.list ~~ (0x0050,), '1D443 -> 0050';
ok Uni.new(0x1D444).NFKC.list ~~ (0x0051,), '1D444 -> 0051';
ok Uni.new(0x1D445).NFKC.list ~~ (0x0052,), '1D445 -> 0052';
ok Uni.new(0x1D446).NFKC.list ~~ (0x0053,), '1D446 -> 0053';
ok Uni.new(0x1D447).NFKC.list ~~ (0x0054,), '1D447 -> 0054';
ok Uni.new(0x1D448).NFKC.list ~~ (0x0055,), '1D448 -> 0055';
ok Uni.new(0x1D449).NFKC.list ~~ (0x0056,), '1D449 -> 0056';
ok Uni.new(0x1D44A).NFKC.list ~~ (0x0057,), '1D44A -> 0057';
ok Uni.new(0x1D44B).NFKC.list ~~ (0x0058,), '1D44B -> 0058';
ok Uni.new(0x1D44C).NFKC.list ~~ (0x0059,), '1D44C -> 0059';
ok Uni.new(0x1D44D).NFKC.list ~~ (0x005A,), '1D44D -> 005A';
ok Uni.new(0x1D44E).NFKC.list ~~ (0x0061,), '1D44E -> 0061';
ok Uni.new(0x1D44F).NFKC.list ~~ (0x0062,), '1D44F -> 0062';
ok Uni.new(0x1D450).NFKC.list ~~ (0x0063,), '1D450 -> 0063';
ok Uni.new(0x1D451).NFKC.list ~~ (0x0064,), '1D451 -> 0064';
ok Uni.new(0x1D452).NFKC.list ~~ (0x0065,), '1D452 -> 0065';
ok Uni.new(0x1D453).NFKC.list ~~ (0x0066,), '1D453 -> 0066';
ok Uni.new(0x1D454).NFKC.list ~~ (0x0067,), '1D454 -> 0067';
ok Uni.new(0x1D456).NFKC.list ~~ (0x0069,), '1D456 -> 0069';
ok Uni.new(0x1D457).NFKC.list ~~ (0x006A,), '1D457 -> 006A';
ok Uni.new(0x1D458).NFKC.list ~~ (0x006B,), '1D458 -> 006B';
ok Uni.new(0x1D459).NFKC.list ~~ (0x006C,), '1D459 -> 006C';
ok Uni.new(0x1D45A).NFKC.list ~~ (0x006D,), '1D45A -> 006D';
ok Uni.new(0x1D45B).NFKC.list ~~ (0x006E,), '1D45B -> 006E';
ok Uni.new(0x1D45C).NFKC.list ~~ (0x006F,), '1D45C -> 006F';
ok Uni.new(0x1D45D).NFKC.list ~~ (0x0070,), '1D45D -> 0070';
ok Uni.new(0x1D45E).NFKC.list ~~ (0x0071,), '1D45E -> 0071';
ok Uni.new(0x1D45F).NFKC.list ~~ (0x0072,), '1D45F -> 0072';
ok Uni.new(0x1D460).NFKC.list ~~ (0x0073,), '1D460 -> 0073';
ok Uni.new(0x1D461).NFKC.list ~~ (0x0074,), '1D461 -> 0074';
ok Uni.new(0x1D462).NFKC.list ~~ (0x0075,), '1D462 -> 0075';
ok Uni.new(0x1D463).NFKC.list ~~ (0x0076,), '1D463 -> 0076';
ok Uni.new(0x1D464).NFKC.list ~~ (0x0077,), '1D464 -> 0077';
ok Uni.new(0x1D465).NFKC.list ~~ (0x0078,), '1D465 -> 0078';
ok Uni.new(0x1D466).NFKC.list ~~ (0x0079,), '1D466 -> 0079';
ok Uni.new(0x1D467).NFKC.list ~~ (0x007A,), '1D467 -> 007A';
ok Uni.new(0x1D468).NFKC.list ~~ (0x0041,), '1D468 -> 0041';
ok Uni.new(0x1D469).NFKC.list ~~ (0x0042,), '1D469 -> 0042';
ok Uni.new(0x1D46A).NFKC.list ~~ (0x0043,), '1D46A -> 0043';
ok Uni.new(0x1D46B).NFKC.list ~~ (0x0044,), '1D46B -> 0044';
ok Uni.new(0x1D46C).NFKC.list ~~ (0x0045,), '1D46C -> 0045';
ok Uni.new(0x1D46D).NFKC.list ~~ (0x0046,), '1D46D -> 0046';
ok Uni.new(0x1D46E).NFKC.list ~~ (0x0047,), '1D46E -> 0047';
ok Uni.new(0x1D46F).NFKC.list ~~ (0x0048,), '1D46F -> 0048';
ok Uni.new(0x1D470).NFKC.list ~~ (0x0049,), '1D470 -> 0049';
ok Uni.new(0x1D471).NFKC.list ~~ (0x004A,), '1D471 -> 004A';
ok Uni.new(0x1D472).NFKC.list ~~ (0x004B,), '1D472 -> 004B';
ok Uni.new(0x1D473).NFKC.list ~~ (0x004C,), '1D473 -> 004C';
ok Uni.new(0x1D474).NFKC.list ~~ (0x004D,), '1D474 -> 004D';
ok Uni.new(0x1D475).NFKC.list ~~ (0x004E,), '1D475 -> 004E';
ok Uni.new(0x1D476).NFKC.list ~~ (0x004F,), '1D476 -> 004F';
ok Uni.new(0x1D477).NFKC.list ~~ (0x0050,), '1D477 -> 0050';
ok Uni.new(0x1D478).NFKC.list ~~ (0x0051,), '1D478 -> 0051';
ok Uni.new(0x1D479).NFKC.list ~~ (0x0052,), '1D479 -> 0052';
ok Uni.new(0x1D47A).NFKC.list ~~ (0x0053,), '1D47A -> 0053';
ok Uni.new(0x1D47B).NFKC.list ~~ (0x0054,), '1D47B -> 0054';
ok Uni.new(0x1D47C).NFKC.list ~~ (0x0055,), '1D47C -> 0055';
ok Uni.new(0x1D47D).NFKC.list ~~ (0x0056,), '1D47D -> 0056';
ok Uni.new(0x1D47E).NFKC.list ~~ (0x0057,), '1D47E -> 0057';
ok Uni.new(0x1D47F).NFKC.list ~~ (0x0058,), '1D47F -> 0058';
ok Uni.new(0x1D480).NFKC.list ~~ (0x0059,), '1D480 -> 0059';
ok Uni.new(0x1D481).NFKC.list ~~ (0x005A,), '1D481 -> 005A';
ok Uni.new(0x1D482).NFKC.list ~~ (0x0061,), '1D482 -> 0061';
ok Uni.new(0x1D483).NFKC.list ~~ (0x0062,), '1D483 -> 0062';
ok Uni.new(0x1D484).NFKC.list ~~ (0x0063,), '1D484 -> 0063';
ok Uni.new(0x1D485).NFKC.list ~~ (0x0064,), '1D485 -> 0064';
ok Uni.new(0x1D486).NFKC.list ~~ (0x0065,), '1D486 -> 0065';
ok Uni.new(0x1D487).NFKC.list ~~ (0x0066,), '1D487 -> 0066';
ok Uni.new(0x1D488).NFKC.list ~~ (0x0067,), '1D488 -> 0067';
ok Uni.new(0x1D489).NFKC.list ~~ (0x0068,), '1D489 -> 0068';
ok Uni.new(0x1D48A).NFKC.list ~~ (0x0069,), '1D48A -> 0069';
ok Uni.new(0x1D48B).NFKC.list ~~ (0x006A,), '1D48B -> 006A';
ok Uni.new(0x1D48C).NFKC.list ~~ (0x006B,), '1D48C -> 006B';
ok Uni.new(0x1D48D).NFKC.list ~~ (0x006C,), '1D48D -> 006C';
ok Uni.new(0x1D48E).NFKC.list ~~ (0x006D,), '1D48E -> 006D';
ok Uni.new(0x1D48F).NFKC.list ~~ (0x006E,), '1D48F -> 006E';
ok Uni.new(0x1D490).NFKC.list ~~ (0x006F,), '1D490 -> 006F';
ok Uni.new(0x1D491).NFKC.list ~~ (0x0070,), '1D491 -> 0070';
ok Uni.new(0x1D492).NFKC.list ~~ (0x0071,), '1D492 -> 0071';
ok Uni.new(0x1D493).NFKC.list ~~ (0x0072,), '1D493 -> 0072';
ok Uni.new(0x1D494).NFKC.list ~~ (0x0073,), '1D494 -> 0073';
ok Uni.new(0x1D495).NFKC.list ~~ (0x0074,), '1D495 -> 0074';
ok Uni.new(0x1D496).NFKC.list ~~ (0x0075,), '1D496 -> 0075';
ok Uni.new(0x1D497).NFKC.list ~~ (0x0076,), '1D497 -> 0076';
ok Uni.new(0x1D498).NFKC.list ~~ (0x0077,), '1D498 -> 0077';
ok Uni.new(0x1D499).NFKC.list ~~ (0x0078,), '1D499 -> 0078';
ok Uni.new(0x1D49A).NFKC.list ~~ (0x0079,), '1D49A -> 0079';
ok Uni.new(0x1D49B).NFKC.list ~~ (0x007A,), '1D49B -> 007A';
ok Uni.new(0x1D49C).NFKC.list ~~ (0x0041,), '1D49C -> 0041';
ok Uni.new(0x1D49E).NFKC.list ~~ (0x0043,), '1D49E -> 0043';
ok Uni.new(0x1D49F).NFKC.list ~~ (0x0044,), '1D49F -> 0044';
ok Uni.new(0x1D4A2).NFKC.list ~~ (0x0047,), '1D4A2 -> 0047';
ok Uni.new(0x1D4A5).NFKC.list ~~ (0x004A,), '1D4A5 -> 004A';
ok Uni.new(0x1D4A6).NFKC.list ~~ (0x004B,), '1D4A6 -> 004B';
ok Uni.new(0x1D4A9).NFKC.list ~~ (0x004E,), '1D4A9 -> 004E';
ok Uni.new(0x1D4AA).NFKC.list ~~ (0x004F,), '1D4AA -> 004F';
ok Uni.new(0x1D4AB).NFKC.list ~~ (0x0050,), '1D4AB -> 0050';
ok Uni.new(0x1D4AC).NFKC.list ~~ (0x0051,), '1D4AC -> 0051';
ok Uni.new(0x1D4AE).NFKC.list ~~ (0x0053,), '1D4AE -> 0053';
ok Uni.new(0x1D4AF).NFKC.list ~~ (0x0054,), '1D4AF -> 0054';
ok Uni.new(0x1D4B0).NFKC.list ~~ (0x0055,), '1D4B0 -> 0055';
ok Uni.new(0x1D4B1).NFKC.list ~~ (0x0056,), '1D4B1 -> 0056';
ok Uni.new(0x1D4B2).NFKC.list ~~ (0x0057,), '1D4B2 -> 0057';
ok Uni.new(0x1D4B3).NFKC.list ~~ (0x0058,), '1D4B3 -> 0058';
ok Uni.new(0x1D4B4).NFKC.list ~~ (0x0059,), '1D4B4 -> 0059';
ok Uni.new(0x1D4B5).NFKC.list ~~ (0x005A,), '1D4B5 -> 005A';
ok Uni.new(0x1D4B6).NFKC.list ~~ (0x0061,), '1D4B6 -> 0061';
ok Uni.new(0x1D4B7).NFKC.list ~~ (0x0062,), '1D4B7 -> 0062';
ok Uni.new(0x1D4B8).NFKC.list ~~ (0x0063,), '1D4B8 -> 0063';
ok Uni.new(0x1D4B9).NFKC.list ~~ (0x0064,), '1D4B9 -> 0064';
ok Uni.new(0x1D4BB).NFKC.list ~~ (0x0066,), '1D4BB -> 0066';
ok Uni.new(0x1D4BD).NFKC.list ~~ (0x0068,), '1D4BD -> 0068';
ok Uni.new(0x1D4BE).NFKC.list ~~ (0x0069,), '1D4BE -> 0069';
ok Uni.new(0x1D4BF).NFKC.list ~~ (0x006A,), '1D4BF -> 006A';
ok Uni.new(0x1D4C0).NFKC.list ~~ (0x006B,), '1D4C0 -> 006B';
ok Uni.new(0x1D4C1).NFKC.list ~~ (0x006C,), '1D4C1 -> 006C';
ok Uni.new(0x1D4C2).NFKC.list ~~ (0x006D,), '1D4C2 -> 006D';
ok Uni.new(0x1D4C3).NFKC.list ~~ (0x006E,), '1D4C3 -> 006E';
ok Uni.new(0x1D4C5).NFKC.list ~~ (0x0070,), '1D4C5 -> 0070';
ok Uni.new(0x1D4C6).NFKC.list ~~ (0x0071,), '1D4C6 -> 0071';
ok Uni.new(0x1D4C7).NFKC.list ~~ (0x0072,), '1D4C7 -> 0072';
ok Uni.new(0x1D4C8).NFKC.list ~~ (0x0073,), '1D4C8 -> 0073';
ok Uni.new(0x1D4C9).NFKC.list ~~ (0x0074,), '1D4C9 -> 0074';
ok Uni.new(0x1D4CA).NFKC.list ~~ (0x0075,), '1D4CA -> 0075';
ok Uni.new(0x1D4CB).NFKC.list ~~ (0x0076,), '1D4CB -> 0076';
ok Uni.new(0x1D4CC).NFKC.list ~~ (0x0077,), '1D4CC -> 0077';
ok Uni.new(0x1D4CD).NFKC.list ~~ (0x0078,), '1D4CD -> 0078';
ok Uni.new(0x1D4CE).NFKC.list ~~ (0x0079,), '1D4CE -> 0079';
ok Uni.new(0x1D4CF).NFKC.list ~~ (0x007A,), '1D4CF -> 007A';
ok Uni.new(0x1D4D0).NFKC.list ~~ (0x0041,), '1D4D0 -> 0041';
ok Uni.new(0x1D4D1).NFKC.list ~~ (0x0042,), '1D4D1 -> 0042';
ok Uni.new(0x1D4D2).NFKC.list ~~ (0x0043,), '1D4D2 -> 0043';
ok Uni.new(0x1D4D3).NFKC.list ~~ (0x0044,), '1D4D3 -> 0044';
ok Uni.new(0x1D4D4).NFKC.list ~~ (0x0045,), '1D4D4 -> 0045';
ok Uni.new(0x1D4D5).NFKC.list ~~ (0x0046,), '1D4D5 -> 0046';
ok Uni.new(0x1D4D6).NFKC.list ~~ (0x0047,), '1D4D6 -> 0047';
ok Uni.new(0x1D4D7).NFKC.list ~~ (0x0048,), '1D4D7 -> 0048';
ok Uni.new(0x1D4D8).NFKC.list ~~ (0x0049,), '1D4D8 -> 0049';
ok Uni.new(0x1D4D9).NFKC.list ~~ (0x004A,), '1D4D9 -> 004A';
ok Uni.new(0x1D4DA).NFKC.list ~~ (0x004B,), '1D4DA -> 004B';
ok Uni.new(0x1D4DB).NFKC.list ~~ (0x004C,), '1D4DB -> 004C';
ok Uni.new(0x1D4DC).NFKC.list ~~ (0x004D,), '1D4DC -> 004D';
ok Uni.new(0x1D4DD).NFKC.list ~~ (0x004E,), '1D4DD -> 004E';
ok Uni.new(0x1D4DE).NFKC.list ~~ (0x004F,), '1D4DE -> 004F';
ok Uni.new(0x1D4DF).NFKC.list ~~ (0x0050,), '1D4DF -> 0050';
ok Uni.new(0x1D4E0).NFKC.list ~~ (0x0051,), '1D4E0 -> 0051';
ok Uni.new(0x1D4E1).NFKC.list ~~ (0x0052,), '1D4E1 -> 0052';
ok Uni.new(0x1D4E2).NFKC.list ~~ (0x0053,), '1D4E2 -> 0053';
ok Uni.new(0x1D4E3).NFKC.list ~~ (0x0054,), '1D4E3 -> 0054';
ok Uni.new(0x1D4E4).NFKC.list ~~ (0x0055,), '1D4E4 -> 0055';
ok Uni.new(0x1D4E5).NFKC.list ~~ (0x0056,), '1D4E5 -> 0056';
ok Uni.new(0x1D4E6).NFKC.list ~~ (0x0057,), '1D4E6 -> 0057';
ok Uni.new(0x1D4E7).NFKC.list ~~ (0x0058,), '1D4E7 -> 0058';
ok Uni.new(0x1D4E8).NFKC.list ~~ (0x0059,), '1D4E8 -> 0059';
ok Uni.new(0x1D4E9).NFKC.list ~~ (0x005A,), '1D4E9 -> 005A';
ok Uni.new(0x1D4EA).NFKC.list ~~ (0x0061,), '1D4EA -> 0061';
ok Uni.new(0x1D4EB).NFKC.list ~~ (0x0062,), '1D4EB -> 0062';
ok Uni.new(0x1D4EC).NFKC.list ~~ (0x0063,), '1D4EC -> 0063';
ok Uni.new(0x1D4ED).NFKC.list ~~ (0x0064,), '1D4ED -> 0064';
ok Uni.new(0x1D4EE).NFKC.list ~~ (0x0065,), '1D4EE -> 0065';
ok Uni.new(0x1D4EF).NFKC.list ~~ (0x0066,), '1D4EF -> 0066';
ok Uni.new(0x1D4F0).NFKC.list ~~ (0x0067,), '1D4F0 -> 0067';
ok Uni.new(0x1D4F1).NFKC.list ~~ (0x0068,), '1D4F1 -> 0068';
ok Uni.new(0x1D4F2).NFKC.list ~~ (0x0069,), '1D4F2 -> 0069';
ok Uni.new(0x1D4F3).NFKC.list ~~ (0x006A,), '1D4F3 -> 006A';
ok Uni.new(0x1D4F4).NFKC.list ~~ (0x006B,), '1D4F4 -> 006B';
ok Uni.new(0x1D4F5).NFKC.list ~~ (0x006C,), '1D4F5 -> 006C';
ok Uni.new(0x1D4F6).NFKC.list ~~ (0x006D,), '1D4F6 -> 006D';
ok Uni.new(0x1D4F7).NFKC.list ~~ (0x006E,), '1D4F7 -> 006E';
ok Uni.new(0x1D4F8).NFKC.list ~~ (0x006F,), '1D4F8 -> 006F';
ok Uni.new(0x1D4F9).NFKC.list ~~ (0x0070,), '1D4F9 -> 0070';
ok Uni.new(0x1D4FA).NFKC.list ~~ (0x0071,), '1D4FA -> 0071';
ok Uni.new(0x1D4FB).NFKC.list ~~ (0x0072,), '1D4FB -> 0072';
ok Uni.new(0x1D4FC).NFKC.list ~~ (0x0073,), '1D4FC -> 0073';
ok Uni.new(0x1D4FD).NFKC.list ~~ (0x0074,), '1D4FD -> 0074';
ok Uni.new(0x1D4FE).NFKC.list ~~ (0x0075,), '1D4FE -> 0075';
ok Uni.new(0x1D4FF).NFKC.list ~~ (0x0076,), '1D4FF -> 0076';
ok Uni.new(0x1D500).NFKC.list ~~ (0x0077,), '1D500 -> 0077';
ok Uni.new(0x1D501).NFKC.list ~~ (0x0078,), '1D501 -> 0078';
ok Uni.new(0x1D502).NFKC.list ~~ (0x0079,), '1D502 -> 0079';
ok Uni.new(0x1D503).NFKC.list ~~ (0x007A,), '1D503 -> 007A';
ok Uni.new(0x1D504).NFKC.list ~~ (0x0041,), '1D504 -> 0041';
ok Uni.new(0x1D505).NFKC.list ~~ (0x0042,), '1D505 -> 0042';
ok Uni.new(0x1D507).NFKC.list ~~ (0x0044,), '1D507 -> 0044';
ok Uni.new(0x1D508).NFKC.list ~~ (0x0045,), '1D508 -> 0045';
ok Uni.new(0x1D509).NFKC.list ~~ (0x0046,), '1D509 -> 0046';
ok Uni.new(0x1D50A).NFKC.list ~~ (0x0047,), '1D50A -> 0047';
ok Uni.new(0x1D50D).NFKC.list ~~ (0x004A,), '1D50D -> 004A';
ok Uni.new(0x1D50E).NFKC.list ~~ (0x004B,), '1D50E -> 004B';
ok Uni.new(0x1D50F).NFKC.list ~~ (0x004C,), '1D50F -> 004C';
ok Uni.new(0x1D510).NFKC.list ~~ (0x004D,), '1D510 -> 004D';
ok Uni.new(0x1D511).NFKC.list ~~ (0x004E,), '1D511 -> 004E';
ok Uni.new(0x1D512).NFKC.list ~~ (0x004F,), '1D512 -> 004F';
ok Uni.new(0x1D513).NFKC.list ~~ (0x0050,), '1D513 -> 0050';
ok Uni.new(0x1D514).NFKC.list ~~ (0x0051,), '1D514 -> 0051';
ok Uni.new(0x1D516).NFKC.list ~~ (0x0053,), '1D516 -> 0053';
ok Uni.new(0x1D517).NFKC.list ~~ (0x0054,), '1D517 -> 0054';
ok Uni.new(0x1D518).NFKC.list ~~ (0x0055,), '1D518 -> 0055';
ok Uni.new(0x1D519).NFKC.list ~~ (0x0056,), '1D519 -> 0056';
ok Uni.new(0x1D51A).NFKC.list ~~ (0x0057,), '1D51A -> 0057';
ok Uni.new(0x1D51B).NFKC.list ~~ (0x0058,), '1D51B -> 0058';
ok Uni.new(0x1D51C).NFKC.list ~~ (0x0059,), '1D51C -> 0059';
ok Uni.new(0x1D51E).NFKC.list ~~ (0x0061,), '1D51E -> 0061';
ok Uni.new(0x1D51F).NFKC.list ~~ (0x0062,), '1D51F -> 0062';
ok Uni.new(0x1D520).NFKC.list ~~ (0x0063,), '1D520 -> 0063';
ok Uni.new(0x1D521).NFKC.list ~~ (0x0064,), '1D521 -> 0064';
ok Uni.new(0x1D522).NFKC.list ~~ (0x0065,), '1D522 -> 0065';
ok Uni.new(0x1D523).NFKC.list ~~ (0x0066,), '1D523 -> 0066';
ok Uni.new(0x1D524).NFKC.list ~~ (0x0067,), '1D524 -> 0067';
ok Uni.new(0x1D525).NFKC.list ~~ (0x0068,), '1D525 -> 0068';
ok Uni.new(0x1D526).NFKC.list ~~ (0x0069,), '1D526 -> 0069';
ok Uni.new(0x1D527).NFKC.list ~~ (0x006A,), '1D527 -> 006A';
ok Uni.new(0x1D528).NFKC.list ~~ (0x006B,), '1D528 -> 006B';
ok Uni.new(0x1D529).NFKC.list ~~ (0x006C,), '1D529 -> 006C';
ok Uni.new(0x1D52A).NFKC.list ~~ (0x006D,), '1D52A -> 006D';
ok Uni.new(0x1D52B).NFKC.list ~~ (0x006E,), '1D52B -> 006E';
ok Uni.new(0x1D52C).NFKC.list ~~ (0x006F,), '1D52C -> 006F';
ok Uni.new(0x1D52D).NFKC.list ~~ (0x0070,), '1D52D -> 0070';
ok Uni.new(0x1D52E).NFKC.list ~~ (0x0071,), '1D52E -> 0071';
ok Uni.new(0x1D52F).NFKC.list ~~ (0x0072,), '1D52F -> 0072';
ok Uni.new(0x1D530).NFKC.list ~~ (0x0073,), '1D530 -> 0073';
ok Uni.new(0x1D531).NFKC.list ~~ (0x0074,), '1D531 -> 0074';
ok Uni.new(0x1D532).NFKC.list ~~ (0x0075,), '1D532 -> 0075';
ok Uni.new(0x1D533).NFKC.list ~~ (0x0076,), '1D533 -> 0076';
ok Uni.new(0x1D534).NFKC.list ~~ (0x0077,), '1D534 -> 0077';
ok Uni.new(0x1D535).NFKC.list ~~ (0x0078,), '1D535 -> 0078';
ok Uni.new(0x1D536).NFKC.list ~~ (0x0079,), '1D536 -> 0079';
ok Uni.new(0x1D537).NFKC.list ~~ (0x007A,), '1D537 -> 007A';
ok Uni.new(0x1D538).NFKC.list ~~ (0x0041,), '1D538 -> 0041';
ok Uni.new(0x1D539).NFKC.list ~~ (0x0042,), '1D539 -> 0042';
ok Uni.new(0x1D53B).NFKC.list ~~ (0x0044,), '1D53B -> 0044';
ok Uni.new(0x1D53C).NFKC.list ~~ (0x0045,), '1D53C -> 0045';
ok Uni.new(0x1D53D).NFKC.list ~~ (0x0046,), '1D53D -> 0046';
ok Uni.new(0x1D53E).NFKC.list ~~ (0x0047,), '1D53E -> 0047';
ok Uni.new(0x1D540).NFKC.list ~~ (0x0049,), '1D540 -> 0049';
ok Uni.new(0x1D541).NFKC.list ~~ (0x004A,), '1D541 -> 004A';
ok Uni.new(0x1D542).NFKC.list ~~ (0x004B,), '1D542 -> 004B';
ok Uni.new(0x1D543).NFKC.list ~~ (0x004C,), '1D543 -> 004C';
ok Uni.new(0x1D544).NFKC.list ~~ (0x004D,), '1D544 -> 004D';
ok Uni.new(0x1D546).NFKC.list ~~ (0x004F,), '1D546 -> 004F';
ok Uni.new(0x1D54A).NFKC.list ~~ (0x0053,), '1D54A -> 0053';
ok Uni.new(0x1D54B).NFKC.list ~~ (0x0054,), '1D54B -> 0054';
ok Uni.new(0x1D54C).NFKC.list ~~ (0x0055,), '1D54C -> 0055';
ok Uni.new(0x1D54D).NFKC.list ~~ (0x0056,), '1D54D -> 0056';
ok Uni.new(0x1D54E).NFKC.list ~~ (0x0057,), '1D54E -> 0057';
ok Uni.new(0x1D54F).NFKC.list ~~ (0x0058,), '1D54F -> 0058';
ok Uni.new(0x1D550).NFKC.list ~~ (0x0059,), '1D550 -> 0059';
ok Uni.new(0x1D552).NFKC.list ~~ (0x0061,), '1D552 -> 0061';
ok Uni.new(0x1D553).NFKC.list ~~ (0x0062,), '1D553 -> 0062';
ok Uni.new(0x1D554).NFKC.list ~~ (0x0063,), '1D554 -> 0063';
ok Uni.new(0x1D555).NFKC.list ~~ (0x0064,), '1D555 -> 0064';
ok Uni.new(0x1D556).NFKC.list ~~ (0x0065,), '1D556 -> 0065';
ok Uni.new(0x1D557).NFKC.list ~~ (0x0066,), '1D557 -> 0066';
ok Uni.new(0x1D558).NFKC.list ~~ (0x0067,), '1D558 -> 0067';
ok Uni.new(0x1D559).NFKC.list ~~ (0x0068,), '1D559 -> 0068';
ok Uni.new(0x1D55A).NFKC.list ~~ (0x0069,), '1D55A -> 0069';
ok Uni.new(0x1D55B).NFKC.list ~~ (0x006A,), '1D55B -> 006A';
ok Uni.new(0x1D55C).NFKC.list ~~ (0x006B,), '1D55C -> 006B';
ok Uni.new(0x1D55D).NFKC.list ~~ (0x006C,), '1D55D -> 006C';
ok Uni.new(0x1D55E).NFKC.list ~~ (0x006D,), '1D55E -> 006D';
ok Uni.new(0x1D55F).NFKC.list ~~ (0x006E,), '1D55F -> 006E';
ok Uni.new(0x1D560).NFKC.list ~~ (0x006F,), '1D560 -> 006F';
ok Uni.new(0x1D561).NFKC.list ~~ (0x0070,), '1D561 -> 0070';
ok Uni.new(0x1D562).NFKC.list ~~ (0x0071,), '1D562 -> 0071';
ok Uni.new(0x1D563).NFKC.list ~~ (0x0072,), '1D563 -> 0072';
ok Uni.new(0x1D564).NFKC.list ~~ (0x0073,), '1D564 -> 0073';
ok Uni.new(0x1D565).NFKC.list ~~ (0x0074,), '1D565 -> 0074';
ok Uni.new(0x1D566).NFKC.list ~~ (0x0075,), '1D566 -> 0075';
ok Uni.new(0x1D567).NFKC.list ~~ (0x0076,), '1D567 -> 0076';
ok Uni.new(0x1D568).NFKC.list ~~ (0x0077,), '1D568 -> 0077';
ok Uni.new(0x1D569).NFKC.list ~~ (0x0078,), '1D569 -> 0078';
ok Uni.new(0x1D56A).NFKC.list ~~ (0x0079,), '1D56A -> 0079';
ok Uni.new(0x1D56B).NFKC.list ~~ (0x007A,), '1D56B -> 007A';
ok Uni.new(0x1D56C).NFKC.list ~~ (0x0041,), '1D56C -> 0041';
ok Uni.new(0x1D56D).NFKC.list ~~ (0x0042,), '1D56D -> 0042';
ok Uni.new(0x1D56E).NFKC.list ~~ (0x0043,), '1D56E -> 0043';
ok Uni.new(0x1D56F).NFKC.list ~~ (0x0044,), '1D56F -> 0044';
ok Uni.new(0x1D570).NFKC.list ~~ (0x0045,), '1D570 -> 0045';
ok Uni.new(0x1D571).NFKC.list ~~ (0x0046,), '1D571 -> 0046';
ok Uni.new(0x1D572).NFKC.list ~~ (0x0047,), '1D572 -> 0047';
ok Uni.new(0x1D573).NFKC.list ~~ (0x0048,), '1D573 -> 0048';
ok Uni.new(0x1D574).NFKC.list ~~ (0x0049,), '1D574 -> 0049';
ok Uni.new(0x1D575).NFKC.list ~~ (0x004A,), '1D575 -> 004A';
ok Uni.new(0x1D576).NFKC.list ~~ (0x004B,), '1D576 -> 004B';
ok Uni.new(0x1D577).NFKC.list ~~ (0x004C,), '1D577 -> 004C';
ok Uni.new(0x1D578).NFKC.list ~~ (0x004D,), '1D578 -> 004D';
ok Uni.new(0x1D579).NFKC.list ~~ (0x004E,), '1D579 -> 004E';
ok Uni.new(0x1D57A).NFKC.list ~~ (0x004F,), '1D57A -> 004F';
ok Uni.new(0x1D57B).NFKC.list ~~ (0x0050,), '1D57B -> 0050';
ok Uni.new(0x1D57C).NFKC.list ~~ (0x0051,), '1D57C -> 0051';
ok Uni.new(0x1D57D).NFKC.list ~~ (0x0052,), '1D57D -> 0052';
ok Uni.new(0x1D57E).NFKC.list ~~ (0x0053,), '1D57E -> 0053';
ok Uni.new(0x1D57F).NFKC.list ~~ (0x0054,), '1D57F -> 0054';
ok Uni.new(0x1D580).NFKC.list ~~ (0x0055,), '1D580 -> 0055';
ok Uni.new(0x1D581).NFKC.list ~~ (0x0056,), '1D581 -> 0056';
ok Uni.new(0x1D582).NFKC.list ~~ (0x0057,), '1D582 -> 0057';
ok Uni.new(0x1D583).NFKC.list ~~ (0x0058,), '1D583 -> 0058';
ok Uni.new(0x1D584).NFKC.list ~~ (0x0059,), '1D584 -> 0059';
ok Uni.new(0x1D585).NFKC.list ~~ (0x005A,), '1D585 -> 005A';
ok Uni.new(0x1D586).NFKC.list ~~ (0x0061,), '1D586 -> 0061';
ok Uni.new(0x1D587).NFKC.list ~~ (0x0062,), '1D587 -> 0062';
ok Uni.new(0x1D588).NFKC.list ~~ (0x0063,), '1D588 -> 0063';
ok Uni.new(0x1D589).NFKC.list ~~ (0x0064,), '1D589 -> 0064';
ok Uni.new(0x1D58A).NFKC.list ~~ (0x0065,), '1D58A -> 0065';
ok Uni.new(0x1D58B).NFKC.list ~~ (0x0066,), '1D58B -> 0066';
ok Uni.new(0x1D58C).NFKC.list ~~ (0x0067,), '1D58C -> 0067';
ok Uni.new(0x1D58D).NFKC.list ~~ (0x0068,), '1D58D -> 0068';
ok Uni.new(0x1D58E).NFKC.list ~~ (0x0069,), '1D58E -> 0069';
ok Uni.new(0x1D58F).NFKC.list ~~ (0x006A,), '1D58F -> 006A';
ok Uni.new(0x1D590).NFKC.list ~~ (0x006B,), '1D590 -> 006B';
ok Uni.new(0x1D591).NFKC.list ~~ (0x006C,), '1D591 -> 006C';
ok Uni.new(0x1D592).NFKC.list ~~ (0x006D,), '1D592 -> 006D';
ok Uni.new(0x1D593).NFKC.list ~~ (0x006E,), '1D593 -> 006E';
ok Uni.new(0x1D594).NFKC.list ~~ (0x006F,), '1D594 -> 006F';
ok Uni.new(0x1D595).NFKC.list ~~ (0x0070,), '1D595 -> 0070';
ok Uni.new(0x1D596).NFKC.list ~~ (0x0071,), '1D596 -> 0071';
ok Uni.new(0x1D597).NFKC.list ~~ (0x0072,), '1D597 -> 0072';
ok Uni.new(0x1D598).NFKC.list ~~ (0x0073,), '1D598 -> 0073';
ok Uni.new(0x1D599).NFKC.list ~~ (0x0074,), '1D599 -> 0074';
ok Uni.new(0x1D59A).NFKC.list ~~ (0x0075,), '1D59A -> 0075';
ok Uni.new(0x1D59B).NFKC.list ~~ (0x0076,), '1D59B -> 0076';
ok Uni.new(0x1D59C).NFKC.list ~~ (0x0077,), '1D59C -> 0077';
ok Uni.new(0x1D59D).NFKC.list ~~ (0x0078,), '1D59D -> 0078';
ok Uni.new(0x1D59E).NFKC.list ~~ (0x0079,), '1D59E -> 0079';
ok Uni.new(0x1D59F).NFKC.list ~~ (0x007A,), '1D59F -> 007A';
ok Uni.new(0x1D5A0).NFKC.list ~~ (0x0041,), '1D5A0 -> 0041';
ok Uni.new(0x1D5A1).NFKC.list ~~ (0x0042,), '1D5A1 -> 0042';
ok Uni.new(0x1D5A2).NFKC.list ~~ (0x0043,), '1D5A2 -> 0043';
ok Uni.new(0x1D5A3).NFKC.list ~~ (0x0044,), '1D5A3 -> 0044';
ok Uni.new(0x1D5A4).NFKC.list ~~ (0x0045,), '1D5A4 -> 0045';
ok Uni.new(0x1D5A5).NFKC.list ~~ (0x0046,), '1D5A5 -> 0046';
ok Uni.new(0x1D5A6).NFKC.list ~~ (0x0047,), '1D5A6 -> 0047';
ok Uni.new(0x1D5A7).NFKC.list ~~ (0x0048,), '1D5A7 -> 0048';
ok Uni.new(0x1D5A8).NFKC.list ~~ (0x0049,), '1D5A8 -> 0049';
ok Uni.new(0x1D5A9).NFKC.list ~~ (0x004A,), '1D5A9 -> 004A';
ok Uni.new(0x1D5AA).NFKC.list ~~ (0x004B,), '1D5AA -> 004B';
ok Uni.new(0x1D5AB).NFKC.list ~~ (0x004C,), '1D5AB -> 004C';
ok Uni.new(0x1D5AC).NFKC.list ~~ (0x004D,), '1D5AC -> 004D';
ok Uni.new(0x1D5AD).NFKC.list ~~ (0x004E,), '1D5AD -> 004E';
ok Uni.new(0x1D5AE).NFKC.list ~~ (0x004F,), '1D5AE -> 004F';
ok Uni.new(0x1D5AF).NFKC.list ~~ (0x0050,), '1D5AF -> 0050';
ok Uni.new(0x1D5B0).NFKC.list ~~ (0x0051,), '1D5B0 -> 0051';
ok Uni.new(0x1D5B1).NFKC.list ~~ (0x0052,), '1D5B1 -> 0052';
ok Uni.new(0x1D5B2).NFKC.list ~~ (0x0053,), '1D5B2 -> 0053';
ok Uni.new(0x1D5B3).NFKC.list ~~ (0x0054,), '1D5B3 -> 0054';
ok Uni.new(0x1D5B4).NFKC.list ~~ (0x0055,), '1D5B4 -> 0055';
ok Uni.new(0x1D5B5).NFKC.list ~~ (0x0056,), '1D5B5 -> 0056';
ok Uni.new(0x1D5B6).NFKC.list ~~ (0x0057,), '1D5B6 -> 0057';
ok Uni.new(0x1D5B7).NFKC.list ~~ (0x0058,), '1D5B7 -> 0058';
ok Uni.new(0x1D5B8).NFKC.list ~~ (0x0059,), '1D5B8 -> 0059';
ok Uni.new(0x1D5B9).NFKC.list ~~ (0x005A,), '1D5B9 -> 005A';
ok Uni.new(0x1D5BA).NFKC.list ~~ (0x0061,), '1D5BA -> 0061';
ok Uni.new(0x1D5BB).NFKC.list ~~ (0x0062,), '1D5BB -> 0062';
ok Uni.new(0x1D5BC).NFKC.list ~~ (0x0063,), '1D5BC -> 0063';
ok Uni.new(0x1D5BD).NFKC.list ~~ (0x0064,), '1D5BD -> 0064';
ok Uni.new(0x1D5BE).NFKC.list ~~ (0x0065,), '1D5BE -> 0065';
ok Uni.new(0x1D5BF).NFKC.list ~~ (0x0066,), '1D5BF -> 0066';
ok Uni.new(0x1D5C0).NFKC.list ~~ (0x0067,), '1D5C0 -> 0067';
ok Uni.new(0x1D5C1).NFKC.list ~~ (0x0068,), '1D5C1 -> 0068';
ok Uni.new(0x1D5C2).NFKC.list ~~ (0x0069,), '1D5C2 -> 0069';
ok Uni.new(0x1D5C3).NFKC.list ~~ (0x006A,), '1D5C3 -> 006A';
ok Uni.new(0x1D5C4).NFKC.list ~~ (0x006B,), '1D5C4 -> 006B';
ok Uni.new(0x1D5C5).NFKC.list ~~ (0x006C,), '1D5C5 -> 006C';
ok Uni.new(0x1D5C6).NFKC.list ~~ (0x006D,), '1D5C6 -> 006D';
ok Uni.new(0x1D5C7).NFKC.list ~~ (0x006E,), '1D5C7 -> 006E';
ok Uni.new(0x1D5C8).NFKC.list ~~ (0x006F,), '1D5C8 -> 006F';
ok Uni.new(0x1D5C9).NFKC.list ~~ (0x0070,), '1D5C9 -> 0070';
ok Uni.new(0x1D5CA).NFKC.list ~~ (0x0071,), '1D5CA -> 0071';
ok Uni.new(0x1D5CB).NFKC.list ~~ (0x0072,), '1D5CB -> 0072';
ok Uni.new(0x1D5CC).NFKC.list ~~ (0x0073,), '1D5CC -> 0073';
ok Uni.new(0x1D5CD).NFKC.list ~~ (0x0074,), '1D5CD -> 0074';
ok Uni.new(0x1D5CE).NFKC.list ~~ (0x0075,), '1D5CE -> 0075';
ok Uni.new(0x1D5CF).NFKC.list ~~ (0x0076,), '1D5CF -> 0076';
ok Uni.new(0x1D5D0).NFKC.list ~~ (0x0077,), '1D5D0 -> 0077';
ok Uni.new(0x1D5D1).NFKC.list ~~ (0x0078,), '1D5D1 -> 0078';
ok Uni.new(0x1D5D2).NFKC.list ~~ (0x0079,), '1D5D2 -> 0079';
ok Uni.new(0x1D5D3).NFKC.list ~~ (0x007A,), '1D5D3 -> 007A';
ok Uni.new(0x1D5D4).NFKC.list ~~ (0x0041,), '1D5D4 -> 0041';
ok Uni.new(0x1D5D5).NFKC.list ~~ (0x0042,), '1D5D5 -> 0042';
ok Uni.new(0x1D5D6).NFKC.list ~~ (0x0043,), '1D5D6 -> 0043';
ok Uni.new(0x1D5D7).NFKC.list ~~ (0x0044,), '1D5D7 -> 0044';
ok Uni.new(0x1D5D8).NFKC.list ~~ (0x0045,), '1D5D8 -> 0045';
ok Uni.new(0x1D5D9).NFKC.list ~~ (0x0046,), '1D5D9 -> 0046';
ok Uni.new(0x1D5DA).NFKC.list ~~ (0x0047,), '1D5DA -> 0047';
ok Uni.new(0x1D5DB).NFKC.list ~~ (0x0048,), '1D5DB -> 0048';
ok Uni.new(0x1D5DC).NFKC.list ~~ (0x0049,), '1D5DC -> 0049';
ok Uni.new(0x1D5DD).NFKC.list ~~ (0x004A,), '1D5DD -> 004A';
ok Uni.new(0x1D5DE).NFKC.list ~~ (0x004B,), '1D5DE -> 004B';
ok Uni.new(0x1D5DF).NFKC.list ~~ (0x004C,), '1D5DF -> 004C';
ok Uni.new(0x1D5E0).NFKC.list ~~ (0x004D,), '1D5E0 -> 004D';
ok Uni.new(0x1D5E1).NFKC.list ~~ (0x004E,), '1D5E1 -> 004E';
ok Uni.new(0x1D5E2).NFKC.list ~~ (0x004F,), '1D5E2 -> 004F';
ok Uni.new(0x1D5E3).NFKC.list ~~ (0x0050,), '1D5E3 -> 0050';
ok Uni.new(0x1D5E4).NFKC.list ~~ (0x0051,), '1D5E4 -> 0051';
ok Uni.new(0x1D5E5).NFKC.list ~~ (0x0052,), '1D5E5 -> 0052';
ok Uni.new(0x1D5E6).NFKC.list ~~ (0x0053,), '1D5E6 -> 0053';
ok Uni.new(0x1D5E7).NFKC.list ~~ (0x0054,), '1D5E7 -> 0054';
ok Uni.new(0x1D5E8).NFKC.list ~~ (0x0055,), '1D5E8 -> 0055';
ok Uni.new(0x1D5E9).NFKC.list ~~ (0x0056,), '1D5E9 -> 0056';
ok Uni.new(0x1D5EA).NFKC.list ~~ (0x0057,), '1D5EA -> 0057';
ok Uni.new(0x1D5EB).NFKC.list ~~ (0x0058,), '1D5EB -> 0058';
ok Uni.new(0x1D5EC).NFKC.list ~~ (0x0059,), '1D5EC -> 0059';
ok Uni.new(0x1D5ED).NFKC.list ~~ (0x005A,), '1D5ED -> 005A';
ok Uni.new(0x1D5EE).NFKC.list ~~ (0x0061,), '1D5EE -> 0061';
ok Uni.new(0x1D5EF).NFKC.list ~~ (0x0062,), '1D5EF -> 0062';
ok Uni.new(0x1D5F0).NFKC.list ~~ (0x0063,), '1D5F0 -> 0063';
ok Uni.new(0x1D5F1).NFKC.list ~~ (0x0064,), '1D5F1 -> 0064';
ok Uni.new(0x1D5F2).NFKC.list ~~ (0x0065,), '1D5F2 -> 0065';
ok Uni.new(0x1D5F3).NFKC.list ~~ (0x0066,), '1D5F3 -> 0066';
ok Uni.new(0x1D5F4).NFKC.list ~~ (0x0067,), '1D5F4 -> 0067';
ok Uni.new(0x1D5F5).NFKC.list ~~ (0x0068,), '1D5F5 -> 0068';
ok Uni.new(0x1D5F6).NFKC.list ~~ (0x0069,), '1D5F6 -> 0069';
ok Uni.new(0x1D5F7).NFKC.list ~~ (0x006A,), '1D5F7 -> 006A';
ok Uni.new(0x1D5F8).NFKC.list ~~ (0x006B,), '1D5F8 -> 006B';
ok Uni.new(0x1D5F9).NFKC.list ~~ (0x006C,), '1D5F9 -> 006C';
ok Uni.new(0x1D5FA).NFKC.list ~~ (0x006D,), '1D5FA -> 006D';
ok Uni.new(0x1D5FB).NFKC.list ~~ (0x006E,), '1D5FB -> 006E';
ok Uni.new(0x1D5FC).NFKC.list ~~ (0x006F,), '1D5FC -> 006F';
ok Uni.new(0x1D5FD).NFKC.list ~~ (0x0070,), '1D5FD -> 0070';
ok Uni.new(0x1D5FE).NFKC.list ~~ (0x0071,), '1D5FE -> 0071';
ok Uni.new(0x1D5FF).NFKC.list ~~ (0x0072,), '1D5FF -> 0072';
ok Uni.new(0x1D600).NFKC.list ~~ (0x0073,), '1D600 -> 0073';
ok Uni.new(0x1D601).NFKC.list ~~ (0x0074,), '1D601 -> 0074';
ok Uni.new(0x1D602).NFKC.list ~~ (0x0075,), '1D602 -> 0075';
ok Uni.new(0x1D603).NFKC.list ~~ (0x0076,), '1D603 -> 0076';
ok Uni.new(0x1D604).NFKC.list ~~ (0x0077,), '1D604 -> 0077';
ok Uni.new(0x1D605).NFKC.list ~~ (0x0078,), '1D605 -> 0078';
ok Uni.new(0x1D606).NFKC.list ~~ (0x0079,), '1D606 -> 0079';
ok Uni.new(0x1D607).NFKC.list ~~ (0x007A,), '1D607 -> 007A';
ok Uni.new(0x1D608).NFKC.list ~~ (0x0041,), '1D608 -> 0041';
ok Uni.new(0x1D609).NFKC.list ~~ (0x0042,), '1D609 -> 0042';
ok Uni.new(0x1D60A).NFKC.list ~~ (0x0043,), '1D60A -> 0043';
ok Uni.new(0x1D60B).NFKC.list ~~ (0x0044,), '1D60B -> 0044';
ok Uni.new(0x1D60C).NFKC.list ~~ (0x0045,), '1D60C -> 0045';
ok Uni.new(0x1D60D).NFKC.list ~~ (0x0046,), '1D60D -> 0046';
ok Uni.new(0x1D60E).NFKC.list ~~ (0x0047,), '1D60E -> 0047';
ok Uni.new(0x1D60F).NFKC.list ~~ (0x0048,), '1D60F -> 0048';
ok Uni.new(0x1D610).NFKC.list ~~ (0x0049,), '1D610 -> 0049';
ok Uni.new(0x1D611).NFKC.list ~~ (0x004A,), '1D611 -> 004A';
ok Uni.new(0x1D612).NFKC.list ~~ (0x004B,), '1D612 -> 004B';
ok Uni.new(0x1D613).NFKC.list ~~ (0x004C,), '1D613 -> 004C';
ok Uni.new(0x1D614).NFKC.list ~~ (0x004D,), '1D614 -> 004D';
ok Uni.new(0x1D615).NFKC.list ~~ (0x004E,), '1D615 -> 004E';
ok Uni.new(0x1D616).NFKC.list ~~ (0x004F,), '1D616 -> 004F';
ok Uni.new(0x1D617).NFKC.list ~~ (0x0050,), '1D617 -> 0050';
ok Uni.new(0x1D618).NFKC.list ~~ (0x0051,), '1D618 -> 0051';
ok Uni.new(0x1D619).NFKC.list ~~ (0x0052,), '1D619 -> 0052';
ok Uni.new(0x1D61A).NFKC.list ~~ (0x0053,), '1D61A -> 0053';
ok Uni.new(0x1D61B).NFKC.list ~~ (0x0054,), '1D61B -> 0054';
ok Uni.new(0x1D61C).NFKC.list ~~ (0x0055,), '1D61C -> 0055';
ok Uni.new(0x1D61D).NFKC.list ~~ (0x0056,), '1D61D -> 0056';
ok Uni.new(0x1D61E).NFKC.list ~~ (0x0057,), '1D61E -> 0057';
ok Uni.new(0x1D61F).NFKC.list ~~ (0x0058,), '1D61F -> 0058';
ok Uni.new(0x1D620).NFKC.list ~~ (0x0059,), '1D620 -> 0059';
ok Uni.new(0x1D621).NFKC.list ~~ (0x005A,), '1D621 -> 005A';
ok Uni.new(0x1D622).NFKC.list ~~ (0x0061,), '1D622 -> 0061';
ok Uni.new(0x1D623).NFKC.list ~~ (0x0062,), '1D623 -> 0062';
ok Uni.new(0x1D624).NFKC.list ~~ (0x0063,), '1D624 -> 0063';
ok Uni.new(0x1D625).NFKC.list ~~ (0x0064,), '1D625 -> 0064';
ok Uni.new(0x1D626).NFKC.list ~~ (0x0065,), '1D626 -> 0065';
ok Uni.new(0x1D627).NFKC.list ~~ (0x0066,), '1D627 -> 0066';
ok Uni.new(0x1D628).NFKC.list ~~ (0x0067,), '1D628 -> 0067';
ok Uni.new(0x1D629).NFKC.list ~~ (0x0068,), '1D629 -> 0068';
ok Uni.new(0x1D62A).NFKC.list ~~ (0x0069,), '1D62A -> 0069';
ok Uni.new(0x1D62B).NFKC.list ~~ (0x006A,), '1D62B -> 006A';
ok Uni.new(0x1D62C).NFKC.list ~~ (0x006B,), '1D62C -> 006B';
ok Uni.new(0x1D62D).NFKC.list ~~ (0x006C,), '1D62D -> 006C';
ok Uni.new(0x1D62E).NFKC.list ~~ (0x006D,), '1D62E -> 006D';
ok Uni.new(0x1D62F).NFKC.list ~~ (0x006E,), '1D62F -> 006E';
ok Uni.new(0x1D630).NFKC.list ~~ (0x006F,), '1D630 -> 006F';
ok Uni.new(0x1D631).NFKC.list ~~ (0x0070,), '1D631 -> 0070';
ok Uni.new(0x1D632).NFKC.list ~~ (0x0071,), '1D632 -> 0071';
ok Uni.new(0x1D633).NFKC.list ~~ (0x0072,), '1D633 -> 0072';
ok Uni.new(0x1D634).NFKC.list ~~ (0x0073,), '1D634 -> 0073';
ok Uni.new(0x1D635).NFKC.list ~~ (0x0074,), '1D635 -> 0074';
ok Uni.new(0x1D636).NFKC.list ~~ (0x0075,), '1D636 -> 0075';
ok Uni.new(0x1D637).NFKC.list ~~ (0x0076,), '1D637 -> 0076';
ok Uni.new(0x1D638).NFKC.list ~~ (0x0077,), '1D638 -> 0077';
ok Uni.new(0x1D639).NFKC.list ~~ (0x0078,), '1D639 -> 0078';
ok Uni.new(0x1D63A).NFKC.list ~~ (0x0079,), '1D63A -> 0079';
ok Uni.new(0x1D63B).NFKC.list ~~ (0x007A,), '1D63B -> 007A';
ok Uni.new(0x1D63C).NFKC.list ~~ (0x0041,), '1D63C -> 0041';
ok Uni.new(0x1D63D).NFKC.list ~~ (0x0042,), '1D63D -> 0042';
ok Uni.new(0x1D63E).NFKC.list ~~ (0x0043,), '1D63E -> 0043';
ok Uni.new(0x1D63F).NFKC.list ~~ (0x0044,), '1D63F -> 0044';
ok Uni.new(0x1D640).NFKC.list ~~ (0x0045,), '1D640 -> 0045';
ok Uni.new(0x1D641).NFKC.list ~~ (0x0046,), '1D641 -> 0046';
ok Uni.new(0x1D642).NFKC.list ~~ (0x0047,), '1D642 -> 0047';
ok Uni.new(0x1D643).NFKC.list ~~ (0x0048,), '1D643 -> 0048';
ok Uni.new(0x1D644).NFKC.list ~~ (0x0049,), '1D644 -> 0049';
ok Uni.new(0x1D645).NFKC.list ~~ (0x004A,), '1D645 -> 004A';
ok Uni.new(0x1D646).NFKC.list ~~ (0x004B,), '1D646 -> 004B';
ok Uni.new(0x1D647).NFKC.list ~~ (0x004C,), '1D647 -> 004C';
ok Uni.new(0x1D648).NFKC.list ~~ (0x004D,), '1D648 -> 004D';
ok Uni.new(0x1D649).NFKC.list ~~ (0x004E,), '1D649 -> 004E';
ok Uni.new(0x1D64A).NFKC.list ~~ (0x004F,), '1D64A -> 004F';
ok Uni.new(0x1D64B).NFKC.list ~~ (0x0050,), '1D64B -> 0050';
ok Uni.new(0x1D64C).NFKC.list ~~ (0x0051,), '1D64C -> 0051';
ok Uni.new(0x1D64D).NFKC.list ~~ (0x0052,), '1D64D -> 0052';
ok Uni.new(0x1D64E).NFKC.list ~~ (0x0053,), '1D64E -> 0053';
ok Uni.new(0x1D64F).NFKC.list ~~ (0x0054,), '1D64F -> 0054';
ok Uni.new(0x1D650).NFKC.list ~~ (0x0055,), '1D650 -> 0055';
ok Uni.new(0x1D651).NFKC.list ~~ (0x0056,), '1D651 -> 0056';
ok Uni.new(0x1D652).NFKC.list ~~ (0x0057,), '1D652 -> 0057';
ok Uni.new(0x1D653).NFKC.list ~~ (0x0058,), '1D653 -> 0058';
ok Uni.new(0x1D654).NFKC.list ~~ (0x0059,), '1D654 -> 0059';
ok Uni.new(0x1D655).NFKC.list ~~ (0x005A,), '1D655 -> 005A';
ok Uni.new(0x1D656).NFKC.list ~~ (0x0061,), '1D656 -> 0061';
ok Uni.new(0x1D657).NFKC.list ~~ (0x0062,), '1D657 -> 0062';
ok Uni.new(0x1D658).NFKC.list ~~ (0x0063,), '1D658 -> 0063';
ok Uni.new(0x1D659).NFKC.list ~~ (0x0064,), '1D659 -> 0064';
ok Uni.new(0x1D65A).NFKC.list ~~ (0x0065,), '1D65A -> 0065';
ok Uni.new(0x1D65B).NFKC.list ~~ (0x0066,), '1D65B -> 0066';
ok Uni.new(0x1D65C).NFKC.list ~~ (0x0067,), '1D65C -> 0067';
ok Uni.new(0x1D65D).NFKC.list ~~ (0x0068,), '1D65D -> 0068';
ok Uni.new(0x1D65E).NFKC.list ~~ (0x0069,), '1D65E -> 0069';
ok Uni.new(0x1D65F).NFKC.list ~~ (0x006A,), '1D65F -> 006A';
ok Uni.new(0x1D660).NFKC.list ~~ (0x006B,), '1D660 -> 006B';
ok Uni.new(0x1D661).NFKC.list ~~ (0x006C,), '1D661 -> 006C';
ok Uni.new(0x1D662).NFKC.list ~~ (0x006D,), '1D662 -> 006D';
ok Uni.new(0x1D663).NFKC.list ~~ (0x006E,), '1D663 -> 006E';
ok Uni.new(0x1D664).NFKC.list ~~ (0x006F,), '1D664 -> 006F';
ok Uni.new(0x1D665).NFKC.list ~~ (0x0070,), '1D665 -> 0070';
ok Uni.new(0x1D666).NFKC.list ~~ (0x0071,), '1D666 -> 0071';
ok Uni.new(0x1D667).NFKC.list ~~ (0x0072,), '1D667 -> 0072';
ok Uni.new(0x1D668).NFKC.list ~~ (0x0073,), '1D668 -> 0073';
ok Uni.new(0x1D669).NFKC.list ~~ (0x0074,), '1D669 -> 0074';
ok Uni.new(0x1D66A).NFKC.list ~~ (0x0075,), '1D66A -> 0075';
ok Uni.new(0x1D66B).NFKC.list ~~ (0x0076,), '1D66B -> 0076';
ok Uni.new(0x1D66C).NFKC.list ~~ (0x0077,), '1D66C -> 0077';
ok Uni.new(0x1D66D).NFKC.list ~~ (0x0078,), '1D66D -> 0078';
ok Uni.new(0x1D66E).NFKC.list ~~ (0x0079,), '1D66E -> 0079';
ok Uni.new(0x1D66F).NFKC.list ~~ (0x007A,), '1D66F -> 007A';
ok Uni.new(0x1D670).NFKC.list ~~ (0x0041,), '1D670 -> 0041';
ok Uni.new(0x1D671).NFKC.list ~~ (0x0042,), '1D671 -> 0042';
ok Uni.new(0x1D672).NFKC.list ~~ (0x0043,), '1D672 -> 0043';
ok Uni.new(0x1D673).NFKC.list ~~ (0x0044,), '1D673 -> 0044';
ok Uni.new(0x1D674).NFKC.list ~~ (0x0045,), '1D674 -> 0045';
ok Uni.new(0x1D675).NFKC.list ~~ (0x0046,), '1D675 -> 0046';
ok Uni.new(0x1D676).NFKC.list ~~ (0x0047,), '1D676 -> 0047';
ok Uni.new(0x1D677).NFKC.list ~~ (0x0048,), '1D677 -> 0048';
ok Uni.new(0x1D678).NFKC.list ~~ (0x0049,), '1D678 -> 0049';
ok Uni.new(0x1D679).NFKC.list ~~ (0x004A,), '1D679 -> 004A';
ok Uni.new(0x1D67A).NFKC.list ~~ (0x004B,), '1D67A -> 004B';
ok Uni.new(0x1D67B).NFKC.list ~~ (0x004C,), '1D67B -> 004C';
ok Uni.new(0x1D67C).NFKC.list ~~ (0x004D,), '1D67C -> 004D';
ok Uni.new(0x1D67D).NFKC.list ~~ (0x004E,), '1D67D -> 004E';
ok Uni.new(0x1D67E).NFKC.list ~~ (0x004F,), '1D67E -> 004F';
ok Uni.new(0x1D67F).NFKC.list ~~ (0x0050,), '1D67F -> 0050';
ok Uni.new(0x1D680).NFKC.list ~~ (0x0051,), '1D680 -> 0051';
ok Uni.new(0x1D681).NFKC.list ~~ (0x0052,), '1D681 -> 0052';
ok Uni.new(0x1D682).NFKC.list ~~ (0x0053,), '1D682 -> 0053';
ok Uni.new(0x1D683).NFKC.list ~~ (0x0054,), '1D683 -> 0054';
ok Uni.new(0x1D684).NFKC.list ~~ (0x0055,), '1D684 -> 0055';
ok Uni.new(0x1D685).NFKC.list ~~ (0x0056,), '1D685 -> 0056';
ok Uni.new(0x1D686).NFKC.list ~~ (0x0057,), '1D686 -> 0057';
ok Uni.new(0x1D687).NFKC.list ~~ (0x0058,), '1D687 -> 0058';
ok Uni.new(0x1D688).NFKC.list ~~ (0x0059,), '1D688 -> 0059';
ok Uni.new(0x1D689).NFKC.list ~~ (0x005A,), '1D689 -> 005A';
ok Uni.new(0x1D68A).NFKC.list ~~ (0x0061,), '1D68A -> 0061';
ok Uni.new(0x1D68B).NFKC.list ~~ (0x0062,), '1D68B -> 0062';
ok Uni.new(0x1D68C).NFKC.list ~~ (0x0063,), '1D68C -> 0063';
ok Uni.new(0x1D68D).NFKC.list ~~ (0x0064,), '1D68D -> 0064';
ok Uni.new(0x1D68E).NFKC.list ~~ (0x0065,), '1D68E -> 0065';
ok Uni.new(0x1D68F).NFKC.list ~~ (0x0066,), '1D68F -> 0066';
ok Uni.new(0x1D690).NFKC.list ~~ (0x0067,), '1D690 -> 0067';
ok Uni.new(0x1D691).NFKC.list ~~ (0x0068,), '1D691 -> 0068';
ok Uni.new(0x1D692).NFKC.list ~~ (0x0069,), '1D692 -> 0069';
ok Uni.new(0x1D693).NFKC.list ~~ (0x006A,), '1D693 -> 006A';
ok Uni.new(0x1D694).NFKC.list ~~ (0x006B,), '1D694 -> 006B';
ok Uni.new(0x1D695).NFKC.list ~~ (0x006C,), '1D695 -> 006C';
ok Uni.new(0x1D696).NFKC.list ~~ (0x006D,), '1D696 -> 006D';
ok Uni.new(0x1D697).NFKC.list ~~ (0x006E,), '1D697 -> 006E';
ok Uni.new(0x1D698).NFKC.list ~~ (0x006F,), '1D698 -> 006F';
ok Uni.new(0x1D699).NFKC.list ~~ (0x0070,), '1D699 -> 0070';
ok Uni.new(0x1D69A).NFKC.list ~~ (0x0071,), '1D69A -> 0071';
ok Uni.new(0x1D69B).NFKC.list ~~ (0x0072,), '1D69B -> 0072';
ok Uni.new(0x1D69C).NFKC.list ~~ (0x0073,), '1D69C -> 0073';
ok Uni.new(0x1D69D).NFKC.list ~~ (0x0074,), '1D69D -> 0074';
ok Uni.new(0x1D69E).NFKC.list ~~ (0x0075,), '1D69E -> 0075';
ok Uni.new(0x1D69F).NFKC.list ~~ (0x0076,), '1D69F -> 0076';
ok Uni.new(0x1D6A0).NFKC.list ~~ (0x0077,), '1D6A0 -> 0077';
ok Uni.new(0x1D6A1).NFKC.list ~~ (0x0078,), '1D6A1 -> 0078';
ok Uni.new(0x1D6A2).NFKC.list ~~ (0x0079,), '1D6A2 -> 0079';
ok Uni.new(0x1D6A3).NFKC.list ~~ (0x007A,), '1D6A3 -> 007A';
ok Uni.new(0x1D6A4).NFKC.list ~~ (0x0131,), '1D6A4 -> 0131';
ok Uni.new(0x1D6A5).NFKC.list ~~ (0x0237,), '1D6A5 -> 0237';
ok Uni.new(0x1D6A8).NFKC.list ~~ (0x0391,), '1D6A8 -> 0391';
ok Uni.new(0x1D6A9).NFKC.list ~~ (0x0392,), '1D6A9 -> 0392';
ok Uni.new(0x1D6AA).NFKC.list ~~ (0x0393,), '1D6AA -> 0393';
ok Uni.new(0x1D6AB).NFKC.list ~~ (0x0394,), '1D6AB -> 0394';
ok Uni.new(0x1D6AC).NFKC.list ~~ (0x0395,), '1D6AC -> 0395';
ok Uni.new(0x1D6AD).NFKC.list ~~ (0x0396,), '1D6AD -> 0396';
ok Uni.new(0x1D6AE).NFKC.list ~~ (0x0397,), '1D6AE -> 0397';
ok Uni.new(0x1D6AF).NFKC.list ~~ (0x0398,), '1D6AF -> 0398';
ok Uni.new(0x1D6B0).NFKC.list ~~ (0x0399,), '1D6B0 -> 0399';
ok Uni.new(0x1D6B1).NFKC.list ~~ (0x039A,), '1D6B1 -> 039A';
ok Uni.new(0x1D6B2).NFKC.list ~~ (0x039B,), '1D6B2 -> 039B';
ok Uni.new(0x1D6B3).NFKC.list ~~ (0x039C,), '1D6B3 -> 039C';
ok Uni.new(0x1D6B4).NFKC.list ~~ (0x039D,), '1D6B4 -> 039D';
ok Uni.new(0x1D6B5).NFKC.list ~~ (0x039E,), '1D6B5 -> 039E';
ok Uni.new(0x1D6B6).NFKC.list ~~ (0x039F,), '1D6B6 -> 039F';
ok Uni.new(0x1D6B7).NFKC.list ~~ (0x03A0,), '1D6B7 -> 03A0';
ok Uni.new(0x1D6B8).NFKC.list ~~ (0x03A1,), '1D6B8 -> 03A1';
ok Uni.new(0x1D6B9).NFKC.list ~~ (0x0398,), '1D6B9 -> 0398';
ok Uni.new(0x1D6BA).NFKC.list ~~ (0x03A3,), '1D6BA -> 03A3';
ok Uni.new(0x1D6BB).NFKC.list ~~ (0x03A4,), '1D6BB -> 03A4';
ok Uni.new(0x1D6BC).NFKC.list ~~ (0x03A5,), '1D6BC -> 03A5';
ok Uni.new(0x1D6BD).NFKC.list ~~ (0x03A6,), '1D6BD -> 03A6';
ok Uni.new(0x1D6BE).NFKC.list ~~ (0x03A7,), '1D6BE -> 03A7';
ok Uni.new(0x1D6BF).NFKC.list ~~ (0x03A8,), '1D6BF -> 03A8';
ok Uni.new(0x1D6C0).NFKC.list ~~ (0x03A9,), '1D6C0 -> 03A9';
ok Uni.new(0x1D6C1).NFKC.list ~~ (0x2207,), '1D6C1 -> 2207';
ok Uni.new(0x1D6C2).NFKC.list ~~ (0x03B1,), '1D6C2 -> 03B1';
ok Uni.new(0x1D6C3).NFKC.list ~~ (0x03B2,), '1D6C3 -> 03B2';
ok Uni.new(0x1D6C4).NFKC.list ~~ (0x03B3,), '1D6C4 -> 03B3';
ok Uni.new(0x1D6C5).NFKC.list ~~ (0x03B4,), '1D6C5 -> 03B4';
ok Uni.new(0x1D6C6).NFKC.list ~~ (0x03B5,), '1D6C6 -> 03B5';
ok Uni.new(0x1D6C7).NFKC.list ~~ (0x03B6,), '1D6C7 -> 03B6';
ok Uni.new(0x1D6C8).NFKC.list ~~ (0x03B7,), '1D6C8 -> 03B7';
ok Uni.new(0x1D6C9).NFKC.list ~~ (0x03B8,), '1D6C9 -> 03B8';
ok Uni.new(0x1D6CA).NFKC.list ~~ (0x03B9,), '1D6CA -> 03B9';
ok Uni.new(0x1D6CB).NFKC.list ~~ (0x03BA,), '1D6CB -> 03BA';
ok Uni.new(0x1D6CC).NFKC.list ~~ (0x03BB,), '1D6CC -> 03BB';
ok Uni.new(0x1D6CD).NFKC.list ~~ (0x03BC,), '1D6CD -> 03BC';
ok Uni.new(0x1D6CE).NFKC.list ~~ (0x03BD,), '1D6CE -> 03BD';
ok Uni.new(0x1D6CF).NFKC.list ~~ (0x03BE,), '1D6CF -> 03BE';
ok Uni.new(0x1D6D0).NFKC.list ~~ (0x03BF,), '1D6D0 -> 03BF';
ok Uni.new(0x1D6D1).NFKC.list ~~ (0x03C0,), '1D6D1 -> 03C0';
ok Uni.new(0x1D6D2).NFKC.list ~~ (0x03C1,), '1D6D2 -> 03C1';
ok Uni.new(0x1D6D3).NFKC.list ~~ (0x03C2,), '1D6D3 -> 03C2';
ok Uni.new(0x1D6D4).NFKC.list ~~ (0x03C3,), '1D6D4 -> 03C3';
ok Uni.new(0x1D6D5).NFKC.list ~~ (0x03C4,), '1D6D5 -> 03C4';
ok Uni.new(0x1D6D6).NFKC.list ~~ (0x03C5,), '1D6D6 -> 03C5';
ok Uni.new(0x1D6D7).NFKC.list ~~ (0x03C6,), '1D6D7 -> 03C6';
ok Uni.new(0x1D6D8).NFKC.list ~~ (0x03C7,), '1D6D8 -> 03C7';
ok Uni.new(0x1D6D9).NFKC.list ~~ (0x03C8,), '1D6D9 -> 03C8';
ok Uni.new(0x1D6DA).NFKC.list ~~ (0x03C9,), '1D6DA -> 03C9';
ok Uni.new(0x1D6DB).NFKC.list ~~ (0x2202,), '1D6DB -> 2202';
ok Uni.new(0x1D6DC).NFKC.list ~~ (0x03B5,), '1D6DC -> 03B5';
ok Uni.new(0x1D6DD).NFKC.list ~~ (0x03B8,), '1D6DD -> 03B8';
ok Uni.new(0x1D6DE).NFKC.list ~~ (0x03BA,), '1D6DE -> 03BA';
ok Uni.new(0x1D6DF).NFKC.list ~~ (0x03C6,), '1D6DF -> 03C6';
ok Uni.new(0x1D6E0).NFKC.list ~~ (0x03C1,), '1D6E0 -> 03C1';
ok Uni.new(0x1D6E1).NFKC.list ~~ (0x03C0,), '1D6E1 -> 03C0';
ok Uni.new(0x1D6E2).NFKC.list ~~ (0x0391,), '1D6E2 -> 0391';
ok Uni.new(0x1D6E3).NFKC.list ~~ (0x0392,), '1D6E3 -> 0392';
ok Uni.new(0x1D6E4).NFKC.list ~~ (0x0393,), '1D6E4 -> 0393';
ok Uni.new(0x1D6E5).NFKC.list ~~ (0x0394,), '1D6E5 -> 0394';
ok Uni.new(0x1D6E6).NFKC.list ~~ (0x0395,), '1D6E6 -> 0395';
ok Uni.new(0x1D6E7).NFKC.list ~~ (0x0396,), '1D6E7 -> 0396';
ok Uni.new(0x1D6E8).NFKC.list ~~ (0x0397,), '1D6E8 -> 0397';
ok Uni.new(0x1D6E9).NFKC.list ~~ (0x0398,), '1D6E9 -> 0398';
ok Uni.new(0x1D6EA).NFKC.list ~~ (0x0399,), '1D6EA -> 0399';
ok Uni.new(0x1D6EB).NFKC.list ~~ (0x039A,), '1D6EB -> 039A';
ok Uni.new(0x1D6EC).NFKC.list ~~ (0x039B,), '1D6EC -> 039B';
ok Uni.new(0x1D6ED).NFKC.list ~~ (0x039C,), '1D6ED -> 039C';
ok Uni.new(0x1D6EE).NFKC.list ~~ (0x039D,), '1D6EE -> 039D';
ok Uni.new(0x1D6EF).NFKC.list ~~ (0x039E,), '1D6EF -> 039E';
ok Uni.new(0x1D6F0).NFKC.list ~~ (0x039F,), '1D6F0 -> 039F';
ok Uni.new(0x1D6F1).NFKC.list ~~ (0x03A0,), '1D6F1 -> 03A0';
ok Uni.new(0x1D6F2).NFKC.list ~~ (0x03A1,), '1D6F2 -> 03A1';
ok Uni.new(0x1D6F3).NFKC.list ~~ (0x0398,), '1D6F3 -> 0398';
ok Uni.new(0x1D6F4).NFKC.list ~~ (0x03A3,), '1D6F4 -> 03A3';
ok Uni.new(0x1D6F5).NFKC.list ~~ (0x03A4,), '1D6F5 -> 03A4';
ok Uni.new(0x1D6F6).NFKC.list ~~ (0x03A5,), '1D6F6 -> 03A5';
ok Uni.new(0x1D6F7).NFKC.list ~~ (0x03A6,), '1D6F7 -> 03A6';
ok Uni.new(0x1D6F8).NFKC.list ~~ (0x03A7,), '1D6F8 -> 03A7';
ok Uni.new(0x1D6F9).NFKC.list ~~ (0x03A8,), '1D6F9 -> 03A8';
ok Uni.new(0x1D6FA).NFKC.list ~~ (0x03A9,), '1D6FA -> 03A9';
ok Uni.new(0x1D6FB).NFKC.list ~~ (0x2207,), '1D6FB -> 2207';
ok Uni.new(0x1D6FC).NFKC.list ~~ (0x03B1,), '1D6FC -> 03B1';
ok Uni.new(0x1D6FD).NFKC.list ~~ (0x03B2,), '1D6FD -> 03B2';
ok Uni.new(0x1D6FE).NFKC.list ~~ (0x03B3,), '1D6FE -> 03B3';
ok Uni.new(0x1D6FF).NFKC.list ~~ (0x03B4,), '1D6FF -> 03B4';
ok Uni.new(0x1D700).NFKC.list ~~ (0x03B5,), '1D700 -> 03B5';
ok Uni.new(0x1D701).NFKC.list ~~ (0x03B6,), '1D701 -> 03B6';
ok Uni.new(0x1D702).NFKC.list ~~ (0x03B7,), '1D702 -> 03B7';
ok Uni.new(0x1D703).NFKC.list ~~ (0x03B8,), '1D703 -> 03B8';
ok Uni.new(0x1D704).NFKC.list ~~ (0x03B9,), '1D704 -> 03B9';
ok Uni.new(0x1D705).NFKC.list ~~ (0x03BA,), '1D705 -> 03BA';
ok Uni.new(0x1D706).NFKC.list ~~ (0x03BB,), '1D706 -> 03BB';
ok Uni.new(0x1D707).NFKC.list ~~ (0x03BC,), '1D707 -> 03BC';
ok Uni.new(0x1D708).NFKC.list ~~ (0x03BD,), '1D708 -> 03BD';
ok Uni.new(0x1D709).NFKC.list ~~ (0x03BE,), '1D709 -> 03BE';
ok Uni.new(0x1D70A).NFKC.list ~~ (0x03BF,), '1D70A -> 03BF';
ok Uni.new(0x1D70B).NFKC.list ~~ (0x03C0,), '1D70B -> 03C0';
ok Uni.new(0x1D70C).NFKC.list ~~ (0x03C1,), '1D70C -> 03C1';
ok Uni.new(0x1D70D).NFKC.list ~~ (0x03C2,), '1D70D -> 03C2';
ok Uni.new(0x1D70E).NFKC.list ~~ (0x03C3,), '1D70E -> 03C3';
ok Uni.new(0x1D70F).NFKC.list ~~ (0x03C4,), '1D70F -> 03C4';
ok Uni.new(0x1D710).NFKC.list ~~ (0x03C5,), '1D710 -> 03C5';
ok Uni.new(0x1D711).NFKC.list ~~ (0x03C6,), '1D711 -> 03C6';
ok Uni.new(0x1D712).NFKC.list ~~ (0x03C7,), '1D712 -> 03C7';
ok Uni.new(0x1D713).NFKC.list ~~ (0x03C8,), '1D713 -> 03C8';
ok Uni.new(0x1D714).NFKC.list ~~ (0x03C9,), '1D714 -> 03C9';
ok Uni.new(0x1D715).NFKC.list ~~ (0x2202,), '1D715 -> 2202';
ok Uni.new(0x1D716).NFKC.list ~~ (0x03B5,), '1D716 -> 03B5';
ok Uni.new(0x1D717).NFKC.list ~~ (0x03B8,), '1D717 -> 03B8';
ok Uni.new(0x1D718).NFKC.list ~~ (0x03BA,), '1D718 -> 03BA';
ok Uni.new(0x1D719).NFKC.list ~~ (0x03C6,), '1D719 -> 03C6';
ok Uni.new(0x1D71A).NFKC.list ~~ (0x03C1,), '1D71A -> 03C1';
ok Uni.new(0x1D71B).NFKC.list ~~ (0x03C0,), '1D71B -> 03C0';
ok Uni.new(0x1D71C).NFKC.list ~~ (0x0391,), '1D71C -> 0391';
ok Uni.new(0x1D71D).NFKC.list ~~ (0x0392,), '1D71D -> 0392';
ok Uni.new(0x1D71E).NFKC.list ~~ (0x0393,), '1D71E -> 0393';
ok Uni.new(0x1D71F).NFKC.list ~~ (0x0394,), '1D71F -> 0394';
ok Uni.new(0x1D720).NFKC.list ~~ (0x0395,), '1D720 -> 0395';
ok Uni.new(0x1D721).NFKC.list ~~ (0x0396,), '1D721 -> 0396';
ok Uni.new(0x1D722).NFKC.list ~~ (0x0397,), '1D722 -> 0397';
ok Uni.new(0x1D723).NFKC.list ~~ (0x0398,), '1D723 -> 0398';
ok Uni.new(0x1D724).NFKC.list ~~ (0x0399,), '1D724 -> 0399';
ok Uni.new(0x1D725).NFKC.list ~~ (0x039A,), '1D725 -> 039A';
ok Uni.new(0x1D726).NFKC.list ~~ (0x039B,), '1D726 -> 039B';
ok Uni.new(0x1D727).NFKC.list ~~ (0x039C,), '1D727 -> 039C';
ok Uni.new(0x1D728).NFKC.list ~~ (0x039D,), '1D728 -> 039D';
ok Uni.new(0x1D729).NFKC.list ~~ (0x039E,), '1D729 -> 039E';
ok Uni.new(0x1D72A).NFKC.list ~~ (0x039F,), '1D72A -> 039F';
ok Uni.new(0x1D72B).NFKC.list ~~ (0x03A0,), '1D72B -> 03A0';
ok Uni.new(0x1D72C).NFKC.list ~~ (0x03A1,), '1D72C -> 03A1';
ok Uni.new(0x1D72D).NFKC.list ~~ (0x0398,), '1D72D -> 0398';
ok Uni.new(0x1D72E).NFKC.list ~~ (0x03A3,), '1D72E -> 03A3';
ok Uni.new(0x1D72F).NFKC.list ~~ (0x03A4,), '1D72F -> 03A4';
ok Uni.new(0x1D730).NFKC.list ~~ (0x03A5,), '1D730 -> 03A5';
ok Uni.new(0x1D731).NFKC.list ~~ (0x03A6,), '1D731 -> 03A6';
ok Uni.new(0x1D732).NFKC.list ~~ (0x03A7,), '1D732 -> 03A7';
ok Uni.new(0x1D733).NFKC.list ~~ (0x03A8,), '1D733 -> 03A8';
ok Uni.new(0x1D734).NFKC.list ~~ (0x03A9,), '1D734 -> 03A9';
ok Uni.new(0x1D735).NFKC.list ~~ (0x2207,), '1D735 -> 2207';
ok Uni.new(0x1D736).NFKC.list ~~ (0x03B1,), '1D736 -> 03B1';
ok Uni.new(0x1D737).NFKC.list ~~ (0x03B2,), '1D737 -> 03B2';
ok Uni.new(0x1D738).NFKC.list ~~ (0x03B3,), '1D738 -> 03B3';
ok Uni.new(0x1D739).NFKC.list ~~ (0x03B4,), '1D739 -> 03B4';
ok Uni.new(0x1D73A).NFKC.list ~~ (0x03B5,), '1D73A -> 03B5';
ok Uni.new(0x1D73B).NFKC.list ~~ (0x03B6,), '1D73B -> 03B6';
ok Uni.new(0x1D73C).NFKC.list ~~ (0x03B7,), '1D73C -> 03B7';
ok Uni.new(0x1D73D).NFKC.list ~~ (0x03B8,), '1D73D -> 03B8';
ok Uni.new(0x1D73E).NFKC.list ~~ (0x03B9,), '1D73E -> 03B9';
ok Uni.new(0x1D73F).NFKC.list ~~ (0x03BA,), '1D73F -> 03BA';
ok Uni.new(0x1D740).NFKC.list ~~ (0x03BB,), '1D740 -> 03BB';
ok Uni.new(0x1D741).NFKC.list ~~ (0x03BC,), '1D741 -> 03BC';
ok Uni.new(0x1D742).NFKC.list ~~ (0x03BD,), '1D742 -> 03BD';
ok Uni.new(0x1D743).NFKC.list ~~ (0x03BE,), '1D743 -> 03BE';
ok Uni.new(0x1D744).NFKC.list ~~ (0x03BF,), '1D744 -> 03BF';
ok Uni.new(0x1D745).NFKC.list ~~ (0x03C0,), '1D745 -> 03C0';
ok Uni.new(0x1D746).NFKC.list ~~ (0x03C1,), '1D746 -> 03C1';
ok Uni.new(0x1D747).NFKC.list ~~ (0x03C2,), '1D747 -> 03C2';
ok Uni.new(0x1D748).NFKC.list ~~ (0x03C3,), '1D748 -> 03C3';
ok Uni.new(0x1D749).NFKC.list ~~ (0x03C4,), '1D749 -> 03C4';
ok Uni.new(0x1D74A).NFKC.list ~~ (0x03C5,), '1D74A -> 03C5';
ok Uni.new(0x1D74B).NFKC.list ~~ (0x03C6,), '1D74B -> 03C6';
ok Uni.new(0x1D74C).NFKC.list ~~ (0x03C7,), '1D74C -> 03C7';
ok Uni.new(0x1D74D).NFKC.list ~~ (0x03C8,), '1D74D -> 03C8';
ok Uni.new(0x1D74E).NFKC.list ~~ (0x03C9,), '1D74E -> 03C9';
ok Uni.new(0x1D74F).NFKC.list ~~ (0x2202,), '1D74F -> 2202';
ok Uni.new(0x1D750).NFKC.list ~~ (0x03B5,), '1D750 -> 03B5';
ok Uni.new(0x1D751).NFKC.list ~~ (0x03B8,), '1D751 -> 03B8';
ok Uni.new(0x1D752).NFKC.list ~~ (0x03BA,), '1D752 -> 03BA';
ok Uni.new(0x1D753).NFKC.list ~~ (0x03C6,), '1D753 -> 03C6';
ok Uni.new(0x1D754).NFKC.list ~~ (0x03C1,), '1D754 -> 03C1';
ok Uni.new(0x1D755).NFKC.list ~~ (0x03C0,), '1D755 -> 03C0';
ok Uni.new(0x1D756).NFKC.list ~~ (0x0391,), '1D756 -> 0391';
ok Uni.new(0x1D757).NFKC.list ~~ (0x0392,), '1D757 -> 0392';
ok Uni.new(0x1D758).NFKC.list ~~ (0x0393,), '1D758 -> 0393';
ok Uni.new(0x1D759).NFKC.list ~~ (0x0394,), '1D759 -> 0394';
ok Uni.new(0x1D75A).NFKC.list ~~ (0x0395,), '1D75A -> 0395';
ok Uni.new(0x1D75B).NFKC.list ~~ (0x0396,), '1D75B -> 0396';
ok Uni.new(0x1D75C).NFKC.list ~~ (0x0397,), '1D75C -> 0397';
ok Uni.new(0x1D75D).NFKC.list ~~ (0x0398,), '1D75D -> 0398';
ok Uni.new(0x1D75E).NFKC.list ~~ (0x0399,), '1D75E -> 0399';
ok Uni.new(0x1D75F).NFKC.list ~~ (0x039A,), '1D75F -> 039A';
ok Uni.new(0x1D760).NFKC.list ~~ (0x039B,), '1D760 -> 039B';
ok Uni.new(0x1D761).NFKC.list ~~ (0x039C,), '1D761 -> 039C';
ok Uni.new(0x1D762).NFKC.list ~~ (0x039D,), '1D762 -> 039D';
ok Uni.new(0x1D763).NFKC.list ~~ (0x039E,), '1D763 -> 039E';
ok Uni.new(0x1D764).NFKC.list ~~ (0x039F,), '1D764 -> 039F';
ok Uni.new(0x1D765).NFKC.list ~~ (0x03A0,), '1D765 -> 03A0';
ok Uni.new(0x1D766).NFKC.list ~~ (0x03A1,), '1D766 -> 03A1';
ok Uni.new(0x1D767).NFKC.list ~~ (0x0398,), '1D767 -> 0398';
ok Uni.new(0x1D768).NFKC.list ~~ (0x03A3,), '1D768 -> 03A3';
ok Uni.new(0x1D769).NFKC.list ~~ (0x03A4,), '1D769 -> 03A4';
ok Uni.new(0x1D76A).NFKC.list ~~ (0x03A5,), '1D76A -> 03A5';
ok Uni.new(0x1D76B).NFKC.list ~~ (0x03A6,), '1D76B -> 03A6';
ok Uni.new(0x1D76C).NFKC.list ~~ (0x03A7,), '1D76C -> 03A7';
ok Uni.new(0x1D76D).NFKC.list ~~ (0x03A8,), '1D76D -> 03A8';
ok Uni.new(0x1D76E).NFKC.list ~~ (0x03A9,), '1D76E -> 03A9';
ok Uni.new(0x1D76F).NFKC.list ~~ (0x2207,), '1D76F -> 2207';
ok Uni.new(0x1D770).NFKC.list ~~ (0x03B1,), '1D770 -> 03B1';
ok Uni.new(0x1D771).NFKC.list ~~ (0x03B2,), '1D771 -> 03B2';
ok Uni.new(0x1D772).NFKC.list ~~ (0x03B3,), '1D772 -> 03B3';
ok Uni.new(0x1D773).NFKC.list ~~ (0x03B4,), '1D773 -> 03B4';
ok Uni.new(0x1D774).NFKC.list ~~ (0x03B5,), '1D774 -> 03B5';
ok Uni.new(0x1D775).NFKC.list ~~ (0x03B6,), '1D775 -> 03B6';
ok Uni.new(0x1D776).NFKC.list ~~ (0x03B7,), '1D776 -> 03B7';
ok Uni.new(0x1D777).NFKC.list ~~ (0x03B8,), '1D777 -> 03B8';
ok Uni.new(0x1D778).NFKC.list ~~ (0x03B9,), '1D778 -> 03B9';
ok Uni.new(0x1D779).NFKC.list ~~ (0x03BA,), '1D779 -> 03BA';
ok Uni.new(0x1D77A).NFKC.list ~~ (0x03BB,), '1D77A -> 03BB';
ok Uni.new(0x1D77B).NFKC.list ~~ (0x03BC,), '1D77B -> 03BC';
ok Uni.new(0x1D77C).NFKC.list ~~ (0x03BD,), '1D77C -> 03BD';
ok Uni.new(0x1D77D).NFKC.list ~~ (0x03BE,), '1D77D -> 03BE';
ok Uni.new(0x1D77E).NFKC.list ~~ (0x03BF,), '1D77E -> 03BF';
ok Uni.new(0x1D77F).NFKC.list ~~ (0x03C0,), '1D77F -> 03C0';
ok Uni.new(0x1D780).NFKC.list ~~ (0x03C1,), '1D780 -> 03C1';
ok Uni.new(0x1D781).NFKC.list ~~ (0x03C2,), '1D781 -> 03C2';
ok Uni.new(0x1D782).NFKC.list ~~ (0x03C3,), '1D782 -> 03C3';
ok Uni.new(0x1D783).NFKC.list ~~ (0x03C4,), '1D783 -> 03C4';
ok Uni.new(0x1D784).NFKC.list ~~ (0x03C5,), '1D784 -> 03C5';
ok Uni.new(0x1D785).NFKC.list ~~ (0x03C6,), '1D785 -> 03C6';
ok Uni.new(0x1D786).NFKC.list ~~ (0x03C7,), '1D786 -> 03C7';
ok Uni.new(0x1D787).NFKC.list ~~ (0x03C8,), '1D787 -> 03C8';
ok Uni.new(0x1D788).NFKC.list ~~ (0x03C9,), '1D788 -> 03C9';
ok Uni.new(0x1D789).NFKC.list ~~ (0x2202,), '1D789 -> 2202';
ok Uni.new(0x1D78A).NFKC.list ~~ (0x03B5,), '1D78A -> 03B5';
ok Uni.new(0x1D78B).NFKC.list ~~ (0x03B8,), '1D78B -> 03B8';
ok Uni.new(0x1D78C).NFKC.list ~~ (0x03BA,), '1D78C -> 03BA';
ok Uni.new(0x1D78D).NFKC.list ~~ (0x03C6,), '1D78D -> 03C6';
ok Uni.new(0x1D78E).NFKC.list ~~ (0x03C1,), '1D78E -> 03C1';
ok Uni.new(0x1D78F).NFKC.list ~~ (0x03C0,), '1D78F -> 03C0';
ok Uni.new(0x1D790).NFKC.list ~~ (0x0391,), '1D790 -> 0391';
ok Uni.new(0x1D791).NFKC.list ~~ (0x0392,), '1D791 -> 0392';
ok Uni.new(0x1D792).NFKC.list ~~ (0x0393,), '1D792 -> 0393';
ok Uni.new(0x1D793).NFKC.list ~~ (0x0394,), '1D793 -> 0394';
ok Uni.new(0x1D794).NFKC.list ~~ (0x0395,), '1D794 -> 0395';
ok Uni.new(0x1D795).NFKC.list ~~ (0x0396,), '1D795 -> 0396';
ok Uni.new(0x1D796).NFKC.list ~~ (0x0397,), '1D796 -> 0397';
ok Uni.new(0x1D797).NFKC.list ~~ (0x0398,), '1D797 -> 0398';
ok Uni.new(0x1D798).NFKC.list ~~ (0x0399,), '1D798 -> 0399';
| 64.548259 | 279 | 0.628016 |
ed90a0230357688ac734b8d2be08c178959a900c | 14,463 | pl | Perl | src/backend/catalog/genbki.pl | chet0xhenry/postgresql | 6ffdf1265e74405c84b89ae8f239b01c8de47b89 | [
"PostgreSQL"
] | 1 | 2021-02-24T13:01:00.000Z | 2021-02-24T13:01:00.000Z | src/backend/catalog/genbki.pl | chet0xhenry/postgresql | 6ffdf1265e74405c84b89ae8f239b01c8de47b89 | [
"PostgreSQL"
] | null | null | null | src/backend/catalog/genbki.pl | chet0xhenry/postgresql | 6ffdf1265e74405c84b89ae8f239b01c8de47b89 | [
"PostgreSQL"
] | null | null | null | #!/usr/bin/perl -w
#----------------------------------------------------------------------
#
# genbki.pl
# Perl script that generates postgres.bki, postgres.description,
# postgres.shdescription, and schemapg.h from specially formatted
# header files. The .bki files are used to initialize the postgres
# template database.
#
# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
# src/backend/catalog/genbki.pl
#
#----------------------------------------------------------------------
use Catalog;
use strict;
use warnings;
my @input_files;
my @include_path;
my $output_path = '';
my $major_version;
# Process command line switches.
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/)
{
push @include_path, length($arg) > 2 ? substr($arg, 2) : shift @ARGV;
}
elsif ($arg =~ /^--set-version=(.*)$/)
{
$major_version = $1;
die "Invalid version string.\n"
if !($major_version =~ /^\d+$/);
}
else
{
usage();
}
}
# Sanity check arguments.
die "No input files.\n" if !@input_files;
die "No include path; you must specify -I at least once.\n" if !@include_path;
die "--set-version must be specified.\n" if !defined $major_version;
# Make sure output_path ends in a slash.
if ($output_path ne '' && substr($output_path, -1) ne '/')
{
$output_path .= '/';
}
# Open temp files
my $tmpext = ".tmp$$";
my $bkifile = $output_path . 'postgres.bki';
open my $bki, '>', $bkifile . $tmpext
or die "can't open $bkifile$tmpext: $!";
my $schemafile = $output_path . 'schemapg.h';
open my $schemapg, '>', $schemafile . $tmpext
or die "can't open $schemafile$tmpext: $!";
my $descrfile = $output_path . 'postgres.description';
open my $descr, '>', $descrfile . $tmpext
or die "can't open $descrfile$tmpext: $!";
my $shdescrfile = $output_path . 'postgres.shdescription';
open my $shdescr, '>', $shdescrfile . $tmpext
or die "can't open $shdescrfile$tmpext: $!";
# Fetch some special data that we will substitute into the output file.
# CAUTION: be wary about what symbols you substitute into the .bki file here!
# It's okay to substitute things that are expected to be really constant
# within a given Postgres release, such as fixed OIDs. Do not substitute
# anything that could depend on platform or configuration. (The right place
# to handle those sorts of things is in initdb.c's bootstrap_template1().)
# NB: make sure that the files used here are known to be part of the .bki
# file's dependencies by src/backend/catalog/Makefile.
my $BOOTSTRAP_SUPERUSERID =
Catalog::FindDefinedSymbol('pg_authid.h', \@include_path,
'BOOTSTRAP_SUPERUSERID');
my $PG_CATALOG_NAMESPACE =
Catalog::FindDefinedSymbol('pg_namespace.h', \@include_path,
'PG_CATALOG_NAMESPACE');
# Read all the input header files into internal data structures
my $catalogs = Catalog::Catalogs(@input_files);
# Generate postgres.bki, postgres.description, and postgres.shdescription
# version marker for .bki file
print $bki "# PostgreSQL $major_version\n";
# vars to hold data needed for schemapg.h
my %schemapg_entries;
my @tables_needing_macros;
my %regprocoids;
my %types;
# produce output, one catalog at a time
foreach my $catname (@{ $catalogs->{names} })
{
# .bki CREATE command for this catalog
my $catalog = $catalogs->{$catname};
print $bki "create $catname $catalog->{relation_oid}"
. $catalog->{shared_relation}
. $catalog->{bootstrap}
. $catalog->{without_oids}
. $catalog->{rowtype_oid} . "\n";
my @attnames;
my $first = 1;
print $bki " (\n";
my $schema = $catalog->{columns};
foreach my $column (@$schema)
{
my $attname = $column->{name};
my $atttype = $column->{type};
push @attnames, $attname;
if (!$first)
{
print $bki " ,\n";
}
$first = 0;
print $bki " $attname = $atttype";
if (defined $column->{forcenotnull})
{
print $bki " FORCE NOT NULL";
}
elsif (defined $column->{forcenull})
{
print $bki " FORCE NULL";
}
}
print $bki "\n )\n";
# Open it, unless bootstrap case (create bootstrap does this
# automatically)
if (!$catalog->{bootstrap})
{
print $bki "open $catname\n";
}
if (defined $catalog->{data})
{
# Ordinary catalog with DATA line(s)
foreach my $row (@{ $catalog->{data} })
{
# Split line into tokens without interpreting their meaning.
my %bki_values;
@bki_values{@attnames} =
Catalog::SplitDataLine($row->{bki_values});
# Perform required substitutions on fields
foreach my $column (@$schema)
{
my $attname = $column->{name};
my $atttype = $column->{type};
# Substitute constant values we acquired above.
# (It's intentional that this can apply to parts of a field).
$bki_values{$attname} =~ s/\bPGUID\b/$BOOTSTRAP_SUPERUSERID/g;
$bki_values{$attname} =~ s/\bPGNSP\b/$PG_CATALOG_NAMESPACE/g;
# Replace regproc columns' values with OIDs.
# If we don't have a unique value to substitute,
# just do nothing (regprocin will complain).
if ($atttype eq 'regproc')
{
my $procoid = $regprocoids{ $bki_values{$attname} };
$bki_values{$attname} = $procoid
if defined($procoid) && $procoid ne 'MULTIPLE';
}
}
# Save pg_proc oids for use in later regproc substitutions.
# This relies on the order we process the files in!
if ($catname eq 'pg_proc')
{
if (defined($regprocoids{ $bki_values{proname} }))
{
$regprocoids{ $bki_values{proname} } = 'MULTIPLE';
}
else
{
$regprocoids{ $bki_values{proname} } = $row->{oid};
}
}
# Save pg_type info for pg_attribute processing below
if ($catname eq 'pg_type')
{
my %type = %bki_values;
$type{oid} = $row->{oid};
$types{ $type{typname} } = \%type;
}
# Write to postgres.bki
my $oid = $row->{oid} ? "OID = $row->{oid} " : '';
printf $bki "insert %s( %s )\n", $oid,
join(' ', @bki_values{@attnames});
# Write comments to postgres.description and
# postgres.shdescription
if (defined $row->{descr})
{
printf $descr "%s\t%s\t0\t%s\n",
$row->{oid}, $catname, $row->{descr};
}
if (defined $row->{shdescr})
{
printf $shdescr "%s\t%s\t%s\n",
$row->{oid}, $catname, $row->{shdescr};
}
}
}
if ($catname eq 'pg_attribute')
{
# For pg_attribute.h, we generate DATA entries ourselves.
# NB: pg_type.h must come before pg_attribute.h in the input list
# of catalog names, since we use info from pg_type.h here.
foreach my $table_name (@{ $catalogs->{names} })
{
my $table = $catalogs->{$table_name};
# Currently, all bootstrapped relations also need schemapg.h
# entries, so skip if the relation isn't to be in schemapg.h.
next if !$table->{schema_macro};
$schemapg_entries{$table_name} = [];
push @tables_needing_macros, $table_name;
# Generate entries for user attributes.
my $attnum = 0;
my $priornotnull = 1;
foreach my $attr (@{ $table->{columns} })
{
$attnum++;
my %row;
$row{attnum} = $attnum;
$row{attrelid} = $table->{relation_oid};
morph_row_for_pgattr(\%row, $schema, $attr, $priornotnull);
$priornotnull &= ($row{attnotnull} eq 't');
# If it's bootstrapped, put an entry in postgres.bki.
print_bki_insert(\%row, @attnames) if $table->{bootstrap};
# Store schemapg entries for later.
morph_row_for_schemapg(\%row, $schema);
push @{ $schemapg_entries{$table_name} },
sprintf "{ %s }",
join(', ', grep { defined $_ } @row{@attnames});
}
# Generate entries for system attributes.
# We only need postgres.bki entries, not schemapg.h entries.
if ($table->{bootstrap})
{
$attnum = 0;
my @SYS_ATTRS = (
{ name => 'ctid', type => 'tid' },
{ name => 'oid', type => 'oid' },
{ name => 'xmin', type => 'xid' },
{ name => 'cmin', type => 'cid' },
{ name => 'xmax', type => 'xid' },
{ name => 'cmax', type => 'cid' },
{ name => 'tableoid', type => 'oid' });
foreach my $attr (@SYS_ATTRS)
{
$attnum--;
my %row;
$row{attnum} = $attnum;
$row{attrelid} = $table->{relation_oid};
$row{attstattarget} = '0';
# Omit the oid column if the catalog doesn't have them
next
if $table->{without_oids}
&& $attr->{name} eq 'oid';
morph_row_for_pgattr(\%row, $schema, $attr, 1);
print_bki_insert(\%row, @attnames);
}
}
}
}
print $bki "close $catname\n";
}
# Any information needed for the BKI that is not contained in a pg_*.h header
# (i.e., not contained in a header with a CATALOG() statement) comes here
# Write out declare toast/index statements
foreach my $declaration (@{ $catalogs->{toasting}->{data} })
{
print $bki $declaration;
}
foreach my $declaration (@{ $catalogs->{indexing}->{data} })
{
print $bki $declaration;
}
# Now generate schemapg.h
# Opening boilerplate for schemapg.h
print $schemapg <<EOM;
/*-------------------------------------------------------------------------
*
* schemapg.h
* Schema_pg_xxx macros for use by relcache.c
*
* 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/catalog/genbki.pl
*
*-------------------------------------------------------------------------
*/
#ifndef SCHEMAPG_H
#define SCHEMAPG_H
EOM
# Emit schemapg declarations
foreach my $table_name (@tables_needing_macros)
{
print $schemapg "\n#define Schema_$table_name \\\n";
print $schemapg join ", \\\n", @{ $schemapg_entries{$table_name} };
print $schemapg "\n";
}
# Closing boilerplate for schemapg.h
print $schemapg "\n#endif /* SCHEMAPG_H */\n";
# We're done emitting data
close $bki;
close $schemapg;
close $descr;
close $shdescr;
# Finally, rename the completed files into place.
Catalog::RenameTempFile($bkifile, $tmpext);
Catalog::RenameTempFile($schemafile, $tmpext);
Catalog::RenameTempFile($descrfile, $tmpext);
Catalog::RenameTempFile($shdescrfile, $tmpext);
exit 0;
#################### Subroutines ########################
# Given $pgattr_schema (the pg_attribute schema for a catalog sufficient for
# AddDefaultValues), $attr (the description of a catalog row), and
# $priornotnull (whether all prior attributes in this catalog are not null),
# modify the $row hashref for print_bki_insert. This includes setting data
# from the corresponding pg_type element and filling in any default values.
# Any value not handled here must be supplied by caller.
sub morph_row_for_pgattr
{
my ($row, $pgattr_schema, $attr, $priornotnull) = @_;
my $attname = $attr->{name};
my $atttype = $attr->{type};
$row->{attname} = $attname;
# Adjust type name for arrays: foo[] becomes _foo, so we can look it up in
# pg_type
$atttype = '_' . $1 if $atttype =~ /(.+)\[\]$/;
# Copy the type data from pg_type, and add some type-dependent items
my $type = $types{$atttype};
$row->{atttypid} = $type->{oid};
$row->{attlen} = $type->{typlen};
$row->{attbyval} = $type->{typbyval};
$row->{attstorage} = $type->{typstorage};
$row->{attalign} = $type->{typalign};
# set attndims if it's an array type
$row->{attndims} = $type->{typcategory} eq 'A' ? '1' : '0';
$row->{attcollation} = $type->{typcollation};
if (defined $attr->{forcenotnull})
{
$row->{attnotnull} = 't';
}
elsif (defined $attr->{forcenull})
{
$row->{attnotnull} = 'f';
}
elsif ($priornotnull)
{
# attnotnull will automatically be set if the type is
# fixed-width and prior columns are all NOT NULL ---
# compare DefineAttr in bootstrap.c. oidvector and
# int2vector are also treated as not-nullable.
$row->{attnotnull} =
$type->{typname} eq 'oidvector' ? 't'
: $type->{typname} eq 'int2vector' ? 't'
: $type->{typlen} eq 'NAMEDATALEN' ? 't'
: $type->{typlen} > 0 ? 't'
: 'f';
}
else
{
$row->{attnotnull} = 'f';
}
my $error = Catalog::AddDefaultValues($row, $pgattr_schema);
if ($error)
{
die "Failed to form full tuple for pg_attribute: ", $error;
}
}
# Write a pg_attribute entry to postgres.bki
sub print_bki_insert
{
my $row = shift;
my @attnames = @_;
my $oid = $row->{oid} ? "OID = $row->{oid} " : '';
my $bki_values = join ' ', @{$row}{@attnames};
printf $bki "insert %s( %s )\n", $oid, $bki_values;
}
# Given a row reference, modify it so that it becomes a valid entry for
# a catalog schema declaration in schemapg.h.
#
# The field values of a Schema_pg_xxx declaration are similar, but not
# quite identical, to the corresponding values in postgres.bki.
sub morph_row_for_schemapg
{
my $row = shift;
my $pgattr_schema = shift;
foreach my $column (@$pgattr_schema)
{
my $attname = $column->{name};
my $atttype = $column->{type};
# Some data types have special formatting rules.
if ($atttype eq 'name')
{
# add {" ... "} quoting
$row->{$attname} = sprintf(qq'{"%s"}', $row->{$attname});
}
elsif ($atttype eq 'char')
{
# Replace empty string by zero char constant; add single quotes
$row->{$attname} = '\0' if $row->{$attname} eq q|""|;
$row->{$attname} = sprintf("'%s'", $row->{$attname});
}
# Expand booleans from 'f'/'t' to 'false'/'true'.
# Some values might be other macros (eg FLOAT4PASSBYVAL),
# don't change.
elsif ($atttype eq 'bool')
{
$row->{$attname} = 'true' if $row->{$attname} eq 't';
$row->{$attname} = 'false' if $row->{$attname} eq 'f';
}
# We don't emit initializers for the variable length fields at all.
# Only the fixed-size portions of the descriptors are ever used.
delete $row->{$attname} if $column->{is_varlen};
}
}
sub usage
{
die <<EOM;
Usage: genbki.pl [options] header...
Options:
-I path to include files
-o output path
--set-version PostgreSQL version number for initdb cross-check
genbki.pl generates BKI files from specially formatted
header files. These BKI files are used to initialize the
postgres template database.
Report bugs to <pgsql-bugs\@postgresql.org>.
EOM
}
| 28.192982 | 78 | 0.621863 |
73e2a4d2e0c8b03496d703a358a36384318e66c3 | 9,195 | pm | Perl | lib/Mojo/IOLoop/Client.pm | jamadam/mojo | e3217946f67e2a71541d119e3492a5107e07cdd3 | [
"Artistic-2.0"
] | null | null | null | lib/Mojo/IOLoop/Client.pm | jamadam/mojo | e3217946f67e2a71541d119e3492a5107e07cdd3 | [
"Artistic-2.0"
] | 3 | 2021-01-27T10:09:28.000Z | 2021-05-11T21:20:12.000Z | lib/Mojo/IOLoop/Client.pm | jamadam/mojo | e3217946f67e2a71541d119e3492a5107e07cdd3 | [
"Artistic-2.0"
] | 2 | 2020-03-13T13:41:29.000Z | 2021-09-29T00:19:26.000Z | package Mojo::IOLoop::Client;
use Mojo::Base 'Mojo::EventEmitter';
use Errno 'EINPROGRESS';
use IO::Socket::IP;
use IO::Socket::UNIX;
use Mojo::IOLoop;
use Mojo::IOLoop::TLS;
use Scalar::Util 'weaken';
use Socket qw(IPPROTO_TCP SOCK_STREAM TCP_NODELAY);
# Non-blocking name resolution requires Net::DNS::Native
use constant NNR => $ENV{MOJO_NO_NNR}
? 0
: eval { require Net::DNS::Native; Net::DNS::Native->VERSION('0.15'); 1 };
my $NDN;
# SOCKS support requires IO::Socket::Socks
use constant SOCKS => $ENV{MOJO_NO_SOCKS}
? 0
: eval { require IO::Socket::Socks; IO::Socket::Socks->VERSION('0.64'); 1 };
use constant READ => SOCKS ? IO::Socket::Socks::SOCKS_WANT_READ() : 0;
use constant WRITE => SOCKS ? IO::Socket::Socks::SOCKS_WANT_WRITE() : 0;
has reactor => sub { Mojo::IOLoop->singleton->reactor }, weak => 1;
sub DESTROY { shift->_cleanup }
sub can_nnr {NNR}
sub can_socks {SOCKS}
sub connect {
my ($self, $args) = (shift, ref $_[0] ? $_[0] : {@_});
# Timeout
weaken $self;
my $reactor = $self->reactor;
$self->{timer} = $reactor->timer($args->{timeout} || 10,
sub { $self->emit(error => 'Connect timeout') });
# Blocking name resolution
$_ && s/[[\]]//g for @$args{qw(address socks_address)};
my $address = $args->{socks_address} || ($args->{address} ||= '127.0.0.1');
return $reactor->next_tick(sub { $self && $self->_connect($args) })
if !NNR || $args->{handle} || $args->{path};
# Non-blocking name resolution
$NDN //= Net::DNS::Native->new(pool => 5, extra_thread => 1);
my $handle = $self->{dns} = $NDN->getaddrinfo($address, _port($args),
{protocol => IPPROTO_TCP, socktype => SOCK_STREAM});
$reactor->io(
$handle => sub {
my $reactor = shift;
$reactor->remove($self->{dns});
my ($err, @res) = $NDN->get_result(delete $self->{dns});
return $self->emit(error => "Can't resolve: $err") if $err;
$args->{addr_info} = \@res;
$self->_connect($args);
}
)->watch($handle, 1, 0);
}
sub _cleanup {
my $self = shift;
$NDN->timedout($self->{dns}) if $NDN && $self->{dns};
return $self unless my $reactor = $self->reactor;
$self->{$_} && $reactor->remove(delete $self->{$_}) for qw(dns timer handle);
return $self;
}
sub _connect {
my ($self, $args) = @_;
my $path = $args->{path};
my $handle = $self->{handle} = $args->{handle};
unless ($handle) {
my $class = $path ? 'IO::Socket::UNIX' : 'IO::Socket::IP';
my %options = (Blocking => 0);
# UNIX domain socket
if ($path) { $options{Peer} = $path }
# IP socket
else {
if (my $info = $args->{addr_info}) { $options{PeerAddrInfo} = $info }
else {
$options{PeerAddr} = $args->{socks_address} || $args->{address};
$options{PeerPort} = _port($args);
}
$options{LocalAddr} = $args->{local_address} if $args->{local_address};
}
return $self->emit(error => "Can't connect: $@")
unless $self->{handle} = $handle = $class->new(%options);
}
$handle->blocking(0);
$path ? $self->_try_socks($args) : $self->_wait('_ready', $handle, $args);
}
sub _port { $_[0]{socks_port} || $_[0]{port} || ($_[0]{tls} ? 443 : 80) }
sub _ready {
my ($self, $args) = @_;
# Socket changes in between attempts and needs to be re-added for epoll/kqueue
my $handle = $self->{handle};
unless ($handle->connect) {
return $self->emit(error => $!) unless $! == EINPROGRESS;
$self->reactor->remove($handle);
return $self->_wait('_ready', $handle, $args);
}
return $self->emit(error => $! || 'Not connected') unless $handle->connected;
# Disable Nagle's algorithm
setsockopt $handle, IPPROTO_TCP, TCP_NODELAY, 1;
$self->_try_socks($args);
}
sub _socks {
my ($self, $args) = @_;
# Connected
my $handle = $self->{handle};
return $self->_try_tls($args) if $handle->ready;
# Switch between reading and writing
my $err = $IO::Socket::Socks::SOCKS_ERROR;
if ($err == READ) { $self->reactor->watch($handle, 1, 0) }
elsif ($err == WRITE) { $self->reactor->watch($handle, 1, 1) }
else { $self->emit(error => $err) }
}
sub _try_socks {
my ($self, $args) = @_;
my $handle = $self->{handle};
return $self->_try_tls($args) unless $args->{socks_address};
return $self->emit(
error => 'IO::Socket::Socks 0.64+ required for SOCKS support')
unless SOCKS;
my %options = (ConnectAddr => $args->{address}, ConnectPort => $args->{port});
@options{qw(AuthType Username Password)}
= ('userpass', @$args{qw(socks_user socks_pass)})
if $args->{socks_user};
my $reactor = $self->reactor;
$reactor->remove($handle);
return $self->emit(error => 'SOCKS upgrade failed')
unless IO::Socket::Socks->start_SOCKS($handle, %options);
$self->_wait('_socks', $handle, $args);
}
sub _try_tls {
my ($self, $args) = @_;
my $handle = $self->{handle};
return $self->_cleanup->emit(connect => $handle) unless $args->{tls};
my $reactor = $self->reactor;
$reactor->remove($handle);
# Start TLS handshake
weaken $self;
my $tls = Mojo::IOLoop::TLS->new($handle)->reactor($self->reactor);
$tls->on(upgrade => sub { $self->_cleanup->emit(connect => pop) });
$tls->on(error => sub { $self->emit(error => pop) });
$tls->negotiate(%$args);
}
sub _wait {
my ($self, $next, $handle, $args) = @_;
weaken $self;
$self->reactor->io($handle => sub { $self->$next($args) })
->watch($handle, 0, 1);
}
1;
=encoding utf8
=head1 NAME
Mojo::IOLoop::Client - Non-blocking TCP/IP and UNIX domain socket client
=head1 SYNOPSIS
use Mojo::IOLoop::Client;
# Create socket connection
my $client = Mojo::IOLoop::Client->new;
$client->on(connect => sub {
my ($client, $handle) = @_;
...
});
$client->on(error => sub {
my ($client, $err) = @_;
...
});
$client->connect(address => 'example.com', port => 80);
# Start reactor if necessary
$client->reactor->start unless $client->reactor->is_running;
=head1 DESCRIPTION
L<Mojo::IOLoop::Client> opens TCP/IP and UNIX domain socket connections for
L<Mojo::IOLoop>.
=head1 EVENTS
L<Mojo::IOLoop::Client> inherits all events from L<Mojo::EventEmitter> and can
emit the following new ones.
=head2 connect
$client->on(connect => sub {
my ($client, $handle) = @_;
...
});
Emitted once the connection is established.
=head2 error
$client->on(error => sub {
my ($client, $err) = @_;
...
});
Emitted if an error occurs on the connection, fatal if unhandled.
=head1 ATTRIBUTES
L<Mojo::IOLoop::Client> implements the following attributes.
=head2 reactor
my $reactor = $client->reactor;
$client = $client->reactor(Mojo::Reactor::Poll->new);
Low-level event reactor, defaults to the C<reactor> attribute value of the
global L<Mojo::IOLoop> singleton. Note that this attribute is weakened.
=head1 METHODS
L<Mojo::IOLoop::Client> inherits all methods from L<Mojo::EventEmitter> and
implements the following new ones.
=head2 can_nnr
my $bool = Mojo::IOLoop::Client->can_nnr;
True if L<Net::DNS::Native> 0.15+ is installed and non-blocking name resolution
support enabled.
=head2 can_socks
my $bool = Mojo::IOLoop::Client->can_socks;
True if L<IO::Socket::SOCKS> 0.64+ is installed and SOCKS5 support enabled.
=head2 connect
$client->connect(address => '127.0.0.1', port => 3000);
$client->connect({address => '127.0.0.1', port => 3000});
Open a socket connection to a remote host. Note that non-blocking name
resolution depends on L<Net::DNS::Native> (0.15+), SOCKS5 support on
L<IO::Socket::Socks> (0.64), and TLS support on L<IO::Socket::SSL> (2.009+).
These options are currently available:
=over 2
=item address
address => 'mojolicious.org'
Address or host name of the peer to connect to, defaults to C<127.0.0.1>.
=item handle
handle => $handle
Use an already prepared L<IO::Socket::IP> object.
=item local_address
local_address => '127.0.0.1'
Local address to bind to.
=item path
path => '/tmp/myapp.sock'
Path of UNIX domain socket to connect to.
=item port
port => 80
Port to connect to, defaults to C<80> or C<443> with C<tls> option.
=item socks_address
socks_address => '127.0.0.1'
Address or host name of SOCKS5 proxy server to use for connection.
=item socks_pass
socks_pass => 'secr3t'
Password to use for SOCKS5 authentication.
=item socks_port
socks_port => 9050
Port of SOCKS5 proxy server to use for connection.
=item socks_user
socks_user => 'sri'
Username to use for SOCKS5 authentication.
=item timeout
timeout => 15
Maximum amount of time in seconds establishing connection may take before
getting canceled, defaults to C<10>.
=item tls
tls => 1
Enable TLS.
=item tls_ca
tls_ca => '/etc/tls/ca.crt'
Path to TLS certificate authority file.
=item tls_cert
tls_cert => '/etc/tls/client.crt'
Path to the TLS certificate file.
=item tls_key
tls_key => '/etc/tls/client.key'
Path to the TLS key file.
=item tls_protocols
tls_protocols => ['foo', 'bar']
ALPN protocols to negotiate.
=item tls_verify
tls_verify => 0x00
TLS verification mode.
=back
=head1 SEE ALSO
L<Mojolicious>, L<Mojolicious::Guides>, L<https://mojolicious.org>.
=cut
| 23.883117 | 80 | 0.639587 |
ed0dd772d501251a70ff24f1f1454c14f0e5a8b2 | 1,231 | pm | Perl | lib/OpusVL/FB11/Form/Admin/Users/Edit.pm | OpusVL/OpusVL-FB11 | eecdace4e58ffd4421743b69e3fcfd7b879ad344 | [
"Artistic-1.0"
] | 2 | 2019-06-11T18:56:30.000Z | 2019-08-22T13:44:16.000Z | lib/OpusVL/FB11/Form/Admin/Users/Edit.pm | OpusVL/OpusVL-FB11 | eecdace4e58ffd4421743b69e3fcfd7b879ad344 | [
"Artistic-1.0"
] | 45 | 2017-11-27T09:34:17.000Z | 2020-09-26T09:56:29.000Z | lib/OpusVL/FB11/Form/Admin/Users/Edit.pm | OpusVL/OpusVL-FB11 | eecdace4e58ffd4421743b69e3fcfd7b879ad344 | [
"Artistic-1.0"
] | 1 | 2019-03-28T13:50:46.000Z | 2019-03-28T13:50:46.000Z | package OpusVL::FB11::Form::Admin::Users::Edit;
our $VERSION = '2';
use OpusVL::FB11::Plugin::FormHandler;
with 'HTML::FormHandler::TraitFor::Model::DBIC';
has_field 'username' => (
type => 'Text',
label => 'Username',
required => 1,
# Stops chrome trying to populate it like a login form
element_attr => {
autocomplete => 'new-username',
}
);
has_field 'name' => (
type => 'Text',
label => 'Name',
required => 1,
);
has_field 'email' => (
type => 'Email',
label => 'Email',
required => 1,
);
has_field 'tel' => (
type => 'Text',
label => 'Telephone',
);
has_field 'status' => (
type => 'Select',
widget => 'RadioGroup',
options => [
{ value => 'enabled', label => 'Enabled', attributes => { checked => 'checked' } },
{ value => 'disabled', label => 'Disabled' },
],
);
has_field 'submit-it' => (
type => 'Submit',
widget => "ButtonTag",
widget_wrapper => "None",
value => '<i class="fa fa-check"></i> Submit',
element_attr => { value => 'submitok', class => ['btn', 'btn-primary'] }
);
no HTML::FormHandler::Moose;
1;
__END__
| 22.381818 | 91 | 0.515028 |
ed234dd610081e2e46643f7ee39a004b8ef9a319 | 1,304 | pl | Perl | pop/plog/lib/on_interrupt.pl | nickpapadonis/poplog-x64 | c4af8c97e68823fe162fbedde0bc0af183c3a1ca | [
"MIT"
] | null | null | null | pop/plog/lib/on_interrupt.pl | nickpapadonis/poplog-x64 | c4af8c97e68823fe162fbedde0bc0af183c3a1ca | [
"MIT"
] | null | null | null | pop/plog/lib/on_interrupt.pl | nickpapadonis/poplog-x64 | c4af8c97e68823fe162fbedde0bc0af183c3a1ca | [
"MIT"
] | null | null | null | /* --- Copyright University of Sussex 1991. All rights reserved. ----------
> File: C.all/plog/lib/on_interrupt.pl
> Purpose: Handling keyboard interrupts
> Author: Simon Nichols, Jun 19 1991
> Documentation: HELP * ON_INTERRUPT
*/
:- system_predicate on_interrupt/2.
:- module prolog.
:- prolog_language(pop11).
compile_mode:pop11 +strict;
12 -> item_chartype(`\\`, readitem); ;;; alphabeticiser
define on_interrupt\/2(OldAction, NewAction);
lvars OldAction, NewAction, old_action;
define lconstant invoke(/* Goal */) with_nargs 1;
prolog_sysinvoke(prolog_instance(/* Goal */)) -> ;
enddefine;
if prolog_interrupt == identfn then
"abort";
elseif pdpart(prolog_interrupt) == invoke then
prolog_instance(frozval(1, prolog_interrupt));
else
prolog_interrupt;
endif -> old_action;
returnunless(prolog_unify(OldAction, old_action));
prolog_deref(NewAction) -> NewAction;
if isprologvar(NewAction) then
prolog_assign(NewAction, old_action);
elseif NewAction == "abort" then
identfn -> prolog_interrupt;
elseif isprocedure(NewAction) then
NewAction -> prolog_interrupt;
else
invoke(% prolog_generalise(NewAction) %) -> prolog_interrupt;
endif;
chain(prolog_apply_continuation)
enddefine;
:- prolog_language(prolog).
:- endmodule prolog.
| 25.076923 | 75 | 0.726994 |
73de6f7f0fce3d63c796c0d510ae8e623fb9a186 | 1,974 | pm | Perl | src/soft/miARma-Seq.1.7.5/lib/Perl/DateTime/TimeZone/America/Bogota.pm | eandresleon/miRNA-mRNA_Integration | b478a6ae73e235f9826cbf5343d2865bfcb067fa | [
"Apache-2.0"
] | 8 | 2018-08-13T18:50:15.000Z | 2021-11-02T05:09:44.000Z | src/soft/miARma-Seq.1.7.5/lib/Perl/DateTime/TimeZone/America/Bogota.pm | eandresleon/miRNA-mRNA_Integration | b478a6ae73e235f9826cbf5343d2865bfcb067fa | [
"Apache-2.0"
] | null | null | null | src/soft/miARma-Seq.1.7.5/lib/Perl/DateTime/TimeZone/America/Bogota.pm | eandresleon/miRNA-mRNA_Integration | b478a6ae73e235f9826cbf5343d2865bfcb067fa | [
"Apache-2.0"
] | 4 | 2018-10-26T04:31:32.000Z | 2020-06-20T07:01:33.000Z | # 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/8FT049ktOU/southamerica. Olson data version 2015d
#
# Do not edit this file directly.
#
package DateTime::TimeZone::America::Bogota;
$DateTime::TimeZone::America::Bogota::VERSION = '1.90';
use strict;
use Class::Singleton 1.03;
use DateTime::TimeZone;
use DateTime::TimeZone::OlsonDB;
@DateTime::TimeZone::America::Bogota::ISA = ( 'Class::Singleton', 'DateTime::TimeZone' );
my $spans =
[
[
DateTime::TimeZone::NEG_INFINITY, # utc_start
59428011376, # utc_end 1884-03-13 04:56:16 (Thu)
DateTime::TimeZone::NEG_INFINITY, # local_start
59427993600, # local_end 1884-03-13 00:00:00 (Thu)
-17776,
0,
'LMT',
],
[
59428011376, # utc_start 1884-03-13 04:56:16 (Thu)
60396641776, # utc_end 1914-11-23 04:56:16 (Mon)
59427993600, # local_start 1884-03-13 00:00:00 (Thu)
60396624000, # local_end 1914-11-23 00:00:00 (Mon)
-17776,
0,
'BMT',
],
[
60396641776, # utc_start 1914-11-23 04:56:16 (Mon)
62840552400, # utc_end 1992-05-03 05:00:00 (Sun)
60396623776, # local_start 1914-11-22 23:56:16 (Sun)
62840534400, # local_end 1992-05-03 00:00:00 (Sun)
-18000,
0,
'COT',
],
[
62840552400, # utc_start 1992-05-03 05:00:00 (Sun)
62869579200, # utc_end 1993-04-04 04:00:00 (Sun)
62840538000, # local_start 1992-05-03 01:00:00 (Sun)
62869564800, # local_end 1993-04-04 00:00:00 (Sun)
-14400,
1,
'COST',
],
[
62869579200, # utc_start 1993-04-04 04:00:00 (Sun)
DateTime::TimeZone::INFINITY, # utc_end
62869561200, # local_start 1993-04-03 23:00:00 (Sat)
DateTime::TimeZone::INFINITY, # local_end
-18000,
0,
'COT',
],
];
sub olson_version {'2015d'}
sub has_dst_changes {1}
sub _max_year {2025}
sub _new_instance {
return shift->_init( @_, spans => $spans );
}
1;
| 23.783133 | 89 | 0.674265 |
ed07434b717846404a613cc45eebeff0870cbc94 | 787 | pm | Perl | lib/Moose/Meta/Method/Accessor/Native/Hash/delete.pm | RsrchBoy/moose | 6bdea4fe2cf00478e26c3949994825ed66964da0 | [
"Artistic-1.0"
] | null | null | null | lib/Moose/Meta/Method/Accessor/Native/Hash/delete.pm | RsrchBoy/moose | 6bdea4fe2cf00478e26c3949994825ed66964da0 | [
"Artistic-1.0"
] | null | null | null | lib/Moose/Meta/Method/Accessor/Native/Hash/delete.pm | RsrchBoy/moose | 6bdea4fe2cf00478e26c3949994825ed66964da0 | [
"Artistic-1.0"
] | null | null | null | package Moose::Meta::Method::Accessor::Native::Hash::delete;
our $VERSION = '2.2007';
use strict;
use warnings;
use Moose::Role;
with 'Moose::Meta::Method::Accessor::Native::Hash::Writer';
sub _adds_members { 0 }
sub _potential_value {
my $self = shift;
my ($slot_access) = @_;
return '(do { '
. 'my %potential = %{ (' . $slot_access . ') }; '
. '@return = delete @potential{@_}; '
. '\%potential; '
. '})';
}
sub _inline_optimized_set_new_value {
my $self = shift;
my ($inv, $new, $slot_access) = @_;
return '@return = delete @{ (' . $slot_access . ') }{@_};';
}
sub _return_value {
my $self = shift;
my ($slot_access) = @_;
return 'wantarray ? @return : $return[-1]';
}
no Moose::Role;
1;
| 19.195122 | 63 | 0.551461 |
ed70fadd9cdd47982d32397b5689b911996261bc | 9,003 | pl | Perl | v2.1/developer/dist_3.0.70/mcon/pl/wanted.pl | oldbitpusher/npasswd | c0d535196d0d26bde72f44e4883a5be0a841c6b7 | [
"BSD-4-Clause-UC"
] | null | null | null | v2.1/developer/dist_3.0.70/mcon/pl/wanted.pl | oldbitpusher/npasswd | c0d535196d0d26bde72f44e4883a5be0a841c6b7 | [
"BSD-4-Clause-UC"
] | null | null | null | v2.1/developer/dist_3.0.70/mcon/pl/wanted.pl | oldbitpusher/npasswd | c0d535196d0d26bde72f44e4883a5be0a841c6b7 | [
"BSD-4-Clause-UC"
] | null | null | null | ;# $Id: wanted.pl,v 3.0.1.2 1995/01/11 15:42:37 ram Exp $
;#
;# Copyright (c) 1991-1993, Raphael Manfredi
;#
;# You may redistribute only under the terms of the Artistic Licence,
;# as specified in the README file that comes with the distribution.
;# You may reuse parts of this distribution only within the terms of
;# that same Artistic Licence; a copy of which may be found at the root
;# of the source tree for dist 3.0.
;#
;# $Log: wanted.pl,v $
;# Revision 3.0.1.2 1995/01/11 15:42:37 ram
;# patch45: added % in front of hash table names for perl5's each() (ADO)
;# patch45: tell users about possible extra file-extension lookups
;#
;# Revision 3.0.1.1 1993/10/16 13:56:05 ram
;# patch12: modified to handle ?M: lines
;# patch12: added warning when magic symbols used without proper config
;#
;# Revision 3.0 1993/08/18 12:10:29 ram
;# Baseline for dist 3.0 netwide release.
;#
;#
;# These two arrays record the file names of the files which may (or may not)
;# contain shell or C symbols known by metaconfig.
;# @SHlist records the .SH files
;# @clist records the C-like files (i.e. .[chyl])
;#
;# These files are scanned in turn to see how many symbols known by metaconfig
;# they have. Those symbols are gathered in a Wanted file. As C symbols are
;# not true targets for the forthcoming Makefile, a ">" sign is prepended.
;# Finally, the obsolete symbols are preceded by a "!".
;#
;# When obsolete symbols are found, they are dumped in file 'Obsolete'. Two
;# files are created anyway in the .MT directory. Obsol_h.U and Obsol_sh.U which
;# respectively list the obsoleted symbols (C and shell ones).
;# Obsol_h.U records obsolete C symbols
;# Obsol_sh.U records obsolete shell symbols
;#
;# The manifake() routine has to be provided externally.
;#
# Build a wanted file from the files held in @SHlist and @clist arrays
sub build_wanted {
# If wanted file is already there, parse it to map obsolete if -o option
# was used. Otherwise, build a new one.
if (-f 'Wanted') {
&map_obsolete if $opt_o; # Build Obsol*.U files
&dump_obsolete; # Dump obsolete symbols if any
return;
}
&parse_files;
}
sub parse_files {
print "Building a Wanted file...\n" unless $opt_s;
open(WANTED,"| sort | uniq >Wanted") || die "Can't create Wanted.\n";
unless (-f $NEWMANI) {
&manifake;
die "No $NEWMANI--can't build a Wanted file.\n" unless -f $NEWMANI;
}
local($search); # Where to-be-evaled script is held
local($_) = ' ' x 50000 if $opt_m; # Pre-extend pattern search space
local(%visited); # Records visited files
local(%lastfound); # Where last occurence of key was
# Now we are a little clever, and build a loop to eval so that we don't
# have to recompile our patterns on every file. We also use "study" since
# we are searching the same string for many different things. Hauls!
if (@clist) {
local($others) = $cext ? " $cext" : '';
print " Scanning .[chyl]$others files for symbols...\n"
unless $opt_s;
$search = ' ' x (40 * (@cmaster + @ocmaster)); # Pre-extend
$search = "while (<>) {study;\n"; # Init loop over ARGV
foreach $key (keys(%cmaster)) {
$search .= "&cmaster('$key') if /\\b$key\\b/;\n";
}
foreach $key (grep(!/^\$/, keys %Obsolete)) {
$search .= "&ofound('$key') if /\\b$key\\b/;\n";
}
$search .= "}\n"; # terminate loop
print $search if $opt_d;
@ARGV = @clist;
# Swallow each file as a whole, if memory is available
undef $/ if $opt_m;
eval $search;
eval '';
$/ = "\n";
while (($key,$value) = each(%cmaster)) {
print WANTED $cwanted{$key}, "\n", ">$key", "\n" if $value;
}
}
# If they don't use magic but use magically guarded symbols without
# their corresponding C symbol dependency, warn them, since they might
# not know about that portability issue.
if (@clist && !$opt_M) {
local($nused); # list of non-used symbols
local($warning) = 0; # true when one warning issued
foreach $cmag (keys %mwanted) { # loop over all used magic symbols
next unless $cmaster{$cmag};
$nused = '';
foreach $cdep (split(' ', $mwanted{$cmag})) {
$nused .= " $cdep" unless $cmaster{$cdep};
}
$nused =~ s/^ //;
$nused = "one of " . $nused if $nused =~ s/ /, /g;
if ($nused ne '') {
print " Warning: $cmag is used without $nused.\n";
$warning++;
}
}
if ($warning) {
local($those) = $warning == 1 ? 'that' : 'those';
local($s) = $warning == 1 ? '' : 's';
print "Note: $those previous warning$s may be suppressed by -M.\n";
}
}
# Cannot remove $cmaster as it is used later on when building Configure
undef @clist;
undef %cwanted;
undef %mwanted;
%visited = ();
%lastfound = ();
if (@SHlist) {
local($others) = $shext ? " $shext" : '';
print " Scanning .SH$others files for symbols...\n" unless $opt_s;
$search = ' ' x (40 * (@shmaster + @oshmaster)); # Pre-extend
$search = "while (<>) {study;\n";
# All the keys already have a leading '$'
foreach $key (keys(%shmaster)) {
$search .= "&shmaster('$key') if /\\$key\\b/;\n";
}
foreach $key (grep (/^\$/, keys %Obsolete)) {
$search .= "&ofound('$key') if /\\$key\\b/;\n";
}
$search .= "}\n";
print $search if $opt_d;
@ARGV = @SHlist;
# Swallow each file as a whole, if memory is available
undef $/ if $opt_m;
eval $search;
eval '';
$/ = "\n";
while (($key,$value) = each(%shmaster)) {
if ($value) {
$key =~ s/^\$//;
print WANTED $key, "\n";
}
}
}
# Obsolete symbols, if any, are written in the Wanted file preceded by a
# '!' character. In case -w is used, we'll thus be able to correctly build
# the Obsol_h.U and Obsol_sh.U files.
&add_obsolete; # Add obsolete symbols in Wanted file
close WANTED;
# If obsolete symbols where found, write an Obsolete file which lists where
# each of them appear and the new symbol to be used. Also write Obsol_h.U
# and Obsol_sh.U in .MT for later perusal.
&dump_obsolete; # Dump obsolete symbols if any
die "No desirable symbols found--aborting.\n" unless -s 'Wanted';
# Clean-up memory by freeing useless data structures
undef @SHlist;
undef %shmaster;
}
# This routine records matches of C master keys
sub cmaster {
local($key) = @_;
$cmaster{$key}++; # This symbol is wanted
return unless $opt_t || $opt_M; # Return if neither -t nor -M
if ($opt_t &&
$lastfound{$key} ne $ARGV # Never mentionned for this file ?
) {
$visited{$ARGV}++ || print $ARGV,":\n";
print "\t$key\n";
$lastfound{$key} = $ARGV;
}
if ($opt_M &&
defined($mwanted{$key}) # Found a ?M: symbol
) {
foreach $csym (split(' ', $mwanted{$key})) {
$cmaster{$csym}++; # Activate C symbol dependencies
}
}
}
# This routine records matches of obsolete keys (C or shell)
sub ofound {
local($key) = @_;
local($_) = $Obsolete{$key}; # Value of new symbol
$ofound{"$ARGV $key $_"}++; # Record obsolete match
$cmaster{$_}++ unless /^\$/; # A C hit
$shmaster{$_}++ if /^\$/; # Or a shell one
return unless $opt_t; # Continue if trace option on
if ($lastfound{$key} ne $ARGV) { # Never mentionned for this file ?
$visited{$ARGV}++ || print $ARGV,":\n";
print "\t$key (obsolete, use $_)\n";
$lastfound{$key} = $ARGV;
}
}
# This routine records matches of shell master keys
sub shmaster {
local($key) = @_;
$shmaster{$key}++; # This symbol is wanted
return unless $opt_t; # Continue if trace option on
if ($lastfound{$key} ne $ARGV) { # Never mentionned for this file ?
$visited{$ARGV}++ || print $ARGV,":\n";
print "\t$key\n";
$lastfound{$key} = $ARGV;
}
}
# Write obsolete symbols into the Wanted file for later perusal by -w.
sub add_obsolete {
local($file); # File where obsolete symbol was found
local($old); # Name of this old symbol
local($new); # Value of the new symbol to be used
foreach $key (sort keys %ofound) {
($file, $old, $new) = ($key =~ /^(\S+)\s+(\S+)\s+(\S+)/);
if ($new =~ s/^\$//) { # We found an obsolete shell symbol
print WANTED "!$old\n";
} else { # We found an obsolete C symbol
print WANTED "!>$old\n";
}
}
}
# Map obsolete symbols from Wanted file into %Obsolete and call dump_obsolete
# to actually build the Obsol_sh.U and Obsol_h.U files. Those will be needed
# during the Configure building phase to actually do the remaping.
# The obsolete symbols found are entered in the %ofound array, tagged as from
# file 'XXX', which is specially recognized by dump_obsolete.
sub map_obsolete {
open(WANTED, 'Wanted') || die "Can't open Wanted file.\n";
local($new); # New symbol to be used instead of obsolete one
while (<WANTED>) {
chop;
next unless s/^!//; # Skip non-obsolete symbols
if (s/^>//) { # C symbol
$new = $Obsolete{$_}; # Fetch new symbol
$ofound{"XXX $_ $new"}++; # Record obsolete match (XXX = no file)
} else { # Shell symbol
$new = $Obsolete{"\$$_"}; # Fetch new symbol
$ofound{"XXX \$$_ $new"}++; # Record obsolete match (XXX = no file)
}
}
close WANTED;
}
| 34.102273 | 80 | 0.635233 |
ed9441fd1901b43a7077a66e70a41651dbe5af40 | 9,302 | pm | Perl | Net-SSLeay-1.85/inc/Module/Install/PRIVATE/Net/SSLeay.pm | jmaslak/dotfiles | c3cf4697cdfc9f42b2173a4d6121caed0a776b09 | [
"Apache-2.0",
"MIT"
] | 4 | 2019-08-24T19:16:54.000Z | 2020-09-09T22:45:45.000Z | Net-SSLeay-1.85/inc/Module/Install/PRIVATE/Net/SSLeay.pm | jmaslak/dotfiles | c3cf4697cdfc9f42b2173a4d6121caed0a776b09 | [
"Apache-2.0",
"MIT"
] | 1 | 2017-12-05T18:32:58.000Z | 2018-07-12T15:24:56.000Z | Net-SSLeay-1.85/inc/Module/Install/PRIVATE/Net/SSLeay.pm | jmaslak/dotfiles | c3cf4697cdfc9f42b2173a4d6121caed0a776b09 | [
"Apache-2.0",
"MIT"
] | null | null | null | #line 1
package Module::Install::PRIVATE::Net::SSLeay;
use strict;
use Module::Install::Base;
use File::Basename ();
use File::Spec;
use Config;
use Symbol qw(gensym);
use vars qw{$VERSION @ISA};
BEGIN {
$VERSION = 0.01;
@ISA = qw{Module::Install::Base};
}
# Define this to one if you want to link the openssl libraries statically into
# the Net-SSLeay loadable object on Windows
my $win_link_statically = 0;
sub ssleay {
my ($self) = @_;
$self->requires_external_cc;
my $prefix = $self->find_openssl_prefix;
my $exec = $self->find_openssl_exec($prefix);
unless (-x $exec) {
print <<EOM;
*** Could not find OpenSSL
If it's already installed, please set the OPENSSL_PREFIX environment
variable accordingly. If it isn't installed yet, get the latest version
from http://www.openssl.org/.
EOM
exit 0; # according http://wiki.cpantesters.org/wiki/CPANAuthorNotes this is best-practice when "missing library"
}
$self->check_openssl_version($prefix, $exec);
my $opts = $self->ssleay_get_build_opts($prefix, $exec);
$self->makemaker_args(
CCCDLFLAGS => $opts->{cccdlflags},
OPTIMIZE => $opts->{optimize},
INC => join(' ', map {"-I$_"} @{$opts->{inc_paths}}),
LIBS => join(' ', (map {"-L$_"} @{$opts->{lib_paths}}), (map {"-l$_"} @{$opts->{lib_links}})),
);
if ( $self->prompt(
"Do you want to run external tests?\n".
"These tests *will* *fail* if you do not have network connectivity.",
'n',
) =~ /^y/i ) {
$self->tests('t/*/*.t t/*/*/*.t');
} else {
$self->tests('t/local/*.t t/handle/local/*.t');
}
}
sub ssleay_get_build_opts {
my ($self, $prefix, $exec) = @_;
my $opts = {
lib_links => [],
cccdlflags => '',
};
for ("$prefix/include", "$prefix/inc32", '/usr/kerberos/include') {
push @{$opts->{inc_paths}}, $_ if -f "$_/openssl/ssl.h";
}
for ($prefix, "$prefix/lib64", "$prefix/lib", "$prefix/out32dll") {
push @{$opts->{lib_paths}}, $_ if -d $_;
}
my $rsaref = $self->ssleay_is_rsaref;
print <<EOM;
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
and Net::SSLeay. Mixing and matching compilers is not supported.
EOM
if ($^O eq 'MSWin32') {
print "*** RSAREF build on Windows not supported out of box" if $rsaref;
if ($win_link_statically) {
# Link to static libs
push @{ $opts->{lib_paths} }, "$prefix/lib/VC/static" if -d "$prefix/lib/VC/static";
}
else {
push @{ $opts->{lib_paths} }, "$prefix/lib/VC" if -d "$prefix/lib/VC";
}
my $found = 0;
my @pairs = ();
# Library names depend on the compiler
@pairs = (['eay32','ssl32'],['crypto.dll','ssl.dll'],['crypto','ssl']) if $Config{cc} =~ /gcc/;
@pairs = (['libeay32','ssleay32'],['libeay32MD','ssleay32MD'],['libeay32MT','ssleay32MT']) if $Config{cc} =~ /cl/;
for my $dir (@{$opts->{lib_paths}}) {
for my $p (@pairs) {
$found = 1 if ($Config{cc} =~ /gcc/ && -f "$dir/lib$p->[0].a" && -f "$dir/lib$p->[1].a");
$found = 1 if ($Config{cc} =~ /cl/ && -f "$dir/$p->[0].lib" && -f "$dir/p->[1].lib");
if ($found) {
$opts->{lib_links} = [$p->[0], $p->[1], 'crypt32']; # Some systems need this system lib crypt32 too
$opts->{lib_paths} = [$dir];
last;
}
}
}
if (!$found) {
#fallback to the old behaviour
push @{ $opts->{lib_links} }, qw( libeay32MD ssleay32MD libeay32 ssleay32 libssl32 crypt32);
}
}
elsif ($^O eq 'VMS') {
if (-r 'sslroot:[000000]openssl.cnf') { # openssl.org source install
@{ $opts->{lib_paths} } = 'SSLLIB';
@{ $opts->{lib_links} } = qw( ssl_libssl32.olb ssl_libcrypto32.olb );
}
elsif (-r 'ssl$root:[000000]openssl.cnf') { # HP install
@{ $opts->{lib_paths} } = 'SYS$SHARE';
@{ $opts->{lib_links} } = qw( SSL$LIBSSL_SHR32 SSL$LIBCRYPTO_SHR32 );
}
@{ $opts->{lib_links} } = map { $_ =~ s/32\b//g } @{ $opts->{lib_links} } if $Config{use64bitall};
}
else {
push @{ $opts->{lib_links} },
($rsaref
? qw( ssl crypto RSAglue rsaref )
: qw( ssl crypto )
);
if (($Config{cc} =~ /aCC/i) && $^O eq 'hpux') {
print "*** Enabling HPUX aCC options (+e)\n";
$opts->{optimize} = '+e -O2 -g';
}
if ( (($Config{ccname} || $Config{cc}) eq 'gcc') && ($Config{cccdlflags} =~ /-fpic/) ) {
print "*** Enabling gcc -fPIC optimization\n";
$opts->{cccdlflags} .= '-fPIC';
}
}
# From HMBRAND to handle multple version of OPENSSL installed
if (my $lp = join " " => map { "-L$_" } @{$opts->{lib_paths} || []})
{
my $mma = $self->makemaker_args;
($mma->{uc $_} = $Config{$_}) =~ s/-L/$lp -L/ for qw( lddlflags ldflags );
}
return $opts;
}
sub ssleay_is_rsaref {
my ($self) = @_;
return $ENV{OPENSSL_RSAREF};
}
my $other_try = 0;
my @nopath;
sub check_no_path { # On OS/2 it would be typically on default paths
my $p;
if (not($other_try++) and $] >= 5.008001) {
use ExtUtils::MM;
my $mm = MM->new();
my ($list) = $mm->ext("-lssl");
return unless $list =~ /-lssl\b/;
for $p (split /\Q$Config{path_sep}/, $ENV{PATH}) {
@nopath = ("$p/openssl$Config{_exe}", # exe name
'.') # dummy lib path
if -x "$p/openssl$Config{_exe}"
}
}
@nopath;
}
sub find_openssl_prefix {
my ($self, $dir) = @_;
if (defined $ENV{OPENSSL_PREFIX}) {
return $ENV{OPENSSL_PREFIX};
}
my @guesses = (
'/home/linuxbrew/.linuxbrew/opt/openssl/bin/openssl' => '/home/linuxbrew/.linuxbrew/opt/openssl', # LinuxBrew openssl
'/usr/local/opt/openssl/bin/openssl' => '/usr/local/opt/openssl', # OSX homebrew openssl
'/usr/local/bin/openssl' => '/usr/local', # OSX homebrew openssl
'/opt/local/bin/openssl' => '/opt/local', # Macports openssl
'/usr/bin/openssl' => '/usr',
'/usr/sbin/openssl' => '/usr',
'/opt/ssl/bin/openssl' => '/opt/ssl',
'/opt/ssl/sbin/openssl' => '/opt/ssl',
'/usr/local/ssl/bin/openssl' => '/usr/local/ssl',
'/usr/local/openssl/bin/openssl' => '/usr/local/openssl',
'/apps/openssl/std/bin/openssl' => '/apps/openssl/std',
'/usr/sfw/bin/openssl' => '/usr/sfw', # Open Solaris
'C:\OpenSSL\bin\openssl.exe' => 'C:\OpenSSL',
'C:\OpenSSL-Win32\bin\openssl.exe' => 'C:\OpenSSL-Win32',
$Config{prefix} . '\bin\openssl.exe' => $Config{prefix}, # strawberry perl
$Config{prefix} . '\..\c\bin\openssl.exe' => $Config{prefix} . '\..\c', # strawberry perl
'/sslexe/openssl.exe' => '/sslroot', # VMS, openssl.org
'/ssl$exe/openssl.exe' => '/ssl$root', # VMS, HP install
);
while (my $k = shift @guesses
and my $v = shift @guesses) {
if ( -x $k ) {
return $v;
}
}
(undef, $dir) = $self->check_no_path
and return $dir;
return;
}
sub find_openssl_exec {
my ($self, $prefix) = @_;
my $exe_path;
for my $subdir (qw( bin sbin out32dll ia64_exe alpha_exe )) {
my $path = File::Spec->catfile($prefix, $subdir, "openssl$Config{_exe}");
if ( -x $path ) {
return $path;
}
}
($prefix) = $self->check_no_path
and return $prefix;
return;
}
sub check_openssl_version {
my ($self, $prefix, $exec) = @_;
my ($major, $minor, $letter);
{
my $pipe = gensym();
open($pipe, qq{"$exec" version |})
or die "Could not execute $exec";
my $output = <$pipe>;
chomp $output;
close $pipe;
if ( ($major, $minor, $letter) = $output =~ /^OpenSSL\s+(\d+\.\d+)\.(\d+)([a-z]?)/ ) {
print "*** Found OpenSSL-${major}.${minor}${letter} installed in $prefix\n";
} elsif ( ($major, $minor) = $output =~ /^LibreSSL\s+(\d+\.\d+)\.(\d+)/ ) {
print "*** Found LibreSSL-${major}.${minor} installed in $prefix\n";
} else {
die <<EOM
*** OpenSSL version test failed
(`$output' has been returned)
Either you have bogus OpenSSL or a new version has changed the version
number format. Please inform the authors!
EOM
}
}
if ($major < 0.9 || ($major == 0.9 && $minor < 3)) {
print <<EOM;
*** That's too old!
Please upgrade OpenSSL to the latest version (http://www.openssl.org/)
EOM
exit 0; # according http://wiki.cpantesters.org/wiki/CPANAuthorNotes this is best-practice when "missing library"
}
if ($major == 1.1 && $minor > 0) {
print <<EOM;
*** That's newer than what this module was tested with
You should consider checking if there is a newer release of this module
available. Everything will probably work OK, though.
EOM
}
}
sub fixpath {
my ($self, $text) = @_;
my $sep = File::Spec->catdir('');
$text =~ s{\b/}{$sep}g;
return $text;
}
1;
| 33.103203 | 122 | 0.536551 |
73febd4dae74fa0324a61cc752116600e448d247 | 20,623 | pm | Perl | lib/Lemplate/Directive.pm | openresty/lemplate | 5335fcf49138a53aa73c65a9158a021e3029e1d3 | [
"Condor-1.1",
"Naumen",
"Xnet",
"Net-SNMP",
"X11",
"MS-PL"
] | 93 | 2016-01-09T06:49:41.000Z | 2021-06-14T13:54:47.000Z | lib/Lemplate/Directive.pm | openresty/lemplate | 5335fcf49138a53aa73c65a9158a021e3029e1d3 | [
"Condor-1.1",
"Naumen",
"Xnet",
"Net-SNMP",
"X11",
"MS-PL"
] | 9 | 2017-04-06T21:30:25.000Z | 2017-11-29T07:13:49.000Z | lib/Lemplate/Directive.pm | openresty/lemplate | 5335fcf49138a53aa73c65a9158a021e3029e1d3 | [
"Condor-1.1",
"Naumen",
"Xnet",
"Net-SNMP",
"X11",
"MS-PL"
] | 18 | 2016-01-18T02:51:06.000Z | 2019-11-05T09:19:27.000Z | package Lemplate::Directive;
use strict;
use warnings;
our $VERSION = '0.15';
our $OUTPUT = 'i = i + 1 output[i] =';
our $WHILE_MAX = 1000;
# parser state variable
# only true when inside JAVASCRIPT blocks
our $INJAVASCRIPT = 0;
sub new {
my $class = shift;
return bless {}, $class
}
sub template {
my ($class, $block) = @_;
return "function() return '' end" unless $block =~ /\S/;
return <<"...";
function (context)
if not context then
return error("Lemplate function called without context\\n")
end
local stash = context.stash
local output = {}
local i = 0
$block
return output
end
...
}
# Try to do 1 .. 10 expansions
sub _attempt_range_expand_val ($) {
my $val = shift;
return $val unless
my ( $from, $to ) = $val =~ m/\s*\[\s*(\S+)\s*\.\.\s*(\S+)\s*\]/;
die "Range expansion is current supported for positive/negative integer values only (e.g. [ 1 .. 10 ])\nCannot expand: $val" unless $from =~ m/^-?\d+$/ && $to =~ m/^-?\d+$/;
return join '', '[', join( ',', $from .. $to ), ']';
}
#------------------------------------------------------------------------
# textblock($text)
#------------------------------------------------------------------------
sub textblock {
my ($class, $text) = @_;
return $text if $INJAVASCRIPT;
return "$OUTPUT " . $class->text($text);
}
#------------------------------------------------------------------------
# text($text)
#------------------------------------------------------------------------
sub text {
my ($class, $text) = @_;
for ($text) {
s/([\'\\])/\\$1/g;
s/\n/\\n/g;
s/\r/\\r/g;
}
return "'" . $text . "'";
}
#------------------------------------------------------------------------
# ident(\@ident) foo.bar(baz)
#------------------------------------------------------------------------
sub ident {
my ($class, $ident) = @_;
return "''" unless @$ident;
my $ns;
# does the first element of the identifier have a NAMESPACE
# handler defined?
if (ref $class && @$ident > 2 && ($ns = $class->{ NAMESPACE })) {
my $key = $ident->[0];
$key =~ s/^'(.+)'$/$1/s;
if ($ns = $ns->{ $key }) {
return $ns->ident($ident);
}
}
if (scalar @$ident <= 2 && ! $ident->[1]) {
$ident = $ident->[0];
}
else {
$ident = '{' . join(', ', @$ident) . '}';
}
return "stash_get(stash, $ident)";
}
#------------------------------------------------------------------------
# assign(\@ident, $value, $default) foo = bar
#------------------------------------------------------------------------
sub assign {
my ($class, $var, $val, $default) = @_;
if (ref $var) {
if (scalar @$var == 2 && ! $var->[1]) {
$var = $var->[0];
}
else {
$var = '{' . join(', ', @$var) . '}';
}
}
$val = _attempt_range_expand_val $val;
$val .= ', 1' if $default;
return "stash_set(stash, $var, $val)";
}
#------------------------------------------------------------------------
# args(\@args) foo, bar, baz = qux
#------------------------------------------------------------------------
sub args {
my ($class, $args) = @_;
my $hash = shift @$args;
push(@$args, '{ ' . join(', ', @$hash) . ' }')
if @$hash;
return '{}' unless @$args;
return '{ ' . join(', ', @$args) . ' }';
}
#------------------------------------------------------------------------
# filenames(\@names)
#------------------------------------------------------------------------
sub filenames {
my ($class, $names) = @_;
if (@$names > 1) {
$names = '[ ' . join(', ', @$names) . ' ]';
}
else {
$names = shift @$names;
}
return $names;
}
#------------------------------------------------------------------------
# get($expr) [% foo %]
#------------------------------------------------------------------------
sub get {
my ($class, $expr) = @_;
return "$OUTPUT $expr";
}
sub block {
my ($class, $block) = @_;
return join "\n", map {
s/^#(?=line \d+)/-- /gm;
$_;
} @{ $block || [] };
}
#------------------------------------------------------------------------
# call($expr) [% CALL bar %]
#------------------------------------------------------------------------
sub call {
my ($class, $expr) = @_;
$expr .= ';';
return $expr;
}
#------------------------------------------------------------------------
# set(\@setlist) [% foo = bar, baz = qux %]
#------------------------------------------------------------------------
sub set {
my ($class, $setlist) = @_;
my $output;
while (my ($var, $val) = splice(@$setlist, 0, 2)) {
$output .= $class->assign($var, $val) . ";\n";
}
chomp $output;
return $output;
}
#------------------------------------------------------------------------
# default(\@setlist) [% DEFAULT foo = bar, baz = qux %]
#------------------------------------------------------------------------
sub default {
my ($class, $setlist) = @_;
my $output;
while (my ($var, $val) = splice(@$setlist, 0, 2)) {
$output .= &assign($class, $var, $val, 1) . ";\n";
}
chomp $output;
return $output;
}
#------------------------------------------------------------------------
# include(\@nameargs) [% INCLUDE template foo = bar %]
# # => [ [ $file, ... ], \@args ]
#------------------------------------------------------------------------
sub include {
my ($class, $nameargs) = @_;
my ($file, $args) = @$nameargs;
my $hash = shift @$args;
$file = $class->filenames($file);
(my $raw_file = $file) =~ s/^'|'$//g;
$Lemplate::ExtraTemplates{$raw_file} = 1;
my $file2 = "'$Lemplate::TemplateName/$raw_file'";
my $str_args = (@$hash ? ', { ' . join(', ', @$hash) . ' }' : '');
return "$OUTPUT context.include(context, template_map['$Lemplate::TemplateName/$raw_file'] and $file2 or $file$str_args)";
}
#------------------------------------------------------------------------
# process(\@nameargs) [% PROCESS template foo = bar %]
# # => [ [ $file, ... ], \@args ]
#------------------------------------------------------------------------
sub process {
my ($class, $nameargs) = @_;
my ($file, $args) = @$nameargs;
my $hash = shift @$args;
$file = $class->filenames($file);
(my $raw_file = $file) =~ s/^'|'$//g;
$Lemplate::ExtraTemplates{$raw_file} = 1;
$file .= @$hash ? ', { ' . join(', ', @$hash) . ' }' : '';
return "$OUTPUT context.process(context, $file)";
}
#------------------------------------------------------------------------
# if($expr, $block, $else) [% IF foo < bar %]
# ...
# [% ELSE %]
# ...
# [% END %]
#------------------------------------------------------------------------
sub if {
my ($class, $expr, $block, $else) = @_;
my @else = $else ? @$else : ();
$else = pop @else;
my $output = "if tt2_true($expr) then\n$block\n";
foreach my $elsif (@else) {
($expr, $block) = @$elsif;
$output .= "elseif tt2_true($expr) then\n$block\n";
}
if (defined $else) {
$output .= "else\n$else\nend\n";
} else {
$output .= "end\n";
}
return $output;
}
#------------------------------------------------------------------------
# foreach($target, $list, $args, $block) [% FOREACH x = [ foo bar ] %]
# ...
# [% END %]
#------------------------------------------------------------------------
sub foreach {
my ($class, $target, $list, $args, $block) = @_;
$args = shift @$args;
$args = @$args ? ', { ' . join(', ', @$args) . ' }' : '';
my ($loop_save, $loop_set, $loop_restore, $setiter);
if ($target) {
$loop_save =
'local oldloop = ' . $class->ident(["'loop'"]);
$loop_set = "stash['$target'] = value";
$loop_restore = "stash_set(stash, 'loop', oldloop)";
}
else {
die "XXX - Not supported yet";
$loop_save = 'stash = context.localise()';
$loop_set =
"stash.get(['import', [value]]) if typeof(value) == 'object'";
$loop_restore = 'stash = context.delocalise()';
}
$list = _attempt_range_expand_val $list;
return <<EOF;
-- FOREACH
do
local list = $list
local iterator
if list.list then
iterator = list
list = list.list
end
$loop_save
local count
if not iterator then
count = table_maxn(list)
iterator = { count = 1, max = count - 1, index = 0, size = count, first = true, last = false, prev = "" }
else
count = iterator.size
end
stash.loop = iterator
for idx, value in ipairs(list) do
if idx == count then
iterator.last = true
end
iterator.index = idx - 1
iterator.count = idx
iterator.next = list[idx + 1]
$loop_set
$block
iterator.first = false
iterator.prev = value
end
$loop_restore
end
EOF
}
#------------------------------------------------------------------------
# next() [% NEXT %]
#
# Next iteration of a FOREACH loop (experimental)
#------------------------------------------------------------------------
sub next {
return <<EOF;
return error("NEXT not implemented yet")
EOF
}
#------------------------------------------------------------------------
# wrapper(\@nameargs, $block) [% WRAPPER template foo = bar %]
# # => [ [$file,...], \@args ]
#------------------------------------------------------------------------
sub wrapper {
my ($class, $nameargs, $block) = @_;
my ($file, $args) = @$nameargs;
my $hash = shift @$args;
s/ => /: / for @$hash;
return $class->multi_wrapper($file, $hash, $block)
if @$file > 1;
$file = shift @$file;
push(@$hash, "'content': output");
$file .= @$hash ? ', { ' . join(', ', @$hash) . ' }' : '';
return <<EOF;
// WRAPPER
$OUTPUT (function() {
var output = '';
$block;
return context.include($file);
})();
EOF
}
sub multi_wrapper {
my ($class, $file, $hash, $block) = @_;
push(@$hash, "'content': output");
$hash = @$hash ? ', { ' . join(', ', @$hash) . ' }' : '';
$file = join(', ', reverse @$file);
# print STDERR "multi wrapper: $file\n";
return <<EOF;
// WRAPPER
$OUTPUT (function() {
var output = '';
$block;
var files = new Array($file);
for (var i = 0; i < files.length; i++) {
output = context.include(files[i]$hash);
}
return output;
})();
EOF
}
#------------------------------------------------------------------------
# while($expr, $block) [% WHILE x < 10 %]
# ...
# [% END %]
#------------------------------------------------------------------------
sub while {
my ($class, $expr, $block) = @_;
return <<EOF;
-- WHILE
do
local failsafe = $WHILE_MAX;
while $expr do
failsafe = failsafe - 1
if failsafe <= 0 then
break
end
$block
end
if not failsafe then
return error("WHILE loop terminated (> $WHILE_MAX iterations)\\n")
end
end
EOF
}
#------------------------------------------------------------------------
# javascript($script) [% JAVASCRIPT %]
# ...
# [% END %]
#------------------------------------------------------------------------
sub javascript {
my ( $class, $javascript ) = @_;
return $javascript;
}
sub no_javascript {
my ( $class ) = @_;
die "EVAL_JAVASCRIPT has not been enabled, cannot process [% JAVASCRIPT %] blocks";
}
#------------------------------------------------------------------------
# switch($expr, \@case) [% SWITCH %]
# [% CASE foo %]
# ...
# [% END %]
#------------------------------------------------------------------------
sub switch {
my ($class, $expr, $case) = @_;
my @case = @$case;
my ($match, $block, $default);
my $caseblock = '';
$default = pop @case;
foreach $case (@case) {
$match = $case->[0];
$block = $case->[1];
# $block = pad($block, 1) if $PRETTY;
$caseblock .= <<EOF;
case $match:
$block
break;
EOF
}
if (defined $default) {
$caseblock .= <<EOF;
default:
$default
break;
EOF
}
# $caseblock = pad($caseblock, 2) if $PRETTY;
return <<EOF;
switch($expr) {
$caseblock
}
EOF
}
#------------------------------------------------------------------------
# throw(\@nameargs) [% THROW foo "bar error" %]
# # => [ [$type], \@args ]
#------------------------------------------------------------------------
sub throw {
my ($class, $nameargs) = @_;
my ($type, $args) = @$nameargs;
my $hash = shift(@$args);
my $info = shift(@$args);
$type = shift @$type;
return qq{return error({$type, $info})};
}
#------------------------------------------------------------------------
# clear() [% CLEAR %]
#
# NOTE: this is redundant, being hard-coded (for now) into Parser.yp
#------------------------------------------------------------------------
sub clear {
return "output = {}";
}
#------------------------------------------------------------------------
# break() [% BREAK %]
#
# NOTE: this is redundant, being hard-coded (for now) into Parser.yp
#------------------------------------------------------------------------
sub break {
return 'break';
}
#------------------------------------------------------------------------
# return() [% RETURN %]
#------------------------------------------------------------------------
sub return {
return "return output"
}
#------------------------------------------------------------------------
# stop() [% STOP %]
#------------------------------------------------------------------------
sub stop {
return "return error('Lemplate.STOP\\n' .. concat(output))";
}
#------------------------------------------------------------------------
# use(\@lnameargs) [% USE alias = plugin(args) %]
# # => [ [$file, ...], \@args, $alias ]
#------------------------------------------------------------------------
sub use {
my ($class, $lnameargs) = @_;
my ($file, $args, $alias) = @$lnameargs;
$file = shift @$file; # same production rule as INCLUDE
$alias ||= $file;
$args = &args($class, $args);
$file .= ", $args" if $args;
return "-- USE\n"
. "stash_set(stash, $alias, context.plugin(context, $file))";
}
#------------------------------------------------------------------------
# raw(\@lnameargs) [% RAW alias = plugin(args) %]
# # => [ [$file, ...], \@args, $alias ]
#------------------------------------------------------------------------
sub raw {
my ($class, $lnameargs) = @_;
my ($file, $args, $alias) = @$lnameargs;
$file = shift @$file; # same production rule as INCLUDE
$alias ||= $file;
$args = &args($class, $args);
# $file .= ", $args" if $args;
$file =~ s/'|"//g;
return "// RAW\n"
. "stash_set(stash, $alias, $file)";
}
#------------------------------------------------------------------------
# stubs() [% STOP %]
#------------------------------------------------------------------------
sub filter {
my ($class, $lnameargs, $block) = @_;
my ($name, $args, $alias) = @$lnameargs;
$name = shift @$name;
$args = &args($class, $args);
$args = $args ? "$args, $alias" : ", null, $alias"
if $alias;
$name .= ", $args" if $args;
return <<EOF;
-- FILTER
local value
do
local output = {}
local i = 0
$block
value = context.filter(output, $name)
end
$OUTPUT value
EOF
}
sub quoted {
my $class = shift;
if ( @_ && ref($_[0]) ) {
return join( " .. ", @{$_[0]} );
}
return "return error('QUOTED called with unknown arguments in Lemplate')";
}
#------------------------------------------------------------------------
# macro($name, $block, \@args)
#------------------------------------------------------------------------
sub macro {
my ($class, $ident, $block, $args) = @_;
if ($args) {
$args = join(';', map { "args['$_'] = fargs.shift()" } @$args);
return <<EOF;
//MACRO
stash.set('$ident', function () {
var output = '';
var args = {};
var fargs = Array.prototype.slice.call(arguments);
$args;
args.arguments = Array.prototype.slice.call(arguments);
var params = fargs.shift() || {};
for (var key in params) {
args[key] = params[key];
}
context.stash.clone(args);
try {
$block
}
catch(e) {
var error = context.set_error(e, output);
throw(error);
}
context.stash.declone();
return output;
});
EOF
}
else {
return <<EOF;
//MACRO
stash.set('$ident', function () {
var output = '';
var args = {};
var fargs = Array.prototype.slice.call(arguments);
args.arguments = Array.prototype.slice.call(arguments);
if (typeof arguments[0] == 'object') args = arguments[0];
context.stash.clone(args);
try {
$block
}
catch(e) {
var error = context.set_error(e, output);
throw(error);
}
context.stash.declone();
return output;});
EOF
}
}
sub capture {
my ($class, $name, $block) = @_;
if (ref $name) {
if (scalar @$name == 2 && ! $name->[1]) {
$name = $name->[0];
}
else {
$name = '[' . join(', ', @$name) . ']';
}
}
return <<EOF;
// CAPTURE
(function() {
var output = '';
$block
stash.set($name, output);
})();
EOF
}
BEGIN {
return; # Comment out this line to get callback traces
no strict 'refs';
my $pkg = __PACKAGE__ . '::';
my $stash = \ %$pkg;
use strict 'refs';
for my $name (keys %$stash) {
my $glob = $stash->{$name};
if (*$glob{CODE}) {
my $code = *$glob{CODE};
no warnings 'redefine';
$stash->{$name} = sub {
warn "Calling $name(@_)\n";
&$code(@_);
};
}
}
}
1;
__END__
=encoding UTF-8
=head1 NAME
Lemplate::Directive - Lemplate Code Generating Backend
=head1 SYNOPSIS
use Lemplate::Directive;
=head1 DESCRIPTION
Lemplate::Directive is the analog to Template::Directive, which is the
module that produces that actual code that templates turn into. The
Lemplate version obviously produces Lua code rather than Perl.
Other than that the two modules are almost exactly the same.
=head1 BUGS
Unfortunately, some of the code generation seems to happen before
Lemplate::Directive gets control. So it currently has heuristical code
to rejigger Perl code snippets into Lua. This processing needs to
happen upstream once I get more clarity on how Template::Toolkit works.
=head1 AUTHOR
Ingy döt Net <ingy@cpan.org>
=head1 COPYRIGHT
Copyright (c) 2016. Yichun Zhang (agentzh). All rights reserved.
Copyright (c) 2006-2014. Ingy döt Net. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
See L<http://www.perl.com/perl/misc/Artistic.html>
=cut
| 26.372123 | 177 | 0.378849 |
ed54184c0e6b1ccca78778014bcc817759452adf | 2,646 | pm | Perl | perl/vendor/lib/CPANPLUS/Shell/Default/Plugins/Source.pm | ifleeyo180/VspriteMoodleWebsite | 38baa924829c83808d2c87d44740ff365927a646 | [
"Apache-2.0"
] | 2 | 2021-11-19T22:37:28.000Z | 2021-11-22T18:04:55.000Z | perl/vendor/lib/CPANPLUS/Shell/Default/Plugins/Source.pm | ifleeyo180/VspriteMoodleWebsite | 38baa924829c83808d2c87d44740ff365927a646 | [
"Apache-2.0"
] | 6 | 2021-11-18T00:39:48.000Z | 2021-11-20T00:31:40.000Z | perl/vendor/lib/CPANPLUS/Shell/Default/Plugins/Source.pm | ifleeyo180/VspriteMoodleWebsite | 38baa924829c83808d2c87d44740ff365927a646 | [
"Apache-2.0"
] | null | null | null | package CPANPLUS::Shell::Default::Plugins::Source;
use strict;
use CPANPLUS::Error qw[error msg];
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
use vars qw[$VERSION];
$VERSION = "0.9910";
=head1 NAME
CPANPLUS::Shell::Default::Plugins::Source - read in CPANPLUS commands
=head1 SYNOPSIS
CPAN Terminal> /source /tmp/list_of_commands /tmp/more_commands
=head1 DESCRIPTION
This is a C<CPANPLUS::Shell::Default> plugin that works just like
your unix shells source(1) command; it reads in a file that has
commands in it to execute, and then executes them.
A sample file might look like this:
# first, update all the source files
x --update_source
# find all of my modules that are on the CPAN
# test them, and store the error log
a ^KANE$'
t *
p /home/kane/cpan-autotest/log
# and inform us we're good to go
! print "Autotest complete, log stored; please enter your commands!"
Note how empty lines, and lines starting with a '#' are being skipped
in the execution.
=cut
sub plugins { return ( source => 'source' ) }
sub source {
my $class = shift;
my $shell = shift;
my $cb = shift;
my $cmd = shift;
my $input = shift || '';
my $opts = shift || {};
my $verbose = $cb->configure_object->get_conf('verbose');
for my $file ( split /\s+/, $input ) {
my $fh = FileHandle->new("$file") or(
error(loc("Could not open file '%1': %2", $file, $!)),
next
);
while( my $line = <$fh> ) {
chomp $line;
next if $line !~ /\S+/; # skip empty/whitespace only lines
next if $line =~ /^#/; # skip comments
msg(loc("Dispatching '%1'", $line), $verbose);
return 1 if $shell->dispatch_on_input( input => $line );
}
}
}
sub source_help {
return loc(' /source FILE [FILE ..] '.
'# read in commands from the specified file' ),
}
1;
=pod
=head1 BUG REPORTS
Please report bugs or other issues to E<lt>bug-cpanplus@rt.cpan.org<gt>.
=head1 AUTHOR
This module by Jos Boumans E<lt>kane@cpan.orgE<gt>.
=head1 COPYRIGHT
The CPAN++ interface (of which this module is a part of) is copyright (c)
2001 - 2007, Jos Boumans E<lt>kane@cpan.orgE<gt>. All rights reserved.
This library is free software; you may redistribute and/or modify it
under the same terms as Perl itself.
=head1 SEE ALSO
L<CPANPLUS::Shell::Default>, L<CPANPLUS::Shell>, L<cpanp>
=cut
# Local variables:
# c-indentation-style: bsd
# c-basic-offset: 4
# indent-tabs-mode: nil
# End:
# vim: expandtab shiftwidth=4:
| 23.837838 | 73 | 0.629252 |
ed820622759169d871b2e1a1436e09d44293dabe | 2,706 | pm | Perl | lib/Dancer2/Logger/Multiplex.pm | atancasis/Dancer2-Logger-Multiplex | 917441732b78f4a288fca093c1df83acc91aac96 | [
"Artistic-1.0"
] | null | null | null | lib/Dancer2/Logger/Multiplex.pm | atancasis/Dancer2-Logger-Multiplex | 917441732b78f4a288fca093c1df83acc91aac96 | [
"Artistic-1.0"
] | null | null | null | lib/Dancer2/Logger/Multiplex.pm | atancasis/Dancer2-Logger-Multiplex | 917441732b78f4a288fca093c1df83acc91aac96 | [
"Artistic-1.0"
] | null | null | null | package Dancer2::Logger::Multiplex;
use strict;
use 5.008_005;
our $VERSION = '0.02';
use Moo;
use Dancer2::Core::Types;
with 'Dancer2::Core::Role::Logger';
has loggers => (
is => 'ro',
isa => ArrayRef,
);
has logging_engines => (
is => 'lazy',
);
sub _build_logging_engines {
my $self = shift;
my ($app) = grep { $_->name eq $self->app_name } @{ $Dancer2::runner->apps };
my @logging_engines = map {
$app->_factory->create(
logger => $_,
%{ $app->_get_config_for_engine( logger => $_, $app->config ) },
location => $app->config_location,
environment => $app->environment,
app_name => $app->name,
postponed_hooks => $app->postponed_hooks
)
} @{ $self->loggers };
return \@logging_engines;
}
sub log {
my ($self, $level, $message) = @_;
$_->log($level, $message) for @{ $self->logging_engines };
}
1;
__END__
=encoding utf-8
=head1 NAME
Dancer2::Logger::Multiplex - Log to multiple Dancer2::Logger engines
=head1 VERSION
version 0.02
=head1 SYNOPSIS
use Dancer2::Logger::Multiplex;
=head1 DESCRIPTION
Implements a multiplexing logger engine to dispatch logs to multiple
backend L<Dancer2::Core::Role::Logger> engines.
=head1 METHODS
=head2 log($level, $message)
Writes the log message to multiple logger engines.
=head1 CONFIGURATION
The setting B<logger> should be set to C<Multiplex> in order to use this
logging engine in a Dancer2 application.
Below is a sample configuration:
logger: "Multiplex"
engines:
logger:
Multiplex:
loggers:
- Console
- File
- Fluent
File:
log_dir: "/var/log/myapp"
file_name: "myapp.log"
Fluent:
tag_prefix: "myapp"
host: "127.0.0.1"
port: 24224
Allowed options are as follows:
=over 4
=item loggers
Specifies the list of L<Dancer2::Core::Role::Logger> backend engines to
dispatch log messages to.
Each logger engine will be initialized with their corresponding
configurations. As such, in the example above, L<Dancer2::Logger::File>
will be initialized with settings for I<log_dir> and I<file_name>, while
L<Dancer2::Logger::Fluent> will be initialized with settings for
I<tag_prefix>, I<host>, and I<port> as specified in the sample configuration.
=back
=head1 AUTHOR
Arnold Tan Casis E<lt>atancasis@cpan.orgE<gt>
=head1 COPYRIGHT
Copyright 2017- Arnold Tan Casis
=head1 LICENSE
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
=head1 SEE ALSO
See L<Dancer2> for details about logging in route handlers.
=cut
| 20.656489 | 81 | 0.656689 |
ed4b97dfafb9d54ace72eaa761998e4e01ee9cad | 1,751 | pl | Perl | probs/SYJ/SYJ211+1.008.pl | ptarau/TypesAndProofs | ca9e4347d3dabb3531d38bdef6aafaa41a30555d | [
"Apache-2.0"
] | 25 | 2018-07-19T00:08:18.000Z | 2022-02-08T23:07:12.000Z | probs/SYJ/SYJ211+1.008.pl | ptarau/TypesAndProofs | ca9e4347d3dabb3531d38bdef6aafaa41a30555d | [
"Apache-2.0"
] | null | null | null | probs/SYJ/SYJ211+1.008.pl | ptarau/TypesAndProofs | ca9e4347d3dabb3531d38bdef6aafaa41a30555d | [
"Apache-2.0"
] | 4 | 2019-01-12T17:02:14.000Z | 2021-11-23T08:16:09.000Z | %--------------------------------------------------------------------------
% File : SYJ211+1.008 : ILTP v1.1.2
% Domain : Intuitionistic Syntactic
% Problem : Formulae of Korn & Kreitz
% Version : Especial.
% Problem formulation : Inuit. Invalid. Size 8
% English : (A & B(N) & C(N)) -> f with
% A - (a(0) -> f), B(N) - (~~b(N) -> b(0) -> a(N)),
% C(N) - (&&_{i-1..n} ((~~b(i-1) -> a(i)) -> a(i-1))),
% Refs : [Dyc97] Roy Dyckhoff. Some benchmark formulas for
% intuitionistic propositional logic. At
% http://www.dcs.st-and.ac.uk/~rd/logic/marks.html
% : [KK97] D. Korn & C. Kreitz, A constructively adequate
% refutation system for intuitionistic logic,
% position paper at Tableaux'97, available at
% http://www.cs.uni-potsdam.de/ti/kreitz/PDF/
% Source : [Dyc97]
% Names : kk_n8 : Dyckhoff's benchmark formulas (1997)
%
% Status (intuit.) : Non-Theorem
% Rating (intuit.) : 0.25 v1.0.0
%
% Comments :
%--------------------------------------------------------------------------
fof(axiom1,axiom,(
( a0 -> f) )).
fof(axiom2,axiom,(
( ( ~(~(b8)) -> b0) -> a8) )).
fof(axiom3,axiom,(
( ( ~(~(b0)) -> a1) -> a0) )).
fof(axiom4,axiom,(
( ( ~(~(b1)) -> a2) -> a1) )).
fof(axiom5,axiom,(
( ( ~(~(b2)) -> a3) -> a2) )).
fof(axiom6,axiom,(
( ( ~(~(b3)) -> a4) -> a3) )).
fof(axiom7,axiom,(
( ( ~(~(b4)) -> a5) -> a4) )).
fof(axiom8,axiom,(
( ( ~(~(b5)) -> a6) -> a5) )).
fof(axiom9,axiom,(
( ( ~(~(b6)) -> a7) -> a6) )).
fof(axiom10,axiom,(
( ( ~(~(b7)) -> a8) -> a7) )).
fof(con,conjecture,(
f
)).
%--------------------------------------------------------------------------
| 28.241935 | 75 | 0.4249 |
ed680a4295222fbbf817166fde770d81a46816d3 | 35,230 | pm | Perl | lib/DateTime/TimeZone/America/Sao_Paulo.pm | Helmholtz-HIPS/prosnap | 5286cda39276d5eda85d2ddb23b8ab83c5d4960c | [
"MIT"
] | 1 | 2021-11-26T17:29:56.000Z | 2021-11-26T17:29:56.000Z | lib/DateTime/TimeZone/America/Sao_Paulo.pm | Helmholtz-HIPS/prosnap | 5286cda39276d5eda85d2ddb23b8ab83c5d4960c | [
"MIT"
] | 1 | 2020-03-19T21:12:23.000Z | 2020-03-19T21:12:23.000Z | lib/DateTime/TimeZone/America/Sao_Paulo.pm | Helmholtz-HIPS/prosnap | 5286cda39276d5eda85d2ddb23b8ab83c5d4960c | [
"MIT"
] | 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/8FT049ktOU/southamerica. Olson data version 2015d
#
# Do not edit this file directly.
#
package DateTime::TimeZone::America::Sao_Paulo;
$DateTime::TimeZone::America::Sao_Paulo::VERSION = '1.88';
use strict;
use Class::Singleton 1.03;
use DateTime::TimeZone;
use DateTime::TimeZone::OlsonDB;
@DateTime::TimeZone::America::Sao_Paulo::ISA = ( 'Class::Singleton', 'DateTime::TimeZone' );
my $spans =
[
[
DateTime::TimeZone::NEG_INFINITY, # utc_start
60368468788, # utc_end 1914-01-01 03:06:28 (Thu)
DateTime::TimeZone::NEG_INFINITY, # local_start
60368457600, # local_end 1914-01-01 00:00:00 (Thu)
-11188,
0,
'LMT',
],
[
60368468788, # utc_start 1914-01-01 03:06:28 (Thu)
60928725600, # utc_end 1931-10-03 14:00:00 (Sat)
60368457988, # local_start 1914-01-01 00:06:28 (Thu)
60928714800, # local_end 1931-10-03 11:00:00 (Sat)
-10800,
0,
'BRT',
],
[
60928725600, # utc_start 1931-10-03 14:00:00 (Sat)
60944320800, # utc_end 1932-04-01 02:00:00 (Fri)
60928718400, # local_start 1931-10-03 12:00:00 (Sat)
60944313600, # local_end 1932-04-01 00:00:00 (Fri)
-7200,
1,
'BRST',
],
[
60944320800, # utc_start 1932-04-01 02:00:00 (Fri)
60960308400, # utc_end 1932-10-03 03:00:00 (Mon)
60944310000, # local_start 1932-03-31 23:00:00 (Thu)
60960297600, # local_end 1932-10-03 00:00:00 (Mon)
-10800,
0,
'BRT',
],
[
60960308400, # utc_start 1932-10-03 03:00:00 (Mon)
60975856800, # utc_end 1933-04-01 02:00:00 (Sat)
60960301200, # local_start 1932-10-03 01:00:00 (Mon)
60975849600, # local_end 1933-04-01 00:00:00 (Sat)
-7200,
1,
'BRST',
],
[
60975856800, # utc_start 1933-04-01 02:00:00 (Sat)
61501863600, # utc_end 1949-12-01 03:00:00 (Thu)
60975846000, # local_start 1933-03-31 23:00:00 (Fri)
61501852800, # local_end 1949-12-01 00:00:00 (Thu)
-10800,
0,
'BRT',
],
[
61501863600, # utc_start 1949-12-01 03:00:00 (Thu)
61513614000, # utc_end 1950-04-16 03:00:00 (Sun)
61501856400, # local_start 1949-12-01 01:00:00 (Thu)
61513606800, # local_end 1950-04-16 01:00:00 (Sun)
-7200,
1,
'BRST',
],
[
61513614000, # utc_start 1950-04-16 03:00:00 (Sun)
61533399600, # utc_end 1950-12-01 03:00:00 (Fri)
61513603200, # local_start 1950-04-16 00:00:00 (Sun)
61533388800, # local_end 1950-12-01 00:00:00 (Fri)
-10800,
0,
'BRT',
],
[
61533399600, # utc_start 1950-12-01 03:00:00 (Fri)
61543850400, # utc_end 1951-04-01 02:00:00 (Sun)
61533392400, # local_start 1950-12-01 01:00:00 (Fri)
61543843200, # local_end 1951-04-01 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
61543850400, # utc_start 1951-04-01 02:00:00 (Sun)
61564935600, # utc_end 1951-12-01 03:00:00 (Sat)
61543839600, # local_start 1951-03-31 23:00:00 (Sat)
61564924800, # local_end 1951-12-01 00:00:00 (Sat)
-10800,
0,
'BRT',
],
[
61564935600, # utc_start 1951-12-01 03:00:00 (Sat)
61575472800, # utc_end 1952-04-01 02:00:00 (Tue)
61564928400, # local_start 1951-12-01 01:00:00 (Sat)
61575465600, # local_end 1952-04-01 00:00:00 (Tue)
-7200,
1,
'BRST',
],
[
61575472800, # utc_start 1952-04-01 02:00:00 (Tue)
61596558000, # utc_end 1952-12-01 03:00:00 (Mon)
61575462000, # local_start 1952-03-31 23:00:00 (Mon)
61596547200, # local_end 1952-12-01 00:00:00 (Mon)
-10800,
0,
'BRT',
],
[
61596558000, # utc_start 1952-12-01 03:00:00 (Mon)
61604330400, # utc_end 1953-03-01 02:00:00 (Sun)
61596550800, # local_start 1952-12-01 01:00:00 (Mon)
61604323200, # local_end 1953-03-01 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
61604330400, # utc_start 1953-03-01 02:00:00 (Sun)
61940257200, # utc_end 1963-10-23 03:00:00 (Wed)
61604319600, # local_start 1953-02-28 23:00:00 (Sat)
61940246400, # local_end 1963-10-23 00:00:00 (Wed)
-10800,
0,
'BRT',
],
[
61940257200, # utc_start 1963-10-23 03:00:00 (Wed)
61946301600, # utc_end 1964-01-01 02:00:00 (Wed)
61940250000, # local_start 1963-10-23 01:00:00 (Wed)
61946294400, # local_end 1964-01-01 00:00:00 (Wed)
-7200,
1,
'BRST',
],
[
61946301600, # utc_start 1964-01-01 02:00:00 (Wed)
61951485600, # utc_end 1964-03-01 02:00:00 (Sun)
61946294400, # local_start 1964-01-01 00:00:00 (Wed)
61951478400, # local_end 1964-03-01 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
61951485600, # utc_start 1964-03-01 02:00:00 (Sun)
61980519600, # utc_end 1965-01-31 03:00:00 (Sun)
61951474800, # local_start 1964-02-29 23:00:00 (Sat)
61980508800, # local_end 1965-01-31 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
61980519600, # utc_start 1965-01-31 03:00:00 (Sun)
61985613600, # utc_end 1965-03-31 02:00:00 (Wed)
61980512400, # local_start 1965-01-31 01:00:00 (Sun)
61985606400, # local_end 1965-03-31 00:00:00 (Wed)
-7200,
1,
'BRST',
],
[
61985613600, # utc_start 1965-03-31 02:00:00 (Wed)
62006785200, # utc_end 1965-12-01 03:00:00 (Wed)
61985602800, # local_start 1965-03-30 23:00:00 (Tue)
62006774400, # local_end 1965-12-01 00:00:00 (Wed)
-10800,
0,
'BRT',
],
[
62006785200, # utc_start 1965-12-01 03:00:00 (Wed)
62014557600, # utc_end 1966-03-01 02:00:00 (Tue)
62006778000, # local_start 1965-12-01 01:00:00 (Wed)
62014550400, # local_end 1966-03-01 00:00:00 (Tue)
-7200,
1,
'BRST',
],
[
62014557600, # utc_start 1966-03-01 02:00:00 (Tue)
62035729200, # utc_end 1966-11-01 03:00:00 (Tue)
62014546800, # local_start 1966-02-28 23:00:00 (Mon)
62035718400, # local_end 1966-11-01 00:00:00 (Tue)
-10800,
0,
'BRT',
],
[
62035729200, # utc_start 1966-11-01 03:00:00 (Tue)
62046093600, # utc_end 1967-03-01 02:00:00 (Wed)
62035722000, # local_start 1966-11-01 01:00:00 (Tue)
62046086400, # local_end 1967-03-01 00:00:00 (Wed)
-7200,
1,
'BRST',
],
[
62046093600, # utc_start 1967-03-01 02:00:00 (Wed)
62067265200, # utc_end 1967-11-01 03:00:00 (Wed)
62046082800, # local_start 1967-02-28 23:00:00 (Tue)
62067254400, # local_end 1967-11-01 00:00:00 (Wed)
-10800,
0,
'BRT',
],
[
62067265200, # utc_start 1967-11-01 03:00:00 (Wed)
62077716000, # utc_end 1968-03-01 02:00:00 (Fri)
62067258000, # local_start 1967-11-01 01:00:00 (Wed)
62077708800, # local_end 1968-03-01 00:00:00 (Fri)
-7200,
1,
'BRST',
],
[
62077716000, # utc_start 1968-03-01 02:00:00 (Fri)
62635431600, # utc_end 1985-11-02 03:00:00 (Sat)
62077705200, # local_start 1968-02-29 23:00:00 (Thu)
62635420800, # local_end 1985-11-02 00:00:00 (Sat)
-10800,
0,
'BRT',
],
[
62635431600, # utc_start 1985-11-02 03:00:00 (Sat)
62646919200, # utc_end 1986-03-15 02:00:00 (Sat)
62635424400, # local_start 1985-11-02 01:00:00 (Sat)
62646912000, # local_end 1986-03-15 00:00:00 (Sat)
-7200,
1,
'BRST',
],
[
62646919200, # utc_start 1986-03-15 02:00:00 (Sat)
62666276400, # utc_end 1986-10-25 03:00:00 (Sat)
62646908400, # local_start 1986-03-14 23:00:00 (Fri)
62666265600, # local_end 1986-10-25 00:00:00 (Sat)
-10800,
0,
'BRT',
],
[
62666276400, # utc_start 1986-10-25 03:00:00 (Sat)
62675949600, # utc_end 1987-02-14 02:00:00 (Sat)
62666269200, # local_start 1986-10-25 01:00:00 (Sat)
62675942400, # local_end 1987-02-14 00:00:00 (Sat)
-7200,
1,
'BRST',
],
[
62675949600, # utc_start 1987-02-14 02:00:00 (Sat)
62697812400, # utc_end 1987-10-25 03:00:00 (Sun)
62675938800, # local_start 1987-02-13 23:00:00 (Fri)
62697801600, # local_end 1987-10-25 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
62697812400, # utc_start 1987-10-25 03:00:00 (Sun)
62706880800, # utc_end 1988-02-07 02:00:00 (Sun)
62697805200, # local_start 1987-10-25 01:00:00 (Sun)
62706873600, # local_end 1988-02-07 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
62706880800, # utc_start 1988-02-07 02:00:00 (Sun)
62728657200, # utc_end 1988-10-16 03:00:00 (Sun)
62706870000, # local_start 1988-02-06 23:00:00 (Sat)
62728646400, # local_end 1988-10-16 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
62728657200, # utc_start 1988-10-16 03:00:00 (Sun)
62737725600, # utc_end 1989-01-29 02:00:00 (Sun)
62728650000, # local_start 1988-10-16 01:00:00 (Sun)
62737718400, # local_end 1989-01-29 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
62737725600, # utc_start 1989-01-29 02:00:00 (Sun)
62760106800, # utc_end 1989-10-15 03:00:00 (Sun)
62737714800, # local_start 1989-01-28 23:00:00 (Sat)
62760096000, # local_end 1989-10-15 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
62760106800, # utc_start 1989-10-15 03:00:00 (Sun)
62770384800, # utc_end 1990-02-11 02:00:00 (Sun)
62760099600, # local_start 1989-10-15 01:00:00 (Sun)
62770377600, # local_end 1990-02-11 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
62770384800, # utc_start 1990-02-11 02:00:00 (Sun)
62792161200, # utc_end 1990-10-21 03:00:00 (Sun)
62770374000, # local_start 1990-02-10 23:00:00 (Sat)
62792150400, # local_end 1990-10-21 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
62792161200, # utc_start 1990-10-21 03:00:00 (Sun)
62802439200, # utc_end 1991-02-17 02:00:00 (Sun)
62792154000, # local_start 1990-10-21 01:00:00 (Sun)
62802432000, # local_end 1991-02-17 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
62802439200, # utc_start 1991-02-17 02:00:00 (Sun)
62823610800, # utc_end 1991-10-20 03:00:00 (Sun)
62802428400, # local_start 1991-02-16 23:00:00 (Sat)
62823600000, # local_end 1991-10-20 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
62823610800, # utc_start 1991-10-20 03:00:00 (Sun)
62833284000, # utc_end 1992-02-09 02:00:00 (Sun)
62823603600, # local_start 1991-10-20 01:00:00 (Sun)
62833276800, # local_end 1992-02-09 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
62833284000, # utc_start 1992-02-09 02:00:00 (Sun)
62855665200, # utc_end 1992-10-25 03:00:00 (Sun)
62833273200, # local_start 1992-02-08 23:00:00 (Sat)
62855654400, # local_end 1992-10-25 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
62855665200, # utc_start 1992-10-25 03:00:00 (Sun)
62864128800, # utc_end 1993-01-31 02:00:00 (Sun)
62855658000, # local_start 1992-10-25 01:00:00 (Sun)
62864121600, # local_end 1993-01-31 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
62864128800, # utc_start 1993-01-31 02:00:00 (Sun)
62886510000, # utc_end 1993-10-17 03:00:00 (Sun)
62864118000, # local_start 1993-01-30 23:00:00 (Sat)
62886499200, # local_end 1993-10-17 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
62886510000, # utc_start 1993-10-17 03:00:00 (Sun)
62897392800, # utc_end 1994-02-20 02:00:00 (Sun)
62886502800, # local_start 1993-10-17 01:00:00 (Sun)
62897385600, # local_end 1994-02-20 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
62897392800, # utc_start 1994-02-20 02:00:00 (Sun)
62917959600, # utc_end 1994-10-16 03:00:00 (Sun)
62897382000, # local_start 1994-02-19 23:00:00 (Sat)
62917948800, # local_end 1994-10-16 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
62917959600, # utc_start 1994-10-16 03:00:00 (Sun)
62928842400, # utc_end 1995-02-19 02:00:00 (Sun)
62917952400, # local_start 1994-10-16 01:00:00 (Sun)
62928835200, # local_end 1995-02-19 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
62928842400, # utc_start 1995-02-19 02:00:00 (Sun)
62949409200, # utc_end 1995-10-15 03:00:00 (Sun)
62928831600, # local_start 1995-02-18 23:00:00 (Sat)
62949398400, # local_end 1995-10-15 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
62949409200, # utc_start 1995-10-15 03:00:00 (Sun)
62959687200, # utc_end 1996-02-11 02:00:00 (Sun)
62949402000, # local_start 1995-10-15 01:00:00 (Sun)
62959680000, # local_end 1996-02-11 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
62959687200, # utc_start 1996-02-11 02:00:00 (Sun)
62980254000, # utc_end 1996-10-06 03:00:00 (Sun)
62959676400, # local_start 1996-02-10 23:00:00 (Sat)
62980243200, # local_end 1996-10-06 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
62980254000, # utc_start 1996-10-06 03:00:00 (Sun)
62991741600, # utc_end 1997-02-16 02:00:00 (Sun)
62980246800, # local_start 1996-10-06 01:00:00 (Sun)
62991734400, # local_end 1997-02-16 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
62991741600, # utc_start 1997-02-16 02:00:00 (Sun)
63011790000, # utc_end 1997-10-06 03:00:00 (Mon)
62991730800, # local_start 1997-02-15 23:00:00 (Sat)
63011779200, # local_end 1997-10-06 00:00:00 (Mon)
-10800,
0,
'BRT',
],
[
63011790000, # utc_start 1997-10-06 03:00:00 (Mon)
63024400800, # utc_end 1998-03-01 02:00:00 (Sun)
63011782800, # local_start 1997-10-06 01:00:00 (Mon)
63024393600, # local_end 1998-03-01 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63024400800, # utc_start 1998-03-01 02:00:00 (Sun)
63043758000, # utc_end 1998-10-11 03:00:00 (Sun)
63024390000, # local_start 1998-02-28 23:00:00 (Sat)
63043747200, # local_end 1998-10-11 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63043758000, # utc_start 1998-10-11 03:00:00 (Sun)
63055245600, # utc_end 1999-02-21 02:00:00 (Sun)
63043750800, # local_start 1998-10-11 01:00:00 (Sun)
63055238400, # local_end 1999-02-21 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63055245600, # utc_start 1999-02-21 02:00:00 (Sun)
63074602800, # utc_end 1999-10-03 03:00:00 (Sun)
63055234800, # local_start 1999-02-20 23:00:00 (Sat)
63074592000, # local_end 1999-10-03 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63074602800, # utc_start 1999-10-03 03:00:00 (Sun)
63087300000, # utc_end 2000-02-27 02:00:00 (Sun)
63074595600, # local_start 1999-10-03 01:00:00 (Sun)
63087292800, # local_end 2000-02-27 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63087300000, # utc_start 2000-02-27 02:00:00 (Sun)
63106657200, # utc_end 2000-10-08 03:00:00 (Sun)
63087289200, # local_start 2000-02-26 23:00:00 (Sat)
63106646400, # local_end 2000-10-08 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63106657200, # utc_start 2000-10-08 03:00:00 (Sun)
63118144800, # utc_end 2001-02-18 02:00:00 (Sun)
63106650000, # local_start 2000-10-08 01:00:00 (Sun)
63118137600, # local_end 2001-02-18 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63118144800, # utc_start 2001-02-18 02:00:00 (Sun)
63138711600, # utc_end 2001-10-14 03:00:00 (Sun)
63118134000, # local_start 2001-02-17 23:00:00 (Sat)
63138700800, # local_end 2001-10-14 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63138711600, # utc_start 2001-10-14 03:00:00 (Sun)
63149594400, # utc_end 2002-02-17 02:00:00 (Sun)
63138704400, # local_start 2001-10-14 01:00:00 (Sun)
63149587200, # local_end 2002-02-17 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63149594400, # utc_start 2002-02-17 02:00:00 (Sun)
63171975600, # utc_end 2002-11-03 03:00:00 (Sun)
63149583600, # local_start 2002-02-16 23:00:00 (Sat)
63171964800, # local_end 2002-11-03 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63171975600, # utc_start 2002-11-03 03:00:00 (Sun)
63181044000, # utc_end 2003-02-16 02:00:00 (Sun)
63171968400, # local_start 2002-11-03 01:00:00 (Sun)
63181036800, # local_end 2003-02-16 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63181044000, # utc_start 2003-02-16 02:00:00 (Sun)
63202215600, # utc_end 2003-10-19 03:00:00 (Sun)
63181033200, # local_start 2003-02-15 23:00:00 (Sat)
63202204800, # local_end 2003-10-19 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63202215600, # utc_start 2003-10-19 03:00:00 (Sun)
63212493600, # utc_end 2004-02-15 02:00:00 (Sun)
63202208400, # local_start 2003-10-19 01:00:00 (Sun)
63212486400, # local_end 2004-02-15 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63212493600, # utc_start 2004-02-15 02:00:00 (Sun)
63235047600, # utc_end 2004-11-02 03:00:00 (Tue)
63212482800, # local_start 2004-02-14 23:00:00 (Sat)
63235036800, # local_end 2004-11-02 00:00:00 (Tue)
-10800,
0,
'BRT',
],
[
63235047600, # utc_start 2004-11-02 03:00:00 (Tue)
63244548000, # utc_end 2005-02-20 02:00:00 (Sun)
63235040400, # local_start 2004-11-02 01:00:00 (Tue)
63244540800, # local_end 2005-02-20 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63244548000, # utc_start 2005-02-20 02:00:00 (Sun)
63265114800, # utc_end 2005-10-16 03:00:00 (Sun)
63244537200, # local_start 2005-02-19 23:00:00 (Sat)
63265104000, # local_end 2005-10-16 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63265114800, # utc_start 2005-10-16 03:00:00 (Sun)
63275997600, # utc_end 2006-02-19 02:00:00 (Sun)
63265107600, # local_start 2005-10-16 01:00:00 (Sun)
63275990400, # local_end 2006-02-19 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63275997600, # utc_start 2006-02-19 02:00:00 (Sun)
63298378800, # utc_end 2006-11-05 03:00:00 (Sun)
63275986800, # local_start 2006-02-18 23:00:00 (Sat)
63298368000, # local_end 2006-11-05 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63298378800, # utc_start 2006-11-05 03:00:00 (Sun)
63308052000, # utc_end 2007-02-25 02:00:00 (Sun)
63298371600, # local_start 2006-11-05 01:00:00 (Sun)
63308044800, # local_end 2007-02-25 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63308052000, # utc_start 2007-02-25 02:00:00 (Sun)
63328014000, # utc_end 2007-10-14 03:00:00 (Sun)
63308041200, # local_start 2007-02-24 23:00:00 (Sat)
63328003200, # local_end 2007-10-14 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63328014000, # utc_start 2007-10-14 03:00:00 (Sun)
63338896800, # utc_end 2008-02-17 02:00:00 (Sun)
63328006800, # local_start 2007-10-14 01:00:00 (Sun)
63338889600, # local_end 2008-02-17 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63338896800, # utc_start 2008-02-17 02:00:00 (Sun)
63360068400, # utc_end 2008-10-19 03:00:00 (Sun)
63338886000, # local_start 2008-02-16 23:00:00 (Sat)
63360057600, # local_end 2008-10-19 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63360068400, # utc_start 2008-10-19 03:00:00 (Sun)
63370346400, # utc_end 2009-02-15 02:00:00 (Sun)
63360061200, # local_start 2008-10-19 01:00:00 (Sun)
63370339200, # local_end 2009-02-15 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63370346400, # utc_start 2009-02-15 02:00:00 (Sun)
63391518000, # utc_end 2009-10-18 03:00:00 (Sun)
63370335600, # local_start 2009-02-14 23:00:00 (Sat)
63391507200, # local_end 2009-10-18 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63391518000, # utc_start 2009-10-18 03:00:00 (Sun)
63402400800, # utc_end 2010-02-21 02:00:00 (Sun)
63391510800, # local_start 2009-10-18 01:00:00 (Sun)
63402393600, # local_end 2010-02-21 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63402400800, # utc_start 2010-02-21 02:00:00 (Sun)
63422967600, # utc_end 2010-10-17 03:00:00 (Sun)
63402390000, # local_start 2010-02-20 23:00:00 (Sat)
63422956800, # local_end 2010-10-17 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63422967600, # utc_start 2010-10-17 03:00:00 (Sun)
63433850400, # utc_end 2011-02-20 02:00:00 (Sun)
63422960400, # local_start 2010-10-17 01:00:00 (Sun)
63433843200, # local_end 2011-02-20 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63433850400, # utc_start 2011-02-20 02:00:00 (Sun)
63454417200, # utc_end 2011-10-16 03:00:00 (Sun)
63433839600, # local_start 2011-02-19 23:00:00 (Sat)
63454406400, # local_end 2011-10-16 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63454417200, # utc_start 2011-10-16 03:00:00 (Sun)
63465904800, # utc_end 2012-02-26 02:00:00 (Sun)
63454410000, # local_start 2011-10-16 01:00:00 (Sun)
63465897600, # local_end 2012-02-26 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63465904800, # utc_start 2012-02-26 02:00:00 (Sun)
63486471600, # utc_end 2012-10-21 03:00:00 (Sun)
63465894000, # local_start 2012-02-25 23:00:00 (Sat)
63486460800, # local_end 2012-10-21 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63486471600, # utc_start 2012-10-21 03:00:00 (Sun)
63496749600, # utc_end 2013-02-17 02:00:00 (Sun)
63486464400, # local_start 2012-10-21 01:00:00 (Sun)
63496742400, # local_end 2013-02-17 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63496749600, # utc_start 2013-02-17 02:00:00 (Sun)
63517921200, # utc_end 2013-10-20 03:00:00 (Sun)
63496738800, # local_start 2013-02-16 23:00:00 (Sat)
63517910400, # local_end 2013-10-20 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63517921200, # utc_start 2013-10-20 03:00:00 (Sun)
63528199200, # utc_end 2014-02-16 02:00:00 (Sun)
63517914000, # local_start 2013-10-20 01:00:00 (Sun)
63528192000, # local_end 2014-02-16 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63528199200, # utc_start 2014-02-16 02:00:00 (Sun)
63549370800, # utc_end 2014-10-19 03:00:00 (Sun)
63528188400, # local_start 2014-02-15 23:00:00 (Sat)
63549360000, # local_end 2014-10-19 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63549370800, # utc_start 2014-10-19 03:00:00 (Sun)
63560253600, # utc_end 2015-02-22 02:00:00 (Sun)
63549363600, # local_start 2014-10-19 01:00:00 (Sun)
63560246400, # local_end 2015-02-22 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63560253600, # utc_start 2015-02-22 02:00:00 (Sun)
63580820400, # utc_end 2015-10-18 03:00:00 (Sun)
63560242800, # local_start 2015-02-21 23:00:00 (Sat)
63580809600, # local_end 2015-10-18 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63580820400, # utc_start 2015-10-18 03:00:00 (Sun)
63591703200, # utc_end 2016-02-21 02:00:00 (Sun)
63580813200, # local_start 2015-10-18 01:00:00 (Sun)
63591696000, # local_end 2016-02-21 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63591703200, # utc_start 2016-02-21 02:00:00 (Sun)
63612270000, # utc_end 2016-10-16 03:00:00 (Sun)
63591692400, # local_start 2016-02-20 23:00:00 (Sat)
63612259200, # local_end 2016-10-16 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63612270000, # utc_start 2016-10-16 03:00:00 (Sun)
63623152800, # utc_end 2017-02-19 02:00:00 (Sun)
63612262800, # local_start 2016-10-16 01:00:00 (Sun)
63623145600, # local_end 2017-02-19 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63623152800, # utc_start 2017-02-19 02:00:00 (Sun)
63643719600, # utc_end 2017-10-15 03:00:00 (Sun)
63623142000, # local_start 2017-02-18 23:00:00 (Sat)
63643708800, # local_end 2017-10-15 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63643719600, # utc_start 2017-10-15 03:00:00 (Sun)
63654602400, # utc_end 2018-02-18 02:00:00 (Sun)
63643712400, # local_start 2017-10-15 01:00:00 (Sun)
63654595200, # local_end 2018-02-18 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63654602400, # utc_start 2018-02-18 02:00:00 (Sun)
63675774000, # utc_end 2018-10-21 03:00:00 (Sun)
63654591600, # local_start 2018-02-17 23:00:00 (Sat)
63675763200, # local_end 2018-10-21 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63675774000, # utc_start 2018-10-21 03:00:00 (Sun)
63686052000, # utc_end 2019-02-17 02:00:00 (Sun)
63675766800, # local_start 2018-10-21 01:00:00 (Sun)
63686044800, # local_end 2019-02-17 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63686052000, # utc_start 2019-02-17 02:00:00 (Sun)
63707223600, # utc_end 2019-10-20 03:00:00 (Sun)
63686041200, # local_start 2019-02-16 23:00:00 (Sat)
63707212800, # local_end 2019-10-20 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63707223600, # utc_start 2019-10-20 03:00:00 (Sun)
63717501600, # utc_end 2020-02-16 02:00:00 (Sun)
63707216400, # local_start 2019-10-20 01:00:00 (Sun)
63717494400, # local_end 2020-02-16 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63717501600, # utc_start 2020-02-16 02:00:00 (Sun)
63738673200, # utc_end 2020-10-18 03:00:00 (Sun)
63717490800, # local_start 2020-02-15 23:00:00 (Sat)
63738662400, # local_end 2020-10-18 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63738673200, # utc_start 2020-10-18 03:00:00 (Sun)
63749556000, # utc_end 2021-02-21 02:00:00 (Sun)
63738666000, # local_start 2020-10-18 01:00:00 (Sun)
63749548800, # local_end 2021-02-21 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63749556000, # utc_start 2021-02-21 02:00:00 (Sun)
63770122800, # utc_end 2021-10-17 03:00:00 (Sun)
63749545200, # local_start 2021-02-20 23:00:00 (Sat)
63770112000, # local_end 2021-10-17 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63770122800, # utc_start 2021-10-17 03:00:00 (Sun)
63781005600, # utc_end 2022-02-20 02:00:00 (Sun)
63770115600, # local_start 2021-10-17 01:00:00 (Sun)
63780998400, # local_end 2022-02-20 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63781005600, # utc_start 2022-02-20 02:00:00 (Sun)
63801572400, # utc_end 2022-10-16 03:00:00 (Sun)
63780994800, # local_start 2022-02-19 23:00:00 (Sat)
63801561600, # local_end 2022-10-16 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63801572400, # utc_start 2022-10-16 03:00:00 (Sun)
63813060000, # utc_end 2023-02-26 02:00:00 (Sun)
63801565200, # local_start 2022-10-16 01:00:00 (Sun)
63813052800, # local_end 2023-02-26 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63813060000, # utc_start 2023-02-26 02:00:00 (Sun)
63833022000, # utc_end 2023-10-15 03:00:00 (Sun)
63813049200, # local_start 2023-02-25 23:00:00 (Sat)
63833011200, # local_end 2023-10-15 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63833022000, # utc_start 2023-10-15 03:00:00 (Sun)
63843904800, # utc_end 2024-02-18 02:00:00 (Sun)
63833014800, # local_start 2023-10-15 01:00:00 (Sun)
63843897600, # local_end 2024-02-18 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63843904800, # utc_start 2024-02-18 02:00:00 (Sun)
63865076400, # utc_end 2024-10-20 03:00:00 (Sun)
63843894000, # local_start 2024-02-17 23:00:00 (Sat)
63865065600, # local_end 2024-10-20 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63865076400, # utc_start 2024-10-20 03:00:00 (Sun)
63875354400, # utc_end 2025-02-16 02:00:00 (Sun)
63865069200, # local_start 2024-10-20 01:00:00 (Sun)
63875347200, # local_end 2025-02-16 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63875354400, # utc_start 2025-02-16 02:00:00 (Sun)
63896526000, # utc_end 2025-10-19 03:00:00 (Sun)
63875343600, # local_start 2025-02-15 23:00:00 (Sat)
63896515200, # local_end 2025-10-19 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63896526000, # utc_start 2025-10-19 03:00:00 (Sun)
63907408800, # utc_end 2026-02-22 02:00:00 (Sun)
63896518800, # local_start 2025-10-19 01:00:00 (Sun)
63907401600, # local_end 2026-02-22 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63907408800, # utc_start 2026-02-22 02:00:00 (Sun)
63927975600, # utc_end 2026-10-18 03:00:00 (Sun)
63907398000, # local_start 2026-02-21 23:00:00 (Sat)
63927964800, # local_end 2026-10-18 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63927975600, # utc_start 2026-10-18 03:00:00 (Sun)
63938858400, # utc_end 2027-02-21 02:00:00 (Sun)
63927968400, # local_start 2026-10-18 01:00:00 (Sun)
63938851200, # local_end 2027-02-21 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63938858400, # utc_start 2027-02-21 02:00:00 (Sun)
63959425200, # utc_end 2027-10-17 03:00:00 (Sun)
63938847600, # local_start 2027-02-20 23:00:00 (Sat)
63959414400, # local_end 2027-10-17 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63959425200, # utc_start 2027-10-17 03:00:00 (Sun)
63970308000, # utc_end 2028-02-20 02:00:00 (Sun)
63959418000, # local_start 2027-10-17 01:00:00 (Sun)
63970300800, # local_end 2028-02-20 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
63970308000, # utc_start 2028-02-20 02:00:00 (Sun)
63990874800, # utc_end 2028-10-15 03:00:00 (Sun)
63970297200, # local_start 2028-02-19 23:00:00 (Sat)
63990864000, # local_end 2028-10-15 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
63990874800, # utc_start 2028-10-15 03:00:00 (Sun)
64001757600, # utc_end 2029-02-18 02:00:00 (Sun)
63990867600, # local_start 2028-10-15 01:00:00 (Sun)
64001750400, # local_end 2029-02-18 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
64001757600, # utc_start 2029-02-18 02:00:00 (Sun)
64022929200, # utc_end 2029-10-21 03:00:00 (Sun)
64001746800, # local_start 2029-02-17 23:00:00 (Sat)
64022918400, # local_end 2029-10-21 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
64022929200, # utc_start 2029-10-21 03:00:00 (Sun)
64033207200, # utc_end 2030-02-17 02:00:00 (Sun)
64022922000, # local_start 2029-10-21 01:00:00 (Sun)
64033200000, # local_end 2030-02-17 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
64033207200, # utc_start 2030-02-17 02:00:00 (Sun)
64054378800, # utc_end 2030-10-20 03:00:00 (Sun)
64033196400, # local_start 2030-02-16 23:00:00 (Sat)
64054368000, # local_end 2030-10-20 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
64054378800, # utc_start 2030-10-20 03:00:00 (Sun)
64064656800, # utc_end 2031-02-16 02:00:00 (Sun)
64054371600, # local_start 2030-10-20 01:00:00 (Sun)
64064649600, # local_end 2031-02-16 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
64064656800, # utc_start 2031-02-16 02:00:00 (Sun)
64085828400, # utc_end 2031-10-19 03:00:00 (Sun)
64064646000, # local_start 2031-02-15 23:00:00 (Sat)
64085817600, # local_end 2031-10-19 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
64085828400, # utc_start 2031-10-19 03:00:00 (Sun)
64096106400, # utc_end 2032-02-15 02:00:00 (Sun)
64085821200, # local_start 2031-10-19 01:00:00 (Sun)
64096099200, # local_end 2032-02-15 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
64096106400, # utc_start 2032-02-15 02:00:00 (Sun)
64117278000, # utc_end 2032-10-17 03:00:00 (Sun)
64096095600, # local_start 2032-02-14 23:00:00 (Sat)
64117267200, # local_end 2032-10-17 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
64117278000, # utc_start 2032-10-17 03:00:00 (Sun)
64128160800, # utc_end 2033-02-20 02:00:00 (Sun)
64117270800, # local_start 2032-10-17 01:00:00 (Sun)
64128153600, # local_end 2033-02-20 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
64128160800, # utc_start 2033-02-20 02:00:00 (Sun)
64148727600, # utc_end 2033-10-16 03:00:00 (Sun)
64128150000, # local_start 2033-02-19 23:00:00 (Sat)
64148716800, # local_end 2033-10-16 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
64148727600, # utc_start 2033-10-16 03:00:00 (Sun)
64160215200, # utc_end 2034-02-26 02:00:00 (Sun)
64148720400, # local_start 2033-10-16 01:00:00 (Sun)
64160208000, # local_end 2034-02-26 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
64160215200, # utc_start 2034-02-26 02:00:00 (Sun)
64180177200, # utc_end 2034-10-15 03:00:00 (Sun)
64160204400, # local_start 2034-02-25 23:00:00 (Sat)
64180166400, # local_end 2034-10-15 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
64180177200, # utc_start 2034-10-15 03:00:00 (Sun)
64191060000, # utc_end 2035-02-18 02:00:00 (Sun)
64180170000, # local_start 2034-10-15 01:00:00 (Sun)
64191052800, # local_end 2035-02-18 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
64191060000, # utc_start 2035-02-18 02:00:00 (Sun)
64212231600, # utc_end 2035-10-21 03:00:00 (Sun)
64191049200, # local_start 2035-02-17 23:00:00 (Sat)
64212220800, # local_end 2035-10-21 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
64212231600, # utc_start 2035-10-21 03:00:00 (Sun)
64222509600, # utc_end 2036-02-17 02:00:00 (Sun)
64212224400, # local_start 2035-10-21 01:00:00 (Sun)
64222502400, # local_end 2036-02-17 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
64222509600, # utc_start 2036-02-17 02:00:00 (Sun)
64243681200, # utc_end 2036-10-19 03:00:00 (Sun)
64222498800, # local_start 2036-02-16 23:00:00 (Sat)
64243670400, # local_end 2036-10-19 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
64243681200, # utc_start 2036-10-19 03:00:00 (Sun)
64254564000, # utc_end 2037-02-22 02:00:00 (Sun)
64243674000, # local_start 2036-10-19 01:00:00 (Sun)
64254556800, # local_end 2037-02-22 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
64254564000, # utc_start 2037-02-22 02:00:00 (Sun)
64275130800, # utc_end 2037-10-18 03:00:00 (Sun)
64254553200, # local_start 2037-02-21 23:00:00 (Sat)
64275120000, # local_end 2037-10-18 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
64275130800, # utc_start 2037-10-18 03:00:00 (Sun)
64286013600, # utc_end 2038-02-21 02:00:00 (Sun)
64275123600, # local_start 2037-10-18 01:00:00 (Sun)
64286006400, # local_end 2038-02-21 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
64286013600, # utc_start 2038-02-21 02:00:00 (Sun)
64306580400, # utc_end 2038-10-17 03:00:00 (Sun)
64286002800, # local_start 2038-02-20 23:00:00 (Sat)
64306569600, # local_end 2038-10-17 00:00:00 (Sun)
-10800,
0,
'BRT',
],
[
64306580400, # utc_start 2038-10-17 03:00:00 (Sun)
64317463200, # utc_end 2039-02-20 02:00:00 (Sun)
64306573200, # local_start 2038-10-17 01:00:00 (Sun)
64317456000, # local_end 2039-02-20 00:00:00 (Sun)
-7200,
1,
'BRST',
],
[
64317463200, # utc_start 2039-02-20 02:00:00 (Sun)
64338030000, # utc_end 2039-10-16 03:00:00 (Sun)
64317452400, # local_start 2039-02-19 23:00:00 (Sat)
64338019200, # local_end 2039-10-16 00:00:00 (Sun)
-10800,
0,
'BRT',
],
];
sub olson_version {'2015d'}
sub has_dst_changes {67}
sub _max_year {2038}
sub _new_instance {
return shift->_init( @_, spans => $spans );
}
sub _last_offset { -10800 }
my $last_observance = bless( {
'format' => 'BR%sT',
'gmtoff' => '-3:00',
'local_start_datetime' => bless( {
'formatter' => undef,
'local_rd_days' => 716971,
'local_rd_secs' => 0,
'offset_modifier' => 0,
'rd_nanosecs' => 0,
'tz' => bless( {
'name' => 'floating',
'offset' => 0
}, 'DateTime::TimeZone::Floating' ),
'utc_rd_days' => 716971,
'utc_rd_secs' => 0,
'utc_year' => 1965
}, 'DateTime' ),
'offset_from_std' => 0,
'offset_from_utc' => -10800,
'until' => [],
'utc_start_datetime' => bless( {
'formatter' => undef,
'local_rd_days' => 716971,
'local_rd_secs' => 7200,
'offset_modifier' => 0,
'rd_nanosecs' => 0,
'tz' => bless( {
'name' => 'floating',
'offset' => 0
}, 'DateTime::TimeZone::Floating' ),
'utc_rd_days' => 716971,
'utc_rd_secs' => 7200,
'utc_year' => 1965
}, 'DateTime' )
}, 'DateTime::TimeZone::OlsonDB::Observance' )
;
sub _last_observance { $last_observance }
my $rules = [
bless( {
'at' => '0:00',
'from' => '2038',
'in' => 'Feb',
'letter' => '',
'name' => 'Brazil',
'offset_from_std' => 0,
'on' => 'Sun>=15',
'save' => '0',
'to' => 'max',
'type' => undef
}, 'DateTime::TimeZone::OlsonDB::Rule' ),
bless( {
'at' => '0:00',
'from' => '2008',
'in' => 'Oct',
'letter' => 'S',
'name' => 'Brazil',
'offset_from_std' => 3600,
'on' => 'Sun>=15',
'save' => '1:00',
'to' => 'max',
'type' => undef
}, 'DateTime::TimeZone::OlsonDB::Rule' )
]
;
sub _rules { $rules }
1;
| 27.037606 | 92 | 0.631791 |
ed463f21e419032db541ad24333ff52c531390a3 | 2,687 | pl | Perl | ext/candc/src/data/italian/prolog/printTUT.pl | TeamSPoon/logicmoo_nlu | 5c3e5013a3048da7d68a8a43476ad84d3ea4bb47 | [
"MIT"
] | 6 | 2020-01-27T12:08:02.000Z | 2020-02-28T19:30:28.000Z | pack/logicmoo_nlu/prolog/candc/src/data/italian/prolog/printTUT.pl | logicmoo/old_logicmoo_workspace | 44025b6e389e2f2f7d86b46c1301cab0604bba26 | [
"MIT"
] | 1 | 2020-02-02T13:12:34.000Z | 2020-02-02T13:12:34.000Z | pack/logicmoo_nlu/prolog/candc/src/data/italian/prolog/printTUT.pl | logicmoo/old_logicmoo_workspace | 44025b6e389e2f2f7d86b46c1301cab0604bba26 | [
"MIT"
] | null | null | null |
:- module(printTUT,[printTUT/2,lenTUT/2]).
/* --------------------------------------------------------------------------
Tab Length
-------------------------------------------------------------------------- */
tablength(4).
/* --------------------------------------------------------------------------
Print Tree
-------------------------------------------------------------------------- */
printTUT(X,Stream):- printTUT(X,0,Stream), nl(Stream).
printTUT(X,_Tab,Stream):- atom(X), !, tab(Stream,1), write(Stream,X).
printTUT(_Type:X,_Tab,Stream):- atom(X), !, tab(Stream,1), write(Stream,X).
printTUT(Type:tree(A),Tab,Stream):- !,
nl(Stream), tab(Stream,Tab), write(Stream,Type),
write(Stream,'('),write(Stream,A),
write(Stream,')').
printTUT(Type:tree(A,B),Tab,Stream):- !,
nl(Stream), tab(Stream,Tab),
write(Stream,Type),write(Stream,'('),write(Stream,A),
tablength(Length),
NewTab is Tab + Length,
printTUTs([B],NewTab,Stream),
write(Stream,')').
printTUT(Type:Tree,Tab,Stream):-
Tree =.. [tree,A|Rest], !,
nl(Stream),
tab(Stream,Tab),write(Stream,Type),write(Stream,'('),write(Stream,A),
tablength(Length),
NewTab is Tab + Length,
printTUTs(Rest,NewTab,Stream),
write(Stream,')').
printTUT(Type:Tree,Tab,Stream):- !,
nl(Stream), tab(Stream,Tab), write(Stream,Type:Tree).
/* --------------------------------------------------------------------------
Print Branches
-------------------------------------------------------------------------- */
printTUTs([],_,_):- !.
printTUTs([X|L],Tab,Stream):- printTUT(X,Tab,Stream), !, printTUTs(L,Tab,Stream).
/* --------------------------------------------------------------------------
Length Tree
-------------------------------------------------------------------------- */
lenTUT(X,N):- lenTUT(X,0,N).
lenTUT(X,N1,N2):- atom(X), !, token(X,N1,N2).
lenTUT(_:X,N,N):- atom(X), !.
lenTUT(_:tree(_),N,N):- !.
lenTUT(_:tree(_,B),N1,N2):- !, lenTUTs([B],N1,N2).
lenTUT(_:Tree,N1,N2):- Tree =.. [tree,_|Rest], !, lenTUTs(Rest,N1,N2).
lenTUT(_,N,N).
/* --------------------------------------------------------------------------
Length of Branches
-------------------------------------------------------------------------- */
lenTUTs([],N,N):- !.
lenTUTs([X|L],N1,N3):- lenTUT(X,N1,N2), !, lenTUTs(L,N2,N3).
/* --------------------------------------------------------------------------
Deciding whether it is a token
-------------------------------------------------------------------------- */
token(Atom,N1,N2):-
atom(Atom),
atom_chars(Atom,Lex),
append(Chars,['/'|_],Lex),
\+ member('.',Chars), !,
N2 is N1 + 1.
token(_,N,N).
| 28.892473 | 81 | 0.400447 |
ed963a29dc947907dec5048d020d048bb4a87562 | 1,288 | pm | Perl | lib/Google/Ads/GoogleAds/V3/Resources/MutateJob.pm | PierrickVoulet/google-ads-perl | bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4 | [
"Apache-2.0"
] | null | null | null | lib/Google/Ads/GoogleAds/V3/Resources/MutateJob.pm | PierrickVoulet/google-ads-perl | bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4 | [
"Apache-2.0"
] | null | null | null | lib/Google/Ads/GoogleAds/V3/Resources/MutateJob.pm | PierrickVoulet/google-ads-perl | bc9fa2de22aa3e11b99dc22251d90a1723dd8cc4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020, Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
package Google::Ads::GoogleAds::V3::Resources::MutateJob;
use strict;
use warnings;
use base qw(Google::Ads::GoogleAds::BaseEntity);
use Google::Ads::GoogleAds::Utils::GoogleAdsHelper;
sub new {
my ($class, $args) = @_;
my $self = {
id => $args->{id},
longRunningOperation => $args->{longRunningOperation},
metadata => $args->{metadata},
nextAddSequenceToken => $args->{nextAddSequenceToken},
resourceName => $args->{resourceName},
status => $args->{status}};
# Delete the unassigned fields in this object for a more concise JSON payload
remove_unassigned_fields($self, $args);
bless $self, $class;
return $self;
}
1;
| 31.414634 | 79 | 0.687112 |
ed2d6ab74e4eed70262d028c1a74ae01ac1c362a | 91 | pl | Perl | Chapter11/4.pl | PacktPublishing/Perl-6-Deep-Dive | b47fadd6bd65efd38ed4860109edc5018ce98924 | [
"MIT"
] | 9 | 2017-12-28T13:41:36.000Z | 2021-12-20T03:31:06.000Z | Chapter11/6.pl | PacktPublishing/Perl-6-Deep-Dive | b47fadd6bd65efd38ed4860109edc5018ce98924 | [
"MIT"
] | 1 | 2020-01-29T07:23:03.000Z | 2020-12-01T07:38:06.000Z | Chapter11/6.pl | PacktPublishing/Perl-6-Deep-Dive | b47fadd6bd65efd38ed4860109edc5018ce98924 | [
"MIT"
] | 2 | 2017-12-13T10:11:15.000Z | 2019-05-24T00:38:23.000Z | my $phone = '+31 645-23-10';
my $re = rx/\+? (\d | \s | \-)+/;
say 'OK' if $phone ~~ $re;
| 18.2 | 33 | 0.417582 |
73dff3b16f59235b977817ce17e00a1bfcd3f43e | 3,013 | pl | Perl | Task/Sieve-of-Eratosthenes/Perl/sieve-of-eratosthenes-10.pl | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:38.000Z | 2018-11-09T22:08:38.000Z | Task/Sieve-of-Eratosthenes/Perl/sieve-of-eratosthenes-10.pl | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | null | null | null | Task/Sieve-of-Eratosthenes/Perl/sieve-of-eratosthenes-10.pl | mullikine/RosettaCodeData | 4f0027c6ce83daa36118ee8b67915a13cd23ab67 | [
"Info-ZIP"
] | 1 | 2018-11-09T22:08:40.000Z | 2018-11-09T22:08:40.000Z | use strict;
use warnings;
package Tie::SieveOfEratosthenes;
sub TIEARRAY {
my $class = shift;
bless \$class, $class;
}
# If set to true, produces copious output. Observing this output
# is an excellent way to gain insight into how the algorithm works.
use constant DEBUG => 0;
# If set to true, causes the code to skip over even numbers,
# improving runtime. It does not alter the output content, only the speed.
use constant WHEEL2 => 0;
BEGIN {
# This is loosely based on the Python implementation of this task,
# specifically the "Infinite generator with a faster algorithm"
my @primes = (2, 3);
my $ps = WHEEL2 ? 1 : 0;
my $p = $primes[$ps];
my $q = $p*$p;
my $incr = WHEEL2 ? 2 : 1;
my $candidate = $primes[-1] + $incr;
my %sieve;
print "Initial: p = $p, q = $q, candidate = $candidate\n" if DEBUG;
sub FETCH {
my $n = pop;
return if $n < 0;
return $primes[$n] if $n <= $#primes;
OUTER: while( 1 ) {
# each key in %sieve is a composite number between
# p and p-squared. Each value in %sieve is $incr x the prime
# which acted as a 'seed' for that key. We use the value
# to step through multiples of the seed-prime, until we find
# an empty slot in %sieve.
while( my $s = delete $sieve{$candidate} ) {
print "$candidate a multiple of ".($s/$incr).";\t\t" if DEBUG;
my $composite = $candidate + $s;
$composite += $s while exists $sieve{$composite};
print "The next stored multiple of ".($s/$incr)." is $composite\n" if DEBUG;
$sieve{$composite} = $s;
$candidate += $incr;
}
print "Candidate $candidate is not in sieve\n" if DEBUG;
while( $candidate < $q ) {
print "$candidate is prime\n" if DEBUG;
push @primes, $candidate;
$candidate += $incr;
next OUTER if exists $sieve{$candidate};
}
die "Candidate = $candidate, p = $p, q = $q" if $candidate > $q;
print "Candidate $candidate is equal to $p squared;\t" if DEBUG;
# Thus, it is now time to add p to the sieve,
my $step = $incr * $p;
my $composite = $q + $step;
$composite += $step while exists $sieve{$composite};
print "The next multiple of $p is $composite\n" if DEBUG;
$sieve{$composite} = $step;
# and fetch out a new value for p from our primes array.
$p = $primes[++$ps];
$q = $p * $p;
# And since $candidate was equal to some prime squared,
# it's obviously composite, and we need to increment it.
$candidate += $incr;
print "p is $p, q is $q, candidate is $candidate\n" if DEBUG;
} continue {
return $primes[$n] if $n <= $#primes;
}
}
}
if( !caller ) {
tie my (@prime_list), 'Tie::SieveOfEratosthenes';
my $limit = $ARGV[0] || 100;
my $line = "";
for( my $count = 0; $prime_list[$count] < $limit; ++$count ) {
$line .= $prime_list[$count]. ", ";
next if length($line) <= 70;
if( $line =~ tr/,// > 1 ) {
$line =~ s/^(.*,) (.*, )/$2/;
print $1, "\n";
} else {
print $line, "\n";
$line = "";
}
}
$line =~ s/, \z//;
print $line, "\n" if $line;
}
1;
| 28.158879 | 80 | 0.60604 |
ed887a5ca6c30fa84e4f47452980d6246291124a | 11,265 | pm | Perl | perl/vendor/lib/DBIx/Class.pm | ifleeyo180/VspriteMoodleWebsite | 38baa924829c83808d2c87d44740ff365927a646 | [
"Apache-2.0"
] | 2 | 2021-07-24T12:46:49.000Z | 2021-08-02T08:37:53.000Z | perl/vendor/lib/DBIx/Class.pm | ifleeyo180/VspriteMoodleWebsite | 38baa924829c83808d2c87d44740ff365927a646 | [
"Apache-2.0"
] | 6 | 2021-11-18T00:39:48.000Z | 2021-11-20T00:31:40.000Z | perl/vendor/lib/DBIx/Class.pm | ifleeyo180/VspriteMoodleWebsite | 38baa924829c83808d2c87d44740ff365927a646 | [
"Apache-2.0"
] | null | null | null | package DBIx::Class;
use strict;
use warnings;
our $VERSION;
# Always remember to do all digits for the version even if they're 0
# i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
# brain damage and presumably various other packaging systems too
# $VERSION declaration must stay up here, ahead of any other package
# declarations, as to not confuse various modules attempting to determine
# this ones version, whether that be s.c.o. or Module::Metadata, etc
$VERSION = '0.082842';
{
package
DBIx::Class::_ENV_;
require constant;
constant->import( DEVREL => ( ($DBIx::Class::VERSION =~ /_/) ? 1 : 0 ) );
}
$VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases
use DBIx::Class::_Util;
use mro 'c3';
use DBIx::Class::Optional::Dependencies;
use base qw/DBIx::Class::Componentised DBIx::Class::AccessorGroup/;
use DBIx::Class::StartupCheck;
use DBIx::Class::Exception;
__PACKAGE__->mk_group_accessors(inherited => '_skip_namespace_frames');
__PACKAGE__->_skip_namespace_frames('^DBIx::Class|^SQL::Abstract|^Try::Tiny|^Class::Accessor::Grouped|^Context::Preserve');
# FIXME - this is not really necessary, and is in
# fact going to slow things down a bit
# However it is the right thing to do in order to get
# various install bases to highlight their brokenness
# Remove at some unknown point in the future
sub DESTROY { &DBIx::Class::_Util::detected_reinvoked_destructor }
sub mk_classdata {
shift->mk_classaccessor(@_);
}
sub mk_classaccessor {
my $self = shift;
$self->mk_group_accessors('inherited', $_[0]);
$self->set_inherited(@_) if @_ > 1;
}
sub component_base_class { 'DBIx::Class' }
sub MODIFY_CODE_ATTRIBUTES {
my ($class,$code,@attrs) = @_;
$class->mk_classdata('__attr_cache' => {})
unless $class->can('__attr_cache');
$class->__attr_cache->{$code} = [@attrs];
return ();
}
sub _attr_cache {
my $self = shift;
my $cache = $self->can('__attr_cache') ? $self->__attr_cache : {};
return {
%$cache,
%{ $self->maybe::next::method || {} },
};
}
# *DO NOT* change this URL nor the identically named =head1 below
# it is linked throughout the ecosystem
sub DBIx::Class::_ENV_::HELP_URL () {
'http://p3rl.org/DBIx::Class#GETTING_HELP/SUPPORT'
}
1;
__END__
# This is the only file where an explicit =encoding is needed,
# as the distbuild-time injected author list is utf8 encoded
# Without this pod2text output is less than ideal
#
# A bit regarding selection/compatiblity:
# Before 5.8.7 UTF-8 was == utf8, both behaving like the (lax) utf8 we know today
# Then https://www.nntp.perl.org/group/perl.unicode/2004/12/msg2705.html happened
# Encode way way before 5.8.0 supported UTF-8: https://metacpan.org/source/DANKOGAI/Encode-1.00/lib/Encode/Supported.pod#L44
# so it is safe for the oldest toolchains.
# Additionally we inject all the utf8 programattically and test its well-formedness
# so all is well
#
=encoding UTF-8
=head1 NAME
DBIx::Class - Extensible and flexible object <-> relational mapper.
=head1 WHERE TO START READING
See L<DBIx::Class::Manual::DocMap> for an overview of the exhaustive documentation.
To get the most out of DBIx::Class with the least confusion it is strongly
recommended to read (at the very least) the
L<Manuals|DBIx::Class::Manual::DocMap/Manuals> in the order presented there.
=cut
=head1 GETTING HELP/SUPPORT
Due to the sheer size of its problem domain, DBIx::Class is a relatively
complex framework. After you start using DBIx::Class questions will inevitably
arise. If you are stuck with a problem or have doubts about a particular
approach do not hesitate to contact us via any of the following options (the
list is sorted by "fastest response time"):
=over
=item * RT Bug Tracker: L<https://rt.cpan.org/Public/Dist/Display.html?Name=DBIx-Class>
=item * Email: L<mailto:bug-DBIx-Class@rt.cpan.org>
=item * Twitter: L<https://twitter.com/intent/tweet?text=%40ribasushi%20%23DBIC>
=back
=head1 SYNOPSIS
For the very impatient: L<DBIx::Class::Manual::QuickStart>
This code in the next step can be generated automatically from an existing
database, see L<dbicdump> from the distribution C<DBIx-Class-Schema-Loader>.
=head2 Schema classes preparation
Create a schema class called F<MyApp/Schema.pm>:
package MyApp::Schema;
use base qw/DBIx::Class::Schema/;
__PACKAGE__->load_namespaces();
1;
Create a result class to represent artists, who have many CDs, in
F<MyApp/Schema/Result/Artist.pm>:
See L<DBIx::Class::ResultSource> for docs on defining result classes.
package MyApp::Schema::Result::Artist;
use base qw/DBIx::Class::Core/;
__PACKAGE__->table('artist');
__PACKAGE__->add_columns(qw/ artistid name /);
__PACKAGE__->set_primary_key('artistid');
__PACKAGE__->has_many(cds => 'MyApp::Schema::Result::CD', 'artistid');
1;
A result class to represent a CD, which belongs to an artist, in
F<MyApp/Schema/Result/CD.pm>:
package MyApp::Schema::Result::CD;
use base qw/DBIx::Class::Core/;
__PACKAGE__->load_components(qw/InflateColumn::DateTime/);
__PACKAGE__->table('cd');
__PACKAGE__->add_columns(qw/ cdid artistid title year /);
__PACKAGE__->set_primary_key('cdid');
__PACKAGE__->belongs_to(artist => 'MyApp::Schema::Result::Artist', 'artistid');
1;
=head2 API usage
Then you can use these classes in your application's code:
# Connect to your database.
use MyApp::Schema;
my $schema = MyApp::Schema->connect($dbi_dsn, $user, $pass, \%dbi_params);
# Query for all artists and put them in an array,
# or retrieve them as a result set object.
# $schema->resultset returns a DBIx::Class::ResultSet
my @all_artists = $schema->resultset('Artist')->all;
my $all_artists_rs = $schema->resultset('Artist');
# Output all artists names
# $artist here is a DBIx::Class::Row, which has accessors
# for all its columns. Rows are also subclasses of your Result class.
foreach $artist (@all_artists) {
print $artist->name, "\n";
}
# Create a result set to search for artists.
# This does not query the DB.
my $johns_rs = $schema->resultset('Artist')->search(
# Build your WHERE using an SQL::Abstract::Classic-compatible structure:
{ name => { like => 'John%' } }
);
# Execute a joined query to get the cds.
my @all_john_cds = $johns_rs->search_related('cds')->all;
# Fetch the next available row.
my $first_john = $johns_rs->next;
# Specify ORDER BY on the query.
my $first_john_cds_by_title_rs = $first_john->cds(
undef,
{ order_by => 'title' }
);
# Create a result set that will fetch the artist data
# at the same time as it fetches CDs, using only one query.
my $millennium_cds_rs = $schema->resultset('CD')->search(
{ year => 2000 },
{ prefetch => 'artist' }
);
my $cd = $millennium_cds_rs->next; # SELECT ... FROM cds JOIN artists ...
my $cd_artist_name = $cd->artist->name; # Already has the data so no 2nd query
# new() makes a Result object but doesn't insert it into the DB.
# create() is the same as new() then insert().
my $new_cd = $schema->resultset('CD')->new({ title => 'Spoon' });
$new_cd->artist($cd->artist);
$new_cd->insert; # Auto-increment primary key filled in after INSERT
$new_cd->title('Fork');
$schema->txn_do(sub { $new_cd->update }); # Runs the update in a transaction
# change the year of all the millennium CDs at once
$millennium_cds_rs->update({ year => 2002 });
=head1 DESCRIPTION
This is an SQL to OO mapper with an object API inspired by L<Class::DBI>
(with a compatibility layer as a springboard for porting) and a resultset API
that allows abstract encapsulation of database operations. It aims to make
representing queries in your code as perl-ish as possible while still
providing access to as many of the capabilities of the database as possible,
including retrieving related records from multiple tables in a single query,
C<JOIN>, C<LEFT JOIN>, C<COUNT>, C<DISTINCT>, C<GROUP BY>, C<ORDER BY> and
C<HAVING> support.
DBIx::Class can handle multi-column primary and foreign keys, complex
queries and database-level paging, and does its best to only query the
database in order to return something you've directly asked for. If a
resultset is used as an iterator it only fetches rows off the statement
handle as requested in order to minimise memory usage. It has auto-increment
support for SQLite, MySQL, PostgreSQL, Oracle, SQL Server and DB2 and is
known to be used in production on at least the first four, and is fork-
and thread-safe out of the box (although
L<your DBD may not be|DBI/Threads and Thread Safety>).
This project is still under rapid development, so large new features may be
marked B<experimental> - such APIs are still usable but may have edge bugs.
Failing test cases are I<always> welcome and point releases are put out rapidly
as bugs are found and fixed.
We do our best to maintain full backwards compatibility for published
APIs, since DBIx::Class is used in production in many organisations,
and even backwards incompatible changes to non-published APIs will be fixed
if they're reported and doing so doesn't cost the codebase anything.
The test suite is quite substantial, and several developer releases
are generally made to CPAN before the branch for the next release is
merged back to trunk for a major release.
=head1 HOW TO CONTRIBUTE
Contributions are always welcome, in all usable forms (we especially
welcome documentation improvements). The delivery methods include git-
or unified-diff formatted patches, GitHub pull requests, or plain bug
reports either via RT or the Mailing list. Do not hesitate to
L<get in touch|/GETTING HELP/SUPPORT> with any further questions you may
have.
=for comment
FIXME: Getty, frew and jnap need to get off their asses and finish the contrib section so we can link it here ;)
This project is maintained in a git repository. The code and related tools are
accessible at the following locations:
=over
=item * Current git repository: L<https://github.com/Perl5/DBIx-Class>
=item * Travis-CI log: L<https://travis-ci.com/github/Perl5/DBIx-Class/branches>
=back
=head1 AUTHORS
Even though a large portion of the source I<appears> to be written by just a
handful of people, this library continues to remain a collaborative effort -
perhaps one of the most successful such projects on L<CPAN|http://cpan.org>.
It is important to remember that ideas do not always result in a direct code
contribution, but deserve acknowledgement just the same. Time and time again
the seemingly most insignificant questions and suggestions have been shown
to catalyze monumental improvements in consistency, accuracy and performance.
=for comment this line is replaced with the author list at dist-building time
The canonical source of authors and their details is the F<AUTHORS> file at
the root of this distribution (or repository). The canonical source of
per-line authorship is the L<git repository|/HOW TO CONTRIBUTE> history
itself.
=head1 COPYRIGHT AND LICENSE
Copyright (c) 2005 by mst, castaway, ribasushi, and other DBIx::Class
L</AUTHORS> as listed above and in F<AUTHORS>.
This library is free software and may be distributed under the same terms
as perl5 itself. See F<LICENSE> for the complete licensing terms.
| 35.093458 | 124 | 0.740435 |
ed6d39727d89d056a3a3af96048246a3b800fb3a | 3,236 | pm | Perl | Plack/Middleware/Choke/Bytes.pm | hathitrust/plack-lib | a519ef9d455582fd785177bf1127f425e32b2ffd | [
"BSD-3-Clause"
] | null | null | null | Plack/Middleware/Choke/Bytes.pm | hathitrust/plack-lib | a519ef9d455582fd785177bf1127f425e32b2ffd | [
"BSD-3-Clause"
] | null | null | null | Plack/Middleware/Choke/Bytes.pm | hathitrust/plack-lib | a519ef9d455582fd785177bf1127f425e32b2ffd | [
"BSD-3-Clause"
] | null | null | null | package Plack::Middleware::Choke::Bytes;
use base qw( Plack::Middleware::Choke );
use Date::Manip;
use Data::Dumper;
sub test {
my ( $self ) = @_;
my $delta = ( $self->now - $self->data->{'_ts'} );
my $allowed = 1; my $message;
my $tx_credit = 0; my $reset = 0;
my ( $max_debt, $max_debt_unit ) = @{ $self->max_debt };
$max_debt *= $self->multiplier;
unless ( ref($self->data->{bytes}) ) {
$self->data->{bytes} = { debt => 0, max_debt => join(" / ", @{ $self->max_debt} ) };
if ( ref($self->credit_rate) ) {
$self->data->{bytes}->{credit_rate} = join(" / ", @{ $self->credit_rate });
if ( $self->rate_multiplier != 1 ) {
$self->data->{bytes}->{credit_rate} .= qq{ * $self->rate_multiplier};
}
}
}
if ( ref($self->credit_rate) ) {
my ( $credit_rate, $unit ) = @{ $self->credit_rate };
$credit_rate *= $self->rate_multiplier;
if ( $unit eq 'min' ) {
$credit_rate = $credit_rate / 60.0;
} elsif ( $unit eq 'hour' ) {
$credit_rate = $credit_rate / 60.0 / 60.0;
}
$tx_credit = $credit_rate * $delta;
if ( $self->data->{bytes}->{debt} > 0 ) {
$self->data->{bytes}->{debt} -= $tx_credit;
$self->data->{bytes}->{debt} = 0 if ( $self->data->{bytes}->{debt} < 0 );
}
}
if ( $self->data->{_until_ts} ) {
if ( $self->now > $self->data->{_until_ts} ) {
# throttling is OVER!
$self->data->{bytes}->{debt} = 0;
delete $self->data->{_until_ts};
} else {
$allowed = 0;
$message = qq{Request still throttled until : } . $self->data->{_until_ts};
}
} elsif ( $self->data->{bytes}->{debt} > $max_debt ) {
$allowed = 0;
unless ( $max_debt_unit =~ m,^\+, ) {
$max_debt_unit = qq{+ 1 $max_debt_unit};
}
$self->data->{_until_ts} = UnixDate($max_debt_unit, "%s");
$message = qq{Request throttled until : } . $self->data->{_until_ts};
}
$self->headers->{'X-Choke-Allowed'} = $allowed;
$self->headers->{'X-Choke'} = 'bytes';
$self->headers->{'X-Choke-Now'} = UnixDate("epoch " . $self->now, "%Y-%m-%d %H:%M:%S");
$self->headers->{'X-Choke-Until'} = UnixDate("epoch " . $self->data->{_until_ts}, "%Y-%m-%d %H:%M:%S") if ( $self->data->{_until_ts} );
$self->headers->{'X-Choke-UntilEpoch'} = $self->data->{_until_ts} if ( $self->data->{_until_ts} );
$self->headers->{'X-Choke-Debt'} = $self->data->{bytes}->{debt};
$self->headers->{'X-Choke-Max'} = $max_debt;
$self->headers->{'X-Choke-Credit'} = $tx_credit;
$self->headers->{'X-Choke-Message'} = $message;
$self->headers->{'X-Choke-Delta'} = $delta;
$rate = qq{$max_debt bytes / $max_debt_unit};
$rate =~ s, \+([0-9]), $1,;
$self->headers->{'X-Choke-Rate'} = $rate;
return ( $allowed, $message );
}
sub post_process {
my ( $self, $chunk ) = @_;
my $content_length = length($chunk);
if ( $content_length ) {
$self->data->{bytes}->{debt} += $content_length;
$self->update_cache();
}
return $chunk;
}
1;
| 35.955556 | 139 | 0.504635 |
ed79eb40af54d0c5d4c2d264075ec00c77c18b8a | 4,485 | perl | Perl | Vagrantfile.perl | sergueik/puppetmaster_vagrant | 4ce82f9618a040206a695038bfe8f8fc21cdfcb6 | [
"MIT"
] | 3 | 2016-02-04T22:24:59.000Z | 2020-04-13T17:09:30.000Z | Vagrantfile.perl | sergueik/puppetmaster_vagrant | 4ce82f9618a040206a695038bfe8f8fc21cdfcb6 | [
"MIT"
] | 6 | 2021-12-11T14:40:53.000Z | 2022-01-04T16:54:19.000Z | Vagrantfile.perl | sergueik/puppetmaster_vagrant | 4ce82f9618a040206a695038bfe8f8fc21cdfcb6 | [
"MIT"
] | 1 | 2016-07-19T13:36:24.000Z | 2016-07-19T13:36:24.000Z | # -*- mode: ruby -*-
# vi: set ft=ruby :
# based on:
# https://github.com/williambelle/perl-box
# collapsed into single, fixed few Vagrant specific issues
perl_version = ENV.fetch('PERL_VERSION', '5.28.0') # TODO: use to suppress brew
# e.g. 5.28.0
box_name = ENV.fetch('BOX_NAME', 'puppetlabs/ubuntu-16.04-64-puppet')
debug_perl = ENV.fetch('DEBUG_PERL', '')
debug_perl = true if debug_perl =~ /^(?:true|yes|1)$/i
# debug = ENV.fetch('DEBUG', false)
debug = ENV.fetch('DEBUG', '')
debug = true if debug =~ /^(?:true|yes|1)$/i
perl_old = '5.8.9 5.10.1 5.12.5 5.14.4 5.16.3 5.18.4 '
perl_new = '5.20.3 5.22.4 5.24.4 5.26.2 5.28.0'
VAGRANTFILE_API_VERSION = '2'
basedir = (ENV.fetch('HOME','') || ENV.fetch('USERPROFILE', '')).gsub('\\', '/')
box_memory = ENV.fetch('BOX_MEMORY', '1024').to_i
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = box_name
# using localy cached vagrant box
# invoke-webrequest -uri 'https://app.vagrantup.com/puppetlabs/boxes/ubuntu-16.04-64-puppet/versions/1.0.0/providers/virtualbox.box' -outfile "${env:USERPROFILE}\Downloads\ubuntu-16.04-64-puppet.box"
config_vm_box_name = 'ubuntu-16.04-64-puppet.box'
config.vm.box_url = "file://#{basedir}/Downloads/#{config_vm_box_name}"
# based on https://groups.google.com/forum/#!topic/vagrant-up/k2aUobRmn1A
# config.vm.provision 'file', source: './bootstrap', destination: '/tmp/bootstrap'
# config.vm.provision 'shell', inline: '/tmp/bootstrap/bootstrap-script.sh'
# only required for
config.vm.boot_timeout = 600
config.vm.synced_folder './' , '/vagrant'
shell_script = <<-EOF
sudo apt-get -qy update
sudo apt-get -qqy install vim jq build-essential curl zlib1g-dev libssl-dev libexpat1-dev
sudo apt-get -qqy install perl-doc perltidy libperl-critic-perl libwww-perl
sudo apt-get -qqy apache2 lynx
sudo apt-get install libhtml-tokeparser-simple-perl libossp-uuid-perl libregexp-common-perl
# https://tecadmin.net/enable-or-disable-cgi-in-apache24/
# https://httpd.apache.org/docs/2.4/howto/cgi.html
# http://www.wellho.net/forum/Perl-Programming/Running-Perl-CGI-scripts-under-Apache-Tomcat.html
sudo a2enmod cgi
sudo systemctl restart httpd
PERL_MODULES='JSON YAML Date::Manip Date::Parse CGI::FastTemplate Test::CheckManifest Carp Test::Pod::Coverage Test::CheckManifest Test::Pod::Coverage Test::Pod Test::Perl::Critic Data::Dumper CGI Time::HiRes Time::CTime Time::Local Time::ParseDate File::Basename List::MoreUtils Data::UUID HTML::TokeParser::Simple Regexp::Common Regexp::Assemble::Compressed XML::Parser XML::SAX::Expat XML::Simple HTML::TableExtract Log::Log4perl Getopt::Long HTML::TagParser Log::Log4perl'
cpan install CPAN::Shell
# https://www.perlmonks.org/?node_id=859409
for M in $PERL_MODULES;
do
perl -MCPAN -e "CPAN::Shell->notest('install', '$M')"
# cpan install $M;
done
export PERLBREW_ROOT='/home/vagrant/perl5/perlbrew'
PERLBREW_BIN="${PERLBREW_ROOT}/bin/perlbrew"
PERL_OLD='5.8.9 5.10.1 5.12.5 5.14.4 5.16.3 5.18.4 '
PERL_NEW='5.20.3 5.22.4 5.24.4 5.26.2 5.28.0'
# NOTE: cannot leave empty
PERL_OLD='5.8.9'
PERL_NEW='5.28.0'
# Install Perlbrew.
# NOTE: all temporary files being deleted.
# NOTE: no way currently to override PERLBREW_ROOT
# NOTE: installing as regular user
curl -kL https://install.perlbrew.pl | bash
# Add Perlbrew to PATH
echo 'source ~/perl5/perlbrew/etc/bashrc' >> /home/vagrant/.bashrc
# Install all Perl version
$PERLBREW_BIN install-multiple --notest $PERL_OLD $PERL_NEW
# Install cpanm
$PERLBREW_BIN install-cpanm
# NOTE: need to suppress cpanm testing during install: too time-consuming
# Install Perl dev dependencies for both old and new Perl versions. TODO: do the same in the system Perl to made vailable to apache2 CGI-BIN
for M in $PERL_MODULES; do $PERLBREW_BIN exec cpanm -n $M; done
chown -R vagrant:vagrant ~vagrant/perl5
# Switch to latest new Perl version
$PERLBREW_BIN switch perl-${PERL_NEW##* }
# echo $PERL_NEW | rev| cut -f 1 -d' ' | rev
EOF
config.vm.provision 'shell',
env: {
'PERL_OLD' => perl_old,
'PERL_NEW' => perl_new,
},
inline: shell_script
end
| 43.543689 | 484 | 0.661984 |
Subsets and Splits