
Software Developer with a Variety of Skills: C, C++(STL), Qt, SQL, Multithreading/Concurrency, Networking, Encryption.
Here is a brief summary of my most recent projects. You can find them all on my Github page: HERE.
Please get in touch if you'd like to collaborate on any Agile/Scrum/Kanban Projects.
Forex Trading Dashboard coded in QT and C++. Useful if you want to study the correlation between currency pairs and back test trading strategies. It's pre-loaded with all the price action data for 2023 and allows you to trade with realistic brokerage fees. However it does not include slippage which might be a good idea for the next version. C++ is a particularly good language for execution and perhaps the next version will have a QML front end.
You can find all the source code HERE.
This is my encrypted password manager with multi-factor authentication. When the program first launches you are given a QR Token which you can scan through your phone's authenticator app. This will generate a one time password code that changes every 30 seconds.
Once you've chosen a password and entered in your OTP code, your account is set up and you're then able to start storing passwords. Even if someone manages to get hold of your password, they still cannot log in without your OTP code so this adds an extra layer of authentication.
The information is held inside an SQLite database, encrypted with AES256 Cipher Block Chaining using a key unique to your system. No passwords or login information is kept in plaintext, but are instead hashed using SHA1.
You can use the program to store as many passwords as you like, putting them in their own categories and branches. You can edit the names of the branches and passwords as you wish. You can also generate random secure passwords if you don't want to think of one yourself.
Whenever you need to retrieve a password, you can either find it by navigating through the tree structure, or just by clicking the find password menu option. You can then click the URL / Username / Password buttons to have those individual pieces of information copied to the clipboard respectively.
You can also change the OTP token seed if you have your own hardware token that you prefer to use.
You can find all the source code HERE.
API Hooking is where you redirect a program's native API calls, choosing whether to process them or allow them through. You do this by injecting your own DLL into the process memory space adjusting its Import Address Table (IAT). The program continues to think it's calling the underlying Windows ecosystem but is actually being rerouted through our own code. Here I wanted to inject into the API calls where the program outputted text to the console and so after examining its dependencies, the two options were to hijack either the call to WriteConsoleW or WriteFile and the latter seemed to work best.
I wrote a dummy exchange rate calculator as an example. By injecting a new DLL into its process, I was able to add authentication to the application so that it now required a password to log in. The password algorithm could be as complex as you like, requiring multi-factor authentication and an OTP code if you wish. However here I've just hard coded it as an example.
If you're able to analyse the DLL calls an application makes using something like Dependency Walker, you can in theory make any application behave as you wish. It may require injection into several calls and a deep understanding of the native program logic.
You can find all the source code HERE.
Framerate image processing and motion detection using the OpenCV Library. When pixel differences between frames is above a certain minimum threshold, motion is identified and the contours are highlighted with bounding rectangles. A Gaussian blur filter is implemented to also help reduce pixelation noise and keep false positives to a minimum. In this example, I'm keeping an on screen count of any objects and pedestrians that cross the central dividing line.
You can find all the source code HERE.
Archery Game coded in Qt and C++. You are given 20 arrows to start with and your aim is to achieve the highest score possible. Every time you hit the Bullseye you get 10 points and an extra arrow and so theoretically there is no upper limit on the score if you are particularly skilled. Every time you nearly hit the bullseye you are rewarded with 5 points and an "Excellent" Message. Arrows are fired due to left button mouse presses which are captured in the Graphics View.
The Arrows, the Bow and the Target are all subclasses of QGraphicsPixMap. Once publically inherited, each arrow for example, becomes an independent object which automatically traverses across the screen. Its motion and opacity are all completely encapsulated within the class. If it crosses the bounds of the screen, it automatically destroys itself and frees allocated memory. If it collides with the target it becomes a child of it. In addition the motions of the arrow and bow are made smoother through the use of Animations which provide an easing curve that better describes linear projectile motion.
The Bow moves up and down at a random choice of speeds to make the Game Difficult and the Target moves to a random position every time it is hit. The motion of the Target is smoothed through an animation and easing curve. The collision detection in Qt works very well and as soon as the arrow impacts the target it becomes a child of it and so sticks to it as it moves until the next arrow is fired.
All assets on the screen are separate objects which are added to the Graphics Scene one by one. The scene is then set inside a Graphics View. A series of timers are then constructed and parented to provide the motion of the bow, target and arrows. Each arrow destroys itself when it goes out of range of whenever the next one is fired.
The Qt system of Signals/Slots make communication between classes particularly straight forward and so all objects are aware whenever an arrow is fired and when it collides with the target, hence the score can be updated and the sound resources can play in the correct order if an arrow strikes the target, hits the bullseye or goes right past it completely. I often favour coding the connect statements using Lambdas as they are really convenient.
Finally Mouse Wheel events are captured for the Volume control which pops up whenever you click the Speaker Icon. This modulates the volume at which the Sound resources are played on the system without setting Global volumes.
You can find all the source code HERE.
This is my attempt at the very popular Flappy Bird Game, made with QT and C++. The bird traverses through a random arrangement of pipes, increasing the score as it goes until it collides with one of them or falls off the screen. Mouse clicks provide the "boost" for the bird to briefly gain altitude.
The flapping motion of the bird is simulated by switching through three images of it, where the wings are in various states, top, middle and bottom and by using a timer with sufficient intervals we can make it appear to flap. On top of this I've added two animations, one to simulate gravity to pull the bird downward and another to rotate its orientation as it falls. Both are implemented using a Quad easing curve so that their effects are applied smoothly. The brief uplift provided to the bird through the mouse click is also an animation that raises its orientation upward and propels it up the Y axis.
The Pipe(s) are actually a single pipe image where I have taken one and placed it in the lower half of the window and the other in the upper half of the window and then grouped them as a single object with a gap in between them that I thought was sufficient for the gameplay. They spawn at regular intervals and traverse the screen. Once off screen they automatically destroy themselves and thereby avoid any memory leaks. Their height position is chosen through a random number generator so that the game is different with every run.
Collision occurs when the bird makes contact with the pipe group. Otherwise if the bird finds itself past the pipes then the score (upper left) is incremented. Finally to provide a parallax effect I added a Gif animation in the background to simulate a moving sky. This was an image which I found and brought into Photoshop so that I could transition the front and end frames to produce a gif with a relatively slowly moving background.
You can find all the source code HERE.
The QT Framework has the ability to create flexible and responsive Graphical User Interfaces (GUI) through its Widget Sizing Policy. This example shows how you have several widgets on your layout and control the responsiveness of each.
Here I have a List Widget on the left and a Table Widget on the right. The specifications for this design were that the List Widget remained fixed in horizontal width whilst being free to grow vertically if required. In contrast, the Table widget would be allowed to grow both in the horizontal and vertical planes.
In addition, I wanted the behaviour of the Table columns to also be responsive and grow uniformly with the Widget itself. However I also wanted to show how you can implement a custom width for any particular column and have it remained fixed whilst the others still continue to be responsive. This is implemented by overriding and handling the resizeEvent() method from the MainWindow class and using it to dynamically resize the columns.
You can find all the source code HERE.

