General Flashcards

1
Q

Fingerprinting

A

Fingerprinting is a technique that makes the name of a file dependent on the contents of the file. When the file contents change, the filename is also changed. For content that is static or infrequently changed, this provides an easy way to tell whether two versions of a file are identical, even across different servers or deployment dates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Cache busting

A

When a filename is unique and based on its content, HTTP headers can be set to encourage caches everywhere (whether at CDNs, at ISPs, in networking equipment, or in web browsers) to keep their own copy of the content. When the content is updated, the fingerprint will change. This will cause the remote clients to request a new copy of the content.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

CDN

A

A content delivery network or content distribution network (CDN) is a large distributed system of servers deployed in multiple data centers across the Internet. The goal of a CDN is to serve content to end-users with high availability and high performance. CDNs serve a large fraction of the Internet content today, including web objects (text, graphics and scripts), downloadable objects (media files, software, documents), applications (e-commerce, portals), live streaming media, on-demand streaming media, and social networks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Single Responsibility Principle

A

In object-oriented programming, the single responsibility principle states that every class should have a single responsibility, and that responsibility should be entirely encapsulated by the class. All its services should be narrowly aligned with that responsibility.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

SOLID (Principles)

A

In computer programming, SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion) is a mnemonic acronym introduced by Michael Feathers for the “first five principles” named by Robert C. Martin[1][2] in the early 2000s[3] that stands for five basic principles of object-oriented programming and design. The principles, when applied together, intend to make it more likely that a programmer will create a system that is easy to maintain and extend over time.[3] The principles of SOLID are guidelines that can be applied while working on software to remove code smells by causing the programmer to refactor the software’s source code until it is both legible and extensible. It is part of an overall strategy of agile and adaptive programming.[3]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The Open/Closed Principle

A

In object-oriented programming, the open/closed principle states “software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification”. That is, such an entity can allow its behaviour to be extended without modifying its source code. This is especially valuable in a production environment, where changes to source code may necessitate code reviews, unit tests, and other such procedures to qualify it for use in a product: code obeying the principle doesn’t change when it is extended, and therefore needs no such effort.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Liskov Substitution Principle

A

Substitutability is a principle in object-oriented programming. It states that, in a computer program, if S is a subtype of T, then objects of type T may be replaced with objects of type S (i.e., objects of type S may substitute objects of type T) without altering any of the desirable properties of that program (correctness, task performed, etc.). More formally, the Liskov substitution principle (LSP) is a particular definition of a subtyping relation, called (strong) behavioral subtyping, that was initially introduced by Barbara Liskov in a 1987 conference keynote address entitled Data abstraction and hierarchy. It is a semantic rather than merely syntactic relation because it intends to guarantee semantic interoperability of types in a hierarchy, object types in particular.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Chain-of-responsibility Pattern

A

In object-oriented design, the chain-of-responsibility pattern is a design pattern consisting of a source of command objects and a series of processing objects.[1] Each processing object contains logic that defines the types of command objects that it can handle; the rest are passed to the next processing object in the chain. A mechanism also exists for adding new processing objects to the end of this chain.

This pattern promotes the idea of loose coupling, which is considered a programming best practice.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

REST(ful)

A

Representational State Transfer (REST) is a software architecture style consisting of guidelines and best practices for creating scalable web services. REST is a coordinated set of constraints applied to the design of components in a distributed hypermedia system that can lead to a more performant and maintainable architecture.

REST has gained widespread acceptance across the Web as a simpler alternative to SOAP and WSDL-based Web services. RESTful systems typically, but not always, communicate over the Hypertext Transfer Protocol with the same HTTP verbs (GET, POST, PUT, DELETE, etc.) used by web browsers to retrieve web pages and send data to remote servers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Web-Service

A

A Web service is a method of communication between two electronic devices over a network. It is a software function provided at a network address over the Web with the service always on as in the concept of utility computing. The W3C defines a Web service generally as:
A software system designed to support interoperable machine-to-machine interaction over a network.

