C++ regular_invocable and generative AI
I took interest in C++ random number generation because of the concept of regular_invocable. To my understanding, regular_invocable is C++’s notion of a “pure function”, or something really close to […]
I took interest in C++ random number generation because of the concept of regular_invocable. To my understanding, regular_invocable is C++’s notion of a “pure function”, or something really close to […]
It’s pretty old stuff, but still… Here’s how you typically generate a random number in C++: Let’s dissect it a little. On the one hand, “random_device” is a rather nebulous […]
Summary Unlike many other languages, Python allows abstract static methods (see the reference). A class directly or indirectly deriving from abc.ABC cannot be instantiated, unless all its abstract methods are […]
TL;DR Internally CPython stores strings with fixed character size of 1, 2, or 4 bytes, depending on the string [PEP-393]. The indexing operator s[n] takes constant time. UTF-8 representation can […]
https://codebeautify.org/sqlformatter all the way. It is a 3rd of a 4th link on Google, but it provides the best formatting and the best experience. You paste your ugly formatted SQL […]
A few days ago I discovered (with the help from my colleagues) that ARG instruction in Docker creates a true environment variable that is available inside the commands invoked at […]
When we write a JOIN statement in SQL, it usually goes like this SELECT {columns} FROM parent LEFT JOIN child ON child.parent_id = parent.id Does it ever make sense for […]
Just recording my amazement here. Suppose you have a GraphQL server. How do you ask it what’s the query schema? You would expect something like calling https://myserver/graphql/schema? Nah, that would […]
Yesterday, I had an Internet outage at home. The Internet was down for several hours. This is a perfect time to use Mobile hotspot. But alas, it wasn’t working. I […]
TL;DR: Python statement from module import obj creates a copy of the object in the importing scope. In other words, from module import obj is roughly equivalent to obj = __import__(‘module’).obj. […]