What lambda that does, it creates on the fly a function, as the program runs. That I can then pass around.
这里的入是在函数运行的时候,由一个函数创建的,然后我会传递这个值。
>> They only use that when the program that you're running-- the program that you're referring to is going to your computer?
>它只有在你运行程序的时候才用到-,那你刚刚提到的程序,会到你的电脑上运行吗?
Whereas in the linear case, I make it ten times bigger, it takes ten times longer to run. OK.
它要占用原来十倍的时间去运行,我一直在说还有一件事情没有讲,这是我要强调的最后一件事。
Now Microsoft is sort of a funny place, we've got these big businesses but in the software business big businesses need to be constantly recreated.
现今的微软是非常有意思的地方,我们运行着庞大的生意,但是在软件交易上,大宗交易更像是消遣。
Distorting price signals , making it impossible for the market to respond as it otherwise would have .
扭曲价格信息,让市场无法正常反应,无法在正常市场机制下运行。
If you escape the pull of gravity, your spaceship will be off, won't be orbiting the Earth.
如果你完全脱离重力,太空船早就飞得没影了,而不是在轨道上运行
Once an invention is seen to work it is rapidly copied around the world.
而当一种创新品运行顺畅的时候,就会在世界范围内被模仿
But let's not try and figure out what's going on with this big, big example because we'll get really tired.
但是我们不用去想,这个超大的例子是怎么运行的,因为那太累人了,哦实际上,在我们这么做之前。
Or take this value out of memory, run it through some other simple operation, stick it back in memory.
或者从记忆存储器中取出一个结果,在类似的操作中运行,再插回到存储器中。
Said a different way, in the case of the straight-line programs, how long would it take to run a program?
换种说法,在直线式程序里面,运行一个程序要多长时间?
GCC -o So, on the one hand, I've run this command here, GCC dash O and this projector I'm highlighting things all day long on the screen here and you're not seeing any of it unfortunately it seems on this projector.
我在这运行了一条命令,这台投影仪我一天到晚的开着,一再强调屏幕上的东西,不幸地,你们却,在投影仪上没有看到它。
I feel pretty good about this, and in fact I ran it a lot of times in my office.
我觉得这很好,实际上我在自己的办公室也运行了很多次。
Run merge sort on those. By induction, if it does the right thing, I'm going to get back two lists, and I'm going to then merge Them together. Notice what I'm going to do.
在这些上面再运行归并排序,根据归纳,如果这样是正确的,我将重新得到两个列表,然后我会把它们合并在一起。
Let's assume, for sake of argument, the thing I'm looking for is bigger than this. In that case, I'm going to throw away all of this, I'm going to hit that bottom line of that code.
让我们假定不是,假定要找的元素,比这个大,在这样的情况下,这些都擦掉,我要运行到代码的最后一行。
OK. Having done this now, I can simply go ahead and run this, and in fact if I go up here to run, you'll see I've got both an option to check the module, though in this case I'm just going to run it.
好,讲完了这些,我可以去执行程序了,实际上如果我在这里运行,你们会看到我同样得到了,一个可以同时检查模块的选项,虽然在这个例子中我就是直接去运行程序了。
But it turns out that on Macs and if you have the right software on PCs, you can kind of get a teaser of what this environment tends to look like and be forewarned, what you're about to see is intentionally very underwhelming.
事实上,它是运行在苹果机上的,如果你在电脑上有正确的软件,可以去看看这个环境大致是怎么样的,提前说下,这个程序不会让你印象深刻,我是故意这样做的。
And so what I see is that as I run this, I'm doing a lot of redundant computation.
因此我在这里,看到的是随着我的运行,我将会进行很多冗余的计算。
If you can figure out why fails on three letters instead of 12, you'll be more than half way to solving the problem.
如果你能明白为什么程序,在输入三个字母的单词的时候没法运行,你就已经解决了问题的一半了。
And so you care-- you care about ultimately how much time is my algorithm gonna take to perform on that worst case running time.
因此你最终所关心的是,算法在最坏情况下需要多长的,运行时间。
If you look at solve 2, it's going to solve2 run through the same kind of loop, printing out all of the answers.
我会让你们看一看,如果你在看,那将运行相同的循环。
So before I try and run my program, I test each part of it independently.
因此在我尝试运行我的程序之前,我都会对它的每个部分进行独立的测试。
Does it give you the answer that you expected it to give? Often, in practical problems, you'll spend just as much time doing performance debugging. Why is it slow?
它返回了期待中的结果了么?通常,在实际的问题中你会花,同样多的时间在性能调试上,它为什么运行这么慢?
All right? A linear search, I start at the beginning of the list and walk all the way through it. All right, if I'm lucky and it's at the low end, If it's not, if it's at the far end, I've got to go forever, and you saw that last time where this thing paused for a little while while it actually searched a list this big.
如果很幸运就在开头,那运行起来很快,如果是在末尾,那就一直得走到头,上次看到了,如果搜索空间很大,程序都会暂停一会,好的,那我希望你们。
But here I want it to be determined, chosen at run time.
但是在这里我想要让它是一个由运行时间。
We're checking the end test and incrementing, actually I was going to, I commented that out for a reason you'll see in a second, but I, normally I would keep this on, which would let me, at each step, see what it's doing. If I ran this, it would print out each step. Which is helping me make sure that it's incrementing the right way.
对不对?进行终结测试然后递增,实际上我要,因为某些你们,马上要明白的原因我把这里注释了,但是我通常会一直这么做,这样能让我看到每一步都做了什么,如果我运行这个程序,它会在每一步都,进行显示,这能帮助我让我确信程序是,在以正确的方式递增。
So it's doing something underneath the hood.
它会在后台运行一些的操作。
So the institution, the accounts remain, they remain alive.
所以机构和账户得以保存,现在还在运行。
So we can see what it's doing is it runs. So let's try fib it here with Fib of 6.
我们可以看到它在,运行的时候做了什么,让我们试试。
And if they can't answer that question, I say well, before you even run it, have an answer to that.
如果他们没法回答这个问题的话,我会说好吧,在你运行实验之前,先回答这个问题吧。
This machinery is so precise that a human hair couldn't even pass between the heads and spinning platters, yet it all works in terrific speeds.
这些设备是很紧密的以至于人的头发,都不能在头和旋转的磁盘之间通过,尽管如此,它的运行速度非常快。
应用推荐