Main > Free Download Search >

Free division software for linux

division

Sponsored Links
Sponsored Links
Secleted [ 0 ] software to compare
Results 1 - 15 of about 59
Seismic Unix 4.0

Seismic Unix 4.0


Seismic Unix package is a software environment for seismic processing and seismic and wave-propagation related research. more>>
The CWP/SU Seixmic Un*x (SU) package is a software environment for seismic processing and seismic and wave-propagation related research.
Seismic Unix project is used not only in seismology but in other areas involving time-dependent data, such as Ground Penetrating RADAR.
Installation:
1) read the READMEs before unbundling cwp.su.all.xx.tar.Z
2) dont install as root (the superuser) (It is possible to damage a systems file structure if the install is not done properly.)
3) begin with the compressed tarfile cwp.su.all.xx.tar.Z in /your/root/path
4) set the CWPROOT environment variable to CWPROOT=/your/root/path
5) put /your/root/path/bin on your working shell path
6) uncompress and untar the compressed tarfile via:
zcat cwp.su.all.xx.tar.Z | tar -xvf -
The code will appear as the single directory /your/root/path/src
7) compile codes via:
cd /your/root/path/src
1) edit the file /your/root/path/src/Makefile.config to agree with the needs of your system.
2) type:
make install (to install the basic set of codes)
make xtinstall (to install the X-toolkit applications)
make finstall (to install the Fortran codes)
make mglinstall (to install the Mesa/ Open GL items) (experimental)
make utils (to install libcwputils) (nonessential)
make xminstall (to install the Motif application)(nonessential)
make sfinstall (to install an improved version of SEGDREAD)
or if remaking:
type: make remake (to remake the basic set of codes)
make xtremake (to remake the X-toolkit applications)
make finstall (to install the Fortran codes)
make mglremake (to install the Mesa/ Open GL items)(experimental)
make uremake (to remake libcwputils.a)(nonessential)(nonessential)
make xmremake (to remake the Motif-based applications)(nonessential)
make sfremake (to remake the improved version of SEGDREAD)
You may have to do some hacking along the way, if the codes fail to compile the first time through. In this event, you may simply type "make" in the directory where you were modifying code. If code appears to have been missed, you may need to
use the "remaking" options.
A screen dump of a successfull install of the current version of the codes on a RedHat Linux based PC is located in the file: "install.successfull"
Enhancements:
- This version added functions for converting stiffnesses to velocities, replacing lobes on seismic data with a spike of height scaled by the area of the lobe, and carrying out deconvolution by complex division in the frequency domain.
- There were also many code speedups, cleanups, and bugfixes.
<<less
Download (10.7MB)
Added: 2007-05-12 License: Free To Use But Restricted Price:
579 downloads
Open Administration for Schools 2.40

Open Administration for Schools 2.40


Open Administration for Schools is a Web-based school administration package. more>>
Open Admin for Schools is a School Administration Program. It is a freely available, open source software package and is licensed under the GNU General Public License.
Open Administration for Schools project is entirely web based and can run from a centrally located division wide server or a single computer in a school. It is designed to support an entire division on one or more central computers but can also work just fine for a single school.
Currently several school divisions use this approach and have 15+ schools on a single central server. This is because it is designed to be lightweight both in server resource requirements and in communication bandwidth.
It is secure. Each school has two or more virtual websites and each is protected with password(s). One site, the admin site, is used by the school office and another, the teacher site, is used by teachers in the classroom.
The teacher site also has password access for entering attendance by teachers and also uses cookies that expire in a short period, further limiting access. Another site, a parent/student site, is controlled by parent/student userids and passwords. A fourth virtual site may be used by school liason officers from outside agencies to give them a slightly different access to school information. (Community Schools)
Main features:
- Demographics - It stores student and family information that can be viewed and printed in a variety of ways.
- Attendance - Attendance can be entered either by secretaries in the school office or by teachers in the classroom. It features the ability to do different numbers of periods per day for elementary grades vs high school and middle years. This will allow elementary classes to have 2 classes per day (AM/PM) with a homeroom teacher while higher grades can have attendance done on a per subject period basis (and be subject based). Attendance reports are integrated with report cards/progress reports. A variety of attendance reports are available. A variety of attendance entry methods are available for use by teachers and/or secretaries to allow it to integrate with normal school practice.
- Discipline - A simple discipline module to track student discipline events and track outcomes, etc. Behaviours may be categorized and statistical reports may be printed. Enrollment changes are also posted into this system.
- Report Card System - a flexible reporting system with per subject objectives (up to 20), integrated attendance reporting, etc. All report cards are printed as PDF reports and may include a school logo. All subjects may have unlimited length text comments, and can have any desired ordering. Attendance reporting will now do days open, days enrolled, days absent, and times late as standard.
- IEP (Special Needs) Site that is integrated at the division level that allows special needs teachers to tailor individual student programs that can be viewed from each schools teacher site. This includes the ability to add student medical history, testing done, student teams (and responsibilities), and objectives chosen from lists of thousands, categorized in a variety of ways. There can be up to 32 objectives per subject and each subject is specific to that particular child. His/her program would consist of a variety of subjects in areas such as fine motor control, etc.
- This system can generate progress reports (for use with the report card system) as well as a comprehensive IEP report containing the yearly plan for the child. This IEP can also viewed from the teacher site, to ensure compliance throughout the year.
- Export/Import Modules - to allow students to easily transfer schools within divisions without re-entry of demographic information. Export of data to other programs. Export of data to Provincial authorities via an automated XML based transfer mechanism.
- Saskatchewan SDS support for direct XML transfers of student demographic, subject and enrollment marks to provincial authorities.
- Online Gradebook to allow teachers to enter marks and assessments onine from school or home. It can group and weight assessment items and post directly into the report card system.
- Parent Viewing scripts to allow parents to view attendance, gradebook(where allowed), and report card marks. This is easily integrated into existing school sites.
- Upcoming: Family functions, Parent-Teacher Interview Scheduling, Wherever schools want to go...
- Further out... Multi-language support (demand for a Spanish version exists currently), Student timetabling.
Enhancements:
- A new Fees System to allow fee charging (predefined or new, with various groups), invoice printing, payments and receipts, and the ability to export summary journal transactions to an external accounting program.
- A new teacher logout to remove session data has been added.
- There is a new 70 page User Documentation PDF and a 40 page Administration Documentation PDF (also available in HTML versions).
<<less
Download (MB)
Added: 2007-07-19 License: GPL (GNU General Public License) Price:
844 downloads
Podius 5.1.0

