condition
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 301
WeatherBug 1.0.0.2
WeatherBug is a Firefox extension that can get live, local weather conditions in Firefox web browser. more>>
WeatherBug is a Firefox extension that can get live, local weather conditions in Firefox web browser. Featuring forecasts, radar, and severe weather alerts from WeatherBugs community of neighborhood weather stations.
<<less Download (0.037MB)
Added: 2007-05-30 License: MPL (Mozilla Public License) Price:
559 downloads
Xfce 4 Weather Plugin 0.5.99.1
Xfce 4 Weather Plugin shows the current temperature and weather condition, using weather data provided by xoap.weather.com. more>> <<less
Download (0.56MB)
Added: 2007-03-07 License: GPL (GNU General Public License) Price:
572 downloads
CSS::SAC::ConditionFactory 0.06
CSS::SAC::ConditionFactory Perl module contains the default ConditionFactory. more>>
CSS::SAC::ConditionFactory Perl module contains the default ConditionFactory.
SYNOPSIS
my $cf = CSS::SAC::ConditionFactory->new;
my $cond1 = $cf->create_foo_condition;
my $cond2 = $cf->create_bar_condition;
This is the default ConditionFactory for CSS::SAC. It creates conditions of all types defined in SAC. You may wish to subclass or replace the default ConditionFactory in order to get your own condition objects.
I plan on adding more flexibility to this factory so that one could tell it the classes to use for various conditions, that would avoid enforcing subclassing/recoding for people that only want to replace a family of factory methods.
I know that some of the method names are quite lengthy, but given the great number of possible conditions it helps to have descriptive names.
METHODS
These define the interface that must be adhered to by ConditionFactories. The Java names (given in parens) work too, though the Perl ones are recommended.
CSS::SAC::ConditionFactory->new or $cf->new
Creates a new condition factory object.
$cf->create_and_condition($first,$second) (createAndCondition)
creates a combinator condition of type and
$cf->create_attribute_condition($lname,$ns,$specified,$value) (createAttributeCondition)
creates an attr condition
$cf->create_begin_hyphen_attribute_condition($lname,$ns,$specified,$value) (createBeginHyphenAttributeCondition)
creates a attr condition of type bh
$cf->create_class_condition($ns,$value) (createClassCondition)
creates a attr condition of type class
$cf->create_content_condition($data) (createContentCondition)
creates a content condition
$cf->create_id_condition($value) (createIdCondition)
creates a attr condition of type id
$cf->create_lang_condition($lang) (createLangCondition)
creates a lang condition
$cf->create_negative_condition($cond) (createNegativeCondition)
creates a negative condition
$cf->create_one_of_attribute_condition($lname,$ns,$specified,$value) (createOneOfAttributeCondition)
creates a attr condition of type id
$cf->create_only_child_condition() (createOnlyChildCondition)
creates a only-child condition
$cf->create_only_type_condition() (createOnlyTypeCondition)
creates a only-type condition
$cf->create_or_condition($first,$second) (createOrCondition)
creates a combinator condition of type or
$cf->create_positional_condition($position,$type_node,$same_type) (createPositionalCondition)
creates a positional condition
$cf->create_pseudo_class_condition($ns,$value) (createPseudoClassCondition)
creates a attr condition of type pseudo class
<<lessSYNOPSIS
my $cf = CSS::SAC::ConditionFactory->new;
my $cond1 = $cf->create_foo_condition;
my $cond2 = $cf->create_bar_condition;
This is the default ConditionFactory for CSS::SAC. It creates conditions of all types defined in SAC. You may wish to subclass or replace the default ConditionFactory in order to get your own condition objects.
I plan on adding more flexibility to this factory so that one could tell it the classes to use for various conditions, that would avoid enforcing subclassing/recoding for people that only want to replace a family of factory methods.
I know that some of the method names are quite lengthy, but given the great number of possible conditions it helps to have descriptive names.
METHODS
These define the interface that must be adhered to by ConditionFactories. The Java names (given in parens) work too, though the Perl ones are recommended.
CSS::SAC::ConditionFactory->new or $cf->new
Creates a new condition factory object.
$cf->create_and_condition($first,$second) (createAndCondition)
creates a combinator condition of type and
$cf->create_attribute_condition($lname,$ns,$specified,$value) (createAttributeCondition)
creates an attr condition
$cf->create_begin_hyphen_attribute_condition($lname,$ns,$specified,$value) (createBeginHyphenAttributeCondition)
creates a attr condition of type bh
$cf->create_class_condition($ns,$value) (createClassCondition)
creates a attr condition of type class
$cf->create_content_condition($data) (createContentCondition)
creates a content condition
$cf->create_id_condition($value) (createIdCondition)
creates a attr condition of type id
$cf->create_lang_condition($lang) (createLangCondition)
creates a lang condition
$cf->create_negative_condition($cond) (createNegativeCondition)
creates a negative condition
$cf->create_one_of_attribute_condition($lname,$ns,$specified,$value) (createOneOfAttributeCondition)
creates a attr condition of type id
$cf->create_only_child_condition() (createOnlyChildCondition)
creates a only-child condition
$cf->create_only_type_condition() (createOnlyTypeCondition)
creates a only-type condition
$cf->create_or_condition($first,$second) (createOrCondition)
creates a combinator condition of type or
$cf->create_positional_condition($position,$type_node,$same_type) (createPositionalCondition)
creates a positional condition
$cf->create_pseudo_class_condition($ns,$value) (createPseudoClassCondition)
creates a attr condition of type pseudo class
Download (0.037MB)
Added: 2007-06-20 License: Perl Artistic License Price:
856 downloads
Data::BenchmarkResults 0.01
Data::BenchmarkResults is a Perl extension for averaging and comparing multiple benchmark runs. more>>
Data::BenchmarkResults is a Perl extension for averaging and comparing multiple benchmark runs.
SYNOPSIS
use Data::BenchmarkResults;
$conditionA_results = new Data::BenchmarkResults;
$conditionB_results = new Data::BenchmarkResults;
#Load test result runs for the first condition
$conditionA_results->add_result_set("test1","run1",@data1);
$conditionA_results->add_result_set("test2","run1",@data2);
$conditionA_results->add_result_set("test1","run2",@data3);
$conditionA_results->add_result_set("test2","run2",@data4);
#Load test result runs for the second condition
$conditionB_results->add_result_set("test1","run1",@data5);
$conditionB_results->add_result_set("test2","run2",@data6);
$conditionB_results->add_result_set("test1","run1",@data7);
$conditionB_results->add_result_set("test2","run2",@data8);
#Average (mean average) the results of all the the runs of test1
# w/o tossing the highest and lowest values (replace the 0 with 1to
# toss the highest and lowest values
my $computed = $conditionA_results->process_result_set("test1","mean",0);
my $computed2 = $conditionB_results->process_result_set("test1","mean",0);
#OR process all of the tests at once (tossing the highest and lowest value) :
$conditionA_results->process_all_result_sets("mean",1);
$conditionB_results->process_all_result_sets("mean",1);
#Print out all of the processed test results
print "Condition A results.... nn"
$conditionA_results->print_calculated_sets;
print "Condition B results.... nn"
$conditionB_results->print_calculated_sets;
#Compare results of test1 of condition B against those with condition A
# as a percentage change from A to B
my $compared = $conditionB_results->compare_result_set($conditionA_results,"test1");
#OR compare all the processed test results from one condition to those of another
my $total_comparison = $conditionB_results->compare_all_result_sets($conditionA_results);
<<lessSYNOPSIS
use Data::BenchmarkResults;
$conditionA_results = new Data::BenchmarkResults;
$conditionB_results = new Data::BenchmarkResults;
#Load test result runs for the first condition
$conditionA_results->add_result_set("test1","run1",@data1);
$conditionA_results->add_result_set("test2","run1",@data2);
$conditionA_results->add_result_set("test1","run2",@data3);
$conditionA_results->add_result_set("test2","run2",@data4);
#Load test result runs for the second condition
$conditionB_results->add_result_set("test1","run1",@data5);
$conditionB_results->add_result_set("test2","run2",@data6);
$conditionB_results->add_result_set("test1","run1",@data7);
$conditionB_results->add_result_set("test2","run2",@data8);
#Average (mean average) the results of all the the runs of test1
# w/o tossing the highest and lowest values (replace the 0 with 1to
# toss the highest and lowest values
my $computed = $conditionA_results->process_result_set("test1","mean",0);
my $computed2 = $conditionB_results->process_result_set("test1","mean",0);
#OR process all of the tests at once (tossing the highest and lowest value) :
$conditionA_results->process_all_result_sets("mean",1);
$conditionB_results->process_all_result_sets("mean",1);
#Print out all of the processed test results
print "Condition A results.... nn"
$conditionA_results->print_calculated_sets;
print "Condition B results.... nn"
$conditionB_results->print_calculated_sets;
#Compare results of test1 of condition B against those with condition A
# as a percentage change from A to B
my $compared = $conditionB_results->compare_result_set($conditionA_results,"test1");
#OR compare all the processed test results from one condition to those of another
my $total_comparison = $conditionB_results->compare_all_result_sets($conditionA_results);
Download (0.009MB)
Added: 2007-08-16 License: Perl Artistic License Price:
799 downloads
Workflow::Factory 0.28
Workflow::Factory is a Perl module that generates new workflow and supporting objects. more>>
Workflow::Factory is a Perl module that generates new workflow and supporting objects.
SYNOPSIS
# Import the singleton for easy access
use Workflow::Factory qw( FACTORY );
# Add XML configurations to the factory
FACTORY->add_config_from_file( workflow => workflow.xml,
action => [ myactions.xml, otheractions.xml ],
validator => [ validator.xml, myvalidators.xml ],
condition => condition.xml,
persister => persister.xml );
# Create a new workflow of type MyWorkflow
my $wf = FACTORY->create_workflow( MyWorkflow );
# Fetch an existing workflow with ID 25
my $wf = FACTORY->fetch_workflow( MyWorkflow, 25 );
Public
The Workflow Factory is your primary interface to the workflow system. You give it the configuration files and/or data structures for the Workflow, Workflow::Action, Workflow::Condition, Workflow::Persister, and Workflow::Validator objects and then you ask it for new and existing Workflow objects.
Internal
Developers using the workflow system should be familiar with how the factory processes configurations and how it makes the various components of the system are instantiated and stored in the factory.
<<lessSYNOPSIS
# Import the singleton for easy access
use Workflow::Factory qw( FACTORY );
# Add XML configurations to the factory
FACTORY->add_config_from_file( workflow => workflow.xml,
action => [ myactions.xml, otheractions.xml ],
validator => [ validator.xml, myvalidators.xml ],
condition => condition.xml,
persister => persister.xml );
# Create a new workflow of type MyWorkflow
my $wf = FACTORY->create_workflow( MyWorkflow );
# Fetch an existing workflow with ID 25
my $wf = FACTORY->fetch_workflow( MyWorkflow, 25 );
Public
The Workflow Factory is your primary interface to the workflow system. You give it the configuration files and/or data structures for the Workflow, Workflow::Action, Workflow::Condition, Workflow::Persister, and Workflow::Validator objects and then you ask it for new and existing Workflow objects.
Internal
Developers using the workflow system should be familiar with how the factory processes configurations and how it makes the various components of the system are instantiated and stored in the factory.
Download (0.10MB)
Added: 2007-07-10 License: Perl Artistic License Price:
839 downloads
bzr-hudson 1.0 Beta 1
Bazaar plugin for Hudson more>>
bzr-hudson 1.0 Beta 1 offers you a perfect and helpful plugin which can allow the use of Bazaar as a build SCM in Hudson. With this plugin, you can designate a Bazaar branch as the "upstream" repository. Every build will update the local branch. Polling is also supported, it'll check if the upstream branch have any new revision and use this as the build triggering condition.
Requirements:
- Bazaar Revision Control System: bzr >= 1.9
- xmloutput >= 0.8.2
Added: 2009-01-28 License: GPL Price: FREE
14 downloads
Temperature.app 1.4
Temperature.app is a Window Maker applet which fetches local temperature information every 15 minutes. more>>
Temperature.app is a Window Maker applet which fetches local temperature information every 15 minutes from http://weather.noaa.gov and displays it (in Celsius or Fahrenheit).
Temperature.app program is licensed through the GNU General Public License.
Enhancements:
- Now fetching temperature information over http (instead of ftp).
- Fixed possible race condition when creating temporary files.
<<lessTemperature.app program is licensed through the GNU General Public License.
Enhancements:
- Now fetching temperature information over http (instead of ftp).
- Fixed possible race condition when creating temporary files.
Download (0.016MB)
Added: 2006-10-03 License: GPL (GNU General Public License) Price:
1130 downloads
Snow Path Formation Simulator 0.5.3
Snow Path Formation Simulator it graphically displays the formation of paths in the snow formed by people. more>>
Snow Path Formation Simulator is a program that models the process of people forming very distinct, and yet not always altogether logical looking, paths in the snow as they walk across open spaces.
The evolving condition of the snow is displayed graphically. This project may eventually mature into a screensaver.
<<lessThe evolving condition of the snow is displayed graphically. This project may eventually mature into a screensaver.
Download (0.10MB)
Added: 2005-04-25 License: GPL (GNU General Public License) Price:
1646 downloads
CCIDE 0.0.8-8
CCIDE is a tool that generates code from embedded decision tables. more>>
Ccide reads C, C++, BASIC, or bash source code containing embedded decision tables from stdin, expands the tables, copies the remaining statements, and forms a compilable C or C++ source module, executable bash script, or interpretable BASIC program.
Erratic side effects are avoided by evaluating all condition expressions at exactly the same time, and by performing all evaluations and actions in the original sequence.
Enhancements:
- Numerous fixes to BASH script generation.
- Added CC comment recognition: if //DECISION_TABLE: is encountered in a C program, use "//" for generated comments instead of /* .... */.
- Fixed standard C comment recognition and generation.
- Added environment variable, CCIDEW, to ccide script, to facillitate testing. If CCIDEW is empty, the ccide script will attempt to find the ccidew program and set the CCIDEW variable equal to its location; otherwise, the script will attempt to use the program at the CCIDEW location.
- Changed C program output from C++ style comments(//) to C style comments(/*...*/) to enhance portability.
- Added logic to suppress unnecessary condition evaluation (e.g. if there are only "Dont Care" entries in the condition statement).
- Added -p PREFIX option to substitute PREFIX for CCIDE in generated code.
- Added NEWGROUP in condition stub to replace ccide_group == $$.
- Eliminated unused case labels to reduce compiler warnings.
- Made some security enhancements.
- Replaced the typedef, CCIDE-BIT, with unsigned long.
- Added new target (make flaws) to Makefile for systems with flawfinder installed.
<<lessErratic side effects are avoided by evaluating all condition expressions at exactly the same time, and by performing all evaluations and actions in the original sequence.
Enhancements:
- Numerous fixes to BASH script generation.
- Added CC comment recognition: if //DECISION_TABLE: is encountered in a C program, use "//" for generated comments instead of /* .... */.
- Fixed standard C comment recognition and generation.
- Added environment variable, CCIDEW, to ccide script, to facillitate testing. If CCIDEW is empty, the ccide script will attempt to find the ccidew program and set the CCIDEW variable equal to its location; otherwise, the script will attempt to use the program at the CCIDEW location.
- Changed C program output from C++ style comments(//) to C style comments(/*...*/) to enhance portability.
- Added logic to suppress unnecessary condition evaluation (e.g. if there are only "Dont Care" entries in the condition statement).
- Added -p PREFIX option to substitute PREFIX for CCIDE in generated code.
- Added NEWGROUP in condition stub to replace ccide_group == $$.
- Eliminated unused case labels to reduce compiler warnings.
- Made some security enhancements.
- Replaced the typedef, CCIDE-BIT, with unsigned long.
- Added new target (make flaws) to Makefile for systems with flawfinder installed.
Download (0.049MB)
Added: 2005-04-22 License: GPL (GNU General Public License) Price:
1645 downloads
re2c 0.12.2 / 0.13.0
re2c is a tool for writing fast and flexible lexers. more>>
re2c is a tool for writing flexible and fast lexers. Unlike other such tools, it concentrates solely on generating efficient code for matching regular expressions.
This make it suitable for a wide variety of applications. The generated scanners approach hand-crafted ones in terms of size and speed.
Whats New in 0.13.0 Development Release:
- his brand new development version of re2c comes with initial support for (f)lex like conditions. That is, this version is the first step towards full condition support where re2c checks for a condition and based on that switches to a specific sub block handling only rules for that specific condition.
- This verison is fully compatible with older versions and in fact you need the new switches -c and -t to get condition support. Also a lot of new inplace configurations have been added.
- Check out the manual or man page for new stuff.
Whats New in 0.12.2 Stable Release:
- This new stable version of re2c fixes issue on Mac OS X. (See issue #1743180 fwrite with 0 length crashes on OS X).
<<lessThis make it suitable for a wide variety of applications. The generated scanners approach hand-crafted ones in terms of size and speed.
Whats New in 0.13.0 Development Release:
- his brand new development version of re2c comes with initial support for (f)lex like conditions. That is, this version is the first step towards full condition support where re2c checks for a condition and based on that switches to a specific sub block handling only rules for that specific condition.
- This verison is fully compatible with older versions and in fact you need the new switches -c and -t to get condition support. Also a lot of new inplace configurations have been added.
- Check out the manual or man page for new stuff.
Whats New in 0.12.2 Stable Release:
- This new stable version of re2c fixes issue on Mac OS X. (See issue #1743180 fwrite with 0 length crashes on OS X).
Download (0.12MB)
Added: 2007-06-27 License: MIT/X Consortium License Price:
854 downloads
sysfence 0.16
sysfence is a system resources guard for Linux. more>>
Sysfence project is a resource monitoring tool designed for Linux machines. While running as daemon it checks resource levels and makes desired action if some values exceed safety limits.
Main features:
- notifying system administrators when something goes wrong,
- stopping services when system performance is dropping too low and starting them when its going up again,
- periodically restarting memory-leaking processes,
- dumping system statistics in critical situations
Usage
Sysfence reads its configuration from file(s) specified in argument list. Config files may contain one or more rules describing conditions and actions to be performed.
Rule has syntax like this:
if {
resource1 > limit1
or
{ resource2 < limit2 and resource3 < limit3 }
}
run once command-to-be-run
The block enclosed within {} brackets describes condition. When its result is TRUE, following command is invoked.
The once keyword is optional. If present, the command is executed only once after condition becomes TRUE. Next execution will take place only if condition becomes FALSE and then TRUE again. Without once keyword, command is invoked periodically, after every resource check that gives TRUE, no matter what was the condition result before.
Command specified right after run keyword is passed to /bin/sh, so it may contain more than one instruction or even whole script. But be careful - rule checking is suspended unless command execution has been completed! (Other rules are unaffected.)
As resources, following ones can be given:
- la1 - load average during last minute.
- la5 - load average during last 5 minutes.
- la15 - load average during last 15 minutes.
- memfree - lower limit for free memory amount.
- memused - upper limit for memory used by processes.
- swapfree - lower limit for free swap space.
- swapused - upper limit for swap space in use.
Enhancements:
- This release contains bugfix for wrong memory levels recognition on non-vanilla kernels.
<<lessMain features:
- notifying system administrators when something goes wrong,
- stopping services when system performance is dropping too low and starting them when its going up again,
- periodically restarting memory-leaking processes,
- dumping system statistics in critical situations
Usage
Sysfence reads its configuration from file(s) specified in argument list. Config files may contain one or more rules describing conditions and actions to be performed.
Rule has syntax like this:
if {
resource1 > limit1
or
{ resource2 < limit2 and resource3 < limit3 }
}
run once command-to-be-run
The block enclosed within {} brackets describes condition. When its result is TRUE, following command is invoked.
The once keyword is optional. If present, the command is executed only once after condition becomes TRUE. Next execution will take place only if condition becomes FALSE and then TRUE again. Without once keyword, command is invoked periodically, after every resource check that gives TRUE, no matter what was the condition result before.
Command specified right after run keyword is passed to /bin/sh, so it may contain more than one instruction or even whole script. But be careful - rule checking is suspended unless command execution has been completed! (Other rules are unaffected.)
As resources, following ones can be given:
- la1 - load average during last minute.
- la5 - load average during last 5 minutes.
- la15 - load average during last 15 minutes.
- memfree - lower limit for free memory amount.
- memused - upper limit for memory used by processes.
- swapfree - lower limit for free swap space.
- swapused - upper limit for swap space in use.
Enhancements:
- This release contains bugfix for wrong memory levels recognition on non-vanilla kernels.
Download (0.039MB)
Added: 2006-04-30 License: GPL (GNU General Public License) Price:
1272 downloads
Modem.pl 0.15
Modem.pl is a small script that scrapes the web interface of a Motorola SURFboard cable modem for various status conditions more>>
Modem.pl is a small script that scrapes the web interface of a Motorola SURFboard cable modem for various status conditions like signal strength and signal to noise.
The results are sent to STDOUT where they can be easily piped into a log file. The modem values are also checked for reasonable operating ranges.
If the modem values are outside of reasonable operating ranges, results are also sent to STDERR. When run from a cron job, modem.pl can be used to monitor the condition of the cable service and notify someone before conditions cause service interruptions.
Main features:
- Captures operating conditions of a Motorola SURFboard cable modem.
- Runs interactively or from a scheduled job (cron)
- Output is formatted with a standard log time stamp when scheduled.
- Checks modem values for reasonable operating ranges.
- Errors and warnings are duplicated to STDERR.
<<lessThe results are sent to STDOUT where they can be easily piped into a log file. The modem values are also checked for reasonable operating ranges.
If the modem values are outside of reasonable operating ranges, results are also sent to STDERR. When run from a cron job, modem.pl can be used to monitor the condition of the cable service and notify someone before conditions cause service interruptions.
Main features:
- Captures operating conditions of a Motorola SURFboard cable modem.
- Runs interactively or from a scheduled job (cron)
- Output is formatted with a standard log time stamp when scheduled.
- Checks modem values for reasonable operating ranges.
- Errors and warnings are duplicated to STDERR.
Download (0.011MB)
Added: 2007-03-09 License: GPL (GNU General Public License) Price:
967 downloads
Qfsm 0.44
Qfsm project is a graphical editor for finite state machines written in C++ using Qt the graphical Toolkit from Trolltech. more>>
Qfsm project is a graphical editor for finite state machines written in C++ using Qt the graphical Toolkit from Trolltech.
Finite state machines are a model to describe complex objects or systems in terms of the states they may be in. In practice they can used to design integrated circuits or to create regular expressions, scanners or other program code.
Main features:
- Drawing, editing and printing of diagrams
- Binary, ASCII and "free text" condition codes
- Multiple windows
- Integrity check
- Interactive simulation
- AHDL/VHDL/Verilog HDL/KISS export
- State table export in Latex, HTML and plain text format
- Ragel file export (used for C/C++, Java or Ruby code generation)
Enhancements:
- English user documentation was written.
- The possibility of default transition was introduced.
- Ragel file export was added.
- The input condition "any" was introduced.
- The possibility to invert transition conditions was introduced.
- More arrow types were added.
- The "Free Text" type was added.
- The "print header" option was added.
<<lessFinite state machines are a model to describe complex objects or systems in terms of the states they may be in. In practice they can used to design integrated circuits or to create regular expressions, scanners or other program code.
Main features:
- Drawing, editing and printing of diagrams
- Binary, ASCII and "free text" condition codes
- Multiple windows
- Integrity check
- Interactive simulation
- AHDL/VHDL/Verilog HDL/KISS export
- State table export in Latex, HTML and plain text format
- Ragel file export (used for C/C++, Java or Ruby code generation)
Enhancements:
- English user documentation was written.
- The possibility of default transition was introduced.
- Ragel file export was added.
- The input condition "any" was introduced.
- The possibility to invert transition conditions was introduced.
- More arrow types were added.
- The "Free Text" type was added.
- The "print header" option was added.
Download (0.80MB)
Added: 2007-07-23 License: GPL (GNU General Public License) Price:
825 downloads
Games::Score 0.02
Games::Score is a Perl module to keep track of score in games . more>>
Games::Score is a Perl module to keep track of score in games .
SYNOPSIS
use Games::Score;
# these three values are the default ones, by the way
Games::Score->default_score(0);
Games::Score->default_step(1);
Games::Score->step_method(inc);
# start two players
my $player1 = Games::Score->new();
my $player2 = Games::Score->new();
# set a winning condition
Games::Score->victory_is( sub { $_[0] >= 20 } );
# and something to do if it is achieved
Games::Score->on_victory_do( sub { print "Won!" } );
# give points to the players
$player1->add(2);
$player2->step();
# look at section FUNCTIONS for more functionalities, such as
Games::Score->invalidate_if( sub { $_[0] > 20 } );
Games::Score can be use to keep track of several players points in a game, regardless of the starting amount of points, winning and/or losing conditions, etc.
It provides several useful methods so that the user doesnt have to keep testing values to see if theyre valid or if the player condition has changed.
<<lessSYNOPSIS
use Games::Score;
# these three values are the default ones, by the way
Games::Score->default_score(0);
Games::Score->default_step(1);
Games::Score->step_method(inc);
# start two players
my $player1 = Games::Score->new();
my $player2 = Games::Score->new();
# set a winning condition
Games::Score->victory_is( sub { $_[0] >= 20 } );
# and something to do if it is achieved
Games::Score->on_victory_do( sub { print "Won!" } );
# give points to the players
$player1->add(2);
$player2->step();
# look at section FUNCTIONS for more functionalities, such as
Games::Score->invalidate_if( sub { $_[0] > 20 } );
Games::Score can be use to keep track of several players points in a game, regardless of the starting amount of points, winning and/or losing conditions, etc.
It provides several useful methods so that the user doesnt have to keep testing values to see if theyre valid or if the player condition has changed.
Download (0.007MB)
Added: 2006-12-27 License: Perl Artistic License Price:
1031 downloads
Test::Cmd 1.05
Test::Cmd is a Perl module for portable testing of commands and scripts. more>>
Test::Cmd is a Perl module for portable testing of commands and scripts.
SYNOPSIS
use Test::Cmd;
$test = Test::Cmd->new(prog => program_or_script_to_test,
interpreter => script_interpreter,
string => identifier_string,
workdir => ,
subdir => dir,
match_sub => $code_ref,
verbose => 1);
$test->verbose(1);
$test->prog(program_or_script_to_test);
$test->basename(@suffixlist);
$test->interpreter(script_interpreter);
$test->string(identifier string);
$test->workdir(prefix);
$test->workpath(subdir, file);
$test->subdir(subdir, ...);
$test->subdir([sub, dir], ...);
$test->write(file, read($contents, [subdir, file]);
$test->read(@lines, [subdir, file]);
$test->writable(dir);
$test->writable(dir, $rwflag);
$test->writable(dir, $rwflag, %errors);
$test->preserve(condition, ...);
$test->cleanup(condition);
$test->run(prog => program_or_script_to_test,
interpreter => script_interpreter,
chdir => dir, args => arguments, stdin => pass(condition, &func);
$test->fail(condition);
$test->fail(condition, &func);
$test->fail(condition, &func, $caller);
$test->no_result(condition);
$test->no_result(condition, &func);
$test->no_result(condition, &func, $caller);
$test->stdout;
$test->stdout($run_number);
$test->stderr;
$test->stderr($run_number);
$test->match(@lines, @matches);
$test->match($lines, $matches);
$test->match_exact(@lines, @matches);
$test->match_exact($lines, $matches);
$test->match_regex(@lines, @regexes);
$test->match_regex($lines, $regexes);
$test->diff_exact(@lines, @matches, @output);
$test->diff_exact($lines, $matches, @output);
$test->diff_regex(@lines, @regexes, @output);
$test->diff_regex($lines, $regexes, @output);
sub func {
my ($self, $lines, $matches) = @_;
# code to match $lines and $matches
}
$test->match_sub(&func);
$test->match_sub(sub { code to match $_[1] and $_[2] });
$test->here;
The Test::Cmd module provides a low-level framework for portable automated testing of executable commands and scripts (in any language, not just Perl), especially commands and scripts that interact with the file system.
The Test::Cmd module makes no assumptions about what constitutes a successful or failed test. Attempting to read a file that doesnt exist, for example, may or may not be an error, depending on the software being tested.
Consequently, no Test::Cmd methods (including the new() method) exit, die or throw any other sorts of exceptions (but they all do return useful error indications). Exceptions or other error status should be handled by a higher layer: a subclass of Test::Cmd, or another testing framework such as the Test or Test::Simple Perl modules, or by the test itself.
(That said, see the Test::Cmd::Common module if you want a similar module that provides exception handling, either to use directly in your own tests, or as an example of how to use Test::Cmd.)
In addition to running tests and evaluating conditions, the Test::Cmd module manages and cleans up one or more temporary workspace directories, and provides methods for creating files and directories in those workspace directories from in-line data (that is, here-documents), allowing tests to be completely self-contained. When used in conjunction with another testing framework, the Test::Cmd module can function as a fixture (common startup code for multiple tests) for simple management of command execution and temporary workspaces.
The Test::Cmd module inherits File::Spec methods (file_name_is_absolute(), catfile(), etc.) to support writing tests portably across a variety of operating and file systems.
A Test::Cmd environment object is created via the usual invocation:
$test = Test::Cmd->new();
Arguments to the Test::Cmd::new method are keyword-value pairs that may be used to initialize the object, typically by invoking the same-named method as the keyword.
<<lessSYNOPSIS
use Test::Cmd;
$test = Test::Cmd->new(prog => program_or_script_to_test,
interpreter => script_interpreter,
string => identifier_string,
workdir => ,
subdir => dir,
match_sub => $code_ref,
verbose => 1);
$test->verbose(1);
$test->prog(program_or_script_to_test);
$test->basename(@suffixlist);
$test->interpreter(script_interpreter);
$test->string(identifier string);
$test->workdir(prefix);
$test->workpath(subdir, file);
$test->subdir(subdir, ...);
$test->subdir([sub, dir], ...);
$test->write(file, read($contents, [subdir, file]);
$test->read(@lines, [subdir, file]);
$test->writable(dir);
$test->writable(dir, $rwflag);
$test->writable(dir, $rwflag, %errors);
$test->preserve(condition, ...);
$test->cleanup(condition);
$test->run(prog => program_or_script_to_test,
interpreter => script_interpreter,
chdir => dir, args => arguments, stdin => pass(condition, &func);
$test->fail(condition);
$test->fail(condition, &func);
$test->fail(condition, &func, $caller);
$test->no_result(condition);
$test->no_result(condition, &func);
$test->no_result(condition, &func, $caller);
$test->stdout;
$test->stdout($run_number);
$test->stderr;
$test->stderr($run_number);
$test->match(@lines, @matches);
$test->match($lines, $matches);
$test->match_exact(@lines, @matches);
$test->match_exact($lines, $matches);
$test->match_regex(@lines, @regexes);
$test->match_regex($lines, $regexes);
$test->diff_exact(@lines, @matches, @output);
$test->diff_exact($lines, $matches, @output);
$test->diff_regex(@lines, @regexes, @output);
$test->diff_regex($lines, $regexes, @output);
sub func {
my ($self, $lines, $matches) = @_;
# code to match $lines and $matches
}
$test->match_sub(&func);
$test->match_sub(sub { code to match $_[1] and $_[2] });
$test->here;
The Test::Cmd module provides a low-level framework for portable automated testing of executable commands and scripts (in any language, not just Perl), especially commands and scripts that interact with the file system.
The Test::Cmd module makes no assumptions about what constitutes a successful or failed test. Attempting to read a file that doesnt exist, for example, may or may not be an error, depending on the software being tested.
Consequently, no Test::Cmd methods (including the new() method) exit, die or throw any other sorts of exceptions (but they all do return useful error indications). Exceptions or other error status should be handled by a higher layer: a subclass of Test::Cmd, or another testing framework such as the Test or Test::Simple Perl modules, or by the test itself.
(That said, see the Test::Cmd::Common module if you want a similar module that provides exception handling, either to use directly in your own tests, or as an example of how to use Test::Cmd.)
In addition to running tests and evaluating conditions, the Test::Cmd module manages and cleans up one or more temporary workspace directories, and provides methods for creating files and directories in those workspace directories from in-line data (that is, here-documents), allowing tests to be completely self-contained. When used in conjunction with another testing framework, the Test::Cmd module can function as a fixture (common startup code for multiple tests) for simple management of command execution and temporary workspaces.
The Test::Cmd module inherits File::Spec methods (file_name_is_absolute(), catfile(), etc.) to support writing tests portably across a variety of operating and file systems.
A Test::Cmd environment object is created via the usual invocation:
$test = Test::Cmd->new();
Arguments to the Test::Cmd::new method are keyword-value pairs that may be used to initialize the object, typically by invoking the same-named method as the keyword.
Download (0.030MB)
Added: 2007-02-23 License: Perl Artistic License Price:
978 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 condition 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