Skip to content

Instantly share code, notes, and snippets.

@chris-piekarski
Created August 26, 2023 22:22
Show Gist options
  • Save chris-piekarski/c66413053c7e26b2505840f72ddc8cc7 to your computer and use it in GitHub Desktop.
Save chris-piekarski/c66413053c7e26b2505840f72ddc8cc7 to your computer and use it in GitHub Desktop.
Apex Engineers In The Arena
import re
import random
def binary_logic_choice(options):
# Randomly choose option A or B
choice_A_or_B = random.choice(["A", "B"])
choice = options.get(choice_A_or_B, "")
# Implementing binary digital logic to decide if option C should be picked
pick_A = random.choice([True, False])
pick_B = random.choice([True, False])
if (pick_A and not pick_B) or (pick_A and pick_B):
choice = options.get("C", "")
return choice
def adapt_quote_for_value_driven_engineer(quote):
# Dictionary to replace key terms
replacements = {
"critic": {"A": "skeptic", "B": "doubter", "C": "cynic"},
"man": {"A": "apex engineer", "B": "value-driven engineer", "C": "elite technologist"},
"strong man": {"A": "leading engineer", "B": "master engineer", "C": "chief innovator"},
"doer of deeds": {"A": "provider of solutions", "B": "creator of value", "C": "innovation leader"},
"arena": {"A": "lab", "B": "industry", "C": "technological frontier"},
"face is marred by dust and sweat and blood": {
"A": "mind is filled with calculations and optimizations",
"B": "hands are skilled from prototyping and programming",
"C": "soul is imbued with resilience and ambition"
},
"strives valiantly": {"A": "innovates relentlessly", "B": "strategizes effectively", "C": "works passionately"},
"errs, who comes short again and again": {
"A": "debugs, revisits designs often",
"B": "refines, tweaks systems continuously",
"C": "iterates, learns constantly"
},
"effort without error and shortcoming": {
"A": "value without continuous improvement",
"B": "innovation without setbacks",
"C": "growth without challenge"
},
"do the deeds": {"A": "deliver the value", "B": "realize the projects", "C": "make the breakthroughs"},
"knows great enthusiasms, the great devotions": {
"A": "has a passion for excellence",
"B": "a commitment to quality",
"C": "an obsession with performance"
},
"spends himself in a worthy cause": {
"A": "invests himself in high-impact projects",
"B": "commits himself to value-driven goals",
"C": "dedicates himself to game-changing initiatives"
},
"triumph of high achievement": {
"A": "milestone of exceptional value",
"B": "peak of unparalleled solutions",
"C": "zenith of groundbreaking impact"
},
"fails while daring greatly": {
"A": "fails while pushing boundaries",
"B": "falls short while aiming for the extraordinary",
"C": "stumbles while challenging the status quo"
},
"cold and timid souls who neither know victory nor defeat": {
"A": "those who avoid risks and never innovate",
"B": "those who maintain the status quo, never realizing potential",
"C": "those too cautious to step outside their comfort zones"
},
}
adapted_quote = quote
for word, replacement_options in replacements.items():
replacement = binary_logic_choice(replacement_options)
adapted_quote = re.sub(rf'\b{word}\b', replacement, adapted_quote, flags=re.IGNORECASE)
return adapted_quote
if __name__ == "__main__":
original_quote = ("It is not the critic who counts; not the man who points out how the strong man stumbles, "
"or where the doer of deeds could have done them better. The credit belongs to the man "
"who is actually in the arena, whose face is marred by dust and sweat and blood; who strives valiantly; "
"who errs, who comes short again and again, because there is no effort without error and shortcoming; "
"but who does actually strive to do the deeds; who knows great enthusiasms, the great devotions; "
"who spends himself in a worthy cause; who at the best knows in the end the triumph of high achievement, "
"and who at the worst, if he fails, at least fails while daring greatly, so that his place shall never be "
"with those cold and timid souls who neither know victory nor defeat.")
adapted_quote = adapt_quote_for_value_driven_engineer(original_quote)
print("Adapted Quote for a Value-Driven Apex Electrical Engineer:\n")
print(adapted_quote)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment