norden.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
Moin! Dies ist die Mastodon-Instanz für Nordlichter, Schnacker und alles dazwischen. Folge dem Leuchtturm.

Administered by:

Server stats:

3.6K
active users

#c

32 posts26 participants0 posts today

Released: #swad v0.1 🥳

Looking for a simple way to add #authentication to your #nginx reverse proxy? Then swad *could* be for you!

swad is the "Simple Web Authentication Daemon", written in pure #C (+ #POSIX) with almost no external dependencies. #TLS support requires #OpenSSL (or #LibreSSL). It's designed to work with nginx' "auth_request" module and offers authentication using a #cookie and a login form.

Well, this is a first release and you can tell by the version number it isn't "complete" yet. Most notably, only one single credentials checker is implemented: #PAM. But as pam already allows pretty flexible configuration, I already consider this pretty useful 🙈

If you want to know more, read here:
github.com/Zirias/swad

Simple Web Authentication Daemon. Contribute to Zirias/swad development by creating an account on GitHub.
GitHubGitHub - Zirias/swad: Simple Web Authentication DaemonSimple Web Authentication Daemon. Contribute to Zirias/swad development by creating an account on GitHub.

I’m interested in seeing Fedi’s opinion on this. Also reply with a more detailed opinion and your language of choice if you feel so inclined. Boost if you are interested in this too.

When my compiler reports an error, I most often see this as:

#rust#cpp#c

Did you ever dream to write your own videogame for the #SEGA #MasterSystem? 😲

xfixium has released a *complete* #video #tutorial: "Make Your Own Game with #devkitSMS" where he creates a Ms. Pac-Man clone using the #C language! 😍

The whole series is here: youtube.com/watch?v=9jGkoHX3BS and you also can download the ROM (for free) here: smspower.org/Homebrew/MsPacMan , with the whole source code freely available here: github.com/xfixium/SMS-Ms-Pac- 😁

I've made a fraction-based calculator, for simplifying rational expressions (written in ANSI-C using vi)

I was aiming to merge a scientific calculator with "bc", because I often need to simplify various fractions and whatnot. Quite happy with the result!

Uses shunting yard algorithm to evaluate the expressions, and a naive descent parser (I think?) to tokenise

Aside: OpenBSD's "editline" is very easy to use

Please ask any questions :)

patpatpat.xyz/data/frac

#c#bsd#unix

I wonder what would a c clone, like a c++ that is, instead of being object oriented, it was functional, like a cλλ, like inline assembly with category theory whitepaper code. That would be the most language ever. Like no side effects, with totally side effects. Like it also has some object stuff like how c++ is supposed to have some but it's just a featureful struct. I'm genuinely curious, morbidly. #programming #c #cpp #haskell #programminglanguages #doesanybodylikethis #insanity #darkwoke

Replied in thread

DId lots of smaller improvements to #swad ... but first, I had to hunt down a crash 🤯. Finally found it was caused by my #poser lib (to be fixed later): A connection there can resolve the hostname of a remote end and does so in a thread job to avoid blocking. If the connection dies meanwhile, the job is canceled. Seems my canceling mechanism relying on a signal to the thread is, well, not reliable (the signal can arrive delayed). Ok, for now just disabled name resolution to sidestep that.

Now, integration with #nginx is much better. I intrdoduced (optional) custom headers to transport the authentication realm and the redirect URI, plus state management in the session, so these can be passed to the "auth" endpoint. This requires to make sure nginx always passes the session #cookie, Unfortunately, I still need a "hacky" redirect configuration for login in nginx. If auth_request could just pass the response body, this would be unnecessary .... 🙄

The nginx configuration shows #swad running on "files" and another nginx running on "wwwint" serving #poudriere output there. This nginx instance helpfully adds cache hints, which I have to override, so a redirect works as expected when for example the swad session times out.

While implementing complex numbers for #simd I tripped over failures wrt. negative zero. After multiple re-readings of C23 Annex G and considering the meaning of infinite infinities on a 2D plane (with zeros simply being their inverse) I believe #C and #CPlusPlus should ignore the sign of zeros and infinities in their x+iy representations of complex numbers. compiler-explorer.com/z/YavE4M provides some motivation.
Am I missing something?

compiler-explorer.comCompiler Explorer - C++ int main() { using C = std::complex<double>; std::cout << C() * -C() << '\n'; std::cout << 0. * -C() << '\n'; }