Frectonz
3.45K subscribers
1.91K photos
82 videos
32 files
1.64K links
A place for me to talk about my projects, stuff i find on the internet and what I am currently thinking about.

By @frectonz
Download Telegram
No wonder that the movie "Leave the world behind" is good, it is based on a novel from 2020.

I think in the book the things going wrong thing is not explained with a cyberattack, I think the book depicts the Earth fighting back or sth like that.

https://youtu.be/Ylq2F6csdD8
If you don't wanna delete the whole directory like the steps shown in the pic, you can find some solutions to common git screw ups here.

https://ohshitgit.com/
Frectonz
OCaml supports throwing exceptions, so you don't have to carry around a Result type everywhere. The error objects are not some opaque value that can't be inspected at the caller site, instead they are typed values that can be checked by the caller. For example…
I am already falling behind on this year's AoC, maybe i need to stop sleeping.

One thing i have realized this year is that my knowledge in the area of "graph algorithms" is heavily limited.
Frectonz
I am already falling behind on this year's AoC, maybe i need to stop sleeping. One thing i have realized this year is that my knowledge in the area of "graph algorithms" is heavily limited.
Advent of Code update, last time i did Day 7. I was doing Day 8 but i couldn't figure it out so i have skipped it.

Then I did "Mirage Maintenance" - Day 9 - Advent of Code 2023 in TypeScript via Deno.

[Part 1 Solution] [Part 2 Solution]
Frectonz
I am already falling behind on this year's AoC, maybe i need to stop sleeping. One thing i have realized this year is that my knowledge in the area of "graph algorithms" is heavily limited.
And today I did "Pipe Maze" - Day 10 - Advent of Code 2023 in Rust

Part 1 was parsing a grid of connected pipes and finding the longest path in that grid. Parsing the grid was easy enough but for the actual longest path algorithm stuff i used this rust library petgraph that has a lot of graph traversal algorithms. Particularly i used the all_simple_paths function. And another cool thing about the library it can turn the your graph into a graphviz dot file. So you can turn your graph into an image, that's what you are seeing in the images.

Part 2 was asking for the number of grid points that were inside the loop formed by the path in part 1. I tried to think of some heuristics thinking of all the connections a point could make but i couldn't figure it out.

So then i finally decided to checkout the solutions thread on reddit and i saw that people were talking about these two algorithms Shoelace algorithm and Pick's theorem. So i implemented the two algorithms in my solutions and finally solved part 2.
🔥1
I just finished solving "Cosmic Expansion" - Day 11 - Advent of Code 2023

Now i am only 2 days behind 🎉 😁

I did it in Rust 🦀. I gotta say rayon + petgraph is the ultimate weapon to solve these graph questions.

[Part 1 Solution] [Part 2 Solution]
🔥3
Savage 💀😂
🔥4🤡4
😁14