SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Introduction to computers and
        programming
Content

• Hardware               • Network
• Information storage       Protocols
   RAM, ROM                Packets
   HD, DVD              • Programming
• Display                   Algorithm
   Images                  Pseudocode
   Characters (fonts)      Flowchart
• File system/type       • Languages
   Encryption           • Source code
   Compression             Example
The computer
Internally
The connections
Information storage

•   1 bit                              •   bit (1 or 0)
•   8 bits                             •   byte (octet) (28)
•   16 bits                            •   word (216)
•   32 bits                            •   double (232)
•   64 bits                            •   long double (264)




    Encoding information on a fixed element of length n
    with a base b gives bn non-redundant possibilities
Information coding

• Binary              • How to count
   0 or 1                     128 64 32 16 8 4 2 1

                                  1 0 1 1 0 1 0 1
• Octal
   0-7               • 128+32+16+4+1=
• Hexadecimal             181 (decimal)
                          265 (octal)
   0-9+A-F
                          B5 (hexadecimal)
• Decimal
   0-9               • Signed vs unsigned
                          0 to 255
                          -127 to +127
Operations on bits

• Booleans:          • Example tables
   0 = false = no       AND   0   1
                          0    0   0
   1 = true = yes
                          1    0   1
• Operators:
                         OR    0   1
     AND                 0    0   1

     OR                  1    1   1

     XOR                XOR   0   1

     NOT                 0    0   1
                          1    1   0
RAM/ROM
Memory mapping
Address      Values
               10111001
                          • Size reminder:
0000
               00001111
                          •   Kilobyte   Kb   210 ~103
0001
0002           11100011   •   Megabyte   Mb   220 ~106
..                        •   Gigabyte   Gb   230 ~109
..                        •   Terabyte   Tb   240 ~1012
..
                          •   Petabyte   Pb   250 ~1015
                          •   …




..
FFFF        00100100
HD/DVD

         trac
         k
           sector

            hea
            d
Display
            QuickTime™ et un
 décompresseur TIFF (non compressé)
sont requis pour visionner cette image.




    •              Screen pixel or dots
                                                        • Fonts
    •              Color coding: 32 bits
    •              1 pixel = 3 bytes of color (RGB)+1      Bitmap
                   byte alpha channel (transparency)       Vectors
    •              1600x1200x4bytes=7,5 Mb!
                                                             TrueType, OpenType,
                                                              PostScript
Keyboard/Mouse

• Each key (or combination    • The mouse movements
  of keys) of the keyboard        1 to 4 bytes (vertical &
  sends a code to the              horizontal)
  computer.                   • Buttons
• The code is interpreted and     Clicked, pressed, rolled
  converted to the
  corresponding ASCII or                                buttons
  Unicode number.
ASCII & Unicode

• ASCII 7/8 bits
• Unicode              •
   UTF-8/16/32 bits
   ISO-8859 (Latin)


• od -c od -h
Software layers

    Files                  Data (.doc, .mp3)
  Software         Word, scripts, mail, web browser…
User Interface   Quartz    CLI, X-Windows      Windows
  Operating        MacOSX          Linux       Windows
    System
   ROM             Firmware                BIOS
  Hardware                CPU, RAM, HD, DVD
File systems

• Method the OS uses to store information
    Storage unit, directories, subdirectories (Windows,
     VMS)
    Single arborescence (Linux, MacOSX, all Unix)
• What exactly is a file?
    a piece of information (text, graphic, data, music
     program, script)
    it is identified by a name and an logical address (or
     path)
    other informations: date, size, type, creator,
     ownership, physical address…
File system organisation


   Disk 1                 Disk 2                                                   Disk 2
       C:                       D:                                                      /


DOCS        PROGS      CONFIG        DATA           Directories                  /usr          /home
                                                                  Disk 1
       WORD    EXCEL        EXPT1           EXPT2   Subdirectories       local          phil           john


                                                                   bin           lib


                                                                         emacs          X11



                Windows                                                    Unix
Path

• The path is the logical address used by
  the system or the user to locate a file.
• Example:
/bd_du_Palais/35/etage/4/appart/12/Dupont_ Jean.txt




                                                      suffix
                                        filename
      path
File types

• Executable               • Special cases in Unix
   .exe                       STDIN
   .app                       STDOUT
   Unix requires « x »        STDERR

• Data
     Text (.txt)
     Music (.mp3)
     Image (.jpg, .gif)
     Movie (.mpg, .mov)
     Binary (.bin)
Encryption / compression

• Compression
   Reducing the size of files
   E.g., .mp3, .gz, .jpg, .zip
• Encryption
   Protecting your privacy
   E.g., .pgp
• Packing
   Grouping the files
   E.g., .tar
Networks

• Direct
    USB 11Mb-480Mb
    Ethernet 10Mb-1Gb



• Wired
    Modem 56Kb
    ADSL 600Kb-8Mb
    LAN 10Mb-10Gb



• Wireless
    Bluetooth 1Mb-20Mb
    WIFI (AirPort) 11Mb-54Mb
Network (ethernet or wireless)

• Computer talk to each           • Handshaking
  other via network               • Transmission
  protocols                       • Ackowledgement
    ip, tcp, http, ftp, …

• TCP/IP                          • DNS
                                     Domain Name Server
    transmission control
     protocol/internet protocol   • URL
                                     Universal Resource
                                      Locator
                                  • IP addess
                                     192.42.197.51
DNS reminder


              2               Root DNS                3
                                    *.org

                        5                       4
 Local DNS                                          Primary DNS
 dns.anywhere.net                                     www.expasy.org



1                   6
                            www.expasy.org ??



Client query                                        Target server
client.anywhere.net                                    129.194.8.64
Packets

The data travels within
units called packets
Packet breakout




Usual TCP/IP payload per packet: 512 bytes
Introduction to programming
What is a program?

• How to cook?
• The algorithm
• Are you a programmer?
Pseudocode

• This is the pseudocode for a game of Monopoly
Flowcharts
Flowcharts details
Languages

• Low level (processor dependent)
    Machine code, assembler
• High level: structured, procedural
    Fortran, C, Pascal…
• High level: object oriented
    C++, Java, C#, Perl, Objective-C…
• Virtual machines
    Java, C#…
• Scripting
    Perl, Python, JavaScript…
Source code -> Object code


• Compiler+linker               • Compiler+linker
    Fortran, C, Pascal, C++…       Fast to execute, but slow
                                     to debug
• Interpreter                   • Interpreter
    Basic, Perl…                   Slow to execute, but fast
                                     to debug (no need to
                                     recompile)
• Intermediate                  • Intermediate
    Java                           Slow…
Source code

• Instructions            • Data structures
     Statement, blocks        Variable
     Affectation              List
     Operators                Array
     Loops                    Hash
     Tests                    Pointers
     Subroutines              Objects
     Comments
Source code (2)

• Statement, blocks          • Variable
   One or more                 A region in memory
    instructions for the         that can be modified
    processor
                                Exists in different
• Affectation                    types
   Change to a variable           Scalar, char, numeric,
• Operator                          boolean
   affect one or more             List, array
    variable                       Hash
      + * - / AND OR NOT…         Combination->data
                                    structure
Source code (3)

• Loops                     • Pointers
   Allow the computer to      Reference to region in
    repeat blocks               memory (address)
• Tests                     • Objects
   Decide what to do
                               Combination of data
• Subroutines                   and code
   Programs frequently
    called (functions)
• Comments
   The most important
    lines of the source
    code…
Example: a text to treat

« Noon rings out. A wasp, making an ominous sound, a sound akin to a klaxon or a
tocsin, flits about. Augustus, who has had a bad night, sits up blinking and purblind. Oh
what was that word (is his thought) that ran through my brain all night, that idiotic word
that, hard as I'd try to pun it down, was always just an inch or two out of my grasp - fowl
or foul or Vow or Voyal? - a word in a quizz which, by association, brought into play an
incongruous mass and magma of nouns, idioms, slogans and sayings, a confusing,
amorphous outpouring which I sought in vain to control or turn off but which wound
around my mind a whirlwind of a cord, a whiplash of a cord, a cord that would split again
and again, would knit again and again, of words without communication or any possibility
of combination, words without pronunciation, signification or transcription but out of
which, notwithstanding, was brought forth a flux, a continuous, compact and lucid flow: an
intuition, a vacillating frisson of illumination as if caught in a flash of lightning or in a mist
abruptly rising to unshroud an obvious sign - but a sign, alas, that would last an instant
only to vanish for good. »

Gilbert Adair
Result…

a=97   n=91
b=15   o=104   Do you see any problem??
c=26   p=15
d=35   q=1
f=23   r=43
g=32   s=59
h=44   t=77
               Try with this:
i=90   u=52
j=1    v=4
               « The quick brown fox, jumps
k=5    w=31    over the lazy dog. »
l=33   x=2
m=17   y=13
       z=2
Flowchart
Source code example

#!/usr/bin/perl -w # essential line of all perl scripts

$filename = "avoid.txt"; # affect « avoid.txt » to the variable $filename

# open the file, or exit
open(FILE, $filename) || die "Cannot open file ‘$filename’nn";
@text = <FILE>; # add each line of the file to an array
close FILE;

