Continuing from yesterday's codes, today's morning and afternoon were left with finishing up the "X over laser" application, and solving some syntax errors after finishing the codes.
However, when we try out the finished application, it start to draw many crosses, even though no lasers were shown, and the position of the lasers being drawn are critically weird. As the Lightdraw application is suppose to return only a range of x and y coordinates between 0-1 in range, the application appears to retrieve data of 1,000 and above. The mysterious point was that we put a code to display an output to console whenever a packet is being received, and this allows us to see that no packet was actually received when no laser is shone, and this points me to the question : where does all the weird values comes from?
One answer from my internet research would be they are uninitialized values.
With the help of Ming Hong, we used a Vector instead to store the data received, and it worked perfectly well, with no weird values received. I also found out that I was all along using the wrong way to pass an array or object into a method.
The correct was actually :
passInArray (& myArray);
and not :
passInArray (myArray);
Furthermore, I have also came to know how to use Vector today
Time flies, and tomorrow would be the end of my 2nd week in IHPC, and yet it feels so much like my first day at IHPC. The amount of data (opps, I mean knowledge) I gained is definitely more than what any of my subjects would have covered, and I am gald that I am given this opportunity to have this internship at IHPC
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment