Now formally I could have had this pointing off to another object containing 4, but that just seemed excessive, right?
当然我可以正式的把它指向,另外一个含有4的对象,但这有点多余对不对?
Romeo, doff thy name, and for that name, which is no part of thee, take all myself."
罗密欧,抛弃了你的名字吧,我愿意,把我整个的心灵,赔偿你这一个身外的空名“
By putting it in a function bug if I find a bug and I change my program I can just run the function again.
把我输入的值放到一个函数里,如果以后我在程序中发现了一个,并对程序进行更改的话,我可以直接。
C So here I'm declaring a variable called c, and I'm pretty much translating the formula from the slide using the characters on my keyboard to a floating point value.
这里我声明了一个变量,然后我把那个幻灯片上的公式,用键盘上的字符翻译成了,浮点数值。
So, as an example, let's take argon, I've written up the electron configuration here, and let's think about what some of the similarities might be between wave functions in argon and wave functions for hydrogen.
所以作为一个例子我们来看看氩,我已经把它的电子构型写在这里,我们来考虑氩和,氢波函数之间的,一些相似性。
All right, let me just go through one numerical example of a calorimetry calculation, OK.
好,让我们来做一个量热,法计算的例子,我不会把所有的。
Now I can measure that, because I pull it by one centimeter and I find the acceleration it exerts on a known mass.
现在就能测量这个力了,因为把弹簧拉伸 1 厘米,我就知道它让一个质量已知的物体产生的加速度
In the second half of class, I will introduce to you and start telling the first story of the term, and that's about Richard Wright's Black boy which is our first reading of the term.
下面我将把这堂课的,第一个故事介绍并讲述给你们,理查,怀特的《黑孩子》,这是我们这学期要读的第一本书。
Okay, so this is a five-dollar note and I'm going to put it--sorry about that again-- I'm going to put it in an envelope.
没错,这是一张5美元的钞票,我将要把它,装进一个信封里面
I've sold the car to a dealer.
我就把车卖给了一个商人。
On one axis you have dietary fat, the other you have how much-- in fact I should have brought the graph but I didn't-- how much breast cancer there is in the society.
其中一个轴是膳食脂肪摄入量,另一个轴是,事实上我应该把图表带来的但没有,社会上的乳腺癌病例数量
I was watching a poker game once on TV and somebody who lost said, and I quote, "They beat me like an ugly stepchild" and the fate of the ugly stepchild is, in fact, not a very good fate but this is not a good study.
有一次我看电视扑克比赛,一个输的人说,我引用他的话”他们把我像丑陋的继子女一样揍了“,丑陋的继子女的命运,确实不是好命运,但这个研究也不是好研究。
And so what I was hinting at earlier when you put semicolons in the wrong place, and then proceed to have curly braces around arbitrary lines of code, you're creating an even more local scope there, which is generally not the right intended behavior.
在之前我暗示了,当你把一个分号放在错误的地方时,然后开始用花括号,括上任意行的代码,你在那里创建了一个局部范围,那个不是故意的行为。
I can model this whole thing as point charges.
我能把这一切设计成一个点电荷模型。
Let me cluster them because really what I have, sorry, separate them out. I've gone from one problem size eight down to eight problems of size one.
让我把它们聚集起来,因为已经得到我想要的,抱歉,把它们分开来,现在我从一个长度为8的问题,得到了八个长度为1的问题。
If I know I'm going to need something over and over again, I squirrel it away somewhere and then get it back when I need it.
如果我知道我将要反复,使用一个东西时,我会把它贮藏起来以后用。
Right, so the things we want you to take away from this are, get into the habit of using pseudo code when you sit down to start a problem, write out what are the steps.
好,这儿我想大家明白的就是,养成解决问题时先写伪代码的好习惯,把步骤都写出来,我想要告诉你们的是一个好的程序员。
OK. So, what do I want you to take away from this? This idea of binary search is going to be a really powerful tool. And it has this property again, of chopping things into pieces.
从这里学到些什么?二分查找的思想,是一个非常有用的工具,我重复一遍,把问题拆成几部分来解决,那事实上,这里的增长率是多少?
Right, so an exception then has this format that I can control as a programmer.
好的,所以一个异常会有这样的格式,我能把他当做一个程序员来控制。
What have we done? We've now got a way of collecting things together, right? And this is the first version of something we'd like to use.
用的一些东西的,第一个版本,现在我已经把它和,一个名字进行了绑定。
I get the int and store it in n. The switch statement takes inside its parenthesis an int or a char or some primitive type.
我得到一个整数并把它存储,到n中,switch语句的圆括号里可以是一个整数,或者一个字符或其他的基本类型。
It's funny a little bit. It's a picturesque comparison, hair and gravy, 0 but it emphasizes that ugliness. Now, if you look on page 80 , this is a woman climbing out of the swimming pool.
这的确挺好玩儿的,这是一个生动的对比,头发和肉汁,小说着重强调了丑陋,现在,如果你把书翻到第80页0,我的书是84页,这是一个刚才游泳池中爬出的女人的形象。
It says if I want to get the length of a segment, going to pass in that instance, it says from that instance, get the start point, that's the thing I just found.
它的意思是如果我想要,得到一个线段的长度,首先要把这个实例传进来,然后对于这个实例,从开始点,取得x坐标,然后通过同样的操作。
So STR, which I just typed up there, takes in parens, some input, and it converts it into a string, so that now I can use that John where I was expecting a string. John.
因此STR,也就是,我刚刚输入的,然后把这个输入变更为一个字符串,因此现在我就能,在需要用字符串的地方使用这个对象了。
s2 So, I'm passing in the first character in s2, I'm making it uppercase and then I'm putting it back so casually speaking this is just capitalizing the first letter of whatever word the user typed in to s2.
那么,我把第一个字符传递给,我把它转换成大写的,然后存下来,简单说,这就是把用户输入s2中的单词,的第一个字母转换成大写的。
Now at this point in the story, I've got a variable called n. I've stored it in int.
现在这个故事的这里,我获得了一个变量n,我把它存储成int型的。
So, let's just arbitrarily put it between these two in this case here, but actually there's no reason we couldn't also put it between oxygen b and c, so I'm going to draw another structure where we have it here.
那么,让我们任意地将它们放在这两个之间,但实际上我们没有理由,不能把它们放在氧原子,B,与,C,之间,因此我将把另外一个结构画在这里。
Let's take a system. Under constant pressure T1 V1, going to a second -- this is the system, so let me write the system here.
我们建立一个系统1,在恒定的压强T1,V1,下,变成了另一个系统,-这个初始的系统让我把它写在这。
X I'm passing an X, and yet I'm also assigning the return value to X. So just intuitively what's going to be the effect of this one line of code?
我传一个X,之后我把返回值赋值给,很明显,这一行代码,将会产生什么作用?
应用推荐