Author image

Maze Solving


A maze is a programming puzzle involving a collection of paths. What we seek to do here is construct an algorithm that will traverse a path starting from a specified location and ending to a destination location.

A Maze is typically given as an N*N array, eg. maze[N][N]. Imagine you're a rat trapped in the maze and you have to traverse the blocks to go from the Start to the Destination block. Reaching the destination blocks allows you to escape the maze and go free! The rat only possesses elementary movement abilities, either left/right or up/down. It's a 2d world for the rat and it suits us nicely.

In this example, we want to be able to construct a maze dynamically based on however many amount of rows and columns it consists of; for this reason we opted to use a vector of vectors - 2d vector called "maze".

You can provide whatever maze you want as input to this program. Use a file, place it somewhere inside the project and run the program by...

Author image

Microsoft Ergonomic MacroKeyboard 4000 - Autohotkey scripts


All the special hacky functionality you (or at least I) could possibly need from the best keyboard ever. I wouldn't want to type without it. Programmed in two Autohotkey scripts.

Any macro you need it provides, from startup, shutdown to making windows always on top, to launching specific programs and so much more.

If you want to use it just run macro_keyboard.exe and microsoft_ergonomic_keyboard_4000.exe , or add it to startup by placing them in shell:startup (run WinKey + R -> type shell:startup -> enter -> place them there), or via task scheduler (which also gives you administrator execution privileges, without a prompt).

If you'd like to see a complete keymapping let me know. Most are intuitive stuff though and I've provided keys even for mouse actions (eg left shift + right alt = move mouse pointer left by ~60 pixels). It's not...

Author image

RC Car


Forenote: RC may stand for either Remote Control, or Radio Control.

This is the implementation of a Radio Controlled (RC) car scaled 1-16. When talking about “implementation” I refer to the electromechanical assembly of the parts required, their wiring and microcontroller programming.

The goal is to move the car around telepathically (no just kidding) using a transmitter i.e. remotely controlling it via radio frequency signal waves and technology used to decode and encode those signals on the receive and transmitter ends respectively.

Hardware & Software used:

  • the popular programmable MSP430 microcontroller chip (MCU) from Texas Instruments
  • HC-06 Bluetooth module
  • L293D(ne) H-bridge chip
  • IAR Embedded Workbench 7 for Windows, student license for programming
  • Windows 8.1 x86_64
  • Tera Term and Putty for IO serial comms via UART interface.

You will have...

Author image

Pybind 11 Tutorial


Pybind11 is a lightweight header only library that exposes c++ types in Python. 8k lines entire library. 5k LOC core codebase. You can use it to extend python with C/C++ written python extensions - similar to CPython, but in a much easier and up-to-date method. Alternatively you can embed the python interpreter in C++ allowing for python scripting in a C++ application. It can work both ways, it's not particularly hard and you basically get to marry the Beauty and the Beast together (and C++ is not the beauty..).

Tip:

If you don't have a python distribution installed on your system you can extract the python36.zip and python36.dll from the pybinding\x64\Debug\python-3.6.6-embed-amd64.zip file and place them on the same directory as the output executable. They will work exactly the same.

pybind_module is a static library project...

Author image

Snake Applesken - Python PyGame & cx_Freeze Tutorial


KeyC0de's take on the classic Snake game he played back in the day on Nokia 3310 and Sony Ericsson W810i.

If you'd like some implementation help on how I went about to do this I hereby give you my notes below:

Author image

Tile Game (Pokemon Wannabe)


A minimal but functional tile-based 2d game the likes of the good ol' Pokemon Gen 2. This was my first real big accomplishment in my video game learning journey. I was inspired by Pokemon Crystal, which was the game that really introduced me into video games.

Author image

Regular Expression tutorial


Regular expressions are sequences of characters and symbols to be searched for (CTRL + F) within a longer piece of text.

Here I summarize my personal notes on regexps, awk, sed, grep and C++ regexps, Java regexps, Python regexps, Bash (linux shell) regexps, Javascript (regexps), PHP (regexps) etc.

For example to create a pattern that matches only the numbers out of this character sequence: 917-555-1234 and 646.867-5309 stop it!

use \d{3}[-.]\d{3}[-.]\d{4}

in PCRE regexp dialect.

But what are all these cryptic runes and sequences? Let's find out. Read on!

Meta Characters

  • \g : global matching, matches found in entire text
  • \G : matches the end of previously...

Author image

Windows Leak Checker


Memory Leak checking facility for Windows.

Simply integrate the files to your own program and test if you have any memory leaks.

You don't have to reference this code in your own code files. It will do everything on its own, so long as you add the files to your program and compile them.

Note that it works only in debug mode.

This is essentially a barebones alternative to the free and open source "Visual Leak Detector".

I used Windows and Microsoft Visual Studio to build the project.

Github

Github repository link.

Author image

Minimal XAudio v2.8 Windows library


A high performance minimal XAudio 2.8 based library developed from scratch. It is almost as low level as one can get in Windows; such is the nature of XAudio2. It is flexible and extensible.

XAudio2 delegates sounds to the WASAPI backend. You don't need multiple threads for each playing sound; these are managed internally by WASAPI which mixes & matches them internally as it best sees fit.

I used:

  • Windows x86_64, Microsoft Visual Studio
  • XAudio v2.8
  • X3DAudio

If you're on Windows 10 you can use XAudio v2.9 dll without much, if any, change.

If you'd prefer a more graphical approach, I have a QT audio player project.

Usage

SoundManager is a singleton audio instance.

There is a maximum number of sound channels, which I have hardcoded to 64. But make...

Author image

Set-Bit Sort in MIPS Assembly & C/C++

In this project we will dig deep into the MIPS64 architecture innards to make sense of CPU pipelining. We'll be using the free & open source emulator EduMIPS64 which is written in Java. The emulator supports a subset (indeed the majority) of the MIPS64 architecture's instruction set repertoire. We will attempt to optimize and thus minimize the execution time of the program.

To test drive it, we will put together a program which processes an unsorted table of 120 signed integer numbers xi and performs the following computation:

  • counts the number of ones in the binary representation of each number and sorts them in increasing order of their number of one-bits. In case there are numbers with equal set-bits sort them in increasing order of their arithmetic value.

We won't be using console input for the numbers, they will reside in a file.

The following table sums up our...

1 2 3 4 5 6