Rust dev, I enjoy reading and playing games, I also usually like to spend time with friends.

You can reach me on mastodon @sukhmel@mastodon.online or telegram @sukhmel@tg

  • 0 Posts
  • 667 Comments
Joined 3 年前
cake
Cake day: 2023年7月3日

help-circle
  • Also, yeah, I hate when people blast AC 15 degree below ambient temperature, especially when ambient is at 44°C like last week and ‘blasting’ is 29°C /s

    That is assuming a post was not about °F which would be a laughable difference in temperature completely.

    Also, there are people who blast heaters in winter, too. Where I live now this is not that much of an issue, but you can’t just decide not to use any heater when it’s below -20°C outside





  • Quite often when I hear or see a joke I think a bit further than the surface level and ponder how that joke reflects on the image of someone in real life. Sometimes the answer is ‘not good’. The same goes for things other than jokes, so it always makes sense to consider how things you encounter may affect you


  • I haven’t looked at the code, so my two cents may be irrelevant, but it sounds like you could define a structure that borrows the vector, keeps a separate vector of indices into borrowed vector, and has a current element index.

    struct SortFacadeIterator<'a, T: Ord> {
        data: &'a Vec<T>,
        indices: Vec<usize>,
        position: usize,
    }
    

    Then in new you would need to sort the original vector but instead of mutating it you would store indices of a resulting sorted elements from the original, i.e. when passed [“b”, “a”, “c”] you would create index storage of [1, 0, 2]. After that you can iterate both ways, returning an element by index:

    impl<'a, T: Ord> SortFacadeIterator<'a, T> {
        fn current(&self) -> &T {
            self.data[self.indices[self.position]]
        }
    }
    

    I think, maybe sorting a vector could be done by enumerating original vector and sort_by a value, also I’m not sure you need a full ordering, but I don’t remember what a sort expects











  • I understand the sentiment and feel somewhat similar about doing any drawings with AI, but I feel like a lot of people who say that you should draw even if it’s bad, wouldn’t pay attention to badly drawn things before AI slop became a thing. I definitely wouldn’t have decided to visit a bar with a poorly drawn board just because intent is what’s important, while sometimes I was tempted to visit a bar with artfully drawn board, that likely was commissioned from an artist. So when I hear people saying ‘do it yourself instead of slopping’ I can’t shake off the feeling that it’s rather being ‘do it yourself if you are good or commission from someone who is good’, because in competitive fields it is rather hard to achieve much when the only thing you have is intention