• 1 Post
  • 45 Comments
Joined 1 year ago
cake
Cake day: June 6th, 2023

help-circle

  • They explain it a bit here: https://mitchellh.com/writing/ghostty-and-useful-zig-patterns

    Also, calling out the warning signs, my bar for a native platform experience is that the app feels and acts like a purpose-built native app. I don’t think this bar is unreasonable. For example, I don’t think it’s unreasonable to say that Alacritty is kind of not native because new windows create new processes. Or that Kitty is kind of not native because tabs use a non-native widget. And so on (there are many more examples for each).

    So nothing wrong with Kitty on MacOS e.g., but the “feel” is not native. Personally don’t care too much about that, but the author seems to do.



  • Absolutely nothing comes close to the thinness and lightness, combined with battery and performance of my M2 Air. And that’s not to mention that Apple’s touchpads are still so far ahead of everyone else that I’d like to laugh about it, but it’s too embarrassing for that. It’s not like I’m not aware of the linux/windows alternatives, it’s that there simply are no alternatives…I’d rather deal with Apple’s shit software instead of everyone else’s subpar hardware, because software is changeable.

    Also, since the Asahi team actually knows what they’re doing, it turns out that their linux support on Apple Silicon is often better in a lot of ways than most windows-centric laptops. They take a long time to support certain hardware capabilities, but once they do you can be sure that it works flawlessly. Can’t say the same about any other laptop I owned before (although Framework, System 76 and Tuxedo laptops are probably good in that regard).

    Also, while the keyboard on my Dell XPS broke a whopping 5 times in the last few years, the Macbook Air has yet to show any signs of wear. The reason I got a Macbook is because I need to get work done and need a reliable machine for that. And what can I say, my god has it ever been reliable.




  • May not be the most popular choice, but I absolutely love Sublime Merge. Only issue I have is that it doesn’t support workspaces. But I love how it doesn’t abstract git away. Most actions in the UI are just called like the underlying git command, there are no non-git things like a “sync”. Plus you can always click on the top to see which commands exactly were executed and with what output. And it’s Sublime-typical wicked fast.

    It’s an unlimited free trial with the dark mode disabled. License costs $100 and lasts for 3 years of updates.





  • Treeniks@lemmy.mltoLinux@lemmy.mlHyprland is now fully independent!
    link
    fedilink
    arrow-up
    56
    arrow-down
    7
    ·
    3 months ago

    People keep saying this happened only because vaxry got banned from the FDO, completely forgetting the fact that hyprland has used their own modified fork of wlroots for ages now. They’ve wanted to get away from wlroots even before this whole fiasco, it really just tipped the needle for them to finally pull the trigger.

    Mind you also, the ban in no way prevents hyprland from using wlroots still. The only thing the ban did was prevent vaxry from contributing to wlroots upstream, which is damn unfortunate if you ask me.











  • Rust

    github codeberg gitlab

    First tried a really slow brute force, but after waiting many minutes heard others talk of Karger’s Algorithm, so I implemented that.

    use rand::prelude::*;
    use std::collections::HashSet;
    
    type Graph = (V, E);
    
    type V = HashSet;
    type E = Vec<(String, String)>;
    
    fn parse_input(input: &str) -> Graph {
        let mut vertices = HashSet::new();
        let mut edges = Vec::new();
    
        for line in input.trim().lines() {
            let mut it = line.split(':');
    
            let left = it.next().unwrap();
            vertices.insert(left.to_owned());
    
            for right in it.next().unwrap().trim().split_whitespace() {
                vertices.insert(right.to_owned());
                edges.push((left.to_owned(), right.to_owned()));
            }
        }
    
        (vertices, edges)
    }
    
    fn part1(input: &str) -> usize {
        let (vertices, edges) = parse_input(input);
    
        let mut rng = rand::thread_rng();
    
        // Karger's Algorithm
        loop {
            let mut vertices = vertices.clone();
            let mut edges = edges.clone();
            while vertices.len() > 2 {
                let i = rng.gen_range(0..edges.len());
                let (v1, v2) = edges[i].clone();
    
                // contract the edge
                edges.swap_remove(i);
                vertices.remove(&v1);
                vertices.remove(&v2);
    
                let new_v = format!("{}:{}", v1, v2);
                vertices.insert(new_v.clone());
    
                for (e1, e2) in edges.iter_mut() {
                    if *e1 == v1 || *e1 == v2 {
                        *e1 = new_v.clone()
                    }
                    if *e2 == v1 || *e2 == v2 {
                        *e2 = new_v.clone()
                    }
                }
    
                // remove loops
                let mut j = 0;
                while j < edges.len() {
                    let (e1, e2) = &edges[j];
                    if e1 == e2 {
                        edges.swap_remove(j);
                    } else {
                        j += 1;
                    }
                }
            }
    
            if edges.len() == 3 {
                break vertices
                    .iter()
                    .map(|s| s.split(':').count())
                    .product::();
            }
        }
    }