- 英文文章备份 pmarchive.com
- 译言花花翻译
- xyb 整理
在这个系列的帖子里我会回顾我在创建搞科技创业公司时所积累的知识和经验。
在这个系列的帖子里我会回顾我在创建搞科技创业公司时所积累的知识和经验。
import os | |
import re | |
import time | |
from colorama import Fore, Style | |
""" | |
该程序可以找到所有项目中包含所有 Python 文件中的中文注释 | |
This program can find all Chinese comments in all Python files in the project | |
Author: goocarlos<[email protected]> |
class func folderSize(folderPath:String) -> UInt{ | |
// @see http://stackoverflow.com/questions/2188469/calculate-the-size-of-a-folder | |
let filesArray:[String] = NSFileManager.defaultManager().subpathsOfDirectoryAtPath(folderPath, error: nil)! as [String] | |
var fileSize:UInt = 0 | |
for fileName in filesArray{ | |
let filePath = folderPath.stringByAppendingPathComponent(fileName) | |
let fileDictionary:NSDictionary = NSFileManager.defaultManager().attributesOfItemAtPath(filePath, error: nil)! |
<?php | |
/** | |
* 生成一个 $l 位的 62 进制随机字符串, 其第一位字符不为数字 | |
* @author Luyu Zhang<[email protected]> | |
*/ | |
function mt_rand_base62($l) { | |
$c = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; | |
$letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; | |
for ($s = '', $cl = strlen($c)-1, $i = 0; $i < $l; $s .= $c[mt_rand(0, $cl)], ++$i); |
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); | |
/** | |
* 扩展的 Input 库 | |
* @author Luyu<[email protected]> | |
*/ | |
class MY_Input extends CI_Input | |
{ | |
function __construct() |
<?php | |
//CREATE TABLE IF NOT EXISTS `pool` ( | |
//`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, | |
//`active_time` datetime NOT NULL COMMENT '活动时间', | |
//`used_time` datetime DEFAULT NULL COMMENT '被使用时间', | |
//`status` tinyint(4) NOT NULL, | |
//PRIMARY KEY (`id`), | |
//KEY `active_time_status` (`active_time`,`status`) | |
//) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |