graph component
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 1565
PoJoe Component Libraries 1.1
PoJoe Component Libraries project is a set of Java POJO components, originally developed for OSMQ. more>>
PoJoe Component Libraries project is a set of Java POJO components, originally developed for OSMQ. Developers have found these components useful in building robust enterprise applications.
Of note are: a FIFO queue that utilizes memory until a size threshold is reached, paging overflow elements to a disk cache; a dynamic discovery mechanism for locating remote processes by name over an IP network, eliminating the need to identify a remote service with a specific host computer; and a set of peer-to-peer async message components that support n concurrent message publishers for each named subscriber.
Enhancements:
- Minor enhancements and bugfixes, and changing the license from GNU Lesser to Apache 2.0.
<<lessOf note are: a FIFO queue that utilizes memory until a size threshold is reached, paging overflow elements to a disk cache; a dynamic discovery mechanism for locating remote processes by name over an IP network, eliminating the need to identify a remote service with a specific host computer; and a set of peer-to-peer async message components that support n concurrent message publishers for each named subscriber.
Enhancements:
- Minor enhancements and bugfixes, and changing the license from GNU Lesser to Apache 2.0.
Download (0.87MB)
Added: 2007-06-12 License: The Apache License 2.0 Price:
521 downloads
POE::Component::OSCAR 0.05
POE::Component::OSCAR is a POE component for the Net::OSCAR module. more>>
POE::Component::OSCAR is a POE component for the Net::OSCAR module.
SYNOPSIS
use POE qw(Component::OSCAR);
[ ... POE set up ... ]
sub _start { # start an OSCAR session $oscar = POE::Component::OSCAR->new();
# start an OSCAR session with automatic throttling of new connections
# to prevent being banned by the server
$oscar = POE::Component::OSCAR->new( throttle => 4 );
# set up the "im_in" callback to call your state, "im_in_state"
$oscar->set_callback( im_in => im_in_state);
# its good to detect errors if you dont want to get banned
$oscar->set_callback( error => error_state );
$oscar->set_callback( admin_error => admin_erro_stater );
$oscar->set_callback( rate_alert => rate_alert_state );
# sign on
$oscar->signon( screenname => $MY_SCREENNAME, password => $MY_PASSWORD );
}
sub im_in_state { my ($nothing, $args) = @_[ARG0..$#_]; my ($object, $who, $what, $away) = @$args;
print "Got $what from $whon";
}
<<lessSYNOPSIS
use POE qw(Component::OSCAR);
[ ... POE set up ... ]
sub _start { # start an OSCAR session $oscar = POE::Component::OSCAR->new();
# start an OSCAR session with automatic throttling of new connections
# to prevent being banned by the server
$oscar = POE::Component::OSCAR->new( throttle => 4 );
# set up the "im_in" callback to call your state, "im_in_state"
$oscar->set_callback( im_in => im_in_state);
# its good to detect errors if you dont want to get banned
$oscar->set_callback( error => error_state );
$oscar->set_callback( admin_error => admin_erro_stater );
$oscar->set_callback( rate_alert => rate_alert_state );
# sign on
$oscar->signon( screenname => $MY_SCREENNAME, password => $MY_PASSWORD );
}
sub im_in_state { my ($nothing, $args) = @_[ARG0..$#_]; my ($object, $who, $what, $away) = @$args;
print "Got $what from $whon";
}
Download (0.006MB)
Added: 2007-04-18 License: Perl Artistic License Price:
919 downloads
Graph 0.81
Graph is a Perl module with graph data structures and algorithms. more>>
Graph is a Perl module with graph data structures and algorithms.
SYNOPSIS
use Graph;
my $g0 = Graph->new; # A directed graph.
use Graph::Directed;
my $g1 = Graph::Directed->new; # A directed graph.
use Graph::Undirected;
my $g2 = Graph::Undirected->new; # An undirected graph.
$g->add_edge(...);
$g->has_edge(...)
$g->delete_edge(...);
$g->add_vertex(...);
$g->has_vertex(...);
$g->delete_vertex(...);
$g->vertices(...)
$g->edges(...)
<<lessSYNOPSIS
use Graph;
my $g0 = Graph->new; # A directed graph.
use Graph::Directed;
my $g1 = Graph::Directed->new; # A directed graph.
use Graph::Undirected;
my $g2 = Graph::Undirected->new; # An undirected graph.
$g->add_edge(...);
$g->has_edge(...)
$g->delete_edge(...);
$g->add_vertex(...);
$g->has_vertex(...);
$g->delete_vertex(...);
$g->vertices(...)
$g->edges(...)
Download (0.12MB)
Added: 2007-07-02 License: Perl Artistic License Price:
1427 downloads
Graph::ModularDecomposition 0.13
Graph::ModularDecomposition is a Perl module for modular decomposition of directed graphs. more>>
Graph::ModularDecomposition is a Perl module for modular decomposition of directed graphs.
SYNOPSIS
use Graph::ModularDecomposition qw(pairstring_to_graph tree_to_string);
my $g = new Graph::ModularDecomposition;
my $h = $g->pairstring_to_graph( ab,ac,bc );
print "yesn" if check_transitive( $h );
print "yesn" if $h->check_transitive; # same thing
my $m = $h->modular_decomposition_EGMS;
print tree_to_string( $m );
This module extends Graph::Directed by providing new methods related to modular decomposition.
The most important new method is modular_decomposition_EGMS(), which for a directed graph with n vertices finds the modular decomposition tree of the graph in O(n^2) time. Method tree_to_string() may be useful to represent the decomposition tree in a friendlier format; this needs to be explicitly imported.
If you need to decompose an undirected graph, represent it as a directed graph by adding two directed edges for each undirected edge.
The method classify() uses the modular decomposition tree to classify a directed graph as non-transitive, or for transitive digraphs, as series-parallel (linear or parallel modules only), decomposable (not series-parallel, but with at least one non-primitive module), indecomposable (primitive), decomposable but consisting of primitive or series modules only (only applies to graphs of at least 7 vertices), or unclassified (should never apply).
<<lessSYNOPSIS
use Graph::ModularDecomposition qw(pairstring_to_graph tree_to_string);
my $g = new Graph::ModularDecomposition;
my $h = $g->pairstring_to_graph( ab,ac,bc );
print "yesn" if check_transitive( $h );
print "yesn" if $h->check_transitive; # same thing
my $m = $h->modular_decomposition_EGMS;
print tree_to_string( $m );
This module extends Graph::Directed by providing new methods related to modular decomposition.
The most important new method is modular_decomposition_EGMS(), which for a directed graph with n vertices finds the modular decomposition tree of the graph in O(n^2) time. Method tree_to_string() may be useful to represent the decomposition tree in a friendlier format; this needs to be explicitly imported.
If you need to decompose an undirected graph, represent it as a directed graph by adding two directed edges for each undirected edge.
The method classify() uses the modular decomposition tree to classify a directed graph as non-transitive, or for transitive digraphs, as series-parallel (linear or parallel modules only), decomposable (not series-parallel, but with at least one non-primitive module), indecomposable (primitive), decomposable but consisting of primitive or series modules only (only applies to graphs of at least 7 vertices), or unclassified (should never apply).
Download (0.013MB)
Added: 2006-09-29 License: Perl Artistic License Price:
1122 downloads
GENE Graph Export Engine 0.3
GENE Graph Export Engine is an advanced XML exporter. more>>
GENE Graph Export Engine is an advanced XML exporter.
GENE Graph Export Engine is a complex convertor/framework for multi-namespace XML transforming and exporting.
It is able to convert various XML types including SVG, DocBook, MathML, XSL-FO, and their combinations into a wide area of output formats: PDF, PNG, SVG, PS, MIF, RTF, and XHTML.
Custom XSLT scripts can be registered easily and are used automatically. It requires Sun JRE 5.0.
Enhancements:
- GENE Core bugfixes. FOP plugin bugfixes.
- Gene Runner I18N support has been added. l12n in Slovak.
- Configuration ability has been added.
- New command line switches have been added.
- Preliminary buggy CML (Chemical Markup Language) and XHTML->DocBook exporters have been added.
<<lessGENE Graph Export Engine is a complex convertor/framework for multi-namespace XML transforming and exporting.
It is able to convert various XML types including SVG, DocBook, MathML, XSL-FO, and their combinations into a wide area of output formats: PDF, PNG, SVG, PS, MIF, RTF, and XHTML.
Custom XSLT scripts can be registered easily and are used automatically. It requires Sun JRE 5.0.
Enhancements:
- GENE Core bugfixes. FOP plugin bugfixes.
- Gene Runner I18N support has been added. l12n in Slovak.
- Configuration ability has been added.
- New command line switches have been added.
- Preliminary buggy CML (Chemical Markup Language) and XHTML->DocBook exporters have been added.
Download (1.1MB)
Added: 2006-07-03 License: MPL (Mozilla Public License) Price:
1209 downloads
POE::Component::Enc::Mp3 1.2
POE::Component::Enc::Mp3 is a mp3 encoder wrapper. more>>
POE::Component::Enc::Mp3 is a mp3 encoder wrapper.
SYNOPSIS
use POE qw(Component::Enc::Mp3);
$mp3 = POE::Component::Enc::Mp3->new($bitrate => 160);
$mp3->enc("/tmp/tst.wav");
POE::Kernel->run();
This POE component encodes raw audio files into mp3 format. It is merely a wrapper for the notlame program.
METHODS
The module provides an object oriented interface as follows:
new
Used to initialise the system and create a module instance. The following parameters are available:
alias
Indicates the name of a session to which module callbacks are posted. Default: main.
bitrate
Should be self-evident. If left unspecified, defaults to 160.
enc < file-name > [del-orig]
Encodes the given file, naming it with a .mp3 extension. An optional true value for the second parameter indicates that the original file should be deleted.
e.g. $mp3->enc("/tmp/tst.wav");
<<lessSYNOPSIS
use POE qw(Component::Enc::Mp3);
$mp3 = POE::Component::Enc::Mp3->new($bitrate => 160);
$mp3->enc("/tmp/tst.wav");
POE::Kernel->run();
This POE component encodes raw audio files into mp3 format. It is merely a wrapper for the notlame program.
METHODS
The module provides an object oriented interface as follows:
new
Used to initialise the system and create a module instance. The following parameters are available:
alias
Indicates the name of a session to which module callbacks are posted. Default: main.
bitrate
Should be self-evident. If left unspecified, defaults to 160.
enc < file-name > [del-orig]
Encodes the given file, naming it with a .mp3 extension. An optional true value for the second parameter indicates that the original file should be deleted.
e.g. $mp3->enc("/tmp/tst.wav");
Download (0.003MB)
Added: 2006-11-07 License: Perl Artistic License Price:
1081 downloads
Q-Graph 1.4
Q-Graph is a collection of Q scripts that provide a graph data structure and a full-featured graph editor. more>>
Q-Graph is a collection of Q scripts that provide a graph data structure and a full-featured graph editor (the latter requires Tcl/Tk).
Q-Graph library can be used to implement and test graph algorithms using the Q language.
Q is a functional programming language based on term rewriting. Thus, a Q program or "script" is simply a collection of equations which are used to evaluate expressions in a symbolic fashion.
The equations establish algebraic identities and are interpreted as rewriting rules in order to reduce expressions to "normal forms".
For instance, here is how you define a function sqr which squares its argument by multiplying it with itself:
sqr X = X*X;
Note that, as in Prolog, capitalized identifiers are used to indicate the variables in an equation, which are bound to the actual values when an equation is applied. Equations may also include a condition part, as in the following definition of the factorial function:
fact N = N*fact (N-1) if N>0;
= 1 otherwise;
Functions on structured arguments are defined by "pattern matching". E.g., the product of a list (denoted in Prolog-like syntax) can be computed with these two equations:
prod [] = 1;
prod [X|Xs] = X*prod Xs;
With this definition, the factorial can now also be defined as follows (the notation [1..N], as in Haskell, denotes an arithmetic sequence):
fact N = prod [1..N];
As you can see, the definitions are really just like mathematical equations. The syntax is superficially similar to other modern functional languages like Miranda and Haskell, except that Q is "free-format", i.e., it does not use layout to indicate syntactical structure (thus the semicolon is used to terminate an equation).
Due to its term rewriting heritage, Q goes well beyond most other functional languages in that it also allows you to perform computations with symbolic expressions. For instance, with the definition of the sqr function from above, you will find that sqr (X+1) evaluates to (X+1)*(X+1). This might first look like an arcane feature, but it is actually quite useful, because you can try your definitions with symbolic inputs, too.
<<lessQ-Graph library can be used to implement and test graph algorithms using the Q language.
Q is a functional programming language based on term rewriting. Thus, a Q program or "script" is simply a collection of equations which are used to evaluate expressions in a symbolic fashion.
The equations establish algebraic identities and are interpreted as rewriting rules in order to reduce expressions to "normal forms".
For instance, here is how you define a function sqr which squares its argument by multiplying it with itself:
sqr X = X*X;
Note that, as in Prolog, capitalized identifiers are used to indicate the variables in an equation, which are bound to the actual values when an equation is applied. Equations may also include a condition part, as in the following definition of the factorial function:
fact N = N*fact (N-1) if N>0;
= 1 otherwise;
Functions on structured arguments are defined by "pattern matching". E.g., the product of a list (denoted in Prolog-like syntax) can be computed with these two equations:
prod [] = 1;
prod [X|Xs] = X*prod Xs;
With this definition, the factorial can now also be defined as follows (the notation [1..N], as in Haskell, denotes an arithmetic sequence):
fact N = prod [1..N];
As you can see, the definitions are really just like mathematical equations. The syntax is superficially similar to other modern functional languages like Miranda and Haskell, except that Q is "free-format", i.e., it does not use layout to indicate syntactical structure (thus the semicolon is used to terminate an equation).
Due to its term rewriting heritage, Q goes well beyond most other functional languages in that it also allows you to perform computations with symbolic expressions. For instance, with the definition of the sqr function from above, you will find that sqr (X+1) evaluates to (X+1)*(X+1). This might first look like an arcane feature, but it is actually quite useful, because you can try your definitions with symbolic inputs, too.
Download (0.085MB)
Added: 2006-02-09 License: GPL (GNU General Public License) Price:
1352 downloads
POE::Component::Basement 0.01
POE::Component::Basement provides Class::Std and base POE component functionality. more>>
POE::Component::Basement provides Class::Std and base POE component functionality.
SYNOPSIS
package POE::MyComponent;
# use as base
use base qw/ POE::Component::Basement /;
# where the initializations happen (see Class::Std)
sub BUILD { ... }
# see also Class::Std and Class::Data::Inheritable also
# for accessor creation etc.
# define states
sub state_one : State( :inline< _start > ) { ... }
sub state_two : State( :object< foo > ) { ... }
sub state_three : State( :package< bar > ) { ... }
# combined
sub state_multi : State( :inline< foobar > :package< snafoo > ) { ... }
...
# chained events
sub first : State( :object< foo > :chained< bar > ) { ... }
sub second : State( :object< bar > ) { ... }
...
# calling in a row
sub first : State( :object< foo > :next< bar > ) { ... }
sub second : State( :object< bar > ) { ... }
...
# usage
my $comp = POE::MyComponent->new ({
# single alias or array reference for multiple
aliases => [qw/ mycomp shub_niggurath /],
... # your specific init_args.
});
Provides Class::Std and base POE component functionality. This module is still kinda experimental.
<<lessSYNOPSIS
package POE::MyComponent;
# use as base
use base qw/ POE::Component::Basement /;
# where the initializations happen (see Class::Std)
sub BUILD { ... }
# see also Class::Std and Class::Data::Inheritable also
# for accessor creation etc.
# define states
sub state_one : State( :inline< _start > ) { ... }
sub state_two : State( :object< foo > ) { ... }
sub state_three : State( :package< bar > ) { ... }
# combined
sub state_multi : State( :inline< foobar > :package< snafoo > ) { ... }
...
# chained events
sub first : State( :object< foo > :chained< bar > ) { ... }
sub second : State( :object< bar > ) { ... }
...
# calling in a row
sub first : State( :object< foo > :next< bar > ) { ... }
sub second : State( :object< bar > ) { ... }
...
# usage
my $comp = POE::MyComponent->new ({
# single alias or array reference for multiple
aliases => [qw/ mycomp shub_niggurath /],
... # your specific init_args.
});
Provides Class::Std and base POE component functionality. This module is still kinda experimental.
Download (0.017MB)
Added: 2006-10-23 License: Perl Artistic License Price:
1096 downloads
POE::Component::Enc::Flac 1.01
POE::Component::Enc::Flac is a POE component to wrap FLAC encoder flac. more>>
POE::Component::Enc::Flac is a POE component to wrap FLAC encoder flac.
SYNOPSIS
use POE qw(Component::Enc::Flac);
$encoder1 = POE::Component::Enc::Flac->new();
$encoder1->enc(input => "/tmp/track03.wav");
$encoder2 = POE::Component::Enc::Flac->new(
parent => mainSession,
priority => 10,
compression => best,
status => flacStatus,
error => flacEerror,
warning => flacWarning,
done => flacDone,
);
$encoder2->enc(
input => "/tmp/track02.wav",
output => "/tmp/02.flac",
tracknumber => Track 2,
comment => [
title=Birdhouse in your Soul,
artist=They Might be Giants,
date=1990,
origin=CD,
]
);
POE::Kernel->run();
ABSTRACT
POE is a multitasking framework for Perl. FLAC stands for Free Lossless Audio Codec and flac is an encoder for this standard. This module wraps flac into the POE framework, simplifying its use in, for example, a CD music ripper and encoder application. It provides an object oriented interface.
<<lessSYNOPSIS
use POE qw(Component::Enc::Flac);
$encoder1 = POE::Component::Enc::Flac->new();
$encoder1->enc(input => "/tmp/track03.wav");
$encoder2 = POE::Component::Enc::Flac->new(
parent => mainSession,
priority => 10,
compression => best,
status => flacStatus,
error => flacEerror,
warning => flacWarning,
done => flacDone,
);
$encoder2->enc(
input => "/tmp/track02.wav",
output => "/tmp/02.flac",
tracknumber => Track 2,
comment => [
title=Birdhouse in your Soul,
artist=They Might be Giants,
date=1990,
origin=CD,
]
);
POE::Kernel->run();
ABSTRACT
POE is a multitasking framework for Perl. FLAC stands for Free Lossless Audio Codec and flac is an encoder for this standard. This module wraps flac into the POE framework, simplifying its use in, for example, a CD music ripper and encoder application. It provides an object oriented interface.
Download (0.72MB)
Added: 2006-06-22 License: Perl Artistic License Price:
1219 downloads
POE::Component::Proxy::TCP 1.2
POE::Component::Proxy::TCP is a simplified TCP proxy. more>>
POE::Component::Proxy::TCP is a simplified TCP proxy.
SYNOPSIS
use POE qw(Component::Proxy::TCP);
POE::Component::Proxy::TCP->new
(Alias => "ProxyServerSessionAlias",
Port => $local_server_port,
OrigPort => $remote_server_port,
OrigAddress => $remote_server_host,
DataFromClient => &data_from_client_handler,
DataFromServer => &data_from_server_handler,
);
# gets called with data passed from server.
# called inside the per client connected session created by PoCo::Server::TCP
sub data_from_server_handler {
my $server_data = shift;
# show obtaining other session info esp per proxy session info
};
# gets called with data passed from remote client
#
sub data_from_client_handler {
my $server_data = shift;
};
# show obtaining other session info esp per proxy session info
# Reserved HEAP variables:
$heap->{self} = Proxy object / instance var hash
$heap->{self}->losta stuff add documentation
[do the per connection ones]
EXAMPLE ^
use warnings;
use strict;
use diagnostics;
use POE;
use POE::Filter::Stream;
use POE::Filter::Line;
use POE::Component::Proxy::TCP;
$|++;
POE::Component::Proxy::TCP->new
(Alias => "ProxyServerSessionAlias",
Port => 4000,
OrigPort => 5000,
OrigAddress => "localhost",
DataFromClient => sub {print "From client:", shift(), "n";},
DataFromServer => sub {print "From server:", shift(), "n";},
RemoteClientFilter => "POE::Filter::Stream",
RemoteServerOutputFilter => "POE::Filter::Stream",
RemoteServerInputFilter => "POE::Filter::Stream"
);
$poe_kernel->run();
exit 0;
<<lessSYNOPSIS
use POE qw(Component::Proxy::TCP);
POE::Component::Proxy::TCP->new
(Alias => "ProxyServerSessionAlias",
Port => $local_server_port,
OrigPort => $remote_server_port,
OrigAddress => $remote_server_host,
DataFromClient => &data_from_client_handler,
DataFromServer => &data_from_server_handler,
);
# gets called with data passed from server.
# called inside the per client connected session created by PoCo::Server::TCP
sub data_from_server_handler {
my $server_data = shift;
# show obtaining other session info esp per proxy session info
};
# gets called with data passed from remote client
#
sub data_from_client_handler {
my $server_data = shift;
};
# show obtaining other session info esp per proxy session info
# Reserved HEAP variables:
$heap->{self} = Proxy object / instance var hash
$heap->{self}->losta stuff add documentation
[do the per connection ones]
EXAMPLE ^
use warnings;
use strict;
use diagnostics;
use POE;
use POE::Filter::Stream;
use POE::Filter::Line;
use POE::Component::Proxy::TCP;
$|++;
POE::Component::Proxy::TCP->new
(Alias => "ProxyServerSessionAlias",
Port => 4000,
OrigPort => 5000,
OrigAddress => "localhost",
DataFromClient => sub {print "From client:", shift(), "n";},
DataFromServer => sub {print "From server:", shift(), "n";},
RemoteClientFilter => "POE::Filter::Stream",
RemoteServerOutputFilter => "POE::Filter::Stream",
RemoteServerInputFilter => "POE::Filter::Stream"
);
$poe_kernel->run();
exit 0;
Download (0.017MB)
Added: 2007-04-10 License: Perl Artistic License Price:
930 downloads
POE::Component::Proxy::MSN 0.02
POE::Component::Proxy::MSN is a POE Component that is an MSN Messenger proxy. more>>
POE::Component::Proxy::MSN is a POE Component that is an MSN Messenger proxy.
SYNOPSIS
use POE qw(Component::Proxy::MSN);
# spawn MSN session
POE::Component::Proxy::MSN->spawn(
alias => msnproxy, # Optional, default
ip => any, # Optional, ip to bind to or any (default)
port => 1863, # Optional, default
msn_server => 207.46.106.79, # Server to connect to, not optional
msn_port => 1863, # Just leave this at 1863, not optional
);
# register your session as MSN proxy observer in _start of a new session
POE::Session->create(
inline_states => {
_start => sub {
$_[KERNEL]->post(msnproxy => register);
}
msn_logged_in => sub {
my ($kernel, $cmd) = @_[KERNEL, ARG0];
# tell them they are on the proxy, this is called when they log in
if ($cmd->{data} =~ m/(S+@S+)/) {
$kernel->post(msnproxy => toast => {
text => "MSN Proxy Active",
site_url => http://teknikill.net/?MSNProxy,
action_url => /,
options_url => /,
# not speciying email will toast all users
email => $1, # email targets a specific user that is logged in
});
}
},
}
);
$poe_kernel->run;
POE::Component::Proxy::MSN is a POE component that proxys the MSN Messenger service and allows you to send your own notifications (toasts).
<<lessSYNOPSIS
use POE qw(Component::Proxy::MSN);
# spawn MSN session
POE::Component::Proxy::MSN->spawn(
alias => msnproxy, # Optional, default
ip => any, # Optional, ip to bind to or any (default)
port => 1863, # Optional, default
msn_server => 207.46.106.79, # Server to connect to, not optional
msn_port => 1863, # Just leave this at 1863, not optional
);
# register your session as MSN proxy observer in _start of a new session
POE::Session->create(
inline_states => {
_start => sub {
$_[KERNEL]->post(msnproxy => register);
}
msn_logged_in => sub {
my ($kernel, $cmd) = @_[KERNEL, ARG0];
# tell them they are on the proxy, this is called when they log in
if ($cmd->{data} =~ m/(S+@S+)/) {
$kernel->post(msnproxy => toast => {
text => "MSN Proxy Active",
site_url => http://teknikill.net/?MSNProxy,
action_url => /,
options_url => /,
# not speciying email will toast all users
email => $1, # email targets a specific user that is logged in
});
}
},
}
);
$poe_kernel->run;
POE::Component::Proxy::MSN is a POE component that proxys the MSN Messenger service and allows you to send your own notifications (toasts).
Download (0.010MB)
Added: 2007-03-07 License: Perl Artistic License Price:
967 downloads
GD::Graph::colour 1.44
GD::Graph::colour contains colour manipulation routines for use with GD::Graph. more>>
GD::Graph::colour contains colour manipulation routines for use with GD::Graph.
SYNOPSIS
use GD::Graph::colour qw(:colours :lists :files :convert);
The GD::Graph::colour package provides a few routines to work with colours. The functionality of this package is mainly defined by what is needed, now and historically, by the GD::Graph modules.
FUNCTIONS
colour_list( number of colours )
Returns a list of number of colours colour names known to the package. Exported with the :lists tag.
sorted_colour_list( number of colours )
Returns a list of number of colours colour names known to the package, sorted by luminance or hue. NB. Right now it always sorts by luminance. Will add an option in a later stage to decide sorting method at run time. Exported with the :lists tag.
_rgb( colour name )
Returns a list of the RGB values of colour name. if the colour name is a string of the form that is acceptable to the hex2rgb sub, then the colour will be added to the list dynamically. Exported with the :colours tag.
_hue( R,G,B )
Returns the hue of the colour with the specified RGB values. Exported with the :colours tag.
_luminance( R,G,B )
Returns the luminance of the colour with the specified RGB values. Exported with the :colours tag.
add_colour(colourname => [$r, $g, $b]) or add_colour(#7fe310)
Self-explanatory. Exported with the :colours tag.
rgb2hex($red, $green, $blue)
hex2rgb(#7fe310)
These functions translate a list of RGB values into a hexadecimal string, as is commonly used in HTML and the Image::Magick API, and vice versa. Exported with the :convert tag.
read_rgb( file name )
Reads in colours from a rgb file as used by the X11 system.
Doing something like:
use GD::Graph::bars;
use GD::Graph::colour;
GD::Graph::colour::read_rgb("rgb.txt") or die "cannot read colours";
Will allow you to use any colours defined in rgb.txt in your graph. Exported with the :files tag.
<<lessSYNOPSIS
use GD::Graph::colour qw(:colours :lists :files :convert);
The GD::Graph::colour package provides a few routines to work with colours. The functionality of this package is mainly defined by what is needed, now and historically, by the GD::Graph modules.
FUNCTIONS
colour_list( number of colours )
Returns a list of number of colours colour names known to the package. Exported with the :lists tag.
sorted_colour_list( number of colours )
Returns a list of number of colours colour names known to the package, sorted by luminance or hue. NB. Right now it always sorts by luminance. Will add an option in a later stage to decide sorting method at run time. Exported with the :lists tag.
_rgb( colour name )
Returns a list of the RGB values of colour name. if the colour name is a string of the form that is acceptable to the hex2rgb sub, then the colour will be added to the list dynamically. Exported with the :colours tag.
_hue( R,G,B )
Returns the hue of the colour with the specified RGB values. Exported with the :colours tag.
_luminance( R,G,B )
Returns the luminance of the colour with the specified RGB values. Exported with the :colours tag.
add_colour(colourname => [$r, $g, $b]) or add_colour(#7fe310)
Self-explanatory. Exported with the :colours tag.
rgb2hex($red, $green, $blue)
hex2rgb(#7fe310)
These functions translate a list of RGB values into a hexadecimal string, as is commonly used in HTML and the Image::Magick API, and vice versa. Exported with the :convert tag.
read_rgb( file name )
Reads in colours from a rgb file as used by the X11 system.
Doing something like:
use GD::Graph::bars;
use GD::Graph::colour;
GD::Graph::colour::read_rgb("rgb.txt") or die "cannot read colours";
Will allow you to use any colours defined in rgb.txt in your graph. Exported with the :files tag.
Download (0.15MB)
Added: 2007-08-07 License: Perl Artistic License Price:
808 downloads
GD::Graph::Thermometer 0.05
GD::Graph::Thermometer is a Perl module to generate progress graph on the fly. more>>
GD::Graph::Thermometer is a Perl module to generate progress graph on the fly.
SYNOPSIS
use GD::Graph::Thermometer;
my $result = GD::Graph::Thermometer->new({
image_path => /path/to/image.png,
type => png,
goal => 80000,
current => 20000,
title => Funding the League for the Year ($),
width => 100,
height => 200,
transparent => 1,
background_color => [ r, g, b ],
text_color => [ r, g, b ],
outline_color => [ r, g, b ],
mercury_color => [ r, g, b ]
});
When deployed in production, the current value ought to be dynamically calculated based on a query of the database tracking contributions or volunteers or whatever the goal represented by the graph represents.
my $result = GD::Graph::Thermometer->new({});
This module exports only one method, its constructor, ->new(), which creates a .png (by default) image file of the thermometer graph with the path and name defined in its constructor. If no image_path is defined in the constructor, then the module will print the image directly to STDOUT.
The anonymous hash fed to the constructor must define values for the keys: goal and current. Otherwise a fatal error will be thrown. Current should represent the progress made toward the goal being graphed since the beginning of the campaign.
The output format defaults to png if the key type is undefined, otherwise a user may specify png, gif or jpeg as the output format. These correspond to the GD::Image-> methods by the same name, which are used to implement the ->_render_image() internal method.
The size parameters will default to 100 pixels wide by 200 pixels tall, if those arguments are missing from the anonymous hash given to the constructor. If title is not defined a warning will be thrown, but the graph will still be generated.
The colors for the background, text, outline and mercury will default to white, black, black and red respectively, if not otherwise defined in the constructor. If defined in the constructor, they should be defined as an anonymous array of three values ( => [ r, g, b ],), range 0 - 255, suitable for feeding to the GD::Image->colorAllocate() method. If the transparent key is set to 1, any area of the image set to either the default or a custom background color will render as transparent for inclusion on a web page.
<<lessSYNOPSIS
use GD::Graph::Thermometer;
my $result = GD::Graph::Thermometer->new({
image_path => /path/to/image.png,
type => png,
goal => 80000,
current => 20000,
title => Funding the League for the Year ($),
width => 100,
height => 200,
transparent => 1,
background_color => [ r, g, b ],
text_color => [ r, g, b ],
outline_color => [ r, g, b ],
mercury_color => [ r, g, b ]
});
When deployed in production, the current value ought to be dynamically calculated based on a query of the database tracking contributions or volunteers or whatever the goal represented by the graph represents.
my $result = GD::Graph::Thermometer->new({});
This module exports only one method, its constructor, ->new(), which creates a .png (by default) image file of the thermometer graph with the path and name defined in its constructor. If no image_path is defined in the constructor, then the module will print the image directly to STDOUT.
The anonymous hash fed to the constructor must define values for the keys: goal and current. Otherwise a fatal error will be thrown. Current should represent the progress made toward the goal being graphed since the beginning of the campaign.
The output format defaults to png if the key type is undefined, otherwise a user may specify png, gif or jpeg as the output format. These correspond to the GD::Image-> methods by the same name, which are used to implement the ->_render_image() internal method.
The size parameters will default to 100 pixels wide by 200 pixels tall, if those arguments are missing from the anonymous hash given to the constructor. If title is not defined a warning will be thrown, but the graph will still be generated.
The colors for the background, text, outline and mercury will default to white, black, black and red respectively, if not otherwise defined in the constructor. If defined in the constructor, they should be defined as an anonymous array of three values ( => [ r, g, b ],), range 0 - 255, suitable for feeding to the GD::Image->colorAllocate() method. If the transparent key is set to 1, any area of the image set to either the default or a custom background color will render as transparent for inclusion on a web page.
Download (0.007MB)
Added: 2007-02-08 License: Perl Artistic License Price:
990 downloads
B::Graph 0.51
B::Graph is a Perl compiler backend to produce graphs of OP trees. more>>
B::Graph is a Perl compiler backend to produce graphs of OP trees.
SYNOPSIS
perl -MO=Graph,-text prog.pl >graph.txt
perl -MO=Graph,-vcg prog.pl >graph.vcg
xvcg graph.vcg
perl -MO=Graph,-dot prog.pl | dot -Tps >graph.ps
This module is a backend to the perl compiler (B::*) which, instead of outputting bytecode or C based on perls compiled version of a program, writes descriptions in graph-description languages specifying graphs that show the programs structure. It currently generates descriptions for the VCG tool (http://www.cs.uni-sb.de/RW/users/sander/html/gsvcg1.html) and Dot (part of the graph visualization toolkit from AT&T: http://www.research.att.com/sw/tools/graphviz/). It also can produce plain text output (which is more useful for debugging the module itself than anything else, though you might be able to make cut the nodes out and make a mobile or something similar).
OPTIONS
Like any other compiler backend, this module needs to be invoked using the O module to run correctly:
perl -MO=Graph,-opt,-opt,-opt program.pl
OR
perl -MO=Graph,-opt,obj -e BEGIN {$obj = ["hi"]}; print $obj
OR EVEN
perl -e use O qw(Graph -opt obj obj); print "hi!n";
Obj is the name of a perl variable whose contents will be examined. It cant be a my() variable, and it shouldnt have a prefix symbol ($@^*), though you can specify a package -- the name will be used to look up a GV, whose various fields will lead to the scalar, array, and other values that correspond to the named variable. If no object is specified, the whole main program, including the CV that points to its pad, will be displayed.
Each of the the opts can come from one of the following (each set is mutually exclusive; case and underscores are insignificant):
-text, -vcg, -dot
Produce output of the appropriate type. The default is -text, which isnt useful for much of anything (it does draw some nice ASCII boxes, though).
-addrs, -no_addrs
Each of the nodes on the graph produced corresponds to a C structure that has an address and includes pointers to other structures. The module uses these addresses to decide how to draw edges, but it makes the graph more compact if they arent printed. The default is -no_addrs.
-compile_order, -run_order
The collection of OPs that perl compiles a script into has two different layers of structure. It has a tree structure which corresponds roughly to the synactic nesting of constructs in the source text, and a roughly linked-list representation, essentially a postorder traversal of this tree, which is used at runtime to decide what to do next. The graph can be drawn to emphasize one structure or the other. The former, compile_order, is the default, as it tends to lead to graphs with aspect ratios close to those of standard paper.
-SVs, -no_SVs
If OPs represent a programs compiled code, SVs represent its data. This includes literal numbers and strings (IVs, NVs, PVs, PVIVs, and PVNVs), regular arrays, hashes, and references (AVs, HVs, and RVs), but also the structures that correspond to individual variables (special HVs for symbol tables and GVs to represent values within them, and special AVs that hold my() variables (as well as compiler temporaries)), structures that keep track of code (CVs), and a variety of others. The default is to display all these too, to give a complete picture, but if you arent in a holistic mood, you can make them disappear.
-ellipses, -rhombs
The module tries to give the nodes representing SVs a different shape from those of OPs. OPs are usually rectangular, so two obvious shapes for SVs are ellipses and rhombuses (stretched diamonds). This option currently only makes a difference for VCG (ellipse is the default).
-stashes, -no_stashes
The hashes that perl uses to represent symbol tables are called stashes. Since every GV has a pointer back to its stash, its virtually inevitable for the links in a graph to lead to the main stash. Unfortunately stashes, especially the main one, can be quite big, and lead to forests of other structures -- theres one GV and another SV for each magic variable, plus all of @INC and %ENV, and so on. To prevent information overload, then, the display of stashes is disabled by default.
-fileGVs, -no_fileGVs
Another kind graph element that can be annoying are the pointers from every GV and COP (a kind of OP that occurs for every statement) to the GV that represents the file from which that code came (used for error messages). By default, these links arent shown, to keep them from cluttering the graph. Also, perls internal interfaces changed in a recent version, so in perl 5.005_63 or later you cant see the fileGVs at all.
-SEQs, -no_SEQs
As it is visited in the peephole optimization phase, each OP gets a sequence number, which is currently used by anything (except the peephole optimizer, to avoid visiting OPs twice). If you want to see these, ask for them. (COPs have their own sequence numbers too, but theyre more interesting to look at -- for instance, theyre used to bound the lifetimes of lexicals).
-types, -no_types
B::Graph always gives the type of each OP symbolically (entersub), but it can also print the numeric value of the type field, if you want. The default is no_types.
-float, -no_float
Almost every OP has an op_next and an op_sibling pointer, and B::Graph colors them distinctively (pink and light blue, respectively). Because of this, it isnt strictly necessary to anchor the arrow on a line in the OPs box saying op_next. The float option lets the graph layout engine start these arrows wherever it wants, which can sometimes lead to a more pleasing layout, at the expense of being less obvious. The default is not to float.
-targlinks, -no_targlinks
Lexical (my()) variables and temporary values used by individual OPs are stored in pads, per-code arrays linked to the CV. OPs store indexes into these arrays in the op_targ field, but B::Graph can often also draw links directly from the OP to the SV that stores the name of the variable. These links dont correspond to any real pointers, however, and they can make the graph more complicated, so they are disabled by default.
<<lessSYNOPSIS
perl -MO=Graph,-text prog.pl >graph.txt
perl -MO=Graph,-vcg prog.pl >graph.vcg
xvcg graph.vcg
perl -MO=Graph,-dot prog.pl | dot -Tps >graph.ps
This module is a backend to the perl compiler (B::*) which, instead of outputting bytecode or C based on perls compiled version of a program, writes descriptions in graph-description languages specifying graphs that show the programs structure. It currently generates descriptions for the VCG tool (http://www.cs.uni-sb.de/RW/users/sander/html/gsvcg1.html) and Dot (part of the graph visualization toolkit from AT&T: http://www.research.att.com/sw/tools/graphviz/). It also can produce plain text output (which is more useful for debugging the module itself than anything else, though you might be able to make cut the nodes out and make a mobile or something similar).
OPTIONS
Like any other compiler backend, this module needs to be invoked using the O module to run correctly:
perl -MO=Graph,-opt,-opt,-opt program.pl
OR
perl -MO=Graph,-opt,obj -e BEGIN {$obj = ["hi"]}; print $obj
OR EVEN
perl -e use O qw(Graph -opt obj obj); print "hi!n";
Obj is the name of a perl variable whose contents will be examined. It cant be a my() variable, and it shouldnt have a prefix symbol ($@^*), though you can specify a package -- the name will be used to look up a GV, whose various fields will lead to the scalar, array, and other values that correspond to the named variable. If no object is specified, the whole main program, including the CV that points to its pad, will be displayed.
Each of the the opts can come from one of the following (each set is mutually exclusive; case and underscores are insignificant):
-text, -vcg, -dot
Produce output of the appropriate type. The default is -text, which isnt useful for much of anything (it does draw some nice ASCII boxes, though).
-addrs, -no_addrs
Each of the nodes on the graph produced corresponds to a C structure that has an address and includes pointers to other structures. The module uses these addresses to decide how to draw edges, but it makes the graph more compact if they arent printed. The default is -no_addrs.
-compile_order, -run_order
The collection of OPs that perl compiles a script into has two different layers of structure. It has a tree structure which corresponds roughly to the synactic nesting of constructs in the source text, and a roughly linked-list representation, essentially a postorder traversal of this tree, which is used at runtime to decide what to do next. The graph can be drawn to emphasize one structure or the other. The former, compile_order, is the default, as it tends to lead to graphs with aspect ratios close to those of standard paper.
-SVs, -no_SVs
If OPs represent a programs compiled code, SVs represent its data. This includes literal numbers and strings (IVs, NVs, PVs, PVIVs, and PVNVs), regular arrays, hashes, and references (AVs, HVs, and RVs), but also the structures that correspond to individual variables (special HVs for symbol tables and GVs to represent values within them, and special AVs that hold my() variables (as well as compiler temporaries)), structures that keep track of code (CVs), and a variety of others. The default is to display all these too, to give a complete picture, but if you arent in a holistic mood, you can make them disappear.
-ellipses, -rhombs
The module tries to give the nodes representing SVs a different shape from those of OPs. OPs are usually rectangular, so two obvious shapes for SVs are ellipses and rhombuses (stretched diamonds). This option currently only makes a difference for VCG (ellipse is the default).
-stashes, -no_stashes
The hashes that perl uses to represent symbol tables are called stashes. Since every GV has a pointer back to its stash, its virtually inevitable for the links in a graph to lead to the main stash. Unfortunately stashes, especially the main one, can be quite big, and lead to forests of other structures -- theres one GV and another SV for each magic variable, plus all of @INC and %ENV, and so on. To prevent information overload, then, the display of stashes is disabled by default.
-fileGVs, -no_fileGVs
Another kind graph element that can be annoying are the pointers from every GV and COP (a kind of OP that occurs for every statement) to the GV that represents the file from which that code came (used for error messages). By default, these links arent shown, to keep them from cluttering the graph. Also, perls internal interfaces changed in a recent version, so in perl 5.005_63 or later you cant see the fileGVs at all.
-SEQs, -no_SEQs
As it is visited in the peephole optimization phase, each OP gets a sequence number, which is currently used by anything (except the peephole optimizer, to avoid visiting OPs twice). If you want to see these, ask for them. (COPs have their own sequence numbers too, but theyre more interesting to look at -- for instance, theyre used to bound the lifetimes of lexicals).
-types, -no_types
B::Graph always gives the type of each OP symbolically (entersub), but it can also print the numeric value of the type field, if you want. The default is no_types.
-float, -no_float
Almost every OP has an op_next and an op_sibling pointer, and B::Graph colors them distinctively (pink and light blue, respectively). Because of this, it isnt strictly necessary to anchor the arrow on a line in the OPs box saying op_next. The float option lets the graph layout engine start these arrows wherever it wants, which can sometimes lead to a more pleasing layout, at the expense of being less obvious. The default is not to float.
-targlinks, -no_targlinks
Lexical (my()) variables and temporary values used by individual OPs are stored in pads, per-code arrays linked to the CV. OPs store indexes into these arrays in the op_targ field, but B::Graph can often also draw links directly from the OP to the SV that stores the name of the variable. These links dont correspond to any real pointers, however, and they can make the graph more complicated, so they are disabled by default.
Download (0.012MB)
Added: 2007-06-26 License: Perl Artistic License Price:
851 downloads
POE::Component::ControlPort 0.01
POE::Component::ControlPort is a Perl module with network control port for POE applications. more>>
POE::Component::ControlPort is a Perl module with network control port for POE applications.
SYNOPSIS
use POE;
use Getopt::Long;
use POE::Component::ControlPort;
use POE::Component::ControlPort::Command;
my @commands = (
{
help_text => My command,
usage => my_command [ arg1, arg2 ],
topic => custom,
name => my_command,
command => sub {
my %input = @_;
local @ARGV = @{ $input{args} };
GetOptions( ... );
},
}
);
POE::Component::ControlPort->create(
local_address => 127.0.0.1,
local_port => 31337,
# optional...
hostname => pie.pants.org,
appname => my perl app,
commands => @commands,
poe_debug => 1,
);
# other poe sessions or whatever ...
POE::Kernel->run();
When building network applications, it is often helpful to have a network accessible control and diagnostic interface. This module provides such an interface for POE applications. By default, it provides a fairly limited set of commands but is easily extended to provide whatever command set you require. In addition, if POE::Component::DebugShell version 1.018 or above is installed, a set of POE debug commands will be loaded.
<<lessSYNOPSIS
use POE;
use Getopt::Long;
use POE::Component::ControlPort;
use POE::Component::ControlPort::Command;
my @commands = (
{
help_text => My command,
usage => my_command [ arg1, arg2 ],
topic => custom,
name => my_command,
command => sub {
my %input = @_;
local @ARGV = @{ $input{args} };
GetOptions( ... );
},
}
);
POE::Component::ControlPort->create(
local_address => 127.0.0.1,
local_port => 31337,
# optional...
hostname => pie.pants.org,
appname => my perl app,
commands => @commands,
poe_debug => 1,
);
# other poe sessions or whatever ...
POE::Kernel->run();
When building network applications, it is often helpful to have a network accessible control and diagnostic interface. This module provides such an interface for POE applications. By default, it provides a fairly limited set of commands but is easily extended to provide whatever command set you require. In addition, if POE::Component::DebugShell version 1.018 or above is installed, a set of POE debug commands will be loaded.
Download (0.012MB)
Added: 2007-02-13 License: Perl Artistic License Price:
983 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 graph component 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