I built an asynchronous HTTP/1.1 server from scratch in Python without touching asyncio.
Instead, I implemented manual I/O multiplexing using the raw selectors module and the Reactor Pattern.
Github repo: https://t.co/GOIYvMeuJM
Here is the exact breakdown: 🧵👇
Week 5 of Stanford's Probability for AI complete!
Explored neural networks, backpropagation, embeddings, attention, and next-token prediction.
Learned how changing GPT-2's embedding parameters could make it place the Louvre in Tokyo instead of Paris.
Week 4 of Stanford's Probability for AI complete!
Learned logistic regression, sigmoid, and train/test splits. Built a model using Kepler data to estimate whether a dip in starlight signals a planet: 84% test accuracy!
Week 3 of Stanford's Probability for AI complete!
We explored gradient ascent and maximum likelihood estimation, then built a model to detect a hidden chamber in a pyramid using particle data. Loved seeing the math in action!
Week 2 of Stanford's Probability for AI complete!
We explored random variables and probabilistic models, then built a small art generator powered by probability. 🎨
Same rules, different artwork each run. Loved seeing the math come to life!
Week 1 of Probability for AI was really fun!
We covered Kolmogorov's axioms, independence, Bayes' theorem and the law of total probability.
We even solved a problem about why LLMs can give different answers to the same prompt. Really enjoyed @chrispiech's teaching!
Seeing so much cool stuff built with LLMs made me curious about how they work under the hood.
I decided to revise my math fundamentals, starting with probability theory. I've joined @chrispiech's Probability for AI course.
Once I finish the basics, I'll study Transformers.
Imagine your Node.js server gets hit by multiple HTTP requests trying to modify the same data.json file.
Each request does:
1. Read file
2. Check conditions
3. Write to file
Race conditions corrupt your data. How do you make this a single transaction? 👇
The cool trick here is using an ultra-lightweight Promise Queue.
Instead of heavy database locks or massive external npm packages, you can turn these messy concurrent requests into a strict, predictable pipeline using just a handful of lines of pure JS.
To Master HTTP you must know these things 👇
1.TCP (the foundation HTTP runs on)
2.Statelessness
3.Request & Response structure
4.HTTP Methods & Idempotency
5.Status Codes & Headers
6.Cookies
7.CORS, OPTIONS & Preflight requests
8.HTTPS
9.HTTP versions (1.0 → 1.1 → 2 → 3)
6/I deliberately avoided using AI to write the server code to ensure I struggled through the core systems engineering.
But at the end, I used AI to generate Readme.md and a concurrency stress-test script to fire multiple simultaneous HTTP requests to verify my selector loop!
I built an asynchronous HTTP/1.1 server from scratch in Python without touching asyncio.
Instead, I implemented manual I/O multiplexing using the raw selectors module and the Reactor Pattern.
Github repo: https://t.co/GOIYvMeuJM
Here is the exact breakdown: 🧵👇
5/It took 3-4 days of dedicated time, but it was 100% worth it. Building this teaches you more about TCP, HTTP, and network internals than any tutorial ever could.