From tim at consultix-inc.com Fri Aug 2 11:06:26 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:09:07 2004 Subject: SPUG: Perl Classes in Aug/Sept Message-ID: <20020802090626.A25645@timji.consultix.wa.com> SPUGsters, Just a quick note to tell you about upcoming public classes on Perl (and UNIX) topics; see the schedule below. By the way, we're currently assembling our Fall schedule, so let us know if you'd be interested in attending a public offering of any of the 13 Perl classes we teach! 8-} More details are available through the links given below. -Tim *==============================================================================* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | | 8/20:UNIX 8/26:Perl+Modules 9/18:Int Perl 9/23:Shell Prog. & Utilities | *==============================================================================* CONSULTIX SUMMER PUBLIC CLASSES, Kirkland WA --------------------------------------------------------- COURSE DATES Days CLASSES BY> Dr. Tim Maher UNIX Fundamentals 8/20-23 4 Perl Prog. + Modules 8/26-29 4 Intermediate Perl 9/18-20 3 Shell and Utilities 9/23-27 5 +-----------------------------------------------------------+ CONSULTIX ON-LINE RESOURCES General Information: http://www.consultix-inc.com On-Site Training: http://www.consultix-inc.com/on-site.html Course Listings: UNIX/Shell, http://teachmeunix.com/unixlist.html Perl, http://teachmeperl.com/perllist.html Registration and Pricing: http://www.consultix-inc.com/reg.html Instructor Evaluations: http://www.consultix-inc.com/evals.html Course Evaluations: http://www.consultix-inc.com/course_evals.html *==============================================================================* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | | 8/20:UNIX 8/26:Perl+Modules 9/18:Int Perl 9/23:Shell Prog. & Utilities | *==============================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Sat Aug 3 17:00:24 2002 From: tim at consultix-inc.com (SPUG-list-owner) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Aug. 20 Mtg: Extreme/Spam! Message-ID: <20020803150024.A27240@timji.consultix.wa.com> SPUGsters, Here's an advance notice of what's coming up in this month's meeting. More details will follow later. Incidentally, I'm working on getting mjd (Mark-Jason Dominus) to visit Seattle in October to deliver some commercial training classes, and do some free SPUG talks. So start buttering up your managers to pony up the dough for your next dose of world-class Perl training! 8-} -Tim Maher, JAWCAR ("Just Another White Camel Award Recipient") August 2002 Seattle Perl User's Group Meeting ------------------------------------------------------ Speaker #1: Asim Jalis: "Extreme Perl" Speaker #1: Creede Lombard: "Mail::SpamAssassin" Time: Tuesday, August 20, 2002 7-9pm Location: SAFECO bldg, Brooklyn St. and NE 45th St. Cost: Admission is free and open to the general public. Info: http://seattleperl.org/ ------------------------------------------------------ "Extreme Perl", by Asim Jalis ------------------------------------------------------ In this talk, you will learn: - What's eXtreme Programming, Unit Testing, Refactoring, and Emergent Architecture. - What's in the CPAN unit testing modules and how to use these modules to tighten your code. - How to jump into coding without spending weeks and months in architecture and design, and still deliver code that is rock-solid. - How to shock your product manager by cheerfully accepting brand new requirements and then implementing them without breaking any existing functionality. We will talk about unit testing, refactoring, and emergent architecture as they apply to Perl, and then we'll do some mob programming to experience how it works in practice. About the Speaker, Asim Jalis ----------------------------- Asim is a software engineer at Hewlett-Packard where he is working on printing applications of web services using C#/.NET. He uses Perl to run an internal website and for various maintenance tasks. He has an M.S. in computer science and an M.A. in mathematics. ------------------------------------------------------ "Mail::SpamAssassin", by Creede Lombard ------------------------------------------------------ Still waiting for full details on this talk to come in, but my understanding is that it will discuss the Mail::SpamAssassin module (for filtering SPAM), and how to use it with Mail::Audit. Or something like that. Watch for updates! -Tim ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== *============================================================================* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | | 8/26: Perl+Modules 9/18: Int Perl 9/23: Shell & Utilities OCT: mjd ? | *============================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jay at Scherrer.com Mon Aug 5 13:13:02 2002 From: jay at Scherrer.com (Jay Scherrer) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Perl dev. help needed. Message-ID: <200208051113.02485.jay@scherrer.com> Tim, Fellow Spuger's, We have decided to release our Practical tax Perl program as open source . This program is still under developement (updating to the new tax season). We currently have a CPA to double check the calculations. If any of you (If you have the time) have skills in scripting Perl::Tk and are familiar using the PDF::Create module or database development, Let us know. Comments are welcomed. Jay - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From eric.brose at attws.com Tue Aug 6 16:41:30 2002 From: eric.brose at attws.com (Brose, Eric) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Dereferencing hash ref Message-ID: <67AC2DB52118D411A8F300508B957F120D706235@WA-MSG02> Hello, I'm using the XML::Simple module and need to recurse over my results. ---------------------------------------------------------------------------- ----- use XML::Simple; use Data::Dumper; my $ref = XMLin('C:\Perl\HBSource.xml'); print Dumper($ref); foreach $setting (sort keys (%$ref)){ #print "$setting\n"; This works! foreach $detail (sort keys %{$ref{$setting}} ){ print "$ref{$setting}->{$detail}\n"; } } ; --------------------------------------------------------------------- I'm trying to figure out how to review all of the info in the hash ref. Can someone give me some clues how i can change my foreach nested loops to get our what I want. Below is the kind of info i see in from datadumper. I need to be able to recurse through my data structure(the hash ref) to extract this info. Any ideas? $VAR1 = { 'vtComponent' => { 'deployName' => '/FROG/InfoFlo/Connectors/HBSource', 'vtFlow' => { 'vtProperty' => { 'channel' => { 'value' => 'CRM.INFOFLO.HB.SRC' }, 'hostname' => { 'value' => 'googly }, 'QManager' => { 'value' => 'EGYPT' }, 'transactionQueue' => { 'value' => 'CRM.INFOFLO.HB.SOURCE.TRANQUEUE' }, 'QName' => { 'value' => 'ATCDEV3G3.HB.RECEIVE.QUEUE' } }, 'name' => 'MQSeries Source' }, 'componentType' => 'connector' } }; Thanks, Eric Brose -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020806/11eea275/attachment.htm From evgenyr at cs.washington.edu Tue Aug 6 18:02:38 2002 From: evgenyr at cs.washington.edu (Evgeny Roubinchtein) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Dereferencing hash ref In-Reply-To: <67AC2DB52118D411A8F300508B957F120D706235@WA-MSG02> References: <67AC2DB52118D411A8F300508B957F120D706235@WA-MSG02> Message-ID: <874re78ub5.fsf@graphon.com> >>>>> "EB" == Brose, Eric writes: EB> Hello, EB> I'm using the XML::Simple module and need to recurse over my results. EB> use XML::Simple; EB> use Data::Dumper; EB> my $ref = XMLin('C:\Perl\HBSource.xml'); EB> print Dumper($ref); EB> foreach $setting (sort keys (%$ref)){ EB> #print "$setting\n"; This works! EB> foreach $detail (sort keys %{$ref{$setting}} ){ EB> print "$ref{$setting}->{$detail}\n"; EB> } EB> } EB> ; EB> I'm trying to figure out how to review all of the info in the EB> hash ref. Can someone give me some clues how i can change my EB> foreach nested loops to get our what I want. Personally, I would write the inner foreach as: foreach $detail (sort keys %{$ref->{$setting}) { print $ref->{$setting}->{$detail}, "\n"; } Do "perldoc perlref" for the full story. If something in the perlref documentation doesn't make sense, or you need more examples, feel free to ask again. EB> I need to be able to recurse through my data structure(the EB> hash ref) to extract this info. Any ideas? I'm probably sounding like Mr. Obvious, but, if you want to _recurse_, it seems that recursion would be more appropriate than iteration, no? sub recurse_thang ($); # this code is mostly "for illustration", rather than "for production use" sub recurse_thang ($) { my $thang = shift; if (not ref $thang) { # the base case: a plain scalar print $thang, ", "; return; } if ( ref($thang) eq 'HASH') { print "{ "; foreach my $key (sort keys %$thang) { print $key, " => "; recurse_thang($thang->{$key}); } print "}\n"; } elsif ( ref($thang) eq 'ARRAY') { print "[ "; foreach my $item (@$thang) { recurse_thang($item); } print "]\n"; } elsif ( ref($thang) eq 'SCALAR' ) { print $$thang, ", "; } # ... more cases here ... } my $ref = { foo => [1, 2, 3], bar => [ {baz => 5}, 4, 8], }; recurse_thang($ref); Hope this helps. -- Evgeny Faced with the choice between changing one's mind, and proving that there is no need to do so - almost everyone gets busy on the proof. -- John Kenneth Galbraith - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From asa.martin at attws.com Wed Aug 7 15:16:48 2002 From: asa.martin at attws.com (Martin, Asa) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Net::FTP Message-ID: <67FC0E2A32D0D31194500008C7CF2E6F055292F9@wa-msg09.entp.attws.com> I have a directory mirroring script I'm working on and it uses Net::FTP to connect to the remote host and grab the files. I'm basically using the ftp_mirror.pl script from Network Programming with Perl by Lincoln Stein. The script is supposed to compare the time stamp and file size of each file from the remote server to the local copy and not copy it if it's not newer. It uses the Net::FTP::mdtm function to get the modification time from the remote server. Here's the code snippet: zub get_file { my ( $path, $mode ) = @_; my $rtime = $ftp->mdtm($path); my $rsize = $ftp->size($path); $mode = ( parse_listing( $ftp->dir($path) ) )[2] unless defined $mode; my ( $lsize, $ltime ) = stat($path) ? ( stat(_) )[ 7, 9 ] : ( 0, 0 ); if ( defined($rtime) and defined($rsize) and ( $ltime >= $rtime ) and ( $lsize == $rsize ) ) { warn "Getting file $path: not newer than local copy.\n" if $VERBOSE; return; } warn "Getting file $path\n" if $VERBOSE; $ftp->get($path) or ( warn $ftp->message, "\n" and return ); chmod $mode, $path if $mode; } On some of my servers, $rtime does not return a value. On others it does. $rsize always returns a value, so I know that $path is correct. Anyone know what I could check to troubleshoot this? Thanks, Asa - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ben at reser.org Wed Aug 7 16:34:51 2002 From: ben at reser.org (Ben Reser) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Net::FTP In-Reply-To: <67FC0E2A32D0D31194500008C7CF2E6F055292F9@wa-msg09.entp.attws.com> References: <67FC0E2A32D0D31194500008C7CF2E6F055292F9@wa-msg09.entp.attws.com> Message-ID: <20020807213451.GA2040@occipital.brain.org> On Wed, Aug 07, 2002 at 03:16:48PM -0500, Martin, Asa wrote: > On some of my servers, $rtime does not return a value. On others it does. > $rsize always returns a value, so I know that $path is correct. Anyone know > what I could check to troubleshoot this? ftp isn't very good for mirroring like this. If you control both ends consider using rsync. If not then I'm not sure what to tell you... -- Ben Reser http://ben.reser.org If your love has no hope of being welcomed do not voice it; for if it be silent it can endure, a guarded flame, within you. - The Wisdom of the Sands - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From aaron at activox.com Wed Aug 7 17:05:05 2002 From: aaron at activox.com (Aaron Salo) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Net::FTP Message-ID: <3.0.5.32.20020807150505.0157a410@pop3.norton.antivirus> http://www.perldoc.com/perl5.8.0/lib/Net/libnetFAQ.html#How-can-I-debug-my-s cripts-that-use-Net--*-modules-- HTH ~!a >On Wed, Aug 07, 2002 at 03:16:48PM -0500, Martin, Asa wrote: >> On some of my servers, $rtime does not return a value. On others it does. >> $rsize always returns a value, so I know that $path is correct. Anyone know >> what I could check to troubleshoot this? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From benjamin at dzhan.com Thu Aug 8 15:01:35 2002 From: benjamin at dzhan.com (Benjamin Franks) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: ncurses charting Message-ID: <20020808125149.D10482-100000@crimea.dzhan.com> I've been digging around cpan a little, but haven't found what I'm look for. Anyone know of a Perl module for generating line/scatter/bar/etc simple charts and graphs using ncurses or some other text/console display mode. I know, you might say, "get with the times...png,gd,etc" but i want a terminal-based, curses-compliant graphing library if possible! ;) --Ben - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From asimjalis at yahoo.com Thu Aug 8 16:51:44 2002 From: asimjalis at yahoo.com (Asim Jalis) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Dijsktra is Dead Message-ID: <20020808215144.4178.qmail@web14208.mail.yahoo.com> Dijsktra is dead. We can all write unstructured code again. __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From moonbeam at catmanor.com Thu Aug 8 18:26:20 2002 From: moonbeam at catmanor.com (William Julien) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Re: ncurses charting Message-ID: <200208082326.g78NQKW02705@catmanor.com> >I've been digging around cpan a little, but haven't found what I'm look >for. Anyone know of a Perl module for generating line/scatter/bar/etc >simple charts and graphs using ncurses or some other text/console display >mode. I know, you might say, "get with the times...png,gd,etc" but i >want a terminal-based, curses-compliant graphing library if possible! ;) >--Ben How about ... http://search.cpan.org/search?dist=Curses William - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From richard at richard-anderson.org Fri Aug 9 00:25:35 2002 From: richard at richard-anderson.org (Richard Anderson) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) References: <20020808215144.4178.qmail@web14208.mail.yahoo.com> Message-ID: <025801c23f65$35ebd550$2d88ddd1@aciwin> Speaking of unstructured coding, I recently updated the online grep/map/sort tutorial and added the example below. This got me thinking: are there any cases where self-generating code is "better" (in some sense) than the alternatives? I feel the answer is no - can anyone provide a counter-example? Find prime numbers: a cautionary tale Lastly, an example of how NOT to use map. Once you become proficient with map, it is tempting to apply it to every problem involving an array or hash. This can lead to unfortunate code like this: foreach $num (1 .. 1000) { @expr = map { '$_ % ' . $_ . ' &&' } 2 .. int sqrt $num; if (eval "grep { @expr 1 } $num") { print "$num " } } 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 ... This works, but the code is such an evil mess that it made my dog cry. Self-generating code is inherently difficult to read, debug and modify. Look at how easy it is to understand a straightforward implementation of the same algorithm: CANDIDATE: foreach $num (1 .. 1000) { foreach $factor (2 .. int sqrt $num) { unless ($num % $factor) { next CANDIDATE } } print "$num "; } 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 ... As a bonus, the simple implementation is two orders of magnitude faster than the self-generating code! In general, the simpler your code looks, the more the compiler can optimize it. Of course, a complex implementation of a fast algorithm can trump a simple implementation of a slow algorithm. Now that we have gazed upon the Dark Side, let us return to the path of righteous, simple code ... (Complete tutorial at http://www.raycosoft.com/rayco/support/perl_tutor.html ) Cheers, Richard richard@richard-anderson.org www.richard-anderson.org www.raycosoft.com ----- Original Message ----- From: "Asim Jalis" To: Sent: Thursday, August 08, 2002 2:51 PM Subject: SPUG: Dijsktra is Dead > Dijsktra is dead. We can all write unstructured > code again. > > > > __________________________________________________ > Do You Yahoo!? > HotJobs - Search Thousands of New Jobs > http://www.hotjobs.com > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jgardn at alumni.washington.edu Fri Aug 9 02:00:02 2002 From: jgardn at alumni.washington.edu (Jonathan Gardner) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) In-Reply-To: <025801c23f65$35ebd550$2d88ddd1@aciwin> References: <20020808215144.4178.qmail@web14208.mail.yahoo.com> <025801c23f65$35ebd550$2d88ddd1@aciwin> Message-ID: <200208090000.02313.jgardn@alumni.washington.edu> On Thursday 08 August 2002 10:25 pm, Richard Anderson wrote: > Speaking of unstructured coding, I recently updated the online > grep/map/sort tutorial and added the example below. This got me thinking: > are there any cases where self-generating code is "better" (in some sense) > than the alternatives? I feel the answer is no - can anyone provide a > counter-example? > While it's not *SELF*-generating code, I am writing a perl script at work that will make bash scripts that will run SQL scripts... -- Jonathan Gardner jgardn@alumni.washington.edu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From richard at richard-anderson.org Fri Aug 9 10:03:32 2002 From: richard at richard-anderson.org (Richard Anderson) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) References: <20020808215144.4178.qmail@web14208.mail.yahoo.com> <025801c23f65$35ebd550$2d88ddd1@aciwin> <200208090000.02313.jgardn@alumni.washington.edu> Message-ID: <027701c23fb5$eec65140$2d88ddd1@aciwin> And what is the reason for not simply writing a perl program using DBD/DBI? This would seem to be a cleaner implementation, more maintenance-friendly. Cheers, Richard richard@richard-anderson.org www.richard-anderson.org www.raycosoft.com ----- Original Message ----- From: "Jonathan Gardner" To: "Richard Anderson" ; "Asim Jalis" ; "spug" Sent: Friday, August 09, 2002 12:00 AM Subject: Re: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) On Thursday 08 August 2002 10:25 pm, Richard Anderson wrote: > Speaking of unstructured coding, I recently updated the online > grep/map/sort tutorial and added the example below. This got me thinking: > are there any cases where self-generating code is "better" (in some sense) > than the alternatives? I feel the answer is no - can anyone provide a > counter-example? > While it's not *SELF*-generating code, I am writing a perl script at work that will make bash scripts that will run SQL scripts... -- Jonathan Gardner jgardn@alumni.washington.edu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From Marc.M.Adkins at Doorways.org Fri Aug 9 11:45:38 2002 From: Marc.M.Adkins at Doorways.org (Marc M. Adkins) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Self-generating code: yea or nay? In-Reply-To: <025801c23f65$35ebd550$2d88ddd1@aciwin> Message-ID: I learned Perl after browsing the camel book in Borders and noticing that it had an eval() function. It's the first language I've used since Lisp that has this feature. I had been playing with Java but reflection didn't do what I wanted...and all I really wanted was to _easily_ evaluate simple math expressions. After learning Perl I found that 95% of the code I had written in Java (on that particular project) was unecessary if I used Perl. Granted, mis-use of this feature can lead to performance penalties as well as being hazardous to one's health (I finally got enough rope to really hang myself). mma > Speaking of unstructured coding, I recently updated the online > grep/map/sort > tutorial and added the example below. This got me thinking: are there any > cases where self-generating code is "better" (in some sense) than the > alternatives? I feel the answer is no - can anyone provide a > counter-example? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From cmeyer at helvella.org Fri Aug 9 12:12:12 2002 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) In-Reply-To: <025801c23f65$35ebd550$2d88ddd1@aciwin>; from richard@richard-anderson.org on Thu, Aug 08, 2002 at 10:25:35PM -0700 References: <20020808215144.4178.qmail@web14208.mail.yahoo.com> <025801c23f65$35ebd550$2d88ddd1@aciwin> Message-ID: <20020809101212.C15437@hobart.helvella.org> On Thu, Aug 08, 2002 at 10:25:35PM -0700, Richard Anderson wrote: > Speaking of unstructured coding, I recently updated the online > grep/map/sort tutorial and added the example below. This got me > thinking: are there any cases where self-generating code is "better" > (in some sense) than the alternatives? I feel the answer is no - can > anyone provide a counter-example? [...] > > foreach $num (1 .. 1000) { > @expr = map { '$_ % ' . $_ . ' &&' } 2 .. int sqrt $num; > if (eval "grep { @expr 1 } $num") { print "$num " } > } > > 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 ... > > This works, but the code is such an evil mess that it made my dog > cry. Self-generating code is inherently difficult to read, debug > and modify. This example is difficult to read, but that doesn't demonstrate that all code generated by code is so messy. Consider the code it generates when $num == 10: @expr will be: ( '$_ % 2 &&', '$_ % 3' ) the eval'd string will be: "grep { $_ % 2 && $_ % 3 && 1 } $num". Just because you chose to generate code that is odd to the typical Perl programmer doesn't mean that all generated code need be so odd. > > Look at how easy it is to understand a straightforward implementation > of the same algorithm: Comparing apples and oranges doesn't lend to useful conclusions. For a useful and understandable example of autogenerated code, take a look at something like Class::Struct (or Chapter 8 of _OO Perl_ for a nice analysis). A module like this demonstrates when when autogenerated code is better than the alternative. It is a waste of time for the programmer to repeatedly hand code simple accessors, yet how many of us do so on a regular basis? Why not let automate the task and let a program generate the code for you? For a very useful example, see Lex::HookWrap. This code may take some studying (or a lecture from Damian ;-) to understand. Lex::HookWrap autogenerates a class to unhook the hooks, when a scope is left (causing an object to go out of scope, and its DESTROY method to be called). What's the alternative to autogenerated code here? ;-) It's doable, but with a DESTROY method that is much thicker and less intuitive. As with many features of Perl, don't use autogenerating code, if you aren't comfortable with it. When writing code that others will be maintaining, consider their capabilities and comfort as well. Have fun, -Colin. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From glyph at mac.com Fri Aug 9 14:18:04 2002 From: glyph at mac.com (Geoffrey & Kristin Grosenbach) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) In-Reply-To: <20020809101212.C15437@hobart.helvella.org> Message-ID: I love using Perl to generate code for other languages. In a past project I used Perl to parse SQL stored procedures, then generate Java database-layer code. One might argue for a different design, but it sure beat monotonous copying of stored proc names, arguments, return values, etc. Geoff On Friday, August 9, 2002, at 10:12 AM, Colin Meyer wrote: > On Thu, Aug 08, 2002 at 10:25:35PM -0700, Richard Anderson wrote: >> Speaking of unstructured coding, I recently updated the online >> grep/map/sort tutorial and added the example below. This got me >> thinking: are there any cases where self-generating code is "better" >> (in some sense) than the alternatives? I feel the answer is no - can >> anyone provide a counter-example? > [...] >> >> foreach $num (1 .. 1000) { >> @expr = map { '$_ % ' . $_ . ' &&' } 2 .. int sqrt $num; >> if (eval "grep { @expr 1 } $num") { print "$num " } >> } >> >> 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 ... >> >> This works, but the code is such an evil mess that it made my dog >> cry. Self-generating code is inherently difficult to read, debug >> and modify. > > This example is difficult to read, but that doesn't demonstrate that > all code generated by code is so messy. > > Consider the code it generates when $num == 10: > > @expr will be: ( '$_ % 2 &&', '$_ % 3' ) > > the eval'd string will be: "grep { $_ % 2 && $_ % 3 && 1 } $num". > > Just because you chose to generate code that is odd to the typical > Perl programmer doesn't mean that all generated code need be so odd. > >> >> Look at how easy it is to understand a straightforward implementation >> of the same algorithm: > > Comparing apples and oranges doesn't lend to useful conclusions. > > For a useful and understandable example of autogenerated code, take a > look at something like Class::Struct (or Chapter 8 of _OO Perl_ for a > nice analysis). > > A module like this demonstrates when when autogenerated code is better > than the alternative. It is a waste of time for the programmer to > repeatedly hand code simple accessors, yet how many of us do so on a > regular basis? Why not let automate the task and let a program generate > the code for you? > > For a very useful example, see Lex::HookWrap. This code may take some > studying (or a lecture from Damian ;-) to understand. Lex::HookWrap > autogenerates a class to unhook the hooks, when a scope is left (causing > an object to go out of scope, and its DESTROY method to be called). > What's the alternative to autogenerated code here? ;-) It's doable, but > with a DESTROY method that is much thicker and less intuitive. > > As with many features of Perl, don't use autogenerating code, if you > aren't comfortable with it. When writing code that others will be > maintaining, consider their capabilities and comfort as well. > > Have fun, > -Colin. > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your > Email-address > For daily traffic, use spug-list for LIST ; for weekly, > spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > > http://www.GeoffreyGrosenbach.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From dancerboy at strangelight.com Fri Aug 9 15:00:28 2002 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Self-generating code: yea or nay? In-Reply-To: <025801c23f65$35ebd550$2d88ddd1@aciwin> References: <20020808215144.4178.qmail@web14208.mail.yahoo.com> <025801c23f65$35ebd550$2d88ddd1@aciwin> Message-ID: At 10:25 PM -0700 8/8/02, Richard Anderson wrote: >Speaking of unstructured coding, I recently updated the online grep/map/sort >tutorial and added the example below. This got me thinking: are there any >cases where self-generating code is "better" (in some sense) than the >alternatives? I feel the answer is no - can anyone provide a >counter-example? Depends on how narrowly you define the "self" in "self-generating". It's often much simpler to translate user input into perl code and then eval that generated code rather than parsing the input directly. -jason - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From asimjalis at yahoo.com Fri Aug 9 15:21:19 2002 From: asimjalis at yahoo.com (Asim Jalis) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) In-Reply-To: <20020809101212.C15437@hobart.helvella.org> Message-ID: <20020809202119.81454.qmail@web14205.mail.yahoo.com> Richard Anderson wrote: > [A]re there any cases where self-generating code > is "better" (in some sense) than the > alternatives? I feel the answer is no - can > anyone provide a counter-example? Here are some examples: - SWIG and also Inline::* Generate wrapper code for embedding one language into another. - Class::Struct, Class::DBI Generate subs for setters and getters for a class's fields. Class::DBI generates code so database rows can be accessed almost like objects. Code generation's sweet spot seems to be where you have to write a lot of routine mindless code, frequently to wrap access to something. Are there any examples of Code Generation where it is used to non-routine non-mindless code? Asim __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From legrady at earthlink.net Fri Aug 9 16:10:01 2002 From: legrady at earthlink.net (Tom Legrady) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) In-Reply-To: <20020809202119.81454.qmail@web14205.mail.yahoo.com> Message-ID: <84OMRM4WRRO83WUQWWSNJSPWT531X.3d542fa9@legrady> Asim Jalis wrote: >Are there any examples of Code Generation where it >is used to non-routine non-mindless code? I have a module in CPAN, Text-ASED.pm, which provides an interface to file editing, search-and-replace. While my module is not as powerful as the Perl 5 regular expressions on which it is based, it is simpler to understand for complex expressions, and simplifies the separation of the S-n-R strings from the code, thus supporting I18N. The modifications to be performed are parsed into a Perl script which is then eval-ed. Since each module command can contribute to the initialization segment and may generate a loop or conditional block, it is far simpler to generate the code than to perform interpretation in the methods themselves. Tom Legrady - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jgardn at alumni.washington.edu Fri Aug 9 22:12:32 2002 From: jgardn at alumni.washington.edu (Jonathan Gardner) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) In-Reply-To: <027701c23fb5$eec65140$2d88ddd1@aciwin> References: <20020808215144.4178.qmail@web14208.mail.yahoo.com> <200208090000.02313.jgardn@alumni.washington.edu> <027701c23fb5$eec65140$2d88ddd1@aciwin> Message-ID: <200208092012.32652.jgardn@alumni.washington.edu> On Friday 09 August 2002 08:03 am, Richard Anderson wrote: > And what is the reason for not simply writing a perl program using DBD/DBI? > This would seem to be a cleaner implementation, more maintenance-friendly. > When you're dealing with many gigabytes of data, even the small overhead of having DBI get in the way is a large cost. The plan is to keep it all as low-level as possible to turn a several hour job into a few hours. I write bash scripts because bash is much better suited for running the programs directly. Perl is great for organizing the scripts. I can make a few changes to the perl script, and change which tables and rows I am grabbing. -- Jonathan Gardner jgardn@alumni.washington.edu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From richard at richard-anderson.org Mon Aug 12 15:15:16 2002 From: richard at richard-anderson.org (Richard Anderson) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) References: <20020808215144.4178.qmail@web14208.mail.yahoo.com> <025801c23f65$35ebd550$2d88ddd1@aciwin> <20020809101212.C15437@hobart.helvella.org> Message-ID: <038001c2423c$fa95fdc0$2d88ddd1@aciwin> Hi Colin. Your example of Hook::LexWrap, Marc M. Adkins example and Geoffrey & Kristin Grosenbach's example of generating Java database-layer code are reasonable counter-examples, and and illustrate how easy Perl makes to do things that would be difficult in other languages. I think I'll tone down the tutorial's condemnation of self-generating code. However, Colin's comment about > ...see Lex::HookWrap. This code may take some studying (or a lecture from Damian ;-) to understand. Lex::HookWrap > autogenerates a class to unhook the hooks, when a scope is left (causing > an object to go out of scope, and its DESTROY method to be called). > What's the alternative to autogenerated code here? ;-) It's doable, but > with a DESTROY method that is much thicker and less intuitive. is indicative that self-generating code can be kind of dodgy. Cheers, Richard richard@richard-anderson.org www.richard-anderson.org www.raycosoft.com ----- Original Message ----- From: "Colin Meyer" To: "Richard Anderson" Cc: "spug" Sent: Friday, August 09, 2002 10:12 AM Subject: Re: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) > On Thu, Aug 08, 2002 at 10:25:35PM -0700, Richard Anderson wrote: > > Speaking of unstructured coding, I recently updated the online > > grep/map/sort tutorial and added the example below. This got me > > thinking: are there any cases where self-generating code is "better" > > (in some sense) than the alternatives? I feel the answer is no - can > > anyone provide a counter-example? > [...] > > > > foreach $num (1 .. 1000) { > > @expr = map { '$_ % ' . $_ . ' &&' } 2 .. int sqrt $num; > > if (eval "grep { @expr 1 } $num") { print "$num " } > > } > > > > 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 ... > > > > This works, but the code is such an evil mess that it made my dog > > cry. Self-generating code is inherently difficult to read, debug > > and modify. > > This example is difficult to read, but that doesn't demonstrate that > all code generated by code is so messy. > > Consider the code it generates when $num == 10: > > @expr will be: ( '$_ % 2 &&', '$_ % 3' ) > > the eval'd string will be: "grep { $_ % 2 && $_ % 3 && 1 } $num". > > Just because you chose to generate code that is odd to the typical > Perl programmer doesn't mean that all generated code need be so odd. > > > > > Look at how easy it is to understand a straightforward implementation > > of the same algorithm: > > Comparing apples and oranges doesn't lend to useful conclusions. > > For a useful and understandable example of autogenerated code, take a > look at something like Class::Struct (or Chapter 8 of _OO Perl_ for a > nice analysis). > > A module like this demonstrates when when autogenerated code is better > than the alternative. It is a waste of time for the programmer to > repeatedly hand code simple accessors, yet how many of us do so on a > regular basis? Why not let automate the task and let a program generate > the code for you? > > For a very useful example, see Lex::HookWrap. This code may take some > studying (or a lecture from Damian ;-) to understand. Lex::HookWrap > autogenerates a class to unhook the hooks, when a scope is left (causing > an object to go out of scope, and its DESTROY method to be called). > What's the alternative to autogenerated code here? ;-) It's doable, but > with a DESTROY method that is much thicker and less intuitive. > > As with many features of Perl, don't use autogenerating code, if you > aren't comfortable with it. When writing code that others will be > maintaining, consider their capabilities and comfort as well. > > Have fun, > -Colin. > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From dancerboy at strangelight.com Mon Aug 12 22:20:55 2002 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) In-Reply-To: <038001c2423c$fa95fdc0$2d88ddd1@aciwin> References: <20020808215144.4178.qmail@web14208.mail.yahoo.com> <025801c23f65$35ebd550$2d88ddd1@aciwin> <20020809101212.C15437@hobart.helvella.org> <038001c2423c$fa95fdc0$2d88ddd1@aciwin> Message-ID: It sounds like all of the examples of "good" uses of self-generating code are essentially *compilers* of some sort or other. Obviously a compiler is going to generate code: that's what a compiler does. That one may write a compiler *in* Perl that compiles *to* Perl may seem a little twisted and confusing, but really it's no more twisted than, say, all those C++ compilers out there which were mostly written in C++. Are there any examples of good uses of self-generating code *other* than in compilers or interpreters? -jason At 1:15 PM -0700 8/12/02, Richard Anderson wrote: >Hi Colin. Your example of Hook::LexWrap, Marc M. Adkins example and >Geoffrey & Kristin Grosenbach's example of generating Java >database-layer code are reasonable counter-examples, and and illustrate how >easy Perl makes to do things that would be difficult in other languages. I >think I'll tone down the tutorial's condemnation of self-generating code. >However, Colin's comment about >> ...see Lex::HookWrap. This code may take some studying (or a lecture from >Damian ;-) to understand. Lex::HookWrap >> autogenerates a class to unhook the hooks, when a scope is left (causing >> an object to go out of scope, and its DESTROY method to be called). >> What's the alternative to autogenerated code here? ;-) It's doable, but >> with a DESTROY method that is much thicker and less intuitive. > >is indicative that self-generating code can be kind of dodgy. > >Cheers, >Richard >richard@richard-anderson.org >www.richard-anderson.org >www.raycosoft.com >----- Original Message ----- >From: "Colin Meyer" >To: "Richard Anderson" >Cc: "spug" >Sent: Friday, August 09, 2002 10:12 AM >Subject: Re: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) > > >> On Thu, Aug 08, 2002 at 10:25:35PM -0700, Richard Anderson wrote: >> > Speaking of unstructured coding, I recently updated the online >> > grep/map/sort tutorial and added the example below. This got me >> > thinking: are there any cases where self-generating code is "better" >> > (in some sense) than the alternatives? I feel the answer is no - can > > > anyone provide a counter-example? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From Marc.M.Adkins at Doorways.org Mon Aug 12 23:42:49 2002 From: Marc.M.Adkins at Doorways.org (Marc M. Adkins) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) In-Reply-To: Message-ID: > It sounds like all of the examples of "good" uses of self-generating > code are essentially *compilers* of some sort or other. Obviously a > compiler is going to generate code: that's what a compiler does. > That one may write a compiler *in* Perl that compiles *to* Perl may > seem a little twisted and confusing, but really it's no more twisted > than, say, all those C++ compilers out there which were mostly > written in C++. Artificial Intelligence, particularly Expert Systems, was done in Lisp for ever so long because it was possible to construct data structures that were then executed. Rules had to be able to generate more rules for knowledge to accumulate. So is the expert system 'compiling' expertise? Data and logic get ever so confused on the boundaries of (un)consciousness... mma - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From dancerboy at strangelight.com Tue Aug 13 00:11:58 2002 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Self-generating code: yea or nay? (was: Dijsktra is Dead) In-Reply-To: References: Message-ID: At 9:42 PM -0700 8/12/02, Marc M. Adkins wrote: > > It sounds like all of the examples of "good" uses of self-generating >> code are essentially *compilers* of some sort or other. Obviously a >> compiler is going to generate code: that's what a compiler does. >> That one may write a compiler *in* Perl that compiles *to* Perl may >> seem a little twisted and confusing, but really it's no more twisted >> than, say, all those C++ compilers out there which were mostly >> written in C++. > >Artificial Intelligence, particularly Expert Systems, was done in Lisp for >ever so long because it was possible to construct data structures that were >then executed. Rules had to be able to generate more rules for knowledge to >accumulate. So is the expert system 'compiling' expertise? And does this constitute a "good" use of self-generating code? I don't know very much about modern AI techniques, but my (limited) understanding is that they rarely use this sort of approach anymore. I'd be very interested to know more about this: are there any AI experts on this list who would care to comment? -jason - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Tue Aug 13 21:23:15 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Telecommuting MMPOG Gig Message-ID: <20020813192315.A3049@timji.consultix.wa.com> looking for folks with Perl, C/C++, PHP, MySQL or PostgreSQL Postion to last for 4-6 weeks with more work coming about a week after that Pay will DOE Company headquarters is in Penn with a branch localy Bellevue We would require telecommuting We are producing a internet based MMPOG similar to some of the old door games from BBS days Questions should be directed to Jim Whigham jim@faststorm.com our company site is http://www.faststorm.com. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From pdarley at kinesis-cem.com Thu Aug 15 11:54:44 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question Message-ID: Friends, I am working with database stuff and I want to store deleted database records, so there's a history of what was in the database. I have chosen to do this by having my front end app, written in Perl, put all the field names and values into a single string separated by a non-printing Ascii character which I can just do a split() on later to return a hash of the record, which is exactly what I would get if I did a fetchrow_hashref() on the original record. My question is this; what non-printing Ascii character can I use for this? I wanted to use chr(0), the ascii null, but postgresql or DBD::Pg or DBI or something chokes on it. I went with chr(31) which is described as 'unit separator'. I'm worried that there may be some unexpected interaction with file systems or something that I'm unaware of, so I thought I'd ask y'all. Thanks, Peter Darley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From mathin at mathin.com Thu Aug 15 12:30:50 2002 From: mathin at mathin.com (Dan Ebert) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question In-Reply-To: References: Message-ID: <1029432650.6201.3.camel@algernon.lan.enic.cc> I have often used a separator like :::: (four colons), since the chances of that occuring in the data fields I wanted to parse was slim to none. That way you wouldn't have to worry about using non-printable chars. It does take up more bytes than a single char though. Dan. On Thu, 2002-08-15 at 09:54, Peter Darley wrote: > Friends, > I am working with database stuff and I want to store deleted database > records, so there's a history of what was in the database. I have chosen to > do this by having my front end app, written in Perl, put all the field names > and values into a single string separated by a non-printing Ascii character > which I can just do a split() on later to return a hash of the record, which > is exactly what I would get if I did a fetchrow_hashref() on the original > record. > My question is this; what non-printing Ascii character can I use for this? > I wanted to use chr(0), the ascii null, but postgresql or DBD::Pg or DBI or > something chokes on it. I went with chr(31) which is described as 'unit > separator'. I'm worried that there may be some unexpected interaction with > file systems or something that I'm unaware of, so I thought I'd ask y'all. > Thanks, > Peter Darley > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > -- Dan Ebert ---------------------------------------------------------- "If you're right 90% of the time, why quibble about the remaining 3%?" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From creede at penguinsinthenight.com Thu Aug 15 12:35:41 2002 From: creede at penguinsinthenight.com (Creede Lambard) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question In-Reply-To: References: Message-ID: <1029432943.1583.24.camel@svetlana> I'm not sure if there will be any problems with chr(31) as a field separator -- my inclination would be to try it and see -- but I have to wonder, why do you want to have the character be non-printing? If you use a visible but uncommon character like the pipe, you have a good idea where your records break into fields. Or better yet, use a tab, which is both whitespace and easily represented in a print string (\t) and still only takes up one character in your field. On Thu, 2002-08-15 at 09:54, Peter Darley wrote: > Friends, > I am working with database stuff and I want to store deleted database > records, so there's a history of what was in the database. I have chosen to > do this by having my front end app, written in Perl, put all the field names > and values into a single string separated by a non-printing Ascii character > which I can just do a split() on later to return a hash of the record, which > is exactly what I would get if I did a fetchrow_hashref() on the original > record. > My question is this; what non-printing Ascii character can I use for this? > I wanted to use chr(0), the ascii null, but postgresql or DBD::Pg or DBI or > something chokes on it. I went with chr(31) which is described as 'unit > separator'. I'm worried that there may be some unexpected interaction with > file systems or something that I'm unaware of, so I thought I'd ask y'all. > Thanks, > Peter Darley > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > -- * .~. `( ------------------------------------------------------------ ` / V \ . Creede Lambard : Live in a world of your own, /( )\ creede@penguinsinthenight.com : but always welcome visitors. ^^-^^ ------------------------------------------------------------ Perl Programmer and Linux Sysadmin, reasonable rates. Inquire within. GPG key at http://www.penguinsinthenight.com/creede_public_key.asc -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/archives/spug-list/attachments/20020815/fb10da90/attachment.bin From AEH at akc.org Thu Aug 15 12:41:34 2002 From: AEH at akc.org (Adrian Hands) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question Message-ID: Are you storing the deleted records in the database or on the filesystem ? Writing non-printable chars to a file shouldn't be a problem - you might need to use "binmode" though. Technically, since you probably can't really guarantee that the data doesn't contain non-printable characters, you should use some scheme of quoting any instances of your delimiter within the file before joining the fields. E.g. If your delimter is $delim: s@\\@\\\\@g; # quote any backslashes s@$delim@\\$delim@g; # quote any delimiter or there's probably modules you could for unicoding. >>> Dan Ebert 08/15/02 01:30PM >>> I have often used a separator like :::: (four colons), since the chances of that occuring in the data fields I wanted to parse was slim to none. That way you wouldn't have to worry about using non-printable chars. It does take up more bytes than a single char though. Dan. On Thu, 2002-08-15 at 09:54, Peter Darley wrote: > Friends, > I am working with database stuff and I want to store deleted database > records, so there's a history of what was in the database. I have chosen to > do this by having my front end app, written in Perl, put all the field names > and values into a single string separated by a non-printing Ascii character > which I can just do a split() on later to return a hash of the record, which > is exactly what I would get if I did a fetchrow_hashref() on the original > record. > My question is this; what non-printing Ascii character can I use for this? > I wanted to use chr(0), the ascii null, but postgresql or DBD::Pg or DBI or > something chokes on it. I went with chr(31) which is described as 'unit > separator'. I'm worried that there may be some unexpected interaction with > file systems or something that I'm unaware of, so I thought I'd ask y'all. > Thanks, > Peter Darley > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > -- Dan Ebert ---------------------------------------------------------- "If you're right 90% of the time, why quibble about the remaining 3%?" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From asimjalis at yahoo.com Thu Aug 15 12:41:54 2002 From: asimjalis at yahoo.com (Asim Jalis) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question In-Reply-To: Message-ID: <20020815174154.89658.qmail@web14207.mail.yahoo.com> Peter Darley wrote: > Friends, I am working with database stuff and I > want to store deleted database records, so > there's a history of what was in the database. > I have chosen to do this by having my front end > app, written in Perl, put all the field names > and values into a single string separated by a > non-printing Ascii character which I can just do > a split() on later to return a hash of the > record, which is exactly what I would get if I > did a fetchrow_hashref() on the original record. > My question is this; what non-printing Ascii > character can I use for this? I wanted to use > chr(0), the ascii null, but postgresql or > DBD::Pg or DBI or something chokes on it. I > went with chr(31) which is described as 'unit > separator'. I'm worried that there may be some > unexpected interaction with file systems or > something that I'm unaware of, so I thought I'd > ask y'all. Thanks, Peter Darley You should look into using Data::Dumper or YAML instead of defining your own format. If space is a consideration, you can compress the file as (or after) you write it. Asim __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From pdarley at kinesis-cem.com Thu Aug 15 12:53:37 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question In-Reply-To: <20020815174154.89658.qmail@web14207.mail.yahoo.com> Message-ID: Asim, I've used Data::Dumper to store structures in a db in the past, but since these will never be complex hashes (only simple key/value pairs)I figured that it would be better to have something that is a little smaller. After compression do you end up with a text string, or a binary string? I need to figure out how to deal with binary objects in the db, but don't want to do that right at this point. :) If I can't figure out weither the non-printable characters are safe I'll fall back to Data::Dumper. Thanks, Peter Darley -----Original Message----- From: Asim Jalis [mailto:asimjalis@yahoo.com] Sent: Thursday, August 15, 2002 10:42 AM To: Peter Darley; SPUG Subject: Re: SPUG: Stupid Ascii question Peter Darley wrote: > Friends, I am working with database stuff and I > want to store deleted database records, so > there's a history of what was in the database. > I have chosen to do this by having my front end > app, written in Perl, put all the field names > and values into a single string separated by a > non-printing Ascii character which I can just do > a split() on later to return a hash of the > record, which is exactly what I would get if I > did a fetchrow_hashref() on the original record. > My question is this; what non-printing Ascii > character can I use for this? I wanted to use > chr(0), the ascii null, but postgresql or > DBD::Pg or DBI or something chokes on it. I > went with chr(31) which is described as 'unit > separator'. I'm worried that there may be some > unexpected interaction with file systems or > something that I'm unaware of, so I thought I'd > ask y'all. Thanks, Peter Darley You should look into using Data::Dumper or YAML instead of defining your own format. If space is a consideration, you can compress the file as (or after) you write it. Asim __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From joneil at cobaltgroup.com Thu Aug 15 12:54:36 2002 From: joneil at cobaltgroup.com (O'neil, Jerome) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question Message-ID: > Peter Darley wrote: > Friends, I am working with database stuff and I > want to store deleted database records, so > there's a history of what was in the database. I know I'll be declared a heretic for recommending it, but if you have access to the database, why not simply let the database handle it instead of writing a bunch of code and custom formats. Add a boolean 'deleted' attribute to the relations in question, or create a new 'deleted records' relation, and add a trigger to copy the record on delete. Standard OLAP stuff. This way you have a complete history in the database, everything is fully recoverable via your SOP database management practices, and you've saved a bunch of time. $0.02 worth. Spend wisely... -Jerome -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020815/6be11196/attachment.htm From tleffler at u.washington.edu Thu Aug 15 12:54:52 2002 From: tleffler at u.washington.edu (Trevor Leffler) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question References: Message-ID: <3D5BEAEC.60605@u.washington.edu> Peter, I can't say that any non-printing ascii character would or wouldn't work for you. However, I offer these two solutions: 1. You could use a printing character, and encode any instances of that character in the data. For example, you might get away with using "," as a delimiter and encode all other instances as "%2C". Obviously this makes the assumption that the data will not already contain the string "%2C". 2. You could construct a hash of your field names and the corresponding values, and then serialize the structure with, for example, Storable.pm. You can then store this serialized structure to your database. Apache::Session is a module that does this. As an aside, since it appears that you're logging this data to your DB, which is choking, have you considered logging to text files? They make for great logs: easily accessible, readable, gzip-able, archive-able, backup-able. --Trevor Peter Darley wrote: > Friends, > I am working with database stuff and I want to store deleted database > records, so there's a history of what was in the database. I have chosen to > do this by having my front end app, written in Perl, put all the field names > and values into a single string separated by a non-printing Ascii character > which I can just do a split() on later to return a hash of the record, which > is exactly what I would get if I did a fetchrow_hashref() on the original > record. > My question is this; what non-printing Ascii character can I use for this? > I wanted to use chr(0), the ascii null, but postgresql or DBD::Pg or DBI or > something chokes on it. I went with chr(31) which is described as 'unit > separator'. I'm worried that there may be some unexpected interaction with > file systems or something that I'm unaware of, so I thought I'd ask y'all. > Thanks, > Peter Darley > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From pdarley at kinesis-cem.com Thu Aug 15 12:55:58 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question In-Reply-To: <1029432650.6201.3.camel@algernon.lan.enic.cc> Message-ID: Dan, I'd like to make sure that it can handle any normal (readable) text, since I don't know what might be stored in the future. Thanks, Peter Darley -----Original Message----- From: Dan Ebert [mailto:mathin@mathin.com] Sent: Thursday, August 15, 2002 10:31 AM To: Peter Darley Cc: SPUG Subject: Re: SPUG: Stupid Ascii question I have often used a separator like :::: (four colons), since the chances of that occuring in the data fields I wanted to parse was slim to none. That way you wouldn't have to worry about using non-printable chars. It does take up more bytes than a single char though. Dan. On Thu, 2002-08-15 at 09:54, Peter Darley wrote: > Friends, > I am working with database stuff and I want to store deleted database > records, so there's a history of what was in the database. I have chosen to > do this by having my front end app, written in Perl, put all the field names > and values into a single string separated by a non-printing Ascii character > which I can just do a split() on later to return a hash of the record, which > is exactly what I would get if I did a fetchrow_hashref() on the original > record. > My question is this; what non-printing Ascii character can I use for this? > I wanted to use chr(0), the ascii null, but postgresql or DBD::Pg or DBI or > something chokes on it. I went with chr(31) which is described as 'unit > separator'. I'm worried that there may be some unexpected interaction with > file systems or something that I'm unaware of, so I thought I'd ask y'all. > Thanks, > Peter Darley > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > -- Dan Ebert ---------------------------------------------------------- "If you're right 90% of the time, why quibble about the remaining 3%?" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From cmeyer at helvella.org Thu Aug 15 12:56:08 2002 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question In-Reply-To: ; from pdarley@kinesis-cem.com on Thu, Aug 15, 2002 at 09:54:44AM -0700 References: Message-ID: <20020815105608.B26003@hobart.helvella.org> On Thu, Aug 15, 2002 at 09:54:44AM -0700, Peter Darley wrote: > Friends, > I am working with database stuff and I want to store deleted database > records, so there's a history of what was in the database. I have chosen to > do this by having my front end app, written in Perl, put all the field names > and values into a single string separated by a non-printing Ascii character > which I can just do a split() on later to return a hash of the record, which > is exactly what I would get if I did a fetchrow_hashref() on the original > record. I would suggest two alternatives. Since you are already using a database, which does a good job of keeping separate fields, you could use another table to hold the deleted records. This table would simply have the same columns as the original table. Trying to encode and decode fields from a string seems like a lot of extra work that the db is quite capable of. Another option would be to use Text::CSV_XS. This is a module that is very good at joining and splitting fields to and from strings. You can select the separator character, or let it use the default comma (which it automatically escapes within your fields). Have fun, -Colin. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From pdarley at kinesis-cem.com Thu Aug 15 13:07:04 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question In-Reply-To: Message-ID: Jerome, I thought I might get this question. The reasons are: I don't want deleted stuff in the real table, growing indexes and potentially slowing down queries etc. If the deleted stuff stays in the original table there is a good chance that there will be collisions with primary keys or other unique constraints if something similar is added back in in the future. I want to be able to put all deleted stuff into one table, rather than having one 'deleted' table for each real table I have. If I can pack everything into a string the table doesn't need to match because all the data goes into one field. Thanks, Peter Darley -----Original Message----- From: O'neil, Jerome [mailto:joneil@cobaltgroup.com] Sent: Thursday, August 15, 2002 10:55 AM To: Peter Darley; SPUG Subject: RE: SPUG: Stupid Ascii question > Peter Darley wrote: > Friends, I am working with database stuff and I > want to store deleted database records, so > there's a history of what was in the database. I know I'll be declared a heretic for recommending it, but if you have access to the database, why not simply let the database handle it instead of writing a bunch of code and custom formats. Add a boolean 'deleted' attribute to the relations in question, or create a new 'deleted records' relation, and add a trigger to copy the record on delete. Standard OLAP stuff. This way you have a complete history in the database, everything is fully recoverable via your SOP database management practices, and you've saved a bunch of time. $0.02 worth. Spend wisely... -Jerome - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From pdarley at kinesis-cem.com Thu Aug 15 13:15:00 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question In-Reply-To: <20020815105608.B26003@hobart.helvella.org> Message-ID: Colin, The Text::CSV_XS option seems very close to the Data::Dumper option, which I guess I would prefer since it creates more human readable (at least to me) output. It looks like the consensus is that I should use something to create a string for me that will take care of all the escaping of separators and such. I'll probably use Data::Dumper. Thanks everyone, Peter Darley -----Original Message----- From: Colin Meyer [mailto:cmeyer@helvella.org] Sent: Thursday, August 15, 2002 10:56 AM To: Peter Darley Cc: SPUG Subject: Re: SPUG: Stupid Ascii question On Thu, Aug 15, 2002 at 09:54:44AM -0700, Peter Darley wrote: > Friends, > I am working with database stuff and I want to store deleted database > records, so there's a history of what was in the database. I have chosen to > do this by having my front end app, written in Perl, put all the field names > and values into a single string separated by a non-printing Ascii character > which I can just do a split() on later to return a hash of the record, which > is exactly what I would get if I did a fetchrow_hashref() on the original > record. I would suggest two alternatives. Since you are already using a database, which does a good job of keeping separate fields, you could use another table to hold the deleted records. This table would simply have the same columns as the original table. Trying to encode and decode fields from a string seems like a lot of extra work that the db is quite capable of. Another option would be to use Text::CSV_XS. This is a module that is very good at joining and splitting fields to and from strings. You can select the separator character, or let it use the default comma (which it automatically escapes within your fields). Have fun, -Colin. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From cansubaykan at hotmail.com Thu Aug 15 13:18:57 2002 From: cansubaykan at hotmail.com (Can Subaykan) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question Message-ID: If the data comes from a variety of sources (like from users who might have copy&pasted text from word processor documents etc.) the content itself might include some weird non-printing ascii characters. With any bad luck, some may include the character you chose as the separator. Maybe some kind of tag you can identify like ? ASCII stupid question, get a stupid ANSI ;) ----Original Message Follows---- From: "Peter Darley" To: "Dan Ebert" CC: "SPUG" Subject: RE: SPUG: Stupid Ascii question Date: Thu, 15 Aug 2002 10:55:58 -0700 Dan, I'd like to make sure that it can handle any normal (readable) text, since I don't know what might be stored in the future. Thanks, Peter Darley -----Original Message----- From: Dan Ebert [mailto:mathin@mathin.com] Sent: Thursday, August 15, 2002 10:31 AM To: Peter Darley Cc: SPUG Subject: Re: SPUG: Stupid Ascii question I have often used a separator like :::: (four colons), since the chances of that occuring in the data fields I wanted to parse was slim to none. That way you wouldn't have to worry about using non-printable chars. It does take up more bytes than a single char though. Dan. On Thu, 2002-08-15 at 09:54, Peter Darley wrote: > Friends, > I am working with database stuff and I want to store deleted database > records, so there's a history of what was in the database. I have chosen to > do this by having my front end app, written in Perl, put all the field names > and values into a single string separated by a non-printing Ascii character > which I can just do a split() on later to return a hash of the record, which > is exactly what I would get if I did a fetchrow_hashref() on the original > record. > My question is this; what non-printing Ascii character can I use for this? > I wanted to use chr(0), the ascii null, but postgresql or DBD::Pg or DBI or > something chokes on it. I went with chr(31) which is described as 'unit > separator'. I'm worried that there may be some unexpected interaction with > file systems or something that I'm unaware of, so I thought I'd ask y'all. > Thanks, > Peter Darley > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > -- Dan Ebert ---------------------------------------------------------- "If you're right 90% of the time, why quibble about the remaining 3%?" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From me at donshanks.com Thu Aug 15 13:29:05 2002 From: me at donshanks.com (Don Shanks) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question In-Reply-To: Message-ID: <002c01c24489$a983f140$8c280a0a@telgar> Failing the access to the database, have you considered ( Here goes my heretical slant ) using XML, something simple like XML::Element, compress the file if need be. both string and binary data can be stored. -Don -----Original Message----- From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org] On Behalf Of O'neil, Jerome Sent: Thursday, 15 August, 2002 10:55 To: Peter Darley; SPUG Subject: RE: SPUG: Stupid Ascii question > Peter Darley wrote: > Friends, I am working with database stuff and I > want to store deleted database records, so > there's a history of what was in the database. I know I'll be declared a heretic for recommending it, but if you have access to the database, why not simply let the database handle it instead of writing a bunch of code and custom formats. Add a boolean 'deleted' attribute to the relations in question, or create a new 'deleted records' relation, and add a trigger to copy the record on delete. Standard OLAP stuff. This way you have a complete history in the database, everything is fully recoverable via your SOP database management practices, and you've saved a bunch of time. $0.02 worth. Spend wisely... -Jerome -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020815/e407b7af/attachment.htm From dancerboy at strangelight.com Thu Aug 15 15:52:19 2002 From: dancerboy at strangelight.com (dancerboy) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Stupid Ascii question In-Reply-To: <1029432650.6201.3.camel@algernon.lan.enic.cc> References: <1029432650.6201.3.camel@algernon.lan.enic.cc> Message-ID: At 10:30 AM -0700 8/15/02, Dan Ebert wrote: >I have often used a separator like :::: (four colons), since the chances >of that occuring in the data fields I wanted to parse was slim to none. >That way you wouldn't have to worry about using non-printable chars. It >does take up more bytes than a single char though. Once, when coding a web-based job-listing database application, I and the DB designer solved this problem by making the record delimiter be "" -- since the chances of the string "" showing up in any of our job listings was, naturally, exactly nil. This was, of course, a searchable database, and for speed searching was done on the raw (un-split) records. This had the interesting side-effect that doing a search for "corporate whore" would return every single job listing in the database. We considered this a "feature" ;) -jason - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From eric.brose at attws.com Thu Aug 15 16:25:46 2002 From: eric.brose at attws.com (Brose, Eric) Date: Wed Aug 4 00:09:08 2004 Subject: No subject Message-ID: <67AC2DB52118D411A8F300508B957F120D70628E@WA-MSG02> Hello all, I have a several hashrefs I need to look through, all with similar/identical structure. What I'd like to do, is have an array hold the exact places to look in the hash ref. By cycling through the array, I'd like to do something like below, where I just prepend the hashref name and I get to view the goods. @HBSource=("->{vtComponent}->{deployName}","->{vtComponent}->{vtFlow}->{vtPr operty}->{channel}->{value}","->{vtComponent}->{vtFlow}->{vtProperty}->{host name}->{value}","->{vtComponent}->{vtFlow}->{vtProperty}->{QManager}->{value }","->{vtComponent}->{vtFlow}->{vtProperty}->{transactionQueue}->{value}","- >{vtComponent}->{vtFlow}->{vtProperty}->{QName}->{value}"); foreach (@HBSource){ $value1 = $hash1."$_"; $value2 = $hash2."$_"; $value3 = $hash3."$_"; print "$value1\n$value2\n$value3\n";} However, this just doesn't work. My output ends up looking like: HASH(0x1cfebec)->{vtComponent}->{deployName} HASH(0x1cfebec)->{vtComponent}->{vtFlow}->{vtProperty}->{channel}->{value} HASH(0x1cfebec)->{vtComponent}->{vtFlow}->{vtProperty}->{hostname}->{value} HASH(0x1cfebec)->{vtComponent}->{vtFlow}->{vtProperty}->{QManager}->{value} HASH(0x1cfebec)->{vtComponent}->{vtFlow}->{vtProperty}->{transactionQueue}-> {value} HASH(0x1cfebec)->{vtComponent}->{vtFlow}->{vtProperty}->{QName}->{value} I have had success when I put the hashref name in the array(see below), but I'd like to be able to programatically cycle through just one array. @HBSource=("$hash->{vtComponent}->{deployName}","$hash->{vtComponent}->{vtFl ow}->{vtProperty}->{channel}->{value}","$hash->{vtComponent}->{vtFlow}->{vtP roperty}->{hostname}->{value}","$hash->{vtComponent}->{vtFlow}->{vtProperty} ->{QManager}->{value}","$hash->{vtComponent}->{vtFlow}->{vtProperty}->{trans actionQueue}->{value}","$hash->{vtComponent}->{vtFlow}->{vtProperty}->{QName }->{value}"); Any ideas would be appreciated. Eric - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From kahn at cpan.org Thu Aug 15 16:43:31 2002 From: kahn at cpan.org (Jeremy Kahn) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: X-Y scatter-plotting with annotated datapoints Message-ID: SPUGsters -- So I've got this complex data-set representing phonetic symbols and a couple of pitch and timing values (in milliseconds and Hertz) for each symbol. (This is data emitted by a text processing engine, coming up with a plausible prosody for text-to-speech synthesis). Sample (and entirely bogus) data is at the bottom of this note. What I'd like to do is an X-Y plot (where time in ms is the X axis, and Hz is the Y axis, with each "target" representing a point on that plot). Ideally, the dots should be connected along the timeline (in their X ordering). More important than the connectedness, though, is that the targets be associated with the phonetic symbols they are subordinate to. These data are pretty much worthless as a series of points if I can't synchronize those points to the phonetic symbols. I can think of two nice ways to demonstrate the synchronization: * attach the phone symbol to each point * plot the phone symbols as regions along the X axis But I've gotten stuck looking for a tool that can build me this graph. I experimented with Excel's graphing abilities -- no dice, as far as I could tell, since I could get the X-Y plot, but no way to attach the phone symbols, or I could get the phone symbols, but then they were evenly-spaced along the X (time!) axis, despite their widely varying time signatures. I once solved a problem like this using SAS, but I don't have it now and I don't have the budget. So, I thought, I'll turn to Perl, since everything is easier in Perl. (It is, isn't it?) I found Martin Verbruggen's GD::Graph, which is very spiffy, but doesn't have a way to do this all neatly packaged. Before I plunge in to write an extension to GD::Graph (or -- please, no -- write it directly in GD!), does anybody have any ideas or advice? Has anybody solved a problem like this before using Perl? --Jeremy Data follows: Note the format below is not what I'm using; I've got it in XML, so it's completely parsed. I am *not* interested in help parsing the data, just giving some sense of the kind of data I have. Input text: "she had" __DATA__ ms Hz phonetic-symbol --------------------------- 0 120 S 20 118 (also S) 30 110 i 70 125 (also i) 90 120 h 120 110 (also h) 170 108 A 200 105 (also A) 210 100 d 245 95 (also d) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Thu Aug 15 17:18:49 2002 From: tim at consultix-inc.com (SPUG-list-owner) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: X-Y scatter-plotting with annotated datapoints In-Reply-To: References: Message-ID: <20020815151849.A11500@timji.consultix.wa.com> On Thu, Aug 15, 2002 at 02:43:31PM -0700, Jeremy Kahn wrote: Hi Jeremy, Why not just color-code the dots to the phonetic labels? Of course, if you have more data points than your printer or human vision can differentiate, or if they would overlap, then this approach might not be feasible. Having blithely offered that easy solution, I suppose your next question would be what software will do this for you! Unfortunately, I don't have the answer to that, but perhaps this idea will help you redirect your search in the right quarters (for "scatterplot" software, e.g.). -Tim *----------------------------------------------------------------------------* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | | UPCOMING CLASSES: 9/18: Int. Perl 9/23: Shell & Utilities | *----------------------------------------------------------------------------* > SPUGsters -- > > So I've got this complex data-set representing phonetic symbols and a > couple of pitch and timing values (in milliseconds and Hertz) for each > symbol. (This is data emitted by a text processing engine, coming up with > a plausible prosody for text-to-speech synthesis). Sample (and entirely > bogus) data is at the bottom of this note. > > What I'd like to do is an X-Y plot (where time in ms is the X axis, and > Hz is the Y axis, with each "target" representing a point on that plot). > Ideally, the dots should be connected along the timeline (in their X > ordering). > > More important than the connectedness, though, is that the targets be > associated with the phonetic symbols they are subordinate to. These data > are pretty much worthless as a series of points if I can't synchronize > those points to the phonetic symbols. I can think of two nice ways to > demonstrate the synchronization: > > * attach the phone symbol to each point > * plot the phone symbols as regions along the X axis > > But I've gotten stuck looking for a tool that can build me this graph. I > experimented with Excel's graphing abilities -- no dice, as far as I could > tell, since I could get the X-Y plot, but no way to attach the phone > symbols, or I could get the phone symbols, but then they were > evenly-spaced along the X (time!) axis, despite their widely varying time > signatures. > > I once solved a problem like this using SAS, but I don't have it now and I > don't have the budget. > > So, I thought, I'll turn to Perl, since everything is easier in Perl. > (It is, isn't it?) I found Martin Verbruggen's GD::Graph, which is very > spiffy, but doesn't have a way to do this all neatly packaged. Before I > plunge in to write an extension to GD::Graph (or -- please, no -- write it > directly in GD!), does anybody have any ideas or advice? Has anybody > solved a problem like this before using Perl? > > --Jeremy > > > Data follows: > Note the format below is not what I'm using; I've got it in XML, so it's > completely parsed. I am *not* interested in help parsing the data, just > giving some sense of the kind of data I have. > > Input text: "she had" > > __DATA__ > > ms Hz phonetic-symbol > --------------------------- > 0 120 S > 20 118 (also S) > 30 110 i > 70 125 (also i) > 90 120 h > 120 110 (also h) > 170 108 A > 200 105 (also A) > 210 100 d > 245 95 (also d) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From sthoenna at efn.org Fri Aug 16 00:11:44 2002 From: sthoenna at efn.org (Yitzchak Scott-Thoennes) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: Re: multilevel hash lookups References: <67AC2DB52118D411A8F300508B957F120D70628E@WA-MSG02> Message-ID: On Thu, 15 Aug 2002 14:25:46 -0700, eric.brose@attws.com wrote: >@HBSource=("->{vtComponent}->{deployName}","->{vtComponent}->{vtFlow}->{vtPr >operty}->{channel}->{value}","->{vtComponent}->{vtFlow}->{vtProperty}->{host >name}->{value}","->{vtComponent}->{vtFlow}->{vtProperty}->{QManager}->{value >}","->{vtComponent}->{vtFlow}->{vtProperty}->{transactionQueue}->{value}","- >>{vtComponent}->{vtFlow}->{vtProperty}->{QName}->{value}"); > > foreach (@HBSource){ > $value1 = $hash1."$_"; > $value2 = $hash2."$_"; > $value3 = $hash3."$_"; Sounds like your data structure doesn't quite match what you want to do with it. Perhaps some OO encapsulation is in order? Nevertheless, to do it the way you are trying, you need to reinvoke the parser at run-time. The way to do this is with eval EXPR: foreach (@HBSource) { eval("\$value1 = \$hash1$_; \$value2 = \$hash2$_; \$value3 = \$hash3$_; 1") || die "bad code in \@HBSource ($_): $@"; } Replace the eval with print to see the code it is using. Alternatively, something like: sub deep_lookup { my ($val, $keys) = @_; for my $key (@$keys) { $val = $val->{$key} } return $val } @HBSource = (["vtComponent", "deployName"], ["vtComponent", "vtFlow"], ... ); foreach $src (@HBSource) { $value1 = deep_lookup($hash1, $src); ... } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jeremycalvert2000 at yahoo.com Fri Aug 16 16:11:10 2002 From: jeremycalvert2000 at yahoo.com (Jeremy Calvert) Date: Wed Aug 4 00:09:08 2004 Subject: SPUG: X-Y scatter-plotting with annotated datapoints In-Reply-To: <20020815151849.A11500@timji.consultix.wa.com> Message-ID: <20020816211110.55327.qmail@web11907.mail.yahoo.com> A cheap and dirty option: ---- use GD::Graph::lines; my @data; for(my $i=0; $i<=245; $i++){ ${$data[0]}[$i] = undef; ${$data[1]}[$i] = undef; } ${$data[0]}[0] = "0 S"; ${$data[1]}[0] = 120; ${$data[0]}[20] = "20 S"; ${$data[1]}[20] = 118; ${$data[0]}[30] = "30 i"; ${$data[1]}[30] = 110; ...and so on... $my_graph = new GD::Graph::lines(); $my_graph->plot(\@data); ------ which is to say, by filling in two 245 element arrays with nulls, then sprinkling in your data in the way indicated above, then passing them to GD::Graph, and plotting them as a line graph, it does what you want it to...It spaces the points on the x-axis correctly and connects the actual data points (as opposed to (undef, undef) points) with straight lines. YASJ --- SPUG-list-owner wrote: > On Thu, Aug 15, 2002 at 02:43:31PM -0700, Jeremy > Kahn wrote: > > Hi Jeremy, > > Why not just color-code the dots to the phonetic > labels? Of course, > if you have more data points than your printer or > human vision can > differentiate, or if they would overlap, then this > approach might > not be feasible. > > Having blithely offered that easy solution, I > suppose your next question > would be what software will do this for you! > Unfortunately, I don't > have the answer to that, but perhaps this idea will > help you redirect > your search in the right quarters (for "scatterplot" > software, e.g.). > > -Tim > *----------------------------------------------------------------------------* > | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) > DOC-PERL; (866) DOC-LINUX | > | Ph.D. & JAWCAR ("Just Another White Camel Award > Recipient") | > | tim@consultix-inc.com teachmeunix.com > teachmeperl.com teachmelinux.net | > | UPCOMING CLASSES: 9/18: Int. Perl 9/23: > Shell & Utilities | > *----------------------------------------------------------------------------* > > > SPUGsters -- > > > > So I've got this complex data-set representing > phonetic symbols and a > > couple of pitch and timing values (in milliseconds > and Hertz) for each > > symbol. (This is data emitted by a text processing > engine, coming up with > > a plausible prosody for text-to-speech synthesis). > Sample (and entirely > > bogus) data is at the bottom of this note. > > > > What I'd like to do is an X-Y plot (where time in > ms is the X axis, and > > Hz is the Y axis, with each "target" representing > a point on that plot). > > Ideally, the dots should be connected along the > timeline (in their X > > ordering). > > > > More important than the connectedness, though, is > that the targets be > > associated with the phonetic symbols they are > subordinate to. These data > > are pretty much worthless as a series of points if > I can't synchronize > > those points to the phonetic symbols. I can think > of two nice ways to > > demonstrate the synchronization: > > > > * attach the phone symbol to each point > > * plot the phone symbols as regions along the X > axis > > > > But I've gotten stuck looking for a tool that can > build me this graph. I > > experimented with Excel's graphing abilities -- no > dice, as far as I could > > tell, since I could get the X-Y plot, but no way > to attach the phone > > symbols, or I could get the phone symbols, but > then they were > > evenly-spaced along the X (time!) axis, despite > their widely varying time > > signatures. > > > > I once solved a problem like this using SAS, but I > don't have it now and I > > don't have the budget. > > > > So, I thought, I'll turn to Perl, since everything > is easier in Perl. > > (It is, isn't it?) I found Martin Verbruggen's > GD::Graph, which is very > > spiffy, but doesn't have a way to do this all > neatly packaged. Before I > > plunge in to write an extension to GD::Graph (or > -- please, no -- write it > > directly in GD!), does anybody have any ideas or > advice? Has anybody > > solved a problem like this before using Perl? > > > > --Jeremy > > > > > > Data follows: > > Note the format below is not what I'm using; I've > got it in XML, so it's > > completely parsed. I am *not* interested in help > parsing the data, just > > giving some sense of the kind of data I have. > > > > Input text: "she had" > > > > __DATA__ > > > > ms Hz phonetic-symbol > > --------------------------- > > 0 120 S > > 20 118 (also S) > > 30 110 i > > 70 125 (also i) > > 90 120 h > > 120 110 (also h) > > 170 108 A > > 200 105 (also A) > > 210 100 d > > 245 95 (also d) > > - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: > owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: > ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL > by your Email-address > For daily traffic, use spug-list for LIST ; for > weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: > http://seattleperl.org > __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From kahn at cpan.org Fri Aug 16 17:30:28 2002 From: kahn at cpan.org (Jeremy Kahn) Date: Wed Aug 4 00:09:09 2004 Subject: ANNOUNCE: Chart::Plot::Annotated (was Re: SPUG: X-Y scatter-plotting with annotated datapoints) In-Reply-To: <20020816211110.55327.qmail@web11907.mail.yahoo.com> Message-ID: SPUGsters -- For my application, the winnah is Sanford Morton, whose module Chart::Plot had both the elegance of flexibility and ease of use and the power of leaving hooks to the underlying GD object exposed. This made it easy for me to write a subclass, Chart::Plot::Annotated, which I have submitted to CPAN early this afternoon (look for it there or at http://students.washington.edu/~jgk/modules/), which allows text annotation of Chart::Plot style dataplots. For an example of the results, see: http://students.washington.edu/~jgk/modules/C-P-A-exx/prosodytrack.png This example pitch-plots a few sentences (the first two phrases are: "The last one was simple. This one is a bit more sophisticated."). No guarantees on any *naturalness* to this prosody, by the way, but the picture is pretty spiffy. Thanks to everybody who thought about this for me. Please let me know if anybody else finds this useful; I'd be pleased if this was an instant-turnaround win for everybody. Thanks all, and especially Sanford. --jeremy On Fri, 16 Aug 2002, Jeremy Calvert wrote: > A cheap and dirty option: > ---- > use GD::Graph::lines; > > my @data; > for(my $i=0; $i<=245; $i++){ > ${$data[0]}[$i] = undef; > ${$data[1]}[$i] = undef; > } > ${$data[0]}[0] = "0 S"; > ${$data[1]}[0] = 120; > > ${$data[0]}[20] = "20 S"; > ${$data[1]}[20] = 118; > > ${$data[0]}[30] = "30 i"; > ${$data[1]}[30] = 110; > > ....and so on... > > $my_graph = new GD::Graph::lines(); > $my_graph->plot(\@data); > > ------ > > which is to say, by filling in two 245 element arrays > with nulls, then sprinkling in your data in the way > indicated above, then passing them to GD::Graph, and > plotting them as a line graph, it does what you want > it to...It spaces the points on the x-axis correctly > and connects the actual data points (as opposed to > (undef, undef) points) with straight lines. > > YASJ > > --- SPUG-list-owner wrote: > > On Thu, Aug 15, 2002 at 02:43:31PM -0700, Jeremy > > Kahn wrote: > > > > Hi Jeremy, > > > > Why not just color-code the dots to the phonetic > > labels? Of course, > > if you have more data points than your printer or > > human vision can > > differentiate, or if they would overlap, then this > > approach might > > not be feasible. > > > > Having blithely offered that easy solution, I > > suppose your next question > > would be what software will do this for you! > > Unfortunately, I don't > > have the answer to that, but perhaps this idea will > > help you redirect > > your search in the right quarters (for "scatterplot" > > software, e.g.). > > > > -Tim > > > *----------------------------------------------------------------------------* > > | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) > > DOC-PERL; (866) DOC-LINUX | > > | Ph.D. & JAWCAR ("Just Another White Camel Award > > Recipient") | > > | tim@consultix-inc.com teachmeunix.com > > teachmeperl.com teachmelinux.net | > > | UPCOMING CLASSES: 9/18: Int. Perl 9/23: > > Shell & Utilities | > > > *----------------------------------------------------------------------------* > > > > > SPUGsters -- > > > > > > So I've got this complex data-set representing > > phonetic symbols and a > > > couple of pitch and timing values (in milliseconds > > and Hertz) for each > > > symbol. (This is data emitted by a text processing > > engine, coming up with > > > a plausible prosody for text-to-speech synthesis). > > Sample (and entirely > > > bogus) data is at the bottom of this note. > > > > > > What I'd like to do is an X-Y plot (where time in > > ms is the X axis, and > > > Hz is the Y axis, with each "target" representing > > a point on that plot). > > > Ideally, the dots should be connected along the > > timeline (in their X > > > ordering). > > > > > > More important than the connectedness, though, is > > that the targets be > > > associated with the phonetic symbols they are > > subordinate to. These data > > > are pretty much worthless as a series of points if > > I can't synchronize > > > those points to the phonetic symbols. I can think > > of two nice ways to > > > demonstrate the synchronization: > > > > > > * attach the phone symbol to each point > > > * plot the phone symbols as regions along the X > > axis > > > > > > But I've gotten stuck looking for a tool that can > > build me this graph. I > > > experimented with Excel's graphing abilities -- no > > dice, as far as I could > > > tell, since I could get the X-Y plot, but no way > > to attach the phone > > > symbols, or I could get the phone symbols, but > > then they were > > > evenly-spaced along the X (time!) axis, despite > > their widely varying time > > > signatures. > > > > > > I once solved a problem like this using SAS, but I > > don't have it now and I > > > don't have the budget. > > > > > > So, I thought, I'll turn to Perl, since everything > > is easier in Perl. > > > (It is, isn't it?) I found Martin Verbruggen's > > GD::Graph, which is very > > > spiffy, but doesn't have a way to do this all > > neatly packaged. Before I > > > plunge in to write an extension to GD::Graph (or > > -- please, no -- write it > > > directly in GD!), does anybody have any ideas or > > advice? Has anybody > > > solved a problem like this before using Perl? > > > > > > --Jeremy > > > > > > > > > Data follows: > > > Note the format below is not what I'm using; I've > > got it in XML, so it's > > > completely parsed. I am *not* interested in help > > parsing the data, just > > > giving some sense of the kind of data I have. > > > > > > Input text: "she had" > > > > > > __DATA__ > > > > > > ms Hz phonetic-symbol > > > --------------------------- > > > 0 120 S > > > 20 118 (also S) > > > 30 110 i > > > 70 125 (also i) > > > 90 120 h > > > 120 110 (also h) > > > 170 108 A > > > 200 105 (also A) > > > 210 100 d > > > 245 95 (also d) > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - > > - - - - - - - - - - - > > POST TO: spug-list@pm.org PROBLEMS: > > owner-spug-list@pm.org > > Subscriptions; Email to majordomo@pm.org: > > ACTION LIST EMAIL > > Replace ACTION by subscribe or unsubscribe, EMAIL > > by your Email-address > > For daily traffic, use spug-list for LIST ; for > > weekly, spug-list-digest > > Seattle Perl Users Group (SPUG) Home Page: > > http://seattleperl.org > > > > > __________________________________________________ > Do You Yahoo!? > HotJobs - Search Thousands of New Jobs > http://www.hotjobs.com > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Tue Aug 20 14:27:08 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Meeting tonight: "Extreme/Spam" Message-ID: <20020820122708.A13766@timji.consultix.wa.com> August 2002 Seattle Perl User's Group Meeting ------------------------------------------------------ Speaker #1: Asim Jalis: "Extreme Perl" Speaker #2: Creede Lambard: "Mail::SpamAssassin" Time: Tuesday, August 20, 2002 7-9pm Location: SAFECO bldg, Brooklyn St. and NE 45th St. Cost: Admission is free and open to the general public. Info: http://seattleperl.org/ ------------------------------------------------------ "Extreme Perl", by Asim Jalis ------------------------------------------------------ In this talk, you will learn: - What's eXtreme Programming, Unit Testing, Refactoring, and Emergent Architecture. - What's in the CPAN unit testing modules and how to use these modules to tighten your code. - How to jump into coding without spending weeks and months in architecture and design, and still deliver code that is rock-solid. - How to shock your product manager by cheerfully accepting brand new requirements and then implementing them without breaking any existing functionality. We will talk about unit testing, refactoring, and emergent architecture as they apply to Perl, and then we'll do some mob programming to experience how it works in practice. About the Speaker, Asim Jalis ----------------------------- Asim is a software engineer at Hewlett-Packard where he is working on printing applications of web services using C#/.NET. He uses Perl to run an internal website and for various maintenance tasks. He has an M.S. in computer science and an M.A. in mathematics. ------------------------------------------------------ "Mail::SpamAssassin", by Creede Lambard ------------------------------------------------------ This talk will include: - a description of how Unix delivers your mail - a brief understated diatribe on why spam is bad - how to use Mail::Audit to filter your mail - how Mail::SpamAssassin can help decide what's worth keeping About the Speaker, Creede Lambard: --------------------------------- I'm a computer professional with over 20 years' experience in various platforms. I first learned Perl about five years ago and discovered that English really wasn't my native language after all. I'm a veteran of Microsoft, RealNetworks, The Cobalt Group and several lesser entities, and am currently looking for another position so I know definitively what kind of work I'm out of. See you there! -Tim ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== *============================================================================* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | JAPH, JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | | 8/26: Perl+Modules 9/18: Int Perl 9/23: Shell & Utilities OCT: mjd ? | *============================================================================* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Tue Aug 20 14:31:32 2002 From: tim at consultix-inc.com (Tim Maher) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Anyone for Dinner? Message-ID: <20020820123132.B13766@timji.consultix.wa.com> SPUGsters, Anybody feel like congregating for dinner at the Cedars at 50th and Brooklyn? My time is pretty flexible today, so I could show up in the 5:30 - 5:45pm time frame. -Tim *----------------------------------------------------------------------------* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | | CLASSES: 8/26: Perl + Modules; 9/18: Int. Perl 9/23: Shell & Utilities | *----------------------------------------------------------------------------* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From cmeyer at helvella.org Tue Aug 20 16:20:08 2002 From: cmeyer at helvella.org (Colin Meyer) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Anyone for Dinner? In-Reply-To: <20020820123132.B13766@timji.consultix.wa.com>; from tim@consultix-inc.com on Tue, Aug 20, 2002 at 12:31:32PM -0700 References: <20020820123132.B13766@timji.consultix.wa.com> Message-ID: <20020820142008.A3060@hobart.helvella.org> On Tue, Aug 20, 2002 at 12:31:32PM -0700, Tim Maher wrote: > SPUGsters, > > Anybody feel like congregating for dinner at the Cedars at 50th and > Brooklyn? > > My time is pretty flexible today, so I could show up in the 5:30 - 5:45pm > time frame. I'll be there at about 5:45. See you, -Colin. > > -Tim > *----------------------------------------------------------------------------* > | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | > | Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") | > | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | > | CLASSES: 8/26: Perl + Modules; 9/18: Int. Perl 9/23: Shell & Utilities | > *----------------------------------------------------------------------------* > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Wed Aug 21 14:03:32 2002 From: tim at consultix-inc.com (SPUG-list-owner) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Spamassassin Example Message-ID: <20020821120332.A16729@timji.consultix.wa.com> SPUGsters, As a follow-up to Creede's excellent talk on mail filtering and SpamAssassin last night, I thought it would be helpful to show you an actual SPAM message (in case you've never seen one 8-}) and the detailed annotations that spamassassin inserted into it to explain its identification as such. Normally, I wouldn't have seen this message at all, because it gets relegated to my .caughtspam folder, but I fished it out to show you. See below... -Tim P.S. It also adds *****SPAM***** to the subject line. *----------------------------------------------------------------------------* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | | CLASSES: 8/26: Perl + Modules; 9/18: Int. Perl 9/23: Shell & Utilities | *----------------------------------------------------------------------------* x-esmtp: 0 0 1 Reply-To: "T. Montague" Errors-to: terry_m2000@HotPOP.com From: "T. Montague" To: yumpy@consultix-inc.com Subject: *****SPAM***** Cash Only Home Based Business - Start Today for $25. Date: Fri, 16 Aug 2002 22:39:08 -0700 X-MIME-Autoconverted: from quoted-printable to 8bit by timji.consultix.wa.com id VAA03539 X-Spam-Status: Yes, hits=12.5 required=5.0 tests=FROM_ENDS_IN_NUMS,DEAR_FRIEND,DEAR_SOMEBODY,GUARANTEE,BULK_EMAIL,FOR_FREE,JODY,REMOVE_SUBJ,SENT_IN_COMPLIANCE,REMOVE_IN_QUOTES,LINE_OF_YELLING,FREQ_SPAM_PHRASE version=2.01 X-Spam-Flag: YES X-Spam-Checker-Version: SpamAssassin 2.01 (devel $Id: SpamAssassin.pm,v 1.61 2002/01/25 04:41:02 jmason Exp $) X-Spam-Prev-Content-Type: text/plain; charset=US-ASCII SPAM: -------------------- Start SpamAssassin results ---------------------- SPAM: This mail is probably spam. The original message has been altered SPAM: so you can recognise or block similar unwanted mail in future. SPAM: See http://spamassassin.org/tag/ for more details. SPAM: SPAM: Content analysis details: (12.54 hits, 5 required) SPAM: Hit! (1.94 points) From: ends in numbers SPAM: Hit! (0.9 points) BODY: How dear can you be if you don't know my name? SPAM: Hit! (1 point) BODY: Contains 'Dear Somebody' SPAM: Hit! (1.32 points) BODY: Contains word 'guarantee' in all-caps SPAM: Hit! (0.01 points) BODY: Talks about bulk email SPAM: Hit! (1.77 points) BODY: No such thing as a free lunch SPAM: Hit! (1 point) BODY: Contains "My wife, Jody" testimonial SPAM: Hit! (1 point) BODY: List removal information SPAM: Hit! (1.33 points) BODY: Claims compliance with SPAM regulations SPAM: Hit! (0.01 points) BODY: List removal information SPAM: Hit! (0.7 points) BODY: A WHOLE LINE OF YELLING DETECTED SPAM: Hit! (1.56 points) Contains phrases frequently found in spam SPAM: [score: 19, hits: absolutely laws, accepted] SPAM: [make, accountant with, accurately take, address] SPAM: [accurately, address place, address report, ads] SPAM: [much, advertise until, advertisement remove,] SPAM: [advertising sending, alberta canada, all you,] SPAM: [also assume, also investigated, alter names,] SPAM: [alter will, always provide, always send, are] SPAM: [ordering, astonishment received, available] SPAM: [reports, based business, batch mails, because] SPAM: [system, become financially, become millionaire,] SPAM: [before deleted, being gambling, believe many,] SPAM: [below and, below see, better investment, bit] SPAM: [effort, both feet, box crammed, bulk mails, bull] SPAM: [please, bureau consumer, but conservative,] SPAM: [calculate you, can follow, can help, cannot] SPAM: [considered, case any, cash concealed, cash will,] SPAM: [change remember, changes save, checks not,] SPAM: [commission bureau, compliance the, computer age,] SPAM: [concealed wrapping, conservative that,] SPAM: [considered spam, contact get, contact office,] SPAM: [continue advertising, continue roll, copy had,] SPAM: [corporation make, counting their, cycle doubt,] SPAM: [dare think, days money, decide start, different] SPAM: [report, disk well, dollars every, doubt] SPAM: [counting, down report, dreams will, each let,] SPAM: [effort money, enough orders, entire letter,] SPAM: [entire show, every you, everyone half, exactly] SPAM: [instructed, exceedingly well, exciting report,] SPAM: [expect return, faster return, federal trade,] SPAM: [feet made, financial dreams, financial freedom,] SPAM: [financially independent, find thousands,] SPAM: [findings proved, first month, first weeks,] SPAM: [follow program, follow simple, followed simple,] SPAM: [for free, for marketing, for minimal, for] SPAM: [report, for your, fort lee, fortune move, found] SPAM: [medium, free ads, free classified, free order,] SPAM: [free places, friend have, from your, front] SPAM: [different, fun her, gambling type, generate] SPAM: [from, generate more, get pencil, give you, given] SPAM: [try, greedy then, guarantee your, guide] SPAM: [advertising, guide sending, guidelines follow,] SPAM: [guidelines guarantee, happen everyone, happened] SPAM: [not, help you, her hobby, home based, honesty] SPAM: [reaps, hundreds free, ignored supposed, includes] SPAM: [how, income send, income this, independent you,] SPAM: [inexpensive there, information materials,] SPAM: [initial investment, instructed below, instructed] SPAM: [not, internet millionaire, internet reports,] SPAM: [invaluable marketing, investigated whether,] SPAM: [investment only, investment was, investment] SPAM: [with, involved knew, involved send, jody her,] SPAM: [jody live, jody totally, joined jody, joined] SPAM: [just, jumped with, key success, knew wouldn,] SPAM: [larger response, lately due, later wondered,] SPAM: [laws prohibiting, lay old, least orders, legal] SPAM: [their, legality this, legally where, letter] SPAM: [with, list below, list removal, listed next,] SPAM: [little cost, live chicago, lose out, lot free,] SPAM: [made merciless, mail address, mail copy, mail] SPAM: [each, mail made, mail problems, mails each,] SPAM: [mails sent, mails until, major corporation,] SPAM: [majority your, make mind, make relatively,] SPAM: [making over, marketing information, marketing] SPAM: [practices, marketing the, marketing your,] SPAM: [materials opportunity, may send, medium size,] SPAM: [merciless fun, method has, method placing,] SPAM: [method sending, million mails, millionaire] SPAM: [utilizing, mind participate, minimal effort,] SPAM: [mitchell wife, mitchell wolf, modified list,] SPAM: [money back, money required, money started, money] SPAM: [still, months passed, months than, more income,] SPAM: [more orders, more potential, more testimonials,] SPAM: [more than, move name, moved down, much more,] SPAM: [name address, name mitchell, name moved, names] SPAM: [save, net very, news lately, not alter, not] SPAM: [program, notes always, office associate, old] SPAM: [told, one the, only each, only mails, only] SPAM: [orders, only response, opportunity become, order] SPAM: [report, ordered all, orders for, orders least,] SPAM: [orders more, originator this, out mails, paper] SPAM: [write, passed congress, passed then, pencil] SPAM: [paper, people money, people responded, people] SPAM: [who, percentages involved, person report, placed] SPAM: [front, places advertise, placing free, placing] SPAM: [lot, population percentages, practices federal,] SPAM: [primary methods, profits once, program before,] SPAM: [program contact, program described, program] SPAM: [exactly, program grumbled, program people,] SPAM: [program recently, progress watching, prohibiting] SPAM: [participation, prompt because, protection] SPAM: [washington, proved once, provide same, purchase] SPAM: [will, reach friend, ready lay, receive least,] SPAM: [receive only, receive report, received] SPAM: [information, received orders, received this,] SPAM: [received total, recently devoted, relatives] SPAM: [names, relax because, remember every, remember] SPAM: [friend, remember honesty, remember mail, remove] SPAM: [the, reply this, report available, report] SPAM: [checks, report down, report insert, report make,] SPAM: [report move, report people, report position,] SPAM: [report send, report they, report those, report] SPAM: [within, reports now, reports order, reports] SPAM: [shown, reports take, reports today, reports you,] SPAM: [required astonishment, response could, responses] SPAM: [within, risk just, road financial, roll this,] SPAM: [say bull, see really, seen national, send bulk,] SPAM: [send out, sending bulk, sent compliance,] SPAM: [sequence the, sheets paper, simple instructions,] SPAM: [simple steps, size post, small just, spam long,] SPAM: [started come, started your, still coming,] SPAM: [subject line, success guidelines, supposed] SPAM: [intelligence, sure cash, system already, that] SPAM: [can, that you, the income, the insider, the] SPAM: [internet, the legality, the net, the popularity,] SPAM: [the subject, their fortune, their sequence, them] SPAM: [remember, these guidelines, they ordered, this] SPAM: [disk, this email, this message, this program,] SPAM: [those sheets, thousands free, through cycle,] SPAM: [took several, total income, total million, total] SPAM: [out, totally ignored, trade commission, tried] SPAM: [greedy, tried put, try course, type remove, type] SPAM: [took, understand way, usa report, very] SPAM: [inexpensive, was mailed, was within, watching] SPAM: [which, way believe, way financial, weeks] SPAM: [continue, weeks make, well laugh, what] SPAM: [instructed, what you, when you, who are, wife] SPAM: [jody, will easily, will guarantee, will prompt,] SPAM: [with faster, with invaluable, with orders, with] SPAM: [response, with risk, with this, with your,] SPAM: [within days, wolf chicago, work jody, works] SPAM: [exceedingly, wrapping least, write number, you] SPAM: [calculate, you financial, you ideas, you like,] SPAM: [you must, you not, you purchase, you receive,] SPAM: [you want, you with, you you, your business, your] SPAM: [envelope, your home, your life, your mail, your] SPAM: [name, your order, your profits, your progress,] SPAM: [your reports, your road, your success, your] SPAM: [total] SPAM: SPAM: -------------------- End of SpamAssassin results --------------------- Dear Friend, You can earn $200,000 or more in the next 90 days sending e-mail. Seem impossible? Is there a catch? NO, there is no catch; just send your e-mails and be on your way to financial freedom. Basically, I send out as many of these e-mails as I can, then people send me cash in the mail for information that I just e-mail back to them. Everyday, I make a three minute walk to my mail box knowing that there are at least a few hundred dollars waiting for me. And the best part, IT IS COMPLETELY LEGAL. Just read the next few paragraphs and see what you think. If you like what you read, great! If you don't, read it again because you must have missed something. AS SEEN ON NATIONAL TV "Making over half a million dollars every 4 to 5 months from your home for an investment of only $25 U.S. Dollars expense one time" THANKS TO THE COMPUTER AGE AND THE INTERNET! BE A MILLIONAIRE LIKE OTHERS WITHIN A YEAR!! Before you say "bull", please read the following. This is the letter you have been hearing about on the news lately. Due to the popularity of this letter on the Internet, a national weekly news program recently devoted an entire show to the investigation of this program described below, to see if it really can make people money. The show also investigated whether or not the program was legal. Their findings proved once and for all that there are "absolutely NO laws prohibiting the participation in the program and if people can follow the simple instructions, they are bound to make some mega bucks with only $25 out of pocket cost". DUE TO THE RECENT INCREASE OF POPULARITY & RESPECT THIS PROGRAM HAS ATTAINED, IT IS CURRENTLY WORKING BETTER THAN EVER. This is what one had to say "Thanks to this profitable opportunity. I was approached many times before but each time I passed on it. I am so glad I finally joined just to see what one could expect in return for the minimal effort and money required. To my astonishment, I received total $610,470.00 in 21 weeks, with money still coming in". Pam Hedland, Fort Lee, New Jersey. Here is another testimonial "This program has been around for a long time but I never believed in it. But one day when I received this again in the mail I decided to gamble my $25 on it. I followed the simple instructions and walaa 3 weeks later the money started to come in. First month I only made $240.00 but the next 2 months after that I made a total of $290,000.00. So far, in the past 8 months by re-entering the program, I have made over $710,000.00 and I am playing it again. The key to success in this program is to follow the simple steps and NOT change anything." More testimonials later but first, PRINT THIS NOW FOR YOUR FUTURE REFERENCE If you would like to make $500,000 or more every 4 to 5 months easily and comfortably, please read the following.. THEN READ IT AGAIN and AGAIN!!! FOLLOW THE SIMPLE INSTRUCTION BELOW AND YOUR FINANCIAL DREAMS WILL COME TRUE, GUARANTEED! INSTRUCTIONS Order all 5 reports shown on the list below. For each report send $5 CASH, THE NAME & NUMBER OF THE REPORT YOU ARE ORDERING and YOUR E-MAIL ADDRESS to the person whose name appears ON THAT LIST next to the report. MAKE SURE YOUR RETURN ADDRESS IS ON YOUR ENVELOPE TOP LEFT CORNER in case of any mail problems. When you place your order, make sure you order each of the 5 reports. You will need all 5 reports so that you can save them on your computer and resell them. YOUR TOTAL COST $5 X 5 = $25.00. Within a few days you will receive, via e-mail, each of the 5 reports from these 5 different individuals. Save them on your computer so they will be accessible for you to send to the 1,000's of people who will order them from you. Also make a floppy of these reports and keep it on your desk. ****IMPORTANT - DO NOT alter the names of the people who are listed next to each report or their sequence on the list in any way other than what is instructed below in step 1 through 6 or you will lose out on the majority of your profits. Once you understand the way this works you will also see how it does not work if you change it. Remember, this method has been tested, and if you alter it, it will NOT work!!! People have tried to put their friends/relatives names on all five thinking they could get all the money. But it does not work this way. Believe us, we all have tried to be greedy and then nothing happened. So Do Not try to change anything other than what is instructed. Because if you do, it will NOT work for you. Remember, honesty reaps the rewards!!! 1. After you have ordered all 5 reports, take this advertisement and REMOVE the name & address of the person in REPORT #5. This person has made it through the cycle and is no doubt counting their fortune. 2. Move the name & address in REPORT #4 down TO REPORT #5. 3. Move the name & address in REPORT # 3 down TO REPORT #4. 4. Move the name & address in REPORT #2 down TO REPORT #3. 5. Move the name & address in REPORT # 1 down TO REPORT #2 6. Insert YOUR name & address in the REPORT # 1 Position. PLEASE MAKE SURE you copy every name & address ACCURATELY! Take this entire letter, with the modified list of names, and save it on your computer. DO NOT MAKE ANY OTHER CHANGES. Save this on a disk as well just in case if you loose any data. To assist you with marketing your business on the internet, the 5 reports you purchase will provide you with invaluable marketing information which includes how to send bulk e-mails legally, where to find thousands of free classified ads and much more. There are 2 Primary methods to get this venture going METHOD # 1 BY SENDING BULK E-MAIL LEGALLY Let's say that you decide to start small, just to see how it goes, and we will assume you and those involved send out only 5,000 e-mails each. Let's also assume that the mailings receive only a 0.2% response (the response could be much better but let's just say it is only 0.2%. Also many people will send out hundreds of thousands e-mails instead of only 5,000 each). Continuing with this example, you send out only 5,000 e-mails. With a 0,2% response, that is only 10 orders for report # 1. Those 10 people responded by sending out 5,000 e-mails each for a total of 50,000. Out of those 50,000 e-mails only 0.2% responded with orders. That's = 100 people responded and ordered Report # 2. Those 100 people mail out 5,000 e-mails each for a total of 500,000 e-mails. The 0.2% response to that is 1000 orders for Report # 3. Those 1000 people send out 5000 e-mails each for a total of 5 million e-mails sent out. The 0.20% response to that is 10,000 orders for Report #4. Those 10,000 people send out 5,000 e-mails each for a total of 50,000,000 (50 million) e-mails. The 0.2% response to that is 100,000 orders for Report #5. THATS 100,000 ORDERS TIMES $5 EACH = $500,000.00 (half million). Your total income in this example is 1 $50 + 2 $500 + 3 $5,000 + 4 $50,000 + 5 $500,000 Grand Total = $555,550.00 NUMBERS DO NOT LIE. GET A PENCIL & PAPER AND FIGURE OUT THE WORST POSSIBLE RESPONSES AND NO MATTER HOW YOU CALCULATE IT, YOU WILL STILL MAKE A LOT OF MONEY! REMEMBER FRIEND, THIS IS ASSUMING ONLY 10 PEOPLE ORDERING OUT OF 5,000 YOU MAILED TO. Dare to think for a-moment what would happen if everyone, or half or even one 4th of those people mailed 100,000 e-mails each or more? There are over 150 million people on the internet worldwide and counting. Believe me, many people will do just that and more! METHOD #2 BY PLACING FREE ADS ON THE INTERNET Advertising on the net is very, very inexpensive and there are hundreds of FREE places to advertise. Placing a lot of free ads on the Internet will easily get a larger response. We strongly suggest you start with Method # I and add METHOD #2 as you go along. For every $5 you receive, all you must do is e-mail them the Report they ordered. That's it. Always provide same day service on all orders. This will, guarantee that the e-mail they send out, with your name and address on it, will be prompt because they can not advertise until they receive the report. AVAILABLE REPORTS ORDER EACH REPORT BY ITS NUMBER & NAME ONLY. Notes Always send $5 cash for each Report. Checks NOT accepted. Make sure the cash is concealed by wrapping it in AT LEAST 2 sheets of paper. On one of those sheets of paper write the NUMBER & the NAME of the Report you are ordering, YOUR E-MAIL ADDRESS and your name and postal address. PLACE YOUR ORDER FOR THESE REPORTS NOW- REPORT #1 "The Insider's Guide to Advertising for Free on the Net" Order Report #1 from T. Montague PMB205 8554 122 Ave. N.E. Kirkland, WA 98033-5831 USA _________________________________________________________ REPORT #2 "The Insider's Guide to Sending Bulk e-mail on the Net." Order Report #2 from M. Linville P.O. Box 580654 Elk Grove, CA 95758-0011 USA _________________________________________________________ REPORT #3 "Secret to Multilevel Marketing on the Net" Order Report #3 from Witold Stawarz 1455 Tallevast Road Suite L8369 Sarasota, FL 34243 USA _________________________________________________________ _________________________________________________________ REPORT #4 "How to become a Millionaire Utilizing M.L.M. and the Net." Order Report #4 from T.S. Kolonia Browar 55 34-300 Zywiec Poland ___________________________________________________________ REPORT # 5 "How to Send Out One Million e-mails for FREE" Order Report #5 from John Gerken Box 703 401 Pine Street Abilene, Texas 79601 USA YOUR SUCCESS GUIDELINES Follow these guidelines to guarantee your success If you do not receive at least 10 orders for Report #1 within 2 weeks, continue sending e-mails until you do. After you have received 10 orders 2 to 3 weeks after that you should receive 100 orders or more for REPORT #2. If you did not, continue advertising or sending e-mails until you do. Once you have received 100 or more orders for Report # 2, YOU CAN RELAX, because the system is already working for you and the cash will continue to roll in THIS IS IMPORTANT TO REMEMBER Every time your name is moved down on the list you are placed in front of a different report. You can KEEP TRACK of your PROGRESS by watching which report people are ordering from you. IF YOU WANT TO GENERATE MORE INCOME SEND ANOTHER BATCH OF E-MAILS AND START THE WHOLE PROCESS AGAIN. There is NO LIMIT to the income you can generate from this business. FOLLOWING IS A NOTE FROM THE ORIGINATOR OF THIS PROGRAM "You have just received information that can give you financial freedom for the rest of your life, with NO RISK and JUST A LITTLE BIT OF EFFORT You can make more money in the next few weeks and months than you have ever imagined. Follow the program EXACTLY AS INSTRUCTED. Do Not change it in any way. It works exceedingly well as it is now. Remember to e-mail a copy of this exciting report after you have put your name and address in Report #1 and moved the others to #2 - # 5 as instructed above. One of the people you send this to may send out 100,000 or more e-mails and your name will be on everyone of them. Remember though, the more you send out the more potential customers you will reach. So my friend, I have given you the ideas, information, materials and opportunity to become financially independent. IT IS UP TO YOU NOW! MORE TESTIMONIALS My name is Mitchell. My wife, Jody and I live in Chicago. I am an accountant with a major U.S. Corporation and I make pretty good money. When I received this program I grumbled to Jody about receiving "junk mail". I made fun of the whole thing, spouting my knowledge of the population and percentages involved. I "knew" it wouldn't work. Jody totally ignored my supposed intelligence and few days later she jumped in with both feet. I made merciless fun of her, and was ready to lay the old "I told you so" on her when the thing didn't work. Well, the laugh was on me within 3 weeks she had received 50 responses. Within the next 45 days she had received a total of$ 147,200.00 all cash! I was shocked. I have joined Jody in her "hobby" Mitchell Wolf M.D. Chicago, Illinois Not being the gambling type, it took me several weeks to make up my mind to participate in this plan. But conservative that I am, I decided that the initial investment was so little that there was just no way that I wouldn't get enough orders to at least get my money back. I was surprised when I found my medium size post office box crammed with orders. I made $319,210.00 in the first 12 weeks. The nice thing about this deal is that it does not matter where people live. There simply isn't a better investment with a faster return and so big. Dan Sondstrom, Alberta, Canada "I had received this program before. I deleted it, but later I wondered if I should have given it a try. Of course, I had no idea who to contact to get another copy, so I had to wait until I was e-mailed again by someone else. 11 months passed then it luckily came again I did not delete this one! I made more than $490,000 on my first try and all the money came within 22 weeks". Susan De Suza, New York, N.Y "It really is a great opportunity to make relatively easy money with little cost to you. I followed the simple instructions carefully and within 10 days the money started to come in. My first month I made $ 20, 560.00 and by the end of third month my total cash count was $362,840.00. Life is beautiful, Thanx to the internet". Fred Dellaca1 Westport, New Zealand Your local bank or post office can help you exchange local currency in to US retain the system in US Dollars so we are all on the same playing field. Good Luck, it really works. ORDER YOUR REPORTS TODAY AND GET STARTED ON YOUR ROAD TO FINANCIAL FREEDOM! If you have any questions of the legality of this program, contact the Office of Associate Director for Marketing Practices, Federal Trade Commission, Bureau of Consumer Protection, Washington, D.C. _________________________________________________________ This message is sent in compliance of the new email Bill HR 1910. Under Bill HR 1910 passed by the 106th US Congress on May 24, 1999, this message cannot be considered Spam as long as we include the way to be removed. Per Section HR 1910, please type, "REMOVE" in the subject line and reply to this email. All removal requests are handled immediately once received. Only used for list removal. Complaints and reports to this server will only cause the account to be terminated and removal options unavailable. ----- End forwarded message ----- -- *----------------------------------------------------------------------------* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | | CLASSES: 8/26: Perl + Modules; 9/18: Int. Perl 9/23: Shell & Utilities | *----------------------------------------------------------------------------* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jope-spug at jope.net Wed Aug 21 16:02:33 2002 From: jope-spug at jope.net (El JoPe Magnifico) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: mail filtering addenda Message-ID: A few follow-up notes to the talk last night on SpamAssassin: First off, useful info at its homepage. http://www.spamassassin.org I believe it was asserted during the talk that there was no Windows version available. In fact, there is a commercial version. http://www.deersoft.com It's unclear whether this uses the same Perl-based implementation under the hood, but I'm guessing it does. For those interested in Bayesian filtering, recently popularized by Paul Graham (of Lisp fame), I've found at least one perl implementation. http://www.garyarnold.com/projects.php#bayespam There undoubtedly are (or will soon be) others out there, and I suspect it will be added to SpamAssassins list of heuristics in short order. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From creede at penguinsinthenight.com Wed Aug 21 16:00:25 2002 From: creede at penguinsinthenight.com (Creede Lambard) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Spamassassin Example In-Reply-To: <20020821120332.A16729@timji.consultix.wa.com> References: <20020821120332.A16729@timji.consultix.wa.com> Message-ID: <200208211400.25625.creede@penguinsinthenight.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Boy, this guy hits all the buttons, doesn't he? By the way, this afternoon I'm going to copy the presentation over to my server for download for those of you who have OpenOffice (or presumably StarOffice, though I haven't tried yet). After that I'll see if I can turn it into individual slides you can just browse through. http://www.penguinsintheinght.com/spamtalk/ On Wednesday 21 August 2002 12:03, SPUG-list-owner wrote: > SPUGsters, > > As a follow-up to Creede's excellent talk on mail filtering and > SpamAssassin last night, I thought it would be helpful to show you > an actual SPAM message (in case you've never seen one 8-}) and the > detailed annotations that spamassassin inserted into it to explain its > identification as such. > > Normally, I wouldn't have seen this message at all, because it gets > relegated to my .caughtspam folder, but I fished it out to show you. > > See below... > > -Tim > P.S. It also adds *****SPAM***** to the subject line. > - -- * .~. `( -------------------------------------------------------------- ` / V \ . Creede Lambard : error in /usr/bin/breakfast - /( )\ creede@penguinsinthenight.com : cereal port not responding ^^-^^ -------------------------------------------------------------- Perl Programmer and Linux Sysadmin, reasonable rates. Inquire within. GPG key at http://www.penguinsinthenight.com/creede_public_key.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9Y/9p6RaRqmjNX/0RAqkXAJ9hNbhh2jg6Uyr5kVzHIzMz+nOxtwCfaaf6 i/nhuVkMPl3S2s2rm7SfB9E= =ANc4 -----END PGP SIGNATURE----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From creede at penguinsinthenight.com Wed Aug 21 16:22:26 2002 From: creede at penguinsinthenight.com (Creede Lambard) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: mail filtering addenda In-Reply-To: References: Message-ID: <200208211422.26931.creede@penguinsinthenight.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This is true, and in fact I was going to mention the Deersoft version but ran out of time. It's listed on the "URLs for more information" slide. I don't know for sure whether it's the same implementation as the Unix/Perl version, but it says it "uses the same engine", which leads me to believe it does. The download page is up, by the way. It ain't pretty, but it works. http://www.penguinsinthenight.com/spamtalk On Wednesday 21 August 2002 14:02, El JoPe Magnifico wrote: > I believe it was asserted during the talk that there was no Windows > version available. In fact, there is a commercial version. > http://www.deersoft.com > > It's unclear whether this uses the same Perl-based implementation > under the hood, but I'm guessing it does. - -- * .~. `( ---------------------------------------------------------------- ` / V \ . Creede Lambard : Just who is this General Failure /( )\ creede@penguinsinthenight.com : and why is he reading my disk? ^^-^^ ---------------------------------------------------------------- Perl Programmer and Linux Sysadmin, reasonable rates. Inquire within. GPG key at http://www.penguinsinthenight.com/creede_public_key.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE9ZASS6RaRqmjNX/0RAiTaAJ41gKZ6biJct4qvjGamAlBG+9cnmACgg7UF N1ZR9uCLQTExM5uWkeKfjRw= =XjPF -----END PGP SIGNATURE----- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ben at reser.org Wed Aug 21 17:30:17 2002 From: ben at reser.org (Ben Reser) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Spamassassin Example In-Reply-To: <200208211400.25625.creede@penguinsinthenight.com> References: <20020821120332.A16729@timji.consultix.wa.com> <200208211400.25625.creede@penguinsinthenight.com> Message-ID: <20020821223017.GY25159@occipital.brain.org> On Wed, Aug 21, 2002 at 02:00:25PM -0700, Creede Lambard wrote: > Boy, this guy hits all the buttons, doesn't he? I didn't even see it because spamassassin kindly deleted it for me :) -- Ben Reser http://ben.reser.org If your love has no hope of being welcomed do not voice it; for if it be silent it can endure, a guarded flame, within you. - The Wisdom of the Sands - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From devnull at deadletter.org Wed Aug 21 18:19:40 2002 From: devnull at deadletter.org (Anesly) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Spamassassin Example In-Reply-To: <20020821223017.GY25159@occipital.brain.org>; from ben@reser.org on Wed, Aug 21, 2002 at 03:30:17PM -0700 References: <20020821120332.A16729@timji.consultix.wa.com> <200208211400.25625.creede@penguinsinthenight.com> <20020821223017.GY25159@occipital.brain.org> Message-ID: <20020821161940.A13940@genius.brain.org> Neb Reser 02.08.21 15:45: > On Wed, Aug 21, 2002 at 02:00:25PM -0700, Creede Lambard wrote: > > Boy, this guy hits all the buttons, doesn't he? > > I didn't even see it because spamassassin kindly deleted it for me :) Aww, but then you miss out on things like 'THE BOOB RANCH' -- Anesly, who is endlessly amused but the image of a herd of disembodied breasts out in a ranch some place. oranges are good for you - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From asimjalis at acm.org Thu Aug 22 15:26:50 2002 From: asimjalis at acm.org (Asim Jalis) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Extreme Perl Links Message-ID: <20020822202650.GA1797@wokkil.pair.com> Here are the links on Extreme Programming that I promised at the last meeting: BOOKS "Extreme Programming Explained: Embrace Change" by Kent Beck. Overview of XP philosophy. Short readable chatty. "Test Driven Development" by Kent Beck. Available online at http://groups.yahoo.com/group/testdrivendevelopment/files/TDD17Jul2002.pdf. More development focused. Includes lots of code samples, ideas for testing techniques. Again very readable, mostly due to the chatty humorous style. WEBSITES The Wiki. Publicly editable web site. Contains living discussion on different ideas including XP. If you have questions about specific parts of XP - e.g. does pairing work over the internet - this is the place to go. Download unit testing frameworks for different languages here. Seattle XP Group. Information about monthly meetings and weekly pair sessions at Tully's on 45th in Wallingford. Pairing sessions are on every Thursday (except the second) and are from 6.30 pm to 9.30 pm. Bring your laptop with a project or come ready to pair with someone else. MAILING-LISTS Send a blank e-mail message to these addresses to subscribe. To read archives go to and search for the lists by name. Focus on Perl and Extreme Programming. Low volume. General XP discussion. High volume. More focused on Seattle area announcements and events. Low volume. Focus on refactoring. Medium volume. Focus on unit testing and test driven development. Medium volume. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From asimjalis at acm.org Thu Aug 22 18:37:21 2002 From: asimjalis at acm.org (Asim Jalis) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Test::Extreme Message-ID: <20020822233721.GB31804@wokkil.pair.com> I uploaded the Test::Extreme module on CPAN today. It should show up on search.cpan.org in a few days. In the meantime here is a direct link to it. http://cpan.org/modules/by-module/Test/Test-Extreme-0.10.tgz I added some more functionality to run_tests so that it can pick up and run tests from different namespaces. I'll upload some more improvements in the next week or so. One major one I am working on now is to make it generate output that is acceptable to Test::Harness. Then you could use unit tests as your test scripts for packaged modules. If anyone has any feedback or comments or ideas for features let me know. Asim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From asimjalis at acm.org Sat Aug 24 19:05:17 2002 From: asimjalis at acm.org (Asim Jalis) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Test::Extreme In-Reply-To: <20020822233721.GB31804@wokkil.pair.com> References: <20020822233721.GB31804@wokkil.pair.com> Message-ID: <20020825000517.GA48452@wokkil.pair.com> On Thu, Aug 22, 2002 at 07:37:21PM -0400, Asim Jalis wrote: > I uploaded the Test::Extreme module on CPAN today. It should show > up on search.cpan.org in a few days. In the meantime here is a > direct link to it. > > http://cpan.org/modules/by-module/Test/Test-Extreme-0.10.tgz Instead of this hard-coded link search for it on search.cpan.org, to get the latest version with some small fixes. Asim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From stephen.m.baker at intel.com Mon Aug 26 12:00:16 2002 From: stephen.m.baker at intel.com (Baker, Stephen M) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: redirect close Message-ID: <288F9BF66CD9D5118DF400508B68C446020DA6F6@orsmsx113.jf.intel.com> I'm maintaining a program where I constantly see 2>&1 which I believe redirects STDOUT to STDIN, but regardless of what exactly it does I'm aware its a redirect of some kind and I would really like to know its scope for declaration and how to cut it off. Is it limited to the block it is declared in, or does this type of command continue to live on outside of a give code block. Stephen Baker Office: 253.371.4188 Intel Corporation Mobile: 253.678.0556 Intel Architecture Group Email: stephen.m.baker@intel.com Mail Stop DP3-307 2800 Center Dr. Dupont, WA 98327 **************************************************************************** ************** The information contained in this email are the opinions and views of the author(s), and are not on behalf of Intel unless specifically stated. **************************************************************************** ************** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ERICKPA at dshs.wa.gov Mon Aug 26 12:42:05 2002 From: ERICKPA at dshs.wa.gov (Erickson, Paul) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Ask Larry Wall Message-ID: <6AA584692F6AD611BA8D00034707E7FB8DF2E6@dshsmsgf2-b.dshs.wa.gov> At 8:00 am this morning (8/26), a new article was posted on slashdot.org titled, "Interviews: Ask Larry Wall." "About what? Perl is probably a good topic choice. No one knows more about Perl than Larry Wall, right? We'll send 10 of the highest-moderated questions to Larry by email, and post his answers when we get them back. Note: Due to Slashdot's line length restrictions, lines of code over 50 characters long may not display correctly. Please be aware of this if you include code samples in your question." So far, there aren't but a few good insightful questions. Here's a chance to have the expert answer the Perl question that keeps you awake at night. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From joneil at cobaltgroup.com Mon Aug 26 13:00:41 2002 From: joneil at cobaltgroup.com (O'neil, Jerome) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Ask Larry Wall Message-ID: Are we allowed to comment on Slashdot here on the list? -J -----Original Message----- From: Erickson, Paul [mailto:ERICKPA@dshs.wa.gov] Sent: Monday, August 26, 2002 10:42 AM To: 'spug-list@pm.org' Subject: SPUG: Ask Larry Wall At 8:00 am this morning (8/26), a new article was posted on slashdot.org titled, "Interviews: Ask Larry Wall." "About what? Perl is probably a good topic choice. No one knows more about Perl than Larry Wall, right? We'll send 10 of the highest-moderated questions to Larry by email, and post his answers when we get them back. Note: Due to Slashdot's line length restrictions, lines of code over 50 characters long may not display correctly. Please be aware of this if you include code samples in your question." So far, there aren't but a few good insightful questions. Here's a chance to have the expert answer the Perl question that keeps you awake at night. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.pm.org/archives/spug-list/attachments/20020826/bff654b6/attachment.htm From wim at nyetwork.org Mon Aug 26 13:21:58 2002 From: wim at nyetwork.org (Wim Kerkhoff) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: redirect close In-Reply-To: <288F9BF66CD9D5118DF400508B68C446020DA6F6@orsmsx113.jf.intel.com> Message-ID: <001601c24d2d$778558d0$4e17100a@tendon> Baker, Stephen M: > I'm maintaining a program where I constantly see > > 2>&1 > > which I believe redirects STDOUT to STDIN, but regardless of Actually that redirects STDERR to the same place as STDIN. 2>&1 is a fairly standard bash trick to easily capture errors, see the REDIRECTION section in bash(1). > what exactly it > does I'm aware its a redirect of some kind and I would really > like to know > its scope for declaration and how to cut it off. Is it > limited to the block > it is declared in, or does this type of command continue to > live on outside > of a give code block. Wim - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From cwilkes-spug at ladro.com Mon Aug 26 13:19:55 2002 From: cwilkes-spug at ladro.com (Chris Wilkes) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: redirect close In-Reply-To: <288F9BF66CD9D5118DF400508B68C446020DA6F6@orsmsx113.jf.intel.com> References: <288F9BF66CD9D5118DF400508B68C446020DA6F6@orsmsx113.jf.intel.com> Message-ID: <20020826181955.GC19984@www.ladro.com> On Mon, Aug 26, 2002 at 10:00:16AM -0700, Baker, Stephen M wrote: > > I'm maintaining a program where I constantly see > > 2>&1 > > which I believe redirects STDOUT to STDIN, but regardless of what exactly it > does I'm aware its a redirect of some kind and I would really like to know > its scope for declaration and how to cut it off. Is it limited to the block > it is declared in, or does this type of command continue to live on outside > of a give code block. I take it that this is in some perl code, something like: $ret = `cp a.txt b.txt 2>&1`; print $ret; If a.txt doesn't exist you'll get an error printed to STDERR of "no such file" -- which is captured with the above syntax. If you didn't have it there the error would come up on your screen and $ret wouldn't have this value. Note: this just isn't for built in shell functions returning errors, it could be for anything, even another perl script that might print debugging info to STDERR. Its also handy if you don't want to see stderr output on the screen. Since you're forking a new process the 2>&1 redirect will only be around for that process. The next time you do a system call the stderr will go to the same place as it normally goes. There's a lot of info in the perldocs if you type 'perldoc -q stderr' Chris - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From ced at carios2.ca.boeing.com Mon Aug 26 12:59:39 2002 From: ced at carios2.ca.boeing.com (ced@carios2.ca.boeing.com) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: redirect close Message-ID: <200208261759.KAA00785@carios2.ca.boeing.com> > I'm maintaining a program where I constantly see > 2>&1 > which I believe redirects STDOUT to STDIN, but regardless of what exactly it > does I'm aware its a redirect of some kind and I would really like to know > its scope for declaration and how to cut it off. Is it limited to the block > it is declared in, or does this type of command continue to live on outside > of a give code block. 2>&1 redirects STDERR to STDOUT and persists while the filehandle is open. The redirection scopes to the life of the open filehandle. The only loophole occurs when the filehandle is localized, eg, { local *STDERR; open (STDERR, ">&SOME_OTHER_FILEHANDLE") or die "can't dup: $!"; ... } I think some of the online docs discuss redirection. Hope this helps, -- Charles DeRykus - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Mon Aug 26 13:33:34 2002 From: tim at consultix-inc.com (SPUG-list-owner) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Ask Larry Wall In-Reply-To: References: Message-ID: <20020826113334.A22274@timji.consultix.wa.com> On Mon, Aug 26, 2002 at 11:00:41AM -0700, O'neil, Jerome wrote: > Are we allowed to comment on Slashdot here on the list? > > -J Sure, to the extent that it relates to Perl in some discernible way. -Tim ====================================================== | Tim Maher, Ph.D. tim@timmaher.org | | SPUG Founder & Leader spug@seattleperl.org | | Seattle Perl Users Group www.seattleperl.org | ====================================================== - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From stephen.m.baker at intel.com Mon Aug 26 17:16:00 2002 From: stephen.m.baker at intel.com (Baker, Stephen M) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Message-ID: <288F9BF66CD9D5118DF400508B68C446020DA6FC@orsmsx113.jf.intel.com> I'm looking for the correct exit command for the following situation: Program A coninuously checks environment conditions and runs Program B as necessary. Each time Program B runs, it spawns multiple instances of program C. Eventually, Programs B and C complete execution, modify the environment, and Program A again notices changes and restarts the cycle. I have the program catching signal interrupts for exit purposes, but I don't know whether to go with a kill 9, an exit(?), or what. What I want to do when exit is called is kill all instances of programs A and B, but not any occurances of program C. Stephen Baker Office: 253.371.4188 Intel Corporation Mobile: 253.678.0556 Intel Architecture Group Email: stephen.m.baker@intel.com Mail Stop DP3-307 2800 Center Dr. Dupont, WA 98327 **************************************************************************** ************** The information contained in this email are the opinions and views of the author(s), and are not on behalf of Intel unless specifically stated. **************************************************************************** ************** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From creede at penguinsinthenight.com Mon Aug 26 18:37:07 2002 From: creede at penguinsinthenight.com (Creede Lambard) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Ask Larry Wall In-Reply-To: <20020826113334.A22274@timji.consultix.wa.com> References: <20020826113334.A22274@timji.consultix.wa.com> Message-ID: <1030405027.30077.41.camel@svetlana> Well, Slashdot is written in Perl, so everything on it should be fair game, right? Right? Hey, show me some support here . . . :) On Mon, 2002-08-26 at 11:33, SPUG-list-owner wrote: > On Mon, Aug 26, 2002 at 11:00:41AM -0700, O'neil, Jerome wrote: > > Are we allowed to comment on Slashdot here on the list? > > > > -J > > Sure, to the extent that it relates to Perl in some > discernible way. > > -Tim > ====================================================== > | Tim Maher, Ph.D. tim@timmaher.org | > | SPUG Founder & Leader spug@seattleperl.org | > | Seattle Perl Users Group www.seattleperl.org | > ====================================================== > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > -- * .~. `( --------------------------------------------------------------- ` / V \ . Creede Lambard : Nothing is quite so powerful as /( )\ creede@penguinsinthenight.com : a penguin whose time has come. ^^-^^ --------------------------------------------------------------- Perl Programmer and Linux Sysadmin, reasonable rates. Inquire within. GPG key at http://www.penguinsinthenight.com/creede_public_key.asc -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/archives/spug-list/attachments/20020826/c7990ac2/attachment.bin From creede at penguinsinthenight.com Mon Aug 26 18:40:08 2002 From: creede at penguinsinthenight.com (Creede Lambard) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: In-Reply-To: <288F9BF66CD9D5118DF400508B68C446020DA6FC@orsmsx113.jf.intel.com> References: <288F9BF66CD9D5118DF400508B68C446020DA6FC@orsmsx113.jf.intel.com> Message-ID: <1030405208.30077.45.camel@svetlana> I'd say, every time program A or program B runs, save its PID in a file somewhere (or database table, or whatever). Then, when you decide to shut down, go through the list in that file and kill all the pids in it. If you do this be sure to remove the PID entry when an instance of the program exits or you could cause yourself unnecessary work. On Mon, 2002-08-26 at 15:16, Baker, Stephen M wrote: > > > I'm looking for the correct exit command for the following situation: > > Program A coninuously checks environment conditions and runs Program B as > necessary. > > Each time Program B runs, it spawns multiple instances of program C. > > Eventually, Programs B and C complete execution, modify the environment, and > Program A again notices changes and restarts the cycle. > > I have the program catching signal interrupts for exit purposes, but I don't > know whether to go with a kill 9, an exit(?), or what. > > What I want to do when exit is called is kill all instances of programs A > and B, but not any occurances of program C. > > > > > Stephen Baker Office: 253.371.4188 > Intel Corporation Mobile: 253.678.0556 > Intel Architecture Group Email: > stephen.m.baker@intel.com > > Mail Stop DP3-307 2800 Center Dr. Dupont, WA 98327 > > **************************************************************************** > ************** > The information contained in this email are the opinions and views of the > author(s), and are not on behalf of Intel unless specifically stated. > **************************************************************************** > ************** > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > -- * .~. `( ------------------------------------------------------------ ` / V \ . Creede Lambard : Live in a world of your own, /( )\ creede@penguinsinthenight.com : but always welcome visitors. ^^-^^ ------------------------------------------------------------ Perl Programmer and Linux Sysadmin, reasonable rates. Inquire within. GPG key at http://www.penguinsinthenight.com/creede_public_key.asc -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 232 bytes Desc: This is a digitally signed message part Url : http://mail.pm.org/archives/spug-list/attachments/20020826/dc5b3104/attachment.bin From jgardn at alumni.washington.edu Mon Aug 26 20:47:54 2002 From: jgardn at alumni.washington.edu (Jonathan Gardner) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Ask Larry Wall In-Reply-To: <1030405027.30077.41.camel@svetlana> References: <20020826113334.A22274@timji.consultix.wa.com> <1030405027.30077.41.camel@svetlana> Message-ID: <200208261847.54133.jgardn@alumni.washington.edu> On Monday 26 August 2002 04:37 pm, Creede Lambard wrote: > Well, Slashdot is written in Perl, so everything on it should be fair > game, right? > > Right? > > Hey, show me some support here . . . > > :) > We're all eyes. I think most of what people think about Slashdot is left unsaid... -- Jonathan Gardner jgardn@alumni.washington.edu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jgardn at alumni.washington.edu Mon Aug 26 20:52:47 2002 From: jgardn at alumni.washington.edu (Jonathan Gardner) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: In-Reply-To: <288F9BF66CD9D5118DF400508B68C446020DA6FC@orsmsx113.jf.intel.com> References: <288F9BF66CD9D5118DF400508B68C446020DA6FC@orsmsx113.jf.intel.com> Message-ID: <200208261852.47132.jgardn@alumni.washington.edu> On Monday 26 August 2002 03:16 pm, Baker, Stephen M wrote: > I'm looking for the correct exit command for the following situation: > > Program A coninuously checks environment conditions and runs Program B as > necessary. > > Each time Program B runs, it spawns multiple instances of program C. > > Eventually, Programs B and C complete execution, modify the environment, > and Program A again notices changes and restarts the cycle. > > I have the program catching signal interrupts for exit purposes, but I > don't know whether to go with a kill 9, an exit(?), or what. > > What I want to do when exit is called is kill all instances of programs A > and B, but not any occurances of program C. > If program A is persistent (for instance, it sleeps between checking, and doesn't need to be restarted each time to be checked), you can store program B's pid in a list. Set up the beginning of your program to say: $SIG{TERM} = sub { map {kill "TERM", $_} @pids; } You'll also need to keep the list of pids current, but that is easily handled through "waitpid" or just "wait", and $SIG{CHLD}. Look in the camel book for more info on this. The same thing we do with A and B applies for B and C as well. If A is not persistent, you will have to store it in a file or make sure B is done before you exit. -- Jonathan Gardner jgardn@alumni.washington.edu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jgardn at alumni.washington.edu Mon Aug 26 20:55:27 2002 From: jgardn at alumni.washington.edu (Jonathan Gardner) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: In-Reply-To: <1030405208.30077.45.camel@svetlana> References: <288F9BF66CD9D5118DF400508B68C446020DA6FC@orsmsx113.jf.intel.com> <1030405208.30077.45.camel@svetlana> Message-ID: <200208261855.27578.jgardn@alumni.washington.edu> On Monday 26 August 2002 04:40 pm, Creede Lambard wrote: > I'd say, every time program A or program B runs, save its PID in a file > somewhere (or database table, or whatever). Then, when you decide to > shut down, go through the list in that file and kill all the pids in it. > > If you do this be sure to remove the PID entry when an instance of the > program exits or you could cause yourself unnecessary work. > It's not much work to check to see if a PID stored in a file is valid. Try this: $pid = `cat $pidfile`; chomp $pid; if (kill 0, $pid) { # still running. } else { # dead - stale lockfile. } There is a small chance that the child has been long dead and you have cycled through the available PIDs, and a different process is running as that PID, but what can you do about that? -- Jonathan Gardner jgardn@alumni.washington.edu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From humbaba9 at yahoo.com Tue Aug 27 10:59:40 2002 From: humbaba9 at yahoo.com (Meryll Larkin) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: kill or exit multiple processes In-Reply-To: <288F9BF66CD9D5118DF400508B68C446020DA6FC@orsmsx113.jf.intel.com> Message-ID: <20020827155940.3211.qmail@web12807.mail.yahoo.com> 8/27/02 Now I'm confused because I assumed that if Program B spawned Program C that Program B's PID (process ID) would be the PPID (parent process ID) to Program C. I also thought that if Program B was killed, that killing the parent would kill the child (Program C). In which case, wouldn't it be easier to just have Program B check for a condition (created by Program A - like the existance of a file or something) after Program C completed and exit itself if that condition was true? Or am I missing something here? If so, please correct me! Meryll Larkin --- "Baker, Stephen M" wrote: > > > I'm looking for the correct exit command for the following situation: > > Program A coninuously checks environment conditions and runs Program > B as > necessary. > > Each time Program B runs, it spawns multiple instances of program C. > > Eventually, Programs B and C complete execution, modify the > environment, and > Program A again notices changes and restarts the cycle. > > I have the program catching signal interrupts for exit purposes, but > I don't > know whether to go with a kill 9, an exit(?), or what. > > What I want to do when exit is called is kill all instances of > programs A > and B, but not any occurances of program C. > > > > > Stephen Baker Office: 253.371.4188 > Intel Corporation Mobile: 253.678.0556 > Intel Architecture Group Email: > stephen.m.baker@intel.com > > Mail Stop DP3-307 2800 Center Dr. Dupont, WA 98327 > > **************************************************************************** > ************** > The information contained in this email are the opinions and views of > the > author(s), and are not on behalf of Intel unless specifically stated. > **************************************************************************** > ************** > > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your > Email-address > For daily traffic, use spug-list for LIST ; for weekly, > spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: > http://seattleperl.org > __________________________________________________ Do You Yahoo!? Yahoo! Finance - Get real-time stock quotes http://finance.yahoo.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From andrew at sweger.net Tue Aug 27 12:13:15 2002 From: andrew at sweger.net (Andrew Sweger) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: tracking PIDs In-Reply-To: <200208261855.27578.jgardn@alumni.washington.edu> Message-ID: On Mon, 26 Aug 2002, Jonathan Gardner wrote: > There is a small chance that the child has been long dead and you have cycled > through the available PIDs, and a different process is running as that PID, > but what can you do about that? If a somewhat unique value (other than a PID) is included in the command line of each process spawned in this particular system, this value's existence can be checked in /proc/$pid/cmdline on systems that support procfs. So, along with tracking PIDs, these unique values would also need to be tracked. If the PID is still alive (via the kill 0 test), check the cmdline to see if it still matches the previously recorded signature. -- Andrew B. Sweger -- The great thing about multitasking is that several things can go wrong at once. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jimfl at tensegrity.net Tue Aug 27 12:16:40 2002 From: jimfl at tensegrity.net (Jim Flanagan) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: kill or exit multiple processes In-Reply-To: <20020827155940.3211.qmail@web12807.mail.yahoo.com> Message-ID: On Tue, 27 Aug 2002, Meryll Larkin wrote: > Now I'm confused because I assumed that if Program B > spawned Program C that Program B's PID (process ID) would > be the PPID (parent process ID) to Program C. Yes. > I also thought that if Program B was killed, that killing > the parent would kill the child (Program C). No. How do you think deamons are born? It's very common for parents to die, and their children live on ("and even have itty-bitty litte children of their own." (+5 pts if you get the move reference)). However, you can kill a process group, by setting up the parent as the process grou leader, then using kill to kill (or send any signal) to the entire group. The common way to set up a process as the process group leader is to use setsid(2) or setpgid(2), depending upon your OS. Also, usually, using kill with a negative pid sends the signal to the process group, instead of the process. http://jimfl.tensegrity.net mailto:jimfl%40t%65ns%65gr%69ty.n%65t - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From pdarley at kinesis-cem.com Tue Aug 27 13:09:27 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: kill or exit multiple processes In-Reply-To: Message-ID: Jim, Since I don't usually have anything to contribute about Perl, I might as well make what contributions as I can; that is a quote from _The 5th Element_ (in which we learn that the mystical fifth element is, indeed, women). Thanks, Peter Darley -----Original Message----- From: owner-spug-list@pm.org [mailto:owner-spug-list@pm.org]On Behalf Of Jim Flanagan Sent: Tuesday, August 27, 2002 10:17 AM To: Meryll Larkin Cc: Baker, Stephen M; 'spug-list@pm.org' Subject: Re: SPUG: kill or exit multiple processes No. How do you think deamons are born? It's very common for parents to die, and their children live on ("and even have itty-bitty litte children of their own." (+5 pts if you get the move reference)). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jimfl at tensegrity.net Tue Aug 27 14:32:22 2002 From: jimfl at tensegrity.net (Jim Flanagan) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: kill or exit multiple processes In-Reply-To: Message-ID: On Tue, 27 Aug 2002, Peter Darley wrote: > Since I don't usually have anything to contribute about > Perl, I might as well make what contributions as I can; > that is a quote from _The 5th Element_ (in which we learn > that the mystical fifth element is, indeed, women). We have a winnah! -- ::jimfl http://jimfl.tensegrity.net mailto:jimfl%40t%65ns%65gr%69ty.n%65t - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jgardn at alumni.washington.edu Tue Aug 27 16:41:33 2002 From: jgardn at alumni.washington.edu (Jonathan Gardner) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: tracking PIDs In-Reply-To: References: Message-ID: <200208271441.33075.jgardn@alumni.washington.edu> On Tuesday 27 August 2002 10:13 am, Andrew Sweger wrote: > On Mon, 26 Aug 2002, Jonathan Gardner wrote: > > There is a small chance that the child has been long dead and you have > > cycled through the available PIDs, and a different process is running > > as that PID, but what can you do about that? > > If a somewhat unique value (other than a PID) is included in the command > line of each process spawned in this particular system, this value's > existence can be checked in /proc/$pid/cmdline on systems that support > procfs. So, along with tracking PIDs, these unique values would also need > to be tracked. If the PID is still alive (via the kill 0 test), check the > cmdline to see if it still matches the previously recorded signature. This is a nearly foolproof method. I just thought of this as well. We could compare the creation time of the PID file, and the "beginning" of the process in question. How to figure out when a process started, or even how long it has been running (not how much CPU time it took) is beyond me at the moment. However, the two times should be similar, with the "Start" time earlier than the PID file creation, if not at the same time. Jonathan Gardner - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Tue Aug 27 21:28:53 2002 From: tim at consultix-inc.com (SPUG-list-owner) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Public Perl Classes in Kirkland Message-ID: <20020827192853.A4001@timji.consultix.wa.com> From: Tim Maher, CONSULTIX Subject: Public Perl/UNIX Classes in Kirkland SPUGsters, We'll be running several Perl (& UNIX) classes in Kirkland in the upcoming months. The schedule is visible below, and electronic versions of it are also available for download at http://teachmeperl.com/sched.html. I'd be grateful if you'd help publicize these classes by posting a copy of the schedule on a company bulletin board, or emailing one to a colleague! Thanks in advance, -Tim +----------------------------------------------------------+ SCHEDULE OF CONSULTIX PUBLIC CLASSES, in Kirkland WA +----------------------------------------------------------+ COURSE DATES Days Intermediate Perl 9/18-20 3 Shell Programming 9/23-25 3 UNIX Utilities 9/26-27 2 > Shell and Utilities 9/23-27 5 UNIX Fundamentals 10/21-24 4 Minimal Perl 10/25 1 Basic OO Perl 10/28-29 2 Int. Pattern Matching 10/30-31 1.5 +--------------------------------------------------------+ CONSULTIX ON-LINE RESOURCES General Information: http://www.consultix-inc.com On-Site Training: http://www.consultix-inc.com/on-site.html Course Listings: Perl, http://teachmeperl.com/perllist.html UNIX/Shell, http://teachmeunix.com/unixlist.html Registration and Pricing: http://www.consultix-inc.com/reg.html Instructor Evaluations: http://www.consultix-inc.com/evals.html Course Evaluations: http://www.consultix-inc.com/course_evals.html *----------------------------------------------------------------------------* | Tim Maher, CEO, CONSULTIX (206) 781-UNIX; (866) DOC-PERL; (866) DOC-LINUX | | Ph.D. & JAWCAR ("Just Another White Camel Award Recipient") | | tim@consultix-inc.com teachmeunix.com teachmeperl.com teachmelinux.net | | CLASSES: 8/26: Perl + Modules; 9/18: Int. Perl 9/23: Shell & Utilities | *----------------------------------------------------------------------------* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From pate at eylerfamily.org Wed Aug 28 15:52:58 2002 From: pate at eylerfamily.org (Pat Eyler) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: RFP for Perl work on existing project Message-ID: The Nelsonville, Ohio, Public Library has recently announced that they will be migrating to Koha, a GPL'd library software system () which is written in Perl. They have decided to contribute to the ongoing development of Koha and have released an RFP to solicit bids to work on full MARC support for the 1.4 release, the RFP is available at (a copy is also included below). I'd encourage interested parties to read carefully through the RFP and to join the koha-devel mailing list (). It may also be worthwhile to join the #koha channel at irc.katipo.co.nz to discuss the project in general or MARC support specifically. If you know anyone else that might be interested in responding to the RFP, please feel free to forward it as appropriate. Further background on Nelsonville's announcement is at . For more information, please feel free to contact me by email at info@koha.org. thanks, -pate Pat Eyler Kaitiaki/manager the Koha project http://www.koha.org REQUEST For PROPOSAL -- MARC 21 record support for Koha (www.koha.org) The Nelsonville Public Library invites all interested parties to submit proposals in response to the following request. Proposals may be submitted in any format, but should carefully answer all questions in the request. Proposals should be sent to Stephen Hedges, Director, Nelsonville Public Library, e-mail nelpl@athenscounty.lib.oh.us, fax 740-753-3543, mail 95 W. Washington Street, Nelsonville, Ohio 45764. Proposals are due no later than 8:00 A.M. Eastern Daylight Time, September 30, 2002. Any responses made in proposals from interested parties may be incorporated as part of a final agreement. BACKGROUND The Nelsonville Public Library is a public library system consisting of seven libraries serving the residents of Athens County, Ohio, USA, with 36,000 active borrowers and over 250,000 items in the collections. The library has made plans to switch from its current library automation system to Koha, but only if Koha has certain required capabilities. Among these is the ability to store and retrieve item records in MARC 21 format at the (Full) National Record Level. Accordingly, the Library is seeking proposals from parties who are capable of modifying the current Koha code to provide this capability. Proposals will be evaluated by a committee of five Library staff members, and a contract will be negotiated with the submitter of the successful proposal. Please note that the Nelsonville Public Library does not expect to fund the entire development process, but is instead offering a financial reward to encourage development of Koha to be able to handle MARC 21 format. Nelsonville Public Library may elect to share some of this financial burden with other agencies as it sees fit. SPECIAL CONSIDERATIONS Nelsonville Public Library realizes that several people/groups may wish to combine resources to fulfill the requirements of this RFP. The Library is aware of the special nature of Open Source software projects, which encourages wide participation in the development process, and is thus amenable to proposals which divide the work between parties. In such a case, however, the Library prefers to receive only one combined proposal, with payment going to only one person or organization. If no acceptable combined proposal is received, then the library will entertain partial proposals from several persons or organizations that can demonstrate a plan to coordinate their efforts toward achieving the intended goal. SELECTION CRITERA Proposals will be evaluated on the basis of cost, qualifications of the programmer(s), time to delivery, ease of integration of the proposed code into the current Koha software, and ease of upgrading the delivered software to incorporate future changes to the MARC formats. The Library also intends to share information from proposals with the current Koha development team, in order to better judge the compatibility of the proposals with the overall Koha development plan. REQUIRED INFORMATION - How will you modify current Koha tables and/or scripts to accomodate MARC 21 National (Full) Level Record Requirements? (See http://lcweb.loc.gov/marc/bibliographic/nlr/). Please provide enough detail so that the committee may judge the viability of your plan, but do not submit sample tables and/or scripts. - Who will undertake this work? - What are the qualifications of the person(s) doing this work? - How have you been involved in previous Koha development? - How long will it take to complete this work? - How much will you charge for this work? (in US Dollars, please) - How will you coordinate your work with the existing work on MARC for the 1.4 release of Koha? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From tim at consultix-inc.com Thu Aug 29 13:38:45 2002 From: tim at consultix-inc.com (SPUG-list-owner) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Sr Level OOP Dev Positionz Message-ID: <20020829113845.A9862@timji.consultix.wa.com> My old staff manager at Venturi Partners (formerly known as BEST Consulting) is looking to fill the following 3 month contract position. You must be able to start immediately: Sr. level UNIX object oriented Perl developer Contract is at least through end of year. Max pay rate is $45.00/hour Location: Factoria Required Skills: * Sr level UNIX Solaris 2.8; HP-UX version 11.0 * Sr. level object oriented Perl Script Development * some DBA skills would help Desired Skills: * previous experience in telecom and wireless - big plus * UML * experience in C++ - big plus * experience in the Korn shell - plus * undergraduate and advanced degrees from leading universities - big plus Project: Location Based Services. These are the services that allow for 911 locators. Vendors of base stations are installing new servers and the current system for managing the features is archaic. They have implemented features on the servers that are less then user friendly. Client is looking for a Sr. level UNIX Developer with excellent Perl Script development skills to write scripts that manage the process and automatically execute database checks, file checks, etc. There will be some database administration duties. Most is in text format, with some in Sybase. Tyra Tyra Tally Consulting Services Manager Venturi Technology Partners (formerly BEST ) ttally@venturipartners.com 425-202-8201 Cell: 206-276-6458 Fax: 425-814-8108 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From Daniel.Pommert at verizonwireless.com Thu Aug 29 16:41:40 2002 From: Daniel.Pommert at verizonwireless.com (Pommert, Daniel) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Sr Level OOP Dev Positionz Message-ID: <9B30436F511ED5118EDF0002A55C318005790334@cairvexmb03.uswin.ad.vzwcorp.com> * Sigh * I just recieved word that this position is now closed: The person who is currently filling it decided to stay on to the end of the year. -- Daniel -----Original Message----- From: SPUG-list-owner [mailto:tim@consultix-inc.com] Sent: Thursday, August 29, 2002 11:39 AM To: spug-list@pm.org Subject: SPUG: Sr Level OOP Dev Positionz My old staff manager at Venturi Partners (formerly known as BEST Consulting) is looking to fill the following 3 month contract position. You must be able to start immediately: Sr. level UNIX object oriented Perl developer Contract is at least through end of year. Max pay rate is $45.00/hour Location: Factoria Required Skills: * Sr level UNIX Solaris 2.8; HP-UX version 11.0 * Sr. level object oriented Perl Script Development * some DBA skills would help Desired Skills: * previous experience in telecom and wireless - big plus * UML * experience in C++ - big plus * experience in the Korn shell - plus * undergraduate and advanced degrees from leading universities - big plus Project: Location Based Services. These are the services that allow for 911 locators. Vendors of base stations are installing new servers and the current system for managing the features is archaic. They have implemented features on the servers that are less then user friendly. Client is looking for a Sr. level UNIX Developer with excellent Perl Script development skills to write scripts that manage the process and automatically execute database checks, file checks, etc. There will be some database administration duties. Most is in text format, with some in Sybase. Tyra Tyra Tally Consulting Services Manager Venturi Technology Partners (formerly BEST ) ttally@venturipartners.com 425-202-8201 Cell: 206-276-6458 Fax: 425-814-8108 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From stephen.m.baker at intel.com Thu Aug 29 17:02:19 2002 From: stephen.m.baker at intel.com (Baker, Stephen M) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: interrupts! Message-ID: <288F9BF66CD9D5118DF400508B68C446020DA714@orsmsx113.jf.intel.com> I have an interrupt handler built into a script to guarantee data logging before the program exits in the event an interrupt signal is detected... However the manner in which I know how to do this does not permit me to access non-local variables in the interrupt handler function. The nature of the interrupt handler is that an interrupt triggers a reference to a function call, rather that a system process, and as such the function call is not capable of handling parameters. Does anyone know a way to add parameters, or make it possible to access them without making them global? Stephen Baker Office: 253.371.4188 Intel Corporation Mobile: 253.678.0556 Intel Architecture Group Email: stephen.m.baker@intel.com Mail Stop DP3-307 2800 Center Dr. Dupont, WA 98327 **************************************************************************** ************** The information contained in this email are the opinions and views of the author(s), and are not on behalf of Intel unless specifically stated. **************************************************************************** ************** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jimfl at tensegrity.net Thu Aug 29 19:22:51 2002 From: jimfl at tensegrity.net (Jim Flanagan) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: interrupts! In-Reply-To: <288F9BF66CD9D5118DF400508B68C446020DA714@orsmsx113.jf.intel.com> Message-ID: On Thu, 29 Aug 2002, Baker, Stephen M wrote: > I have an interrupt handler built into a script to > guarantee data logging before the program exits in the > event an interrupt signal is detected... However the > manner in which I know how to do this does not permit > me to access non-local variables in the interrupt handler > function. The nature of the interrupt handler is that an > interrupt triggers a reference to a function call, rather > that a system process, and as such the function call is > not capable of handling parameters. Does anyone know a > way to add parameters, or make it possible to access them > without making them global? You can use a closure, like this: $SIG{USR2} = sub { handler($foo, $bar, $baz) }; You can set this closure up anywhere you like (where the parameters you want are scoped) package One; $foo = 1; $bar = "Gronk"; $baz = [1, 2, 3, 4, 5]; $handler_ref = sub {handler($foo, $bar, $baz)}; package main; $SIG{USR2} = $One::handler_ref; Or whatever. It doesn't matter if the parameters change over time. The closure will track them. Like magic. -- Jim Flanagan http://jimfl.tensegrity.net mailto:jimfl%40t%65ns%65gr%69ty.n%65t - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From pdarley at kinesis-cem.com Fri Aug 30 11:12:59 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Perl alert system which will call me Message-ID: Friends, I'm looking at writing a Perl script that will monitor a machine from a remote location and perform an alert when it detects a problem. Unfortunately there's no grantee that I'll be checking my email at the time when something may go down, so I would like the machine to give me a call and let me know that something is wrong. I see that there's a module for controlling voice modems (Modem::Vgetty), witch makes me thing that perhaps someone has already written something like this? Thought I would ask y'all before getting started, as I can't find anything on SourceForge or Google, and y'all seem to know just about everything. :) Thanks, Peter Darley - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From pdarley at kinesis-cem.com Fri Aug 30 11:38:09 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Perl alert system which will call me In-Reply-To: Message-ID: Matthew, The problem with this is that I won't know what part of the system is down, and if the network is down it would be foolish to rely on email. Plus I don't have a pager, or an email address for my phone. Thanks, Peter Darley -----Original Message----- From: Matthew.Bustad [mailto:mbustad@Myrio.com] Sent: Friday, August 30, 2002 9:31 AM To: Peter Darley Cc: SPUG Subject: Re: SPUG: Perl alert system which will call me Usually you just send email to your phone or pager. On Fri, 30 Aug 2002, Peter Darley wrote: > Friends, > I'm looking at writing a Perl script that will monitor a machine from a > remote location and perform an alert when it detects a problem. > Unfortunately there's no grantee that I'll be checking my email at the time > when something may go down, so I would like the machine to give me a call > and let me know that something is wrong. I see that there's a module for > controlling voice modems (Modem::Vgetty), witch makes me thing that perhaps > someone has already written something like this? Thought I would ask y'all > before getting started, as I can't find anything on SourceForge or Google, > and y'all seem to know just about everything. :) > Thanks, > Peter Darley > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From beckyls at u.washington.edu Fri Aug 30 11:49:43 2002 From: beckyls at u.washington.edu (Rebecca L. Schmidt) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: UW Perl, Python In-Reply-To: Message-ID: Hi all, You are invited to a free Information Meeting describing the UW Certificate Program in Perl Programming. Please come and learn more about this evening program taught by industry experts. Wednesday, Sept. 4, 2002, 6-7 p.m., UW Extension Downtown, 1325 Fourth Ave., Suite 400, Seattle. This three-course certificate program is designed for adults from a variety of fields who want to gain in-depth knowledge of Perl and to practice its use. The program begins in autumn (Seattle) or winter (Bellevue). We are accepting applications now. You can find more information, including how to apply, via the following URL: http://www.outreach.washington.edu/extinfo/certprog/per/per_main.asp On another note, I am pleased to announce a new 3-day Python programming course being offered at the UW October 21-23, 2002. We are fortunate to have Mark Lutz, well-known author of multiple O'Reilly Python books as the instructor for this intensive course. Through lectures and laboratory work, students learn the basics of Python programming. Register by calling (206) 543-2310 or 1 (800) 543-2320. For more information, please see: http://www.outreach.washington.edu/extinfo/comp/programming.asp#python Please feel free to contact me with any questions. Best regards, Rebecca Schmidt Academic Programs University of Washington Extension 5001 25th Ave NE, Seattle, WA 98105-4190 rschmidt@ese.washington.edu; beckyls@u.washington.edu (206) 221-6243 UW Box 354221 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From mathin at mathin.com Fri Aug 30 11:27:52 2002 From: mathin at mathin.com (Dan Ebert) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Perl alert system which will call me In-Reply-To: References: Message-ID: <1030724872.14194.34.camel@algernon.lan.enic.cc> Could you have it send an email to a pager or cell phone? Dan. On Fri, 2002-08-30 at 09:12, Peter Darley wrote: > Friends, > I'm looking at writing a Perl script that will monitor a machine from a > remote location and perform an alert when it detects a problem. > Unfortunately there's no grantee that I'll be checking my email at the time > when something may go down, so I would like the machine to give me a call > and let me know that something is wrong. I see that there's a module for > controlling voice modems (Modem::Vgetty), witch makes me thing that perhaps > someone has already written something like this? Thought I would ask y'all > before getting started, as I can't find anything on SourceForge or Google, > and y'all seem to know just about everything. :) > Thanks, > Peter Darley > > > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org > Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL > Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address > For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest > Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org > -- Dan Ebert ---------------------------------------------------------- "If you're right 90% of the time, why quibble about the remaining 3%?" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From SEYMOUR at npl.npl.washington.edu Fri Aug 30 12:57:59 2002 From: SEYMOUR at npl.npl.washington.edu (Richard Seymour UW-NPL) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Perl alert system which will call me Message-ID: <020830105759.20898bec@npl.npl.washington.edu> > From: Matthew.Bustad [mailto:mbustad@Myrio.com] > Usually you just send email to your phone or pager. On Fri, 30 Aug 2002, Peter Darley wrote: > The problem with this is that I won't know what part of the system is down, > and if the network is down it would be foolish to rely on email. Plus I > don't have a pager, or an email address for my phone. Um... buy a pager? Paging service is about $120/year. If you spend one extra day trying to wedge in a more complex solution, it's not cost-effective. Simple non-email Pager systems can accept/display touch-tone numeric codes to tell you -what- is wrong. Since you want to isolate your alert system from network failures you still are going to be depending upon the phone system. (what -are- you going to do if\\ when the alert system does down?), We have vital systems with a web of layered (i.e. piles of partial) solutions... including the last resort: a RadioShack $99 tape-based, battery-powered phone dialer. If the rest of the building collapses, a normally-actively-held-open relay drops out and an off-site phoneline is dialled (three numbers, message repeats to each). You could have your system Email you. If it determined that Email wasn't going to work, it could invoke a Draconiam system like our final link (or -always- call you with the canned message to "check your Email"... if you didn't -get- email, you'd know it was the network) have fun --dick - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From cjk at tc.fluke.com Fri Aug 30 13:14:38 2002 From: cjk at tc.fluke.com (Charles Klement) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Perl alert system Message-ID: Peter, Have you looked at the bb package? Combined with qpage, I think it does everything you want. Including sending an sms message to your cell phone. It gives fairly reasonable alert messages that tell what is actually broken. I think it may be able to use a dialogic board to send a voice alert, but I can't recall for sure. http://bb4.com -charles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From aaron at activox.com Fri Aug 30 15:23:00 2002 From: aaron at activox.com (Aaron Salo) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Perl alert system which will call me In-Reply-To: References: Message-ID: <3.0.5.32.20020830132300.01c7a4e8@pop3.norton.antivirus> At 09:38 AM 8/30/2002 -0700, Peter Darley wrote: >Matthew, > The problem with this is that I won't know what part of the system is down, >and if the network is down it would be foolish to rely on email. Plus I >don't have a pager, or an email address for my phone. >Thanks, >Peter Darley ignoring for academic purposes the fact that sending mail to a cell phone or text pager is the very best solution to these things (you can get an explanation of the problem in the alert that tells you whether you need to get out of bed at 3am and drive to the NOC or can let it slide till the morning)... you would like it to dial your cell phone and use a text-to-voice application of some kind to tell you electro-voice-synth-orally what the specific problem is on the network/system/target machine? otherwise, you intend for it to fire off a series of coded beeps like a BIOS that you will use a decoder ring to decypher to tell you what the problem is? Otherwise, the flaw you cite above about "not knowing what part of the system is down" still exists in your dialer scheme. hmm. presumably you are monitoring Machine A externally from Machine B, and you wish Machine B to call you? Obviously if Machine A is in the crapper, it ain't gonna be reaching out and touching you. Whoa. Maybe that image was too vivid. So Machine B is hooked up to a POTS line and is running [some sort of monitoring software] peeping on Machine A. Machine B smells trouble, Timmy's stuck in a well out near the old Johnson place. Machine B is supposed to fire up its modem, ATDT [your number], wait for a pickup on your end, and [speak/beep] something audible to you or your voice mail? Or is your intention to just have it call you, and you would then infer that there is a problem by seeing that number in your callerID? ~!a - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From pdarley at kinesis-cem.com Fri Aug 30 16:04:10 2002 From: pdarley at kinesis-cem.com (Peter Darley) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: Perl alert system which will call me In-Reply-To: <3.0.5.32.20020830132300.01c7a4e8@pop3.norton.antivirus> Message-ID: Aaron (and others), What I'm wanting is that when there is a problem I get a call. When I pick up the phone I hear my own sweet pre recorded voice saying, 'The web server can't be pinged.' or 'The web server returns an unexpected result for web page X' or 'Can't ping the database server' or 'The database server returns an unexpected count of records' or 'Can't ping outside world' or whatever. This looks easy to do using a 'voice modem' and the Modem::Vgetty module to handle the alert part (Looks like probably 10 lines of code). Tho I'm far too lazy for this, one could even use it to interactively perform other tests based on what buttons on the phone you pressed, etc. I'll assume from everyone's responses that they don't know of anything that does this. If anyone cares there are some good reasons that this is better than a pager. :) They are as follows: 1) I can get the system to call one or more of my business partners who are not system admins and who won't want to carry a pager. 2) When I'm at my house I won't need to carry a pager around with me all the time. I can be sure that I'll hear the phone, and won't have to keep track of any little beeping boxes. 3) I'm not sure, but I suspect that the phone is more likely to wake me than a pager (but like I said, I don't have a pager, so I don't know) 4) It's not dependant on the network in any way, which means that I can run it on a machine inside our network and even if the pipe to the wider world is down it can still report 5) I already own all necessary equipment, and don't need to deal with the phone company to get text messaging set up on my cell phone (I hate dealing with the phone company) Thanks for everyone's feedback, Peter Darley -----Original Message----- From: Aaron Salo [mailto:aaron@activox.com] Sent: Friday, August 30, 2002 1:23 PM To: Peter Darley Cc: SPUG Subject: RE: SPUG: Perl alert system which will call me At 09:38 AM 8/30/2002 -0700, Peter Darley wrote: >Matthew, > The problem with this is that I won't know what part of the system is down, >and if the network is down it would be foolish to rely on email. Plus I >don't have a pager, or an email address for my phone. >Thanks, >Peter Darley ignoring for academic purposes the fact that sending mail to a cell phone or text pager is the very best solution to these things (you can get an explanation of the problem in the alert that tells you whether you need to get out of bed at 3am and drive to the NOC or can let it slide till the morning)... you would like it to dial your cell phone and use a text-to-voice application of some kind to tell you electro-voice-synth-orally what the specific problem is on the network/system/target machine? otherwise, you intend for it to fire off a series of coded beeps like a BIOS that you will use a decoder ring to decypher to tell you what the problem is? Otherwise, the flaw you cite above about "not knowing what part of the system is down" still exists in your dialer scheme. hmm. presumably you are monitoring Machine A externally from Machine B, and you wish Machine B to call you? Obviously if Machine A is in the crapper, it ain't gonna be reaching out and touching you. Whoa. Maybe that image was too vivid. So Machine B is hooked up to a POTS line and is running [some sort of monitoring software] peeping on Machine A. Machine B smells trouble, Timmy's stuck in a well out near the old Johnson place. Machine B is supposed to fire up its modem, ATDT [your number], wait for a pickup on your end, and [speak/beep] something audible to you or your voice mail? Or is your intention to just have it call you, and you would then infer that there is a problem by seeing that number in your callerID? ~!a - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From stephen.m.baker at intel.com Fri Aug 30 18:12:23 2002 From: stephen.m.baker at intel.com (Baker, Stephen M) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: pause for child process Message-ID: <288F9BF66CD9D5118DF400508B68C446020DA71D@orsmsx113.jf.intel.com> if a child process is started using a system call, is there a way to wait until the child process executes before continuing with the script?? Stephen Baker Office: 253.371.4188 Intel Corporation Mobile: 253.678.0556 Intel Architecture Group Email: stephen.m.baker@intel.com Mail Stop DP3-307 2800 Center Dr. Dupont, WA 98327 **************************************************************************** ************** The information contained in this email are the opinions and views of the author(s), and are not on behalf of Intel unless specifically stated. **************************************************************************** ************** - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From shawnw at speakeasy.org Fri Aug 30 18:34:11 2002 From: shawnw at speakeasy.org (Shawn Wagner) Date: Wed Aug 4 00:09:09 2004 Subject: SPUG: pause for child process In-Reply-To: <288F9BF66CD9D5118DF400508B68C446020DA71D@orsmsx113.jf.intel.com>; from stephen.m.baker@intel.com on Fri, Aug 30, 2002 at 04:12:23PM -0700 References: <288F9BF66CD9D5118DF400508B68C446020DA71D@orsmsx113.jf.intel.com> Message-ID: <20020830163411.B633@speakeasy.org> On Fri, Aug 30, 2002 at 04:12:23PM -0700, Baker, Stephen M wrote: > if a child process is started using a system call, is there a way to wait > until the child process executes before continuing with the script?? perldoc -f waitpid. For that matter, perl's system() waits for the child process to exit before returning... If you mean you want to wait for the child process to start running, but not neccessarily for it to exit before the parent continues, perhaps opening a pipe and have the child write to it while the parent blocks waiting to read from it? -- Shawn Wagner shawnw@speakeasy.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org From jimfl at tensegrity.net Fri Aug 30 18:44:45 2002 From: jimfl at tensegrity.net (Jim Flanagan) Date: Wed Aug 4 00:09:10 2004 Subject: SPUG: pause for child process In-Reply-To: <288F9BF66CD9D5118DF400508B68C446020DA71D@orsmsx113.jf.intel.com> Message-ID: On Fri, 30 Aug 2002, Baker, Stephen M wrote: > if a child process is started using a system call, > is there a way to wait until the child process executes > before continuing with the script?? Do you mean wait until the child starts or wait until the child finishes? If the latter, take a look at perldoc -tf wait perldoc -tf waitpid It's harder to know when a child process is fired up and ready for action. You have to arrange and manage some channel for communication, so that the child can say "okay, I'm ready" (signals, pipes, etc). -- ::jimfl http://jimfl.tensegrity.net mailto:jimfl%40t%65ns%65gr%69ty.n%65t - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POST TO: spug-list@pm.org PROBLEMS: owner-spug-list@pm.org Subscriptions; Email to majordomo@pm.org: ACTION LIST EMAIL Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org