diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml deleted file mode 100644 index 876005b..0000000 --- a/.github/workflows/python.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: Python package - -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.9"] - - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - cd ./python - pip install -r requirements.txt - - name: Lint with flake8 - run: | - cd ./python - flake8 ./ - - name: Lint with MyPy - run: | - cd ./python - mypy ./ - - name: Test with unittest - run: | - cd ./python - python -m unittest diff --git a/golang/main.go b/golang/main.go index d2c4e91..9488b72 100644 --- a/golang/main.go +++ b/golang/main.go @@ -1,7 +1,26 @@ package main -import "fmt" +import ( + "fmt" + "math" +) func main() { - fmt.Println("Hello world") + F4R(1.25, 3.25, 0.4) + fmt.Println("---------------------") + F4A([]float64{1.84, 2.71, 3.81, 4.56, 5.62}) +} + +func F4R(xn, xk, dx float64) { + for x := xn; x <= xk; x += dx { + var res float64 = math.Pow(math.Abs(math.Pow(x, 2)-2.5), 1.0/4.0) + math.Pow(math.Log(math.Pow(x, 2))/math.Log(math.E), 1.0/3.0) + fmt.Println(res) + } +} + +func F4A(arr []float64) { + for _, x := range arr { + var res float64 = math.Pow(math.Abs(math.Pow(x, 2)-2.5), 1.0/4.0) + math.Pow(math.Log(math.Pow(x, 2))/math.Log(math.E), 1.0/3.0) + fmt.Println(res) + } } diff --git a/python/.flake8 b/python/.flake8 deleted file mode 100644 index 4b473c6..0000000 --- a/python/.flake8 +++ /dev/null @@ -1,3 +0,0 @@ -[flake8] -ignore = E722 -max-line-length = 128 diff --git a/python/.gitignore b/python/.gitignore deleted file mode 100644 index c792544..0000000 --- a/python/.gitignore +++ /dev/null @@ -1,206 +0,0 @@ -# Prerequisites -*.d - -# Object files -*.o -*.ko -*.obj -*.elf - -# Linker output -*.ilk -*.map -*.exp - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - -# Debug files -*.dSYM/ -*.su -*.idb -*.pdb - -# Kernel Module Compile Results -*.mod* -*.cmd -.tmp_versions/ -modules.order -Module.symvers -Mkfile.old -dkms.conf -*.out - -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -#poetry.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -# JetBrains specific template is maintainted in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ \ No newline at end of file diff --git a/python/.vscode/launch.json b/python/.vscode/launch.json deleted file mode 100644 index 0a5c809..0000000 --- a/python/.vscode/launch.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Python: Текущий файл", - "type": "python", - "request": "launch", - "program": "${file}", - "console": "integratedTerminal" - } - ] -} diff --git a/python/.vscode/settings.json b/python/.vscode/settings.json deleted file mode 100644 index 2597cbc..0000000 --- a/python/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "python.linting.pylintEnabled": false, - "python.linting.mypyEnabled": false, - "python.linting.enabled": true, - "python.linting.lintOnSave": true, - "python.linting.flake8Enabled": true, -} diff --git a/python/Pipfile b/python/Pipfile deleted file mode 100644 index 0f6a6f3..0000000 --- a/python/Pipfile +++ /dev/null @@ -1,19 +0,0 @@ -[[source]] -url = "https://pypi.org/simple" -verify_ssl = true -name = "pypi" - -[packages] - -[dev-packages] -mypy = "*" -flake8 = "*" - -[requires] -python_version = "3.9" - -[scripts] -start = "python ./src/main.py" -test = "python -m unittest" -lint = "flake8 ./" -lintMyPy = "mypy ./" diff --git a/python/Pipfile.lock b/python/Pipfile.lock deleted file mode 100644 index f3145ef..0000000 --- a/python/Pipfile.lock +++ /dev/null @@ -1,106 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "4894b22932cc8c76e138c68198ce54cb057a7f4b391476c15e3e05d193ceb7f7" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3.9" - }, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.org/simple", - "verify_ssl": true - } - ] - }, - "default": {}, - "develop": { - "flake8": { - "hashes": [ - "sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db", - "sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248" - ], - "index": "pypi", - "version": "==5.0.4" - }, - "mccabe": { - "hashes": [ - "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325", - "sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e" - ], - "markers": "python_version >= '3.6'", - "version": "==0.7.0" - }, - "mypy": { - "hashes": [ - "sha256:1021c241e8b6e1ca5a47e4d52601274ac078a89845cfde66c6d5f769819ffa1d", - "sha256:14d53cdd4cf93765aa747a7399f0961a365bcddf7855d9cef6306fa41de01c24", - "sha256:175f292f649a3af7082fe36620369ffc4661a71005aa9f8297ea473df5772046", - "sha256:26ae64555d480ad4b32a267d10cab7aec92ff44de35a7cd95b2b7cb8e64ebe3e", - "sha256:41fd1cf9bc0e1c19b9af13a6580ccb66c381a5ee2cf63ee5ebab747a4badeba3", - "sha256:5085e6f442003fa915aeb0a46d4da58128da69325d8213b4b35cc7054090aed5", - "sha256:58f27ebafe726a8e5ccb58d896451dd9a662a511a3188ff6a8a6a919142ecc20", - "sha256:6389af3e204975d6658de4fb8ac16f58c14e1bacc6142fee86d1b5b26aa52bda", - "sha256:724d36be56444f569c20a629d1d4ee0cb0ad666078d59bb84f8f887952511ca1", - "sha256:75838c649290d83a2b83a88288c1eb60fe7a05b36d46cbea9d22efc790002146", - "sha256:7b35ce03a289480d6544aac85fa3674f493f323d80ea7226410ed065cd46f206", - "sha256:85f7a343542dc8b1ed0a888cdd34dca56462654ef23aa673907305b260b3d746", - "sha256:86ebe67adf4d021b28c3f547da6aa2cce660b57f0432617af2cca932d4d378a6", - "sha256:8ee8c2472e96beb1045e9081de8e92f295b89ac10c4109afdf3a23ad6e644f3e", - "sha256:91781eff1f3f2607519c8b0e8518aad8498af1419e8442d5d0afb108059881fc", - "sha256:a692a8e7d07abe5f4b2dd32d731812a0175626a90a223d4b58f10f458747dd8a", - "sha256:a705a93670c8b74769496280d2fe6cd59961506c64f329bb179970ff1d24f9f8", - "sha256:c6e564f035d25c99fd2b863e13049744d96bd1947e3d3d2f16f5828864506763", - "sha256:cebca7fd333f90b61b3ef7f217ff75ce2e287482206ef4a8b18f32b49927b1a2", - "sha256:d6af646bd46f10d53834a8e8983e130e47d8ab2d4b7a97363e35b24e1d588947", - "sha256:e7aeaa763c7ab86d5b66ff27f68493d672e44c8099af636d433a7f3fa5596d40", - "sha256:eaa97b9ddd1dd9901a22a879491dbb951b5dec75c3b90032e2baa7336777363b", - "sha256:eb7a068e503be3543c4bd329c994103874fa543c1727ba5288393c21d912d795", - "sha256:f793e3dd95e166b66d50e7b63e69e58e88643d80a3dcc3bcd81368e0478b089c" - ], - "index": "pypi", - "version": "==0.982" - }, - "mypy-extensions": { - "hashes": [ - "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d", - "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8" - ], - "version": "==0.4.3" - }, - "pycodestyle": { - "hashes": [ - "sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785", - "sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b" - ], - "markers": "python_version >= '3.6'", - "version": "==2.9.1" - }, - "pyflakes": { - "hashes": [ - "sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2", - "sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3" - ], - "markers": "python_version >= '3.6'", - "version": "==2.5.0" - }, - "tomli": { - "hashes": [ - "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", - "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" - ], - "markers": "python_version < '3.11'", - "version": "==2.0.1" - }, - "typing-extensions": { - "hashes": [ - "sha256:1511434bb92bf8dd198c12b1cc812e800d4181cfcb867674e0f8279cc93087aa", - "sha256:16fa4864408f655d35ec496218b85f79b3437c829e93320c7c9215ccfd92489e" - ], - "markers": "python_version >= '3.7'", - "version": "==4.4.0" - } - } -} diff --git a/python/README.md b/python/README.md deleted file mode 100644 index a394814..0000000 --- a/python/README.md +++ /dev/null @@ -1,54 +0,0 @@ -# Работа с проектом - -`vscode` при старте предложит установить рекомендованныек расширения - с ним лучше согласиться. - - -## Настройка окружения - -### Python - -Установите `python` для соответствующей операционной системы. - -**ВАЖНО** - -При установке в windows - укажите галочку - добавить python в переменную окружения `PATH` - -### Pipenv - -Мы используем виртуальное окружение `pipenv`, для его установки используйте следующую команду: - -```shell -pip install pipenv -``` -Установку требуется сделать только 1 раз, активацию - каждый раз когда вы перезапускаете терминал. - - -Для активации виртуального окружения следует выполнить следующую команду, при этом выполнять ее нужно в каталоге текущего проекта `python` (рядом с текущим `README.md` файлом и содержит `Pipfile`) - -``` -pipenv shell -``` - -После этого необходимо установить зависимости, указанные в `pipenv` файле - - - -После установки pipenv при использовании `vscode` следует выбрать версию интерпретатора, привязанный к проекту. Для этого можно выполнить следующую последовательность действий. Настраивать требуется только 1 раз при настройке виртуального окружения. - -- Нажать комбинацию клавиш `ctrl-shift-p` -- Начать писать `Reload window` -- Начать писать `Python select interpreter` -- Выбрать на уровне рабочей области -- Найти свое окружение, скорее всего в его имени в скобках будет указано `(python-"НАБОР_СИМВОЛОВ")` - -Ваше рабочее окружение настроено и можете его иcпользовать. - -### Доступные команды - -Команды проверок, запускаемые в `github actions` можно также запустить локально выполнением одной из следующих команд - -```shell -pipenv run test -pipenv run lint -pipenv run lintMyPy -``` \ No newline at end of file diff --git a/python/informatics.code-workspace b/python/informatics.code-workspace deleted file mode 100644 index 9c3d46e..0000000 --- a/python/informatics.code-workspace +++ /dev/null @@ -1,19 +0,0 @@ -{ - "folders": [ - { - "path": "." - }, - ], - "settings": { - "files.exclude": { - "**/.git": true, - }, - "editor.tabSize": 4, - }, - "extensions": { - "recommendations": [ - "ms-python.python", - "eamodio.gitlens" - ] - } -} diff --git a/python/requirements.txt b/python/requirements.txt deleted file mode 100644 index 35e3f5c..0000000 Binary files a/python/requirements.txt and /dev/null differ diff --git a/python/src/__init__.py b/python/src/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/python/src/main.py b/python/src/main.py deleted file mode 100644 index e37a77c..0000000 --- a/python/src/main.py +++ /dev/null @@ -1,7 +0,0 @@ -def summ(a: int, b: int) -> int: - return a + b - - -if __name__ == "__main__": - print("Hello world") - print(summ(3, 4)) diff --git a/python/tests/__init__.py b/python/tests/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/python/tests/test_main.py b/python/tests/test_main.py deleted file mode 100644 index 0280a2e..0000000 --- a/python/tests/test_main.py +++ /dev/null @@ -1,37 +0,0 @@ -import unittest -from src import main - - -class SummTests(unittest.TestCase): - - def test_positive(self): - res = main.summ(2, 3) - self.assertEqual(5, res) - - def test_zero(self): - res = main.summ(0, 0) - self.assertEqual(0, res) - - def test_one_negative(self): - res = main.summ(-2, 3) - self.assertEqual(1, res) - - def test_both_negative(self): - res = main.summ(-2, -4) - self.assertEqual(-6, res) - - def test_one_negative_zero_res(self): - res = main.summ(-2, 2) - self.assertEqual(0, res) - - def test_one_negative_and_text(self): - try: - main.summ(-2, "2") - except: - self.assertTrue(True) - return - self.fail() - - -if __name__ == '__main__': - unittest.main()