From uri at stemsystems.com Mon Aug 8 01:35:22 2016 From: uri at stemsystems.com (Uri Guttman) Date: Mon, 8 Aug 2016 04:35:22 -0400 Subject: [tpm] Join DFW.pm for a talk on dataflow In-Reply-To: <57A8432E.2080602@stemsystems.com> References: <57A8432E.2080602@stemsystems.com> Message-ID: <57A8444A.1090509@stemsystems.com> Hi all, I will be giving a remote talk to the Dallas/Ft. Worth Perl mongers (dfw.pm) on Monday night August 8, at 8pm CDT (GMT - 500). This talk will be about dataflow, a way to organize and architect your software which has many advantages. It is an expanded version of the lightning talk I gave in June at The Perl Conference in Orlando. If you plan to attend online, please install the hangouts app/plugin from google.com/hangouts ? This will allow you to view the live video stream, but if you'd like to participate interactively, please send your google ID *in advance* to dfw.perlmongers at gmail.com and we'll add you to the online classroom. -- Tommy Butler, John Fields, DFW.pm I will aim to answer questions via hangouts chat. thanx, Uri Guttman -------------- next part -------------- An HTML attachment was scrubbed... URL: From uri at stemsystems.com Mon Aug 8 01:38:15 2016 From: uri at stemsystems.com (Uri Guttman) Date: Mon, 8 Aug 2016 04:38:15 -0400 Subject: [tpm] Join DFW.pm for a talk on dataflow In-Reply-To: <57A8444A.1090509@stemsystems.com> References: <57A8432E.2080602@stemsystems.com> <57A8444A.1090509@stemsystems.com> Message-ID: <57A844F7.4090706@stemsystems.com> On 08/08/2016 04:35 AM, Uri Guttman wrote: > > Hi all, > > I will be giving a remote talk to the Dallas/Ft. Worth Perl mongers > (dfw.pm) on Monday night August 8, at 8pm CDT (GMT - 500). This talk > will be about dataflow, a way to organize and architect your software > which has many advantages. It is an expanded version of the lightning > talk I gave in June at The Perl Conference in Orlando. > oops! make that 7pm CDT (8pm for me). thanx, uri -------------- next part -------------- An HTML attachment was scrubbed... URL: From cj at enersave.ca Thu Aug 11 07:37:57 2016 From: cj at enersave.ca (Chris Jones) Date: Thu, 11 Aug 2016 10:37:57 -0400 Subject: [tpm] Regex assistance Message-ID: <20160811103757.Horde.mFMDUTioPGUR86aQGvCkUd1@enersave.ca> Hello Perl Mongers, I am looking for assistance with a regex. I have a bunch of strings in for form: "01.03.16,,Studio one, Space 22,1 500,500,01.051,," or ",01.03.16,,Studio one, Space 22,1 500,500,01.051," or ",01.03.16,,Studio one, Space 22,1 500,500,01.051,," or ",01.03.16,,Studio one, Space 22, ,01.051,," So the middle section can be one or more comma separated strings. I am trying to match and return the first non-blank pattern and the last non-blank pattern 01.03.16 and 01.051 ? these numbering formats are always the same: xx.xx.xx and yy.yyy So far I have a regex that matches the first pattern: "([0-9]{2})([\.])([0-9]{2})([\.])([0-9]{2})" In any of those above example. I am stuck after that. Any insights appreciated! -- Chris Jones 14 Oneida Avenue Toronto, ON M5J 2E3 416-697-0056 From olaf.alders at gmail.com Thu Aug 11 08:00:44 2016 From: olaf.alders at gmail.com (Olaf Alders) Date: Thu, 11 Aug 2016 11:00:44 -0400 Subject: [tpm] Regex assistance In-Reply-To: <20160811103757.Horde.mFMDUTioPGUR86aQGvCkUd1@enersave.ca> References: <20160811103757.Horde.mFMDUTioPGUR86aQGvCkUd1@enersave.ca> Message-ID: > On Aug 11, 2016, at 10:37 AM, Chris Jones wrote: > > > Hello Perl Mongers, > > I am looking for assistance with a regex. I have a bunch of strings in for form: > > "01.03.16,,Studio one, Space 22,1 500,500,01.051,," > or > ",01.03.16,,Studio one, Space 22,1 500,500,01.051," > or > ",01.03.16,,Studio one, Space 22,1 500,500,01.051,," > or > ",01.03.16,,Studio one, Space 22, ,01.051,," > > So the middle section can be one or more comma separated strings. > > I am trying to match and return the first non-blank pattern and the last non-blank pattern > 01.03.16 and 01.051 ? these numbering formats are always the same: xx.xx.xx and yy.yyy > > So far I have a regex that matches the first pattern: > > "([0-9]{2})([\.])([0-9]{2})([\.])([0-9]{2})" > > In any of those above example. > > I am stuck after that. > Any insights appreciated! I know you're looking for a regex, but you can do this with a split as well, which may be easier to read. use List::AllUtils qw( first ); my $foo = "01.03.16,,Studio one, Space 22,1 500,500,01.051,,"; my @foo = split m{,}, $foo; my $first = first { $_ } @foo; my $last = first { $_ } reverse @foo; Having said that, it looks like you're maybe parsing a CSV file, in which case just using a CSV parser from CPAN would help catch any corner cases. Olaf From janes.rob at gmail.com Thu Aug 11 08:29:51 2016 From: janes.rob at gmail.com (Rob Janes) Date: Thu, 11 Aug 2016 11:29:51 -0400 Subject: [tpm] Regex assistance In-Reply-To: <20160811103757.Horde.mFMDUTioPGUR86aQGvCkUd1@enersave.ca> References: <20160811103757.Horde.mFMDUTioPGUR86aQGvCkUd1@enersave.ca> Message-ID: ^,* in front then |(\d\d\.\d\d\d),*$ after? Ok replace bar with ,.*, On Aug 11, 2016 10:38 AM, "Chris Jones" wrote: > > Hello Perl Mongers, > > I am looking for assistance with a regex. I have a bunch of strings in for > form: > > "01.03.16,,Studio one, Space 22,1 500,500,01.051,," > or > ",01.03.16,,Studio one, Space 22,1 500,500,01.051," > or > ",01.03.16,,Studio one, Space 22,1 500,500,01.051,," > or > ",01.03.16,,Studio one, Space 22, ,01.051,," > > So the middle section can be one or more comma separated strings. > > I am trying to match and return the first non-blank pattern and the last > non-blank pattern > 01.03.16 and 01.051 ? these numbering formats are always the same: > xx.xx.xx and yy.yyy > > So far I have a regex that matches the first pattern: > > "([0-9]{2})([\.])([0-9]{2})([\.])([0-9]{2})" > > In any of those above example. > > I am stuck after that. > Any insights appreciated! > > > > -- > > Chris Jones > 14 Oneida Avenue > Toronto, ON M5J 2E3 > 416-697-0056 > > _______________________________________________ > toronto-pm mailing list > toronto-pm at pm.org > http://mail.pm.org/mailman/listinfo/toronto-pm > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jkeen at verizon.net Thu Aug 11 08:52:52 2016 From: jkeen at verizon.net (James E Keenan) Date: Thu, 11 Aug 2016 11:52:52 -0400 Subject: [tpm] Regex assistance In-Reply-To: References: <20160811103757.Horde.mFMDUTioPGUR86aQGvCkUd1@enersave.ca> Message-ID: <43c59b62-887e-f3a8-6d9c-d18dd59adf27@verizon.net> On 08/11/2016 11:00 AM, Olaf Alders wrote: > >> On Aug 11, 2016, at 10:37 AM, Chris Jones wrote: >> >> >> Hello Perl Mongers, >> >> I am looking for assistance with a regex. I have a bunch of strings in for form: >> >> "01.03.16,,Studio one, Space 22,1 500,500,01.051,," >> or >> ",01.03.16,,Studio one, Space 22,1 500,500,01.051," >> or >> ",01.03.16,,Studio one, Space 22,1 500,500,01.051,," >> or >> ",01.03.16,,Studio one, Space 22, ,01.051,," >> >> So the middle section can be one or more comma separated strings. >> >> I am trying to match and return the first non-blank pattern and the last non-blank pattern >> 01.03.16 and 01.051 ? these numbering formats are always the same: xx.xx.xx and yy.yyy >> >> So far I have a regex that matches the first pattern: >> >> "([0-9]{2})([\.])([0-9]{2})([\.])([0-9]{2})" >> >> In any of those above example. >> >> I am stuck after that. >> Any insights appreciated! > > I know you're looking for a regex, but you can do this with a split as well, which may be easier to read. > > use List::AllUtils qw( first ); > > my $foo = "01.03.16,,Studio one, Space 22,1 500,500,01.051,,"; > my @foo = split m{,}, $foo; > > my $first = first { $_ } @foo; > my $last = first { $_ } reverse @foo; > > Having said that, it looks like you're maybe parsing a CSV file, in which case just using a CSV parser from CPAN would help catch any corner cases. > > Olaf I would go one step farther than Olaf. It looks to me that you're trying to parse *badly formatted* CSV data. Each column in well-defined CSV data should have a specific real-world meaning. In your sample data, the pattern '(\d{2}\.){2}\d{2}' can appear in either the first or second column -- which means that the real-world meaning of either of those columns is, at best, ambiguous. If you're going to need to parse this data over the long haul, you'd probably be better off getting the data provider to clean up the data. IMO unless and until you are getting really clean data, trying to compose a single killer regex is a waste of effort. If this is one off, then you can take Olaf's suggestions. Or you could pass each record through a series of regexes which trim the extraneous fields from the beginning and end of the strings, then use other regexes to capture what you need. That would be slower, but perhaps more self-documenting. Thank you very much. Jim Keenan From legrady at gmail.com Thu Aug 11 10:22:30 2016 From: legrady at gmail.com (legrady) Date: Thu, 11 Aug 2016 13:22:30 -0400 Subject: [tpm] Regex assistance Message-ID: How about if you split () on Co. Mas, and then just check the elements of the array for the values you want? You pattern captures into separate variables : two digits, a dot, two digits, a dot, another two digits. ?From your description you want to the whole thing:? ? ? ? /(\d{2}\.\d {2}\.\d {2})/ OR a bit sloppily, ?but valid? ? ? ?/([0-9.]{8})/ It matches non valid strings, ?but you say those won't happen. Or by adding an 'x' flag, you can comment your regex.? ? ? / ( ? ? ? ? ? ? ? ? ? ? # capture? ? ? ? [0-9.] {8} ? ? ?# 8 chars which are digit or dot? ? ? ? ) /' Probably more useful in more complex instances. Sent from my Samsung Galaxy smartphone. -------- Original message --------From: Rob Janes Date: 2016-08-11 11:29 (GMT-05:00) To: Chris Jones Cc: toronto-pm at pm.org Subject: Re: [tpm] Regex assistance ^,* in front then |(\d\d\.\d\d\d),*$ after? Ok replace bar with ,.*, On Aug 11, 2016 10:38 AM, "Chris Jones" wrote: Hello Perl Mongers, I am looking for assistance with a regex. I have a bunch of strings in for form: "01.03.16,,Studio one, Space 22,1? ? ? ? ?500,500,01.051,," or ",01.03.16,,Studio one, Space 22,1? ? ? ? ?500,500,01.051," or ",01.03.16,,Studio one, Space 22,1? ? ? ? ?500,500,01.051,," or ",01.03.16,,Studio one, Space 22, ,01.051,," So the middle section can be one or more comma separated strings. I am trying to match and return the first non-blank pattern and the last non-blank pattern 01.03.16 and 01.051 ? these numbering formats are always the same: xx.xx.xx and yy.yyy So far I have a regex that matches the first pattern: "([0-9]{2})([\.])([0-9]{2})([\.])([0-9]{2})" In any of those above example. I am stuck after that. Any insights appreciated! -- Chris Jones 14 Oneida Avenue Toronto, ON M5J 2E3 416-697-0056 _______________________________________________ toronto-pm mailing list toronto-pm at pm.org http://mail.pm.org/mailman/listinfo/toronto-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From cj at enersave.ca Fri Aug 12 03:06:35 2016 From: cj at enersave.ca (Christopher Jones) Date: Fri, 12 Aug 2016 06:06:35 -0400 Subject: [tpm] Regex assistance In-Reply-To: References: Message-ID: <035601d1f481$35bde150$a139a3f0$@enersave.ca> Thanks all for your kind assistance. You are correct, I do end up with a badly formatted csv strings to analyze but that was my doing. The document starts as a badly formatted PDF which I converted to Excel ? the conversion doesn?t recognize all the columns successfully. My thought was to loop through the rows in the excel tables and create the csv strings on each row then search in those strings for the patterns I need to extract. Perhaps there is a PDF Perl module that would be useful for this kind of task? Christopher Jones 14 Oneida Avenue Toronto, ON 416-697-0056 From: legrady [mailto:legrady at gmail.com] Sent: Thursday, August 11, 2016 1:22 PM To: Rob Janes; Chris Jones Cc: toronto-pm at pm.org Subject: Re: [tpm] Regex assistance How about if you split () on Co. Mas, and then just check the elements of the array for the values you want? You pattern captures into separate variables : two digits, a dot, two digits, a dot, another two digits. From your description you want to the whole thing: /(\d{2}\.\d {2}\.\d {2})/ OR a bit sloppily, but valid /([0-9.]{8})/ It matches non valid strings, but you say those won't happen. Or by adding an 'x' flag, you can comment your regex. / ( # capture [0-9.] {8} # 8 chars which are digit or dot ) /' Probably more useful in more complex instances. Sent from my Samsung Galaxy smartphone. -------- Original message -------- From: Rob Janes Date: 2016-08-11 11:29 (GMT-05:00) To: Chris Jones Cc: toronto-pm at pm.org Subject: Re: [tpm] Regex assistance ^,* in front then |(\d\d\.\d\d\d),*$ after? Ok replace bar with ,.*, On Aug 11, 2016 10:38 AM, "Chris Jones" wrote: Hello Perl Mongers, I am looking for assistance with a regex. I have a bunch of strings in for form: "01.03.16,,Studio one, Space 22,1 500,500,01.051,," or ",01.03.16,,Studio one, Space 22,1 500,500,01.051," or ",01.03.16,,Studio one, Space 22,1 500,500,01.051,," or ",01.03.16,,Studio one, Space 22, ,01.051,," So the middle section can be one or more comma separated strings. I am trying to match and return the first non-blank pattern and the last non-blank pattern 01.03.16 and 01.051 ? these numbering formats are always the same: xx.xx.xx and yy.yyy So far I have a regex that matches the first pattern: "([0-9]{2})([\.])([0-9]{2})([\.])([0-9]{2})" In any of those above example. I am stuck after that. Any insights appreciated! -- Chris Jones 14 Oneida Avenue Toronto, ON M5J 2E3 416-697-0056 _______________________________________________ toronto-pm mailing list toronto-pm at pm.org http://mail.pm.org/mailman/listinfo/toronto-pm -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.s.doyle at gmail.com Mon Aug 22 10:57:01 2016 From: dave.s.doyle at gmail.com (Dave Doyle) Date: Mon, 22 Aug 2016 13:57:01 -0400 Subject: [tpm] Meetup on Thursday Message-ID: Details here: https://www.meetup.com/Toronto-Perl-Mongers/events/233539831/ -- dave.s.doyle at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.s.doyle at gmail.com Wed Aug 24 10:05:19 2016 From: dave.s.doyle at gmail.com (Dave Doyle) Date: Wed, 24 Aug 2016 13:05:19 -0400 Subject: [tpm] September Lightning Talks -- Call for speakers Message-ID: Thursday Sept 29 It's September again so that means it's time for Lightning talks! CALL FOR VOLUNTEERS Any who are interested presenting please email me (dave.s.doyle at gmail.com) with your topic. Lightning talks are a chance for people to present on their favourite language, framework, library or any other topic that we might be interested in (not just Perl). Past talks even included ones on Mindfulness and the Pirate Party. Talks need only be about 5 to 10 minutes (but aim for 5). This is a great opportunity for people who haven't presented before to get their feet wet. You don't need to be an expert, you just need to care! Speakers: Please, if possible, email me slides as PDF or send a link to your online slideshow so we can run everything off a single laptop. Speaker list: ? Dave Doyle - TBD -- dave.s.doyle at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave.s.doyle at gmail.com Thu Aug 25 16:02:48 2016 From: dave.s.doyle at gmail.com (Dave Doyle) Date: Thu, 25 Aug 2016 19:02:48 -0400 Subject: [tpm] Google Hangout Message-ID: https://t.co/QLDCtKYo3x -- dave.s.doyle at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From olaf.alders at gmail.com Thu Aug 25 21:00:28 2016 From: olaf.alders at gmail.com (Olaf Alders) Date: Fri, 26 Aug 2016 00:00:28 -0400 Subject: [tpm] tonight's talk Message-ID: <6AF90703-1D27-423B-9A81-A481C2D93732@gmail.com> Thanks to everyone who attended (in person and virtually). The talk is on Youtube: https://www.youtube.com/watch?v=QBnOV4kTE6g The slides are at http://www.slideshare.net/oalders/no-hugging-no-learning and https://github.com/oalders/no-hugging-no-learning Olaf From olaf.alders at gmail.com Tue Aug 30 15:22:56 2016 From: olaf.alders at gmail.com (Olaf Alders) Date: Tue, 30 Aug 2016 18:22:56 -0400 Subject: [tpm] Another Minion follow-up Message-ID: <12CD9894-D001-413E-96C1-8400899CE900@gmail.com> Alex had asked last night if Highcharts can handle a logarithmic axis and it turns out that it can: http://www.highcharts.com/demo/line-log-axis Thanks very much for that suggestion. I'll be giving it a spin. :) Joel Berger watched the presentation and answered the following for me: Alex had asked whether the backoff setting could handle arbitrary logic. Turns out you can supply it with an anonymous sub: https://metacpan.org/pod/Minion#backoff Dave, you had asked about rate limiting in Minion. There's nothing properly built in to handle this. You could possibly cobble something together that would do this, but adding a delay to inactive jobs and possibly by failing active jobs and adding a delay once rate limiting has come into play. There was a question about how long jobs stay in the queue after they are finished. The default is 2 days, but it is configurable. http://mojolicious.org/perldoc/Minion/#remove_after Olaf