Docsity

notes based on the slides, Appunti di Computer Graphics

Toggle sidebar
bg1
ICT: Information and Communication Technology, it is a science that deals with all the
technologies that have the function of elaborating, storing, and transporting of data.
HISTORY BACKGROUNDS
1. TELEGRAPH: first long-distance message in dots and line (MORSE code)
2. TELEPHONE: real-time voice communication
3. RADIO: first-time wireless transmission through waves, but only in smaller scale distance
since the waves are very long and easy to get stuck
4. SATELLITE COMMUNICATION: global communication through space-based relays
5. ARPANET (1969): first used as a military technology, but it is the base of the INTERNET
6. TCP/PROTOCOL (1983): a set of established rules that we use, which made the Internet
globally interoperable
7. WWW (1991)
TELECOMMUNICATIONS: from Stationary to Mobile
1. 1G First generation 1980s: analog voice communication, basic voice calls, low quality
2. 2G (1991): no more analog, but digital communication, allowing more storage of data and
sending messages SMS
3. 3G (2001): mobile broadband, with internet access and video streaming (2Mpbs)
4. 4G (2009): LTE technology, (1Gpbs) VoIP
5. 5G (2019): ultra-fast speeds 10 Gpbs, latency is low, and real-time application (VR and AR)
6. 6G (ca 2030): it should exceeds 1 Tpb with the integration of AI and computer base
Information technologies
calculator: any kind of instrument that can do the mathematical calculation by itself so the first
calculator is the Blaise Pascal in 1642.
Charles Babbage, here we start to store some data inside it and control flow, in addition here we have
the first design of the analytical engine (first time in the story)
Alan Turing (a great person that contributed a lot to modern science, 1930s-1940s): theoretical model
that demonstrated that any computation can be performed using a series of instructions (algorithm)
JOHN VON NEUMANN (1945): putting in practice the model founded by Turing, which is the basis
of the most modern computers, in addition, introduced also the idea of a stored program computer,
aboth data, and instructions
Early computers (1940s-1950s): ENIAC, the first model using vacuum tubes
● INPUT and OUTPUT devices
● CPU
● MEMORY
These are all BISTABLE DEVICES:
● the voltage level of an electrical conductor: high or low
● the state of magnetic polarization: positive or negative
● the state of the light in optical fiber: on or off
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Anteprima parziale del testo

Scarica notes based on the slides e più Appunti in PDF di Computer Graphics solo su Docsity!

ICT : Information and Communication Technology , it is a science that deals with all the

technologies that have the function of elaborating, storing, and transporting of data. HISTORY BACKGROUNDS

  1. TELEGRAPH : first long-distance message in dots and line (MORSE code)
  2. TELEPHONE : real-time voice communication
  3. RADIO : first-time wireless transmission through waves, but only in smaller scale distance since the waves are very long and easy to get stuck
  4. SATELLITE COMMUNICATION : global communication through space-based relays
  5. ARPANET (1969) : first used as a military technology, but it is the base of the INTERNET
  6. TCP/PROTOCOL (1983) : a set of established rules that we use, which made the Internet globally interoperable
  7. WWW (1991) TELECOMMUNICATIONS : from Stationary to Mobile
  8. 1G First generation 1980s: analog voice communication, basic voice calls, low quality
  9. 2G (1991): no more analog, but digital communication, allowing more storage of data and sending messages SMS
  10. 3G (2001): mobile broadband, with internet access and video streaming (2Mpbs)
  11. 4G (2009): LTE technology, (1Gpbs) VoIP
  12. 5G (2019): ultra-fast speeds 10 Gpbs, latency is low, and real-time application (VR and AR)
  13. 6G (ca 2030): it should exceeds 1 Tpb with the integration of AI and computer base

Information technologies calculator: any kind of instrument that can do the mathematical calculation by itself so the first calculator is the Blaise Pascal in 1642.

Charles Babbage , here we start to store some data inside it and control flow, in addition here we have the first design of the analytical engine (first time in the story)

Alan Turing (a great person that contributed a lot to modern science, 1930s-1940s): theoretical model that demonstrated that any computation can be performed using a series of instructions (algorithm)

JOHN VON NEUMANN (1945) : putting in practice the model founded by Turing, which is the basis of the most modern computers, in addition, introduced also the idea of a stored program computer, aboth data, and instructions

Early computers (1940s-1950s): ENIAC, the first model using vacuum tubes

● INPUT and OUTPUT devices ● CPU ● MEMORY These are all BISTABLE DEVICES: ● the voltage level of an electrical conductor: high or low ● the state of magnetic polarization: positive or negative ● the state of the light in optical fiber: on or off

