Skip to content

Instantly share code, notes, and snippets.

View Kikimora's full-sized avatar

Andrey Verbin Kikimora

View GitHub Profile
namespace Hmmm
{
class SequentialTaskScheduler : TaskScheduler
{
private readonly ConcurrentQueue<Task> _tasks = new ConcurrentQueue<Task>();
private readonly TaskScheduler _executor;
private int _isRunning;
public SequentialTaskScheduler() : this(Default)
{
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using MyExchange.Common.Data;
using Qoden.Util;
using Qoden.Util.Serilog;
using Qoden.Validation;
using Serilog;
public interface IMyBriefDto
{
public string Name { get; set; }
public string Address { get; set; }
}
public interface IMyDto : IMyBriefDto
{
public int Age { get; set; }
public string Country { get; set; }
public class TestDbListener : DbListener
{
private readonly BlockingCollection<List<DbListenerEvent>> _events = new BlockingCollection<List<DbListenerEvent>>();
private readonly List<DbListenerEvent> _triggerErrorFlag = new List<DbListenerEvent>();
private Exception _error;
public TestDbListener([NotNull] IOptions<DbListenerOptions> options) : base(options)
{
}
interface IBotOptionsVisitor<T>
{
T Visit(CopyCatOptions copyCatOptions);
T Visit(VolGenOptions volGenOptions);
}
static class BotOptionsVisitor
{
public static bool TryVisit<T>(JObject options, IBotOptionsVisitor<T> visitor, out T result)
{
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "remote bot",
"type": "coreclr",
@Kikimora
Kikimora / lottery.sol
Last active September 23, 2019 14:57
contract Lottery {
//standard ERC20 staff
//TODO: separate ERC20 token from this contract?
uint public contestFinishTime; //dec 31
//Lottery starts in OPEN state
//then transiton to PICK_WINNER
//then to CLOSED
using System;
using System.Diagnostics;
using System.Threading;
using Microsoft.Extensions.DependencyInjection;
using MyExchange.BackOffice.Client;
using MyExchange.Data;
using MyExchange.Test;
using MyExchange.Test.XUnit;
using Serilog;
using Xunit;
interface IPersonRouter
{
void EditPersonAddress(Address address);
}
public class PersonRouter : IPersonRouter
{
private QodenController _root;
PersonRouter(QodenController root) { _root = root; }
using System;
using System.Threading;
using System.Linq;
using System.Collections.Generic;
public class Program
{
private static int i = -1;
private static List<int> a = new List<int>() {1, 5, 6, 8};
private static List<int> b = new List<int>() {3, 4, 1, 9};