Programming Leftovers
-
Jussi Pakkanen: PDF with font subsetting and a look in the future
After several days of head scratching, debugging and despair I finally got font subsetting working in PDF. The text renders correctly in Okular, goes througg Ghostscript without errors and even passes an online PDF validator I found. But not Acrobat Reader, which chokes on it completely and refuses to show anything. Sigh.
-
Developing the Hello, Word! Program in Python
Welcome to the world of programming! If you're just starting out, you're probably eager to dive in and start creating your own programs.
-
An AI app walks into a writers room
Third use case: ChatGPT is currently trained on an English language text corpus. It would be very interesting to see what it could do by way of translation with a sufficiently large input corpus of translated texts—like the huge trove of EU and UN documents that Google Translate was trained on.
-
Monoids in the Category of...
The meme words have become an annoying blot on the fringes of the Haskell universe. Learning resources don’t mention it, the core Haskell community doesn’t like it because it adds little and spooks newcomers, and it’s completely unnecessary to understand it if you just want to write Haskell code. But it is interesting, and it pops up in enough cross-language programming communities that there’s still a lot of curiosity about the meme words. I wrote an explanation on reddit recently, it became my highest-voted comment overnight, and someone said that it deserved its own blog post. This is that post.
This is not a monad tutorial. You do not need to read this, especially if you’re new to Haskell. Do something more useful with your time. But if you will not be satisfied until you understand the meme words, let’s proceed. I’ll assume knowledge of categories, functors, and natural transformations.
-
Poor Man’s Logistic Regression
We own a B2B online store, and we want to boost conversion rates by improving our search functionality. We a/b test with a SaaS provider, giving us results11 On the first row are sessions that went to the SaaS provider. On the second row are sessions that went to our existing solution. The first column are sessions that lead to a purchase, and the second column those that did not.: [...]
-
Tips for organising your R code
Keeping your R code organised is not as straightforward as one might think. Just think about the libraries, variables, functions, and many more. All these objects can be defined and later rewritten, some might get obsolete during the process.
This process is proven to be even more crucial when you are part of a larger group of engineers, and scientists, who collaborate with you.
-
December 2022: “Top 40” New CRAN Packages
One hundred sixteen new packages stuck to CRAN in December 2022. Here are my “Top 40” selections in thirteen categories: Computational Methods, Data, Ecology, Epidemiology, Genomics, Machine Learning, Mathematics, Medicine, Networks, Signal Processing, Statistics, Utilities, and Visualization.
-
Move or copy your strings? Possible performance impacts
You sometimes want to add a string to an existing data structure. For example, the C++17 template ‘std::optional’ may be used to represent a possible string value. You may copy it there, as this code would often do…
-
All about UndefinedBehaviorSanitizer
UndefinedBehaviorSanitizer (UBSan) is an undefined behavior detector for C/C++. It consists of code instrumentation and a runtime. Both components have multiple independent implementations.
Clang implemented the first instrumentations in 2009-12, initially named -fcatch-undefined-behavior. In 2012 -fsanitize=undefined was added and -fcatch-undefined-behavior was removed. GCC 4.9 implemented -fsanitize=undefined in 2013-08.
The runtime used by Clang lives in llvm-project/compiler-rt/lib/ubsan. GCC from time to time syncs its downstream fork of the sanitizers part of compiler-rt (libsanitizer). The end of the article lists some alternative runtime implementations.
-
Lessons learned streaming building a Scheme-like interpreter in Go
I wanted to practice making coding videos so I did a four-part series on writing a basic Scheme-like language (minus macros and arrays and tons of stuff).
I picked this simple topic because I wanted a low-stakes way to learn what I did not know about making videos.
Here was the end result (nothing crazy): [...]
-
Deriving Simple Recursive Functions
I used to teach Haskell to first-year university students, and many of them struggled to write their first recursive functions. It really isn’t obvious why you can solve a problem using the function you’re in the process of defining, and many students have difficulty making that leap. There is no shame in this. I remember taking a long time to grok proof-by-induction, which has a similar conceptual hurdle: how can you use a statement to prove itself?
-
Git Templates
Git is a powerful tool for managing and tracking changes in code projects. However, as projects grow and become more complex, it can be difficult to keep everything organized and make sure that everyone is on the same page. This is where Git templates come in.
-
Git: Querying the existing configuration
Git is a powerful tool for managing code and collaborating with others. One of the most important things when working with Git is understanding how to query the existing configuration.
-
Git: Configuration targets
Git is a powerful and versatile tool for managing and tracking code changes. One of the key features of Git is its ability to configure various settings and options at different levels, depending on your needs.
-
10 comics about Linux and programming and stuff.
I have a disease where I can't stop telling Linux jokes. Doctor says it's terminal.
-
droppy, The Self-hosted File Storage development has ceased
droppy is a self-hosted file storage server with a web interface and capabilities to edit files and view media directly in the browser. It is particularly well-suited to be run on low-end hardware like the Raspberry Pi.
Features
* Responsive, scalable HTML5 interface * Real-time updates of file system changes * Directory and...