- Joined
- Jan 20, 2007
- Messages
- 3,269
- Reaction score
- 270
- Points
- 83
- Location
- Oakton, VA USA
- Your Mac's Specs
- White MacBook Intel C2D 2.2GHz, 2G, 250G, SD, Leopard.
This is the software being considered for use in the "Wish" thread:
http://www.mac-forums.com/forums/showthread.php?t=78599&page=1
The software is here:
http://homepage.mac.com/mathogre/.Pictures/touch_08.py
It is a command line program written in Python. It uses the version of Python built into the latest version of OS X, 10.4.10. The version of Python is 2.3.5. While newer versions of Python are available, I chose to go with what is in OS X.
Download the softare to your desktop. After you download it, do an md5 check on it. Open Terminal and type the following on the command line:
md5 touch_08.py
You should get a result like this:
MD5 (touch_08.py) = 105388ae8172326cef18a353ad8d78f3
If you do, then your download worked properly. If not, then your download did not work.
This is NOT the final version of the software. However, you should try it to see how it works.
Type the following on the command line:
/usr/bin/python ~/Desktop/touch_08.py
This will start the program.
Below you will find the opening comment section from the program. You can read the code with any text editor and see exactly what is in it. The program is neither long nor complicated. Please feel free to challenge anything that does not seem right!
## This program chooses names in the drawing run by macjuicy23 for an
## Apple Store credit and for an iPod touch. The names are stored in a
## list, once for each ticket they bought. A user enters a closing stock
## figure as the random number seed for a stock group or single stock
## chosen on the previous day. The Apple Store credit is chosen first,
## and the winning ticket is removed from the list. The iPod touch is
## chosen second, and the winning ticket is removed from the list.
##
## To run the program, place this program on your desktop, run Terminal,
## and enter the following command into Terminal:
##
## /usr/bin/python ~/Desktop/touch_08.py
##
## This will start the program.
##
## You will first see a greeting, and a request to enter the stock price.
## For instance, on a Monday, someone may decide the drawing will occur
## the next day, and that the closing Apple stock price for Tuesday as
## reported on an iPhone will be used to seed the program. This is where
## you'll enter it.
##
## Note that the random number generator is very sensitive to inputs. A
## one cent difference ($0.01) can radically alter results. In addition
## to the unpredictability of stock prices from day to day, no one can
## second guess the results. Feel free to experiment!
##
## After entering the stock price, you are shown what you entered, and
## are allowed to either press the return key to continue or enter ctrl-d
## to exit the program.
##
## Assuming you've properly entered the stock price, you are then
## prompted to press the return key to see what tickets are in the
## drawing. I've taken everything almost exactly as in the forum thread.
## In one case I had to add a back slash - a character escape - to allow
## for a single quote that appeared in the forum list.
##
## One line exists for each ticket. People who bought multiple tickets
## are shown multiple times. This is simply for validation.
##
## Now it's time for the drawing. You are prompted to press the return
## key to see who wone the Apple Store credit. The program randomly
## chooses an entry from the ticket list (a Python list named ticketList)
## and prints the result.
##
## You are then prompted to press the return key to see the list of
## tickets remaining in the drawing. The program takes the winning
## ticket and removes it from the ticket list. The remaining entries are
## displayed.
##
## Note that a person with two or more tickets could potentially win both
## prizes. Only the winning ticket is removed.
##
## The next prompt for the return key is for the iPod touch. As before,
## the program randomly chooses an entry from the ticket list and prints
## the result.
##
## Finally you are prompted to see the remaining list of tickets that did
## not win. The winning entry is removed from the list when you press
## return, and the remaining tickets are displayed.
http://www.mac-forums.com/forums/showthread.php?t=78599&page=1
The software is here:
http://homepage.mac.com/mathogre/.Pictures/touch_08.py
It is a command line program written in Python. It uses the version of Python built into the latest version of OS X, 10.4.10. The version of Python is 2.3.5. While newer versions of Python are available, I chose to go with what is in OS X.
Download the softare to your desktop. After you download it, do an md5 check on it. Open Terminal and type the following on the command line:
md5 touch_08.py
You should get a result like this:
MD5 (touch_08.py) = 105388ae8172326cef18a353ad8d78f3
If you do, then your download worked properly. If not, then your download did not work.
This is NOT the final version of the software. However, you should try it to see how it works.
Type the following on the command line:
/usr/bin/python ~/Desktop/touch_08.py
This will start the program.
Below you will find the opening comment section from the program. You can read the code with any text editor and see exactly what is in it. The program is neither long nor complicated. Please feel free to challenge anything that does not seem right!
## This program chooses names in the drawing run by macjuicy23 for an
## Apple Store credit and for an iPod touch. The names are stored in a
## list, once for each ticket they bought. A user enters a closing stock
## figure as the random number seed for a stock group or single stock
## chosen on the previous day. The Apple Store credit is chosen first,
## and the winning ticket is removed from the list. The iPod touch is
## chosen second, and the winning ticket is removed from the list.
##
## To run the program, place this program on your desktop, run Terminal,
## and enter the following command into Terminal:
##
## /usr/bin/python ~/Desktop/touch_08.py
##
## This will start the program.
##
## You will first see a greeting, and a request to enter the stock price.
## For instance, on a Monday, someone may decide the drawing will occur
## the next day, and that the closing Apple stock price for Tuesday as
## reported on an iPhone will be used to seed the program. This is where
## you'll enter it.
##
## Note that the random number generator is very sensitive to inputs. A
## one cent difference ($0.01) can radically alter results. In addition
## to the unpredictability of stock prices from day to day, no one can
## second guess the results. Feel free to experiment!
##
## After entering the stock price, you are shown what you entered, and
## are allowed to either press the return key to continue or enter ctrl-d
## to exit the program.
##
## Assuming you've properly entered the stock price, you are then
## prompted to press the return key to see what tickets are in the
## drawing. I've taken everything almost exactly as in the forum thread.
## In one case I had to add a back slash - a character escape - to allow
## for a single quote that appeared in the forum list.
##
## One line exists for each ticket. People who bought multiple tickets
## are shown multiple times. This is simply for validation.
##
## Now it's time for the drawing. You are prompted to press the return
## key to see who wone the Apple Store credit. The program randomly
## chooses an entry from the ticket list (a Python list named ticketList)
## and prints the result.
##
## You are then prompted to press the return key to see the list of
## tickets remaining in the drawing. The program takes the winning
## ticket and removes it from the ticket list. The remaining entries are
## displayed.
##
## Note that a person with two or more tickets could potentially win both
## prizes. Only the winning ticket is removed.
##
## The next prompt for the return key is for the iPod touch. As before,
## the program randomly chooses an entry from the ticket list and prints
## the result.
##
## Finally you are prompted to see the remaining list of tickets that did
## not win. The winning entry is removed from the list when you press
## return, and the remaining tickets are displayed.