dream

一个菜鸟程序员的成长历程

0%

数据库系统原理第七节

数据库设计

数据定义

连接数据库

mysql -u root -p

创建数据库

create database my_test;

查看数据库

show databases;

删除数据库

drop my_test;

进入数据库

use my_test;

表定义

创建表

数据表被定义为字段的集合
的格式存储
每一行代表一条记录
每一列代表记录中一个字段的取值

1
2
3
4
create [temporary] table tbl_name
(
字段名1 数据类型 [列完整性约束条件] [默认值]
)

修改表

1
ALTER TABLE table_name

字句

  • ADD [COLUMN] 子句
  • change [COLUMN] 子句
  • alter [column] 子句 修改或删除表中指定列的默认值
    • alter colum city set default ‘bj’
  • modify [column] 子句 只修改指定列的数据类型,不会干涉它的列名
    • modify column city char(50);
  • drop [column] 子句 删除指定列
    • drop column city;
  • rename [to] 子句 修改表名
    • rename to table_name
  • add index index_name(column_name) 创建索引
  • drop index index_name

修改表名:
rename table table_name to new_table_name

删除表

1
2
drop [temporary] table [if exists]

查看表

1
show colums from table_name;

索引定义

索引时提高数据文件访问效率的有效方法

缺点

  • 索引是以文件的形式存储的,如果有大量的索引,索引文件可能比数据文件更快达到最大的文件尺寸

  • 索引在提高查询速度的同时,会降低更新表的速度

  • index 或 key 普通索引

  • unique 唯一性索引 候选码

  • primary key 主键

创建索引

1
2
create [unique] index index_name
on table_name(index_col_name)

索引删除

drop index index_name on table_name

新概念英语第一册

21

祈使句

请给我一本书
give me a book please

请递给我一本书
pass me a book

pass me:递给

哪一本书
which book?

这一本书吗
this one?

红色的这本
the red one

不是那本
not that one

给你
here you are

语法

you give me a book
主语 谓语 宾语

主语:人称代词主格 i you he she we they
宾语:人称代词宾格 me you him her us them

单词

cup:杯子

glass:玻璃杯

bottle:瓶子

knife:刀

sharp:锋利的

blunt:钝的

fork:叉子

spoon:勺子

23

请给我一些玻璃杯
give me some glasses please

some glasses: 直接宾语
me: 间接宾语

架子上这些吗
the ones on the shelf

on : 介词 在…上面

on the shelf: 介词短语用来修饰名词

on the floor: 在地板上

25

这是一个冰箱
there is a refrigerator

在厨房里面
in the kitchen

in:介词,在…里面

in the kitchen:介词短语 在厨房里面

in the middle of the room:复合介词,在房间的中间

这个杯子在桌子上
there is cup on the table
变疑问句
is there cup on the table?

他在哪?
where is it?

单词

refrigerator:冰箱
fridge:冰箱

electric cooker: 炊具

27

在电视上有一些杂志
there are some magazines on the television

照片在墙上
the pictures are on the wall

on the wall:在墙上

near the window:离窗户很近

near the … : 介词,离…很近

他们在哪里
where are they

there is a …

there are some ..
变疑问句
are there any …?
变否定句
there are not any …?

some 疑问和否定变 any

单词

armchair: 扶手椅

bowl:碗

cooker:炉子

29

请关门,祈使句
shut the door,please

铺床
make the bed

给化妆桌除尘
dust the dressing table

扫地
then sweep the floor

给房间通风
air the room

我必须要干什么?
what must i do?

must:情态动词,必须要,不可推卸

我一定要打扫我的房间
i must tidy my room

我必须要努力学习
i must study hard

打开电视
turn on the TV

短语动词
turn on: 打开…
turn off: 关闭…

穿上大衣
put on the coat
put on: 穿上…
take off: 脱下…

形容词做动词

empty :空的
这个杯子不是空的,倒空他
the cup is not empty, empty it!

clean
这个窗户不干净,弄干净他
the window is not clean. clean it!

shut
这个们没关上,关上他
the door is not shut, shut it!

open
这个窗户没打开,打开它
the wardrobe is not open.open it!

单词

wardrobe:衣柜

dust:给…除尘,灰尘

tidy:把…变整洁,整洁

untidy:不干净的,不整洁的

31

xxxx 在哪里?
where is xxxx?

she is …

Tim 在公园里面吗?
is Tim in the garden?

现在进行时的疑问句
what’s she doing?

他现在正在树下面坐着
she’s sitting under the tree

现在进行时 be + ing

he is climbing the tree

现在分词 +ing

e 结尾的去 e + ing

辅音+元音+辅音的 双写辅音字母 + ing

短语动词,追逐
running after

看….东西
looking at

33

今天是很好的一天
it’s a lovely day today

今天的天气很好
it’s lovely weather today

there be 这有,天空中有一些云
there are some clouds in the sky

jones和他的家人在一起
Mr.jones is with his family

他们正在桥上散步
they are walking over the bridge

what are the children doing?

they are doing …

单词

with:介词,和…在一起

over the bridge:在桥上

boat: 船

river: 河

ship: 轮船

aeroplane: 飞机

over: 在 … 上面,不接触的

over the river: 在河上空

on the river: 在河上,在河表面

wash dishes: 洗盘子

wait for: 等 …

35

这是一张 我们的村庄 的照片
this is a photograph of our village

our village is in a valley

单词

photograph: 照片

village: 村庄

valley: 山谷

hills: 小山丘

alone: 沿着…

banks of the river: 河岸

across:

beside: 在…旁边

out of: 从 … 出来

into: 进入…

37

你工作很努力
you are working hard

be going to: 一般将来时

你接下来要干啥?
what are you going to do now?

我要给他上颜色了
I’m going to paint it.

你现在正在干什么?
what are you doing now?

回答:i’m listening to music

I’m going to paint it pink
i:主语
paint:谓语动词
it:宾语
pink:宾语补足语

这个书架不是给我的
this bookcase isn’t for me

单词

hard: 副词 adv,修饰动词,努力的

paint: 上色,上油漆

for: 给某人,为某人准备的

39

对那个花瓶做什么
to do with that vase

我不知道怎么办
i don’t konw what to do with it

对这个书做什么
do with a book

祈使句的否定形式
don’t do that

别摔了它
don’t drop it

双宾语 sb 间接宾语 sth 直接宾语
give sb sth
give sth to sb
比如:give me a book, give the book to me

give/show/send/take 都一样

send john that letter
send that letter to john

使用it 把 it 放中间
turn on the TV = turn it on
turn off the TV = turn it off
put on your trousers = put it on
take off your shoes = take it off

41

那个包重吗
is that bag heavy

is there a … in/on that …?

在房间里有一个椅子吗?
is there a chair in that room?

桌子上有一个花瓶吗?
is there a vase on that table?

不可数名词 a 替换成 any

are there any … in/on that …?

there are some … in/on that …

is there any … in/on that …?

短语

p piece of 一片/一块

a loaf of 一条/长条

a bar of 一块

a bottle of 一瓶

a pound of 一磅

half 一半

a qurater of 四分之一

a tin of tobacco 一听烟丝

单词

certainly 当然

43

你能泡茶吗
can you make the tea?

i can’t see any … 可以接可数名词复数也可以接不可数名词

短语

boil the kettle 烧水

hurry up 快点

单词

teapot 茶壶

behind 在 … 后面

45

你能过来一下吗
can you come here a minute please?

她能为我打一下这个信吗
can she type this letter for me?

47

49

51

what’s sth like = be + like = 像什么。。。,什么样子的

在你的国家气候是什么样子的?
what’s the climate like in your country?

单词

climate: 气候

pleasant: 宜人的

Brazil: 巴西

Brazilian: 巴西人

Holland: 荷兰

Dutch:荷兰人

Norway: 挪威

Norwagian: 挪威人

Spain: 西班牙

Spanish: 西班牙人

Sweden: 瑞典

Swedish: 瑞典人

53

你最喜欢哪个季节?
which seasons do you like best?

单词

mild: 温和的

season: 季节

rise: 升起

early: 早期的

late: 晚的

Australia: 澳大利亚

Australian: 澳大利亚人

Austria: 奥地利

Austrian: 奥地利人

Finland: 芬兰

Finnish: 芬兰人

India: 印度

Indian: 印度人

Nigeria: 尼日利亚

Nigerian: 尼日利亚人

Turkey: 土耳其

Turkish: 土耳其人

Poland: 波兰

Polish: 波兰人

Thailand: 泰国

Thai: 泰国人

55

你经常做什么?
what do you usually do (in the morning/afternoon/evening)?

单词

57

现在正在做某事…
be + v.-ing

现在什么时间?
what’s the time now?
what time is it?

单词

unurual : 不寻常的

at the moment: 此时此刻

59

你有一些手写纸吗?
do you have any writing paper?

这就是你要的所有东西了吗?
is that all?

其他人呢?
who else?

其他东西呢?
anything else?

单词

envelope: 信封

glue: 胶水

writing paper: 书写纸

pad: 便签

chalk: 粉笔

size: 型号,尺寸

else: 其他

wine: 红酒

61

他怎么了?
what’s the matter with him?

他还好吗?
Is he all right?

she has a headache

单词

feel: 感觉,联系动词,后面可以跟形容词

ill: 生病的,不舒服的

sick: 生病的

sad: 悲伤

stay in bed: 卧床

bad cold: 重感冒

good news: 好消息

stomach: 肚子

stomach ache : 肚子疼

medicine: 药

take some medicine: 吃点药

see a docter: 看医生

have a temperature: 发烧

flu: 流感

measles: 麻疹

63

我能看看他吗
can i see him please

can + 动词原形

他可以每天下床两小时
he can get up for about two hours each day

单词

better: well的比较级,比上次更好点

yet: 仍然,一般用于否定句中

rich food: 大鱼大肉,油腻的食物

light food: 轻食

aspirins: 阿司匹林

take an aspirins: 吃阿司匹林

lean out of : 身体探出。。。

65

一般将来时
be going to do 你将要干什么

你不能晚回家
you mustn’t come home late.

具体时间用 at
日期用on
月份年份用in

单词

be home: 在家

come home: 回家

half past ten: 10点半

quarter past eleven: 11点十五

past: 过了

quarter to eleven: 10点45

half to ten: 9点半

67

一般过去时
你刚才在肉店吗?
were you at the butcher’s?

单词

过去式
am - was
is - was
are - were

greengrocer: 蔬菜商人

last week: 上周

absent: 缺席

in the country: 在乡下

aren’t you luckly!: 你真幸运!

69

回家的路上
on the way home

单词

race: 比赛,竞赛

handreds of: 成百上千

finish:完成,最后,结局

stationer’s:文具店

71

他昨天给我打了4次电话
he telephoned me four times yesterday

前天给我打了3次电话
and three times the day before yesterday

过去式
规则动词 + ed
不规则动词

单词

yesterday: 昨天

the day before yesterday: 前天

four times: 四次

last night: 昨天晚上

the night before last: 前天晚上

73

他很不了解伦敦
she does not know London very well

单词

very well:很好,非常好,修饰know,表示程度

lose: 过去式 lost 丢失

suddenly: 突然地

see: 过去式 saw

pleasantly: 副词,修饰动词,表示程度,开心的,愉快地,舒服的

speak: 过去式 spoke

phrasebook: 短语书

take: 过去式 took

slowly: 慢慢的

hurriedly: 副词,匆忙地

badly:副词,严重的

give-gave

drink- drank

thirstily: y 结尾 变i加ly 很渴的

meet-met

warmly: 温暖的,热情的

swim-swam

75

他是在这里买的吗?
did she buy them here?

我恐怕没办法帮你
I’m afraid that i can’t

我恐怕。。。
i’m afraid …

你在什么时候做了什么事情
when did you …?

单词

a month age: 一个月之前

afraid: 恐怕

jump off: 跳下

77

你不能一直等到下午吗?
can’t you wait till this afternoon?

单词

appointment: 预约

urgnet: 紧急的,急迫的

awful: 糟糕的

till: 一直到…

79

much + 不可数名词 在否定和疑问句中表示没有很多了,只有一点了

many + 可数名词 在否定和疑问句中表示没有很多了,只有一点了

any 在否定句中表示一点也没有了

at all 在否定句中表示一点也没有了

单词

a lot of : 大量的,许多的

haven’t got = don’t have: 没有

jam: 果酱

groceries: 杂货,零食

newsagent: 报刊亭

stationery: 文具

chemist: 药剂师,化学家

81

be + doing : 现在进行时,现在正在做某事

have a cigaretee 抽个烟吧

have a glass of whisky 喝杯威士忌吧

have + 名词 替代相应的动作

have a bath 洗澡吧

have dinner 吃完餐吧

have a lesson 上个课吧

have a good time 玩的开心

单词

whisky: 威士忌

roast: 烘焙,烤

video game: 电子游戏,视频游戏

postcard: 明信片

83

你想和我们一起吃午餐吗
do you want to have lunch with us?

现在完成时 have/has + 过去分词
我已经吃了午餐
I have already had lunch

不好意思,让你看到这么乱
Excuse the mess

我已经吃了一些…
I’ve already had some …

我已经吃了一个了
I’ve already had one

some + 不可数名词 one 是可数名词

变疑问句

你吃过午餐了吗
have you had lunch yet?

yet 用于现在完成时,表示到现在为止吃过午餐了吗

have you had any vegetables or fruit? 你到现在吃蔬菜或水果了吗?
i haven’t had any vegetables 我没有吃蔬菜
i’ve just had some fruit 我仅仅吃了一些水果 just:仅仅

单词

mess: 混乱,乱的

untidy: 不整洁的

suitcase: 行李箱

85

你刚刚去看过电影了吗
have you just been to the cinema?
yes i have

你刚刚去过…
Have you just been to …

现在有什么电影上映?
What’s on?

我从未去过这里
i’ve never been there

你曾经去过这里吗?
have you ever been there?

单词

just: 刚刚,不久

never: 从未

ever: 曾经

87

我的车准备好了吗?
is my car ready yet?

那个不是你的车吗?
isn’t that you car?

你做过什么事情了吗?
have you … yet?

单词

bring: 带来

mechanics: 机械师,修理工

still: 仍然

garage: 车库

crash: 车祸

lamp-post: 路灯

repair: 修理,修补

89

我相信这个房子是待售的,that引导的从句,that引导的我相信的内容
i believe that this house is for sale

我可以看看他吗? may引导的疑问句,表示有礼貌的
may i have a look at it, please?

你居住在这里多久了? 回答要用现在完成时
How long have you lived here?

我已经居住在这里20年了 have lived 现在完成时,回答how long用for + 一段时间
i have lived here for twenty years

我自从1976年开始就在这里了
i have been here since 1976

他值得每一个便士
it’s worth every penny of it

单词

for sale: 待售的

since: 自从

retire: 退休

cost: 成本,花费,代价

worth: 价值,值得

decide: 决定

last word: 最后的话,遗言

91

他到现在为止一直是一个好邻居
he has always been a good neighbor

一般将来时
will + do

我将来会想她的
i’ll miss him

你今天要去看lan吗
will you see lan today

单词

neighbor: 邻居

the day after tomorrow: 后天

poor: 贫穷的,可怜的

the night after next: 后天晚上

93

你下个月要去东京吗
will you go to Tokyo next month?

不,我们不是下个月去,will 的否定用 won’t
No, we won’t go to Tokyo next month

单词

next-door: 下一家

pilot: 飞行员

the month after next: 下下个月

at the moment: 此时此刻

Madrid: 马德里

the week after next: 下下周

Athens: 雅典

Berlin: 柏林

Geneva: 日内瓦

Moscow: 莫斯科

Rome: 罗马

Seoul: 汉城,首尔

Stockholm: 斯德哥尔摩

Sydney: 悉尼

Tokyo: 东京

95

请给我两张去伦敦的往返车票
two return tickets to London,please

赶火车
catch the train

我们想要赶8点19去伦敦的火车
we want to catch the eight nineteen to London

等待某人…
wait for sb

in + 一段时间表示未来一段时间内
i will go to Beijing in a year’s time

单词

plenty of:大量的,很多的

had better: 最好…

exact: 确切的,精确的

exact time: 确切的时间

97

我那天在去往伦敦的火车上落下的箱子
i left a suitcase on the train to London the other day

is this case yours?

No, that’s not mine

yours 是名词性物主代词 = your suitcase = 形容词性物主代词 + 名词
mine = my suitcase

属于谁…
belong to …

单词

the other day: 那天

zip: 拉链

belong: 属于

99

单词

slip: 滑到

sure: 确信的,确切的

101

你知道 他是YHA的成员
you know he’s a member of the Y.H.A

单词

youth: 青年

member: 成员

association: 协会,社团

speak up: 大点声

103

英语和数学试卷对我来说不是足够简单的
the english and Maths papers weren’t easy enough for me

单词

exam: 考试

easy enough: 足够简单

enough: 足够的

fail: 失败,挂科

too: 过于

rest: 剩余的

difficult: 困难的

hate: 恨

mark: 分数,记号,标记

cheer up: 振奋一点,开心一点

105

to + do = 动词不定式 可以用来做宾语

我想要某人做某事
i want you to do

告诉某人做某事
tell you to do

i don’t want you to do

tell you not to do

单词

at once: 马上来

intelligent: 聪明的

be full of: 充满了…

present: 礼物

correct: 正确,修正,纠正

107

你想试一下吗?
Would you like to try it?

形容词比较级 + than
他比那个蓝色的更小
it’s smarller than the blud one

pretty 变比较级 y 变 i 加 er = prettier

large 变比较级 直接 + r = larger

最高级 + the

smarll - smarller - smarllest

large - larger - largest

tall - taller - tallest

hot - hotter - hottest

heavy - heavier - heaviest

单词

smart: 漂亮的,时髦的

smarller: 比…更小

suit: 适合

at all: 否定句最后表示一点也不

compare: 比较

crowd: 人群

ever seen: 见过

109

a little: 一点点 + 不可数名词

a few: 一点点 几个 + 可数名词

what a pity!

what + 名词

数量比较

不可数名词,多
much - more - the moest

litte - less - the least

few - fewer - fewest

形容词比较级

good - better - best

bad - worse - worst

单词

teaspoonful: 满茶勺

pity: 可怜,遗憾

instead: 代替,反而

advice: 建议

111

他多少钱?
how much does it cost?

他没有贵的那个好 as … as
it’s not as good as the expensive one

青苹果和红苹果一样甜 as sweet as 一样甜
the green apple is as sweet as the red one

白车不如黑车干净,not as clean as 没有那个干净
the white car is not as clean as the black one

多音节形容词
difficult - more difficult - the most difficult
interesting - less interesting - the least interesting

单词

cost: 价格,成本

afford: 买得起

instalment: 分期付款

deposit: 储蓄,存款,订金

price: 价格,单价

113

我也没有 either 否定的也
i haven’t got any either

我也不能
neither can i = i can’t either

我们的乘客没有人能找开这个钱
none of our passengers can change this note

我有一些零钱
i’ve got some shall change

单词

small change: 小额零钱

fare: 票价,车费

Square: 广场

note: 笔记,注意,纸币

passenger: 乘客,旅客

either:两,二者之一

none: 没有任何,一点也不

neither: 两者都不,也不

shall: 将,将要

115

单词

复合不定代词
everything: 每个东西

impossible: 不可能的

anything: 任何东西

everyone: 每个人

everybody: 每个人

anyone: 任何人

someone: 某人

no one: 没有人

everywhere: 每个地方

nowhere: 无处,到处都无

117

过去进行时 was/were + doing

过去完成时 had + 过去分词

出来的小男孩
out little boy

那天早上晚些时候
later that morning

但是我还没有看到任何变化
but i haven’t had any change yet

正当我开门的时候,电话响了
just as i was opening the front door, the telephone rang

单词

dining room: 餐厅

look for: 寻找

swallow: 吞,吞噬,吞咽

toilet: 洗手间,厕所

rang: 响了

just as: 正当…

while: 正当… 只能接过去进行时

119

我的一个朋友
a friend of mine

怎么啦
what’s up?

单词

thief: 小偷

torch: 火把,手电筒

exercise: 练习,锻炼,训练,习题

121

戴着帽子的男人, in a hat 定语从句 戴帽子的
the man in a hat

站在柜台后面的这个女士 who 引导定语从句 指示人
the lady who is standing behind the counter

在柜台上的这本书 which 引导定语从句,指示物的位置
the books which are on the counter

that 引导的定语从句,关系代词,既可以指示人也可以指示物
is this man that you served

单词

counter: 柜台

recognize: 认出,辨认

123

看,Scott,这是我去澳大利亚旅游的照片 photograph在定语从句中做宾语,所以that可以省略
look,Scott,this is a photograph (that) i took during my trip to Australia

单词

during: 期间

bear: 胡子

125

我必须先给花园浇水
i must water the garden first

have to 将来时 will have to
过去式 had to
过去完成时 have had to

don’t need to: 我不需要做,有其他的选择
don’t have to: 我没有责任做,不必要做

单词

nuisance: 讨厌的人

have to: 必须 表示客观的必须

immediately: 立即,马上

127

must还可以表示猜测 我猜是…
i must be …

Karen Marsh 看起来真老呀,不是吗!
Doesn’t Karen Marsh look old!

没有那么久
not that long ago

我自己还没有29那么大呢
i’m not more than twenty-nine myself

不可能
can’t be

他不可能生病
he can’t be ill

他一定是累了
he must be tired

单词

actress: 女演员

at least: 至少

129

must have been: 表示肯定,对过去的一件事情猜测

你肯定有开到每小时70米
you must have been driving at seventy miles an hour

我没有吧
i can’t have been

我肯定在梦游
i must have been dreaming

单词

wave: 波浪,海浪,挥手

overtake: 超过

speed limit: 限速

131

度假
spend your holidays

我们不能下决心 make up sb minds
we can’t make up our minds

别那么确定
don’t be so sure

我不确定
I’m not sure

may be: 可能
may have been: 过去可能,用在过去发生的事情里面

单词

aborad:国外

by sea: 坐船

by air: 坐飞机

cheap: 便宜的

might not: 也许不会

look after: 照顾

take care of sb: 照顾某人

in the end: 到最后

133

间接引语转述的时候,都要变成过去式

单词

sensational:轰动性的,爆炸性的

airport: 飞机场

mink: 貂皮

135

我拿不定主意
i can’t make up my mind

were going to 转述变成 would

can 转述变成 could

单词

get married:结婚

137

如果你赢了很多钱,你要怎么做? if 引导的条件状语从句 if前面是一般将来时,后面跟一般现在时,主将从现
what will you do if you win a lot of money?

单词

football pools:足球赌注

nearly: 几乎

depend:依赖

depends on: 取决于…

seaside: 海边

139

我不知道我什么时候会完成 when 引导的从句
i don’t konw when i’ll finish

by the way: 顺便说一下

他想知道你是否累了,if表示是否的意思
he wants to know if you are tired

疑问句转述变成陈述句,用if引导

如果疑问句中有特殊疑问词,那么直接用特殊疑问词引导从句

141

被动语态 be + 过去分词
was invited to a children’s party

单词

middle-aged: 中年的

opposite: 对立的

curiously: 好奇的

powder: 粉

powder compact: 粉饼

put away: 收起来

kindly: 亲切的

amused: 被逗乐了

amuse: 动词,逗笑某人

143

我居住在一个被美丽的森林环绕着的老小镇 被动语态用by表示主语,正常语句是 beautiful woods is surround …
i live in a very old town which is surrounded by beautiful woods

ask to do … 要求做某事
游客 be asked被要求做某事 have been现在完成时,游客到现在一直被要求保持森林干净和整洁
visitors have been asked to keep the woods clean and tidy

垃圾筐现在已经被摆放在树下面
litter baskets have been placed under the trees

我所看到的使我非常难过
what i saw made me very sad

我数了数有7辆旧车
i counted seven old cars

cover with sth 被什么东西覆盖
地面被很多纸
ground was covered with pieces of paper

任何留下垃圾在这个森林里的人都将被依法处置
anyone who leaves litter in these woods will be prosecuted

单词

beauty spot: 景点

litter:垃圾

go for a walk:去散步

sad:难过

cover:覆盖

rusty:生锈的

among: 在…之中

prosecute: 起诉

新概念英语第二册

01

这个剧很令人感兴趣
the play was very interesting

interesting: 对事物感兴趣
interested: 对人感兴趣

不关你的事
none of you business

简单陈述句语序

主语 + 谓语动词 + 宾语 + 状语 时间,地点,程度都可以放到后面做状语

谓语动词 宾语 状语
i did not enjoyed it

主语 + 系动词 + 表语 表语一般是形容词

单词

theatre: 剧院

watch a play: 看剧

bear: 动词有忍受,承担的意思,名词是熊

02

频率副词,时间副词 位置在动词前面
now,sometimes可以放在句首或者句尾
now, still用现在进行时,其他的是一般现在时
现在进行时 be + doing

难点

what引导的感叹句 ,用来感叹名词
what + 名词 + 主语 + 谓语

单词

频率副词
never 从不
rarely 很少
sometimes 有时候
frequently 经常
often 常常
always 总是

感叹句:what + 名词
this is a wonderful garden!
变成感叹句: what a wonderful garden (this is)

you are a clever boy!
what a clever boy (you are)!

03

一般过去时 was/were + 动词过去式

难点

双宾语动词
he lent me a book, me是间接宾语,a book是直接宾语
可以变成 he lent a book to/for me

单词

daught: 教
lend: 借给
whole: 整个的
spoil: 损坏,溺爱的

04

现在完成时 have/has + 动词过去分词

时间状语 just,already,ever,never放在动词前面, yet, so far, lately放在句尾
just 刚刚
already 已经
ever 曾经
never 从不
yet 仍然,还未,只能用在否定句和疑问句中
so far 到现在为止,可以用在肯定句,否定句,疑问句中
lately 最近的

yet 用在现在完成时,still用在现在进行时

单词

firm 商行,公司
a great of number: 许多

yet: 到目前为止还没有,还,仍然
so far: 到目前为止

05

up to now: 到现在

way的短语
in this way: 这个方法
in the/my way: 挡住我的路了
in a way: 在某种程度上
on the way: 在…的路上
by the way: 顺便,顺道

单词

pigeon: 鸽子
spare aprt: 备件
spare: 形容词:备用的,空闲的 动词:赦免
obtain: 获得

06

ask sb for sth: 向某人索要某物
in return for this: 作为报答
stand on his head: 他倒立

a,an 泛指一个 放在可数名词单数前面
some 泛指一些 放在可数名词复数 or 不可数名词前面
the 特指这个

有些动词,加上介词或副词后就会改变词义
knock sb out: 把某人打昏
konck … over: 把…撞倒
knock off: 下班
konck … off… 把… 从…碰掉
konck at 敲
knock 20% off the price 让利,优惠20%

07

过去进行时 was/were + doing

时态副词,比如while,when,as代表当…的时候,可以用过去进行时或者一般过去时

有些动词短语可以把宾语放在中间,如果宾语是it,it必须在中间
put it out
put it away
put it on
put it off
take it on
take it off
有些是固定搭配,不能把宾语放在中间,比如
look at
look for
look after
wait for
ask for

单词

detective: 侦探
valuable: 贵重的
parcel: 包裹
daimond: 钻石
steal: 偷
precious: 珍贵的
prevent: 防止,避免

08

形容词的比较级和最高级
大多数比较级是加er/r
大多数最高级是加est/st

单音节形容词只有一个元音字母并以一个辅音字母结尾的
其比较级和最高级的构成是将这个辅音字母双写,再加er,est

辅音字母+y结尾的,y变i+er,est

多音节形容词在前面+more or the most

副词做比较
变形副词 前面 + more or the most
rudely more rudely the most rudely

同形式副词
hard harder the hardest

grow sth
sth grows

interesting: …令人感兴趣的
interested: 我对…感兴趣

单词

neat:整齐的
competition: 比赛
enter for: 报名参加
grow up: 长大

09

具体时间用 at at 9:00, at helf past one,at noon
具体日期用on on Sunday, on May 26th
月份年份用in in 2021, in May, in spring, in the morning
表示一段时间 in half an hour 半小时以后,in two weeks 两周以后, in twenty minutes’ time 20分钟以后
其他引导时间短语的介词
from…till: 从…到…
during: 在…期间
until: 直到…才

难点

any 的疑问句可以用
not any或者no回答
Is there any tea in the pot?
there is not any tea in the pot
there is no tea in the pot

单词

town hall: 市政厅
strike: 罢工,敲击
hand: 指针
a large crowd of: 一大群…
strike twelve: 敲击12下
in twenty minutes’ time: 20分钟以后

10

被动语态 be + 过去分词
主动语态主语是人或物,被动语态中,动作是对主语执行的
prisoners of war built this bridge in 1942 战俘在1942年建造了这个桥
this bridge was built by prisoners of war in 1942 这个桥被战俘于1942年建造 was built 被建造 + by 通过…建造

made in: 表示产地
made of: 表示用某种材料制作的 made of silver 银质的
made from: 表示用数种材料制作的 made from sand and lime 由沙和石灰制作的
made by: 表示制作人 made by my sister 我姐姐做的

难点

双重所有格
he is one of my friends的双重所有格形式:
he is a friend of mine

单词

instrument: 乐器
struck:被击中

11

one good turn deserves another 礼尚往来

有些动词的后面用动词不定式(to do …)作宾语时,需要在前面的动词后面增加一个代词或名词
he wants me to ask you a question // to ask you a question 是 to do 动词不定式,所以wants 后面加代词 me

单词

deserve: 应得,值得
repay: 偿还
wage: 工资,指日薪,周薪,体力劳动者的现金工资
salary: 工资,指月薪,年薪
at once: 马上,立刻

12

一般将来时 will or shall + 动词原形
shall 用在第一人称后面 will 用在所有人称后面

短语动词
be back: 回来
be on: 上映
be over: 过去
be not up to: 不能胜任,不能做
be away: 离开
set off: 出发
set out: 动身,出发
set up: 创造

单词

sail: 航行
take part in: 参与
plenty of time: 大量的时间
race across: 赛跑
the Atlantic: 大西洋
audience:观众
capable: 有能力的
compatibility:兼容性的

13

将来进行时 will be doing
they will be coming by train 他们将坐火车来这里

难点

名词所有格
单数名词后面加’s
规则的复数名词-s后面加’
不是s结尾的人名后面加’s
是s结尾的人名后面可以加’s或’

单词

pop singers: 流行歌手
present: 现在,当前,表达,介绍
performances: 表演
keep order: 保持秩序
occasion: 场合
as usual: 和往常一样
have a diffcult time: 日子不好过
have a hard time: 日子不好过
attract:吸引,招引
recitals: 表演,演出
situations: 形势,处境

14

过去完成时 had + 过去分词 表示过去发生的两个事件,动作中哪一个发生在前

ask: 问
ask for: 要求
except: 除了…
except用在句首常用except for

单词

apart from: 除了….之外
journey: 旅途
ask for a lift: 要求搭车
as i soon learnt: 我很快就知道
learnt: 知道,学到
regret: 后悔

15

that引导的宾语从句
the secretary told me that Mr. harmsworth would see me

that 引导的宾语从句,间接引语,要用过去式
he said that business was very bad

单词

irritable: 易怒的
spare: 空闲的
study: 书房

16

if 引导的条件状语从句 如果他没开罚单让你走了那你真的很幸运
you will be very lucky if he lets you go without a ticket

单词

part: 停放(汽车)
let you go: 放你走
without a ticket: 没有票,没开票
fail: 无视,忘记
street sign: 交通标志
however: 然而
disturb: 打扰
blame: 责备

17

他肯定至少35岁
she must be at least thirty-five years old

他经常出现在舞台上以一个年轻女孩的角色
she often appears on the stage as a young girl
as 以一个什么身份
i work as a teacher 我以一个老师的身份工作
as 当when用
as we were listening to the radio,someone knocked at the door
as 做因为用 我来不了因为我忙
i cannot come as i am busy

have to: 不得不 可以和must 替换 也可以用 have got to
junnifer 将不得不参加一个
jennifer will have to take part in a new play soon

grow: 成长
grow up: 成年人
suit: 一套衣服,正装
custume: 服装,戏服

单词

at least: 至少
personally: 个人的,自己的
in spite of: 尽管…
an adult = grown up 成年人
bright: 鲜艳的
must be: 一定是,表示对现在情况的一种推测,带有一听的肯定程度
fool: 傻子,呆瓜

18

have = have got, have got用于口语

umbrella = brolly, brolly 口语化

把…归还给…
return sth to sb

单词

give back: 归还
give away: 送出
give in: 交上,投降
give up: 放弃

19

may/might 表示猜测,可能
这个剧可能随时开始
the play may begin at any moment
may have + 动词过去分词 表示现在已经…
他可能已经开始了
it may have begun already

may/might i …? 可以和 can/could i … ? 替换

那我还是买了他们吧
i might as well have them

might as well:表示不是最好的选择,只好选这个了

表示请求
will you let me use your phone please?
可以用May
May i use your phone please?

表示推测
perhaps he will come tomorrow
可以用may
he may come tomorrow

单词

exclaim:惊呼 大声说
pity: 令人遗憾的事
sadly: 悲哀地
at once: 立刻
delighted: 高兴极了

20

钓鱼是我最喜欢的运动
fishing is my favourite sport

什么也没抓住,没钓上来
without catching anything

代替钓鱼的是
instead of catching fish,they

动名词

动名词 fishing, catching, having
动名词做主语
在床上看书是我一直享受的事情 i always enjoy做定语,解释什么事情
reading in bed is something i always enjoy

动名词做宾语
介词without 后面跟宾语,名词可以做宾语,所以动词变成动名词catching
i often fish for hours without catching anything

动名词以简化繁
i often fish for hours, i don’t catch anything
如果两个主语一样,可以通过介词连接两句话然后介词后面跟宾语,把动词变成动名词做宾语放在介词后面
i often fish for hours without catching anything

单词

instead of catching fish: 而不是捕鱼
pastime: 业余时间
be interested in doing sth: 对做…感兴趣

21

飞机慢慢把我逼疯了, drive sb mad/crazy: 把某人逼疯
Aeroplanes are slowly driving me mad

一定已经有一百个人被噪音驱赶走了
must have been 表示猜测一定已经…,be driven 被动语态 被驱赶走了 drive sb sth 被动语态变成 sb be driven sth
Over a hundred people must have been driven away from their homes by the noise

我已经被提供了一大笔钱让我离开
i have been offered a large sum of money to go away

但是我下定决心呆在这里
But i am determined to stay here

drive sb sth 被驱赶走了
drive into: 赶进去…
drive back: 赶回去..
drive out of: 赶出去…

单词

mad: crazy 疯狂的
determined: 下定决心的

22

of her own age: 和她同龄的人

单词

dream of: 梦想,幻想
cost: 成本,花费
regularly: 定期的,经常
the Channel: 英吉利海峡

23

我们现在正居住在一个乡下的美丽的新房子里面
we are now living in a beautiful new house in the country

名词前面有多个形容词的,顺序口诀:好美小高状奇新,颜色国料特别亲

单词

modern: 现代的
strange: 奇怪的
to: 对于某人来说
district: 地区

24

用现在进行时表示埋怨的语气

每个人这些天都在丢钱
everyone’s losing money these days

我妈妈总是认为我学习不够努力
My mon’s always thinking i don’t study hard

单词

wicked: 很坏的,邪恶的
honesty: 诚实的
upset: 不安,沮丧
sympathetic: 同情的
complain: 抱怨

25

我不仅英语说的非常小心,而且也非常清楚。
I not only spoke English very carefully, but very clearly as well

但是他说的既不慢也不清楚
but he spoke neither slowly nor clearly

他开始说的慢了,然而我还是不能听懂他说的, but代表然而,表示转折
Then he spoke slowly, but i could not understand him

不仅,而且
not only … but…as well
不仅,而且
not only … but also
neither … nor… 既不,也不

单词

at last: 最后,终于
several: 多次的,若干次
wonder: 疑惑,感到奇怪
porter: 搬运工

26

他们总是告诉你这个图片的意思是什么, what引导的宾语从句保持陈述句语序
They always tell you what a picture is 'about'

他们能观察到更多
They notice more

我的妹妹只有7岁,但是他总能告诉我 我的图画是好的还是坏的,whether 引导的宾语从句 whether or not 是否
My sister is only seven, but she always tells me whether my pictures are good or not

单词

critics: 批评者,评论家
critically: 批判的,质疑的
pretend: 假装
pattern: 图案
curtain: 窗帘
material: 材料
appreciate: 欣赏,鉴赏
just as: 正像…一样

27

单词

put up: 搭建
tent: 帐篷
wonderful: 美妙的,美好的
campfire: 篝火 = open fire
creep: 爬行
soundly: 香甜的
leap: 跳
stream: 小溪流
had formed: 已经形成了
wind: 蜿蜒,弯弯曲曲的
flow: 流

28

Jasper White 是少见的相信古代神话的人之一, who引导的定语从句
Jasper White is one of those rare people who believes in ancient myths

她是我见过的最丑的脸之一 定语从句
It is one of the ugliest faces I have ever seen

定语从句 由 关系代词 who, which ,that , whose, whom 引导, 修饰限定名词

这个飞行员落在了田野里没有受伤
The pilot whose plane landed in a field was not hurt

可省略的代词 who,which what 做宾语时候可以省略
你昨天见得这个男的是个演员 whom代表的the man在从句中做宾语,可以省略
The man (whom) you met yesterday is an actor

Jasper 希望 她将这些车和他们的车主变成石头 turn … to … 把…变成…
Jasper hopes that she will turn cars and their owners to stone

单词

rare: 罕见的,少见的
ancient: 古代的
effect: 效果
have effect: 有效果
turn … to … 把…变成…
none of them: 没有任何一个人
reputation:名誉
affected: 影响,打动

29

然而,最令人惊讶的是他能在任何地方着落,that引导的表语从句,主系表
The most surprising thing about it, however, is that it can land anywhere

on another occasion: 在另外一次情景中,还有一次

难点

bring: 拿来,come from somewhere with something
take: 拿走, away from somewhere with something
fetch: 去哪拿来某物 go somewhere, pick something up and bring it back

very: i arrived very late but i caught the train 我来的很晚,但我赶上火车了
too: i arrived too late and i missed the train 我来的太晚,我错过火车了

单词

plough: 犁,耕
lonely: 偏远的,孤僻的,孤单的
flat: 公寓
deserted: 废弃的
desert: 沙漠
Welsh: 威尔士的
remarkable:卓越,杰出
sowing: 播种

30

as usual: 像往常一样

on fine afternoons: 天气晴朗的下午

单词

in sight: 在我视野里
row: 划船
oars: 船桨

31

Frank 当时正在跟我说… 过去进行时
Frank Hawkins was telling me

修车是他的工作,It作为形式主语,to do不定式做主语
It was his job to repair bicycles

在他20多岁的时候
In his twenties

used to do: 过去常常做某事

单词

economise: 节约,节省

32

比较状语从句
人们不再像以前那样诚实了 not so/as + 形容词 + as … 是不如…那样…
People are not so honest as they once were

偷窃的诱惑比以前更强 to steal 是动词不定式做 temptation的定语
it is … for sb to do sth
The temptation to steal is greater than ever before

wrap it up: 收尾,打包

as…as possible: 尽可能…

单词

well-dressed: 穿着得体的
tempation: 诱惑
article:文章,物品,东西
wrap: 包裹
find out: 查出
simply: 仅仅
arrest: 逮捕
without paying: 没有付款

33

遇上了暴风雨, catch做突然遇上讲 be caught in 被抓住了被困在了…
was caught in a storm

一到岸边… on + 动名词 相当于一个由 as soon as 引导的时间状语从句
on arriving at the shore …

having spent: 现在分词的完成时,表示时间状语,表示已经完成的动作

难点

passed: 通过
past: 过去的

next: 下一个 next day:下一天
other: 另一个 other day: 前几天

单词

explain: 解释,叙述
storm:暴风雨
cliff: 悬崖
struggle: 挣扎
set out: 出发,动身

34

他不再担心了
he is not worried anymore

现在正用火车给他运回家 被动语态用在现在进行时中 要在be后面加ing
It is now being sent to his home by train

most 有 very的意思,常与起形容词作用的过去分词连用
most surprised

call at 拜访哪个地方
call on 拜访哪个人
call out 喊叫
call up 打电话
call off = cancel 取消

单词

station: 警察局
amused: 被逗乐了
call at: 拜访,也可以用call on
pick up: 有意外找到的意思
robbed: 被偷窃了

35

一段时间以后
a short while age

far more:

see sb do sth: 看见某人做某事用原型
他看见两个小偷从商店跑出来跑向一个停着的车
he saw two thieves rush out of a shop and run towards a waiting car

see sb doing sth: 看见某人正在做某事
当我通过窗户的时候,我看见他正和一个男人说话
When i passed the window, I saw her talking to a man

such (a/an) + adj. n. that… 如此…以至于…
拿着钱的那个受到如此的惊吓以至于他落下了包
The one with the money got such a fright that he dropped the bag

so 修饰形容词或副词
such 修饰名词

单词

regret: 后悔
fright: 惊吓
battered: 损坏

36

将来进行时 will be doing
明天他将会一直紧张的看着他当她游很长的距离去英国的时候
Tomorrow he will be watching her anxiously as she swims the long distance to England

他们当中将会有Debbie的妈妈,倒装句 正常应该是 Debbie’s mother will be among them
among them will be Debbie’s mother

单词

set up: 创造
intend: 打算
take rest: 休息

37

将来完成时 will have + done
工人将在今年年末完成这个新路 by引导一个未来的时间
Workers will have completed the new roads by the end of this year

单词

hold: 举办
immense:巨大的
standard: 标准,规格
fantastic: 巨大的
look forward: 期待

38

他一回来就买了一个房子住进去, no sooner than 相当于 as soon as 一…就… 主句过去完成时,从句一般过去时
He had no sooner returned than he bought a house and went to live there

他还没来得及安顿下来就卖掉了房子离开了这个国家 hardly … when … 几乎没来得及…就…
He had hardly had time to settle down when he sold the house and left the country

因为即使它还是夏天的时候,他也在下雨而且刺骨的冷
for even though it was still summer and it was often bitterly cold

他表现的就好像他之前从未居住在英国过
He acted as if he had never lived in England before

他超过我能忍受的程度了。。 它比我能忍受的更多,超过了我的忍受
it was more than he could bear

单词

settle down: 安居,定居
Mediterranean: 地中海的
even though: 即使
continually: 不断的,频繁的
continuously: 连续不断的
bitterly: 刺骨的
acted: 表现得
as if: 就好像
bear = put up with: 忍受
any longer: 再也不…

39

接下来一天
The following day

他问Gilbert先生的手术是否成功,转述疑问句用asked,if引导一般疑问句是否…
He asked if Mr. Gilbert’s operation had been successful
原话:has Mr. Gilberts’s operation been successful?

他这时候又问道 Gilbert先生将在什么时候能被允许回家呢 特殊疑问句直接跟上
He then asked when Mr. Gilbert would be allowed to go home
原话:When will Mr. Gilbert be allowed to go home

单词

in hospital: 住院
in the hospital: 在医院
exchange: 交接台
inquire: 询问
certain: 某位
surgeon: 外科医生

40

虚拟语气 用过去时表示另外一种情况,和现在的不一样 虚拟语气里面be动词都是were
‘Young man, if you ate more and talked less, we would both enjoy our dinner’

单词

hostess: 女主人
unsmile: 不笑的
tight: 紧身的
take my seat: 拿我的椅子做下
look up: 抬头看
despair: 绝望
briefly: 简要的
do exercises: 做练习
do business: 做生意
do one’s best: 尽自己最大的努力
do some shopping: 买东西

41

你不必说那样的话,我的妻子说 needn't 情态动词 + 动词原形
needn’t have done 表示不用那么做,但是已经那么做了, need情态动词只能用在否定句和疑问句中
‘You needn't have said that,’ my wife answered

needn’t = don’t have to

我觉得他很漂亮,我说,一个男人有再多的领带也不嫌多
‘I find it beautiful,’ I said. ‘A man can never have too many ties’

单词

mirror: 镜子
needn’t = don’t have to

42

have + 名词 = 这个名词做动词时候的意思

pick you up: 接你

picked up a lot of English: 学习了很多英语

pick out: 挑出来,选出来

显然,他辨别不出印第安音乐和爵士乐的不同
It obviously could not tell the difference between Indian music and jazz

单词

have a long walk: 走了很长一段路
have a rest: 休息一下
charmer: 魔术师
snake charmer: 舞蛇人
pipe: 管道,笛子
tune: 曲子
movements: 运动,动作
obviously: 明显的,显然的
tell the difference between … 辨别…之间的不同

43

run into trouble 遇到麻烦
it seemed certain: 他看起来肯定

表示动作已经完成用
was/were able to 不能用 could 换,其他时候可以互换

steal sb’s handbag = rob sb of his handbag

单词

Pole: 极
the South Pole: 南极
point: 地点
clear: 越过
at any rate:好歹,不管怎么说
be at a loss:不知所措
at time: 有时
at least: 至少
at present: 此时此刻

44

她所冒的风险
the risk she was taking

喘不上气,上气不接下气
out of breath

to do 和 doing 有些时候可以互换,有时候不行,比如doing表示宽泛的做这个事情,to do 表示做了具体的某个事情

单词

take the risk: 冒…风险
risk: 危险,冒险
fright: 惊吓的
in one’s possession: 为…所有
possession: 所有
picnic: 野餐
strap: 皮带
breath: 呼吸
going through: 翻看
daring:大胆

45

单词

pay back: 偿还,报仇
rob: 抢
rob sb of sth
clear: 无罪的,不亏心的
conscience: 良心
in time: 最后,终于

46

account for: 解释
没人能解释这些箱子中的一个为什么是如此的重 that引导的同位语从句说明这个事实
No one could account for the fact that one of the boxes was extremely heavy

astonished at: 对于什么惊讶
superised at: 对于什么惊喜

单词

pile: 堆
astonish: 使惊讶
occur: 发生
occur to: 想起
extremely: 及其,非常
admit: 承认
confine: 关在

47

因为他听到一个奇怪的声音,来自吧台的奇怪声音,宾语补足语
because he heard a strange noise coming from the bar

单词

haunt: 来访,闹鬼
furniture: 家具
suggest: 暗示
shake: 摇动
shake one’s head: 摇头

48

当你不能回答的时候牙医总问你问题 when引导时间状语从句,it是形式主语, 正确语序 to answer is impossible for you
Dentists always ask questions when it is impossible for you to answer

他刚刚告诉我去休息一会,转述told的时候可以接 to do 不定式 说的实际是 rest for a while
he had told me to rest for a while

他知道我收集火柴盒,他问我我的收藏是否增加了 whether 引导一般疑问句, 转述的时候,使用过去式陈述语序,正常问话:is you collection growing?
he knew (that) i collected match boxes and asked me whether my collection was growing

单词

pull out: 拔牙
cotton: 棉花
cotton wool: 药棉
search out: 搜寻

49

因为厌倦了睡地上,一个年轻人在 Teheran 存了很多年钱买了一个真床。前面的是原因,因为主语一样,所以前面的可以省略主语
Tired of sleeping on the floor, a young man in Teheran saved up for years to buy a real bed

Because + 句子
because of + 名词

他睡得很好, sleep weel 睡得好 第一二晚上睡得好
He slept very well for the first two nights

暴风雨来的猛烈
a storm blew up

这个男人知道床撞到地面才醒过来, not…until: 直到…才…
The young man did not wake up until the bed had struck the ground

一阵风把床从屋顶吹的撞到了院子下面 crashing 现在分词短语做宾语补足语
A gust of wind swept the bed off the roof and sent it crashing into the courtyard below

单词

be tired of: 厌倦了,疲倦了
springs: 弹簧
sleep weel 睡得好
gust: 阵风
courtyard: 院子
smashe: 粉碎,撞碎
miraculously: 奇迹般的
glance:撇一眼
metal: 金属
promptly: 及时,迅速地

50

losing my way: 迷路

我最近去做了一次旅行,但是我的旅行花费的时间比我想的更长
i went on an excursion recently, but my trip took me longer than i expected

take做花费讲,花费某人一些时间做某事 to do sth做主语
it takes/took me some time to do sth

我坐在公交车里面的前面因为能看到乡村的好风景
i sat in the front of the bus to get a good view of the countryside

in the front of: 在…里面的前面
in front of: 在外面的前面

两句话的主语相同,可以把一个放在前面省略主语做状语,变成现在分词形式,悬垂状语
Looking round, i realized with a shock that i was the only passenger left on the bus

forget to do sth: 忘记做某事
forget doing: 忘记做过什么事

那我更喜欢呆在车上
i prefer to stay on the bus

宽泛的说相对于踢足球我更喜欢看足球
i prefer watching football to playing it

prefer to do: 更喜欢去做某事
prefer doing: 宽泛的说我更喜欢做这个事情

单词

excursion: 远足
in that case: 在这种情况下,既然如此

51

实行节食
go on a diet = be on a diet

我去拜访他
i paid him a visit
paid sb a visit = visit sb: 拜访某人

显然他干到很尴尬, it形式主语,that引导名词性从句做主语,同位语从句
it was obvious that he was very embarrassed

难点

raise: 提起来,抬起来,形容放在后面的词
rise: 起来,升起来,形容放在前面的词
lie: 躺着,形容前面的词 sb lie
lay: 摆放,形容后面的词 lay sth
beat: 打败对方,beat sb
win: 赢得比赛,win sth

单词

reward: 报偿,给奖赏
diet: 节食
virtue: 美德
guiltily: 内疚的
occasionally: 偶尔的
led: 引导,领着
obvious: 显然的

52

现在完成进行时 have been + doing 表示动作在某一时间段内一直在进行,到现在,可能不进行了也可能还在进行,句中常有all+时间 all morning等

我整个上午一直在努力工作
I have been working hard all morning

我一直在尝试整理好我的新房间
i have been trying to get my new room in order

get…in order: 把….整理好

help sb to do sth
help sb do sth

单词

temporarily: 暂时的
gazed: 凝视
proved:证实
rather:相当
prettiest: 最漂亮的 pretty 的最高级
otherwise: 不同的

53

throw…away: 把…扔掉
throw … to …:把…扔给…
throw…. at … 把…扔向…

quiet: 安静
quite: 十分,相当

cause: 原因
reason: 缘由,理由,说服,劝说

drop: 使掉下
fall:掉下,落下

单词

hot: 带电的
remains: 尸体
wire: 金属线,电线
power line: 电力线
snatch: 抓住
spark: 电火花
explanation: 解释
evidence:证据
wound: 缠绕

54

我回到家的时候还挺早的。returned home 回家,home是副词,可以直接跟在return后面,回学校returned to school
it was still early when i returned home

一会之后我正忙着混合黄油和面粉 be busy doing: 忙着做某事
In a short time I was busy mixing butter and flour

我刚回到厨房,门铃就响起来了,响的足够大可以把死人吵醒
no sooner ... than... 一…就…
I had no sooner got back to the kitchen than the doorbell rang loud enough to wake the dead

没什么比这个更恼人的了
nothing could have been more annoying

单词

sticky: 黏黏的
pastry: 面糊
annoying: 恼人的
dismay: 沮丧的,失望
doorknobs: 门把手
receiver: 电话话筒
register letter: 挂号信

55

尽管如此
in spite of this

come true: 实现,成真

一个新机器被叫做The Revealer已经被发明出来了,他被使用来探测被埋葬在底下的金子
A new machine (which is) called ‘The Revealer’ has been invented and it has been used to detect gold which has been buried in the ground

sth be used to do
sth be used for doing

据说,是海盗们过去常常藏金子的地方 it is said 是插入语,据说…
where - it is said - pirates used to hide gold

海盗们过去经常埋金子在山洞里 would do过去…
The pirates would often bury gold in the cave

Armed with 过去分词做状语,hoping to 现在分词做状语
Armed with the new machine, a search party went into the cave hoping to find buried treasure

状语:形容词做状语,被动语态用过去分词做状语,主动语态用现在分词做状语

单词

revealer: 探索者
pirate: 海盗
thoroughly: 彻底的
trunk: 行李箱
confident: 有信心的
fairly: 快

56

每年
once a year

在他开始之前他们都很激动
there was a great deal of excitement just before it began

在许多响亮的爆炸声之后,比赛开始了
after a great many loud explosions, the race began

许多司机花费了更多的时间在车下面,而不是车里面
some drivers spent more time under their cars than in them

单词

a great deal of + 不可数名词: 大量的
a great many + 可数名词: 大量的
explosion: 爆炸
course: 赛道
rival: 对手
break down: 抛锚,出故障

57

他享受自己做某事
she enjoyed onself doing

let 和 make 后面要跟不带to的动词不定式

单词

hesitate: 犹豫
scornfully: 轻蔑的
seek: 寻找
eager: 热情的

58

it is … that … 强调句式,强调最近几年的时间,他才获得了一个邪恶的名声
but it is only in recent years that it has gained an evil reputation

这个牧师被要求找人把树砍掉 have sth done 是让别人做某事 如果是cut the tree down 是自己砍树
The vicar has been asked to have the tree cut down

In spite of 和 Despite 可以互换

单词

bless: 保佑
disguise: 伪装
possess: 拥有
curse: 诅咒
mention:提到
gained:获得
reputation:名声
vicar:牧师
claim: 以….为后果
victim: 受害者
trunk: 树干

59

spend 时间 doing:花费时间做某事

这次他正在叫,为的是有人能让他出去,so that引导目的状语,表示什么目的
This time he was barking so that someone would let him out

单词

bark: 叫
expert: 专家

60

你一离开这里,你将会获得一个大惊喜, The moment引导时间状语,一…就…,主句一般将来时,从句一般现在时
The moment you leave this tent, you will get a big surprise

that is all: 这就是全部

in less than an hour: 不到一个小时

单词

fair: 集市
village fair: 村庄集市
crystal: 水晶
impatiently: 不耐心地,不耐烦地

61

哈勃望远镜1990-4-20通过NASA被发射到太空,花费了超过壹佰亿美元,at a cost of 花费多少钱
The Hubble telescope was launched into space by NASA on April 20,1990 at a cost of over a billion dollars

从最开始
Right from the start

当宇航员们做必要的修补的时候,一个机械臂将从Endeavour里面伸出来抓住他, while引导时间状语从句,主将从现
A robot-arm from the Endeavour will grab the telescope and hold it while the astronauts make the necessary reparis

当你读到这的时候,哈勃的鹰眼将发送给我们成千上万的神奇的照片了
By the time you read this,the hubble’s eagle eye will have sent us thousands and thousands of wonderful pictures

单词

launch: 发射
telescope:望远镜
space:太空
faulty: 有问题的
shuttle: 航天飞机
Endeavour: 奋进号
grab: 抓住
galaxy: 星系
eagle eye: 鹰眼
distant: 遥远的
atmosphere: 大气层

62

消防员在他们能把火势控制住之前,已经和这个森林火灾对抗了几乎三周了
过去完成进行时 had been + doing 有一个过去的时间点,在这个时间点之前一直持续做某事,有一个持续的时间段
Firemen had been fighting the forest fire for nearly three weeks before they could get it under control

截止到这个时候之前,然而,许多地方的草都已经生根了
By + 时间表示截止到这个时间之前
By then,however, in many places the grass had already taken root

替代这些已经生长了一个世纪的参天大树的,是一片片的绿色出现在了这片焦土上。
in place of the great trees which had been growing there for centuries,patches of green had begun to appear in the blackened soil

冬季即将来临
winter was coming on

单词

under control: 控制住,在控制之中
take root: 生根
in place of: 替代了
the great trees: 参天大树
patches of green: 一片片的绿色
flood: 洪水
spray:喷雾
quantily: 量
desolate: 荒凉的
threaten: 威胁

63

这就是Jeremy喜欢的这类事情
This is the sort of thing that Jeremy loves

但是他还是按照他女儿要求的做了,as 做连词引导状语从句,表示方式
but he did as his daughter asked

她告诉他她不喜欢看到这么多人嘲笑他, see so sb doing
she told him that she did not like to see so many people laughing at him

结构难点

当直接引语是祈使句,变成间接引语将谓语动词变成动词不定式
“Don’t make so much noise”
She told them not to make so much noise

如果主语的谓语动词是suggestinsist,间接引语变成主语+should+动词原形
“Ask him about it,” he insisted
He insisted that i should ask him about it

单词

amused: 被逗乐了
sense of humor: 幽默感
circle of friends: 朋友圈
close: 紧密的
wedding reception:婚宴
sort: 种类
laughing at: 嘲笑

64

如果高的烟囱被建造在海平面上方,这个隧道将有好的通风
真实条件句:表示假设或愿望,主将从现,主句过去将来时,从句一般过去时
The tunnel would be well-ventilated if tall chimaneys were built above sea level

如果当时,英国人呢不害怕入侵,他将已经被完成了
虚拟条件句:对于过去事实的假设,从句 if had 动词过去分词 主句 would have 动词过去分词
if at the time,the British had not feared invasion,it would have been completed

单词

ventilate: 通风
chimney: 烟囱
put forward:提出
a double railway-tunnel should be built: 一个双轨铁路隧道应该被建造
draw in: 引进来
draw up: 起草
draw off: 开走
draw back: 退后
invasion: 入侵
officially: 正式的
continent: 大陆
propose:提出

65

分词做状语 过去分词被动语态做状语,现在分词主动语态做状语
他穿着圣诞老人的衣服,有6个漂亮的女孩陪着,坐着被叫做Jumbo的小象动身往城市的主路上走着
Dressed up as Father Christmas and accompanied by a ‘guard of honour’ of six pretty girls,he set off down the main street of the city riding a baby elephant called Jumbo

should/ought to + have 动词过去分词 应该做某事,应当做某事
他应该知道警察绝对不会允许这类事情
He should have known that the police would never allow this sort of thing

所以他幸运的是我们可以不用扛着他
so it was fortunate that we didn’t have to carry him

单词

versus:相对,谁和谁比拼
circus: 马戏团
present: 礼物
guard of honour:仪仗队
set off:出发
ought: 应该,应当
side street: 辅路
holding up the traffic: 影响交通
furtunate: 幸运的
arrest:逮捕
let off: 放过
let down: 拒绝
let in:让…进入
let out:放出

66

这场事故被遗忘了,残骸没有被人打扰还保持原状
the crash was forgotten and the wreck remained undisturbed

到现在为止,一个良好状况的Lancaster轰炸机是罕见的,值得拯救一下。
worth doing 值得做某事, in reasonable condition 在良好的条件下,状况良好
By this time, a Lancaster bomber in reasonable condition was rare and worth resuing

使役动词 have sth done 是让别人做某事

一群蜜蜂在之前已经回到了这个引擎,进入了蜂房,所以它被蜂蜡完整地保存了下来
A colony of bees had turned the engine into a hive and it was totally preserved in beeswax

单词

badly:严重
wreck: 残骸
remain:保留
undisturbed: 不受干扰
accidentally:意外地
aerial survey:航空测量
reasonable:合理的
enthusiasts: 爱好者
packing case:包装箱
imagine: 想象
totally: 完全的
preserved: 保存
beeswax:蜂蜡

67

Tazieff 能够成功把他的营地设置在火山附近当火山正猛烈喷发的时候 was able to 代表费了一点周折成功做了某事
Tazieff was able to set up his camp very close to the volcano while it was erupting violently

尽管他成功的拍了许多杰出的照片 managed to 代表费了一点周折成功做了某事
Though he managed to take a number of brilliant photographs

一股岩浆
a river of liquid rock

单词

volcanoes: 火山
erupt: 喷发
violently:猛烈地
brilliant: 杰出的
in time: 及时的
risk:冒险
tell a lie: 说谎
tell the time: 报时
tell the difference between: 区别

68

避免做某事
avoid doing

享受某事
enjoy doing

prevent sb from doing sth 预防某人做某事

fancy doing: 表示对…干到惊奇

假装我之前没看到他是没必要的 pretending 现在分词短语做主语
It was no use pretending that i had not seen him

不管你有多忙,他总是坚持跟着你 no matter 引导的让步状语从句, no matter和how,when等连接,翻译成无论
No matter how busy you are, he always insists on comming with you

我刚刚一直在思考如果度过这个早上
I was just wondering how to spend the morning

你介意我和你一起吗?
would you mind my coming with you

单词

pretend: 假装
prevent: 预防
fancy: 极好的
rush hour:高峰时间
insisted on:坚持做某事

69

我当时正在被测试驾照考试,已经第三次了 被动语态在进行时里面be变成being
I was being tested for a driving licence for the third time

我之前被要求在高峰期开车
I had been asked to drive in heavy traffic

我被指示开出小镇之后,我开始有了自信 After介词后要加动名词所以had变成having
After having been instructed to drive out of town,I began to acquire confidence

考官肯定觉得我的表现不错,很高兴 must have 过去分词表示对过去的事情推测
The examiner must have been pleased with my performance

做出反应花了我很长时间 to react做主语
It took me a long time to react

单词

murder: 谋杀
instruct:指示
acquire: 获得
suppose: 假设
tap: 轻敲
pedal: 踏板
mournful: 悲伤的
confess:承认

70

但是它突然看到这个醉汉
but it suddenly caught sight of the drunk who was shouting rude remarks and

显然对于批评很敏感 sensitive to 对...敏感
Apparently sensitive to criticism

当这个公牛接近他的时候,他笨拙的移开了让它冲过去了
When the bull got close to him, he clumsily stepped aside to let it pass

人群突然爆发欢呼声,这个醉汉鞠躬
The crowd broke into cheers and the drunk bowed

