Skip to content

Instantly share code, notes, and snippets.

View yonghanjung's full-sized avatar

Yonghan Jung yonghanjung

View GitHub Profile
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cmath>
#define MAX_TOK 10
using namespace std;
# -*- coding: utf-8 -*-
def find_all_paths(graph, start, end, path=[]):
path = path + [start]
if start == end:
return [path]
if not graph.has_key(start):
return []
paths = []
for node in graph[start]:
@yonghanjung
yonghanjung / inheritance.py
Last active August 29, 2015 14:04
멋쟁이사자 클래스
# Object-oriented programming intro
# Adapted from MIT 6.01 course notes (Section 3.5)
# http://mit.edu/6.01/mercurial/spring10/www/handouts/readings.pdf
class Staff601:
course = '6.01'
building = 34
room = 501
def salutation(self):
import mechanize
import urllib
from bs4 import BeautifulSoup
import unicodedata
import csv
def parserparser(url):
htmlread = mechanize.urlopen(url)
htmltext = htmlread.read()
import random
def main():
balls = range(1,46)
random.shuffle(balls)
print sorted(balls[0:6])
if __name__ == '__main__':
main()
@yonghanjung
yonghanjung / Class
Last active December 20, 2015 14:19
이론 리뷰
Class 는 Structs 의 확장된 형태로, 함수까지도 담을 수 있다.
Object는 Class안에 들어있는 것을 말한다. 즉, int number 에서 int를 class, number를 object로 볼 수 있다.
class class_name {
access_specifier_1:
member1;
access_specifier_2:
member2;
...
} object_names;
@yonghanjung
yonghanjung / 00_1. Code Review.cpp
Last active December 20, 2015 01:18
Code Study
/* To study Other good Codes
/* MY code, solving the Try_catch problem */