I'm a full-stack web developer, and this is my blog. Please connect with me on LinkedIn or visit my Github for more!

Projects

> > >All projects
  • Teaching a Reinforcement Learning Algo to Play Queens

    An image of a chess-playing robot. This is basically what I imagined I was building.

    Once you have created infinite games of Queens, you need to play infinite games of Queens. I don’t have time for that, so the next logical step is to teach the computer how to play, taking humans out of the equation entirely.

    A very cool data scientist I know recommended getting to know reinforcement learning algorithms. These are the AIs that do cool things like speedrun Mario. Why not train one to beat Queens? Why not, indeed. Ignoring the part where I have no experience in machine learning and don’t think much of my math skills (I was a middle school mathlete, but I still don’t think much of my math skills), this should be fun. Follow along with me as I take my first steps into machine learning.

    Read on →

  • Site Updates for September

    A 90s-style "under construction" gif showing a construction worker shoveling dirt.

    Frequent visitors to the site may have noticed some minor layout changes around here.

    I’ve moved my list of projects to the top of the main page. Crucially, it is now mobile friendly as well.

    Projects also have tags on them now to distinguish between apps (something that may be useful), games (a full-fledged, playable game) and toys (things I made to mess around with). I may add more categories later.

    On the backend, projects are now a Jekyll Collection which in theory gives me more control over how to render them. And, if you reshare any of my posts, they now have improved open graph metadata.

  • In Which I Go Down a Complete Rabbithole About Bash Completion

    It's the rabbithole I went down. Get it?

    Ever wonder what is actually going on in your shell when you type, for example, cd ~/myp, hit <TAB>, and the shell completes ~/myproject?

    Neither had I, until recently.

    This was supposed to be a post about the next chapter of Efficient Linux at the Command Line, which is about navigating the file system. However, the author dropped in the idea of the bash builtin complete in a sidebar, and I might have gone a little off the deep end.

    In the source code given for writing a custom bash function, the last line added to the user’s config file is: complete -W "work recipes video beatles" qcd which would mean if someone typed qcd followed by two tabs, the terminal would print all the available keys: in this case work recipes video and beatles.

    What is this? What’s going on here?

    If you type complete by itself, you get a very long list of what looks like nonsense:

    complete -F _longopt mv
    complete -F _root_command gksudo
    complete -F _command nice
    complete -F _longopt tr
    complete -F _longopt head
    ...and so on
    

    This is, it turns out, a list of what completion command is run when you run one of the bash commands at the end of each line. In other words, complete -F _longopt mv means, if you type mv <tab><tab> complete will run the function (-F) _longopt.

    _longopt and the other built in completions are very long bash functions that mostly call other functions, and if you want to spend a lot of your next three-day weekend retracing my steps, you are welcome to it. For the purposes of this post, however, I’ll talk about an overly simplified completion, because I already spent more time on this Labor Day weekend reading about this than I ever imagined I would.

    Read on →

  • Leveling Up on the Command Line

    I'm a hacker, ma!

    I am lucky in that my first exposure to computers was through the command line. I wasn’t a wizard by any sense when I realized that I could type “echo hi” and the computer would ‘talk’ back to me*, but it means that I feel more comfortable in a non-GUI environment than many of my colleagues.

    There’s always room for improvement, though. And when I’m not at work, I’m working on a new-to-me Linux laptop. Even with Pop OS installed, let’s be real: There are some things that any Linux GUI just doesn’t do that well, so the command line is still essential.

    In that spirit, I bought Efficient Linux at the Command Line.

    I’m only on Chapter 3 but am already learning a lot of commands that I hope to burn into muscle memory. Here are a few that I am working on now:

    Read on →

  • Building a Queens clone in React

    This is a queen, right? I'm actually terrible at chess

    I have nearly a 50-day streak on Queens, a daily game from the worst social network. The fact that LinkedIn has managed to trick me into visiting daily is not lost on me, but man, it’s a fun game.

    I decided that one Queens per day is not enough, and so I’ve built Infinite Queens. The original Queens puzzle, which Infinite Queens is based on, is fairly simple: place eight queens on the chessboard such that no two queens could capture each other. That means no queens in the same horizontal, vertical or diagonal line. LinkedIn’s Queens actually is more complex and, I think, more interesting, but I started with the easier problem: How can I make a puzzle that replicates the O.G. Queens, but is different every time you refresh the page?

    Because there are only 96 solutions to Queens, and the majority of them are created by transforming other solutions, I decided that the solutions can be hardcoded. Basically, create hardcoded 2D arrays with the solutions, and at game time, we can choose one at random, then flip or rotate the array to create an alternate game board, then remove all but 2-3 of the starting pieces to give the player something to start with.

    At that point, I’m honestly not sure whether the puzzle is “well-formed” – meaning, whether there is only one solution to the given configuration. I suspect there is more than one solution, so the game only checks whether the board is valid, not whether it matches the original configuration.

    I started with one board:

    Read on →

> > >Blog archive