{{ message }}

Instantly share code, notes, and snippets.

# Kim Jeong Ju haje01

• Webzen
• Seoul
Last active Dec 22, 2015
View calc.py
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 # -*- coding: utf-8 -*- """ Caculator for Python Korea GangNam Study """ import re from collections import deque
Last active Dec 25, 2015
집단지성프로그래밍 3장 for 파이썬 코리아 강남 스터디
View gist:6892583
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
 { "metadata": { "name": "" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ {
Last active Nov 21, 2017
Google Play Review Scraper
View reivew.py
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 import urllib import urllib2 import json import codecs url = "https://play.google.com/store/getreviews" values = { "reviewType": "0", "pageNum": "2", "id":
Created Nov 24, 2014
손고리즘 - Festival
View festival.py
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 calc_mavg(prc, ft): mavg = 100 n = len(prc) fs = 0 for start in xrange(0, n - ft + 1): cur = start + ft fs = sum(prc[start:cur]) if fs == 0 else fs - prc[start - 1] + prc[cur - 1] avg = fs / float(cur - start) if avg < mavg: mavg = avg
Created Nov 24, 2014
손고리즘 - Festival2
View festival2.py
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 calc_mavg(prc, ft): t = 0 aprc = [] for p in prc: t += p aprc.append(t) n = len(prc) ma = 100 * n for s in xrange(0, n - ft + 1): i = s - 1
Created Dec 22, 2014
View ites.py
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 gen_data(): a = 1983 po = pow(2, 32) while True: yield a % 10000 + 1 a = (a * 214013 + 2531011) % po def do_case(k, n): head = gen_data().next
Last active Aug 29, 2015
View josephus.py
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 do_case(n, ok): a = range(2, n+1) la = len(a) k = 0 while la > 2: k = (k + ok - 1) % la a.pop(k) la -= 1 return a
Last active Aug 29, 2015
동적계획법 보강 코드
View dynamicprog.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Feb 2, 2015
원주율 외우기
View pi.py
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 sfn1(na, o): a, b, c = na[o-2], na[o-1], na[o] if a == b and b == c: return 1 df = b - a if df == c - b: return 2 if abs(df) == 1 else 5 elif a == c: return 4 return 10
Created Mar 2, 2015
View packing.py
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 = None def memoize(fn): global cache def helper(w, ts, i): if cache[w][i] == -1: cache[w][i] = fn(w, ts, i) return cache[w][i]