maker 0.05
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 222
File::Maker 0.05
File::Maker is a Perl module that mimics a make by loading a database and calling targets methods. more>>
File::Maker is a Perl module that mimics a make by loading a database and calling targets methods.
SYNOPSIS
#####
# Subroutine interface
#
use File::Maker qw(load_db);
%data = load_db($pm);
######
# Object interface
#
require File::Maker;
$maker = $maker->load_db($pm);
$maker->make_targets(%targets, @targets, %options );
$maker->make_targets(%targets, %options );
$maker = new File::Maker(@options);
Generally, if a subroutine will process a list of options, @options, that subroutine will also process an array reference, @options, [@options], or hash reference, %options, {@options}. If a subroutine will process an array reference, @options, [@options], that subroutine will also process a hash reference, %options, {@options}. See the description for a subroutine for details and exceptions.
When porting low level C code from one architecture to another, makefiles do provide some level of automation and save some time. However, once Perl or another high-level language is up and running, the high-level language usually allows much more efficient use of programmers time; otherwise, whats point of the high-level language. Thus, makes great economically sense to switch from makefiles to high-level language.
The File::Maker program module provides a "make" style interface as shown in the herein above. The @targets contains a list of targets that mimics the targets of a makefile. The targets are subroutines written in Perl in a separate program module from the File::Maker. The separate target program module inherits the methods in the File::Maker program module as follows:
use File::Maker;
use vars qw( @ISA );
@ISA = qw(File::Maker);
The File::Maker methods will then find the target subroutines in the separate target program module.
The File::Maker provides for the loading of a hash from a program module to provide for the capabilities of defines in a makefile. The option pm = $file> tells File::Maker to load a database from the __DATA__ section of a program module that is in the Tie::Form format. The Tie::Form format is a very flexible lenient format that is about as close to a natural language form and still have the precision of being machine readable.
This provides a more flexible alternative to the defines in a makefile. The define hash is in a separate, very flexible form program module. This arrangement allows one target program module that inherits the File::Maker program module to produce as many different outputs as there are Tie::Form program modules.
<<lessSYNOPSIS
#####
# Subroutine interface
#
use File::Maker qw(load_db);
%data = load_db($pm);
######
# Object interface
#
require File::Maker;
$maker = $maker->load_db($pm);
$maker->make_targets(%targets, @targets, %options );
$maker->make_targets(%targets, %options );
$maker = new File::Maker(@options);
Generally, if a subroutine will process a list of options, @options, that subroutine will also process an array reference, @options, [@options], or hash reference, %options, {@options}. If a subroutine will process an array reference, @options, [@options], that subroutine will also process a hash reference, %options, {@options}. See the description for a subroutine for details and exceptions.
When porting low level C code from one architecture to another, makefiles do provide some level of automation and save some time. However, once Perl or another high-level language is up and running, the high-level language usually allows much more efficient use of programmers time; otherwise, whats point of the high-level language. Thus, makes great economically sense to switch from makefiles to high-level language.
The File::Maker program module provides a "make" style interface as shown in the herein above. The @targets contains a list of targets that mimics the targets of a makefile. The targets are subroutines written in Perl in a separate program module from the File::Maker. The separate target program module inherits the methods in the File::Maker program module as follows:
use File::Maker;
use vars qw( @ISA );
@ISA = qw(File::Maker);
The File::Maker methods will then find the target subroutines in the separate target program module.
The File::Maker provides for the loading of a hash from a program module to provide for the capabilities of defines in a makefile. The option pm = $file> tells File::Maker to load a database from the __DATA__ section of a program module that is in the Tie::Form format. The Tie::Form format is a very flexible lenient format that is about as close to a natural language form and still have the precision of being machine readable.
This provides a more flexible alternative to the defines in a makefile. The define hash is in a separate, very flexible form program module. This arrangement allows one target program module that inherits the File::Maker program module to produce as many different outputs as there are Tie::Form program modules.
Download (0.076MB)
Added: 2007-02-16 License: Perl Artistic License Price:
980 downloads
Class::Maker 0.05.18
Class::Maker Perl module contains classes, reflection, schema, serialization, attribute- and multiple inheritance. more>>
Class::Maker Perl module contains classes, reflection, schema, serialization, attribute- and multiple inheritance.
SYNOPSIS
use Class::Maker qw(class);
class Human, { isa => [qw( ParentClass )],
public =>
{
string => [qw(name lastname)],
ref => [qw(father mother)],
array => [qw(friends)],
custom => [qw(anything)],
},
private =>
{
int => [qw(dummy1 dummy2)],
},
configure =>
{
ctor => create,
explicit => 0,
},
};
sub Human::greeting : method { my $this = shift;
printf This is %s (%d), $this->name, $this->uid;
}
class UnixUser, { isa => [qw( Human )],
public =>
{
int => [qw(uid gid)],
string => [qw(username)],
},
};
my $a = Human->new( uid => 1, gid => 2, name => Bart );
$a->father( Human->new( name => Houmer ) );
$a->greeting();
$a->uid = 12;
$a->_dummy1( bla );
Class::Maker introduces the concept of classes via a "class" function. It automatically creates packages, ISA, new and attribute-handlers. The classes can inherit from common perl-classes and class-maker classes. Single and multiple inheritance is supported.
This package is for everybody who wants to program oo-perl and does not really feel comfortable with the common way.
Java-like reflection is also implemented and allows one to inspect the class properties and methods during runtime. This is helpfull for implementing persistance and serialization. A Tangram (see cpan) schema generator is included to the package, so one can use Tangram object-persistance on the fly as long as he uses Class::Maker classes.
<<lessSYNOPSIS
use Class::Maker qw(class);
class Human, { isa => [qw( ParentClass )],
public =>
{
string => [qw(name lastname)],
ref => [qw(father mother)],
array => [qw(friends)],
custom => [qw(anything)],
},
private =>
{
int => [qw(dummy1 dummy2)],
},
configure =>
{
ctor => create,
explicit => 0,
},
};
sub Human::greeting : method { my $this = shift;
printf This is %s (%d), $this->name, $this->uid;
}
class UnixUser, { isa => [qw( Human )],
public =>
{
int => [qw(uid gid)],
string => [qw(username)],
},
};
my $a = Human->new( uid => 1, gid => 2, name => Bart );
$a->father( Human->new( name => Houmer ) );
$a->greeting();
$a->uid = 12;
$a->_dummy1( bla );
Class::Maker introduces the concept of classes via a "class" function. It automatically creates packages, ISA, new and attribute-handlers. The classes can inherit from common perl-classes and class-maker classes. Single and multiple inheritance is supported.
This package is for everybody who wants to program oo-perl and does not really feel comfortable with the common way.
Java-like reflection is also implemented and allows one to inspect the class properties and methods during runtime. This is helpfull for implementing persistance and serialization. A Tangram (see cpan) schema generator is included to the package, so one can use Tangram object-persistance on the fly as long as he uses Class::Maker classes.
Download (0.048MB)
Added: 2007-06-01 License: Perl Artistic License Price:
879 downloads
mod_arm 0.05
mod_arm provides a simple, seamless, and application independent interface to ARM (Application Response Measurement). more>>
mod_arm provides a simple, seamless, and application independent interface to ARM (Application Response Measurement).
mod_arm allows system administrators to get an accurate idea of how long an application takes on a running server - for a single instance or as a step in a multi-tier transaction. This is definitely a work in progress.
Configuration Directives
Arm
Syntax: Arm state
When state is on, ARM measurements will be taken for this directory
When state is application, ARM measurements will be controlled by the application scripting language such as PHP (not yet implemented)
When state is off, no measurements are taken for this directory
ArmApplication
Syntax: ArmApplication application_name
Specifies the application name to use for this directory. If non is specified, the default value of "Apache" is used.
ArmUser
Syntax: ArmUser user_name
Specifies the user name for the transaction. If none is specified, the default value of "*" is used
ArmTransaction
Syntax: ArmTransaction transaction_name
Specifies the name of the transaction. If none is specified, the default value will be the URI of the object requested.
ArmTransactionInfo
Syntax: ArmTransactionInfo transaction_info
This is an informational string used to descibe the transaction, primarily for use by transaction correlators. If not specifed, the default value is "Apache web page".
<<lessmod_arm allows system administrators to get an accurate idea of how long an application takes on a running server - for a single instance or as a step in a multi-tier transaction. This is definitely a work in progress.
Configuration Directives
Arm
Syntax: Arm state
When state is on, ARM measurements will be taken for this directory
When state is application, ARM measurements will be controlled by the application scripting language such as PHP (not yet implemented)
When state is off, no measurements are taken for this directory
ArmApplication
Syntax: ArmApplication application_name
Specifies the application name to use for this directory. If non is specified, the default value of "Apache" is used.
ArmUser
Syntax: ArmUser user_name
Specifies the user name for the transaction. If none is specified, the default value of "*" is used
ArmTransaction
Syntax: ArmTransaction transaction_name
Specifies the name of the transaction. If none is specified, the default value will be the URI of the object requested.
ArmTransactionInfo
Syntax: ArmTransactionInfo transaction_info
This is an informational string used to descibe the transaction, primarily for use by transaction correlators. If not specifed, the default value is "Apache web page".
Download (0.015MB)
Added: 2006-05-26 License: The Apache License Price:
1247 downloads
Aften 0.05
Aften is a simple, open-source, A/52 (AC-3) audio encoder. more>>
Aften project is a simple, open-source, A/52 (AC-3) audio encoder.
Main features:
- Implemented my own wav reader
- Converted the fixed-point algorithms to floating-point
- Rearranged the methods and structures
- Added stereo rematrixing (mid/side)
- Added short block MDCT and block switching
- Added VBR encoding mode
- Added variable bandwidth
- Added more complete WAV format support
- Added support for using the alternate bit stream syntax
- Created separate library and frontend
- Added input filters
Enhancements:
- Bit allocation speedups, a compile-time choice of using floats or doubles internally, an internal restructuring of MDCT functions, and bugfixes. quality=0 is now a valid setting.
<<lessMain features:
- Implemented my own wav reader
- Converted the fixed-point algorithms to floating-point
- Rearranged the methods and structures
- Added stereo rematrixing (mid/side)
- Added short block MDCT and block switching
- Added VBR encoding mode
- Added variable bandwidth
- Added more complete WAV format support
- Added support for using the alternate bit stream syntax
- Created separate library and frontend
- Added input filters
Enhancements:
- Bit allocation speedups, a compile-time choice of using floats or doubles internally, an internal restructuring of MDCT functions, and bugfixes. quality=0 is now a valid setting.
Download (0.046MB)
Added: 2006-08-22 License: GPL (GNU General Public License) Price:
1165 downloads
Aorta 0.05
Aorta project is a load-balancing clustered P2P application. more>>
Aorta project is a load-balancing clustered P2P application.
It executes Tasklets (which have the ability to split themselves into sub tasks that can be executed in pararell).
A typical cluster contains of a LAN with 1-256 computers, each one running aorta.
A Tasklet can be of any type ranging from encoding MP3s, Genomic DNA Alignment, or simply to rendering Web pages for high speed/heavily loaded Web sites.
You can make functions calls to C/C++, applications like Matlab, etc.
Main features:
- PingTasklet simply traversers your net of aortas.
- ImageTasklet , simply rescale imagecolours.
- EncodeTasklet, spreads out mp3 encode in your LAN.
- SimpleSort , Merge sort by Gretsam.
Enhancements:
- Refactored to one base class Moblet,the smalles code and data entity moving around
- Improved Moblet Receiver and executing. Minimizing worker idle time
- startup script aorta.sh improved now can start with remote debug params
- Aorta core can now be used as an API to emit/delegete Moblets from an user created application
- Preferences stuff should work on a MS platform now
- Herve added DocBook to buildsystem
- Gretsam added a MergeSorter Tasklet
<<lessIt executes Tasklets (which have the ability to split themselves into sub tasks that can be executed in pararell).
A typical cluster contains of a LAN with 1-256 computers, each one running aorta.
A Tasklet can be of any type ranging from encoding MP3s, Genomic DNA Alignment, or simply to rendering Web pages for high speed/heavily loaded Web sites.
You can make functions calls to C/C++, applications like Matlab, etc.
Main features:
- PingTasklet simply traversers your net of aortas.
- ImageTasklet , simply rescale imagecolours.
- EncodeTasklet, spreads out mp3 encode in your LAN.
- SimpleSort , Merge sort by Gretsam.
Enhancements:
- Refactored to one base class Moblet,the smalles code and data entity moving around
- Improved Moblet Receiver and executing. Minimizing worker idle time
- startup script aorta.sh improved now can start with remote debug params
- Aorta core can now be used as an API to emit/delegete Moblets from an user created application
- Preferences stuff should work on a MS platform now
- Herve added DocBook to buildsystem
- Gretsam added a MergeSorter Tasklet
Download (2.2MB)
Added: 2006-10-09 License: GPL (GNU General Public License) Price:
1110 downloads
FaxRouter 0.05
FaxRouter is a efax based application which converts a received fax to jpeg and sends it to you by email. more>>
FaxRouter is a efax based application which converts a received fax to jpeg and sends it to you by email.
It will also keep your fax spool clean for you and can easily be configured to run from inittab and receive all faxes for you.
<<lessIt will also keep your fax spool clean for you and can easily be configured to run from inittab and receive all faxes for you.
Download (0.006MB)
Added: 2006-09-14 License: GPL (GNU General Public License) Price:
1136 downloads
List::Maker 0.0.3
List::Maker is a Perl module that can generate more sophisticated lists than just $a..$b. more>>
List::Maker is a Perl module that can generate more sophisticated lists than just $a..$b.
SYNOPSIS
use List::Maker;
@list = < 1..10 >; # (1,2,3,4,5,6,7,8,9,10)
@list = < 10..1 >; # (10,9,8,7,6,5,4,3,2,1)
@list = < 1,3,..10 > # (1,3,5,7,9)
@list = < 1..10 x 2 > # (1,3,5,7,9)
@list = < 0..10 : prime N >; # (2,3,5,7)
@list = < 1,3,..30 : /7/ > # (7,17,27)
@words = < a list of words >; # (a, list, of, words)
@words = < a list "of words" >; # (a list, of words)
The List::Maker module hijacks Perls built-in file globbing syntax (< *.pl > and glob *.pl) and retargets it at list creation.
The rationale is simple: most people rarely if ever glob a set of files, but they have to create lists in almost every program they write. So the list construction syntax should be easier than the filename expansion syntax.
<<lessSYNOPSIS
use List::Maker;
@list = < 1..10 >; # (1,2,3,4,5,6,7,8,9,10)
@list = < 10..1 >; # (10,9,8,7,6,5,4,3,2,1)
@list = < 1,3,..10 > # (1,3,5,7,9)
@list = < 1..10 x 2 > # (1,3,5,7,9)
@list = < 0..10 : prime N >; # (2,3,5,7)
@list = < 1,3,..30 : /7/ > # (7,17,27)
@words = < a list of words >; # (a, list, of, words)
@words = < a list "of words" >; # (a list, of words)
The List::Maker module hijacks Perls built-in file globbing syntax (< *.pl > and glob *.pl) and retargets it at list creation.
The rationale is simple: most people rarely if ever glob a set of files, but they have to create lists in almost every program they write. So the list construction syntax should be easier than the filename expansion syntax.
Download (0.007MB)
Added: 2007-06-27 License: Perl Artistic License Price:
852 downloads
Patch Maker 3.0
Patch Maker helps you manage multiple in-progress source code patches to software. more>>
Patch Maker helps you manage multiple in-progress source code patches to software. Patch Maker remembers which files are part of which patch, and keeps them disentangled during the development process.
It speeds up common operations and housekeeping tasks, allowing you to focus on writing code. It is a command-line tool written in Perl, and so is usable on (at least) Windows, Linux and Mac OS X.
Enhancements:
- Initial SVN support was added to go with CVS.
- The configuration was moved to the .pmrc file in the home directory.
- Message and error printing were tidied up and standardized.
<<lessIt speeds up common operations and housekeeping tasks, allowing you to focus on writing code. It is a command-line tool written in Perl, and so is usable on (at least) Windows, Linux and Mac OS X.
Enhancements:
- Initial SVN support was added to go with CVS.
- The configuration was moved to the .pmrc file in the home directory.
- Message and error printing were tidied up and standardized.
Download (0.032MB)
Added: 2006-07-11 License: GPL (GNU General Public License) Price:
5673 downloads
Config Maker 0.2
Config Maker is a tool to automatically create C++ classes that parse configuration files. more>>
Config Maker is a tool to automatically create C++ classes that parse configuration files.
Only a few lines of text that describe the possible entries in the configuration file are needed, and the complete class will be generated ready for use.
Basic usage
The input files for Config Maker have a very simple structure (in ANTLR/grep like notation):
objectname (configentry)+
Each configentry looks like this
type entryname defaultvalue (comment)?
type
Type of the entry, can be int, double, string or bool. If the basic type is followed by any number, the corresponding c++object variable will be of type vector < basic type > The number is the initial number of elements that are allocated for the vector, but the actual configuration file can contain more components. These are added using the push_back method.
If there are less elements specified in the configuration file, the object variable will still contain the number of elements specified here. No warning will be issued.
configentry
Name of the entry and corresponding variable. Has to be at least two characters long and can contain characters and numbers. Case insensitive.
defaultvalue
Default value for the entry. This is optional.
comment
Each comment starts with // and is completely ignored
<<lessOnly a few lines of text that describe the possible entries in the configuration file are needed, and the complete class will be generated ready for use.
Basic usage
The input files for Config Maker have a very simple structure (in ANTLR/grep like notation):
objectname (configentry)+
Each configentry looks like this
type entryname defaultvalue (comment)?
type
Type of the entry, can be int, double, string or bool. If the basic type is followed by any number, the corresponding c++object variable will be of type vector < basic type > The number is the initial number of elements that are allocated for the vector, but the actual configuration file can contain more components. These are added using the push_back method.
If there are less elements specified in the configuration file, the object variable will still contain the number of elements specified here. No warning will be issued.
configentry
Name of the entry and corresponding variable. Has to be at least two characters long and can contain characters and numbers. Case insensitive.
defaultvalue
Default value for the entry. This is optional.
comment
Each comment starts with // and is completely ignored
Download (0.30MB)
Added: 2007-03-20 License: GPL (GNU General Public License) Price:
955 downloads
Compass::Bearing 0.05
Compass::Bearing is a Perl module to convert angle to text bearing (aka heading). more>>
Compass::Bearing is a Perl module to convert angle to text bearing (aka heading).
SYNOPSIS
use Compass::Bearing;
my $obj = Compass::Bearing->new();
print "Bearing: $_ deg => ", $obj->bearing($_), "n" foreach (12,45,78,133);
print "Compass: ", join(":", $obj->data),"n";
CONSTRUCTOR
new
The new() constructor may be called with any parameter that is appropriate to the set method.
my $obj = Compass::Bearing->new();
METHODS
bearing
Method returns a text string based on bearing
my $bearing=$obj->bearing($degrees_from_north);
bearing_rad
Method returns a text string based on bearing
my $bearing=$obj->bearing_rad($radians_from_north);
set
Method sets and returns key for the bearing text data structure.
my $key=$self->set;
my $key=$self->set(1);
my $key=$self->set(2);
my $key=$self->set(3); #default value
data
Method returns an array of text values.
my $data=$self->data;
<<lessSYNOPSIS
use Compass::Bearing;
my $obj = Compass::Bearing->new();
print "Bearing: $_ deg => ", $obj->bearing($_), "n" foreach (12,45,78,133);
print "Compass: ", join(":", $obj->data),"n";
CONSTRUCTOR
new
The new() constructor may be called with any parameter that is appropriate to the set method.
my $obj = Compass::Bearing->new();
METHODS
bearing
Method returns a text string based on bearing
my $bearing=$obj->bearing($degrees_from_north);
bearing_rad
Method returns a text string based on bearing
my $bearing=$obj->bearing_rad($radians_from_north);
set
Method sets and returns key for the bearing text data structure.
my $key=$self->set;
my $key=$self->set(1);
my $key=$self->set(2);
my $key=$self->set(3); #default value
data
Method returns an array of text values.
my $data=$self->data;
Download (0.020MB)
Added: 2007-05-16 License: Perl Artistic License Price:
895 downloads
Tk::HyperText 0.05
Tk::HyperText can create and manipulate ROText widgets which render HTML code. more>>
Tk::HyperText can create and manipulate ROText widgets which render HTML code.
SYNOPSIS
my $hypertext = $mw->Scrolled ("HyperText",
-scrollbars => e,
-wrap => word,
-linkcommand => &onLink, # what to do when links are clicked
-titlecommand => &onTitle, # what to do when
<<lessSYNOPSIS
my $hypertext = $mw->Scrolled ("HyperText",
-scrollbars => e,
-wrap => word,
-linkcommand => &onLink, # what to do when links are clicked
-titlecommand => &onTitle, # what to do when
Download (0.034MB)
Added: 2007-08-02 License: Perl Artistic License Price:
813 downloads
SNMP::Persist 0.05
SNMP::Persist is a Perl module for the SNMP pass_persist threaded backend. more>>
SNMP::Persist is a Perl module for the SNMP pass_persist threaded backend.
SYNOPSIS
use SNMP::Persist qw(&define_oid &start_persister &define_subtree);
use strict;
use warnings;
#define base oid to host the subtree
define_oid(".1.3.6.1.4.1.2021.248");
#start the thread serving answers
start_persister();
#set first application number
#loop forever to update the values
while(1) {
my %subtree;
my $gameName;
my $index=1; #set first application number
foreach $gameName ("game1", "game2") { #for each application
$subtree{"1." . $index}=["INTEGER",$index]; #set game index data pair
$subtree{"2." . $index}=["STRING",$gameName]; #set game name data pair
$subtree{"3." . $index}=["Counter32", 344.2 ]; #set total memory data pair
$index++; #next application
}
#new values have arrived - notify the subtree controller
define_subtree(%subtree);
#dont update for next 5 minutes
sleep(300);
}
<<lessSYNOPSIS
use SNMP::Persist qw(&define_oid &start_persister &define_subtree);
use strict;
use warnings;
#define base oid to host the subtree
define_oid(".1.3.6.1.4.1.2021.248");
#start the thread serving answers
start_persister();
#set first application number
#loop forever to update the values
while(1) {
my %subtree;
my $gameName;
my $index=1; #set first application number
foreach $gameName ("game1", "game2") { #for each application
$subtree{"1." . $index}=["INTEGER",$index]; #set game index data pair
$subtree{"2." . $index}=["STRING",$gameName]; #set game name data pair
$subtree{"3." . $index}=["Counter32", 344.2 ]; #set total memory data pair
$index++; #next application
}
#new values have arrived - notify the subtree controller
define_subtree(%subtree);
#dont update for next 5 minutes
sleep(300);
}
Download (0.006MB)
Added: 2007-04-19 License: Perl Artistic License Price:
919 downloads
Gtk2::TrayManager 0.05
Gtk2::TrayManager is a Perl bindings for EggTrayManager. more>>
Gtk2::TrayManager is a Perl bindings for EggTrayManager.
SYNOPSIS
use Gtk2 -init;
use Gtk2::TrayManager;
my $screen = Gtk2::Gdk::Screen->get_default;
if (Gtk2::TrayManager->check_running($screen)) {
print STDERR "A tray manager is already running, sorry!n";
exit 256;
}
my $tray = Gtk2::TrayManager->new;
$tray->manage_screen($screen);
$tray->set_orientation(vertical);
$tray->signal_connect(tray_icon_added, sub {
# $_[1] is a Gtk2::Socket
});
$tray->signal_connect(tray_icon_removed, sub {
# $_[1] is a Gtk2::Socket
});
The EggTrayManager library is used internally by GNOME to implement the server-side of the Notification Area (or system tray) protocol. Gtk2::TrayManager allows you to create notification area applications using Gtk2-Perl.
<<lessSYNOPSIS
use Gtk2 -init;
use Gtk2::TrayManager;
my $screen = Gtk2::Gdk::Screen->get_default;
if (Gtk2::TrayManager->check_running($screen)) {
print STDERR "A tray manager is already running, sorry!n";
exit 256;
}
my $tray = Gtk2::TrayManager->new;
$tray->manage_screen($screen);
$tray->set_orientation(vertical);
$tray->signal_connect(tray_icon_added, sub {
# $_[1] is a Gtk2::Socket
});
$tray->signal_connect(tray_icon_removed, sub {
# $_[1] is a Gtk2::Socket
});
The EggTrayManager library is used internally by GNOME to implement the server-side of the Notification Area (or system tray) protocol. Gtk2::TrayManager allows you to create notification area applications using Gtk2-Perl.
Download (0.011MB)
Added: 2006-07-18 License: Perl Artistic License Price:
1195 downloads
Sort::Half::Maker 0.03
Sort::Half::Maker is a Perl module to create half-sort subs easily. more>>
Sort::Half::Maker is a Perl module to create half-sort subs easily.
SYNOPSIS
use Sort::Half::Maker qw(make_halfsort);
$sub = make_halfsort(
start => [ qw(x y z) ],
end => [ qw(a b c) ],
fallback => sub { $_[0] cmp $_[1] },
);
@list = sort $sub qw(a y f h w z b t x);
# qw(x y z f h t w a b)
Before anything, what it a half-sort?
A half-sort is a sort subroutine defined by a starting list, an ending list and an ordinary sort subroutine. Elements in the starting list always go first in comparison to others and keep the original order. Elements in the ending list always go last in comparison to others and keep their original order. The remaining elements are sorted via the given ordinary sort subroutine.
An example, please?
Imagine we want to sort the list of key/value pairs of a hash, such that qw(name version abstract license author) come first and qw(meta-spec) comes last, using case-insensitive comparison in-between. With this module, this is done so:
$sub = make_halfsort(
start => [ qw(name version abstract license author) ],
end => [ qw(meta-spec) ],
fallback => sub { lc $_[0] cmp lc $_[1] }
);
my @pairs = map { ($_, $h{$_}) } sort $sub keys(%h);
Why is it good for?
I dont see many uses for it. I played with the concept while writing a patch to improve META.yml generation by ExtUtils::MakeMaker. There we wanted to dump some keys (like name, version, abstract, license, author) before and then the ones the module author provided as extra information.
FUNCTIONS
make_halfsort
$sub = make_halfsort(start => @start_list,
end => @end_list,
fallback => &sort_sub
);
@sorted = sort $sub @unsorted;
Builds a sort subroutine which can be used with sort. It splits the sorted list into (possibly) three partitions: the elements contained in @start_list, the elements contained in @end_list and the remaining ones. For the elements in @start_list and @end_list, the list order is preserved. For the remaining ones, the given sort sub (or the default) is used.
If fallback is ommited, it defaults to use the sort sub sub ($$) { $_[0] cmp $_[1] }.
The arguments start or end may be ommited as well. But if you omit both, you could have done it without a half-sort.
<<lessSYNOPSIS
use Sort::Half::Maker qw(make_halfsort);
$sub = make_halfsort(
start => [ qw(x y z) ],
end => [ qw(a b c) ],
fallback => sub { $_[0] cmp $_[1] },
);
@list = sort $sub qw(a y f h w z b t x);
# qw(x y z f h t w a b)
Before anything, what it a half-sort?
A half-sort is a sort subroutine defined by a starting list, an ending list and an ordinary sort subroutine. Elements in the starting list always go first in comparison to others and keep the original order. Elements in the ending list always go last in comparison to others and keep their original order. The remaining elements are sorted via the given ordinary sort subroutine.
An example, please?
Imagine we want to sort the list of key/value pairs of a hash, such that qw(name version abstract license author) come first and qw(meta-spec) comes last, using case-insensitive comparison in-between. With this module, this is done so:
$sub = make_halfsort(
start => [ qw(name version abstract license author) ],
end => [ qw(meta-spec) ],
fallback => sub { lc $_[0] cmp lc $_[1] }
);
my @pairs = map { ($_, $h{$_}) } sort $sub keys(%h);
Why is it good for?
I dont see many uses for it. I played with the concept while writing a patch to improve META.yml generation by ExtUtils::MakeMaker. There we wanted to dump some keys (like name, version, abstract, license, author) before and then the ones the module author provided as extra information.
FUNCTIONS
make_halfsort
$sub = make_halfsort(start => @start_list,
end => @end_list,
fallback => &sort_sub
);
@sorted = sort $sub @unsorted;
Builds a sort subroutine which can be used with sort. It splits the sorted list into (possibly) three partitions: the elements contained in @start_list, the elements contained in @end_list and the remaining ones. For the elements in @start_list and @end_list, the list order is preserved. For the remaining ones, the given sort sub (or the default) is used.
If fallback is ommited, it defaults to use the sort sub sub ($$) { $_[0] cmp $_[1] }.
The arguments start or end may be ommited as well. But if you omit both, you could have done it without a half-sort.
Download (0.004MB)
Added: 2007-08-08 License: Perl Artistic License Price:
807 downloads
Tie::Trace 0.05
Tie::Trace can easy print debugging with tie. more>>
Tie::Trace can easy print debugging with tie.
SYNOPSIS
use Tie::Trace;
my %hash;
tie %hash, "Tie::Trace";
$hash{hoge} = hogehoge; # warn Hash => Key: hoge, Value: hogehgoe at ...
my @array;
tie @aray, "Tie::Trace";
push @array, "array"; # warn Array => Point: 0, Value: array at ...
my $scalar;
tie $scalar, "Tie::Trace";
$scalar = "scalar"; # warn Scalar => Value: scalar at ...
This is usefull for print debugging. Using tie mechanism, you can see sotred value for the specified variable.
If the stored value is scalar/array/hash ref, this can check recursively.
for example;
tie %hash, "Tie::Trace";
$hash{foo} = {a => 1, b => 2}; # warn ...
$hash{foo}->{a} = 2 # warn ...
But This ignores blessed reference and tied value.
<<lessSYNOPSIS
use Tie::Trace;
my %hash;
tie %hash, "Tie::Trace";
$hash{hoge} = hogehoge; # warn Hash => Key: hoge, Value: hogehgoe at ...
my @array;
tie @aray, "Tie::Trace";
push @array, "array"; # warn Array => Point: 0, Value: array at ...
my $scalar;
tie $scalar, "Tie::Trace";
$scalar = "scalar"; # warn Scalar => Value: scalar at ...
This is usefull for print debugging. Using tie mechanism, you can see sotred value for the specified variable.
If the stored value is scalar/array/hash ref, this can check recursively.
for example;
tie %hash, "Tie::Trace";
$hash{foo} = {a => 1, b => 2}; # warn ...
$hash{foo}->{a} = 2 # warn ...
But This ignores blessed reference and tied value.
Download (0.008MB)
Added: 2007-08-10 License: Perl Artistic License Price:
807 downloads
Secleted [ 0 ] software to compare
Copyright Notice:
Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future software development. The above maker 0.05 search only lists software in full, demo and trial versions for free download. Download links are directly from our mirror sites or publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed