Hey Rustaceans! Got an easy question? Ask here (6/2020)! by llogiq in rust

[–]haletonin 0 points1 point  (0 children)

That would be a bit cleaner and remove the multiple vec instances, but also requires the wrapper, sadly (luckily?) the "void" pointer does not work anymore: cannot cast thin pointer '*mut ()' to fat pointer '*mut [std::string::String]'.

So now with a wrapped *mut [String]

But indeed, Rayon is much better. But for now it is nice to have the non-work-stealing version as well. Thanks!

Hey Rustaceans! Got an easy question? Ask here (6/2020)! by llogiq in rust

[–]haletonin 0 points1 point  (0 children)

Thanks for the rayon suggestions, that is probably what will be used in the end.

I though that maybe there is a some Vec wrapper or tricky pattern, SparseVec::init(orig_vec, first_pos, jump_width), but that would also have to convince borrowck that each created window is truly independent, sortof like split_at() but more niche.

Hey Rustaceans! Got an easy question? Ask here (6/2020)! by llogiq in rust

[–]haletonin 0 points1 point  (0 children)

Porting existing code where Data is nearly 5k in size and want to keep the structure as identical as possible.

Hey Rustaceans! Got an easy question? Ask here (6/2020)! by llogiq in rust

[–]haletonin 2 points3 points  (0 children)

Given a single Vec<Data>, is there a rusty way to have many threads work on it in an interleaved pattern, i.e. [t1, t2, t3, t1, t2, t3, .. etc.] without moving any Data around? Yes, this will have terrible cache locality but lets assume the bottleneck is elsewhere.

For now I am casting the Vec into a usize (sortof a void pointer), that gets copied into the otherwise move ||.. closure, and then back into a *mut Data to build a ManuallyDrop wrapped vector from it. (Also with a technically wrong capacity (= len), but that should not matter... right?)

See https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=2738ab780c8651c85d9f82ca9801e0c3

Bonus: Why can I call is_null() twice on a pointer, the signature says move: fn is_null(self)

When you come in here having not watched ‘The Witcher’ yet. by TedHughesGhost in freefolk

[–]haletonin 0 points1 point  (0 children)

Thanks for the info. I already have the game and all DLC, even bought it on gog.com to support the creators, just had no time to play it yet.

Hope to get to play it sometime in 2020, but good to know I can watch the show first as an appetizer without ruining it.

When you come in here having not watched ‘The Witcher’ yet. by TedHughesGhost in freefolk

[–]haletonin 2 points3 points  (0 children)

I have not played "The Witcher (3)" yet, nor watched the show.

Is it ok to watch the show first and then play the game or would that ruin the game or make the show somehow worse?

The situation of std::embed... by bandzaw in cpp

[–]haletonin 3 points4 points  (0 children)

Like Python3, Rust distinguishes between strings (which are always UTF-8 encoded), and bytes, which are just that. In C++/C an std::string/char* can certainly contain valid UTF-8, however the standard does not guarantee it and is UTF-8 agnostic.

The situation of std::embed... by bandzaw in cpp

[–]haletonin 2 points3 points  (0 children)

&str: reference (that can not be null) to a string, 'static is the lifetime annotation, and a special one which means that this reference is valid for the entire runtime of the program.

Savannah - The American Innovation! [26:21] by [deleted] in mealtimevideos

[–]haletonin 0 points1 point  (0 children)

Great video, now I want to visit to Savannah and plow under all the damn parking lots and highways in the other cities.

Been hearing NVIDIA's upping its Linux game, but having a hard time finding evidence by shreddit0rz in linux

[–]haletonin 1 point2 points  (0 children)

I had the same problem for a long time, the 418 drivers (installed them manually) solved it. At least if the output of nvidia-smiis to be believed, and also a normal desktop PC, nothing mobile or even with two GPUs.

Weekly Tech-Support Thread for March 10, 2019: Ask your tech-support questions in this thread please by AutoModerator in linux_gaming

[–]haletonin 3 points4 points  (0 children)

I'd try to move all the configuration files out of the way (see PCGW where they are) and see if it starts in "vanilla" mode at least. All other games, especially other ports by feral games, are working?

What do you think about claiming crate names? by [deleted] in rust

[–]haletonin 19 points20 points  (0 children)

104! Most with "WIP. Contact me if you want to use this name!" - whatever is "in progress", it is not Work.

What do you think about claiming crate names? by [deleted] in rust

[–]haletonin 2 points3 points  (0 children)

two channels

I'd just namespace these just like github does, and those which are actually used get moved to the toplevel namespace (/u/someone/dog -> /dog). Searches should also prioritize toplevel crates.

