in reply to Re: Finding large blocks consisting of a single character (but within certain parameters...)
in thread Finding large blocks consisting of a single character (but within certain parameters...)

Are these returned offsets, the offsets within the file of the 32k blocks containing matching blocks of null byte blocks? Or the offsets of the null byte blocks within the 32k blocks? Or the offset of null byte blocks within the file?

They would be the offsets of null byte blocks within the file.

What does it return in a scalar context if the first 32k block that contains a matching, qualifying block, contains more than one?

The offset, within the file, of the first qualifying block.

And as for that subroutine...well, I can't make head or tail out of most of it. Does it need to be that long? And why is the "state" necessary?
  • Comment on Re^2: Finding large blocks consisting of a single character (but within certain parameters...)

Replies are listed 'Best First'.
Re^3: Finding large blocks consisting of a single character (but within certain parameters...)
by BrowserUk (Patriarch) on Mar 07, 2011 at 16:27 UTC
    And as for that subroutine...well, I can't make head or tail out of most of it

    Hm. Then I guess it would be easier if you detailed the bits you do understand?

    Does it need to be that long?

    It's shorter if you remove the comments. but I don't think I'll ever be able to make it as short as all those other answers you got.

    And why is the "state" necessary?

    It's not. Feel free to delete it.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Hm. Then I guess it would be easier if you detailed the bits you do understand?

      Well, I don't really know where to start...it's all confusing. And if I don't understand it, I can't customize it. (This is especially important; for one thing, in the real situation, the special character string would be followed by four bytes, the first two indicating the length of the protected area.)
        it's all confusing.

        If you cannot explain what you do not understand, then how can I explain 'it' to you?

        Do you know that this: $x is a variable? Can you guess what this does? if( $x == 1 ) { print 'hi' }

        in the real situation, the special character string would be followed by four bytes,

        Once again I ask, why do you insist on wasting my time?

        Why, when I explicitly and clearly asked you to "What you are actually searching for."; asked you to avoid say this, say that, say the other. Why do you have me expend a not inconsiderable amount of my time, solving the problem you claimed to have, only for you to then tell me that actually you lied, and your actual problem is something different?

        There is nothing in the code I posted that, with a little effort on your behalf to look things up in the extensive and detailed perl documentation, that anyone intellectually capable of being or becoming a programmer, could not understand if they choose to.

        But if you cannot, or will not, make the effort to at least describe what it is that you do not understand, then how can I possibly assist you?


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.