Programming Leftovers
-
Rlang ☛ A Practical Guide to Selecting Top N Values by Group in R
In data analysis, there often arises a need to extract the top N values within each group of a dataset. Whether you’re dealing with sales data, survey responses, or any other type of grouped data, identifying the top performers or outliers within each group can provide valuable insights. In this tutorial, we’ll explore how to accomplish this task using three popular R packages: dplyr, data.table, and base R. By the end of this guide, you’ll have a solid understanding of various approaches to selecting top N values by group in R.
-
Nat Bennett ☛ Seriously just write a Rails (Phoenix) app
This is advice you'll see from a certain kind of cranky web developer. "Don't let your team split the codebase!" "You don't need all that Javascript!" But usually the explanation is something like "specialization" or "heavy frameworks." I agree with the advice, sure – there're way too many React applications out there that should have just been Rails apps – but this week, I've been writing a lot of LiveView and I've been thinking about why this feels so much better for a small team than a stack with a strong frontend/backend split.
-
Michael Bburkhardt ☛ Automatic Archival Using EchoFeed
Not sure if this is a good idea or a bad idea, but I’m trying it on for size.
Problem I’m trying to solve is archival of my microblog content—Mastodon posts, status.lol messages, and Flickr and blog announcements. I think the workflow shown here accomplishes all that without duplicating the blog content too much.
I’m going to live with it for a while and see how it goes.
-
Sandor Dargo ☛ When and how variables are initialized? - Part 3
For the last couple of weeks, we’ve been learning about the different forms of initializations in C++. This quest is motivated by a bug I discovered after a compiler update in a code base that I maintained. While I was looking for an answer to what happened, I realized that there are not only default and value initializations in C++ but many more different forms.
-
Bert Hubert ☛ Practical parsing with PEG and cpp-peglib
If I’ll ever stop programming it will be because I can no longer find the energy to parse even just one more string format.
Way back in 2001 I wrote an introduction to Lex and Yacc which still gets an astounding 600 non-bot visitors per month. Lex and Yacc remain very powerful tools, but they don’t integrate too well with modern programming languages. Also, they take some work to set up these days. But for 23 years I could find nothing obviously better. And neither could a lot of other people.
This means that a lot of terrible parsing is going on, using stuff like regexes or artisanally crafted string slicers and dicers.
-
[Old] Bert Hubert ☛ Lex & YACC HOWTO
If you have been programming for any length of time in a Unix environment, you will have encountered the mystical programs Lex & YACC, or as they are known to GNU/Linux users worldwide, Flex & Bison, where Flex is a Lex implementation by Vern Paxon and Bison the GNU version of YACC. We will call these programs Lex and YACC throughout - the newer versions are upwardly compatible, so you can use Flex and Bison when trying our examples.
These programs are massively useful, but as with your C compiler, their manpage does not explain the language they understand, nor how to use them. YACC is really amazing when used in combination with Lex, however, the Bison manpage does not describe how to integrate Lex generated code with your Bison program.
-
Ben Tsai ☛ Multidimensional Prototyping
A few weeks ago, I offered some thoughts on prototyping to this year’s MHCI cohort at CMU. The design capstone projects are at a phase where teams are developing prototypes to test their designs and advance their thinking about their problem areas.
-
[Old] Ted Kaminski ☛ The one ring problem: abstraction and our quest for power
A quick story about me: I recently finished up a thesis related to extending programming languages with new features. One of the things I got to do along the way was take some time looking back on some old proceedings from conferences on that exact topic (Extensible Languages Symposium 1969 and 1971), to get familiar with what people have already thought up. While looking over them, I realized there was an unfortunate common theme:
Quite a lot of papers would come up with something they wanted to do, show that existing designs were incapable of doing it, then design some more powerful system where they could.
I believe this thought process is a common failing among programmers.
-
Positech Games ☛ Sanding the woodwork
Take my sarcastic boatbuilder buddy’s advice. Sand the fucking woodwork. When you start work, when you are motivated, when you are excited, do some of the grunt work. Code the error handling, optimize the rendering. Check the game runs on min-spec. Do the multi-language support. Do the steam API implementation. Do the options menu. Do the level editor. Do the modding support. Do the stuff you know you wont want to do later. This is the way. Then when you feel your motivation flagging, go decide what color the laser beams should be.
-
Erlang ☛ The Optimizations in Erlang/OTP 27 - Erlang/OTP
This post explores the new optimizations for record updates as well as some of the other improvements. It also gives a brief historic overview of recent optimizations leading up to Erlang/OTP 27.
-
Cliff L Biffle ☛ lilos v1.0 released
After five years of development, something like seven art projects, one commercial product, and many changes to the dark corners of the Rust language, I’ve decided lilos is ready for a 1.0 release!
-
Perl / Raku
-
PerlMonks ☛ The strictures, according to Seuss
This is what happens when you read too much Dr. Seuss' "Green Eggs and Ham" to your kids and spend too much time on PerlMonks.
-
-
Python
-
Sumana Harihareswara ☛ Model UX Research & Design Docs for Command-Line Open Source
Back in 2020, during grant-funded work on the next-generation pip resolver, the consultancy Superbloom (previously Simply Secure) did fascinating user experience research and design work. I was the project manager on this work, and can attest that working with UX experts on pip was crucial and valuable. The more we knew about users’ experience, the better decisions we could make.
During that work, they wrote several useful documents that took a while to get merged, but now live in pip’s documentation! Like: [...]
-
Python ☛ UX Research Results - pip documentation v24.1.dev0
Over the course of 2020, the pip team worked on improving pip’s user experience, developing a better understanding of pip’s UX challenges and opportunities, with a particular focus on pip’s new dependency resolver. The Simply Secure team focused on 4 key areas: [...]
-
-
Shell/Bash/Zsh/Ksh
-
TecMint ☛ How to Use Comparison Operators & Data Filtering with Awk – Part 4
In this part of the Awk series, we shall take a look at how you can filter text or strings using comparison operators.
-
-
Standards/Consortia
-
Chris O'Donnnell ☛ Baseball and radios
This article about a 50 year old GE radio that still works isn't really about the radio. It's not even about the fact that nothing we use today will still be functional in 25 years, let alone 50. It's about how a piece of technology can connect across 3 generations of a family that used that radio to listen to baseball or get the early morning school closing report.
-
MaskRay ☛ When QOI meets XZ
QOI, the Quite OK Image format, has been gaining in popularity. Chris Wellons offers a great analysis.
QOI's key advantages is its simplicity. Being a byte-oriented format without entropy encoding, it can be further compressed with generic data compression programs like lz4, xz, and zstd. PNG, on the other hand, uses DEFLATE compression internally and is typically resistant to further compression. By applying a stronger compression algorithm on QOI output, you can often achieve a smaller file size compared to PNG.
-