Ever since C++11 (C++0x), the C++ language has had support for multithreading and concurrency and could then rely less and less on platform APIs to perform parallelism. Modern hardware is more equipped these days to handle the demands of a well designed multithreaded application, especially on multi-core CPUs.
In this repository I provide several programs to show how to make the most of Multithreading and concurrency in Modern C++. I begin with a general task made up of two functions and benchmark how much faster I can make it by resolving the execution into multiple threads. You'll see how the execution time can be cut in half in some cases.
I then look at how to craft the way in which the threads execute by using mutex locking and try locking. This tackles the problem of race hazards where the same critical section of code is being run through by multiple threads at the same time. A mutex lock on the critical region ensures threads can only access it sequentially.
Following on from this, I look at how to lock multiple critical sections through the std::try_lock() method and provide an example of dual data feeds being consumed by a third thread which occasionally blocks, reads and resets the data. Here we see how we can lock multiple mutex objects at the same time.
After this I provide an example of how to use conditional variables in order to synchronise threads in order to have them perform in the sequence you wish, despite operating system and platform dependant differences. This is through the aid of various waiting functions in the conditional variable library that allows you to send a thread to sleep if certain conditions aren't met in which case it will release any locks to mutex objects it has made, allowing other threads to proceed.
I show examples of how to create and avoid deadlocks between threads and then how to achieve communication between them using promise and future objects. I then incorporate the use of Thread ID identifiers to highlight which thread has acquired mutex locking on the critical sections.
I finish up by implementing a producer/consumer thread program. The producer thread adds data to the shared buffer whilst the consumer thread removes and consumes it. Both threads are synchronised with each other through a condition variable which allows them both to know when the buffer is ready to fill, or when it requires to be emptied. They alternate locking of the mutex whilst they do their tasks. In this way we can allow the two threads to take care of the business of providing data to the program and then reading it and our main thread can go off processing other tasks in the program.
Multithreading and Concurrency in C++ is a topic all of its own, but very valuable to the modern C++ software engineer.
You can find all the source code HERE.

