Programming Leftovers
-
Mystery Buglet #2 | Buddy Burden [blogs.perl.org]
Hey! I know, I know: long time, no blog. I would love to blame the pandemic, but the truth is, I just haven’t been inspired with any sufficiently Perl-y topics lately. Until recently, when I ran into this.
Now, once upon a time, I wrote a post about a small buglet I had encountered. The post presented the problem, then asked you if you saw the problem, then explained what was going on. So let’s do that again.
[...]
But, as it turns out, unlink is fine with getting an empty list (I tested it). So that wasn’t the problem. Still, the last two sentences of the previous paragraph, when combined, contain the answer to the mystery. If you haven’t spotted it by now, you may want to take a moment to reread them carefully and see if I you see it before proceeding further.
-
YAML in practice can be looser than I expected
Both the Prometheus and the Grafana Loki ecosystems are mostly configured with a large amount of YAML. Since we use both, this has resulted in me writing a fair amount of YAML. I've never tried to systematically learn YAML; like a lot of other things to do with configuration files, it's something that I tended to pick up as I needed to know specific things. I sort of learned general ideas, copied examples, diagnosed and fixed complaints, and so on.
A while back I decided to install yamllint (well, the Ubuntu version of it) and use it on our YAML files. I expected to find some minor things and small surprises. Instead, I received a litany of warnings, primarily about having too much indentation. This was especially surprising to me because I'd absorbed the story that YAML was extremely picky about whitespace; you had to use two spaces, no more and no less, and carefully line everything up where it was required. Except, apparently, not always, at least as Prometheus and other Go programs accepted YAML.
-
FRnOG #36: Akvorado
Here are the slides I presented for FRnOG #36 in September 2022. They are about Akvorado, a tool to collect network flows and visualize them. It was developped by Free. I didn’t get time to publish a blog post yet, but it should happen soon!
-
Refactoring Russian Doll Code
Recently, I’ve been working with an environmental scientist to refactor a large R package. Let’s call her Jane.
Jane inherited a mess of code, and had to get it working as quickly as possible. She tidied up it as best as she could in the time, but now that the company depended on it, it needed some attention. We referred to it as her “Russian Doll code” because it had many nested functions, each passing the same giant nested lists back and forth. I could see that it frustrated her every time she had to touch it as she knew there was a better way to structure the code.
-
Map any region in the world with R - Part I: The basic map | R with White Dwarf
When you prepare for a job interview one of the questions they always tell you to prepare is “What are you most proud of?”. Personally I’ve never been asked that question in a job interview but it kept me thinking. Some years ago I developed the R code for the creation of maps of infrastructure for a Political Sciences project, and I can say that this is one of the projects I’m most proud of. However, it is also true what they say to developers, that nobody cares about how you did it. The final user only cared about what was done, while the research team about what are the possibilities. Due to the confidentiality agreement of the client, I also cannot share a git repository.
The project taught me so much in terms of technical skills that I have decided to share the how in case it can help somebody else. It is also my way to contribute to the R community since I myself learned R and programming thanks to the kind people who post their experience on the web (and to the ones who have the patience to answer questions in StackOverflow too).