Hello Monks,

We have a tricky java class with an include path list of over 3000 different directories. Naturally the program doesn't need all of these paths, but we don't know which ones are used.

We thought one solution might be to gradually go through the list, trying all combinations of up to 5 paths at once, in an attempt to find the minimal include path for the program. Eg.
$/ = ';'; @paths = <DATA>; foreach my $combination_listref ( &combinations_of( { min_length => 1, + max_length => 5, elements => \@paths }) ) { my @paths = @{$combination_listref}; &test_using_paths(@paths) and say 'SUCCESS WITH ' . scalar (@paths) . ' paths : ' . join +(';', @paths) } __DATA__ D:\opt\tbq\J2E\JC00\exe\jenqulib.jar;D:\opt\tbq\J2E\JC00\exe\jlogunzip +.jar;D:\opt\tbq\J2E\JC00\exe\jperflib.jar;D:\opt\tbq\J2E\JC00\exe\jst +artup.jar;D:\opt\tbq\J2E\JC00\exe\jstartupapi.jar;D:\opt\tbq\J2E\JC00 +\exe\jstartupimpl.jar;D:\opt\tbq\J2E\JC00\exe\servicehttp\tbqmc\frog. +jar;D:\opt\tbq\J2E\JC00\exe\servicehttp\tbqmc\tbqmc.jar;D:\opt\tbq\J2 +E\JC00\exe\servicehttp\tbqmc\tbqmcsoap.jar;D:\opt\tbq\J2E\JC00\exe\se +rvicehttp\tbqmc\tbqmcswing.jar;D:\opt\tbq\J2E\JC00\exe\servicehttp\tb +qmc\soapclient.jar;D:\opt\tbq\J2E\JC00\j2ee\admin\go.jar;D:\opt\tbq\J +2E\JC00\j2ee\admin\launcher\jaas.jar;D:\opt\tbq\J2E\JC00\j2ee\admin\l +ib\admin.jar;D:\opt\tbq\J2E\JC00\j2ee\admin\lib\bytecode.jar;D:\opt\t +bq\J2E\JC00\j2ee\admin\lib\compilation_lib.jar;D:\opt\tbq\J2E\JC00\j2 +ee\admin\lib\com_tbq_pj_jmx.jar;D:\opt\tbq\J2E\JC00\j2ee\admin\lib\co +nnector.jar;D:\opt\tbq\J2E\JC00\j2ee\admin\lib\ejb20.jar;D:\opt\tbq\J +2E\JC00\j2ee\admin\lib\exception.jar;D:\opt\tbq\J2E\JC00\j2ee\admin\l +ib\iq-lib.jar;D:\opt\tbq\J2E\JC00\j2ee\admin\lib\jARM.jar;D:\opt\tbq\ +J2E\JC00\j2ee\admin\lib\jARMSat.jar;D:\opt\tbq\J2E\JC00\j2ee\admin\li +b\jaxrpc-api.jar;D:\opt\tbq\J2E\JC00\j2ee\admin\lib\jcert.jar;D:\opt\ +tbq\J2E\JC00\j2ee\admin\lib\jmonapi.jar;D:\opt\tbq\J2E\JC00\j2ee\admi +n\lib\jms.jar;D:\opt\tbq\J2E\JC00\j2ee\admin\lib\jnet.jar;D:\opt\tbq\ +J2E\JC00\j2ee\admin\lib\jsse.jar;D:\opt\tbq\J2E\JC00\j2ee\admin\lib\j +startupapi.jar;D:\opt\tbq\J2E\JC00\j2ee\admin\lib\jstartupimpl.jar;D: +\opt\tbq\J2E\JC00\j2ee\admin\lib\jta.jar;
So, is there a CPAN module that can create the combinations for us? Or an enthusiastic Monk?


- Boldra

In reply to permutations and combinations - too many java class paths! by Boldra

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.