Programming Leftovers
-
Fast decoding of base32 strings
For the most parts, these base64 techniques are applicable to base32. Base32 works in the following manner: you use 8 ASCII characters to encode 5 bytes. Each ASCII characters carries 5 bits of information: it can be one of 32 characters. For reference, base64 uses 64 different ASCII characters so each character carries more information. However, base64 requires using both upper case and lower case letters and other special characters, so it is less portable. Base32 can be case invariant.
-
Normal Probability Plots for Dummies
Now, here's the trick. We can use some math to determine the expected z-score of the nth element. For example, we might say that the expected z-score of the 50th element in a sample of 100 normally distributed values is 0. Using this, we can create a plot of our points, where the x-axis is the expected z-score, and the y-axis is the actual z-score.
If the distribution is really normal, the resulting points will fall on a straight line. Any deviations may tell you information about the true distribution, such as its skewness.
-
A visual tree iterator in Rust
My adventure with learning Rust continues. As a quick recap from the previous post, I’m writing a tree viewer. I have now completed another major milestone, which is to rewrite the tree-printing function to use an iterator. (Rationale: it makes the code more reusable – I can, for instance, easily implement a tree-drawing view for Cursive with it.)
-
How to subset list objects in R
If you’re an aspiring data scientist or R programmer, you must be familiar with the powerful data structure called “lists.” Lists in R are collections of elements that can contain various data types such as vectors, matrices, data frames, or even other lists. They offer great flexibility and are widely used in many real-world scenarios.
In this blog post, we will explore one of the essential skills in working with lists: subsetting. Subsetting allows you to extract specific elements or portions of a list, helping you access and manipulate data efficiently. So, let’s dive into the world of list subsetting and learn some useful techniques along the way!
-
What is Correction Data?
The GNSS works by utilizing a constellation of satellites that continuously transmit signals containing information about their locations and the time the signals were transmitted. Receivers on the ground or in vehicles receive these signals and use the timing and location information to calculate their own positions through a process called trilateration.
Trilateration involves measuring the time it takes for the signals from multiple satellites to reach the receiver. By knowing the speed of light, the receiver can calculate the distance to each satellite based on the time delay. Using GPS, you need to know the distance to three satellites to pinpoint a location, and a fourth to account for clock errors.
-
Game of Trees 0.91 released
Version 0.91 of Game of Trees has been released (and the port updated): [...]
-
Game of Trees Comparison to other version control systems
A unique feature of Got is its multi-process model working behind the scenes, tailored to interfaces provided by the OpenBSD kernel. Processes with an inherent attack surface, such as those talking to the network or parsing the data in repositories, run in a separate address space and with as little capabilities as possible. The OpenBSD version of Got provides the strongest protections by using pledge and unveil in combination. For example, unveil enforces read-only access to repositories while the Got server is serving fetches. The Got client main process restricts itself to the repository directory (read-only or read-write as appropriate), the /tmp directory, and the work tree. Processes speaking the network protocol have no direct filesystem access at all. All processes are pledged as tightly as possible to restrict the available system calls to those required for regular operation. The -portable version of Got uses Capsicum on FreeBSD and Landlock on Linux to restrict filesystem access during network access and parsing of repository data, but does not restrict the main process (yet?).