OK, now what I want to do is just describe a little bit of how do you measure all this stuff, right?
好,现在我要做的就是,介绍一下怎样来测量这些东西?
I mean, this is a really great place to do business, because almost regardless of what it is you do,
这里也是一个发展业务的好地方,因为不管你现在要做什么,
All right. The fourth thing I'm going to do, is I'm going to then construct the block of code.
好,我要做的第四件事情就是,我会去写这块循环代码。
So, what we want to do now is see if we can understand how this backscattering experiment worked. So we will do our own backscattering experiment.
希望现在能更简洁一点,好,我们现在,要做的就是看看,我们是否理解了。
So the Hund's Rule is telling us to put the two electrons in separate orbitals unpaired as opposed to we should not put them in like this, like some librarian might want to fill nicely from left to right, up and down.
所以洪特定律告诉我们,要把这两个电子放在独立的轨道中,而不是像我们常做的那样,像一些图书管理员想要,把书从左到右,从上到下放得很好。
Well, one thing that a literary argument can do is take something small like this and try to give an account for it, so that's what I'm going to do.
好了,文学争论能对向这样小细节,进行描写说明,所以,我现在要做的是。
And you are thinking to yourself, "Ok,fine. So university,academia must make itself with action.
你可能会想,“好,学术界要结合实践做研究。
by asking, which of them are so valuable you'd be prepared to do them even if they would introduce what isn't otherwise there, ? namely, the risk of death?
通过问自己,什么事如此有价值,以至于你准备好要去做,即便它们会带来如果不去做就不会有的,也就是,死亡的风险?
Good, okay. That's certainly the first step.
很好,这是我们要做的第一步
OK, but before I do that, let me drive home this idea of why this is a recipe.
好了,但是在我做那个之前,我们要把这个想法拉回到,“为什么这是个方法“这个问题上来。
All right, and let's just check this out, because I want to make a point of this, let's go back and do the following.
好,让我们记住这一点,因为我想要强调下这里,我们回过头去做如下的操作:
All right. First thing we need to do is have some sort of a theory.
好了,我们要做的第一件事就是,要有一些理论。
Well, I'm going to do the same analogy to a real recipe. So, real recipe.
好吧,我要做一个,真正方法的类比,因此,真正的方法。
Right, what's the second thing I do?
好,我要做的第二件事情是什么?
Come prepared and you will do fine.
来时要准备好,你就会做的很好的。
Just to give you an example of that, for instance, I can do the following: all right, the number four is less than 4 the string three, whereas the string four, oops, is not less than the string three.
仅仅是给大家看一个例子,例如,我可以这么做:,好,数字4比,字符串3要小,而字符串,比字符串3要大。
And remind you that inside of here, I'd better be changing the variable. All right, if that variable that's counting is not changing I'm going to be stuck in an infinite loop, so I ought to that, right, expect somewhere in there, a change of that variable. All right?
我最好改变了计数器的变量值,好,如果计数的变量没有变化的话,我就会被卡在一个无限循环里面,因此我应该【不可闻的声音】,对,在这里的某个地方,改变下计数器的变量,对不对?我要做的最后一件事情就是?
But here's where I'm going to practice a little bit of defensive programming.
但是这儿我们要把编程的,防御性做的好一些。
I'm checking that I didn't leave my program because I didn't find an answer. Well this is a good thing, it's better than my program running forever, but it's a bad thing because I don't have it the square root of 0.25.
我对计数器要做个验证,因为我不会没得到答案就退出程序,好,这其实是个好事,因为它不会让我的程序永远跑下去,但这也是件坏事因为,我没得到0。25的平方根。
And so what I'm really doing is inviting you to take a good, cold, hard look at death, and to face it and think about it in a way that most of us don't do.
那就是我要你们做的,认清,死亡的好和坏,面对它,然后思考它,用我们从没用过的方式。
So what I'm going to do, well, let's get rid of this print statement for now.
所以我想要做的,好吧,让我们先省去这个打印声明。
OK, now, if I actually do this, and I'm going to show you the example, I just, what did I type over there, I got p was a c point.
传入了其他的参数,好,现在,如果我,实际上要做这个的话,我要给大家看个例子。
Well, let's do the smoke test number one: is the mean more or less what we expected?
好了,让我们先做1号发烟测试:,这个平均值是和我们想要的答案差不多吗?
So first thing we should do is scratch our heads and see what's going on here. Alright, let's look at it. What's happening here?
所以我们要做的第一件事,就是抓抓脑袋看看发生了什么,好了,让我们来看看,这儿发生了什么呢?
I'm going to tort-- I'm going to make the font smaller so we can see more.
我们还没看到比较结果,好,你知道我要做什么了么?
And I want to have that because I want to have lots of versions of points.
我想要这么做因为,我想要创建很多点,好,现在让我们回到。
OK. So to do this, we're going to have to do a couple of things. All right, the first one is, what do we mean by input size?
好,为了实现这种方法我们,有些事情要做,第一件事情就是,当我们说到输入的大小的时候代表了什么呢?
I've certainly written code that has this problem, I've tried to use my own code that has this problem, and good to us, right, good hygiene, I'm going to use that word again here, of getting into the habit of writing defensive code up front, it's part of that collection of things that you ought to do is a great thing to do.
我举手了吧?,我当然写过犯这种错误的程序了,我也尝试过应用含有这种错误的代码,不错,好的卫生,我还是要用这个词,对我们有帮助,养成写防卫性,代码的好习惯,是你应该做的,一系列事情之一,也是我们日后要做的主要的事情。
It says, if I want to print out something I built in Cartesian form up here, says, again, I'm going to pass it in a pointer to the instance, that self thing, and then I'm going to return a string that I combine together with an open self and close paren, a comma in the middle, and getting the x-value and the y-value and converting them into strings before I put the whole thing together.
这不仅仅是个列表,它是怎么来做的?,流程是:如果我想要返回,一些已经在笛卡尔模式下建好的值,好,再说一遍,我首先要传入一个,指向实例的指针,也就是,然后我会返回一个,由开括号,闭括号,中间的一个逗号,以及提前转换为字符串格式的。
So I'm going to go over here, and I'm going to type test search-- I can type and if you look at your handout, it's just a sequence of tests that I'm going to do OK. So initially, I'm going to set up the list to be the first million integers.
大家可以看看你们的课堂材料,那儿有一些我要做的实验,好,一开始我先去建立个,含有一百万个integer的数组,对,这有点儿简单,但是这给我提供了这样一个有序的数组。
应用推荐