Thursday, December 14, 2017

Packet Pusher Priority Queue #135 Book Drawing

Hello, fellow network automation engineers! It has been a while since I last wrote about my blog, my apologies. Rest assured that I have not been slacking off, I have been busy working on another book project on Distributed Denial of Service (DDoS) with my good friend Rich Groves that should be out early next year. I am very excited about the project and hope it brings value to you if you are interested in learning more about the topic. 

Many of you have listened or at least aware of the episode on Packet Pusher Priority Queue #135 where I discussed my book and the subsequent offering of a free autographed copy if you sign up on this link a month after the airing of the show on November 9th, 2017. 

I am a few days late, but I have not forgotten about it. In total, there were 271 people who signed up (Thanks!). I exported the list into Excel sorted by the time they were signed up from: 


And I used the following Python script to randomly generate a number between 2 to 272 (since the first row is the header) 10 times: 

  1 #!/usr/bin/env python
  2
  3 import random, time
  4
  5
  6 def rand_int(start_num, stop_num, num_range):
  7     for i in range(start_num, stop_num):
  8         number = random.randint(1, num_range)
  9         print("Run: " + str(i) + " Number: " + str(number))
 10         time.sleep(0.1)
 11         print("----")
 12     return number
 13
 14
 15 if __name__ == "__main__":
 16     result = rand_int(2, 11, 272)
 17     print("Congratulations to the person with Number: " + str(result))
 18

The result was below: 

$ python book_drawing.py
Run: 2 Number: 11
----
Run: 3 Number: 234
----
Run: 4 Number: 253
----
Run: 5 Number: 207
----
Run: 6 Number: 203
----
Run: 7 Number: 264
----
Run: 8 Number: 20
----
Run: 9 Number: 41
----
Run: 10 Number: 106
----
Congratulations to the person with Number: 106

I will notify the 106th person on the spreadsheet and arrange for shipping of the book. Thanks again for your support! I hope the blog and book have brought value to you. 

If you have a celebrated holiday at the end of the calendar year, I want to wish you happy holidays! If not, happy coding! 

Best, 

Eric 









4 comments:

  1. Hi Eric,
    How do I know my number?
    Thanks,
    Omer Shtivi

    ReplyDelete
    Replies
    1. Not sure why it is relevant, but I will look for it and send it to you Omer.

      Delete
  2. Worthful Python tutorial. Appreciate a lot for taking up the pain to write such a quality content on Python course. Just now I watched this similar -Python tutorial and I think this will enhance the knowledge of other visitors for sure. Thanks anyway.https://www.youtube.com/watch?v=qgOXopu4n7c

    ReplyDelete

  3. Top Trending Technologies of 2019. Watch here:https://www.youtube.com/watch?v=-y5Z2fmnp-o

    ReplyDelete