Skip to content

Instantly share code, notes, and snippets.

View lseongjoo's full-sized avatar

Lee Seongjoo lseongjoo

  • CodeBasic
  • Seoul, Korea
View GitHub Profile
@lseongjoo
lseongjoo / bigpy-2015-07-19.py
Last active August 29, 2015 14:25
์›น API ์š”์ฒญ ์งˆ๋ฌธ ๊ด€๋ จ (2015-07-19)
# coding: utf-8
"""
https://www.facebook.com/bigpython
"""
import requests
response = requests.get('http://api.openhangul.com/dic', {'api_key':20141107174448, 'q':u'์ข‹๋‹ค'})
# content-length
cLen = response.headers['Content-Length']
# Get the content of the HTTP response
@lseongjoo
lseongjoo / console_arg_to_unicode.py
Created August 18, 2015 09:41
์ฝ˜์†”์˜ ์ธ์ฝ”๋”ฉ ์ •๋ณด๋ฅผ ํ™œ์šฉํ•ด ๋ช…๋ น์ค„ ์ธ์ž๋ฅผ ์œ ๋‹ˆ์ฝ”๋“œ๋กœ ๋ณ€ํ™˜ํ•˜๊ธฐ
# coding: utf-8
# @LeeSeongjoo
import sys
if __name__ == '__main__':
# ๋ช…๋ น์ค„ ์ธ์ž๋ฅผ ์œ ๋‹ˆ์ฝ”๋“œ๋กœ ๋ณ€ํ™˜
uargv = [arg.decode(sys.stdin.encoding) for arg in sys.argv[1:]]
print(uargv)
# coding: utf-8
"""
์ฃผ์‹  ์งˆ๋ฌธ์— ๋Œ€ํ•œ ํ•ด๊ฒฐ์ฑ…์„ ์ œ์•ˆํ•ฉ๋‹ˆ๋‹ค.
๋น…ํŒŒ์ด: ๋น…๋ฐ์ดํ„ฐ๋ฅผ ์œ„ํ•œ ํŒŒ์ด์ฌ
www.facebook.com/bigpython
"""
import pandas as pd
from pandas import Series, DataFrame
@lseongjoo
lseongjoo / archive.py
Last active March 7, 2016 23:44
ํŒŒ์ด์ฌ ํŒŒ์ผ ์••์ถ•
# coding: utf-8
"""
๋น…ํŒŒ์ด, ๋น…๋ฐ์ดํ„ฐ๋ฅผ ์œ„ํ•œ ํŒŒ์ด์ฌ
facebook.com/bigpython
์ด์„ฑ์ฃผ [email protected]
>>> print('ํ…Œ์ŠคํŠธ1', file=open('ํ…Œ์ŠคํŠธ1.txt', 'w'))
>>> print('ํ…Œ์ŠคํŠธ2', file=open('ํ…Œ์ŠคํŠธ2.txt', 'w'))
>>> ํŒŒ์ผ๋ชฉ๋ก = ['ํ…Œ์ŠคํŠธ1.txt', 'ํ…Œ์ŠคํŠธ2.txt']
>>> export_to_zip('test.zip', ํŒŒ์ผ๋ชฉ๋ก)
@lseongjoo
lseongjoo / imagenet1000_clsid_to_human.txt
Created December 13, 2017 12:54 — forked from yrevar/imagenet1000_clsidx_to_labels.txt
text: imagenet 1000 class id to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@lseongjoo
lseongjoo / coro_life.py
Created June 7, 2018 05:34 — forked from ramalho/coro_life.py
John Conway's Game of Life implemented with coroutines, by Brett Slatkin
#!/usr/bin/env python3
# Copyright 2014 Brett Slatkin, Pearson Education Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#

ํ•œ๊ธ€๊ณผ ์œ ๋‹ˆ์ฝ”๋“œ

์œ ๋‹ˆ์ฝ”๋“œ์—์„œ ํ•œ๊ธ€์„ ์–ด๋–ป๊ฒŒ ๋‹ค๋ฃจ๋Š”์ง€๋ฅผ ์ •๋ฆฌํ•˜์˜€๋‹ค.

์œ ๋‹ˆ์ฝ”๋“œ

  • ์œ ๋‹ˆ์ฝ”๋“œ(Unicode)๋Š” ์ „ ์„ธ๊ณ„์˜ ๋ชจ๋“  ๋ฌธ์ž๋ฅผ ์ปดํ“จํ„ฐ์—์„œ ์ผ๊ด€๋˜๊ฒŒ ํ‘œํ˜„ํ•˜๊ณ  ๋‹ค๋ฃฐ ์ˆ˜ ์žˆ๋„๋ก ์„ค๊ณ„๋œ ์‚ฐ์—… ํ‘œ์ค€ (์œ„ํ‚ค ๋ฐฑ๊ณผ)
  • ๋‹จ์ˆœํžˆ ๋ฌธ์ž๋งˆ๋‹ค ๋ฒˆํ˜ธ๋ฅผ ๋ถ™์ž„
  • ๊ณ„์† ์—…๋ฐ์ดํŠธ๋˜๋ฉฐ ํ˜„์žฌ๋Š” Unicode Version 9.0.0 ์ด ์ตœ์‹ ์ด๋‹ค.

UTF

  • ์œ ๋‹ˆ์ฝ”๋“œ๋ฅผ ์‹ค์ œ ํŒŒ์ผ ๋“ฑ์— ์–ด๋–ป๊ฒŒ ๊ธฐ๋กํ•  ๊ฒƒ์ธ์ง€๋ฅผ ํ‘œ์ค€ํ™”ํ•œ ๊ฒƒ์ด๋‹ค.
@lseongjoo
lseongjoo / pydeep.md
Last active March 14, 2023 01:12
๋”ฅ๋Ÿฌ๋‹ ํ™˜๊ฒฝ ์„ค์ •

Codebasic (c) 2023

๋‹ค์Œ ๋ฌธ์„œ๋Š” ์•„๋ž˜ ํ”Œ๋žซํผ๋ณ„ ๋”ฅ๋Ÿฌ๋‹ ์†Œํ”„ํŠธ์›จ์–ด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜ ์ ˆ์ฐจ๋ฅผ ์•ˆ๋‚ดํ•ฉ๋‹ˆ๋‹ค.

ํ”Œ๋žซํผ

  1. Windows (x86-64bit)
  2. ์œ ๋‹‰์Šค ๊ณ„์—ด (Unix-Like)
    1. Mac (Apple Silicon/Intel x86-64bit)
  3. Linux (x86-64bit)
@lseongjoo
lseongjoo / pyml.md
Last active March 14, 2023 00:48
๊ธฐ๊ณ„ํ•™์Šต ํ™˜๊ฒฝ ์„ค์ •

Codebasic (c) 2023

๋‹ค์Œ ๋ฌธ์„œ๋Š” ์•„๋ž˜ ํ”Œ๋žซํผ๋ณ„ ๊ธฐ๊ณ„ํ•™์Šต ์†Œํ”„ํŠธ์›จ์–ด ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜ ์ ˆ์ฐจ๋ฅผ ์•ˆ๋‚ดํ•ฉ๋‹ˆ๋‹ค.

ํ”Œ๋žซํผ

  1. Windows (x86-64bit)
  2. ์œ ๋‹‰์Šค ๊ณ„์—ด (Unix-Like)
    1. Mac (Apple Silicon/Intel x86-64bit)
  3. Linux (x86-64bit)
@lseongjoo
lseongjoo / install-nanum-fonts-on-ubuntu.md
Created September 27, 2022 00:25 — forked from tiglek/install-nanum-fonts-on-ubuntu.md
Ubuntu ํ•œ๊ธ€ ๊ธ€๊ผด ์„ค์น˜

๋„ค์ด๋ฒ„ ๋‚˜๋ˆ” ๊ธ€๊ผด(https://zetawiki.com/wiki/%EB%82%98%EB%88%94%EA%B8%80%EA%BC%B4)

Download and Install

# download and extract font files(.ttf)
wget http://cdn.naver.com/naver/NanumFont/fontfiles/NanumFont_TTF_ALL.zip
wget https://github.com/naver/nanumfont/releases/download/VER2.5/NanumGothicCoding-2.5.zip
unzip NanumFont_TTF_ALL.zip