Prudhvi Reddy
prudhvir3ddy.bsky.social
Prudhvi Reddy
@prudhvir3ddy.bsky.social
Software Engineer
I just completed "Ceres Search" - Day 4 - Advent of Code 2024

adventofcode.com/2024/day/4

#AdventOfCode
Day 4 - Advent of Code 2024
adventofcode.com
December 5, 2024 at 11:15 AM
IntelliJ ultimate had some lag when i pasted that input in the text file.

Fleet is smooth though.
December 3, 2024 at 8:30 AM
🫠 After seeing problem i decided to not use regex and it looks like this now.

github.com/prudhvir3ddy...
advent-of-code-kotlin-2024/src/Day03.kt at main · prudhvir3ddy/advent-of-code-kotlin-2024
Contribute to prudhvir3ddy/advent-of-code-kotlin-2024 development by creating an account on GitHub.
github.com
December 3, 2024 at 8:29 AM
I just completed "Mull It Over" - Day 3 - Advent of Code 2024

adventofcode.com/2024/day/3

#AdventOfCode
Day 3 - Advent of Code 2024
adventofcode.com
December 3, 2024 at 7:33 AM
I just completed "Red-Nosed Reports" - Day 2 - Advent of Code 2024

adventofcode.com/2024/day/2

#AdventOfCode
Day 2 - Advent of Code 2024
adventofcode.com
December 3, 2024 at 7:33 AM
I just completed "Historian Hysteria" - Day 1 - Advent of Code 2024

adventofcode.com/2024/day/1

#AdventOfCode
Day 1 - Advent of Code 2024
adventofcode.com
December 3, 2024 at 7:33 AM
Nice 👌 extra check there.

😅 do you have static lint check for global exception handling not having timber usage?

Manual reviews can’t be trusted.
November 28, 2024 at 2:28 PM
This will rethrow the CancellationException to parent for you.

gist.github.com/prudhvir3ddy...
November 28, 2024 at 11:12 AM
To understand more about the Exception handling here

You can read this amazing blog manuelvivo.dev/coroutines-can…

It mentions about usage of CoroutineExceptionHandler

But sometimes you don't want to use it as it's global and prefer run-catching. You can use 👇 gist
https://manuelvivo.dev/coroutines-can…
November 28, 2024 at 11:12 AM
Which feels like a normal behaviour of user. So,

1. We shouldn't be logging it.
2. We shouldn't even be catching it - ?

We need to tell the coroutineScope that this particular operation got cancellation

Only then structured concurrency will work as expected
November 28, 2024 at 11:12 AM
Example:
If user makes a network request for which the code is under a scope which is tied to a lifecycle of that screen

And user goes to some other screen before it completes.

Below code does that automatically.

Now that code will trigger a CancellationException.
November 28, 2024 at 11:12 AM
When you log the error like in above👆

You will notice your error 🐞 logs are filled up with CancellationException

Should that be something you should be worrying about? Yes and No.

Yes, you need to fix your code.

No, you can't do anything about cancellation exception.
November 28, 2024 at 11:12 AM
👋 small account.

Thanks for creating this.
November 10, 2024 at 2:53 PM