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
pragma solidity ^0.5.2; | |
contract TaiwanConsensusBuilder { | |
address public contractOwner; | |
//================================== | |
// Modifiers (Safety Checks) | |
//================================== | |
modifier ownerOnly { |
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
import numpy as np | |
import pandas as pd | |
from numpy import abs | |
from numpy import log | |
from numpy import sign | |
from scipy.stats import rankdata | |
# region Auxiliary functions | |
def ts_sum(df, window=10): | |
""" |
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
import pandas as pd | |
import numpy as np | |
from scipy import stats | |
def make_factors(): | |
# (rank(Ts_ArgMax(SignedPower(((returns < 0) ? stddev(returns, 20) : close), 2.), 5)) - 0.5) | |
class Alpha1(CustomFactor): | |
inputs = [USEquityPricing.close, Returns(window_length=2)] |
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 scipy.stats import rankdata | |
import scipy as sp | |
import numpy as np | |
import pandas as pd | |
class GTJA_191: | |
def __init__(self, end_date, index): | |
security = get_index_stocks(index) |
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
static void Main(string[] args) | |
{ | |
// getMostVisited(10, new List<int>() { 1, 5 ,10,3}); | |
longestPalindrome(7, "bandana"); | |
} | |
public static int getMostVisited(int n, List<int> sprints) | |
{ | |
int ret = -1; | |
if (sprints.Count < 1) | |
return ret; |
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
import asyncio | |
import aiohttp | |
async def get_html(session, url): | |
async with session.get(url) as res: | |
return await res.text() | |
async def main(): | |
urls = [ | |
'http://python.org', |
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
# asyncq.py | |
import asyncio | |
import itertools as it | |
import os | |
import random | |
import time | |
async def makeitem(size: int = 5) -> str: | |
return os.urandom(size).hex() |
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
// Created by Chih.Lun.Kang | |
// 網路上找的範例大部分都不能用,後來嘗試數次只有這方法可行 | |
// 主網的appid => 539ab33xxxx,要去Infura申請,在上面建立一個project | |
// #### NOTE #### : 要特別注意本身轉帳的帳號要儲備足夠數量的 eth 跟 btc | |
// #### 注意 #### : 目前使用人工轉換儲值手續費,建議在幣價好的時候一次換匯才划算 | |
const USDTJSON = require('./build/contracts/USDT.json') | |
const Web3 = require('web3') | |
const Tx = require('ethereumjs-tx').Transaction |
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
import ccxt | |
import pandas as pd | |
import time | |
pd.set_option('expand_frame_repr', False) | |
def main(): | |
""" | |
主函数 |
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
const okex_api = require('../../libs/okex-api') | |
const constant = require('../../libs/constants') | |
const request = require('request') | |
const numgrid = 100 | |
var marketinfo = {} | |
const fetch_market_info = async () => { | |
let _mkt = await okex_api.fetch_perp_symbols(mode='all') | |
_mkt.forEach((inst) => { | |
marketinfo[inst.instrument_id] = inst |
OlderNewer