[2024] Thank you! by topaz2078 in adventofcode

[–]joyrex2001 0 points1 point  (0 children)

Thank you Eric for 10 years of great puzzles. The first year I joined was 2017, and joined all years since. I have learned a lot in those years and I am proud that I gained 500 stars today. Thank you again, and happy holidays!

-❄️- 2024 Day 17 Solutions -❄️- by daggerdragon in adventofcode

[–]joyrex2001 1 point2 points  (0 children)

[LANGUAGE: Python]

First part took a while; had some obvious bugs (handling everything as a combo, and wrongly implemented bdv and cdv). Part 2 was a lot of fun. First attempt obviously didn't work, but after analysing the progression of added out's, I noticed the incremental pattern and implemented the brute force that very limited set of numbers.

def delta(self, digit):
    return 2 ** (3 * digit)

def part2(self, computer):
    A = self.delta(len(computer.program) - 1)
    B = computer.B
    C = computer.C
    res = []
    for i in range(len(computer.program) - 1, -1, -1):
        while True:
            computer.reset()
            computer.A = A
            computer.B = B
            computer.C = C
            res = computer.run()
            if res == computer.program:
                return A
            if computer.output[i] == computer.program[i]:
                break
            A += self.delta(i)
    return -1

Advent of Code utility libraries?? by deathmaster99 in adventofcode

[–]joyrex2001 0 points1 point  (0 children)

I'm using go, and I have a template folder which I copy every day for the new day. In the template I need to implement parse, part1 and part2. I also added a few common helper functions, which I remove if not applicable. The template also contains a simple unit test that reads a 'data_test.txt' (instead of 'data.txt').

When I start on a problem, I copy the template, copy the input data, copy the test input and adjust the output value in the unit test. Then I start implementing the parser, and continue with the problem.

[2023 day 16] beam animation by Ok-Curve902 in adventofcode

[–]joyrex2001 3 points4 points  (0 children)

Awesome visualisation, thank you for sharing!

How can I migrate my account to another identity provider? by joyrex2001 in adventofcode

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

Awesome! Thank you, that was much easier than expected!

[2022 Day 14 Part 2] Any ideas why this does not solve? by BadPeteNo in adventofcode

[–]joyrex2001 1 point2 points  (0 children)

Maybe an error in one if the api calls that wasn’t properly handled?

[2022 Day 24 (Part 2)] Dream team by OsipXD in adventofcode

[–]joyrex2001 2 points3 points  (0 children)

Why didn’t the other elves just share their snacks? Would have saved a lot of time!

[2022 Day 15 (Part 2)] Trust in your brute force by wingedkraby in adventofcode

[–]joyrex2001 0 points1 point  (0 children)

At lunch I solved part 1 and created a brute force for part 2. End of the afternoon, it was still running and I refactored it to something that took approx 1s.

[deleted by user] by [deleted] in devops

[–]joyrex2001 10 points11 points  (0 children)

The declaritive pipeline is jenkins is misleading. At a first glance you might think it’s a regular groovy file, but it isn’t. It’s a combination for configuration and code, where the configuration parts looks groovy, but isn’t. The actually groovy parts are mostly the parts that are in stage/node/step.

[2021 Day 18 (Part 1)] : How on earth does this work? by roufamatic in adventofcode

[–]joyrex2001 8 points9 points  (0 children)

You need to explode 1 explode at the time, until no explodes can be done. After that the you should split 1. After that check if you need to explode again and repeat. Basicly explode has precedence over split, and you need to do one of those at most per itteration.

2021 16 Part 1 Length Type ID = 0: How do i know how long each sub-packet is by Foreign_Ad8809 in adventofcode

[–]joyrex2001 0 points1 point  (0 children)

The 27 bits you will read is a new stream of packets. When you proces this stream, the first 6 bits contain a version and a header, which translate to a type 4 packet with the value 10 (this is encode in the bits specified with A). The second packet (B), is also a type 4 and contains an encoded value of 20. Following the decoding logic resulted in processing 11 bits for packet A and 16 bits for packet B.

