Programming Leftovers
-
Maybe Software Engineers could learn something from Linguistics
Alloy is a formal specification language I use a lot. In Alloy, ≈all data is either an atom or a relation between atoms.
[...]
Unlike most languages, Alloy has two notions of subtyping: a type (or “signature”) can be
extend
ed, which is exclusive, or they can bein
, which are stackable. In this example, the source can be generic, a database, or a file, but not all three. -
Cadence of Code
Typing out a lot of other people’s code – that I did. Whenever I follow a book that contains code and it’s a book I truly want to learn from, I type out the code while following along. No copy & pasting. I’ve done it this way ever since I started programming and learning from books. Not sure exactly why, maybe because copy & pasting always had a smell to it? Maybe it felt like skipping the actual work when you don’t type it out?
When I read Zed Shaw’s Learn C The Hard Way years and years ago, I got confirmation that I’m not alone with this. In the introduction Zed sets some rules for following along: [...]
-
A case for ClojureScript 2.0
I was complaining the other day about the ergonomics of ClojureScript and realized an interesting thing.
-
GCC --enable-languages=all on OpenBSD
It cannot be overstated just how successful GCC has been since its introduction over 35 years ago.
What I'm interested in exploring today is if we can build all of these frontends for OpenBSD. If we can, I would like to explore their usability on OpenBSD.
I am using amd64 but I believe arm64 and perhaps even riscv64 would also be OK, but alas I don't have any RISC-V machines and my paltry Raspberry Pi 3B+ isn't all that healthy anymore.
-
R
-
Visualization in R: Unleashing the Power of the abline() Function
Welcome to the world of data visualization in R! In this blog post, we will explore the abline() function, a versatile tool that allows you to add straight lines to your plots effortlessly. Whether you’re a beginner or an experienced R programmer, mastering abline() will empower you to create more informative and visually appealing graphs. So, let’s dive in!
-
R for Predictive Modeling and Data Visualization in Turkey
Mustafa Cavus, organizer of the Eskisehir R User Group, in Turkey, discussed the diverse and thriving R community in Eskisehir. He shared the details of a 4-day event hosted by the group, which covered beginner-level talks and advanced topics for expert users. He also shared some useful techniques for hosting successful events.
-
Dirk Eddelbuettel: digest 0.6.32 on CRAN: CRC32C and AES Updates
Release 0.6.32 of the digest package arrived at CRAN this morning, and will be uploaded to Debian as
digest creates hash digests of arbitrary R objects (using the
md5
,sha-1
,sha-256
,sha-512
,crc32
,xxhash32
,xxhash64
,murmur32
,spookyhash
,blake3
, andcrc32c
algorithms) permitting easy comparison of R language objects. It is a mature and widely-used (with 58.3 million downloads just on the partial cloud mirrors of CRAN which keep logs) as many tasks may involve caching of objects for which it provides convenient general-purpose hash key generation to quickly identify the various objects. -
%dofuture% – a Better foreach() Parallelization Operator than %dopar%
-
Order Constraints in Bayes Models (with brms)
-
-
Python
-
Seaborn Swarmplot
In Python, the Seaborn “swarmplot()” method is used to draw a non-overlapping scatter graph that includes one of the variables as a categorical variable.
-
Python String rindex() Method
In Python, the “string.rindex()” method is used to get the highest index of the specified substring inside the input string.
-
How to Find a Substring in Python?
In Python, regular expressions, in operator, find(), and index() methods are pre-defined techniques that are used to find substrings from the large string.
-
-
Perl / Raku
-
dBASE: Parsing a Binary File Format With Raku
Text files, images, videos and anything you can store in a computer have a thing in common: all of them are stored as binary data. We make sense of what a sequence of binary data refers to purely based on how we interpret the binary data, and whether it conforms to what we expect it to be. If some chunk of binary data holds any meaning, we can tell it apart from another chunk by using a binary format specification, which describes how some binary data ought to be interpreted. For example, in the dBASE specification the first 32 bytes make up the header, which contains information such as date of last update, number of records in the database file, etc. Every binary file format you can imagine has a specification, and when such a specification isn’t available to someone interested on decoding a binary file format, then they must reverse engineer it.
-
Rakudo Weekly 2023.26 Pretty Damn Cool
Out of the blue Felix Knorr has written a very nice blog post about how the Raku Programming Language is pretty damn cool for them, describing Raku as a language that mixes Bash and Python (/r/rakulang, HackerNews, lobste.rs comments).
-