We can identify two major classes of Web services:

  1. REST-compliant Web services, in which the primary purpose of the service is to manipulate XML representations of Web resources using a uniform set of stateless operations;
  2. Arbitrary Web services, in which the service may expose an arbitrary set of operations.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

XHR

A

XMLHttpRequest (XHR) is an API available to web browser scripting languages such as JavaScript. It is used to send HTTP or HTTPS requests to a web server and load the server response data back into the script. Development versions of all major browsers support URI schemes beyond http and https, in particular, blob URLs are supported.
Data from the response can be used to alter the current document in the browser window without loading a new web page, and despite the name of the API, this data can be in the form of not only XML but also JSON, HTML or plain text.The response data can also be evaluated by client-side scripting. For example, if it was formatted as JSON by the web server, it can be converted into a client-side data object for further use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

BDD

A

Behavior-driven development (BDD) is a software development process that emerged from test-driven development. It combines the general techniques and principles of TDD with ideas from domain-driven design and object-oriented analysis and design to provide software development and management teams with shared tools and a shared process to collaborate on software development.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

TDD

A

Test-driven development is a software development process that relies on the repetition of a very short development cycle: first the developer writes an (initially failing) automated test case that defines a desired improvement or new function, then produces the minimum amount of code to pass that test, and finally refactors the new code to acceptable standards. Kent Beck, who is credited with having developed or ‘rediscovered’ the technique, stated in 2003 that TDD encourages simple designs and inspires confidence

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

HTTP Referer

A

HTTP referer is an HTTP header field that identifies the address of the webpage that linked to the resource being requested. By checking the referer, the new webpage can see where the request originated.
In the most common situation this means that when a user clicks a hyperlink in a web browser, the resulting request includes the referer field, which indicates the last page the user was on.
Referer logging is used to allow websites and web servers to identify where people are visiting them from, for promotional or statistical purposes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

CGI

A

Common Gateway Interface (CGI) is a standard method used to generate dynamic content on Web pages and Web applications. CGI, when implemented on a Web server, provides an interface between the Web server and programs that generate the Web content. These programs are known as CGI scripts or simply CGIs; they are usually written in a scripting language, but can be written in any programming language.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Sandy Metz’ 5 OO-Principles

A
  1. Classes can be no longer than 100 LOC
  2. Methods can be no longer than 5 LOC
  3. You can pass no more than 4 parameters
  4. Controller actions can only instantiate 1 object
  5. You can pass only one instance variable to a view
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Model–View–Presenter

A

Model–view–presenter (MVP) is where the model–view–controller (MVC) pattern derives from. It is used mostly for building user interfaces. In MVP the presenter assumes the functionality of the “middle-man”. In MVP, all presentation logic is pushed to the presenter. It is engineered to facilitate automated unit testing and improve the separation of concerns in presentation logic:

  • The model is an interface defining the data to be displayed or otherwise acted upon in the user interface.
  • The view is a passive interface that displays data (the model) and routes user commands (events) to the presenter to act upon that data.
  • The presenter acts upon the model and the view. It retrieves data from repositories (the model), and formats it for display in the view.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Reactor Pattern

A

The Reactor design pattern is an event handling pattern for handling service requests delivered concurrently to a service handler by one or more inputs. The service handler then demultiplexes the incoming requests and dispatches them synchronously to the associated request handlers.
All reactor systems are single threaded by definition, but can exist in a multithreaded environment.

Benefits
The reactor pattern completely separates application specific code from the reactor implementation, which means that application components can be divided into modular, reusable parts. Also, due to the synchronous calling of request handlers, the reactor pattern allows for simple coarse-grain concurrency while not adding the complexity of multiple threads to the system.

Limitations
The reactor pattern can be more difficult to debug[2] than a procedural pattern due to the inverted flow of control. Also, by only calling request handlers synchronously, the reactor pattern limits maximum concurrency, especially on Symmetric multiprocessing hardware. The scalability of the reactor pattern is limited not only by calling request handlers synchronously, but also by the demultiplexer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Unit Testing

