# links

title: using API Gateway as Lambda trigger
href: zk/Practical_walkthrough_Lambda_creation_within_AWS.md
type: markdown
snippet:
  See
  [using API Gateway as Lambda trigger](Practical_walkthrough_Lambda_creation_within_AWS.md)
  for a basic example of usage.


title: Fetch from Secrets Manager
href: zk/Fetch_from_Secrets_Manager.md
type: markdown
snippet:
  See
  [Fetch from Secrets Manager](Fetch_from_Secrets_Manager.md)
  for a code example of retrieving a value from Secrets Manager.


title: factors and divisors
href: zk/Factors_and_divisors.md
type: markdown
snippet:
  Given the symmetry between
  [factors and divisors](Factors_and_divisors.md) these
  properties are related. Note however that the LCM is more generic: it applies to
  any set of numbers not just fractions. Whereas the LCD is explicitly to do with
  fractions (hence 'denominator').


title: increase the complexity
href: zk/Why_computers_use_binary.md#from-circuits-to-programs
type: markdown
snippet:
  Although a digital system could use more than two symbols, adding more would
  [increase the complexity](Why_computers_use_binary.md#from-circuits-to-programs)
  and cost of the system. A set of only two symbols allows for simplified hardware
  and improved reliability.


title: schema
href: zk/Apollo_Server.md#example-schema
type: markdown
snippet:
  We will be working with the
  > [schema](Apollo_Server.md#example-schema) we defined
  > when working on the server


title: resolver
href: zk/Apollo_Server.md#implementing-resolvers
type: markdown
snippet:
  Therefore, for each query in the schema we must write a frontend implementation.
  We do this with **query constants**. The frontend implementation has a backend
  analogue: the
  [resolver](Apollo_Server.md#implementing-resolvers)
  that is invoked when the frontend issues a query. The schema standardises this
  relationship so that every query on the client must have a corresponding
  resolver on the backend.


title: Routing
href: zk/Routing.md
type: markdown
snippet:
  If you are using React Router `App` becomes the index for the different page
    components. See [Routing](Routing.md) for more detail.


title: logic gates
href: zk/Logic_gates.md
type: markdown
snippet:
  The ALU comprises
  [logic gates](Logic_gates.md) that
  execute the instructions passed from memory and where the data stored by the
  registers is acted upon. A processor's ALU is just a complex combinatorial logic
  circuit.


title: full-adders and half adders
href: zk/Half_adder_and_full_adder.md
type: markdown
snippet:
  It executes arithmetic and logical operations on binary numbers and where you
  will find operations conducted by
  [full-adders and half adders](Half_adder_and_full_adder.md)
  etc.


title: fetch, decode, execute cycle
href: zk/Fetch_decode_execute.md
type: markdown
snippet:
  More specifically, the ALU is responsible for the _execute_ phase of the
  [fetch, decode, execute cycle](Fetch_decode_execute.md).


title: Basic properties of sets
href: zk/Basic properties of sets.md
type: markdown
snippet:
  The basic notions of set theory are defined in
  [Basic properties of sets](Basic%20properties%20of%20sets.md). There we
  introduced a formal syntax that will be utilised to define the axioms. For easy
  reference:


title: hexadecimal
href: zk/Hexadecimal_number_system.md
type: markdown
snippet:
  To distinguish numbers in binary from decimal or
  [hexadecimal](Hexadecimal_number_system.md)
  numbers, it is common to use the prefix `0b`. Thus, e.g, `0b110` for decimal
  `6`.


title: binary number system
href: zk/Binary_number_system.md
type: markdown
snippet:
  The equivalent entity in the
  [binary number system](Binary_number_system.md)
  is the **bit**. For example the binary number 110 has three bits. A bit can only
  have one of two values in contrast to a digit which can have one of ten values.
  These values are 0 and 1.


title: standard metric prefixes
href: zk/Prefixes_for_units_of_electrical_measurement.md
type: markdown
snippet:
  Having established that the core quantity of information is the byte, the
  convention is to apply the
  [standard metric prefixes](Prefixes_for_units_of_electrical_measurement.md)
  to the byte to establish units:


title: electrical field
href: zk/Voltage.md#distinguishing-voltage-from-electric-field
type: markdown
snippet:
  In this configuration the same current flows through all the cells; it is not
  cumulative. We represent this as follow> However the voltage is cumulative: it
  is the _sum_ of the individual cell voltages, represented below as
  [electrical field](Voltage.md#distinguishing-voltage-from-electric-field):


title: remote tracking branch
href: zk/Remote_tracking_branches.md
type: markdown
snippet:
  You don't have to just cherry-pick locally, you can also cherry-pick from a
    [remote tracking branch](Remote_tracking_branches.md).


title: copying functions
href: zk/Functions_in_Python.md
type: markdown
snippet:
  The same principle that applies to
  [copying functions](Functions_in_Python.md)
  applies to copying objects created through classes: redeclaration results in a
  duplicate entity. Thus changes to the duplicate will affect the original.


title: reciprocol
href: zk/Reciprocals.md
type: markdown
snippet:
  We combine the foregoing (that it is easier to divide by fractional amounts
  using multiplication) with the concept of a [reciprocol](Reciprocals.md) to
  arrive at a definitive method for dividing two fractions. It boils down to:
  _invert and multiply_:


title: REST API
href: zk/RESTful_APIs.md
type: markdown
snippet:
  The Docker Client is a thin API for making
    [REST API](RESTful_APIs.md) to the Docker Server. Any CLI
    command beginning `docker...` is an API request to the server.


title: electric current
href: zk/Current.md
type: markdown
snippet:
  Magnetism is a physical property produced by the _motion_ of electric charge,
  > which of course, is the same thing as
  > [electric current](Current.md)


title: shell session
href: zk/Shell-sessions-e6dd743dec1d4fe3b1ee672c8f9731f6
type: markdown
snippet:
  Every time a
    [shell session](Shell-sessions-e6dd743dec1d4fe3b1ee672c8f9731f6)
    spawns, a process takes place to gather and compile information that should be
    available to the shell process and its child processes. It obtains the data
    for these settings from a variety of different files and settings on the
    system.


title: shell session
href: zk/Shell-sessions-e6dd743dec1d4fe3b1ee672c8f9731f6
type: markdown
snippet:
  You can also add variables to config files that run on login such as your user
  `.bashrc` / `.zshrc` . This is obviously best for when you want the variables to
  persist and be accessible within every
  [shell session](Shell-sessions-e6dd743dec1d4fe3b1ee672c8f9731f6).


title: solution
href: zk/Algebra key terms.md#678811
type: markdown
snippet:
  Two equations are equivalent if they have the same
  > [solution](Algebra%20key%20terms.md#678811) set.


title: solution
href: zk/Algebra key terms.md#678811
type: markdown
snippet:
  $$ x - 4 = 3
  $$
  The [solution](Algebra%20key%20terms.md#678811) to this equation is $7$
  $$ x -
  4 (+4) = 3 (+ 4) $$


title: solution
href: zk/Algebra key terms.md#678811
type: markdown
snippet:
  $$ x + 4 = 9
  $$
  The [solution](Algebra%20key%20terms.md#678811) to this equation is $5$.
  $$ x +
  4 (-4) = 9(-4) $$


title: solution
href: zk/Algebra key terms.md#678811
type: markdown
snippet:
  $$x \cdot 2 = 10  $$
  The [solution](Algebra%20key%20terms.md#678811) to this equation is $5$.
  $$
  (x \cdot 2) \cdot 3 = 10 \cdot 3 $$ Here we have multiplied each side of the
  equation by $3$. If $x =5$ then


title: solution
href: zk/Algebra key terms.md#678811
type: markdown
snippet:
  $$x \cdot 3 = 18  $$
  The [solution](Algebra%20key%20terms.md#678811) to this equation is $6$.
  $$\frac{x
  \cdot 3}{3} = \frac{18}{3}
  $$
  Here we have divided each side of the equation by $3$. If $x$ is 6, then
  $$\frac{6
  \cdot 3}{3} = 6$$
  $$\frac{18}{3} = 6 $$


title: equivalent
href: zk/Equivalent fractions.md
type: markdown
snippet:
  When we divide by the common divisor is acts as a divisor. When we multiply by
  the common divisor it acts as a factor. The fact that the fractions are
  [equivalent](Equivalent%20fractions.md) in both cases indicates that the
  properties are equivalent.


title: CPU Architecture
href: zk/CPU_architecture.md#arithmetic-logic-unit
type: markdown
snippet:
  Now the command will be executed. The operand is copied to the Memory Address
  Register and then passed to the Memory Data Register and the command is carried
  out by the ALU. The activities of ALU are covered in
  [CPU Architecture](CPU_architecture.md#arithmetic-logic-unit)
  and the notes on
  [Logic Gates](Logic_gates.md).


title: registers
href: zk/CPU_architecture.md#registers
type: markdown
snippet:
  If the instruction is iterative (e.g. adding two numbers and then multiplying
    by another number), the instruction will tell the CPU to store the interim
    first value in the CPU's
    [registers](CPU_architecture.md#registers). As
    these are part of the CPU, the data can be retrieved more readily. If the
    value is not expected to be used again immediately, it goes to the DRAM or
    harddisk.


title: passing arguments to scripts
href: zk/Passing_arguments_to_Bash_scripts.md
type: markdown
snippet:
  We can access all the arguments passed to a function using the `$@` syntax we
  encountered before when
  [passing arguments to scripts](Passing_arguments_to_Bash_scripts.md).
  (Here a function is a kind of script in miniature so the process is the same.)


title: equivalent
href: zk/Equivalent fractions.md
type: markdown
snippet:
  Let $a,b$ be any integers. The following three fractions are
  > [equivalent](Equivalent%20fractions.md):
  > $$\frac{-5}{15}, \frac{5}{-15}, - \frac{5}{15}$$


title: hardware simulator
href: zk/Hardware_simulation.md
type: markdown
snippet:
  The hardware designer specifies a chip's logic by writing an HDL program which
  is then rigorously tested. At this stage, a
  [hardware simulator](Hardware_simulation.md) takes the
  HDL program as input and creates a software representation of the chip logic.
  The designer can instruct the simulator to test the virtual chip on various sets
  of inputs. This is done to check the chip's functionality but also to benchmark
  a variety of other parameters such as speed of computation and energy
  consumption.


title: input and output pins
href: zk/Integrated_circuits.md
type: markdown
snippet:
  In an HDL program we distinguish internal pins along with the standard
  [input and output pins](Integrated_circuits.md).
  At the level of the interface, we are concerned only with input and output pins
  (in the example program these are `a`, `b` and `out`). It is at the level of the
  implementation that internal pins are encountered. In the example these are the
  connections between, e.g. the AND and NOT gates such as
  `And (a=a, b-notb, out=w1)`. This means the AND gate is receiving through its
  `a` pin the input `a` value and through its `b` pin the value of `b` inverted by
  a NOT. `out` is the value that is computed based on the input pins of `a` and
  `b`.


title: Boolean function
href: zk/Boolean_functions.md
type: markdown
snippet:
  Along with the HDL file we also create a test file. This runs the chip against
  the inputs we supply, these will typically be equivalent to the (left-hand)
  truth-values column in a truth table which is the same as the parameters passed
  to a [Boolean function](Boolean_functions.md), for
  example:


title: equivalent
href: zk/Equivalent fractions.md
type: markdown
snippet:
  Whenever we increase a fraction, the resultant fraction will always be
  > [equivalent](Equivalent%20fractions.md) to the fraction we started with.


title: NOR
href: zk/Logic_gates.md#nor-gate
type: markdown
snippet:
  The circuit diagram latch symbol obviously encapsulates more complex
  functionality that occurs at the sub-circuit level. We will demonstrate how this
  functionality can be achieved with two
  [NOR](Logic_gates.md#nor-gate) gates.


title: pins
href: zk/Integrated_circuits.md
type: markdown
snippet:
  Logic gates are the basic building blocks of digital computing. **A logic gate
  is an electrical circuit that has one or more than one input and only one
  output.** The input and output points of the gate are
  [pins](Integrated_circuits.md) The
  input controls the output and the logic determining which types of input
  (on/off) lead to specific outputs (on/off) is isomorphic with the
  truth-conditions of the
  [Boolean connectives](Truth-functional_connectives.md) specifiable in
  terms of [truth tables](Truth-tables.md).


title: transistor
href: zk/Transistors.md
type: markdown
snippet:
  Physically, what 'travels through' the gates is electrical current and what
  constitutes the 'gate' is a
  [transistor](Transistors.md)
  responding to the current. Going up a level of abstraction, the current/ charge
  is identified with a
  [bit](Binary_units_of_measurement.md#binary-units-of-measurement).
  It is bits that go into the gate and bits which come out: binary information
  that may be either 1 or 0.


title: Adders
href: zk/Half_adder_and_full_adder.md
type: markdown
snippet:
  An example of a composite gate would be a three-way AND. An AND with three
  inputs rather than the standard two that furnish the elementary AND gate. This
  gate would output 1 when all three gates have the value 1 and 0 otherwise.
  [Adders](Half_adder_and_full_adder.md)
  and [latche>s](Latches.md) whilst
  being
  [integrated circuits](Integrated_circuits.md)
  are also, technically speaking, composite gates.


title: hardware abstraction
href: zk/Hardware_abstraction_and_modularity.md
type: markdown
snippet:
  Importantly, a single interface may be implemented in a variety of ways. There
  > is a one-to-many relationship at work here. From the point of view of the user
  > interface these differences should not be detectable. This is another example
  > of
  > [hardware abstraction](Hardware_abstraction_and_modularity.md)


title: queue
href: zk/Queue.md
type: markdown
snippet:
  As the name indicates, its operating mode is that of a
  [queue](Queue.md) data structure offering first-in, first-out
  and other queue implementations.


title: add fractions with a common denominator
href: zk/Add_Subtract_Fractions.md#adding-subracting-fractions-with-common-denominators
type: markdown
snippet:
  But we know that when we
  [add fractions with a common denominator](Add_Subtract_Fractions.md#adding-subracting-fractions-with-common-denominators),
  we only add the numerators, not the denominators. Thus the calculation would
  actually be:


title: using factorization
href: zk/Multiplying_fractions.md#prime-factorisation-in-place
type: markdown
snippet:
  Then carry out the multiplication
     [using factorization](Multiplying_fractions.md#prime-factorisation-in-place):


title: invert and multiply
href: zk/Dividing_fractions.md#formal-specification-of-how-to-divide-fractions'
type: markdown
snippet:
  Again we convert the mixed fraction into an improper fraction and then follow
  the requisite rule, in the case of division this is to
  [invert and multiply](Dividing_fractions.md#formal-specification-of-how-to-divide-fractions').


title: reducing fractions
href: zk/Reducing_fractions.md
type: markdown
snippet:
  It would be laborious to reduce such a large product using factor trees or the
  repeated application of divisors, as defined in
  [reducing fractions](Reducing_fractions.md). We can use a more efficient
  method. This method can be applied at the point at which we conduct the
  multiplication rather than afterwards once we have the product. We express the
  the initial multiplicands as prime factors:


title: $PATH
href: zk/The_PATH.md
type: markdown
snippet:
  When we run a program like `cd` or `npm` we don’t have to type `./cd.sh` or
  `./npm.sh`. This is because a reference to the program file is already in our
  [`$PATH`](The_PATH.md).


title: AWS API Gateway
href: zk/AWS_API_Gateway.md
type: markdown
snippet:
  We will do this using [AWS API Gateway](AWS_API_Gateway.md). We
  select "Add trigger" from the dashboard view and input basic settings:


title: factors
href: zk/Factors and divisors.md
type: markdown
snippet:
  For any whole number $n$ where $n \neq 1$, $n$ is prime if and only if its
  > sole [factors](Factors%20and%20divisors.md) are $1$ and $n$


title: 8-bits long
href: zk/Binary_units_of_measurement.md
type: markdown
snippet:
  When Python runs in this implementation, code written in C converts it to
  bytecode (so-called because each instruction is
  [8-bits long](Binary_units_of_measurement.md)). This is a
  lower-level transliteration of Python is not meant to be understood by the CPU
  (since it is not binary) but rather to be run in the Python virtual machine
  which is equipped to understand bytecode. The Python Virtual Machine is
  therefore also known as "bytecode interpreter" or the CPython VM. The VM then
  converts bytecode into machine-executable code.


title: HTTP request types
href: zk/HTTP_request_types.md
type: markdown
snippet:
  A basic example of a REST API would be a series of methods corresponding to the
  main [HTTP request types](HTTP_request_types.md).


title: file descriptors
href: zk/File_descriptors_and_redirection.md
type: markdown
snippet:
  The `2>&1` argument is the content: any errors that the program may generate and
  try to show in stout. Notice we are using the
  [file descriptors](File_descriptors_and_redirection.md)
  `1` and `2`.


title: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html
href: https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html
type: markdown
snippet:
  See
  [https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html)


title: IAM user
href: zk/zk/AWS_User_management_and_roles.md#iam
type: markdown
snippet:
  You require an access key for the given
  [IAM user](zk/AWS_User_management_and_roles.md#iam). You should create an IAM
  account specific to the project with bounded permissions.


title: IAM
href: zk/zk/AWS_User_management_and_roles.md#iam
type: markdown
snippet:
  This information can be found in the Security Credentials section of the given
  [IAM](zk/AWS_User_management_and_roles.md#iam) user:


title: handler function
href: zk/Lambda_handler_function.md
type: markdown
snippet:
  This details the location of the [handler function](/Lambda_handler_function.md)
  which is contained at the path `hello-world/app.js`:


title: S3
href: zk/zk/AWS_S3.md
type: markdown
snippet:
  The packaging proces will first archive all of the project artefacts into a zip
  file and then upload that to [S3](zk/AWS_S3.md). A reference to this S3 entity
  is then provided to CloudFormation.


title: environmental and shell variables
href: zk/Environmental-and-shell-variables-04d5ec7e8e2b486a93f002bf686e4bbb
type: markdown
snippet:
  The type of shell session that you are currently in affects the
  [environmental and shell variables](Environmental-and-shell-variables-04d5ec7e8e2b486a93f002bf686e4bbb)
  that you can access. This is because the order in which configuration files are
  read on initialisation differs depending on the type of shell.


title: Lambda
href: zk/Lambda_programming_model.md
type: markdown
snippet:
  At the beginning you define a `StartAt` state which is the entrypoint of the
  state machine. This can be manually triggered, or more likely, triggered by
  another AWS service such as a
  [Lambda](Lambda_programming_model.md), an
  [API Gateway](AWS_API_Gateway.md) request or a messaging/queue
  event.


title: list
href: zk/Lists_in_Python.md
type: markdown
snippet:
  The `split()` function in Python is used to divide a string into multiple parts
  at the occurrence of a given separator. This function returns a
  [list](Lists_in_Python.md) of substrings.


title: pip
href: zk/Python_package_management.md
type: markdown
snippet:
  Pytest is the most popular testing library for Python. It is not included with
  the Python standard library so it must be installed with
  [pip](Python_package_management.md).
  While it does not include a declaration library, it is robust enough to handle
  most scenarios having a rich and expressive set of constructs and decorators
  that let you declare what your tests should do, under what conditions they
  should run, and how they should interact with the rest of your system.


title: original schema
href: zk/Apollo_Server.md#example-schema
type: markdown
snippet:
  In order to demonstrate arguments we need to expand the
  [original schema](Apollo_Server.md#example-schema).


title: server-side process
href: zk/Apollo_Server.md
type: markdown
snippet:
  Now we have to create a resolver for our new `track` query. We will quickly run
  through the [server-side process](Apollo_Server.md).


title: useQuery hook
href: zk/Apollo_Client.md#usequery-hook
type: markdown
snippet:
  We can now write a proper query using the
  [useQuery hook](Apollo_Client.md#usequery-hook) from
  Apollo Client, with variables.


title: simple example
href: zk/Apollo_Client.md#query-constants
type: markdown
snippet:
  Note that in contrast to the
  [simple example](Apollo_Client.md#query-constants)
  because we are using variables, we have to pass-in an additional options object
  with the query constant that specifies our variables.


title: multiplicands
href: zk/Symbols-and-formal-conventions-80aeaf1872f94a0d97a2e8d07e3855bd
type: markdown
snippet:
  When **multiplying** whole numbers the placement of the
  [multiplicands](Symbols-and-formal-conventions-80aeaf1872f94a0d97a2e8d07e3855bd)
  does not affect the
  [product](Symbols-and-formal-conventions-80aeaf1872f94a0d97a2e8d07e3855bd).


title: expansion
href: zk/Expansions_and_substitutions.md
type: markdown
snippet:
  Note: we do not use a dollar-sign when referring to variables within
  > arithmetic evaluation, there is no need. If we do, we get an error. This is
  > because we are using an
  > [expansion](Expansions_and_substitutions.md),
  > therefore the variables are already being interpreted as variables.


title: logic gates
href: zk/Logic_gates.md
type: markdown
snippet:
  The half adder and full adder are components of digital circuits that enable us
  to carry out binary addition. Using adders and half adders we can add two binary
  numbers together. Adders are a type of [integrated circuit]() comprising certain
  [logic gates](Logic_gates.md) where the arrangement allows for the
  representation of the addition of bits.


title: XOR
href: zk/Logic_gates.md#xor-gate
type: markdown
snippet:
  We can see that the sum bit column replicates the truth-conditions of
  [XOR](Logic_gates.md#xor-gate):


title: Memory_leaks
href: Memory_leaks
type: wiki-link
snippet:
  Whereas stack memory with it's LIFO structure has memory management built-in
  when programs allocate memory from the heap they must manually deallocate it
  when it is no longer required. This process of "freeing memory" is known as
  _garbage collection_. In a language like C, this is the explicit concern of the
  programmer and is not abstracted away. Failure to properly manage garbage
  collection is what causes [[Memory_leaks]].


title: ways around this
href: https://thom4.net/2014/self-contained-node-scripts/
type: markdown
snippet:
  If you use any module not in the Node core, you will need to have this installed
  globally for it to work. (There are
  [ways around this](https://thom4.net/2014/self-contained-node-scripts/) for Node
  scripts you publish but for personal scripts this doesn't matter.)


title: difference of potential
href: zk/Voltage.md
type: markdown
snippet:
  When there is an excess of electrons at one terminal (i.e. negatively charged
  atoms) and a deficiency of electrons at the other terminal (i.e. positively
  charged atoms), a [_difference of potential_](Voltage.md) exists between the two
  terminals.


title: current
href: zk/Current.md
type: markdown
snippet:
  We noted in the discussion of [current](Current.md) that current flows when
  there is a difference of potential between two points with negatively charged
  atoms at one point and positively charged atoms at the other.


title: form of energy
href: zk/Voltage_sources.md
type: markdown
snippet:
  Voltage is the application of this energy. Any
  [form of energy](Voltage_sources.md) that dislodges electrons from atoms can be
  used to produce current. Thus:


title: battery
href: zk/Cells_and_batteries.md
type: markdown
snippet:
  Given that voltage is the force that generates current, it would be natural to
  think that voltage only exists when a voltage source (such as a
  [battery](Cells_and_batteries.md)) is connected to a circuit. This however is
  not the case. Even if a 9V battery isn't connected to anything it still has a
  difference of potential of 9-volts accross its terminals. Remember voltage is
  _potential energy_ not just the actualisation of that energy.


title: Ohm's Law
href: zk/Ohms_Law.md
type: markdown
snippet:
  We can work out the voltage of the remaining voltage points by inverting
  [Ohm's Law](Ohms_Law.md): $V = I \times R$:


title: amp
href: zk/Current.md#formal-expression
type: markdown
snippet:
  One ohm is the resistance of a circuit or circuit element that permits a
  > steady current flow of one [amp](Current.md#formal-expression) (one
  > coulomb/second) when one [volt](Voltage.md#voltage) is applied to the circuit.


title: batteries
href: zk/Cells_and_batteries.md
type: markdown
snippet:
  The chemical creation of current is the physics behind
  [batteries](Cells_and_batteries.md). Chemical current production produces
  currents on a smaller and less industrial scale than generators.


title: exception
href: zk/Error_handling_in_Python.md
type: markdown
snippet:
  Obviously file access can raise errors - typically when the file you want to
  access does not exist (i.e. a `FileNotFoundError`
  [exception](Error_handling_in_Python.md)). We can manage this scenario with
  [exception handlers](Error_handling_in_Python.md):


title: event emitter
href: zk/Events module.md#event-emitters
type: markdown
snippet:
  We create an [event emitter](Events%20module.md#event-emitters) and listener
  that listens for GET requests on a specified port and sends data in response to
  requests.


title: my notes
href: zk/Connect_to_Mongo_database.md
type: markdown
snippet:
  We will follow the routine for establishing a MongoDB instance as detailed in
  [my notes](Connect_to_Mongo_database.md) on Mongo:


title: Querying a collection
href: zk/Querying_a_Mongo_collection.md
type: markdown
snippet:
  Now we need to rewrite our RESTful request handlers so that the data is sourced
  from and added to the database. We will mainly be using the Mongo syntax defined
  at [Querying a collection](Querying_a_Mongo_collection.md) and
  [Adding documents to a collection](Adding_documents_to_a_Mongo_collection.md).
  We will also keep API validation within the `/model/` file.


title: query-first
href: zk/Update_a_Mongo_document.md#query-first-document-update
type: markdown
snippet:
  When updating a value in the database we are going to use the
  [query-first](Update_a_Mongo_document.md#query-first-document-update)
  approach to updating a Mongo document.


title: React_useReducer
href: zk/React_useReducer.md#refining-the-syntax
type: markdown
snippet:
  Now we need a reducer that will handle the state updates. We will just use the
  same setup as we used in the example of
  [React_useReducer](React_useReducer.md#refining-the-syntax):


title: Commutative Law
href: zk/Whole_numbers.md#the-commutative-property
type: markdown
snippet:
  Compare the
  [Commutative Law](Whole_numbers.md#the-commutative-property)
  in the context of arithmetic.


title: Associative Law
href: zk/Whole_numbers.md#the-associative-property
type: markdown
snippet:
  Compare the
  [Associative Law](Whole_numbers.md#the-associative-property)
  in the context of arithmetic.


title: Distributive Law applies in the case of algebra based on arithmetic
href: zk/Distributivity.md
type: markdown
snippet:
  Compare how the
  [Distributive Law applies in the case of algebra based on arithmetic](Distributivity.md):


title: DeMorgan's Laws
href: zk/DeMorgan's_Laws.md
type: markdown
snippet:
  In addition we have
  [DeMorgan's Laws](DeMorgan's_Laws.md) which express
  the relationship that obtains between the negations of conjunctive and
  disjunctive expressions:


title: logic gates
href: zk/Logic_gates.md
type: markdown
snippet:
  The fact that we can take a complex Boolean function and reduce it to a simpler
  formulation has great significance for the development of computer
  architectures, specifically
  [logic gates](Logic_gates.md). It
  would be rather resource intensive and inefficient to create a gate that is
  representative of the complex function. Whereas the simplified version only
  requires a single
  [OR gate](Logic_gates.md#or-gate).


title: logic circuits
href: zk/Digital_circuits.md
type: markdown
snippet:
  This is an important skill that we will use when constructing
  [logic circuits](Digital_circuits.md).
  We will go from truth conditions (i.e. what we want the circuit to do and when
  we want it to do it) to a function expression which is then reduced to its
  simplest form and implemented with
  [logic gates](Logic_gates.md).
  Specifically, NAND gates.


title: idempotence
href: zk/Boolean_algebra.md#idempotent-law
type: markdown
snippet:
  Notice that $\lnot(z)$ is repeated so we can remove the repetition through
  [idempotence](Boolean_algebra.md#idempotent-law):


title: NAND gate
href: zk/Logic_gates.md#nand-gate
type: markdown
snippet:
  Finally, we can simplify even further by doing away with AND and NOT and using a
  single
  [NAND gate](Logic_gates.md#nand-gate)
  which embodies the logic of both, being true in all instances where AND would be
  false: $\lnot (x \land  y)$.


title: trkjuth table
href: zk/Truth-tables.md
type: markdown
snippet:
  We can compute all possible outputs of the function by constructing a
  [trkjuth table](Truth-tables.md) with each possible
  variable as the truth conditions and the output of the function as the truth
  value:


title: memory
href: zk/Memory.md
type: markdown
snippet:
  | Bus type      | Description                                                                                                                                                                                                        |
  | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
  | System bus    | The primary pathway between the CPU and [memory](Memory.md). It comprises the **data bus** that transfers data from the memory to the CPU and the **address bus** which transmits requests from the CPU to memory. |
  | Internal bus  | Connects local devices for example the harddisk to the CPU.                                                                                                                                                        |
  | External bus  | Connects peripheral devices such as disks and printers to the [motherboard](Motherboard.md)                                                                                                                        |
  | Expansion bus | Allows expansion boards to access the CPU and memory.                                                                                                                                                              |
  | Frontside bus | Main computer bus that determines data transfer rate speed and is the primary data transfer path between the CPU, RAM and other [motherboard](Motherboard.md) devices.                                             |
  | Backside bus  | Transfers secondary cache (L2 cache) data at faster speeds, allowing more efficient CPU operations                                                                                                                 |


title: motherboard
href: zk/Motherboard.md
type: markdown
snippet:
  The chipset manages the data flow between the different components that comprise
  the [motherboard](Motherboard.md): processor,
  [memory](Memory.md),
  [harddisk](What_are_disks.md) and peripherals.


title: system bus
href: zk/Bus.md
type: markdown
snippet:
  Buses run in and out of the chipset into these key motherboard components. The
  main chipset is a kind of junction that sits between the memory and CPU through
  which the [system bus](Bus.md) passes.


title: duck typing
href: zk/Custom_types_in_TypeScript.md#duck-typing
type: markdown
snippet:
  You shouldn't confuse `implements` with `extends`. `implements` just checks the
  class as an interface in accordance with the principles of
  [duck typing](Custom_types_in_TypeScript.md#duck-typing):
  i.e the implementing class should have the same properties and methods. It
  doesn't affect anything internal to the methods or properties. So e.g, if you
  typed a method parameter as `string` in the base class, this would still default
  to `any` in the derived class.


title: principle of the immutability of elements
href: zk/Elements-992594b9cd2e483c85cddddffeb16f11
type: markdown
snippet:
  We change components by using state, not by mutating props. This is consistent
  with React's
  [principle of the immutability of elements](Elements-992594b9cd2e483c85cddddffeb16f11).


title: data type
href: zk/Data_types_in_MySQL.md
type: markdown
snippet:
  Below is an example of this in practice. Each field corresponds to a column. We
  specify the name of the field and its corresponding
  [data type](Data_types_in_MySQL.md). Every table must have a
  **primary key**. In the example, `employee_id` is the primary key.


title: collections and documents
href: zk/MongoDB_Introduction.md
type: markdown
snippet:
  In order start adding
  [collections and documents](MongoDB_Introduction.md) to our database,
  we use Mongoose's **schema** structure. (This is specific to Mongoose and is not
  a structure that is a part of Mongo in general.)


title: separate entry
href: zk/Validating_Mongoose_schemas.md
type: markdown
snippet:
  Note that we set our validation criteria as the second property for each
  > schema value. There is more info info on validation in a
  > [separate entry](Validating_Mongoose_schemas.md);


title: zk/Docker_architecture
href: zk/Docker_architecture
type: wiki-link
snippet:
  Cloud-based or virtual server (virtual machine), basically a hypervisor
    (compare [[zk/Docker_architecture]])


title: syntactic
href: zk/Syntax_of_sentential_logic.md
type: markdown
snippet:
  Derivation rules are
  [syntactic](Syntax_of_sentential_logic.md) rather
  than semantic. They are applied on the basis of their form rather than on the
  basis of the truth conditions of the sentences they are applied to.


title: CREATE TABLE
href: zk/Create_an_SQL_table.md
type: markdown
snippet:
  The output will be represented as a table but it is virtual, not an actual
  table. (If you wish to actually create a table or a view off the back of a join
  operation you should combine the join with the
  [`CREATE TABLE`](Create_an_SQL_table.md) command etc.)


title: contradiction
href: zk/Logical_truth_and_falsity.md#logical-falsity
type: markdown
snippet:
  A
  [contradiction](Logical_truth_and_falsity.md#logical-falsity)
  has very important consequences for reasoning because if a set of propositions
  is inconsistent, any other proposition is derivable from it.


title: negation elimination
href: zk/Negation_Elimination.md
type: markdown
snippet:
  Here we want to derive some proposition $Q$. If we can derive a contradiction
  from its negation as an assumption then, by the
  [negation elimination](Negation_Elimination.md)) rule, we can
  assert $Q$. This is why contradictions should be avoided in arguments, they
  'prove' everything which, by association, undermines any particular premise you
  are trying to assert.


title: derivation
href: zk/Formal proofs in propositional logic.md
type: markdown
snippet:
  Propositions $P$ and $Q$ are equivalent in a system of
  > [derivation](Formal%20proofs%20in%20propositional%20logic.md) for
  > propositional logic if $Q$ is derivable from $P$ and $P$ is derivable from
  > $Q$.


title: material biconditional
href: zk/Biconditional_Introduction.md
type: markdown
snippet:
  Note that the property of equivalence stated in terms of derivablity above is
  identical to the derivation rule for the
  [material biconditional](Biconditional_Introduction.md):


title: consistently
href: zk/Consistency.md
type: markdown
snippet:
  A proposition is logically indeterminate if it is neither logically true or
  logically false. This is to say: it can be both [consistently](Consistency.md)
  asserted and consistently denied.


title: logical consistency
href: zk/Logical_consistency.md
type: markdown
snippet:
  In distinguishing the properties of
  [logical consistency](Logical_consistency.md) and
  [validity](Validity_and_entailment.md) we make tacit use
  of the notion of **possibility**. This is because when we consider the validity
  of an argument we are assessing truth-conditions and this consists in asking
  ourselves what could or could not be the case: were it such that _P_, then it
  would be the case that _Q_. It is important to understand what possibility means
  in the context of logic and how it differs from what we might mean ordinarily
  when we use the term.


title: logical truth
href: zk/Logical_truth_and_falsity.md#logical-truth
type: markdown
snippet:
  A proposition is _logically necessary_ if it is true in every logically possible
  circumstance which is to say: true on every possible truth functional
  assignment. Necessity and
  [logical truth](Logical_truth_and_falsity.md#logical-truth)
  are therefore synonyms: anything that is logically true (a tautology) is true by
  necessity (could not be otherwise.)


title: consistency
href: zk/Logical_consistency.md
type: markdown
snippet:
  Neither proposition can be true because the truth of the first clause is
  contradicted by the second. By the principle of
  [consistency](Logical_consistency.md), it is not
  possible for both clauses to be true at once therefore the proposition, overall
  has the truth value of false.


title: validity
href: zk/Validity_and_entailment.md
type: markdown
snippet:
  If an argument contains premises which are logically false than this argument
    will perforce be valid. This is because one cannot consistently assert the
    premises and deny the conclusion which is the definition of
    [validity](Validity_and_entailment.md). However the
    _reason_ why one cannot consistently assert the premises and deny the
    conclusions is because one cannot consistently assert the premises - they
    conflict with each other. Furthermore as the argument contains false premises,
    it cannot be sound.


title: React_useEffect
href: zk/React_useEffect.md
type: markdown
snippet:
  Note that the syntax is similar to [React_useEffect](React_useEffect.md): there is a
  dependency array. The effect is the same: the function contained within
  `useCallback` will only re-rendered if one of these dependencies changes.
  However (see next section) the function will run in its memoized form on every
  click.


title: tables
href: zk/Relational_database_architecture.md#table
type: markdown
snippet:
  Although Mongo is not a relational database it has a structure that we can
  understand in relation to that paradigm. A **database** is obviously the overall
  structure. It comprises **collections** which are organised sets of data that
  are analagous to [tables](Relational_database_architecture.md#table)
  in RDBs. Within each collection are a series of **documents** which we can think
  of as being equivalent to [rows](Relational_database_architecture.md)
  in RDB table: units that comprise the collection.


title: CPU
href: zk/CPU_architecture.md
type: markdown
snippet:
  The motherboard is the foundation of a computer. It allocates power and allows
  communication to and between the
  [CPU](CPU_architecture.md),
  [RAM](Memory.md),
  [harddisk](What_are_disks.md) and all other hardware
  components.


title: any
href: zk/Any.md
type: markdown
snippet:
  `Object` is a valid type declaration in TS but it is not particularly helpful
  since it becomes similar to using [any](Any.md) given that most primitive
  types in JavaScripts prototypically inherit from an Object.


title: custom types
href: zk/Custom_types_in_TypeScript.md
type: markdown
snippet:
  Generally, when you use objects in TypeScript you type them as
  [custom types](Custom_types_in_TypeScript.md).


title: model
href: zk/Create_collections_and_documents_with_Mongoose.md#models
type: markdown
snippet:
  Now we will query the collection. This capability is provided via the Mongoose
  schema class we used to create the `Course`
  [model](Create_collections_and_documents_with_Mongoose.md#models).
  We have the following methods available to use from the schema:


title: React_useEffect
href: zk/React_useEffect.md#cleanup-functions
type: markdown
snippet:
  As the warning suggests, this can be resolved using the cleanup parameter within
  [React_useEffect](React_useEffect.md#cleanup-functions).


title: Application state management
href: zk/Application_state_management_with_React_hooks.md
type: markdown
snippet:
  In the examples above we have only been consuming state that is owned by the
  provider however in most scenarios you will also want to update the state from a
  consumer. This is best achieved by combining `useContext` with a reducer and is
  detailed in [Application state management](Application_state_management_with_React_hooks.md).


title: lifecyle methods
href: zk/Lifecycle_methods.md
type: markdown
snippet:
  `useEffect` enshrines but also simplifies the
  [lifecyle methods](Lifecycle_methods.md) that are used with
  class-based React components.


title: lifecycle methods
href: zk/Lifecycle_methods.md
type: markdown
snippet:
  The syntax of the `useEffect` hook also allows you to handle cleanup: something
  you want to do when the component unmounts (another example of how this hook
  recasts the traditional [lifecycle methods](Lifecycle_methods.md))
  . In addition to running on unmount, the cleanup function will run before the
  effect runs again (i.e. when it runs in response to a change in one of the
  elements of the dependency araray). This is chiefly used to prevent
  [memory leaks](Memory_leaks.md) and the
  ['update on unmounted component error'](React_errors.md#state-update-on-unmounted-component).


title: ACID principle
href: zk/ACID_principle.md
type: markdown
snippet:
  This is essential for carrying out operations across database tables and for
  creating and deleting database entires in accordance with the
  [ACID principle](ACID_principle.md). It is also a safeguard: it means
  you can always identify a record by itself and don't have to rely on generic
  queries to identify it.


title: recursive
href: zk/Recursion.md
type: markdown
snippet:
  Goal analysis is a [recursive](Recursion.md) strategy which
  proceeds by using a 'goal' proposition to guide the construction of intermediary
  derivations.


title: valid
href: zk/Validity_and_entailment.md#validity
type: markdown
snippet:
  Assume that we want to show that an argument is
  [valid](Validity_and_entailment.md#validity). Then our
  ultimate goal is to derive the conclusion from the premises we are given. We
  first ask ourselves: _which propositions if we could derive them, would allow us
  to easily derive the conclusion_? (For example, these propositions might be two
  simple propositions that when combined with
  [Conjunction Introduction](Conjunction_Introduction.md) give us
  the conclusion.) Deriving these propositions then becomes the new intermediate
  goal.


title: Conjunction Introduction
href: zk/Conditional_Introduction.md
type: markdown
snippet:
  First, we consider what is the easiest possible way of achieving the proposition
  $(L \lor A) \land D$. Clearly it is to separately derive each disjunct
  ($L \lor A$ and $D$) and then combine them with
  [Conjunction Introduction](Conditional_Introduction.md). This
  provides us with our first goal: to derive each of the separate conjuncts.


title: Conjunction Elimination
href: zk/Conjunction Elimination.md
type: markdown
snippet:
  Let's start with $D$: where does it occur in the assumptions? It occurs in the
  compound $(\lnot N \rightarrow L) \land (D \leftrightarrow \lnot N)$, but only
  in the first conjunct. We can get this simply but applying
  [Conjunction Elimination](Conjunction%20Elimination.md).


title: Biconditional Elimination
href: zk/Biconditional_Elimination.md
type: markdown
snippet:
  Now we just need to get $D$ from the proposition at line 3. This is easy since
  we already have access to the consequent of the biconditional at line 1.
  Therefore we can apply
  [Biconditional Elimination](Biconditional_Elimination.md)) at line
  3 to get $D$. We are now halfway there:


title: Conjunction Elimination
href: zk/Conjunction_Elimination.md
type: markdown
snippet:
  Next we need to turn our attention to deriving $L \lor A$. How can we obtain $L$
  ? Well it is contained within the first conjunct of the assumption on line 2.
  Again, we can get this through the application of
  [Conjunction Elimination](Conjunction_Elimination.md). Now, how do
  we get $L$ from $(\lnot N \rightarrow L)$? Well, we already have the antecedent
  $\lnot N$ as an assumption on the first line, so we can use
  [Conditional Elimination](Conditional_Elimination.md) to derive
  $L$. These two steps give us:


title: Disjunction Introduction
href: zk/Disjunction_Introduction.md
type: markdown
snippet:
  Now we need to get from $L$ to $L \lor A$. This is really straightforward
  because by using
  [Disjunction Introduction](Disjunction_Introduction.md)) we can
  get from any sentence to a disjunction. Finally, having assembled all the
  constituent parts of the conjunction that is the conclusion, we can combine them
  with [Conjunction Introduction](Conjunction_Introduction.md) as we
  had planned at the outset.


title: Conjunction Introduction
href: zk/Conjunction_Introduction.md
type: markdown
snippet:
  The requirements here could easily mislead us. We see that the target
  proposition is a conjunction so we might think that the best strategy is to seek
  to derive each conjunct and then combine them via
  [Conjunction Introduction](Conjunction_Introduction.md)).


title: Biconditional Elimination
href: zk/Biconditional_Elimination.md
type: markdown
snippet:
  Actually, if we look more closely, there is a better approach. The target
  proposition is contained in the first premise as the consequent to the
  biconditional ($\lnot L \leftrightarrow [X \land (\lnot S \lor B)]$). A better
  approach is therefore to seek to derive the antecedent ($\lnot L$) and then use
  [Biconditional Elimination](Biconditional_Elimination.md) to
  extract the target sentence which is the consequent.


title: theorems
href: zk/Theorems_and_empty_sets.md#theorems-and-empty-sets
type: markdown
snippet:
  When we are proving
  [theorems](Theorems_and_empty_sets.md#theorems-and-empty-sets)
  we do not have a set of assumptions to work from when constructing the proof. We
  must derive the target sentence from the 'empty set' which is the target
  sentence itself. It is therefore like a process of reverse engineering.


title: Disjunction Elimination
href: zk/Disjunction_Elimination.md
type: markdown
snippet:
  Our starting assumption is to a disjunction. Thus we can apply
    [Disjunction Elimination](Disjunction_Elimination.md) to show
    that our goal sentence $\lnot(A \land B)$ follows from each of the disjuncts
    ($\lnot A$ and $\lnot B$) in dedicated sub-proofs. If we can do this, we have
    the right to derive $\lnot (A \land B)$.


title: Disjunction Elimination
href: zk/Disjunction_Elimination.md
type: markdown
snippet:
  Having done this, we can discharge the
    [Disjunction Elimination](Disjunction_Elimination.md) sub-proofs
    and derive $\lnot (A \land B)$ from $\lnot A \lor \lnot B$


title: Negation Elimination
href: zk/Negation_Elimination.md
type: markdown
snippet:
  We will do this by assuming the negation of what we want to prove
    ($\lnot (\lnot A \lor \lnot B)$) and then apply
    [Negation Elimination](Negation_Elimination.md) to get
    $\lnot A \lor \lnot B$.


title: Negation Elimination
href: zk/Negation_Elimination.md
type: markdown
snippet:
  This requires us to derive a contradiction. We get this on lines 23 and 24.
    This requires as previous steps that we have two sub-proofs that use
    [Negation Elimination](Negation_Elimination.md) to release $A$
    and $B$


title: atomic and molecular propositions
href: zk/Atomic_and_molecular_propositions.md
type: markdown
snippet:
  These definitions provide a formal specification of the concepts of
  [atomic and molecular propositions](Atomic_and_molecular_propositions.md)
  introduced previously.


title: derivation
href: zk/Formal_proofs_in_propositional_logic.md#derivation-rules
type: markdown
snippet:
  We know that when we construct a
  [derivation](Formal_proofs_in_propositional_logic.md#derivation-rules)
  we start from a set of assumptions and then attempt to reach a proposition that
  is a consequence of the starting assumptions. However it does not always have to
  be the case that the starting set contains members. The set can in fact be
  empty.


title: logically determinant
href: zk/Logical_indeterminacy.md
type: markdown
snippet:
  We know that
  [logically determinant](Logical_indeterminacy.md)
  propositions express a truth value. When simple propositions are joined with a
  connective to make a compound proposition they also have a truth value. This is
  determined by the nature of the connective and the truth value of the
  constituent propositions. We therefore call connectives of this nature truth
  _functional_ connectives since the **truth value of the compound is a function
  of the truth values of its components**.


title: query
href: zk/Querying_a_Mongo_collection.md
type: markdown
snippet:
  With this approach we first execute a
  [query](Querying_a_Mongo_collection.md) to retrieve the document we
  want to edit and then make the change. We use the `findById` method to identify
  the document by its UUID and then `set` to update specified properties on the
  document. The `set` method is one of many operators that can be used to update
  values. For example there is also built-in operators for increment, renaming,
  multiplying values.


title: HTTP request types
href: zk/HTTP_request_types.md
type: markdown
snippet:
  Express provides us with methods corresponding to each of the
  [HTTP request types](HTTP_request_types.md):


title: MongoDB database
href: zk/05_ Integrating_the_database.md
type: markdown
snippet:
  Typically when you create a RESTful API you are going to be returning data
  > from a database. For simplicity we are just going simulate this with a simple
  > data array so that we can focus on the Express syntax rather than database
  > handling. Later we will integrate this with a
  > [MongoDB database](05_%20Integrating_the_database.md).


title: middleware
href: zk/Middleware_in_NodeJS.md
type: markdown
snippet:
  We first create an instance of Express within `index.js`. This will be the main
  coordinating file and we will aim to minimise the amount of business logic we
  have in this file. It should really just be for initialization and managing
  [middleware](Middleware_in_NodeJS.md).


title: Joi validator
href: zk/Validation_in_NodeJS.md
type: markdown
snippet:
  We should accept alterations to the database that are not first validated. We
  can use the
  [Joi validator](Validation_in_NodeJS.md) to vet
  the request:


title: capacitors
href: zk/Memory.md
type: markdown
snippet:
  This is the part of the CPU that stores data. The memory cells that comprise it
  do not have [capacitors](Memory.md) (unlike RAM)
  so they cannot store very much data but they work faster, which is what is
  important. Because their memory capacity is so small, we measure the size of
  registers in bits rather than bytes.


title: memory hierarchy
href: zk/Memory.md#the-memory-hierarchy
type: markdown
snippet:
  In terms of speed, registers sit at the top part of the overall
  [memory hierarchy](Memory.md#the-memory-hierarchy).


title: controller
href: zk/Chipset_and_controllers.md
type: markdown
snippet:
  The CPU's [controller](Chipset_and_controllers.md). It
  takes the instructions in binary form from RAM memory (separate from the CPU,
  but connected) and then signals to the to ALU and memory registers what it is
  supposed to do to execute the instructions. Think of it as the overseer that
  gets the ALU and registers to work together to run program instructions.


title: logic gates
href: zk/Logic_gates.md
type: markdown
snippet:
  The clock's circuitry is based on a quartz crystal system like that used in
  watches. At precisely timed intervals, the clock sends out pulses of electricity
  that cause bits to move from place to place within
  [logic gates](Logic_gates.md) or
  between logic gates and
  [registers](CPU_architecture.md#registers). This is
  covered in greater detail in the discussion of
  [clock signals in digital circuits](Clock_signals.md).


title: kernel
href: zk/The_kernel.md
type: markdown
snippet:
  Each "cycle" is the execution of a process that commences once the
  [kernel](The_kernel.md) hands control to the CPU. Each cycle
  follows a sequence of events known as
  [fetch, decode, and execute](Fetch_decode_execute.md).


title: electromagentic waves
href: zk/Electromagnetism.md
type: markdown
snippet:
  Hertz was the scientist who detected
  [electromagentic waves](Electromagnetism.md).
  We use Hertz as a measure of the frequency of electromatic wave cycles in a
  signal.


title: arguments
href: zk/Passing_arguments_and_options_to_Bash_scripts.md
type: markdown
snippet:
  Here we test that the right number of
  [arguments](Passing_arguments_and_options_to_Bash_scripts.md)
  have been passed to the script:


title: electromagnetic
href: zk/Electromagnetism.md
type: markdown
snippet:
  A single iteration of the volatage rising and falling is a **pulse**. A complete
  oscillation from low to high and back to low is a **cycle**. As with all
  [electromagnetic](Electromagnetism.md)
  signals we measure the frequency of the wave in Hertz: cylcles per second. We
  also further distinguish the rising and falling edge of a pulse. Rising
  represents the signal passing from ground to its maximum voltage and falling is
  the reverse (the electrons moving from the voltage source to ground).


title: CPU
href: zk/CPU_architecture.md#the-system-clock
type: markdown
snippet:
  The role of the clock is essential in the functioning of the
  [CPU](CPU_architecture.md#the-system-clock). It is
  the system clock that gives CPUs their performance rating: how many processes
  can execute within a given clock cycle.


title: kernal
href: zk/The_kernel.md
type: markdown
snippet:
  Containers are native to the Linux [kernal](The_kernel.md)
    and are key part of how it works. Thus when you run containers on Linux, you
    are using native capability. When you use containers on Windows or Mac you
    have to run a virtual version of Linux in order to exploit the capabilities of
    that kernel. (Docker provides this)


title: user space
href: zk/User_Space.md
type: markdown
snippet:
  In ordinary [user space](User_Space.md) applications share
  the _same_ processor, memory and file system resources. This increases the
  likelihood of resourcing challenges, dependency conflicts and security threats.
  Without modularisation and the titration of resources, you are opened up to much
  greater possibility of failure.


title: mode
href: zk/File_permissions_and_execution_in_Bash.md#what-the-output-means
type: markdown
snippet:
  The
  [mode](File_permissions_and_execution_in_Bash.md#what-the-output-means)
  is different from ordinary files. Each device file is prepended with
  `b, p, c, s` before the standard permissions. These stand for the major types of
  devices: _block, character, pipe_ and _socket_.


title: bash scripting
href: zk/Redirect_to_dev_null.md
type: markdown
snippet:
  `/dev/null` is a virtual device: it doesn't actually exist as a piece of
  hardware on the system. It can be useful when
  [bash scripting](Redirect_to_dev_null.md) as a
  place to direct output that you don't care about, for example errors or verbose
  program read-outs.


title: kernel
href: zk/The_kernel.md
type: markdown
snippet:
  A running Node application is a single running process. Like everything that
  happens within the OS, a process is managed by the
  [kernel](The_kernel.md) that dispatches operations to the CPU
  in a clock cycle. A thread is a sequence of code that resides within the process
  and utilises its memory pool (the amount of memory assigned by the kernel to the
  Node process). The Event Loop runs on CPU ticks: a tick is a single run of the
  Event Loop.


title: call stack
href: zk/Call_stack.md
type: markdown
snippet:
  The Event Loop comprises six phases. The Event Loop starts at the moment Node
  begins to execute your `index.js` file or any other application entry point.
  These six phases create one cycle, or loop, equal to one **tick**. A Node.js
  process exits when there is no more pending work in the Event Loop, or when
  `process.exit()` is called manually. A program only runs for as long as there
  are tasks queued in the Event Loop, or present on the
  [call stack](Call_stack.md).


title: call stack
href: zk/Call_stack.md
type: markdown
snippet:
  At the beginning of this phase the Event Loop updates its own time. Then it
       checks a queue, or pool, of timers. This queue consists of all timers that
       are currently set. The Event Loop takes the timer with the shortest wait
       time and compares it with the Event Loop's current time. If the wait time
       has elapsed, then the timer's callback is queued to be called once the
       [call stack](Call_stack.md) is empty.


title: https://blog.appsignal.com/2022/07/20/an-introduction-to-multithreading-in-nodejs.html
href: https://blog.appsignal.com/2022/07/20/an-introduction-to-multithreading-in-nodejs.html
type: implicit
snippet:
  https://blog.appsignal.com/2022/07/20/an-introduction-to-multithreading-in-nodejs.html
  https://school.geekwall.in/p/Bk2xFs1DV


title: variables
href: zk/Variables_and_data_types_in_Bash.md
type: markdown
snippet:
  We use most frequently for returning the value of stored
  [variables](Variables_and_data_types_in_Bash.md).
  Techically we do not have to use the braces, we can retrieve with just `$var`
  however it's better to use them to minimise interpretation fuck-ups which happen
  a lot.


title: sub-shell
href: zk/Shell_sessions.md
type: markdown
snippet:
  Command substitution (circle-brackets) allows us to put the output of one
  command inside another. Bash runs the bracketed command in a
  [sub-shell](Shell_sessions.md) and then returns it
  to the main user shell.


title: redirect
href: zk/Redirection_in_Bash.md
type: markdown
snippet:
  They are typically used when you want to
  [redirect](Redirection_in_Bash.md) the output of the
  standard/input /output/error somewhere, e.g a file or as input to another
  program. A classic case is `[some_command] > /dev/null 2>&1`


title: $0
href: zk/Passing_arguments_and_options_to_Bash_scripts.md#passing-arguments
type: markdown
snippet:
  They are all technically "files" which are open and which append themselves to
  every process that can run in the shell. For any command or program that you
  run, you will be able to access `0`, `1` and `2` for them. In this way they are
  similar to variables like
  [`$0`](Passing_arguments_and_options_to_Bash_scripts.md#passing-arguments)
  and
  [`$@`](Passing_arguments_and_options_to_Bash_scripts.md#passing-arguments).
  They have a universal meaning within the context of the shell runtime.


title: database
href: zk/Basic_database_concepts.md
type: markdown
snippet:
  A filesytem is a form of [database](Basic_database_concepts.md); it
  > supplies the structure to transform a simple block device into the
  > sophisticated hierarchy of files and subdirectories that users can understand.


title: swap
href: zk/Swap_space.md
type: markdown
snippet:
  It shows my root and home filesystems and my
  [swap](Swap_space.md) file. Note that we use the UUID
  to name the partition rather than its name in `/dev/`. The order of the
  parameters is as follows:


title: printing-values-in-c
href: zk/printing-values-in-c.md
type: markdown
snippet:
  Format specifiers define the type of data to be printed on standard output. You
  need to use format specifiers whenever you are
  [printing-values-in-c](printing-values-in-c.md).


title: cherry-picking
href: zk/Cherry_picking_a_branch.md
type: markdown
snippet:
  The main difference between the two approaches is that
  [cherry-picking](Cherry_picking_a_branch.md) is a more selective
  process, where you can pick and choose specific commits that you want to include
  in another branch. This can be useful when you only want to apply specific
  changes or fixes from one branch to another, without including all the changes
  made in the original branch.


title: sort
href: zk/Sorting_lists_in_Python.md
type: markdown
snippet:
  Assuming the sub-lists have an identical structure, you can
  [sort](Sorting_lists_in_Python.md) them by
  a common property by passing a
  [lambda function](Lambdas_in_Python.md) to
  the `key` value of `sorted()` and `.sort()`.


title: map
href: zk/Map_and_filter_in_Python.md
type: markdown
snippet:
  Below we use
  [map](Map_and_filter_in_Python.md) and a
  [lambda function](Lambdas_in_Python.md) to
  convert the first element of each iner list from a Unix timestamp to a readable
  string:


title: list comprehension
href: zk/List_comprehension_in_Python.md
type: markdown
snippet:
  We could also use
  [list comprehension](List_comprehension_in_Python.md)
  to achieve the same outcome:


title: dictionary comprehension
href: zk/List_comprehension_in_Python.md#dictionary-comprehension
type: markdown
snippet:
  Accordingly, we create a dictionary which uses the unique key in each list as
  the key of each dictionary entry via
  [dictionary comprehension](List_comprehension_in_Python.md#dictionary-comprehension)
  that loops through each value in the inner lists of the multidimensional array.
  We then parse the values of the dictionary into a list.


title: map, filter
href: zk/Map_and_filter_in_Python.md
type: markdown
snippet:
  They are most often used unnamed with the functional methods
  [map, filter](Map_and_filter_in_Python.md)
  and reduce.


title: superuser
href: zk/User_Space.md#root-user-superuser
type: markdown
snippet:
  This is the domain of the [superuser](User_Space.md#root-user-superuser). The
    part of the filesystem that you need sudo priveleges to access and where you
    manage users


title: kernel
href: zk/The_kernel.md
type: markdown
snippet:
  Most standard partition tables allow for primary, extended and logical
  partitions. The primary partition is the part of the harddisk that contains the
  operating system and is thus described as 'bootable' and may be called the 'boot
  partition'. During the bootstrapping process this is injected into memory as the
  [kernel](The_kernel.md).


title: map and filter
href: zk/Map_and_filter_in_Python.md
type: markdown
snippet:
  Since its introduction to the language, the same functionality has become
  achievable by using functional methods like
  [`map` and `filter`](Map_and_filter_in_Python.md),
  utilising [lambdas](Lambdas_in_Python.md)
  however list comprehension is often more straightforward and easier to read.


title: test
href: zk/Test_values_in_Bash.md
type: markdown
snippet:
  Here we pass all the elements of the array to a
  [test](Test_values_in_Bash.md) condition which
  tests for an empty string.


title: function
href: zk/Functions_in_Bash.md
type: markdown
snippet:
  When you pass an array as an argument to a
  [function](Functions_in_Bash.md) it will not
  immediately be understood to be an array.


title: loop through each character in a string
href: zk/Strings_in_Bash.md#loop-through-each-character-in-a-string
type: markdown
snippet:
  We are leveraging this aspect of Bash when we
  [loop through each character in a string](Strings_in_Bash.md#loop-through-each-character-in-a-string).


title: CPU
href: CPU_architecture
type: wiki-link
snippet:
  No matter how a program was originally written, it eventually needs to execute
  on a [[CPU_architecture|CPU]] as a series of machine language instructions.


title: ARM ISA
href: Instruction_set_architectures
type: wiki-link
snippet:
  The following machine instruction is an instruction that would be understood by
  an [[Instruction_set_architectures| ARM ISA]]. It moves the number `4` into the
  `r7` register:


title: Hexadecimal_number_system
href: Hexadecimal_number_system
type: wiki-link
snippet:
  Binary sequences are hard to understand, even if converted to the
  [[Hexadecimal_number_system]]. We have a better way of managing operations on
  the machine level: [assembly](Assembly.md)


title: global process object
href: zk/Process_object.md
type: markdown
snippet:
  To determine the current environment we can use the variable
  **`process.env.NODE_ENV`** from the
  [global process object](Process_object.md).
  This works universally regardless of the kind of Node app we are building.


title: environment variable
href: zk/Environmental_and_shell_variables.md
type: markdown
snippet:
  `NODE_ENV` is a bash
  [environment variable](Environmental_and_shell_variables.md)
  like any other. So we can set it in the normal way:


title: Config
href: zk/node-config
type: markdown
snippet:
  We use the third-party [Config](node-config)
  package to manage different configurations based on the environment.


title: environmental variables
href: zk/Environmental_and_shell_variables.md
type: markdown
snippet:
  We can do so securely by utilising
  [environmental variables](Environmental_and_shell_variables.md)
  alongside the config pacakage.


title: ports
href: zk/Ports_in_NodeJS.md
type: markdown
snippet:
  We can control which middleware we run via the Node envrionment variables:
  `process.env` (see for instance [ports](Ports_in_NodeJS.md)).


title: module object
href: zk/Modules_in_NodeJS.md#structure-of-a-module
type: markdown
snippet:
  Note that one of these parameters is the
  [module object](Modules_in_NodeJS.md#structure-of-a-module).


title: ps
href: zk/Processes.md
type: markdown
snippet:
  We can use [ps](Processes.md) to list the
  currently running processes but it does not provide much information about the
  resource metrics or how the process changes over time. We can use `top` to get
  more information.


title: virtual memory
href: zk/Virtual_memory_and_the_MMU_in_Linux.md
type: markdown
snippet:
  The total amount of
      [virtual memory](Virtual_memory_and_the_MMU_in_Linux.md) used by
      the process including: program code, data, shared libraries, pages that have
      been swapped, pages that have been mapped but not used.


title: buffer
href: zk/Role_of_memory_in_computation.md#relation-between-cache-and-buffers
type: markdown
snippet:
  Total kbs currently in
        [buffer](Role_of_memory_in_computation.md#relation-between-cache-and-buffers)
        and not written


title: cache
href: zk/Role_of_memory_in_computation.md#relation-between-cache-and-buffers
type: markdown
snippet:
  Total amount of virtual memory in the
        [cache](Role_of_memory_in_computation.md#relation-between-cache-and-buffers)


title: swapped
href: zk/Swap_space.md
type: markdown
snippet:
  Distinguishes amount of memory
      [swapped](Swap_space.md) in (`si`) to memory and
      swapped out (`so`) to disk


title: kernel
href: zk/The_kernel.md
type: markdown
snippet:
  A system call is when a process requests a service from the
  [kernel](The_kernel.md), for instance an I/O operation to
  memory. We can trace these system calls with `strace`.


title: MMU
href: zk/Virtual_memory_and_the_MMU_in_Linux.md
type: markdown
snippet:
  We know that processes primarily interact with virtual memory in the form of
  pages which are then translated to physical blocks by the kernel via the
  [MMU](Virtual_memory_and_the_MMU_in_Linux.md). There are several tools
  which provide windows onto this process.


title: buffers and caches
href: zk/Role_of_memory_in_computation.md#relation-between-cache-and-buffers
type: markdown
snippet:
  `free` displays the total amount of free and¬used physical and swap memory in
  the system, as well as the
  [buffers and caches](Role_of_memory_in_computation.md#relation-between-cache-and-buffers)
  used by the kernel.


title: build context
href: zk/Creating_a_Docker_image.md#creating-a-docker-image
type: markdown
snippet:
  Each of the files listed below would be saved to the same source directory which
  would then form the basis of the
  [build context](Creating_a_Docker_image.md#creating-a-docker-image).


title: process.env
href: zk/Managing_environments_in_NodeJS.md
type: markdown
snippet:
  In the example, the database connection information in the Node source is coming
  from the
  [`process.env`](Managing_environments_in_NodeJS.md)
  object, which itself is sourcing the values `MYSQL_HOST`, `MYSQL_PASSWORD` etc
  from the Docker compose file. Therefore these values are hardcoded there.


title: type-guarding
href: zk/Type_guarding_and_narrowing.md
type: markdown
snippet:
  One way to get around it is to use better
  [type-guarding](Type_guarding_and_narrowing.md) and conditionality and to
  cover cases where the value may be undefined.


title: semantic versioning
href: zk/Semantic_versioning.md
type: markdown
snippet:
  `npm update` only updates from _current_ to _wanted_. In other words it only
  updates in accordance with your caret and tilde rules applied to
  [semantic versioning](Semantic_versioning.md).


title: event listeners
href: zk/Events module.md#event-emitters
type: markdown
snippet:
  While we may not know the specific port, whatever it is, it will be accessible
  via the `PORT` environment variable. So we can use this when writing our
  [event listeners](Events%20module.md#event-emitters):


title: format specifier
href: zk/zk/format-specifiers-in-c.md
type: markdown
snippet:
  The `%d` is an example of a [format specifier](./zk/format-specifiers-in-c.md).
  It is the decimal integer format specifier.


title: event listeners
href: zk/events.md
type: markdown
snippet:
  Typically we want to write and read data that the user provides. To do this we
  need to wait on that event. So we use Node's asynchonous
  [event listeners](events.md). We wait
  on the `data` event:


title: split the contents into an array
href: zk/Split_into_array_in_Bash.md
type: markdown
snippet:
  `read` will parse line by line using a space (`\n`) as the default delimiter.
  You can use IFS to parse by other characters and/or
  [split the contents into an array](Split_into_array_in_Bash.md).


title: find
href: zk/Find_Bash_command.md
type: markdown
snippet:
  Here we use [find](Find_Bash_command.md) to collate the files in
  the current directory and then pipe them to read.


title: file descriptors
href: zk/File_descriptors.md
type: markdown
snippet:
  It is common practice to combine redirection with the
  [file descriptors](File_descriptors.md) to redirect
  the output of `stdout` and `stderr`. A common case is to
  [redirect error output to `/dev/null`](Redirect_to_dev_null.md).


title: AWS Lambda handler function
href: zk/Lambda_handler_function.md
type: markdown
snippet:
  Let's walk through the above example making reference to the general structure
  of the
  [AWS Lambda handler function](Lambda_handler_function.md):


title: kernel
href: zk/The_kernel.md
type: markdown
snippet:
  To use an existing disk partition as a swap you can run the command
  `mkswap [device]` and then `swapon [device]` to register the space with the
  [kernel](The_kernel.md).


title: fstab
href: zk/Filesystems.md#fstab
type: markdown
snippet:
  You will want the swap to be activated every time the OS boots so add the
  following line to the [fstab](Filesystems.md#fstab),
  where `/sda3` is used as the example partition:


title: array
href: zk/Lists_and_arrays_in_Bash.md
type: markdown
snippet:
  Note: this syntax can also be used to test if a given element exists in an
  > [array](Lists_and_arrays_in_Bash.md).


title: clock pulses
href: zk/Clock_signals.md
type: markdown
snippet:
  The circuit will have three memory components, each representing one bit of the
  3-bit number. When the
  [clock pulses](Clock_signals.md), the
  3-bit number increments by one. We need to synchronise the operation with a
  clock because each bit by itself is meaningless, it only gains meaning by the
  relation it sustains to the other two bits hence it must be kept in sync with
  them.


title: T flip-flop
href: zk/Flip_flops.md#t-flip-flops
type: markdown
snippet:
  This means that to construct a circuit that displays this behaviour we just have
  to use a
  [T flip-flop](Flip_flops.md#t-flip-flops)
  since the only state change we need is a single bit toggle three times that
  retains its value.


title: immediate sentential components
href: zk/Syntax of sentential logic.md
type: markdown
snippet:
  The core truth-tables tell us how to determine the truth-value of a molecular
  > sentence given the truth-values of its
  > [immediate sentential components](Syntax%20of%20sentential%20logic.md). And if
  > the immediate sentential components of a molecular sentence are also
  > molecular, we can use the information in the characteristic truth-tables to
  > determine how the truth-value of each immediate component depends n the
  > truth-values of _its_ components and so on.


title: consistent
href: zk/Consistency.md
type: markdown
snippet:
  Recall that a set of propositions is logically or truth-functionally
  [consistent](Consistency.md) just if there is at least one assignment of truth
  conditions which results in all members of the set being true. To identify
  consistency for a set of three propositions via the truth table approach we
  would need to construct a truth table with $2^3$ (8) rows. Assume that this set
  is consistent on one partial assignment only. This means that 87.5% of our rows
  are redundant, they are not required to prove the consistency of the set.
  However we can only know this and we can only be sure of consistency once we
  have gone through the process of generating an assignment for each row.


title: logical falsity
href: zk/Logical truth and falsity.md#logical-falsity
type: markdown
snippet:
  When we wish to assess
  [logical falsity](Logical%20truth%20and%20falsity.md#logical-falsity) we are not
  focused on sets however, we are interested in a property of a sentence. However
  we can easily construe single sentences as unit sets: sets with a single member.
  With this in mind and the above accounts of consistency and logical falsity we
  are equipped to express logical falsity in terms of truth-trees with the
  following rule:


title: logically true
href: zk/Logical truth and falsity.md#logical-truth
type: markdown
snippet:
  For a sentence $P$ to be
  [logically true](Logical%20truth%20and%20falsity.md#logical-truth), there must
  be no possible assignment in which $P$ is false. We express this informally by
  saying _it is not possible to consistently deny $P$._ We know that in terms of
  truth trees an inconsistent set is a closed tree therefore a unit set of ${ P }$
  is logically true if ${ \sim P }$ is a closed tree. This is to say: if the
  negation of $P$ is inconsistent.


title: Indeterminacy
href: zk/Indeterminacy.md
type: markdown
snippet:
  [Indeterminacy](Indeterminacy.md) follows from the two definitions above; we do
  not require any additional apparatus. We recall that a sentence $P$ is logically
  indeterminate just if it is neither logically true or logically false. Thus the
  truth tree for an indeterminate sentence is straightforward:


title: logically equivalent
href: zk/Logical equivalence.md
type: markdown
snippet:
  Recall that $P$ and $Q$ are [logically equivalent](Logical%20equivalence.md)
  just if there is no truth assignment on which one is true and the other is
  false. We know from the
  [material biconditional shorthand](Corresponding%20material%20and%20biconditional.md#corresponding-material-biconditional)
  that this state of affairs can be expressed as $P \equiv Q$ and that if this
  compound sentence is true on every assignment then both simple sentences are
  equivalent. But ‘true on every assignment’ is another way of saying _logically
  true_ since there is no possibility of a false assignment. We already know what
  logical truth looks like as a truth tree: it is a closed tree for the negation
  of the sentence being tested. Therefore, to test the logical equivalence of two
  sentences it is necessary to construct a truth tree for the negation of the
  sentences conjoined by the biconditional (i.e. $\sim (P \equiv Q)$ )and see if
  this results in a closed tree. If it does, the two sentences are logically
  equivalent.


title: entailment
href: zk/Validity and entailment.md#entailment
type: markdown
snippet:
  Let’s remind ourselves of the meaning of truth-functional
  [entailment](Validity%20and%20entailment.md#entailment) and
  [validity](Validity%20and%20entailment.md#validity) and the relation between the
  two. $\Gamma$ $\vdash$ $P$ is true if and only if there is no truth-assignment
  in which every member of $\Gamma$ is true and $P$ is false. Entailment is
  closely related to validity; it is really just a matter of emphasis: we say that
  $\Gamma$ are the premises and $P$ is the conclusion and that this is a valid
  argument if there is no assignment in which every member of $\Gamma$ is true and
  $P$ is false.


title: binary encoding
href: Binary_encoding
type: wiki-link
snippet:
  Two's complement divides the available word length (see
  [[Binary_encoding|binary encoding]]) into two subsets: one for negative integrs
  and one for positive integers.


title: signed_and_unsigned_numbers
href: Signed_and_unsigned_numbers
type: wiki-link
snippet:
  [[Signed_and_unsigned_numbers|signed_and_unsigned_numbers]],
  [[Binary_addition|binary addition]], [[Signed_magnitude_representation]]


title: middlewear
href: zk/Middleware_in_NodeJS.md
type: markdown
snippet:
  Next we introduce GraphQL as a piece of Node.js
  [middlewear](Middleware_in_NodeJS.md), with the
  `app.use()` method.


title: Joi
href: zk/Validation_in_NodeJS.md
type: markdown
snippet:
  What is the relationship between this Mongoose validation and the
  [Joi](Validation_in_NodeJS.md) validation that we
  use when validating API requests in Node/Express? They complement each other. We
  use Joi to validate the client request to the API. If this is valid, the process
  would then move onto the next stage which would be transforming the data from a
  REST request to a database request implemented through Mongoose, where a second
  layer of validation would appy. We would also have validation on the
  client-side.


title: zk/Elastic_Compute_Cloud
href: zk/Elastic_Compute_Cloud
type: wiki-link
snippet:
  AWS VPC is used to create a virtual network. This is typically used in concert
  with [[zk/Elastic_Compute_Cloud]] to manage connections to a virtual server both
  privately and accross the internet.


title: partitions
href: zk/Partitions.md
type: markdown
snippet:
  A disk is divided up into [partitions](Partitions.md)
    which are subsections of the overall disk. The kernel presents each partition
    as a [block device](Devices.md) as it would with an entire
    disk.


title: user space
href: zk/User_Space.md
type: markdown
snippet:
  The **filesystem** is a database of files and directories: this comprises the
    bulk of the partition and is what you interact with in
    [user space](User_Space.md) when reading and writing data.


title: event queue
href: zk/Event_loop.md
type: markdown
snippet:
  Every method associated with `fs` has a _blocking_ and _asynchronous_
  implementation. The former obviously blocks the
  [event queue](Event_loop.md), the
  latter does not.


title: event emitter
href: zk/events.md
type: markdown
snippet:
  An HTTP server is another instance of an
  [event emitter](events.md)). It
  therefore has all the same methods as the `EventEmitter` class: `on`, `emit`,
  `addListener` etc. This demonstrates again how much of Node's core functionality
  is based on event emitters.


title: Zettelkasten
href: https://en.wikipedia.org/wiki/Zettelkasten
type: markdown
snippet:
  It is a [Zettelkasten](https://en.wikipedia.org/wiki/Zettelkasten) work in
  progress. I've recently converted the topic-based subdirectories into a single
  flat directory structure organised by tags. I'm in the process of partitioning
  longer notes into smaller units.


title: zk
href: https://github.com/zk-org/zk
type: markdown
snippet:
  I use the [zk](https://github.com/zk-org/zk) CLI package to help with indexing
  and task automation alongside its [zk-nvim](https://github.com/zk-org/zk-nvim)
  Neovim wrapper. I occassionally utilise [Obsidian](https://obsidian.md/)
  alongside Neovim for when I want to view my notes as a knowledge graph or read
  them alongside their rich content (images, videos etc).


title: scripts
href: scripts
type: markdown
snippet:
  The [scripts](/scripts) directory contains several Bash and Python scripts I use
  for general housekeeping, such as formatting image URLs, removing unused assets,
  and autosaving.


title: filesystem
href: zk/Filesystems.md
type: markdown
snippet:
  You see the GRUB default menu when you first start a Linux machine. It will
  offer you various options for loading your installed OS or other OSs. GRUB is a
  [filesystem](./Filesystems.md) like the main disk. If you press `e` in this
  screen you can view and edit specific boot parameters. Pressing `c` gives you
  access to the GRUB command line interface. This allows you to interact with GRUB
  in the same way as you would with any other filesystem, allowing for advanced
  configuration.


title: process id
href: zk/Processes.md#processes-ps
type: markdown
snippet:
  The kernel starts a program called **init**. It has a
     [process id](Processes.md#processes-ps) of 1. This is the point at which
     [user space](User_Space.md) starts.


title: journal
href: zk/journald.md
type: markdown
snippet:
  Linux keeps a log of the boot process as part of the [journal](./journald.md)
  log of everything that happens on disk. We can use the command `journalct -k` to
  view the diagnostics generated during the boot. Here is a selection:


title: memory management unit
href: zk/Virtual_memory_and_the_MMU_in_Linux.md#the-memory-management-unit-mmu
type: markdown
snippet:
  Modern CPUs include a
  > [memory management unit](Virtual_memory_and_the_MMU_in_Linux.md#the-memory-management-unit-mmu)
  > which provides the kernel with **virtual** memory. In this scenario, memory
  > isn't directly accessed by the process instead it works on the assumption that
  > is has access to the entire memory of the machine and this is then translated
  > into a map that is applied to the real memory and managed by the kernel.


title: foreign_keys
href: zk/Foreign_keys_in_SQL.md
type: markdown
snippet:
  DynamoDB is "NoSQL" because it does not support #SQL queries and is
  non-relational meaning there cannot be JOIN operations via
  [foreign_keys](Foreign_keys_in_SQL.md)


title: resistor
href: zk/Resistance.md#resistors
type: markdown
snippet:
  An LED diode lights up when the right amount of current flows through it. A
  standard LED has a maximum current of 20mA. An appropriate
  [resistor](Resistance.md#resistors)
  must therefore be added to the circuit to ensure the current doesn't exceed this
  amount.


title: listener
href: zk/Node_JS_events_module.md#extending-the-eventemitter-class
type: markdown
snippet:
  We instantiate an `ApolloServer` instance and pass our schema to it. We then
  subscribe to it with a
  [listener](Node_JS_events_module.md#extending-the-eventemitter-class).


title: function
href: zk/Creating_a_GraphQL_server.md#resolvers
type: markdown
snippet:
  A resolver is a [function](Creating_a_GraphQL_server.md#resolvers) that
  populates data for a given query. It should have **the same name as the field
  for the query**. So far we have one query in our schema: `tracksForHome` which
  returns the tracks to be listed on the home page. We must therefore also name
  our resolver for this query `tracksForHome`.


title: generic example
href: zk/Creating_a_GraphQL_server.md#resolvers
type: markdown
snippet:
  As per the [generic example](Creating_a_GraphQL_server.md#resolvers), you
  write write your resolvers as keys on a `resolvers` object, e.g:


title: resolver chains
href: zk/Using_arguments_with_Apollo_Client.md#resolver-chains
type: markdown
snippet:
  Used with
      [resolver chains](Using_arguments_with_Apollo_Client.md#resolver-chains)
      ---add example


title: argument
href: zk/Using_arguments_with_Apollo_Client.md
type: markdown
snippet:
  This time we utilise the `args` parameter in the resolver since an `id` will
    be provided as a client-side
    [argument](Using_arguments_with_Apollo_Client.md) to
    return a specific author.


title: REST APIs
href: zk/RESTful_APIs.md#rest
type: markdown
snippet:
  The best way to think of GraphQL architecturally is to think of it as a
  > different technique for instantiating the _uniform interface_, _client/server
  > decoupling_, and _layered-system architecture_ contraints of traditional
  > [REST APIs](RESTful_APIs.md#rest). However, instead of making
  > GET or POST requests to a REST endpoint URL and passing parameters, you send a
  > structured query object.


title: query constants
href: zk/Apollo_Client.md#query-constants
type: markdown
snippet:
  As with queries and
  [query constants](Apollo_Client.md#query-constants) we
  wrap our mutation in a `gql` template string:


title: exception
href: zk/Error_handling_in_Python.md
type: markdown
snippet:
  Will error if the input string is not properly formatted JSON. This will be
  `json.JSONDecodeError`, a subclass of the `ValueError`
  [exception](./Error_handling_in_Python.md)


title: voltage
href: zk/Voltage.md
type: markdown
snippet:
  Transistors are an electrical component that is capable of controlling the flow
  of current in the manner of a switch where the 'off' and 'on' states are
  represented by [voltage](Voltage.md) values within set parameters.


title: AND
href: zk/Logic_gates.md#and-gate
type: markdown
snippet:
  For example to create an [AND](Logic_gates.md#and-gate) gate we would have two
  voltage inputs going into two transistors that are connected in sequence. The
  two transistors create a continuous line going from the collector of one to the
  emitter of the other. If either voltage input is low then the voltage of the
  combined line is low (equivalent to the circuit being broken) and there is no
  current flowing.


title: processor core
href: zk/CPU_architecture.md
type: markdown
snippet:
  Each [processor core](./CPU_architecture.md) can only run one thread at a time
  so the number of cores that a device's CPU has deterimines how many threads can
  run at once. In practice, then, the CPU shuffles between multiple threads in
  [clock segments](./Clock_signals.md). This is known as scheduling and is managed
  by the process that the thread belongs to.


title: heap memory
href: Heap_memory
type: wiki-link
snippet:
  Along with [[Heap_memory|heap memory]] heap memory, programs make use of
    _stack memory_ during runtime.


title: stack data structure
href: Stacks
type: wiki-link
snippet:
  Similarly to the [[Stacks|stack data structure]], it works on the basis of LIFO:
  the last item put on the stack is the first item to be withdrawn.


title: register
href: CPU_architecture#registers
type: wiki-link
snippet:
  A **stack pointer** is used to manage the items in the stack. This value is
  stored in a [[CPU_architecture#registers|register]] and its value is the memory
  address of the item currently on the top of the stack. Note: _not_ the value
  itself, the _address_ of the value.


title: memory leaks
href: Memory_leaks
type: wiki-link
snippet:
  Local variable storage: storing the variables local to a function's scope and
     removing them once the function returns, avoiding
     [[Memory_leaks|memory leaks]]


title: greatest common divisor
href: zk/Factors and divisors.md#greatest-common-divisor
type: markdown
snippet:
  A fraction is said to be _reduced to its lowest terms_ if the
  > [greatest common divisor](Factors%20and%20divisors.md#greatest-common-divisor)
  > of the numerator and the denominator is $1$.


title: equivalent
href: zk/Equivalent fractions.md
type: markdown
snippet:
  Whenever we reduce a fraction, the resultant fraction will always be
  > [equivalent](Equivalent%20fractions.md) to the fraction we started with.


title: highest common divisor
href: zk/Factors and divisors.md#greatest-common-divisor
type: markdown
snippet:
  In the previous example the reduction took two steps: first we divided by two
  and then we divided by three. There is a more efficient way: find the
  [highest common divisor](Factors%20and%20divisors.md#greatest-common-divisor) of
  the numerator and denominator and then use this as the basis for the reduction.
  With this method, the reduction can be completed in a single step.


title: factors
href: zk/Factors and divisors.md#factors
type: markdown
snippet:
  Note how our earlier two divisors 2 and 3 are
  [factors](Factors%20and%20divisors.md#factors) of 6, showing the consistency
  between the two methods.


title: interchangeability of factors and divisors
href: zk/Factors and divisors.md
type: markdown
snippet:
  The two methods above are not very systematic and are quite heuristic. The third
  approach is more systematic and relies on the
  [interchangeability of factors and divisors](Factors%20and%20divisors.md).


title: factor
href: zk/Factors and divisors.md#factors
type: markdown
snippet:
  Instead of thinking asking what is the greatest common divisor of 18 and 24 we
  could ask: which single number can we multiply by to get 18 and 24? Obviously
  both numbers are in the six times table. This is therefore to say that 6 is a
  [factor](Factors%20and%20divisors.md#factors) of both: we can multiply some
  number by 6 to arrive at both 18 and 24. The numbers are 3 and 4 respectively:


title: prime factorization
href: zk/Prime factorization.md
type: markdown
snippet:
  A better method is to utilise [prime factorization](Prime%20factorization.md)
  combined with the canceling technique.


title: fraction with unlike terms
href: zk/Handling negative fractions.md#fractions-with-unlike-terms
type: markdown
snippet:
  This fraction is an instance of a
    [fraction with unlike terms](Handling%20negative%20fractions.md#fractions-with-unlike-terms).


title: fraction with like terms
href: zk/Handling negative fractions.md#fractions-with-like-terms
type: markdown
snippet:
  This fraction is an instance of a
    [fraction with like terms](Handling%20negative%20fractions.md#fractions-with-like-terms).


title: logarithm
href: zk/Logarithms.md
type: markdown
snippet:
  We need to reverse this formula to find out how many bits we need to represent a
  given number of addresses. We can do this with a [logarithm](Logarithms.md).


title: hexadecimal numbers
href: zk/Hexadecimal_number_system.md
type: markdown
snippet:
  This is hard to parse so we can instead use
  [hexadecimal numbers](Hexadecimal_number_system.md) to represent the addresses:


title: binary encoding
href: zk/Binary_encoding.md
type: markdown
snippet:
  By itself, the the data is meaningless but we know from
  [binary encoding](Binary_encoding.md) that the binary data will correspond to
  some meaningful data, such as a character or a colour, depending on the encoding
  scheme used. The above table could correspond to the characters for 'A', 'B' and
  'C' in the ASCII encoding scheme:


title: CPU
href: zk/CPU_architecture.md
type: markdown
snippet:
  When a [CPU](CPU_architecture.md) executes a program, it needs a place to store
  the program's **instructions** and **related data**. This is the role of memory.


title: RAM
href: zk/DRAM_and_SRAM_memory.md
type: markdown
snippet:
  [RAM](./DRAM_and_SRAM_memory.md) memory is _volatile_ : the memory is only
  retained whilst the computer has a power supply and is wiped when the computer
  is rebooted. This contrasts with the memory of the harddisk which is
  non-volatile and is retained after a reboot.


title: bootstrapping
href: zk/Boot_process.md
type: markdown
snippet:
  The following steps outline the way in which memory interacts with the processor
  during computational cycles, once the [bootstrapping](Boot_process.md) process
  has completed and the OS kernel is itself loaded into memory.


title: system bus
href: zk/Bus.md
type: markdown
snippet:
  The instruction at the first address is sent to the CPU, travelling accross
     the data bus part of the [system bus](Bus.md).


title: chipset
href: zk/Chipset_and_controllers.md
type: markdown
snippet:
  The CPU processes this instruction and then sends a request accross the
     address bus part of the system bus for the next instruction to the memory
     controller within the [chipset](Chipset_and_controllers.md).


title: DRAM
href: zk/Memory.md#dram
type: markdown
snippet:
  The chipset finds where this instruction is stored within the
     [DRAM](Memory.md#dram) and issues a request to have it read out and send to
     the CPU over the data bus.


title: transistor
href: zk/Transistors.md
type: markdown
snippet:
  In a DRAM cell, each bit of data is stored as a charge in a capacitor. The
  presence of charge represents a '1' bit and the absence of charge represents a
  '0' bit. Each of these cells is paired with a [transistor](Transistors.md) that
  controls the reading and writing of data.


title: charge
href: zk/Current.md
type: markdown
snippet:
  However capacitors lose [charge](Current.md) over time due to leaks. As a result
  DRAM is memory that needs to be refreshed (recharged) frequently. For this
  reason and because it only uses one transistor and capacitor per bit, DRAM is
  the less expensive form of volatile memory.


title: flip flops
href: zk/Flip_flops.md
type: markdown
snippet:
  SRAM uses [flip flops](Flip_flops.md) to store the bits. It also uses multiple
  transistors per bit. This makes it faster than DRAM but more expensive. DRAM is
  at least ten times slower than SRAM.


title: Registers
href: zk/CPU_architecture.md#Registers
type: markdown
snippet:
  [Registers](./CPU_architecture.md#Registers) are a form of memory that are
  positioned on the same chip as the CPU. They are very fast but can only store a
  small amount of data. They are used to store the results of calculations and the
  addresses of the next instructions to be processed.


title: DRAM to fast SRAM
href: zk/DRAM_and_SRAM_memory.md
type: markdown
snippet:
  Cache controllers use complex algorithms to determine what should go into the
  cache to facilitate the best performance, but generally they work on the
  principle that what has been previously used by the CPU will be requested again
  soon. If the CPU has just asked for an instruction at memory location 555 it's
  very likely that it will next ask for the one at 556, and after that the one at
  557 and so on. The cache's controller circuits therefore go ahead and fetch
  these from slow [DRAM to fast SRAM](./DRAM_and_SRAM_memory.md).


title: processes
href: zk/Processes.md
type: markdown
snippet:
  When an OS implements virtual memory, [processes](./Processes.md) in
  [user space](./User_Space.md) cannot directly read or write to the physical
  memory. Instead they execute memory operations against virtual memory and the
  [kernel](./The_kernel.md) translates these into the actual operations against
  the memory hardware.


title: memory addresses
href: zk/Memory_addresses.md
type: markdown
snippet:
  Because the physical memory is abstracted, it can be the case that the physical
  [memory addresses](./Memory_addresses.md) are non-contiguous or even distributed
  accross different hardware components (such as the
  [cache](./Register_and_cache_memory.md) and [swap](./Swap_space.md)). Despite
  this, the memory addresses will appear contiguous in virtual memory. Each user
  space process is presented with the same range of available memory addresses and
  the same total capacity.


title: boot_process
href: zk/Boot_process.md
type: markdown
snippet:
  During the [boot_process](Boot_process.md), it runs in physical memory mode
  however it rapidly creates a 1:1 mapping of physical to virtual memory for
  itself. This direct mapping allows the kernel to easily access any physical
  memory location as needed, whilst retaining the benefits of virtual memory.


title: Arithmetic_Logic_Unit
href: Arithmetic_Logic_Unit
type: wiki-link
snippet:
  A family of CPUs that implement the core instructions of the
    [[Arithmetic_Logic_Unit]] in the same way share an ISA. Any software built for
    that ISA will work on any CPU that implements the ISA


title: word-size
href: zk/Signed_and_unsigned_numbers.md
type: markdown
snippet:
  There have been different, successive generations of x86 corresponding to
    their [word-size](Signed_and_unsigned_numbers.md): 16-bit, 32-bit, 64-bit.
    Word size here just means how many bits the processor can work with at a time.
    A 34-bit processor can operate on values that are 32 bits in length. This
    means it has 32bit [[CPU_architecture#registers|registers]], a 32-bit data
    [[Bus|bus]], a 32-bit address bus and so on.


title: shell
href: zk/Intro_to_the_Unix_shell.md
type: markdown
snippet:
  A user can interact with the operating system either via the GUI or the
  [shell](Intro_to_the_Unix_shell.md). (Both ultimately access the OS via the
  shell since the UI is an abstraction layer of the shell.)


title: instruction_set_architecture
href: zk/Instruction_set_architectures.md
type: markdown
snippet:
  Windows has its own API called _The Windows API_. The original version was
  16-bit called _Win16_, then when it moved to 32-bits it became _Win32_. When it
  moved to an x86 [instruction_set_architecture](Instruction_set_architectures.md)
  it became _Win64_. Starting with Windows 10, it introduced the _Universal
  Windows Platform_ which aims to make app development consistent accross
  different devices that run Windows.


title: https://www.geeksforgeeks.org/user-mode-and-kernel-mode-switching/
href: https://www.geeksforgeeks.org/user-mode-and-kernel-mode-switching/
type: implicit
snippet:
  !! Add info on kernel mode and user mode
  https://www.geeksforgeeks.org/user-mode-and-kernel-mode-switching/


