examples of mission statements
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 3727
Regular Statement String 2.5.7
Regular Statement String (RSS) provides several libraries in C, Java, and COM. more>>
Regular Statement String (RSS) provides several libraries in C, Java, and COM to implement and demonstrate the key-value development method using well-designed "strings" (RSS) as the media. Regular Statement String also shows a way to write "Process Oriented" applications.
Enhancements:
- This release adds an implementation for SUN Solaris (SPARC).
<<lessEnhancements:
- This release adds an implementation for SUN Solaris (SPARC).
Download (0.33MB)
Added: 2007-04-12 License: Freeware Price:
926 downloads
makepp_statements 1.50-cvs-070506
makepp_statements Perl package contains various statements in a makefile. more>>
makepp_statements Perl package contains various statements in a makefile.
and, build_cache, "build_check", define, else, enddef, endef, endif, "export", global, ifdef, "ifeq", "ifmakeperl", ifndef, ifneq, ifnsys, "ifperl", "ifsys", "include", "_include", load_makefile, make, perl, "makesub", no_implicit_load, or, perl, "perl_begin", perl_end, "prebuild", register_scanner, "register_command_parser", "register_input_suffix", repository, "runtime", signature, "sub"
A statement is any line beginning with a word which does not have a : in it. (A colon implies that the line is a rule.) For example, these are statements:
include extra_rules.mk
load_makefile subdir
Makepp has a number of builtin statements which you may occasionally need to use.
Note that wherever you see an underscore, you may also use a dash, because makepp converts dashes to underscores in statement names.
Conditionals
Conditionals are special statements, which control what lines of the Makeppfile are actually seen. The simplest form (where ifxxx stands for any of the conditional statements documented below) is:
ifxxx ...
lines seen if the statement evaluates as true
endif
or:
ifxxx ...
lines seen if the statement evaluates as true
else
lines seen if the statement evaluates as false
endif
There is also the possibility to do complex combinations like this:
ifxxx ...
and ifxxx ...
and ifxxx ...
or ifxxx ...
and ifxxx ...
lines seen if the combined statements evaluate as true
else ifxxx ...
or ifxxx ...
and ifxxx ...
lines seen if the first combination evaluates as false
and these combined statements evaluate as true
else
lines seen if the statements above evaluate as false
endif
As is suggested by the indentation, and has higher precedence than or. In other words an or elects between two groups of and`s. There may be any number of and ifxxx`s, or ifxxx`s and else ifxxx`s.
<<lessand, build_cache, "build_check", define, else, enddef, endef, endif, "export", global, ifdef, "ifeq", "ifmakeperl", ifndef, ifneq, ifnsys, "ifperl", "ifsys", "include", "_include", load_makefile, make, perl, "makesub", no_implicit_load, or, perl, "perl_begin", perl_end, "prebuild", register_scanner, "register_command_parser", "register_input_suffix", repository, "runtime", signature, "sub"
A statement is any line beginning with a word which does not have a : in it. (A colon implies that the line is a rule.) For example, these are statements:
include extra_rules.mk
load_makefile subdir
Makepp has a number of builtin statements which you may occasionally need to use.
Note that wherever you see an underscore, you may also use a dash, because makepp converts dashes to underscores in statement names.
Conditionals
Conditionals are special statements, which control what lines of the Makeppfile are actually seen. The simplest form (where ifxxx stands for any of the conditional statements documented below) is:
ifxxx ...
lines seen if the statement evaluates as true
endif
or:
ifxxx ...
lines seen if the statement evaluates as true
else
lines seen if the statement evaluates as false
endif
There is also the possibility to do complex combinations like this:
ifxxx ...
and ifxxx ...
and ifxxx ...
or ifxxx ...
and ifxxx ...
lines seen if the combined statements evaluate as true
else ifxxx ...
or ifxxx ...
and ifxxx ...
lines seen if the first combination evaluates as false
and these combined statements evaluate as true
else
lines seen if the statements above evaluate as false
endif
As is suggested by the indentation, and has higher precedence than or. In other words an or elects between two groups of and`s. There may be any number of and ifxxx`s, or ifxxx`s and else ifxxx`s.
Download (0.58MB)
Added: 2007-05-30 License: Perl Artistic License Price:
877 downloads
Mission Photo 0.5.2
Mission Photo, an easy-to-use photo management application for the Linux desktop. more>>
Mission Photo, an easy-to-use photo management application for the Linux desktop.
Main features:
- Detects attachment and detachment of digital cameras
- Imports photos from digital cameras
- Imports image files from disk
- Skips duplicate photos during import
- Losslessly rotates photos, fully preserving image quality
- Lets you rate, sort and filter your photos
- Lets you share your photos on Flickr
<<lessMain features:
- Detects attachment and detachment of digital cameras
- Imports photos from digital cameras
- Imports image files from disk
- Skips duplicate photos during import
- Losslessly rotates photos, fully preserving image quality
- Lets you rate, sort and filter your photos
- Lets you share your photos on Flickr
Download (0.92MB)
Added: 2006-12-24 License: GPL (GNU General Public License) Price:
1044 downloads
SQL::Statement::Embed 1.15
SQL::Statement::Embed can embed a SQL engine in a DBD or module. more>>
SQL::Statement::Embed can embed a SQL engine in a DBD or module.
SQL::Statement is designed to be easy to embed in other modules and to be especially easy to embed in DBI drivers. It provides a SQL Engine and the other module needs to then provide a data source and a storage mechanism. For example, the DBD::CSV module uses SQL::Statement as an embedded SQL engine by implementing a file-based data source and by using DBI as the user interface. Similarly DBD::Amazon uses SQL::Statement as its SQL engine, provides its own extensions to the supported SQL syntax, and uses on-the-fly searches of Amazon.com as its data source.
SQL::Statement is the basis for eight existing DBDs (DBI database drivers). If you have a new data source, you too can create a DBD without having to reinvent the SQL wheel. Its fun, its easy, become a DBD author today!
SQL::Statement can be also be embedded without DBI. Well explore that first since developing a DBD uses most of the same methods and techniques.
The role of SQL::Statement subclasses
SQL::Statement provides a SQL parsing and execution engine. It does not provide a data source or storage mechanism other than in-memory tables. The DBD::File module is a subclass of SQL::Statement that provides access to file-based storage mechanisms. Its quite possible to use things other than files as data souces, in which case we wouldnt use DBD::File, instead wed replace DBD::Files methods with our own. In the examples below, well use DBD::File, replacing only a few methods.
SQL::Statement provides SQL parsing and evaluation and DBD::File provides file-based storage. The only thing missing is a data source - what we actually want to store and query. As an example suppose we are going to create a subclass called Foo that will provide as a data source a simple file similar to a passwd file - one record per line, fields separated by colons, with only three fields "username, uid, gid".
Consider what needs to happen to perform a SELECT query on our Foo data:
* recieve a SQL string
* parse the SQL string into a request structure
* open the table(s) specified in the request
* define column names and postions for the table
* read rows from the table
* convert the rows from colon-separated format into perl arrays
* match the columns and rows against the requested selection criteria
* return requested rows and columns to the user
To perform operations like INSERT and DELETE, we also need to:
* convert rows from perl arrays into colon-separated format
* write rows
* delete rows
SQL::Statement takes care of all of the SQL parsing and evaluation. DBD::File takes care of file opening, reading, writing, and deleting. So the only things Foo is really responsible for are:
* define column names and postions for the table
* convert rows from colon-separated format into perl arrays
* convert rows from perl arrays into colon-separated format
In SQL::Statement subclasses these responsibilities are assigned to two objects, a ::Statement object is responsible for opening the table, defining the column names and positions, and for creating new ::Table objects. A ::Table object is responsible for reading, converting, writing, and deleting data.
<<lessSQL::Statement is designed to be easy to embed in other modules and to be especially easy to embed in DBI drivers. It provides a SQL Engine and the other module needs to then provide a data source and a storage mechanism. For example, the DBD::CSV module uses SQL::Statement as an embedded SQL engine by implementing a file-based data source and by using DBI as the user interface. Similarly DBD::Amazon uses SQL::Statement as its SQL engine, provides its own extensions to the supported SQL syntax, and uses on-the-fly searches of Amazon.com as its data source.
SQL::Statement is the basis for eight existing DBDs (DBI database drivers). If you have a new data source, you too can create a DBD without having to reinvent the SQL wheel. Its fun, its easy, become a DBD author today!
SQL::Statement can be also be embedded without DBI. Well explore that first since developing a DBD uses most of the same methods and techniques.
The role of SQL::Statement subclasses
SQL::Statement provides a SQL parsing and execution engine. It does not provide a data source or storage mechanism other than in-memory tables. The DBD::File module is a subclass of SQL::Statement that provides access to file-based storage mechanisms. Its quite possible to use things other than files as data souces, in which case we wouldnt use DBD::File, instead wed replace DBD::Files methods with our own. In the examples below, well use DBD::File, replacing only a few methods.
SQL::Statement provides SQL parsing and evaluation and DBD::File provides file-based storage. The only thing missing is a data source - what we actually want to store and query. As an example suppose we are going to create a subclass called Foo that will provide as a data source a simple file similar to a passwd file - one record per line, fields separated by colons, with only three fields "username, uid, gid".
Consider what needs to happen to perform a SELECT query on our Foo data:
* recieve a SQL string
* parse the SQL string into a request structure
* open the table(s) specified in the request
* define column names and postions for the table
* read rows from the table
* convert the rows from colon-separated format into perl arrays
* match the columns and rows against the requested selection criteria
* return requested rows and columns to the user
To perform operations like INSERT and DELETE, we also need to:
* convert rows from perl arrays into colon-separated format
* write rows
* delete rows
SQL::Statement takes care of all of the SQL parsing and evaluation. DBD::File takes care of file opening, reading, writing, and deleting. So the only things Foo is really responsible for are:
* define column names and postions for the table
* convert rows from colon-separated format into perl arrays
* convert rows from perl arrays into colon-separated format
In SQL::Statement subclasses these responsibilities are assigned to two objects, a ::Statement object is responsible for opening the table, defining the column names and positions, and for creating new ::Table objects. A ::Table object is responsible for reading, converting, writing, and deleting data.
Download (0.085MB)
Added: 2006-06-13 License: Perl Artistic License Price:
1230 downloads
GNUstep examples 1.1.0
GNUstep examples is a collection of programs that are meant to show programmers how to use GNUstep. more>>
GNUstep examples is a collection of programs that are meant to show programmers how to use GNUstep.
GNUstep examples includes a calculator, a currency converter, finger, fractal, puzzle, hostaddress, and ink (a simple editor).
Enhancements:
- Minor feature enhancements
<<lessGNUstep examples includes a calculator, a currency converter, finger, fractal, puzzle, hostaddress, and ink (a simple editor).
Enhancements:
- Minor feature enhancements
Download (0.23MB)
Added: 2006-09-13 License: GPL (GNU General Public License) Price:
1140 downloads
GCJ::Cni::Examples 0.03
GCJ::Cni::Examples is a Perl module with examples of how to use GCJs CNI interface to write Perl Modules in Java. more>>
GCJ::Cni::Examples is a Perl module with examples of how to use GCJs CNI interface to write Perl Modules in Java.
EXAMPLES
Writing Treaded modules in Java
One benefit of using GCJ is that it takes advantage of POSIX threading. This is nice since Perls threading model is, shall we say, less than ideal. Now, you could theoretically write a module in C or C++ and and use the standard POSIX library to do your threaded work for you, however, why not take advantage of the nice Threading interface that Java provides to you by default. This may also come in handy if you have a massively threaded Java library that youd like to call from Perl.
For this example assume that I want to do matrix multiplication, albeit in a very crazy manner. Therefore, I will write a Java class, Matrix, and a method, multiply, which will take another matrix to perform the operation between. Heres the crazy part, for each cell in the resulting matrix I will spawn a new thread, as an internal class, and give it a row and a column from which they will derive the result. I know this is a little wierd but the point is that Ill be spawning a lot of new threads. To multiply two 10x10 matrices we will have to spawn 100 threads (one thread per cell in the resulting 10x10 matrix). Imagine doing this in Perl, then imagine doing it in Java; natively compiled Java. Much faster and a lot less headaches.
The Java Interface/pseudocode is as follows:
public class Matrix {
public Matrix ( int numRows, int numCols ) {
...Constructor stuff...
}
public void set ( int row, int col, int val ) {
...set an element...
}
public int get ( int row, int col ) {
...get an element...
}
public Matrix multiply ( Matrix times ) {
...set it up...
for ( int i = 0; i < rows; i++ ) {
for ( int j = 0; j < times.getCols(); j++ ) {
//GO NUTS!!!!
ArrayMultiplier multiplier = new ArrayMultiplier(this, times, result, i, j);
multiplier.start();
...etc...
}
}
...wait for the threads to exit and return the new matrix...
}
public int getRows ( ) {
...get number of rows...
}
public int getCols ( ) {
...get number of columns...
}
public void print ( ) {
...print the matrix to stdout...
}
private class ArrayMultiplier extends Thread {
public ArrayMultiplier ( Matrix a, Matrix b, Matrix result, int row, int col ) {
...Construct this bad boy...
}
public void run ( ) {
int sum = 0;
for ( int i = 0; i < a.getCols(); i++ ) {
sum += (a.get(row, i) * b.get(i, col));
}
result.set(row, col, sum);
}
}
}
Now, we want to call this class from Perl. My perferred manner is through SWIG so thats what were going to use. However, you do not need to use SWIG, you can use whatever method you prefer when wrapping C++ classes. We begin by creating a C++ header file from our above class. This is done by using GCJs gcjh utility. First we need to class compile Matrix.java
gcj -C Matrix.java
Then we go ahead and create the header file:
gcjh Matrix
Easy enough. We can then extract the interface we want to have available in Perl from the generated header file and from it create a i file to be used as input to SWIG. I usually start by copying my header file to the same named file but with an i extension instead. I then remove all of the grimy C++ gruff, private methods and variables, slap a module directive on it and call it done. It wont always be this easy though. When youre done an interface file for the above class should look something like this:
%module Matrix;
typedef int jint;
class Matrix
{
public:
Matrix (jint, jint);
virtual void set (jint, jint, jint);
virtual jint get (jint, jint);
virtual ::Matrix *multiply (::Matrix *);
virtual jint getRows ();
virtual jint getCols ();
virtual void print ();
};
We then put SWIG to work and generate our C++ wrapper for Perl:
swig -perl -c++ Matrix.i
After the above command we now will see two new files in our current directory, Matrix.pm and Matrix_wrap.cxx; these correspond the module directive we gave in Matrix.i.
At this point all we have left to do is compile, and use.
gcj -c Matrix.java
gcc -c -I -include Matrix.h Matrix_wrap.cxx
gcc -shared -lgcj -lstdc++ Matrix.o Matrix_wrap.o -oMatrix.so
A simple Perl file using this module might look something like:
sub populate_matrix {
my $matrix = shift;
for ( my $i = 0; $i < $matrix->getRows(); $i++ ) {
for ( my $j = 0; $j < $matrix->getCols(); $j++ ) {
$matrix->set($i, $j, $i * $j);
}
}
}
use GCJ::Cni;
use Matrix;
GCJ::Cni::JvCreateJavaVM(undef);
GCJ::Cni::JvAttachCurrentThread(undef, undef);
my $matrix = new Matrix::Matrix(10, 10);
populate_matrix($matrix);
my $matrix2 = new Matrix::Matrix(10, 10);
populate_matrix($matrix2);
$matrix3 = $matrix->multiply($matrix2);
$matrix3->print();
GCJ::Cni::JvDetachCurrentThread();
Ill leave it up to the reader to write a Perl module that does the same thing, that is, spawns 100 threads. In my own personal fiddling I found that just spawning that many threads (never mind doing any kind of work) was over 3 time slower in Perl. In this situation we at least get to use our favorite language, Perl, and offload some of the heavy hitting to a language more suited for it.
Where this really comes in handy is when you have an existing multi-threaded Java library that you would like to expose to Perl. You could theoretically natively compile various components of your library and then generate Perl bindings to access it. In this way, you get a little extra speed and efficiency as well as code reuse and binding.
<<lessEXAMPLES
Writing Treaded modules in Java
One benefit of using GCJ is that it takes advantage of POSIX threading. This is nice since Perls threading model is, shall we say, less than ideal. Now, you could theoretically write a module in C or C++ and and use the standard POSIX library to do your threaded work for you, however, why not take advantage of the nice Threading interface that Java provides to you by default. This may also come in handy if you have a massively threaded Java library that youd like to call from Perl.
For this example assume that I want to do matrix multiplication, albeit in a very crazy manner. Therefore, I will write a Java class, Matrix, and a method, multiply, which will take another matrix to perform the operation between. Heres the crazy part, for each cell in the resulting matrix I will spawn a new thread, as an internal class, and give it a row and a column from which they will derive the result. I know this is a little wierd but the point is that Ill be spawning a lot of new threads. To multiply two 10x10 matrices we will have to spawn 100 threads (one thread per cell in the resulting 10x10 matrix). Imagine doing this in Perl, then imagine doing it in Java; natively compiled Java. Much faster and a lot less headaches.
The Java Interface/pseudocode is as follows:
public class Matrix {
public Matrix ( int numRows, int numCols ) {
...Constructor stuff...
}
public void set ( int row, int col, int val ) {
...set an element...
}
public int get ( int row, int col ) {
...get an element...
}
public Matrix multiply ( Matrix times ) {
...set it up...
for ( int i = 0; i < rows; i++ ) {
for ( int j = 0; j < times.getCols(); j++ ) {
//GO NUTS!!!!
ArrayMultiplier multiplier = new ArrayMultiplier(this, times, result, i, j);
multiplier.start();
...etc...
}
}
...wait for the threads to exit and return the new matrix...
}
public int getRows ( ) {
...get number of rows...
}
public int getCols ( ) {
...get number of columns...
}
public void print ( ) {
...print the matrix to stdout...
}
private class ArrayMultiplier extends Thread {
public ArrayMultiplier ( Matrix a, Matrix b, Matrix result, int row, int col ) {
...Construct this bad boy...
}
public void run ( ) {
int sum = 0;
for ( int i = 0; i < a.getCols(); i++ ) {
sum += (a.get(row, i) * b.get(i, col));
}
result.set(row, col, sum);
}
}
}
Now, we want to call this class from Perl. My perferred manner is through SWIG so thats what were going to use. However, you do not need to use SWIG, you can use whatever method you prefer when wrapping C++ classes. We begin by creating a C++ header file from our above class. This is done by using GCJs gcjh utility. First we need to class compile Matrix.java
gcj -C Matrix.java
Then we go ahead and create the header file:
gcjh Matrix
Easy enough. We can then extract the interface we want to have available in Perl from the generated header file and from it create a i file to be used as input to SWIG. I usually start by copying my header file to the same named file but with an i extension instead. I then remove all of the grimy C++ gruff, private methods and variables, slap a module directive on it and call it done. It wont always be this easy though. When youre done an interface file for the above class should look something like this:
%module Matrix;
typedef int jint;
class Matrix
{
public:
Matrix (jint, jint);
virtual void set (jint, jint, jint);
virtual jint get (jint, jint);
virtual ::Matrix *multiply (::Matrix *);
virtual jint getRows ();
virtual jint getCols ();
virtual void print ();
};
We then put SWIG to work and generate our C++ wrapper for Perl:
swig -perl -c++ Matrix.i
After the above command we now will see two new files in our current directory, Matrix.pm and Matrix_wrap.cxx; these correspond the module directive we gave in Matrix.i.
At this point all we have left to do is compile, and use.
gcj -c Matrix.java
gcc -c -I -include Matrix.h Matrix_wrap.cxx
gcc -shared -lgcj -lstdc++ Matrix.o Matrix_wrap.o -oMatrix.so
A simple Perl file using this module might look something like:
sub populate_matrix {
my $matrix = shift;
for ( my $i = 0; $i < $matrix->getRows(); $i++ ) {
for ( my $j = 0; $j < $matrix->getCols(); $j++ ) {
$matrix->set($i, $j, $i * $j);
}
}
}
use GCJ::Cni;
use Matrix;
GCJ::Cni::JvCreateJavaVM(undef);
GCJ::Cni::JvAttachCurrentThread(undef, undef);
my $matrix = new Matrix::Matrix(10, 10);
populate_matrix($matrix);
my $matrix2 = new Matrix::Matrix(10, 10);
populate_matrix($matrix2);
$matrix3 = $matrix->multiply($matrix2);
$matrix3->print();
GCJ::Cni::JvDetachCurrentThread();
Ill leave it up to the reader to write a Perl module that does the same thing, that is, spawns 100 threads. In my own personal fiddling I found that just spawning that many threads (never mind doing any kind of work) was over 3 time slower in Perl. In this situation we at least get to use our favorite language, Perl, and offload some of the heavy hitting to a language more suited for it.
Where this really comes in handy is when you have an existing multi-threaded Java library that you would like to expose to Perl. You could theoretically natively compile various components of your library and then generate Perl bindings to access it. In this way, you get a little extra speed and efficiency as well as code reuse and binding.
Download (0.020MB)
Added: 2007-06-04 License: Perl Artistic License Price:
877 downloads
Language::Basic::Expression 1.44
Language::Basic::Expression is a Perl package to handle string, numeric, and boolean expressions. more>>
Language::Basic::Expression is a Perl package to handle string, numeric, and boolean expressions.
SYNOPSIS
See Language::Basic for the overview of how the Language::Basic module works. This pod page is more technical.
# Given an LB::Token::Group, create an expression I parse it
my $exp = new LB::Expression::Arithmetic $token_group;
# Whats the value of the expression?
print $exp->evaluate;
# Perl equivalent of the BASIC expression
print $exp->output_perl;
Expressions are basically the building blocks of Statements, in that every BASIC statement is made up of keywords (like GOTO, TO, STEP) and expressions. So expressions include not just the standard arithmetic and boolean expressions (like 1 + 2), but also lvalues (scalar variables or arrays), functions, and constants. See Language::Basic::Syntax for details on the way expressions are built.
BASIC expressions are represented by various objects of subclasses of Language::Basic::Expression. Most LB::Expressions are in turn made up of other LB::Expressions. For example an LBE::Arithmetic may be made up of two LBE::Multiplicative and a "plus". "Atoms" (indivisible LBEs) include things like LBE::Constants and LBE::Lvalues (variables).
<<lessSYNOPSIS
See Language::Basic for the overview of how the Language::Basic module works. This pod page is more technical.
# Given an LB::Token::Group, create an expression I parse it
my $exp = new LB::Expression::Arithmetic $token_group;
# Whats the value of the expression?
print $exp->evaluate;
# Perl equivalent of the BASIC expression
print $exp->output_perl;
Expressions are basically the building blocks of Statements, in that every BASIC statement is made up of keywords (like GOTO, TO, STEP) and expressions. So expressions include not just the standard arithmetic and boolean expressions (like 1 + 2), but also lvalues (scalar variables or arrays), functions, and constants. See Language::Basic::Syntax for details on the way expressions are built.
BASIC expressions are represented by various objects of subclasses of Language::Basic::Expression. Most LB::Expressions are in turn made up of other LB::Expressions. For example an LBE::Arithmetic may be made up of two LBE::Multiplicative and a "plus". "Atoms" (indivisible LBEs) include things like LBE::Constants and LBE::Lvalues (variables).
Download (0.051MB)
Added: 2006-09-29 License: Perl Artistic License Price:
1121 downloads
DBIx::Simple::Examples 1.30
DBIx::Simple provides a simplified interface to DBI, Perls powerful database module. more>>
[COPRIGHT=1]
EXAMPLES
General
#!/usr/bin/perl -w
use strict;
use DBIx::Simple;
# Instant database with DBD::SQLite
my $db = DBIx::Simple->connect(dbi:SQLite:dbname=file.dat)
or die DBIx::Simple->error;
# Connecting to a MySQL database
my $db = DBIx::Simple->connect(
DBI:mysql:database=test, # DBI source specification
test, test, # Username and password
{ RaiseError => 1 } # Additional options
);
# Using an existing database handle
my $db = DBIx::Simple->connect($dbh);
# Abstracted example: $db->query($query, @variables)->what_you_want;
$db->commit or die $db->error;
Simple Queries
$db->query(DELETE FROM foo WHERE id = ?, $id) or die $db->error;
for (1..100) {
$db->query(
INSERT INTO randomvalues VALUES (?, ?),
int rand(10),
int rand(10)
) or die $db->error;
}
$db->query(
INSERT INTO sometable VALUES (??),
$first, $second, $third, $fourth, $fifth, $sixth
);
# (??) is expanded to (?, ?, ?, ?, ?, ?) automatically
Single row queries
my ($two) = $db->query(SELECT 1 + 1)->list;
my ($three, $four) = $db->query(SELECT 3, 2 + 2)->list;
my ($name, $email) = $db->query(
SELECT name, email FROM people WHERE email = ? LIMIT 1,
$mail
)->list;
Or, more efficiently:
$db->query(SELECT 1 + 1)->into(my $two);
$db->query(SELECT 3, 2 + 2)->into(my ($three, $four));
$db->query(
SELECT name, email FROM people WHERE email = ? LIMIT 1,
$mail
)->into(my ($name, $email));
<<lessEXAMPLES
General
#!/usr/bin/perl -w
use strict;
use DBIx::Simple;
# Instant database with DBD::SQLite
my $db = DBIx::Simple->connect(dbi:SQLite:dbname=file.dat)
or die DBIx::Simple->error;
# Connecting to a MySQL database
my $db = DBIx::Simple->connect(
DBI:mysql:database=test, # DBI source specification
test, test, # Username and password
{ RaiseError => 1 } # Additional options
);
# Using an existing database handle
my $db = DBIx::Simple->connect($dbh);
# Abstracted example: $db->query($query, @variables)->what_you_want;
$db->commit or die $db->error;
Simple Queries
$db->query(DELETE FROM foo WHERE id = ?, $id) or die $db->error;
for (1..100) {
$db->query(
INSERT INTO randomvalues VALUES (?, ?),
int rand(10),
int rand(10)
) or die $db->error;
}
$db->query(
INSERT INTO sometable VALUES (??),
$first, $second, $third, $fourth, $fifth, $sixth
);
# (??) is expanded to (?, ?, ?, ?, ?, ?) automatically
Single row queries
my ($two) = $db->query(SELECT 1 + 1)->list;
my ($three, $four) = $db->query(SELECT 3, 2 + 2)->list;
my ($name, $email) = $db->query(
SELECT name, email FROM people WHERE email = ? LIMIT 1,
)->list;
Or, more efficiently:
$db->query(SELECT 1 + 1)->into(my $two);
$db->query(SELECT 3, 2 + 2)->into(my ($three, $four));
$db->query(
SELECT name, email FROM people WHERE email = ? LIMIT 1,
)->into(my ($name, $email));
Download (0.015MB)
Added: 2007-05-10 License: Public Domain Price:
897 downloads
Java::Import::Examples 0.03
Java::Import::Examples is an example of how to use Java::Import to call into Java classes. more>>
Java::Import::Examples is an example of how to use Java::Import to call into Java classes.
Making RMI calls from Perl
One nice thing about Java is the extremely straight forward manner in which it allows you to make calls to remote objects residing on distant servers. Many people use this ability as a point of integration between their system and a posible third party or legacy system. Unfortunatly, for the most part the ability to make calls to these remote objects is something that only other Java applications can do without making a big fuss about it. However, we can now do this from Perl.
Assume that I have a RMI server from which I can get data from in the form of simple Java Beans. One method of doing this is to use the GCJ::Cni library and natively compile and wrap a set of Java Classes which can then be used from my Perl script. However, there is an easier way.
Lets begin by descriping the Java interfaces that well be working with. We first have the Remote Interface that we will be interacting with:
import java.rmi.*;
public interface RemoteInterface extends Remote {
public SomeBean getMessage(String seedMessage) throws RemoteException;
}
And we also have the bean we will be asking for:
import java.io.*;
public class SomeBean implements Serializable {
private String value;
public SomeBean() {}
public void setValue ( String _value ) { ... }
public String getValue ( ) { ... }
}
As far as any Perl client program is concerned this is all we need to know about.
Now all there is left to do is write a client:
use Java::Import qw(
java.rmi.Naming
);
my $remote_interface = java::rmi::Naming->lookup(jstring("//localhost/Home"));
my $bean = $remote_interface->getMessage(jstring("Hi there"));
print $bean->getValue(), "n";
Thats all there is. Notice that all we had to tell Java::Import about was java.rmi.Naming, this is because it was the only class we used by name in our Perl code, every other Java class (the objects held by $bean and $remote_interface) was returned by some other method call originating from java.rmi.Naming.
In order to run this example we have to make sure everything is in its place. We start by compiling the client code. Assuming that we have been given a Stub class file (RemoteObject_Stub.class) we can do the following:
gcj -C SomeBean.java RemoteInterface.java
fastjar -cvf client.jar SomeBean.class RemoteInterface.class RemoteObject_Stub.class
Making sure our server is reachable we can then run the client code:
CLASSPATH=client.jar perl client.pl
Thats it, you should then see the message returned by your server.
<<lessMaking RMI calls from Perl
One nice thing about Java is the extremely straight forward manner in which it allows you to make calls to remote objects residing on distant servers. Many people use this ability as a point of integration between their system and a posible third party or legacy system. Unfortunatly, for the most part the ability to make calls to these remote objects is something that only other Java applications can do without making a big fuss about it. However, we can now do this from Perl.
Assume that I have a RMI server from which I can get data from in the form of simple Java Beans. One method of doing this is to use the GCJ::Cni library and natively compile and wrap a set of Java Classes which can then be used from my Perl script. However, there is an easier way.
Lets begin by descriping the Java interfaces that well be working with. We first have the Remote Interface that we will be interacting with:
import java.rmi.*;
public interface RemoteInterface extends Remote {
public SomeBean getMessage(String seedMessage) throws RemoteException;
}
And we also have the bean we will be asking for:
import java.io.*;
public class SomeBean implements Serializable {
private String value;
public SomeBean() {}
public void setValue ( String _value ) { ... }
public String getValue ( ) { ... }
}
As far as any Perl client program is concerned this is all we need to know about.
Now all there is left to do is write a client:
use Java::Import qw(
java.rmi.Naming
);
my $remote_interface = java::rmi::Naming->lookup(jstring("//localhost/Home"));
my $bean = $remote_interface->getMessage(jstring("Hi there"));
print $bean->getValue(), "n";
Thats all there is. Notice that all we had to tell Java::Import about was java.rmi.Naming, this is because it was the only class we used by name in our Perl code, every other Java class (the objects held by $bean and $remote_interface) was returned by some other method call originating from java.rmi.Naming.
In order to run this example we have to make sure everything is in its place. We start by compiling the client code. Assuming that we have been given a Stub class file (RemoteObject_Stub.class) we can do the following:
gcj -C SomeBean.java RemoteInterface.java
fastjar -cvf client.jar SomeBean.class RemoteInterface.class RemoteObject_Stub.class
Making sure our server is reachable we can then run the client code:
CLASSPATH=client.jar perl client.pl
Thats it, you should then see the message returned by your server.
Download (0.028MB)
Added: 2007-06-01 License: Perl Artistic License Price:
876 downloads
WWW::Mechanize::Examples 1.30
WWW::Mechanize::Examples is a Perl module with sample programs that use WWW::Mechanize. more>>
SYNOPSIS
Plenty of people have learned WWW::Mechanize, and now, you can too!
Following are user-supplied samples of WWW::Mechanize in action.
You can also look at the t/*.t files in the distribution.
Please note that these examples are not intended to do any specific task. For all I know, theyre no longer functional because the sites they hit have changed. Theyre here to give examples of how people have used WWW::Mechanize.
Note that the examples are in reverse order of my having received them, so the freshest examples are always at the top.
Starbucks Density Calculator, by Nat Torkington
Heres a pair of scripts from Nat Torkington, editor for OReilly Media and co-author of the Perl Cookbook.
Rael [Dornfest] discovered that you can easily find out how many Starbucks there are in an area by searching for "Starbucks". So I wrote a silly scraper for some old census data and came up with some Starbucks density figures. Theres no meaning to these numbers thanks to errors from using old census data coupled with false positives in Yahoo search (e.g., "Dodie Starbuck-Your Style Desgn" in Portland OR). But it was fun to waste a night on.
Here are the top twenty cities in descending order of population, with the amount of territory each Starbucks has. E.g., A New York NY Starbucks covers 1.7 square miles of ground.
New York, NY 1.7
Los Angeles, CA 1.2
Chicago, IL 1.0
Houston, TX 4.6
Philadelphia, PA 6.8
San Diego, CA 2.7
Detroit, MI 19.9
Dallas, TX 2.7
Phoenix, AZ 4.1
San Antonio, TX 12.3
San Jose, CA 1.1
Baltimore, MD 3.9
Indianapolis, IN 12.1
San Francisco, CA 0.5
Jacksonville, FL 39.9
Columbus, OH 7.3
Milwaukee, WI 5.1
Memphis, TN 15.1
Washington, DC 1.4
Boston, MA 0.5
Download (0.10MB)
Added: 2007-07-20 License: Perl Artistic License Price:
828 downloads
2E Programming Language 0.8.2
2E Programming Language is a simple algebraic syntax language. more>>
2E Programming Language (two es, as in ee, or expression evaluator) is a simple algebraic syntax language. It natively supports expressions (composed of operators and operands), and function definitions, and basically nothing else. Therefore, it can be fairly straight-forward to learn (assuming you are already familiar with general programming constructs).
The language itself is refered to as 2e, however the interpreter is called ee.
An operand can be a literal, such as a numeric value (integer or floating point), a quoted string, a single-quoted character, a variable or a function call. Operators consist of the standard algebraic operators (i.e., *, /, +, -), assignment ("="), logical operators (, =, ==), sub-expression join operator (";"), and a conditional operator pair ("? :") like in C. Also added, is an iterative conditional pair ("?? :").
Heres a couple of examples:
ee -p 2 + 3 * 7
23
In this case, when called with the "-p" flag, the next parameter is evaluated and the final result printed. The "-c" flag does the same thing, but doesnt print the final result (use this when the expression already contains output statements).
ee -c x = 7; y = 11; z = (x * y); print(z; "n")
77
The ";" operator isnt really a statement terminator, it is actually a join operator. It evaluates the left and right expressions, and returns the result of the right hand side. It has the lowest order of precedence, so in general use you can treat it like a statement terminator (however it can be used in the middle of a larger expression, such as within parentheses grouping). It also does double-duty as a function parameter delimeter, such as the print function in the previous example.
The way that the "?" (conditoinal) operator works is as follows:
result = expr_test ? expr_true : expr_false
If expr_test is true (non-zero), then expr_true is evaluated and returned, otherwise expr_false is evaluated and returned. This is just like the inline conditional in C.
Also supported, is the iterative conditional:
result = expr_test ?? expr_true : expr_false
This will evaluate expr_test repeatedly, and as long as it is true, will evaluate expr_true. Once expr_test becomes false, then the final expr_true value is returned as the result of the whole expression. However, if expr_test never was true to begin with, then and only then is expr_false evaluated and returned. Therefore, expr_false can be used for some error handling, for example.
If an operator of lower precedence than ? or ?? is encounterd such as the ";" (join) operator, then a default false target will automatically be assumed. Therefore,
result = expr_test ? expr_true : 0; ...
result = expr_test ? expr_true; ...
are both the same. Heres a more extensive example, highlighting a few more of the operands avaliable. This example also calls the interpreter using the unix "#!" syntax, same as what is used for other scripting languages.
#!/usr/local/bin/ee
# This is a comment
i = 0;
x = 0;
i < 10 ?? ( # Read this as "while i is less than 10"
j = 0;
j < 5 ?? ( # while j < 5
array[i][j] = x; # here we are assigning a value to a 2-dimentional array
j++;
x++
);
i++
)
This example uses the iterative conditional operator to initialize an array. Notice the missing ";" after x++ and i++. this is because they are not followed by an operand (instead, in this case are followed by a closing parenthese). The ";" operator is a binary operator, no different than +, -, *, /, etc. Therefore, it is only used between to operands or two sub-expressions.
Enhancements:
- This release adds a bunch of functions to round out the string handling capabilities of 2e.
- Also added are "anonymous" functions, bitwise operators, and a few code cleanups.
<<lessThe language itself is refered to as 2e, however the interpreter is called ee.
An operand can be a literal, such as a numeric value (integer or floating point), a quoted string, a single-quoted character, a variable or a function call. Operators consist of the standard algebraic operators (i.e., *, /, +, -), assignment ("="), logical operators (, =, ==), sub-expression join operator (";"), and a conditional operator pair ("? :") like in C. Also added, is an iterative conditional pair ("?? :").
Heres a couple of examples:
ee -p 2 + 3 * 7
23
In this case, when called with the "-p" flag, the next parameter is evaluated and the final result printed. The "-c" flag does the same thing, but doesnt print the final result (use this when the expression already contains output statements).
ee -c x = 7; y = 11; z = (x * y); print(z; "n")
77
The ";" operator isnt really a statement terminator, it is actually a join operator. It evaluates the left and right expressions, and returns the result of the right hand side. It has the lowest order of precedence, so in general use you can treat it like a statement terminator (however it can be used in the middle of a larger expression, such as within parentheses grouping). It also does double-duty as a function parameter delimeter, such as the print function in the previous example.
The way that the "?" (conditoinal) operator works is as follows:
result = expr_test ? expr_true : expr_false
If expr_test is true (non-zero), then expr_true is evaluated and returned, otherwise expr_false is evaluated and returned. This is just like the inline conditional in C.
Also supported, is the iterative conditional:
result = expr_test ?? expr_true : expr_false
This will evaluate expr_test repeatedly, and as long as it is true, will evaluate expr_true. Once expr_test becomes false, then the final expr_true value is returned as the result of the whole expression. However, if expr_test never was true to begin with, then and only then is expr_false evaluated and returned. Therefore, expr_false can be used for some error handling, for example.
If an operator of lower precedence than ? or ?? is encounterd such as the ";" (join) operator, then a default false target will automatically be assumed. Therefore,
result = expr_test ? expr_true : 0; ...
result = expr_test ? expr_true; ...
are both the same. Heres a more extensive example, highlighting a few more of the operands avaliable. This example also calls the interpreter using the unix "#!" syntax, same as what is used for other scripting languages.
#!/usr/local/bin/ee
# This is a comment
i = 0;
x = 0;
i < 10 ?? ( # Read this as "while i is less than 10"
j = 0;
j < 5 ?? ( # while j < 5
array[i][j] = x; # here we are assigning a value to a 2-dimentional array
j++;
x++
);
i++
)
This example uses the iterative conditional operator to initialize an array. Notice the missing ";" after x++ and i++. this is because they are not followed by an operand (instead, in this case are followed by a closing parenthese). The ";" operator is a binary operator, no different than +, -, *, /, etc. Therefore, it is only used between to operands or two sub-expressions.
Enhancements:
- This release adds a bunch of functions to round out the string handling capabilities of 2e.
- Also added are "anonymous" functions, bitwise operators, and a few code cleanups.
Download (0.031MB)
Added: 2006-12-26 License: GPL (GNU General Public License) Price:
1032 downloads
DBA Companion 1.5
DBA Companion is a free open-source Oracle administration tool. more>>
DBA Companion is a free open-source Oracle administration tool.
I am building this tool for my own needs. This means, it does not necessarily contain all the information you can extract from an Oracle database nor all the information that *you* may require.
Configuration:
Set LD_LIBRARY_PATH (SHLIB_PATH on HP) to point to $ORACLE_HOME/lib and the QT library directory. Also set DBACOMP_INI to the dbacomp.ini file (with the full path).
E.g.: DBACOMP_INI=/usr/local/dbacomp/dbacomp.ini.
Open dbacomp.ini and set the variables sql_cache_file, sql_generation and user_sql.
sql_cache_file_prefix: Tells DBAComp where to find the SQL statements files.
These files contain all the SQL that DBAComp uses (see
later). The prefix comprises the full path plus the
common beginning of the name of the file.
sql_generation: The directory where you want DBAComp to store the SQL
scripts that you may generate with it.
user_sql: Indicates the location of the file that contains the
users *own* SQL statements (for more details see below).
sql_cache_file_prefix and user_sql must be set to the fully qualified file name. By default the files are called user.sql and dbacomp.
Example: sql_cache_file_prefix=/opt/dbacomp/dbacomp
user_sql=/opt/dbacomp/user.sql
If you dont set any of these variables (DBACOMP_INI, sql_cache_file_prefix, user_sql), DBAComp will look for these files in the local directory (i.e. the directory where you have started DBAComp from) using the default names.
Now start the program by typing ./dbacomp.
Logon and ENJOY!
BTW: You can also start dbacomp with the username/password[@tnsalias] on the command line (i.e.: ./dbacomp scott/tiger@orcl). Also OPS$ (automatic) logons are supported (e.g. ./dbacomp / or ./dbacomp /@orcl).
Enhancements:
- The main new features are the adaptation to Oracle10G, charting capabilities, and the integration of Statspack and AWR analysis modules.
- This release corrects a number of problems from the previous version.
<<lessI am building this tool for my own needs. This means, it does not necessarily contain all the information you can extract from an Oracle database nor all the information that *you* may require.
Configuration:
Set LD_LIBRARY_PATH (SHLIB_PATH on HP) to point to $ORACLE_HOME/lib and the QT library directory. Also set DBACOMP_INI to the dbacomp.ini file (with the full path).
E.g.: DBACOMP_INI=/usr/local/dbacomp/dbacomp.ini.
Open dbacomp.ini and set the variables sql_cache_file, sql_generation and user_sql.
sql_cache_file_prefix: Tells DBAComp where to find the SQL statements files.
These files contain all the SQL that DBAComp uses (see
later). The prefix comprises the full path plus the
common beginning of the name of the file.
sql_generation: The directory where you want DBAComp to store the SQL
scripts that you may generate with it.
user_sql: Indicates the location of the file that contains the
users *own* SQL statements (for more details see below).
sql_cache_file_prefix and user_sql must be set to the fully qualified file name. By default the files are called user.sql and dbacomp.
Example: sql_cache_file_prefix=/opt/dbacomp/dbacomp
user_sql=/opt/dbacomp/user.sql
If you dont set any of these variables (DBACOMP_INI, sql_cache_file_prefix, user_sql), DBAComp will look for these files in the local directory (i.e. the directory where you have started DBAComp from) using the default names.
Now start the program by typing ./dbacomp.
Logon and ENJOY!
BTW: You can also start dbacomp with the username/password[@tnsalias] on the command line (i.e.: ./dbacomp scott/tiger@orcl). Also OPS$ (automatic) logons are supported (e.g. ./dbacomp / or ./dbacomp /@orcl).
Enhancements:
- The main new features are the adaptation to Oracle10G, charting capabilities, and the integration of Statspack and AWR analysis modules.
- This release corrects a number of problems from the previous version.
Download (0.72MB)
Added: 2007-01-03 License: GPL (GNU General Public License) Price:
1026 downloads
Project: Starfighter 1.1
Project: Starfighter is a 2D mission-based shoot-em-up game. more>>
After decades of war one company, who had gained powerful supplying both sides with weaponary, steps forwards and crushes both warring factions in one swift movement.
Using far superior weaponary and AI craft, the company was completely unstoppable and now no one can stand in their way.
Thousands began to perish under the iron fist of the company. The people cried out for a saviour, for someone to light this dark hour... and someone did.
Main features:
- 26 missions over 4 star systems
- Primary and Secondary Weapons (including a laser cannon and a charge weapon)
- A weapon powerup system
- Wingmates
- Missions with Primary and Secondary Objectives
- A Variety of Missions (Protect, Destroy, etc)
- 13 different music tracks
- Boss battles
<<lessUsing far superior weaponary and AI craft, the company was completely unstoppable and now no one can stand in their way.
Thousands began to perish under the iron fist of the company. The people cried out for a saviour, for someone to light this dark hour... and someone did.
Main features:
- 26 missions over 4 star systems
- Primary and Secondary Weapons (including a laser cannon and a charge weapon)
- A weapon powerup system
- Wingmates
- Missions with Primary and Secondary Objectives
- A Variety of Missions (Protect, Destroy, etc)
- 13 different music tracks
- Boss battles
Download (2.3MB)
Added: 2005-09-06 License: GPL (GNU General Public License) Price:
1508 downloads
Learn HTML By Example 1.03
Learn HTML By Example is a sweet little JavaScript / HTML program. more>>
Learn HTML By Example is a sweet little JavaScript / HTML program that allows you to see the HTML you input into on side displayed as a web page on the other.
To install the program, just download it from Web Design Factory, and upload it to your web site.
Main features:
- Easy installation. Just upload to your web site and youre done!
- Immediate feedback on testing HTML and CSS code
- Several examples of commonly used HTML and CSS elements
- No page refreshing required
- Easy to expand by adding new examples
<<lessTo install the program, just download it from Web Design Factory, and upload it to your web site.
Main features:
- Easy installation. Just upload to your web site and youre done!
- Immediate feedback on testing HTML and CSS code
- Several examples of commonly used HTML and CSS elements
- No page refreshing required
- Easy to expand by adding new examples
Download (0.008MB)
Added: 2005-12-19 License: Freeware Price:
1406 downloads
XML::Smart::Tutorial 1.6.9
XML::Smart::Tutorial is a Perl module with tutorials and examples for XML::Smart. more>>
XML::Smart::Tutorial is a Perl module with tutorials and examples for XML::Smart.
SYNOPSIS
This document is a tutorial for XML::Smart and shows some examples of usual things.
<<lessSYNOPSIS
This document is a tutorial for XML::Smart and shows some examples of usual things.
Download (0.049MB)
Added: 2006-09-12 License: GPL (GNU General Public License) Price:
1144 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 examples of mission statements 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