Skip to content

Instantly share code, notes, and snippets.

Ilkyu Ju osori

Block or report user

Report or block osori

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@osori
osori / unpickling.py
Last active Dec 3, 2017
Unpickling in Python (Object de-serialization)
View unpickling.py
import pickle
with open("myobject.lq", "rb") as file:
my_obj = pickle.load(file)
# 이후 my_obj 는 일반적인 객체랑 똑같이 사용할 수 있다.
@osori
osori / pickling.py
Last active Dec 3, 2017
Pickling in Python (Object serialization)
View pickling.py
import pickle
with open("myobject.lq", "wb") as file:
pickle.dump(object(), file)
# object() 자리에 파일로 내보내고 싶은 객체를 넣으면 된다.
@osori
osori / py_trie.py
Last active Dec 2, 2017
파이썬에서 Trie 구현
View py_trie.py
class Trie(object):
def __init__(self):
self.head = Node(None)
"""
트라이에 문자열을 삽입합니다.
"""
def insert(self, string):
curr_node = self.head
@osori
osori / trie_node.py
Created Dec 2, 2017
Trie Node implementation in Python
View trie_node.py
class Node(object):
"""
A node that consists of a trie.
"""
def __init__(self, key, data=None):
self.key = key
self.data = data
self.children = {}
@osori
osori / trie.py
Last active Oct 9, 2019
Trie implementation in Python
View trie.py
class Node(object):
"""
A single node of a trie.
Children of nodes are defined in a dictionary
where each (key, value) pair is in the form of
(Node.key, Node() object).
"""
def __init__(self, key, data=None):
self.key = key
@osori
osori / phyundai.py
Last active Nov 24, 2017
pangyo-hyundai
View phyundai.py
# Jupyter Notebook에서 실행하세요
from IPython.display import Image, display
from bs4 import BeautifulSoup
import requests
print("어서오세요 품격과 전통의 판교 현백입니다.\n 어떤 물건을 찾으세요?")
query = input() # 유저 인풋 받아오기
@osori
osori / ngram_analyzer.py
Last active Oct 31, 2017
This python script can analyze n-grams from word or phoneme level. | 음절/어절 단에서 n-gram을 분석해주는 파이썬 스크립트입니다.
View ngram_analyzer.py
#!/usr/bin/env python3
# -*- coding:utf-8 -*-]
sample_text = "신은 다시 일어서는 법을 가르치기 위해 넘어뜨린다고 나는 믿는다."
def word_ngram(sentence, num_gram):
ngrams = []
text = list(sentence) # split the sentence into an array of characters
ngrams = [text[x:x+num_gram] for x in range(0, len(text))]
View SortingTest.java
public class SortingTest {
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] alist = {54,26,93,17,77,31,44,55,20};
printArray(alist);
//selectionSort(alist);
//insertionSort(alist);
You can’t perform that action at this time.