view release on metacpan or search on metacpan
lib/A1z/HTML5/Template.pm view on Meta::CPAN
$out .= qq{\t<h3>$h1</h3>\n\t<div>$div</div>\n} if $line;
}
elsif ($output_format eq 'menu')
{
# the first item will be used as link title and name
# the second item will be used as the actual link
# no extensions added automatically by the script
# an id for each link/li is also provided in case, may be it is not needed
# Remove items with a # in the beginning; Sat Feb 21 18:48:19 2015
next if ($h1 =~ /^#http/ or $div =~ /^#http/);
lib/A1z/HTML5/Template.pm view on Meta::CPAN
$h->start_html('DifferentCharset');
=head2 body_js_css
Add/include javascript and css files just above </body> section
Typically, CSS files should/are not be used here.
Default behavior:
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
my $name = shift;
my $features = ( $self->{values}->{features} ||= [] );
my $mods;
if ( @_ == 1 and ref( $_[0] ) ) {
# The user used ->feature like ->features by passing in the second
# argument as a reference. Accomodate for that.
$mods = $_[0];
} else {
$mods = \@_;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AAC/Pvoice/Input.pm view on Meta::CPAN
This constructor takes the window (AAC::Pvoice::Panel typically) on which
the events and timer will be called as a parameter.
If the configuration (read using Wx::ConfigBase::Get) has a key called
'Device' (which can be set to 'icon', 'keys' , 'mouse' or 'adremo') is set to 'adremo', it
will start polling the parallel port every x milliseconds, where x is the
value of the configuration key 'Interval'. This setting is only useful if you connect
an "Adremo" electrical wheelchair to the parallel port of your PC (for more
information see http://www.adremo.nl).
If the key 'Device' is set to 'icon' it will respond to the left and right
mouse button, and if it's set to 'keys' it will respond to the configuration
lib/AAC/Pvoice/Input.pm view on Meta::CPAN
and 'next' events respectively.
AAC::Pvoice::Input has the ability to operate with either one or two buttons.
If you want to use only one button, you need to set the configuration key "Buttons"
to 1, and it will automatically invoke the subroutine you pass to Next()
at an interval of the value set in the configuration key OneButtonInterval (set in milliseconds).
The default for is to operate in two button mode, and if OneButtonInterval is not
set, it will use a default of 2000 milliseconds if "Buttons" is set to 1.
=head2 newchild($window)
This semi-constructor takes the window (usually a child of the panel you
passed to the new() constructor, on which the events will be called as a parameter.
lib/AAC/Pvoice/Input.pm view on Meta::CPAN
This method is used to setup a button for normal mouse input (when
configuration key 'Device' is set to 'mouse'). It takes the wxWindow
(typically a Wx::BitmapButton) that should respond to this way of
input as the first parameter.
$subgetfocus is the coderef that should be invoked when the mousecursor
hovers over this $window (EVT_ENTER).
$subup is the coderef that should be invoked when the left mousebutton
is released (EVT_LEFT_UP).
$sublosefocus is the coderef that should be invoked when the $window
loses focus (EVT_LEAVE).
lib/AAC/Pvoice/Input.pm view on Meta::CPAN
This method will pause ($bool is set to 1) or restart ($bool is set to 0)
the timer that monitors the parallel port.
=head2 StartAutoscan
This method will start the timer that invokes the Next() event every n milliseconds.
=head2 QuitAutoscan
This method will stop the timer that invokes the Next() method.
view all matches for this distribution
view release on metacpan or search on metacpan
$self->{_sample} = "";
$self->{A} = [];
$self->{T} = [];
$self->{G} = [];
$self->{C} = [];
$self->{_basecalls} = [];
$self->{_basecalls_corrected} = [];
$self->{_trace_length} = 0;
$self->{_seq_length} = 0;
$self->{_seq_length_corrected} = 0;
$self->{_abs_index} = 26;
$self->{_index} = undef;
my $buf;
my $length = $self->{_seq_length} * 2;
my $fh = $self->{_fh};
seek( $fh, $self->{PLOC}, 0 );
read( $fh, $buf, $length );
@{ $self->{_basecalls} } = unpack( "n" x $length, $buf );
# print "@{$self->{_basecalls}}" , "\n";
}
sub _set_corrected_base_calls {
my $self = shift;
my $buf;
my $length = $self->{_seq_length_corrected} * 2;
my $fh = $self->{_fh};
seek( $fh, $self->{PLOC1}, 0 );
read( $fh, $buf, $length );
@{ $self->{_basecalls_corrected} } = unpack( "n" x $length, $buf );
}
sub _set_seq {
my $self = shift;
my $buf;
=head2 get_base_calls()
Title : get_base_calls()
Usage : my @base_calls = $abi->get_base_calls();
Function : Returns the called bases by the base caller. This method will return the unedited
original basecalls created by the basecaller.
Args : Nothing
Returns : An array
=cut
sub get_base_calls {
my $self = shift;
return @{ $self->{_basecalls} };
}
=head2 get_corrected_base_calls()
Title : get_corrected_base_calls()
=cut
sub get_corrected_base_calls {
my $self = shift;
return @{ $self->{_basecalls_corrected} };
}
=head2 get_sample_name()
Title : get_sample_name()
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AC/ISOTime.pm view on Meta::CPAN
$time ||= '00:00:00Z';
my($year, $mon, $day) = $date =~ /(\d{4})-?(\d{2})-?(\d{2})?/;
$day ||= 1; # day is optional
($time, my $tz) = $time =~ /([^-+Z]+)(.*)/;
my($hr, $min, $sec) = $time =~ /(\d{2}):?(\d{2}):?(.*)/;
($sec, my $frac) = $sec =~ /(\d+)(\.\d+)?/;
my($tzsign, $tzhr, $tzmin) = $tz =~ /(-?)(\d{2}):?(\d{2})?/;
$tzmin ||= 0;
$tzhr = $tzmin = 0 if $tz eq 'Z';
my $t = timegm($sec,$min,$hr, $day, $mon-1, $year);
$t += $frac;
$t -= (3600 * $tzhr + 60 * $tzmin) * ($tzsign ? -1 : 1);
return $t;
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AC/MrGamoo.pm view on Meta::CPAN
specifies 2 on the east coast, and 2 on the west coast.
seedpeer 192.168.10.11:3503
seedpeer 192.168.10.12:3503
=item secret
specify a secret key used to encrypt data transfered between
systems in different datacenters.
secret squeamish-ossifrage
=item syslog
specify a syslog facility for log messages.
lib/AC/MrGamoo.pm view on Meta::CPAN
basedir /home/data
=item debug
enable debugging for a particular section
debug job
=back
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AC/Yenta.pm view on Meta::CPAN
specifies 2 on the east coast, and 2 on the west coast.
seedpeer 192.168.10.11:3503
seedpeer 192.168.10.12:3503
=item secret
specify a secret key used to encrypt data transfered between
yentas in different datacenters.
secret squeamish-ossifrage
=item syslog
specify a syslog facility for log messages.
syslog local5
=item debug
enable debugging for a particular section
debug map
=item map
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ACH/Generator.pm view on Meta::CPAN
my $data = "";
# Iterate through the ACH Data
foreach my $item (@{$self->{_achData}}) { # Array of ACH file Sections
my @achSections = map { defined $_ ? $_ : '' } @{$item};
my $sectionValue = 0;
for (my $y=0; $y < @achSections; $y++) { # Array of ACH file Section data
my %hash = map { defined $_ ? $_ : '' } %{$achSections[$y]};
# Use the appropriate file Format size for the appropriate ACH file section
foreach my $hashItem (keys (%hash)) { # Hash containing the ACH field name and value
chomp $hash{$hashItem};
my $dataValue = "";
# Get the section header in the first field, else get the data
if ($y == 0) { $dataValue = $sectionValue = $hash{$hashItem}; }
else {
# Get the field length and data
my $field = ${$self->{_achFormats}{$sectionValue}}[$y];
my ($field_length); while ( my ($key, $value) = each(%$field) ) { $field_length = $value; }
$dataValue = substr($hash{$hashItem}, 0, $field_length);
}
# Store the data in the file data variable
view all matches for this distribution
view release on metacpan or search on metacpan
# Print all data from the ACH object
sub printAllData {
my $self = shift;
foreach my $item (@{$self->{_achData}}) { # Array of ACH file Sections
my @achSections = map { defined $_ ? $_ : '' } @{$item};
foreach my $section (@achSections) { # Array of ACH file Section data
my %hash = map { defined $_ ? $_ : '' } %{$section};
foreach my $hashItem (keys (%hash)) { # Hash containing the ACH field name and value
print "$hashItem: $hash{$hashItem}\n";
}
}
}
view all matches for this distribution
view release on metacpan or search on metacpan
t/01-functional.t view on Meta::CPAN
due => '2026-10-01',
);
my $id2 = add_item($plan, 'Publish a book', list => 'Work', tags => ['writing']);
is($id1, 1, 'first id');
is($id2, 2, 'second id');
my $item = get_item($plan, $id1);
is($item->{status}, 'todo', 'default status');
is($item->{list}, 'Health', 'list stored');
view all matches for this distribution
view release on metacpan or search on metacpan
t/00-report-prereqs.t view on Meta::CPAN
my @full_reports;
my @dep_errors;
my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs;
# Add static includes into a fake section
for my $mod (@include) {
$req_hash->{other}{modules}{$mod} = 0;
}
for my $phase ( qw(configure build test runtime develop other) ) {
view all matches for this distribution
view release on metacpan or search on metacpan
t/00-report-prereqs.t view on Meta::CPAN
my @full_reports;
my @dep_errors;
my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs;
# Add static includes into a fake section
for my $mod (@include) {
$req_hash->{other}{modules}{$mod} = 0;
}
for my $phase ( qw(configure build test runtime develop other) ) {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ACME/MBHall.pm view on Meta::CPAN
my $foo = ACME::MBHall->new();
...
=head1 EXPORT
A list of functions that can be exported. You can delete this section
if you don't export anything, such as for a purely object-oriented module.
=head1 SUBROUTINES/METHODS
=head2 sum( LIST_OF_NUMBERS )
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ACME/MyFirstModule/SETHS.pm view on Meta::CPAN
my $foo = ACME::MyFirstModule::SETHS->new();
...
=head1 EXPORT
A list of functions that can be exported. You can delete this section
if you don't export anything, such as for a purely object-oriented module.
=head1 SUBROUTINES/METHODS
=head2 function1
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ACME/YAPC/NA/2012.pm view on Meta::CPAN
my $foo = ACME::YAPC::NA::2012->new();
...
=head1 EXPORT
A list of functions that can be exported. You can delete this section
if you don't export anything, such as for a purely object-oriented module.
=head1 SUBROUTINES/METHODS
=head2 function1
view all matches for this distribution
view release on metacpan or search on metacpan
lib/ACME/ltharris.pm view on Meta::CPAN
my $foo = ACME::ltharris->new();
...
=head1 EXPORT
A list of functions that can be exported. You can delete this section
if you don't export anything, such as for a purely object-oriented module.
=head1 SUBROUTINES/METHODS
=head2 function1
view all matches for this distribution
view release on metacpan or search on metacpan
inc/Module/Install/Metadata.pm view on Meta::CPAN
my $name = shift;
my $features = ( $self->{values}->{features} ||= [] );
my $mods;
if ( @_ == 1 and ref( $_[0] ) ) {
# The user used ->feature like ->features by passing in the second
# argument as a reference. Accomodate for that.
$mods = $_[0];
} else {
$mods = \@_;
}
view all matches for this distribution
view release on metacpan or search on metacpan
examples/port-probe-multi.pl view on Meta::CPAN
sub usage {
print <<"USAGE";
Probe tcp connection to several hosts at once
Usage: $0 [ options ] host:port host:port ...
Options may include:
--timeout <seconds> - may be fractional as well
--help - this message
USAGE
exit 1;
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AES128.pm view on Meta::CPAN
=head1 SYNOPSIS
# ------------------------ simple version ----------------------------------
use AES128 qw/:all/;
my $plain_text = "There's more than one way to do it.";
my $key = "my secret aes key.";
my $encrypted = AES128_CTR_encrypt($plain_text, $key);
my $plain = AES128_CTR_decrypt($encrypted, $key);
# ------------ server/client key exchange -----------------------------------
use MicroECC;
use AES128 qw/:all/;
use Digest::SHA qw/sha256/;
my $curve = MicroECC::secp256r1();
my ($server_pubkey, $server_privkey) = MicroECC::make_key($curve);
# Generate shared secret with client public key.
my $shared_secret = MicroECC::shared_secret($client_pubkey, $server_privkey);
my $key = sha256($shared_secret);
my $plain_text = "There's more than one way to do it.";
my $encrypted = AES128_CTR_encrypt($plain_text, $key);
my $plain = AES128_CTR_decrypt($encrypted, $key);
=head1 DESCRIPTION
Perl wrapper for the tiny-AES-c library (https://github.com/kokke/tiny-AES-c)
Since 128bit key length is secure enough for most applications and ECB is NOT secure,
this module supports 128bit key length and CTR mode only.
=head2 EXPORT
None by default.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AFS/Command/FS.pm view on Meta::CPAN
while ( defined($_ = $self->{handle}->getline()) ) {
chomp;
if ( /The current down server probe interval is (\d+) secs/ ) {
$result->_setAttribute( interval => $1 );
}
if ( /These servers are still down:/ ) {
while ( defined($_ = $self->{handle}->getline()) ) {
view all matches for this distribution
view release on metacpan or search on metacpan
examples/Meltdown.pl view on Meta::CPAN
# field format expansion
# August 2004 - SLAC - modified to use the Perl rxdebu function
#
# Aug 30, 2006 - Jeff Blaine - Added CSV stats output mode
#
# Parameters are -s <server> -p <port> -t <sleeptime in seconds>
# and -C to enable CSV-output mode
#
# Example:
# Meltdown.pl -s point -p 7000 -t 300
#
examples/Meltdown.pl view on Meta::CPAN
print STDERR "\n\n$progName: collect rxdebug stats on AFS process.\n";
print STDERR "usage: $progName [options]\n";
print STDERR "options:\n";
print STDERR " -s <server> (required parameter, no default).\n";
print STDERR " -p <port> (default: 7000).\n";
print STDERR " -t <interval> (default: 1200 seconds).\n";
print STDERR " -C \n";
print STDERR " -h (help: show this help message).\n\n";
print STDERR "Example: $progName -s point -p 7000\n";
print STDERR "Collect statistics on server point for port 7000\n";
print STDERR "Refresh interval will default to 20 minutes (1200 seconds)\n\n";
exit 0;
} # Usage
sub Check_data {
#
examples/Meltdown.pl view on Meta::CPAN
#
if ($server eq "") {
&Usage();
}
else {
print "\nServer: $server, Port: $port, Interval $delay seconds\n";
system date;
}
#
# clear the counters for the first run
examples/Meltdown.pl view on Meta::CPAN
}
#
# snag the current time
#
($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isDST) = localtime();
#
# fire the command and collect the stats
#
examples/Meltdown.pl view on Meta::CPAN
if ($csvmode != 1) {
#
# output the timestamp and current results
#
printf "%2.2d:%2.2d:%2.2d ", $hour,$min,$sec;
printf "%-$Ln[0].0f %-$Ln[1].0f %-$Ln[2].0f %-$Ln[3].0f ",
$wproc,$nobuf,$wpack,$fpack;
printf "%-$Ln[4].0f %-$Ln[5].0f %-$Ln[6].0f %-$Ln[7].0f %-$Ln[8].0f\n",
$calls,$delta,$data,$resend,$idle;
} else { # must be csv mode then...
printf "%2.2d:%2.2d:%2.2d,", $hour,$min,$sec;
printf "$wproc,$nobuf,$wpack,$fpack";
printf "$calls,$delta,$data,$resend,$idle\n";
}
#
view all matches for this distribution
view release on metacpan or search on metacpan
Written by Russ Allbery <rra@cpan.org>
Copyright 2013, 2014 The Board of Trustees of the Leland Stanford Junior
University. This software is distributed under a BSD-style license.
Please see the section LICENSE below for more information.
BLURB
AFS::PAG provides the standard PAG and token manipulation functions
setpag and unlog to Perl programs as a native module. It also provides
view all matches for this distribution
view release on metacpan or search on metacpan
src/PTS/PTS.pm view on Meta::CPAN
$VERSION = 'v2.6.4';
sub new {
# this whole construct is to please the old version from Roland
if ($_[0] =~ /AFS::PTS/) { my $class = shift; }
my $sec = shift;
my $cell = shift;
my @args = ();
push @args, $sec if defined $sec;
push @args, $cell if defined $cell;
AFS::PTS::_new('AFS::PTS', @args);
}
sub DESTROY {
view all matches for this distribution
view release on metacpan or search on metacpan
example/lava_lamp.pl view on Meta::CPAN
=back
=cut
# ===========================================================================
# Configuration section
# Configuration required for accessing the switch.
my $SWITCH_CONFIG =
{
# AVM AHA Host for controlling the devices
example/lava_lamp.pl view on Meta::CPAN
# Name of AVM AHA switch
id => "Lava Lamp"
};
# Time how long the lamp should be at least be kept switched off (seconds)
my $LAMP_REST_TIME = 60 * 60;
# Maximum time a lamp can be on
my $LAMP_MAX_TIME = 5 * 60 * 60; # 5 hours
example/lava_lamp.pl view on Meta::CPAN
my $LOG_FILE = "/var/log/lamp.log";
# Stop file, when, if exists, keeps the lamp off
my $OFF_FILE = "/tmp/lamp_off";
# Time back in passed assumed when switching was done manually (seconds)
# I.e. if a manual state change is detected, it is assumed that it was back
# that amount of seconds in the past (5 minutes here)
my $MANUAL_DELTA = 5 * 60;
# Maximum number of history entries to store
my $MAX_HISTORY_ENTRIES = 1000;
example/lava_lamp.pl view on Meta::CPAN
if (!$last_hist || $last_hist->[0] < $rest_time) {
$lamp->on();
update_status($status,1,$mode,time,$opts{label});
} else {
info("Lamp not switched on because the lamp was switched off just before ",
time - $last_hist->[0]," seconds");
}
} else {
# Notification received offtime, remember to switch on the lamp
# when in time
info("Notification received in an off-period: type = ",$type," | ",$opts{label});
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AI/ANN.pm view on Meta::CPAN
ANN::new(input_count => $inputcount, data => [{ iamanoutput => 0, inputs => {$inputid => $weight, ...}, neurons => {$neuronid => $weight}}, ...])
input_count is number of inputs.
data is an arrayref of neuron definitions.
The first neuron with iamanoutput=1 is output 0. The second is output 1.
I hope you're seeing the pattern...
minvalue is the minimum value a neuron can pass. Default 0.
maxvalue is the maximum value a neuron can pass. Default 1.
afunc is a reference to the activation function. It should be simple and fast.
The activation function is processed /after/ minvalue and maxvalue.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AI/Anthropic.pm view on Meta::CPAN
my $claude = AI::Anthropic->new(
api_key => 'your-api-key', # required (or use ANTHROPIC_API_KEY env)
model => 'claude-sonnet-4-20250514', # optional
max_tokens => 4096, # optional
timeout => 120, # optional, seconds
);
=cut
sub new {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AI/CBR/Sim.pm view on Meta::CPAN
=head2 sim_set
Works for sets/lists of textual values.
Suitable when you are interested into overlap of the two sets.
Arguments are two array references with textual values.
Returns the number of elements in the intersection
divided by the number of elements in the union.
No third argument.
sim_set([qw/a b c/], [qw/b c d/]); # returns 0.5
sim_set([qw/a b c/], [qw/c/]); # returns 0.33
lib/AI/CBR/Sim.pm view on Meta::CPAN
my ($a, $b) = @_;
return 1 if int @$a == 0 && int @$b == 0;
return 0 unless int @$a && int @$b;
my %a = map { ($_ => 1) } @$a;
my $union = int keys %a;
my $intersection = 0;
map {
$a{$_} ? $intersection++ : $union++
} @$b;
return $intersection / $union;
}
=head1 SEE ALSO
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AI/Calibrate.pm view on Meta::CPAN
Calibrate returns a reference to an ordered list of references:
[ [score, prob], [score, prob], [score, prob] ... ]
Scores will be in descending numerical order. See the DESCRIPTION section for
how this structure is interpreted. You can pass this structure to the
B<score_prob> function, along with a new score, to get a probability.
=cut
lib/AI/Calibrate.pm view on Meta::CPAN
values. It continues this process of averaging and replacement until the
entire sequence is monotonically decreasing. The result is a sequence of
instances, each of which has a score and an associated probability estimate,
which can then be used to map scores into probability estimates.
For further information on the PAV algorithm, you can read the section in my
paper referenced below.
=head1 EXPORT
This module exports three functions: calibrate, score_prob and print_mapping.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/AI/Categorizer.pm view on Meta::CPAN
For the usage details, please see the documentation of each individual
module.
=head1 FRAMEWORK COMPONENTS
This section explains the major pieces of the C<AI::Categorizer>
object framework. We give a conceptual overview, but don't get into
any of the details about interfaces or usage. See the documentation
for the individual classes for more details.
A diagram of the various classes in the framework can be seen in
lib/AI/Categorizer.pm view on Meta::CPAN
Deciding which features are the most important is a very large part of
the categorization task - you cannot simply consider all the words in
all the documents when training, and all the words in the document
being categorized. There are two main reasons for this - first, it
would mean that your training and categorizing processes would take
forever and use tons of memory, and second, the significant stuff of
the documents would get lost in the "noise" of the insignificant stuff.
The process of selecting the most important features in the training
set is called "feature selection". It is managed by the
C<AI::Categorizer::KnowledgeSet> class, and you will find the details
view all matches for this distribution