• 4 Posts
  • 235 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).





  • … so, when are we launching?

    On a serious note, I think I was wrong.

    Assuming you can get into Mün’s SOI with an incredibly precise trajectory, you can MAYBE, sort of, lose kinetic energy by simply burning “upwards” at certain points, until you’re basically repeatedly going upwards then downwards relatively to the Mün. Its rotation is a problem, but tbh I haven’t played KSP in years and ffs I’m studying IT, not… whatever KSP is.







  • The first argument is more or less understandable (still wrong): you can’t just propel yourself upwards at your earliest convenience to reach the moon, you have to play around with orbital mechanics.
    If your friend’s idea of a moon-worthy vessel is an unsteerable rocket with infinite fuel and a chair strapped to it… well the odds are effectively zero.

    The second argument? bro, last time I checked the moon was still orbiting Earth





  • // 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));
      // edited mistake here: c is a type, not a value
      // i += decltype(jnt)(C<decltype(b(c))>);
      i += decltype(jnt)(C<decltype(b(c(1)))>);
    }
    

    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.