#header-inner {background-position: right !important; width: 100% !important;}

## 11/22/14

### Electricity.

a Form of Energy & Light.

Electric Charge.

Basic component of Electricity is Electric Charge.

Electric charge in normal state of physical body is neutral. In isolators this state can be changed, for example by rubbing.

Electric charges affect each other with force (for example, when two rods of acrylic glass or ebonite are near each other).

Charges with the same polarity are repelling each other, while charges with the opposite polarity are drawing each other near.

Electric charge is measured in ampere-seconds (A·s) also called Coulombs (C).

Electric charge depends on amount of electrons orbiting around nucleus, as well as on amount of protons in nucleus.

More electrons make for negative polarity, more protons for positive polarity.

Atom with non-zero charge is called 'ion'.

Elementary charge, minimal amount of charge in electron or proton is either:
-1,602 x 10-19 C, or +1,602 x 10-19 C respectively.

Voltage.

Between opposite polarity charges there's force of attraction.

If needed to separate charges, work is neccessary against forces of attraction.

Work becomes stored as potential energy, between charges voltage is made.

There's inclination for charges to neutralize themselves, so electric voltage is also inclined to neutralize itself as well.

Electric voltage is force put to separate charges, in comparison to charge's magnitude.

Electric voltage (symbol: U) is measured by voltmeter.

Unit of voltage is volt, which has symbol of V.

[U] = 1V (read: unit of voltage is volt).

Voltage can be considered as the electric pressure. If two metallic bodies with opposite charges are connected by a conductor, electrons move caused by the voltage from negative electrode to the positive electrode.

Voltage relative to certain point, for example on ground is called 'potential'. Voltage can be presented as difference between two potentials.

Current.

Presence of voltage causes electric current flow.

Electric current can flow only in closed circuit.

Electric circuit consist of source, destination & wires (in any form) connecting source to destination.

Electric circuit can be opened or closed with electric switch.

Electric Circuit.

Materials contain electrons, which may move freely within material. These electrons are called 'free electrons'.

Free electrons move from places where there are too many electrons to places where is not enough of electrons.

In proper conductors, for example: in copper or silver, there are almost as many free electrons as there are electrons moving on atoms' external orbits.

Directed electrons flow we call: 'electric current'.

There's force in electric current, that affects free electrons. That force affects whole electric circuit after it's closed.

Electrons move affected by that force.

Direction of the electric current is opposite to the electrons flow & equal to the flow of positive ions in fluids.

Electric current affects surroundings in various ways.

Heat & magnetism occurs all the time. Light, chemical affects, living organisms affects occur only in certain conditions.

Electric current (symbol I) is measured with ammeter.

Unit of current's intensity is ampere (A).

There's:
- Direct Current (DC) - direction of electrons flow is constant, from negative pole to positive pole,
- Alternating Current (AC) - direction of electrons flow alternates constantly,
- Universal Current (UC) - consists both of AC & DC.

Difference betweeen Amperage & Voltage.

Amperage, or current, is a measure of the amount of electrons moving in a circuit.

Voltage is a measure of how much force those electrons are under.

Source: [28], [41], the Internet.

See also, if You wish: Atomic Structure (proceed with caution), Electric Resistance, Introduction to Physics, Fields & Units.

### Array List - Theory & ANSI C Implementation.

List can be implemented as a resizable array.

it's data structure L with operations:
- insert(L, index, value) - inserts 'value' element on list L, after element at position 'index',
- get(L, index) - returns 'value' element on list L, at position 'index',
- delete(L, index) - deletes element on list L, after element at position 'index',
- size(L) - returns number of elements on list L.

after 'insert' or 'delete' operation, list is reorganized & perhaps resized (to twice of it's previous size, by default).

we can see that 'insert' & 'delete' operations are expensive, but 'get' cheap - opposite to Pointer Lists (LinkedLists in Java), which have fairly cheap insertion, but it's expensive to get element from selected position.

(to be continued as soon as possible).

Source: my partial education, my programming experience.

### Hash Map - Theory & ANSI C Implementation.

What is Hash Map?

Hash Map is dictionary data structure.

Hash Map assigns values vn to keys kn from key set. Each of keys must be unique.

Hash Map has at minimum, following operations:
- search(kn) - returns vn assigned to kn,
- insert(kn, vn) - inserts (kn, vn) pair into hash map data structure properly, keeping association between key kn & value vn.
- delete(kn) - deletes (kn, vn) pair from hash map.

Often however, it also has following convenience operations:
- get_keys() - returns set of keys k1...km,
- size() - returns amount of elements in key set,
- perhaps more.

'Hash' part of 'Hash Map' name comes from 'hash function'.

Hash function usually helps (there's no guarantee for speed) to quickly find place where key is or should be located.

Implementation.

Key set can be implemented using array list of keys, with hash function we probably won't have to search through whole array list for a key.

(to be continued as soon as possible).

Source: [4], [19], [30], my partial education, my programming experience.

## 11/20/14

### Simple Parser Tutorial.

it's a simple example of how context-free grammar parsers can be designed & implemented.

it's fairly advanced topic, requires knowledge of programming, programming languages, regular expressions & related.

Language.

our parser will accept texts written in language with:

1. integer numbers & boolean values.
2. arithmetic operations on integer numbers:
- substraction,
- multiplication,
- division.
3. arithmetic operations on boolean values:
- not,
- and,
- or.
4. expressions & grouping operations (parentheses).
5. variables & assignment instruction.
6. conditional instruction if.
7. input & print instructions.

this should enable for basic arithmetic/logic operations whose results can be printed on screen.

they are mandatory for any serious programming language in my opinion, input & print instructions as well - even if they are only standard library functions.

Context-Free Grammar.

first we'll design language's grammar, which consists of productions, terminal symbols, nonterminal symbols & separators written in a serie of code lines.

* token -> instruction | expression
* instruction -> conditional_instruction | assignment_instruction | variable_declaration | input_instruction | print_instruction
* conditional_instruction -> if ( boolean_expression) instruction;
* assignment_instruction -> identifier = expression;
* variable_declaration -> variable_type identifier;
* variable_type -> int | boolean
* print_instruction -> print identifier;
* expression -> number_expression | boolean_expression | ( expression ) | input_instruction
* number_expression -> number | ( number_expression ) | -number_expression | number_expression + number_expression | number_expression - number_expression | number_expression * number_expression | number_expression / number_expression
* boolean_expression -> boolean_value | ( boolean_expression ) | not boolean_expression | boolean_expression or boolean_expression | boolean_expression and boolean_expression

in this language we do not allow for conversion between types, for simplicity.

what is an identifier, number, boolean_value etc... we'll define a little later, during tokenization process. terminal symbols of grammar will be defined there, as well as other things.

Tokenization.

(to be continued, if/when i can).

### Stitie Machine 1.3 'November Rain'.

1.3 'November Rain' version of Stitie Machine is open for ideas.

Features considered for this or later version:
- Space, Transformations & Recursion; i think something more or less related to ideas presented in this article can be included in future versions, probably later than 1.3 - i need to finish Mathematics Masters Degree first, understand mathematics better, include ideas learned, refine, improve & elaborate design & concepts as well.

### Distributed Operating Systems.

Introduction.

Distributed Operating System allows hiding & protecting resources at servers.

Resources & Services.

Distributed Operating System provides mechanisms needed to reach for these resources, such as:

- naming,
- communication,
- planning.

resources include:

- non-software files, including:
- information,
- art,
- software, including:
- information management,
- internet galleries,
- physical device controllers,
- perhaps more.

Naming

resources are hidden, stored & protected at server(s).

for resource to be available, client must know:
- server's IP address at which the resource is,
- as well as port.
(if we use the Internet solution).

it's convenient to use simple names for resources however, without caring for remembering resource's current location.

then we can say:
- let's get report file #108.
- let's switch mode of our transport car #84000 to 'delivery'.
- let's get art file called 'mona lisa #27'.
or something similar. (identifier does not have to be a number).

'Naming Service' can help us hide resource location under a name, by resolving identifier to address:port combination.

for example:
'mona lisa #27' -> 212.180.202.14:22
'report file #108' -> 212.180.202.14:22
'delivery car #84000 mode controller' -> 212.180.202.14:21600

naming service can work like DNS tree for example, as it's simple approach.

naming service should be reconfigurable, allowing to change resource's location as resource moves between servers without extra effort from user(s).

Source: [13], my partial education, my experience & insights, Wikipedia.

i think that Stitie Space has potential to serve as software infrastructure for coordinating and/or modelling remote services.

## 11/15/14

### 'Ola AH' as a 4GL Programming Language.

- what is 4GL Programming Language?
- i think that 4GL (Fourth Generation Language) is programming language that allows for faster software development than 3GL (Thrid Generation Language).

- can 'Ola AH' be 4GL class of Programming Languages?
- i think yes, due to Stitie Space, a part of 'Ola AH' semantics. it's a data structure in which an objects graph filled with code - a program - can be modelled & run.

- are there additional costs of using 4GL?
- i am not sure if programs written in 4GL (or at least programs written in 'Ola AH') are slower ('Ola AH' is not created yet, but i have ideas & imagination). i think it will take user a while to get used to new tools, perhaps more.

- how such faster development can be realized?
- with better syntax, graphical/textual - with modelling objects graph & filling parts with code, that together will create a running program model, with proper GUI (Graphical User Interface). GUI should include 3D overview of object graph within Stitie Space, as well as overview of 'synapses' - connections between objects in graph. Customizable object labels - with titles & comments, with option of turning off or on selected labels as well - should be part of GUI as well. GUI should provide overview of objects & synapses animation during program's runtime, 'state colors' & perhaps other state information, perhaps more. GUI should include graphical-textual profiler, debugger, graphical unit & integration tests support as well - a step into internally-coherent, practical & unified solution for all of the iterative-software-construction stages.

- why it's faster?
- less code writing, less mouse clicks, more focus on thinking, mindfulness & focus during code construction, better program overview, perhaps more.

- should graphical/textual syntax unambiguously translate to 'text-only syntax'?
- definitely yes, i think. to elegant text even.

---

what else is there to consider?

- perhaps in future, when computing resources allow for that, systems can be modelled on a pixel-by-pixel basis, then parts or even whole filled with code.

- perhaps class diagrams & other software design models will be possible to create in 'Ola AH' Programming Language's toolset - these should be easy to map on the software during the design & development software construction stages, along with their names & version number. this should unify tools for analysis, design & programming into one internally-coherent solution.

See also, if You wish or need, ... : Esoteric Programming Languages, Funges & Ola AH Programming Language, Token Game.

## 11/14/14

### Attacking Combined Threats.

How to attack combined threat?

We need:

1. Means (optimal tool, more or less) to attack threat A.
2. Means (optimal tool, more or less) to attack threat B.
3. Means (optimal tool, more or less) to attack their combination (hybrid weapon, or combined forces of two factions, for example).

First we attack combination of threats, to separate, thus breaking their 'bone'.

When one of threats (A or B) gains in strength, we have means to attack that threat separately.

### LightPoint as an Object.

LightPoint is a part of Stitie Machine 1.1 'Sunsail'.

LightPoint is (State, Strategy) pair, which is equivalent to an Object as in Object Oriented Programming - under condition that Strategy has access to a State.

In Stitie Machine 1.1.34-RC-0-0-3 'Sunsail', there's LightPointObject class that can be used this way:

----
final Certificate cert = new Certificate();

// test #1 : without 'superclass'.
final LightPointObject lpo = new LightPointObject(new HashMapStateImpl(), null);
@Override
public void execute(Certificate cert) {
Integer[] args = (Integer[]) lpo.getArgs(cert);
int result = args[0] + args[1];
lpo.setReturnValue(cert, result);
}
@Override
public int getPriority(Certificate cert) {
return 0;
}
});

