不多解释,预防普通锁不正规的获取与释放#!/usr/bin/env python# -*- coding: utf-8 -*-import threadingimport timeclass MyThread(threading.Thread): def run(self): g...
分类:
编程语言 时间:
2014-09-04 19:00:19
阅读次数:
201
Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your program should return all 5 uni...
分类:
其他好文 时间:
2014-09-04 18:52:29
阅读次数:
181
服务器端#-*-coding:utf-8-*-#python:2.x__author__='Administrator'fromsocketimport*fromtimeimport*HOST=''PORT=1122#侦听端口BUFSIZ=1024ADDR=(HOST,PORT)sock=socke...
分类:
编程语言 时间:
2014-09-04 18:47:09
阅读次数:
195
1 from argparse import ArgumentParser 2 3 p = ArgumentParser(description='eg: $python mm_crawler -n 8 -o "D:/mm_pics" -l 500 \ 4 ...
分类:
其他好文 时间:
2014-09-04 18:46:59
阅读次数:
278
结合例子,就很好理解了。就是不要让共享变量被各个线程无序执行,导致结果不可预期threading模块中定义了Lock类,可以方便的处理锁定:#创建锁mutex = threading.Lock()#锁定mutex.acquire([timeout])#释放mutex.release()其中,锁定方法...
分类:
编程语言 时间:
2014-09-04 18:43:09
阅读次数:
264
GCC是Linux操作系统下一个非常重要的源代码编译工具,有着许多重要的选项,支持许多不同语言的编译,如C、C++、Ada、Fortran、Objective、Perl、Python、Ruby以及Java等,甚至Linux的许多内核和许多其他自由软件以及开放源码应用程序都是用C语言编写并经gcc编译...
分类:
系统相关 时间:
2014-09-04 18:42:39
阅读次数:
258
//// main.m// TestVar2//// Created by lishujun on 14-9-4.// Copyright (c) 2014年 lishujun. All rights reserved.//#import @interface Address : NSObj...
分类:
其他好文 时间:
2014-09-04 18:30:09
阅读次数:
212
class Solution {
public:
int canCompleteCircuit(vector &gas, vector &cost) {
int len = gas.size();
int tank_all = 0;
int pos = 0;
int tank_cur =0;
for (int i = 0; i < len; i++){
int tank...
分类:
其他好文 时间:
2014-09-04 17:08:19
阅读次数:
181
drop table t1;
create table t1 (c1 char(2) primary key, c2 char(1) not null);
insert into t1 values ('A ','A');
select t1.c1 from t1
where t1.c1 in (select c2 from t1 union all select '0'||c2 c2 fr...
分类:
数据库 时间:
2014-09-04 16:58:39
阅读次数:
245
#入门学习系列的内容均是在学习《Python编程入门(第3版)》时的学习笔记统计一个文本文档的信息,并输出出现频率最高的10个单词#text.py#保留的字符keep = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p'...
分类:
编程语言 时间:
2014-09-04 16:44:29
阅读次数:
326