Rico's Nerd Cluster

「离开世界之前 一切都是过程」

C++ - Container Operations

Vector, Map, Algorithms

Vector Common Operations Append vector2 to the end of vector1 1 vector1.insert(vector1.end(), vector2.begin(), vector2.end()); Map TODO Algorithms Nth Element nth_element(first, nth, l...

C++ - BLAS and LAPACK

Scientific Computing Libraries

Article: BLAS (“Basic Linear Algebra Subalgorithms”) BLAS is a set of specifications of linear algebra operations such as vector addition, scalar multiplication, dot products, etc. It’s categorize...

C++ - Casting

Ever tried convincing your boss that your need for vacation is a 'const' by using const_cast? Welcome to C++ casting!

Introduction TODO - coming soon ;) Const Casting ❗ const_cast is needed sometimes to form a pointer/reference to a const object to interface with legacy code. Modifying the char* might lead to u...

C++ - Operators

Basic Operators

Basic Operators a == b == c doesn’t do what you want. Do (a == b && b == c) instead. It’s equivalent to: 1 2 3 int a = 5, b = 5, c = 5; bool res = a == b; res = res == c;

C++ - Bit Operations

A Mumbo Jumbo List About Bit and Byte Operations

Basic Bitwise operations Setting a specific bit to 1. 1 2 uchar desc_byte = 0; desc_byte |= (1 << NUM);

C++ - Erase Remove

An efficient in-place way to remove elements in a container

Introduction It’s a common task to remove items in a sequential container that fits a criteria, like an array, vector, queue, etc. For this scenario in C++, it’s advised to use the erase-remove id...

C++ - Useful Macros

Why do we still need macros for C++? Please click in and take a look!

Introduction Macros are string substitution for code. It happens during the preprocessing phase. It is generally not encouraged in c++ nowadays. However, there are still applications where it coul...

C++ - Virtual Functions and Virtual Inheritance

Virtual is virtually complicated. Dynamic Dispatch, Dreadful Diamond Derivative (DDD) Problem ...

Introduction The virutal keyword is very versatile. A really short and nasty summary is, it is to ensure the correct functions or base class is inherited / loaded during runtime. Virtual Function...

C++ - Weird & Interesting Stuff I found

Oh boy, C++ is weird ... but also interesting :)

Strings Raw C strings (char arrays) should always terminate with a null character, ‘\0’. Fun fact about char arrays: nullptr is inserted at the back of the array. This is a convention for argv ...

Deep Learning - Designing Machine Learning Systems Notes

Machine learning is to learn complex patterns from existing data, and use them to predict on unseen data. MLOps is a set of tools and best practices for bringing ML into production. ML Algorithms a...