@Override
public void execute(Certificate cert) {
Integer[] args = (Integer[]) lpo.getArgs(cert);
int result = args[0] - args[1];
lpo.setReturnValue(cert, result);
}
@Override
public int getPriority(Certificate cert) {
return 0;
}
});

lpo.setArgs(cert, new Integer[] {3,2});
System.out.println("test #1: without superclass.");

lpo.execute(cert);
int result = (int) lpo.getReturnValue(cert);
System.out.println("add operation call's result: " + result);

lpo.setMethodToCall(cert, "sub");
lpo.execute(cert);
result = (int) lpo.getReturnValue(cert);
System.out.println("sub operation call's result: " + result);

// test #2: with superclass

LightPointObject lpoSubclass = new LightPointObject(new HashMapStateImpl(), lpo);
@Override
public void execute(Certificate cert) {
lpoSubclass.setReturnValue(cert, 0);
// weird value - used only for testing of method inheritance & polymorphism
}
@Override
public int getPriority(Certificate cert) {
return 0;
};
});

LightPointObject lpoSubclass2 = new LightPointObject(new HashMapStateImpl(), lpo);
@Override
public void execute(Certificate cert) {
lpoSubclass2.setReturnValue(cert, 20);
// weird value - used only for testing of method inheritance & polymorphism
}
@Override
public int getPriority(Certificate cert) {
return 0;
}
});

