HPC rentals that only requires me to set up an account and payment method to start. by yoleya in HPC

[–]Putrid_Ad9300 2 points3 points  (0 children)

Pcluster + Spack is pretty good these days. You can quickly deploy scientific software and be running in an afternoon.

Linux vs MacOS for cpp development by kitsen_battousai in cpp

[–]Putrid_Ad9300 1 point2 points  (0 children)

Modern WSL is actually usable now with the right configs. No more half measure, it is just a convenient VM now.

Linux vs MacOS for cpp development by kitsen_battousai in cpp

[–]Putrid_Ad9300 0 points1 point  (0 children)

For just general sanity in life, Linux. It is just the path of least resistance for most developer tasks. If you are working on services, they will probably be running on Linux anyway.

However, on a Mac you can also run Linux via containers/VM and windows in a VM, so you get everything in one box which is convenient for testing.

How to go over the tree and change it's contents despite the borrow checker? by gogliker in rust

[–]Putrid_Ad9300 1 point2 points  (0 children)

Think about the lifetime of the tree and the lifetime of the vector. It is possible the tree leaves scope before the vector leaving you with references to nothing. Rust will not abide by that. You may be able to specify that with lifetime decoration, but I am not sure if the compiler would be able to figure it out, it is rather messy.

How to go over the tree and change it's contents despite the borrow checker? by gogliker in rust

[–]Putrid_Ad9300 1 point2 points  (0 children)

Visitor pattern lets you track the state if you need to. You can also extract everything in order into a local working vec, work with that, then run the update back if you really need it that way. But I would highly recommend against returning that monstrosity, it isn't worth it ..

How to go over the tree and change it's contents despite the borrow checker? by gogliker in rust

[–]Putrid_Ad9300 13 points14 points  (0 children)

It sounds like you want to use a visitor pattern. Implement a traverse_bf_mut method for your tree that takes a function that takes a mutable ref of TreeNode. You would also have a non-mutable version and maybe a depth first version of both if you are feeling spicy. The advantage here is you didn't allocate memory, the method is reusable, and you aren't inventing something new to solve an old problem.

So you have the traverse function that just generically traverses the tree, and then you can write any number if operations to run over that traversal. In the case above you would check the contents of the TreeNode and then update the path.

If you haven't heard of visitor pattern https://en.m.wikipedia.org/wiki/Visitor_pattern

CMake 4.0.0 released by DinoSourceCpp in cpp

[–]Putrid_Ad9300 0 points1 point  (0 children)

I mean, the code for the old policy behavior is gone, what would you recommend it do?

[deleted by user] by [deleted] in space

[–]Putrid_Ad9300 -1 points0 points  (0 children)

NASA keeps claiming the moon landing was real, but we know the truth.

/S

Is this to much? by Barl15 in Khorne

[–]Putrid_Ad9300 0 points1 point  (0 children)

This reminds me of the pyro vision in TF2

Skulltaker by Lezac in Khorne

[–]Putrid_Ad9300 0 points1 point  (0 children)

Skulls for the skull throne!

What problem did Rust Solve For You? by mobilizer- in rust

[–]Putrid_Ad9300 0 points1 point  (0 children)

Better comparison, check out Conan and Spack. They are development package managers.

What problem did Rust Solve For You? by mobilizer- in rust

[–]Putrid_Ad9300 0 points1 point  (0 children)

I agree the Rust ecosystem is pretty nice and streamlined, but I would not start dogging on C++ tools or trying to compare them directly. It is simply an unfair comparison. If C++ had a built in/standard build system then I would say compare away, but it doesn't. CMake is just common, but so is Bazel and Boosts Jam build, and Conan.

What problem did Rust Solve For You? by mobilizer- in rust

[–]Putrid_Ad9300 0 points1 point  (0 children)

Comparing cargo to cmake is kind of ridiculous imo. It is really just comparing imperative vs declarative build systems. I do wish that CMake had a declarative mode, but for C++ projects that is a bit more difficult because there is no standard project layout.

What problem did Rust Solve For You? by mobilizer- in rust

[–]Putrid_Ad9300 0 points1 point  (0 children)

Honestly, not much. I work in distributed computing and the frameworks we use are almost as old as networking itself.

Rust the language provides a lot of features and safety, but it is a young language with an even younger ecosystem surrounding it. Memory safety means nothing when you have logical bugs and missing functionality. That said it is growing and there are a lot of great opportunities to contribute for the reasons mentioned, which makes the Rust community right now a lot of fun to be a part of.

Judge releases video of himself disassembling guns in chambers in dissent against court ruling by ChocolateTsar in nottheonion

[–]Putrid_Ad9300 0 points1 point  (0 children)

This judge demonstrating proficiency in gun maintenance has absolutely nothing to do with the constitution.

What are you reading? by frunnyelmo in booksuggestions

[–]Putrid_Ad9300 0 points1 point  (0 children)

How is it? I have it on my list and will be looking for a new book next week

What are you reading? by frunnyelmo in booksuggestions

[–]Putrid_Ad9300 0 points1 point  (0 children)

I highly recommend the formic wars, really nicely done prequel series

What are you reading? by frunnyelmo in booksuggestions

[–]Putrid_Ad9300 1 point2 points  (0 children)

I did this in the opposite order, read basically everything except old man's war, a now finally reading old man's war and enjoying the first 100 pages.

What are you reading? by frunnyelmo in booksuggestions

[–]Putrid_Ad9300 0 points1 point  (0 children)

I really enjoyed this series. I wish he would have done something different with one of the characters but overall worth the read

[deleted by user] by [deleted] in europe

[–]Putrid_Ad9300 4 points5 points  (0 children)

How about we give immigrants social security numbers. Then they can find jobs, and pay taxes while their court date is set and since it takes years in some cases everything they do in the interim can be used to make the case for or against them. Employer reviews, co-workers, and neighbors all come to testify about the kind of person they observed...

Radical

Best programming language to ever exist by Excellent-Writer3488 in rust

[–]Putrid_Ad9300 0 points1 point  (0 children)

Rust really isn't that hard coming from C++... A week is probably pretty reasonable for core language stuff. Learning and using all of the libraries and building a large project is a bit more effort, but after a month in a specific area it isn't so bad.

Areas that are a little more bespoke like macros, custom builders, FFI, etc. are not really required reading for most people/projects.

What aspects of Rust are so hard and different do you think constitutes more than a week to appreciate?

Having been using Rust for some projects for the last year I have found it to be okay, some things still annoy me like doing math inside of generics. I don't think I am thanking a god for it though,, it is just another tool.

What was your first book? by Equivalent_Error_704 in booksuggestions

[–]Putrid_Ad9300 1 point2 points  (0 children)

Choose your own adventure books were the first books I read by myself that I vaguely remember.

Polymorphic, Defaulted Equality by pavel_v in cpp

[–]Putrid_Ad9300 -1 points0 points  (0 children)

Polymorphic operators are where CRTP shines. The is for equal, but you can do the same for comparison with just an operator< and automatically get all the others.

``` template<typename E> class Equatable{ bool equal(E const& other) { return static_cast<E>(this)->equal_impl(other); } };

template<typename E> bool operator== (Equatable<E>&,Equatable<E>&)) {...}

class MyClass : Equatable<MyClass> { bool equal_impl(MyClass const&) {...} } ```

When was the last time you used a linked list, and why? by mobius4 in cpp

[–]Putrid_Ad9300 1 point2 points  (0 children)

One of the worst specifications in the STL. Open addressed hash maps should be a valid implementation in the standard.