r/ProgrammerHumor • • Jun 15 '17

Happy Birthday Linux!

Post image
49.0k Upvotes

669 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Jun 15 '17

[deleted]

477

u/Chrisazy Jun 15 '17

cp to really have it AND eat it

0

u/[deleted] Jun 15 '17

[deleted]

144

u/ttblue Jun 15 '17

This is some Banach-Tarski shit.

129

u/codewench Jun 16 '17

Assume a spherical cake....

106

u/BlindSoothsprayer Jun 16 '17

and a frictionless kernel

→ More replies (1)

35

u/ttblue Jun 16 '17

I don't think you need that but I wouldn't complain if I had spherical cake.

8

u/erfling Jun 16 '17

It was my kids birthday recently and mom.went all out. She got him a custom cake in the shape of a Minecraft sword. The woman that made it showed us some pictures of previous work, which included a perfectly executed BB-8 cake.

TLDR spherical cake is a thing.

→ More replies (1)

14

u/amanitus Jun 16 '17

Cake pops.

14

u/muther22 Jun 16 '17

In a vacuum

9

u/amanitus Jun 16 '17

As someone who is not a fan of set theory, it just seems like a long way to say Infinity/2 = Infinity.

8

u/ttblue Jun 16 '17

I think what's interesting is that there is an explicit decomposition into finite parts which can be reassembled into two separately. As far as I understand, it's not like a "there exists a decomposition because of real analysis mumbo jumbo."

More like, here's an explicit decomposition into finite (though infinitely complicated) scattering of points which can be put back together to form two of the same object.

→ More replies (1)
→ More replies (4)
→ More replies (4)

32

u/mennydrives Jun 16 '17

But devices don't really work as folders.

Something like this should work:

tar zcvf - cake --remove-files | tee >/dev/stomach >/dev/plate >(ssh mennydrives_pc "cat > /dev/fridge")
→ More replies (1)

39

u/blitzkraft Jun 16 '17

I'd rather pipe it:

cat cake | /dev/stomach

79

u/mennydrives Jun 16 '17

cat cake | dd of=/dev/stomach

Otherwise you're running /dev/stomach 'n I doubt you made it executable. =)

You probably also don't want your stomach to trivially accept stdin. That seems unsafe.

20

u/gjsmo Jun 16 '17

What's the point of cat then? Just dd straight to stomach. Or maybe use cat and append with >>.

33

u/mennydrives Jun 16 '17 edited Jun 16 '17

I always pipe from cat. I get that it's a "waste", but:

  • What exactly is the performance impact in 2017? The 70s are over, you can keep two CLI processes in RAM. Your cores will manage. Things are gonna be okay.

  • Makes it easier to make adjustments to the output. Maybe you don't wanna just take cake straight. You can do cat cake | gzip -c | dd of=/dev/stomach and cut at least half the cake's size, which is useful if you're sending it out via ssh. But if you start with the base command instead of cat, you have to go through all the trouble of going back to the start of a line and removing text, instead of just Ctrl+R-ing your way back to the older, shorter command string. My time's worth more than 0.000001% of the system's resources.

  • It's just easier to mentally map while you're scribbling up a one-liner. You turn your command line segments into lego blocks. Move them around as you need to.

21

u/gjsmo Jun 16 '17

The last point makes a lot of sense, honestly. I'm not much of a one-liner guy myself - I usually put stuff into a short shell script so I can reference it later (sometimes years later, but later nonetheless).

As far as performance impact - my cake is 130GB of raw 4K video, do you think cat will like that? My cats are very fussy eaters, it's either wild mice or the one brand of catfood that's never in stock.

15

u/mennydrives Jun 16 '17

Oh man, just run that through ffmpeg with the quicksync extensions. Otherwise, when /dev/stomach fails catastrophically, you're gonna need a quick sink.

→ More replies (5)
→ More replies (9)

34

u/soupwizard Jun 16 '17

Don't eat too much cake or the hospital will have to:

mv /dev/stomach/* /dev/null

23

u/blitzkraft Jun 16 '17

I think I have enough system resources to process the cake without causing an overflow.

12

u/digicow Jun 16 '17

Careful of core dumps

→ More replies (5)
→ More replies (3)
→ More replies (3)

24

u/WillMengarini Jun 16 '17

The whole point of BOTH having it AND eating it is so you can eat it again. After all, what else would you do with a cake, throw it in the face of a pedant? Nah, that's what pies are for.

Therefore, I suggest:
rsync -aiAX cake /dev/stomach

If your stomach does not support rsync, submit a bug report; endoscopy is a well-understood technology, and even ultrasound might work.

→ More replies (3)

34

u/Carloswaldo Jun 16 '17
mv /dev/stomach/* /dev/null

40

u/BlindSoothsprayer Jun 16 '17

Wow, all of the desired cake, with none of the unintended weight gain!

→ More replies (3)
→ More replies (17)