• Re: Comparing algorithm costs

    From Don Y@3:633/10 to All on Thursday, June 04, 2026 13:25:54
    On 6/4/2026 10:52 AM, Niocl s P˘l Caile n de Ghloucester wrote:
    Don Y <blockedofcourse@foo.invalid> wrote: |-----------------------------------------------------------------------| |"[I knew of a piece of code that read a byte at a time from a | |file and incremented a counter after each successful read -- to | |determine the size of the file. Clearly a naive approach and | |terribly inefficient. But, the result was always accurate, | |even if costly to compute!]" | |-----------------------------------------------------------------------|

    Websites often allow users to upload a file but such websites often
    impose a size limit.

    Today I used an imperfect website which is oriented for Gaelic
    purposes to upload a file. This website had not warned that it imposes
    a size limit. I attempted to upload that 122-megabyte file: HTTP://Gloucester.Insomnia247.NL/drochdhliodoiri/mu/Eirinn/Mary_O_Malley_Costello/2026-03-18a_Judge_Mary_O_Malley_Costello_rudely_left_whilst_I_spake_to_her__2026_03_18_12_27_41OnlineConverter_com.m4a

    "Le fichier charg‚ d‚passe la taille de fichier maximale autoris‚e."
    said HTTPS://eComplaint.WorkplaceRelations.Ie/ga-IE/complaint-equal-status/?stepid=b8f96d59-49a6-ed11-aad1-000d3a4bb61c&sessionid=affeb351-7441-4611-b1ea-36ad8712a9a6
    today AFTER I have uploaded much of that file! In other words, this
    website inefficiently did not bother to check in advance whether or
    not that file is small enough before it dared to emit an error message
    in French instead of Gaelic!

    Can the web app "stat(2)" the file? (I have no idea what the capabilities
    of client-side apps esp considering sandboxing issues) I.e., is it even possible for it to know the size of the file before "collecting" it?

    |-----------------------------------------------------------------------| |"Because, if I had built a discrete device to close the garage door |
    |at sundown, I would never think of giving it access to the thermostat!"| |-----------------------------------------------------------------------|

    You are thinking of it right now!!! :)

    No, I'm thinking of NOT giving it access -- a very different issue!


    --- PyGate Linux v1.5.15
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Don Y@3:633/10 to All on Thursday, June 04, 2026 14:02:57
    On 6/4/2026 1:41 PM, Niocl s P˘l Caile n de Ghloucester wrote:
    |------------------------------------------------------------------------| |"(I have no idea what the capabilities | |of client-side apps esp considering sandboxing issues) I.e., is it even| |possible for it to know the size of the file before "collecting" it?" | |------------------------------------------------------------------------|

    Yes. This web app is not written to bother to check, whereas different
    web apps do check sizes so they refuse to even begin to upload big
    files.
    Clearly, a mismatch between what the developer THOUGHT the user would
    be doing and what the user *might* do. No surprise, there.

    This is why it's important to have specifications/"contracts"
    so stakeholders can determine the suitability of an implementation
    for a particular envisioned use.

    --- PyGate Linux v1.5.15
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Jan Panteltje@3:633/10 to All on Friday, June 05, 2026 08:07:53
    =?UTF-8?Q?Niocl=C3=A1s_P=C3=B3l_Caile=C3=A1n?= de Ghloucester <thanks-to@Taf.com>wrote:
    Don Y <blockedofcourse@foo.invalid> wrote: >|-----------------------------------------------------------------------| >|"[I knew of a piece of code that read a byte at a time from a | >|file and incremented a counter after each successful read -- to | >|determine the size of the file. Clearly a naive approach and | >|terribly inefficient. But, the result was always accurate, | >|even if costly to compute!]" | >|-----------------------------------------------------------------------|

    Websites often allow users to upload a file but such websites often
    impose a size limit.

    Today I used an imperfect website which is oriented for Gaelic
    purposes to upload a file. This website had not warned that it imposes
    a size limit. I attempted to upload that 122-megabyte file: >HTTP://Gloucester.Insomnia247.NL/drochdhliodoiri/mu/Eirinn/Mary_O_Malley_Costello/2026-03-18a_Judge_Mary_O_Malley_Costello_rudely
    _left_whilst_I_spake_to_her__2026_03_18_12_27_41OnlineConverter_com.m4a

    "Le fichier charg‚ d‚passe la taille de fichier maximale autoris‚e."
    said >HTTPS://eComplaint.WorkplaceRelations.Ie/ga-IE/complaint-equal-status/?stepid=b8f96d59-49a6-ed11-aad1-000d3a4bb61c&sessionid=affe
    b351-7441-4611-b1ea-36ad8712a9a6
    today AFTER I have uploaded much of that file! In other words, this
    website inefficiently did not bother to check in advance whether or
    not that file is small enough before it dared to emit an error message
    in French instead of Gaelic!

    Don Y <blockedofcourse@foo.invalid> wrote: >|-----------------------------------------------------------------------| >|"Because, if I had built a discrete device to close the garage door |
    |at sundown, I would never think of giving it access to the thermostat!"| >|-----------------------------------------------------------------------|

    You are thinking of it right now!!! :)
    (S. HTTP://Gloucester.Insomnia247.NL/ fuer Kontaktdaten!)

    I once used a website hosting company that would re-encode large gifs for my website to a lower resolution to save space.
    I remember posting a big circuit diagram that was clear here, but came out fuzzy on the website.
    People complained, downloaded it back from my website, indeed fuzzy.
    Had a little talk about that with them, they then stopped doing that.
    Have a different hosting company now, seems to work OK.


    --- PyGate Linux v1.5.15
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)