Result:
found more than 329 distributions - search limited to the first 2001 files matching your query ( run in 1.016 )


Adapter-Async

 view release on metacpan or  search on metacpan

lib/Adapter/Async/OrderedList.pm  view on Meta::CPAN

94
95
96
97
98
99
100
101
102
103
104
105
=item * hidden - no longer visible.
 
 hidden => [1,2,4]
 
=item * selected - this item is now part of an active selection. could be used to block deletes.
 
 selected => [1,4,5,6]
 
=item * highlight - mouse over, cursor, etc.
 
 highlight => 1

lib/Adapter/Async/OrderedList.pm  view on Meta::CPAN

109
110
111
112
113
114
115
116
117
118
=item * activate - some action has been performed.
 
 activate => [1]
 activate => [1,2,5,6,7,8]
 
Multi-activate will typically happen when items have been selected rather than just highlighted.
 
The adapter itself doesn't do much with this.
 
=back

 view all matches for this distribution


AddressBook

 view release on metacpan or  search on metacpan

lib/AddressBook/Config.pm  view on Meta::CPAN

173
174
175
176
177
178
179
180
181
182
183
sub new {
  my $class=shift;
  my %args = @_;
  my $self = {};
  bless ($self,$class);
  my ($parser,$config,$field,$field_name,$attr,$db_type,$db_field_name,$db,$select,$option,$value);
  $self->{config_file} = $args{config_file} || $AddressBook::Config::config_file;
  eval {
    $parser = XML::DOM::Parser->new(ErrorContext=>1,
                                    ParseParamEnt=>1,
                                    ProtocolEncoding=>'UTF-8');

 view all matches for this distribution


Ado

 view release on metacpan or  search on metacpan

lib/Ado/Command/generate/crud.pm  view on Meta::CPAN

340
341
342
343
344
345
346
347
348
349
350
#Used in template <%= $a->{t}%>/list.html.ep
$c->stash('table_class',$table_class);
#content negotiation
my $list = $c->list_for_json(
        [$$args{limit}, $$args{offset}],
        [$table_class->select_range($$args{limit}, $$args{offset})]
    );
return $c->respond_to(
    json => $list,
    html =>{list =>$list}
);

 view all matches for this distribution


Advanced-Config

 view release on metacpan or  search on metacpan

Config.pm  view on Meta::CPAN

306
307
308
309
310
311
312
313
314
315
bless ( $self, $class );
 
# Creating a new object ... (The main section)
my %control;
 
# Initialize what options were selected ...
$control{filename}  = $self->_fix_path ($filename);
$control{read_opts} = get_read_opts ( $read_opts );
$control{get_opts}  = get_get_opts ( $get_opts );
$control{date_opts} = get_date_opts ( $date_opts );

Config.pm  view on Meta::CPAN

3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
}
my $language = $opts->{month_language};
my $type = ( $opts->{use_gmt} ) ? "gmtime" : "localtime";
 
print STDERR "${cmt} The Special Predefined Date Variables ... (in ${language})\n";
print STDERR "${cmt} The format and language used can vary based on the date options selected.\n";
print STDERR "${cmt} Uses ${type} to convert the current timestamp into the other values.\n";
 
set_special_date_vars ( $opts, \%dt );
foreach my $k ( sort keys %dt ) {
   print STDERR "   ${la}$k${ra} ${asgn} $dt{$k}\n";

 view all matches for this distribution


Affix

 view release on metacpan or  search on metacpan

dyncall/Makefile.embedded  view on Meta::CPAN

53
54
55
56
57
58
59
60
61
62
63
  CFLAGS="-isysroot ${IOS_SDKROOT}"\
  CXXFLAGS="-isysroot ${IOS_SDKROOT}"\
  LDFLAGS="-Wl,-syslibroot ${IOS_SDKROOT}"\
  ${MAKE_CMD} all 
ios:
        IOS_SDKROOT="`xcode-select -print-path`/Platforms/iPhone${IOS_PLATFORM}.platform/Developer/SDKs/iPhone${IOS_PLATFORM}${IOS_SDK}.sdk" ${MAKE_CMD} ios-sdkroot
ios-sim:
        IOS_PLATFORM="Simulator" ${MAKE_CMD} ios
ios-os:
        IOS_PLATFORM="OS"        ${MAKE_CMD} ios
# NOTE iOS 6.1 does not support armv6 (has no libs)

 view all matches for this distribution


Agent-TCLI-Package-Net

 view release on metacpan or  search on metacpan

lib/Agent/TCLI/Package/Net/HTTPD.pm  view on Meta::CPAN

240
241
242
243
244
245
246
247
248
249
250
handler: establish_context
help: simple http web server
manual: >
  httpd provides a simple web server that can respond to and log requests.
  By default it responds with a Status code 404 to all requests. One may add
  a select few other status code responses using regular expression pattern
  matching if desired. One cannot change content, only status codes.
  Httpd is useful for network testing situations where the response codes
  are being monitored by the network.
topic: net
usage: httpd spawn port=8080

 view all matches for this distribution


Agent

 view release on metacpan or  search on metacpan

examples/ex.pl  view on Meta::CPAN

65
66
67
68
69
70
71
72
73
74
75
$args{Eval} = '2+2';
unless ($args{'Name'}) { print $usage; exit 1; }
 
if ($logfile) {
        open (LOG, "> $logfile") or die "couldn't open $logfile! $!";
        select LOG;
        $| = 1;
}
 
# then setup and execute the agent:
my $agent = new Agent( %args ) or die "couldn't create agent!";

 view all matches for this distribution


Aion-Format

 view release on metacpan or  search on metacpan

lib/Aion/Format/Html.pm  view on Meta::CPAN

1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
        th                      => _set(qw/table thead tbody tfoot caption/),
        dt                      => _set(qw/dl/),
        dd                      => _set(qw/dl/),
        rt                      => _set(qw/ruby/),
        rp                      => _set(qw/ruby/),
        option          => _set(qw/optgroup select/),
        optgroup        => _set(qw/select/),
);
 
# <tr> закрывает открытые <td> и <th> и <tr>
our %TOP_NEW_TAG = (
        head            => _set(qw/body/),

lib/Aion/Format/Html.pm  view on Meta::CPAN

1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
# Все, кроме запрещённых:
#  applet, script, style, embed, object, param,
#  video, audio, source, track, frame, frameset, iframe, comment
#  html, head, body, title, meta, base, basefont, bgsound, link
#  form, keygen, output, textarea, select, option, optgroup, legend, label, input
#  plaintext, xmp
# А так же удаляет атрибуты начинающиеся на "on", name, for, formaction и др..
my %SAFE_TAG = map {$_=>1} qw/
a
abbr

 view all matches for this distribution


Aion-Query

 view release on metacpan or  search on metacpan

lib/Aion/Query.pm  view on Meta::CPAN

76
77
78
79
80
81
82
83
84
85
86
        }) or die "Connect to db failed";
 
        $base->do($_) for @$conn;
        return $base unless wantarray;
        my ($base_connection_id) = $dsn =~ /^DBI:(mysql|mariadb)/i
                ? $base->selectrow_array("SELECT connection_id()")
                : -1;
        return $base, $base_connection_id;
}
 
# Проверка коннекта и переконнект

lib/Aion/Query.pm  view on Meta::CPAN

256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
my ($query, $columns) = @_;
sql_debug query => $query;
connect_respavn($base, $base_connection_id);
 
my $res = eval {
        if($query =~ /^\s*(select|show|desc(ribe)?)\b/in) {
 
                my $r = @_>1? do {
                        my $sth = $base->prepare($query);
                        $sth->execute;
                        $_[1] = [@{$sth->{NAME}}];
                        my $res = $sth->fetchall_arrayref({});
                        $sth->finish;
                        $res
                }: $base->selectall_arrayref($query, { Slice => {} });
 
                if(defined $r and BQ) {
                        for my $row (@$r) {
                                for my $k (keys %$row) {
                                        $row->{$k} =~ s/°([^\x7F]{1,7})\x7F/chr from_radix($1, 254)/ge if utf8::is_utf8($row->{$k});

lib/Aion/Query.pm  view on Meta::CPAN

453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
my @orders = split /\s*,\s*/, $order;
my @order_direct;
my @order_sel = map { my $x=$_; push @order_direct, $x=~s/\s+(asc|desc)\s*$//ie ? lc $1: "asc"; $x } @orders;
 
my $select = @order_sel==1? $order_sel[0]:
        _check_drv($base, "mysql|mariadb")?
                join("", "concat(", join(",',',", @order_sel), ")"):
                join " || ',' || ", @order_sel
;
 
return $select, 1 if $next eq "";
 
my @next = split /,/, $next;
$next[$#orders] //= "";
@next = map quote($_), @next;
my @op = map { /^a/ ? ">": "<" } @order_direct;

lib/Aion/Query.pm  view on Meta::CPAN

485
486
487
488
489
490
491
492
493
494
495
                }
                push @whr, join " AND ", @opr;
        }
        my $where = join "\nOR ", map "$_", @whr;
 
        return $select, "($where)", \@order_sel;
}
 
# Устанавливает или возвращает ключ из таблицы settings
sub settings($;$) {
        my ($id, $value) = @_;

lib/Aion/Query.pm  view on Meta::CPAN

983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
Creates a page request condition not by offset, but by B<cursor pagination>.
 
To do this, it receives C<$order> of the SQL query and C<$next> - a link to the next page.
 
        my ($select, $where, $order_sel) = make_query_for_order "name DESC, id ASC", undef;
         
        $select     # => name || ',' || id
        $where      # -> 1
        $order_sel  # -> undef
         
        my @rows = query "SELECT $select as next FROM author WHERE $where LIMIT 2";
         
        my $last = pop @rows;
         
        ($select, $where, $order_sel) = make_query_for_order "name DESC, id ASC", $last->{next};
        $select     # => name || ',' || id
        $where      # => (name < 'Pushkin A.'\nOR name = 'Pushkin A.' AND id >= '2')
        $order_sel  # --> [qw/name id/]
 
See also:

 view all matches for this distribution


Aion-Telemetry

 view release on metacpan or  search on metacpan

lib/Aion/Telemetry.pm  view on Meta::CPAN

127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
Creates a reference point.
 
        my $reper1 = refmark "main";
         
        select(undef, undef, undef, .05);
         
        my $reper2 = refmark "reper2";
        select(undef, undef, undef, .2);
        undef $reper2;
         
        select(undef, undef, undef, .05);
         
        my $reper3 = refmark "reper2";
        select(undef, undef, undef, .1);
        undef $reper3;
         
        select(undef, undef, undef, .1);
         
        undef $reper1;
         
        # report:
        sub round ($) { int($_[0]*10 + .5) / 10 }

 view all matches for this distribution


Album

 view release on metacpan or  search on metacpan

lib/Album/Tutorial.pm  view on Meta::CPAN

371
372
373
374
375
376
377
378
379
380
381
'200405171843310052.jpg'. 'album' tries to link to the image, if that
is not possible, the image will be coped. File 'dsc00053.jpg' must be
rotated, so it will always be a copy.
 
If you hover the mouse over the file name in the index page, or over
the title on the image pages, a pop-up will show a selection of
information from the EXIF data.
 
=head2 Embedding other albums
 
In the file 'info.dat' you can also enter names of HTML documents to

 view all matches for this distribution


Algorithm-AM

 view release on metacpan or  search on metacpan

lib/Algorithm/AM/Batch.pm  view on Meta::CPAN

234
235
236
237
238
239
240
241
242
243
244
if(!$self->training_item_hook &&
        ($self->probability == 1) &&
        $max >= $self->training_set->size){
    $training_set = $self->training_set;
}else{
    # otherwise, make a new set with just the selected
    # items
    $training_set = Algorithm::AM::DataSet->new(
        cardinality => $self->training_set->cardinality);
 
    # don't try to add more items than we have!

 view all matches for this distribution


Algorithm-Bitonic-Sort

 view release on metacpan or  search on metacpan

lib/Algorithm/Bitonic/Sort.pm  view on Meta::CPAN

63
64
65
66
67
68
69
70
71
72
=head1 SUBROUTINES
 
=head2 bitonic_sort
 
The First Parameter works as the ascending/decreasing selector.
True (1 or any true value) means ascending (incremental),
False (0 or any false value) means decreasing.
 
All other params will be treated as members/items to be sorted.

 view all matches for this distribution


Algorithm-BreakOverlappingRectangles

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
ck_retarget|||
ck_return|||
ck_rfun|||
ck_rvconst|||
ck_sassign|||
ck_select|||
ck_shift|||
ck_sort|||
ck_spair|||
ck_split|||
ck_subr|||

 view all matches for this distribution


Algorithm-CP-IZ

 view release on metacpan or  search on metacpan

lib/Algorithm/CP/IZ.pm  view on Meta::CPAN

26
27
28
29
30
31
32
33
34
35
36
# Do not simply export all your public functions/methods/constants.
 
# This allows declaration       use Algorithm::CP::IZ ':all';
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
# will save memory.
our %EXPORT_TAGS = ( 'value_selector' => [ qw(
    CS_VALUE_SELECTOR_MIN_TO_MAX
    CS_VALUE_SELECTOR_MAX_TO_MIN
    CS_VALUE_SELECTOR_LOWER_AND_UPPER
    CS_VALUE_SELECTOR_UPPER_AND_LOWER
    CS_VALUE_SELECTOR_MEDIAN_AND_REST

lib/Algorithm/CP/IZ.pm  view on Meta::CPAN

40
41
42
43
44
45
46
47
48
49
50
    CS_VALUE_SELECTION_LT
    CS_VALUE_SELECTION_GE
    CS_VALUE_SELECTION_GT
) ]);
 
our @EXPORT_OK = ( @{ $EXPORT_TAGS{'value_selector'} } );
 
our $VERSION = '0.07';
 
sub AUTOLOAD {
    # This AUTOLOAD is used to 'autoload' constants from the constant()

lib/Algorithm/CP/IZ.pm  view on Meta::CPAN

414
415
416
417
418
419
420
421
422
423
424
my $array = [map { $$_ } @$var_array];
my $max_fail = -1;
my $find_free_var_id = 0;
my $find_free_var_func = sub { die "search: Internal error"; };
my $criteria_func;
my $value_selectors;
my $max_fail_func;
my $ngs;
my $notify;
 
if ($params->{FindFreeVar}) {

lib/Algorithm/CP/IZ.pm  view on Meta::CPAN

442
443
444
445
446
447
448
449
450
451
452
if ($params->{MaxFail}) {
    $max_fail = int($params->{MaxFail});
}
 
if ($params->{ValueSelectors}) {
    $value_selectors = $params->{ValueSelectors};
}
 
if ($params->{MaxFailFunc}) {
    $max_fail_func = $params->{MaxFailFunc};
}

lib/Algorithm/CP/IZ.pm  view on Meta::CPAN

462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
    }
 
    $notify->set_var_array($var_array);
}
 
my $is_search35 = $value_selectors || $max_fail_func || $ngs || $notify;
 
if ($is_search35) {
    unless ($value_selectors) {
        if ($criteria_func) {
            $Algorithm::CP::IZ::CriteriaValueSelector::CriteriaFunction = $criteria_func;
             
            $value_selectors = [
                map {
                    $self->create_value_selector_simple("Algorithm::CP::IZ::CriteriaValueSelector")
                } (0..scalar(@$var_array)-1)];
        }
        else {
            $value_selectors = [
                map {
                    $self->get_value_selector(&CS_VALUE_SELECTOR_MIN_TO_MAX)
                } (0..scalar(@$var_array)-1)];
        }
    }
     
    my $i = 0;
    for my $v (@$array) {
        my $vs = $value_selectors->[$i];
        $vs->prepare($i);
        $i++;
    }
 
    if ($max_fail_func) {
        return Algorithm::CP::IZ::cs_searchValueSelectorRestartNG(
            $array,
            $value_selectors,
            $find_free_var_id,
            $find_free_var_func,
            $max_fail_func,
            $max_fail,
            defined($ngs) ? $ngs->{_ngs} : 0,
            defined($notify) ? $notify->{_ptr} : 0);
    }
    else {
        return Algorithm::CP::IZ::cs_searchValueSelectorFail(
            $array,
            $value_selectors,
            $find_free_var_id,
            $find_free_var_func,
            $max_fail,
            defined($notify) ? $notify->{_ptr} : 0);
    }

lib/Algorithm/CP/IZ.pm  view on Meta::CPAN

691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
    # not supported
    return;
}
 
sub get_value_selector {
    my $self = shift;
    my $id = shift;
 
    return Algorithm::CP::IZ::ValueSelector::IZ->new($self, $id);
}
 
sub create_value_selector_simple {
    my $self = shift;
    my $id = shift;
 
    return Algorithm::CP::IZ::ValueSelector::Simple->new($self, $id);
}

lib/Algorithm/CP/IZ.pm  view on Meta::CPAN

1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
=over 2
 
=item FindFreeVar
 
FindFreeVar specifies variable selection strategy.
Choose constants from Algorithm::CP::IZ::FindFreeVar or specify your own
function as coderef here.
 
Most simple function will be following. (select from first)
 
    sub simple_find_free_var{
        my $array = shift; # VARIABLES is in parameter
        my $n = scalar @$array;

lib/Algorithm/CP/IZ.pm  view on Meta::CPAN

1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
        return -1; # no free variable
    };
 
=item Criteria
 
Criteria specifies value selection strategy.
Specify your own function as coderef here.
 
    sub sample_criteria {
      # position in VARIABLES, and candidate value
      my ($index, $val) = @_;

lib/Algorithm/CP/IZ.pm  view on Meta::CPAN

1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
Upper limit of fail count while searching solutions.
 
=item ValueSelectors
 
Arrayref of Algorithm::CP::IZ::ValueSelector instances created via
get_value_selector or create_value_selector_simple method.
 
(If ValueSelector is specified, this parameter is ignored.)
 
=item MaxFailFunc

lib/Algorithm/CP/IZ.pm  view on Meta::CPAN

1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
Specify a notify object receives following notification by search function.
 
    search_start
    search_end
    before_value_selection
    after_value_selection
    enter
    leave
    found
 
if OBJECT is a object, method having notification name will be called.

lib/Algorithm/CP/IZ.pm  view on Meta::CPAN

1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
Returns version string like "3.5.0".
undef will be returned if getVersion() is not supported in iZ-C (old version).
 
 
=item get_value_selector(ID)
 
Get built-in value selector (instance of Algorithm::CP::IZ::ValueSelector) specifed by ID.
ID must be selected from following constants defined in package Algorithm::CP::IZ.
 
=over
 
=item CS_VALUE_SELECTOR_MIN_TO_MAX

lib/Algorithm/CP/IZ.pm  view on Meta::CPAN

1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
=item CS_VALUE_SELECTOR_MEDIAN_AND_REST
 
=back
 
(These values are exported by Algorithm::CP::IZ and can be imported using tag 'value_selector')
 
Returned object will be used as a parameter ValueSelectors when calling "search" method.
 
  use Algorithm::CP::IZ qw(:value_selector);
  my $vs = $iz->get_value_selector(CS_VALUE_SELECTOR_MIN_TO_MAX);
 
  my $v1 = $iz->create_int(1, 9);
  my $v2 = $iz->create_int(1, 9);
  $iz->Add($v1, $v2)->Eq(12);
  my $rc = $iz->search([$v1, $v2], {
      ValueSelectors => [ $vs, $vs ],
  });
 
 
=item create_value_selector_simple(CLASS_NAME)
 
Create user defined value-seelctor defined by class named CLASS_NAME.
This class must have constructor named "new" and method namaed "next".
 
  use Algorithm::CP::IZ qw(:value_selector);
   
  package VSSample1;
  sub new {
    my $class = shift;
    my ($v, $index) = @_;

lib/Algorithm/CP/IZ.pm  view on Meta::CPAN

1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
  }
 
  my $v1 = $iz->create_int(1, 9);
  my $v2 = $iz->create_int(1, 9);
  $iz->Add($v1, $v2)->Eq(12);
  my $vs = $iz->create_value_selector_simple("VSSample1");
  my $rc = $iz->search([$v1, $v2], {
      ValueSelectors => [ $vs, $vs ],
  });
 
=item create_no_good_set(VARIABLES, PRE_FILTER, MAX_NO_GOOD, EXT)

 view all matches for this distribution


Algorithm-CheckDigits

 view release on metacpan or  search on metacpan

lib/Algorithm/CheckDigits.pm  view on Meta::CPAN

584
585
586
587
588
589
590
591
592
593
594
Providing some means to add additional algorithms without the need to change
the module has the benefit that the user of those additional algorithms may
easily use them with the same interface as the other algorithms without having
to wait for a new version, that may or may not include the wanted algorithm.
 
But there is a problem: the user must be able to select the new algorithms
like he did with the other ones. And the catch is: since these new algorithms
are developed independently there is no guarantee that no more than one
module applies for the same handle. I could have implemented some simple
strategies like last one wins (the module that registers last for a given
handle is the one that is choosen) or first one wins (the first registered

 view all matches for this distribution


Algorithm-ClusterPoints

 view release on metacpan or  search on metacpan

example/draw2-1.pl  view on Meta::CPAN

7
8
9
10
11
12
13
14
15
16
17
use List::Util qw(max min);
 
 
select STDERR; $|=1; select STDOUT;
 
# Latitude stats:
# Minimum: 10.318842
# Maximum: 14.124424
# Mean: 11.24719

 view all matches for this distribution


Algorithm-Combinatorics

 view release on metacpan or  search on metacpan

Combinatorics.pm  view on Meta::CPAN

417
418
419
420
421
422
423
424
425
426
This documentation refers to Algorithm::Combinatorics version 0.26.
 
=head1 DESCRIPTION
 
Algorithm::Combinatorics is an efficient generator of combinatorial sequences. Algorithms are selected from the literature (work in progress, see L</REFERENCES>). Iterators do not use recursion, nor stacks, and are written in C.
 
Tuples are generated in lexicographic order, except in C<subsets()>.
 
=head1 SUBROUTINES

 view all matches for this distribution


Algorithm-ConsistentHash-CHash

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
ck_require|||
ck_return|||
ck_rfun|||
ck_rvconst|||
ck_sassign|||
ck_select|||
ck_shift|||
ck_sort|||
ck_spair|||
ck_split|||
ck_subr|||

 view all matches for this distribution


Algorithm-ConstructDFA2

 view release on metacpan or  search on metacpan

lib/Algorithm/ConstructDFA2.pm  view on Meta::CPAN

504
505
506
507
508
509
510
511
512
513
  my $sth = $self->_dbh->prepare(q{
    SELECT state_id FROM State WHERE vertex_str = ?
  });
 
  return $self->_dbh->selectrow_array($sth, {}, $vertex_str);
}
 
sub _find_or_create_state_from_vertex_str {
  my ($self, $vertex_str) = @_;

lib/Algorithm/ConstructDFA2.pm  view on Meta::CPAN

537
538
539
540
541
542
543
544
545
546
my $escaped_roots = join ", ", map {
  $self->_dbh->quote($_)
} @vertices;
 
my ($vertex_str) = $self->_dbh->selectrow_array(qq{
  SELECT _canonical(json_group_array(closure.e_reachable))
  FROM Closure
  WHERE root IN ($escaped_roots)
});

lib/Algorithm/ConstructDFA2.pm  view on Meta::CPAN

557
558
559
560
561
562
563
564
565
566
567
}
 
sub vertices_in_state {
  my ($self, $state_id) = @_;
 
  return map { @$_ } $self->_dbh->selectall_array(q{
    SELECT vertex FROM Configuration WHERE state = ?
  }, {}, $state_id);
}
 
sub cleanup_dead_states {

lib/Algorithm/ConstructDFA2.pm  view on Meta::CPAN

579
580
581
582
583
584
585
586
587
588
589
  SELECT state_id AS state
  FROM State
  WHERE _vertices_accept(vertex_str)+0 = 1
});
 
my @accepting = map { @$_ } $self->_dbh->selectall_array(q{
  SELECT state FROM accepting
});
 
# NOTE: this also renames states in transitions involving
# possible start states, but they would then simply have no

lib/Algorithm/ConstructDFA2.pm  view on Meta::CPAN

648
649
650
651
652
653
654
655
656
657
  ORDER BY
    s.state_id, i.rowid
  LIMIT ?
});
 
my @new = $self->_dbh->selectall_array($sth, {}, $limit);
 
my $find_or_create = memoize(sub {
  _find_or_create_state_from_vertex_str($self, @_);
});

lib/Algorithm/ConstructDFA2.pm  view on Meta::CPAN

678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
}
 
sub transitions_as_3tuples {
  my ($self) = @_;
 
  return $self->_dbh->selectall_array(q{
    SELECT src, input, dst FROM transition
  });
}
 
sub transitions_as_5tuples {
  my ($self) = @_;
 
  return $self->_dbh->selectall_array(q{
    SELECT * FROM view_transitions_as_5tuples
  });
}
 
sub backup_to_file {

 view all matches for this distribution


Algorithm-DecisionTree

 view release on metacpan or  search on metacpan

Examples/evaluate_training_data1.pl  view on Meta::CPAN

6
7
8
9
10
11
12
13
14
15
16
##  contained in the file `stage3cancer.csv'.
 
##  Through the class EvalTrainingData as shown below, this script runs a 10-fold
##  cross-validation test on the training data.  This test divides all of the
##  training data into ten parts, with nine parts used for training a decision tree
##  and one part used for testing its ability to classify correctly. This selection
##  of nine parts for training and one part for testing is carried out in all of the
##  ten different possible ways.
 
##  A script like this can also be used to test the appropriateness of your choices
##  for the constructor parameters entropy_threshold, max_depth_desired, and

 view all matches for this distribution


Algorithm-Dependency-Objects

 view release on metacpan or  search on metacpan

lib/Algorithm/Dependency/Objects.pm  view on Meta::CPAN

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
        my ($class, %params) = @_;
 
        my $objects = $class->_to_set($params{objects}) or
                croak "The 'objects' parameter must be an array reference or a Set::Object";
         
        my $selected = exists($params{selected})
                ? $class->_to_set($params{selected})
                : Set::Object->new()
                        or croak "If provided, the 'selected' parameter must be an array reference or a Set::Object";
         
        # all the contents of the Set::Object must have depends methods
        $class->assert_can_get_deps($objects);
 
        $objects = $class->verify_input_set($objects);
 
        return bless {
                objects  => $objects,
                selected => $selected,
        }, $class;
}
 
sub objects  { (shift)->{objects}  }
sub selected { (shift)->{selected} }
 
sub get_deps {
        my ( $self, $obj ) = @_;
        $obj->depends;
}

lib/Algorithm/Dependency/Objects.pm  view on Meta::CPAN

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
sub depends {
        my ( $self, @objs ) = @_;
 
        my @queue = @objs;
 
        my $selected_now = Set::Object->new;
        my $selected_previously = $self->selected;
 
        my $all_objects = $self->objects;
 
        while (@queue){
                my $obj = shift @queue;
 
                $self->unknown_object($obj) unless $all_objects->contains($obj);
 
                next if $selected_now->contains($obj);
                next if $selected_previously->contains($obj);
 
                push @queue, $self->get_deps($obj);
 
                $selected_now->insert($obj);
        }
 
        $selected_now->remove(@objs);
 
        return wantarray ? $selected_now->members : $selected_now;
}
 
sub verify_input_set {
        my ( $self, $objects ) = @_;

lib/Algorithm/Dependency/Objects.pm  view on Meta::CPAN

125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
sub schedule {
        my ( $self, @desired ) = @_;
 
        my $desired = Set::Object->new(@desired);
 
        my $selected = $self->selected;
 
        my $missing = $desired->difference($selected);
 
        $self->depends(@desired)->union($missing)->members;
}
 
sub schedule_all {
        my $self = shift;
        $self->objects->difference($self->selected)->members;
}
 
__PACKAGE__
 
__END__

lib/Algorithm/Dependency/Objects.pm  view on Meta::CPAN

153
154
155
156
157
158
159
160
161
162
163
 
my $o = Algorithm::Dependency::Objects->new(
        objects => \@objects,
        selected => \@selected, # objects which are already taken care of
);
 
my @needed = $o->schedule( $objects[0] );
 
# need to take care of @needed for $objecs[0] to be resolved

lib/Algorithm/Dependency/Objects.pm  view on Meta::CPAN

175
176
177
178
179
180
181
182
183
184
185
186
187
188
Duh.
 
=item B<objects>
 
=item B<selected>
 
Returns the L<Set::Object> representing this collection. Objects is an
enumeration of all the object who we're dependo-frobnicating, and selected is
those that don't need to be run.
 
=item B<depends>
 
=item B<schedule>

 view all matches for this distribution


Algorithm-Dependency-Source-DBI

 view release on metacpan or  search on metacpan

lib/Algorithm/Dependency/Source/DBI.pm  view on Meta::CPAN

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
   
  # Load the data from a database
  my $data_source = Algorithm::Dependency::Source::DBI->new(
      dbh            => DBI->connect('dbi:SQLite:sqlite.db'),
      select_ids     => 'select name from stuff',
      select_depends => 'select from, to from m2m_deps',
  );
   
  # Create the dependency object, and indicate the items that are already
  # selected/installed/etc in the database
  my $dep = Algorithm::Dependency->new(
      source   => $data_source,
      selected => [ 'This', 'That' ]
  ) or die 'Failed to set up dependency algorithm';
   
  # For the item 'Foo', find out the other things we also have to select.
  # This WON'T include the item we selected, 'Foo'.
  my $also = $dep->depends( 'Foo' );
  print $also
        ? "By selecting 'Foo', you are also selecting the following items: "
                . join( ', ', @$also )
        : "Nothing else to select for 'Foo'";
   
  # Find out the order we need to act on the items in.
  # This WILL include the item we selected, 'Foo'.
  my $schedule = $dep->schedule( 'Foo' );
 
=head1 DESCRIPTION
 
The L<Algorithm::Dependency> module has shown itself to be quite reliable

lib/Algorithm/Dependency/Source/DBI.pm  view on Meta::CPAN

77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
=head2 new
 
  my $simple = Algorithm::Dependency::Source::DBI->new(
      dbh            => $dbi_db_handle,
      select_ids     => 'select name from stuff',
      select_depends => 'select from, to from m2m_deps',
  );
   
  my $complex = Algorithm::Dependency::Source::DBI->new(
      dbh            => $dbi_db_handle,
      select_ids     => [ 'select name from stuff where foo = ?',         'bar' ],
      select_depends => [ 'select from, to from m2m_deps where from = ?', 'bar' ],
  );
 
The C<new> constructor takes three named named params.
 
The C<dbh> param should be a standard L<DBI> database connection.
 
The C<select_ids> param is either a complete SQL string, or a reference to
an C<ARRAY> containing a SQL string with placeholders and matching
variables.
 
When executed on the database, it should return a single column containing
the complete set of all item identifiers.
 
The C<select_depends> param is either a complete SQL string, or a reference
to an C<ARRAY> containing a SQL string with placeholders and matching
variables.
 
When executed on the database, it should return two columns containing
the complete set of all dependencies, where identifiers in the first-column

lib/Algorithm/Dependency/Source/DBI.pm  view on Meta::CPAN

118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
        # Create the object
        my $self = bless { @_ }, $class;
 
        # Apply defaults
        if ( _STRING($self->{select_ids}) ) {
                $self->{select_ids} = [ $self->{select_ids} ];
        }
        if ( _STRING($self->{select_depends}) ) {
                $self->{select_depends} = [ $self->{select_depends} ];
        }
 
        # Check params
        unless ( _INSTANCE($self->dbh, 'DBI::db') ) {
                Carp::croak("The dbh param is not a DBI database handle");
        }
        unless ( _ARRAY($self->select_ids) and _STRING($self->select_ids->[0]) ) {
                Carp::croak("Missing or invalid select_ids param");
        }
        unless ( _ARRAY($self->select_depends) and _STRING($self->select_depends->[0]) ) {
                Carp::croak("Did not provide the select_depends query");
        }
 
        return $self;
}

lib/Algorithm/Dependency/Source/DBI.pm  view on Meta::CPAN

153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
        $_[0]->{dbh};
}
 
=pod
 
=head2 select_ids
 
The C<select_ids> accessor returns the SQL statement provided to the
constructor. If a raw string was provided, it will be returned as a
reference to an C<ARRAY> containing the SQL string and no params.
 
=cut
 
sub select_ids {
        $_[0]->{select_ids};
}
 
=pod
 
=head2 select_depends
 
The C<select_depends> accessor returns the SQL statement provided to
the constructor. If a raw string was provided, it will be returned as
a reference to an C<ARRAY> containing the SQL string and no params.
 
=cut
 
sub select_depends {
        $_[0]->{select_depends};
}

lib/Algorithm/Dependency/Source/DBI.pm  view on Meta::CPAN

190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
sub _load_item_list {
        my $self = shift;
 
        # Get the list of ids
        my $ids  = $self->dbh->selectcol_arrayref(
                $self->select_ids->[0],
                {}, # No options
                @{$self->select_ids}[1..-1],
                );
        my %hash = map { $_ => [ ] } @$ids;
 
        # Get the list of links
        my $depends = $self->dbh->selectall_arrayref(
                $self->select_depends->[0],
                {}, # No options
                @{$self->select_depends}[1..-1],
                );
        foreach my $depend ( @$depends ) {
                next unless $hash{$depend->[0]};
                next unless $hash{$depend->[1]};
                push @{$hash{$depend->[0]}}, $depend->[1];

 view all matches for this distribution


Algorithm-Dependency

 view release on metacpan or  search on metacpan

lib/Algorithm/Dependency.pm  view on Meta::CPAN

19
20
21
22
23
24
25
26
27
28
29
#pod   };
#pod   my $deps_source = Algorithm::Dependency::Source::HoA->new( $deps );
#pod
#pod   my $dep = Algorithm::Dependency::Ordered->new(
#pod     source   => $deps_source,
#pod     selected => [ 'this', 'that' ], # Items we have processed elsewhere or have already satisfied
#pod   )
#pod   or die 'Failed to set up dependency algorithm';
#pod
#pod   my $also = $dep->schedule_all();
#pod   # Returns: ['core', 'a', 'b'] -- ie: installation-order. Whereas using base

lib/Algorithm/Dependency.pm  view on Meta::CPAN

42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pod  
#pod   # Load the data from a simple text file
#pod   my $data_source = Algorithm::Dependency::Source::File->new( 'foo.txt' );
#pod  
#pod   # Create the dependency object, and indicate the items that are already
#pod   # selected/installed/etc in the database
#pod   my $dep = Algorithm::Dependency->new(
#pod       source   => $data_source,
#pod       selected => [ 'This', 'That' ]
#pod   ) or die 'Failed to set up dependency algorithm';
#pod  
#pod   # For the item 'Foo', find out the other things we also have to select.
#pod   # This WON'T include the item we selected, 'Foo'.
#pod   my $also = $dep->depends( 'Foo' );
#pod   print $also
#pod    ? "By selecting 'Foo', you are also selecting the following items: "
#pod            . join( ', ', @$also )
#pod    : "Nothing else to select for 'Foo'";
#pod  
#pod   # Find out the order we need to act on the items in.
#pod   # This WILL include the item we selected, 'Foo'.
#pod   my $schedule = $dep->schedule( 'Foo' );
#pod
#pod =head1 DESCRIPTION
#pod
#pod Algorithm::Dependency is a framework for creating simple read-only

lib/Algorithm/Dependency.pm  view on Meta::CPAN

93
94
95
96
97
98
99
100
101
102
103
104
105
#pod
#pod =for stopwords versioned
#pod
#pod Algorithm::Dependency implements algorithms relating to dependency
#pod hierarchies. To use this framework, all you need is a source for the master
#pod list of all the items, and a list of those already selected. If your
#pod dependency hierarchy doesn't require the concept of items that are already
#pod selected, simply don't pass anything to the constructor for it.
#pod
#pod Please note that the class Algorithm::Dependency does NOT implement an
#pod ordering, for speed and simplicity reasons. That is, the C<schedule> it
#pod provides is not in any particular order. If item 'A' depends on item 'B',
#pod it will not place B before A in the schedule. This makes it unsuitable for

lib/Algorithm/Dependency.pm  view on Meta::CPAN

150
151
152
153
154
155
156
157
158
159
160
161
162
163
#pod The only compulsory option is the source of the dependency items. This is
#pod an object of a subclass of L<Algorithm::Dependency::Source>. In practical terms,
#pod this means you will create the source object before creating the
#pod Algorithm::Dependency object.
#pod
#pod =item selected => [ 'A', 'B', 'C', etc... ]
#pod
#pod The C<selected> option provides a list of those items that have already been
#pod 'selected', acted upon, installed, or whatever. If another item depends on one
#pod in this list, we don't have to include it in the output of the C<schedule> or
#pod C<depends> methods.
#pod
#pod =item ignore_orphans => 1
#pod

lib/Algorithm/Dependency.pm  view on Meta::CPAN

182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
                or return undef;
 
        # Create the object
        my $self = bless {
                source   => $source, # Source object
                selected => {},
                }, $class;
 
        # Were we given the 'ignore_orphans' flag?
        if ( $args{ignore_orphans} ) {
                $self->{ignore_orphans} = 1;
        }
 
        # Done, unless we have been given some selected items
        _ARRAY($args{selected}) or return $self;
 
        # Make sure each of the selected ids exists
        my %selected = ();
        foreach my $id ( @{ $args{selected} } ) {
                # Does the item exist?
                return undef unless $source->item($id);
 
                # Is it a duplicate
                return undef if $selected{$id};
 
                # Add to the selected index
                $selected{$id} = 1;
        }
 
        $self->{selected} = \%selected;
        $self;
}

lib/Algorithm/Dependency.pm  view on Meta::CPAN

230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
sub source { $_[0]->{source} }
 
#pod =pod
#pod
#pod =head2 selected_list
#pod
#pod The C<selected_list> method returns, as a list and in alphabetical order,
#pod the list of the names of the selected items.
#pod
#pod =cut
 
sub selected_list { sort keys %{$_[0]->{selected}} }
 
#pod =pod
#pod
#pod =head2 selected $name
#pod
#pod Given an item name, the C<selected> method will return true if the item is
#pod selected, false is not, or C<undef> if the item does not exist, or an error
#pod occurs.
#pod
#pod =cut
 
sub selected { $_[0]->{selected}->{$_[1]} }
 
#pod =pod
#pod
#pod =head2 item $name
#pod

lib/Algorithm/Dependency.pm  view on Meta::CPAN

278
279
280
281
282
283
284
285
286
287
288
#pod
#pod =head2 depends $name1, ..., $nameN
#pod
#pod Given a list of one or more item names, the C<depends> method will return
#pod a reference to an array containing a list of the names of all the OTHER
#pod items that also have to be selected to meet dependencies.
#pod
#pod That is, if item A depends on B and C then the C<depends> method would
#pod return a reference to an array with B and C. ( C<[ 'B', 'C' ]> )
#pod
#pod If multiple item names are provided, the same applies. The list returned

lib/Algorithm/Dependency.pm  view on Meta::CPAN

309
310
311
312
313
314
315
316
317
318
319
while ( my $id = shift @stack ) {
        # Does the id exist?
        my $Item = $self->{source}->item($id)
        or $self->{ignore_orphans} ? next : return undef;
 
        # Skip if selected or checked
        next if $checked{$id};
 
        # Add its depends to the stack
        push @stack, $Item->depends;
        $checked{$id} = 1;

lib/Algorithm/Dependency.pm  view on Meta::CPAN

323
324
325
326
327
328
329
330
331
332
333
334
                unless ( scalar grep { $id eq $_ } @_ ) {
                        push @depends, $id;
                }
        }
 
        # Remove any items already selected
        my $s = $self->{selected};
        return [ sort grep { ! $s->{$_} } @depends ];
}
 
#pod =pod
#pod

lib/Algorithm/Dependency.pm  view on Meta::CPAN

344
345
346
347
348
349
350
351
352
353
354
#pod dependencies, in the preferred order of action. For the normal algorithm,
#pod where order it not important, this is alphabetical order. This makes it
#pod easier for someone watching a program operate on the items to determine
#pod how far you are through the task and makes any logs easier to read.
#pod
#pod If any of the names you provided in the arguments is already selected, it
#pod will not be included in the list.
#pod
#pod The method returns a reference to an array of item names on success, a
#pod reference to an empty array if no items need to be acted upon, or C<undef>
#pod on error.

lib/Algorithm/Dependency.pm  view on Meta::CPAN

360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
        my @items = @_ or return undef;
 
        # Get their dependencies
        my $depends = $self->depends( @items ) or return undef;
 
        # Now return a combined list, removing any items already selected.
        # We are allowed to return an empty list.
        my $s = $self->{selected};
        return [ sort grep { ! $s->{$_} } @items, @$depends ];
}
 
#pod =pod
#pod
#pod =head2 schedule_all;
#pod
#pod The C<schedule_all> method acts the same as the C<schedule> method, but
#pod returns a schedule that selected all the so-far unselected items.
#pod
#pod =cut
 
sub schedule_all {
        my $self = shift;

lib/Algorithm/Dependency.pm  view on Meta::CPAN

414
415
416
417
418
419
420
421
422
423
424
};
my $deps_source = Algorithm::Dependency::Source::HoA->new( $deps );
 
my $dep = Algorithm::Dependency::Ordered->new(
  source   => $deps_source,
  selected => [ 'this', 'that' ], # Items we have processed elsewhere or have already satisfied
)
or die 'Failed to set up dependency algorithm';
 
my $also = $dep->schedule_all();
# Returns: ['core', 'a', 'b'] -- ie: installation-order. Whereas using base

lib/Algorithm/Dependency.pm  view on Meta::CPAN

437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
    
  # Load the data from a simple text file
  my $data_source = Algorithm::Dependency::Source::File->new( 'foo.txt' );
   
  # Create the dependency object, and indicate the items that are already
  # selected/installed/etc in the database
  my $dep = Algorithm::Dependency->new(
      source   => $data_source,
      selected => [ 'This', 'That' ]
  ) or die 'Failed to set up dependency algorithm';
   
  # For the item 'Foo', find out the other things we also have to select.
  # This WON'T include the item we selected, 'Foo'.
  my $also = $dep->depends( 'Foo' );
  print $also
        ? "By selecting 'Foo', you are also selecting the following items: "
                . join( ', ', @$also )
        : "Nothing else to select for 'Foo'";
   
  # Find out the order we need to act on the items in.
  # This WILL include the item we selected, 'Foo'.
  my $schedule = $dep->schedule( 'Foo' );
 
=head1 DESCRIPTION
 
Algorithm::Dependency is a framework for creating simple read-only

lib/Algorithm/Dependency.pm  view on Meta::CPAN

488
489
490
491
492
493
494
495
496
497
498
499
500
=for stopwords versioned
 
Algorithm::Dependency implements algorithms relating to dependency
hierarchies. To use this framework, all you need is a source for the master
list of all the items, and a list of those already selected. If your
dependency hierarchy doesn't require the concept of items that are already
selected, simply don't pass anything to the constructor for it.
 
Please note that the class Algorithm::Dependency does NOT implement an
ordering, for speed and simplicity reasons. That is, the C<schedule> it
provides is not in any particular order. If item 'A' depends on item 'B',
it will not place B before A in the schedule. This makes it unsuitable for

lib/Algorithm/Dependency.pm  view on Meta::CPAN

529
530
531
532
533
534
535
536
537
538
539
540
541
The only compulsory option is the source of the dependency items. This is
an object of a subclass of L<Algorithm::Dependency::Source>. In practical terms,
this means you will create the source object before creating the
Algorithm::Dependency object.
 
=item selected => [ 'A', 'B', 'C', etc... ]
 
The C<selected> option provides a list of those items that have already been
'selected', acted upon, installed, or whatever. If another item depends on one
in this list, we don't have to include it in the output of the C<schedule> or
C<depends> methods.
 
=item ignore_orphans => 1

lib/Algorithm/Dependency.pm  view on Meta::CPAN

555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
=head2 source
 
The C<source> method retrieves the L<Algorithm::Dependency::Source> object
for the algorithm context.
 
=head2 selected_list
 
The C<selected_list> method returns, as a list and in alphabetical order,
the list of the names of the selected items.
 
=head2 selected $name
 
Given an item name, the C<selected> method will return true if the item is
selected, false is not, or C<undef> if the item does not exist, or an error
occurs.
 
=head2 item $name
 
The C<item> method fetches and returns the item object, as specified by the

lib/Algorithm/Dependency.pm  view on Meta::CPAN

578
579
580
581
582
583
584
585
586
587
588
=head2 depends $name1, ..., $nameN
 
Given a list of one or more item names, the C<depends> method will return
a reference to an array containing a list of the names of all the OTHER
items that also have to be selected to meet dependencies.
 
That is, if item A depends on B and C then the C<depends> method would
return a reference to an array with B and C. ( C<[ 'B', 'C' ]> )
 
If multiple item names are provided, the same applies. The list returned

lib/Algorithm/Dependency.pm  view on Meta::CPAN

609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
dependencies, in the preferred order of action. For the normal algorithm,
where order it not important, this is alphabetical order. This makes it
easier for someone watching a program operate on the items to determine
how far you are through the task and makes any logs easier to read.
 
If any of the names you provided in the arguments is already selected, it
will not be included in the list.
 
The method returns a reference to an array of item names on success, a
reference to an empty array if no items need to be acted upon, or C<undef>
on error.
 
=head2 schedule_all;
 
The C<schedule_all> method acts the same as the C<schedule> method, but
returns a schedule that selected all the so-far unselected items.
 
=head1 TO DO
 
Add the C<check_source> method, to verify the integrity of the source.

 view all matches for this distribution


Algorithm-Diff-Any

 view release on metacpan or  search on metacpan

lib/Algorithm/Diff/Any.pm  view on Meta::CPAN

1
2
3
4
5
6
7
# Algorithm::Diff::Any
#  An interface that automagically selects the XS or Pure Perl port of
#  the diff algorithm (Algorithm::Diff or Algorithm::Diff::XS)
#
# $Id: Any.pm 10595 2009-12-23 00:29:52Z FREQUENCY@cpan.org $
 

lib/Algorithm/Diff/Any.pm  view on Meta::CPAN

61
62
63
64
65
66
67
68
69
70
  }
}
 
