<div dir="ltr"><div>Hi Murray,<br><br></div>Thanks a lot for the feedback. I apologise for not testing my stuff more thoroughly, I hadn't actually though people were going to run it, just look at it :-)<br><div><div><div class="gmail_extra">
<br><br><div class="gmail_quote">On 13 April 2013 20:36, Murray <span dir="ltr"><<a href="mailto:perl@minty.org" target="_blank">perl@minty.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im">On Sat, Apr 13, 2013 at 05:36:08PM +0100, Wim Vanderbauwhede wrote:<br>
> For example:<br>
><br>
> use GPRM;<br>
> use GPRM::DocFilter;<br>
><br>
> my @dfs = map {new GPRM::DocFilter($_)} 1..8;<br>
> my $df2 = new GPRM::DocFilter(9);<br>
><br>
>     {<br>
>         my @vals;<br>
>         for my $i (1..8) {<br>
>             push @vals, $dfs[$i-1]->score($i)<br>
>         }<br>
>         $df2->aggregate(@vals);<br>
>     }<br>
<br>
</div>Ok -- so I'm not claiming to really grok all of the details, and I've only had<br>
a cursory glance, so forgive stupid / newbie mistakes ... but I always find it<br>
useful to get that feedback, even if it's probably not what you were really<br>
hoping for here ;)<br>
<br>
Also, this is kinda brain dump, sorry :)<br>
<br>
---<br>
<br>
So first I forked your repo -- gives me a place to play.<br>
<br>
<a href="https://github.com/minty/Perl-GPIR-Generator" target="_blank">https://github.com/minty/Perl-GPIR-Generator</a><br>
<br>
then<br>
<br>
    git clone git@github.com:minty/Perl-GPIR-Generator.git<br>
<br>
    cd Perl-GPIR-Generator<br>
    vi sample<br>
<br>
Then I set "sample" to be:<br>
<br>
    #!/usr/bin/env perl<br>
<div class="im"><br>
    use GPRM;<br>
    use GPRM::DocFilter;<br>
<br>
    my @dfs = map { new GPRM::DocFilter($_) } 1..8;<br>
    my $df2 = new GPRM::DocFilter(9);<br>
</div>    my $NTH = 8;<br>
<br>
    {<br>
        my @vals;<br>
        for my $i (1..$NTH) {<br>
<div class="im">            push @vals, $dfs[$i-1]->score($i)<br>
        }<br>
        $df2->aggregate(@vals);<br>
    }<br>
<br>
</div>ran it, and got:<br>
<br>
    § chmod u+x ./sample<br>
    § ./sample<br>
<br>
    Deep recursion on subroutine "PPI::Visitors::visit_tree" at PPI/Visitors.pm line 97.<br>
    Deep recursion on subroutine "PPI::Visitors::visit_tree" at PPI/Visitors.pm line 97.<br>
    Deep recursion on subroutine "PPI::Visitors::visit_tree" at PPI/Visitors.pm line 97.<br>
    Deep recursion on subroutine "PPI::Visitors::visit_tree" at PPI/Visitors.pm line 97.<br>
    Deep recursion on subroutine "PPI::Visitors::visit_tree" at PPI/Visitors.pm line 97.<br>
    ...<br>
<br>
I tried it with:<br>
<br>
    § perl ./sample<br>
<br>
but same result.<br>
<br>
I seem to get these littering the filesystem:<br>
<br>
    #   _PROC__PROC__PROC__PROC__PROC_sample<br>
    #   _PROC__PROC__PROC__PROC_sample<br>
    #   _PROC__PROC__PROC_sample<br>
    #   _PROC__PROC_sample<br>
    #   _PROC_sample<br>
<br>
Which makes me wonder if File::Temp, used with it's CLEANUP => 1 constructor<br>
arg might be relevant?<br>
<br></blockquote><div>Could be, will check it out<br> <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I had to Ctrl-C "sample" in both the above cases.<br></blockquote><div><br></div><div>This should be fixed now. I made a mistake in how I check for the generated file name. <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
fwiw, I'm using perlbrew:<br>
<br>
    § perl -v<br>
    This is perl 5, version 16, subversion 3 (v5.16.3) built for i686-linux<br>
