Skip to content

XuhuaHuang/EmbeddedProgramming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,921 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Embedded Programming

$$\int_b^d study ,dt= life$$

https://g.dev/xuhua-huang-io

https://github.com/XuhuaHuang/EmbeddedProgramming

#include <>
std::cout << std::hex << std::showbase << std::internal << std::uppercase << std::setfill('0') << std::setw(8)

wakatime

This repository hopefully can lead you through the modern C++ world, with some of its popular tool chains.
Each topic is placed in individual folder. Projects are placed under each descriptively-named folders.
Most of the directories are provided with a CMakeLists.txt.
Using CMake will be significantly easier than manually compiling all the files with your favorite compiler.
For your comfort, some of the files have required compilation command documented in the source file itself.

Table of Contents

Special Thanks

Prof. Charmaine Jirgens
My mentor to the programming world
Professor, Electronics Engineering and Information Technology
Heritage College, Gatineau, Quebec, Canada

Software does not run in a magic fairy aether powered by the fevered dreams of CS PhDs.

Languages

C/C++, Objective-C/C++

An image for C LanguageAn image for C++ An image for MinGW

#pragma once

#include <string>
#include <utility>

class person {
public:
  person() = default;

  person(std::string first_name, std::string last_name)
    : first(std::move(first_name))
    , last(std::move(last_name)) {}

  [[nodiscard]]
  std::string& first_name() {
    return first;
  }

  [[nodiscard]]
  const std::string& first_name() const {
    return first;
  }

  [[nodiscard]]
  std::string& last_name() {
    return last;
  }

  [[nodiscard]]
  const std::string& last_name() const {
    return last;
  }

private:
  std::string first;
  std::string last;
};

template<typename T>
concept printable = requires(T t) {
  { std::cout << t } -> std::convertible_to<std::ostream&>;
}

struct print {
  constexpr print() = default;

  template <typename T>
    requires printable<T>
  constexpr inline void operator()(const T& t) const {
    std::cout << t << "\n";
  }
};

Getting Started

Obtain vcpkg and Dependencies

cd
git clone https://github.com/microsoft/vcpkg
cd vcpkg
bash ./bootstrap-vcpkg.sh
./vcpkg integrate install
./vcpkg install gtest
./vcpkg install qt6

Example to Compile a File Named get_tie.cpp

g++ --version
cd ./StandardTemplateLibrary/Tuple
g++ -g -Wall -Wextra -Wpedantic -c get_tie.cpp -o get_tie.exe -std=gnu++2b
./get_tie

To Update MinGW on Windows
Run a PowerShell session with administrator privilege and run:

# Get the latest version of mingw
mingw-get update
mingw-get upgrade
# Verify the version of installed gcc and g++
gcc --version
g++ --version

Repository Directories

If you already have installed CMake on your operating system, simple change to the directory in which a CMakeLists.txt is provided then run:

The convention is to create a folder dedicated to CMake files, for example, build or bin:

cd DesignPatterns
cmake -B build -S . -G "Visual Studio 17 2022"

To build with popular Ninja or MinGW generator:

# With Ninja generator
cmake -B build -S . -G "Ninja"
# With MinGW generator
cmake -B build -S . -G "MinGW Makefiles"

To build the repository and run tests:

cmake . -B build
cmake --build build
ctest --verbose

Functionality provided by separate module. A namespace util is created to better manage the functions.
Tests and GoogleTest are located within the GoogleTests folder.

namespace util {
    namespace data_structure {}
    namespace iife {}
    namespace list {}
    namespace math {
        namespace cartesian_plane {}
        namespace euclidean_space {}
    }
    namespace parse {}
    namespace physics {}
    namespace pointer {}
    namespace range {}
    namespace type {}
    namespace type_safety {}
    namespace vector {}
}

HackerRank

Contains solutions to some of the basic problem solving coding questions. Provided file name most likely describes the content. The README.md has more handy notes when encountering those problems.
Click to see my HackerRank profile

LeetCodePlayground

Contains solutions to some of the basic problem solving coding questions.
Click to see my LeetCode profile

ObjectiveC

Popular concepts in Objective-C. Compiled in Windows using GNUstep Core and provided GNUstep developer tools.

Projects

Contains projects carried along the coursework and includes some personal project as well. For example, building a terminal progress bar for visual effects and working with OpenGL library in C++.

References

More Information

Commonly Used Command in CMake