veidelis

Joined 14 years ago

Karma
310
Submissions
162
Member since
May 16
sometimes I know what I'm doing
View on Hacker News

Recent submissions

Comment · 1 month ago
Politics by Aristotle
Comment · 2 months ago
I don't believe in planning when to stare at the wall. I just do it when I feel like it - whenever - sometimes family members are around. Be reasonably spontaneous - you'll calibrate on you're own. Don't be afraid. Breathe, baby!
Comment · 4 months ago
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!
Comment · 4 months ago
Honestly there might be truth to it, I don't get the downvotes - why?
Comment · 4 months ago
I personally think null is useless. I write TS not JS btw.
Comment · 4 months ago
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.
Comment · 4 months ago
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.
Comment · 4 months ago
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!"]
Comment · 9 months ago
You world view is very one-sided, it borders with total naiveness.
Comment · 9 months ago
The US also are by law not allowed to start a war without the approval of Congress, right? But they did anyway in Venezuela.
Comment · 9 months ago
+ 3 bits for piece type?
Comment · 10 months ago
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.
Comment · 10 months ago
Is rust code part of user space?

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton