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 ubuntu:16.04 | |
RUN sed -i '[email protected]@kr.archive.ubuntu.com@g' /etc/apt/sources.list |
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
#include <stdio.h> | |
#include <signal.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
static void sig_usr(int); |
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
sudo wget https://raw.githubusercontent.com/notro/rpi-source/master/rpi-source -O /usr/bin/rpi-source && sudo chmod +x /usr/bin/rpi-source && /usr/bin/rpi-source -q --tag-update | |
# check required gcc version | |
cat /proc/version | |
# install gcc 4.9 | |
sudo apt update -y | |
sudo apt-get install gcc-4.9 g++-4.9 -y | |
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 50 |
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
# For more information on configuration, see: | |
# * Official English Documentation: http://nginx.org/en/docs/ | |
# * Official Russian Documentation: http://nginx.org/ru/docs/ | |
user ec2-user; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log; | |
pid /run/nginx.pid; | |
# Load dynamic modules. See /usr/share/nginx/README.dynamic. |
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 gevent import monkey | |
monkey.patch_all() | |
import gevent | |
from gevent.pool import Pool | |
from gevent.lock import Semaphore | |
import time | |
from urllib.request import urlopen | |
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 asyncio | |
import random | |
import logging | |
import aiohttp | |
import tenacity | |
logging.basicConfig(level=logging.DEBUG) | |
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 functools import lru_cache | |
@lru_cache(maxsize=None) # caching all them, do not discard cache | |
def fibonacci_dynamic_recursive(n): | |
if n == 0 or n == 1: | |
return n | |
return fibonacci_dynamic_recursive(n - 1) + fibonacci_dynamic_recursive(n - 2) |
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 collections import Counter, defaultdict | |
def solution(genres, plays): | |
song_limit = 2 | |
answer = [] | |
songs = defaultdict(dict) | |
_genre_counter_dict = defaultdict(int) |
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 decrypt(row, size): | |
mask = 1 << (size - 1) | |
while mask: | |
yield '#' if (row & mask) else ' ' | |
mask = mask >> 1 | |
def solution(n, arr1, arr2): | |
answer = [] | |
for row in (a|b for a, b in zip(arr1, arr2)): | |
answer.append(''.join(decrypt(row, n))) |
OlderNewer