• 1 Post
  • 151 Comments
Joined 1 year ago
cake
Cake day: December 23rd, 2023

help-circle


  • MoonMelontolearnpythonIf statement behaving oddly
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    5 days ago

    I think some of the other responses about there being a hidden “on” default are probably right, but if I was writing this code I would skip using “None” completely. Seems you want it either on or off, considering your “print” statement instructing the user? So either exit the program after bad input and do nothing:

        case _:
            print("Please enter 'on' or 'off'")
            return
    

    or restrict this up front by not allowing invalid command line args in the first place:

    parser.add_argument("state", help="'on' to turn on the screen, 'off' to turn off",type=str, choices=['on','off'])

    Alternatively you could make on a flag, and when it is present you assume “on” and absent you assume “off”:

    parser.add_argument('--on', action='store_true')

    Another options is to logically default to “0” and always set to either on or off yourself. There is no need to use None:

    power = 0  # This always evaluates
    if args.state == 'on':
        power = 1
    mylcd.backlight(power)  # This always evaluates
    

    This will have the side effect of turning the light off if the user enters anything besides “on”, not just the word “off” but also “0”, “ON”, “coconut”, etc. This may or may not be desirable, it’s up to you.

    Just as side note if you do use None it’s idiomatic to use is when checking None for reasons discussed here.. This isn’t your problem just thought I would mention it.




  • MoonMelontoAsklemmyIs the FDA good or bad?
    link
    fedilink
    English
    arrow-up
    7
    ·
    11 days ago

    I’d like to specifically highlight the Swill Milk Scandal also.

    The New York Times reported an estimate that in one year, 8,000 infants died from swill milk. The milk from swill-fed cows, produced in dense urban areas and often priced as low as 6 cents per quart, was affordable to most of New York City’s poorest residents. Swill milk dairies were noted for their filthy conditions and overpowering stench both caused by the close confinement of hundreds (sometimes thousands) of cows in narrow stalls where, once farmers tied them, they would stay for the rest of their lives, often standing in their own manure, covered with flies and sores, and suffering from a range of virulent diseases.

    Sound familiar?

    The Tammany Hall politician Alderman Michael Tuomey, known as “Butcher Mike”, defended the distillers vigorously throughout the scandal—in fact, he was put in charge of the Board of Health investigation… Tuomey assumed a central role in the ensuing investigations and … shielded the dairies and turned the hearings into one-sided exercises designed to make dairy critics and established health authorities look ridiculous.

    Sound familiar? However people were so enraged that eventually laws passed regardless, and then finally at the federal level.

    Most people don’t know about it, but this was basically THE incident that led to the modern FDA. It keeps coming up too. Recently we’ve had the raw milk fad, but also various melamine adulteration incidents (melamine is used to fool modern protein assays, but is basically the 21st century version of swill milk). There’s also occasional “grass roots” efforts to loosen the regulation on milk labeling, ostensibly for plant based milks, but I am suspicious this is astroturfing by the dairy industry because it’s exactly what they’ve been fighting for since the Pure Food and Drug Act passed.




  • MoonMelontoGreentext@sh.itjust.worksAnon visits America
    link
    fedilink
    English
    arrow-up
    12
    ·
    edit-2
    19 days ago

    Yeah, that worker is one of two in the entire restaurant. She has to take your order plus the five behind you, the drive-thru orders, make fries, bag it all up, take your monkey, clean tables, make coffee, refill the ketchup/soda/milkshake/yogurt contraptions with their various bags of sugary goo, restock counters/tables with all the varied plastic and paper geegaws, take out the trash, stock the walk-in, clean the bathrooms somebody sprayed with liquid shit, then count out and get to her other job by 3pm so she can then do it all again tomorrow. She doesn’t give a fuck what anyone orders, it’s just a blur of colors and lower back pain.

    If she makes a face it’s probably the best she can do to fake a smile because you might be a secret shopper who is going to ding her points for not saying, “Welcome to McDonald’s Home of the McFlurry™ now with DoubleStuff™ Oreo™, what can I get started for you today because It Just Tastes Better!!℠” with the proper amount of obsequiousness.

    There’s plenty of reasons to hate the hellscape, no reason for anon to invent some.






  • There was an initial consultation, where the doctor told me that quite a few childless men want to get the procedure reversed later, but you should consider it “not reversible.” Not a problem for me.

    On the day I entered a very small room with a reclined chair. The lights were dimmed. The only pain was a brief “pinch” during anesthesia. This was “needleless” anesthesia with some kind of aerosol device, but a needle probably would have been about the same. Needles don’t bother me, so I considered this a gimmick.

    It was done a lot faster than I thought. I was chatting with the urologist the entire time. The stitches were in a different part of my scrotum than I imagined they would be (higher up). Initial recovery was fine, but a couple weeks later I did have some post-op pain that was pretty bad. NSAIDS, suprisingly, helped quite a bit. This recurred a few times a year for about five years and then never again. It was not an infection. From what I understand this is a rare side effect, but possible. For a lot of people it’s totally painless, but that was my experience.



  • MoonMelontoAsklemmyWhat are some signs your getting older?
    link
    fedilink
    English
    arrow-up
    6
    ·
    1 month ago

    School dreams are very rare now, and when I have them the “cast” is all people from various adult jobs. I never knew my actual school mates as adults, so I guess my brain just can’t fill it in. If I was actually transported back to high school and saw them again it would probably feel like being surrounded by babies, so makes sense that “central casting” sends in adult stand-ins.

    I’m always an adult too. What’s weird is I remember being a child. I remember my body being clumsy and awkward, I remember being confused by adult concepts, I remember being small. It never comes out in childhood dreams, I’m always my present age.





  • I feel no connection to anywhere, not country, not state, not city, not my ancestors, not the human race, nothing. I don’t hate that stuff, it’s just like those are places and people like any other, not special or “mine” any more than some other group or place.

    Maybe it’s because I’ve lived all over the country. Maybe it’s because I’m not particularly fond of my birth place. I’m thoroughly American as far as enculturation, language, temperament, etc as I’ve never lived anywhere else, so it’s not like I’m a “stranger in a strange land” or something intriguing. It’s just blank. Null. That organ other people seem to have making them feel “at home” just never developed when I was in the womb., nor do I feel any need to have it.

    If I had to guess who “my people” were I think I’m more akin to something like a hermit. Lockdown showed me that a lot of people are genuinely different from me in terms of the needs they have. Even now that I’ve finally managed to acquire somewhat of a “hermitage” for myself I feel like its temporary steward rather than a place I “belong”. When I describe this to people they consider it sad, but I am quite happy.

    I did, after false starts, manage to find a partner that feels the same way, so I’m not “alone” or lonely. Her family was actively abusive and cutting ties was an excruciating process that left scars. Nothing like that ever happened to me. I still speak to my family, just not frequently. Again, not totally sure why. Perhaps whatever I have is genetic.