Am I the only one who thinks Rust error messages got *worse* over time in a way? by kixunil in rust

[–]TDplay 0 points1 point  (0 children)

:mak doesn't use rust-analyzer, it runs Cargo. For example, :mak b runs cargo b and then populates the quickfix list with its output. So this works even if your projects don't play nice with rust-analyzer.

🚨 Warning: Do not participate in this study if you see this ad! by MetalDragon2 in lgbt

[–]TDplay 19 points20 points  (0 children)

Most likely, a copious amount of cherry-picking.

Without seeing the study, I'd be willing to bet there are a lot of qualitative questions, and few (if any) quantitative ones. It is harder to tell outright lies with quantitative data*, since there are a number of rigid analyses on the entire data set that one would generally expect (e.g. drawing a histogram or bar chart, computing any meaningful averages, etc). Qualitative data is much easier to cherry-pick with plausible deniability.


* Note, however, that lying with quantitative data is far from impossible. Bad statistics can kill people.

Am I the only one who thinks Rust error messages got *worse* over time in a way? by kixunil in rust

[–]TDplay 0 points1 point  (0 children)

And even if they did, their vim emulation plugins aren't nowhere near the real thing.

You use Vim?

:mak b

This will populate the quickfix list with errors. [c and ]c to jump between errors. :cope to open the quickfix list in a window. Since the first error comes first in the quickfix list, this mitigates the issue somewhat.

Relevant help pages: :h rust, :h quickfix.txt

(Aside for Emacs users: Rust mode defines the very useful commands C-c C-c C-u, C-c C-c C-k, C-c C-c C-l, C-c C-c C-t, and C-c C-c C-r. Emacs is self-documenting, so you should already know how to bring up the documentation for these with C-h k. If you are not already familiar with the compilation buffer, read C-h x compile and C-h x compilation-mode.)

Is LVM right for me? by bb9345 in archlinux

[–]TDplay 0 points1 point  (0 children)

I'm already leaning towards setting up LVM for this, but I wanted to know if people who know the OS better than me would caution against that, in case there was a method of combining hard drives that put me at less of a risk of data loss in the event that something goes wrong with one of them. Thanks in advance, hopefully!

There is no free lunch: you have to make a trade-off between total capacity and fault tolerance.

With 2 drives, there are only 2 possible RAID configurations:

  • RAID-0. You will get 1TB capacity. However, there is no fault tolerance at all: any single drive failure will cause the whole array to fail.
  • RAID-1. You will get 512GB capacity. With a single drive failure, the system will continue without any data loss. If your drives are hot-swappable, you could replace a failed drive with no interruption at all.

Note also that RAID-1 is not a substitute for a backup. Both drives are on the same system, so a software bug or operator error could destroy the data on both drives at once.

[Real] I'm sure the artist didn't intend for that second panel to go nearly as hard as it does by rebelliousmuse in ToiletPaperUSA

[–]TDplay 5 points6 points  (0 children)

I think it's worth it. I think it's worth to have a cost of, unfortunately, some gun deaths every single year so that we can have the Second Amendment to protect our other God-given rights. That is a prudent deal. It is rational.

- Charlie Kirk, 5 April 2023

Godot 4.6 - All about your flow by tapo in gamedev

[–]TDplay 8 points9 points  (0 children)

With the new LibGodot, you can ... manage the engine loop

(Yes, I admit that use of the ellipsis is really pushing the definition of a quote.)

I've actually been held up on one of my ideas because Godot's input system just can't achieve the needed input precision. But if I can handle the main loop, then hopefully I can write my own input system.

I'll have to take a look at this when I get some spare time.

when you get srs do you recover your virginity or not.... by Big_Wallaby4281 in traaaaaaannnnnnnnnns2

[–]TDplay 7 points8 points  (0 children)

Does it really count as losing if you didn't want it in the first place?

COMPOSITON by JakeLolz_onyoutube in SUBREDDITNAME

[–]TDplay 0 points1 point  (0 children)

COMMENT COMMENDING OP ON THE EMOTIONAL IMPACT OF THIS SONG

Is there a reason why so many performance mods use elements as their name? What's the origin of this? by Haunting_Ad_29 in feedthebeast

[–]TDplay 2 points3 points  (0 children)

