上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 15 下一页
  2011年10月8日
摘要: data = read.table("file", header=TRUE)R commands for PCAHere are some R commands for PCApcdat = princomp(data) - It does actual job and put the results to pcdat. It will use covariance matrixpcdat = princomp(data,cor=TRUE) - It will use correlation matrixsummary(pcdat) - It will print stan 阅读全文
posted @ 2011-10-08 16:48 香格里拉\(^o^)/ 阅读(4025) 评论(0) 推荐(0) 编辑
  2011年9月27日
摘要: =head1 NAME The name of your program or module.=head1 SYNOPSIS A one-line description of what your program or module does (purportedly).=head1 DESCRIPTION The bulk of your documentation. (Bulk is good in this context.)=head1 AUTHOR Who you are. (Or an alias, if you are ashamed of your program.)=head 阅读全文
posted @ 2011-09-27 18:14 香格里拉\(^o^)/ 阅读(5992) 评论(0) 推荐(0) 编辑
摘要: linux下解压命令大全 .tar 解包:tar xvf FileName.tar打包:tar cvf FileName.tar DirName(注:tar是打包,不是压缩!)———————————————.gz解压1:gunzip FileName.gz解压2:gzip -d FileName.gz压缩:gzip FileName.tar.gz 和 .tgz解压:tar zxvf FileName.tar.gz压缩:tar zcvf FileName.tar.gz DirName———————————————.bz2解压1:bzip2 -d FileName.bz2解压2:bunzip2 F 阅读全文
posted @ 2011-09-27 14:40 香格里拉\(^o^)/ 阅读(563) 评论(0) 推荐(0) 编辑
  2011年9月5日
摘要: openIN,“gzip-dc文件名|” open OUT, "| gzip >$out_f.gz" or die $!;自动判断是否压缩文件,例子:use PerlIO::gzip;open FQ1, "<:gzip(autopop)", "$ARGV[0]" || die "Cannot open $ARGV[0]\n";利用管道输出文件自动生成压缩文件:perla.pl|gzip> out.gz 阅读全文
posted @ 2011-09-05 10:52 香格里拉\(^o^)/ 阅读(7301) 评论(0) 推荐(0) 编辑
  2011年8月30日
摘要: #!/usr/bin/perl -wuse strict;use Getopt::Std;sub usage{ print "\tUsage: ", $0, " options\n", "\toptions:\n", "\t\t-i <str>\tthe input fa file\n", "\t\t-o <str>\tthe ouput file prefix\n"; exit(1);}use vars qw($opt_i $opt_o );getopts(" 阅读全文
posted @ 2011-08-30 13:44 香格里拉\(^o^)/ 阅读(896) 评论(0) 推荐(1) 编辑
  2011年8月25日
摘要: 做性能测试需要记录性能测试机器的硬件信息,现将需要的命令总结如下:查看CPU信息(型号)# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 8 Intel(R) Xeon(R) CPU E5410 @ 2.33GHz(看到有8个逻辑CPU, 也知道了CPU型号)# cat /proc/cpuinfo | grep physical | uniq -c 4 physical id : 0 4 physical id : 1(说明实际上是两颗4核的CPU)PS:Jay added on 10th, May, 2011# 其... 阅读全文
posted @ 2011-08-25 17:49 香格里拉\(^o^)/ 阅读(17154) 评论(1) 推荐(1) 编辑
摘要: 衡量CPU性能的指标:1,用户使用CPU的情况;CPU运行常规用户进程CPU运行niced processCPU运行实时进程2,系统使用CPU情况;用于I/O管理:中断和驱动用于内存管理:页面交换用户进程管理:进程开始和上下文切换3,WIO:用于进程等待磁盘I/O而使CPU处于空闲状态的比率。4,CPU的空闲率,除了上面的WIO以外的空闲时间5,CPU用于上下文交换的比率6,nice7,real-time8,运行进程队列的长度9,平均负载Linux中常用的监控CPU整体性能的工具有:§ mpstat: mpstat 不但能查看所有CPU的平均信息,还能查看指定CPU的信息。§ 阅读全文
posted @ 2011-08-25 17:47 香格里拉\(^o^)/ 阅读(42187) 评论(0) 推荐(1) 编辑
  2011年8月24日
摘要: 求400的阶乘C/C++ code#define N 400long a[8916]={1,0},n,i,c,len; int main(void) { n=N; for ( len=1;n>1; n--) { for (c=0,i=0; i<len;i++ ) { a[i]= ( c+= a[i]*n ) % 10000; c/=10000; } ((a[i]=c)>0)?len++:0; } for( len--,printf("%d",... 阅读全文
posted @ 2011-08-24 19:03 香格里拉\(^o^)/ 阅读(3534) 评论(0) 推荐(0) 编辑
摘要: 这是一个很有意思的问题,也是在面试中最容易被问到的问题之一。这个问题有个正式的名字叫Hamming_weight,而且wikipedia上也提供了很好的位运算解决的方法,这个下面也会提到。解决这个问题的第一想法是一位一位的观察,判断是否为1,是则计数器加一,否则跳到下一位,于是很容易有这样的程序。?12345678910int test(int n) { int count=0; while(n != 0){ if(n%2 ==1) count++; n /= 2; } return count; }或者和其等价的位运算版本:?123456789int test(int n) { int co 阅读全文
posted @ 2011-08-24 18:40 香格里拉\(^o^)/ 阅读(11454) 评论(1) 推荐(3) 编辑
摘要: gcc和g++的区别 我们在编译c/c++代码的时候,有人用gcc,有人用g++,于是各种说法都来了,譬如c代码用gcc,而c++代码用g++,或者说编译用gcc,链接用g++,一时也不知哪个说法正确,如果再遇上个extern "C",分歧就更多了,这里我想作个了结,毕竟知识的目的是令人更清醒,而不是更糊涂。误区一:gcc只能编译c代码,g++只能编译c++代码两者都可以,但是请注意:1.后缀为.c的,gcc把它当作是C程序,而g++当作是c++程序;后缀为.cpp的,两者都会认为是c++程序,注意,虽然c++是c的超集,但是两者对语法的要求是有区别的,例如:#includ 阅读全文
posted @ 2011-08-24 18:39 香格里拉\(^o^)/ 阅读(1013) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 15 下一页