@0x4E4F@infosec.pub to Programmer Humor@programming.devEnglish • 7 months agoNot my problem sortinfosec.pubimagemessage-square70arrow-up1772
arrow-up1772imageNot my problem sortinfosec.pub@0x4E4F@infosec.pub to Programmer Humor@programming.devEnglish • 7 months agomessage-square70
minus-square@BatmanAoD@programming.devlinkfedilink151•7 months agoReminds me of quantum-bogosort: randomize the list; check if it is sorted. If it is, you’re done; otherwise, destroy this universe.
minus-square@xmunk@sh.itjust.workslinkfedilink97•7 months agoGuaranteed to sort the list in nearly instantaneous time and with absolutely no downsides that are capable of objecting.
minus-square@frezik@midwest.sociallinkfedilink48•7 months agoYou still have to check that it’s sorted, which is O(n). We’ll also assume that destroying the universe takes constant time.
minus-square@BatmanAoD@programming.devlinkfedilink44•7 months agoIn the universe where the list is sorted, it doesn’t actually matter how long the destruction takes!
minus-square@groet@feddit.orglinkfedilinkEnglish13•7 months agoIt actually takes a few trillion years but its fine because we just stop considering the “failed” universes because they will be gone soon™ anyway.
minus-squareYonderEpochslinkfedilink9•7 months ago We’ll also assume that destroying the universe takes constant time. Well yeah just delete the pointer to it!
minus-square@vithigar@lemmy.calinkfedilink16•7 months agoExcept you missed a bug in the “check if it’s sorted” code and it ends up destroying every universe.
minus-square@db2@lemmy.worldlinkfedilink7•7 months agoThere’s a bug in it now, that’s why we’re still here.
minus-square@Zaphod@discuss.tchncs.delinkfedilink25•7 months ago The creation and destruction of universes is left as an exercise to the reader
minus-square@BatmanAoD@programming.devlinkfedilink5•7 months agoCreation is easy, assuming the many-worlds interpretation of quantum mechanics!
minus-squareNaNlinkfedilink17•7 months agoInstead of destroying the universe, can we destroy prior, failed shuffle/check iterations to retain o(1)? Then we wouldn’t have to reload all of creation into RAM.
minus-square@BatmanAoD@programming.devlinkfedilink6•7 months agoDelete prior iterations of the loop in the same timeline? I’m not sure there’s anything in quantum mechanics to permit that…
minus-square@jcg@halubilo.sociallinkfedilink29•edit-27 months agois-sorted and a handful of about 300 other npm packages
minus-square@Swedneck@discuss.tchncs.delinkfedilink8•7 months agothat explains why it took god 7 days to make the universe
minus-square@onlinepersona@programming.devlinkfedilink2•edit-27 months agoWe still suffer from the runtime errors that could’ve been caught at compilation time. Anti Commercial-AI license
minus-square@frezik@midwest.sociallinkfedilink2•7 months agoSince randomizing the list increases entropy, it could theoretically make your cpu cooler just before it destroys the universe.
Reminds me of quantum-bogosort: randomize the list; check if it is sorted. If it is, you’re done; otherwise, destroy this universe.
Guaranteed to sort the list in nearly instantaneous time and with absolutely no downsides that are capable of objecting.
You still have to check that it’s sorted, which is O(n).
We’ll also assume that destroying the universe takes constant time.
In the universe where the list is sorted, it doesn’t actually matter how long the destruction takes!
It actually takes a few trillion years but its fine because we just stop considering the “failed” universes because they will be gone soon™ anyway.
Eh, trillion is a constant
amortized O(0)
Well yeah just delete the pointer to it!
universe.take()
Except you missed a bug in the “check if it’s sorted” code and it ends up destroying every universe.
There’s a bug in it now, that’s why we’re still here.
deleted by creator
Creation is easy, assuming the many-worlds interpretation of quantum mechanics!
Instead of destroying the universe, can we destroy prior, failed shuffle/check iterations to retain o(1)? Then we wouldn’t have to reload all of creation into RAM.
Delete prior iterations of the loop in the same timeline? I’m not sure there’s anything in quantum mechanics to permit that…
What library are you using for that?
is-sorted and a handful of about 300 other npm packages
that explains why it took god 7 days to make the universe
We still suffer from the runtime errors that could’ve been caught at compilation time.
Anti Commercial-AI license
In Python you just use
import destroy_universe
Since randomizing the list increases entropy, it could theoretically make your cpu cooler just before it destroys the universe.