<br>
    § cat /etc/lsb-release<br>
    DISTRIB_ID=Ubuntu<br>
    DISTRIB_RELEASE=12.04<br>
    DISTRIB_CODENAME=precise<br>
    DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"<br>
<br>
Running:<br>
<br>
    § perl transform_GPRM.pl<br>
<br>
Seems to work and produce plausible output.<br>
<br>
    § perl <a href="http://matmult.pl" target="_blank">matmult.pl</a><br>
    Can't locate GPRM/MatrixOps.pm in @INC ... [snipped long @INC paths]<br>
<br>
I can't see GPRM/MatrixOps.pm in the git repo ... ?<br></blockquote><div>I forgot a few lines in the script :-( Fixed now.  GPRM/MatrixOps.pm is a generated stub, that's why it's not in the repo. <br><br></div>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
    § perl <a href="http://matops.pl" target="_blank">matops.pl</a><br>
<br>
produces:<br>
<br>
------------<br>
ADD TO REG TABLE $GPRM::A<br>
------------<br>
ADD TO REG TABLE $GPRM::B<br>
------------<br>
ADD TO REG TABLE $GPRM::C<br>
------------<br>
ADD TO REG TABLE $GPRM::D<br>
------------<br>
$GPRM::A exists in REG TABLE<br>
REG_READ <1>:<$GPRM::A><br>
------------<br>
$GPRM::B exists in REG TABLE<br>
REG_READ <2>:<$GPRM::B><br>
------------<br>
ADD TO REG TABLE $GPRM::AB<br>
------------<br>
$GPRM::C exists in REG TABLE<br>
REG_READ <3>:<$GPRM::C><br>
------------<br>
$GPRM::D exists in REG TABLE<br>
REG_READ <4>:<$GPRM::D><br>
------------<br>
ADD TO REG TABLE $GPRM::CD<br>
------------<br>
$GPRM::AB exists in REG TABLE<br>
REG_READ <5>:<$GPRM::AB><br>
------------<br>
$GPRM::CD exists in REG TABLE<br>
REG_READ <6>:<$GPRM::CD><br>
Name "GPRM::CD" used only once: possible typo at _PROC_matops.pl line 85.<br>
Name "GPRM::C" used only once: possible typo at _PROC_matops.pl line 70.<br>
Name "GPRM::A" used only once: possible typo at _PROC_matops.pl line 58.<br>
Name "GPRM::B" used only once: possible typo at _PROC_matops.pl line 58.<br>
Name "GPRM::D" used only once: possible typo at _PROC_matops.pl line 70.<br>
Name "GPRM::AB" used only once: possible typo at _PROC_matops.pl line 85.<br>
Can't locate object method "new" via package "Mat" (perhaps you forgot to load "Mat"?) at _PROC_matops.pl line 40.<br></blockquote><div>Another mistake in the script, fixed now. You'll still get the warnings, that is because my transformer is not yet complete. <br>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
---<br>
<br>
time for some dinner now -- I'll have a further play with transform_GPRM.pl in<br>
due course, as currently it is the only one that seems to really work for me.<br> 
<br></blockquote><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
feedback? make it easier to get a working demo, or unit tests.  Test are, in<br>
addition to all the testing things, my first port of call to run the code in<br>
anger, and start messing with it.  They are often where I copy/paste from to<br>
start playing, as my assumption is they are worked-examples of how the code is<br>
intended to be used.<br></blockquote><div>Correct. Only I did not actually test all the test cases in the repo ^_^; <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
I realise that *might* be tricky in this case ... but ... well, feedback.  More<br>
tests.  Primarily, for a "worked example of the code in use" rather than<br>
worrying about "comprehensive test coverage".<br>
<br>
So ... I tried to create a minimal test file -- no love :(<br>
<br>
§ cat t/01_basic.t<br>
#!/usr/bin/env perl<br>
<br>
use FindBin;<br>
use lib "$FindBin::Bin";<br>
<br>
use common::sense;<br>
use Test::More;<br>
<br>
use_ok 'GPRM';<br>
<br>
done_testing();<br>
<br>
murray@testing:~/github/Perl-GPIR-Generator§ perl t/01_basic.t<br>
Can't open perl script "t/_PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC_01_basic.t": File name too long<br>
</blockquote><div>Same stupid bug again, should probably be OK now, though I don't know what the output of this test should be.<br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
---<br>
<br>
fwiw:<br>
<br>
#!/usr/bin/env perl<br>
<br>
I use perlbrew [1], and this makes yer scripts "more portable" in such<br>
environs.<br>
<br></blockquote><div>Don't know it, will check it out <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
use common::sense;<br></blockquote><div>Ditto <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
it works for me, and it's less boilerplate than:<br>
<br>
    use strict;<br>
    use warnings;<br>
    use 5.10;<br>
<br>
plus, I concur with the general sentiment of the pod, even if frankly the<br>
details are tl;dr for me.  ymmv obviously :)<br>
<br>
[1] re: perlbrew ... fwiw, this is my baseline:<br>
<br>
    curl -kL <a href="http://install.perlbrew.pl" target="_blank">http://install.perlbrew.pl</a> | bash<br>
    echo 'source ~/perl5/perlbrew/etc/bashrc' >> ~/.bashrc<br>
    source ~/perl5/perlbrew/etc/bashrc<br>
    perlbrew install --switch stable<br>
    perlbrew install-cpanm<br>
