本来是看到另一篇博文中的题目,觉得博主实现的方式有点问题,故尝试自己实现,还望大家指教。 http://blog.csdn.net/u014039577/article/details/48623721 问题描述 启动3个线程打印递增的数字, 线程1先打印1,2,3,4,5, 然后是线程2打印6,7 ...
分类:
编程语言 时间:
2016-10-21 11:13:03
阅读次数:
186
正则表达式中(.*?)是常用的匹配模式,匹配出了换行符以外的字符,是非贪婪模式,读取最少的匹配信息 在编译模式中是用re.S可以让(.*?)匹配任意字符,包括换行符。 try: except Exception, e: print e 捕获所有异常并打印异常信息 dir(),查看当前对象的所有可用方 ...
分类:
编程语言 时间:
2016-10-21 10:25:10
阅读次数:
168
脚本内容:[root@m01scripts]#catfenfa_sshkey.exp[root@m01scripts]#catfenfa_sshkey.exp#!/usr/bin/expectif{$argc!=2}{send_user"usage:expectfenfa_sshkey.expfilehost\n"exit}#definevarsetfile[lindex$argv0]sethost[lindex$argv1]setpassword"123456"spawnssh-copy-id-i..
分类:
其他好文 时间:
2016-10-18 23:16:20
阅读次数:
190
1.题目大意 Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear runtime ...
分类:
编程语言 时间:
2016-10-14 00:24:38
阅读次数:
289
oracle 并操作 union 自动去除重复 如果想保留重复,需要使用union all 交操作intersect 自动去除重复 如果想保留重复,需要使用intersect all 差操作 except 自动去除重复 如果想保留重复,需要使用except all 聚集函数 平均值:avg 最小值: ...
分类:
数据库 时间:
2016-10-13 14:58:25
阅读次数:
174
什么是异常?顾名思义,异常就是程序因为某种原因无法正常工作了,比如缩进错误、缺少软件包、环境错误、连接超时等等都会引发异常。一个健壮的程序应该把所能预知的异常都应做相应的处理,应对一些简单的异常情况,使得更好的保证程序长时间运行。即使出了问题,也可让维护者..
分类:
编程语言 时间:
2016-10-12 23:33:41
阅读次数:
321
vi/usr/lib/python2.6/site-packages/tab.py
#!/usr/bin/envpython
#pythonstartupfile
importsys
importreadline
importrlcompleter
importatexit
importos
#tabcompletion
readline.parse_and_bind(‘tab:complete‘)
#historyfile
histfile=os.path.join(os.environ[‘HOME‘],‘..
分类:
编程语言 时间:
2016-10-12 23:25:09
阅读次数:
266
方式一:try语句: 1使用try和except语句来捕获异常 该种异常处理语法的规则是: · 执行try下的语句,如果引发异常,则执行过程会跳到第一个except语句。 · 如果第一个except中定义的异常与引发的异常匹配,则执行该except中的语句。 · 如果引发的异常不匹配第一个excep ...
分类:
编程语言 时间:
2016-10-10 23:03:01
阅读次数:
182
136. Single Number Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a lin ...
分类:
其他好文 时间:
2016-10-05 19:42:24
阅读次数:
115