From roland at euphony.net Sun Nov 3 14:19:56 2002 From: roland at euphony.net (Roland Tarver) Date: Thu Aug 5 00:28:44 2004 Subject: DCPM: meeting In-Reply-To: <20020926150319.A7867@flumpet.demon.co.uk> Message-ID: yeah m8, launch it up, I'll come. > -----Original Message----- > From: owner-devoncornwall@pm.org [mailto:owner-devoncornwall@pm.org]On > Behalf Of Steve Marvell > Sent: Thursday, September 26, 2002 3:03 PM > To: devoncornwall@happyfunball.pm.org > Subject: DCPM: meeting > > > We need one. > > Steve > From roland at euphony.net Mon Nov 4 16:20:16 2002 From: roland at euphony.net (Roland Tarver) Date: Thu Aug 5 00:28:44 2004 Subject: DCPM: meeting In-Reply-To: <20021003104735.A13923@flumpet.demon.co.uk> Message-ID: Great Torrington, Winkleigh are the nearest town and village. There nearest "big" place is Bideford/Barnstaple cheers, roly > -----Original Message----- > From: owner-devoncornwall@pm.org [mailto:owner-devoncornwall@pm.org]On > Behalf Of Steve Marvell > Sent: Thursday, October 03, 2002 10:48 AM > To: devoncornwall@pm.org > Subject: Re: DCPM: meeting > > > On Sun, Nov 03, 2002 at 08:19:56PM -0000, Roland Tarver wrote: > > > yeah m8, launch it up, I'll come. > > Roughly where do you live Roly? > > Steve > From steve at fysh.org Mon Nov 18 10:13:29 2002 From: steve at fysh.org (Steve Marvell) Date: Thu Aug 5 00:28:45 2004 Subject: DCPM: a test Message-ID: <20021118161329.A8707@flumpet.demon.co.uk> Just checking a recent spate of bouncing has not caused me to be dropped from the list. Steve From steve at fysh.org Thu Nov 21 07:50:32 2002 From: steve at fysh.org (Steve Marvell) Date: Thu Aug 5 00:28:45 2004 Subject: DCPM: quiz of the week Message-ID: <20021121135032.A946@flumpet.demon.co.uk> Here is the present quiz of the week for perl. If you like this kind of thing, get on the list_s_. Steve ----- Forwarded message from Mark Jason Dominus ----- Reply-To: perl-qotw-discuss@plover.com Delivered-To: mailing list perl-qotw@plover.com Delivered-To: moderator for perl-qotw@plover.com To: perl-qotw@plover.com Subject: Perl Quiz-of-the-Week #6 Date: Wed, 20 Nov 2002 17:31:26 -0500 From: Mark Jason Dominus IMPORTANT: Please do not post solutions, hints, or other spoilers until at least 60 hours after the date of this message. Thanks. IMPORTANTE: Por favor, no enviis soluciones, pistas, o cualquier otra cosa que pueda echar a perder la resolucin del problema hasta que hayan pasado por lo menos 60 horas desde el envo de este mensaje. Gracias. IMPORTANT: S'il vous plat, attendez au minimum 60 heures aprs la date de ce message avant de poster solutions, indices ou autres rvlations. Merci. WICHTIG: Bitte schicken Sie keine Lsungen, Tipps oder Hinweise fr diese Aufgabe vor Ablauf von 60 Stunden nach dem Datum dieser Mail. Danke. Qing3 Zhu4Yi4: Qing3 Ning2 Deng3Dao4 Jie1Dao4 Ben3 Xin4Xi2 Zhi1Hou4 60 Xiao3Shi2, Zai4 Fa1Biao3 Jie3Da2, Ti2Shi4, Huo4 Qi2Ta1 Hui4 Xie4Lou4 Da2An4 De5 Jian4Yi4. Xie4Xie4. ---------------------------------------------------------------- Write a function, format_number_list, whose argument is a list of integers. It then returns a string which represents the input list in compact, human-readable form. For example, format_number_list(1, 2, 4, 5, 6, 7, 9, 13, 24, 25, 26, 27) will return "1-2, 4-7, 9, 13, 24-27" Also write a function, 'expand_number_list', which does the conversion in the opposite direction, so that expand_number_list("1-2, 4-7, 9, 13, 24-27") will return (1, 2, 4, 5, 6, 7, 9, 13, 24, 25, 26, 27) (Thanks to Mark Hickman for suggesting this quiz problem.) ----- End forwarded message ----- ----- Forwarded message from Mark Jason Dominus ----- Reply-To: perl-qotw-discuss@plover.com Delivered-To: mailing list perl-qotw@plover.com Delivered-To: moderator for perl-qotw@plover.com To: perl-qotw@plover.com Subject: Perl 'Expert' Quiz-of-the-Week #6 Date: Wed, 20 Nov 2002 17:46:49 -0500 From: Mark Jason Dominus IMPORTANT: Please do not post solutions, hints, or other spoilers until at least 60 hours after the date of this message. Thanks. IMPORTANTE: Por favor, no enviis soluciones, pistas, o cualquier otra cosa que pueda echar a perder la resolucin del problema hasta que hayan pasado por lo menos 60 horas desde el envo de este mensaje. Gracias. IMPORTANT: S'il vous plat, attendez au minimum 60 heures aprs la date de ce message avant de poster solutions, indices ou autres rvlations. Merci. WICHTIG: Bitte schicken Sie keine Lsungen, Tipps oder Hinweise fr diese Aufgabe vor Ablauf von 60 Stunden nach dem Datum dieser Mail. Danke. Qing3 Zhu4Yi4: Qing3 Ning2 Deng3Dao4 Jie1Dao4 Ben3 Xin4Xi2 Zhi1Hou4 60 Xiao3Shi2, Zai4 Fa1Biao3 Jie3Da2, Ti2Shi4, Huo4 Qi2Ta1 Hui4 Xie4Lou4 Da2An4 De5 Jian4Yi4. Xie4Xie4. ---------------------------------------------------------------- Write a generic survey or quiz program, "survey". The program will read a configuration file in this format: How old are you? 0-12; 13-19; 20-24; 25-34; 35-44; 45 or older What is your favorite color? red; blue; black; other ... Each question is on a separate line; the question is everything up to and including the first '?', and the allowed responses to the question are the following items separated by ';'. If the last response ends with ";;" instead of ";", any data following the ";;" is taken to be configuration options for that question, separated by spaces. For example: How old are you? 0-12; 13-19; 20-24; 25-34; 35-44; 45 or older;; OPTIONAL What is your favorite color? red; blue; black;; ALLOW_OTHER It is up to you to decide what options, if any, should be supported. The program will then prompt the user with the questions, and read and validte the responses. When the user has finished answering the questions, the program should record the responses in a file. There should be some way to run the program to get it to disgorge a report about the aggregate survey responses. The report should include: The number of people completing the survey; the number providing each response to each question, and the percentage breakdown for the responses to each question. The program could use the terminal as an interface, or it could have a Tk interface, or could be a CGI program, or whatever you prefer. ----- End forwarded message ----- From steve at fysh.org Mon Nov 25 08:26:28 2002 From: steve at fysh.org (Steve Marvell) Date: Thu Aug 5 00:28:45 2004 Subject: DCPM: duh! Message-ID: <20021125142628.A16878@flumpet.demon.co.uk> Change that pounds to pound and perl CD bookshelf works much better :) Steve From steve at fysh.org Mon Nov 25 08:23:27 2002 From: steve at fysh.org (Steve Marvell) Date: Thu Aug 5 00:28:45 2004 Subject: DCPM: more book reviews Message-ID: <20021125142327.A16862@flumpet.demon.co.uk> Extending & Embedding Perl and the Perl CD Bookshelf. I'm sure these will get on the web site. Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/devoncornwall-pm/attachments/20021125/fe70101e/manning.extembperl.review.html -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/devoncornwall-pm/attachments/20021125/fe70101e/ora.percdbs3.review.html From alex at dclug.org.uk Mon Nov 25 19:03:30 2002 From: alex at dclug.org.uk (Alex Charrett) Date: Thu Aug 5 00:28:45 2004 Subject: DCPM: fork oddness Message-ID: <1038272610.2881.10.camel@seca.beau.net> Hi all, I'm having an odd issue with fork maybe you guys can shed some light on. I've got a constantly running process that forks itself when doing time consuming tasks to make the front end script more responsive. It's doing it's job nicely and I've got an exit(0) to get the child to terminate at the correct time. However, the exit is causing defunct processes to sit in the process list until the parent exits (which I don't want it to do as the parent isn't meant to exit). You can re-create the problem with this test fork script: #!/usr/bin/perl while (1) { $child_pid=fork(); if($child_pid == 0) { print "ooh, I\'m the child\!\n"; exit(0); } sleep(10); } and an excerpt from my ps ax (this is on linux btw): 2949 pts/2 S 0:00 /usr/bin/perl ./fork2.pl (this is the parent) 2950 pts/2 Z 0:00 [fork2.pl ] 2951 pts/2 Z 0:00 [fork2.pl ] 2954 pts/2 Z 0:00 [fork2.pl ] 2956 pts/2 Z 0:00 [fork2.pl ] 2957 pts/2 Z 0:00 [fork2.pl ] Any ideas? Cheers, Alex. From steve at fysh.org Tue Nov 26 03:15:07 2002 From: steve at fysh.org (Steve Marvell) Date: Thu Aug 5 00:28:45 2004 Subject: DCPM: fork oddness In-Reply-To: <1038272610.2881.10.camel@seca.beau.net>; from alex@dclug.org.uk on Tue, Nov 26, 2002 at 01:03:30AM +0000 References: <1038272610.2881.10.camel@seca.beau.net> Message-ID: <20021126091507.A20202@flumpet.demon.co.uk> On Tue, Nov 26, 2002 at 01:03:30AM +0000, Alex Charrett wrote: > I'm having an odd issue with fork maybe you guys can shed some light on. > I've got a constantly running process that forks itself when doing time > consuming tasks to make the front end script more responsive. It's > doing it's job nicely and I've got an exit(0) to get the child to > terminate at the correct time. > > However, the exit is causing defunct processes to sit in the process > list until the parent exits (which I don't want it to do as the parent > isn't meant to exit). The parent should wait() or waitpid() for the child after it dies. You'll know when it dies from the SIGCHLD in the parent, which you'll need to trap. Steve From steve at fysh.org Tue Nov 26 10:02:14 2002 From: steve at fysh.org (Steve Marvell) Date: Thu Aug 5 00:28:45 2004 Subject: DCPM: of trees and squishing Message-ID: <20021126160214.A21760@flumpet.demon.co.uk> Imagine a directory tree: A -> B -> C -> D -> E -> F -> E -> G H -> I -> J -> K -> L -> M -> N -> O -> P -> Q -> R -> S etc Now imagine directory entries: bob (G,M) fred (L,R) jim (C,P,N,G) I can't rely on them being in a nice order. I want to basically form the subtree including only the sections terminating in each of the of the nodes associated with the names. ie. bob: A -> B -> E -> G H -> I -> L -> M fred H -> I -> L -> Q -> R jim A -> B -> C -> E -> G H -> I -> N -> O -> P With each entre in the tree, I've stored the ancestry, so I can easily get: jim A -> B -> C H -> I -> O -> P H -> I -> N A -> B -> E -> G I just can't think of a great algorithm to combine them. I can think of some bad ones, but no good ones. So, imagine you have: @v = ( [qw(A B C)] , [qw(H I O P)] , [qw(H I N)] , [qw(A B E G)] ); And now you want it in a reduced for which is suitable for printing in the way above, say. I suppose it could be done by pruning the main tree, but the size of the small one is likely to be much much smaller than the main one. So, any thoughts? Steve From alex at dclug.org.uk Tue Nov 26 13:17:56 2002 From: alex at dclug.org.uk (Alex Charrett) Date: Thu Aug 5 00:28:45 2004 Subject: DCPM: fork oddness In-Reply-To: <20021126091507.A20202@flumpet.demon.co.uk> References: <1038272610.2881.10.camel@seca.beau.net> <20021126091507.A20202@flumpet.demon.co.uk> Message-ID: <1038338293.953.1.camel@seca.beau.net> On Tue, 2002-11-26 at 09:15, Steve Marvell wrote: > On Tue, Nov 26, 2002 at 01:03:30AM +0000, Alex Charrett wrote: > > > I'm having an odd issue with fork maybe you guys can shed some light on. > > I've got a constantly running process that forks itself when doing time > > consuming tasks to make the front end script more responsive. It's > > doing it's job nicely and I've got an exit(0) to get the child to > > terminate at the correct time. > > > > However, the exit is causing defunct processes to sit in the process > > list until the parent exits (which I don't want it to do as the parent > > isn't meant to exit). > > The parent should wait() or waitpid() for the child after it > dies. You'll know when it dies from the SIGCHLD in the parent, which > you'll need to trap. Ok, that seems to be working until I hit the point where I may have more than one child at a time, how do I tell which is sending me the SIGCHLD? Alex. From steve at fysh.org Wed Nov 27 04:54:41 2002 From: steve at fysh.org (Steve Marvell) Date: Thu Aug 5 00:28:45 2004 Subject: DCPM: fork oddness In-Reply-To: <1038338293.953.1.camel@seca.beau.net>; from alex@dclug.org.uk on Tue, Nov 26, 2002 at 07:17:56PM +0000 References: <1038272610.2881.10.camel@seca.beau.net> <20021126091507.A20202@flumpet.demon.co.uk> <1038338293.953.1.camel@seca.beau.net> Message-ID: <20021127105441.C25030@flumpet.demon.co.uk> On Tue, Nov 26, 2002 at 07:17:56PM +0000, Alex Charrett wrote: > Ok, that seems to be working until I hit the point where I may have more > than one child at a time, how do I tell which is sending me the SIGCHLD? You don't need to, you jnust need to wait for ll the dead children to go. if you ... while ($pid = waitpid(-1,&WNOHANG) > 0) { # do something with $pid, or not } Then you'll wait for everyone to die. Alternatively if you IGNORE the SIGCHLD, then I believe the system will just sort it out for you. $SIG{'CHLD'} = 'IGNORE'; This is a good option when you want to do nothing with the children. Steve From alex at dclug.org.uk Wed Nov 27 06:01:56 2002 From: alex at dclug.org.uk (Alex Charrett) Date: Thu Aug 5 00:28:45 2004 Subject: DCPM: fork oddness In-Reply-To: <20021127105441.C25030@flumpet.demon.co.uk> References: <1038272610.2881.10.camel@seca.beau.net> <20021126091507.A20202@flumpet.demon.co.uk> <1038338293.953.1.camel@seca.beau.net> <20021127105441.C25030@flumpet.demon.co.uk> Message-ID: <1038398520.927.12.camel@seca.beau.net> On Wed, 2002-11-27 at 10:54, Steve Marvell wrote: > On Tue, Nov 26, 2002 at 07:17:56PM +0000, Alex Charrett wrote: > > > Ok, that seems to be working until I hit the point where I may have more > > than one child at a time, how do I tell which is sending me the SIGCHLD? > > You don't need to, you jnust need to wait for ll the dead children to > go. Gotchas, the aforementioned problem was down to my brain-dead implementation in the end. Cheers. Alex. From steve at fysh.org Wed Nov 27 09:47:43 2002 From: steve at fysh.org (Steve Marvell) Date: Thu Aug 5 00:28:45 2004 Subject: DCPM: changes to review Message-ID: <20021127154743.A26373@flumpet.demon.co.uk> Minor change to reference to older version of the bookshelf. Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/devoncornwall-pm/attachments/20021127/513de48f/ora.percdbs3.review.html From steve at fysh.org Wed Nov 27 10:01:26 2002 From: steve at fysh.org (Steve Marvell) Date: Thu Aug 5 00:28:45 2004 Subject: DCPM: dumping cyclic structures Message-ID: <20021127160126.A26436@flumpet.demon.co.uk> Dumping cyclic structures is great, until you want to eval them, it seems. Any ideas? Cheers Steve #!/usr/bin/perl use Data::Dumper; $old = { name => "bob" }; $young = { name => "bob jr" }; $old->{child} = $young; $young->{parent} = $old; $string = Data::Dumper->Dump([$old],[qw(old)]); undef $old; undef $young; eval $string; $check = Data::Dumper->Dump([$old],[qw(old)]); if ($string ne $check) { print "eek!\n---\n$string---\n$check"; }