03-17-2011
Why cannot I assume in my program the arrays ifx[] and pfx[] to end at '\0' ?
Because since these are string arrays, I think we should assume it to end with a null character.
Why we have to specify/initialize that the two arrays would end at null character?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi,
I am new ot unix. So, can i write a shell(c shell or korn shell) program to access internet? I mean if I run the program, it can access specified url and then copy the html to a file? Can anyone help me? And how can make the program runs every 1 hr?
new comer (2 Replies)
Discussion started by: firebirdonfire
2 Replies
2. Shell Programming and Scripting
How do I Ftp, and rename multiple files in one unix script. I have to send it with .tmp extension , then rename it to .txt after FTP is done . I need to do a Mass rename of more than 1 file in a shell script , Urgent help required. (1 Reply)
Discussion started by: Suppandi
1 Replies
3. SCO
Hy guys,
During installation of machine (Pentium x86, 64MB RAM), well during booting SCO UnixWARE 7.1.1 diskette 1/2 i get following error (after SCO logo)
"memfs.fs: I/0 error or unexpected EOF"
Bootstrap Command Processor
...
_
Please advise! (2 Replies)
Discussion started by: R@LE
2 Replies
4. AIX
hi
We have a program which is running on cutomer end,and when its crashing its not dropping core, we asked them to check ulimit,they say that its unlimited.
Even when they crash the program manually by using command
kill -ABRT <pid>
its not dropping the core,on our end when we use same... (1 Reply)
Discussion started by: khan_069
1 Replies
5. Solaris
hi sun experts,
i have problem with my server sun fire v240, if i run application the server will restarting itself and i got some error messages like this:
Mar 21 15:15:03 sun ^Mpanic/thread=2a10094bd40:
Mar 21 15:15:04 sun unix: BAD TRAP: type=34 rp=2a10094b660 addr=30005566764... (0 Replies)
Discussion started by: bucci
0 Replies
6. UNIX and Linux Applications
Hi Friends,
I am new to Unix,
Now I am Working with shell scripting in my company
Description:-By executing that script I need to get the exception from the log file
I need the program for getting the Exceptions from the logfile,,and that program should be generic...I mean if i want to... (5 Replies)
Discussion started by: Anji
5 Replies
7. Shell Programming and Scripting
Hello I have to do a program in Bash, need help because it does not go out for me and go enough time with this!!
Five directories(boards of directors) that more occupy, arranged according to size. To measure the size of every directory(board of directors) there must not be included the size... (1 Reply)
Discussion started by: danihj
1 Replies
8. Programming
Hey, i am trying to write a program that takes multiple files as command line arguments, then outputs them to a single file. i also need the option to read them back out again. essentially what i am trying to create is an archiver, however, a very simple one. The program i have accomplished so far... (1 Reply)
Discussion started by: wezzyb
1 Replies
9. Programming
Hello all ,
i need some help asap
i have a program that keeps killing the machine
when i did google searches and 2 days later i ran strace
it seems the programm keeps making a system call to gettimeofday
to i guess increment a counter ?
gettimeofday({1347986584, 464904}, NULL) = 0... (6 Replies)
Discussion started by: NetworkLearning
6 Replies
10. Programming
Hi ,
seq can be 0...128
int windex = seq / 8;
int bindex = seq % 8;
unsigned char bitvalue = '\x01' << (7-bindex) ;
bpv.bitmapvalue = bitvalue;
This is the part of a program to convert decimal to bitmap value of hexadecimal.
I want this to change to convert only to... (1 Reply)
Discussion started by: greenworld123
1 Replies
LEARN ABOUT DEBIAN
imager::expr
Imager::Expr(3pm) User Contributed Perl Documentation Imager::Expr(3pm)
NAME
Imager::Expr - implements expression parsing and compilation for the expression evaluation engine used by Imager::transform2()
SYNOPSIS
my $code = Imager::Expr->new({rpnexpr=>$someexpr})
or die "Cannot compile $someexpr: ",Imager::Expr::error();
DESCRIPTION
This module is used internally by the Imager::transform2() function. You shouldn't have much need to use it directly, but you may want to
extend it.
To create a new Imager::Expr object, call:
my %options;
my $expr = Imager::Expr->new(\%options)
or die Imager::Expr::error();
You will need to set an expression value and you may set any of the following:
o constants
A hashref defining extra constants for expression parsing. The names of the constants must be valid identifiers (/[^Wd]w*/) and the
values must be valid numeric constants (that Perl recognizes in scalars).
Imager::Expr may define it's own constants (currently just pi.)
o variables
A reference to an array of variable names. These are allocated numeric registers starting from register zero.
By default you can define a "rpnexpr" key (which emulates RPN) or "expr" (an infix expression). It's also possible to write other
expression parsers that will use other keys. Only one expression key should be defined.
Instance methods
The Imager::Expr::error() method is used to retrieve the error if the expression object cannot be created.
Methods
Imager::Expr provides only a few simple methods meant for external use:
Imager::Expr->type_registered($keyword)
Returns true if the given expression type is available. The parameter is the key supplied to the new() method.
if (Imager::Expr->type_registered('expr')) {
# use infix expressions
}
$expr->code()
Returns the compiled code.
$expr->nregs()
Returns a reference to the array of numeric registers.
$expr->cregs()
Returns a reference to the array of color registers.
$expr->dumpops()
Returns a string with the generated VM "machine code".
$expr->dumpcode()
Returns a string with the disassembled VM "machine code".
Creating a new parser
I'll write this one day.
Methods used by parsers:
compile
This is the main method you'll need to implement in a parser. See the existing parsers for a guide.
It's supplied the following parameters:
o $expr - the expression to be parsed
o $options - the options hash supplied to transform2.
Return an array ref of array refs containing opcodes and operands.
@vars = $self->_variables()
A list (not a reference) of the input variables. This should be used to allocate as many registers as there are variable as input
registers.
$self->error($message)
Set the return value of Imager::Expr::error()
@ops = $self->stack_to_reg(@stack_ops)
Converts marginally parsed RPN to register code.
assemble()
Called to convert op codes into byte code.
numre()
Returns a regular expression that matches floating point numbers.
optimize()
Optimizes the assembly code, including attempting common subexpression elimination and strength reducing division by a constant into
multiplication by a constant.
register_type()
Called by a new expression parser implementation to register itself, call as:
YourClassName->register_type('type code');
where type code is the parameter that will accept the expression.
Future compatibility
Try to avoid doing your own optimization beyond literal folding - if we add some sort of jump, the existing optimizer will need to be
rewritten, and any optimization you perform may well be broken too (well, your code generation will probably be broken anyway <sigh>).
perl v5.14.2 2011-06-06 Imager::Expr(3pm)