A

A software testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine whether they are fit for use. Intuitively, one can view a unit as the smallest testable part of an application. In procedural programming, a unit could be an entire module, but it is more commonly an individual function or procedure. In object-oriented programming, a unit is often an entire interface, such as a class, but could be an individual method. Unit tests are created during the development process. It is also known as component testing.

Ideally, each test case is independent from the others. Substitutes such as method stubs, mock objects, fakes, and test harnesses can be used to assist testing a module in isolation. Unit tests are typically written and run by software developers to ensure that code meets its design and behaves as intended.

20
Q

Mock Object

A

In object-oriented programming, mock objects are simulated objects that mimic the behavior of real objects in controlled ways. Similar to a car designer that uses a crash test dummy to simulate the dynamic behavior of a human in vehicle impacts. If an actual object has any of the following characteristics, it may be useful to use a mock object in its place:

  1. The object supplies non-deterministic results
  2. It has states that are difficult to create or reproduce
  3. It is slow
  4. It does not yet exist or may change behavior;
  5. it would have to include information and methods exclusively for testing purposes
21
Q

Dependency Injection

A

In software engineering, DI is a design pattern that implements inversion of control for software libraries, where the caller delegates to an external framework the control flow of discovering and importing a service or module. DI allows a program design to follow the dependency inversion principle where modules are loosely coupled. With DI, the client part of a program which uses a module or service doesn’t need to know all its details, and typically the module can be replaced by another one of similar characteristics without altering the client.

An injection is the passing of a dependency (a service) to a dependent object (a client). The service is made part of the client’s state. Passing the service to the client, rather than allowing a client to build or find the service, is the fundamental requirement of the pattern.

There are three common forms of dependency injection: setter-, interface- and constructor-based injection, where the responsibility of injecting the dependency lies upon the client, the service or the constructor method respectively.

22
Q

Principle of least astonishment (POLA)

A

The principle of least astonishment applies to user interface and software design, from the ergonomics standpoint. It is alternatively referred to as the law or rule of least astonishment, or of least surprise. “If a necessary feature has a high astonishment factor, it may be necessary to redesign the feature.”
A textbook formulation is “People are part of the system. The design should match the user’s experience, expectations, and mental models.” What is least surprising may however depend on the expected audience, e.g. end users, programmers or system administrators.
In more practical terms, the principle aims to exploit users’ pre-existing knowledge as a way to minimize the learning curve for instance by designing interfaces borrowing heavily from “functionally similar or analogous programs with which your users are likely to be familiar.” User expectations in this respect may be closely related to a particular computing platform or tradition. In more abstract settings like an API, the expectation that function or method names intuitively match their behaviour is another example. This practice also involves the application of sensible defaults.

When two elements of an interface conflict, or are ambiguous, the behavior should be that which will least surprise the user; in particular a programmer should try to think of the behavior that will least surprise someone who uses the program, rather than that behavior that is natural from knowing the inner workings of the program.

23
Q

AJAX

A

Ajax (short for asynchronous JavaScript and XML) is used on the client-side to create asynchronous Web apps. With Ajax, apps can send data to and retrieve from a server asynchronously (in the background) without interfering with the display and behavior of the existing page. Data can be retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not required (JSON is often used in the AJAJ variant), and the requests do not need to be asynchronous.
Ajax is not a single technology, but a group of technologies. The DOM is accessed with JavaScript to dynamically display – and allow the user to interact with – the information presented. JavaScript and the XMLHttpRequest object provide a method for exchanging data asynchronously between browser and server to avoid full page reloads.

24
Q

BLOB

A

