news
Programming Leftovers
-
Blain Smith ☛ Vendoring Modules in Hare
Hare doesn't have a package manager. This is by design and I'm glad for it. No dependency hell, no lock files, no node_modules black hole. However, you still need a way to pull in third-party code. There are two approaches: [...]
-
R / R-Script
-
Rlang ☛ Explaining Time-Series Forecasts with Sensitivity Analysis (ahead::dynrmf and external regressors)
Following the post on exact Shapley values for time series explainability, this post illustrates an example of how to use sensitivity analysis to explain time-series forecasts, based on the ahead::dynrmf model and external regressors. What is sensitivity analysis in this context? It’s about evaluating the impact of changes in the external regressors on the time-series forecast.
The post uses the ahead::dynrmf_sensi function to compute the sensitivities, and the ahead::plot_dynrmf_sensitivity function to plot the results.
-
-
Python
-
Kenneth Reitz ☛ NumPy as Synth Engine
There are zero audio files in PyTheory. Zero samples. Zero recordings. Zero WAVs, MP3s, OGGs, or any other format you could name. Not one byte of pre-recorded sound exists anywhere in the repository.
Every sound you hear — every plucked guitar string, every tabla stroke, every djembe slap, every organ chord — is computed at runtime. From math. Sine waves, noise generators, filters, and envelopes, all the way down. NumPy arrays are the synth engine.
And somehow, the results sound... real?
I still can't quite believe this works. I'm going to walk you through it, not as an expert in DSP (I am definitely not that), but as someone who kept adding features to a music theory library and accidentally ended up building physical models of goatskin membranes in Python.
-
-
Java/Golang
-
Daniel Lemire ☛ A Fast Immutable Map in Go
Consider the following problem. You have a large set of strings, maybe millions. You need to map these strings to 8-byte integers (uint64). These integers are given to you.
If you are working in Go, the standard solution is to create a map. The construction is trivial, something like the following loop.
-