Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 976 Categories, Downloaded 29.989.583 Times

Set::Integer::Gapfillers 0.07

  Date Added: November 10, 2010  |  Visits: 708

Set::Integer::Gapfillers

Report Broken Link
Printer Friendly Version


Product Homepage
Download (70 downloads)

Set::Integer::Gapfillers is a Perl module that can fill in the gaps between integer ranges. SYNOPSIS use Set::Integer::Gapfillers; $gf = Set::Integer::Gapfillers->new( lower => -12, upper => 62, sets => [ [ 1, 17 ], # Note: Use comma, not [ 25, 42 ], # range operator (..) [ 44, 50 ], ], ); $segments_needed_ref = $gf->segments_needed(); $gapfillers_ref = $gf->gapfillers(); $all_segments_ref = $gf->all_segments(); Any of the three preceding output methods can also be called with an expand option: $segments_needed_ref = $gf->segments_needed( expand => 1 ); This Perl extension provides methods which may be useful in manipulating sets whose elements are consecutive integers. Suppose that you are provided with the following non-intersecting, non-overlapping sets of consecutive integers: { 1 .. 17 } { 25 .. 42 } { 44 .. 50 } Suppose further that you are provided with the following lower and upper bounds to a range of consecutive integers: lower: 12 upper: 62 Provide a set of sets which: when joined together, would form a set of consecutive integers from the lower to the upper bound, inclusive; and are derived from: the sets provided; proper subsets thereof; or newly generated sets which fill in the gaps below, in between or above the provided sets. Once a Set::Integer::Gapfillers object has been constructed, its segments_needed() method can be used to provide these results: { 12 .. 17 } # subset of 1st set provided { 18 .. 24 } # gap-filler set { 25 .. 42 } # 2nd set provided { 43 .. 43 } # gap-filler set # (which happens to consist of a single element) { 44 .. 50 } # 3rd set provided { 51 .. 62 } # gap-filler set for range above highest provided set Alternatively, you may only wish to examine the gap-filler sets. The gapfillers() method provides this set of sets. { 18 .. 24 } # gap-filler set { 43 .. 43 } # gap-filler set { 51 .. 62 } # gap-filler set And, as an additional alternative, you may wish to have your set of sets begin or end with all the values of a given provided set, rather than a proper subset thereof containing only those values needed to populate the desired range. In that case, use the all_segments() method. { 1 .. 17 } # 1st set provided { 18 .. 24 } # gap-filler set { 25 .. 42 } # 2nd set provided { 43 .. 43 } # gap-filler set # (which happens to consist of a single element) { 44 .. 50 } # 3rd set provided { 51 .. 62 } # gap-filler set for range above highest provided set The results returned by the all_segments() method differ from those returned by the segments_needed() method only at the lower or upper ends. If, as in the above example, the lower bound of the target range of integers falls inside a provided segment, the first set returned by all_segments() will be the entire first set provided; the first set returned by segments_needed() will be a proper subset of the first set provided, starting with the requested lower bound..

Requirements: No special requirements
Platforms: Linux
Keyword: Fill In Libraries Needed Perl Module Provided Range Segments Setintegergapfillers Sets
Users rating: 0/10

License: Freeware Size: 17.41 KB
SET::INTEGER::GAPFILLERS RELATED
Libraries  -  Set::IntSpan::Fast 0.0.5
Set::IntSpan::Fast is a Perl module for fast handling of sets containing integer spans. SYNOPSIS use Set::IntSpan::Fast; my $set = Set::IntSpan::Fast->new(); $set->add(1, 3, 5, 7, 9); $set->add_range(100, 1_000_000); print...
102.4 KB  
Libraries  -  Alien Perl module 0.91
Alien Perl module package contains external libraries wrapped up for your viewing pleasure! SYNOPSIS perldoc Alien; Alien is a package that exists just to hold together an idea, the idea of Alien:: packages, so there is no code here, just...
10.24 KB  
Libraries  -  Class::Meta::Declare 0.04
Class::Meta::Declare is a Perl module deprecated in favor of Class::Meta::Express. SYNOPSIS This was a first attempt at making a saner interface for Class::Meta. It is nicer, but Class::Meta::Express is nicer still. Go use that one. package...
15.36 KB  
Libraries  -  OpenGeoDB Perl module 0.4
OpenGeDB Perl module is a module to access the OpenGeoDB database and calculate all ZIP codes in a certain radius..
3.07 KB  
Libraries  -  String::MFN 1.27
String::MFN is a Perl module to Normalize a string in the manner of the mfn utility. SYNOPSIS use String::MFN; my $sane_string = mfn($retarded_string); ... Normalizes a string. Normalization, in brief, means modifying the string to...
8.19 KB  
Libraries  -  Set::Infinite 0.61
Set::Infinite Perl module contains sets of intervals. SYNOPSIS use Set::Infinite; $set = Set::Infinite->new(1,2); # [1..2] print $set->union(5,6); # [1..2],[5..6] Set::Infinite is a Set Theory module for infinite sets. A set is a...
49.15 KB  
Network & Internet  -  MyCMS perl module 1.0
MyCMS perl module provides the MN::CMS Perl module used by the MyCMS. MyCMS perl module contains Perl object classes to manage the data of MyCMS (such as articles, links, and images). MN::CMS is a perl module that allows you to manage an...
16.38 KB  
Libraries  -  DBD::ODBC 1.14
DBD::ODBC Perl module contains a ODBC Driver for DBI. SYNOPSIS use DBI; $dbh = DBI->connect(dbi:ODBC:DSN, user, password); Private DBD::ODBC Attributes odbc_more_results (applies to statement handle only!) Use this attribute to...
122.88 KB  
Libraries  -  SVG::SVG2zinc 0.10
SVG::SVG2zinc is a Perl module to display or convert svg files in scripts, classes, images... SYNOPSIS use SVG::SVG2zinc; &SVG::SVG2zinc::parsefile(file.svg, Backend,file.svg, -out => outfile, -verbose => $verbose, -namespace => 0|1,...
133.12 KB  
Libraries  -  RDFStore::Parser::SiRPAC 0.50
RDFStore::Parser::SiRPAC is a Perl module that implements a streaming RDF Parser as a direct implementation of XML::Parser::Expat. SYNOPSIS use RDFStore::Parser::SiRPAC; use RDFStore::NodeFactory; my $p=new RDFStore::Parser::SiRPAC(...
481.28 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
Libraries  -  wolfSSL 3.12.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
2.73 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB