This is the project for the third course in the Udacity C++ Nanodegree Program: Memory Management.
The ChatBot code creates a dialogue where users can ask questions about some aspects of memory management in C++. After the knowledge base of the chatbot has been loaded from a text file, a knowledge graph representation is created in computer memory, where chatbot answers represent the graph nodes and user queries represent the graph edges. After a user query has been sent to the chatbot, the Levenshtein distance is used to identify the most probable answer. The code was fully functional and used raw pointers to represent the knowledge graph and interconnections between objects throughout the project.
In this project we analysed and modified the program. Although the program was runnable and worked as intended, no advanced or morden concepts had been used; there were no smart pointers, no move semantics and not much thought has been given to ownership or memory allocation.
The goal here was to use the course knowledge to optimise the ChatBot program from a memory management perspective.
- cmake >= 3.11
- All OSes: click here for installation instructions
- make >= 4.1 (Linux, Mac), 3.81 (Windows)
- Linux: make is installed by default on most Linux distros
- Mac: install Xcode command line tools to get make
- Windows: Click here for installation instructions
- gcc/g++ >= 5.4
- Linux: gcc / g++ is installed by default on most Linux distros
- Mac: same deal as make - install Xcode command line tools
- Windows: recommend using MinGW
- wxWidgets >= 3.0
- Linux:
apt-get install libwxgtk3.0-gtk3-dev libwxgtk3.0-gtk3-0v5
. If you are facing unmet dependency issues, refer to the official page for installing the unmet dependencies. - Mac: There is a homebrew installation available.
- Installation instructions can be found here. Some version numbers may need to be changed in instructions to install v3.0 or greater.
- Linux:
- Clone this repo.
- Make a build directory in the top level directory:
mkdir build && cd build
- Compile:
cmake .. && make
- Run it:
./membot
.