-
專案內的代碼為專案成員所共有
自己的 code 會被別人使用、修改;同樣自己也有機會去修改別人的 code。因此撰寫代碼時最重要的是清楚明瞭,避免特殊術語或縮寫,以方便他人或將來的自己閱讀。
-
保持本地工作用副本 (working copy) 為最新版
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 <bitset> | |
#include <cmath> | |
#include <iomanip> | |
#define NUM_DIGITS 4 | |
using namespace std; | |
long long C(int m, int n) |
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
#!/usr/bin/python | |
# | |
# author: [email protected] | |
# usage: cat file.input | ./qround-problem-a.py > file.output | |
import sys | |
# 計算建完 n 個農場所需時間 | |
def calc_time(c, f, n): | |
tt = 0.0 |
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
#!/usr/bin/python | |
# | |
# author: [email protected] | |
# usage: cat file.input | ./qround-problem-d.py > file.output | |
import sys | |
def solve(): | |
numblocks = (int)(sys.stdin.readline()) | |
s = sys.stdin.readline()[:-1] |
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
#!/usr/bin/python | |
# | |
# author: [email protected] | |
# usage: cat file.input | ./qround-problem-a.py > file.output | |
import sys | |
def solve(): | |
s = sys.stdin.readline()[:-1] | |
c, f, x = [float(x) for x in s.split()] |
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
#!/usr/bin/python | |
# | |
# author: [email protected] | |
# usage: cat file.input | ./qround-problem-a.py > file.output | |
import sys | |
def get_a_row(): | |
a = (int)(sys.stdin.readline()) | |
b = 5 - a |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
import HTMLParser | |
import csv | |
import datetime | |
import codecs, cStringIO # for UnicodeWriter | |
response = urllib2.urlopen('http://www.imdb.com/chart/top') |
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
#!/bin/bash | |
# start year and end year | |
SYEAR=2005 | |
EYEAR=`date "+%Y"` | |
POSTPATH=~/github/octopress/source/_posts/ | |
echo | |
echo "YEAR File # Word Count" |
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
#!/usr/bin/python | |
import sys | |
import random | |
def misspell(s): | |
# word and punctation | |
(w, p) = (s, '') if s[-1] not in [',', '.', ';', ':'] else (s[:-1], s[-1]) | |
if len(w) <= 3: | |
return s |
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 urllib | |
# http://mh.99770.cc/manhua/5264/ | |
# http://mh.99770.cc/manhua/5264/42671.htm?s=3 (Book 1) | |
sServer="http://61.164.109.141:99/dm03/" | |
sFiles="/ok-comic00/j/jjs/vol_01/99770_001DD.jpg|/ok-comic00/j/jjs/vol_01/99770_002en.jpg|/ok-comic00/j/jjs/vol_01/99770_003zb.jpg|/ok-comic00/j/jjs/vol_01/99770_004va.jpg|/ok-comic00/j/jjs/vol_01/99770_005yQ.jpg|/ok-comic00/j/jjs/vol_01/99770_006cQ.jpg|/ok-comic00/j/jjs/vol_01/99770_007OI.jpg|/ok-comic00/j/jjs/vol_01/99770_008bY.jpg|/ok-comic00/j/jjs/vol_01/99770_009ue.jpg|/ok-comic00/j/jjs/vol_01/99770_010pv.jpg|/ok-comic00/j/jjs/vol_01/99770_011rC.jpg|/ok-comic00/j/jjs/vol_01/99770_012TU.jpg|/ok-comic00/j/jjs/vol_01/99770_013qr.jpg|/ok-comic00/j/jjs/vol_01/99770_014BY.jpg|/ok-comic00/j/jjs/vol_01/99770_015fI.jpg|/ok-comic00/j/jjs/vol_01/99770_016YE.jpg|/ok-comic00/j/jjs/vol_01/99770_017Le.jpg|/ok-comic00/j/jjs/vol_01/99770_018mb.jpg|/ok-comic00/j/jjs/vol_01/99770_019HC.jpg|/ok-comic00/j/jjs/vol_01/99770_020DB.jpg|/ok-comic00/j/jjs/vol_01/99770_021te.jpg|/ok-comic |