Documente Academic
Documente Profesional
Documente Cultură
127.0.0.1 project0
8ecall LhaL sudo execuLes a command as Lhe super-user (."!", root), whlch ls necessary ln Lhls
case, slnce /etc/hosts ls only wrlLeable by root. 1he llne you [usL added ensures LhaL
project0 wlll resolve" (as vla unS) Lo 127.0.0.1, whlch ls Lhe appllance's loopback address."
(
( nexL, conflrm LhaL you have a dlrecLory called vhosts ln your (well, !ohn Parvard's) home
dlrecLory. 1hen creaLe a project0 dlrecLory wlLhln vhosts. 1hen creaLe an html dlrecLory
wlLhln project0. 1hen chmod all Lhree, plus your home dlrecLory, 711.
lf curlous as Lo why all Lhls works, Lake a peek aL /etc/httpd/conf.d/appliance50.conf.
1haL flle maps all of Lhe appllance's vlrLual hosLs Lo /home/jharvard/vhosts/ so LhaL creaLlng
a new vlrLual hosL called, say, foo lnslde Lhe appllance ls as easy as creaLlng
/home/jharvard/vhosts/foo/ and /home/jharvard/vhosts/foo/html/ and edlLlng
/etc/hosts so LhaL foo resolves Lo Lhe 127.0.0.1.
?ou can also access Lhe appllance's vlrLual hosLs from a browser on your own compuLer lf you'd llke, buL you'll flrsL need Lo
edlL /etc/hosts (lf runnlng Mac CS or Llnux) or C:\Windows\system32\drivers\etc\hosts (lf runnlng Wlndows) on your
own compuLer slmllarly. !usL be sure Lo replace 127.0.0.1 wlLh Lhe appllance's l address, whlch ls dlsplayed aL all Llmes ln
Lhe appllance's boLLom-rlghL corner. 1o edlL Lhese flles wlLh a LexL edlLor, you'll llkely need Lo lnvoke sudo (lf runnlng Mac CS
or Llnux) or =<9(-3(567+93'"-'#" (lf runnlng Wlndows).
**
lf you already have an exlsLlng accounL, you're welcome Lo use LhaL for Lhe course. ?ou can apply Lo have lL upgraded Lo an
unllmlLed sLudenL plan aL http://www.atlassian.com/software/views/bitbucket-academic-license.jsp.
CompuLer Sclence S-73: 8ulldlng uynamlc WebslLes
Parvard Summer School
Summer 2012
3 < 9
! Cpen a Lermlnal lnslde Lhe appllance or SSP Lo lL from your compuLer. 1hen execuLe Lhe followlng
command Lo generaLe an SSP key palr (one publlc key, one prlvaLe key):
ssh-keygen
PlL LnLer aL each of Lhe prompLs LhaL appears (unless you'd prefer Lo secure Lhe prlvaLe key wlLh a
keyphrase). lf you Lhen execuLe
ls ~/.ssh/
you should see LhaL you now have (among oLhers) flles called id_rsa (your prlvaLe key) and
id_rsa.pub (your publlc key). LxecuLe
geany ~/.ssh/id_rsa.pub
Lhen hlghllghL and copy Lhe conLenLs of LhaL flle (whlch happens Lo be your publlc key). vlslL
https://bitbucket.org/account/ and pasLe Lhe key lnLo Lhe LexL fleld below NN8(E%:3, Lhen
cllck 566(E%:.
! now leL's push an lnlLlal commlL Lo your reposlLory. Agaln ln a Lermlnal wlndow wlLhln Lhe
appllance, execuLe Lhese commands, where Alice ls your own name and alice@example.com
ls your own emall address:
cd ~/vhosts/project0/
git config --global user.name "Alice"
git config --global user.email "alice@example.com"
git init
git add --all
git commit -m "Initial commit"
1hen execuLe Lhe below Lo add a remoLe" for your 8lLbuckeL repo, where alice ls your own
8lLbuckeL username:
git remote add origin git@bitbucket.org:alice/project0.git
(
now push your code Lo LhaL remoLe:
git push -u origin master
lf you vlslL https://bitbucket.org/alice/project0/src, where alice ls your 8lLbuckeL
username, you should see Lhe code you [usL pushed.
(
CompuLer Sclence S-73: 8ulldlng uynamlc WebslLes
Parvard Summer School
Summer 2012
6 < 9
! PenceforLh, anyLlme you make changes Lo code LhaL you'd llke Lrack ln verslon conLrol, execuLe
Lhe below (or slmllar, lf more experlenced wlLh git) lnslde of ~/vhosts/project0/:
git add --all
git commit -m "a description of the changes you've made"
git push
;%2+&+#<3(O./4(
! !usL Lhe oLher day, whlle walLlng ln llne for lunch aL your favorlLe plzza place, you were golng on
and on (as you ofLen do) wlLh a frlend abouL how you're Laklng some course on bulldlng dynamlc
webslLes. Maybe you should make Lhls place a webslLe so LhaL we don'L have Lo sLand ln llne
anymore," your frlend lnLerrupLed, wlLh [usL a hlnL of sarcasm. 1hen we could order onllne."
Pmmm," you replled, mlsslng Lhe sarcasm. 1haL ls a fanLasLlc ldea!"
And so was born your ro[ecL 0. ?our mlsslon for Lhls pro[ecL ls Lo lmplemenL a webslLe LhaL
allows cusLomers Lo place orders onllne!
lncluded aL Lhls documenL's end ls a menu from a local haunL called 1hree Aces (who, sadly, has
gone ouL of buslness, buL leL's preLend Lhey're sLlll wlLh us). 1urns ouL Lhey sell more Lhan [usL
plzza. ln facL, Lhey offer Len dlfferenL caLegorles" of food: !+,,-3, NI%&+-2':( !+,,-3, NI%&+-2(
;+99%"3, N+6%( C"6%"3, N-2-63, NI->B%''+( #"( P+'+, 8#7%( 7-6%( /-3->9-( =-K+#2+( #"( .-9+&#''+,
8#7%7-6%(A-2,#9%3, L"-I3, and 1"+96%"3. Some lLems only came ln one slze, buL oLhers clearly
come ln boLh small and large slzes, aL dlfferenL prlces no less.
?our flrsL challenge ls Lo come up wlLh a daLa model for Lhls menu. ?ou LhoughL abouL uslng a
daLabase, buL LhaL feels llke overklll, slnce you'd Lhen also need Lo lmplemenL an lnLerface wlLh
whlch Lhe folks aL 1hree Aces could updaLe Lhe menu. AfLer all, you don'L wanL a phone call every
Llme Lhey wanL Lo ralse prlces! lus, Lhe goal here ls Lo save Llme. An xML flle, Lhen, feels llke Lhe
rlghL cholce for Lhls menu, your slLe wlll slmply read lLems from lL. 1haL way, Loo, Lhe folks aL
1hree Aces can preLLy easlly updaLe Lhelr own menu Lhemselves wlLh any old LexL edlLor. Cf
course, Lhey'll have Lo keep Lhe xML well-formed, buL LhaL seems a reasonable prlce Lo pay for an
oLherwlse free webslLe!
Spend some Llme Lhlnklng abouL how besL Lo represenL Lhls menu as xML, keeplng Lhese goals ln
mlnd:
! lL musL be easy for someone less Lechnlcal Lhan you Lo make changes Lo Lhe menu. 1he xML
should be sLralghLforward Lo read and alLer.
! ?ou musL somehow keep Lrack of each lLem's caLegory, name, prlce(s), slze(s), and
descrlpLlon, lf any.
If you omit the -m flag when committing, git will prompt you for a commit message with nano. Once youve
provided said message, you can save and quit nano with ctl-x, y, then Enter.
CompuLer Sclence S-73: 8ulldlng uynamlc WebslLes
Parvard Summer School
Summer 2012
7 < 9
! ?ou should avold dupllcaLlon of daLa. !usL because 1hree Aces sells 1omaLo & Cheese plzzas
ln Lwo slzes, LhaL doesn'L mean 1omaLo & Cheese" needs Lo appear Lwlce ln your flle!
! ?our model should be exLenslble. lf 1hree Aces evenLually decldes Lo sell medlum plzzas,
Lhey shouldn'L need Lo call you!
8efore decldlng on a model, Lhough, besL Lo read on so LhaL you know how your xML wlll be used.
1he overall deslgn and aesLheLlcs of Lhls slLe are ulLlmaLely up Lo you, buL we requlre LhaL your slLe
meeL some requlremenLs.
( F%-'<"%(=%Q<+"%7%9'3(
! ?our slLe musL noL dlsplay 1hree Aces's menu on one huge page buL, raLher, allow
cusLomers Lo browse Lhe menu by caLegory. lL ls flne Lo dlsplay mulLlple (buL noL all)
caLegorles per page. NI->B%''+( #"( P+'+ and 8#7%( 7-6%( /-3->9-( =-K+#2+( #"( .-9+&#''+, for
lnsLance, sound llke Lhey belong on Lhe same page.
! ?ou need noL converL 1hree Aces's enLlre menu Lo xML, lesL Ledlum Lake Lhe fun ouL of
deslgn, Lhree lLems per caLegory sufflce, so long as Lhose Lrlples make clear your overall
deslgn. Powever, we suspecL you'll en[oy your slLe more lf you lnpuL more Lhan Lhree lLems
per caLegory!
! CusLomers musL be able Lo add lLems Lo a shopplng carL" whose conLenLs perslsL unLll Lhe
cusLomers check ouL or close Lhelr browsers. CusLomers musL also be able Lo updaLe
quanLlLles and remove lLems ouLrlghL (wlLhouL, !"#", havlng Lo change some lLem's quanLlLy
Lo 0).
! When cusLomers follow some llnk Lo check ouL, Lhey musL be lnformed of Lhelr order's LoLal
cosL and Lhanked for Lhelr order.
! ?our slLe should perform rlgorous error-checklng. under no clrcumsLances should we be
able Lo crash your slLe or lnduce unreasonable behavlor. LeLLlng us lnpuL negaLlve
quanLlLles so LhaL 1hree Aces owes 1, money ls noL, shall we say, reasonable. We wlll bang
on your code and Lry Lo flnd faulLs, do noL leL us succeed.
R%&B9+&-2(=%Q<+"%7%9'3(
! ?ou're welcome Lo develop your slLe on any compuLer uslng any luL or LexL edlLor, even
wlLhouL uslng Lhe CS30 Appllance, buL you musL ulLlmaLely ensure LhaL lL works wlLhln Lhe
CS30 Appllance aL a u8L of http://project0/ when lnsLalled ln
/home/jharvard/vhosts/project0/.
! Cnly flles LhaL should be web-accesslble should llve ln project0/html/, everyLhlng else
should llve ln project0/ or some (oLher) subdlrecLory Lhereln.
! ?our markup language should be valld (or LenLaLlvely" valld) P1ML3, as per
http://validator.w3.org/, unless some feaLure of your slLe requlres oLherwlse (for
Lhe sake of some browser), explaln ln P1ML commenLs any lnLenLlonal lnvalldlLles. ?our
P1ML should also be as preLLy-prlnLed as posslble. ?our CSS need noL be valld.
! ?our P musL be exLenslvely commenLed and be as preLLy-prlnLed as posslble.
CompuLer Sclence S-73: 8ulldlng uynamlc WebslLes
Parvard Summer School
Summer 2012
8 < 9
! ?ou may use a W?SlW?C edlLor Lo generaLe P1ML and/or CSS LhaL you would llke Lo use ln
your slLe.
! lf you lnLegraLe Lhlrd-parLy CSS or !avaScrlpL llbrarles lnLo your pro[ecL, clLe Lhelr orlgln wlLh
commenLs.
! lf you lncorporaLe or adapL snlppeLs of P code from Lhe Web lnLo your pro[ecL
(!"#", examples from php.net), clLe Lhe code's orlglns wlLh commenLs.
! lf you lncorporaLe lmages from Lhe Web lnLo your pro[ecL, clLe Lhe lmages' wlLh commenLs.
! ?our webslLe musL appear and behave Lhe same on Lhe laLesL verslons of aL leasL Lwo of
Lhese browsers:
! Chrome
! llrefox
! lnLerneL Lxplorer
! Cpera
! Safarl
So long as your slLe meeLs Lhe foregolng requlremenLs, you are welcome Lo lnLerpreL Lhls
speclflcaLlon as you see flL. lmaglne, perhaps, an ldeal slLe for 1hree Aces. 1hen go lmplemenL
LhaL. Cr, aL leasL, as much as you can!
And don'L forgeL abouL cs75.net/discuss!
GS+'(@9'%"K+%H4(
! Cnce done wlLh your slLe, puL LogeLher a readme ln a LexL flle called README LhaL llves ln
project0/.
1reaL Lhls readme as your opporLunlLy noL only Lo explaln buL Lo [usLlfy your deslgn declslons. 1ell
us why you modeled your xML as you dld. 1ell us why you chose, say, selecL menus over radlo
buLLons for some feaLure. 1ell us wlLh whlch Lwo (or more) browsers we should evaluaLe your
slLe. And glve us an overall sense of how your slLe works (!"#", Lell us whlch flles do whaL). 8uL
sLlll be succlncL, keep Lhls readme Lo [usL a few paragraphs ln lengLh.
(
8#H('#(N<M7+'4(
! A few days prlor Lo Lhls pro[ecL's deadllne, lnsLrucLlons for submlLLlng your work wlll be
announced aL https://www.cs75.net/. 8e sure Lo look for Lhose dlrecLlons and Lhen submlL
your work prlor Lo Lhls pro[ecL's deadllne.
YOUR AD HERE
for more info: www.menupages.com
MenuPages PRIME Advertising
Menu Items and Prices subject to change. Information related to this restaurant is provided solely for informational purposes only and
is not an endorsement or guarantee by MenuPages.com or any Listed Restaurant. 2007 Slick City Media, Inc. www.MenuPages.com
Three Aces 617 491-2884
1613 Massachusetts Ave
617 491-2889
Cambridge, MA 02139
Btwn Mellen & Everett St
Pizzas
Sm/lg
Tomato & Cheese ..................................... 5.50 9.75
Onions..................................................... 6.85 10.85
Peppers ................................................... 6.85 10.85
Broccoli ................................................... 6.85 10.85
Fresh Garlic............................................. 6.85 10.85
Mushrooms............................................. 6.85 10.85
Fresh Spinach ......................................... 6.85 10.85
Anchovies ............................................... 6.85 10.85
Hamburg ................................................. 6.85 10.85
Pepperoni ................................................ 6.85 10.85
Sausage .................................................. 6.85 10.85
Meatball ................................................. 6.85 10.85
Bacon ...................................................... 6.85 10.85
Ham......................................................... 6.85 10.85
Olives ...................................................... 6.85 10.85
Grilled Chicken........................................ 7.95 11.80
Hawaiian................................................. 7.95 11.80
2-way Combo.......................................... 7.95 11.80
3-way Combo.......................................... 8.90 12.80
Extra Cheese............................................. 1.25 1.85
Speciality Pizzas
$9.80 Sm / $15.80 Lg
Three Aces Special ......................................................
Mediterranean Sliced Tomatoes, Olives, Spinach, Fresh
Garlic, Mozzarella & Feta Cheese ..................................
Vegetarian Sliced Tomatoes, Onion, Peppers, Mushrooms,
Broccoli, Mozzarella .....................................................
Meat Lovers Pepperoni, Hamburg, Sausage & Bacon.......
Bbq Grilled Chicken Choice Of Vegetables .....................
Grecian Supreme Grilled Chicken, Feta Cheese, Toma-
toes, Kalamata Olives...................................................
Special Dinners
Chicken Wing Dinner ............................................7.25
Gyro Plate .............................................................7.25
Chicken Finger Plate .............................................7.25
3 Piece Chicken Dinner .........................................7.25
Cheeseburger or Chicken Burger Plate.................5.25
Double-cheeseburger Plate ..................................5.75
Chicken Kabob Plate With rice, salad & pita bread..7.85
Steak Tips Dinner Served with side salad & french
fries .....................................................................8.25
Fish & Chips Dinner Served with side salad, french fries
& tartar sauce.......................................................7.35
All Dinners served with French Fries and Salad*
Side Orders
Onion Rings............................................... 2.60 2.95
French Fries............................................... 2.25 2.65
Spicy Fries................................................. 2.60 2.95
Chicken Wings......................................................5.75
Buffalo Wings....................................................... 5.75
Chicken Fingers .................................................... 5.75
Mozzarella Sticks(7 Pieces) .................................. 4.50
Slice Cheese Pizza................................................ 1.65
Slice Pepperoni Pizza............................................ 1.85
Homemade Spinach Pie ....................................... 3.10
Buffalo Fingers ..................................................... 5.75
Chicken Burger ..................................................... 2.75
Cheeseburger ....................................................... 2.75
Spanakopita.......................................................... 3.25
Salads
SM/LG
Garden .......................................................3.50 4.50
Greek .........................................................4.50 5.50
Antipasto ...................................................4.50 5.50
Chef ...........................................................4.50 5.50
Tuna ...........................................................4.50 5.50
Grilled Chicken ..........................................4.95 5.95
Kabob Salad With grilled Chicken & feta
cheese ......................................................5.45 6.45
Spaghetti or Ziti
With Sauce........................................................... 5.40
With Sausage....................................................... 6.45
With Meat Ball ..................................................... 6.45
With Veal .............................................................. 6.45
With Chicken Cutlet ............................................. 6.45
With Mushrooms.................................................. 6.45
A La Three Aces Sausage, Mushrooms, Bacon & Ham
Topped with Sauce & Mozzarella Cheese................ 7.25
Eggplant Spaghetti or Ziti Dinner With Mozzarella
Cheese................................................................. 7.25
Home made Lasagna Ravioli or Mani-
cotti
With Sauce........................................................... 6.25
With Sausage....................................................... 7.25
With Meatball ...................................................... 7.25
With Veal .............................................................. 7.25
With Chicken Cutlet ............................................. 7.25
With Mushrooms.................................................. 7.25
Veggie Lasagna .................................................... 7.25
All Pasta Dinners Served with Garlic Bread and Salad
Homemade Calzones
$7.35-lg
Vegetarian ...................................................................
Sausage.......................................................................
Ham & Cheese.............................................................
Chicken Cutlet .............................................................
Grilled Chicken ............................................................
Meatball ......................................................................
Grecian ........................................................................
Veal ..............................................................................
Eggplant ......................................................................
Steak ...........................................................................
Italian All the above come with mushrooms, peppers&
onions ........................................................................
Grecian Fresh Tomatoes, Spinach, Feta...........................
Wraps $4.95
Turkey Club Wrap Turkey, Cheese, Lettuce, Tomato,
Onion, Mayo................................................................
Chicken Cobb Grilled Chicken, Bacon, Cheese, lettuce,
Tomatop, Onion, Honey Mustard...................................
Greek Supreme Feta Cheese, Black Olives, Lettuce,
Tomato, Onion, Greek Dressing.....................................
Crispy Chicken Chicken Finger, Lettuce, Tomato, Onion,
Honey Mustard............................................................
Steak Wrap .................................................................
Grinders
Sm/lg
Meatless ................................................... 4.50 4.95
Hamburger................................................. 4.50 4.95
Cheeseburger ............................................ 4.75 5.75
Meatball .................................................... 4.75 5.75
Sausage..................................................... 4.75 5.75
American................................................... 4.75 5.75
Veal Cutlet................................................. 4.75 5.75
Hot Pastrami.............................................. 4.95 5.95
Italian ........................................................ 4.75 5.75
Genoa Salami ............................................ 4.75 5.75
Ham........................................................... 4.75 5.75
Tuna........................................................... 4.75 5.75
Roast Beef................................................. 4.95 5.95
B.l.t. Bacon, Lettuce, Tomato ........................ 4.75 5.75
Sliced Turkey ............................................. 4.75 5.75
Three Aces Special Turkey, Roast Beef &
Bacon ....................................................... 5.30 6.40
Cheese Steak ............................................ 5.10 6.00
Onion Steak............................................... 5.20 6.20
Pepper Steak ............................................. 5.20 6.20
Mushroom Steak....................................... 5.20 6.20
Special Steak ............................................ 5.40 6.40
Steak Bomb Each Additional Item on Steak Subs $0.25/
$0.40 ........................................................ 5.50 6.50
Pepper & Egg............................................. 4.50 4.95
Ham & Egg ................................................ 4.75 5.75
Steak & Egg............................................... 5.60 6.50
Bacon & Egg.............................................. 5.30 6.40
Chicken Cutlet ........................................... 4.75 5.75
Eggplant & Cheese.................................... 4.75 5.75
Gyro On Pita ......................................................... 5.50
Grilled Chicken On Pita ........................................ 5.25
Grilled Chicken Delight ............................. 5.50 6.50
Grilled Chicken Sub................................... 5.25 5.85
Chicken Finger Sub.................................... 4.60 5.60