Blog Posts

Thoughts, tutorials, and insights on software engineering

Article

Inferential vs Descriptive Statistics

Understanding the two primary branches of statistics. Learn how descriptive statistics summarizes data with measures of central tendency and dispersion, while inferential statistics generalizes from samples to populations using probability and hypothesis testing.

· 1 min read
Python
import numpy as np
data = [23, 45, 12, 67, 34, 89, 21]
mean = np.mean(data)    # 41.57
std = np.std(data)      # 25.24
Article

Classic Algorithms Explained

An exploration of essential algorithms including Karatsuba multiplication, binary search, sorting algorithms, and graph traversal—with practical Python implementations and complexity analysis.

· 1 min read
Python
def binary_search(arr, target):
    left, right = 0, len(arr) - 1
    while left <= right:
        mid = (left + right) // 2
        if arr[mid] == target:
            return mid
        elif arr[mid] < target:
            left = mid + 1
        else:
            right = mid - 1
    return -1
Article

Dynamic Programming

Learn how dynamic programming works, when to use it, and how to model solutions using top-down memoization and bottom-up tabulation.

· 1 min read
Python
def fib(n):
  dp = [0, 1]
  for i in range(2, n + 1):
    dp.append(dp[i - 1] + dp[i - 2])
  return dp[n]
Article

Economía Básica

Conceptos fundamentales de economía: transacciones, oferta y demanda, crédito, ciclos económicos, y más. Una guía práctica para entender cómo funciona la economía.

· 1 min read
Python
def calculate_roi(investment: float, returns: float) -> float:
    return (returns - investment) / investment * 100
Article

Indicadores Económicos

Los indicadores económicos más importantes: PIB, inflación, desempleo, balanza comercial y más. Qué miden, cómo se calculan y por qué importan.

· 1 min read
Markdown
PIB = C + I + G + (X - M)
Article

Building a Production-Ready Remote MCP Server

Lessons from building a remote MCP server in Python. Challenges with stateful sessions, input validation, scoped tool access, and OAuth 2.1 authorization in horizontally scaled production environments.

· 1 min read
Python
from http_mcp import Server
from http_mcp.types import Tool

tool = Tool(
    inputs=MyInput,
    output=MyOutput,
    func=my_handler,
    scopes=("mcp:read",),
)
Article

SOLID Python

The five SOLID design principles applied to Python. Practical examples of SRP, OCP, LSP, ISP, and DIP to write cleaner, more maintainable code.

· 1 min read
Python
from abc import ABC, abstractmethod
class Animal(ABC):
    @abstractmethod
    def make_sound(self) -> str:
        pass
Article

JSON-RPC V2.0

JSON-RPC is a stateless, light-weight remote procedure call (RPC) protocol

· 1 min read
Json
{
  "jsonrpc": "2.0",
  "method": "call_function",
  "params": {
    "name": "function_name",
    "arguments": {
      "user_name": "jondoe"
    }
  },
  "id": 2
}
Article

Most Useful Git Commands

A practical reference for the git commands I use the most. From stash tricks and interactive rebase to worktrees, bisect, and recovery with reflog.

· 1 min read
Bash
git log --oneline --graph --all
git stash
git rebase -i HEAD~3
git bisect start
Article

WSGI vs ASGI Protocols

Comprehensive guide comparing WSGI and ASGI protocols in Python web development. Learn key differences, implementation examples, and when to use each protocol for optimal web application performance.

· 1 min read
Python
def app(environ, start_response):
    start_response("200 OK", [("Content-Type", "text/plain")])
    return [b"Hello, World!"]
Article

Réflexions 2024

Un résumé des livres que j'ai lus et des choses que j'ai apprises en 2024.

· 1 min read
Markdown
> La simplicité est la sophistication ultime. - Leonardo da Vinci
Article

Concurrency and Multithreading

Understanding concurrency, parallelism, and multithreading. How threads share memory, why concurrency matters for performance, and practical patterns with async Python.

· 1 min read
Python
async def fetch(url: str) -> str:
  async with(
    aiohttp.ClientSession() as session,
    session.get(url) as response
  ):
    return await response.text()
Article

Functional Programming

A practical introduction to functional programming in Python: pure functions, immutability, composition, and common patterns.

· 1 min read
Python
from functools import reduce
numbers = [1, 2, 3, 4]
result = reduce(lambda acc, x: acc + x * 2, numbers, 0)
Article

Python Virtual Environments

How to isolate project dependencies with virtual environments. Creating, activating, freezing requirements, and packaging Python projects with Docker.

· 1 min read
Docker
FROM python:3.7
WORKDIR /app
COPY requirements.txt /app
RUN pip install --no-cache-dir --upgrade -r requirements.txt
COPY /app /app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "80"]
Article

Terminal Basics

A beginner-friendly guide to the command line. What shells, terminals, and commands are, plus essential operations for navigating and managing files.

· 1 min read
Bash
mkdir dir_name
cd dir_name
touch file_name
echo 'foo' > file_name
ls
cat file_name
rm file_name
Article

Python Basics

Python is a great language for beginners and experts alike. Let's explore the basics of Python. From modules, packages, scope, and more. Let's dive in!

· 1 min read
Python
def outer():
    x = "local"

    def inner():
        nonlocal x
        x = "nonlocal"

    inner()

if __name__ == "__main__":
    outer()