using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
public class Program
{
static void Main() => WebHost.Start(ctx => ctx.Response.WriteAsync("Hello World!")).WaitForShutdown();
}
This file contains 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 System.Collections.Generic | |
{ | |
public static class ConcurrentDictionaryExtensions | |
{ | |
/// <summary> | |
/// Provides an alternative to <see cref="ConcurrentDictionary{TKey, TValue}.GetOrAdd(TKey, Func{TKey, TValue})"/> that disposes values that implement <see cref="IDisposable"/>. | |
/// </summary> | |
/// <typeparam name="TKey"></typeparam> | |
/// <typeparam name="TValue"></typeparam> | |
/// <param name="dictionary"></param> |
This file contains 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.Linq; | |
using Org.BouncyCastle.Asn1.X9; | |
using Org.BouncyCastle.Crypto; | |
using Org.BouncyCastle.Crypto.Generators; | |
using Org.BouncyCastle.Crypto.Parameters; | |
using Org.BouncyCastle.Security; | |
namespace Program | |
{ |
This file contains 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
// 1 | |
int a = 1; | |
void main() { | |
// 2 | |
double b; | |
// 3 | |
var text = "text"; |
This file contains 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
/* | |
* Используя switch, напишите программу в методе main(), которая выводит название месяца по номеру от 1 до 12. | |
*/ | |
var monthMap = <int, String> { | |
1: "Январь", | |
2: "Февраль", | |
3: "Март", | |
4: "Апрель", | |
5: "Май", |
This file contains 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
void main() { | |
for (int i = 0; i < 100; i++) { | |
if (i.isEven) | |
print("${i}"); | |
} | |
} |
This file contains 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 'dart:io'; | |
void main() { | |
var total = 0; | |
for (;;) { | |
stdout.write("Input number or 'stop': "); | |
var input = stdin.readLineSync()!; | |
if (input == 'stop') break; |
This file contains 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
void main(List<String> arguments) { | |
print('Hello world!'); | |
var student = Student('mikhail', 'ushanov', DateTime(2018, 01, 01)); | |
print(student); | |
} | |
// 2.10 1 | |
class Student extends User { | |
DateTime yearOfAdmission; |
This file contains 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
public class EnumMapper : IDisposable | |
{ | |
readonly Dictionary<Type, Dictionary<string, object>> _stringsToEnums = | |
new Dictionary<Type, Dictionary<string, object>>( ) ; | |
readonly Dictionary<Type, Dictionary<int, string>> _enumNumbersToStrings = | |
new Dictionary<Type, Dictionary<int, string>>( ) ; | |
readonly ReaderWriterLockSlim _lock = new ReaderWriterLockSlim( ) ; |