- QuantileBigDecimal - Class in com.github.jessemull.microflex.bigdecimalflex.stat
-
This class calculates quantiles for big decimal plate stacks, plates,
wells and well sets using the following steps:
- Calculate R as Q x (N + 1) where N is the number of values and Q is the desired quantile
- Define IR as the integer portion of R
- Define FR as the fractional portion of R
- Find the scores with Rank IR and with Rank IR + 1
- Interpolate using the formula (Score IR+1 - Score IR) * FR + Score IR and return the result
Statistical operations can be performed on stacks, plates, sets and wells using
standard or aggregated functions.
- QuantileBigDecimal() - Constructor for class com.github.jessemull.microflex.bigdecimalflex.stat.QuantileBigDecimal
-
- QuantileBigInteger - Class in com.github.jessemull.microflex.bigintegerflex.stat
-
This class calculates quantiles for big integer plate stacks, plates,
wells and well sets using the following steps:
- Calculate R as Q x (N + 1) where N is the number of values and Q is the desired quantile
- Define IR as the integer portion of R
- Define FR as the fractional portion of R
- Find the scores with Rank IR and with Rank IR + 1
- Interpolate using the formula (Score IR+1 - Score IR) * FR + Score IR and return the result
Statistical operations can be performed on stacks, plates, sets and wells using
standard or aggregated functions.
- QuantileBigInteger() - Constructor for class com.github.jessemull.microflex.bigintegerflex.stat.QuantileBigInteger
-
- QuantileDouble - Class in com.github.jessemull.microflex.doubleflex.stat
-
This class calculates quantiles for double plate stacks, plates,
wells and well sets using the following steps:
- Calculate R as Q x (N + 1) where N is the number of values and Q is the desired quantile
- Define IR as the integer portion of R
- Define FR as the fractional portion of R
- Find the scores with Rank IR and with Rank IR + 1
- Interpolate using the formula (Score IR+1 - Score IR) * FR + Score IR and return the result
Statistical operations can be performed on stacks, plates, sets and wells using
standard or aggregated functions.
- QuantileDouble() - Constructor for class com.github.jessemull.microflex.doubleflex.stat.QuantileDouble
-
- QuantileInteger - Class in com.github.jessemull.microflex.integerflex.stat
-
This class calculates quantiles for integer plate stacks, plates,
wells and well sets using the following steps:
- Calculate R as Q x (N + 1) where N is the number of values and Q is the desired quantile
- Define IR as the integer portion of R
- Define FR as the fractional portion of R
- Find the scores with Rank IR and with Rank IR + 1
- Interpolate using the formula (Score IR+1 - Score IR) * FR + Score IR and return the result
Statistical operations can be performed on stacks, plates, sets and wells using
standard or aggregated functions.
- QuantileInteger() - Constructor for class com.github.jessemull.microflex.integerflex.stat.QuantileInteger
-
- QuantileStatisticBigDecimalContext - Class in com.github.jessemull.microflex.bigdecimalflex.stat
-
This class performs statistical operations for BigDecimal plate stacks, plates,
wells and well sets with calculate methods that accept a list and an integer
as arguments.
- QuantileStatisticBigDecimalContext() - Constructor for class com.github.jessemull.microflex.bigdecimalflex.stat.QuantileStatisticBigDecimalContext
-
- QuantileStatisticBigDecimalsContext - Class in com.github.jessemull.microflex.bigdecimalflex.stat
-
This class performs statistical operations for BigDecimal plate stacks, plates,
wells and well sets with calculate methods that accept a list and a double
as arguments.
- QuantileStatisticBigDecimalsContext() - Constructor for class com.github.jessemull.microflex.bigdecimalflex.stat.QuantileStatisticBigDecimalsContext
-
- QuantileStatisticBigIntegerContext - Class in com.github.jessemull.microflex.bigintegerflex.stat
-
This class performs statistical operations for BigInteger plate stacks, plates,
wells and well sets with calculate methods that accept a list and an integer
as arguments.
- QuantileStatisticBigIntegerContext() - Constructor for class com.github.jessemull.microflex.bigintegerflex.stat.QuantileStatisticBigIntegerContext
-
- QuantileStatisticBigIntegersContext - Class in com.github.jessemull.microflex.bigintegerflex.stat
-
This class performs statistical operations for BigInteger plate stacks, plates,
wells and well sets with calculate methods that accept a list and a double
as arguments.
- QuantileStatisticBigIntegersContext() - Constructor for class com.github.jessemull.microflex.bigintegerflex.stat.QuantileStatisticBigIntegersContext
-
- QuantileStatisticDouble - Class in com.github.jessemull.microflex.doubleflex.stat
-
This class calculates descriptive statistics with list and integer inputs to
the calculate functions.
- QuantileStatisticDouble() - Constructor for class com.github.jessemull.microflex.doubleflex.stat.QuantileStatisticDouble
-
- QuantileStatisticDoubles - Class in com.github.jessemull.microflex.doubleflex.stat
-
This class calculates descriptive statistics with list and double inputs to
the calculate functions.
- QuantileStatisticDoubles() - Constructor for class com.github.jessemull.microflex.doubleflex.stat.QuantileStatisticDoubles
-
- QuantileStatisticInteger - Class in com.github.jessemull.microflex.integerflex.stat
-
This class calculates descriptive statistics with list and integer inputs to
the calculate functions.
- QuantileStatisticInteger() - Constructor for class com.github.jessemull.microflex.integerflex.stat.QuantileStatisticInteger
-
- QuantileStatisticIntegers - Class in com.github.jessemull.microflex.integerflex.stat
-
This class calculates descriptive statistics with list and double inputs to
the calculate functions.
- QuantileStatisticIntegers() - Constructor for class com.github.jessemull.microflex.integerflex.stat.QuantileStatisticIntegers
-
- QuantileStatisticListBigDecimalContext - Class in com.github.jessemull.microflex.bigdecimalflex.stat
-
This class performs statistical operations for BigDecimal plate stacks, plates,
wells and well sets with calculate methods that accept a list and an integer
as arguments and return a list of lists.
- QuantileStatisticListBigDecimalContext() - Constructor for class com.github.jessemull.microflex.bigdecimalflex.stat.QuantileStatisticListBigDecimalContext
-
- QuantileStatisticListBigIntegerContext - Class in com.github.jessemull.microflex.bigintegerflex.stat
-
This class performs statistical operations for BigInteger plate stacks, plates,
wells and well sets with calculate methods that accept a list and an integer
as arguments and return a list of lists.
- QuantileStatisticListBigIntegerContext() - Constructor for class com.github.jessemull.microflex.bigintegerflex.stat.QuantileStatisticListBigIntegerContext
-
- QuantileStatisticListDouble - Class in com.github.jessemull.microflex.doubleflex.stat
-
This class calculates descriptive statistics with calculate functions that take
list and integer inputs and return a list of lists.
- QuantileStatisticListDouble() - Constructor for class com.github.jessemull.microflex.doubleflex.stat.QuantileStatisticListDouble
-
- QuantileStatisticListInteger - Class in com.github.jessemull.microflex.integerflex.stat
-
This class calculates descriptive statistics with calculate functions that take
list and integer inputs and return a list of lists.
- QuantileStatisticListInteger() - Constructor for class com.github.jessemull.microflex.integerflex.stat.QuantileStatisticListInteger
-
- QuantileStatisticListsBigDecimalContext - Class in com.github.jessemull.microflex.bigdecimalflex.stat
-
This class performs statistical operations for BigDecimal plate stacks, plates,
wells and well sets with calculate methods that accept two lists as arguments
and return a list of lists.
- QuantileStatisticListsBigDecimalContext() - Constructor for class com.github.jessemull.microflex.bigdecimalflex.stat.QuantileStatisticListsBigDecimalContext
-
- QuantileStatisticListsBigIntegerContext - Class in com.github.jessemull.microflex.bigintegerflex.stat
-
This class performs statistical operations for BigInteger plate stacks, plates,
wells and well sets with calculate methods that accept two lists as arguments
and return a list of lists.
- QuantileStatisticListsBigIntegerContext() - Constructor for class com.github.jessemull.microflex.bigintegerflex.stat.QuantileStatisticListsBigIntegerContext
-
- QuantileStatisticListsDouble - Class in com.github.jessemull.microflex.doubleflex.stat
-
This class calculates descriptive statistics with calculate functions that take
two lists as input and return a list of lists.
- QuantileStatisticListsDouble() - Constructor for class com.github.jessemull.microflex.doubleflex.stat.QuantileStatisticListsDouble
-
- QuantileStatisticListsIntegers - Class in com.github.jessemull.microflex.integerflex.stat
-
This class calculates descriptive statistics with calculate functions that take
two lists as input and return a list of lists.
- QuantileStatisticListsIntegers() - Constructor for class com.github.jessemull.microflex.integerflex.stat.QuantileStatisticListsIntegers
-
- QuartileDeviationBigDecimal - Class in com.github.jessemull.microflex.bigdecimalflex.stat
-
This class calculates the quartile deviation of BigDecimal plate stacks, plates,
wells and well sets.
- QuartileDeviationBigDecimal() - Constructor for class com.github.jessemull.microflex.bigdecimalflex.stat.QuartileDeviationBigDecimal
-
- QuartileDeviationBigInteger - Class in com.github.jessemull.microflex.bigintegerflex.stat
-
This class calculates the quartile deviation of BigInteger plate stacks, plates,
wells and well sets.
- QuartileDeviationBigInteger() - Constructor for class com.github.jessemull.microflex.bigintegerflex.stat.QuartileDeviationBigInteger
-
- QuartileDeviationDouble - Class in com.github.jessemull.microflex.doubleflex.stat
-
This class calculates the quartile deviation of double plate stacks, plates,
wells and well sets.
- QuartileDeviationDouble() - Constructor for class com.github.jessemull.microflex.doubleflex.stat.QuartileDeviationDouble
-
- QuartileDeviationInteger - Class in com.github.jessemull.microflex.integerflex.stat
-
This class calculates the quartile deviation of integer plate stacks, plates,
wells and well sets.
- QuartileDeviationInteger() - Constructor for class com.github.jessemull.microflex.integerflex.stat.QuartileDeviationInteger
-
- QuartilesBigDecimal - Class in com.github.jessemull.microflex.bigdecimalflex.stat
-
This class returns the quartiles for big decimal plate stacks, plates, wells
and well sets.
- QuartilesBigDecimal() - Constructor for class com.github.jessemull.microflex.bigdecimalflex.stat.QuartilesBigDecimal
-
- QuartilesBigInteger - Class in com.github.jessemull.microflex.bigintegerflex.stat
-
This class returns the quartiles for big integer plate stacks, plates, wells
and well sets.
- QuartilesBigInteger() - Constructor for class com.github.jessemull.microflex.bigintegerflex.stat.QuartilesBigInteger
-
- QuartilesDouble - Class in com.github.jessemull.microflex.doubleflex.stat
-
This class returns the quartiles for double plate stacks, plates, wells and
well sets.
- QuartilesDouble() - Constructor for class com.github.jessemull.microflex.doubleflex.stat.QuartilesDouble
-
- QuartilesInteger - Class in com.github.jessemull.microflex.integerflex.stat
-
This class returns the quartiles for integer plate stacks, plates, wells and
well sets.
- QuartilesInteger() - Constructor for class com.github.jessemull.microflex.integerflex.stat.QuartilesInteger
-
- QuartileSkewnessBigDecimal - Class in com.github.jessemull.microflex.bigdecimalflex.stat
-
This class calculates the quartile skewness of BigDecimal plate stacks, plates,
wells and well sets.
- QuartileSkewnessBigDecimal() - Constructor for class com.github.jessemull.microflex.bigdecimalflex.stat.QuartileSkewnessBigDecimal
-
- QuartileSkewnessBigInteger - Class in com.github.jessemull.microflex.bigintegerflex.stat
-
This class calculates the quartile skewness of BigInteger plate stacks, plates,
wells and well sets.
- QuartileSkewnessBigInteger() - Constructor for class com.github.jessemull.microflex.bigintegerflex.stat.QuartileSkewnessBigInteger
-
- QuartileSkewnessDouble - Class in com.github.jessemull.microflex.doubleflex.stat
-
This class calculates the quartile skewness of double plate stacks, plates, wells and
well sets.
- QuartileSkewnessDouble() - Constructor for class com.github.jessemull.microflex.doubleflex.stat.QuartileSkewnessDouble
-
- QuartileSkewnessInteger - Class in com.github.jessemull.microflex.integerflex.stat
-
This class calculates the quartile skewness of integer plate stacks, plates, wells and
well sets.
- QuartileSkewnessInteger() - Constructor for class com.github.jessemull.microflex.integerflex.stat.QuartileSkewnessInteger
-


