view release on metacpan or search on metacpan
t/MyTestHelpers.pm view on Meta::CPAN
#
# use Exporter;
# use vars qw(@ISA @EXPORT_OK %EXPORT_TAGS);
# @ISA = ('Exporter');
# @EXPORT_OK = qw(findrefs
# main_iterations
# warn_suppress_gtk_icon
# glib_gtk_versions
# any_signal_connections
# nowarnings);
# %EXPORT_TAGS = (all => \@EXPORT_OK);
t/MyTestHelpers.pm view on Meta::CPAN
#-----------------------------------------------------------------------------
# Gtk/Glib helpers
# Gtk 2.16 can go into a hard loop on events_pending() / main_iteration_do()
# if dbus is not running, or something like that. In any case limiting the
# iterations is good for test safety.
#
sub main_iterations {
my $count = 0;
if (DEBUG) { MyTestHelpers::diag ("main_iterations() ..."); }
while (Gtk2->events_pending) {
$count++;
Gtk2->main_iteration_do (0);
if ($count >= 500) {
MyTestHelpers::diag ("main_iterations(): oops, bailed out after $count events/iterations");
return;
}
}
MyTestHelpers::diag ("main_iterations(): ran $count events/iterations");
}
# warn_suppress_gtk_icon() is a $SIG{__WARN__} handler which suppresses spam
# from Gtk trying to make you buy the hi-colour icon theme. Eg,
#
t/MyTestHelpers.pm view on Meta::CPAN
while (! $done) {
if (DEBUG >= 2) { MyTestHelpers::diag ("wait_for_event() iteration $count"); }
Gtk2->main_iteration;
$count++;
}
MyTestHelpers::diag ("wait_for_event(): '$signame' ran $count events/iterations\n");
$widget->signal_handler_disconnect ($sig_id);
Glib::Source->remove ($timer_id);
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/MyTestHelpers.pm view on Meta::CPAN
#
# use Exporter;
# use vars qw(@ISA @EXPORT_OK %EXPORT_TAGS);
# @ISA = ('Exporter');
# @EXPORT_OK = qw(findrefs
# main_iterations
# warn_suppress_gtk_icon
# glib_gtk_versions
# any_signal_connections
# nowarnings);
# %EXPORT_TAGS = (all => \@EXPORT_OK);
t/MyTestHelpers.pm view on Meta::CPAN
#-----------------------------------------------------------------------------
# Gtk/Glib helpers
# Gtk 2.16 can go into a hard loop on events_pending() / main_iteration_do()
# if dbus is not running, or something like that. In any case limiting the
# iterations is good for test safety.
#
sub main_iterations {
my $count = 0;
if (DEBUG) { MyTestHelpers::diag ("main_iterations() ..."); }
while (Gtk2->events_pending) {
$count++;
Gtk2->main_iteration_do (0);
if ($count >= 500) {
MyTestHelpers::diag ("main_iterations(): oops, bailed out after $count events/iterations");
return;
}
}
MyTestHelpers::diag ("main_iterations(): ran $count events/iterations");
}
# warn_suppress_gtk_icon() is a $SIG{__WARN__} handler which suppresses spam
# from Gtk trying to make you buy the hi-colour icon theme. Eg,
#
t/MyTestHelpers.pm view on Meta::CPAN
while (! $done) {
if (DEBUG >= 2) { MyTestHelpers::diag ("wait_for_event() iteration $count"); }
Gtk2->main_iteration;
$count++;
}
MyTestHelpers::diag ("wait_for_event(): '$signame' ran $count events/iterations\n");
$widget->signal_handler_disconnect ($sig_id);
Glib::Source->remove ($timer_id);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Image/Bitmap2Paths.pm view on Meta::CPAN
At C<[$y][$x]>, the count of directions in which a ray goes for length >=2.
=item C<stage10>
Combines: C<rays> C<longedges10> C<seenlong10> C<inLong10> C<midLong10> (done in two long iterations of DO_RAYS + a minor
massage)
=item C<rays>
For each C<[$y][$x][$dir]> which corresponds to a known neighbor, contains the (preliminary) result of the deep inspection of the
view all matches for this distribution
view release on metacpan or search on metacpan
ccv-src/bin/cifar-10.c view on Meta::CPAN
layer_params[8].bias.momentum = 0.9;
ccv_convnet_train_param_t params = {
.max_epoch = 999,
.mini_batch = 128,
.iterations = 500,
.symmetric = 1,
.color_gain = 0,
.device_count = 1,
.layer_params = layer_params,
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Image/DominantColors.pm view on Meta::CPAN
my $cc = Image::ColorCollection->new();
push @centroids, $cc;
}
my $shft = 100;
my $it = 0;#track iterations
# print "TotalCentroid : ".scalar(@centroids);
while($shft != 0)
{
foreach my $col (@colors) {
my $min = LONG_MAX;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Image/ExifTool/MIFF.pm view on Meta::CPAN
depth => 'Depth',
dispose => 'Dispose',
gamma => 'Gamma',
'green-primary' => 'GreenPrimary',
id => 'ID',
iterations => 'Iterations',
label => 'Label',
matte => 'Matte',
montage => 'Montage',
packets => 'Packets',
page => 'Page',
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Image/Leptonica/Func/ccthin.pm view on Meta::CPAN
index = 4 sel_8_2, sel_8_3, sel_48_2
index = 5 sel_8_1, sel_8_5, sel_8_6
index = 6 sel_8_2, sel_8_3, sel_8_8, sel_8_9
index = 7 sel_8_5, sel_8_6, sel_8_7, sel_8_7_rot
Thickening:
index = 8 sel_4_2, sel_4_3 (e.g,, do just a few iterations)
index = 9 sel_8_4 (e.g., do just a few iterations)
=head2 pixThinGeneral
PIX * pixThinGeneral ( PIX *pixs, l_int32 type, SELA *sela, l_int32 maxiters )
view all matches for this distribution
view release on metacpan or search on metacpan
demo/demo.pl view on Meta::CPAN
push(@$images,$example);
print "Morphology...\n";
$example=$model->Clone();
$example->Label('Morphology');
$example->Morphology(method=>'Dilate',kernel=>'Diamond',iterations=>2);
push(@$images,$example);
print "Motion Blur...\n";
$example=$model->Clone();
$example->Label('Motion Blur');
view all matches for this distribution
view release on metacpan or search on metacpan
libpng-1.6.17/ltmain.sh view on Meta::CPAN
# Relative path, prepend $cwd.
func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
;;
esac
# Cancel out all the simple stuff to save iterations. We also want
# the path to end with a slash for ease of parsing, so make sure
# there is one (and only one) here.
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
while :; do
view all matches for this distribution
view release on metacpan or search on metacpan
include/common.h view on Meta::CPAN
#endif
// Based on code from http://www.agner.org/optimize/
// Test code to count clock cycles of some portion of the code
// Wrap code to be tested with CLOCK_START(n) ... CLOCK_END(n)
// where n is a count of iterations to run. Code must support
// being run more than once.
#ifdef CLOCK_CYCLE_TESTS
// Read time stamp counter
// The return value is the internal clock count
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Image/TextMode/Reader/ANSI/XS.pm view on Meta::CPAN
=head1 BENCHMARK
Image::TextMode version 0.22
Image::TextMode::Reader::ANSI::XS version 0.09
Filesize: 75501 bytes
Benchmark: timing 50 iterations of PP, XS...
PP: 33 wallclock secs (32.03 usr + 0.01 sys = 32.04 CPU) @ 1.56/s (n=50)
XS: 1 wallclock secs ( 1.59 usr + 0.03 sys = 1.62 CPU) @ 30.86/s (n=50)
Rate PP XS
PP 1.56/s -- -95%
XS 30.9/s 1878% --
view all matches for this distribution
view release on metacpan or search on metacpan
webp-src/libtool view on Meta::CPAN
*)
# Relative path, prepend $cwd.
func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
;;
esac
# Cancel out all the simple stuff to save iterations. We also want
# the path to end with a slash for ease of parsing, so make sure
# there is one (and only one) here.
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
while :; do
view all matches for this distribution
view release on metacpan or search on metacpan
* [FEATURE] Need to alter number of words shown on an image based on the image
size and bounds. We can't fit 70 words in a 200x200
* [OPTIMIZATION] Run time of cloud() increases as the image size increases. In
fact the run time of M::P::TheodorusSpiral::n_to_xy() doubles when the image
doubles. This is because M::P::TheodorusSpiral has to cover a much larger
area and thus gets more iterations (calls). A 500x500 image makes 6709
calls n_to_xy(), a 1000x1000 image makes 22,987 calls, and a 2000x2000 image
makes 44,261 calls.
- Can't fix this! Internally n_to_xy() has to run over each iteration.
Increasing our incrementer just makes the internals spin MILLIONS of times
to catch up, rather than just keeping in line with the calls we make. It
view all matches for this distribution
view release on metacpan or search on metacpan
vendor/qrencode-3.4.2/use/ltmain.sh view on Meta::CPAN
*)
# Relative path, prepend $cwd.
func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
;;
esac
# Cancel out all the simple stuff to save iterations. We also want
# the path to end with a slash for ease of parsing, so make sure
# there is one (and only one) here.
func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
-e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
while :; do
view all matches for this distribution
view release on metacpan or search on metacpan
Mandelbrot/Mandelbrot.pm view on Meta::CPAN
C<miny>, C<maxy> - the range of y values to render. Defaults: -1.5, 1.5
=item *
C<maxiter> - the maximum number of iterations to perform when checking
if the sequence tend towards infinity.
=back
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
ffi/target/release/build/mlua-sys-6a99a2ae50f12319/out/luajit-build/build/dynasm/dynasm.lua view on Meta::CPAN
if subst then gotsubst = word; return subst else return word end
end
-- Iteratively substitute defines.
local function definesubst(stmt)
-- Limit number of iterations.
for i=1,100 do
gotsubst = false
stmt = gsub(stmt, "#?[%w_]+", definesubst_one)
if not gotsubst then break end
end
view all matches for this distribution
view release on metacpan or search on metacpan
t/35dictunicodememleak.t view on Meta::CPAN
$rss *= 1024;
}
return $rss;
}
my $iterations = 3_000_000;
my $rss_before_iterations = get_rss_memory();
# print STDERR "RSS before python_dict_with_unicode_key(): $rss_before_iterations\n";
my $dict;
for (my $x = 0; $x < $iterations; ++$x) {
$dict = python_dict_with_unicode_key();
}
my $rss_after_iterations = get_rss_memory();
# print STDERR "RSS after python_dict_with_unicode_key(): $rss_after_iterations\n";
ok( $rss_after_iterations - $rss_before_iterations < 100 * 1024 * 1024, "RSS takes up less than 100 MB" );
Test::Deep::cmp_deeply( $dict, { 'abcdefghijklmno' => 1, 'pqrstuvwxyz' => 2 } );
view all matches for this distribution
view release on metacpan or search on metacpan
t/lib/MyTest/Utils.pm view on Meta::CPAN
my $err = $@;
my $ctx = context();
is( $cnt, $max, 'not enough or too few iterations' );
$ctx->release;
die $@ if $@;
}
view all matches for this distribution
view release on metacpan or search on metacpan
};
is $@, q{}, q{Created one-arg iterator; no exception};
# How do you test an infinite iterator?
# Well, let's run through a bunch of iterations, see if it pans out.
$worked = 1; # assume okay
eval
{
foreach my $test (52..151) # try a hundred values
{
view all matches for this distribution
view release on metacpan or search on metacpan
lib/IxNetwork/IxNetwork.pm view on Meta::CPAN
my $sock = $_socket;
my $rin = '';
my $win = '';
my $buffer = '';
my $timeout = 15;
my $iterations = 2;
vec($rin, fileno($sock), 1) = 1;
vec($win, fileno($sock), 1) = 1;
my $ein= $rin | $win;
my $socketOpen = select(my $rout = $rin, my $wout = $win, my $eout = $ein, 1);
while ($iterations > 0 and !$socketOpen) {
$socketOpen = select(my $rout = $rin, my $wout = $win, my $eout = $ein, 1);
$iterations -= 1;
}
if (!$socketOpen) {
die "Host is unreachable.\n";
}
$_socket->blocking(1);
view all matches for this distribution
view release on metacpan or search on metacpan
t/12-statements.t view on Meta::CPAN
/* 33-45 */
is_eval('3;do;while(0)', 3, 'do with one iteration returning nothing')
is_eval('do 3;while(0)', 3, 'do with one iteration returning something')
is_eval('var x=0; do if(x);else 3;while(!x++)', 3,
'do with two iterations, returning the value of the first')
is_eval('var x=0; do if(x)4;else 3;while(!x++)', 4,
'do with two iterations, returning the value of the 2nd')
is_eval('3;var x=0; do;while(!x++)', 3,
'do with two iterations, returning nothing')
x = 0; y=0
do { if(!x) continue; else ++y; ++y; } while(!x++)
is(y, 2, 'do-continue without label')
t/12-statements.t view on Meta::CPAN
is_eval('var x=0;3;while(!x++);', 3,
'while with one iteration returning nothing')
is_eval('var x=0;while(!x++)3', 3,
'while with one iteration returning something')
is_eval('var x=-1; while(++x<2)if(x);else 3;', 3,
'while with two iterations, returning the value of the first')
is_eval('var x=-1; while(++x<2)if(x)4;else 3;', 4,
'while with two iterations, returning the value of the 2nd')
is_eval('3;var x=-1; while(++x<2);', 3,
'do with two iterations, returning nothing')
x = -1; y=0
while(++x<2) { if(!x) continue; else ++y; ++y; }
is(y, 2, 'while-continue without label')
t/12-statements.t view on Meta::CPAN
is_eval('var x=0;3;for(;x<1;++x);', 3,
'for(;;) with one iteration returning nothing')
is_eval('var x=0;for(;x<1;++x)3', 3,
'for(;;) with one iteration returning something')
is_eval('var x=-1; for(;++x<2;)if(x);else 3;', 3,
'for(;;) with two iterations, returning the value of the first')
is_eval('var x=-1; for(;++x<2;)if(x)4;else 3;', 4,
'for(;;) with two iterations, returning the value of the 2nd')
is_eval('3;var x=-1; for(;++x<2;);', 3,
'do with two iterations, returning nothing')
x = 0; y=0
for(;x<2;x++) { if(!x) continue; else ++y; ++y; }
is(y+' '+x, '2 2', 'for(;;)-continue without label')
t/12-statements.t view on Meta::CPAN
is_eval('3;for(var x=0;x<1;++x);', 3,
'for(var;;) with one iteration returning nothing')
is_eval('for(var x=0;x<1;++x)3', 3,
'for(var;;) with one iteration returning something')
is_eval('; for(var x=-1;++x<2;)if(x);else 3;', 3,
'for(var;;) with two iterations, returning the value of the first')
is_eval('; for(var x=-1;++x<2;)if(x)4;else 3;', 4,
'for(var;;) with two iterations, returning the value of the 2nd')
is_eval('3;; for(var x=-1;++x<2;);', 3,
'for(var;;) with two iterations, returning nothing')
for(var x = 0, y=0;x<2;x++) { if(!x) continue; else ++y; ++y; }
is(y+' '+x, '2 2', 'for(var ;;)-continue without label')
ihat: aur: for(var x = 0, y=0;!y++;) { continue ihat; x = 1 }
t/12-statements.t view on Meta::CPAN
is_eval('var x;3;for(x in o1);', 3,
'for-in with one iteration returning nothing')
is_eval('var x;for(x in o1)3', 3,
'for-in with one iteration returning something')
is_eval('var x=0,y;for(y in o)if(x++);else 3;', 3,
'for-in with two iterations, returning the value of the first')
is_eval('var x=0,y; for(y in o)if(x++)4;else 3;', 4,
'for-in with two iterations, returning the value of the 2nd')
is_eval('3;var x;for(x in o);', 3,
'for-in with two iterations, returning nothing')
var a = []
for(a[a.length] in o);
is(a.sort(), 'a,c', 'the lhs gets property names assigned')
t/12-statements.t view on Meta::CPAN
is_eval('3;for(var x in o1);', 3,
'for-var-in with one iteration returning nothing')
is_eval('for(var x in o1)3', 3,
'for-var-in with one iteration returning something')
is_eval('var x=0;for(var y in o)if(x++);else 3;', 3,
'for-var-in with two iterations, returning the value of the first')
is_eval('var x=0; for(var y in o)if(x++)4;else 3;', 4,
'for-var-in with two iterations, returning the value of the 2nd')
is_eval('3;for(var x in o);', 3,
'for-var-in with two iterations, returning nothing')
var a = []
for(var x in o) a.push(x);
is(a.sort(), 'a,c', 'the lhs gets property names assigned')
view all matches for this distribution
view release on metacpan or search on metacpan
t/data/hypercritical.json view on Meta::CPAN
},
"date_published" : "2012-11-27T09:42:00-05:00",
"id" : "http://hypercritical.co/2012/11/27/strange-game",
"date_modified" : "2012-11-27T09:42:00-05:00",
"title" : "Strange Game",
"content_html" : "<div class=\"image header\"><img src=\"/2012/11/27/images/journey.jpg\" width=\"640\" height=\"360\" alt=\"Journey\"/></div>\n\n<p><i>This article originally appeared in <a href=\"http://the-magazine.org/2/strange-game\">is...
"url" : "http://hypercritical.co/2012/11/27/strange-game"
},
{
"date_modified" : "2014-10-17T08:59:48-04:00",
"title" : "About My Mountain Lion Review",
view all matches for this distribution
view release on metacpan or search on metacpan
if (SvMAGICAL (hv))
{
// need to count by iterating. could improve by dynamically building the vector below
// but I don't care for the speed of this special case.
// note also that we will run into undefined behaviour when the two iterations
// do not result in the same count, something I might care for in some later release.
count = 0;
while (hv_iternext (hv))
++count;
view all matches for this distribution
view release on metacpan or search on metacpan
eg/bench.pl view on Meta::CPAN
use Carp qw(confess);
$SIG{__DIE__} = \&confess;
GetOptions(
'i|iterations=i' => \my $Iterations,
'x|jsonxs' => \my $TestJsonxs,
's|jsonsl' => \my $TestJsonsl,
'j|jpr' => \my $TestJsonpointer,
'c|chunked=i' => \my $TestChunks,
'f|file=s' => \my $TESTFILE,
eg/bench.pl view on Meta::CPAN
);
if ($PrintHelp) {
print STDERR <<EOF;
$0 [options]
-i --iterations=NUM Number of iterations
-x --jsonxs Benchmark JSON::XS
-s --jsonsl Benchmark JSON::SL
-j --jpr Test JSONPointer functionality
-f --file=FILE Run benchmarks on FILE
-c --chunked=SIZE Test incremental chunks of SIZE bytes
view all matches for this distribution
view release on metacpan or search on metacpan
t/issue-272-recursive-data-protection.t view on Meta::CPAN
},
};
}
my $spec_url = 'https://spec.openapis.org/oas/3.1/schema/2021-05-20';
my $iterations = 500;
my (%errors, $failures);
for (1 .. $iterations) {
my $schema = JSON::Validator::Schema::OpenAPIv3->new(spec(), specification => $spec_url);
next unless my @e = @{$schema->errors};
$failures++;
$errors{"$_"}++ for @e;
}
is $failures, undef, "valid 3.1 \$ref parameter stays valid across $iterations validations (#272)"
or diag "spurious errors: " . join(', ', map {"$_ x$errors{$_}"} sort keys %errors);
done_testing;
view all matches for this distribution
view release on metacpan or search on metacpan
--blank-lines-before-packages=0
--iterations=2
--no-outdent-long-comments
-b
-bar
-boc
-ci=4
view all matches for this distribution
view release on metacpan or search on metacpan
if (SvMAGICAL (hv))
{
// need to count by iterating. could improve by dynamically building the vector below
// but I don't care for the speed of this special case.
// note also that we will run into undefined behaviour when the two iterations
// do not result in the same count, something I might care for in some later release.
count = 0;
while (hv_iternext (hv))
++count;
view all matches for this distribution
view release on metacpan or search on metacpan
t/11_stress.t view on Meta::CPAN
my $json = encode_json({s => $long});
my $back = decode_json($json);
is length($back->{s}), 100_000, "100K string roundtrip";
}
# many iterations
{
my $json = encode_json([map { {id => $_} } 1..1000]);
my $doc = jdoc $json;
my $it = jiter $doc, "";
my $count = 0;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Jabber/Lite.pm view on Meta::CPAN
$wghtpos = abs( int( rand( $wghtcnt + 1 ) + ( $wghthigh - $wghtnum ) ) );
$trycnt++;
}
# Did the loop exit due to success, or because
# of too many iterations?
if( defined( $weights{"$wghtpos"} ) ){
# Count up until we find one.
$wghtpos = 0;
while( defined( $weights{"$wghtpos"} ) ){
$wghtpos++;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/JavaScript/Duktape/C/lib/duktape.c view on Meta::CPAN
DUK_LOCAL duk_int_t duk__year_from_day(duk_int_t day, duk_small_int_t *out_day_within_year) {
duk_int_t year;
duk_int_t diff_days;
/* estimate year upwards (towards positive infinity), then back down;
* two iterations should be enough
*/
if (day >= 0) {
year = 1970 + day / 365;
} else {
view all matches for this distribution