to do sqrt, or square root-- no, I'm going to square root use sqrt, that's the name I'm using here-- square root a hundred different places in some piece of code. Without function, I'd have to copy that piece of code everywhere.
让我做一下准备,想象一下我要调用sqrt或者-,不,我会调用sqrt函数,这是我在这里用的名字,我得把这段代码到处复制。
anywhere around Buckingham Palace or Trafalgar Square,
白金汉宫和特拉法加广场周围地区,
So I guess I should go back, and let me do this correctly this way. Again, I can look at test, test and I guess test now if I want to get the element out-- angle bracket or square bracket?
但是这不是我想要的对不对?,我认为我该回到这里,让我改正这个错误,好,那么我还是对元组,那么现在我想从test中取出元素来?
Try to imagine-- can you do that or can you not do that?-- try to imagine a round square.
试着去想象,你可不可以这样,试着去想象一个圆的方形
The backmost square-shaped chamber of that inner shrine was the inner sanctum or the holy of holies.
神殿最后面的正方形的空间,是内圣所或者说,最神圣的地方。
So again if we look at this in terms of its physical interpretation or probability density, what we need to do is square the wave function.
如果我们从物理意义或者,概率密度的角度来看这个问题,我们需要把波函数平方。
I remember walking around the square during mu lunch hour, walking faster and faster trying to get around, four or five different classes of kids, all of whom were verbally abusive to me, and feeling there was no place that I belong there was no place that I felt connected to other kids.
我记得我在广场周围走着,那会儿正是午餐时间,我越走越快,想翘过接下来的四五个不同的班级,班上的孩子都对我恶言相向过,我觉得自己无处可去,我找不到自己和其他孩子相联系的地方。
int Y Well, I said int X and int Y; so that gave me one square here called X, one square here ; or wherever, called Y, done, one was put in here; two was put in here, and then I called this function swap.
好的,我声明了int,X,和;,然后我这里有个正方形叫做X,一个正方形,叫做Y,完成,1放在这里;,2放在这里,然后我调用这个swap函数。
What we want to do now is compute the mean and variance of the portfolio-- or the mean and standard deviation, since standard deviation is the square root of the variance-- for different combinations of the portfolios.
我们现在要做的是,计算这个投资组合的均值和方差-,或者均值和标准差,因为标准差的平方就等于方差-,这对任何投资组合都是一样的。
And the good news was we didn't have to worry about how math did square root or anything like that, we just got it and we used it.
也可能是其他数,好消息是,我们不必担心math函数是怎样开方的,我们只要使用它就好。
So in the first case of this first bond here that I've put in a square, what type of a bond is this, is the sigma or pi?
在这第一个键里,我用方框把它标出来了,这个键是什么类型的,sigma还是π?
And keep going, until the square of one of those integers is greater than or equal to - sorry, just greater than x. OK, why am I doing that? When I get greater than x, I've gone past the place where I want to be.
如果还是比x小的话,跳到3,这么继续下去,直到一个整数的平方大于或者等于,对不起,是大于x,好,为什么我要这么做呢?,让我得到的整数的平方和。
You know, if you're wandering through Harvard Square and you see an out-of-work Harvard grad, they're handing out examples of square roots, they'll give you an example and you can test it to see is the square root of 2, 1.41529 or whatever.
你知道,如果你从哈佛校园里穿过去,你看见了一个失业校友,正在派发平方根的示例,他们会给你一个例子,而你会检查2的平方根是1。41529或者别的什么。
I can check it, so if this was part of some other computation, I want to know, did it find a perfect square or not?
我可以检验它,因此如果这是其它计算的一部分我想知道,它能否找到一个完全平方根呢?
Or, it could act like a square root machine.
或者,它可以表现的像个开平方根的机器。
If I say x is 2, I want to know, what's the square root of 2, well if you're enough of a geek, you'll say 1.41529 or whatever the heck it is, but in general, this doesn't help you find the square root.
如果我说X等于,我想知道,2的平方根是多少,那么如果你足够书呆子你就会说,1。41529或者随便什么玩意儿,但是大体上,它不会帮你算出平方根。
应用推荐