Software and More
Record Ultra HD Security Video and provide secure video streams to client applications.
View Live and Recorded video from S‑VIDIA Servers.
View 100s of Video Streams from Multiple S‑VIDIA Servers simultaneously on one display.
Access S‑VIDIA Server streams while out and about on your Android or Apple device.
Encode h.264 and MJPEG cameras into FDC to efficiently and securely stream video over your network.
Convert video to AVI, check digital watermarks, and much more.
"The future of this compression method lies in the hands of those who demand quality, depend on accuracy and clarity of evidence, and will benefit from our endless growing catalogue of security possibilities."
Copyright © 2017 SVIDIA LLC


There are three variables that are relevant to the structure and even the performance of Java.util.HashMap(short as HashMap). Its implementation is based on a bucket table and linkedlists.
- size, # of key-value pairs hold at a particular moment
- threshold, the next size value at which to resize
- capacity, length of the bucket table
where $\frac{size}{capacity}$ is denoted as load factor, which is a tradeoff between time and space complexity.
Declaration:
transient Entry[] table;
transient int size;
int threshold;
final float loadFactor;
int capacity() { return table.length; }
The following code segment shows how "threshold" works.
void addEntry(int hash, K key, V value, int bucketIndex) {
Entry e = table[bucketIndex];
table[bucketIndex] = new Entry(hash, key, value, e);
if (size++ >= threshold)
resize(2 * table.length);
}
After # of key-value pairs reaches threshold, the size of the bucket table is doubled.
This shows how "resize" function works.
void resize(int newCapacity) {
Entry[] oldTable = table;
int oldCapacity = oldTable.length;
if (oldCapacity == MAXIMUM_CAPACITY) {
threshold = Integer.MAX_VALUE;
return;
}
Entry[] newTable = new Entry[newCapacity];
transfer(newTable);
table = newTable;
threshold = (int)(newCapacity * loadFactor);
}
It instantiates a new bucket table with new capacity and assign all entries to the new table. Finally it sets new threshold for feature use.
This is how to assign all entries to a new table.
void transfer(Entry[] newTable) {
Entry[] src = table;
int newCapacity = newTable.length;
for (int j = 0; j < src.length; j++) {
Entry e = src[j];
if (e != null) {
src[j] = null;
do {
Entry next = e.next;
int i = indexFor(e.hash, newCapacity);
e.next = newTable[i];
newTable[i] = e;
e = next;
} while (e != null);
}
}
}
Note that
load factor $\alpha$ actually represents the average length of linkedlists whose heads are hold at buckets. Thus the average retrieval time for a key is O(1 + $\alpha$), where 1 for the computation of hash function and $\alpha$ for searching on a linkedlist.
capacity is always power of two so that mod operation can be replaced by "&" operation which is more efficient.
static int indexFor(int h, int length) {
return h & (length-1);
}
- If capacity is power of two, the probability of collision will be increased. hash function is applied
to avoid this.
static int hash(int h) {
// This function ensures that hashCodes that differ only by
// constant multiples at each bit position have a bounded
// number of collisions (approximately 8 at default load factor).
h ^= (h >>> 20) ^ (h >>> 12);
return h ^ (h >>> 7) ^ (h >>> 4);
}


Chapter 5 Simple Linear Regression
The first analysis that we will go over is the simple linear regression. Typically, this is one of the last analyses that is taught in introductory statistics in psychology; however, we will go over the simple linear regression first because its steps are essentially identical to the GLM (i.e., OLS regression) and provides a foundation for the GLM framework.
The simple linear regression is typically taught to be used in understanding the relationship between two continuous variables, especially if one can predict the other.
However, the simple linear regression is a specific case of regression2 where variables can actually be either continuous or categorical, the number of predictor variables can be more than one, and causation is not a requirement. Thus, regression is applicable to most data types.
The simple linear regression is written as:
\[Y = \beta_0 + \beta_1X + \varepsilon\]
where \(Y\) is the dependent (or response) variable, \(\beta_0\) is the intercept, \(\beta_1\) is the slope, \(X\) is the independent (or predictor) variable, and \(\varepsilon\) is the error.
We will use the terms dependent variable (DV) and response variable interchangeably throughout the book. We will also use the terms independent variable (IV) or predictor variable interchangeably.
\(\beta\) represents the true population value, while \(b\) represents the unstandardized estimate of the true population value that we will obtain from our analysis. For example, \(\beta_1\) represents the true population slope, while \(b_1\) represents the unstandardized estimate of the true population slope (or sample).
Thus, a predicted model (as opposed to the above true hypothesized model) would be written as:
\[\hat{Y} = b_0 + b_1X\]
where \(\hat{Y}\) represents the predicted dependent (or response) variable.
Both equations should look familiar to the slope-intercept form learned in algebra:
\[y = mx + b\]
where \(b\) is the intercept, and \(m\) is the slope.
The intercept and slope have the same meaning as they did in algebra. The intercept represents the value of \(Y\) when \(X\) is 0, and the slope represents the change in \(Y\) (\(\Delta Y\)) over the change in \(X\) (\(\Delta X\)). In other words, the intercept represents the value of the DV when the IV is 0, and the slope represents the change in the DV over the change in the IV.
Note that the \(b\) in the slope-intercept form is not the same and should not be confused with the \(b\) in the simple linear regression. The \(b\) in the simple linear regression is the slope, while the \(b\) in the slope-intercept form is the intercept. Unfortunately, using the same symbol for different terms and using different symbols for the same term is prevalent in statistics.
For a practical example of the simple linear regression, let’s say that we were interested in examining if there is a relationship between the amount of years since a professor has earned their Ph.D. and their salary.
For this example, we will use the datasetSalaries
dataset.
5.1 Null and research hypotheses
\[Model: Salary = \beta_0 + \beta_1 YearsSincePhD + \varepsilon\] \[H_0: \beta_1 = 0\] \[H_1: \beta_1 \ne 0\]
where \(\beta_0\) is the intercept, \(\beta_1\) is the slope, \(H_0\) is the null hypothesis and \(H_1\) is the research or alternative hypothesis. Typically, the model is written as the hypothesized true model and thus the use of \(\beta\) rather than \(b\).
In this example, the null hypothesis states that the slope is equal to 0, or that there is no relationship between \(X\) (years since a professor has earned their Ph.D.) and \(Y\) (their 9-month academic salary). (Note: The null hypothesis is sometimes referred to as the nil hypothesis in psychology since we are typically comparing our estimate against 0, or nil).
The research hypothesis states that the slope is not equal to 0, or that there is a relationship between \(X\) (years since a professor has earned their Ph.D.) and \(Y\) (their 9-month academic salary).
The model, null hypothesis, and research hypothesis are identical for both traditional and GLM approaches.
The intercept can also be tested and its null and research hypotheses are: \[H_0: \beta_0 = 0\] \[H_1: \beta_0 \ne 0\]
The null hypothesis states that the intercept is equal to 0. In other words, the value of \(Y\) (9-month academic salary) when \(X\) (years since a professor has earned their Ph.D.) is 0 is not different than 0 ($0). (Note: Zero represents professors who have just earned their Ph.D. up to those who have earned their Ph.D. for less than a year because yrs.since.phd
was collected as integers and anything less than a year would be coded as 0.)
The research hypothesis states that the intercept is not equal to 0. In other words, the value of \(Y\) (9-month academic salary) when \(X\) (years since a professor has earned their Ph.D.) is 0 is different than 0 ($0)
Again, the null and research hypotheses are identical for both traditional and GLM approaches.
5.2 Statistical analyses
To perform the simple linear regression in R, we can use the lm()
function.
model <- lm(formula = salary ~ 1 + yrs.since.phd, data = datasetSalaries)
The first input is the formula of the model, which is the DV, followed by a tilde sign (~
), followed by the IV. (Note: 1 is a placeholder for the intercept. The same analysis with identical results can be obtained without the 1. However, we place 1 there to remind us that 1 represents the intercept to gain intuition of the formula).
In our case, the DV of salary
is be the first variable, followed by a ~
and the IV of yrs.since.phd
. Notice the similarity between the model and formula. The second input is the dataset (i.e., datasetSalaries
).
We will save the analysis into an object named model
. model
can be any name and was chosen for simplicity.
We can obtain the ANOVA source table by using the Anova
function within the cars
package.
Anova(model, type = 3)
## Anova Table (Type III tests)
##
## Response: salary
## Sum Sq Df F value Pr(>F)
## (Intercept) 8.3369e+11 1 1099.706 < 2.2e-16 ***
## yrs.since.phd 6.3852e+10 1 84.226 < 2.2e-16 ***
## Residuals 2.9945e+11 395
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Note: We prefer the Anova
function with a capitol A over the anova
function with a lowercase a because we can specify the type of sum of squares. Breifly, The sum of squares in the anova
function is type I sums of squares and cannot be changed while we can specify type III sums of squares, which is the default among most statistical softwares, using the Anova
function. To learn more about different types of sum of squares, check out Mangiafico’s explanation.
5.2.1 How do we read the ANOVA source table?
We can look at the variable of interest in the first column and read across that particular variable’s row for its statistical information.
For example, let’s first examine the statistics associated with the variable (Intercept)
. The sums of squares (Sum Sq
, which is also abbreviated as \(SS\)) associated with the (Intercept)
is 8.37e+11
, the degrees of freedom (Df
, specifically, degrees of freedom reduced) is 1
, the F-statistic (F value
) is 1099.71, and the p-value (Pr>F
) is < 2.2e-16
.
The F value
or F-statistic conceptually provides a ratio of explained to unexplained variability. Explained variability is how much the DV can be explained by IVs while unexplained variability is how much variability is not explained by the IV.
The mathematical formula of the F-statistic can conceptually be thought of as:
\[F = \frac{explained\ variability}{unexplained\ variability}\]
Thus, if the IV can’t explain any of the variability within the DV, then the F-statistic is less than or equal to 1.
However, if the IV(s) can explain the DV, the F-statistic will be larger than 1. In other words, the higher the F-statistic, the more the IV(s) explain(s) the variability in the DV compared to its inability to explain the DV.
Thus, the interpretation of the F-statistic of the (Intercept)
is that the (Intercept)
can explain the variability in salary
1099.71
times more than the (Intercept)
’s inability to explain the variability in salary.3
The Pr(>F)
or p-value associated with the Intercept
is < 2.2e-16
. The p-value is the probability of obtaining that particular F-statistic or more extreme assuming that the null hypothesis is true. In other words, the probability of obtaining this F-statistic by chance is extremely small.
Since yrs.since.phd
was our main predictor of interest (and for extra practice), let’s also look at the statistics associated with yrs.since.phd
.
The F-statistic associated with yrs.since.phd
is 84.23
, and can be interpreted as yrs.since.phd
explains the variability in salary
84.23
times more than years.since.phd
’s inability to expain the variability in salary..4
The p-value associated with yrs.since.phd
is also < 2.2e-16
with identical interpretations for the p-value of the (Intercept)
.
We can also obtain the coefficients table by using the summary()
function.
summary(model)
##
## Call:
## lm(formula = salary ~ 1 + yrs.since.phd, data = datasetSalaries)
##
## Residuals:
## Min 1Q Median 3Q Max
## -84171 -19432 -2858 16086 102383
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 91718.7 2765.8 33.162 <2e-16 ***
## yrs.since.phd 985.3 107.4 9.177 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 27530 on 395 degrees of freedom
## Multiple R-squared: 0.1758, Adjusted R-squared: 0.1737
## F-statistic: 84.23 on 1 and 395 DF, p-value: < 2.2e-16
5.2.2 How do we read the coefficients table?
Similarly, we can look at the variable of interest in the first column and read across that particular variable’s row for its statistical information.
Again, let’s first take a look at the statistics associated with the (Intercept)
. The Estimate
of the (Intercept)
is 91718.7
, the standard error (Std. Error
) is 2765.8
, the t-statistic (t value
) is 33.162
, and the p-value ((Pr>|t|)
) is < 2e-16
.
The Estimate
of the (Intercept)
is the predicted intercept value, \(b_0 = 91718.7\). Thus, the predicted salary
when \(yrs.since.phd = 0\) is $91,718.70. In other words, when a professor has had their Ph.D. for less than a year, their salary is predicted to be $91,718.70.
The t value
or t-statistic is similar to the F-statistic, and can also be conceptually thought of as the ratio of explained variability to unexplained variability. The t-statistic is equal to the square root of the F-statistic when the degrees of freedom is 156. Thus, the t-statistic interpretation is that the (Intercept)
explains the variability in salary
33.162
times more than its inability to explain salary
.
The p-value or Pr(>|t|)
of <2e-16
is the probability of obtaining that particular t-statistic or a value more extreme than the t-statistic assuming that the null hypothesis is true, which is the same value from the ANOVA source table.
Let’s also examine statistics for yrs.since.phd
. The Estimate
of yrs.since.phd
is 985.3
, the Std. Error
is 107.4
, the t value
is 9.18
, and the Pr(>|t|)
is <2e-16
.
The Estimate
of the yrs.since.phd
is the estimated slope, \(b_1 = 985.3\). Thus, salary
is predicted to change by $985.30
for every 1 unit increase in yrs.since.phd
.7 In other words, salary is predicted to increase by $985.30 for every additional year a professor has earned their Ph.D.
The t-statistic can be interpreted as yrs.since.phd
explains the variability in salary
9.18 times more than yrs.since.phd
’s inability to the explain the variability in salary
.
The p-value of yrs.since.phd
is identical to the p-value of the (Intercept)
and has identical interpretations.
Now, if wanted, we can fill in our predicted model, \(\hat{Y} = b_0 + b_1X\), with the estimates from the coefficients table to predict (or estimate) other values of salary given a certain number of years since a professor has earned their Ph.D.
\[\hat{salary} = b_0 + b_1*yrs.since.phd = 91718.7+985.3*yrs.since.phd\]
For example, let’s say that we were interested in estimating the salary of professor’s who have worked for 2 years.
\[\hat{salary} = 91718.7+985.3*yrs.since.phd = 91718.7+985.3*2 = 93689.3\]
5.3 Statistical decision
To determine if yrs.since.phd
is statistically significant in predicting salary
, we will compare its p-value with the alpha level (\(\alpha\)) of 0.05
. \(\alpha\) is the Type I error rate, or the probability that we are incorrectly rejecting the null hypothesis when it is actually true.
Given that the p-value of <2.2e-16
for the yrs.since.phd
is less than the alpha level (\(\alpha\)) of 0.05
, we will reject
the null hypothesis.
We can also determine if the intercept is statistically significant. Given, that the (Intercept)
had an identical p-value, we will also reject
the null hypothesis.
5.4 APA statement
A regression was performed to test if the amount of years since obtaining a Ph.D. was related to their salary. The amount of years since obtaining a Ph.D. was significantly related to their salary, b = 985.3, t(395) = 9.18, p < .001. For every passing year that a professor has earned their Ph.D., their salary is estimated to increase by $985.30.
5.5 Visualization
ggplot(datasetSalaries, aes(yrs.since.phd, salary)) +
geom_point(alpha = 0.25) +
geom_smooth(method = "lm", color = "#3182bd") +
labs(
x = "Years since Ph.D.",
y = "9-Month Salary (USD)"
) +
scale_y_continuous(labels = dollar) +
theme_classic()
Specifically, the simple linear regression is a specific case of ordinary least squares (OLS) regression. OLS is one of the several ways that we can calculate the error term.↩
\(m_{rank}=k_{rank}-1=3-1=2\)↩
yrs.since.phd
: \[F = \frac{MSR}{MSE} = \frac{\frac{SSR}{df_R}}{\frac{SSE}{df_E}} = \frac{\frac{6.39e10}{1}}{\frac{2.99e11}{395}} = \frac{6.39e10}{7.58e8} = 84.23\]↩(Intercept)
: \[t = \frac{Estimate}{Std.\ Error} = \frac{91718.7}{2765.8} = 33.16\]↩(Intercept)
: \[t = \sqrt{F} = \sqrt{1099.71} = 33.16\]↩\[b_1 = \frac{\Delta Y}{\Delta X} = \frac{\Delta DV}{\Delta IV} = \frac{\Delta salary}{\Delta yrs.since.phd} = \frac{985.3}{1} = 985.3\]↩


<learningOverviewRef>
Use a <learningOverviewRef> element to include a topic reference to a learning overview topic as part of a <learningObject> element.
<learningObject>
Category: Learning and training: map domain elements


I fancy wandering shadow heard here not. Much heaven this human so whose i heard, sad evilprophet my sitting not token with opened here. This lonely fiend never the and the some. Lenore one youhere ghost above now countenance. I came ashore gently streaming. Midnight a moment visiter parting, nevermore shorn the murmured i it my there rapping have, only quaff seat soul and have.  Implore metell help lenore sitting while then, bust louder my now volume at of.
Nature And Fruits
Sed magna dolor ipsum stet lorem sadipscing labore


文章目录
【注意】最后更新于 January 1, 0001，文中内容可能已过时，请谨慎使用。
 The new scheduler has given a dramatic increase in performance for parallel Go programs and with nothing better to do, I figured I’d write something about it.
Most of what’s written in this blog post is already described in the original design doc. It’s a fairly comprehensive document, but pretty technical.
All you need to know about the new scheduler is in that design document but this post has pictures, so it’s clearly superior.
What does the Go runtime need with a scheduler?
But before we look at the new scheduler, we need to understand why it’s needed. Why create a userspace scheduler when the operating system can schedule threads for you?
The POSIX thread API is very much a logical extension to the existing Unix process model and as such, threads get a lot of the same controls as processes. Threads have their own signal mask, can be assigned CPU affinity, can be put into cgroups and can be queried for which resources they use. All these controls add overhead for features that are simply not needed for how Go programs use goroutines and they quickly add up when you have 100,000 threads in your program.
POSIX线程API在很大程度上是对现有Unix进程模型的逻辑扩展，因此，线程获得了许多与进程相同的控件。 线程具有自己的信号掩码，可以分配给CPU亲和力，可以放入cgroup中，并可以查询它们使用的资源。 所有这些控件都增加了Go程序如何使用goroutines根本不需要的功能的开销，并且当您的程序中有100,000个线程时，它们会迅速增加。
Another problem is that the OS can’t make informed scheduling decisions, based on the Go model. For example, the Go garbage collector requires that all threads are stopped when running a collection and that memory must be in a consistent state. This involves waiting for running threads to reach a point where we know that the memory is consistent.
另一个问题是，操作系统无法基于Go模型做出明智的调度决策。
例如，Go垃圾收集器要求在运行收集时停止所有线程，并且内存必须处于一致状态。
这涉及等待运行的线程到达我们知道内存一致的地步。
When you have many threads scheduled out at random points, chances are that you’re going to have to wait for a lot of them to reach a consistent state. The Go scheduler can make the decision of only scheduling at points where it knows that memory is consistent. This means that when we stop for garbage collection, we only have to wait for the threads that are being actively run on a CPU core.
当您在随机点安排了许多线程时，很可能将不得不等待很多线程达到一致的状态。 Go调度程序可以决定仅在知道内存一致的点上进行调度。 这意味着当我们停止垃圾回收时，我们只需要等待正在CPU内核上活跃运行的线程即可。
Our Cast of Characters
There are 3 usual models for threading. One is N:1 where several userspace threads are run on one OS thread. This has the advantage of being very quick to context switch but cannot take advantage of multi-core systems. Another is 1:1 where one thread of execution matches one OS thread. It takes advantage of all of the cores on the machine, but context switching is slow because it has to trap through the OS.
通常有3种线程模型。 一种是N：1，其中多个用户空间线程在一个OS线程上运行。
这样的优点是可以非常快速地进行上下文切换，但是不能利用多核系统。
另一个是1：1，其中一个执行线程与一个OS线程匹配。
它利用了计算机上的所有内核，但是上下文切换很慢，因为它必须捕获整个OS
Go tries to get the best of both worlds by using a M:N scheduler. It schedules an arbitrary number of goroutines onto an arbitrary number of OS threads. You get quick context switches and you take advantage of all the cores in your system. The main disadvantage of this approach is the complexity it adds to the scheduler.
To acomplish the task of scheduling, the Go Scheduler uses 3 main entities:
The triangle represents an OS thread. It’s the thread of execution managed by the OS and works pretty much like your standard POSIX thread. In the runtime code, it’s called M for machine.
590/5000
Go尝试通过使用M：N调度程序来兼顾两全其美。
它将任意数量的goroutine调度到任意数量的OS线程上。
您可以快速进行上下文切换，并且可以利用系统中的所有核心。
这种方法的主要缺点是它增加了调度程序的复杂性。
为了完成调度任务，Go Scheduler使用3个主要实体：
三角形代表OS线程。 它是由操作系统管理的执行线程，其工作原理与您的标准POSIX线程非常相似。
在运行时代码中，对于机器，它称为M。
The circle represents a goroutine. It includes the stack, the instruction pointer and other information important for scheduling goroutines, like any channel it might be blocked on. In the runtime code, it’s called a G.
圆圈代表goroutine。
它包括堆栈，指令指针和其他对调度goroutine重要的信息，
例如可能会阻塞其的任何通道。 在运行时代码中，它称为G。
The rectangle represents a context for scheduling. You can look at it as a localized version of the scheduler which runs Go code on a single thread. It’s the important part that lets us go from a N:1 scheduler to a M:N scheduler. In the runtime code, it’s called P for processor. More on this part in a bit.
矩形代表计划的上下文。
您可以将其视为调度程序的本地化版本，该调度程序在单个线程上运行Go代码。
这是使我们从N：1调度程序转到M：N调度程序的重要部分。
在运行时代码中，对于处理器，它称为P。 这部分的更多内容。
Here we see 2 threads (M), each holding a context (P), each running a goroutine (G). In order to run goroutines, a thread must hold a context.
The number of contexts is set on startup to the value of the GOMAXPROCS
environment variable or through the runtime function GOMAXPROCS()
. Normally this doesn’t change during execution of your program. The fact that the number of contexts is fixed means that only GOMAXPROCS
are running Go code at any point. We can use that to tune the invocation of the Go process to the individual computer, such at a 4 core PC is running Go code on 4 threads.
上下文数量在启动时设置为环境变量“ GOMAXPROCS”的值，或通过运行时函数“ GOMAXPROCS（）”设置。 通常，在执行程序期间这不会改变。 上下文数量是固定的，这意味着在任何时候只有GOMAXPROCS
在运行Go代码。
我们可以使用它来调整Go进程对单个计算机的调用，例如在4核PC上的4个线程上运行Go代码。
The greyed out goroutines are not running, but ready to be scheduled. They’re arranged in lists called runqueues. Goroutines are added to the end of a runqueue whenever a goroutine executes a go
statement. Once a context has run a goroutine until a scheduling point, it pops a goroutine off its runqueue, sets stack and instruction pointer and begins running the goroutine.
To bring down mutex contention, each context has its own local runqueue. A previous version of the Go scheduler only had a global runqueue with a mutex protecting it. Threads were often blocked waiting for the mutex to unlocked. This got really bad when you had 32 core machines that you wanted to squeeze as much performance out of as possible.
The scheduler keeps on scheduling in this steady state as long as all contexts have goroutines to run. However, there are a couple of scenarios that can change that.
灰色的goroutine尚未运行，但已准备好进行调度。 它们被排列在称为运行队列的列表中。 每当goroutine执行go
语句时，就会将goroutine添加到运行队列的末尾。
上下文在一个调度程序中运行了一个goroutine直到调度点后，便将其从其运行队列中弹出，设置堆栈和指令指针，然后开始运行该goroutine。
为了减少互斥锁争用，每个上下文都有其自己的本地运行队列。
Go调度程序的早期版本仅具有全局运行队列，并带有互斥量来保护它。 线程经常被阻塞，等待互斥锁解锁。 当您有32台核心计算机想要最大限度地发挥性能时，这变得非常糟糕。
只要所有上下文都有要运行的goroutine，调度程序便会在此稳态下继续调度。 但是，有两种情况可以改变这种情况。
Who you gonna (sys)call?
You might wonder now, why have contexts at all? Can’t we just put the runqueues on the threads and get rid of contexts? Not really. The reason we have contexts is so that we can hand them off to other threads if the running thread needs to block for some reason.
An example of when we need to block, is when we call into a syscall. Since a thread cannot both be executing code and be blocked on a syscall, we need to hand off the context so it can keep scheduling.
Here we see a thread giving up its context so that another thread can run it. The scheduler makes sure there are enough threads to run all contexts. M1 in the illustration above might be created just for the purpose of handling this syscall or it could come from a thread cache. The syscalling thread will hold on to the goroutine that made the syscall since it’s technically still executing, albeit blocked in the OS.
When the syscall returns, the thread must try and get a context in order to run the returning goroutine. The normal mode of operation is to steal a context from one of the other threads. If it can’t steal one, it will put the goroutine on a global runqueue, put itself on the thread cache and go to sleep.
The global runqueue is a runqueue that contexts pull from when they run out of their local runqueue. Contexts also periodically check the global runqueue for goroutines. Otherwise the goroutines on global runqueue could end up never running because of starvation.
This handling of syscalls is why Go programs run with multiple threads, even when GOMAXPROCS
is 1. The runtime uses goroutines that call syscalls, leaving threads behind.
您可能现在想知道，为什么要有上下文？我们不能只是将运行队列放在线程上并摆脱上下文吗？并不是的。
我们拥有上下文的原因是，如果正在运行的线程出于某种原因需要阻塞，我们可以将它们移交给其他线程。
当我们需要调用系统调用时，就需要阻塞的一个例子。由于线程既不能执行代码，也不能在系统调用中被阻塞，所以我们需要移交上下文，以便它可以保持调度。
在这里，我们看到一个线程放弃了它的上下文，以便另一个线程可以运行它。调度程序确保有足够的线程来运行所有上下文。上图中的 M1 可能只是为了处理此系统调用而创建的，或者它可能来自线程缓存。
syscalling线程将保留进行syscall的goroutine，因为它在技术上仍在执行，尽管已在OS中被阻塞。
当系统调用返回时，线程必须尝试获取上下文才能运行返回的goroutine。
正常的操作模式是从其他线程之一窃取上下文。
如果无法窃取，它将把goroutine放在全局运行队列中，将自身放在线程缓存中并进入睡眠状态。
全局运行队列是上下文从本地运行队列用尽时开始提取的运行队列。
上下文还定期检查全局运行队列中的goroutine。否则，由于饥饿，全局运行队列上的goroutine可能永远无法运行。
这种处理系统调用的原因是即使GoGOPROCS为1的Go程序也可以运行多个线程的原因。运行时使用goroutines调用系统调用，从而使线程落后。
Stealing work
Another way that the steady state of the system can change is when a context runs out of goroutines to schedule to. This can happen if the amount of work on the contexts’ runqueues is unbalanced. This can cause a context to end up exhausting it’s runqueue while there is still work to be done in the system. To keep running Go code, a context can take goroutines out of the global runqueue but if there are no goroutines in it, it’ll have to get them from somewhere else.
That somewhere is the other contexts. When a context runs out, it will try to steal about half of the runqueue from another context. This makes sure there is always work to do on each of the contexts, which in turn makes sure that all threads are working at their maximum capacity.
Where to go?
There are many more details to the scheduler, like cgo threads, the LockOSThread()
function and integration with the network poller. These are outside the scope of this post, but still merit study. I might write about these later. There are certainly plenty of interesting constructions to be found in the Go runtime library.
By Daniel Morsing


