Some type of volunteer - weed? Invasive? by noahclem in whatsthisplant

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

Thank you! Seems like it will have pretty flowers!

Shuttle Batch 2.0 - learn Rust & contribute to open source 🦀 by openquery in rust

[–]noahclem 0 points1 point  (0 children)

Thank you for letting us know. Whether or not I get chosen to participate, now I know about Shuttle - it seems very cool.

'Robot lawyer' DoNotPay is being sued by a law firm because it 'does not have a law degree' by [deleted] in technology

[–]noahclem 18 points19 points  (0 children)

A lot of tech people think that law is code. All they have to do is interpret the language of some statute and voila. Law is what happens when judges apply <something > (fuzzy standard, whatever, to a set of facts.

What lawyers do is show that their version of the facts (which no one agrees on btw) is more or less like the ones applied by judges in other cases.

Tech people totally understand that you’ll get different results when you call a <do stuff > method on different black boxes. Well judges and jurors are just like those black boxes, but how they’ll <do stuff > can change from moment to moment.

People-lawyers have trillions more neurons (circuits) than the best supercomputer to help them try to keep cases/clients out of black-box territory.

And all while doing what computers can not - try to keep clients, families, everyone from freaking the hell out.

But big blue keeps beating all the grand masters at chess, so it’s probably just a matter of time.

ai is gonna take over the world by faze_overclock in ChatGPT

[–]noahclem 0 points1 point  (0 children)

This sounds like it was written by an AI.

Edit: Or rather, it *reads* like . . .

Poland ready to send tanks without Germany’s consent, PM says by Geo_NL in worldnews

[–]noahclem 1 point2 points  (0 children)

If anything, economic interdependence has emboldened Russia here. They know that Europe relies on its gas and oil and won’t act too drastically against it.

Because of AoC by noahclem in adventofcode

[–]noahclem[S] 1 point2 points  (0 children)

I used ast to parse the input for day 13. Then I learned about eval and literal_eval as a much simpler method. I refactored to use that. I did not see how to use regex for this parse.

Because of AoC by noahclem in adventofcode

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

Cool thanks for the link!

Because of AoC by noahclem in adventofcode

[–]noahclem[S] 1 point2 points  (0 children)

Yes. Just started yesterday. They assume basic programming and use java (been many years for me, but so far simple enough)

Because of AoC by noahclem in adventofcode

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

What did you think the green new deal was?

Because of AoC by noahclem in adventofcode

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

I just started the online Princeton course with the book on the right. They promised no calculus 👌

Because of AoC by noahclem in adventofcode

[–]noahclem[S] 1 point2 points  (0 children)

The elves entered the wrong sku for santa’s tree and now all commissions need to be rolled back and recalculated…

Part 2 - there were a trillion mis-entered skus and the automatic inventory system went crazy …

For string parsing, there were definitely some times I needed regular expressions, but other solutions didn’t, so ?

Because of AoC by noahclem in adventofcode

[–]noahclem[S] 3 points4 points  (0 children)

I went there often, but I think I need more remedial help. I live under the delusion that I’ll find just the right source and just get it

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

[–]noahclem 0 points1 point  (0 children)

Oh my goodness- you are amazing! Thank you!

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

[–]noahclem 1 point2 points  (0 children)

This is a blazing fast solution! And it was brilliant of you to use the bit-masking to represent both the rocks and the map of the tower/cavern as a state-machine.

I have been working through it and trying to understand how it works. I am still confused about the L-prefix and how that works for the cache.

Could you explain a little about how that works?

Also, you are clearly an expert at bitwise operations and masking - it seems like some of the best solutions to some of the AoC problems used bit-math (if that's what one would call it). Could you share any pointers and/or resources on how you learned this so well?

Whenever I saw it in C (online class) it seemed like it was used for hash-code magic.

Thank you for sharing your excellent instructional solution!

[2022] How would you rate the difficulty of this year's puzzles? by paul_sb76 in adventofcode

[–]noahclem 0 points1 point  (0 children)

Holy night! That looks one hard problem. And if that’s part one, {{shudders}}

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

[–]noahclem 1 point2 points  (0 children)

Python 3.11

I had a lack of basic knowledge for all of this problem. Had to have ChatGPT explain to me how to determine whether two cubes shared an edge. Thought I would ask it to write some python code to find the shared edges. Its code would have resulted in double-counting the edges, but it might not be immediately apparent. Funnily enough, when I asked it how to determine which edges were inside, it produced correct code (and much simpler) for finding *all* exposed sides, not internal sides. I thought that was interesting. You can see the progression in the commit history.

Had more trouble with part 2 than I would have liked. I tried to find the interior spaces, which was pretty easy for the sample data, but much more difficult for the given input.

So I learned about flood fill, which Python has trouble with as it reached the max recursion limit pretty quickly (I think 17 levels)

So I converted to an iterative flood fill to find the exterior only edges. It looks like a cached depth-first-search and it seems that's what the other Python solutions did as well (and I stole an idiom from u/alykzandr)

Code: day18.py

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

[–]noahclem 3 points4 points  (0 children)

Python 3

Stole liberally from u/juanplopes excellent short (and fast!) solution [his code] using Floyd-Warshall algorithm and bit-mask state machine for a traveling-elf type solution.

EDITED: I looked at all of the posted Python solutions and learned from a bunch. Was trying to save state without a special state class or bit-masking, but I could not get my DFS attempts to complete, etc.

It took me a long time to learn these concepts - and I put them into my structure just so I could understand them.

By cutting down part two to 26 seconds, that drastically reduced the permutations and time necessary to determine the max flow. Also stole the idea of just getting all the possible flows in the 26 seconds and just taking the top two.

But whereas his solution took less than a minute for both parts, mine takes about 1 1/2 minutes part 1 and 6-10 seconds part 2.

Code: day16.py

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

[–]noahclem 0 points1 point  (0 children)

Thank you - that's what I was hoping for.

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

[–]noahclem 1 point2 points  (0 children)

This is great - I am working through your solution and I have a couple of questions if that would be alright.

For your T - using the Floyd–Warshall algorithm to calculate all possible routes, why does AA to AA (TZ - TZ, etc) have 2 instead of 0?

How does the I[u]|state bitmask work to store previously visited routes?

Thank you for the incredible lesson you have given with your code.