view release on metacpan or search on metacpan
# B::Hooks::OP::Check::LeaveEval
Setup callbacks to call when new code is compiled
## Author
Szymon NieznaÅski <s.nez@member.fsf.org>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/B/Hooks/OP/Check/StashChange.pm view on Meta::CPAN
__END__
=head1 NAME
B::Hooks::OP::Check::StashChange - Invoke callbacks when the stash code is being compiled in changes
=head1 SYNOPSIS
=head2 From Perl
lib/B/Hooks/OP/Check/StashChange.pm view on Meta::CPAN
=head2 TYPES
=head3 OP *(*hook_op_check_stashchange_cb) (pTHX_ OP *op, const char *new_stash, const char *old_stash, void *user_data)
The type the callbacks need to implement.
=head2 FUNCTIONS
=head3 UV hook_op_check_stashchange (hook_op_check_stashchange_cb cb, void *user_data)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/B/Hooks/OP/PPAddr.pm view on Meta::CPAN
=head2 OP
typedef OP *(*hook_op_ppaddr_cb_t) (pTHX_ OP *, void *user_data)
Type that callbacks need to implement.
=head1 FUNCTIONS
=head2 hook_op_ppaddr
lib/B/Hooks/OP/PPAddr.pm view on Meta::CPAN
=head2 hook_op_ppaddr_around
void hook_op_ppaddr_around (OP *op, hook_op_ppaddr_cb_t before, hook_op_ppaddr_cb_t after, void *user_data)
Register the callbacks C<before> and C<after> to be called before and after the
execution of C<op>. C<user_data> will be passed to the callback as the last
argument.
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/B/OPCheck.pm view on Meta::CPAN
package B::OPCheck; # git description: v0.31-4-gd081d88
# ABSTRACT: PL_check hacks using Perl callbacks
use 5.008;
use strict;
use warnings;
lib/B/OPCheck.pm view on Meta::CPAN
=encoding UTF-8
=head1 NAME
B::OPCheck - PL_check hacks using Perl callbacks
=head1 VERSION
version 0.32
view all matches for this distribution
view release on metacpan or search on metacpan
=item result
The request results are processed synchronously by C<poll_cb>.
The C<poll_cb> function will process all outstanding aio requests by
calling their callbacks, freeing memory associated with them and managing
any groups they are contained in.
=item done
Request has reached the end of its lifetime and holds no resources anymore
C<BDB::poll_cb> to process requests (more correctly the mininum amount
of time C<poll_cb> is allowed to use).
Setting C<max_poll_time> to a non-zero value creates an overhead of one
syscall per request processed, which is not normally a problem unless your
callbacks are really really fast or your OS is really really slow (I am
not mentioning Solaris here). Using C<max_poll_reqs> incurs no overhead.
Setting these is useful if you want to ensure some level of
interactiveness when perl is not fast enough to process all requests in
time.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BIND/Conf_Parser.pm view on Meta::CPAN
$self->{_file} = @_ ? shift : "a scalar";
$self->{_line} = 0;
$self->parse_conf;
}
# The callbacks
sub handle_logging_category {}; # $name, \@names
sub handle_logging_channel {}; # $name, \%options
sub handle_key {}; # $name, $algo, $secret
sub handle_acl {}; # $name, $addrmatchlist
sub handle_option {}; # $option, $argument
lib/BIND/Conf_Parser.pm view on Meta::CPAN
The parse() method cannot be called multiple times with parts of
statements.
Comments are not passed to a callback method.
Some callbacks are invoked before the semicolon that terminates the
corresponding syntactic form is actually recognized. It is therefore
possible for a syntax error to not be detected until after a callback
is invoked for the presumably completly parsed form. No attempt is
made to delay the invocation of callbacks to the completion of toplevel
statements.
=head1 NOTE
This version of C<BIND::Conf_Parser> corresponds to BIND version 8.2.2
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BPM/Engine/ProcessRunner.pm view on Meta::CPAN
I<complete> or I<execute>.
=item * C<$node>
The first argument passed to the C<cb_*> callback method, the respective entity
node in the process that this callback is emitted for. On activity callbacks,
this is the activity object, the task object on task callbacks, the process
object for process entities, and transition for transition calls.
=item * C<$instance>
The second argument passed to the C<cb_*> callback method, being the instance
view all matches for this distribution
view release on metacpan or search on metacpan
bson/bson-types.h view on Meta::CPAN
const char *key,
void *data);
/* corrupt BSON, or unsupported type and visit_unsupported_type not set */
void (*visit_corrupt) (const bson_iter_t *iter,
void *data);
/* normal bson field callbacks */
bool (*visit_double) (const bson_iter_t *iter,
const char *key,
double v_double,
void *data);
bool (*visit_utf8) (const bson_iter_t *iter,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Backbone/Events.pm view on Meta::CPAN
Remove a previously-bound callback from an object.
=head2 trigger($event, @args)
Trigger callbacks for the given event.
=head2 once($event, $callback)
Just like 'on', but causes the bound callback to fire only once before being
removed.
view all matches for this distribution
view release on metacpan or search on metacpan
}
*path = '\0';
}
/*
* Simple logging functions. If you register callbacks, they will be called.
* Otherwise, messages are accumulated, and a callback allows the
* log strings to be fetched.
*
* We store the data in a single buffer of '\0'-terminated strings.
*/
view all matches for this distribution
view release on metacpan or search on metacpan
t/filesystem/visitor.t view on Meta::CPAN
'got all default files' );
#-----------------------------------------------------------------------
# visitor callbacks
#-----------------------------------------------------------------------
my $n = 0;
@files = $vdir->visit(
accept_file => sub { $n++ }
view all matches for this distribution
view release on metacpan or search on metacpan
share/public/js/base/jquery.form.js view on Meta::CPAN
}
else {
options.data = q; // data is the query string for 'post'
}
var $form = this, callbacks = [];
if (options.resetForm) {
callbacks.push(function() { $form.resetForm(); });
}
if (options.clearForm) {
callbacks.push(function() { $form.clearForm(); });
}
// perform a load on the target only if dataType is not provided
if (!options.dataType && options.target) {
var oldSuccess = options.success || function(){};
callbacks.push(function(data) {
var fn = options.replaceTarget ? 'replaceWith' : 'html';
$(options.target)[fn](data).each(oldSuccess, arguments);
});
}
else if (options.success) {
callbacks.push(options.success);
}
options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg
var context = options.context || options; // jQuery 1.4+ supports scope context
for (var i=0, max=callbacks.length; i < max; i++) {
callbacks[i].apply(context, [data, status, xhr || $form, $form]);
}
};
// are there files to upload?
var fileInputs = $('input:file', this).length > 0;
share/public/js/base/jquery.form.js view on Meta::CPAN
if (xhr.aborted) {
log('upload aborted');
ok = false;
}
// ordering of these callbacks/triggers is odd, but that's how $.ajax does it
if (ok) {
s.success.call(s.context, data, 'success', xhr);
g && $.event.trigger("ajaxSuccess", [xhr, s]);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Beam/Emitter.pm view on Meta::CPAN
#pod
#pod This role is used by classes that want to add callback hooks to allow
#pod users to add new behaviors to their objects. These hooks are called
#pod "events". A subscriber registers a callback for an event using the
#pod L</subscribe> or L</on> methods. Then, the class can call those
#pod callbacks by L<emitting an event with the emit() method|/emit>.
#pod
#pod Using the L<Beam::Event> class, subscribers can stop an event from being
#pod processed, or prevent the default action from happening.
#pod
#pod =head2 Using Beam::Event
lib/Beam/Emitter.pm view on Meta::CPAN
$args{ name } ||= $name;
my $event = $class->new( %args );
return $event unless exists $self->_listeners->{$name};
# don't use $self->_listeners->{$name} directly, as callbacks may unsubscribe
# from $name, changing the array, and confusing the for loop
my @listeners = @{ $self->_listeners->{$name} };
for my $listener ( @listeners ) {
$listener->callback->( $event );
lib/Beam/Emitter.pm view on Meta::CPAN
sub emit_args {
my ( $self, $name, @args ) = @_;
return unless exists $self->_listeners->{$name};
# don't use $self->_listeners->{$name} directly, as callbacks may unsubscribe
# from $name, changing the array, and confusing the for loop
my @listeners = @{ $self->_listeners->{$name} };
for my $listener ( @listeners ) {
$listener->callback->( @args );
lib/Beam/Emitter.pm view on Meta::CPAN
This role is used by classes that want to add callback hooks to allow
users to add new behaviors to their objects. These hooks are called
"events". A subscriber registers a callback for an event using the
L</subscribe> or L</on> methods. Then, the class can call those
callbacks by L<emitting an event with the emit() method|/emit>.
Using the L<Beam::Event> class, subscribers can stop an event from being
processed, or prevent the default action from happening.
=head2 Using Beam::Event
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Beekeeper/AnyEvent.pm view on Meta::CPAN
USE_PERL_BACKEND: {
# Prefer AnyEvent perl backend over default EV, as it is fast enough
# and it does not ignore exceptions thrown from within callbacks
$ENV{'PERL_ANYEVENT_MODEL'} ||= 'Perl' unless $AnyEvent::MODEL;
}
UNTAINT_IP_ADDR: {
lib/Beekeeper/AnyEvent.pm view on Meta::CPAN
=over
=item *
Prefer the pure perl backend over default EV, as it is fast enough and
it does not ignore exceptions thrown from within callbacks.
=item *
Addresses resolved by AnyEvent::DNS are tainted, causing an "Insecure
dependency in connect" error as Beekeeper runs with taint mode enabled.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Benchmark/Featureset/ParamCheck/Implementation/PV.pm view on Meta::CPAN
use constant short_name => 'PV';
sub get_named_check {
state $check = {
integer => { type => SCALAR, regex => qr/\A-?[0-9]+\z/ },
hashes => { type => ARRAYREF, callbacks => { hashes => sub { !grep ref ne 'HASH', @{$_[0]} } } },
object => { type => OBJECT, can => [qw/print close/] },
};
}
sub get_positional_check {
state $check = [
{ type => SCALAR, regex => qr/\A-?[0-9]+\z/ },
{ type => ARRAYREF, callbacks => { hashes => sub { !grep ref ne 'HASH', @{$_[0]} } } },
{ type => OBJECT, can => [qw/print close/] },
];
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
share/PerlCritic/Critic/Policy/Modules/ProhibitExcessMainComplexity.pm view on Meta::CPAN
complexity of all the code that is B<outside> of any subroutine
declaration.
The usual prescription for reducing complexity is to refactor code
into smaller subroutines. Mark Dominus book "Higher Order Perl" also
describes callbacks, recursion, memoization, iterators, and other
techniques that help create simple and extensible Perl code.
=head1 CONFIGURATION
view all matches for this distribution
view release on metacpan or search on metacpan
BerkeleyDB.xs view on Meta::CPAN
softCrash("associate_foreign needs Berkeley DB 4.8 or later") ;
#else
saveCurrentDB(db) ;
if (callback != &PL_sv_undef)
{
//softCrash("associate_foreign does not support callbacks yet") ;
secondary->associated_foreign = newSVsv(callback) ;
callback_ptr = ( secondary->recno_or_queue
? associate_foreign_cb_recno
: associate_foreign_cb);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Biblio/COUNTER.pm view on Meta::CPAN
die "Instantiating a report from an array not yet implemented";
}
elsif (ref($how)) {
# Read report from a filehandle
my $fh = $how;
my $callbacks = delete($args{'callback'}) || {};
my $report = Biblio::COUNTER::Report->new(
%args,
'fh' => $fh,
'callback' => {
'output' => sub {
my ($self, $output) = @_;
print $output, "\n";
},
%$callbacks,
},
'rows' => [],
'errors' => 0,
'warnings' => 0,
# Current position within the report
lib/Biblio/COUNTER.pm view on Meta::CPAN
specified that is triggered each time the event occurs; see the B<report>
method for how to specify a callback.
Callbacks must be coderefs, not function or method names.
For example, the following callbacks may be used to provide an indication of
the progress in processing it:
$record_number = 0;
%callbacks = (
'begin_report' => sub {
print STDERR "Beginning report: ";
},
'end_header' => sub {
my ($report, $header) = @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bigtop/Parser.pm view on Meta::CPAN
returns an array reference (which is why we have to join the result
in the above skeleton). After the children have been visited, the
callback (C<output_something> in the example) is called with their output
array reference. You can also pass an additional scalar (which is usually
a hash reference) to walk_postorder. It will be passed along to all
the child walk_postorders and to the callbacks.
With this module walking the tree, all you must do is provide the appropriate
callbacks. Put one at each level of the tree that interests you.
For example, if you are generating SQL, you need to put callbacks in
at least the following packages:
table_block
table_element_block
field_statement
lib/Bigtop/Parser.pm view on Meta::CPAN
in the lib/Bigtop subdirectory of Bigtop's build directory,
for the possible packages (or grep for package on this file).
There are also several chapters of the Gantry book devoted to explaining
how to use the AST to build backends.
The callbacks are called as methods on the current tree node. They receive
the output array reference from their children and the data scalar that
was passed to walk_postorder (if one was passed in the top level call).
So, a typical callback method might look like this:
sub output_something {
lib/Bigtop/Parser.pm view on Meta::CPAN
level is the name of a block. Under that, there is a fixed keyword for
each subblock type, etc.
=back
=head2 METHODS for use in walk_postorder callbacks
=over 4
=item dumpme
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Biblio/IO/medlinexml.pm view on Meta::CPAN
} else {
$self->throw ("XML source to be parsed is unknown. Should be given in the new().");
}
# when parsing is done all citations have already been delivered
# to the caller using her callbacks - and nothing to be stored
# here, or parser put all citations into global @Cittaions where
# we want to copy there into this instance - so any caller can
# start parsing other XML input without overwriting already read
# citations from the first parser
if (@Citations) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/DB/HTS/Pileup.pm view on Meta::CPAN
Bio::DB::HTS::Pileup -- Object passed to pileup() callback
=head1 SYNOPSIS
See L<Bio::DB::HTS/The generic fetch() and pileup() methods> for how
this object is passed to pileup callbacks.
=head1 DESCRIPTION
A Bio::DB::HTS::Pileup object (or a Bio::DB::HTS::PileupWrapper
object) is passed to the callback passed to the Bio::DB::HTS->pileup()
view all matches for this distribution
view release on metacpan or search on metacpan
bin/bp_biofetch_genbank_proxy view on Meta::CPAN
%MAPPING = (genbank => {db=>'nucleotide',
rettype => 'gb'},
genpep => {db=>'protein',
rettype => 'gp'});
# we're doing everything in callbacks, so initialize globals.
$BUFFER = '';
%GOT = ();
print header('text/plain');
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Das/Lite.pm view on Meta::CPAN
push @{$ar_ref}, $ref;
$DEBUG and print {*STDERR} q( )x($depth*2), qq(leaving _parse_branch\n);
#########
# only perform callbacks if we're at recursion depth zero
#
if($depth == 0 && $self->{'callback'}) {
$DEBUG and print {*STDERR} q( )x($depth*2), qq(executing callback at depth $depth\n);
$ref->{'dsn'} = $dsn;
my $callback = $self->{'callback'};
lib/Bio/Das/Lite.pm view on Meta::CPAN
Constructs an arrayref of DAS requests including parameters for each call
=head2 build_requests
Constructs the WWW::Curl callbacks
=head2 postprocess
Applies processing to the result set, e.g. removal of whitespace from sequence responses.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/DB/EUtilities.pm view on Meta::CPAN
will work for 'seekable' data.
A callback specified using callback() will be used to filter objects
for any generated iterator. This behaviour is implemented for both
normal and lazy iterator types and is the default. If you don't want
this, make sure to reset any previously set callbacks via
reset_callback() (which just deletes the code ref).
TODO : generate seekable iterators ala HOP for seekable fh data
=head2 callback
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Graphics/Glyph/decorated_transcript.pm view on Meta::CPAN
1) Type. For example used to specify decoration source (e.g. 'SignalP40')
2) Name. Decoration name. Used as decoration label by default (e.g. 'SP' for signal peptide)
3) Start. Start coordinate at the protein-level (1-based coordinate)
4) End. End coordinate at the protein-level
5) Score. Optional. Score associated with a decoration (e.g. Pfam E-value). This score can be used
to dynamically filter or color decorations via callbacks (see glyph options).
6) Description. Optional. User-defined description of decoration. The glyph ignores this description,
but it will be made available to callback functions for inspection. Special characters
like ':' or ',' that might interfere with the GFF tag parser should be avoided.
If callback functions are used as glyph parameters (see below), the callback is called for each
lib/Bio/Graphics/Glyph/decorated_transcript.pm view on Meta::CPAN
-end => $nt_end,
-score => $score,
-desc => $desc,
-seq_id => $feature->seq_id,
-strand => $feature->strand,
-attributes => { # remember protein coordinates for callbacks
'p_start' => $p_start,
'p_end' => $p_end
}
);
lib/Bio/Graphics/Glyph/decorated_transcript.pm view on Meta::CPAN
End coordinate at the protein-level
=item 5. score
Optional. Score associated with a decoration (e.g. Pfam E-value). This score can be used
to dynamically filter or color decorations via callbacks (see glyph options).
=item 6. description
Optional. User-defined description of decoration. The glyph ignores this description,
but it will be made available to callback functions for inspection. Special characters
view all matches for this distribution
view release on metacpan or search on metacpan
eg/testit.pl view on Meta::CPAN
my $type = $feature->primary_tag;
$type eq 'group' ? 'dashed'
: $type eq 'transcript' ? 'hat'
: $type eq 'alignment' ? 'solid'
: undef},
-all_callbacks => 1,
-connector_color => 'black',
-height => 10,
-bump => 1,
-linewidth=>2,
# -tkcolor => $colors[rand @colors],
eg/testit.pl view on Meta::CPAN
-orient => 'N',
-height => 8,
-base => 1,
-relative_coords => 1,
-tick => 2,
-all_callbacks => 1,
-bgcolor => 'red',
-key => 'Dynamically Added');
$track->add_feature($bigone,$zed_27,$abc3);
$track->add_group($predicted_exon1,$predicted_exon2,$confirmed_exon3);
view all matches for this distribution
view release on metacpan or search on metacpan
contrib/roary_plots/roary_files/MathJax.js view on Meta::CPAN
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
if(document.getElementById&&document.childNodes&&document.createElement){if(!(window.MathJax&&MathJax.Hub)){if(window.MathJax){window.MathJax={AuthorConfig:window.MathJax}}else{window.MathJax={}}MathJax.isPacked=true;MathJax.version="2.5";MathJax.fil...
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/DB/Bam/Pileup.pm view on Meta::CPAN
Bio::DB::Bam::Pileup -- Object passed to pileup() callback
=head1 SYNOPSIS
See L<Bio::DB::Sam/The generic fetch() and pileup() methods> for how
this object is passed to pileup callbacks.
=head1 DESCRIPTION
A Bio::DB::Bam::Pileup object (or a Bio::DB::Bam::PileupWrapper
object) is passed to the callback passed to the Bio::DB::Sam->pileup()
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/ToolBox/db_helper/alignment_callbacks.pm view on Meta::CPAN
package Bio::ToolBox::db_helper::alignment_callbacks;
use warnings;
use strict;
use Carp;
use Bio::ToolBox::db_helper::constants;
lib/Bio/ToolBox/db_helper/alignment_callbacks.pm view on Meta::CPAN
# passed parameters as array ref
# chromosome, start, stop, strand, strandedness, method, value, db, dataset
my $param = shift;
# check the current list of calculated callbacks
# cache the calculated callback method to speed up subsequent data
# collections it's likely only one method is ever employed in an
# execution, but just in case we will cache all that we calculate
my $string = sprintf "%s_%s_%s_%d", $param->[STND], $param->[STR],
$param->[METH], $param->[RETT];
lib/Bio/ToolBox/db_helper/alignment_callbacks.pm view on Meta::CPAN
__END__
=head1 NAME
Bio::ToolBox::db_helper::alignment_callbacks
=head1 DESCRIPTION
This module provides common callback subroutines for working with bam alignments.
It is generalized and may be used with either L<Bio::DB::Sam> or L<Bio::DB::HTS>
view all matches for this distribution
view release on metacpan or search on metacpan
Bio/Event/EventHandlerI.pm view on Meta::CPAN
Title : start_document
Usage : $resultObj = $parser->start_document();
Function: Receive notification of the beginning of a document (the
input file of a parser). The parser will invoke this method
only once, before any other event callbacks.
Usually, a handler will reset any internal state structures
when this method is called.
Returns : none
view all matches for this distribution