Competitive Programming - Bit Shifting, Formulas, and More., Machine Learning - Andrew Ng, Vanilla JS Project Bits, Programming Paradigms & Functional Programming & Haskell, Angular 2, Javascript: OOP, Design Patterns and more, JS Datastructures, Rea...

Competitive Programming - Bit Shifting, Formulas, and More., Machine Learning - Andrew Ng, Vanilla JS Project Bits, Programming Paradigms & Functional Programming & Haskell, Angular 2, Javascript: OOP, Design Patterns and more, JS Datastructures, Rea...

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

Get absolute value of n using bit ops?

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

5

All-time users

7

Favorites

0

Last updated

4 years ago

Date created

Mar 1, 2020

Cards (918)

Section 1

(50 cards)

Get absolute value of n using bit ops?

Front

(n ^ (n >> 31)) - (n >> 31);

Back

Clustering

Front

a method of unsupervised learning - a good way of discovering unknown relationships in datasets. Cluster analysis or clustering is the task of grouping a set of objects in such a way that objects in the same group (called a cluster) are more similar (in some sense or another) to each other than to those in other groups (clusters). It is a main task of exploratory data mining, and a common technique for statistical data analysis, used in many fields, including machine learning, pattern recognition, image analysis, information retrieval, bioinformatics, data compression, and computer graphics. Cluster analysis itself is not one specific algorithm, but the general task to be solved. It can be achieved by various algorithms that differ significantly in their notion of what constitutes a cluster and how to efficiently find them. Popular notions of clusters include groups with small distances among the cluster members, dense areas of the data space, intervals or particular statistical distributions. Clustering can therefore be formulated as a multi-objective optimization problem. The appropriate clustering algorithm and parameter settings (including values such as the distance function to use, a density threshold or the number of expected clusters) depend on the individual data set and intended use of the results. Cluster analysis as such is not an automatic task, but an iterative process of knowledge discovery or interactive multi-objective optimization that involves trial and failure. It is often necessary to modify data preprocessing and model parameters until the result achieves the desired properties.

Back

How to toggle a bit?

Front

number ^= 1 << x;

Back

What does this hypothesis represent? h_theta(x) = theta_0 + theta_1 x

Front

univariate linear regression model

Back

Target Function definition?

Front

Target function: In predictive modeling, we are typically interested in modeling a particular process; we want to learn or approximate a particular function that, for example, let's us distinguish spam from non-spam email. The target function f(x) = y is the true function f that we want to model. The target function is the (unknown) function which the learning problem attempts to approximate.

Back

Sum of an arithmetic sequence?

Front

S_n = terms(a_1 + a_n) / 2

Back

Why do we square instead of using the absolute value when calculating variance and standard deviation?

Front

First I'll answer the mathematical question asked in the question details, which I'm going to restate because I think it is stated wrong: The short answer is "Because of Jensen's inequality." See http://en.wikipedia.org/wiki/Jen... and the rest of the article for context. It says in particular that for a concave function What about the more general question, "Why variance?" I don't believe there is any compelling conceptual reason to use variance as a measure of spread. If forced to choose, my guess is that most people would say more robust measures like interquartile range or MAD better capture the concept of "spread" in most cases. But variance (and more generally "sum of squares") has some attractive properties, many of which flow from the Pythagorean theorem one way or another. Here some of them, without much math: We can decompose sums of squares into meaningful components like "between group variance" and "within-group variance." To generalize the above point, when a random variable Y Y is partly explained by another random variable X X there is a useful decomposition of the variance of Y Y into the part explained by X X and the unexplained part. (See http://en.wikipedia.org/wiki/Law...). If we think more broadly about mean squared error, this too can be decomposed into the sum of variance and squared bias. It is easy to interpret this total error as the sum of "systematic error" and "noise." Often we want to minimize our error. When the error is a sum of squares, we are minimizing something quadratic. This is easily accomplished by solving linear equations. So yes, variance and mean squared error are conveniences rather than conceptual necessities. But they are convenient conveniences.

Back

What is left associativity?

Front

a Q b Q c If Q is left associative, then it evaluates as (a Q b) Q c And if it is right associative, then it evaluates as a Q (b Q c)

Back

The sum of powers of two is...

Front

2^(n+1) - 1

Back

Model definition?

Front

Model: In machine learning field, the terms hypothesis and model are often used interchangeably. In other sciences, they can have different meanings, i.e., the hypothesis would be the "educated guess" by the scientist, and the model would be the manifestation of this guess that can be used to test the hypothesis.

Back

Synonym for output variable?

Front

Targets

Back

How to clear a bit

Front

number &= ~(1 << x);

Back

Nth term of geometric series?

Front

a_n = a_1 * r^(n-1)

Back

How to swap two values a,b using bits?

Front

a ^= b; b ^= a; a ^= b; OR (easier to memorize) x = x xor y y = x xor y x = x xor y

Back

How to fill first byte with 1's to a variable x?

Front

x |= (0xFF)

Back

Can you assign to a const after declaring the const?

Front

No. A const promises that we won't change the value of the variable for the rest of its life and this is considered a reassignment or rewrite.

Back

Classifier?

Front

Classifier: A classifier is a special case of a hypothesis (nowadays, often learned by a machine learning algorithm). A classifier is a hypothesis or discrete-valued function that is used to assign (categorical) class labels to particular data points. In the email classification example, this classifier could be a hypothesis for labeling emails as spam or non-spam. However, a hypothesis must not necessarily be synonymous to a classifier. In a different application, our hypothesis could be a function for mapping study time and educational backgrounds of students to their future SAT scores.

Back

3D Surface Plot - how can it be used to plot the cost function?

Front

Theta 0 and Theta 1 in a univariate linear regression can be plotted on the x and y axes. the Z axis will indicate the actual cost

Back

Training sample definition?

Front

Training sample: A training sample is a data point x in an available training set that we use for tackling a predictive modeling task. For example, if we are interested in classifying emails, one email in our dataset would be one training sample. Sometimes, people also use the synonymous terms training instance or training example.

Back

Learning algorithm?

Front

Learning algorithm: Again, our goal is to find or approximate the target function, and the learning algorithm is a set of instructions that tries to model the target function using our training dataset. A learning algorithm comes with a hypothesis space, the set of possible hypotheses it can come up with in order to model the unknown target function by formulating the final hypothesis

Back

Cost function vs Gradient Descent?

Front

A cost function is something you want to minimize. For example, your cost function might be the sum of squared errors over your training set. Gradient descent is a method for finding the minimum of a function of multiple variables. So you can use gradient descent to minimize your cost function. If your cost is a function of K variables, then the gradient is the length-K vector that defines the direction in which the cost is increasing most rapidly. So in gradient descent, you follow the negative of the gradient to the point where the cost is a minimum. If someone is talking about gradient descent in a machine learning context, the cost function is probably implied (it is the function to which you are applying the gradient descent algorithm).

Back

Get Max Int (Bit Ops)

Front

int maxInt = ~(1 << 31); int maxInt = (1 << 31) - 1; int maxInt = (1 << -1) - 1;

Back

How to set any bit?

Front

number |= 1 << x;

Back

when does a stream stop writing

Front

whitespace encounter

Back

How to check if the nth bit is set?

Front

if (x & (1 << n)) { //set } else { //not-set }

Back

How to check if a number is a power of two?

Front

(n & (n - 1)) == 0 this works because every power of 2 has just one 1 in binary

Back

Derive SSE

Front

Given a linear regression model, the difference at each predicted point with the correct point is given by diff = y_i - (mx + b)

Back

How to detect if two integers have opposite signs?

Front

int x, y; // input values to compare signs bool f = ((x ^ y) < 0); // true iff x and y have opposite signs

Back

Explain Two's Complements

Front

Back

local variables

Front

varaibles defined inside a pair of curly braces and exist only while executing the part of the program within those braces.

Back

Supervised learning

Front

Supervised learning is a type of machine learning algorithm that uses a known dataset (called the training dataset) to make predictions. The training dataset includes input data and response values. From it, the supervised learning algorithm seeks to build a model that can make predictions of the response values for a new dataset. A test dataset is often used to validate the model. Using larger training datasets often yield models with higher predictive power that can generalize well for new datasets. Called Supervised learning BECAUSE the data is labeled with the "correct" responses.

Back

What is an octet? Why do we use the term?

Front

An octet is a unit of digital information in computing and telecommunications that consists of eight bits. The term is often used when the term byte might be ambiguous, since historically there was no standard definition for the size of the byte.

Back

Bitwise Swap Intuition x = x xor y y = x xor y x = x xor y

Front

On line 1 we combine x and y (using XOR) to get this "hybrid" and we store it back in x. XOR is a great way to save information, because you can remove it by doing an XOR again. So, this is exactly what we do on line 2. We XOR the hybrid with y, which cancels out all the y information, leaving us only with x. We save this result back into y, so now they have swapped. On the last line, x still has the hybrid value. We XOR it yet again with y (now with x's original value) to remove all traces of x out of the hybrid. This leaves us with y, and the swap is complete! The mathematics are fairly simple and work because XOR has a useful property, when you XOR A and B, you get a value C. If you XOR C and A you'll get B back, if you XOR C and B you'll get A back.

Back

Add one to n using bit ops

Front

-~n

Back

Sum of geometric series?

Front

S_n = a_1(1-r^n)/(1-r)

Back

Nth term of arithmetic sequence?

Front

a_n = a_1 + (n-1)d

Back

Synonym for Input variable?

Front

Features

Back

What is a stream?

Front

In computer science, a stream is a sequence of data elements made available over time. A stream can be thought of as items on a conveyor belt being processed one at a time rather than in large batches Streams are processed differently from batch data - normal functions cannot operate on streams as a whole, as they have potentially unlimited data, and formally, streams are codata (potentially unlimited), not data (which is finite). Functions that operate on a stream, producing another stream, are known as filters, and can be connected in pipelines, analogously to function composition. Filters may operate on one item of a stream at a time, or may base an item of output on multiple items of input, such as a moving average. - processed one at a time rather than in batches

Back

Get Min Int (Bit Ops)

Front

int minInt = 1 << 31; int minInt = 1 << -1;

Back

What is SSE?

Front

The sum of squared error

Back

How do you change the sign of an integer?

Front

~x + 1

Back

Subtract one to n using bit ops

Front

~-n

Back

character literals in C++

Front

completely distinct from string literals - and always enclosed in single quotes whereas strings are always enclosed in double quotes.

Back

Cocktail party effect/problem

Front

The cocktail party effect is the phenomenon of being able to focus one's auditory attention on a particular stimulus while filtering out a range of other stimuli, much the same way that a partygoer can focus on a single conversation in a noisy room. Example of source separation.

Back

What are contour plots?

Front

A contour plot is a graphical technique for representing a #D surface by plotting constant z slices, called contours onto a 2Dimensional format. That is, given a value for z, lines are drawn for connecting the x,y, coordinates twhere that z value occurs. The circles in a contour plot are called level sets - the function J is equal here.The center of the contour plot is the minimum of the cost function typically in ML.

Back

What is "hypothesis" in machine learning?

Front

Hypothesis: A hypothesis is a certain function that we believe (or hope) is similar to the true function, the target function that we want to model. In context of email spam classification, it would be the rule we came up with that allows us to separate spam from non-spam emails.

Back

Regression vs Classification?

Front

Regression: the output variable takes continuous values. - Price of house given a size. Classification: the output variable takes class labels, or discrete value output - Breast cancer, malignant or benign? Almost like quantitative vs categorical

Back

Unsupervised learning

Front

Unsupervised learning is the machine learning task of inferring a function to describe hidden structure from unlabeled data. Since the examples given to the learner are unlabeled, there is no error or reward signal to evaluate a potential solution. This distinguishes unsupervised learning from supervised learning and reinforcement learning. Unsupervised learning is closely related to the problem of density estimation in statistics.[1] However unsupervised learning also encompasses many other techniques that seek to summarize and explain key features of the data.

Back

What is a nibble in Computer Programming?

Front

Half an octet, 4-bit aggregation 0xF

Back

In 8-bit Two's Complement what is -1 in binary, what about -127?

Front

1111 1111

Back

Section 2

(50 cards)

What is the formula for theta in a normal equation?

Front

Back

SSE formula?

Front

observation - mean for each observation squared.

Back

Document.querySelector(String selector)

Front

returns the first element node within the document in document order that matches the specified selectors.

Back

What are polymorphic types in Haskell?

Front

Haskell also incorporates polymorphic types---types that are universally quantified in some way over all types. Polymorphic type expressions essentially describe families of types. For example, (forall a)[a] is the family of types consisting of, for every type a, the type of lists of a. Lists of integers (e.g. [1,2,3]), lists of characters (['a','b','c']), even lists of lists of integers, etc., are all members of this family. (Note, however, that [2,'b'] is not a valid example, since there is no single type that contains both 2 and 'b'.)

Back

Gradient Descent for linear regression?

Front

(Review again)

Back

K-Fold?

Front

In k-fold cross-validation, the original sample is randomly partitioned into k equal sized subsamples. Of the k subsamples, a single subsample is retained as the validation data for testing the model, and the remaining k − 1 subsamples are used as training data. The cross-validation process is then repeated k times (the folds), with each of the k subsamples used exactly once as the validation data. The k results from the folds can then be averaged to produce a single estimation. The advantage of this method over repeated random sub-sampling (see below) is that all observations are used for both training and validation, and each observation is used for validation exactly once. 10-fold cross-validation is commonly used,[7] but in general k remains an unfixed parameter. When k=n (the number of observations), the k-fold cross-validation is exactly the leave-one-out cross-validation. In stratified k-fold cross-validation, the folds are selected so that the mean response value is approximately equal in all the folds. In the case of a dichotomous classification, this means that each fold contains roughly the same proportions of the two types of class labels. Ultimately this helps fix the problem that we want to maximize both the training and test sets in cross-validation.

Back

What happens if you initialize a parameter at a local minimum and attempt to use gradient descent on it?

Front

The derivative turns out to be zero because the tangent is a flat line meaning that regardless of alpha it is multiplied by zero, indicating no change.

Back

"Batch" Gradient Descent (BGD or GD)

Front

Each step of gradient descent uses all the training examples. batch GD - This is different from (SGD - stochastic gradient descent or MB-GD - mini batch gradient descent) In GD optimization, we compute the cost gradient based on the complete training set; hence, we sometimes also call it batch GD. In case of very large datasets, using GD can be quite costly since we are only taking a single step for one pass over the training set -- thus, the larger the training set, the slower our algorithm updates the weights and the longer it may take until it converges to the global cost minimum (note that the SSE cost function is convex).

Back

What does the derivative of a function tell us?

Front

The derivative of a function of a real variable measures the sensitivity to change of a quantity (a function value or dependent variable) which is determined by another quantity (the independent variable). Derivatives are a fundamental tool of calculus. For example, the derivative of the position of a moving object with respect to time is the object's velocity: this measures how quickly the position of the object changes when time is advanced. The derivative of a function of a single variable at a chosen input value, when it exists, is the slope of the tangent line to the graph of the function at that point. The tangent line is the best linear approximation of the function near that input value. For this reason, the derivative is often described as the "instantaneous rate of change", the ratio of the instantaneous change in the dependent variable to that of the independent variable.

Back

Standardization vs normalization

Front

Normalization rescales the values from to a range of [0,1]. This might useful in some cases where all parameters need to have the same positive scale, but outliers from data set are lost. Xchanged = (X - Xmin)/(Xmax-Xmin) Standardization rescales data to have a mean of 0 and standard deviation of 1 (unit variance). Xchanged = (x-mean)/sd For most applications standardization is recommended. In the business world, "normalization" typically means that the range of values are "normalized to be from 0.0 to 1.0". "Standardization" typically means that the range of values are "standardized" to measure how many standard deviations the value is from its mean. However, not everyone would agree with that. It's best to explain your definitions before you use them. In any case, your transformation needs to provide something useful.

Back

What is normalization?

Front

In statistics and applications of statistics, normalization can have a range of meanings.[1] In the simplest cases, normalization of ratings means adjusting values measured on different scales to a notionally common scale, often prior to averaging. In more complicated cases, normalization may refer to more sophisticated adjustments where the intention is to bring the entire probability distributions of adjusted values into alignment. In the case of normalization of scores in educational assessment, there may be an intention to align distributions to a normal distribution. A different approach to normalization of probability distributions is quantile normalization, where the quantiles of the different measures are brought into alignment.

Back

What is the downside of using an alpha (learning rate) that is too big?

Front

Gradient descent can overshoot the minimum and it may fail to converge or even diverge.

Back

What is a lambda expression?

Front

lambda expression in computer programming, also called anonymous function, a function (or a subroutine) defined, and possibly called, without being bound to an identifier Lambda Expressions are nameless functions given as constant values. They can appear anywhere that any other constant may, but are typically written as a parameter to some other function. The canonical example is that you'll pass a comparison function to a generic "sort" routine, and instead of going to the trouble of defining a whole function (and incurring the lexical discontinuity and namespace pollution) to describe this comparison, you can just pass a lambda expression describing the comparison. HOWEVER, this misses one of the most important features of Lambda Expressions, which is that they execute in the context of their appearance. Therefore, they can use the values of the variables that are defined in that context. This differentiates function-pointers from true lambda expressions. In languages supporting mutable variables, proper lambda expressions offer the power change the values of those variables. Lambda expressions are rooted in lambda calculus.

Back

Gradient Descent algorithm

Front

Image result for gradient descent Gradient descent is a first-order optimization algorithm. To find a local minimum of a function using gradient descent, one takes steps proportional to the negative of the gradient (or of the approximate gradient) of the function at the current point. used with simultaneous updates of the parameters of success Susceptible to falling into local optimum depending on initialization.

Back

What does it mean for an algorithm to converge?

Front

An iterative algorithm is said to converge when as the iterations proceed the output gets closer and closer to a specific value. In some circumstances, an algorithm will diverge; its output will undergo larger and larger oscillations, never approaching a useful result. The "converge to a global optimum" phrase in your first sentence is a reference to algorithms which may converge, but not to the "optimal" value (e.g. a hill-climbing algorithm which, depending on initial conditions, may converge to a local maximum, never reaching the global maximum).

Back

How to make sure gradient descent is working properly?

Front

create an automatic convergence test - declare convergence based on amount of decrease of J(Theta) plot on graph, y axis being J and axis being number of iterations.

Back

hypothesis model

Front

remember that the HYPOTHESIS MODEL or SET is what is depicted with h(theta)

Back

What to do when J(Theta) is moving up and down in waves ?

Front

Use a smaller Alpha!!

Back

Definition of stochastic?

Front

randomly determined; having a random probability distribution or pattern that may be analyzed statistically but may not be predicted precisely.

Back

Convex functions?

Front

In mathematics, a real-valued function defined on an interval is called convex (or convex downward or concave upward) if the line segment between any two points on the graph of the function lies above or on the graph, in a Euclidean space (or more generally a vector space) of at least two dimensions. Equivalently, a function is convex if its epigraph (the set of points on or above the graph of the function) is a convex set. Well-known examples of convex functions include the quadratic function {\displaystyle x^{2}} x^{2} and the exponential function {\displaystyle e^{x}} e^{x} for any real number x. Convex functions play an important role in many areas of mathematics. They are especially important in the study of optimization problems where they are distinguished by a number of convenient properties. For instance, a (strictly) convex function on an open set has no more than one minimum.

Back

What letter is typically used to depict a cost function?

Front

Function J

Back

Inflection points

Front

Inflection points are where the function changes concavity. Since concave up corresponds to a positive second derivative and concave down corresponds to a negative second derivative, then when the function changes from concave up to concave down (or vise versa) the second derivative must equal zero at that point. So the second derivative must equal zero to be an inflection point. But don't get excited yet. You have to make sure that the concavity actually changes at that point.

Back

What does theta typically represent in stat/ML?

Front

quite often θ stands for the set of parameters of a distribution.

Back

Array.prototype.slice vs Array.prototype.slice is a good demonstration of what?

Front

A pure function vs a non-pure function. arr.slice([begin[, end]]) --> begin is zero-indexed, end is zero-indexed but is not included in the slice. slice does NOT alter the given array. It returns a shallow copy of elements from the original array. array.splice(start, deleteCount[, item1[, item2[, ...]]]) --> start is the beginning index to start changing the array, deleteCount is the number of elements to delete, items are anything to be added var myFish = ['angel', 'clown', 'mandarin', 'surgeon']; // removes 0 elements from index 2, and inserts 'drum' var removed = myFish.splice(2, 0, 'drum'); // myFish is ['angel', 'clown', 'drum', 'mandarin', 'surgeon'] // removed is [], no elements removed // myFish is ['angel', 'clown', 'drum', 'mandarin', 'surgeon'] // removes 1 element from index 3 removed = myFish.splice(3, 1); // myFish is ['angel', 'clown', 'drum', 'surgeon'] // removed is ['mandarin'] // myFish is ['angel', 'clown', 'drum', 'surgeon'] // removes 1 element from index 2, and inserts 'trumpet' removed = myFish.splice(2, 1, 'trumpet'); // myFish is ['angel', 'clown', 'trumpet', 'surgeon'] // removed is ['drum'] // myFish is ['angel', 'clown', 'trumpet', 'surgeon'] // removes 2 elements from index 0, and inserts 'parrot', 'anemone' and 'blue' removed = myFish.splice(0, 2, 'parrot', 'anemone', 'blue'); // myFish is ['parrot', 'anemone', 'blue', 'trumpet', 'surgeon'] // removed is ['angel', 'clown'] // myFish is ['parrot', 'anemone', 'blue', 'trumpet', 'surgeon'] // removes 2 elements from index 2 removed = myFish.splice(myFish.length -3, 2); // myFish is ['parrot', 'anemone', 'surgeon'] // removed is ['blue', 'trumpet']

Back

Who founded Lambda Calculus?

Front

Alonzo Church (1930)

Back

How to iterate across an object with side effects?

Front

use the for... in loop while checking .hasOwnProperty because for...in will check parents as well.

Back

Node.appendChild()

Front

Node.appendChild() method adds a node to the end of the list of children of a specified parent node. If the given child is a reference to an existing node in the document, appendChild() moves it from its current position to the new position.

Back

What is the difference between a deep copy and a shallow copy?

Front

Shallow copies duplicate as little as possible. A shallow copy of a collection is a copy of the collection structure, not the elements. With a shallow copy, two collections now share the individual elements. Deep copies duplicate everything. A deep copy of a collection is two collections with all of the elements in the original collection duplicated.

Back

why use features that are on a similar scale?

Front

contour plots with differently scaled features will be extremely thin or extremely fat resulting in a very slow gradient descent (convergence is slower) get them to a -1 <= x <= 1 scale. poorly scaled is too large -100 to 100 or -0.00001 or 0.00001

Back

multivariate linear regression

Front

ask: why is the notation shorter and what does that convenience notation indicate?

Back

What are first order methods in numerical analysis?

Front

In numerical analysis, methods that have at most linear local error are called first order methods. They are frequently based on finite differences, a local linear approximation.

Back

What is a Node?

Front

A Node is an interface from which a number of DOM types inherit and allow these various types to be treated or tested similarly.

Back

What is the downside of using an alpha (learning rate) that is too small?

Front

Gradient descent can be way too slow.

Back

What is feature scaling?

Front

Feature scaling is a method used to standardize the range of independent variables or features of data. In data processing, it is also known as data normalization and is generally performed during the data preprocessing step. The range of values of raw data varies widely, in some machine learning algorithms, objective functions will not work properly without normalization[citation needed]. For example, the majority of classifiers calculate the distance between two points by the Euclidean distance[citation needed]. If one of the features has a broad range of values, the distance will be governed by this particular feature[citation needed]. Therefore, the range of all features should be normalized so that each feature contributes approximately proportionately to the final distance[citation needed]. Another reason why feature scaling is applied is that gradient descent converges much faster with feature scaling than without it[citation needed]. Some methods are rescaling, standardization, scaling to unit length.

Back

Why is it unnecessary to change alpha over time to ensure that the gradient descent converges to a local minimum?

Front

As we approach a local minimum, the gradient descent will take smaller steps because of the change of the derivative or the steepness of the cost function J. Don't need to worry about divergence.

Back

Higher derivatives?

Front

Let f be a differentiable function, and let f ′(x) be its derivative. The derivative of f ′(x) (if it has one) is written f ′′(x) and is called the second derivative of f. Similarly, the derivative of a second derivative, if it exists, is written f ′′′(x) and is called the third derivative of f. Continuing this process, one can define, if it exists, the nth derivative as the derivative of the (n-1)th derivative. These repeated derivatives are called higher-order derivatives. The nth derivative is also called the derivative of order n.

Back

Document.createElement

Front

In an HTML document, the Document.createElement() method creates the specified HTML element or an HTMLUnknownElement if the given element name isn't a known one.

Back

Document.createTextNode(data)

Front

Back

What is cross-validation?

Front

Cross-validation, sometimes called rotation estimation,[1][2][3] is a model validation technique for assessing how the results of a statistical analysis will generalize to an independent data set. It is mainly used in settings where the goal is prediction, and one wants to estimate how accurately a predictive model will perform in practice. In a prediction problem, a model is usually given a dataset of known data on which training is run (training dataset), and a dataset of unknown data (or first seen data) against which the model is tested (testing dataset).[4] The goal of cross validation is to define a dataset to "test" the model in the training phase (i.e., the validation dataset), in order to limit problems like overfitting, give an insight on how the model will generalize to an independent dataset (i.e., an unknown dataset, for instance from a real problem), etc.

Back

For a sufficiently small alpha...

Front

J(Theta) should decrease EVERY iteration

Back

Cubic functions...

Front

Back

What is a simple linear regression?

Front

In statistics, simple linear regression is the least squares estimator of a linear regression model with a single explanatory variable. In other words, simple linear regression fits a straight line through the set of n points in such a way that makes the sum of squared residuals of the model (that is, vertical distances between the points of the data set and the fitted line) as small as possible. minimize squared error

Back

What function should you use when intentionally iterating with a predicate that produces side effects?

Front

Array.prototype.foreach(predicate) -- as recommended by Kyle Simpson

Back

x^i_j notation in ML means?

Front

an index into a training set for the ITH training example and JTH feature (input variable)

Back

Linear regression formula?

Front

Back

Pure Function conditions

Front

In computer programming, a function may be considered a pure function if both of the following statements about the function hold: The function always evaluates the same result value given the same argument value(s). The function result value cannot depend on any hidden information or state that may change while program execution proceeds or between different executions of the program, nor can it depend on any external input from I/O devices (usually—see below). Evaluation of the result does not cause any semantically observable side effect or output, such as mutation of mutable objects or output to I/O devices (usually—see below).

Back

First FP programming language?

Front

Lisp -- this is important because Lisp is often used as a good comparison and frequently referenced.

Back

What is overfitting?

Front

In statistics and machine learning, one of the most common tasks is to fit a "model" to a set of training data, so as to be able to make reliable predictions on general untrained data. In overfitting, a statistical model describes random error or noise instead of the underlying relationship. Overfitting occurs when a model is excessively complex, such as having too many parameters relative to the number of observations. A model that has been overfit has poor predictive performance, as it overreacts to minor fluctuations in the training data. how to avoid overfitting? cross-validation, regularization, early stopping, pruning, Bayesian priors on parameters or model comparison and more!

Back

What does J(Theta) increasing tell you about ur gradient descent?

Front

it's not working lol. use a bigger alpha. on the other end if you use too big of an alpha you'll end up with a bowl shaped curve and you might be moving farther away from convergence.

Back

What is a side effect?

Front

In computer science, a function or expression is said to have a side effect if it modifies some state or has an observable interaction with calling functions or the outside world. For example, a particular function might modify a global variable or static variable, modify one of its arguments, raise an exception, write data to a display or file, read data, or call other side-effecting functions. In the presence of side effects, a program's behaviour may depend on history; that is, the order of evaluation matters. Understanding and debugging a function with side effects requires knowledge about the context and its possible histories

Back

Section 3

(50 cards)

What is a Privileged Method?

Front

A privileged method is able to access the private variables and methods, and is itself accessible to the public methods and the outside. It is possible to delete or replace a privileged method, but it is not possible to alter it, or to force it to give up its secrets.

Back

class Student { fullName: string; constructor(public firstName, public middleInitial, public lastName) { this.fullName = firstName + " " + middleInitial + " " + lastName; } } interface Person { firstName: string; lastName: string; } function greeter(person : Person) { return "Hello, " + person.firstName + " " + person.lastName; } var user = new Student("Jane", "M.", "User"); document.body.innerHTML = greeter(user); Typescript -> ES5 compiles to....?

Front

var Student = (function () { function Student(firstName, middleInitial, lastName) { this.firstName = firstName; this.middleInitial = middleInitial; this.lastName = lastName; this.fullName = firstName + " " + middleInitial + " " + lastName; } return Student; }()); function greeter(person) { return "Hello, " + person.firstName + " " + person.lastName; } var user = new Student("Jane", "M.", "User"); document.body.innerHTML = greeter(user);

Back

Haskell: how to get type of expression in GHCI?

Front

:type expr

Back

Haskell: Select 2nd element of a list

Front

[1,2,3,4,5] !! 2 note that this is not a constant time operation because lists are not arrays in Haskell

Back

Haskell: Are functions first class citizens?

Front

yes

Back

@angular/common

Front

@angular/common - The commonly needed services, pipes and directives provided by the Angular team.

Back

Class definition

Front

Defines the object's characteristics. A class is a template definition of an object's properties and methods.

Back

Is Haskell lazy or strict?

Front

Haskell is often described as a lazy language. However, the language specification simply states that Haskell is non-strict, which is not quite the same thing as lazy.

Back

Haskell: Generalizations of <head> and <tail>?

Front

<take> and <drop>

Back

Object definition in OOP

Front

An instance of a class.

Back

@angular/upgrade

Front

Set of utilities for upgrading Angular 1 application2

Back

Write a file my-module.js that exports a default function cube! Then import it in another file. Use Default Exports

Front

// module "my-module.js" export default function cube(x) { return x x x; } import cube from 'my-module'; console.log(cube(3)); // 27

Back

What are the two types of Exports?

Front

Named exports: export { myFunction }; // exports a function declared earlier export const foo = Math.sqrt(2); // exports a constant Default exports (only one per script): export default function() {} // or 'export default class {}' // there is no semi-colon here

Back

Tsconfig.json?

Front

The tsconfig.json file specifies the root files and the compiler options required to compile the project.

Back

Constructor definition

Front

A method called at the moment an object is instantiated. It usually has the same name as the class containing it.

Back

Namespace definition

Front

A container which lets developers bundle all functionality under a unique, application-specific name.

Back

Does Javascript have function overloading?

Front

No, you cannot double-define functions in the same scope.

Back

Haskell: What do back quotes do for operators?

Front

Makes the operator infix

Back

@angular/core

Front

@angular/core - Critical runtime parts of the framework needed by every application. Includes all metadata decorators, Component, Directive, dependency injection, and the component lifecycle hooks.

Back

What is lazy evaluation?

Front

In programming language theory, lazy evaluation, or call-by-need[1] is an evaluation strategy which delays the evaluation of an expression until its value is needed (non-strict evaluation) and which also avoids repeated evaluations (sharing).[2][3] The sharing can reduce the running time of certain functions by an exponential factor over other non-strict evaluation strategies, such as call-by-name.[citation needed] The benefits of lazy evaluation include: The ability to define control flow (structures) as abstractions instead of primitives. The ability to define potentially infinite data structures. This allows for more straightforward implementation of some algorithms. Performance increases by avoiding needless calculations, and error conditions in evaluating compound expressions.

Back

Write a file my-module.js that exports a function Cubed and a const foo. Then import the two into another file. Use Named Exports

Front

// module "my-module.js" export function cube(x) { return x x x; } const foo = Math.PI + Math.SQRT2; export { foo }; -------- import { cube, foo } from 'my-module'; console.log(cube(3)); // 27 console.log(foo); // 4.555806215962888

Back

Haskell: What operator has highest priority?

Front

function application

Back

Haskell: double colon <::> means

Front

has the type <type>

Back

32

Front

Back

Haskell: :t length returns length :: [a] -> Int => wtf is the [a]?

Front

alpha type, meaning its polymorphic

Back

@angular/compiler

Front

@angular/compiler - Angular's Template Compiler. It understand templates and can convert them to code that makes the app run and render. Developers typically don't interact with the compiler directly. They use it indirectly via platform-browser-dynamic or the offline template compiler.

Back

Haskell 98?

Front

In late 1997, the series culminated in Haskell 98, intended to specify a stable, minimal, portable version of the language and an accompanying standard library for teaching, and as a base for future extensions. The committee expressly welcomed creating extensions and variants of Haskell 98 via adding and incorporating experimental features.

Back

Haskell: Sum up list, length of list, product, reverse, append two lists

Front

sum [1,2,3,4,5], product, [1,2,3,4,5] ++ [6,7,8], reverse

Back

Haskell: What character denotes function application?

Front

Whitespace

Back

Dependencies vs devdependencies in package.json?

Front

The packages listed under dependencies are essential to running the application. The devDependencies are only necessary to develop the application. They can be excluded from production installations as in this example: $npm install my-application --production

Back

Inheritance definition

Front

A class can inherit characteristics and capabilities from another class.

Back

What is the essential structure of an ng2 Component?

Front

One or more import statements to reference the things we need. A @Component decorator that tells Angular what template to use and how to create the component. A component class that controls the appearance and behavior of a view through its template.

Back

Haskell: convention meaning: xs, ns, nss

Front

list of type s, list of type n, list of lists of type s

Back

Haskell: how to convert infix operator to prefix?

Front

2 + 2 ---> (+) 2 2

Back

What was the significant advance of ML?

Front

Type inference - compiler would infer types based on code.

Back

ES6: export

Front

The export statement is used to export functions, objects or primitives from a given file (or module). export { name1, name2, ..., nameN }; export { variable1 as name1, variable2 as name2, ..., nameN }; export let name1, name2, ..., nameN; // also var export let name1 = ..., name2 = ..., ..., nameN; // also var, const export default expression; export default function (...) { ... } // also class, function* export default function name1(...) { ... } // also class, function* export { name1 as default, ... }; export * from ...; export { name1, name2, ..., nameN } from ...; export { import1 as name1, import2 as name2, ..., nameN } from ...;

Back

system.js

Front

A dynamic module loader compatible with the ES2015 module specification. There are other viable choices including the well-regarded webpack. SystemJS happens to be the one we use in the documentation samples. It works.

Back

@angular/http

Front

Angular's http client

Back

@angular/platform-browser-dynamic

Front

@angular/platform-browser-dynamic - Providers and a bootstrap method for applications that compile templates on the client. don't use offline compilation. We use this package for boostrapping during development and for boostrapping plunker samples

Back

@angular/platform-browser

Front

@angular/platform-browser - Everything DOM and browser related, especially the pieces that help render into DOM. This package also includes the bootstrapStatic method for bootstrapping applications for production builds that pre-compile templates offline.

Back

What are the three package categories in the dependencies section of package.json?

Front

Features - Feature packages provide our application with framework and utility capabilities. Polyfills - Polyfills plug gaps in the browser's JavaScript implementation. Other - Other libraries that support the application such as bootstrap for HTML widgets and styling.

Back

Haskell: do strings exist in Haskell?

Front

Nah, lists of chars do though [Char] single chars can be written with single quotes while list of chars can be written with double quotes

Back

RequireJS

Front

Used mainly in the browser. Packages everything into file and helps you manage how JS is loading.

Back

Haskell: What does null do

Front

null checks if a list is empty. If it is, it returns True, otherwise it returns False. Use this function instead of xs == [] (if you have a list called xs)

Back

Haskell: whitespace is not significant in Haskell T or F?

Front

whitespace is significant in Haskell

Back

@angular/router

Front

Component router.

Back

Haskell: Remove first element from a list

Front

tail [1,2,3,4,5];

Back

What is the root of an Angular 2 App?

Front

AppComponent is the root of the application

Back

Webpack?

Front

Webpack is a powerful module bundler. A bundle is a JavaScript file that incorporate assets that belong together and should be served to the client in a response to a single file request. A bundle can include JavaScript, CSS styles, HTML, and almost any other kind of file. Webpack roams over your application source code, looking for import statements, building a dependency graph, and emitting one (or more) bundles. With plugin "loaders" Webpack can preprocess and minify different non-JavaScript files such as TypeScript, SASS, and LESS files. We determine what Webpack does and how it does it with a JavaScript configuration file, webpack.config.js.

Back

Haskell: Select first N elements of a list

Front

take 3 [1,2,3,4,5]

Back

Section 4

(50 cards)

Array.prototype.push()

Front

MUTATOR method Adds one or more elements to the end of an array and returns the new length of the array.

Back

Array.prototype.length

Front

ACCESSOR method Reflects the number of elements in an array.

Back

What is the equivalent of a constructor in JS?

Front

The constructor is called at the moment of instantiation (the moment when the object instance is created). The constructor is a method of the class. In JavaScript the function serves as the constructor of the object, therefore there is no need to explicitly define a constructor method. Every action declared in the class gets executed at the time of instantiation. The constructor is used to set the object's properties or to call methods to prepare the object for use. Adding class methods and their definitions occurs using a different syntax described later in this article.

Back

Create a property firstName within a class Person

Front

var Person = function (firstName) { this.firstName = firstName; }; //instantiation: var person1 = new Person('Alice');

Back

Write a function length that finds the length of a linked list with a new node

Front

function length (head) { let length = 0; let current = head; while (current) { current = current.next; length++; } return length; }

Back

How does JS define classes?

Front

JavaScript uses functions as constructors for classes. Defining a class is as easy as defining a function. In the example below we define a new class called Person with an empty constructor. var Person = function () {};

Back

Write a function length that recursively finds the length of a linked list

Front

function length(head) { head ? 1 + length(head.next) : 0; }

Back

Array.prototype.every()

Front

ITERATION method Returns true if every element in this array satisfies the provided testing function.

Back

Array.prototype.sort()

Front

MUTATOR method Sorts the elements of an array in place and returns the array.

Back

Create a Student class that inherits from a Person Class

Front

// Define the Person constructor var Person = function(firstName) { this.firstName = firstName; }; // Add a couple of methods to Person.prototype Person.prototype.walk = function(){ console.log("I am walking!"); }; Person.prototype.sayHello = function(){ console.log("Hello, I'm " + this.firstName); }; // Define the Student constructor function Student(firstName, subject) { // Call the parent constructor, making sure (using Function#call) // that "this" is set correctly during the call Person.call(this, firstName); // Initialize our Student-specific properties this.subject = subject; } // Create a Student.prototype object that inherits from Person.prototype. // Note: A common error here is to use "new Person()" to create the // Student.prototype. That's incorrect for several reasons, not least // that we don't have anything to give Person for the "firstName" // argument. The correct place to call Person is above, where we call // it from Student. Student.prototype = Object.create(Person.prototype); // See note below // Set the "constructor" property to refer to Student Student.prototype.constructor = Student; // Replace the "sayHello" method Student.prototype.sayHello = function(){ console.log("Hello, I'm " + this.firstName + ". I'm studying " + this.subject + "."); }; // Add a "sayGoodBye" method Student.prototype.sayGoodBye = function(){ console.log("Goodbye!"); }; // Example usage: var student1 = new Student("Janet", "Applied Physics"); student1.sayHello(); // "Hello, I'm Janet. I'm studying Applied Physics." student1.walk(); // "I am walking!" student1.sayGoodBye(); // "Goodbye!" // Check that instanceof works correctly console.log(student1 instanceof Person); // true console.log(student1 instanceof Student); // true

Back

What is the difference between Object.create() and new?

Front

The object used in Object.create actually forms the prototype of the new object, whereas in the new Function() form, the declared properties/functions do not form the prototype. With constructor functions, the newly created object inherits from the constructor's prototype when using new. var o = new SomeConstruct(); --> inheriting from SomeConstructor.prototype.

Back

Array.prototype.unshift()

Front

MUTATOR method Adds one or more elements to the front of an array and returns the new length of the array.

Back

[...]

Front

optional

Back

Array.prototype.entries() ECMASCRIPT 6

Front

ITERATION method Returns a new Array Iterator object that contains the key/value pairs for each index in the array. let people = ['jamie', 'jack', 'isaac']; let entries = people.entries(); console.log(entries.next().value); // [0, 'jamie'] console.log(entries.next().value); // [1, 'jack'] console.log(entries.next().value); // [2, 'isaac'] The following methods help with iterating over Arrays: Array.prototype.entries() Array.prototype.keys() Array.prototype.values() The result of each of the aforementioned methods is a sequence of values, but they are not returned as an Array; they are revealed one by one, via an iterator. Let's look at an example. I'm using Array.from() to put the iterators' contents into Arrays: > Array.from(['a', 'b'].keys()) [ 0, 1 ] > Array.from(['a', 'b'].values()) [ 'a', 'b' ] > Array.from(['a', 'b'].entries()) [ [ 0, 'a' ], [ 1, 'b' ] ]

Back

Why add methods using prototype as opposed to using this?

Front

Methods that inherit via the prototype chain can be changed universally for all instances, for example: function Class () {} Class.prototype.calc = function (a, b) { return a + b; } // Create 2 instances: var ins1 = new Class(), ins2 = new Class(); // Test the calc method: console.log(ins1.calc(1,1), ins2.calc(1,1)); // -> 2, 2 // Change the prototype method Class.prototype.calc = function () { var args = Array.prototype.slice.apply(arguments), res = 0, c; while (c = args.shift()) res += c; return res; } // Test the calc method: console.log(ins1.calc(1,1,1), ins2.calc(1,1,1)); // -> 3, 3 ) Notice how changing the method applied to both instances? This is because ins1 and ins2 share the same calc() function. In order to do this with public methods created during construction, you'd have to assign the new method to each instance that has been created, which is an awkward task. This is because ins1 and ins2 would have their own, individually created calc() functions. Another side effect of creating methods inside the constructor is poorer performance. Each method has to be created every time the constructor function runs. Methods on the prototype chain are created once and then "inherited" by each instance. On the flip side of the coin, public methods have access to "private" variables, which isn't possible with inherited methods. var YourClass = function(){ var privateField = "somevalue"; this.publicField = "somevalue"; this.instanceMethod1 = function(){ //you may access both private and public field from here: //in order to access public field, you must use "this": alert(privateField + "; " + this.publicField); }; } YourClass.prototype.instanceMethod2 = function(){ //you may access only public field 2 from this method, but not private fields: alert(this.publicField); //error: drawaback of prototype methods: alert(privateField); }; When you define methods via prototype, they are shared among all YourClass instances. As a result the total size of such instances is less than if you define methods in constructor; There are tests that show how method definition via prototype decrease the total size of html page and as a result a speed of its loading. another advantage of methods, defined via prototype - is when you use inherited classes, you may override such methods and in the overriden method of the derived class you may invoke the method of base class with the same name, but with methods defined in constructor, you cannot do this.

Back

Array.prototype.fill()

Front

MUTATOR method Fills all the elements of an array from a start index to an end index with a static value.

Back

Create a method sayHello on a class Person using the prototype design pattern

Front

var Person = function (firstName) { this.firstName = firstName; }; Person.prototype.sayHello = function() { console.log("Hello, I'm " + this.firstName); };

Back

How do we create an instance or object of a class named Person?

Front

var person1 = new Person();

Back

Array.prototype.findIndex() ECMASCRIPT 6

Front

ITERATION method Returns the found index in the array, if an element in the array satisfies the provided testing function or -1 if not found. arr.findIndex(callback[, thisArg])

Back

Array.prototype.reverse()

Front

MUTATOR method Reverses the order of the elements of an array -- the first becomes the last, and the last becomes the first.

Back

Create a global namespace called MYAPP, then create a sub namespace called event

Front

//global namespace var MYAPP = MYAPP || {}; // sub namespace MYAPP.event = {};

Back

{...}

Front

repetition

Back

[x[y]]

Front

when x is provided y is optional

Back

In JS OOP, what's a namespace?

Front

In JavaScript a namespace is just another object containing methods, properties, and objects. (The idea behind creating a namespace in JavaScript is simple: create one global object, and all variables, methods, and functions become properties of that object. Use of namespaces also reduces the chance of name conflicts in an application, since each application's objects are properties of an application-defined global object.)

Back

Array.prototype.concat()

Front

ACCESSOR method Returns a new array comprised of this array joined with other array(s) and/or value(s).

Back

Write a function length that finds the length of a linked list with no new objects created.

Front

function length (head) { let count = 0; while (head) { count++; head = head.next; } return count; }

Back

...

Front

repeated

Back

Array Iteration methods

Front

Several methods take as arguments functions to be called back while processing the array. When these methods are called, the length of the array is sampled, and any element added beyond this length from within the callback is not visited. Other changes to the array (setting the value of or deleting an element) may affect the results of the operation if the method visits the changed element afterwards. While the specific behavior of these methods in such cases is well-defined, you should not rely upon it so as not to confuse others who might read your code. If you must mutate the array, copy into a new array instead.

Back

Array.prototype.keys() ECMASCRIPT 6

Front

ITERATION method Returns a new Array Iterator that contains the keys for each index in the array.

Back

Array.prototype.filter()

Front

ITERATION method Creates a new array with all of the elements of this array for which the provided filtering function returns true.

Back

Array.prototype.indexOf()

Front

ACCESSOR method Returns the first (least) index of an element within the array equal to the specified value, or -1 if none is found. arr.indexOf(searchElement[, fromIndex = 0])

Back

Array.prototype.splice()

Front

MUTATOR method Adds and/or removes elements from an array.

Back

Create a linked list Node Constructor

Front

function Node(data) { this.data = data; this.next = null; }

Back

Array.prototype.toString()

Front

ACCESSOR method Returns a string representing the array and its elements. Overrides the Object.prototype.toString() method.

Back

Does resetting the prototype constructor in a subclass matter?

Front

Yes and no. In ES5 and earlier, JavaScript itself didn't use constructor for anything. It defined that the default object on a function's prototype property would have it and that it would refer back to the function, and that was it. Nothing else in the specification referred to it at all. That changed in ES2015 (ES6), which started using it in relation to inheritance hierarchies. For instance, Promise#then uses the constructor property of the promise you call it on (via SpeciesConstructor) when building the new promise to return. It's also involved in subtyping arrays. Note that in the places the ES2015 spec uses it, it's set automatically for you (you can't subclass Promise or arrays except via class, and class handles it for you). Outside of the language itself, sometimes people would use it when trying to build generic "clone" functions or just generally when they wanted to refer to what they believed would be the object's constructor function. My experience is that using it is rare, but sometimes people do use it. It's there by default, you only need to put it back when you replace the object on a function's prototype property: Student.prototype = Object.create(Person.prototype); If you don't do this: Student.prototype.constructor = Student; ...then Student.prototype.constructor inherits from Person.prototype which (presumably) has constructor = Person. So it's misleading. It's okay if nothing in your code (or library code you use) uses it. I've always ensured it was correctly wired up. Of course, with ES2015 (aka ES6)'s class keyword, most of the time we would have used it, we don't have to anymore, because it's handled for us when we do class Student extends Person { }

Back

How to implement inheritance in Javascript?

Front

Inheritance is a way to create a class as a specialized version of one or more classes (JavaScript only supports single inheritance). The specialized class is commonly called the child, and the other class is commonly called the parent. In JavaScript you do this by assigning an instance of the parent class to the child class, and then specializing it. In modern browsers you can also use Object.create to implement inheritance.

Back

Array.prototype.forEach()

Front

ITERATION method Calls a function for each element in the array.

Back

Array Accessor methods

Front

These methods do not modify the array and return some representation of the array.

Back

Prototype-based programming

Front

Prototype-based programming is an OOP model that doesn't use classes, but rather it first accomplishes the behavior of any class and then reuses it (equivalent to inheritance in class-based languages) by decorating (or expanding upon) existing prototype objects. (Also called classless, prototype-oriented, or instance-based programming.)

Back

Array.prototype.map()

Front

ITERATION method Creates a new array with the results of calling a provided function on every element in this array.

Back

Array.prototype.lastIndexOf()

Front

ACCESSOR method Returns the last (greatest) index of an element within the array equal to the specified value, or -1 if none is found.

Back

Array.prototype.slice()

Front

ACCESSOR method Extracts a section of an array and returns a new array. arr.slice([begin[, end]]) *Shallow copy *End index is not included *There's an equivalent method for Strings, and slice works on Array-like objects i.e. arguments begin: Zero-based index at which to begin extraction. As a negative index, begin indicates an offset from the end of the sequence. slice(-2) extracts the last two elements in the sequence. If begin is undefined, slice begins from index 0. end: Zero-based index at which to end extraction. slice extracts up to but not including end. slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3). As a negative index, end indicates an offset from the end of the sequence. slice(2,-1) extracts the third element through the second-to-last element in the sequence. If end is omitted, slice extracts through the end of the sequence (arr.length).

Back

Array.prototype.find() ECMASCRIPT 6

Front

ITERATION method Returns the found value in the array, if an element in the array satisfies the provided testing function or undefined if not found. arr.find(callback[, thisArg])

Back

Abstraction definition

Front

The conjunction of an object's complex inheritance, methods, and properties must adequately reflect a reality model.

Back

Encapsulation definition

Front

In programming languages, encapsulation is used to refer to one of two related but distinct notions, and sometimes to the combination[1][2] thereof: A language mechanism for restricting direct access to some of the object's components.[3][4] A language construct that facilitates the bundling of data with the methods (or other functions) operating on that data.[5][6] Some programming language researchers and academics use the first meaning alone or in combination with the second as a distinguishing feature of object-oriented programming, while other programming languages which provide lexical closures view encapsulation as a feature of the language orthogonal to object orientation. The second definition is motivated by the fact that in many OOP languages hiding of components is not automatic or can be overridden; thus, information hiding is defined as a separate notion by those who prefer the second definition. The features of encapsulation are supported using classes in most object-oriented programming languages, although other alternatives also exist.

Back

Array.prototype.pop()

Front

MUTATOR method Removes the last element from an array and returns that element.

Back

Polymorphism defintiion

Front

Poly means "many" and morphism means "forms". Different classes might define the same method or property.

Back

Array.prototype.shift()

Front

MUTATOR method Removes the first element from an array and returns that element.

Back

Array.prototype.join()

Front

ACCESSOR method Joins all elements of an array into a string. join defaults to using ',' as a separator use .join('') to get a full string that is not delimited.

Back

Array.prototype.some()

Front

ITERATION method Returns true if at least one element in this array satisfies the provided testing function.

Back

Section 5

(50 cards)

[1, 2, 3, 4, 5].copyWithin(-2, -3, -1);

Front

[1, 2, 3, 3, 4]

Back

console.log([4, 6, 7, 12].findIndex(isPrime));

Front

2

Back

var x = "YOLO"; return x.split();

Front

["YOLO"];

Back

JS Precedence: Grouping vs Logical NOT? () vs !

Front

Grouping ( ... ) (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence)

Back

[1, 2, 3].fill(4, 1, 2);

Front

[1, 4, 3]

Back

let arr = [3,2,1]; let dup = arr; arr.sort() whats the value of dup?

Front

[1,2,3]

Back

[1,2,3,4,5].copyWithin(0, 3);

Front

[4, 5, 3, 4, 5]

Back

Array.isArray()

Front

Bool if argument is array

Back

Does String.prototype.split() mutate the String given?

Front

no

Back

console.log([4, 5, 8, 12].find(isPrime));

Front

5

Back

Array.prototype.reduce()

Front

ITERATION method Apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value.

Back

Array.prototype.sort([5,10,14]);

Front

[10,14,5] (Array.prototype.sort mutates and returns the mutated array, but it sorts based on Unicode value)

Back

Do arrow functions with one param require parens?

Front

No

Back

4 Ways to convert number 123 or variable N to a string

Front

String(123); N.toString(); "" + 123; N + ""

Back

[1, 2, 3, 4, 5].copyWithin(-2);

Front

[1, 2, 3, 1, 2]

Back

Array.from()

Front

Array instance from array-like object // Any iterable object... // Set var s = new Set(["foo", window]); Array.from(s); // ["foo", window] // Map var m = new Map([[1, 2], [2, 4], [4, 8]]); Array.from(m); // [[1, 2], [2, 4], [4, 8]] // String Array.from("foo"); // ["f", "o", "o"] // Using an arrow function as the map function to // manipulate the elements Array.from([1, 2, 3], x => x + x); // [2, 4, 6] Array.from() lets you create Arrays from: array-like objects (objects with a length property and indexed elements) or iterable objects (objects where you can get its elements, such as Map and Set). Array.from() has an optional parameter mapFn, which allows you to execute a map function on each element of the array (or subclass object) that is being created. More clearly, Array.from(obj, mapFn, thisArg) is the same as Array.from(obj).map(mapFn, thisArg), except that it does not create an intermediate array. This is especially important for certain array subclasses, like typed arrays, since the intermediate array would necessarily have values truncated to fit into the appropriate type. The length property of the from() method is 1.

Back

JS Precedence: Greater Than vs Addition > vs + e.g. 1 + 3 > 3

Front

+

Back

What are the Javascript falsy values?

Front

false, 0, "", null, undefined, NaN

Back

arguments object

Front

- not an array but array-like - good to do conditionals based on number of arguments - .length property - variable number of parameters (function myConcat(separator) { var args = Array.prototype.slice.call(arguments, 1); return args.join(separator); })

Back

var x = "YOLO"; return x.split('');

Front

["Y","O","L","O"];

Back

functions with variable number of params

Front

use arguments

Back

[1,2,3,4,5].fill(4);

Front

[4,4,4,4,4]

Back

console.log([4, 6, 8, 12].find(isPrime));

Front

undefined

Back

var fruits = ['Banana', 'Orange', 'Lemon', 'Apple', 'Mango']; var citrus = fruits.slice(1, 3); value of citrus?

Front

citrus contains ['Orange','Lemon']

Back

[1,2,3,4,5].fill(4,1);

Front

[1,4,4,4,4]

Back

How to check if a value is NaN?

Front

x !== x or isNan()

Back

[1,2,3,4,5].copyWithin(0,3,4);

Front

[4, 2, 3, 4, 5] (target Zero based index at which to copy the sequence to. If negative, target will be counted from the end. If target is at or greater than arr.length, nothing will be copied. If target is positioned after start, the copied sequence will be trimmed to fit arr.length. start Zero based index at which to start copying elements from. If negative, start will be counted from the end. If start is omitted, copyWithin will copy from the start (defaults to 0). end Zero based index at which to end copying elements from. copyWithin copies up to but not including end. If negative, end will be counted from the end. If end is omitted, copyWithin will copy until the end (default to arr.length).)

Back

[1,2,3,4,5].forEach( a => a + 2);

Front

undefined

Back

How to make a string into an array of chars?

Front

String.prototype.split('');

Back

JS Precedence: Logical AND vs Logical OR && vs ||

Front

&&

Back

console.log([4, 6, 8, 12].findIndex(isPrime));

Front

-1

Back

Define javascript

Front

Lig

Back

parameter

Front

var nameImprover = function (name, adj) { return 'Col' + name + 'Mc' + adj + pants; }

Back

Do arrow functions with no params require parens?

Front

yes

Back

JS Precedence: Exponentiation vs Multiplication? * vs

Front

Tie

Back

[1,2,3,4,5].every( a => a > 4);

Front

false

Back

myAnimal.speak()

Front

myAnimal['speak']()

Back

Array.prototype.reduceRight()

Front

ITERATION method Apply a function against an accumulator and each value of the array (from right-to-left) as to reduce it to a single value.

Back

why use console.log with a comma and not a +

Front

console.log("my name is ", name); the + stringifies an object. if name is an object this is not quite what we want as we'll get "[object Object]"

Back

Do arrow functions with two* params require parens?

Front

yes

Back

Array.prototype.copyWithin() ECMASCRIPT 6 (need to put in more examples for this one)

Front

MUTATOR METHOD The copyWithin() method shallow copies part of an array to another location in the same array and returns it, without modifying its size.

Back

[1,2,3,4,5].every(a => a > 0);

Front

true

Back

Triangle Inequality Theorem not including zero area triangles, x, y, z sides

Front

z < x + y

Back

[3].every(a => a = 3);

Front

true

Back

let animals = [{name: "cow", qty: 2}, {name: "pig", qty: 2}]; return animals.find( (animal) => animal.qty === 2);

Front

{name: "cow", "qty: 2}; (find returns first value in the array found, the value here is an object)

Back

JS: 1 + 2 > 3

Front

true

Back

for...of loop

Front

The for...of statement creates a loop iterating over iterable objects (including Array, Map, Set, String, TypedArray, arguments object and so on), invoking a custom iteration hook with statements to be executed for the value of each distinct property.

Back

123.toString();

Front

invalid token

Back

How to sort an array from lowest number val to highest?

Front

Array.prototype.sort( (a,b) => a - b));

Back

what arguments does Array.prototype.forEach callback accept?

Front

element, index, array (callback is invoked with three arguments: the element value the element index the array being traversed)

Back

Section 6

(50 cards)

false || null || "" || 0 || NaN || "Hello" || undefined

Front

short circuit evaluation - returns "Hello"

Back

Exponential decay formula where a = initial amt, r = growth/decay rate, x = number of time intervals

Front

a * (1-r)^x

Back

Tail Call

Front

(In computer science, a tail call is a subroutine call performed as the final action of a procedure. If a tail call might lead to the same subroutine being called again later in the call chain, the subroutine is said to be tail-recursive, which is a special case of recursion. Tail recursion (or tail-end recursion) is particularly useful, and often easy to handle in implementations.)

Back

Does Array.prototype.reduce mutate the given array?

Front

No

Back

What is ES.next?

Front

The next version of Ecmascript

Back

Can a function have more than one tail position?

Front

Yes

Back

if (x == 3) { x += 2; return x} else {return 0}; with ternary operator minimizing parens

Front

x == 3 ? ( x +=2, return x) : return 0

Back

Tail Position

Front

The tail position is a postion which an expression would return a value from. There are no more forms evaluated after the form in the tail position is evaluated.

Back

false || "bar";

Front

"bar"; (did you note that this is essentially an if-else statement?)

Back

"foo" || "bar";

Front

"foo";

Back

The three rules and side effects of closures

Front

1. Closures have access to the outer function's variable even after the outer function returns 2. Closures store references to the outer function's variables;

Back

There's no such thing as private properties on a coffeescript object! But, maybe there are? Implement a function createSecretHolder(secret) which accepts any value as secret and returns an object with ONLY two methods getSecret() which returns the secret setSecret() which sets the secret

Front

function createSecretHolder(secret) { let _val = secret; return { getSecret : function() { return _val; }, setSecret: function(s) { _val = s; } }

Back

Do proper tail calls work normally in Javascript?

Front

No, you have to turn on "strict mode"

Back

Short Circuit evaluation

Front

Back

function foo(){ return 1 + bar(); } what's wrong with this?

Front

can be optimized. currently storing frames onto stack during recursion due to "1 +"

Back

** ES6

Front

exponentiation

Back

What are the closure's scope chains?

Front

1. It's own scope, variables defined within its own curly braces. 2. Access to outer function's variables and arguments. 3. Access to global variables.

Back

ES6 arrow and this note

Front

ECMAScript 2015 introduced arrow functions whose this is lexically scoped (it is set to the this value of the enclosing execution context)

Back

Tail Recursion with Accumulators reason

Front

It's unnecessary to keep around a stack frame when it is just going to return a value. Some compilers will optimize for this by using the same stack space if the return values are the same. It is reasonable to assume all functional-language implementations optimize these tail calls. -- So there's less memory used, and it is faster overall.

Back

What will always(3) return? Given this: function always (n) { return function (n){ return n; } }

Front

undefined (When two arguments or variables in the scopes of a closure have the same name, there is a name conflict. More inner scopes take precedence, so the inner-most scope takes the highest precedence, while the outer-most scope takes the lowest. This is the scope chain. )

Back

How to trim off last letter of a string <str> using String.prototype.substr?

Front

str.substr(0, str.length -1);

Back

Write a function that <always> that takes an input <n> and returns a function which returns <n>

Front

function always(n) { return function(){ return n; } }

Back

Write a function that doubles each char in a given string using split,map,join

Front

const doubleChar = (str) => str.split("").map(c => c + c).join("");

Back

Write a function that returns does this given an array of 3 arrays of 3 ints [[5,3,7],[3,3,1],[4,1,2]] == ((5+3+7) (3+3+1) (4+1+2)) = 735

Front

arr.map(a=>a.reduce((x,y)=>x+y),0).reduce((a,b)=>a*b); arr.map( a => a[0] + a[1] + a[2]).reduce( (a,b) => a * b); (important thing to note here is the use of mapping and reducing together, the map allows you to reduce on each element)

Back

How to take a string s and break it into an array of string characters?

Front

s.split('');

Back

var pet = function(name) { // The outer function defines a variable called "name" var getName = function() { return name; // The inner function has access to the "name" variable of the outer function } return getName; // Return the inner function, thereby exposing it to outer scopes }, myPet = pet("Vivie"); myPet(); // Returns "Vivie"

Front

Closure

Back

Write a function makeAdder(x) using closures that returns a function that adds any value to x.

Front

function makeAdder(x){ return fuction(x,y){ return x+y; }; } var add5 = makeAdder(5); var add10 = makeAdder(10); console.log(add5(2)); // 7 console.log(add10(2)); // 12

Back

Can a function have more than one tail call?

Front

Yes

Back

Pass by Reference vs Pass by Values GIF

Front

Back

Does Array.prototype.map mutate the given array?

Front

No

Back

What are free variables?

Front

Variables that are used locally, but defined in an enclosing scope.

Back

Pros and cons of using closures for private properties?

Front

The advantage of this technique is that it offers more protection: there is no way for the user to access a private property except by using its getter or setter function. However, the use of closures makes private properties too restrictive: since there is no way to access variables in one closure from within another closure, there is no way for objects of the same class to access each other's private properties.

Back

What does a variable with prefixed underscore mean?

Front

The variable is intended to be private.

Back

(C++) Write a Class Box with the public properties length breadth height as doubles. Then instantiate two boxes as Box1 and Box2

Front

class Box { public: double length; // Length of a box double breadth; // Breadth of a box double height; // Height of a box }; Box Box1; // Declare Box1 of type Box Box Box2; // Declare Box2 of type Box

Back

var x = null || 0; what is x?

Front

0;

Back

In JS how is short circuiting different?

Front

Javacript uses short-circuit evaluation for logical operators || and &&. However, it's different to other languages in that it returns the result of the last value that halted the execution, instead of a true, or false value.

Back

How to trim off first letter of a string <str> using String.prototype.substr?

Front

str.substr(1);

Back

Does Array.prototype.filter mutate the given array?

Front

No

Back

Closure definition

Front

(Closures are one of the most powerful features of JavaScript. JavaScript allows for the nesting of functions and grants the inner function full access to all the variables and functions defined inside the outer function (and all other variables and functions that the outer function has access to). However, the outer function does not have access to the variables and functions defined inside the inner function. This provides a sort of security for the variables of the inner function. Also, since the inner function has access to the scope of the outer function, the variables and functions defined in the outer function will live longer than the outer function itself, if the inner function manages to survive beyond the life of the outer function. A closure is created when the inner function is somehow made available to any scope outside the outer function.)

Back

Map mneumonic

Front

Map maps a function onto each value on an array.

Back

Write a function that doubles each char in a given string using regexp

Front

function doubleChar(str) { return str.replace(/(.)/g, "$1$1") }

Back

what's important about ES6 in regards to recursion?

Front

introduces "proper" tail calls!

Back

Define Lazy Evaluation

Front

In programming language theory, lazy evaluation, or call-by-need[1] is an evaluation strategy which delays the evaluation of an expression until its value is needed (non-strict evaluation) and which also avoids repeated evaluations (sharing).

Back

Tail Call Elimination

Front

(Tail calls can be implemented without adding a new stack frame to the call stack. Most of the frame of the current procedure is not needed any more, and it can be replaced by the frame of the tail call, modified as appropriate --similar to overlay for processes, but for function callsThe program can then jump to the called subroutine. Producing such code instead of a standard call sequence is called tail call elimination. Tail call elimination allows procedure calls in tail position to be implemented as efficiently as goto statements, thus allowing efficient structured programming.)

Back

1 && [] && {} && true && "World" && null && 2010 -- why is this optimized?

Front

short circuit evaluation -- returns null and doesnt evaluate 2010;

Back

(C++) How are private and protected members different from public properties?

Front

It is important to note that private and protected members can not be accessed directly using direct member access operator (.). We will learn how private and protected members can be accessed. (#include <iostream> using namespace std; class Adder{ public: // constructor Adder(int i = 0) { total = i; } // interface to outside world void addNum(int number) { total += number; } // interface to outside world int getTotal() { return total; }; private: // hidden data from outside world int total; }; int main( ) { Adder a; a.addNum(10); a.addNum(20); a.addNum(30); cout << "Total " << a.getTotal() <<endl; //60 return 0; }) Note that this is called encapsulation.

Back

Crockford, Closure, Bugs

Front

// This example is explained in detail below (just after this code box).​ ​function celebrityIDCreator (theCelebrities) { var i; var uniqueID = 100; for (i = 0; i < theCelebrities.length; i++) { theCelebrities[i]["id"] = function () { return uniqueID + i; } } return theCelebrities; } ​ ​var actionCelebs = [{name:"Stallone", id:0}, {name:"Cruise", id:0}, {name:"Willis", id:0}]; ​ ​var createIdForActionCelebs = celebrityIDCreator (actionCelebs); ​ ​var stalloneID = createIdForActionCelebs [0]; console.log(stalloneID.id()); // 103

Back

Take the string "1234" and break it into an array of numbers

Front

s.split('').map(Number);

Back

Celebrities, Crockford, Closures, Pass-by-Reference

Front

function celebrityID () { var celebrityID = 999; // We are returning an object with some inner functions​ // All the inner functions have access to the outer function's variables​ return { getID: function () { // This inner function will return the UPDATED celebrityID variable​ // It will return the current value of celebrityID, even after the changeTheID function changes it​ return celebrityID; }, setID: function (theNewID) { // This inner function will change the outer function's variable anytime​ celebrityID = theNewID; } } ​ } ​ ​var mjID = celebrityID (); // At this juncture, the celebrityID outer function has returned.​ mjID.getID(); // 999​ mjID.setID(567); // Changes the outer function's variable​ mjID.getID(); // 567: It returns the updated celebrityId variable

Back

function always(n) { return function () { return n }; } why is this useful?

Front

In an analogy with OOP, the outer function is kind of like a class constructor, and the inner function is kind of like a method and the variable n is kind of like a private variable. (function product(name, price) { var companyName = 'ACME'; return { getCompanyName: function () { return companyName }, getName: function () { return name }, getPrice: function () { return price }, setPrice: function (x) { return price = x } } } widget = product('widget', 2); widget.getCompanyName(); // 'ACME' widget.getName(); // 'widget' widget.getPrice(); // 2 widget.setPrice(5); // 5 widget.getPrice(); // 5)

Back

Section 7

(50 cards)

Important note about <this> value being dynamic.

Front

// let's assume .elem is <div class="elem"></div> var element = document.querySelector('.elem'); // our function var someMethod = function () { console.log(this); }; // when clicked, `this` will become the element element.addEventListener('click', someMethod, false); // <div> // if we just invoke the function, `this` becomes the window object someMethod(); // [object Window]

Back

undefined vs not defined?

Front

undefined is a type, the following error often pops up when trying to use something that just does not exist at all "var name is not defined"

Back

What is put out by myFunc(); function myFunc() { console.log(this); }

Front

window object

Back

.call() what are the parameters?

Front

fun.call(thisArg[, arg1[, arg2[, ...]]]) (thisArg The value of this provided for the call to fun. Note that this may not be the actual value seen by the method: if the method is a function in non-strict mode code, null and undefined will be replaced with the global object and primitive values will be converted to objects. arg1, arg2, ... Arguments for the object. )

Back

Javascript Closure Recipe

Front

1. Create parent function 2. Define variables in parent's local scope. 3. Define a function inside the parent function i.e. child 4. Return the function from inside the parent function

Back

// let's assume .elem is <div class="elem"></div> var element = document.querySelector('.elem'); var someMethod = function () { console.log(this); }; element.addEventListener('click', someMethod, false); What is put out on click?

Front

<div class="elem"></div>.

Back

Lexical Scoping?

Front

Lexical Scoping defines how variable names are resolved in nested functions: inner functions contain the scope of parent functions even if the parent function has returned.

Back

var sameName = 'outer'; var fn = function () { var sameName = 'inner'; }; fn(); ACTUAL = sameName; expect(ACTUAL === 'outer').to.be.true;

Front

it('if an inner and an outer variable share the same name, and the name is referenced in the outer scope, the outer value binding will be used', function () {

Back

var fn = function () { // the `||` symbol here is being used to set a default value for innerCounter. If innerCounter already contains a truthy value, then the value in that variable will be unchanged. If it is falsey however (such as if it were completely uninitialized), then this line will set it to the default value of 10. var innerCounter = innerCounter || 10; innerCounter = innerCounter + 1; ACTUAL = innerCounter; }; fn(); expect(ACTUAL === '11').to.be.true; fn(); expect(ACTUAL === '10').to.be.true; //whats wrong here?

Front

second value is 11 because scope is recreated

Back

What is a synonym for static scope?

Front

Lexical scope

Back

Lexical Scope Definition

Front

Functions in JavaScript are lexically rather than dynamically scoped. This means that they run in the scope in which they are defined, not the scope from which they are executed. Prior to JavaScript 1.2, functions could be defined only in the global scope, and lexical scoping was not much of an issue: all functions were executed in the same global scope (with the call object of the function chained to that global scope).

Back

.call() vs .apply()

Front

While the syntax of this function is almost identical to that of apply(), the fundamental difference is that call() accepts an argument list, while apply() accepts a single array of arguments.

Back

var firstFn = function () { var localToFirstFn = 'first'; // Although false, it might seem reasonable to think that the secondFn (which mentions the localToFirstFn variable), should have access to the localToFirstFn variable, since it's being called here from within the scope where that variable is declared. secondFn(); }; var secondFn = function () { ACTUAL = localToFirstFn; }; //value of ACTUAL?

Front

it('a function\'s local scope variables are not available anywhere outside that function, regardless of the context it\'s called in', function () {

Back

var sameName = 'outer'; var fn = function () { var sameName = 'inner'; ACTUAL = sameName; }; fn();

Front

it('if an inner and an outer variable share the same name, and the name is referenced in the inner scope, the inner scope variable masks the variable from the outer scope with the same name. This renders the outer scope variables inaccassible from anywhere within the inner function block', function () {

Back

Show three ways to write global variables

Front

var glob1 = 'global here'; function yolo(){ glob2 = 'global here too actually'; window.glob3 = 'global attached to window'; }

Back

Always, what is <this>

Front

This is the value of the object that invokes the function where this is used.

Back

var myConstructor = function () { this.someMethod = function () { console.log(this); }; }; var a = new myConstructor(); a.someMethod(); what does someMethod(); put out?

Front

myConstructor();

Back

Explain hoisting in relation to the "Var" keyword

Front

Because variable declarations (and declarations in general) are processed before any code is executed, declaring a variable anywhere in the code is equivalent to declaring it at the top. This also means that a variable can appear to be used before it's declared. This behavior is called "hoisting", as it appears that the variable declaration is moved to the top of the function or global code. bla = 2 var bla; // ... // is implicitly understood as: var bla; bla = 2;

Back

The Biggest Gotcha with JavaScript "this" keyword

Front

If you understand this one principle of JavaScript's this, you will understand the "this" keyword with clarity: this is not assigned a value until an object invokes the function where this is defined. Let's call the function where this is defined the "this Function." Even though it appears this refers to the object where it is defined, it is not until an object invokes the this Function that this is actually assigned a value. And the value it is assigned is based exclusively on the object that invokes the this Function. this has the value of the invoking object in most circumstances. However, there are a few scenarios where this does not have the value of the invoking object. I touch on those scenarios later.

Back

Value of <this>: function f1(){ return this; }

Front

Window object. In this case, the value of this is not set by the call. Since the code is not in strict mode, the value of this must always be an object so it defaults to the global object.

Back

(function sayHello() { alert("hello!"); })(); Is this a function expression or a function declaration?

Front

IIFE stands for Immediately Invoked Function Expression. Functions defined via Functions Expressions can be named or anonymous. Function Expressions must not start with "function" (hence the parentheses around the self invoking example below)

Back

// create an object var myObject = {}; // create a method on our object myObject.someMethod = function () { console.log(this); }; // call our method myObject.someMethod(); what does myObject.someMethod(); put out?

Front

myObject

Back

function () { var sameName = 'outer'; var fn = function () { var sameName = 'inner'; }; fn(); ACTUAL = sameName; expect(ACTUAL === 'outer').to.be.true; });

Front

it('if an inner and an outer variable share the same name, and the name is referenced in the outer scope, the outer value binding will be used',

Back

<this> explained in rohit khan

Front

var person = { firstName :"Penelope", lastName :"Barrymore", showFullName:function () { ​// The "context"​ console.log (this.firstName + " " + this.lastName); } } ​ ​// The "context", when invoking showFullName, is the person object, when we invoke the showFullName () method on the person object.​ ​// And the use of "this" inside the showFullName() method has the value of the person object,​ person.showFullName (); // Penelope Barrymore​ ​ ​// If we invoke showFullName with a different object:​ ​var anotherPerson = { firstName :"Rohit", lastName :"Khan"​ }; ​ ​// We can use the apply method to set the "this" value explicitly—more on the apply () method later.​ ​// "this" gets the value of whichever object invokes the "this" Function, hence:​ person.showFullName.apply (anotherPerson); // Rohit Khan​ ​ ​// So the context is now anotherPerson because anotherPerson invoked the person.showFullName () method by virtue of using the apply () method​

Back

Value of <this>

Front

W

Back

given an array of objects: var numbers = [{ name: 'Mark' },{ name: 'Tom' },{ name: 'Travis' }]; write a function that will iterate across and print each name using <this>

Front

for (var i = 0; i < numbers.length; i++) { (function () { console.log(this.name); // Mark, Tom, Travis }).call(numbers[i]); }

Back

in JavaScript, the scope of a variable is defined by its location within the source code (it is apparent) and nested functions have access to variables declared in their outer scope.

Front

lexical scope & static scope

Back

What does <this> hold in global functions and anonymous functions that are not bound to any object in strict mode?

Front

Note that when we use strict mode, this holds the value of undefined in global functions and in anonymous functions that are not bound to any object.

Back

When a function is used as a constructor with the <new> keyword, what is the value of <this>

Front

<this> is bound to the new object being constructed.

Back

Closures and <this>

Front

It is important to take note that closures cannot access the outer function's this variable by using the this keyword because the this variable is accessible only by the function itself, not by inner functions.

Back

What is <this> in the global execution context?

Front

In the global execution context (outside of any function), this refers to the global object, whether in strict mode or not. (console.log(this.document === document); // true // In web browsers, the window object is also the global object: console.log(this === window); // true this.a = 37; console.log(window.a); // 37 )

Back

Create a class called Person

Front

var Person = function () {};

Back

function add(a, b) {return a +b; } //has a scope been created?

Front

no. scopes are only created when the function is run or invoked.

Back

The golden rule of <this>

Front

First, know that all functions in JavaScript have properties, just as objects have properties. And when a function executes, it gets the this property—a variable with the value of the object that invokes the function where this is used.

Back

Value of <this> function f2(){ "use strict"; // see strict mode return this; }

Front

Undefined (In strict mode, the value of this remains at whatever it's set to when entering the execution context. If it's not defined, it remains undefined. It can also be set to any value, such as null or 42 or "I am not this"., this should be undefined, because f2 was called directly and not as a method or property of an object (e.g. window.f2()). This feature wasn't implemented in some browsers when they first started to support strict mode. As a result, they incorrectly returned the window object.)

Back

What is the counterpart to lexical scoping?

Front

Dynamic scoping

Back

What is a synonym for lexical scope?

Front

Static scope

Back

What is wrong with this code sample? var person = { firstName: "Penelope", lastName: "Barrymore", fullName: function () { ​// We could have also written this:​​ console.log(person.firstName + " " + person.lastName); } }

Front

(If we use person.firstName and person.lastName, as in the last example, our code becomes ambiguous. Consider that there could be another global variable (that we might or might not be aware of) with the name "person." Then, references to person.firstName could attempt to access the fistName property from the person global variable, and this could lead to difficult-to-debug errors. ) Use this.firstName and this.lastName instead.

Back

Function declarations vs Function Expressions - Best Practices?

Front

Badly placed Function Declarations are misleading and there are few (if any) situations where you can't use a Function Expression assigned to a variable instead. However if you must use Function Declarations, it will minimize confusion if you place them at the top of the scope to which they belong. I would never place a Function Declarations in an if statement. Having said all this you may well find yourself in situations where it makes sense to use a Function Declaration. That's fine. Slavish adherance to rules is dangerous and often results in tortuous code. Much more important is that you understand the concepts so that you can make your own informed decisions. I hope this article helps in that regard.

Back

In browsers, what are global variables attached to?

Front

The Window!

Back

Simulate the processing of the following code: function foo(){ function bar() { return 3; } return bar(); function bar() { return 8; } } alert(foo());

Front

//*Simulated processing sequence for Question 1* function foo(){ //define bar once function bar() { return 3; } //redefine it function bar() { return 8; } //return its invocation return bar(); //8 } alert(foo());

Back

Simulate the processing of the following code: function foo(){ var bar = function() { return 3; }; return bar(); var bar = function() { return 8; }; } alert(foo());

Front

//*Simulated processing sequence for Question 2* function foo(){ //a declaration for each function expression var bar = undefined; var bar = undefined; //first Function Expression is executed bar = function() { return 3; }; // Function created by first Function Expression is invoked return bar(); // second Function Expression unreachable } alert(foo()); //3

Back

(function () { describe('Function Exercises', function () { var ACTUAL; // This resets the value of ACTUAL (to null) before each test is run beforeEach(function () { ACTUAL = null; }); it('a function has access to its own local scope variables', function () { var fn = function () { var name = 'inner'; ACTUAL = name; }; fn(); expect(ACTUAL === 'inner').to.be.true; }); it('inputs to a function are treated as local scope variables', function () { var fn = function (name) { ACTUAL = name; }; fn('inner'); expect(ACTUAL === 'inner').to.be.true; }); it('a function has access to the variables contained within the same scope that function was created in', function () { var name = 'outer'; var fn = function () { ACTUAL = name; }; fn(); expect(ACTUAL === 'outer').to.be.true; }); it('a function\'s local scope variables are not available anywhere outside that function', function () { var firstFn = function () { var localToFirstFn = 'inner'; }; firstFn(); expect(function () { ACTUAL = localToFirstFn; }).to.throw(); expect(ACTUAL === null).to.be.true; }); it('a function\'s local scope variables are not available anywhere outside that function, regardless of the context it\'s called in', function () { var firstFn = function () { var localToFirstFn = 'first'; // Although false, it might seem reasonable to think that the secondFn (which mentions the localToFirstFn variable), should have access to the localToFirstFn variable, since it's being called here from within the scope where that variable is declared. secondFn(); }; var secondFn = function () { ACTUAL = localToFirstFn; }; expect(function () { // of course, calling the secondFn should throw an error in this case, since secondFn does not have access to the localToFirstFn variable secondFn(); }).to.throw(); expect(function () { // in addition, calling the firstFn (which in turn calls the secondFn) should also throw, since it the calling context of secondFn has no influence over its scope access rules firstFn(); }).to.throw(); expect(ACTUAL === null).to.be.true; }); it('if an inner and an outer variable share the same name, and the name is referenced in the inner scope, the inner scope variable masks the variable from the outer scope with the same name. This renders the outer scope variables inaccassible from anywhere within the inner function block', function () { var sameName = 'outer'; var fn = function () { var sameName = 'inner'; ACTUAL = sameName; }; fn(); expect(ACTUAL === 'inner').to.be.true; }); it('if an inner and an outer variable share the same name, and the name is referenced in the outer scope, the outer value binding will be used', function () { var sameName = 'outer'; var fn = function () { var sameName = 'inner'; }; fn(); ACTUAL = sameName; expect(ACTUAL === 'outer').to.be.true; }); it('a new variable scope is created for every call to a function, as exemplified with a counter', function () { var fn = function () { // the `||` symbol here is being used to set a default value for innerCounter. If innerCounter already contains a truthy value, then the value in that variable will be unchanged. If it is falsey however (such as if it were completely uninitialized), then this line will set it to the default value of 10. var innerCounter = innerCounter || 10; innerCounter = innerCounter + 1; ACTUAL = innerCounter; }; fn(); expect(ACTUAL === 11).to.be.true; fn(); expect(ACTUAL === 11).to.be.true; }); it('a new variable scope is created for each call to a function, as exemplified with uninitialized string variables', function () { // this is a longer form of the same observation as above, using strings in stead of numbers. var fn = function () { var localVariable; if (localVariable === undefined) { // the variable will be initialized for the first time during this call to fn ACTUAL = 'alpha'; } else if (localVariable === 'initialized') { // the variable has already been initialized by a previous call to fn ACTUAL = 'omega'; } // now that actual has been set, we will initialize localVariable to refer to a string localVariable = 'initialized'; }; fn(); expect(ACTUAL === 'alpha').to.be.true; fn(); expect(ACTUAL === 'alpha').to.be.true; }); it('an inner function can access both its local scope variables and variables in its containing scope, provided the variables have different names', function () { var outerName = 'outer'; var fn = function () { var innerName = 'inner'; ACTUAL = innerName + outerName; }; fn(); expect(ACTUAL === 'innerouter').to.be.true; }); it('between calls to an inner function, that inner function retains access to a variable in an outer scope. Modifying those variables has a lasting effect between calls to the inner function.', function () { var outerCounter = 10; var fn = function () { outerCounter = outerCounter + 1; ACTUAL = outerCounter; }; fn(); expect(ACTUAL === 11).to.be.true; fn(); expect(ACTUAL === 12).to.be.true; }); it('the rule about retaining access to variables from an outer scope still applies, even after the outer function call (that created the outer scope) has returned', function () { var outerFn = function () { // NOTE: the contents of this function is the same as the entire body of the previous test var counterInOuterScope = 10; var innerIncrementingFn = function () { counterInOuterScope = counterInOuterScope + 1; ACTUAL = counterInOuterScope; }; innerIncrementingFn(); expect(ACTUAL === 11).to.be.true; innerIncrementingFn(); expect(ACTUAL === 12).to.be.true; // Here, we retain a reference to the newly created inner function for later, by assigning it to the global scope (window) window.retainedInnerFn = innerIncrementingFn; }; // before we run outerFn, there will be no innerFn exported to the global scope expect(window.retainedInnerFn).to.equal.undefined; // running this outer function should have the same effect as running the whole previous test, with the addition of placing the innerFn somewhere that we can reach it after outerFn has returned outerFn(); expect(window.retainedInnerFn).to.be.a('function'); // even though the outerFn has returned once the only call to it was completed a couple of lines above, the inner function remains available in the global scope, and still has access to the variables of that containing scope where it was first created. window.retainedInnerFn(); expect(ACTUAL === 13).to.be.true; }); }); })();

Front

go through thsi...

Back

new vs Object.create for instantiating objects of classes?

Front

Object.create

Back

Write a function that adds from two invocations. add(3)(4) // 7 add(12)(20) // 32

Front

function add(a){ return function(b){ a + b }; }

Back

Write up a quick display of the module pattern with a function called Module, privateProperty, privateMethod, publicProperty, publicMethod, and privilegedMethod

Front

var Module = function(){ var privateProperty = "foo"; var privateMethod = function(){ //do something }; return { publicProperty: "", publicMethod: function(args){ //do something }, privilegedMethod: function(args){ privateMethod(args); } } }

Back

// this is a longer form of the same observation as above, using strings in stead of numbers. var fn = function () { var localVariable; if (localVariable === undefined) { // the variable will be initialized for the first time during this call to fn ACTUAL = 'alpha'; } else if (localVariable === 'initialized') { // the variable has already been initialized by a previous call to fn ACTUAL = 'omega'; } // now that actual has been set, we will initialize localVariable to refer to a string localVariable = 'initialized'; }; fn(); expect(ACTUAL === 'alpha').to.be.true; fn(); expect(ACTUAL === 'omega').to.be.true; //what's wrong here?

Front

second value should be alpha

Back

In Javascript what are namespaces?

Front

In JavaScript a namespace is just another object containing methods, properties, and objects. (The idea behind creating a namespace in JavaScript is simple: create one global object, and all variables, methods, and functions become properties of that object. Use of namespaces also reduces the chance of name conflicts in an application, since each application's objects are properties of an application-defined global object. )

Back

Inside object literals, what does the <this> keyword refer to?

Front

Inside Object literals, the this value will always refer to it's own Object. Nice and simple to remember. / create an object var myObject = {}; // create a method on our object myObject.someMethod = function () { console.log(this); }; // call our method myObject.someMethod();

Back

var globalObject = this; var foo = (() => this); what is the value of foo() ?

Front

globalObject;

Back

Section 8

(50 cards)

Recursive Function Recipe

Front

var recurse = function() { if (){ //basecase } else { //recursive case recurse(); } return;

Back

5 % 4

Front

1

Back

Lazy Evaluation vs Short Circuiting?

Front

The difference is that in case of lazy evaluation an expression is evaluated only when it is needed, while in case of short-circuit evaluation expression evaluation stops right after you know the result. It's sort of orthogonal notions.

Back

postfix vs prefix operators

Front

If used postfix, with operator after operand (for example, x++), then it returns the value before incrementing. If used prefix with operator before operand (for example, ++x), then it returns the value after incrementing. // Postfix var x = 3; y = x++; // y = 3, x = 4 // Prefix var a = 2; b = ++a; // a = 3, b = 3

Back

how do you write a for loop that iterates through an array backwars

Front

for (var i = 0; i < arr.length; i++){ console.log(arr[arr.length-1-i]); } for (var i = testArr.length-1; i >= 0; i--){ //console.log(testArr[i]); } var goToLoop = function(){ for (var i = testArr.length; i --> 0;){ console.log(testArr[i]); } return "DONE"; }

Back

how to get rid of all the falsey values in an array? false, null, undefined, 0, NaN or ""

Front

var a=[1,2,"b",0,{},"",NaN,3,undefined,null,5]; var b=a.filter(Boolean); // [1,2,"b",{},3,5]

Back

1 % 2

Front

1

Back

console.clear()

Front

Clears the console.

Back

Chrome $() equivalent

Front

document.querySelector(); (Returns the first matching Element node within the node's subtree. If no matching node is found, null is returned.) (Returns the first element that matches the specified CSS selector. It is a shortcut for document.querySelector )

Back

100 % 50

Front

0

Back

100 % 101

Front

100

Back

Javascript ASI (Automatic Semicolon insertion)

Front

1. When a token (LineTerminator or }) is encountered that is not allowed by the grammar, a semicolon is inserted before it if: - The token is separated from the previous token by at least one LineTerminator. - The token is } { 1 2 } 3 // is transformed to { 1 ;2 ;} 3; The NumericLiteral 1 meets the first condition, the following token is a line terminator. The 2 meets the second condition, the following token is }. 2. When the end of the input stream of tokens is encountered and the parser is unable to parse the input token stream as a single complete Program, then a semicolon is automatically inserted at the end of the input stream. a = b ++c // is transformed to: a = b; ++c; / 3. This case occurs when a token is allowed by some production of the grammar, but the production is a restricted production, a semicolon is automatically inserted before the restricted token. ostfixExpression : LeftHandSideExpression [no LineTerminator here] ++ LeftHandSideExpression [no LineTerminator here] -- ContinueStatement : continue [no LineTerminator here] Identifieropt ; BreakStatement : break [no LineTerminator here] Identifieropt ; ReturnStatement : return [no LineTerminator here] Expressionopt ; ThrowStatement : throw [no LineTerminator here] Expression ; classic example: return "something"; // is transformed to return; "something"; (http://stackoverflow.com/questions/2846283/what-are-the-rules-for-javascripts-automatic-semicolon-insertion-asi)

Back

higher order functions

Front

In mathematics and computer science, a higher-order function (also functional, functional form or functor) is a function that does at least one of the following: takes one or more functions as arguments (i.e., procedural parameters), returns a function as its result.

Back

Combine the following arrays: let arr1 = [1,2,3]; let arr2 = [2,3,4]; let arr3 = [5,6,7];

Front

arr1.concat(arr2,arr3);

Back

What are the different ways to duplicate an array in JS?

Front

loop constructor slice / splice concat

Back

Native vs Library Methods - when to use?

Front

Library methods should be used for contrived and convoluted uses of native methods that often confuse more than make progress in code. However, if there is a native method for a specific task that is tailored to that task always use the native method.

Back

immutable datatypes vs mutable data types

Front

Back

What is the purpose of the delete operator?

Front

The purpose of the delete operator is to completely remove a property from an object, whereas setting a property to undefined just sets the property to undefined.

Back

How does Array.prototype.slice.call(arguments) work?

Front

What happens under the hood is that when .slice() is called normally, this is an Array, and then it just iterates over that Array, and does its work. How is this in the .slice() function an Array? Because when you do: object.method(); ...the object automatically becomes the value of this in the method(). So with: [1,2,3].slice() ...the [1,2,3] Array is set as the value of this in .slice(). But what if you could substitute something else as the this value? As long as whatever you substitute has a numeric .length property, and a bunch of properties that are numeric indices, it should work. This type of object is often called an array-like object. The .call() and .apply() methods let you manually set the value of this in a function. So if we set the value of this in .slice() to an array-like object, .slice() will just assume it's working with an Array, and will do its thing. Take this plain object as an example. var my_object = { '0': 'zero', '1': 'one', '2': 'two', '3': 'three', '4': 'four', length: 5 }; This is obviously not an Array, but if you can set it as the this value of .slice(), then it will just work, because it looks enough like an Array for .slice() to work properly. var sliced = Array.prototype.slice.call( my_object, 3 ); Example: http://jsfiddle.net/wSvkv/ As you can see in the console, the result is what we expect: ['three','four']; So this is what happens when you set an arguments object as the this value of .slice(). Because arguments has a .length property and a bunch of numeric indices, .slice() just goes about its work as if it were working on a real Array.

Back

How to inspect document.body when JQuery is used while using $?

Front

inspect($(document.body)[0]); (https://api.jquery.com/category/selectors/)

Back

The else of : if (a < b) { //execute }

Front

a >= b

Back

what's wrong with this code? function () { return {key : "yo"}; }

Front

ASI adds semicolon after return resulting in no return value.

Back

STACK ACRONYM

Front

LIFO - push, pop, size, peek or top (push returns size of stack, but pushes an element onto stack, pop - pops off top and returns that value, size() returns value of size)

Back

100 % 200

Front

100

Back

So you just selected three elements in order a, div, h1 and in console you do $1 what do you get back?

Front

div

Back

The else of : if (a >= b) { //execute }

Front

a < b

Back

300 % 200

Front

100

Back

What statements does ASI affect?

Front

empty statement var statement expression statement do-while statement continue statement break statement return statement throw statement (http://stackoverflow.com/questions/2846283/what-are-the-rules-for-javascripts-automatic-semicolon-insertion-asi)

Back

console.assert(expression, object)

Front

Writes error to the console when the evaluated expression is false. (https://developers.google.com/web/tools/chrome-devtools/debug/console/console-reference#assert)

Back

What's special about Array.prototype.slice()?

Front

The slice function is intentionally generic; it does not require that its <this> value be an Array object. Therefore it can be transferred to other kinds of objects for use as a method. Whether the slice function can be applied successfully to a host object is implementation-dependent.

Back

What does the JQuery $ return?

Front

JQuery Object contains array of elements.

Back

Sum up an array named arr

Front

arr.reduce( (prev, curr) => prev + curr );

Back

QUEUES ACRONYM

Front

FIFO - enqueue or push, dequeue or pop, size

Back

What is the value of arr1 after arr1.filter(num => num > 5); where let arr1 = [4,7,9,1];

Front

[4,7,9,1]; (array that is filtered is unchanged)

Back

Can strings be changed?

Front

Strings are immutable :(

Back

what pattern does this exhibit? var Toaster = function(){ //private here var status = false; var voltage = 3.0; var manufacturer = 91745321; var changeVoltage = function(num){ voltage = num; }; return { toggle : function() { status = !status; }, showStats : function(){ console.log(voltage); console.log(status); console.log(manufacturer); }, toast : function(bread){ bread === 'new' ? bread === 'toasty' : bread === 'burnt'; }, callManufacturer : function(){ console.log(manufacturer); } }; };

Front

module pattern -- how does it work? how are the private variables private? how are certain methods privileged and some are public?

Back

What is the return value of arr1.filter(num => num > 5); where let arr1 = [4,7,9,1];

Front

[7,9];

Back

what's wrong with this recursive function? var tracker = 0; var callMe = function() { tracker++ if (tracker === 3) { return 'loops!'; } callMe('anytime'); }; why doesn't it return 'loops'?

Front

it returns undefined since 'loops' isnt worked back up the call stack. the third call of callMe() does return 'loops', but the second call of callMe() doesn't use that anywhere.

Back

explain new

Front

A new object is created, inheriting from Foo.prototype. The constructor function Foo is called with the specified arguments, and with this bound to the newly created object. new Foo is equivalent to new Foo(), i.e. if no argument list is specified, Foo is called without arguments. The object returned by the constructor function becomes the result of the whole new expression. If the constructor function doesn't explicitly return an object, the object created in step 1 is used instead. (Normally constructors don't return a value, but they can choose to do so if they want to override the normal object creation process.)

Back

How to inspect the third a tag when JQuery is used while using $?

Front

inspect($("a")[2]); (https://api.jquery.com/category/selectors/)

Back

$0

Front

View previous selection in Chrome Inspect

Back

Delete all numbers that are greater than 5 in this array: let arr1 = [4,7,9,1];

Front

arr1.filter( num => num <= 5);

Back

50 % 100

Front

50

Back

can any recursion function be turned into a function that uses iteration?

Front

Can you always turn a recursive function into an iterative one? Yes, absolutely, and the Church-Turing thesis proves it if memory serves. In lay terms, it states that what is computable by recursive functions is computable by an iterative model (such as the Turing machine) and vice versa. The thesis does not tell you precisely how to do the conversion, but it does say that it's definitely possible. In many cases, converting a recursive function is easy. Knuth offers several techniques in "The Art of Computer Programming". And often, a thing computed recursively can be computed by a completely different approach in less time and space. The classic example of this is Fibonacci numbers or sequences thereof. You've surely met this problem in your degree plan.

Back

inspect(object/function)

Front

Open element in appropriate panel. (inspect(object/function) opens and selects the specified element or object in the appropriate panel: either the Elements panel for DOM elements or the Profiles panel for JavaScript heap objects.)

Back

Why is this wrong: let arr = [a];

Front

a is not defined (the code will attempt to put the variable a into an object as the value to key 0 i.e. {0 : a})

Back

$(object/function)

Front

Open in inspect ?

Back

JQuery $(selector [, context ] )

Front

Accepts a string containing a CSS selector which is then used to match a set of elements.

Back

What happens if you delete an array element? var arr = [1,2,3,4]; delete arr[3];

Front

When you delete an array element, the array length is not affected. This holds even if you delete the last element of the array. When the delete operator removes an array element, that element is no longer in the array.

Back

When in other tabs how to open console quickly?

Front

Esc or button on right hand side.

Back

Section 9

(50 cards)

What is the question mark called?

Front

quantifier

Back

RegExp.prototype.test()

Front

Search regexp return boolean (The text() method executes a search for a match between a regular expression and a specified string. Returns true or false. var str = "hello world!"; var result = /^hello/.test(str); console.log(result); // true)

Back

.

Front

Match any character except newline (For example, /.n/ matches 'an' and 'on' in "nay, an apple is on the tree", but not 'nay'. Take note that that means anything that is NOT optional is mandatory. 'nay' is not matched because it doesnt have the specific order of a single character and then the 'n' character.)

Back

Unminifying in DevTools

Front

{} button on bottom

Back

* (Quantifier)

Front

Match preceding expression 0 or more times (For example, /bo*/ matches 'boooo' in "A ghost booooed" and 'b' in "A bird warbled", but nothing in "A goat grunted".)

Back

Front

Back

What is a regular expression?

Front

Search pattern matching for strings. (A sequence of characters that define a search pattern, mainly for use in pattern matching with strings, or string matching, i.e. "find and replace"-like operations.)

Back

m flag

Front

multiline search

Back

$ (Anchor)

Front

Match end of input ( If the multiline flag is set to true, also matches immediately before a line break character. For example, /t$/ does not match the 't' in "eater", but does match it in "eat".)

Back

Pause on exceptions

Front

Pause button on right (While it's paused you can hover over variables to see its values!)

Back

saying for caret and dollar?

Front

(you farm carrots to make dollars. so the ^ indicates beginning, the $ indicates the end of input.)

Back

Let has what scope?

Front

Block scope

Back

What are the three ways to disable/refresh cache in DevTools?

Front

Hard Refresh, incognito mode, Disable Cache option

Back

What are regex anchors?

Front

^ $

Back

Red vertical line in timeline?

Front

Load

Back

What are the two ways to define regular expressions in Javascript? (Code for a string with an 'a', one or more 'b's and a 'c')

Front

var re /ab+c/; var re = new RegExp("ab+c"); (1. Using a literal, which is a pattern enclosed in slashes. var re = /ab+c/. 2. Calling the constructor function of the RegExp object. var re = new RegExp("ab+c");)

Back

List the Chrome DevTools Storage Items

Front

Local Storage, Session Storage, IndexedDB, WebSQL, Cookies

Back

Pause on uncaught exceptions

Front

Pause button on right twice or in settings.

Back

y flag

Front

sticky search The sticky property reflects whether or not the search is sticky (searches in strings only from the index indicated by the lastIndex property of this regular expression). sticky is a read-only property of an individual regular expression object.

Back

Execution control buttons

Front

Resume, Step over, Step into, Step out of, deactivate Breakpoints

Back

Normal Reload

Front

Use cache, revalidate everything (Normal browsing, The same thing as pressing F5. This will use the cache but revalidate everything during page load, looking for "304 Not Modified" responses. If the browser can avoid re-downloading cached JavaScript files, images, text files, etc. then it will.)

Back

Web Event: DOMContentLoaded

Front

HTML document loaded (The DOMContentLoaded event is fired when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading. https://developer.mozilla.org/en-US/docs/Web/Events/DOMContentLoaded)

Back

Save to local after modifying Sources to see the effect?

Front

Right click + save

Back

\s

Front

Match white space character. (Matches a single white space character, including space, tab, form feed, line feed. Equivalent to [ \f
\r\t\v\u00a0\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]. For example, /\s\w*/ matches ' bar' in "foo bar.")

Back

Array, Date, Function are all what datatype?

Front

Objects

Back

? (Quantifier)

Front

Make preceding token optional. (The question mark makes the preceding token in the regular expression optional. colou?r matches both colour and color. The question mark is called a quantifier. You can make several tokens optional by grouping them together using parentheses, and placing the question mark after the closing parenthesis. E.g.: Nov(ember)? matches Nov and November. You can write a regular expression that matches many alternatives by including more than one question mark. Feb(ruary)? 23(rd)? matches February 23rd, February 23, Feb 23rd and Feb 23. For example, /e?le?/ matches the 'el' in "angel" and the 'le' in "angle" and also the 'l' in "oslo".)

Back

What are the regular expression flags?

Front

g i m y

Back

What is the initiator column on Network tab?

Front

File and line that requested resource

Back

+ (Quantifier)

Front

Match preceding expression 1 or more (For example, /a+/ matches the 'a' in "candy" and all the a's in "caaaaaaandy", but nothing in "cndy".)

Back

Set breakpoints

Front

Line number on left

Back

Var has what scope?

Front

Function scope

Back

Nonprimitive JS Datatype

Front

Objects

Back

Has the line that you set a breakpoint on been run?

Front

no

Back

g flag

Front

global search ( The "g" flag indicates that the regular expression should be tested against all possible matches in a string.)

Back

Web Event: Load

Front

All content loaded (The load event is fired when a resource and its dependent resources have finished loading. https://developer.mozilla.org/en-US/docs/Web/Events/load)

Back

What are special characters in regular expressions?

Front

Non-direct match search (When the search for a match requires something more than a direct match, such as finding one or more b's, or finding white space, the pattern includes special characters. For example, the pattern /ab(asterisk)c/ matches any character combination in which a single 'a' is followed by zero or more 'b's (* means 0 or more occurrences of the preceding item) and then immediately followed by 'c'. In the string "cbbabbbbcdebc," the pattern matches the substring 'abbbbc'.)

Back

What does str.prototype.match(RegExp) return?

Front

array match result else null (An Array containing the entire match result and any parentheses-captured matched results, or null if there were no matches.)

Back

^ (Anchor)

Front

Match beginning of input (Matches beginning of input. If the multiline flag is set to true, also matches immediately after a line break character. For example, /^A/ does not match the 'A' in "an A", but does match the 'A' in "An E". The '^' has a different meaning when it appears as the first character in a character set pattern. See complemented character sets for details and an example.)

Back

What does Incognito Mode do?

Front

fresh cache, no cookies, no history (It essentially sets the cache path to a temporary folder. Cookies are still used, but everything starts "fresh" when the incognito window is launched. This applies all storage, including Cookies, Local Storage, Web SQL, IndexedDB, cache, etc. Of course Chrome also leaves pages out of the browser's history.)

Back

Blue vertical line in timeline?

Front

DOMContentLoaded

Back

How are anchors different in what characters they specify?

Front

(The caret, ^ does the r.e. after and $ does the r.e. before. i.e. /^abc$/ -> checks a begin and c end)

Back

i flag

Front

case-insensitive search

Back

Primitive JS Datatypes

Front

Boolean, Null, Undefined, Number, String, Symbol

Back

$$(selector) alternative

Front

document.querySelectorAll() ( returns an array of elements that match the given CSS selector)

Back

Whats the difference between * and +?

Front

(The * matches preceding expression even when not existent 0 or more times, but the + necessitates its existence that is 1 or more times.)

Back

console.warn(object [, object, ...])

Front

Prints a message like console.log(), but also displays a yellow warning icon next to the logged message.

Back

Sometimes the reload button doesnt show various options. Why is that?

Front

Developer tools not open

Back

Save in memory after modifying Sources to see the effect?

Front

CMD + S

Back

What are simple patterns in regular expressions?

Front

(Simple patterns are constructed of characters for which you want to find a direct match. For example, the pattern /abc/ matches character combinations in strings only when exactly the characters 'abc' occur together and in that order. Such a match would succeed in the strings "Hi, do you know your abc's?" and "The latest airplane designs evolved from slabcraft." In both cases the match is with the substring 'abc'. There is no match in the string 'Grab crab' because while it contains the substring 'ab c', it does not contain the exact substring 'abc'.)

Back

\

Front

Backslash next character interpreted literally (First know that this is a backslash, not a slash. Slashes go from L to R. A backslash that precedes a special character indicates that the next character is not special and should be interpreted literally. For example, the pattern /a/ relies on the special character '' to match 0 or more a's. By contrast, the pattern /a\/ removes the specialness of the '' to enable matches with strings like 'a*'.)

Back

Section 10

(50 cards)

\t

Front

Tab

Back

write a regex to find calendar or calender when misspelt

Front

/calend[ae]r/

Back

Smile - Self Influencing

Front

Act as if you were already happy, and that will tend to make you happy.

Back

\B meaning

Front

Matches a non-word boundary. This matches a position where the previous and next character are of the same type: Either both must be words, or both must be non-words. The beginning and end of a string are considered non-words.

Back

Smile - Fun and Success

Front

People rarely succeed at anything unless they have fun at it.

Back

\S

Front

Match single non white-space character

Back

{3}

Front

preceding expression 3 times

Back

"possibly yesterday".match(/ye\B/)

Front

["ye"]

Back

\B (examples needed)

Front

non-word boundary

Back

Write a regex to find Jennifer, Jen or Jenny and a last name using a bracket quantifier

Front

/(Je[nnifer|nny|n]{1-6}\s\w+\s/

Back

(x)

Front

Matches x and remembers the match (called capturing groups)

Back

\r

Front

Carriage Return

Back


Front

Line Break

Back

{1,3}

Front

preceding expression 1 to 3 times

Back

"moon".match(/\bm/)

Front

["m"]

Back

{N}

Front

Match N of preceding expression (Bounded repeat: Matches exactly n occurrences of the preceding expression. N must be a positive integer. For example, /a{2}/ doesn't match the 'a' in "candy," but it does match all of the a's in "caandy," and the first two a's in "caaandy.")

Back

A Simple Way to Make a Good First Impression

Front

Smile

Back

Don't Criticize, Condemn, or Complain - Thomas Carlyle

Front

A great man shows his greatness by the way he treats little men.

Back

"yo".match(/\Byo/);

Front

null

Back

"yoo".match(/yo\B/);

Front

["yo"]

Back

Smile - Dog

Front

Why are dogs so loved? They do not desire anything but are so naturally glad to see people. This same love is reciprocated.

Back

"abc def".match(/\b./) returns?

Front

returns ["a"]; - only returns first one due to no /g flag

Back

\b meaning

Front

Matches a word boundary. A word boundary matches the position where a word character is not followed or preceeded by another word-character. Note that a matched word boundary is not included in the match. In other words, the length of a matched word boundary is zero. (Not to be confused with [\b].)

Back

"yoo".match(/\Byo/);

Front

null

Back

\b

Front

word boundary. (Matches a word boundary. This is the position where a word character is not followed or preceded by another word-character, such as between a letter and a space. Note that a matched word boundary is not included in the match. In other words, the length of a matched word boundary is zero.)

Back

Do This and You'll Be Welcome Anywhere

Front

Become genuinely interested in people

Back

Become genuinely interested in people - Theodore Roosevelt

Front

Story of the bobwhite and the valet's wife.

Back

"doomoom oom".match(/oom\b/g)

Front

["oom", "oom"]

Back

Don't Criticize, Condemn, or Complain - Benjamin Franklin

Front

I will speak ill of no man, and speak all the good I know of everybody

Back

Smile - Meetings

Front

You MUST have a good time meeting people if you expect them to have a good time meeting you.

Back

Smile - Takeways

Front

Give positive feedback, let people know that you're listening. Smile, laugh out loud. The expression one wears on one's face is far more important than the clothes on wears on one's back.

Back

Write a regex to looks for phone numbers with or w/o dashes, with or w/o parens

Front

/t|(\(?[0-9]{3}\)[0-9]{3}\)?[0-9]{4})/

Back

Don't Criticize, Condemn, or Complain - Self-justification examples

Front

Two Gun Crowley, Al Capone, Dutch Schultz

Back

"Moon".match(/\bm/)

Front

null

Back

Become genuinely interested in people - Knaphle

Front

Asking for help to those who can help is a compliment to their skill and generates interest. "I have come to you for help because I can't think of anyone else who could be more capable of giving me the facts I want. I'm anxious to win this debate, and I'll deeply appreciate whatever help you can give me."

Back

Become genuinely interested in people - Howard Thurston

Front

Greatest magician who told himself, "I am grateful because these people come to see me. They make it possible for me to make my living in a very agreeable way. I'm going to five them the very best I possibly can. "I love my audience." before every show.

Back

"moon".match(/oo\b/)

Front

null

Back

Become genuinely interested in people - Alfred Adler

Front

It is the individual who is not interested in his fellow men who has the greatest difficulties in life and provides the greatest injury to others. It is from among such individuals that all human failures spring.

Back

Multi line flag definition

Front

The m flag is used to specify that a multiline input string should be treated as multiple lines. If the m flag is used, ^ and $ match at the start or end of any line within the input string instead of the start or end of the entire string.

Back

\d

Front

Match digit character (Equivalent to [0-9]. For example, /\d/ or /[0-9]/ matches '2' in "B2 is the suite number.")

Back

Don't Criticize, Condemn or Complain - Lincoln

Front

with malice toward none, with charity for all

Back

Write a regex to find Jennifer, Jen, or Jenny and a last name using only one quantifier

Front

(Jennifer|Jen|Jenny)(\b\w+)\b

Back

Back reference the third paren surrounded regexp

Front

\3

Back

"moon".match(/oon\b/)

Front

["oom"]

Back

\D

Front

Match non-digit character (Matches any character that is not a digit in the basic Latin alphabet. Equivalent to [^0-9]. For example, /\D/ or /[^0-9]/ matches "B" in "B2 is the suite number".)

Back

If you want to gather honey, don't kick over the beehive

Front

Don't criticize, condemn, or complain.

Back

Become genuinely interested in people - George Dyke

Front

In his humble and friendly way he became generally interested in learning the background nad interests of every musician he met.

Back

[xyz]

Front

Character set. (Character Sets - This pattern type matches any one of the characters in the brackets, including escape sequences. Special characters like the dot(.) and asterisk (*) are not special inside a character set, so they don't need to be escaped. You can specify a range of characters by using a hyphen, as the following examples illustrate. The pattern [a-d], which performs the same match as [abcd], matches the 'b' in "brisket" and the 'c' in "city". The patterns /[a-z.]+/ and /[\w.]+/ match the entire string "test.i.ng".)

Back

"at noon".match(/\Bon/)

Front

["on"]

Back

write a regex with brackets for a character between A through F or a through t (lowercase) and 0 through 4

Front

/[A-Fa-t0-4]/

Back

Section 11

(50 cards)

topics of conersation

Front

of less ocntroversial nature. save political debate for after hour dinners. avoid squeamish subject. avoid vulgar language.

Back

Accepted reply to formal intros

Front

how do you do

Back

robert morrison was exceptional scholar

Front

in Greek and Latin

Back

Remember names and use them - Ken Nottingham

Front

Story of addressing people with their names over the counter as a sign of endearment.

Back

the good man is one who is

Front

of strong character, just and generous in his freindship, loyal and upright. friendship is born between men who share these ideals.

Back

greek alphabet

Front

alpha beta gamma delta epsilon zeta eta theta iota kappa lambda mu nu xi omicron pi rho sigma tau upsillon phi chi psi omega

Back

Female graduate

Front

alumna

Back

Brethren is

Front

archaic

Back

Male graduate term

Front

almnus

Back

How long was the olympian of pi delta theta

Front

316 pages

Back

Phikeia meeting procedure

Front

Roll Call, Minutes of Last Meeting, Reports of Officers, Reports of Committees, Scholarship Reports, Old Business, New Business, Announcements, Examination on Assigned Material, Guest Speakers, Assignments.

Back

If You Don't Do This, You are Headed for Trouble

Front

Remember that a person's name is to that person the sweetest and most important sound in any language.

Back

Walter B Palmer, emory-Vanderbilt 1877

Front

Phi Delta Theta was organized with tthree principle objectives: The cultivation of friendship among its members; the acquirement individually of a high degree of mental culture, and the attainment personally of a high standard of morality

Back

greek and roman writers saw friendship as...

Front

unity of skills, tastes and thoughts

Back

why not use nationals

Front

incorrect usage since 1902 when PDT installed its first Canadian chapter at McGill Uni in Quebec. PDT should be referenced as the General or International headquarters (1902) (1902)

Back

Smile - Shakespeare

Front

"There is nothing either good or bad, but thinking makes it so"

Back

Founders?

Front

John Wolfe Lindley, Robert Morrison Miami 1849

Back

Smile - Final sentence

Front

For nobody needs a smile so much as those who have none left to give.

Back

Remember names and use them - Jim Farley

Front

" I can call fifty thousand people by their first name"

Back

when can napkins be tucked in

Front

only if riding on a plane

Back

Why not say house instead of chapter

Front

smoe chapters dont have houses

Back

Remember names and use them - Franklin D Roosevelt, Napoleon III

Front

Asking for names if they are unclear. "To recall a voter's name is statesmanship. To forget it is oblivion"

Back

telephone etiquette

Front

"Phi Delta Theta, how may I help you?"

Back

three cardinal rules

Front

friendship, sound learning, rectitude

Back

Sipping beverages

Front

Don't sip until mouth is empty and has been wiped with a napkin. Keeps rim of cup or glass free from food marks

Back

Silverware order

Front

Outside in. Utensils used for first course are farthest and closer as courses progress.

Back

Brotherhood is a feeling that comes...

Front

from the experiences shared with close friends. It transecends typical friendship, becoming a familial relationship.

Back

Manual renamed what

Front

The Olympian of Phi Delta Theta

Back

Palmer's objectives are defined in

Front

the bond of phi delta theta which every member admitted to the fraternity pledges himself to uphold. bond will remain involate and unalterable

Back

first greek letter organization?

Front

phi beta kappa

Back

secrecy concerning the organization is

Front

perpetually and wisely enjoyed in The Bond, not because secrecy is a vital factor, but it is important where friendships are so close and confidential.

Back

mutual pledge (spirit of the fraternity)

Front

all for one and one for all

Back

Frat is

Front

colloquial

Back

Size of manual

Front

4.5" x 6" and 54 pages

Back

Second founders?

Front

Walter B Palmer, Emory-Vandrbilt 1877 and George Banta Sr. Franklin-Indiana 1876

Back

Formal introductions

Front

Mr. Guest, may I present Mr.Member . Introduce a gentleman to a lady, a member toa guest, anda young person to a markedly older person. Distinguished people are to be introduced to. i.e. Dr.Taylor, let me present Miss Patterson

Back

Oath

Front

I now declare that I pledge myself and my services to the Phi Delta Theta Fraternity. That I will discharge faithfully the duties devolving upon me as a Phikeia, and that I will try to promote the welfare of the Fraternity, and that I will be always mindful of the basic principles of the Fraternity. And further, I pledge myself as a college man to uphold the honor and dignity of Phi Delta Theta, everywhere and at all times. I will never bring disgrace to this, my Fraternity, by any act of dishonesty or moral cowardice. I will stand firm for the ideals and sacred things of my Fraternity, both alone and with my Phikeia Brothers. I will revere and obey the laws of the Fraternity, and do my best to incite a like respect and reverence in my Phikeia brothers and in every member of this chapter. I will strive in all ways to transmit the Fraternity to thoswe who may follow after, not only not less, but greater than it was transmitted to me.

Back

Remember names and use them - Andrew Carnegie

Front

Pullman donation by simple renaming of factories of steel manufacturers

Back

Smile - Perception

Front

How do people perceive work? Perception is everything. It isnt what you have or who you are or where you are or what you are doing that makes you happy or unhappy. It is what you think about it.

Back

high scholastic achievement

Front

is almost impossible without a sense of intellectual curiosity and a drive for truth and understanding.

Back

First manual was printed when

Front

1886

Back

the bond will reain...

Front

inviolate and unalterable

Back

get by more than

Front

gentleman's c grade

Back

Who printed the first manual

Front

Walter B Palmer, Emory-Vanderbilt 1877

Back

who enters dining room first

Front

guests and ladies

Back

Smile - Chinese proverb

Front

"A man without a smiling face must not open a shop"

Back

Plural for male graduate

Front

alumni

Back

friendship

Front

true friendship, for one who strives to act maturely, will raise thq uestion - what can i give, rather than what is in it for me?

Back

sound learning ==

Front

intellectual curiosity and a search for truth

Back

Plural for female graduate

Front

alumnae (pronounced alumnee)

Back

Section 12

(50 cards)

NPHC

Front

1930 when founded -- national panhellenic for African aMerican

Back

great snowball rebellion

Front

students of miami blocked the entrances of the amin educational and administrative building in the winter of 1847.

Back

Morton george Williams

Front

FFirst chosen, First Taken, Best Beloved

Back

First black greek letter men's fraternity

Front

Alpha Phi Alpha, Cornell University 1906

Back

Miami Triad

Front

Beta Theta Pi, Phi Delta Theta, Sigma Chi

Back

phi beta kappa meaning?

Front

philosophy is the guide of life

Back

Two members of PDT that have been honored by sororities

Front

George Banta Sr., Franklin-Indiana 1876, Guy Potter Bento, Ohio Wesleyan 1886

Back

Morrisons philosophy

Front

to do what ought to be done but what would not ahve been done unless i did it, i thought to be my duty

Back

when was phi beta kappa founded?

Front

december 5 1776 at the college of william and mary in williamsburg, virginia, the second-oldest institution for higher learning in America. -- in Old Raleigh Tavern

Back

two members of phi delta theta getting distinction from women

Front

george banta sr,., franklin-indiana 1876- in 1879 georgre banta initiated to help DG expansion effort

Back

First frat chapter west of Allegheny Mountains?

Front

Alpha Delta Phi at Miami University - 1833

Back

First Greek Letter Organization...

Front

Phi Beta Kappa 1776, College of WIlliam and Mary

Back

Authors of Bond of PDT

Front

John MOrriosn Miami Ohio 1849, John McMillan Wilson, Miami-Ohio 1849

Back

PDT was founded as..

Front

first fraternity aside Phi Beta kappa to be founded on a campus without a Greek letter organization

Back

Robert MOrrison was an exceptional scholar in..

Front

Greek and Latin

Back

Who stole our pin?

Front

Sigma Tau Gamma

Back

Firstfraternity to expand into canada

Front

Zeta Psi, University of Tornoto 1879

Back

when was pdt founded

Front

december 26, 1848

Back

First sisterhood?

Front

alpha Delta Pi

Back

union triad

Front

sigma phi, delta phi, kappa alpha society.

Back

miami triad

Front

beta theta pi, phi delta theta, sigma chi

Back

Sound learning

Front

intellectual curiosity and a search for truth.

Back

winter of 1847?

Front

The Great Snowball Rebellioon

Back

True friendship will raise the question

Front

What can I give? rather than What is in it for me?

Back

Three principle quotes

Front

Cultivation of friendship among its members; acquirement individually of a high degree of mental culture, attainment personally of a high standard of morality

Back

First president of GeneralCouncil

Front

George Banta, Franklin-Indiana 1876

Back

First Greek letter fraternity for black women

Front

Alpha Kappa Alpha, 1908, Howard university

Back

First man pledged to PDT

Front

Morton George Williams

Back

The good man is one..

Front

of strong character, just and generous in his friendship, loyal and upright. Friendship is born between men who share these ideals.

Back

Beta Theta Pi is the first what...

Front

first fraternity founded west of the Alleghenies

Back

Secret society literary and social in nature but not Greek

Front

Flat hat club

Back

NPC

Front

national panhellenic conference organized in 1902 and now includes 26 women's fraternities

Back

kappa alpha theta

Front

1870 - first greek letter society for women.

Back

Immortal Six

Front

Robert Morrison, Miami-Ohio 1849. John McMillan Wilson, Miami-Ohio 1849, Robert Thompson Drake Miami Ohio 1850, John Wolfe Lindley Miami Ohio 1850, Adrivan walker Rodgers, Miami Ohio 1851 Andrew Watts Rogers, Miami Ohio 1851

Back

alpha delta phi

Front

counted as the first sisterhood having been founded as the adelphean society in 1851.

Back

Phi Beta Kappa means?

Front

Philosophy is the guide to life.

Back

Greeek and Roman Writers saw freindship as..

Front

unity of skills, tastes and thoughts

Back

Webster's dictionary of rectitude

Front

idea of moral integrity and correctness of judgment

Back

alpha kappa alpha

Front

first greek frat for black women founded at howard uni

Back

What is Phi Beta Kappaa today

Front

prestigious honor society

Back

william morgan

Front

traitor of phi beta kappa revealing secrets

Back

Historic Meetings

Front

Dec 26 - create a secret society, 28 - report of committee was considered and amended, 30 - report was further debated and finally adopted, January 1st - first pledge.

Back

Union Triad

Front

Sigma Phi 1827, Delta Phi 1827, Kappa Alpha Society 1825 -- Union College in NY

Back

First organization of college women established as a national college fraternity

Front

Pi Beta Phi 1867

Back

guy potter benton

Front

guy potter benton, ohio wesleyan 1886, president of miami university.

Back

Second Founders

Front

Walter B Palmer, Emory-Vanderbilt 1877, Georga Banta Sr., Franklin-Indiana, 1876

Back

NIC

Front

north-american interfraternity conference. aimed at same goals as the NPC. 1909

Back

Walter B Palmer

Front

Emory-Vanderbilt 1877

Back

pi beta phi

Front

1867 - first organization of college women established as a national college fratnernity.

Back

Miami's chapter was called what until 1868

Front

The Grand Chapter

Back

Section 13

(50 cards)

Michael Stittgen

Front

1367

Back

Manual renamed in?

Front

Olympian of Phi Delta Theta

Back

Jeremy Harvey Brown

Front

1384, Warden

Back

rectitude

Front

moral integrity & correctness of judgment

Back

Andoni Garcia

Front

1379

Back

sound learning

Front

- comes oabout only if one has the will to study and the dirsire to penetrate beyond the surface, genetleman's c grade

Back

PDT was the first to...

Front

adopt a pledge pin and publish a pledge manual.

Back

Fourth and fifth editions

Front

Executive Secretary, Arthur R. Priest, Depauw 1891

Back

Number of provinces now?

Front

43

Back

How to get away from the table?

Front

a nod and "May I be excused"

Back

Founder's day

Front

March 16 in 1910

Back

Voting privileges at the Convention

Front

UNdergraduate chatper delegeates, members of general council, past presidents of general council, province presidents, survey commissioners, the executive vice president, the housing commissioner, other commissioners taht the general council may appoint, alumni club delegates.

Back

Palladians

Front

Every five years after becoming a Golden Legionnaire members receive a pin niscribed

Back

GHQ location

Front

Oxford Ohio.

Back

1922 Changes to the General Council

Front

offices of secretary and historian were abolished, and two members of the General Council were termed members-at-large. other three members became executivecommittee of the general council.

Back

Keenan McKenzie

Front

1369

Back

Tze Ern Teo

Front

1368

Back

First charter in a state can only be granted...

Front

by the National Grand Chapter

Back

Sam Zacher

Front

1376

Back

chapters of pdt

Front

173

Back

Bryan Bunning

Front

1382, Treasurer

Back

kappa alpha theta

Front

first greek letter society for women - 1870

Back

Sommy Irani

Front

1373

Back

Tyler Wojak

Front

1377

Back

designer of pin

Front

robert morrison, miami-ohio 1849

Back

ThirdWednesday of April

Front

Alumni Day

Back

alpha delta pi

Front

founded as first sisterhood

Back

aLPHA CHAPTER IN EACH STATE

Front

State Grand Chapter

Back

Convention of 1880 importance

Front

most important, general council and provinces were adopted. State Grand Chapter and National Grand Chapter were abolished, the executive committee was discontinued and the supremer power of the Fraternity was vested in the General Convention.

Back

James Taylor

Front

1378

Back

Sam Vexler

Front

1380

Back

Austin Little

Front

1372

Back

How long was the Olympian of Phi Delta Theta

Front

316 pages

Back

General Council roles

Front

President, Secretary, treasureser, historian, (reporter) later came in

Back

Golden Legion

Front

50 years Phis

Back

majority of greek letter societies were founded

Front

1865 - 1900

Back

Chethan Reddy

Front

1370, VP Awards Chair

Back

Silver Legion

Front

25 years Phis

Back

Convention of 1920

Front

Established a central office and created position of exec. secretary to have charge of it.

Back

pi beta phi

Front

first organization of ocollege women - 1867

Back

Jay Stemmer

Front

1383

Back

classical authors mention the duties of friendship

Front

truthfulness, mutual correction, fidelity.

Back

Who wrote the preface?

Front

Robert A Biggs, Georgia Southern `76.

Back

General Convetion powers and responsibilities

Front

Electing the General council, Revoking charters of chapters, Providing for the raising and disbursement of revenues, enacting laws for the regulation of the fraternity.

Back

picture

Front

Walter B Palmer, Emory-Vanderbilt 1877 at General Convention 1902

Back

First General Convention

Front

Cincinnati 1851

Back

Who wrote the preface?

Front

Robert A Biggs, Georgia Southern `76

Back

Diamond Legionnaires

Front

Phis for 75 years and more.

Back

Jeremy Pushkin

Front

1371

Back

Daniel Sullivan

Front

1381

Back

Section 14

(50 cards)

Conor McDonough

Front

1395

Back

Mihir Dubey

Front

1408

Back

Jeff Zhao

Front

1424

Back

Camron Bagheri

Front

1405

Back

David Gao

Front

1432

Back

Sebastian Perez

Front

1396

Back

Carter Brown

Front

1421, Risk Manager

Back

Joe Geyer

Front

1399, Community Service Chair

Back

Matt Jeong

Front

1433

Back

Kevin Yin

Front

1419

Back

Daniel Trainor

Front

1416, House Manager

Back

Jack Haggerty

Front

1427

Back

Nick Reuter

Front

1430

Back

Pierre Danly

Front

1414, Public Relations Chair, Co-Social Chair

Back

Cameron Brown

Front

1418

Back

Colin Findley

Front

1394

Back

Protocool

Front

set of rules and in context of networking given communication rules

Back

Aaron Cendan

Front

1415, Recruitment Chair, J-Board

Back

Drew Willimitis

Front

1428

Back

Duncan McGillivary

Front

1410, Alumni Secretary

Back

Sander Danly

Front

1431

Back

Kyle Lee

Front

1429, Ex-Comm member at large

Back

Chris Turner

Front

1390

Back

Kevin Brennan

Front

1425, IM Sports Representative

Back

Dakota Ford

Front

1398

Back

Ferdinand Chan

Front

1412, Scholarship Chair

Back

Jack Uidl

Front

1391

Back

Nick Luthi

Front

1388

Back

Emerson Delgado

Front

1402, Ex-Comm Member at Large

Back

Chris Summers

Front

1434

Back

Bryan Popoola

Front

1404, Phikeia Educator

Back

Nick Gallagher

Front

1407

Back

Ryan Keem

Front

1409

Back

Brendan Brown

Front

1422, Social Chair, Chorister, Steward

Back

Alex Espinosa

Front

1426, House Tech

Back

Brian Yan

Front

1385

Back

Justin Boganey

Front

1403

Back

Ziyad El-Mouniri

Front

1406

Back

Gustavo Velazquez

Front

1400

Back

David Tong

Front

1413, Assistant to Treasurer

Back

Hunter McComas

Front

1397

Back

Mantim Lee

Front

1411

Back

Roland Li

Front

1420

Back

Andrew Kilbourne

Front

1393

Back

Cristian Saucedo

Front

1401

Back

Rolland Lee

Front

1435

Back

Luke Wilson

Front

1417, Fundraising Chair

Back

Francis Beach

Front

1392

Back

Rohit Satishchandra

Front

1423

Back

Alex Mobashery

Front

1389, Secretary, Co-Brotherhood Chair

Back

Section 15

(50 cards)

Subnet masks aresometimes noted using a shorthand

Front

add a slash and the number of bits that are used for subnet mask /24 would be a class C address.

Back

: dig

Front

use Domain Information Groper (dig) to preferom a DNS lookup on yur DNS server and display detailed info about the hostname being resolved and about dns server itself a - resolve a record info ptr - resolve a ptr record cname - resolve cname record info in - resolve internet record info mx - resolve mx record info soa - resolve start of authority info

Back

: dhclient eth0

Front

specify that your eth0 interface gets IP address dynamically from DHCP

Back

Port 110

Front

POP3

Back

: route del -net network_address netmask netmask gw route_address

Front

a

Back

: host

Front

host command to resolve hostnames whereas dig provides extensive name resolution info host provides quick info the syntax is ismilar to dig. you enter host hostname DNS_server at shell prompt -- shows quick info -- very useful

Back

Data Link

Front

defines rules and procedures for accessing the physical layer. it defines how hosts are identified on the network and how the network medium is accessed. it also sepecified how to verify that the data received from the physical layer doesn't have any errors. information received from upper layers is orrganized into datagrams

Back

1024 - 49151

Front

Registered Ports

Back

Physical LAyer

Front

transmits electrical signals between hosts

Back

CLASS C

Front

192.168.0.0. - 192.168.255.255

Back

different DNS records

Front

CNAME, FQD

Back

Network

Front

Enables the routing of the data. It specified how to recognize the address of neighboring nodes and routers. It also specifies how to determine the next netowrk point to which a packet should be forwarded toward its destination. The Internet Protocol (IP) operates at this layer, as does the Internet Control Message Protocol (ICMP)

Back

port 25

Front

SMTP

Back

eth0, eth1, eth2

Front

The first Ethernet adapter in your system and so on.

Back

/etc/sysconfig/network/routes

Front

default ateway router address is stored here

Back

CLASS A

Front

10.0.0.0 - 10.255.255.255

Back

Dynamic address assignment

Front

a netowork host contacts a DHCP server when it boots. the DHCP server dynamically assigns an IP address to the host for a psecified period of time called a lease. It allows IP configuration for a large # of network hosts very easy. Just power the system on and it gets its IP address information. t also conservs IP address usage. Addresses used by systems that are powered off can be reassigned to other network hosts.

Back

partial subnetting

Front

you could define a subnet mask of 255.255.252.0 for a class B address.

Back

configuring DNS

Front

/etc/resolv.conf defines search prefix and nameserveers to use the search column specifies the domain name that should be used to fill out incomplete hostnames for example if yu were try to resolve a hostname of WS1 name would convert to FQDN of ws1.mydom.com namesearch field specifies IP address of DNS servers you want to use for name resolution you can configure up to 3 DNS servers if first server fails or is otherwise unreachable next DNS server is used syntax is nameserver DNS_server_IP_address

Back

OSI Layers

Front

Physical, Data Link, Network, Transport, Session, Presentation, Application

Back

unicast

Front

the route specifies a real path to the destination route

Back

Session

Front

responsible for establishing connections between source and destination network hosts. these connections are called sessions.

Back

lo interface

Front

local loopback virtual network interface -- required for many linux services DONT TINKER

Back

Port 443

Front

HTTPS

Back

port 23

Front

Telnet

Back

If the host resides on a ublic network, such as the Internet,

Front

it must use a GLOBALLY unique IP address

Back

Port 20 and 21

Front

FTP

Back

ifconfig parameters

Front

HW addr, inet addr, Bcast, Mask, RX packets, TX packets, Collisions, RX bytes, TX bytes

Back

: traceroute

Front

utility traces route a packet must traverse through routers to arrivae at its destination: syntax traceroute destination

Back

: ping

Front

ping utility checks if network interface is working correctly thhe destination system is up and working correctly network hardware between your system and the destination system is wokring correctly -- uses ICMP echo request packet

Back

Port 119

Front

NNTP (news)

Back

: route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.1.254

Front

add a route to the network through router with ip address of 192.168.1.254

Back

Port 137, 138, 139

Front

NetBIOS

Back

Presentation

Front

responsible for ensuring that infomration passinh through the OSI layers is formatted correctly for the application on the destination system

Back

eth0

Front

eth0 is the Ethernet network interface installed in the system

Back

Ports

Front

Ports are provided by bothtthe TCP and UDP protocols at the Transport layer. In essecnce, a port is a logical connection provided by TCP and UDP for upper-layer protocols. Ports allow a single host wiht a single IP address assigned to provide multiple network services. Each service uses hte same IP address but operates using a different TCP or UDP port number.

Back

CLASS B

Front

172.16.0.0. - 172.31.255.255

Back

Dynamic Ports & Private Ports

Front

49152 - 65535 - designed as dynamic ports and are available for use by any network service. Frequently used by network services that need to establish a temporary connection. For example, aservice ma ynegotiate a dynamic port with the client. It wielll then use tha tport just during the current session when session is completed, port is closed and no longer used,

Back

ifconfig syntax

Front

ifconfig interface ip_address netmask subnet_mask broadcast broadcast_address -- e.g. assign eth0 interface to 192.168.1.1 subnet mask of 255.255.255.0 and a broadcast address of 192.168.1.255 "ifconfig eth0 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255"

Back

: ifdown interface, ifup interface

Front

restart your network interface to apply changes -- interface is alias of interface such as eth0

Back

port 80

Front

HTTP

Back

: netstat

Front

list network connections, display routing table, display info about network interface -a lists all listening and nonlistening sockets -i displays statistics for your network interfaces

Back

Transport Layer

Front

On the sending host the Transprt ayer receives information from the upper alyers of the OSI model and divides it into small transmittable chunks called packets. on receiving host the transport layer reassembles packets form datagrams received from lower layers of OSI model. the transport layer provides error-checking mechans to ensure that dat arrives at destination host intact. TCP and UDP operate at this layer

Back

subnet mask

Front

network vs node address -- subnets determine how much of an address is used for the network and how much for the node. 255.0.0.0 - class A - network vs node

Back

Application

Front

Respomnsible for providing applications with a way to access the network.

Back

: route

Front

add routes to the table by entering route add-net network_address netmask netmask gw router_address

Back

: ifconfig

Front

displays the current status fo all network interfaces in the system

Back

Registered Ports

Front

1024 - 49151 - ICANN has reserved ports for speccial implementations . Organizations can program their own network service and then apply for a registered port number to be assigned to it.

Back

49152 - 65535

Front

Dynamic and Private

Back

0-1023

Front

Well Known Ports

Back

Section 16

(50 cards)

configuring openssh

Front

~/ssh/ssh_config, /etc/ssh/ssh_config allowusers restricts login to the ssh server to only users listed, denyusers prevents users listed from loggin in through ssh server, hostkey specifies which private host key file should be used by ssh. listenaddress if the host where sshd is running has multiple ip addresses assigned oyu can restrict sshfd to only listening on specifc addresses using this param. permitrootlogin specifies whether you can authenticate through ssh server as root, port, specifies port on which sshd will listen for ssh requests , protocol specifies which version of ssh to use , stricthostkeychecking -- ssh server sensds ssh client its public key when yu initiate an ssh connection. by default, the first time you connect to a given ssh server you are prompted on the client end to accept the server's public key. user

Back

: wc

Front

the wc command prints nuber of newlines words and bytes in a file wc -options file

Back

3DES

Front

triple data encryption standard -- symmetric encryption used to encrypt data in three stages in either a 112 bit or 168 bit key

Back

&& || AND OR

Front

slightly different from C programming the && is used the second command is executed only if first command runs and exited correctly. for cmd1 || cmd2 the second command is excecuted only if the first command runs and exits abnormally with a nonzero exit status.

Back

$PATH

Front

Use $PATH to put shell scripts into and run directly from bash

Back

flags that test for files

Front

-e check if exists, -d check to see if dir exists -f check to see if file exists and is a regular file -G check to see if specified file exists and is owned by aspecified group -h or -L checks to see if specified file exists and if it is a symbolic link. -O checks to see if specified file exist & if it is owned by a specified user Id -r checks to see if specified file exists and if read permission is granted -w checks to see if specified file exists and if write permission is granted -x checks to see if specified file exists and if execute permission is granted

Back

script can read from input of bash

Front

using : read

Back

Exit status 0

Front

always means the command exited successfully without any errors. an exit status of nany numbe rother than 0 indicates an error of some type that occurred and that the command exited abnormally.

Back

: sort

Front

sort cmmand sorts lines of text file alphabetically or some other order

Back

:cut

Front

used to print columns or fields that you specify from a file to the stdout by default tab is used as delimiteer -b select bytes -c select chars -d delim -flist -s

Back

Exit status 0

Front

always means the command exited successfully without any errors. an exit status of nany numbe rother than 0 indicates an error of some type that occurred and that the command exited abnormally.

Back

: ? shell variable

Front

? shell variable to get the exxit status f the previously exited commmand. e.g. in a script use echo "Exit status is" $? ."

Back

until loop

Front

until condition do script commands done

Back

private key

Front

/etc/ssh/ssh_host_key

Back

#!/bin/bash

Front

the first line of any shell script must specify which shell the script is writtent o run under. In this case, the /bin/bash shell is specified. When a script is urn, a subhell will becreated using the shell specified here and the script contents will be processed within it.

Back

: ? shell variable

Front

? shell variable to get the exxit status f the previously exited commmand. e.g. in a script use echo "Exit status is" $? ."

Back

: declare -i

Front

declare a variable to be a certain type - typecasting --i in this case is for an integer.

Back

REGEXP reviews

Front

* . ^ $ | [nnn] [^nnn] [n-n]

Back

Max lenghth of a bash script

Front

128 KB use

Back

while loop

Front

while condition do script commands done

Back

:xargs

Front

use xargs to break down a long command line into 128 KB chunks and pass each chunk as an argument to the command listed within the xargs command line.

Back

slogin

Front

utility that accesses the shell prompt remotely

Back

:cut

Front

used to print columns or fields that you specify from a file to the stdout by default tab is used as delimiteer -b select bytes -c select chars -d delim -flist -s

Back

: declare -i

Front

declare a variable to be a certain type - typecasting --i in this case is for an integer.

Back

example of test flag

Front

"[-e "$MYNEWPATH"]; if test -f /home/rtracy/myfile; then echo.

Back

:xargs

Front

use xargs to break down a long command line into 128 KB chunks and pass each chunk as an argument to the command listed within the xargs command line.

Back

AES

Front

improved version of 3DES

Back

Blowfish

Front

variable key lengths up to 448 bits

Back

while loop

Front

while condition do script commands done

Back

script can read from input of bash

Front

using : read

Back

$PATH

Front

Use $PATH to put shell scripts into and run directly from bash

Back

&& || AND OR

Front

slightly different from C programming the && is used the second command is executed only if first command runs and exited correctly. for cmd1 || cmd2 the second command is excecuted only if the first command runs and exits abnormally with a nonzero exit status.

Back

REGEXP reviews

Front

* . ^ $ | [nnn] [^nnn] [n-n]

Back

scp

Front

a utility that securely copies files between systems

Back

sshd

Front

ssh daemon that allows remote access to shell prompt

Back

public key

Front

/etc/ssh/ssh_host_key.pub

Back

*~ files

Front

usually temporary files end with the tilde

Back

if/then structures

Front

"if condition then commands else commands fi"

Back

*~ files

Front

usually temporary files end with the tilde

Back

until loop

Front

until condition do script commands done

Back

flags that test for files

Front

-e check if exists, -d check to see if dir exists -f check to see if file exists and is a regular file -G check to see if specified file exists and is owned by aspecified group -h or -L checks to see if specified file exists and if it is a symbolic link. -O checks to see if specified file exist & if it is owned by a specified user Id -r checks to see if specified file exists and if read permission is granted -w checks to see if specified file exists and if write permission is granted -x checks to see if specified file exists and if execute permission is granted

Back

sftp

Front

a utility that securely ransfers files between systems

Back

: sort

Front

sort cmmand sorts lines of text file alphabetically or some other order

Back

Two ways of running shellscripts

Front

call shell then script to execute -- bash ./runme, the second option is to give execute permissions to the file nd then run it with the path to the script

Back

example of test flag

Front

"[-e "$MYNEWPATH"]; if test -f /home/rtracy/myfile; then echo.

Back

#!/bin/bash

Front

the first line of any shell script must specify which shell the script is writtent o run under. In this case, the /bin/bash shell is specified. When a script is urn, a subhell will becreated using the shell specified here and the script contents will be processed within it.

Back

Max lenghth of a bash script

Front

128 KB use

Back

ssh

Front

ssh client used to connect to the sshd daemon on another system

Back

if/then structures

Front

"if condition then commands else commands fi"

Back

Two ways of running shellscripts

Front

call shell then script to execute -- bash ./runme, the second option is to give execute permissions to the file nd then run it with the path to the script

Back

Section 17

(50 cards)

: bg

Front

moves a foreground process to background -- "bg job_ID"

Back

: kill

Front

kill command terminates a process use kill -signal PID.

Back

Verify your backups

Front

If theres too much system load while backing up you may end up with errors in your backups. It's important to verify your backups.

Back

SIGHUP (1)

Front

Kill signal 1 -- restarts process after restart process will have same PID. very useful for restarts and changes in config files

Back

Backup Types

Front

Full, Incremental, Differntial

Back

Incremental Backup

Front

Only the files that have been modified since the last backup (full or incremental) are backed up. Ecah file is flagged as having been backed up.

Back

Linux Process loading

Front

all linux processes are directly or indirectly loaded by INIT process

Back

: exit

Front

used to exit a running process

Back

Subshells

Front

Always occur -- a subshell is created -- it is a separate process in and of itself and has its own PID assigned. the PPID of the subshel is the PID of the shell where command was entered. This process is called forking

Back

SIGKILL (9)

Front

Brute-force signal that kills process if process ws hung badly, will force sotp and may not clean after itself if this is used. better to use SIGTERM (15)

Back

Init Scripts

Front

for system processes you use an init script which is used by the init process to start processes on system boot.

Back

rc.d and init.d

Front

stop and run these scripts within rc.d or init.d

Back

MTBF

Front

Mean Time Between Fialure, how long a drive will last before it fails. ALL hard drives will fail it's a matter of when.

Back

Multicore CPU

Front

replaced hyperthreading CPUs

Back

User processes

Front

associated with soem kind of end-user program running on system -- created from GUI or command line

Back

Hyperthreading CPUs

Front

once popular have been replaced by multicore CPUs. -- one single processor can run more than one process

Back

Differential Backup

Front

Only the files that have been modified since the last full backup are backed up. Even though they have been backed up during a differentialb ackup, the files invovled are not flagged as having been backed up

Back

: dd

Front

copy with dd determine input and outut file -- it copies data using records with default size of record being 512. because of this it can copy an entire parititon to a single file.

Back

TTY

Front

the name of terminal session that the process is running within (shell)

Back

Init process PID

Front

0

Back

: nice

Front

nice utility used to launch processes with different priority levels changes the NI value which is value of process factored into kernel calculations that determines the priority (R) " nice -n nice_level command" must be root for nice to be set to below 0

Back

Burrows-Wheeler Compression Algorithm

Front

what bzip2 uses

Back

Mixing up Backups

Front

good idea because certain backups take too long to run. whereas if you mix you can get the best bang for your buck. -- Thinka botu when to run certain backups. Maybe running a fullbackup once a week when system load is light on Friday night and then incremental backups on the toher six days.

Back

: renice

Front

renice is used to restart a process with higher or lower nice values -- uses renice nice_value PID

Back

: ps -ef

Front

display extended information of all (-e) processes running.

Back

: killall (more convenient at times)

Front

killall uses command name of process to kill isntead of PID .. use killall -15 vi to kill vi.

Back

PID vs PPID

Front

Proces ID Number -- Parent Process ID Number

Back

etc/rc.d

Front

for system V init scripts

Back

: free

Front

free command displays the amount of free and allocated RAM and swap memotry in your system use the -m option to display memory statistics in megabytes -t option to fdisplay totals for each category of information

Back

: top

Front

top provides variety of tools for viewing runnin gprocesses on yourr system. pressing H gets help screen F displays other columns you can add

Back

Full Backups

Front

All sepcified files are backed up, regardless of whether or not they've been modified since the last backup. After being baceked up each file is flagged as having been backed up.

Back

BSD init scripts

Front

Other linux distros use BSD init scripts -- these reside in the /etc/init.d directory

Back

Concurrent Running

Front

Linux switches between various processes on CPU making it appear as if its working on concurrent processes

Back

: tar

Front

tar options -A (appends tar files to existing archive) -d --compare compare differences between an archive file and filees in system -z uses the gzip utility to compress. -j uses bzip2 instead

Back

/etc/init.d

Front

for init scripts on BSD style systems

Back

: cpio

Front

provide cpio wih LIST of files and directories from standard input. ls | cpio -ov > /media/usb/backup.cpio

Back

System V init scripts

Front

Linux distros that use System V init scripts store them in the /etc/rc.d directory within this /etc/rc.d are a series of subd's named rc0.d thru rc6.d -- each of these directories is associated with a particular runlevel.

Back

: ps -e

Front

to see all processes running on system

Back

: wc

Front

the wc command prints nuber of newlines words and bytes in a file wc -options file

Back

System processes & Daemons

Front

User Processes are tied to a particular shell instance , ystem processes ar enot.

Back

Get rid of daemons on server

Front

get rid of unnecssary daemons that consume memory and may open security holes

Back

Lempel-Ziv Copmression Algorithm

Front

what gzip utility uses

Back

: fg

Front

moves a background process to foreground "fg job_ID"

Back

Linux Backup Utilities

Front

tar, cpio, dd

Back

SIGTERM (15)

Front

this signal tellsprocess to terminate immediately -- allows the process to clean up after itself before exiting -- default signal sent by kill if you omit a signal in the cmd line

Back

Nice value range

Front

-20 to +19

Back

SIGINT (2)

Front

kill signal 2 -- sends CTRL+C to process

Back

INIT Process

Front

parent process or grand-parent of all other linux processes.

Back

: ps

Front

view the processes associated with the CURREN shell.

Back

: jobs

Front

view current jobs running -- which ones are background and which ones arent? the first value [1] is the background job ID the second value is the PID of the process --

Back

Section 18

(50 cards)

SUID

Front

When an executable file with the SUID set is run, the user who ran the file temporarily becomes the file's owner

Back

/Pictures

Front

contains image files

Back

/Documents

Front

contains documents

Back

/Videos

Front

contains video files

Back

etc/group

Front

this file contains your system's groups

Back

: chmod

Front

change permsisions chmod entity=[ermissions filename or use numbers in octal

Back

/var/log/

Front

place to store system log files

Back

/etc/login.defs

Front

contains values that cna be used for the GID AND UID params when creating an cct with useradd, also contains defaults for creating pass2words in /etc/shadow.

Back

Local vs LDAP

Front

local stores at /etc/passwd. LDAP(Lightweight Directory Access Protocol) Unlike local authentication which stores accounts in a simple flat file, the directory service is hierarchical in natre; allowing you to sort and organize your user accounts by location, function, or department. The directroy database can also be replicated among several different Linux systems providing fault tolerance. The key benefit of this option is that it allows yout o maintain a single set of user accounts that can be used to authenticate to many different Linux systems in your network.

Back

messages

Front

contains messages from most running porcesses -- probably the most useful of all log files - used to torubleshoot services that wont start services taht dont appear tow ork properly

Back

lastlog

Front

contains last login info for users

Back

: usermod

Front

modify an existing user account .

Back

boot.log

Front

contains log entries from daemons as they were started during bootup

Back

: pwck

Front

verify /etc/passwd/ and /etc/shadow/ -- verifies that the two passwors are the same, sometimes they dont stay in sync.

Back

warn

Front

contains warning messages

Back

: tail -f

Front

show tail messages as you use the system

Back

default umask

Front

022

Back

faillog

Front

contains failed authentication attempts

Back

UID between 0 - 999

Front

system accounts

Back

/bin

Front

contains executable files and scripts that user may need to run. directory is auto added to $PATH

Back

NIS

Front

Network Information Service -- designed to provide centralized user account management when you have multiple systms that all need the same user accounts

Back

SGID

Front

When a user runs an executable file with SGID set, the user temproraily becomes a member of the file's owning group. When a user creates a file in a directory that has SGID set, the file's owner is set to the user's account (as per normal). HOwever the owning group assigned to the new file is set to the owning group of the parent directory.

Back

/Downloads

Front

contains files downloaded from the Internet by ksanders' web browser

Back

Windows Domain

Front

Active Directory or like Linux's Samba, configure your linux systemt o use user accounts in the domain to authenticate to the local system.

Back

: chown

Front

used to change user or group that owns a fiel or directory chown user.group file or directory -R change ownership recursively

Back

wtmp

Front

contains a list of users who have authenticated to the system

Back

: chgrp

Front

change group that owns a file or directory

Back

/etc/skel

Front

useradd copies files from skel directory into a newly created home directory. -- contains seceral config files such as .bashrc and.profile

Back

: useradd

Front

adds user. /etc/default/useradd contains defaults used by the useradd utility, including basic group, umask, etc.

Back

/public_html

Front

contains personal web pages

Back

boot.msg

Front

contains all of the messages dispalyed on screen during system bootup -- useful for trobuleshoooting startup problems

Back

/etc/shadow

Front

this file contains password for your user accounts

Back

GID

Front

groupid

Back

Sticky Bit

Front

When the Sticky Bit is assigned to a directory users can only delete files within the directory for which they are the owner of the file or the directory itself. This negates the effect of having the wirte permission to a directory, which could allow a user to delete files in a directory that he or she doesn't own.

Back

: userdel

Front

delete a user, simply enter userdel username. -r removes home directory.

Back

: finger

Front

view information about the user

Back

UID

Front

userid

Back

special permissions

Front

SUID : 4 SGID : 2 Sticky Bit : 1

Back

SYSLOGD

Front

HANDLES LOGGING ON A LINUX SYSTEM

Back

mail

Front

contains messagesgnereated by the postfix or sendmail daemons

Back

/Desktop

Front

contains files and icons displayed on desktop

Back

firewall

Front

contains firewall log entries

Back

root userid

Front

0

Back

/etc/passwd

Front

user account info for your system

Back

: umask

Front

find what ur umask is

Back

additive property of permissions

Front

one suer accountcan receiver permissions from more than one entity

Back

xinetd.log

Front

contains log entries form the xinetd daemon

Back

: passwd

Front

change iexisting user's passwords.

Back

/Music

Front

contains music files

Back

/dev/log/

Front

most linux services are configured to write log entries to /dev/log by default -- this device file is maintained by the syslogd daemon the syslogd daemon writes entries into the /etc/syslog.conf file

Back

Section 19

(50 cards)

: join

Front

join prints line from each of two speciied input fields based on delimiters

Back

/var/log/messages

Front

detect intrustion attempts -- contains messages from all srvices running on the system --

Back

: head

Front

used to display first couple of lines of a text file on screen

Back

: sudo

Front

sudo if in sudoers gets root permission to run a commmand requires user's password not root's

Back

Send both outputs to same file

Front

command 1> filenae 2> &1

Back

: less

Front

The less filename command can also be used to dispaly text file, but automaticlaly pauses a long text file one page at a time.

Back

: groupadd

Front

adds groups to linux system . - groupadd options groupname -- groupadd dbusers . -g -p -r

Back

: tail -f

Front

use it to monitor file specified continuously. -- helpful when trouble shooting

Back

: pr

Front

used to format text files for printing -- determine margins, etc

Back

: split

Front

splits an input file into a series of files w/o altering the original input file.

Back

regexp quick overview

Front

* ? . ^ $ | [nnnn] [^nnnn] [n-n] | matches characters on either side of the pipe [nnn] any one of the characters [^nnn] not containing any of the characters [n-n] containing anything within that range

Back

: >>

Front

doesnt overwrite, appends

Back

: | pipes

Front

take output and put it into next command

Back

: sort

Front

-f change lowercase characters to uppercase characters -M sort by month, -n sort numerically, -r reverse the sort order

Back

: fgrep

Front

searches files for lines tha tmatch a fixed string.

Back

: uniq

Front

uniq command reports or omits repeated lines -d Only print duplicate lines -u only print unique lines

Back

: cat

Front

The cat filename command will display contents of the specified text file onscreen.

Back

: >

Front

redirection of stdout

Back

Send different ouputs to different files

Front

command 1> stdout_filename 2> stderr_filename.

Back

: groupdel

Front

delete an existing project from the system

Back

: tr

Front

used to translate or delete characters -- send text stream to stin of tr.

Back

stdout

Front

1 -- output generated from a command

Back

: grep -i

Front

ignore case grep

Back

: fmt

Front

fmt reformat a text file -- use -w to specify characters per row, etc.

Back

stdin

Front

0 -- input provided to a particular command to a process

Back

you can take input in

Front

command < input_text_or_file

Back

: cat myfiles.odt 2> errorfile

Front

if myfiles doesnt exist puts error code intoo errorfile.

Back

: grep

Front

grep search_exxp file_name

Back

: grep -l

Front

displays on names of files that ocntain matching text

Back

: tail

Front

display las tcouple of lines the -f flag is very powerful

Back

: tail /var/logmessages 1> lastmessages

Front

tells shell to redirect stdout (1) to file named lastmessages

Back

: cut

Front

cut columsns or fields that you specify form a file -c(list) - select only these characters -d(delim) - use specified character isntead of tab for delimiter -f(list) -- select only specified fields -s do not print lines that do not contain these delimiters

Back

: who

Front

who is logged on?

Back

: w

Front

what proccesses are the people who are logged in running?

Back

command substitution

Front

alternative to piping tail$(fgrep -l 192.168 /etc/*) -- command returns a list of filenmames only not the actual matching text. list of files is then piped to input of tial command

Back

stderr

Front

2 -- error code or any serror message generated

Back

: su

Front

su substitute user, needs root's password -c command switches to user account and runs specified command -m switches to user acct but preserves existing environment variables

Back

/var/log/lastlog

Front

file contains a list of all users in the system and when they last logged in

Back

: tee

Front

tee command is to display output forom a command and also use redirection or piping

Back

: grep -r

Front

searches recurisvely through subdirectories of the path specified

Back

/var/log/faillog

Front

log files contains a list of failed authentication attemp --- effective at detecting dictionary attacks which run through a list of words. view it using the fiallog utility -- faillog - u rtracy

Back

: grep -v

Front

displays all lines that DO NOT contain the search string.

Back

: nl

Front

output is written with a line number added to beginning of each line in the file

Back

: grep -n

Front

displays matching line numbers

Back

/bin

Front

This directory contains executable files necessary to manage and run the Linux system, including shells (such as bash) and file system management utilities such as cp and rm.

Back

/boot

Front

This directory contains your bootloader files, which are required to boot your system.

Back

: groupmod

Front

modify a group's properties, GID number, c=group passwd, add a user account to the group, -R removes a user account from the group

Back

: paste

Front

similar to join, paste to files together based on criteria

Back

: egrep

Front

grep seearch files for extended regexps.

Back

: wc

Front

prints the number of newlines, words, and bytes, depending on flags -c byte -m character -l newline -L length of longest line -w print word counts

Back

Section 20

(50 cards)

/opt

Front

this directory cotains files for some prorgams you install on the system

Back

/etc/exports

Front

configures file systems oto be exported to remote NFS clients

Back

/etc/X11

Front

Contains X Window config files

Back

/etc/services

Front

maps port numbers to named services on the system

Back

/media

Front

this directory is usedby some linux distros such as OpenSUSE and fedora to mount external devices, including optiacal drives, USB drives, etc . This is done using a series of subd

Back

ext2

Front

reputed to be fastests but one off the oldest as well. has one key weakness and that is it takes long time to recover if system shuts down abruptly. -- there isn't a clean dismount procedure. -- wil run e2fsck ot fix any problems but that indexing required for e2fsck takes too long

Back

/tmp

Front

This directory contains temporary files created by you or the system.

Back

/etc/grub.conf

Front

contains config parameters to the GRUB bootloader

Back

/sbin

Front

this directory contains important system managemant andadministration files such as fdisk, fsck, ifconfig, init, mkfs, shutdown, and halt.

Back

ext4

Front

can support up to 16TB. very big, -- uses checksums in addition to journaling.

Back

ext3

Front

uses journalling to fix the abrupt shutdown error of ext2-- backgrounds compatible

Back

/home

Front

This directory contains subdirectories that serve as home directories for each user acccount on your linux system

Back

ls variations

Front

-a, -l, -R

Back

/sys

Front

This directory contains information about the ahrdware in your system.

Back

/etc/shadow

Front

contains encrypted passwords for your caccounts

Back

Block-oriented de ice files.

Front

These files are used fordevices that manage data in blocks; such as floppy disks and hard drives. Block devices usually support random access ot the data stored on them

Back

/dev

Front

This directory contains special files that are used to represent the various hardware devices installed in the system. For example, the first hard disk drive in your system is called sda, the second is called sdb, and so on. The partiitions on each drive are identitfied by an additional number added to the end of the disk filename.

Back

/etc/passwd

Front

contains your system user accounts

Back

/proc

Front

this directory is a little diff from the other d's in this list, /proc doesnt actually exist in the file system. It's a pseuudo-file system taht's dynamically created whenever access. -- The "top" program uses this folder.

Back

/etc/init.d

Front

a subdirectory that contains startup scripts for services intalled on the system. Ona Fedora or a RH stsytem, these are located in /etc/rc.d/init.d

Back

/etc/nsswitch

Front

configures which services are to be used to resolve hostname and to store users groups, and passwords

Back

/lib

Front

this directory ocntains code libraries used by programs in /bin and /sbin. Your kernel modules are also stored in the modules subdirectory of /lib

Back

/dev/fd0

Front

Floppy drive

Back

subdirectories of /usr

Front

bin, lib, lib64, local, sbin, share

Back

/etc/modules.conf

Front

contains config parameters for your kernel modules (drivers)

Back

Reiser

Front

alternative to ext3, utilizes journaling as well -- but uses a dramatically different internal structure.

Back

/srv

Front

directory contains subd's where services running on system such as httpd, and ftpd save files

Back

/dev/ttyS0

Front

serial port

Back

/dev/scd0

Front

optical drive

Back

/usr

Front

this directory contains application files In fact most of the application files used on your sysrem are stored in a subd of /usr

Back

/mnt

Front

This directory is used to mount external devices including CD drives, USB, etc as the/media directory -- this uses subdirectories for this.

Back

/etc/aliases

Front

contains table used to redirect mail to local recipients

Back

/var

Front

This directory contains variable data including your system log files.

Back

Sockets

Front

sockets are similar to FIFOs in that they are used to transfer information between processes. UNlike FiFos, however, sockets can move data bidirectionally

Back

Character-oriented device files

Front

These files are used for devices that receive data sequentially one character at a time; such as a printer, mouse, or tape-drive. Thse deviceses usually dont support random access to the data stored on them.

Back

/dev/lp0

Front

parallel port

Back

Finding files in Linux FS

Front

find, locate, which whereis, type

Back

/etc/ftpusers

Front

controls user access to the ftp service running on system

Back

Linux Filesystems

Front

ext2, ext3, Reiser, ext4

Back

/etc/group

Front

contains local group definitions

Back

/etc/hosts

Front

contains a list of hostname-to-IP address mappings the system can use to resolve hostnames

Back

/etc/fstab

Front

lists partitions and file systems that are mounted when system boots

Back

/etc/inittab

Front

contains configuration paramters for the init process

Back

: | more

Front

view pages one at a time -- pausing display.

Back

/root

Front

This directory is root user's home directory. separated form other directories.

Back

FIFO

Front

stands for first in first out. move data from one software process on the system to another.

Back

/etc

Front

this directory contains text-based config files used by stem as well as services running on system.

Back

Linux files

Front

Refgular files, Links, FIFOs, Sockets

Back

/etc/resolv.conf

Front

specifies the DNS server and domain suffix used by the system

Back

: md

Front

md alias to mkdir

Back

Section 21

(6 cards)

: whereis

Front

whereis locates source code, binary files, and man pages for specified files -b for binary path -m for man pages

Back

: find

Front

find (path) - name "filename" also supports regexps and -user flag and -size or +size flag for more or less

Back

: locate

Front

find is slow and lcoate is a alternative. its more efficient

Back

Types of Link Files

Front

Hard and Symbolic links -- symbolic points to another file in file system. but a symoblic link has its own inode Hard link file points directly to the inode of another file. no pointer and pointee

Back

: which

Front

used to display full path to a shell command or utility

Back

: type

Front

will return type of a command as one of following shellbuiltin hashed (external command) aias of another cmd a function -a flag causes type to return all isntances of the specified command in the file system.

Back