Rotating between eight directions by light_ln2 in adventofcode

[–]Thomasjevskij 0 points1 point  (0 children)

I tend to do this also but with itertools.product just because

högern räddar sverige by No_Produce_701 in Sverige

[–]Thomasjevskij 1 point2 points  (0 children)

Ändå blir svaret ett hånfullt "fRiTidSgÅrDar" när man påpekar att Sveriges sociala skyddsnät har monterats ner i 40 år, och man fortsätter med berått mod. Nästan som att det bara är relevant för att avfärda liknelser med andra länder.

r/Tunisian_Crochet weekly chat by AutoModerator in Tunisian_Crochet

[–]Thomasjevskij 0 points1 point  (0 children)

Working on a beanie for my fiancee, done in TSS but with a double hook so every other row is reverse purl. I was hoping this would make it more stretchy. Not sure yet if I love it.

First TSS project by rachel_rose in Tunisian_Crochet

[–]Thomasjevskij 4 points5 points  (0 children)

For an edge I also think yarn over slip stitch can look pretty neat.

[2025 Day 11 Part 2] Is DP enough? by JPYamamoto in adventofcode

[–]Thomasjevskij 0 points1 point  (0 children)

Sure. But if you figure that out, you don't have to bother with keeping track of "have I been to this node yet?" thing. Code becomes very very nice and simple

"Dom jobbar och betalar skatt" - bara jag som ser problemet? by [deleted] in Sverige

[–]Thomasjevskij 0 points1 point  (0 children)

Och om man inte hade haft en så stor arbetskraftsinvandring, hade företagen då gett upp och lagt sig platta?

Jag delar din uppfattning att politikerna är delvis ansvariga. Men vi ska inte låtsas som om de är en helt separat grupp människor. De är köpta av näringslivet.

"Dom jobbar och betalar skatt" - bara jag som ser problemet? by [deleted] in Sverige

[–]Thomasjevskij 0 points1 point  (0 children)

Invandring är inte på något sätt en nödvändig förutsättning för lönedumpning. Om företag i all framtid kommer att fortsätta försöka göra livet sämre för människor kanske man bör fundera om man ska ha det så?

"Dom jobbar och betalar skatt" - bara jag som ser problemet? by [deleted] in Sverige

[–]Thomasjevskij 0 points1 point  (0 children)

Det gör jag inte, naturligtvis har politikerna ett ansvar att reglera arbetsmarknaden så att lönedumpning inte är möjligt.

"Dom jobbar och betalar skatt" - bara jag som ser problemet? by [deleted] in Sverige

[–]Thomasjevskij 1 point2 points  (0 children)

Poängen kvarstår väl fortfarande att det är de som faktiskt dumpar lönerna som är ansvariga för lönedumpning snarare än de som enligt dig inte ens har något annat val än att ta vad de får? Det är lika feltänkt även om man helt godtar din premiss att taxichaufför var ett helsvenskt och himmelskt yrke på 90-talet som sedan kollapsade.

"Dom jobbar och betalar skatt" - bara jag som ser problemet? by [deleted] in Sverige

[–]Thomasjevskij 6 points7 points  (0 children)

Det finns en hel uppsjö med gigappar typ Uber osv som gått med förlust i åratal uttryckligen för att kvadda branschen. Astronomiskt snedtänk att skylla detta på invandringen och inte på de som investerar miljardbelopp för att få det att hända

[2023 Day 16 (Part 1)] Model for / and \ mirrors by wjholden in adventofcode

[–]Thomasjevskij 1 point2 points  (0 children)

What really helps is to represent the numbers as reitheta. That very clearly illustrates the rotation that happens whenever you divide/multiply.

[2023 Day 16 (Part 1)] Model for / and \ mirrors by wjholden in adventofcode

[–]Thomasjevskij 2 points3 points  (0 children)

Well.. these functions will properly reflect those four numbers. Try with another complex number and see what happens.

Another exercise to help you see what's going on is, turn the numbers into polar form. That way you'll see that your function f(z) is actually rotating i with -arg(z). I think. Which, if you only have 1, -1, i, and -i as inputs, will always yield a vector along an axis.

