int2str πŸ‡ΊπŸ‡¦'s Avatar

int2str πŸ‡ΊπŸ‡¦

@int2str.net.bsky.social

30 Followers  |  14 Following  |  95 Posts  |  Joined: 02.12.2024  |  2.2555

Latest posts by int2str.net on Bluesky

Post image

After 30+ years of daily driving manual transmission cars, we're now an all-electric family.
End of an era for sure. Bitter sweet....

13.08.2025 15:46 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Yeah, but is your hearing as *sharp* as it should be ?! πŸ™‰

31.01.2025 15:59 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@forrestvalkai.bsky.social
Re: Center for Inquiry talk

Amen!?11!!1!!!

21.01.2025 18:19 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
Making a custom C++ ranges view | int2str πŸ‡ΊπŸ‡¦ When starting to experiment more with C++20 / C++23's std::ranges and std::views, the question inevitably comes up as to what it takes to make a custom view. While there are articles and examples out ...

Here's a full write-up on what I learned along the way:
whtwnd.com/int2str.net/...

15.01.2025 23:33 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
WhiteWind

During #AdventOfCode 2024, I dove deeper into #C++ ranges and views. Here's some of what I learned:

How to make custom C++ views:
whtwnd.com/int2str.net/...

15.01.2025 23:08 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

"In all fairness, people only said that because it's true."
- @forrestvalkai.bsky.social , 2025

lol :)

15.01.2025 19:54 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

What language are you coding in?
Also, ImGui?

11.01.2025 16:43 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

Bubble sort in C++23?!???

I made an "nm_pairs" view during #AdventOfCode, largely as a tool to better understand what it takes to make a custom view in #C++.

github.com/int2str/nm_p...

10.01.2025 19:22 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Yup πŸ‘

08.01.2025 17:12 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

Make your #AdventOfCode problem twice as fast with this one weird trick ...

I was absolutely sure the compiler (clang-18) would do this for me, but alas, it didn't.... Went from ~40ms to ~20ms.

Hat tip to @49pctber.bsky.social
I peeked at their code and was like "nah, THAT can't be it..."

08.01.2025 16:24 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

Finally figured out how to make my "Utils::views::nm" play nicely with C++23 ranges/views.

This makes the final #AdventOfCode problem super nice in C++!

I need to do a proper write-up on both the AoC problem, as well as the difficulties of making a C++23 custom view....

07.01.2025 04:42 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@daveeddy.com tiny tip of the day based on your (awesome) day 16 video:

wc -l -> Get number of lines in a file (you did that)
wc -L -> Gets longest line in the file ;)

So, grid size for day 16 -> wc -lL

#AdventOfCode

05.01.2025 14:52 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Yup, fixed it:
github.com/int2str/adve...

29.12.2024 17:11 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Preview
The slowest way to the fastest*** Advent Of Code solution | int2str πŸ‡ΊπŸ‡¦ I got here just in time Advent Of Code 2024 is a wonderful collection of 25 little coding challenges, allowing hundrets of thousands of aspiring and established programmers to learn something new, or...

The slowest way to the fastest*** Advent Of Code solution whtwnd.com/int2str.net/...

Here's my write up of my #AdventOfCode "solution" for Day 17.

29.12.2024 16:19 β€” πŸ‘ 3    πŸ” 1    πŸ’¬ 1    πŸ“Œ 0

Yes, an embarrassing long time :)
However, not any of the new features (ranges etc.) that I used extensively (like day 25).

27.12.2024 04:24 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Yes, that's about right.

Unfortunately my hand rolled "nm_view" doesn't have the proper "view" interface to play well with C++ ranges. That's a long winded way of saying, if I fix my nm_view, it would be completely clean and functional.

One day...

26.12.2024 16:25 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

121 commits
9598 lines of C++
64 unit tests
3 SFML animations
1 x86_64 JIT compiler
25 awesome puzzles (well except you, day 21...)
50 stars :)

Thank you, #AdventOfCode!
I tried a whole bunch of new/different things and had a blast learning all December!

Public repo:
github.com/int2str/adve...

26.12.2024 15:07 β€” πŸ‘ 10    πŸ” 0    πŸ’¬ 2    πŸ“Œ 0

It's Neovim actually, but that part is actually not important. You need a font with ligature support (like Fira Code). So as long as your terminal supports it, it'll just work. πŸ‘

25.12.2024 17:33 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

Yes, it can be done, even in less than (one) second[s] :)

25.12.2024 13:42 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

Congrats!
Was starting to think I'm the only one doing C++ around here :)

25.12.2024 12:18 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image Post image

I've completed "Code Chronicle" - Day 25 - Advent of Code 2024 #AdventOfCode

Man, if I could just turn my mn_const_view() into an actual view, this would actually have been a "one liner" in C++ :)

Thank you, AoC team and participants!
Merry x-mas and happy holidays!!!!!!

25.12.2024 12:05 β€” πŸ‘ 7    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

"Crossed Wires" - Day 24 - Advent of Code 2024 #AdventOfCode

Ohhhhh nooooo AoC - I'm almost done writing a completely unnecessary, overkill JIT compiler for Day 17.... Don't make me write another one!!! :p

24.12.2024 14:44 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image Post image

I keep running in the issue that std::unordered_map<> in C++ is slow. Yes, maps are super convenient (I see you, my Python friends...), but they are not free and can hide their complexity.
Using a flat array and a bitset, Day 22 went from my slowest to be super fast!
#AdventOfCode

24.12.2024 00:34 β€” πŸ‘ 2    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

Tried your code and it runs hella fast, kudos.
Of course Perl remains a write-only language in 2024 :p

23.12.2024 23:31 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

Given we know the shape of the problem, part 2 can be written cleaner as well...
#AdventOfCode

23.12.2024 22:57 β€” πŸ‘ 1    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0
Post image

With the benefit of sleep, this can be written much shorter/cleaner/simpler...
#AdventOfCode

23.12.2024 22:54 β€” πŸ‘ 3    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

I've completed "LAN Party" - Day 23 - Advent of Code 2024 #AdventOfCode

Maybe it's the embedded programmer in me, but I always gravitate towards bit-masks for problems like these. No recursion, no graph theory etc., just a bunch of bits...

23.12.2024 21:11 β€” πŸ‘ 5    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0
Post image

I've completed "Monkey Market" - Day 22 - Advent of Code 2024 #AdventOfCode

Day 22 was an absolute breeze and a blast, after 21 was a thorough kick in the pants for me... Both done now and officially caught up!

Always fun to use fold_left() weirdly :)

Hopefully, no more hard ones 'til x-mas :D

23.12.2024 06:33 β€” πŸ‘ 7    πŸ” 0    πŸ’¬ 1    πŸ“Œ 0

I think (still working on it), it matters what direction you're going because of the previous direction pad. Any direction change costs, because it ripples 2 direction pads down.
Also, you need to avoid the gap completely. I missed that part at first.

22.12.2024 15:46 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

For context, screenshot is the part of the OUT operator that masks the bottom bits. %r9 is the output register.

21.12.2024 22:46 β€” πŸ‘ 0    πŸ” 0    πŸ’¬ 0    πŸ“Œ 0

@int2str.net is following 14 prominent accounts