Skip Navigation

InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)B
Posts
10
Comments
274
Joined
3 yr. ago

Collecting downvotes since before forums even had thank you's.

  • Keep (Neo)Vim out of this.

  • Hate to break it to you, but you're not really learning.

  • why gcc couldnt do this automatically? i mean its supposed to do this right?

    Because gcc is a compiler, not a build tool.

    Maybe you come from a language where the two tasks are combined, but that's not the case here.

    and another important issue that clang ls (language server) showed the same error? i thought fixing this would fix that too, but that isnt the case here.

    For the same reason stated above, clangd needs to know how you build your code. This is done via a JSON file called compile_commands.json.

    In your trivial case, running this should be enough:

     
        
    clang -MJ- main.c `pkg-config --cflags --libs dbus-1` > compile_commands.json
    
      
  •  
        
    % pkg-config --cflags dbus-1
    -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include
    % pkg-config  --libs dbus-1
    -ldbus-1
    
      

     
        
    gcc main.c `pkg-config --cflags --libs dbus-1`
    
      

    You don't need to link against the library yet, but you will.

    Linking might become a separate step when you have multiple files, not just main.

  • I for one am happy we’re getting an alternative to the Chrome/Firefox duality we’re stuck with.

    Anyone serious about that would be sending their money towards Servo, which resumed active development since the start of 2023, and is making good progress every month.

    I would say nothing but "Good Luck" to other from-scratch efforts, but It's hard not to see them as memes with small cultist followings living on hope and hype.

  • I thought I saw this weeks ago.

    May 21, 2024

    yep

    Anyway, neovim+rust-analyzer+ra-multiplex is all I need.

  • P.S. Since it wasn't mentioned already, look up cgroups.

    Back when I had a humble laptop (pre-Rust), using nice and co. didn't help much. Custom schedulers come with their own stability and worst-case-scenario baggage. cgroups should give you supported and well-tested tunable kernel-level resource usage control.

  • This hasn't been my experience when no swapping is involved (not a concern for me anymore with 32GiB physical RAM with 28GiB zram).

    And I've been Rusting since v1.0, and Linuxing for even longer.

    And my setup is boring (and stable), using Arch's LTS kernel which is built with CONFIG_HZ=300. Long gone are the days of running linux-ck.

    Although I do use craneleft backend now day to day, so compiles don't take too long anyway.

  • Why Aren't We Embracing IPFS?

    Because it's an overhyped joke successfully utilized by crypto scammers.

    Neither content addressing, nor distributed hash tables (or key-value stores, or whatever) were novel ideas.

    The combination of the two is not a novel idea.

    For p2p, torrents, work as another user already pointed out (initial realease 2001).

    For a distributed filesystem, look at Tahoe-LAFS (initial release 2007).

    For a full anonymous p2p distributed filesystem, check out (real) Freenet, called Hyphanet now (initial release 2000).

    And no, if you need anonymity, an anonymous transport (e.g. using libp2p) is not enough. You need to consider anonymity at each step like Freenet does.

    These are three real non-overhyped products one can draw inspiration from. IPFS? not so much.

    You can look around for more examples. I always found this Wikipedia page about file sharing in Japan interesting, since it mentions networks not well known to the rest of the world: https://en.wikipedia.org/wiki/File_sharing_in_Japan

  • What’s interesting is that this problem is largely solved for C and C++: Linux distributions like Debian

    [closes tab]

    • GitHub wasn't always owned by Microsoft. At least get your dates right.
    • Yes, GH shouldn't be the sole auth provider.
  • Is everyone genuinely liking this!

    This is, IMHO, not a good style.

    Isn't something like this much clearer?

     
        
    // Add `as_cstr()` to `NixPath` trait first
    
    let some_or_null_cstr = |v| v.map(NixPath::as_cstr)
      .unwrap_or(Ok(std::ptr::null()));
    
    // `Option::or_null_cstr()` for `OptionᐸTᐳ`
    // where `T:  NixPath` would make this even better
    let source_cstr = some_or_null_cstr(&source)?;
    let target_cstr = target.as_cstr()?;
    let fs_type_cstr = some_or_null_cstr(&fs_type)?;
    let data_cstr = some_or_null_cstr(&data)?;
    let res = unsafe { .. };
    
      

    Edit: using alternative chars to circumvent broken Lemmy sanitization.

  • fn foo(&big, &chungus)

    is out,

    async fn foo(&BIG_GLOBAL_STATIC_REF_OR_SIMILAR_HORROR, sendable_chungus.clone())

    is in.

    Or maybe you know

    fn foo(&big, &chungus)

    is out

    async fn foo(big, chungus) -> (big, chungus)

    is in

    Or

     
        
    async fn foo(big, chungus) {
      // ...
      tx.send((big, chungus)).await?;
      // ...
    }
    
      

    is in

    Moving (movable/sendable) data is not limited by number or direction, you know. And that second one even makes use of them great Hoare channels! And gives us control on how long we hold on to data before sending it back (modified or not). But I digress. Let's go back to the important talking point that Hoare was right!