Chapter 15 Mediation & Moderation
These notes are adapted from this tutorial: Mediation and moderation
Mediation analysis tests a hypothetical causal chain where one variable X affects a second variable M and, in turn, that variable affects a third variable Y. Mediators describe the how or why of a (typically well-established) relationship between two other variables and are sometimes called intermediary variables since they often describe the process through which an effect occurs. This is also sometimes called an indirect effect. For instance, people with higher incomes tend to live longer but this effect is explained by the mediating influence of having access to better health care.
15.1 Learning goals
- Simulating a mediation analysis.
- Baron and Kenny’s (1986) steps for mediation.
- Testing the significance of a mediation.
- Sobel test.
- Bootstrapping.
- Bayesian approach.
- Limitations of mediation analysis.
- Simulating a moderator effect.
15.3 Load packages and set plotting theme
library("knitr") # for knitting RMarkdown
library("kableExtra") # for making nice tables
library("janitor") # for cleaning column names
library("mediation") # for mediation and moderation analysis
library("multilevel") # Sobel test
library("broom") # tidying up regression results
library("DiagrammeR") # for drawing diagrams
library("DiagrammeRsvg") # for exporting pdfs of graphs
library("rsvg") # for exporting pdfs of graphs
library("tidyverse") # for wrangling, plotting, etc.
15.4 Controlling for variables
15.4.1 Illustration of the d-separation algorithm
- Question: Are D and E independent?
<IP_ADDRESS> Full DAG
g = grViz("
digraph neato {
graph[layout = neato]
# general settings for all nodes
node [
shape = circle,
style = filled,
color = black,
label = ''
fontname = 'Helvetica',
fontsize = 16,
fillcolor = lightblue
]
# labels for each node
a [label = 'A' pos = '0,0!']
b [label = 'B' pos = '2,0!']
c [label = 'C' pos = '1,-1!']
d [label = 'D' pos = '0,-2!']
e [label = 'E' pos = '2,-2!']
f [label = 'F' pos = '1,-3!']
g [label = 'G' pos = '0,-4!']
# edges between nodes
edge [color = black]
a -> c
b -> c
c -> {d e}
d -> f
f -> g
# direction in which arrows are drawn (from left to right)
rankdir = LR
}
")
# export as pdf
# g %>%
# export_svg %>%
# charToRaw %>%
# rsvg_pdf("figures/dag.pdf")
# show plot
g
<IP_ADDRESS> Draw the ancestral graph
g = grViz("
digraph neato {
graph[layout = neato]
# general settings for all nodes
node [
shape = circle,
style = filled,
color = black,
label = ''
fontname = 'Helvetica',
fontsize = 16,
fillcolor = lightblue
]
# labels for each node
a [label = 'A' pos = '0,0!']
b [label = 'B' pos = '2,0!']
c [label = 'C' pos = '1,-1!']
d [label = 'D' pos = '0,-2!']
e [label = 'E' pos = '2,-2!']
# edges between nodes
edge [color = black]
a -> c
b -> c
c -> {d e}
# direction in which arrows are drawn (from left to right)
rankdir = LR
}
")
# export as pdf
# g %>%
# export_svg %>%
# charToRaw %>%
# rsvg_pdf("figures/ancestral_graph.pdf")
# show plot
g
<IP_ADDRESS> “Moralize” the ancestral graph by “marrying” any parents, and disorient by replacing arrows with edges
g = grViz("
graph neato {
graph[layout = neato]
# general settings for all nodes
node [
shape = circle,
style = filled,
color = black,
label = ''
fontname = 'Helvetica',
fontsize = 16,
fillcolor = lightblue
]
# labels for each node
a [label = 'A' pos = '0,0!']
b [label = 'B' pos = '2,0!']
c [label = 'C' pos = '1,-1!']
d [label = 'D' pos = '0,-2!']
e [label = 'E' pos = '2,-2!']
# edges between nodes
edge [color = black]
a -- c
b -- c
c -- {d e}
edge [color = black]
a -- b
# direction in which arrows are drawn (from left to right)
rankdir = LR
}
")
# export as pdf
# g %>%
# export_svg %>%
# charToRaw %>%
# rsvg_pdf("figures/moralize_and_disorient.pdf")
# show plot
g
- For the case in which we check whether D and E are independent conditioned on C
g = grViz("
graph neato {
graph[layout = neato]
# general settings for all nodes
node [
shape = circle,
style = filled,
color = black,
label = ''
fontname = 'Helvetica',
fontsize = 16,
fillcolor = lightblue
]
# labels for each node
a [label = 'A' pos = '0,0!']
b [label = 'B' pos = '2,0!']
d [label = 'D' pos = '0,-2!']
e [label = 'E' pos = '2,-2!']
# edges between nodes
edge [color = black]
edge [color = black]
a -- b
# direction in which arrows are drawn (from left to right)
rankdir = LR
}
")
## export as pdf
#g %>%
# export_svg %>%
# charToRaw %>%
# rsvg_pdf("figures/moralize_and_disorient2.pdf")
# show plot
g
15.4.2 Good controls
<IP_ADDRESS> Common cause (with direct link between X and Y)
<IP_ADDRESS>.1 DAG
g = grViz("
digraph neato {
graph[layout = neato]
# general settings for all nodes
node [
shape = circle,
style = filled,
color = black,
label = ''
fontname = 'Helvetica',
fontsize = 16,
fillcolor = lightblue
]
# labels for each node
x [label = 'X' pos = '0,0!']
y [label = 'Y' pos = '2,0!']
z [label = 'Z' pos = '1,1!', fontcolor = 'red']
# edges between nodes
edge [color = black]
x -> y
z -> {x y}
# direction in which arrows are drawn (from left to right)
rankdir = LR
}
")
# export as pdf
# g %>%
# export_svg %>%
# charToRaw %>%
# rsvg_pdf("figures/common_cause1.pdf")
# show plot
g
<IP_ADDRESS>.2 Regression
set.seed(1)
n = 1000
b_zx = 2
b_xy = 2
b_zy = 2
sd = 1
fun_error = function(n, sd){
rnorm(n = n,
mean = 0,
sd = sd)
}
df = tibble(z = fun_error(n, sd),
x = b_zx * z + fun_error(n, sd),
y = b_zy * z + b_xy * x + fun_error(n, sd))
# without control
lm(formula = y ~ x,
data = df) %>%
summary()
##
## Call:
## lm(formula = y ~ x, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.6011 -0.9270 -0.0506 0.9711 4.0454
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.02449 0.04389 0.558 0.577
## x 2.82092 0.01890 149.225 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.388 on 998 degrees of freedom
## Multiple R-squared: 0.9571, Adjusted R-squared: 0.9571
## F-statistic: 2.227e+04 on 1 and 998 DF, p-value: < 2.2e-16
##
## Call:
## lm(formula = y ~ x + z, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.6151 -0.6564 -0.0223 0.6815 2.8132
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.01624 0.03260 0.498 0.618
## x 2.02202 0.03135 64.489 <2e-16 ***
## z 2.00501 0.07036 28.497 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.031 on 997 degrees of freedom
## Multiple R-squared: 0.9764, Adjusted R-squared: 0.9763
## F-statistic: 2.059e+04 on 2 and 997 DF, p-value: < 2.2e-16
<IP_ADDRESS>.3 Moralize and disorient the ancestral graph
g = grViz("
graph neato {
graph[layout = neato]
# general settings for all nodes
node [
shape = circle,
style = filled,
color = black,
label = ''
fontname = 'Helvetica',
fontsize = 16,
fillcolor = lightblue
]
# labels for each node
x [label = 'X' pos = '0,0!']
y [label = 'Y' pos = '2,0!']
z [label = 'Z' pos = '1,1!', fontcolor = 'red']
# edges between nodes
edge [color = black]
x -- y
z -- {x y}
# direction in which arrows are drawn (from left to right)
rankdir = LR
}
")
# export as pdf
# g %>%
# export_svg %>%
# charToRaw %>%
# rsvg_pdf("figures/common_cause1_undirected.pdf")
# # rsvg_pdf("figures/common_cause1_undirected2.pdf")
# show plot
g
<IP_ADDRESS> Common cause (without direct link between X and Y)
<IP_ADDRESS>.1 DAG
g = grViz("
digraph neato {
graph[layout = neato]
# general settings for all nodes
node [
shape = circle,
style = filled,
color = black,
label = ''
fontname = 'Helvetica',
fontsize = 16,
fillcolor = lightblue
]
# labels for each node
x [label = 'X' pos = '0,0!']
y [label = 'Y' pos = '2,0!']
z [label = 'Z' pos = '1,1!', fontcolor = 'red']
# edges between nodes
edge [color = black]
z -> {x y}
# direction in which arrows are drawn (from left to right)
rankdir = LR
}
")
# export as pdf
# g %>%
# export_svg %>%
# charToRaw %>%
# rsvg_pdf("figures/common_cause2.pdf")
# show plot
g
<IP_ADDRESS>.2 Regression
set.seed(1)
n = 1000
b_zx = 2
b_zy = 2
sd = 1
fun_error = function(n, sd){
rnorm(n = n,
mean = 0,
sd = sd)
}
df = tibble(z = fun_error(n, sd),
x = b_zx * z + fun_error(n, sd),
y = b_zy * z + fun_error(n, sd))
# without control
lm(formula = y ~ x,
data = df) %>%
summary()
##
## Call:
## lm(formula = y ~ x, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -4.6011 -0.9270 -0.0506 0.9711 4.0454
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.02449 0.04389 0.558 0.577
## x 0.82092 0.01890 43.426 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.388 on 998 degrees of freedom
## Multiple R-squared: 0.6539, Adjusted R-squared: 0.6536
## F-statistic: 1886 on 1 and 998 DF, p-value: < 2.2e-16
##
## Call:
## lm(formula = y ~ x + z, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.6151 -0.6564 -0.0223 0.6815 2.8132
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.01624 0.03260 0.498 0.618
## x 0.02202 0.03135 0.702 0.483
## z 2.00501 0.07036 28.497 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.031 on 997 degrees of freedom
## Multiple R-squared: 0.8093, Adjusted R-squared: 0.8089
## F-statistic: 2115 on 2 and 997 DF, p-value: < 2.2e-16
15.4.3 Bad controls
<IP_ADDRESS> Common effect (with direct link)
<IP_ADDRESS>.1 DAG
g = grViz("
digraph neato {
graph[layout = neato]
# general settings for all nodes
node [
shape = circle,
style = filled,
color = black,
label = ''
fontname = 'Helvetica',
fontsize = 16,
fillcolor = lightblue
]
# labels for each node
x [label = 'X' pos = '0,0!']
y [label = 'Y' pos = '2,0!']
z [label = 'Z' pos = '1,-1!', fontcolor = 'red']
# edges between nodes
edge [color = black]
x -> y
x -> z
y -> z
# direction in which arrows are drawn (from left to right)
rankdir = LR
}
")
# export as pdf
# g %>%
# export_svg %>%
# charToRaw %>%
# rsvg_pdf("figures/common_effect_with_direct_link.pdf")
# show plot
g
<IP_ADDRESS>.2 Regression
set.seed(2)
n = 100
b_xy = 2
b_xz = 2
b_yz = 2
sd = 1
fun_error = function(n, sd){
rnorm(n = n,
mean = 0,
sd = sd)
}
df = tibble(x = fun_error(n, sd),
y = x * b_xy + fun_error(n, sd),
z = x * b_xz + y * b_yz + fun_error(n, sd))
# without control
lm(formula = y ~ x,
data = df) %>%
summary()
##
## Call:
## lm(formula = y ~ x, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.1496 -0.8196 0.1370 0.7195 2.0560
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.02777 0.09892 0.281 0.78
## x 1.95290 0.08566 22.798 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.9888 on 98 degrees of freedom
## Multiple R-squared: 0.8414, Adjusted R-squared: 0.8397
## F-statistic: 519.8 on 1 and 98 DF, p-value: < 2.2e-16
##
## Call:
## lm(formula = y ~ x + z, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.21227 -0.28384 0.01043 0.26406 1.35276
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.04969 0.04783 -1.039 0.3014
## x -0.35095 0.13417 -2.616 0.0103 *
## z 0.39211 0.02173 18.045 <2e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.4762 on 97 degrees of freedom
## Multiple R-squared: 0.9636, Adjusted R-squared: 0.9628
## F-statistic: 1284 on 2 and 97 DF, p-value: < 2.2e-16
<IP_ADDRESS>.3 Moralize and disorient the ancestral graph
g = grViz("
graph neato {
graph[layout = neato]
# general settings for all nodes
node [
shape = circle,
style = filled,
color = black,
label = ''
fontname = 'Helvetica',
fontsize = 16,
fillcolor = lightblue
]
# labels for each node
x [label = 'X' pos = '0,0!']
y [label = 'Y' pos = '2,0!']
z [label = 'Z' pos = '1,-1!', fontcolor = 'red']
# edges between nodes
edge [color = black]
x -- y
x -- z
y -- z
# direction in which arrows are drawn (from left to right)
rankdir = LR
}
")
# export as pdf
# g %>%
# export_svg %>%
# charToRaw %>%
# rsvg_pdf("figures/common_effect_with_direct_link_undirected1.pdf")
# # rsvg_pdf("figures/common_effect_with_direct_link_undirected2.pdf")
# show plot
g
<IP_ADDRESS> Causal chain 1
<IP_ADDRESS>.1 DAG
g = grViz("
digraph neato {
graph[layout = neato]
# general settings for all nodes
node [
shape = circle,
style = filled,
color = black,
label = ''
fontname = 'Helvetica',
fontsize = 16,
fillcolor = lightblue
]
# labels for each node
x [label = 'X' pos = '0,0!']
y [label = 'Y' pos = '2,0!']
z [label = 'Z' pos = '1, 0!', fontcolor = 'red']
# edges between nodes
edge [color = black]
x -> z
z -> y
# direction in which arrows are drawn (from left to right)
rankdir = LR
}
")
# # export as pdf
# g %>%
# export_svg %>%
# charToRaw %>%
# rsvg_pdf("figures/causal_chain.pdf")
# show plot
g
<IP_ADDRESS>.2 Regression
set.seed(1)
n = 20
b_xz = 2
b_zy = 2
sd = 1
fun_error = function(n, sd){
rnorm(n = n,
mean = 0,
sd = sd)
}
df = tibble(x = fun_error(n, sd),
z = x * b_xz + fun_error(n, sd),
y = z * b_zy + fun_error(n, sd))
# without control
lm(formula = y ~ x,
data = df) %>%
summary()
##
## Call:
## lm(formula = y ~ x, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -3.336 -1.208 0.209 1.220 3.189
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.1547 0.3982 0.388 0.702
## x 3.8488 0.4374 8.799 6.15e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.741 on 18 degrees of freedom
## Multiple R-squared: 0.8114, Adjusted R-squared: 0.8009
## F-statistic: 77.43 on 1 and 18 DF, p-value: 6.154e-08
##
## Call:
## lm(formula = y ~ x + z, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.35959 -0.56643 -0.06193 0.48088 1.80592
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.09559 0.18177 0.526 0.606
## x 0.64724 0.43278 1.496 0.153
## z 1.78614 0.21425 8.337 2.07e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.7943 on 17 degrees of freedom
## Multiple R-squared: 0.9629, Adjusted R-squared: 0.9586
## F-statistic: 220.8 on 2 and 17 DF, p-value: 6.868e-13
<IP_ADDRESS> Causal chain 2
<IP_ADDRESS>.1 DAG
g = grViz("
digraph neato {
graph[layout = neato]
# general settings for all nodes
node [
shape = circle,
style = filled,
color = black,
label = ''
fontname = 'Helvetica',
fontsize = 16,
fillcolor = lightblue
]
# labels for each node
x [label = 'X' pos = '0,0!']
y [label = 'Y' pos = '1,0!']
z [label = 'Z' pos = '2, 0!', fontcolor = 'red']
# edges between nodes
edge [color = black]
x -> y
y -> z
# direction in which arrows are drawn (from left to right)
rankdir = LR
}
")
# # export as pdf
# g %>%
# export_svg %>%
# charToRaw %>%
# rsvg_pdf("figures/causal_chain2.pdf")
# show plot
g
<IP_ADDRESS>.2 Regression
set.seed(1)
n = 20
b_xy = 2
b_yz = 2
sd = 1
fun_error = function(n, sd){
rnorm(n = n,
mean = 0,
sd = sd)
}
df = tibble(x = fun_error(n, sd),
y = x * b_xy + fun_error(n, sd),
z = y * b_yz + fun_error(n, sd),)
# without control
lm(formula = y ~ x,
data = df) %>%
summary()
##
## Call:
## lm(formula = y ~ x, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.69133 -0.43739 -0.07132 0.68033 1.63937
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.03307 0.19981 0.166 0.87
## x 1.79245 0.21951 8.166 1.83e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.8738 on 18 degrees of freedom
## Multiple R-squared: 0.7874, Adjusted R-squared: 0.7756
## F-statistic: 66.68 on 1 and 18 DF, p-value: 1.827e-07
##
## Call:
## lm(formula = y ~ x + z, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -0.9023 -0.2316 0.1173 0.2396 0.6319
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -0.03650 0.09153 -0.399 0.695
## x 0.06113 0.23056 0.265 0.794
## z 0.44983 0.05396 8.337 2.07e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 0.3986 on 17 degrees of freedom
## Multiple R-squared: 0.9582, Adjusted R-squared: 0.9533
## F-statistic: 195 on 2 and 17 DF, p-value: 1.896e-12
<IP_ADDRESS> Bias amplification
<IP_ADDRESS>.1 DAG
g = grViz("
digraph neato {
graph[layout = neato]
# general settings for all nodes
node [
shape = circle,
style = filled,
color = black,
label = ''
fontname = 'Helvetica',
fontsize = 16,
fillcolor = lightblue
]
# labels for each node
x [label = 'X' pos = '0,0!']
y [label = 'Y' pos = '2,0!']
z [label = 'Z' pos = '-1, 1!', fontcolor = 'red']
u [label = 'U' pos = '1, 1!', fillcolor = 'white']
# edges between nodes
edge [color = black]
x -> y
z -> x
u -> {x y}
# direction in which arrows are drawn (from left to right)
rankdir = LR
}
")
# # export as pdf
# g %>%
# export_svg %>%
# charToRaw %>%
# rsvg_pdf("figures/bias_amplification.pdf")
# show plot
g
<IP_ADDRESS> Regression
set.seed(1)
n = 20
b_xy = 2
b_ux = 2
b_uy = 2
b_zx = 2
sd = 1
fun_error = function(n, sd){
rnorm(n = n,
mean = 0,
sd = sd)
}
df = tibble(u = fun_error(n, sd),
z = fun_error(n, sd),
x = u * b_ux + z * b_zx + fun_error(n, sd),
y = u * b_uy + x * b_xy + fun_error(n, sd))
# without control
lm(formula = y ~ x,
data = df) %>%
summary()
##
## Call:
## lm(formula = y ~ x, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -2.2838 -0.8662 -0.2281 0.7201 3.1619
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.1903 0.3282 0.58 0.569
## x 2.5771 0.1375 18.74 2.96e-13 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.434 on 18 degrees of freedom
## Multiple R-squared: 0.9512, Adjusted R-squared: 0.9485
## F-statistic: 351.1 on 1 and 18 DF, p-value: 2.961e-13
##
## Call:
## lm(formula = y ~ x + z, data = df)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.9114 -0.4876 -0.1044 0.6333 1.8935
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 0.07431 0.24564 0.303 0.76594
## x 2.78984 0.11553 24.147 1.35e-14 ***
## z -1.25270 0.31719 -3.949 0.00103 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.066 on 17 degrees of freedom
## Multiple R-squared: 0.9746, Adjusted R-squared: 0.9716
## F-statistic: 325.7 on 2 and 17 DF, p-value: 2.793e-14
15.5 Mediation
Mediation tests whether the effects of X (the independent variable) on Y (the dependent variable) operate through a third variable, M (the mediator). In this way, mediators explain the causal relationship between two variables or “how” the relationship works, making it a very popular method in psychological research.
Figure 15.1 shows the standard mediation model. Perfect mediation occurs when the effect of X on Y decreases to 0 with M in the model. Partial mediation occurs when the effect of X on Y decreases by a nontrivial amount (the actual amount is up for debate) with M in the model.
Important: Both mediation and moderation assume that the DV did not CAUSE the mediator/moderator.
15.5.1 Generate data
15.5.2 Method 1: Baron & Kenny’s (1986) indirect effect method
The Baron and Kenny (1986) method is among the original methods for testing for mediation but tends to have low statistical power. It is covered in this chapter because it provides a very clear approach to establishing relationships between variables and is still occassionally requested by reviewers.
The three steps:
Estimate the relationship between \(X\) and \(Y\) (hours since dawn on degree of wakefulness). Path “c” must be significantly different from 0; must have a total effect between the IV & DV.
Estimate the relationship between \(X\) and \(M\) (hours since dawn on coffee consumption). Path “a” must be significantly different from 0; IV and mediator must be related.
Estimate the relationship between \(M\) and \(Y\) controlling for \(X\) (coffee consumption on wakefulness, controlling for hours since dawn). Path “b” must be significantly different from 0; mediator and DV must be related. The effect of \(X\) on \(Y\) decreases with the inclusion of \(M\) in the model.
<IP_ADDRESS> Total effect
Total effect of X on Y (not controlling for M).
# fit the model
fit.y_x = lm(formula = y ~ 1 + x,
data = df.mediation)
# summarize the results
fit.y_x %>% summary()
##
## Call:
## lm(formula = y ~ 1 + x, data = df.mediation)
##
## Residuals:
## Min 1Q Median 3Q Max
## -10.917 -3.738 -0.259 2.910 12.540
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 8.78300 6.16002 1.426 0.1571
## x 0.16899 0.08116 2.082 0.0399 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 5.16 on 98 degrees of freedom
## Multiple R-squared: 0.04237, Adjusted R-squared: 0.0326
## F-statistic: 4.336 on 1 and 98 DF, p-value: 0.03993
<IP_ADDRESS> Path a
##
## Call:
## lm(formula = m ~ 1 + x, data = df.mediation)
##
## Residuals:
## Min 1Q Median 3Q Max
## -9.5367 -3.4175 -0.4375 2.9032 16.4520
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2.29696 5.79432 0.396 0.693
## x 0.66252 0.07634 8.678 8.87e-14 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.854 on 98 degrees of freedom
## Multiple R-squared: 0.4346, Adjusted R-squared: 0.4288
## F-statistic: 75.31 on 1 and 98 DF, p-value: 8.872e-14
<IP_ADDRESS> Path b and c’
Effect of M on Y controlling for X.
##
## Call:
## lm(formula = y ~ 1 + m + x, data = df.mediation)
##
## Residuals:
## Min 1Q Median 3Q Max
## -9.3651 -3.3037 -0.6222 3.1068 10.3991
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 7.80952 5.68297 1.374 0.173
## m 0.42381 0.09899 4.281 4.37e-05 ***
## x -0.11179 0.09949 -1.124 0.264
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 4.756 on 97 degrees of freedom
## Multiple R-squared: 0.1946, Adjusted R-squared: 0.1779
## F-statistic: 11.72 on 2 and 97 DF, p-value: 2.771e-05
<IP_ADDRESS> Interpretation
fit.y_x %>%
tidy() %>%
mutate(path = "c") %>%
bind_rows(fit.m_x %>%
tidy() %>%
mutate(path = "a"),
fit.y_mx %>%
tidy() %>%
mutate(path = c("(Intercept)", "b", "c'"))) %>%
filter(term != "(Intercept)") %>%
mutate(significance = p.value < .05,
dv = ifelse(path %in% c("c'", "b"), "y", "m")) %>%
select(path, iv = term, dv, estimate, p.value, significance)
## # A tibble: 4 x 6
## path iv dv estimate p.value significance
## <chr> <chr> <chr> <dbl> <dbl> <lgl>
## 1 c x m 0.169 3.99e- 2 TRUE
## 2 a x m 0.663 8.87e-14 TRUE
## 3 b m y 0.424 4.37e- 5 TRUE
## 4 c' x y -0.112 2.64e- 1 FALSE
Here we find that our total effect model shows a significant positive relationship between hours since dawn (X) and wakefulness (Y). Our Path A model shows that hours since down (X) is also positively related to coffee consumption (M). Our Path B model then shows that coffee consumption (M) positively predicts wakefulness (Y) when controlling for hours since dawn (X).
Since the relationship between hours since dawn and wakefulness is no longer significant when controlling for coffee consumption, this suggests that coffee consumption does in fact mediate this relationship. However, this method alone does not allow for a formal test of the indirect effect so we don’t know if the change in this relationship is truly meaningful.
15.5.3 Method 2: Sobel Test
The Sobel Test tests whether the indirect effect from X via M to Y is significant.
# run the sobel test
fit.sobel = sobel(pred = df.mediation$x,
med = df.mediation$m,
out = df.mediation$y)
# calculate the p-value
(1 - pnorm(fit.sobel$z.value))*2
## [1] 0.0001233403
The relationship between “hours since dawn” and “wakefulness” is significantly mediated by “coffee consumption”.
The Sobel Test is largely considered an outdated method since it assumes that the indirect effect (ab) is normally distributed and tends to only have adequate power with large sample sizes. Thus, again, it is highly recommended to use the mediation bootstrapping method instead.
15.5.4 Method 3: Bootstrapping
The “mediation” packages uses the more recent bootstrapping method of Preacher and Hayes (2004) to address the power limitations of the Sobel Test.
This method does not require that the data are normally distributed, and is particularly suitable for small sample sizes.
library("mediation")
# bootstrapped mediation
fit.mediation = mediate(model.m = fit.m_x,
model.y = fit.y_mx,
treat = "x",
mediator = "m",
boot = T)
## Running nonparametric bootstrap
##
## Causal Mediation Analysis
##
## Nonparametric Bootstrap Confidence Intervals with the Percentile Method
##
## Estimate 95% CI Lower 95% CI Upper p-value
## ACME 0.28078 0.14133 0.43 <2e-16 ***
## ADE -0.11179 -0.30293 0.11 0.274
## Total Effect 0.16899 -0.00539 0.35 0.056 .
## Prop. Mediated 1.66151 -1.91644 10.16 0.056 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Sample Size Used: 100
##
##
## Simulations: 1000
- ACME = Average causal mediation effect
- ADE = Average direct effect
- Total effect = ACME + ADE
Plot the results:
<IP_ADDRESS> Interpretation
The mediate()
function gives us our Average Causal Mediation Effects (ACME), our Average Direct Effects (ADE), our combined indirect and direct effects (Total Effect), and the ratio of these estimates (Prop. Mediated). The ACME here is the indirect effect of M (total effect - direct effect) and thus this value tells us if our mediation effect is significant.
15.6 Moderation
Moderation can be tested by looking for significant interactions between the moderating variable (Z) and the IV (X). Notably, it is important to mean center both your moderator and your IV to reduce multicolinearity and make interpretation easier.
15.6.1 Generate data
# make example reproducible
set.seed(123)
# number of participants
n = 100
df.moderation = tibble(x = abs(rnorm(n, 6, 4)), # hours of sleep
x1 = abs(rnorm(n, 60, 30)), # adding some systematic variance to our DV
z = rnorm(n, 30, 8), # ounces of coffee consumed
y = abs((-0.8 * x) * (0.2 * z) - 0.5 * x - 0.4 * x1 + 10 +
rnorm(n, 0, 3))) # attention Paid
15.6.2 Moderation analysis
# scale the predictors
df.moderation = df.moderation %>%
mutate_at(vars(x, z), ~ scale(.)[,])
# run regression model with interaction
fit.moderation = lm(formula = y ~ 1 + x * z,
data = df.moderation)
# summarize result
fit.moderation %>%
summary()
##
## Call:
## lm(formula = y ~ 1 + x * z, data = df.moderation)
##
## Residuals:
## Min 1Q Median 3Q Max
## -21.466 -8.972 -0.233 6.180 38.051
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 48.544 1.173 41.390 < 2e-16 ***
## x 17.863 1.196 14.936 < 2e-16 ***
## z 8.393 1.181 7.108 2.08e-10 ***
## x:z 6.094 1.077 5.656 1.59e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 11.65 on 96 degrees of freedom
## Multiple R-squared: 0.7661, Adjusted R-squared: 0.7587
## F-statistic: 104.8 on 3 and 96 DF, p-value: < 2.2e-16
<IP_ADDRESS> Visualize result
# generate data grid with three levels of the moderator
df.newdata = df.moderation %>%
expand(x = c(min(x),
max(x)),
z = c(mean(z) - sd(z),
mean(z),
mean(z) + sd(z))) %>%
mutate(moderator = rep(c("low", "average", "high"), nrow(.)/3))
# predictions for the three levels of the moderator
df.prediction = fit.moderation %>%
augment(newdata = df.newdata) %>%
mutate(moderator = factor(moderator, levels = c("high", "average", "low")))
# visualize the result
df.moderation %>%
ggplot(aes(x = x,
y = y)) +
geom_point() +
geom_line(data = df.prediction,
mapping = aes(y = .fitted,
group = moderator,
color = moderator),
size = 1) +
labs(x = "hours of sleep (z-scored)",
y = "attention paid",
color = "coffee consumed") +
scale_color_brewer(palette = "Set1")
df.prediction %>%
head(9) %>%
kable(digits = 2) %>%
kable_styling(bootstrap_options = "striped",
full_width = F)
| x | z | moderator | .fitted | .se.fit |
|---|---|---|---|---|
| -1.83 | -1 | low | 18.58 | 3.75 |
| -1.83 | 0 | average | 15.80 | 2.51 |
| -1.83 | 1 | high | 13.02 | 2.99 |
| 2.41 | -1 | low | 68.52 | 4.32 |
| 2.41 | 0 | average | 91.60 | 3.09 |
| 2.41 | 1 | high | 114.68 | 4.12 |
15.7 Additional resources
15.7.1 Books
15.7.2 Tutorials
15.8 Session info
Information about this R session including which version of R was used, and what packages were loaded.
## R version 3.6.2 (2019-12-12)
## Platform: x86_64-apple-darwin15.6.0 (64-bit)
## Running under: macOS Mojave 10.14.6
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib
##
## locale:
## [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## attached base packages:
## [1] stats graphics grDevices utils datasets methods base
##
## other attached packages:
## [1] forcats_0.5.0 stringr_1.4.0 dplyr_0.8.4 purrr_0.3.3
## [5] readr_1.3.1 tidyr_1.0.2 tibble_2.1.3 ggplot2_3.3.0
## [9] tidyverse_1.3.0 rsvg_1.3 DiagrammeRsvg_0.1 DiagrammeR_1.0.5
## [13] broom_0.5.5 multilevel_2.6 nlme_3.1-145 mediation_4.5.0
## [17] sandwich_2.5-1 mvtnorm_1.1-0 Matrix_1.2-18 MASS_7.3-51.5
## [21] janitor_1.2.1 kableExtra_1.1.0 knitr_1.28
##
## loaded via a namespace (and not attached):
## [1] fs_1.3.2 lubridate_1.7.4 webshot_0.5.2
## [4] RColorBrewer_1.1-2 httr_1.4.1 tools_3.6.2
## [7] backports_1.1.5 utf8_1.1.4 R6_2.4.1
## [10] rpart_4.1-15 Hmisc_4.3-1 DBI_1.1.0
## [13] colorspace_1.4-1 nnet_7.3-13 withr_2.1.2
## [16] tidyselect_1.0.0 gridExtra_2.3 curl_4.3
## [19] compiler_3.6.2 cli_2.0.2 rvest_0.3.5
## [22] htmlTable_1.13.3 xml2_1.2.2 labeling_0.3
## [25] bookdown_0.18 scales_1.1.0 checkmate_2.0.0
## [28] digest_0.6.25 foreign_0.8-76 minqa_1.2.4
## [31] rmarkdown_2.1 base64enc_0.1-3 jpeg_0.1-8.1
## [34] pkgconfig_2.0.3 htmltools_0.4.0 lme4_1.1-21
## [37] highr_0.8 dbplyr_1.4.2 htmlwidgets_1.5.1
## [40] rlang_0.4.5 readxl_1.3.1 rstudioapi_0.11
## [43] farver_2.0.3 visNetwork_2.0.9 generics_0.0.2
## [46] zoo_1.8-7 jsonlite_1.6.1 acepack_1.4.1
## [49] magrittr_1.5 Formula_1.2-3 fansi_0.4.1
## [52] Rcpp_1.0.3 munsell_0.5.0 lifecycle_0.1.0
## [55] stringi_1.4.6 yaml_2.2.1 grid_3.6.2
## [58] crayon_1.3.4 lattice_0.20-40 haven_2.2.0
## [61] splines_3.6.2 hms_0.5.3 pillar_1.4.3
## [64] boot_1.3-24 lpSolve_5.6.15 reprex_0.3.0
## [67] glue_1.3.1 evaluate_0.14 V8_3.0.1
## [70] latticeExtra_0.6-29 data.table_1.12.8 modelr_0.1.6
## [73] png_0.1-7 vctrs_0.2.3 nloptr_1.2.1
## [76] cellranger_1.1.0 gtable_0.3.0 assertthat_0.2.1
## [79] xfun_0.12 survival_3.1-8 viridisLite_0.3.0
## [82] cluster_2.1.0
References
Baron, Reuben M, and David A Kenny. 1986. “The Moderator–Mediator Variable Distinction in Social Psychological Research: Conceptual, Strategic, and Statistical Considerations.” Journal of Personality and Social Psychology 51 (6): 1173–82.
Fiedler, Klaus, Malte Schott, and Thorsten Meiser. 2011. “What Mediation Analysis Can (Not) Do.” Journal of Experimental Social Psychology 47 (6): 1231–6.
MacKinnon, David P., Amanda J. Fairchild, and Matthew S. Fritz. 2007. “Mediation Analysis.” Annual Review of Psychology 58 (1): 593–614. https://doi.org/10.1146/annurev.psych.58.110405.085542.
Preacher, Kristopher J, and Andrew F Hayes. 2004. “SPSS and Sas Procedures for Estimating Indirect Effects in Simple Mediation Models.” Behavior Research Methods, Instruments & Computers 36 (4): 717–31.


6.2. Index Basics¶
GeoMesa will create various indices for a given SimpleFeatureType
schema (see Index Overview). This
allows us to answer a variety of queries in a optimized manner. GeoMesa will make a best effort to determine
the attributes used for indexing. The attributes to use can also be specified as part of the SimpleFeatureType
.
6.2.1. Spatial Index (Z2/XZ2)¶
If the SimpleFeatureType
has a Geometry
-type attribute (Point
, LineString
, Polygon
, etc),
GeoMesa will create a spatial index on that attribute. If there is more than one Geometry
-type attribute,
the default one will be used. The default geometry is generally specified with a *
prefix in the
SimpleFeatureType
string, and is the one returned by SimpleFeatureType.getGeometryDescriptor
.
6.2.2. Spatio-temporal Index (Z3/XZ3)¶
If the SimpleFeatureType
has both a Geometry
-type attribute and a Date
attribute, GeoMesa will
create a spatio-temporal index on those attributes. The Geometry
-type attribute used is the same as
for the spatial index, above. The Date
attribute selected will be the first one declared, or can be
set explicitly. See Setting the Indexed Date Attribute for details on setting the indexed date.
6.2.3. ID Index¶
GeoMesa will always create an ID index on SimpleFeature.getID()
.
6.2.4. Attribute Index¶
Some queries are slow to answer using the default indices. For example, with twitter data you might want to return all tweets for a given user. To speed up this type of query, any attribute in your simple feature type may be indexed individually.
To index an attribute, add an index
hint to the attribute descriptor with a value of true
. To set
the cardinality of an attribute, use the hint cardinality
with a value of high
or low
(see below
for a description of cardinality hints).
Warning
Accumulo data stores have an additional option to create reduced ‘join’ attribute indices, and will use the reduced format by default. See Accumulo Attribute Indices for details.
Setting the hint can be done in multiple ways. If you are using a string to indicate your simple feature type
(e.g. through the command line tools, or when using SimpleFeatureTypes.createType
), you can append
the hint to the attribute to be indexed, like so:
// append the hint after the attribute type, separated by a colon
String spec = "name:String:index=true:cardinality=high,age:Int:index=true,dtg:Date,*geom:Point:srid=4326"
SimpleFeatureType sft = SimpleFeatureTypes.createType("mySft", spec);
If you have an existing simple feature type, or you are not using SimpleFeatureTypes.createType
,
you may set the hint directly in the feature type:
// set the hint directly
SimpleFeatureType sft = ...
sft.getDescriptor("name").getUserData().put("index", "true");
sft.getDescriptor("name").getUserData().put("cardinality", "high");
sft.getDescriptor("age").getUserData().put("index", "true");
If you are using TypeSafe configuration files to define your simple feature type, you may include the hint in the attribute field:
geomesa {
sfts {
"mySft" = {
attributes = [
{ name = name, type = String, index = true, cardinality = high }
{ name = age, type = Int, index = true }
{ name = dtg, type = Date }
{ name = geom, type = Point, srid = 4326 }
]
}
}
}
If you are using the GeoMesa SftBuilder
, you may call the overloaded attribute methods:
// scala example
import org.locationtech.geomesa.utils.geotools.SftBuilder.SftBuilder
import org.locationtech.geomesa.utils.stats.Cardinality
val sft = new SftBuilder()
.stringType("name", Opts(index = true, cardinality = Cardinality.HIGH))
.intType("age", Opts(index = true))
.date("dtg")
.geometry("geom", default = true)
.build("mySft")
<IP_ADDRESS>. Cardinality Hints¶
GeoMesa has a query planner that tries to find the best strategy for answering a given query. In general, this means using the index that will filter the result set the most, before considering the entire query filter on the reduced data set. For simple queries, there is often only one suitable index. However, for mixed queries, there can be multiple options.
For example, given the query bbox(geom, -120, -60, 120, 60) AND IN('id-01')
, we could try to
execute against the spatial index using the bounding box, or we could try to execute against the
ID index using the feature ID. In this case, we know that the ID filter will match at most one
record, while the bbox filter could match many records, so we will choose the ID index.
Attributes that are know to have many distinct values, i.e. a high cardinality, are likely to filter out many false positives through the index structure, and thus a query against the attribute index will touch relatively few records. Conversely, in the worst case, a Boolean attribute (for example), with only two distinct values, would likely require scanning half of the entire data set.
Cardinality hints may be used to influence the query planner when considering attribute indices. If an attribute is marked as having a high cardinality, the attribute index will be prioritized. Conversely, if an attribute is marked with low cardinality, the attribute index will be de-prioritized.


DPATH
DPATH is introduced in this context as a means of addressing elements in a document with a flat structure. It has some resemblance with xpath, but is much simpler and has less precision.
The basic structure in an DPATH-expression is best considered as an analogy to a unix filepath.
Some examples:
| //Results | Will select all material under heading-level 3 with name Results |
| * | Will attempt to select all material under headings level 1 |
| /Semifinal/Results | Will select all material under heading-level 3 with name Results which are under header-level 2 with name Semifinal |
We may also have a spesification part, or selection part, in the form []. The purpose is to filter the elements we use.
- [*] will have no filtering effect, all elements will be included.
- [p,img] wil select only elements of type p and img.
| //Results[*] | Will select all material under heading-level 3 with name Results |
| //Results[table] | Will select all elements of type table under heading-level 3 with name Results |


--- layout: post status: publish published: true title: Advanced .NET Remoting author: display_name: Tomas Restrepo login: tomasr email<EMAIL_ADDRESS>url: http://winterdom.com/ author_login: tomasr author_email<EMAIL_ADDRESS>author_url: http://winterdom.com/ wordpress_id: 464 wordpress_url: http://winterdom.com/2002/04/advancednetremoting date: '2002-04-16 11:07:28 +0000' date_gmt: '2002-04-16 11:07:28 +0000' categories: - ".NET" tags: [] comments: [] ---
My copy of Ingo's Advanced .NET Remoting finally got here! Whoohoo!


Math 239 Introduction to Combinatorics
Introduction to graph theory: colourings, matchings, connectivity, planarity. Introduction to combinatorial analysis: generating series, recurrence relations, binary strings, plane trees.


Inheritance / Dziedziczenie example
class Dog extends Animal {...} // extends is a method used to extend the parent class. // finally that what class Animal posess plus methodes and properties added in class Dog. Dog is a subclass (child class) of Animal class (which is a parent class, superclass).


Pizza palace was founded in 1993 by kelmains and has since then offered its clients the best Pizza with value for there money. Browse through for some delicacy!!!We warn that you will come again😊
Delivery will cost sh. 150


Openlayers battles - Is this polygon convex or not?
16 Aug 2015This would be pretty easy - I thought - if it were only a wonderful Openlayers function e.g polygon.isConvex()
. But it wasn’t, or at least I could find it in version 2.13.1. I was searching the internet, trying to find the simplest solution, because I was sure there is a more elegant and shorter solution than hacking with angles.
Finally StackOverflow came to my help (as always :). In this thread I found the most suitable algorithm for my need.
A polygon is a set of points in a list where the consecutive points form the boundary. It is much easier to figure out whether a polygon is convex or not (and you don't have to calculate any angles, either):For each consecutive pair of edges of the polygon (each triplet of points), compute the z-component of the cross product of the vectors defined by the edges pointing towards the points in increasing order. Take the cross product of these vectors:given p[k], p[k+1], p[k+2] each with coordinates x, y: dx1 = x[k+1]-x[k] dy1 = y[k+1]-y[k] dx2 = x[k+2]-x[k+1] dy2 = y[k+2]-y[k+1] zcrossproduct = dx1*dy2 - dy1*dx2
The polygon is convex if the z-components of the cross products are either all positive or all negative. Otherwise the polygon is nonconvex.If there are N points, make sure you calculate N cross products, e.g. be sure to use the triplets (p[N-2],p[N-1],p[0]) and (p[N-1],p[0],p[1]).
You can checkout my Javascript implementation of this algorithm here.
Openlayers concave shape example


{% extends "base.html" %} {% block title %}Home{% endblock %} {% block body %} FORM VALIDATION Taken from jqueryvalidation.org Upload name To Email Description I have read and accept the terms SUBMIT {{% endblock %}}


About Me
Hi, I'm miza m murshad
front-end web designer
-
-
-
- EMAIL
-<EMAIL_ADDRESS>-
Based somewhere in Malaysia, somewhere near Kuala Lumpur. I design and build websites as a freelancer.
I specialises in front-end web design.
After quitting the O&G industry I decided to revisit my old interest - Web Designing. We have gone separate ways for far too long and 2016 is the best year to pick where we left off.
My motto is -
Simplicity is the keynote of all true elegance


Table.Data.DataProvider
This interface is used by lists and tables in order to load data. The
interface define single load method.
Example
Load
State argument
Data structure which contains all required information to load list which may include sort order, pagination and
filters. The shape of these data is not explicitly defined here, how they will be mapped to real request parameters is
depends on application which implements this interface. See
TableDataProviderConfig.mapState method for
more explanation.
Return result
Observable stream which should return loaded data, the shape of these data is not explicitly defined here, how they will
be mapped to list component models is defined in
TableDataProviderConfig.mapResult method.


Bowling Score Card
Enter the number of pins knocked down with each roll, then click "Confirm":
Frame:
First roll:
Second roll:
Total Score:


Magic Johnson lauds LeBron James, says he's 'playing as well as I've ever seen him play', Business Insider - Business Insider Singapore
by Meredith Cash, Business Insider US- At the 29th Annual Achilles Gala – a celebration of disabled athletes through Cigna and Achilles International – Los Angeles Lakers legend Magic Johnson spoke about how impressed he’s been with LeBron James this season.
- “Right now – this season – he’s playing as well as I’ve ever seen him play,” Johnson said of the 34-year-old superstar.
- James is averaging 25 points and a league-leading 11.1 assists per game to start his 17th season in the league and second in Los Angeles.
- Visit Business Insider’s homepage for more stories.
Even though Magic Johnson no longer holds a formal role with the Los Angeles Lakers, the legendary point guard still has a vested interest in his former franchise’s ongoing success.
And with LeBron James at the helm, it’s safe to say the purple and gold are in good hands.
At the 29th Annual Achilles Gala – a celebration of disabled athletes through Cigna and Achilles International – Johnson spoke about how impressed he’s been with James’ play as of late.
“Right now – this season – he’s playing as well as I’ve ever seen him play,” Johnson said of the 34-year-old superstar. “You know, LeBron can see the floor. He’s a special player.”
Fourteen games into his 17th season in the league and his second with the Lakers, James has averaged 25 points per night and a league-leading 11.1 assists per game. Should his passing prowess continue throughout the season, it would mark the first time in his acclaimed career that his average assists per game has hit double digits.
A 6-foot-9 point guard known best for his flashy dimes, Johnson himself averaged 11.2 assists per game in his 13 seasons in Los Angeles. In four of those years, Johnson led the league in assists, so he can appreciate as well as anyone James’ transformation into the league’s best distributor with the Lakers this season.
“He’s scoring and putting up 25 points a night but also he’s leading the league in assists,” Johnson said. “Eleven assists – he’s just awesome. He’s doing his thing.”
With six-time NBA All-Star Anthony Davis signing on with Los Angeles this offseason, James’ squad has dominated the competition to the tune of an NBA-best 12-2 record on the season. And even though Johnson abruptly resigned his post as the franchise’s president of basketball operations after the conclusion of last season, he’s undoubtedly happy to see the new-look Lakers in peak form.
- Read more:
- Rob Gronkowski and Venus Williams danced with the Laker Girls in a hilarious bit with James Corden
- Here are the new, sleek NBA ‘City’ uniforms from Nike that all 30 teams will be wearing
- Map shows which states support Colin Kaepernick the most
- The Coyotes tried to troll the Kings by hanging the team’s ‘jinxed’ Taylor Swift banner and instead, the Kings trolled right back


Final Project Presentation @ Spiced Academy
Agnes Hanko
2020-12-04
Top 10 Correspondents
Top 10 Degree Centrality Scores
Other Persons of Interest
Any Questions?
Thank you!


Before Change
:param x: list of strings representing image filenames
:return: ndarray representing network outputs corresponding to inputs in the same order
if not self.__with_patching:
raise RuntimeError("patching dimensions were not specified."+
" Need to use DPPModel.set_patch_size(height, width) before training.")
with self.__graph.as_default():
patch_height = self.__patch_height
patch_width = self.__patch_width
if self.__problem_type == definitions.ProblemType.CLASSIFICATION:
After Change
else:
for i in range(int(num_batches)):
xx = self.__session.run(x_pred)
total_outputs = np.append(total_outputs, xx, axis=0)


Your {{ trackee.name }} is moving away from you
Your {{ trackee.name }} is moving away from you
Your {{ trackee.name }} is moving away from you
Your {{ trackee.name }} is moving away from you
Your {{ trackee.name }} is moving away from you
Your {{ trackee.name }} is moving away from you
Your {{ trackee.name }} is moving away from you
Your {{ trackee.name }} is moving away from you
Your {{ trackee.name }} is moving away from you
Your {{ trackee.name }} is moving away from you


-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 5000 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 800 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 500 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 1500 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
-
Universal Bike Body Cover - Sporty Blue
Brand Name: Universal BikePrice: 400 INR
₹300/-
₹250/-
₹950/-
₹650/-
₹450/-
₹550/-
₹950/-
₹990/-


Hair care, landing
Organic cosmetics for skin and hair care. It is made from a special substance based on Altai mountain herbs. The packaging design elements and the page are inspired by ancient rock paintings found in this area.
Visit website
Under development


POETRY
Tím
Màu của ơ thờ lắm đăm chiêu
Tím của say mê với nuông chiều
Thôi phôi pha bớt vài nắng hạt
Tình rãi rơi nhiều có được yêu?
Readmore
Testimonials
Our business helps busy people save time, so fast service with BaoNguyen is critical.
Best rates across asia! I'm using this app for work as I travel across asia. Finally I'm not wasting money anymore!
Great service makes your customers feel that you care about developing a long-term relationship that means more than just making a sale. I would and will, recommend Bao-Nguyen to anyone who need to create their website!
What do i do!
CODING ALL OVER THE WORLD
Now Avaliable in 7 countries covering 100+ customers.
Clients
Our most trusted partners and clients.


WATCH: Lionel Messi tells Brazil head coach Tite to ‘shut his mouth’
Lionel Messi got on the scoresheet in Argentina’s 1-0 win over arch-rivals Brazil in an international friendly in Riyadh, Saudi Arabia. Messi failed to convert from the spot but was quick enough to convert from the rebound just three minutes after Gabriel Jesus had missed a spot-kick for the Selecao.
During the first half, the Argentine was seen gesturing towards Brazil head coach Tite, asking him to keep quiet. As the tactician revealed after the match, he was asking for Messi to be shown a yellow, in reaction to which the Barcelona star asked him to ‘shut his mouth’.
Watch Messi’s reaction here.
 “And that was it.”
“I don’t want to answer anymore on it. You need a strong referee because he’ll swallow you… It should have been a card, I was right to complain,” he added.


Constructor
new Chart(container, widthopt, heightopt, xScaleopt, xTitleopt, xColopt, yTitleopt, yScaleopt, yColopt, y2Titleopt, y2Scaleopt, y2Colopt, x2Titleopt, x2Scaleopt, x2Colopt, horizontalopt)
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
container
|
DOM |
DOM element in which to create the chart. |
||
width
|
number |
<optional> |
300 |
Width of the chart. |
height
|
number |
<optional> |
300 |
Height of the chart. |
xScale
|
function |
<optional> |
D3 scale for the X axis. |
|
xTitle
|
string |
<optional> |
Title for the X axis. |
|
xCol
|
BIColumn |
<optional> |
Column for the X axis. |
|
yTitle
|
string |
<optional> |
Title for the Y axis. |
|
yScale
|
function |
<optional> |
D3 scale for the Y axis. |
|
yCol
|
BIColumn |
<optional> |
Column for the Y axis. |
|
y2Title
|
string |
<optional> |
Title for a second Y axis. |
|
y2Scale
|
function |
<optional> |
D3 scale for a second Y axis. |
|
y2Col
|
BIColumn |
<optional> |
Column for a second Y axis. |
|
x2Title
|
string |
<optional> |
Title for a second X axis. |
|
x2Scale
|
function |
<optional> |
D3 scale for a second X axis. |
|
x2Col
|
BIColumn |
<optional> |
Column for a second X axis. |
|
horizontal
|
boolean |
<optional> |
false |
Indicates the chart should be orientated horizontally rather than vertically. |
Members
Axes
Object for axes to be stored so they can be redrawn later.
Properties:
| Name | Type | Description |
|---|---|---|
X
|
||
X2
|
||
Y
|
||
Y2
|
Container
Container DOM element.
Height
Height of the container in pixels.
Horizontal
Indicates if the chart is horizontally orientated .
Width
Width of the container in pixels.
Methods
axisLabelDisplay()
Determines whether the array would need to be rotated to display on an axis, or can't display at all. If the there is enough room, it will display the axis labels on-axis. If they are too long they will rotate. If there are too many labels so they overlap, they should be hidden completely.
createSVG(beforeopt)
Create SVG element for plot area.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
before
|
string |
<optional> |
CSS selector at which the SVG should be inserted before. |
drawAxes()
Draw axes for chart using the defined margin and scales. Values are also formatted as per the OBIEE column.
rotate()
Rotates the chart and axes 90 degrees
setMargin()
Sets default margin sizes (top, left, right, bottom) to this.Margin
based on labels, size and axes.
setX(title, scale, col)
Sets the X axis to this.Axes.X
from input information.
Parameters:
| Name | Type | Description |
|---|---|---|
title
|
string |
Title for the axis |
scale
|
function |
D3 scale function for the axis. |
col
|
BIColumn |
OBIEE column of the axis. |
setX2(title, scale, col)
Sets the second X axis to this.Axes.X2
from input information.
Parameters:
| Name | Type | Description |
|---|---|---|
title
|
string |
Title for the axis |
scale
|
function |
D3 scale function for the axis. |
col
|
BIColumn |
OBIEE column of the axis. |
setY(title, scale, col)
Sets the Y axis to this.Axes.Y
from input information.
Parameters:
| Name | Type | Description |
|---|---|---|
title
|
string |
Title for the axis |
scale
|
function |
D3 scale function for the axis. |
col
|
BIColumn |
OBIEE column of the axis. |
setY2(title, scale, col)
Sets the second Y axis to this.Axes.Y2
from input information.
Parameters:
| Name | Type | Description |
|---|---|---|
title
|
string |
Title for the axis |
scale
|
function |
D3 scale function for the axis. |
col
|
BIColumn |
OBIEE column of the axis. |
(inner) axis()
Return axis sub objects


{ArticleTitle}
-
{ArticleDescription}
-
Paypal is our prefered method of payment but we also accept Direct Deposit. If you would like to pay via Direct Deposit please email us for the details.
-
When shopping online we want to ensure you are happy with your purchase and feel good about the experience of shopping with us. If for any reason you are not pleased with the items purchased online, or if it is not what you expected, you have the option of returning the item to us for a full refund of the product price subject to the following conditions:
Return policy is 30 days
If you simply have changed your mind, the refund will be for the product price only and not the postage cost;
If you post the item to us, you do so at your own expense; and
The item must be returned in original condition and packaging within 14 days of receipt.
Faulty or Damaged Goods
Please Contact Us to discuss the faulty items and to obtain our reply paid address. Please note that refunds can only be issued to the bank account or PayPal account that was originally charged.


Selena Gomez Opens the AMAs With the Most Stunning Outfit Change
by Sarah WasilakSelena Gomez opened the American Music Awards with a serious tone, singing her hit "Lose You to Love Me" in a black turtleneck gown, and then, just like that, she tore off her dress to reveal a mosaic crystal bodysuit by Dior. The mood completely changed when Selena broke it down and danced to "Look at Her Now," emitting all the confidence in the world. Selena had walked the red carpet in a highlighter-green Versace minidress just moments before, then suddenly, here she was showing us she can own the stage, too.
We love that Selena kept on her Roberto Coin diamond necklaces for her performance, because her stage was deserving of complete and total sparkle and shine. Selena capped off the look with black suede Stuart Weitzman Lesley thigh-high boots, which are currently available for $795. Coordinate them with whatever you like, but we can't say we don't recommend an incredibly sexy, curve-flattering look like Selena's — who says you can't pull that off anyway?


Preparation time
1-2 hours
Cooking time
30 mins to 1 hour
Serves
Serves 6
Dietary
Once you’ve mastered the art of making honeycomb (here dipped in dark chocolate) you can move onto more complicated dishes like this parfait.
Equipment and preparation: you will need a sugar thermometer.
For the honeycomb, line a baking tray with a little oil and baking parchment.
Place the sugar, honey, glucose and 50ml/2fl oz water into a saucepan and bring to a boil. Continue to cook until the temperature reaches 160C/320F on a sugar thermometer.
Remove from the heat and quickly beat in the bicarbonate of soda, stirring constantly. Pour the mixture onto the lined baking tray.
Set aside until completely cool and then break into large pieces.
Melt the chocolate in a bowl suspended over a pan of simmering water (do not allow the bottom of the bowl to touch the water), or in the microwave.
Line a baking tray with greaseproof paper.
Dip each piece of honeycomb into the melted chocolate and then place onto the lined tray. Leave for one hour until the chocolate is set and hard.
For the parfait, grease a loaf tin with a little vegetable oil and then line with two layers of cling film.
In a clean mixing bowl, whisk the egg whites until soft peaks form when the whisk is removed. Gradually whisk in half of the sugar and continue to whisk until firm peaks are formed.
Whisk the egg yolks and remaining sugar in a bowl over a pan of simmering water for about 5-6 minutes, or until the mixture thickens.
Place the cream and scraped vanilla seeds into a separate bowl and whisk until soft peaks form when the whisk is removed from the bowl.
Gently fold the meringue, egg yolks and cream together in a bowl gently until just mixed together.
Roughly chop the chocolate honeycomb and then fold it into the mixture, making sure it’s distributed evenly.
Pour the mixture into the lined loaf tin and place in the freezer for at least for hours, or until firm.
To serve, remove the parfait from the freezer and leave for one hour to soften slightly before slicing and serving.


Hours Open
| Days | AM | PM |
|---|---|---|
| Sunday | 6:00 | 7:00 |
| Monday | 6:00 | 7:00 |
| Tuesday | 6:00 | 7:00 |
| Wednesday | 6:00 | 7:00 |
| Thursday | 6:00 | 7:00 |
| Friday | - | - |
| Saturday | 6:00 | 7:00 |
locations with addresses
Special Items
About us
Salmon Cookies is a Global shop sell the original Salmon Cookies.
Contact Information
Reach us via Email or call us on phone numbers. Thank you.
Phones:
+ 962 6 000 000
+ 962 6 000 000


Erdogan says Turkey will let refugees into Europe if EU does not support it
by ReutersANKARA (Reuters) - Turkey will have to open the doors to Europe for Syrian refugees unless the European Union provides Ankara with enough support, President Tayyip Erdogan said on Thursday, adding that Turkey could not carry that burden alone.
Turkey aims to establish a "safe zone" in northeast Syria, where it says up to 2 million Syrian refugees can settle once the region is cleared of the Kurdish YPG militia. Ankara has repeatedly urged the EU to help Turkey in hosting more than 3.5 million refugees.
"Whether we receive support or not, we will continue to aid the guests we are hosting. But, if this doesn't work out, then we will have to open the doors," Erdogan told a news conference alongside Hungarian Prime Minister Viktor Orban in Budapest.
(Reporting by Tuvan Gumrukcu and Ece Toksabay)


This form allows you to create a new MySQL database, with an optional
initial table. You must enter a database name, and if creating an initial
table you must enter a table name and the details of at least one field.
When done, click on the Create to have the database immediately
created.


| About Dailyrotten |
|
Feedback
If you like this page, hate it, or would like to suggest changes,
<EMAIL_ADDRESS>is listening. This page
is experimental and somewhat different from what we usually offer, so please
do send your feedback.
Adding Stories
If you are a rotten newshound and you would like to suggest a story,
visit our submit page to
send us the URL. Stories that are accepted will have your name credited.
Viewership
On the first full day this page went live, 100,000 people visited this Rotten
News page. Of course that was the day after the WTC attacks, so that number is
somewhat distorted. Right now this page gets between 50,000 and 75,000 people
every day.
Linking
We encourage everyone to link to this page; if you like it, others probably
will as well.
Other Rotten
Rotten
Gaping Maw
Celebrity Morgue
Mugshots
Rotten Store
Shockumentary
Rate My Poo
Rate My Kitten
Rate My Finger
Penny Postcards
Phallic
Dr. Sputnik
Boners
Dead Pool
NNDB
Home
Make Dailyrotten your start page
|
|
|
October 07, 2003
Bush doubts CIA leaker will ever be found
WDIV-TV 4 Detroit | Submitted by: Reid Fleming
"Staffers at both the White House and the Pentagon were given until 5 p.m. Eastern time to turn in any documents possibly related to the leaking of the identity of a CIA officer... White House lawyers will screen the materials and decide which ones to send to the Justice Department... President Bush expresses doubt the leaker will be identified. Bush told reporters Tuesday that the press does 'a very good job of protecting the leakers.' ... [Rep. John Conyers] said Karl Rove should step down."
|
|
Read article... and
This article...
|
|
Kim Jong Il's secret wife in intensive care
Independent | Submitted by: Reid Fleming
"When a retired North Korean dancing girl crashed her Mercedes in Pyongyang a month ago, not a peep was heard from the world's most isolated Stalinist state about the scale of the tragedy to have befallen its paranoid leader Kim Jong Il. Only yesterday, did it emerge that the 50-year-old woman who suffered severe head injuries and is now in a critical condition is the wife of the 'Dear Leader' Mr Kim and mother of his heir apparent... Ms Ko reportedly caught Mr Kim's eye as one of 2,000 girls employed in the dictator's 'pleasure groups.' ... Each 'pleasure group' is composed of three teams - a 'satisfaction team,' which performs sexual services; a 'happiness team,' which provides massage and a 'dancing and singing team.' These teams, recruited from girls' high schools, undergo a six-month training course before they are assigned to one of the dictator's 32 villas and palaces until the age of 25."
|
|
Read article...
|
|
Looks bad for accused sex tourist
Sacramento Bee | Submitted by: Reid Fleming
"An 85-year-old man accused of attempting to travel to the Philippines to have sex with two underage girls was detained Monday without bail... [John W. Seljan] was arrested Friday while preparing to board a flight at Los Angeles International Airport.  Authorities discovered pornographic materials, sexual aids, and nearly 100 pounds of chocolate and candy in his luggage during the arrest."
|
|
Read article...
|
|
Judge accused of mild pervosity
WECT-TV 6 Wilmington | Submitted by: Reid Fleming
"The lawyers for a former Miss North Carolina have filed a motion to disqualify the arbitrator in her case, alleging that he is no longer impartial. The lawyers claim Judge Conley Ingram of Georgia has become obsessed with alleged topless photographs taken of Rebekah Revels by her former boyfriend Tosh Welch... Revels lawyer Barry Nakell says Ingram has insisted on seeing the photos but he hasn't forced pageant officials to explain why they need to see them, as he believes the law requires. He says he has told Ingram that he's willing to supply the photos with just her face showing but that offer was refused."
|
|
Read article...
|
|
Corpsefucking still legal in California
Daily Press | Submitted by: Reid Fleming
"A judge released [Donald Luis Cooper Jr.], 32, with a suspended sentence on Sept. 26 after he pleaded guilty to unlawful handling of human remains — the only law on the books that he violated, prosecutors say... But it took a technicality to even have made that prosecution possible, Amster said. 'If he hadn't broken the skin, nothing could have been done.'"
|
|
Read article...
|
|
Elementary school teacher recommends suicide to pupil
Washington Times | Submitted by: Reid Fleming
"The Mainichi Daily News said the 9-year-old student at a Fukuoka elementary school is reportedly suffering post-traumatic stress disorders, such as headaches and nausea, as a result of the teacher's verbal abuse and physical punishment. The lawsuit alleges that in May this year, the 46-year-old teacher pulled the child's ears in a corporal punishment he called the 'Mickey Mouse.' Knowing the boy has an American ancestor, the teacher also told a class the boy's blood was not pure because it was 'mixed.' The legal action said the teacher told the child: 'Hurry up and die. Jump off a condo.'"
|
|
Read article...
|
|
British museum struggles to import Elvis guns
BBC | Submitted by: Reid Fleming
"A UK Elvis Presley museum is facing a battle with the government over plans to import a collection of the singer's handguns from the US... The six guns include a Derringer pistol - which Elvis carried down the side of his boot when on stage - and a Smith and Wesson engraved with Elvis' motto 'Taking Care of Business.' Museum director Jerry Goldman said Elvis was 'fanatical' about collecting and using guns. 'We've all heard the stories of Elvis sitting watching television and shooting the screen out if he didn't like the programme,' he said. 'But he also used to shoot at his cars if they failed to start and he used to shoot at squirrels from the comfort of his toilet seat at his home in Graceland.'"
|
|
Read article...
|
|
Ted Nugent promoting ice cream
Firearm News | Submitted by: Reid Fleming
"Ted Nugent, rock musician, avid outdoorsman and defender of gun rights, has come out in support of 'Gun Nut' ice cream, a new flavor unveiled by a company billing itself as 'the conservative alternative to liberal Ben & Jerry's.' ... According to the statement, the company has partnered with Nugent and Gun Owners of America in the promotion of Gun Nut. The firm plans to donate $1 from the sale of each quart of Gun Nut to the educational work of the Gun Owners Foundation Gun Safety Project."
|
|
Read article...
|
|
HP demos latest tool of the Panopticon
BBC | Submitted by: Soylent
"A prototype pair of sunglasses with a camera built in to them has been created by Hewlett Packard researchers. 'It means you now have a wearable camera which nobody will notice and can take pictures while being involved in events,' said Huw Robson from Hewlett Packard. But experts say there could be privacy implications if this sort of technology becomes part of everyday life. [Really?] The sunglasses developed at the Hewlett Packard labs in Bristol in the west of England sport a camera that constantly takes images of what a wearer sees. The camera also has an off-switch to preserve privacy." [The wearer's privacy, that is.]
|
|
Read article...
|
|
Michael Jackson unlikely to win Nobel Peace Prize
Aftenposten | Submitted by: Reid Fleming
"This year's Nobel Peace Prize winner is very hard to guess, but US pop star Michael Jackson is among nominees who can forget the award, the director of the Norwegian Nobel Institute said on Monday... 'There are many good candidates, the vast majority of them are serious names. Michael Jackson is maybe not such a serious name, but there are very few in that category,' Lundestad said. Jackson has been nominated for promoting peace via pop."
|
|
Read article...
|
|
|
|
|


| message = message text string value |
|
You power programmers will just love this. You have your own debug log to write to! The DebugLog can be viewed from the debugger window during program execution only.
For those not familiar to this sort of thing, think of the Debug log like your own private 'in program notepad'. Use this to write messages to yourself during program execution. For example, you could write the graphic modes that the user has on his system, or just little alerts to let you know your code execution made it to a certain point in the execution without interrupting it. I'm sure you'll find a lot of uses for this! See the example if you're still lost. See also: Stop. |
|
; DebugLog Example
; Let's start graphics mode Graphics 640,480,16 ; Now, let's load an image that doesn't exist! gfxPlayer=LoadImage("noimagefound.jpg") If gfxPlayer=0 Then DebugLog "Player's Graphics failed to load!" End If ; This is supposed to generate an error. Press F9 to see the log! While Not KeyHit(1) DrawImage gfxPlayer,100,100 Wend |


SusmithaLinkedIn: https://www.linkedin.com/in/susmitha-venkit/Github: https://github.com/SusmithaVenkittaraman |
||
PratixaLinkedIn: https://www.linkedin.com/in/pratixa-shahGithub: https://github.com/pratixashah |
||
YashLinkedIn: https://www.linkedin.com/in/yash5/Github: https://github.com/yash5OG |


@********************************************************* * twitter like page that gives summary of all your * * projects. shows list of events * * @param projects all the projects available to whom? * * @param events sequence of event to be shown * * @param user name of current user who is logged in * ********************************************************@ @(projects: Seq[Project], events: Seq[(Task,Project)], user: User) @layouts.twocolumnProjects(projects, user){


The specified file was not found on this website. Please check the URL for mistakes and try again. Make sure your network is online!


|
City of Calgary |
http://www.calgary.ca |
|
Alberta Relocations |
www.albertarelocations.com |
|
Learn about Alberta |
www.explorealberta.com |
|
Learn all about Calgary |
www.discovercalgary.com |
|
Learn about Banff National Park |
www.worldweb.com/ParksCanada-Banff/ |
|
Learn About Banff in the Canadian Rockies |
www.discoverbanff.com |
|
Learn about Jasper National Park |
www.discoverjasper.com |
|
Employment opportunities in Alberta |
www.calcna.ab.ca/occupati/jobs/empl.html#jobs |
|
Calgary Convention and Tourist Bureau |
www.visitor.Calgary.ab.ca |
|
Public School Board |
www.cbe.ab.ca |
|
University of Calgary |
www.ucalgary.ca |
|
Southern Alberta Institute of Technology |
www.sait.ab.ca |
|
Mount Royal College |
www.mtroyal.ab.ca |
|
All homes for sale on the MLS throughout Canada |
www.mls.ca |
|
Calgary Real Estate Board |
www.creb.com |
|
Remax of Western Canada |
www.remax.ca |
|
Remax International |
www.remax.com |
|
Children's Miracle Network |
www.cmn.org |
|
The Calgary Herald Daily Newspaper |
www.calgaryherald.com |
|
The Calgary Sun Daily Newspaper |
www.calgarysun.com |
|
Calgary Flames NHL Hockey Team |
www.calgaryflames.com |
|
Calgary Stampeders CFL Football Team |
www.stampeders.com |
|
A Great Currency converter |
www.xe.net/ucc |
|
Calgary Transit |
www.calgarytransit.com |
|
Calgary Zoo |
www.calgaryzoo.ab.ca |
|
Glenbow Museum |
www.glenbow.org |
|
Calgary Stampede |
www.calgary-stampede.com |
|
Talisman Centre |
www.talismancentre.com |
|
Heritage Park |
www.heritagepark.ab.ca |
|
Movie Locations and showtimes |
www.loewscineplex.com/canada/locations/ab |
|
Info on All Calgary Communities |
www.calgaryarea.com |


Upload all files on form submit.
Show results through events.
Upload files on file input change.
Show results through callbacks
Force files to upload through Iframe on file input change.
Show results through callbacks
Upload images with dropzone
Use Uploader class as fallback for IE9


PREPARE
Section: SQL Commands (7)Updated: 2012-08-14
Index Return to Main Contents
NAME
PREPARE - prepare a statement for executionSYNOPSIS
PREPARE name [ ( datatype [, ...] ) ] AS statement
DESCRIPTION
PREPARE creates a prepared statement. A prepared statement is a server-side object that can be used to optimize performance. When the PREPARE statement is executed, the specified statement is parsed, rewritten, and planned. When an EXECUTE command is subsequently issued, the prepared statement need only be executed. Thus, the parsing, rewriting, and planning stages are only performed once, instead of every time the statement is executed.
Prepared statements can take parameters: values that are substituted into the statement when it is executed. When creating the prepared statement, refer to parameters by position, using $1, $2, etc. A corresponding list of parameter data types can optionally be specified. When a parameter's data type is not specified or is declared as unknown, the type is inferred from the context in which the parameter is used (if possible). When executing the statement, specify the actual values for these parameters in the EXECUTE statement. Refer to EXECUTE [execute(7)] for more information about that.
Prepared statements only last for the duration of the current database session. When the session ends, the prepared statement is forgotten, so it must be recreated before being used again. This also means that a single prepared statement cannot be used by multiple simultaneous database clients; however, each client can create their own prepared statement to use. The prepared statement can be manually cleaned up using the DEALLOCATE [deallocate(7)] command.
Prepared statements have the largest performance advantage when a single session is being used to execute a large number of similar statements. The performance difference will be particularly significant if the statements are complex to plan or rewrite, for example, if the query involves a join of many tables or requires the application of several rules. If the statement is relatively simple to plan and rewrite but relatively expensive to execute, the performance advantage of prepared statements will be less noticeable.
PARAMETERS
- name
- An arbitrary name given to this particular prepared statement. It must be unique within a single session and is subsequently used to execute or deallocate a previously prepared statement.
- datatype
- The data type of a parameter to the prepared statement. If the data type of a particular parameter is unspecified or is specified as unknown, it will be inferred from the context in which the parameter is used. To refer to the parameters in the prepared statement itself, use $1, $2, etc.
- statement
- Any SELECT, INSERT, UPDATE, DELETE, or VALUES statement.
NOTES
In some situations, the query plan produced for a prepared statement will be inferior to the query plan that would have been chosen if the statement had been submitted and executed normally. This is because when the statement is planned and the planner attempts to determine the optimal query plan, the actual values of any parameters specified in the statement are unavailable. PostgreSQL collects statistics on the distribution of data in the table, and can use constant values in a statement to make guesses about the likely result of executing the statement. Since this data is unavailable when planning prepared statements with parameters, the chosen plan might be suboptimal. To examine the query plan PostgreSQL has chosen for a prepared statement, use EXPLAIN [explain(7)].
For more information on query planning and the statistics collected by PostgreSQL for that purpose, see the ANALYZE [analyze(7)] documentation.
You can see all available prepared statements of a session by querying the pg_prepared_statements system view.
EXAMPLES
Create a prepared statement for an INSERT statement, and then execute it:
PREPARE fooplan (int, text, bool, numeric) AS INSERT INTO foo VALUES($1, $2, $3, $4); EXECUTE fooplan(1, 'Hunter Valley', 't', 200.00);
Create a prepared statement for a SELECT statement, and then execute it:
PREPARE usrrptplan (int) AS SELECT * FROM users u, logs l WHERE u.usrid=$1 AND u.usrid=l.usrid AND l.date = $2; EXECUTE usrrptplan(1, current_date);Note that the data type of the second parameter is not specified, so it is inferred from the context in which $2 is used.
COMPATIBILITY
The SQL standard includes a PREPARE statement, but it is only for use in embedded SQL. This version of the PREPARE statement also uses a somewhat different syntax.
SEE ALSO
DEALLOCATE [deallocate(7)], EXECUTE [execute(7)]
Index
This document was created by man2html, using the manual pages.
Time: 05:34:15 GMT, December 24, 2015


Browser interfaces have been a fundamental aspect of BYOND for quite a while, but the idea of using HTML to enhance a program's interface has not been commonly executed in BYOND games. This library will let you create and design behaviour for HTML interfaces in your project without having to re-invent the wheel every time you write some browser interface code.
To define a form, all you need to do is define a child type from the datum /upForm and define some variables and procs. Here is a simple definition of a form that would display "hello" to the user's default browser.
The proc GenerateBody() is where you should write your code to generate the body of the page, implied by the name. GenerateBody() should always call UpdatePage() with the body text of the page being sent through the parameter. This proc must be implemented in any form you wish to define.
The above code won't do anything, since it's just a declaration of a new form. We can do something with this datum by using the upForm() proc defined in the library. This proc essentially creates and handles a form for you. It is the hub of all form instantiation. To create an instance of a form, call upForm(), sending the required data through the args. The following will display the form we defined above when the player logs in.
There are four to use upForm(), but the most common method is to specify the target of the form (a mob, or a client) as the first arg, and then the path of the form (such as /upForm/mypage) as the second arg. You may call upForm() as many times as you want with the limitation that another page will not be interrupted.
On another note, upForm() returns the reference of the newly instantiated form. Therefore, you can store this elsewhere to handle it, such as the case if you want to externally close the form. To close a form, the most simple way is to delete the instance. Deleting it handles all of the final closing code. More of this will be explained in the next sections.
There are a total of four types of forms you may define with the /upForm datum. This is determined by what the value of the /upForm variable form_type is. The variable may be one of the four constants:
The default value for form_type is UPFORM_BROWSER, so if it is not specified, the form will display the page to the default browser of the user's interface. The example in the previous section displays the page to the user's default interface. The only difference between UPFORM_BROWSER and UPFORM_INTERFACE is that you specify the interface control's name to output to using the form_name variable.
Windows are a fairly common way of displaying data, because you can have as many windows as you want on the screen, and they have the flexibility of being resizable, movable, and closable. To create a windowed form, set the form_type of the form to UPFORM_WINDOW.
Windows also have other important settings that you may want to configure. The three variables used to configure window settings are window_title, window_size, and window_params. The window_title variable is what will be displayed as the title of the window. window_size is the size of the window using a "[width]x[height]" format. window_params is a variable that takes flags as settings that determine the nature of the window. The variable may take the following flags: UPFORM_CANNOT_CLOSE, UPFORM_CANNOT_RESIZE, UPFORM_CANNOT_MINIMIZE, and UPFORM_NO_TITLEBAR.
Because there is no way to catch the event that a window has been closed by the client, two form types have been defined for you. If you want the user to have the ability to keep the window up for as long as he or she wants, then you should define the form as a UPFORM_CLOSEWINDOW. By defining a window as a regular UPFORM_WINDOW, then you will need to handle the closing yourself, either by external or internal means. Close Windows are deleted right after their pages are displayed, so upForm() will return null.
The upForm datum handles all of the link handling for you in Topic(). You will not and should not touch the Topic() proc. The library has defined a Link() proc for you to handle communication from the player to the form. Its usage is similar to how you would override Topic() if you were to handle your own communication. Here is a simple example showing how you could have a window have a close link.
Link() has two args, one that is actively demonstrated. The href_list var is an associative list holding a name=value list of the params sent through the link. The second arg is the client who sent the link, so it is possible to have distinct behaviour of your forms depending on who sent it.
The great thing about the library is that it handles all automated verification for you. The client sent through Link() is guaranteed to be valid, as it is verified by the form datum. Nothing will happen if an unauthorized user attempts to send a link to a form that the user is not viewing.
Because of the numerous ways that you can represent a form's purpose and functionality, this library has defined a few variables for you to utilize externally from the form. When you call upForm(), the first arg of the proc is always the target of the form. The target can either be a client, or a list of clients (if a mob or list of clients or mobs is sent in a list, they will be automatically converted if possible). The target of a form is essentially the client or clients that the form will be directed at. Therefore, you can send an instance of a form to the screen of many clients if you want them all to view and control the same thing. More information about multi-viewer forms is discussed in the next section.
If the target of an owner is an individual client or mob, then a form's owner is set to that client. By defining owner for form objects, we can identify internally who the form belongs to. There is no owner if the target is a list of clients.
Another concept of forms is the host. The host of a form is what the form is about, or what the form is modifying. The host variable holds any type of datum, and is completely optional. The variable should be specified in the arg after the owner when calling upForm(). The purpose of defining host is if you want convenient and reliable access to a certain object that the form will commonly use. For example, if you want to create a browser interface that reads or modifies a certain object, such as another character in your game, then you will want to send the character reference through the second arg of upForm(). The following is an example on how you would use the host variable to view the health of another player.
Notice how the verb calls upForm() with three arguments instead of two. If you want a host to be specified, then the second arg should be the reference of a host. For easy reference, here are the two main ways to call upForm():
When you are trying to access the host or the owner of a form, you should use getOwner() and getHost() respectively. You should use these procs to ensure that you are not going to access something that does not exist. If you did not specify a host (or in the case of multi- viewer forms or global forms, an owner), then you should not be calling getHost(). However, in the case the host is deleted while the form is running, you will want to manually check the host variable before calling getHost(), as the proc will call an assertion if a host does not exist. You will have to handle the possibility of the host being deleted while the form is still running.
You can enhance your interface by including CSS and JavaScript. All forms have the variables page_css and page_js. Respectively, they represent the CSS code and JavaScript code that will be displayed in that form. The upForm Library defines a predefined set of commonly used JavaScript functions, all prefixed with upForm_. Refer to the Reference at the end of this documentation for information about the predefined JavaScript functions. JavaScript can also be written by sending text through the second arg of UpdatePage(). When you generate your page, you may want in a certain case to send JavaScript code.
If you want all of your pages to look similar, you can define a global CSS by defining the global_css var belonging to the /upForm datum. The below example shows the usage of global_css, page_css, page_js, and sending JavaScript code through UpdatePage()
upForm not only easily lets us define and associate forms, but it has some unique features unheard of from other browser or html libraries on BYOND. These features include easy support for resource handling, multiple viewers, form handling, and timers.
Another convenient feature in the library is the ability to easily handle and send resources such as images and sounds to the client. The resources associative list defined in the datum is a list of runtime resources you want the form to send to the user when it is created. The key of the list is the resource, while the association is an optional name for the file you want to send.
You are also able to dynamically send resources to the viewers of a form. If you have a dynamically generated resource such as a custom icon, then you can use the LoadResource() proc defined in the form to send a resource that you could not send through the resources list. The first mandatory arg for the proc is the resource itself, and the second optional arg is the name of the resource. You should specify the name of the resource if it is dynamically generated. The following is a form demonstrating both predefined and dynamic resource handling methods.
The above example shows how you could use a combination of predefined and dynamic resources to display a dynamic image between two star icons on top of a banner png. LoadResource() can be called anywhere. However, it is up to you to decide when it is appropriate to call it and to think ahead of the necessity of sending the resource.
The upForm Library gives you a fairly good amount of control over the creation and display of the form objects. For example, if a certain form could not be sent to a client, then upForm() will return null. Knowing this, we can handle the case where a form could not be sent to a user, such as the attempt to send a Battle Challenge page to a player who is already in a Battle. In this case, you could store the return value of upForm(), and check whether a form was returned by checking if a reference was sent. If it wasn't, then the form was not able to be sent to that client.
But wait, how do we know whether a form can or can't be sent to a client? By default, an interface that displays to the same interface control in the client's form list, and a browser interface that is being sent when another browser interface is being displayed will not be allowed to display the form to that client. A form can't be sent if it interrupts another form object. This prevents the output coming from another form from being interrupted by a new form.
If you want to define your own conditions, such as the incomplete battle challenge request page, then you will need to override the existing canDisplayForm() proc. This proc belongs to the /upForm datum, and the arg is the client whom the form is being sent to. Here is how you could disallow a battle challenge to be sent if the player is currently in a battle:
The important part of the code is the implementation of canDisplayForm() in the above example. Notice how the proc calls and sets the default return value to . to further extend the behaviour of the original functionality. That way, we do not overwrite the original library functionality that prevents forms from interrupting other forms. Using this method, you can easily add more and more conditions to whether a form can be displayed.
Most commonly, you will want not want two windows of the same type to be displayed to the player. The library defines a client proc, upForm_isViewingForm() to easily check whether a certain player is viewing a certain form, or type of form. The arg for the proc accepts either an instance, a path, or a tag. It will return true a valid instance is found in the list. A window that should not be displayed more than once to the user at one given time would use this proc to check if any instances of the same type of the window we are trying to send is in the client's form list (to be explained in the next section). A definition of a window of such would look like this:
There may be several cases when you will want to have many players be viewing the same page. With this in mind, the library has support for multiple viewers. To display a form to many players, you will want to specify the target when you call upForm() as a list of clients and/or mobs. When you send a list, the library will know whether to display the form to one or many players. Here's a small example on how to display "Hello" to everyone in the world.
Fundamentally, the only difference between having a form that is only displayable to one player opposed to many players is that you will need to handle the case when a page is not successfully sent to a set of clients. The library makes it as easy as possible to catch these types of errors. When a form has failed to be sent to a client, then it will not be inside the upForms client variable. upForms is a list that contains all of the instances of forms that the client is currently viewing. To catch any cases where a form is incorrectly sent, you can loop through the list of clients you generated to check whether the form instance is located in the list by using the upForm_isViewingForm() proc, and sending the reference of the stored form through the arg.
The code above displays the clients who would not have that form displayed to their screens. You can use this to handle the case when a form is not possible to be displayed to a client's screen. By default, a client can't have an interface that interrupts an existing interface that is on the client's screen. For example, you cannot have two form objects that display to the same browser interfaces.
There are many ways to handle multiple viewers, and incorporate it with what the body displays. The /upForm datum stores the viewers in the viewers list variable. By looping through the list, you can create a form that will display all of the viewers currently viewing the form.
Global interfaces are a fancy way of saying a type of interface that would be shared by many viewers, yet will still exist when there are no viewers. These types of forms are created with the purpose that viewers will be freely added or removed from the form at a later time.
To create a global interface, you must: define the UPFORM_SET_SHARED flag in the settings var of the form definition, and call upForm() with a null target. Here is how you would define a global interface that displays "Hello world" by adding the player to the viewer list.
Note that the way that we are handling the form is by calling AddViewer() and RemoveViewer() respectively to display and close the form for the viewer. Although this is not a practical usage of a shared interface, you could use this model for something much more usable, such as a player list that updates when a player logs in or out. If you want the page to regenerate when a viewer is added or removed, then you will want to turn on the UPFORM_SET_RELOAD_ON_VIEWER_UPDATE flag. This example does not need it because it displays a constant message, but a dynamic player list interface would definitely want to be updated.
Handling HTML forms is the main purpose of this library, hence its name. HTML forms are commonly used in websites that allow you to enter a set of information, and process it all at one time. The upForm datum gives you a plethora of functions and resources to make form handling as easy and intuitive as possible. There are three procs that you must implement when handling forms: FormInitTempVars(), FormSetTempVars(), and ProcessVariable().
To tell the datum that you want it to handle forms for you, you will have to turn on the UPFORM_SET_HANDLE_FORMS flag in the settings var. When the flag is on, the form object will know to separately handle any form data through its form functions. Next, you will have to implement the FormInitTempVars() proc. This proc uses the initFormVar() proc to set the initial values of the entries of a form control that you will eventually define in the body of your page. initFormVar() takes three args in this order: the form name, the variable name, and the value of the variable. For every single form, and form input, you will have to call initFormVar() to initialize and declare the value of the input of a certain form. Internally, this creates indexes for the values of a form to be recalled later. The form stores all of the values, whether they are valid or invalid, for future reference.
You also will have to implement the mirrored function, FormSetTempVars(). Opposed to the above proc that was explained, this proc gets called when a form is successfully submitted, and you want to set the variables that were submitted, or perform some other action. The argument that is sent through the proc is the name of the form that was submitted, so you can set the correct values of the variables. To get the values of the internally-stored variables, you must use the proc getFormVar(), which takes the form name and input name as the args, respectively. The proc returns the value of the input control, given the form name and input name that you have sent through the args. In FormSetTempVars(), you will set the variables that you intended to change using the HTML form. getFormVar() is also used when you write the HTML code for your form. You use this proc to get the value of the control in the page.
The other main proc that you will need to override is ProcessVariable(). This proc gets called when a form is submitted, and variables need to be processed. It is called for every single input that you have defined in your form. The proc's args hold three variables: the form name, the input name, and the value of the variable as a text string. You are expected to set the value of the input that was sent by using the setFormVar() proc, which also requires the same 3 args. If the variable is not valid, you must return a text string with the error, which you may choose to display on the screen.
When handling forms, GeneratePage() will have a list sent to it if there are errors in the page. This list is an associative list containing the values for the name of the input, and the error associated with the input which was returned by ProcessVariable(). This gives you the option of displaying an error on a screen for a particular variable such as the case of having too many characters in your name, or if you attempt to write a negative number for your age.
Writing an HTML form is not simple, so here is a relatively simple example for a page that has a form that will accept a name and a password.
There are some things you may have noticed in the above example. When you are generating a page with an HTML form, you must have two hidden inputs sending information about the form reference, and the name of the form. This will allow the HTML form to be handled by the form functions rather than Link(). A generic form would look like this:
Another thing you may have noticed is that we can override the FormSubmitSuccess() proc to do something on the event of a successful form submission. The name of the form is sent through the arg. By default, it reloads the page. In the above example, we close the form when the submission is successful. There is also the FormSubmitError() proc, which is called when a form with a validation error is sent. By default, it reloads the page with the errors. The form name and list of error is sent through the args.
HTML forms are a useful and powerful tool to quickly submit and review information all at one go. The library can support as many forms as you like, but you will have to specify the form values for each of them.
Timers are a simple yet useful feature for forms, and have been supported in this library due to the convenience of having an internal timer rather than having to manually implement timing or handling the time externally. Time is mainly handled with the time_left variable. This is the time (measured in ticks) left that until the page will be deleted. If you define an upForm datum with the time being a positive non-zero integer, then the form will be deleted in that duration.
This is the most common usage of a timed interface, which closes the page after a certain time. If you want finer control over the time, then you can modify the time_interval variable. By default, it is 10 ticks, which means that the timer will update every 10 ticks. This variable usually does not need to be changed, but if you want the form to be deleted in an interval of less than 10 ticks, then you will want to modify this number so time_left % time_interval = 0.
However, the main purpose of the time_interval variable is to control the refresh rate of a timed form that you want updated within the interval you defined. If the time_update variable is 1, then the page will be regenerated once per time_interval ticks. This is useful if you want the viewers to know the value of the counter. Below is an example showing a countdown from 10 to 0.
The above example uses two new procs: TimeUp() and hasTimeStarted(). As the names of the procs imply, TimeUp() is called when the timer reaches zero. By default, it will delete the form when the time runs out. The time bomb example overrides the functionality to prevent the timer from deleting the form so a message could instead be displayed. hasTimeStarted() returns true if the timer is running. This proc is useful if you want to display something different when the timer is running.
Two other procs exist for timers. TimeStarted(), similar to TimeUp() is called when the timer is started. If time_left is defined in the form definition, then it will be called when the form is created. If you don't want the timer to start when the form is created, then you can call StartTimer() manually, submitting the time in ticks through the arg. This will manually start the timer if it hasn't started already. StartTimer() will not sleep, so you do not need to call spawn().
The features explained in this section do not require as much depth as the above features, and are mainly used for convenience.
The interface_bgstyle variable is used for the specific case of an form with the form_type of UPFORM_INTERFACE or UPFORM_BROWSER. By default, when a form is closed, it will remove all of the text from the browser control. BYOND will display a blank white screen. In the case that you don't want a white background to be displayed, interface_bgstyle is used to display an empty page with a custom CSS definition. So if your game has a dark background, then you may want to define the variable as a dark grey background for the blank page.