<br>
Optionally, if you have multiple CPUS, with "-j 8" (or some other value for 8)<br>
added to the first "perlbrew install" line.  Makes it silly fast to install a<br>
new Perl :)<br>
<br>
<a href="http://www.dagolden.com/index.php/1384/parallel-make-for-perlbrew/" target="_blank">http://www.dagolden.com/index.php/1384/parallel-make-for-perlbrew/</a><br>
<br>
Then I rely heavily on cpanm -- at least, for dev/play.  Production is an<br>
entirely different ball game.<br></blockquote><div>How so? cpanm not good for production? <br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

<br>
    § cpanm common::sense<br>
<br>
etc.<br></blockquote><div> </div></div>Thanks a lot!<br><br></div><div class="gmail_extra">Wim<br></div><div class="gmail_extra"><br clear="all"><br>-- <br>If it's pointless, what's the point?<br>If there is a point to it, what's the point?<br>
(Tibor Fischer, "The Thought Gang")
</div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 13 April 2013 20:36, Murray <span dir="ltr"><<a href="mailto:perl@minty.org" target="_blank">perl@minty.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Sat, Apr 13, 2013 at 05:36:08PM +0100, Wim Vanderbauwhede wrote:<br>
> For example:<br>
><br>
> use GPRM;<br>
> use GPRM::DocFilter;<br>
><br>
> my @dfs = map {new GPRM::DocFilter($_)} 1..8;<br>
> my $df2 = new GPRM::DocFilter(9);<br>
><br>
>     {<br>
>         my @vals;<br>
>         for my $i (1..8) {<br>
>             push @vals, $dfs[$i-1]->score($i)<br>
>         }<br>
>         $df2->aggregate(@vals);<br>
>     }<br>
<br>
</div>Ok -- so I'm not claiming to really grok all of the details, and I've only had<br>
a cursory glance, so forgive stupid / newbie mistakes ... but I always find it<br>
useful to get that feedback, even if it's probably not what you were really<br>
hoping for here ;)<br>
<br>
Also, this is kinda brain dump, sorry :)<br>
<br>
---<br>
<br>
So first I forked your repo -- gives me a place to play.<br>
<br>
<a href="https://github.com/minty/Perl-GPIR-Generator" target="_blank">https://github.com/minty/Perl-GPIR-Generator</a><br>
<br>
then<br>
<br>
    git clone git@github.com:minty/Perl-GPIR-Generator.git<br>
