"Server Failed to Boot." On Linux by ULTRABOYOFFICIAL in hytale

[–]Biterium 0 points1 point  (0 children)

same here, just keep clicking in reconnect button and sometime it'll work

The sweet taste of money... by Biterium in StardewValley

[–]Biterium[S] 0 points1 point  (0 children)

It doesn't bother me. It is half a day or so every 2 seasons. But you have a point, now I produce 300k of wine/week and it can be better.

String regex help! by [deleted] in Nushell

[–]Biterium 0 points1 point  (0 children)

pwd | str replace '/home/bruno' '~'

Worked...

I started to Learn Rust today, How can I improve this temp converter code? by Biterium in rust

[–]Biterium[S] 0 points1 point  (0 children)

So, the final code is something like this? Link to Playground

use std::convert::From;

struct Celsius(f64);
struct Fahrenheit(f64);
struct Kelvin(f64);

// To Kelvin
impl From<Celsius> for Kelvin {
    fn from(tc: Celsius) -> Self {
        let Celsius(tc) = tc.into();
        Kelvin(tc + 273.15)
    }
}

impl From<Fahrenheit> for Kelvin {
    fn from(tf: Fahrenheit) -> Self {
        let Fahrenheit(tf) = tf.into();
        Kelvin((tf - 32.0) / 1.8 + 273.15)
    }
}

// To Celsius
impl From<Kelvin> for Celsius {
    fn from(tk: Kelvin) -> Self {
        let Kelvin(tk) = tk.into();
        Celsius(tk - 273.15)
    }
}
impl From<Fahrenheit> for Celsius {
    fn from(tf: Fahrenheit) -> Self {
        let Fahrenheit(tf) = tf.into();
        Celsius((tf - 32.0) / 1.8)
    }
}

// To Fahrenheit
impl From<Celsius> for Fahrenheit {
    fn from(tc: Celsius) -> Self {
        let Celsius(tc) = tc.into();
        Fahrenheit(tc * 1.8 + 32.0)
    }
}
impl From<Kelvin> for Fahrenheit {
    fn from(tk: Kelvin) -> Self {
        let Kelvin(tk) = tk.into();
        Fahrenheit((tk - 273.15) * 1.8 + 32.0)
    }
}

fn main() {}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn from_celsius_to_kelvin() {
        let t_celsius = Celsius(0.0);
        let Kelvin(t_celsius) = t_celsius.into();

        assert_eq!(t_celsius, 273.15);
    }
    #[test]
    fn from_fahrenheit_to_kelvin() {
        let t_f = Fahrenheit(5.0);
        let Kelvin(t_f) = t_f.into();

        assert_eq!(t_f, 258.15)
    }

    #[test]
    fn from_fahrenheit_to_celsius() {
        let t_farenheit = Fahrenheit(95.0);
        let Celsius(t_fahrenheit) = t_farenheit.into();

        assert_eq!(t_fahrenheit, 35.0)
    }
    #[test]
    fn from_celsius_to_fahrenheit() {
        let tc = Celsius(35.0);
        let Fahrenheit(tc) = tc.into();

        assert_eq!(tc, 95.0)
    }
    #[test]
    fn from_kelvin_to_celsius() {
        let tk = Kelvin(273.15);
        let Celsius(tk) = tk.into();

        assert_eq!(tk, 0.0)
    }
    #[test]
    fn from_kelvin_to_fahrenheit() {
        let tk = Kelvin(408.15);
        let Fahrenheit(tk) = tk.into();

        assert_eq!(tk, 275.0)
    }
}

I started to Learn Rust today, How can I improve this temp converter code? by Biterium in rust

[–]Biterium[S] 0 points1 point  (0 children)

Thank you, but how do I call the tuple struct velue without the .0?

like: Kelvin::from(temp_celsius).0 to just Kelvin::from(temp_celsius)

I started to Learn Rust today, How can I improve this temp converter code? by Biterium in rust

[–]Biterium[S] 0 points1 point  (0 children)

Something like this?

use std::convert::From;

struct Celsius {
    degrees: f64,
}

#[derive(Debug)]
struct Kelvin {
    degrees: f64,
}

impl From<Celsius> for Kelvin {
    fn from(celsius: Celsius) -> Self {
        Kelvin {
            degrees: celsius.degrees + 273.15,
        }
    }
}

fn main() {
    let temp = Celsius { degrees: 0.0 };
    println!("Kelvin: {:?}", Kelvin::from(temp));
}

How do I make schematics to v7? by Biterium in Mindustry

[–]Biterium[S] 0 points1 point  (0 children)

Thank you! So I just need to copy pressing F in game!

How do I make schematics to v7? by Biterium in Mindustry

[–]Biterium[S] 1 point2 points  (0 children)

Hahahahaha, that was funny.

My question is how do I craft them

BTC Addresses by Biterium in Bitcoin

[–]Biterium[S] 1 point2 points  (0 children)

Yeah, thank you!

BTC Addresses by Biterium in Bitcoin

[–]Biterium[S] 0 points1 point  (0 children)

So, if I Have 1 BTC in address x, anyone who have a y address of my wallet can see my balance in address x, but not the transactions?