%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;C:Program FilesJavajdk1.5.0_02bin;C:MinGWbin;C:Program FilesVimvim70
http://www.vi-improved.org/vimrc.php
http://www.vi-improved.org/_vimrc
%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;C:Program FilesJavajdk1.5.0_02bin;C:MinGWbin;C:Program FilesVimvim70
最近突然很多人要用Eclipse, 不仅仅是写Java, 也要使用C/C++, 很多问题, 一起写出来吧 :)
实验室的配置是WindowsXP SP2 + Eclipse3.2 with CDT Embedded for Win32 + MinGW 3.0.0.1 + JDK 1.5.02, 本次讨论最重要的Eclipse3.2withCDT却没找到合适的下载, 官方给的没有集成版的, 只有自己去找一下,我有上传过到 药学院 的FTP, 可惜好像被删了. MinGW和JDK都可以在官方主页上找下载, 或者你可以点 MinGW 来从台湾的镜像下载MinGW, 访问 Java 2 SDK 来从yaguo下载JDK.
首先安装JDK, 假设你安装到了默认目录, 然后将bin目录加入到环境变量中. 然后安装MinGW, 将bin目录加入到环境变量中, 并且把bin目录下的mingw32-make.exe改名为make.exe. 最后解压Eclipse到任何你喜欢的地方, Eclipse是一个基于Java编写的绿色软件, 不用担心安装问题, 打开后配置好WorkSpace的位置, 就可以任意使用了. 关于Eclipse的具体使用方法, 这就是另一个话题了…
附: 关于环境变量, 在桌面上打开[我的电脑], 选[属性], 选[高级]标签页, 点开下面的[环境变量], 双击下面系统变量中的Path, 要加入的就是在原始的后面加;和要添加的目录了, 比如我的在装了JDK和MinGW以及gVIM后的环境变量为
%SystemRoot%system32;%SystemRoot%;%SystemRoot%System32Wbem;C:Program FilesJavajdk1.5.0_02bin;C:MinGWbin;C:Program FilesVimvim70
A 14 lines only .vimrc files for the vim under linux, I can use it everywhere as I used to be.
set nocompatible " get out of horrible vi-compatible mode syntax on " syntax highlight on set ruler " Always show current positions along the bottom set number " trun on line number set showmatch " show matching brackets set ai " autoindent set si " smartindent set cindent " do c-style indenting set tabstop=4 " tab spacing set softtabstop=4 " tab spacing set shiftwidth=4 " tab spacing set expandtab " not real tabs please! set smarttab " use tabs at the start of a line, spaces elsewhere set so=5 " Keep 5 lines (top/bottom) for scope
自己用的vimrc配置文件, 这篇文章随时可能会更新以符合最新的使用习惯 :P
vimrc使用”来注释到行末, 类似C++里面的//, 我能理解的选项我都会添加部分中文注释的
我觉得比较有用的有以下几个:
autocmd GUIEnter * :simalt ~x " 启动时全屏 set nocompatible " 不使用vi兼容模式 set helplang=Cn " 帮助语言为中文 set background=dark " 黑色背景(我喜欢的) syntax on " 语法高亮显示 colorscheme torte " torte颜色主题(我喜欢的) set ruler " 显示按钮位置(一个我不是很明白的配置,但是一般都加上) set number " 显示行号 set backspace=2 " 退格键工作模式, 2为一般 set showmatch " 显示匹配的括号 set so=5 " 翻页时屏幕上下各留5行缓冲区 set ai " 自动缩进 set si " 智能缩进 set cindent " 使用C的语法模式缩进 set tabstop=4 " tab键宽度 set softtabstop=4 " 同上 set shiftwidth=4 " 同上 set expandtab " 使用tab, 一个tab键产生一个真实的/t set nowrap " 不要跨行 set smarttab " 智能tab
一个非常好的vimrc文件样例,有英文注释,上面一个是彩色高亮的,下面一个是纯文本的:
http://www.vi-improved.org/vimrc.php
http://www.vi-improved.org/_vimrc
我的_vimrc文件,有修改,基于Windows下的gVIM7.0(前一小部分)和上面提到的那个. 添加了几个快捷键, F2保存, F3保存退出, F10编译, F11运行. 同时注意要使用此文件请在VIM的安装目录下的vimfiles目录下建立backup和temp两个临时文件夹. 有很多冗余的, 因为不知道具体规则, 还没敢删. 本blog系统只能上传.rar文件, 大家自己解压到原来的目录吧.
Thinking in Java is a book’s name, a good book. This afternoon, I did a hard work to find a method which can check that a char is a letter or not, but got no answer. I complained that Java is too hard to learn if I don’t know any class library and its method, everything I need to deal by myself, then MagicPig advise us to read the book Thinking in Java, said that it will be the best book to learn Java.
I spent nearly the hole day to type some simple code of the text book, and get many errors some seems strange, there may be a good experiences and wealth, because it can make me not to do the stupid thing again and again. But there is still a little problem need to fixed, which I can’t use Ant in Eclipse to compile a .jar file and to run the .jar file by double-click, there is always a error hint break out when I try to run the .jar file by double-click, I doubt there is something wrong in the build.xml file, but I don’t know how to correct it also I used Baidu and Google for a solution.
For the course, and for learning a useful skill, start coding in Java. Java is the third programming language I learned strictly, before it are Pascal and C. There is more easy that when you have used a programming language skilled to study another, because the ideas are the same, only the method to get the result are different. The last words may be wrong, because Java is an OO(Object Oriented) language, which is different to the Process-Oriented language likes Pascal/C, and I said I learned C only as I didn’t know the ideas of OO in C++.
In Java, everything is long, the name of class, function, variable, too long to type… I love C, I love VIM, which can do anything use keyboard only. Our Java text book used the Hungarian notation ordinary, so it’s a good way to make my coding habit standardization.
VIM的中文手册,好东西,记录一下
// ** Start of PerfectMatch ******************************* // Name: PerfectMatch by Kuhn_Munkras O(n^3) // Description: w is the adjacency matrix, nx,ny are the size of x and y, // lx, ly are the lables of x and y, fx[i], fy[i] is used for marking // whether the i-th node is visited, matx[x] means x match matx[x], // maty[y] means y match maty[y], actually, matx[x] is useless, // all the arrays are start at 1 int nx,ny,w[MAXN][MAXN],lx[MAXN],ly[MAXN]; int fx[MAXN],fy[MAXN],matx[MAXN],maty[MAXN]; int path(int u) { int v; fx[u]=1; for(v=1;v<=ny;v++) if((lx[u]+ly[v]==w[u][v])&&(fy[v]<0)) { fy[v]=1; if((maty[v]<0)||(path(maty[v]))) { matx[u]=v; maty[v]=u; return(1); } // end of if((maty[v]... } // end of if((lx[u]... return(0); } // end of int path() int PerfectMatch() { int ret=0,i,j,k,p; memset(ly,0,sizeof(ly)); for(i=1;i<=nx;i++) { lx[i]=-INF; for(j=1;j<=ny;j++) if(w[i][j]>lx[i]) lx[i]=w[i][j]; } // end of for(i... memset(matx,-1,sizeof(matx)); memset(maty,-1,sizeof(maty)); for(i=1;i<=nx;i++) { memset(fx,-1,sizeof(fx)); memset(fy,-1,sizeof(fy)); if(!path(i)) { i--; p=INF; for(k=1;k<=nx;k++) if(fx[k]>0) for(j=1;j<=ny;j++) if((fy[j]<0)&&(lx[k]+ly[j]-w[k][j]<p)) p=lx[k]+ly[j]-w[k][j]; for(j=1;j<=ny;j++) ly[j]+=(fy[j]<0?0:p); for(k=1;k<=nx;k++) lx[k]-=(fx[k]<0?0:p); } // end of if(!path(i)) } // end of for(i... for(i=1;i<=ny;i++) ret+=w[maty[i]][i]; return ret; } // end of int PerfectMatch() // ** End of PerfectMatch *********************************
// ** Start of MaximumMatch ******************************* // Name: MaximumMatch by Hungray O(n^3) // Description: mat is the adjacency matrix, nx,ny are the size of x and y, // fy is used for marking whether the k-th node is visited, matx[x] means x // match matx[x], maty[y] means y match maty[y], actually, matx[x] is useless, // all the arrays start at 1 int nx,ny,mat[MAXN][MAXN],fy[MAXN],matx[MAXN],maty[MAXN]; int path(int u) { int v; for(v=1;v<=ny;v++) if((mat[u][v])&&(fy[v]<0)) { fy[v]=1; if((maty[v]<0)||(path(maty[v]))) { matx[u]=v; maty[v]=u; return(1); } // end of if((maty[v]... } // end of if((mat[u][v]... return(0); } // end of int path() int MaximumMatch() { int i,ret=0; memset(matx,-1,sizeof(matx)); memset(maty,-1,sizeof(maty)); for(i=1;i<=nx;i++) if(matx[i]<0) { memset(fy,-1,sizeof(fy)); ret+=path(i); } // end of if(matx[i]... return(ret); } // end of int MaximumMatch() // ** End of MaximumMatch *********************************
直接抄的武大李春葆老师的数据结构上的改进KMP
// return the first matching string2 in the string1 #include <stdio.h> #include <string.h> #define MaxSize 1000 typedef struct { char ch[MaxSize]; int len; } SqString; void GetNextval(SqString t,int nextval[]) { int j=0,k=-1; nextval[0]=-1; while(j<t.len) { if((k==-1)||(t.ch[j]==t.ch[k])) { j++; k++; if(t.ch[j]!=t.ch[k]) nextval[j]=k; else nextval[j]=nextval[k]; } else k=nextval[k]; } } int KMP(SqString s,SqString t) { int nextval[MaxSize],i=0,j=0,v; GetNextval(t,nextval); while((i<s.len)&&(j<t.len)) { if((j==-1)||(s.ch[i]==t.ch[j])) { i++; j++; } else j=nextval[j]; } if(j>=t.len) v=i-t.len; else v=-1; return(v); } int main() { // freopen("kmp.in","r",stdin); // freopen("kmp.out","w",stdout); SqString str1,str2; gets(str1.ch); str1.len=strlen(str1.ch); gets(str2.ch); str2.len=strlen(str2.ch); printf("%dn",KMP(str1,str2)); return(0); }