But imagine I actually wanted to gather them together. I wanted to collect them, so I could do something with them.
把那些除数都显示出来,这很有用,但是请想想下我想要,把它们放在一块。
Look in the local newspaper, see where they're advertising because it's always really helpful.
看看当地报纸吧,看看他们在为哪里做广告,因为它一直都很有用。
And this is actually a useful thing to know.
这是一个很有用的理论,大家都应该记住。
So, conceptually if you've ever wondered why you get access in all of your functions to global variables that's because they're not down here, they're at the very top of RAM and any function can access that RAM way up there, but for now the interesting player in the story is this thing called the heap.
所以,如果你想知道为什么全局变量能在,所有的函数中使用,那是因为它们不在这下面,而是在内存的顶端,那样任意函数都可以在内存中使用它们,现在,这里面一个有用的角色是,叫做堆的东西。
My major in English Literature is very helpful for any type of business.
我的专业是英语文学,它对各类职业都有用。
I mean, Francis Ford Coppola went here. I mean it all helps.
我是说,佛朗西斯·福特·科波拉也来这儿。我觉得这都有用。
What I'm going to talk about today applies not just to comfortable wealthy people, but it applies to everyone.
我今天要说的这些内容,不仅仅对生活安逸的富人们有用,而且对每一个人都适用。
It's great for string-matching problems of a whole variety.
都是一个很好的方案,他非常有用。
The "Would you" questions are very useful in a variety of settings.
Would you”问句在许多情况下都非常有用。
You will find this pattern "I'm worried" useful for many situations
你会发现“I'm worried”句型在许多情形下都非常有用。
Alright, so it turns out there're two other useful types that you don't get for free out of the box.
我们还是回到这里,还有两种很有用的数据类型,这两种都不用担心内存不足。
And, in fact, it kind of looks like a function, and yet here's a semicolon I just said that can get you into trouble, and yet that's not actually a function, because there's no interesting lines of code, because it turns out the interesting code is down here at the bottom.
实际上,它有点像一个函数,并且这里有一个能够使你陷入麻烦当中的分号,那个事实上也不是一个函数,因为这里没有有用的代码,因为,有用的代码都在底端。
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的,如果不是的话,请注意会发生什么,下面的代码都不会被执行,程序会到这里来然后显示一些有用的信息,信息会说,嘿,你给了我一个负数,我不知道该怎么弄这个了。
应用推荐