this post was submitted on 11 May 2025
680 points (97.6% liked)

Programmer Humor

23172 readers
1303 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
top 50 comments
sorted by: hot top controversial new old
[–] JamonBear@sh.itjust.works 6 points 1 hour ago

You want real infinite storage space? Here you go: https://github.com/philipl/pifs

[–] kryptonianCodeMonkey@lemmy.world 17 points 3 hours ago (3 children)

I had a manager once tell me during a casual conversation with complete sincerity that one day with advancements in compression algorithms we could get any file down to a single bit. I really didn't know what to say to that level of absurdity. I just nodded.

[–] calcopiritus@lemmy.world 1 points 10 minutes ago

Just make a file system that maps each file name to 2 files. The 0 file and the 1 file.

Now with just a filename and 1 bit, you can have any file! The file is just 1 bit. It's the filesystems that needs more than that.

[–] bluemellophone@lemmy.world 6 points 3 hours ago

That’s precisely when you bet on it.

[–] WorldsDumbestMan@lemmy.today 1 points 1 hour ago

Let me guess, over 30 years old.

[–] bstix 13 points 7 hours ago (1 children)

It's like that chip tune webpage where the entire track is encoded in the url.

[–] LemmyFeed@lemmy.dbzer0.com 8 points 5 hours ago (2 children)
[–] skisnow@lemmy.ca 5 points 3 hours ago

Are you trying to get rickrolled?

[–] MTK@lemmy.world 127 points 18 hours ago (1 children)

If you have a tub full of water and a take a sip, you still have a tub full of water. Therefore only drink in small sips and you will have infinite water.

Water shortage is a scam.

[–] Aux@feddit.uk 14 points 15 hours ago (2 children)

There is a water shortage?

[–] MTK@lemmy.world 19 points 15 hours ago
[–] Feyter@programming.dev 5 points 13 hours ago (1 children)

Out of context, but this video showing the amount of freshwater on the planet in perspective was eye opening for me... I see water availability different since.

https://youtu.be/b3_Abb2Vqnc

[–] rickyrigatoni@lemm.ee 4 points 8 hours ago

Don't worry, global warming is desalinating the water so it will all be fresh in time 🙏

[–] Little8Lost@lemmy.world 33 points 15 hours ago* (last edited 15 hours ago) (3 children)

Stupid BUT: making the font in LibreOffice bigger saves space. so having 11 is readible but by changing the font size to like 500 it can save some mb per page
I dont know how it works, i just noticed it at some point

Edit: i think it was kb, not mb

[–] Jankatarch@lemmy.world 5 points 3 hours ago

Have a macro that decreases all font size on opening and then increases all again before closing.

Follow me irl for more compression techniques.

[–] SkaveRat@discuss.tchncs.de 13 points 6 hours ago

per page

I mean, yes. obviously.

If you had 1000 bytes of text on 1 page before, you now have 1byte per page on 1000 pages afterwards

[–] InFerNo@lemmy.ml 5 points 7 hours ago

You could always diff the XML before and after to see what's causing it.

[–] iknowitwheniseeit@lemmynsfw.com 37 points 17 hours ago (4 children)
[–] skisnow@lemmy.ca 1 points 3 hours ago

I was sort of on Mike Goldman (the challenge giver)'s side until I saw the great point made at the end that the entire challenge was akin to a bar room bet; Goldman had always set it up as a kind of scam from the start and was clearly more than happy to take $100 from anyone who fell for it, and so should have taken responsibility when someone managed to meet the wording of his challenge.

[–] ulterno@programming.dev 3 points 9 hours ago

Nice stuff.

I got sold on the :

EOF does not consume less space than "5"

because, even though the space taken by the filesystem is the fault of the filesystem, one needs to consider the minimum information requirements of stating starts and ends of files, specially when stuff is split into multiple files.

I would have actually considered the file size information as part of the file size instead (for both the input and the output) because, for a binary file, which can include a string of bits which might match an EOF, causing a falsely ended file, would be a problem. And as such, the contestant didn't go checking for character == EOF, but used the function that truly tells whether the end of file is reached, which would, then be using the file system's file size information.

Since the input file was a 3145728 bytes and the output files would have been smaller than that, I would go with 22 bits to store the file size information. This would be in favour of the contestant as:

  1. That would be the minimum (hyh) number of bits required to store the file size, making it as easy as possible for the contestant to make more files
  2. You could actually go with 2 bits, if you predefine MiB to be the unit, but that would make it harder for the contestant, because they will be unable to present file sizes less than 1 MiB, and would have to increase the file size information bits

