Instructor: David R. Brooks, PhD

e-mail: brooksdr@drexel.edu
WWW: www.pages.drexel.edu/~brooksdr
Office: at Bossone prior to class or by appointment
Time: Thursday, 6:00-8:50pm
Place: Bossone 709
Texts:
In the past I have used these two texts:
        David R. Brooks, An Introduction to HTML and JavaScript for Scientists and Engineers, Springer, 2007
        ISBN 978-1-84628-656-8

        David R. Brooks, Introduction to PHP for Scientists and Engineers, Springer, 2008
        ISBN 978-1-84800-236-4

NOTE: Check www.abebooks.com for prices on these texts, new and used. They are also in Hagerty Library.

BUT, this fall I am just finishing a new manuscript combining these two texts with some new material and I will put this manuscript online closer to the start of classes. If you would like a printed copy, we can arrange that at our first class meeting. I think a photocopied and spiral bound copy will cost about $15.

Course Description

This course provides an introduction to programming and problem solving. Rather than using a "traditional" programming language such as C or C++, it uses the HTML/JavaScript/PHP environment. This approach recognizes the dominant role HTML and JavaScript play in today's online world, and takes advantage of the fact that JavaScript and PHP include the most important features of modern structured programming languages. HTML is a basic Web development tool that provides the user interface for problem solving. JavaScript is a fully featured client-side language that can be used to solve a wide range of computing problems, including problems from science and engineering. JavaScript's inability to access information stored on a remote server is a limitation that can be overcome by using a server-side language such as PHP. For our purposes, PHP's ability to read and write files on a server is its most important characteristic.

Students are expected to bring to this class their own suggestions for computing problems that are relevant to their current studies. By the end of the course, students will be able to create their own online applications for solving a wide range of computing problems. Because the course emphasizes general programming principles, it prepares students to learn other languages as needed. Not so incidentally, a working knowledge of HTML, JavaScript, and PHP is a highly marketable skill.

There will be weekly homework assignments. These assignments will be more challenging later in the course. Homework assignments are due at the beginning of class each week, so that we may discuss them during class. I am always available online to discuss these assignments and I am happy to arrange to meet with you individually before class.

Course Outline (preliminary and subject to change)

Week 1, September 23
Introduction to HTML elements
HW #1, due beginning of class, September 30: all Chapter 1 exercises
Also, prepare a brief oral presentation (no more than 5 minutes?) about a computing problem you encounter in your other classes, current or past, or at your job. Please hand in a brief written outline for this problem.
HW #2, due beginning of class October 7: all Chapter 2 exercises
Week 2, September 30
HTML tables, lists, and forms
Week 3, October 7
Introduction to JavaScript
HW #3, due beginning of class October 14: all Chapter 3 exercises
Week 4, October 14
Introduction to JavaScript
HW #4, due beginning of class, October 21: Exercises 4.4, 4.5, 4.13, 4.15
Week 5, October 21
JavaScript Functions
HW #5, due beginning of class NOVEMBER 4. Exercises 5.5, 5.7, 6.3, 6.6, 6.7
NOTE: No homework due in class on October 28. In class, we will start working on these homework exercises.
Week 6, October 28
Building complete HTML/JavaScript applications
Week 7, November 4
Introduction to the PHP environment
HW#6, due begining of class November 11
1. Create a data file containing at least 10 entries that look like this: David 99
Sue 73
...
Note that a compound name, like "Sue Ellen", will cause complications because it will look like two strings and not just one. Write a PHP program that will read this file and save the contents in a new comma-delimited file: David,99
Sue,73
...

Give this new file a .csv extension. (If you double click on such a file, it should be opened in Excel.) Note that this file does not necessarily need an HTML document interface. Such a document could be used to specify the name of the input file, but you can also "hard code" the file names. If you do hard code the file names, then you won't need an HTML interface to provide input.

PHP 2 in your text. You can just make up materials and densities, or you can use real materials and their real densities. In any case you will need an HTML interface to tell the PHP program whether to display materials greater or less than some specified value. In PHP, the "value" of a radio button is very easy to get. Just use the $_POST[...] value for the name of the radio button.
Week 8, November 11
Remote file access with PHP
HW#7, due DECEMBER 2
In your text, PHP 8, PHP 11, PHP 12, PHP 16, PHP 20

For PHP 20, your data file should have this header, as shown, and should contain at LEAST these four sets of data:
mon	day	year	hour	min	sec	AM/PM
10	17	2010	9	29	35	AM
10	17	2010	12	40	0	PM
11	3	2010	9	22	33	PM
11	4	2010	12	3	14	AM			 
Week 9, November 18
More about PHP
Week 10, November 25
THANKSGIVING HOLIDAY
Week 11, December 2
Class project

Grading

Homework, 40%; Class participation, 25%; Final project or take-home exam, 35%

Class policies

Class participation is important. Homework and other individual projects must represent your own work. In some cases, you may arrange to work jointly on class presentations or projects. I understand that you will make use of other resources, including other books, friends, and colleagues. This is OK, but you must acknowledge them for your homework assignments.

Prior to the start of class, you must establish a basic Web page on Drexel's dunx1 computer or elsewhere. See this file. NOTE: This file may need to be updated. If I find problems I will try to fix them. If you find problems, please let me know. Prior to the start of class, I will be available to help if you have questions. This Web page does not need to include anything other than your name in plain (default) font. The point of this requirement is to minimize the amount of class time spent going over the purely mechanical process of setting up a Web page. You do not have to put a Web page on dunx1. If you already have a Web site on which you can post assignments for this class, that is OK. Here is the minimum HTML code you will need:

<html>
<head>
  <title></title>
</head>
<body>
Home page for [your name].
</body>
</html>

You will need an HTML/JavaScript/PHP editor for this course. In principle, you can use any text editor, even Notepad. However, a "real" script editor will make your life much easier. I use the freeware version of AceHTML, available from www.visicommedia.com. The only downside to this free software is that it may require you to install other software that you don't want. I have a very old version, when this wasn't a problem. Presumably you can uninstall whatever software you don't want to keep. You do NOT need any kind of more elaborate Web design software, such as FrontPage, but you can use it if you already have it. There are several freeware editors available online, but I haven't looked at them. If you bring a Windows laptop to class, you can copy my installation program for AceHTML 5.0, which is what I use. It is pretty old, so I do not know whether it will work with Vista or Windows 7.

You will also need access to a server that is running PHP. The easiest solution is to create a local server on your own desktop and/or laptop. Note that, because of system security issues, Drexel's dunx1 computer (on which your Drexel e-mail and possibly your web page reside) does NOT support PHP (or other server-based scripting languages). Biomed's own servers also will not support server-based scripting languages. For Windows computers, you can download and install WAMP (Windows Apache server with MySQL and PHP). For Linux, use LAMP. For Macintosh, use MAMP. These are all free downloads. I have WAMP on my Windows XP computers and I found the installation to be very easy. In the past, I had problems with configuring PHP on the IIS server that comes with Windows. I have not tried MAMP, but it is reported to be easy as well. I have LAMP installed on my own Linux-based server at home, but I know virtually nothing about Linux.

Code from book

Powerpoint presentations:
Chapter 1
Chapter 2
Chapter 3
Chapter 4a
Chapter 4b
Chapter 5
Chapter 6
my homework solutions
philtemp.txt data file
Chapter 7
Chapter 8
Chapter 9

Other Resources

These books aren't required for this course, but they are an essential investment if you continue to use HTML and JavaScript after this class. Of course, there is also a vast amount of online information about HTML and JavaScript. The book by Stauffer is no longer in print, but it was the first HTML book I ever read. I include it partly for sentimental reasons, but it is still a good source for learning HTML if you can find a used copy.

Thomas Powell, HTML: The Complete Reference, Third Edition, 2001, Osborne/McGraw-Hill, Berkeley, CA. ISBN 0-07-212951-4.

Thomas Powell and Dan Whitworth, HTML Programmer's Reference, Second Edition, 2001, Osborne/McGraw-Hill, Berkeley, CA. ISBN 0-07-213232-9.

Thomas Powell and Fritz Schneider, JavaScript: The Complete Reference, 2001, Osborne/McGraw-Hill, Berkeley, CA. ISBN 0-07-219127-9.

Todd Stauffer, Using HTML 3.2, Second Edition, 1996, Que Corporation, Indianapolis, IN. ISBN 0-7897-0985-6.

There are a lot of books about PHP, too, but I have never bothered to buy one. Once you have some idea about how programming languages work, what you need for a new language are the specific implementation details for that language. The PHP books I have seen do not address a science/engineering-oriented audience and are therefore not a very efficient way to learn what you need to know. In conjunction with the text for this course, you should be able to do what I did when I was learning PHP: use online sources. The first source to which I turn when I have a question is www.php.net/manual/en/index.php. This is not just a language reference, but the site also includes many examples of PHP code, along with useful reader commentary. It is especially useful when you have a question about using a built-in PHP function.