I’ve always been interested in simulations. In college I would write very simple simulations, graph the output and marvel at the patterns that would emerge from things like the periodic oscillations of a predator/prey population set given a stable environment. It was so much fun to do that even if I knew the outcome. It was sort of my way of playing a game without actually playing a game. I…
I’m reposting this. I was looking through my old notes and stumbled onto this oldie. It really is such a superb way to dive into a subject. A four-step process to test your understanding of a given subject matter. Get a piece of paper and write the name of the technique/concept at the top Explain the concept in the most basic language possible. Avoid all technical jargon and pretend…
Tags Search tags: SPC n m or SPC o a m Add tag: SPC m q Links Insert link: SPC m l l File links have the structure [[file:relative_link_to_file][some_title]] To link to a specific heading in a file [[file:relative_link::header title][some_title]] header title can have spaces in it, e.g. relative_link.org::A Heading in a file External (web) links have the structure [[full_url][some_title]] To…
1 2 3 4 5 6 7 curl -0 -v -X POST https://some.api.com/graphql \ -H 'Content-Type: application/json' \ -d @- << EOF { 'query': 'query { someQuery (someArg: false) { name } }' } EOF curl will probably complain about the -X POST being inferred, but it shouldn’t harm anything. It can be left out.
Take a function like below… 1 2 3 4 5 6 7 8 type Combinable = string | number function add ( a : Combinable , b : Combinable ) : Combinable { if ( typeof a === 'string' || typeof b === 'string' ) { return a . toString () + b . toString () } return a + b } If we were to use this function like this: 1 2 const x = add ( 'black cat' , 'white dog' ) x . split ( ' ' ) // TS compiler will complain…
1 2 // say you have some var hangin' around called `name` let x : string = name ?? '(no name)' ?? is the nullish coalescing operator. It differs from || in that if you had (in the above example) 1 let x : string = name || '(no name)' name equal to an empty string (which is falsey) x would then be assigned the value (no name) . The nullish coalescing operator will only use the right-hand assignment…
In TS@4 a type can reference itself, e.g. 1 2 3 4 5 6 7 8 9 type JSONValue = | string | number | boolean | null | JSONValue [] | { [ k : string ] : JSONValue } Previously, this would not be possible without some messy hacks.
1 type Address = [ number , string , string , number ] Say you now have a function printAddress which takes an Address type as its arg. 1 2 3 function printAddress (... address : Address ) { // ...stuff } Your editor (before TS@4 ) would hint that the arguments were something like: address_0: number, address_1: string, ...etc which is not really helpful because address_0: number doesn’t…
1 type Foo < T extends any [] > = [ boolean , ... T , boolean ] Before TS@4.0 ...T would need to be the last element, but now we can spread the T type nested between known types; e.g. “This array will have a boolean, with some stuff (strings, numbers, etc.), and another boolean”.
TypeScript has a way of describing a build process as multiple subpieces of a project. This saves from having to build every piece, and instead build independent parts and stitch them together as needed. In a monorepo environment, multiple packages will have multiple builds and, possibly, refer to those builds amongst each other. The root tsconfig.json file can be used, but a problem of…
Out of the box, Jest mostly works in a Monorepo environment, with the exception of a few Babel plugins so that (as an example) TypeScript works. Needs: @babel/preset-env (Babel will transform whatever it needs to transform based on the build target, e.g. TypeScript, IE11, ES6, Node10, etc.) @babel/preset-typescript (Babel will strip out the symbols that are specific to TypeScript) The root-level…
“colocation” is a pattern wherein you keep the query/mutation as close to the consuming component as possible. In many instances, it’s in the exact file. This is in contrast with the DRY approach, which would beg the author to push queries/mutations higher up and imported into whichever file needs it.
package.json resolutions field yarn specific Allows you to force the use of a particular version for a nested dependency. e.g.: 1 2 3 4 'devDependencies' : { '@angular/cli' : '1.0.3' , 'typescript' : '2.3.2' } yarn.lock will contain: 1 2 3 4 5 6 7 'typescript@>=2.0.0 <2.3.0' : version '2.2.2' resolved…
A cipher is defined over the spaces of: All Keys, \(\mathscr{K}\) All Messages, \(\mathscr{M}\) All Cipher texts, \(\mathscr{C}\) Cipher (defined as a triple, \((\mathscr{K}, \mathscr{M}, \mathscr{C})\)) as a pair of algorithms \((\mathbf{E}, \mathbf{D})\) where \(\mathbf{E}\) represents the encryption algorithm and \(\mathbf{D}\) represents the decryption algorithm. \begin{equation} \mathbf{E}:…
A vector with non-negative components (representing specific probabilities) which add up to one e.g. \begin{equation} (P(x_{0}), P(x_{1}),…,P(x_{n})) \end{equation} Also known as: Stochastic Vector
\begin{equation} x \in U:P(x) = \frac{1}{|U|} \end{equation} Where \(|U|\) is the size of the universe (set). In Probability Theory, a uniform distribution assigns an equal probability to each element of a given set.
x 0 : P(x) = 1,∀ x ≠ x 0 : P(x) = 0 In Probability Theory, a point distribution is a distribution which assigns all the probability to a given point (set element).
The measurement of accuracy of a hypothesis function . The accuracy is given as an average difference of all the results of the hypothesis from the inputs (\(x\)’s) to the outputs (\(y\)’s). \begin{equation} J(\Theta_{0},\Theta_{1})=\frac{1}{2m}\sum_{i=1}^{m}(h_{\Theta}(x_{i}) - y_{i})^{2} \end{equation} where \(m\) is the number of inputs (e.g. training examples) This function is also…
An optimization algorithm for finding the local minimum of a differentiable function. (The red arrows show the minimums of \(J(\Theta_{0},\Theta_{1})\), i.e. the cost function ) To find the minimum of the cost function , we take its derivative and “move along” the tangential line of steepest (negative) descent. Each “step” is determined by the coefficient \(\alpha\), which…
Artificial Neural Network (ANN) Layers All learning occurs in the layers. In the image, below, there are three layers, but there could be only one, or many more. In the example image the first layer is known as the Input Layer , the second the Hidden Layer , and the third the Output Layer . In a 3+ layered ANN, any layer that is not the input/output layer is a Hidden Layer . Input The data being…
A linear mapping from a vector space to a field of scalars. In other words, a linear function which acts upon a vector resulting in a real number (scalar) \begin{equation} \alpha\,:\,\mathbf{V} \longrightarrow \mathbb{R} \end{equation} Simplistically, covectors can be thought of as “row vectors”, or: \begin{equation} \begin{bmatrix} 1 & 2 \end{bmatrix} \end{equation} This might look…
A mapping from \(\mathbf{V} \rightarrow \mathbf{W}\) that preserves the operations of addition and scalar multiplication. Also known as Linear Map Linear Transformation Linear Function
The space of all linear functionals \(f:V\rightarrow \mathbb{R}\), noted as \(V^{*}\) The dual space has the same dimension as the corresponding vector space or, given a space \(V\), with bases \((v_{1},…,v_{n})\), there exists a dual space \(V^{*}\) with a dual basis \((v^{*}_{1},…,v^{*}_{n})\).
The space of all linear functionals \(f:V\rightarrow \mathbb{R}\), noted as \(V^{*}\) The dual space has the same dimension as the corresponding vector space or, given a space \(V\), with bases \((v_{1},…,v_{n})\), there exists a dual space \(V^{*}\) with a dual basis \((v^{*}_{1},…,v^{*}_{n})\).
The bubble, created by the Sun’s plasma (see Solar Wind ), which encompasses the Sun itself. Outside of this bubble, the Sun’s plasma is overwhelmed by the Interstellar plasma.
As a linear representation A tensor can be represented as a vector of x-number of dimensions. Basically, a generalization on top of scalars, vectors, and matrices. The specific “flavor” of the tensor (i.e. is it a scalar, vector, or matrix) is clarified by referring to the tensor’s “rank”. For instance; a rank 0 tensor is a scalr, rank 1 tensor is a one-dimensional…
a basis for an n-dimensional vector space \(V\) is any ordered set of linearly independent vectors \((\mathbf{e}_{1}, \mathbf{e}_{2},…,\mathbf{e}_{n})\) An arbitrary vector \(\mathbf{x}\) in \(V\) can be expressed as a linear combination of the basis vectors: \begin{equation} \mathbf{x}\,=\,\sum\limits_{i = 1}^{n} \mathbf{e}_{i}x^{i} \end{equation} See Bases Transformation , Coordinate…
Consider two bases \((\mathbf{e}_{1},\mathbf{e}_{2})\) and \((\mathbf{\tilde{e}}_{1},\mathbf{\tilde{e}}_{2})\), where we consider the former the old basis and the latter the new basis . Each vector \((\mathbf{\tilde{e}}_{1},\mathbf{\tilde{e}}_{2})\) can be expressed as a linear combination of \((\mathbf{e}_{1},\mathbf{e}_{2})\): \begin{equation}…
\begin{equation} \mathbf{I}(\mathbf{X})=\mathbf{X} \end{equation} Where any \(nxn\) matrix is established via the Kronecker Delta , e.g. \begin{equation} \mathbf{I}_{ij}\,=\,\delta_{ij} \end{equation}
A matrix, which when multiplied by another matrix, results in the identity matrix . \begin{equation} \mathbf{A}\mathbf{A}^{-1} = I \end{equation} e.g. \begin{equation} \begin{bmatrix} a & b\\\ c & d \end{bmatrix} \begin{bmatrix} d & -b\\\ -c & a \end{bmatrix}= \begin{bmatrix} 1 & 0\\\ 0 & 1 \end{bmatrix} \end{equation}
also known as a linear space A collection of objects known as “vectors”. In the Euclidean space these can be visualized as simple arrows with a direction and a length, but this analogy will not necessarily translate to all spaces. Addition and multiplication of these objects (vectors) must adhere to a set of axioms for the set to be considered a “vector space”. Addition (+)…
To qualify as a vector space , a set \(V\) and its associated operations of addition (\(+\)) and multiplication/scaling (\(\cdot\)) must adhere to the below: Associativity \begin{equation} \mathbf{u}+(\mathbf{v}+\mathbf{w}) = (\mathbf{u} + \mathbf{v}) + \mathbf{w} \end{equation} Commutivity \begin{equation} \mathbf{u} + \mathbf{v} = \mathbf{v} + \mathbf{u} \end{equation} Identity of Addition There…
An property (of a mathematical object) is invariant if, after some operation(s) are applied, that property remains unchanged. For instance, in a geometrical space where the concept of “length” is defined (by some metric); a physical object, say a pencil, will maintain its characteristics (length) despite a change of coordinates (e.g. polar to cartesian). In short, vectors are…
source The Inflationary Universe: A Possible Solution To The Horizon And Flatness Problems (Guth, 1980) Questions I still have DONE WHY#1: why is that approximation unstable? See Flatness Problem Abstract The initial conditions defined in the Standard Model present two problems: The early universe is defined to be homogeneous despite the massive distances between regions (causal disconnect) The…
This refers to the Cosmological “Standard Model”, i.e. the \(\Lambda\)CDM. This is not the same as the Standard Model of Particle Physics Lambda-CDM The lambda-cdm or, lambda cold-dark-matter, is a three-parameter description of the Big Bang Cosmological model parametrized by: the Cosmological Constant \(\Lambda\) dark matter normal matter Of the cosmological models, this presents the…
The Cosmological Principle states that at large enough scales (>100Mpc) the universe’s matter distribution is isotropic and homogeneous and should not produce irregularities in the large-scale structure of the universe over the course of its evolution.