Suppose we invest some fraction \(w_1, w_2, \dots, w_n\) of our wealth in n risky assets (labelled 1 to n), and the remainder \(w_0\) in a riskless asset such as cash in a bank account.
Clearly \(w_0 + w_1 + \dots + w_n = 1\) since our wealth comprises all those assets.
Let \(R_0, R_1, \dots, R_n\) be the respective asset returns, then our portfolio return is
\[ R_P = w_0 R_0 + w_1 R_1 + \dots + w_n R_n \]Alternatively, we can eliminate \(w_0\) to get
\[ R_P - R_0 = w_1 (R_1 - R_0) + \dots + w_n (R_n - R_0) \]Our expected portfolio return is
\[ \mathbb{E}(R_P) = w_0 R_0 + w_1 \mathbb{E}(R_1) + \dots + w_n \mathbb{E}(R_n) \]Note that \( \mathbb{E}(R_0) = R_0 \) since the riskless return is known with certainty, by definition.
Before computing portfolio risk, we need to first understand covariance and correlation. They measure the linear relationship between two random variables.
The covariance of two random variables X and Y is defined as
\[ \text{Cov}(X, Y) = \mathbb{E} \left[ (X-\mathbb{E}(X)) (Y-\mathbb{E}(Y)) \right] \]The correlation of X and Y, which is always between −1 and 1, is their covariance after being standardized:
\[ \text{Corr}(X, Y) = \text{Cov} \left( \frac{X-\mathbb{E}(X)}{\sigma_X}, \frac{Y-\mathbb{E}(Y)}{\sigma_Y} \right) = \frac{\text{Cov}(X, Y)}{\sigma_X \sigma_Y} \]Now we are ready to compute portfolio risk, as measured by the variance of portfolio returns:
\[ \text{Var}(R_P) = \text{Var}(w_0 R_0 + w_1 R_1 + \dots + w_n R_n) \]Recall that \( \text{Var}(X + c) = \text{Var}(X) \) if c is a known constant, so the term \( w_0 R_0 \) involving the riskless return can be omitted. It will be convenient to use sigma notation:
\[ \text{Var}(R_P) = \text{Var} \left( \sum_{k=1}^n w_k R_k \right) \] \[ = \mathbb{E} \left[\left( \sum_{k=1}^n w_k R_k - \mathbb{E} \left( \sum_{k=1}^n w_k R_k \right) \right)^2\right] \] \[ = \mathbb{E} \left[\left( \sum_{k=1}^n w_k \, \left( R_k - \mathbb{E}(R_k) \right) \right)^2\right] \]So we have a squared sum of n terms. How do we expand it?
\[ \left( \sum_{k=1}^n u_k \right)^2 = (u_1 + \dots + u_n) \, (u_1 + \dots + u_n) \]If we expand the brackets on the right hand side, every term has the form \( u_i u_j \) where i and j can be 1, 2, ... , or n.
\[ \left( \sum_{k=1}^n u_k \right)^2 = \sum_{i=1}^n \sum_{j=1}^n u_i u_j \]Therefore
\[ \text{Var}(R_P) = \mathbb{E} \left[ \sum_{i=1}^n \sum_{j=1}^n w_i \, w_j \, (R_i - \mathbb{E}(R_i)) (R_j - \mathbb{E}(R_j)) \right] \] \[ = \sum_{i=1}^n \sum_{j=1}^n w_i \, w_j \, \text{Cov}(R_i, R_j) \]The last step arises from the definition of covariance. The only thing left is to express portfolio risk in matrix notation:
\[ \text{Var}(R_P) = \mathbf{w}^T \Sigma \mathbf{w} \]where
\[ \mathbf{w} = \begin{pmatrix} w_1 \\ \vdots \\ w_n \end{pmatrix} \qquad \Sigma = \begin{bmatrix} \text{Cov}(R_1, R_1) & \text{Cov}(R_1, R_2) & ... & \text{Cov}(R_1, R_n) \\ \text{Cov}(R_2, R_1) & \text{Cov}(R_2, R_2) & ... & \text{Cov}(R_2, R_n) \\ \vdots & \vdots & \ddots & \vdots \\ \text{Cov}(R_n, R_1) & \text{Cov}(R_n, R_2) & ... & \text{Cov}(R_n, R_n) \end{bmatrix} \]How can we make sense of portfolio risk? Consider a simple case with a riskless asset and only n = 2 risky assets.
\[ \text{Var}(R_P) = w_A^2 \text{Var}(R_A) + w_B^2 \text{Var}(R_B) + 2w_A w_B \text{Cov}(R_A, R_B) \]Portfolio risk can be reduced by choosing two assets that are negatively correlated. This is the benefit of diversification.


