DiaColloDB

 view release on metacpan or  search on metacpan

DiaColloDB/Utils.pod  view on Meta::CPAN

=item crun

 $bool = crun(@IPC_Run_args);

wrapper for IPC::Run::run(@IPC_Run_args) with $ENV{LC_ALL}='C'

=item csort_to

 $bool = csort_to(\@sortargs, \&catcher);

runs system sort and feeds resulting lines to \&catcher

=item csortuc_to

 $bool = csortuc_to(\@sortargs, \&catcher);

runs system sort | uniq -c and feeds resulting lines to \&catcher

=item sortCmd

 $cmd = sortCmd();
 $cmd = sortCmd($nJobs);

Returns command-line prefix (command and initial optopins) for GNU-like B<sort> command.
This method just returns the value of the C<DIACOLLO_SORT> environment variable if it is set,
otherwise the value of the C<SORT> environment variable if that is set.  If neither
C<DIACOLLO_SORT> nor C<SORT> are set, it returns the string B<sort> with the parallelization
options returned by L</sortJobs> appended.  You can use the environment variable hooks e.g. to
reduce the amount of RAM and/or CPU cores used by subordinate system sort calls by setting
them appropriately, e.g.

 env SORT="/bin/sort --parallel=4 --buffer-size=1G"

to request that GNU sort use at most 4 CPU cores and a maximum RAM buffer size of 1GB.

=back

=cut

##----------------------------------------------------------------
## DESCRIPTION: DiaColloDB::Utils: Functions: pack filters
=pod

=head2 Functions: pack filters

=over 4

=item packsize

 $len = PACKAGE::packsize($packfmt);
 $len = PACKAGE::packsize($packfmt,@args);

get pack-size for $packfmt with args @args

=item packFilterStore

 \&filter_sub = PACKAGE::packFilterStore($pack_template);
 \&filter_sub = PACKAGE::packFilterStore([$pack_template_store, $pack_template_fetch]);
 \&filter_sub = PACKAGE::packFilterStore([\&pack_code_store,   \&pack_code_fetch]);

returns a L<DB_File|DB_File>-style STORE-filter sub for transparent packing of data to $pack_template

=item packFilterFetch

 \&filter_sub = PACKAGE::packFilterFetch($pack_template);
 \&filter_sub = PACKAGE::packFilterFetch([$pack_template_store, $pack_template_fetch]);
 \&filter_sub = PACKAGE::packFilterFetch([\&pack_code_store,   \&pack_code_fetch]);

returns a L<DB_File|DB_File>-style FETCH-filter sub for transparent unpacking of data from $pack_template.

=back

=cut

##----------------------------------------------------------------
## DESCRIPTION: DiaColloDB::Utils: Math stuff
=pod

=head2 Math stuff

=over 4

=item Variable: $LOG2

constant: C<log(2)> for binary logarithms.

=item log2

 $log2 = log2($x);

binary logarithm function.

=item max2

 $max2 = max2($x,$y);

maximum

=item min2

 $min2 = min2($x,$y);

minimum

=back

=cut

##----------------------------------------------------------------
## DESCRIPTION: DiaColloDB::Utils: Functions: lists
=pod

=head2 Functions: lists

=over 4

=item luniq

 \@l_uniq = luniq(\@l);

returns sorted list of unique defined elements of @l; @l need not be sorted.

=item sluniq

 \@l_sorted_uniq = sluniq(\@l_sorted);

returns unique defined elements of pre-sorted list @l_sorted.

=item xluniq



( run in 1.984 second using v1.01-cache-2.11-cpan-5837b0d9d2c )