Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Stats for super search look buggy

by jdporter (Paladin)
on May 08, 2021 at 20:37 UTC ( [id://11132283]=note: print w/replies, xml ) Need Help??


in reply to Re: Stats for super search look buggy
in thread Stats for super search look buggy

Great. Now I feel even worse about that. :-(

  • Comment on Re^2: Stats for super search look buggy

Replies are listed 'Best First'.
Re^3: Stats for super search look buggy
by pryrt (Abbot) on May 08, 2021 at 22:54 UTC
    Well, the percentage calculator could be presumably changed to something like
    use constant jump => 9866219; my $delta = $last_node_in_search_range - $first_node_in_search_range; $delta -= jump if $delta > jump; my $percent = 100 * $delta / ($most_recent_node_id - jump);

      Right, but I don't think that the delta merely being larger than the gap is a sufficient test; we should check whether the search actually spans the gap:

      $delta -= jump if $first_node_in_search_range <= 1233781 && $last_node_in_search_range >= 11100000;
        Diminishing the bigger a ° value by the gap-distance, if it exceeds the threshold, is sufficient.

        $bigger_node_in_search_range -= $jump if $bigger_node_in_search_range > 1233781;

        for ($node_min, $node_max) { $_ -= $jump if $_ > 1233781; }

        Calculate percentage then

        update

        °) sorry, both could have jumped.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

        Good point. As of today, I don't see a way that the delta would be over 9 million if it wasn't crossing the gap without another 9million posts or another gap, but might as well future-proof it ... and just because I don't see something doesn't mean it doesn't exist.

        My reply was a rather off-the-cuff, first-level approximation of how I thought I might solve it, rather than a fully fleshed-out solution, with implications and edge cases considered. Also, I also realized that my reply could have come across as "why haven't you come up with this", which isn't what I intended; rather, I meant something more like "but at least the fix shouldn't be too difficult to come up with (famous last words), something like /this/".

      I've already identified the code in question, but it's a little more complicated.

      Furthermore there is also the "remaining" part, and the search could go backwards.

      Interested pmdevs can submit patches here

      511: . qq[ (searched ] . sprintf( "%.2f", 512: 100*( abs($n0-$start)+1 ) / $lastNode 513: ) . qq[% of DB).</div><br />\n<div class="ss-criteri +a-summary">\n];

      and

      569: } else { 570: my( $min, $max )= $oldFirst ? ( $n0, $lastNode ) : ( + 1, $n0 ); 571: my $pct= sprintf "%.2f%%", 100*($max-$min+1)/$lastNo +de; 572: if( 1 == $doSearch ) { 573: $html .= qq[Press ] 574: . $q->submit( "nx", "Next >" ) 575: . qq[ to <b>continue</b> searching remaining $ +pct of DB.]; 576: } else {

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

Re^3: Stats for super search look buggy
by LanX (Saint) on May 08, 2021 at 20:54 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11132283]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2024-04-18 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found