Última actualización: 2026-12-02

DAY 001 OF 1600 · 2026-08-28

Day 001 — Starting with the basics

A student's private learning log · one concept at a time. Date: 2026-08-28 · Day: 1 of 1600 Log: a student's private learning log · one concept at a time. ---

Concept #1 — Summary statistics by hand

I started with the basics: computing summary statistics without a library, so I actually understand what the numbers mean instead of just calling df.describe() . This is introductory — I am at the start of the program. What I tried today: a small Python script that computes the mean, sample variance and standard deviation of a dataset by hand. data = [3.1, 2.8, 4.2, 5.0, 4.8, 3.9, 4.1, 5.2, 3.4, 4.6] n = len(data) mean = sum(data) / n var = sum((x - mean) ** 2 for x in data) / (n - 1) # sample variance sd = var ** 0.5 print(f"n={n} mean={mean:.3f} sample_var={var:.3f} sd={sd:.3f}") print(f"minimum={min(data):.2f} maximum={max(data):.2f}") Real output: n=10 mean=4.110 sample_var=0.665 sd=0.816 minimum=2.80 maximum=5.20 What I understood from it: the sample variance divides by n-1, not n, because one degree of freedom is used to estimate the mean. I had to check this twice before it made sense. I am still learning this. ---

Security #1 — Path traversal (CWE-22)

I studied path traversal: when user input reaches a filesystem path without checking, ../ can walk up outside the intended folder. This is a beginner topic for me; I am learning how the pattern works and how to prevent it. The pattern I studied: # UNSAFE — user input joined into a path without checking filename = request.args.get("file") # e.g. "../../../etc/passwd" with open("/var/www/uploads/" + filename) as f: return f.read() What I understood about preventing it: import os BASE = "/var/www/uploads" path = os.path.realpath(os.path.join(BASE, filename)) if not path.startswith(os.path.realpath(BASE) + os.sep): raise PermissionError("traversal blocked") Sandbox check (local only, on a scratch dir I made): print(read("notes.txt")) # allowed print(read("../../../etc/hostname")) # blocked Real output: safe file BLOCKED: traversal What I understood: checking the resolved path stays inside the intended folder stops the climb. I ran this only in a local sandbox folder — not against anything real. ---

Day 1 notes

Concept #1: code ran, output above. ✔ Security #1: understood the idea, sandbox only. ✔ 1599 days left. One at a time.

Written by my own daily machine, checked by me.

← Back to the index

· Day 001 of 1600 · Matías Rathgeb


[ inicio ]   [ proyectos ]   [ posts ]   [ daylog ]


Página estática. Sin cookies, sin javascript, sin fuentes externas.
Contacto: ver inicio.