2012年3月9日

一个日历C程序

摘要: 由于C语言当初没学好,像C的结构体,文件流,指针等都还弄不明白。现在又捡起来再看一本C语言的书--Application Programming in Ansi C下面是最近的一个代码,关于打印日历的。/*Calendar 打印出某年的日历,由用户指出1月1日是星期几以及该年是否为闰年。 表示1月1日是星期几的编码: 0 Sunday 1 Monday 2 Tuesday 3 Wednesday 4 Thuray 5 Friday 6 Saturday 表示是否为闰年的编码: 0 不是 1 是 @author Jeff Chen @version 1.0 date:2012-03-08 ... 阅读全文

posted @ 2012-03-09 18:43 X.P.Chen 阅读(196) 评论(0) 推荐(0)

2012年3月6日

Emacs编辑命令速查4【摘自Learning Gnu Emacs】

摘要: Table E-19. Lisp commands (Chapter 9)KeystrokesCommand nameActionC-M-bbackward-sexpMove backward by one S-expression.C-M-fforward-sexpMove forward by one S-expression.C-M-ttranspose-sexpsTranspose the two S-expressions around the cursor.C-M-@mark-sexpSet mark to the end of the current S-expression; 阅读全文

posted @ 2012-03-06 14:42 X.P.Chen 阅读(166) 评论(0) 推荐(0)

Emacs编辑命令速查3【摘自Learning Gnu Emacs 】

摘要: Table E-13. Macro commands (Chapter 6)KeystrokesCommand nameActionC-x (kmacro-start-macroStart macro definition.F3kmacro-start-macro-or-insert-counterStart macro definition. If pressed while defining a macro, insert a counter.C-x )kmacro-end-macroEnd macro definition.F4kmacro-end-or-call-macroEnd ma 阅读全文

posted @ 2012-03-06 14:41 X.P.Chen 阅读(151) 评论(0) 推荐(0)

Emacs编辑命令速查2【摘自Learning Gnu Emacs】

摘要: Table E-7. Regular expression search commands (Chapter 3)KeystrokesCommand nameActionC-M-s EnterEditSearchRegexp Forwardre-search-forwardSearch for a regular expression forward.C-M-r EnterEditSearchRegexp Backwardsre-search-backwardSearch for a regular expression backward.C-M-sEditSearchIncremental 阅读全文

posted @ 2012-03-06 14:39 X.P.Chen 阅读(129) 评论(0) 推荐(0)

Emacs编辑命令速查表1【摘自Learning Gnu Emacs】

摘要: Table E-1. File-handling commands (Chapter 1)KeystrokesCommand nameActionC-x C-fFileOpen Filefind-fileFind file and read it in a new buffer.C-x C-vfind-alternate-fileRead an alternate file, replacing the one read withC-x C-f.C-x iFileInsert Fileinsert-fileInsert file at cursor position.C-x C-sFileSa 阅读全文

posted @ 2012-03-06 14:37 X.P.Chen 阅读(163) 评论(0) 推荐(0)

Emacs编辑命令速查

摘要: Emacs编辑命令速查Emacs 启动:$ emacs 如果有X-windows就会以视窗方式启动$ emacs -nw 不开视窗启动一些按键的约定:C- Control-(即 Ctrl-),按住 Ctrl 键再按其他键M- Meta-(或 Alt-),按住 Alt 键再按其他键;或按一下 ESC,再按其他键C-M- Control-Alt-,按住 Ctrl 和 Alt 两个键再按其他键point 位点。文档中的一个位置,一般是光标的左下角mark 标记。由命令设置,用来定义/保存文档中的位置信息region 区域。在 mark 和 point 之间部分,称为一个 regionRET 回... 阅读全文

posted @ 2012-03-06 14:15 X.P.Chen 阅读(227) 评论(0) 推荐(0)

2012年3月3日

My first Python class

摘要: """ This is a student class, it has functions:study(),Getage,Getname,Getschool and ageSet, nameSet,schoolSet. @author Jeff Chen @date:2012-3-3 """ #a student class class student: #study function def study(self): print '%s read and study'%self.name #set name def 阅读全文

posted @ 2012-03-03 21:45 X.P.Chen 阅读(169) 评论(0) 推荐(0)

2011年12月14日

vi编辑器一些常用命令的使用

摘要: 一些常见命令:(1)进入插入模式 i 从光标所在位置前进行插入文本 a 在光标所在位置之后追加新文本 o 将在光标所在行的下面新开一行,并将光标置于该行行首,等待输入文本(2)编辑模式下操作(如果在文本编辑则应按Esc键退到编辑模式命令) h,j,k,l 进行光标的左、下、上、右移动一个字符单位x 删除光标处的字符 yy 将当前的内容复制到缓冲区中 p 将缓冲区的内容写到光标所在的位置 zz 存盘退出 dd 删除整行(3)命令模式下操作(格式{:命令}):n 直接跳到n所指向的行,n指行号:q 退出vi :wq 保存并退出vi:q! 不保存退出 阅读全文

posted @ 2011-12-14 22:02 X.P.Chen 阅读(150) 评论(0) 推荐(0)

递归方法编写函数求n阶勒让德多项式的值(VS2010)

摘要: / 递归函数实现N阶勒让德多项式.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { return 0; } #include<iostream> using namespace std; long p(int x,int y) //Legendre polynomials函数定义 { if(y==0) return 1; else if(y==1) return x; else return (((2*y-1)*x*p(x,y-1)-(y-... 阅读全文

posted @ 2011-12-14 21:58 X.P.Chen 阅读(648) 评论(0) 推荐(0)

linux进程控制(fork,getpid,lockf)

摘要: 编写一段程序(程序命名为fork()),使用系统调用fork()创建两个子进程。当此程序运行时,在系统中有一个父进程和2个子进程活动。让每一个进程在屏幕上显示字符说明:父进程显示“Father”,子进程分别显示“Child1”,“Child2”;#include<stdio.h>#include<sys/types.h>#include<unistd.h>int main(){int pid1,pid2;printf("Father\n");if((pid1=fork())<0){printf("Child1 fail c 阅读全文

posted @ 2011-12-14 21:55 X.P.Chen 阅读(769) 评论(0) 推荐(0)

导航