<br>
    cd Perl-GPIR-Generator<br>
    vi sample<br>
<br>
Then I set "sample" to be:<br>
<br>
    #!/usr/bin/env perl<br>
<div class="im"><br>
    use GPRM;<br>
    use GPRM::DocFilter;<br>
<br>
    my @dfs = map { new GPRM::DocFilter($_) } 1..8;<br>
    my $df2 = new GPRM::DocFilter(9);<br>
</div>    my $NTH = 8;<br>
<br>
    {<br>
        my @vals;<br>
        for my $i (1..$NTH) {<br>
<div class="im">            push @vals, $dfs[$i-1]->score($i)<br>
        }<br>
        $df2->aggregate(@vals);<br>
    }<br>
<br>
</div>ran it, and got:<br>
<br>
    § chmod u+x ./sample<br>
    § ./sample<br>
<br>
    Deep recursion on subroutine "PPI::Visitors::visit_tree" at PPI/Visitors.pm line 97.<br>
    Deep recursion on subroutine "PPI::Visitors::visit_tree" at PPI/Visitors.pm line 97.<br>
    Deep recursion on subroutine "PPI::Visitors::visit_tree" at PPI/Visitors.pm line 97.<br>
    Deep recursion on subroutine "PPI::Visitors::visit_tree" at PPI/Visitors.pm line 97.<br>
    Deep recursion on subroutine "PPI::Visitors::visit_tree" at PPI/Visitors.pm line 97.<br>
    ...<br>
<br>
I tried it with:<br>
<br>
    § perl ./sample<br>
<br>
but same result.<br>
<br>
I seem to get these littering the filesystem:<br>
<br>
    #   _PROC__PROC__PROC__PROC__PROC_sample<br>
    #   _PROC__PROC__PROC__PROC_sample<br>
    #   _PROC__PROC__PROC_sample<br>
    #   _PROC__PROC_sample<br>
    #   _PROC_sample<br>
<br>
Which makes me wonder if File::Temp, used with it's CLEANUP => 1 constructor<br>
arg might be relevant?<br>
<br>
I had to Ctrl-C "sample" in both the above cases.<br>
<br>
fwiw, I'm using perlbrew:<br>
<br>
    § perl -v<br>
    This is perl 5, version 16, subversion 3 (v5.16.3) built for i686-linux<br>
<br>
    § cat /etc/lsb-release<br>
    DISTRIB_ID=Ubuntu<br>
    DISTRIB_RELEASE=12.04<br>
    DISTRIB_CODENAME=precise<br>
    DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"<br>
<br>
Running:<br>
<br>
    § perl transform_GPRM.pl<br>
<br>
Seems to work and produce plausible output.<br>
<br>
    § perl <a href="http://matmult.pl" target="_blank">matmult.pl</a><br>
    Can't locate GPRM/MatrixOps.pm in @INC ... [snipped long @INC paths]<br>
<br>
I can't see GPRM/MatrixOps.pm in the git repo ... ?<br>
<br>
    § perl <a href="http://matops.pl" target="_blank">matops.pl</a><br>
<br>
produces:<br>
<br>
------------<br>
ADD TO REG TABLE $GPRM::A<br>
------------<br>
ADD TO REG TABLE $GPRM::B<br>
------------<br>
ADD TO REG TABLE $GPRM::C<br>
------------<br>
ADD TO REG TABLE $GPRM::D<br>
------------<br>
$GPRM::A exists in REG TABLE<br>
REG_READ <1>:<$GPRM::A><br>
------------<br>
$GPRM::B exists in REG TABLE<br>
REG_READ <2>:<$GPRM::B><br>
------------<br>
ADD TO REG TABLE $GPRM::AB<br>
------------<br>
$GPRM::C exists in REG TABLE<br>
REG_READ <3>:<$GPRM::C><br>
------------<br>
$GPRM::D exists in REG TABLE<br>
REG_READ <4>:<$GPRM::D><br>
------------<br>
ADD TO REG TABLE $GPRM::CD<br>
------------<br>
$GPRM::AB exists in REG TABLE<br>
REG_READ <5>:<$GPRM::AB><br>
------------<br>
$GPRM::CD exists in REG TABLE<br>
REG_READ <6>:<$GPRM::CD><br>
Name "GPRM::CD" used only once: possible typo at _PROC_matops.pl line 85.<br>
Name "GPRM::C" used only once: possible typo at _PROC_matops.pl line 70.<br>
Name "GPRM::A" used only once: possible typo at _PROC_matops.pl line 58.<br>
Name "GPRM::B" used only once: possible typo at _PROC_matops.pl line 58.<br>
Name "GPRM::D" used only once: possible typo at _PROC_matops.pl line 70.<br>
Name "GPRM::AB" used only once: possible typo at _PROC_matops.pl line 85.<br>
Can't locate object method "new" via package "Mat" (perhaps you forgot to load "Mat"?) at _PROC_matops.pl line 40.<br>
<br>
---<br>
<br>
time for some dinner now -- I'll have a further play with transform_GPRM.pl in<br>
due course, as currently it is the only one that seems to really work for me.<br>
<br>
feedback? make it easier to get a working demo, or unit tests.  Test are, in<br>
addition to all the testing things, my first port of call to run the code in<br>
anger, and start messing with it.  They are often where I copy/paste from to<br>
start playing, as my assumption is they are worked-examples of how the code is<br>
intended to be used.<br>
<br>
I realise that *might* be tricky in this case ... but ... well, feedback.  More<br>
tests.  Primarily, for a "worked example of the code in use" rather than<br>
worrying about "comprehensive test coverage".<br>
<br>
So ... I tried to create a minimal test file -- no love :(<br>
<br>
§ cat t/01_basic.t<br>
#!/usr/bin/env perl<br>
<br>
use FindBin;<br>
use lib "$FindBin::Bin";<br>
<br>
use common::sense;<br>
use Test::More;<br>
<br>
use_ok 'GPRM';<br>
<br>
done_testing();<br>
<br>
murray@testing:~/github/Perl-GPIR-Generator§ perl t/01_basic.t<br>
Can't open perl script "t/_PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC__PROC_01_basic.t": File name too long<br>

<br>
---<br>
<br>
fwiw:<br>
<br>
#!/usr/bin/env perl<br>
<br>
I use perlbrew [1], and this makes yer scripts "more portable" in such<br>
environs.<br>
<br>
use common::sense;<br>
<br>
it works for me, and it's less boilerplate than:<br>
<br>
    use strict;<br>
    use warnings;<br>
    use 5.10;<br>
<br>
plus, I concur with the general sentiment of the pod, even if frankly the<br>
details are tl;dr for me.  ymmv obviously :)<br>
<br>
[1] re: perlbrew ... fwiw, this is my baseline:<br>
<br>
    curl -kL <a href="http://install.perlbrew.pl" target="_blank">http://install.perlbrew.pl</a> | bash<br>
    echo 'source ~/perl5/perlbrew/etc/bashrc' >> ~/.bashrc<br>
    source ~/perl5/perlbrew/etc/bashrc<br>
    perlbrew install --switch stable<br>
    perlbrew install-cpanm<br>
<br>
Optionally, if you have multiple CPUS, with "-j 8" (or some other value for 8)<br>
added to the first "perlbrew install" line.  Makes it silly fast to install a<br>
new Perl :)<br>
<br>
<a href="http://www.dagolden.com/index.php/1384/parallel-make-for-perlbrew/" target="_blank">http://www.dagolden.com/index.php/1384/parallel-make-for-perlbrew/</a><br>
<br>
Then I rely heavily on cpanm -- at least, for dev/play.  Production is an<br>
entirely different ball game.<br>
<br>
    § cpanm common::sense<br>
<br>
etc.<br>
</blockquote></div><br><br clear="all"><br>-- <br>If it's pointless, what's the point?<br>If there is a point to it, what's the point?<br>(Tibor Fischer, "The Thought Gang")
</div>