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 flask import Flask | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import sessionmaker | |
import time | |
app = Flask(__name__) | |
engine = create_engine('mysql+pymysql://root:22380476@localhost/pool?charset=UTF8MB4', pool_recycle=300) | |
SessionMaker = sessionmaker(bind=engine) | |
engine.execute('SELECT NOW();') |
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 localProperties = new Properties() | |
def localPropertiesFile = rootProject.file('local.properties') | |
if (localPropertiesFile.exists()) { | |
localPropertiesFile.withReader('UTF-8') { reader -> | |
localProperties.load(reader) | |
} | |
} | |
def flutterRoot = localProperties.getProperty('flutter.sdk') | |
if (flutterRoot == null) { |
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
apiVersion: kibana.k8s.elastic.co/v1 | |
kind: Kibana | |
metadata: | |
name: quickstart | |
spec: | |
version: 7.6.2 | |
podTemplate: | |
spec: | |
containers: | |
- name: kibana |
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
apiVersion: elasticsearch.k8s.elastic.co/v1 | |
kind: Elasticsearch | |
metadata: | |
name: quickstart | |
spec: | |
version: 7.6.2 | |
nodeSets: | |
- name: default | |
count: 1 | |
config: |
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 winsound | |
import time | |
winsound.Beep(293, 200) # D | |
winsound.Beep(293, 200) # D | |
winsound.Beep(293, 200) # D | |
winsound.Beep(293, 600) # D | |
winsound.Beep(246, 600) # B | |
time.sleep(0.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
class G: | |
pending = set() | |
bombed = 0 | |
board = [] | |
def bomb(): | |
for i, j in reversed(sorted(G.pending)): | |
G.board[i].pop(j) | |
G.bombed += 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
#!/usr/bin/env python | |
import flask | |
from flask import request, jsonify | |
from os import path, environ | |
from raven.contrib.flask import Sentry | |
import cv2 | |
import numpy as np | |
import requests |
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 sys , os | |
sys.path.append(os.pardir) | |
from dataset.mnist import load_mnist | |
from common.functions import sigmoid, softmax, np | |
def get_data(): | |
(x_train, t_train), (x_test, t_test)=\ | |
load_mnist(normalize=True, flatten=True, one_hot_label=True) | |
return x_train, t_train |
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 solution(t, l = []): | |
if not t: # 탈출 조건. 삼각형을 전부 소모한다. | |
return max(l) | |
result = [] | |
for x, y, z in zip([0]+l, l+[0], t[0]): # [0] + l = 0 더하기 리스트 | |
# zip 은 리스트를 n 개 받아서 각 리스트 마다 foreach 를 돌아줘요 | |
# for a, b, c in zip(A, B, C) 이면 a 는 A의 요소, b 는 B의 요소, c 는 C의 요소 | |
result.append(max(x, y) + z) # result 에 하나씩 더함 |
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
# 종만북에서 풀었던 문제. 삼각형 모양만 다르다. | |
# cache[i][j] 보다 f 스트링을 사용한 1중 dict 가 훨씬 빠르다. | |
# 이게 반복으로 풀 수 있는 문제인가? | |
cache = {} | |
def move(triangle, i, j): | |
''' | |
현재 위치에서 내려갔을 떄 얻을 수 있는 최댓값을 반환합니다. |