Hacker Newsnew | past | comments | ask | show | jobs | submit | more BiteCode_dev's commentslogin

Summary:

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


Really funny, but a lot of those contain more carbs than fiber, so they cannot be used every day.


Just to be shockingly pedantic -- Dietary fiber are carbs so containing more fibre than carbs is technically impossible.

Ok, but I think your point means like refined starchy foods, and not fibrous vegetables and grains?


Indeed.

Just like when people say "sugar", they usually mean the white stuff, or fructose syrup, not carbs in general nor fructose in fruits.


It helps with accessibility, not with the problem that cashless is dangerous for democracy.

Everytime you pay anything with something else than cash, it is recorded: the amount, the time, the place, and the nature of the thing you buy.

There is no way to go to a gay bar (or another place loaded with consequences) without a trace. And this is needed for human dignity.

There is way to support a controversial political movement without a trace. And this is necessary for new idea to come up.

There is not way for kids to do dumb things without a trace. And this is necessary for growing.

There is no way to pay for something when electricity or network goes down. And this is necessary to deal with crisis.

Basically, cash buys humanity margin of maneuver, and a fallback against any decaying societal or technical system.


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.


That hasn't been true for years.

CC processing today 100% requires power and network.


I don't know of any business in my country that has the manual machine anymore.

But even if it did, how would visa process the recipe without power ? Their money is all bits.

Cash is cash, even when there is no accounting.


> There is no way to go to a gay bar (or another place loaded with consequences) without a trace. And this is needed for human dignity.

We should remember that this is also true about phones.


You can leave your phone at home and go to a bar no problem. If you can't pay for drinks, that's a problem.


Op has a point since one phone is enough to ruin the privacy of a place. It doesn't need to be yours to cause some trouble.


Yes but some points have priorities:

-- "Every exchange will leave a full track - where, when, what" already should raise a "you'd better be joking".

-- Failsafe fallback: a system depending on running infrastructure (electricity, internet, servers etc.) is badly conceived.


There is no way to pay for something when electricity or network goes down. And this is necessary to deal with crisis.

I've noticed that the loudest voices in favor of getting rid of cash usually seem to live in places that have few, if any, natural disasters.


> natural disasters

Infrastructure does not fail only because of natural disasters.


Indeed. Or war. Or just bad engineering.


A good idea is a good idea, even when uttered by terrible people.

If Hitler said german should eat more fruits and vegetables, that doesn't make it false.


>A good idea is a good idea

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.


Yes, but it did bring the concept to be debated to HN. I'm now thinking we should do it in my country.


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?


All those topics will go down the drain even more if you get into a dictatorship. And cashless is a fantastic tool to get it.


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.


Cash don't prevent a dictatorship.

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.


> How did sticking to cash help them prevent their situation?

The contrapositive is not true.


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.


As a Frenchmen, I think we can't say we are against government oversight. But I don't think I would agree that:

> people consider it unnecessary

In fact, I've discussed a cashless society with friends, and the majority is against, precisely because of this.

Now it may be my bubble, and not apply to the average French citizen.


> Frenchmen ... the majority is against

When did it become so hard to pay for fuel with cash in your territories?

The matter is creeping in...


This assumes having a long couple relationship is necessary for humans.

Maybe the next generations will evolved in ways that means they are very happy without the structure of the couple.

Other structures exist.


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.


Graeber's dawn of humanity have taught me humans have tried a lot of different social setups in the past for power and cooperation structures.

Many animals have evolved in different direction for educational, emotional and sexual structures.

I don't see any impossibility here.

Only the believe the future will like the present, which is obviously not true.


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.

It would make for a nice movie.


Nuitka deals pretty well with those in general: https://nuitka.net/


Until you require pytorch ;)


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?


True, I never think about the machine learning stack as something I want a stand alone executable for.


It's 5 years for free. You can have 15. You just have to pay for it.


Sure, but then you have to militate also for half of the fortune 500, most of them having bigger impacts.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: