• But suppose you are in a train and you're moving past me and you look at this piece of chalk.

    但假如你在火车上,从我面前驶过,你看着这支粉笔

    耶鲁公开课 - 基础物理课程节选

  • And we hope that at the end of the class, every time you're confronted with some technical problem, one of your first instincts is going to be, "How do I write the piece of code that's going to help me solve that?"

    并且我们希望到了期末,每当你要面对一些,技术问题的时候,你们的本能之一将会是:,“我怎么才能编写一个代码,来帮我解决这问题?“

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Let me first ask you this, is this a reversible or in irreversible process? Right, let me add one more piece of data here which I said in words but which is actually important to write down before doing the problem.

    让我先问你们,这是可逆过程,还是不可逆过程?好,让我加上一点简要的,但是很重要的前提,【p1>p2】这是可逆的吗?

    麻省理工公开课 - 热力学与动力学课程节选

  • - So now if Christiana doesn't actually -- if either programmer or who's programming these little puzzle pieces, don't actually do anything with this return value, and I call, get int, she wants to hand this piece of paper -- to me, but if I don't actually assign -- no, no, I just messed up the demo.

    现在如果Christiana没有-,如果程序员或谁在编写这段代码,不要对这个返回值做任何事情,我调用GetInt,她把这张纸给我,但是如果我没有赋值-,不,不,我刚才把这个演示搞乱了。

    哈佛公开课 - 计算机科学课程节选

  • OK, let me comment this out, and let's look at this next little piece of code. All right.

    好,让我添加一点注释,然后让我们看看,下面的一些代码,好。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • 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的哈希表。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • So this first little piece of code right here says, ok you give me 2 points, I'll create another 1 of these lists and I'll simply take the x, sorry I shouldn't say x, I'm going to assume it's the x, the x-values are the two points, add them together, just right there, the y-values, add them together and return that list.

    好,为了来认识到这一点,让我们来看一个简单的小例子,在你们的课堂手册上,你可以看到我写了一个小程序,它假设我得到了,这些点中的一些,我想对它们做一些操作,例如我想把它们加到一起,那么这里的第一小片,代码的意思是,好给我两个点,我会再创建一个数组。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • 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的算法-,我们来看看这个算法吧。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Second thing to notice, is that little piece of pseudo code is telling me things about values.

    然后需要注意的是,这些伪代码告诉了一些关于值方面的事情,我需要一个浮点数。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Yeah, if my machine will come back up, there we go. So, I'm going to now go ahead and write a little piece of code, and I put it here and I hope you can actually see these better this time, let me uncomment that region.

    让我们写出代码来吧,好,如果我的电脑能回来的话,好了,那么,我要去写一小块代码,我把它放在这里以期望大家这次,能看的更清楚点。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • So let me give you an example of a piece of imperative knowledge.

    所以让我给你一个,程序性知识的小例子。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • And in fact, now let me ask those two questions about this piece of code. First question is, for what values of integers-- we're going to assume integers-- but for what values of x does this code terminate? And the second question is, for what values of x does it give me back the right answer?

    实际上,让我关于这块代码问两个问题,第一个问题是,对于什么样的整数值,我们会假设是整数,对于x的什么值程序,会最终终止?第二个问题是,对于x的什么值程序,会返回正确答案?

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • But notice what this does. The first thing it does is, it says, let's check and make sure x is greater than or equal to 0. If it isn't, notice what's going to happen. None of that block is going to get executed, and it's going to come down here and print out a useful piece of information, which says, hey, you gave me a negative number. I don't know how to do this.

    做的是和以前一样的事情,但是注释它做了什么,第一件做的事情就是,程序说,要去检查并且确信x是大于等于0的,如果不是的话,请注意会发生什么,下面的代码都不会被执行,程序会到这里来然后显示一些有用的信息,信息会说,嘿,你给了我一个负数,我不知道该怎么弄这个了。

    麻省理工公开课 - 计算机科学及编程导论课程节选

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定