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
#! /usr/bin/python3 | |
import random | |
def luhn_residue(digits): | |
return sum(sum(divmod(int(d)*(1 + i%2), 10)) | |
for i, d in enumerate(digits[::-1])) % 10 | |
def get_valid_luhn(N, preamble = ""): | |
part = preamble+''.join(str(random.randrange(0,9)) for _ in range(N-1-len(preamble))) | |
res = luhn_residue('{}{}'.format(part, 0)) |
This file has been truncated, but you can view the full file.
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
{'message': 'when are you going to lift the no trade on sia', 'username': 'Taniwha', 'time': 1496044046, 'reputation': 0} | |
{'message': 'guys just buy stratis', 'username': 'Konbro', 'time': 1496044046, 'reputation': 0} | |
{'message': 'DocNuance, hiiiii o/', 'username': 'Thehobbitwith9fingers', 'time': 1496044046, 'reputation': 315} | |
{'message': 'how come all cryptos are going down? its been like this for 3 days', 'username': 'nickleijenhorst', 'time': 1496044046, 'reputation': 0} | |
{'message': 'is there a reason bits is down?', 'username': 'nucleartrashout', 'time': 1496044049, 'reputation': 31} | |
{'message': 'Ban him. Mod spam', 'username': 'gamegrounds', 'time': 1496044053, 'reputation': 7} | |
{'message': 'Hotmetal, but not that slow. From what I gather, API users are able to push trades faster than we on the UI here', 'username': 'dlight_2016', 'time': 1496044059, 'reputation': 28} | |
{'message': 'd', 'username': 'Xinord', 'time': 1496044059, 'reputation': 31} | |
{'message': 'nickleijenhorst, what goes up comes down. easy |
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 sockschain | |
import urllib2 | |
import time | |
import random | |
import re | |
import json | |
import requests | |
import pyping | |
import multiprocessing | |
import atexit |
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
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
## add comments by weixsong | |
## reference page [The Unreasonable Effectiveness of Recurrent Neural Networks](http://karpathy.github.io/2015/05/21/rnn-effectiveness/) | |
## this is a 3 layers neuron network. | |
## input layer: one hot vector, dim: vocab * 1 |
This file has been truncated, but you can view the full file.
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
|
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 concurrent.futures | |
async def async_wrapper(loop, functional, args=(None)): | |
with concurrent.futures.ThreadPoolExecutor() as executor: | |
return await loop.run_in_executor(executor, functional, args) | |
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 time import time | |
import socket | |
import fcntl | |
import struct | |
import urllib.request, urllib.error, urllib.parse | |
import re | |
import json | |
ip_sources = ['https://wtfismyip.com/json', 'https://canhazip.com/', 'https://icanhazip.com', 'https://vyncke.org/ip.php', 'https://www.dan.me.uk/ipinfo', 'https://ipinfo.me/', 'https://my-ip.herokuapp.com/', 'https://httpbin.org/ip', 'https://onlinebanking.tdbank.com/'] |
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
Nuitka:DEBUG:print.py:1 : new_expression : Using original '__file__' value. | |
Nuitka:DEBUG:print.py:5 : new_builtin_ref : Module variable 'print' found to be built-in reference. | |
Nuitka:DEBUG:print.py:6 : new_builtin_ref : Module variable 'print' found to be built-in reference. | |
Nuitka:DEBUG:print.py:7 : new_builtin_ref : Module variable 'print' found to be built-in reference. | |
Nuitka:DEBUG:print.py:8 : new_builtin_ref : Module variable 'print' found to be built-in reference. | |
Nuitka:DEBUG:print.py:9 : new_builtin_ref : Module variable 'print' found to be built-in reference. | |
Nuitka:DEBUG:print.py:10 : new_builtin_ref : Module variable 'print' found to be built-in reference. | |
Nuitka:DEBUG:print.py:12 : new_constant : Replaced read-only module attribute '__name__' with constant value. | |
Nuitka:DEBUG:print.py:12 : new_constant : Comparison of constant arguments. Predicted constant result. | |
Nuitka:DEBUG:print.py:13 : new_builtin_ref : Module variable 'range' found to be built-in reference. |
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
try: | |
from elftools.elf.elffile import ELFFile | |
except: | |
ELFFile = None | |
if ELFFile is not None: | |
import sys | |
elf_file=open(sys.argv[1], 'rb') | |
machine = ELFFile(elf_file).get_machine_arch().lower() | |
print(machine) |
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 ctypes | |
import re | |
import sys | |
import glob | |
import os | |
c_ptrace = ctypes.CDLL(None).ptrace | |
c_pid_t = ctypes.c_int32 | |
c_ptrace.argtypes = [ctypes.c_int, c_pid_t, ctypes.c_void_p, ctypes.c_void_p] |