Execution Context & it’s stack
Lexical Environment : it’s the internal js engine construct that holds identifier-variable mapping. (here identifier refers to the name of variables/functions, and variable is the reference to actual object [including function type object] or primitive value). A lexical environment also holds a reference to a parent lexical environment.
Now, for every execution context — 1) a corresponding lexical environment is created and 2) if any function is created in that execution context, reference to that lexical environment is stored at the internal property ( [[Environment]] ) of that function. So, every function tracks the lexical environment related to the execution context it was created in.
And every lexical environment tracks its parent lexical environment (that of parent execution context). As a result, every function has a chain of lexical environments attached to it. [Note: in js a function is an object, creating a function by a statement means creating an object of type Function. So like other objects, a function can hold properties both internal and user defined]
Scope : it’s the language agnostic concept, to refer to the visibility of variables or functions to the executing code. In js a variable or function is visible to the executing code, if it is there in the current lexical environment or in the lexical-environment-chain of the enclosing function. In case of global code, the chain does not exist.
Note: similar to function’s case, by the introduction of let and const in es6, when a block begins to execute (if block, for loop block etc), a new lexical environment is also created having the parent function’s lexical environment as parent.
vardeclarations are initialized with
“Your beliefs become your thoughts,Ghandi
Your thoughts become your words,
Your words become your actions,
Your actions become your habits,
Your habits become your values,
Your values become your destiny.”
Plasticity means the possession of a structure weak enough to yield to an influence, but strong enough not to yield all at once. Each relatively stable phase of equilibrium in such a structure is marked by what we may call a new set of habits. Organic matter, especially nervous tissue, seems endowed with a very extraordinary degree of plasticity of this sort; so that we may without hesitation lay down as our first proposition the following, that the phenomena of habit in living beings are due to the plasticity of the organic materials of which their bodies are composed.William James’ book “Habit”
But the philosophy of habit is thus, in the first instance, a chapter in physics rather than in physiology or psychology.
Water, in flowing, hollows out for itself a channel, which grows broader and deeper; and, after having ceased to flow, it resumes, when it flows again, the path traced by itself before. Just so, the impressions of outer objects fashion for themselves in the nervous system
The only impressions that can be made upon them are through the blood, on the one hand, and through the sensory nerve-roots, on the other; and it is to the infinitely attenuated currents that pour in through these latter channels that the hemispherical cortex shows itself to be so peculiarly susceptible. The currents, once in, must find a way out. In getting out they leave their traces in the paths which they take. The only thing they can do, in short, is to deepen old paths or to make new ones; and the whole plasticity of the brain sums itself up in two words when we call it an organ in which currents pouring in from the sense-organs make with extreme facility paths which do not easily disappear.
If only a part of the matter of the path were to ‘rearrange’ itself, the neighboring parts remaining inert, it is easy to see how their inertness might oppose a friction which it would take many waves of rearrangement to break down and overcome. If we call the path itself the ‘organ,’ and the wave of rearrangement the ‘function,’ then it is obviously a case for repeating the celebrated French formula of ‘La fonction fait l’organe.’
Being physical pathways, the brain needs rest also to form lasting in roads, that is why it is said “we learn to swim in the winter and skate in the summer” There is no part of the organism of ma in which the reconstructive activity is so great, during the whole period of life, as it is in the ganglionic substance of the brain. This is indicated by the enormous supply of blood which it receives. It is moreover, a fact of great significance that the nerve-substance is specially distinguished by its reparative power.
The psychical principles of association, indeed, and the physiological principles of nutrition, simply express – the former in terms of mind,
the latter in terms of brain – the universally admitted fact that any sequence of mental action which has been frequently repeated tends to perpetuate itself; so that we find ourselves automatically prompted to think, feel, or do what we have been before accustomed to think, feel, or do, under like circumstances, without any consciously formed purpose, or anticipation of results. For, when the organic modification has been once fixed in the growing brain, it becomes a part of the normal fabric, and is regularly maintained by nutritive substitution; so that it may endure to the end of life, like the scar of a wound.
Forgetting can drive me crazy (literally), but it doesn’t neseccarily mean a physiological or mental issue:orgetting also helps to reconcile the storage of new information with old knowledge.
Memory performance is usually related to the active functioning of three stages. These three stages are:
memory is understood as an informational processing system with explicit and implicit functioning that is made up of a sensory processor, short-term (or working) memory, and long-term memory
Working memory serves as an encoding and retrieval processor.
Explicit and implicit functions of memory are also known as declarative and non-declarative systems.
Declarative, or explicit, memory is the conscious storage and recollection of data.
Under declarative memory resides semantic and episodic memory.
Semantic memory refers to memory that is encoded with specific meaning, while episodic memory refers to information that is encoded along a spatial and temporal plane. Declarative memory is usually the primary process thought of when referencing memory.
Non-declarative, or implicit, memory is the unconscious storage and recollection of information.
An example of a non-declarative process would be the unconscious learning or retrieval of information by way of procedural memory, or a priming phenomenon. Priming is the process of subliminally arousing specific responses from memory and shows that not all memory is consciously activated, whereas procedural memory is the slow and gradual learning of skills that often occurs without conscious attention to learning.
The ways by which information is encoded, stored, and retrieved can all be corrupted.
Brain-derived neurotrophic factor, also known as BDNF, is a protein that, in humans, is encoded by the BDNF Gene. BDNF is a member of the neurotrophin family of growth factors, which are related to the canonical nerve growth factor.
BDNF acts on certain neurons of the central nervous system and the peripheral nervous system, helping to support the survival of existing neurons, and encourage the growth and differentiation of new neurons and synapses. In the brain, it is active in the hippocampus, cortex, and basal forebrain—areas vital to learning, memory, and higher thinking. BDNF is also expressed in the retina, kidney, saliva, prostate, motor neurons and skeletal muscle.
BDNF itself is important for long-term memory. Although the vast majority of neurons in the mammalian brain are formed prenatally, parts of the adult brain retain the ability to grow new neurons from neural stem cells in a process known as neurogenesis. Neurotrophins are proteins that help to stimulate and control neurogenesis, BDNF being one of the most active
Sensory inputs from environmental stimuli are initially processed by the cortex before being transmitted to the hippocampus along an afferent pathway, suggesting the activity-mediated effects of enrichment can be far-reaching within the brain.
Ways to increase BDNF include exercise, meditation, deep sleep, and sunlight.
Things that block BDNF include stress, sugar, and social isolation.
High-intensity interval training evokes larger serum BDNF levels compared with intense continuous exercise.
Wear blue light blocking glasses – Shut down electronic devices two hours before bed
Nutrition to support BDNF: High-quality fats like grass-fed butter and wild-caught fish nourish your brain, Vitamin D, Krill Oil: Oily fish like sardines, krill, and salmon, Magnesium: almonds and raisins
meditation:taoist (breath through nose, left palm over right thumbs touching, tongue to roof of mouth)
whole steps and half steps :
progressing upward or downward one note at a time regardless if its a flat a sharp or neither from beginning to end, is a half step.
progressing upward or downward, beginning from a flat a sharp or neither, two notes at a time (with a note in between regardless if its a flat a sharp or neither) is a whole step.
there are 2 main scales :
major(happy) W – W – H – W – W – W – H (when starting in the key of ‘C’, it progresses CDEFGABC without sharps or flats)
minor(dark) W – H – W – W – H – W – W (when starting in the key of ‘C’, it progresses CD[Eb]FG[Ab][Bb]C
What is there to notice? That both scales follow the same pattern:
- w-w-h-w-w-w-h but they are start at different notes
- they both have all notes CDEFGABC, with the minor scale, E, A and B are flat
*in a scale only use an alphabet letter once
major & minor chords use the 1st tone, 3rd tone and 5th tone of their respective scales:
‘C’ major triad : [C] = 1, D = 2, [E] = 3, F = 4, [G] = 5, A = 6, B = 7, C = 8
‘C’ minor triad : [C] = 1, D = 2, [Eb] = 3, F = 4, [G] = 5, Ab = 6, Bb = 7, C = 8
circle of fourths/fifths
(Clockwise) : C|G|D|A|E|B(Cb)|Gb(F#)|Db(C#)|Ab|Eb|Bb|F|C
(Counter-clockwise) : C|F|Bb|Eb|Ab|Db(C#)|Gb(F#)|B(Cb)|E|A|D|G|C