Recent Posts

  • WuBi 98 Input Method Table for ibus

    I have written a seris of posts on how to extend WuBi 98 support to various platforms. The company that is maintaining the official WuBi 98 distribution (i.e. WangMa) has put little effort into updating their software for modern operating systems. I have purchased their WuBi IME on Windows, and it kept crashing my other applications due to poor compatibility with Win10 APIs. The worse thing is that they only allow you to install their IME on three distinct computers. Since I switch hardware rather regularly, it is not feasible to use their software anymore.

  • How many rounds does the small circle rotate?

    Today I came across a very interesting problem: suppose a small circle with radius 1 is rolling on a big circle with radius 2, how many rounds does the small circle rotate when it rolls around the big circle once? Being told the correct answer is 3, I am confused as I am unable to figure it out. Therefore, I wrote a program to simulate the scenario.

    The correct answer is three rounds.
  • From LaTeX to Jekyll markdown: towards faster post compilation

    Recently, I updated my texlive distribution to 2019. I think I am experiencing a huge boost in compilation speed, though I have not yet done some serious comparison. As I start to take notes with Jekyll in this semester, a problem gradually stands out: speed. Writing with Jekyll are slow in two ways. Firstly, its compilation speed is slow. Secondly, it does not provide any navigation functionality. Therefore, if I am able to write my posts in and convert them into Jekyll markdown afterwards, I can potentially save a lot of time.

  • Emulating Ubuntu Terminal with LaTeX

    This semester, one of the courses that I attend requires screenshot of terminal output as a proof of completion. Personally, I dislike including screenshots in my submissions as their nature is very different from the dominating component of the document (i.e. text). The reader (grader) is unable to interact with the image, and the difference in resolution and format will bring more trouble for him/her. Therefore, I would like to emulate Ubuntu terminal within documens, and the output would be text-based.

  • PyCG 8: Audio Oscilloscope

    Oscilloscope music is a very unique music genre, which is mainly developped by Jerobeam Fenderson (see the video below as an example). The idea is that you can not only listen to it, but you can also see it visually. Indeed, if you pass the audio signal into an oscilloscope, the fancy patterns cleverly designed by the artist will be revealed. This time, let us find out how to visualize the wave form given an oscilloscope music.

  • PyCG 7: Simple Ray Tracing

    Ray tracing is a way of rendering photo-realistic photos. I made use of this concept in this post to compute the image of projecting on a spherical screen. This time, let us build a simple ray tracer with Python. This time, OpenGL is not needed.

    Output of the demo
  • Extending Jekyll: A Simple Ruby Program For Indexing

    I try to take my notes digitally last semester with the help of , and I find it really helpful for me and my classmates. However, files needs compiling, and the resulting pdf files is not very well integrated into the web environment either, which makes it very difficult to update changes to the notes. Therefore, I decide to use my blog as my new platform to hold my notes. Actually everything is great about composing notes with Jekyll, but there is only one thing missing - indexing, which is very helpful for class notes. As I realize that there is no existing Jekyll plugins supporting this feature, I have to build one on my own, with Ruby.

  • PyCG 6: Cloth Simulation

    The computer graphics lecture at Berkeley constantly uses awesome cloth simulation videos (e.g. this one) to demonstrate the beauty of computer graphics, and I was truly absorbed by it. As it turns out, the mathematics behind it is not very difficult to understand, and it can be fairly easy to build a simple simulation.

    Video capture of the demo. The video is sped up five times.
  • PyCG 5: Inverse Kinematics

    Have you ever wondered how robotic arms control each of its segments so that its tip locates at an precise location? This is exactly one of the topics of inverse kinematics. Inverse kinematics is the mathematical process of recovering the movements of an object in the world from some other data, such as a film of those movements, or a film of the world as seen by a camera which is itself making those movements. In this case, the data we know is where the tip of the arm should be, and we would like to find out a way to position the arm segments correctly.

    Video capture of the demo
  • Spherical Projection Correction

    In this article I briefly discussed and demonstrated how to simulate projecting images onto a spherical screen with a normal projector. Now, the problem comes naturally: how do we correct the image so that it looks right? By modifying the PyOpenGL program slightly, we can have a image generator that can help us analyze this problem and formulate a solution.