Computer Programming for Everybody, a Newbie Project

R

Ron Stephens

As most of you know, the founder and creator of Python has stated an
interest in bringing the joys of computer programming to a wider
audience, and he has coined the phrase "Computer Programming for
Everybody" to sort of sum up this concept. I fit in this category, for
prior to about 3 yrs ago, my programming experience and knowledge was
next-to-none. After 3 yrs of enjoying Python as a hobby in my limited
spare time, I have created a program, which I call askMerlin, that is
simple enough for a newbie to understand, yet interesting and
different.

Having greatly cleaned up the original code, the basic program is now
a class Decision() that allows one to simply analyze any decision one
needs to make. The other modules are subclasses of Decision() and are
sort of ultra-mini expert systems on how to decide what to eat for
lunch, who to vote for in an election, how to predict who will win a
given basketball game, football game, and how to answer yes or no type
questions. The last two modules apply the same technique but also
utilize the internet to gather data used to analyze and make
decisions.

I think it is a fun little program. Newbies can not only understand
it, but can add simple modules, in any area of their expertise, by
simply subclassing Decision(), or by simply creating an instance of
Decision and over-riding a few key methods, or perhaps more simply by
imitating the functional logic.

OK, that's my spiel. The program can be found at my web site at
http://www.awaretek.com/plf.html

Ron Stephens, humbly-yet-fearlessly-treading-where-he-ought-not-ly-yours

P.S. of course I am still adding to this program, especially the
internet-enabled part, and welcome ideas / contributions from any and
all, especially relative newbies who need a place to start.

P.S.S. to Newbies, the best way to understand this program is just to
run it a few times. It is a command line program, and although I have
cleaned up the code, I also removed for the time being the
documentation and comments, that were becoming unwieldy after three
years of fiddling. I think the code speaks for itself, especially
after you run it a few times and see how it works. And yes, I do
intend to add some simple comments back into the code ;-)))
eventually. Also, I apologize in advance for any indentation errors
anyone has after downloading or cutting and pasting the code; just run
the program and let the Python error messages help you sort out any
formatting or indentation errors you may encounter.

The basic idea is to choose between a few options or alternatives, by
basing your choice on a few good criteria, with each criteria having a
weight, or relative-importance-factor, and then, by various means,
determining a score for each option on each criteria. There, that's
the documentation for now ;-)))

And lastly, yes, I do realize it isn't much to show for three years of
part time work, but hey, I give me A's for persistence.

Ron Stephens
 
T

Tony Clarke

As most of you know, the founder and creator of Python has stated an
interest in bringing the joys of computer programming to a wider
audience, and he has coined the phrase "Computer Programming for
Everybody" to sort of sum up this concept. I fit in this category, for
prior to about 3 yrs ago, my programming experience and knowledge was
next-to-none. After 3 yrs of enjoying Python as a hobby in my limited
spare time, I have created a program, which I call askMerlin, that is
simple enough for a newbie to understand, yet interesting and
different.

Having greatly cleaned up the original code, the basic program is now
a class Decision() that allows one to simply analyze any decision one
needs to make. The other modules are subclasses of Decision() and are
sort of ultra-mini expert systems on how to decide what to eat for
lunch, who to vote for in an election, how to predict who will win a
given basketball game, football game, and how to answer yes or no type
questions. The last two modules apply the same technique but also
utilize the internet to gather data used to analyze and make
decisions.

I think it is a fun little program. Newbies can not only understand
it, but can add simple modules, in any area of their expertise, by
simply subclassing Decision(), or by simply creating an instance of
Decision and over-riding a few key methods, or perhaps more simply by
imitating the functional logic.

OK, that's my spiel. The program can be found at my web site at
http://www.awaretek.com/plf.html

Ron Stephens, humbly-yet-fearlessly-treading-where-he-ought-not-ly-yours

P.S. of course I am still adding to this program, especially the
internet-enabled part, and welcome ideas / contributions from any and
all, especially relative newbies who need a place to start.

P.S.S. to Newbies, the best way to understand this program is just to
run it a few times. It is a command line program, and although I have
cleaned up the code, I also removed for the time being the
documentation and comments, that were becoming unwieldy after three
years of fiddling. I think the code speaks for itself, especially
after you run it a few times and see how it works. And yes, I do
intend to add some simple comments back into the code ;-)))
eventually. Also, I apologize in advance for any indentation errors
anyone has after downloading or cutting and pasting the code; just run
the program and let the Python error messages help you sort out any
formatting or indentation errors you may encounter.

The basic idea is to choose between a few options or alternatives, by
basing your choice on a few good criteria, with each criteria having a
weight, or relative-importance-factor, and then, by various means,
determining a score for each option on each criteria. There, that's
the documentation for now ;-)))

And lastly, yes, I do realize it isn't much to show for three years of
part time work, but hey, I give me A's for persistence.

Ron Stephens


Excellent Ron,
As one long term newbie to another!
Worked first time, I downloaded from the page source info, perhaps that helped.
Now give us the GUI!
Tony Clarke
 
R

Ron Stephens

I am planning on going forward in several ways, and I would appreciate
any feedback on which directions seem most worthwhile.

1. I plan to do a full GUI version of the entire program using
PythonCard. I also, eventually plan to do an alternative GUI version
(or two), certainly one using Jython and SWING (so I can make a
self-installing GUI version for my Sharp Zaurus). I have also loaded
PyQt on my Zaurus, but I find Jython and SWING to be easier for me to
learn and use. Maybe a PyQt version will follow, and I would also like
to do a Tkinter version for comparison purposes. I may use EasyGui to
create a simple Tkinter version, and I will probably do an AnyGui
version. Another Sharp Zaurus user has reported getting an AnyGui
program working fine on his Zaurus (AnyGui uses the QT tool kit on the
Zaurus).

2. I plan to use NLQ, a Python natural language processor module, to
allow Merlin to choose appropriate possible options, or answers, to
users' questions, and then applying the standard askMerlin web
scraping algorithm to decide which possible answer is best. I have
preliminary versions of this working, but not yet posted, because it
doesn't choose good enough options yet, but I think I have figured out
ways to improve it. Next, I plan to make a more interactive and
versatle version of general decision analysis and askmerlin that will
flexibly adapt to a user's entries, answering a user's random question
most optimally, whether the user just asks a question and gives no
options, criteria, or weights, or whether the user gives any given
combination of the above. In other words, instead of making the user
declare upfront how much information she has to offer, it might seem
more fluid to the user to use one generic module that answers
questions regardless of how much information is given, although of
course the quality of the program's answers will tend to be better
when the user gives more information up front.

3. Concerning the web scraper algorithm used in askmerlin, I am
thinking about some ideas to do a version that will automatically
track trends on the web over time, graphing the output, in response to
specific user questions.

4. I want to do an online version the whole program, by making a
server-side version of askMerlin. Probably starting with a simple CGI
version, the idea will be to post the program on my website, and allow
a user to interact over the web; but this will also lead to the
storage of the sessions, allowing a database to be built up which
tracks user inputs, especially on scoring the various options for each
criteria. Picture this with respect to the election.py module. For a
given election, say the 2004 USA Presidential election, once we are
down to 2 or 3 candidates for the general election next November. As
each user enters their scores for each candidate on each criteria, not
only will they get an immediate response to the over all score of each
candidate based on their responses, but more significantly the
database can tally all users scores and average them, and plot the
results over time. I suspect that, for a website with enough users,
the data so generated could be valuable. My site currently gets about
10,000 unique visitors per month. If a site could get 1,000 users of
election.py (online version) per month, this might usefully supplement
the official Zogby and Gallup type "polls". No, the users would not be
scientifically sampled and randomly selected, and probably a site
would need to have, say, 100,000 unique visitors per month in order to
get 1000 to actually do the election.py online, in order to get useful
results. But still it is interesting to me, and it shouldn't be that
hard to make such an online server side version of election.py, or so
I figure. ;-))))

5. I will no doubt add at least a few new modules on new topic areas
to Decision Analysis. Of course, my biggest hope is that others will
do such additions and share them with me ;-)))


Any other ideas would be appreciated. Meanwhile, I would be interested
if anyone would offer thoughts on which of the 5 directions for future
activity sound most interesting.

Ron Stephens
http://www.awaretek.com/plf.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,588
Members
45,100
Latest member
MelodeeFaj
Top