Programming Leftovers
-
Sean Conner ☛ A bit of background on compilers exploiting signed overflow
A cautionary tale about compiler writers exploiting undefined behavior. I don't have much to add here, other than to spread a bit of awareness of why this happens.
-
Mark Dominus ☛ My Git pre-commit hook contained a footgun
The other day I made some changes to a program, but when I ran the tests they failed in a very bizarre way I couldn't understand. After a bit of investigation I still didn't understand. I decided to try to narrow down the scopy of possible problems by reverting the code to the unmodified state, then introducing changes from one file at a time.
-
Perl / Raku
-
Perl ☛ Perl Advent Calendar 2023: Perl - The Humane Programming Language
Programming languages usually reflect the needs of the computer. We find ourselves typing verbose incantations, over and over. Our instructions are so detailed as to remove all ambiguity from them -- yet programs frequently don't do what we expect. The limitations of the programming language dictate how we think about and solve problems.
Perl is different. It puts you, the programmer, first. Larry Wall, Perl's creator was a linguist who brought many principles of natural language to Perl. As creators, we are at our most productive, contented selves when we get into the flow. Let's see what makes Perl the flow-state language.
-
Perl ☛ Perl Advent Calendar 2023: A Dotenv Carol
Next appeared the Ghost of Configurations Present, adorned with snippets of Perl code and a merry demeanor. It took Scrooge to witness scenes of joyous developers using dotenv files – simple, readable, and devoid of unnecessary complexity. "Behold the present, Ebenezer!" the ghost declared. "Look at the ease with which developers manage all those different app environments. No more verbosity, no more headaches. Dotenv files bring clarity and simplicity to configuration management.".
-
Rakulang ☛ Day 19 – Autogenerating Raku bindings!
For this advent post I will tell you about how I got into the Raku Programming Language and my struggles of making raylib-raku bindings. I already have some knowledge about C, which helped me tremendously when making the bindings. I won’t explain much about C passing by value or passing by reference. So I suggest learning a bit of C if you are more interested.
-
Rakulang ☛ Day 20 – Craggy Christmas Chronicles
Then he remembered that Raku, his favourite programming language could be used as a powerful Command Line calculator via the App::Crag module.
-
-
Python
-
James Bennett ☛ Show Python deprecation warnings
Python provides the ability to issue a warning as a step below raising an exception; warnings are issued by calling the warnings.warn() function, which at minimum should be called with a message and a warning type.
One of the most common ways warnings are used is to provide notification that an API is deprecated and will be removed in the future; this typically uses the DeprecationWarning type, and the message should give some hint about what to use instead of the deprecated API, and when the deprecated API will be removed.
-
Python Speed ☛ How many CPU cores can you actually use in parallel?
When you’re running a CPU-intensive parallel program, you often want to have a thread or process pool sized by the number of CPU cores on your machine. Fewer threads and you’re not taking advantage of all the cores, more than that and your program will start running slower as multiple threads compete for the same core. Or that’s the theory, anyway.
So how do you check how many cores your computer has? And is this actually good advice?
-
James Bennett ☛ Running async tests in Python
Async Python can be useful in the right situation, but one of the tricky things about it is that it requires a bit more effort to run than normal synchronous Python, because you need an async event loop that can run and manage all your async functions.
This is especially something you’ll notice when testing, since async code basically has to have async tests (remember, it’s a syntax error to await inside a non-async code block).
-
-
Java
-
PR Web ☛ New InstallAware Multi Platform Builds GUI Setups with Console Fallbacks, Ensuring 100% Successful Deployments on All (Linux) OS's
Unique "Mixed Mode" setups liberate users from the confines of widgets, incompatible package managers, and a plethora of distributions – successfully deploying to all (Linux) operating systems from a directly executing, single file, Native Code (no Java) binary!
-
-
Content Management Systems (CMS)
-
Chen HuiJing ☛ Pulling content from external API into Drupal 10
If you had read my previous blog post, you’ll have found out that I’m somehow unable to escape Drupal. Not that Drupal is some terrible monster, it’s actually not bad. At this point, I’ll probably end up finishing my career with some Drupal project, who knows? Drupal 42, let’s go.
-