Spyke

Posts

programmer_humor·Programmer Humorbysiriusmart

rust blasphemy (added context)

made in gimp, with <3

::: spoiler Context for actual rust programmers I was having massive beef with the rust compiler yesterday, every cargo check takes 20 seconds.

And then look at the three functions below, only one of them are Send, if you know why, please let me know.

(Note: value that is not Send cannot be held across an await point, and Box is not Send)

async fn one() {
    let res: Result<(), Box<dyn Error>> = do_stuff();
    if let Err(err) = res {
        let content = err.to_string();
        let _ = do_stuff(content).await;
    }
}

async fn two() {
    let res: Result<(), Box<dyn Error>> = do_stuff();
    let content = if let Err(err) = res {
        Some(err.to_string())
    } else {
        None
    };
    drop(res);
    if let Some(content) = content {
        let _ = do_stuff(content).await;
    }
}

async fn three() {
    let content = {
        let res: Result<(), Box<dyn Error>> = do_stuff();
        if let Err(err) = res {
            Some(err.to_string())
        } else {
            None
        }
    };
    if let Some(content) = content {
        let _ = do_stuff(content).await;
    }
}

:::

View original on lemmy.world
dailymaths·Daily Maths Challengesbysiriusmart

[2025/01/15] Twice derivative of function

Question

  • Find the function f such that f'' = -f
  • Show that the function can be written in format f = A sin(x + B)

Extension

Find a function g such that g'' = C * -g and

  • g(0) = D
  • g'(0) = 0 where C and D are arbitrary constants.

::: spoiler For those who have finished the extension Congratulations, you have just derived the formula for objects in simple harmonic motions (physics). :::

View original on lemmy.world
linkinpark·Linkin Parkbysiriusmart

take on new LP songs?

heres my current ops after first listen

::: spoiler Spoilers sounds amazing:

  • cut the bridge
  • overflow
  • stained
  • good things go

give it some time:

  • two faced
  • IGYEIH

no:

  • casualty :::

casualty after over each other is pretty cool

and just would like to say, good things go sounds like a mike shinoda song than LP

View original on lemmy.world
israel_palestine_pol·Israel and Palestine Politics Discussionbysiriusmart

Israel intentionally targetting UN peacekeeping forces

In light of events following the previous post, it is almost certain shelling of the UN peacekeepers camp was not an accident from attacking nearby hezbollah tunnels.

The UN forces are the target of the Israeli army, as bulldozers usually dont accidentally show up in a warzone to specifically bulldoze a UN watch tower.

Oct 20 (Reuters) - The U.N. peacekeeping force in Lebanon (UNIFIL) said in a statement that an Israeli army bulldozer had demolished an observation tower and perimeter fence of a U.N. position in Marwahin in southern Lebanon on Sunday.
https://www.reuters.com/world/middle-east/unifil-says-israeli-army-demolished-watchtower-fence-un-site-southern-lebanon-2024-10-20/Open linkView original on lemmy.world