Programming Leftovers
-
Git rebase: Everything You Need to Know
The Git rebase command combines two source code branches into one. The Git merge command does that too. We explain what rebase does, how it’s used, and when to use merge instead.
-
Andy Wingo: i'm throwing ephemeron party - you're invited -- wingolog
Good day, hackfolk. Today's note tries to extend our semi-space collector with support for ephemerons. Spoiler alert: we fail in a subtle and interesting way. See if you can spot it before the end :)
Recall that, as we concluded in an earlier article, a memory manager needs to incorporate ephemerons as a core part of the tracing algorithm. Ephemerons are not macro-expressible in terms of object trace functions.
-
Qt Installer Framework and Qt Online Installer 4.5.1 Released
Qt Installer Framework and Qt Online Installer 4.5.1 have been released today.
-
Day 10 (Advent of Code 2022)
...to parse the input into nicely-organized Rust data structures: [...]
-
Espresso: Find Out If .take_while() Reached The End
In yesterday's Advent of Code (mild spoilers ahead), there was a section where one had to figure out how far the elves can see, based on the height of a line of trees in that direction. The answer was to be given in the number of trees they see.
-
What is in a modern code editor?
Before we begin, let me give you an idea of where I am coming from and what my experiences are based on. Just to get it out of the way, I'm currently an Emacs user. That said, I have used a lot of text/code editors, all the way from Notepad to JetBrains IDEs(well, in the past) or even the Borland C++ editor which looked like this running on DOS.
-
An experimental GoToSocial installation
Why GoToSocial and not Mastodon? The latter scares me: it has too many moving parts for my taste, and the former is one of these lovely single Go binaries – sufficient reason to chose it in spite of the project’s warning: [...]
-
Git Tip: Find the Top Contributors
From time to time it’s useful to know who are main authors of some piece of a project. Admittedly most of the time I want to check who are the top contributors to some Git repository I’d use a web interface for this (e.g. GitHub). Probably because I never bothered to remember the magic incantations to do this with the git command-line interface and probably because statistics often look better when you have a have richer UI toolkit to render them. That being said, today I was reminded how easy it is to cover the basics with the command-line. If we want a list of the top 10 contributors (in terms of commits) we can get it like this:1
-
Hybrid fuzzing: Sharpening the spikes of Echidna
Echidna is a property-based fuzzer built by Trail of Bits that is widely used in smart contract bug hunting. (See its README for a list of notable uses of Echidna and some of the vulnerabilities it has found.) It lies in the category of “smart fuzzers,” which use the ABI of a contract and perform static analysis of its source code to make decisions on how best to generate input data.
-
It’s time to stop using Python 3.7
Still, there is only so much time you can delay upgrading, and for Python 3.7, the time to upgrade is over the next few months. Python 3.7 is reaching its end of life as of June 2023.
No more bug fixes.
No more security fixes.
-
Why Do Product Managers Need Product Analytics?
In the last decade, product managers of digital products have managed to create mind-blowing smartphones, self-driving cars, and virtual reality devices without product analytics. So, why would product managers need to change their way of working now?
-
Just How Good Is ChatGPT in Data Science? | Mad (Data) Scientist
Many of you may have heard of ChatGPT, a dazzling new AI tool. We are hearing lots of gushing praise for the tool. Well, how well does it do in data science contexts? I tried a few queries here, and found interesting results.
I first requested, “Write an R function that returns every other element of a vector x, starting with the third.” I won’t show the code here, but suffice it to say that it worked! It did give me correct code.
Next, “In R’s built-in dataset CO2, fit a linear regression with ‘uptake’ as the outcome variable, and find the standard error of the intercept term.” Alas, it begged ignorance: “…I do not have the ability to perform calculations or access specific datasets…” Not really true; unfortunately, ChatGPT was not able to pick up the key phrase, “built-in.”
-
Portal with RTX Free DLC Available December 8, with Full Ray Tracing & NVIDIA DLSS 3
Portal with RTX is launching December 8th, bringing full ray tracing and DLSS 3 to one of the best video games of all time. Wishlist on Steam now.
-
How to score Rock Paper Scissors - Higher Order Functions
Ho ho ho, it is the most wonderful time of the year: Advent of code!
AOC is a yearly collection of programming puzzles throughout the first 25 days of December. I like it… so much so that I wrote an R package for completing my puzzles using the structure of an R package. The puzzles start out easy and get progressively more elaborate or devious in their requirements. But I am going to talk about an easy puzzle in this post, and specifically, one little trick I used in my solution.
Day 2 of 2022 requires us to score games of Rock Paper Scissors. The moves are encoded using letters, where our opponent’s moves are coded as A, B, C and ours are coded as X, Y, Z.
-
Please Avoid detectCores() in your R Packages
The detectCores() function of the parallel package is probably one of the most used functions when it comes to setting the number of parallel workers to use in R. In this blog post, I’ll try to explain why using it is not always a good idea.
-
rOpenSci | How to Save ggplot2 Plots in a targets Workflow?
I really enjoy using targets for all of my data analysis projects, especially because it helps me structure all of the projects nicely in the same folder. For targets projects, I often produce several figures using ggplot2. However, there are no formal recommendations for saving ggplot2 objects (as opposed to static images) in a targets workflow.
I want to keep my plots accessible to be able to revisit them any time and to assemble them with patchwork into more complex figures for a potential paper. In a regular project I generate 10 to 20 figures, some only diagnostic ones and some polished ones for the finished manuscript. I do revisit the list of figures often, as co-authors or reviewers ask me for more detailed analyses and visualizations.
In most cases, I don’t know before hand the sizes of the figures nor their formats, so I like to save the ggplot2 plots as R objects and not images in my targets workflow. I sometimes edit them for a presentation, a paper, or a poster, so I like the flexibility of saving them as R objects. This allows me to change their aspect ratio or their style on the fly without having to re-create them.
-
How to test the significance of amediationeffect
How to test the significance of a mediation effect?, To perform a sobel test in R is covered in this lesson.
Using R to run a Sobel test We can use the bda package to run a sobel test in R.
-
Linux - How to work with complex commands
It can frustrate to work on complex commands in the terminal. I'll present you some tips on how to manage them. If you have another tip, I'd appreciate a quick message.
-
Unix's special way of marking login shells goes back to V2 Unix (at least)
Many Unix shells have some command line argument that tells them that they are a login shell; for example, Bash has '-l' (also '--login'), and I think that '-l' has become the de facto standard. However, this argument is not how Unix programs like sshd and login actually tell your shell that it's a login shell; instead, for a long time, a login shell has a '-' as the first character of its program name, or to put it another way, argv[0][0] is '-'.
-
Evaluating Rust's http/websocket frameworks - Martin Pitt
I spent this day of learning on evaluating the three popular high-level Rust frameworks for HTTP/websocket servers. At some point we want/need to rewrite Cockpit’s web server, and Rust feels like a natural choice for this (besides Python).
[...]
I started with warp, as this seemed to be the most “modern” framework. I liked its idea about building everything from filters, as it is functional and flexible. You can see the implementation in the warp-server directory of my “learn rust” project. It implements /hello, /dir (without compression support, as warp::fs::dir does not support that), and the two websocket routes.