ÿþ<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:p="urn:schemas-microsoft-com:office:powerpoint" xmlns:oa="urn:schemas-microsoft-com:office:activation" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/html; charset=unicode"> <meta name=ProgId content=Word.Document> <meta name=Generator content="Microsoft Word 12"> <meta name=Originator content="Microsoft Word 12"> <link rel=File-List href="Lab08_files/filelist.xml"> <link rel=Edit-Time-Data href="Lab08_files/editdata.mso"> <!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--> <title>IT350 Lab</title> <!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>mjlenn</o:Author> <o:Template>Normal</o:Template> <o:LastAuthor>adina</o:LastAuthor> <o:Revision>25</o:Revision> <o:TotalTime>7983</o:TotalTime> <o:Created>2009-10-21T18:37:00Z</o:Created> <o:LastSaved>2011-10-25T13:37:00Z</o:LastSaved> <o:Pages>5</o:Pages> <o:Words>1639</o:Words> <o:Characters>9343</o:Characters> <o:Company>US Naval Academy</o:Company> <o:Lines>77</o:Lines> <o:Paragraphs>21</o:Paragraphs> <o:CharactersWithSpaces>10961</o:CharactersWithSpaces> <o:Version>12.00</o:Version> </o:DocumentProperties> <o:OfficeDocumentSettings> <o:AllowPNG/> </o:OfficeDocumentSettings> </xml><![endif]--> <link rel=themeData href="Lab08_files/themedata.thmx"> <link rel=colorSchemeMapping href="Lab08_files/colorschememapping.xml"> <!--[if gte mso 9]><xml> <w:WordDocument> <w:View>Print</w:View> <w:Zoom>90</w:Zoom> <w:TrackMoves>false</w:TrackMoves> <w:TrackFormatting/> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:DoNotPromoteQF/> <w:LidThemeOther>EN-US</w:LidThemeOther> <w:LidThemeAsian>X-NONE</w:LidThemeAsian> <w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript> <w:Compatibility> <w:BreakWrappedTables/> <w:SnapToGridInCell/> <w:WrapTextWithPunct/> <w:UseAsianBreakRules/> <w:DontGrowAutofit/> <w:SplitPgBreakAndParaMark/> <w:DontVertAlignCellWithSp/> <w:DontBreakConstrainedForcedTables/> <w:DontVertAlignInTxbx/> <w:Word11KerningPairs/> <w:CachedColBalance/> </w:Compatibility> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> <m:mathPr> <m:mathFont m:val="Cambria Math"/> <m:brkBin m:val="before"/> <m:brkBinSub m:val="&#45;-"/> <m:smallFrac m:val="off"/> <m:dispDef/> <m:lMargin m:val="0"/> <m:rMargin m:val="0"/> <m:defJc m:val="centerGroup"/> <m:wrapIndent m:val="1440"/> <m:intLim m:val="subSup"/> <m:naryLim m:val="undOvr"/> </m:mathPr> <u1:mathPr> <u1:mathFont u1:val="Cambria Math"/> <u1:brkBin u1:val="before"/> <u1:brkBinSub u1:val="--"/> <u1:smallFrac u1:val="off"/> <u1:dispDef/> <u1:lMargin u1:val="0"/> <u1:rMargin u1:val="0"/> <u1:defJc u1:val="centerGroup"/> <u1:wrapIndent u1:val="1440"/> <u1:intLim u1:val="subSup"/> <u1:naryLim u1:val="undOvr"/> </u1:mathPr> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" DefUnhideWhenUsed="false" DefSemiHidden="false" DefQFormat="false" LatentStyleCount="267"> <w:LsdException Locked="false" Priority="1" Name="Default Paragraph Font"/> <w:LsdException Locked="false" Priority="99" Name="No List"/> <w:LsdException Locked="false" Priority="99" SemiHidden="true" Name="Placeholder Text"/> <w:LsdException Locked="false" Priority="1" QFormat="true" Name="No Spacing"/> <w:LsdException Locked="false" Priority="60" Name="Light Shading"/> <w:LsdException Locked="false" Priority="61" Name="Light List"/> <w:LsdException Locked="false" Priority="62" Name="Light Grid"/> <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1"/> <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2"/> <w:LsdException Locked="false" Priority="65" Name="Medium List 1"/> <w:LsdException Locked="false" Priority="66" Name="Medium List 2"/> <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1"/> <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2"/> <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3"/> <w:LsdException Locked="false" Priority="70" Name="Dark List"/> <w:LsdException Locked="false" Priority="71" Name="Colorful Shading"/> <w:LsdException Locked="false" Priority="72" Name="Colorful List"/> <w:LsdException Locked="false" Priority="73" Name="Colorful Grid"/> <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 1"/> <w:LsdException Locked="false" Priority="61" Name="Light List Accent 1"/> <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 1"/> <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 1"/> <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 1"/> <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 1"/> <w:LsdException Locked="false" Priority="99" SemiHidden="true" Name="Revision"/> <w:LsdException Locked="false" Priority="34" QFormat="true" Name="List Paragraph"/> <w:LsdException Locked="false" Priority="29" QFormat="true" Name="Quote"/> <w:LsdException Locked="false" Priority="30" QFormat="true" Name="Intense Quote"/> <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 1"/> <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 1"/> <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 1"/> <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 1"/> <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 1"/> <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 1"/> <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 1"/> <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 1"/> <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 2"/> <w:LsdException Locked="false" Priority="61" Name="Light List Accent 2"/> <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 2"/> <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 2"/> <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 2"/> <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 2"/> <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 2"/> <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 2"/> <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 2"/> <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 2"/> <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 2"/> <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 2"/> <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 2"/> <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 2"/> <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 3"/> <w:LsdException Locked="false" Priority="61" Name="Light List Accent 3"/> <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 3"/> <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 3"/> <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 3"/> <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 3"/> <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 3"/> <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 3"/> <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 3"/> <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 3"/> <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 3"/> <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 3"/> <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 3"/> <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 3"/> <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 4"/> <w:LsdException Locked="false" Priority="61" Name="Light List Accent 4"/> <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 4"/> <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 4"/> <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 4"/> <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 4"/> <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 4"/> <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 4"/> <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 4"/> <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 4"/> <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 4"/> <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 4"/> <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 4"/> <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 4"/> <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 5"/> <w:LsdException Locked="false" Priority="61" Name="Light List Accent 5"/> <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 5"/> <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 5"/> <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 5"/> <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 5"/> <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 5"/> <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 5"/> <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 5"/> <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 5"/> <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 5"/> <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 5"/> <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 5"/> <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 5"/> <w:LsdException Locked="false" Priority="60" Name="Light Shading Accent 6"/> <w:LsdException Locked="false" Priority="61" Name="Light List Accent 6"/> <w:LsdException Locked="false" Priority="62" Name="Light Grid Accent 6"/> <w:LsdException Locked="false" Priority="63" Name="Medium Shading 1 Accent 6"/> <w:LsdException Locked="false" Priority="64" Name="Medium Shading 2 Accent 6"/> <w:LsdException Locked="false" Priority="65" Name="Medium List 1 Accent 6"/> <w:LsdException Locked="false" Priority="66" Name="Medium List 2 Accent 6"/> <w:LsdException Locked="false" Priority="67" Name="Medium Grid 1 Accent 6"/> <w:LsdException Locked="false" Priority="68" Name="Medium Grid 2 Accent 6"/> <w:LsdException Locked="false" Priority="69" Name="Medium Grid 3 Accent 6"/> <w:LsdException Locked="false" Priority="70" Name="Dark List Accent 6"/> <w:LsdException Locked="false" Priority="71" Name="Colorful Shading Accent 6"/> <w:LsdException Locked="false" Priority="72" Name="Colorful List Accent 6"/> <w:LsdException Locked="false" Priority="73" Name="Colorful Grid Accent 6"/> <w:LsdException Locked="false" Priority="19" QFormat="true" Name="Subtle Emphasis"/> <w:LsdException Locked="false" Priority="21" QFormat="true" Name="Intense Emphasis"/> <w:LsdException Locked="false" Priority="31" QFormat="true" Name="Subtle Reference"/> <w:LsdException Locked="false" Priority="32" QFormat="true" Name="Intense Reference"/> <w:LsdException Locked="false" Priority="33" QFormat="true" Name="Book Title"/> <w:LsdException Locked="false" Priority="37" SemiHidden="true" UnhideWhenUsed="true" Name="Bibliography"/> <w:LsdException Locked="false" Priority="39" SemiHidden="true" UnhideWhenUsed="true" QFormat="true" Name="TOC Heading"/> </w:LatentStyles> </xml><![endif]--> <style> <!-- /* Font Definitions */ @font-face {font-family:Batang; panose-1:2 3 6 0 0 1 1 1 1 1; mso-font-alt:¼ÕÐ; mso-font-charset:129; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1342176593 1775729915 48 0 524447 0;} @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:1; mso-generic-font-family:roman; mso-font-format:other; mso-font-pitch:variable; mso-font-signature:0 0 0 0 0 0;} @font-face {font-family:Cambria; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:0; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-536870145 1073743103 0 0 415 0;} @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-520081665 -1073717157 41 0 66047 0;} @font-face {font-family:"\@Batang"; panose-1:2 3 6 0 0 1 1 1 1 1; mso-font-charset:129; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1342176593 1775729915 48 0 524447 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:Batang;} h1 {mso-style-unhide:no; mso-style-qformat:yes; mso-style-link:"Heading 1 Char"; mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; mso-outline-level:1; font-size:24.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast;} h2 {mso-style-unhide:no; mso-style-qformat:yes; mso-style-link:"Heading 2 Char"; mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; mso-outline-level:2; font-size:18.0pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast;} h3 {mso-style-unhide:no; mso-style-qformat:yes; mso-style-link:"Heading 3 Char"; mso-margin-top-alt:auto; margin-right:0in; mso-margin-bottom-alt:auto; margin-left:0in; mso-pagination:widow-orphan; mso-outline-level:3; font-size:13.5pt; font-family:"Times New Roman","serif"; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast;} a:link, span.MsoHyperlink {mso-style-unhide:no; color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {mso-style-unhide:no; color:blue; text-decoration:underline; text-underline:single;} p.MsoAcetate, li.MsoAcetate, div.MsoAcetate {mso-style-unhide:no; mso-style-link:"Balloon Text Char"; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:8.0pt; font-family:"Tahoma","sans-serif"; mso-fareast-font-family:Batang;} span.Heading1Char {mso-style-name:"Heading 1 Char"; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"Heading 1"; mso-ansi-font-size:14.0pt; mso-bidi-font-size:14.0pt; font-family:"Cambria","serif"; mso-ascii-font-family:Cambria; mso-fareast-font-family:"Times New Roman"; mso-hansi-font-family:Cambria; mso-bidi-font-family:"Times New Roman"; color:#365F91; font-weight:bold;} span.Heading2Char {mso-style-name:"Heading 2 Char"; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"Heading 2"; mso-ansi-font-size:13.0pt; mso-bidi-font-size:13.0pt; font-family:"Cambria","serif"; mso-ascii-font-family:Cambria; mso-fareast-font-family:"Times New Roman"; mso-hansi-font-family:Cambria; mso-bidi-font-family:"Times New Roman"; color:#4F81BD; font-weight:bold;} span.Heading3Char {mso-style-name:"Heading 3 Char"; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"Heading 3"; mso-ansi-font-size:12.0pt; mso-bidi-font-size:12.0pt; font-family:"Cambria","serif"; mso-ascii-font-family:Cambria; mso-fareast-font-family:"Times New Roman"; mso-hansi-font-family:Cambria; mso-bidi-font-family:"Times New Roman"; color:#4F81BD; font-weight:bold;} span.BalloonTextChar {mso-style-name:"Balloon Text Char"; mso-style-unhide:no; mso-style-locked:yes; mso-style-link:"Balloon Text"; mso-ansi-font-size:8.0pt; mso-bidi-font-size:8.0pt; font-family:"Tahoma","sans-serif"; mso-ascii-font-family:Tahoma; mso-fareast-font-family:Batang; mso-hansi-font-family:Tahoma; mso-bidi-font-family:Tahoma;} span.st0 {mso-style-name:st0; mso-style-unhide:no;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt;} @page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.WordSection1 {page:WordSection1;} /* List Definitions */ @list l0 {mso-list-id:126625422; mso-list-type:hybrid; mso-list-template-ids:-1996997200 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l0:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} @list l0:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} @list l1 {mso-list-id:1005401065; mso-list-template-ids:1754405232;} @list l1:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} @list l1:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} @list l2 {mso-list-id:1117337768; mso-list-type:hybrid; mso-list-template-ids:300973554 67698703 67698703 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l2:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} @list l2:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} @list l2:level3 {mso-level-number-format:roman-lower; mso-level-tab-stop:1.5in; mso-level-number-position:right; text-indent:-9.0pt;} @list l2:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} @list l2:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} @list l2:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} @list l2:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} @list l2:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} @list l2:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} @list l3 {mso-list-id:1352563870; mso-list-type:hybrid; mso-list-template-ids:546492042 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;} @list l3:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} @list l3:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} @list l4 {mso-list-id:2067604960; mso-list-template-ids:2118189004;} @list l4:level1 {mso-level-number-format:bullet; mso-level-text:·ð; mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:Symbol;} @list l4:level2 {mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in;} @list l4:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in;} @list l4:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in;} @list l4:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in;} @list l4:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in;} @list l4:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in;} @list l4:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in;} @list l4:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in;} ol {margin-bottom:0in;} ul {margin-bottom:0in;} --> </style> <!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman","serif";} </style> <![endif]--> <meta name=Title content="IT350 Fall 2005 - Lab 09"> <meta name=Keywords content=""> <!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="26626"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]--> </head> <body bgcolor=white lang=EN-US link=blue vlink=blue style='tab-interval:.5in'> <div class=WordSection1> <p class=MsoNormal align=right style='text-align:right'>IT350 - Web and Internet Programming<br style='mso-special-character:line-break'> <![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'> <![endif]></p> <h1 align=center style='text-align:center'>Lab 8  CGI with Perl</h1> <h2>Introduction</h2> <p class=MsoNormal style='margin-bottom:12.0pt'>This week will be an introduction to CGI programming. To do this, you will go back to the HTML form you created for your website back in Lab 02/03, and finally put some computation behind it  to really keep track of signups, orders, etc.</p> <p class=MsoNormal style='margin-bottom:12.0pt'>You originally created your form in Lab02, <b style='mso-bidi-font-weight:normal'>though you should copy your work from Lab03 (or later) instead</b>, in order to benefit from your later CSS additions. </p> <h2>Requirements</h2> <p class=MsoNormal><span style='mso-fareast-font-family:"Times New Roman"'>VERY IMPORTANT: You are likely editing your Perl files on a Windows machine. On Windows, files are usually save in &quot;DOS&quot; mode, which means each line ending is actually two characters (CR/LF). On Unix, only one character is used, and our Unix-based web server will fail on any files saved in Windows mode. For this reason: <o:p></o:p></span></p> <ul type=disc> <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l4 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family: "Times New Roman"'>Do not use Notepad! Use Notepad++<o:p></o:p></span></li> <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l4 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family: "Times New Roman"'>In Notepad++: Settings-&gt;Preferences-&gt;New Document/Default Directory tab. Select &quot;Unix&quot; for format. Note that you must do this BEFORE you create your Perl file, but then it should remember the setting on that computer. If you already have a file in Dos\Windows mode (look on the status bar at the bottom of the screen), then do this: Edit-&gt;EOL Conversion-&gt;UNIX format. <o:p></o:p></span></li> <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l4 level1 lfo1;tab-stops:list .5in'><span style='mso-fareast-font-family: "Times New Roman"'>Whatever tool you use: do this change on your Bancroft machine as well.<o:p></o:p></span></li> </ul> <p class=MsoNormal><o:p>&nbsp;</o:p></p> <p class=MsoNormal>You must create a folder on you Web drive called &quot;Lab08&quot; (without the quotes) and store your work in that directory.</p> <p class=MsoNormal><o:p>&nbsp;</o:p></p> <p class=MsoNormal>IMPORTANT: To allow the webserver to later create files when running a perl script, the webserver user needs to have extra permissions on your Lab08 directory. To enable this, ssh into intranet.cs.usna.edu (use putty or other tool) and type the following in the window that appears:</p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-family:"Courier New"'>cd public_html<o:p></o:p></span></b></p> <p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span style='font-family:"Courier New"'>setfacl -m u:www-data:rwx Lab08<br style='mso-special-character:line-break'> <![if !supportLineBreakNewLine]><br style='mso-special-character:line-break'> <![endif]></span></b></p> <p class=MsoNormal>&nbsp;Read the entire lab so you see the requirements and know what is coming.</p> <ol style='margin-top:0in' start=1 type=1> <li class=MsoNormal style='mso-list:l2 level1 lfo2;tab-stops:list .5in'>Your first order of business is to write a basic Perl program and get that working to the point where it produces some output visible with a browser. We ll walk you through this part:</li> <ol style='margin-top:0in' start=1 type=1> <li class=MsoNormal style='mso-list:l2 level2 lfo2;tab-stops:list 1.0in'><b style='mso-bidi-font-weight:normal'>Right</b>-<b style='mso-bidi-font-weight: normal'>click</b> on <a href="submit.txt">submit</a> and then save it in W:\public_html\Lab08\submit.pl (you <b style='mso-bidi-font-weight:normal'>must</b> change  Save as type to  All files .<span style='mso-spacerun:yes'>  </span>Then change filename from submit.txt to submit.pl)</li> <li class=MsoNormal style='mso-list:l2 level2 lfo2;tab-stops:list 1.0in'>Take a look at submit.pl.<span style='mso-spacerun:yes'>  </span>Get a general feel for what it does.<span style='mso-spacerun:yes'>  </span>(Note: it has a few bugs that you will correct in a moment). </li> <li class=MsoNormal style='mso-list:l2 level2 lfo2;tab-stops:list 1.0in'>ssh into intranet.cs.usna.edu (use putty or other tool)</li> <li class=MsoNormal style='mso-list:l2 level2 lfo2;tab-stops:list 1.0in'>Type the following into the window that appears:<br> <b style='mso-bidi-font-weight:normal'><span style='font-family:"Courier New"'>cd public_html/Lab08<br> ./submit.pl<br> </span></b>(this will execute your file. Any syntax error will be reported to the screen)<b style='mso-bidi-font-weight:normal'><span style='font-family:"Courier New"'><o:p></o:p></span></b></li> </ol> </ol> <p class=MsoNormal style='margin-left:1.0in'>If you cannot execute submit.pl due to permissions errors, use </p> <p class=MsoNormal style='margin-left:1.0in'>chmod 755 submit.pl </p> <p class=MsoNormal style='margin-left:1.0in'>to set the correct permissions for the file.<b style='mso-bidi-font-weight:normal'><span style='font-family:"Courier New"'><o:p></o:p></span></b></p> <ol style='margin-top:0in' start=1 type=1> <ol style='margin-top:0in' start=5 type=1> <li class=MsoNormal style='mso-list:l2 level2 lfo2;tab-stops:list 1.0in'>This last step should identify a few errors in the program.<span style='mso-spacerun:yes'>  </span>Fix them.<span style='mso-spacerun:yes'>  </span>Re-run perl from the command line until you get no more errors. (Hint: all control flow statements like if/while/for require curly braces around their body  this is optional in most other languages).</li> <li class=MsoNormal style='mso-list:l2 level2 lfo2;tab-stops:list 1.0in'>Try fetching the URL <span style='font-family:"Courier New"'><a href="http://www.mxxxxxx.it350.cs.usna.edu/Lab08/submit.pl?name=Fred&amp;age=72">http://intranet.cs.usna.edu/~mXXXXXX/Lab08/submit.pl?name=Fred&amp;age=72</a><span style='mso-spacerun:yes'>  </span></span><br> You likely still have a logic bug or two in your program that perl interpreter won t catch.<span style='mso-spacerun:yes'>  </span>Fix the program so that fetching the above link correctly produces the following output (note: if you get nothing and have the right URL, use the next step to debug your Perl):<br> <span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"> <v:stroke joinstyle="miter"/> <v:formulas> <v:f eqn="if lineDrawn pixelLineWidth 0"/> <v:f eqn="sum @0 1 0"/> <v:f eqn="sum 0 0 @1"/> <v:f eqn="prod @2 1 2"/> <v:f eqn="prod @3 21600 pixelWidth"/> <v:f eqn="prod @3 21600 pixelHeight"/> <v:f eqn="sum @0 0 1"/> <v:f eqn="prod @6 1 2"/> <v:f eqn="prod @7 21600 pixelWidth"/> <v:f eqn="sum @8 21600 0"/> <v:f eqn="prod @7 21600 pixelHeight"/> <v:f eqn="sum @10 21600 0"/> </v:formulas> <v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/> <o:lock v:ext="edit" aspectratio="t"/> </v:shapetype><v:shape id="Picture_x0020_1" o:spid="_x0000_i1026" type="#_x0000_t75" style='width:431.4pt;height:180pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="Lab08_files/image001.png" o:title=""/> </v:shape><![endif]--><![if !vml]><img border=0 width=575 height=240 src="Lab08_files/image002.jpg" v:shapes="Picture_x0020_1"><![endif]></span></li> <li class=MsoNormal style='mso-list:l2 level2 lfo2;tab-stops:list 1.0in'>Sometimes a syntactically correct Perl program will still crash when you run it with actual parameters, in which case you may not be able to see everything/anything when you run it via the browser, as in the step above.<span style='mso-spacerun:yes'>  </span>At such times, you want to instead really run it from the command line, but provide arguments so that it actually execute the right thing.<span style='mso-spacerun:yes'>  </span>To do that, we omit the question mark from the URL and just provide the arguments as a quoted string like this:<br> <b style='mso-bidi-font-weight:normal'><span style='font-family:"Courier New"'>./submit.pl &quot;name=Fred&amp;age=72&quot;<br> </span></b>Try this out now and see what the output looks like.<span style='mso-spacerun:yes'>  </span>This is a vital debugging tool, and you will want to use this for your final project and possibly for this lab.</li> </ol> </ol> <p class=MsoNormal style='margin-left:.5in'><o:p>&nbsp;</o:p></p> <ol style='margin-top:0in' start=2 type=1> <li class=MsoNormal style='mso-list:l2 level1 lfo2;tab-stops:list .5in'>Congratulations!<span style='mso-spacerun:yes'>  </span>You now have a working CGI program. Before moving to the next part, show your instructor your working program.</li> </ol> <p class=MsoNormal style='margin-left:.5in'><span style='mso-spacerun:yes'> </span></p> <p class=MsoNormal style='margin-left:.5in'>You will now modify it to use the values provided by your form.</p> <ol style='margin-top:0in' start=3 type=1> <li class=MsoNormal style='mso-list:l2 level1 lfo2;tab-stops:list .5in'><b style='mso-bidi-font-weight:normal'>Perl functions</b>: You are required to write and use at least one Perl function for this lab.<b><o:p></o:p></b></li> <li class=MsoNormal style='mso-list:l2 level1 lfo2;tab-stops:list .5in'>You should have a file form.html from Lab03, copied into Lab08. Your form should contain at least on element of the following input types: text, password, checkbox or radio button, submit (your form will likely contain more than that) Modify the form (in your Lab08 directory) so that when you click submit, it invokes your new CGI program.<span style='mso-spacerun:yes'>  </span>Modify your CGI program so that it reads in some value from your form and displays the value in its resultant HTML output.</li> <li class=MsoNormal style='mso-list:l2 level1 lfo2;tab-stops:list .5in'><b>Validity check: </b><span style='mso-bidi-font-weight:bold'>Modify submit.pl</span> to validate <i style='mso-bidi-font-style:normal'>some</i> of the input that your form provides to your CGI program.<span style='mso-spacerun:yes'>  </span>If an error is detected, your program should state explicitly what the error was, and tell the user to hit the back button and try again (see extra credit for a better approach). You may find it useful to go back to Lab03/form.html, fill in some values, and click submit to see how your data is received by the CGI program we gave you earlier. For the validation you should at a minimum check the following (you can of course do more if you like):</li> <ol style='margin-top:0in' start=1 type=1> <li class=MsoNormal style='mso-list:l2 level2 lfo2;tab-stops:list 1.0in'>For your first (or only) text field, ensure it is filled out (not empty)</li> <li class=MsoNormal style='mso-list:l2 level2 lfo2;tab-stops:list 1.0in'>For your first (or only) set of checkboxes OR radio buttons, ensure at least one checkbox / radio button is selected. See the &quot;Hints&quot; section for a discussion about checkboxes.</li> <li class=MsoNormal style='mso-list:l2 level2 lfo2;tab-stops:list 1.0in'>At least one of your checks must involve a pattern match / regular expression  e.g. to verify a phone number, SSN, etc. is valid. <span style='mso-spacerun:yes'> </span>See section 25.3 of the online book chapter.<span style='mso-spacerun:yes'>  </span>You may also find the validation in Figure 25.13 useful.<span style='mso-spacerun:yes'>  </span>You can modify your form if you wish (to create a parameter that is more amenable to validating with a pattern match).</li> </ol> <li class=MsoNormal style='mso-list:l2 level1 lfo2;tab-stops:list .5in'><b>Confirmation: </b>Modify your Perl code so that, if the variables pass all the validation tests above, the program prints out a user friendly confirmation.<span style='mso-spacerun:yes'>  </span>This confirmation should display the <u>value of all the variables</u> that were provided in a user-friendly manner.<span style='mso-spacerun:yes'>  </span><br> <b style='mso-bidi-font-weight:normal'>A page with a raw list of variables and their values is not so friendly</b> -- you should at least have a reasonable title, some welcome text, then a reasonable confirmation of their values. Imagine this was on your website and you wanted to present a reasonable appearance to someone that just submitted your form.<span style='mso-spacerun:yes'>  </span>Example:  Your reservation for 4 people has been confirmed.<span style='mso-spacerun:yes'>  </span>The details for this reservation are as follows&  </li> <li class=MsoNormal style='mso-list:l2 level1 lfo2;tab-stops:list .5in'><b>Logging: </b>Modify submit.pl so that it records activity to a file called LOG.txt. You will want to append to this file (so it contains a history of everything that has happened).<span style='mso-spacerun:yes'>  </span><span style='mso-bidi-font-weight:bold'>If the values pass your  Validity test, then write all the parameters provided by the user to LOG.txt.<span style='mso-spacerun:yes'>  </span>The values provided by a single user should all be on a single line  use a tab ( \t ) as a separator. Hint:</span> Create a function to write into the log</li> </ol> <p class=MsoNormal style='margin-left:.25in'><span style='mso-bidi-font-weight: bold'><o:p>&nbsp;</o:p></span></p> <p class=MsoNormal style='margin-left:.25in'><span style='mso-bidi-font-weight: bold'>Here s an example of how a simple Log file might look after 3 users submitted forms that passed the Validity test:<br> </span><b style='mso-bidi-font-weight:normal'><span style='mso-no-proof:yes'><!--[if gte vml 1]><v:shape id="Picture_x0020_3" o:spid="_x0000_i1025" type="#_x0000_t75" style='width:402pt; height:84pt;visibility:visible;mso-wrap-style:square'> <v:imagedata src="Lab08_files/image006.png" o:title="" croptop="4707f" cropbottom="52876f" cropright="41971f"/> </v:shape><![endif]--><![if !vml]><img border=0 width=536 height=112 src="Lab08_files/image003.jpg" v:shapes="Picture_x0020_3"><![endif]></span><o:p></o:p></b></p> <p class=MsoNormal style='margin-left:.25in'><b><o:p>&nbsp;</o:p></b></p> <ol style='margin-top:0in' start=8 type=1> <li class=MsoNormal style='mso-list:l2 level1 lfo2;tab-stops:list .5in'><b>Documentation</b>: ensure you have appropriate comments.<span style='mso-spacerun:yes'>  </span><b><o:p></o:p></b></li> <li class=MsoNormal style='mso-list:l2 level1 lfo2;tab-stops:list .5in'><b>Important final step: </b>create five links in your top-level default.htm page under the heading  Lab08 <b><o:p></o:p></b></li> <ol style='margin-top:0in' start=1 type=1> <li class=MsoNormal style='mso-list:l2 level2 lfo2;tab-stops:list 1.0in'>Under the name  Form , make a link to your Lab08/form.html page</li> <li class=MsoNormal style='mso-list:l2 level2 lfo2;tab-stops:list 1.0in'>Under the name  Good submission make a link to your submit.pl file with all of form variables specified in the URL, such that variables all validate.<span style='mso-spacerun:yes'>  </span>Hint: if your form uses the GET method (change this temporarily if necessary), then you can create the needed URL for this by filling out your form correctly and hitting submit.</li> <li class=MsoNormal style='mso-list:l2 level2 lfo2;tab-stops:list 1.0in'>Under the name  LOG.txt make a link to your log file</li> </ol> </ol> <p class=MsoNormal><o:p>&nbsp;</o:p></p> <p class=MsoNormal>Your HTML web page must be constructed using Notepad or a similar <u>text-only </u>editor. The use of programs such as Microsoft Word, Microsoft Frontpage, DreamWeaver, ColdFusion, Mozilla Composer, etc. will be considered an honor offense.<span style='mso-spacerun:yes'>  </span></p> <h2>Extra Credit</h2> <p class=MsoNormal>For a nominal amount of extra credit do some/all of the following:<br> (NOTE: saving a backup copy of your working lab is recommended before starting on this)</p> <ol style='margin-top:0in' start=1 type=1> <li class=MsoNormal style='mso-list:l0 level1 lfo3;tab-stops:list .5in'>If your program finds a validation problem with an input (such as a missing value or a number that is too big), a much better way to handle this is to have your CGI program regenerate the table with all of the values provided by the user filled in, and values that had a problem highlighted.<span style='mso-spacerun:yes'>  </span>Of course there should be a submit button so the user can modify the values and resubmit back to the CGI program.</li> <li class=MsoNormal style='mso-list:l0 level1 lfo3;tab-stops:list .5in'>Write a new CGI program (in Perl) that reads your LOG file and generates a summary report of the submissions.<span style='mso-spacerun:yes'>  </span>Be sure that your LOG.txt has enough data in it to make this report at least a little interesting.</li> </ol> <h2>Deliverables</h2> <ol start=1 type=1> <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo4;tab-stops:list .5in'>Your main web page should be called &quot;form.html&quot; (without the quotes).</li> <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo4;tab-stops:list .5in'>Your Perl file should be called  submit.pl </li> <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo4;tab-stops:list .5in'>You should have all the pieces working described in  Requirements above.</li> <li class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt; mso-list:l1 level1 lfo4;tab-stops:list .5in'>You should have the three links in default.htm that are described above.</li> <li class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt; mso-list:l1 level1 lfo4;tab-stops:list .5in'>All of your files should be in a folder called &quot;Lab08&quot; (without the quotes) on the W drive. <b>Your instructor will assume that your web pages are viewable at http://intranet.cs.usna.edu/~mXXXXXX/Lab08/form.html</b> where XXXXXX is your alpha number. You may want to check that this URL is viewable and that everything works correctly <i>from a computer where somebody else is logged in</i>. If you've goofed and linked to a file on your X drive, this will help you catch it!</li> <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; mso-list:l1 level1 lfo4;tab-stops:list .5in'>Turn in the following hardcopy at the beginning of class on the due date, stapled together in the following order (coversheet on top):</li> <ol start=1 type=1> <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt: auto;mso-list:l1 level2 lfo4;tab-stops:list 1.0in'>A completed assignment <a href="../it350_CoverSheet.pdf">coversheet</a>. Your comments will help us improve the course.</li> <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt: auto;mso-list:l1 level2 lfo4;tab-stops:list 1.0in'>A printout of the source to your submit.pl file. </li> </ol> </ol> <h2><o:p>&nbsp;</o:p></h2> <h2>Additional Hints/Clarifications </h2> <ol style='margin-top:0in' start=1 type=1> <li class=MsoNormal style='mso-list:l3 level1 lfo5;tab-stops:list .5in'>Checkboxes are interesting because more than one can be checked. If you give the same name (in HTML) to all your checkboxes, for example  mychecks , and if you write something like this in Perl:<br> <b style='mso-bidi-font-weight:normal'><span style='font-family:"Courier New"'>@checks = param(&quot;mychecks&quot;);</span></b><br> the param() function will notice the result should be an array (due to the @ symbol), and will return an array with the values of all of the  mychecks checkboxes that were checked.</li> <li class=MsoNormal style='mso-list:l3 level1 lfo5;tab-stops:list .5in'>If your code is not working, first run perl from the command line (like you did in the beginning of the lab) to ensure there are no syntax errors.<span style='mso-spacerun:yes'>  </span>Then, add extra print() commands to see what parts of the program are executing and what the values being used are.</li> <li class=MsoNormal style='mso-list:l3 level1 lfo5;tab-stops:list .5in'>The book sometimes use the <span style='font-family:"Courier New"'>die()</span> function to report errors.<span style='mso-spacerun:yes'>  </span>This is a bad idea for CGI programs because the script will just terminate without sending the error message to the browser.<span style='mso-spacerun:yes'>  </span>Instead, use regular <span style='font-family:"Courier New"'>print()</span> commands to send an error.</li> </ol> <p class=MsoNormal style='margin-left:.25in'><o:p>&nbsp;</o:p></p> <p class=MsoNormal style='margin-left:.25in'><o:p>&nbsp;</o:p></p> </div> </body> </html>