Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Юдин Павел #217
base: master
Are you sure you want to change the base?
Юдин Павел #217
Changes from 10 commits
98f713c
2d73d71
7cea7f5
1f90ebe
af69793
a3f52a1
5bd2487
f628907
c59da28
4aa9348
0c7799a
359c828
d811522
37e5f25
a3122ef
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему опять func
почему это не метод?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Потому что в теле функции только return
Поэтому, я подумал, что можно и записать её как лямбда-выражение.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
что это и зачем?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
в Задачи 3 написано сохранять файлы, если тест провалился
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
этот тест ничего не проверяет
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
он проверяет если ничего нет, не кидать ошибку, а выводить пустое дефолтное изображение
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
во-первых: что мешает передать в тест сразу массив Point а не отдельно x и y координаты?
во-вторых: зачем тут такая проверка по 6 точек? поведение изменится что ли на 7 точке? разве нельзя указать шаг угла побольше? тогда у тебя и точки будут сдвигаться куда быстрее и уже вторая будет разительно отличаться, покажет направление движение спирали по координатам
если даже указать шаг 2, то первая же точка будет (8, 14) при положительном angleStep и (8, 6) при отрицательном
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
передать массив Point компилятор выдаст ошибку: An attribute argument must be a constant expression, 'typeof()' expression or array creation expression of an attribute parameter type.
Всё остальное справедливо. Уже у себя поправил
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лишние ссылки стоит убирать, они сильно захламляют артефакты, помимо того что в ide тебе могут предложить использовать не те сущности через intellisense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
если я это уберу, то тесты не запускаются
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
что делает эта строчка? зачем этот код?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я думал, что если пробегать не по всем прямоугольниками, а только по ближайшим, это сильно сократит время выполнения программы. Но сделав сегодня замеры, я пришёл к выводу, что такая логика только замедляет работу программы, так как для начальных это не нужно(они и так в самом начале и Any сразу проверяет их) , а для последних оказалось легче просто проверить по очереди все прямоугольники, чем фильтровать по дистанции, а потом уже проверять по ближайшим
Но как оказалось, если проверять пресечение текущего прямоугольника не сначала массива всех прямоугольников, а с конца, то это существенно ускоряет программу. Что позволяет обработать 100000 и более прямоугольников
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
метод называется Get но ничего не возвращает, что он делает из названия не понятно, да и вообще бесполезен
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
этот метод обновляет зону ближайших прямоугольников.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
опять штука которая не нужна для отрисовки, только для тестов, при том там где она используется можно использовать свойство
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
просто основная цель первой задачи: "Нужно найти расположение каждого такого прямоугольника, а не сгенерировать картинку", поэтому я и добавил этот метод, который и находит расположение каждого прямоугольника, как бы формально выполняя первую задачу.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а что если я положу проект в корень диска?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
человек может сохранять изображение в любую свою папку.
Если же говориться про добавление фотографии в методе Main в MainProgram, то я так делаю, потому что результат программы(exe файл) находиться в tagsCloud\bin\Debug\net6.0.
Поэтому Directory.GetParent(workingDirectory).Parent.Parent.FullName;
никогда не вернет null, так как всегда при выполнении программы будут папки bin и Debug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
кто будет отпускать ресурсы? райдер/решарпер тебе должны прямо трубить об этом