view release on metacpan or search on metacpan
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Drunk.pm view on Meta::CPAN
require Exporter;
use base qw[Exporter];
use vars qw[$VERSION @EXPORT %EXPORT_TAGS];
$VERSION = '0.03';
@EXPORT = qw[MALE FEMALE drunk floz_to_etoh proof_to_percent];
%EXPORT_TAGS = ( ':all' => \@EXPORT );
sub ML_IN_FLOZ () { 0.0338140226 }
sub MALE () { 0 }
lib/Acme/Drunk.pm view on Meta::CPAN
my ($body_weight, $alcohol_weight, $gender) = @_;
bac( bha($body_weight, $gender), $alcohol_weight );
}
# Proof goes to 200.
sub proof_to_percent {
my ($proof) = @_;
$proof / 2;
}
# For N fluid ounces of alcohol, find pure alcohol content.
sub floz_to_etoh {
my ($ounces, $percent) = @_;
$ounces * $percent;
}
# For N ml of alcohol, find pure alcohol content.
sub ml_to_etoh {
floz_to_etoh( $_[0] * ML_IN_FLOZ, $_[1] );
lib/Acme/Drunk.pm view on Meta::CPAN
The weight of alcohol you've had in ounces. This can be hard to
calculate, and two helpful functions are exported for your use. Here is
a common example, Guiness Gold Lager.
my $alcohol_weight = floz_to_etoh( 16, proof_to_percent( 8.48 ) );
Acme::Drunk can't do these sorts of calculations for you. You might
be a raging alcoholic, drinking 45 beers a night, or so many different
drinks that Acme::Drunk can no-longer keep track.
lib/Acme/Drunk.pm view on Meta::CPAN
If you can't come up with the alcohol_weight you've had, don't worry,
you might not yet be drunk.
=back
=head2 C<proof_to_percent()>
Accepts one argument, the proof number. Does a simple calculation to
convert it to percent. Returns the percentage.
=head2 C<floz_to_etoh()>
Accepts two arguments, the number of ounces a drink was, and the
percentage of that drink that was alcohol. Returns the fluid ounces of
alcohol contained in the drink.
=head2 C<ml_to_etoh()>
For our less US-centric friends, this function is exactly like
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/EyeDrops.pm view on Meta::CPAN
your love compatibility.
Accordingly, the love compatibility of our entire team was calculated,
and found to be disappointingly low, with one notable exception.
Taffy and Muss recorded an astonishingly high love compatibility
of ninety nine percent, the highest ever recorded!
As a tribute to their affectionate and touching bromance, I wrote this program:
use Acme::EyeDrops qw(sightly get_eye_string hjoin_shapes);
print sightly( { ShapeString => hjoin_shapes(3, (get_eye_string('heart2'))x2),
view all matches for this distribution
view release on metacpan or search on metacpan
script/gen-generic-ind-company-names view on Meta::CPAN
# } elsif ($fmt_name eq 'sci2dec') {
# if ($row->[$j] =~ /\A(?:[+-]?)(?:\d+\.|\d*\.(\d+))[eE]([+-]?\d+)\z/) {
# my $n = length($1 || "") - $2; $n = 0 if $n < 0;
# $row->[$j] = sprintf("%.${n}f", $row->[$j]);
# }
# } elsif ($fmt_name eq 'percent') {
# my $fmt = $fmt_opts->{sprintf} // '%.2f%%';
# $row->[$j] = sprintf($fmt, $row->[$j] * 100);
# } elsif ($fmt_name eq 'number') {
# require Number::Format::BigFloat;
# $row->[$j] = Number::Format::BigFloat::format_number(
view all matches for this distribution
view release on metacpan or search on metacpan
Revision history for Perl module Acme::Incorporated
1.00 Wed Jul 6 00:48:23 UTC 2005
- run the percentage tests a few more times to shake out randomness bugs
- improved kwalitee
- checked coverage
- added a few more jokes in the documentation
- make a traditional Makefile.PL
- bumped up version number
view all matches for this distribution
view release on metacpan or search on metacpan
author/en2kana.csv view on Meta::CPAN
pearl,ãã¼ã«
pen,ãã³
pencil,ãã³ã·ã«
people,ãã¼ãã«
pepper,ãããã¼
percent,ãã¼ã»ã³ã
perfect,ãã¼ãã§ã¯ã
perform,ããã©ã¼ã
perhaps,ããããã¹
period,ããªãªã
permit,ãã¼ããã
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/MetaSyntactic/punctuation.pm view on Meta::CPAN
caret
currency
dagger
degree
number_sign octothorpe
percent_sign permille_sign
pilcrow paragraph_mark
section_mark
tilde
underscore
umlaut deaeresis
view all matches for this distribution
view release on metacpan or search on metacpan
A warning message can be sent when robot has to be notified on different problems which have occured. Currently seven different warning messages can be sent, namely
UNKNOWN_MESSAGE: The server received a message it couldn't recognize.
PROCESS_TIME_LOW: The CPU usage has reached the CPU warning percentage. Only in competition-mode.
MESSAGE_SENT_IN_ILLEGAL_STATE: The message received couldn't be handled in this state of the program. For example Rotate is sent before the game has started.
UNKNOWN_OPTION: The robot sent a robot option with either illegal option name or illegal argument to that option.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/TextLayout.pm view on Meta::CPAN
} @keys;
$.Right{$char} = \@d;
return @d;
}
=head2 B<range_as_percent>
($xpercent, $ypercent) = $tl->range_as_percent($char);
Returns the percentage of x and y that this character consumes
in the I<pattern>. Number returned for each is <= 1.0.
=cut
sub range_as_percent {
my ($self, $char) = @_;
my ($ymin, $ymax, $xmin, $xmax) = ./range($char);
my $width = ./width();
my $height = ./height();
return (($xmax-$xmin+1)/$width, ($ymax-$ymin+1)/$height);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acme/Tie/Eleet.pm view on Meta::CPAN
=head2 Parameters supported by tie (both TIEHANDLE and TIESCALAR)
=over 4
=item o letters => <percentage>
The parameter allow you to transform letters to corresponding number
(ie, transform l to 1, e to 3, etc.) with a given percentage. Default
is 25 (1 char out of 4 being translitterate - if possible). That's 31337!
=item o spacer => <percentage>|<pattern>
Add extra spaces between chars. You can tell it to add random spaces
with a given percentage. Eg, 'spacer => 50' will add about 1 space
every two chars, whereas 'spacer => 0' will add no extra spaces. Or
you can provide a pattern of the form "m/n" which will be understood
as 'add an extra space after each of the m next chars, then do not add
extra space after the n next chars'. For example, 'spacer => "1/1"'
will add an extra space after one char out of two, whereas 'spacer =>
"1/0" will add extra spaces after each char. Default is 0 (no extra
space). T h a t r o c k s !
=item o case_mixer => <percentage>|<pattern>
Put some chars into uppercase. You can tell it to convert random chars
with a given percentage. Eg, 'case_mixer => 50' will convert a mean of
1 char every two chars, whereas 'case_mixer => 100' will convert every
character. Or you can provide a pattern of the form "m/n" which will
be understood as 'uppercase m chars, then do not uppercase the n next
chars'. For example, 'case_mixer => "2/1"' will convert two chars,
then left one char unchanged; whereas 'case_mixer => "0/1"' won't
lib/Acme/Tie/Eleet.pm view on Meta::CPAN
Transform words given a dictionnary. For exampe, transform 'hacker' to
'haxor', and so on... Either true or false, default to false. Kewl stuff!
=item o add_before => <percentage>
Add some preamble randomly with a given percentage. For example, it
could transform "this is my sentence." to "Yeah man, this is my
sentence.". Default to 15.
=item o add_after => <percentage>
Terminate a sentence randomly with an hacker expression according to a
given percentage. For example, it could transform "this is my
sentence." to "this is my sentence, fear us.". Default to 15.
=item o extra_sent => <percentage>
Add randomly whole sentences to the filehandle. If filehandle is read
from, it won't return the next chunk of text, but rather a leave it
where it stands and return a sentence of its own. Default to 10. All
your base are belong to us!
view all matches for this distribution
view release on metacpan or search on metacpan
geomavg
harmonicavg
stddev
rstddev
median
percentile
$Resolve_iterations
$Resolve_last_estimate
$Resolve_time
resolve
resolve_equation
use Acme::Tools;
print sum(1,2,3); # 6
print avg(2,3,4,6); # 3.75
print median(2,3,4,6); # 3.5
print percentile(25, 101..199); # 125
my @list = minus(\@listA, \@listB); # set operation
my @list = union(\@listA, \@listB); # set operation
print length(gzip("abc" x 1000)); # far less than 3000
writefile("/dir/filename",$string); # convenient
my $s=readfile("/dir/filename"); # also convenient
print "yes!" if between($PI,3,4);
print percentile(0.05, @numbers);
my @even = range(1000,2000,2); # even numbers between 1000 and 2000
my @odd = range(1001,2001,2);
my $dice = random(1,6);
$n%2 ? $list[($n-1)/2]
: ($list[$n/2-1] + $list[$n/2])/2;
}
=head2 percentile
Returns one or more percentiles of a list of numbers.
Percentile 50 is the same as the I<median>, percentile 25 is the first
quartile, 75 is the third quartile.
B<Input:>
First argument is your wanted percentile, or a refrence to a list of percentiles you want from the dataset.
If the first argument to percentile() is a scalar, this percentile is returned.
If the first argument is a reference to an array, then all those percentiles are returned as an array.
Second, third, fourth and so on argument are the numbers from which you want to find the percentile(s).
B<Examples:>
This finds the 50-percentile (the median) to the four numbers 1, 2, 3 and 4:
print "Median = " . percentile(50, 1,2,3,4); # 2.5
This:
@data=(11, 5, 3, 5, 7, 3, 1, 17, 4, 2, 6, 4, 12, 9, 0, 5);
@p = map percentile($_,@data), (25, 50, 75);
Is the same as this:
@p = percentile([25, 50, 75], @data);
But the latter is faster, especially if @data is large since it sorts
the numbers only once internally.
B<Example:>
Average (or mean) is 143
Median is 15.5 (which is the average of 9 and 22 who both equally lays in the middle)
The 25-percentile is 6.25 which are between 6 and 7, but closer to 6.
The 75-percentile is 46.5, which are between 39 and 49 but close to 49.
Linear interpolation is used to find the 25- and 75-percentile and any
other x-percentile which doesn't fall exactly on one of the numbers in
the set.
B<Interpolation:>
As you saw, 6.25 are closer to 6 than to 7 because 25% along the set of
the twelve numbers is closer to the third number (6) than to he fourth
(7). The median (50-percentile) is also really interpolated, but it is
always in the middle of the two center numbers if there are an even count
of numbers.
However, there is two methods of interpolation:
Example, we have only three numbers: 5, 6 and 7.
Method 1: The most common is to say that 5 and 7 lays on the 25- and
75-percentile. This method is used in Acme::Tools.
Method 2: In Oracle databases the least and greatest numbers
always lay on the 0- and 100-percentile.
As an argument on why Oracles (and others?) definition is not the best way is to
look at your data as for instance temperature measurements. If you
place the highest temperature on the 100-percentile you are sort of
saying that there can never be a higher temperatures in future measurements.
A quick non-exhaustive Google survey suggests that method 1 here is most used.
The larger the data sets, the less difference there is between the two methods.
B<Extrapolation:>
In method one, when you want a percentile outside of any possible
interpolation, you use the smallest and second smallest to extrapolate
from. For instance in the data set C<5, 6, 7>, if you want an
x-percentile of x < 25, this is below 5.
If you feel tempted to go below 0 or above 100, C<percentile()> will
I<die> (or I<croak> to be more precise)
Another method could be to use "soft curves" instead of "straight
lines" in interpolation. Maybe B-splines or Bezier curves. This is not
used here.
For large sets of data Hoares algorithm would be faster than the
simple straightforward implementation used in C<percentile()>
here. Hoares don't sort all the numbers fully.
B<Differences between the two main methods described above:>
Data: 1, 4, 6, 7, 8, 9, 22, 24, 39, 49, 555, 992
Percentile Method 1 Method 2
(Acme::Tools::percentile (Oracle)
and others)
------------- ----------------------------- ---------
0 -2 1
1 -1.61 1.33
25 6.25 6.75
99 1372.19 943.93
100 1429 992
Found like this:
perl -MAcme::Tools -le 'print for percentile([0,1,25,50,75,99,100], 1,4,6,7,8,9,22,24,39,49,555,992)'
And like this in Oracle-databases:
select
percentile_cont(0.00) within group(order by n) per0,
percentile_cont(0.01) within group(order by n) per1,
percentile_cont(0.25) within group(order by n) per25,
percentile_cont(0.50) within group(order by n) per50,
percentile_cont(0.75) within group(order by n) per75,
percentile_cont(0.99) within group(order by n) per99,
percentile_cont(1.00) within group(order by n) per100
from (
select 0+regexp_substr('1,4,6,7,8,9,22,24,39,49,555,992','[^,]+',1,i) n
from dual,(select level i from dual connect by level <= 12)
);
(Oracle also provides a similar function: C<percentile_disc> where I<disc>
is short for I<discrete>, meaning no interpolation is taking
place. Instead the closest number from the data set is picked.)
=cut
sub percentile {
my(@p,@t,@ret);
if(ref($_[0]) eq 'ARRAY'){ @p=@{shift()} }
elsif(not ref($_[0])) { @p=(shift()) }
else{croak()}
@t=@_;
Per 182 180 182 183 75 73 76 74
Tone 70 69 70 71
Options:
Options to sort differently and show sums and percents are available. (...MORE DOC ON THAT LATER...)
See also L<Data::Pivot>
=cut
advantage over other data structures for representing sets.
In the example below, a set of 100000 phone numbers (or any string of
any length) can be "stored" in just 91230 bytes if you accept that you
can only check the data structure for existence of a string and accept
false positives with an error rate of 0.03 (that is three percent, error
rates are given in numbers larger than 0 and smaller than 1).
You can not retrieve the strings in the set without using "brute
force" methods and even then you would get slightly more strings than
you put in because of the error rate inaccuracy.
4533 counters = 6
445 counters = 7
46 counters = 8
1 counters = 9
Even after the error_rate is changed from 0.001 to a percent of that, 0.00001, the limit of 16 (4 bits) is still far away:
47162242 counters = 0
33457237 counters = 1
11865217 counters = 2
2804447 counters = 3
=head2 bfsum
Returns the number of 1's in the filter.
my $percent=100*bfsum($bf)/$$bf{filterlength};
printf "The filter is %.1f%% filled\n",$percent; #prints 50.0% or so if filled to capacity
Sums the counters for counting bloom filters (much slower than for non counting).
=head2 bfdimensions
k = log(1/p) / log(2) # p = error_rate, uses perls internal log() with base e (2.718)
...that is: m = the best number of bits in the filter and k = the best
number of hash functions optimized for the given capacity (n) and
error_rate (p). Note that k is a dependent only of the error_rate. At
about two percent error rate the bloom filter needs just the same
number of bytes as the number of keys.
Storage (bytes):
Capacity Error-rate Error-rate Error-rate Error-rate Error-rate Error-rate Error-rate Error-rate Error-rate Error-rate Error-rate Error-rate
0.000000001 0.00000001 0.0000001 0.000001 0.00001 0.0001 0.001 0.01 0.02141585 0.1 0.5 0.99
due -K Like -k but uses 1000 instead of 1024
due -z View two extentions if .z .Z .gz .bz2 .rz or .xz (.tar.gz, not just .gz)
due -M Also show min, medium and max date (mtime) of files, give an idea of their age
due -C Like -M, but create time instead (ctime)
due -A Like -M, but access time instead (atime)
due -P Also show 10, 50 (medium) and 90 percentile of file date
due -MP Both -M and -P, shows min, 10p, 50p, 90p and max
due -a Sort output alphabetically by extention (default order is by size)
due -c Sort output by number of files
due -i Ignore case, .GZ and .gz is the same, output in lower case
due -t Adds time of day to -M and -P output
my $perc=!$o{M}&&!$o{C}&&!$o{A}&&!$o{P}?sub{""}:
sub{
my @p=$o{P}?(10,50,90):(50);
my @m=@_>0 ? do {grep$_, split",", $xtime{$_[0]}}
: do {grep$_, map {split","} values %xtime};
my @r=percentile(\@p,@m);
@r=(min(@m),@r,max(@m)) if $o{M}||$o{C}||$o{A};
@r=map int($_), @r;
my $fmt=$o{t}?'YYYY/MM/DD-MM:MI:SS':'YYYY/MM/DD';
@r=map tms($_,$fmt), @r;
" ".join(" ",@r);
view all matches for this distribution
view release on metacpan or search on metacpan
tie $plait => Acme::please, please => " s'il vous plait";
print "will you sit down$plait?\n" for 1..10; # expect 2.5 pleases in French
=head1 DESCRIPTION
A tie interface for creating scalar variables that have a percentage chance
of having either a predetermined value or they are empty strings when
evaluated. The tie interface takes two named arguments, C<pctg> and C<please>.
=head2 pctg
C<pctg>, which is short for "percentage", will be compared with C<rand(100)>
and the null string will be returned if the random number is larger. The
efault value is C<25>.
=head2 please
view all matches for this distribution
view release on metacpan or search on metacpan
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Acrux/Util.pm view on Meta::CPAN
This function is somewhat similar to the C function strftime(), except that the data source
is not the date and time, but the set of data passed to the function.
The format string may be containing any combination of regular characters and special format
specifiers (patterns). These patterns are replaced to the corresponding values to represent
the data passed as second function argument. They all begin with a percentage (%) sign,
and are: '%c' or '%{word}'. The "c" is single character specifier like %d, the "word" is
regular word like "month" or "filename"
If you give a pattern that doesn't exist, then it is simply treated as text.
If you give a pattern that doesn't defined but is exist in data set, then it will be
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Agent/TCLI/Package/Net/HTTP.pm view on Meta::CPAN
my $tag = $gen_args->[1]; # Request ID tag from.
my $got = $call_args->[0]; # Number of bytes retrieved so far.
my $tot = $call_args->[1]; # Total bytes to be retrieved.
my $oct = $call_args->[2]; # Chunk of raw octets received this time.
my $percent = $got / $tot * 100;
# printf(
# "-- %.0f%% [%d/%d]: %s\n", $percent, $got, $tot, $req->uri()
# );
my $request = $self->requests->{$tag}{'request'};
# Not doing anything yet.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Aion/Telemetry.pm view on Meta::CPAN
my @v = values %REFMARK;
%REFMARK = (), undef $REFMARK_LAST_TIME if $clean;
my $total = sum map $_->{interval}, @v;
$_->{percent} = ($_->{interval} / $total) * 100 for @v;
@v = sort {$b->{percent} <=> $a->{percent}} @v;
return \@v, $total if wantarray;
join "",
"Ref Report -- Total time: ${\ sinterval $total }\n",
sprintf("%8s %12s %6s %s\n", "Count", "Time", "Percent", "Interval"),
"----------------------------------------------\n",
map sprintf("%8s %12s %6.2f%% %s\n",
$_->{count},
sinterval $_->{interval},
$_->{percent},
$_->{mark},
), @v;
}
1;
lib/Aion/Telemetry.pm view on Meta::CPAN
round $total # -> 0.5
$report->[0]{mark} # => reper2
$report->[0]{count} # -> 2
round $report->[0]{interval} # -> 0.3
round $report->[0]{percent} # -> 60.0
$report->[1]{mark} # => main
$report->[1]{count} # -> 1
round $report->[1]{interval} # -> 0.2
round $report->[1]{percent} # -> 40.0
=head2 refreport (;$clean)
Make a report on reference points.
view all matches for this distribution
view release on metacpan or search on metacpan
bin/analogize.pl view on Meta::CPAN
i.e. cardinality, etc.
=item C<statistical_summary>
A statistical summary of the classification results, including
all predicted outcomes with their scores and percentages and
the total score for all outcomes. Whether the predicted class is
correct, incorrect, or a tie is also included, if the test item
had a known class.
=item C<analogical_set_summary>
The analogical set, showing all items that contributed to the predicted
outcome, along with the amount contributed by each item (score and
percentage overall).
=item C<gang_summary>
A summary of the gang effects on the outcome prediction.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/Accounting/Report.pm view on Meta::CPAN
our $VERSION = '0.02';
sub process {
my ($occhash,$field_groups,$group_occ) = @_;
for(keys %{$occhash}) {
$self->report_occurrence_percentage($_,$occhash);
}
for(0..@{$field_groups}-1) {
$self->report_field_group_occurrence_percentage($_,$field_groups,$group_occ);
}
}
__END__
=head1 NAME
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/Backoff/RetryTimeouts.pm view on Meta::CPAN
#pod
#pod =item *
#pod
#pod B<Adjustable timeouts> - Providing an adjustable timeout after each request solves the
#pod opposite problem of exponential backoffs: slower, unresponsive errors that gobble up all
#pod of the max duration time in one go. Each new timeout is a certain percentage of the time
#pod left.
#pod
#pod =back
#pod
#pod =head2 Typical scenario
lib/Algorithm/Backoff/RetryTimeouts.pm view on Meta::CPAN
=item *
B<Adjustable timeouts> - Providing an adjustable timeout after each request solves the
opposite problem of exponential backoffs: slower, unresponsive errors that gobble up all
of the max duration time in one go. Each new timeout is a certain percentage of the time
left.
=back
=head2 Typical scenario
view all matches for this distribution
view release on metacpan or search on metacpan
t/test.data view on Meta::CPAN
. . O
While IN O
nearly RB B
equal JJ I
percentages NNS I
of IN O
black JJ B
and CC I
white JJ I
women NNS I
t/test.data view on Meta::CPAN
rate NN I
to TO O
decline VB O
about IN B
one-quarter NN I
percentage NN I
point NN I
. . O
The DT B
federal JJ I
view all matches for this distribution
view release on metacpan or search on metacpan
ExamplesRandomizedTrees/classify_database_records.pl view on Meta::CPAN
$confusion_matrix_row2[1] += 1;
}
}
}
my $percentage_errors = ($total_errors * 100.0) / scalar keys %calculated_classifications;
print "\n\nClassification error rate: $percentage_errors\n";
print "\nConfusion Matrix:\n\n";
printf("%50s %25s\n", "classified as NOT at risk", "classified as at risk");
printf("Known to be NOT at risk: %10d %35d\n\n", @confusion_matrix_row1); #(G)
printf("Known to be at risk:%15d %35d\n\n", @confusion_matrix_row2); #(H)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/Evolutionary/Op/Convergence_Terminator.pm view on Meta::CPAN
use strict; #-*-cperl-*-
use warnings;
=head1 NAME
Algorithm::Evolutionary::Op::Convergence_Terminator - Checks for termination of an algorithm, returns true if a certain percentage of the population is the same
=head1 SYNOPSIS
my $ct = new Algorithm::Evolutionary::Op::Convergence_Terminator 0.5;
do {
view all matches for this distribution
view release on metacpan or search on metacpan
there is an encoding/decoding bit sequences for these ones.
It also guarantees that these bit sequences are longer than
all other encoding/decoding sequences of counted characters/substrings.
The countings needn't be integers,
they could also be fractions (e.g. percentage).
=item $huff->encode_hash
Returns a reference to the encoding hash.
The keys of the encoding hash are the characters/strings passed
view all matches for this distribution
view release on metacpan or search on metacpan
BEGIN { use_ok 'Algorithm::Kelly' }
is optimal_f(0, 1), -1, 'Zero chance has optimal f of minus one';
is optimal_f(0.5, 2), 0.25, 'Fifty-fifty chance with net odds of two is a quarter of bankroll';
is optimal_f(1, 2), 1, 'One hundred percent chance has an optimal f of one';
ok exception { optimal_f(0) };
ok exception { optimal_f(-0.1, 50) };
ok exception { optimal_f(1.1, 4) };
ok exception { optimal_f(0.5, -50) };
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/LDA.pm view on Meta::CPAN
beta();
#Start Main loop
for my $iter (1..$maxIterations)
{
#Calculate and print percentage completed
my $a = $iter * 100 / $maxIterations;
print "Iteration: $iter | $a% Completed...\n";
#Shuffle Documents
@{$self->documents} = shuffle(@{$self->documents});
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/MOS.pm view on Meta::CPAN
}
else {
$r_value = 93.2 - ($effective_latency - 120) / 10;
}
# Now, let's deduct 2.5 r_value per percentage of packet_loss
$r_value = $r_value - ($packet_loss * 2.5);
# Convert the r_value into an MOS value. (this is a known formula)
$ret_val = 1 +
(0.035) *
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Algorithm/TrunkClassifier/Classification.pm view on Meta::CPAN
use POSIX;
our $VERSION = "v1.0.1";
#Description: Function responsible for building decision trunks and classifying test samples using LOOCV
#Parameters: (1) Package, (2) input dataset, (3) test dataset, (4) classification procedure, (5) split percent,
# (6) testset data file name, (7) classification variable name, (8) output folder name,
# (9) number of levels, (10) verbose flag, (11) input data file name (12) useall flag
#Return value: None
sub trainAndClassify($ $ $ $ $ $ $ $ $ $ $ $ $){
shift(@_);
lib/Algorithm/TrunkClassifier/Classification.pm view on Meta::CPAN
my $name2 = $dataWrapper->getClassTwoName();
my $log = "Trunk classifier log\n";
$log .= "Input data file: $DATAFILE\n";
$log .= "Testset data file: $TESTFILE\n";
$log .= "Procedure: $CLASSIFY\n";
$log .= "Split percent: $SPLITPERCENT\n";
$log .= "Number of levels: $numTrunkLevels[0]\n";
$log .= "Classification variable: $CLASSNAME\n";
$log .= "Training set classes:\n";
if($CLASSIFY eq "loocv"){
$log .= "\tClass one size: " . $dataWrapper->getClassSize($name1) . " ($name1)\n";
view all matches for this distribution
view release on metacpan or search on metacpan
share/static/alice.js view on Meta::CPAN
((node.hasChildNodes() && !Element.hasClassName(node,className)) ?
Element.collectTextNodesIgnoreClass(node, className) : ''));
}).flatten().join('');
};
Element.setContentZoom = function(element, percent) {
element = $(element);
element.setStyle({fontSize: (percent/100) + 'em'});
if (Prototype.Browser.WebKit) window.scrollBy(0,0);
return element;
};
Element.getInlineOpacity = function(element){
share/static/alice.js view on Meta::CPAN
return new Effect.Move(element,
Object.extend({ x: toLeft, y: toTop }, arguments[3] || { }));
};
Effect.Scale = Class.create(Effect.Base, {
initialize: function(element, percent) {
this.element = $(element);
if (!this.element) throw(Effect._elementDoesNotExistError);
var options = Object.extend({
scaleX: true,
scaleY: true,
scaleContent: true,
scaleFromCenter: false,
scaleMode: 'box', // 'box' or 'contents' or { } with provided values
scaleFrom: 100.0,
scaleTo: percent
}, arguments[2] || { });
this.start(options);
},
setup: function() {
this.restoreAfterFinish = this.options.restoreAfterFinish || false;
view all matches for this distribution