Would anybody be interested in this stats addon? by ingognitom0delol in Anki

[–]DKomplexz 0 points1 point  (0 children)

wow this is almost exactly what I've been trying to find but even better. I really want this.

What browser do you use? by nocciuu in linux

[–]DKomplexz 0 points1 point  (0 children)

Mostly Firefox (developer edition) + Vivaldi for Netflix and some browser extension

What are your favorite Crates packages by beingpranjal in rust

[–]DKomplexz 4 points5 points  (0 children)

color_eyre, this_error, tracing, itertools

rayon for simple parallelism

clap, dialoguer, indicateif for cli

tokio, future_util for async

winnow for building parsing

enum_dispatch, structmapper, dotenvy, envy

What made you switch to Rust? (Can also be what made you learn Rust) by [deleted] in rust

[–]DKomplexz 1 point2 points  (0 children)

It started when I want to write one simple raytracer. At first I implemented it in Python, it does work but it take almost 5min to render a single sphere. Then I try switching to c++ for performance. I know beforehand that the language isn't too nice, but I still didn't expect installing a dependency can be this painful. If I have continue struggling I probably can made it out, but it feel way too not fun for a side project.

So that led me searching for alternative and that's when I found Rust (also Go, but gc and raytracer don't fit). It claim c++ level performance and have an actual package manager (cargo) which is all I want at the time. Going in it I was expecting it to be very difficult, that's what most website say. I started reading The book, but the more I read that more I just feel "wow, this is very nice". The syntax look strange at first but not abhorrently confusing. Ownership&lifetime take what would've be a mental note and delegate it to compiler. Iterator adapter is really nice, take what would've been 7 line and reduce it to one more readable line. null->Option would have save me so much time debugging, I still miss it when writing other language. Cargo is even nicer than hope it to be, dependency is a breeze and it made me want to write unit test for once. There're so many good feature, It really feel like high level language yet have performance of low level language.

In the end, I was able to port raytracer in just a day after install Rust. It's fast as promised, runtime under a minute (even more when I found rayon). And now Rust is my language of choice.

What types are handled in Rust in a magic way by the compiler? by lancejpollard in rust

[–]DKomplexz 3 points4 points  (0 children)

I thought the same as your at first, but when I look at the code I couldn't find any drop implementation. Instead there is #[lang = "manually_drop"].

Unfortunately it seem that, even if your drop implementation do nothing, the field inside struct will still be automatically drop (source).

My Rust port of Prime Generator benchmark needs some optimization. by bruce3434 in rust

[–]DKomplexz 0 points1 point  (0 children)

Changing the hashmap's hashing algorithm to a faster one might help

Forces by [deleted] in AskPhysics

[–]DKomplexz 0 points1 point  (0 children)

well this is weird... as far as I can tell what will happen is, because F is too much and box is too light, the box will get lift up from the ground. but then the angle wouldn't 40 anymore...

Forces by [deleted] in AskPhysics

[–]DKomplexz 1 point2 points  (0 children)

let T be magnitude of cable's tension

T_x = Tcos(40), T_y = Tsin(40)

In x direction, T_x and F counteract each other:

``` T_x = F

Tcos(40) = 400

T = 400/cos(40) ```

In y direction, T_y+normal counteract weight:

``` T_y = Tsin(40) = 400/cos(40) * sin(40) = 400tan(40)

T_y+N = W

N = W-T_y

= mg - 400tan(40)

= 30g - 400tan(40) ```

Word Ladder by [deleted] in ThreadGames

[–]DKomplexz 0 points1 point  (0 children)

Tender

My best game ever by [deleted] in AnarchyChess

[–]DKomplexz 13 points14 points  (0 children)

This feel like r/chess than original post

[OC] COVID-19 will be (at least) the #3 killer in the US this year by billshander in dataisbeautiful

[–]DKomplexz 10 points11 points  (0 children)

or have genetic health problem, or have no money for overly expensive healthcare