[25324] in Perl-Users-Digest
Perl-Users Digest, Issue: 7569 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 24 14:05:28 2004
Date: Fri, 24 Dec 2004 11: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 Fri, 24 Dec 2004 Volume: 10 Number: 7569
Today's topics:
Re: hashref strange side effects <cal@not.splitreflection.com>
Re: Is zero even or odd? <a.newmane.remove@eastcoastcz.com>
Re: Is zero even or odd? <a.newmane.remove@eastcoastcz.com>
Re: Is zero even or odd? <nospam@nospam.com>
Re: Is zero even or odd? <jfields@austininstruments.com>
Re: Is zero even or odd? <torkel@sm.luth.se>
Re: Is zero even or odd? <nospam@nospam.com>
Re: Is zero even or odd? <nospam@nospam.com>
Re: Is zero even or odd? <torkel@sm.luth.se>
Re: Is zero even or odd? <see@sig.com>
Re: Is zero even or odd? <see@sig.com>
Re: Is zero even or odd? <jmw@jmwa.demon.contraspam.yuk>
Perlesque sqlREST? jim_bowery@hotmail.com
Re: Saving regex to new variable <toddrw69@excite.com>
Re: Some Programing Needed bigmur77@hotmail.com
Re: WWW:Search::Ebay not working? <lance-news@augustmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 24 Dec 2004 09:49:55 -0800
From: penguinista <cal@not.splitreflection.com>
Subject: Re: hashref strange side effects
Message-Id: <41cc56c1$0$19028$d368eab@news.calweb.com>
Anno Siegel wrote:
> penguinista <cal@not.splitreflection.com> wrote in comp.lang.perl.misc:
>
>># load a map into memory
>>sub readmap
>>{ my ($map, $file) = @_; # $map is a hashref here
>> my ($line, $type, $name);
>> return if eof $file;
>> $line = <$file>;
>> chomp $line;
>> if ($line =~ /\{\s*(\w+)\s+(\w+)/)
>> { $type = $1; $name = $2;
>> if (!defined($map->{$name}))
>> { $map->{$name} = {'parent'=>$map, 'name'=>$name, 'type'=>$type}; }
>> &readmap($map->{$name}, $file);
>> }
>> elsif ( $line =~ /(\w+)=(.+)/ )
>> { $map->{$1} = $2; # this sets field value, then shoots off to garbage
>> }
>> elsif ($line =~ /\}/)
>> { return; }
>> else {}; # error
>>}
>>
>>It the above subroutine, the line $map->{$1} = $2 assigns key+value into
>>the hash as expected, then shoots off to a sub DESTROY {} in package
>>IO::Handle; before returning to my code after the call to the subroutine
>>that first calls recursive routine readmap. $1 = 'val', $2 = '"Login"'
>>
>>running perl 5.8.5 in cygwin.
>>
>>any ideas?
>
>
> Presumably the file handle in $file goes out of scope on return from
> that call. The line you mention just happens to be the last line
> executed in the sub. There's nothing mysterious about it. Why is
> it bothering you?
>
> Anno
I'm used to the debugger showing the return from subroutine. I guess
it's a C vs. perl in debugger thing.
------------------------------
Date: Fri, 24 Dec 2004 08:08:19 -0800
From: "Alfred Z. Newmane" <a.newmane.remove@eastcoastcz.com>
Subject: Re: Is zero even or odd?
Message-Id: <332t5mF3roamjU1@individual.net>
Gordon Weast wrote:
> Alfred Z. Newmane wrote:
>>
>>
>> oo (infinity isn't a number) so you cannot use it this way.
>>
>>
>
> Well, if you move out of pure math into something more applied,
> like physics or signal processing, you find a nice little thing
> called the Dirac delta function. This seems to have confounded
> mathemeticians for a while before they finally came around and
> decided that it really does work.
>
> This wonderful function has infinite height and zero width, yet
> it has area 1. Granted, you can work with a limit as the width
> goes to 0, but you don't have to.
>
> Think Fourier series and Fourier analysis. These wouldn't work
> without the Dirac delta function.
>
> A wonderful example of 0 * oo = 1.
Except for the fact it doesn't follow the basic mathematic principal of
0 * n = 0 (anything times zero is zero.) Infinity is undefined. Perhaps
I'm missing something here but how exactly do they get 1 from that?
------------------------------
Date: Fri, 24 Dec 2004 08:18:41 -0800
From: "Alfred Z. Newmane" <a.newmane.remove@eastcoastcz.com>
Subject: Re: Is zero even or odd?
Message-Id: <332tp5F3spfe5U1@individual.net>
John Savard wrote:
> On Wed, 22 Dec 2004 01:56:47 GMT, "Nicholas O. Lindan" <see@sig.com>
> wrote, in part:
>
>> Slightly OT, is there an accepted ASCII-gram for square root?
>
> Here's an example of how I draw equations in ASCII art.
>
> _
> / theta / psi pi \ / psi pi \
> | sin | ----- + --- | + cos | ----- + --- |
> | \ 2 4 / \ 2 4 /
> | ------------------------------------------------- , d psi
> | ____________________________
> | / 2 / psi pi \
> | / 1 + tan | ----- - --- |
> _/ 0 \/ \ 2 4 /
^^^
What's this zero supposed to represent? The "zero" root? Isn't that
dividing by zero?
n^0 = 1; zeroroot(n) = undefined
What it really comes down to is this:
If
sqrt(4) = 2
can be written as
4^(1/2) = 2,
then
zeroroot(n) = undefined
can be written as
n^(1/0) = undefined,
can it not?
------------------------------
Date: Fri, 24 Dec 2004 16:44:34 GMT
From: Fred Bloggs <nospam@nospam.com>
Subject: Re: Is zero even or odd?
Message-Id: <41CC471C.30704@nospam.com>
Torkel Franzen wrote:
> Fred Bloggs <nospam@nospam.com> writes:
>
>
>>See:
>>
>>Cohen,P.J., "The Independence of the Continuum Hypothesis." Proc. Nat.
>>Acad. Sci. U.S.A. 50 1143-148, 1963.
>
>
> The independence of the continuum hypothesis has no apparent
> relation to your statement.
> Note that the axiom of choice does not
> imply the continuum hypothesis.
Right- Cohen's result showed that /CH is compatible with ZFC, and
apparently Godel showed CH is compatible (no contradiction) with ZFC,
making CH undecidable.
> The generalized continuum hypothesis
> does imply the axiom of choice.
Wouldn't that contradict Cohen? I see that ZF + GCH-> CH, and now you
say ZF + GCH -> Axiom of Choice, when Cohen showed /CH + ZFC leads to no
contradiction. Certainly /CH-> /GCH under ZFC.
------------------------------
Date: Fri, 24 Dec 2004 10:52:34 -0600
From: John Fields <jfields@austininstruments.com>
Subject: Re: Is zero even or odd?
Message-Id: <52hos0pf0aqj6ta5fsdg0qbsnobh3vr1aa@4ax.com>
On Fri, 24 Dec 2004 15:11:23 GMT, vonroach <hadrainc@earthlink.net>
wrote:
>On Thu, 23 Dec 2004 16:16:15 -0600, John Fields
><jfields@austininstruments.com> wrote:
>
>>In truth, the E in
>>
>> E
>> R = ---
>> I
>>
>>refers to the voltage _across_ the resistor, (a shunt, was it?) which
>>you didn't measure. What you measured was the voltage from the low
>>side of where the resistor was supposed to be to ground, which gave
>>you zero volts which corresponded, also, to zero amps. Had you
>>measured the voltage _across_ where the resistor was supposed to be
>>you would have measured the entire supply voltage minus what was being
>>dropped across the load by the current flowing through the meter and
>>you would have concluded that by subtracting the meter current that
>>you would have had:
>>
>> E E
>> R = --- = --- = oo
>> I 0
>>
>>Which would have been right!
>>
>There you go spoiling the fun by really measuring something.
---
Well... Not _really_, it's just a thought measurement.
---
>But can resistance ever be infinite?
---
Yes, but there has to be a time (a delta t, actually) associated with
the measurement since the resistance is determined by the voltage
across the resistance and the number of charges entering and exiting
the resistance in a given amount of time. For example, with one volt
across the resistance, if one coulomb of charge (6.2E18 electrons) is
injected into the resistance and one coulomb of charge is ejected from
the resistance in one second, that resistance is defined as one ohm.
However, if zero charges manage to make it through in one second, then
the resistance of the resistor will have been infinite for that time.
---
>Is it truly 0 even at absolute 0 temp or
>there about?
---
For some materials, yes. For others, I think, no.
---
>Is there no limit on the accuracy of the equipment used
>to measure it?
---
Yes, there is.
---
>I hesitate to add, making the instrument `infinitely'
>accurate?
---
I see you didn't hesitate for _too_ long... ;)
--
John Fields
------------------------------
Date: 24 Dec 2004 17:53:27 +0100
From: Torkel Franzen <torkel@sm.luth.se>
Subject: Re: Is zero even or odd?
Message-Id: <vcbhdmb63js.fsf@beta19.sm.ltu.se>
Fred Bloggs <nospam@nospam.com> writes:
> Wouldn't that contradict Cohen? I see that ZF + GCH-> CH, and now you
> say ZF + GCH -> Axiom of Choice, when Cohen showed /CH + ZFC leads to no
> contradiction.
That ZF+GCH |- AC does not imply that ZF+AC |- GCH.
------------------------------
Date: Fri, 24 Dec 2004 17:06:58 GMT
From: Fred Bloggs <nospam@nospam.com>
Subject: Re: Is zero even or odd?
Message-Id: <41CC4C5B.4050900@nospam.com>
Torkel Franzen wrote:
> Fred Bloggs <nospam@nospam.com> writes:
>
>
>>Wouldn't that contradict Cohen? I see that ZF + GCH-> CH, and now you
>>say ZF + GCH -> Axiom of Choice, when Cohen showed /CH + ZFC leads to no
>>contradiction.
>
>
> That ZF+GCH |- AC does not imply that ZF+AC |- GCH.
>
Right- but ZF + GCH-> AC does mean you now have ZFC, and ZFC+/CH->/CH by
Cohen, so you can't have ZF + GCH-> CH any more. I am assuming that that
(ZF + GCH -> CH)->( ZFC + GCH ->CH), and maybe that's where I'm going wrong.
------------------------------
Date: Fri, 24 Dec 2004 17:18:57 GMT
From: Fred Bloggs <nospam@nospam.com>
Subject: Re: Is zero even or odd?
Message-Id: <41CC4F79.3030700@nospam.com>
Alfred Z. Newmane wrote:
> John Savard wrote:
>
>>On Wed, 22 Dec 2004 01:56:47 GMT, "Nicholas O. Lindan" <see@sig.com>
>>wrote, in part:
>>
>>
>>>Slightly OT, is there an accepted ASCII-gram for square root?
>>
>>Here's an example of how I draw equations in ASCII art.
>>
>> _
>> / theta / psi pi \ / psi pi \
>> | sin | ----- + --- | + cos | ----- + --- |
>> | \ 2 4 / \ 2 4 /
>> | ------------------------------------------------- , d psi
>> | ____________________________
>> | / 2 / psi pi \
>> | / 1 + tan | ----- - --- |
>>_/ 0 \/ \ 2 4 /
>
>
> ^^^
>
> What's this zero supposed to represent? The "zero" root? Isn't that
> dividing by zero?
It's the lower limit of integration. It's a definite integral between 0
and theta.
------------------------------
Date: 24 Dec 2004 18:45:16 +0100
From: Torkel Franzen <torkel@sm.luth.se>
Subject: Re: Is zero even or odd?
Message-Id: <vcbfz1v615f.fsf@beta19.sm.ltu.se>
Fred Bloggs <nospam@nospam.com> writes:
> Right- but ZF + GCH-> AC does mean you now have ZFC, and ZFC+/CH->/CH by
> Cohen, so you can't have ZF + GCH-> CH any more.
"ZFC+/CH->/CH" is not what you meant to write, surely? Anyway, both CH
and not-CH are compatible with ZFC.
------------------------------
Date: Fri, 24 Dec 2004 18:17:17 GMT
From: "Nicholas O. Lindan" <see@sig.com>
Subject: Re: Is zero even or odd?
Message-Id: <N2Zyd.12188$Z47.3846@newsread2.news.atl.earthlink.net>
"Dave Seaman" <dseaman@no.such.host> wrote
> Perhaps I should have said that the Continuum Hypothesis (CH) is the
> "hypothesis" (rather than the "proposition") that c = aleph_1. The final
> clause says that CH is neither provable nor disprovable; that's what
> "independent of the axioms" means.
Agreed, figured out what I thought you meant, and I think that is what
you thought you meant.
In the original it was hard to tell assertions from negations from
perambulations. It seemed to negate an assertion then assert the first
assertion and conclude that nothing could be asserted or negated.
Did I get that right?
--
Nicholas O. Lindan, Cleveland, Ohio
Consulting Engineer: Electronics; Informatics; Photonics.
Remove spaces etc. to reply: n o lindan at net com dot com
psst.. want to buy an f-stop timer? nolindan.com/da/fstop/
------------------------------
Date: Fri, 24 Dec 2004 18:22:05 GMT
From: "Nicholas O. Lindan" <see@sig.com>
Subject: Re: Is zero even or odd?
Message-Id: <h7Zyd.12190$Z47.8208@newsread2.news.atl.earthlink.net>
"Alfred Z. Newmane" <a.newmane.remove@eastcoastcz.com> wrote
> > > j [sqrt(-1)] isn't a number but we still mix it up with numbers.
> > Of course it is a number, thats why we treat it as such.
> Ok what it's value then?
I'm still waiting for a jpeg of quantity sqrt(-1) apples.
I confess my imagination does not stretch this far.
--
Nicholas O. Lindan, Cleveland, Ohio
Consulting Engineer: Electronics; Informatics; Photonics.
Remove spaces etc. to reply: n o lindan at net com dot com
psst.. want to buy an f-stop timer? nolindan.com/da/fstop/
------------------------------
Date: Fri, 24 Dec 2004 18:54:36 +0000
From: John Woodgate <jmw@jmwa.demon.contraspam.yuk>
Subject: Re: Is zero even or odd?
Message-Id: <TUNRjIAsXGzBFwlo@jmwa.demon.co.uk>
I read in sci.electronics.design that Nicholas O. Lindan <see@sig.com>
wrote (in <h7Zyd.12190$Z47.8208@newsread2.news.atl.earthlink.net>) about
'Is zero even or odd?', on Fri, 24 Dec 2004:
>"Alfred Z. Newmane" <a.newmane.remove@eastcoastcz.com> wrote
>> > > j [sqrt(-1)] isn't a number but we still mix it up with numbers.
>> > Of course it is a number, thats why we treat it as such.
>> Ok what it's value then?
>
>I'm still waiting for a jpeg of quantity sqrt(-1) apples. I confess my
>imagination do
It seems to me that when you have embraced the concept of -1 apples, the
next step (or half-step back) to j apples, is not so difficult.
Of course, those of us on s.e.d experience the properties of complex
numbers almost every day. Others may not.
--
Regards, John Woodgate, OOO - Own Opinions Only.
The good news is that nothing is compulsory.
The bad news is that everything is prohibited.
http://www.jmwa.demon.co.uk Also see http://www.isce.org.uk
------------------------------
Date: 24 Dec 2004 09:42:40 -0800
From: jim_bowery@hotmail.com
Subject: Perlesque sqlREST?
Message-Id: <1103910160.794341.131280@z14g2000cwz.googlegroups.com>
Is there a Perl implementation of something like sqlREST?
"This guide shows, how relational databases can be enabled as REST
style Web Service within minutes."
http://sqlrest.sourceforge.net/5-minutes-guide.htm
------------------------------
Date: Fri, 24 Dec 2004 18:13:28 GMT
From: "Todd W" <toddrw69@excite.com>
Subject: Re: Saving regex to new variable
Message-Id: <c%Yyd.3260$oR4.1323@newssvr31.news.prodigy.com>
"Lance Hoffmeyer" <lance-news@augustmail.com> wrote in message
news:pan.2004.12.23.18.18.35.872153@augustmail.com...
> Hello all,
>
> Been a while since I have worked the perl in this manner.
>
> I am trying to save a regex as a new variable "$month".
> It is a regex that takes a date (2004-12-23) and saves
> only the month from this date. Can't seem to remember
> how to do this.
>
>
> while (my @row_ary = $sth->fetchrow_array)
> {
>
> ($month) => $row_ary[2] =~ s/([0-9]+)\-([0-9]+)\-([0-9]+)/$2/;
> print $month;
> }
>
use Time::Piece::mysql;
while (my @row_ary = $sth->fetchrow_array) {
my $date = Time::Piece->from_mysql_date( $row_ary[2] );
print $date->mon, "\n";
}
------------------------------
Date: 24 Dec 2004 09:45:36 -0800
From: bigmur77@hotmail.com
Subject: Re: Some Programing Needed
Message-Id: <1103910336.198586.168740@f14g2000cwb.googlegroups.com>
Joe Smith wrote:
> Murray J wrote:
> > I would like to capture the co-ordinates of
> > the mouse at the instant when it is clicked on the first image,
>
> Read up on HTML documentation on the ISMAP attribute of <IMG>.
> <a href="xy.cgi"><img src="first-image.png" ismap></a>
ISMAP sends the co-ordinates to some program on a server.????
>
> > apply some mathematics based on which 'hot spot' was clicked, and
come
> > up with a new set of co-ordinates.
>
> That's pretty trivial. What have you tried?
Trivial only to those who know the answer.
>
> > When the destination page is opened, I would like the viewport to
be
> > at those new co-ordinates on the 3200px X 2560px image on the page.
>
> What's a viewport?
Screen 800 X 600
Image 3200 X 2560
Viewport - that 800 X 600 window I look through.
Whatever it is, it needs to work with Opera,
> Safari, and Netscape/Mozilla/Firefox.
> -Joe
-BigMur
------------------------------
Date: Fri, 24 Dec 2004 11:51:49 -0600
From: Lance Hoffmeyer <lance-news@augustmail.com>
Subject: Re: WWW:Search::Ebay not working?
Message-Id: <pan.2004.12.24.17.51.49.975885@augustmail.com>
On Thu, 23 Dec 2004 18:57:38 -0600, Lance Hoffmeyer wrote:
Ebay searching doesn't appear to be worknig anymore.
I search on Ebay brings up at least 10 items. This
script does not print out any results and I was expecting
at least 10 urls.
use WWW::Search;
my $oSearch = new WWW::Search('Ebay');
my $sQuery = WWW::Search::escape_query("Elton John MFSL");
$oSearch->native_query($sQuery);
while (my $oResult = $oSearch->next_result())
{ print $oResult->title, "\n";
print $oResult->url, "\n";
}
Lance
------------------------------
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 7569
***************************************