view release on metacpan or search on metacpan
eg/g2r_table view on Meta::CPAN
$end_of_interval{$current_start} = $year;
}
}
#
# Compute the formulas for a sample year and for a month.
# 1st January 1796 is 11 Nivôse IV, and 31 January 1796 is 11 Pluviôse IV.
# Therefore, for January 1796, we have two formulas : "+10 Niv" and "-20 Plu".
# Since all French Revolutionary months have 30 days, only one computation is necessary.
# Exception: the additional days are grouped in a notional 13th month, which lasts
# either 5 or 6 days. In this case, we have 3 formulas for September, at the cost of 2 conversions.
#
sub formulas {
my ($year, $month) = @_;
my @formulas = ();
my @month = qw(Niv Plu Vnt Ger Flo Pra Mes The Fru S-C Vnd Bru Fri Niv);
#my $date = new Date::Convert::Gregorian $year, $month, 1;
#convert Date::Convert::FrenchRevolutionary $date;
my $dg = DateTime->new(year => $year, month => $month);
my $dr = DateTime::Calendar::FrenchRevolutionary->from_object(object => $dg);
my $offset = $dr->day() - 1;
if ($month <= 9) # Have to split in two, because of the additional days within @month
{
push @formulas, "+$offset $month[$month - 1]";
$offset = 30 - $offset;
push @formulas, "-$offset $month[$month]";
}
else
{
push @formulas, "+$offset $month[$month]";
$offset = 30 - $offset;
push @formulas, "-$offset $month[$month + 1]";
}
if ($month == 9)
{
#$date = new Date::Convert::FrenchRevolutionary $year - 1791, 1, 1;
#convert Date::Convert::Gregorian $date;
$dr = DateTime::Calendar::FrenchRevolutionary->new(year => $year - 1791);
$dg = DateTime->from_object(object => $dr);
$offset = $dg->day() - 1;
push @formulas, "-$offset Vnd";
}
@formulas;
}
sub html_0 {
my ($title) = @_;
print <<"EOF";
eg/g2r_table view on Meta::CPAN
# the part of September in the end of the year
if ($part eq 'e') {
print "<tr align='center'><td>$labels{month}[8]</td>";
foreach (@days) {
my $year = $year_of_partday{$part}{$_};
my @formulas = formulas($year, 9);
print "<td>$formulas[2]</td>\n";
}
print "</tr>\n";
}
# The regular months of the part of the year
my @month_list = $part eq 'b' ? (1..2) : $part eq 'm' ? (3..9) : (10..12);
foreach my $month (@month_list) {
print "<tr align='center'><td>$labels{month}[$month - 1]</td>";
foreach (@days) {
my $year = $year_of_partday{$part}{$_};
my @formulas = formulas($year, $month);
print "<td>$formulas[0]<br>$formulas[1]</td>\n";
}
print "</tr>\n";
}
print "</table>\n";
eg/g2r_table view on Meta::CPAN
my $y2 = sprintf "%02d", $y % 100;
my $part = $m <= 2 ? 'b' : $m < 9 ? 'm' : 'e';
my $offset = $part eq 'e' ? 1791 : 1792;
my $letter = letter_of_yearpart($y, $part);
my $word = word_for_year($y);
my @formulas = formulas($y, $m);
my $limit = $1 if $formulas[1] =~ /(\d+)/;
my $formula = $formulas[$d <= $limit ? 0 : 1];
my $ryear = $date->year();
my $begint; # Beginning of the interval
foreach (sort { $a <=> $b } keys %end_of_interval)
{
last if $y < $_;
eg/g2r_table view on Meta::CPAN
# $m = 9;
$gr_date = &{$labels{format}}($y, 9, $d, $lang);
#$date = new Date::Convert::Gregorian $y, 9, $d;
#convert Date::Convert::FrenchRevolutionary $date;
$date = DateTime::Calendar::FrenchRevolutionary->from_object(object => DateTime->new(year => $y, month => 9, day => $d));
@formulas = formulas($y, 9);
my $mletter = letter_of_yearpart($y, 'm');
my $eletter = letter_of_yearpart($y, 'e');
$abridged = $date->strftime("%e %b %Y");
$rev_date = $date->strftime("%A %e %B %EY");
$limit = $1 if $formulas[1] =~ /(\d+)/;
if ($d <= $limit)
{ $formula = $formulas[0]; $offset = 1792 }
else
{
$limit = $1 if $formulas[2] =~ /(\d+)/;
if ($d <= $limit)
{ $formula = $formulas[1]; $offset = 1792 }
else
{ $formula = $formulas[2]; $offset = 1791 }
}
$_ = eval "qq($labels{usage2})";
print;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Event/Easter.pm view on Meta::CPAN
=item * western_epact($year)
In the Gregorian comput, the epact is the age of the ecclesiastical
Moon on the 1st January of the given year. The C<western> part of the
subroutine name accounts for the fact that Gregorian and Julian
calendars do not use the same formula.
The epact is a 0..29 number. The "0" value is shown as "*" in some
sources. This subroutine does not convert "0" to "*", the result is
always a pure number.
lib/DateTime/Event/Easter.pm view on Meta::CPAN
=item * eastern_epact($year)
In the Julian comput, the epact is the age of the ecclesiastical Moon
on 22nd March. The C<eastern> part of the subroutine name accounts for
the fact that Gregorian and Julian calendars do not use the same
formula.
The epact is a 0..29 number. The "0" value is shown as "*" in some
sources. This subroutine does not convert "0" to "*", the result is
always a pure number. There is no other special case, for 25 as for
any other number.
The formula given by Reingold and Dershowitz is a "shifted epact" and
gives different results from the values printed in Lefort's and
Couderc's books. The module follows Couderc and Lefort.
=item * western_sunday_letter($year), eastern_sunday_letter($year)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Event/Jewish/Haversine.pm view on Meta::CPAN
@EXPORT_OK = qw(recalculate_coordinate azimuth elevation point2distance);
use Math::Trig;
our $VERSION = '0.01';
# Python implementation of Haversine formula
# Copyright (C) <2009> Bartek Garny <bartek at gorny.edu.pl>
# Converted to Perl by Raphael Mankin <rapmankin at cpan.org> Feb 2010
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
lib/DateTime/Event/Jewish/Haversine.pm view on Meta::CPAN
# Sun: 31.6' - 32.7'
# Moon: 29.3' - 34.1'
=head1 NAME
Haversine.pm - Calculations using haversine formula
=head1 SYNOPSIS
use Haversine;
my $degrees = recalculate_coordinate([51, 12, 0], 'deg');
lib/DateTime/Event/Jewish/Haversine.pm view on Meta::CPAN
=head3 points2distance($start, $end)
Calculate distance (in kilometers) between two points
given as (lat, long) pairs based on Haversine formula
(http://en.wikipedia.org/wiki/Haversine_formula).
Implementation inspired by JavaScript implementation from http://www.movable-type.co.uk/scripts/latlong.html
Accepts coordinates as tuples (deg, min, sec), but coordinates can be given in any form - e.g.
can specify only minutes:
(0, 3133.9333, 0)
lib/DateTime/Event/Jewish/Haversine.pm view on Meta::CPAN
}
=head3 azimuth($start, $end)
Calculate azimuth (bearing) of one point from another
given as (lat, long) pairs based on Haversine formula
=cut
sub azimuth {
my ($start, $end) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
0.03 2004-03-17
0.02_02 2004-03-15
- update to new DateTime::Set specs
- more tests, revised README and TODO
- added a note on README about tests that may fail.
- use a slightly different density formula
for calculating the first element of a set.
This should give a better distribution for
$set->next($dt) on an unbounded, uncached set -
but only the first time it is called (this is
still in the TODO list)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Locale/Data.pm view on Meta::CPAN
"1694ACAD" => "Early Modern French",
1901 => "Traditional German orthography",
"1959ACAD" => "Academic",
1994 => "Standardized Resian orthography",
1996 => "German orthography of 1996",
ABL1943 => "Orthographic formulation of 1943",
ALALC97 => "ALA-LC Romanization, 1997 edition",
ALUKU => "Aluku dialect",
AO1990 => "Portuguese Language Orthographic Agreement of 1990",
AREVELA => "Eastern Armenian",
AREVMDA => "Western Armenian",
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime/Util/Calc.pm view on Meta::CPAN
iteration.
=head2 search_next(%opts)
Performs a "linear" search until some condition is met. This is a generalized
version of the formula defined in [1] p.22. The basic idea is :
x = base
while (! check(x) ) {
x = next(x);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/DateTime.pm view on Meta::CPAN
free from DST-related complications.
=item * $dt->subtract_datetime and $dt->add_duration
You must convert your datetime objects to the UTC time zone before doing date
math if you want to make sure that the following formulas are always true:
$dt2 - $dt1 = $dur
$dt1 + $dur = $dt2
$dt2 - $dur = $dt1
Note that using C<< $dt->delta_days >> ensures that this formula always works,
regardless of the time zones of the objects involved, as does using C<<
$dt->subtract_datetime_absolute >>. Other methods of subtraction are not always
reversible.
=item * never do math on two objects where only one is in the floating time zone
view all matches for this distribution
view release on metacpan or search on metacpan
DayOfNthWeek.pm view on Meta::CPAN
sub tomorrow { print "Meeting is tomorrow\n"; }
sub tonight { print "Meeting is tonight\n"; }
=head2 FORMULA
The formula for calculating the week is:
(int(((Day of the Month - 1)+ Day of the Week)/7))+1
my %hash = ();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Deco/Tissue.pm view on Meta::CPAN
$self->{time}->{lastdepthchange} = 0;
# oxygen exposure tracking through OTU's
$self->{otu} = 0;
# haldane formula for current parameters, returns a ref to a sub
$self->{haldane} = $self->_haldanePressure();
return $self;
}
lib/Deco/Tissue.pm view on Meta::CPAN
# remember this depthchange on the time scale
$self->{time}->{lastdepthchange} = $self->{time}->{current};
#print "Time of last depth change is: " . $self->{time}->{lastdepthchange} ."\n";
# when depth changes we need to recalculate the Haldane formula
$self->{haldane} = $self->_haldanePressure();
}
return $self->{depth};
}
lib/Deco/Tissue.pm view on Meta::CPAN
my $depth = shift;
my $press = $depth * $self->{waterfactor} / 10;
return $press;
}
# use haldanian formula to solve the current pressure in tissue
# as long as the depth remains constant, this formula is still valid
sub _haldanePressure {
my $self = shift;
my $gas = lc(shift) || 'n2';
croak "Asking for unsupported gas $gas" unless exists $GASES{$gas};
# we need the current tissure pressure, at t=0 for the depth
my $tissue_press0 = $self->{$gas}->{pressure};
#print "recalculating haldane formula. tissue pressure at t0 = $tissue_press0\n";
# and the alveolar pressure
my $alveolar = $self->_alveolarPressure( depth => $self->{depth} );
# the time in minutes we have been at this depth, note that internal times are in seconds!
view all matches for this distribution
view release on metacpan or search on metacpan
Deliantra/Data.pm view on Meta::CPAN
}
],
[
'is_cauldron',
{
desc => 'If set, the container can be used as alchemy-cauldron. The player can put ingredients inside, close it, cast alchemy and if his formulae is true, he\'ll get what he longed for.',
name => 'alchemy cauldron',
type => 'bool'
}
],
[
view all matches for this distribution
view release on metacpan or search on metacpan
DB/DbgrProperties.pm view on Meta::CPAN
=head1 postconditions
This function does one of three things:
1. Throw an exception: let the caller deal with it, and formulate
an error message.
2. Assign a value to a local value if it's a non-top-level stack
Return undef
view all matches for this distribution
view release on metacpan or search on metacpan
stolen_chunk_of_toke.c view on Meta::CPAN
#if !defined(PERL_5_9_PLUS) && defined(PERL_IMPLICIT_CONTEXT)
/* These two are not exported from the core on Windows. With 5.9+
it's not an issue, because they're part of the PL_parser structure,
which is exported. On multiplicity/thread builds we can work
around the lack of export by this formulation, where we provide
a substitute implementation of the unexported accessor functions.
On single-interpreter builds we can't, because access is directly
via symbols that are not exported. */
# define Perl_Ilinestart_ptr my_Ilinestart_ptr
char **my_Ilinestart_ptr(pTHX) { return &(aTHX->Ilinestart); }
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Device/Chip/BME280.pm view on Meta::CPAN
unpack( "L>", "\x00" . $bytesT ) >> 4,
unpack( "S>", $bytesH ),
);
}
# Compensation formulae directly from BME280 datasheet section 8.1
field $_t_fine;
field @_dig_T;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Device/Altimeter/LPS331AP.pm view on Meta::CPAN
Get pressure in inches of mercury
=head2 getPressureToAltitudeMeters
converts pressure in mbar to altitude in meters, using 1976 US
Standard Atmosphere model (note that this formula only applies to a
height of 11 km, or about 36000 ft)
If altimeter setting (QNH, barometric pressure adjusted to sea
level) is given, this function returns an indicated altitude
compensated for actual regional pressure; otherwise, it returns
the pressure altitude above the standard pressure level of 1013.25
view all matches for this distribution
view release on metacpan or search on metacpan
memory_map_2300.PL view on Meta::CPAN
# strip it off.
$line =~ s/\s*\([^\(]+\)$//;
# Is it a definition line?
if ($line =~ m!^\|\s+([^ 0-9].*?)\s*:\s*(.*)!) {
my ($desc, $formula) = ($1, $2);
push @map, {
desc => $desc,
name => _canonical_name($desc),
address => $address,
length => 1,
};
# FIXME: formula
$formula =~ s{<(\S+)>}{
my $key = $1;
defined $macro{$key}
or die "$mapfile:$.: Undefined macro <$key>";
$macro{$key};
}ge;
if ($formula =~ s/\s*\[(.*)\]\s*//) {
$map[-1]->{units} = $1;
}
$map[-1]->{formula} = $formula;
}
elsif ($line =~ m!^_/!) {
my $l = $address - $map[-1]->{address} + 1;
if ($l > 10) {
die "$mapfile:$.: preposterous length";
memory_map_2300.PL view on Meta::CPAN
if (my $units = $entry->{units}) {
$name .= " [$units]";
}
printf { $mmap_fh } "%04X:%-2d %-40s %s\n", @{$entry}{"address","length"},
$name, $entry->{formula};
}
print { $mmap_fh } <<'END_MMAP_REST';
END_MEMORY_MAP
view all matches for this distribution
view release on metacpan or search on metacpan
// *overVoltage -If >0, an overvoltage has been detected on
// at least one sample of at least one of the
// analog inputs (I32).
//
// Time: The execution time of this function, in milliseconds, can be
// estimated with the below formulas. The actual number of scans
// collected and transferred by the LabJack is the smallest power
// of 2 from 64 to 4096 which is at least as big as numScans. This
// is represented below as numScansActual.
// Normal => 30+(1000*numScansActual/scanRate)+(2.5*numScansActual)
// Turbo => 30+(1000*numScansActual/scanRate)+(0.4*numScansActual)
view all matches for this distribution
view release on metacpan or search on metacpan
doc/devdoc/RS232_MS2_E.htm view on Meta::CPAN
<p><strong>Units</strong> are the human readable units. ADC means the value
from the analog to digital converter before they are scaled. ADC units typically
represent 0-5V max using 0-255 </p>
<p align="left">The scaling is done with a multiplier (<strong>scale</strong>)
and an offset (<strong>translate</strong>) to get to user units (in the above
example AFR) use this formula: <br>
userValue = (msValue + translate) * scale.</p>
<p align="left"> The<strong> lo</strong> and<strong> hi</strong> value indicate
the range of the values. In this example for an input of 0-5V (Innovate 0-5V
LC-1) the user units will range from an AFR of 10 to 20. The scaling values
will be different for different sensor settings. </p>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Device/TNC/KISS.pm view on Meta::CPAN
(i.e., 500 ms).
2 P The next byte is the persistence
parameter, p, scaled to the range
0 - 255 with the following
formula:
P = p * 256 - 1
The default value is P = 63
(i.e., p = 0.25).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Device/USB/PCSensor/HidTEMPer/NTC/External.pm view on Meta::CPAN
# Calculate key
$key = $self->_volt_7705_calibration( $volt );
=pod
The formula used to calculate value based on a calibrated key value is
created using the Eureqa tool from Cornell Computational Synthesis Lab,
http://ccsl.mae.cornell.edu/eureqa.
Resulting in the use of this formula instead of the provided number list:
f(y)=66.7348/(66.7275/(67.8088 - 9.70353*log(0.000251309 + y*y)) - 0.21651)
If you find another formula that is more accurate please drop me a line.
The data used can be found in the source code of this file.
=cut
$temperature = 66.7348
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Device/Velleman/K8055/Fuse.pm view on Meta::CPAN
This outputs $value to the analog channel indicated by $channel.
The indicated 8-bit Digital to Analogue Converter channel is altered according to the new value.
This means that the value corresponds to a specific voltage. The value 0 corresponds to a
minimum output voltage (0 Volt) and the value 255 corresponds to a maximum output voltage (+5V).
A value of $value lying in between these extremes can be translated by the following formula :
$value / 255 * 5V.
See also SetAnalogChannel() and SetAllAnalog()
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Device/Velleman/K8055/libk8055.pm view on Meta::CPAN
This outputs $data to the analog channel indicated by $channel.
The indicated 8-bit Digital to Analogue Converter channel is altered according to the new data.
This means that the data corresponds to a specific voltage. The value 0 corresponds to a
minimum output voltage (0 Volt) and the value 255 corresponds to a maximum output voltage (+5V).
A value of $data lying in between these extremes can be translated by the following formula :
$data / 255 * 5V.
=head2 OutputAllAnalog($data1, $data2);
This outputs $data1 to the first analog channel, and $data2 to the
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Device/Velleman/K8055.pm view on Meta::CPAN
This outputs $data to the analog channel indicated by $channel.
The indicated 8-bit Digital to Analogue Converter channel is altered according to the new data.
This means that the data corresponds to a specific voltage. The value 0 corresponds to a
minimum output voltage (0 Volt) and the value 255 corresponds to a maximum output voltage (+5V).
A value of $data lying in between these extremes can be translated by the following formula :
$data / 255 * 5V.
=head2 OutputAllAnalog($data1, $data2);
This outputs $data1 to the first analog channel, and $data2 to the
view all matches for this distribution
view release on metacpan or search on metacpan
(0.4275 * $temp * $v016);
}
return $chill;
}
# old windchill formula
sub oldWindChill {
my $self = shift;
my $speed = $self->{windSpeed};
my $temp = $self->{outTemp};
my $chill;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Debian/Dependency.pm view on Meta::CPAN
[^\s\]]+ # architecture name
(?:\s+|(?=\])) # whitespace or end
)+
\]
)?
(?: # "restriction formulas" (build profile) is optional
\s* # optional space
<
(?:
!? # negation is optional
[^\s>]+ # build profile name
view all matches for this distribution
view release on metacpan or search on metacpan
example.resp view on Meta::CPAN
<lvl>B1</lvl>
</info>
<def>to give someone a set of questions, in order to measure their knowledge or ability: </def>
</definition>
<examp>
<eg>Will you test me <b>on</b> the chemical formulae I've been learning?</eg>
</examp>
</def-block>
<def-block>
<definition>
<info>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Digest/MD5/Reverse.pm view on Meta::CPAN
my $plaintext = reverse_md5($md5);
=head1 DESCRIPTION
MD5 sums (see RFC 1321 - The MD5 Message-Digest Algorithm) are used as a one-way
hash of data. Due to the nature of the formula used, it is impossible to reverse
it.
This module provides functions to search several online MD5 hashes database and
return the results (or return undefined if no match found).
view all matches for this distribution
view release on metacpan or search on metacpan
die one day Cause I'm goin and goin and goin this way Not like a roach or a
piece of toast I'm going out first class not going out coach Rock my Adidas
never rock Fila *I do not sniff the coke I only smoke sinsemilla* With my
nose I knows and with my scopes I scope What I live I write and that is
strictly rope I've got science for any occasion Postulating theorems
formulating equations Cheech wizard in a snow blizzard Eating chicken
gizzards with a girl named Lizzy Dropping science like when Galileo dropped
his orange Stay up all night go to sleep watching Dragnet Never sleep alone
because Jimmy's the magnet I'm so rope they call me Mr. Roper When
the troubles arise I'm the cool coper On the mic I score just like
the Yankees Get over on Ms. Crabtree like my main man Spankee Excuse me
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Dist/Zilla/Dist/Builder.pm view on Meta::CPAN
#pod already been built, an exception will be thrown.
#pod
#pod =method build
#pod
#pod This method just calls C<build_in> with no arguments. It gets you the default
#pod behavior without the weird-looking formulation of C<build_in> with no object
#pod for the preposition!
#pod
#pod =cut
sub build { $_[0]->build_in }
lib/Dist/Zilla/Dist/Builder.pm view on Meta::CPAN
#pod C<$root> (or the default root, if no root is given), no exception is raised.
#pod
#pod =method ensure_built
#pod
#pod This method just calls C<ensure_built_in> with no arguments. It gets you the
#pod default behavior without the weird-looking formulation of C<ensure_built_in>
#pod with no object for the preposition!
#pod
#pod =cut
sub ensure_built {
lib/Dist/Zilla/Dist/Builder.pm view on Meta::CPAN
already been built, an exception will be thrown.
=head2 build
This method just calls C<build_in> with no arguments. It gets you the default
behavior without the weird-looking formulation of C<build_in> with no object
for the preposition!
=head2 ensure_built_in
$zilla->ensure_built_in($root);
lib/Dist/Zilla/Dist/Builder.pm view on Meta::CPAN
C<$root> (or the default root, if no root is given), no exception is raised.
=head2 ensure_built
This method just calls C<ensure_built_in> with no arguments. It gets you the
default behavior without the weird-looking formulation of C<ensure_built_in>
with no object for the preposition!
=head2 dist_basename
my $basename = $zilla->dist_basename;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Data/Object/ClassHas.pm view on Meta::CPAN
}
sub _generate_has {
my ($info, $orig) = @_;
return sub { @_ = _formulate_opts($info, @_); goto $orig; };
}
sub _formulate_opts {
my ($info, $name, %opts) = @_;
# name-only support
%opts = (is => 'ro', isa => 'Any') unless %opts;
%opts = (%opts, _formulate_new($info, $name, %opts)) if $opts{new};
%opts = (%opts, _formulate_bld($info, $name, %opts)) if $opts{bld};
%opts = (%opts, _formulate_clr($info, $name, %opts)) if $opts{clr};
%opts = (%opts, _formulate_crc($info, $name, %opts)) if $opts{crc};
%opts = (%opts, _formulate_def($info, $name, %opts)) if $opts{def};
%opts = (%opts, _formulate_hnd($info, $name, %opts)) if $opts{hnd};
%opts = (%opts, _formulate_isa($info, $name, %opts)) if $opts{isa};
%opts = (%opts, _formulate_lzy($info, $name, %opts)) if $opts{lzy};
%opts = (%opts, _formulate_opt($info, $name, %opts)) if $opts{opt};
%opts = (%opts, _formulate_pre($info, $name, %opts)) if $opts{pre};
%opts = (%opts, _formulate_rdr($info, $name, %opts)) if $opts{rdr};
%opts = (%opts, _formulate_req($info, $name, %opts)) if $opts{req};
%opts = (%opts, _formulate_tgr($info, $name, %opts)) if $opts{tgr};
%opts = (%opts, _formulate_use($info, $name, %opts)) if $opts{use};
%opts = (%opts, _formulate_wkr($info, $name, %opts)) if $opts{wkr};
%opts = (%opts, _formulate_wrt($info, $name, %opts)) if $opts{wrt};
$name = "+$name" if $opts{mod} || $opts{modify};
return ($name, %opts);
}
sub _formulate_new {
my ($info, $name, %opts) = @_;
if (delete $opts{new}) {
$opts{builder} = "new_${name}";
$opts{lazy} = 1;
}
return (%opts);
}
sub _formulate_bld {
my ($info, $name, %opts) = @_;
$opts{builder} = delete $opts{bld};
return (%opts);
}
sub _formulate_clr {
my ($info, $name, %opts) = @_;
$opts{clearer} = delete $opts{clr};
return (%opts);
}
sub _formulate_crc {
my ($info, $name, %opts) = @_;
$opts{coerce} = delete $opts{crc};
return (%opts);
}
sub _formulate_def {
my ($info, $name, %opts) = @_;
$opts{default} = delete $opts{def};
return (%opts);
}
sub _formulate_hnd {
my ($info, $name, %opts) = @_;
$opts{handles} = delete $opts{hnd};
return (%opts);
}
sub _formulate_isa {
my ($info, $name, %opts) = @_;
return (%opts) if ref($opts{isa});
$opts{isa} = Data::Object::Utility::Reify($info->[1], $opts{isa});
return (%opts);
}
sub _formulate_lzy {
my ($info, $name, %opts) = @_;
$opts{lazy} = delete $opts{lzy};
return (%opts);
}
sub _formulate_opt {
my ($info, $name, %opts) = @_;
delete $opts{opt};
$opts{required} = 0;
return (%opts);
}
sub _formulate_pre {
my ($info, $name, %opts) = @_;
$opts{predicate} = delete $opts{pre};
return (%opts);
}
sub _formulate_rdr {
my ($info, $name, %opts) = @_;
$opts{reader} = delete $opts{rdr};
return (%opts);
}
sub _formulate_req {
my ($info, $name, %opts) = @_;
delete $opts{req};
$opts{required} = 1;
return (%opts);
}
sub _formulate_tgr {
my ($info, $name, %opts) = @_;
$opts{trigger} = delete $opts{tgr};
return (%opts);
}
sub _formulate_use {
my ($info, $name, %opts) = @_;
if (my $use = delete $opts{use}) {
$opts{builder} = _formulate_use_builder($info, $name, @$use);
$opts{lazy} = 1;
}
return (%opts);
}
sub _formulate_use_builder {
my ($info, $name, $sub, @args) = @_;
return sub {
my ($self) = @_;
lib/Data/Object/ClassHas.pm view on Meta::CPAN
goto $point;
}
}
sub _formulate_wkr {
my ($info, $name, %opts) = @_;
$opts{weak_ref} = delete $opts{wkr};
return (%opts);
}
sub _formulate_wrt {
my ($info, $name, %opts) = @_;
$opts{writer} = delete $opts{wrt};
return (%opts);
view all matches for this distribution
view release on metacpan or search on metacpan
share/specs/v1.39.yaml view on Meta::CPAN
If either `precpu_stats.online_cpus` or `cpu_stats.online_cpus` is
nil then for compatibility with older daemons the length of the
corresponding `cpu_usage.percpu_usage` array should be used.
To calculate the values shown by the `stats` command of the docker cli tool
the following formulas can be used:
* used_memory = `memory_stats.usage - memory_stats.stats.cache`
* available_memory = `memory_stats.limit`
* Memory usage % = `(used_memory / available_memory) * 100.0`
* cpu_delta = `cpu_stats.cpu_usage.total_usage - precpu_stats.cpu_usage.total_usage`
* system_cpu_delta = `cpu_stats.system_cpu_usage - precpu_stats.system_cpu_usage`
view all matches for this distribution