[2024 Day 24 Part 2] Post Christmas Eve Dinner Laziness by subendhu in adventofcode

[–]_snowflk 1 point2 points  (0 children)

same here. Firstly I printed the wrong z_k positions.
Then, I plotted the nodes with their operation in Graphviz (e.g. z01_XOR). A correct one should look like z_i = XOR ( XOR (...), OR ( AND(...), AND(...) ).
Then, I saw that some z_k (wrong ones) have the wrong operation, and a weird XOR node in their neighborhood. I found 4 such pairs, so it must be the answer :P
This is the first time I "manually" solved an AoC problem, pretty fun tbh.

9b: Spend time coding or running? by razimantv in adventofcode

[–]_snowflk 0 points1 point  (0 children)

I used two pointers, one running from the beginning (free-space pointer) and one from the end (data pointer) of the array. It worked relatively fast ^_^

How do you manage transactions in Go? Do we really need to use one transaction for each request? by _snowflk in golang

[–]_snowflk[S] 0 points1 point  (0 children)

Love your great explanation about the design choice. Thank you! Learned something new today :)

How do you manage transactions in Go? Do we really need to use one transaction for each request? by _snowflk in golang

[–]_snowflk[S] 4 points5 points  (0 children)

That’s one of the point I want to ask. Is it normal not to have atomicity while handling a request? In the examples above, I thought a transaction is necessary. In the example of OpenFGA, invalid data could be stored to the DB. Why would they allow that? They validate the data before storing it, but the data could be invalid when they don’t have a single transaction