class maker
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 2695
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
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
Class::Adapter 1.02
Class::Adapter is a Perl implementation of the Adapter Design Pattern. more>>
Class::Adapter is a Perl implementation of the "Adapter" Design Pattern.
The Class::Adapter class is intended as an abstract base class for creating any sort of class or object that follows the Adapter pattern.
What is an Adapter?
The term Adapter refers to a "Design Pattern" of the same name, from the famous "Gang of Four" book "Design Patterns". Although their original implementation was designed for Java and similar single-inheritance strictly-typed langauge, the situation for which it applies is still valid.
An Adapter in this Perl sense of the term is when a class is created to achieve by composition (objects containing other object) something that cant be achieved by inheritance (sub-classing).
This is similar to the Decorator pattern, but is intended to be applied on a class-by-class basis, as opposed to being able to be applied one object at a time, as is the case with the Decorator pattern.
The Class::Adapter object holds a parent object that it "wraps", and when a method is called on the Class::Adapter, it manually calls the same (or different) method with the same (or different) parameters on the parent object contained within it.
Instead of these custom methods being hooked in on an object-by-object basis, they are defined at the class level.
Basically, a Class::Adapter is one of your fall-back positions when Perls inheritance model fails you, or is no longer good enough, and you need to do something twisty in order to make several APIs play nicely with each other.
What can I do with the actual Class::Adapter class
Well... nothing really. It exist to provide some extremely low level fundamental methods, and to provide a common base for inheritance of Adapter classes.
The base Class::Adapter class doesnt even implement a way to push method calls through to the underlying object, since the way in which that happens is the bit that changes from case to case.
To actually DO something, you probably want to go take a look at Class::Adapter::Builder, which makes the creation of Adapter classes relatively quick and easy.
<<lessThe Class::Adapter class is intended as an abstract base class for creating any sort of class or object that follows the Adapter pattern.
What is an Adapter?
The term Adapter refers to a "Design Pattern" of the same name, from the famous "Gang of Four" book "Design Patterns". Although their original implementation was designed for Java and similar single-inheritance strictly-typed langauge, the situation for which it applies is still valid.
An Adapter in this Perl sense of the term is when a class is created to achieve by composition (objects containing other object) something that cant be achieved by inheritance (sub-classing).
This is similar to the Decorator pattern, but is intended to be applied on a class-by-class basis, as opposed to being able to be applied one object at a time, as is the case with the Decorator pattern.
The Class::Adapter object holds a parent object that it "wraps", and when a method is called on the Class::Adapter, it manually calls the same (or different) method with the same (or different) parameters on the parent object contained within it.
Instead of these custom methods being hooked in on an object-by-object basis, they are defined at the class level.
Basically, a Class::Adapter is one of your fall-back positions when Perls inheritance model fails you, or is no longer good enough, and you need to do something twisty in order to make several APIs play nicely with each other.
What can I do with the actual Class::Adapter class
Well... nothing really. It exist to provide some extremely low level fundamental methods, and to provide a common base for inheritance of Adapter classes.
The base Class::Adapter class doesnt even implement a way to push method calls through to the underlying object, since the way in which that happens is the bit that changes from case to case.
To actually DO something, you probably want to go take a look at Class::Adapter::Builder, which makes the creation of Adapter classes relatively quick and easy.
Download (0.024MB)
Added: 2007-06-20 License: Perl Artistic License Price:
856 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
Class::Inner 0.1
Class::Inner is a perlish implementation of Java like inner classes. more>>
Class::Inner is a perlish implementation of Java like inner classes.
SYNOPSIS
use Class::Inner;
my $object = Class::Inner->new(
parent => ParentClass,
methods => { method => sub { ... } }, },
constructor => new,
args => [@constructor_args],
);
Yet another implementation of an anonymous class with per object overrideable methods, but with the added attraction of sort of working dispatch to the parent classs method.
METHODS
new HASH
Takes a hash like argument list with the following keys.
parent
The name of the parent class. Note that you can only get single inheritance with this or SUPER wont work.
methods
A hash, keys are method names, values are CODEREFs.
constructor
The name of the constructor method. Defaults to new.
args
An anonymous array of arguments to pass to the constructor. Defaults to an empty list.
Returns an object in an anonymous class which inherits from the parent class. This anonymous class has a couple of extra methods:
SUPER
If you were to pass something like
$obj = Class::Inner->new(
parent => Parent,
methods => { method => sub { ...; $self->SUPER::method(@_) } },
);
then $self-gtSUPER::method almost certainly wouldnt do what you expect, so we provide the SUPER method which dispatches to the parent implementation of the current method. There seems to be no good way of getting the full SUPER:: functionality, but Im working on it.
DESTROY
Because Class::Inner works by creating a whole new class name for your object, it could potentially leak memory if you create a lot of them. So we add a DESTROY method that removes the class from the symbol table once its finished with.
If you need to override a parents DESTROY method, adding a call to Class::Inner::clean_symbol_table(ref $self) to it. Do it at the end of the method or your other method calls wont work.
clean_symbol_table
The helper subroutine that DESTROY uses to remove the class from the symbol table.
new_classname
Returns a name for the next anonymous class.
<<lessSYNOPSIS
use Class::Inner;
my $object = Class::Inner->new(
parent => ParentClass,
methods => { method => sub { ... } }, },
constructor => new,
args => [@constructor_args],
);
Yet another implementation of an anonymous class with per object overrideable methods, but with the added attraction of sort of working dispatch to the parent classs method.
METHODS
new HASH
Takes a hash like argument list with the following keys.
parent
The name of the parent class. Note that you can only get single inheritance with this or SUPER wont work.
methods
A hash, keys are method names, values are CODEREFs.
constructor
The name of the constructor method. Defaults to new.
args
An anonymous array of arguments to pass to the constructor. Defaults to an empty list.
Returns an object in an anonymous class which inherits from the parent class. This anonymous class has a couple of extra methods:
SUPER
If you were to pass something like
$obj = Class::Inner->new(
parent => Parent,
methods => { method => sub { ...; $self->SUPER::method(@_) } },
);
then $self-gtSUPER::method almost certainly wouldnt do what you expect, so we provide the SUPER method which dispatches to the parent implementation of the current method. There seems to be no good way of getting the full SUPER:: functionality, but Im working on it.
DESTROY
Because Class::Inner works by creating a whole new class name for your object, it could potentially leak memory if you create a lot of them. So we add a DESTROY method that removes the class from the symbol table once its finished with.
If you need to override a parents DESTROY method, adding a call to Class::Inner::clean_symbol_table(ref $self) to it. Do it at the end of the method or your other method calls wont work.
clean_symbol_table
The helper subroutine that DESTROY uses to remove the class from the symbol table.
new_classname
Returns a name for the next anonymous class.
Download (0.003MB)
Added: 2007-06-06 License: Perl Artistic License Price:
871 downloads
Class::Meta 0.53
Class::Meta is a Perl class automation, introspection, and data validation. more>>
Class::Meta is a Perl class automation, introspection, and data validation.
SYNOPSIS
Generate a class:
package MyApp::Thingy;
use strict;
use Class::Meta;
use Class::Meta::Types::String;
use Class::Meta::Types::Numeric;
BEGIN {
# Create a Class::Meta object for this class.
my $cm = Class::Meta->new( key => thingy );
# Add a constructor.
$cm->add_constructor(
name => new,
create => 1,
);
# Add a couple of attributes with generated methods.
$cm->add_attribute(
name => uuid,
authz => Class::Meta::READ,
type => string,
required => 1,
default => sub { Data::UUID->new->create_str },
);
$cm->add_attribute(
name => name,
is => string,
required => 1,
default => undef,
);
$cm->add_attribute(
name => age,
is => integer,
default => undef,
);
# Add a custom method.
$cm->add_method(
name => chk_pass,
view => Class::Meta::PUBLIC,
);
$cm->build;
}
Then use the class:
use MyApp::Thingy;
my $thingy = MyApp::Thingy->new;
print "ID: ", $thingy->id, $/;
$thingy->name(Larry);
print "Name: ", $thingy->name, $/;
$thingy->age(42);
print "Age: ", $thingy->age, $/;
Or make use of the introspection API:
use MyApp::Thingy;
my $class = MyApp::Thingy->my_class;
my $thingy;
print "Examining object of class ", $class->package, $/;
print "nConstructors:n";
for my $ctor ($class->constructors) {
print " o ", $ctor->name, $/;
$thingy = $ctor->call($class->package);
}
print "nAttributes:n";
for my $attr ($class->attributes) {
print " o ", $attr->name, " => ", $attr->get($thingy), $/;
if ($attr->authz >= Class::Meta::SET && $attr->type eq string) {
$attr->get($thingy, hey there!);
print " Changed to: ", $attr->get($thingy), $/;
}
}
print "nMethods:n";
for my $meth ($class->methods) {
print " o ", $meth->name, $/;
$meth->call($thingy);
}
Class::Meta provides an interface for automating the creation of Perl classes with attribute data type validation. It differs from other such modules in that it includes an introspection API that can be used as a unified interface for all Class::Meta-generated classes. In this sense, it is an implementation of the "Facade" design pattern.
<<lessSYNOPSIS
Generate a class:
package MyApp::Thingy;
use strict;
use Class::Meta;
use Class::Meta::Types::String;
use Class::Meta::Types::Numeric;
BEGIN {
# Create a Class::Meta object for this class.
my $cm = Class::Meta->new( key => thingy );
# Add a constructor.
$cm->add_constructor(
name => new,
create => 1,
);
# Add a couple of attributes with generated methods.
$cm->add_attribute(
name => uuid,
authz => Class::Meta::READ,
type => string,
required => 1,
default => sub { Data::UUID->new->create_str },
);
$cm->add_attribute(
name => name,
is => string,
required => 1,
default => undef,
);
$cm->add_attribute(
name => age,
is => integer,
default => undef,
);
# Add a custom method.
$cm->add_method(
name => chk_pass,
view => Class::Meta::PUBLIC,
);
$cm->build;
}
Then use the class:
use MyApp::Thingy;
my $thingy = MyApp::Thingy->new;
print "ID: ", $thingy->id, $/;
$thingy->name(Larry);
print "Name: ", $thingy->name, $/;
$thingy->age(42);
print "Age: ", $thingy->age, $/;
Or make use of the introspection API:
use MyApp::Thingy;
my $class = MyApp::Thingy->my_class;
my $thingy;
print "Examining object of class ", $class->package, $/;
print "nConstructors:n";
for my $ctor ($class->constructors) {
print " o ", $ctor->name, $/;
$thingy = $ctor->call($class->package);
}
print "nAttributes:n";
for my $attr ($class->attributes) {
print " o ", $attr->name, " => ", $attr->get($thingy), $/;
if ($attr->authz >= Class::Meta::SET && $attr->type eq string) {
$attr->get($thingy, hey there!);
print " Changed to: ", $attr->get($thingy), $/;
}
}
print "nMethods:n";
for my $meth ($class->methods) {
print " o ", $meth->name, $/;
$meth->call($thingy);
}
Class::Meta provides an interface for automating the creation of Perl classes with attribute data type validation. It differs from other such modules in that it includes an introspection API that can be used as a unified interface for all Class::Meta-generated classes. In this sense, it is an implementation of the "Facade" design pattern.
Download (0.060MB)
Added: 2006-10-05 License: Perl Artistic License Price:
1114 downloads
Class.Jabber.PHP 0.4
Class.Jabber.PHP provides a medium-level API to interact with the Jabber network. more>>
Class.Jabber.PHP provides a medium-level API to interact with the Jabber network.
Class.Jabber.PHP is a class which you can use to connect to the Jabber network. It allows you to easily connect to a server and interact with it. It supports all packet types (message, iq, and presence), is very flexible, and offers both high-level methods (registration, message sending, etc.) and low-level methods (packet sending, etc.).
The problem with current IM solutions is that they are all proprietary and cannot talk to each other. Jabber seeks to get rid of those barriers by allowing a Jabber client to talk with an AOL user, or an IRC chat room, or any number of other programs.
Class.Jabber.PHP a PHP class that provides a PHP Developer access to the Jabber protocol. Using this OOP class, I provide a clean interface to writing anything from a full client to a simple protocol tester.
<<lessClass.Jabber.PHP is a class which you can use to connect to the Jabber network. It allows you to easily connect to a server and interact with it. It supports all packet types (message, iq, and presence), is very flexible, and offers both high-level methods (registration, message sending, etc.) and low-level methods (packet sending, etc.).
The problem with current IM solutions is that they are all proprietary and cannot talk to each other. Jabber seeks to get rid of those barriers by allowing a Jabber client to talk with an AOL user, or an IRC chat room, or any number of other programs.
Class.Jabber.PHP a PHP class that provides a PHP Developer access to the Jabber protocol. Using this OOP class, I provide a clean interface to writing anything from a full client to a simple protocol tester.
Download (0.016MB)
Added: 2007-02-27 License: GPL (GNU General Public License) Price:
976 downloads
Class::Date 1.1.9
Class::Date provides a date datatype for Perl. more>>
Class::Date is a perl module, which provides a simple date type for perl.
You can create new Class::Date objects with a constructor from different scalar formats, array refs, and hash refs, and then you can easily manipulate it by the builtin "+" and "-" operators (e.g., $date=date([2001,03,15])+3Y 1s). Relative date types also available.
Enhancements:
- This release adds "ampm" and "meridiam" methods.
<<lessYou can create new Class::Date objects with a constructor from different scalar formats, array refs, and hash refs, and then you can easily manipulate it by the builtin "+" and "-" operators (e.g., $date=date([2001,03,15])+3Y 1s). Relative date types also available.
Enhancements:
- This release adds "ampm" and "meridiam" methods.
Download (0.034MB)
Added: 2006-05-15 License: GPL (GNU General Public License) Price:
1257 downloads
Class::Container 0.12
Class::Container is a Perl module with Glues object frameworks together transparently. more>>
Class::Container is a Perl module with Glues object frameworks together transparently.
SYNOPSIS
package Car;
use Class::Container;
@ISA = qw(Class::Container);
__PACKAGE__->valid_params
(
paint => {default => burgundy},
style => {default => coupe},
windshield => {isa => Glass},
radio => {isa => Audio::Device},
);
__PACKAGE__->contained_objects
(
windshield => Glass::Shatterproof,
wheel => { class => Vehicle::Wheel,
delayed => 1 },
radio => Audio::MP3,
);
sub new {
my $package = shift;
# windshield and radio objects are created automatically by
# SUPER::new()
my $self = $package->SUPER::new(@_);
$self->{right_wheel} = $self->create_delayed_object(wheel);
... do any more initialization here ...
return $self;
}
This class facilitates building frameworks of several classes that inter-operate. It was first designed and built for HTML::Mason, in which the Compiler, Lexer, Interpreter, Resolver, Component, Buffer, and several other objects must create each other transparently, passing the appropriate parameters to the right class, possibly substituting other subclasses for any of these objects.
The main features of Class::Container are:
Explicit declaration of containment relationships (aggregation, factory creation, etc.)
Declaration of constructor parameters accepted by each member in a class framework
Transparent passing of constructor parameters to the class that needs them
Ability to create one (automatic) or many (manual) contained objects automatically and transparently
<<lessSYNOPSIS
package Car;
use Class::Container;
@ISA = qw(Class::Container);
__PACKAGE__->valid_params
(
paint => {default => burgundy},
style => {default => coupe},
windshield => {isa => Glass},
radio => {isa => Audio::Device},
);
__PACKAGE__->contained_objects
(
windshield => Glass::Shatterproof,
wheel => { class => Vehicle::Wheel,
delayed => 1 },
radio => Audio::MP3,
);
sub new {
my $package = shift;
# windshield and radio objects are created automatically by
# SUPER::new()
my $self = $package->SUPER::new(@_);
$self->{right_wheel} = $self->create_delayed_object(wheel);
... do any more initialization here ...
return $self;
}
This class facilitates building frameworks of several classes that inter-operate. It was first designed and built for HTML::Mason, in which the Compiler, Lexer, Interpreter, Resolver, Component, Buffer, and several other objects must create each other transparently, passing the appropriate parameters to the right class, possibly substituting other subclasses for any of these objects.
The main features of Class::Container are:
Explicit declaration of containment relationships (aggregation, factory creation, etc.)
Declaration of constructor parameters accepted by each member in a class framework
Transparent passing of constructor parameters to the class that needs them
Ability to create one (automatic) or many (manual) contained objects automatically and transparently
Download (0.019MB)
Added: 2006-10-06 License: Perl Artistic License Price:
1113 downloads
El Jay Icon Maker 0.6
El Jay Icon Maker is a Firefox extension that allows you to right click on any image and create an icon for use with livejournal more>>
El Jay Icon Maker is a Firefox extension that allows you to right click on any image and create an icon for use with livejournal.com There are two options to choose from when making an icon "Create Icon Instantly" and "Create Icon With Options".
Selecting either link redirects you to the El Jay icon maker home page where you can rotate, crop, add text and borders to the image. The El Jay icon maker was made for use with llivejournal.com, but can be used on any site that requires an image smaller than 100x100 for an icon.
This is not a support forum, if you have questions or problems please go here: http://www.livejournal.com/users/lechatron/407511.html?mode=reply
<<lessSelecting either link redirects you to the El Jay icon maker home page where you can rotate, crop, add text and borders to the image. The El Jay icon maker was made for use with llivejournal.com, but can be used on any site that requires an image smaller than 100x100 for an icon.
This is not a support forum, if you have questions or problems please go here: http://www.livejournal.com/users/lechatron/407511.html?mode=reply
Download (0.005MB)
Added: 2007-05-30 License: MPL (Mozilla Public License) Price:
1060 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
TagCloud Maker Class 1.0
TagCloud Maker Class is a class that takes a single dimensional array of terms and outputs a piece of HTML with each term. more>>
TagCloud Maker Class is a class that takes a single dimensional array of terms and outputs a piece of HTML with each term wrapped in a span tag with an ID that you can define in your CSS.
TagCloud Maker Class script can be called either as an object or as a static class.
Check out the example page. The keywords from the sample page come from the last 30 entries of my blog. Ill admit I cheated and just open the database and pull them from there instead of trying to call my blog w/curl or fopen and parse it. (Although that would have been cooler.) I then ran each blog entry against Yahoos Term Extraction API to get the terms. Then I pumped that array into my new TagCloud maker. The important code you cant see from the index.php is below.
require_once(TagCloud.php);
$x = TagCloud::fetch_cloud($thisArray,...,tagcloud_,http://www.technorati.com/tags/%s);
$o = new TagCloud($thisArray,...,tagcloud_,http://www.technorati.com/tags/%s,10,weight,2);
$o->get_cloud();
$y = $o->output_cloud;
As you can see, I used 2 different methods of creating the 2 lists. The first is just calling the object::method statically with all the necessary parameters. This is by far the easiest way to use this class and unless you need something special, its the way I recommend. The second way it to instantiate an object. I pass all the variables into the constructor but you could just as easily use the setters to set them all. (dont know why you would but hey, I spent an extra 15 minutes creating getters and setters so use them, by all means use them!)
<<lessTagCloud Maker Class script can be called either as an object or as a static class.
Check out the example page. The keywords from the sample page come from the last 30 entries of my blog. Ill admit I cheated and just open the database and pull them from there instead of trying to call my blog w/curl or fopen and parse it. (Although that would have been cooler.) I then ran each blog entry against Yahoos Term Extraction API to get the terms. Then I pumped that array into my new TagCloud maker. The important code you cant see from the index.php is below.
require_once(TagCloud.php);
$x = TagCloud::fetch_cloud($thisArray,...,tagcloud_,http://www.technorati.com/tags/%s);
$o = new TagCloud($thisArray,...,tagcloud_,http://www.technorati.com/tags/%s,10,weight,2);
$o->get_cloud();
$y = $o->output_cloud;
As you can see, I used 2 different methods of creating the 2 lists. The first is just calling the object::method statically with all the necessary parameters. This is by far the easiest way to use this class and unless you need something special, its the way I recommend. The second way it to instantiate an object. I pass all the variables into the constructor but you could just as easily use the setters to set them all. (dont know why you would but hey, I spent an extra 15 minutes creating getters and setters so use them, by all means use them!)
Download (0.012MB)
Added: 2006-01-25 License: GPL (GNU General Public License) Price:
1380 downloads
Class::Driver 0.005
Class::Driver is a Perl module to generate driver (composite) class hierarchies on-the-fly. more>>
EXAMPLE
# This is a really long synopsis, but hopefully it will give you an idea...
package MyPackage;
use Class::Driver;
use base q(Class::Driver);
our %drivers;
return 1;
sub new {
my($class, %args) = @_;
die "mime_type is required" unless($args{mime_type});
die "no driver to handle type $args{mime_type}"
unless($drivers{$args{mime_type}});
return $class->driver_load($drivers{$args{mime_type}}, %args);
}
sub driver_new {
my($class, %args) = @_;
return bless %args, $class;
}
sub driver_required { 1; }
sub driver_requied_here { 0; }
package MyPackage::avi;
use MyPackage;
use base q(MyPackage);
use Video::Info;
$MyPackage::drivers{video/x-msvideo} = avi;
return 1;
sub driver { "avi"; }
sub driver_new {
my($class, %args) = @_;
die "file is a required parameter for $args{mime_type} files"
unless($args{file});
$args{info} = Video::Info->new(-file => $args{file})
or die "Failed to create a Video::Info object for $args{file}";
return $class->SUPER::driver_new(%args);
}
sub duration {
my $self = shift;
return $args{info}->duration;
}
package MyPackage::mp3;
use base q(MyPackage);
use MP3::Info;
$MyPackage::drivers{audio/mpeg} = mp3;
## (etc...)
package main;
my $foo = MyPackage->new(file => foobar.mp3, mime_type => audio/mpeg);
print "foobar.mp3 is ", $foo->duration, " seconds long.n";
Download (0.011MB)
Added: 2006-11-14 License: Perl Artistic License Price:
1075 downloads
Class::CGI 0.20
Class::CGI is a Perl module to fetch objects from your CGI object. more>>
Class::CGI is a Perl module to fetch objects from your CGI object.
SYNOPSIS
use Class::CGI
handlers => {
customer_id => My::Customer::Handler
};
my $cgi = Class::CGI->new;
my $customer = $cgi->param(customer_id);
my $name = $customer->name;
my $email = $cgi->param(email); # behaves like normal
if ( my %errors = $cgi->errors ) {
# do error handling
}
For small CGI scripts, its common to get a parameter, untaint it, pass it to an object constructor and get the object back. This module would allow one to to build Class::CGI handler classes which take the parameter value, automatically perform those steps and just return the object. Much grunt work goes away and you can get back to merely pretending to work.
<<lessSYNOPSIS
use Class::CGI
handlers => {
customer_id => My::Customer::Handler
};
my $cgi = Class::CGI->new;
my $customer = $cgi->param(customer_id);
my $name = $customer->name;
my $email = $cgi->param(email); # behaves like normal
if ( my %errors = $cgi->errors ) {
# do error handling
}
For small CGI scripts, its common to get a parameter, untaint it, pass it to an object constructor and get the object back. This module would allow one to to build Class::CGI handler classes which take the parameter value, automatically perform those steps and just return the object. Much grunt work goes away and you can get back to merely pretending to work.
Download (0.017MB)
Added: 2006-10-20 License: Perl Artistic License Price:
1099 downloads
Class::XML 0.06
Class::XML is a Perl module for simple XML Abstraction. more>>
Class::XML is a Perl module for simple XML Abstraction.
SYNOPSIS
package Foo;
use base qw/Class::XML/;
__PACKAGE__->has_attributes(qw/length colour/);
__PACKAGE__->has_child(bar => Bar);
package Bar;
use base qw/Class::XML/;
__PACKAGE__->has_parent(foo);
__PACKAGE__->has_attribute(counter);
# Meanwhile, in another piece of code -
my $foo = Foo->new( xml => # Or filename or ioref or parser
qq!< foo length="3m" colour="pink" >< bar / >< /foo >! );
$foo->length; # Returns "3m"
$foo->colour("purple"); # Sets colour to purple
print $foo; # Outputs
my $new_bar = new Bar; # Creates empty Bar node
$new_bar->counter("formica");
$foo->bar($new_bar); # Replaces child
$new_bar->foo->colour; # Returns "purple"
$foo->colour(undef); # Deletes colour attribute
print $foo; # Outputs < foo length="3m" >< bar counter="formica" / >< /foo >
Class::XML is designed to make it reasonably easy to create, consume or modify XML from Perl while thinking in terms of Perl objects rather than the available XML APIs; it was written out of a mixture of frustration that JAXB (for Java) and XMLSerializer (for .Net) provided programming capabilities that simply werent easy to do in Perl with the existing modules, and the sheer pleasure that Ive had using Class::DBI.
The aim is to provide a convenient abstraction layer that allows you to put as much of your logic as you like into methods on a class tree, then throw some XML at that tree and get back a tree of objects to work with. It should also be easy to get started with for anybody familiar with Class::DBI (although I doubt you could simply switch them due to the impedance mismatch between XML and relational data) and be pleasant to use from the Template Toolkit.
Finally, all Class::XML objects are also XML::XPath nodes so the full power of XPath is available to you if Class::XML doesnt provide a shortcut to what youre trying to do (but if you find it doesnt on a regular basis, contact me and Ill see if I can fix that.
<<lessSYNOPSIS
package Foo;
use base qw/Class::XML/;
__PACKAGE__->has_attributes(qw/length colour/);
__PACKAGE__->has_child(bar => Bar);
package Bar;
use base qw/Class::XML/;
__PACKAGE__->has_parent(foo);
__PACKAGE__->has_attribute(counter);
# Meanwhile, in another piece of code -
my $foo = Foo->new( xml => # Or filename or ioref or parser
qq!< foo length="3m" colour="pink" >< bar / >< /foo >! );
$foo->length; # Returns "3m"
$foo->colour("purple"); # Sets colour to purple
print $foo; # Outputs
my $new_bar = new Bar; # Creates empty Bar node
$new_bar->counter("formica");
$foo->bar($new_bar); # Replaces child
$new_bar->foo->colour; # Returns "purple"
$foo->colour(undef); # Deletes colour attribute
print $foo; # Outputs < foo length="3m" >< bar counter="formica" / >< /foo >
Class::XML is designed to make it reasonably easy to create, consume or modify XML from Perl while thinking in terms of Perl objects rather than the available XML APIs; it was written out of a mixture of frustration that JAXB (for Java) and XMLSerializer (for .Net) provided programming capabilities that simply werent easy to do in Perl with the existing modules, and the sheer pleasure that Ive had using Class::DBI.
The aim is to provide a convenient abstraction layer that allows you to put as much of your logic as you like into methods on a class tree, then throw some XML at that tree and get back a tree of objects to work with. It should also be easy to get started with for anybody familiar with Class::DBI (although I doubt you could simply switch them due to the impedance mismatch between XML and relational data) and be pleasant to use from the Template Toolkit.
Finally, all Class::XML objects are also XML::XPath nodes so the full power of XPath is available to you if Class::XML doesnt provide a shortcut to what youre trying to do (but if you find it doesnt on a regular basis, contact me and Ill see if I can fix that.
Download (0.018MB)
Added: 2006-09-07 License: Perl Artistic License Price:
1142 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 class maker 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