Programming Leftovers
-
Rlang ☛ How to Remove Specific Elements from a Vector in R
Working with vectors is one of the fundamental aspects of R programming. Sometimes, you need to remove specific elements from a vector to clean your data or prepare it for analysis. This post will guide you through several methods to achieve this, using base R, dplyr, and data.table. We’ll look at examples for both numeric and character vectors and explain the code in a straightforward manner. By the end, you’ll have a clear understanding of how to manipulate your vectors efficiently. Let’s dive in!
-
Nicholas Tietz-Sokolsky ☛ Rust's iterators optimize nicely—and contain a footgun
I saw a claim recently that in functional programming using "map/filter iterates over the list twice, while the foreach loop iterates only once." The author continued that "Haskell can fuse maps together as an optimization but I don't think you safely fuse arbitrary map/filters? I dunno."
There are really two claims here:
• in functional programming, map/filter will do two iterations
• there is an optimization in Haskell to combine maps, but this may not generalize to arbitrary maps/filters
-
Matt Palmer ☛ Brane Dump: "Is This Project Still Maintained?"
If you wander around a lot of open source repositories on the likes of GitHub, you’ll invariably stumble over repos that have an issue (or more than one!) with a title like the above. Sometimes sitting open and unloved, often with a comment or two from the maintainer and a bunch of “I’ll help out!” followups that never seemed to pan out. Very rarely, you’ll find one that has been closed, with a happy ending.
These issues always fascinate me, because they say a lot about what it means to “maintain” an open source project, the nature of succession (particularly in a post-Jia Tan world), and the expectations of users and the impedence mismatch between maintainers, contributors, and users. I’ve also recently been thinking about pre-empting this sort of issue, and opening my own issue that answers the question before it’s even asked.
-
Rlang ☛ Divide data into groups in R
Divide data into groups in R, we will learn how to use the split and unsplit functions in R to divide and reassemble vectors into groups.
These functions are useful when you need to separate a large dataset into smaller groups based on specific criteria and then reassemble the data back into a single vector.
-
Roman Kashitsyn ☛ Enlightenmentware
As programmers, we interact with software tools daily. Most of them can barely get the job done. But once in a white, we discover a piece of software that transcends mere utility. These tools capture our imagination, open new possibilities, and affect how we design our own systems. I call such software enlightenmentware.
The most common source of enlightenment for programmers is the programming language they use at work or learn as a hobby. I experienced many jolts of enlightenment from fiddling with programming languages, from masm and C to Prolog and Idris. I won’t focus on languages, however, since the effects of language learning on mind expansion is old news.
In this article, I praise the software that contributed the most to my enlightenment.
-
Rlang ☛ R Shiny and DuckDB: How to Speed Up Your Shiny Apps When Working With Large Datasets
If there’s one thing with a certain downward trend, it’s got to be people’s attention span. Even Surveillance Giant Google reports that pages with a load time of 5 seconds increase their probability of bounce by 90%! And that was in 2017! -
Rlang ☛ simstudy 0.8.0: customized distributions
Over the past few years, a number of folks have asked if simstudy accommodates customized distributions. There’s been interest in truncated, zero-inflated, or even more standard distributions that haven’t been implemented in simstudy.
-
Rlang ☛ formatdown v0.1.4
In response to issues raised by users, formatdown has new functionality (and bug fixes) with additional arguments affording greater control over the appearance of the formatted objects.
-
Python
-
SANS ☛ Analyzing MSG Files, (Mon, May 20th)
.msg email files are ole files and can be analyzed with my tool oledump.py.
-