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
FROM golang:alpine3.9 | |
RUN apk add git | |
RUN go get github.com/mholt/caddy/caddy && \ | |
go get github.com/caddyserver/builds | |
WORKDIR /go/src/github.com/mholt/caddy/caddy | |
RUN \ | |
go get github.com/caddyserver/dnsproviders/digitalocean && \ | |
go get github.com/nicolasazrak/caddy-cache && \ | |
go get github.com/captncraig/cors && \ | |
go get github.com/miekg/caddy-prometheus && \ |
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
def __mix(back, front, alpha): | |
result = 0 | |
result += round(front * (alpha / 255)) | |
result += round(back * ((255-alpha) / 255)) | |
return result | |
colordic = {} | |
for f in range(256): | |
for a in range(256): |
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
def fact(n): | |
if(n <= 1): | |
return 1 | |
else: | |
return n*fact(n-1) | |
def GeneratePermutation(n, k, i): | |
numberSet = range(1, n+1) | |
permutation = [] | |
elementsLeft = n |
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 threading | |
class MapThread(threading.Thread): | |
def initialize(self, function, sequence, *args): | |
self._function = function | |
self._sequence = sequence | |
self._args = args | |
def run(self): | |
self._result = map(self._function, self._sequence, *self._args) |