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
# https://school.programmers.co.kr/learn/courses/30/lessons/118668#qna | |
import math | |
def solution(alp, cop, problems): | |
# 필요 능력 구하기 | |
alp_max = 0 | |
cop_max = 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
//https://gist.github.com/andrew8088/6f53af9579266d5c62c8 | |
function stringify2(obj){ | |
var result = []; | |
var k | |
for(k in obj){ | |
if(typeof obj[k] === 'object'){ | |
result.push('"' + k + '":' + stringify2(obj[k])); |
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 datetime | |
datetime.datetime.today() | |
# datetime.datetime(2021, 7, 20, 17, 48, 37, 529267) | |
datetime.datetime(2021, 9, 3) - datetime.timedelta(days=30) | |
# datetime.datetime(2021, 8, 4, 0, 0) | |
datetime.datetime.today() - datetime.datetime(2021, 9, 3) | |
# datetime.timedelta(days=-45, seconds=64206, microseconds=234744) |
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
# encode from binary file to base64txt | |
$outpath = (Join-Path (pwd) 'out_base64.txt'); | |
$inpath = (Join-Path (pwd) 'data.jpg'); | |
[IO.File]::WriteAllText($outpath, ([convert]::ToBase64String(([IO.File]::ReadAllBytes($inpath))))) | |
# decode from base64txt to binary file | |
$outpath = (Join-Path (pwd) 'outdata2.jpg'); | |
$inpath = (Join-Path (pwd) 'out_base64.txt'); | |
[IO.File]::WriteAllBytes($outpath, ([convert]::FromBase64String(([IO.File]::ReadAllText($inpath))))) |
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 os | |
import glob | |
for l in glob.glob('*.webm'): | |
fname, ext = os.path.splitext(l.strip()) | |
cli = f'ffmpeg -i "{l}" "{fname}.mp4"' | |
os.system(cli) |
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
function makeHashCount( arr ){ | |
const m = new Map(); | |
arr.forEach( k => { | |
m.set(k, (m.get(k)||0) + 1 ); | |
}) | |
return m; | |
} |
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
a = "daejin dae aaa" | |
import re | |
re.split(' +', a) | |
['daejin', 'dae', 'aaa'] | |
b = "daejin aaa # daejidna;kdj" | |
re.sub('#.*$', '', b) | |
'daejin aaa ' |
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 glob | |
import os | |
l = glob.glob('*.jpg') | |
for nm in l : | |
print(nm[:26], '{:04d}'.format(int(nm[26:-4])), '.jpg') | |
os.rename(nm, nm[:26]+'{:04d}'.format(int(nm[26:-4]))+'.jpg') |
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
# pip install youtube-dl | |
# 해서 youtube-dl 설치하시고 | |
#import subprocess | |
#def dn(i): | |
# u = r'https://www.youtube.com/watch?v=UOunv9V14cA&list=PLZPhyNeJvHRmnMr5yucZ9Eu-yVhjRRsOM&index=' | |
# subprocess.call('youtube-dl ' + u+str(i)) | |
#[ dn(x) for x in range(1,73)] |
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
일단 인터넷이 되는 곳 | |
mkdir openpyxl & cd openpyxl | |
pip download openpyxl | |
해당 폴더에 아래와 같은 압축파일 몇개가 생긴다. | |
et_xmlfile-1.0.1.tar.gz | |
jdcal-1.4-py2.py3-none-any.whl |
NewerOlder