102 times
Why 102? Isn't it 0-100?
He already said it once
But that was before she set the requirement. I assume she meant from then on, and not since the beginning of time.
If they have eggs, get a dozen.
Wow that went over my head haha
- Using Java
You should always check https://xkcd.com/1205/ first to see if it makes sense to automate something
Let's say it takes half a second to copy/paste and submit the message. That's 50 seconds saved, round it to one minute. You're only doing it once, so let's cross over to yearly. According to the Munroe Automation Scale, you can spend up to 5 minutes on it.
I'd say that code took about 1 minute to write. Maybe 2.
Result: do the automation.
Caveat: This is all written assuming the message is being written on a computer with a real keyboard. But if we're assuming this is written on a phone, then my analysis doesn't apply, but then again, writing a java program to execute in your messaging app is also a terrible idea. Which means we're suspending disbelief, so I choose to believe that a computer keyboard and shortcuts are available.
Type the phrase once. Select all. copy, paste, paste (the first paste replaces what you already have highlighted, the second paste adds a second copy). Now you have 2. Control + A, Control + C, Control + V.. Now you have 4.
It will take you only 7 cycles of this get 128*, you only need to copy/paste it one by one if you want to send each message separately. and even then, it's would purely be copy the original, then paste, send, paste, send, paste send, paste, send.
Assuming you can hold down control and just hit ACVV 7 times, that's 28 keystrokes. I'd bet I can get that done in 5 seconds or less (i tried it, it's less than that), so now I only save 5 seconds. Which means I only get 25 seconds to write the script. Which he chose to write in java for some reason?
[print("I'm sorry") for x in range(0, 100)]
is actually a script I could write in less than 25 seconds.
*And I disagree with the "reason 4" given. She didn't say "exactly 100 times" she said "100 times before I forgive you" and to me, "before" implies >=
and not ==
. So if you drop it in 128 times, that exceeds the criteria. No one has ever rescinded forgiveness for receiving extra apologies.
I miss /r/theydidthemath
He must have to apologize to her a lot.
Reason 5: she doesn't exist and you're bad at cropping
I'll do you one better
function* sorry() { yield "I'm sorry"; }
Call sorry.next().value as many times as you need to baby, hell you can even use it in a for-of loop because Generator functions are Iterable. I fucking love JavaScript
lol that doesn't work either tho. it yields the string once and then is done. you still need a loop inside
You're right! That's actually a really cool point about Generator functions too, them having while(true) loops is very unproblematic :D
I'm correcting myself to:
function* sorry() { while(true){ yield "I'm sorry"; } }
Twitter PR review
Programmer Humor
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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics