HackerTrans
TopNewTrendsCommentsPastAskShowJobs

lokeg

no profile record

comments

lokeg
·il y a 13 jours·discuss
Isn't working with the utf8 stream sufficient? Especially if you only have ASCII keywords/operators/brackets, I feel a ASCII parser should work with utf8 out of the box
lokeg
·il y a 8 mois·discuss
There is a somewhat famous post about this:

https://www.reddit.com/r/gamedev/comments/qeqn3b/despite_hav...

Essentially stating that Linux users disproportionately care to actually report bugs they encounter rather than ignoring them. I find that very plausible.
lokeg
·il y a 10 mois·discuss
This can be alleviated by the gas plant operator selling call options, effectively paying them for being reliable. The relevant keyword is "capacity markets".
lokeg
·il y a 11 mois·discuss
What about the worst case? I.e. something like searching for 1000 'a's in a long string of 'a's interspersed with 'b's every 500-1000 steps? Seems accidentally quadradic unfortunately in the absence of some KMP-like fallback
lokeg
·il y a 12 mois·discuss
Something like the following? I am trying and failing to reproduce the issue, even with mutable AST nodes.

  use bumpalo::Bump;
  use std::io::Read;
  fn main() {
      let mut arena = Bump::new();
      loop {
          read_and_process_lines(&mut arena);
          arena.reset();
      }
  }
  #[derive(Debug)]
  enum AstNode<'a> {
      Leaf(&'a str),
      Branch {
          line: &'a str,
          meta: usize,
          cons: &'a mut AstNode<'a>
      },
  }
  fn read_and_process_lines(arena: &Bump) {
      let cap = 40;
      let buf: &mut [u8] = arena.alloc_slice_fill_default(cap);
      let l = std::io::stdin().lock().read(buf).expect("reading stdin");
      let content: &str = str::from_utf8(&buf[..l]).unwrap();
      dbg!(content);

      let mut lines = content.lines();
      let mut latest: &mut AstNode<'_> = arena.alloc(AstNode::Leaf(lines.next().unwrap()));
      for line in lines {
          latest = arena.alloc(AstNode::Branch{line, meta:0, cons: latest});
      }
      println!("{latest:?}");
  }
lokeg
·l’année dernière·discuss
What?
lokeg
·il y a 2 ans·discuss
It indeed does not make sense to have a market for carbon sequestration that does not also include fossil fuel emissions.

But implementing a comprehensive cap-and-trade system is superior to a fixed carbon price in that the it directly limits emissions without fiddling with the exact price (which instead is discovered by the market), and therefore can be planned long term.

(What should the carbon price be 2050? That depends on inflation and many other factors, but the allowed net emissions should clearly be zero or negative)

I recommend everyone to take a look at the EU ETS which unfortunately is surprisingly unknown