Programming Leftovers
-
Databases ☛ Database Architects: Advent of Code 2024 in pure SQL
On a whim I decided to do this years advent of code in pure SQL. That was an interesting experience that I can recommend to everybody because it forces you to think differently about the problems. And I can report that it was possible to solve every problem in pure SQL.
In many cases SQL was actually surprisingly pleasant to use. The full solution for day 11 (including the puzzle input) is shown below: [...]
-
Elias Mårtenson ☛ Advent of code 2024
So Advent of Code is done, and I made an actual effort this time. Of course I used Kap, and the final tally ended up being 32 out of 50 stars. I may solve some more later if I feel bored.
The Advent of Code problems tend to be very good fits for array languages, and they tend to be much shorter than solutions in other languages. In particular, the parsing which is often annoying in many languages often reduce down to a few characters in Kap.
-
Andrew Hutchings ☛ wolfSSL on Amiga
wolfSSL actually already has a 68000 based port, so some of the work is done for me. The most difficult part is generating entropy for the random number generator seeding. The typical ways of doing this are clocks (especially not synced to the CPU) and analogue ports.
-
[Old] The United Kingdom ☛ Making source code open and reusable - Service Manual
It is much easier to write your code in the open from the beginning of a project than it is to to open an existing repository later, because you can address security and other issues as you go along. If you do not do this, you will have to spend a costly period of time at the end of the project checking your code is all safe to be released.
-
Python
-
Adafruit ☛ UPDATED GUIDE: CircuitPython on Linux and Raspberry Pi
An updated guide is available in the Adafruit Learning System: CircuitPython on Linux and Raspberry Pi. A new page was added called Using NeoPixels on the Pi 5 describing how to use NeoPixels on the Raspberry Pi 5.
-
-
Shell/Bash/Zsh/Ksh
-
Fish Shell ☛ Fish 4.0: The Fish Of Theseus
We had decided we were gonna do a “Fish Of Theseus” port - we would move over, component by component, until no C++ was left. And at every stage of that process, it would remain a working fish.
This was a necessity - if we didn’t, we would not have a working program for months, which is not only demoralizing but would also have precluded us from using most of our test suite - which is end-to-end tests that run a script or fake a terminal interaction. We would also not have been able to do another C++ release, putting some cool improvements into the hands of our users.
Had we chosen to disappear into a hole we might not have finished at all, and we would have to re-do a bunch of work once it became testable. We also mostly kept the structure of the C++ code intact - if a function is in the “env” subsystem, it would stay there. Resisting the temptation to clean up allowed us to compare the before and after to find places where we had mistranslated something.
So we used autocxx to generate bindings between C++ and Rust code, allowing us to port one component at a time.
-