• 3 Posts
  • 480 Comments
Joined 3 years ago
cake
Cake day: July 3rd, 2023

help-circle

  • I would expect something worse than bubble sort. No idea whether it will even work:

    void reverse(auto A, int start, int end) {
      for (int i = 0; i < (end - start) / 2; i = i + 1) {
        auto tmp = A[start + i];
        A[start + i] = A[end - i];
        A[end - i] = tmp;
      }
    }
    
    for (int j = 0; j < N; j = j + 1) {
      for (int i = 0; i < N; i = i + 1) {
        if (A[i] < A[i + 1]) {
          reverse(A, i, N);
        }
      }
    }
    


  • For ages it was safe to download and open random files on Linux, because they simply would not run. Now Linux is a very desirable target for criminals, so they learned to write multiplatform viruses.

    The best option would be an automatic sandbox for running random crap downloaded who knows where, and Android does that automatically, but on desktop Linux you need to either create a new user (and remove world-readable permissions from your main account files), or create a custom Docker container, or create a chroot, or launch a VM, all of which require half a day of learning new tools, and then debugging why graphics would not work.





  • The executable will search for .so files not inside predefined paths like /usr/lib but inside it’s current directory. You may theoretically put . as an argument to configure, but it converts that into an absolute path, snd libtool and linker fail when encountering relative paths inside shared library dependencies.


  • I am using this myself in Android app, where you can write files only inside /data/data/your.app.id/

    So naturally, if you want to publish a different app, your.app.id will be different, so you need to recompile all your Linux tools that you bundle inside your app.

    If you are not running your Linux tools on Android, you’d probably be better off using Docker or a chroot.