Docker. Run Container.

I had a small task - run container with parameters:

  1. Name is web
  2. Image is nginx:latest
  3. The container must be available on port 9099
  4. The /var/log/nginx directory inside the container must be mounted to the /data/nginx/logs directory on the host system
  5. When starting the container, the environment variable logging = true should be added
Read More

Finite state machine (FSM)

A finite-state machine (FSM) is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM can change from one state to another in response to some inputs; the change from one state to another is called a transition. An FSM is defined by a list of its states, its initial state, and the inputs that trigger each transition.

Read More

SICP. Part 3. Propagation of Constraints

Computer programs are traditionally organized as one-directional computations, which perform operations on prespecified arguments to produce desired outputs. On the other hand, we often model systems in terms of relations among quantities. For example, a mathematical model of a mechanical structure might include the information that the deflection d of a metal rod is related to the force F on the rod, the length L of the rod, the cross-sectional area A, and the elastic modulus E via the equation dAE = FL. Such an equation is not one-directional. Given any four of the quantities, we can use it to compute the fifth. Yet translating the equation into a traditional computer language would force us to choose one of the quantities to be computed in terms of the other four. Thus, a procedure for computing the area A could not be used to compute the deflection d, even though the computations of A and d arise from the same equation.

Read More

SICP. Part 2. Building Abstractions with Data

Data abstraction is a methodology that enables us to isolate how a compound data object is used from the details of how it is constructed from more primitive data objects. The consequence of this methodology is abstraction barriers. It’s a splitting a program into layers, where each layer uses the layer on the level below.

Read More