The tenacity library comes with an intriguing mix of iterators and context managers to allow the users to retry blocks with this syntax:
from tenacity import Retrying, stop_after_attempt
for attempt in Retrying(stop=stop_after_attempt(3)):
with attempt:
1 / 0
You can use the same mechanism yourself, by creating and linking a custom context manager and iterator:
class YouAndIhaveUnfinishedBusiness:
def __init__(self, notify_success, attempt_number):
self.notify_success = notify_success
self.attempt = attempt_number
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
if exc_value:
print(f"You have disappointed me {self.attempt} time(s).")
else:
self.notify_success()
return True
class DoOrDoNotThereIsNoTry:
def __init__(self, max_attempts):
self.max_attempts = max_attempts
self.success = False
def __iter__(self):
for i in range(self.max_attempts):
yield YouAndIhaveUnfinishedBusiness(self.succeed, i+1)
if self.success:
print("You are ready for the Kumite.")
break
else:
print("We trained him wrong on purpose, as a joke.")
def succeed(self):
self.success = True
Credit cards actually don't need electricity or the network to be up. That was kind of the original point. The business that you're paying trusts the card issuer to pay them on your behalf, so they can communicate the payment details to the bank asynchronously, and after supplying the paid for goods or services.
But the rest of your point stands. Cash grants a lot more flexibility.
Everyone has good ideas, hell, I just had 3 good ideas this morning, the point is the intentions of political ideas, and he's intentions are purely for gathering populist support and votes from those doing tax fraud (a large sizable percentage in Austria) as going cashless was never an option in Austria anyway so it was a non-issue to begin with, a nothing burger if you will.
In which country do you live where going cashless is a bigger concern for the population than healthcare, housing, education, cost of living and the rest, because I'd like to live there?
What's with these strawmen arguments? How will cash prevent a dictatorship?
And all cash users don't just keep their all cash under their mattress to be eaten away by rats and inflation, but still use banks and assets to hold their money and use ATMs to get cash as needed, so the government can still lock your banc account leaving you penniless regardless if you used to pay by cash at the supermarket or by card.
But having your entire population tracked when they pay and a way to shut down the money of anything because it has no cash fallback helps a lot setting one up.
How so? Look at modern dictatorships, or ones masquerading as democracies (Venezuela, North Korea, Russia, Iran, Turkey, Cuba, etc). They all use and allow cash. How did sticking to cash help them prevent their situation?
You can't function in a moderns western country without a bank account anyway: rent, salary, utilities, all are fully wired now (I can't go pay my utilities at the counter in cash or get my salary in cash), so even if you buy your groceries and weed with cash, the government can just lock your bank accounts making you broke overnight, and unless you got close friends and family to shelter you indefinitely, you're a few weeks/months away from homelessness deepening on how much you got saved under the mattress.
If the government wants to track you, they'll do it whether you use cash or not. Just look how effective the KGB and Stasi were at tracking people when cashless payments weren't even invented yet.
Your clutching at straws at this point trying to prove that cash plays such a big parts in preventing authoritarian regimes.
What helps prevent authoritarian regimes is a separation of powers in government and an accountable political class. The nordic countries have more or less given up cash, yet I doubt they're at the risk of political authoritarianism and have the lowest corruption index in the world. If you feel like your country is at the risk of becoming an dictatorship, maybe focus more on how you can become more like the nordics instead of sticking to cash.
there's always bigger fish to fry and therefore we cannot talk about the smaller ones?
but srsly, "cashless" used to be a FPÖ (the far right party in Austria) topic, now the conservatives have finally picked up on it. I don't like either of their agendas and nobody seriously suggested going cashless in Austria.
However, I'm also not a fan of being forced to use a private company just to pay for my basic necessities. And it seems plausible to me that after a certain decline of cash usage and the corresponding decline in infrastructure, there will be a tipping point when handling cash becomes so expensive that it will be shut down for cost reasons.
A good question to ask imo is:
Is it possible to hold a view that's not held by my political ingroup?
>there's always bigger fish to fry and therefore we cannot talk about the smaller ones?
Why not focus on the bigger fish that actually impact everyone? If I'm bleeding from my severed artery, I'm gonna care about that more than my chipped tooth.
Politicians focusing on mediatizing bogus issues to keep voting population attention away from the real issue is the oldest trick in the book ("hey don't look at our corruption scandals and the rising CoL, look at how we're gonna defend your use of cash").
>However, I'm also not a fan of being forced to use a private company just to pay for my basic necessities.
What about your bank? Necessities are more than just paying for groceries at the supermarket by cash, you know.
All your other actual necessities like salary, tax-returns, insurances, utilities and sometimes rent are deducted automatically via direct debit from you bank account, not via cash-in0hand trasnations. You can't live cash-only without a bank as an intermediate anyway.
>handling cash becomes so expensive that it will be shut down for cost reasons.
But handling cash the right way (counting it, accounting it, carrying and storing it securely, etc) already IS more expensive that contactless transaction fees, but cash-only businesses offset that by doing tax-fraud, and as an honest tax-payer I want tax-fraud to end. Getting rid of cash completely is just a bonus and a means to ending tax-fraud. Tax fraud is a bigger issue in Austria.
This strikes me as incredibly unlikely from an evolutionary psychology perspective. Or even from a perspective that acknowledges the relative complexity between whatever system you are envisioning and the simple (mostly) monogamous couple.
We will never know, but maybe they receive some governmental pressure to never publish and pretend the research lead nowhere so that their country only gets the benefit.
But the rogue scientist wanted to share it with the entire world.
What kind of madman tries to deploy pytorch? If it's a product, convert the finished model to onnx. Otherwise it's probably for a dev and you can tell them to have fun because installing all the gpu libs sucks no matter what. In theory mambaforge should make most of these scenarios less painful (mostly portable faster version of anaconda), but you'll still need the right cuda runtime, rocm, etc.
What makes this stuff so hard? I could probably find a Python tutorial to render a spinning cube in like 5 minutes, but as soon as you want to do ML you spend an hour just getting libraries to work?
Is there ever going to be standardization, the way a WebGL shader just works everywhere?
The tenacity library comes with an intriguing mix of iterators and context managers to allow the users to retry blocks with this syntax:
You can use the same mechanism yourself, by creating and linking a custom context manager and iterator: