>> They only use that when the program that you're running-- the program that you're referring to is going to your computer?
>它只有在你运行程序的时候才用到-,那你刚刚提到的程序,会到你的电脑上运行吗?
I made a ton of random things when I was at Harvard and most of them no one ever saw.
我在哈佛写了许多程序,很多都没人见过。
You double click an icon, the program gets loaded into memory, well, conceptually where does your program end up?
双击一个图标,程序就被加载到内存中,那么,程序在哪里结束?
By putting it in a function bug if I find a bug and I change my program I can just run the function again.
把我输入的值放到一个函数里,如果以后我在程序中发现了一个,并对程序进行更改的话,我可以直接。
The distinction I made in the paper that we talked about in the class is between procedural justice and substance of justice in the university.
我曾经在一篇论文中做了一个区分,在课堂上讲到过,那就是大学程序性公正,和实质性公正的区别。
In the current world champion of chess, I think Vladimir Kramnik, was defeated in December by a chess-playing program.
当前的国际象棋世界冠军,弗拉基米尔?克拉姆尼克,就在今年12月被一个国际象棋程序击败
They actually can be used in a court of law as a stage toward arriving at a verdict.
这些词在法庭上,指审判前的一个程序。
Said a different way, in the case of the straight-line programs, how long would it take to run a program?
换种说法,在直线式程序里面,运行一个程序要多长时间?
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.
我觉定在我的程序中,我可以,交换两个变量值,好的。
So the moral here, again, is whenever you're doing an implementation of a simulation, you do need to have some underlying theory about the model.
所以这里的寓意还是,不管你在做什么东西的仿真程序,你需要有一个,模型的底层程序。
And this one will be particularly germane to a portion of Problem Set 1, at least in Problem Set 1.
这个程序跟习题集1中的,一部分比较相似,至少在习题1中。
And here, too, it's just a little baby program in that I'm hardcoding the expression 17 divided by 13.
然后这里,这只是一个子程序,在那里面我硬编码了表达式“17除以13“
And so now, you have two threads so to speak, two miniature programs, two sprites all interacting with one another.
现在我们有两个线程,两个轻量型程序,两个精灵在沟通。
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.
这只是从根本上确保,我们的程序并没往后退,也就是说在可用性方面倒退了,因此我们在任何东西上,都要进行这样的测试。
There are absolutely going to be times where you're running a program where the programmer, say you, didn't possibly know in advanced how much RAM the program was going to need.
它们总是在,程序员运行程序的地方,你可能预先不知道那个程序,需要多少内存。
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.
现在就提供给你们一些框架,在代码中有些空白,是为了让你们了解其中的思想,如果是你自己,若时间允许,那就尽量写大的程序。
All right so it has to live in RAM as opposed to the hard drive because otherwise things would be terribly slow as you know so it's much better if your programs live while they're running in RAM and they end up in what's called the tech segment.
好的,它存在内存中,而不是硬盘中,因为,否则程序会非常的缓慢,程序在内存中运行会好得多,它们在技术段,的地方结束。
But it's a valuable thing. It says, in each case, I return some useful value from this procedure.
但是这就是变量,是在每个例子中,我从这个程序中返回了一些有用的值。
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.
或者说是你的敌人,而且千方百计地要破坏你的程序,唉,这种漏洞百出的软件我见过的是在太多了。
So I wrote a little program called "chart" that, based on some data I happened to hardcode into the program, shows us their numbers for the past several years.
我写了一个叫做“图表“的小程序,基于我在程序中硬编码的一些数据,向我们显示在过去几年中我们课程的人数。
OK, here we go, here we go, you see, I'm doing it down here, I can't see it, does that-- ah, I hear his sighs of relief, OK, good. There we go. Better. All right.
好,我们开始,大家可以看到,我在这里写这个程序,我看不见,这是不是-啊,我听到大家放松的叹气了,好,让我们开始吧,好多了,好。
Now in fairness, that particular problem kind of happened because so many companies ended up running so much code for many more years than the programmers actually thought they would be running it, but the idea is still the same.
公平起见,那个问题有时会发生,因为实际上,很多企业在这么多年里运行了,比程序员多得多的代码,虽然他们将运行它,但那个构想还是一样的。
So, ask yourself frankly especially when it comes to designing your own tools and your own programs whether it's for real users to use, whether it's for your research group to use in some other field, you know, where do you even begin?
坦白讲,问一问你们自己,当你设计一个工具,一个程序时,它是否是为真实用户使用的,还是为在其他领域的,研究团队使用的,你们懂的,你从哪里开始?
With simple branching, how long is it going to take to run a piece of code?
但是在简单分支程序中,执行一个程序,要多长时间呢?
It's a bad habit to get into, because when you come back to it, it may haunt you later on down the road. So really get into that notion of trying to be defensive as you program.
来运行程序的时候,错误就会出现缠住你了,因此现在我们真的要培养,在程序中有防卫性设计的概念。
Alright, so maybe a little underwhelming and we saw already what this program is going to do but let's just go through this process once before we start doing more interesting things and then we'll come back and at least give you a hint of what some of these syntactic details are doing.
好吧,这个程序也许太平庸了,让人印象不够深刻,我们也知道这个程序是干嘛的,在我们开始更有意思的事情之前,让我们再来讨论一下整个过程后再回来,这些语法细节到底是在做什么呢?,先给你们一点小小的提示。
And indeed, when they program these things, the programmers will feed in game after game after game of the great chess games in history.
的确,当人们编写游戏程序时,会在这些程序中,一局接一局地,输入历史上那些最伟大的棋局
So, an alternative to that that is incredibly common in just the programming world and in industry is to actually not write programs on your own personal computer but to actually write and run them on a server, someplace where the software is all standardized.
那么,在编程界和工业界普遍,使用的一个解决方案是,不在你自己的电脑上写程序,而是在服务器上编程运行,服务器上的软件都是标准化的。
应用推荐