Occasional memory dump of various things.



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 →


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 →


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 →


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 →


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 →


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 →


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 →


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 →


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 →


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 →


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 →


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 →


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 →


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 →


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 →