20230127日志

20230127日志

2023年1月27日
2023
202301, 助动词, 情态动词, 系动词, 从句, coding, session, ThreadLocal, 引用

english #

助动词 #

  1. 辅助主动词
  2. 不能像助动词一样单独作谓语动词
  3. 除此以外,情态动词能够表意,也归在助动词内
  4. 有些单词除了作为助动词,还可以作为实义动词

基本助动词 #

  1. 没有实际含义
  2. be
    • The rabbit is eating a carrot
  3. do
    • The reabbit does like coins 构成强调
  4. have
    • The rabbit has eaten a carrot

情态助动词 #

  1. 有实际含义
  2. can/could
    • I can kill a wolf. 表能力
    • Could I borrow your book? 表请求, could 虽然是过去式, 但没有时间上的含义
    • Anyting can happen. 表可能
  3. may/might
    • May/Might I borrow your bookk? 表请求
    • He may be at home. 可是可能性 can/could > may/might
    • May you success. 祝你成功. 表祝愿,放在句首
  4. shall/should
    • I will/shall be there at 9 AM. 构成将来时
    • Shall we meet at 9 AM. 建议
    • You shall not murder. 警告
    • We should treat the rabbit well. 表应当
    • It should rain tomorrow. 根据条件推测,可能性较大
    • It’s suprising the he should be late. 表竟然
    • If it should rain tomorrow, I wouldn’t go. 构成虚拟语句
  5. will/would
    • Will/Would you lend me the book?
    • Ask him. He will/would know. 表推测/过去将来时,需要看具体语境
  6. must
    • You must finish homework first.
    • You must not smoke here. must not 表示禁止
    • You needn’t give me a thumbs-up.
    • The light is on, the rabbit must be at home. 表推测只能用于肯定句中,否定用 can’t
  7. ought to
    • We outght to treat the rabbit well. 表应该, 比shuld更强烈
  8. dare/dared
    • The rabbit dare not tell the truth to the wolf. 情态动词
    • How dare you. 情态动词
    • 作情态动词常用于否定句和疑问句
  9. need
    • I need your coins. 作实义动词
    • The rabbit needs to wait. 作实义动词
    • The rabbit doesn’t need to wait. 作实义动词
    • The rabbit needn’t wait. 作情态动词
  10. used to
  • The rabbit used to eat apples. Now he only eats carrots. 作情态动词
  • Could i use your phone? 实义动词
  • I am used to getting up early. 固定搭配

半助动词 #

  1. be able to
    • can/could, 表现在/过去的能力, be able to 可以表将来的能力
    • I’ll be able to reach school on time if I leave right now. 表将来
    • I was able to reach school on time because I left home early. 表过去,成功做成某事
  2. be going to
    • 很快就要做某事,很强的主观能动性
    • I’m going to eat dinner at 6PM today.
  3. be about to
    • 马上就要做某事,时间更短
  4. be to
    • You are to finish homework fist. 表被命令
    • I think they’re to fall in love with each other. 表命中注定
  5. had better
    • 最好做某事,暗含如果不这么做有不好的后果
    • You had better follow my orders.
    • You’d better follow my orders.
  6. have to

系动词 #

  1. 联系,赋值
  2. I am tall.
  3. The carrot smells well. 系动词
  4. I smell(实义动词,及物) something! Oh no, the carrot has gone bad. It smells(实义动词,不及物).

使役动词 #

  1. 使,让,令
  2. make
    • 迫使…做
    • I make the wolf eat carrots from time to time. eat为非谓语动词, 省略to
    • The carrot made the wolf full. 接形容词
  3. let
    • 允许…做
    • I’ll let the wolf eat some chocolate.
    • Let me out. 接副词
  4. have
    • 给…责任/任务
    • I had someone wash my car.
    • I had my car washed. 被动
  5. get
    • 说服/鼓励…
    • I’ll get the wolf to clean the kitchen after she washes the dishes. 说服,鼓励
    • I got my nails done. 接被动
    • I had my nails done. 接被动
  6. force, drive, leave

从句 #

分类 #

  1. 根据5种基本句型分类
    • 主语从句
    • 宾语从句
    • 宾语补语从句
    • 表语从句
    • 定语从句
    • 状语从句
    • 同位语从句
  2. 根据10种词性分类
    • 名词从句
      • 主语从句
      • 宾语从句
      • 表语从句
      • 宾语补语从句
      • 同位语从句
    • 形容词从句
      • 定语从句
    • 副词从句
      • 状语从句

形容词从句(定语从句/关系从句) #

思维方式 #

  1. 中文: ..的..的..的葫芦卜
  2. 英文: ..胡萝卜是…的胡萝卜

构成 #

  1. a carrot that I bought, 先行词后接关系词
  2. 关系代词
    • The rabbit is eating a carrot that I bought. 宾语(物)
    • The teacher who ate a carrot is a rabbit. 主语(人)
    • The teacher whom I saw yesterday is a rabbit. 宾语(人)
    • The teacher whose favorite food is carrot is a rabbit. 主语(人称代词)
    • The food which/that the teacher likes is a carrot. 宾语(物)
    • 语义中先行词是唯一的只能用that, 多选一用which/that
      • all the rabbits that ate a carrot, 这里是一个整体, 只能用that
      • the only rabbit that ate a carrot
      • the first rabbit that ate a carrot
  3. 关系副词
    • This was the place where/at which the rabbit ate the carrot. 副词(地点)
    • This is the reason why/for which the rabbit ate the carrot. 副词(原因)
    • That was the day when/on which the rabbit ate the carrot for the first time. 副词(时间)

限定与非限定 #

  1. The rabbit ate the carrot which was on the table. 限定, 可能有很多根胡萝卜,吃了桌上那根
  2. The rabbit ate the carrot, which was on the table. 非限定, 吃了根胡萝卜,并且是桌上那根(可能只有一根)
  3. 非限定常作为插入语
    • My head, which is big, is useful when it rains.
    • The biggest carrot, which the rabbit ate, was on the table.
    • The biggest carrot which the rabbit ate was on the table. 表唯一只能用that
  4. 非限定性从句不一定指代先行词,也可能是整句话
    • The rabbit ate the carrot, which was not supprising.

名词从句 #

主语从句 #

  1. 确定的信息
    • That the rabbit ate a carrot is obvious(is a secret/was discussed/happened). 兔子吃了胡萝卜,这件事是明显的
  2. 不确定的信息
    • Whether the rabbit ate the carrot is obvious.
    • Where the rabbit ate the carrot is obvious.
    • When the rabbit ate the carrot is obvious.
    • How the rabbit ate the carrot is obvious.
    • Who ate the carrot is obvious.
    • What the rabbit ate is obvious.
    • 避免头重脚轻,采用形式主语
      • It is obvious(was discussed/happened) whether(where/when/how…) the rabbit ate the carrot.
      • It is suggested that you [should] eat a carrot 虚拟语气

宾语从句 #

  1. 确定的信息
    • I saw [that] the rabbit ate a carrot. 只有that可以省略
    • 不可省略that
    • I didn’t konw [that] the rabbit ate the carrot and [that] you saw it.
    • I know, just like you do, [that] the rabbit ate the carrot.
  2. 不确定的信息
    • I saw whether(where/when/who/how/what) the rabbit ate a carro. 这些引导词不能省略
  3. 否定加载谓语动词前而不是从句
    • I dont’t think [that] the rabbit is smart.
  4. 主从时态一致
    • I dont’t think [that] the you are right.
    • I didn’t think [that] the you were right.
    • 例外(客观事实)
      • I knew that the sun rises in the east.
  5. be…adj…that
    • I am sure that there’s a carrot ont the table.

表语从句 #

  1. The problem is that the rabbit is hungry.
  2. The quesion is whether(waht/where/how/when) the rabbit should eat the carrot.
  3. 其他系动词
    • feel, seem, look, taste, smell
    • It seems that the rabbit is hungry.

同位语从句 #

  1. 常作为从句修饰抽象的名词
    • The fact that the rabbit ate the carrot did not supprise me.
    • The question whether the rabbit will eat the carrot is on all our minds.
    • I have no idea who ate the carrot.

宾语补语从句 #

  1. You can call me Papa rabbit. –> You can call me what you like.
  2. My education made me who I am today.

副词从句(状语从句) #

表时间 #

  1. The rabbit ate a carrot before the wolf stopped by. 之前
  2. Before the wolf stopped by, the rabbit ate a carrot. 地址调换,要用逗号断句
  3. when, while, as
    • when: 时间点 “突然”
    • while: 时间段
    • as: 同时
  4. after
  5. since
    • The rabbit has shared three carrots since the wolf stopped by.
  6. until
    • The rabbit waited until the wolf stopped by.
  7. as soon as
  8. the next time
    • The rabbit will share the biggest carrot the next time the wolf stopped by.

表地点 #

  1. The rabbit ate the carrot where he found it. carrot不能是地点,所以是副词从句
  2. The rabbit ate the carrot at the place where he found it. 定语从句
  3. The rabbit will go where(wherever/anywhere) he found a carrot.

表条件 #

  1. If the rabbit sees a carrot, he will eat it. 真实的假设, 用一般现在时态
  2. Unless you like this video, you will not give it a thumbs-up.
  3. Provided that my video is excellent, you will give it a thumbs-up.
  4. As long as I make excellent videos, you will remain my follower.
  5. In case you don’t understand, please comment below.

表让步 #

  1. 假设
    • Even if i see a carrot, I will not eat it.
  2. 事实
    • Although I see a carrot, I will not eat it.
  3. 不确定事实如何
    • No matter what happens, I will not eat it.
    • Regardless of what kind of video I make, you will give it a thumbs-up.

表方式 #

  1. I fell good as if I had just eaten a carrot. 假想
  2. Eat the carrot as I do. 非假想
  3. Leave the carrot as it is.
  4. You spend money the way(in which) millionaires do.
  5. Eat the carrot the wat I eat it.

表比较 #

  1. He is smarter than me. –> He is smarter than I am.
  2. This carrot is bigger than that one. –> This carrot is bigger than that one is.
  3. She is more beautiful than Snow White. –> She is more beautiful than Snow White is.
  4. She is as beautiful as Snow White is.
  5. The more you practice English, the fluent you become.

表原因 #

  1. The rabbit ate the carrot because he was hungry.
  2. Since you are hungry, you can eat the carrot.
  3. As you were not here, we ate the carrot without you.
  4. beacause > since > as
  5. since, as 引导的从句一般只能放到主句之前
  6. You must really like me, for you have given all my videos a thumbs-up. for构成复合句而不是复杂句

表目的 #

  1. In order that I could finish the video in time, I pulled an all-night.
  2. I pulled an all-night, so that I could finish the video in time. so that不能放在句首

表结果 #

  1. I ate a lot of carrots for lunch so that I wasn’t hungry at all in the afternoon. so that表结果不是目的
  2. I like this video, so I’ll give it a thumbs-up. so复合句
  3. I ate so many carrots for lunch that I felt sick afterwards.
  4. It was such a tasty carrot that I ate it all at once.

编码 #

  1. Jedis连接是不安全的, 可以通过池来解决
    • 最大连接
    • 最大空闲
    • 最小空闲
    • 超时时间
  2. sprint-data-redis封装redis命令的思想 sprint_dataj
  3. 避免菱形代码的一种方式
    • if (cacheCode == null || !cacheCode.toString().equals(code)){}
  4. ThreadLocal
    • 进行对象跨层传递的时候,使用ThreadLocal可以避免多次传递,打破层次间的约束
    • 线程间数据隔离
    • 进行事务操作,用于存储线程事务信息
    • 数据库连接,Session会话管理
  5. 引用
    • 强引用, java: gc不回收; python: 引用计数不为0并且不回收
    • 软引用, java: gc时内存不足才回收; python: 无此概念
    • 弱引用, java: gc时就回收; python: 不增加引用计数, 被引用对象回收后,弱引用对象置为None
  6. session: 每个浏览器都会生成一个sessionId, 浏览器请求时会放在cookie里提交