Computer Science Notes (1) (1)
Computer Science Notes (1) (1)
● Dutch computer scientist E.W Dijkstra - “When all is said and done, the only
thing computers can do for us is to manipulate symbols and produce results of
such manipulations.”
● Computer - A device that can be programmed to carry out general purpose
logical/mathematical computations.
● Programmable Computer - Can be re-programmed to improve solutions, or
adapted when the problem changes. Can even be programmed to solve
different problems.
● General Purpose Computer - Can carry out a wide range of tasks, not built for
a specific purpose.
● Digital Computer - One that operates using digital signals.
● Signals - Used to represent changing information. Used to transmit
information from one place to another. Discrete, can only have a limited
number of values.
● Electronic Computer - A computer that operates through the use of electricity.
● Electricity - The movement of electrons through a material.
● Semiconductor - A material that falls somewhere between a conductor and an
insulator. E.g. Silicone. They can be used to control the flow of electricity
making modern computers possible.
● Modern Computers:
○ Able to carry out general purpose computation via programs.
○ Fairly inexpensive, robust and portable.
○ Have good performance.
○ Relatively good energy efficiency.
○ Fairly durable.
● Abacus - Aid to a person doing computations.
● Computers (people) - As early as the 17th century the term Computers
referred to people doing mathematical calculations.
● Slide rule - 1600s analog computer. Able to calculate:
○ Logarithms
○ Trigonometric functions
○ Squares
○ Cubes and their roots.
● Difference Engine - 1822 Charles Babbage designed a mechanical computer
used to calculate polynomials (x3+2x2+6x+2=0). Solved the problem of human
error in computing. Size of a car, thousands of moving parts.
● Analytical Engine - Charles Babbage, general purpose computer able to store
data on punched cards. Programmes stored on punched cards. Never built.
● Ada Lovelace - First computer programmer. Realised the Analytic Engine
could be used for general purpose computing, wrote programmes for it. Wrote
and published the first algorithm designed to be carried out by a machine.
● Percy Ludgate - Irish, designed a similar machine to Babbage’s Analytical
Engine, smaller and more portable, also never built.
● Turing Machine - Alan Turing, A-machine (automatic machine), a Turing
Machine provided a relatively simple theoretical “machine” that demonstrated
the true power of computing before computers as we know them existed.
Turing Machine consists of four parts:
○ A tape that symbols can be written to and read from.
○ A head that does the reading and writing.
○ A state register that stores the state of the machine at any given time.
○ A table of instructions that tells the machine what to do next, based on
the state of the machine and the symbol being read at the time.
● Vacuum Tubes - Small devices that control the flow of electricity.
● ENIAC - Electronic Numerical Integrator and Computer, First electronic,
digital, programmable, general purpose computer. Operated by plugging and
unplugging cables. Kathleen McNulty, an Irish woman, was one of the first
programmers to work on it.
● Transistors - Small electronic switches, performed the same job as a vacuum
tube but more efficiently.
● Integrated Circuits - Third Generation of Computers, a number of electronic
circuits on one semiconductor, a Chip. Example of one is the AGS (Apollo
Guidance System)
● Microprocessors - Fourth Generation, CPUs. 1971, Intel 4004.
● Personal Computers - PCs made possible by microprocessors with billions of
transistors. Called microcomputers at the time. Commodore, Apple, IBM.
Computers now usable by non-experts, development of OS (Operating
Systems) such as Windows, Displays, Hardware such as keyboards and
mice.
● GENERATIONS:
○ First Generation - Vacuum Tubes.
○ Second Generation - Transistors.
○ Third Generation - Integrated Circuits.
○ Fourth Generation - Microprocessors.
○ Potential Fifth Generation - Quantum Computing (Far future)
● Ireland and Supercomputers - 14 of the 500 fastest computers on Earth in
Ireland, One named Kay after Kathleen McNulty.
Computer Systems
Software Development
Computational Thinking
Modelling
Databases
● A way of organising data/information so that it can be accessed easily.
● They are useful because:
○ They store large amounts of data
○ They hold data in an organised way
○ Makes it faster to carry out searches
○ Freely available
○ Interact with different systems
● Flat File databases - Simplest database, single table.
● Attributes - Column name and the data it contains. Data is called fields.
● Records - Refers to one entry (column) in the table. AKA an instance.
● Data Types:
○ Varchar
○ Number
○ Date
● Varchar - Variable Character, like a string in python, a series of numbers,
letters and other characters.
● Number - A number that can be used in calculations.
● Date - Typically date/month/year, but can also be an integer value based on
number of days since 31/12/1899.
● CSV - Comma Separated Value, file type used to store flat file databases.
● Relational Databases - stores and provides access to data points that are
related to one another.
● Problems with single data tables:
○ Duplicate data
○ Wasted time replacing duplicate data
○ Wasted storage space
○ Hard to extract specific data
● Primary Key - a unique identifier generated to reference records.
● Foreign Key - an attribute that is created to link different tables.
● ERD - Entity Relationship Diagram. Used to visualise the relationship between
entities (tables).
HTML
● Markup language
● Uses tags rather than blocks of code
● Tags are always grounded by anchor brackets <>
● Closed using the /
● Metadata - information stored inside the <body> tag which stores info about
the website
● Attribute - provides extra info about an element eg class/id
● Comments - done using !-- inside an anchor bracket <!--p>content</p!-->
● Hyperlink - links two pages together using the anchor element <a>
● Absolute URL - Takes your to another URL
● Relative URL - Takes you to another page of the website you’re on
CSS
● Cascading Style Sheets
● Provides instructions on how the html should display its content
● Proposed by Håkon Wium Lee in 1994
Java Script
● Created by Brendan Eich in 1995
● Used to make a webpage interactive
● Introduced into a website using the <script> tag
● DOM - Document Object Model - A model of all the elements in a html
website used by the js code to trigger functions
● Can be used to modify HTML and CSS elements
● Same operators are used as in python except the increment and decrement
which use ++ and -- instead of += and -=
● Boolean operators
○ And &&
○ Or ||
○ Not !
● Variables are assigned using the syntax “var age=18”
● Lists are assigned as in python only using the var syntax as above
Cheeky revolut plug: