Entry for November 21, 2006

Jan302007
0 评论

Fifty suggestion from senior
1.把C++当成一门新的语言学习(和C没啥关系!真的。);2.看《Thinking In C++》,不要看《C++变成死相》;3.看《The C++ Programming Language》和《Inside The C++ Object Model》,不要因
为他们很难而我们自己是初学者所以就不看;4.不要被VC、BCB、BC、MC、TC等词汇所迷惑——他们都是集成开发环境,而我们要学的
是一门语言;5.不要放过任何一个看上去很简单的小编程问题——他们往往并不那么简单,或者可以
引伸出很多知识点;6.会用Visual C++,并不说明你会C++;7.学class并不难,template、STL、generic programming也不过如此——难的是长期坚
持实践和不遗余力的博览群书;8.如果不是天才的话,想学编程就不要想玩游戏——你以为你做到了,其实你的C++水平
并没有和你通关的能力一起变高——其实可以时刻记住:学C++是为了编游戏的;9.看Visual C++的书,是学不了C++语言的;10.浮躁的人容易说:XX语言不行了,应该学YY;——是你自己不行了吧!?11.浮躁的人容易问:我到底该学什么;——别问,学就对了;12.浮躁的人容易问:XX有钱途吗;——建议你去抢银行;13.浮躁的人容易说:我要中文版!我英文不行!——不行?学呀!14.浮躁的人容易问:XX和YY哪个好;——告诉你吧,都好——只要你学就行;15.浮躁的人分两种:a)只观望而不学的人;b)只学而不坚持的人;16.把时髦的技术挂在嘴边,还不如把过时的技术记在心里;17.C++不仅仅是支持面向对象的程序设计语言;18.学习编程最好的方法之一就是阅读源代码;19.在任何时刻都不要认为自己手中的书已经足够了;20.请阅读《The Standard C++ Bible》(中文版:标准C++宝典),掌握C++标准;21.看得懂的书,请仔细看;看不懂的书,请硬着头皮看;22.别指望看第一遍书就能记住和掌握什么——请看第二遍、第三遍;23.请看《Effective C++》和《More Effective C++》以及《Exceptional C++》;24.不要停留在集成开发环境的摇篮上,要学会控制集成开发环境,还要学会用命令行方
式处理程序;25.和别人一起讨论有意义的C++知识点,而不是争吵XX行不行或者YY与ZZ哪个好;26.请看《程序设计实践》,并严格的按照其要求去做;27.不要因为C和C++中有一些语法和关键字看上去相同,就认为它们的意义和作用完全一
样;28.C++绝不是所谓的C的“扩充”——如果C++一开始就起名叫Z语言,你一定不会把C和
Z语言联系得那么紧密;29.请不要认为学过XX语言再改学C++会有什么问题——你只不过又在学一门全新的语言
而已;30.读完了《Inside The C++ Object Model》以后再来认定自己是不是已经学会了C++;
31.学习编程的秘诀是:编程,编程,再编程;32.请留意下列书籍:《C++面向对象高效编程(C++ Effective Object-Oriented Soft
ware Construction)》《面向对象软件构造(Object-Oriented Software Constructio
n)》《设计模式(Design Patterns)》《The Art of Computer Programming》;33.记住:面向对象技术不只是C++专有的;34.请把书上的程序例子亲手输入到电脑上实践,即使配套光盘中有源代码;35.把在书中看到的有意义的例子扩充;36.请重视C++中的异常处理技术,并将其切实的运用到自己的程序中;37.经常回顾自己以前写过的程序,并尝试重写,把自己学到的新知识运用进去;38.不要漏掉书中任何一个练习题——请全部做完并记录下解题思路;39.C++语言和C++的集成开发环境要同时学习和掌握;40.既然决定了学C++,就请坚持学下去,因为学习程序设计语言的目的是掌握程序设计技
术,而程序设计技术是跨语言的;41.就让C++语言的各种平台和开发环境去激烈的竞争吧,我们要以学习C++语言本身为主
;42.当你写C++程序写到一半却发现自己用的方法很拙劣时,请不要马上停手;请尽快将
余下的部分粗略的完成以保证这个设计的完整性,然后分析自己的错误并重新设计和编
写(参见43);43.别心急,设计C++的class确实不容易;自己程序中的class和自己的class设计水平是
在不断的编程实践中完善和发展的;44.决不要因为程序“很小”就不遵循某些你不熟练的规则——好习惯是培养出来的,而
不是一次记住的;45.每学到一个C++难点的时候,尝试着对别人讲解这个知识点并让他理解——你能讲清
楚才说明你真的理解了;46.记录下在和别人交流时发现的自己忽视或不理解的知识点;47.请不断的对自己写的程序提出更高的要求,哪怕你的程序版本号会变成Version 100.
XX;48.保存好你写过的所有的程序——那是你最好的积累之一;49.请不要做浮躁的人;50.请热爱C++!

Entry for November 21, 2006

0 评论

Some books i was recommened to read.
The Design and Evoluation of C++ C++ Primer / Essential C++ The Practice of Programming Thinking in C++ The C++ Programming Language Effective C++More Effective C++ Effective STL Inside the C++ Object Model Modern C++ Design
They were all about c++.Yes,i returned to study c++.Because it is more confortable for me.And there are more study material in hand

Entry for November 21, 2006

0 评论

Some books i was recommened to read.
The Design and Evoluation of C++ C++ Primer / Essential C++ The Practice of Programming Thinking in C++ The C++ Programming Language Effective C++More Effective C++ Effective STL Inside the C++ Object Model Modern C++ Design
They were all about c++.Yes,i returned to study c++.Because it is more confortable for me.And there are more study material in hand

Entry for November 20, 2006

0 评论

I was finally able to get my first day completed.It is really a different day for me .We did something absolutely differ from my courses in the school.We worked in a lathe.Wow,it was so happy for us to do that.That is my first time in the lathe.And,so are my classmates.I supposed to have a hard time there,but,the teacher was very helpful.Therefore,we have an easy time in the workshop.The machines there was all older than us.They were made in 1970's.Hah,how could they had live so long?They were all very healthy until now.And that's fantasy.Wish a better day tomorrow and forever...

Entry for November 19, 2006

0 评论

