Thursday, October 26, 2017

if you have trouble to install igraph in python

if you have trouble to install igraph in python, please check this page and install it: https://anaconda.org/marufr/python-igraph

Sunday, October 15, 2017

some concepts may be useful for paper

笛卡尔乘积定义 笛卡尔乘积是指在数学中,两个集合X和Y的卡尓(Cartesian product),又称直,表示为X×Y,第一个对象是X的成员而第二个对象是Y的所有可能有序对的其中一个成员 。

HMM , factor graph 和 MRF是一个有向图一个无向图。
sum product algorithm 是belief propogration.  看Bishop的第八章

Tuesday, October 10, 2017

Some linux commend


log in time for all users:
lastlog

log in time for me:
lastlog | grep gao 

检查CPU使用率 从大到小排序
ps auxw --sort=%cpu

list all files:
ls -l

看file system 的大小和使用情况
df -h 

http://www.cnblogs.com/peida/archive/2012/10/30/2746968.html
http://mark-ztw.iteye.com/blog/1544367

查看文件大小,文件夹大小:du -sm *,du -h, du *, du -sm, du -h *,
查看文件多少行:wc -l 2018092121.tsv

[root@linux ~]# tar -cvf /tmp/etc.tar /etc  <==仅打包,不压缩!

[root@linux ~]# tar -czvf /tmp/etc.tar.gz /etc  <==打包后,以 gzip 压缩

[root@linux ~]# tar -cjvf /tmp/etc.tar.bz2 /etc  <==打包后,以 bzip2 压缩

把tar包分成多个小文件:split -b 40M home1.tar.bz2 "home.tar.bz2.part"
把多个小文件合并:cat home.tar.bz2.parta* > home2.tar.bz2

linux 并行执行。用& 和 wait 综合操作。
& 表示并行
wait可以再等前面执行完,串行回来
https://blog.csdn.net/gua___gua/article/details/48682665

如果remove 一个folder ,然后不出现一个一个文件删除的确认的话,需要用
rm -rf folder/
一个一个文件删除的话 用:
rm -r folder/

Shell cheat sheet:
https://devhints.io/bash

对于shell 来说,如果想下一个命令要在上一个命令完成之后才开始的话,需要在每行命令后面加上 && 符号 https://blog.csdn.net/ysdaniel/article/details/6127860

https://blog.csdn.net/tiwoo/article/details/51094913


有zsh 也有bash. 对应的配置文件为zshrc 和 bashrc. 为了查看到底机器用的是哪个shell, 用
echo $SHELL 来查看。

bashrc 和 bash_profile 的区别: https://justcoding.iteye.com/blog/2120331

Some notes for check python location, module, virtualenv

If you can't see the virtualenvwrapper.sh. First uninstall virtualenvwrapper. It will show messages about the location of the virtualenvwrapper.sh file.


Check all python' location

type -a python

首选要确定哪个版本的python 要使用(不同的python版本可能存在在不同的地方)
可以用module load python/2.7 用module查看有几个版本的python

首先install virtualenv:
pip install virtualenv

新建一个sandbox of virtual environment:
virtualenv --python=/l/python2.7/bin/python env1 (silo 上面 module load的 python 不是系统自带的,也不是anaconda上面的)

有些python 用的是anaconda的,所以需要指定python路径

把当前路径设为指定的virtual envir:

cd env1/
 source bin/activate
which python
pip list //看一下安装的包都有什么
pip freeze// python 所有依赖的包

退出虚拟环境:
deactivate

如果你的虚拟环境想用系统已有的包,when you create it, you need to use
virtualenv --system-site-packages venv

Otherwise, if you don't want to use system package, create it using:

virtualenv venv –no-site-packages (和以上的基本一样)


2.3. 指定python版本

可以使用-p PYTHON_EXE选项在创建虚拟环境的时候指定python版本
#创建python2.7虚拟环境
➜  Test git:(master) ✗ virtualenv -p /usr/bin/python2.7 ENV2.7
Running virtualenv with interpreter /usr/bin/python2.7
New python executable in ENV2.7/bin/python
Installing setuptools, pip...done.
#创建python3.4虚拟环境
➜  Test git:(master) ✗ virtualenv -p /usr/local/bin/python3.4 ENV3.4
Running virtualenv with interpreter /usr/local/bin/python3.4
Using base prefix '/Library/Frameworks/Python.framework/Versions/3.4'
New python executable in ENV3.4/bin/python3.4
Also creating executable in ENV3.4/bin/python
Installing setuptools, pip...done.


作者:Andrew_liu
链接:http://www.jianshu.com/p/08c657bd34f1
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

使用virtualenvwrapper (更简单的方法)


http://codingpy.com/article/virtualenv-must-have-tool-for-python-development/
http://qicheng0211.blog.51cto.com/3958621/1561685
http://www.jianshu.com/p/44ab75fbaef2
http://liuzhijun.iteye.com/blog/1872241


man 在Linux中可以有文档查看的功能 i.e.
man ls
man python


























Monday, October 9, 2017

Gephi

Useful links:
http://blog.csdn.net/golden1314521/article/details/44982023

Friday, October 6, 2017

乐理

全全半 全全全半 这个是一个音阶
大调开心 小调悲伤
小调是大调3,6,7的降半音

在大调音阶中,每个音与第一个音的距离都叫做完全或者大音程
1458是完全 2367是大

减《--完全《--增
减《--小《--大《--增

五度循环圈