"We are here today to announce the first synthetic cell -- a cell made by starting with the digital code in the computer, building the chromosome from four bottles of chemicals, assembling that chromosome in yeast, transplanting it into a recipient bacterial cell and transforming that cell into a new bacterial species."
VOA: special.2010.07.20
> That lets the compiler know that you want to use some actual compiled code from that library.
>,那是告诉编译器我们想要在程序库中,使用一些当前的编译后的代码。
I got the idea from a book... by Dan Brown, "Da Vinci Code".
我是从一本书里得到了灵感,是丹·布朗的《达芬奇密码》。
They can even map a pathogen's genetic code, which changes from generation to generation.
VOA: standard.2010.05.05
So let's look at the second example, all right, I keep doing that -- this piece of code from here to here gives me a way of now creating a hash table of size 256.
所以让我们来看一下第二个例子,好的,我继续做那件事,这段代码中从这里到这里,是创建一个大小为256的哈希表。
Then we have to steal the code from earlier to do a forever loop, a while true loop and then I'm gonna go ahead and use that printf thing that we saw.
然后再借用先前的代码,做一个永久性的循环,即while循环,紧接着需要用到一个,之前我们看到过的printf函数。
It should not be limited or constrained by any transcendent standards or moral laws that do not derive from politics itself, whether a law of God or some kind of transcendent moral order or code.
它不可以被任何超验的准则或道德条律所,限制和束缚,因为那些并非源自于,政治本身,无论那是上帝的法则,还是,某种超验的道德命令或准则。
It's more complicated in making protein from an RNA strand and that complication is called the genetic code.
而从一条单链RNA翻译为蛋白,这个过程更为复杂,称之为遗传密码
You will be able to infer from some of our code how in fact you can implement some more sophisticated programs.
你可以从一些代码中推断出,应该要怎样实现一些较复杂的程序。
Which is a way of reminding you that I need to think as I write the code about what are my expectations from the input, and how might I enforce them.
通过这个我在提醒大家,在写代码的时候,要搞清楚对输入的期望,并思考下如何执行这些期望。
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.
好,这儿我想大家明白的就是,养成解决问题时先写伪代码的好习惯,把步骤都写出来,我想要告诉你们的是一个好的程序员。
So if you're coming from prior background, your code might work a little differently on a different system if you don't use those flags.
如果你来自一个先前的背景,如果你们没有使用这个版本标志的话,在一个不同的系统中,你的代码可能运行地不太一样。
So, it frees you from some of Apple's tethers and this was the code that circulated on the Internet iPhone with which people could crack their iPhones.
这样我们就从苹果的约束下解放出来,这些代码是在网站上流通的,使用它们可能损坏你们的。
So my challenge to you, and I know Professor Guttag can do this, my challenge to you is, a year from now, come back and look at code you wrote here.
因此我这里有个具有挑战性的任务,我知道Guttag也可能会说这个任务,我的这个任务就是,一年以后,回头来看,你之前写过的代码。
Well, what is code like that from the world of Scratch gonna look like?
那么像Scratch那样的代码,长啥样子呢?
If I go back to that code from a moment ago, and I just rerun math3, notice how many places printed after the decimal point -- two?
如果刚才我回到那段代码中去,我们回到math3,请注意在小数点后面,会打印几位数呢--两位?
I'm much better having an exception get handled at the time of input than to let that prop -- that value rather propagate through a whole bunch of code until eventually it hits an error 17 calls later, and you have no clue where it came from.
不是我期望的格式,这时我最好有一个异常处理,而不是让其传下去,这个值传到代码的整个分支,最终会导致一个错误17调用的发生,并且你不知道这个错误是哪里来的。
So it's generally called distribution code and whereas for the previous problems that you pretty much started from scratch, blank files you opened up nano and there was nothing there unless you put it there.
它一般被称作分布码,然而,对于之前几乎要从头做起的问题,在空白文件中什么都没有,除非你在里面写入些东西。
And for a couple of reasons, one this is the first P set where we're actually gonna give you code to work from.
由于一些原因,这里是第一个习题集,在此我们提供了一些代码供大家参考。
This little set of code here from create insert and number. What's create do?
这一小段代码是创建插入和编号的,创建是做什么的?
So in your mind, if you are now the computer program and you are executing this thing from top to bottom, what just has happened verbally is we are stepping into the line of code that says sort left half of elements.
在你们看来,如果你现在是计算机程序,正在从上到下执行一系列指令,刚才所发生的就是我们现在已执行到了这行代码,它告诉你要对左半部分的元素排序。
And notice, by the way, if I do that, and I type sqrt and open the paren, ah-ha! It shows me what the creator, in this case actually I stole this from John so what Professor Guttag put up as his specification for this piece of code.
它需要什么养的输入和其它我想传达的信息,如果我这么做了,我将会到这里打上sqrt并且加上括号,啊哈!这里告诉我这段程序的创建者,事实上这是我是从约翰那里偷来的,所以也就是Guttag教授在它的。
应用推荐