Programming Leftovers
-
Pandas Bins
In Python, the “pandas.cut()” and “pandas.qcut()” method is used to create the bins based on the input boundary values or based on the sample quantiles.
-
Python Errno
The “errno” module in Python defines a dictionary called “errorcode” that maps from error codes to symbolic names, such as error code “1” is mapped to “EPERM”.
-
Python trajectory waiting
In simple motion control applications with moteus, a common request for the python library is “run a position command until it is complete”. moteus does track when the target position reaches the desired one and reports it in the “trajectory complete flag” (register 0x00b), however until now the application needed to poll that flag on a regular basis to see when the motion is done.
-
Randomness in programming (with Go code)
Computer software is typically deterministic on paper: if you run twice the same program with the same inputs, you should get the same outputs.
-
getaddrinfo() on glibc calls getenv(), oh boy
getaddrinfo() is pretty much required if you want to connect to anything beyond mere legacy IPv4 gunk, so it's not like you can avoid it. You're probably going to call it quite often if you are opening connections over the IPv6 Internet.
-
Estimates are about time, so let's cut to the chase
As software engineers, we routinely estimate our work. Our most common brush with estimates is when we estimate individual tasks within a sprint. Usually, we do that with abstract points, and that's the wrong way about it. We should be cutting to the chase and estimating directly in units of time.
Note: Although those post reads as a strong opinion ("x is wrong, do y"), the subject is much more nuanced than that. We've used points on most teams I've been on, and it's fine! I just think we can all do better, maybe!
-
Optimizing SQL Queries With Code Examples In Go
Scalability and performance are important metrics you’ll pay attention to as you build your applications. Optimising SQL queries is important to your app’s performance. Optimizing queries involves tuning queries to make them faster and more efficient, involving rewriting queries, caching, query simplification, indexing, and connection pooling, amongst other measures.
Slow queries can slow down your application’s performance and harm business outcomes. By optimizing your SQL queries, you enable your app to handle more requests and process data quickly.
In this tutorial, you’ll learn how to optimize SQL queries for your Go applications with GORM and the Postgres DBMS. You’ll learn how to use various optimization techniques, including indexing, query simplification, caching, and connection pooling.
-
Interactions – where are you?
The {hstats} R package introduced in our last post measures their strength using Friedman’s H-statistics, a collection of statistics based on partial dependence functions.
-
AddressSanitizer: global variable instrumentation
AddressSanitizer (ASan) is a compiler technology that detects addressability-related memory errors with some additional checks. It consists of two components: compiler instrumentation and a runtime library. To put it simply, [...]
-
Wrapping Meshes With Geodesic Walks
I've been working on building a game engine of sorts in Three.JS, and along the way I've been creating some levels and demos for it. My 3D modelling skills have come a long way but they're still quite bad, so I've been using procedural or semi-procedural generation a lot as part of my work.
For one level I was working on, I wanted to cover the surface of a large building with decorations to help give it a bit more character. I wanted it to be part of the environment and have it span over large parts of the map, so creating it procedurally seemed like the best idea. I thought it would be cool to have it spread over the surface like vines.
Well, I did end up accomplishing that goal - but the process of getting there was much longer and more complex than I expected. The solution involves a lot of cool techniques, though, so I figured I'd write this up to go over it.
-
[Updated] 11 Best GitHub Alternatives to Host Open Source Projects
Since Microsoft acquired GitHub, many open source enthusiasts are probably weary of this acquisition, knowing very well that Microsoft is a for-profit company, and who knows terms and conditions are bound to change (as is always the case with such deals) concerning the world’s leading software development platform.
-
Running a CRaC Java application on Raspberry Pi - UPDATE
On July 15th of 2023, I published a post here about my initial experiments with CRaC on the Raspberry Pi. At that time, I found out that both the Linux kernel in Raspberry Pi OS and the Zulu Build of OpenJDK still needed some changes to work on the Raspberry Pi. I created a ticket in the Linux kernel project, which was solved by Phil Elwell. Last week, a new version of the Raspberry Pi OS, based on Debian Bookworm, was released. And in september, version 21 of OpenJDK was released and the Zulu Build of it, includes CRaC. So let’s see if we can use CRaC without issues, if we bring all this togheter.