Giter Club home page Giter Club logo

exercises-csharp's Introduction

github action status

hexlet-basics

Setup

Requirements

  • docker
  • docker compose V2
  • ruby >= 3.0.0
  • make

Steps

Add to /etc/hosts: 127.0.0.1 code-basics.test

Clone project

Some lsp servers are fully workable only when the root dir is the same inside and outside the container. That is why we set WORKDIR to /opt/projects/hexlet-basics. So, if it is possible, clone this project to that directory.

Prepare pulling image locally

  1. Open ./app/lib/docker_exercise_api.rb
  2. Find def self.download(lang_name) line
  3. Comment or remove ok = system("docker pull #{image_name(lang_name)}") line
  4. Add new line ok = true below

Run

make project-setup
make compose # run server
# open code-basics.test

make app-test # run tests

# load language
# make app-language-load L=php

make app-db-prepare # sometimes, when fixtures were changed

To manage loaded languages and set other settings, you need to sign in (login: [email protected], password: password)

Production

Kube access

# make k8s-macos-setup or make k8s-ubuntu-setup
export DIGITALOCEAN_ACCESS_TOKEN=<your token>
make local-cluster-setup

Deploy

  • Create new tag via command:

    make next-tag
  • Wait notification about ready tag in Slack channel #sideprojects-code-auto or wait Github Actions

  • Change version in k8s/hb-app-chart/values.yaml and then:

    make -C k8s helm-upgrade-app

Troubleshooting

I couldn't commit my changes

  • try to reinitialize your fork repository Read more
  • try to add RUN git config --global --add safe.directory ${PROJECT_ROOT} line after WORKDIR ${PROJECT_ROOT} in Dockerfile Read more

Hexlet Ltd. logo

This repository is created and maintained by the team and the community of Hexlet, an educational project. Read more about Hexlet.

See most active contributors on hexlet-friends.

exercises-csharp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

exercises-csharp's Issues

Добавить реплы с примерами кода.

В теории есть куски кода, которые можно посмотреть. но они не интерактивные.
Пример -

```cs
// Ставим пробел в левой части
Console.WriteLine("King's " + "Landing"); // => King's Landing
// Ставим пробел в правой части
Console.WriteLine("King's" + " Landing"); // => King's Landing
// Добавляем пробел отдельно
Console.WriteLine("King's" + " " + "Landing"); // => King's Landing
```

Надо добавить реплы, такие же, как в других языках (js, python, java), чтобы студенты могли позапускать их.

СЮда можно скидывать ссылки на созданные реплы, либо в ПРе вставлять на свои. А мы будем их форкать и давать новую ссылку на хекслетовский репл. Это нужно для того, чтобы все наши реплы находились в одном месте - в аккаунте Хекслета.

Т.е. задача состоит из двух частей

  1. сделать сами реплы, которые нужно копировать
  2. Фигануть ПРчик, мы копируем реплы и даем ссылки, вставляете реплы в код, заменяя старую ссылочку.

Поменять способ получения первого и последнего символа в строке

var result = $"First: {text[0]}\nLast: {text[text.Length - 1]}";

Прислали обратную связь по упражнению:

Задание 33 по C# вывод первого и последнего символа строки, так уже никто не пишет myString[myString.Length - 1]; а ваш компилятор не знает про такой синтаксис myString[^1]; хотел применить прочитанную теорию но потерпел неудачу )

scriptcs при пропущенной ; в конце ответа возвращает код 0 (нет ошибки)

В этом уроке https://ru.code-basics.com/languages/csharp/lessons/definition#editor
У студента есть неправильное решение

var motto = "What Is Dead May Never Die!";
Console.Writeline(motto);

Тесты проваливаются, все хорошо.
Но если убрать все ;, и попробовать его проверить, вывод будет такой:

(2,0): error CS1525: Unexpected symbol `Console'
(1,23): error CS0103: The name `output' does not exist in the current context

Но при этом пишет, что тесты прошли и засчитает упражнение.

scriptcs при ошибках в синтаксисе возвращает код 2. Но в данном случае почему-то возвращает 0.

Нестабильная работа тестов

Тесты то падают, то проходят, даже если код не менялся. В независимости от упражнения, во - всяком случае однозначно воспроизводится на упражнениях с выводом в консоль.
Вывод или такой
Unstable2

или такой

Unstable

Дважды повторяется слово "возвращает" в строке 87

* Получить текущую дату с помощью свойства `DateTime.Now`. Это свойство возвращает возвращает объект даты. В реальности у даты есть свойство `Year`, который выполняет нашу задачу. Но здесь мы хотим потренироваться

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.