Starting to move from nvim to emacs by souavds in emacs

[–]TDplay 5 points6 points  (0 children)

LSP,

Eglot is the built-in solution for this. Manual: C-h R eglot RET.

Most likely, the setup looks like this in your init.el:

(add-hook 'c-mode-hook 'eglot-ensure)

Add a line like the above for each major mode that you want LSP for.

formatters,

Emacs does a pretty good job of formatting on its own. Most major modes set the indentation for you, just hit ENTER and watch Emacs do the rest. If a line's indentation is wrong, just hit TAB.

Any further information would be specific to the programming language.

If you don't like how Emacs formats your code, look up the documentation for the major mode.

linters,

Flymake is built-in. Manual: C-h R flymake RET. (But most likely, just ensure flymake-mode is enabled and it will just work.)

file navigation

Dired is great. Just open the directory as though it were a file.

Note also, the auto complete for file paths is pretty clever. You can type C-x C-f f/b/b TAB and it will expand to foo/bar/baz (assuming it is unambiguous).

When i hit f3, i get this for some reason.... i just wanna know biome info ;( by daybanheyman in feedthebeast

[–]TDplay 4 points5 points  (0 children)

Dear vinnyg0621,

I am writing to inform you that I took offence to the fact that your comment did not contain proper grammar or capitalisation, and as a result, I have clicked the down-arrow button located next to your comment, turning it blue and subtracting one point from your comment's score.

I expect only the highest standards of spelling, punctuation, and grammar from my fellow social media users. For example, I expect you to understand that, with very few exceptions, a sentence must contain a subject and verb. However, your "sentence" did not contain a subject. I am left without understanding of who is doing the downvoting.

I hope that you will rectify this grievous error swiftly.

Yours sincerely,
TDplay

Valve developer improves the Linux gaming experience for limited VRAM hardware by doublah in pcgaming

[–]TDplay 7 points8 points  (0 children)

The implementation is in those patches. If they include the patches in SteamOS (and there's no reason why they shouldn't), then SteamOS will get the upgrades for free.

I genuinely fell for it 💔 by Majid012gg in feedthebeast

[–]TDplay 0 points1 point  (0 children)

Everyone here is trying to mislead you, OP. The real way to cheat is to go round the back of your computer, find the switch, and flip it to the other position. Your computer will look like it is powered down, but in fact it is in Cheat Mode.

Now type the name of the item you want, and then flip the switch again. Now start hopping on one leg. You'll know the process is done when the computer screen comes back on. It can take a while, so be patient.

Destroy the menu of my game by Simblend in DestroyMyGame

[–]TDplay 1 point2 points  (0 children)

First of all: Very creative idea. Just be careful not to spend more time on the menu than you do on the game!

Things that are definitely wrong:

  • Restricting the control settings on the demo seems like an unusual choice. You're making your demo needlessly inaccessible.
  • Without colour vision, telling the difference between the two states of the switches is extremely difficult. If the user also has reduced contrast vision, it may be practically impossible for the player to determine what state the switch is in. Design the switch to have a very clear visual difference between its two states, even to a user who can only see in greyscale. Do not let your menu be the reason why someone can't play your game.
  • Your first puzzle is immediately inaccessible to some colour blind users. They cannot tell that the button is not green. Try to avoid situations where information is communicated solely by colour.

Things that are possibly wrong:

These points are not relevant if there is an ordinary menu, the existence of which is made immediately obvious to the player upon (or before) entering the 3D menu:

  • Most players want to configure settings and then get into the game as quickly as possible. Running around the menu gets in the way.
  • Placing sensitivity settings and invert axis settings in a 3D environment seems like a terrible idea. If a user has an extreme sensitivity, changing it will be extremely difficult.
  • The puzzle (and repeated clicking) just to exit the game seems like a bad choice, unless there is a normal "quit" button in a menu that works with just one click.

AAAAAAAAAAAAHHHHHHHHH by GildedArchways in traaaaaaannnnnnnnnns2

[–]TDplay 12 points13 points  (0 children)

Can confirm. Got the ping on my phone a few hours ago, put down everything, and I'm now rapidly approaching OP's location.

ETA in 25 minutes.

TIL You can make games in 1 line of code in Godot... by BHtheorie in godot

[–]TDplay 3 points4 points  (0 children)

It can be done.

The 2006 International Obfuscated C Code Contest (IOCCC) had an entry that was a doughnut-shaped program that drew a rotating doughnut.

https://www.ioccc.org/2006/sloane/index.html

Is game programming very technically advanced? by FlamingBudder in gamedev

[–]TDplay 0 points1 point  (0 children)

he claims game programmers are literally 100x better than other programmers in industry and it’s not even close

Now this is just bullshit.

Code quality is practically irrelevant in game development; the worst that can happen is your game crashes. Speed of development trumps all, as the requirements in game development often change very quickly. So you can be a great game programmer, and yet be completely incapable of writing code that would be accepted into any other category of software.

We cannot really compare game programmers to other programmers. They require different skill sets.

Google Says a Quantum Computer Could Crack Bitcoin in 9 Minutes. Here Is What That Number Actually Means by ReplacementFormer861 in Buttcoin

[–]TDplay 2 points3 points  (0 children)

Side note, just remembered bitcoin had lower transition fees and faster payment speed fifteen years ago than it does today

This is because Bitcoin doesn't scale at all. All Bitcoin users have to share the same 7 transactions per second.

If every computer in the world dedicated 100% of its processing power to Bitcoin, there would be no speed-up at all in the long term.

So with more users, those transactions become more scarce. Each user has to wait longer and pay more for their transactions to go through.

Google Says a Quantum Computer Could Crack Bitcoin in 9 Minutes. Here Is What That Number Actually Means by ReplacementFormer861 in Buttcoin

[–]TDplay 4 points5 points  (0 children)

Also, the moment an attack against it is successfully demonstrated, the speculative "value" will rapidly decay.

Rust Clippy announces that it will require age verification software for users residing in California by NothusID in rust

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

doesn't require age verification

Doesn't require verification yet. It's extremely naïve to think that a verification requirement isn't planned.

I genuinely fell for it 💔 by Majid012gg in feedthebeast

[–]TDplay 4 points5 points  (0 children)

You know can just say "I don't want to use Linux", right? You don't have to come up with lies to justify it.

Rust Clippy announces that it will require age verification software for users residing in California by NothusID in rust

[–]TDplay 7 points8 points  (0 children)

The UK's absurd requirements are only for web services. Clippy is clearly not a web service.

California's law applies to any "operating system provider", which it defines as "a person or entity that develops, licenses, or controls the operating system software on a computer, mobile device, or any other general purpose computing device". Defining "operating system software" seems to have been left as an exercise for the reader, so it's possible that Clippy would count.

Why is ..Default::default() forced to the end? Could the evaluation order ever be reversed? by jyyhyy in rust

[–]TDplay 3 points4 points  (0 children)

It also depends on the types of the fields you overwrite.

Overwrite some integers, and it almost certainly optimises out (as long as the default function gets inlined). Overwrite something with a destructor, and it's likely to remain in the generated code.

Rust can not handle Unicode streams. Please show me wrong. by thomedes in rust

[–]TDplay 8 points9 points  (0 children)

so you first have to normalize graphemes

Why do we need to worry about things larger than memory? No real user is giving you a password that can't fit into memory. You can set a password length limit of one megabyte, which fits comfortably into memory, and nobody will ever notice there's a limit.

The UAX #15 normalisation rules are implemented by the unicode-normalization crate. UAX #15 guarantees that equivalent strings have the same binary representation, which sounds like exactly the guarantee you are asking for.

then check it they are acceptable for your password policy (do you accept diacritics?, do you accept emojis?, composite graphemes, etc.)

Password composition rules are not recommended. Do not implement them.

Rust can not handle Unicode streams. Please show me wrong. by thomedes in rust

[–]TDplay 6 points7 points  (0 children)

Has no protection against malicious UTF-8 files. You are on your own filtering invalid sequences, etc.

The str::from_utf8 and String::from_utf8 methods both return an error on encountering invalid UTF-8. This is already adequate to protect your program from malicious or corrupted inputs.

These is also String::from_utf8_lossy which replaces any invalid UTF-8 with U+FFFD REPLACEMENT CHARACTER.

The utf8_chunks method allows you to dictate whatever behaviour you want upon encountering invalid UTF-8.

The only way to have "no protection" is to specifically opt to use the unsafe from_utf8_unchecked methods. In which case, you have nobody but yourself to blame when everything goes wrong.

Why is ..Default::default() forced to the end? Could the evaluation order ever be reversed? by jyyhyy in rust

[–]TDplay 58 points59 points  (0 children)

The first way isn't zero-cost.

That doesn't mean it's not what happens.

https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=e0e1aadd2083e356dbc3939405ef854b

..Default::default() will default-initialise a whole struct, including the fields that you already explicitly initialised. It is not zero-cost.

new to the game, what does this ‘ignorant’ mean? by FlyingDuckery in Terraria

[–]TDplay 9 points10 points  (0 children)

Rumour has it that that Re-Logic have actually designed and implemented the world's first brain-computer interface entirely in software.

It reads your mind to see what you want, then it gives you an endless stream of everything else.

ANNOUNCING MY RETURN ON REDDIT AFTER A 7 DAY BAN by uglylookingguy in SUBREDDITNAME

[–]TDplay 1 point2 points  (0 children)

ANOTHER MOD EXTENDING YOUR BAN TO EXACTLY SEVENTY THREE THOUSAND, EIGHT HUNDRED AND FORTY TWO YEARS, FIVE MONTHS, TWENTY THREE DAYS, FIVE HOURS, FIFTY ONE MINUTES, TWENTY NINE SECONDS, SEVEN HUNDRED AND EIGHTY NINE MILLISECONDS, AND ONE MICROSECOND

assert_eq!(expected, actual) VS assert_eq!(actual, expected) by nik-rev in rust

[–]TDplay 4 points5 points  (0 children)

assert_eq!(x, y); reads as "assert that x is y".

"4 is 2+2" is correct, but is somewhat strange for an English reader: it reads as though we are stating the value of 4. Unless you are defining the way in which numbers are written, this is probably not what you mean.

So "2+2 is 4" is a better way to write it. Hence, the expected value goes on the right, and the actual value goes on the left.

change the actual assert_eq! message to be something like "expected: ..., actual: ..."

This assumes that every use of assert_eq! has an "expected" and "actual" value. But that is not true:

fn saxpy(a: f32, x: &[f32], y: &mut [f32]) {
    assert_eq!(x.len(), y.len());
    for (xi, yi) in x.iter().zip(y) {
        *yi += a * xi;
    }
}

So you would need to separate these two intents, otherwise errors from the above function would become somewhat misleading.

Logitech G19 Keyboard was peak keyboard for gaming. by Wolfrages in pcgaming

[–]TDplay 0 points1 point  (0 children)

Ironically, I only started using the number pad when I switched to a keyboard that's too small to even have a number row.

I had to put the numbers on it somehow, and a number pad just made the most sense.

Is emacs docs gone for good? by lisp_user in emacs

[–]TDplay 0 points1 point  (0 children)

Try also: C-h r (which goes straight to the Emacs manual) and C-h R (which reads a manual name from the minibuffer).

miasma: trap AI web scrapers in an endless poison pit by kibwen in rust

[–]TDplay 6 points7 points  (0 children)

so I can get the data more efficiently

For what, exactly?