Programming Leftovers
-
Matt Rickard ☛ The Unreasonable Effectiveness of Monte Carlo
Monte Carlo methods are used in almost every branch of science: to evaluate risk in finance, to generate realistic lighting and shadows in 3D graphics, to do reinforcement learning, to forecast weather, and to solve complex game theory games.
There are many types of Monte Carlo Methods, but they all follow a general pattern — using random sampling to model complex systems.
-
Chris Clark ☛ Robot Dad
Tired of Alexa's feeble "here's what I found on wikianswerspam.com" responses to my eight-year-old son's science questions, I whipped up Robot Dad during my Thanksgiving break. He now runs in the background of our family computer.
Robot Dad sounds like real dad, thanks to voice cloning from Eleven Labs (very easy; I rambled about Formula 1 into a new MacOS Voice Memo for about sixty seconds, uploaded it, and voila), and answers appropriately for an eight-year-old, while deflecting prank requests -- though I suspect prompt injection will soon be second nature to this generation.
-
Daniel Lemire ☛ Parsing 8-bit integers quickly
Suppose that you want to parse quickly 8-bit integers (0, 1, 2, …, 254, 255) from an ASCII/UTF-8 string. The problem comes up in the simdzone project lead by Jeroen Koekkoek (NLnet Labs). You are given a string and its length: e.g., ’22’ and length is 2. The naive approach in C might be: [...]
-
Rlang ☛ Understanding and Implementing Robust Regression in R
If you’re familiar with linear regression in R, you’ve probably encountered the traditional lm() function. While this is a powerful tool, it might not be the best choice when dealing with outliers or influential observations. In such cases, robust regression comes to the rescue, and in R, the rlm() function from the MASS package is a valuable resource. In this blog post, we’ll delve into the step-by-step process of performing robust regression in R, using a dataset to illustrate the differences between the base R lm model and the robust rlm model.
-
Rlang ☛ R Shiny Docker: How To Run Shiny Apps in a Docker Container
It doesn’t matter if you’ve created the world’s best R Shiny application if you can’t share it with others.
-
Rlang ☛ Spatial autocorrelation
-
Rlang ☛ {rhino} vs {golem} vs {leprechaun}: Which R/Shiny Library is Right for You?
Shiny dashboards created using R have become a staple for data professionals due to their flexibility, power, ease of use, and community support when carrying out data visualization and analytics. As the demand for interactive dashboards grows, so does the need for R packages that facilitate their creation.
-
Rlang ☛ Advent of Code 2022
In the lead up to Christmas each year, Advent of Code offers a series of 25 puzzles which start out reasonably simple, but get progressively harder, eventually requiring knowledge of algorithms and dynamic programming techniques. Last year I solved these in (strictly) base R on the day they were released (or as close to as I could). I then (starting Dec 27) went back and re-solved (13 of) them in Rust.
-
Dirk Eddelbuettel ☛ Dirk Eddelbuettel: RcppSimdJson 0.1.11 on CRAN: Maintenance
A new maintenance release 0.1.11 of the RcppSimdJson package is now on CRAN.
RcppSimdJson wraps the fantastic and genuinely impressive simdjson library by Daniel Lemire and collaborators. Via very clever algorithmic engineering to obtain largely branch-free code, coupled with modern C++ and newer compiler instructions, it results in parsing gigabytes of JSON parsed per second which is quite mindboggling. The best-case performance is ‘faster than CPU speed’ as use of parallel SIMD instructions and careful branch avoidance can lead to less than one cpu cycle per byte parsed; see the video of the talk by Daniel Lemire at QCon.
-
Hackaday ☛ BBC Basic Is Back In A Big Way
The BBC has a long history of teaching the world about computers. The broadcaster’s name was proudly displayed on the BBC Micro, and BBC Basic was the programming language developed especially for that computer. Now, BBC Basic is back and running on a whole mess of modern platforms.
-
Jonathan Dowland ☛ Jonathan Dowland: Useful vim plugins: AnsiEsc
Sometimes I have to pore over long debugging logs which have originally been written out to a terminal and marked up with colour or formatting via ANSI escape codes. The formatting definitely makes reading them easier, but I want to read them in Vim, rather than a terminal, and (out of the box) Vim doesn't render the formatting.
Cue AnsiEsc.vim: an OG Vim script1 that translates some ANSI escape codes — in particular some colour specifying ones — into Vim syntax highlighting.
This makes viewing and navigating around multi-MiB console log files much nicer.
-
Perl / Raku
-
Rakulang ☛ More Ab5tract
The Raku Core Developers welcome John Haltiwanger as a full core developer on Rakudo, an implementation of the Raku Programming Language. Usually known by their ab5tract nickname, John has recently been very active in working on RakuAST implementing many features, including: a newly featureful FIRST phaser, the subset and enum types, and a comprehensive new implementation of how WhateverCodes prime themselves and others. These were developed through Pull Requests. That extra step won’t be necessary anymore!
-
-
Java
-
Chris Hannah ☛ Well, I Guess I’m a Java Developer
I’ve also now decided to take a more formal approach to learning more about Java, and how I can become a better Java developer. Even though I used it for a few years at university, and also quite a number of years professionally, I think I’m going to try and focus more time on getting even better.
-
-
Rust
-
Niko Matsakis: Project Goals
Lately I’ve been iterating on an idea I call project goals. Project goals are a new kind of RFC that defines a specific goal that a specific group of people hope to achieve in a specific amount of time – for example, “Rusty Spoon Corp proposes to fund 2 engineers full time to stabilize collections that support custom memory allocations by the end of 2023”.
Project goals would also include asks from various teams that are needed to complete the goal. For example, “Achieving this goal requires a dedicated reviewer from the compiler team along with an agreement from the language design team to respond to RFCs or nominated issues within 2 weeks.” The decision of whether to accept a goal would be up to those teams who are being asked to support it. If those teams approve the RFC, it means they agree with the goal, and also that they agree to commit those resources.
My belief is that project goals become a kind of incremental, rolling roadmap, declaring our intent to fix specific problems and then tracking our follow-through (or lack thereof). As I’ll explain in the post, I believe that a mechanism like project goals will help our morale and help us to get shit done, but I also think it’ll help with a bunch of other ancillary problems, such as providing a clearer path to get involved in Rust as well as getting more paid maintainers and contributors.
-