Giter Club home page Giter Club logo

2022-mathmech-f-sharp-lessons's Introduction

2022MathMechFSharpLessons

Репозиторий домашних заданий на МатМехе (Технологии программирования).

Task1 module

  1. Реализовать функцию, принимающую два числа (основание и показатель) и вычисляющую степень наивным образом. Реализовать необходимые тесты. NaivePower
  2. Реализовать функцию, принимающую два числа (основание и показатель) и вычисляющую степень используя быстрое возведение в степень. Реализовать необходимые тесты. Power
  3. Реализовать функцию, принимающую массив и возвращающую разницу между самым большим и самым маленьким элементами в этом массиве. Добавить тесты. Dispersion
  4. Реализовать функцию, которая принимает два целых числа и возвращает массив нечётных чисел, лежащих строго между ними. Реализовать тесты. OddBetween

Task2 module

Для двух типов, реализующих список, которые были придуманы на паре.

  1. Реализовать сортировку пузырьком: функция принимает список и возвращает отсортированный список. Добавить необходимые тесты. FuncList.BubbleSort и OOPList.BubbleSort
  2. Реализовать сортировку Хоара (быструю сотрировку): функция принимает список и возвращает отсортированный список. Добавить необходимые тесты. FuncList.QuickSort и OOPList.QuickSort
  3. Реализовать конкатенацию двух списков: функуия принимает два списка и возвращает третий —- конкатенацию двух входных. FuncList.Concat и OOPList.Concat Подробнее здесь.

Task3 module

Домашняя работа 3. Про деревья.

  1. Описать алгебраический тип, задающий дерево, в котором внутренний узел может иметь произвольное количество сыновей. Листья и внутренние узлы хранят некоторые значения произвольного (одинакового для всех) типа. Tree
  2. Реализовать функцию, которая по дереву (тип, описанный выше), находит количество различных элементов, хранящихся в узлах. Использовать рекурсию, не использовать мутабельные переменные. Tree.CountDifferent
  3. Реализовать функцию, которая по дереву (тип, описанный выше), строит список, содержащий все значения из всех узлов. Для сипска использовать тип MyList из предыдущей задачи. Рекурсия — хорошо, мутабельные переменные — плохо. Tree.GetList Подробнее здесь.

Task4 module

Домашка 4.

  1. Используя алгебраические типы данных реализовать деревья, необходимые для представления разреженных матриц и разреженных векторов. Предусмотреть возможность хранить в векторах и матрицах значения различных типов (бывают матрицы со строками, бывают с целыми числами и т.д.) VectorBinTree<'elementType> и MatrixQuadTree<'elementType>
  2. Реализовать тип "вектор" и тип "матрица" с использованием реализованных ранее деревьев. Vector<'elementType> и Matrix<'elementType>
  3. Реализовать функцию умножения вектора на матрицу.
  4. Не забыть все протестировать.

Как запустить какую-то функцию из перечисленных выше?

  1. Собрать проект: ./build.sh DotnetBuild
  2. По желанию, можно протестировать: ./build.sh DotnetTest
  3. Запустить: ./src/2022MathMechFSharpLessons/bin/Debug/net6.0/2022MathMechFSharpLessons Этот исполняемый файл выполняет функции из task1, а функции из других заданий - нет

Builds

GitHub Actions
GitHub Actions
Build History

NuGet

Package Stable Prerelease
2022MathMechFSharpLessons NuGet Badge NuGet Badge

Developing

Make sure the following requirements are installed on your system:

or


Environment Variables

  • CONFIGURATION will set the configuration of the dotnet commands. If not set, it will default to Release.
    • CONFIGURATION=Debug ./build.sh will result in -c additions to commands such as in dotnet build -c Debug
  • GITHUB_TOKEN will be used to upload release notes and NuGet packages to GitHub.
    • Be sure to set this before releasing
  • DISABLE_COVERAGE Will disable running code coverage metrics. AltCover can have severe performance degradation so it's worth disabling when looking to do a quicker feedback loop.
    • DISABLE_COVERAGE=1 ./build.sh

Building

> build.cmd <optional buildtarget> // on windows
$ ./build.sh  <optional buildtarget>// on unix

Build Targets

  • Clean - Cleans artifact and temp directories.
  • DotnetRestore - Runs dotnet restore on the solution file.
  • DotnetBuild - Runs dotnet build on the solution file.
  • DotnetTest - Runs dotnet test on the solution file.
  • GenerateCoverageReport - Code coverage is run during DotnetTest and this generates a report via ReportGenerator.
  • WatchApp - Runs dotnet watch on the application. Useful for rapid feedback loops.
  • WatchTests - Runs dotnet watch with the test projects. Useful for rapid feedback loops.
  • GenerateAssemblyInfo - Generates AssemblyInfo for libraries.
  • CreatePackages - Runs the packaging task from dotnet-packaging. This creates applications for win-x64, osx-x64 and linux-x64 - Runtime Identifiers.
    • Bundles the win-x64 application in a .zip file.
    • Bundles the osx-x64 application in a .tar.gz file.
    • Bundles the linux-x64 application in a .tar.gz file.
  • GitRelease - Creates a commit message with the Release Notes and a git tag via the version in the Release Notes.
  • GitHubRelease - Publishes a GitHub Release with the Release Notes and any NuGet packages.
  • FormatCode - Runs Fantomas on the solution file.
  • Release - Task that runs all release type tasks such as GitRelease and GitHubRelease. Make sure to read Releasing to setup your environment correctly for releases.

Releasing

git add .
git commit -m "Scaffold"
git remote add origin https://github.com/user/MyCoolNewApp.git
git push -u origin master
  • Create a GitHub OAuth Token

    • You can then set the GITHUB_TOKEN to upload release notes and artifacts to github
    • Otherwise it will fallback to username/password
  • Then update the CHANGELOG.md with an "Unreleased" section containing release notes for this version, in KeepAChangelog format.

NOTE: Its highly recommend to add a link to the Pull Request next to the release note that it affects. The reason for this is when the RELEASE target is run, it will add these new notes into the body of git commit. GitHub will notice the links and will update the Pull Request with what commit referenced it saying "added a commit that referenced this pull request". Since the build script automates the commit message, it will say "Bump Version to x.y.z". The benefit of this is when users goto a Pull Request, it will be clear when and which version those code changes released. Also when reading the CHANGELOG, if someone is curious about how or why those changes were made, they can easily discover the work and discussions.

Here's an example of adding an "Unreleased" section to a CHANGELOG.md with a 0.1.0 section already released.

## [Unreleased]

### Added
- Does cool stuff!

### Fixed
- Fixes that silly oversight

## [0.1.0] - 2017-03-17
First release

### Added
- This release already has lots of features

[Unreleased]: https://github.com/user/MyCoolNewApp.git/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/user/MyCoolNewApp.git/releases/tag/v0.1.0
  • You can then use the Release target, specifying the version number either in the RELEASE_VERSION environment variable, or else as a parameter after the target name. This will:
    • update CHANGELOG.md, moving changes from the Unreleased section into a new 0.2.0 section
      • if there were any prerelease versions of 0.2.0 in the changelog, it will also collect their changes into the final 0.2.0 entry
    • make a commit bumping the version: Bump version to 0.2.0 and adds the new changelog section to the commit's body
    • push a git tag
    • create a GitHub release for that git tag

macOS/Linux Parameter:

./build.sh Release 0.2.0

macOS/Linux Environment Variable:

RELEASE_VERSION=0.2.0 ./build.sh Release

2022-mathmech-f-sharp-lessons's People

Contributors

alin42 avatar pavlova-alena-student avatar

Watchers

Semyon avatar  avatar

Forkers

alin42

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.