Programming Leftovers
-
Rlang ☛ How to Check if Date is Between Two Dates in R
In this blog post, we’ll explore two approaches to accomplish this task using base R syntax. We’ll use simple examples and explain the code in easy-to-understand terms. So, let’s get started!
-
Bartosz Milewski ☛ Linear Lenses in Haskell
Haskell has essentially solved the concurrency and parallelism problems by channeling mutation to dedicated monads, but resource management has always been part of the awkward squad. The main advantage of linear types in Haskell, other than dealing with external resources, is to allow safe mutation and non-GC memory management. This could potentially lead to substantial performance gains.
This post is based on very informative discussions I had with Arnaud Spiwack, who explained to me the work he’d done on linear types and linear lenses, some of it never before documented.
-
Logikal Solutions ☛ C++ – Defaults and Deletes – Pt. 3
I called this class NoFarHeap because it has no dynamic memory allocations. We took the compiler defaults for the default and copy constructor. If you read this post on std::optional then you recognize the only constructor I coded. The benefit of std::optional is it allows you to skip over parameters without knowing their default values and without having to have the coded in many places. It has drawbacks though.
-
Yoshua Wuyts ☛ Will it block?
Determining whether something "is blocking" is a messy endeavor because computers are messy. Whether something blocks is not something we can objectively determine, but depends on our own definitions and uses. A system call which resolves quickly might not be considered "blocking" at all 1, while a computation which takes a long time might be. The Tokio folks wrote the following about it a few years ago: [...]
-
Perl / Raku
-
Olaf Alders ☛ Find and Fix More Typos
When you’re constantly producing code and documentation, mistakes will happen. Some will be easy to spot and others may elude you. We know that attention to detail counts. When someone finds a typo in your documentation or your code, they may be inclined to ask themselves what else may be wrong. In order to avoid the impression of carelessness, let’s automate the finding and fixing of typos.
-