It is often desirable to calculate the pricing of put and call options in the financial spot market. These are financial instruments that give you the right (but not the obligation) to buy or sell a stock at the strike price if you choose to. Determining how to price such options is performed by using the Black Scholes Model and here I demonstrate how you can simply calculate put and call option prices for assumed values of spot price, strike price, underlying/implied volatility and other parameters.
You can find all the source code HERE.
An SQL User Login System, using QT and C++.
Allowing access to a platform only to selected users is a common procedure and so here is an example of how to achieve it with QT, C++ and SQL. You will initially have your bonafide users set up on an SQL Database and then your program will initially connect to it and be able to query it any time new log on information is provided.
If no matching log on information is found from the Database Query the user is informed through the statusbar that an error has occurred and to try again. Otherwise it grants them access to the next Phase of the platform. In this case I am just showing them personal information stored in the database about them.
Add as many users as you like to the SQL Database and they will all be granted access.
You can find all the source code HERE.
Coding your own version of the Snake Game seems like a rite of passage. Rather than use a Graphics View and Scene I wanted to try and do it by overriding the Paint Event on the Canvas. This does come with some overhead as the paint event calls for the entire window to be redrawn from frame to frame, so that the snake doesn't leave a persistant trail behind it.
The whole window is invisibly divided up into rows and columns so that the motion of the snake aligns to a grid. This means whenever the snake's food spawns randomly, it will be aligned with the snake's potential path.
The snake starts by moving a little slower than usual so the player gets used to the mechanics of using the arrow keys. As soon as they have managed to capture a few food elements, the speed increases. With every capture of food the snake's body grows by one element.
The body follows the path of the head, and all body elements are contained within a Vector that is continually shifted as the snake moves and the tail position is discarded thereby producing the effect that the snake is moving. The snake's food is spawned randomly but a check is made so that it doesn't appear within the current body or head of the snake.
The Game ends when the snake collides with either the boundary of the window, or its own body and this triggers the current score to appear in the title bar. The game is then automatically restarted once again.
You can find all the source code HERE.
The ubiquitous Simon Says Memory Game, made in QT and C++. The aim is to accurately follow the sequence of flashing colours. Behind the scenes the program generates a 50 digit sequence consisting only of the numbers 1,2,3,4 and stored into an array for sequential playback. This corresponds to the sequence of coloured labels that need to be pressed in order.
Each Coloured Square is a separate Label object, whose colour is provided as a parameter in the constructor. The flashing appearance is performed through the use of CSS Style Sheets which also work with QT. By providing a slightly offset hexcode, the colours "appear" to flash.
The main game logic is reading through the sequence array and flashing the appropriate coloured label. If you incorrectly guess the wrong colour in the sequence, the correct colour is flashed to show you where you've gone wrong and the game is reset. The title bar is updated as you play to show you the length of the sequence you have currently successfully remembered which can be a useful aid for achieving goals and pursuing memory improvement.
You can find all the source code HERE.
This is a type of game I have seen designed many different ways over the years and I wanted to do my own version. Particularly interesting was using the math library to engage with the Trig functions in order to ascertain the rotation angle for the Bow so that it can always follow the mouse. The way it works is that each mouse movement triggers an event which is captured by the Bow. Then an invisible line is drawn from the centre of the bow to the current position of the mouse and the angle this makes with the horizontal is easily obtained using the definition of Sine.
Using this I could then swivel the Bow image using a rotational transform and this gives the appearance of the bow always being in sync with the position of the mouse. This provides the game mechanism for targeting the birds as they fly by.
The birds spawn randomly, and the effect of flapping is achieved by swapping out the image of each bird with alternate wing positions. Each bird is an object as are the arrows and when they collide the bird is replaced with a puff cloud to indicate it's been hit and the score is incremented by one. Arrows can be fired one at a time, or the mouse key can be held down for a continuous auto fire.
If any birds make it past the screen, they are automatically deleted and their memory is cleaned up to prevent leaks. Similarly each arrow is destroyed and removed from the Graphics Scene when it leaves the visible area of the screen also, again to prevent memory leaks.
You can find all the source code HERE.
We developers often find ourselves having to work with the strangest of strings, usually in an ugodly mixture of uppercase, lowercase and possibly klingon. In all seriousness though, it is quite useful if you're able to look at unfamiliar combinations of characters and remember them in one shot - rather than having to keep switching back and forth. It can save you lots of time.
This is a little utility I developed to take my brain muscles to the gym. It shows you a random word of length your choosing. Your aim is to simply commit it to memory and repeat it. The catch? Well as soon as you start typing.. the word disappears leaving you to recall it all on your own. You can adjust the word length using the number box provided or simply key up and down.
You can find all the source code HERE.
I find SQL really powerful to use and so here I have created a small Database using SQLite and I'm using QT and C++ to interact and query it. For this to work the Sql module needs to be imported into QT and the QtSql Header file included. Once this is done and qmake is rerun, the project can take advantage of using the SQL Language directly.
Once the connection to the database is made, it's then just a matter of preparing and creating the SQL Statements you wish to use and executing them on the database. The typical Select, Update, Delete commands are sufficient to obtain all the functionality to manage the database.
By Clicking on any entry, or any column of it, its details populate the edit fields so you are then free to adjust them. Otherwise you can delete entries and add new ones as you wish. The database itself is displayed through a TableView which is loaded via a Select * statement applied to the database.
I also implemented a live search feature so that you can pull up all entries which have a certain Job/Profession. As you type your search string, the database is queried for a match and shows the results.
You can find all the source code HERE.
QT Implements the Model-View-Architecture (MVC) slightly differently than usual. Rather than having the Controller, it uses something called a Delegate to interact between the Model and the View. Essentially when we load our Data into the Model and then Assign it to the View, we can then interact with the View by double clicking any field. This spawns a delegate which allows us to enter in new choices for the data in that field (based on the role we want to amend in that data field).
So here I have re-implemented the delegate and model classes in order to provide my own functionality. Instead of the rating appearing as a regular numerical spinbox, I have implemented a scale of 5-point stars which you can drag or click in order to enter your value. Additionally the Favourite Colour field has been replaced with a Combo Box to allow you to choose from the range of colours the system recognises. As soon as one is selected the field is repainted with that colour.
We can create entirely custom tables and tree views, to display and interact with Data using the Model View Architecture.
You can find all the source code HERE.
A Simple Graphical Calculator implemented in QT and C++. The Design of the grid layout was achieved using QT Designer which is very useful, even though normally I'd rather implement the design in code. Then the digit precision of the output display label is set.
The math operations (Add, Sub, Mult, Divide) are all handled by the same callback function MathNumPressed which discriminates the operation based on which particular button was pressed. The lambda functions in the connect statements are used efficiently to show how this is all managed.
You can find all the source code HERE.
Here I am making use of the Proxy Filter functionality provided by QT. This is when we load an object to front-run, or intercept events originally intended for the event handler on another class. This way we can filter and trap the events which are important to us and let the unimportant ones through. In this case we are loading a List View Widget with a list of system colour names that when clicked on, fill the adjacent label with that colour.
The Filtering comes into play when you start typing in your colour choices into the edit box at the bottom. As you type text it will apply this to the filter object as a Regular Expression. This means rather than all colours being populated in the List View widget, we are intercepting all of the colours intended for it except those matching the Regular expression.
The result is as you type the colour you're looking for, the List View updates itself to show you any colour names which match this string.
You can find all the source code HERE.

