[26201] in Perl-Users-Digest
Perl-Users Digest, Issue: 8388 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 4 18:05:38 2005
Date: Sun, 4 Sep 2005 15:05:04 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 4 Sep 2005 Volume: 10 Number: 8388
Today's topics:
Re: Can I Get The PID Of The Program That Launched My P <hal@thresholddigital.com>
Re: Can I Get The PID Of The Program That Launched My P <my.address.is@chris.at.lowth.dot.com>
Re: Can I Get The PID Of The Program That Launched My P <hal@thresholddigital.com>
Re: Can I Get The PID Of The Program That Launched My P <pseudo@codernet.net>
GETTING SICK OF ALL THOSE FAKE MONEY-MAKING-PROGRAMMES? (brianwel)
Re: Looking for Equation Solver <kkeller-usenet@wombat.san-francisco.ca.us>
Re: Looking for Equation Solver <ignoramus14363@NOSPAM.14363.invalid>
Re: Looking for Equation Solver <BZ@caradhras.net>
Re: Looking for Equation Solver <daveandniki@ntlworld.com>
Re: New Script Directory needs your scripts listed <notvalid@email.com>
OT: Re: Looking for Equation Solver <daveandniki@ntlworld.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 04 Sep 2005 00:56:43 -0400
From: Hal Vaughan <hal@thresholddigital.com>
Subject: Re: Can I Get The PID Of The Program That Launched My Program?
Message-Id: <oMmdnaYE-OoW44feRVn-1A@comcast.com>
Tad McClellan wrote:
> jim <jim22@trlp.com> wrote:
>> On Sat, 03 Sep 2005 15:43:28 -0400, Hal Vaughan wrote:
>>
>>> I'm working on Linux. I have some Perl programs that launch a program
>>> by
>>> just putting the command line in backticks. So if program A launches
>>> program B this way, is there any way for program B to get the PID of
>>> program A?
>
>> Linux provide getppid(2) which gets the parent process ID. Perl supports
>> getppid().
>
>
> Which will probably return the PID of the shell that the
> backticks started rather than the PID of program A.
I tested it. When I start the program from a console window, it gives me
the PID of the console. When I start program B from program A with
backticks, it gives me the PID of program A.
I did notice, though, that the PID for program B was always at least 2
higher than program A. If A's PID was 2257, B's was 2259.
Hal
------------------------------
Date: Sun, 04 Sep 2005 13:08:33 GMT
From: Chris Lowth <my.address.is@chris.at.lowth.dot.com>
Subject: Re: Can I Get The PID Of The Program That Launched My Program?
Message-Id: <llCSe.2155$zw1.1579@newsfe2-gui.ntli.net>
Hal Vaughan wrote:
> I did notice, though, that the PID for program B was always at least 2
> higher than program A. If A's PID was 2257, B's was 2259.
This behaviour is not something you can rely on. Sometimes the PID of B
will be less than that of A, and sometimes the gap will be greater or
smaller.
--
Linux plus iptables plus Rope = control of high-level protocols
including p2p: bittorrent, kademlia, gnutella, edonkey..
http://www.lowth.com/rope
------------------------------
Date: Sun, 04 Sep 2005 11:55:06 -0400
From: Hal Vaughan <hal@thresholddigital.com>
Subject: Re: Can I Get The PID Of The Program That Launched My Program?
Message-Id: <V4mdnSWRKsVHhYbeRVn-gQ@comcast.com>
Chris Lowth wrote:
> Hal Vaughan wrote:
>> I did notice, though, that the PID for program B was always at least 2
>> higher than program A. If A's PID was 2257, B's was 2259.
>
> This behaviour is not something you can rely on. Sometimes the PID of B
> will be less than that of A, and sometimes the gap will be greater or
> smaller.
I'm not counting on that. Actually, in some tests I ran, B was 5-8 PID
numbers higher than A, which I figure was because of other programs working
in the background, for example, I had several loops running in other bash
shells that would reprint info every X seconds. And, yes, if A has a high
enough PID, then B's will be back at the bottom of the list.
My implication was that there was at least one process that was launched and
given a PID between A and B.
Hal
P.S. What I'm more concerned is that, after months of overwork, my brain is
so fried that when I pick a random number out of my head, it turns out to
be an obscure science fiction reference connected to Saucer C57D. Am I so
exhausted my brain is retreating into all the old sf films I watched
growing up? -- and even more so is that I notice it when re-reading my
post!
------------------------------
Date: Sun, 04 Sep 2005 12:11:22 -0500
From: Willie Wilson <pseudo@codernet.net>
Subject: Re: Can I Get The PID Of The Program That Launched My Program?
Message-Id: <1125854034_2060@spool6-east.superfeed.net>
Chris Lowth wrote:
> Hal Vaughan wrote:
>
>> I did notice, though, that the PID for program B was always at least 2
>> higher than program A. If A's PID was 2257, B's was 2259.
>
>
> This behaviour is not something you can rely on. Sometimes the PID of B
> will be less than that of A, and sometimes the gap will be greater or
> smaller.
>
> --
> Linux plus iptables plus Rope = control of high-level protocols
> including p2p: bittorrent, kademlia, gnutella, edonkey..
> http://www.lowth.com/rope
This behavior is especially unreliable because you never know if the
user will be using something like grsecurity (or SELinux), where PIDs
can be randomized, and not predictable. :-)
-Willie
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
------------------------------
Date: Sun, 04 Sep 2005 19:00:30 GMT
From: thafrummel_at_hotmail_dot_com@foo.com (brianwel)
Subject: GETTING SICK OF ALL THOSE FAKE MONEY-MAKING-PROGRAMMES????
Message-Id: <ivHSe.66657$cv3.29689@fe12.news.easynews.com>
-------------------------------------
Look at this, it's the only safe and real money making programme.
You can use your Paypal, Egold or Stormpay account.
You can contact them for questions and they will do all the work for you!
Go to this page:
http://dollarsblaster.com/userindex.asp?userid=26028
--
##-----------------------------------------------##
Article posted with Web Developer's USENET Archive
http://www.1-script.com/forums
no-spam read and post WWW interface to your favorite newsgroup -
comp.lang.perl.misc - 36723 messages and counting!
##-----------------------------------------------##
------------------------------
Date: Sat, 3 Sep 2005 22:47:50 -0700
From: Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>
Subject: Re: Looking for Equation Solver
Message-Id: <6dequ2x0up.ln2@goaway.wombat.san-francisco.ca.us>
On 2005-09-03, Ignoramus14363 <ignoramus14363@NOSPAM.14363.invalid> wrote:
>
> On 03 Sep 2005 22:51:13 GMT, xhoster@gmail.com <xhoster@gmail.com> wrote:
>>
>> Also, it doesn't give the right answer.
>>
>> "Text form: ((x^2-6x+9)/(x^2-3x-10))/((x^2-5x+6)/(x^2-8x+15)) simplifies to
>> (x-3)/(x+2)"
>>
>> No, it doesn't.
>
> I will appreciate corrections and suggestions. What's the right answer
> there?
If you can't figure it out on paper, why are you writing a program to do
it? Sheesh, I might as well go write an OS! :-\
--keith
--
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://wombat.san-francisco.ca.us/cgi-bin/fom
see X- headers for PGP signature information
------------------------------
Date: Sun, 04 Sep 2005 06:10:15 GMT
From: Ignoramus14363 <ignoramus14363@NOSPAM.14363.invalid>
Subject: Re: Looking for Equation Solver
Message-Id: <bdwSe.98947$mm3.66189@fe35.usenetserver.com>
On Sat, 3 Sep 2005 22:47:50 -0700, Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us> wrote:
> On 2005-09-03, Ignoramus14363 <ignoramus14363@NOSPAM.14363.invalid> wrote:
>>
>> On 03 Sep 2005 22:51:13 GMT, xhoster@gmail.com <xhoster@gmail.com> wrote:
>>>
>>> Also, it doesn't give the right answer.
>>>
>>> "Text form: ((x^2-6x+9)/(x^2-3x-10))/((x^2-5x+6)/(x^2-8x+15)) simplifies to
>>> (x-3)/(x+2)"
>>>
>>> No, it doesn't.
>>
>> I will appreciate corrections and suggestions. What's the right answer
>> there?
>
> If you can't figure it out on paper, why are you writing a program to do
> it? Sheesh, I might as well go write an OS! :-\
Let me know when you have something useful and substantial to say,
okay?
(hint, I did solve it on paper)
If you can explain why the above simplification is incorrect, I would
appreciate hearing that.
i
------------------------------
Date: 4 Sep 2005 11:44:06 GMT
From: BZ <BZ@caradhras.net>
Subject: Re: Looking for Equation Solver
Message-Id: <slrndhlng6.vo6.BZ@kalypso.caradhras.net>
Ignoramus14363 wrote in comp.lang.perl.misc:
> > "Text form: ((x^2-6x+9)/(x^2-3x-10))/((x^2-5x+6)/(x^2-8x+15)) simplifies to
> > (x-3)/(x+2)"
> > No, it doesn't.
>
> I will appreciate corrections and suggestions. What's the right answer
> there?
(x-3)^2/(x-4)^2
--
BZ
------------------------------
Date: Sun, 4 Sep 2005 21:20:53 +0200
From: "Dave" <daveandniki@ntlworld.com>
Subject: Re: Looking for Equation Solver
Message-Id: <431b4921$0$5387$8fcfb975@news.wanadoo.fr>
"BZ" <BZ@caradhras.net> wrote in message
news:slrndhlng6.vo6.BZ@kalypso.caradhras.net...
> Ignoramus14363 wrote in comp.lang.perl.misc:
>> > "Text form: ((x^2-6x+9)/(x^2-3x-10))/((x^2-5x+6)/(x^2-8x+15))
>> > simplifies to
>> > (x-3)/(x+2)"
>> > No, it doesn't.
>>
>> I will appreciate corrections and suggestions. What's the right answer
>> there?
>
> (x-3)^2/(x-4)^2
>
> --
> BZ
No, Paul is right. It can also be written:
((x-3)^2)/((x+2)(x-2))
or
(x-3)^2/(x^2-4)
the latter of which is perhaps what BZ meant to type.
------------------------------
Date: Sun, 04 Sep 2005 05:24:51 GMT
From: Ala Qumsieh <notvalid@email.com>
Subject: Re: New Script Directory needs your scripts listed
Message-Id: <DyvSe.1309$I91.1137@newssvr13.news.prodigy.com>
Tad McClellan wrote:
> Nameless Spammer <zwWzg8R3@2JxJHR6.com> wrote:
>
>
>
>>Subject: New Script Directory needs your scripts listed
>
>
>
> How much do you pay for fulfilling your needs?
and why is Perl put in the same category with CGI?
--Ala
------------------------------
Date: Sun, 4 Sep 2005 21:29:30 +0200
From: "Dave" <daveandniki@ntlworld.com>
Subject: OT: Re: Looking for Equation Solver
Message-Id: <431b4b29$0$27419$8fcfb975@news.wanadoo.fr>
"Ignoramus14363" <ignoramus14363@NOSPAM.14363.invalid> wrote in message
news:bdwSe.98947$mm3.66189@fe35.usenetserver.com...
> On Sat, 3 Sep 2005 22:47:50 -0700, Keith Keller
> <kkeller-usenet@wombat.san-francisco.ca.us> wrote:
>> On 2005-09-03, Ignoramus14363 <ignoramus14363@NOSPAM.14363.invalid>
>> wrote:
>>>
>>> On 03 Sep 2005 22:51:13 GMT, xhoster@gmail.com <xhoster@gmail.com>
>>> wrote:
>>>>
>>>> Also, it doesn't give the right answer.
>>>>
>>>> "Text form: ((x^2-6x+9)/(x^2-3x-10))/((x^2-5x+6)/(x^2-8x+15))
>>>> simplifies to
>>>> (x-3)/(x+2)"
>>>>
>>>> No, it doesn't.
>>>
>>> I will appreciate corrections and suggestions. What's the right answer
>>> there?
>>
>> If you can't figure it out on paper, why are you writing a program to do
>> it? Sheesh, I might as well go write an OS! :-\
>
> Let me know when you have something useful and substantial to say,
> okay?
>
> (hint, I did solve it on paper)
>
> If you can explain why the above simplification is incorrect, I would
> appreciate hearing that.
>
> i
>
The error in the explanation this example is at the line:
'Canceled out common factors (x-(3)),(x-(3))'
Where (1) is left in each case instead of (x-3) and (x-2) in numerator and
denominator respectively.
The explantion would be clearer if you showed the factorisation before the
cancellation, and this error would have been more obvious too.
Hope this helps
Dave
------------------------------
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 8388
***************************************