If my code is correct, what should the average price be, after say, 100 days, if there's no bias. Pardon?
如果我的代码没写错的话,如果没有偏向值那平均价格会是多少呢,如果没有偏向值,请说?
So I'm going to comment those out, and let's go down to this piece of code, and uncomment it.
那么我会把这些注释上,让我们看看这段代码,取消注释。
The structural moment of concentration on the code for its own sake cannot be avoided, and literature necessarily breeds its own formalism.
集中在代码上的结构瞬间,因为它本身的原因不可避免,文学必要地导致了它自身的形式主义。
And notice because I have just one line of code inside of each of these branches, what have I clearly omitted?
请注意因为我在每个分支中只有一行代码,显然地我省略了什么?
Chapters 17 through 26 then are a block of material that's referred to as the "Holiness code" because of its special emphasis on holiness.
7章到26章是一块,被称为“神圣的代码“的内容“,因为它侧重于神圣。
I'm not going to do it for you, but what would I think about doing when I change the code?
要改变代码应该做什么呢?,我不会帮你们做这些,但是我在改编代码的时候会想什么呢?
I will be posting code that you can play with, and I suggest you go through exactly this kind of exercise.
我给你一些你用的上的代码,我建议你们,多进行一些这种实验。
I've written a little for loop, which is going to iterate over all of the elements in the list.
让我们先看看这儿的代码,我已经写了一个循环语句,用来迭代处理数组中所有的元素。
I'm going to start somewhere near the middle of the code. Again, a lot of times, people don't do that.
我会在代码中间的某个位置开始,再说一次,很多时候人们不会这么做。
So we left off last time with looking at a bit of coding and teasing you with the upcoming problem set.
我们上次讲到了查看一些代码,并且给你们带来这下面的习题。
Right now, I have to take that piece of code and replicate it everywhere I want in my larger file.
现在我要把这段代码,复制到,大文件中的各个部分。
What happens now after we've executed this third line of code, what happens next in the story?
我执行完第三行代码会发生什么呢,在这之后会发生什么呢?
All right, those pieces of code inherently involved something that does depend on the size of the input, or on the particular input.
好,这些代码,肯定会涉及到一些,与输入的大小相关的东西,或者说与特定输入相关。
So, inside of code, or inside of a script, there's no print, unless we make it explicit.
因此,在代码里面,或者在脚本里面,不会有显示结果的功能,除非我们让它这么做。
Alright, we are back so we just wrote a programming pseudocode or walk through a programming pseudocode.
继续上课,刚才我们只写了一个伪代码,或者说简单地过了一下。
And in the process of tidying it up and making it prettier, I'll often by accident find the bug.
让我的程序更漂亮些,在这个清理美化代码的过程中,我常常无意中发现我的错误。
And in particular, I can then ask the following question, which is, what's different between those two pieces of code?
是有个明显的模式的,我特别要问如下的问题,这两块代码的,不同之处在哪儿?
And we will show you exactly how you can write programs that actually interact with the user in that way.
我们将给大家示范如何,书写代码以及跟用户交互。
The other thing you want to do is find the part of the program that is most likely at fault.
你们要做的另外一件事就是找出,最可能出错的那一部分代码。
What we will distribute for most lectures is a handout that's mostly code examples that we're going to do.
我们在大多课堂上会散发一些,印着我们要做的,代码范例的资料。
I was being a little lazy on Wednesday in the interest of simplifying the code as much as possible.
在周三我在那个网站上尽可能地,简化代码的时候,我有点偷懒。
All right, you can see that this little piece of code, it's got a loop in there, and what's it doing?
好,你们看到的这一小块代码,是做了一个循环吧?,他在做什么?
Right. If you look at the rest of that code, gee, it looks a lot like what I had elsewhere.
好了如果你看看剩下的代码,天呐,看上去就像我在别的地方写过的。
You will be able to infer from some of our code how in fact you can implement some more sophisticated programs.
你可以从一些代码中推断出,应该要怎样实现一些较复杂的程序。
And they're awfully simple because, all I can do now, is decide whether to execute some piece of code or another.
它们之所以太简单的原因是:,现在我能做的,就是,决定执行一块代码或者执行另外一块。
You don't have this particular code on your handout, you do have a code that uses the same concept.
在你们的讲义上没有这种代码,你可以看到相同概念的一个代码。
Having now used this pseudo code to line things up, I can start putting some additional structure on this.
用伪代码把这些事情串起来后,我可以开始进行,一些结构方面的优化了。
But there's a key line of code that I lost over a moment ago and that was this one here.
但是我刚才漏了一行关键的代码,就是这里的这一行。
What is that? It's the piece of code we wrote for computing square roots, square roots of actually perfect squares.
对吧?这是什么呢?,这是我们写的计算平方根的代码,计算完全全平方根的。
It could be, preconditions I want to have on input It could be, explanations of specific things you're doing.
也可以是我对输入的预期是什么,也可以是,对代码,正在进行的特定操作的解释。
应用推荐