May 2012
M T W T F S S
« Jul «-»  
 123456
78910111213
14151617181920
21222324252627
28293031  

Leaving Chris World?

Why not bring back a souvenir?

Archives

An Ethical Dilemma?

 
"""
An Ethical Dilemma?
 
Probably the closest thing to a computer misdemeanor I'll ever have.
 
I went to this school for 5 years.
I always thought about how to catch those sudden openings in
classes I was trying to get. I think I was never that motivated
because I never got locked out of a class. 
 
You see, I took my major courses before my GE's so that
when all the GE students were struggling to get into the
courses... I was taking lower demand Computer Science major courses.
And since the longer you go to the school the higher
your class ranking aka the earlier you can sign up... 
 
I always got the classes I needed.
 
But still, I was always fascinated by the possibility of auto sign-ups.
There already exists a system to help students respond to course openings
if the classes they want are already full.
Sure the school has a notification system, I thought.
But they don't have an 'auto sign up' notification system. 
 
Hence, someone 'could' write that sort of thing.
The Class Scheduling Magic Bullet so to speak.
 
I don't know what terms they have against such a thing.
I can imagine there might be something.
If so it should be here somewhere on HSU's policy page
http://www.humboldt.edu/~its/planning/policy/aup.shtml
 
And if not there then I don't believe this software breaks
any laws as stated in the California Penal Code 502, Computer Crimes, and 502.1
http://www.leginfo.ca.gov/cgi-bin/displaycode?section=pen&group=00001-01000&file=484-502.9
 
But the fact remains that while I was a student I never
did anything like it. And I find it that it wasn't till after
I had my CS Degree than I sat down to figure out how to do it
as an experiment in parsing. And even then, all I did was the first half. 
 
I the real reason why I wanted to parse te course enrollment docs
was to see the 'how, when and by how much
classes fill up in order to study the way student enrollment behaves
over the course of the semester.
 
I didn't finish nor have I tested the seconding theoretical auto course
sign up. But I'm sure a student of sufficient knowledge and skill could
make Selenium RC work and bind it to the python functions necessary.
 
I find publishing this to the web to
be an ethical dilemma for me. Someone could use the material
thus far to spring board them into a system for easy and cheat-like
class sign ups.
 
Though it reminds me of the PGP issue back in the day.
You see software is a funny creature. 
 
It's both text and a thing. And having this place in the world
make it the root of some unique if not troublesome legal dilemmas.
It's my right to publish this code. Could I be blamed if someone
decided to actually use the code? How could the act of using the code be the crime
while the act of making it available be protected?
 
Strange stuff.
 
Consider good ol' Philip Zimmermann
 
"Zimmermann challenged these regulations in a curious way. He published the entire
source code of PGP in a hardback book[7], via MIT Press, which was distributed and sold widely.
Anybody wishing to build their own copy of PGP could buy the $60 book, cut off the covers,
separate the pages, and scan them using an OCR program, creating a set of source code text files.
One could then build the application using the freely available GNU C Compiler. PGP would thus be
available anywhere in the world. The claimed principle was simple: export of munitions—guns, bombs,
planes, and software—was (and remains) restricted; but the export of books is protected by the
First Amendment."
(http://en.wikipedia.org/wiki/Pretty_Good_Privacy)
 
Why PGP? Read this to get the full picture.
http://www.philzimmermann.com/EN/essays/index.html
 
Now, I'm in no way claiming this software is anything like his or
others like it. I'm simply saying it's one of the first things
I've ever posted where I spent more time writing about
the use of the code then writing the code. 
 
So BE good! People, I needed it to for a statical analysis of
student enrollment behavior for which I think I might write
in java. I can't wait to watch spikes in attrition rates over
the semester. So many strange questions to answer!
So little time!  
 
October 5, 2008
Chris B Stones
 
Implementation Notes:
 
Part I
 Parse the class available list.
 http://www.humboldt.edu/~oaa/class_schd/fall08/index.shtml
 
 A typical Page looks like...
 http://www.humboldt.edu/~oaa/class_schd/fall08/MATH.html
 
 Computer Science simpler and more a more fitting example.
 http://www.humboldt.edu/~oaa/class_schd/fall08/CS.html
 
Part II
 Auto sign up the part they don't have at HSU.
 WebReg
 https://www.humboldt.edu/pls/banweb/twbkwbis.P_WWWLogin
 
One might think you could just have it keep trying to sign you up.
But a fellow found out that that just locks you out of the system after
a few ten's of thousand times. Hence why you need to check.
 
Assuming that those pages are updated every single change..
 
    Copyright 2008  Chris B Stones 
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
"""
 
# The Vital Info for this Service
CRS_NUMBER    = 42864                              # Course ID of the course you want
class_listing =  "http://www.humboldt.edu/~oaa/class_schd/fall08/CS.html"
                                                   # The page on which the course
												   # listing appears and is updated
student_id    = "673434878"                        # id string
student_pwd   = "54516"                            # studnet passworld for WebReg
 
import urllib
from urllib import URLopener
 
webpage = URLopener().open(class_listing)
lines = []
for line in webpage:
	lines.append(line)
 
for l in lines:
	# first find the line of the course
	# we are watching
	if( l.find(str(CRS_NUMBER)) != -1 ):
		# parse for data assuming no other slashes
		# And only 2 slashes per line I want
		max,enrol,rest = l.split("/")
		# pull off the last 4 chars of max then trim
		# should leave you with the value
		crs = max
		max = max[len(max)-4:]
		max = max.strip() #remove whitespace
		enrol = enrol.strip()
 
print enrol,max
free_spots = int(max) - int(enrol)
print "There are",str(free_spots),"free spots in", CRS_NUMBER," :",crs
 
# if free spots sign up for one automatically
# and then don't try again
# if( free_spots > 1):   
 
# assuming you have SE RC all setup ... something I have yet
# to be able to do.
from selenium import selenium
import unittest, time, re
 
class NewTest(unittest.TestCase):
    def setUp(self):
        self.verificationErrors = []
        self.selenium = selenium("localhost", 4444, "*chrome", "https://www.humboldt.edu/")
        self.selenium.start()
 
    def test_new(self):
        sel = self.selenium
		# WebReg Url
        sel.open("/pls/banweb/twbkwbis.P_WWWLogin")
        sel.type("UserID", student_id)
        sel.type("//input[@name='PIN']", student_pwd)
        sel.click("//input[@value='Login']")
        sel.wait_for_page_to_load("30000")
        sel.click("//a[contains(text(),'Student Services')]")
        sel.wait_for_page_to_load("30000")
        sel.click("link=Registration and Schedule")
        sel.wait_for_page_to_load("30000")
        sel.click("link=Register or Add/Drop Classes")
        sel.wait_for_page_to_load("30000")
		# There are more steps that include submitting the CRS_NUMBER
		# But they are not here because I'm not a student anymore
		# so the pages are broken
 
    def tearDown(self):
        self.selenium.stop()
        self.assertEqual([], self.verificationErrors)
 
if __name__ == "__main__":
    unittest.main()
 

You must be logged in to post a comment.