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
<?php | |
function ismain(){ | |
$debug = debug_backtrace(); | |
if(PHP_SAPI === 'cli' && count($debug)==1 && $debug[0]["function"]==__FUNCTION__){ | |
return true; | |
} | |
return false; | |
} |
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
<?php | |
/** | |
* 排序算法 | |
* 插入排序、快速排序、选择排序、冒泡排序 | |
* | |
*/ | |
class SortAlgorithm{ | |
/** |
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 os, re, sys | |
RE =re.compile(ur'r(\d+)\s\|\s(\S+)\s\|\s(\S+\s\S+)') | |
SVN_LOG="svn log" | |
def backtrack(file): | |
fh = os.popen("%s -q %s" % (SVN_LOG, file), "r") | |
for line in fh: | |
line = line.strip() | |
if line != "------------------------------------------------------------------------": |
NewerOlder