Podius 5.1.0


Podius is a content management and web publishing system. more>>
Podius is a content management and web publishing system.
Main features:
- o dependencies (download and run anywhere with perl installed)
- intuitive component model with rich configurable properties
- file-based or rdbms-based persistence and high level transactions
- support for concurrency and auto-merged changes (optimistic locking)
- nice and powerful template syntax, easily extensible
- support for multilingual content, synchronized between languages
- support for inheritable and reusable projects
- clean storage-data division (no sql in perl code is needed)
- clean data-presentation division (no perl code in html is needed)
- management scripts, allowing full control from command line
- web-based interface for non-technical editors
<<less
Download (0.30MB)
Added: 2006-02-21 License: GPL (GNU General Public License) Price:
1340 downloads
Test::Exception 0.25

Test::Exception 0.25


Test::Exception is a Perl module to test exception based code. more>>
Test::Exception is a Perl module to test exception based code.

SYNOPSIS

use Test::More tests => 5;
use Test::Exception;

# or if you dont need Test::More

use Test::Exception tests => 5;

# then...

# Check that something died
dies_ok { $foo->method1 } expecting to die;

# Check that something did not die
lives_ok { $foo->method2 } expecting to live;

# Check that the stringified exception matches given regex
throws_ok { $foo->method3 } qr/division by zero/, zero caught okay;

# Check an exception of the given class (or subclass) is thrown
throws_ok { $foo->method4 } Error::Simple, simple error thrown;

# all Test::Exceptions subroutines are guaranteed to preserve the state
# of $@ so you can do things like this after throws_ok and dies_ok
like $@, what the stringified exception should look like;

# Check that a test runs without an exception
lives_and { is $foo->method, 42 } method is 42;

# or if you dont like prototyped functions

dies_ok( sub { $foo->method1 }, expecting to die );
lives_ok( sub { $foo->method2 }, expecting to live );
throws_ok( sub { $foo->method3 }, qr/division by zero/,
zero caught okay );
throws_ok( sub { $foo->method4 }, Error::Simple,
simple error thrown );
lives_and( sub { is $foo->method, 42 }, method is 42 );

<<less
Download (0.011MB)
Added: 2007-05-03 License: Perl Artistic License Price:
904 downloads
BigInteger 1.0

BigInteger 1.0


BigInteger is an arbitrary length integer extension module for Perl. more>>
BigInteger is an arbitrary length integer extension module for Perl.

SYNOPSIS

use Math::BigInteger;

The BigInteger extension module gives access to Eric Youngs bignum library. This provides a faster alternative to the Math::BigInt library.
The basic object in this library is a BigInteger. It is used to hold a single large integer.

It is not intended that this package be used directly, but instead be used by a wrapper package, such as the Math::BigInteger class.

FUNCTIONS

Many of the following functions can be used in two styles, by calling the function on an object, or by calling the function explicitly; for example, here are two ways of assigning to $a the sum of $b and $c:

$a->add($b, $c);
or

BigInteger::add($a, $b, $c);

Creation/Destruction routines.

new
my $bi = new BigInteger; # Create a new BigInteger object.
clone
my $b = $a->clone();

