#software humor
Explore tagged Tumblr posts
mentalisttraceur-humor · 2 years ago
Text
mentalisttraceur don't get mad at someone else's software before it turns out the problem is in your own software challenge (impossible difficulty)
9 notes · View notes
mentalisttraceur-software · 2 years ago
Text
Developer: I consent.
Language: I consent.
Isn't there somebody you forgot to ask? [Every other developer who has to read this code after you.]
10 notes · View notes
Text
Thousands of replies and no one has properly helped OP!
First, since Python won't let us have an if-elif chain that's as long as we need in the source itself, we need a way to generate it. Generators are perfect for this, and very Pythonic:
def _is_even_branches():     yield 'if a == 0: return True'     number = 1     while True:         yield f'elif a == {number}: return False'         number += 1         yield f'elif a == {number}: return True'         number += 1
That generator never finishes, which is good design because it lets the calling code control how high to generate.
Next, we're going to need a better Python - but we can optimize by just implementing the subset of Python that we need: it only needs to interpret lines in the form `(if|elif) a == <integer>: return (True|False)`:
def _is_even_evaluator(lines, a_value):     for line in lines:         condition, body = line.split(": ")         if_or_elif, a_name, equals, number = condition.split()         assert if_or_elif in ('if', 'elif')         assert a_name == 'a'         assert equals == '=='         # `int` raises ValueError if it can't parse         if int(number, base=10) == a_value:             return_, result = body.split()             assert return_ == 'return'             assert result in ('False', 'True')             return eval(result)             # The above `eval` is safe             # so long as you don't turn on             # Python's optimization option             # (which skips all asserts).
And now, finally:
def is_even(number):     if number < 0:         number = -number     return _is_even_evaluator(_is_even_branches(), number)
So python is apparently unable to handle if-statement with more than 2996 elif’s, which is fair, however, it’s really limiting my implentation of an is_even function
Tumblr media
Any ideas on how I can work around this?
5K notes · View notes
a-person-probably · 3 months ago
Text
April 4th
AKA 4/04
AKA "Date not found"
0 notes
retrogamingblog2 · 6 months ago
Text
Tumblr media
2K notes · View notes
computer-nerd-girl · 11 months ago
Text
Tumblr media
479 notes · View notes
mentalisttraceur-software · 3 months ago
Text
Also software development.
Tumblr media
1K notes · View notes
nixcraft · 8 months ago
Text
Tumblr media
305 notes · View notes
oldschoolfrp · 7 months ago
Text
Tumblr media
"Why armor class is important" -- Wizardry: Proving Grounds of the Mad Overlord for the Apple II took a lot of inspiration from D&D. The armor class scale begins at 10 and descends for improved armor, as used in OD&D through AD&D 2e, before D&D 3e finally changed to ascending AC numbers. (Will McLean comic panel from the game manual, Sir-Tech Software, 1981)
185 notes · View notes
punstars · 2 years ago
Text
Tumblr media
1K notes · View notes
mrbreaknfix · 2 months ago
Text
Tumblr media
Other people follow rules. I follow results
98 notes · View notes
secondwheel · 3 months ago
Text
Tumblr media
Experiments in science
146 notes · View notes
mentalisttraceur-software · 2 years ago
Text
Expectation: "chooses the number of threads automatically using heuristics"
Reality: `self.threads = 2`
5 notes · View notes
edmundtheartist · 4 months ago
Text
This should have been an option.
Tumblr media
69 notes · View notes
aeolianblues · 7 days ago
Text
I don't like that the dev community picks on people who are most fluent in Python, when the ChatGPT-using "vibe coders" are right there. At least Python babies are coding. Bully the non-coders instead.
48 notes · View notes
jnc687-blog · 3 days ago
Text
Tumblr media
You know how those r/iamverysmart people all sound like a high schooler with a thesaurus? Well, with this program I wrote, you can type in any sentence and sound like that kid! It uses the Natural Language Toolkit (NLTK) to finds all the synonyms for every word in the sentence, and then it prints the longest one. The example sentence I used is
"I am writing my blog post about something I wrote and I hope you enjoy it"
and the output is........drumroll please.......
"atomic number 53 amplitude modulation committal to writing my web log Charles William Post approximately something atomic number 53 drop a line and atomic number 53 Leslie Townes Hope you delight information technology"
20 notes · View notes