Advertisement
sheivin

Untitled

Nov 28th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <script src="http://code.jquery.com/jquery-latest.min.js"></script>
  5. <title>Matrix Visualizer</title>
  6. </head>
  7.  
  8. <body onload="load_first_file">
  9. <script type="text/javascript">
  10.  
  11. console.log("JJJJJ");
  12. var matrix = []
  13. var temp_matrix = [];
  14. var temp2_matrix = [];
  15.  
  16. function load_first_file () {
  17. $.ajax('RAP_8.ij.00000', {
  18. datatype: 'text',
  19. success: process_first_file
  20. });
  21. }
  22.  
  23. function process_first_file(data) {
  24. console.log("HHHHH");
  25. console.log(data);
  26. temp_matrix = data.split("\n");
  27. //console.log(temp_matrix.length);
  28. for(var i = 1; i < temp_matrix.length - 1; i++) {
  29. temp2_matrix[0] = temp_matrix[i].split(" ");
  30. console.log(temp2_matrix[0]);
  31. //temp2_matrix[0].splice(0, 1);
  32. //console.log(temp2_matrix[i]);
  33. matrix[(temp2_matrix[0][0])][(temp2_matrix[0][1])] = 1;
  34. }
  35. console.log("Hello World!")
  36. }
  37.  
  38. function load_second_file () {
  39. $.ajax('RAP_8.ij.00001', {
  40. datatype: 'text',
  41. success: process_second_file
  42. });
  43. }
  44.  
  45. function process_second_file(data) {
  46. console.log(data);
  47. temp_matrix = data.split("\n");
  48. for(var i = 1; i < temp_matrix.length - 1; i++) {
  49. temp2_matrix[0] = temp_matrix[i].split(" ");
  50. console.log(temp2_matrix[0]);
  51. matrix[(temp2_matrix[0][0])][(temp2_matrix[0][1])] = 1;
  52. }
  53. load_first_file();
  54. }
  55.  
  56. function load_third_file () {
  57. $.ajax('RAP_8.ij.00002', {
  58. datatype: 'text',
  59. success: process_third_file
  60. });
  61. }
  62.  
  63. function process_third_file(data) {
  64. console.log(data);
  65. temp_matrix = data.split("\n")
  66. for(var i = 1; i < temp_matrix.length - 1; i++) {
  67. temp2_matrix[0] = temp_matrix[i].split(" ");
  68. matrix[(temp2_matrix[0][0])][(temp2_matrix[0][1])] = 1;
  69. }
  70. load_second_file();
  71. }
  72.  
  73. function load_fourth_file () {
  74. $.ajax('RAP_8.ij.00003', {
  75. datatype: 'text',
  76. success: process_fourth_file
  77. });
  78. }
  79.  
  80. function process_fourth_file(data) {
  81. console.log(data);
  82. temp_matrix = data.split("\n");
  83. temp2_matrix = temp_matrix[0].split(" ");
  84. matrix = new Array()
  85. for(var i = 1; i < temp_matrix.length - 1; i++) {
  86. temp2_matrix[0] = temp_matrix[i].split(" ");
  87. matrix[(temp2_matrix[0][0])][(temp2_matrix[0][1])] = 1;
  88. }
  89. console.log(temp_matrix);
  90. //console.log("Hello World!");
  91. //console.log(matrix);
  92. load_third_file();
  93. }
  94.  
  95. </script>
  96. </body>
  97. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement