Skip to content

Instantly share code, notes, and snippets.

View MangaD's full-sized avatar
📚
studying

David Gonçalves MangaD

📚
studying
View GitHub Profile
@MangaD
MangaD / cpp_lto.md
Created June 16, 2026 10:28
Link Time Optimization (LTO) in C and C++: Architecture, Cross-Translation-Unit Optimizations, Compiler Implementations, Limitations, and Real-World Behavior Across Toolchains and Language Versions

Link Time Optimization (LTO) in C and C++: Architecture, Cross-Translation-Unit Optimizations, Compiler Implementations, Limitations, and Real-World Behavior Across Toolchains and Language Versions

CC0

Disclaimer: ChatGPT generated document.

What LTO is

Link Time Optimization moves some compiler optimization work from “compile each .c/.cpp file separately” to “optimize after the linker can see many object files together.”

@MangaD
MangaD / agent.md
Created June 15, 2026 12:00
Agent: The Long History of a Word About Action, Representation, and Intelligence

Agent: The Long History of a Word About Action, Representation, and Intelligence

CC0

Disclaimer: ChatGPT generated document.

The word agent is built around one central idea: something that acts.

It comes ultimately from Latin agere, meaning “to drive, lead, conduct, do, act, or set in motion.” The Latin present participle agens, meaning “doing” or “acting,” gave rise to the English word agent. Related English words include act, action, agenda, agency, and even agile. (Merriam-Webster)

@MangaD
MangaD / cpp-linkage-odr.md
Created June 13, 2026 21:27
C++ Linkage, Object Files, Static Libraries, Shared Libraries, Inline Functions, Inline Variables, and the ODR

C++ Linkage, Object Files, Static Libraries, Shared Libraries, Inline Functions, Inline Variables, and the ODR

CC0

Disclaimer: ChatGPT generated document.

1. The big picture

When you write C++, you usually think in terms of source files:

@MangaD
MangaD / leaf_spine_network.md
Created June 7, 2026 17:23
Leaf-Spine Network Basics

Leaf-Spine Network Basics

CC0

Disclaimer: ChatGPT generated document.

These concepts are fundamental to modern data center networking, especially in cloud providers, AI clusters, Kubernetes environments, and large-scale enterprise infrastructure.

The terminology can seem confusing at first because it mixes network topology (Leaf-Spine) with traffic patterns (East-West and North-South).

@MangaD
MangaD / network_topologies.md
Created June 6, 2026 19:08
Network Topologies: Understanding How Computer Networks Are Structured

Network Topologies: Understanding How Computer Networks Are Structured

CC0

Disclaimer: ChatGPT generated document.

Introduction

Modern computer networks form the foundation of today's digital world. Every email sent, website visited, video streamed, or file transferred relies on a network infrastructure that connects devices and enables communication. One of the most fundamental concepts in networking is network topology.

@MangaD
MangaD / cpp_code_intelligence_ecosystem.md
Created June 5, 2026 10:32
The Modern C++ Code Intelligence Ecosystem: Bear, Clang, clangd, LSP, IDEs, Static Analysis, and Distributed Builds

The Modern C++ Code Intelligence Ecosystem: Bear, Clang, clangd, LSP, IDEs, Static Analysis, and Distributed Builds

CC0

Disclaimer: ChatGPT generated document.

Below is a map of the whole ecosystem.

1. The core problem: C++ tooling needs your real compile command

@MangaD
MangaD / cpp_static_initialization_order_fiasco.md
Created May 31, 2026 18:58
The Static Initialization Order Fiasco in C++: Causes, Pitfalls, and Modern Solutions

The Static Initialization Order Fiasco in C++: Causes, Pitfalls, and Modern Solutions

CC0

Disclaimer: ChatGPT generated document.

The static initialization order fiasco is a C++ problem where one object with static storage duration depends on another static object whose initialization order is not guaranteed.

It usually happens with global objects, namespace-scope objects, static data members, and sometimes function-local statics during destruction.

@MangaD
MangaD / cpp_brace_elision.md
Created May 31, 2026 18:50
Brace Elision in C++: History, Language Rules, Evolution, Pitfalls, and Modern Best Practices

Brace Elision in C++: History, Language Rules, Evolution, Pitfalls, and Modern Best Practices

CC0

Disclaimer: ChatGPT generated document.

Brace elision is the C++ aggregate-initialization rule that lets you omit inner braces for subobjects.

struct Pair { int x, y; };
@MangaD
MangaD / cpp_method_or_member_function.md
Created May 31, 2026 18:46
Method vs. Member Function: Object-Oriented Theory and C++ Terminology

Method vs. Member Function: Object-Oriented Theory and C++ Terminology

CC0

Disclaimer: ChatGPT generated document.

This is a surprisingly subtle question because "method" and "member function" are often used interchangeably in practice, but there are differences depending on whether you're discussing object-oriented theory or C++ specifically.


@MangaD
MangaD / cpp_copy_elision.md
Created May 29, 2026 19:52
Copy Elision in C++: Complete Guide from C++98 to C++26 (RVO, NRVO, Guaranteed Elision, and Prvalue Semantics)

Copy Elision in C++: Complete Guide from C++98 to C++26 (RVO, NRVO, Guaranteed Elision, and Prvalue Semantics)

CC0

Disclaimer: ChatGPT generated document.

Copy elision is a C++ optimization/semantic rule where the compiler avoids creating a temporary object and therefore avoids calling a copy or move constructor.

In modern C++, especially since C++17, copy elision is not merely an optimization in some cases. Some object constructions are defined so that no temporary object exists at all.