=head1 DESCRIPTION
 
This is a simple module to select the best available implementation of the
standard C<diff> algorithm, which works by effectively trying to solve the
Longest Common Subsequence (LCS) problem. This algorithm is described in:
I<A Fast Algorithm for Computing Longest Common Subsequences>, CACM, vol.20,
no.5, pp.350-353, May 1977.

 view all matches for this distribution


Algorithm-Diff-XS

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

894
895
896
897
898
899
900
901
902
903
904
ck_retarget|||
ck_return|||
ck_rfun|||
ck_rvconst|||
ck_sassign|||
ck_select|||
ck_shift|||
ck_sort|||
ck_spair|||
ck_split|||
ck_subr|||

 view all matches for this distribution


Algorithm-Diff

 view release on metacpan or  search on metacpan

lib/Algorithm/Diff.pm  view on Meta::CPAN

546
547
548
549
550
551
552
553
554
555
556
            # 1   # $me->[1]: Ref to first sequence
            # 2   # $me->[2]: Ref to second sequence
sub _End()  { 3 } # $me->[_End]: Diff between forward and reverse pos
sub _Same() { 4 } # $me->[_Same]: 1 if pos 1 contains unchanged items
sub _Base() { 5 } # $me->[_Base]: Added to range's min and max
sub _Pos()  { 6 } # $me->[_Pos]: Which hunk is currently selected
sub _Off()  { 7 } # $me->[_Off]: Offset into _Idx for current position
sub _Min() { -2 } # Added to _Off to get min instead of max+1
 
