So all of these programs or commands that we've been using thus far for the piece set in class, take what we call command line arguments, they are the zero or more words that follow the program's name.
所有我们一直在课堂上使用的,这些程序或者命令,携带着命令行参数,它们是跟在,程序名的后面的一个或多个单词。
I'm then printing bracket one, bracket two, bracket three, bracket dot, dot, dot up until the total number of arguments, 1 whatever that may be, and it's going to be at least one because the program always has a name.
然后我打印,括号等等等,知道打印完所有的参数,不管那个最大值可能是什么,它将至少为,因为程序总是有一个名字。
Otherwise, this is going to be doing something strange, but all integers?
否则,程序会去做一些,奇怪的事情,但是是所有的整数么?
Every file or program that you see here in this packet is alphabetically listed.
你们看到的所有的文件或程序,都会在这里按字母表顺序一一列出。
But when you start writing programs, especially when we get to web-based stuff where you want -- to check the user's input -- is it valid, is it an email address, -- and all these different scenarios -- it's actually often useful to be able to just enumerate them or rattle them off using this switching construct instead.
但是当你看是写程序时,特别是当我们,使用基于网络的东西,你想要,检查用户的输入-,它是合法的吗?它是不是一个电子邮箱地址?,所有的这些场景-,实际上它常常是有用的,当你用枚举结构列举它们,或者用它来快速地来说出它们。
Because we obviously can't, in any course, or even any set of courses, tell you everything you'll ever want to know in life we've seeded some things in this program that will be unfamiliar, so during the time you're studying the program, get online, look it up, figure out what they do.
因为在任何一门课上或者几门课上,我们都不可能告诉你,所有你想知道的事情,我们在这个程序中,加上了一些你们不熟悉的东西,所以在你们研究这个程序的时候,你们可以上网找资料,弄懂它是干什么的。
But very soon will you find that if you're writing programs with lots and lots of functions, and some might call these, and these might call these, you can come up very soon with scenarios where you can not order them top to bottom, because everything is comingled, and there's a lot of cross talk among all of your functions.
但是不久后你们会发现你们写的程序中,有很多很多的函数,有的函数调用这些函数,这些函数又调用另外的函数,你不能用脚本,把它们从上到下排序,因为所有函数相互混合,在你的函数中也有很多交叉。
Almost everyone in this room has probably had a segfault at some point or core dump where you end up with this random file called core, which recall is just the contents of memory at the time your program crashed.
几乎这个教室里的所有人,在某个时候,都遇到过段错误,或者通过这个core文件的,存储器内核更新,这就是你的内存出现错误,你的程序崩溃掉了。
So, for example, if I say TEST and I don't give it a start but I give it an end, then it gives me all the elements up to that point.
例如,我创建了TEST这个元组我没有给他,起始点却给了它一个结束点,然后程序会基于这一点放置所有的元素。
Those nine hours are going to be primarily working on problem sets, and all the problems sets are going to involve programming in Python, which is the language we're going to be using this term Now, one of the things you're going to see is the first problem sets are pretty easy.
这九个小时会是问题,提出的基本锻炼,所有的问题提出,都将涵盖,我们这学期,将使用的Python语言的程序,现在,你们将要看见的,第一个问题的提出非常简单。
But if you avoid all of these minutia and focus really just on the idea, it looks like what was a blue say block, a so called statement, is now going to be something called printf where the F happens to stand for formatted.
但是如果你抛开所有这些繁琐的细节,把注意力集中到,它的编程思想,那么它只不过一个蓝色的say程序块,是一个声明,即所谓的printf函数,其中的f是,用于格式化输出。
It comes with all Macs by default.
默认情况下所有的Mac电脑都装有该程序。
I mean what if you're running so many things, what if the user has copied and pasted their thesis and just pasted it at the blinking prompt such that you're now out of memory because your computer is somewhat limited in memory so get string cannot possibly return all those characters or fit all of those characters in memory and return to you the address of the first.
如果你运行了很多程序,假使用户复制粘贴了他们的论文,只是粘贴在光标提示符那里,这样就出现了内存不足,因为你们的计算机的内存是有限的,所以GetString不可能返回所有的字符,或者保存这些字符到内存中,并且返回第一个字符的地址。
应用推荐