u/cuntmong

Halloween decorations in the town

Halloween decorations in the town

A lot happened this week and I completely forgot about this aspect. What do we think is the deal with these Halloween decorations in the hall type building. There is a stage and chairs, so one assumes it is the set dressing for a Halloween style play. But even if there was a point in time when life in the town was normal enough to put on a play, why would people in this place choose to do it Halloween themed of all things?

I think these Halloween decorations are very intentional, and are there specifically to add to the lore of how the town came to be. I am undecided exactly what that is though. My standing theory is that everything in from world comes from people's minds, not necessarily just when they die either.

u/cuntmong — 16 hours ago
▲ 1 r/rust

Noob question regarding borrows and "static" (?)

I'm new to rust and still learning the basics. The way I like to learn new languages is just by building stuff which is what I'm trying to do.

I understand the overall concepts and restrictions around borrowing etc, but have hit a case where I'm not even sure how to frame the part I'm not understanding.

I'm using the device query library to listen for when someone presses the UP or DOWN keys, and when they do I want to increment or decrement a variable and then print it to screen, but still have that variable usable by other parts of my code.

The issue is that the on_key_down listener operates out of sync with the rest of the code, so I'm not really sure how to give my callbacks access to my variable without it warning that it might outlive the variable it's trying to use.

Posting my whole program here because its quite simple

use device_query::{DeviceEvents, DeviceEventsHandler};
use std::time::Duration;

fn main() {
    let mut the_variable: u64 = 0;

    let device_events = DeviceEventsHandler::new(Duration::from_millis(10)).unwrap();
    let _guard2 = device_events.on_key_down(|key| {

        match key.to_string().as_str() {
            "Down" => {
               // I want to increment the_variable here then println! it, but still have it usable elsewhere
            },
            "Up" => {
                // I want to decrement the_variable here then println! it, but still have it usable elsewhere
            },
            _ => {
                // don't do anything
            },
        }
    });

    loop {}
}

on_key_down is defined as follows, so I assume the answer lies in here somewhere, but I'm not really sure how to interpret Sync + Send + 'static

    fn on_key_down<Callback: Fn(&Keycode) + Sync + Send + 'static>(
        &self,
        callback: Callback,
    ) -> CallbackGuard<Callback>;

I also realise that there may be other libraries that do what I'm trying to do better, but the exercise is more about understanding what's going on rather than the actual output, so I'm asking specifically how to update the_variable in any case like this, rather than just this specific example, and i guess what is this specific issue called?

reddit.com
u/cuntmong — 7 days ago

I have a suspicion that rather than victors mum seeing the from world as it is in her drug trips before entering, the world actually gets its ideas for how to shape itself from the people entering. So when you get car treed in, it uses imagery and ideas that are already in your head to fill in necessary details.

reddit.com
u/cuntmong — 16 days ago