view release on metacpan or search on metacpan
lib/CGI/Ajax.pm view on Meta::CPAN
=item 1 Standard CGI::Ajax example
Start by defining a perl subroutine that you want available from
javascript. In this case we'll define a subrouting that determines
whether or not an input is odd, even, or not a number (NaN):
use strict;
use CGI::Ajax;
use CGI;
lib/CGI/Ajax.pm view on Meta::CPAN
sub evenodd_func {
my $input = shift;
# see if input is defined
if ( not defined $input ) {
return("input not defined or NaN");
}
# see if value is a number (*thanks Randall!*)
if ( $input !~ /\A\d+\z/ ) {
return("input is NaN");
}
# got a number, so mod by 2
$input % 2 == 0 ? return("EVEN") : return("ODD");
}
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/CGI/FormBuilder.pm view on Meta::CPAN
$jsmisc .= <<EOJS;
var ${jspre}counter = new Object; // for assigning unique ids; keyed by field name
var ${jspre}limit = new Object; // for limiting the size of growable fields
function ${jspre}grow (baseID) {
// inititalize the counter for this ID
if (isNaN(${jspre}counter[baseID])) ${jspre}counter[baseID] = 1;
// don't go past the growth limit for this field
if (${jspre}counter[baseID] >= ${jspre}limit[baseID]) return;
var base = document.getElementById(baseID + '_' + (${jspre}counter[baseID] - 1));
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/IDS.pm view on Meta::CPAN
# normalize obfuscated method calls
$converted = preg_replace(qr/\)\s*\+/, ')', $converted);
# convert JS special numbers
$converted = preg_replace(qr/(?:\(*[.\d]e[+-]*[^a-z\W]+\)*)|(?:NaN|Infinity)\W/ims, 1, $converted);
if ($converted && ($compare ne $converted)) {
$value .= "\n" . $converted;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/Inspect/htdocs/js/jquery.js view on Meta::CPAN
* http://docs.jquery.com/License
*
* Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
* Revision: 6246
*/
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;thi...
/*
* Sizzle CSS Selector Engine - v0.9.3
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
view all matches for this distribution
view release on metacpan or search on metacpan
lib/CGI/OptimalQuery/Resources/jquery.js view on Meta::CPAN
/*! jQuery v@1.8.0 jquery.com | jquery.org/license */
(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d=...
view all matches for this distribution
view release on metacpan or search on metacpan
t/private/javascripts/datepicker.js view on Meta::CPAN
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
days: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']
}, options || {});
// Make sure first weekday is in the correct range
with (this.options)
if (isNaN(firstWeekDay*1)) firstWeekDay = 0;
else firstWeekDay = firstWeekDay % 7;
this.keysCaptured = false;
this.calendarCont = null;
this.currentDate = this.options.date ? this.options.date : new Date();
t/private/javascripts/datepicker.js view on Meta::CPAN
otherInput.type = 'text';
otherInput.maxLength = 2;
otherInput.style.width = '2em';
var inputTimeout = null;
otherInput.onkeyup = function(e) {
if (!isNaN(otherInput.value)) {
this.currentDate.setMinutes(otherInput.value);
this.dateChanged(this.currentDate);
}
}.bindAsEventListener(this);
otherInput.onkeydown = function(e) {
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/CLDR/Number.pm view on Meta::CPAN
Examples: C<â> (infinity) for B<root>, B<en>, and almost all locales
=item nan
Examples: C<NaN> for B<root>, B<en>, and most locales; many other variations for
individual locales like C<не ÑиÑло> for B<ru> and C<鿏å¼> for B<zh-Hant>
=item cldr_version
Value: C<29>
view all matches for this distribution
view release on metacpan or search on metacpan
easyxs/ppport.h view on Meta::CPAN
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/CORBA/IDLtree.pm view on Meta::CPAN
# use BigInt so that Perl won't switch to
# floating point for large values
my $v;
if ($value =~ /^[-+]?0[0-7]/) {
# Math::BigInt->new won't convert octal numbers
# (and from_oct produces NaN for '0')...
if (Math::BigInt->can('from_oct')) {
$v = Math::BigInt->from_oct($value);
} else {
# older Math::BigInt versions don't have from_oct
my @dg = (split //, $value);
view all matches for this distribution
view release on metacpan or search on metacpan
omnithreads/ppport.h view on Meta::CPAN
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
t/var/nntp-testers/1427341 view on Meta::CPAN
eUtils-0
.21-m7Ollt/blib/lib:/usr/local/src/CPAN/build/Test-SubCalls-1.07-p5Ck0t/blib/arch:/usr/local/src/CPAN/build/Test-SubCalls-1.07-p5Ck0t/blib/lib:/usr/local/src/CPAN/build/Hook-LexWrap-0.20-hOsOuj/blib/arch:/usr/local/src/CPAN/build/Hook-LexWrap-0.20-hO...
d/Sort-D
ataTypes-2.02-Hyq5bz/blib/lib:/usr/local/src/CPAN/build/Date-Manip-5.52-qEUDEK/blib/arch:/usr/local/src/CPAN/build/Date-Manip-5.52-qEUDEK/blib/lib:/usr/local/src/CPAN/build/Data-NDS-1.02-79IKmq/blib/arch:/usr/local/src/CPAN/build/Data-NDS-1.02-79IKmq...
AN/build
/POE-Component-Client-DNS-1.00-02jeMw/blib/lib:/usr/local/src/CPAN/build/Net-DNS-0.63-GQV6tw/blib/arch:/usr/local/src/CPAN/build/Net-DNS-0.63-GQV6tw/blib/lib:/usr/local/src/CPAN/build/Digest-HMAC-1.01-iUBLKx/blib/arch:/usr/local/src/CPAN/build/Digest...
AN/build
/Sub-Install-0.924-2DWrFD/blib/lib:/usr/local/src/CPAN/build/Params-Util-0.31-Lil2E5/blib/arch:/usr/local/src/CPAN/build/Params-Util-0.31-Lil2E5/blib/lib:/usr/local/src/CPAN/build/Class-MOP-0.55-et5QK6/blib/arch:/usr/local/src/CPAN/build/Class-MOP-0....
PERL5OPT =
PERL5_CPANPLUS_IS_RUNNING = 54951
PERL5_CPAN_IS_RUNNING = 54951
view all matches for this distribution
view release on metacpan or search on metacpan
vhost/html/js/prototype.js view on Meta::CPAN
var array = Object(this), length = array.length >>> 0;
if (length === 0) return -1;
i = Number(i);
if (isNaN(i)) {
i = 0;
} else if (i !== 0 && isFinite(i)) {
i = (i > 0 ? 1 : -1) * Math.floor(Math.abs(i));
}
vhost/html/js/prototype.js view on Meta::CPAN
var array = Object(this), length = array.length >>> 0;
if (length === 0) return -1;
if (!Object.isUndefined(i)) {
i = Number(i);
if (isNaN(i)) {
i = 0;
} else if (i !== 0 && isFinite(i)) {
i = (i > 0 ? 1 : -1) * Math.floor(Math.abs(i));
}
} else {
view all matches for this distribution
view release on metacpan or search on metacpan
vhost/html/js/tiny_mce/plugins/table/editor_plugin.js view on Meta::CPAN
(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TablePlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;each([['table','table.desc','mceInsertTable',true],['delete_table','table.del','mceTableDelete'],['delete_col','tab...
view all matches for this distribution
view release on metacpan or search on metacpan
vhost/html/js/tiny_mce/plugins/table/editor_plugin.js view on Meta::CPAN
(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TablePlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;each([['table','table.desc','mceInsertTable',true],['delete_table','table.del','mceTableDelete'],['delete_col','tab...
view all matches for this distribution
view release on metacpan or search on metacpan
templates/js/sorttable.js view on Meta::CPAN
/* sort functions
each sort function takes two parameters, a and b
you are comparing a[0] and b[0] */
sort_numeric: function(a,b) {
aa = parseFloat(a[0].replace(/[^0-9.-]/g,''));
if (isNaN(aa)) aa = 0;
bb = parseFloat(b[0].replace(/[^0-9.-]/g,''));
if (isNaN(bb)) bb = 0;
return aa-bb;
},
sort_alpha: function(a,b) {
if (a[0]==b[0]) return 0;
if (a[0]<b[0]) return -1;
view all matches for this distribution
view release on metacpan or search on metacpan
vhost/html/js/tiny_mce/plugins/table/editor_plugin.js view on Meta::CPAN
(function(){var each=tinymce.each;tinymce.create('tinymce.plugins.TablePlugin',{init:function(ed,url){var t=this;t.editor=ed;t.url=url;each([['table','table.desc','mceInsertTable',true],['delete_table','table.del','mceTableDelete'],['delete_col','tab...
view all matches for this distribution
view release on metacpan or search on metacpan
inc/bundle/JSON/PP.pm view on Meta::CPAN
Note that numerical precision has the same meaning as under Perl (so
binary to decimal conversion follows the same rules as in Perl, which
can differ to other languages). Also, your perl interpreter might expose
extensions to the floating point numbers of your platform, such as
infinities or NaN's - these cannot be represented in JSON, and it is an
error to pass those in.
JSON::PP (and JSON::XS) trusts what you pass to C<encode> method
(or C<encode_json> function) is a clean, validated data structure with
values that can be represented as valid JSON values only, because it's
not from an external data source (as opposed to JSON texts you pass to
C<decode> or C<decode_json>, which JSON::PP considers tainted and
doesn't trust). As JSON::PP doesn't know exactly what you and consumers
of your JSON texts want the unexpected values to be (you may want to
convert them into null, or to stringify them with or without
normalisation (string representation of infinities/NaN may vary
depending on platforms), or to croak without conversion), you're advised
to do what you and your consumers need before you encode, and also not
to numify values that may start with values that look like a number
(including infinities/NaN), without validating.
=back
=head2 OBJECT SERIALISATION
view all matches for this distribution
view release on metacpan or search on metacpan
include/boost/limits.hpp view on Meta::CPAN
BOOST_STATIC_CONSTANT(int, min_exponent10 = 0);
BOOST_STATIC_CONSTANT(int, max_exponent = 0);
BOOST_STATIC_CONSTANT(int, max_exponent10 = 0);
BOOST_STATIC_CONSTANT(bool, has_infinity = false);
BOOST_STATIC_CONSTANT(bool, has_quiet_NaN = false);
BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false);
BOOST_STATIC_CONSTANT(bool, has_denorm = false);
BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false);
static BOOST_LLT infinity() throw() { return 0; };
static BOOST_LLT quiet_NaN() throw() { return 0; };
static BOOST_LLT signaling_NaN() throw() { return 0; };
static BOOST_LLT denorm_min() throw() { return 0; };
BOOST_STATIC_CONSTANT(bool, is_iec559 = false);
BOOST_STATIC_CONSTANT(bool, is_bounded = true);
BOOST_STATIC_CONSTANT(bool, is_modulo = true);
include/boost/limits.hpp view on Meta::CPAN
BOOST_STATIC_CONSTANT(int, min_exponent10 = 0);
BOOST_STATIC_CONSTANT(int, max_exponent = 0);
BOOST_STATIC_CONSTANT(int, max_exponent10 = 0);
BOOST_STATIC_CONSTANT(bool, has_infinity = false);
BOOST_STATIC_CONSTANT(bool, has_quiet_NaN = false);
BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false);
BOOST_STATIC_CONSTANT(bool, has_denorm = false);
BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false);
static BOOST_ULLT infinity() throw() { return 0; };
static BOOST_ULLT quiet_NaN() throw() { return 0; };
static BOOST_ULLT signaling_NaN() throw() { return 0; };
static BOOST_ULLT denorm_min() throw() { return 0; };
BOOST_STATIC_CONSTANT(bool, is_iec559 = false);
BOOST_STATIC_CONSTANT(bool, is_bounded = true);
BOOST_STATIC_CONSTANT(bool, is_modulo = true);
view all matches for this distribution
view release on metacpan or search on metacpan
src/catch.hpp view on Meta::CPAN
return Converter<T>(t);
}
template <typename FP>
bool almostEqualUlps(FP lhs, FP rhs, int maxUlpDiff) {
// Comparison with NaN should always be false.
// This way we can rule it out before getting into the ugly details
if (std::isnan(lhs) || std::isnan(rhs)) {
return false;
}
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/CSS/ppport.h view on Meta::CPAN
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/CVSS/v4.pm view on Meta::CPAN
}
my $eq4_next_lower_macro = join '', ($eq1, $eq2, $eq3, $eq4 + 1, $eq5, $eq6);
my $eq5_next_lower_macro = join '', ($eq1, $eq2, $eq3, $eq4, $eq5 + 1, $eq6);
my $score_eq1_next_lower_macro = $CVSS_LOOKUP_GLOBAL->{$eq1_next_lower_macro} || 'NaN';
my $score_eq2_next_lower_macro = $CVSS_LOOKUP_GLOBAL->{$eq2_next_lower_macro} || 'NaN';
my $score_eq3eq6_next_lower_macro_left = undef;
my $score_eq3eq6_next_lower_macro_right = undef;
my $score_eq3eq6_next_lower_macro = undef;
if ($eq3 == 0 && $eq6 == 0) {
# multiple path take the one with higher score
$score_eq3eq6_next_lower_macro_left = $CVSS_LOOKUP_GLOBAL->{$eq3eq6_next_lower_macro_left} || 'NaN';
$score_eq3eq6_next_lower_macro_right = $CVSS_LOOKUP_GLOBAL->{$eq3eq6_next_lower_macro_right} || 'NaN';
$score_eq3eq6_next_lower_macro = max($score_eq3eq6_next_lower_macro_left, $score_eq3eq6_next_lower_macro_right);
}
else {
$score_eq3eq6_next_lower_macro = $CVSS_LOOKUP_GLOBAL->{$eq3eq6_next_lower_macro} || 'NaN';
}
my $score_eq4_next_lower_macro = $CVSS_LOOKUP_GLOBAL->{$eq4_next_lower_macro} || 'NaN';
my $score_eq5_next_lower_macro = $CVSS_LOOKUP_GLOBAL->{$eq5_next_lower_macro} || 'NaN';
# b. The severity distance of the to-be scored vector from a
# highest severity vector in the same MacroVector is determined.
my $eq1_maxes = $MAX_COMPOSED->{eq1}->{$eq1};
my $eq2_maxes = $MAX_COMPOSED->{eq2}->{$eq2};
lib/CVSS/v4.pm view on Meta::CPAN
# d. The maximal scoring difference is multiplied by the proportion of
# distance.
my $n_existing_lower = 0;
if (!isNaN($available_distance_eq1) && $available_distance_eq1 >= 0) {
$n_existing_lower += 1;
$percent_to_next_eq1_severity = ($current_severity_distance_eq1) / $max_severity_eq1;
$normalized_severity_eq1 = $available_distance_eq1 * $percent_to_next_eq1_severity;
}
if (!isNaN($available_distance_eq2) && $available_distance_eq2 >= 0) {
$n_existing_lower += 1;
$percent_to_next_eq2_severity = ($current_severity_distance_eq2) / $max_severity_eq2;
$normalized_severity_eq2 = $available_distance_eq2 * $percent_to_next_eq2_severity;
}
if (!isNaN($available_distance_eq3eq6) && $available_distance_eq3eq6 >= 0) {
$n_existing_lower += 1;
$percent_to_next_eq3eq6_severity = ($current_severity_distance_eq3eq6) / $max_severity_eq3eq6;
$normalized_severity_eq3eq6 = $available_distance_eq3eq6 * $percent_to_next_eq3eq6_severity;
}
if (!isNaN($available_distance_eq4) && $available_distance_eq4 >= 0) {
$n_existing_lower += 1;
$percent_to_next_eq4_severity = ($current_severity_distance_eq4) / $max_severity_eq4;
$normalized_severity_eq4 = $available_distance_eq4 * $percent_to_next_eq4_severity;
}
if (!isNaN($available_distance_eq5) && $available_distance_eq5 >= 0) {
$n_existing_lower += 1;
$percent_to_next_eq5_severity = 0;
$normalized_severity_eq5 = $available_distance_eq5 * $percent_to_next_eq5_severity;
}
lib/CVSS/v4.pm view on Meta::CPAN
my ($self, $metric, $vector_string) = @_;
my %metrics = split /[\/:]/, $vector_string;
return $metrics{$metric};
}
sub isNaN { !defined($_[0] <=> 9**9**9) }
sub to_xml {
my ($self) = @_;
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