liang, ivan

I once took a photograph of a lighthouse by the beach. I had carefully planned the composition of my photo and was pleased with the result. Later that day, I went to go post it on Instagram, only to realize that the top of the lighthouse was cropped out by Instagram's max aspect ratio of 4:5. If only I had known of content-aware scaling!

Content-aware scaling is a computational photography technique made possible by an algorithm called seam carving. But before we get into the details, let's talk about traditional methods of image scaling.


The goal is to simulate a self-piloting spaceship that can navigate through an asteroid field without collisions. I implemented a Kalman filter that estimates the state of the system — the asteroids’ future positions. Knowing where each asteroid is heading, I then programmed the spaceship to choose the best heading and velocity at each time step as not to crash into any asteroids.


Last updated: April 9, 2021

A set of notes made when I was learning about web authentication. Like with anything else in software development, there are tradeoffs between using sessions vs. JWTs. At the end of this post, I highlight the security concerns that need to be taken into consideration when using JWT authentication.

Traditional client-server interactions were straightforward request-response cycles. Modern Single-Page Application (SPA) interactions can be more complex, and can involve multiple clients and servers.