07-27-2008 12:19 AM
Really what you do in this code is dividing the length of your file by half of the segment length. (this makes sense).
@dan07 wrote:
Because of this I take the size of the array and let the while loop runs until it found a value greater than the number of values in the array, in the sequence, the while loop stops and send to the for loop the N.
....I think you devide the length of the array by half the length of the segment?
The Lenght of the array is not divided by half the lenght of segment. Due the 50 % overlap, the array is not logically divided by the lenght of segments, some values are show in two different segments graphs, because the segments are 50 % overlapped.
07-27-2008 01:32 AM - edited 07-27-2008 01:34 AM
The main problem with your code is that you have 1 event handler for basically three different events:In the third case you most likely only want to react on the change of the boolean, what you do is that you recalculate the whole array, resetting all booleans to false.
- File contents change (triggered by Timeout)
- Segment length change
- Array change (Triggered by a click on the boolean)
You should make a clear distinction between these three events.
07-27-2008 06:11 AM
07-27-2008 08:47 PM
TonP wrote:
Event 2 should trigger event 3!
In event 2 you recalculate the whole array with all booleans to false.
Then you create an event 3 for the 'Array' value change.
There you do a recalculate of the Sum. In the code you have the distinction allready (the local and terminal split is the best place).
07-28-2008 01:09 AM