• 0 Posts
  • 133 Comments
Joined 1 year ago
cake
Cake day: May 10th, 2024

help-circle
















  • The only way to make Rust segfault is by performing unsafe operations.

    Challange accepted. The following Rust code technically segfaults:

    fn stackover(a : i64) -> i64 {
        return stackover(a);
    }
    
    
    fn main() {
        println!("{}", stackover(100));
    }
    

    A stack overflow is technically a segmentation violation. At least on linux the program recives the SIGSEGV signal. This compiles and I am no rust dev but this does not use unsafe code, right?

    While the compiler shows a warning, the error message the program prints when run is not very helpfull IMHO:

    thread 'main' has overflowed its stack
    fatal runtime error: stack overflow
    [1]    45211 IOT instruction (core dumped)  ../target/debug/rust
    

    Edit: Even the compiler warning can be tricked by making it do recusion in pairs:

    fn stackover_a(a : i64) -> i64 {
        return stackover_b(a);
    }
    
    fn stackover_b(a : i64) -> i64 {
        return stackover_a(a);
    }
    
    fn main() {
        println!("{}", stackover_a(100));
    }
    

  • A set of propositional formulas is satisfiable if and only if all finite subsets of it are satisfiable.

    The cardinality of a set is always smaller than the cardinality of the set of subsets of the former set.

    A set cannot contain itself.

    There is no 1 to 1 mapping from the natural numbers to the real numbers.

    There is a 1 to 1 mapping from the natural numbers to the rational numbers.

    Something exists. I cannot tell you what it is but it does exist. Maybe reality is an illusion but even then the illusion exists.


  • Fair enough, I think yours is also a valid interpretation.

    I just want to clarify: with “just be happy” energy, I meant the tendency of people to suggest seemingly simple fixes to others struggling with mental health. Even, if they work for oneself and even if it works statistically (for example sport is a good habit against depression), it feels like talking the problem down. But that is highly subjective of course.


  • Ok, what do you mean by checking myself first?

    I just commented on how I personally perceived the comic. I also said that I believe that the comic was made with good intentions.

    Ultimately, I am just someone on the Internet. I have no illusion that my comments here matter. Though, I do have first and second hand experience with depression and suicide if that matters, which it does not.

    And yes in many ways I am extremely privileged when it comes to this topic, e.g. my healthcare insurance is not tied to my employer as I don’t live in the US. I would like to know how that has anything to do with my comment above though.