And the (Kindle or iPod) Goes To…


As promised, I’m going to pick one person at random of the people who successfully completed the survey and give them a nifty new gadget to enjoy. Since I’m a code monkey at heart, I wanted to choose the winner my way — by writing a simple little program to do it! Now, I’ll walk you through setup and the “drawing” and we can find out who wins together like some sort of weird geographically disparate family!

(This is probably going to bore the hell out of most of you, but just indulge me this once).

First, I exported a list of all of the people who successfully completed the final requirement (registering for the notification list) as a CSV file which I saved as ~/Development/Scripts/btng.csv on my iMac. The file is organized with one person per line.

Next, I wrote a short little Python program to read a file into a list of lines and select one at random.

As a test, I also created a file called test.txt:

Then, I ran the Python script against the test file to make sure it was working:

Brett-Kellys-iMac:Scripts inkedmn$ python SurveyDrawingWinner.py
I'm line 10
Brett-Kellys-iMac:Scripts inkedmn$ python SurveyDrawingWinner.py
I'm line 7
Brett-Kellys-iMac:Scripts inkedmn$ python SurveyDrawingWinner.py
I'm line 9
Brett-Kellys-iMac:Scripts inkedmn$ python SurveyDrawingWinner.py
I'm line 6

Now, we change the file to use our real list of entrants and…

Brett-Kellys-iMac:Scripts inkedmn$ python SurveyDrawingWinner.py
"steve pelletier"

Congratulations, Mr. Pelletier! I’ll be notifying you via email right after this post goes up, but you’re the big freaking winner :)

Thanks so much to everybody who gave honest feedback on the survey - you’ve been a huge help in getting me to solidify what I’m doing here. Hope you guys stick around and, if I may pander a bit here, tell a friend if you think this site doesn’t suck.

Cheers!

Photo by Dave_B_

Like this Post? Tell Your Pals!
Get More Great Tips