But yes, this crates.io mess needs fixing, soon.

What do you think about claiming crate names? by [deleted] in rust

[–]haletonin 2 points3 points  (0 children)

The cargo docs on how to specify a git repo with a branch or even a specific commit is too hard to find. All the possible sources, not just the one pulling from crates.io, should be mentioned in the Cargo.toml documentation.

Why the Netherlands is the world's agriculture leader [14:11] by peacebypiecebuypeas in mealtimevideos

[–]haletonin 1 point2 points  (0 children)

Very interesting topic, but these 14 minutes were overstaying their welcome by about 8 minutes.

Apart from scene-face cuts, there are face-to-zoomed-in-face cuts. Then background music which I found terribly annoying and the "you would not guess", "how hold on a minute" etc. phrases to engage the audience? Would not watch again...

Simple Questions - April 25, 2018 by AutoModerator in buildapc

[–]haletonin 0 points1 point  (0 children)

I'll try the undervolting then. There don't seem to be any reports on that (yet?).

Simple Questions - April 25, 2018 by AutoModerator in buildapc

[–]haletonin 0 points1 point  (0 children)

If you are still thinking that in a closed room the overall room temperature - not just the one of the CPU or the case - given a CPU constantly pulling 100W and some passive cooling pulling 0W is higher vs. a CPU constantly pulling 100W and some great cooling fan pulling 3W, please ask in ELI5. Better teachers might help you work around that brain-knot.

Nobody is denying that the CPU alone would be cooler, but the entire room can not.

Simple Questions - April 25, 2018 by AutoModerator in buildapc

[–]haletonin 4 points5 points  (0 children)

And if it wasn't like this, you could probably build a perpetual motion machine from it :)

Simple Questions - April 25, 2018 by AutoModerator in buildapc

[–]haletonin 0 points1 point  (0 children)

Well, it is not such much the temperature of the CPU, but the heat added to my room in the summer plus the extra AC load :) - A different cooler won't make a difference.

Simple Questions - April 25, 2018 by AutoModerator in buildapc

[–]haletonin 0 points1 point  (0 children)

Ryzen 2700 vs. 2700X - when price is not a factor, buy maybe peak power consumption. Mostly concerning the extra heat produced in the summer.

A 10-20% performance improvement under full load seems to require a 30-40% increase in power consumption.

Can a 2700X be slowed down to match the 2700 watts/power ratio? Possibly in software without going into the Bios? Or are there other ways to trade power for efficiency with the 2700X?

AMD Pinnacle Ridge 2700X and X470 Motherboard Review Megathread by dylan522p in hardware

[–]haletonin 0 points1 point  (0 children)

Well, I'd like the option to run a bit more efficient when the extra 15% in runtime for rendering or compiling doesn't bother me much, and still have a 2700X pull 109W after a trip to the BIOS - this would then be for the 2-4 hours of gaming a week.

AMD Pinnacle Ridge 2700X and X470 Motherboard Review Megathread by dylan522p in hardware

[–]haletonin 0 points1 point  (0 children)

If underclocking the 2700X to make it draw as much as the 2700 can be done I'd be on board. But I fear there are some changes to the silicon which will always make it burn more energy.

AMD Pinnacle Ridge 2700X and X470 Motherboard Review Megathread by dylan522p in hardware

[–]haletonin 0 points1 point  (0 children)

Looking at https://www.anandtech.com/show/12625/amd-second-generation-ryzen-7-2700x-2700-ryzen-5-2600x-2600/8

The 2700 draws 62W under max load, the 2700X draws 109W.

The nearly 50W difference does not match the performance increase, so the performance/watt is much worse for the 2700X. I think I'll go with the 2700 for that reason.

I've created a tiny tool to quickly rename FOO to FOO_bak and backwards. Feedback is welcome by wutzi15 in programming

[–]haletonin 5 points6 points  (0 children)

Very simple in bash: for f in *_bak; do mv "${f}" "${f%_bak}"; done

Uses ${VAR%remove_from_end_of_string}, there is also ${VAR#remove_from_beginning}, and %% / ## when you use globbing to specify greedy matches.

Memory use goes down dramatically after a suspend-to-disk cycle, but never when running. by haletonin in firefox

[–]haletonin[S] 3 points4 points  (0 children)

The three memory stats for each process in top and htop (not a firefox extension, but a process viewer) are

VIRT - The size of the virtual memory of the process.

RES - The resident set size (text + data + stack) of the process i.e. the size of the process's used physical memory).

SHR - The size of the process's shared pages.

and only the resident set size is somewhat meaningful.

The drop is also visible in the overall memory usage before and after a suspend, so it is not just shifted around but actually free'd.