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 time | |
from functools import wraps | |
def timeit(f): | |
@wraps(f) | |
def inner(*x, **y): | |
a = time.monotonic() | |
r = f(*x, **y) | |
b = time.monotonic() |
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 io | |
import pickle | |
import random | |
import time | |
from multiprocessing import Process | |
import zmq | |
def pub_main(port=7777): |
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
// vi: filetype=objc | |
#import <Foundation/Foundation.h> | |
NSDictionary<NSNumber*,NSNumber*> * makeTransformer(); | |
NSString* choseongWithString(NSString* text); | |
NSDictionary<NSNumber*,NSNumber*> * makeTransformer() | |
{ |
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
// | |
// hangulSound.h | |
// firstcode | |
// | |
// Created by sooop on 12. 1. 31.. | |
// Copyright (c) 2012년 soooprmx.com All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
COLORS = dict(zip(range(1, 10), 'black red green yellow blue magenta' | |
' cyan white reset'.split())) | |
class BG: | |
black = '\033[40m' | |
red = '\033[41m' | |
green = '\033[42m' | |
yellow = '\033[43m' | |
blue = '\033[44m' |
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
// | |
// ViewController.swift | |
// DragTable | |
// | |
// Created by Anna Kim on 2017. 2. 9.. | |
// Copyright © 2017년 Anna Kim. All rights reserved. | |
// | |
import Cocoa |
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 Vertex { | |
constructor(value, order, matrix) { | |
this.value = value; | |
this.order = order; | |
this.availableNumbers = []; | |
this.color = (value !== 0) ? "black" : "white"; | |
} | |
reset() { | |
this.color = "white"; |
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 | |
import sqlite3 | |
import time | |
# 데이터베이스 연결 생성 | |
# 존재하지 않는 파일이라고 가정. 새 파일을 생성함 | |
db_filename = 'test.db' | |
conn = sqlite3.connect(db_filename) | |
# 테이블 제거, 생성 |
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
@echo off | |
@setlocal | |
@set start_time="0:0" | |
@set filters="fps=20,scale=320:-1:flags=lanczos" | |
@set palette="__palette.png" | |
@ffmpeg -v warning -ss %start_time% -i %1 ^ | |
-vf "%filters%,palettegen"^ | |
-y %palette% | |
@ffmpeg -v warning -ss %start_time% -i %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
/* | |
모나드는 특정한 타입을 감싸는 타입이며, | |
raw한 값을 감싸는 함수와 | |
raw한 값을 모나드 값으로 바꾸는 어떤 함수에 바인딩된다. | |
이를 바탕으로 모나드 프로토콜을 정의하면 다음과 같다. | |
*/ | |
protocol Monad { |