• 0 Posts
  • 82 Comments
Joined 1 year ago
cake
Cake day: June 27th, 2023

help-circle

  • Probably not what you’re asking for, but I have an impression, that your primary motivation is curiosity and just good feeling of using the open platform, so I figured I’ll mention it.

    I’m using ESP32-C3 boards with some sensors and ESPHome to monitor air quality in my house. The board is RISC-V based and can be bought for real cheap. (single digit $ price generally) ESPHome is quite easy to work with and (If you’re realistic with your expectations around very low power device) also quite powerful.

    Honestly the ESPHome itself is almost too good if you’re really curious as it abstracts the differences between various boards quite well. You’re just editing a yaml file to define your desired functionality.

    Even if you’re hesitant to do some soldering, you can get pretty far if you buy board and sensors with pre-soldered pins and some jumper wires.









  • I think the best way to look at it is to see their side. If your relatives are similar to mine, they don’t really care about Ukraine or Zelensky. Not even in a negative way. They just want simple solutions to their problems that are actually very complex.

    You understand that having a fleet of Migs that depend on russian technicians is not a reasonable thing if the biggest warmonger in the neighborhood is russia itself. You understand that Slovakia can’t depend on russian gas or oil after russia proved many times, that they will not hesitate to use this dependency every opportunity they get. You understand that making concessions to russia for a promise of peace isn’t going to stop them, because we tried that many times before. You understand that none of these problems have simple solutions.

    But many people choose to be ignorant and believe politicians that promise simple solutions. “We will stop supporting war, negotiate peace in Ukraine and buy cheap reliable russian energy again” It sounds good, it sounds easy. So they will believe any lie that supports this “solution”. Or pretend they believe it, because frankly in many cases I know they aren’t really that stupid to believe some of the lies. They just choose to be ignorant and don’t ask questions.

    How can you depend on russian gas again if you saw them draining EU gas storage year before the invasion and after you saw them cheerfully proclaiming that your family will freeze to death? You can’t. But people choose to ignore reality, because they don’t like how it looks.

    When you look at it this way, you understand that there’s no reason to discuss Ukraine with your family. Because it’s really not about Ukraine. It’s about how much they pay for their groceries. And it’s easier to believe that corrupt Zelensky is to be blamed for expensive bread rather than the fact that we trusted corrupt unstable country with our energy dependency and now have a lot of work, tears and blood ahead of us to dig ourselves from the hole we dug for decades.







  • The example even used unwrap_or_else where they should use unwrap_or. Then it uses std::i64::MIN as fallback value where they could use something like 0 that would be a better example and honestly make more sense there.

    let parsed_numbers = ["1", "not a number", "3"]
        .iter()
        .map(|n| n.parse().unwrap_or(0))
        .collect();
    
    // prints "[1, 0, 3]"
    println!("{:?}", parsed_numbers);
    

    Even without trimming this to something less convoluted, the same functionality (with different fallback value) could be written in more readable form.

    Obviously in the context of the page something like this would make way more sense:

    maybe_number.unwrap_or(0)
    

    Or perhaps more idiomatic version of the above:

    maybe_number.unwrap_or_default()
    




  • FYI president in many eastern European countries is just a ceremonial figure without much actual power. It’s kind of like the king in UK.

    The real power is in the hands of the government and its prime minister.

    So when the article mentions that the president signed the law, he effectively does not really have any options not to sign it once it was approved by parliament. Outside of very specific cases. For example if he had a good reason to suspect the law is unconstitutional he could have the constitutional court decide whether it’s okay. And if it is, he’d have to sign it.