Source Code for network and port scanner, TRW algorithm, and reduction method implementations.

simulating_data-stream.py 671B

123456789101112131415161718192021222324252627
  1. from threading import Timer
  2. import random
  3. #Objective: receive specific information, and store.
  4. #Set a timer and once it has passed empty the storing structure
  5. #and renew the timer and proceed to continue storing
  6. def bleh():
  7. print "\nEmpyting Event Id Hash\n"
  8. global hash
  9. hash = {}
  10. t1 = Timer(3, bleh).start()
  11. t.cancel()
  12. if __name__ == '__main__':
  13. hash = {}
  14. t = Timer(1, bleh)
  15. t.start()
  16. eventidlist = [1,1,2,3,4,3,2,3,4,5,3,3,6,7,8,6,5,6,88,9,7,6]
  17. while True: #Simulating "data streaming"
  18. for num in eventidlist:
  19. if num not in hash:
  20. hash[num] = 1
  21. print "process Event", num