But they also found something else. They say another kind of bug is now attacking the cotton and other crops.
VOA: special.2010.05.25
So, all that talking on the bus, and the way they're moving their hands, the bug, that's all where this language is rising from.
因此,那些公交车上的谈话,和他们的手舞足蹈,他们的疯狂,都是语言的来源。
And in the process of tidying it up and making it prettier, I'll often by accident find the bug.
让我的程序更漂亮些,在这个清理美化代码的过程中,我常常无意中发现我的错误。
"When they become infected with the al-Qaida bug, their idea of who they should target as an enemy changes."
VOA: standard.2010.05.18
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,所以作为这个文件顶端的注释,那实际上是那个。
It's a statue of a woman with white robes and long hair. Her arms are thrust high into the sky, and she holds aloft a giant black bug.
VOA: standard.2010.08.10
All right. What do you do when you've found the bug and you need to fix it?
好了,当你发现错误并修改它们的时候,你该怎么做?记住一个古老的法则?
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.
第一,记住错误可能不是,发生在你认为的地方,因为如果那儿有一个错误,你可能已经找到了它。
bug And maybe by understanding why it worked on a and not on b, you'll get a lot of insight that you won't if you just focus on the bug.
发现很多东西,而你只关注,本身的话就发现不了这么多东西,如果知道你的程序至少还对。
bug So now I've narrowed the bug down to one place.
现在我已经把。
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两次,我返回给你“输入了相同的东西“
And the bug was in my thinking, I did not look for all of the tests.
当然我已经知道这个bug了,就没去做所有的测试。
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不会繁殖,也会有很多,并且请记住调试的目的,并不是去消除一个。
So I know the bug is not above.
因此我知道bug不在上面了。
By putting it in a function bug if I find a bug and I change my program I can just run the function again.
把我输入的值放到一个函数里,如果以后我在程序中发现了一个,并对程序进行更改的话,我可以直接。
So you say well, rather than rushing off and fixing this one bug, let me pull back and ask, bug is this a systematic mistake that I've made throughout the program?
因此我们应该回头想想,这是不是我在整个程序中都,在犯的一个系统性错误,而不是匆匆忙忙的去修复这一个,如果确实是系统性错误的话?
bug What I typically do is I start with the input that provoked the problem, and I keep making it smaller and smaller.
我这里做的就是从引起,出现的输入开始,然后将输入,一步步的缩小规模。
bug This is an easy bug to come up with. But imagine, if you don't do the test, you're going to get answers that don't make any sense.
这是一个容易发现的,但是想象下,如果你没做测试的话,你会得到没有意义的答案,实际上。
We're actually making a legitimate copy with this version of the program so I don't have this bug in anymore.
我们使用这个程序版本,做了一个合法的拷贝,这样我就没有这个bug了。
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.
它解决了一点缺陷,如果我不用它,但是更多的是在以后当你们讨论,文件和创建文件时。
You find some way of systematically going through the list. Yet, I often see people, when they're debugging, proceeding at what, to me, looks almost like a random fashion of looking for the bug.
是不是目标元素,我们有一种系统化的,遍历数组的方法,然后我经常看到,有些人调试的时候。
Sometimes when I'm really stuck, I say, alright let me stop looking for the bug.
有些时候我被卡住了,我会说好吧。
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方面,同样适用于那些正常工作的模块。
bug It's not true now. If there is a bug in the program it's there for only one reason.
如果程序中有一个,那一定是有原因的,是你通过例如犯了。
And you'll see at the bottom, bug it says the first actual case of a bug being found.
然后程序就正常工作了,因此这就是第一个被发现的。
The problem is, things that you catch here are bug actually the least worrisome bugs.
问题是,这儿你捕捉到的问题是,隐患最小的。
So you try and find a smaller input that bug will produce the problem.
你应该尝试着用规模小一点的输入,去重现这个。
bug If you find a bug, it probably means there bug are more of them. So you ought to be bug a little bit careful. The story I've heard told is you're at somebody's house for dinner, and you're sitting at the dining room table, then you hear a .
对不对?你得修复这个,如果你发现了一个,可能就意味着还有更多的,因此你应该小心点,我听说的一个故事,是当你在别人家吃饭的时候,你坐在餐桌上呢,然后听到了邦的一声响。
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,很抱歉-,我改了一部分这个错误但是没看到这里的,好,这儿的增长率,有人想猜猜么?
And what they're doing as they hunt, is they're reducing the search space.
发现bugs的方法,当他们寻找bug的时候。
应用推荐