Hi, i’m into programming, sexual transmutation and psychedelics!

  • 22 Posts
  • 67 Comments
Joined 2 years ago
cake
Cake day: June 13th, 2023

help-circle

  • dontblink@feddit.ittoPrivacy@lemmy.ml*Permanently Deleted*
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    18 days ago

    I think people should really read books like digital minimalism by cal Newport, stolen focus, surveillance capitalism, your brain on porn ecc to understand how social medias (but the internet in general) IS DESIGNED to be addictive, and what are the addictive traits.

    Lemmy is definitely better but still holds some concepts from addictive social medias (not because of developers fault, I think they just tried mimicking popular socials, since these are born as “alternatives”). Infinite scrolling and upvotes are just two examples.

    Some frontends do a great job leaving power to the user in that, like eternity, but I think a lot more consciousness should be raised on the topic and, at least in the open source / federated community there should be some guidelines on how to design social medias just as useful tools while minimizing distractions/useless/addictive parts.

    It’s great to be decentralized, it’s great to avoid ads, profilation and targetization, but we can do better in designing really new and useful tools starting from certain principles.





  • I thought about Nix, it is indeed cool to declaratively install stuff and it would indeed be very helpful to set system settings all from one file so that you control everything there, but I don’t think that’s what I need, I think I’d need a more focused desktop environment maybe?

    Kiosk environments could be a solution, because once the UI is limited, you can install software in any way you like and from any distro really, I think the focus is to keep it minimal under the hoods and very simple on the surface!










  • Exactly! I don’t see why we have to rely on the old internet infrastructure for a completely differently conceived type of distributing content!

    There’s stuff like ipfs, and I’m sure there are many ways to make self hosting easier…

    We normalize everyone has a modem/router/access point at home: we should normalize everyone having his own server hosted, bitcoin node, ipfs node etc etc…

    And your right, these services have to be super easy to deploy… I think containerization might be helping with this… Think about docker or Nixos… Make a nice GUI and simplify docker even more and you get packages that can run on any distro in any OS, that even a complete noob could spin up! Maybe paired with repos that host most of the self hostable stuff.

    But yeah I think the whole structure might be have to be rethought, from the way we host to the way we can connect to each other… We got to give everyone the possibility to decide which web they want to be part of, and federation definitely allows this!












  • Hi! First of all thank you so much for the detailed explanation!

    What I’m trying to do is scraping some content.

    Yes I’m trying to return all links (maybe in a vector), I have a list of elements (Select, which actually is scraper::html::Select<'_, '_>) which contain essentially html nodes selections, and I would like to grab each of them, extract the actual link value (&str), convert it into an actual String and push it firstly into a vector containing all the links and then in an istance of a struct which will contain several datas about the scraped page later.

    I was trying to use a for loop because that was the first structure that came to my mind, I’m finding it hard to wrap my head around ownership and error handling with rust, using the if let construct can be a good idea, and I didn’t consider the use of break!

    I also managed to build the “match version” of what I was trying to achieve:

    fn get_links(link_nodes: scraper::html::Select<'_, '_>) -> Vec<String> {
            let mut links = vec![];
    
            for node in link_nodes {
                match node.value().attr("href") {
                    Some(link) => {
                        links.push(link.to_string());
                    }
                    None => (),
                }
            }
    
            dbg!(&links);
            links
        }
    

    I didn’t understand that I had to return the same type for each of the Option match arms, I thought enum variants could have different types, so if the Some match arm returns (), also None has to do the same…

    If I try with a simpler example I still cannot understand why I cannot do something like:

    enum OperativeSystem {
                Linux,
                Windows,
                Mac,
                Unrecognised,
            }
    
            let absent_os = OperativeSystem::Unrecognised;
            find_os(absent_os);
    
            fn find_os(os: OperativeSystem) -> String {
                match os {
                    debian => {
                        let answer = "This pc uses Linux";
                        answer.to_string()
                    }
                    windows10home => {
                        let answer = "This pc uses Windows, unlucky you!";
                        answer.to_string()
                    }
                    ios15 => {
                        let answer = "This pc uses Mac, I'm really sorry!";
                        answer.to_string()
                    }
                    _ => {
                        let is_unrecognised = true;
                        is_unrecognised
                    }
                }
            }
    

    match is much more intuitive for a beginner, there’s a lot of stuff which go under the hood with ?