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.614.213 Times

Data::Page::Viewport 1.02

  Date Added: July 12, 2010  |  Visits: 709


Report Broken Link
Printer Friendly Version

Product Homepage
Download (71 downloads)

Data::Page::Viewport is a Perl module to scroll thru data a page, or just an item, at a time. Synopsis This is a complete, tested, runnable program. #!/usr/bin/perl use strict; use warnings; use Data::Page::Viewport; # ----------------------------------------------- my(@data) = (qw/zero one two three four five six seven eight nine ten eleven twelve thirteen fourteen/); my($page) = Data::Page::Viewport -> new ( data_size => scalar @data, page_size => 4 ); print "Data bounds: 0 .. $#data. n"; print "Data: ", join(, , @data), ". n"; print "Page bounds: 0 .. 3. n"; print "Page data: ", join(, , @data[0 .. 3]), ". n"; print "n"; my(@bound); for (-2, 1, 4, 4, 1, 3, 3, -2, 1, 2, 1, -4, -4, -1, 1, 2, -1, -2, -2, -1, -4, 4, 4, 4) { print "Offset: $_. n"; @bound = $page -> offset($_) -> bounds(); print "Page bounds: $bound[0] .. $bound[1]. n"; print Page data: , join(, , @data[$bound[0] .. $bound[1] ]), ". n"; print - x 50, "n"; } Data::Page::Viewport is a pure Perl module. This module keeps track of what items are on the current page, when you scroll forwards or backwards within a data set. Similarly to Data::Page, you can call sub offset(N), for + or - N, to scroll thru the data a page at a time. And, like Set::Window, you can call sub offset(N), for + or - 1, to scroll thru the data an item at a time. Clearly, N does not have to be fixed. The viewport provides access to the current page, and the code shifts indexes into and out of the viewport, according to the parameter passed to sub offset(). Note that the data is not passed into this module. The module only keeps track of the indexes within the viewport, i.e. indexes on the current page. You call sub bounds() on the object (of type Set::Window) returned by sub offset(), to determine what indexes are on the current page at any particular point in time. Also note that, unlike Set::Window, the boundaries of the viewport are rigid, so that changes to the indexes caused by sub offset() are limited by the size of the data set. This means, if you do this: my($page) = Data::Page::Viewport -> new ( data_size => $#data, # 0 .. $#data. page_size => $page_size, # 1 .. N. ); my(@bound) = $page -> offset(- 1) -> bounds(); the call to sub offset(- 1) will have no effect. That is, when trying to go back past the beginning of the data set, the bounds will be locked to values within 0 .. data_size. Similarly, a call which would go beyond the other end of the data set, will lock the bounds to the same range. In short, you cant fall off the edge by calling sub offset(). This in turn means that the values returned by sub bounds() will always be valid indexes within the range 0 .. data_size. The module implements this by building 2 objects of type Set::Window, one for the original data set (which never changes), and one for the current page, which changes each time sub offset() is called (until the boundaries are hit, of course). Note: No range checking is performed on the parameters to sub new(). Note: It should be obvious by now that this module differs from Data::Page, and indeed all such modules, in that they never change the items which are on a given page. They only allow you to change the page known as the current page. This module differs, in that, by calling sub offset(+ or - N), you are effectively changing the items which are deemed to be on the current page..

Requirements: No special requirements
Platforms: Linux
Keyword: Data Data Set Datapageviewport Libraries Module Offset Page Perl Module Programming Sub
Users rating: 0/10

License: Freeware Size: 8.19 KB
More Reviews or Write Review

Libraries  -  Module::Install::Philosophy 0.67
Module::Install::Philosophy Perl module contains the concepts behind Module::Install. SYNOPSIS This document describes the personal philosophy behind the creation of CPAN::MakeMaker (the predecessor of Module::Install). The views expressed...
81.92 KB  
Libraries  -  Data::Phrasebook::Loader::XML 0.12
Data::Phrasebook::Loader::XML Perl module can abstract your phrases with XML. SYNOPSIS use Data::Phrasebook; my $q = Data::Phrasebook->new( class => Fnerk, loader => XML, file => phrases.xml, dict => Dictionary, # optional ); OR my...
17.41 KB  
Libraries  -  Set::Infinite::Basic 0.61
Set::Infinite::Basic is a Perl module with sets of intervals. SYNOPSIS use Set::Infinite::Basic; $set = Set::Infinite::Basic->new(1,2); # [1..2] print $set->union(5,6); # [1..2],[5..6] Set::Infinite::Basic is a Set Theory module for...
49.15 KB  
Libraries  -  Time::Skew 0.1
Time::Skew is a Perl module that computes local clock skew with respect to a remote clock. SYNOPISI use Time::Skew # Init Convex Hull and timing data my $hull=[]; my $result={}; # Iterate data point introduction...
45.06 KB  
Libraries  -  Convert::Cyr
Convert::Cyr, chcp is a Perl module for change cyrillic code page of a text. SYNOPSIS use Convert::Cyr qw(chcp); $converted_string=chcp($string, $maxlen, $from, $to); ABSTRACT Convert::Cyr, chcp - change cyrillic code page of a text....
5.12 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  -  SQL::Preproc 0.10
SQL::Preproc is a Perl module to embed SQL in your Perl (ala SQL preprocessors). SYNOPSIS use SQL::Preproc subclass => Chart, emit => 1, keepsql => 1, syntax => [ Teradata ], pponly => 1, relax => 1, alias => 1, debug => 1; use DBI;...
52.22 KB  
Libraries  -  PDL::Tips 2.4.3
PDL::Tips is a Perl module with small tidbits of useful arcana. Programming tidbits and such. SYNOPSIS use PDL; # Whatever happens here. This page documents useful idioms, helpful hints and tips for using Perl Data Language v2.0. Help...
2.1 MB  
Libraries  -  DateTime::TimeZone::SystemV 0.000
DateTime::TimeZone::SystemV is a Perl module with System V and POSIX timezone strings. SYNOPSIS use DateTime::TimeZone::SystemV; $tz = DateTime::TimeZone::SystemV->new("EST5EDT"); if($tz->is_floating) { ... if($tz->is_utc) { ......
8.19 KB  
Libraries  -  Text::Reform 1.11
Text::Reform is a Perl module for manual text wrapping and reformatting. SYNOPSIS use Text::Reform; print form $template, $data, $to, $fill, $it, $with; use Text::Reform qw( tag ); print tag B, $enboldened_text; The form sub The...
20.48 KB  
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, 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.11.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