f



both 1 and not-1?

Okay, maybe I'm getting too tired for tonight, but ... how can
add_to_array *possibly* die with a filter violation (which it does)?
Certainly, is_filtered doesn't modify $visit -- or does it?

sub add_to_array{
    my $self = shift;
    my $visit = shift;
    if ( not $self->is_filtered($visit) ){
        if ( $self->is_filtered($visit) ){die ("FILTER VIOLATION\n");}
    }
}

sub is_filtered{
    my $self = shift;
    my $visit = shift;
    while ( my ($field, $pattern) = each %{ $self->{_excludepatterns} } ){
        if ( $visit->{$field} =~ $pattern){  return 1; }
    }
    return 0;
}

Many thanks,
Michael Goerz
0
Michael
9/26/2006 7:41:08 AM
comp.lang.perl.misc 33233 articles. 2 followers. brian (1246) is leader. Post Follow

7 Replies
1235 Views

Similar Articles

[PageSpeed] 27

"Michael Goerz" <news12@8439.e4ward.com> wrote in message 
news:4ns3s9Fbp1otU1@uni-berlin.de...
> Okay, maybe I'm getting too tired for tonight, but ... how can
> add_to_array *possibly* die with a filter violation (which it does)?
> Certainly, is_filtered doesn't modify $visit -- or does it?
>
> sub add_to_array{
>    my $self = shift;
>    my $visit = shift;
>    if ( not $self->is_filtered($visit) ){
>        if ( $self->is_filtered($visit) ){die ("FILTER VIOLATION\n");}
>    }
> }
>
> sub is_filtered{
>    my $self = shift;
>    my $visit = shift;
>    while ( my ($field, $pattern) = each %{ $self->{_excludepatterns} } ){
>        if ( $visit->{$field} =~ $pattern){  return 1; }
>    }
>    return 0;
> }
>
> Many thanks,
> Michael Goerz

If the key $visit{$field} does not exist the above code will create it, with 
value undef, so yes is_filtered can modify $visit. If this is undesirable 
try:
if ( (exists $visit->{$field} ) && ($visit->{$field} =~ $pattern ) ){ 
return 1; }


0
Dave
9/26/2006 9:07:09 AM
Michael Goerz wrote:
> Okay, maybe I'm getting too tired for tonight, but ... how can
> add_to_array *possibly* die with a filter violation (which it does)?
> Certainly, is_filtered doesn't modify $visit -- or does it?

You are right.. it does not modify your $visit.

> sub add_to_array{
>     my $self = shift;
>     my $visit = shift;
>     if ( not $self->is_filtered($visit) ){
>         if ( $self->is_filtered($visit) ){die ("FILTER VIOLATION\n");}
>     }
> }

The logic is: if it's '1', it will never be '-1' or '0' again, so the
inner 'if' in your subroutine is redundant, and the related block {die
("FILTER VIOLATION\n");} will never be executed. but if you meant:
either 1 or otherwise not -1, then

if ( $x == 1 ) {
    # do something;
} elsif ( not $x == -1 ) {
   # do some other things;
}

BTW. your subroutine is_filtered() doesnot return -1, and '-1' is
'TRUE' as in the 'if' condition.

Regards,
Xicheng

0
Xicheng
9/26/2006 9:23:05 AM
"Dave" <daveandniki@ntlworld.com> wrote in message 
news:4518edcc$0$5110$ba4acef3@news.orange.fr...
>
> "Michael Goerz" <news12@8439.e4ward.com> wrote in message 
> news:4ns3s9Fbp1otU1@uni-berlin.de...
>> Okay, maybe I'm getting too tired for tonight, but ... how can
>> add_to_array *possibly* die with a filter violation (which it does)?
>> Certainly, is_filtered doesn't modify $visit -- or does it?
>>
>> sub add_to_array{
>>    my $self = shift;
>>    my $visit = shift;
>>    if ( not $self->is_filtered($visit) ){
>>        if ( $self->is_filtered($visit) ){die ("FILTER VIOLATION\n");}
>>    }
>> }
>>
>> sub is_filtered{
>>    my $self = shift;
>>    my $visit = shift;
>>    while ( my ($field, $pattern) = each %{ $self->{_excludepatterns} } ){
>>        if ( $visit->{$field} =~ $pattern){  return 1; }
>>    }
>>    return 0;
>> }
>>
>> Many thanks,
>> Michael Goerz
>
> If the key $visit{$field} does not exist the above code will create it, 
> with value undef, so yes is_filtered can modify $visit. If this is 
> undesirable try:
> if ( (exists $visit->{$field} ) && ($visit->{$field} =~ $pattern ) ){ 
> return 1; }
>
>

Sorry, my mistake, the original code does not cause auto-vivication. The 
problem is elsewhere as Xicheng has noted.



0
Dave
9/26/2006 12:01:20 PM
Xicheng Jia wrote:
> Michael Goerz wrote:
>> Okay, maybe I'm getting too tired for tonight, but ... how can
>> add_to_array *possibly* die with a filter violation (which it does)?
>> Certainly, is_filtered doesn't modify $visit -- or does it?
> 
> You are right.. it does not modify your $visit.
> 
>> sub add_to_array{
>>     my $self = shift;
>>     my $visit = shift;
>>     if ( not $self->is_filtered($visit) ){
>>         if ( $self->is_filtered($visit) ){die ("FILTER VIOLATION\n");}
>>     }
>> }
> 
> The logic is: if it's '1', it will never be '-1' or '0' again, so the
> inner 'if' in your subroutine is redundant, and the related block {die
> ("FILTER VIOLATION\n");} will never be executed. 

That's exactly my point! the inner block should never be executed! I put
it in there for debugging only. My point is that the first 'if ( not
$self->is_filtered($visit) ){' should make sure that I'm only dealing
with visits where is_filtered has returned zero. Yet, as I'm puzzled to
find out, I end up with visits inside the block that violate this! I do
get the filter violation printed out, and it's totally unclear to me how
that's even possible. It's like the outer if isn't even executed.
However, sometimes it works, as this code proves (I get both correctly
filtered visits, and filter violations at some point):

if ( not $self->is_filtered($visit) ){
    if ( $self->is_filtered($visit) ){die ("FILTER VIOLATION\n");}
         else {print "Filtered\n"}
}

Does this explain what's going on? It's entirely incomprehensible to me,
logically.

Maybe I can extract the routine and put it in a full working test
script, to find out what's going on.

Thank you,
Michael Goerz
0
Michael
9/26/2006 3:53:46 PM
Michael Goerz wrote:
> Maybe I can extract the routine and put it in a full working test
> script, to find out what's going on.
Interesting, I was able to recreate the faulty behavior in an example
script (see below). If I use generate_test_visit2(), everything works
fine, but with generate_test_visit1(), I get the filter violation. The
only difference between the two is that once $visit is local, and once
it's global. Now this may give a clue to what's going wrong, I have to
look into it, but still, I don't understand how logically the filter
violation can ever occur!!!

Xicheng, by the way, I see what confused you in your first reply: My
subject line was ambiguous. It should be 'both one and not-one', not to
be read as 'both one and not-minus-one'. Sorry about that. I hope it's
clear now what my problem is.

Thanks,
Michael


#!/usr/bin/perl -w
use strict;
use Data::Dumper;


my $visit = {field1 => 1, field2 => 'foo'};
my $compiled_pattern = qr/1/;
my %excludepatterns = ('field1' => $compiled_pattern);


# Main Program
while (1){
    $visit = generate_test_visit1();
    print Dumper $visit;
    add_to_array($visit);
}




# toggle for testing
sub generate_test_visit1{
    my $visit;
    if ( not exists($visit->{field1}) ){
        warn "field1 doesn't exist\n";
        $visit->{field1} = 0;
    }
    if ($visit->{field1} == 0){
        $visit->{field1} = 1;
    } else {
        $visit->{field1} = 0;
    }
    return $visit;
}


# toggle for testing
sub generate_test_visit2{
    if ( not exists($visit->{field1}) ){
        warn "field1 doesn't exist\n";
        $visit->{field1} = 0;
    }
    if ($visit->{field1} == 0){
        $visit->{field1} = 1;
    } else {
        $visit->{field1} = 0;
    }
    return $visit;
}


sub add_to_array{
    my $visit = shift;
    if ( not is_filtered($visit) ){
        print "accepted value $visit->{field1}\n";
        if ( is_filtered($visit) ){
            warn ("FILTER VIOLATION, value $visit->{field1} was not
filtered\n");
         }
    } else {
        print "filtered value $visit->{field1}\n";
    }
}

# checks if visit has to be filtered out
sub is_filtered{
    my $visit = shift;
    while ( my ($field, $pattern) = each %excludepatterns ){
        if ( exists($visit->{$field}) ){
            if ( $visit->{$field} =~ $pattern){
                return 1;
            }
        } else {
            warn "Tried to filter non-existing field.\n";
        }
    }
    return 0;
}
0
Michael
9/26/2006 4:47:22 PM
In article <4nt3sfFbuecsU1@uni-berlin.de>,
Michael Goerz  <news12@8439.e4ward.com> wrote:

[ much snippage ]

>my $visit = {field1 => 1, field2 => 'foo'};
>my $compiled_pattern = qr/1/;
>my %excludepatterns = ('field1' => $compiled_pattern);

># checks if visit has to be filtered out
>sub is_filtered{
>    my $visit = shift;
>    while ( my ($field, $pattern) = each %excludepatterns ){
>        if ( exists($visit->{$field}) ){
>            if ( $visit->{$field} =~ $pattern){
>                return 1;
>            }
>        } else {
>            warn "Tried to filter non-existing field.\n";
>        }
>    }
>    return 0;
>}

I think the problem is that if any pattern matches, you are leaving
the loop early.  So, the next time you enter the function, the
each() will continue the earlier iteration rather than starting over.

There are several possibilities to correct this:

1) Make sure you loop through all the fields -- set a flag if a
pattern matches, but keep going until the while() ends.

2) Reset the internal iterator that each() uses when you enter
is_filtered() -- see perldoc -f each for how to do this.

3) Don't use each(), use keys() instead.  This is probably the way
I would find clearest, but maybe that's just me.

forreach my $field (keys %excludepatterns) {
    if (exists $visit->{$field}) {
        return 1 if $visit->{$field} =~ $excludepatterns{$field};
    }
    # else as before
}

I'm not sure which would be fastest (if speed is important and this
is a significant part of your code).  You might want to benchmark each
and run some tests.

Gary Ansok
-- 
3M suggests that to obtain the best results, one should make the bond
"while the adhesive is wet, aggressively tacky."  I did not know what
"aggressively tacky" meant until I saw a recent notice in the Bboard.
	(Mario Barbacci)
0
ansok
9/26/2006 5:21:19 PM
Gary E. Ansok wrote:

> I think the problem is that if any pattern matches, you are leaving
> the loop early.  So, the next time you enter the function, the
> each() will continue the earlier iteration rather than starting over.
Yes! Fixing this solved the problem. Thanks a lot -- I wouldn't have
thought about this.

Thanks,
Michael
0
Michael
9/26/2006 6:05:43 PM
Reply:

Similar Artilces:

1 - 1, 1 -1, 1-1, 1
Hi, I have a question regarding lexical analysis. I recently came across a bug in our lexical analyser in phc (www.phpcompiler.org), that I am unsure how to solve. This is the problem: our current definition for integer constant looks something like INT ([1-9][0-9]*)|0 In particular, note that it does not allow for an (optional) "+" or "-" at the start of the integer. This means that the strings "1 - 1", "1 -1" and "1-1" all generate the same sequence of three tokens INT(1), OP(-), INT(1), for which the syntax analyser generates the subtree BIN_OP(-, 1, 1). For the string "1 - -1", the lexer (unsurprisingly) generates INT(1), OP(-), OP(-), INT(1). The syntax analyser recognises this as BIN_OP(1, UNARY_OP(-, 1)). In other words, the second "-" is treated as a unary operator, rather than as part of the number. This works fine, with the sole exception of the number "-2147483648". The problem is, of course, overflow: -2147483648 is a valid negative number (assuming 32-bit numbers), but the integer 2147483648 is _not_ a valid positive number. Thus, the above method of dealing with "-" as a unary operator breaks down. The solution is to interpret the "-" as part of the number, and generate INT(-2147483648), rather than OP(-), INT(...). However, changing the definition of INT to INT [+-]?([1-9][0-9]*)|0 causes "1-1" to be recognised as INT(1), INT(-1), which is...

1.1.1.1 ?
hi my firewall logs dropped packets from an internal IP address trying to contact 1.1.1.1 through port 9999. Any ideas whether 1.1.1.1 is valid IP? and what is port 9999?? thanks mike wrote: > hi > > my firewall logs dropped packets from an internal IP address trying to > contact 1.1.1.1 through port 9999. Any ideas whether 1.1.1.1 is valid > IP? and what is port 9999?? > thanks These trojans *BlitzNet*, *Backdoor.Oracle*, *Backdoor.Spadeace* uses port 9999 -- S.S. "StarScripter" <Star@privacy.net> wrote in message news:<bv8ejj$p54t3$1@ID-185702.new...

plot 1, -1, 1, -1, -1
Hi, How to plot those numbers in a rectangle style? thanks x = linspace(-4*pi,4*pi,1000); y = sin(x); plot(x,sign(y)), axis([-12 12 -2 2]) PZ <patrick.zou@gmail.com> wrote in message <d64c545f-f2ac-4f87-af89-051bda896707@x6g2000vbg.googlegroups.com>... > Hi, > > How to plot those numbers in a rectangle style? > > thanks help stairs stairs([-1 1 -1 1 -1 1]) hth Jos ...

Ip-Address 1.1.1.1
A traceroute to 213.176.224.4 showed following results: # traceroute -In -m10 213.176.224.4 traceroute to 213.176.224.4 (213.176.224.4), 10 hops max, 38 byte packets 1 212.152.136.1 103.658 ms 99.452 ms 109.767 ms 2 212.152.151.2 99.646 ms 99.680 ms 99.821 ms 3 62.218.1.93 99.689 ms 109.665 ms 99.751 ms 4 212.152.192.182 99.762 ms 1359.690 ms 99.718 ms 5 193.203.0.72 104.398 ms 105.014 ms 109.781 ms 6 146.188.2.229 109.696 ms 109.733 ms 99.771 ms 7 146.188.14.113 119.710 ms 199.720 ms 209.720 ms 8 146.188.49.194 119.695 ms 129.663 ms 119.808 ms 9 1.1.1.1 109.731 ms 129.672 ms 119.772 ms 10 * * * 1.1.1.1? I thought that 1.0.0.0/8 is reserved by iana according to: http://www.iana.org/assignments/ipv4-address-space or do I understand something wrong here? thx Leopold In article <pan.2005.02.07.19.19.33.29091@utanet.at>, Leopold Schweighofer <leos@utanet.at> wrote: :A traceroute to 213.176.224.4 showed following results: : 8 146.188.49.194 119.695 ms 129.663 ms 119.808 ms : 9 1.1.1.1 109.731 ms 129.672 ms 119.772 ms :I thought that 1.0.0.0/8 is reserved by iana according to: :http://www.iana.org/assignments/ipv4-address-space :or do I understand something wrong here? No you are correct. It appears what has happened is that UUNet/PIPEX have a NATing device attached to them which has been set with an outside IP of 1.1.1.1. That works fine for receiving traffic, and...

ERROR IN EXPRESSION; -1 - (-1) not 1
The expression isn't a = 1 - (1-), but: a = -1 - (1) der <der@noemail.com> scribbled the following: > The expression isn't a = 1 - (1-), but: a = -1 - (1) Ah, that's different, then. Then the answer is: The result will be -2. You have *no* guarantees about which of -1 or (1) is evaluated first, but as they don't have side effects, you don't have to care. -- /-- Joona Palaste (palaste@cc.helsinki.fi) ---------------------------\ | Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++| | http://www.helsinki.fi/~palaste W++ B OP+ | \----------------------------------------- Finland rules! ------------/ "To doo bee doo bee doo." - Frank Sinatra ...

Alignment of foo[1][1][1][1]
Suppose I have type 'foo' and: sizeof (foo) == 16 alignof (foo) == 2 Suppose I have type 'foo[1][1][1][1]' and: sizeof (foo[1][1][1][1]) == 16 Can: alignof (foo[1][1][1][1]) == 4 ? I'd like to think not, but is it prohibited? If I do: typedef foo bar[1][1][1][1]; bar * my_bar = malloc(sizeof *bar); foo * my_foo = (foo *) my_bar; certainly 'my_bar' points to an object whose alignment satisfies type 'foo'. But what about the other way around? typedef foo bar[1][1][1][1]; foo * my_foo = malloc(sizeof *foo); bar * my_ba...

RxParse 1.1
This is one of the best little XML SAX parser's I have ever used. Totally Perl, doesen't use any dll wrappers. ################################################################# # AUTHOR: robic0, copyright (c) 2006-2007 # Reproduction of contents, or distribution in a comercial # product, is strictly prohibited without prior written # permission from the author. ################################################################# # XML/Xhtml/Html - RXParse parse/edit/filter module # ------------------------------------------------------ # Compliant w3c XML: 1.1 # Resources: # Extensibl...

RedNotebook 1.1.1
RedNotebook 1.1.1 has been released. You can get the tarball, the Windows installer and links to distribution packages at http://rednotebook.sourceforge.net/downloads.html What is RedNotebook? -------------------- RedNotebook is a **graphical journal** and diary helping you keep track of notes and thoughts. It includes a calendar navigation, customizable templates, export functionality and word clouds. You can also format, tag and search your entries. RedNotebook is available in the repositories of most common Linux distributions and a Windows installer is available. What's new? ----------- * Let user delete category with 'DELETE' key (LP:608717) * Sort categories alphabetically (LP:612859) * Fix: After clicking "Change the text" on an annotation, directly edit it (LP:612861) * Fix: Journal -> _Journal in menu * Fix: Do not clear entry when category is changed in new-entry dialog * Fix: restore left divider position * Fix: Use rednotebook website for retrieving newest version information (LP:621975) * Windows: Shrink installer size * Windows: Update gtk libs * Windows: New theme * Windows: New icons * New translations: * English (United Kingdom) * Norwegian Bokmal * Many translations updated Cheers, Jendrik ...

htmldata 1.1.1
Bug-fix release of htmldata, fixes error when parsing whitespace inside tags. Description of the htmldata module, from its PyPI site: http://cheeseshop.python.org/pypi/htmldata/ "Extract and modify HTML/CSS URLs, translate HTML documents <-> list data structures. The htmldata module allows one to translate HTML documents back and forth to list data structures. This allows for programmatic reading and writing of HTML documents, with much flexibility. Functions are also available for extracting and/or modifying all URLs present in the HTML or stylesheets of a document. I have found this library useful for writing robots, for "wrapping" all of the URLs on websites inside my own proxy CGI script, for filtering HTML, and for doing flexible wget-like mirroring. It keeps things as simple as possible, so it should be easy to learn. Supports XHTML, too." Connelly Barnes http://www.connellybarnes.com/ __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ...

CDSB 1.1.1
CDSB 1.1.1 is available. More tools can be installed on FreeBSD. For example, Calibre, HSPICE, SpiceExplorer, etc. Get more information from CDSB Wiki: http://code.google.com/p/cdsb/w/list Group: cdsbgroup@googlegroups.com ...

DeepForm 1.1.1
DeepForm allows an analyst to create a document (named Model) that specifies the structure and the contents of the XML document containing the corporate data. DeepForm does not requires any knowledge of the XML format by the user. The data model creation The application allows the user to compone his own model using a quick and easy interface. The analyst can create his own model by simply combining the "basic" elements of DeepForm: * fields (customizables); * tables; * sections. DeepForm allows to create new models by using parts of other models pre...

slimKEYS 1.1.1
slimKEYS is a universal hotkey manager with a plug-in system that lets you perform an infinite number of actions simply by pressing system- wide hotkeys. It already comes with multiple built-in plug-ins: slimLAUNCH lets you open applications, documents or folders, or search for password entries stored securely, or open your del.icio.us posts simply by typing a few letters of their name or by directly assigning them specific hotkeys. slimSIZE lets you resize or move windows to any monitor and location just by pressing a hotkey. slimSEARCH helps you search on popular search engine...

3DLDF Release 1.1.5 and 1.1.5.1
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Release of 3DLDF 1.1.5. 3DLDF is a GNU package for three-dimensional drawing with MetaPost output. It is available from http://ftp.gnu.org/gnu/3dldf and other ftp servers. Please see the author's website, http://wwwuser.gwdg.de/~lfinsto1 and http://www.gnu.org/directory/graphics/3D/3DLDF.html for more information. In release 1.1.5, I've tied up some loose ends. I wanted to do this before starting on the input routine. * Added `const real step' argument to the version of Ellipse::intersection_points() that takes an Ellipse argument. * BUG FIX: Added `touch 3DLDFmp.mp' to the `3DLDFmp.mp' target in 3DLDF-1.1.5/CWEB/Makefile.am. This ensures that TeX and dvips will be run if MetaPost is run on `3DLDFmp.mp'. This happens if `3DLDFput.mp' is newer than `3DLDFmp.mp', but the latter isn't changed, so TeX and dvips weren't being run. I'm surprized nobody's complained about this. Not yet documented in the _3DLDF User and Reference Manual_. * Added `PHONY' targets as synonyms for certain targets: `cpl' for `3dldf'. For compiling and linking `3dldf'. `mp' for `3DLDFmp.mp'. For running MetaPost on `3DLDFmp.mp'. `ldf' for `3DLDFput.mp'. For running `3dldf'. Not yet documented in the _3DLDF User and Reference Manual_. * It is now possible to ``typedef'' ...

-1, +1
Hi, How can I generate a random number as -1 or +1 in a loop TIA Try, A=rand(5,5); A(A>0.5)=1; A(A<=0.5)=-1; This makes a matrix of random +1/-1 you can probably get what you need from this... Volvo wrote: > > > Hi, > > How can I generate a random number as > > -1 or +1 in a loop > > TIA > > > On Sun, 02 Nov 2003 14:03:30 -0500, Dan Ennis wrote: > Try, > > > A=rand(5,5); > A(A>0.5)=1; > A(A<=0.5)=-1; A shorter version would be A=sign(2*rand(5)-1); A(A==0)=1; % or however you want to assign it. Of cou...

1--1
I don't understand why this works as expected: select * from games order by 2 but this doesn't: select * from games order by 1--1 The "order by" is completely ignored. On Wednesday January 21 2015 11:44, in comp.databases.mysql, "Kiuhnm Mnhuik" <gandalf23@mail.com> wrote: > I don't understand why this works as expected: > select * > from games > order by 2 > but this doesn't: > select * > from games > order by 1--1 > The "order by" is completely ignored. No, it isn...

