Skip Navigation

Posts
4
Comments
58
Joined
2 yr. ago

  • You would have to either mutate the original vector or clone it, yes. If you really want to iterate through an immutable Vec with only constant memory usage, then you probably can't get around O(n^2) runtime, but maybe there is some time-memory-tradeoff where a small memory usage can get some time reduction.

  • Maybe a heap data structure is what you're looking for. Depending on the usecase you might have to first turn an unsorted Vec into a heap (runtime in O(n), which is still faster than fully sorting it), at that point you can both insert new elements and remove the minimum element within a time in O(log n).

  • Number only, get out of here with superfluous symbols. I don't need The Status Bar: Illustrated Edition.

  • I don't disagree with the position of the company as outlined in this statement and their neutral position. But by being a customer of the company I would also be paying the co-founder with his weird views that are definitely not neutral, and that is still worth avoiding. And maybe his individual opinions are actually more representative of the companies values because they aren't filtered through a PR team. As long as they are not the only good VPN provider, I don't want to support this.

  • The reason is to avoid favoring any one of the four official languages by deriving the code from a neutral, fifth language.

  • There is the map_err method on Result which simplifies this case. But yes, anyhow is still easier if you don't care that much about the error contents.

  • Can you verify this? Maybe we should require Debian contributors to prove they are adults. /s

  • Truffle Pizza can be very good and is relatively common in Italy. I couldn't tell you how to make it, but you can certainly find recipes for it.

  • I'm living without alcohol and caffeine (except in tea and chocolate) and really never have the feeling of missing anything. Can recommend.

  • Deleted

    Permanently Deleted

    Jump
  • Nope, never use it. I know how to write code myself.

  • But you can just as well make an exception to allow errors when -e is enabled with something like command || true, or even some warning message.

    I feel like, while it does occur, allowing errors like this is more unusual than stopping the script in an error, so it's good to explicitly mark this case, therefore -e is still a reasonable default in most cases.

  • That's just a different proprietary app though.

  • That's a very good background and should be more than enough to understand the rust book. But if you do eventually want to go more into the theoretical background, I recommend looking towards type theory, specifically Algebraic Data Types (ADT) which Rust uses a lot, and Polymorphism (Generics). But it's certainly not required to write good Rust code.

  • It's wild that one of the problems is that the kernel doesn't use floating point numbers.

  • Technology @beehaw.org

    How Big Tech Killed Online Debate

    www.currentaffairs.org /news/how-big-tech-killed-online-debate
  • Unfortunately not real, I would have loved to read into some of them.

  • $35

    Jump
  • CIДАЯETTES

  • Right, which occurs in particular when dealing with graphs, which are basically matrices and usually sparse. Large graphs are what I used this format for, however I also needed edge weights, so the first column was still required for that.

  • The CSR (compressed sparse row) format is a very simple but efficient way of storing sparse matrices, meaning matrices with a large amount of zero entries, which should not all occupy memory. It has three arrays: one holds all non-zero entries in order, read row by row, the next array contains the column indices of each non-zero element (and therefore has the same length as the first array), the third array indices into the first array for the first element of each row, so we can tell where a new row starts.

    On sparse matrices it has optimal memory efficiency and fast lookups, the main downside is that adding or removing elements from the matrix requires shifting all three arrays, so it is mostly useful for immutable data.

  • In my opinion yes, Debian is the best choice for server machines, especially on the homelab scale.

  • How does this even work? I get the redirection part, but how is the command executed in a detached state?

  • Linux @programming.dev

    The EU wants to cut funding for Free Software. Tell them why they should reconsider.

    fsfe.org /news/2024/news-20240911-02.html
  • Opensource @programming.dev

    The EU wants to cut funding for Free Software. Tell them why they should reconsider.

    fsfe.org /news/2024/news-20240911-02.html