即使这个公牛看起来像是为他感觉遗憾,因为它同情的看热闹直到这个醉汉被拖走,在注意力转到这个斗牛士之前
Even the bull seemed to feel sorry for him, for it looked on sympathetically until the drunk was out of the way before once more turning its attention to the matador

单词

bullfight: 斗牛
drunk: 醉汉
wandered: 慢慢的挪步
unaware: 不知道,意识不到
matador: 斗牛士
rude remarks: 说脏话
apparently:显然
grew quiet: 变得安静
clumsily: 笨拙的
clumsily stepped aside:笨拙的移动到旁边
got close to:接近了
bowed:鞠躬
sympathetically: 同情的
look on: 看热闹

71

大本钟是用 Benjamin Hall 的名字来命名的
Big Ben takes its name from Sir Benjamin Hall

单词

burned down: 烧光了
erected: 竖立
accurate: 准确的
immense: 巨大的
extremely: 极其的
responsible: 负责任的

72

开始的行程
the first run

追随他爸爸的足迹
Following in his father’s footsteps

单词

burst: 爆裂
footsteps: 足迹
skidded: 打滑的
overturned:推翻

73

记录保持者
The record holder

安静钓一天鱼,或者8个小时在电影院一遍又一遍看一样的电影,是通常他们能做的最多的事情了
over and over again一遍又一遍
as far as表示到….程度
A quiet day’s fishing,or eight hours in a cinema seeing the same film over and over again,is usually as far as they get

他搭便车去Dover,快到晚上的时候,进入一个船寻找睡觉的地方
towards evening快到晚上的时候
to find somewhere to do 不定式做状语,找一些地方 to sleep to do不定式做定语,睡觉的地方
He hitchhiked to Dover and, towards evening, went into a boat to find somewhere to sleep

在他第二天早上醒来的时候,他发现这个船在这段时间已经开往Calais了
in the meantime 在这段时间
When he woke up next morning,he discovered that the boat had, in the meantime, travelled to Calais

这个男孩截住的下一辆车没把他像他希望的那样带到巴黎市中心,而是去了在法国和西班牙的边界Perpignan
as he hoped it would 方式状语从句,像他希望的那样
The next car the boy stopped did not take him into the centre of Paris as he hoped it would, but to Perpignan on the French-Spanish border

他无疑为成千上万梦想逃学的孩子创造了一个记录
He has surely set up a record for the thousands of children who dream of evading school

单词

truant: 逃学
unimaginative: 想象力不丰富的
hitchhike: 搭便车
lorry: 卡车
evade: 逃脱

短语

pay attention to: 关注,注意, 后面加动名词,不能加动词

look forward to: 期待

so … that: 如此…以至于… so是副词后面加形容词或副词
such…that: 如此…以至于… such是形容词,后面可以加可数名词或不可数名词,名词前面可以有形容词

connect…with: 把….和…联系起来

unless: 连词,如果不,除非,等同于 if…not

put on: 穿上,表演,发胖
put away: 收起来
put out: 熄灭
put up:
put off: 脱下
put down:

warn sb to do sth: 警告某人做某事

end up:最终成为
end up doing sth: 最终做某事

take up: 占用
stay up: 熬夜
use up: 用完

or not 前面只能用whether

too to 和 so that是同义词

in order to: 为了,以便于

have the ability to do sth: 有能力做某事

became interested in…:变得对…感兴趣

keep doing sth: 坚持做某事

practice doing sth:练习做某事

sth cost/cost sb + 钱数 主语是物

sb pay/paid some money for sth 主语是人

sb spend/spent some time on sth/doing sth 花时间主语是人
sb spend/spent some money on sth/doing sth 花钱主语是人

It takes/took on doing sth 花时间
it takes sb some time to do sth

反义疑问句前肯后否,前否后肯
回答依据事实,前否后肯的回答中,yes和no的意思相反

be used to: 习惯于
used to be:曾经常常做某事
didn’t use to do sth: 过去不常做某事
did use to do sth? 过去经常做某事吗?
be used to doing sth: 习惯于做某事

take up + 时间或地点表示占用占据
take up + 事物表示开始做某事,学着做某事
take out:取出
take off:起飞
take away: 带走
take after: 像
take part in: 参加,加入
take place:发生
take one’s temperature: 量体温

deal with: 处理,应付

in trouble: 处于困境
in time: 及时
in person: 亲自

seldom: 很少,不常,几乎不
hardly: 几乎不

be proud of: 为…感到自豪
take pride in: 为什么感到自豪

at the age of: 在…..岁时

came up with: 想出了…

trick or treat: 不给糖就捣蛋

promise to do sth: 承诺做某事

decide to do sth: 决定做某事

dress up as: 装扮成…

expect sb to do sth: 期待某人做某事

remind sb of sth: 使某人想起某事

admire sb for sth:

none of you business:不关你的事
admire sb for sth: 因某事而仰慕某人

suggest doing sth: 建议做某事

lend sb sth/ lend sth to sb
borrow sth/ borrow sth from sb

up to now: 到现在
up till now: 到目前为止

in this way: 这个方法
in the/my way: 挡住我的路了
in a way: 在某种程度上
on the way: 在…的路上
by the way: 顺便,顺道

ask sb for sth: 向某人索要某物
in return for this: 作为报答
stand on one’s head: 倒立

knock sb out: 把某人打昏
konck … over: 把…撞倒
knock off: 下班
konck … off… 把… 从…碰掉
konck at 敲
knock 20% off the price 让利,优惠20%

a large crowd of: 一大群…

one good turn deserves another 礼尚往来

aprt from: 除了….之外
ask for a lift: 要求搭车
as i soon learnt: 我很快就知道

in spite of: 尽管…
be interested in doing sth: 对做…感兴趣

drive sb mad/crazy: 把某人逼疯
drive into: 赶进去…
drive back: 赶回去..
drive out: 赶出去…

withdraw…from…: 从…提取,收回
comment on: 评论
include in: 包括
congratulate sb on sth: 为某事向某人祝贺
protect … from … :保护,使…免于
emerge from: 从…出现
dream of: 梦想,幻想
rely on: 依靠
prevent sb from doing sth : 阻止某人做某事
count on: 依赖
help sb in: 帮助某人
beware of: 谨慎,注意,当心
persisted in: 坚持
insist on: 坚持
get rid of: 摆脱
hear of: 获知…消息
separate…from:把…分开
cure…of: 治愈
operate on: 动手术,开刀
depend on: 依赖依靠
accuse … of…:控告…
suspect…of: 对…猜疑
think of: 思考
expect … of: 期望
smell of…: 闻到…
differ from: 与….不同
invest … in: 投资
based on: 在基础上
lean on: 依靠于
suffer from…: 受…之苦
embark on: 从事
belive in: 相信 信仰
be dismissed from: 被解雇
experiment on: 做尝试
concentrate on: 集中于
pride on: 为…感到自豪
fail in: 不成功
escape from: 从…逃出
economize on: 节约,节省
live on: 靠…为生
be employed in: 被雇佣
consist of: 由…组成
act on: 遵守
write on: 在…上写
boast of: 夸耀
encourage…in: 鼓励
instruct in : 指导,教导
be involved in: 使卷入
prohibit from: 不准许,禁止
assure … of: 让…放心
approve of: 赞成
despair of: 失望,丧失信心
perform on: 上演,扮演
warn … of: 警告…有危险
borrow from: 从…借
delight in: 喜欢

be tired of: 对…感到厌倦
be full of: 充满了…
turn … to … 把…变成…
on another occasion: 在另外一次情景中,还有一次
not so + 形容词 + as … 是不如…那样…

set out: 动身
call at: 拜访,也可以用call on
pick up: 有意外找到的意思
on + 动名词 相当于一个由 as soon as 引导的时间状语从句
wrap it up: 收尾,打包

set up: 创造
take rest: 休息
look forward to do 期待…
any longer: 再也不…
tell the difference between … 辨别…之间的不同

take the risk: 冒…风险
in one’s possession: 为…所有
out of breath 喘不上气,上气不接下气
going through: 翻看
steal sb’s handbag = rob sb of his handbag

sleep weel 睡得好

get…in order: 把….整理好
help sb to do sth
help sb do sth

forget to do sth: 忘记做某事
forget doing: 忘记做过什么事
in the front of: 在…里面的前面
in front of: 在外面的前面

avoid doing 避免做某事
enjoy doing 享受某事
prevent sb from doing sth 预防某人做某事

be unaware of: 没意识到…
caught sight of: 看到….

过去式

have - had - had

lose - lost 丢失

see - saw - seen

speak - spoke - spoken

take - took - taken

give - gave - given

drink- drank

meet-met

swim - swam - swum

过去式
am - was - been
is - was - been
are - were - been

do - did - done

buy - bought

bring - brought - brought

drive - drove - driven

try - tried

get - got

leave - left

find - found

hear - heard

make - made

send - sent

sweep - swept

tell - told

come - came

eat - ate - eaten

rise - rose - risen 上升

fly - flew - flown

catch - caught - caught

slip - slipped - slipped 滑到

fall - fell - fallen

hurt - hurt - hurt

drop - dropped

swallow - swallowed - swllowed 吞下

forget - forgot - forgotten

grow - grew - grown

will - would

can - could

may - might

lend - lent 借给

teach - taught

think - thought

spend - spent

write - wrote - written

throw - threw - thrown

creep - crept - crept: 爬行

leap - leapt - leapt: 跳

wind - wound - wound 蜿蜒

strike - struck: 撞击,碰撞

hold - held - held: 举办

lie - lay - lain: 躺着,位于
lay - laid - laid: 摆放

wind - wound - wound: 缠绕

forbid - forbade - forbidden 禁止
lead - led - led: 领导,领着,引导
hide - hid - hidden: 隐藏

ring - rang - rung : 响

seek - sought - sought: 寻找

过去分词

air - aired

go - gone

sell - sold

学堂在线C++程序设计第八章学习笔记

指针与数组

定义指向数组元素的指针
定义与赋值
例如: int a[10], *pa;
pa = &a[0] 或 pa = &a

*(pa +1)就是 a[1]

也可以 pa[1]

指针数组:数组的元素是指针类型
例如:Point *pa[2];
由pa[0],pa[1]两个指针构成

指针与函数

为什么需要指针做参数

  • 需要数据双向传递时(引用传递也可以达到此效果)
  • 需要传递一组数据,只传首地址运行效率比较高

指针类型的函数

若函数的返回类型是指针类型,该函数就是指针类型的函数

指针函数的定义形式:

1
2
3
存储类型 数据类型 *函数名() {

}
  • 不要将非静态局部地址用作函数的返回值
    • 因为非静态局部地址作用域仅限于函数内部,离开函数就被销毁
1
2
3
4
5
6
7
8
9
10
11
int main() {
int *function();
int *ptr = function();
*ptr = 5; //危险!!!
return 0;
}

int *function() {
int local = 0; //作用域只在函数内部有效
return &local;
} //函数结束,变量local被释放
  • 返回的指针要确保在主调函数中是有效合法的地址

在子函数中通过动态内存分配new操作取得的内存地址返回给主函数是合法有效的,但是内存分配释放不在同一级别,要注意不能忘记释放,避免内存泄露

1
2
3
4
5
6
7
8
9
10
11
12
int main() {
int *function();
int *ptr = function();
*ptr = 5; //如果返回的是 new 分配的,就可以了
delete ptr; //但是这里需要释放,避免内存泄露
return 0;
}

int *function() {
int *local = new int(); //new 分配的不会离开函数就释放
return local;
}

指向函数的指针

函数指针的定义

  • 定义形式
    存储类型 数据类型 (*函数指针名)()
  • 含义
    函数指针指向的是程序代码存储区

用途:函数回调

  • 通过函数指针调用的函数
    • 例如将函数的指针作为参赛传递给一个函数,使得在处理相似事件的时候可以灵活的使用不同方法
  • 调用者不关心谁是被调用者
    • 需要知道存在一个具有特定原型和限制条件的被调用函数。

对象指针

定义:
类名 *对象指针名;
例如:

1
2
3
Point a(5,10);
Point *ptr;
ptr = &a;

通过指针访问对象成员
对象指针名->成员名
例如:
ptr->getX() 相当于 (*ptr).getX()

this 指针

  • 隐含于类的每一个非静态成员函数中
  • 指出成员函数所操作的对象
    • 当通过一个对象调用成员函数时,系统先将该对象的地址赋给this指针,然后调用成员函数,成员函数对对象的数据成员进行操作时,就隐含的使用了this指针。

动态内存分配

动态申请内存
new 类型名T (初始化参数列表)

  • 功能:
    在程序执行期间,申请用于存放T类型对象的内存空间,并依初值列表赋值
  • 结果值:
    成功:T类型的指针,指向新分配的内存,失败:抛出异常

释放内存
delete 指针P

  • 功能:
    释放指针P所指向的内存,p必须是new操作符的返回值

智能指针

C++11提供的

  • unique_ptr
    • 不允许多个指针共享资源,可以用标准库中的move函数转移指针
  • shared_ptr
    • 多个指针共享资源
  • weak_ptr
    • 可复制 shared_ptr ,但其构造或者释放对资源不产生影响

Vector

为什么需要Vector

  • 封装任何类型的动态数组,自动创建和删除
  • 数组下标越界检查

定义

  • vector<元素类型> 数组对象名(数组长度);
  • 例子:
    vector arr(5) 建立大小为5的int数组

vector对象的使用

  • 对数组元素的引用
    与普通数组具有相同形式:
    vector对象名[下标表达式]
    vector数组对象名不表示数组首地址
  • 获得数组长度
    size函数
    vector对象名.size()

对象复制和移动

浅层复制

  • 实现对象间数据元素的一一对应复制

深层复制

  • 当被复制的对象数据成员是指针类型时,不是复制该指针成员本身,而是将指针所指对象进行复制

申请和释放动态数组

分配和释放动态数组

  • 分配:new 类型名T [数组长度]
    • 数组长度可以是任何整数类型表达式,在运行时计算
  • 释放:delete[] 数组名p
    • 释放指针p所指向的数组
    • p必须是用new分配得到的数组首地址

动态创建多维数组
new 类型名T[第1维长度][第2维长度]

  • 如果内存申请成功,new 运算返回一个指向新分配内存首地址的指针
  • 例如
    char (*fp)[3];
    fp = new char[2][3]

将动态数组封装成类

  • 更加简洁,便于管理
  • 可以在访问数组元素前检查下标是否越界

移动构造

C++11中提供了新的构造方法

C++11之前,如果要将源对象的状态转移到目标对象只能通过复制。在某些情况下,我们没有必要复制对象 – 只需要移动它们

移动构造

  • C++11引入移动语义:
    • 源 对象资源的控制权全部交给目标对象
  • 移动构造函数

移动构造函数
class_name(class_name &&)

字符串

C风格字符串

字符串常量

  • 例如:”program”
  • 各字符连续,顺序存放,每个字符占一个字节,以’\0’结尾,相当于一个隐含创建的字符常量数组
  • “program” 出现在表达式中,表示这个char数组的首地址
  • 首地址可以赋给char常量指针
  • const char *STRING1 = “program”

用字符数组存储字符串

  • 例如
    char str[8] = {‘p’,’r’,’o’,’g’,’r’,’a’,’m’,’\0’}
    char str[8] = “program”
  • 缺点
    • 执行连接,拷贝,比较等操作,都需要显式调用库函数,很麻烦
    • 当字符串长度不确定时,需要用new 动态创建字符数组,最后要用delete释放,很繁琐
    • 字符串实际长度大于为他分配的空间时,会产生数组下标越界的错误

string类

构造函数

  • string() 默认的,建立长度为0的字符串
    例如 string s1;
  • string(const char *s); //用指针s所指向的字符串常量初始化string对象
    例如 string s2 = “abc”;
  • string(const string& rhs); //复制构造函数
    例如 string s3 = s2;

学堂在线C++程序设计第七章学习笔记

数组的定义与初始化

数组是具有一定顺序关系的若干相同类型变量的集合体,组成数组的变量称为该数组的元素

数组的定义

类型说明符 数组名[常量表达式] [常量表达式]…
数组名的构成方法与一般变量名相同

例如:

  • int a[10]
  • int a[5][3]

数组的使用

  • 数组必须先定义,后使用
  • 可以逐个引用数组元素
  • 例如:
    a[0] = a[5] + a[7]

数组的存储和初始化

一位数组的存储

数组元素在内存中顺次存放,它们的地址是连续的。元素间物理地址上的相邻,对应着逻辑次序上的相邻

数组名字是数组首元素的内存地址

数组名字是一个常量,不能被赋值

一维数组初始化

  • 列出全部值
    • static int a[5] = {0,1,2,3,4}
  • 可以只给一部分元素初始化
    • static int a[5] = {0,1,2}
  • 列出全部值时,可以不指定长度
    • static int a[] = {0,1,2,3,4}

二维数组的存储

  • 按行存放

二维数组的初始化

  • 列出全部值,按照顺序初始化
    • static int a[3][2] = {0,1,2,3,4,5}
  • 分行列出二维数组元素的初值
    • static int a[3][2] = { {0,1},{2,3},{4,5} }
  • 可以只对部分元素初始化
    • static int a[3][2] = { {0},{1,2},{3} }
  • 列出全部初始值,第一维下标可以省略
    • static int a[][2] = {0,1,2,3,4,5}
    • static int a[][2] = { {0,1},{2,3},{4,5} }
  • 如果不做任何初始化,局部作用域非静态数组中会存在垃圾数据,static 数组中的数据默认初始化为0
  • 如果只对部分元素初始化,剩下的将自动被初始化为0

对象数组

对象数组的定义和访问

  • 定义对象数组
    • 类名 数组名[元素个数]
  • 访问对象数组
    • 通过下标访问 数组名[下标].成员名

对象数组初始化

  • 数组中每一个元素对象被创建时,系统都会调用类构造函数初始化该对象
  • 通过初始化列表赋值
    • 例如:Point a[2] = {Point{1,2}, Point{3,4}}
  • 如果没有为数组元素指定显式初始值,数组元素便使用默认值初始化(调用默认构造函数)

数组元素的构造和析构

  • 构造数组时,元素所属的类未声明构造函数,则采用默认构造函数
  • 各元素对象的初值要求为相同的值时,可以声明具有默认形参值得构造函数
  • 各元素对象的初值要求为不同的值时,需要声明带形参的构造函数
  • 当数组中每一个对象被删除时,系统需要调用一次析构函数

基于范围的for循环

C++11 提供的

自动遍历整个容器

1
2
3
4
5
6
7
8
9
int main(){
int array[3] = {1,2,3}
int *p;
for (p = array;p < array + sizeof(array) / sizeof(int); ++p) {
*p += 2;
std::cout << *p << std::endl;
}
return 0;
}

如果用基于范围的

1
2
3
4
5
6
7
8
int main(){
int array[3] = {1,2,3};
for(int & e : array) {
e+=2;
std::cout <<e <<std::endl;
}
return 0;
}

指针的定义和运算

内存空间的访问形式:

  • 通过变量名访问
  • 通过地址访问

指针的概念:

  • 指针:内存地址,用于间接访问内存单元
  • 指针变量:用于存放地址的变量
1
2
static int i;
static int* ptr = &i; //指向int变量的指针

指针运算符 *:表示该变量内存里存储的是地址,并操作存储地址对应的内存空间

地址运算符 &: 表示该变量的地址

指针的初始化和赋值

指针变量的初始化

  • 语法形式
    • 存储类型 数据类型 *指针名 = 初始地址
    • 例如:int *pa = &a
  • 注意事项
    • 用变量地址作为初始值时,该变量必须在指针初始化之前已声明过,且变量类型应与指针类型一致
    • 可以用一个已有合法值的指针去初始化另一个指针变量
    • 不要用一个内部非静态变量去初始化 static 指针

指针变量的赋值运算

  • 语法形式 指针名 = 地址
  • 注意:
    • 地址 中存放的数据类型与指针类型必须相符
    • 向指针变量赋值必须是地址常量或变量,不能是普通整数
  • 例如:
    • 通过地址运算 & 求得已定义的变量和对象的起始地址
    • 动态内存分配成功时返回的地址
  • 例外:整数0可以赋值给指针,表示空指针
  • 允许定义或声明指向 void 类型的指针。该指针可以被赋予任何类型对象的地址
    • void *general;

指向常量的指针

  • const 指针
  • 不能通过指向常量的指针改变所指对象的值,但指针本身可以改变,可以指向另外的对象
  • 例如:
    1
    2
    3
    4
    5
    int a;
    const int *p = &a;
    int b;
    p = &b
    *p = 2; //编译出错

指针类型的常量

  • 声明指针常量,则指针本身的值不能被改变
  • 例如:
    1
    2
    3
    int a;
    int * const p2 = *a;
    p2 = &b; //错误

指针的运算

指针的算术运算

  • 指针与整数的加减运算
    • 指针p 加上或减去 n:指针当前指向位置的前方或后方第n个数据的起始位置
  • 指针++,–运算
    • 指向下一个或前一个完整数据的起始位置
  • 运算的结果值取决于指针指向的数据类型,总是指向一个完整数据的起始位置
  • 当指针指向连续存储的同类型数据时,指针与整数的加减运算和自增自减才有意义

指针的关系运算

  • 指向相同类型数据的指针之间可以进行各种关系运算
  • 指向不同数据类型的指针,以及指针与一般整形变量之间的关系运算是无意义的
  • 指针可以和零之间进行等于或不等于的关系运算,判断空指针

数据库系统原理第五节

数据库设计

数据库设计概述

数据库的生命周期

  • 数据库分析与设计阶段
    • 需求分析
    • 概念设计
    • 逻辑设计
    • 物理设计
  • 数据库实现与操作阶段
    • 实现
    • 操作与监督
    • 修改与调整

数据库设计的目标

  • 满足应用功能需求
    • 存,取,删,改
  • 良好的数据库性能
    • 高效率存取和空间的节省
    • 共享性,完整性,一致性,安全保密性

数据库设计的内容

  • 静态的 数据库结构设计
    • 数据库概念结构设计
    • 逻辑结构设计
    • 物理结构设计
  • 动态的 数据库行为设计
    • 功能设计
    • 事务设计
    • 程序设计

数据库设计的方法

  • 直观设计法
    • 最原始的数据库设计方法
  • 规范设计法
    • 新奥尔良设计法:需求分析,概念结构设计,逻辑结构设计,物理结构设计
    • 基于E-R模型
    • 基于第三范式
  • 计算机辅助设计法
    • 辅助软件工程工具

数据库设计的过程

  • 需求分析
  • 结构设计,行为设计
  • 数据库实施
    • 加载数据库数据
    • 调试运行应用程序
  • 数据库运行与维护

数据库设计的基本步骤

需求分析

数据库设计的起点
目标:是了解与分析用户的信息及应用处理的要求,并将结果按一定格式整理而形成需求分析报告

该分析报告是后续概念设计,逻辑设计,物理设计,数据库建立与维护的依据

  • 确定数据范围
    • 有效的利用计算机设备及数据库系统的潜在能力
    • 提高数据库的应变能力
    • 避免应用过程中对数据库做太多或太大的修改
    • 延长数据库的生命周期
  • 分析数据应用过程
    • 用到那些数据
    • 数据使用的顺序
    • 对数据作何处理和处理的策略以及结果
    • 应用过程分析的结果是数据库结构设计的重要依据
  • 收集与分析数据
    • 数据收集与分析的任务是了解并分析数据的组成各式及操作特征,每个数据元素的语义及关系等,并将它们收集起来整理归档
    • 静态结构 —不施加应用操作于其上时数据的原数始状况
    • 动态结构 —将应用操作施加于数据之上后数据的状况
    • 数据约束 —使用数据时的特殊要求
      • 数据的安全保密性
      • 数据的完整性
      • 响应时间
      • 数据恢复
  • 编写需求分析报告
    • 数据库的应用功能目标
    • 标明不同用户视图范围
    • 应用处理过程需求说明,包括:数据流程图;任务分类表;数据操作特征表;操作过程说明书。
    • 数据字典,是数据库系统中存储三级结构定义的数据库,通常指的是数据库系统中各类数据详细描述的集合。功能是存储和检索各种数据描述,即元数据。包括数据分类表,数据元素表和各类原始资料
    • 数据量
    • 数据约束

概念结构设计 重点

概念模型 – E-R图

  • 实体分析法 (自顶向下)
  • 属性综合法 (自底向上)

概念模型

  • 独立于任何软件与硬件
  • 主要目标:最大限度的满足应用需求

逻辑结构设计

目标:
将概念模型转换为等价的,并为特定DBMS所支持数据模型的结构

步骤:

  1. 模型转换 是将概念模型等价的转换为特定DBMS支持的关系模型,网状模型或层次模型表示
  2. 子模式设计的目标是抽取或导出模式的子集,以构造不同用户使用的局部数据逻辑结构
  3. 编制应用程序设计说明的目的是为可实际运行的应用程序设计提供依据与指导,并作为设计评价的基础
  4. 设计评价的任务是分析并检验模式及子模式的正确性与合理性

物理设计

具体任务主要是确定数据库在存储设备上的存储结构存取方法
因DBMS的不同还可能包括建立索引聚集,以及物理块大小缓冲区个数和大小数据压缩的选择

数据库实施

  • 加载数据
  • 应用程序设计
  • 数据库试运行

数据库运行与维护

保证数据库的正常运行

最困难:数据库重组与重构

关系数据库设计方法

概念模型的表示方法

  • 矩形:实体
  • 椭圆:属性
  • 菱形:联系

数据库系统原理第六节

数据库设计

关系数据库设计方法

逻辑结构设计方法

  • 将E-R图转换为关系模型
    • 一个实体转换为一个关系模式,实体的属性作为关系的属性,实体的码作为关系的码
    • 一个一对一联系可以转换为一个独立的关系模式,也可以与任意一端对应的关系模式合并
    • 一个一对多联系可以转换为一个独立的关系模式,也可以与N端对应的关系模式合并
    • 一个多对多联系可以转换为一个独立的关系模式,与该联系相连的各实体的码以及联系本身的属性均转换为关系的属性
    • 三个或以上实体间的一个多元联系可以转换为一个关系模式
    • 具有相同码的关系模式可合并
  • 对关系数据模型进行优化
    • 数据库逻辑设计的结果,不是唯一
    • 确定各属性间的函数依赖关系
    • 对于各个关系模式之间的数据依赖进行极小化处理,消除冗余的联系
    • 判断每个关系模式的范式,根据实际需要确定最合适的范式
    • 按照需求分析得到的处理要求,分析浙西模式对于这样的应用环境是否合适,确定是否要对某些模式进行合并或分解
    • 对关系模式进行必要的分解,提高数据操作的效率和存储空间的利用率
  • 设计面向用户的外模式

设计用户子模式

  • 可以通过视图机制在设计用户视图时,重新定义某些属性的别名,使其更符合用户的习惯,以方便使用
  • 可以对不同级别的用户定义不同的视图,以保证系统的安全性。
  • 简化用户对系统的使用

物理设计方法

建立索引

  • 逻辑连接
  • 静态建立索引
  • 动态建立索引
    建立聚集
  • 聚集是将相关数据集中存放的物理存储技术
  • 数据聚集结构的一种有效方式是块结构方式
  • 数据聚集可在一个或多个关系上建立

SQL与关系数据库基本操作

SQL概述

什么是SQL

结构化查询语言是专门用来与数据库通信的语言,它可以帮助用户操作关系数据库

SQL的特点

SQL不是某个特定数据库供应商专有的语言
SQL简单易学
SQL强大,灵活,可以进行非常复杂和高级的数据库操作

SQL的组成

数据查询
数据定义 DDL

  • CREATE 创建数据库或数据库对象
  • ALTER 对数据库或数据库对象进行修改
  • DROP 删除数据库或数据库对象
    数据操纵 DML
  • SELECT 从表或视图中检索数据
  • INSERT 将数据插入到表或视图中
  • UPDATE 修改表或视图中的数据
  • DELETE 从表或视图中删除数据
    数据控制 DCL
  • GRANT 用于授予权限
  • REVOKE 用于收回权限

MySql预备知识

MySQL使用基础

关系数据库管理系统 RDBMS

优点:体积小,速度快,开放源代码,遵循GPL

MySQL扩展语言要素

常量:也称字面值或标量值

  • 字符串常量
  • 数值常量
  • 十六进制常量
  • 时间日期常量
  • 位字段值
  • 布尔值
  • NULL值

变量

  • 用户变量
    用户变量前常添加@
  • 系统变量
    大多数系统变量前添加两个@@

运算符

  • 算术运算符
  • 位运算符
  • 比较运算符
  • 逻辑运算符
    • NOT
    • AND
    • OR
    • XOR

表达式:是常量,变量,列名,复杂计算,运算符合函数的组合

  • 字符型表达式
  • 数值型表达式
  • 日期型表达式

内置函数

  • 数学函数
    • ABS
  • 聚合函数
    • COUNT
  • 字符串函数
  • 日期和时间函数
  • 加密函数

数据定义

数据库模式定义

创建数据库
使用 CREATE DATABASECREATE SCHEMA语句

1
2
3
CREATE {DATABASE | SCHEMA} [IF NOT EXISTS] db_name
[DEFAULT] CHARACTER SET[=]charset_name
| [DEFAULT] COLLATE[=]collation_name

查看数据库

1
2
SHOW {DATABASES | SCHEMAS}
[LIKE pattern | WHERE expr]

选择数据库

1
use db_name

修改数据库

1
2
3
ALTER DATABASE db_name
DEFAULT CHARACTER SET gb2312
DEFAULT COLLATE gb2312_chinese_ci;

删除数据库

1
DROP {DATABASE|SCHEMA} [IF EXISTS] db_name;

学堂在线C++程序设计第六章学习笔记

变量和对象定义在不同的位置

  • 其作用域,可见性,生存期都不同

友元:

  • 对一些类外的函数,其他的类,给预授权,使之可以访问类的私有成员

标识符的作用域与可见性

作用域分类:

  • 函数原型作用域
  • 局部作用域
  • 类作用域
  • 文件作用域
  • 命名空间作用域

函数原型作用域

  • 函数原型中的参数

类的作用域

  • 类的成员具有类作用域,其范围包括类体和成员函数体
  • 在类作用域以外访问类的成员
    • 静态成员:通过类名,或者该类的对象名,对象引用访问
    • 非静态成员:通过类名,或该类的对象名,对象引用,对象指针访问

文件作用域

  • 不在前述各个作用域中出现的声明,就具有文件作用域
  • 其作用域开始于声明点,结束于文件尾

可见性

  • 可见性是从对标识符的引用角度来谈论的
  • 可见性表示从内层作用域向外层作用域“看”时能看见什么
  • 如果标识在某处可见,就可以在该处引用此标识符
  • 如果某个标识符在外层中声明,且在内层中没有同一标识符的声明,则该标识符在内层可见
  • 对于两个嵌套的作用域,如果在内层作用域内声明了与外层作用域中同名的标识符,则外层标识符在内层不可见

对象的生存期

静态生存期

  • 这种生存期与程序的运行期相同
  • 在文件作用域中声明的对象具有这种生存期
  • 在函数内部声明静态生存期对象,要冠以关键字static

动态生存期

  • 开始于程序执行到声明点时,结束于命名该标识符的作用域结束处
  • 块作用域中声明的,没有用static修饰的对象是动态生存期的对象(也称局部生存期对象)

静态数据成员

  • 用关键词static修饰
  • 为该类的所有对象共享,静态数据成员具有静态生存期
  • 必须在类外定义和初始化,用(::)来指明所属的类
1
2
3
4
5
class Point{
public:
static int count; //声明
}
int Point::count = 0; //初始化

静态函数成员

静态函数成员主要用来处理静态数据成员

静态函数成员要处理非静态数据成员,需要用对象调用

类的友元

  • 友元是C++提供的一种破坏数据封装和数据隐藏的机制
  • 通过将一个模块声明为另一个模块的友元,一个模块能够引用到另一个模块中本是被隐藏的信息
  • 可以声明友元函数和友元类
  • 为了确保数据的完整性,及数据封装与隐藏的原则,建议慎用友元

友元函数

  • 友元函数是在类声明中由关键字friend修饰说明的非成员函数,在它的函数体中能够通过对象名访问private和protected成员
  • 作用:增加灵活性,使程序员可以在封装和快速性方面做合理选择
  • 访问对象中的成员必须通过对象名

友元类

  • 若一个类为另一个类的友元,则此类的所有成员都能访问对方类的私有成员
  • 声明语法:将友元类名在另一个类中使用friend修饰说明
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class A{
friend class B;
public:
void display() {
cout << X << endl;
}
private:
int X;
}

class B{
public:
void set(int i);
void display();
private:
A a;
}

void B::set(int i) {
a.X = i;
}

void display() {
a.display();
}

类的友元关系是单向的:

  • 声明B类是A类的友元 不等于 A类是B类的友元

共享数据的保护

常类型

  • 常对象:必须进行初始化,不能被更新。
    const 类名 对象名
  • 常成员:
    用 const 进行修饰的类成员:常数据成员和常函数成员
  • 常引用:被引用的对象不能被更新
    const 类型说明符 &引用名;
  • 常数组:数组元素不能被更新
    类型说明符 const 数组名[大小]
  • 常指针:指向常量的指针

常成员:用const修饰的对象成员

  • 常成员函数
    • 使用const 关键字说明的函数
    • 常成员函数不更新对象的数据成员
    • 常成员函数说明格式:
      类型说明符 函数名(参数表)const;
      这里,const是函数类型的一个组成部分,因此在实现部分也要带const关键字
    • const 关键字可以被用于参与对重载函数的区分
    • 通过常对象只能调用它的常成员函数
  • 常数据成员
    • 使用 const 说明的数据成员

常引用

  • 在友元函数中用常引用做参数,既能获得较高的执行效率,又能保证实参的安全性

多文件结构和预编译处理命令

C++程序的一般组织结构

  • 一个工程可以划分为多个源文件
    • 类声明文件(.h文件)
    • 类实现文件(.cpp文件)
    • 类的使用文件(main()所在的.cpp文件)
  • 利用工程来组合各个文件

文件1 Point.h

1
2
3
4
5
6
7
8
9
10
class Point{
//类的定义
public:
Point(int x =0,int y = 0):x(x),y(y){}
Point(const Point &p);
static void showCount();
private:
int x,y;
static int count;
}

文件2 Point.cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
#include "Point.h"
#include <iostream>
using namespace std;

int Point::cout = 0;

Point::Point(const Point &p):x(p.x),y(p.y){
count++;
}

void Point::showCount() {
cout << "Object count =" << count << endl;
}

文件3 主函数 main.cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
#include "Point.h"
#include <iostream>
using namespace std;

int main() {
Point a(4,5);
cout << "Point A:" < a.getX() << "," << a.getY();
Point::showCount();
Point b(a);
cout << "Point B:" << b.getX() << "," << b.getY();
Point::showCount();
return 0;
}

外部变量

  • 除了在定义它的源文件中可以使用外,还能被其他文件使用
  • 文件作用域中定义的变量,默认情况下都是外部变量
  • 在其它文件中如果需要使用,需要用extern关键字声明

外部函数

  • 在所有类之外声明的函数(也就是非成员函数),都是具有文件作用域的
  • 这样的函数都可以在不同的编译单元中被调用
  • 只要在调用之前进行引用性声明(即声明函数原型)即可

将变量和函数限制在编译单元内

  • 在匿名命名空间中定义的变量和函数,都不会暴露给其它的编译单元
1
2
3
4
5
6
7
namespace {
//匿名的命名空间
int n;
void f() {
n++;
}
}

标准C++库

  • 标准C++类库是一个极为灵活并可扩展的可重用软件模块的集合

标准C++类与组件在逻辑上分为6种类型:

  • 输入/输出类
  • 容器类与抽象数据类型
  • 存储管理类
  • 算法
  • 错误处理
  • 运行环境支持

编译预处理

  • #include 包含指令
    • 将一个源文件嵌入到当前源文件中该点处
    • #include<文件名>
      • 按标准方式搜索,文件位于C++系统目录的include子目录下
    • #include “文件名”
      • 首先在当前目录中搜索,若没有,再按标准方式搜索
  • #define 宏定义指令
    • 定义符号常量,很多情况下已被const定义语句取代
    • 定义带参数宏,已被内联函数取代
  • #under
    • 删除由 #define 定义的宏,使之不再起作用

条件编译指令 #if 和 #endif
#if 常量表达式
//当 常量表达式 非零时编译
程序正文
#endif

条件编译指令 #else
#if 常量表达式
//当 常量表达式 非零时编译
程序正文1
#else
//当 常量表达式 为零时编译
程序正文2
#endif

条件编译指令 #elif
#if 常量表达式1
//当 常量表达式1 非零时编译
程序正文1
#elif 常量表达式2
//当 常量表达式2 非零时编译
程序正文2
#else
//其他情况下编译
程序正文3
#endif

条件编译指令
#ifdef 标识符
程序段1
#else
程序段2
#endif

  • 如果 标识符 经 #define 定义过,且未经undef删除,则编译程序段1
  • 否则编译程序段2

条件编译指令
#ifndef 标识符
程序段1
#else
程序段2
#endif

  • 如果标识符未被定义过,则编译程序段1
  • 否则编译程序段2