"One of the programming problems was try to figure out how to break an arbitrary chocolate bar into a certain number of pieces of a certain number of sizes and to do it as quickly as possible.
VOA: special.2010.03.11
Alright, we are back so we just wrote a programming pseudocode or walk through a programming pseudocode.
继续上课,刚才我们只写了一个伪代码,或者说简单地过了一下。
I took a programming class and did okay in it.
我上过一次编程课,成绩也还可以。
Poland's speaker of parliament, Bronislaw Komorowski, became the country's interim head of state Saturday after Polish radio adjusted its regular programming to announce that President Lech Kaczynski and his wife Maria were among those killed in a plane crash in Western Russia.
VOA: standard.2010.04.10
3 So here what I'm doing is 17 divided by 13, but because of this parenthetical, , -- because of that parenthetical -- that has nothing to do with math; -- this is a programming language thing -- that is a casting operation.
所以这里我要做的是用17除以,但因为这样的题外话,因为那样的题外话-,还是没有做完这个数学题;,这是一个编程语言的东西-,那是一个计算操作。
Because that's not a programming problem.
因为这并不是一个编程问题。
rather than take a computer science person who's already doing a lot of programming,
比起那些正在做项目的计算机达人来说,
Computer programming is a lot like learning a different language,
电脑编程很像是学习一种不同的语言,
Here's the problem with that technique, and by the way, a number of programming languages use this, including Lisp.
这会指向元素的值,然后对内存进行切分,关于这种技术有个问题,顺路说下。
up employing something called programming, the act of constructing, telling a computer to do your bidding.
你们会使用一种叫做程序设计的方法,或称之为构建,即让计算机去执行你的命令。
That's a huge improvement. And that's sort of the magic of dynamic programming.
这是一个很大的进步,这也是动态编程的魅力所在。
Realize in programming languages like C, there is a set of very well-defined rules, and this is in the recommended books.
同样,在像C语言这样的编程语言里,也有,一套非常明确的规则,这些都在推荐图书里面。
The strategic goals are the following: course six we want to help prepare freshmen and sophomores who are interested in majoring in course six to get an easy entry into the department, especially for those students who don't have a lot of prior programming experience.
以下是关键的目标:,我们希望帮助对于通过主修,从而进入本系这条捷径,非常感兴趣的大一大二生,尤其是那些,以前没有编程经验的人。
OK. Note, by the way, if I chase through each possible path, like there's some IFs in here, if there's some places to go, at least in this piece of code, every possible path through this code ends in a return. And that's a good programming discipline, to make sure that happens.
注意一下,如果我跟进每一条可能的路径,像是这里的,起码在这段代码中就有很多走向,这段代码中的每一条可能路径,在结尾都会返回一个值,这就是一条很好的编程定律,请确保这样做。
It's not true, by the way, of all programming languages. In fact, Professor Guttag already talked about that, in some languages lists take a time linear with the length to get to it.
顺便说一句这在大部分,编程语言中做不到,实际上Guttag教授已经说过这一点了,在一些语言中取得数组,要花费时间是线性长度的。
Meaning, we're going to try to help you with how to develop good programming style, but you need to write in a way in which it is going to be easy for you to spot the places that cause those semantic bugs to occur.
这意味着我们会帮助你,形成良好的编程风格,但是你需要去以一种,容易发现,程序中,容易发生语义bug的地方的方式去写代码。
And today nobody advocates a programming language that does not support it in some sort of way.
今天没有人会推荐一种,不支持面向对象编程的语言。
And this too is where the power of recursion comes in in a programming language.
这也是在编程语言中,对递归很有影响的一点。
- The fact that I've called it X, is really just a programming -- it's a feature of the programming language that I, the human, can now refer to it.
事实是我叫它为X,它实际上只是一个程序-,它是程序的一个特写,我们可以参考使用它。
in graduate school I used a programming language called Perl a lot.
在研究院时,我经常使用一种,叫做Perl的,编程语言。
This is the sort of thing that people who do numerical programming worry about all the time. And there are a lot of a little tricks they use to deal with that, they'll perturb it a little bit, things like that.
这是一些做计算编程,要时刻注意的问题,当然有的时候我们还需要,应对一些假象,比如像这样被扰乱的。
And this course in particular isn't at the end of the day about programming even though that is in fact how you will spend a good amount of your time and the skill that you will in fact walk away with.
尤其特别的是,这门课程最终的目标,不是教会你编程,尽管编程会花费你们大量的时间和精力。
We hand you a bunch of programming code that we wrote because this is very much the norm in the real world.
我们给你们一些我们自己写的代码,因为在现实世界中这都是非常正常的。
So when you're trying to think about is this a problem that I can solve with dynamic programming, these are the two questions you ask.
所以当你想知道能否,用动态编程来解决这个问题时,你可以问自己两个问题。
It's the same computation. But this is a nice way of writing it, often called defensive programming.
这跟原来的计算过程没什么不同,但这是写代码的更优秀的一种方式。
Pseudo code. Now, you're all linguistic majors, pseudo means false, this sounds like code that ain't going to run, and that's not the intent of the term. When I say pseudo code, what I mean is, I'm going to write a description of the steps, but not in a particular programming language.
伪代码,基于你们都是学语言的,伪代码意味着不正确,这听起来就像是没法运行的代码,这可不是我们学这个的目的,当我说到伪代码的时候,我的意思是要对步骤进行一个描述,而不是某种特定的编程语言。
You have to with C, as with a lot of programming language, say what you return.
在C语言和大部分语言中,你必须说明函数的返回值。
I probably whip out a do while loop very rarely, but very often when programming games or any program that takes user input and has to check that user input and yell at the user if they're messing with you or aren't providing what's expected.
我可能很少用do,while,循环,但常常是,当编制程序游戏或需要用户输入的程序是,需要检查用户的输入并提醒用户,如果他们干扰了你,或没有提供所期望的输入。
but I've taken a lot of computer programming classes,
但是我上了很多编程课,
This combining of data and functions on that data is a very essence of object-oriented programming That's really what defines it.
数据与函数的结合,是面向对象编程的核心,这也就是它的定义。
应用推荐