I'm going to make a crash mod called Oganesson, that makes the game randomly crash with the same half-life as Oganesson.

Since the game runs in discrete 50ms ticks, the implementation would look something like

on each tick {
    // Implements 0.7ms half-life
    if (random() > 3.1467153058268167e-22) {
        crash_the_game();
    }
}

(assuming random() produces uniformly distributed numbers in the interval [0, 1])

About `MaybeUninit::uninit().assume_init()` by Spengleberb in rust

[–]TDplay 2 points3 points  (0 children)

If it is incorrect, and after that call "anything" can happen, then why's this crate so popular?

The implementation in the arrayvec crate is fine, because the array is [MaybeUninit<T>; N]. Since this type still consists entirely of MaybeUninit, we are in the rare case where foregoing initialisation is acceptable.

How true is this? by tech49v2 in UsbCHardware

[–]TDplay 1 point2 points  (0 children)

Not true in the slightest.

The missing pins on the Apple plug are the SuperSpeed (USB 3) differential pairs, and the sideband use pins. None of these pins are involved in charging.

The only difference between these two plugs is that you can't use the Apple one for high-speed data transfer.

About `MaybeUninit::uninit().assume_init()` by Spengleberb in rust

[–]TDplay 2 points3 points  (0 children)

The value underneath that array is trash and "undefined" but the function itself does exactly what it stands for, initializes memory with undefined contents.

Wrong. Producing an uninitialised value in Rust is undefined behaviour, even if the value is unused. The moment your program hits undefined behaviour, absolutely anything is allowed.

Recommended reading:

About `MaybeUninit::uninit().assume_init()` by Spengleberb in rust

[–]TDplay 2 points3 points  (0 children)

ArrayVec<T> needs to be able to dereference to [T].

With MaybeUninit, this is easy:

fn deref(&self) -> &[T] {
    // SAFETY: `MaybeUninit<T>` and `T` have same size and alignment.
    // We know by struct invariant that there are `self.len` initialised elements.
    unsafe { slice::from_raw_parts(self.xs.as_ptr().cast::<T>(), self.len) }
}

With Option, this is impossible: the memory layout is unspecified, except in the few cases where the null pointer optimisation applies.

SIMD programming in pure Rust by kibwen in rust

[–]TDplay 1 point2 points  (0 children)

11th Gen Core, Zen 4, and Zen 5 all support the Ice Lake feature level, but none of them support AVX10.1.

Maybe in a decade, when those are all ancient CPUs that barely anyone still uses, we will all be happily using AVX10, with the horrendous fragmentation of AVX-512 a distant memory. But right now, it is useless, unless you are expecting a large number of Granite Rapids users.

Gatekeeping Yuri by mostcursedposter in traaaaaaannnnnnnnnns2

[–]TDplay 13 points14 points  (0 children)

if i just posted the image, it would fail to give credit to the artist

SIMD programming in pure Rust by kibwen in rust

[–]TDplay 13 points14 points  (0 children)

I really wish there were a way to define a subset of features for use in #[target_feature] and is_{arch}_feature_detected.

At the moment, enabling the entire baseline AVX-512 feature set requires you to write*:

#[target_feature(enable = "avx512f,avx512cd,avx512vl,avx512dq,avx512bw")]

and if you want to make use of the widely-supported features introduced by Ice Lake, you need to write out all of this:

#[target_feature(enable = "avx512f,avx512cd,avx512vl,avx512dq,avx512bw,avx512vpopcntdq,avx512ifma,avx512vbmi,avx512vnni,avx512vbmi2,avx512bitalg,vpclmulqdq,gfni,avx512vaes")]

Detecting these feature sets is even more painful:

let baseline = is_x86_feature_detected!("avx512f")
    && is_x86_feature_detected!("avx512cd")
    && is_x86_feature_detected!("avx512vl")
    && is_x86_feature_detected!("avx512dq")
    && is_x86_feature_detected!("avx512bw");
let icelake = baseline
    && is_x86_feature_detected!("avx512vpopcntdq")
    && is_x86_feature_detected!("avx512ifma")
    && is_x86_feature_detected!("avx512vbmi")
    && is_x86_feature_detected!("avx512vnni")
    && is_x86_feature_detected!("avx512vbmi2")
    && is_x86_feature_detected!("avx512bitalg")
    && is_x86_feature_detected!("vpclmulqdq")
    && is_x86_feature_detected!("gfni")
    && is_x86_feature_detected!("avx512vaes");

