Lights Out Android App
My Lights Out app is based on the 1995 handheld electronic game by Tiger Electronics of the same name. In the 1995 version, the game board consists of a 5x5 grid of lights, and then when game starts, a seemingly random pattern of lights is presented to the player. The player's objective is to toggle lights to turn all the lights off with button presses, preferably in as few presses as possible.
When a light is pressed, the on/off state of the pressed light and all directly adjacent lights are toggled.
Although similar handheld games and apps already exists. There are two things that I believe make my app unique: variable board sizes, and mathematical optimization.
Variable Board Sizes
Many of the apps available today only feature a single board size, usually the classic 5x5. This makes the app less challenging once the user finds a reliable method for solving the single board size and limits the number of possible scrambles. For the 5x5 board, there are 223=8388608 distinct ways to create a scramble. However, there are at least 4 different ways to create any given scramble, leaving at most 219=524288 unique scrambles. All of these scrambles can be solved in at most 15 button presses.
My app allows user to play any board size from the trivial 1x1 to the daunting 10x10, providing orders of magnitude more unique scrambles than the 5x5 alone. I would have allowed even larges sizes, but the buttons were getting too small to reliably press.
In fact, just the 10x10 size has 2100, over 1 nonillion unique scrambles. For comparison, if each unique board were printed on a sheet of paper 0.1 mm thick, the stack of paper would reach to the edge of the observable universe 13.4 billion light years away.
Users have yet another dimension opened to them in being able to play by only pressing buttons that are already on. Although all puzzles that can be solved normally can also be solved by only pressing on buttons, it makes for a much more difficult challenge because the way that most learn to solve the 5x5 board requires pressing off buttons.
I already mentioned how any 5x5 board can be solved in at most 15 button presses. Puzzle enthusiasts and recreational mathematicians like Jaap Scherphuis proved this to be the case. Jaap in particular uses a method of treating solving the board as a linear algebra problem that is described by mathematician Marlow Anderson and Todd Feil in their 1998 paper Turning Lights Out with Linear Algebra.
I implemented Andserson and Feil's method of row-reducing matrices modulo 2 to determine the minimum number of clicks needed to solve any given board. This way users can know how their solve is compared to the absolute best they could do.
Although this value is only one number on a screen, I think it provides valuable information to users about a given puzzle's difficulty and their own solving abilities that no other app has.
Computer Vision Security Camera
This application started when my high-school engineering class had just moved into a larger building. It was common for expensive tools to get lost or stolen, so we needed a way to track these items as they were used and identify theft.
Although the new building already had some installed security cameras, there were still many blind spots, and footage could only be saved up to one week, meaning that if a tool were discovered missing after one week had passed, the traditional security cameras would not be useful in recovering it. My solution was to use Raspberry Pi's, which are small, cheap, and single-board computers, as "smart" security cameras. These devices would be cheaper, more portable, and easier to install than the traditional cameras.
My first goal was to cut down on the storage space needed for footage without sacrificing picture quality or other valuable information. My solution was for the smart cameras to record video only when they detect motion. This way, disk space wouldn't be wasted recording hours of no activity.
This method worked extremely well. In many cases, hours of video was cut down to mere minutes. However, changing lighting conditions throughout the day could add noise to the image that would be mistaken for motion. I decided to fix this problem by allowing the camera auto-adjust its threshold for motion. However, I wanted to make sure all activity would still be recorded, regardless of the lighting conditions. This is where computer vision came to my aid. Using Python's OpenCV library, the camera searches for faces. If any faces are detected, a green rectangle would be drawn around the face in the recorded video feed, an annotated image of the frame containing the face would be saved. The camera waits to recalibrate until no faces have been detected recently.
Code for this project is available on GitHub
I created wmboyles.com because I felt that my front-end development skills were lacking. Front-end development is taught (if at all) in most computer science curriculums as an afterthought. However, I believe that just as students are taught to make clean, legible, and well-documented code through comments and programming paradigms (like object-oriented), they should also be taught how to make clean, navigable, and intuitive front ends. After all, this is the portion of a product with which most end-users will interact. wmboyles.com is meant to meet these design criteria and to be a place to talk about myself and my experience more in-depth than in a resume. In order to have a full experience in creating my own website, I didn't use any hand-holding website builders.
Although the original version of my site was passable, the code was messy, images were difficult to deal with, and the website did not work well on mobile devices. With these issues in mind, I resigned the site to use Bootstrap to give the site a cleaner look and help in addressing mobile issues.
Although you are already viewing the website, all the code is available on GitHub.
While taking a summer physics class dealing with multivariable calculus, I realized how much of the subject I had forgotten even though I took multivariable calculus class (Calc III) only nine months earlier. I also knew that several of my friends who would be taking Calc III in the coming semesters had already requested my notes and advice about the class.
However, I like to keep my notes, which can be hard for others to read, as a reference. I decided to digitize my notes using LaTeX in an abridged textbook structure. I would also add better visual aids than the hurriedly-drawn sketchesin my nodes. This way, I could easily share clear and legible notes, keep the my original notes, and refresh my own understanding. By the time I was finished, I had condensed the several-thousand page textbook into an 81 pages that covered almost all topics mentioned in class while still containing many visual aids and full-length proofs. I feel much more confident in my abilities, and I think my friends will be able to learn from me much more easily.
After completing my notes, I posted the results to r/math, an online community of math enthusiasts. To my surprise my post was incredibly well-received, and several users suggested open-sourcing my work so that others could help make corrections and suggest additions. The repo is available and has already taken several community contributions.
I've begun expanding the scope of the project beyond multivaraible calculus. I recently completed a 92-page summary of introductory differential equations, and hope to start working on a similar document for linear algebra. Due to user suggestions, a summary of single variable calculus is also forthcoming.
Twitter Bad Words Bot
The specific words that people choose to use can provide insight into their background and character. Although reasonable people can vehemently disagree, a good indicator of mutual respect between two parties is that neither resorts to vulgarity. Inspired by other bots on platforms like Reddit and Discord that could provide information on the language that users have used and play a part in keeping online discussion civil, I set out to create a Twitter bot that when called upon by a Twitter user would provide information on vulgarities that a requested user had recently tweeted.
Bad Word Count Bot Report for @badwordsmovie's last 100 tweets— Bad Word Count Bot (@BadWordCount) October 9, 2019
bitch - 3
hell - 3
fucking - 2
fuck - 2
ass - 1
cunt - 1
fucker - 1
damn - 1
tits - 1
asshole - 1
shit - 1
I wrote the bot in Python, following basic online video tutorials that detailed how to work with the Twitter API through the Python library tweepy. Although these tutorials showed me how to detect when a user had @ mentioned the bot and how to respond to tweets, the real challenge and substance of this bot came from accessing another user's tweets, parsing through them to find bad words, and reporting the frequency of these bad words within the 280-character limit of a Tweet.
After finding separate answers on how to access a given user's tweets, I got to work on detecting bad words. Although I found several GitHub repos that contained lists of bad words, many were too comprehensive, marking even words with possible negative connotations, like the names of political parties, as bad. I eventually settled on a list of 444 common words collected by Google. This list was comprehensive enough to cover most bad word, and even common variations like swapping a letter for a number. On the implementation side, I took advantage of Python's built-in dictionary functionality to find matching bad words in a user's 100 most recent tweets and rank them by frequency.
The bot is currently not deployed. I hope to find a long-term, affordable, and reliable deployment solution.
Jeopardy! has for a long time been one of my favorite TV game shows. I enjoy how the game is mostly skill-based and I always learn something new when I play along. When I heard about the free JService API from a friend, I thought this would be a fun opportunity for me to learn about interacting with APIs.
The biggest issue came from some unavoidable problems with the JService API. For API problems, some Jeopardy! clues use sounds or videos as clues, the gimmick of certain categories are also hard to understand without an explination from the host. JService provides access to neither of these things. Although JService has made an effort to remove these sorts of clues from its dataset, some still remain. Further, the answers to certain clues sometimes contain extraneous words like "a" or "the". To avoid the user being penalized for responses that arent't letter for letter perfect, I've included an "I'm Right" button that gives the user credit for an answer that doesn't exactly match the one provided by JService. Another big difference between traditional Jeopardy! gameplay and mine is that I don't require users to answer in the form of a question. This matched the form in which answers were sent by the API.
Computer Generated Art
For example, the left image below visualizes how numbers change after a given number of iterations in the unsolved Collatz conjecture; it has been my phone background for several years. For a more artistic visualization, see the right image below, which applies a smeared watercolor effect.
One can also visualize more useful and common mathematical ideas. The left image below shows how horizontal and vertical lines in the complex plane are transformed under e^(1/z). One can clearly see concentric cardioids. The right image below shows the graph of several common functions, like sine and the natural logarithm.
The Turtle library allows one to trace out colored paths in an image, like the rainbow spiral no the left below. Getting a little more advanced, one can create recursive shapes, like the Koch Snowflake, Seirpinski Triangle, and dragon curve, shown below.
One can also make other startlingly complex images from a simple set of recursive rules. The below images, known collectively as "strange attractors," show a tree, Barnsley Fern, pine branch and piece of tall grass. The procedural generation techniques used to create these images, known as L-systems, are used in many of today's popular video games to make random, realistic terrain and plants.
The images above and many others that I made in Python, as well as the code used to create them, are available on GitHub.