[25345] in Perl-Users-Digest
Perl-Users Digest, Issue: 7590 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Dec 29 00:05:31 2004
Date: Tue, 28 Dec 2004 21:05:07 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Tue, 28 Dec 2004 Volume: 10 Number: 7590
Today's topics:
Re: Hard coded vs. variable assignment using in SQL sta <jack@swamc.com>
Re: Hard coded vs. variable assignment using in SQL sta <matthew.garrish@sympatico.ca>
Re: Hard coded vs. variable assignment using in SQL sta <jack@swamc.com>
Re: Help needed for perl rookie <see_sig@invalid>
Re: how to delete files that create date <=20041210 <blgl@hagernas.com>
Re: Is zero even or odd? <invalid@msgid.michael.mendelsohn.de>
Re: Is zero even or odd? <george_coxanti@spambtinternet.com.invalid>
Re: Is zero even or odd? <george_coxanti@spambtinternet.com.invalid>
Re: Is zero even or odd? <krw@att.bizzzz>
Re: Is zero even or odd? <jfields@austininstruments.com>
Re: Is zero even or odd? <jfields@austininstruments.com>
Re: Is zero even or odd? <godbless@isu.com>
Newbie question on require and semaphores <gmeazell@swbell.net>
Re: Newbie question on require and semaphores <matthew.garrish@sympatico.ca>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 29 Dec 2004 10:49:15 +0800
From: Jack <jack@swamc.com>
Subject: Re: Hard coded vs. variable assignment using in SQL statement.
Message-Id: <cqt7h2$2lso$1@news.hgc.com.hk>
Jim Gibson wrote:
> In article <cqs1um$23il$1@news.hgc.com.hk>, Jack <jack@swamc.com> wrote:
>
>
>>sam wrote:
>
>
>
>>The value of the custcode is 07-3-0037, when it is used in MySQL
>>statement, is there a way to force it to be a string rather than a date
>>format?
>>In the SQL statement I wrote (in perl), regardless of having double
>>quote or not, there is not result return from the following statement:
>>AND c.custcode = "$mycustcode"
>
>
> Perl does not have a primitive, built-in date scalar value. It has only
> numeric, string, and reference scalar values, so '07-3-0037' IS a
> string.
>
> You need to post a complete, working, short-as-possible program that
> anyone can run to get more help. In general, you should print out the
> values of variables to see what they contain, but you seem to be doing
> that.
>
Here is a more complete version of the perl code.
The following perl code does return result when execute the SQL statement:
@outlets = ("07-6-0057","07-3-0051","07-2-0036");
my $mycustcode = "$outlets[1]"; # also work for [0] or [2]
$create_view_sql = qq {create view $viewtab as
select c.custcode, c.custname, c.type, sum(t.netsales) as sales
from customer c, transaction t
where c.custcode = t.custcode
and c.custcode = "$mycustcode"
group by c.custcode;};
However if I change the code to be a bit more dynamic like the following:
In html.pl: # the following value (in the OPTION tag) will be submitted
to the query1_result.cgi.
while ($aref = $sth->fetchrow_arrayref){
print "<OPTION value=$aref->[0],>$aref->[1]: $aref->[2]</Option>\n";
}
In query1_result.cgi:
sub split_outlets_to_array
{
my ($s) = @_;
@outlets = split(',',$s);
return @outlets;
}
$outlet_str = $in{'outlets'}; # the outlets contains a list of custcodes
that seperated by comma.
@outlets_array = &split_outlets_to_array($outlet_str);
my $mycustcode = "$outlets_array[0]"; # but value of [1] and [2] can't
make the following SQL statement return a result.
$sql = qq {
select c.custcode, c.custname, c.type, sum(t.netsales) as sales
from customer c, transaction t
where c.custcode = t.custcode
and c.custcode = "$mycustcode"
group by c.custcode;};
Summary:
The problem with the second case is that outlets_array[0] does make the
SQL statement return result, but [1] and [2] does not.
With the first case (with hardcoded values), all elements of
outlets_array does make the SQL return result.
There may be problem in the code $in{'outlets'}. However from printing
each element of the array on the html page, I found nothing wrong with
the value, they are all printed in the following format on the html page:
outlets[0]: 07-6-0057
outlets[1]: 07-3-0051
outlets[2]: 07-2-0036
Unless the code of $in{} did something wrong behind the scene, I don't
know what caused this error when execute it with the SQL statement.
I tried to turn on warninig with -w, but not sure how to see them when
running in web browser.
Thanks
Jack
------------------------------
Date: Tue, 28 Dec 2004 22:58:30 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Hard coded vs. variable assignment using in SQL statement.
Message-Id: <EXpAd.27519$Tn1.975461@news20.bellglobal.com>
"Jack" <jack@swamc.com> wrote in message
news:cqt7h2$2lso$1@news.hgc.com.hk...
>
> I tried to turn on warninig with -w, but not sure how to see them when
> running in web browser.
>
Sorry, but your post is too convoluted for my poor brain at this hour. I
will just mention that you can resolve the above by adding:
use CGI::Carp qw/fatalsToBrowser warningsToBrowser/;
Matt
------------------------------
Date: Wed, 29 Dec 2004 12:49:11 +0800
From: Jack <jack@swamc.com>
Subject: Re: Hard coded vs. variable assignment using in SQL statement.
Message-Id: <cqtehu$2p9d$1@news.hgc.com.hk>
Jack wrote:
> Hi,
>
>
Sorry
> However, if I use the following hard coded assignment, the SQL statement
> returns result:
> # my $mycustcode = "07-2-0057";
>
> Here is the SQL statement for MySQL 5.0:
> $create_view_sql = qq {create view $viewtab as
> select c.custcode, c.custname, c.type, sum(t.netsales)
> as sales
> from customer c, transaction t
> where c.custcode = t.custcode
> and date(t.date) >= "$start_date"
> and date(t.date) <= "$end_date"
> and (c.type = "EXPORT" or c.type = "LOCAL")
> and (c.custcode = "$mycustcode")
> group by c.custcode;};
>
I just found that the value of $mycustcode contains a leading space,
thus sql failed to match the right record.
This also explained why the first element has no such problem.
Sorry for being so careless.
> Thanks
> Jack
------------------------------
Date: Tue, 28 Dec 2004 22:08:53 -0500
From: Bob Walton <see_sig@invalid>
Subject: Re: Help needed for perl rookie
Message-Id: <41d21f31_2@127.0.0.1>
GRLCOPM wrote:
>>From: Bob Walton <see_sig@invalid>
...
>>GRLCOPM wrote:
>>
>>
>>>I am new to perl, but so far have had decent success in writing/modifying
>>>code to do what I want to do. However I am stuck trying to modify the
>>>following code. I am sure the solution is quite simple, but I can't
>>>completely figure out what this piece of code does. I think it is just
>>>matching up a data pattern but this is an area I am unfamiliar with.
>>>
>>>All I want to do is change the format of the data file from example #1 to
>>>example #2 and need this section of code to work with the new format. I
>>>would be grateful for any help provided in understanding what this piece of
>>>code does and suggestions on the modification needed.
>>>
>>>If more information or a larger chunk of the code is needed please let me
>>>know and I will provide.
>>>
>>>EXAMPLE #1 - Current format of data file:
>>>0000000050 20041227 0000000003 'my-page.shtml'
>>>0000000054 20041227 0000000004 'another-page.shtml'
>>>0000000020 20041227 0000000003 'yet-another-page.shtml'
>>>
>>>EXAMPLE #2 - New format of data file:
>>>0000000050|20041227|0000000003|my-page.shtml
>>>0000000054|20041227|0000000004|another-page.shtml
>>>0000000020|20041227|0000000003|yet-another-page.shtml
>>
>>Your example #2 is in "pipe-delimited" form -- the best way to
>>split it apart is with the split() function, as in:
>>
>>($acc,$day,$dayacc,$uri)=split /\|/,$line;
>>
>>
>>
>>>if (($acc,$day,$dayacc,$uri) = ($line =~ /^(\d+) (\d+) (\d+) '(\S+)'$/)) {
>>
>>
>>--
>>Bob Walton
>>Email: http://bwalton.com/cgi-bin/emailbob.pl
>
>
> Thanks Bob,
>
> I am familiar with the split function and have been looking for a solution
> that utilizes it, but the line you provided does not seem to work as a
> replacement for the line I included. I have been looking through
Here is an example using split:
use warnings;
use strict;
while(my $line=<DATA>){
chomp $line; #remove newline at end of line
if(my($acc,$day,$dayacc,$uri)=split /\|/,$line){
print "acc=$acc\nday=$day\ndayacc=$dayacc\nuri=$uri\n";
}
}
__END__
0000000050|20041227|0000000003|my-page.shtml
0000000054|20041227|0000000004|another-page.shtml
0000000020|20041227|0000000003|yet-another-page.shtml
That generates:
D:\junk>perl junk510.pl
acc=0000000050
day=20041227
dayacc=0000000003
uri=my-page.shtml
acc=0000000054
day=20041227
dayacc=0000000004
uri=another-page.shtml
acc=0000000020
day=20041227
dayacc=0000000003
uri=yet-another-page.shtml
D:\junk>
which seems to me to be what you want. If that isn't what you
want, please describe in full detail exactly what it is you do
want. Note that your statement "does not seem to work" doesn't
convey much information. What *exactly* did it do that you
didn't want it to do? What didn't it do that you did want it to
do? Did it generate any error messages? If so, what *exactly*
(copy/pasted, not retyped) were they?
Also note the use of a simplified example code complete with data
(and lacking unrelated obfuscating details) that illustrates the
point and that anyone can copy/paste/execute. Providing such is
good form in this newsgroup.
> documentation including the references you provided, but I am still having a
> hard time with this. I guess what I am looking for is someone to break down
> what is happening in this line so that I can modify it to work as I need it
> to. Here is the section of code in question.
>
> &LockOpen (COUNT,"$AccessFile");
> $location = tell COUNT;
> while ($line = <COUNT>) {
> if (($acc,$day,$dayacc,$uri) = ($line =~ /^(\d+) (\d+) (\d+) '(\S+)'$/)) {
> if ($uri eq $doc_uri) {
> last;
> }
> }
> last if ($uri eq $doc_uri);
> $location = tell COUNT;
> $acc = 0;
> $dayacc = 0;
> }
>
> And here is the specific line:
>
> if (($acc,$day,$dayacc,$uri) = ($line =~ /^(\d+) (\d+) (\d+) '(\S+)'$/)) {
OK, in detail:
The if(expression){block} statement tests an expression (in this
case, the scalarized results of a list assignment [i.e., the
length of the list assignment] from a regular expression match)
for a true value, and if true, it executes the statements in the
block (in this case, another if statement). Otherwise it does
not execute them. In the case of a pattern match, it is a *very*
good idea to test for the success of the pattern match before
using the purported results, as you are doing in this if statement.
Now, the expression executed is:
($acc,$day,$dayacc,$uri)=($line=~/^(\d+) (\d+) (\d+) '(\S+)'$/)
The lefthand side of the = is a list of four lvalues, which
lvalues will be assigned to the first four list elements
generated by the right-hand side. The right-hand side is:
($line=~/^(\d+) (\d+) (\d+) '(\S+)'$/)
which has an unneeded set of parens around it, so:
$line=~/^(\d+) (\d+) (\d+) '(\S+)'$/
which is a pattern-matching statement. The left-hand side of the
=~ matching operator designates the source of the string to be
matched. The right-hand side starts with a / , which indicates
to Perl that it is a shortcut for the "m" operator using /'s as
delimiters. Between the matching /'s then is a regular
expression. This regular expression contains many metacharacters
(characters with special meaning inside regular expressions).
Specifically:
^ -> start the match with the first character of the string
(anchored match)
(\d+) -> a parenthesized group "captures" the portion of the
string matched by the contents of the parens. Each capture
generates another element in the list output by the pattern match
(so there will be a four-element list generated by this regexp if
it matches).
\d+ -> The + metacharacter means the regexp element
immediately to the left of the + is repeated one or more times.
So in this case, a "\d" will be repeated one or more times.
\d -> This is a shortcut code for "any digit" (or, in other
words, the character class [0-9]). It matches any single digit.
Thus, we see that \d+ matches any string of one or more digits.
And (\d+) captures that string of one or more digits on the
output list.
space character -> the space character is not a
metacharacter, and is matched literally. Since it is not inside
of capturing parenthesis, it is not output on the output list.
Three occurrences of "(\d+) " occur, which will match three
strings of digits followed by space characters, and capture the
three strings of digits in the output list.
' -> the apostrophe is not a metacharacter, so it is matched
literally. It is not captured.
(\S+) -> captures the results of \S repeated one or more
times. \S is a shortcut code for any non-whitespace character.
' -> is a literal apostrophe
$ -> anchors the trailing end of the match at the end of the
string. In other words, if the string isn't exhaused at the
point where the $ metacharacter occurs, the match will backtrack
and try an alternative or fail if the alternatives are exhausted.
By default, a trailing newline (like what you've got with your
data) is permitted on the end of the string -- the match will
succeed if everything up to the newline has been matched.
So in English, your regexp will match a string that starts with
three repititions of strings of digits followed by a single space
character followed by ' followed by any string of non-whitespace
characters followed by ' followed by the end of the string. The
three strings of digits and the string of non-whitespace
characters will be captured and, upon match success, will be
assigned as the output list of the =~ match operator (and also,
BTW, in special variables $1, $2, $3 and $4, plus various pieces
of the match may be assigned to other builtin variables such as
$', $`, $&, @+, @-, etc. See the docs for details, particularly
perldoc perlvar.
>
> It reads the data file that is in this format:
>
> EXAMPLE #1 - Current format of data file:
> 0000000050 20041227 0000000003 'my-page.shtml'
> 0000000054 20041227 0000000004 'another-page.shtml'
> 0000000020 20041227 0000000003 'yet-another-page.shtml'
>
> I need it to perform the same function on a data file in this format:
>
> EXAMPLE #2 - New format of data file:
> 0000000050|20041227|0000000003|my-page.shtml
> 0000000054|20041227|0000000004|another-page.shtml
> 0000000020|20041227|0000000003|yet-another-page.shtml
>
If you insist on a regexp to match the above, try:
if(($acc,$day,$dayacc,$uri)=
($line=~/^(\d+)\|(\d+)\|(\d+)\|(\S+)$/)) {
Note that | is a regexp metacharacter and thus literal instances
of it must be escaped with the \ metacharacter or equivalent.
> Based on the way this program works, my guess is that $uri is being compared
> with the data inside the quotes '(\S+)' taken from the current line of the
> data file. Right?
Yes, if the match succeeds.
>
> I appreciate your help and any further advice you or anyone else can offer.
My advice is: read and study the documentation that is already
on your computer. It is wonderful stuff, and is where all the
answers may be found. And found more quickly than asking on a
newsgroup, where folks are generally not too willing to
regurgitate the docs in specific detail.
>
> - Patrick
>
HTH.
--
Bob Walton
Email: http://bwalton.com/cgi-bin/emailbob.pl
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
------------------------------
Date: Wed, 29 Dec 2004 04:36:13 +0100
From: Bo Lindbergh <blgl@hagernas.com>
Subject: Re: how to delete files that create date <=20041210
Message-Id: <blgl-4245BA.04361129122004@news.bahnhof.se>
In article <vilain-FC3815.14475127122004@news.giganews.com>,
Michael Vilain <vilain@spamcop.net> wrote:
> Unix does not store the file's creation time.
So Mac OS X doesn't count as Unix? :-P
More accurately, traditional Unix filesystems don't store it, and thus
the stat system call doesn't return it.
/Bo Lindbergh
------------------------------
Date: Wed, 29 Dec 2004 03:06:04 +0100
From: Michael Mendelsohn <invalid@msgid.michael.mendelsohn.de>
Subject: Re: Is zero even or odd?
Message-Id: <41D2110C.AB2998F8@msgid.michael.mendelsohn.de>
John Fields schrieb:
> On Wed, 29 Dec 2004 01:06:32 +0100, Michael Mendelsohn
> <invalid@msgid.michael.mendelsohn.de> wrote:
>
> >John Fields schrieb:
> >> Ah, but :-) the normal order of precedence dictates that the
> >> multiplication be performed first, so my method first reduces k*0 to 0
> >> by virtue of the multiplication, then the division by zero is
> >> performed to yield the ratio of 1.
> >>
> >> (k*0) -> 0
> >> ------ --- = 1
> >> 0 -> 0
> >>
> >> Interestingly, your method also requires the quotient of 0/0 to be 1,
> >> otherwise the multiplication by k wouldn't yield k as the product!
> >
> >So (k*0)/0 is not equal to k*(0/0), then?
>
> ---
> Obviously, but no matter.
>
> Consider:
>
> If my point is that 0/0 = 1, and if k*(0/0)=k then 0/0 _must_ be
> equal to 1, otherwise k would not be equal to k.
No, that is circular reasoning:
"If 0/0 = 1 the 0/0 must be equal to 1".
If dividing by zero yields no result (i.e. it is undefined), then both
(k*0)/0 and k*(0/0) produce the same, i.e. they're both undefined.
> That, I believe,
> proves my point, my point being:
>
> x
> y = lim x->0 --- = 1
> x
> ---
>
> >What a pity!
> >To defend your point, you have to abandon the associative law of
> >multiplication.
>
> ---
> Not at all, since (k*0)/0 and k*(0/0) both [seem to] prove that
> 0/0 = 1.
But they're not equal any more,
and (a*b)/c = a*(b/c) by the associative law.
I am trying to show to you that _assuming_ 0/0=1 (to be 100% clear,
assuming that 0/0=1 is _always_ true) leads to you having to abandon the
generality of that law.
If by associative law, you find that (k*0)/0=k*(0/0), that proves that
0/0 can't be 1,
because the equation simplifies to 1=k.
So it's either that law or 0/0=1, but not both.
Cheers
Michael
--
Still an attentive ear he lent Her speech hath caused this pain
But could not fathom what she meant Easier I count it to explain
She was not deep, nor eloquent. The jargon of the howling main
-- from Lewis Carroll: The Three Usenet Trolls
------------------------------
Date: Wed, 29 Dec 2004 02:58:46 +0000 (UTC)
From: George Cox <george_coxanti@spambtinternet.com.invalid>
Subject: Re: Is zero even or odd?
Message-Id: <41D21D6B.3993FE0C@spambtinternet.com.invalid>
John Fields wrote:
>
> Then what would be the proper way to write it, please?
Write what? That 1/x gets big as x gets small?
1/x -> +infinity as x -> +0
1/x -> -infinity as x -> -0.
------------------------------
Date: Wed, 29 Dec 2004 03:03:12 +0000 (UTC)
From: George Cox <george_coxanti@spambtinternet.com.invalid>
Subject: Re: Is zero even or odd?
Message-Id: <41D21E75.604053C6@spambtinternet.com.invalid>
John Fields wrote:
>
> If my point is that 0/0 = 1, and if k*(0/0)=k then 0/0 _must_ be
> equal to 1, otherwise k would not be equal to k. That, I believe,
> proves my point, my point being:
>
> x
> y = lim x->0 --- = 1
> x
This is true, but it is true because
x
y = lim x->0 --- = lim x->0 1 = 1.
x
The "1" on the left of the equals sign is there because the two x's
cancelled.
It is not always the case that
lim x -> A f(x) = f(A).
So the true statement
x
y = lim x->0 --- = 1
x
does not allow you to conclude that 0/0 = 1.
------------------------------
Date: Tue, 28 Dec 2004 22:49:39 -0500
From: keith <krw@att.bizzzz>
Subject: Re: Is zero even or odd?
Message-Id: <pan.2004.12.29.03.49.34.584228@att.bizzzz>
On Tue, 28 Dec 2004 20:59:47 +0000, Dave Seaman wrote:
> On Tue, 28 Dec 2004 15:32:56 -0500, Keith Williams wrote:
>> In article <cqsf31$opr$1@mailhub227.itcs.purdue.edu>,
>> dseaman@no.such.host says...
>>> On Tue, 28 Dec 2004 14:15:14 -0500, Keith Williams wrote:
>>> > In article <cqs4v5$j1c$1@mailhub227.itcs.purdue.edu>,
>>> > dseaman@no.such.host says...
>>> >> On Tue, 28 Dec 2004 11:31:17 -0500, Keith Williams wrote:
>>> >> > In article <cqs0gk$gpp$1@mailhub227.itcs.purdue.edu>,
>>> >> > dseaman@no.such.host says...
>>> >> >> >>
>>> >> >> >>> Well, 0^0 is a mess. But lim x->0 0^x is well defined.
>>> >> >> >>
>>> >> >> >>No, it isn't. That limit does not exist.
>>> >> >>
>>> >> >> > Most certainly does. It's zero.
>>> >> >>
>>> >> >> Wrong. That limit cannot exist because 0^x is undefined for all x < 0.
>>> >>
>>> >> > "lim x->0 0^x "
>>> >>
>>> >> > Where is X < 0 in the above?
>>> >>
>>> >> Look up the definition of limit. Notice that "limit" in the reals means
>>> >> "two-sided limit." In particular, that means the left-hand and
>>> >> right-hand limits must both exist, and must agree.
>>>
>>> > Ah, so the lim x->oo 1/x is?
>>>
>>> Doesn't exist, because the one-sided limits don't agree.
>
>> Well, that wipes out all the math I ever learned. I guess all that calc
>> I took in college was for naught.
>
> Did those calc courses teach you that there is a +infinity and a
> -infinity?
Of course. We had no issues with discontinuities either.
>
>> Lemme guess... You're a math type posting from sci.math.
>
> Correct. And I used to teach calculus around 30 years ago.
That's about when I took it. (actually 33 years).
> But there is a way to say the limit exists. You have to work with the
> one-point compactification of the reals instead of the two-point
> compactification that is commonly taught in calculus courses. That means
> you have just a single infinity, instead of a +infinity and a -infinity.
Which makes no practical sense. Engineers like the practical, even though
it's infinite. ;-)
--
Keith
------------------------------
Date: Tue, 28 Dec 2004 21:57:09 -0600
From: John Fields <jfields@austininstruments.com>
Subject: Re: Is zero even or odd?
Message-Id: <r984t09csj6s1ksek81lcij9g5695uv6pd@4ax.com>
On Wed, 29 Dec 2004 03:03:12 +0000 (UTC), George Cox
<george_coxanti@spambtinternet.com.invalid> wrote:
>John Fields wrote:
>>
>> If my point is that 0/0 = 1, and if k*(0/0)=k then 0/0 _must_ be
>> equal to 1, otherwise k would not be equal to k. That, I believe,
>> proves my point, my point being:
>>
>> x
>> y = lim x->0 --- = 1
>> x
>
>This is true, but it is true because
>
> x
> y = lim x->0 --- = lim x->0 1 = 1.
> x
>
>The "1" on the left of the equals sign is there because the two x's
>cancelled.
>
>It is not always the case that
>
> lim x -> A f(x) = f(A).
>
>So the true statement
>
> x
> y = lim x->0 --- = 1
> x
>
>does not allow you to conclude that 0/0 = 1.
But _does_ allow me to conclude that any other number, no matter how
small, and no matter what its sign will, when divided by itself, give
a quotient of 1?
OK, look at it this way:
These two number lines are behind a screen, so the numbers can't be
seen, but arranged in such a way that when a number is picked from
one, the same number will be picked from the other and those two
numbers will be divided and the quotient presented for viewing.
-1 0 1
-|-------------------------|-------------------------|-
-1 0 1
-|-------------------------|-------------------------|-
I fail to see why, at one infinitesimal spot on the line(s), the
division becomes intractable and the machine refuses to output a 1.
--
John Fields
------------------------------
Date: Tue, 28 Dec 2004 22:12:09 -0600
From: John Fields <jfields@austininstruments.com>
Subject: Re: Is zero even or odd?
Message-Id: <rgb4t0h1qp1kntcsgab7qdonfdekddla05@4ax.com>
On Wed, 29 Dec 2004 03:03:12 +0000 (UTC), George Cox
<george_coxanti@spambtinternet.com.invalid> wrote:
>John Fields wrote:
>>
>> If my point is that 0/0 = 1, and if k*(0/0)=k then 0/0 _must_ be
>> equal to 1, otherwise k would not be equal to k. That, I believe,
>> proves my point, my point being:
>>
>> x
>> y = lim x->0 --- = 1
>> x
>
>This is true, but it is true because
>
> x
> y = lim x->0 --- = lim x->0 1 = 1.
> x
>
>The "1" on the left of the equals sign is there because the two x's
>cancelled.
---
And if those x's were zeroes when they were cancelled, that still
results in a quotient of 1, so 0/0 = 1
---
>
>It is not always the case that
>
> lim x -> A f(x) = f(A).
>
>So the true statement
>
> x
> y = lim x->0 --- = 1
> x
>
>does not allow you to conclude that 0/0 = 1.
---
It does if the case where X = 0 can result in a cancellation because
the numerator and denominator were equal and a quotient of 1 resulted
because of that cancellation.
--
John Fields
------------------------------
Date: Tue, 28 Dec 2004 22:59:57 -0600
From: "ISU WINS!" <godbless@isu.com>
Subject: Re: Is zero even or odd?
Message-Id: <41D239CD.AA69FD34@isu.com>
"Vince Fiscus, KB7ADL" wrote:
> Gactimus <gactimus@xrs.net> wrote in news:10sdnunotbnere2@corp.supernews.com:
>
> > I know 0 is neither negative or positive but what about odd/even? I think
> > it's even.
> >
> > Odd numbers start at 1 and go every other number 1,3,5,7;1,-1,-3,-5,-7
> > Even starts at 2 and go every other number 2,4,6,8;2,0,-2,-4,-6,-8
>
> An even number plus an even number equals an even number.
>
> An odd number plus an even number equals an odd number.
>
> An odd number plus an odd number equals an even number.
>
> 0 + 1 = odd number
>
> 0 + 2 = even number, 2 is not odd, so zero must be even.
>
> KB7ADL
Dont ever say "must". Thatw as inthe Novice exam!
------------------------------
Date: Wed, 29 Dec 2004 03:21:10 GMT
From: Gerald Meazell <gmeazell@swbell.net>
Subject: Newbie question on require and semaphores
Message-Id: <GopAd.3767$F67.2844@newssvr12.news.prodigy.com>
I'm trying to do some semaphore programming but when I put in the line
'require "ipc.ph"', perl whines that ipc.ph cannot be found in @INC. It
then goes on to list out the @INC directories. Sure enough, ipc.ph
isn't in any of them, but it is in some subdirectories of the ones in
@INC.
I tried copying the files up one level but that did not work due to a
compilation error.
What do I need to do to get this working? I'm using RedHat.
Thanks!
--
Gerald
------------------------------
Date: Tue, 28 Dec 2004 22:45:22 -0500
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: Newbie question on require and semaphores
Message-Id: <lLpAd.27384$Tn1.970880@news20.bellglobal.com>
"Gerald Meazell" <gmeazell@swbell.net> wrote in message
news:GopAd.3767$F67.2844@newssvr12.news.prodigy.com...
> I'm trying to do some semaphore programming but when I put in the line
> 'require "ipc.ph"', perl whines that ipc.ph cannot be found in @INC. It
> then goes on to list out the @INC directories. Sure enough, ipc.ph isn't
> in any of them, but it is in some subdirectories of the ones in @INC.
>
> I tried copying the files up one level but that did not work due to a
> compilation error.
>
> What do I need to do to get this working?
>
I would imagine specify the path to the file:
use lib '/path/to/header/file';
require 'ipc.ph';
or
require '/path/to/header/file/ipc.ph';
Whatever compilation problems you're having likely have nothing to do with
requiring the ph file, though, and everything to do with the code in that
file. Without a specific error message and code, however, it's hard to say
anything more useful than that.
Matt
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 7590
***************************************