"Look,this is a pre-trial detention, the ethiopian criminal code clearly defines the conditions made by detaining authorities when a person is detained before trial.
VOA: standard.2009.05.25
In the code of conduct, professional conduct, that we embody by this code here is comparable to what you are expected to adhere to in your professional lives.
在行为准则中,专业准则,这个准则所体现的相当于,你所期待去追求的,在你的专业生活中。
And that then let's me get to, basically, base this code. Having done that, height I simply call base with get float, I call height with get float, and do the rest of the work.
现在让我们看看这段代码,其实已经写好了,我简单的调用下,用来得到一个浮点数,再调用下,来得到另外一个浮点数,然后做剩下的工作就可以了。
Mr.Toure recognized those who had worked on the legislation and assured them that this new code, nearly a decade in the making, was not being abandoned entirely.
VOA: standard.2009.08.27
> Okay. This code allocates two pointers which can point to integers.
>,好的,这段代码分配两个指针,可以指向整型数。
"This is a great achievement." The Code of Conduct appears to answer concerns voiced by the opposition and the international community that Prime Minister Meles's Ethiopian People's Revolutionary Democratic Front controls the electoral process.
VOA: standard.2009.11.01
There's the Diet Code, this is the weight loss secrets of Leonardo Da Vinci, and you probably didn't know this, but see?
还有减肥密码,这是达芬奇的减肥秘诀,你可能并不知道这个,我们来看看
In this study, the research team developed a new statistical way of analyzing the genetic code of people who had reached age 100 as compared with people who had a more typical lifespan.
VOA: standard.2010.07.14
I took those same references the exact opposite way, 'cause I thought that essentially he's referring to the temporality of our moral structure, and how it's just this arbitrary code which our society has decided upon.
我对那些参考的理解完全不同,因为我认为本质上他提到了我们道德基准的暂时性,还提到它们如何只是我们社会,随意决定的准则。
It's words to you, or to the reader of the code, that are telling you what's going on inside of this code. OK?
注释是一些对你,或者对代码阅读者说的一些话,告诉你这段代码,是干什么的,对不对?
If I come into this code, I'm going to check this branch first, if it's not true, ah, there's a return at the end of that branch. If it is true, I do that, and then I've got a second test. If it's true, return I return, otherwise a return.
但是如果我们看看这里,如果我看这段程序,我会先检查这一部分,如果它是假的,啊,这部分分支结尾有一个。
Well just to see what we know what we're doing, let's look at this code here.
我们下一步该去怎么做呢?,好,让我们来看看。
So let's look at this code for a second.
那么让我们来看看这个代码吧。
> Okay. Well, this code allocates a new integer pointee and this part sets x to point to it.
>,好的,呃,这段代码分配一个新的整型指针数据,这部分让x指向它。
stdio h This file here is called standard I/O or stdio.h and this is just another text file someone else wrote many years ago and by using that line of code there, I'm telling the computer, give me acces to this code that this other person wrote that's in that file.
在这里的头文件称为标准输入输出文件或,这是由某位前人编写的文本文件,我们只需要刚才所述的一行代码,就能告诉电脑,让我连接到,这个前人在那个文件中写的代码。
OK. Now, having done that, let's build this code.
好,现在做完了这个。
And you can see that in this code here.
它首先是显示出开始点和尾点的位置。
So this code is, in fact, correct.
所以这个代码实际上是正确的。
Because as you'll soon find, when you're writing programs 0 that aren't just four lines long but are 40 or 400 which very quickly becomes easy, you'll find that even you the next morning have no idea what this code does for whatever reason, and just having some English comments is a huge boon to comprehension for yourself and others.
你们自己写程序时就会发现,用40行甚至400行代码来代替繁杂拥挤的4行代码0,将会让事情简化许多,你会发现,即使由于某些原因,你不知道如何写代码,先写些注释,于人于己,都是好事,易于理解嘛。
OK. Note, by the way, if I chase through each possible path, like there's some IFs in here, if there's some places to go, at least in this piece of code, every possible path through this code ends in a return. And that's a good programming discipline, to make sure that happens.
注意一下,如果我跟进每一条可能的路径,像是这里的,起码在这段代码中就有很多走向,这段代码中的每一条可能路径,在结尾都会返回一个值,这就是一条很好的编程定律,请确保这样做。
So now, in this case, this code is going to, when we get here, check, and if you haven't seen that strange thing there, that exclamation point in bang computer-ese called a bang, it says x if ANS star ANS is not equal to x, all right?
那么现在,在这个例子中,当我们执行到这里,代码会去检查,如果你没有看到过这个奇怪的东西,这个感叹号在计算机学中被叫做,代码的意思是如果ANS的平方不等于?
This code does swap the two values, A and B. However, when I run this program, something happens.
这个代码没有交换那两个值,A和B,但是,当我运行这个程序时,有些事情发生了。
So this code is identical functionally nonswitch c to the last implementation we saw, nonswitch.c, but I'm just ever-more emphatically saying, "In case 1," that is when n equals 1 -- or when case 2 applies -- when n equals 2 or when n equals 3 do what?
所以这些代码到最后的实现上,功能是,完全相同的,但是我想要再次强调一下,“在case,1“,那是当n等于1时1,或者当case,2适用-,当n等于2或者当n等于3,它将做什么?
So I'm going to comment those out, and let's go down to this piece of code, and uncomment it.
那么我会把这些注释上,让我们看看这段代码,取消注释。
All right, you can see that this little piece of code, it's got a loop in there, and what's it doing?
好,你们看到的这一小块代码,是做了一个循环吧?,他在做什么?
Having now used this pseudo code to line things up, I can start putting some additional structure on this.
用伪代码把这些事情串起来后,我可以开始进行,一些结构方面的优化了。
I should also warn you that this code includes some Python concepts, at least one, that you have not yet seen.
我得事先说明这个代码中,包括了一些你没见过的Python语言的概念,至少一个。
I can't rely on Professor Guttag if I give this- if this code to him, I can't rely on him to type in a float. Actually I can, because he's a smart guy, but in general, I can't rely on the user-- I wouldn't do it right to see if you did.
当Guttag使用这段代码的时候-,我不能相信他一定会输入一个浮点数,实际上我能因为他很聪明,但是总体上来讲,别相信用户一定会按照规则来-,我会故意做错来试试你的程序的。
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的什么值程序,会返回正确答案?
What happens now after we've executed this third line of code, what happens next in the story?
我执行完第三行代码会发生什么呢,在这之后会发生什么呢?
应用推荐