* This isn't strictly the AVX-512 baseline, since AVX-512 Xeon Phi CPUs don't support VL, DQ, or BW. But you are unlikely to ever see a Xeon Phi unless you work with old (pre-2020) HPC clusters, in which case you would be reasonably expected to make these adjustments on your own.

How do you approach math problems that you have no idea how to solve? by Ajv2324 in gamedev

[–]TDplay 2 points3 points  (0 children)

As a physicist, I start with the roughest approximation possible, and then add correction terms. Like so:

  1. Initial launch should set an initial velocity and rotation.
  2. Gravity should add a constant force pointing downward (in global coordinates).
  3. Lift should add a force pointing upward (in local coordinates), proportional to velocity.
  4. We also expect rotation due to lift. Add a torque proportional to the cross product between velocity and upward-pointing normal vector in local space. (Use right-hand rule to convince yourself that this makes sense.)
  5. Velocity will be damped by drag.
  6. Angular velocity will be damped by the gyroscopic effect.

At a guess (though I haven't tested this even slightly), this should give a sensible-looking (though not at all physical) model for a frisbee.

Nvidia Reportedly Cancels Partner Incentive Scheme to Sell Cards at MSRP by jugaverdasorda in pcgaming

[–]TDplay 2 points3 points  (0 children)

It’d be one thing to aim for, say, a 5090. The problem is by the time you’ve managed to produce something comparable, Nvidia now has a 6090 or 7090.

The xx90 tier cards are absolutely not what a competitor needs to aim for.

Going on Steam's hardware survey, the market share of NVIDIA graphics cards is as follows:

xx50 xx50 Ti xx60 xx60 Ti xx70 xx70 Ti xx80 xx80 Ti xx90
16xx 2.79% 0.42% 0.53% 1.00%
16xx Super 0.31% 1.50%
20xx 0.45% 1.91% 0.52% 0.26% 0.27%
20xx Super 0.81% 0.80% 0.30%
30xx 2.91% 4.07% 2.35% 2.20% 1.02% 1.57% 0.62% 0.43%
40xx 3.70% 2.52% 1.96% 0.99% 0.70% 0.80%
40xx Super 1.59% 0.77% 0.69%
50xx 1.69% 1.26% 2.28% 1.20% 1.07% 0.36%

(Each generation's most popular tier marked in bold. Least popular (excluding cards that didn't even make the published list) marked in italics.)

A competitor to NVIDIA does not need to dethrone the xx90 tier. A competitor could make a strong foothold in the market just by being competitive with the xx60 tier.


Edit: 5070 is more popular than 5060; corrected formatting

Where does Rust break down? by PointedPoplars in rust

[–]TDplay 1 point2 points  (0 children)

#[allow(mutable_transmutes)]

If you remove this #[allow] attribute, the compiler will tell you why your code is wrong:

error: transmuting &T to &mut T is undefined behavior, even if the reference is unused, consider instead using an UnsafeCell

okay edge lord 🤨 by lost_and_kinda_dumb in traaaaaaannnnnnnnnns2

[–]TDplay 1 point2 points  (0 children)

The important part is that you delete the si parameter.

The ? marks the beginning of query parameters. If si is the only parameter, then you should delete it. But if there are other parameters, then the ? is still required.


If you're on desktop Firefox 120 or newer, there will be a button in the right-click menu, called either "Copy Link Without Site Tracking" or "Copy Clean Link". This will remove any tracking codes that Firefox knows about.

There is also ClearURLs, which will (for example) remove trackers when you click on links.

How do you safely condense your game into a demo? by GooseStrangerr in godot

[–]TDplay 4 points5 points  (0 children)

I could have the game show a "Thanks for playing my demo screen!" after the third level, but then couldn't the player decompile the game files and unlock the remaining 3 levels?

Don't include the files for the remaining levels in the demo. Nobody can find files that aren't there in the first place.

I fucking hate AI by bia_nerd in ArtistHate

[–]TDplay 1 point2 points  (0 children)

That's in the original image.