As Regular Expressions are very useful, here is how to use them with QT and C++. Once you have your GUI set up you then write out your expression as usual in the constructor of a QRegExp Object from the QT Class. In this case we're implementing a restriction on what the user can enter into the field so that it must be consistant with a reference typically found on a spreadsheet application like Microsoft Excel. The Regular Expression being implemented here is: [A-Za-z][1-9][0-9]{0,2}
So we can accept entries which have a single first letter (Upper or Lowercase), a single digit from 1-9, and anywhere from 0 - 2 digits from 0-9 on the end. So valid entries might be A1, or x33, or K132 for example. If the user does not enter in a matching string, the entry is not shown in the edit box. This way we can validate data at this stage for further processing later in our program.
You can find all the source code HERE.
A simple mouse drawing program with a right click context menu that allows you to copy, paste and clear your drawings. I'm using the QImage structure in order to keep track of the pixels that need to be painted on to the canvas.
The way the mouse draw occurs is that each mouse move triggers a move event and so we draw a straight line from the last known position to the current position. In that way it appears we are making a fluid drawing, but it actually consists of linear pixel-length lines.
The copy, paste and clear functionality is all provided by overriding the right-click context menu of the main window class. To perform a copy, we take the current image on the canvas and load it into a mime structure and then into the clipboard. To perform a paste, we load the image from the clipboard and to perform a clear, we fill the image with white (same colour as our background) and then issue a repaint event for the window.
You can find all the source code HERE.

