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.Linq; | |
| using System.Linq.Expressions; | |
| using System.Security.Cryptography; | |
| using BenchmarkDotNet.Attributes; | |
| using BenchmarkDotNet.Running; | |
| namespace ConsoleApp7 | |
| { | |
| [CoreJob] |
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.Linq; | |
| using Org.BouncyCastle.Crypto.Digests; | |
| namespace XXX | |
| { | |
| public static class OneTimePad | |
| { | |
| public static byte[] Encrypt(byte[] data, byte[] masterKey, uint index) => | |
| Encrypt(data, masterKey.Concat(GetSolidityUint256(index)).ToArray()); |
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 scala.annotation.tailrec | |
| trait RNG { | |
| def nextInt: (Int, RNG) | |
| } | |
| case class SimpleRNG(seed: Long) extends RNG { | |
| def nextInt: (Int, RNG) = { | |
| val newSeed = (seed * 0x5DEECE66DL + 0xBL) & 0xFFFFFFFFFFFFL | |
| val nextRNG = SimpleRNG(newSeed) |
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
| Прикиньте как к с Дру играть в шахматы. | |
| - Это не мат. Даже если это мат, я могу продолжать. | |
| - И что что ты сказал "мат", это оценочное суждение. | |
| - Нет мат это не проигрыш, иначе он бы назывался "проигрыш", а не мат. | |
| - Включи мозг, очевидно, что мат это один из двух состояний игры "Шах" и "Мат". | |
| - Мат это просто очень серьезный шах. | |
| - Да завершился взятием короля. И что? | |
| - Ты просто убил моего короля, причем тут проигрыш? | |
| - Нет не проиграл, я просто пожертвовал фигуру. |
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 static string GetTelegramMessage(string message) | |
| { | |
| const int telegramMessageMaxLength = 4096; // https://core.telegram.org/method/messages.sendMessage#return-errors | |
| const int ellipsisDotsCount = 3; | |
| var encoding = Encoding.UTF8; | |
| if (string.IsNullOrEmpty(message) || encoding.GetByteCount(message) <= telegramMessageMaxLength) | |
| { | |
| return message; | |
| } |
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
| С рефакторингом обычно связан вопрос о его влиянии на производительность программы. С целью облегчить понимание работы программы часто осуществляется модификация, приводящая к замедлению выполнения программы. Это важный момент. Я не принадлежу к той школе, которая пренебрегает производительностью в пользу чистоты проекта или в надежде на рост мощности аппаратной части.Программное обеспечение отвергалось как слишком медленное, а более быстрые машины устанавливают свои правила игры. Рефакторинг, несомненно, заставляет программу выполняться медленнее, но при этом делает ее более податливой для настройки производительности. Секрет создания быстрых программ, если только они не предназначены для работы в жестком режиме реального времени, состоит в том, чтобы сначала написать программу, которую можно настраивать, а затем настроить ее так, чтобы достичь приемлемой скорости. | |
| Мне известны три подхода к написанию быстрых программ. Наиболее трудный из них связан с ресурсами времени и часто применяется в системах с жестк |
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
| { | |
| "name": "MyNet", | |
| "engine": { | |
| "authorityRound": { | |
| "params": { | |
| "stepDuration": "5", | |
| "validators": { | |
| "list": [ | |
| "0x00Bd138aBD70e2F00903268F3Db08f2D25677C9e", | |
| "0x00Aa39d30F0D20FF03a22cCfc30B7EfbFca597C2", |
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.Data.Linq.SqlClient; | |
| using System.Linq; | |
| using System.Linq.Expressions; | |
| using System.Reflection; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace Tests |
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
| Alex@DESKTOP-CA0EFN5 MINGW64 ~/Documents/Repo/parity-ethereum (master) | |
| $ cargo +nightly-x86_64-pc-windows-msvc build | |
| Building [ ] 0/406: Building [ ] 0/406: Building [ ] 0/406: Building [ ] 0/406: Building [ ] 0/406: |
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
| fn are_concatable_strings(a: &str, b: &str, result: &str) -> bool { | |
| if a.len() + b.len() != result.len() { | |
| return false; | |
| } | |
| let a: Vec<_> = a.chars().collect(); | |
| let b: Vec<_> = b.chars().collect(); | |
| let result: Vec<_> = result.chars().collect(); | |
| let mut i = 0; | |
| let mut j = 0; |