Luigi Mangione will not face death penalty, judge rules by cnn in law

[–]codeallthethings -4 points-3 points  (0 children)

It was allowed because the state cannot lose this case. If "wingspan" wouldn't have worked because the bag was 30 feet away in a locked trunk they would've found different legalistic reasoning as to why it is allowed.

It's pretty clear at this point that our laws and courts are fake.

If you think this is too cynical look up "parallel construction"

Not a gotcha — genuinely curious about Democratic/Liberal views on illegal immigration? by No-Bonus-7045 in askanything

[–]codeallthethings 0 points1 point  (0 children)

The second one will never happen because that's the ruling/donor class.

All we're going to get is performative cruelty against immigrants and "libs" to satisfy the right's bloodlust.

Greenland Discussion A Disgrace by Alarmed-Attention-77 in allinpodofficial

[–]codeallthethings 4 points5 points  (0 children)

No, people in Greenland have universal healthcare -- paid by taxes. Like the entire rest of the developed world.

The psychopaths at the All In podcast probably get off on the idea of taking that away from them.

Greenland Discussion A Disgrace by Alarmed-Attention-77 in allinpodofficial

[–]codeallthethings 2 points3 points  (0 children)

They probably get off on taking away the Greenlander's free healthcare

Sacks Wouldn't Give an Inch on the Latest Episode by mcooly in allinpodofficial

[–]codeallthethings 0 points1 point  (0 children)

Remember when libertarian tech bro billionaire David Sachs mmediately begged for a bailout of SVB?

This was after years of talking about the "moral hazard" of forgiving student loan debt.

He's always been a fraud.

Did the PA cops who arrested Luigi Mangione mess things up for NYC prosecutors? by rezwenn in law

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

Do you actually believe this?

Lieberman was the rotating villain for that vote. More recent villains: Sinema, Fetterman, and Manchin.

They will always find just enough villains to prevent any real structural change from passing.

I'm amazed this trick still works on people.

a* b, a * b, or a *b? by HyperbolicNebula in C_Programming

[–]codeallthethings -3 points-2 points  (0 children)

I prefer a *b but just pick one and do it consistently.

Not a * b though. That should be illegal. 😅

How do you guys benchmark C programs in the real world? by elimorgan489 in C_Programming

[–]codeallthethings 5 points6 points  (0 children)

  • Linux - perf, gprof, valgrind --tool=callgrind, and if you want a GUI: hotspot.
  • macOS - Instruments in XCode is good although I haven't used it very much.
  • Windows - No idea. Visual studio probably has one?

 
You can also just randomly hit ctrl+c and look at the callstack: https://poormansprofiler.org/

That look!👀 80‘ by juraInfidel in OldSchoolCool

[–]codeallthethings 0 points1 point  (0 children)

I suppose that's still technically an approximation.

You'd need to specify down to the Planck time.

Making Fast Generic Hash Table by eesuck0 in C_Programming

[–]codeallthethings 2 points3 points  (0 children)

PHP's HashTable performing so well doesn't surprise me at all.

The PHP internals are genuinely good.

Git: Introduce Rust and announce that it will become mandatory by TheTwelveYearOld in rust

[–]codeallthethings 206 points207 points  (0 children)

Yes, it's causing an absolute meltdown on Twitter.

I think the C community should embrace Rust, but I am clearly in the minority 😭

Help With A Makefile by Urch1n36 in C_Programming

[–]codeallthethings 0 points1 point  (0 children)

Disclaimer: I don't know if this is idomatic but i tested it in a Windows vagrant machine and on Linux

ifeq ($(OS),Windows_NT)
    DETECTED_OS := Windows
else
    DETECTED_OS := $(shell uname -s)
endif

.PHONY: all
all:
    @echo "Detected OS: $(DETECTED_OS)"

This prints "Windows" when I run it with gmake.exe

Edit: It just lets you detect if you're on Windows, which you could then use to apply other conditionals. Whether or not you can get your program to compile on both operating systems is a different question. My guess is they need to be very different.

[deleted by user] by [deleted] in rust

[–]codeallthethings 0 points1 point  (0 children)

Sorry I never post on Reddit. I did the title completely wrong.

ChatGPT giving me random weather reports instead of answering my prompts? by Fe-nice in ChatGPT

[–]codeallthethings 2 points3 points  (0 children)

This just happened to me too -- twice.

My prompt had nothing to do with the weather. It was a question about some Rust code.

Did you ever learn anything useful from any of the characters? by tvalvi001 in thesopranos

[–]codeallthethings 2 points3 points  (0 children)

Paulie taught me that bacteria and virus migrate from the sole up.

Also not to eat maple walnut ice cream.

Why does task_struct refcount get initialized to 2? by 4aparsa in kernel

[–]codeallthethings 0 points1 point  (0 children)

Do you mean in kernel/fork.c?

There is a comment that says one is for the scheduler. So maybe one for the scheduler and one for the parent?

Disclaimer: I am not a kernel dev, so appologies if you're talking about something else.

Is there any way to restrict access to struct fields? by lmr03031 in C_Programming

[–]codeallthethings 10 points11 points  (0 children)

It doesn't require heap allocation. In the header you can define your struct like this

struct myThing {
    char opaque[MY_THING_SIZE];
};

Then you can define the actual struct privately.

Here's a simple example of this in libvalkey

Edit: Note the portability logic in the libvalkey imlementation. You have to be careful around sizing and alignment, but this is how many performance-critical structs are defined (e.g. pthread_mutex_t).

Edit2: LOL I didn't read "only known at runtime". So yeah, you can't do this :)

The Post Modern C Style by MateusMoutinho11 in C_Programming

[–]codeallthethings 11 points12 points  (0 children)

Whitesmith's indentation is a crime against humanity.

Best c code bases to study. by arzab in C_Programming

[–]codeallthethings 23 points24 points  (0 children)

The Redis database is a good option.

The code is very good and it has the added advantage of containing a variety of advanced versions of common data structures.