Skip to content

Instantly share code, notes, and snippets.

View nj4x's full-sized avatar

Roman Herasymenko nj4x

View GitHub Profile
using System;
using System.Collections.Generic;
using System.Threading;
using nj4x.Metatrader;
using NUnit.Framework;
namespace nj4x.Appliance.Tests
{
public class Account : IDisposable
{
//
// example of com.nj4x.ext.mw.rpc.get_rates_by_date/by_dates RPC
//
(function (brokerId, symbolId) {
toDate = function (date) {
//‌2015-11-08T23:00:00
//0123456789012345678
var day = parseInt(date.slice(8, 10)),
month = parseInt(date.slice(5, 7)) - 1,
year = parseInt(date.slice(0, 4)),
@nj4x
nj4x / ZooKeeperNetExTest.cs
Created January 28, 2016 10:48
Endless ZooKeeper reconnection for sessionTimeout parameter below 1000
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading.Tasks;
using org.apache.zookeeper;
namespace ZooKeeperNetExTest
{
internal class Program
{
@nj4x
nj4x / Double lock
Created January 27, 2016 14:34
ZooKeeperNetEx.Recipes WriteLock allows multiple clients to obtain lock to the same dir simultaneously
using System;
using System.Threading.Tasks;
using org.apache.zookeeper;
using org.apache.zookeeper.recipes.@lock;
namespace ZooKeeperNetExTest
{
internal class Program
{
private static void Main(string[] args)