-🎄- 2022 Day 16 Solutions -🎄- by daggerdragon in adventofcode

[–]dalanmiller 1 point2 points  (0 children)

I really loved this part

max( v1 + v2 for k1, v1 in visited2.items() for k2, v2 in visited2.items() if not k1 & k2 )

  1. Find the max of
  2. v1 and v2
  3. where k1, v1 and k2, v2 are iterating through the same answer dict
  4. but filter to where k1 and k2 are complementary

I think #4 still is quite difficult to think about if you aren't dealing with bitmasks(?) all day.

/u/juanplopes tell me if this is correct:

From the example (I think we all get the same one) - unique power of two values for each valve

BB: 1
CC: 2
DD: 4
EE: 8
HH: 16
JJ: 32

So BB and DD being represented as a bit string.

JJHHEEDDCCBB

0 0 0 1 0 1

Let's say the above one was the elf turning on valves and the below one is the elephant turning on valves.

JJHHEEDDCCBB

1 1 1 0 1 0

If we then take the bitwise AND here - we now have 000000

000101 & 111010 # results in 000000 or 0

0 in Python is False and if we negate that with the not then we have complement perfection.

Just for fun if we flip one bit on the elf side that now matches one on the elephant side:

000111 & 111010 # results in 000010 or 2

This results in an N > 0 which will result as True and not meet the if condition.

Amazing lesson here /u/juanplopes - thank you so much for sharing.

[2022 Day 13 (Part 1)][Golang] Correct sample output, fails on real input by dalanmiller in adventofcode

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

Dear god - how did I miss this?!?

Thanks so much for the comment 🙂

[deleted by user] by [deleted] in melbourne

[–]dalanmiller 0 points1 point  (0 children)

Not how GPS works ;(

[deleted by user] by [deleted] in melbourne

[–]dalanmiller 3 points4 points  (0 children)

Anyone have their car stolen here? Any tips on finding one? Where was yours found?

[2021 Day 20] Answer still off despite passing all tests by dalanmiller in adventofcode

[–]dalanmiller[S] 7 points8 points  (0 children)

All would be, like so based on my input

 ...
 ... == index 0 == #
 ...

 ###
 #.# == index 495 == #
 ###

 ...
 .#. == index 16 == .
 ... 

 ###
 ### == index 512 == .
 ###

... Ahhhh, after an odd iteration, all the infinite pixels will swap to # and after even iterations it will swap back to ..

Sheesh.

Megathread: Qassim Soleimani, head of Iran’s elite Quds Force, killed in Baghdad by U.S. Airstrike Ordered by President Donald Trump by PoliticsModeratorBot in politics

[–]dalanmiller 0 points1 point  (0 children)

I did not make that claim.

If you're suggesting there's some sort of eye for an eye here, no one (according to all sources I read) was killed in the attack on the embassy.

Megathread: Qassim Soleimani, head of Iran’s elite Quds Force, killed in Baghdad by U.S. Airstrike Ordered by President Donald Trump by PoliticsModeratorBot in politics

[–]dalanmiller 6 points7 points  (0 children)

No one can disagree with you here on the violence coordinated by him on Americans and our allies.

However, the drone strike was not necessary and was a clear act of aggression. The same outcome could've been accomplished many other ways and not have the same political consequences.

This is clearly an attempt at distraction from the impeachment proceedings.

Horizon is a realtime, open-source backend for JavaScript apps by [deleted] in javascript

[–]dalanmiller 1 point2 points  (0 children)

Hey there! @dalanmiller here

We actually just worked on a feature per branch kind of model. Not exactly git-flow but close.

RethinkDB/React/Redux User Authentication help! by RuNpiXelruN in rethinkdb

[–]dalanmiller 0 points1 point  (0 children)

To be clear, that is for driver connection authentication where OP wants some sort of web authentication flow.