All data and instructions are written in Binary System PROGRAMMING LANGUAGE set of instructions stored in the computer, so that once the computer receives the signals, it can start to solve the problem, i.e. process data Firstly developed in 1950s FORTRAN (scientific), COBOL (business) MICROPROCESSOR AND PERSONAL COMPUTER : since with development the computers can be used by no professional people, microprocessor that replace vacuum tubes INTERNET and WWW that revolutionised the way of sharing data MOBILE and Social Revolution : Social Media IoT and Cloud services (the technology became a part of the daily life) AI VR and Quantum Computing: development of immersive digital experiences through augmented reality, quantum computing can do factors numbers, and from this there can be developed other unencrype technology

ICT Tools: Software Hardware Network

hardware TRENDS: higher storage capacity, reduce size, extend functionality, higher processing speed

software TRENDS: ease of use, new way of access, new program language, ubiquituous use

application software: an app the users use to process data into information

NETWORK trends: 5G, ultra band, cloud computing, Internet of Things, from Web 2 to 3 The broad band speed is crucial for the economic growth, related also to personal and business productivity

DIGITALDIVIDE

Operating System : carries all the basic and fundamental instructions of the computer, and it is usually loaded in the RAM and launched at the opening of the computer

USE of CODES: the logical behind the well-formed sequences

Since in the recent period the devices are constructed as bistable devices, thus the information must be transmitted through a BINARY SYSTEM , no more based on the standard 10-based system.

BIT: 2 symbols BYTE: 8 bits, i.e. 16 symbols of 0 and 1

using the binary system there is a unique representation way

For image the number needed depends on the pixel

For the computer to process the data we need to provide them the right instruction to start, and initially, these instructions are string of long bits, written manually by technicians using special technical language: Machine Language

Remember that the programming language must be transformed into the machine language in 0 and 1 understandable by the computer

DATASET

A set of information gathered and organised into the matrix format, columns for fields (indicated by letters) and rows for records (indicated by numbers) To create appropriately a dataset it is necessary to consolidate the data: data cleaning, integration and homogenization SPREADSHEET Accessibility (intuitive and easy-to-use interface) ▪ Interactivity (automatic recalculation) ▪ Versatility (hundreds of mathematical, statistical, logical functions, etc.) ▪ Completeness (analysis tools: pivot tables, scenarios, solver, etc.) The workbook is a collection of worksheets

The spreadsheets accept the text string, numerical and logical values

Logical Values in functions

  • AND (v 1 , v 2 ) => T,F T: when both v 1 , v 2 are verified F: otherwise
  • OR (v1, v 2 ) => T,F T: when one of the two conditions are satisfied F: when both are absent
  • IF (condition, outcome 1, outcome 2) z SERIES OF FUNCTIONS:
  • IF
  • OR
  • IFS
  • SUM/MIN/MAX/AVERAGE
  • RANK.EQ
  • SUMPRODUCT
  • COUNTIFS, SUMIFS, AVERAGEIFS
  • DAY, MONTH, YEAR, HOUR, MINUTE, SECOND, WEEKDAY, TODAY, NOW, DATE, DATEDIF

- RIGHT, LEFT, MID, CONCATENATE, UPPER, LOWER, PROPER, LEN, SEARCH,

TRIM

PMT:Payment PPMT: Principal payment IPMT: Interest pmt FV:future value

PEMDAS (Parenthesis, Exponential, Multiplication, Division, Addiction, Subtraction)

the concept of variables. A variable is a name that represents a numerical value registered in the computer, it is registered through the Assignment Statement, whereas the “=” sign is called the assignment operator.

During the same session, different values can be assigned to the name, as long as another assignment statement takes place. If we just want to modify the value, the operation is called Update.

There is also the concept of Unpacking, multiple assignment.

NOTE: for float , we mean real numbers, while for bool, we mean the values of true and false

CONTROL STRUCTURE

It is the logical pattern according to which the program statements are executed. There are 3 types of control structures:

  • Sequential : the default one
  • Selection (decision-making structure) : used to execute alternative branches within the code, it establishes a series of conditions, and only those modules that satisfy the conditions can be involved. The computer only commands the conditions through the Conditional Structure/Statement.
  • Repetition : used to iterate a portion of code multiple times

Control Flow Statements regulate the control structure, they can be classified according to the type of control structure that they determine:

  • Conditional Statements: if , else , elif
  • Loops Statements: while , for , continue , break
  • Other: try , except , custom function calls (def)

There are three types of selectional control structures(selection structure) :

**- Simple decision-making structure

  • Alternative execution
  • Chained conditionals** As stated before, they need the implementation of conditional statements

IF STATEMENT: it is composed of Heading, indented block (when the clause is true), the rest of the script It implements Boolean expressions

  1. Single Alternative: If clause
  1. Double Alternative: If-else
  2. Chained conditionals:elif Elif Statement allows us to enter the statement for each possible case, it can be also combined with the else statement. There are also other Boolean Operators:
  • and
  • or
  • not The if function can be applied also to a range of values, as long as we use in

REMARK: == is used to equal, while when we are using the assignment statement it is enough =

Repetition structure is defined by iterative constructs that can execute repeatedly the same book

of statements (loops). These iterative constructs are called loops , which are subdivided into two categories:

  • loops controlled by condition
  • loops controlled by a counter : for FOR function execute the operations for each element of the range/sequence.

Built-in functions are immediately usable, others can be used only when we import the module, i.e. the library in which it is contained. There are also custom functions that are created to perform tasks and operations based on our needs. A function contains a set of instructions aiming at performing the functionality wanted. Apart from actions like: calculation, creating a subject, updating values, etc.. They are essential also for the creation of a modular program.

CUSTOM FUNCTIONS:

keyword def , name of the function that we want to customize, list of parameters(mandatory or

optional) => Header list of instructions, the custom function ends with a return statement, only when it must return a value to the calling instruction => Body By defining the function, the system only recognises what it should do when the function is typed; to execute it, we need to type the function followed by “()” or (parameters). There could be two types of custom functions:

  • productive function
  • void function The first one usually ends with the return statement return the value established by the instructions, and it can store the value in a variable.

We can have two types of variables:

  • Global variable: it can be reached by any instruction in a program
  • Local variable: it can be used only within the realm of a function

The concept of docstring , it is a string enclosed by triple quotes right after the header, it is the explanation we can see when we want to type a function.

The types of errors in python:

In an object-oriented program, like Python, a specific variable of a particular class is called an

instance.

A class is defined by methods and a set of attributes

To create a class we need to define its attributes and/or the methods:

  • The attributes can be given during the construction phase of the class through the usual assignment statement, but also through special methods, the constructor method def init

If we want to search for a specific object, i.e. for an instance, we need to check whether it can be defined through the constructor method:

  • if yes, then we type InstanceName = Classname(val1, val2,...)
  • if not, we approach with another method InstancaName.AttributeName = value

There is the distinction between the parent class and the child class, the latter one inherit all the attribute from the previous one and adds further attributes and methods

We can also access a file in Python using the open function but we need to attribute it to a variable to close the file we use the method .close

We can open the file in 4 modes:

  • read-only: r
  • write: w (in this case, if the file already exists, then it will be deleted, if not a new file will be created)
  • a: writing mode + the things that we enter into the file will be added at the end
  • +:it needs to be combined with r, w, or a, bc it allows both read and write mode

MODULES NLTK(Natural Language ToolKit) allows us to study the interactions between the the computer languages and the human languages TOKENIZATION For this process we mean the process to break a text into smaller pieces called tokens.

STOPWORDS The functions gives us a list of the stopwords, i.e.: and, or, is, etc..

WORDNET

It ia a large lexical dataset , which groups the words into groups and maps them into synonyms (=> SYNSET, the objets within the synset are called LEMMAS ). It shows us the conceptual relationship among them

SENTIMENT ANALYSIS Sentiment analysis is the process of determining whether a sentence expresses a positive, negative, or neutral sentiment

ex: items = ['apple', 'banana', 'cherry'] result = ', '.join(items) print(result)

  • .insert(index,element) => the ordinary method to insert smth within a list

DICTIONARY

  • .get(key) (returns the value)
  • .pop(key) (removes the item corresponding to the key, and returns the value)
  • .popitem (it removes the last item returns both value and key)
  • .items (it returns dict_items and returns the dictionary as a list of tuples(each tuple consisting )
  • .keys (like the previous one but return only the key)
  • .values (idem but returns the value)
  • init (it is with double underscores)
  • open (to access a file in Python)
  • .close
  • .readline
  • str
  • to add the new pair is => diction_name[key]=value
  • choice(list)
  • dir() is a function that allows us to check which modules are arealdy included in the file, or dir(math) which helps us determine which functions this module contains
  • random.randrange(integer) is very similar to the one we have encountered before, except the fact that it can use also the steps
  • openpyxl.load_workbook(Filename with its extension)
  • Workbookname[Sheet name]
  • sheetname.cell(x,y).value
  • file.save(filename.extesion)
  • nltk.corpus.stopwords.words(“languange”)
  • nltk.freqDist (it allows us to calculate the frequency of a word)
  • Text. max()
  • Text.most_common()
  • nltk.tokenize.word(or sent)_tokenize()
  • random.uniform(