view release on metacpan or search on metacpan
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
view all matches for this distribution
view release on metacpan or search on metacpan
return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++;
if (s == send || (*s != 'A' && *s != 'a'))
return 0;
s++;
if (s == send || (*s != 'N' && *s != 'n'))
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BarefootJS.pm view on Meta::CPAN
# template can render value-equivalent output without a JS engine.
#
# Failure policy mirrors the Go adapter (#1188): user-data marshalling
# (json) bubbles errors so Mojolicious aborts loudly on cycles /
# unsupported values rather than silently producing an empty payload.
# Numeric coercion follows JS semantics (NaN propagates as the special
# string 'NaN'; non-numeric input returns 'NaN' rather than 0). Strings
# always coerce to a string representation.
# ---------------------------------------------------------------------------
sub json ($self, $value) {
# Mojo::JSON::to_json returns a character string (not bytes), suitable
lib/BarefootJS.pm view on Meta::CPAN
return defined $value ? "$value" : '';
}
sub number ($self, $value) {
# JS `Number(v)` mirror. Numeric coerces via Perl's implicit
# numeric context; non-numeric / undef yield real numeric NaN
# (`'nan' + 0`) so downstream arithmetic propagates correctly
# (`Math.floor(NaN) === NaN`). Returning the literal string
# "NaN" would conflate the user-passing-the-string-"NaN" case
# with the parse-failure case, and break NaN detection in
# downstream helpers.
return 0 + 'nan' unless defined $value;
return $value + 0 if looks_like_number($value);
return 0 + 'nan';
}
# NaN is the only float for which `$x != $x` holds. Used as the
# portable sentinel check in floor/ceil/round.
sub _is_nan { my $n = shift; return $n != $n }
# True for +/-Infinity. `9**9**9` is Perl's portable infinity literal; a
# finite number is always strictly less than +Inf in magnitude.
lib/BarefootJS.pm view on Meta::CPAN
# the same IR node (`array-method` / method `includes`). This helper
# dispatches at the Perl level via `ref()`:
# - ARRAY ref: scan elements with `BarefootJS::Evaluator::_same_value_zero`,
# matching `Array.prototype.includes`'s SameValueZero
# semantics (no cross-type coercion, e.g. `[2].includes("2")`
# is false; NaN matches NaN) â the same algorithm the
# evaluator's serialized-callback path already uses for
# `.includes`, so both positions agree. This used to be a
# stringy `eq` scan, which coerced numbers to strings
# (`[2].includes("2")` was true) and diverged from JS.
# - scalar: `index($recv, $sub) != -1`, with both args
lib/BarefootJS.pm view on Meta::CPAN
}
# `Array.prototype.flat(depth)` with a DYNAMIC depth (#2094) â the depth is
# itself an arbitrary runtime value (e.g. a prop), not a compile-time literal,
# so it must be coerced with JS's `ToIntegerOrInfinity` before delegating to
# `flat` above: truncate toward zero; negative -> 0; NaN / non-numeric -> 0;
# +Infinity or a huge finite value -> flatten fully.
#
# Deliberately a SEPARATE entry point from `flat`, not a smarter version of
# it: the literal-depth path's `-1` argument is a compile-time SENTINEL baked
# into the template source, meaning "the source literally said `Infinity`". A
lib/BarefootJS.pm view on Meta::CPAN
#
# Perl's scalar type system blurs string/number duality, so `looks_like_number`
# (already the codebase's ToNumber-style coercion check, see BarefootJS::
# Evaluator's `_to_number`) is reused here rather than inventing a new
# convention. `looks_like_number` on this Perl (5.38) already recognises the
# strings "Infinity" / "-Infinity" / "NaN" as numeric (verified empirically:
# `perl -MScalar::Util=looks_like_number -e 'print looks_like_number("Infinity")'`
# prints 1), and `$str + 0` on those strings yields the corresponding Perl
# non-finite double, so no extra string special-casing is needed here.
sub _coerce_flat_depth ($depth) {
return 0 unless defined $depth;
lib/BarefootJS.pm view on Meta::CPAN
elsif (!ref($depth) && looks_like_number($depth)) {
$f = $depth + 0;
}
else {
# undef handled above; anything else non-numeric (a plain string
# that isn't a number, a HASH/ARRAY ref, ...) coerces via NaN.
return 0;
}
return 0 if $f != $f; # NaN
return -1 if $f == 9**9**9; # +Infinity -> flatten fully sentinel
return 0 if $f == -(9**9**9); # -Infinity -> 0
my $trunc = int($f); # Perl's int() truncates toward zero
return 0 if $trunc < 0;
return -1 if $trunc > 1_000_000; # huge finite ~= flatten fully
lib/BarefootJS.pm view on Meta::CPAN
# `round` helper uses), then format the exact multiple. A negative
# `digits` clamps to 0, mirroring how the adapters default an omitted
# argument.
sub to_fixed ($self, $value, $digits = 0) {
my $n = $self->number($value);
# JS toFixed returns the STRINGS "NaN" / "Infinity" / "-Infinity" for
# non-finite inputs; the numeric values would stringify per-platform
# ("nan"/"inf"/...) and diverge.
return 'NaN' if _is_nan($n);
return $n < 0 ? '-Infinity' : 'Infinity' if _is_inf($n);
$digits = 0 if !defined $digits || $digits < 0;
my $factor = 10 ** $digits;
my $rounded = POSIX::floor($n * $factor + 0.5);
return sprintf('%.*f', $digits, $rounded / $factor);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Basset/Object.pm view on Meta::CPAN
All easy enough. Refer to any subclasses of this class for further examples.
Basset::Object includes two other alternate accessors for you - regex and private.
Some::Class->add_attr(['user_id', '_isa_regex_accessor', qr{^\d+$}, "Error - user_id must be a number", "NaN"]);
The arguments to it are, respectively, the name of the attribute, the internal accessor used, the regex used to validate, the error message to return, and the error code to return.
If you try to mutate with a value that doesn't match the regex, it'll fail.
Some::Class->add_attr(['secret', '_isa_private_accessor']);
view all matches for this distribution
view release on metacpan or search on metacpan
share/public/js/base/jquery.js view on Meta::CPAN
* Copyright 2011, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
*
* Date: Thu Jun 30 14:16:56 2011 -0400
*/
(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("ifram...
shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\...
)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++...
view all matches for this distribution
view release on metacpan or search on metacpan
clearTimers(slide);
const timers = [];
slide.querySelectorAll('audio[data-autoplay-after], video[data-autoplay-after]').forEach(media => {
const delay = parseInt(media.getAttribute('data-autoplay-after'), 10);
if (Number.isNaN(delay)) return;
const id = setTimeout(() => {
// Only play if this slide is still current
if (Reveal.getCurrentSlide() !== slide) return;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bencher/Scenario/Accessors/ClassStartup.pm view on Meta::CPAN
The above result presented as chart:
=begin html
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAH4CAMAAABUnipoAAAJJmlDQ1BpY2MAAEiJlZVnUJNZF8fv8zzphUASQodQQ5EqJYCUEFoo0quoQOidUEVsiLgCK4qINEWQRQEXXJUia0UUC4uCAhZ0gywCyrpxFVFBWXDfGZ33HT+8/5l7z2/+c+bec8/5cAEgiINlwct7YlK6wNvJjhkYFMwE3yiMn5...
=end html
To display as an interactive HTML table on a browser, you can add option C<--format html+datatables>.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bencher/Scenario/Data/Dmp/Dump.pm view on Meta::CPAN
],
datasets => [
{
name => 'a100-num-various',
args => { data => [ (0, 1, -1, "+1", 1e100,
-1e-100, "0123", "Inf", "-Inf", "NaN") x 10 ] },
},
{
name => 'a100-num-int',
args => { data => [ 1..100 ] },
},
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bencher/Scenario/DataDmp.pm view on Meta::CPAN
],
datasets => [
{
name => 'a100-num-various',
args => { data => [ (0, 1, -1, "+1", 1e100,
-1e-100, "0123", "Inf", "-Inf", "NaN") x 10 ] },
},
{
name => 'a100-num-int',
args => { data => [ 1..100 ] },
},
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bencher/Scenario/StringFunctions/CommonPrefix.pm view on Meta::CPAN
315581/s --
Legends:
: dataset=elems10prefix1 ds_tags= p_tags= participant=String::CommonPrefix::common_prefix perl=perl
=for html <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAH4CAMAAABUnipoAAAJJmlDQ1BpY2MAAEiJlZVnUJNZF8fv8zzphUASQodQQ5EqJYCUEFoo0quoQOidUEVsiLgCK4qINEWQRQEXXJUia0UUC4uCAhZ0gywCyrpxFVFBWXDfGZ33HT+8/5l7z2/+c+bec8/5cAEgiINlwct7YlK6wNvJjhkY...
Benchmark module startup overhead (C<< bencher -m StringFunctions::CommonPrefix --module-startup >>):
#table9#
view all matches for this distribution
view release on metacpan or search on metacpan
data/wiki2.html view on Meta::CPAN
dvp_meta.height=parseInt(vx.nvl(vx.dvp_height,225));
dispatchVideoCdn(50);
function dispatchVideoCdn(awspercent) {
var tmpint=parseInt(awspercent);
if (awspercent && !isNaN(tmpint) && tmpint>0) {
awspercent=tmpint;
} else {
awspercent=0;
}
var cdn='hw';
data/wiki2.html view on Meta::CPAN
var curr=0;
var total=0;
var found=0;
var keys=[];
for (var key in capmeta) {
if (capmeta.hasOwnProperty(key) && !isNaN(tmpval=parseFloat(key)) && tmpval>=0) {
total++;
keys.push(key);
if (found==0) {
if (pos<tmpval) {
found++;
view all matches for this distribution
view release on metacpan or search on metacpan
share/P6STD/STD.pm6 view on Meta::CPAN
# Note, does not include <1/2> forms, which are parsed as quotewords
token number {
[
| 'NaN' »
| <integer>
| <dec_number>
| <rad_number>
| 'Inf' »
]
view all matches for this distribution
view release on metacpan or search on metacpan
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
view all matches for this distribution
view release on metacpan or search on metacpan
scripts/summing view on Meta::CPAN
#my $FH = $o{1} ? \* STDOUT : \*STDERR ; # <-- æå³ããã£ãã®ã???
select $o{1} ? \* STDOUT : \*STDERR ; # <-- æå³ããã£ãã®ã???
print $o{q}? '' : 'header=' , qq{'$header'\t} if $o{'='} ;
my $fmt = $o{q} ? "%s\t%d\t%g\t%s" : "%s <- sum ;\t%d + %d <- counted + not ; \t%s <- average ;" ;
#$fmt = "%50X <- sum ;\t%d + %d <- counted + not ;" if $o{h} ;
my $quot = $lln != 0 ? $sum/$lln : "NaN" ;
if ( "$quot" > $quot ) { $quot = "$quot" . '..(-)' }
elsif ( "$quot" < $quot ) { $quot = "$quot" . '..(+)' }
#if ( $o{h} ) { say sprintf( & hex8 ( $sum) ; return } ;
$sum = & hex8 ( $sum ) if $o{h} ;
say sprintf ($fmt , $sum, $lln, $nlln , "$quot") , sprintf "\t%0.6f sec calculation (summing)." , tv_interval ${ dt_start } ;
}
sub hex8 {
my @out = '' ;
my $n = $_ [0] ; $n = 0 if $n eq "NaN" ;
my $c = 12 ;
do {my $t = $n % 16**8 ; $n = int $n /16**8 ; unshift @out , sprintf "%08x" , $t ; say $n } while ($n != 0 && $c--) ;
my $out = join " " , @out ;
$out =~ s/^00+/0x 0/;
return $out ;
view all matches for this distribution
view release on metacpan or search on metacpan
scripts/summing view on Meta::CPAN
#my $FH = $o{1} ? \* STDOUT : \*STDERR ; # <-- æå³ããã£ãã®ã???
select $o{1} ? \* STDOUT : \*STDERR ; # <-- æå³ããã£ãã®ã???
print $o{q}? '' : 'header=' , qq{'$header'\t} if $o{'='} ;
my $fmt = $o{q} ? "%s\t%d\t%g\t%s" : "%s <- sum ;\t%d + %d <- counted + not ; \t%s <- average ;" ;
#$fmt = "%50X <- sum ;\t%d + %d <- counted + not ;" if $o{h} ;
my $quot = $lln != 0 ? $sum/$lln : "NaN" ;
if ( "$quot" > $quot ) { $quot = "$quot" . '..(-)' }
elsif ( "$quot" < $quot ) { $quot = "$quot" . '..(+)' }
#if ( $o{h} ) { say sprintf( & hex8 ( $sum) ; return } ;
$sum = & hex8 ( $sum ) if $o{h} ;
say sprintf ($fmt , $sum, $lln, $nlln , "$quot") , sprintf "\t%0.6f sec calculation (summing)." , tv_interval ${ dt_start } ;
}
sub hex8 {
my @out = '' ;
my $n = $_ [0] ; $n = 0 if $n eq "NaN" ;
my $c = 12 ;
do {my $t = $n % 16**8 ; $n = int $n /16**8 ; unshift @out , sprintf "%08x" , $t ; say $n } while ($n != 0 && $c--) ;
my $out = join " " , @out ;
$out =~ s/^00+/0x 0/;
return $out ;
view all matches for this distribution
view release on metacpan or search on metacpan
t/01.bigwig.t view on Meta::CPAN
ok(ref $es_list,'ARRAY');
ok(scalar @$es_list,500);
ok(join(' ',sort keys %{$es_list->[0]}),"maxVal minVal sumData sumSquares validCount");
ok($es_list->[300]{sumData}/$es_list->[300]{validCount},$summary->[300]);
my $value = $wig->bigWigSingleSummary('I',1,5000000,bbiSumMean,'NaN');
ok ($value > 0);
1;
view all matches for this distribution
view release on metacpan or search on metacpan
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
view all matches for this distribution
view release on metacpan or search on metacpan
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
view all matches for this distribution
view release on metacpan or search on metacpan
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/MaxQuant/Evidence/Statistics.pm view on Meta::CPAN
=head2 logRatios
Logs ratios (base 2) throughout the dataset, and sets a flag so it can't get logged again.
Treatment of "special values": empty string, <= 0, NaN, and any other non-number are removed
from the data!
=cut
sub logRatios {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Phylo/Util/CONSTANT.pm view on Meta::CPAN
my $looks_like_number;
{
eval { Scalar::Util::looks_like_number(0) };
if ($@) {
my $LOOKS_LIKE_NUMBER_RE =
qr/^([-+]?\d+(\.\d+)?([eE][-+]\d+)?|Inf|NaN)$/;
$looks_like_number = sub {
my $num = shift;
if ( defined $num and $num =~ $LOOKS_LIKE_NUMBER_RE ) {
return 1;
}
view all matches for this distribution
view release on metacpan or search on metacpan
contrib/roary_plots/roary_files/jquery.min.js view on Meta::CPAN
/*! jQuery v2.0.3 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery.min.map
*/
(function(e,undefined){var t,n,r=typeof undefined,i=e.location,o=e.document,s=o.documentElement,a=e.jQuery,u=e.$,l={},c=[],p="2.0.3",f=c.concat,h=c.push,d=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,x=function(e,n){return new x.fn.in...
};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return q.get(e,n)||q.access(e,n,{empty:x.Callbacks("once memory").add(funct...
},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var Xt,Ut,Yt=x.now(),Vt=/\?/,Gt=/#.*$/,Jt=/([?&])_=[^&]*/,Qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Kt=/^(?:a...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/SDRS.pm view on Meta::CPAN
my $self = shift;
my ($assay, $pam, $data) = @_;
my $stdev = Math::NumberCruncher::StandardDeviation($data);
my $mean = Math::NumberCruncher::Mean($data);
my $cutoff = $mean / 10;
$stdev = $cutoff if ($stdev eq 'NaN' || $stdev < $cutoff);
my ($l, $h, $step);
$step = $stdev / 2.5;
$step = sprintf("%.3f", $step);
if ($step == 0.0) {
carp "Data range too small for $assay -- step size raised to 0.001.\n";
view all matches for this distribution
view release on metacpan or search on metacpan
scripts/manipulate_wig.pl view on Meta::CPAN
Selection functions:
-k --skip <regex> Skip lines where chromosomes match regex
-y --apply <regex> Only apply manipulations to matching chromosomes
Manipulation functions (in order of execution):
-u --null Convert null, NA, N/A, NaN, inf values to 0
-d --delog [2|10] Delog values of given base
-b --abs Convert to the absolute value
-m --mult <float> Multiply score by the given value
-a --add <float> Add the given value to the score
-l --log [2|10] Convert to log2 or log10.
scripts/manipulate_wig.pl view on Meta::CPAN
=over 4
=item --null
Convert lines with a score of C<null>, C<NA>, C<N/A>, C<NaN>, or C<inf> to
a value of 0.
=item --delog [2|10]
Convert lines from log space in the indicated base.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Tradis/CombinePlots.pm view on Meta::CPAN
#my $seq_len = `wc $comb_plot | awk '{print \$1}'`;
#chomp($seq_len);
my $uis = `grep -c -v "0 0" $comb_plot`;
chomp($uis);
my $sl_per_uis = "NaN";
$sl_per_uis = $seq_len / $uis if($uis > 0);
my $stats = "$id,$seq_len,$uis,$sl_per_uis\n";
print { $self->_stats_handle } $stats;
view all matches for this distribution
view release on metacpan or search on metacpan
Bio/Align/ProteinStatistics.pm view on Meta::CPAN
my $D = 1 - ( $match / $scored );
if( $D < 0.8541 ) {
$D = - log ( 1 - $D - (0.2 * ($D ** 2)));
$values[$j][$i] = $values[$i][$j] = sprintf($precisionstr,$D);
} else {
$values[$j][$i] = $values[$i][$j] = ' NaN';
}
# fwd and rev lookup
$dist{$names[$i]}->{$names[$j]} = [$i,$j];
$dist{$names[$j]}->{$names[$i]} = [$i,$j];
view all matches for this distribution
view release on metacpan or search on metacpan
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
view all matches for this distribution
view release on metacpan or search on metacpan
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
view all matches for this distribution
view release on metacpan or search on metacpan
s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
s++;
}
sawinf = 1;
} else if (*s == 'N' || *s == 'n') {
/* XXX TODO: There are signaling NaNs and quiet NaNs. */
s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
s++;
sawnan = 1;
} else
view all matches for this distribution