The memory of the error:
Last semester took the visualization of this course, the final big job with D3 implementation, in the use of D3 read CSV data when the following error occurred:
I first read the data in a CSV format in the code, put it into the variable root, and then traverse through the root, then make statistics, and finally put some statistically obtained results into the other variable temp. And this temp declaration is before the CSV data is read. Finally I output the temp after reading the CSV data. found that temp is actually empty, which is not assigned.
It's depressing that I first declare the variable, read the file, do the processing, put the result in a pre-declared variable, and the final output has no response.
Reasons for the final identification:
Asked the classmate, he said it is possible to read the CSV is another thread running? Then go online and check it out, that's true. Then the reason is clear: is to read the CSV is another thread running, the main thread output temp, the reading of the CSV thread has not run out, so caused the above problems.
Effect:
Cause the subsequent visualization to collapse completely, resulting in a heap of 0. The program can't write down the feeling ...
How to discover:
Students ' reminders + online search to achieve the principle.
Software Test Job Description error