Rodrigo ππ
@mathsppblog
Followers
42K
Following
41K
Media
3K
Statuses
18K
Advent of Code π§βπ» live-stream https://t.co/qc9DDQHs7N
ππ Free Python book π
Joined July 2020
We did it! Largest computer programming lesson in the world!
29
8
195
Advent of Code is over (only 12 days this year) and I'm kind of sad I don't have a reason to stream today. I liked streaming! What if I wanted to stream more? What should I stream about?
2
1
3
I've finished #adventofcode 2025 and this is the first year that I managed to get all solutions under 100ms β‘ All but two are under 10ms. Not bad for the slowest popular language out there π, although I did have to use numpy a few times.
1
2
11
It's so ANNOYING to break out of nested loops. Auxiliary variables, conditional statements, non-linear paths through your code... It's a mess! But if you extract the looping logic to a generator, you get: - less indentation β¨ - a flat loop you can easily break out of β¨
2
0
9
Mind you, this is someone who opened 86 out of my last 88 emails and who's been getting my emails for ~ 2 years. Do I _really_ sound/look like a scammer? It's a bit worrying π€£π
1
0
2
π’ Public service announcement: Don't buy from me: Don't buy my books. Don't sign-up for my courses. Don't attend my cohorts. Apparently, I'm a scammer. π€· At least, that's my interpretation of this comment from a subscriber... Should I delete them from my mailing list?
5
0
3
After yesterday's flop, today I'm live streaming to solve day 10 and hopefully go back to day 9 part 2 to make progress on finishing it!
0
0
2
A visualisation of day 7 from Advent of Code. Worked on this during yesterday's stream, although the colouring was added off stream.
0
2
4
7 days of Advent of Code diagrams from my streams and analysis sessions!
0
1
6
Today was a fun Advent of Code problem! Join me at 5pm UTC (in ~2h40min) as I livestream my solution and a visualisation for today's part 2. We'll be implementing a very efficient Python solution with sets and counters! The link is in my profile/bio!
1
0
3
If you want to tune in for the livestream, the link is in my profile π
0
0
0
Advent of Code doesn't rest during the weekend and neither do I! In ~3 hours (@ 5pm UTC) I will be livestreaming my solution for day 6. We'll also go back to day 5 to implement the MOST efficient β‘οΈ solution for day 5, since my solution from yesterday was kinda inefficient. π
1
0
1
I need ideas. Later today (in ~2 hours) I'm going to be livestreaming while I solve Advent of Code day 5. I want to livestream for ~1h. But the problem won't be long enough. What should I do after, along a similar theme?
0
0
2
π΄ I'm going live in 30 minutes to solve Advent of Code day 4. I'm sure we'll have some time left, so we'll also work on a visualisation for day 4. The link is in the bio; see you in 30!
0
0
2
Anatomy of a list comprehension. Understand this and you'll never need to look up list comprehensions again.
0
0
10
I'm going live to solve Advent of Code, day 2, in 10 minutes! And we'll also be going back to the visualisation for yesterday's problem... The link is in my profile :)
0
0
2
To build _all_ the permutations: π go through the list of all original values π for each value, prepend it to the permutations of all the **other** values This is just an example of recursion in action... Recursion also shines when working with trees... Learn recursion! π
0
0
0
This shows the recursive relation: π βThe **permutations** of a list of values start with the first value appended to the **permutations** of the _rest_ of the values. This is for the first permutations. To build all of them, generalise this idea to all individual values π
1
0
0
those triples are built by taking `0` and putting it in front of the permutations of the list `[1, 2]`: >>> from itertools import permutations >>> [(0,) + perm for perm in permutations([1, 2])] [ (0, 1, 2), (0, 2, 1), ] Interesting, right?
1
0
0
Consider the permutations of the list `[0, 1, 2]`: [ (0, 1, 2), (0, 2, 1), (1, 0, 2), (1, 2, 0), (2, 0, 1), (2, 1, 0), ] The first two results are `(0, 1, 2)` and `(0, 2, 1)`, right? Now, note how
1
0
1
Here's a lie developers tell themselves: βRecursion is uselessβ That's a coping mechanism because you're afraid of recursion... But you shouldn't be afraid! Recursion is actually nice β¨ And it's a very natural way to express certain algorithms... Let me show you an example.
1
1
3