HackerTrans
トップ新着トレンドコメント過去質問紹介求人

lokeg

no profile record

コメント

lokeg
·13 日前·議論
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
·8 か月前·議論
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
·10 か月前·議論
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
·11 か月前·議論
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
·12 か月前·議論
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
·昨年·議論
What?
lokeg
·2 年前·議論
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