Web
Programming

Fall 2012
course
navigation

Nov 1

aside

udacity web development on Google's App Engine

old homework

sqlsoup answers to this week's homework - and a bit of raw SQL answers - and more practice questions for those who want 'em :
SELECT MAX(shipments) as shipments, name FROM ( SELECT COUNT(1) AS shipments, e.name AS name FROM Employee AS e INNER JOIN Shipment as s ON e.employee_id = s.manager_id GROUP BY e.employee_id );
Last time we talked about embedded SELECT, and had some discussion of whether or not SQL was a programming language. Well:
sqlite> SELECT x*y FROM ((SELECT 2+3 as x), (SELECT 5+3 as y)); 40
or if you like, an entire program :
--- The question is ... --- Is SQL a programming language? --- Well, can you translate this into Python code ? DROP TABLE IF EXISTS Stuff; CREATE TABLE Stuff (name TEXT PRIMARY KEY, value TEXT); INSERT INTO Stuff VALUES('a', ""); INSERT INTO Stuff VALUES('b', ""); UPDATE Stuff SET value="test" WHERE name="a"; UPDATE Stuff SET value = ( SELECT (CASE WHEN x > 4 THEN "yes" ELSE "no" END) FROM (SELECT z+y AS x FROM ((SELECT 9/3 AS y), (SELECT 4 AS z)))) WHERE name="b"; -- Returns collection ("test", "yes") SELECT value FROM Stuff WHERE name IN ("a", "b");
NOW we're having fun.

Most of you had trouble with the RESTful assignment.
So let's discuss :
Is cs.marlboro.edu RESTful?
Here's the wikipedia API : http://en.wikipedia.org/w/api.php . Is it (or the regular web interace) RESTful ?
Here's a few other APIs :
Do any of them look RESTful ?

new homework

... is posted

more PHP + MySQL

Here's a slightly more complex example to give a somewhat larger taste of PHP before we look closer at mysql: http://csmarlboro.org/sam/story_game/. (The source can be viewed at http://csmarlboro.org/sam/story_game/_index.html and http://csmarlboro.org/sam/story_game/functions.html)
Here's a small example of using PHP with the PEAR database module: http://csmarlboro.org/sam/php/
In class we'll go through the process of installing and setting up a WordPress blog. Including some basic customizations.

Links

http://cs.marlboro.edu/ courses/ fall2012/web/ notes/ Nov_1
last modified Thursday November 1 2012 11:45 am EDT