On Thursday, we'll look at why that allows you to do lots of things more conveniently than you can do without mutation.
周四我们会探讨下,为什么这种可变性会让你,在进行很多操作的时候方便了许多。
So Israelite-Judean religion on the ground shared many cultic forms and practices and rituals with Canaanite and Ancient Near Eastern culture generally.
因此以色列-犹太宗教本质上来说,和迦南以及古近东时期的文化,在宗教形式、操作和仪式上有很多共同点。
Or take this value out of memory, run it through some other simple operation, stick it back in memory.
或者从记忆存储器中取出一个结果,在类似的操作中运行,再插回到存储器中。
So thankfully, modern operating systems allow you to put parts of files here, parts of your file here, parts of your file here, but the end result is that your files get fragmented.
因此,谢天谢地,现代操作系统允许你,把这里的文件进行分块,在这里存一部分,在那儿存一部分,但最后的结果是你的文件变成了分片的。
What this is is learning the relationships between what you do and how successful or unsuccessful they are, learning what works and what doesn't.
操作性条件作用,是在学习行为与成功,或失败程度之间的关系,学习什么行为起作用,什么行为不起作用。
What that will look like in practice is that we'll cover not so much information.
所以我们在实际操作时,不会传达过多信息方面的东西。
Practically, sons didn't all live in the same place with their father.
实际操作中,儿子并不全都和父亲住在一起。
We do this in the undergraduate Biomedical Engineering laboratory in the Malone Building so that we can do demonstrations and sort of hands on projects to really get a little bit deeper into the subject that we're considering.
开会的地点在,生物医学工程本科生实验室,在马龙大楼,这样我们就能通过做演示和实际操作,使大家较深刻地了解,我们讲过的东西
It actually lets you see how to get access to that pointer so you know what you're referring to.
怎么来取得指针,以得知在对什么进行操作,但是这是个简单的设计决定。
On the other hand, if the value I'm looking for here- sorry, the value I'm looking for is smaller than the value I see here, I just need to look here. All right?
如果我的目标数比这个值要小呢?,我就在这边找就对了,对不对?,做完了这一步,我可以在下一步做相同的操作,假设我选中了这一分支?
- And here as promised is that other operator -- looks a little weird, but because assignment is already using the equal sign to assign one value on the right to a variable on the left.
在这里正像所承诺的那样,其他的操作-,看起来有点怪异,但是因为“=“已经被用来当赋值运算符了,用来把右边的一个值赋值给左边的变量。
Or another way of saying it is, we're going to use as the basic steps, those operations that run in constant time, so arithmetic operations.
我们用可以在恒定时间内完成的操作,算法,比较,内存读取。
So the interpreter is simply operating directly on your code at run time.
因此解释器在运行程序的时候,会直接的对你的代码进行操作。
And those are two things that you'd like to do with every looping construct you write: you'd like to be able to assure yourself that they will always terminate, and then the second thing you'd like to do, is to assure yourself that it does give you back a reasonable answer.
就是现在我有了能去检查程序,是不是做了正确的操作的能力:,这就是你们在写每个循环程序的时候,都要注意的两个事情:,第一件事情是要确保程序可以终结,第二件你要做的事情,就是要确保程序返回了正确的答案。
And that operation is being performed before others.
并且那个操作是在其它操作之前的。
So this is doing comparisons.
那么这个操作是在做比较。
And we're going to see, well all right.
在这一块程序中做的操作。
Only the operating system has controlling of byte zero NULL in the computer's RAM and so if a function ever returns null, aka zero, well, something must have gone wrong because that can't possibly belong to me that memory because by human convention zero is owned by the operating system; not by a program I wrote.
只用操作系统在内存中能够控制,字节0,并且如果一个函数返回,或者说0,好的,可能出错了,因为那可能是不属于我的内存,因为惯例上,0是由操作系统拥有的,而不是由我的程序拥有的。
Now, suppose in fact these weren't x and y glued together, these were radius and angle glued together.
我实际也说过了,我在这里操作的是,和这两个点。
And so the program may do different things on different runs. We'll see a lot of that, because it's used a lot in modern computing.
因此程序会对不同的输入做不同的操作,我们会看到很多这样的情况,因为它在现代计算中被广泛应用。
If you give me a number and a string, I'm going to concatenate them together, it's really different operations, but nonetheless, it's what it's going to do.
如果给的输入是一个数字和一个字符串,我将会把它们连接在一起,这实在是不正确的操作,但是无论如何,它就是会去这么做。
And so I'm going to go back to this idea of a class, and let's build the first of these, and that is shown right here on this piece of your handout.
你把半径加到一起,你不会把角度加到一起,你需要再笛卡尔坐标下,进行这个操作,那么我这里在讲的就是。
And I'm cheating here, right, because what am I doing?
然而这里我没这么做,对,因为我在做什么操作呢?
So it's doing something underneath the hood.
它会在后台运行一些的操作。
If you've ever noticed, Mac OS has its Apple menu on the top left and Windows has its start menu in the bottom left, really for no compelling reason.
如果你注意到,你会发现,Mac操作系统,在其左上角是Apple菜单,Windows却把它的开始菜单,放在左下角,毫无理由可言。
And in Python the expression is, operand, operator, operand, when we're doing simple expressions like this, and if I give it to the interpreter, it gives me back exactly what you'd expect, which is that value. OK?
在Python中表达式就是,运算对象,操作符,运算对象,当我们处理这样的简单表达式的时候,我把表达式传给处理器,处理器给我返回了我想要的结果,对不对?
I spotted an error here, I could have spotted it by running it on different test sets, and using prints things, another way of doing it, but this idea of at least simulating it on simple examples lets you check a couple of important questions.
操作么?我在这里发现了一个错误,我也可以通过运行不同的测试集,或者运用print声明来发现这个错误,但是至少应该用简单的例子来手工模拟下,代码的思想可以让你,对一些很重要的问题进行检验。
You open what we call the "text editor," the specific one we used on Wednesday was called Nano, -- which is similar to Notepad or TextEdit -- totally simple, kind of dumbed down but in a useful way so that you can just focus on writing code and not learning some new interface.
你先打开那个“文本编辑器“,就是我们周三用过的叫做Nano的编辑器,这个跟写字板和记事本差不多-,非常简单的,只是通过一种有用的方法而进行精简了的,所以你们可以把注意力集中在编写代码上,而不需要学习一些新的界面操作。
And in this case, we go from 8 to 4 to 2 to 1 three times and then on each iteration of this algorithm, each pass across the board I'm touching N numbers, so that means I'm doing N things, log N times.
在这个例子中,我们从8得到4,到2,再到1,是3次,在这个算法的每次迭代中,每一趟我都会操作N个数,也就是所我每次要做N步操作,一共要做,log,N,次。
应用推荐