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 typing import Protocol, TypeVar, Callable | |
from dataclasses import is_dataclass, fields | |
from dataclasses import MISSING | |
S = TypeVar("S") | |
T = TypeVar("T") | |
class IProfile(Protocol): |
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 __future__ import annotations | |
from typing import Callable, Generic, Protocol, TypeVar | |
from typing import overload | |
from typing import get_type_hints, get_args, get_origin | |
T = TypeVar("T") | |
class IServiceProvider(Protocol): |
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
MIT License | |
Copyright (c) 2022 Adam Hancock | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
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.Reactive; | |
using System.Reactive.Concurrency; | |
using System.Reactive.Linq; | |
using System.Threading; | |
using System.Threading.Tasks; | |
public class RateLimiter | |
{ |
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 ClassifierSettings | |
{ | |
public int WindowSize { get; set; } = 250; | |
public int Estimators { get; set; } = 25; | |
public int MaxDepth { get; set; } = 15; | |
public int Features { get; set; } = 0; |
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; | |
using System.Collections.Generic; | |
using System.Linq; | |
public interface ISeries | |
{ | |
void Attach(ISeries series); |
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 DisposableInstance | |
{ | |
using System; | |
using System.Threading; | |
// Usage | |
internal class Program | |
{ | |
private static void TestDisposeInstance() | |
{ |
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 interface ISocket : IDisposable | |
{ | |
event Action<Exception> OnError; | |
event Action<dynamic> OnData; | |
event Action OnDisconnected; | |
event Action OnConnected; |
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 FluentValidator : ComponentBase | |
{ | |
private readonly IDictionary<Type, IValidator> _validators = | |
new Dictionary<Type, IValidator>(); | |
[CascadingParameter] | |
public EditContext EditContext { get; set; } | |
[Inject] |
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 abstract class Disposable : IDisposable | |
{ | |
private bool _disposed; | |
public void Dispose() | |
{ | |
if (_disposed) | |
{ | |
return; |
NewerOlder