This past week, I encountered a super interesting problem while working with C++ at Google. On a day to day basis, most of the software I deal with is written with C++ and an internal configuration language known as GCL. This week, I was working on a fairly significant migration using an internal API when I encountered a fascinating problem that exposed me to the madness of C++ macros.

Allow me to set the stage.

Pretend that this API contains an APIFactory class, and that there exist two C++ macros to declare instances of APIFactory. …


Major felonies in New York City from 2000–2019, context for article

Recently, a friend on Facebook shared the following opinion piece written by the New York Post: “Crime is up — and it feels like the city is headed back to the 1970s” by John Podhoretz. After reading it, curiosity got the better of me, since other articles I’ve perused over the past year seem to imply that the general trend of crime in New York City is that it has been steadily decreasing.

This was an interesting tidbit to me since this piece noted that:

… according to official statistics, the number of similar crimes in this precinct has doubled…


Everyone has heard the adage “there’s no such thing as a bad question”. Unfortunately, there most certainly are such things as bad questions. But fear not, having a bad question is a natural step on the way to asking good questions. I hope that after reading this piece, you’ll have a much better time getting the information you want through questions you ask, and that solving problems becomes much easier for you to think about.

This post is going to be a wall of text, with very few fun graphics like my normal posts, so I will keep it as…


This weekend, I revisited my post on building a bot to play Tetris. I had a random shower thought of using a genetic algorithm to try and optimize the bot by structuring the internals of the bot as a rankable “chromosome”. When I first approached this problem, I started with the idea of permuting all the possible positions a tetromino could fall into a given field. This post will build on that idea by trying to find smarter ways to choose which position and orientation to drop the tetromino into.

Rationale

I tried my best not to read anything online about…


Audio Spatializer, submission for BrickHack4

Some Background Information

I spent last weekend hacking at RIT’s BrickHack 4. Normally, I love to spend my hackathons building multiplayer games, but this time, I wanted to try working on an idea that I’d had in the back of my TODO list for a while. This idea came to me after I was listening to some nightcore (a remixed track of a song that speeds it up, increases its pitch, and puts more emphasis on a strong beat). Specifically, I was listening to this one on YouTube:

If you skip to the 0:36 mark, you can hear an interesting audio effect…


I love the open source community. The node.js ecosystem is a fantastic place and you can find packages for literally everything on npm. The problem is, you can find packages for literally everything, and sometimes more than one package that accomplishes the same thing.

From the most abstract standpoint, this is one of the best things about open source code. Anyone can publish anything, and if you don’t like a package or you want something else, you can fork it and modify it however you want to suit your own purposes. This has proven useful to me in the past…


(just the most viewed portions)

I’m not sure how I came up with this idea, but some time ago, I wanted to scrape a bunch of websites to see what the most popular colors and colors themes were. In this techsploration, I generated screenshots of the top ~400 most trafficked websites and analyzed what colors were most commonly used by all of them. This was an interesting data scraping project and I used this as an opportunity to learn about multi-threading, color theory, and matplotlib. …


While I was doing laundry, my friends and I decided to mess around on TypeRacer, a popular web game where you race against others in a typing test to see who can type a phrase or sentence the fastest. Normally, I have an average typing speed of 120~130 wpm (words per minute), but just for fun, I wanted to mess with my friends. In this techsploration, I’m going to explain how I did it.

Let’s go into a practice game and snoop around to see what we can find.

TypeRacer practice game

Here’s what the interface of a practice game looks like. …


The Rochester Institute of Technology (RIT) has one of the largest populations of deaf, NTID (National Technical Institute for the Deaf), and hard-of-hearing students in the world. As a result, there are a myriad of services available such as captioning, ASL interpreting, and note taking. As a student at RIT, I work as a NTID note taker for some of my classes. …


It’s that time of year where college acceptances and rejections are being sent out to thousands of prospective students. Some of you will have gotten into your dream schools, and to you, I say congratulations. You have earned the honor and your hard work has paid off. To those of you that didn’t, fret not. There are many more opportunities and college should not be the be-all end-all of your aspirations. I learned a lot of valuable things during my own experience with college rejection and I hope I can change your perspective with my story.

My Personal Journey

In 2016, I applied…

Alvin Lin

I'm a software engineer from New York City with a permanent case of bed hair.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store