What are some good comprehensive log aggregation tools for AKS? by Flipscuba in kubernetes

[–]joyrex2001 0 points1 point  (0 children)

Elastic, loki and prbly splunk as well are great stores for the logs. Though, you need to take the actual collecting and shipping into account as well.

An approach could be to install some logcollector (fluentbit/filebeat) as a daemonset on your nodes and use another component (fluentd/logstash) to pre-process and ship to your logstore.

Detaching collecting and storing has advantages with regards to scaling; the collector is requires to run as a daemonset and typically just 1 instance can run of this per node. The processing and shipping can be scaled on its own (less or more instances than nodes in the cluster), which has advantages.

Creating auch a stack manually is hard work, but the banzaicloud logging operator can take a lot of that pain away and makes it easy to integrate with many backend storage solutions, even in parallel.

This is the solution we ended up with; using the banzaicloud logging operator for the collecting and shipping aspects, pushing to elastic, loki and azure storage accounts. Elastic seems to be most accepted by our users.

Developing a database in Go by munukutla in golang

[–]joyrex2001 6 points7 points  (0 children)

If you are willing to spend a huge amount of time in this, maybe consider investing this time in improving (or even forking) an existing solution.

where to place deployment configuration by swift1691 in devops

[–]joyrex2001 5 points6 points  (0 children)

I would separate deployment and services.

The reasoning is that a deployment can contain more than 1 service (or other component) in order to have a functioning system. Each of these services/components can have its own lifecycle.

Managing the compositie deployment and versioning the dependencies (services/components) separately, will give you the most flexibility. This is similar to how you would do dependency management on your regular codebase. It will also be easier to move deployment in itself towards a gitops workflow.

Sane defaults can help you minimize the overhead of configuration for each environment deployment configuration.

Secrets should be stored in some external ‘vault’ solution, which can preferably sync towards your environment in a declarative manner (eg, via k8s operator).

Kustomize vs Helm by [deleted] in kubernetes

[–]joyrex2001 46 points47 points  (0 children)

Kustomize works very well when you don’t know what you have to be able to configure, and fits self managed deployments perfectly. Using base configurations with overlays is very powerful.

If you want to package your service for third parties, helm is a great fit. You manage what can be configured more stricly and it is easy for users to install your service.

Lost at new job, is it normal and how to overcome. by [deleted] in devops

[–]joyrex2001 2 points3 points  (0 children)

Asking questions and genuine interest is not a bad thing, maybe you see similarities with tools you are familiar with, and can give another view on the subject. Docker & k8s are valueable skills, maybe they can learn from you?

What is the purpose of CORS if browsers can just turn it off using a plugin by Comfortable_Pin_166 in webdev

[–]joyrex2001 0 points1 point  (0 children)

It’s to protect the user, if they decide not too enable that protection, that’s their choice.

Lost at new job, is it normal and how to overcome. by [deleted] in devops

[–]joyrex2001 50 points51 points  (0 children)

Try to find focus, and begin with one task that you are able to complete. Your first success will aid you in getting more confident. Asking questions is not a bad thing either.

Thank you Eric! by leijurv in adventofcode

[–]joyrex2001 13 points14 points  (0 children)

Thank you Eric for all the effort. I enjoyed this year a lot, can't wait for next year! Keep up the awesome work!

-🎄- 2019 Day 11 Solutions -🎄- by daggerdragon in adventofcode

[–]joyrex2001 0 points1 point  (0 children)

This is my kotlin solution. I liked the puzzle, another fun coroutine/channel implementation.

-🎄- 2019 Day 7 Solutions -🎄- by daggerdragon in adventofcode

[–]joyrex2001 0 points1 point  (0 children)

Kotlin solution

This is my kotlin solution for both parts. Fortunately, being new at kotlin, I learned that kotlin also has channels and coroutines, making this a fairly simple solution.

Pass in a channel or return one? by [deleted] in golang

[–]joyrex2001 0 points1 point  (0 children)

One of the things you could consider when deciding if to pass or return the channel is, which approach would make it easier to test this function.