We shall review your impudence at a later date - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

We shall review your impudence at a later date

Description:

'We shall review your impudence at a later date... get_quant(Word,Quant), stringlist_concat([Word,',',Quant],Attrs), file_data(adj,Attrs) ... – PowerPoint PPT presentation

Number of Views:74
Avg rating:3.0/5.0
Slides: 21
Provided by: alcar4
Category:

less

Transcript and Presenter's Notes

Title: We shall review your impudence at a later date


1
We shall review your impudence at a later date
http//www.imdb.com/title/tt0048960/
  • David Niven in Around the World in 80 Days
    (1956)

2
Computer Science 101Lecture 19
linuxvm.org/ Images/TuxonVM.gif
  • Spring Semester 2008
  • Friday, February 29
  • Week 7/18
  • Albert H. Carlson

3
Announcements
  • Due March 7 Midterm Essay
  • Bring your FLASH drive to lab
  • Bring your Castro Book on HTML to lab. Also,
    study the assigned reading to this point so you
    are familiar with it.

4
5th Generation/Research
  • The newest experimental languages
  • Often OO
  • Used for special purpose computing problems
  • Not used by large numbers of programmers mostly
    used by specialists
  • Customized to do one thing very well

5
Compilers
  • Compilers are really translators
  • Translate very abstract languages into more
    specific directions to the machine
  • Because they try to be general purpose they can
    insert extra steps that arent really needed
    code bloat
  • Use two passes when reading the code
  • Pass 1 Find all the names in the code (variables
    and labels)

6
Compilers II
  • Then a table is made for each name
  • Second pass uses the table made in pass 1 and
    translates the code with the location of the name
    in the table in mind
  • Compilers are made for a language and a target
    computer

7
Languages
  • Interpreted
  • BASIC
  • FORTH
  • HTML
  • Structured/Functional
  • C
  • Pascal
  • OO
  • C
  • Java

8
Languages II
  • 5th Generation
  • Prolog
  • Haskel

9
Coding Examples - Microcode
  • 11000010
  • 00000000
  • 00101000
  • 00101100
  • 11000100
  • 00000000
  • 00101000
  • 00110000
  • 10000110
  • 10001000

10
Coding Examples - Assembly
  • ld r4,r5
  • ba loop
  • addcc r3,r5,r3
  • jmpl r154,r0

11
Coding Examples - HTML
  • ltbodygt
  • ltdiv idwelcomegt
  • lth1gtWelcome to the CS101, Spring 2006
    Website!lt/h1gt
  • lt/divgt
  • ltmarquee scrolldelay"0"gt
  • lt!-- Enter your marquee text here. To change the
    width of the marquee, edit it in the CSS --gt
  • The Study Guide for Exam 1 is Linked in at the
    bottom of the page
  • lt/marqueegt
  • ltpgt
  • ltbrgt
  • lt/pgt
  • lth1gtLecturelt/h1gt
  • ltdiv idindent_5gt
  • ltpgt
  • lt!-- Enter the Lecture information here. To
    change indentation of paragraph, goto indent_5
    and edit the left property of the p section. --gt

12
Coding Examples - C
  • int main()
  • int val 1
  • int count 0
  • int unicityu 7 //Upper bound for a unicity
    measurement, used to make it easier to run a loop
    past a float value (ie, rounding up)
  • int k 25
  • int a 26
  • int max
  • float s
  • float rl .75
  • float confidence 0
  • double unicity
  • int filecounter 0
  • double intern, top, bottom, denom
  • //Calculate unictiy
  • // kfact(26)
  • top log10(k)

13
Coding Examples - Python
  • z ins.read(1)
  • print loop
  • print tempcount
  • print lettercount
  • loop 0
  • outs.write(inputfile)
  • outs.write("\n")
  • while(loop lt 26)
  • print lettercountloop
  • outs.write("d," (lettercountloop))
  • loop loop 1
  • print inputfile
  • print lettercount
  • ins.close
  • outs.close
  • print "File is written and this job is done."

14
Coding Examples - Prolog
  • get_attrs(Word,'adj',Ok)
  • - get_quant(Word,Quant),
  • stringlist_concat(Word,',',Quant,Attrs),
  • file_data(adj,Attrs),
  • write('Saving '),write(Word),write_ln(' as an
    adjective to permanent memory.'),
  • retract(words(_)),
  • make_word_list,
  • Ok is 1.

15
Coding Examples - Scripting
  • echo Changing directories into 1
  • echo Using input file 2 as the input file
  • echo ....
  • cd 1
  • echo .....
  • echo Checking all m-gram combinations
  • c\dissertation\shiftandsubciphercfiles\debug\ma
    in -i 1\output35.txt
  • c\test\release\tester -i 2 gtgt 1\output35.txt
  • c\dissertation\shiftandsubciphercfiles\debug\ma
    in -i 1\output35.txt
  • echo ....
  • cd c\dissertation
  • echo Complete

16
Algorithms
  • Algorithms are sometimes called methods
  • Done step by step and in order the steps will be
    accomplished
  • Specify things in detail
  • Lets try an example
  • Washing clothes
  • Typically designed in pseudo code
  • Can contain other algorithms

17
Programs
  • Typically written by programmers
  • Contain one, or more algorithms
  • Written in, or can be translated into, a language
    that is understood by the computer
  • Usually stored for multiple uses
  • Perform one job

18
Program Attributes (Should be)
  • Small as possible
  • Portable
  • Store as many as possible in memory
  • As fast as possible
  • Use as little memory as possible
  • Easy to understand when read
  • Well tested (get rid of the errors)

19
Programs
  • Several fields study software programs
  • Software Engineering studies ways to make better
    programs
  • Complexity studies how to make faster programs
    that use less memory
  • Note that sometimes the goal of fast, small, and
    memory efficient are exclusive of each other and
    decisions have to be made

20
Questions?
Write a Comment
User Comments (0)
About PowerShow.com