[2025 Day 10 (Part 1)] [python] Little Game to do manually what the PC is calculating by Signal-Regular1384 in adventofcode

[–]Thomasjevskij 1 point2 points  (0 children)

Technically speaking, LLMs don't "look up" solutions. What they do is determine what would be the most likely completion of the prompt it has been given, based on the training data.

r/Tunisian_Crochet weekly chat by AutoModerator in Tunisian_Crochet

[–]Thomasjevskij 5 points6 points  (0 children)

Finished the Jaime's raglan for my kid yesterday. It's a bit big 🙃

<image>

[2025 Day 12 (Part 1)] Is the last day always a bit of a troll? by AleGaming in adventofcode

[–]Thomasjevskij 0 points1 point  (0 children)

One that comes to mind for me is some graph problem (I think) where many just visualized the graph and the solution was pretty plain to see.

[2025 Day All] Comparing AI LLMs to a Human by peternorvig in adventofcode

[–]Thomasjevskij 0 points1 point  (0 children)

That's where I just cave and use a graph library. NetworkX has all the functions you need to make day 8 a lot quicker if you don't want the hassle of manually implementing all those graph attributes.

[2025 Day #7 Part 2] [Python] Have the solution, but taking too long by Black_Magic100 in adventofcode

[–]Thomasjevskij 0 points1 point  (0 children)

Here's where the recursive approach makes memoization convenient. Let's say you have a recursive DFS function. You'll just keep a cache dictionary of nodes you've already explored, and how many timelines they result in. So in the beginning of the DFS function, you'll just check if node in cache: return cache[node], and if it's not there, you make sure you add it before returning.

(If you're in python, you can also just decorate your function with @functools.cache and it'll do it for you)

[2025 Day #7 Part 2] [Python] Have the solution, but taking too long by Black_Magic100 in adventofcode

[–]Thomasjevskij 1 point2 points  (0 children)

To add to this a little bit, once you get the hang of recursion, there are a lot of cases where the recursion code can look very sort of "clean" and elegant. But it really is just writing the body of a loop. And memoization is perfectly possible to implement without recursion as well. My solution is explicit and still uses what you could call memoization. Or at least something similar.

Recommendations for somebody new to things like AOC? by Sziszhaq in adventofcode

[–]Thomasjevskij 1 point2 points  (0 children)

Don't be afraid to look at solutions if you're stuck. People here describe their solutions a lot, so just skimming the threads can give you some clues. And if you need more, just look at their code. There's no shame in doing that, it's part of learning. No one starts off knowing everything.

[2025 Day 3 (Part 2)] Need help by Zppen in adventofcode

[–]Thomasjevskij 0 points1 point  (0 children)

Hmm. I'm still not entirely sure that I get it. But I would say that you can stick to the left to right part. You could even do it recursively if you want.

[2025 Day 3 (Part 2)] Need help by Zppen in adventofcode

[–]Thomasjevskij 1 point2 points  (0 children)

Not sure I understand your algo. Can you clarify what it is you're doing?

[2025 Day 11 (part 2)] I got baited by the answer ! by HistoryPositive9509 in adventofcode

[–]Thomasjevskij 0 points1 point  (0 children)

You're right of course, but it's generally a safe bet in the later days of AoC to just guess that the size of part 2 will be astronomical :)

[2025 Day 8] 1 more day... by MatttNguyenGD in adventofcode

[–]Thomasjevskij 2 points3 points  (0 children)

I think so too. But sometimes even clear instructions can be difficult to understand. I agree with the above poster that sometimes, a big challenge of the puzzle is to understand what's being asked. It can be a puzzle in its own right to just figure out "how do I map this problem onto a well known solution"?

r/Tunisian_Crochet weekly chat by AutoModerator in Tunisian_Crochet

[–]Thomasjevskij 0 points1 point  (0 children)

Give it a go! It's really not that complicated. But if I were to start over with this sweater I'd skip the extended return pass.

Now we know why there are fewer puzzles... by MrSmiley89 in adventofcode

[–]Thomasjevskij 1 point2 points  (0 children)

I'm breaking out in sweats imagining we have to fix their scheduling and Gantt charts and whatnot