Latest post

Oct 9, 2026, 00:29:58

One leg of my glasses fell of. After I glue it back, the legs become unbalanced. However, I cleverly fixed it by using a piece of paper to compensate for the leg height difference.

follow me on Mastodon

Articles

  • Monkey-patching graciously

    Article cover image with no practical usageMonkey-patching is a powerful tool in programming. In this article, I used techniques of Ruby metaprogramming to define a series of methods def_after, def_before, etc. to help monkey-patching. They look graciously in that we can use it to shorten the codes for monkey-patching (avoiding aliasing and repeating codes).

  • Amazing Siteleaf

    Article cover image with no practical usageI have been using Siteleaf to manage my blog. It is just convenient and amazing.

  • Hyperellipsoids in barycentric coordinates

    Article cover image with no practical usageIn this article, I introduce the barycentric coordinates: it is an elegant way to represent geometric shapes related to a simplex. By using it, given a simplex, we can construct a hyperellipsoid with the properties: its surface passes every vertex of the simplex, and its tangent hyperplane at each vertex is parallel to the hyperplane containing all other vertices.

  • Use complex numbers as canonical variables

    Article cover image with no practical usageIn this article, I try exploring an idea: using complex numbers to combine pairs of canonical variables into complex variables: c≔αq+iβp\mathbf c\coloneqq\alpha\mathbf q+\mathrm i\beta\mathbf p. It turns out that we can write canonical equations dcdt=−2iαβ∂H∂c∗\frac{\mathrm d\mathbf c}{\mathrm dt}=-2\mathrm i\alpha\beta\frac{\partial\mathcal H}{\partial\mathbf c^*}, Poisson brackets {f,g}=−2iαβ(∂f∂c⋅∂g∂c∗−∂f∂c∗⋅∂g∂c)\left\{f,g\right\}=-2\mathrm i\alpha\beta \left(\frac{\partial f}{\partial\mathbf c}\cdot \frac{\partial g}{\partial\mathbf c^*}- \frac{\partial f}{\partial\mathbf c^*}\cdot \frac{\partial g}{\partial\mathbf c}\right), and canonical transformations ∂c∗∂c′∗=∂c′∂c,∂c∂c′∗=−∂c′∂c∗\frac{\partial\mathbf c^*}{\partial\mathbf c'^*}= \frac{\partial\mathbf c'}{\partial\mathbf c}, \frac{\partial\mathbf c}{\partial\mathbf c'^*}= -\frac{\partial\mathbf c'}{\partial\mathbf c^*} in these complex numbers. Finally, I show two examples of using them in real problems: a free particle, and a harmonic oscillator.

  • Giving birth to my own blog

    Article cover image with no practical usageThis is my first blog! I will share interesting things in my life here.

subscribe via Atom