Create a new BigInteger object from another BigInteger object.

copy
copy($a, $b);

Copy one BigInteger object to another.

save
my $data = $bi->save();

Save a BigInteger object as a MSB-first string.

restore
my $bi = restore BigInteger $data;

Create a new BigInteger object from a MSB-first string.

Comparison functions

ucmp
ucmp($a, $b);

Return -1 if $a is less than $b, 0 if $a and $b are the same and 1 is $a is greater than $b. This is an unsigned comparison.

cmp
cmp($a, $b);

Return -1 if $a is less than $b, 0 if $a and $b are the same and 1 is $a is greater than $b. This is a signed comparison.

Arithmetic Functions

inc $bi->inc();

Increment $bi by one:

dec $bi->dec();

Decrement $bi by one:

add
$r->add($a, $b);

Add $a and $b and return the result in $r.

mul
$r->mul($a, $b);

Multiply $a by $b and return the result in $r. Note that $r must not be the same object as $a or $b.

div
div($dv, $rem, $m, $d);

Divide $m by $d and return the result in $dv and the remainder in $rem. Either of $dv or $rem can be undef, in which case that value is not returned.

mod
$rem->mod($m, $d);

Find the remainder of $m divided by $d and return it in $rem. This function is more efficient than div.

lshift
$r->lshift($a, $n);

Shift $a left by $n bits.

lshift1
$r->lshift1($a);

Shift $a left by 1 bit. This form is more efficient than lshift($r, $a, 1).

rshift
$r->rshift($a, $n);

Shift $a right by $n bits.

rshift1
$r->rshift1($a);

Shift $a right by 1 bit. This form is more efficient than rshift($r, $a, 1).

mod_exp
$r->mod_exp($a, $p, $mod);

Raise $a to the $p power and return the remainder into $r when divided by $m.

modmul_recip
modmul_recip($r, $x, $y, $m, $i, $nb);

This function is used to perform an efficient mod_mul operation. If one is going to repeatedly perform mod_mul with the same modulus is worth calculating the reciprocal of the modulus and then using this function. This operation uses the fact that a/b == a*r where r is the reciprocal of b. On modern computers multiplication is very fast and big number division is very slow. $x is multiplied by $y and then divided by $m and the remainder is returned in $r. $i is the reciprocal of $m and $nb is the number of bits as returned from reciprocal. This function is used in mod_exp.

mul_mod
$r->mul_mod($a, $b, $m);

Multiply $a by $b and return the remainder into $r when divided by $m.
reciprical
$r->reciprical($m);

Return the reciprocal of $m into $r.

Miscellaneous Routines

num_bits
my $size = $bi->numbits();

Return the size (in bits) of the BigInteger.

gcd
$r->gcd($a, $b);

$r has the greatest common divisor of $a and $b.

inverse_modn
$r->inverse_modn($a, $n);

This function creates a new BigInteger and returns it in $r. This number is the inverse mod $n of $a. By this it is meant that the returned value $r satisfies (a*r)%n == 1. This function is used in the generation of RSA keys.

<<less
Download (0.020MB)
Added: 2007-07-02 License: Perl Artistic License Price:
846 downloads
MIDI::Opus 0.81

MIDI::Opus 0.81


MIDI::Opus are functions and methods for MIDI opuses. more>>
MIDI::Opus are functions and methods for MIDI opuses.

SYNOPSIS

use MIDI; # uses MIDI::Opus et al
foreach $one (@ARGV) {
my $opus = MIDI::Opus->new({ from_file => $one, no_parse => 1 });
print "$one has ", scalar( $opus->tracks ) " tracksn";
}
exit;

MIDI::Opus provides a constructor and methods for objects representing a MIDI opus (AKA "song"). It is part of the MIDI suite.

An opus object has three attributes: a format (0 for MIDI Format 0), a tick parameter (parameter "division" in MIDI::Filespec), and a list of tracks objects that are the real content of that opus.

Be aware that options specified for the encoding or decoding of an opus may not be documented in this modules documentation, as they may be (and, in fact, generally are) options just passed down to the decoder/encoder in MIDI::Event -- so see MIDI::Event for an explanation of most of them, actually.

<<less
Download (0.061MB)
Added: 2006-08-30 License: Perl Artistic License Price:
1151 downloads
XView4Struts 1.4.1

XView4Struts 1.4.1