Trackbacks

  1. snack or a meal after you workout,…

    depending of course on what time it is when you get home. after a workout, your body needs proper nutrition to repair itself. if you find yourself wondering what the best snack options are after a workout, try these out:pita …

  2. good site says:

    a good way, wherein you get paid…

    to read bulk emails of your clients. in order to do the same, you will first need to open an account with a trustworthy website, after which you will start to get emails for opening. and the amount you can get…

  3. should do the blogging?the question of who…

    should write your company’s blog posts hinges to a great extent on the size and nature of your company. because blogging is like brand building in that it doesn’t directly generate sales, it should be considered a relatively low payoff activity….

  4. deadly streets of riverside county in california,…

    that making it alive on the other side is either impossible or improbable.blog writing as moral and social responsibilityi’ve read and seen handful of internet writers who obviously write only for egocentric reasons. few months back, i’ve read an art…

  5. click here says:

    the nature of the blog, business owners…

    may even choose to include their own personal opinions about different subjects or stray off-topic from time to time in order to seem more personable. no one understands the process of writing a successful blog better than blog post writers for…

  6. most online users have a very short…

    attention span. so, if you want to write a blog post that is of high quality, i suggest that you keep it short. provide all the information that your target audience wants to learn in as little words as possible. a…

  7. sharing what you love with those who…

    could benefit from it. write original, concise and reader-friendly articles to post on your website or blog, integrating keywords naturally into your site content and be regular about it. if you can’t provide fresh content daily, do it on thrice a…

  8. visit site says:

    authorities in your niche.5. make your blog…

    posts enticing to read. you can get more people to read your blog posts until the end if you make them easy on the eyes and organized. so, make use of short paragraphs and subheadings or number list. also, break your…

  9. they are doing, or not doing, and…

    fill in that need. be unique!you must feel comfortable writing extensively about the subject that you choose. in order to build a successful blog, you will need to add an extensive amount of content in the beginning, and still continue over…

  10. by the number of links that are…

    attached to it and the amount of content added.examples of great authority sites are cnn.com, and usa.gov. they are large in volume and have massive content related to news and government respectively.authority sites that’s great for you to add conten…

  11. back together. a modern-day humpty dumpty tale….

    wrong place at the wrong time: these poor guys unwittingly became famous usually at the expense of their life or limb. again not totally free, but there was no investment up front, only collateral damage or medical or burial expenses after…

  12. you’ll own 30 unique posts. so in…

    2 months (30 x 2) = 60 posts!start#3: apply nowi know that there is a new tos (term of service) added adsense that no domains below 6 months will be approved by adsense. but if your content is useful, if a…

  13. - the general customer who tells them…

    what the product is like. since, it is based on honest opinions, generally there is less of sugar coated words, and false implications.this form of advertising generally happens in two different ways. the first is where reviewers or more specifically b…

  14. also a great and popular one. this…

    user-friendly site has a wide selection of designs and themes that configuring your page is never that difficult. in fact, one can have a professional design for that contemporary and refined page. with free blog accounts you can do a lot…

  15. and what really matters is the content….

    yes that’s true but focusing on just one factor is dangerous. let’s face it, as a visitor to a website or blog the first thing you notice is the design, the ease of navigation, loading time, advertisement banners and thumbnail images….

  16. visit site says:

    pre-loaded into wordpress and should be found…

    in the plugin section. this will need a key for it to be enabled and you will need to register with akismet to get a key. it used to be available from wordpress.org but unfortunately they have stopped doing that. [essential]2….

  17. reality people do not stay on your…

    page very long. you only have so much time to grab their attention, so you want to make sure to do the following:- format your post in a way that people can navigate easily - use italics and bolding for phrases…

  18. attention.differ in your opinion: receiving information only…

    about the right things always has become very common and people tent to get bored of it. you need to muster up the courage and inform people about the wrong things as well. controversy is one of the most popular crowd…

  19. there are several blog hosting sites that…

    will allow you to start your own blog for free - and you can’t get a better start-up cost than that! once your blog is up and running online, then the real work begins - growing your readership to boost blog…

  20. black birkin says:

    needs to be popular in blogosphre. use…

    social media for free advertisement - social media is one of the free platform to advertise your blog. just join as many as social media sites and make a lot of friends, share your article with them. join forums and use…

  21. aspect. when browsers go to your site…

    and see that your blog is nominated for the best blog design category, they now instantly know that you are for real, and this legitimacy factor is most commonly tagged with trust. a seed of faith is planted and this is…

  22. time to read unnecessary information that does…

    not relate to them. in order to get potential customers hooked and to inspire action, content writers use words that relate to the business’s target audience. the trick that writer of a content use is that they only insert useful and…

  23. svubit.org says:

    in a marketable way to gain the…

    desired effect you want. whether it’s for people to buy your book, come to your squeeze page, build an interest in reading your sales letter or going to your opt-in form.beware of the unethical ghostwriteras a ghost myself, i’ve seen many…

  24. seguros says:

    will receive. this needs precise detailing within…

    a short span of time. if you are a fast typer with good writing talent, needless to say your blogs will capture more attention.the tips stated above are just some basics to help increase your typing skills. you can try out…

  25. all the rage at the moment with…

    blogging ‘gurus’ telling you all about the great traffic benefits of guest blogging on other peoples sites. and you would be right to listen; they do bring in good traffic if you post to really great blogs. the writer gets exposure…

  26. should also use them in the text,…

    but avoid loading the article with keywords. instead, limit each keyword to no more than 5% of the total word count.develop your social media writing skillsthere is a lot of demand in the online writing marketplace for seo experts, but there…

  27. winery could keep a travelogue about day…

    trips in the region. a pet store could highlight and review pet-friendly hotels and other businesses.there should be some link between what kind of business you have and the topic(s) you blog about but the link needn’t be direct and ideally…

  28. and grown-ups alike are attracted to picture…

    books or websites that have eye-catching images? this is because most people tend to associate a lot of meaning to pictures.when used appropriately, a picture can enhance what you write and convey a lot of meaning to the reader. in other…

  29. your style cleanwhat does it mean to…

    “keep it Titanic clean?” does that mean that you can’t or shouldn’t address off-color topics or use colorful language? not necessarily! if that’s your style, then go for it. by “keeping your style clean,” i mean keep it consistent, keep it clear…

  30. Sites we Like……

    [...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……

  31. symptoms of low vitiam d…

    I do enjoy the manner in which you have presented this particular issue and it does indeed give me personally a lot of fodder for thought. Nonetheless, from what I have witnessed, I just wish as other feed-back pile on that individuals continue to be o…