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 math import log | |
from array import array | |
from struct import unpack | |
from hashlib import sha512 | |
class Bits: | |
__slots__ = ('data',) | |
def __init__(self, cap): |
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
[Unit] | |
Description=gunicorn daemon | |
After=network.target | |
[Service] | |
User=sammy | |
Group=www-data | |
WorkingDirectory=/home/sammy/myproject | |
ExecStart=/home/sammy/myproject/myprojectenv/bin/gunicorn --workers 3 --bind unix:/home/sammy/myproject/myproject.sock myproject.wsgi:application |
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
# coding: utf-8 | |
# requirements: | |
# requests | |
# beautifulsoup4 | |
# flask | |
# html5lib | |
import re | |
import webbrowser |
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
def calculate_volume(relief): | |
left_max = 0 | |
right_max = 0 | |
left = 0 | |
right = len(relief) - 1 | |
volume = 0 | |
while left < right: | |
if relief[left] > left_max: | |
left_max = relief[left] |
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 Matrix(object): | |
data = None | |
def __init__(self, data): | |
self.data = data | |
self.columns = len(self.data) | |
self.rows = len(self.data[0]) | |
def get(self, t): | |
return self.data[t[0]][t[1]] |
NewerOlder