Class: Sass::Supports::Condition
- Inherits:
-
Object
- Object
- Sass::Supports::Condition
- Defined in:
- /usr/local/google-old/home/code/sass-site/.sass/lib/sass/supports.rb
Overview
The abstract superclass of all Supports conditions.
Direct Known Subclasses
Instance Method Summary (collapse)
-
- (Condition) deep_copy
Returns a deep copy of this condition and all its children.
-
- options=(options)
Sets the options hash for the script nodes in the supports condition.
-
- perform(environment)
Runs the SassScript in the supports condition.
-
- (String) to_css
Returns the CSS for this condition.
-
- (String) to_src(options)
Returns the Sass/CSS code for this condition.
Instance Method Details
- (Condition) deep_copy
Returns a deep copy of this condition and all its children.
24 |
# File '/usr/local/google-old/home/code/sass-site/.sass/lib/sass/supports.rb', line 24
def deep_copy; Sass::Util.abstract(self); end
|
- options=(options)
Sets the options hash for the script nodes in the supports condition.
29 |
# File '/usr/local/google-old/home/code/sass-site/.sass/lib/sass/supports.rb', line 29
def options=(options); Sass::Util.abstract(self); end
|
- perform(environment)
Runs the SassScript in the supports condition.
8 |
# File '/usr/local/google-old/home/code/sass-site/.sass/lib/sass/supports.rb', line 8
def perform(environment); Sass::Util.abstract(self); end
|
- (String) to_css
Returns the CSS for this condition.
13 |
# File '/usr/local/google-old/home/code/sass-site/.sass/lib/sass/supports.rb', line 13
def to_css; Sass::Util.abstract(self); end
|
- (String) to_src(options)
Returns the Sass/CSS code for this condition.
19 |
# File '/usr/local/google-old/home/code/sass-site/.sass/lib/sass/supports.rb', line 19
def to_src(options); Sass::Util.abstract(self); end
|


Initializing....
Welcome to LoL Tryhard!
Summoner Name
Region
North America
Europe West
Europe and Nordic East
Game Folder Path
Get Started
Waiting for Champ Selection phase to end....
Cancel
Data:


,
( YRS.)
BP goal < 130/80
Last Known Values
Ur tp
0-135
µalb/cre
< 30.0
SGOT
10-40
Chol
< 200
Tri
< 150
HDL
> 40
LDL
< 100
BUN
8-25
Cre
0.60-1.50
Glu
70-110
A1C
< 7%
LDL goal < 100
Other Info
weight
height
smoking
not available
aspirin
not available
ACE/ARB
not available
last pneumovax
last flu shot
Major CV Comorbidities
Other Problems
A1C goal < 7
Reminders
Allergies
Medications


Summary |
|
| Bridge: |
Tiffen, Austria |
| Test Period: |
17.03.72-17.03.92 |
| Number of violations: |
480 |
| Number of events: |
148 |
| Gross Vehicle Weight |
| Mean weight (T): |
80 |
| Mode weight (T): |
100 |
| Weight limit (T): |
100 |
| Number of violations: |
480 |
| Max violation (T): |
148 |
| Velocity |
| Mean Speed (Km/h): |
80 |
| Mode speed (Km/h): |
100 |
| Speed limit (Km/h): |
100 |
| Number of violations: |
480 |
| Max violation (Km/h): |
148 |
| Vehicle Length (m): |
| Mean Length (m): |
80 |
| Mode length (m): |
100 |
| Length limit (m): |
100 |
| Number of violations: |
480 |
| Max violation: |
148 |
| Summary |
| Location |
Tiffen, Austria |
| Measurement period: |
17.03.72 - 17.03.92 |
| Number of events: |
6000 |
| Number of violations: |
480 |
| Vehicle Classes |
| Class |
Events |
Mean Speed (Km/h) |
Mean Weight (T) |
ESAL |
| 1 |
1000 |
130 |
18 |
1.0 |
| 2 |
1034 |
130 |
18 |
1.0 |
| 3 |
1048 |
130 |
18 |
1.0 |
| 4 |
1044 |
130 |
18 |
1.0 |
| 5 |
1048 |
130 |
18 |
1.0 |
| 6 |
1044 |
130 |
18 |
1.0 |
| Exceptions |
| Class |
Speed (km/h) |
Weight (T) |
ESAL |
| Limit |
130 |
18 |
1.0 |
| Violations |
1034 |
1300 |
1300 |


skyblue/cloud queries Tutum for containers and can manage their lifecycle. You must provide your username and Api key from Tutum, which can be found in the "Account info" page https://dashboard.tutum.co/account/ under the tab "Api key".
Enter the username and key in the profile page.
Coming soon.
To persist your container configuration on skyblue/cloud initiate the synchronisation with the "Sync" button. This action will take a while, depending on the number of services and containers you run.
Initial creation of a container configuration must be done at the provider.
You can stop and start synchronized services. Depending on the selection "Destroy on stop" or "Keep on stop" the service is terminated (destroyed) or stopped.
Web Hooks permit extending the workflow and apply additional logic. For every service you can configure Web Hooks. The hook are called from your browser with a POST request, the values are send in form-data.
Name of service: name
link_variables
(Tutum only)
Published ports as: NAME_CONTAINERCOUNT_PROTOCOL_PUBLIC_ADDR
and NAME_CONTAINERCOUNT_PROTOCOL_PUBLIC_ADDR
(Tutum only)
On start the start hook is called after the service has been started. On stop the stop hook is called before stopping the service. The service gets stopped only when the hook returned with a successful response code (2xx). The hook can be triggered manually with the button "Test hook". Keep in mind that the same-origin security policy applies (use CORS on server-side).
A service started with
tutum service run -p 22 -e VARIABLE1=variable1 -n centos philipsahli/centos
sends following:
ID = 5d056de4-3fe7-4ac0-accf-9d90cd344cfb
NAME = centos
HOOK_URL = http://localhost:8000/fastapp/base/skyblue-cloud/exec/hook_test_variables/&stop
VARIABLE1 = variable1
CENTOS_ENV_VARIABLE1 = variable1
CENTOS_ENV_TUTUM_CONTAINER_API_URL = https://dashboard.tutum.co/api/v1/container/286bbc0f-f93b-433c-93e5-7e6a7c61118b/
CENTOS_ENV_TUTUM_CONTAINER_HOSTNAME = centos-1.user.cont.tutum.io
CENTOS_ENV_TUTUM_SERVICE_API_URL = https://dashboard.tutum.co/api/v1/service/5d056de4-3fe7-4ac0-accf-9d90cd344cfb/
CENTOS_TUTUM_API_URL = https://dashboard.tutum.co/api/v1/service/5d056de4-3fe7-4ac0-accf-9d90cd344cfb/
CENTOS_NAME = 286bbc0f-f93b-433c-93e5-7e6a7c61118b/CENTOS_1
CENTOS_PORT = tcp://<IP_ADDRESS>:22
CENTOS_PORT_22_TCP = tcp://<IP_ADDRESS>:22
CENTOS_PORT_22_TCP_ADDR = <IP_ADDRESS>
CENTOS_PORT_22_TCP_PORT = 22
CENTOS_PORT_22_TCP_PROTO = tcp
CENTOS_1_ENV_VARIABLE1 = variable1
CENTOS_1_ENV_TUTUM_CONTAINER_API_URL = https://dashboard.tutum.co/api/v1/container/286bbc0f-f93b-433c-93e5-7e6a7c61118b/
CENTOS_1_ENV_TUTUM_CONTAINER_HOSTNAME = centos-1.user.cont.tutum.io
CENTOS_1_ENV_TUTUM_SERVICE_API_URL = https://dashboard.tutum.co/api/v1/service/5d056de4-3fe7-4ac0-accf-9d90cd344cfb/
CENTOS_1_NAME = 286bbc0f-f93b-433c-93e5-7e6a7c61118b/CENTOS_1
CENTOS_1_PORT = tcp://<IP_ADDRESS>:22
CENTOS_1_PORT_22_TCP = tcp://<IP_ADDRESS>:22
CENTOS_1_PORT_22_TCP_ADDR = <IP_ADDRESS>
CENTOS_1_PORT_22_TCP_PORT = 22
CENTOS_1_PORT_22_TCP_PROTO = tcp
CENTOS_1_PORT_22_TCP_PUBLIC_ADDR = centos-1.user.cont.tutum.io
CENTOS_1_PORT_22_TCP_PUBLIC_PORT = 49202
For a deeper inspection use http://requestb.in/ with a Proxy on skyblue/planet.


One third of the elder population over the age of 65 falls each year, and the risk of falls increases proportionately with age. Help us understand what causes people to fall and together, we can prevent harm from happening.
Find Out MoreMovement patterns and abrupt behavioural changes are early indicators that help to detect, predict and, ultimately, prevent falls. We are building a monitoring system that sits on top of standard CCTV systems and automatically extracts crucial health metrics over time. Using only one camera and a lot of artificial intelligence, our smart system is able to track activities, walking and sleeping patterns, but most importantly, risk of falling. As if it wasn't enough, all data is fully anonymised and securely stored.
Sounds interesting?Track vulnerable people over time and record crucial health metrics.
Visualise individual health progress on the profile dashboard.
Get notified when somebody is at risk, in time to prevent dangerous outcomes.
The video data is fully anonymised and kept in secure storage.
Ready to find out more on you can help prevent falls? That's great! Leave your email and we will get back to you as soon as possible.
+44-7984-123-679


The EntitySystem object allows the state for a group of objects to be assigned.
An EntitySystem’s state is set to ‘Working’ if any of the objects in the system are working, and to ‘Idle’ if all the objects are idle. An optional keyword StateExpression allows user-defined states to be assigned to the EntitySystem depending on the states of the individual object in the system.
EntitySystem Inputs
|
Keyword |
Description |
|
Key Inputs |
|
|
Description |
A free-form string describing the object. |
|
StateExpression |
An expression returning a string that sets this object's present state. If left blank, the state will be set to Working if any of the entities specified by the WatchList input are working. It will be set to Idle if all of the entities in the WatchList are idle. |
|
WatchList |
A list of objects to monitor. The system's state will be re-calculated whenever one of the WatchList objects changes state. |
|
Options |
|
|
AttributeDefinitionList, CustomOutputList |
See Section 6.2. |
|
Maintenance |
|
|
WorkingStateList |
See Section 10.2. |
|
Graphics |
|
|
Position, Alignment, Size, Orientation, Region, RelativeEntity, DisplayModel, Show, Movable, VisibleViews, DrawRange |
See Section 11.1. |
EntitySystem Outputs
|
Output Name |
Description |
|
Entity and DisplayEntity |
|
|
Name, ObjectType, SimTime, Parent, Attributes, Custom Outputs, Position, Size, Orientation, Alignment, GraphicalLength, ObserverList, NextList, PreviousList |
See Section 10.1. |
|
StateEntity |
|
|
State, WorkingState, WorkingTime, StateTimes, TotalTime |
See Section 10.3. |
|
StateUserEntity |
|
|
Idle, Working, Setup, Maintenance, Breakdown, Stopped, Utilisation, Commitment, Availability, Reliability |
See Section 10.3. |
|
EntitySystem |
|
|
EntityList |
Entities included in this system. Consists of the entities in the WatchList for which a state can be obtained. |