i++, ++i, i+=1 and i = i+1;
Hello, let say we have; 1) i++; /* use i and increment by one */ 2) ++i; /* increment i by one and use it */ 3) i += 1; 4) i = i+1; result (for value of i) of all 4 will be same; could anyone tell differences among them from any perspectives? I heard we'd better use 2) over 1). And 1) is faster than 3) or 4). Thanks in advance, jim said: > Hello, > let say we have; > > 1) i++; /* use i and increment by one */ > 2) ++i; /* increment i by one and use it */ > 3) i += 1; > 4) i = i+1; > > result (for value of i) of all 4 will be same; could anyone...

OO 1.1 and java 1.3.1
Am attempting to install OO 1.1, but with just Java 1.3.1, and the install documentation says that without at least 1.4.1, I cannot make use of full capabilties. I infer from this that I should be able to OO crippled. However, However, OO does not like it when I point to my 131 JRE. Comments? -- Sir: David I. Smith wrote: > Am attempting to install OO 1.1, but with just Java 1.3.1, and the > install documentation says that without at least 1.4.1, I cannot make > use of full capabilties. I infer from this that I should be able to > OO crippled. However, However, OO...

IMDbPY 4.1 and IMDbPYKit 1.1.1
IMDbPY 4.1 and IMDbPYKit 1.1.1 are available (tgz, deb, rpm, exe) from: http://imdbpy.sourceforge.net/ IMDbPY is a Python package useful to retrieve and manage the data of the IMDb movie database about movies, people, characters and companies. IMDbPYKit (mostly developed by H. Turgut Uyar) is a web interface to IMDbPY, able to serve its output both in HTML and XML. With this release, a DTD for the XML output was formalized and support for i18n was introduced. A lot of bugs were fixed. Platform-independent and written in pure Python (and few C lines), IMDbPY can retrieve data from both the IMDb's web server and a local copy of the whole database. IMDbPY package can be very easily used by programmers and developers to provide access to the IMDb's data to their programs. Some simple example scripts are included in the package; other IMDbPY-based programs are available from the home page. -- Davide Alberani <alberanid@libero.it> [GPG KeyID: 0x465BFD47] http://erlug.linux.it/~da/ ...

