Programming Leftovers
-
Python API deployment with RStudio Connect: FastAPI
[200~FastAPI is a light web framework and as you can probably tell by the name, it’s fast. It provides a similar functionality to Flask in that it allows the building of web applications and APIs, however it is newer and uses the ASGI (Asynchronous Server Gateway Interface) framework. One of the nice features of FastAPI is it is built on OpenAPI and JSON Schema standards which means it has the ability to provide automatic interactive API documentation with SwaggerUI. You also get validation for most Python data types with Pydantic. FastAPI is therefore another popular choice for data scientists when creating APIs to interact with and visualize data.
In this blog post we will go through how to deploy a simple machine learning API to RStudio Connect.
-
Quasi-likelihood Gamma regression in statsmodels for zeroes in observations
Generalised linear models with a gamma distribution and log link are frequently used to model non-negative right-skewed continuous data, such as costs [1].
-
Zipping Collections in OCaml
Many programming languages have a function for combining the elements of multiple collections (e.g. arrays or lists) together. Typically this function is named zip. Here’s an example from Haskell: [...]
-
Value Accrual in the Crypto Infra Stack
Does value accrue at the protocol layer or the application layer? Value creation is not the same as value capture. The prevailing thesis has been one of Fat Protocols (2016) / Thin Applications (2020).
[...]
Application-specific blockchains. Forgo the base layer and build a vertical solution. We saw dYdX move to its own app chain. Like successful applications built on a PaaS, the largest customers churn out of your platform and build their own vertical solutions. Building your own application-specific blockchain still seems like migrating off Heroku to build your own Heroku – when you really need your own bespoke infrastructure. This I why I believe dYdX and on-chain exchanges won't be able to compete with fully off-chain ones.
-
Release Anxiety
I build pyinfra, a tool for deploying infrastructure using Python. I recently not so recently released v2.0 and it was months late for absolutely no reason. Enter release anxiety.
What if someone PRs a cool new thing tomorrow? What if there’s undiscovered bugs? What if documentation is missing?
There is an endless stream of anxiety inducing what-ifs floating in my head in the run up to a release. On the other side there’s an ever growing pressure to make the release. The walls are closing in.
-
Take the RStudio IDE experimental support for arm64 architectures out for a spin | R-bloggers
Apple’s bet on the arm architecture with their M1 and M2 processors has had an interesting side effect, developers of mainstream software are now forced to support the arm64 architecture and, since they are already supporting macOS for Apple Silicon processors anyways, supporting Linux arm64 distributions is no longer that much of a burden for them. The RStudio IDE development team is not strange to this circumstance and they have been working on general arm64 support. Currently, they have made available experimental builds for the arm64 architecture (also known as aarch64) compiled for Ubuntu 22.04 (possibly compatible with Debian 12 as well) and since Ubuntu 22.04.1 LTS has official support for Raspberry Pi SBCs, I have decided to give it a try. If you are interested, join me in the installation process.
-
Developer Tools for Kubernetes - Earthly Blog
When you get started on your path as a developer, you may notice from the beginning that there’s an abundance of different tools to choose from. At the same time, it may not even be clear why you need to use specialized tools rather than simply using the programs natively.
To put it simply, tools are there to assist you in becoming more efficient in your workload, making sure that you aren’t wasting time getting work done. On top of that, some tools may even bring more advanced capabilities to your workload, like being able to view the status of multiple different services at once.
This is especially true when you start working with Kubernetes. You will notice that there’s an abundance of tools to help you in your developer journey. For example, you may find that deploying to Kubernetes can cause issues you wouldn’t otherwise experience, as access control may be different than what you’re used to. Or, perhaps you find that deploying using only standard Kubernetes manifests is too much of a hassle.
-
Streamlining The Toolchain
Sometimes I try to do something magical, and it works. Most of the time this happens because other people have done a good part of the work for me, and shared it. I just cobble a bunch of existing tools into a flow that fits my needs. But the sum of all the parts is often less than the whole, when too many of the steps involve human intervention. Tools made for people simply keep the people in the loop.