Cse120wi11lec24[1] Metatags XML

  • Upload
    dee-can

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    1/25

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    2/25

    3/2/11 2011 Larry Snyder, CSE 2

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    3/25

    3/2/11 (c) 2010 Larry Snyder, CSE 2010 Larry Snyder, CSE

    byte (baIt). Computers. [Arbitrary, prob. influenced by bit sb.4 and bite sb.] A group of eight

    consecutive bits operated on as a unit in a computer. 1964Blaauw& Brooks in IBM Systems

    Jrnl. III. 122 An 8-bit unit of information is fundamental to most of the formats [of the System/360]. A consecutive group ofn such units constitutes a field of length n. Fixed-length fields of

    length one, two, four, and eight are termed bytes, halfwords, words, and double words

    respectively. 1964IBM Jrnl. Res. & Developm. VIII. 97/1 When a byte of data appears from an

    I/O device, the CPU is seized, dumped, used and restored. 1967P. A. StarkDigital Computer

    Programmingxix. 351 The normal operations in fixed point are done on four bytes at a time.1968Dataweek24 Jan. 1/1 Tape reading and writing is at from 34,160 to 192,000 bytes per

    second.

    byte baIt. Computers.Arbitrary, prob. influenced by bit n.4andbite n. A group of eight consecutive bitsoperated on as a unit in a computer. 1964Blaauw &amp.Brooks in IBM Systems Jrnl. III. 122 An 8-bit unit of information is fundamental to most of the formats of the System/

    360.&es.A consecutive group of n such units constitutes a field oflength n.&es.Fixed-length fields of length one, two, four, and eight aretermed bytes, halfwords, words, and double words respectively. 1964 IBM Jrnl. Res. &amp. Developm. VIII. 97/1When a byte of data appears from an I/O device, the CPU is seized, dumped,used and restored. 1967 P. A. Stark DigitalComputer Programming xix. 351 The normal operations in fixedpoint are done on four bytes at a time.1968 Dataweek24 Jan. 1/1 Tape reading and writing is at from 34,160 to 192,000bytes per second.

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    4/25

    Metadataisdataaboutdataadescriptionofwhatthedatais

    Knowingwhatthedatais,asintheOED,allowsustoprocessitbetterforusers

    Heresanexample:SearchOEDfordefofbinary Withoutmetadata,get8,311hitswhichoneisthe

    definition?

    Withmetadata,geteachdefinitioninorderhow?binary ... ...

    3/2/11 2011 Larry Snyder, CSE 4

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    5/25

    Metadataisdataaboutdataadescriptionofwhatthedatais

    Knowingwhatthedatais,asintheOED,allowsustoprocessitbetterforusers

    Heresanexample:SearchOEDfordefofbinary Withoutmetadata,get8,311hitswhichoneisthe

    definition?

    Withmetadata,geteachdefinitioninorderhow?binary ... ...

    3/2/11 2011 Larry Snyder, CSE 5

    ThePrinciple:Wecanprogramcomputersto

    betterhelpusifweknowwhatthecontentis

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    6/25

    Wehaveseentagsinseveralforms OEDcustomtagscreatedfordictionary HTMLthetagsmarkupthecontentsoitcan

    bedisplayed;itsasimpleuseoftagging

    Recalltagterminology3/2/11 2011 Larry Snyder, CSE 6

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    7/25

    ImprovingonthemetadataofHTML Metadatadescribeswhatthedatais,but

    becausethetagscanbedistinguishedfrom

    thecontent,itseparatesitselffromthecontentthatsgood ButHTMLcombinesidentifyingcontent

    withsayinghowtoprocessit,i.e.displayit

    Bignewidea(notpartofHTML)

    3/2/11 2011 Larry Snyder, CSE 7

    Separatethecontentanditstagsentirelyfrom

    theprocessingproduceadataonlyfile

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    8/25

    Byseparatingthecontentfromtheprocessingitispossibletomaximize

    expertise

    Thecontentexpert(you)putsthedatatogether

    Theprocessingexpert(someprogrammers)writetheprocessingcodebasedonthetags

    3/2/11 2011 Larry Snyder, CSE 8

    DisplayApp

    http://blog.flexcommunity.net/lab/ppv3dGallery_slicedCube/

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    9/25

    3/2/11 2011 Larry Snyder, CSE 9

    JustDoIt!

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    10/25

    TheExtensibleMarkupLanguage(XML)isamarkuplanguageinwhichYOUthinkupthe

    tagsitisaselfdefininglanguage!

    Theusualrulesfortagsapply Enclosein StarttagandEndtag Tagsmustalwaysbematchedorselfterminated

    Tagscanhaveattributes(thinkthoseup,too)ofform attributename="valueInQuotes"

    Use.xml asthefileextension Alwaysstartwithstandardtext(shownlater)

    3/2/11 2011 Larry Snyder, CSE 10

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    11/25

    SupposeIwanttorecordinformationaboutthisclass;usingXML,Imightwrite:

    3/2/11 2011 Larry Snyder, CSE 11

    120M, W, F

    Tu,Th

    Must-know computing knowledge for the

    21st century

    L. Snyder

    Iinventedthetags;they

    makesensetome,andI

    couldwritesoftwaretoprocesssuchdescriptions

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    12/25

    Ifyouhaveanydigitaldata,itshouldbetagged,eitherbyyouorbysoftware

    ThefactthatXMLisastandardispowerfulourexamplewillbesvg,scalablevectorgraphics

    Theidea:specifyall2DgraphicfiguresusingXML,andleavetherendering,thatis,the

    drawingofthefigurestoothersoftware OurspecifyingsystemwillbeInkscape Ourrenderingsystemwillbeprocessing

    3/2/11 2011 Larry Snyder, CSE 12

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    13/25

    Inkscapeisalovely,opensourcesystemtocreatedsvggraphics:http://inkscape.org/

    3/2/11 2011 Larry Snyder, CSE 13

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    14/25

    InstallSWanddevelopsome

    graphicscake

    Savefileasstars.svg

    3/2/11 2011 Larry Snyder, CSE 14

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    15/25

    Surpriseitsa(lot)of

    XML Wecantunderstandit,buttheSWcan

    itsjustalotofattributes

    andtheirvalues

    3/2/11 2011 Larry Snyder, CSE 15

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    16/25

    Processing(andlotsofgraphics

    systems)understandtheSVG

    primitivesandXMLletsusstructurethe

    graphics

    3/2/11 2011 Larry Snyder, CSE 16

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    17/25

    Sincewethinkupthetagsourselves,itstheeasiestlanguageintheworldtolearn,right?

    Right.

    Itstrivial?! Notquitethereisalittletechnique,and

    welldothatnow

    Tagscanserveinthreeroles

    3/2/11 2011 Larry Snyder, CSE 17

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    18/25

    IdentitytagitsoyouknowwhatitisGeorge Washington

    Affinityallpropertiesofathingshouldbecollectedtogether

    George Washington

    6 2

    WoodenMount Vernon

    3/2/11 2011 Larry Snyder, CSE 18

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    19/25

    Collectionencloseagroupofitemsofthesametypeinacollectivetag

    George

    John

    Thomas

    num="44">Barack

    Theseusesbecomeintuitivequickly

    3/2/11 2011 Larry Snyder, CSE 19

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    20/25

    3/2/11 2011 Larry Snyder, CSE 20

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    21/25

    UsingXML,giveadescriptionoftheMac

    3/2/11 2011 Larry Snyder, CSE 21

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    22/25

    WecanseethestructureofourXML(andcheckthatitiswellformed)bydisplayingit

    inFirefox

    3/2/11 2011 Larry Snyder, CSE 22

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    23/25

    Part1:Setupapicturevieweron

    yourowncomputerofyourownpix

    http://www.simpleviewer.net/simpleviewer/3/2/11 2011 Larry Snyder, CSE 23

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    24/25

    BuildADiaryUsing

    XML

    3/2/11 2011 Larry Snyder, CSE 24

  • 8/6/2019 Cse120wi11lec24[1] Metatags XML

    25/25

    Thebrowserdisplayspage,buttheSWgivenisalittlelameandalittlelimited!JustFixIt!

    3/2/11 2011 Larry Snyder, CSE 25