foreach $line (@text) { # read one line from the array into $line and repeat for each line
      @table = split(//,$line); # read each character of the line in an array
      while ($char=pop(@table)) { # read one character of the array 'table' and repeat for all
                $char =~ s/[^a-z]//; # keep only the alphabetical character a to z
                if ($char) { # check if the character exists and execute the block
                                    $count{$char}++; # if yes, increment by one the hash 'count'
                }
      }
}

# print each character and its number of occurence one per line
foreach $c (keys %count) {
       print "$c=$count{$c}n";
}
exit; # quit the program
Tips

• Think about your       • Test the code
  problem                      For all the possible
• Create a flowchart            functions or cases (if
                                possible)
• Create the                   Give it to users as a
  pseudocode                    beta (if not possibe)
• Verify the memory            Sell it (if you work for
  used by your                  Microsoft©… ;-)
  variables              • Debug
• Write the code
Summary of the week

• Monday                      • Wednesday
   Intro computers &             Object Oriented
    programming                    programming
                                  BioPerl
   Intro Unix
                                  EMBOSS
   Tutorial Unix
                              • Thursday
• Tuesday                         Database indexing
   Intro Perl                    BLAST
   Regexp & Perl In-liners       HTML & cgi-bin
                              • Friday
                                  Finish exercises
                                  Users questions
Unix

• Next presentation…

Weitere ähnliche Inhalte

Was ist angesagt?

Coal presentationt
Coal presentationtCoal presentationt
Coal presentationtfika sweety
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux Harish R
 
A Quick Introduction to Linux
A Quick Introduction to LinuxA Quick Introduction to Linux
A Quick Introduction to LinuxTusharadri Sarkar
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questionsKavya Sri
 
Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Tushar B Kute
 
Module 1 introduction to Linux
Module 1 introduction to LinuxModule 1 introduction to Linux
Module 1 introduction to LinuxTushar B Kute
 
Linux fundamentals Training
Linux fundamentals TrainingLinux fundamentals Training
Linux fundamentals TrainingLove Steven
 
Introduction to linux at Introductory Bioinformatics Workshop
Introduction to linux at Introductory Bioinformatics WorkshopIntroduction to linux at Introductory Bioinformatics Workshop
Introduction to linux at Introductory Bioinformatics WorkshopSetor Amuzu
 
7 cs102 dvd report (2)
7 cs102 dvd report (2)7 cs102 dvd report (2)
7 cs102 dvd report (2)Tweetie Sabado
 
Chapter 5 memory external
Chapter 5 memory externalChapter 5 memory external
Chapter 5 memory externalwawankoerniawan
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linuxPrasanth V
 
Htcia an introduction to the microsoft ex fat file system 1.01 final
Htcia   an introduction to the microsoft ex fat file system 1.01 finalHtcia   an introduction to the microsoft ex fat file system 1.01 final
Htcia an introduction to the microsoft ex fat file system 1.01 finalovercertified
 
Group project linux helix
Group project linux helixGroup project linux helix
Group project linux helixJeff Carroll
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1Lilesh Pathe
 

Was ist angesagt? (20)

Coal presentationt
Coal presentationtCoal presentationt
Coal presentationt
 
Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
 
Web Introduction
Web IntroductionWeb Introduction
Web Introduction
 
Linux Fundamentals
Linux FundamentalsLinux Fundamentals
Linux Fundamentals
 
Fast File System
Fast File SystemFast File System
Fast File System
 
A Quick Introduction to Linux
A Quick Introduction to LinuxA Quick Introduction to Linux
A Quick Introduction to Linux
 
Linux admin interview questions
Linux admin interview questionsLinux admin interview questions
Linux admin interview questions
 
Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.Module 3 Using Linux Softwares.
Module 3 Using Linux Softwares.
 
Module 1 introduction to Linux
Module 1 introduction to LinuxModule 1 introduction to Linux
Module 1 introduction to Linux
 
Linux fundamentals Training
Linux fundamentals TrainingLinux fundamentals Training
Linux fundamentals Training
 
Introduction to linux at Introductory Bioinformatics Workshop
Introduction to linux at Introductory Bioinformatics WorkshopIntroduction to linux at Introductory Bioinformatics Workshop
Introduction to linux at Introductory Bioinformatics Workshop
 
Linux
Linux Linux
Linux
 
7 cs102 dvd report (2)
7 cs102 dvd report (2)7 cs102 dvd report (2)
7 cs102 dvd report (2)
 
Chapter 5 memory external
Chapter 5 memory externalChapter 5 memory external
Chapter 5 memory external
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Htcia an introduction to the microsoft ex fat file system 1.01 final
Htcia   an introduction to the microsoft ex fat file system 1.01 finalHtcia   an introduction to the microsoft ex fat file system 1.01 final
Htcia an introduction to the microsoft ex fat file system 1.01 final
 
Group project linux helix
Group project linux helixGroup project linux helix
Group project linux helix
 
Linux forensics
Linux forensicsLinux forensics
Linux forensics
 
Linux in Urdu
 Linux in Urdu  Linux in Urdu
Linux in Urdu
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
 

Andere mochten auch

Android reverse engineering: understanding third-party applications. OWASP EU...
Android reverse engineering: understanding third-party applications. OWASP EU...Android reverse engineering: understanding third-party applications. OWASP EU...
Android reverse engineering: understanding third-party applications. OWASP EU...Internet Security Auditors
 
introduction to computer hardware
 introduction to computer hardware introduction to computer hardware
introduction to computer hardwareBikramjeet Sidhu
 
Understanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer toolUnderstanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer toolGabor Paller
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingNSU-Biliran Campus
 
Chapter 1 -introduction_to_computers csc
Chapter 1 -introduction_to_computers cscChapter 1 -introduction_to_computers csc
Chapter 1 -introduction_to_computers cscTyrah Ira
 
C101 – Intro to Programming with C
C101 – Intro to Programming with CC101 – Intro to Programming with C
C101 – Intro to Programming with Cgpsoft_sk
 
Computer hardware presentation
Computer hardware presentationComputer hardware presentation
Computer hardware presentationJisu Dasgupta
 
Introduction to computer hardware
Introduction to computer hardwareIntroduction to computer hardware
Introduction to computer hardwaremite6025.hku
 
The dedexer disassembler
The dedexer disassemblerThe dedexer disassembler
The dedexer disassemblerGabor Paller
 
Introduction to Computers
Introduction to ComputersIntroduction to Computers
Introduction to ComputersSamudin Kassan
 
Components of a computer system
Components of a computer systemComponents of a computer system
Components of a computer systemlistergc
 

Andere mochten auch (15)

Android reverse engineering: understanding third-party applications. OWASP EU...
Android reverse engineering: understanding third-party applications. OWASP EU...Android reverse engineering: understanding third-party applications. OWASP EU...
Android reverse engineering: understanding third-party applications. OWASP EU...
 
2 memory-and-io-devices
2 memory-and-io-devices2 memory-and-io-devices
2 memory-and-io-devices
 
introduction to computer hardware
 introduction to computer hardware introduction to computer hardware
introduction to computer hardware
 
Understanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer toolUnderstanding the Dalvik bytecode with the Dedexer tool
Understanding the Dalvik bytecode with the Dedexer tool
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
Chapter 1 -introduction_to_computers csc
Chapter 1 -introduction_to_computers cscChapter 1 -introduction_to_computers csc
Chapter 1 -introduction_to_computers csc
 
1 introduction-to-computer
1 introduction-to-computer1 introduction-to-computer
1 introduction-to-computer
 
Computer Hardware
Computer HardwareComputer Hardware
Computer Hardware
 
Computer Programming- Lecture 4
Computer Programming- Lecture 4Computer Programming- Lecture 4
Computer Programming- Lecture 4
 
C101 – Intro to Programming with C
C101 – Intro to Programming with CC101 – Intro to Programming with C
C101 – Intro to Programming with C
 
Computer hardware presentation
Computer hardware presentationComputer hardware presentation
Computer hardware presentation
 
Introduction to computer hardware
Introduction to computer hardwareIntroduction to computer hardware
Introduction to computer hardware
 
The dedexer disassembler
The dedexer disassemblerThe dedexer disassembler
The dedexer disassembler
 
Introduction to Computers
Introduction to ComputersIntroduction to Computers
Introduction to Computers
 
Components of a computer system
Components of a computer systemComponents of a computer system
Components of a computer system
 

Ähnlich wie Introduction to computers

COMPUTER INTRODUCTION
COMPUTER INTRODUCTIONCOMPUTER INTRODUCTION
COMPUTER INTRODUCTIONAmit Sharma
 
Intro computeRRR
Intro computeRRRIntro computeRRR
Intro computeRRRGHOTRAANGEL
 
R tech introcomputer
R tech introcomputerR tech introcomputer
R tech introcomputerRose Rajput
 
Internet protocol
Internet protocolInternet protocol
Internet protocolOnline
 
introduction for computers
introduction for computersintroduction for computers
introduction for computersYogesh Chaure
 
Designs, Lessons and Advice from Building Large Distributed Systems
Designs, Lessons and Advice from Building Large Distributed SystemsDesigns, Lessons and Advice from Building Large Distributed Systems
Designs, Lessons and Advice from Building Large Distributed SystemsDaehyeok Kim
 
Digital Image Processing and gis software systems
Digital Image Processing and gis software systemsDigital Image Processing and gis software systems
Digital Image Processing and gis software systemsNirmal Kumar
 
Working of Volatile and Non-Volatile memory
Working of Volatile and Non-Volatile memoryWorking of Volatile and Non-Volatile memory
Working of Volatile and Non-Volatile memoryDon Caeiro
 
Intro computer fundamentals
Intro computer fundamentalsIntro computer fundamentals
Intro computer fundamentalsPrabhu Govind
 
Computer fundamental short information about input and output devices.
Computer fundamental short information about input and output devices.Computer fundamental short information about input and output devices.
Computer fundamental short information about input and output devices.HamaQarani
 
Computer Components
Computer ComponentsComputer Components
Computer ComponentsBeth Sockman
 
Hadoop on a personal supercomputer
Hadoop on a personal supercomputerHadoop on a personal supercomputer
Hadoop on a personal supercomputerPaul Dingman
 
MIPS Assembly Language I
MIPS Assembly Language IMIPS Assembly Language I
MIPS Assembly Language ILiEdo
 
Microsoft Windows Nt
Microsoft Windows NtMicrosoft Windows Nt
Microsoft Windows Ntisma ishak
 
Windows 3.1 (WFW) on vintage and modern hardware
Windows 3.1 (WFW) on vintage and modern hardwareWindows 3.1 (WFW) on vintage and modern hardware
Windows 3.1 (WFW) on vintage and modern hardwareyeokm1
 
How Computer work
How Computer workHow Computer work
How Computer workSpy Seat
 

Ähnlich wie Introduction to computers (20)

COMPUTER INTRODUCTION
COMPUTER INTRODUCTIONCOMPUTER INTRODUCTION
COMPUTER INTRODUCTION
 
Intro compute
Intro computeIntro compute
Intro compute
 
Intro computeRRR
Intro computeRRRIntro computeRRR
Intro computeRRR
 
Intro compute
Intro computeIntro compute
Intro compute
 
1mb copy of newdoc
1mb copy of newdoc 1mb copy of newdoc
1mb copy of newdoc
 
R tech introcomputer
R tech introcomputerR tech introcomputer
R tech introcomputer
 
Part 6 : Internet applications
Part 6 : Internet applicationsPart 6 : Internet applications
Part 6 : Internet applications
 
Internet protocol
Internet protocolInternet protocol
Internet protocol
 
introduction for computers
introduction for computersintroduction for computers
introduction for computers
 
Designs, Lessons and Advice from Building Large Distributed Systems
Designs, Lessons and Advice from Building Large Distributed SystemsDesigns, Lessons and Advice from Building Large Distributed Systems
Designs, Lessons and Advice from Building Large Distributed Systems
 
Digital Image Processing and gis software systems
Digital Image Processing and gis software systemsDigital Image Processing and gis software systems
Digital Image Processing and gis software systems
 
Working of Volatile and Non-Volatile memory
Working of Volatile and Non-Volatile memoryWorking of Volatile and Non-Volatile memory
Working of Volatile and Non-Volatile memory
 
Intro computer fundamentals
Intro computer fundamentalsIntro computer fundamentals
Intro computer fundamentals
 
Computer fundamental short information about input and output devices.
Computer fundamental short information about input and output devices.Computer fundamental short information about input and output devices.
Computer fundamental short information about input and output devices.
 
Computer Components
Computer ComponentsComputer Components
Computer Components
 
Hadoop on a personal supercomputer
Hadoop on a personal supercomputerHadoop on a personal supercomputer
Hadoop on a personal supercomputer
 
MIPS Assembly Language I
MIPS Assembly Language IMIPS Assembly Language I
MIPS Assembly Language I
 
Microsoft Windows Nt
Microsoft Windows NtMicrosoft Windows Nt
Microsoft Windows Nt
 
Windows 3.1 (WFW) on vintage and modern hardware
Windows 3.1 (WFW) on vintage and modern hardwareWindows 3.1 (WFW) on vintage and modern hardware
Windows 3.1 (WFW) on vintage and modern hardware
 
How Computer work
How Computer workHow Computer work
How Computer work
 

Mehr von VisualBee.com

Homenagem para luiz e marcos (shared using VisualBee)
Homenagem para luiz e marcos 
 (shared using VisualBee)Homenagem para luiz e marcos 
 (shared using VisualBee)
Homenagem para luiz e marcos (shared using VisualBee)VisualBee.com
 
PowerPoint Presentation (shared using VisualBee)
PowerPoint Presentation (shared using VisualBee)PowerPoint Presentation (shared using VisualBee)
PowerPoint Presentation (shared using VisualBee)VisualBee.com
 
PowerPoint Presentation (shared using http://VisualBee.com). (shared using Vi...
PowerPoint Presentation (shared using http://VisualBee.com). (shared using Vi...PowerPoint Presentation (shared using http://VisualBee.com). (shared using Vi...
PowerPoint Presentation (shared using http://VisualBee.com). (shared using Vi...VisualBee.com
 
The bible and I (shared using VisualBee)
The bible and I (shared using VisualBee)The bible and I (shared using VisualBee)
The bible and I (shared using VisualBee)VisualBee.com
 
bb (shared using VisualBee)
bb  
(shared using VisualBee)bb  
(shared using VisualBee)
bb (shared using VisualBee)VisualBee.com
 
Chua nhat III mua Thuong Nien - Nam C
Chua nhat III mua Thuong Nien - Nam CChua nhat III mua Thuong Nien - Nam C
Chua nhat III mua Thuong Nien - Nam CVisualBee.com
 
LA FE QUE AGRADA A DIOS
LA FE QUE AGRADA A DIOSLA FE QUE AGRADA A DIOS
LA FE QUE AGRADA A DIOSVisualBee.com
 
Martin Luther king JR
Martin Luther king JRMartin Luther king JR
Martin Luther king JRVisualBee.com
 
Diapositive 1 (shared using http://VisualBee.com).
Diapositive 1 (shared using http://VisualBee.com).Diapositive 1 (shared using http://VisualBee.com).
Diapositive 1 (shared using http://VisualBee.com).VisualBee.com
 

Mehr von VisualBee.com (20)

Homenagem para luiz e marcos (shared using VisualBee)
Homenagem para luiz e marcos 
 (shared using VisualBee)Homenagem para luiz e marcos 
 (shared using VisualBee)
Homenagem para luiz e marcos (shared using VisualBee)
 
PowerPoint Presentation (shared using VisualBee)
PowerPoint Presentation (shared using VisualBee)PowerPoint Presentation (shared using VisualBee)
PowerPoint Presentation (shared using VisualBee)
 
PowerPoint Presentation (shared using http://VisualBee.com). (shared using Vi...
PowerPoint Presentation (shared using http://VisualBee.com). (shared using Vi...PowerPoint Presentation (shared using http://VisualBee.com). (shared using Vi...
PowerPoint Presentation (shared using http://VisualBee.com). (shared using Vi...
 
The bible and I (shared using VisualBee)
The bible and I (shared using VisualBee)The bible and I (shared using VisualBee)
The bible and I (shared using VisualBee)
 
bb bb b
bb bb bbb bb b
bb bb b
 
bb (shared using VisualBee)
bb  
(shared using VisualBee)bb  
(shared using VisualBee)
bb (shared using VisualBee)
 
bb
bbbb
bb
 
loki
lokiloki
loki
 
ASH WEDNESDAY
ASH WEDNESDAYASH WEDNESDAY
ASH WEDNESDAY
 
hijospreferidos
hijospreferidoshijospreferidos
hijospreferidos
 
yo
yoyo
yo
 
hijo preferido
hijo preferidohijo preferido
hijo preferido
 
Alcoholismo
AlcoholismoAlcoholismo
Alcoholismo
 
west love
west lovewest love
west love
 
jaa
jaajaa
jaa
 
Chua nhat III mua Thuong Nien - Nam C
Chua nhat III mua Thuong Nien - Nam CChua nhat III mua Thuong Nien - Nam C
Chua nhat III mua Thuong Nien - Nam C
 
LA FE QUE AGRADA A DIOS
LA FE QUE AGRADA A DIOSLA FE QUE AGRADA A DIOS
LA FE QUE AGRADA A DIOS
 
Martin Luther king JR
Martin Luther king JRMartin Luther king JR
Martin Luther king JR
 
Diapositive 1 (shared using http://VisualBee.com).
Diapositive 1 (shared using http://VisualBee.com).Diapositive 1 (shared using http://VisualBee.com).
Diapositive 1 (shared using http://VisualBee.com).
 
my cara de empanaaa
my cara de empanaaamy cara de empanaaa
my cara de empanaaa
 

Introduction to computers

  • 1. Introduction to computers and programming
  • 2. Content • Hardware • Network • Information storage  Protocols  RAM, ROM  Packets  HD, DVD • Programming • Display  Algorithm  Images  Pseudocode  Characters (fonts)  Flowchart • File system/type • Languages  Encryption • Source code  Compression  Example
  • 6. Information storage • 1 bit • bit (1 or 0) • 8 bits • byte (octet) (28) • 16 bits • word (216) • 32 bits • double (232) • 64 bits • long double (264) Encoding information on a fixed element of length n with a base b gives bn non-redundant possibilities
  • 7. Information coding • Binary • How to count  0 or 1 128 64 32 16 8 4 2 1 1 0 1 1 0 1 0 1 • Octal  0-7 • 128+32+16+4+1= • Hexadecimal  181 (decimal)  265 (octal)  0-9+A-F  B5 (hexadecimal) • Decimal  0-9 • Signed vs unsigned  0 to 255  -127 to +127
  • 8. Operations on bits • Booleans: • Example tables  0 = false = no AND 0 1 0 0 0  1 = true = yes 1 0 1 • Operators: OR 0 1  AND 0 0 1  OR 1 1 1  XOR XOR 0 1  NOT 0 0 1 1 1 0
  • 9. RAM/ROM Memory mapping Address Values 10111001 • Size reminder: 0000 00001111 • Kilobyte Kb 210 ~103 0001 0002 11100011 • Megabyte Mb 220 ~106 .. • Gigabyte Gb 230 ~109 .. • Terabyte Tb 240 ~1012 .. • Petabyte Pb 250 ~1015 • … .. FFFF 00100100
  • 10. HD/DVD trac k sector hea d
  • 11. Display QuickTime™ et un décompresseur TIFF (non compressé) sont requis pour visionner cette image. • Screen pixel or dots • Fonts • Color coding: 32 bits • 1 pixel = 3 bytes of color (RGB)+1  Bitmap byte alpha channel (transparency)  Vectors • 1600x1200x4bytes=7,5 Mb!  TrueType, OpenType, PostScript
  • 12. Keyboard/Mouse • Each key (or combination • The mouse movements of keys) of the keyboard  1 to 4 bytes (vertical & sends a code to the horizontal) computer. • Buttons • The code is interpreted and  Clicked, pressed, rolled converted to the corresponding ASCII or buttons Unicode number.
  • 13. ASCII & Unicode • ASCII 7/8 bits • Unicode •  UTF-8/16/32 bits  ISO-8859 (Latin) • od -c od -h
  • 14. Software layers Files Data (.doc, .mp3) Software Word, scripts, mail, web browser… User Interface Quartz CLI, X-Windows Windows Operating MacOSX Linux Windows System ROM Firmware BIOS Hardware CPU, RAM, HD, DVD
  • 15. File systems • Method the OS uses to store information  Storage unit, directories, subdirectories (Windows, VMS)  Single arborescence (Linux, MacOSX, all Unix) • What exactly is a file?  a piece of information (text, graphic, data, music program, script)  it is identified by a name and an logical address (or path)  other informations: date, size, type, creator, ownership, physical address…
  • 16. File system organisation Disk 1 Disk 2 Disk 2 C: D: / DOCS PROGS CONFIG DATA Directories /usr /home Disk 1 WORD EXCEL EXPT1 EXPT2 Subdirectories local phil john bin lib emacs X11 Windows Unix
  • 17. Path • The path is the logical address used by the system or the user to locate a file. • Example: /bd_du_Palais/35/etage/4/appart/12/Dupont_ Jean.txt suffix filename path
  • 18. File types • Executable • Special cases in Unix  .exe  STDIN  .app  STDOUT  Unix requires « x »  STDERR • Data  Text (.txt)  Music (.mp3)  Image (.jpg, .gif)  Movie (.mpg, .mov)  Binary (.bin)
  • 19. Encryption / compression • Compression  Reducing the size of files  E.g., .mp3, .gz, .jpg, .zip • Encryption  Protecting your privacy  E.g., .pgp • Packing  Grouping the files  E.g., .tar
  • 20. Networks • Direct  USB 11Mb-480Mb  Ethernet 10Mb-1Gb • Wired  Modem 56Kb  ADSL 600Kb-8Mb  LAN 10Mb-10Gb • Wireless  Bluetooth 1Mb-20Mb  WIFI (AirPort) 11Mb-54Mb
  • 21. Network (ethernet or wireless) • Computer talk to each • Handshaking other via network • Transmission protocols • Ackowledgement  ip, tcp, http, ftp, … • TCP/IP • DNS  Domain Name Server  transmission control protocol/internet protocol • URL  Universal Resource Locator • IP addess  192.42.197.51
  • 22. DNS reminder 2 Root DNS 3 *.org 5 4 Local DNS Primary DNS dns.anywhere.net www.expasy.org 1 6 www.expasy.org ?? Client query Target server client.anywhere.net 129.194.8.64
  • 23. Packets The data travels within units called packets
  • 24. Packet breakout Usual TCP/IP payload per packet: 512 bytes
  • 26. What is a program? • How to cook? • The algorithm • Are you a programmer?
  • 27. Pseudocode • This is the pseudocode for a game of Monopoly
  • 30. Languages • Low level (processor dependent)  Machine code, assembler • High level: structured, procedural  Fortran, C, Pascal… • High level: object oriented  C++, Java, C#, Perl, Objective-C… • Virtual machines  Java, C#… • Scripting  Perl, Python, JavaScript…
  • 31. Source code -> Object code • Compiler+linker • Compiler+linker  Fortran, C, Pascal, C++…  Fast to execute, but slow to debug • Interpreter • Interpreter  Basic, Perl…  Slow to execute, but fast to debug (no need to recompile) • Intermediate • Intermediate  Java  Slow…
  • 32. Source code • Instructions • Data structures  Statement, blocks  Variable  Affectation  List  Operators  Array  Loops  Hash  Tests  Pointers  Subroutines  Objects  Comments
  • 33. Source code (2) • Statement, blocks • Variable  One or more  A region in memory instructions for the that can be modified processor  Exists in different • Affectation types  Change to a variable  Scalar, char, numeric, • Operator boolean  affect one or more  List, array variable  Hash  + * - / AND OR NOT…  Combination->data structure
  • 34. Source code (3) • Loops • Pointers  Allow the computer to  Reference to region in repeat blocks memory (address) • Tests • Objects  Decide what to do  Combination of data • Subroutines and code  Programs frequently called (functions) • Comments  The most important lines of the source code…
  • 35. Example: a text to treat « Noon rings out. A wasp, making an ominous sound, a sound akin to a klaxon or a tocsin, flits about. Augustus, who has had a bad night, sits up blinking and purblind. Oh what was that word (is his thought) that ran through my brain all night, that idiotic word that, hard as I'd try to pun it down, was always just an inch or two out of my grasp - fowl or foul or Vow or Voyal? - a word in a quizz which, by association, brought into play an incongruous mass and magma of nouns, idioms, slogans and sayings, a confusing, amorphous outpouring which I sought in vain to control or turn off but which wound around my mind a whirlwind of a cord, a whiplash of a cord, a cord that would split again and again, would knit again and again, of words without communication or any possibility of combination, words without pronunciation, signification or transcription but out of which, notwithstanding, was brought forth a flux, a continuous, compact and lucid flow: an intuition, a vacillating frisson of illumination as if caught in a flash of lightning or in a mist abruptly rising to unshroud an obvious sign - but a sign, alas, that would last an instant only to vanish for good. » Gilbert Adair
  • 36. Result… a=97 n=91 b=15 o=104 Do you see any problem?? c=26 p=15 d=35 q=1 f=23 r=43 g=32 s=59 h=44 t=77 Try with this: i=90 u=52 j=1 v=4 « The quick brown fox, jumps k=5 w=31 over the lazy dog. » l=33 x=2 m=17 y=13 z=2
  • 38. Source code example #!/usr/bin/perl -w # essential line of all perl scripts $filename = "avoid.txt"; # affect « avoid.txt » to the variable $filename # open the file, or exit open(FILE, $filename) || die "Cannot open file ‘$filename’nn"; @text = <FILE>; # add each line of the file to an array close FILE; foreach $line (@text) { # read one line from the array into $line and repeat for each line @table = split(//,$line); # read each character of the line in an array while ($char=pop(@table)) { # read one character of the array 'table' and repeat for all $char =~ s/[^a-z]//; # keep only the alphabetical character a to z if ($char) { # check if the character exists and execute the block $count{$char}++; # if yes, increment by one the hash 'count' } } } # print each character and its number of occurence one per line foreach $c (keys %count) { print "$c=$count{$c}n"; } exit; # quit the program
  • 39. Tips • Think about your • Test the code problem  For all the possible • Create a flowchart functions or cases (if possible) • Create the  Give it to users as a pseudocode beta (if not possibe) • Verify the memory  Sell it (if you work for used by your Microsoft©… ;-) variables • Debug • Write the code
  • 40. Summary of the week • Monday • Wednesday  Intro computers &  Object Oriented programming programming  BioPerl  Intro Unix  EMBOSS  Tutorial Unix • Thursday • Tuesday  Database indexing  Intro Perl  BLAST  Regexp & Perl In-liners  HTML & cgi-bin • Friday  Finish exercises  Users questions