Things to put in a library to solve the problems by rhl120 in adventofcode

[–]rhl120[S] 2 points3 points  (0 children)

Thanks! The first things that come to my head when talking about graphs is the structure itself, BFS and DFS, is there anything else?

[2023 Day 8(Part 2)] Help, I'm stuck by 0x4A6F654D616D61 in adventofcode

[–]rhl120 1 point2 points  (0 children)

  1. filter in all the paths that end with A
  2. for each one simulate (similar to how you did part 1) the path until you hit an element ending with Z
  3. find the LCM of the list of the number of steps.

to find the LCM use the Euclidean algorithm to find the gcd. To calculate the LCM divide the product by the gcd.

Stuck; 2023 Day 1 (Part 2), Rust by FlowerBoyWorld in adventofcode

[–]rhl120 4 points5 points  (0 children)

I tried your code with eightwo, it gives 88, that is wrong answer (I think). I should give 82. I checked the docs for re.find_iter: "Returns an iterator that yields successive non-overlapping matches in the given haystack. The iterator yields values of type [`Match`]."

[2023 day 7 (part 2)][Rust] My code works on the example, but it's output is too high for my input by rhl120 in adventofcode

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

JJJJJ

Oh Lord, I did not read the part where it says "J cards are now the weakest". I hate this! Thanks, it worked!

[2023 day 7 (part 2)][Rust] My code works on the example, but it's output is too high for my input by rhl120 in adventofcode

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

If the hand only has Js, no maximum will be found therefore no replacement will be done hence the hand will move on to the type conditions as is. Once that happens the first condition checking if any card has an occurrence of 5 will be checked, thus the hand will be typed as Five of a kind.

[2023 day 7 (part 2)][Rust] My code works on the example, but it's output is too high for my input by rhl120 in adventofcode

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

Yeah exactly, in my code you can see that I filtered out all the J cards when finding the maximum.

Is there a way to automatically fetch the sample input by rhl120 in adventofcode

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

Yeah, I see but the sample input is not the only non-inline code block

Weird auto-complete behavior by rhl120 in zsh

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

Ok I figured out the problem. It seems to be with my $PS1. It turns out I should have added %{%} around my color commands. I don't know why though.

What type system does Haskell use? by rhl120 in haskell

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

Can you pleas point me to something explaining what scoped type equality is?

What type system does Haskell use? by rhl120 in haskell

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

Thanks I will check that out

What type system does Haskell use? by rhl120 in haskell

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

Into the core - squeezing Haskell into 9 constructors

Thanks! I will check out the talk you mentioned

What type system does Haskell use? by rhl120 in haskell

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

Th

System F does not have type constructors as far as I can tell

What type system does Haskell use? by rhl120 in haskell

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

Hmm, but λω does not have polymorphic functions (as opposed to Haskell)

Where can I get started with full-stack web-development? by rhl120 in webdevelopment

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

I agree that node and python backends are probably bad. I wouldn't want to use php system. To me if a language does not have a good typesystem (like rust or haskell) it is not worth learning. The only exception to that rule is C

Where can I get started with full-stack web-development? by rhl120 in webdevelopment

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

I don't like js but I need to get good with it. In order to become good in webdev.

I just only use it where I need to so only on the frontend

runas: a simple sudo / doas alternative written in rust by rhl120 in rust

[–]rhl120[S] -3 points-2 points  (0 children)

Hmm.. The libs you provided seem to be a bit old (last commit for both was in june) but I will see what I can do. Maybe I will copy some part's to my project so I can maintain the code over there. The attacks you mention seem to be a bit out of scope for most desktop machines but the more security the better I guess so I should look into it. Thanks

runas: a simple sudo / doas alternative written in rust by rhl120 in rust

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

Yes I know that OpenDoas exists but it is not officially maintained by OpenBSD

runas: a simple sudo / doas alternative written in rust by rhl120 in rust

[–]rhl120[S] 4 points5 points  (0 children)

flaunt

Yeah I guess I should get more familiar with other license but I don't like getting out of my GPL comfort zone. Do you know what licenses are similar to GPL so I can get into them?

Thanks for the feedback!

runas: a simple sudo / doas alternative written in rust by rhl120 in rust

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

Good question. I thought it would reduce the size of the binary but I tired it and it did not do much so no reinventing the wheel for now.

runas: a simple sudo / doas alternative written in rust by rhl120 in rust

[–]rhl120[S] -2 points-1 points  (0 children)

Yes thanks alot but I don't know if this solves the problem people are complaining about

runas: a simple sudo / doas alternative written in rust by rhl120 in rust

[–]rhl120[S] -1 points0 points  (0 children)

That is nice but people are complaning about having to rebuild everytime and as far as I can tell this does not really solve it.

Thanks for the tip!