sub Die
{

 view all matches for this distribution


Algorithm-DimReduction

 view release on metacpan or  search on metacpan

inc/Test/Builder.pm  view on Meta::CPAN

935
936
937
938
939
940
941
942
943
944
945
946
947
    return $fh;
}
 
sub _autoflush {
    my($fh) = shift;
    my $old_fh = select $fh;
    $| = 1;
    select $old_fh;
 
    return;
}
 
my( $Testout, $Testerr );

 view all matches for this distribution


Algorithm-Easing

 view release on metacpan or  search on metacpan

lib/Algorithm/Easing.pm  view on Meta::CPAN

67
68
69
70
71
72
73
74
75
76
    Quintonion
    Sinusoidal
    Backdraft
    Circular
 
For ease of use, there is an included Mediator class.  The Mediator class permits the programmer to select from the spread of easing functions through a single class name.
 
=cut
 
=head1 METHODS

 view all matches for this distribution


Algorithm-Evolutionary

 view release on metacpan or  search on metacpan

lib/Algorithm/Evolutionary/Hash_Wheel.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;
 
=head1 NAME
 
Algorithm::Evolutionary::Hash_Wheel - Random selector of things depending on probabilities
 
=head1 SYNOPSIS
 
    my $wheel = new Algorithm::Evolutionary::Hash_Wheel( \%probs );
    print $wheel->spin(); #Returns an element according to probabilities;
 
=head1 DESCRIPTION
 
Creates a "roulette wheel" for spinning and selecting stuff. It will
be used in several places; mainly in the
L<Algorithm::Evolutionary::Op::CanonicalGA>. It's similar to
L<Algorithm::Evolutionary::Wheel>, but with a hash instead of an
array. Probably should unify both..

 view all matches for this distribution


( run in 1.016 second using v1.01-cache-2.11-cpan-49f99fa48dc )