This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| namespace Trading | |
| { | |
| // A class representing a single order in the order book | |
| public class Order | |
| { | |
| public int Id { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import operator | |
| # Define a dictionary of supported operations and their corresponding | |
| # functions from the operator module | |
| operators = { | |
| "+": operator.add, | |
| "-": operator.sub, | |
| "*": operator.mul, | |
| "/": operator.truediv, | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Host * | |
| IgnoreUnknown AddKeysToAgent,UseKeychain | |
| UseKeychain yes | |
| AddKeysToAgent yes | |
| IdentityFile c:\users\USERNAME\.ssh\id_ed25519 | |
| ## Uncomment if you want to switch SSH port | |
| ## Note that alias is 'gh' so you can now clone with | |
| ## git clone gh:GITHUB_USERNAME/REPO_NAME.git | |
| # Host gh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from functools import reduce | |
| list3 = [ | |
| ['S1', 'S2'], | |
| ['O1', 'O2'], | |
| ['F1'], | |
| ['A1', 'A2'] | |
| ] | |
| result = list3[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a = ['f', 'a', 'f', 's', 'o','a', 'd', 'm'] | |
| word = 'sofa' | |
| a_sorted = sorted(a, key=lambda x: x) | |
| print(a_sorted) | |
| a_sorted_by_word = sorted(a, key=lambda x: word.find(x)) | |
| print(a_sorted_by_word) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime | |
| firstName = input('Enter your first name: ') | |
| lastName = input('Enter your last name:'); | |
| birthdateInput = input('Enter your birthdate: YYYY-MM-DD: (e.g 2003-12-04):'); | |
| birthdate = datetime.fromisoformat(birthdateInput); | |
| age = datetime.now() - birthdate | |
| days = age.days |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // See https://aka.ms/new-console-template for more information | |
| int count = 6; | |
| var products = Enumerable.Range(1001, 20).ToArray(); | |
| for (int i = 1; i <= count; i++) | |
| { | |
| int recordsCount = (int)Math.Pow(10, i); | |
| var fileName = $"Data/Data{recordsCount}.csv"; | |
| Directory.CreateDirectory("Data"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace DataLib | |
| { | |
| public class DataManager | |
| { | |
| public void Run() | |
| { | |
| DataProvider.Instance.RunQuery(); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM mcr.microsoft.com/dotnet/core/sdk:2.2-alpine as build | |
| WORKDIR /app | |
| COPY *.csproj . | |
| RUN dotnet restore -r linux-musl-x64 | |
| FROM build as publish | |
| WORKDIR /app | |
| COPY . . | |
| #add IL linker package |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM mcr.microsoft.com/dotnet/core/sdk:2.2-alpine as build | |
| WORKDIR /app | |
| COPY *.csproj . | |
| RUN dotnet restore -r linux-musl-x64 | |
| COPY . . | |
| RUN dotnet publish -c Release -r linux-musl-x64 -o out --no-restore | |
| FROM mcr.microsoft.com/dotnet/core/runtime-deps:2.2-alpine as runtime |