• 27 Posts
  • 142 Comments
Joined 1 year ago
cake
Cake day: June 10th, 2023

help-circle


  • Thanks for sharing this. I took the time to read through the documentation of the re module. Here’s my review of the functions.

    Useful:

    • re.finditer returns an iterator over all Match objects
    • re.search returns the first Match object or None if there are no matches.
    • r'' use raw strings for patters so you don’t have to worry about backslashes
    • the optional flags argument modifies the behaviour (case insensitive, multiline)

    Utility:

    • re.sub replace each match in the string
    • re.split split a string by a regular expression

    The Match object:

    • match.groups(0) returns the portion of text matched by the pattern
    • match.groups(1) returns the first capturing group
    • match.groups(2) returns the second capturing group, and so on

    I don’t understand why these exist:

    • re.match like search, but only matches at the beginning of the string. why not just use ‘^’ or ‘\A’ in the pattern you pass to ‘search’?
    • re.fullmatch like ‘search’, but only if the full string matches. Why not just use ‘\A’ and ‘\Z’ in the pattern you pass to ‘search’?
    • re.findall Returns all matches. It seems like a shitty version of ‘finditer’. The function has three different return types which depend on the pattern you pattern you pass to the function. Who wants to work with that?


  • alyth@lemmy.worldtolinuxmemes@lemmy.worldLOL
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    4 months ago

    or traditional Fedora, which also has often unstable packages, dnf is often unusable

    My experience with dnf is that it’s slow as molasses but your average computer user isn’t gonna install 10 new CLI apps per day /j

    I’ve used Discover (dnf or flatpack backend) and you can install just about any software with 1 click. It takes a minute to install but that’s fine.










  • Wouldn’t mixing with a wide variety of ages from 18 to 118 be better?

    You will work in the NHS or the firefighters and so on, so you will certainly engage with community members of all ages and from all wakes of life. For a year of mandatory service that everybody is meant to complete, 18 is arguably the best time to do it.

    slavery

    When you walk on a public road past a hospital do you think to yourself “they stole my money to build this”? You have rights and duties as a citizen. Your service benefits the community as a whole.

    Also why is the stick to make people do it a fine (so that the rich will just pay if their kids don’t want to do it)?

    I fully agree with you on this point









  • WOW thank you! It’s super rare for anyone, let alone a stranger on the internet to care and ask. I appreciate you. You have some personality traits you come across very seldom and I hope you preserve them. I’ll just put it in spoiler tags because it’s long.

    spoiler

    So, earlier today I drew up a diagram with my age on the x-axis and happiness on the y-axis. There were three times in my life when my happiness was in the positive. The first was when I met someone at school and they seemed to like me and we became mutual best friends. Unfortunately, they cut off all contact for reasons they still don’t want to talk about, so that ended fairly quickly. The second time was when I met an online friend irl, we became best friends instantly and started dating, but because of living on two different continents we couldn’t keep it up, so that was the end of that. I have an unfulfilled desire for reciprocated best friendship or love. Humans are social animals and I think it makes sense to feel miserable when a basic need that you have is unfulfilled. I’m not suggesting that everyone feels a need for romance or a best friend, but I certainly do. I have zero friends I can turn to in this town. My next closest friend lives 160km away while the second closest is already separated by the English channel. Oh, the third time in my life I felt happy? Well I was bullied throughout my entire childhood and adolescence for my weight. When I turned 18 and left that toxic environment, I was able to reach a weight that’s considered healthy for the first time in my life. I thought this would be the end of feeling miserable and that my life would start now. That optimism lasted for about a year. Then I realized that nothing has changed and nothing I have ever done has amounted to anything worthwhile.