A program written by myself when i was learning c.
C 语言大作业报告
200530212043 8/31/06
09:15:13.PM 作业题目:
按给定的数据结构设计一个具有下面功能的菜单通信录。 要求:能显示菜单,并且能进行选择以及完成相应的功能。 数据结构:学号、姓名、性别、家庭住址、邮编、电话。 功能:
1.数据录入--按顺序录入特定的学生成绩; .2.删除特定的记录; .3.修改特定的记录; .4.查询特定的记录; .5.退出。 提示:参考教材的第十一章和第十三章有关内容。 解题的基本算法和基本架构:
1. 为了符合书本知识的应用和使程序得到简化,本程序使用单链来储存数据(即姓名、学号等)。 2.由于成绩具有同类的特性,所以相应地建立一个结构体来存放,也因此产生了复合的结构体, 但是在显示、储存、载入链表的时候,如果每个数据都要显示的话,会很占屏幕,所以可 可能显示方面有一些不整齐,然而,那个对人接收数据不会产生影响。 3.为程序能够简单的运行,使用了一个head_ptr.指针来贯穿整个程序,每个功能的实现都会由 这个指针参数来提供接口,当然函数的返回值也会是个指针参数,它会提供下一个功能的入口 4.本程序提供了一个主菜单,大多数的功能都会在这里得到实现,但同时,也相应的做了几个子菜 单,它们主要用来进行一些日常信息的管理,如登录日志,密码更改等。 5.为了是功能得到强化,特意增加了成绩统计功能,同时把数据的管理分为创建链表,删除链表中 的某个条目,增加条目,载入链表,保存链表,显示链表,按学号搜索条目等,而且每个功能都会 有相应的菜单来选择执行, 6.为了方便程序的维护和管理,把程序分为了3 个模块:主函数模块负责菜单的显示,功能 显示;链表操作模块,实现数据的操作;登录模块,负责登录事项的管理。 7. 根据题目的要求搜索功能只是实现了按学号搜索的功能。 8.为了使程序更加人性化,几乎每个菜单都会进行表格化,方便操作。 9.程序的可扩张性是根据结构化的设计的原理来实现的,对于链表的操作扩展性应该很大, 整个程序所用的算法都是以基本的循环,条件语句来实现。 10. 为了使程序可以在多个平台运行,方便实现,所以没有使用特定的系统函数,这样程序的 适应能力,或者说是可移植性就大大提高,经测试可以在Ubuntu 上运行。 11. 为了方便编译,写了几个makefile ,分别对应不同的编译器,它们主要有Microsoft.Visual.C...++,Borland.c++,Turbo.c++,GNU.gcc 等。 源代码: 注意:本程序纯属用作本次大作业的报告,任何人用作其它用途,不管褒贬,请保留本人的 小名,还有,任何软件或者他人代码发现与本程序有一点点相同,纯属巧合,与本人无关, 敬请留意。
1.sys_log.h— 系统日志实现头文件. /*************************************************************** .*system_loglogin.system, loginout.system,.add.a.password,..* .*.edit.password,.save.password...* .* .*.* .*Functions:.* .* passwdthe.password.to.login.system. ..* .*.save_loginsave.the.login..record..* .*.in.the.log.txt.* .*.save_logoutsave.the.logout.record. ..*
.*.chg_passwdchange.the.password. .* add_passwdadd.a.password. ..* .*.dellfiledelete.the.log.history.file. ..* .*.view_logview.the.log.history.file. ..* .**************************************************************/ /************************************************************* .*passwdthe.password.to.login.system. .*************************************************************/ .extern.void.passwd(void);
/************************************************************* .*save_loginopen.the.log.record.file.and.save.infomation. ..* .*.* .*Parameters.* .* nameName.of.disk.file.which.stored.the.* .*.log.record...* .*Returns.* .*.0open.secceeded. ..* .*.nozeroopen.failed. ..* .**************************************************************/
..extern.int.save_login(const.char.name[]);
/************************************************************* .*save_logoutsave.the.log.record.file. ..* .*************************************************************/ .extern.int.save_logout(const.char.name[]);
/************************************************************ .*add_chg_passwdadd.orchange.the.password. ..* .*Returns.* ochange.sucessfully. ..* .*.nozerofailed.to.change. ..*
.************************************************************/
.extern.void.add_chg_passwd(void);
/************************************************************* .*del_lfiledelete.the.log.file. ..* .*************************************************************/ .extern.int.del_lfile(const.char.name[]);
/************************************************************** .*view_logview.the.log.record.file. .**************************************************************/ .extern.int.view_log(const.char.name[]);
2.sys_log.c— 系统日志的实现文件。 /*************************************************************** .*system.log.module.* .* Handles.the.login.and.logout.* .*.do.with.the.password.matters...* .*Functions.* .* passwdthe.password.to.login.system. ..* .*.save_loginsave.the.login..record..* .*.in.the.log.txt...*
.*.save_logoutsave.the.logout.record.file .*.in.the.log.txt...* .* add_chg_passwdadd.or.change.a.password. ..* .*.view_logview.the.log.history.file. ..* .*.del_lfiledelete.the.log.history.file. ..* .**************************************************************/ .#include. .#include. .#include. .#include."sys_log.h" .#include. .#define.STRING_MAX.100../*longest.string.can.be.used*/
.struct.log_file{ FILE.*file;........../*file.used.to.record*/ char.time[STRING_MAX];........./*login.date.and.time*/ char.usr_name[STRING_MAX];...../*user.who.login*/ char.state[8];......../*log.state.*/
.};
.struct.log_file.log; /* .*.passwdthe.password.to.login.system. ..* .*/ .void.passwd(void) .{ .char.line[STRING_MAX]; .char.string_pw[STRING_MAX];...../*the.array.to.store.password*/
.FILE.*ptr;.................../*the.password.file*/ .char.string_in[STRING_MAX];........../*the.string.input*/ .ptr.=.fopen("pwd.dat","rb"); .if.(ptr.==.NULL).{
.printf("Memory.Error!\n"); .} .fscanf(ptr,."%s",.string_pw); .while(1){
.printf("Please.Enter.Your.Password:"); .fgets(line,sizeof(line),stdin); .sscanf(line,"%s",string_in); .if(strcmp(string_pw,string_in)==.0)
.break;
else.printf("Error!\n"); .} .fclose(ptr); .printf("Welcome.back!Master\n");
.}
/* .*add_chg_passwdadd.or.change.a.password. .*/ .void.add_chg_passwd(void) .{
.char.line[STRING_MAX]; .FILE.*pwd_ptr; .char.str1[STRING_MAX]; .char.str2[STRING_MAX]; .printf("Atttion.:.if.you.have.an.old.password,.it.will.be.lay.over!\n"); .pwd_ptr.=.fopen("pwd.dat","wb"); .if(pwd_ptr.==.NULL)
.printf("There.is.something.wrong!");../*memory.error*/
.while(1){ .printf("Please.Enter:"); .fgets(line,sizeof(line),stdin); .sscanf(line,"%s",str1); .printf("Enter.Again.To.Confirm:."); .fgets(line,sizeof(line),stdin);
.sscanf(line,"%s",str2);
.if(strcmp(str1,str2).==.0.){ .printf("PASSWORD.CHANGED.SUCESSFULL\n"); .break;
.}
.else.printf("ERROR,NOT.THE.SAME!\n"); .} .fprintf(pwd_ptr,."%s",.str1); .fclose(pwd_ptr);
}
/* .*save_loginsave.the.login.record.. .*/ .int.save_login(const.char.name[]) .{
.time_t.td; .time(&td); .log.file.=.fopen(name,"a+"); .if(log.file.==.NULL)../*failed.to.open.file*/
return.(errno);
./* ..*get.the.date.and.time.from.system. .*/
.strcpy.(log.time,asctime(localtime(&td))); .log.time[strlen(log.time)1] .=.'\0'; .strcpy.(log.usr_name,."Administrator");...../*define.the.usr's.name*/ .strcpy.(log.state,."login");................/*system.state*/ .fprintf(log.file,"\t\tTIME\t\tUSER\t.STATE\n"); .fprintf(log.file,".%s..%s.%s\n",log.time,log.usr_name,log.state); .fclose(log.file); .return.(0);
.}
/*
.*.save_logoutsave.the.logout.record. .*/ .int.save_logout(const.char.name[]) .{ .time_t.td; .time(&td); .log.file.=.fopen(name,."a+");..../*open.log.fiel*/ .if(log.file.==.NULL)../*failed.to.open*/
return.(errno);
.strcpy(log.state,."logout");.........../*system.state*/
./* ..*get.the.date.and.time.from.system. .*/
.strcpy.(log.time,asctime(localtime(&td))); .log.time[strlen(log.time)1] .=.'\0'; .strcpy.(log.usr_name,"Administrator"); .fprintf(log.file,"\t\tTIME\t\tUSER\t.STATE\n"); .fprintf(log.file,".%s..%s.%s\n",log.time,log.usr_name,log.state); .fclose(log.file); .return.(0);
.}
./* ..*del_lfiledelete.the.log.record. .*/
.int.del_lfile(const.char.name[])
.{ .FILE.*fp; .fp.=.fopen(name.,."w"); .if(fp.==.NULL)
return.(errno); .fclose(fp); .return.(0);
.}
/* .*view_logview.the.history.record. .*/ .int.view_log(const.char.name[]) .{
.char.ch; .FILE.*fp; .fp.=.fopen(name.,."r"); .if(fp.==.NULL){
printf("failed.to.open.file"); return.(errno); .}
.ch.=.fgetc(fp); .while(ch.!=.EOF){................/*output.the.char.until.the.end.of.file.*/
.putchar(ch); .ch.=fgetc(fp);
.} .fclose(fp); .return.(0);
.}
3.record_manage.h— 链表数据头文件。 /************************************************************* .*define.the.structure.of.student. .*************************************************************/
..struct.grade{ float.Maths;.............../*mathematical.analysis.score*/ float.English;............./*English.score*/ float.Advan_lang_progr;...../*C.Programming.score*/
.};
.struct.student{ int.rno;.................../*student.number*/ char.name[50];............./*student.name*/ char.sex[10];.............../*student.sex*/ char.clas[50];............./*student.class*/ char.address[100];........./*strdent.home.address*/
....int..zip_code;......../*home's.postalcode*/ long.int.homei;............/*home's.telephone.number*/ struct.grade.score;......../*student.score.*/ struct.student.*next_ptr;.../*next.item*/
.};
/************************************************************** .*cre_reccreate.student.record. .***********************************************************/ .extern.struct.student.*cre_rec(void);
./************************************************************* .*add_recadd.a.student's.infomation. ..* .**************************************************************/ .extern.struct.student.*add_rec(struct.student.*head_ptr);
/************************************************************** .*delete_recdelete.a.student's.infomation. ..* .**************************************************************/ .extern.struct.student.*delete_rec.(struct.student.*head_ptr);
/**************************************************************
.*load_recload.all.students'.record.from.file. ..* .**************************************************************/
.extern.struct.student.*load_rec.(struct.student.*head_ptr);
/************************************************************* .*save_recsave.students'.information.in.a.file. ..* .*************************************************************/
.extern.int.save_rec(struct.student.*head_ptr);
./********************************************************** .*searchThis.is.designed.to.search.record.by..* .*...student.G.R.NO.or.by.name...* .*Parameters.* .* head_ptrthe.pointer.to.the.linked.head. ..* .*Returns .*.head_ptrthe.same.to.parameters. ..* .**********************************************************/ .extern.struct.student.*search(struct.student.*head_ptr);
/************************************************************* .*printprint.the.student.record. .*************************************************************/ .extern.void.print(struct.student.*head_ptr);
/************************************************************ .*statisticsprint.a.statistics. .************************************************************/ .extern.struct.student.*statistics(struct.student.*head_ptr);
4.record_manage.c— 链表数据实现文件. /************************************************************** .*record_manage...* .*This.module.is.used.to.manage.the.students'.information,..* .*such.as,.editing.,.adding,.deleting,.reviewing...* .*Public.Functions.* .*.struct.student.*cre_rec.(void);.* .*.struct.student.*add_rec.(struct.student.*head_ptr);.* .*.strutct.student.*delete_rec.(struct.student.*head_ptr);.* .*.struct.student.*load_rec.(void);.* .*.void.save_rec(struct.student.*head_ptr);.*
.*.struct.student.*search(struct.student.*head_ptr); .*.void.print(struct.student.*head) .**************************************************************/ .#include. .#include.
.#include. .#include.
.#include."record_manage.h"
.int.node_num;................./*node.counter.*/
/* .*cre_reccreate.students'.record. .*/ .struct.student.*cre_rec(void)../*This.will.return.a.pointer.*/ .{
.struct.student.*head_ptr; .struct.student.*ptr1,.*ptr2; .node_num.=.0;
./* ..*initialize.linked. .*/
./* ..*allocate.space. .*/
.ptr1.=.ptr2.=.(struct.student.*)malloc(sizeof(struct.student)); .printf("Enter.a.G.R.NO(above.0):"); .scanf("%d",&ptr1> rno); .while.(ptr1> rno.<.0).{
.printf("\nThe.number.must.above.zero\n"); .printf("Enter.again:"); .scanf("%d",.&ptr1> rno.);
.} .printf("Enter.Name:"); .scanf("%s",.ptr1> name.); .printf("Enter.SEX(M.OR.F):"); .scanf.("%s",ptr1> sex); .printf("Enter.Class:"); .scanf.("%s",.ptr1> clas.); .printf("Enter.Address:"); .scanf.("%s",.ptr1> address.); .printf("Enter.Postalcode:"); .scanf("%d",.&ptr1> zip_code.); .printf("Enter.Telephone.Number:"); .scanf.("%ld",&ptr1> homei.); .printf("Enter.Maths.Score:"); .scanf.("%f",.&((*ptr1).score.Maths).);
.printf("Enter.English.Score:"); .scanf.("%f",.&((*ptr1).score.English).); .printf("Enter.Advanced.Programming.Languge:."); .scanf("%f",.&((*ptr1).score.Advan_lang_progr)..); .head_ptr.=.NULL; .while.(1){
.node_num.=.node_num.+.1; .if.(node_num.==.1)
head_ptr.=.ptr1; .else.ptr2> next_ptr.=.ptr1; .ptr2.=.ptr1; .ptr1.=.(struct.student.*)malloc(sizeof(struct.student)); .if.(ptr1.==.NULL).{
printf("out.of.memory\n"); exit(0); .}
./* ..*continue.to.initialize. .*/
.printf("Enter.G.R.NO(above.0.or.0.to.exit):"); .scanf("%d",&ptr1> rno); .if.(ptr1> rno.<.0).{
.printf("\nThe.number.must.above.zero\n"); .printf("Enter.again:"); .scanf("%d",.&ptr1> rno.);
.} .else.if(ptr1> rno.==.0)
.break; .else{ .printf("Enter.Name:"); .scanf("%s",.ptr1> name.); .printf("Enter.sex(M.OR.W):"); .scanf("%s",.ptr1> sex.); .printf("Enter.Class:"); .scanf("%s",.ptr1> clas.); .printf("Enter.Address:"); .scanf("%s",.ptr1> address.); .printf("Enter.Postalcode:"); .scanf("%d",.&ptr1> zip_code.); .printf("Enter.Telephone.Number:"); .scanf("%ld",.&ptr1> homei.); .printf("Enter.Maths.Score:"); .scanf("%f",.&((*ptr1).score.Maths).); .printf("Enter.English.Score:"); .scanf("%f",.&((*ptr1).score.English).);
.printf("Enter.Advanced.Programming.Languge:."); .scanf("%f",.&((*ptr1).score.Advan_lang_progr)..);
.} .} .ptr2> next_ptr.=.NULL;.............../*the.end.of.linked*/ .return.(head_ptr); .}; /*
.*add_recadd.student.record. .*/ .struct.student.*add_rec(struct.student.*head_ptr) .{
struct.student.*stu; struct.student.*ptr1,*ptr2,*ptr3; ptr1.=.head_ptr;................/*point.to.the.first.node*/ stu.=.(struct.student.*)malloc(sizeof(struct.student));
.../*point.to.the.insert.node*/ printf("INPUT.THE.INSERT.ITEM:\n"); printf("Enter.G.R.NO:"); scanf("%d",.&stu> rno); printf("Enter.Name:"); scanf("%s",.stu> name.); printf("Enter.sex(M.OR.W):"); scanf("%s",.stu> sex.); printf("Enter.Class:"); scanf("%s",.stu> clas.); printf("Enter.Address:"); scanf("%s",.stu> address.); printf("Enter.Postalcode:"); scanf("%d",.&stu> zip_code.); printf("Enter.Telephone.Number:"); scanf("%ld",&stu> homei.); printf("Enter.Maths.Score:"); scanf("%f",.&((*stu).score.Maths).); printf("Enter.English.Score:"); scanf("%f",.&((*stu).score.English).); printf("Enter.Advanced.Programming.Languge:."); scanf("%f",.&((*stu).score.Advan_lang_progr)..);
ptr2.=.stu;
if.((head_ptr.==.NULL)).{......./*NO.original.linked*/ head_ptr.=.ptr2;............/*ptr2.point.to.the.head*/ ptr2> next_ptr.=.NULL.;
} else{ while.((ptr2> rno.>.ptr1> rno.).&&.(ptr1> next_ptr.!=.NULL)){
ptr3.=.ptr1;............/*ptr3.point.to.the.same.with.ptr1*/
ptr1.=.ptr1> next_ptr.;./*ptr1.point.to.next*/ } if.(ptr2> rno.<=.ptr1> rno.).{
if(head_ptr.==.ptr1)head_ptr.=.ptr2;./*insert.to.the.first*/ else.ptr3> next_ptr.=.ptr2;../*insert.to.center*/ ptr2> next_ptr.=.ptr1;
}else{ ptr1> next_ptr.=.ptr2; ptr2> next_ptr.=.NULL;......./*insert.to.the.last*/
}
} node_num.=.node_num.+.1;.........................../*add.1.to.node.counter*/ return.(head_ptr);
.}
/* .*delete_recdelete.a.item.from.the.record. .*/ .struct.student.*delete_rec(struct.student.*head_ptr) .{
.struct.student.*ptr1,*ptr2; .int.num; .printf("Enter.the.G.R.NO.to.delete(Enter.0.to.exit):"); .scanf("%d",&num); .while(num.!=.0){
if(head_ptr.==.NULL){ printf("\nthere.is.no.record\n"); return.(0);
} ptr1.=.head_ptr; /*
.*ptr1.is.not.the.node.we.want. .*/
while(num.!=.ptr1> rno.&&.ptr1> next_ptr.!=.NULL){ ptr2.=.ptr1; ptr1.=.ptr1> next_ptr;
}./*goto.next.node*/
/* .*found.the.item. .*/
if(num.==.ptr1> rno){
if(ptr1.==.head_ptr)../*the.head.item.is.the.target*/ head_ptr=ptr1> next_ptr;
else.ptr2> next_ptr.=.ptr1> next_ptr;./*current.point.to.next.next.item*/
printf("delete:%d",num); node_num.=.node_num.1; ................/*decrease.one.item*/ } /*
.*item.not.found*
.*/ else.printf("there.is.no.%d.in.the.record\n",.num); printf("Enter.the.G.R.NO(0.for.exit):"); scanf("%d".,.&num);
.} .return.(head_ptr); .}
/* .*load_recload.all.record.from..file. .*/ .struct.student.*load_rec(struct.student.*head_ptr) .{
.char.fileop[20]; .struct.student.*ptr1,*ptr2; .int.m.=.0; .FILE.*in_file; .printf("Enter.File.Path.and.Name,please!~$"); .scanf("%s",fileop); .in_file.=.fopen(fileop,."r+"); .if.(in_file.==.NULL).{
.printf("cannot.open.file\n");............/*file.to.read*/
.return.(0); .} ./*
..*read.form.
.*/ .fscanf(in_file,."********************************************************\n"); .fscanf(in_file,."*...Communication.Book..*\n"); .fscanf(in_file,."*..AUTHOR:HUZHILI.CLASS:1.MAJOR:ELECTRONICENGINEER
*\n"); .fscanf(in_file,."********************************************************\n"); .fscanf(in_file,"\ n"); .fscanf(in_file,"NO.\tNAME\tSEXCLA\t\tADDRESS\t\tPOCO\tHTN\tMATHS.ENG.CP
\n"); .fscanf(in_file,"\ n"); ./*
..*print.form.
.*/ .printf("********************************************************\n"); .printf("*...Communication.Book..*\n"); .printf("*..AUTHOR:HUZHILI.CLASS:1.MAJOR:ELECTRONICENGINEER..*\n"); .printf("********************************************************\n"); .printf("\ n"); .printf("NO.\tNAME\tSEXCLA\t\tADDRESS\t\tPOCO\tHTN\tMATHS.ENG.CP\n"); .printf("\ n"); .m.=.m.+.1; .if(m.==.1){
ptr1.=.(struct.student.*)malloc(sizeof(struct.student));./*new.item*/
fscanf(in_file,"%d%s%s%s%s%d%ld%f%f%f",&ptr1> rno,.ptr1> name, ptr1> sex,.ptr1> clas,.ptr1> address,&ptr1> zip_code, &ptr1> homei,&ptr1> score.Maths,&ptr1> score.English, &ptr1> score.Advan_lang_progr);
./*read.and.print*/ .head_ptr.=.NULL; .do{
node_num.=.node_num.+.1; if(node_num.==.1)head_ptr.=.ptr1; else.ptr2> next_ptr.=.ptr1; ptr2.=.ptr1; ptr1.=.(struct.student.*)malloc(sizeof(struct.student));../*new.item*/ fscanf(in_file,"%d%s%s%s%s%d%ld%f%f%f",&ptr1> rno,.ptr1> name,
ptr1> sex,.ptr1> clas,.ptr1> address,&ptr1> zip_code, &ptr1> homei.,&ptr1> score.Maths,&ptr1> score.English, &ptr1> score.Advan_lang_progr);
/* .*Print.form.. .*/
printf("%d\t%s\t%s.%s\t%s.%d.%ld\t%.1f\t%.1f\t%.1f\t\n",ptr1> rno, ptr1> name,ptr1> sex,ptr1> clas,ptr1> address,ptr1> zip_code,ptr1> homei, ptr1> score.Maths,ptr1> score.English,ptr1> score.Advan_lang_progr);
.}while(!feof(in_file)); .ptr2> next_ptr.=.ptr1; .ptr1> next_ptr.=.NULL; .node_num.=.node_num.+.1; .} .printf("\ n"); .fclose(in_file);/*end.load,.close.file*/ .return.(head_ptr);
.};
/* .*save_recsave.record.to.a.file. .*/ .int.save_rec(struct.student.*p1) .{
.FILE.*fp;
.char.filepn[20];
.printf("Please.Enter.File.Path.and.Name:~$"); .scanf("%s",filepn); .if((fp=fopen(filepn,"w+"))==NULL){
.printf("Fail.to.open.file!\n");
.return.0; .} .fprintf(fp,."********************************************************\n"); .fprintf(fp,."*...Communication.Book..*\n"); .fprintf(fp,."*..AUTHOR:HUZHILI.CLASS:1.MAJOR:ELECTRONICENGINEER..*\n"); .fprintf(fp,."********************************************************\n"); .fprintf(fp,"\ n"); .fprintf(fp,"NO.\tNAME\tSEXCLA\t\tADDRESS\t\tPOCO\tHTN\tMATHS.ENG.CP\n"); .fprintf(fp,"\ n"); ./*PRINT.FORM.AREA*/ .while(p1!=NULL){
.fprintf(fp,"%d\t%s\t%s.%s\t%s.%d.%ld\t%.1f\t%.1f\t%.1f\t\n",p1> rno, .p1> name,p1> sex,p1> clas,p1> address,p1> zip_code,p1> homei, .p1> score.Maths,p1> score.English,p1> score.Advan_lang_progr);
.p1=p1> next_ptr;/*NEXT.NODE*/
.} .fclose(fp); .printf("FILE.SAVED!\n"); .return.0;
.}
/* .*searchdesigned.to.make.a.quick.search. .*/ .struct.student.*search(struct.student.*head_ptr) .{
.int.number; .struct.student.*ptr1,*ptr2; .printf("Enter.the.student's.G.R.NO(o.for.exit):"); .scanf("%d",&number.);
.while(number.!=.0) .{
.if(head_ptr.==.NULL){ printf("\nThere.is.no.record.here\n"); return.(head_ptr);
.} .printf("\ n"); .printf("NO.\tNAME\tSEXCLA\t\tADDRESS\tPOCO\tHTNMATHSENGCP\n"); .printf("\ n"); .ptr1=head_ptr; .while(number.!=.ptr1> rno.&&.ptr1> next_ptr.!=.NULL){
ptr2.=.ptr1;
ptr1.=.ptr1> next_ptr; .} .if(number.==.ptr1> rno)
printf("..%d.%s..\t%s.%s...\t%s\t.%d.%ld.%.1f.%.1f.%.1f", .ptr1> rno,.ptr1> name,.ptr1> sex,ptr1> clas, .ptr1> address,.ptr1> zip_code,.ptr1> homei, .ptr1> score.Maths,head_ptr> score.English, .ptr1> score.Advan_lang_progr.);
.else.printf("%there.is.no.%d",number); .printf("Enter.number.(Enter.0.to.exit)"); .scanf("%d",&number); .} .printf("STATE:exited\n"); .return.(head_ptr);
.}
/* .*printprint.the.record. .*/ .void.print(struct.student.*head_ptr) .{
.struct.student.*ptr; .if(head_ptr.==.NULL) printf("THERE.IS.NO.RECORD!\n");
.else{ printf("These.%d.records.are:\n",node_num); printf("\ n"); printf("NO.\tNAME\tSEXCLA\t\tADDRESS\tPOCO\tHTNMATHSENGCP\n");
ptr=head_ptr; do{
printf("..%d.%s..\t%s.%s...\t%s\t%d.%ld.%.1f.%.1f.%.1f\n", .ptr> rno,.ptr> name,.ptr> sex,ptr> clas, .ptr> address,.ptr> zip_code,.ptr> homei,
.ptr> score.Maths,ptr> score.English, .ptr> score.Advan_lang_progr.); .printf("\ n");
.ptr=ptr> next_ptr;../*go.to.next.item*/
}while(ptr.!=.NULL);./*END.PRINT*/ .} .}
/* .*statisticscomputer.single.person.average.score., .single.subject.average
.*...MAX.total.score,.and.Min.total.score. .*/ .struct.student.*statistics(struct.student.*head_ptr)
.{ .float.sum1.=.0,.sum2.=.0,.sum3.=.0; .float.ave1.=.0,.ave2.=.0,.ave3.=.0; .float.max.=0,.min.=0; .struct.student.*ptr; .int.y.=.0,.i.=.0; .int.x; .int.j.=.0; .ptr.=.head_ptr; .while(j.<.80){
.printf("*");
.j++; .} .printf("1.SINGLE.STATISTICS.\t2.SINGLE.SUBJUCT.AVERAGE.\n"); .printf("3.HIGHEST.TOTAL\t\t4.LOWEST.TOTAL.\n"); .printf("0.ENTER.O.TO.EXIT\t\n"); .while(j.>.0){
.printf("*");
.j; .} .printf("Please.Choose.one.item:"); .scanf("%d",&x); .getchar(); .switch(x){ .case.0:break; .case.1:if(head_ptr.==.NULL){
...printf("\nThere.is.NO.record.now!\n"); ...return.(head_ptr); }/*NO.linked*/ ....else.{
printf("\ n"); printf("NO.\tNAME\tMATHS\tENG\tCP\tTOTAL\tAVEREGE\t\n"); printf("\ n"); while.(ptr.!=.NULL){
/*caculate.single*/ sum1.=.ptr> score.Maths.+.ptr> score.English.+.ptr
>score.Advan_lang_progr; ave1.=.sum1/3; printf("%d\t%s\t%.1f\t%.1f\t%.1f\t%.1f\t%.1f\t",ptr> rno,
ptr> name,ptr> score.Maths,ptr> score..English,
ptr> score..Advan_lang_progr,sum1,ave1.); /*PRINT.RESULT*/ printf("\ n"); ptr.=.ptr> next_ptr;
} } return.(head_ptr); break;
.case.2:if(head_ptr.==.NULL){ printf("\nThere.is.NO.record.now!\n"); return.(head_ptr);
}/*NO.LINKED*/
while(ptr.!=.NULL){ sum1.=.sum1.+.ptr> score.Maths; sum2.=.sum2.+.ptr> score.English; sum3.=.sum3.+.ptr> score..Advan_lang_progr.;/*Caculate.total*/ y.=.y.+.1; ave1.=.sum1/y; ave2.=.sum2/y; ave3.=.sum2/y;......../*Caculate.average*/ ptr.=.ptr> next_ptr;../*Next.node*/
} printf("AVERAGE.OF.MATHS:%.1f\n",ave1); printf("AVERAGE.OF.ENGLISH:%.1f\n",ave2); printf("AVERAGE.OF.CP:%.1f\n",ave3); return.(head_ptr); break;
.case.3:if(head_ptr.==.NULL){ printf("\nThere.is.NO.record.now!\n"); return.(head_ptr);
} max.=.ptr> score..Maths.+.ptr> score..English.+ptr> score..Advan_lang_progr.; while(i.<.node_num){
i.=.i.+.1; sum1.=.ptr> score..Maths.+.ptr> score..English.+.ptr> score
.Advan_lang_progr.; if(max.<.sum1) max.=.sum1;
ptr.=.ptr> next_ptr.; } printf("HIGHEST.TOTAL.SCORE:%.1f\n",max); return.(head_ptr); break;
.case.4:if(head_ptr.==.NULL){ printf("\nThere.is.NO.record.now\n!"); return.(head_ptr);
} while(ptr.!=.NULL){ min.=.ptr> score..Maths.+.ptr> score..English.+.ptr> score .Advan_lang_progr.; while(ptr.!=.NULL){ sum2.=.ptr> score..Maths.+.ptr> score..English.+.ptr> score .Advan_lang_progr.; if(min.>.sum2) min.=.sum2; ptr.=.ptr> next_ptr;
} } printf("LOWEST.OF.TOTAL:%.1f\n",min); return.(head_ptr); break;
.default:printf("Error!Try.again,please!\n"); .} .return.(head_ptr);
.}
5.COMBK.c— 主文件. /************************************************************** .*This.is.the.main.function.of.the.project...* .*It.will.display.a.menu.to.choose...* .*By.that,it.can.complete.some.* .*managemet.of.Communication.book...* .* .*Functions
.* menudisplay.a.menu. .* mainno.need.to.say. .************************************************************/ .#include. .#include. .#include."sys_log.h"
.#include."record_manage.h"
/* .*log_managemanage.the.log.infomation. .*/ .void.log_manage(int.opera) .{
.int.i; .printf("\t\tWELCOME.TO.LOG.PART\n");
.while.(opera){
.for.(i.=.0;.i.<=.50;.i++.){
.printf("*"); .} .printf("\n\t1.Add.or.change.password\n"); .printf("\t2.View.log.infomation\n"); .printf("\t3.Delete.the.log.file\n"); .printf("\t4.Enter.0.to.exit\n"); .for.(i.=.0;.i.<=.50;.i++).{
.printf("*"); .} .printf("\nPlease.choose.an.item:"); .scanf("%d",.&opera); .switch(opera){
.case.0:break; .case.1:add_chg_passwd(); break; .case.2:view_log("log.txt"); break; .case.3:del_lfile("log.txt"); break; .default:printf("Enter.error!\nTry.again,please!"); .} .} .}
/* .*menudisplay.a.menu.to.choose.operetion. .*/ .int.menu(int.opera) .{
.struct.student.*head_ptr.=.0; .struct.student.*stud.=.0;
.int.i; .while(opera){ ./*
..*Give.an.operation.info.
.*/ .printf("\t\t\t\tCommunication.Book\n"); .printf("\t\t\t\t.Author:HUZHILI\n"); .for.(i.=.0;.i.<80;..i++){
.printf("*"); .} .printf.("\n\t\t\t\tWELCOME.TO.COM_BOK!\n"); .printf.("\t1.Enter.student.Info\t\t\t2.Load.From.File\n"); .printf.("\t3.Search.Student.Info\t\t\t4.Delete.Student.Info\n"); .printf.("\t5.Add.Student.Info\t\t\t6.Display.Student.Info\n"); .printf.("\t7.Statistics\t\t\t\t8.Log.Management\t\t"); .printf.("\t9.Save.Changes.\t\t\t\t10.EXIT\n"); .for.(i.=.0;.i.<.80;.i++).{
.printf("*"); .} .printf("\nPlease.choose.an.operation:"); .scanf("%d",&opera); ./*completement.the.operetion*/ .switch(opera){
.case.1:head_ptr.=.cre_rec();............../*create.linked*/ break; .case.2:head_ptr.=.load_rec(head_ptr);...../*load.linked*/ break; .case.3:head_ptr.=.search(head_ptr);......./*search.linked*/ break; .case.4:head_ptr.=.delete_rec(head_ptr);.../*delete.item*/ break; .case.5:head_ptr.=.add_rec(head_ptr);....../*add.an.item*/ break; .case.6:print(head_ptr);.................../*print.the.linked*/
break; .case.7:statistics(head_ptr);............../*.Give.a.statistics*/ .case.8:log_manage(opera);....................../*manipulate.log.info.*/
break; .case.9:save_rec(head_ptr);.............../*save.changes*/ .break; .case.10:save_logout("log.txt");............/*logout.system*/ exit.(8);
.default:printf("Enter.error\nTry.again,.please!"); .} .}
.return.(0);
.} /*
.*mainthe.main.function.of.the.project.
.*/
.int.main(void)
.{
.int.opera.=.1;
.FILE.*ptr;
.ptr.=.fopen("pwd.dat","rb");
.if(.ptr.==.NULL){
printf("There.is.no.password,Please.add.one\n");
add_chg_passwd();
.}
.else.passwd();
.save_login("log.txt");
.menu(opera);
.return.(0);
.}
主要心得与体会:
这是第一次做程序设计,根据实际问题进行分析求解,而且初次使用了模块化设计,大大的方便 了实际工作,根据所学的的C 语言知识,加上自己的思考,设计出一点东西,感觉真不錯,在分析问 题时,要想象实际的工作生活需要,进行改进,使这个程序更加符合要求。在求解问题的时候, 运用自顶至下,逐步求精的方法,首先设计好具体那个模块实现那些功能以及相应的数据要 求,写出初次企划方案,要后根据这个方案进行初步的代码设计,实现部分功能,在实际编 码的过程中,取得要领,根据实际进行改进,在初步实现了某些功能的时候,就进行全面的 编码工作,同时,这时也想到了,一些可以实现的额外功能,就开始有意识的猜想,然后就 就加的功能写代码,最终完成初始代码编辑工作,从而开始测试,在测试的过程中发现漏洞 和错误,同时这时也开始了漫长的DEBUG 阶段,由于初次做这样的大作业,对C 语言也是 才学了半个学期,完全没有什么程序设计经验,这时的工作对我来说就变得很漫长的拉,这 时候,这是不明白怎么会有这么多的错误呀!真是想一脚把它们踢开,想到BUG 真是是一些 讨厌的东西!不过在这段过程中,我认为自己是学到最多的时候,正所谓要在困难中成长, 迎难而上,这些错误,真是可爱有可恨,以前从来没有想到DEBUG 会是这么神奇的事,它 们就像一群寄生虫一样,程序的产生,成长,发展,它们也跟着产生,成长,发展,对于我 的小程序,它们可是无孔不入呀!刚刚改完这里,哪里又不知不觉产生了BUG 了,真是够意 思的家伙。好在,在长思漫想中,它们初步清除了,起码我的程序可以运行了,通过了编 译,在往后的测试中,又有很多的东东需要改进,然而,这是挺那个的,就像在对它们说: “来呀,小弟,等着你们这群家伙哟”。在多次的测试中,感觉对自己的基础有了很大坚固, 这就是还得要感谢它们的原因了。另外,自己也发现了几个不會的问题,没有能够解决,这 就要在以后的学习中努力了。对于简化代码,觉得有时候,清晰点也不错的,不是很大的影 响效率,应该没有什么问题吧。最后,注明一下,之所以用英文写程序,是自己不想经常换 切换输入法,加上这样能练练英语,虽然,有错误这是一定的啦,但是起码比不敢写好点, 这是自己的个人观点,呵呵。

Entry for November 18, 2006

0 评论

It is really a specil day.I go to shopping with my two of best friends ,dengweiming and liangrongjia in the afternoon.Before that,i took them to the sixth students' retaurant.And i showed them around in my great campus.Of course,they appreciated where i took them to.At about 2:31,i rushed home from tianhe shopping mall.Because there was going to be a football match which i would took part in.Though i was not a main force in the team,i was with great great enthusiasm.That results i was a foreign aid to them.However,with 1:0 leading to end half court,we were catch up soon after the beginning of second half.And that was the final record.It was a wonderful match!And we all enjoy the pleasant sensation which brought to us.

Entry for November 17, 2006

0 评论

A Short History of JavaThis section gives a short history of Java's evolution. It is based on various published sources (most important, on an interview with Java's creators in the July 1995 issue of SunWorld's on-line magazine).Java goes back to 1991, when a group of Sun engineers, led by Patrick Naughton and Sun Fellow (and all-around computer wizard) James Gosling, wanted to design a small computer language that could be used for consumer devices like cable TV switchboxes. Because these devices do not have a lot of power or memory, the language had to be small and generate very tight code. Also, because different manufacturers may choose different central processing units (CPUs), it was important that the language not be tied to any single architecture. The project was code-named "Green."The requirements for small, tight, and platform-neutral code led the team to resurrect the model that some Pascal implementations tried in the early days of PCs. Niklaus Wirth, the inventor of Pascal, had pioneered the design of a portable language that generated intermediate code for a hypothetical machine. (These are often called virtual machines—hence, the Java virtual machine or JVM.) This intermediate code could then be used on any machine that had the correct interpreter. The Green project engineers used a virtual machine as well, so this solved their main problem.The Sun people, however, come from a UNIX background, so they based their language on C++ rather than Pascal. In particular, they made the language object oriented rather than procedure oriented. But, as Gosling says in the interview, "All along, the language was a tool, not the end." Gosling decided to call his language "Oak" (presumably because he liked the look of an oak tree that was right outside his window at Sun). The people at Sun later realized that Oak was the name of an existing computer language, so they changed the name to Java. This turned out to be an inspired choice.In 1992, the Green project delivered its first product, called "*7." It was an extremely intelligent remote control. (It had the power of a SPARCstation in a box that was 6 inches by 4 inches by 4 inches.) Unfortunately, no one was interested in producing this at Sun, and the Green people had to find other ways to market their technology. However, none of the standard consumer electronics companies were interested. The group then bid on a project to design a cable TV box that could deal with new cable services such as video on demand. They did not get the contract. (Amusingly, the company that did was led by the same Jim Clark who started Netscape—a company that did much to make Java successful.)The Green project (with a new name of "First Person, Inc.") spent all of 1993 and half of 1994 looking for people to buy its technology—no one was found. (Patrick Naughton, one of the founders of the group and the person who ended up doing most of the marketing, claims to have accumulated 300,000 air miles in trying to sell the technology.) First Person was dissolved in 1994.While all of this was going on at Sun, the World Wide Web part of the Internet was growing bigger and bigger. The key to the Web is the browser that translates the hypertext page to the screen. In 1994, most people were using Mosaic, a noncommercial web browser that came out of the supercomputing center at the University of Illinois in 1993. (Mosaic was partially written by Marc Andreessen for $6.85 an hour as an undergraduate student on a work-study project. He moved on to fame and fortune as one of the cofounders and the chief of technology at Netscape.)In the SunWorld interview, Gosling says that in mid-1994, the language developers realized that "We could build a real cool browser. It was one of the few things in the client/server mainstream that needed some of the weird things we'd done: architecture neutral, real-time, reliable, secure—issues that weren't terribly important in the workstation world. So we built a browser."The actual browser was built by Patrick Naughton and Jonathan Payne and evolved into the HotJava browser. The HotJava browser was written in Java to show off the power of Java. But the builders also had in mind the power of what are now called applets, so they made the browser capable of executing code inside web pages. This "proof of technology" was shown at SunWorld '95 on May 23, 1995, and inspired the Java craze that continues today.Sun released the first version of Java in early 1996. People quickly realized that Java 1.0 was not going to cut it for serious application development. Sure, you could use Java 1.0 to make a nervous text applet that moved text randomly around in a canvas. But you couldn't even print in Java 1.0. To be blunt, Java 1.0 was not ready for prime time. Its successor, version 1.1, filled in the most obvious gaps, greatly improved the reflection capability, and added a new event model for GUI programming. It was still rather limited, though.The big news of the 1998 JavaOne conference was the upcoming release of Java 1.2, which replaced the early toylike GUI and graphics toolkits with sophisticated and scalable versions that come a lot closer to the promise of "Write Once, Run Anywhere"™ than their predecessors. Three days after (!) its release in December 1998, Sun's marketing department changed the name to the catchy Java 2 Standard Edition Software Development Kit Version 1.2.Besides the "Standard Edition," two other editions were introduced: the "Micro Edition" for embedded devices such as cell phones, and the "Enterprise Edition" for server-side processing. This book focuses on the Standard Edition.Versions 1.3 and 1.4 of the Standard Edition are incremental improvements over the initial Java 2 release, with an ever-growing standard library, increased performance, and, of course, quite a few bug fixes. During this time, much of the initial hype about Java applets and client-side applications abated, but Java became the platform of choice for server-side applications.Version 5.0 is the first release since version 1.1 that updates the Java language in significant ways. (This version was originally numbered 1.5, but the version number jumped to 5.0 at the 2004 JavaOne conference.) After many years of research, generic types (which are roughly comparable to C++ templates) have been added—the challenge was to add this feature without requiring changes in the virtual machine. Several other useful language features were inspired by C#: a "for each" loop, autoboxing, and metadata. Language changes are always a source of compatibility pain, but several of these new language features are so seductive that we think that programmers will embrace them eagerly. Table 1-1 shows the evolution of the Java language.--FROM CORE JAVA 2

Entry for November 17, 2006

0 评论

This is the last week before i come to a practice called jingongshixi.It is the first time that i go to a workshop.I don't know what it will be like.But there is one thing that i can be sure of,it would be a hard work.And everything i do there will be marked by the teachers who teach at the workshop.Never there is a job like that we get no paid for working hard.Of course,it is an obligatory course.At the end of that, there will be an exam.However hard we work at first,the exam will take up 70% scores.So we will also study theory by ourself.I am at the very thirsty of that,because that means we needn't have regular course except English and Analog Circle.We may be free at most of the time.HA.
End

November 15, 2006

0 评论

Wo,whatever i want,whatever i do,failed by now.How could i receive so much criticism.I didn't mean that everyone, i just want to get myself ordered.Why do things so frequently go against me.i suspect having some someone who is dirty me .I have to think over my behavior.
I didn't learn anything about Java these day,because i have plenty of homework to do.I do feel guilty about that.I hava to make-up mathematics examination of last term in the 17th week.And i am going to take the examination of cet6,i must work hard for that for the reason that i didn't do very well in cet4.That all caused by my poor study-willing last term.I also have trouble in learning Analog Circle this term.But i have desided to make a home run!let's make it a promise.

Terrorists

0 评论

In the years following WWII a nation for the Jewish faith was created in their ancestral homeland. While this was indeed a noble gesture following the horrors many endured under the Nazi party during the war there was more to it than appeared at face value. The land set aside for Israel was unfortunately the homeland and holy land of another group of people, the Palestinians. An entire nation of people was summarily driven from its land and homes for the creation of the new country of Israel. While neighboring Arab countries were vehemently opposed to this invasion, the United States immediately recognized Israel as a nation followed closely by Great Britain, and both began supplying arms and training. Over the next 60 years Israel continued to expand in a series of wars, financed and armed by their foreign allies. Through the machinations of our mass media, Israel has come to be accepted as the victim of a ruthless terrorist campaign by the Palestinians. The fact that they are fighting merely to gain back the homes and holy land that were rightfully theirs is conveniently glossed over. Palestinian suicide bombers and the carnage wreaked by them upon civilians in Israeli marketplaces are commonly shown on the nightly news. What isn't shown are U.S. supplied Cobra helicopter gunships firing volley after volley of missiles into civilian Palestinian warehouses and communities, the thousands of Palestinians held without trial in Israeli prisons, and the Israeli settlements forever expanding into Palestinian land. While the U.K. ceased arms sales to Israel after the invasion of Lebanon, the U.S. is quite willing to ignore Israeli terrorism and its direct part in said undertakings for the foothold in the oil-rich Middle East Israel provides it. And now we wage war on even more of the Middle East in our so-called ‘war on terror,’ all the while hiding the hypocrisy from our own people.