OK. So if we have variables, one of the questions we can ask is, what's the type of the variable.
好,如果我们有了一个变量,我们要问的问题之一就是,这个变量的类型是什么?
All right? The first one is, that test has to involve-- shouldn't have to, the value of some variable.
好不好?第一件事是,循环开始的测试必须必须-不是一定,一些变量的值。
So what they do is, they're describing how these thermodynamic properties change, in terms of only state functions and state variables.
他们的作用是描述,随着状态函数和状态变量的变化,系统的热力性质如何变化。
The square brackets here, meanwhile, say this is a special type of variable that's got multiple values inside of it.
这里的这个方括号,同时,说明这个是特殊的变量类型,里面有很多复合的值。
These are called population measures because they refer to the whole population of possible outcomes and they measure the probabilities.
这些是用来度量总体的变量,因为他们对应的是总体中所有的结果,度量的是所有事件的概率
The Taylor rule specifies specific variables and everybody at the markets would understand the rule, ? and that's correct, right?
像泰勒规则就明确了具体的变量,市场中每一个参与者也都能够理解,这个没错吧?
Change the independent variable, find the change in the function, take the ratio and that's the derivative.
改变自变量,算出函数的变量,计算比值,这就是求导
OK. Now, last thing about variables, and then we're going to start pushing on this, is where can you use them?
好,关于变量的最后一件事,然后我们就要,结束这个话题了,这个问题就是在什么地方可以应用变量?
Takes a start and an end point, just going to bind local variable names start and end to those pieces.
有一个开始和结束点,就是去把局部的变量的名字,和这些点进行绑定。
Because I might have written some code in which I'm expecting that integer particular variable to have an integer value.
因为我可能写了一些代码,来把一些,变量的类型,指定为。
And the only thing that's differing is the name of the type and the name of the variable I'm using.
其中唯一的区别是数据类型的名字,和我使用的变量名字。
- When you say bracket one, you are storing -- you are referring to the variable here, bracket two.
当你指明,你在存储-,涉及到的变量在这里。
If somewhere later on in the code it shifts to string, I might not be manipulating that and getting actual values out, but not what I wanted, and it's going to be really hard for me to chase it back.
然后后面的一些代码,把变量类型变为了字符串,我可能不会通过实际操作,去取得实际的变量的类型,但是这并不是我想要的类型,而且对我来说把类型,变回去也很困难。
We're going to find other properties that do care about the history of the system like work, that you put in the system, or heat that you put in the system, or some other variables But you can't use those to define the equilibrium state.
我们还会发现其他一些,与系统的历史有关的性质,比如你对系统做的功,或者你向系统传递的热量,或其他的变量,但你不能用它们,来定义平衡态。
Then the second derivative gives the change in entropy with respect to the variable that we're differentiating, with respect to which is either pressure or volume.
二阶导数给出熵,随着变量变化的情况,这些变量包括压强或者体积。
So one of the things I would like to suggest is that you develop some good style here, and in particular, don't change types arbitrarily.
所以我的建议是,你们要养成一些好的编程风格,尤其是,不要反复无常的改变变量的类型。
That's just a graphical incarnation of this thing called an array and notice, the games can, in fact, interact with a human much like Wednesday, I'm leaving my house.
它其实是数组变量的,图形化,具体化,这个游戏实际上是与人交互的,如周三看到的,我正要离开我的房子。
I'd really like to have that modularity that says, I'm only going to get access to the values, not by calling their names, but by calling some specific method to get access to their names.
这样我们就丢掉了代码的模块化,我很希望代码有这样的模块化:,我访问变量的值,不是通过直接调用它们的名字,而是通过调用某个可以,访问这些变量名的方法来访问。
So when I do the analysis, I want to think about what am I doing here, am I capturing all the pieces of it? Here, the two variables that matter are what's the length of the list, and how many times I'm going to search it?
这里,要关注的,两个变量是列表,的长度以及我要搜索的次数,这种情况下,这个算法赢了?
We'll see that there's actually compelling use cases for using the same names of variables in different context's.
我们将看到这是一个在不同环境中,使用相同名字变量的,一个案例。
And that's fine, because inside of curly braces can you redeclare variables with the same name if you intend to quote unquote shadow the previous variable.
那是可以的,因为,在花括号里面,你可以重新定义一个,相同名字的变量,如果你想引用之前的变量。
So, when you want to figure out the address & of a variable, you say ampersand.
当你想得到一个变量的地址,你可以指明。
And that test is usually a value of a variable.
测试通常是针对变量的值。
OK. The other piece I want to say about variable names is, once I have that choice of variable name, I can use it, but in fact there are a few things that I can't use in terms of variable names.
关于变量名字我还想说的,另外一点就是,一旦我对变量的名称可以选择,我可以用自己的方式命名,但是,有一些词汇是,不能用来命名变量的。
What if I don't change the value of that variable inside of the code?
那么如果在循环内部,我不改变这些变量的值会怎么样?
swap I'm going to keep track of a little variable called swap, it's initially true, and as long as it's true, I'm going to keep going, but inside of the loop I'm going to set it to false, and only if I do a swap will I set it to true.
我打算跟踪一个小的变量称为,初始值为真,只要它是真的,算法就会继续,但是在循环里,我打算把他设为假,除非交换发生,就把它设为真。
I think of data hiding as basically saying, one can only access instance values, or, we'll call them that, instance values through defined methods.
一个人仅仅可以访问实例变量,或者,我们可以这么来说,通过定义好的方法,来访问实例的变量。
What I meant - what in the world do I mean by that?
是选一个计数的变量,我这么说是什么意思呢?
Well, things can be fixed by a little trick called global variables.
好的,问题可以通过,一个叫做全局变量的东西来解决。
应用推荐