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
//поиск | |
https://yandex.ru/search/smart/?text=%25s | |
//подсказки | |
https://suggest.yandex.ru/suggest-ff.cgi?part=%s |
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 static System.Linq.Expressions.Expression; | |
void Main() | |
{ | |
var obj = new {yoba = "zheltiy", peka = 1488}; | |
var obj2 = new {A = "zheltiy", B = 1488, C = BindingFlags.DoNotWrapExceptions}; | |
obj.GetAnonDict().Dump(); | |
obj2.GetAnonDict().Dump(); | |
} |
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
async Task Main() | |
{ | |
var dir = @"C:\Work\work\nsrj\trunk\lib"; | |
var http = new HttpClient { BaseAddress = new Uri("https://search.maven.org") }; | |
var deps = new StringBuilder(); | |
foreach (var jar in Directory.EnumerateFiles(dir, @"*.jar", SearchOption.AllDirectories)) | |
{ | |
jar.Dump(); | |
var hash = Sha1(File.ReadAllBytes(jar)); | |
var url = $"https://search.maven.org/solrsearch/select?q=1:%20{hash}&start=0&rows=20"; |
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
from dataclasses import dataclass | |
from typing import List | |
T_co = TypeVar('T_co', Employee, Engineer, Manager, covariant=True) | |
T_contra = TypeVar('T_contra', Employee, Engineer, Manager, contravariant=True) | |
@dataclass | |
class Employee: | |
salary: int |
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() | |
{ | |
var options = new GeneratorOptions | |
{ | |
CsPath = @"C:\Users\aokarpov\Downloads\PayMsgRes\PayMsgRes.cs", | |
DateTimeFormat = "yyyy-MM-ddTHH:mm:ss.fffZ", | |
Namespace = "Yoba.Peka", | |
XsdPath = @"C:\Users\aokarpov\Downloads\PayMsgRes\PayMsgRes.xsd", | |
}; | |
Generate(options).Dump(); |
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.Collections.Concurrent; | |
using System.Linq; | |
using System.Threading; | |
namespace ConsoleApp1 | |
{ | |
public class Program | |
{ | |
static readonly Random Rng = new Random(); |
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.Collections.Generic; | |
using System.Diagnostics.Contracts; | |
using System.IO; | |
using System.Text; | |
namespace Interfax.SM.Utils.IO | |
{ | |
/// <inheritdoc /> | |
/// <summary> |
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 DataDogFilterAttribute : ActionFilterAttribute | |
{ | |
const string KEY = nameof(DataDogFilterAttribute) + "Value"; | |
readonly string _name; | |
public DataDogFilterAttribute(string name) | |
{ | |
if (string.IsNullOrEmpty(name)) | |
throw new ArgumentNullException(nameof(name)); |
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 SerializerInfo | |
{ | |
const double EPSILON = 0.0001; | |
readonly object _lock = new object(); | |
double _averageSize = 0; | |
long _count = 0; | |
public SerializerInfo(XmlSerializer serializer) | |
{ | |
Serializer = serializer; |
NewerOlder