Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

The Monastery Gates

( [id://131]=superdoc: print w/replies, xml ) Need Help??

Notices:

erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

If you're new here please read PerlMonks FAQ
and Create a new user.

Quests
Wall of Larry Quest
Starts at: Feb 26, 2024 at 05:00
Ends at: Dec 31, 2024 at 04:59
Current Status: Active
2 replies by jdporter

    By now you've all seen The St. Larry Wall Shrine. Well, it could use a fresh coat of gold leaf and shellac. Therefore, we are soliciting Larry-related items to be placed on the shrine. Links to offsite content are good; or if you have small bits of content, such as quotes, you'd like to contribute, that's fine too. Please reply to this Quest with your humble offerings. Thank you! And may St. Larry bless your codings and your debuggings.

poll ideas quest 2024
Starts at: Jan 01, 2024 at 00:00
Ends at: Dec 31, 2024 at 23:59
Current Status: Active
5 replies by pollsters
    First, read How do I create a Poll?. Then suggest your poll here. Complete ideas are more likely to be used.

    Note that links may be used in choices but not in the title.

Perl News
PDL website updated including "demos" section
on Sep 19, 2024 at 21:03
0 replies by etj
    Esteemed monks, the PDL website at https://pdl.perl.org/ was updated today:
    • the "News" section was updated with releases from this year for various PDL-related modules
    • the "demos" section (https://pdl.perl.org/?page=demos/index, or the "Demos" link in the sidebar) was updated to have the text and output (including images, including animations) of not two but now eight PDL demos - a couple of them might be considered quite neat
    • the front page had some text added with something of a "why use PDL" pitch
    It would be very helpful if those who have time could take a look at any of those, and comment if there are any mistakes or possible improvements (or even if they think it's good).
PDL 2.092 released
on Sep 19, 2024 at 16:59
0 replies by etj
    PDL 2.092 has just been released. Notable changes since 2.087:
    • fix badvalue propagation
    • core support for PDL::Parallel::threads
    • change dataflow to work one-shot each time like "inplace"
    • add demos of PDL::GSL::RNG, PDL::GSL::CDF, PDL::Func
    • fix MatrixOps::eigens for asymmetric case inc complex eigenvectors
    • wfits fixed to handle multi-line HISTORY
    • fix handling large Perl scalar values
    • add spline-handling functions in PDL::Slatec
    • PP dim sizes can be =CALC(...) instead of explicit RedoDimsCode
    The IRC channel (#pdl on irc.perl.org) is a great virtual place to come and ask questions, or just watch the GitHub messages flow by.

    As usual, please give the new release a try and report problems.

Supplications
Merge lists of ordered strings into canonical ordering
5 direct replies — Read more / Contribute
by NERDVANA
on Sep 19, 2024 at 13:50
    Brain teaser alert! This is more tricky than you would expect.

    I'm looking for an algorithm that can take lists of strings that are in a user-declared logical order, and merge those lists in the way that preserves the most of those logical orderings.

    Example:

    use Test2::V0; use v5.40; my @list1= qw( K B I S Y A Q ); my @list2= qw( B S N A ); my @list3= qw( Y N Q ); my $combined= fancy_algorithm(\@list1, \@list2, \@list3); is( $combined, [qw( K B I S Y N A Q )] );
    For bonus points, it should return a stable output when there are ambiguities (such as if there is no list which establishes the order between two elements), and if the input disagrees with itself it should select the ordering that occurs more frequently.
    use Test2::V0; use v5.40; my @lists= ( [qw( X P Y )], [qw( X B Y N )], [qw( P B N )], [qw( X B P N )], [qw( X B P Y )], [qw( A Z )], [qw( A K L )], ); my $combined= fancy_algorithm(@lists); is( $combined, [qw( X B P Y N A Z K L )] );

    Why is it relevant? because on more than one occasion I've wanted to export user data with the columns in the "natural order", but I'm combining multiple independent data sets and for each dataset the user has chosen the column names according to some ordering that makes sense to them but which the system has no knowledge of. I have a solution that "mostly works", but I keep finding edge cases where it breaks. I'm curious if there is a complete solution to the problem.

    Edit: ...and hopefully more efficient than just running every permutation of output looking for the one with the highest score. Sometimes there are a lot of columns and that could be bad.

[XS] : "snprintf" portability options
2 direct replies — Read more / Contribute
by syphilis
on Sep 15, 2024 at 05:46
    Hi,

    In Cpanel-JSON-XS-4.38, the XS.xs file contains a few lines like:
    snprintf (enc->cur, IVUV_MAXCHARS, "%" UVuf, uv)
    which is fine on *nix systems but on Windows builds of perl, whenever IVSIZE is 8, it warns:
    XS.xs:2449:66: warning: format '%u' expects argument of type 'unsigned + int', but argument 4 has type 'long long unsigned int' [-Wformat=]
    I can fix that for those Windows perls by replacing the occurrence of "%" with "%llu" but I doubt the portability of that fix. (I guess I could also add separate renditions for #if defined(WIN32) && IVSIZE == 8 .... yuk.)

    What's the best portable way of dealing with this ? ... and where are the options for this formatting style documented ?
    I can never remember where it that documentation is, and I can never find it when I need it :-(

    Cheers,
    Rob
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2024-09-20 08:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (25 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.