Menu

Home

Krishna

This project contains all the explorations done in C++ language at work. It is organized into following projects:
1. Binary Tree - Contains the implementations of binary tree algorithms
2. Linked List - Contains the implementations for some of the common problems of Linked Lists.
3. Design Patterns - Contains the implementations for commonly known Design Patterns
4. Learning Programming - Contains the explorations of various contructs of C++ language, include C++11 features, Template Metaprogramming concepts.
5. Exploring C++14 - Explorations of features of C++ 14, along with functional programming concepts like Continuation Passing Style etc.
6. Performance Experiments - Contains the benchmarking code for seemingly simple code, and tries to obtain the average time taken by a function.
7. Interview_Questions_Solutions contains code related to programming questions asked in various interviews, with each company's questions organized into its own project. Currently the following projects are present
* TAS - Diophantine
* Amazon
* NVidia
* Codeland
* Napa

Prerequisites:

  1. C++14 or later compiler. For example on windows, requires MSVC 2015 or later for successful compilation.
  2. Boost libraries >= 1.59.
  3. Poco libraries >= 1.7.8
  4. CMake >= 3.5
  5. Zlib and LibPng if building ImageProcess library.
  6. Qt >= 5.9.1 if building Napa_Solution and CodeLand_Solution

Steps for setup

  1. Make sure that cmake is installed and added to path.
    For eg. if you type "cmake" at command prompt it should print details and quit.
  2. Define Environment variable "POCO" and have it pointed to the path where it is installed.
    For building Poco on windows, refer to the section below.
  3. Define Environment variables "BOOST_ROOT", "BOOST_INCLUDEDIR", "BOOST_LIBRARYDIR" as follows:
    For example, assume that boost libraries are extracted to the following folder: C:\local\boost_1_64_0.
    Then define
    BOOST_ROOT=C:/local/boost_1_64_0
    BOOST_INCLUDEDIR=${BOOST_ROOT}/boost/ or C:/local/boost_1_64_0/boost/
    BOOST_LIBRARYDIR=${BOOST_ROOT}/lib64-msvc-14.1 or C:/local/boost_1_64_0/lib64-msvc-14.1/

    Please note that "lib64-msvc-14.1" folder could change based on 32bit/64bit libraries and also the msvc compiler used to compile the boost libraries.
    Also, boost_1_64_0 could also change as per the version of the boost that has been downloaded.
    4. Define Environment Variable "QT_DIR" as follows:
    For example, assume that Qt is located in the following folder: C:\Qt\5.9.1\
    Then define
    QT_DIR=C:\Qt\5.9.1\msvc2015_64
    where "msvc2015_64" represents the compiler and the architecture against which the Qt libraries have been built.
    Please note that, the build may fail if there is any configuration mismatch.
    5. If ImageProcess library is being built, please refer to sections: "Steps for building ZLIB" and "Steps for building LibPng", as the ImageProcess library
    depends on them.

Steps for building Poco:

  1. Goto this site to download the poco sources: https://pocoproject.org/
  2. Download the sources for Basic Edition, since there are no other dependent libraries needed to build.
  3. Extract to a suitable folder, and then run cmake with either of the following command for building with MSVC 2017(depending on the debug/release builds, although it is recommended to build both):
    cmake -G "Visual Studio 15" -DENABLE_MONGODB=OFF -DENABLE_ZIP=OFF -DENABLE_PAGECOMPILER=OFF -DENABLE_PAGECOMPILER_FILE2PAGE=OFF -DENABLE_DATA=OFF <path to="" sources="">
    or
    cmake -G "Visual Studio 15" -DCMAKE_BUILD_TYPE="Debug" -DENABLE_MONGODB=OFF -DENABLE_ZIP=OFF -DENABLE_PAGECOMPILER=OFF -DENABLE_PAGECOMPILER_FILE2PAGE=OFF -DENABLE_DATA=OFF <path to="" sources=""></path></path>
  4. Open the corresponding VS project and hit build.
  5. Once the build is complete, run the "INSTALL" project, and the poco libraries should be copied to C:\Program Files (x86)\Poco.
    Please note that if you did a 64 bit build, then the location would change to C:\Program Files\Poco
  6. Define an environment variable POCO which points to the path where the binaries are copied.

Steps for building ZLIB:

  1. Goto http://www.zlib.net/ to get the latest sources.
  2. Make a directory called build (or any other directory) and run cmake -G "Visual Studio 15" -DCMAKE_BUILD_TYPE="Debug" <path to="" zlib="" source="" containing="" cmakelists.txt=""></path>
  3. Make sure to run the install command once the build is finished. This will copy the includes and libraries to "C:\Program Files (x86)\zlib" on windows. On other platforms, the
    appropriate installation directories will be chosen. Also, if the build is 64 bit, then the path will be changed to "C:\Program Files\zlib".
    Please note that, you may need to run with admin privileges/root persmissions for the install command to succeed.
  4. Now, define an environment variable ZLIB_ROOT, and have it point to the directory where the files in the previous step were copied.

Steps for building LibPng:

  1. LibPng needs Zlib, so please follow the steps mentioned in the section "Steps for building ZLIB" before proceeding further.
  2. Goto http://www.libpng.org/pub/png/libpng.html and get the latest soureces.
  3. Make a directory called build (or any other directory) and run cmake -G "Visual Studio 15" -DCMAKE_BUILD_TYPE="Debug" -DZLIB_LIBRARY=<path to="" the="" zlib="" library,="" including="" file="" name="" eg.="" zlib.lib=""> -DZLIB_INCLUDE_DIR=<path to="" the="" zlib="" include="" directory=""> <path to="" libpng="" sources="">
    Please note that the path to ZLib Library should include the filename as well, otherwise, the cmake build could fail with unresolved externals.</path></path></path>
  4. Make sure to run the install command once the build is finished. The same caveats as in the earlier section ("Steps for building ZLib") will apply here as well.
  5. Now, define an environment variable LIBPNG_ROOT, and have it point to the directory where the files in the previous step were copied.

Project Members:


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.