XView4Struts provides a Struts framework extension that replaces JSP pages with pure HTML. more>>
XView4Struts provides a Struts framework extension that replaces JSP pages with pure HTML.
The XView4Struts project is an extension to the Jakarta Struts Framework. Its main purpose is to eliminate the need to use tag libraries and JSP pages. The view is pure HTML, and interaction between the view and the model is transparent to the developer.
This approach offers faster development, better division of work, a more pure MVC design pattern, reusable view components, and easier maintenance.
With XView4Struts the view layer is pure HTML. This has several implications. You dont need a java developer to write HTML. Many organizations have graphics experts that are more suited for that job. Many organizations prefer to create HTML mock-ups of an application to solicit client approval before they start working on the underlying logic that makes it work. Using this scenerio with the standard Struts view layer, the developer then has to spend many hours implementing jsp tags to make it work with the underlying logic. With XView4Struts the developer only needs to apply id attributes to the standard HTML tags and the framework takes care of the rest.
XView4Struts extends the Struts requestProcessor and intercepts all forwarding actions to HTML pages. The processor parses the HTML page and if it can it will process any tags implementing an id attribute. If there is no match between the id attribute and a form bean property or an error occurs, the parser simply returns control back to the processor. Since only HTML pages are parsed, XView4Struts may exist in an application that implements the standard Struts view components.
Main features:
- Faster development time. A whole layer of programming has been removed since there are no JSPs to write. No tag libraries to learn and implement.
- Easier maintenance. There is no logic in the view layer to troubleshoot and maintain.
- A truer MVC design pattern since all logic in the view layer has been removed.
- The developer has an option to use xslt to produce dynamic content. Reusable view components are easy to build using this option. XView4Struts does not use xslt to produce the entire view layer as other implementations of this type do. It is only implemented to dynamically insert content pieces into the HTML document.
- Application templates are extremely easy to implement.
- The parsing functionality is dynamic enough that the developer often has more than one option or technology to choose from to achieve the same result. They simply use what they understand best.
Enhancements:
- Enhancement - Upgraded
handler to accept id value as a context relative path to an html page.
<<less
Download (0.22MB)
Added: 2007-04-04 License: The Apache License Price:
935 downloads
slang 1.4.9

slang 1.4.9


