view release on metacpan or search on metacpan
lib/Audio/MPD/Common/Time.pm view on Meta::CPAN
traits => [ 'Hash' ],
is => 'ro',
isa => 'HashRef',
lazy_build => 1,
handles => {
percent => [ get => 'percent' ],
sofar => [ get => 'sofar' ],
left => [ get => 'left' ],
total => [ get => 'total' ],
sofar_secs => [ get => 'sofar_secs' ],
sofar_mins => [ get => 'sofar_mins' ],
lib/Audio/MPD/Common/Time.pm view on Meta::CPAN
my $self = shift;
my $time = $self->time;
my ($seconds_sofar, $seconds_total) = split /:/, $time;
my $seconds_left = $seconds_total - $seconds_sofar;
my $percent = $seconds_total ? 100*$seconds_sofar/$seconds_total : 0;
# Parse the time so far
my $sofar_mins = int( $seconds_sofar / 60 );
my $sofar_secs = $seconds_sofar % 60;
my $sofar = sprintf "%d:%02d", $sofar_mins, $sofar_secs;
lib/Audio/MPD/Common/Time.pm view on Meta::CPAN
# cooked values
sofar => $sofar,
left => $left,
total => $total,
percent => sprintf("%.1f", $percent), # 1 decimal
# details
sofar_secs => $sofar_secs,
sofar_mins => $sofar_mins,
total_secs => $total_secs,
lib/Audio/MPD/Common/Time.pm view on Meta::CPAN
=head2 my $str = $time->left;
Return total C<$time> (C<minutes:seconds> format).
=head2 my $percent = $time->percent;
Return elapsed C<$time> (percentage, 1 digit).
=head2 my $secs = $time->seconds_sofar;
Return elapsed C<$time> in seconds.
view all matches for this distribution
view release on metacpan or search on metacpan
If this exists, filtering is disabled.
=item I<lowpass_filter_width>
The width of the filter expressed as a percentage of the filter frequency.
Defaults to 15%.
=item I<highpass_filter_frequency>
If set to a frequency (in Hertz), the input will pass through a filter
If this exists, filtering is disabled.
=item I<highpass_filter_width>
The width of the filter expressed as a percentage of the filter frequency.
Defaults to 15%.
=item I<apply_delay>
This will correct for the MP3 encoding delay. If set to 1, the first
view all matches for this distribution
view release on metacpan or search on metacpan
demo/player-gtk-ipc view on Meta::CPAN
sub progress_update { 1 }
sub progress_timeout {
my $progressbar = shift;
my $new_val = $progressbar->get_current_percentage;
$new_val += 0.02;
$new_val = 0.0 if $new_val >= 1.0;
$progressbar->update($new_val);
return 1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Audio/Nama.pm view on Meta::CPAN
example: |
vol * 1.5 # Multiply the current volume by 1.5
vol 75 # Set the current volume to 75
! # Depending on your namarc configuration, this means
! # either 75% of full volume (-ea) or 75 dB (-eadb).
vol - 5.7 # Decrease current volume by 5.7 (percent or dB)
vol # Display the volume setting of the current track.
mute:
type: track
what: |
Mute the current track by reducing the volume parameter.
lib/Audio/Nama.pm view on Meta::CPAN
pan:
type: track
what: |
Change or display the current panning position of the
current track. Panning is moving the audio in the stereo
panorama between right and left. Position is given in percent.
0 is hard left and 100 hard right, 50% is dead centre.
short: p
parameters: [ <float:pan_position_in_percent> ]
example: |
pan 75 # Pan the track to a position between centre and hard right
p 50 # Move the current track to the centre.
pan # Show the current position of the track in the stereo panorama.
pan_right:
lib/Audio/Nama.pm view on Meta::CPAN
afx etc 6 100 45 2.5 # add a chorus effect on the reverbed signal
guitar # Change back to the main guitar track
wet 25 # Set the balance between wet/dry track to 25% wet, 75% dry.
set_insert_wetness:
type: effect
what: Set wet/dry balance of the insert for the current track. The balance is given in percent, 0 meaning dry and 100 wet signal only.
short: wet
parameters: [ pre | post ] <n_wetness>
example: |
wet pre 50 # Set the prefader insert to be balanced 50/50 wet/dry.
wet 100 # Simpler if there's only one insert
lib/Audio/Nama.pm view on Meta::CPAN
unmute $i;
}
}
# Quantise current track to the nearest quantise_note denomination with a
# precision of precision percent starting at start_position for
# quantise_measures measures.
# Example:
# cquantm now 12 16 100 # quantise the next 8 measures to 16th notes with
# # 100% precision
proc cquantm start_position quantise_measures quantise_note precision {
lib/Audio/Nama.pm view on Meta::CPAN
return 0;
}
}
# Quantise a track to the nearest quantise_note denomination with a
# precision of precision percent starting at start_position for
# quantise_measures measures.
# Example:
# quantm piano 0 10 8 75 # quantise piano from beginning to 10 measures
# # to 8th notes with 75% precision
proc quantm my_track start_position quantise_measures quantise_note precision {
lib/Audio/Nama.pm view on Meta::CPAN
return 0;
}
}
# Quantise the current track to the nearest quantise_note with a
# precision of precision percent starting at start_position upto
# end_position.
# Example:
# cquant 0 end 16 95
proc cquant start_position end_position quantise_note precision {
let start_pos = [eval_pos $start_position];
lib/Audio/Nama.pm view on Meta::CPAN
return 0;
}
}
# Quantise the track to the nearest quantise_note denomination with a
# precision of precision percent starting at start_position upto
# end_position.
# Example:
# quant piano 2 end 16 100
proc quant my_track start_position end_position quantise_note precision {
let start_pos = [eval_pos $start_position];
lib/Audio/Nama.pm view on Meta::CPAN
return 0;
}
}
# Quantise all track in the group to the nearest quantise_notes with a
# precision of precision percent, starting at start_position for
# quantise_measures measures.
# example:
# tnew piano
# tnew bass
# let band = {piano bass}
lib/Audio/Nama.pm view on Meta::CPAN
}
return $cur_return_value;
}
# Quantise all tracks in the group to the nearest quantise_note with a
# precision of precision percent starting at start_position upto
# end_position.
# Example:
# tnew piano
# tnew bass
# let band = {piano bass}
view all matches for this distribution
view release on metacpan or search on metacpan
mpg123/README view on Meta::CPAN
NAS_SOUND_PORT_DURATION
NAS_SOUND_LOW_WATER_MARK
Change them to optimize the player for your environment. For slow
networks a proven config is:
#define NAS_SOUND_PORT_DURATION 10 /* seconds */
#define NAS_SOUND_LOW_WATER_MARK 75 /* percent */
Pentium optimization notes:
---------------------------
The ASM optimaztions are especially for Intel Pentium FPUs.
On other processorts the egcs compiler optimization
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Audio/RPLD.pm view on Meta::CPAN
The unit of value.
=item pc
The volume in percent.
=back
The current volume (as float) is value/scale.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Audio/Radio/XM/PCR.pm view on Meta::CPAN
$self->{'signal_strength'}->{'sat'}->{'1'}->{'db'} = $sat_db[1];
$self->{'signal_strength'}->{'sat'}->{'2'}->{'db'} = $sat_db[2];
for (my $x=1; $x<=2; $x++) {
if ($sat_db[$x] < 12) {
$self->{'signal_strength'}->{'sat'}->{$x}->{'percent'} = $sat_db[$x] * 80 / 12;
} elsif ($sat_db[$x] < 16) {
$self->{'signal_strength'}->{'sat'}->{$x}->{'percent'} = ((($sat_db[$x] - 48) * 20 / 4) + 80);
} else {
$self->{'signal_strength'}->{'sat'}->{$x}->{'percent'} = 99.9;
}
}
# Terrestrial
my $terr_signal = $self->{'signal_strength'}->{'terr'}->{1}->{'BER'} / 68;
lib/Audio/Radio/XM/PCR.pm view on Meta::CPAN
$terr_signal = 0;
} elsif ($terr_signal >= 100) {
$terr_signal = 100;
}
$self->{'signal_strength'}->{'terr'}->{1}->{'percent'} = $terr_signal;
# Summary Information
if ($self->{'signal_strength'}->{'sat'}->{'1'}->{'db'} > $self->{'signal_strength'}->{'sat'}->{'2'}->{'db'}) {
$self->{'signal_strength'}->{'sat'}->{'db'} = $self->{'signal_strength'}->{'sat'}->{'1'}->{'db'};
$self->{'signal_strength'}->{'sat'}->{'percent'} = $self->{'signal_strength'}->{'sat'}->{'1'}->{'percent'};
} else {
$self->{'signal_strength'}->{'sat'}->{'db'} = $self->{'signal_strength'}->{'sat'}->{'2'}->{'db'};
$self->{'signal_strength'}->{'sat'}->{'percent'} = $self->{'signal_strength'}->{'sat'}->{'2'}->{'percent'};
}
$self->{'signal_strength'}->{'terr'}->{'percent'} = $self->{'signal_strength'}->{'terr'}->{'1'}->{'percent'};
}
sub _read_mon_song_time {
my $self = shift;
my $code = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
goto out;
}
// Use Xing TOC if available
if ( mp3->xing_frame->has_toc ) {
float percent;
uint8_t ipercent;
uint16_t tva;
uint16_t tvb;
float tvx;
percent = (offset * 1.0 / mp3->song_length_ms) * 100;
ipercent = (int)percent;
if (ipercent > 99)
ipercent = 99;
// Interpolate between 2 TOC points
tva = mp3->xing_frame->xing_toc[ipercent];
if (ipercent < 99) {
tvb = mp3->xing_frame->xing_toc[ipercent + 1];
}
else {
tvb = 256;
}
tvx = tva + (tvb - tva) * (percent - ipercent);
frame_offset = (int)((1.0/256.0) * tvx * mp3->xing_frame->xing_bytes);
frame_offset += mp3->audio_offset;
if (frame_offset == mp3->audio_offset) {
DEBUG_TRACE("find_frame: frame_offset == audio_offset, skipping to next frame\n");
frame_offset += 1;
}
DEBUG_TRACE("find_frame: using Xing TOC, song_length_ms: %d, percent: %f, tva: %d, tvb: %d, tvx: %f, frame offset: %d\n",
mp3->song_length_ms, percent, tva, tvb, tvx, frame_offset
);
}
else {
// calculate offset using bitrate
float bytes_per_ms = mp3->bitrate / 8.0;
view all matches for this distribution
view release on metacpan or search on metacpan
example/player.pl view on Meta::CPAN
=over 5
=item B<--volume|-v> volume
Play at a given software volume (in percent).
=item B<--seek|-s> seconds
Start playback from a given position in the audio.
view all matches for this distribution
view release on metacpan or search on metacpan
examples/js/jquery-1.9.1.js view on Meta::CPAN
ret = jQuery.style( elem, name );
}
// A tribute to the "awesome hack by Dean Edwards"
// Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
// Remember the original values
width = style.width;
examples/js/jquery-1.9.1.js view on Meta::CPAN
}
};
}
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
// getComputedStyle returns percent when specified for top/left/bottom/right
// rather than make the css module depend on the offset module, we just check for it here
if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
jQuery.each( [ "top", "left" ], function( i, prop ) {
jQuery.cssHooks[ prop ] = {
get: function( elem, computed ) {
if ( computed ) {
computed = curCSS( elem, prop );
// if curCSS returns percentage, fallback to offset
return rnumnonpx.test( computed ) ?
jQuery( elem ).position()[ prop ] + "px" :
computed;
}
}
examples/js/jquery-1.9.1.js view on Meta::CPAN
}
var currentTime = fxNow || createFxNow(),
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
temp = remaining / animation.duration || 0,
percent = 1 - temp,
index = 0,
length = animation.tweens.length;
for ( ; index < length ; index++ ) {
animation.tweens[ index ].run( percent );
}
deferred.notifyWith( elem, [ animation, percent, remaining ]);
if ( percent < 1 && length ) {
return remaining;
} else {
deferred.resolveWith( elem, [ animation ] );
return false;
}
examples/js/jquery-1.9.1.js view on Meta::CPAN
return hooks && hooks.get ?
hooks.get( this ) :
Tween.propHooks._default.get( this );
},
run: function( percent ) {
var eased,
hooks = Tween.propHooks[ this.prop ];
if ( this.options.duration ) {
this.pos = eased = jQuery.easing[ this.easing ](
percent, this.options.duration * percent, 0, 1, this.options.duration
);
} else {
this.pos = eased = percent;
}
this.now = ( this.end - this.start ) * eased + this.start;
if ( this.options.step ) {
this.options.step.call( this.elem, this.now, this );
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
"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
"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
"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
"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
t/modules.pm view on Meta::CPAN
use Cwd;
use Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(%modules $keep
perlversion
percent log_diag log_pass log_err get_module_list
random_sublist is_subset
);
our (%modules);
our $log = 0;
our $keep = '';
t/modules.pm view on Meta::CPAN
: '-nt'),
($dVAR ? '-dVAR' : '')
);
}
sub percent {
$_[1] ? sprintf("%0.1f%%", $_[0]*100/$_[1]) : '';
}
sub log_diag {
my $message = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BBCode/Util.pm view on Meta::CPAN
} else {
return undef;
}
}
# CSS 2.1 4.3.3 <percentage>
# Note: The same concerns apply as for <relative-size>
if(/^ ( [\s\d._+-]+ ) % $/x) {
my $n = parseNum $1;
if(defined $n and $n > 0) {
$n *= 0.01;
view all matches for this distribution
view release on metacpan or search on metacpan
db_env_txn_checkpoint (DB_ENV *env, U32 kbyte = 0, U32 min = 0, U32 flags = 0, SV *callback = 0)
flags: FORCE
db_env_lock_detect (DB_ENV *env, U32 flags = 0, U32 atype = DB_LOCK_DEFAULT, SV *dummy = 0, SV *callback = 0)
atype: LOCK_DEFAULT LOCK_EXPIRE LOCK_MAXLOCKS LOCK_MAXWRITE LOCK_MINLOCKS LOCK_MINWRITE LOCK_OLDEST LOCK_RANDOM LOCK_YOUNGEST
db_env_memp_sync (DB_ENV *env, SV *dummy = 0, SV *callback = 0)
db_env_memp_trickle (DB_ENV *env, int percent, SV *dummy = 0, SV *callback = 0)
db_env_dbremove (DB_ENV *env, DB_TXN_ornull *txnid, bdb_filename file, bdb_filename database, U32 flags = 0, SV *callback = 0)
db_env_dbrename (DB_ENV *env, DB_TXN_ornull *txnid, bdb_filename file, bdb_filename database, bdb_filename newname, U32 flags = 0, SV *callback = 0)
db_env_log_archive (DB_ENV *env, SV *listp, U32 flags = 0, SV *callback = 0)
db_env_lsn_reset (DB_ENV *env, bdb_filename db, U32 flags = 0, SV *callback = 0)
db_env_fileid_reset (DB_ENV *env, bdb_filename db, U32 flags = 0, SV *callback = 0)
view all matches for this distribution
view release on metacpan or search on metacpan
resident_set_size => 'rssize',
rssize_before_swap => 'swrss',
text_size => 'tsize',
exit_status => 'xstat',
accounting_flags => 'acflag',
percent_cpu => 'pctcpu',
estimated_cpu => 'estcpu',
sleep_time => 'slptime',
time_last_swap => 'swtime',
elapsed_time => 'runtime',
process_flags => 'flag',
=item accounting_flags, acflag
Process accounting flags (TODO: decode them).
=item percent_cpu, pctcpu
Percentage of CPU time used by the process (for the duration of
swtime, see below).
=item estimated_cpu, estcpu
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
"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/Badge/Depot/Plugin/Coverage.pm view on Meta::CPAN
=head1 ATTRIBUTES
=head2 coverage
Set the code coverage percentage manually. Should only be used when L<Dist::Zilla::App::Command::coverh> is B<not> used.
=head2 custom_image_url
Default: C<https://img.shields.io/badge/%s-%s-%s.svg>
Override the default image url. It is expected to have three C<sprintf> placeholders: Text, coverage percentage and color.
=head2 max_age
Default: C<60>
lib/Badge/Depot/Plugin/Coverage.pm view on Meta::CPAN
=head2 text
Default: C<coverage>
Set a different coverage percentage. The percentage sign will be appended.
=head1 SEE ALSO
=over 4
view all matches for this distribution
view release on metacpan or search on metacpan
t/badge-simple.t view on Meta::CPAN
for my $k (qw/ total_w l_w r_w l_txt_c r_txt_c /) {
my $delta = abs( $exp->{$k} - $got->{$k} );
my $max_err = $k eq 'total_w' ? 8 : 4; #TODO Later: Can we make these smaller?
if ($exp->{$k}<100) # for lengths of <100 pixels, apply error to pixel count
{ ok $delta<=$max_err, "$k: exp $$exp{$k}, got $$got{$k}, delta $delta is <= ${max_err}px" }
else { # for lengths of >=100 pixels, apply error to percentage difference
my $percent = sprintf "%0.1f", 100*$delta/$exp->{$k};
ok $percent<=$max_err, "$k: exp $$exp{$k}, got $$got{$k}, delta $delta ($percent%) <= $max_err%";
}
}
};
}
view all matches for this distribution
view release on metacpan or search on metacpan
examples/ws.pl view on Meta::CPAN
team_ss_claim_point => 'team_pos_claim_point("ss")',
team_of_claim_point => 'team_pos_claim_point("of")',
team_pos_claim_point => sub {
my $pos = shift;
my $cp = "${pos}_claim_percentage";
my $weight = "${pos}_fielding_weight";
exists $_->fielding->{$pos} ? ($_->$cp - 0.2) * $_->$weight : 0;
},
team_c_ws => 'team_fielding_ws * team_c_claim_point / team_total_claim_point',
examples/ws.pl view on Meta::CPAN
return $val < 0 ? 0 : $val > $max ? $max : $val;
},
# Catchers' Claim Percentage
#c_claim_percentage => 'c_cs_grade + c_non_so_e_rate_grade + c_bunt_allowed_grade + c_pb_grade',
c_claim_percentage => '(
limit(c_cs_grade, 50) +
limit(c_non_so_e_rate_grade, 30) +
limit(c_bunt_allowed_grade, 10)
) * 10 / 9',
examples/ws.pl view on Meta::CPAN
c_non_so_e_rate_grade => '30 - 15 * non_so_error_per / $league->non_so_error_per',
c_bunt_allowed_grade => '0', # CPBL doesn't have this record
c_pb_grade => '5 + ($league->pb * tlpop - pb) / 5',
# 1st Basemans' Claim Percentage
b1_claim_percentage => '
limit(b1_def_change_grade, 40) +
limit(b1_e_ratio_grade, 30) +
limit(b1_arm_grade, 20) +
limit(err_of_b3ss_grade, 10)',
examples/ws.pl view on Meta::CPAN
($league->fielders("b1")->a + $league->fielders("ss")->f_dp / 2 - $league->fielders("p")->po - $league->fielders("b2")->f_dp / 2) ) / 5',
err_of_b3ss_grade => '10 - 5 * (fielders("b3")->e + fielders("ss")->e) / (($league->fielders("b3")->e + $league->fielders("ss")->e) * tlpop)',
# 2nd Basemans' Claim Percentage
b2_claim_percentage => '
limit(b2_dp_grade, 40) +
limit(b2_a_grade, 30) +
limit(b2_e_ratio_grade, 20) +
limit(b2_po_grade, 10)',
examples/ws.pl view on Meta::CPAN
sh => '0',
e_ratio => '1 - fpct',
# 3nd Basemans' Claim Percentage
b3_claim_percentage => '(
limit(b3_a_grade, 50) +
limit(b3_e_ratio_grade, 30) +
limit(b3_dp_grade, 10)
) * 10 / 9',
examples/ws.pl view on Meta::CPAN
b3_dp_grade => '5 + (fielders("b3")->f_dp - expected_dp * ($league->fielders("b3")->f_dp / $league->f_dp)) / 2',
league_b3_fpct => '$league->fielders("b3")->fpct',
# Shortstops' Claim Percentage
ss_claim_percentage => '
limit(ss_a_grade, 40) +
limit(ss_dp_grade, 30) +
limit(ss_e_ratio_grade, 20) +
limit(ss_po_grade, 10)',
examples/ws.pl view on Meta::CPAN
) / 15',
# Outfielders' Claim Percentage
of_claim_percentage => '
limit(of_po_grade, 40) +
limit(of_der_grade, 40) +
limit(of_a_and_po_grade, 10) +
limit(of_e_ration_grade, 10)',
examples/ws.pl view on Meta::CPAN
print "TEAM\tNAME\tBAT\tPITCH\tFIELD\tTOTAL\tææwsæ¯é\n";
$_->print qw/ team name att_ws pitch_ws def_ws ws pitcher_ws_weight / for $league->pitchers;
print "\n";
#$_->print qw/ name c_claim_percentage b1_claim_percentage b2_claim_percentage b3_claim_percentage ss_claim_percentage of_claim_percentage / for $league->teams;
#print Dumper($league->teams('bears'));
for ($league->batters) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Baseball/Simulation.pm view on Meta::CPAN
# StolenBases
#
# Description: Calculates the averages for the batting statistics
#
# Returns: The array consisting the cumalitve averages for:
# WalkChance - The percentage for a walk
# SingleChance - The percentage that a single can be hit
# DoubleChance - The percentage that a single can be hit
# TripleChance - The percentage that a single can be hit
# HomerChance - The percentage that a single can be hit
# SacChance - The percentage that a sacrifice occurs
# StolenBaseChance - The percentage that a stolen base occurs
#
##################################################
sub CreateBatterArray(@) {
my ($AtBats, $Hits, $Doubles, $Triples, $Homers, $Walks, $Steals) = @_;
my $TotalAtBats = $AtBats + $Walks;
lib/Baseball/Simulation.pm view on Meta::CPAN
}
##################################################
# AtBat
#
# Parameters: WalkChance - The percentage for a walk
# SingleChance - The percentage that a single can be hit
# DoubleChance - The percentage that a single can be hit
# TripleChance - The percentage that a single can be hit
# HomerChance - The percentage that a single can be hit
# SacChance - The percentage that a single can be hit
# StolenBaseChance - The percentage that a single can be hit
#
# Description: Simulates an at-bat
#
# Returns: The result - -1 = walk
# 0 = out
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Basket/Calc.pm view on Meta::CPAN
carp "'$key' missing";
return;
}
}
unless ($discount->{type} =~ m/^(percent|amount)$/x) {
carp "'type' has to be either percent, or amount";
return;
}
unless (looks_like_number($discount->{value})) {
carp "'value' is not a number";
return;
}
given ($discount->{type}) {
when ('percent') {
if ($discount->{value} <= 0 or $discount->{value} > 1) {
carp "'percent' has to be a decimal between 0 and 1";
return;
}
}
when ('amount') {
$discount->{currency} = $self->currency
lib/Basket/Calc.pm view on Meta::CPAN
if ($self->discount) {
print __PACKAGE__ . ' discount: ' . join(' ', %{ $self->discount }) . $/
if $self->debug;
given ($self->discount->{type}) {
when ('percent') {
$total->{net} *= (1 - $self->discount->{value});
}
when ('amount') {
$total->{net} = $total->{net} - $self->discount->{value};
$total->{net} = 0 if $total->{net} < 0;
lib/Basket/Calc.pm view on Meta::CPAN
my $basket = Basket::Calc->new(debug => 1, currency => 'NZD', tax => .15);
$basket->add_item({ price => 14.90, currency => 'USD', quantity => 2 });
$basket->add_item({ price => 59, currency => 'EUR'});
$basket->add_item({ price => 119.15, currency => 'JPY' });
$basket->add_discount({ type => 'percent', value => .2 });
# or
$basket->add_discount({ type => 'amount', value => 15, currency => 'HKD' });
print dump $basket->calculate;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Beekeeper/Worker.pm view on Meta::CPAN
# Average errors per second
my $err = sprintf("%.2f", $worker->{error_count} / $period);
$worker->{error_count} = 0;
# Average load as percentage of wall clock busy time (not cpu usage)
my $load = sprintf("%.2f", ($BUSY_TIME - $worker->{busy_time}) / $period * 100);
$worker->{busy_time} = $BUSY_TIME;
# Queues
my %queues;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bencher/Formatter/AddComparisonFields.pm view on Meta::CPAN
return unless defined $slowest_time;
$self->add_field(
$envres,
'pct_faster_vs_slowest',
{after=>'time', align=>'number', format=>'percent'},
sub {
for my $rit (@{$envres->[2]}) {
$rit->{pct_faster_vs_slowest} =
($slowest_time - $rit->{time}) / $rit->{time};;
}
}
);
$self->add_field(
$envres,
'pct_slower_vs_fastest',
{after=>'pct_faster_vs_slowest', align=>'number', format=>'percent'},
sub {
for my $rit (@{$envres->[2]}) {
$rit->{pct_slower_vs_fastest} =
($rit->{time} - $fastest_time) / $fastest_time;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bencher/ScenarioR/AcmePERLANCARTestPerformance.pm view on Meta::CPAN
## no critic
package Bencher::ScenarioR::AcmePERLANCARTestPerformance;
our $VERSION = "0.060"; # VERSION
our $results = do{my$var=[[200,"OK",[{_name=>"",_succinct_name=>"",dataset=>100,ds_tags=>"",errors=>3.3e-09,modver=>0.06,p_tags=>"",participant=>"Acme::PERLANCAR::Test::Performance::primes",pct_faster_vs_slowest=>0,pct_slower_vs_fastest=>0,perl=>"per...
1;
# ABSTRACT: Benchmark Acme::PERLANCAR::Test::Performance
=head1 DESCRIPTION
view all matches for this distribution
view release on metacpan or search on metacpan
},
"runtime" : {
"requires" : {
"Bencher::Backend" : "1.062",
"Data::Sah::Coerce::perl::To_array::From_str::comma_sep" : "0",
"Data::Sah::Coerce::perl::To_float::From_str::percent" : "0",
"Data::Sah::Compiler::perl::TH::array" : "0.914",
"Data::Sah::Compiler::perl::TH::bool" : "0.914",
"Data::Sah::Compiler::perl::TH::float" : "0.914",
"Data::Sah::Compiler::perl::TH::hash" : "0.914",
"Data::Sah::Compiler::perl::TH::int" : "0.914",
view all matches for this distribution