• 0 Posts
  • 122 Comments
Joined 2 years ago
cake
Cake day: July 23rd, 2023

help-circle












  • 404@lemmy.ziptoRust@programming.devstruct in Rust
    link
    fedilink
    English
    arrow-up
    11
    ·
    1 month ago

    You can implement Display for custom structs, to print them in the regular manner:

    use std::fmt;
    
    struct Point {
        x: i32,
        y: i32,
    }
    
    impl fmt::Display for Point {
        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
            write!(f, "({}, {})", self.x, self.y)
        }
    }
    
    fn main() {
        let point = Point { x: 10, y: 20 };
        println!("{}", point); // using standard println!
    }
    

    You can also implement things like Add, Sub, AddAssign (point_a += point_b)… :)







  • 404@lemmy.ziptoScience Memes@mander.xyzpump up the jamz
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 months ago

    Technotronic got their name by combining the word ‘techno’, meaning a sort of dance music, and ‘tronic’ meaning ‘tronic’.

    The original 12-inch release of Pump Up The Jam came with a free horse.

    At 7.16pm on December 28th 1879, Dundee’s Tay Bridge collapsed as a train passed over it. 60 passengers lost their lives.

    Other musical acts whose names begin with ‘T’ include The Cure, The Isley Brothers, and The Velvet Underground.


  • 404@lemmy.ziptoScience Memes@mander.xyzpump up the jamz
    link
    fedilink
    English
    arrow-up
    4
    ·
    3 months ago

    Pump Up the Jam is an anagram of ‘Jump Up the Pump’.

    This song was played five times in a row at the funeral of director Stanley Kubrick.

    Techtronic’s home planet, Earth, consists of 70% water.

    If you isolate the individual drumbeats from this song and arrange them in a circle, it unlocks a cheat mode that allows you to pass through solid surfaces at will.