slang is a powerful interpreted language. more>>
S-Lang is a multi-platform programmers library designed to allow a developer to create robust multi-platform software.
It provides facilities required by interactive applications such as display/screen management, keyboard input, keymaps, and so on. The most exciting feature of the library is the slang interpreter that may be easily embedded into a program to make it extensible.
The language features both global and local variables, branching and looping constructs, user-defined functions, structures, datatypes, and arrays. In addition, there is limited support for pointer types. The concise array syntax rivals that of commercial array-based numerical computing environments.
The language provides built-in support for string, integer (signed and unsigned long and short), double precision floating point, and double precision complex numbers. In addition, it supports user defined structure types, multi-dimensional array types, and associative arrays.
To facilitate the construction of sophisticated data structures such as linked lists and trees, a `reference type was added to the language. The reference type provides much of the same flexibility as pointers in other languages. Finally, applications embedding the interpreter may also provide special application specific types, such as the Mark_Type that the jed editor provides.
The language provides standard arithmetic operations such as addition, subtraction, multiplication, and division. It also provides support for modulo arithmetic as well as operations at the bit level, e.g., exclusive-or. Any binary or unary operator may be extended to work with any data type. For example, the addition operator (+) has been extended to work between string types to permit string concatenation.
The binary and unary operators work transparently with array types. For example, if a and b are arrays, then a + b produces an array whose elements are the result of element by element addition of a and b. This permits one to do vector operations without explicitly looping over the array indices.
Enhancements:
- src/slarray.c: superfluous call to SLclass_add_math_op removed (Michael Noble)
- src/slang.c: foreach (NULL) using("next"){} foo (); caused _NARGS=1 in foo.
- src/slarrfunc.c: Fix to prevent sum(NULL) from causing a core-dump.
- src/slimport.c: import (module, "") made equivalent to import(module,"Global"); This way, import(module, current_namespace()) will work when the current namespace is anonymous.
- src/slospath.c: Several users have requested that I add the ability to define a load path and use that path when loading interpreter files. To this end, several new functions were added to the API:
- char *SLpath_get_load_path (void);
- int SLpath_set_load_path (char *path);
- /* Get and Set the path to be searched for files */
- int SLpath_get_path_delimiter (void);
- SLpath_set_path_delimiter (int delimiter);
- /* Get and set the character delimiter for search paths */
- int SLang_load_file_verbose (int verbose);
- /* if non-zero, display file loading messages */
New intrinsics include:
- set_slang_load_path
- get_slang_load_path
- path_get_delimiter
- These functions, nor the intrinsics have an effect on applications that use SLang_load_file_hook or SLns_load_file_hook for loading files. The change should be transparant to applications that use the stock load file mechanism. The main difference is that if one attempts to load a file with no extension, e.g., "foo", but the file does not exist, then the interpreter will try to load the more recent of "foo.sl" and "foo.slc". See src/slsh.c for how the functions may be used.
- slsh/slsh.c: Updated to use the new search path code outlined above. Also, slsh is distributed with a collection of general purpose slang functions, including jeds provide/require functions. See slsh/README for more information.
- doc/tm/cslang.tm: Modified the section describing the implemetation of intrinsic functions in an effort to clarify the discussion.
- src/slang.c: tiny memory leak resulting from peephole optimzations added earlier found and fixed.
- src/slarrmisc.c: new intrinsic: cumsum computes the cumulative sum of an array via the new SLarray_map_array function.
- src/modules: perl compatible regular expression (pcre) module added.
<<less
Download (0.78MB)
Added: 2005-04-15 License: GPL (GNU General Public License) Price:
1673 downloads
Exceptions in C 0.1.5

Exceptions in C 0.1.5


Exceptions in C implements powerful and customizable exceptions for the C programming language. more>>
Exceptions in C implements fully-functional nested exceptions with these constructs:

try
except
on
throw

Also, it allows to define various datatypes for exception object (default is int, can be anything from char * to struct foo *).

Compiling and running

Precodey straight forward.

admp@sols:~/excc/example$ gcc exception.c -c
admp@sols:~/excc/example$ gcc exception.o example.c -o example
admp@sols:~/excc/example$ ./example
Usage: ./example A B
admp@sols:~/excc/example$ ./example 100 2
100/2=50
Program is going to end its short life.
admp@sols:~/excc/example$ ./example 100 0
Caught up division by zero (100/0).
Program is going to end its short life.

Attributions:

Felix Ogg for inspiring me to write finally, also detailed feedbacks and ideas for documentation (diagrams too!). Though I havent completed that - for almost a year now; I am not sure I ever will.
<<less
Download (0.015MB)
Added: 2006-03-16 License: GPL (GNU General Public License) Price:
1318 downloads
libDSP 5.0.2

libDSP 5.0.2


libDSP is C++ class library of common digital signal processing functions. more>>
libDSP project is C++ class library of common digital signal processing functions. There is also a wrapper for the C language.
Current (vector) functions:
- Float to integer conversion with rounding
- Addition (real, complex)
- Subtraction (real, complex)
- Multiply (real, complex)
- Division (real, complex)
- 1/x (real)
- Absolute value (real)
- Square root (real)
- Zero (real, complex)
- Set (real, complex)
- Clip (real)
- Copy (real, complex)
- Convolution (real)
- Correlation (real)
- Autocorrelation (real)
- Dot product (real)
- Min and Max (real)
- Mean (real)
- Median (real)
- Negate (real)
- Normalization (real)
- Product (real)
- Reverse
- Scale to -1..1 and 0..1 (real)
- Sort (real)
- Standard deviation (real)
- Sum (real)
- Square (real)
- Integer-Float and Float-Integer conversion: 8, 12, 16, 24, 32 bits (real)
- Cartesian-Polar and Polar-Cartesian conversion
- Cross correlation (real)
- Energy (real)
- Magnitude
- Power
- Phase
- Decimation
- Interpolation
- RMS (real)
- Variance (real)
- Peak level in dB (real)
- Window functions: Bartlett, Blackman, Blackman-Harris, Cosine tapered, Exponential, Flat-top, Generic cosine, Hamming, Hanning, Kaiser, Kaiser-Bessel, Tukey, Dolph-Chebyshev
- Mix (real)
- Spatialize (real)
- Interleave/Deinterleave (real)
- Rebuffer
- Deg-Rad and Rad-Deg conversion
- FIR filter
- IIR filter
- DFT, DCT, DST
- FFT filter
- Multirate decimation/interpolation with FFT, FIR and IIR filters
- Frequency band flipping
- Hankel
<<less
Download (0.21MB)
Added: 2006-11-08 License: GPL (GNU General Public License) Price:
1091 downloads
OpenTT 1.2.5

OpenTT 1.2.5


OpenTT is a trouble ticketing/request management engine. more>>
OpenTT is a trouble ticketing/request management engine, a simple and intuitive container for structured information in the form of question/answer or title/content (FAQ), and a sophisticated graphical reporting tool to keep the situation under control.
Main features:
Trouble Ticketing (based on OTRS)
- Opening of calls via web
- Opening of calls via email
- Opening of calls via telephone through an operator (available integration for CosmoCall and leading multimedia contact center software)
- Management of users, groups and security policies (with local database or LDAP server)
- Management of multiple request queues
- Management of priorities, alarms, ready-made replies
- Resource accounting
- Multilingual support
Frequently asked question (based on phpMyFAQ)
- Division of subjects into categories and sub-categories
- List of the most frequently read articles
- List of most recent articles
- Free text search
- Management of user feedback
Graphical reporting (based on Cewolf)
- Trend graphics
- Dashboard with real time indicators
Enhancements:
- Chart enhancements included an object filter, data download (CSV), and a reset properties button.
- The dashboard was enhanced with an object filter and configurable meter size.
- Database connection optimizations were made and bug related to chart calendars was fixed.
<<less
Download (2.4MB)
Added: 2005-09-01 License: MPL (Mozilla Public License) Price:
1515 downloads
Template::Manual::Directives 2.19

Template::Manual::Directives 2.19


Template::Manual::Directives is a Perl module that contains template directives. more>>
Template::Manual::Directives is a Perl module that contains template directives.

Accessing and Updating Template Variables

GET

The GET directive retrieves and outputs the value of the named variable.

[% GET foo %]

The GET keyword is optional. A variable can be specified in a directive tag by itself.

[% foo %]

The variable can have an unlimited number of elements, each separated by a dot .. Each element can have arguments specified within parentheses.

[% foo %]
[% bar.baz %]
[% biz.baz(10) %]
...etc...

See Template::Manual::Variables for a full discussion on template variables.
You can also specify expressions using the logical (and, or, not, ?:) and mathematic operators (+ - * / % mod div).

[% template.title or default.title %]

[% score * 100 %]

[% order.nitems ? checkout(order.total) : no items %]

The div operator returns the integer result of division. Both % and mod return the modulus (i.e. remainder) of division. mod is provided as an alias for % for backwards compatibility with version 1.

[% 15 / 6 %] # 2.5
[% 15 div 6 %] # 2
[% 15 mod 6 %] # 3

CALL

The CALL directive is similar to GET in evaluating the variable named, but doesnt print the result returned. This can be useful when a variable is bound to a sub-routine or object method which you want to call but arent interested in the value returned.

[% CALL dbi.disconnect %]

[% CALL inc_page_counter(page_count) %]

SET

The SET directive allows you to assign new values to existing variables or create new temporary variables.

[% SET title = Hello World %]

The SET keyword is also optional.

[% title = Hello World %]

Variables may be assigned the values of other variables, unquoted numbers (digits), literal text (single quotes) or quoted text ("double quotes"). In the latter case, any variable references within the text will be interpolated when the string is evaluated. Variables should be prefixed by $, using curly braces to explicitly scope the variable name where necessary.

[% foo = Foo %] # literal value Foo
[% bar = foo %] # value of variable foo
[% cost = $100 %] # literal value $100
[% item = "$bar: ${cost}.00" %] # value "Foo: $100.00"

Multiple variables may be assigned in the same directive and are evaluated in the order specified. Thus, the above could have been written:

[% foo = Foo
bar = foo
cost = $100
item = "$bar: ${cost}.00"
%]

Simple expressions can also be used, as per GET.

[% ten = 10
twenty = 20
thirty = twenty + ten
forty = 2 * twenty
fifty = 100 div 2
six = twenty mod 7
%]

You can concatenate strings together using the _ operator. In Perl 5, the . is used for string concatenation, but in Perl 6, as in the Template Toolkit, the . will be used as the method calling operator and _ will be used for string concatenation. Note that the operator must be specified with surrounding whitespace which, as Larry says, is construed as a feature:

[% copyright = (C) Copyright _ year _ _ author %]

You can, of course, achieve a similar effect with double quoted string interpolation.

[% copyright = "(C) Copyright $year $author" %]

DEFAULT

The DEFAULT directive is similar to SET but only updates variables that are currently undefined or have no "true" value (in the Perl sense).

[% DEFAULT
name = John Doe
id = jdoe
%]

This can be particularly useful in common template components to ensure that some sensible default are provided for otherwise undefined variables.

[% DEFAULT
title = Hello World
bgcol = #ffffff
%]
< html>
< head>
< title>[% title %]
< /head>

< body bgcolor="[% bgcol %]">

<<less
Download (0.76MB)
Added: 2007-07-11 License: Perl Artistic License Price:
836 downloads
Math::BigInt::Calc 1.87

Math::BigInt::Calc 1.87


Math::BigInt::Calc is a pure Perl module to support Math::BigInt. more>>
Math::BigInt::Calc is a pure Perl module to support Math::BigInt.

SYNOPSIS

Provides support for big integer calculations. Not intended to be used by other modules. Other modules which sport the same functions can also be used to support Math::BigInt, like Math::BigInt::GMP or Math::BigInt::Pari.

In order to allow for multiple big integer libraries, Math::BigInt was rewritten to use library modules for core math routines. Any module which follows the same API as this can be used instead by using the following:

use Math::BigInt lib => libname;
libname is either the long name (Math::BigInt::Pari), or only the short version like Pari.

METHODS

The following functions MUST be defined in order to support the use by Math::BigInt v1.70 or later:

api_version() return API version, 1 for v1.70, 2 for v1.83
_new(string) return ref to new object from ref to decimal string
_zero() return a new object with value 0
_one() return a new object with value 1
_two() return a new object with value 2
_ten() return a new object with value 10

_str(obj) return ref to a string representing the object
_num(obj) returns a Perl integer/floating point number
NOTE: because of Perl numeric notation defaults,
the _numified obj may lose accuracy due to
machine-dependent floating point size limitations

_add(obj,obj) Simple addition of two objects
_mul(obj,obj) Multiplication of two objects
_div(obj,obj) Division of the 1st object by the 2nd
In list context, returns (result,remainder).
NOTE: this is integer math, so no
fractional part will be returned.
The second operand will be not be 0, so no need to
check for that.
_sub(obj,obj) Simple subtraction of 1 object from another
a third, optional parameter indicates that the params
are swapped. In this case, the first param needs to
be preserved, while you can destroy the second.
sub (x,y,1) => return x - y and keep x intact!
_dec(obj) decrement object by one (input is guaranteed to be > 0)
_inc(obj) increment object by one


_acmp(obj,obj) operator for objects (return -1, 0 or 1)

_len(obj) returns count of the decimal digits of the object
_digit(obj,n) returns the nth decimal digit of object

_is_one(obj) return true if argument is 1
_is_two(obj) return true if argument is 2
_is_ten(obj) return true if argument is 10
_is_zero(obj) return true if argument is 0
_is_even(obj) return true if argument is even (0,2,4,6..)
_is_odd(obj) return true if argument is odd (1,3,5,7..)

_copy return a ref to a true copy of the object

_check(obj) check whether internal representation is still intact
return 0 for ok, otherwise error message as string

_from_hex(str) return new object from a hexadecimal string
_from_bin(str) return new object from a binary string
_from_oct(str) return new object from an octal string

_as_hex(str) return string containing the value as
unsigned hex string, with the 0x prepended.
Leading zeros must be stripped.
_as_bin(str) Like as_hex, only as binary string containing only
zeros and ones. Leading zeros must be stripped and a
0b must be prepended.

_rsft(obj,N,B) shift object in base B by N digits right
_lsft(obj,N,B) shift object in base B by N digits left

_xor(obj1,obj2) XOR (bit-wise) object 1 with object 2
Note: XOR, AND and OR pad with zeros if size mismatches
_and(obj1,obj2) AND (bit-wise) object 1 with object 2
_or(obj1,obj2) OR (bit-wise) object 1 with object 2

_mod(obj1,obj2) Return remainder of div of the 1st by the 2nd object
_sqrt(obj) return the square root of object (truncated to int)
_root(obj) return the nth (n >= 3) root of obj (truncated to int)
_fac(obj) return factorial of object 1 (1*2*3*4..)
_pow(obj1,obj2) return object 1 to the power of object 2
return undef for NaN
_zeros(obj) return number of trailing decimal zeros
_modinv return inverse modulus
_modpow return modulus of power ($x ** $y) % $z
_log_int(X,N) calculate integer log() of X in base N
X >= 0, N >= 0 (return undef for NaN)
returns (RESULT, EXACT) where EXACT is:
1 : result is exactly RESULT
0 : result was truncated to RESULT
undef : unknown whether result is exactly RESULT
_gcd(obj,obj) return Greatest Common Divisor of two objects
The following functions are REQUIRED for an api_version of 2 or greater:
_1ex($x) create the number 1Ex where x >= 0
_alen(obj) returns approximate count of the decimal digits of the
object. This estimate MUST always be greater or equal
to what _len() returns.
_nok(n,k) calculate n over k (binomial coefficient)

The following functions are optional, and can be defined if the underlying lib has a fast way to do them. If undefined, Math::BigInt will use pure Perl (hence slow) fallback routines to emulate these:

_signed_or
_signed_and
_signed_xor

Input strings come in as unsigned but with prefix (i.e. as 123, 0xabc or 0b1101).

So the library needs only to deal with unsigned big integers. Testing of input parameter validity is done by the caller, so you need not worry about underflow (f.i. in _sub(), _dec()) nor about division by zero or similar cases.

The first parameter can be modified, that includes the possibility that you return a reference to a completely different object instead. Although keeping the reference and just changing its contents is preferred over creating and returning a different reference.

Return values are always references to objects, strings, or true/false for comparison routines.

<<less
Download (0.19MB)
Added: 2007-08-03 License: Perl Artistic License Price:
499 downloads
Arithmetic Operations Simulation Library 0.01

Arithmetic Operations Simulation Library 0.01


Arithmetic Operations Simulation Librarys aim is to develop an open source library to simulate heavy arithmetic operations. more>>
Arithmetic Operations Simulation Librarys aim is to develop an open source library to simulate heavy arithmetic operations efficiently.
Finding different ways to solve a problem has been an interesting way to relax for many people. Not only they derive some kicks out of it, but as a side effect they develop much deeper insight into the problems enabling them to work out solutions under different constraints easily.
Here you will find discussion/hints to solve some common programming problems in efficient ways, supported with code that you can try.
DSP Programming Tricks
Often support for many heavy arithmetic operations goes missing to reduce the chip cost for marketability reasons, or during chip development stages. And we programmers have to make for the lack of these.
Accessing recent N items in history
This problem attracted my attention during DSP guest lectures by Mr. Ganesh Bhokare at PUCSD in later half of 2005. Various programming solutions to this problem would be.
Maintain a circular buffer in an array of N (or N+1) items. This will require support for MOD operation.
In case N is a power of 2, bitwise-anding with (N-1) can be used in place of MOD.
If neither N is a power of 2, nor MOD support is available?
Enhancements:
- This version supports finding the first 1/0 bit from left/right (lsb/msb), 16-bit unsigned numbers multiplication, division and mod operations, and also special cases of division by 3.
<<less
Download (0.010MB)
Added: 2006-05-15 License: GPL (GNU General Public License) Price:
1258 downloads
Libeval 1.0.7

Libeval 1.0.7


Libeval provides simple means of evaluating simple arithmetic expressions. more>>
Libeval provides simple means of evaluating simple arithmetic expressions involving literal numeric values, variables and functions using the addition (+), subtraction (-), multiplication (*), division (/), modulo division (), exponentiation (^), sign (+-), percentag (%) and grouping (()) operators.
Libeval provides a means of setting and interrogating variables, defining functions and converting error codes into human readable strings. A number of predefined functions are included with libeval that wrap the existing standard C library math functions.
You can evaluate an expression by calling the eval() function. eval() takes two parameters, the expression to evaluate (as a simple C string) and a reference to a double precision float in which to put the result. If eval() encounters an error it returns a non-zero value, otherwise, if everything went well, it returns zero.
The error code returned by eval() can be converted into a human readable string by the eval_error() function. eval_error() takes one parameter, the error code returned by eval(),and returns a constant string describing the error.
Variables can be manipulated with the eval_set_var() and eval_get_var() functions.
eval_set_var() sets the named variable to the specified double precision value. eval_set_var() takes two parameters, the name of the variable to set as a simple C string, and the double precision float value to set the variable to. it returns 0 (zero) on success, non-zero on failure.
eval_get_var() gets the value of the named variable. eval_get_var() takes two parameters, the name of the variable as a simple C string and a reference to a double precision float in which to store the variables value. it returns 0 (zero) on success, non-zero on failure.
Functions can be defined with the eval_def_fn() function, which takes the name of the function as a simple C string, a pointer to a C function implementing the function, a pointer to a block of custom storage for use by the function and the number of arguments taken by the function. The prototype for the implementation function is:
int fn(int args, double *arg, double *rv, void *data);
The first two parameters (args and arg) are similar to the standard parameters to the main() function in C, the args parameter indicates how many elements are the argument list, and arg is the argument list itself. The third parameter (rv) is the return value from the function. The last parameter (data) is the custome storage block passed in when the function was defined.
If you specify a positive value (including zero) as the number of arguments for a function, libeval will only all the function to be called with exactly that number of parameters. If you specify a -1 (negative one) for the number of arguments, the function can be called with any number of parameters.
The following functions are predefined:
abs(x) absolute value of x
int(x) integer part of x
round(x) round x to nearest integer
trunc(x) truncate x (same as int(x))
floor(x) round x to nearest lesser integer
ceil(x) round x to nearest greater integer
sin(x) sine of x (radians)
cos(x) cosine of x (radians)
tan(x) tangent of x (radians)
asin(x) arc sine of x (radians)
acos(x) arc cosine of x (radians)
atan(x) arc tangent of x (radians)
sinh(x) hyperbolic sine of x (radians)
cosh(x) hyperbolic cosine of x (radians)
tanh(x) hyperbolic tangent of x (radians)
asinh(x) hyperbolic arc sine of x (radians)
acosh(x) hyperbolic arc cosine of x (radians)
atanh(x) hyperbolic arc tangent of x (radians)
deg(x) convert radians to degrees
rad(x) convert degrees to radians
ln(x) natural logarithm of x
log(x) base 10 logarithm of x
sqrt(x) square root of x
exp(x) e to x power
rand() random number between 0.0 and 1.0
fact(x) factorial of x (or gamma(x) if x is non-integer)
sum(...) sum of the arguments
min(...) minimum value in arguments
max(...) maximum value in arguments
avg(...) average of arguments
med(...) median of arguments
var(...) variance of arguments
std(...) standard deviation of arguments
Finally, you can get a set of bookkeepping information about the eval_expr libray with the eval_info() function. eval_info() takes nine parmaeters: three references to integer values for the version, revision and build numbers of the current eval_expr library, and three pairs of buffer address and buffer size limit for authors name, copyright info and license info.
You can use libeval by including the libeval header in your program source
#include
and then by linking your program against the libeval library
gcc -o myprog myprog.c -leval
Enhancements:
- A bug in the var() function and version string construction were fixed.
<<less
Download (0.027MB)
Added: 2007-01-17 License: LGPL (GNU Lesser General Public License) Price:
1011 downloads
Secleted [ 0 ] software to compare
  • Page: 1 of 4
  • 1
  • 2
  • 3
  • 4