@Override
public void execute(Certificate cert) {
lpoSubclass2.setReturnValue(cert, 10);
// weird value - used only for testing of method inheritance & polymorphism
}
@Override
public int getPriority(Certificate cert) {
return 0;
}
});

System.out.println("test #2: with 'superclass'.");

lpoSubclass.setArgs(cert, new Integer[] {3,2});
lpoSubclass2.setArgs(cert, new Integer[] {3,2});

// testing calling method from superclass. (subclass has it not defined).
lpoSubclass.execute(cert);
result = (int) lpoSubclass.getReturnValue(cert);
System.out.println("add operation call's result: " + result);

// testing method overriding & polymorphism.
lpoSubclass.setMethodToCall(cert, "sub");
lpoSubclass.execute(cert);
result = (int) lpoSubclass.getReturnValue(cert);
System.out.println("sub operation call's result: " + result);

// testing calling method from superclass. (subclass has it defined).
lpoSubclass2.execute(cert);
result = (int) lpoSubclass2.getReturnValue(cert);
System.out.println("add operation call's result: " + result);

// testing method overriding & polymorphism.
lpoSubclass2.setMethodToCall(cert, "sub");
lpoSubclass2.execute(cert);
result = (int) lpoSubclass2.getReturnValue(cert);
System.out.println("sub operation call's result: " + result);

// in real programming, unlike what's shown in this exercise,
// separate superclass object copy should be made for each of subclass objects,
// to prevent 'state overlapping' & state overwriting.

----

more details - in the code.

### What is a Function?

in Mathematics:

Let X,Y be any nonempty sets.

X is called function's domain, Y is called function's codomain.

def. function is assignment for each element in X an exactly one element in Y.

in Computer Sciences:

functions take n-arguments, which can be represented as one object (tuple), then assign returned value to this tuple of values.

all possible values of n-argument tuple are domain of a function, all possible returned values are codomain of a function.

if function's value also depends on other factors such as global variables, these factors can be assumed to be part of input of n-arguments.

- are Computer Sciences part of Mathematics?
- i think yes.

Function notations.

1. Mathematical formula.

y = x2, for x∈ {-2, -1, 0, 1, 2, 3, 4}.

2. Words.

There are sets X = { -2, -1, 0, 1, 2, 3, 4 }, Y = { 0, 1, 4, 9, 16 }. Then for each number from set X we assign a square of that a number.

3. Table.

 x -2 -1 0 1 2 3 4 y 4 1 0 1 4 9 16

4. Graph.

5. Ordered pairs set.

{(-2,4), (-1,1), (0,0), (1,1), (2,4), (3,9), (4,16)}.

in the above example of 'a function of the garden', pairs are: (coordinates, object).

6. Graph.

7. Computer program code.

int square(int x) {
if (inDomain(x) == false) { throw new RuntimeException("x = " + x + " not in domain"); };
return x * x;
};

boolean inDomain(int x) {
return ((x >= -2) && (x <= 4));
};

i think that 'Ola AH' programming language should have following syntax features:
- elegant domain clauses (because of function domains in Mathematics & functional programming paradigm, because of invariants & contract, perhaps more),
- optional 'function' keyword before function's signature line,
- multiple argument tuples both in return values, as well as in passed arguments.

code would look like:

function int square(int x) {
cd x inX; // cd is short for 'check domain'
return x * x;
};

dc inX(int x) { // dc is short for 'domain check'
return ((x >= -2) && (x <= 4));
};

another example:

