dance classes
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 2604
C++ Foundation Classes 0.1.4
C++ Foundation Classes package contains a Fully Overloaded String object that works with other classes. more>>
The C++ Foundation Classes package contains a Fully Overloaded String object that works with other classes (even those not owned by CFC), a full (template) Matrix and Vector Object, some Data types like DateTime, Boolean, Integer, Real, and Complex, and Sets, Stack, Queues, etc. C++ Foundation Classes also has an LL-type Parser and Scanner for lexical reading.
Installation:
The simplest way to compile this package is:
1. `cd to the directory containing the packages source code and type `./configure to configure the package for your system. If youre using `csh on an old version of System V, you might need to type `sh ./configure instead to prevent `csh from trying to execute `configure itself.
Running `configure takes awhile. While running, it prints some messages telling which features it is checking for.
2. Type `make to compile the package.
3. Optionally, type `make check to run any self-tests that come with the package.
4. Type `make install to install the programs and any data files and documentation.
5. You can remove the program binaries and object files from the source code directory by typing `make clean. To also remove the files that `configure created (so you can compile the package for a different kind of computer), type `make distclean. There is also a `make maintainer-clean target, but that is intended mainly for the packages developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution.
<<lessInstallation:
The simplest way to compile this package is:
1. `cd to the directory containing the packages source code and type `./configure to configure the package for your system. If youre using `csh on an old version of System V, you might need to type `sh ./configure instead to prevent `csh from trying to execute `configure itself.
Running `configure takes awhile. While running, it prints some messages telling which features it is checking for.
2. Type `make to compile the package.
3. Optionally, type `make check to run any self-tests that come with the package.
4. Type `make install to install the programs and any data files and documentation.
5. You can remove the program binaries and object files from the source code directory by typing `make clean. To also remove the files that `configure created (so you can compile the package for a different kind of computer), type `make distclean. There is also a `make maintainer-clean target, but that is intended mainly for the packages developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution.
Download (1.2MB)
Added: 2005-11-17 License: GPL (GNU General Public License) Price:
1440 downloads
Perl6::Classes 0.22
Perl6::Classes project contains first class classes in Perl 5. more>>
Perl6::Classes project contains first class classes in Perl 5.
SYNOPSIS
use Perl6::Classes;
class Composer {
submethod BUILD { print "Giving birth to a new composern" }
method compose { print "Writing some music...n" }
}
class ClassicalComposer is Composer {
method compose { print "Writing some muzak...n" }
}
class ModernComposer is Composer {
submethod BUILD($) { $.length = shift }
method compose() { print((map { int rand 10 } 1..$.length), "n") }
has $.length;
}
my $beethoven = new ClassicalComposer;
my $barber = new ModernComposer 4;
my $mahler = ModernComposer->new(400);
$beethoven->compose; # Writing some muzak...
$barber->compose # 7214
compose $mahler; # 89275869347968374698756....
Perl6::Classes allows the creation of (somewhat) Perl 6-style classes in Perl 5. The following features are currently supported:
subs, methods, and submethods
And their respective scoping rules.
Attributes
Which are available through the has keyword, and look like $.this.
Inheritance
Both single and multiple inheritance are available through the is keyword.
Signatures
Signatures on methods, subs, and submethods are supported, but just the Perl 5 kind.
Data hiding
Using the public, protected, and private traits, you can enforce (run-time) data hiding. This is not supported on attributes, which are always private.
Anonymous classes
That respect closures. You can now nest them inside methods of other classes, even other anonymous ones!
The Perl6::Classes module augments Perls syntax with a new declarator: class. It offers the advantage over Perls standard OO mechanism that it is conceptually easier to see (especially for those from a C++/Java background). It offers the disadvantage, of course, of being less versatile.
<<lessSYNOPSIS
use Perl6::Classes;
class Composer {
submethod BUILD { print "Giving birth to a new composern" }
method compose { print "Writing some music...n" }
}
class ClassicalComposer is Composer {
method compose { print "Writing some muzak...n" }
}
class ModernComposer is Composer {
submethod BUILD($) { $.length = shift }
method compose() { print((map { int rand 10 } 1..$.length), "n") }
has $.length;
}
my $beethoven = new ClassicalComposer;
my $barber = new ModernComposer 4;
my $mahler = ModernComposer->new(400);
$beethoven->compose; # Writing some muzak...
$barber->compose # 7214
compose $mahler; # 89275869347968374698756....
Perl6::Classes allows the creation of (somewhat) Perl 6-style classes in Perl 5. The following features are currently supported:
subs, methods, and submethods
And their respective scoping rules.
Attributes
Which are available through the has keyword, and look like $.this.
Inheritance
Both single and multiple inheritance are available through the is keyword.
Signatures
Signatures on methods, subs, and submethods are supported, but just the Perl 5 kind.
Data hiding
Using the public, protected, and private traits, you can enforce (run-time) data hiding. This is not supported on attributes, which are always private.
Anonymous classes
That respect closures. You can now nest them inside methods of other classes, even other anonymous ones!
The Perl6::Classes module augments Perls syntax with a new declarator: class. It offers the advantage over Perls standard OO mechanism that it is conceptually easier to see (especially for those from a C++/Java background). It offers the disadvantage, of course, of being less versatile.
Download (0.007MB)
Added: 2007-06-08 License: Perl Artistic License Price:
868 downloads
Rauls classes for PHP 0.6.3
Rauls classes for PHP is an OOP database abstraction layer for PHP 5.1 or greater. more>>
Rauls classes for PHP is an OOP database abstraction layer for PHP 5.1 or greater. Rauls classes for PHP provides abstract classes to access database servers and traverse result sets.
There are several implementation classes to access different types of databases: SQLite, MySQL, PostgreSQL, and MSSQL.
The classes provide functions to establish connections, execute queries, traverse result sets with pagination support, and retrieve the list of databases, tables and fields. Any possible error is signaled by throwing exceptions with specific message and error code.
Enhancements:
- A quickref.txt file was added to the project.
- A totalRows get property was included for SQL result objects.
- A third optional parameter was added to the printPageSelect method in order to return the page < select > code as an string instead of printing it.
<<lessThere are several implementation classes to access different types of databases: SQLite, MySQL, PostgreSQL, and MSSQL.
The classes provide functions to establish connections, execute queries, traverse result sets with pagination support, and retrieve the list of databases, tables and fields. Any possible error is signaled by throwing exceptions with specific message and error code.
Enhancements:
- A quickref.txt file was added to the project.
- A totalRows get property was included for SQL result objects.
- A third optional parameter was added to the printPageSelect method in order to return the page < select > code as an string instead of printing it.
Download (0.050MB)
Added: 2006-06-08 License: MIT/X Consortium License Price:
1235 downloads
Objective-C Foundation Classes 0.7.1
Objective-C Foundation Classes is an Objective-C library. more>>
Objective-C Foundation Classes is an Objective-C library.
It contains general purpose classes for easier development of applications, in areas such as data types, network, C library wrappers, collections, and compound classes.
The classes in the library are grouped in five clusters:
- DataTypes - integer, text string, fraction, bitarray, date/time, random generators, big integer, big double ...
- Collections - array, list, hash table, AVL and n-tree, circular array, graph ...
- Network - TCP/UDP server and client, HTTP client, Telnet client ...
- C-library wrappers - DBM, socket, MD5, regular expression, timer, file, directory, gzip and bzip2 file, text screen ...
- Compound - Argument parser, calendar, finite state machine, tokenizer, XML tree, discrete distribution, objective-c source tokenizer ...
Enhancements:
- A new class (DBigFraction) and a new protocol (DBitArithmetic) have been added to the library.
- There are also several bugfixes related to 64-bit platforms.
- The copy-constructor support has been improved, and as a result all collections can now be (deep) copied.
- There are some small bugfixes, and several classes have been extended with new methods.
<<lessIt contains general purpose classes for easier development of applications, in areas such as data types, network, C library wrappers, collections, and compound classes.
The classes in the library are grouped in five clusters:
- DataTypes - integer, text string, fraction, bitarray, date/time, random generators, big integer, big double ...
- Collections - array, list, hash table, AVL and n-tree, circular array, graph ...
- Network - TCP/UDP server and client, HTTP client, Telnet client ...
- C-library wrappers - DBM, socket, MD5, regular expression, timer, file, directory, gzip and bzip2 file, text screen ...
- Compound - Argument parser, calendar, finite state machine, tokenizer, XML tree, discrete distribution, objective-c source tokenizer ...
Enhancements:
- A new class (DBigFraction) and a new protocol (DBitArithmetic) have been added to the library.
- There are also several bugfixes related to 64-bit platforms.
- The copy-constructor support has been improved, and as a result all collections can now be (deep) copied.
- There are some small bugfixes, and several classes have been extended with new methods.
Download (0.74MB)
Added: 2006-07-27 License: GPL (GNU General Public License) Price:
1196 downloads
classes::Test 0.942
classes::Test are functions to help with classes pragma testing. more>>
classes::Test are functions to help with classes pragma testing.
SYNOPSIS
can_new
can_set_get
has_decl
has_class_const
has_mixins
has_mixins_hash
is_classes MyClass;
is_classes main;
is_throwable X::Mine;
is_classes_exc X::Mine;
Generic tests based on Test::Builder designed to help write unit tests for code that uses the classes pragma.
<<lessSYNOPSIS
can_new
can_set_get
has_decl
has_class_const
has_mixins
has_mixins_hash
is_classes MyClass;
is_classes main;
is_throwable X::Mine;
is_classes_exc X::Mine;
Generic tests based on Test::Builder designed to help write unit tests for code that uses the classes pragma.
Download (0.16MB)
Added: 2006-10-31 License: Perl Artistic License Price:
1088 downloads
Dynamic Probe Class Library 3.4.3
Dynamic Probe Class Library (DPCL) is an object-based C++ class library. more>>
Dynamic Probe Class Library (DPCL) is an object-based C++ class library that provides the necessary infrastructure to allow tool developers and sophisticated tool users to build parallel and serial tools through technology called dynamic instrumentation.
Dynamic Probe Class Library takes the basic components needed by tool developers and encapsulates them into C++ classes. Each of these classes provide the member functions necessary to interact and dynamically instrument a running application with software patches called probes.
Dynamic instrumentation provides the flexibility for tools to insert probes into applications as the application is running and only where it is needed.
Enhancements:
- This version is a minor update to DPCL that fixes a couple problems that have been reported since the v3.4.2 release
<<lessDynamic Probe Class Library takes the basic components needed by tool developers and encapsulates them into C++ classes. Each of these classes provide the member functions necessary to interact and dynamically instrument a running application with software patches called probes.
Dynamic instrumentation provides the flexibility for tools to insert probes into applications as the application is running and only where it is needed.
Enhancements:
- This version is a minor update to DPCL that fixes a couple problems that have been reported since the v3.4.2 release
Download (2.5MB)
Added: 2006-07-28 License: GPL (GNU General Public License) Price:
1185 downloads
Runtime Java Class Editor 1.0
Runtime Java Class Editor is a tool for editing loaded (running) Java classes and much more. more>>
RJCE allows all methods or variables of user defined classes to be altered at runtime. These alterations are then applied to a single instance, a collection of instances (i.e. list, set or map), or an entire class.
This helps you to test your application in an interactive way; altering running programs helping a trial and error approach to programming; testing code and saving it when its correct. Long running algorithms, such as simulations, can also easily be refined without the need for restarts or lose of data.
RJCE can be used to write a program from within itself ensuring high coupling between testing and development, with no delay before the outcome of any alterations.
RJCE allows scripts to run from within your application, allowing users to configure or extend an application dynamically, bypassing normal language access rules controlled by public, private and protected. This can be done by easily instatiating an instance of CodeEditorFrame from the rom.gui package.
RJCE permits faster development of applications by allowing easy migration from scripts to Java programs.
<<lessThis helps you to test your application in an interactive way; altering running programs helping a trial and error approach to programming; testing code and saving it when its correct. Long running algorithms, such as simulations, can also easily be refined without the need for restarts or lose of data.
RJCE can be used to write a program from within itself ensuring high coupling between testing and development, with no delay before the outcome of any alterations.
RJCE allows scripts to run from within your application, allowing users to configure or extend an application dynamically, bypassing normal language access rules controlled by public, private and protected. This can be done by easily instatiating an instance of CodeEditorFrame from the rom.gui package.
RJCE permits faster development of applications by allowing easy migration from scripts to Java programs.
Download (3.1MB)
Added: 2005-04-18 License: BSD License Price:
1713 downloads
Nameko 20070620 (Low Level Classes)
Nameko was born as a simple PHP webmail. more>>
Nameko was born as a simple PHP webmail. Now Nameko is much more than this: its a set of classes to manage e-mail with PHP.
The project can retrieve message from a POP3 server, parse e-mails, send email through SMTP server, and so on.
The mail parser was totally rewritten from the original version: now its greatly improved, and it can read every kind of email.
The Nameko webmail has also been totally rewritten: now it has a great interface, fast, powerful, with a lot of advanced tools.
Each component of the webmail is customizable, with a sort of plug-ins system: you can add only the plug-ins for the functions you really need.
The basic version on Nameko is always a one-file script: so simple tu set up!
Enhancements:
- This release include great performance improvements, making parsing also of heavy email (> 50MB) much faster.
- It includes some code cleanup and small bugfixes.
<<lessThe project can retrieve message from a POP3 server, parse e-mails, send email through SMTP server, and so on.
The mail parser was totally rewritten from the original version: now its greatly improved, and it can read every kind of email.
The Nameko webmail has also been totally rewritten: now it has a great interface, fast, powerful, with a lot of advanced tools.
Each component of the webmail is customizable, with a sort of plug-ins system: you can add only the plug-ins for the functions you really need.
The basic version on Nameko is always a one-file script: so simple tu set up!
Enhancements:
- This release include great performance improvements, making parsing also of heavy email (> 50MB) much faster.
- It includes some code cleanup and small bugfixes.
Download (0.020MB)
Added: 2007-06-22 License: GPL (GNU General Public License) Price:
859 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::Std 0.0.8
Class::Std is a Perl module to support for creating standard inside-out classes. more>>
Class::Std is a Perl module to support for creating standard "inside-out" classes.
SYNOPSIS
package MyClass;
use Class::Std;
# Create storage for object attributes...
my %name : ATTR;
my %rank : ATTR;
my %snum : ATTR;
my %public_data : ATTR;
# Handle initialization of objects of this class...
sub BUILD {
my ($self, $obj_ID, $arg_ref) = @_;
$name{$obj_ID} = check_name( $arg_ref->{name} );
$rank{$obj_ID} = check_rank( $arg_ref->{rank} );
$snum{$obj_ID} = _gen_uniq_serial_num();
}
# Handle cleanup of objects of this class...
sub DEMOLISH {
my ($self, $obj_ID) = @_;
_recycle_serial_num( $snum{$obj_ID} );
}
# Handle unknown method calls...
sub AUTOMETHOD {
my ($self, $obj_ID, @other_args) = @_;
# Return any public data...
if ( m/A get_(.*)/ ) { # Method name passed in $_
my $get_what = $1;
return sub {
return $public_data{$obj_ID}{$get_what};
}
}
warn "Cant call $method_name on ", ref $self, " object";
return; # The call is declined by not returning a sub ref
}
This module provides tools that help to implement the "inside out object" class structure in a convenient and standard way.
<<lessSYNOPSIS
package MyClass;
use Class::Std;
# Create storage for object attributes...
my %name : ATTR;
my %rank : ATTR;
my %snum : ATTR;
my %public_data : ATTR;
# Handle initialization of objects of this class...
sub BUILD {
my ($self, $obj_ID, $arg_ref) = @_;
$name{$obj_ID} = check_name( $arg_ref->{name} );
$rank{$obj_ID} = check_rank( $arg_ref->{rank} );
$snum{$obj_ID} = _gen_uniq_serial_num();
}
# Handle cleanup of objects of this class...
sub DEMOLISH {
my ($self, $obj_ID) = @_;
_recycle_serial_num( $snum{$obj_ID} );
}
# Handle unknown method calls...
sub AUTOMETHOD {
my ($self, $obj_ID, @other_args) = @_;
# Return any public data...
if ( m/A get_(.*)/ ) { # Method name passed in $_
my $get_what = $1;
return sub {
return $public_data{$obj_ID}{$get_what};
}
}
warn "Cant call $method_name on ", ref $self, " object";
return; # The call is declined by not returning a sub ref
}
This module provides tools that help to implement the "inside out object" class structure in a convenient and standard way.
Download (0.030MB)
Added: 2006-09-26 License: Perl Artistic License Price:
1124 downloads
Test::Class 0.24
Test::Class is a Perl module that allows you to easily create test classes in an xUnit/JUnit style. more>>
Test::Class is a Perl module that allows you to easily create test classes in an xUnit/JUnit style.
SYNOPSIS
package Example::Test;
use base qw(Test::Class);
use Test::More;
# setup methods are run before every test method.
sub make_fixture : Test(setup) {
my $array = [1, 2];
shift->{test_array} = $array;
};
# a test method that runs 1 test
sub test_push : Test {
my $array = shift->{test_array};
push @$array, 3;
is_deeply($array, [1, 2, 3], push worked);
};
# a test method that runs 4 tests
sub test_pop : Test(4) {
my $array = shift->{test_array};
is(pop @$array, 2, pop = 2);
is(pop @$array, 1, pop = 1);
is_deeply($array, [], array empty);
is(pop @$array, undef, pop = undef);
};
# teardown methods are run after every test method.
sub teardown : Test(teardown) {
my $array = shift->{test_array};
diag("array = (@$array) after test(s)");
};
later in a nearby .t file
#! /usr/bin/perl
use Example::Test;
# run all the test methods in Example::Test
Test::Class->runtests;
Outputs:
1..5
ok 1 - pop = 2
ok 2 - pop = 1
ok 3 - array empty
ok 4 - pop = undef
# array = () after test(s)
ok 5 - push worked
# array = (1 2 3) after test(s)
<<lessSYNOPSIS
package Example::Test;
use base qw(Test::Class);
use Test::More;
# setup methods are run before every test method.
sub make_fixture : Test(setup) {
my $array = [1, 2];
shift->{test_array} = $array;
};
# a test method that runs 1 test
sub test_push : Test {
my $array = shift->{test_array};
push @$array, 3;
is_deeply($array, [1, 2, 3], push worked);
};
# a test method that runs 4 tests
sub test_pop : Test(4) {
my $array = shift->{test_array};
is(pop @$array, 2, pop = 2);
is(pop @$array, 1, pop = 1);
is_deeply($array, [], array empty);
is(pop @$array, undef, pop = undef);
};
# teardown methods are run after every test method.
sub teardown : Test(teardown) {
my $array = shift->{test_array};
diag("array = (@$array) after test(s)");
};
later in a nearby .t file
#! /usr/bin/perl
use Example::Test;
# run all the test methods in Example::Test
Test::Class->runtests;
Outputs:
1..5
ok 1 - pop = 2
ok 2 - pop = 1
ok 3 - array empty
ok 4 - pop = undef
# array = () after test(s)
ok 5 - push worked
# array = (1 2 3) after test(s)
Download (0.046MB)
Added: 2007-06-13 License: Perl Artistic License Price:
863 downloads
Class::Bits 0.05
Class::Bits is a Perl module with class wrappers around bit vectors. more>>
Class::Bits is a Perl module with class wrappers around bit vectors.
SYNOPSIS
package MyClass;
use Class::Bits;
make_bits( a => 4, # 0..15
b => 1, # 0..1
c => 1, # 0..1
d => 2, # 0..3
e => s4 # -8..7
f => s1 # -1..0
);
package;
$o=MyClass->new(a=>12, d=>2);
print "o->b is ", $o->b, "n";
print "bit vector is ", unpack("h*", $$o), "n";
$o2=$o->new();
$o3=MyClass->new($string);
ABSTRACT
Class::Bits creates class wrappers around bit vectors.
Class::Bits defines classes using bit vectors as storage.
Object attributes are stored in bit fields inside the bit vector. Bit field sizes have to be powers of 2 (1, 2, 4, 8, 16 or 32).
There is a class constructor subroutine:
make_bits( field1 => size1, field2 => size2, ...)
exports in the calling package a ctor, accessor methods, some utility methods and some constants:
Sizes can be prefixed by s or u to define signedness of the field. Default is unsigned.
$class->new()
creates a new object with all zeros.
$class->new($bitvector)
creates a new object over $bitvector.
$class->new(%fields)
creates a new object and initializes its fields with the values in %fields.
$obj->new()
clones an object.
$obj->$field()
$obj->$field($value)
gets or sets the value of the bit field $field inside the bit vector.
$class->length
$obj->lenght
returns the size in bits of the bit vector used for storage.
$class->keys
$obj->keys
returns an array with the names of the object attributes
$obj->as_hash
returns a flatten hash with the object attributes, i.e.:
my %values=$obj->as_hash;
%INDEX
hash with offsets as used by vec perl operator (to get an offset in bits, the value has to be multiplied by the corresponding bit field size).
%SIZES
hash with bit field sizes in bits.
%SIGNED
hash with signedness of the fields
Bit fields are packed in the bit vector in the order specified as arguments to make_bits.
Bit fields are padded inside the bit vector, i.e. a class created like
make_bits(A=>1, B=>2, C=>1, D=>4, E=>8, F=>16);
will have the layout
AxBBCxxx DDDDxxxx EEEEEEEE xxxxxxxx FFFFFFFF FFFFFFFF
<<lessSYNOPSIS
package MyClass;
use Class::Bits;
make_bits( a => 4, # 0..15
b => 1, # 0..1
c => 1, # 0..1
d => 2, # 0..3
e => s4 # -8..7
f => s1 # -1..0
);
package;
$o=MyClass->new(a=>12, d=>2);
print "o->b is ", $o->b, "n";
print "bit vector is ", unpack("h*", $$o), "n";
$o2=$o->new();
$o3=MyClass->new($string);
ABSTRACT
Class::Bits creates class wrappers around bit vectors.
Class::Bits defines classes using bit vectors as storage.
Object attributes are stored in bit fields inside the bit vector. Bit field sizes have to be powers of 2 (1, 2, 4, 8, 16 or 32).
There is a class constructor subroutine:
make_bits( field1 => size1, field2 => size2, ...)
exports in the calling package a ctor, accessor methods, some utility methods and some constants:
Sizes can be prefixed by s or u to define signedness of the field. Default is unsigned.
$class->new()
creates a new object with all zeros.
$class->new($bitvector)
creates a new object over $bitvector.
$class->new(%fields)
creates a new object and initializes its fields with the values in %fields.
$obj->new()
clones an object.
$obj->$field()
$obj->$field($value)
gets or sets the value of the bit field $field inside the bit vector.
$class->length
$obj->lenght
returns the size in bits of the bit vector used for storage.
$class->keys
$obj->keys
returns an array with the names of the object attributes
$obj->as_hash
returns a flatten hash with the object attributes, i.e.:
my %values=$obj->as_hash;
%INDEX
hash with offsets as used by vec perl operator (to get an offset in bits, the value has to be multiplied by the corresponding bit field size).
%SIZES
hash with bit field sizes in bits.
%SIGNED
hash with signedness of the fields
Bit fields are packed in the bit vector in the order specified as arguments to make_bits.
Bit fields are padded inside the bit vector, i.e. a class created like
make_bits(A=>1, B=>2, C=>1, D=>4, E=>8, F=>16);
will have the layout
AxBBCxxx DDDDxxxx EEEEEEEE xxxxxxxx FFFFFFFF FFFFFFFF
Download (0.004MB)
Added: 2007-07-30 License: Perl Artistic License Price:
816 downloads
Class::Classless 1.35
Class::Classless is a Perl framework for classless OOP. more>>
Class::Classless is a Perl framework for classless OOP.
SYNOPSIS
use strict;
use Class::Classless;
my $ob1 = $Class::Classless::ROOT->clone;
$ob1->{NAME} = Ob1;
$ob1->{stuff} = 123;
$ob1->{Thing} = 789;
my $ob2 = $ob1->clone;
$ob2->{NAME} = Ob2;
printf "ob1 stuff: n", $ob1->{stuff};
printf "ob2 stuff: n", $ob2->{stuff};
printf "ob1 Thing: n", $ob1->{Thing};
printf "ob2 Thing: n", $ob2->{Thing};
$ob1->{METHODS}{zaz} = sub {
print "Zaz! on ", $_[0]{NAME}, "n";
};
$ob1->zaz;
$ob2->zaz;
$ob1->EXAMINE;
$ob2->EXAMINE;
This prints the following:
ob1 stuff: < 123 >
ob2 stuff: < 123 >
ob1 Thing: < 789 >
ob2 Thing: < >
Zaz! on Ob1
Zaz! on Ob2
< Class::Classless::X=HASH(0x200236f4) >
stuff, 123,
NAME, Ob1,
Thing, 789,
METHODS, { zaz, CODE(0x20068360) },
PARENTS, [ ROOT ],
< Class::Classless::X=HASH(0x2002cb48) >
stuff, 123,
NAME, Ob2,
METHODS, { },
PARENTS, [ Ob1 ],
In class-based OOP frameworks, methods are applicable to objects by virtue of objects belonging to classes that either provide those methods, or inherit them from classes that do.
In classless OOP frameworks (AKA delegation-and-prototypes frameworks), what methods an object is capable of is basically an attribute of that object. That is, in Perl terms: instead of methods being entries in the symbol table of the package/class the object belongs to, they are entries in a hash table inside the object. Inheritance is implemented not by having classes inheriting from other classes (via ISA lists), but by having objects inherit from other objects (via PARENTS lists).
In class-based OOP frameworks, you get new objects by calling constructors. In a classless framework, you get new objects by copying ("cloning") an existing object -- and the new clone becomes a child (inheritor) of the original object. (Where do you get the one original object? The language provides one, which has no parents, and which contains some general purpose methods like "clone".)
<<lessSYNOPSIS
use strict;
use Class::Classless;
my $ob1 = $Class::Classless::ROOT->clone;
$ob1->{NAME} = Ob1;
$ob1->{stuff} = 123;
$ob1->{Thing} = 789;
my $ob2 = $ob1->clone;
$ob2->{NAME} = Ob2;
printf "ob1 stuff: n", $ob1->{stuff};
printf "ob2 stuff: n", $ob2->{stuff};
printf "ob1 Thing: n", $ob1->{Thing};
printf "ob2 Thing: n", $ob2->{Thing};
$ob1->{METHODS}{zaz} = sub {
print "Zaz! on ", $_[0]{NAME}, "n";
};
$ob1->zaz;
$ob2->zaz;
$ob1->EXAMINE;
$ob2->EXAMINE;
This prints the following:
ob1 stuff: < 123 >
ob2 stuff: < 123 >
ob1 Thing: < 789 >
ob2 Thing: < >
Zaz! on Ob1
Zaz! on Ob2
< Class::Classless::X=HASH(0x200236f4) >
stuff, 123,
NAME, Ob1,
Thing, 789,
METHODS, { zaz, CODE(0x20068360) },
PARENTS, [ ROOT ],
< Class::Classless::X=HASH(0x2002cb48) >
stuff, 123,
NAME, Ob2,
METHODS, { },
PARENTS, [ Ob1 ],
In class-based OOP frameworks, methods are applicable to objects by virtue of objects belonging to classes that either provide those methods, or inherit them from classes that do.
In classless OOP frameworks (AKA delegation-and-prototypes frameworks), what methods an object is capable of is basically an attribute of that object. That is, in Perl terms: instead of methods being entries in the symbol table of the package/class the object belongs to, they are entries in a hash table inside the object. Inheritance is implemented not by having classes inheriting from other classes (via ISA lists), but by having objects inherit from other objects (via PARENTS lists).
In class-based OOP frameworks, you get new objects by calling constructors. In a classless framework, you get new objects by copying ("cloning") an existing object -- and the new clone becomes a child (inheritor) of the original object. (Where do you get the one original object? The language provides one, which has no parents, and which contains some general purpose methods like "clone".)
Download (0.023MB)
Added: 2007-07-19 License: Perl Artistic License Price:
827 downloads
Exception::Class 1.23
Exception::Class is a Perl module that allows you to declare real exception classes in Perl. more>>
Exception::Class is a Perl module that allows you to declare real exception classes in Perl.
SYNOPSIS
use Exception::Class
( MyException,
AnotherException =>
{ isa => MyException },
YetAnotherException =>
{ isa => AnotherException,
description => These exceptions are related to IPC },
ExceptionWithFields =>
{ isa => YetAnotherException,
fields => [ grandiosity, quixotic ],
alias => throw_fields,
},
);
# try
eval { MyException->throw( error => I feel funny. ) };
my $e;
# catch
if ( $e = Exception::Class->caught(MyException) )
{
warn $e->error, "n", $e->trace->as_string, "n";
warn join , $e->euid, $e->egid, $e->uid, $e->gid, $e->pid, $e->time;
exit;
}
elsif ( $e = Exception::Class->caught(ExceptionWithFields) )
{
$e->quixotic ? do_something_wacky() : do_something_sane();
}
else
{
$e = Exception::Class->caught();
ref $e ? $e->rethrow : die $e;
}
# use an alias - without parens subroutine name is checked at
# compile time
throw_fields error => "No strawberry", grandiosity => "quite a bit";
Exception::Class allows you to declare exception hierarchies in your modules in a "Java-esque" manner.
It features a simple interface allowing programmers to declare exception classes at compile time. It also has a base exception class, Exception::Class::Base, that can be easily extended.
It is designed to make structured exception handling simpler and better by encouraging people to use hierarchies of exceptions in their applications, as opposed to a single catch-all exception class.
This module does not implement any try/catch syntax. Please see the "OTHER EXCEPTION MODULES (try/catch syntax)" section for more information on how to get this syntax.
<<lessSYNOPSIS
use Exception::Class
( MyException,
AnotherException =>
{ isa => MyException },
YetAnotherException =>
{ isa => AnotherException,
description => These exceptions are related to IPC },
ExceptionWithFields =>
{ isa => YetAnotherException,
fields => [ grandiosity, quixotic ],
alias => throw_fields,
},
);
# try
eval { MyException->throw( error => I feel funny. ) };
my $e;
# catch
if ( $e = Exception::Class->caught(MyException) )
{
warn $e->error, "n", $e->trace->as_string, "n";
warn join , $e->euid, $e->egid, $e->uid, $e->gid, $e->pid, $e->time;
exit;
}
elsif ( $e = Exception::Class->caught(ExceptionWithFields) )
{
$e->quixotic ? do_something_wacky() : do_something_sane();
}
else
{
$e = Exception::Class->caught();
ref $e ? $e->rethrow : die $e;
}
# use an alias - without parens subroutine name is checked at
# compile time
throw_fields error => "No strawberry", grandiosity => "quite a bit";
Exception::Class allows you to declare exception hierarchies in your modules in a "Java-esque" manner.
It features a simple interface allowing programmers to declare exception classes at compile time. It also has a base exception class, Exception::Class::Base, that can be easily extended.
It is designed to make structured exception handling simpler and better by encouraging people to use hierarchies of exceptions in their applications, as opposed to a single catch-all exception class.
This module does not implement any try/catch syntax. Please see the "OTHER EXCEPTION MODULES (try/catch syntax)" section for more information on how to get this syntax.
Download (0.016MB)
Added: 2007-05-23 License: Perl Artistic License Price:
884 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 dance classes 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