view release on metacpan or search on metacpan
sub new {
my ($proto, $count_hash) = @_;
my $class = ref($proto) || $proto;
__validate_counting_hash($count_hash);
my $heap = Heap::Fibonacci->new;
my $size = 0;
while (my ($str, $count) = each %$count_hash) {
croak "The count for each character/substring must be a number"
}
return $string;
}
sub __validate_counting_hash {
my $c = shift;
my $error_msg = undef;
defined $c
or croak "Undefined counting hash";
ref($c) eq 'HASH'
view all matches for this distribution
view release on metacpan or search on metacpan
utilize|||
uvchr_to_utf8_flags||5.007003|
uvchr_to_utf8|||
uvuni_to_utf8_flags||5.007003|
uvuni_to_utf8||5.007001|
validate_suid|||
varname|||
vcmp||5.009000|
vcroak||5.006000|
vdeb||5.007003|
vdie_common|||
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
);
while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
$pattern =~ s{\s+}{\\s+}g;
if ( $license_text =~ /\b$pattern\b/i ) {
if ( $osi and $license_text =~ /All rights reserved/i ) {
warn "LEGAL WARNING: 'All rights reserved' may invalidate Open Source licenses. Consider removing it.";
}
$self->license($license);
return 1;
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
src/liblinear.xs view on Meta::CPAN
return false;
}
}
void
validate_parameter(
pTHX_
struct problem *problem_,
struct parameter *parameter_) {
const char *message = check_parameter(problem_, parameter_);
if (message) {
src/liblinear.xs view on Meta::CPAN
struct model *
ll_train(klass, problem_, parameter_)
struct problem *problem_;
struct parameter *parameter_;
CODE:
validate_parameter(aTHX_ problem_, parameter_);
RETVAL = train(problem_, parameter_);
OUTPUT:
RETVAL
struct model *
src/liblinear.xs view on Meta::CPAN
ll_cross_validation(self, problem_, num_folds)
struct parameter *self;
struct problem *problem_;
int num_folds;
CODE:
validate_parameter(aTHX_ problem_, self);
double *targets;
Newx(targets, problem_->l, double);
cross_validation(problem_, self, num_folds, targets);
RETVAL = newAV();
av_extend(RETVAL, problem_->l - 1);
view all matches for this distribution
view release on metacpan or search on metacpan
uvuni_to_utf8|5.019004||cVu
uvuni_to_utf8_flags|5.007003||dcV
UVxf|5.006000|5.003007|poVn
UVXf|5.007001|5.007001|poVn
VAL_EAGAIN|5.003007|5.003007|Vn
validate_proto|5.019002||xcVi
validate_suid|||iu
valid_utf8_to_uvchr|5.015009||cVn
valid_utf8_to_uvuni|5.015009||dcVu
VAL_O_NONBLOCK|5.003007|5.003007|Vn
variant_byte_number|5.031004||cVnu
variant_under_utf8_count|5.027007||Vni
view all matches for this distribution
view release on metacpan or search on metacpan
6.16 0.744 11.625 138572 0.0000 0.0001 Algorithm::MasterMind::matches
5.06 0.611 10.881 499779 0.0000 0.0000 Algorithm::MasterMind::check_rule
0.58 0.070 0.090 1 0.0699 0.0897 YAML::Type::code::BEGIN
0.50 0.060 0.389 7 0.0085 0.0555 main::BEGIN
0.49 0.059 0.195 40252 0.0000 0.0000 YAML::Base::__ANON__
0.49 0.059 0.059 454 0.0001 0.0001 Params::Validate::_validate
0.33 0.040 0.192 7 0.0057 0.0274 DateTime::Locale::BEGIN
0.31 0.038 0.097 449 0.0001 0.0002 DateTime::Locale::_register
0.30 0.036 0.065 5404 0.0000 0.0000 overload::AddrRef
0.24 0.029 0.029 322 0.0001 0.0001 Params::Validate::_validate_pos
0.22 0.026 0.026 5404 0.0000 0.0000 Scalar::Util::blessed
0.18 0.022 0.029 2335 0.0000 0.0000 YAML::Dumper::_emit_str
0.17 0.021 0.086 2235 0.0000 0.0000 YAML::Dumper::_emit_node
view all matches for this distribution
view release on metacpan or search on metacpan
utilize|||
uvchr_to_utf8_flags||5.007003|
uvchr_to_utf8|||
uvuni_to_utf8_flags||5.007003|
uvuni_to_utf8||5.007001|
validate_suid|||
varname|||
vcmp||5.009000|
vcroak||5.006000|
vdeb||5.007003|
vdie_common|||
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Tie/Hash/MinPerfHashTwoLevel/OnDisk.pm view on Meta::CPAN
sub mph2l_make_file {
my ($file,%opts)= @_;
return __PACKAGE__->make_file(file => $file, %opts);
}
sub mph2l_validate_file {
my ($file, %opts)= @_;
return __PACKAGE__->validate_file(file => $file, %opts);
}
sub new {
my ($class, %opts)= @_;
$opts{flags} ||= 0;
$opts{flags} |= MPH_F_VALIDATE if $opts{validate};
my $error;
my $mount= mount_file($opts{file},$error,$opts{flags});
my $error_rsv= delete $opts{error_rsv};
if ($error_rsv) {
$$error_rsv= $error;
lib/Tie/Hash/MinPerfHashTwoLevel/OnDisk.pm view on Meta::CPAN
rename $tmp_file, $ofile
or die "failed to rename '$tmp_file' to '$ofile': $!";
return $ofile;
}
sub validate_file {
my ($class, %opts)= @_;
my $file= $opts{file}
or die "file is a mandatory option to validate_file";
my $verbose= $opts{verbose};
my ($variant,$msg);
my $error_sv;
my $self= $class->new(file => $file, flags => MPH_F_VALIDATE, error_rsv => \$error_sv);
lib/Tie/Hash/MinPerfHashTwoLevel/OnDisk.pm view on Meta::CPAN
In version 0.15 we switched hash functions to use SipHash(1-3), which
unfortunately made supporting variants prior to 5 impossible.
=back
=item validate_file
Validate the file specified by the 'file' argument. Returns a list of
two values, 'variant' and 'message'. If the file fails validation the 'variant'
will be undef and the 'message' will contain an error message. If the file
passes validation the 'variant' will specify the variant of the file
lib/Tie/Hash/MinPerfHashTwoLevel/OnDisk.pm view on Meta::CPAN
tie my %hash, "Tie::Hash::MinPerfHashTwoLevel::OnDisk", $file;
with a simple sub that can be imported
my $hashref= mph2l_tied_hashref($file,$validate);
The validate flag causes MPH_F_VALIDATE validations to occur on load.
=item mph2l_make_file
Sub form of L<make_file>. Eg:
lib/Tie/Hash/MinPerfHashTwoLevel/OnDisk.pm view on Meta::CPAN
use Tie::Hash::MinPerfHashTwoLevel::OnDisk qw(mph2l_make_file);
mph2l_make_file(@args);
Sub form of C<make_file()>.
=item mph2l_validate_file
Sub form of C<validate_file()>. Eg:
use Tie::Hash::MinPerfHashTwoLevel::OnDisk;
Tie::Hash::MinPerfHashTwoLevel::OnDisk->validate_file(@args);
is identical to
use Tie::Hash::MinPerfHashTwoLevel::OnDisk qw(mph2l_validate_file);
mph2l_validate_file(@args);
=back
=head2 TIED INTERFACE
view all matches for this distribution
view release on metacpan or search on metacpan
$ algorithm-networksort-chooser 9 --median ## best median network
$ algorithm-networksort-chooser 9 --selection=4 ## also best median network
$ algorithm-networksort-chooser 9 --selection=0,1,2 ## top-3 elements selection net
$ algorithm-networksort-chooser 9 --validate ## run 0-1 validation test
$ algorithm-networksort-chooser 9 --show ## show network as ASCII diagram
$ algorithm-networksort-chooser 9 --raw ## show network as raw comparators
DESCRIPTION
This module uses Algorithm::Networksort to experiment with sorting
view all matches for this distribution
view release on metacpan or search on metacpan
utilize|||
uvchr_to_utf8_flags||5.007003|
uvchr_to_utf8|||
uvuni_to_utf8_flags||5.007003|
uvuni_to_utf8||5.007001|
validate_suid|||
varname|||
vcmp||5.009000|
vcroak||5.006000|
vdeb||5.007003|
vdie_common|||
view all matches for this distribution
view release on metacpan or search on metacpan
uvoffuni_to_utf8_flags||5.019004|
uvuni_to_utf8_flags||5.007003|
uvuni_to_utf8||5.007001|
valid_utf8_to_uvchr||5.015009|
valid_utf8_to_uvuni||5.015009|
validate_proto|||
validate_suid|||
varname|||
vcmp||5.009000|
vcroak||5.006000|
vdeb||5.007003|
vform||5.006000|
view all matches for this distribution
view release on metacpan or search on metacpan
uvuni_to_utf8|5.019004||cVu
uvuni_to_utf8_flags|5.007003||dcV
UVxf|5.006000|5.003007|poVn
UVXf|5.007001|5.007001|poVn
VAL_EAGAIN|5.003007|5.003007|Vn
validate_proto|5.019002||xcVi
validate_suid|||iu
valid_utf8_to_uvchr|5.015009||cVn
valid_utf8_to_uvuni|5.015009||dcVu
VAL_O_NONBLOCK|5.003007|5.003007|Vn
variant_byte_number|5.031004||cVnu
variant_under_utf8_count|5.027007||Vni
view all matches for this distribution
view release on metacpan or search on metacpan
utilize|||
uvchr_to_utf8_flags||5.007003|
uvchr_to_utf8|||
uvuni_to_utf8_flags||5.007003|
uvuni_to_utf8||5.007001|
validate_suid|||
varname|||
vcmp||5.009000|
vcroak||5.006000|
vdeb||5.007003|
vdie_common|||
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/SVM.pm view on Meta::CPAN
$svm->C(8);
# Retrain the SVM with the new parameters.
$svm->retrain();
# Perform cross validation on the training set.
$accuracy = $svm->validate(5);
# Save the model to a file.
$svm->save('new-sample.model');
# Load a saved model from a file.
lib/Algorithm/SVM.pm view on Meta::CPAN
Trains the SVM on a set of Algorithm::SVM::DataSet objects. @tset should
be an array of Algorithm::SVM::DataSet objects.
$accuracy = $svm->validate(5);
Performs cross validation on the training set. If an argument is provided,
the set is partioned into n subsets, and validated against one another.
Returns a floating point number representing the accuracy of the validation.
$num = $svm->getNRClass();
For a classification model, this function gives the number of classes.
lib/Algorithm/SVM.pm view on Meta::CPAN
my $self = shift;
return _train($self->{svm}, 1);
}
sub validate {
my ($self, $nfolds) = @_;
$nfolds = 5 if(! defined($nfolds));
croak("NumFolds must be >= 2") if($nfolds < 2);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/SkipList.pm view on Meta::CPAN
Returns the last key or the last key and finger returned by a call to
L</first_key>, L</next_key>, L</index_by_key>, L</key_by_index> or
L</value_by_index>. This is not the greatest key.
Deletions and inserts may invalidate the L</last_key> value.
(Deletions will actually L</reset> the value.)
Values for L</last_key> can also be set by including parameters,
however this feature is meant for I<internal use only>:
lib/Algorithm/SkipList.pm view on Meta::CPAN
my $self = shift;
my $left = $self->key; # node key
my $right = shift; # value to compare the node key with
unless ($self->validate_key($right)) {
die "Invalid key: \'$right\'"; }
return ($left <=> $right);
}
sub validate_key {
my $self = shift;
my $key = shift;
return ($key =~ s/\-?\d+(\.\d+)?$/); # test if key is numeric
}
view all matches for this distribution
view release on metacpan or search on metacpan
utilize|||
uvchr_to_utf8_flags||5.007003|
uvchr_to_utf8|||
uvuni_to_utf8_flags||5.007003|
uvuni_to_utf8||5.007001|
validate_suid|||
varname|||
vcmp||5.009000|
vcroak||5.006000|
vdeb||5.007003|
vdie_common|||
view all matches for this distribution
view release on metacpan or search on metacpan
utilize|||
uvchr_to_utf8_flags||5.007003|
uvchr_to_utf8|||
uvuni_to_utf8_flags||5.007003|
uvuni_to_utf8||5.007001|
validate_suid|||
varname|||
vcmp||5.009000|
vcroak||5.006000|
vdeb||5.007003|
vdie_common|||
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/ToNumberMunger.pm view on Meta::CPAN
parameters. Croaks on an unknown munger name or an invalid parameter set. The
optional second argument is only used to make error messages point at a tag.
=cut
# name => builder. Each builder validates its slice of the spec up front and
# returns the per-value closure. Keeping them in a table (rather than a big
# if/elsif) is what makes known_mungers() and has_munger() cheap and honest.
my %BUILDERS = (
enum => \&_build_enum,
frozen_freq_map => \&_build_frozen_freq_map,
lib/Algorithm/ToNumberMunger.pm view on Meta::CPAN
=item * every remaining tag is B<raw> and passed through unchanged.
=back
Coverage is validated up front: C<compile> croaks if two mungers write the same
column, if an C<into> names a column not in C<tags>, if a munger key is neither a
tag nor an expander, if an expander's output count does not match its C<into>,
or if a C<from> list is given to a munger that cannot combine inputs. The
returned plan has two methods, both returning an arrayref of numbers in C<tags>
order: C<apply_named(\%hash)> (keyed by field name, the only form that supports
lib/Algorithm/ToNumberMunger.pm view on Meta::CPAN
=head1 BUILT-IN MUNGERS
Every munger returns a plain number and, where the input cannot be interpreted,
croaks -- the Writer would reject a non-numeric field anyway, so failing at the
munger gives a better message. Parameters are validated when the munger is
built, not per row.
=head2 enum
{ munger => 'enum', map => { GET => 0, POST => 1 }, default => -1 }
lib/Algorithm/ToNumberMunger.pm view on Meta::CPAN
{ munger => 'num', base => 16 } # '0x1a' or '1a' -> 26
{ munger => 'num' } # plain numeric coercion
Parse a string as a number in C<base> (2-36, default 10). Base 10 simply
validates and numifies. Other bases accept the digits C<0-9a-z> below the
base, case-insensitively, an optional leading C<->, and the conventional
prefix for that base (C<0x> for 16, C<0b> for 2, C<0o> for 8). Plenty of
tooling logs flag words and IDs in hex (C<0x2f>), which the Writer would
reject as non-numeric; this munger is the bridge. Croaks on anything that is
not a clean number in the chosen base.
lib/Algorithm/ToNumberMunger.pm view on Meta::CPAN
=back
C<then> is a full munger spec and may be any built-in that takes one value --
including another C<chain>. All step parameters and the terminal spec are
validated at build time. An undef input enters the chain as the empty string;
whether an empty result is acceptable is the terminal's call (C<entropy> and
C<length> score it C<0>, C<num> croaks).
The multi-output form works too: put C<into> on the B<chain> and the C<parts>
on the terminal, e.g. C<trim> a sloppy timestamp before a L</datetime>
C<sin>/C<cos> expansion.
=cut
# op => step builder; each validates its slice of the step spec at build time
# and returns a string-to-string closure. Steps only ever see a defined string
# (the chain entry point turns undef into '').
my %CHAIN_OPS = (
lc => sub {
return sub { return lc $_[0] }
lib/Algorithm/ToNumberMunger.pm view on Meta::CPAN
return ( $code, $n );
} ## end sub _build_eps_multi
# A compiled munging plan for one set, produced by Mungers->compile. It turns an
# input record into a fully-numeric row in tags order; the Writer then only has
# to validate and append. Kept in its own package so the assembly logic is
# testable without a Writer or the filesystem.
package Algorithm::ToNumberMunger::Plan;
use strict;
use warnings;
view all matches for this distribution
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/TravelingSalesman/BitonicTour.pm view on Meta::CPAN
use strict;
use warnings FATAL => 'all';
use base 'Class::Accessor::Fast';
use Carp 'croak';
use List::Util 'reduce';
use Params::Validate qw/ validate_pos SCALAR /;
use Regexp::Common;
our $VERSION = '0.05';
__PACKAGE__->mk_accessors(qw/ _points _sorted_points _tour /);
lib/Algorithm/TravelingSalesman/BitonicTour.pm view on Meta::CPAN
=cut
sub add_point {
my $self = shift;
my $valid = { type => SCALAR, regexp => $RE{num}{real} };
my ($x, $y) = validate_pos(@_, ($valid) x 2);
if (exists $self->_points->{$x}) {
my $py = $self->_points->{$x};
croak "FAIL: point ($x,$y) duplicates previous point ($x,$py)";
}
else {
view all matches for this distribution
view release on metacpan or search on metacpan
Algorithm/TrunkClassifier/ppport.h view on Meta::CPAN
utilize|||
uvchr_to_utf8_flags||5.007003|
uvchr_to_utf8|||
uvuni_to_utf8_flags||5.007003|
uvuni_to_utf8||5.007001|
validate_suid|||
varname|||
vcmp||5.009000|
vcroak||5.006000|
vdeb||5.007003|
vdie_common|||
view all matches for this distribution
view release on metacpan or search on metacpan
examples/corpus/SlideShowApplet.java view on Meta::CPAN
}
if ( scrollableImage != null ) {
contentPane.removeAll();
contentPane.add( scrollableImage );
}
contentPane.revalidate();
contentPane.setVisible( true );
newFrameAvailable = false;
}
};
contentPane.setBackground(Color.white); //(F)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/Voting/Ballot.pm view on Meta::CPAN
package Algorithm::Voting::Ballot;
use strict;
use warnings;
use base 'Class::Accessor::Fast';
use Params::Validate 'validate';
__PACKAGE__->mk_accessors(qw/ candidate /);
=pod
lib/Algorithm/Voting/Ballot.pm view on Meta::CPAN
return $class->new(candidate => $_[0]);
}
my %valid = (
candidate => 0,
);
my %args = validate(@_, \%valid);
return bless \%args, $class;
}
=head2 $ballot->candidate()
view all matches for this distribution
view release on metacpan or search on metacpan
t/Relativity.test view on Meta::CPAN
Analogously, I seek in vain for a real something in classical
mechanics (or in the special theory of relativity) to which I can
attribute the different behaviour of bodies considered with respect to
the reference systems K and K1.* Newton saw this objection and
attempted to invalidate it, but without success. But E. Mach recognsed
it most clearly of all, and because of this objection he claimed that
mechanics must be placed on a new basis. It can only be got rid of by
means of a physics which is conformable to the general principle of
relativity, since the equations of such a theory hold for every body
of reference, whatever may be its state of motion.
t/Relativity.test view on Meta::CPAN
according to Section 21 the general theory of relativity cannot
retain this law. On the contrary, we arrived at the result that
according to this latter theory the velocity of light must always
depend on the co-ordinates when a gravitational field is present. In
connection with a specific illustration in Section 23, we found
that the presence of a gravitational field invalidates the definition
of the coordinates and the ifine, which led us to our objective in the
special theory of relativity.
In view of the resuIts of these considerations we are led to the
conviction that, according to the general principle of relativity, the
view all matches for this distribution
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distribution
view release on metacpan or search on metacpan
corpus/libpalindrome/config.sub view on Meta::CPAN
# of the GNU General Public License, version 3 ("GPLv3").
# Please send patches to <config-patches@gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Alien/Base/ModuleBuild.pm view on Meta::CPAN
push @repos, $self->alien_repository_class($repo->{protocol} || 'default')->new( $repo );
}
# check validation, including c compiler for src type
@repos =
grep { $self->alien_validate_repo($_) }
@repos;
unless (@repos) {
croak "No valid repositories available";
}
return @repos;
}
sub alien_validate_repo {
my $self = shift;
my ($repo) = @_;
my $platform = $repo->{platform};
# return true if platform is undefined
view all matches for this distribution
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distribution
view release on metacpan or search on metacpan
corpus/alien_build_plugin_fetch_wget/record/old.json view on Meta::CPAN
{"-k --content-disposition -S http://localhost/corpus/alien_build_plugin_fetch_wget/dir/foo-1.01.tar":{"stderr":"--2021-05-12 00:10:35-- http://localhost/corpus/alien_build_plugin_fetch_wget/dir/foo-1.01.tar\nResolving localhost (localhost)... ::1, ...
view all matches for this distribution
view release on metacpan or search on metacpan
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
view all matches for this distribution