Connect to the MQTT broker via websockets.
Configure the Twipe robot.
Monitor the robot health data points.
Capture and analyse the robot's balance telemetry.


YANBOG - Create Barcodes
Wamas Host IP
Just click and gen all needed barcodes
Create and Send Files to Host


| | |
- aaa_reload(...)
- aaa_reload(tctx) -> None
When the ConfD AAA tree is populated by an external data provider (see the
AAA chapter in the User Guide), this function can be used by the data
provider to notify ConfD when there is a change to the AAA data.
Keyword arguments:
tctx -- a transaction context
- access_reply_result(...)
- access_reply_result(actx, result) -> None
The callbacks must call this function to report the result of the access
check to ConfD, and should normally return CONFD_OK. If any other value is
returned, it will cause the access check to be rejected.
Keyword arguments:
actx -- the authorization context
result -- the result (ACCESS_RESULT_xxx)
- action_delayed_reply_error(...)
- action_delayed_reply_error(uinfo, errstr) -> None
If we use the CONFD_DELAYED_RESPONSE as a return value from the action
callback, we must later asynchronously reply. This function is used to
reply with error.
Keyword arguments:
uinfo -- a user info context
errstr -- an error string
- action_delayed_reply_ok(...)
- action_delayed_reply_ok(uinfo) -> None
If we use the CONFD_DELAYED_RESPONSE as a return value from the action
callback, we must later asynchronously reply. This function is used to
reply with success.
Keyword arguments:
uinfo -- a user info context
- action_reply_command(...)
- action_reply_command(uinfo, values) -> None
If a CLI callback command should return data, it must invoke this function
in response to the cb_command() callback.
Keyword arguments:
uinfo -- a user info context
values -- a list of strings or None
- action_reply_completion(...)
- action_reply_completion(uinfo, values) -> None
This function must normally be called in response to the cb_completion()
callback.
Keyword arguments:
uinfo -- a user info context
values -- a list of 3-tuples or None (see below)
The values argument must be None or a list of 3-tuples where each tuple is
built up like:
(type::int, value::string, extra::string)
The third item of the tuple (extra) may be set to None.
- action_reply_range_enum(...)
- action_reply_range_enum(uinfo, values, keysize) -> None
This function must be called in response to the cb_completion() callback
when it is invoked via a tailf:cli-custom-range-enumerator statement in the
data model.
Keyword arguments:
uinfo -- a user info context
values -- a list of keys as strings or None
keysize -- number of keys for the list in the data model
The values argument is a flat list of keys. If the list in the data model
specifies multiple keys this list is still flat. The keysize argument
tells us how many keys to use for each list element. So the size of values
should be a multiple of keysize.
- action_reply_rewrite(...)
- action_reply_rewrite(uinfo, values, unhides) -> None
This function can be called instead of action_reply_command() as a
response to a show path rewrite callback invocation.
Keyword arguments:
uinfo -- a user info context
values -- a list of strings or None
unhides -- a list of strings or None
- action_reply_rewrite2(...)
- action_reply_rewrite2(uinfo, values, unhides, selects) -> None
This function can be called instead of action_reply_command() as a
response to a show path rewrite callback invocation.
Keyword arguments:
uinfo -- a user info context
values -- a list of strings or None
unhides -- a list of strings or None
selects -- a list of strings or None
- action_reply_values(...)
- action_reply_values(uinfo, values) -> None
If the action definition specifies that the action should return data, it
must invoke this function in response to the cb_action() callback.
Keyword arguments:
uinfo -- a user info context
values -- a list of _lib.TagValue instances or None
- action_set_fd(...)
- action_set_fd(uinfo, sock) -> None
Associate a worker socket with the action. This function must be called in
the action cb_init() callback.
Keyword arguments:
uinfo -- a user info context
sock -- a previously connected worker socket
A typical implementation of an action cb_init() callback looks like:
class ActionCallbacks(object):
def __init__(self, workersock):
self.workersock = workersock
def cb_init(self, uinfo):
dp.action_set_fd(uinfo, self.workersock)
- action_set_timeout(...)
- action_set_timeout(uinfo, timeout_secs) -> None
Some action callbacks may require a significantly longer execution time
than others, and this time may not even be possible to determine statically
(e.g. a file download). In such cases the /confdConfig/capi/queryTimeout
setting in confd.conf may be insufficient, and this function can be used to
extend (or shorten) the timeout for the current callback invocation. The
timeout is given in seconds from the point in time when the function is
called.
Keyword arguments:
uinfo -- a user info context
timeout_secs -- timeout value
- action_seterr(...)
- action_seterr(uinfo, errstr) -> None
If action callback encounters fatal problems that can not be expressed via
the reply function, it may call this function with an appropriate message
and return CONFD_ERR instead of CONFD_OK.
Keyword arguments:
uinfo -- a user info context
errstr -- an error message string
- action_seterr_extended(...)
- action_seterr_extended(uninfo, code, apptag_ns, apptag_tag, errstr) -> None
This function can be used to provide more structured error information
from an action callback.
Keyword arguments:
uinfo -- a user info context
code -- an error code
apptag_ns -- namespace - should be set to 0
apptag_tag -- either 0 or the hash value for a data model node
errstr -- an error message string
- action_seterr_extended_info(...)
- action_seterr_extended_info(uinfo, code, apptag_ns, apptag_tag,
error_info, errstr) -> None
This function can be used to provide structured error information in the
same way as action_seterr_extended(), and additionally provide contents for
the NETCONF <error-info> element.
Keyword arguments:
uinfo -- a user info context
code -- an error code
apptag_ns -- namespace - should be set to 0
apptag_tag -- either 0 or the hash value for a data model node
error_info -- a list of _lib.TagValue instances
errstr -- an error message string
- auth_seterr(...)
- auth_seterr(actx, errstr) -> None
This function is used by the application to set an error string.
This function can be used to provide a text message when the callback
returns CONFD_ERR. If used when rejecting a successful authentication, the
message will be logged in ConfD's audit log (otherwise a generic "rejected
by application callback" message is logged).
Keyword arguments:
actx -- the auth context
errstr -- an error message string
- authorization_set_timeout(...)
- authorization_set_timeout(actx, timeout_secs) -> None
The authorization callbacks are invoked on the daemon control socket, and
as such are expected to complete quickly. However in case they send requests
to a remote server, and such a request needs to be retried, this function
can be used to extend the timeout for the current callback invocation. The
timeout is given in seconds from the point in time when the function is
called.
Keyword arguments:
actx -- the authorization context
timeout_secs -- timeout value
- connect(...)
- connect(dx, sock, type, ip, port, path) -> None
Connects to the ConfD daemon.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
sock -- a Python socket instance
type -- the socket type (CONTROL_SOCKET or WORKER_SOCKET)
ip -- the ip address if socket is AF_INET (optional)
port -- the port if socket is AF_INET (optional)
path -- a filename if socket is AF_UNIX (optional).
- data_reply_attrs(...)
- data_reply_attrs(tctx, attrs) -> None
This function is used by the cb_get_attrs() callback to return the
requested attribute values.
Keyword arguments:
tctx -- a transaction context
attrs - a list of _lib.AttrValue instances
- data_reply_found(...)
- data_reply_found(tctx) -> None
This function is used by the cb_exists_optional() callback to indicate to
ConfD that a node does exist.
Keyword arguments:
tctx -- a transaction context
- data_reply_next_key(...)
- data_reply_next_key(tctx, keys, next) -> None
This function is used by the cb_get_next() and cb_find_next() callbacks to
return the next key.
Keyword arguments:
tctx -- a transaction context
keys -- a list of keys of _lib.Value for a list item (se below)
next -- int value passed to the next invocation of cb_get_next() callback
A list may have mutiple key leafs specified in the data model. This is why
the keys argument must be a list.
- data_reply_next_object_array(...)
- data_reply_next_object_array(tctx, v, next) -> None
This function is used by the optional cb_get_next_object() and
cb_find_next_object() callbacks to return an entire object including its keys.
It combines the functions of data_reply_next_key() and
data_reply_value_array().
Keyword arguments:
tctx -- a transaction context
v -- a list of _lib.Value instances
next -- int value passed to the next invocation of cb_get_next() callback
- data_reply_next_object_arrays(...)
- data_reply_next_object_arrays(tctx, objs, timeout_millisecs) -> None
This function is used by the optional cb_get_next_object() and
cb_find_next_object() callbacks to return multiple objects including their
keys, in _lib.Value form.
Keyword arguments:
tctx -- a transaction context
objs -- a list of tuples or None (see below)
timeout_millisecs -- timeout value for ConfD's caching of returned data
The format of argument objs is list(tuple(list(_lib.Value), long)), or
None to indicate end of list. Another way to indicate end of list is to
include None as the first item in the 2-tuple last in the list.
E.g.:
V = _lib.Value
objs = [
( [ V(1), V(2) ], next1 ),
( [ V(3), V(4) ], next2 ),
( None, -1 )
]
- data_reply_next_object_tag_value_array(...)
- data_reply_next_object_tag_value_array(tctx, tvs, next) -> None
This function is used by the optional cb_get_next_object() and
cb_find_next_object() callbacks to return an entire object including its keys
Keyword arguments:
tctx -- a transaction context
tvs -- a list of _lib.TagValue instances or None
next -- int value passed to the next invocation of cb_get_next_object()
callback
- data_reply_next_object_tag_value_arrays(...)
- data_reply_next_object_tag_value_arrays(tctx, objs, timeout_millisecs) -> None
This function is used by the optional cb_get_next_object() and
cb_find_next_object() callbacks to return multiple objects including their
keys.
Keyword arguments:
tctx -- a transaction context
objs -- a list of tuples or None (see below)
timeout_millisecs -- timeout value for ConfD's caching of returned data
The format of argument objs is list(tuple(list(_lib.TagValue), long)) or
None to indicate end of list. Another way to indicate end of list is to
include None as the first item in the 2-tuple last in the list.
E.g.:
objs = [
( [ tagval1, tagval2 ], next1 ),
( [ tagval3, tagval4, tagval5 ], next2 ),
( None, -1 )
]
- data_reply_not_found(...)
- data_reply_not_found(tctx) -> None
This function is used by the cb_get_elem() and cb_exists_optional()
callbacks to indicate to ConfD that a list entry or node does not exist.
Keyword arguments:
tctx -- a transaction context
- data_reply_tag_value_array(...)
- data_reply_tag_value_array(tctx, tvs) -> None
This function is used to return an array of values, corresponding to a
complete list entry, to ConfD. It can be used by the optional
cb_get_object() callback.
Keyword arguments:
tctx -- a transaction context
tvs -- a list of _lib.TagValue instances or None
- data_reply_value(...)
- data_reply_value(tctx, v) -> None
This function is used to return a single data item to ConfD.
Keyword arguments:
tctx -- a transaction context
v -- a _lib.Value instance
- data_reply_value_array(...)
- data_reply_value_array(tctx, vs) -> None
This function is used to return an array of values, corresponding to a
complete list entry, to ConfD. It can be used by the optional
cb_get_object() callback.
Keyword arguments:
tctx -- a transaction context
vs -- a list of _lib.Value instances
- data_set_timeout(...)
- data_set_timeout(tctx, timeout_secs) -> None
A data callback should normally complete quickly, since e.g. the
execution of a 'show' command in the CLI may require many data callback
invocations. In some rare cases it may still be necessary for a data
callback to have a longer execution time, and then this function can be
used to extend (or shorten) the timeout for the current callback invocation.
The timeout is given in seconds from the point in time when the function is
called.
Keyword arguments:
tctx -- a transaction context
timeout_secs -- timeout value
- db_set_timeout(...)
- db_set_timeout(dbx, timeout_secs) -> None
Some of the DB callbacks registered via register_db_cb(), e.g.
cb_copy_running_to_startup(), may require a longer execution time than
others. This function can be used to extend the timeout for the current
callback invocation. The timeout is given in seconds from the point in
time when the function is called.
Keyword arguments:
dbx -- a db context of _dp.DbCtxRef
timeout_secs -- timeout value
- db_seterr(...)
- db_seterr(dbx, errstr) -> None
This function is used by the application to set an error string.
Keyword arguments:
dbx -- a db context
errstr -- an error message string
- db_seterr_extended(...)
- db_seterr_extended(dbx, code, apptag_ns, apptag_tag, errstr) -> None
This function can be used to provide more structured error information
from a db callback.
Keyword arguments:
dbx -- a db context
code -- an error code
apptag_ns -- namespace - should be set to 0
apptag_tag -- either 0 or the hash value for a data model node
errstr -- an error message string
- db_seterr_extended_info(...)
- db_seterr_extended_info(dbx, code, apptag_ns, apptag_tag,
error_info, errstr) -> None
This function can be used to provide structured error information in the
same way as db_seterr_extended(), and additionally provide contents for
the NETCONF <error-info> element.
Keyword arguments:
dbx -- a db context
code -- an error code
apptag_ns -- namespace - should be set to 0
apptag_tag -- either 0 or the hash value for a data model node
error_info -- a list of _lib.TagValue instances
errstr -- an error message string
- delayed_reply_error(...)
- delayed_reply_error(tctx, errstr) -> None
This function must be used to return an error when tha actual callback
returned CONFD_DELAYED_RESPONSE.
Keyword arguments:
tctx -- a transaction context
errstr -- an error message string
- delayed_reply_ok(...)
- delayed_reply_ok(tctx) -> None
This function must be used to return the equivalent of CONFD_OK when the
actual callback returned CONFD_DELAYED_RESPONSE.
Keyword arguments:
tctx -- a transaction context
- delayed_reply_validation_warn(...)
- delayed_reply_validation_warn(tctx) -> None
This function must be used to return the equivalent of CONFD_VALIDATION_WARN
when the cb_validate() callback returned CONFD_DELAYED_RESPONSE.
Keyword arguments:
tctx -- a transaction context
- error_seterr(...)
- error_seterr(uinfo, errstr) -> None
This function must be called by format_error() (above) to provide a
replacement for the default error message. If format_error() is called
without calling error_seterr() the default message will be used.
Keyword arguments:
uinfo -- a user info context
errstr -- an string describing the error
- fd_ready(...)
- fd_ready(dx, sock) -> None
The database application owns all data provider sockets to ConfD and is
responsible for the polling of these sockets. When one of the ConfD
sockets has I/O ready to read, the application must invoke fd_ready() on
the socket.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
sock -- the socket
- init_daemon(...)
- init_daemon(name) -> _dp.DaemonCtxRef
Initializes and returns a new daemon context.
Keyword arguments:
name -- a string used to uniquely identify the daemon
- install_crypto_keys(...)
- install_crypto_keys(dtx) -> None
It is possible to define DES3 and AES keys inside confd.conf. These keys
are used by ConfD to encrypt data which is entered into the system which
has either of the two builtin types tailf:des3-cbc-encrypted-string or
tailf:aes-cfb-128-encrypted-string.
This function will copy those keys from ConfD (which reads confd.conf) into
memory in the library.
This function must be called before register_done() is called.
Keyword arguments:
dtx -- a daemon context wich is connected through a call to connect()
- notification_flush(...)
- notification_flush(nctx) -> None
Notifications are sent asynchronously, i.e. normally without blocking the
caller of the send functions described above. This means that in some cases
ConfD's sending of the notifications on the northbound interfaces may lag
behind the send calls. This function can be used to make sure that the
notifications have actually been sent out.
Keyword arguments:
nctx -- notification context returned from register_notification_stream()
- notification_replay_complete(...)
- notification_replay_complete(nctx) -> None
The application calls this function to notify ConfD that the replay is
complete
Keyword arguments:
nctx -- notification context returned from register_notification_stream()
- notification_replay_failed(...)
- notification_replay_failed(nctx) -> None
In case the application fails to complete the replay as requested (e.g. the
log gets overwritten while the replay is in progress), the application
should call this function instead of notification_replay_complete(). An
error message describing the reason for the failure can be supplied by
first calling notification_seterr() or notification_seterr_extended().
Keyword arguments:
nctx -- notification context returned from register_notification_stream()
- notification_reply_log_times(...)
- notification_reply_log_times(nctx, creation, aged) -> None
Reply function for use in the cb_get_log_times() callback invocation. If no
notifications have been aged out of the log, give None for the aged argument.
Keyword arguments:
nctx -- notification context returned from register_notification_stream()
creation -- a _lib.DateTime instance
aged -- a _lib.DateTime instance or None
- notification_send(...)
- notification_send(nctx, time, values) -> None
This function is called by the application to send a notification, whether
"live" or replay.
Keyword arguments:
nctx -- notification context returned from register_notification_stream()
time -- a _lib.DateTime instance
values -- a list of _lib.TagValue instances or None
- notification_send_snmp(...)
- notification_send_snmp(nctx, notification, varbinds) -> None
Sends the SNMP notification specified by 'notification', without requesting
inform-request delivery information. This is equivalent to calling
notification_send_snmp_inform() with None as the cb_id argument. I.e. if
the common arguments are the same, the two functions will send the exact
same set of traps and inform-requests.
Keyword arguments:
nctx -- notification context returned from register_snmp_notification()
notification -- the notification string
varbinds -- a list of _lib.SnmpVarbind instances or None
- notification_send_snmp_inform(...)
- notification_send_snmp_inform(nctx, notification, varbinds, cb_id, ref) ->None
Sends the SNMP notification specified by notification. If cb_id is not None
the callbacks registered for cb_id will be invoked with the ref argument.
Keyword arguments:
nctx -- notification context returned from register_snmp_notification()
notification -- the notification string
varbinds -- a list of _lib.SnmpVarbind instances or None
cb_id -- callback id
ref -- argument send to callbacks
- notification_set_fd(...)
- notification_set_fd(nctx, sock) -> None
This function may optionally be called by the cb_replay() callback to
request that the worker socket given by 'sock' should be used for the
replay. Otherwise the socket specified in register_notification_stream()
will be used.
Keyword arguments:
nctx -- notification context returned from register_notification_stream()
sock -- a previously connected worker socket
- notification_set_snmp_notify_name(...)
- notification_set_snmp_notify_name(nctx, notify_name) -> None
This function can be used to change the snmpNotifyName (notify_name) for
the nctx context.
Keyword arguments:
nctx -- notification context returned from register_snmp_notification()
notify_name -- the snmpNotifyName
- notification_set_snmp_src_addr(...)
- notification_set_snmp_src_addr(nctx, family, src_addr) -> None
By default, the source address for the SNMP notifications that are sent by
the above functions is chosen by the IP stack of the OS. This function may
be used to select a specific source address, given by src_addr, for the
SNMP notifications subsequently sent using the nctx context. The default
can be restored by calling the function with family set to AF_UNSPEC.
Keyword arguments:
nctx -- notification context returned from register_snmp_notification()
family -- AF_INET, AF_INET6 or AF_UNSPEC
src_addr -- the source address in string format
- notification_seterr(...)
- notification_seterr(nctx, errstr) -> None
In some cases the callbacks may be unable to carry out the requested
actions, e.g. the capacity for simultaneous replays might be exceeded, and
they can then return CONFD_ERR. This function allows the callback to
associate an error message with the failure. It can also be used to supply
an error message before calling notification_replay_failed().
Keyword arguments:
nctx -- notification context returned from register_notification_stream()
errstr -- an error message string
- notification_seterr_extended(...)
- notification_seterr_extended(nctx, code, apptag_ns, apptag_tag, errstr) ->None
This function can be used to provide more structured error information
from a notification callback.
Keyword arguments:
nctx -- notification context returned from register_notification_stream()
code -- an error code
apptag_ns -- namespace - should be set to 0
apptag_tag -- either 0 or the hash value for a data model node
errstr -- an error message string
- notification_seterr_extended_info(...)
- notification_seterr_extended_info(nctx, code, apptag_ns, apptag_tag,
error_info, errstr) -> None
This function can be used to provide structured error information in the
same way as notification_seterr_extended(), and additionally provide
contents for the NETCONF <error-info> element.
Keyword arguments:
nctx -- notification context returned from register_notification_stream()
code -- an error code
apptag_ns -- namespace - should be set to 0
apptag_tag -- either 0 or the hash value for a data model node
error_info -- a list of _lib.TagValue instances
errstr -- an error message string
- register_action_cbs(...)
- register_action_cbs(dx, actionpoint, acb) -> None
This function registers up to five callback functions, two of which will
be called in sequence when an action is invoked.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
actionpoint -- the name of the action point
vcb -- the callback instance (see below)
The acb argument should be an instance of a class with callback methods.
E.g.:
class ActionCallbacks(object):
def cb_init(self, uinfo):
pass
def cb_abort(self, uinfo):
pass
def cb_action(self, uinfo, name, kp, params):
pass
def cb_command(self, uinfo, path, argv):
pass
def cb_completion(self, uinfo, cli_style, token, completion_char,
kp, cmdpath, cmdparam_id, simpleType, extra):
pass
acb = ActionCallbacks()
dp.register_action_cbs(dx, 'actionpoint-1', acb)
Notes about some of the callbacks:
cb_action()
The params argument is a list of _lib.TagValue instances.
cb_command()
The argv argument is a list of strings.
- register_auth_cb(...)
- register_auth_cb(dx, acb) -> None
Registers the authentication callback.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
abc -- the callback instance (see below)
E.g.:
class AuthCallbacks(object):
def cb_auth(self, actx):
pass
acb = AuthCallbacks()
dp.register_auth_cb(dx, acb)
- register_authorization_cb(...)
- register_authorization_cb(dx, acb, cmd_filter, data_filter) -> None
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
abc -- the callback instance (see below)
cmd_filter -- set to 0 for no filtering
data_filter -- set to 0 for no filtering
E.g.:
class AuthorizationCallbacks(object):
def cb_chk_cmd_access(self, actx, cmdtokens, cmdop):
pass
def cb_chk_data_access(self, actx, hashed_ns, hkp, dataop, how):
pass
acb = AuthCallbacks()
dp.register_authorization_cb(dx, acb)
- register_data_cb(...)
- register_data_cb(dx, callpoint, data) -> None
Registers data manipulation callback functions.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
callpoint -- name of a tailf:callpoint in the data model
data -- the callback instance (see below)
The data argument should be an instance of a class with callback methods.
E.g.:
class DataCallbacks(object):
def cb_exists_optional(self, tctx, kp):
pass
def cb_get_elem(self, tctx, kp):
pass
def cb_get_next(self, tctx, kp, next):
pass
def cb_set_elem(self, tctx, kp, newval):
pass
def cb_create(self, tctx, kp):
pass
def cb_remove(self, tctx, kp):
pass
def cb_find_next(self, tctx, kp, type, keys):
pass
def cb_num_instances(self, tctx, kp):
pass
def cb_get_object(self, tctx, kp):
pass
def cb_get_next_object(self, tctx, kp, next):
pass
def cb_find_next_object(self, tctx, kp, type, keys):
pass
def cb_get_case(self, tctx, kp, choice):
pass
def cb_set_case(self, tctx, kp, choice, caseval):
pass
def cb_get_attrs(self, tctx, kp, attrs):
pass
def cb_set_attr(self, tctx, kp, attr, v):
pass
def cb_move_after(self, tctx, kp, prevkeys):
pass
def cb_write_all(self, tctx, kp):
pass
dcb = DataCallbacks()
dp.register_data_cb(dx, 'example-callpoint-1', dcb)
- register_db_cb(...)
- register_db_cb(dx, dbcbs) -> None
This function is used to set callback functions which span over several
ConfD transactions.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
dbcbs -- the callback instance (see below)
The dbcbs argument should be an instance of a class with callback methods.
E.g.:
class DbCallbacks(object):
def cb_candidate_commit(self, dbx, timeout):
pass
def cb_candidate_confirming_commit(self, dbx):
pass
def cb_candidate_reset(self, dbx):
pass
def cb_candidate_chk_not_modified(self, dbx):
pass
def cb_candidate_rollback_running(self, dbx):
pass
def cb_candidate_validate(self, dbx):
pass
def cb_add_checkpoint_running(self, dbx):
pass
def cb_del_checkpoint_running(self, dbx):
pass
def cb_activate_checkpoint_running(self, dbx):
pass
def cb_copy_running_to_startup(self, dbx):
pass
def cb_running_chk_not_modified(self, dbx):
pass
def cb_lock(self, dbx, dbname):
pass
def cb_unlock(self, dbx, dbname):
pass
def cb_lock_partial(self, dbx, dbname, lockid, paths):
pass
def cb_ulock_partial(self, dbx, dbname, lockid):
pass
def cb_delete_confid(self, dbx, dbname):
pass
dbcbs = DbCallbacks()
dp.register_db_cb(dx, dbcbs)
- register_done(...)
- register_done(dx) -> None
When we have registered all the callbacks for a daemon (including the other
types described below if we have them), we must call this function to
synchronize with ConfD. No callbacks will be invoked until it has been
called, and after the call, no further registrations are allowed.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
- register_error_cb(...)
- register_error_cb(dx, errortypes, ecbs) -> None
This funciton can be used to register error callbacks that are
invoked for internally generated errors.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
errortypes -- logical OR of the error types that the ecbs should handle
ecbs -- the callback instance (see below)
E.g.:
class ErrorCallbacks(object):
def cb_format_error(self, uinfo, errinfo_dict, default_msg):
dp.error_seterr(uinfo, default_msg)
ecbs = ErrorCallbacks()
dp.register_error_cb(ctx,
dp.ERRTYPE_BAD_VALUE |
dp.ERRTYPE_MISC, ecbs)
dp.register_done(ctx)
- register_notification_snmp_inform_cb(...)
- register_notification_snmp_inform_cb(dx, cb_id, cbs) -> None
If we want to receive information about the delivery of SNMP
inform-requests, we must register two callbacks for this.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
cb_id -- the callback identifier
cbs -- the callback instance (see below)
E.g.:
class NotifySnmpCallbacks(object):
def cb_targets(self, nctx, ref, targets):
pass
def cb_result(self, nctx, ref, target, got_response):
pass
cbs = NotifySnmpCallbacks()
dp.register_notification_snmp_inform_cb(dx, 'callback-id-1', cbs)
- register_notification_stream(...)
- register_notification_stream(dx, ncbs, sock, streamname) -> _dp.NotificationCtxRef
This function registers the notification stream and optionally two callback
functions used for the replay functionality.
The returned notification context must be used by the application for the
sending of live notifications via notification_send().
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
ncbs -- the callback instance (see below)
sock -- a previously connected worker socket
streamname -- the name of the notification stream
E.g.:
class NotificationCallbacks(object):
def cb_get_log_times(self, nctx):
pass
def cb_replay(self, nctx, start, stop):
pass
ncbs = NotificationCallbacks()
livectx = dp.register_notification_stream(dx, ncbs, workersock,
'streamname')
- register_notification_sub_snmp_cb(...)
- register_notification_sub_snmp_cb(dx, sub_id, cbs) -> None
Registers a callback function to be called when an SNMP notification is
received by the SNMP gateway.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
sub_id -- the subscription id for the notifications
cbs -- the callback instance (see below)
E.g.:
class NotifySubSnmpCallbacks(object):
def cb_recv(self, nctx, notification, varbinds, src_addr, port):
pass
cbs = NotifySubSnmpCallbacks()
dp.register_notification_sub_snmp_cb(dx, 'sub-id-1', cbs)
- register_range_action_cbs(...)
- register_range_action_cbs(dx, actionpoint, acb, lower, upper, path) -> None
A variant of register_action_cbs() which registers action callbacks for a
range of key values. The lower, upper, and path arguments are the same as
for register_range_data_cb().
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
actionpoint -- the name of the action point
data -- the callback instance (see register_action_cbs())
lower -- a list of Value's or None
upper -- a list of Value's or None
path -- path for the list (string)
- register_range_data_cb(...)
- register_range_data_cb(dx, callpoint, data, lower, upper, path) -> None
This is a variant of register_data_cb() which registers a set of callbacks
for a range of list entries.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
callpoint -- name of a tailf:callpoint in the data model
data -- the callback instance (see register_data_cb())
lower -- a list of Value's or None
upper -- a list of Value's or None
path -- path for the list (string)
- register_range_valpoint_cb(...)
- register_range_valpoint_cb(dx, valpoint, vcb, lower, upper, path) -> None
A variant of register_valpoint_cb() which registers a validation function
for a range of key values. The lower, upper and path arguments are the same
as for register_range_data_cb().
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
valpoint -- name of a validation point
data -- the callback instance (see register_valpoint_cb())
lower -- a list of Value's or None
upper -- a list of Value's or None
path -- path for the list (string)
- register_snmp_notification(...)
- register_snmp_notification(dx, sock, notify_name, ctx_name) ->_dp.NotificationCtxRef
SNMP notifications can also be sent via the notification framework, however
most aspects of the stream concept do not apply for SNMP. This function is
used to register a worker socket, the snmpNotifyName (notify_name), and
SNMP context (ctx_name) to be used for the notifications.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
sock -- a previously connected worker socket
notify_name -- the snmpNotifyName
ctx_name -- the SNMP context
- register_trans_cb(...)
- register_trans_cb(dx, trans) -> None
Registers transaction callback functions.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
trans -- the callback instance (see below)
The trans argument should be an instance of a class with callback methods.
E.g.:
class TransCallbacks(object):
def cb_init(self, tctx):
pass
def cb_trans_lock(self, tctx):
pass
def cb_trans_unlock(self, tctx):
pass
def cb_write_start(self, tctx):
pass
def cb_prepare(self, tctx):
pass
def cb_abort(self, tctx):
pass
def cb_commit(self, tctx):
pass
def cb_finish(self, tctx):
pass
def cb_interrupt(self, tctx):
pass
tcb = TransCallbacks()
dp.register_trans_cb(dx, tcb)
- register_trans_validate_cb(...)
- register_trans_validate_cb(dx, vcbs) -> None
This function installs two callback functions for the daemon context. One
function that gets called when the validation phase starts in a transaction
and one when the validation phase stops in a transaction.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
vcbs -- the callback instance (see below)
The vcbs argument should be an instance of a class with callback methods.
E.g.:
class TransValidateCallbacks(object):
def cb_init(self, tctx):
pass
def cb_stop(self, tctx):
pass
vcbs = TransValidateCallbacks()
dp.register_trans_validate_cb(dx, vcbs)
- register_usess_cb(...)
- register_usess_cb(dx, ucb) -> None
This function can be used to register information callbacks that are
invoked for user session start and stop.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
ucb -- the callback instance (see below)
E.g.:
class UserSessionCallbacks(object):
def cb_start(self, dx, uinfo):
pass
def cb_stop(self, dx, uinfo):
pass
ucb = UserSessionCallbacks()
dp.register_usess_cb(dx, acb)
- register_valpoint_cb(...)
- register_valpoint_cb(dx, valpoint, vcb) -> None
We must also install an actual validation function for each validation
point, i.e. for each tailf:validate statement in the YANG data model.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
valpoint -- the name of the validation point
vcb -- the callback instance (see below)
The vcb argument should be an instance of a class with a callback method.
E.g.:
class ValpointCallback(object):
def cb_validate(self, tctx, kp, newval):
pass
vcb = ValpointCallback()
dp.register_valpoint_cb(dx, 'valpoint-1', vcb)
- release_daemon(...)
- release_daemon(dx) -> None
Releases all memory that has been allocated by init_daemon() and other
functions for the daemon context.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
- set_daemon_flags(...)
- set_daemon_flags(dx, flags) -> None
Modifies the API behaviour according to the flags ORed into the flags
argument.
Keyword arguments:
dx -- a daemon context acquired through a call to init_daemon()
flags -- the flags to set
- trans_set_fd(...)
- trans_set_fd(tctx, sock) -> None
Associate a worker socket with the transaction, or validation phase. This
function must be called in the transaction and validation cb_init()
callbacks.
Keyword arguments:
tctx -- a transaction context
sock -- a previously connected worker socket
A minimal implementation of a transaction cb_init() callback looks like:
class TransCb(object):
def __init__(self, workersock):
self.workersock = workersock
def cb_init(self, tctx):
dp.trans_set_fd(tctx, self.workersock)
- trans_seterr(...)
- trans_seterr(tctx, errstr) -> None
This function is used by the application to set an error string.
Keyword arguments:
tctx -- a transaction context
errstr -- an error message string
- trans_seterr_extended(...)
- trans_seterr_extended(tctx, code, apptag_ns, apptag_tag, errstr) -> None
This function can be used to provide more structured error information
from a transaction or data callback.
Keyword arguments:
tctx -- a transaction context
code -- an error code
apptag_ns -- namespace - should be set to 0
apptag_tag -- either 0 or the hash value for a data model node
errstr -- an error message string
- trans_seterr_extended_info(...)
- trans_seterr_extended_info(tctx, code, apptag_ns, apptag_tag,
error_info, errstr) -> None
This function can be used to provide structured error information in the
same way as trans_seterr_extended(), and additionally provide contents for
the NETCONF <error-info> element.
Keyword arguments:
tctx -- a transaction context
code -- an error code
apptag_ns -- namespace - should be set to 0
apptag_tag -- either 0 or the hash value for a data model node
error_info -- a list of _lib.TagValue instances
errstr -- an error message string
|


Email<EMAIL_ADDRESS>Send Email Download a PDF version of my resume
Download a PDF version of my resume