Notes
There's a total of 82 articles.
Creating a backing track from your favorite song for an open mic
I perform in open mics in my spare time, when I decide to perform a cover of a song I usually play the guitar as well as singing it. Therefore, I prepare a backing track without those tracks that I use as background music during the performance.
In this article I show how to create a backing track using yt-dlp, demucs and ffmpeg.
Bachata
Documenting my life
Kubernetes
Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications.
Productivity skills
Preparation for a Software Engineer interview
Back of the envelope calculations
When designing a system it’s important to consider the limitations of the technologies chosen, making some approximate calculations when the system is designed help us decide on the tradeoffs of the different approaches, these approximations include
This article has a table with latency comparison numbers, common numbers used in system design calculations and some challenges to put all of these info into practice.
Introduction to Machine Learning
Machine Learning Glossary
For an up to date glossary also check https://developers.google.com/machine-learning/glossary
Hyperparameter tuning
Data structures for massive datasets
Expectation maximization
Bayesian Networks
Kafka
Kafka is a distributed event streaming platform designed for building high-throughput, fault-tolerant, and scalable data streaming applications.
This article covers key designs in kafka such as how messages for a topic are shared into partitions assigned to brokers. Then we see some guarantees about producers, consumers and consumer groups.
Memtable & SSTable (Sorted String Table)
The pattern of batching data up in memory, tracked in a write ahead log, and periodically flushed to disk is ubiquitous today. OSS examples are LevelDB, Cassandra, InfluxDB, or HBase.
In this article I implement a tiny memtable for a timeseries database in golang and briefly talk about how it can be compressed into a sorted string table.
Cassandra
Cassandra is a highly scalable, distributed NoSQL (non-relational) database management system designed for handling large amounts of data across multiple commodity servers.
This article covers key design features of cassandra such as the usage of consistent hashing, the write pattern to a write ahead log and a memtable, the read pattern from the memtable and from sstables, and finally and most important, some examples about data modeling for different types of queries.
Partitioning
Data partitioning refers to the process of dividing a system’s data into smaller, more manageable subsets, which are distributed across multiple storage locations or nodes.
This article covers some strategies for partitioning including random partitioning, by hash key, by range and a hybrid approach for skewed workloads. We also see strategies to rebalance partitions if there's a static or dynamic number of partitions.
Non Functional Requirements
Non functional requirements refer to quality attributes or system characteristics that describe how well a software system or solution performs or behaves.
This article covers well known non functional requirements such as reliability, availability, scalability, performance and durability.
Implementing an A+ conformat Promise library in JavaScript the TDD way
This article is about writing an A+ Promise implementation from scratch following the A+ promise spec in JavaScript the TDD way.
Divisibility
Let $a,b \in \mathbb{Z}$, we say that $a$ divides $b$, written $a \given b$, if there’s an integer $n$ so that: $b = na$. If $a$ divides $b$ then $b$ is divisible by $a$ and $a$ is a divisor or factor of $b$, also $b$ is called a multiple of $a$.
This article covers the greatest common divisor and how to find it using the euclidean algorithm, the extended euclidean algorithm to find solutions to the equation $ax + by = gcd(a, b)$ where $a, b$ are unknowns.
Flat shading
Diffuse shading
As an example on the picture (credits to Marc Kleen) we see a real life car with a matte coating which we want to emulate using the Lambertian shading model.
Introduction to surface shading
Building a first person shooter camera in C++
A first person camera captures objects from the viewpoint of a player’s character. Some aspects have to be considered like the characteristics of the camera (orbiting with the mouse and translation with keyboard keys) as well as how we could capture all these characteristics with math and linear algebra.
In this article I analyze the math needed to design and implement a 1st person shooter camera in C++.
Quaternions
gcc
make
“Make” is a build automation tool commonly used in software development to compile source code and create executable programs or other output files. It automates the process of building complex software projects, including compiling source code, linking object files, and creating executable files or other types of output.
In this article I cover the following: targets and prerequisites, variables, recipes to build an out of date target and finally an example of how to use it in a simple C++ project.
CMake
Makefile
s, projects specify their build process with platform-independent CMake listfiles included in each directory of a source tree with the name CMakeLists.txt
. This article explains how to use CMake to build projects.
C++ refresher
Culling & Clipping
The math behind culling and clipping and how it’s related with the camera and with what it sees.
- Culling is a process where geometry that’s not visible from the camera is discarded to save processing time.
- Clipping is a process that removes parts of primitives that are outside the view volume (clipping against the six faces of the view volume).
Affine spaces
Vector spaces
A vector space is a set whose elements are called “vectors” (denoted as $\v{v}$ or $\mathbf{v}$) which have two operations defined on them: addition of vectors and multiplication of an scalar by a vector.
This article covers some examples of vector spaces, basis of vectores spaces and linear maps.
Triangle in affine spaces
Geometric tests
Transformation matrix to transform objects from NDC coordinates to screen coordinates (viewport transform)
One matrix transformation in the 3D to a 2D transformation pipeline is the viewport transform where objects are transformed from normalized device coordinates (NDC) to screen coordinates (SC).
In short it's the transformation of numbers in the range [-1, 1] to numbers corresponding to pixels on the screen, which is a linear mapping computed with linear interpolation.
In this article I cover the math behind the generation of the viewport transformation matrix.
Normals
Eigenvalues and eigenvectors
Projective space
Ray Tracing
Rendering
Transformation matrix for projection of 3D objects into a 2D plane (projection transform)
In Computer Graphics 3D objects created in an abstract 3D world will eventually need to be displayed in a screen, to view these objects in a 2D plane like a screen objects will need to be projected from the 3D space to the 2D plane with a transformation matrix.
In this article I cover two types of transformations: Orthographic projection and Perspective projection and analyze the math behind the transformation matrices.
Transformation matrix to transform 3D objects from World Space to View Space (View transform)
One matrix transformation in the 3D to a 2D transformation pipeline is the view transform where objects are transformed from world space to view space. a transformation matrix.
In this article I cover the math behind the generation of this transformation matrix.
Combining Matrix Transformations
Perspective projection
This article covers the math behind it and how to generate the transformation matrix to achieve the transformation.
Orthographic projection
This article covers the math behind it and how to generate the transformation matrix to achieve the transformation.
Translating objects with a Transformation Matrix
Euler angles
Euler angles are a way to describe the orientation of a rigid body with 3 values, these values represent 3 angles:
- yaw - Rotation around the vertical axis
- pitch - Rotation around the side-to-side axis
- roll - Rotation around the front-to-back axis
Shearing objects with a Transformation Matrix
Introduction to rotation for computer graphics
The basics of rotation in 2d and 3d for computer graphics with a focus on 3d rotation about cardinal axes and 3d rotation with quaternions.
For quaternions, please also look at https://eater.net/quaternions amazing animations!
Scaling objects with a Transformation Matrix
Transformation matrix
Coordinate systems and transformations between them
Quaternions
Quaternions are a set of 4-dimensional vectors that are used to represent rotations in computer graphics, they were discovered by William Hamilton as an extension of 2d complex numbers to a 3d equivalent.
This article covers the definition of a quaternion, its notation and operations.
Complex numbers
Imaginary numbers were invented to solve problems for equestions with no real roots, complex numbers extend imaginary numbers by adding a real number.
This article covers the definition of complex numbers, operations such as addition, product, norm, conjugate, inverse and square root. Finally, this article covers the geometric and polar representations of complex numbers.
Hamiltonian Graphs
Eulerian Graph and Eulerian Trails
This article discusses Eulerian circuits and trails in graphs. An Eulerian circuit is a closed trail that contains every edge of a graph, and an Eulerian trail is an open trail that contains all the edges of a graph but doesn’t end in the same start vertex.
This article also explains the Königsberg Bridge Problem and how it’s impossible to find a trail on it. Finally there are two implementations in C++ to find Eulerian trails in directed and underected graphs.
Single Source Shortest Path (SSSP) in a graph
Given a weighted graph $G$ with $V$ vertices and $E$ edges where all the weights are non-negative and given a source vertex $s$, the single source shortest path problem consists in finding the distance from $s$ to all the other vertices.
In this article I describe the problem in a weighted and unweighted graph as well as implementations using BFS for unweighted graphs and Dijkstra's algorithm for weighted graphs using an array and a priority queue.
Introduction to Trees in Graph Theory
Strongly Connected Components in Graph Theory
Strongly connected component of a directed graph is a subgraph in which there exists a path from every vertex to every other vertex in the subgraph.
In this article I implement Tarjan's algorithm to find strongly connected components in a graph.
Minimum Spanning Tree
This article covers minimum spanning tree (MST), MSTs have important applications, MST can be used to minimize the cost of building a communication network, or it can be used to identify important features or patterns in a dataset.
I implement the Prim and Kruskal algorithms to find the minimum spanning tree in a graph with different implementations for sparse and dense graphs, also with the theory covered I also implement an algorithm to find the number of nimal spanning trees in a graph.
Cut-vertices (articulation points) in Graph Theory
A vertex $v$ in a connected graph $G$ is called a cut-vertex if $G - v$ results in a disconnected graph, note that $G - v$ is an induced subgraph of $G$ (meaning that $G - v$ contains all the vertices of $G$ but $v$ and a set of edges $G - V$ where $V$ consists of all the edges incident to $v$).
In this article I implement an algorthm to find the articulation points in an undirected graph, also I explain biconnected components in an undirected graph and explain concepts such as edge connectivity and vertex connectivity.
Cut-edges (bridges) in Graph Theory
An edge $e = uv$ of a connected graph $G$ is called a bridge if $G - e$ is disconnected (it increases the number of components).
In this article I implement an algorthm to find the bridges of an undirected graph using DFS. Next I describe an algorithm to find strong bridges in directed graphs.
Topological sorting of a graph
Topological sorting is a linear ordering of the vertices of a directed acyclic graph (DAG) such that for every directed edge (u, v), vertex u comes before vertex v in the ordering. In other words, it is a way to order the vertices of a DAG such that there are no directed cycles.
In this article I implement the topological sorting algorithm as well as an example of how to use it to find the shortest path in a directed acyclic graph.
Traversal of graphs
There are many ways to traverse a graph. For example through breadth-first search and depth-first search. Exploring it with a breadth-first search has interesting properties like implicitly computing the distance from a source $s$ to all the reachable vertices. Exploring it with a depth-first search has properties about edges like finding back edges, forward edges and cross edges.
This article has implementations for both BFS and DFS.
Introduction to Graph Theory
Graph Theory has numerous applications in real life, it can be used in problems found in social networks, transportation networks, the internet, chemistry, computer sciense, electrical networks among others.
In general, any problem that involves relationships between objects can be modeled as a graph.
Integer Factorization
Integer factorization is the process of decomposing a composite number into a product of smaller integers, if these integers are restricted to be prime numbers then the process is called prime factorization.
This article covers factorization using trial division and fermat factorization through Pollard's Rho algorithm and using the sieve of eratosthenes.
Divisor Function
Primality Test
A prime number is a natural number greater than $1$ which has no positive divisors other than $1$ and itself.
This article covers different algorithms for checking if a number is prime or not including a naive test, the erathostenes sieve, the euler primality test and the miller-rabin primality test.
Prime factors of a factorial
Special factorial modulo p
Discrete Logarithm
Chinese Remainder Theorem
The chinese remainder theorem (CRT) is a theorem that deals with finding a solution to a system of congruences.
This article covers the defition of the CRT and an example implementation in C++.
Modular Arithmetic
Modular arithmetic is a type of arithmetic that deals with integers and remains within a fixed range of values. It involves performing arithmetic operations such as addition, subtraction, multiplication, and division, but with the added concept of a “modulus” or a “mod” value.
This article covers the definition a congruence relation, and some of its properties like addition, multiplication, exponentiation and inverse. Next I show how we can use the extended euclidean algorithm to find the modular multiplicative inverse in a general case and in the case of coprime numbers.
Extended Euclidean Algorithm
Binary Exponentiation
Erathostenes Sieve
Euclidean Algorithm
Euler's phi function
Derivative
The derivative is a concept that represents the rate of change or the slope of a function at a particular point. It is a fundamental concept in calculus and is used to analyze how a function changes with respect to its input as the input changes very slightly.
This article covers physical and geometric interpretation of the derivative as well as some applications like finding maxima and minima in a function and newton-raphson.