A Binary Large OBject (BLOB) is a collection of binary data stored as a single entity in a database management system. Blobs are typically images, audio or other multimedia objects, though sometimes binary executable code is stored as a blob. Database support for blobs is not universal.
Blobs were originally just amorphous chunks of data invented by Jim Starkey at DEC, who describes them as “the thing that ate Cincinnati, Cleveland, or whatever” from “the 1958 Steve McQueen movie”, referring to The Blob. Later, Terry McKiever, a marketing person for Apollo, felt that it needed to be an acronym and invented the backronym Basic Large Object. Then Informix invented an alternative backronym, Binary Large Object.
“Blobbing” originally meant moving large amounts of data from one database to another without filters or error correction. This is fast because it puts the responsibility for error checking and filtering on the new host for the data.
The data type and definition was introduced to describe data not originally defined in traditional computer database systems, particularly because it was too large to store practically at the time the field of database systems was first being defined in the 1970s and 1980s.

25
Q

WebSocket

A

WebSocket is a protocol providing full-duplex communications channels over a single TCP connection.
It is designed to be implemented in web browsers and web servers, but it can be used by any client or server application. The WebSocket Protocol is an independent TCP-based protocol. Its only relationship to HTTP is that its handshake is interpreted by HTTP servers as an Upgrade request. lt makes more interaction between a browser and a website possible, facilitating live content and the creation of real-time games. This is made possible by providing a standardized way for the server to send content to the browser without being solicited by the client, and allowing for messages to be passed back and forth while keeping the connection open. In this way a two-way (bi-directional) ongoing conversation can take place between a browser and the server. A similar effect has been achieved in non-standardized ways using stop-gap technologies such as Comet.
In addition, the communications are done over TCP port number 80, which is of benefit for those environments which block non-web Internet connections using a firewall. The WebSocket protocol is currently supported in most major browsers including Google Chrome, Internet Explorer, Firefox, Safari and Opera. WebSocket also requires web applications on the server to support it.

26
Q

XPath

A

Die XML Path Language (XPath) ist eine vom W3-Konsortium entwickelte Abfragesprache, um Teile eines XML-Dokumentes zu adressieren und auszuwerten. XPath dient als Grundlage einer Reihe weiterer Standards wie XSLT, XPointer und XQuery.

27
Q

Headless (system / mode)

A

Als headless, also kopflos, bezeichnet man Computer, meist Serversysteme, die über keinen Bildschirm oder sonstige grafische Ausgabe verfügen. Diese Systeme haben als Steuerungsmöglichkeit in vielen Fällen eine Netzwerkverbindung, die einen Zugriff über SSH oder andere Terminaldienste ermöglicht, in neueren Fällen oft auch über Web-Frontends.

Alternativ gibt es auch Server, die mit einem KVM-Switch zusammengeschlossen sind. Da die Aufgabe dieser Rechner meist die gleichen sind fallen auch diese in die Kategorie „headless“.

28
Q

SSH

A

Secure Shell, or SSH, is a cryptographic (encrypted) network protocol for initiating text-based shell sessions on remote machines in a secure way. This allows a user to run commands on a machine’s command prompt without them being physically present near the machine. It also allows a user to establish a secure channel over an insecure network in a client-server architecture, connecting an SSH client application with an SSH server. Common applications include remote command-line login and remote command execution, but any network service can be secured with SSH. The protocol specification distinguishes between two major versions, referred to as SSH-1 and SSH-2.

29
Q

Unicorn Application Server

A

Unicorn is a very mature web application server for Ruby/Rack based web applications. It is fully-featured, but it denies by design trying to do everything. Unicorn’s principal is doing what needs to be done by a web application server and delegating rest of the responsibilities.

Unicorn’s master process spawns workers, as per your requirements, to serve the requests. This process also monitors the workers in order to prevent memory and process related staggering issues. What this means for system administrators is that it will kill a process if, for example, it takes too much time to complete a task or memory issues occur.

As mentioned above, one of the areas in which Unicorn delegates tasks is using the operating system for load balancing. This allows the requests not to pile up against busy workers spawned.

30
Q

reverse proxy

A

In computer networks, a reverse proxy is a type of proxy server that retrieves resources on behalf of a client from one or more servers. These resources are then returned to the client as though they originated from the proxy server itself.[1] While a forward proxy acts as an intermediary for its associated clients to contact any server, a reverse proxy acts as an intermediary for its associated servers to be contacted by any client.

31
Q

script(ing) language

A

A programming language that supports scripts, programs written for a special run-time environment that can interpret (rather than compile) and automate the execution of tasks that could alternatively be executed one-by-one by a human operator. Environments that can be automated through scripting include software applications, web pages within a web browser, the shells of operating systems (OS), and embedded systems. A scripting language can be viewed as a domain-specific language for a particular environment; in the case of scripting an application, this is also known as an extension language. Scripting languages are also sometimes referred to as very high-level programming languages, as they operate at a high level of abstraction, or as control languages, particularly for job control languages on mainframes.

32
Q

Cross-origin resource sharing

A

CORS is a mechanism that enables many resources (e.g. fonts, JavaScript, etc.) on a web page to be requested from another domain outside the domain from which the resource originated.

A web page may freely embed images, stylesheets, scripts, iframes, videos and some plugin content from any other domain. However embedded web fonts and AJAX (XMLHttpRequest) requests have traditionally been limited to accessing the same domain as the parent web page (as per the same-origin security policy). “Cross-domain” AJAX requests are forbidden by default because of their ability to perform advanced requests (POST, PUT, DELETE and other types of HTTP requests, along with specifying custom HTTP headers) that introduce many security issues as described in cross-site scripting.

CORS defines a way in which a browser and server can interact to safely determine whether or not to allow the cross-origin request. It allows for more freedom and functionality than purely same-origin requests, but is more secure than simply allowing all cross-origin requests. It is a recommended standard of the W3C.

33
Q

hash fragment / fragment identifier

A

In computer hypertext, a fragment identifier is a short string of characters that refers to a resource that is subordinate to another, primary resource. The primary resource is identified by a Uniform Resource Identifier (URI), and the fragment identifier points to the subordinate resource.

The fragment identifier introduced by a hash mark # is the optional last part of a URL for a document. It is typically used to identify a portion of that document. The generic syntax is specified in RFC 3986. The hash mark separator in URIs does not belong to the fragment identifier.

34
Q

Media Type

A

A media type is a two-part identifier for file formats on the Internet. First they were named MIME (Multipurpose Internet Mail Extensions) types. They became known as media types when it became apparent that their usage had expanded to protocols which did not relate specifically to mail.

A media type is composed of a type, a subtype, and optional parameters. As an example, an HTML file might be designated text/html; charset=UTF-8. In this example text is the type, html is the subtype, and charset=UTF-8 is an optional parameter indicating the character encoding.

top-level type name / subtype name [ ; parameters ]

The currently registered top-level type names are: application, audio, example, image, message, model, multipart, text, video.

Sub-type name typically consists of a media type name, but it may or must also contain other content, such as tree prefix (facet), producer’s name, product name or suffix - according the different rules in registration trees.

35
Q

Parkinson’s Law of Triviality

A

Parkinson’s law of triviality, also known as bikeshedding, bike-shed effect, and the bicycle-shed example, is C. Northcote Parkinson’s 1957 argument that organisations give disproportionate weight to trivial issues. Parkinson observed that a committee whose job was to approve plans for a nuclear power plant spent the majority of its time on discussions about relatively unimportant issues, such as what materials to use for the staff bike-shed, while neglecting the proposed design of the nuclear power plant itself, which is far more difficult and complex task to criticise constructively.

The law has been applied to software development[2] and other activities. The term “bikeshedding” was coined as a metaphor to illuminate Parkinson’s law of triviality;

36
Q

Atom (Standard)

A

The name Atom applies to a pair of related Web standards. The Atom Syndication Format is an XML language used for web feeds, while the Atom Publishing Protocol (AtomPub or APP) is a simple HTTP-based protocol for creating and updating web resources.

Web feeds allow software programs to check for updates published on a website. To provide a web feed, the site owner may use specialized software (such as a content management system) that publishes a list (or “feed”) of recent articles or content in a standardized, machine-readable format. The feed can then be downloaded by programs that use it, like websites that syndicate content from the feed, or by feed reader programs that allow Internet users to subscribe to feeds and view their content.

A feed contains entries, which may be headlines, full-text articles, excerpts, summaries, and/or links to content on a website, along with various metadata.

The Atom format was developed as an alternative to RSS. Ben Trott, an advocate of the new format that became Atom, believed that RSS had limitations and flaws—such as lack of on-going innovation and its necessity to remain backward compatible— and that there were advantages to a fresh design.[1]

37
Q

Decorator pattern

A

In object-oriented programming, the decorator pattern (also known as Wrapper, an alternative naming shared with the Adapter pattern) is a design pattern that allows behavior to be added to an individual object, either statically or dynamically, without affecting the behavior of other objects from the same class.[1] The decorator pattern is often useful for adhering to the Single Responsibility Principle, as it allows functionality to be divided between classes with unique areas of concern.

38
Q

XPath

A

XPath is the result of an effort to provide a common syntax and semantics for functionality shared between XSL Transformations and XPointer. The primary purpose of XPath is to address parts of an XML document. In support of this primary purpose, it also provides basic facilities for manipulation of strings, numbers and booleans. XPath uses a compact, non-XML syntax to facilitate use of XPath within URIs and XML attribute values. XPath operates on the abstract, logical structure of an XML document, rather than its surface syntax. XPath gets its name from its use of a path notation as in URLs for navigating through the hierarchical structure of an XML document.

39
Q

XSLT (Extensible Stylesheet Language Transformation)

A

XSLT is a language for transforming XML documents into other XML documents or other formats such as HTML for web pages, plain text or into XSL Formatting Objects, which may subsequently be converted to other formats, such as PDF, PostScript and PNG.

The original document is not changed; rather, a new document is created based on the content of an existing one. Typically, input documents are XML files, but anything from which the processor can build an XQuery and XPath Data Model can be used, for example relational database tables, or geographical information systems.

XSLT is a Turing-complete language, meaning it can specify any computation that can be performed by a computer.

40
Q

XPointer

A

XPointer is a system for addressing components of XML based Internet media. It is divided among four specifications: a “framework” that forms the basis for identifying XML fragments, a positional element addressing scheme, a scheme for namespaces, and a scheme for XPath-based addressing.

The XPointer language is designed to address structural aspects of XML, including text content and other information objects created as a result of parsing the document. Thus, it could be used to point to a section of a document highlighted by a user through a mouse drag action.

41
Q

POSIX

A

POSIX, an acronym for Portable Operating System Interface, is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines the application programming interface (API), along with command line shells and utility interfaces, for software compatibility with variants of Unix and other operating systems

42
Q

HTTP Header (fields)

A

HTTP header fields are components of the header section of request and response messages in HTTP. They define the operating parameters of an HTTP transaction.

43
Q

Finite-state machine

A

A finite-state machine (FSM) or finite-state automaton is a mathematical model of computation used to design both computer programs and sequential logic circuits. It is conceived as an abstract machine that can be in one of a finite number of states. The machine is in only one state at a time; the state it is in at any given time is called the current state. It can change from one state to another when initiated by a triggering event or condition; this is called a transition. A particular FSM is defined by a list of its states, its initial state, and the triggering condition for each transition.

FSMs can model a large number of problems, among which are electronic design automation, communication protocol design, language parsing and other engineering applications. In linguistics, they are used to describe simple parts of the grammars of natural languages.

Considered as an abstract model of computation, the finite state machine has less computational power than some other models of computation such as the Turing machine. That is, there are tasks that no FSM can do, but some Turing machines can. This is because the FSM memory is limited by the number of states.

FSMs are studied in the more general field of automata theory.

44
Q

Turing machine

A

A Turing machine is an abstract machine that manipulates symbols on a strip of tape according to a table of rules; to be more exact, it is a mathematical model of computation that defines such a device. Despite the model’s simplicity, given any computer algorithm, a Turing machine can be constructed that is capable of simulating that algorithm’s logic.

The machine operates on an infinite memory tape divided into cells. The machine positions its head over a cell and “reads” the symbol there. Then per the symbol and its present place in a finite table of user-specified instructions the machine (i) writes a symbol (e.g. a digit or a letter from a finite alphabet) in the cell (some models allowing symbol erasure and/or no writing), then (ii) either moves the tape one cell left or right (some models allow no motion, some models move the head), then (iii) (as determined by the observed symbol and the machine’s place in the table) either proceeds to a subsequent instruction or halts the computation.

The Turing machine was invented in 1936 by Alan Turing, who called it an a-machine (automatic machine). With this model Turing was able to answer two questions in the negative: (1) Does a machine exist that can determine whether any arbitrary machine on its tape is “circular” (e.g. freezes, or fails to continue its computational task); similarly, (2) does a machine exist that can determine whether any arbitrary machine on its tape ever prints a given symbol. Thus by providing a mathematical description of a very simple device capable of arbitrary computations, he was able to prove properties of computation in general - and in particular, the uncomputability of the Hilbert Entscheidungsproblem (“decision problem”).

Thus, Turing machines prove fundamental limitations on the power of mechanical computation. While they can express arbitrary computations, their minimalistic design makes them unsuitable for computation in practice: real-world computers are based on different designs that, unlike Turing machines, use random-access memory.

Turing completeness is the ability for a system of instructions to simulate a Turing machine. A programming language that is Turing complete is theoretically capable of expressing all tasks accomplishable by computers; nearly all programming languages are Turing complete if the limitations of finite memory are ignored.

45
Q

REPL

A

A read–eval–print loop (REPL), also known as an interactive toplevel or language shell, is a simple, interactive computer programming environment that takes single user inputs (i.e. single expressions), evaluates them, and returns the result to the user; a program written in a REPL environment is executed piecewise. The term is most usually used to refer to programming interfaces similar to the classic Lisp machine interactive environment. Common examples include command line shells and similar environments for programming languages, and is particularly characteristic of scripting languages.

46
Q

Lambda Calculus

A

Lambda calculus (also written as λ-calculus) is a formal system in mathematical logic for expressing computation based on function abstraction and application using variable binding and substitution. It is a universal model of computation that can be used to simulate any single-taped Turing machine and was first introduced by mathematician Alonzo Church in the 1930s as part of an investigation into the foundations of mathematics.

Computable functions are a fundamental concept within computer science and mathematics. The λ-calculus provides a simple semantics for computation, enabling properties of computation to be studied formally. The λ-calculus incorporates two simplifications that make this semantics simple.

The first simplification is that the λ-calculus treats functions “anonymously”, without giving them explicit names.

The second simplification is that the λ-calculus only uses functions of a single input. An ordinary function that requires two inputs, for instance the {\textstyle \operatorname {square_sum} } {\textstyle \operatorname {square_sum} } function, can be reworked into an equivalent function that accepts a single input, and as output returns another function, that in turn accepts a single input.

47
Q

Arity

A

In logic, mathematics, and computer science, the arity of a function or operation is the number of arguments or operands that the function takes. The arity of a relation (or predicate) is the dimension of the domain in the corresponding Cartesian product. (A function of arity n thus has arity n+1 considered as a relation.) The term springs from words like unary, binary, ternary, etc. Unary functions or predicates may be also called “monadic”; similarly, binary functions may be called “dyadic”.

In mathematics arity may also be named rank but this word can have many other meanings in mathematics. In logic and philosophy, arity is also called adicity and degree. In linguistics, arity is usually named valency.

In computer programming, there is often a syntactical distinction between operators and functions; syntactical operators usually have arity 0, 1, or 2 (the ternary operator ?: is also common). Functions vary widely in the number of arguments, though large numbers can become unwieldy. Some programming languages also offer support for variadic functions, i.e., functions syntactically accepting a variable number of arguments.