A2 Units Flashcards
(98 cards)
What is a procedural programming language?
A language where the control flow is defined rather than the logic
What is a first-class object?
Any object that can be passed as an argument to a function
What is a high-order function?
A function that takes another function as an argument, or a function that returns another function
What does the map function do?
It takes a list of elements and applies a function to each item in the list
What dies the filter function do?
It returns a list of elements with specified values from another list
What does the reduce function do?
It recursively adds each successive element of a list, allowing for the entire lost to be represented as a single number
What is the head of a list?
The first element of a list
What does the application layer of the TCP/IP model do?
Determines which protocol is to be used when transmitting the data
What does the transport layer of the TCP/IP model do?
Splits data up into packets, numbers each packet, and applies a port number to each
What does the network layer of the TCP/IP model do?
Adds both source and destination IP addresses to each packet, forming sockets
What dies the link layer of the TCP/IP model do?
Adds the source and destination MAC addresses to packets
What is a Galois field of two elements?
A system used to find the dot product of two vectors in a logical way
What use is GF2?
Adding two vectors is like applying an AND bitwise operator, and multiplying vectors is like applying a XOR bitwise operator
Give one application of GF2
To find the parity of a string of bits
List every application layer protocol and their ports in order of increasing port number
FTP Data - 20 FTP Control - 21 SSH - 22 Telnet - 23 SMTP - 25 HTTP - 80/8080 POP3 - 110 IMAP - 143 HTTPS - 443
What does a question mark denote when used in a regular expression?
The previous character does not have to be present
What is the symbol to denote the OR bitwise operator in a regular expression?
|
What does the “-“ symbol represent in a regular expression?
A range of values
What is the purpose of a regular expression?
To determine whether a string is valid in a defined language
What is the syntax used when searching for an entire string in a regular expression?
Rounded brackets are used “()”
What is the syntax used when searching for individual characters?
Squared brackets “[]”
What does the “+” symbol denote in a regular expression?
A wildcard. There must be one or more of the preceding element present
What does the “*” symbol denote in a regular expression?
A wildcard. There can be 0+ of the preceding element
Give three advantages of functional programming paradigms
×Functions are very abstract, so are less prone to errors
×Functions are easier to test because a function will always give the same output
×It is easier to reuse functions with any level of data abstraction