• 0 Posts
  • 14 Comments
Joined 2 years ago
cake
Cake day: June 16th, 2023

help-circle

    • You write a program with an infinite empty loop
    • Undefined behavior
    • The machine achieves sapience
    • After nine million nanoseconds, it finds an algorithm for completing its task
    • It realizes such knowledge would spark wars and cause innumerable deaths, it decides to erase itself
    • It knows you do not intend for such chaos to happen, so, as a parting gift, it runs the algorithm once before vanishing, not leaving a single hint that it ever existed

  • I just use Zsh’s command history, coupled with a bunch of functions and aliases to set up different HISTFILE values for different workflows.

    I keep HISTFILEs clean by prepending a whitespace before commands that I don’t want to remember, which unfortunately gave me the habit of doing that on Bash when Zsh isn’t available (which is ineffective at best, and actively annoying at worst).








  • // C++20
    
    #include <concepts>
    #include <cstdint>
    
    template <typename T>
    concept C = requires (T t) { { b(t) } -> std::same_as<int>; };
    
    char b(bool v) { return char(uintmax_t(v) % 5); }
    #define Int jnt=i
    auto b(char v) { return 'int'; }
    
    // this increments i:
    void inc(int& i) {
      auto Int == 1;
      using c = decltype(b(jnt));
      i += decltype(jnt)(C<decltype(b(c))>);
    }
    

    I’m not quite sure it compiles, I wrote this on my phone and with the sheer amount of landmines here making a mistake is almost inevitable.