130 likes | 146 Views
Course Selection. CS450 Software Design and Development http://www.clarkson.edu/~jablonpa/cs450/selection.html Christopher Cameron Patty Jablonski Megan Peters December 3, 2001. Need. Resolving conflicts is frustrating! Using the online Master Schedule is tedious!
E N D
Course Selection CS450 Software Design and Development http://www.clarkson.edu/~jablonpa/cs450/selection.html Christopher Cameron Patty Jablonski Megan Peters December 3, 2001
Need • Resolving conflicts is frustrating! • Using the online Master Schedule is tedious! • Why not parse the SAS Master Schedule, and let the computer find a course that meets your needs?
User Interface • Access the webpage from any browser. • Narrow the search by selecting search criteria from a web interface. • Choose a course from the results list, or go back and search again.
Selection Options • Undergraduate or Graduate • School • Department • Professor • Day • Time • Course Number
Programming Overview • Development Environment • UNIX • Scripting • Perl • CGI • Web page design and documentation • HTML
From SAS to Usable • Perl script • Parses the SAS Master Schedule to get rid of HTML tags and garbage lines. • Parses new file to reformat and keep the most important information. • Parses the clean file using the criteria entered by the user. • Returns the results with Dynamic HTML.
Script - Professor List cat $1 | sed 's/<.*>//g' | /usr/xpg4/bin/sed "/\^\$/d" | grep "[A-Z][A-Z][0-9][0-9][0-9]." | sed '/HTBA/d' | awk -f getProf | sort | uniq > $2 #!/usr/xpg4/bin/awk –f getProf { print $NF }
Dynamic HTML – Professor List print " Select a Professor:<br>"; print " <select name=\"Professor\">"; print " <option value=\"none\">"; open(INPUT,"professors.txt") || die("Can't open professors.txt"); while(<INPUT>) { print "<option value=\"$_\">"; print $_; } print " </select><p>";
Comparing Professors $pos=length $professor; $l=$pos-1; if($l == $thisLength) { $i=0; while(($thisProf[$i] eq $splitProf[$i]) && ($i<($l))) { $i++; } if($i==$l) { $keep=1; } else { $keep=0; } } else { $keep=0; }
Bibliography • http://www.ecn.purdue.edu/ECN/Documents/perl/ • Castro, Elizabeth. "HTML For The World Wide Web." Fourth Edition. Berkeley,CA: Peachpit Press; 2000. • Christiansen, Tom and Nathan Torkington. "Perl Cookbook." Cambridge: O'Reilly & Associates, Inc; 1998. • Robbins, Arnold. "UNIX In A Nutshell." Cambridge: O'Reilly & Associates, Inc; 1999. • Siever, Ellen, Stephen Spainhour and Nathan Patwardhan. "Perl In A Nutshell." Cambridge: O'Reilly & Associates, Inc; 1999. • Wagner, Bill. "The Complete Idiot's Guide To UNIX." Indianapolis, IN: Que Corporation; 1998. • Wall, Larry, Tom Christiansen and Jon Orwant. "Programming Perl." Cambridge: O'Reilly & Associates, Inc; 2000.