"They are all hurtling around in space at 36,000 kilometers per hour and so even a 1mm piece of space junk can destroy or damage a satellite because it all comes from either dead satellites, satellites which have broken up, satellites which had fuel left in them and exploded."
VOA: standard.2010.07.24
All right, you can see that this little piece of code, it's got a loop in there, and what's it doing?
好,你们看到的这一小块代码,是做了一个循环吧?,他在做什么?
All right, this is actually a very old piece of imperative knowledge for computing square roots, it's attributed to Heron of Alexandria, although I believe that the Babylonians are suspected of knowing it beforehand.
好,这是一个很古老的,关于计算平方根的程序性知识,是亚历山大的海伦提出的,不过我怀疑在那之前,巴比伦人就已经猜想过了。
But for all that, it could just be a particular piece of the missile that does it.
这个问题的答案,可能是导弹上的某一特定部分
So it is a very thin and quick move, one on a second, by which I mean that one electrode, one set of neurons is the a very important piece of the puzzle, but not all that you need.
所以说,这是一个非常细微而迅速的动作,一秒钟一次,我是说一个电极,一组电极对于去猜整个谜很重要,但是你需要的远不止这些。
I'd just like to do a piece of survey research, how many of you, just a show of hands is all I need; how many of you believe ? Socrates is innocent and should be acquitted?
我们来做一下意见调查,有多少人认为,只要举手就可以了;,有多少人认为,苏格拉底是无辜且应无罪开释?
So how many time do you think-- you all have a piece of paper in front you-- how many time do you think you need to roll over the piece of paper ? for the piece of paper to reach the moon?
你们认为需要折多少次-,你们面前都有一张纸-,你们认为需要将纸折叠多少次,才能碰到月亮?
So let's look at the second example, all right, I keep doing that -- this piece of code from here to here gives me a way of now creating a hash table of size 256.
所以让我们来看一下第二个例子,好的,我继续做那件事,这段代码中从这里到这里,是创建一个大小为256的哈希表。
But here is a piece of imperative knowledge. All right?
不过这是个程序性知识,好么?
It can do all sorts of things a piece of chalk can't do.
它能干一堆粉笔干不了的事
I'm given an integer that's a perfect square, and I want to write a little piece of code that's going to find the square root of it. All right so I'm cheating a little, I know it's a perfect square, somebody's given it to me, we'll come back in a second to generalizing it, so what would the steps be that I'd use to walk through it?
完美平方数的整数,我想写一段代码来求这个数的平方根,好,我这儿有点儿作弊了,我知道这是一个完美的平方数了,他们给我的,我们后面会讲怎么产生这个数的,那么我想解决这个问题,需要什么步骤呢?
All right. If you flip to the second side of your handout, you'll see that I have a piece of code there, that does this-- let me, ah, I didn't want to do that, let me back up slightly- this is the algorithm called search.
你可以看到实现这个功能的代码,让我,额,我不想这么做,让我们回来一点,这就是命名为search的算法-,我们来看看这个算法吧。
First of all, two parameters. It's OK. All it says is, when I call this, I need to pass in two parameters for this to work. All right? Now, if I want to use that, I'm going to use a second piece of code here, called Barnyard. I'm going Barnyard to read in a couple of values, convert them into integers, and then I'm going to use solve to get a solution out.
注意我得到了什么,第一,两个参数,它的意思就是我调用这个函数,我得给它输入两个参数,明白了吗?,现在如果我要使用它我得用,这里的第二段代码,也叫,我将读入一组值,将它们转化为整型,然后我会用solve得到一个解决方案。
应用推荐