It actually lets you see how to get access to that pointer so you know what you're referring to.
怎么来取得指针,以得知在对什么进行操作,但是这是个简单的设计决定。
A low-level language, we used to call this assembly programming, you're down at the level of, your primitives are literally moving pieces of data from one location of memory to another, through a very simple operation.
一个低级的语言,我们曾经将其称为假设编程,你们只是处于用基本要素,把一些数据碎片,从记忆存储器的一个地方,通过简单的操作来转到另外一个地方。
Now, according to sort of a simple-minded view of operant conditioning in behaviorist psychology, the children you reward should do it more.
根据简单的,行为心理学的操作性条件反射观点来看,拿到奖励的小孩应该会画更多画。
It's a little more involved on a PC but it's all free, the software you can download, and Linux in similar operating systems generally come with a compiler or you run a simple command to get it.
在PC机上有点复杂,但是它是免费的,你一般下载的软件,类似Linux的操作系统等等通常都需要,一个编译器,或者你可以运行一些简单的指令来获取。
So we have associated with simple things, a set of operations.
鉴于我们已经学过,一些简单的操作。
And then to create the object, I'll simply do a set of inserts.
我将此返回做为我的集合,然后创建对象,我会一系统简单的插入操作。
So this first little piece of code right here says, ok you give me 2 points, I'll create another 1 of these lists and I'll simply take the x, sorry I shouldn't say x, I'm going to assume it's the x, the x-values are the two points, add them together, just right there, the y-values, add them together and return that list.
好,为了来认识到这一点,让我们来看一个简单的小例子,在你们的课堂手册上,你可以看到我写了一个小程序,它假设我得到了,这些点中的一些,我想对它们做一些操作,例如我想把它们加到一起,那么这里的第一小片,代码的意思是,好给我两个点,我会再创建一个数组。
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中表达式就是,运算对象,操作符,运算对象,当我们处理这样的简单表达式的时候,我把表达式传给处理器,处理器给我返回了我想要的结果,对不对?
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的编辑器,这个跟写字板和记事本差不多-,非常简单的,只是通过一种有用的方法而进行精简了的,所以你们可以把注意力集中在编写代码上,而不需要学习一些新的界面操作。
All right? And if you want to do other things, whoops, sorry-- and add them together, we will get out, again, a concatenation of that string. And these will, we'll let you work through the variations, but these are the simple expressions we can use.
对不对?如果你想要进行一些别的操作,哦,对不起-是加到一块,然后结果值也是,两个字符串的链接,这些会,我们会让大家慢慢学习变量,但是这些是我们能用的最简单的表达式。
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声明来发现这个错误,但是至少应该用简单的例子来手工模拟下,代码的思想可以让你,对一些很重要的问题进行检验。
I can write it explicitly. I can write it inside of a FOR loop. And we've started to add, and we'll see a lot more of this, examples of collections of structures so that we don't just have to do something that can be easily described as walking through a set of things but can actually be a collection that you walk through.
我可以明确的写出来,我可以把它在FOR循环的内部写出来,然后我们开始学习了add这个运算符,我们会在以后学习很多的,集合的数据结构的例子,这样一来我们可以进行一些,很简单的遍历集合的操作,我想要为大家指出的最后一件事情是。
应用推荐