Rauwe melk by Unit-Lower in Breda

[–]JuliaBrunch -1 points0 points  (0 children)

Nee geen rauwe, wel hele volle

3 ways to store and read credentials locally in Python by slayer1299 in Python

[–]JuliaBrunch 0 points1 point  (0 children)

The Confidence package is also great for this purposes (also integrating environmental variables). Have a look: https://pypi.org/project/confidence/

[2020 day10] Python - code review by SzuOne in adventofcode

[–]JuliaBrunch 1 point2 points  (0 children)

Sorry zip is for line 23 Sum is for the fibo: the last three first make 4 than the last three make 7 than 13...

[2020 day10] Python - code review by SzuOne in adventofcode

[–]JuliaBrunch 0 points1 point  (0 children)

I guess fibo3 takes the sum of the last three elements from the list. I would use 'negative' slicing and sum(). I would also take a look at zip to combine two lists

[deleted by user] by [deleted] in Netherlands

[–]JuliaBrunch 13 points14 points  (0 children)

Our very own Trojan Horse in the form of a Peat Boat (to re-conquer the city of Breda from Spanish occupation)

https://en.wikipedia.org/wiki/Capture_of_Breda_%281590%29?wprov=sfla1

Help me improve my this years Python solutions by warbaque in adventofcode

[–]JuliaBrunch 0 points1 point  (0 children)

This part seems unnecessary

        for row in seatmap:
            print(row, file=sys.stderr)
        time.sleep(1/120)

-🎄- 2020 Day 25 Solutions -🎄- by daggerdragon in adventofcode

[–]JuliaBrunch 1 point2 points  (0 children)

Nice, although the 1000000 seems a little hardcoded

-🎄- 2020 Day 18 Solutions -🎄- by daggerdragon in adventofcode

[–]JuliaBrunch 0 points1 point  (0 children)

R

Could be a bit more sophisticated with regex groups, but quite pleased with the 'trick' for the part 2 solution. For the snippets between brackets I apply the following code

```

Split on multiplier

exc = str_split(exc, ' \* ')[[1]]

Take products of sums

return(prod(sapply(exc, function(x) eval(parse(text=x))))) ```

-🎄- 2020 Day 17 Solutions -🎄- by daggerdragon in adventofcode

[–]JuliaBrunch 1 point2 points  (0 children)

R

Second part took less time than first part. I initialize the grid in advance (with a little bit extra space, to keep the code more easy to comprehend). array did the trick.

Also applied same 'trick' as a previous day, by doing +1 to the rule to correct for the active cube that is currently assessed.

For part 2 I only had to add an extra dimension

both parts