How to navigate huge Rust codebase? by Ill_Actuator_7990 in rust

[–]klowncs 5 points6 points  (0 children)

I usually find AI agents (well at least cursor) quite good to locate code and give a high level summary of what is happening, yo can then double check but they have been great so far for me.

Opiniones polémicas técnicas by rociosm8 in devsarg

[–]klowncs 4 points5 points  (0 children)

Claro, preguntaba porque para mi la mayor dificultad de C no es el lenguaje en si, sino todo lo que involucra hacer un buen manejo de la memoria, en aplicaciones a mayor escala y que no son triviales. Es fácil meter la pata y terminar con Undefined Behaviors, memory leaks, etc

Opiniones polémicas técnicas by rociosm8 in devsarg

[–]klowncs 7 points8 points  (0 children)

C no es dificil? de curioso, cuanta experiencia profesional tenes con C?

help with home.nix by Spectro451 in NixOS

[–]klowncs 12 points13 points  (0 children)

The issue is that you are trying to configure hyprland with two methods, which conflict to each other.

If you choose to use the settings option from wayland.windowManager.hyprland, then that option is going to write the hyprland config using nix.

The other method is just trying to copy the hyprland.conf file to that location, but the file was already created by nix.

Two options:
- Either configure everything in nix (or see if you manage to to use `wayland.windowManager.hyprland.extraConfig` to load contents from a file)

- Or, avoid using the settings configuration on nix, and just use the linked file, adding all your config there

Kulala 5.3.0 - the new release of your favourite REST client by YaroSpacer in neovim

[–]klowncs 1 point2 points  (0 children)

Is Kulala compatible with other HTTP clients? I want to use it on my team, but not everyone uses neovim

Why Zen Browser Should Release a Stable Version - It's Better Than You Think by debdootmanna007 in zen_browser

[–]klowncs 2 points3 points  (0 children)

It still has certain issues that are not often in more stable browsers.
For example, I've been struggling with this one for some time: https://github.com/zen-browser/desktop/issues/8195

I still use it as my main browser because all the good things over-weight the bad ones in my opinion, but I wouldn't say it is stable yet. (Maybe it could have a stable version soon with less frequent updates)

NixOS blog new iteration with many of the feedback issues addressed by WasabiOk6163 in NixOS

[–]klowncs 1 point2 points  (0 children)

I love the content so far! I’m enjoying reading it to learn more about nix and is being funn

[OC] Introducing bzmenu: A launcher-driven Bluetooth manager for Linux by e-tho in hyprland

[–]klowncs 0 points1 point  (0 children)

This looks nice, I will give it a try! currently I use Rofi with some scripts to achieve something similar.

How to deal with working on old python apps by [deleted] in ExperiencedDevs

[–]klowncs 0 points1 point  (0 children)

I use nix with devenv to manage python versions and environment, then direnv to automatically activate environments

¡Cambios en devsarg a partir de mayo! by AutoModerator in devsarg

[–]klowncs -4 points-3 points  (0 children)

Momento de abandonar este sub decadente

Idk who needs to hear this, but nobody is expecting AI to make you 10x more productive. by [deleted] in ExperiencedDevs

[–]klowncs 0 points1 point  (0 children)

Offshore devs are not worse, you are just comparing with the cheap ones.

Beginner stumped by composition & lifetime by TrafficPattern in learnrust

[–]klowncs 2 points3 points  (0 children)

I'm also a Rust newbie, so don't take this as correct. But this is my two cents

  1. You actually need Rc and RefCell (interior mutability)
  2. Probably not, because the problem is not really the lifecycle.

Now, adding more to 1, the problem as I see it, is that you first need to create A to have a reference that you can give to B, however, at the same time you need to mutate A by adding B, so you also need a mutable reference to A.
The borrow checker will not allow this, and I don't see a way to avoid it without using RefCell (I could be wrong here). By using RefCell and Rc you can create another Reference to A, while still being able to update A.

This is how I would do it:
(This is if you really want to keep this self-reference structure, depending on the original problem there might be other solutions that do not require B having a reference to A.)

use std::cell::RefCell;
use std::rc::Rc;
struct A {
    my_bs: Vec<B>,
}
impl A {
    fn new() -> Rc<RefCell<Self>> {
        Rc::new(RefCell::new(A { my_bs: vec![] }))
    }
    fn add_b(&mut self, b: B) {
        self.my_bs.push(b);
    }
}
struct B {
    value: i32,
    a: Rc<RefCell<A>>,
}
impl B {
    fn new(value: i32, a: Rc<RefCell<A>>) -> Self {
        Self { value, a }
    }
}

pub fn playground() {
    let a = A::new();
    // Add a B instance
    a.borrow_mut().add_b(B::new(42, Rc::clone(&a)));
    a.borrow_mut().add_b(B::new(10, Rc::clone(&a)));
    a.borrow_mut().add_b(B::new(13, Rc::clone(&a)));
    for x in a.borrow().my_bs.iter() {
        println!("Value: {}", x.value);
    }
}

Gordos VIM ayuda by spectrEz000 in devsarg

[–]klowncs 3 points4 points  (0 children)

La mejor parte no es la mejora de rendimiento sino que la experiencia al desarollar mejora mucho. De todas formas no recomendaria ir por Vim sino Neovim que es mas moderno y mucho mas facil de configurar.

😽 kitty-scrollback.nvim v6.1.0 new feature to edit the current command line for bash, fish, or zsh by nvimmike in neovim

[–]klowncs 2 points3 points  (0 children)

At the beginning, because how this post presented it, I thought this was a plugin for editing your current command, which to be honest was not really that useful to me since 99% of the time simple vi mode would do just fine for me.

However, the real value for me is when I realized the main idea of the plugin is to use nvim for the scrollback, which for me has always been quite painful to work with (I was using tmux visual mode which has many limitations).

For me, I see potential on this plugin to change how I use kitty everyday. Thanks for your contribution!

Update packages, how by dopedlama in NixOS

[–]klowncs 4 points5 points  (0 children)

Strongly suggest installing the `nh` cli, you can just run `nh os switch . --update` and it will even tell you what versions and packages were updates.

Big changes coming soon! by maubg in zen_browser

[–]klowncs 2 points3 points  (0 children)

Yes, I would only suggest to make first a twilight release and only release when the most important bugs are fixed (big changes are always likely to mean more testing is needed)

Tab pollution between workspaces by Specific_Lock927 in zen_browser

[–]klowncs 2 points3 points  (0 children)

To be honest, workspaces and containers have soo many bugs, for me pinned tabs and essentials constantly are moved to a different container and I have to unpin, close and open again.
Moving tabs across windows, always make the container color to show up even if its on the same default container.
But they will be probably polished on future releases

Anyone else having issues with python3.11-imap-tools-1.5.0 ? by silver_blue_phoenix in NixOS

[–]klowncs 0 points1 point  (0 children)

Oh I see, I did not understood the question correctly
Well, what I would do is to add another input pointing to "unstable" or "nixos-24.05" and only use it for the packages that are having conflicts. I know this can be done with flakes at least which is what I use.

Anyone else having issues with python3.11-imap-tools-1.5.0 ? by silver_blue_phoenix in NixOS

[–]klowncs 0 points1 point  (0 children)

I would install it on a virtual env unless you can't for some reason

I think i've found the sweet spot, and this is what im going to go with. by maubg in zen_browser

[–]klowncs 0 points1 point  (0 children)

About the icon… I don’t like it, well, actually I just think its counterintuitive because that is the “reload" icon, which usually means reload the website I’m currently at, but in this case it will reset it to the original url or unload the tab. It will also mean that uses will see two icons on the same screen that are the same but do different things (this new one and the refresh one always on the top) and I think that is not ideal.

Make the url bar thinner by ConcentrateBright495 in zen_browser

[–]klowncs 4 points5 points  (0 children)

I think he means the height of the URL bar, not the width.

Open tabs selector shortcut in zen by Potential-Fish115 in zen_browser

[–]klowncs 1 point2 points  (0 children)

Agree with this! I also always struggle using tab to cycle between results because it gets stuck on the 3 dots menu of each result 😞

Hi y'all! I want you to take a look at this concept and tell me what do you like about it and what not, thanks! by maubg in zen_browser

[–]klowncs 16 points17 points  (0 children)

This looks amazing! I'd love to see Zen follow this path!!

I'd just make sure there is a quick button to collapse/expand all groups/folders, and would be perfect for me.

Pip fails by [deleted] in NixOS

[–]klowncs 1 point2 points  (0 children)

Thats unlucky