HackerRank is a website very similar to leetcode, and is used to keep your coding skills sharp. I first encountered it during interviews to become a software developer and have been using it on and off ever since. I still find some of the solutions that I come up with, or see others produce, truly remarkable and elegant.
You can find my HackerRank profile HERE.
My solutions to some of the more interesting problems, can be found in the github repository HERE .

Here is where I've put my solutions to the interesting Problems I've solved using C++. There's usually many ways to solve a problem and I do like to explore as many as I can think of. Some examples are just where I have found the implementation really elegant and the code very efficient. In some cases I have bench marked the code to see how different algorithms compete in solving it.
Here is a quick summary of some of the more interesting snippets:
Fibonacci Sequences: I initially found that producing the Fibonacci Sequences using recursion was fairly straight forward but I was unhappy with the time taken (45 ms) to produce the first 10 digits. I suspected this was due to the way the Fib function was being called so frequently that the time taken to push and pop the stack frames became significant. So in my second attempt I wrapped my algorithm into a single function and found I could reproduce the first 10 digits of the sequence in just 6ms, almost ten times faster. I used my own bench marking tool to detect how long each algorithm had taken.
Operator Overloading: I find working with the Insertion Operator (<<) very convenient and so often I like to overload it so my classes can work with it, especially to display entire vectors or arrays. The implementation usually consists of making the operator a friend of the class and then using a Range Based For loop to iterate through whichever Container is passed to the Function. If I'm only dealing with one type of container I can just hard code the type in, otherwise I can use a templated function.
Number Conversions: I particular like to convert between number systems, such as Decimal, Hexadecimal, Binary and Octal. The easiest way is to adjust the output stream format to display numbers in either of those formats, as it is a built in option and part of the standard library. However I have many other implementations to provide a rounded offering of solutions in this regard.
Lambdas: One of my favourite parts of the Standard Library for C++17/20. I find using them very convenient and so I've showcased a few uses cases on how they can be used, especially with the STL Algorithms to efficiently sort and find data within containers.
STL Containers/Algorithms: Lots of use cases on the STL Containers and how to use them with the built in Algorithms.
You can find all the source code HERE.

In a quest to understand the inner workings of the C++ STL (Standard Template Library), it's a good idea to see if you can provide a similar implementation. Here I include my versions of the STL Array, Vector and the Iterator Class.
You can find all the source code HERE.

A good way to check your understanding of how your Algorithm works is to benchmark it and see how long it takes to execute. You can use profiling tools to do this which come with your IDE. However here is a quick and dirty method to get a pretty fine resolution timer that will tell you how long your Algorithm takes to execute. You just place your code into the template. It relies on a timer being created when the function is called and it is stopped when the object is destroyed, giving you an interval of time that measures how long your code executed for.
You can find all the source code HERE.

The Standard Template Library (STL) for C++ 17 comes with many containers to get the job done. Here I have provided code on how to use each one to do typical tasks such as inserting, removing and deleting elements and the important case of traversing through them.
Covered here are the STL Containers:
Some Containers, depending on their nature and underlying implementation and how contiguous their memory structures are, only allow certain types of iterator (ie forward or backward), ie a forward list. So take this into account when iterating through their values.
With such containers as the basis of your data structures, you can implement further complex algorithms, such as Binary Search Trees.
You can find all the source code HERE.
© 2025 Copyright: GitDhamani