bug It's not true now. If there is a bug in the program it's there for only one reason.
如果程序中有一个,那一定是有原因的,是你通过例如犯了。
We're actually making a legitimate copy with this version of the program so I don't have this bug in anymore.
我们使用这个程序版本,做了一个合法的拷贝,这样我就没有这个bug了。
I've had graduate students come to me and say I found a bug in my program.
你该感到自豪么?经常有毕业生,来找到我并告诉我。
bug Now, this was not the bug in this program because I did, in fact, use the equality operator and so it feels like if I type the word foo both times I should, in fact, get back you type the same thing.
现在,在这个程序中这个不是,因为,实际上,我使用了等于号,如果我输入单词foo两次,我返回给你“输入了相同的东西“
Let me show you one more class, though about-- sorry, let me show you two more classes of algorithms. Let's look at the next one g- and there's a bug in your handout, it should be g of n and m, I apologize for that, I changed it partway through and didn't catch it.
请大家看,额,在你们的课堂材料中有个错误,应该是g,很抱歉-,我改了一部分这个错误但是没看到这里的,好,这儿的增长率,有人想猜猜么?
By putting it in a function bug if I find a bug and I change my program I can just run the function again.
把我输入的值放到一个函数里,如果以后我在程序中发现了一个,并对程序进行更改的话,我可以直接。
It solves a slight bug if we don't use it at all, but more on that in the future when you talk about files and creating files.
它解决了一点缺陷,如果我不用它,但是更多的是在以后当你们讨论,文件和创建文件时。
Just a few small points. First of all, keep in mind that the bug is probably not where you think it is. Because if a bug were there, you'd have already found it.
第一,记住错误可能不是,发生在你认为的地方,因为如果那儿有一个错误,你可能已经找到了它。
And that does two things: bug one, it helps catch bugs in your code, and secondly it often converts it into a more efficient sequence of instructions before you actually go off and run it. All right?
这有两点好处:,第一是可以帮助你发现程序中的,第二是把你的代码,在运行之前,转换为更有效率的指令的集合,对不对?
So I've got one more piece of bad code on this point and this is buggy five dot c. So as a comment on top bug of this file challenges, what is, in fact, the bug.
所以我在这里得到了一块很烂的代码,这个是buggy5,c,所以作为这个文件顶端的注释,那实际上是那个。
The beauty of this is, it keeps me from getting lazy, and not only testing my program and the thing that found the bug, but in all the things that used to work.
运行函数而不用再输入了,这其中的,美妙之处在于,它让我变的勤快了点,并不是仅仅的去测试程序发现bug方面,同样适用于那些正常工作的模块。
And the bug was in my thinking, I did not look for all of the tests.
当然我已经知道这个bug了,就没去做所有的测试。
In Python, it'll find it, I think one bug at a time, right John?
在Python中,它会找到它的,我觉得一回能找一个漏洞,对么John?
Typically, even though they don't breed, there are many bugs. And keep in mind that the bug goal of debugging is not to eliminate one bug.
这是件好事,其实即使bugs不会繁殖,也会有很多,并且请记住调试的目的,并不是去消除一个。
How to fix it. When I think about debugging, I think about it in terms of what you learned in high school as the scientific method.
怎么来修复bug,当我谈论到调试的时候,我认为你们应该依照在高中,在科学方法学中学过的。
Now I'm really honing in.
现在我在逼近这个bug了。
应用推荐