Who was also one of the word's first programmers. So she was trying to write this program, and it didn't work.
也是世界上最早的几个程序员之一,她正尝试着完成一个,复杂的求反正切的程序。
And will make mistakes. And therefore, you write your programs so that catastrophes don't occur when those mistakes are made.
就是人是很愚蠢的,会犯错误的,因此,你要这样设计你的程序,以达到当犯错误时避免大事故的目的。
>> They only use that when the program that you're running-- the program that you're referring to is going to your computer?
>它只有在你运行程序的时候才用到-,那你刚刚提到的程序,会到你的电脑上运行吗?
Why does agreement to a certain procedure, even a fair procedure, justify whatever result flows from the operation of that procedure?
为什么只要经过了特定程序,公平的程序,不管任何结果都可以视为正当呢?
If you're wondering what's OK or what's not OK, it's very clearly written out in this handout, so make sure you read through it, because it is your responsibility to make sure that your calculator does not have anything extra programmed in it.
如果你不清楚什么可以什么不可以,讲义上写得很清楚,所以请大家务必看完它,因为你有义务保证,在自己的计算器里,没有编上额外的程序。
Chapter 16 describes the procedure to be followed on the Day of Atonement or Yom Kippur.
6章节介绍了在犹太人的赎罪日,应该遵循的程序。
On my computer at home I've got a program that allows my computer to play chess.
在我家里的电脑里有一个,玩国际象棋的程序
And in the process of tidying it up and making it prettier, I'll often by accident find the bug.
让我的程序更漂亮些,在这个清理美化代码的过程中,我常常无意中发现我的错误。
I've decided that I need to be able, in my program, to swap the value of two variables. All right.
我觉定在我的程序中,我可以,交换两个变量值,好的。
And it's hard to imagine a simpler program than this. So we very quickly realize that exhaustive testing is just never feasible for an interesting program.
更简单的程序了,因此我们很快的意识到,对一个程序来说详尽的,测试是永远不可行的。
And the obvious question I could start with is, and suppose I ask you, how long does the algorithm implemented by this program take to run?
我开始这个话题的第一个问题是,假设我问你,由这个算法实现的程序大概,要运行多久才能给出答案?
Matt. - So Matt, for you, what bothers you is not the cannibalism but the lack of due process.
马特,-马特,如此说来,真正困扰你的不是食人,而是缺乏正当的程序。
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.
好,这是一个很古老的,关于计算平方根的程序性知识,是亚历山大的海伦提出的,不过我怀疑在那之前,巴比伦人就已经猜想过了。
And two, to give you a better sense of design especially as your programs get a little more involved and they play or they run for more than just a few seconds time.
另一方面,使你们对设计更有感觉,尤其是你的程序要适用于更多的应用环境或,要运行不止几秒钟时间的时候。
You will be able to infer from some of our code how in fact you can implement some more sophisticated programs.
你可以从一些代码中推断出,应该要怎样实现一些较复杂的程序。
Let's take a quick glimpse of what it's like to write a real program albeit a very trivial one.
下面是一个真正的程序,尽管它很简单。
So really, once we start writing more interesting programs, you would have to type out long annoying commands like that to just compile more sophisticated programs.
实际上,一旦我们开始写一些更复杂的程序时,你们可能要键入那样一些长的,讨厌的命令,来编译跟高级的程序。
So today is about writing some programs and empowering you to write your own starting this coming week when Pset One goes out via the website tonight by 7:00 p.m.
今天我们将要写一些程序,并且让你们,在接下来的一周写你们自己的程序,今天晚上七点,习题集1会发布在网站上。
And that's basically trying to make sure our program has not regressed, as to say, gone backwards in how well it works. And so we always test it on everything.
这只是从根本上确保,我们的程序并没往后退,也就是说在可用性方面倒退了,因此我们在任何东西上,都要进行这样的测试。
It's much more interesting if you can actually build things that are interactive, that are animated, that play music and so forth and not just produce things on day 1 that outputs zeroes and ones like this.
如果你构建的东西是互动的,像动画,音乐播放等等,而不是编些像第一天那样,只是输出0和1的程序。
Now we're gonna hand you some framework, that code that we wrote with some blanks to get you accustomed to the idea of one, writing larger programs than time might allow if you were doing it on your own.
现在就提供给你们一些框架,在代码中有些空白,是为了让你们了解其中的思想,如果是你自己,若时间允许,那就尽量写大的程序。
Well, thus far, I haven't written any programs that themselves take any such arguments, and yet it turns out I can do exactly that.
到现在为止,我还没有写任何的,它们自己携带参数的程序,但是,我完全可以这样做。
So an adversary who's actually trying to break your programs 'cause frankly too much software these days is not written with a paranoia in mind.
或者说是你的敌人,而且千方百计地要破坏你的程序,唉,这种漏洞百出的软件我见过的是在太多了。
And I read the documentation, did what it said, and that's how I got my program to compile.
我阅读那个文档,照它说的做,那就是我如何便于我的程序的。
Well, there's a chunk of memory called the heap that you can grab as much memory as you want so long as it exists for your program.
好的,这里有一块叫做堆的内存,这样你就可以获得你想要那么多的内存,因为它为你的程序而存在。
So now after all these stupid setup, we can finally dive in to the actual program.
把这些规定的东西写好后,我们才能写真正的程序。
bug And maybe by understanding why it worked on a and not on b, you'll get a lot of insight that you won't if you just focus on the bug.
发现很多东西,而你只关注,本身的话就发现不了这么多东西,如果知道你的程序至少还对。
Whenever I think about how to build an interesting program, and I hope whenever you think about it, the first thing I think about is, what are the classes I might want to have, what are the types?
无论我何时,去想怎样建立一个有趣的程序,你们每次做这种思考的时候,你们想得第一件事,就是我应该要有什么类呢,它们是什么类型的呢?
All right, so let's take things up slightly to a more interesting one.
好的,让我们开始学习一个稍微,更有趣点的程序。
And if your program doesn't work, that should be your first guess.
如果你的程序无法运行的时候,它们可以成为你的第一猜测。
应用推荐