Latest post
Last Friday, my #GitHub Education Pack benefits expired, and then all my workflows stopped working. I immediately filed a new application, but the Education Pack would only become effective 3 days after the application was approven. Ah, I really need to have #selfhost-ed runners should I have a decent enough spare machine at home.
follow me on Mastodon
Articles
-
Polymorphism on a single object in Ruby
By dynamically redefining singleton methods on an object and instance methods on an extended module, we can achieve polymorphism on a single object based on the context. With the new Proc#refinedmethod in Ruby 4.1, this can be done in a simpler way. -
How Pareto optimizations of distances relate to closed convex hulls
The distance preference relation is the preference relation over a metric space where points nearer to the ideal point are preferred. Suppose there are some agents with distance preference relations over a real normed space, then the (weak/strong) Pareto set of them may contain or be contained by the closed convex hull of their ideal points. This article attempts to completely classify normed spaces based on whether the property holds for all finite sets, all compact sets, all bounded sets, or all sets of ideal points. Several characterizations in infinite dimensions remain open. -
Reducing build time of my blog by 88% by optimizing cross-language invocations
Waiting for my blog to build has been making writing articles unpleasant for me. In order to speed up the building, I revamped my Markdown engine to call Pandoc through FFI and call KaTeX through MiniRacer. I am careful to ensure that the cross-language invocations support multithread operations. This reduces the build time of the full site in production configurations on the CI machine (GitHub provided runners) from 156 seconds to 19 seconds, marking a 88% reduction. -
Analyzing the narrative of Kittens Game
Kittens Game is an incremental game that has very few narrative sentences presented in the game. However, it tells a very rich story in its own unique way through the interaction with the player. -
Text-based visual art in LaTeX
Using the verbatimboxpackage, one can include a text-based visual art in a figure in a document generated by LaTeX. -
Ways of reducing mass rebuilds in Nix without changing Nix
One serious problem with Nix is the amount of mass rebuilds happening in Nixpkgs every time some package with many dependents gets an update. I thought about three ideas to reduce mass rebuilds: store path replacements, separating compiling and linking, and ditching check phases. Each of them has some degree of impracticality. -
Determining the stabilizability of the abelian sandpile model
The abelian sandpile model is a cellular automaton where each cell is a sandpile that can topple to put grains on neighboring cells when having enough grains. It is stable if none of the sandpiles can topple. A natural question to ask is whether it can become stable eventually. In this article, I will show that one can determine the stabilizibility usiung integer linear programming for the abelian sandpile model on an arbitrary finite graph. -
From Picard iteration to Feynman path integral
The Schrödinger equation is an ODE, so we can approach its solution through Picard iteration. This approach leads to a sum over walks on the graph formed by an orthonormal basis as vertices and the Hamiltonian matrix elements as edge weights. This sum is exactly the Feynman path integral if we choose the position basis and take the continuum limit. -
Imperative programming in Nix language
Nix is a functional programming language primarily used for package management and system configuration. However, it may be interesting to emulate imperative programming constructs within Nix. This post explores how to achieve imperative-style programming in Nix, ipmlementing control flow, exception handling, and interactive IO. -
Multi-pass Gaussian blur filter
According to the central limit theorem, the sum of some i.i.d. samples is normally distributed in the limit of large sample size. This fact can be used to implement a multi-pass Gaussian blur filter, where the total number of passes is equal to the number of samples used in the averaging. Through this, we can also see a nice relation to the heat equation, which is not surprising since the heat kernel is a Gaussian function.
subscribe via Atom