view release on metacpan or search on metacpan
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
view release on metacpan or search on metacpan
lib/JavaScript/Embedded/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
view release on metacpan or search on metacpan
share/ext-3.4.1/docs/extjs/ext-all.js view on Meta::CPAN
--
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT OF THIRD-PARTY INTELLECTUAL PROPERTY RIGHTS. See t...
*/
var Ext=Ext||{};Ext._startTime=new Date().getTime();(function(){var h=this,a=Object.prototype,j=a.toString,b=true,g={toString:1},e=function(){},d=function(){var i=d.caller.caller;return i.$owner.prototype[i.$name].apply(this,arguments)},c;Ext.global=...
view all matches for this distribution
view release on metacpan or search on metacpan
quickjs/libbf.c view on Meta::CPAN
*/
bit = get_bit(a->tab, a->len, bit_pos);
bit_pos--;
n--;
bit ^= is_rndn;
/* XXX: slow, but a few iterations on average */
while (n != 0) {
if (get_bit(a->tab, a->len, bit_pos) != bit)
return TRUE;
bit_pos--;
n--;
quickjs/libbf.c view on Meta::CPAN
}
// printf("n=%ld\n", n);
// bf_print_str("T", T);
/* XXX: precision analysis */
/* number of iterations for argument reduction 2 */
K = bf_isqrt((prec + 1) / 2);
/* order of Taylor expansion */
l = prec / (2 * K) + 1;
/* precision of the intermediate computations */
prec1 = prec + K + 2 * l + 32;
view all matches for this distribution
view release on metacpan or search on metacpan
share/handlebars-v4.0.11.js view on Meta::CPAN
} else {
var priorKey = undefined;
for (var key in context) {
if (context.hasOwnProperty(key)) {
// We're running the iterations one step out of sync so we can detect
// the last iteration without have to scan the object twice and create
// an itermediate keys array.
if (priorKey !== undefined) {
execIteration(priorKey, i - 1);
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/03_eval_in_loop.t view on Meta::CPAN
# last;
}
my $t1 = Time::HiRes::gettimeofday();
my $elapsed = 1000.0 * ($t1 - $t0);
ok($count == $times,
sprintf("did all %d iterations with reset=%d, %.0f ms, %.2fms each",
$times, $do_reset ? 1 : 0, $elapsed, $elapsed / $times));
}
sub main {
use_ok($CLASS);
view all matches for this distribution
view release on metacpan or search on metacpan
Tree/Numbered.pm view on Meta::CPAN
my $cursor = $self->{Cursor};
my $length = $self->childCount;
$cursor++;
# return undef when end of iterations. On next call - reset counter.
if ($cursor > $length) {
$cursor = ($length) ? 0 : -1;
}
$self->{Cursor} = $cursor;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Jemplate/Directive.pm view on Meta::CPAN
var failsafe = $WHILE_MAX;
while (--failsafe && ($expr)) {
$block
}
if (! failsafe)
throw("WHILE loop terminated (> $WHILE_MAX iterations)\\n")
EOF
}
#------------------------------------------------------------------------
# javascript($script) [% JAVASCRIPT %]
view all matches for this distribution
view release on metacpan or search on metacpan
share/plugins/Jifty/Plugin/Prototypism/web/static/js/prototypism/scriptaculous/unittest.js view on Meta::CPAN
}.bind(this)) && this.pass();
},
assertElementMatches: function(element, expression) {
this.assertElementsMatch([element], expression);
},
benchmark: function(operation, iterations) {
var startAt = new Date();
(iterations || 1).times(operation);
var timeTaken = ((new Date())-startAt);
this.info((arguments[2] || 'Operation') + ' finished ' +
iterations + ' iterations in ' + (timeTaken/1000)+'s' );
return timeTaken;
},
_isVisible: function(element) {
element = $(element);
if(!element.parentNode) return true;
share/plugins/Jifty/Plugin/Prototypism/web/static/js/prototypism/scriptaculous/unittest.js view on Meta::CPAN
this.assert(!this._isVisible(element), Test.Unit.inspect(element) + " was not hidden and didn't have a hidden parent either. " + ("" || arguments[1]));
},
assertVisible: function(element) {
this.assert(this._isVisible(element), Test.Unit.inspect(element) + " was not visible. " + ("" || arguments[1]));
},
benchmark: function(operation, iterations) {
var startAt = new Date();
(iterations || 1).times(operation);
var timeTaken = ((new Date())-startAt);
this.info((arguments[2] || 'Operation') + ' finished ' +
iterations + ' iterations in ' + (timeTaken/1000)+'s' );
return timeTaken;
}
}
Test.Unit.Testcase = Class.create();
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Geo/KML/PolyMap.pm view on Meta::CPAN
#Recalculate centroids
$rcenters = recalculate_centroids($data,$rcenters,$assn);
#Assign points to clusters
my $newassn = assign_clusters($data,$rcenters);
# End the iterations if the assignments don't change
my $done = 1;
for (my $i = 0;$i<scalar(@$newassn) and $done; $i++) {
$done = ($assn->[$i] == $newassn->[$i])
}
if ($done) {
view all matches for this distribution
view release on metacpan or search on metacpan
cuda/matrixMul_kernel.ptx view on Meta::CPAN
mul.lo.u32 %r45, %r44, 4;
add.u32 %r46, %r45, %r42;
mov.f32 %f1, 0f00000000; // 0
mov.s32 %r47, %r19;
$Lt_0_2818:
//<loop> Loop body line 72, nesting depth: 1, estimated iterations: unknown
.loc 28 87 0
ld.global.f32 %f2, [%r43+0];
st.shared.f32 [%r37+0], %f2;
.loc 28 88 0
ld.global.f32 %f3, [%r41+0];
view all matches for this distribution
view release on metacpan or search on metacpan
0.28 2009-06-26
- YAML serializer no longer stores extra data
- MooseX::Clone is available for entry/reference
- TypeMap::Entry::Std role was split up to smaller roles
- TXN::Memory implements get() properly now (but not iterations yet)
- ->connect("/path/to/config.yml") is now supported
- propagate errors when loading classes in the linker
- core reftypes (ARRAY, HASH etc) are handled by the typemap
- SCALAR refs can be stored in JSON by using a custom typemap
- Support for serializing closures
view all matches for this distribution
view release on metacpan or search on metacpan
lib/LCS/BV.pm view on Meta::CPAN
my ($self,$a,$b) = @_;
#use integer;
#no warnings 'portable'; # for 0xffffffffffffffff
# TODO: maybe faster, if we have fewer expensive iterations
#if (@$a < @$b) {
# my $temp = $a;
# $a = $b;
# $b = $temp;
#}
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
--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
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/LaTeXML/Plugin/LtxMojo/public/js/external/ace-min/mode-php.js view on Meta::CPAN
define("ace/mode/php",["require","exports","module","ace/lib/oop","ace/mode/text","ace/tokenizer","ace/mode/php_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cs...
view all matches for this distribution
view release on metacpan or search on metacpan
-npro
-nsfs
--blank-lines-before-packages=0
--opening-hash-brace-right
--no-outdent-long-comments
--iterations=2
-wbb="% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x="
view all matches for this distribution
view release on metacpan or search on metacpan
.claude/skills/perl-ai-langertha/SKILL.md view on Meta::CPAN
use Langertha::Raider;
my $raider = Langertha::Raider->new(
engine => $engine, # With MCP servers
mission => 'You are a code reviewer.',
max_iterations => 10, # Max tool rounds per raid
# Optional:
max_context_tokens => 4000,
context_compress_threshold => 0.75,
compression_engine => $cheap_model,
raider_mcp => 1, # Enable self-tools (ask_user, pause, abort)
.claude/skills/perl-ai-langertha/SKILL.md view on Meta::CPAN
$raider->add_history('user', $content); # Replay from DB
$raider->clear_history; # Reset
# Metrics
my $m = $raider->metrics;
say "Iterations: $m->{iterations}";
say "Tool calls: $m->{tool_calls}";
```
### Raid Loop (simplified)
.claude/skills/perl-ai-langertha/SKILL.md view on Meta::CPAN
2. Gather tools from MCP servers + inline tools + self-tools
3. Build conversation: mission + history + new messages
4. Call LLM with tools
5. If tool calls: execute via MCP, add results to conversation, loop
6. If no tool calls: extract final text, persist to history, return result
7. Max iterations safety limit
</raider>
<plugins>
## Plugin System
view all matches for this distribution
view release on metacpan or search on metacpan
.claude/skills/langertha/SKILL.md view on Meta::CPAN
use Langertha::Raider;
my $raider = Langertha::Raider->new(
engine => $engine, # With MCP servers
mission => 'You are a code reviewer.',
max_iterations => 10, # Max tool rounds per raid
# Optional:
max_context_tokens => 4000,
context_compress_threshold => 0.75,
compression_engine => $cheap_model,
raider_mcp => 1, # Enable self-tools (ask_user, pause, abort)
.claude/skills/langertha/SKILL.md view on Meta::CPAN
$raider->add_history('user', $content); # Replay from DB
$raider->clear_history; # Reset
# Metrics
my $m = $raider->metrics;
say "Iterations: $m->{iterations}";
say "Tool calls: $m->{tool_calls}";
```
### Raid Loop (simplified)
.claude/skills/langertha/SKILL.md view on Meta::CPAN
2. Gather tools from MCP servers + inline tools + self-tools
3. Build conversation: mission + history + new messages
4. Call LLM with tools
5. If tool calls: execute via MCP, add results to conversation, loop
6. If no tool calls: extract final text, persist to history, return result
7. Max iterations safety limit
</raider>
<plugins>
## Plugin System
view all matches for this distribution
view release on metacpan or search on metacpan
ex/raider_rag.pl view on Meta::CPAN
);
my $r1 = await $raider->raid_f('What is Moose in Perl? One paragraph.');
printf "Answer:\n%s\n\n", $r1;
printf "Metrics: raids=%d, iterations=%d, tool_calls=%d, time=%.0fms\n",
$raider->metrics->{raids},
$raider->metrics->{iterations},
$raider->metrics->{tool_calls},
$raider->metrics->{time_ms};
}
main()->get;
view all matches for this distribution
view release on metacpan or search on metacpan
t/1-classes/ip.t view on Meta::CPAN
while ( keys %wanted ) {
$iter++;
$ip->dir_go_away;
delete $wanted{ $ip->get_delta->as_string };
}
is(keys %wanted, 0, "go_away went north/east/south/west (in $iter iterations)");
#-- turn left
# cardinal directions
view all matches for this distribution
view release on metacpan or search on metacpan
hugs98-Nov2003/src/static.c view on Meta::CPAN
ps = tl(ps);
if (its++ >= factor*cutoff) {
Cell bpi = inst(in).head;
ERRMSG(inst(in).line) "\n*** Cannot derive " ETHEN ERRPRED(bpi);
ERRTEXT " after %d iterations.", its-1 ETHEN
ERRTEXT
"\n*** This may indicate that the problem is undecidable. However,\n"
ETHEN ERRTEXT
"*** you may still try to increase the cutoff limit using the -c\n"
ETHEN ERRTEXT
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Language/l33t.pm view on Meta::CPAN
before run => sub($self,@) {
die "L0L!!1!1!! n0 l33t pr0gr4m l04d3d, sUxX0r!\n"
unless $self->_has_memory;
};
sub run ( $self, $nbr_iterations = -1 ) {
while ( $self->_iterate ) {
$nbr_iterations-- if $nbr_iterations != -1;
return 1 unless $nbr_iterations;
}
return 0;
}
lib/Language/l33t.pm view on Meta::CPAN
=head2 source( $l33tcode )
Loads and "compiles" the string $l33tcode. If one program was already loaded,
it is clobbered by the newcomer.
=head2 run( [ $nbr_iterations ] )
Runs the loaded program. If $nbr_iterations is given, interupts the program
after this number of iterations even if it hasn't terminated. Returns 0 in
case the program terminated by evaluating an END, 1 if it finished by reaching
$nbr_iterations.
=head2 reset
Reset the interpreter to its initial setting. Code is
recompiled, and pointers reset to their initial values.
view all matches for this distribution
view release on metacpan or search on metacpan
bench/benchmark.pl view on Meta::CPAN
my $x = bench_slot();
print "=== Legba Slot Benchmark ===\n\n";
# Test 1: Getter performance
print "--- Getter Performance (10M iterations) ---\n";
my $result = timethese(10_000_000, {
'slot_getter' => sub { my $v = bench_slot(); },
});
print "\n";
# Test 2: Setter performance
print "--- Setter Performance (10M iterations) ---\n";
$result = timethese(10_000_000, {
'slot_setter' => sub { bench_slot(42); },
});
print "\n";
# Test 3: Mixed get/set
print "--- Mixed Get/Set (5M iterations each) ---\n";
$result = timethese(5_000_000, {
'get_then_set' => sub {
my $v = bench_slot();
bench_slot($v + 1);
},
});
print "\n";
# Test 4: Compare to hash access
print "--- Comparison: Slot vs Hash vs Scalar (10M iterations) ---\n";
my %hash = (bench => 0);
my $scalar = 0;
bench_slot(0);
cmpthese(10_000_000, {
view all matches for this distribution
view release on metacpan or search on metacpan
site/htdocs/static/bwr/angular/angular.js view on Meta::CPAN
* @description
*
* Sets the number of times `$onChanges` hooks can trigger new changes before giving up and
* assuming that the model is unstable.
*
* The current default is 10 iterations.
*
* In complex applications it's possible that dependencies between `$onChanges` hooks and bindings will result
* in several iterations of calls to these hooks. However if an application needs more than the default 10
* iterations to stabilize then you should investigate what is causing the model to continuously change during
* the `$onChanges` hook execution.
*
* Increasing the TTL could have performance implications, so you should not change it without proper justification.
*
* @param {number} limit The number of `$onChanges` hook iterations.
* @returns {number|object} the current limit (or `this` if called as a setter for chaining)
*/
this.onChangesTtl = function(value) {
if (arguments.length) {
TTL = value;
site/htdocs/static/bwr/angular/angular.js view on Meta::CPAN
function flushOnChangesQueue() {
try {
if (!(--onChangesTtl)) {
// We have hit the TTL limit so reset everything
onChangesQueue = undefined;
throw $compileMinErr('infchng', '{0} $onChanges() iterations reached. Aborting!\n', TTL);
}
// We must run this hook in an apply since the $$postDigest runs outside apply
$rootScope.$apply(function() {
for (var i = 0, ii = onChangesQueue.length; i < ii; ++i) {
try {
site/htdocs/static/bwr/angular/angular.js view on Meta::CPAN
* @description
* AngularJS's wrapper for `window.setInterval`. The `fn` function is executed every `delay`
* milliseconds.
*
* The return value of registering an interval function is a promise. This promise will be
* notified upon each tick of the interval, and will be resolved after `count` iterations, or
* run indefinitely if `count` is not defined. The value of the notification will be the
* number of iterations that have run.
* To cancel an interval, call `$interval.cancel(promise)`.
*
* In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to
* move forward by `millis` milliseconds and trigger any functions scheduled to run in that
* time.
site/htdocs/static/bwr/angular/angular.js view on Meta::CPAN
* @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat
* indefinitely.
* @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise
* will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.
* @param {...*=} Pass additional parameters to the executed function.
* @returns {promise} A promise which will be notified on each iteration. It will resolve once all iterations of the interval complete.
*
* @example
* <example module="intervalExample" name="interval-service">
* <file name="index.html">
* <script>
site/htdocs/static/bwr/angular/angular.js view on Meta::CPAN
/**
* @ngdoc method
* @name $rootScopeProvider#digestTtl
* @description
*
* Sets the number of `$digest` iterations the scope should attempt to execute before giving up and
* assuming that the model is unstable.
*
* The current default is 10 iterations.
*
* In complex applications it's possible that the dependencies between `$watch`s will result in
* several digest iterations. However if an application needs more than the default 10 digest
* iterations for its model to stabilize then you should investigate what is causing the model to
* continuously change during the digest.
*
* Increasing the TTL could have performance implications, so you should not change it without
* proper justification.
*
* @param {number} limit The number of digest iterations.
*/
/**
* @ngdoc service
site/htdocs/static/bwr/angular/angular.js view on Meta::CPAN
* Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and
* its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change
* the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers}
* until no more listeners are firing. This means that it is possible to get into an infinite
* loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of
* iterations exceeds 10.
*
* Usually, you don't call `$digest()` directly in
* {@link ng.directive:ngController controllers} or in
* {@link ng.$compileProvider#directive directives}.
* Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within
site/htdocs/static/bwr/angular/angular.js view on Meta::CPAN
// `break traverseScopesLoop;` takes us to here
if ((dirty || asyncQueue.length) && !(ttl--)) {
clearPhase();
throw $rootScopeMinErr('infdig',
'{0} $digest() iterations reached. Aborting!\n' +
'Watchers fired in the last 5 iterations: {1}',
TTL, watchLog);
}
} while (dirty || asyncQueue.length);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lemplate/Directive.pm view on Meta::CPAN
break
end
$block
end
if not failsafe then
return error("WHILE loop terminated (> $WHILE_MAX iterations)\\n")
end
end
EOF
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lib/CPUInfo.pm view on Meta::CPAN
=item * Counting number of CPUs
Loops: 1,000.
Lib::CPUInfo: Ran 21 iterations (1 outliers).
Lib::CPUInfo: Rounded run time per iteration: 4.163e-04 +/- 1.5e-06 (0.4%)
Sys::Info::Device::CPU: Ran 25 iterations (5 outliers).
Sys::Info::Device::CPU: Rounded run time per iteration: 9.4582e-01 +/- 2.9e-04 (0.0%)
Rex::Inventory::Proc: Ran 21 iterations (0 outliers).
Rex::Inventory::Proc: Rounded run time per iteration: 5.790e-01 +/- 1.1e-03 (0.2%)
=item * Getting the CPU package name
Loops: 1,000.
Lib::CPUInfo: Ran 23 iterations (3 outliers).
Lib::CPUInfo: Rounded run time per iteration: 1.2206e-02 +/- 1.3e-05 (0.1%)
Sys::Info::Device::CPU: Ran 23 iterations (3 outliers).
Sys::Info::Device::CPU: Rounded run time per iteration: 9.6313e-01 +/- 1.0e-03 (0.1%)
=back
=head1 COVERAGE
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Lib/Pepper/Simple.pm view on Meta::CPAN
# SOLUTION: We never call pepFinalize(), keeping the library loaded in memory.
# This allows creating new instances even after all previous instances are destroyed.
#
# Trade-offs:
# PRO: Can create instances â destroy all â create new instances â
# PRO: No -103 errors, can run unlimited test iterations â
# PRO: Simpler lifecycle management â
# CON: Library stays in memory until process exit (~few MB)
# CON: Cannot reset library state without restarting process
#
# Note: Instance-level resources (connections, handles) are still properly cleaned up.
view all matches for this distribution