wallet inserts
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 574
INSERT 1.3.9b
INSERT aims to be a multi-functional, multi-purpose disaster recovery and network analysis system. more>>
INSERT (the Inside Security Rescue Toolkit) aims to be a multi-functional, multi-purpose disaster recovery and network analysis system. It boots from a credit card-sized CD-ROM and is basically a stripped-down version of Knoppix. It features good hardware detection, fluxbox, emelfm, links-hacked, ssh, tcpdump, nmap, chntpwd, and much more.
INSERT provides full read-write support for NTFS partitions (using captive), and the ClamAV virus scanner (including a fairly recent signature database and a GUI). It also has a network boot facility.
Main features:
- full read-write support for NTFS-partitions using captive
- support for various file system types: EXT2,EXT3,MINIX,REISERFS,JFS,XFS,NTFS,FAT,MSDOS,NFS,SMBFS,NCPFS,UDF,UFS,HFS,HFS+
- support for linux software RAID and LVM
- support for WLAN adapters
- network analysis (e.g. nmap, tcpdump)
- disaster recovery (e.g. parted, gpart, partimage, testdisk, recover)
- virus scanning (Clam Antivirus)
- computer forensics (e.g. chkrootkit, rootkit hunter)
- surf the internet (e.g. links-hacked, AxY FTP)
- network boot server to boot network boot enabled clients that cannot boot from the CD
- based on Linux kernel 2.4.27 and Knoppix 3.6
<<lessINSERT provides full read-write support for NTFS partitions (using captive), and the ClamAV virus scanner (including a fairly recent signature database and a GUI). It also has a network boot facility.
Main features:
- full read-write support for NTFS-partitions using captive
- support for various file system types: EXT2,EXT3,MINIX,REISERFS,JFS,XFS,NTFS,FAT,MSDOS,NFS,SMBFS,NCPFS,UDF,UFS,HFS,HFS+
- support for linux software RAID and LVM
- support for WLAN adapters
- network analysis (e.g. nmap, tcpdump)
- disaster recovery (e.g. parted, gpart, partimage, testdisk, recover)
- virus scanning (Clam Antivirus)
- computer forensics (e.g. chkrootkit, rootkit hunter)
- surf the internet (e.g. links-hacked, AxY FTP)
- network boot server to boot network boot enabled clients that cannot boot from the CD
- based on Linux kernel 2.4.27 and Knoppix 3.6
Download (59.3MB)
Added: 2007-02-28 License: GPL (GNU General Public License) Price:
975 downloads
WAVE Utilities 1.18
WAVE Utilities package contains three programs for dealing with WAVE format audio files. more>>
WAVE Utilities package contains three programs for dealing with WAVE format audio files.
SimplifyWave
The standard permits WAVE format audio files to contain a variety of chunks, such as playlists, cue lists, and padding. A fair amount of software, however, is unable to parse such complex files. This program converts complex WAVE files into the simplest standard-conforming format by stripping out everything other than the obligatory format chunk and the first data chunk. Messages are printed indicating what chunks have been removed.
RepairWave
Some software generates non-conformant files that purport to be WAVE files. They contain a WAVE header but lack the obligatory data chunk id and size information. The audio data immediately follows the header. This program inserts the missing data chunk id and size information and updates the WAVE chunk size information in the header to reflect this.
InfoWave
Extracts information from a RIFF/WAV or RIFX/WAV file and reports on the contents of the file. It shows the size, type, and location of each chunk and gives the encoding of the audio data, its sampling rate, resolution, number of channels and other information. Typical output looks like this:
0: RIFF identifier.
4: chunk size = 38,642 bytes.
8: WAV identifier.
12: format chunk identifier
16: format chunk size = 18 bytes.
20: data format: PCM.
22: one channel (mono).
24: Sampling Rate = 11,025 samples per second.
28: Average Data Rate = 11,025 bytes per second.
32: Bytes_Per_Sample value of 1 indicates 8-bit mono
34: Bits_Per_Sample = 8.
36: chunk id
40: chunk length
44: chunk of type fact (standard) length 4 bytes
48: chunk id
52: chunk length
56: chunk of type data (standard) length 38,591 bytes
amounting to 0 minutes and 3.5 seconds
These programs were originally called SimplifyWav, wavrepair, and wavinfo.
Enhancements:
- The programs have been adapted to run correctly on 64-bit architectures as well as 32-bit architectures.
- They should now compile on systems whose printf does not support thousands separators.
<<lessSimplifyWave
The standard permits WAVE format audio files to contain a variety of chunks, such as playlists, cue lists, and padding. A fair amount of software, however, is unable to parse such complex files. This program converts complex WAVE files into the simplest standard-conforming format by stripping out everything other than the obligatory format chunk and the first data chunk. Messages are printed indicating what chunks have been removed.
RepairWave
Some software generates non-conformant files that purport to be WAVE files. They contain a WAVE header but lack the obligatory data chunk id and size information. The audio data immediately follows the header. This program inserts the missing data chunk id and size information and updates the WAVE chunk size information in the header to reflect this.
InfoWave
Extracts information from a RIFF/WAV or RIFX/WAV file and reports on the contents of the file. It shows the size, type, and location of each chunk and gives the encoding of the audio data, its sampling rate, resolution, number of channels and other information. Typical output looks like this:
0: RIFF identifier.
4: chunk size = 38,642 bytes.
8: WAV identifier.
12: format chunk identifier
16: format chunk size = 18 bytes.
20: data format: PCM.
22: one channel (mono).
24: Sampling Rate = 11,025 samples per second.
28: Average Data Rate = 11,025 bytes per second.
32: Bytes_Per_Sample value of 1 indicates 8-bit mono
34: Bits_Per_Sample = 8.
36: chunk id
40: chunk length
44: chunk of type fact (standard) length 4 bytes
48: chunk id
52: chunk length
56: chunk of type data (standard) length 38,591 bytes
amounting to 0 minutes and 3.5 seconds
These programs were originally called SimplifyWav, wavrepair, and wavinfo.
Enhancements:
- The programs have been adapted to run correctly on 64-bit architectures as well as 32-bit architectures.
- They should now compile on systems whose printf does not support thousands separators.
Download (0.077MB)
Added: 2007-05-13 License: GPL (GNU General Public License) Price:
903 downloads
Title Save 0.1d
Title Save is a Firefox extension that replicates IEs default behavior when saving a webpage. more>>
Title Save is a Firefox extension that replicates IEs default behavior when saving a webpage, placing the pages title as filename.
Also, if the page is saved as "Complete", the corresponding URL is inserted as an HTML comment at the top of the file.
<<lessAlso, if the page is saved as "Complete", the corresponding URL is inserted as an HTML comment at the top of the file.
Download (0.005MB)
Added: 2007-06-21 License: MPL (Mozilla Public License) Price:
860 downloads
alterMIME 0.3.8
alterMIME is a small program which is used to alter your mime-encoded mailpacks. more>>
alterMIME is a small program which is used to alter your mime-encoded mailpacks as typically received by Xamime, Inflex and AMaViS.
Main features:
- Insert disclaimers
- Insert arbitary X-headers
- Modify existing headers
- Remove attachments based on filename or content-type
- Replace attachments based on filename
Enhancements:
- The FFGET engine has been updated.
- Fixed Outlook Calendar kludging has been fixed.
- BASE64 disclaimer insertions have been added.
<<lessMain features:
- Insert disclaimers
- Insert arbitary X-headers
- Modify existing headers
- Remove attachments based on filename or content-type
- Replace attachments based on filename
Enhancements:
- The FFGET engine has been updated.
- Fixed Outlook Calendar kludging has been fixed.
- BASE64 disclaimer insertions have been added.
Download (0.074MB)
Added: 2007-07-14 License: BSD License Price:
835 downloads
Database Functions 1.0
Database Functions is a PHP class that can be used to build and execute MySQL database queries. more>>
Database Functions is a PHP class that can be used to build and execute MySQL database queries.
It can build SELECT, INSERT, UPDATE and DELETE queries from lists of parameters and values.
The class can also execute the generated queries and retrieve the SELECT query results into associative arrays.
<<lessIt can build SELECT, INSERT, UPDATE and DELETE queries from lists of parameters and values.
The class can also execute the generated queries and retrieve the SELECT query results into associative arrays.
Download (MB)
Added: 2007-07-19 License: GPL (GNU General Public License) Price:
830 downloads
Truecrypt mount/unmount scripts 1.2
Truecrypt mount/unmount scripts contains two .sh files for mounting and unmounting truecrypt partitions with some dialogues. more>>
Truecrypt mount/unmount scripts contains two .sh files for mounting and unmounting truecrypt partitions with some dialogues. When mounting a password is asked and when unmounting both normal and forced mounting is supported, asking the user what to do in each stage. These are very simple scripts, but I decided to share them with the world, as I couldnt find them myself.
USAGE
Create two desktop icons which link to the scripts and give as parameters the source and the destination for the TrueCrypt partition. Now clicking the icons allow you to mount and unmount your partitions via dialogues. Very simple, but also useful. Remember to make the scripts executable. If you only have one TrueCrypt partition, you might want to write the source and destination into the script instead of giving them as parameters.
The idea for these scripts came from http://gentoo-wiki.com/TIP_EncFS and especially Kevin Wennemuth who wrote the scripts there, so thanks to him!
Enhancements:
- Opening KDE Wallet fixed, script did not always open kdewallet and never closed it.
- Kwallet script (needed parts) integrated into mount script.
- Some minor cosmetic changes.
<<lessUSAGE
Create two desktop icons which link to the scripts and give as parameters the source and the destination for the TrueCrypt partition. Now clicking the icons allow you to mount and unmount your partitions via dialogues. Very simple, but also useful. Remember to make the scripts executable. If you only have one TrueCrypt partition, you might want to write the source and destination into the script instead of giving them as parameters.
The idea for these scripts came from http://gentoo-wiki.com/TIP_EncFS and especially Kevin Wennemuth who wrote the scripts there, so thanks to him!
Enhancements:
- Opening KDE Wallet fixed, script did not always open kdewallet and never closed it.
- Kwallet script (needed parts) integrated into mount script.
- Some minor cosmetic changes.
Download (0.004MB)
Added: 2007-03-24 License: GPL (GNU General Public License) Price:
958 downloads
libnetfilter_conntrack 0.0.30
libnetfilter_conntrack is a library that allows user-space programs to interface the kernel connection tracking table. more>>
libnetfilter_conntrack is a userspace library providing a programming interface (API) to the in-kernel connection tracking state table.
libnetfilter_conntrack has been previously known as libnfnetlink_conntrack and libctnetlink.
libnetfilter_conntrack library is used by conntrack.
Main features:
- listing/retrieving entries from the kernel connection tracking table
- inserting/modifying/deleting entries from the kernel connection tracking table
- listing/retrieving entries from the kernel expect table
- inserting/modifying/deleting entries from the kernel expect table
<<lesslibnetfilter_conntrack has been previously known as libnfnetlink_conntrack and libctnetlink.
libnetfilter_conntrack library is used by conntrack.
Main features:
- listing/retrieving entries from the kernel connection tracking table
- inserting/modifying/deleting entries from the kernel connection tracking table
- listing/retrieving entries from the kernel expect table
- inserting/modifying/deleting entries from the kernel expect table
Download (0.21MB)
Added: 2006-02-09 License: GPL (GNU General Public License) Price:
1352 downloads
HTML::Widgets::Index 0.6
HTML::Widgets::Index is a Perl module for creating web indexes and menus. more>>
HTML::Widgets::Index is a Perl module for creating web indexes and menus.
This module renders the index of a document tree using the data stored in a MySQL database generated by anxova. It has a flexible set of render options that gives the webmaster many options on the menu item layout.
Table
The tree data must be in a table in a database. The fields of this table should be:
id: int identifies the entry
uri: varchar(150) link of the entry
text: varchar(150) text displayed in the screen
id_parent: int the parent of the current entry. The root is 0
ordern: int menu item position on the menu
Data
Say you have a document tree like this:
a
a1.html
a2.html
b
b1.html
b2
b21.html
b22.html
b3.html
c
c1.html
Then you must enter this in the table :
; First the directory A
INSERT INTO index_items (id,id_parent,uri,text)
VALUES (1,0,a,dir A);
; Now the docs of the a dir
INSERT INTO index_items (id,id_parent,uri,text)
VALUES (2,1,a1.html,A first);
INSERT INTO index_items (id,id_parent,uri,text)
VALUES (3,1,a2.html,A 2nd);
; Now the directory B INSERT INTO index_items (id,id_parent,uri,text) VALUES (4,0,b,dir B); INSERT INTO index_items (id,id_parent,uri,text) VALUES (5,4,b1.html,B first);
; The directory B has subdirs INSERT INTO index_items (id,id_parent,uri,text) VALUES (6,4,b2,B second section);
INSERT INTO index_items (id,id_parent,uri,text)
VALUES (7,6,b21.html,B 2 1 doc);
Notice the uri field is relative, not absolute. You dont need to specify all the path to a document. So you can move docs in the directory, then just change the parent in the table.
The items are sorted alphabetically, if you want to change the order displayed in the html, just add the field ordern when you do the insert:
INSERT INTO index_items (id,id_parent,uri,text,ordern)
VALUES (5,4,b1.html,B first,2);
INSERT INTO index_items (id,id_parent,uri,text)
VALUES (6,4,b2,B second section,1);
<<lessThis module renders the index of a document tree using the data stored in a MySQL database generated by anxova. It has a flexible set of render options that gives the webmaster many options on the menu item layout.
Table
The tree data must be in a table in a database. The fields of this table should be:
id: int identifies the entry
uri: varchar(150) link of the entry
text: varchar(150) text displayed in the screen
id_parent: int the parent of the current entry. The root is 0
ordern: int menu item position on the menu
Data
Say you have a document tree like this:
a
a1.html
a2.html
b
b1.html
b2
b21.html
b22.html
b3.html
c
c1.html
Then you must enter this in the table :
; First the directory A
INSERT INTO index_items (id,id_parent,uri,text)
VALUES (1,0,a,dir A);
; Now the docs of the a dir
INSERT INTO index_items (id,id_parent,uri,text)
VALUES (2,1,a1.html,A first);
INSERT INTO index_items (id,id_parent,uri,text)
VALUES (3,1,a2.html,A 2nd);
; Now the directory B INSERT INTO index_items (id,id_parent,uri,text) VALUES (4,0,b,dir B); INSERT INTO index_items (id,id_parent,uri,text) VALUES (5,4,b1.html,B first);
; The directory B has subdirs INSERT INTO index_items (id,id_parent,uri,text) VALUES (6,4,b2,B second section);
INSERT INTO index_items (id,id_parent,uri,text)
VALUES (7,6,b21.html,B 2 1 doc);
Notice the uri field is relative, not absolute. You dont need to specify all the path to a document. So you can move docs in the directory, then just change the parent in the table.
The items are sorted alphabetically, if you want to change the order displayed in the html, just add the field ordern when you do the insert:
INSERT INTO index_items (id,id_parent,uri,text,ordern)
VALUES (5,4,b1.html,B first,2);
INSERT INTO index_items (id,id_parent,uri,text)
VALUES (6,4,b2,B second section,1);
Download (0.064MB)
Added: 2007-08-15 License: Perl Artistic License Price:
800 downloads
QtSQL Browser 0.85
QtSQL Browser is a generic GUI database browsing frontend. more>>
The purpose of this project is to provide a simple, generic GUI database browsing frontend. The tool is a very simple aggregation of the Qt database classes.
The database abstraction is provided by the Qt database drivers. So far, the drivers for PostgreSQL and MySQL have been found to work well.
In principle, there is no reason why ODBC drivers for popular databases such as Oracle, DB2, Informix as well as Firebird and SAP/DB shouldnt work via the Qt ODBC3 abstraction layer.
However, some preliminary tests with these have not been promising. It may be that the only way to get some of these working is to create a native Qt database driver. This is something Ill be looking into much later.
At the moment, it is only possible to build the system on Unix and similar systems. Since Trolltech have released a version of Qt for OSX under the GPL and have announced their intention to do likewise for Win32, it should be possible to provide ports for both of these platforms. For the moment though, I just provide the source.
Main features:
- Tree browser for databases and tables
- Display of table descriptions
- Display of table contents in main window
- Execution of ad-hoc SQL queries in the query tab
- Command line history in the query tab
- Retrieval of database connection details from XML config file
- Retrieval of other configuration parameters from XML config file
- Prompting for connection password
- Addition of new connections via GUI to the running application and the config file
- Display database views with a separate icon
- Create a connection name independent of the database name
- A "Test" button when creating a new connection
- Dynamically generate a list of available drivers
- Configuration via autoconf
- Fixed bug with executing updates/inserts twice
- Refreshing of a DB connection
- Deleting of connections via the GUI
- Editting of connections via the GUI
- Check for the existence of ~/.qtsql
- Creation of skeleton config file
- Auto saving/restoring of history
- Loading of queries
- Saving of results
- Keyboard shortcuts
<<lessThe database abstraction is provided by the Qt database drivers. So far, the drivers for PostgreSQL and MySQL have been found to work well.
In principle, there is no reason why ODBC drivers for popular databases such as Oracle, DB2, Informix as well as Firebird and SAP/DB shouldnt work via the Qt ODBC3 abstraction layer.
However, some preliminary tests with these have not been promising. It may be that the only way to get some of these working is to create a native Qt database driver. This is something Ill be looking into much later.
At the moment, it is only possible to build the system on Unix and similar systems. Since Trolltech have released a version of Qt for OSX under the GPL and have announced their intention to do likewise for Win32, it should be possible to provide ports for both of these platforms. For the moment though, I just provide the source.
Main features:
- Tree browser for databases and tables
- Display of table descriptions
- Display of table contents in main window
- Execution of ad-hoc SQL queries in the query tab
- Command line history in the query tab
- Retrieval of database connection details from XML config file
- Retrieval of other configuration parameters from XML config file
- Prompting for connection password
- Addition of new connections via GUI to the running application and the config file
- Display database views with a separate icon
- Create a connection name independent of the database name
- A "Test" button when creating a new connection
- Dynamically generate a list of available drivers
- Configuration via autoconf
- Fixed bug with executing updates/inserts twice
- Refreshing of a DB connection
- Deleting of connections via the GUI
- Editting of connections via the GUI
- Check for the existence of ~/.qtsql
- Creation of skeleton config file
- Auto saving/restoring of history
- Loading of queries
- Saving of results
- Keyboard shortcuts
Download (0.025MB)
Added: 2005-05-24 License: GPL (GNU General Public License) Price:
1619 downloads
Tree::Binary::Search 0.07
Tree::Binary::Search is a binary search tree for Perl. more>>
Tree::Binary::Search is a binary search tree for Perl.
SYNOPSIS
use Tree::Binary::Search;
my $btree = Tree::Binary::Search->new();
$btree->useNumericComparison();
$btree->insert(5 => "Five");
$btree->insert(2 => "Two");
$btree->insert(1 => "One");
$btree->insert(3 => "Three");
$btree->insert(4 => "Four");
$btree->insert(9 => "Nine");
$btree->insert(8 => "Eight");
$btree->insert(6 => "Six");
$btree->insert(7 => "Seven");
# this creates the following tree:
#
# +-------(5)----------+
# | |
# +-(2)-+ +-(9)
# | | |
# (1) (3)-+ +----(8)
# | |
# (4) (6)-+
# |
# (7)
#
$btree->exists(7); # return true
$btree->update(7 => "Seven (updated)");
$btree->select(9); # return Nine
$btree->min_key(); # returns 1
$btree->min(); # returns One
$btree->max_key(); # return 9
$btree->max(); # return Nine
$btree->delete(5);
# this results in the following tree:
#
# +-------(6)-------+
# | |
# +-(2)-+ +-(9)
# | | |
# (1) (3)-+ +-(8)
# | |
# (4) (7)
#
This module implements a binary search tree, which is a specialized usage of a binary tree. The basic principle is that all elements to the left are less than the root, all elements to the right are greater than the root. This reduces the search time for elements in the tree, by halving the number of nodes that need to be searched each time a node is examined.
Binary search trees are a very well understood data-structure and there is a wealth of information on the web about them.
Trees are a naturally recursive data-structure, and therefore, tend to lend themselves well to recursive traversal functions. I however, have chosen to implement the tree traversal in this module without using recursive subroutines. This is partially a performance descision, even though perl can handle theoreticaly unlimited recursion, subroutine calls to have some overhead. My algorithm is still recursive, I have just chosen to keep it within a single subroutine.
<<lessSYNOPSIS
use Tree::Binary::Search;
my $btree = Tree::Binary::Search->new();
$btree->useNumericComparison();
$btree->insert(5 => "Five");
$btree->insert(2 => "Two");
$btree->insert(1 => "One");
$btree->insert(3 => "Three");
$btree->insert(4 => "Four");
$btree->insert(9 => "Nine");
$btree->insert(8 => "Eight");
$btree->insert(6 => "Six");
$btree->insert(7 => "Seven");
# this creates the following tree:
#
# +-------(5)----------+
# | |
# +-(2)-+ +-(9)
# | | |
# (1) (3)-+ +----(8)
# | |
# (4) (6)-+
# |
# (7)
#
$btree->exists(7); # return true
$btree->update(7 => "Seven (updated)");
$btree->select(9); # return Nine
$btree->min_key(); # returns 1
$btree->min(); # returns One
$btree->max_key(); # return 9
$btree->max(); # return Nine
$btree->delete(5);
# this results in the following tree:
#
# +-------(6)-------+
# | |
# +-(2)-+ +-(9)
# | | |
# (1) (3)-+ +-(8)
# | |
# (4) (7)
#
This module implements a binary search tree, which is a specialized usage of a binary tree. The basic principle is that all elements to the left are less than the root, all elements to the right are greater than the root. This reduces the search time for elements in the tree, by halving the number of nodes that need to be searched each time a node is examined.
Binary search trees are a very well understood data-structure and there is a wealth of information on the web about them.
Trees are a naturally recursive data-structure, and therefore, tend to lend themselves well to recursive traversal functions. I however, have chosen to implement the tree traversal in this module without using recursive subroutines. This is partially a performance descision, even though perl can handle theoreticaly unlimited recursion, subroutine calls to have some overhead. My algorithm is still recursive, I have just chosen to keep it within a single subroutine.
Download (0.027MB)
Added: 2007-07-21 License: Perl Artistic License Price:
825 downloads
SQL::Routine 0.70.3
SQL::Routine is a Perl module to specify all database tasks with SQL routines. more>>
SQL::Routine is a Perl module to specify all database tasks with SQL routines.
SYNOPSIS
This executable code example shows how to define some simple database tasks with SQL::Routine; it only shows a tiny fraction of what the module is capable of, since more advanced features are not shown for brevity.
use SQL::Routine;
eval {
# Create a model/container in which all SQL details are to be stored.
# The two boolean options being set true here permit all the subsequent code to be as concise,
# easy to read, and most SQL-string-like as possible, at the cost of being slower to execute.
my $model = SQL::Routine->new_container();
$model->auto_set_node_ids( 1 );
$model->may_match_surrogate_node_ids( 1 );
# This defines 4 scalar/column/field data types (1 number, 2 char strings, 1 enumerated value type)
# and 2 row/table data types; the former are atomic and the latter are composite.
# The former can describe individual columns of a base table (table) or viewed table (view),
# while the latter can describe an entire table or view.
# Any of these can describe a domain schema object or a stored procedures variables data type.
# See also the person and person_with_parents table+view defs further below; these data types help describe them.
$model->build_child_node_trees( [
[ scalar_data_type, { si_name => entity_id , base_type => NUM_INT , num_precision => 9, }, ],
[ scalar_data_type, { si_name => alt_id , base_type => STR_CHAR, max_chars => 20, char_enc => UTF8, }, ],
[ scalar_data_type, { si_name => person_name, base_type => STR_CHAR, max_chars => 100, char_enc => UTF8, }, ],
[ scalar_data_type, { si_name => person_sex , base_type => STR_CHAR, max_chars => 1, char_enc => UTF8, }, [
[ scalar_data_type_opt, M, ],
[ scalar_data_type_opt, F, ],
], ],
[ row_data_type, person, [
[ row_data_type_field, { si_name => person_id , scalar_data_type => entity_id , }, ],
[ row_data_type_field, { si_name => alternate_id, scalar_data_type => alt_id , }, ],
[ row_data_type_field, { si_name => name , scalar_data_type => person_name, }, ],
[ row_data_type_field, { si_name => sex , scalar_data_type => person_sex , }, ],
[ row_data_type_field, { si_name => father_id , scalar_data_type => entity_id , }, ],
[ row_data_type_field, { si_name => mother_id , scalar_data_type => entity_id , }, ],
], ],
[ row_data_type, person_with_parents, [
[ row_data_type_field, { si_name => self_id , scalar_data_type => entity_id , }, ],
[ row_data_type_field, { si_name => self_name , scalar_data_type => person_name, }, ],
[ row_data_type_field, { si_name => father_id , scalar_data_type => entity_id , }, ],
[ row_data_type_field, { si_name => father_name, scalar_data_type => person_name, }, ],
[ row_data_type_field, { si_name => mother_id , scalar_data_type => entity_id , }, ],
[ row_data_type_field, { si_name => mother_name, scalar_data_type => person_name, }, ],
], ],
] );
# This defines the blueprint of a database catalog that contains a single schema and a single virtual user which owns the schema.
my $catalog_bp = $model->build_child_node_tree( catalog, Gene Database, [
[ owner, Lord of the Root, ],
[ schema, { si_name => Gene Schema, owner => Lord of the Root, }, ],
] );
my $schema = $catalog_bp->find_child_node_by_surrogate_id( Gene Schema );
# This defines a base table (table) schema object that lives in the aforementioned database catalog.
# It contains 6 columns, including a not-null primary key (having a trivial sequence generator to give it
# default values), another not-null field, a surrogate key, and 2 self-referencing foreign keys.
# Each row represents a single person, for each storing up to 2 unique identifiers, name, sex, and the parents unique ids.
my $tb_person = $schema->build_child_node_tree( table, { si_name => person, row_data_type => person, }, [
[ table_field, { si_row_field => person_id, mandatory => 1, default_val => 1, auto_inc => 1, }, ],
[ table_field, { si_row_field => name , mandatory => 1, }, ],
[ table_index, { si_name => primary , index_type => UNIQUE, }, [
[ table_index_field, person_id, ],
], ],
[ table_index, { si_name => ak_alternate_id, index_type => UNIQUE, }, [
[ table_index_field, alternate_id, ],
], ],
[ table_index, { si_name => fk_father, index_type => FOREIGN, f_table => person, }, [
[ table_index_field, { si_field => father_id, f_field => person_id } ],
], ],
[ table_index, { si_name => fk_mother, index_type => FOREIGN, f_table => person, }, [
[ table_index_field, { si_field => mother_id, f_field => person_id } ],
], ],
] );
# This defines a viewed table (view) schema object that lives in the aforementioned database catalog.
# It left-outer-joins the person table to itself twice and returns 2 columns from each constituent, for 6 total.
# Each row gives the unique id and name each for 3 people, a given person and that persons 2 parents.
my $vw_pwp = $schema->build_child_node_tree( view, { si_name => person_with_parents,
view_type => JOINED, row_data_type => person_with_parents, }, [
( map { [ view_src, { si_name => $_, match => person, }, [
map { [ view_src_field, $_, ], } ( person_id, name, father_id, mother_id, ),
], ], } (self) ),
( map { [ view_src, { si_name => $_, match => person, }, [
map { [ view_src_field, $_, ], } ( person_id, name, ),
], ], } ( father, mother, ) ),
[ view_field, { si_row_field => self_id , src_field => [person_id,self ], }, ],
[ view_field, { si_row_field => self_name , src_field => [name ,self ], }, ],
[ view_field, { si_row_field => father_id , src_field => [person_id,father], }, ],
[ view_field, { si_row_field => father_name, src_field => [name ,father], }, ],
[ view_field, { si_row_field => mother_id , src_field => [person_id,mother], }, ],
[ view_field, { si_row_field => mother_name, src_field => [name ,mother], }, ],
[ view_join, { lhs_src => self, rhs_src => father, join_op => LEFT, }, [
[ view_join_field, { lhs_src_field => father_id, rhs_src_field => person_id } ],
], ],
[ view_join, { lhs_src => self, rhs_src => mother, join_op => LEFT, }, [
[ view_join_field, { lhs_src_field => mother_id, rhs_src_field => person_id } ],
], ],
] );
# This defines the blueprint of an application that has a single virtual connection descriptor to the above database.
my $application_bp = $model->build_child_node_tree( application, Gene App, [
[ catalog_link, { si_name => editor_link, target => $catalog_bp, }, ],
] );
# This defines another scalar data type, which is used by some routines that follow below.
my $sdt_login_auth = $model->build_child_node( scalar_data_type, { si_name => login_auth,
base_type => STR_CHAR, max_chars => 20, char_enc => UTF8, } );
# This defines an application-side routine/function that connects to the Gene Database, fetches all
# the records from the person_with_parents view, disconnects the database, and returns the fetched records.
# It takes run-time arguments for a user login name and password that are used when connecting.
my $rt_fetch_pwp = $application_bp->build_child_node_tree( routine, { si_name => fetch_pwp,
routine_type => FUNCTION, return_cont_type => RW_ARY, return_row_data_type => person_with_parents, }, [
[ routine_arg, { si_name => login_name, cont_type => SCALAR, scalar_data_type => $sdt_login_auth }, ],
[ routine_arg, { si_name => login_pass, cont_type => SCALAR, scalar_data_type => $sdt_login_auth }, ],
[ routine_var, { si_name => conn_cx, cont_type => CONN, conn_link => editor_link, }, ],
[ routine_stmt, { call_sroutine => CATALOG_OPEN, }, [
[ routine_expr, { call_sroutine_cxt => CONN_CX, cont_type => CONN, valf_p_routine_item => conn_cx, }, ],
[ routine_expr, { call_sroutine_arg => LOGIN_NAME, cont_type => SCALAR, valf_p_routine_item => login_name, }, ],
[ routine_expr, { call_sroutine_arg => LOGIN_PASS, cont_type => SCALAR, valf_p_routine_item => login_pass, }, ],
], ],
[ routine_var, { si_name => pwp_ary, cont_type => RW_ARY, row_data_type => person_with_parents, }, ],
[ routine_stmt, { call_sroutine => SELECT, }, [
[ view, { si_name => query_pwp, view_type => ALIAS, row_data_type => person_with_parents, }, [
[ view_src, { si_name => s, match => $vw_pwp, }, ],
], ],
[ routine_expr, { call_sroutine_cxt => CONN_CX, cont_type => CONN, valf_p_routine_item => conn_cx, }, ],
[ routine_expr, { call_sroutine_arg => SELECT_DEFN, cont_type => SRT_NODE, act_on => query_pwp, }, ],
[ routine_expr, { call_sroutine_arg => INTO, query_dest => pwp_ary, cont_type => RW_ARY, }, ],
], ],
[ routine_stmt, { call_sroutine => CATALOG_CLOSE, }, [
[ routine_expr, { call_sroutine_cxt => CONN_CX, cont_type => CONN, valf_p_routine_item, conn_cx, }, ],
], ],
[ routine_stmt, { call_sroutine => RETURN, }, [
[ routine_expr, { call_sroutine_arg => RETURN_VALUE, cont_type => RW_ARY, valf_p_routine_item => pwp_ary, }, ],
], ],
] );
# This defines an application-side routine/procedure that inserts a set of records, given in an argument,
# into the person table. It takes an already opened db connection handle to operate through as a
# context argument (which would represent the invocant if this routine was wrapped in an object-oriented interface).
my $rt_add_people = $application_bp->build_child_node_tree( routine, { si_name => add_people, routine_type => PROCEDURE, }, [
[ routine_context, { si_name => conn_cx, cont_type => CONN, conn_link => editor_link, }, ],
[ routine_arg, { si_name => person_ary, cont_type => RW_ARY, row_data_type => person, }, ],
[ routine_stmt, { call_sroutine => INSERT, }, [
[ view, { si_name => insert_people, view_type => INSERT, row_data_type => person, ins_p_routine_item => person_ary, }, [
[ view_src, { si_name => s, match => $tb_person, }, ],
], ],
[ routine_expr, { call_sroutine_cxt => CONN_CX, cont_type => CONN, valf_p_routine_item => conn_cx, }, ],
[ routine_expr, { call_sroutine_arg => INSERT_DEFN, cont_type => SRT_NODE, act_on => insert_people, }, ],
], ],
] );
# This defines an application-side routine/function that fetches one record
# from the person table which matches its argument.
my $rt_get_person = $application_bp->build_child_node_tree( routine, { si_name => get_person,
routine_type => FUNCTION, return_cont_type => ROW, return_row_data_type => person, }, [
[ routine_context, { si_name => conn_cx, cont_type => CONN, conn_link => editor_link, }, ],
[ routine_arg, { si_name => arg_person_id, cont_type => SCALAR, scalar_data_type => entity_id, }, ],
[ routine_var, { si_name => person_row, cont_type => ROW, row_data_type => person, }, ],
[ routine_stmt, { call_sroutine => SELECT, }, [
[ view, { si_name => query_person, view_type => JOINED, row_data_type => person, }, [
[ view_src, { si_name => s, match => $tb_person, }, [
[ view_src_field, person_id, ],
], ],
[ view_expr, { view_part => WHERE, cont_type => SCALAR, valf_call_sroutine => EQ, }, [
[ view_expr, { call_sroutine_arg => LHS, cont_type => SCALAR, valf_src_field => person_id, }, ],
[ view_expr, { call_sroutine_arg => RHS, cont_type => SCALAR, valf_p_routine_item => arg_person_id, }, ],
], ],
], ],
[ routine_expr, { call_sroutine_cxt => CONN_CX, cont_type => CONN, valf_p_routine_item => conn_cx, }, ],
[ routine_expr, { call_sroutine_arg => SELECT_DEFN, cont_type => SRT_NODE, act_on => query_person, }, ],
[ routine_expr, { call_sroutine_arg => INTO, query_dest => person_row, cont_type => RW_ARY, }, ],
], ],
[ routine_stmt, { call_sroutine => RETURN, }, [
[ routine_expr, { call_sroutine_arg => RETURN_VALUE, cont_type => ROW, valf_p_routine_item => person_row, }, ],
], ],
] );
# This defines 6 database engine descriptors and 2 database bridge descriptors that we may be using.
# These details can help external code determine such things as what string-SQL flavors should be
# generated from the model, as well as which database features can be used natively or have to be emulated.
# The si_name has no meaning to code and is for users; the other attribute values should have meaning to said external code.
$model->build_child_node_trees( [
[ data_storage_product, { si_name => SQLite v3.2 , product_code => SQLite_3_2 , is_file_based => 1, }, ],
[ data_storage_product, { si_name => MySQL v5.0 , product_code => MySQL_5_0 , is_network_svc => 1, }, ],
[ data_storage_product, { si_name => PostgreSQL v8, product_code => PostgreSQL_8, is_network_svc => 1, }, ],
[ data_storage_product, { si_name => Oracle v10g , product_code => Oracle_10_g , is_network_svc => 1, }, ],
[ data_storage_product, { si_name => Sybase , product_code => Sybase , is_network_svc => 1, }, ],
[ data_storage_product, { si_name => CSV , product_code => CSV , is_file_based => 1, }, ],
[ data_link_product, { si_name => Microsoft ODBC v3, product_code => ODBC_3, }, ],
[ data_link_product, { si_name => Oracle OCI*8, product_code => OCI_8, }, ],
[ data_link_product, { si_name => Generic Rosetta Engine, product_code => Rosetta::Engine::Generic, }, ],
] );
# This defines one concrete instance each of the database catalog and an application using it.
# This concrete database instance includes two concrete user definitions, one that can owns
# the schema and one that can only edit data. The concrete application instance includes
# a concrete connection descriptor going to this concrete database instance.
# Note that user descriptions are only stored in a SQL::Routine model when that model is being used to create
# database catalogs and/or create or modify database users; otherwise user should not be kept for security sake.
$model->build_child_node_trees( [
[ catalog_instance, { si_name => test, blueprint => $catalog_bp, product => PostgreSQL v8, }, [
[ user, { si_name => ronsealy, user_type => SCHEMA_OWNER, match_owner => Lord of the Root, password => K34dsD, }, ],
[ user, { si_name => joesmith, user_type => DATA_EDITOR, password => fdsKJ4, }, ],
], ],
[ application_instance, { si_name => test app, blueprint => $application_bp, }, [
[ catalog_link_instance, { blueprint => editor_link, product => Microsoft ODBC v3, target => test, local_dsn => keep_it, }, ],
], ],
] );
# This defines another concrete instance each of the database catalog and an application using it.
$model->build_child_node_trees( [
[ catalog_instance, { si_name => production, blueprint => $catalog_bp, product => Oracle v10g, }, [
[ user, { si_name => florence, user_type => SCHEMA_OWNER, match_owner => Lord of the Root, password => 0sfs8G, }, ],
[ user, { si_name => thainuff, user_type => DATA_EDITOR, password => 9340sd, }, ],
], ],
[ application_instance, { si_name => production app, blueprint => $application_bp, }, [
[ catalog_link_instance, { blueprint => editor_link, product => Oracle OCI*8, target => production, local_dsn => ship_it, }, ],
], ],
] );
# This defines a third concrete instance each of the database catalog and an application using it.
$model->build_child_node_trees( [
[ catalog_instance, { si_name => laptop demo, blueprint => $catalog_bp, product => SQLite v3.2, file_path => Move It, }, ],
[ application_instance, { si_name => laptop demo app, blueprint => $application_bp, }, [
[ catalog_link_instance, { blueprint => editor_link, product => Generic Rosetta Engine, target => laptop demo, }, ],
], ],
] );
# This line will run some correctness tests on the model that were not done
# when the model was being populated for execution speed efficiency.
$model->assert_deferrable_constraints();
# This line will dump the contents of the model in pretty-printed XML format.
# It can be helpful when debugging your programs that use SQL::Routine.
print $model->get_all_properties_as_xml_str( 1 );
};
$@ and print error_to_string($@);
# SQL::Routine throws object exceptions when it encounters bad input; this function
# will convert those into human readable text for display by the try/catch block.
sub error_to_string {
my ($message) = @_;
if (ref $message and UNIVERSAL::isa( $message, Locale::KeyedText::Message )) {
my $translator = Locale::KeyedText->new_translator( [SQL::Routine::L::], [en] );
my $user_text = $translator->translate_message( $message );
return q{internal error: cant find user text for a message: }
. $message->as_string() . . $translator->as_string();
if !$user_text;
return $user_text;
}
return $message; # if this isnt the right kind of object
}
Note that one key feature of SQL::Routine is that all of a models pieces are linked by references rather than by name as in SQL itself. For example, the name of the person table is only stored once internally; if, after executing all of the above code, you were to run "$tb_person->set_attribute( si_name, The Huddled Masses );", then all of the other parts of the model that referred to the table would not break, and an XML dump would show that all the references now say The Huddled Masses.
For some more (older) examples of SQL::Routine in use, see its test suite code.
<<lessSYNOPSIS
This executable code example shows how to define some simple database tasks with SQL::Routine; it only shows a tiny fraction of what the module is capable of, since more advanced features are not shown for brevity.
use SQL::Routine;
eval {
# Create a model/container in which all SQL details are to be stored.
# The two boolean options being set true here permit all the subsequent code to be as concise,
# easy to read, and most SQL-string-like as possible, at the cost of being slower to execute.
my $model = SQL::Routine->new_container();
$model->auto_set_node_ids( 1 );
$model->may_match_surrogate_node_ids( 1 );
# This defines 4 scalar/column/field data types (1 number, 2 char strings, 1 enumerated value type)
# and 2 row/table data types; the former are atomic and the latter are composite.
# The former can describe individual columns of a base table (table) or viewed table (view),
# while the latter can describe an entire table or view.
# Any of these can describe a domain schema object or a stored procedures variables data type.
# See also the person and person_with_parents table+view defs further below; these data types help describe them.
$model->build_child_node_trees( [
[ scalar_data_type, { si_name => entity_id , base_type => NUM_INT , num_precision => 9, }, ],
[ scalar_data_type, { si_name => alt_id , base_type => STR_CHAR, max_chars => 20, char_enc => UTF8, }, ],
[ scalar_data_type, { si_name => person_name, base_type => STR_CHAR, max_chars => 100, char_enc => UTF8, }, ],
[ scalar_data_type, { si_name => person_sex , base_type => STR_CHAR, max_chars => 1, char_enc => UTF8, }, [
[ scalar_data_type_opt, M, ],
[ scalar_data_type_opt, F, ],
], ],
[ row_data_type, person, [
[ row_data_type_field, { si_name => person_id , scalar_data_type => entity_id , }, ],
[ row_data_type_field, { si_name => alternate_id, scalar_data_type => alt_id , }, ],
[ row_data_type_field, { si_name => name , scalar_data_type => person_name, }, ],
[ row_data_type_field, { si_name => sex , scalar_data_type => person_sex , }, ],
[ row_data_type_field, { si_name => father_id , scalar_data_type => entity_id , }, ],
[ row_data_type_field, { si_name => mother_id , scalar_data_type => entity_id , }, ],
], ],
[ row_data_type, person_with_parents, [
[ row_data_type_field, { si_name => self_id , scalar_data_type => entity_id , }, ],
[ row_data_type_field, { si_name => self_name , scalar_data_type => person_name, }, ],
[ row_data_type_field, { si_name => father_id , scalar_data_type => entity_id , }, ],
[ row_data_type_field, { si_name => father_name, scalar_data_type => person_name, }, ],
[ row_data_type_field, { si_name => mother_id , scalar_data_type => entity_id , }, ],
[ row_data_type_field, { si_name => mother_name, scalar_data_type => person_name, }, ],
], ],
] );
# This defines the blueprint of a database catalog that contains a single schema and a single virtual user which owns the schema.
my $catalog_bp = $model->build_child_node_tree( catalog, Gene Database, [
[ owner, Lord of the Root, ],
[ schema, { si_name => Gene Schema, owner => Lord of the Root, }, ],
] );
my $schema = $catalog_bp->find_child_node_by_surrogate_id( Gene Schema );
# This defines a base table (table) schema object that lives in the aforementioned database catalog.
# It contains 6 columns, including a not-null primary key (having a trivial sequence generator to give it
# default values), another not-null field, a surrogate key, and 2 self-referencing foreign keys.
# Each row represents a single person, for each storing up to 2 unique identifiers, name, sex, and the parents unique ids.
my $tb_person = $schema->build_child_node_tree( table, { si_name => person, row_data_type => person, }, [
[ table_field, { si_row_field => person_id, mandatory => 1, default_val => 1, auto_inc => 1, }, ],
[ table_field, { si_row_field => name , mandatory => 1, }, ],
[ table_index, { si_name => primary , index_type => UNIQUE, }, [
[ table_index_field, person_id, ],
], ],
[ table_index, { si_name => ak_alternate_id, index_type => UNIQUE, }, [
[ table_index_field, alternate_id, ],
], ],
[ table_index, { si_name => fk_father, index_type => FOREIGN, f_table => person, }, [
[ table_index_field, { si_field => father_id, f_field => person_id } ],
], ],
[ table_index, { si_name => fk_mother, index_type => FOREIGN, f_table => person, }, [
[ table_index_field, { si_field => mother_id, f_field => person_id } ],
], ],
] );
# This defines a viewed table (view) schema object that lives in the aforementioned database catalog.
# It left-outer-joins the person table to itself twice and returns 2 columns from each constituent, for 6 total.
# Each row gives the unique id and name each for 3 people, a given person and that persons 2 parents.
my $vw_pwp = $schema->build_child_node_tree( view, { si_name => person_with_parents,
view_type => JOINED, row_data_type => person_with_parents, }, [
( map { [ view_src, { si_name => $_, match => person, }, [
map { [ view_src_field, $_, ], } ( person_id, name, father_id, mother_id, ),
], ], } (self) ),
( map { [ view_src, { si_name => $_, match => person, }, [
map { [ view_src_field, $_, ], } ( person_id, name, ),
], ], } ( father, mother, ) ),
[ view_field, { si_row_field => self_id , src_field => [person_id,self ], }, ],
[ view_field, { si_row_field => self_name , src_field => [name ,self ], }, ],
[ view_field, { si_row_field => father_id , src_field => [person_id,father], }, ],
[ view_field, { si_row_field => father_name, src_field => [name ,father], }, ],
[ view_field, { si_row_field => mother_id , src_field => [person_id,mother], }, ],
[ view_field, { si_row_field => mother_name, src_field => [name ,mother], }, ],
[ view_join, { lhs_src => self, rhs_src => father, join_op => LEFT, }, [
[ view_join_field, { lhs_src_field => father_id, rhs_src_field => person_id } ],
], ],
[ view_join, { lhs_src => self, rhs_src => mother, join_op => LEFT, }, [
[ view_join_field, { lhs_src_field => mother_id, rhs_src_field => person_id } ],
], ],
] );
# This defines the blueprint of an application that has a single virtual connection descriptor to the above database.
my $application_bp = $model->build_child_node_tree( application, Gene App, [
[ catalog_link, { si_name => editor_link, target => $catalog_bp, }, ],
] );
# This defines another scalar data type, which is used by some routines that follow below.
my $sdt_login_auth = $model->build_child_node( scalar_data_type, { si_name => login_auth,
base_type => STR_CHAR, max_chars => 20, char_enc => UTF8, } );
# This defines an application-side routine/function that connects to the Gene Database, fetches all
# the records from the person_with_parents view, disconnects the database, and returns the fetched records.
# It takes run-time arguments for a user login name and password that are used when connecting.
my $rt_fetch_pwp = $application_bp->build_child_node_tree( routine, { si_name => fetch_pwp,
routine_type => FUNCTION, return_cont_type => RW_ARY, return_row_data_type => person_with_parents, }, [
[ routine_arg, { si_name => login_name, cont_type => SCALAR, scalar_data_type => $sdt_login_auth }, ],
[ routine_arg, { si_name => login_pass, cont_type => SCALAR, scalar_data_type => $sdt_login_auth }, ],
[ routine_var, { si_name => conn_cx, cont_type => CONN, conn_link => editor_link, }, ],
[ routine_stmt, { call_sroutine => CATALOG_OPEN, }, [
[ routine_expr, { call_sroutine_cxt => CONN_CX, cont_type => CONN, valf_p_routine_item => conn_cx, }, ],
[ routine_expr, { call_sroutine_arg => LOGIN_NAME, cont_type => SCALAR, valf_p_routine_item => login_name, }, ],
[ routine_expr, { call_sroutine_arg => LOGIN_PASS, cont_type => SCALAR, valf_p_routine_item => login_pass, }, ],
], ],
[ routine_var, { si_name => pwp_ary, cont_type => RW_ARY, row_data_type => person_with_parents, }, ],
[ routine_stmt, { call_sroutine => SELECT, }, [
[ view, { si_name => query_pwp, view_type => ALIAS, row_data_type => person_with_parents, }, [
[ view_src, { si_name => s, match => $vw_pwp, }, ],
], ],
[ routine_expr, { call_sroutine_cxt => CONN_CX, cont_type => CONN, valf_p_routine_item => conn_cx, }, ],
[ routine_expr, { call_sroutine_arg => SELECT_DEFN, cont_type => SRT_NODE, act_on => query_pwp, }, ],
[ routine_expr, { call_sroutine_arg => INTO, query_dest => pwp_ary, cont_type => RW_ARY, }, ],
], ],
[ routine_stmt, { call_sroutine => CATALOG_CLOSE, }, [
[ routine_expr, { call_sroutine_cxt => CONN_CX, cont_type => CONN, valf_p_routine_item, conn_cx, }, ],
], ],
[ routine_stmt, { call_sroutine => RETURN, }, [
[ routine_expr, { call_sroutine_arg => RETURN_VALUE, cont_type => RW_ARY, valf_p_routine_item => pwp_ary, }, ],
], ],
] );
# This defines an application-side routine/procedure that inserts a set of records, given in an argument,
# into the person table. It takes an already opened db connection handle to operate through as a
# context argument (which would represent the invocant if this routine was wrapped in an object-oriented interface).
my $rt_add_people = $application_bp->build_child_node_tree( routine, { si_name => add_people, routine_type => PROCEDURE, }, [
[ routine_context, { si_name => conn_cx, cont_type => CONN, conn_link => editor_link, }, ],
[ routine_arg, { si_name => person_ary, cont_type => RW_ARY, row_data_type => person, }, ],
[ routine_stmt, { call_sroutine => INSERT, }, [
[ view, { si_name => insert_people, view_type => INSERT, row_data_type => person, ins_p_routine_item => person_ary, }, [
[ view_src, { si_name => s, match => $tb_person, }, ],
], ],
[ routine_expr, { call_sroutine_cxt => CONN_CX, cont_type => CONN, valf_p_routine_item => conn_cx, }, ],
[ routine_expr, { call_sroutine_arg => INSERT_DEFN, cont_type => SRT_NODE, act_on => insert_people, }, ],
], ],
] );
# This defines an application-side routine/function that fetches one record
# from the person table which matches its argument.
my $rt_get_person = $application_bp->build_child_node_tree( routine, { si_name => get_person,
routine_type => FUNCTION, return_cont_type => ROW, return_row_data_type => person, }, [
[ routine_context, { si_name => conn_cx, cont_type => CONN, conn_link => editor_link, }, ],
[ routine_arg, { si_name => arg_person_id, cont_type => SCALAR, scalar_data_type => entity_id, }, ],
[ routine_var, { si_name => person_row, cont_type => ROW, row_data_type => person, }, ],
[ routine_stmt, { call_sroutine => SELECT, }, [
[ view, { si_name => query_person, view_type => JOINED, row_data_type => person, }, [
[ view_src, { si_name => s, match => $tb_person, }, [
[ view_src_field, person_id, ],
], ],
[ view_expr, { view_part => WHERE, cont_type => SCALAR, valf_call_sroutine => EQ, }, [
[ view_expr, { call_sroutine_arg => LHS, cont_type => SCALAR, valf_src_field => person_id, }, ],
[ view_expr, { call_sroutine_arg => RHS, cont_type => SCALAR, valf_p_routine_item => arg_person_id, }, ],
], ],
], ],
[ routine_expr, { call_sroutine_cxt => CONN_CX, cont_type => CONN, valf_p_routine_item => conn_cx, }, ],
[ routine_expr, { call_sroutine_arg => SELECT_DEFN, cont_type => SRT_NODE, act_on => query_person, }, ],
[ routine_expr, { call_sroutine_arg => INTO, query_dest => person_row, cont_type => RW_ARY, }, ],
], ],
[ routine_stmt, { call_sroutine => RETURN, }, [
[ routine_expr, { call_sroutine_arg => RETURN_VALUE, cont_type => ROW, valf_p_routine_item => person_row, }, ],
], ],
] );
# This defines 6 database engine descriptors and 2 database bridge descriptors that we may be using.
# These details can help external code determine such things as what string-SQL flavors should be
# generated from the model, as well as which database features can be used natively or have to be emulated.
# The si_name has no meaning to code and is for users; the other attribute values should have meaning to said external code.
$model->build_child_node_trees( [
[ data_storage_product, { si_name => SQLite v3.2 , product_code => SQLite_3_2 , is_file_based => 1, }, ],
[ data_storage_product, { si_name => MySQL v5.0 , product_code => MySQL_5_0 , is_network_svc => 1, }, ],
[ data_storage_product, { si_name => PostgreSQL v8, product_code => PostgreSQL_8, is_network_svc => 1, }, ],
[ data_storage_product, { si_name => Oracle v10g , product_code => Oracle_10_g , is_network_svc => 1, }, ],
[ data_storage_product, { si_name => Sybase , product_code => Sybase , is_network_svc => 1, }, ],
[ data_storage_product, { si_name => CSV , product_code => CSV , is_file_based => 1, }, ],
[ data_link_product, { si_name => Microsoft ODBC v3, product_code => ODBC_3, }, ],
[ data_link_product, { si_name => Oracle OCI*8, product_code => OCI_8, }, ],
[ data_link_product, { si_name => Generic Rosetta Engine, product_code => Rosetta::Engine::Generic, }, ],
] );
# This defines one concrete instance each of the database catalog and an application using it.
# This concrete database instance includes two concrete user definitions, one that can owns
# the schema and one that can only edit data. The concrete application instance includes
# a concrete connection descriptor going to this concrete database instance.
# Note that user descriptions are only stored in a SQL::Routine model when that model is being used to create
# database catalogs and/or create or modify database users; otherwise user should not be kept for security sake.
$model->build_child_node_trees( [
[ catalog_instance, { si_name => test, blueprint => $catalog_bp, product => PostgreSQL v8, }, [
[ user, { si_name => ronsealy, user_type => SCHEMA_OWNER, match_owner => Lord of the Root, password => K34dsD, }, ],
[ user, { si_name => joesmith, user_type => DATA_EDITOR, password => fdsKJ4, }, ],
], ],
[ application_instance, { si_name => test app, blueprint => $application_bp, }, [
[ catalog_link_instance, { blueprint => editor_link, product => Microsoft ODBC v3, target => test, local_dsn => keep_it, }, ],
], ],
] );
# This defines another concrete instance each of the database catalog and an application using it.
$model->build_child_node_trees( [
[ catalog_instance, { si_name => production, blueprint => $catalog_bp, product => Oracle v10g, }, [
[ user, { si_name => florence, user_type => SCHEMA_OWNER, match_owner => Lord of the Root, password => 0sfs8G, }, ],
[ user, { si_name => thainuff, user_type => DATA_EDITOR, password => 9340sd, }, ],
], ],
[ application_instance, { si_name => production app, blueprint => $application_bp, }, [
[ catalog_link_instance, { blueprint => editor_link, product => Oracle OCI*8, target => production, local_dsn => ship_it, }, ],
], ],
] );
# This defines a third concrete instance each of the database catalog and an application using it.
$model->build_child_node_trees( [
[ catalog_instance, { si_name => laptop demo, blueprint => $catalog_bp, product => SQLite v3.2, file_path => Move It, }, ],
[ application_instance, { si_name => laptop demo app, blueprint => $application_bp, }, [
[ catalog_link_instance, { blueprint => editor_link, product => Generic Rosetta Engine, target => laptop demo, }, ],
], ],
] );
# This line will run some correctness tests on the model that were not done
# when the model was being populated for execution speed efficiency.
$model->assert_deferrable_constraints();
# This line will dump the contents of the model in pretty-printed XML format.
# It can be helpful when debugging your programs that use SQL::Routine.
print $model->get_all_properties_as_xml_str( 1 );
};
$@ and print error_to_string($@);
# SQL::Routine throws object exceptions when it encounters bad input; this function
# will convert those into human readable text for display by the try/catch block.
sub error_to_string {
my ($message) = @_;
if (ref $message and UNIVERSAL::isa( $message, Locale::KeyedText::Message )) {
my $translator = Locale::KeyedText->new_translator( [SQL::Routine::L::], [en] );
my $user_text = $translator->translate_message( $message );
return q{internal error: cant find user text for a message: }
. $message->as_string() . . $translator->as_string();
if !$user_text;
return $user_text;
}
return $message; # if this isnt the right kind of object
}
Note that one key feature of SQL::Routine is that all of a models pieces are linked by references rather than by name as in SQL itself. For example, the name of the person table is only stored once internally; if, after executing all of the above code, you were to run "$tb_person->set_attribute( si_name, The Huddled Masses );", then all of the other parts of the model that referred to the table would not break, and an XML dump would show that all the references now say The Huddled Masses.
For some more (older) examples of SQL::Routine in use, see its test suite code.
Download (0.17MB)
Added: 2006-09-12 License: Perl Artistic License Price:
1137 downloads
Failmalloc 1.0
Failmalloc generates a shared library which can be loaded by LD_PRELOAD or linked at compilation time. more>>
Failmalloc generates a shared library which can be loaded by LD_PRELOAD or linked at compilation time.
Failmalloc is meant to demonstrate what really happens if memory allocation fails, which is a necessary part of testing the robustness of a program. Failmalloc inserts hooks into your program which induce failures of memory allocation calls.
The functions "malloc", "realloc", and "memalign" are hooked, but other functions which use one of these functions are also affected.
Enhancements:
- This release sets ENOMEM in errno, according to Unix98.
- It adds the variables FAILMALLOC_TIMES and FAILMALLOC_SPACE to specify the maximum number of failures and available free space.
<<lessFailmalloc is meant to demonstrate what really happens if memory allocation fails, which is a necessary part of testing the robustness of a program. Failmalloc inserts hooks into your program which induce failures of memory allocation calls.
The functions "malloc", "realloc", and "memalign" are hooked, but other functions which use one of these functions are also affected.
Enhancements:
- This release sets ENOMEM in errno, according to Unix98.
- It adds the variables FAILMALLOC_TIMES and FAILMALLOC_SPACE to specify the maximum number of failures and available free space.
Download (0.29MB)
Added: 2006-07-24 License: LGPL (GNU Lesser General Public License) Price:
1187 downloads
Other version of Failmalloc
License:LGPL (GNU Lesser General Public License)
Free Digital Money 0.2
Free Digital Money is a free open source project aimed at promoting ideas and stimulating further innovation. more>>
Free Digital Money projetc is aimed at promoting ideas and stimulating further innovation in the field of digital bearer money.
Digital bearer money is like cash and can be transferred person-to-person without going through a bank or PayPal account.
Scope
The scope of this project is necessarily limited; digital bearer money schemes are difficult to implement.
The project will develop and release a Digital Money system and applications, suitable for teaching and idea-testing.
The current release (V0.2) delivers a basic digital PGP-based coin system.
The next release will provide a transport mechanism to send the coins to an intended recipient; and a client application (a Wallet).
How You Can Help
We welcome technical help in a variety of forms:
- Application writers and visionaries: to use the FreeDMoney software to experiment with new ideas
- Coders: to extend the current software or to implement a completely new payment system
- Vendors of existing digital payment schemes: to implement a FDM interface to their code
Educational Usage
Students (and others) are welcome and encouraged to use FreeDMoney as a basis for discussing other considerations of building a secure payment systems.
Examples:
- What technical peer-review process would be required to be confident in the security of the system?
- What are the limitations in the model that would need to be overcome in order to make this into a technically sound basis for a real-world, real-value payment system?
- Assuming these limitations had been overcome, what operational considerations would need to be addressed to deliver a secure, reliable payment system?
- How do existing payment systems address these issues?
What legal and regulatory issues would need to be addressed in the target jurisdictions?
Enhancements:
- Initial Coin implementation and "test bank" Web application.
<<lessDigital bearer money is like cash and can be transferred person-to-person without going through a bank or PayPal account.
Scope
The scope of this project is necessarily limited; digital bearer money schemes are difficult to implement.
The project will develop and release a Digital Money system and applications, suitable for teaching and idea-testing.
The current release (V0.2) delivers a basic digital PGP-based coin system.
The next release will provide a transport mechanism to send the coins to an intended recipient; and a client application (a Wallet).
How You Can Help
We welcome technical help in a variety of forms:
- Application writers and visionaries: to use the FreeDMoney software to experiment with new ideas
- Coders: to extend the current software or to implement a completely new payment system
- Vendors of existing digital payment schemes: to implement a FDM interface to their code
Educational Usage
Students (and others) are welcome and encouraged to use FreeDMoney as a basis for discussing other considerations of building a secure payment systems.
Examples:
- What technical peer-review process would be required to be confident in the security of the system?
- What are the limitations in the model that would need to be overcome in order to make this into a technically sound basis for a real-world, real-value payment system?
- Assuming these limitations had been overcome, what operational considerations would need to be addressed to deliver a secure, reliable payment system?
- How do existing payment systems address these issues?
What legal and regulatory issues would need to be addressed in the target jurisdictions?
Enhancements:
- Initial Coin implementation and "test bank" Web application.
Download (0.73MB)
Added: 2006-10-13 License: Freely Distributable Price:
1114 downloads
ambergris 0.1.0
ambergriss goal is to provide a simple Ruby solution to two-way sync appointments and contacts between Evolution and Kolab2. more>>
ambergriss goal is to provide a simple Ruby solution to two-way sync appointments and contacts between Evolution and Kolab2 for offline work.
Here is a description of the ambergris directory structure:
ext/ contains native ruby Evolution interface code
lib/ contains the ambergris library code in ruby
misc/ basically contains old code that is not use anymore
test/ contains unit tests for ambergris
Here is a description of the most important ruby files contained in ambergris:
evolution.rb ruby part of the evolution ruby interface
pim.rb general PIM classes to represent appointments and Contacts
kolab.rb code to retrieve and store PIM data via IMAP on a kolab2 server
wallet.rb simple account/password management
sync.rb general syncing mechanism for PIM objects
<<lessHere is a description of the ambergris directory structure:
ext/ contains native ruby Evolution interface code
lib/ contains the ambergris library code in ruby
misc/ basically contains old code that is not use anymore
test/ contains unit tests for ambergris
Here is a description of the most important ruby files contained in ambergris:
evolution.rb ruby part of the evolution ruby interface
pim.rb general PIM classes to represent appointments and Contacts
kolab.rb code to retrieve and store PIM data via IMAP on a kolab2 server
wallet.rb simple account/password management
sync.rb general syncing mechanism for PIM objects
Download (0.083MB)
Added: 2006-06-26 License: BSD License Price:
1215 downloads
DaemonRip 1.0.2
DaemonRip runs as a Unix daemon and polls a CD drive to see if an audio CD is inserted. more>>
DaemonRip runs as a Unix daemon and polls a CD drive to see if an audio CD is inserted.
When an audio CD is detected, it will automatically connect to a CDDB server to determine the name, artists, and tracks of the CD, and begin to rip and encode the CD using your preferred ripping and encoding applications.
When finished ripping the disc, it will be ejected from the drive, allowing you to insert a new one to continue the process. No other user interaction is required.
DaemonRip project also can keep statistics about your ripping and encoding times, and logs all of the actions to a log file.
<<lessWhen an audio CD is detected, it will automatically connect to a CDDB server to determine the name, artists, and tracks of the CD, and begin to rip and encode the CD using your preferred ripping and encoding applications.
When finished ripping the disc, it will be ejected from the drive, allowing you to insert a new one to continue the process. No other user interaction is required.
DaemonRip project also can keep statistics about your ripping and encoding times, and logs all of the actions to a log file.
Download (0.017MB)
Added: 2006-02-12 License: GPL (GNU General Public License) Price:
1350 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 wallet inserts 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