Re: [SLUG] Free Gmail Raffle

From: Dylan William Hardison (dylanwh@tampabay.rr.com)
Date: Fri Jun 11 2004 - 11:21:50 EDT


Spake Robert Snyder on Friday, June 11, 2004 at 10:30AM -0400:
> For the slug members who would like a Gmail account and be part of
> Googles now most famous beta .. I am going to be giving away 2
> invites, as the third is going on ebay.... No not really just a close
> friend really wanted to be in this whole gmail thing. So I gave the
> 3rd one to him.
>
> How to enter Just reply to this email saying you want in.
>
> Rules
>
> You can only enter once but will in the both drawings
>
> You may not win both accounts.
>
> No bribing or harassing the judge.
>
> How and when I will leave up to you guys. Personally I will either
> toss a bunch of names in a hat or if some one else figure out a way
> for linux to figure it out that would be great too.
>
> When: Drawings and announcement of winners will happen on June 16 (
> Sarasota Lug Meeting Date)
>
> Anyway good luck If you guys dont want them accounts I will give them
> to some one else.

We wants the precious!

Everyone should pick a number from 0-255, then you can use the following
perl script to decide who wins. Just add a 'number => "Name",' entry to
%people.

I pick for my number 39.

Note: This script could take a long time to run, depending on how the
random number gods are feeling. In theory, the more id => name pairs in
%people, the faster it will run.

--- hat.pl ---
#!/usr/bin/perl
use strict;
use warnings;

## Add contestants here
my %people = (
        39 => "Dylan Hardison",
);

my $victim = pick_person(\%people);
print "And the winner is: $victim!\n";

sub randint {
        open my $hat, "/dev/urandom" or die "Can't open /dev/urandom: $!";
        my $buf;
        read $hat, $buf, 1;
        close $hat;
        return ord($buf);
}

sub pick_person {
        my ($people) = @_;
        my $found;
        
        while (not $found) {
                my $key = randint();
                if (exists $people->{$key}) {
                        $found = $people->{$key};
                }
        }
        return $found;
}
--- end ---

-- 
"A tinker man steped up beside me, and he belted me in my left eye!"
             -- Clancy Brothers and Tommy Makem, "Red Haired Mary" (song)
-
GPG Fingerprint=D67D 2B75 53C6 9769 30E4  D390 239F C833 F32C F6F6
GPG KeyID=F32CF6F6
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS).  Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 20:25:47 EDT