读书笔记
文章平均质量分 79
codists
Life is short, You need Python
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
关于扑克牌的一些讨论——《Fluent Python 2》读书笔记
一、说明参考资料为维基百科的 Playing Card 词条,非严肃性论证,只是对代码为什么这么写做讨论。二、扑克牌的起源import collectionsCard = collections.namedtuple('Card', ['rank', 'suit'])class FrenchDeck: ranks = [str(n) for n in range(2, 11)] + list('JQKA') suits = 'spades diamonds clubs hea原创 2022-05-14 11:25:48 · 285 阅读 · 0 评论 -
Programming Abstractions in C阅读笔记:p293-p302
(1)quadratic time(二次时间)答:In mathematics by 1660s;the algebraic quadratic euqation(二次方程, 1680s) are so called because they involve the square(x^2) and no higher power of x。这里要注意quarter是四分之一,但是quadratic是二次(x^2)的意思。答:主语可以是物也可以是人。翻译的时候需要灵活转变。原创 2024-02-25 18:53:55 · 1516 阅读 · 0 评论 -
Programming abstractions in C阅读笔记: p114-p117
示例:p114,The first prototype is for the function RandomInteger(low, high), which return a randomly chosen integer in the range between low and high, inclusive。主要通过random number介绍了随机数的相关用法,interface示例(random.h),client program示例(craps.c)。1.inclusive什么意思?原创 2023-08-16 23:17:44 · 367 阅读 · 0 评论 -
Programming abstractions in C阅读笔记:p179-p180
(1)包含单个字符的字符串(如"a"),或者空字符串(如" ")也是回文。(2)示例:“level”、“noon”。答:palin(“back”) + drome(“a running”)。c. a word that reads the same forward and backward(回文)。原创 2023-10-16 09:48:16 · 231 阅读 · 0 评论 -
Programming abstractions in C阅读笔记:p161-p165
《Programming Abstractions In C》学习第57天,开始第4章“Introduction to Recursion”的学习,p161-p165,总结如下。答:p164, The strategy, called recursion is defined as any solution technique in which large problems are solved by reducing them to smaller problem of the same form. Th原创 2023-09-16 23:50:07 · 240 阅读 · 0 评论 -
Programming Abstractions in C阅读笔记:p338-p346
栈的实现包括入栈、出栈、判断栈是否为满,判断栈是否为空等。作者结合RPN计算器来实现,稍显无聊。return 0;原创 2024-03-24 14:26:04 · 579 阅读 · 0 评论 -
Programming abstractions in C阅读笔记:p91-p106
看书是为了掌握理论,了解技术全貌,使知识系统化,所以个人采取的方式是每章随机选一题完成,检验学习的效果,其它题目跳过。答:instead of/rather than(而不是),所以词组里面包含preference(偏爱),但是to后面跟的被对比的内容,是否定的。《Programming Abstractions In C》学习第45天,p91-p102,完成第二章内容学习。答:make the effort to do sth,费心,努力。2.in preference to什么意思?原创 2023-08-10 23:19:12 · 242 阅读 · 0 评论 -
Programming Abstractions in C阅读笔记:p258-282
完成第chapter 6的学习。本章主要讲解回溯算法,并通过“maze(迷宫)”和“minimax strategy(极小化极大策略)”两个实际的例子来讲解。回溯算法简单来说就是从某个节点开始,沿着一条路往下走,如果该条路走不通,那么返回选择其它路。在求解的过程中也涉及到递归算法。回溯算法的经典应用有:八皇后问题,背包问题,迷宫问题, 组合排列问题。我们需要通过实际的练习才能更好的理解该算法的思想。原创 2024-01-26 07:26:45 · 381 阅读 · 0 评论 -
Programming abstractions in C阅读笔记:p166-p175
(1)斐波那契数列来源斐波那契数列来自于《Liber Abaci》一书里兔子繁殖问题,相关资料很多,这里不赘述。(2)关于《Liber Abaci》一书《Liber Abaci》——Liber:a book(意思是“书”);Abaci:abacus的复数形式(意思是“算盘”)。原创 2023-10-08 09:52:50 · 163 阅读 · 0 评论 -
Programming abstractions in C阅读笔记:p84-p87
roll:常用作动词,但也有名词的用法:a piece of file, paper or cloth that is rolled into the shape of a tube(卷,卷轴)。对于record,需要其基本用法:定义、声明、field访问以及其与指针的关系。答:withhold:tv. to refuse to give back sth,隐瞒、扣留。答:n. a small company(小公司)。2.withholding status什么意思?1.payroll是什么意思?原创 2023-08-08 23:34:01 · 641 阅读 · 0 评论 -
Programming abstractions in C阅读笔记: p118-p122
(1)seed均匀分布属于概率论和统计学范畴,有连续性均匀分布和离散型均匀分布。参考:(1)连续性均匀分布():(2)离散型均匀分布(答:dis-(“off, away”) + cernere(“distinguish, seperate, shif”),“to see, recorgnize, understand sth that is not clear(识别)”,当使用这个单词的时候,表示“被识别”的对象并不是那么“clear”。原创 2023-08-20 22:18:59 · 391 阅读 · 0 评论 -
Programming abstractions in C阅读笔记:p138
3.4小节介绍“The standard I/O library”,涉及I/O操作最常用的接口是stdio.h,我们经常用到里面的printf函数。答:p132,“Every program in the text includes this interface, mostly because it exports the print function”。mostly的意思是“adv. mainly(主要是)”。原创 2023-08-30 06:55:10 · 295 阅读 · 0 评论 -
Programming abstractions in C阅读笔记:p144-p160
第三章的内容主要介绍C语言中的库(library)和接口(interface),如我们最常遇到的以下三种场景随机数:<stdlib.h>字符串:<string.h>I/O操作:<stdio.h>答:根据上下文的意思,subdivide是分了再分(you divide it into smaller parts and then subdivide these parts into smaller parts)。原创 2023-09-06 08:46:07 · 512 阅读 · 0 评论 -
Programming Abstractions in C阅读笔记:p246-p247
本章通过“the game of nim(尼姆游戏)”,这类以现实生活中事物作为例子进行讲解的情况,往往对学习者要求比较高,需要学习者具备一定的人文、历史知识或专业知识,如果缺乏这方面的知识,就会导致读者在阅读过程中进度缓慢——如果对尼姆游戏比较熟悉的读者,那么便很快就知道作者在说什么,甚至可以跳过对规则的介绍部分。而不了解的读者,则需要一步一步的跟随作者去了解游戏规则。原创 2024-01-14 11:17:07 · 988 阅读 · 0 评论 -
Programming abstractions in C阅读笔记:p176-p178
tn= tn-1+ tn-2序列:3, 7, 10, 17, 27, 44, 71, 115, 186, 301, 487, 788, 1275, …答:ex-(“out of”) + norm(“rule, norm”) + -ous(substituted for Latin-is*, “having, full of”*),即超乎寻常的。adj. “extremely large(巨大的)”之意。原创 2023-10-10 21:12:36 · 241 阅读 · 0 评论 -
Programming abstractions in C阅读笔记:p88-p90
有时候这样就是这样阅读,如果中间没有题目,亦或是生词太多,总是让我一种“学而不思则罔”的感觉——为什么进度那么慢,学了能用在哪里?这个过程是乏味枯燥的,然而我深知打基础的过程是无法逃避的,只有掌握了这些基础,才能在后续的算法中知道怎么去运用这些基础。内存分配可以分为:static allocation、automatic allocation、dynamic allocation。答:be reseasonable or logical,指某个观点、做法或者行为在逻辑上是合理的,讲得通的,在句子中可不译。原创 2023-08-09 23:37:03 · 283 阅读 · 0 评论 -
Programming abstractions in C阅读笔记:p123-p126
这也是一个在计算机相关书籍中出现的词,但有时却不是那么好理解,因为它可以指代很多对象,这里做一个记录。示例:p124。str[i]!= '\0';i++) {在这里,“notation”以理解为“the activity of representing sth by a special system of marks or character”,即“notation”表示的是一种“标记方法”、“表示方法”。2.字符串用法示例// 统计字符串中的空格(space):数组版。原创 2023-08-21 22:36:00 · 279 阅读 · 0 评论 -
Programming abstractions in C阅读笔记:p139-p143
文件I/O操作可以分为一下这些步骤:(1)声明文件指针对象。(2)打开文件fopen()。打开文件的模式有“r”, “w”, "a"三种模式。(3)传输数据读取文件的方式可以是character by character( getc()/putc() ),也可以是line by line( fget()/fput() )。(4)关闭文件fclose()。答:c.the end of sth(终点)。原创 2023-08-31 08:34:17 · 763 阅读 · 0 评论 -
Programming abstractions in C阅读笔记:p130-p131
通过pig latin game掌握字符复制,指针遍历等操作。/** 输入:字符串,这里采用书中坐着自定义的getline函数*/1000// 书中p34, if适用于非此即彼的两种选择(two-way);如果有多个,那么就使用switch。// *表示函数FindFirstVowel返回一个指向char的指针char *word;/** 该函数判断字符是否是元音字母,如果是,返回True,否则返回False。原创 2023-08-28 08:50:23 · 944 阅读 · 0 评论 -
Programming abstractions in C阅读笔记:p127-p129
掌握常用函数如strlen,strcpy用法。答:这里的应该是The function will go ahead and (copy characters right) (on past the end of the buffer),这句话有几个要注意的地方:(1)rightadv. exactly or all the way(完全地),指的是“一直复制/继续复制”。在原文中也有一点"强调"的意思–虽然字符串已经超过了缓冲区的长度(Buffersize),但是strcpy函数还是会复制。原创 2023-08-24 21:33:01 · 318 阅读 · 0 评论 -
Programming abstractions in C阅读笔记:p132-p137
3.2小节介绍了字符串的用法:1.C语言是没有字符串(string)这种数据类型的,但是实际的场景中又很需要这种数据类型,那怎么表示字符串呢?有两种方法:1.用字符数组表示。2.用字符指针表示。2.C自带的字符串库是string,作者为了更好的使用string,封装出了strlib库,所以在书中的代码经常会看到作者在头文件中引入strlib这个库,而不是直接引用string库。3.执行字符串复制的时候要考虑是否会产生buffer overflow问题。原创 2023-08-29 08:49:01 · 397 阅读 · 0 评论 -
Programming Abstractions in C阅读笔记:p242-p245
6.2小结主要讲回溯算法及递归算法在迷宫求解中应用,当然,理解然后用代码实现出来还是有些难度的。不过,这并不影响我们进行下一节6.3的学习。答:u. doub that sth is true or useful,怀疑,怀疑论。(2)skeptic: *spek-(to observe),也写作"sceptic"。c. a person who doubts the truth,持怀疑态度的人。原创 2024-01-10 23:33:33 · 570 阅读 · 0 评论 -
Programming Abstractions in C阅读笔记:p254-p257
答:(2)ambiguous: ambi-(about, around,与…有关的) + agere(drive, lead, act)。原创 2024-01-25 23:39:01 · 544 阅读 · 0 评论 -
Programming Abstractions in C阅读笔记:p248-p253
A generalized program for two-player games”如标题所示,该小节强调要学会从一个复杂的程序中抽象出通用的内容——这也是本书的主旨——“Programming Abstractions in C”。moveT move;while (!break;break;答:p253, You may not terribly interested in a program that plays a nim;原创 2024-01-24 08:03:28 · 1023 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p175-p181
无。vt. amortize originally means “to kill off”, overtime, it evolves to mean “to pay off gradually by periodic payments of principal and interest(分期偿还,摊销)”。英式写法是:amortise。(2)示例。原创 2025-06-13 09:32:50 · 286 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p173-p174
无。vt. to make sth more beautiful by adding something to it(“装饰”)。(3)示例The advantage of doing so is that the mapping is contained entirely within the priority queue, so that the application objects need no further embellishment(《算法导论(第4版)》第 174 页)。原创 2025-05-30 23:49:51 · 317 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p164-p172
(1)(binary) heap(堆/二叉堆)(2)complete binary tree(完全二叉树)(5)应用priority queue(优先队列)。无。关于英语的注解同步更新汇总到 https://github.com/codists/English-In-CS-Books 仓库。原创 2025-05-29 23:04:15 · 354 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p162-p163
(1) (binary) heap(堆/二叉堆)(2)complete binary tree(完全二叉树)(3)max-heap(最大堆)定义:A[PARENT(i)] ≥ A[i]。看了很多定义,不得不说还是这个定义最简洁,准确。(4)min-heap(最小堆)定义:A[PARENT(i)] ≤ A[i]。idom. to a limited degree, to some extent(到一定程度,一定程度上)原创 2025-05-28 10:54:43 · 953 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p156-p161
(1)(binary) heap(堆/二叉堆)(2)complete binary tree(完全二叉树)真是非常不喜欢“树”这种数据结构,各种概念能把人绕晕,例如:树 > 二叉树 > 完全二叉树。(1)faradv. to a great extent, very much(“非常”,Adverb of Degree,程度副词)。(2)示例上面这句话的意思是:如果一棵二叉树不满时只有最后一层不满,且最后一层的所有节点都尽可能地靠左排列,那么这样的一棵二叉树称为完全二叉树。原创 2025-05-27 17:20:49 · 381 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p134-p155
无。c/u. a situation that contains two opposite facts(悖论)。(2)示例关于英语的注解同步更新汇总到 https://github.com/codists/English-In-CS-Books 仓库。原创 2025-05-26 14:14:46 · 188 阅读 · 1 评论 -
《算法导论(第4版)》阅读笔记:p1178-p1212
附录 C 介绍了计数理论(如:和规则,积规则,串,排列,组合,二项式系数,二项式界等),概率理论(如:样本空间,事件,概率论公理,离散概率分布,连续均匀概率分布,贝叶斯定理等),几何分布与二项分布,二项分布的尾部探究。第 5 章会时不时的涉及这些内容,还是先看一下附录 C 比较好。(1)释义adj. having similarity in size, shape, and relative position of corresponding parts(对称的)。原创 2025-05-25 16:52:19 · 348 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p127-p133
(1)定义c. [mathematics]an expression (= mathematical statement) that has two terms (= numbers or symbols) that are not the same(二项式)。(2)示例。原创 2025-05-24 21:41:16 · 897 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p115-p126
无。(1)vagary: vagus(“roving, wandering(闲逛)”)c. originally, vagary means physical wandering, over time, it evolves to describe unpredictable changes(变幻莫测)。(2)示例。原创 2025-05-23 17:08:39 · 473 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p101-p114
compass literally means “to step together”, reflecting the idea of encircling(包围)。c.vt. surround and have or hold with, include(包含)。这两个单词很接近,以至于我老是分不清到底用哪个。encompass: encompass 的意思是 “to include(different types of things),contain, 包含”。原创 2025-05-22 22:23:38 · 319 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p95-p100
无。(1)intuit: in-(“into”) + tueri(“to look at, what over,看”)vt. to understand something immediately based on your feeling rather than facts(凭直觉知道)。c/u. an ability to understand something immediately based on your feeling rather than facts(直觉,直观的xxx)。原创 2025-05-21 10:47:35 · 377 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p91-p94
(1)groundvt. to establish the base(foundation) of something/base something on something(为…建立基础,奠定…的基础),(2)示例。原创 2025-05-20 22:19:52 · 357 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p86-p90
无。(1)inkling: inclen(“utter in an undertone,低声说话”)c. a hint(提示);a slight knowledge(一点点知识,浅薄的认知,强调程度轻微,有限。翻译的时候转成动词翻译较好)。(2)示例。原创 2025-05-19 22:46:39 · 727 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p83-p85
(1)矩阵表示法(2)dense matrix(密集矩阵) & sparse matrix(稀疏矩阵)、无。关于英语的注解同步更新汇总到 https://github.com/codists/English-In-CS-Books 仓库。原创 2025-05-18 23:50:41 · 559 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p82-p82
(1)教材因为第 4 章涉及到矩阵,矩阵属于线性代数(linear algebra)范畴,如果不熟悉,可以看一下作者推荐的两本教材:Gilbert Strang的《Introduction to Applied Mathematics》和《Linear Algebra and Its Applications》。个人补充一本Steven J. Leon, Lisette G. de Pillis的《Linear Algebra with Applications》。原创 2025-05-17 23:58:50 · 524 阅读 · 0 评论 -
《算法导论(第4版)》阅读笔记:p76-p81
(1)定义无。关于英语的注解同步更新汇总到 https://github.com/codists/English-In-CS-Books 仓库。原创 2025-05-16 23:54:56 · 305 阅读 · 0 评论
分享