This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.6.0; | |
contract SwapCheck { | |
function implementation1_0(uint256 x, uint256 y) public returns(uint256 xx, uint256 yy) { | |
// transaction cost: 22236 gas | |
// execution: 580 gas | |
assembly { |
This file contains hidden or 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
set _comment "define constants" | |
set maxASize 10 | |
op mul maxASizeX2 maxASize 2 | |
set m 7 | |
set n 3 | |
set _comment "def aGetIndex" | |
op add aGetIndexLine @counter 1 | |
op add @counter @counter maxASizeX2 | |
set aGetResult a0 | |
set @counter aGetIndexCaller |
This file contains hidden or 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
sudo snap install chromium | |
sudo snap install sublime-text --classic | |
sudo snap install pycharm-professional --classic | |
sudo snap install skype --classic | |
sudo snap install zoom-client | |
sudo snap install slack --classic | |
sudo apt install -y htop iotop build-essential python3-pip git curl | |
echo "deb http://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" | sudo tee -a /etc/apt/sources.list |
This file contains hidden or 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
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This file contains hidden or 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
apm-server: | |
image: docker.elastic.co/apm/apm-server:6.7.1 | |
# image: docker.elastic.co/apm/apm-server:6.5.3 | |
command: -strict.perms=false | |
volumes: | |
- /etc/localtime:/etc/localtime:ro | |
- ./apm/apm-server.yml:/usr/share/apm-server/apm-server.yml | |
depends_on: | |
- es-tunnel | |
logging: |
This file contains hidden or 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
time.mktime(datetime.strptime('2019-01-07 09:43:20,158', '%Y-%m-%d %H:%M:%S,%f').timetuple()) |
This file contains hidden or 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 random | |
N_EXPERIMENTS = 10000 | |
N_SWIPES = 250 | |
A_REAL_RATE = 66 / 250 | |
B_REAL_RATE = 70 / 250 | |
def experiment(): | |
""" observable rate for A and B """ |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
254'), 'token': None, 'aggregatedCap': Decimal('1'), 'timestamp': 1542383692233} | |
2018-11-16 16:54:55,699 - theo_calculator.py:263 - INFO - found_eff_vol=60000.00000000000000000000000 | |
2018-11-16 16:54:55,699 - theo_calculator.py:266 - INFO - total_eff_vol_for_theo=53.54822760785947532988284620 | |
2018-11-16 16:54:55,699 - theo_calculator.py:268 - INFO - total_vol_for_theo=0.009672938653992030036925841023 | |
2018-11-16 16:54:55,699 - theo_calculator.py:276 - INFO - calculate_theo: processed 7 trades (found_eff_vol=60000.00000000000000000000000 >= eff_max_vol=60000) | |
2018-11-16 16:54:55,699 - theo_calculator.py:290 - INFO - Trade theo=5535.879997105127519920974511, total_eff_vol_for_theo=53.54822760785947532988284620, total_vol_for_theo=0.009672938653992030036925841023 | |
update theo in 0.0041997432708740234sec | |
2018-11-16 16:54:55,997 - run.py:77 - INFO - get 1 trades for gemini {'since': 1542383681457, 'limit': 500} | |
2018-11-16 16:54:55,997 - run.py:79 - INFO - trades[0]: {'id': '4817350539', 'order': None, 'info': {'time |
This file contains hidden or 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 socket | |
import logging | |
from contextlib import closing | |
import datetime | |
from sshtunnel import SSHTunnelForwarder | |
from cmreslogging.handlers import CMRESHandler | |
logger = logging.getLogger(__name__) |
This file contains hidden or 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 sys | |
import logging | |
logger = logging.getLogger() | |
logger.setLevel(logging.DEBUG) | |
sh = logging.StreamHandler() | |
sh.setLevel(logging.DEBUG) | |
logger.addHandler(sh) |