function (int, int) myFunc (int x0, int x1) {
cd x0 inX; // cd is short for 'check domain'
cd x1 inX;
return (x0 * x1, -(x1 * x1));
};

Function equality.

Two functions f and g are equal when and only when their domains are equal, and when for the same arguments they are assigned equal values.

(to be elaborated, perhaps).

Source: [42], my partial education (unfinished MIM UW), my programming experience.

## 11/13/14

### Internet of Things, the Distributed Machine.

i think that this type of robots (distributed machines) is to be expected in future.

a swarm of flying small units cooperating, moving in formations, perhaps shooting or carrying different orders.

'internet of things' on small or other scale(s).

Checking Field & Tactics, How to defeat modern machine?, Tactical Forms & Formations in 3D.

## 11/9/14

### Genetic Algorithms.

Disclaimer.

i am not Expert in Artificial Intelligence Field of Computer Sciences, but i try to guess after reading Wikipedia.

Use (or not) at Your own risk.

Critic is welcome & asked for.

Introduction.

In the computer science field of artificial intelligence, a genetic algorithm (GA) is method of finding optimal solutions.

Candidate Solutions.

In a genetic algorithm, a population of candidate solutions (called individuals, creatures, or phenotypes) to an optimization problem is evolved toward better solutions.

Each candidate solution has a set of properties (its chromosomes or genotype) which can be mutated and altered.

Candidate solutions, whether code parts or mathematical functions or other, might be represented as objects with properties (which can be objects as well).

Selection & Evolution.

The evolution usually starts from a population of randomly generated individuals, and is an iterative process, with the population in each iteration called a generation.

In each generation, the 'fitness' of every individual in the population is evaluated by a function.

The more fit individuals are selected from the current population, and each individual's genome is modified (recombined and possibly randomly mutated) to form a new generation.

It is worth tuning parameters such as the mutation probability, crossover probability and population size to find reasonable settings for the problem class being worked on. A very small mutation rate may lead to genetic drift. A recombination rate that is too high may lead to premature convergence of the genetic algorithm. A mutation rate that is too high may lead to loss of good solutions, unless elitist selection is employed.

Termination.

This generational process is repeated until a termination condition has been reached.

Common terminating conditions are:

- A solution is found that satisfies minimum criteria,
- Fixed number of generations reached,
- Allocated budget (computation time/money) reached,
- The highest ranking solution's fitness is reaching or has reached a plateau such that successive iterations no longer produce better results,
- Manual inspection,
- Combinations of the above.

Source: Wikipedia.

### Basics of Concurrent Programming.

Concurrent work is multiple works happening at the same time.

Process is a running program.

Thread (lightweigh process, LWP) is object inside heavyweight process that has it's own control & that shares resources with other threads in the same process.

Critical Section.

Critical section is a code section that can be accessed by only one process or thread at the same time.

Critical section has uses for example in banking: we do not want data to be overwritten as it's written by other process, or read during writing.

Example pseudocode:

process P;

begin
while true do
begin
personal_affairs;
begining_protocol;
critical_section;
ending_protocol;
end
end;

Source: my partial education (see: [7]), my experience.

In computer science, the readers-writers problem is an example of a common computing problem in concurrency.

Shared resource is abstracted as a Reading Room.

More than one Reader may be in a Reading Room, but if writer is in a Reading Room - no one else can be there.

An example algorithm for handling the readers-writers problem is as follows:

Writer's beginning protocol:
writer waits (goes asleep), if there's someone in a reading room.

if is last exitting person, then awakens & lets writer in - if writer waits.

Writer's end protocol:
if readers wait, then awakens them all, otherwise, if writer waits, awakens one.

There should be a limit on maximum number of readers let in in a reading room, when writer(s) is/are awaiting.

Source: my partial education (see: [7]), my experience.

## 11/8/14

### Checking Field & Tactics.

Idea comes from game of Chess.

'Checking Field' spans among fields, and is capability to remove opponent's units if they move to position covered by 'Checking Field'.

If we cover opponent's escape with 'Checking Field', then move our unit(s) on attack position... then we can remove that unit from playing field.

i think this has use in Tactics.

Related topics, to be elaborated perhaps:

- Positional Chess,
- 'Sacrificing units' to remove 'Positionality'.
- Escort Field.

## 11/6/14

### Software Costs & Optimization.

Costs.

Every program instruction costs a set amount of processor time, and there is also memory cost for running program.

Sometimes we can talk of other costs such as printer paper pages used or HDD space taken.

Program running costs depend on algorithm used.

Costs usually depend on amount of data processed, that can be measured by proper mathematical function.

There can be optimistic costs, average costs, pessimistic costs.

Measurements.

Time is usually measured in algorithmic steps, amount of most 'expensive' operations done by algorithm.

Memory used by algorithm is usually measured by amount of memory cells used.

Costs can be precise: for example average_processor_time_cost(n) = n3 + 17 steps, average_memory_cost(n) = 0.5 · n2 + 3 memory cells.

Costs can also be written in asymptotic notation O(n).

O(f(n)) means that f(n) is an approximate value limited by upper asymptote for n ≥ n0 where n0 is a constant.

for example, classic sorting algorithm might have asymptotic time cost of O(n · log(n)), and parallel sorting algorithm might have asymptotic time cost of O(log2 n).

Optimization.

Computer Program can be optimized to perform better in certain area at cost of other areas, other things as well.

For example, there can be memory optimization if we recalculate partial results at each algorithmic steps to not store them in memory.

For example, there can be speed optimization if we use memory cache to store data retrieved from HDD and take it from cache if it's available before trying to read from HDD. That way most often read data will be available in memory cache and we won't need to read it from HDD, as it is slow operation.

For example, there can be programmer time cost optimization if we sacrifice quality of software to finish software sooner (programmers are usually paid per hours of work). That type of optimization leads to increased software production & maintenance costs soon after, i should add.

Programmer's time saved - for example thanks to object orientation - can be used for other types of optimization, i should add as well.

Source: My partial education, [4].

### Wave Interference.

Wave Interference, a Light - double slit experiment.

interference is commonly encountered when two waves of the same wavelength are added together.

Wave Interference, as in Mathematics.

we see that if the two waves are in step (the technical term is 'in phase') they add together to produce a combined wave that has twice the amplitude.

if, on the other hand, they are exactly out of step (in 'antiphase') they cancel each other out.

result of waves interference with a phase difference & the same wavelength is a wave with a different phase & amplitude but with the same wavelength.

Wave Interference, with a Phase Difference.

the phase difference is δ = π/2 or 90 degrees.

the two waves interfere, with the resulting wave (blue) equal to the sum of these two waves.

Wave Interference, Water.

Source: [28], the Internet.

## 11/5/14

### NEMS.

NEMS - nanoelectromechanical systems - are devices integrating electrical and mechanical functionality on the nano scale.

Nanoscale is objects of size: 1 nm -> 100 nm.

1 nanometer: 1nm = 10-9 m (one billionth of meter).

See also, if You wish: Nanotechnology, 'Ola AH' Programming Language for Nanotech ?

---

## 11/4/14

Stitie Processor Memory Model, with volatile memory parts in each of Stitie Machines can be used to fairly efficiently serve classical Object-Oriented Paradigm needs.

Stitie Machines at each of coordinates can serve as memory cells, each for one object that is saved in State object. If contained object is too large, stitie machine can reference external memory as well.

Thus, 'Ola AH' Programming Language should allow for classic Object-Oriented Programming, beside it's features.

## 11/2/14

### Introduction to Physics, Fields & Units.

Purpose of this blog post.

Electronic Phenomena can be described by terms of Physics.

Fields.

If there's influence from distance, we can say that between the cause of influence & affected body there's Field.

A physical field can be thought of as the assignment of a physical quantity at each point of space and time. For example, in a weather forecast, the wind velocity during a day over a country is described by assigning a vector to each point in space. Each vector represents the direction of the movement of air at that point. As the day progresses, the directions in which the vectors point change as the directions of the wind change.

So a Field can be described by n-dimensional Mathematical function, for example: assignment of a scalar or vector to n-dimensional coordinates (time can also be a coordinate).

If affected bodies are influenced by Force, we can speak of Force Fields.

There are many Fields, including Gravitational Field of Earth, Electric Fields, Magnetic Fields.

Electric & Magnetic Fields are tied, forming Electromagnetic Fields that are changing with time.

