Hacker Newsnew | past | comments | ask | show | jobs | submit | keyneus's commentslogin

I remember upgrading from a 4x to 24x, and being excited for the much faster data transfer rate. What I didn't anticipate was the fact that it sounded like a jet taking off when it spun that fast! I figured out how to ratchet it down to 4x and kept it there unless I knew I'd need a fast sustained rate for something like copying hundreds of megs. It wasn't worth the noise for smaller transfers.


I switched to Vivaldi as a result of the removal of this feature from Firefox, because Vivaldi still allows you to choose this behavior. Are there other Unix browsers you're aware of that allow you to disable click-to-select? It'd be nice to at least have some options, although I'm generally happy with Vivaldi.


At least Audacious (in its audacious-plugins package) as well as Qmmp support chiptunes via the Game_Music_Emu library. I'd imagine many other plugin-based players for Linux/Unix have support as well.


In C, it's perfectly legal to do this:

    struct S { ... };
    typedef int S;
That's not valid in C++ (so would be a breaking change in C, if it were to adopt this).

I don't really think changing this in C would break all that much code, but it's definitely not backwards compatible.


If you're at all interested in digging through the Zork code yourself, you no longer need to know Z-machine assembly: the source code for most Infocom games was released/leaked a few years back, and is available here: https://github.com/historicalsource/

It's written in ZIL, which has a somewhat Lispy feel (for a bit of background, see another post by Plotkin here: http://blog.zarfhome.com/2019/04/what-is-zil-anyway.html). Infocom's own internal documentation for ZIL is here: https://archive.org/details/Learning_ZIL_Steven_Eric_Meretzk....


Thanks, looks like this is the relevant code: https://github.com/historicalsource/zork1/blob/master/1actio...

As I understand it, the thief doesn’t travel via room exits, but rather warps through the rooms sequentially in the order they’re listed in the code, skipping any that are sacred or non-land.


As of libpng 1.6.0, a so-called "simplified API" was added, which does not use setjmp/longjmp. A while back I had a C project using the old API, and I converted it to C++, and the interaction of setjmp/longjmp with exceptions was giving me headaches. I switched to the simplified API, and it was a breeze. So much less code, and no hacky C "exceptions". If you can require libpng 1.6 or newer, it's worth looking at the simplified API, if it supports your needs.

It's described here: http://www.libpng.org/pub/png/libpng-manual.txt


> There is no reader mode.

There is, but as far as I know it's not something you can manually toggle. On sites which Vivaldi deems can be shown in reader mode, you're prompted to switch to it. I don't know what criteria it uses to determine that.

It has to be enabled: Settings→Accessibility→Simplified view for web pages


Thanks, that's pretty much equivalent to reader mode then. Though for some reason you cannot switch to other tabs while viewing one page on simplified mode? Weird.


Am I correct in saying that functions written in C do not get pre-empted like Erlang functions? If that is true, you could write computationally intense code in C within a BEAM app.

They cannot be pre-empted, but they must also return quickly, or risk causing lots of problems (see https://erlang.org/doc/man/erl_nif.html for slightly more detail on what this means). As such you can't just write some big function in C to do number crunching.

The NIF documentation mentions some ways around the problem, but all of them take some effort, or have tradeoffs of some sort. I was really excited when “dirty” NIFs were introduced, which can tell the BEAM that they'll run for a while, thus appearing to allow for long-running NIFs with no extra work other than setting a flag. However, it turns out that the BEAM just spins up N threads for scheduling dirty NIFs, and if you have too many such NIFs, too bad, some won't get scheduled till the others have completed. In retrospect it should have been obvious that there couldn't be a silver bullet for this problem, because it really isn't easy.

Erlang may well be my favorite language, but as you imply, it's just not going to be the right approach for everything: in my experience, it's absolutely fantastic in its niche but that niche is quite small. I think that's fine, though. For me, where Erlang does make sense, its concurrency approach makes it unbeatable, and I'll live with the performance tradeoffs. It turns out that basically all the NIFs I've had to write were just to gain access to functionality that Erlang doesn't expose (e.g. network namespaces on Linux, which are supported now, but weren't when I needed them).


I prefer it because it means less fiddling with tabs/the back button. Plus you can collapse comments.

But by default it's very difficult on my eyes due to the low contrast, so to make it at all usable I make use of a Stylish script to fix the text color.


I am the author of the this. Would you mind sharing a stylish script or screenshot. Love to see how it looks after your changes.


C++14:

  auto p = std::make_unique<int>(5);
  auto q = std::move(p);
  std::cout << *p << std::endl;
Segfault using the “safe” C++ features. I'm a fan of modern C++, but it's not safe (in a Rust sense) even if you stick to C++11/C++14 features.


For comparison, the same thing in Rust:

  fn main() {
      let p = Box::new(5);
      let q = p;
      println!("{}", p);
  }

gives, upon compiling:

    error: use of moved value: `p` [E0382]
    println!("{}", p);
                   ^
    note: in this expansion of format_args!
    note: in this expansion of print! (defined in <std macros>)
    note: in this expansion of println! (defined in <std macros>)
    help: run `rustc --explain E0382` to see a detailed explanation
    note: `p` moved here because it has type `Box<i32>`, which is moved
    by default
    let q = p;
        ^
    help: if you would like to borrow the value instead, use a `ref`
    binding as shown:
    let ref q = p;
    error: aborting due to previous error
Running `rustc --explain E0382` or going to https://doc.rust-lang.org/nightly/error-index.html#E0382 gives you an extended error message as well.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: