INFO250 - Programming Languages

Course Objectives

Students develop programming skills using open source technologies, and gain at least novice skills in at least two Programming Languages, plus SQL for database. The first exercises introduce structured programming, data structures and algorithms for keyboard and file processing using PHP at the command line on a Linux server. Projects include design of algorithms for descriptive and inferential stats, and for loading and accessing data in data structures such as linked lists, hash/ISAM indexes, and binary/balanced trees. Then, we focus on server-side programming for the web, with the objective of each student developing their MVC-Model View Controller for the language of their choice.

W3Schools' tutorials introduce semantic markup and styling for the web, and object-oriented programming with the DOM and Browser-Side scripting: HTML, XHTML, HTML5, CSS, JavaScript, and jQuery. Server-Side Scripting involves the 'LAMP Stack' of Linux, Apache, MySQL, and PHP. In the 2nd semester, students continue to design and develop their Model View Controller. Repeating earlier exercises in another language, chosen from: Java/NetBeans, SDK for a Mobil Device (iPhone or Droid), Python, Bash, Perl, Ruby, C++ or an approved other language of interest to the student.

Students will learn:

This page is not in a cogent sequence, is set as it was at the years' end.

'Current Stuff' is arranged by descending date, with recent stuff first. Every few weeks, stuff that is no longer current is moved to Prior Current Stuff. The section 'Topics and Class Meetings' is arranged by ascending date, with topics moved to Topics and Class Meetings when Quizzes and Projects have passed.

Current Stuff at 6/5:

(6/3) Sample Exam Questions are posted. The exam will consist of several of them, for a total of 15 points.

(6/3) Usability Exam

Each student's site will be examined by the instructor during the exam time. An account for a fictitious persons assigned at info465.info/eland will be used. This portion of the exam counts 15 points, 2 points for each bullet below, with bonus points posted if they're earned.

(5/13) Third Deliverable for DPFTW, Due 5/22: Add a form, on the Manager's menu, to create new and update existing records in a table you've added to your database. See guidelines for a Data Management Form below...

(5/4) Second Deliverable for DPFTW, Due 5/15: Site up with AAA and Menu working, customized to your fictitious organization. Advanced students are welcome to write your own after plans are approved and this will count for 2nd and 3rd deliverables. Others See Steps to get ProtoOrg working in your account, add fictitious users, and set to customizing it...

(5/1) There are no Data Janitors at info250.biz so a strong, multi-factor, authentication process and manager approval are required for your sites' users, and any page that gets data to put in the database must be protected from any user that is not authenticated. Watch Topics and Class Meetings on 5/5 for more on this, will start Monday...

(4/27) First project for Database Programming for the Web:

(4/15) Links Due 4/22 for Afternoon Section (Noon's already done!) :

Here's a Database ERD that is close to the Business database:

ERD

(3/25) Exercise with ebus202.info/Business: Assemble in teams of three or four; come up with a politely named organization that sells something; instructor will set it up and assign a manager to it; other team members get accounts with fictitious names, one with an account at info465.info/eland; manager approves accounts them; add three products or services to the catalog; buy some with the elanded-account; fulfill the order; find all the records related to your accounts and purchase in the database at Business. (Log into ebus202.info as userid 'guest' and password '.,guest.,'. Log into mysql with same uerid and password, using database Business. Scripts are at /home/Business/Web, stuff secured off the web root in /home/Business...

(3/25) Database Programming for the Web: (30 points) New students are encouraged to set up the Business stuff in their accounts, advanced students are encouraged to write their own, both _must_ start with a good AAA scheme. The sites must use 'multi-factor authentication' and require a manager to approve any accounts that can log in. They must gather some kind of data, or sell stuff, to the site's users and provide 'back office' functions for managing accounts, reviewing logged activity, and reporting data gathered or sales. 10 points will be assigned when the AAA scheme is set up and working, 10 points when User interface works, and 10 points when back office and complete app is presented.

(3/25) Independent project with New Language: (30 points) Propose your project. It should involve a new language, not PHP, or it may use PHP's OO features. The new language may be deployed for a whole 'nother project, or it may be combined with the above Database Programming for the Web. 10 points will be assigned for early work, intermediate, and final results.

Topics, Class Meetings

Topics and class meetings are arranged in date sequence. Look for due dates in 'Current Stuff' above. Topics are moved down the page to Prior Topics as new topics are introduced.

(4/15) Information Security

Overview: Check out Wiki's article on Information Security and find two others that provide insight to this most-important topic. Application Development: Check out this dry listing of Top 25 Vulnerabilities in application code, and find two others that you find helpful to guide your work on the next 'web-facing' projects.

Although it's beyond the scope of this class, the topic Network Security (puny article with lots of links) should be of interest to anybody who wants to work in computer or information systems.

Study guides for CompTIA's Network+ and Security+ certificates provide the details to implement the Trilogy of Trilogies that describes system security. Somebody who practices 'network security' should know the details of how to design, or survey, a computer system and build in, or point out, the technology and techniques to ensure it's secure. Add a good understanding of Accounting and Risk Management and you have the job-description of today's 'information systems auditor', 'black hat hacker', or 'cracker'.

For decades CIA - Confidentiality, Integrity, and Availability where the '3 pillars of information security'. These were promulgated when networks were rare, many jobs were submitted on punched cards with paperwork authorizing whoever pushed the cart to the computer room door to submit a job to the computer operator, and 'terminals' were just appearing on peoples' desks. Before The Internet was used much of Universities and Labs, information security was easier to provide. Most networks were 'really private' and difficult or illegal to compromise. Today's Internet is 'really public' and there is little expectation of privacy. Even if the little lock is on, NSA and wealthy crackers can suck up packets and decrypt phone calls and 'secure' SSL/PKI at a rate of 50,000+ per day. If the little lock isn't on, everything can be seen/sniffed by anybody who has access to any of the routers that routes our packets across The Internet.

Today, other pillars are commonly pointed out in addition to the old CIA triad: Accountability, Authenticity and Non-repudiation. Since most 'economic co-operation' involves Internet these days, OECD - Organisation for Economic Co-operation and Development, in 2002, settled on a list of nine: nine generally accepted principles: Awareness, Responsibility, Response, Ethics, Democracy, Risk Assessment, Security Design and Implementation, Security Management, and Reassessment.

Operationally: The AAA - Authentication, Authorization, & Accounting functions that allow people and other computer systems to gain access to an organizations systems are key to providing all of the above. Multi-factor authentication, role-based authorization, and accounting for _everything_ a person, or another computer, does on a system are absolutely essential for providing information security. They're where we're starting on the next exercises in 'database programming for the web'...

PCI - Payment Card Industry standards provide practical guides for businesses and organizations that are custodians of customers' payment card and bank account numbers. We wish they'd do better! A breach of confidentiality can harm customers/clients and bankrupt a business. (I've had three credit cards involved in breaches and assume my health records are out there somewhere other than Anthem's database.)

If you're not going to secure it, don't collect it or keep it. Security can't be an add-on, it must be integral in an organization's culture from the top down, and pervasive in the organization's assets from locks on the doors thru its networks' firewalls, computing hardware, operating systems, and application software. Security needs to considered very early in the selection or development of application software and every day that it operates. Richard Clarke, presidential security advisor several years back, summed it up: "If a company pays more for coffee than network security they _deserve_ to be hacked!".

(3/23) AAA Working at info250.biz/YourAccount/Web

(5/4) Due 5/15: Add Your Novel Form to the Database and Site

Provide input for 'users' to fill in a form, store it in the database, and 'back office' functions for Manager to edit and list or summarize the input.

This might be the same as the earlier exercise, but should not be about 'people' or 'organizations' since these are already handled in ProtoOrg. Instead, make the records about 'things' or 'concepts' or other polite entities such as a questionnaire, blog entry, or quiz. The records should demo all data types: varchar, text, integer, decimal, date, and at least one code or foreign key presented in a select.

Forms for Data Management

In the old days the 'sequential master file edit & update' was the big challenge for programmers. This read data from a 'transaction tape' and edited it with reference to the 'master tape' to make sure the transactions were all 'reasonable' and referenced existing master records. If there were 'edit errors' they'd be listed on greenbar paper for whoever prepared the transactions to go fix; else, the tapes would rewind and the transactions would be added to a new tape that held the newly updated master file.

Today a challenge for developers is a 'data management form' where users enter data on-line into a form and the data is 'edited' for reasonable values. If there are edit errors, the form is presented to the user with error messages (often called out with big red splats) marking the errors; else, the tranaction is applied to the record or a new record is added to the table.

This is often called by the acronym that describes operations on records, CRUD or CRUDS: Create, Read, Update, Delete, Search. In practical use, records are hardly ever Deleted since destroying evidence invites theft. When records are Created or Updated there is usually a separate 'transaction record' that is written. And, often 'an update' affects multiple tables.

Some teams meet this challenge by using a 4GL like Net Beans, Zend, or Visual Studio which already 'know how' to manage forms and update databases -- these 4GLs do maybe 80% of the tedious steps for 'data entry forms', leaving some work by the programmer to handle 'business rules', or maybe to handle other tables affected by a new or changed record. Other frameworks like 'Ruby on Rails'

Some teams avoid the expense of the 4GL and roll their own data management forms, using a 'template' that reflects 'the way we do it' so that a consistent design pattern is applied to the application environment and every programmer is not stuck with inventing their own methods.

The instructor suggests that a simple data management form have these functions:

The 'mainline' for the data management form should support at least these functions, features, and views:

Here are some rough sketches so support this discussion:

Functions Mainline

Prior Current Stuff:

(3/13) I've got to miss classes on Monday, have re-arranged the due dates a bit so that the 20-point project will be scored next Wednesday the 18th. Please use the time on Monday to team up and evaluate each other's projects according to all the specs below, dated 3/11. I'll score these projects after class on Wednesday. We'll move on to 'database programming for the web' on Wednesday.

Please pay particular attention to the specs, which have been well discussed in front of mostly attentive students. Use Monday's class to:

(2/13) Due Monday the 16th for 5 points: Find two style guides or other references about how to make mobil-friendly websites. Post links to the on your class' home page so they're easy for the instructor to find. (He appreciates the help with research.) 'Viewports' and 'media queries' are important topics, as well as dimensions for popular smart devices. Apple and Google both have excellent guides, but please dig a bit for one or both of your references.

(2/11, last updated 3/7) Due Wednesday the 18th for 20 points! -- Graphics, JavaScript, and Mobil-friendly POST Data Demo:

(11/19) Terms of Use and Honorable Conduct on the Class' Server

(4/1) Due Friday 17th, 1 Packet per Team:

(2/4) Due Monday the 9th: Add three 'novel' reports (not in the class' samples) that demonstrate passing GET data, tabulated results, aggregate functions, at least one outer join, and at least one case/rollup or other advanced SQL. Advanced students, please replace mysql_ functions with mysqli_ functions and/or objects.

(1/12) Study questions for the short essay, short answer portion of the exam are posted. Sample Queries are posted to supplement those in links below for the Database portion of the exam. They demonstrate SQL ROLLUP, CASE, and COALESCE statements, outer join, and joining three tables with and without explicit JOIN. Exam Sample Questions and Queries.

(1/9) Due Friday 1/16 for 5 points: (Relaxed 1/12) Add SeSPoP reports to your class website to demo use of GET data to specify reports: The sample scripts introducing database programming with PHP including queries from the browser using GET and HTML forms with POST data are at info250.info/astudent. Sample scripts are in /home/astudent/web/LinkToReports.html and DonationReports.php -- you may copy them to your web directory using cp at the command line or FileZilla to copy to your desk and then to your web directory.

Make a page at your website with a prominent link from your home page that says 'SeSPoP Reports' to place your queries and style it consistently with the other pages. Make your scripts produce web pages with valid, strict XHTML or HTML5. Add three 'novel' reports (not in the class' samples) that demonstrate passing GET data, tabulated results, aggregate functions, at least one outer join, and at least one case/rollup or other advanced SQL. Advanced students, please replace mysql_ functions with mysqli_ functions and/or objects. After exams a POST data demo will be the next project due. please don't make reports with hundreds of rows...

(1/9) Due Monday the 12th for 5 points: Demo ability to use MySQL from its command line to do selects involving joining tables and aggregate functions.

(1/7) Lecture is a practical look at SQL using the three tables in the SeSPoP database: Simple queries; order by; aggregate queries (subtotals) using sum, avg, count and group by; errors with multiple tables and missing or flawed join, simple inner join between Donations and Regions using PK=FK in the where clause; outer join between Regions and Donations to show Regions with no activity; &c...

(1/5) The current topic is listed under 1/8 below, gets us into DBMS using SQL. Work through the tutorials and take the quizzes at W3Schools for MySQL and PHP, under the topic 'Server Side'. The quizzes are due by the end of class on Friday the 9th. There will be a quiz on SQL on Wednesday the 14th using SeSPoP tables and the Entities table from the EBUS202 database.

(11/20) After these projects with 'static HTML', when we get into 'database programming for the web' student's sites must gather some kind of data from site's users and present its summary to a site manager, and meet other specs including a strong A&A scheme. Questionnaires, tests, sample management, or other forms of data collection may be approved, including analysis of data in files uploaded to the server.

(12/12) The requirements for a lengthy JavaScript and transparency in images is relaxed for Project #2. We'll pick these up as separate topics after the winter break...

(12/8) The next deliverable is due Dec 19th. It must meet all the specs posted below on Nov 18th, and these: Site launches from link at info250.info; At least three pages styled with the same external css; The css must demo proficiency with id and class selectors and use them appropriately; All graphics must be sized as they are to be displayed be served locally from your web directory, and demo proficiency with a graphics editor like GIMP or PhotoShop; Demo centering some elements using valid CSS; Demo JavaScript that you've written yourself, at least 40 lines of code, and skills with using Chrome or Firefox JavaScript console to debug; Centered, constrained container keeps the page from splatting across a full-width browser; Home page loads within 5 seconds on 3G mobile device; The Content as described below contained to max 800px width; Valid CSS and HTML, Strict XHTML for noobs with exceptions for CSS3/HTML5 elements that work cross-browser but won't validate; must clearly demo Semantic Markup on all pages, especially on the page with 12+ paragraphs; Must be compliant with Section 508 and include a brief description of Section 508, Semantic Markup, and SEO; Optionally, make it 'mobile first', the next programming project will be...

(11/24) Some 'current stuff' links have been moved down the page to the 'Topics & Class Meetings'.

..

(11/20) Get a 'wireframe' sketch of your first web page approved by the instructor and plan to get it to the web.

(11/20) Due Wednesday the 3rd: A valid, Strict XHTML page introducing your approved topic, styled with External CSS, having no local style elements, containing an (awesome) JavaScript effect you find or write, and graphics. (5 Points) Due the following Wednesday the 10th: A 3-page Website that demos consistent multi-column styling and navigation and meets other specs -- one page must have at least several paragraphs (10+) and be a very clear demo of Semantic Markup. Check out '960 Grid' or other multi-column layout schemes. (10 Points) Students from eBusiness Tech may use HTML5 for these pages and should be working to make 'responsive' sites that work equally well on smartphones, tablets, and full-sized browsers. (Beware that iOS doesn't register a touch as a hover for dynamic CSS effects, needs a JavaScript event handler!)

(10/24) For next Wednesday's Stat Pack Delivery: Put all your calculations in one script, if they are not that way already: Mean, Std. Deviation, Median, Max & Min Values, Discretize to Deciles, Mode, and Histogram. Install a 'timer' to calculate how long it takes to read a file and calculate all the stats including the histogram. To make the timer, place a statement like '$StartTime = microtime(true);' just before your fopen statement, and '$EndTime = microtime(true) just after the histogram is displayed. Calculate duration like this: '$Duration = $EndTime - $StartTime; echo "Duration: $Duration";'. Run your script on some of the larger files like 1500SATishNormalish.nbrs, 4000RandomishSAT.nbrs, 8000.nbrs, and 16000.nbrs.

For the Structured Notation: Show the whole algorithm from beginning to end on the cover page, referring to details 'exploded' on other pages (preferably _not_ the back of the cover page); Make the notation very clear, consistently shaping alternative selections and loops, showing how counters and accumulators are handled and how loops are controlled.

(10/22) Things to avoid -- things to do instead: Don't use a series of variables like Variable1, Variable2, Variable3... -- Instead, use subscripts like Variable[Q]. Don't use functions just to be using functions -- Functions are useful for sections of code that would be repeated without them but it makes no sense and complicates things to put one or two lines of code in a function that is only called once. Avoid locking your script into one 'quantile' by hard-coding quartiles -- Instead, make it flexible so that the script can easily accomodate quartiles, quintiles, or deciles. Don't throw away results of a calculation that will be needed later -- Instead, consider the 'final output' and save intermediate results that help produce them.

(10/20) The page with Sketches of Algorithms has been updated to include a workable sketch for 'calc mode' (discretizes into quantiles first) and 'histogram from quantiles'. Scripts are in /home/gschool/bin to demo: DescribeNbrs.php calculates statistics for .nbrs files, CalcMode.php discretizes data into quantiles.

(10/20) Due Friday the 10th (10 points): Demo incomplete stats app with .nbrs files calculating min, max, mean, sort, and median + clearly structured notation for what's been done. Due Friday the 17th (10 points): Complete stats package + clearly structured notation for all components. Due Friday the 24th Wednesday the 29th (10 points): Mode and Histogram for data in .nbrs files and clearly structured notation for the stat package showing whole algorithm on front page and exploding details to other pages as needed.

(10/3) Mr Benos, and others, check this out: Mode (Statistics), which states right clearly: "In order to estimate the mode, the usual practice is to discretize the data by assigning frequency values to intervals of equal distance, as for making a histogram, effectively replacing the values by the midpoints of the intervals they are assigned to."

(9/17) Due Dates: Edit and make a program like Hello World executable: 9/17; Count One File: 9/19; Parts B and C: 9/24; Quiz on IT Infrastructure and Programming: 9/26.

(9/15) Use Ctrl-C to stop a runaway process! The counter/averager series of scripts can get into an 'infinite loop' and Ctrl-C will usually stop it. You can also 'X out' of a putty or terminal window, but that's not usually required.

(9/15) I'm sorry to relate that the current link for 'Logging Into info250.info' led to an exercise in web development instead of this semester's exercises at the command line. It's been patched...

(9/12) Logging in and Working at INFO250.info

Preparatory to 'programming for the web' are exercises for using the vi editor, editing a script for the 'command line' & making it executable, an introduction to 'structure', and a couple scripts for reading data from files & getting simple input from a user. HTML and CSS will be introduced after these preparatory exercises under 'Lab Work' below...

The first deliverable is 5 points for making a 'crafted by' or 'hello world' script run from the command line.

The next deliverable will be to demonstrate some prowess with vi, details will be posted soon...


Prior Topics:

We'll be using PHP as the first language, followed by JavaScript, then your choice of another language next semester: Java, C++, Python, Perl, &?, &?...

(9/5) 'Programming Languages' don't exist in a vacuum, business doesn't run on PCs.  This class was a discussion of the environment today, effect of FOSS on proprietary OS & languages, and other truths contained in The Software Wars; Kinds of Software; *IX History; Language History. Microsoft's Windoze is the only OS with a simple history -- all built within their edifice.

Intro to IT Infrastructure:

(9/6) Historical View of IT Infrastructure.

Lab Work: Introduction to Programming at the command line:

(9/12) Errata: Use vi for the editor, ignore the other options for the time-being. At the top of php scripts, after the #!, the escape into php must be '<?php', not just '<?'

Data Structures and Algorithms

(9/17) The first programming exercises involve a few 'data structures' and the programs introduce 'algorithms' using at least one of each of the 'logical structures'.

The *.nbrs files are examples of 'sequential files with variable length records'. These records are all only one 'field', which may be a number or some trash data. The data are encoded in ASCII, and as each record is read it is read into a string which may be numeric or not. Records are separated by a CrLf, 'Carriage Return + Line Feed' or a Lf alone (ASCII chars 13 and 10). The EOF-End of File is marked with an ASCII char 04, Ctrl-D on the keyboard. When a sequential file is opened, a 'pointer' is at the beginning of the first record in the file. Each 'Read Line' command reads a record from the file into a variable and moves the pointer to the beginning of the next record. When the pointer is sitting at the EOF mark EOF is true. If an 'empty file' is opened the pointer sits on the EOD before any Read Line happens.

The programs introduces common program data structures and data types: Variables hold integers, real numbers, and strings; Arrays hold a collection of variables; The file name is a 'literal' moved into a variable; A 'directory' is opened and read; PHP's 'Hashed Arrays' and directories may be referenced sequentially using foreach; Arrays may also be referenced individually using a numeric subscript or by 'Key'. Logical and arithmetic operators are introduced: != is Not Equal; == is Equal; = means Assign the value on the right to the Variable on the left; += adds a numeric value to an 'Accumulator'; ++ Increments a numeric 'Counter'; a 'class check' is used to see if records read are numeric or not.

The logical structures, or 'control structures' introduced are the While loop and an If/Then/Else alternative selection, and and a couple of short Sequences.

The algorithm to process a sequential file is usually like this, represented in pseudocode indented to show logical structures:

Define the File's FileName
Initialize Counters and Accumulators to Zero: ValidRecordCount, InvalidRecordCount, SumValidRecords
Open the file at FileName
While Not EOF
  Read ARecord
  If ARecord appears valid:
    Increment ValidRecordCount
    Accumulate ARecord in SumValidRecords
  Else
    Increment InvalidRecordCount
Average <- SumValidRecords / ValidRecordCount
Echo Average, ValidRecordCount, InvalidRecordCount

(9/29) Describing Data - Central Tendency:

This 20-point project will be scored on October 10th. The score will be based on: degree of completion; clarity of structured notation; clarity of code; and accuracy of calculations.

Several descriptive and inferential statistical techniques depend on calculations for 'central tendency' and 'standard deviation'. This assignment asks each student to make exceedingly clear structured notation and code for a 'system to report central tendency'. For any file, calculate these values: Number of 'good data elements'; Minimum and Maximum values; Mean/Average of the set; Standard Deviation; Mode; and Median. Calculation of Standard Deviation requires 'two passes' of the data -- one to calculate the mean and the next to calculate the deviations. Calculating the Median requires sorting the data. Calculating the Mode requires grouping the data into 'iles' - 'Percentiles' divide the data into 100 groups, 'Deciles' into 10 groups, 'Quartiles' into 4 groups - the Mode is the midpoint of the group with the highest count.

Here are Sketches of some algorithms, may contain errors, watch out!  Please note the method used to 'show the whole thing on one page' and 'explode the details on other pages'.

Sorting Algorithm Runoff

Due 10/24 for 20 points: Teams of two investigate other sorting algorithms using PHP or other favorite language. Sorts used: Quick Sort; Radix Sort; Merge Sort; and three variations on Pocket Sorts; loading a table in MySQL and using SQL; 'Huge Sort' to handle files too large to fit into an array given the limits of RAM at info250.info.

Points will be awarded for clarity of structured notation and code, and accuracy. Teams with the quickest sort in each category will get bonus points.

Machine Languages, Compute Cycles

The text addresses this concept in the figures starting at 2.6.  Sit with these pages for a while and figure out concepts like: clock, instruction counter, fetch, instruction time, execution time, copying data from memory to registers & the other way, accumulator.  The text doesn't mention 'wait state', but that's a good one to add on.

The Little Man Computer

This is an exercise we'll do in class as another approach to answering 'how does a CPU work?' It assumes there's a 'little man' in the computer that does what the ICU and ALU do. There is a simple set of 11 instructions for the little man to follow.

This example follows one in Englander: The Architecture of Computer Hardware and Systems Software, which was the prior text used for this course. It has been adapted by Nottingham University and put on-line as a pdf.

This is a jpg we'll use in class to run thru a couple of LMC programs. RAM is at the right, using a two-digit address to reference 100 memory locations from 0 thru 99. Before the Start Button is pushed to get the Little Man's attention, a program is loaded as 'program data' starting at address 0. RAM can also hold 'plain data' after the program, it being the programmer's responsibility to keep program instructions from being overwritten by data.

The Instruction Counter is a special register that holds the address of the next instruction to fetch. When the Start button is pushed the, it drops 0 into the first Instruction Cycle just before a bell rings to signal the Little Man to start his Instruction Cycles.

The 'Register' is a general purpose register used to hold temporary values. The LMC can only do arithmetic on data while they're in the register, so complex calculations, like an average, will need to shuffle data in & out of the register.

An InBox and OutBox are used for inputting data, up to three digits, and for displaying results as output.

The instruction set is built in the computer where the Little Man can reference it easily. Some instructions have two parts: the 'Op Code' and an 'Operand'. In the LMC, instructions 1 thru 8 use the last two 'bytes' of a three 'byte' word to reference a memory address. So, '311' means 'Write register contents to memory location 11'.

The instructor or some volunteer from the class plays the part of the Little Man, who has a lot more to do than the little man in the refrigerator. LM has been trained to follow this Instruction Cycle:

The User of the LMC writes the program into RAM, starting at 0, then presses the start button, setting a 0 in the instruction counter and LM to work...

Here's a program that inputs two numbers and displays the difference between them.  We'll run this in class and work on a more complex program:

901
311
901
211
902
000

The assignment following it is to sit with a LMC for a while and work out a couple of other programs, maybe even something that does branches and loops.

'Generations of Programming Languages' 1 thru 4 needs to be added here...

Development Environment for Web Work

(11/19) Pick an editor: It _must_ do syntax highlighting and it _must not_ be an 'HTML Editor' like DreamWeaver or Seamonkey. vi works fine if you like it, does syntax highlighting and is quickest if you have good bandwidth. It might be time to learn emacs, which is the ultimate geekish server-side editor and is on most *ix servers. Windoze users might like NotePad++, Crimson, or Sublime where you edit on the desktop and use FileZilla to transfer files to the server via sftp (NotePad++ will automate this step if you edit its settings). Mac users should check out CodeWrangler, which handles the publishing of files to the server automagically via sftp and also has vertical marks that help align structures in html or scripts.

It's imperative to keep an eye on the error_log to make sure your html and/or scripts are not producing warnings or errors! Keep a terminal window open that's 'tailing the log' with:

tail -f /var/log/httpd/error_log | grep yourid

Keep this peeking out from under your browser so you can see it jump when you get an error!

Database programming for the web is an inherently complex task involving multiple skills, data structures, and programming languages. Careful attention to error messages from the server and browser is required. The database needs to be quickly available to test SQL statements used in the scripts, to see the effect SQL in the scripts has on the database, and to delete trashed records or make changes to the schema.

The more a programmer can _see_ of these rather abstract components as they work, the easier the work becomes. One way to keep the components visible is to have two three putty sessions running. If programming for the web a FireFox or Chrome browser with a View Source and Tools -> Error Console available:

Here is a link to a screenshot showing such an arrangement of putty sessions and browser:

Screenshot

An 'IDE' (Integrated Development Environment) such as the Open Source Eclipse, IBM's WebSphere (which relies heavily on Eclipse), or Microsoft's Visual Studio (which Looks a lot like Eclipse) provides all these 'views' within a single window. And some, like Visual Studio, allow drag/drop convenience for combining database objects with progamming objects with minimum scripting involved. The proprietary Zend Studio is a powerful (not-cheap) IDE that provides 4GL power to 3GL PHP and SQL languages.

Introduction to XHTML, CSS, and JavaScript

(11/19) So far, we've been working with PHP at the command line to develop skills with structured programming, sequential data structures, arrays, and other arcane programming skills. Next, we're on to HTML, CSS, and Database and will begin using PHP for 'database programming for the web'.

(11/19) Use W3 Schools tutorials to start learning HTML, CSS, and JavaScript. Show me a score 90% or better for each tute, will be worth 5 points each, due by Monday the 24th. Then, get the subject for your website approved and put up a single page that validates. Noobs to web work are asked to work on introductory sites for desktop browsers. Advanced students must be working to make 'responsive' sites that work equally well with full-size or mobile browsers.

(11/19) Make sure to meet The Specs here whether you're advanced or not: Specs for HTML and CSS Projects.

(11/19) Validate at HTML and CSS with W3 Schools Validator, or use W3C Markup Validator and W3C CSS Validator. All errors and warnings must be eliminated, except for advice that HTML5 is experimental.

Requirements for Projects with XHTML, CSS, and JavaScript

(11/24) Your project must meet The Specs for HTML and CSS on the links below. Some first efforts look like they're done by students not aware of the specifications. Please comply with the specs sooner than later.

(11/24) 'Semantic Markup' describes what it takes to make web pages accessible for visually handicapped (Section 508), Search Engines, and as a side-effect, it makes sites clear for sighted people, too. Modern XHTML provided the <h1> thru <h6>, p, ul or ol and li, em, and strong tags which are adequate to describe the semantics of a web page. All browsers since IE9 render valid XHTML the way the designer intended it to be seen, they all render invalid HTML differently, in 'quirks mode'...

All old style tags and local formatting for HTML4 are abandoned in XHTML and HTML5, like: font, center, b for bold, i for italic, bgcolor, and other directly applied formatting. W3Schools has examples that use deprecated techniques, so please recongnized them as examples of how not to style websites these days...

Using semantic markup appropriately makes it very easy for search engines to direct their users' 'organic searches' to your page without incurring costs, and it is fundamental to 'SEO'. And, semantic markup makes the content very easily accessible by visually handicapped people. Everything we do to make sites accessible for blind people and search engines improves the experience for ordinary, sighted people, too.

The only markup in 'content' should by semantic. Use semantic markup to outline the _meaning_ of each element of the content. Add external CSS to impress visual appeal onto the contents of your site, choosing elements of ids and classes carefully to help sighted people see the structure of the page.

HTML5 and CSS3 add several new elements of semantic markup for html that clearly outline today's very complex pages for blind people, sighted people, and search engines. These higher-level tags are important for the architecture of more complex web pages, can accurately denote the meaning of each element of a site like nytimes.com, reddit, or ebay. The most used are: nav, section, article, header, footer, aside, and summary.

Web Design Guidelines and Tutorials

(11/21) Consider guidelines for style to get a really pro look: Google Web Fundamentals gives best practices for multi-device web experiences. Also, W3Schools, is regularly trashed by web developers, W3Fools, but it's quick and free. Consider others like codecademy.com to move on to pro-level skills. If you find other free resources please let me know what you like.

(1/8) Programming a LAMP Stack

'LAMP' is prevalent in job listings, stands for Linux/Apache/MySQL/PHP. A couple of other popular Ps are the modern Python and the ancient Perl. The instructor can help with PHP and asks those with no prior experience at database programming for the web to use PHP. Anybody who has already had PHP is encouraged to use these next deliverables as their first assignment with 'the third' programming language.

These next few classes are an intro to this environment, starting with the M-MySQL.  

Class exercise:

Make A&A work for Your Website

Advanced students are welcome to write their own multi-factor, manager-approved, AAA process in lieu of the first deliverables for the 'Database Programming for the Web'.

(5/5) After some detailed analysis of and attacks on AnOrg0 and gschool it's time to add 'authentication and authorization' to your web pages at info250.info, and to start logging the activity at your site.

Replace your home page at info250.biz with an index.html that leads to your login process, link, hamburger or otherwise, at the far upper-right corner as is standard. If you want to preserve any or all of your old website, place a link like 'Old Website' on the page. Plan to make your Database Programming for the Web project Mobile Friendly, adaptive, or responsive.

Use Advanced Stuff to create an acceptable 'Users' or 'Ids' table and use it to authenticate and authorize 'ordinary users', 'restricted users', and 'managers' of your site.   Watch this spot for more: techniques for database abstraction & UI using PHP & browser interface; essentials of CRUD; transaction logging; &c; &c...

Provide detailed structured design notation for three scripts: 1) A 'Log In' script to authenticate users of your site with reference to a userid and password stored in a table in your database and set up Session data for them. * The user gets three attempts at login and is directed to an inconvenient place after a third failed attempt 2) A script to 'Protect a Page' so that it is only accessible to a person 'Logged In' to your website with appropriate Session data. If someone attempts access to the Protected Page without appropriate authorization or POST data a location header should direct them to the Log In page. 3) A script like LogIt.php to log errors and activity.

Deliverable #4:

Will be to define your project site and equip it with models and views so the 'back office' can manage your project's hussle, blogs, or whatever's legal and polite. At a minimum this needs completing your Users/Ids table, adding a Log table, and a whatever table will hold your Goods&Services, blog entries, and a model with views to set up the product list. Logging and reporting all access and views at your site is also part of Dlv #4...

Be thinking about your 'Third Programming Language'.

Java's a good choice for anybody who want to enter a programming competition. Ruby on Rails is cool and Mr Kunkel has loaded the class' server with it. Blender 3D and Python is my favorite to see, tutorials provided by the Blender community introduce object and character animation, a very nice physics engine, and an easy interface with Python to script scenes or games.

We're into the 'database programming for the web' objective, adding SQL to the quiver of skills needed for IS & IT pros. Programming architecture and languages covered so far are _structured_ scripting with PHP at the command line, browser side scripting with the HTML DOM & _Object Oriented_ programming with JavaScript and the jQuery/jQueryUI libraries. The course detoured from programming languages to cover the web's essential _Markup_ Languages, HTML/XHTML & CSS, which are needed to accomplish one the courses prime objectives, 'database programming for the web'.

The next new programming languages are 'server side', able to reference any of several resources on a web server such as the DBMS, File System, Mail Servers, Session Data, and pretty much any web service anywhere on any network. SQL is the most used database programming language, can do data definition & manipulation (CRUD), and handle replication and transaction logging on another server or in a cloud. PHP is maybe, still, the most used programming language for webwork, gets a 300K + bump from WordPress alone, and there are 100s of K more in use for BB, shopping carts, and other web-facing services. This encounter with PHP is not to run scripts at the command line, it is to run them as the 'server side' component of dynamic websites.



Under here needs organizing for 2012

Exam Study Questions

Questions from earlier quizzes will appear on the Exam, too.

Database Programming for The Web: PHP, MySQL, JavaScript

End of semester Projects, Recast

Other Language, other Project:

Sketch of AnOrg's Directory: Page 1 | Page 2 | Page 3

Usability Trials

(5/4) What a pleasure it is to see some enthusiastic responses to the 'usability tests' for the intranet at hand. While several in the class were kicked back or playing games and useless, Mssrs Aldridge and George and the Freshman Team led the class in this exercise, have enthusiastically and methodically checked out the classic weaknesses, generating dozens and dozens of email notices to the Site Manager in the process. They have identified, wreaked havoc with, and helped to solve SQL, HTML, and CSS injection exploits known to all who would deface a Web2 site, and have warded off a couple other dreadful exploits, like JavaScript injections.

These Fresh Persons have trounced the other teams and deserve a gold star: Gold Star

Other teams have been useful, have figured out the clumbsy UI and put together sham organizations, and have identified lots of other usability issues, and the Instructor is most appreciative. This code and database will be made 'portable' and turned over to the teams right soon...

Here are the usability issues the class has turned up, list still being edited as at May 4:

More SQL, beyond Select

Individual Project Assigned 3/16, 10 points, due Friday 3/25:

(11/7) Here are specs and advice for the HTML, CSS, Graphics, and JavaScript. Project #1, One Valid Page is due November 14. Project #2, Three Pages to Specs is due November 28th.

(11/12) Important stuff about Separating Style from Content.

Individual Project Assigned 2/18, for 15 points, due Wednesday the 2nd of March:

Here is a link to Discussion of the Sample Scripts. Use this for explanation of the PHP language features. Use the docs at us2.php.net for more details about each PHP language element.

Current Stuff as at Feb 10, 2011


Past Stuff:

(1/19) Team exercise to finish the Stat Pack! Accommodate MySQL data sources. See /home/gschool/DatabaseAvg.php for an example of a command-line interface to choose the table and column to use for descriptive stats. Plan to present pristine structured notation for your team's application.

DBMS (Queries) Study Questions

Exam Study Questions


(11/5) Recent and past events necessitate a formal policy for students in INFO250. Please read & heed these rules. Sign your copy and give it to the instructor.

as offered at Maggie Walker Governor's School 2008 -- 2009

Old Topics, starting 9/3/08:


Network Admins: arp may answer questions? Get the thing backed up!

Next Points, assigned 2/27, for advanced DBMS Project, to gather data for statistical analysis:

SQL Data Types & Keys: (2/27) Examine the SQL Scripts at /home/gschool, create tables, drop tables, insert records, &c, &c..


Last chance for Last Points, assigned 2/2, for Intro Exercise about reporting on data at SeSPoP. Demo the following on or before Thursday 2/12 for max 15 points:


1/14:  'LAMP' is prevalent in job listings, stands for Linux/Apache/MySQL/PHP-Perl-Python.  These next few classes are an intro to this environment.  


Web Languages: H TML, XHTML, CSS, JavaScript, MySQL, & PHP starting 12/1, updated 12/10 with requirements, 12/12 to add some links that might be helpful...

XHTML/CSS project due 1/7, scored with this rubric

Quiz #1 January 12th - Study Questions


 

Instructor: Gerald Saunders

Everything else needs to be entirely revamped to fit 'Programming Languages' for 2008

Course Description:

The course provides an introduction to the several technologies involved in today's web and eBusiness.  Components of today's networks & systems are presented and discussed from an historical perspective, and basic skills in the technologies supporting eBusiness are developed. 

Students learn about current hardware, software, & networking technologies;  HTML; structured programming using PHP; relational database using MySQL; Accounting; and Object-oriented programming using Javascript. 

Tools for system analysis & design are introduced and used in exercises to develop requirements for case studies and make designs for systems to meet the requirements.  Students are introduced to structured and object-oriented analysis and design techniques using the Unified Modeling Language, Unified Process, & Project Management concepts & tools.  

Textbook:

Internet & World Wide Web -- How to Program; Deitel, Deitel, & Goldberg; Prentice Hall; 2004 

Objectives:  To develop basic skills in the several technologies of eBusiness, introduce system design and project management tools.

  1. Survey the range of computer platforms involved in eBusiness, considering hardware and operating systems likely to be encountered in today's systems.
  2. Learn to build a web server, deploy it securely, and use it. 
  3. Gain experience with the Linux command line environment.
  4. Learn to write html, including cascading style sheets for those students most interested in \91web design\92.
  5. Learn to design and write well-structured programs, with exercises involving common data structures and delivery of active content.
  6. Gain intermediate skills in relational database.
  7. Students interested most in \91programming\92 will gain experience in supplying \91database driven\92 web content and working with web forms to provide user interface.
  8. Learn financial accounting applicable to eBusiness.
  9. Gain introductory skills with system design and project management tools

 

Major Topics:

 

  1. Survey of current hardware/software platforms and emerging technologies.
  2. Building and securing a Linux web server.
  3. Basic networking concepts: equipment, network media, addressing
  4. Basic operating system concepts
  5. Web design: Graphics for the web, and HTML
  6. Logging into a Linux server and working at the command line
  7. Introduction to structured programming logic
  8. Introduction to structured programming with PHP
  9. Introduction to relational database using MySQL
  10. Cascading Style Sheets
  11. Database programming with PHP & MySQL & web forms.
  12. Object-oriented programming with Javascript
  13. Accounting concepts for programmers
  14. System architecture & design tools: Visio, the UML & Unified Process, and MS Project

 

Classroom Expectations:

 

The classroom is a tiered computer lab with a networked computer for each student.  The instructor\92s system at the lectern is connected to a hi-resolution projector.  Visualize is available so that work on any student's monitor may be displayed on all monitors, or projected for all to see.

 

Materials Needed:

 

All the \91open source\92 software is available for free.  The instructor will provide an internet-accessible server where students will make their websites.  The Microsoft Academic Alliance provides other software for free download, and of this suite we will be using Visio and MSProject. 

 

Students who are especially interested in pursuing information systems and want to gain more experience are encouraged to build and deploy servers/firewalls on their networks at home so that they will gain valuable experience in networking and security by \91watching their logs\92 and administering their own server on the internet.

The Exam

Click Exam to see The Exam...