Author image

Math Handbook


A handbook for logic, set theory, algebra, geometry, video game math concepts, graph theory, Calculus, discrete math, probability, statistics, number theory, numerical analysis, vector algebra, physics, chemistry and more goodies I've worked on and off throughout the years.

I compiled this several years ago and it's been left dormant among the circuits of my computer..

I provide the source files, which you can open yourself with TexMaker.

The built pdf file is called “Math Handbook.pdf”.

As a disclaimer, this compilation could be of use to some, to others it could be a jumble up mix of notes.

I release it in the hope that it might prove useful but it's not a rigorous, just note accumulating over the years which at one point almost made up a book's length.

I used Windows 8.1 x86_64, LATEX and TexMaker.

Github

Github repository

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 destination 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. You can do this in Visual Studio, by Project Properties -> Debugging -> Command arguments ->...

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 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 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...

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. I'm a staunch supporter of "If it ain't broke don't fix it" ideology. In Windows 7...

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..).

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 configured...

Author image

Snake Applesken - Python PyGame & cx_Freeze Tutorial


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.

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

Author image

Template Metaprogramming Library


How I delved deep into Template Metaprogramming territory? Well, I watched Walter E. Brown's excellent 2 part template metaprogramming CppCon conferences, titled “Modern Template Metaprogramming: A Compendium” and this tiny library/tutorial is the fruit of my labor.

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

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. By the way, Pokemon Crystal is 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.

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...

1 2 3 4 5 6 7