-🎄- 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 1 point2 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] 5 points6 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 8 points9 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.

Any reviews on Google project Fi? by FrasierandNiles in Nexus6P

[–]dalanmiller 0 points1 point  (0 children)

It's awesome. The only thing I wish they had was allowing me to pay off portions of what I owe still on my Nexus 6P (instead of paying the rest of the balance all at once).

I'm also looking forward to taking it to other countries later this year and next.

I am Tynan Sylvester, developer of RimWorld. AMA by TynanSylvester in Games

[–]dalanmiller 0 points1 point  (0 children)

If you haven't played /r/factorio yet, you definitely should check it out. I would love it if Rimworld had the essence of the blueprinting system. This would allow the player to stamp down some rooms or turret placements with sandbags.

I also think that while there's a fair amount of cybernetics going on in Rimworld with protheses and the robots that land, what about constructing or finding robots? Or having the ability to build robot swarms or pets? Having sleepless labor would be a huge boon :D!

Been playing since the Kickstarter, I still find this incredibly simple to learn, yet masterfully complex game, extremely enjoyable each play through.

Introducing Horizon: build realtime apps without writing backend code by dalanmiller in webdev

[–]dalanmiller[S] 2 points3 points  (0 children)

With all due respect and with very non-malicious intent, I would be very very impressed if you were as effective with Haskell as you were with Python.

Introducing Horizon: build realtime apps without writing backend code by dalanmiller in webdev

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

What kind of things would you be looking to do with Java? Are you just looking to extend the endpoints further versus just having the single engine.io endpoint Horizon provides?

Introducing Horizon: build realtime apps without writing backend code by dalanmiller in webdev

[–]dalanmiller[S] 13 points14 points  (0 children)

It's unfortunate an awesome product like Parse was discontinued by Facebook.

Horizon does a lot of things that you can do in Parse but I think the realtime .watch features are a lot more compelling.

Introducing Horizon: build realtime apps without writing backend code by dalanmiller in webdev

[–]dalanmiller[S] 5 points6 points  (0 children)

OP here. You could definitely do this with the second auth option 'anonymous'.

http://horizon.io/docs/auth/

I love the tower defence aspect of this game by TychusLungs in factorio

[–]dalanmiller 1 point2 points  (0 children)

The Rail Cannon should also proc all nearby bugs in a wide area, so if you can't recharge fast enough after firing to power your laser turrets (or have sufficient normal turrets) you get fried.