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
class Program | |
{ | |
private const int MegaByte = 1048576; | |
public static void Main(string[] args) | |
{ | |
Console.WriteLine("Process ID: " + Process.GetCurrentProcess().Id); | |
var tasks = new List<Task>(); | |
for (var i = 0; i < 10; i++) |
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
class Config | |
{ | |
public static Int32 GoodRowMin => 6; | |
public static Int32 GoodRowMax => 9; | |
public static Int32 GoodColumnMin => 8; | |
public static Int32 GoodColumnMax => 17; | |
} | |
void Main() | |
{ |
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
private async void AsyncMethod() { | |
var result = await Method(); | |
} | |
MyTask<Int32> Method() { | |
return new MyTask<Int32>(); | |
} | |
// ------------------------------------------------------------ |
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
var variable = Expression.Variable(typeof(String[])); | |
Expression.Lambda( | |
Expression.Loop( | |
Expression.Block( | |
new[] { variable }, | |
Expression.Call(typeof(Console), "Write", Type.EmptyTypes, Expression.Constant('>')), | |
Expression.Call(typeof(Console), "Write", Type.EmptyTypes, Expression.Constant(' ')), | |
Expression.Assign(variable, | |
Expression.Call( | |
Expression.Call(typeof(Console), "ReadLine", Type.EmptyTypes), |
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
void Main() { | |
GetBalance("card number").Dump(); | |
} | |
Decimal GetBalance(String card) { | |
var requestData = GetBalanceRequestData(card); | |
var request = HttpWebRequest.CreateHttp("https://api.privatbank.ua/p24api/balance"); | |
request.Method = "POST"; | |
using (var stream = request.GetRequestStream()) |