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
<link rel="import" href="../chart-js/chart-js.html"> | |
<link rel="import" href="../google-map/google-map.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; |
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
1. `Win` + `R` 키나 `시작` > `실행` 버튼을 눌러 `cmd` 를 입력합니다. | |
2. 실행된 창에 `cd <프로젝트 디렉토리>` 를 입력하고 엔터를 입력합니다. | |
- (e.g. `C:\Users\Student1\포트폴리오` 가 프로젝트 디렉토리인 경우 `cd C:\Users\Student1\포트폴리오`) | |
- 프로젝트 디렉토리는 `app.py` 와 `template` 등의 디렉토리가 보이는 디렉토리를 말합니다. | |
3. `python app.py` 를 입력하고 엔터를 입력합니다. | |
- 이 때 `내부 또는 외부 명령, 실행할 수 있는 프로그램, 또는 배치파일이 아닙니다.` 라는 메시지가 뜨면 python 을 설치해야합니다. | |
4. 웹 브라우저를 열어 `http://localhost:5000` 을 입력합니다. |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
span.done { | |
text-decoration: line-through; | |
} | |
</style> | |
</head> | |
<body> |
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 Car: | |
def __init__(self, type): | |
self.type = type | |
class License: | |
def __init__(self, driver_name): | |
self.driver_name = driver_name | |
def print(self): | |
print("{}의 {}종 면허입니다.".format(self.driver_name, self.LICENSE_TYPE)) |
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
(defn split [seq delimiter] | |
(letfn [(check-non-delimiter [val] (not (= val delimiter)))] | |
(cond | |
(empty? seq) | |
seq | |
(every? check-non-delimiter seq) | |
(list seq) | |
:default | |
(cons | |
(take-while check-non-delimiter seq) |
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 deque, Iterable | |
def flatten(l): | |
""" | |
>>> [i for i in flatten([1, [2,3], [5, [6,7]]])] | |
[1, 2, 3, 5, 6, 7] | |
""" | |
queue = deque(l) | |
while len(queue) > 0: | |
p = queue.popleft() |
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 wraps | |
def __extend_keys(l): | |
ret = [[]] | |
for p in l: | |
for r in list(ret): | |
if isinstance(p, list): | |
ret.remove(r) | |
for e in p: | |
nr = list(r) |
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
TAG_TYPES = ["location", "category"] | |
class Tag(db.Model, BaseEntityMixIn, | |
IgnoreDeletionMixIn): | |
__tablename__ = "tag" | |
name = db.Column(db.Unicode(255), index=True) | |
type = db.Column(db.Enum(*TAG_TYPES, native_enum=False), index=True) | |
__mapper_args__ = {'polymorphic_on': type} | |
g = globals() |
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
""" | |
http://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm | |
""" | |
def kmp_make_table(word): | |
table = len(word) * [0] | |
pos = 2 | |
cnd = 0 | |
table[0] = -1 | |
table[1] = 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
def app(environ, start_response): | |
response_body = 'Hello World!' | |
status = '200 OK' | |
response_headers = [('Content-Type', 'text/plain'), | |
('Content-Length', str(len(response_body)))] | |
start_response(status, response_headers) | |
return [response_body] |
OlderNewer