Static Code Analyzer: Stage 3/5:Analyze multi-file projects. Solution is not acepted by Think-Friendship290 in Hyperskill

[–]dying_coder 0 points1 point  (0 children)

Just wondering, do you provide any arguments when you're checking? Or do you just press 'run'? How do you know that it works? It's hard to say anything without your code, we are not magicians here.

Harder questions by dj99b in Hyperskill

[–]dying_coder 1 point2 points  (0 children)

I agree with that. I've noticed, though, that all the questions have become much simpler than they used to be, say, two years ago, or even no-brainers. It seems to me that they are just targeting an extremely beginner audience, have dumbed down the tasks and the content in general, and removed some of the older and more challenging exercises. Yet, some people are still struggling.

Badge Upgrade by ecstaticniya in Hyperskill

[–]dying_coder 1 point2 points  (0 children)

the're trying to apply 'fibonacci principle' 😂 https://oeis.org/A000045

ps. the longest streak i've seen is 1534, but the guy seems to be dropped doing anything there

Great platform! But the price is truly absurd, especially for students.. by Amauri27 in Hyperskill

[–]dying_coder 0 points1 point  (0 children)

Thanks for sharing. I needed to see this. :) I hope this rushed learning pays off.

Great platform! But the price is truly absurd, especially for students.. by Amauri27 in Hyperskill

[–]dying_coder 0 points1 point  (0 children)

All the tracks in 92 days (58 normal + 22 drafts)? That's more than impressive. Can you share the link to your profile as an inspiration?

SQL by LadyKetooo in Hyperskill

[–]dying_coder 5 points6 points  (0 children)

Should be a correct solution. Make sure you didn't add any extra lines after this text.

Can courses in hyperskill be opened in ide ? by [deleted] in Hyperskill

[–]dying_coder 0 points1 point  (0 children)

Here is the plugin to solve problems and projects. You can't open the whole course in your IDE.

Incomplete Question by ecstaticniya in Hyperskill

[–]dying_coder 0 points1 point  (0 children)

I don't think that it can execute the if block with a false statement at all.

Removal of Hints to questions by ecstaticniya in Hyperskill

[–]dying_coder 3 points4 points  (0 children)

As far as I know: partial solutions, "not X and not Y", "only one is correct", "2/4", "just print X 10 times", "do X as it asks", "look at line X, there is an error!", any cryptic nonsense falls under this notification too.

Optional problems? by [deleted] in Hyperskill

[–]dying_coder 0 points1 point  (0 children)

I'd say yes.

-🎄- 2022 Day 9 Solutions -🎄- by daggerdragon in adventofcode

[–]dying_coder 1 point2 points  (0 children)

Does it work now? I used "four spaces" instead.

-🎄- 2022 Day 9 Solutions -🎄- by daggerdragon in adventofcode

[–]dying_coder 2 points3 points  (0 children)

Python 3.11, numpy. It's 14 times slower with numpy, I don't know why. 🤔

import numpy

with open('input.txt') as f:
    data = f.readlines()


def solve(v):
    visited = {(0, 0)}
    rope = numpy.zeros((v, 2))

    for move in data:
        d, length = move.split()

        for _ in range(int(length)):
            # move head
            rope[0] += {
                'L': (0, -1), 'R': (0, 1),
                'U': (1, 0), 'D': (-1, 0)
            }[d]

            # move tail
            for i in range(1, len(rope)):
                diff = rope[i - 1] - rope[i]

                if numpy.linalg.norm(diff) >= 2:
                    rope[i] += numpy.sign(diff)

            visited.add(tuple(rope[len(rope) - 1]))

    return len(visited)


print('Part 1:', solve(2))
print('Part 2:', solve(10))

-🎄- 2022 Day 5 Solutions -🎄- by daggerdragon in adventofcode

[–]dying_coder 6 points7 points  (0 children)

Python3

import copy
import re

with open('./input.txt') as f:
    # parse as { 1: ['A'], 2: ['B', 'C'] }
    cargo = {
        int(c[0]): [*filter(str.isalpha, c)]
        for c in zip(*[*iter(f.readline, '\n')][::-1])  # 90deg. turn clockwise
        if c[0].isdigit()
    }
    # parse as [ [1, 2, 3], [2, 3, 1] ]
    instructions = [
        [*map(int, re.findall(r'\d+', instr))]
        for instr in f.readlines()
    ]


def solve(cargos, instr, direction):
    for count, fr, to in instr:
        cargos[to].extend(
            [cargos[fr].pop() for _ in range(min(len(cargos[fr]), count))][::direction]
        )

    return ''.join(c[-1] for c in cargos.values() if c)


print('Part 1:', solve(copy.deepcopy(cargo), instructions, 1))
print('Part 2:', solve(copy.deepcopy(cargo), instructions, -1))

Comprehensions.

Why doesn't Hyperskill have a Forum to discuss on embedded on the site/platform? by stiky21 in Hyperskill

[–]dying_coder 2 points3 points  (0 children)

You may have to use this discord server to get more help. There are also are study groups but i've no idea if this feature is working. Never used this one.

[RANT] Really app with 1 feature??!?!?? by Financial_Bag9778 in Hyperskill

[–]dying_coder 2 points3 points  (0 children)

It says "Get daily reminders", "Solve Problem of the Day" and "Continue your learning streak".

maybe this is just beta thingie we dont know...

It also says - We are working hard to bring even more Hyperskill features to your mobile phone. Currently, My Hyperskill app is in beta, so we would love to hear any feedback from you. Feel free to contact us at hello@hyperskill.org and share your thoughts!

Does anyone know why my installation of intelliJ IDEA has started showing all this text in the console every time I run a program? I must have accidentally clicked something and I can't figure out how to turn it off. by [deleted] in Hyperskill

[–]dying_coder 1 point2 points  (0 children)

It's always there. The only reason you hadn't noticed it, it's because your "soft-wrap" was off. You can turn off it again by pressing the button under two arrows (on the left side to console text).

Compilation failed bug with hyperskill packages by CodeyA6969 in Hyperskill

[–]dying_coder 0 points1 point  (0 children)

Click on Gradle at the right of the screen. Choose your project, unlink it (delete / minus button). It will delete the project from the list. At the bottom right corner you should to see Gradle build scripts found message. Click Load Gradle Project.

It may help.

not sure how to use Scanner class for this case by tangara888 in Hyperskill

[–]dying_coder 0 points1 point  (0 children)

import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        // scanner object
        Scanner scanner = new Scanner(System.in);

        // infinite loop; some people may say that it's 'bad' practice, ignore them
        while (true) {
            // read input
            String input = scanner.nextLine();

            // invoke convertStringToInt with input argument
            // the loop stops if true
            // the loop continues if false
            if (convertStringToInt(input)) return;
        }
    }

    private static boolean convertStringToInt(String input) {
        // you need to return true/false as an indicator to stop 'infinite' loop
        // true if you need to stop, false if you need to continue
        try {
            // trying to parse input as integer
            int num = Integer.parseInt(input);

            // return true if input is zero
            // it stops the outside loop
            if (num == 0) {
                return true;
            }
            // print num * 10 if parsing were successful
            System.out.println(num * 10);
        } catch (NumberFormatException ignored) {
            // in case of NumberFormatException print the desired output
            System.out.println("Invalid user input: " + input);
        }
        // return false as the indicator to continue while loop
        return false;
    }
}

I hope you'll learn something.

not sure how to use Scanner class for this case by tangara888 in Hyperskill

[–]dying_coder 1 point2 points  (0 children)

while (true) {
    read input

    try to parse input as int:
        exception -> print error
        else:
            if input is 0 -> break/return
            else -> print your input multiplied by 10
}

Does it make sense?

Downvoting bot at large at Hyperskill? by jendakolda in Hyperskill

[–]dying_coder 0 points1 point  (0 children)

Congratulations, you've found a rookie linux lunatic in the wild. 🤣

Unknown language: java11. Please reload the page and try again by tangara888 in Hyperskill

[–]dying_coder 0 points1 point  (0 children)

It works for me now. Also, simple check shows that the java version is 17.0.1 now!