Programming Leftovers
-
Fast expansion of a polynomial with R
In this previous post, this previous post, and this previous post, I showed how to expand a polynomial with symbolic parameters. In the first two posts, I used the R package caracas, a wrapper of SymPy, and in the third post I used Julia.
Now I’ve found a pure R solution, with the help of the spray package, and it is very fast. That’s what I’m going to demonstrate here, with the same example I treated with Julia.
-
The magic of dependency resolution
Dependency resolution is something programmers usually take for granted. Be it cargo, npm, or whatever package manager you use, no one is actually surprised when this black-box figures out, all by itself, the specific set of packages that should be installed.
-
Fast expansion of a polynomial with R – part 2
In the previous post, I showed how to expand a polynomial with symbolic parameters with the help of the spray package. As I said, it has one problem: it doesn’t preserve the rational numbers in the polynomial expression.
I’m going to provide a solution here which overcomes this problem, with the help of the Ryacas package. In fact I provide a solution with the packages Ryacas and partitions, and then I improve it with the help of the spray package.
-
Efficiently updating implicit in-order forests
And you may ask yourself: how do I efficiently compute a range aggregation on this data, e.g. finding the max value for indices 1 through 4?
-
Shell Scripting with sleep: Using Delays Strategically
There are all kinds of use cases for the sleep command, including helping you with alarms, timing user output, or simulating delays when testing software. It can also help when coordinating multiple services.
In this article, you’ll learn more about the sleep command, how it works, and what you can do with it. You’ll also learn about a few alternatives for when its functionality isn’t quite what you need.
-
Our Python fileserver management code has been quite durable over the years
At this point we've been running our ZFS based NFS fileserver environment for about fifteen years, starting with Solaris 10 and evolving over time to the current Ubuntu 22.04 based servers. Over that time we've managed the various iterations of the same basic thing primarily through a local set of programs (all with names starting in 'san', despite the fact that we don't have a SAN any more). These programs have always been written in Python. They started out as Python 2 programs on Solaris and then OmniOS, and were moved to Python 3 when we moved to our Linux based fileservers. Naturally, we have version control history for the Python code of these tools that goes all the way back to the first versions in 2008.