Field Intensity.

Field Intensity is the vector sum of all forces exerted by a field on a unit mass, unit charge, unit magnetic pole, etc., at a given point within the field.

Units.

Almost every physical quantity has it's unit - either basic or derived.

 Quality Quantity Symbol Unit Unit Symbol length l meter m mass m kilogram kg time t second s electric current intensity I amper A temperature T kelwin K light source intensity, brightness Iv candela cd

Basic Physical Quantities.

 Quantity Basic units Particular unit name Symbol ampere-second A · s coulomb C per second 1 / s hertz Hz square meter m · m - m2 Force kg · m/s2 Newton N work N · m Joule J

Derived Units.

Acceleration & Force.

Applying force, we can accelerate movement of a body, change it's speed.

Change of speed (Δ v) divided by amount of time during which that change occured (Δ t), we can call 'acceleration' (a).

a = Δ v / Δ t.

The more acceleration (a) near given mass (m) the stronger force affecting that mass.

Force is a vector (quantity with direction). We can say: vector F, or write it as: F.

F = m · a.

Speed & Velocity.

Speed & velocity are differing in that velocity is a vector (quantity with direction), whereas speed is quantity without direction.

Velocity (v) is length of the way (s) travelled in a given time (t).

v = s / t.

Velocity is measured in meters per second (m/s).

Work.

Work (w) is force (F) times length of way (s).

w = F · s.

Work is a vector.

When force (F) & way (s) are not on the same straight line, a component of force vector (Fs) that is along way is used in calculations of work (w).

w = Fs · s.

Energy.

Energy is capability to do a work. Work causes change in energy quantity.

Energy cannot be created, but it can be transformed into another form (for example: chemical energy can be transformed to heat energy during burning process, solar or nuclear energy can be changed to electricity).

Potential energy is energy contained in certain system, for example in physical body mass in gravitational field of Earth.

Potential energy at initial position has value equal to work neccessary to move mass from initial position to new position.

wp = Fc · Δh.

w - potential energy.
Fc - gravitational force.
Δh - difference in position (height).

Potential energy can also be stored in other ways.

Kinetic energy is contained in physical body mass that is moving.

Kinetic energy depends only on mass & velocity.

wk = 0.5 · m · v2.

Source: [41], Wikipedia, perhaps more.

### Memory Swapping.

Using more of memory, as well as using faster memory can prevent computers' instability & slowness to great extent.

To be able to run a computer program, Operating System must load it into memory first (into Processor's Cache or RAM).

Running program is called a 'Process'.

What if computer memory runs out, for example: due to loading too much of data?

There's an option of using slower memory that is cheaper & loading extra data or processess as neccessary into fast memory.

For example:

1. Few processes in RAM (Random Access Memory), rest waiting to be loaded in HDD Storage or DVD-ROM.
2. A process in Cache, rest of processes in RAM & HDD Storage.
3. In case of Stitie Space, part of Stitie Machine's State & keys in fast memory, rest in slower. Strategy in either, but during code's execution - in fast memory, at least it's part.

Let's note that Memory such as Cache is closer to Processor & faster than RAM, but more expensive - therefore we can buy it less for our money. It has to be used wisely, for example for most critical & most often used parts of software.

Similarly RAM is faster & more expensive than HDD Storage.

Registers, Cache, RAM, HDD Storage & similar can form a 'Pyramid of Needs', with more rare types of memory used more sparingly, due to costs.

Smaller processes run faster - we do not need to worry too much about loading parts of the process & data, then swapping the rest as needed. In case of Cache, with execution code & data being closer to processor, requests do not need to go via Serial Bus - and that speeds computing significiantly. Similar mechanism can be observed between accessibility of RAM & HDD Storage.

Also, there are algorithms that can take advantage of extra memory to use it for faster programs' execution (for example, by storing partial results for different data sets then using them later without computing again).

With more of processes running at once there's need to do more of swapping between faster & slower memory which costs time, same with amount of data increasing.

Extreme case of swapping abuse (for example: by loading too many programs at once into memory) can halt the computer almost to zero speed or even cause Operating System to crash.... if swapping requires more effort than is used to compute processes' data.

Sources: my partial education (see [7]), 12.