ops
Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 86
PDL::Ops 2.4.3
PDL::Ops Perl module contains fundamental mathematical operators. more>>
PDL::Ops Perl module contains fundamental mathematical operators.
This module provides the functions used by PDL to overload the basic mathematical operators (+ - / * etc.) and functions (sin sqrt etc.)
It also includes the function log10, which should be a perl function so that we can overload it!
Matrix multiplication (the operator x) is handled by the module PDL::Primitive.
$doc
$c = $name $a, $b, 0; # explicit call with trailing 0
$c = $a $op $b; # overloaded call
$a->inplace->$name($b,0); # modify $a inplace
It can be made to work inplace with the $a->inplace syntax. This function is used to overload the binary $optxt operator. Note that when calling this function explicitly you need to supply a third argument that should generally be zero (see first example). This restriction is expected to go away in future releases. EOD } # sub: biop()
#simple binary functions sub bifunc { my ($name,$func,$swap,$doc,%extra) = @_; my $funcov = ref $func eq ARRAY ? $func->[1] : $func; my $isop=0; if ($funcov =~ s/^op//) { $isop = 1; } my $funcovp = protect_chars $funcov; $func = $func->[0] if ref $func eq ARRAY; if ($swap) { $extra{HdrCode} .= 1, NoBadifNaN => 1, Pars => a(); b(); [o]c();, OtherPars => int swap, Inplace => [ a ], # quick and dirty solution to get ->inplace do its job Code => "$c() = $func($a(),$b());", BadCode => if ( $ISBAD(a()) || $ISBAD(b()) ) $SETBAD(c()); else . "n $c() = $func($a(),$b());n", CopyBadStatusCode => if ( $BADFLAGCACHE() ) { if ( a == c && $ISPDLSTATEGOOD(a) ) { PDL->propogate_badflag( c, 1 ); /* have inplace op AND badflag has changed */ } $SETPDLSTATEBAD(c); }, %extra, Doc => $name($b,0); # explicit function call
$ovcall
$a->inplace->$name($b,0); # modify $a inplace
It can be made to work inplace with the $a->inplace syntax. This function is used to overload the binary $funcovp function. Note that when calling this function explicitly you need to supply a third argument that should generally be zero (see first example). This restriction is expected to go away in future releases. EOD } # sub: bifunc()
# simple unary functions and operators sub ufunc { my ($name,$func,$doc,%extra) = @_; my $funcov = ref $func eq ARRAY ? $func->[1] : $func; my $funcovp = protect_chars $funcov; $func = $func->[0] if ref $func eq ARRAY;
# handle exceptions
my $badcode = $ISBAD(a());
if ( exists $extra{Exception} ) {
# $badcode .= " || $extra{Exception}";
# print "Warning: ignored exception for $namen";
delete $exists{Exception};
}
# do not have to worry about propogation of the badflag when
# inplace since only input piddle is a, hence its badflag
# wont change
# UNLESS an exception occurs...
pp_def($name,
Pars => a(); [o]b(),
HandleBad => 1,
NoBadifNaN => 1,
Inplace => 1,
Code =>
"$b() = $func($a());",
BadCode =>
if ( . $badcode . )
$SETBAD(b());
else . "n $b() = $func($a());n",
%extra,
Doc => inplace->$name; # modify $a inplace
It can be made to work inplace with the $a->inplace syntax. This function is used to overload the unary $funcovp operator/function. EOD } # sub: ufunc()
######################################################################
# we trap some illegal operations here -- see the Exception option # note, for the ufunc()s, the checks do not work too well # for unsigned integer types (ie < 0) # # XXX needs thinking about # - have to integrate into Code section as well (so # 12/pdl(2,4,0,3) is trapped and flagged bad) # --> complicated # - perhaps could use type %{ %} ? # # ==> currently have commented out the exception code, since # want to see if can use NaN/Inf for bad values # (would solve many problems for F,D types) # # there is an issue over how we handle comparison operators # - see Primitive/primitive.pd/zcover() for more discussion #
## arithmetic ops # no swap biop(plus,+,0,add two piddles); biop(mult,*,0,multiply two piddles);
# all those need swapping biop(minus,-,1,subtract two piddles); biop(divide,/,1,divide two piddles, Exception => $b() == 0 );
## note: divide should perhaps trap division by zero as well
## comparison ops # need swapping biop(gt,>,1,the binary > (greater than) operation); biop(lt,,1,leftshift a$ by $b,GenericTypes => $T); biop(or2,|,0,binary or of two piddles,GenericTypes => $T); biop(and2,&,0,binary and of two piddles,GenericTypes => $T); biop(xor,^,0,binary exclusive or of two piddles,GenericTypes => $T);
# really an ufunc ufunc(bitnot,~,unary bit negation,GenericTypes => $T);
# some standard binary functions bifunc(power,[pow,op**],1,raise piddle $a to the power b,GenericTypes => [D]); bifunc(atan2,atan2,1,elementwise atan2 of two piddles,GenericTypes => [D]); bifunc(modulo,[MOD,op%],1,elementwise modulo operation); bifunc(spaceship,[SPACE,op],1,elementwise ~ operation);
# some standard unary functions ufunc(sqrt,sqrt,elementwise square root, Exception => $a() < 0 ); ufunc(abs,[ABS,abs],elementwise absolute value,GenericTypes => [D,F,S,L]); ufunc(sin,sin,the sin function); ufunc(cos,cos,the cos function); ufunc(not,!,the elementwise not operation); ufunc(exp,exp,the exponential function,GenericTypes => [D]); ufunc(log,log,the natural logarithm,GenericTypes => [D], Exception => $a() [D], Exception => $a() sub PDL::log10 { my $x = shift; if ( ! UNIVERSAL::isa($x,"PDL") ) { return log($x) / log(10); } my $y; if ( $x->is_inplace ) { $x->set_inplace(0); $y = $x; } elsif( ref($x) eq "PDL"){ #PDL Objects, use nullcreate: $y = PDL->nullcreate($x); }else{ #PDL-Derived Object, use copy: (Consistent with # Auto-creation docs in Objects.pod) $y = $x->copy; } &PDL::_log10_int( $x, $y ); return $y; }; );
# note: the extra code that adding HandleBad => 1 creates is # unneeded here. Things could be made clever enough to work this out, # but its very low priority. # It does add doc information though, and lets people know its been # looked at for bad value support # DJB adds: not completely sure about this now that I have added code # to avoid a valgrind-reported error (see the CacheBadFlagInit rule # in PP.pm) # # Cant this be handled in Core.pm when .= is overloaded ? # pp_def( assgn, # HandleBad => 1, Pars => a(); [o]b();, Code => $b() = $a();, # BadCode => # if ( $ISBAD(a()) ) { $SETBAD(b()); } else { $b() = $a(); }, Doc => Plain numerical assignment. This is used to implement the ".=" operator, ); # pp_def assgn
#pp_export_nothing();
pp_done();
<<lessThis module provides the functions used by PDL to overload the basic mathematical operators (+ - / * etc.) and functions (sin sqrt etc.)
It also includes the function log10, which should be a perl function so that we can overload it!
Matrix multiplication (the operator x) is handled by the module PDL::Primitive.
$doc
$c = $name $a, $b, 0; # explicit call with trailing 0
$c = $a $op $b; # overloaded call
$a->inplace->$name($b,0); # modify $a inplace
It can be made to work inplace with the $a->inplace syntax. This function is used to overload the binary $optxt operator. Note that when calling this function explicitly you need to supply a third argument that should generally be zero (see first example). This restriction is expected to go away in future releases. EOD } # sub: biop()
#simple binary functions sub bifunc { my ($name,$func,$swap,$doc,%extra) = @_; my $funcov = ref $func eq ARRAY ? $func->[1] : $func; my $isop=0; if ($funcov =~ s/^op//) { $isop = 1; } my $funcovp = protect_chars $funcov; $func = $func->[0] if ref $func eq ARRAY; if ($swap) { $extra{HdrCode} .= 1, NoBadifNaN => 1, Pars => a(); b(); [o]c();, OtherPars => int swap, Inplace => [ a ], # quick and dirty solution to get ->inplace do its job Code => "$c() = $func($a(),$b());", BadCode => if ( $ISBAD(a()) || $ISBAD(b()) ) $SETBAD(c()); else . "n $c() = $func($a(),$b());n", CopyBadStatusCode => if ( $BADFLAGCACHE() ) { if ( a == c && $ISPDLSTATEGOOD(a) ) { PDL->propogate_badflag( c, 1 ); /* have inplace op AND badflag has changed */ } $SETPDLSTATEBAD(c); }, %extra, Doc => $name($b,0); # explicit function call
$ovcall
$a->inplace->$name($b,0); # modify $a inplace
It can be made to work inplace with the $a->inplace syntax. This function is used to overload the binary $funcovp function. Note that when calling this function explicitly you need to supply a third argument that should generally be zero (see first example). This restriction is expected to go away in future releases. EOD } # sub: bifunc()
# simple unary functions and operators sub ufunc { my ($name,$func,$doc,%extra) = @_; my $funcov = ref $func eq ARRAY ? $func->[1] : $func; my $funcovp = protect_chars $funcov; $func = $func->[0] if ref $func eq ARRAY;
# handle exceptions
my $badcode = $ISBAD(a());
if ( exists $extra{Exception} ) {
# $badcode .= " || $extra{Exception}";
# print "Warning: ignored exception for $namen";
delete $exists{Exception};
}
# do not have to worry about propogation of the badflag when
# inplace since only input piddle is a, hence its badflag
# wont change
# UNLESS an exception occurs...
pp_def($name,
Pars => a(); [o]b(),
HandleBad => 1,
NoBadifNaN => 1,
Inplace => 1,
Code =>
"$b() = $func($a());",
BadCode =>
if ( . $badcode . )
$SETBAD(b());
else . "n $b() = $func($a());n",
%extra,
Doc => inplace->$name; # modify $a inplace
It can be made to work inplace with the $a->inplace syntax. This function is used to overload the unary $funcovp operator/function. EOD } # sub: ufunc()
######################################################################
# we trap some illegal operations here -- see the Exception option # note, for the ufunc()s, the checks do not work too well # for unsigned integer types (ie < 0) # # XXX needs thinking about # - have to integrate into Code section as well (so # 12/pdl(2,4,0,3) is trapped and flagged bad) # --> complicated # - perhaps could use type %{ %} ? # # ==> currently have commented out the exception code, since # want to see if can use NaN/Inf for bad values # (would solve many problems for F,D types) # # there is an issue over how we handle comparison operators # - see Primitive/primitive.pd/zcover() for more discussion #
## arithmetic ops # no swap biop(plus,+,0,add two piddles); biop(mult,*,0,multiply two piddles);
# all those need swapping biop(minus,-,1,subtract two piddles); biop(divide,/,1,divide two piddles, Exception => $b() == 0 );
## note: divide should perhaps trap division by zero as well
## comparison ops # need swapping biop(gt,>,1,the binary > (greater than) operation); biop(lt,,1,leftshift a$ by $b,GenericTypes => $T); biop(or2,|,0,binary or of two piddles,GenericTypes => $T); biop(and2,&,0,binary and of two piddles,GenericTypes => $T); biop(xor,^,0,binary exclusive or of two piddles,GenericTypes => $T);
# really an ufunc ufunc(bitnot,~,unary bit negation,GenericTypes => $T);
# some standard binary functions bifunc(power,[pow,op**],1,raise piddle $a to the power b,GenericTypes => [D]); bifunc(atan2,atan2,1,elementwise atan2 of two piddles,GenericTypes => [D]); bifunc(modulo,[MOD,op%],1,elementwise modulo operation); bifunc(spaceship,[SPACE,op],1,elementwise ~ operation);
# some standard unary functions ufunc(sqrt,sqrt,elementwise square root, Exception => $a() < 0 ); ufunc(abs,[ABS,abs],elementwise absolute value,GenericTypes => [D,F,S,L]); ufunc(sin,sin,the sin function); ufunc(cos,cos,the cos function); ufunc(not,!,the elementwise not operation); ufunc(exp,exp,the exponential function,GenericTypes => [D]); ufunc(log,log,the natural logarithm,GenericTypes => [D], Exception => $a() [D], Exception => $a() sub PDL::log10 { my $x = shift; if ( ! UNIVERSAL::isa($x,"PDL") ) { return log($x) / log(10); } my $y; if ( $x->is_inplace ) { $x->set_inplace(0); $y = $x; } elsif( ref($x) eq "PDL"){ #PDL Objects, use nullcreate: $y = PDL->nullcreate($x); }else{ #PDL-Derived Object, use copy: (Consistent with # Auto-creation docs in Objects.pod) $y = $x->copy; } &PDL::_log10_int( $x, $y ); return $y; }; );
# note: the extra code that adding HandleBad => 1 creates is # unneeded here. Things could be made clever enough to work this out, # but its very low priority. # It does add doc information though, and lets people know its been # looked at for bad value support # DJB adds: not completely sure about this now that I have added code # to avoid a valgrind-reported error (see the CacheBadFlagInit rule # in PP.pm) # # Cant this be handled in Core.pm when .= is overloaded ? # pp_def( assgn, # HandleBad => 1, Pars => a(); [o]b();, Code => $b() = $a();, # BadCode => # if ( $ISBAD(a()) ) { $SETBAD(b()); } else { $b() = $a(); }, Doc => Plain numerical assignment. This is used to implement the ".=" operator, ); # pp_def assgn
#pp_export_nothing();
pp_done();
Download (2.1MB)
Added: 2007-06-29 License: Perl Artistic License Price:
847 downloads
Ops Control Panel 1.4.2
Ops Control Panel is a frontend for MRTG. more>>
Ops Control Panel is a frontend for MRTG.
Unlike many other frontends, it does not have any requirements beyond those of MRTG, although it can support PHP-enabled Web servers instead of just running as a Perl CGI script.
Ops Control Panel project provides overviews of MRTG-based monitoring pages in a variety of formats.
<<lessUnlike many other frontends, it does not have any requirements beyond those of MRTG, although it can support PHP-enabled Web servers instead of just running as a Perl CGI script.
Ops Control Panel project provides overviews of MRTG-based monitoring pages in a variety of formats.
Download (0.017MB)
Added: 2005-12-28 License: GPL (GNU General Public License) Price:
1397 downloads
op 1.32
op tool provides a flexible means for system administrators to grant access to certain root operations. more>>
op tool provides a flexible means for system administrators to grant access to certain root operations without having to give them full superuser privileges.
Different sets of users may access different operations, and the security-related aspects of each operation can be carefully controlled.
It was originally written around 1990 by Tom Christiansen and Dave Koblas. Further updates and porting were performed by Howard Owen. The last version of this vintage is available here. The current version is maintained by Alec Thomas.
I first came into contact with op whilst working at Access Gaming Systems, where op was used extensively to control developer and administrator access to resources.
Enhancements:
- rpl_malloc/rpl_realloc was added so that systems with dodgy implementations will link.
- This fixes compilation on HP-UX.
- If a help parameter does not exist, the actual command to be run for the help is used.
- Detection for openlog() returning void was added.
<<lessDifferent sets of users may access different operations, and the security-related aspects of each operation can be carefully controlled.
It was originally written around 1990 by Tom Christiansen and Dave Koblas. Further updates and porting were performed by Howard Owen. The last version of this vintage is available here. The current version is maintained by Alec Thomas.
I first came into contact with op whilst working at Access Gaming Systems, where op was used extensively to control developer and administrator access to resources.
Enhancements:
- rpl_malloc/rpl_realloc was added so that systems with dodgy implementations will link.
- This fixes compilation on HP-UX.
- If a help parameter does not exist, the actual command to be run for the help is used.
- Detection for openlog() returning void was added.
Download (0.14MB)
Added: 2005-12-08 License: BSD License Price:
1415 downloads
pam_smxs 1.6
pam_smxs is a PAM module that authenticates a user using challenge-response. more>>
pam_smxs is a PAM module that authenticates a user using challenge-response. All tokens that support ANSI X9.9 are currently supported and it provides full support for CryptoCard RB1 tokens.
Installation from source:
Unpack the tarball: tar -zxvf pam_smxs-1.6-1.tar.gz
Change into that dir: cd pam_smxs-1.6, and do a ./configure --enable-rb1 issue a make.
After that, you should end op with a pam_smxs.so file in the dir you are in now. A make install should install the module.
Configuration:
After installing the module (it should be in /lib/security), the following is neccesary to make it work:
Edit the /etc/pam.d/xxx file, where xxx is a service, for example login. In that case, edit /etc/pam.d/login
Normally it looks something like this:
#%PAM-1.0
auth required /lib/security/pam_securetty.so
auth required /lib/security/pam_pwdb.so shadow nullok
auth required /lib/security/pam_nologin.so
accountrequired /lib/security/pam_pwdb.so
password required /lib/security/pam_cracklib.so
password required /lib/security/pam_pwdb.so shadow nullok use_authtok
password required /lib/security/pam_smxs.so
session required /lib/security/pam_pwdb.so
session optional /lib/security/pam_console.so
session required /lib/security/pam_limits.so
Im using this on instead :
auth required /lib/security/pam_securetty.so
auth required /lib/security/pam_smxs.so
auth required /lib/security/pam_nologin.so
accountrequired /lib/security/pam_smxs.so
password required /lib/security/pam_smxs.so
session required /lib/security/pam_smxs.so
session optional /lib/security/pam_console.so
session required /lib/security/pam_limits.so
This will let the users authenticate using pam_smxs. Also see the PAM documentation for futher configuration directives.
Then use the cryptoadm program to add / remove / modify users.
<<lessInstallation from source:
Unpack the tarball: tar -zxvf pam_smxs-1.6-1.tar.gz
Change into that dir: cd pam_smxs-1.6, and do a ./configure --enable-rb1 issue a make.
After that, you should end op with a pam_smxs.so file in the dir you are in now. A make install should install the module.
Configuration:
After installing the module (it should be in /lib/security), the following is neccesary to make it work:
Edit the /etc/pam.d/xxx file, where xxx is a service, for example login. In that case, edit /etc/pam.d/login
Normally it looks something like this:
#%PAM-1.0
auth required /lib/security/pam_securetty.so
auth required /lib/security/pam_pwdb.so shadow nullok
auth required /lib/security/pam_nologin.so
accountrequired /lib/security/pam_pwdb.so
password required /lib/security/pam_cracklib.so
password required /lib/security/pam_pwdb.so shadow nullok use_authtok
password required /lib/security/pam_smxs.so
session required /lib/security/pam_pwdb.so
session optional /lib/security/pam_console.so
session required /lib/security/pam_limits.so
Im using this on instead :
auth required /lib/security/pam_securetty.so
auth required /lib/security/pam_smxs.so
auth required /lib/security/pam_nologin.so
accountrequired /lib/security/pam_smxs.so
password required /lib/security/pam_smxs.so
session required /lib/security/pam_smxs.so
session optional /lib/security/pam_console.so
session required /lib/security/pam_limits.so
This will let the users authenticate using pam_smxs. Also see the PAM documentation for futher configuration directives.
Then use the cryptoadm program to add / remove / modify users.
Download (0.030MB)
Added: 2006-05-15 License: GPL (GNU General Public License) Price:
1257 downloads
Parrot::OpTrans 0.4.5
Parrot::OpTrans is a Perl module that can transform Ops to C Code. more>>
Parrot::OpTrans is a Perl module that can transform Ops to C Code.
Parrot::OpTrans is the abstract superclass for the Parrot op to C transforms. Each transform contains various bits of information needed to generate the C code, and creates a different type of run loop. The methods defined here supply various default values and behaviour common to all transforms.
The subclass hierarchy is as follows:
OpTrans
|_________________________
| | |
C CGoto Compiled
| |
CPrederef |
| | |
| |_________|
| |
CSwitch CGP
Class Methods
new()
Returns a new instance.
Instance Methods
prefix()
Returns the default Parrot_ prefix.
Used by Parrot::Ops func_name() to individuate op function names.
suffix()
Implemented in subclasses to return a suffix with which to individuate variable names. This default implementation returns an empty string.
defines()
Implemented in subclasses to return the C #define macros required.
opsarraytype()
Returns the type for the array of opcodes. By default here its an array opcode_t, but the prederef runops core uses an array of void* to do its clever tricks.
core_type()
Implemented in subclasses to return the type of core created by the transform. This default implementation raises an exception indicating that the core type is missing. See the Parrot_Run_core_t enum in include/parrot/interpreter.h for a list of the core types.
core_prefix()
Implemented in subclasses to return a short prefix indicating the core type used to individuate core function names.
run_core_func_decl($base)
Optionally implemented in subclasses to return the C code for the run core function declaration. $base is the name of the main ops file minus the .ops extension.
ops_addr_decl($base_suffix)
Optionally implemented in subclasses to return the C code for the ops address declaration. $base_suffix is the name of the main ops file minus the .ops extension with suffix() and an underscore appended.
run_core_func_decl($base)
Optionally implemented in subclasses to return the C code for the run core function declaration. $base is the same as for run_core_func_decl().
run_core_func_start()
Implemented in subclasses, if run_core_func_decl() is implemented, to return the C code prior to the run core function.
run_core_after_addr_table($base_suffix)
Optionally implemented in subclasses to return the run core C code for section after the address table. $base_suffix is the same as for ops_addr_decl().
run_core_finish($base)
Implemented in subclasses to return the C code following the run core function. $base is the same as for run_core_func_decl().
init_func_init1($base)
Optionally implemented in subclasses to return the C code for the cores init function. $base is the same as for run_core_func_decl().
init_set_dispatch($base_suffix)
Optionally implemented in subclasses to return the C code for initializing the dispatch mechanism within the cores init function. $base_suffix is the same as for ops_addr_decl().
Macro Substitutions
The following methods are called by Parrot::OpFile to perform ops file macro substitutions.
access_arg($type, $value, $op)
Implemented in subclasses to return the C code for the specified op argument type and value. $op is an instance of Parrot::Op.
gen_goto($where)
The various goto_X methods below call this method with the return value of an expr_X method (implemented in subclass).
restart_address($address)
Implemented in subclasses to return the C code for restart ADDRESS($address).
restart_offset($offset)
Implemented in subclasses to return the C code for restart OFFSET($offset).
goto_address($address)
Transforms the goto ADDRESS($address) macro in an ops file into the relevant C code.
goto_offset($offset)
Transforms the goto OFFSET($offset) macro in an ops file into the relevant C code.
goto_pop()
Transforms the goto POP($address) macro in an ops file into the relevant C code.
expr_offset($offset)
Implemented in subclasses to return the C code for OFFSET($offset). Called by goto_offset().
expr_address($address)
Implemented in subclasses to return the C code for ADDRESS($address). Called by goto_address().
<<lessParrot::OpTrans is the abstract superclass for the Parrot op to C transforms. Each transform contains various bits of information needed to generate the C code, and creates a different type of run loop. The methods defined here supply various default values and behaviour common to all transforms.
The subclass hierarchy is as follows:
OpTrans
|_________________________
| | |
C CGoto Compiled
| |
CPrederef |
| | |
| |_________|
| |
CSwitch CGP
Class Methods
new()
Returns a new instance.
Instance Methods
prefix()
Returns the default Parrot_ prefix.
Used by Parrot::Ops func_name() to individuate op function names.
suffix()
Implemented in subclasses to return a suffix with which to individuate variable names. This default implementation returns an empty string.
defines()
Implemented in subclasses to return the C #define macros required.
opsarraytype()
Returns the type for the array of opcodes. By default here its an array opcode_t, but the prederef runops core uses an array of void* to do its clever tricks.
core_type()
Implemented in subclasses to return the type of core created by the transform. This default implementation raises an exception indicating that the core type is missing. See the Parrot_Run_core_t enum in include/parrot/interpreter.h for a list of the core types.
core_prefix()
Implemented in subclasses to return a short prefix indicating the core type used to individuate core function names.
run_core_func_decl($base)
Optionally implemented in subclasses to return the C code for the run core function declaration. $base is the name of the main ops file minus the .ops extension.
ops_addr_decl($base_suffix)
Optionally implemented in subclasses to return the C code for the ops address declaration. $base_suffix is the name of the main ops file minus the .ops extension with suffix() and an underscore appended.
run_core_func_decl($base)
Optionally implemented in subclasses to return the C code for the run core function declaration. $base is the same as for run_core_func_decl().
run_core_func_start()
Implemented in subclasses, if run_core_func_decl() is implemented, to return the C code prior to the run core function.
run_core_after_addr_table($base_suffix)
Optionally implemented in subclasses to return the run core C code for section after the address table. $base_suffix is the same as for ops_addr_decl().
run_core_finish($base)
Implemented in subclasses to return the C code following the run core function. $base is the same as for run_core_func_decl().
init_func_init1($base)
Optionally implemented in subclasses to return the C code for the cores init function. $base is the same as for run_core_func_decl().
init_set_dispatch($base_suffix)
Optionally implemented in subclasses to return the C code for initializing the dispatch mechanism within the cores init function. $base_suffix is the same as for ops_addr_decl().
Macro Substitutions
The following methods are called by Parrot::OpFile to perform ops file macro substitutions.
access_arg($type, $value, $op)
Implemented in subclasses to return the C code for the specified op argument type and value. $op is an instance of Parrot::Op.
gen_goto($where)
The various goto_X methods below call this method with the return value of an expr_X method (implemented in subclass).
restart_address($address)
Implemented in subclasses to return the C code for restart ADDRESS($address).
restart_offset($offset)
Implemented in subclasses to return the C code for restart OFFSET($offset).
goto_address($address)
Transforms the goto ADDRESS($address) macro in an ops file into the relevant C code.
goto_offset($offset)
Transforms the goto OFFSET($offset) macro in an ops file into the relevant C code.
goto_pop()
Transforms the goto POP($address) macro in an ops file into the relevant C code.
expr_offset($offset)
Implemented in subclasses to return the C code for OFFSET($offset). Called by goto_offset().
expr_address($address)
Implemented in subclasses to return the C code for ADDRESS($address). Called by goto_address().
Download (3.1MB)
Added: 2006-07-06 License: Perl Artistic License Price:
1205 downloads
psyBNC 2.3.2-7
psyBNC is an irc bouncer which holds the connection to the irc-server. more>>
psyBNC is an irc bouncer which holds the connection to the irc-server.
This program is useful for people who cannot be on irc all the time. Its used to keep a connection to irc and your irc client connected, or also allows to act as a normal bouncer by disconnecting from the irc server when the client disconnects.
Being installed on a shell with a permanently connected machine you stay connected
as long you want or until the program crashes *g*.
Due to the fact this programm allows multiple Users at the same time (just change
MAXUSER in the config.h file to get less or more possible Users) you can also trade
kinds of connections with other people running only one backgroundtask at all.
Thats very interesting by using shells which prohibit more than one backgroundtask.
Remember, sometimes admins also care about traffic, traffic by one client connected
to irc is approx. 170 MBytes of traffic per month.
Main features:
- Possibility of linking the bouncer (u can use all vhosts of the linked bouncers (if allowed))
- automatically setting MODE +i-s nick on connect to prevent the filling of the logs with spam
- Crypting of Passwords
- DCC sessions to bots are hold
- Nicks will be saved
- Permanent connections to IRC while you are offline
- Only One Backgroundtask running, even with 100 serving connections
- supports up to 100 Users
- On-Bounce Administration (/ADDUSER, /DELUSER, /ADMIN, /UNADMIN)
- On-Bounce Usersettings (/ADDSERVER, /REMOVESERVER, /JUMP)
- GiveOps: Other users with specific Host can request OP from your bounce
- GiveOps Commands (/ADDOP, /DELOP, /LISTOPS)
- AskOp: The Bounce can automatically ask for Ops when rejoining from hostmasks
- AskOps Commands (/ADDASK, /DELASK, /LISTASK)
- Channels will be saved
- Full Message-Logging, Full Connection Logging
- Log Commands (/PLAYLOG, /ERASELOG, /PLAYMAINLOG, /ERASEMAINLOG)
- On Bounce queries (Nicks preceding "$")
- in 1.1 changed to channel specifig bans/ops/askops and included a setaway function
- Bounce Partyline (Query to/from "$$")
- u can switch off/on systemmessages (/SYSMSG)
Enhancements:
- Supports multi-clients
- Supports asynchroneous resolving
- Supports Prefixes
- bugfixes
<<lessThis program is useful for people who cannot be on irc all the time. Its used to keep a connection to irc and your irc client connected, or also allows to act as a normal bouncer by disconnecting from the irc server when the client disconnects.
Being installed on a shell with a permanently connected machine you stay connected
as long you want or until the program crashes *g*.
Due to the fact this programm allows multiple Users at the same time (just change
MAXUSER in the config.h file to get less or more possible Users) you can also trade
kinds of connections with other people running only one backgroundtask at all.
Thats very interesting by using shells which prohibit more than one backgroundtask.
Remember, sometimes admins also care about traffic, traffic by one client connected
to irc is approx. 170 MBytes of traffic per month.
Main features:
- Possibility of linking the bouncer (u can use all vhosts of the linked bouncers (if allowed))
- automatically setting MODE +i-s nick on connect to prevent the filling of the logs with spam
- Crypting of Passwords
- DCC sessions to bots are hold
- Nicks will be saved
- Permanent connections to IRC while you are offline
- Only One Backgroundtask running, even with 100 serving connections
- supports up to 100 Users
- On-Bounce Administration (/ADDUSER, /DELUSER, /ADMIN, /UNADMIN)
- On-Bounce Usersettings (/ADDSERVER, /REMOVESERVER, /JUMP)
- GiveOps: Other users with specific Host can request OP from your bounce
- GiveOps Commands (/ADDOP, /DELOP, /LISTOPS)
- AskOp: The Bounce can automatically ask for Ops when rejoining from hostmasks
- AskOps Commands (/ADDASK, /DELASK, /LISTASK)
- Channels will be saved
- Full Message-Logging, Full Connection Logging
- Log Commands (/PLAYLOG, /ERASELOG, /PLAYMAINLOG, /ERASEMAINLOG)
- On Bounce queries (Nicks preceding "$")
- in 1.1 changed to channel specifig bans/ops/askops and included a setaway function
- Bounce Partyline (Query to/from "$$")
- u can switch off/on systemmessages (/SYSMSG)
Enhancements:
- Supports multi-clients
- Supports asynchroneous resolving
- Supports Prefixes
- bugfixes
Download (0.30MB)
Added: 2006-10-18 License: GPL (GNU General Public License) Price:
1117 downloads
OSSP var 1.1.3
OSSP var is a flexible, full-featured and fast variable construct expansion library. more>>
OSSP var is a flexible, full-featured and fast variable construct expansion library. It supports a configurable variable construct syntax very similar to the style found in many scripting languages (like @name, ${name}, , etc.) and provides both simple scalar (${name}) and array (${name[index]}) expansion, plus optionally one or more post-operations on the expanded value (${name:op:op...}).
The supported post-operations are length determination, case conversion, defaults, postive and negative alternatives, sub-strings, regular expression based substitutions, character translations, and padding.
Additionally, a meta-construct plus arithmetic expressions for index and range calculations allow (even nested) iterations over array variable expansions (..[..${name[#+1]}..]..). The actual variable value lookup is performed through a callback function, so OSSP var can expand arbitrary values.
Hint: There is also an ISO C++ derivative of the OSSP var library, named libvarexp. It is based on a development version of OSSP var and hence does not provide exactly the same amount of functionality. But it provides an ISO C++ API and so can be of interest to you if you are programming in ISO C++ (where OSSP vars ISO C API might be too boring for you).
Enhancements:
- Fix some sprintf(3) parameter passing. [Ralf S. Engelschall]
- Upgraded build environment to GNU libtool 1.5.20 and GNU shtool 2.0.3. [Ralf S. Engelschall]
- Bumped year in copyright messages for new year 2005. [Ralf S. Engelschall]
<<lessThe supported post-operations are length determination, case conversion, defaults, postive and negative alternatives, sub-strings, regular expression based substitutions, character translations, and padding.
Additionally, a meta-construct plus arithmetic expressions for index and range calculations allow (even nested) iterations over array variable expansions (..[..${name[#+1]}..]..). The actual variable value lookup is performed through a callback function, so OSSP var can expand arbitrary values.
Hint: There is also an ISO C++ derivative of the OSSP var library, named libvarexp. It is based on a development version of OSSP var and hence does not provide exactly the same amount of functionality. But it provides an ISO C++ API and so can be of interest to you if you are programming in ISO C++ (where OSSP vars ISO C API might be too boring for you).
Enhancements:
- Fix some sprintf(3) parameter passing. [Ralf S. Engelschall]
- Upgraded build environment to GNU libtool 1.5.20 and GNU shtool 2.0.3. [Ralf S. Engelschall]
- Bumped year in copyright messages for new year 2005. [Ralf S. Engelschall]
Download (0.33MB)
Added: 2005-10-03 License: MIT/X Consortium License Price:
1481 downloads
Eggdrop 1.6.18
Eggdrop is the worlds most popular open source Internet Relay Chat (IRC) bot. more>>
Eggdrop is the worlds most popular open source Internet Relay Chat (IRC) bot. Originally created by Robey Pointer in December 1993 for use on a channel called #gayteen, it has spawned an almost cult like following of users. It is a feature rich program designed to be easily used and expanded upon (using Tcl scripting) by both novice and advanced IRC users on a variety of hardware and software platforms.
Eggdrop is freely available and can be freely distributed under the terms of GNU General Public License.
An IRC bot is a program that sits on an IRC channel and preforms automated tasks while looking just like a normal user on the channel. Some of these functions include protecting the channel from abuse, allowing privileged users to gain op or voice status, logging channel events, providing information, hosting games, etc.
One of the features that makes Eggdrop stand out from other bots is module and Tcl scripting support. With scripts and modules, you can make the bot preform almost any task you want. They can do anything from preventing floods to greeting users and banning advertisers from channels.
You can also link multiple Eggdrop bots together to form a botnet. This can allow bots to op each other securely, control floods efficiently, and even link channels across multiple IRC networks. It also allows the Eggdrops share user lists, ban lists, exempt/invite lists, and ignore lists with other bots if userfile sharing is enabled. This allows users to have the same access on every bot on your botnet. It also allows the bots to distribute tasks such as opping and banning users. See doc/BOTNET for information on setting up a botnet.
Eggdrop is always being improved and adjusted because there are bugs to be fixed and features to be added (if the users demand them, and they make actually sense). In fact, it existed for several years as v0.7 - v0.9 before finally going 1.0. This version of Eggdrop is part of the 1.6 tree. A valiant effort has been made to chase down and destroy bugs.
This README file contains information about how to get Eggdrop, command line options for Eggdrop, what you may need to do when upgrading from older versions, a list of frequently asked questions, how to set up a crontab, some boring legal stuff, info about the mailing list (a great place to ask questions, and a good place to report bugs, too), some basics about CVS usage, and some channels where you might get help with Eggdrop.
<<lessEggdrop is freely available and can be freely distributed under the terms of GNU General Public License.
An IRC bot is a program that sits on an IRC channel and preforms automated tasks while looking just like a normal user on the channel. Some of these functions include protecting the channel from abuse, allowing privileged users to gain op or voice status, logging channel events, providing information, hosting games, etc.
One of the features that makes Eggdrop stand out from other bots is module and Tcl scripting support. With scripts and modules, you can make the bot preform almost any task you want. They can do anything from preventing floods to greeting users and banning advertisers from channels.
You can also link multiple Eggdrop bots together to form a botnet. This can allow bots to op each other securely, control floods efficiently, and even link channels across multiple IRC networks. It also allows the Eggdrops share user lists, ban lists, exempt/invite lists, and ignore lists with other bots if userfile sharing is enabled. This allows users to have the same access on every bot on your botnet. It also allows the bots to distribute tasks such as opping and banning users. See doc/BOTNET for information on setting up a botnet.
Eggdrop is always being improved and adjusted because there are bugs to be fixed and features to be added (if the users demand them, and they make actually sense). In fact, it existed for several years as v0.7 - v0.9 before finally going 1.0. This version of Eggdrop is part of the 1.6 tree. A valiant effort has been made to chase down and destroy bugs.
This README file contains information about how to get Eggdrop, command line options for Eggdrop, what you may need to do when upgrading from older versions, a list of frequently asked questions, how to set up a crontab, some boring legal stuff, info about the mailing list (a great place to ask questions, and a good place to report bugs, too), some basics about CVS usage, and some channels where you might get help with Eggdrop.
Download (0.786MB)
Added: 2006-10-23 License: GPL (GNU General Public License) Price:
1105 downloads
Parrot::OpTrans::C 0.4.5
Parrot::OpTrans::C is a Perl module Ops to C Code Generation. more>>
Parrot::OpTrans::C is a Perl module for Ops to C Code Generation.
DESCRIPTION
Parrot::OpTrans::C inherits from Parrot::OpTrans to provide a function-based (slow or fast core) run loop.
Instance Methods
core_type()
Returns PARROT_FUNCTION_CORE.
core_prefix()
Returns an empty string.
defines()
Returns the C #define macros for register access etc.
gen_goto($where)
Reimplements the superclass method so that $where is suitably cast.
expr_address($address)
Returns the C code for ADDRESS($address). Called by goto_address().
expr_offset($offset)
Returns the C code for OFFSET($offset). Called by goto_offset().
expr_pop()
Returns the C code for POP(). Called by goto_offset().
access_arg($type, $value, $op)
Returns the C code for the specified op argument type (see Parrot::OpTrans) and value. $op is an instance of Parrot::Op.
restart_offset($offset)
Returns the C code for restart OFFSET($offset).
restart_address($address)
Returns the C code for restart ADDRESS($address).
<<lessDESCRIPTION
Parrot::OpTrans::C inherits from Parrot::OpTrans to provide a function-based (slow or fast core) run loop.
Instance Methods
core_type()
Returns PARROT_FUNCTION_CORE.
core_prefix()
Returns an empty string.
defines()
Returns the C #define macros for register access etc.
gen_goto($where)
Reimplements the superclass method so that $where is suitably cast.
expr_address($address)
Returns the C code for ADDRESS($address). Called by goto_address().
expr_offset($offset)
Returns the C code for OFFSET($offset). Called by goto_offset().
expr_pop()
Returns the C code for POP(). Called by goto_offset().
access_arg($type, $value, $op)
Returns the C code for the specified op argument type (see Parrot::OpTrans) and value. $op is an instance of Parrot::Op.
restart_offset($offset)
Returns the C code for restart OFFSET($offset).
restart_address($address)
Returns the C code for restart ADDRESS($address).
Download (3.1MB)
Added: 2006-07-05 License: GPL (GNU General Public License) Price:
1206 downloads
Open Project Services 0.2
Open Project Services (OPS) is a project collaboration platform, integrating server components such as e-mail, calendaring. more>>
Open Project Services (OPS) is a project collaboration platform, integrating server components such as e-mail, calendaring, timesheets, documents, knowledge, etc. with standards complient clients. Open Project Services consists of a project server and a set of client extensions.
We are building a project collaboration platform. It consists of a project server that integrates with services needed within a project, e.g. e-mail, calendaring, timesheets, documents, knowledge, etc.
The project server is a Webservices hub based on Java (J2EE). The persistence layer for project information is LDAP. We use OpenLDAP now, but others should also be possible. The e-mail backend makes use of a standard IMAP server. Our reference implementation uses Courier.
We are building extensions/plugins for clients, making them OPS-enabled. We support e.g. Mozilla Thunderbird (XUL) and Squirrelmail (PHP) for e-mail clients. For the calendaring and timesheet components we have a Mozilla Sunbird extension (XUL).
In short: we are building a project collaboration environment on an OSS stack, enriching services with project information, using COTS clients/servers and open standards.
Enhancements:
- This release includes some changes to the underlying LDAP schema to make it possible to disable tasks when they are completed.
- To make use of this new feature, the Web services and the sunbird timesheet client have to be updated.
<<lessWe are building a project collaboration platform. It consists of a project server that integrates with services needed within a project, e.g. e-mail, calendaring, timesheets, documents, knowledge, etc.
The project server is a Webservices hub based on Java (J2EE). The persistence layer for project information is LDAP. We use OpenLDAP now, but others should also be possible. The e-mail backend makes use of a standard IMAP server. Our reference implementation uses Courier.
We are building extensions/plugins for clients, making them OPS-enabled. We support e.g. Mozilla Thunderbird (XUL) and Squirrelmail (PHP) for e-mail clients. For the calendaring and timesheet components we have a Mozilla Sunbird extension (XUL).
In short: we are building a project collaboration environment on an OSS stack, enriching services with project information, using COTS clients/servers and open standards.
Enhancements:
- This release includes some changes to the underlying LDAP schema to make it possible to disable tasks when they are completed.
- To make use of this new feature, the Web services and the sunbird timesheet client have to be updated.
Download (8.4MB)
Added: 2006-04-10 License: GPL (GNU General Public License) Price:
1302 downloads
B::Concise 5.8.8
B::Concise is a Perl syntax tree, printing concise info about ops. more>>
B::Concise is a Perl syntax tree, printing concise info about ops.
SYNOPSIS
perl -MO=Concise[,OPTIONS] foo.pl
use B::Concise qw(set_style add_callback);
This compiler backend prints the internal OPs of a Perl programs syntax tree in one of several space-efficient text formats suitable for debugging the inner workings of perl or other compiler backends. It can print OPs in the order they appear in the OP tree, in the order they will execute, or in a text approximation to their tree structure, and the format of the information displayed is customizable. Its function is similar to that of perls -Dx debugging flag or the B::Terse module, but it is more sophisticated and flexible.
EXAMPLE
Heres an example of 2 outputs (aka renderings), using the -exec and -basic (i.e. default) formatting conventions on the same code snippet.
% perl -MO=Concise,-exec -e $a = $b + 42
1 enter
2 nextstate(main 1 -e:1) v
3 gvsv[*b] s
4 const[IV 42] s
* 5 add[t3] sK/2
6 gvsv[*a] s
7 sassign vKS/2
8 leave[1 ref] vKP/REFC
Each line corresponds to an opcode. The opcode marked with * is used in a few examples below.
The 1st column is the ops sequence number, starting at 1, and is displayed in base 36 by default. This rendering is in -exec (i.e. execution) order.
The symbol between angle brackets indicates the ops type, for example; < 2 > is a BINOP, < @ > a LISTOP, and < # > is a PADOP, which is used in threaded perls. (see "OP class abbreviations").
The opname, as in add[t1], which may be followed by op-specific information in parentheses or brackets (ex [t1]).
The op-flags (ex sK/2) follow, and are described in ("OP flags abbreviations").
% perl -MO=Concise -e $a = $b + 42
8 leave[1 ref] vKP/REFC ->(end)
1 enter ->2
2 nextstate(main 1 -e:1) v ->3
7 sassign vKS/2 ->8
* 5 add[t1] sK/2 ->6
- ex-rv2sv sK/1 ->4
3 gvsv(*b) s ->4
4 const(IV 42) s ->5
- ex-rv2sv sKRM*/1 ->7
6 gvsv(*a) s ->7
The default rendering is top-down, so theyre not in execution order. This form reflects the way the stack is used to parse and evaluate expressions; the add operates on the two terms below it in the tree.
Nullops appear as ex-opname, where opname is an op that has been optimized away by perl. Theyre displayed with a sequence-number of -, because they are not executed (they dont appear in previous example), theyre printed here because they reflect the parse.
The arrow points to the sequence number of the next op; theyre not displayed in -exec mode, for obvious reasons.
Note that because this rendering was done on a non-threaded perl, the PADOPs in the previous examples are now SVOPs, and some (but not all) of the square brackets have been replaced by round ones. This is a subtle feature to provide some visual distinction between renderings on threaded and un-threaded perls.
<<lessSYNOPSIS
perl -MO=Concise[,OPTIONS] foo.pl
use B::Concise qw(set_style add_callback);
This compiler backend prints the internal OPs of a Perl programs syntax tree in one of several space-efficient text formats suitable for debugging the inner workings of perl or other compiler backends. It can print OPs in the order they appear in the OP tree, in the order they will execute, or in a text approximation to their tree structure, and the format of the information displayed is customizable. Its function is similar to that of perls -Dx debugging flag or the B::Terse module, but it is more sophisticated and flexible.
EXAMPLE
Heres an example of 2 outputs (aka renderings), using the -exec and -basic (i.e. default) formatting conventions on the same code snippet.
% perl -MO=Concise,-exec -e $a = $b + 42
1 enter
2 nextstate(main 1 -e:1) v
3 gvsv[*b] s
4 const[IV 42] s
* 5 add[t3] sK/2
6 gvsv[*a] s
7 sassign vKS/2
8 leave[1 ref] vKP/REFC
Each line corresponds to an opcode. The opcode marked with * is used in a few examples below.
The 1st column is the ops sequence number, starting at 1, and is displayed in base 36 by default. This rendering is in -exec (i.e. execution) order.
The symbol between angle brackets indicates the ops type, for example; < 2 > is a BINOP, < @ > a LISTOP, and < # > is a PADOP, which is used in threaded perls. (see "OP class abbreviations").
The opname, as in add[t1], which may be followed by op-specific information in parentheses or brackets (ex [t1]).
The op-flags (ex sK/2) follow, and are described in ("OP flags abbreviations").
% perl -MO=Concise -e $a = $b + 42
8 leave[1 ref] vKP/REFC ->(end)
1 enter ->2
2 nextstate(main 1 -e:1) v ->3
7 sassign vKS/2 ->8
* 5 add[t1] sK/2 ->6
- ex-rv2sv sK/1 ->4
3 gvsv(*b) s ->4
4 const(IV 42) s ->5
- ex-rv2sv sKRM*/1 ->7
6 gvsv(*a) s ->7
The default rendering is top-down, so theyre not in execution order. This form reflects the way the stack is used to parse and evaluate expressions; the add operates on the two terms below it in the tree.
Nullops appear as ex-opname, where opname is an op that has been optimized away by perl. Theyre displayed with a sequence-number of -, because they are not executed (they dont appear in previous example), theyre printed here because they reflect the parse.
The arrow points to the sequence number of the next op; theyre not displayed in -exec mode, for obvious reasons.
Note that because this rendering was done on a non-threaded perl, the PADOPs in the previous examples are now SVOPs, and some (but not all) of the square brackets have been replaced by round ones. This is a subtle feature to provide some visual distinction between renderings on threaded and un-threaded perls.
Download (12.2MB)
Added: 2007-06-25 License: Perl Artistic License Price:
851 downloads
B::OptreeShortestPath 0.02
B::OptreeShortestPath adds the methods ->shortest_path( $op ) and ->all_paths() to all B::OP objects in an optree. more>>
B::OptreeShortestPath is a Perl module that adds the methods ->shortest_path( $op ) and ->all_paths() to all B::OP objects in an optree.
SYNOPSIS
use B qw( main_root main_start );
use B::OptreeShortestPath;
for ( main_start()->shortest_path( main_root() ) ) {
print "$_n";
}
METHODS
$op->shortest_path( $other_op )
Returns a list of the shortest paths from $op to $other_op. Each path is a string approximating a bunch of chained method calls.
"->next->sibling->next",
"->sibling->sibling->next"
$op->all_paths()
Returns a list of paths from this node to all other nodes.
<<lessSYNOPSIS
use B qw( main_root main_start );
use B::OptreeShortestPath;
for ( main_start()->shortest_path( main_root() ) ) {
print "$_n";
}
METHODS
$op->shortest_path( $other_op )
Returns a list of the shortest paths from $op to $other_op. Each path is a string approximating a bunch of chained method calls.
"->next->sibling->next",
"->sibling->sibling->next"
$op->all_paths()
Returns a list of paths from this node to all other nodes.
Download (0.004MB)
Added: 2007-06-25 License: Perl Artistic License Price:
851 downloads
IO::InSitu 0.0.2
IO::InSitu is a Perl module to avoid clobbering files opened for both input and output. more>>
IO::InSitu is a Perl module to avoid clobbering files opened for both input and output.
SYNOPSIS
use IO::InSitu;
my ($in, $out) = open_rw($infile_name, $outfile_name);
for my $line () {
$line =~ s/foo/bar/g;
print {$out} $line;
}
When users want to do in-situ processing on a file, they often specify it as both the input and output file:
> myapp -i sample_data -o sample_data -op=normalize
But, if the -i and -o flags are processed independently, the program will usually open the file for input, open it again for output (at which point the file will be truncated to zero length), and then attempt to read in the first line of the now-empty file:
# Open both filehandles...
use Fatal qw( open );
open my $src, , $destination_file;
# Read, process, and output data, line-by-line...
while (my $line = < $src >) {
print {$dest} transform($line);
}
Not only does this not perform the requested transformation on the file, it also destroys the original data. Fortunately, this problem is extremely easy to avoid: just make sure that you unlink the output file before you open it:
# Open both filehandles...
use Fatal qw( open );
open my $src, , $destination_file;
# Read, process, and output data, line-by-line...
while (my $line = ) {
print {$dest} transform($line);
}
If the input and output files are different, unlinking the output file merely removes a file that was about to be rewritten anyway. Then the second open simply recreates the output file, ready for writing.
If the two filenames actually refer to a single in-situ file, unlinking the output filename removes that filename from its directory, but doesnt remove the file itself from the filesystem. The file is already open through the filehandle in $input, so the filesystem will preserve the unlinked file until that input filehandle is closed. The second open then creates a new version of the in-situ file, ready for writing.
The only limitation of this technique is that it changes the inode of any in-situ file . That can be a problem if the file has any hard-linked aliases, or if other applications are identifying the file by its inode number. If either of those situations is possible, you can preserve the in-situ files inode by using the open_rw() subroutine that is exported from this module:
# Open both filehandles...
use IO::InSitu;
my ($src, $dest) = open_rw($source_file, $destination_file);
# Read, process, and output data, line-by-line...
while (my $line = ) {
print {$dest} transform($line);
}
<<lessSYNOPSIS
use IO::InSitu;
my ($in, $out) = open_rw($infile_name, $outfile_name);
for my $line () {
$line =~ s/foo/bar/g;
print {$out} $line;
}
When users want to do in-situ processing on a file, they often specify it as both the input and output file:
> myapp -i sample_data -o sample_data -op=normalize
But, if the -i and -o flags are processed independently, the program will usually open the file for input, open it again for output (at which point the file will be truncated to zero length), and then attempt to read in the first line of the now-empty file:
# Open both filehandles...
use Fatal qw( open );
open my $src, , $destination_file;
# Read, process, and output data, line-by-line...
while (my $line = < $src >) {
print {$dest} transform($line);
}
Not only does this not perform the requested transformation on the file, it also destroys the original data. Fortunately, this problem is extremely easy to avoid: just make sure that you unlink the output file before you open it:
# Open both filehandles...
use Fatal qw( open );
open my $src, , $destination_file;
# Read, process, and output data, line-by-line...
while (my $line = ) {
print {$dest} transform($line);
}
If the input and output files are different, unlinking the output file merely removes a file that was about to be rewritten anyway. Then the second open simply recreates the output file, ready for writing.
If the two filenames actually refer to a single in-situ file, unlinking the output filename removes that filename from its directory, but doesnt remove the file itself from the filesystem. The file is already open through the filehandle in $input, so the filesystem will preserve the unlinked file until that input filehandle is closed. The second open then creates a new version of the in-situ file, ready for writing.
The only limitation of this technique is that it changes the inode of any in-situ file . That can be a problem if the file has any hard-linked aliases, or if other applications are identifying the file by its inode number. If either of those situations is possible, you can preserve the in-situ files inode by using the open_rw() subroutine that is exported from this module:
# Open both filehandles...
use IO::InSitu;
my ($src, $dest) = open_rw($source_file, $destination_file);
# Read, process, and output data, line-by-line...
while (my $line = ) {
print {$dest} transform($line);
}
Download (0.006MB)
Added: 2007-01-16 License: Perl Artistic License Price:
1011 downloads
OpenThought 0.71
OpenThought is a Web Application Environment which doesnt require page reloads. more>>
OpenThought is a Web Application Environment which doesnt require page reloads.
SYNOPSIS
use OpenThought();
my $o = OpenThought->new( $OP );
my $field_data;
$field_data->{myTextBox} = "Text Box Data";
$field_data->{myCheckbox} = "true";
$field_data->{myRadioBtn} = "RadioBtnValue";
$field_data->{mySelectList} = [
[ "text1", "value1" ],
[ "text2", "value2" ],
[ "text3", "value3" ],
];
my $html_data;
$html_data->{id_tagname} = "New HTML Code";
print $o->serialize({
fields => $field_data,
html => $html_data,
focus => "myTextBox",
javascript => $javascript_code
});
OpenThought is a powerful and flexible web application environment. OpenThought applications are different from other web applications in that all communication between the browser and the server is performed in the background. This gives a browser the ability to receive data from the server without ever reloading the currently loaded document. Data received can be displayed automatically on the existing page, can access JavaScript functions and variables, and can load new pages. Additionally, OpenThought completely manages all of your session data for you. These features give the look and feel of a full-blown application instead of just an ordinary Web page.
OpenThought is extended with OpenPlugin, also described briefly in this documentation.
OpenThought works by communicating with the server through the use of a hidden frame. Now some may say "Frames? Youre using frames??" No need to fret though, the frame is completely hidden. There is no visible way for your users to tell that they are using an application which makes use of frames.
This hidden frame performs all communication with the server for you, and allows your browser to talk to the server without reloading the content currently visible in your web browser. This is how OpenThought can update portions of the screen, and how the server can run JavaScript code in the browser, all without reloading the page.
Any time an OpenThought application is loaded, a unique session id is generated for that user. Each time communication takes place between the browser and server, OpenThought is careful to make sure that this session id is sent along with the request. There is nothing you need to do to make this work, it is done for you. When youre programming your application, you can always expect a session id to be sent to the server, and you can easily retrieve it along with the rest of the data sent by the browser.
In addition to being able to update portions of a screen, you can also load new pages within the content frame. If you choose to load new pages, your session continues to be maintained.
OpenThought gives you an easy way of tieing together multiple web pages, and allows you to build web applications which act like "real" applications. When an application is required, some people would decide to build it in Tk, Visual Basic, Gtk, or any number of other systems which offer a visual interface. But then, your application is either not available on the web, or you have to create a seperate web interface to interact with the backend.
Have you ever tried to create a web interface which minics the interface of a non-web based application? The web based application no longer looks or acts like your other interface, it acts like an ordinary webpage. It probably uses several screens to get the same amount of content that your application offered in one.
By not ever needing to reload the page, OpenThought offers this application look and feel thats been missing from the web. This allows you to create just one interface, for both LAN and web use.
<<lessSYNOPSIS
use OpenThought();
my $o = OpenThought->new( $OP );
my $field_data;
$field_data->{myTextBox} = "Text Box Data";
$field_data->{myCheckbox} = "true";
$field_data->{myRadioBtn} = "RadioBtnValue";
$field_data->{mySelectList} = [
[ "text1", "value1" ],
[ "text2", "value2" ],
[ "text3", "value3" ],
];
my $html_data;
$html_data->{id_tagname} = "New HTML Code";
print $o->serialize({
fields => $field_data,
html => $html_data,
focus => "myTextBox",
javascript => $javascript_code
});
OpenThought is a powerful and flexible web application environment. OpenThought applications are different from other web applications in that all communication between the browser and the server is performed in the background. This gives a browser the ability to receive data from the server without ever reloading the currently loaded document. Data received can be displayed automatically on the existing page, can access JavaScript functions and variables, and can load new pages. Additionally, OpenThought completely manages all of your session data for you. These features give the look and feel of a full-blown application instead of just an ordinary Web page.
OpenThought is extended with OpenPlugin, also described briefly in this documentation.
OpenThought works by communicating with the server through the use of a hidden frame. Now some may say "Frames? Youre using frames??" No need to fret though, the frame is completely hidden. There is no visible way for your users to tell that they are using an application which makes use of frames.
This hidden frame performs all communication with the server for you, and allows your browser to talk to the server without reloading the content currently visible in your web browser. This is how OpenThought can update portions of the screen, and how the server can run JavaScript code in the browser, all without reloading the page.
Any time an OpenThought application is loaded, a unique session id is generated for that user. Each time communication takes place between the browser and server, OpenThought is careful to make sure that this session id is sent along with the request. There is nothing you need to do to make this work, it is done for you. When youre programming your application, you can always expect a session id to be sent to the server, and you can easily retrieve it along with the rest of the data sent by the browser.
In addition to being able to update portions of a screen, you can also load new pages within the content frame. If you choose to load new pages, your session continues to be maintained.
OpenThought gives you an easy way of tieing together multiple web pages, and allows you to build web applications which act like "real" applications. When an application is required, some people would decide to build it in Tk, Visual Basic, Gtk, or any number of other systems which offer a visual interface. But then, your application is either not available on the web, or you have to create a seperate web interface to interact with the backend.
Have you ever tried to create a web interface which minics the interface of a non-web based application? The web based application no longer looks or acts like your other interface, it acts like an ordinary webpage. It probably uses several screens to get the same amount of content that your application offered in one.
By not ever needing to reload the page, OpenThought offers this application look and feel thats been missing from the web. This allows you to create just one interface, for both LAN and web use.
Download (0.076MB)
Added: 2006-07-18 License: Perl Artistic License Price:
1195 downloads
Code::Splice 0.01
Code::Splice injects the contents of one subroutine at a specified point elsewhere. more>>
Code::Splice injects the contents of one subroutine at a specified point elsewhere.
SYNOPSIS
use Code::Splice;
Code::Splice::inject(
code => sub { print "fredn"; },
package => main,
method => foo,
precondition => sub {
my $op = shift;
my $line = shift;
$line =~ m/print/ and $line =~ m/four/;
},
postcondition => sub {
my $op = shift;
my $line = shift;
$line =~ m/print/ and $line =~ m/five/;
},
);
sub foo {
print "onen";
print "twon";
print "threen";
print "fourn";
print "fiven";
}
This module removes the contents of a subroutine (usually an anonymous subroutine created just for the purpose) and splices in into the program elsewhere.
Why, you ask?
Write stronger unit tests than the granularity of the API would otherwise allow
Write unit tests for nasty, interdependant speghetti code (my motivation -- hey, you gotta have tests before you can start refactoring, and if you cant write tests for the code, youre screwed)
Fix stupid bugs and remove stupid restrictions in other peoples code in a way thats more resiliant across upgrades than editing files you dont own
Be what "aspects" should be
Screw with your cow-orkers by introducing monster heisenbugs
Play with self-modifying code
Write self-replicating code (but be nice, were all friends here, right?)
The specifics:
The body of the code { } block are extracted from the subroutine and inserted in a place in the code specified by the call to the splice() function. Where the new code is spliced in, the old code is spliced out. The package and method arguments are required and tell the thing how to find the code to be modified. The code argument is required as it specifies the code to be spliced in. That same code block should not be used for anything else under penalty of coredump.
The rest of the argumets specify where the code is to be inserted. Any number of precondition and postcondition arguments provide callbacks to help locate the exact area to splice the code in at. Before the code can e spliced in, all of the precondition blocks must have returned true, and none of the postcondition blocks may have yet returned true. If a postcondition returns true before all of the precondition blocks have, an error is raised. Both blocks get called numerous times per line and get passed a reference to the B OP object currently under consideration and the text of the current line:
precondition => sub {
my $op = shift;
my $line = shift;
$line =~ m/print/ and $line =~ m/four/;
},
... or...
precondition => sub { my $op = shift; $op->name eq padsv and $op->sv->sv =~ m/fred/; },
Its possible to insert code in the middle of an expression when testing ops, but when testing the text of the line of code, the spliced in code will always replace the whole line.
Ill probably drop sending in the opcode in a future version, at least for the precondition/postcondition blocks, or maybe Ill swap them to the 2nd arg so theyre more optional.
Do not attempt to match text in comments as it wont be there. The code in $line is re-generated from the bytecode using B::Deparse and will vary from the original source code in a few ways, including changes to formatting, changes to some idioms and details of the expressions, and formatting of the code with regards to whitespace.
The splicing code will die if it fails for any reason. This will likely change in possible future versions.
There are also label and line arguments that create preconditions for you, for simple cases. Of course, you shouldnt use line for anything other than simple experimentation.
References to lexical variables in the code to be injected are replaced with references to the lexical variables of the same name in the location the code is inserted into. If a variable of the same name doesnt exist there, its an error. ... but it probably shouldnt be an error, at least in the cases where the code being spliced in declares that lexical with my, or when the variable was initiailized entirely outside of the sub block being spliced in and was merely closed over by it.
See the comments in the source code (at the top, in a nice block) for my todo/desired features. Let me know if there are any features in there or yet unsuggested that you want. I wont promise them, but I would like to hear about them.
<<lessSYNOPSIS
use Code::Splice;
Code::Splice::inject(
code => sub { print "fredn"; },
package => main,
method => foo,
precondition => sub {
my $op = shift;
my $line = shift;
$line =~ m/print/ and $line =~ m/four/;
},
postcondition => sub {
my $op = shift;
my $line = shift;
$line =~ m/print/ and $line =~ m/five/;
},
);
sub foo {
print "onen";
print "twon";
print "threen";
print "fourn";
print "fiven";
}
This module removes the contents of a subroutine (usually an anonymous subroutine created just for the purpose) and splices in into the program elsewhere.
Why, you ask?
Write stronger unit tests than the granularity of the API would otherwise allow
Write unit tests for nasty, interdependant speghetti code (my motivation -- hey, you gotta have tests before you can start refactoring, and if you cant write tests for the code, youre screwed)
Fix stupid bugs and remove stupid restrictions in other peoples code in a way thats more resiliant across upgrades than editing files you dont own
Be what "aspects" should be
Screw with your cow-orkers by introducing monster heisenbugs
Play with self-modifying code
Write self-replicating code (but be nice, were all friends here, right?)
The specifics:
The body of the code { } block are extracted from the subroutine and inserted in a place in the code specified by the call to the splice() function. Where the new code is spliced in, the old code is spliced out. The package and method arguments are required and tell the thing how to find the code to be modified. The code argument is required as it specifies the code to be spliced in. That same code block should not be used for anything else under penalty of coredump.
The rest of the argumets specify where the code is to be inserted. Any number of precondition and postcondition arguments provide callbacks to help locate the exact area to splice the code in at. Before the code can e spliced in, all of the precondition blocks must have returned true, and none of the postcondition blocks may have yet returned true. If a postcondition returns true before all of the precondition blocks have, an error is raised. Both blocks get called numerous times per line and get passed a reference to the B OP object currently under consideration and the text of the current line:
precondition => sub {
my $op = shift;
my $line = shift;
$line =~ m/print/ and $line =~ m/four/;
},
... or...
precondition => sub { my $op = shift; $op->name eq padsv and $op->sv->sv =~ m/fred/; },
Its possible to insert code in the middle of an expression when testing ops, but when testing the text of the line of code, the spliced in code will always replace the whole line.
Ill probably drop sending in the opcode in a future version, at least for the precondition/postcondition blocks, or maybe Ill swap them to the 2nd arg so theyre more optional.
Do not attempt to match text in comments as it wont be there. The code in $line is re-generated from the bytecode using B::Deparse and will vary from the original source code in a few ways, including changes to formatting, changes to some idioms and details of the expressions, and formatting of the code with regards to whitespace.
The splicing code will die if it fails for any reason. This will likely change in possible future versions.
There are also label and line arguments that create preconditions for you, for simple cases. Of course, you shouldnt use line for anything other than simple experimentation.
References to lexical variables in the code to be injected are replaced with references to the lexical variables of the same name in the location the code is inserted into. If a variable of the same name doesnt exist there, its an error. ... but it probably shouldnt be an error, at least in the cases where the code being spliced in declares that lexical with my, or when the variable was initiailized entirely outside of the sub block being spliced in and was merely closed over by it.
See the comments in the source code (at the top, in a nice block) for my todo/desired features. Let me know if there are any features in there or yet unsuggested that you want. I wont promise them, but I would like to hear about them.
Download (0.010MB)
Added: 2007-08-14 License: Perl Artistic License Price:
806 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 ops 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