Author image

Maze Solving


A maze is a programming puzzle involving a collection of paths. And the programmer must construct an algorithm that will traverse a path starting from a specified location and ending to a goal location.

A Maze is typically given as 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.

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 specifying the name of the maze as input (in Visual Studio you can do that in Project Properties -> Debugging -> Command arguments -> write say “maze.txt” without the quotes).

To create your own mazes to...

Author image

Microsoft Ergonomic MacroKeyboard 4000


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

Any macro you need it does have it, 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 the to startup via task scheduler or place them in shell:startup (run WinKey + R -> type shell:startup -> enter -> place them there)

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 hard to dig into the script file and figure it out on your own. Anything you want though just ask.

Author image

Morse Code Converter


A Morse Code Converter converts a given input string to Morse Code based sounds. Morse code is a telecommunication method used to encode text characters as sequences of different signal durations called dots and dashes.

Working algorithm is straightforward to program:

  1. prompts the user to enter a text string
  2. it decodes the text string to individual characters and maps them to the right combination of the 2 morse code characters according to the International Morse Code table below.
  3. it uses the WinApi Beep function (in 1kHz arrangement) to play the . or the - sound. Traditionally the dash has a longer sound duration so I use 240ms for a dash's playback and 80ms for a dot' playback (3x).

I know Beep is considered old, but is still very much functional and used. In Windows 7 Beep was rewritten to pass the beep to the default sound device for the...

Author image

RC Car


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 to find the datasheets for all those circuits on your own though. A...

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. Or you can embed the python interpreter in C++ allowing for python scripting in a C++ application. It goes 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..).

Visual Studio Setup: 1. create new project. 2. use the same platform architecture as that of your Python interpreter. eg if you have Python 64bit installed use x64 3. Download pybind11 from the github repository (linked down below) 4. Add in your project's includes the pybind include directory as well as your own Python distribution's include directory (eg C:\Program Files\Python36\include) 5. For libraries add the a directory...

Author image

Snake Applesken


I had to do my own take of the classic Snake game I played back in the day on Nokia 3310 and Sony Ericsson W810i. Enjoy the nostalgia induced experience.

I hereby give you my notes. If you want some implementation help on how I went about to do this:

Author image

Template Metaprogramming Library


How I delved deep into Template Metaprogramming territory? Well after a few years experience with C++ I watched Walter E. Brown's excellent 2 part template metaprogramming CppCon conferences, titled “Modern Template Metaprogramming: A Compendium”.

There are many comments in the code and you can use it to learn. I have it all in a single file (yeah; not much software engineering work here).

This tiny library is the fruit of my labor.

I used Windows 8.1 x86_64, Visual Studio 2017, C++17 to build the project. It should work on other platforms as well.

Github

Github repository link.

Acknowledgements

Walter E. Brown video1
Walter E. Brown

Author image

Tile Game (Pokemon Wannabe)


A minimal but functional tile-based 2d game the likes of the good ol' Pokemon Gen 2. Pokemon Crystal being my favorite video game of all time and the one that introduced me to 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.

To create a pattern that matches only those numbers: 917-555-1234 and 646.867-5309 stop it!

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

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

Meta Characters

  • \g : global matching, matches found in entire text
  • \G : matches the end of previously successful match
  • \i : case insensitive matching
  • \m : enabled multiline mode
  • \A : match whole text
  • \d : any digit \in...

Author image

Unity Pong


I made this time years ago as I was playing and learning the Unity game engine.

Made on Windows 8.1 x86_64 with Unity 2017.2.0f3 and Visual Studio 2015 (solution upgraded to 2017 now). Pop it in and hit play.

1 2 3 4 5 6