HackerTrans
TopNewTrendsCommentsPastAskShowJobs

veidelis

no profile record

comments

veidelis
·12 dagen geleden·discuss
Unfortunately the big game is opaque it's close to impossible to understand for the common folk. So many questions, so tough to grasp answers. Sickening. The enemy is hiding. One could say that paying the taxes in some form is a path toward a destruction. Phrases like "war economy" are lunatic. It all starts in your mind, and that's why it's the most important to protect your children from the propaganda. Take care!
veidelis
·18 dagen geleden·discuss
Honestly there might be truth to it, I don't get the downvotes - why?
veidelis
·28 dagen geleden·discuss
I personally think null is useless. I write TS not JS btw.
veidelis
·vorige maand·discuss
It might be like that. Everyone should strive to make the best decisions and not go with the mainstream. Always question the mainstream, it's dangerous. Make a change for the better. Everything starts with you. Then your family, friends, neighbors... Do you have the opportunity to grow something yourself? Do that.
veidelis
·vorige maand·discuss
[flagged]
veidelis
·vorige maand·discuss
My company tried it but reverted the changes. The biggest reasons - it's not compatible with mobx and we didn't notice any perf gains on an existing codebase.
veidelis
·vorige maand·discuss
Do you find anything "bad" about this code solving the problem?

    use std::rc::Rc;
    use std::cell::RefCell;
    
    struct Button {
        text: String,
        on_click: Option<Rc<dyn Fn()>>,
    }
    
    impl Button {
        fn new(text: &str) -> Self {
            Button { text: text.to_string(), on_click: None }
        }
        fn draw(&self) { println!("[Button: \"{}\"]", self.text); }
        fn fire_click(button: &Rc<RefCell<Button>>) {
            let cb = button.borrow().on_click.clone();
            if let Some(cb) = cb {
                cb();
            }
        }
    }
    
    fn main() {
        let button = Rc::new(RefCell::new(Button::new("Click me")));
        let cb_handle = Rc::clone(&button);
    
        button.borrow_mut().on_click = Some(Rc::new(move || {
            cb_handle.borrow_mut().text = "Clicked!".to_string();
        }));
    
        button.borrow().draw();
        Button::fire_click(&button);
        button.borrow().draw();
    }
Prints:

  [Button: "Click me"]
  [Button: "Clicked!"]
veidelis
·6 maanden geleden·discuss
You world view is very one-sided, it borders with total naiveness.
veidelis
·6 maanden geleden·discuss
The US also are by law not allowed to start a war without the approval of Congress, right? But they did anyway in Venezuela.
veidelis
·6 maanden geleden·discuss
+ 3 bits for piece type?
veidelis
·7 maanden geleden·discuss
From kernel side, I meant - I wasn't clear. Now I understand what's the meaning of "don't break rust code". Happy that rust's journey in the kernel is successful so far. The pace seems strong.
veidelis
·7 maanden geleden·discuss
Is rust code part of user space?
veidelis
·8 maanden geleden·discuss
Totally agree. One might require to be "in their head" a lot of the time to not get swung down, and enjoy himself such as laughing at his own jokes. To make it possible, one has to be free enough to express oneself (also internally). But freedom of thought and action is on the decline as I've come to observe lately, but that's another topic.
veidelis
·8 maanden geleden·discuss
Yes, that's an OK take, no big deal. Also it can be added that life in itself really doesn't have a choice, on some level it just happens (thinking more about chemistry here).
veidelis
·10 maanden geleden·discuss
Is there a way to connect components similarly like react-redux so that they can access external state without prop drilling? Good job.
veidelis
·3 jaar geleden·discuss
I agree with Casey.

I think he understands way much more than how to optimize for 60fps as many commentators here point out.