Evaluation of 1/(1/a + 1/b + 1/r)
Folks, I am trying to write a program to evaluate the sum of two continued fractions, written in polynomials of T. I would like a short routine to evaluate 1/(1/a + 1/b + 1/r), just working with a, b, and r if they are not equal to zero. So, if a = 0, then evaluate 1/(1/b + 1/r) If a, b, = 0, then evaluate 1/r If all of a, b, r = 0, give me 0 as output. If (1/a + 1/b + 1/r) = 0, give me 0 as output. Assume that a, b, r are arbitrary polynomials in T. Can someone help? Thanks, Diana Clear[f]; f[a_,b_,r_]:=0/;a==b==r==0; f[a_,b_,r_]:=1/Total[ 1/Sele...

XHTML 1.1 spec: lang and xml:lang
Hello, I've looked at the latest XHTML spec from 2009-05-07. Referring to http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_commonatts In the I18N module, there are only two attributes listed: dir and xml:lang. The note in the last paragraph says: "Finally, note that the I18N collection only contains the xml:lang attribute unless the Bi- directional Text Module module is selected." This is fine, but... http://www.w3.org/TR/xhtml11/doctype.html says (last paragraph): "This specification also adds the lang attribute to the I18N attribute c...

FAQ 1.1: What is Perl?
This message is one of several periodic postings to comp.lang.perl.misc intended to make it easier for perl programmers to find answers to common questions. The core of this message represents an excerpt from the documentation provided with Perl. -------------------------------------------------------------------- 1.1: What is Perl? Perl is a high-level programming language with an eclectic heritage written by Larry Wall and a cast of thousands. It derives from the ubiquitous C programming language and to a lesser extent from sed, awk, the Unix shell, and at least a dozen ot...

JDK 1.3.1/1.4/1.5
How can you display JDialog without the Close on the Top Right in any of these versions(JDK 1.3.1/1.4/1.5). The only thing it displays is the close button X and I don't want that? Thank you! vnssoftware wrote: > How can you display JDialog without the Close on the Top Right in any > of these versions(JDK 1.3.1/1.4/1.5). The only thing it displays is > the close button X and I don't want that? > > Thank you! Dialog.setUndecorated() since 1.4 -- Knute Johnson email s/nospam/knute/ Molon labe... ...

Meaning of 1:1, 1:1 generalization, 1:n, 1:n non identifying, n:m
Hi All, I've been taking a look at DB Designer 4, and looking through the documentation (http://www.fabforce.net/dbdesigner4/doc/index.html) I am a little unclear on some of their nomenclature: '1:1' - Ok, one to one. Got it. '1:1 generalization' - Don't know this. Obviously different somehow from one to one, but how? '1:n' - One to many, I assume. '1:n non identifying' - Nonidentifying? What does this mean? 'n:m' - Many to many? Again, not sure. Can anyone help clarify? Thanks! -Josh Joshua Beall wrote: > I...

modify date from 1/1/0001 to 1/1/1900 ?
Hi, migrating some Lotus Notes 6.5 DBs I found lots of dates that are set to 1/1/0001 12:00:00 AM. The new system only supports dates starting from 1/1/1900 12:00:00 AM, so I need to change the year 0001 to 1900 for several fields. What is the easiest way to change a field from 1/1/0001 12:00:00 AM to 1/1/1900 12:00:00 AM for all the rows in a nsf? Is there a tool that can help me do this or do I need to learn some scripting? thanks David Ok, I found some tools that can help edit fields in a notes db, like NoteMan and ezScan. As Notes newbie I'm having difficulties...

Web resources about - both 1 and not-1? - comp.lang.perl.misc

Not 1, But 2 Versions Of The Same Album
Nine Inch Nails (NIN) fans are rejoicing after the American Industrial Rock project announced the release of the 8th album "Hesitation Marks", ...

Att Gen asks Americans to report IP violations on their neighbors but not 1 prosecution of Wall Street ...
On Tuesday, Attorney General Eric Holder urged Americans to fink on their neighbors and report intellectual-property offenses like popping or ...

BMW Delivers Decent Ad For BMW i3, But Not 1 Of My 4 Favorites
... electric vehicle archives and/or subscribe to CleanTechnica’s electric vehicle e-newsletter . BMW Delivers Decent Ad For BMW i3, But Not 1 ...

DNews: Voyager 1 Not Even CLOSE to Leaving Solar System
We often hear that the Voyager 1 space probe has left the planetary building, or more specifically left the solar system. But Ian O'Neill tells ...

Get Ready For, Not 1, Not 2, But 3 (THREE) 'Avatar' Sequels
I know, I know. You're probably asking the same question: Why?

Breast Cancer Is Actually 10 Disease, Not 1
The term “breast cancer” is a blanket term for what has turned out to be 10 different categories of diseases which have now been classified by ...

In which I dream I have not 1, but 2 boyfriends...
Not sure what all happened in my dream but there were definitely 2 guys and they were both my boyfriend.

Netflix renews 'Orange Is the New Black' for not 1, not 2, but 3 more seasons
... is magic. There's good news for fans of Orange Is the New Black this morning: Netflix has renewed its most acclaimed original. And not just ...

Earliest Americans Arrived in 3 Waves, Not 1, DNA Study Finds
Genetics researchers say the Americas were first populated by three surges of migrants from Siberia, rather than just a single migration.

Dell PCs have not 1, but 2 dangerous security flaws that could let hackers spy on you
Barely a day after Dell announced it was fixing a major security flaw on its recently shipped PCs, a second one has been discovered in the form ...

Resources last updated: 3/7/2016 2:23:12 AM