☕️

Occasional memory dump of various things. The Archive lists all blog posts in reverse-chronological order.

...
2020-08-01

Creating Custom Day/Night Cycle Dynamic Wallpaper for macOS Under 30 Minutes

Note: this post is WIP Ever since the release of macOS Mojave (macOS 10.14), dynamic wallpapers have become one of my favourite things about the OS aethetics. How it works is that the wallpaper dynamically changes based on current time or sun positions using a set of images, typically taken at the same location with the same viewpoint, but at a different time. These set of images are packed into a single multi-frame .HEIC file with added metadata such as GPS or time information used to determine when to transition to the next image.
Read more →

...
2020-07-12

Installing Realtek Wireless Driver for Ubuntu on a Desktop PC

Recently I did a fresh install of Ubuntu (actually Kubuntu) 20.04 on my desktop PC. Unfortunately, my PC motherboard (Gigabyte Z370) does not have any built in wireless or bluetooth chipset, and somehow I need to get internet working. Also I live in a place where there is no ethernet ports, which makes the process more difficult. So, I use one of the cheap USB WiFi adapter I bought from Amazon. It uses Realtec RTL8811CU chipset.
Read more →

...
2020-01-11

CSS Dark Mode

With the rise in popularity in dark mode across operating systems like iOS, macOS, Windows, etc., it is important to also update webpages dynamically depending on the user. Dark mode helps ease on the eyes when the documents are being viewed in dimly lit environment or at night, a common situation for most people. While there are browser extensions that attempts to inject custom CSS as a work around, it’s a lot better if the website natively supports dark mode. I recently updated my website to be fully dark-mode compatible. You may or may not have noticed this change. The point is to make dark/light mode seamless and integrated with the system settings without any extra UI elements like a button the user can toggle on/off.
Read more →

...
2019-12-28

Terrain Generator - Part 1: Theory

Let’s make a simple height-mapped based terrain generator. We will use Processing 3 for this project because it is easy to write code in 3D. To represent the terrain, we will use a height map. To generate the height map, we use a noise function that takes in spacial coordinates and returns a seemingly “random” value.
Read more →

...
2019-10-14

APSC 160 Lab Statistics

Here are some of the statistics I’ve collected for the APSC 160 labs. Because I only run the lab sections L1T, L1K, L1O, and L1D (for the first term). I only have the statistics for these sections. This page will be updated for each labs.
Read more →

...
2019-10-11

macOS for APSC 160

This comprehensive document outlines the necessary steps to setup your macOS for APSC 160. Please follow the steps in sequential order and only move on when you have completed the previous steps. The whole process will take about 50 minutes, with variation depend on your network speed. If you have any trouble, please seek help on Piazza.
Read more →

...
2019-07-27

UBC Macleod Building in Minecraft

Over the last few weeks I’ve been trying to build the Macleod Building in survival Minecraft. After I heard the rumors about the demolishing of the Macleod building in the future, I thought it would be nice to keep a personal copy of it in my Minecraft world. To prolong the longevity of the build, I’ve limited myself to having no third-party mods except for server-side plugins, vanilla Minecraft data-packs, or client-only mods such as shader mods.
Read more →

...
2019-06-18

Curses, Circle, and Golf

A while ago I learned to draw circles using Bresenham’s algorithm (thanks CPEN 311). I also stumbled upon Python’s curses library which enables interactive GUI in the command line. So I decided to make an animated circle that runs in the command line. And then code golf it.
Read more →

...
2019-05-29

Facebook Messenger Formatting Syntax

Here is a collection of useful formatting tricks (that’s a clickbait word – it’s more just syntax) that you can use in Facebook’s Messenger app.
Read more →

...
2019-03-30

Fixing LaTeX Tags in Markdown

In a lot of my older documents and markdowns, I used a lot of inline math such as: $x^2+y^2$. But this is only applicable to niche applications like Typora that I use to take notes. If I wanted to transfer my notes to, for example, this website. The default markdown compiler, kramdown won’t recognize the syntax. There are also no common standard for LaTeX math, so we’ll have to somehow convert the two easily.
Read more →

...
2019-03-28

Mandelbrot Set on FPGA Part 1

After learning about using the VGA modules for the DE1-SoC FPGA development board in one of my CPEN-311 labs, I wanted to make something cooler than just a circle or a triangle. How about a fractal? This post outlines the theory and plan of attack to implement such thing in programmable hardware.
Read more →

...
2018-08-02

Disintegration Effects in Processing

In this small project, my objective is to take an input image and disintegrate it into particles. I will be using Processing 3 because it’s easy to do quick graphical interactives and I’m familiar with it.
Read more →

...
2018-03-14

How to Train Your Motors: Week 4-9

Last time, we’re left with a single motor with optical encoder setup and the motor was barely controllable. This post outlines the progress we have made since then.
Read more →

...
2018-03-07

Interesting APSC 160 Midterm Stats That No One Wants to Know

Invigilating a midterm exam is boring, one fo the thing I need to do is to count the number of students that are present at the exam.
Read more →

...
2018-01-25

How to Train Your Motors: Week 1-3

First, let me introduce our project course, ELEC 391. This year we are building 2-DOF motor controlled laser pointer that is fast enough to draw images. The entire project is split into two teams: motor and control. The motor team is responsible for constructing good motors from scratch, using nothing but materials found in the lab or off the shelf. The controls team is responsible for running simulations, designing motor mounts, joints, and programming the controllers. I am on the controls team.
Read more →

...
2018-01-14

Verilog RNG, File IO, and Simulation

So, you got your Verilog hardware for a random dice game designed and wired up, it is time to put it to the test…..bench. However, you also want to simulate randomness and do the simulation tons of times and somehow analyize the results later. In this post, I will show you how to do just that. Let’s get started.
Read more →