The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all d...
分类:
其他好文 时间:
2014-08-27 00:11:56
阅读次数:
308
恼人的字符串计算机只能处理数字,如果要处理文本,就必须先把文本转换为数字才能处理。由于计算机是美国人发明的,因此,最早只有127个字母被编码到计算机里,也就是大小写英文字母、数字和一些符号,这个编码表被称为ASCII编码,比如大写字母A的编码是65,小写字母a的编码是97。但是要处理中文至少需要两个...
分类:
编程语言 时间:
2014-08-27 00:09:06
阅读次数:
369
LeetCode: Path SumGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equal...
分类:
其他好文 时间:
2014-08-27 00:07:27
阅读次数:
298
Hadoop Datanode节点无法启动(All directories in dfs.data.dir are invalid)java.io.IOException: All directories in dfs.datanode.data.dir are invalid: "/usr/loc...
分类:
其他好文 时间:
2014-08-26 21:23:27
阅读次数:
265
1. 打开Sublime Text 3,按Ctrl+~打开控制行,复制粘贴以下python代码,然后回车运行。2. 复制并粘贴如下代码:import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404e330c659d4b...
分类:
其他好文 时间:
2014-08-26 21:15:36
阅读次数:
202
转自:http://blog.csdn.net/arbel/article/details/7957782如果要在python2的py文件里面写中文,则必须要添加一行声明文件编码的注释,否则python2会默认使用ASCII编码。[python]view plaincopy#-*-coding:ut...
分类:
编程语言 时间:
2014-08-26 21:11:26
阅读次数:
244
今天遇到一个问题,把table里面的内容全部换成这行的,在td里添加属性word-break:break-all即可。对比几个换行相关的属性,做下总结:white-space : normal 自然显示,也就是文本碰到容器壁之后自动换行white-space : nowrap 强制文本在同一行,除....
分类:
Web程序 时间:
2014-08-26 21:08:26
阅读次数:
332
#!/usr/bin/envpython#coding=utf-8importparamikoimporttime,datetime,threadingdefssh(ip,user,passwd,command):ssh=paramiko.SSHClient()ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())try:ssh.connect(ip,port=16333,username=user,password=passwd)exceptpar..
分类:
编程语言 时间:
2014-08-26 19:54:27
阅读次数:
237
importoptparse,os,socket,timedefparse_args():usage="""pythontest.pytest"""parser=optparse.OptionParser(usage)help="IplistFile"parser.add_option("-f","--file",dest=‘iplistfile‘,default=‘iplist.txt‘,help=help)help="CmdFile"parser.add_option("-c","--config",de..
分类:
编程语言 时间:
2014-08-26 19:54:17
阅读次数:
298
importmultiprocessingimporttime,datetimedefSsh_Cmd(host,CmdFile):elog=open(‘error.log‘,‘a+‘)log=open(‘7z.log‘,"a+")forCmdinopen(CmdFile).readlines():Cmd=Cmd.strip()ifnotlen(Cmd)orCmd.startswith(‘#‘):continuessh=paramiko.SSHClient()ssh.set_missing_host_key_p..
分类:
编程语言 时间:
2014-08-26 19:54:07
阅读次数:
326