On the other hand, had the contestant decided to break the file between bits (instead at byte ends), instead of bytes (which, from the code, I think they didn't) the file size information would require an additional 3 bits.


Now, using this logic, if I check the result:

From the result claimed by the contestant, there were 44 extra bytes (352 bits) remaining.

+ 22 bits for the input file size information - 22*219 bits for the output file size information because 219 files

so the contestant succeeds by 352 + 22 − (22 × 219) = −4444 bits. In other words, fails by 4444 bits.

Now of course, the output file size information might be representable in a smaller number of bits, but to calculate that, I would require downloading the file (which I am not in the mood for.
And in that case, you would require additional information to tell the file size bits. So;

  • 5 bits for the number 22 in the input
  • 5 bits for the size of the file size information (I am feeling this won't give significant gains) and rest of the bits as stated in the first 5 bits, as the file size bits
    • you waste bits for every file size requiring more than 16 bits to store the file size information
    • it is possible to get a net gain with this, as qalc says, log(3145728 / 219, 2) = (ln(1048576) − ln(73)) / ln(2) ≈ 13.81017544

But even then, you have 352 + 5 + 22 − (5 + (14 × 219)) = −2692 for the best case scenario in which all output file sizes manage to be under 14 bits of file size informations. More realistically, it would be something around 352 + 5 + 22 − ((5 + 14) × 219) = −3782 because you will the the 5 bits for every file, separately, with the 14 in this case, be a changing value for every file, giving a possibly smaller number.


If instead going with the naive 8 bit EOF that the offerer desired, well, going with 2 consecutive characters instead of a single one, seems doable. As long as you are able to find enough of said 2 characters.
After going on a little google search, I seem to think that in a 3MiB file, there would be either 47 or 383 (depending upon which of my formulae was correct) possible occurrences of the same 2 character combination. Well, you'd need to find the correct combination.

But of course, that's not exactly compression for a binary file, as I said before, as an EOF is not good enough.

[–] QuazarOmega@lemy.lol 4 points 13 hours ago

This was too damn funny for what I expected it to be

[–] 4grams@awful.systems 6 points 15 hours ago

That story is immediately what came to mind.

[–] Thorry84@feddit.nl 69 points 19 hours ago (1 children)

It's all fun and games until your computer turns into a black hole because there is too much information in too little of a volume.

[–] proti@lemmy.world 31 points 18 hours ago (2 children)

Even better! According to no hiding theorem, you can't destroy information. With black holes you maybe possibly could be able to recover the data as it leaks through the Hawking radiation.
Perfect for long term storage

[–] Klear@lemmy.world 24 points 15 hours ago (1 children)

Can't wait to hear news about a major site leaking user passwords through hawking radiation.

i love this comment

[–] mmddmm@lemm.ee 8 points 14 hours ago (1 children)

Really-long term storage :)

[–] limerod@reddthat.com 1 points 3 hours ago (1 children)

Longer than your lifespan, too.

[–] mmddmm@lemm.ee 1 points 3 hours ago

Longer than the life span of the most long-lived star. By orders of magnitude.

[–] wizzim@infosec.pub 105 points 22 hours ago* (last edited 22 hours ago) (2 children)

Awesome idea. In base 64 to deal with all the funky characters.

It will be really nice to browse this filesystem...

[–] Aurenkin@sh.itjust.works 81 points 22 hours ago

The design is very human

[–] lemon@sh.itjust.works 85 points 22 hours ago (3 children)

Broke: file names have a max character length.

Woke: split b64-encoded data into numbered parts and add .part-1..n suffix to each file name.

[–] psud@aussie.zone 2 points 7 hours ago* (last edited 7 hours ago)

Browse your own machine as if it's under alt.film.binaries but more so

[–] mmddmm@lemm.ee 8 points 14 hours ago

I'd go with a prefix, so it's ls-friendly.

[–] tetris11@lemmy.ml 14 points 19 hours ago

each file is minimum 4kb

(base64.length/max_character) * min_filesize < actual_file_size

For this to pay off

[–] Typewar@infosec.pub 36 points 21 hours ago (4 children)

Reminds me of a project i stumbled upon the other day using various services like Google drive, Dropbox, cloudflare, discord for simultaneous remote storage. The goal was to use whatever service that has data to upload to, to store content there as a Filesystem.

I only remember discord being one of the weird ones where they would use base512 (or higher, I couldn't find the library) to encode the data. The thing with discord, is that you're limited by characters, and so the best way to store data in a compact way is to take advantage of whatever characters that are supported

[–] psud@aussie.zone 3 points 7 hours ago

GmailFS was a thing

[–] jjagaimo@sh.itjust.works 11 points 13 hours ago* (last edited 13 hours ago)

"Harder Drive"

Store the data in pings that constantly get resent to keep the data in the internet

[–] ChairmanMeow@programming.dev 28 points 18 hours ago

I remember a project where someone booted Linux off of Google Drive. Cursed on many levels.

[–] astrsk@fedia.io 38 points 21 hours ago

What about a hard drive made of network pings?

https://m.youtube.com/watch?v=JcJSW7Rprio

[–] anhkagi@jlai.lu 26 points 21 hours ago (1 children)

this is actually a joke compression algorithm that compresses your data by one byte by appending it to the filename. (and you can execute it as many time as you want)

Too bad I can't remember the name.

[–] badcommandorfilename@lemmy.world 40 points 21 hours ago (2 children)
[–] gnutrino@programming.dev 16 points 20 hours ago (3 children)

Obligatory "pi hasn't been proved to be normal"

[–] palordrolap@fedia.io 3 points 17 hours ago (1 children)

Oh, I guarantee that pi is 100% normal. Just not necessarily in the base you want it to be normal in.

[–] gnutrino@programming.dev 6 points 15 hours ago (1 children)

I don't know of a proof that pi is normal in any base (even non-integer bases) so I'd be interested to see on what basis you can guarantee it.

It's somewhere in pi. Wait a moment while I look it up.

load more comments (2 replies)
load more comments (1 replies)
load more comments
view more: next ›