Skip to content

Commit

Permalink
Merge branch 'borisov-saveliy-lab1' of https://github.com/Amazingkiva…
Browse files Browse the repository at this point in the history
…s/devtools-course-practice into borisov-saveliy-lab1
  • Loading branch information
Amazingkivas committed Mar 22, 2024
2 parents 63fe313 + 0040ddc commit 3bbae44
Show file tree
Hide file tree
Showing 8 changed files with 180 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:


run_win:
runs-on: windows-2019
runs-on: windows-2022
name: Windows / Build and Test

steps:
Expand Down
58 changes: 58 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# C/C++ binary extension file
*.bin

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
[Bb]uild/
cmake-build-*/
dashboard/

# IDE (Editors)
.idea/
.vscode/
.vs/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![HTML][html-badge]][html]
[![License: CC BY 4.0](https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/)

[![Build Status](https://github.com/UNN-ITMM-Software/devtools-course-practice/workflows/CI/badge.svg?branch=main)](https://github.com/UNN-ITMM-Software/devtools-course-practice/actions?query=branch%3Amain)
[![Build Status](https://github.com/UNN-ITMM-Software/devtools-course-practice/workflows/CI/badge.svg?branch%3Amain)](https://github.com/UNN-ITMM-Software/devtools-course-practice/actions?query=branch%3Amain)
[![codecov](https://codecov.io/gh/UNN-ITMM-Software/devtools-course-practice/branch/main/graph/badge.svg)](https://codecov.io/gh/UNN-ITMM-Software/devtools-course-practice)

- ННГУ им. Н.И. Лобачевского
Expand Down
2 changes: 1 addition & 1 deletion devtools_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ endif()
#

if(CTEST_TARGET_SYSTEM MATCHES "^Windows")
set_ifndef(CTEST_CMAKE_GENERATOR "Visual Studio 16 2019")
set_ifndef(CTEST_CMAKE_GENERATOR "Visual Studio 17 2022")
else()
set_ifndef(CTEST_CMAKE_GENERATOR "Unix Makefiles")
endif()
Expand Down
29 changes: 25 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@
}
</style>

<script type="module">
<script type="module">
import { Octokit } from "https://esm.sh/@octokit/rest";

const octokit = new Octokit();

let realNames = {};
try {
let res = await fetch("https://devtools-course-practice-hluq.onrender.com/names");
realNames = await res.json();
} catch {};

octokit.paginate(octokit.rest.pulls.list, {
owner: "UNN-ITMM-Software",
repo: "devtools-course-practice",
Expand All @@ -28,11 +34,19 @@
.then(pulls => {
let results = {};
pulls.forEach(pull => {
let task_id = pull.title.match(/\d+/);
let task_id
let isPlagiarized = false;
pull.labels.forEach(label => {
if(label.name == "lab 1" || label.name == "lab 2" || label.name == "lab 3") {
task_id = label.name;
} else if (label.name == "plagiarized") {
isPlagiarized = true;
}
});
if (!task_id)
return;

task_id = parseInt(task_id[0]);
task_id = parseInt(task_id.at(-1));
if (task_id < 1 || task_id > 3)
return;

Expand All @@ -48,6 +62,10 @@
results[username][task_id].status = 'progress';
results[username][task_id].html_url = pull.html_url;
}
if (isPlagiarized) {
results[username][task_id].status ='plagiarized';
results[username][task_id].html_url = pull.html_url;
}
});

document.getElementById("loading").innerHTML = "";
Expand All @@ -61,7 +79,8 @@

for (const [userId, progress] of Object.entries(results)) {
var row = table.insertRow();
row.insertCell().innerHTML = "<a href=https://github.com/" + userId + ">" + userId + "</a>";
let name = userId in realNames ? realNames[userId] : userId;
row.insertCell().innerHTML = "<a href=https://github.com/" + userId + ">" + name + "</a>";
for (let i = 1; i <= 3; ++i) {
var cell = row.insertCell();
if (!progress[i].status)
Expand All @@ -70,6 +89,8 @@
var html = "<a href=" + progress[i].html_url + "><img src='https://img.shields.io/badge/";
if (progress[i].status === "success") {
html += "-accepted-4BC51D";
} else if (progress[i].status === "plagiarized") {
html += "!-plagiarized-blueviolet";
} else {
html += "-in progress-red";
}
Expand Down
26 changes: 13 additions & 13 deletions lab-guide/topics.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

| Тема | ЛР#2 | ЛР#3 |
|---|---|---|
| Алгоритм Хаффмана |||
| Сортировка (не "пузырьковая") |||
| Алгоритм Хаффмана |Солонинко Андрей 3821Б1ФИ2||
| Сортировка (не "пузырьковая") |Боровков Сергей 3821Б1ФИ1||
| Реализовать [бинарный поиск](http://codekata.com/kata/kata02-karate-chop/) |||
| Интерполяционный поиск |||
| Решение квадратного уравнения |||
| Алгоритм Дейкстры для поиска кратчайшего расстояния в графах |||
| Шифр Виженера |||
| Четно-нечетное слияние Бэтчера |||
| Поиск диаметра в графе |||
| Шифр Цезаря |||
| Решение квадратного уравнения |Кириллов Максим 3821Б1ПР1||
| Алгоритм Дейкстры для поиска кратчайшего расстояния в графах |Махиня Данил 3821Б1ПМоп3||
| Шифр Виженера |Ногин Денис 3821Б1ФИ2||
| Четно-нечетное слияние Бэтчера ||Чувашов Андрей 3821Б1ПР1|
| Поиск диаметра в графе |Козлов Михаил 3821Б1ПМоп3||
| Шифр Цезаря |Смирнов Леонид 3821Б1ПР1||
| Шифр Гронсфельда (encoder, decoder и взломщик) |||
| Вычисление значения функции из строки с помощью алгоритма сортировочной станции |||
| Печать всех простых чисел из заданного числового промежутка |||
| Radix sort |||
| Кодирование строк в Base64 и обратно |||
| Radix sort |Храмов Иван 3821Б1ПР1||
| Кодирование строк в Base64 и обратно |Ванюшкин Дмитрий 3821Б1ПР1||
| Волновой алгоритм для поиска пути на карте с препятствиями |||
| Билинейная интерполяция (двумерного массива как набора пикселей) |||
| [Триангуляция Делоне](https://habr.com/ru/post/445048/) | | |
Expand All @@ -45,11 +45,11 @@
| Граф (подсчет числа компонент связности) |||
| Левосторонняя куча |||
| Модифицированный стек |||
| АВЛ деревья |||
| АВЛ деревья |Кузнецов Артём 3821Б1ФИ3||
| RB деревья |||
| Множества |||
| Priority queue |||
| d-куча |||
| d-куча ||Козлов Михаил 3821Б1ПМоп3|
| hashmap |||
| template binary heap |||
| Fibonacci heap |||
Expand All @@ -71,7 +71,7 @@
| Операции над 3D векторами: норма, нормализация, скалярное и векторное произведение |||
| Бисимметричная матрица |||
| [Строковый калькулятор арифметических выражений](https://github.com/garora/TDD-Katas/blob/master/KatasReadme.md#string-calculator-kata-via-roy-osherove) |||
| Конвертор из арабских чисел в римские и обратно |||
| Конвертор из арабских чисел в римские и обратно |Чувашов Андрей 3821Б1ПР1||
| Расчет площади трехмерных фигур |||
| Расчет объема трехмерных фигур |||
| Два отрезка (в 2D). Проверить пересечение. |||
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Copyright 2024 Chuvashov Andrey

#include <gtest/gtest.h>
#include <cmath>
#include "include/complex_number.h"

static bool equalizer(double first, double second) {
return std::fabs(first - second) <= 1.0e-4;
}

TEST(ChuvashovAndreyTests, getTest) {
ComplexNumber cm = ComplexNumber(1, 2);
ASSERT_EQ(cm.getRe(), 1);
ASSERT_EQ(cm.getIm(), 2);
}

TEST(ChuvashovAndreyTests, setTest) {
ComplexNumber cm;
ASSERT_NO_THROW(cm.setRe(1));
ASSERT_NO_THROW(cm.setIm(2));
}

TEST(ChuvashovAndreyTests, setGetTest) {
ComplexNumber cm;
ASSERT_NO_THROW(cm.setRe(1));
ASSERT_NO_THROW(cm.setIm(2));
ASSERT_EQ(cm.getRe(), 1);
ASSERT_EQ(cm.getIm(), 2);
}

TEST(ChuvashovAndreyTests, plusTest) {
ComplexNumber cm1(10, 20), cm2(-20, -10), result(-10, 10);
auto res = cm1 + cm2;
ASSERT_EQ(result.getRe(), res.getRe());
ASSERT_EQ(result.getIm(), res.getIm());
}

TEST(ChuvashovAndreyTests, minusTest) {
ComplexNumber cm1(35, 95), cm2(-105, 25), result(140, 70);
auto res = cm1 - cm2;
ASSERT_EQ(result.getRe(), res.getRe());
ASSERT_EQ(result.getIm(), res.getIm());
}

TEST(ChuvashovAndreyTests, multTest) {
ComplexNumber cm1(189.19, 13), cm2(419.8, 11.34),
result(79274.542, 7602.8146);
auto res = cm1 * cm2;
ASSERT_TRUE(equalizer(result.getRe(), res.getRe()));
ASSERT_TRUE(equalizer(result.getIm(), res.getIm()));
}

TEST(ChuvashovAndreyTests, divTest) {
ComplexNumber cm1(19.11, 45), cm2(76.15, 11.34),
result(0.3315, 0.5415);
auto res = cm1 / cm2;
ASSERT_TRUE(equalizer(result.getRe(), res.getRe()));
ASSERT_TRUE(equalizer(result.getIm(), res.getIm()));
}

TEST(ChuvashovAndreyTests, zeroDivErrorCheck) {
ASSERT_ANY_THROW(ComplexNumber(1, 1) / ComplexNumber(0, 0));
}

TEST(ChuvashovAndreyTests, equalTest) {
ASSERT_TRUE(ComplexNumber(0.1245, 1415.125) ==
ComplexNumber(0.1245, 1415.125));
}

TEST(ChuvashovAndreyTests, notEqualTest) {
ASSERT_TRUE(ComplexNumber(1241.6478, 2663.22) !=
ComplexNumber(35743.15, 37326.2));
}

TEST(ChuvashovAndreyTests, comparisonTest) {
ComplexNumber cm1(10, 20), cm2(-10, -20);
cm1 = cm2;
ASSERT_EQ(cm1.getRe(), -10);
ASSERT_EQ(cm1.getIm(), -20);
}
2 changes: 1 addition & 1 deletion run_cpplint.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
execute_process(
COMMAND "cpplint" "${FILE}"
COMMAND "cpplint" "--filter=-runtime/references" "${FILE}"
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE error
Expand Down

0 comments on commit 3bbae44

Please sign in to comment.