Skip to content

Instantly share code, notes, and snippets.

ERROR [2017-12-26 19:49:03,004] com.coinmx.strategy.StrategyExecutor: Error while running strategy
! org.knowm.xchange.binance.dto.BinanceException: -1021: Timestamp for this request was 1000ms ahead of the server's time.
! at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
! at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
! at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
! at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
! at com.fasterxml.jackson.databind.introspect.AnnotatedConstructor.call(AnnotatedConstructor.java:124)
! at com.fasterxml.jackson.databind.deser.std.StdValueInstantiator.createFromObjectWith(StdValueInstantiator.java:274)
! at com.fasterxml.jackson.databind.deser.ValueInstantiator.createFromObjectWith(ValueInstantiator.java:228)
! at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:189)
WARN [2017-12-26 19:48:52,633] org.knowm.xchange.binance.BinanceExchange: An exception occurred while loading the metadata
! java.lang.NullPointerException: null
! at org.knowm.xchange.binance.BinanceExchange.remoteInit(BinanceExchange.java:61)
! at org.knowm.xchange.BaseExchange.applySpecification(BaseExchange.java:111)
! at org.knowm.xchange.ExchangeFactory.createExchange(ExchangeFactory.java:134)
! at com.coinmx.CoinMXApplication.createExchange(CoinMXApplication.java:72)
! at com.coinmx.CoinMXApplication.createOrderManager(CoinMXApplication.java:60)
! at com.coinmx.CoinMXApplication.createStrategyExecutor(CoinMXApplication.java:53)
! at com.coinmx.CoinMXApplication.run(CoinMXApplication.java:47)
! at com.coinmx.CoinMXApplication.run(CoinMXApplication.java:25)
/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java -Didea.launcher.port=7533 "-Didea.launcher.bin.path=/Applications/IntelliJ IDEA 13 CE/IntelliJ IDEA 13 CE.app/bin" -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/jav
int dad[10000]; // super parent of each node
//union-find, path compression
int find(int x)
{
return x == dad[x] ? x : dad[x] = find(dad[x]);
}
void unite(int x, int y)
{
#include <iostream>
#include <cmath>
#include <cstring>
#include <map>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
#include <iostream>
#include <cmath>
#include <cstring>
#include <map>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int a[(1 << 17) + 1];
int t[(1 << 17) + 1][18];
// binary function
int f(int a, int b)
{
return a + b;
}
// init segment tree
@ogzd
ogzd / v1.cpp
Last active August 29, 2015 14:10
int bs(int* arr, int l, int r, int v)
{
if(l >= r) return -1;
int m = l + (r - l) / 2;
if(arr[m] > v)
{
return bs(arr, l, m, v);
}
if(arr[m] < v)
{
@ogzd
ogzd / recursion.java
Last active August 29, 2015 14:01
How to teach recursion to a 5 years-old
void climbStair()
{
printf("Climbed a stair!");
}
void climbStairs(int stairs)
{
if(stairs > 0)
{
climbStair();
@ogzd
ogzd / A.java
Created April 15, 2014 20:11
How to write a singleton class
public class A {
private static A a;
// disable new operator
private A() {}
// thread-safe
public static synchronized A get() {