(_____(_____________(#)~~~~~~

  • 0 Posts
  • 34 Comments
Joined 3 years ago
cake
Cake day: April 11th, 2022

help-circle

  • COW filesystems like BTRFS/ZFS with btrbk/sanoid are great for this. Only the initial copy may take a while, but after that it only takes the delta between the source and the destination to synchronize. On my main Server I have the OS on a single drive with BTRFS and all the actual data lives on a 4 disk zpool in raidz2. I have cron jobs set up to do hourly snapshots on both and I keep about a week worth of history. The BTRFS one gets synced to an external drive every 24 hours, while the zpool gets synced to another external 4 disk zpool on a weekly basis.





  • Interesting feature, I had no idea. I just verified this with gcc and indeed the return register is always set to 0 before returning unless otherwise specified.

    spoiler
    int main(void)
    {
        int foo = 10;
    }
    

    produces:

    push   %rbp
    mov    %rsp,%rbp
    movl   $0xa,-0x4(%rbp) # Move 10 to stack variable
    mov    $0x0,%eax       # Return 0
    pop    %rbp
    ret
    
    int main(void)
    {
        int foo = 10;
        return foo;
    }
    

    produces:

    push   %rbp
    mov    %rsp,%rbp
    movl   $0xa,-0x4(%rbp) # Move 10 to stack variable
    mov    -0x4(%rbp),%eax # Return foo
    pop    %rbp
    ret
    


  • Your CPU has big registers, so why not use them!

    #include <x86intrin.h>
    #include <stdio.h>
    
    static int increment_one(int input)
    {
        int __attribute__((aligned(32))) result[8]; 
        __m256i v = _mm256_set_epi32(0, 0, 0, 0, 0, 0, 1, input);
        v = (__m256i)_mm256_hadd_ps((__m256)v, (__m256)v);
        _mm256_store_si256((__m256i *)result, v);
        return *result;
    }
    
    int main(void)
    {
        int input = 19;
        printf("Input: %d, Incremented output: %d\n", input, increment_one(input));
        return 0;
    }
    




  • I remember this. I refunded the game ASAP. For the longest time they’ve neglected the Linux client to the point where it was just broken and crashed often and you couldn’t even play with Windows players because the Linux client was so far behind. And of course the Windows version ran just fine on Linux via Proton. Yet they seemed surprised and annoyed whenever Linux players pointed this out. That’s where I lost all my respect for them as a developer. I would refund Gary’s Mod too if I could.




  • I don’t understand how so many people use that centralized, proprietary piece of big tech spyware for like almost everything. There are so many interesting communities out there that exclusively exist on Discord. I hate how some software projects and games use only Discord to post updates, news, patchnotes, documentation and even download links. And they expect people to just “join our Discord” for suggestions, bug reports and troubleshooting. I don’t have a Discord account and I don’t plan on making one, ever. There is so much useful and interesting information currently out there that people are never going to get to see simply because it’s all scattered in random chat rooms on random Discord servers. And if any of those chat rooms, Discord servers or even Discord itself gets shut down all of that information will inevitably become lost media.