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
class Production: | |
def call_one(self, arg1, arg2): | |
return arg1 + arg2 | |
def call_two(self, arg1, arg2, arg3): | |
return self.call_one(str(arg1), str(arg2) + str(arg3)) |
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
$ make | |
centos-7 -> FROM centos:7 | |
coreos -> FROM jess/coreos | |
debian-jessie -> FROM debian:jessie | |
fedora-23 -> FROM fedora:23 | |
ubuntu-xenial -> FROM ubuntu:xenial | |
+ Building the centos-7 base image | |
Sending build context to Docker daemon 3.072kB | |
Step 1/2 : FROM centos:7 | |
---> 8140d0c64310 |
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 socket | |
import threading | |
class ThreadedServer(object): | |
def __init__(self, host, port): | |
self.host = host | |
self.port = port | |
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) |
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 | |
total = 1052 | |
k = 10 | |
indices = np.arange(total) | |
np.random.shuffle(indices) | |
indices = indices.tolist() | |
start = 0 |
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 itertools import permutations | |
def diff(a, b): | |
return abs(a - b) - 1 | |
def all_different(indices): | |
first, second, third, fourth, fifth = indices | |
size = len({diff(first, second), diff(first, third), diff(first, fourth), diff(first, fifth), |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
pushd /tmp | |
echo "Installing Python" | |
curl -O https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz | |
tar xvf Python-3.6.0.tgz | |
cd Python-3.6.0 | |
./configure --prefix=$HOME/python36 | |
make && make install | |
popd | |
pushd /tmp |
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 re | |
RE_PATTERNS= re.compile(r"^#(\d+)|^Issue\s#(\d+)|^Issue#(\d+)", flags=re.MULTILINE | re.IGNORECASE) | |
test_messages = [ | |
"""#123""", | |
"""Issue #123""", | |
"""Issue#123""" | |
] |