Hey everyone, thank you so much for your help through this.  I think that I 
have resolved my problem.  I'll tell you how it happened.  So this morning I 
put a little extra debugging stuff into my Spider script, and realized that 
there was one point in my script where I was checking to see if an Array object 
was empty?, but sometimes this object wasn't returning as an Array, so I looked 
up reflection in the Ruby Pragmatic Programmer manual and found out how to 
determine the class of an object.  I then implemented an if...end block that 
checked whether my object was an array (if object.class == Array...) and found 
out that I had about 200 null objects in my collection of arrays - that's a ton 
- which I think I mentioned in my previous post.  Well I went back through my 
code and found out that I was making my collection too large.  Here's where the 
problem was - order of operations (they kill me sometimes):

collection = Array.new(otherCollection.length)
collection = otherCollection
collection.sort!
collection.uniq! # This is where my issue was, sort of
collection.each { ...

So the order of operations problem was in the order I was doing things in this 
segment.  Because I always knew that there were duplicates in my collection 
object, I always purged that object, but what I should have done, and changed 
to was this:

otherCollection.sort!
otherCollection.uniq!
collection = Array.new(otherCollection.length)
collection = otherCollection
collection.each { ...

Anyway, so I changed that around, and since then I haven't seen any problems - 
IE doesn't close, my arrays don't throw a bunch of null pointer exceptions at 
me, and my Spider actually completed its task.  Coding problems are always the 
most elusive.  Order of operations is necessary to understand in almost every 
coding situation.  Even processors need to understand order of operations, 
otherwise things would be crazy jumbled up!

Well thanks again for all of your help.  I will call on you all again in the 
future.  Even though none of you had the right solution, you still all got me 
thinking, and that's what I count on from other developers/testers!

Thanks,

Nathan
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5183&messageID=14601#14601
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to