Programming Leftovers
-
Using Emacs for R
To start using R, or almost anything else in Emacs you basically need to know 3 things: 1) How to move in Emacs, meaning understanding what is what and learning a few key commands; 2) What is the configuration file and how to use it and 3) How to use packages to extend Emacs. In the first half of this post I will try to show how easy it is to cover these 3 points even for people who are inexperienced in programming. If you don’t believe me I invite you to read just the first paragraph of the next section to give you an idea of how easy it really is. During the second half I will show how I’m using R in Emacs to give you a starting point of a fully functional environment for R, and will conclude with some topics that can be further explored.
-
A Bridge Over a River Never Crossed
This was the sort of situation I was finding myself in for the protocol: I wanted to build everything correctly the first time around, but I had no damn idea about how to wire up only one fine half to nothing just to figure out what shape exactly should a whole exchange have. I couldn't do it right all at once.
-
How to Create an Array of Strings Using Malloc() in C Programming
C programming language is one of the famous structured languages that includes many basic components, and arrays are one of them. Arrays are referred to as a collection of similar types of items stored in contiguous memory blocks. These are of two types: static array and dynamic array. In the static array, the size of the array is fixed. But in a dynamic array, memory is allocated dynamically.
-
Spice up your persistence: loading PHP extensions from memory - Adepts of 0xCC
Dear Fellowship, today’s homily is about how to improve persistences based on PHP extensions. In this gospel we will explain a way to keep a PHP extension loaded on the server without it being backed up by a file on disk. Please, take a seat and listen the story.
-
A table of results for frequentist mixed-effects models: Grouping variables and specifying random slopes | Pablo Bernabeu
Here I share the format applied to tables presenting the results of frequentist models in Bernabeu (2022; the table for Bayesian models is covered in this other post). The sample table presents a mixed-effects model that was fitted using the R package lmerTest (Kuznetsova et al., 2022). The mixed effects were driven by the maximal principle (Brauer & Curtin, 2018). The format of the table resembles one of the examples published by the American Psychological Association. However, there are also deviations from those examples. For instance, in the present table, the effects are grouped under informative labels to facilitate the readers’ comprehension, using the kableExtra package (Zhu, 2022). Furthermore, the random slopes are specified using superscript letters and a footnote. The table can be reproduced using the materials at https://osf.io/gt5uf.
-
A table of results for Bayesian mixed-effects models: Grouping variables and specifying random slopes | Pablo Bernabeu
Here I share the format applied to tables presenting the results of Bayesian models in Bernabeu (2022; the table for frequentist models is covered in this other post). The sample table presents a Bayesian mixed-effects model that was fitted using the R package brms (Bürkner et al., 2022). The mixed effects were driven by the maximal principle (Brauer & Curtin, 2018). The format of the table resembles one of the examples published by the American Psychological Association. However, there are also deviations from those examples. For instance, in the present table, the effects are grouped under informative labels to facilitate the readers’ comprehension, using the kableExtra package (Zhu, 2022). Furthermore, the random slopes are specified using superscript letters and a footnote. The table can be reproduced using the materials at https://osf.io/gt5uf.
-
7 Git articles every open source practitioner should read
Understanding theGit version control system is foundational for many open source practitioners. Whether you are an advanced user or you want 2023 be the year to get started, Opensource.com has plenty of resources for you. Here are a few recent Git articles that I recommend:
The first in a series by Dwayne McDaniels, Git concepts in less than 10 minutes, assures us that, yes, Git can seem intimidating, but knowing and understanding the basic building blocks can break down the barriers. Six basic commands and concepts are explained so you can move on to more advanced Git tools and commands.
5 Git configurations I make on Linux by Alan Formy-Duval is a straightforward guide to getting started working with Git on Linux. There are so many configuration options, and Alan suggests starting with global configuration to help make set up easier every time.
How to rename a branch, delete a branch, and find the author of a branch in Git is a straightforward article about the most common commands around Git branching.
-
Use USB-C Chargers To Top Up Li-Ion Packs With This Hack
In USB-C Power Delivery (PD) standard, the PPS (Programmable Power Supply) mode is an optional mode that lets you request a non-standard voltage from a charger, with the ability to set a current limit of your choice, too. Having learned this, [Jason] from [Rip It Apart] decided to investigate — could this feature be used for charging Li-Ion battery packs, which need the voltage and current to vary in a specific way throughout the charging process? Turns out, the answer is a resounding “yes”, and thanks to a USB-C tester that’s programmable using Lua scripts, [Jason] shows us how we can use a PPS-capable USB-C charger for topping up our Li-Ion battery packs, in a project named DingoCharge.
-
How to read and write files in Rust
Knowing how to read and write files can be useful for various purposes. In Rust, this task is done using the file system module (std::fs) in the standard library. In this article, I'll give you an overview on how to use this module.