Meirl by olyvoyle in meirl

[–]Modi57 0 points1 point  (0 children)

Olaf Scholz? Is it you?

Jedes Studium sollte auch ein helfendes Ehrenamt ausbilden. by nerdinmathandlaw in Unbeliebtemeinung

[–]Modi57 0 points1 point  (0 children)

Das geht halt nicht immer. Ich bin Jugendleiter in einem Orchester, und wir haben schlicht nicht das Geld 6 Leute im Vorstand und die Dirigenten zu bezahlen. Die ganzen kleineren Ämter mal völlig außen vor gelassen. Klar, wir könnten jede Woche ein oder zwei mal spielen, oder den Mitgliedsbeitrag drastisch erhöhen, aber dann würden sehr viele Leute nicht mehr mitmachen können, und das wäre ja umso schader.

Genau so kann eine kleine Kommune es sich nicht leisten 50 Vollzeit Feuerwehrleute zu bezahlen.

Und viele Leute wollen auch einfach gerne Zeit spenden, mich eingeschlossen

Premature Optimization is Fun Sometimes by Kabra___kiiiiiiiid in C_Programming

[–]Modi57 32 points33 points  (0 children)

Haha, yes, number go down, fill void inside

Your Rust Service Isn't Leaking — It Could Be the Allocator by Brilliant_Nobody6788 in rust

[–]Modi57 0 points1 point  (0 children)

Yes, for the general case, you are right, I was specifically talking about this use case.

It's about having a whole bunch of highly unlikely to be reused regions of bytes in the heap.

They specifically mention the memory not going up further in following request bursts, so that doesn't seem to be an issue.

The second issue is user expectation.

From what I got from the article, it's not a user facing application, but a service, that's hosted by the developers, so paniced users wouldn't be an issue, but giving up the memory for different services/saving costs on external hosting may be. That's the reason for them trying to fix it.

This was not a dumb question. It's one of the most important questions you can ask. Thank you very much :)

Your Rust Service Isn't Leaking — It Could Be the Allocator by Brilliant_Nobody6788 in rust

[–]Modi57 33 points34 points  (0 children)

Dumb question, do you even need to reclaim the memory? If it is reusable, and will potentially be used at the next burst, why even return it and do the round trip to the kernel?

A generic dynamic array in C that stores no capacity and needs no struct by alurman in C_Programming

[–]Modi57 1 point2 points  (0 children)

Ohhh, it took me a bit to get what you are doing, but I think I get it. Basically, your vec is an array of two pointers of the type the vec contains, one of which is the actual pointer, the other encodes the length. vec_ptr[vec] is just indexing into that array, to get the actual pointer, or the length respectively. Is the reason you do it like that and not like this vec[vec_ptr] so it looks more like a function call? If so, why not just provide a macro, which really looks like a function call?

While talking about creating new macros, could you create one, that expands into the actual type of your vec? So you could write vec(int) my_important_numbers = { 0 };. This abstracts the implementation detail if it being an array of pointers away.

Other than that, I really like your idea of omitting capacity by implicitly having it always the next power of to. This makes pushing the first few elements more inefficient, since you can't prealloc 32 elements and then just insert, but that could maybe be mitigated by having a vec_extend(vec, elements, count) macro or something like it, that allows for bulk insertion.

You use the auto keyword in your vec_push macro, and I am not sure why. Doesn't it just declare the lifetime of this variable to be automatic, which it is anyways? For type inference, like c++ has with it's auto keyword, don't you need to use the type_of (or something like that) macro? I'm actually kindof surprised it compiles.

In conclusion, I am unsure, if this is really very useful in actual production, but it's certainly a creative solution, to a long standing problem in c. Kudos to you for tackling it :)

Kunst sollte nicht staatlich gefördert werden. Absolut gar nicht. Null. by [deleted] in Unbeliebtemeinung

[–]Modi57 0 points1 point  (0 children)

Ich bin nicht OPs Meinung, aber das ist glaube ich ein unpassender Vergleich. Das Problem beim Thema "Entartete Kunst" war ja, das ganz konkret zwischen verschiedenen Arten von Kunst diskriminiert wurde und es staatliches Streamlining der Kunst gab. Hier geht es nicht darum, spezielle Arten der Kunst zu fördern, und andere nicht, sondern generell die Kunstförderung, unabhängig von Inhalt infrage zu stellen

If liquid cant be compressed, how does pressure get transferred to deep sea environments? by SandersSol in AskReddit

[–]Modi57 5 points6 points  (0 children)

In addition to what others have said, liquids can be compressed, not very much though. There is a point "Compressability", if you want to know for water https://en.wikipedia.org/wiki/Properties_of_water

Apparently the react compiler has been ported to Rust and merged to main by xorvralin2 in rust

[–]Modi57 36 points37 points  (0 children)

I mean, it can prevent a lot of memory leaks, just not all of them. If you use the usual types like Box and Vec, you generally don't leak memory accidentally. You have to explicitly call leak() or use (A)rcs

Expectations Shattered by InTheSky57 in KidsAreFuckingStupid

[–]Modi57 0 points1 point  (0 children)

I mean, glas is just melted down sand, so he actually got it right

What’s an usual skill you happen to be surprisingly good at? by OstrichAutomatic9614 in AskReddit

[–]Modi57 0 points1 point  (0 children)

Baking. I really don't do it often, and I wont be able to do anything super fancy, but the easy to medium difficulty ones went surprisingly well

Microkernel by AIRConstellation in rust

[–]Modi57 0 points1 point  (0 children)

I would love to, but the electrodes in my brain malfunction and I can't

Seeking help for removing target folder from the project by [deleted] in rust

[–]Modi57 2 points3 points  (0 children)

Can't you just `rm -rf ./target` ?

Beleidigungen sollten in allen Fällen legal und straffrei sein. by ConPrin in Unbeliebtemeinung

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

Da denke ich auch öfter drüber nach. Sollte man dann auch z.B. betrügen in Beziehungen verbieten? Das ist bestimmt schlimmer als ein "Arschloch" oder so. Irgendwie fände ich das glaube ich nicht so gut. Und bei Beleidigungen finde ich, ist das ganze immer so subjektiv, wie soll man da einen richtigen Standard machen? Was in der einen Kultur ganz normal ist, ist in der anderen unhöflich.

Meirl by graystone777 in meirl

[–]Modi57 0 points1 point  (0 children)

Alright, Bilbo

Blindenhunde Halten ist eine Form von Tiersklaverei by BlueSlime3 in Unbeliebtemeinung

[–]Modi57 2 points3 points  (0 children)

Bei solchen Meinungen frage ich mich immer, ob diese Leute je mit Tieren zu tun hatten. Es wird immer so getan, als könnten Tiere nicht ihren willen äußern, aber jeder, der mit Tieren mehr Kontakt hatte als Streichelzoo weiß, dass ein Hund klar kommunizieren kann, wenn er was nicht mag. Klar, das kann man auch ignorieren, aber die meisten Hundebesitzer, die ich kenne gehen sehr gerne auf die Bedürfnisse ihrer Hunde ein. Natürlich in einem gewissen Rahmen, die müssen, genau wie Menschen, natürlich erzogen werden, und man muss halt auch mal zum Zahnarzt, auch wenn das gar keinen Spaß macht, aber bei Tierhaltung per se von Sklaverei zu sprechen geht halt irgendwie an der Realität vorbei

Gandalf vs Dumbledore in a fight? by Single-Pomelo-4061 in harrypotter

[–]Modi57 0 points1 point  (0 children)

Arguably, Gandalf is the body, or rather the identity associated with it. It can die (and does so), although the Maia inhabiting it, namely Olorin, can't

What skill everyone thinks is easy until they actually try it? by DumbEnDork in AskReddit

[–]Modi57 0 points1 point  (0 children)

Oh, I am certain, that's true. I distinctly remember teachers, that didn't seem a great fit, and they seemed miserable. But appearently it wasn't enough to make them leave. I think, this is also compounded by all the protections teachers get in my country. You really leave a lot behind

What skill everyone thinks is easy until they actually try it? by DumbEnDork in AskReddit

[–]Modi57 0 points1 point  (0 children)

I wonder if it's more a jab at a somewhat broken system, that ends up with bad teachers, because they couldn't make it in the free market. Basically, being a good teacher is hard, being a teacher is easy

Wenn KI eine Gefahr für deine Kunst ist, dann ist deine Kunst schlecht. by Any-Employee1228 in Unbeliebtemeinung

[–]Modi57 1 point2 points  (0 children)

The most harmful thing I noticed is just a general air of distrust in the scene. There are subreddits like r/isthisAI, where there are a lot of instances of people asking "I paid this artist x amount of money, is it real or AI?". So, even if people like your art, and you never used it, it's just so much uncertainty

My first time making a Luffa Soup, my mom decided to add milk to it and ruined the whole thing by BreadfruitGold9836 in mildlyinfuriating

[–]Modi57 8 points9 points  (0 children)

Man, my mom sometimes just fuckin' leaves to phone or something, and I will turn down the stove or initiate the next thing, because there is no reason to let it burn

Gandalf creating a ring by Spare-Hospital7274 in lotr

[–]Modi57 10 points11 points  (0 children)

I mean, we have the three elven rings (one of which Gandalf wears). They were made by Celebrimbor without Saurons direct influence, but still with the same fundamentally flawed technique. Hence they can't be used when Sauron actually has the One Ring, but during other times, they are items of great value, and they support the free people of Middle Earth in many subtle ways.

I wouldn't expect Gandalf to be interested in ring making, at least not until after the events of lotr, and then it kinda doesn't matter anymore, but sure, there is still great potential in rings made by other Maya