This is the name to which I'm going to refer when I want to use this function. All right?
这是我以后使用这个函数式,会采用的名字?
We can use the Coulomb force law to explain this where we can describe the force as a function of r.
我们用库伦定律解释它,力作为距离r的函数,让我们考虑一下。
You try to design actually I'm going to come back to that in a second. It's like you're trying to use a hash function that spread things out pretty evenly. But the places you store into in those lists may have to themselves have a small list in there, and when you go to check something, you may have to do a linear search through the elements in that list.
你尝试着去设计,实际上过会儿我会回头讲解这个问题,类似于你需要用一个哈希函数,非常平均的将物体分发出去,但是在列表中你数据,映射到的地方可能会有自己的一小段列表,当你回头查找数据的时候,你可能需要在那一小段列表中做线性查找。
And just as with variables, you should use some common sense, some style here, and the function's name should X Y communicate what it does, calling it X or Y or Z is generally not all that helpful.
就像变量,你使用一些常识,一些类型,和函数名需要,传达它所做的事情,把它叫做,或者Z通常是没有什么用处的。
Reverse transcriptase is a naturally occurring protein, it has a biological function in HIV, but we can use it for a technical logical function here by going backwards on the biological path from messenger RNA to DNA.
反转录酶是在自然环境中存在的蛋白质,它在HIV中发挥着生物功能,但在这里它可以发挥一个技术功能,让它用信使RNA反转录出DNA
So, we can use Coulomb's force law to think and it does that, it tells us the force is a function of that distance. But what it does not tell us, which if we're trying to describe an atom we really want to know, is what happens to the distance as time passes?
来考虑这两个粒子之间的,它告诉我们力随距离的函数关系,但它不能告诉我们,而我们如果要描述,原子又非常想知道的是,距离随时间的变化时怎样的?
But long story short, if I want to use a function called sleep, -- the reason I, the programmer, knew to use that library -- -- that header at the top -- because it told me to in this little synopsis.
但长话短说,如果我想要用一个叫做sleep的功能,我作为程序员知道使用那个函数库-,上面的标题-,因为在这个小的大纲中它告诉我。
malloc I'm going to now use this new, fancy function called malloc and I'm going to say x gets the return value of malloc of the size of an int.
我现在使用这个新的,别致的函数,然后我指明x,=,malloc的int型数据的大小,的返回值。
If you instead use GetString, same thing: blinking cursor, the function is just going to wait for the user to type a word, a sentence or whatever, and then hit Enter.
如果你用GetSring来代替它,同样的:闪烁光标,那个函数只是等待用户来,输入一个单词,一个句子什么的,然后敲回车。
I certainly don't want to assume they're always going to type a three-letter or a four-letter or a two-letter word I want some dynamism but that's fine because get string can get a string of any length, I can then use the string length function to just ask while the program is running how big is the string that I was handed?
当然我不能假设他总是,输入3个字符或4个字符,或2个字符的单词,我想要动态地分配,因为GetString可以获得任意长度的字符串,然后我可以使用strlen函数,来得到那个我传递的字符串,有多长?
应用推荐