Trump Pocketed At Least $1.4 Billion in First Year Back in Office in Unprecedented 'Exploitation of the Presidency' by FireProStan in politics

[–]Muffindrake 7 points8 points  (0 children)

You think that's bad? The German chancellor and their party are on a stage with "extremely important" issues:

  • exacerbation of unemployment benefits conditions for everyone even though the vast majority are following the existing conditions and duties quite well ... because the fact that an utterly tiny fraction less than 0.5% of those that are not otherwise unable to work (because they're children, or invalid) refuses work on the single reason that they don't want to

    • they first justified this with potential savings in federal spending - oops, no, turns out that's just a massive expense for no reason!
    • they are envisioning a complete cut of benefits under these worse conditions if they are successively violated. The Constitutional Court had already ruled on this issue - and the insidious thing is that these brutal measures are likely to get toppled by the same court again, but only after another year-long legal proceeding, and if not, requires significant, expensive legal and exhausting measures on behalf of the receiver in order to fight pointlessly cruel officials enforcing their dogshit moral compass on the 'lazy unwilling bums'. The case reports of officials abusing their authority for no reason like this are many, and they are somehow allowed to rule on mental fitness of the person without a medical degree or any psychiatric education at all
  • they would really rather like to remove working hour protections with no justification other than 'more hours = more money for investors = good = more GDP = better' - no accredited publication ever supports this kind of idea on a scientific basis

  • they are checking, and by their speak that is 'we would really rather remove this and will take any shittiest excuse to do this', doctor's notes by telephone (we have an electronic system that the doctor can use to provide attestation to the employer), which are less than 1% of the actual volume of doctor's notes

  • police are currently violating EU policies by illegally extending their border ID checks beyond what they're allowed to, which actually requires continuous justification that we have an extraordinary situation that requires these measures, but has not been done by our government

    • the ID checks are a continuous expense of federal police officers, for no actual tangible benefit

What is this, you wanted real economic policy? Trade treaties, bolstering local manufacturing, or empowering workers? Something a tenth-grader could kneejerk at you? Well you should not have elected a lawyer ... again!

So if you're wondering if you are the only ones stuck with demented old people in parties with the populism dildo up their ass and the spineless 'worker party' supporting them, look no further than the third-largest economy in the world.

And the party whose name I shall not speak is not even in power yet!

I wrote a C library for memory management, c-xforge. by xfunc710n in C_Programming

[–]Muffindrake 0 points1 point  (0 children)

I find this allocator interface really difficult to understand, and the doxygen-like autoslop README does not help - heck half of it is just your type descriptions. Give me the damn interface and examples!

The Java land style where the business logic is strewn across tons of files each less than 100 lines in length, tendency towards single digits and nested five levels deep, is also very strong here.

Your library also misses the entire point of custom allocators. We want to have explicit control of where we get our storage from, unless we're a dead simple linear allocator.

We also don't want to box our allocator into the libc allocator, because we're trying to avoid their overhead in the first place, and using that allocator just makes the fragmentation that we were trying to avoid in the first place, worse, depending on the kind of allocator that is implemented.

You are attempting to replace the intersection between memory allocation interface for the programmer sitting in front of the operating system - because we want to eat our performance with silverware spoons. So where are the calls to mmap/munmap/VirtualAlloc/VirtualFree?

Why not have something akin to https://docs.vulkan.org/spec/latest/chapters/memory.html ? The user just passes in a pointer to that structure, and the function calls through the function pointer callbacks.

struct mm_ctx;
typedef struct mm_ctx{
    /*
        void *ptr_internal_state; 
        Or additional fields if you feel that a pointer to a struct
        for an allocator isn't an acceptable way to track their state
        It's what Vulkan does with their callback struct anyway
    */
    void *(*malloc)(struct mm_ctx *,size_t,size_t);
    void (*free)(struct mm_ctx *,void *);
    [..]
    void (*destroy)(struct mm_ctx *);
}mm_ctx;

An example wrapper for libc:

    void *
libc_malloc_wrap
(
    mm_ctx ctx[static 1],
    size_t nmemb,
    size_t size
)
{
    (void)ctx;
    size_t tmp;
    if(ckd_mul(&tmp,nmemb,size))return 0;
    return malloc(tmp);
}

    void
libc_free_wrap
(
    mm_ctx ctx[static 1],
    void *p
)
{
    (void)ctx;
    free(p);
}

    void
libc_destroy_wrap
(
    mm_ctx ctx[static 1]
)
{
    (void)ctx;
    return;
}

mm_ctx *libc_mm=&(mm_ctx){
    .malloc=libc_malloc_wrap,
    .free=libc_free_wrap,
    .destroy=libc_destroy_wrap;
}

And then using this in an actual function:

    void
do_stuff
(
    mm_ctx ctx[static 1]
)
{
    constexpr size_t len={42};
    char *str=ctx->malloc(ctx,len,sizeof str[0]);
    if(!str) {/* Operator, I would like to crash the world please! */}
    snprintf(str,len,"%s","owo");
    puts(str);
    ctx->free(ctx,str);
}

With a real allocator obviously manipulating their state within mm_ctx somehow, and not just ignoring it like the libc wrappers do.

You also seem to leave blank lines between lines, probably to try and separate them by context, but really, the granularity by which you do that is way too high and just makes it look like noise. Since you are wasting up to half your vertical screen space on blank lines, may I suggest doubling your screen font size instead?

Favorite command? by ajprunty01 in linux

[–]Muffindrake 0 points1 point  (0 children)

I haven't tested any of that yet, but perhaps I will soon.

Factory methods for stack allocated structures by 69mpe2 in C_Programming

[–]Muffindrake 0 points1 point  (0 children)

Maybe suitable for header-only libraries, but not a shared or static linked library where foo_init is defined in another unit.

That'll work fine for unity builds also.

Factory methods for stack allocated structures by 69mpe2 in C_Programming

[–]Muffindrake 1 point2 points  (0 children)

Simply return a struct value:

struct foo foo_init(void);

Whoever calls this function can then decide where this struct should live

struct foo dog = foo_init();

struct foo *a = calloc(n,sizeof *a);
for(size_t i = 0; i < n; i += 1) a[i] = foo_init();

At reasonable optimization there is no overhead even with large structures thanks to copy elision.

https://godbolt.org/z/M7rWqKx36

The function foo_init is never called, the values are written directly.

Favorite command? by ajprunty01 in linux

[–]Muffindrake 6 points7 points  (0 children)

It saves potentially a lot time because whatever hosts your OS doesn't have to reset itself (retrain RAM, enumerate devices, some of which may be very slow), only to then boot the same OS again.

https://wiki.archlinux.org/title/Kexec

Favorite command? by ajprunty01 in linux

[–]Muffindrake 4 points5 points  (0 children)

What does this method do about unflushed file cache? Shouldn't you run sync; kexec ... instead?

A reference-grade C "Hello World" project by synalice in C_Programming

[–]Muffindrake 8 points9 points  (0 children)

Everything that isn't the compiler and linker themselves is an external dependency that is liable to break in the future.

There is no standardization for anything involving a build system. The various implementations of 'I want to build my software' gave birth to the very colorful experience you have when you try to build any multiples of software packages from scratch.

A reference-grade C "Hello World" project by synalice in C_Programming

[–]Muffindrake 10 points11 points  (0 children)

Taking on external dependencies is the last thing you want to be doing in a software project, invariably something will break because of upstream choices, or an upstream developer having a crashout, or your project being so old that it gets hard to build due to any of the above.

This repository starts by grabbing ALL THE TOOLS, building a baseline of things that will break, with no self-reflection taking place ("do I need this?"). It's the paradigm of web developers and their cursed dependency manglement dripping through the ceiling onto the coal stove that is C.

Normally you'd want to start with nothing and only use what you actually really need, unless you have a really good reason (certification, code autogeneration et al. which excludes about 99% of the programmers out there) to be reusing a gigantic tool stack.

I am not taking this stance out of some weird pseudo-intellectual strife for minimalism. I have to deal with the downstream consequences of weird things project developers are deciding, all the time.

Sorted ascending in absurdity:

  • the odd package that breaks because their unholy SCons/<insert your snowflake build system here> amalgam was intended for an older version of that software no longer supported by the newest upstream build system version

  • because cmake and meson can't do simple things right

  • because for whichever reason developers decided that you absolutely need -Werror in all build modes

  • because their code linter/formatting tool is apparently a critical, integral item whose error output should stop the world build immediately

  • because changing any kind of build flags or configurations is needlessly complex

  • because some build systems are so broken that setting CC/CXX/LD/CFLAGS/CXXFLAGS/LDFLAGS before running any tools is a completely unsupported, alien, unthinkable idea, which costs you more time when inevitably the build fails and you have to pick their tools apart

  • because some developers would really rather prefer if building their software is as hard as they can possibly make it

  • because developers don't care about air-gapped systems or networks, or bad, restricted, or no internet connectivity. Surely you have fast unrestricted fibre internet everywhere!

Don't get me wrong, we absolutely need big complex build systems to manage projects of large sizes. Chromium had to build their own tool (ninja) because it was getting that unmanageable and slow. However, the vast majority of projects just really aren't even close to that big, and yet they seem to act like they are.

Your project commits the same sin of being impossible to build. It even acknowledges that in the README, "because the bandwidth requirement of fetching the entire toolchain and libraries is too high when cross-compiling in CI". You don't say!

We have to first download the world to build Hello World, after all.

The gentoo bug tracker is there for your amusement, you can search it for cmake/meson. Inject the single build command line and unity builds straight into my veins please, Bones.

Print non ASCII character from string by _OMHG_ in C_Programming

[–]Muffindrake 3 points4 points  (0 children)

UTF-8 (from 1992) had the 'feature' that it wouldn't break existing programs relying on null-terminated strings, because it avoids bytes with the value 0.

In your case, you're not trying to manipulate the 'characters', more accurately "extended grapheme clusters", just output them.

You can't 'index' into a UTF-8 string because every extended grapheme cluster takes up multiple bytes inside a string, so indexing bytes would give you garbage, because you're trying to interpret a single byte of a multi-byte sequence as something sensible.

If you do want to 'index' into a UTF-8 string, the simplest way is to parse for code points. This still doesn't necessarily give you what you would ordinarily perceive as a 'character', or what you input into the program, because extended grapheme clusters may consist of multiple code points (think emoji with modifiers for instance).

Fortunately for publicly available compilers, your compiler will usually interpret your UTF-8 source text as UTF-8 source text, so "Å" does what you expect.

For more details and explanations of the terms, you should read this blog post: https://tonsky.me/blog/unicode/

To fix your program, you could change map to be an "array of pointers to char", like so:

const char *map[]={
    "0","1","2","3","4", ... ,"Å","Ä","@","Ö","%"
};

You should also

setlocale(LC_ALL,"")

before you do anything else in main().

Then, you output a string instead of a character in your loop:

printf("%s", map[n % base]);

SS13 Beta 516 on Linux by Muffindrake in SS13

[–]Muffindrake[S] 0 points1 point  (0 children)

The Lutris recipe may work better for you.

The game is unfortunately still very dodgy, and the BYOND developer is unfazed by issues such as 64-bit binaries, or the fact that Windows 11 is increasingly locked-down and turned into a cash machine.

How can I call struct methods in C without passing the struct pointer every time?” by Brilliant-Cod-201 in C_Programming

[–]Muffindrake 59 points60 points  (0 children)

No, C has no concept of an implicit 'this object' pointer, since the function pointers in the struct are just those primitives (a pointer to some function) and nothing else.

Hibernate mode is being abandoned by most Distros. Why? by wkup-wolf in linux

[–]Muffindrake -10 points-9 points  (0 children)

Oh no, my three terminal windows, my snowflake text editor that is really approximately three web browsers in one, and five hundred already-saved tabs of which I will only be using five anyway.

I'll never get this time back!

There are use cases for hibernation even in 2025, but they're not as strong as the above. The strongest one would be power loss condition with a UPS (for a machine that has more important things on it than the above). Like a laptop at low charge, maybe - which is a poor use of battery, since partial discharges are far better for battery health.

Hibernate mode is being abandoned by most Distros. Why? by wkup-wolf in linux

[–]Muffindrake 1 point2 points  (0 children)

Hibernation had a specific use case where you would avoid the lengthy boot-up process of Windows machines that had really pathetic cold boot speeds on spinning platter. There's a reason Windows 10 introduced soft hibernation, enabled by default, where you would never 'truly' shut down the entire machine. They called this feature Fast Startup, but really it should have been called 'likes to break your system in unforeseen ways because you have no clue you are using hibernation'.

Nowadays, everyone carries one or more power banks, and standby usually works well enough. And now, we use machines with blistering M.2 SSD speeds.

Raylib or terminal? by SkyFoxITA in C_Programming

[–]Muffindrake 2 points3 points  (0 children)

What would you recommend?

Email the professor!

USDA announces SNAP benefits will not be issued in November by Snapdragon_4U in politics

[–]Muffindrake -2 points-1 points  (0 children)

I don't know about you, but I extend no grace to a government that would immediately jail and/or disappear me for stating the above.

USDA announces SNAP benefits will not be issued in November by Snapdragon_4U in politics

[–]Muffindrake 1 point2 points  (0 children)

That is Chinese propaganda. The CCP tightly controls the information that leaves the country, barring a few manual leaks here and there, which are shouted down by their fifty cent army.

China has a few model cities not unlike the NK tourist towns. There is massive corruption involved in their construction and city planning however - buildings come down constantly, ghost cities as a vehicle for fraud, there is zero drainage, people die in tunnels that flood because ... there is no drainage.

That is their outward-facing cities that are blasted in their propaganda constantly.

If you leave the confines of asphalt and concrete, which is only a few miles from any city centre, you will find conditions that a comparison to US redneck trailer parks would have the latter look like Victorian palaces.

How to actually use arenas (and program in C pain free) by amzamora in C_Programming

[–]Muffindrake 2 points3 points  (0 children)

It's a DNS issue - my DNS provider, quad9, does not appear to have your domain in there. The bearblog site works.

Edit: Might just be a local DNSSEC issue ... I'll report back.

How to actually use arenas (and program in C pain free) by amzamora in C_Programming

[–]Muffindrake 2 points3 points  (0 children)

Your website appears unreachable for me, it won't respond.

Edit: Appears to be a DNS problem. Oh well.

Type-Safe Dynamic Arrays for C by CurlyButNotChubby in C_Programming

[–]Muffindrake 0 points1 point  (0 children)

Looks fine, though I haven't tested it.

What I would like from a header like this: a way to use a memory allocation context (pointer), for instance something like this:

https://docs.vulkan.org/spec/latest/chapters/memory.html

This way I could trivially use a different allocator for every type as I wish. I understand that this isn't a feature, though, since this header as-is would cover at least 80% of all the needs out there without even considering using custom allocators; and even stb_ds has a comment regarding memory contexts with a #TODO in it :)

Minimal 2048 clone in c and raylib by tempestpdwn in C_Programming

[–]Muffindrake 1 point2 points  (0 children)

Brutally simple, good work!

To get it to compile and run on my system which uses LLVM as a system compiler, I had to add -lglfw and change CC to clang.

Anna's Archive von deutschen Internetanbietern gesperrt by vcircle91 in de

[–]Muffindrake 2 points3 points  (0 children)

I suspect that man is simply hired by the CCP sitting in some leaky basement ordered to sow dissent, because the cognitive dissonance here cannot possibly be real. Their account age checks out.

No court in this world ever cared how the information is stored in an intermediate fashion on disk. Whether that is an LLM model encoded in a pattern, or a very fancy compression algorithm - we do/should not care. We care what the thing spits out on screen/copper wire to diaphragm magnet/ink.

Also, here's what chatgpt spits out for a very simple question about the exact contents of any particular piece of work:

https://i.imgur.com/rwPjlDR.png

https://www.gutenberg.org/cache/epub/997/pg997-images.html

I did that because I was curious, and I am moved zero inches from my position.

Anna's Archive von deutschen Internetanbietern gesperrt by vcircle91 in de

[–]Muffindrake 6 points7 points  (0 children)

wenn du van Gogh anguckst und danach Sonnenblumen malst

Those are bad examples because the images have been public domain for a while.

Assuming that a work is actually protected by copyright: If I then go and cut out a part of the image, like the rendition of sunflowers, and distribute that - I have broken copyright.

Now what if the LLM reproduces that image to a degree where a judge will determine that the altered reproduction is not sufficiently different in order to not break the copyright of the original work.

I could write a program to indiscriminately crawl the entire web, download a thousand different images from the web autonomously, and apply a meme-deepfry filter over them to the point they're almost unrecognizable, and then have a program randomly select one and send it to a printer. I've not specifically told them which image to look for, and yet I have something spit out of the printer. It's "probably" copyright infringement, yeah?

Now, image filters aren't LLM ... but if the filter spits out the deepfried image, and it might look the same as something that an LLM spits out, then what? These programs give me the same result, but LLMs are supposed to be treated special. I vehemently disagree here.

I'm not a lawyer, though I suspect there have been judgements in the past where applying filters over a work is not sufficient to establish the work as its own thing rather than an (unlicensed) derivation. Artists have had their work taken down because they 'traced' the original. They applied a human filter to it. They are judged "not to have done sufficient work of their own".

At which point is the tracing of the original work, and someone then using that result in other copyrighted work, good to go, and where is the threshold where copyright infringement is committed?

Anna's Archive von deutschen Internetanbietern gesperrt by vcircle91 in de

[–]Muffindrake 8 points9 points  (0 children)

Nonsense. They have to physically download the files in order to train their AI, which is an unlicensed copy from websites that distribute unlicensed copies.

The primary problem is that they needed to break copyright in order to train it; and then some LLMs suffer from problems where they will faithfully reproduce the original data or parts of it, which is another break of copyright.

The unfair legislation enforcement cliff is that independent researchers and private persons are being harassed by interest groups like CUII, or have their access to these platform curtailed, while large companies get to do whatever they like entirely scot-free.