This file contains hidden or 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
#include <iostream> | |
#include <fstream> | |
#include <string> | |
#include <vector> | |
#include <cstdlib> | |
#include <cmath> | |
#define MAX_TOK 10 | |
using namespace std; |
This file contains hidden or 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
# -*- 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]: |
This file contains hidden or 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
# 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): |
This file contains hidden or 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 mechanize | |
import urllib | |
from bs4 import BeautifulSoup | |
import unicodedata | |
import csv | |
def parserparser(url): | |
htmlread = mechanize.urlopen(url) | |
htmltext = htmlread.read() |
This file contains hidden or 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 random | |
def main(): | |
balls = range(1,46) | |
random.shuffle(balls) | |
print sorted(balls[0:6]) | |
if __name__ == '__main__': | |
main() |
This file contains hidden or 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
Class 는 Structs 의 확장된 형태로, 함수까지도 담을 수 있다. | |
Object는 Class안에 들어있는 것을 말한다. 즉, int number 에서 int를 class, number를 object로 볼 수 있다. | |
class class_name { | |
access_specifier_1: | |
member1; | |
access_specifier_2: | |
member2; | |
... | |
} object_names; |
This file contains hidden or 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
/* To study Other good Codes |
This file contains hidden or 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
/* MY code, solving the Try_catch problem */ |
NewerOlder