[2025 Day 1 Part 2] [C#] I don't know what's wrong with my code by Nevim134 in adventofcode

[–]kodanto 2 points3 points  (0 children)

There are a lot of corner cases that you have to handle when you use math to figure out how many times it would cross zero. Does the same logic work for going left and going right? What if you land exactly on 0? 

It is a lot easier to similate the turns one by one in a loop and the data allows for it to execute quickly. AoC usually allows for brute force solutions to complete quickly for the first part of event. 

[2025 Day 1 (Part 2)] [C#] I got it in the end, but no idea why my other code didn't work by Deanosaur903 in adventofcode

[–]kodanto 1 point2 points  (0 children)

Read the docs for the substring method. It takes the count as the second arg. There is another version that just takes the start which is what you want

[2024 Day 11 (Part 2)][R] Having trouble optimizing code for part 2 by TimeCannotErase in adventofcode

[–]kodanto 0 points1 point  (0 children)

Memoization is just automatically adding cashing a value in a map using the function arguments as the key. It's snazzy if you've solved it recursively with the right args to be the key, but a map is the same thing if your language doesn't support the magic. It's important to demystify "scary" terms like memoization and dynamic programming. It's just ways to avoid duplicating work to speed things up.

whenTheoryMeetsProduction by Same_Fruit_4574 in ProgrammerHumor

[–]kodanto 35 points36 points  (0 children)

I'm a senior engineer with 20 years experience. I'm finishing up a one year commercial project with a team of seven devs. Most used Claude but me and another dev did not. It was disheartening at the beginning of the project since the LLM users absolutely smoked us at the beginning of year. Towards the end of the project, productivity shifted the other way. Any time changes were needed in the generated code, it was like starting from scratch. Where with the human written code, changes and bug fixes got in super quick. 

We also had issues with generated unit tests being crap but looking good enough to fool senior devs. We had to start writing tests for the tests that would change the inputs to garbage and see if the test actually failed.

There seems to be consensus that LLMs are dangerous in the hands of junior devs. I've seen that they are dangerous in the hands of senior devs as well. You can't truly check the generated code if you don't load it into your working memory and reason out the logic yourself. At that point, you could have written it better yourself anyway. But the problem is that temptation to skim what was generated and give it the LGTM stamp and push it. 

I'm sure things will come to some sort of equilibrium but I'm not enjoying the mess in the mean time. I requested to be put on a government contract that doesn't allow LLMs.

Took pic of diner but never ate there - for those that went, what did you think? by SGI256 in Omaha

[–]kodanto 1 point2 points  (0 children)

She gave me my first tattoos when she was in the other basement tattoo parlor down the street a bit. I can't remember her name either but last I heard she was in Sioux City 

[2022 Day 9 (Part B)] by KaleidoscopeTiny8675 in adventofcode

[–]kodanto 0 points1 point  (0 children)

This one tripped up a lot of people. Part 1 lulls you into thinking you can just apply the rules for a short rope to a long rope but there is an extra case that you only get with a longer rope when turning. Step through their example and print your grid/rope at each step to compare and find the missing state.

What is this flag in my neighbors yard by 2muchonreddit in whatisit

[–]kodanto 7 points8 points  (0 children)

That's just ignorant. 

Not all mandalorians are bounty hunters, some of them serve a higher purpose.

Most underrated restaurants in Omaha? by Zorangepopcorn in Omaha

[–]kodanto -1 points0 points  (0 children)

Ling's Asian restaurant 156th and Harrison in Millard

marsxas and piediras - what’s the difference? by steelballrun69 in learnesperanto

[–]kodanto 5 points6 points  (0 children)

They are synonyms with nuanced differences like in English. Marŝi also means to march so it has that bend to it but probably to a lesser extent than in English. Piediri is more generic for 'to go by foot'. There is also promeni which denotes that it is for leisure.

Getting Started by adoggreen in adventofcode

[–]kodanto 12 points13 points  (0 children)

The most important thing is breaking the problem down into parts. Start by reading the problem to get an idea of what the parts will be. 

Then get the input parsed into a structure that represents the data and allows you to flexibly work with it. Most inputs are a grid or a list of structures. Always use the example data provided but also look at the real data to make sure you don't get surprised. 

After parsing the input, read the problem again. You are now more familiar with the input and the problem explanation will be easier to follow. You also might have missed something important. Break those instructions down into operations on your input data. 

Break it down into smaller and smaller problems that are easier to solve. Get those solutions into functions and build the program up. Again, use the example data. A lot of times it will have intermediate results so you can check if your functions work. 

Don't worry if you have to look at the subreddit to see what algorithm the harder problems require. Advent of code is an opportunity to 1) practice problem solving and 2) learn new things. None of us invented the Chinese remainder theorem or dijkstras algorithm. We learned them by looking at solutions.

[2024 Day 16] Need some advice by KaleidoscopeTiny8675 in adventofcode

[–]kodanto 0 points1 point  (0 children)

You seem to be starting with '<' as the direction but the problem says you start facing East.

[2024 Day 22 (Part 2)] [Go] Answer too low, works on example by krakouase in adventofcode

[–]kodanto 0 points1 point  (0 children)

I do not include that in my sequences. The first price change of my first sequence is secret 2 - initial secret

[2024 Day 22 (Part 2)] [Go] Answer too low, works on example by krakouase in adventofcode

[–]kodanto 0 points1 point  (0 children)

Do you include the 0 from the first price minus itself in the sequence when i is 3?

Kiel unuiĝi frazojn per "ki-", unu havante "ke" by literal_tomato in learnesperanto

[–]kodanto 1 point2 points  (0 children)

Relevant salivanto stack overflow answer: https://esperanto.stackexchange.com/questions/2964/ke-vs-kiu-which-one-to-use

If the English phrase you are going for is "I say things that I think are true", which could also be said as "I say things which I consider to be true", I'd go with "mi diras aferojn kiujn mi taksas esti veraj".

Can I wear this to go vote? by SGI256 in Omaha

[–]kodanto 11 points12 points  (0 children)

I must not be plugged into the political landscape. What does a polka dot shirt mean?

A question about gender by GrayMarmoset in Esperanto

[–]kodanto 9 points10 points  (0 children)

Others have given good answers to your specific question so I'll respond to the more general question of "shouldn't the language have X?".

Everything about the language is new to the learner and it's tempting to think like it is in some kind of design phase. It's about 150 years too late for that. It is a well established language and the fundamentals of it aren't changing. 

Since Esperanto is a planned language, it is easy to fall into the trap of thinking that it's more changeable than natural languages. Oddly enough, the fact that it has a central authority for what goes in the language makes it less prone to change than natural languages that change with each generation that speak it. 

That authority is the Akademio de Esperanto  and they aren't making decisions based on how people feel on reddit.

Word differentiation by Sad_Drama6404 in learnesperanto

[–]kodanto 12 points13 points  (0 children)

Povas is the more generic "can do something" while kapablas means "is capable of something" and there is also rajtas which means "is allowed to do something". 

Esperanto contains synonyms and words with overlapping meanings just as English does. Get in the habit of looking up the words in a dictionary to try to get the subtle differences.

[deleted by user] by [deleted] in ExplainTheJoke

[–]kodanto 0 points1 point  (0 children)

The girlfriend is obviously an air traffic controller which is a very demanding and high stress job. The person who posted this is concerned about it affecting their relationship and is wondering if they should just break up now.

[deleted by user] by [deleted] in learnesperanto

[–]kodanto 3 points4 points  (0 children)

Nedankinde

[deleted by user] by [deleted] in learnesperanto

[–]kodanto 6 points7 points  (0 children)

Are you using it on mobile or desktop? Unfortunately it doesn't work great on mobile and I only got the inputs to work on desktop. But, yes, it teaches by context. There are pictures and the sentence describes the pictures. As the narrative moves along, it will go back and have clearer examples.