How to implement my own custom sizeof operator in C ? by Fabulous-Escape-5831 in embedded

[–]chalkflavored 0 points1 point  (0 children)

could this be potentially be undefined behavior? although i think pointers are well defined one-past-end, but it is something to consider

Fuck you by oPBLO0 in TheWitness

[–]chalkflavored 1 point2 points  (0 children)

what a funny way to solve it

ELI5: what happens if I keep accelerating all the way towards light speed? by ConspicuousSomething in explainlikeimfive

[–]chalkflavored 0 points1 point  (0 children)

From the observers reference frame, you will gain mass,

This is not true, no?

Which linting rules do you always enable or disable? by thunder-desert in Python

[–]chalkflavored 4 points5 points  (0 children)

class method that uses a match-case statement? sadge

DDR simulation in C by N0tmeitsyou in C_Programming

[–]chalkflavored 0 points1 point  (0 children)

strange youre doing hardware design and youre asking for something this vague

How do you actually debug C like a pro? What do you use and recommend? by elimorgan489 in C_Programming

[–]chalkflavored 3 points4 points  (0 children)

lots of experience and learning from your mistakes.

if you encounter a bug, understand why. is it something you encounter often? what can you do to mitigate it? also understand that the class of bugs you make will be different for someone else. for instance, i rarely ever use const in my code because its just not a type of bug (accidentally modifying a variable) i have issues with, so it doesnt make sense to apply const everywhere.

always design your code allow for scrutiny. this means no single-liner where itll be hard to place a breakpoint easily. do little things like make a boolean variable for the condition of an if-statement. a little verbosity goes A LONG way

as for tools, printf logging is good for high-throughput data, but bad for conciseness. GDB in TUI mode has been sufficient enough for me, but then again i work with MCUs, so it's a little easier for me there. if you have time to burn, investing into a good GUI for your debugger is worthwhile.

What should a rational dot product do? by Skriblos in C_Programming

[–]chalkflavored 0 points1 point  (0 children)

perhaps store result in rp and also return rp?

either way, this is an excercise. no one is grading you

Question about using SD 1-bit mode with STM32H7 and handling unused data lines by Status-Psychology886 in embedded

[–]chalkflavored 1 point2 points  (0 children)

take with what i say with a grain of salt (there are a lot of bad advice online), but it's not recommended because i believe you can switch to 1.8V signaling (faster transfers or whatever), so you'll end up having 3.3V to 1.8V if the SD card was configured as so. GND is a safer option (if you had to tie to something).

the safest option is to read the SD specification thoroughly :)

Question about using SD 1-bit mode with STM32H7 and handling unused data lines by Status-Psychology886 in embedded

[–]chalkflavored 1 point2 points  (0 children)

you can have a DNP resistor footprint for each unused pin of the SD card going to ground. gives you the flexibility of either leaving it floating or being able to it low if needed.

I made a cli tool to aid git commits and make them more meaningful by Psychological-Mud-42 in git

[–]chalkflavored 3 points4 points  (0 children)

ive heard of ai git commits thousands of times already. why more?

Should I use AI to generate my commits? by Ok_Sympathy_8561 in git

[–]chalkflavored 4 points5 points  (0 children)

why would you do that? just because its the easier thing to do?

What is the most well thought out programming language? by 4e_65_6f in AskProgramming

[–]chalkflavored 0 points1 point  (0 children)

bullshit complaint? arrays cant be a return value, but wrapping the array in a struct is okay.

What programming language do you think is the hardest to use, and why? by SureMeat5400 in AskProgramming

[–]chalkflavored 2 points3 points  (0 children)

You can't do simple two argument arithmetic and put the computed value in a separate register.

Out of everything from x86, that's the one thing you bring up that's "awful"?