搭建HPC 一. ssh 无密码访问 ubuntu10 192.168.199.137ubuntu11 192.168.199.1381.user10@ubuntu10:~$ ssh-keygen -t rsa2.ssh-copy-id user11@192.168.199.138一直回车确定即可.3.ssh user11@192.168.199.1384.sudo nano /etc/hosts末尾追加:192.168.199....
安装openmpi 基于Ubuntu16.04 首先sudo apt-get install build-essentialsudo apt-get install checkinstall然后1. Go to http://www.open-mpi.org and download the latest .tar.gz package2. Create a directory to install OpenMPI and go into ...
连接远程服务器Linux的MySql MySql默认是禁止外部访问的,需要按如下修改:1. 登入 MySqlmysql -u root -p2. 然后输入(password填写自己的)GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;FLUSH PRIVILEGES;3. 我的系统是Ubuntu 16.04 ,My...
python3 去除字符串中的数字 来自https://stackoverflow.com/questions/12851791/removing-numbers-from-stringpython3:from string import digitss = 'abc123def456ghi789zero0'remove_digits = str.maketrans('', '', digits)res = s.transl...
Number Sequence f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.Sample Input1 1 31 2 100 0 0Sample Output25http://acm.hdu.edu.cn/showproblem.php?pid=1005f(n-1): 0~7,f(n): 0~7 所以共49种组合f(n) = (A * f(...
理解Java对象序列化 关于Java序列化的文章早已是汗牛充栋了,本文是对我个人过往学习,理解及应用Java序列化的一个总结。此文内容涉及Java序列化的基本原理,以及多种方法对序列化形式进行定制。在撰写本文时,既参考了Thinking in Java, Effective Java,JavaWorld,developerWorks中的相关文章和其它网络资料,也加入了自己的实践经验与理解,文、码并茂,希望对大家有所帮助。...
java IO文件操作 一些范例:0. 目录File遍历目录下的文件import java.io.File; import java.io.IOException; public class DirErgodic { private static int depth=1; public static void find(String pathName,int de...
A+B for Input-Output Practice (IV) 地址 http://acm.hdu.edu.cn/showproblem.php?pid=1092Problem DescriptionYour task is to Calculate the sum of some integers. InputInput contains multiple test cases. Each test case contains a integer N, an...
计算文件的26个字母出现的频率 来自solelearn appdef count_char(text,char): count = 0 for c in text: if c==char: count+=1 return countfimename = input("Enter a filename:")with open(fimename) as f: ...
python文件处理(一) 1.一般写try: f = open('/path/to/file', 'r') print f.read()finally: if f: f.close()但是麻烦可以写成,不用close()了with open('/path/to/file', 'r') as f: print f.read()2. f.read()一次读取所有文件内容,量力而...
import的注意事项 test.py#test.pydef display(): print ('hello world')display()main.pyimport test运行main.py代码会执行一次即输出hello wprld
Python 罗马数字与阿拉伯数字的转换 原文https://kingname.info/2014/12/29/%E5%AF%B9%E4%B8%80%E4%B8%AA%E7%BD%97%E9%A9%AC%E6%95%B0%E5%AD%97%E4%B8%8E%E9%98%BF%E6%8B%89%E4%BC%AF%E6%95%B0%E5%AD%97%E8%BD%AC%E6%8D%A2%E7%AE%97%E6%B3%95%E7%9A%84%E5
linux vi的使用 原文 http://www.cnblogs.com/itech/archive/2009/04/17/1438439.htmlvi/vim 基本使用方法本文介绍了vi (vim)的基本使用方法,但对于普通用户来说基本上够了!i/vim的区别简单点来说,它们都是多模式编辑器,不同的是vim 是vi的升级版本,它不仅兼容vi的所有指令,而且还有一些新的特性在里面。例如语法加亮,可视化操
镜像源和虚拟环境的使用 pip install -i http://pypi.douban.com/simple/djangowindows1. pip install virtualenv2. virtualenv testvir3 cd testvir/Scripts4 activate.bat 5 deactiavte(退出)linux1 pip
爬虫的去重策略 1 保存到数据库2 保存到set( 占用空间大)3 url经过md5等方法哈希后保存到set中 (scrapy采用了类似方法)4 用bitmap方法,将访问过的url通过hash函数映射到某一位(易冲突)5 bloomfilter方法进行改造,多重hash函数降低冲突()