Tom Ribbens

6 Followers
24 Following
80 Posts
@simon @mmasnick
Yes! Good Omens was amazing! Highly recommend watching that!
@vwbusguy @jcvsilva That is new for me too, thanks for that!

@BrentToderian If you go to edit your profile, where you enter your site, there's a verification code that you can copy.

If you put that link on the website you link to, Mastodon will show it as a verified site. (see my profile for my Github link. This proves that I control both that github account and this mastodon account) This will show people you are the real one behind that site. Doesn't stop others from impersonating you, and you still need to go to someone's profile to actually see it.

@noellemitchell How are you doing? Have you attempted any #adventofcode challenges? If you have, do share them!
@join3r @leo I'm doing #Python, but @leo is doing it in #Lisp. Reading his code was super difficult for me, so when I gave him the suggestion I wasn't actually sure if he did only dirnames or full path actually.
@therealahall You probably did get a new list, but one that contains all the same lists as your original master list. You probably need to use deepcopy: https://docs.python.org/3/library/copy.html
copy — Shallow and deep copy operations

Source code: Lib/copy.py Assignment statements in Python do not copy objects, they create bindings between a target and an object. For collections that are mutable or contain mutable items, a copy ...

Python documentation
@benjiyork @rhgrouls @aconaway defaultdicts are so often the good kind of magic, not having to worry about if an index exists. Day 1 they were useful as well.

@rhgrouls @aconaway I'm sorry, I meant specifically for the parsing of crates, but wasn't clear on that.

You creating effectively three for loops is hurting my brain, I can't comprehend it.

From the Julia I understand from your code, wouldn't replacing your lines 4-7 with the following code work and be clearer?

for line in z[1:end-1]:
for i, crate in enumerate(line[2:4:end]):
!isspace(crate) && push!(stacks[i], crate)

@rhgrouls @aconaway I don't know Julia, so maybe it's the language, but that solution seems overly complicated to me.

My #Python solution is at https://github.com/tomribbens/advent-of-code-tribbe/tree/master/aoc_tribbe/aoc2022

Parsing one line of the crates is lines 19-21, with towers_a setup as a defaultdict earlier on, so I never get an IndexError.

advent-of-code-tribbe/aoc_tribbe/aoc2022 at master · tomribbens/advent-of-code-tribbe

My solutions for Advent of Code. Contribute to tomribbens/advent-of-code-tribbe development by creating an account on GitHub.

GitHub
@eric_normandeau Mine are at https://github.com/tomribbens/advent-of-code-tribbe/tree/master/aoc_tribbe/aoc2022 And I usually post on here when I've completed a day.
advent-of-code-tribbe/aoc_tribbe/aoc2022 at master · tomribbens/advent-of-code-tribbe

My solutions for Advent of Code. Contribute to tomribbens/advent-of-code-tribbe development by creating an account on GitHub.

GitHub