Chapter 32 Multivariate analysis of variance
Packages for this chapter:
library(car)
library(tidyverse)
32.1 Fabricated data
The data in
link
(probably made up) are measurements of two
variables y1
and y2
on three groups, labelled
a
, b
and c
. We want to see whether
y1
or y2
or some combination of them differ among
the groups.
Read in the data and check that you have 12 observations on 2 numeric variables from 3 different groups.
Run a one-way ANOVA predicting
y1
fromgroup
. Are there any significant differences iny1
among the groups? If necessary, run Tukey. What do you conclude?Repeat all the previous part for
y2
.Make a plot of
y1
againsty2
, with the points distinguished by which group they are from.How is it that group
b
is not distinguishable on eithery1
ory2
individually (from the ANOVAs), but is distinguishable on your graph? Explain briefly.Run a one-way multivariate analysis of variance, obtaining a P-value. Note the very small P-value.
32.2 Do characteristics of urine depend on obesity?
A study was made of the characteristics of urine of young
men. The men were classified into four groups based on their degree of
obesity. (The groups are labelled a, b, c, d
.) Four variables
were measured, x
(which you can ignore), pigment creatinine,
chloride and chlorine. The data are in
link as a
.csv
file. There are 45 men altogether.
Read in the data and check that you have the right number of observations and the right variables.
Make boxplots of each of the three variables of interest against obesity group.
How, if at all, do the groups differ on the variables of interest?
Run a multivariate analysis of variance, using the three variables of interest as response variables, and the obesity group as explanatory. (This is a so-called one-way MANOVA.)
What do you conclude? Is this in line with what your boxplots said? Explain briefly.
32.3 How do height and weight depend on sport played by elite athletes?
This question uses the data on Australian elite athletes,
which can be found at
link. 202 elite
athletes had various physical and physiological measurements taken,
and for each athlete, their gender (in the column Sex
) and
the sport they play (Sport
) was also noted. The data values
are separated by tabs, meaning that read_tsv
will
read them in.
Read in the data and verify that you have 202 rows and 13 columns.
We are going to see whether the height-weight combination of an athlete depends significantly on which sport they play and which gender they are. Explain (very) briefly why a multivariate analysis of variance will be necessary to do this.
Create a response variable for a MANOVA. (You don’t need to show what you got, since it is rather big.) The columns you want are called
Ht
andWt
.Run a multivariate analysis of variance to see whether the height-weight combination depends significantly on gender, sport or the combination of both. Display the results. Use the small-m
manova
way to do this one.Briefly justify removing the interaction term from your previous model, and fit a model without it. You can use either
manova
orManova
for this; they should both work. (You only need to use one of them.) Display your results.See if you can make a graph that shows what’s going on here. Bear in mind that you have two quantitative variables and two categorical ones, so you will need to find a way to display everything. Hint: what would you do with two quantitative variables and one categorical one? Can you find a way to generalize that idea by displaying the other categorical variable differently? I think we have seen a couple of ideas that will work, somewhere in the lecture notes (but in a different context). Or you can search for ideas, of course. For full marks, obtain a plot which does not give you any warnings. (The grader will know which of the possible plots give warnings, and will deduct extra marks if you assert that a plot gives no warnings when in fact it does. That is to say, if you get any warnings, you need to include those in what you hand in).
My solutions follow:
32.4 Fabricated data
The data in
link
(probably made up) are measurements of two
variables y1
and y2
on three groups, labelled
a
, b
and c
. We want to see whether
y1
or y2
or some combination of them differ among
the groups.
- Read in the data and check that you have 12 observations on 2 numeric variables from 3 different groups.
Solution
<- "http://ritsokiguess.site/datafiles/simple-manova.txt"
my_url <- read_delim(my_url, " ") simple
## Rows: 12 Columns: 3
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: " "
## chr (1): group
## dbl (2): y1, y2
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
simple
## # A tibble: 12 × 3
## group y1 y2
## <chr> <dbl> <dbl>
## 1 a 2 3
## 2 a 3 4
## 3 a 5 4
## 4 a 2 5
## 5 b 4 8
## 6 b 5 6
## 7 b 5 7
## 8 c 7 6
## 9 c 8 7
## 10 c 10 8
## 11 c 9 5
## 12 c 7 6
As promised: 12 observations, 2 numeric variables y1
and
y2
, and one categorical variable (as text) containing three
groups a,b,c
.
\(\blacksquare\)
- Run a one-way ANOVA predicting
y1
fromgroup
. Are there any significant differences iny1
among the groups? If necessary, run Tukey. What do you conclude?
Solution
.1 <- aov(y1 ~ group, data = simple)
simplesummary(simple.1)
## Df Sum Sq Mean Sq F value Pr(>F)
## group 2 63.45 31.72 21.2 0.000393 ***
## Residuals 9 13.47 1.50
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(simple.1)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = y1 ~ group, data = simple)
##
## $group
## diff lwr upr p adj
## b-a 1.666667 -0.9417891 4.275122 0.2289181
## c-a 5.200000 2.9089670 7.491033 0.0003548
## c-b 3.533333 1.0391725 6.027494 0.0083999
The \(F\)-test said that there were differences among the groups, so I
ran Tukey and found that group c
is significantly bigger on
y1
than the other two groups.
\(\blacksquare\)
- Repeat all the previous part for
y2
.
Solution
.2 <- aov(y2 ~ group, data = simple)
simplesummary(simple.2)
## Df Sum Sq Mean Sq F value Pr(>F)
## group 2 19.05 9.525 9.318 0.00642 **
## Residuals 9 9.20 1.022
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
TukeyHSD(simple.2)
## Tukey multiple comparisons of means
## 95% family-wise confidence level
##
## Fit: aov(formula = y2 ~ group, data = simple)
##
## $group
## diff lwr upr p adj
## b-a 3.0 0.8440070 5.155993 0.0093251
## c-a 2.4 0.5063697 4.293630 0.0157279
## c-b -0.6 -2.6615236 1.461524 0.7050026
Same idea: there is a difference, and Tukey reveals that this time
group a
is significantly smaller than the other groups
on y2
.
\(\blacksquare\)
- Make a plot of
y1
againsty2
, with the points distinguished by which group they are from.
Solution
y1
and y2
can be either way around, since
they are both response variables (!):
ggplot(simple, aes(x = y1, y = y2, colour = group)) + geom_point()
\(\blacksquare\)
- How is it that group
b
is not distinguishable on eithery1
ory2
individually (from the ANOVAs), but is distinguishable on your graph? Explain briefly.
Solution
Group b
has the same kind of y1
values as group
a
and the same kind of y2
values as group
c
. This means looking at either variable singly is not
enough to distinguish group b
. But group b
stands out on the graph as being “top left” of the picture. That
means that y1
has to be low and y2
has to
be high, both together, to pick out group b
.
That seems like a lot of work, but the important point
that I want you to raise is that the points in group b
are distinguished by a particular combination of values of
y1
and y2
.
\(\blacksquare\)
- Run a one-way multivariate analysis of variance, obtaining a P-value. Note the very small P-value.
Solution
This is just like the seed weight and yield example in class (deliberately so):
<- with(simple, cbind(y1, y2))
response .3 <- manova(response ~ group, data = simple)
simplesummary(simple.3)
## Df Pillai approx F num Df den Df Pr(>F)
## group 2 1.3534 9.4196 4 18 0.0002735 ***
## Residuals 9
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
The P-value here, 0.00027, is smaller than either of the P-values for
the one-variable ANOVAs. This expresses the idea that the group
difference is essentially multivariate (it depends on the
combination of y1
and y2
values). I only
wanted you to note that it is smaller than either of the other
ANOVAs; you don’t need to say anything about why.
For completeness, we should do Box’s M test as well:
summary(BoxM(response, simple$group))
## Box's M Test
##
## Chi-Squared Value = 3.517357 , df = 6 and p-value: 0.742
No problems here at all.
We were in the fortunate position of being able to draw a picture, because we had only two response variables, and we could plot them against each other with the groups labelled. (If we had three response variables, like the peanuts example, we wouldn’t be able to do this, barring some kind of 3D-plotting procedure.)
\(\blacksquare\)
32.5 Do characteristics of urine depend on obesity?
A study was made of the characteristics of urine of young
men. The men were classified into four groups based on their degree of
obesity. (The groups are labelled a, b, c, d
.) Four variables
were measured, x
(which you can ignore), pigment creatinine,
chloride and chlorine. The data are in
link as a
.csv
file. There are 45 men altogether.
- Read in the data and check that you have the right number of observations and the right variables.
Solution
read_csv
:
<- "http://ritsokiguess.site/datafiles/urine.csv"
my_url <- read_csv(my_url) urine
## Rows: 45 Columns: 5
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (1): obesity
## dbl (4): x, creatinine, chloride, chlorine
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
urine
## # A tibble: 45 × 5
## obesity x creatinine chloride chlorine
## <chr> <dbl> <dbl> <dbl> <dbl>
## 1 a 24 17.6 5.15 7.5
## 2 a 32 13.4 5.75 7.1
## 3 a 17 20.3 4.35 2.3
## 4 a 30 22.3 7.55 4
## 5 a 30 20.5 8.5 2
## 6 a 27 18.5 10.2 2
## 7 a 25 12.1 5.95 16.8
## 8 a 30 12 6.3 14.5
## 9 a 28 10.1 5.45 0.9
## 10 a 24 14.7 3.75 2
## # … with 35 more rows
The variables are as promised, and we do indeed have 45 rows.
\(\blacksquare\)
- Make boxplots of each of the three variables of interest against obesity group.
Solution
Just churn through it:
ggplot(urine, aes(x = obesity, y = creatinine)) + geom_boxplot()
ggplot(urine, aes(x = obesity, y = chlorine)) + geom_boxplot()
ggplot(urine, aes(x = obesity, y = chloride)) + geom_boxplot()
This also works with facets, though it is different from the other ones we’ve done, in that we have to collect together the \(y\)-variables first rather than the \(x\)s:
%>%
urine pivot_longer(creatinine:chlorine, names_to="yname", values_to="y") %>%
ggplot(aes(x = obesity, y = y)) + geom_boxplot() +
facet_wrap(~yname, scales = "free", ncol = 2)
I decided to throw a couple of things in here: first, the
scales="free"
thing since the \(y\)-variables (this time) are
on different scales, and second, the ncol=2
to arrange the
facets in (3 cells of) a \(2\times 2\) grid, rather than having them
come out tall and skinny.36 It’s unusual to have faceted boxplots, but this is one
of those cases where it makes sense. (The key is different \(y\)’s but
the same \(x\), I think.)
The conclusions about the boxplots are, of course, the same. I think it makes it easier to have the three boxplots side by side, but it’s up to you whether you think that gain is worth the extra coding.
Extra: let’s take another look at that longer data frame:
%>%
urine pivot_longer(creatinine:chlorine, names_to="yname", values_to="y")
## # A tibble: 135 × 4
## obesity x yname y
## <chr> <dbl> <chr> <dbl>
## 1 a 24 creatinine 17.6
## 2 a 24 chloride 5.15
## 3 a 24 chlorine 7.5
## 4 a 32 creatinine 13.4
## 5 a 32 chloride 5.75
## 6 a 32 chlorine 7.1
## 7 a 17 creatinine 20.3
## 8 a 17 chloride 4.35
## 9 a 17 chlorine 2.3
## 10 a 30 creatinine 22.3
## # … with 125 more rows
You might say that there is one quantitative variable now, the thing we called y
, and two categorical variables, obesity
and yname
. So why not make a grouped boxplot? All right:
%>%
urine pivot_longer(creatinine:chlorine, names_to="yname", values_to="y") %>%
ggplot(aes(x=yname, y=y, colour=obesity)) + geom_boxplot()
This actually looks a lot like the facetted boxplots (if you imagine drawing a box around each group of four boxplots and removing the scales="free"
before). There is, as the saying goes, more than one way to skin a cat.
\(\blacksquare\)
- How, if at all, do the groups differ on the variables of interest?
Solution
Any sensible comment here is good. You can take the approach that group D is lowest on creatinine and chloride, but there is not much to choose (given the amount of variability) on chlorine. Or you can say that groups B and C are generally highest, except for chloride where A is higher. Anything of this general kind is fine. The point here is that some of the groups appear to be different on some of the variables, which would make a multivariate analysis of variance (in a moment) come out significant.
\(\blacksquare\)
- Run a multivariate analysis of variance, using the three variables of interest as response variables, and the obesity group as explanatory. (This is a so-called one-way MANOVA.)
Solution
Create the response variable and run manova
:
<- with(urine, cbind(creatinine, chlorine, chloride))
response .1 <- manova(response ~ obesity, data = urine)
urinesummary(urine.1)
## Df Pillai approx F num Df den Df Pr(>F)
## obesity 3 0.43144 2.2956 9 123 0.02034 *
## Residuals 41
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
At some point, you should run Box’s M test, either here or at the start of the next part (before you get to your conclusions):
summary(BoxM(response, urine$obesity))
## Box's M Test
##
## Chi-Squared Value = 30.8322 , df = 18 and p-value: 0.0301
This P-value is small, but not, for this test, small enough to be a problem.
\(\blacksquare\)
- What do you conclude? Is this in line with what your boxplots said? Explain briefly.
Solution
The null hypothesis (that each of the variables have the same mean for each of the groups) is rejected: that is, not all of the groups have the same mean on all of the variables. Based on the idea that there seemed to be differences between the groups in the boxplots, this makes sense. (That’s what I saw, anyway. There was a lot of variability within the groups, which is why the P-value didn’t come out smaller.)
Extra: the other way of doing this is the following, using
Manova
from car
:
.1 <- lm(response ~ obesity, data = urine)
responsesummary(Manova(response.1))
##
## Type II MANOVA Tests:
##
## Sum of squares and products for error:
## creatinine chlorine chloride
## creatinine 496.768761 -225.02136 4.507476
## chlorine -225.021364 1431.85432 86.226818
## chloride 4.507476 86.22682 152.854274
##
## ------------------------------------------
##
## Term: obesity
##
## Sum of squares and products for the hypothesis:
## creatinine chlorine chloride
## creatinine 181.07035 -66.72530 40.03686
## chlorine -66.72530 103.80568 -41.37182
## chloride 40.03686 -41.37182 20.03773
##
## Multivariate Tests: obesity
## Df test stat approx F num Df den Df Pr(>F)
## Pillai 3 0.4314359 2.295559 9 123.00000 0.0203377 *
## Wilks 3 0.6080320 2.395937 9 95.06636 0.0171207 *
## Hotelling-Lawley 3 0.5800706 2.427703 9 113.00000 0.0146529 *
## Roy 3 0.4336849 5.927027 3 41.00000 0.0018659 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
manova
gives you the Pillai test, but Manova
gives you all four; here, they are all significant, but to different degrees.
The result is the same, or at least consistent. You don’t need do this one here (though you
can as an alternative), but when you come to repeated measures you
will need to be able to use Manova
.
To understand the differences in the variables due to the groups, we need to run a discriminant analysis (coming up later).
\(\blacksquare\)
32.6 How do height and weight depend on sport played by elite athletes?
This question uses the data on Australian elite athletes,
which can be found at
link. 202 elite
athletes had various physical and physiological measurements taken,
and for each athlete, their gender (in the column Sex
) and
the sport they play (Sport
) was also noted. The data values
are separated by tabs, meaning that read_tsv
will
read them in.
- Read in the data and verify that you have 202 rows and 13 columns.
Solution
As in the hint:
<- "http://ritsokiguess.site/datafiles/ais.txt"
my_url <- read_tsv(my_url) athletes
## Rows: 202 Columns: 13
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: "\t"
## chr (2): Sex, Sport
## dbl (11): RCC, WCC, Hc, Hg, Ferr, BMI, SSF, %Bfat, LBM, Ht, Wt
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
athletes
## # A tibble: 202 × 13
## Sex Sport RCC WCC Hc Hg Ferr BMI SSF `%Bfat` LBM Ht
## <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 female Netball 4.56 13.3 42.2 13.6 20 19.2 49 11.3 53.1 177.
## 2 female Netball 4.15 6 38 12.7 59 21.2 110. 25.3 47.1 173.
## 3 female Netball 4.16 7.6 37.5 12.3 22 21.4 89 19.4 53.4 176
## 4 female Netball 4.32 6.4 37.7 12.3 30 21.0 98.3 19.6 48.8 170.
## 5 female Netball 4.06 5.8 38.7 12.8 78 21.8 122. 23.1 56.0 183
## 6 female Netball 4.12 6.1 36.6 11.8 21 21.4 90.4 16.9 56.4 178.
## 7 female Netball 4.17 5 37.4 12.7 109 21.5 107. 21.3 53.1 177.
## 8 female Netball 3.8 6.6 36.5 12.4 102 24.4 157. 26.6 54.4 174.
## 9 female Netball 3.96 5.5 36.3 12.4 71 22.6 101. 17.9 56.0 174.
## 10 female Netball 4.44 9.7 41.4 14.1 64 22.8 126. 25.0 51.6 174.
## # … with 192 more rows, and 1 more variable: Wt <dbl>
202 rows and 13 columns indeed.
\(\blacksquare\)
- We are going to see whether the height-weight combination of an athlete depends significantly on which sport they play and which gender they are. Explain (very) briefly why a multivariate analysis of variance will be necessary to do this.
Solution
We now have two response variables, height and weight, rather than just one. In order to do a test with more than one response variable, we need to use multivariate ANOVA rather than regular ANOVA. (The first sentence is enough.)
Extra: the explanatory variables, sport and gender, are both categorical here, which makes a MANOVA work. If either of them had been quantitative, we would have needed to do a multivariate regression, which is beyond the scope of what we do in this course.
\(\blacksquare\)
- Create a response variable for a MANOVA. (You don’t need to
show what you got, since it is rather big.) The columns you want are
called
Ht
andWt
.
Solution
Use cbind
to glue the two columns together:
<- with(athletes, cbind(Ht, Wt)) response
Either way around, height or weight first, is good. Also good is the
dollar sign, which you’ll need to do twice (and thus the with
way is more elegant):
<- cbind(athletes$Ht, athletes$Wt) response_a
\(\blacksquare\)
- Run a multivariate analysis of variance to see whether the
height-weight combination depends significantly on gender, sport or the
combination of both. Display the results. Use the small-m
manova
way to do this one.
Solution
The straightforward way is small-m manova
. I don’t know
what I should be calling my fitted model object, so I’m making
something up. Don’t forget to use the right names for the
variables, and to include an interaction:
.1 <- manova(response ~ Sex * Sport, data = athletes)
htwtsummary(htwt.1)
## Df Pillai approx F num Df den Df Pr(>F)
## Sex 1 0.52412 101.325 2 184 <2e-16 ***
## Sport 9 0.87914 16.123 18 370 <2e-16 ***
## Sex:Sport 6 0.04105 0.646 12 370 0.8023
## Residuals 185
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
%>%
athletes unite("combo", c(Sex, Sport)) -> athletes_combo
summary(BoxM(response, athletes_combo$combo))
## Box's M Test
##
## Chi-Squared Value = 86.605 , df = 48 and p-value: 0.000537
This test gives just small enough a P-value to be worried about (remembering that less than 0.001 is the problem zone). It seems unlikely, though, that the right test (whatever it is) would produce a significant interaction.
The other way is apparently to use large-M Manova
from package
car
. This goes as a two-stage process: fit an lm
first with the same model formula as above, and then pass that
into Manova
. This way, you just display the final result,
rather than passing it into summary
:
.2 <- lm(response ~ Sex * Sport, data = athletes)
htwtManova(htwt.2)
## Error in Anova.mlm(mod, ...): model is singular
Except that this doesn’t work, for reasons that I don’t
understand. htwt.2
is fine; it’s the Manova
that is
not working.
\(\blacksquare\)
- Briefly justify removing the interaction term from your
previous model, and fit a model without it. You can use either
manova
orManova
for this; they should both work. (You only need to use one of them.) Display your results.
Solution
The interaction should come out, since it is not
significant. (This is what I meant by “briefly.”)
To do that, in each case, replace the *
with a +
, or use
update
.  - Sex:Sport) htwt
## Error in if (projections) qr <- lmcall$qr <- TRUE: the condition has length > 1
It seems that manova
things don’t like update
.  - Sex:Sport)
htwt.9 <- Manova(htwt.8)
htwtsummary(htwt.9)
##
## Type II MANOVA Tests:
##
## Sum of squares and products for error:
## Ht Wt
## Ht 6871.978 5842.771
## Wt 5842.771 13613.021
##
## ------------------------------------------
##
## Term: Sex
##
## Sum of squares and products for the hypothesis:
## Ht Wt
## Ht 4582.744 6146.078
## Wt 6146.078 8242.718
##
## Multivariate Tests: Sex
## Df test stat approx F num Df den Df Pr(>F)
## Pillai 1 0.4427781 75.48862 2 190 < 2.22e-16 ***
## Wilks 1 0.5572219 75.48862 2 190 < 2.22e-16 ***
## Hotelling-Lawley 1 0.7946171 75.48862 2 190 < 2.22e-16 ***
## Roy 1 0.7946171 75.48862 2 190 < 2.22e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## ------------------------------------------
##
## Term: Sport
##
## Sum of squares and products for the hypothesis:
## Ht Wt
## Ht 6162.455 7070.085
## Wt 7070.085 13727.950
##
## Multivariate Tests: Sport
## Df test stat approx F num Df den Df Pr(>F)
## Pillai 9 0.8692278 16.31358 18 382 < 2.22e-16 ***
## Wilks 9 0.3132928 16.60578 18 380 < 2.22e-16 ***
## Hotelling-Lawley 9 1.6093145 16.89780 18 378 < 2.22e-16 ***
## Roy 9 1.0593835 22.48247 9 191 < 2.22e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
These both work, and give the same answer. I think this is because the
thing being update
d is a regular lm
; the
Manova
bit comes after, and is calculated from the
lm
fit.
Any of these is good, and gets you the same answer.
The way you run Box’s M test on these is on each explanatory variable separately:
summary(BoxM(response, athletes$Sex))
## Box's M Test
##
## Chi-Squared Value = 3.98602 , df = 3 and p-value: 0.263
summary(BoxM(response, athletes$Sport))
## Box's M Test
##
## Chi-Squared Value = 68.16926 , df = 27 and p-value: 2.04e-05
The second of these, the one for Sport, is small enough to be a problem, but the P-value in the MANOVA for Sport is extremely small, so we should be safe.
Extra: more about the summary
output from Manova
:
summary(htwt.9)
##
## Type II MANOVA Tests:
##
## Sum of squares and products for error:
## Ht Wt
## Ht 6871.978 5842.771
## Wt 5842.771 13613.021
##
## ------------------------------------------
##
## Term: Sex
##
## Sum of squares and products for the hypothesis:
## Ht Wt
## Ht 4582.744 6146.078
## Wt 6146.078 8242.718
##
## Multivariate Tests: Sex
## Df test stat approx F num Df den Df Pr(>F)
## Pillai 1 0.4427781 75.48862 2 190 < 2.22e-16 ***
## Wilks 1 0.5572219 75.48862 2 190 < 2.22e-16 ***
## Hotelling-Lawley 1 0.7946171 75.48862 2 190 < 2.22e-16 ***
## Roy 1 0.7946171 75.48862 2 190 < 2.22e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## ------------------------------------------
##
## Term: Sport
##
## Sum of squares and products for the hypothesis:
## Ht Wt
## Ht 6162.455 7070.085
## Wt 7070.085 13727.950
##
## Multivariate Tests: Sport
## Df test stat approx F num Df den Df Pr(>F)
## Pillai 9 0.8692278 16.31358 18 382 < 2.22e-16 ***
## Wilks 9 0.3132928 16.60578 18 380 < 2.22e-16 ***
## Hotelling-Lawley 9 1.6093145 16.89780 18 378 < 2.22e-16 ***
## Roy 9 1.0593835 22.48247 9 191 < 2.22e-16 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
There are actually four competing tests that generalize the one-response-variable \(F\) statistic in different ways. If you go looking in a text on multivariate analysis, you’ll also see about all four of them, especially Wilks’s \(\Lambda\) (that’s a capital lambda). They will generally agree in terms of conclusion, but you should probably at least glance at all of them.
I am in danger of running out of numbers for my fitted models (and am definitely in danger of forgetting which one is which)!
\(\blacksquare\)
- See if you can make a graph that shows what’s going on here. Bear in mind that you have two quantitative variables and two categorical ones, so you will need to find a way to display everything. Hint: what would you do with two quantitative variables and one categorical one? Can you find a way to generalize that idea by displaying the other categorical variable differently? I think we have seen a couple of ideas that will work, somewhere in the lecture notes (but in a different context). Or you can search for ideas, of course. For full marks, obtain a plot which does not give you any warnings. (The grader will know which of the possible plots give warnings, and will deduct extra marks if you assert that a plot gives no warnings when in fact it does. That is to say, if you get any warnings, you need to include those in what you hand in).
Solution
This will probably involve a bit of digging.
The starting point would be a scatterplot (the two quantitative
variables) with the points distinguished by colour (one of the
categorical variables). What other options do we have?
If you look eg. at the navigation on the left of
link, you’ll
see that there are two likely possibilities: shape
and
size
. shape
uses a different plotting symbol for
each value of a categorical variable; size
draws the
plotting symbol bigger or smaller according to the value of a
categorical variable.
The remaining question is the one of which aesthetic to “map” to
which variable? To guide you in this, note that we have ten
different sports and two different genders. In my opinion, colours
are the easiest to distinguish a lot of, though even then 10 is
pushing it, then plotting symbols. Symbol sizes are hard to
distinguish a lot of, so it’s best to limit this (if you use it at
all) to gender.
With that in mind, I would go for this one:
ggplot(athletes, aes(x = Ht, y = Wt, colour = Sport, shape = Sex)) + geom_point()
If you investigate, you’ll find that ggplot
can handle about
six different shapes (and we have ten sports), and it doesn’t care for
using size
to distinguish values of a categorical
variable. It will try to draw the graph, but will give you a warning,
such as these:
ggplot(athletes, aes(x = Ht, y = Wt, colour = Sport, size = Sex)) + geom_point()
## Warning: Using size for a discrete variable is not advised.
ggplot(athletes, aes(x = Ht, y = Wt, shape = Sport, size = Sex)) + geom_point()
## Warning: Using size for a discrete variable is not advised.
## Warning: The shape palette can deal with a maximum of 6 discrete values because
## more than 6 becomes difficult to discriminate; you have 10. Consider
## specifying shapes manually if you must have them.
## Warning: Removed 72 rows containing missing values (geom_point).
ggplot(athletes, aes(x = Ht, y = Wt, shape = Sport, colour = Sex)) + geom_point()
## Warning: The shape palette can deal with a maximum of 6 discrete values because
## more than 6 becomes difficult to discriminate; you have 10. Consider
## specifying shapes manually if you must have them.
## Warning: Removed 72 rows containing missing values (geom_point).
Whatever plot you come up with, you can put height and weight on the other axes, since neither one of them is uniquely a response variable.
Any of these graphs with warnings do the job, kind of, so they get 2 points.
One of the many well-thought-out things about ggplot2
is that
making this graph was actually not difficult once you had figured out
that you also had shape
and size
at your
disposal. (In addition, ggplot2
will help you make some
aesthetic decisions about which variable is distinguished by what kind
of thing. This will help you work towards a plot that doesn’t have any
warnings. These warnings are pretty clear about what not to do, and by
implication what you need to do instead. Colour, for example, is
always safe warning-wise.)
The model for this kind of graph that we saw is the plot of probability (of preferring different brands of a product) as it depended on age (two quantitative variables) for each brand and gender (two categorical variables). I had three brands and two genders there, so I used colour for brand and shape for gender, but it would have worked about as well if I’d used shape for brand and colour for gender.
The warning message for shape
contains the words ``specify
shapes manually if you must have them’’. I was wondering how you can
avoid that. Here’s how:
ggplot(athletes, aes(x = Ht, y = Wt, shape = Sport, colour = Sex)) + geom_point() +
scale_shape_manual(values = 1:10)
I agree with ggplot2
that this many shapes are hard to tell
apart,37 but if you can figure this out,
you achieve the goal of producing a plot with no warnings, so you get
full marks. (We need 10 shapes because there are 10 different sports,
so we have to specify 10 different values in values=
: any 10
different values will do. A list of the possible shapes is in
link,
at the bottom. You can even use regular letters, but you have to refer
to them by numeric code:
ggplot(athletes, aes(x = Ht, y = Wt, shape = Sport, colour = Sex)) + geom_point() +
scale_shape_manual(values = c(66, 70, 71, 78, 82, 83, 52, 84, 3, 87))
I had to find something for TSprnt
, since all the letters
appeared to be taken.
On consideration, I like this last graph the best, because the letters are more or less reminders of which sport each point is (they are “mnemonic”, so you don’t have to look them up all the time, as with colours or shapes: you can eventually remember which is which).
Whatever you come up with, expect: 3 marks if you get a plot with no warnings, 2 marks if you get a plot with warnings, 1 mark if you get a plot that would produce warnings but you don’t indicate that there are warnings, either by saying so or by including the warnings in what you hand in.
I didn’t ask you to interpret your plot (just getting it was enough work), but there seems to be a common theme that, for sports played by both genders, that the athletes are in about the same place relative to the other ones in their gender (eg., the basketball players are tall and heavy, the field athletes are really heavy but not very tall), but male athletes are both taller and heavier than female athletes playing the same sport. This consistency of pattern was probably why the interaction was nowhere near significant: there are additive separate effects of sport and of gender on the height-weight combination.
\(\blacksquare\)


Files CCore/inc/gadget/UtilFunc.h CCore/src/gadget/UtilFunc.cpp
Here is a collection of some popular functions.
ToConst() makes a constant reference from a reference. Sometimes useful.
template <class T>
const T & ToConst(T &obj) { return obj; }
Min()/Max() — these functions are intended to be used with simple types and can be used in constant expressions. They are implemented in a straightforward way.
template <class T> constexpr T Min(T a,T b) { return (a<b)?a:b; } template <class T> constexpr T Max(T a,T b) { return (a<b)?b:a; }
Min_cast()/Max_cast() — are multi-argument min/max functions, they also cast extra arguments to the type of the first one.
template <class T> constexpr T Min_cast(T a,AnyType ... args); template <class T> constexpr T Max_cast(T a,AnyType ... args);
Cap() adjusts the given value x to fit it into the given interval [a,b]. To work properly, make sure that a <= b. If x is too low, a is returned, if x is too large, b is returned. Otherwise, x is returned. Pay attention, that x is a middle argument!
template <class T>
constexpr T Cap(T a,T x,T b) { return (x<a)?a:( (b<x)?b:x ); }
Fit() checks that the given value x belongs to the interval [a,b]. To work properly, make sure that a <= b. Pay attention, that x is a middle argument!
template <class T>
constexpr bool Fit(T a,T x,T b) { return a<=x && x<=b; }
Sq() calculates the square of the argument.
template <class T>
constexpr T Sq(T x) { return x*x; }
Diff() performs differentiation, i.e. subtracts a value from the previous one and records the new value.
template <class T>
T Diff(T &t,T a) { T ret(a-t); t=a; return ret; }
Consider an example:
int var=x0; int d1=Diff(var,x1); // d1 <- x1-x0 , var <- x1 int d2=Diff(var,x2); // d2 <- x2-x1 , var <- x2 int d3=Diff(var,x3); // d3 <- x3-x2 , var <- x3
Change() assigns a new value if it is different than the old value of the object. If this happens the return value is true, otherwise — false.
template <class T>
bool Change(T &obj,T val)
{
if( obj!=val )
{
obj=val;
return true;
}
return false;
}
AddToCap() increases a value up to the cap. It the value is already above the cap, it is not changed.
template <class T>
T AddToCap(T val,T delta,T cap)
{
if( val<cap )
{
return val+Min_cast(delta,cap-val);
}
else
{
return val;
}
}
CapDown() lowers the given object to the given cap.
template <class T,class S>
void CapDown(T &obj,S cap)
{
if( obj>cap ) obj=(T)cap;
}
Two functions to round up integral values. It is assumed that arguments are positive.
template <SUIntType SUInt> constexpr SUInt RoundUpCount(SUInt x,SUInt g) { return (x+g-1)/g; } template <SUIntType SUInt> constexpr SUInt RoundUp(SUInt x,SUInt g) { SUInt count=(x+g-1)/g; return count*g; }
The first function returns the result of division of the first argument by the second, rounded up. I.e. it is the minimum value res, such that g*res >= x.
The second function rounds up the first argument to be divisible by the second.
Two functions to round down integral values. It is assumed that arguments are positive.
template <SUIntType SUInt> constexpr SUInt RoundDownCount(SUInt x,SUInt g) { return x/g; } template <SUIntType SUInt> constexpr SUInt RoundDown(SUInt x,SUInt g) { SUInt count=x/g; return count*g; }
The first function returns the result of division of the first argument by the second, rounded down. I.e. it is the maximum value res, such that g*res <= x.
The second function rounds down the first argument to be divisible by the second.
Bit...() — four bit manipulation functions:
template <UIntType UInt,class S> void BitSet(UInt &t,S bits); // set bits template <UIntType UInt,class S> void BitClear(UInt &t,S bits); // clear bits template <UIntType UInt,class S> UInt BitTest(UInt t,S bits); // check if at least one of bits is set template <UIntType UInt,class S> bool BitTestAll(UInt t,S bits); // check if all bits are set
These functions make bit manipulation expressions more simple and verbose and resolve the type conversion problem. The second argument is explicitly casted to the type of the first one.
The following three functions converts an unsigned integer into a digit character.
char UpperHexDigit(UIntType digit); char LowerHexDigit(UIntType digit); char DecDigit(UIntType digit);
UpperHexDigit() returns the upper hex digit character, the argument must be in the range [0,16).
LowerHexDigit() returns the lower hex digit character, the argument must be in the range [0,16).
DecDigit() returns the decimal digit character, the argument must be in the range [0,10).


 Okay, we'll let you use it for now. This is an area that is very important to us, as it removes data from the database. We ask that while you are here, you submit a list of your deletions to the website admins (contact information at the bottom of the page) or ask them for permission first.
To delete something, you have to fillout all fields and press "submit".
Please be respectful when deleting data, as we can lose irreplacable information.


Contents
USAGE:
[geostrophic_velocity, mid_lat, mid_long] =
gsw_geostrophic_velocity(geo_strf,long,lat,p)
DESCRIPTION:
Calculates geostrophic velocity relative to the sea surface, given a
geostrophic streamfunction and the position (longitude, latitude and
pressure (long, lat & p)) of each station in sequence along an ocean
section. The data can be from a single isobaric or "density" surface,
or from a series of such surfaces.
INPUT:
geo_strf = geostrophic streamfunction. This geostrophic streamfunction
can be any of, for example,
(1) geo_strf_dyn_height (in an isobaric surface)
(2) geo_strf_Montgomery (in a specific volume anomaly surface)
(3) geo_strf_Cunninhgam (in an approximately neutral surface
e.g. a potential denisty surface).
(4) geo_strf_McD_Klocker (in an approximately neutral surface
e.g. a potential denisty surface, a Neutral Density
surface or an omega surface (Klocker et al., 2009)).
long = longitude in decimal degrees [ 0 ... +360 ]
or [ -180 ... +180 ]
lat = latitude in decimal degrees north [ -90 ... +90 ]
OPTIONAL:
p = sea pressure ( default is 0 ) [ dbar ]
( i.e. absolute pressure - 10.1325 dbar )
Note. This optional input is used to obtain an accurate distance,
"dist", taking into account that the radius from the centre of the
Earth depends on the depth below the sea surface.
There needs to be more than one station.
geo_strf has dimensions (M(bottles) x N(stations)).
lat & long need to have dimensions 1xN or MxN, where geo_strf is MxN.
p may have dimensions 1x1 or Mx1 or 1xN or MxN, where geo_strf is MxN.
Note. The ith bottle of each station (i.e. the ith row of geo_strf)
must be on the same ith surface, whether that surface be,
(1) an isobaric surface,
(2) a specific volume anomaly surface,
or some type of approximately neutral surface (cases (3) & (4)).
OUTPUT:
geostrophic_velocity = geostrophic velocity RELATIVE to the sea
surface. It has dimensions (Mx(N-1))
mid_lat = mid point latitude, [ -90 ... +90 ]
(in decimal degrees north)
mid_long = mid point longitude
(the range corresponds to that entered)
EXAMPLE:
geo_strf(:,1) = [ -0.600766; -2.959872; -6.705156; -9.991887; -14.285795; -17.893004;]
geo_strf(:,2) = [ -0.558086; -2.746335; -6.163343; -8.846621; -11.307648; -12.775731;]
long = [189 189];
lat = [-20 -22];
p = [ 10; 50; 125; 250; 600; 1000;]
geostrophic_velocity = gsw_geostrophic_velocity(geo_strf,long,lat,p)
geostrophic_velocity =
-0.003671955871408
-0.018371680712400
-0.046615489829464
-0.098536165937943
-0.256247175417557
-0.440330269674479
AUTHOR:
Paul Barker, Trevor McDougall and Phil Morgan [<EMAIL_ADDRESS>]
VERSION NUMBER:
3.06 (15th May, 2017)
REFERENCES:
Cunningham, S. A., 2000: Circulation and volume flux of the North
Atlantic using syoptic hydrographic data in a Bernoulli inverse.
J. Marine Res., 58, 1-35.
IOC, SCOR and IAPSO, 2010: The international thermodynamic equation of
seawater - 2010: Calculation and use of thermodynamic properties.
Intergovernmental Oceanographic Commission, Manuals and Guides No. 56,
UNESCO (English), 196 pp. Available from the TEOS-10 web site.
See sections 3.27 - 3.3.30 of this TEOS-10 Manual.
Jackett, D. R. and T. J. McDougall, 1997: A neutral density variable
for the world’s oceans. Journal of Physical Oceanography, 27, 237-263.
Klocker, A., T. J. McDougall and D. R. Jackett, 2009: A new method for
forming approximately neutral surfaces. Ocean Sci., 5, 155-172.
McDougall, T. J. and A. Klocker, 2010: An approximate geostrophic
streamfunction for use in density surfaces. Ocean Modelling, 32,
105-117.
See Eqn. (62), of this paper, for definition of the
McDougall-Klocker geostrophic streamfunction.
Montgomery, R. B., 1937: A suggested method for representing gradient
flow in isentropic surfaces. Bull. Amer. Meteor. Soc. 18, 210-212.
The software is available from http://www.TEOS-10.org


6th Workshop on Automated Knowledge Base Construction (AKBC) 2017
at NIPS 2017 in Long Beach, California, December 8th, 2017.
We welcome papers documenting previously unpublished research; ongoing and exciting preliminary work is perfectly fine. We are particularly interested in visionary paper submissions. We aim for papers that express intriguing and promising ideas — focusing less on where science is today and more on where it should go tomorrow.
Topics of interest include, but are not limited to:
In addition, for the first time, AKBC will address a longstanding issue in the AKBC, that of equitable comparison and evaluation across methods. We encourage people to use the KBP Online platform (https://kbpo.stanford.edu/), a new effort to standardize KB population/construction evaluation, for their system evaluation for paper submissions. The platform automates the annotation of kb output and is made available for free for AKBC participants. For further details or questions, visit https://kbpo.stanford.edu/ or email<EMAIL_ADDRESS>Please format your papers using the standard NIPS 2017 style files, and restrict them to 5 pages (excluding references). Since the reviewing will not be double-blind, include author information and the \nipsfinalcopy flag. Note that you don't have to include a separate Abstract section in the submission. All accepted papers will be presented as posters, with exceptional submissions also presented as oral talks.
We are happy to announce that this year we are able to award free workshop registration to exceptional student applicants. Please send your CV and a short cover letter explaining why you need the travel award, your research interests and how it fits to AKBC to info@akbc.ws.


{% extends "homework/layout.html" %} {% block title %} Homework Board | {{assignment.title}} {% endblock title %} {% block body %}
{{ assignment.title }}
Assigned by: {{ assignment.teacher }}
Issued on: {{ assignment.date_of_issue }}
Deadline: {{ assignment.deadline }}
{{ assignment.description }}
{{ assignment.penalites }}


Alright so it was the summer of '05 and I had alot of cash and alot of time on my hands so I figured I would eat a bunch of shrooms one saturday. This was the third time I would be doing them and I wanted to experience a new level of 'tripping.'
I bought a quad (7 g's) of golden caps and weighed out about 5.8 to 6 grams to myself. I gave the rest to my friend who was dogging me with those puppy eyes. After doing so I got a phone call from my dad telling me I had to come home this instant (I'm 17).
 In a state of fury I stormed back to my friends house and I ate all of the shrooms without second thought. After that we started playing some Halo2 (fuck yeah). I remember I started tripping after about 30-40 minutes. Feeling good, we turned on some Static X. The last thing I remember is talking about how we should go to the forest reserve nearby to trip out on some lakes and trees and stuff. This was around noon on a sunny Saturday.
The next thing I know I wake up on my friend's couch. My body is soaked in something. My socks are off and my feet are covered in blood. I have random cuts and bruises are beginning to swell up in the most weird places. I was alone in the house but I knew that was ok because that was the Saturday the Stones came into town and my friend had tickets.
The following is my friend and his roomate's description of what happened between noon and 6pm of that day:
So we got to the forest reserve and you and I were both tripping. Dustin (the roommate) was with us and we were walking and all the sudden u dropped on the ground.   So we literally dragged you back to the car which was horrible because people were looking and I thought you were going to die, man. On the car ride back home you kept passing out and waking up. We tried to calm you down because once you were awake you would freak out and try to jump out of the car and stuff.
You passed out again and we dragged you back to the house. We were certain that we were going to get arrested or something because this was in broad daylight. Once we got to the house you were okay for a while, but you definetly were not conscious.    Then we left for the show, but called Pat (good friend and neighbor) to check up on you once in a while.
When I heard this the next day I was in shock, mainly because I don't remember any of this.  I had a dream where I thought I was living life in slow motion and sometimes in rewind, which explains the walking backwards and rolling around on the carpet.
I had a dream I was the first person to try this new drug which would give you the craziest high and the craziest trip, but at the end your brain would inevitably fail and you would die at the end of your trip. I had more dreams but now I don't remember. It's one of those things, you know??
 I think that a combination of a negative mental state, a pretty large quantity of shrooms, and eating them on a totally empty stomach caused my body to reject the shrooms and my body shut down?? I'm not sure, but this has never happened before or after.
Experience Reports are the writings and opinions of the individual authors who submit them.
Some of the activities described are dangerous and/or illegal and none are recommended by Erowid.


78cm - RM 25
90cm - RM 30
Code: PVC FILM (B)-90CM / PVC FILM (B)-78CM
Size 1: (W) 78cm x (H) 235cm
Size 2: (W) 90cm x (H) 240cm
RM 250
Code: MAGNET SHEET
Size: (W) 600mm x (H) 15m x (D) 0.6mm
(1mm) RM 45
(2mm) RM 90
Code: HIGHIMPACT / HIGH IMPACT
Size 1: (1mm) - (W) 4ft x (H) 8ft
Size 2: (2mm) - (W) 4ft x (H) 8ft
(5mm) RM 30
(10mm) RM 60
Code: FB
Size 1: (5mm) (W) 4ft x (H) 8ft
Size 2: (10mm) - (W) 4ft x (H) 8ft
(4ft x 8ft / 4ft x 6ft) RM 18
Code: KT BOARD
Size 1: (5mm) - (W) 4ft x (H) 8ft
Size 2: (5mm) - (W) 4ft x (H) 6ft
(3mm) RM 25, (5mm - (H) 8ft) RM 35
(5mm - (H) 20ft) RM 90
Code: PPB
Size 1: (3mm) - (W) 4ft x (H) 8ft
Size 2: (5mm) - (W) 4ft x (H) 8ft
Size 3: (5mm) - (W) 4ft x (H) 20ft
(3FT & 4FT) - RM 4 per sqft
(5FT , 6FT & 7FT) - RM 4.50 per sqft
Code: POLY
Size: Minimum 3ft x 4ft
(3mm) RM 140
(5mm) RM 220
Code: AB
Size 1: (3mm) - (W) 4ft x (H) 8ft
Size 2: (5mm) - (W) 4ft x (H) 8ft
1mm - RM 30, 2mm - RM35
3mm - RM 40, 4mm - RM55
5mm - RM 66, 10mm - RM132
20mm - RM 264, 25mm - RM330
Code: PVCB
Size 1: 1mm - (W) 4ft x (H) 8ft
Size 2: 2mm - (W) 4ft x (H) 8ft
Size 3: 3mm - (W) 4ft x (H) 8ft
Size 4: 4mm - (W) 4ft x (H) 8ft
Size 5: 5mm - (W) 4ft x (H) 8ft
Size 6: 10mm - (W) 4ft x (H) 8ft
Size 7: 20mm - (W) 4ft x (H) 8ft
Size 8: 25mm - (W) 4ft x (H) 8ft


Method implementation benchmarks tested against the built in concurrent hashmap. Results are recorded in operations per millisecond.
Benchmarks of the concurrent hashmap tested against the built in hashmap using the buyer/seller simulation. Results are recorded in operations per millisecond.


Sweet Free Stuff
///////////////////////////////////////////
Free Betty Crocker Gluten Free Coupon
Posted: 27 May 2013 11:13 AM PDT
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/AA1o_OSDEFw/?utm_source=feedburner&utm_medium=email
Try a free Gluten Free Betty Crocker product. Coupons available to first
25k. Get it for Free!
///////////////////////////////////////////
10 Free Pampers Gifts to Grow Points
Posted: 27 May 2013 01:02 AM PDT
http://feedproxy.google.com/&;r/SweetFreeStuff/&;3/NVn5DMHmSDo/?utm_source=feedburner&utm_medium=email
To login please click here and enter the code: FBMEM5DPE7QW613 to receive
10 more points. (If you need to register, click here to sign up and receive
100 points!) The Pampers Gifts to Grow Rewards Program rewards you every
time you choose Pampers diapers, training pants and wipes for your growing
baby. To start, simply […]


CHARACTERISTIC
AN esteemed and learned correspondent, himself a Cornishman, writing to me on the Côrnish character, says -
"There are some adages in which beadledom receives various hard knocks--that abstraction mostly taking the shape of some unlucky mayor; and I have heard in Cornwall, but never elsewhere, that the greatest fool in the place for the time being is always made the mayor.
"There is an adage of the Mayor of Calenich (and yet I doubt if ever that hamlet had such an officer). Calenich is one mile from Truro, and the mayor's hackney was pastured two miles from home; so, as his worship would by no means compromise his dignity by walking to Truro, he invariably walked to his horse to ride there, so that it was said of any one who would keep up appearances at great trouble, that he was 'like the Mayor of Calenich, who walked two miles to ride one.'
"The class who never know on which side their bread is buttered, are said to be 'like the Mayor of Market-Jew, sitting in their own light,' and the stupid man whose moods, whether of sadness or merriment, are inopportune, is, as may be, said to be 'like the Mayor of Falmouth, who thanked God when the town-jail was enlarged.'
"Many persons are chronicled in the same manner.
"'Like Nicholas Kemp, he's got occasion for all.' Nicholas was said to be a voter in a Cornish borough, who was told to help himself (so that no one should have given him a bribe) from a table covered with gold, in the election committee-room.  This was always applied to a once well-known Gwennap-man.
"When a boy is asked what he will be, it is sometimes answered on his behalf, 'I'll be like Knuckey, be as l am.'
"Like Nanny Painter's hens, very high upon the legs,' is applied to a starveling or threadpaper.
"'Like Malachi's cheeld, choke-full of sense,' applied derisively to any one boasting of himself or of his children. This is, I believe, purely Cornish.
"'Like a toad under a harrow, I don't know whichee corse to steer.' The first division of this adage is common property, the last is confined to Cornwall.
"'He's coming home with Penny Liggan,' sometimes 'Peter Lacken,' signifies the return of a penniless scapegrace. The term was probably 'penny lacking' originally.
"Are the Cornish folk given to making 'bulls,' like the Irish?" asks my correspondent. "I have heard of one or two curious inversions of speech.
"Once upon a time a little boy having vainly importuned his seniors for a penny to go and buy sweets, being determined not to be disappointed, went off, exclaiming, 'I don't care; I'll go and trust Betty Rule (the sweatmeat vendor). This is native and genuine Gwennapian.
"The common people are fond of figures of speech. Port-wine negus was christened by the miners 'black wine toddy.' They go on Midsummer. day to Falmouth or Penzance, to get 'a pen'ord o' say '--that is, they go out in a boat on payment of a penny.
"With them, when their health is inquired after, every man is 'brave,' and every women 'charming;' and friendship takes dear household names into its mouth for more expressiveness.
"Well, Billy, my son, how's faether?'
"'Brave, thank ee.'
" 'How are you, Coden [Cousin] Jaan, and how's Betty?'
"'She's charming, thank ee.'
"Trade is a word of special application, 'a pa'cel o' trade.'
"A precious mess is 'a brave shape.'
"Of an undecided person it is said, 'He is neither Nim nor Doll.' Does this mean he is neither Nimrod nor Dorothy?
A phrase descriptive of vacuity of expression is, 'He looks like anybody that has neither got nor lost.'"
Years since it was a common custom to assign some ridiculous action to the people of a small town or village. For example, the people of one place were called "Buccas," "because some one of them was frightened at his shadow."
Those of another town were named "Gulls," "because two of the townsmen threw a gull over a cliff to break its neck."
The men of a fishing-village were nicknamed "Congers," "because they threw a conger overboard to drown it."
"Who whipped the hake?" was applied to the inhabitants of another town, because hake, it is said, being excessively plenty, the fishermen flogged one of those fish, and flung it back into the sea; upon which all the hakes left that coast, and kept away for years. [a]
"Who drowned the man in a dry ditch?" belongs especially to another place.
Certain Cornishmen built a wall around the cuckoo, to prevent that bird from leaving the county, and thus to insure an early spring. When built, the bird flew out, crying "Cuckoo! cuckoo !" "If we had put one course more on the wall we should a' kept 'n in," said they.
Camborne is so called from Camburne, a crooked well-pit of water. This crooked well was at one time far famed for the cure of many diseases.
The persons who washed in this well were called Merrasicke. I know not the meaning of the word. According to an old Cornish custom of fixing nicknames on people, the inhabitants of Camborne are called Mearageeks, signifying perverse, or obstinate.--(Lanyon.)
The Church was anciently called Mariadoci. I therefore suspect that the above terms have some connection with this name. By an easy corruption, and the addition of geeks, or gawks (meaning awkward), either word can be produced.
Of the Gorran men it is asked, "Who tried to throw the moon over the cliffs?"
[a] In Hugh Miller's "Scenes and Legends of the North of Scotland," edit. 1858, pp. 256, 257, will be found some stories of the flight of the "herring drove" from the coast of Cromarty, which are analogous to this.


All Posts
2018
- TimeStamp Ordering Concurrency Control Sep 15, 2018
- Advanced DB Quert Compilation Sep 15, 2018
- How to debug a multi-thread program Sep 04, 2018
- Dynamic Programming Jun 02, 2018
- LLVM Intro May 31, 2018
- Vim Script May 26, 2018
- Vim abbreviation and map May 25, 2018
- Syntax Analysis May 19, 2018
- Constructing Compiler: flex intro May 18, 2018
- Lexical Analysis May 10, 2018
- overview for compiler May 09, 2018
- Syntax Directed Translator Apr 22, 2018
- Tech Diary_03_08_2018 Mar 03, 2018
- Tech Diary_03_07_2018 Mar 03, 2018
- Tech Diary_03_03_2018 Mar 03, 2018
- Tech Diary_03_02_2018 Mar 03, 2018
- Explanation on VC Dimension Feb 15, 2018
- Greedy Algorithm Feb 05, 2018
- Macro usage Feb 03, 2018
- OpenCL notes_8 How to write an OpenCL wrapper Jan 31, 2018
- OpenCL notes_6 Mapreduce Jan 27, 2018
- OpenCL notes_6 reduction Jan 27, 2018
- OpenCL notes_5 Event, Profiling, and Synchronization Jan 26, 2018
- Fibonacci Heap Implementation Jan 25, 2018
- The Annotated uBLAS Sources 5 Matrix_Prod Jan 24, 2018
- The Annotated uBLAS Sources 4 Matrix Expression Template Jan 23, 2018
- The Annotated uBLAS Sources 3 Vector Proxy Jan 22, 2018
- The Annotated uBLAS Sources 2_Vector Expression Template Jan 21, 2018
- UNP_1 Jan 20, 2018
- UNP_1 Jan 20, 2018
- UNP_1 Jan 20, 2018
- Notes on C++ Templates 14 Jan 19, 2018
- Notes on C++ Templates 13 Jan 19, 2018
- Notes on C++ Templates 12 Jan 19, 2018
- Notes on C++ Templates 9 Jan 18, 2018
- Notes on C++ Templates 11 Jan 18, 2018
- Notes on C++ Templates 10 Jan 18, 2018
- OpenCL notes_4 operators and functions Jan 18, 2018
- OpenCL notes_3 data types and device memory Jan 18, 2018
- Notes on C++ Templates 8 Jan 17, 2018
- Notes on C++ Templates 7 Jan 17, 2018
- Notes on C++ Templates 6 Jan 17, 2018
- OpenCL notes_2 data transfer and parition Jan 17, 2018
- OpenCL notes_1 host programming Jan 17, 2018
- Notes on C++ Templates 5 Jan 16, 2018
- Notes on C++ Templates 4 Jan 15, 2018
- Notes on C++ Templates 3 Jan 15, 2018
- Notes on C++ Templates 2 Jan 15, 2018
- formula_testing Jan 15, 2018
- Notes on C++ Templates Jan 13, 2018
- The Annotated uBLAS Sources 1 Jan 13, 2018
2017
- A quick demo of Simple Texture theme's code highlighting features May 27, 2017
- Quick kramdown demo May 25, 2017


'Impressed' - Why the signs are good for Nottingham Forest's January transfer business
The January transfer window is not far away and the Reds will be hoping to work their magic again
by Barry Cooper, Sarah ClapsonNottingham Forest’s summer transfer business seems to have paid dividends, with the Reds battling at the top end of the Championship table.
Twelve new signings came through the City Ground doors as Sabri Lamouchi took hold of the reins.
And the majority of those players have had an impact on the pitch, contributing to a fine start to the season on the banks of the Trent.
With January fast approaching, Forest will be hoping to work their magic in the market once again - and if the summer is anything to go by, the signs are good.
The club managed to find some real gems in the last window, with the likes of Brice Samba, Yuri Ribeiro, Samba Sow and Tiago Silva all putting in good performances in the opening months of the campaign.
Technical director Francois Modesto and head of international recruitment Jose Anigo both played a role in the Reds’ summer business.
And with Lamouchi having previously said the pair are “working for the future”, they are sure to do so again in January.
“Forest’s summer recruitment has proved to be pretty good,” says Reds reporter Sarah Clapson, in our latest Forest video.
“For the most part they got it spot on.
“They brought in players who have made an impact and made a difference.
“You’ve got to be impressed with their summer business.
“They’ve obviously got a team who can find players who fit into the way Sabri Lamouchi wants to play - his system and his way of doing things.
“They will be trying to reproduce that (success) again in January.”
Nottingham Forest latest
This is your round up of all things Forest; the one-stop shop that will keep you updated on the latest goings on at the City Ground and beyond.
Transfers, injuries, match-days and managers, we’ve got you covered.
We’ll be bringing the very latest on the Reds throughout the week and around the clock.
Make sure you keep yourself updated with our handy daily catch up...
Must reads...
- Marinakis' 'vision' for City Ground plans
- Why Reds must not settle for second best
- The lowdown on Reds 'target' Shankland
- Lamouchi demanding 'better' from players
For all your latest NFFC news, opinion, analysis and transfer gossip, click here
You can follow our Reds reporter Sarah Clapson on Twitter, and her email address is<EMAIL_ADDRESS>Sign up for our free Forest WhatsApp service for latest news
Keep up to date with the latest Nottingham Forest news, features and exclusives from Nottinghamshire Live via our free WhatsApp service.
Text NEWS to<PHONE_NUMBER>2 and then add the number to your phone contacts book as ForestLive to receive daily updates and breaking news from our Reds reporter Sarah Clapson.
Your phone number won't be shared with any other members of the group. Click here for more information on the service.


×
☰ Kick Participants
Moderators:
Participants:
Enter experiment settings
Problem to solve:
Time limit:
Minimum score:
Choose group types


{% extends "mail_layout.html" %} {% block title %}SURF platform account deletion notification {% endblock %} {% block content %}
Hi,
User {{ user.name }} ({{ user.uid }}) has deleted their account on environment {{ environment }} at {{ date }}:
Please remove this user from Perun.
{% for key, value in attributes.items() %}{{ key }}: {{ value }}
{% endfor %}This email is automatically sent and can be suppressed by changing the account_deletion_notifications_enabled section of the configuration for environment {{ environment }}
{% endblock %}


This is paragraph cfa869d0-44e3-41d3-86a0-2357ef55b6d6
This is link b26213ae-db73-484a-bf19-b9640cffc393 This is text b2f9b563-523d-4dbd-b545-d096ec6e90ec


Musashi, Craftsmanship and The Critical Moment
Recently, I've been spending some time with books on
craftsmanship
The instance that triggered me into looking for and ultimately buying the reference was this video, in which USA Olympic Weightlifting coach Dave Spitz critiques another athlete and mentions one of The Book of Five Rings' most well known quotes — there are many possible translations for the phrase —:
To know one thing [well] is to know ten thousand.
Could Musashi not only be an entertaining Japanese character but also the or a foundation for craftsmanship?
Master craftsmanship back in Musashi's period had much in common with what we experience nowadays.
Firstly, there were good and bad practitioners everywhere. If you
think every samurai carried itself to Musashi-like standards, throw
your misconceptions away. The main reason for Musashi writing his
books was to rid the world of the disease of bad technique and bad
habit
Musashi was very pragmatic and completely averse to schools which
propagated complicated moves or secret techniques. He spends a lot of
his books' pages trying to convince you that they are actually trying
to trap you, by making you pay endlessly for whatever it is they
know
Second of all, Musashi did not think himself superior to others by being a samurai. According to him, [Japanese] society had many roles mandatory to its existence — namely: the samurai, the farmer, the artisan, and the merchant. What differentiated the samurai was the fact that it was an all or nothing occupation, it demanded everything from the individual and everything should be channeled at the critical moment of the fight.
Third, he does mention many parallels between his craft and others',
specially when it comes to carpentry. This might not have been the
case through his entire life, but, after his experience at designing
the township around the Akashi Castle in 1618, he explicitly starts to
make analogies with carpenters
The Way of combat strategy can be likened to the craft of carpentry.
Comparing samurai with carpenters is related to the subject of
“houses.” We speak of noble houses, warrior houses and the “Four
Houses.”
Everyone knows that craftsmanship has immense value, and, yet, we live
plagued by bad practices — I'm as guilty as anyone else. Maybe
we haven't emphasized it enough. And maybe Musashi can help us with
it. The main mark of a true master writer is exposing the importance
of what is obvious and, yet, neglected
Another very famous quote is the one featured in many Kendo dojos — despite the fact that they more often than not don't really follow any of Musashi's schools, which is actually quite the compliment —:
One thousand days of training to forge,
Ten thousand days of training to refine.
But a [Kendo] bout is decided in a split second.
The quote above, among other things, talks about the importance of putting everything you've got into the decisive split second that will decide the fight.  Of course, this is a little bit of an exaggeration since we can salvage a lot even if you fail hard at the critical juncture, but how many times in your life have you failed at the critical moment and it felt like every second you spent training and studying went immediately up to smoke?
I wish I had emphasized this more in my life and I believe you wish so
too.
Initially, I was completely averse to the whole concept, as it seemed
completely opposite to everything my coaches had ever taught me: be
consistent, keep a constant pace and victory will come inevitably,
with patience. But perhaps endurance-based sports aren't, at the very
least not always, the best analogy for life
Another more usual example of how the critical moment emphasis could improve our performance is presentations and or lectures. It is not common for a class to have a background linear pace, which gives the impression that everything in it is of equal importance — or, perhaps, that nothings is important. But this isn't the case 99% of the time, is it? Every topic has usually 2 or 3 concepts accounting for the vast majority of its contents. Change the temporal pace when approaching these, spend more effort, give temporal emphasis to them, and watch comprehension and attention spike afterwards.
Some 4 years ago I had my first encounter with a close relative of
that Musashi quote in a probably unconscious analogy with Go and life.

What it was meant to teach is that, much like life, Go has moves or
moments in which the value of success or failure is way higher than
the average moment of the game. It is very important for us to
identify those moments and anticipate them so we can focus better and
channel everything we've got into them, the rest of the game might
suffer from our inevitable lack of energy, but that's well worth
it
In swordsmanship and in the midst of pitched battle, the ability to know the right moment to traverse a critical point is essential. Know the enemy’s strengths and have a firm grasp of your own capabilities.
One of the ways of improving your performance when the critical moment arises is by being conscious about it. It's easy to take the path of artificially making everything homogeneous and simply keep moving as usual. But, when the time comes, if you can, just stop, take a step back, breath consistently to lower the heart rate variance — no need for deep breaths actually: watch this lecture by Dr. Alan Watkins for more details — and, only then, make a move. In Go tournaments, from what I experienced throughout more than 5 years of playing and achieving dan levels, this would be revolutionary for almost every player if done right, even those much stronger than me.
For tasks in which you don't have the luxury of pausing, you will need
to find ways of training the switch from focus on the pace to focus
on bursts of extra effort. Create a test harness or laboratory for
your task or sport
Traverse the peril at the optimum point just as a worthy mariner navigates ocean routes. Once crossed, the mind becomes tranquil. If you successfully get past the critical point, your opponent will tire, the initiative will be yours and victory is there for the taking.
Another technique I've found to be very useful and have been recently experimenting with is one explored by performance coach Todd Herman: The Alter Ego Effect. As the Academy of Ideas explains in this video, the Alter Ego Effect tries to leverage a second ideal self for us to be able to achieve our goals without having to deal with our usual self-doubt and anxiety. By acting as our ideal self we can ditch our worries and commitments and only focus on the task at hand. This may appear silly at first but has had tremendous results with high performance athletes and is a de facto technique used and recommended by philosophers and psychologists.
In the end, this whole discussion on critical points could also be
seen as an application of a 4-dimensional perspective of life. We are
beings in 4 dimensions in fact, 3 spatial and 1 temporal. Why do we
put so much stress and importance on space and, so often, leave time
to a secondary role?
Be very mindful that a lot of Musashi's books' contents were lost throughout the ages and we will never know their true content, since they were, for a long time, only passed on from grandmaster to grandmaster, with various editions in-between. Hence, you should be very careful when choosing a translation and source for the text.
I ultimately chose to go for
Alexander Bennett's version of the text, someone who has spent decades in Japan mainly focusing on
Kendo
Takashi is supposedly the world's foremost expert on Musashi and has
done probably the most scientific work on the topic. After years
looking for the original manuscripts and not finding any confirmation
of their existence, he has taken all of the most trustworthy copies
and interpolated them in order to find their mistakes and, hopefully,
uncover the original text from cross-checking all of the various
posterior editions
As a bonus for Bennett's book, you also get the other Musashi books, with meta-references to their counterparts in the main Book of Five Rings.
This review offers a valuable counterpoint to Bennett's translation, some that I will probably never be able to attest, since I don't know any Japanese.
Despite Musashi's works being amazing and perhaps mandatory for any proud craftsman, I would say they are outdated and insufficient. Times and technologies have changed a lot and the context of swordsmanship isn't that generic sometimes.
The way the book is written also doesn't help very much. It's overall superficial and so fragmented that changing the context takes most of your concentration time. Besides all that, it is trying to do something very difficult to achieve: explain martial arts in words. It wasn't meant to be a textbook for beginners but rather for experts, so that's a concession we have to make.
One of Musashi's books that is sometimes forgotten is actually a very iconic one: Dokkodo or The Path Walked Alone. In it, at his deathbed, he listed 21 principles to live your life by. Some of the more unusual ones are:
-
I harbored no biased feelings.
- One of the instances in which this comes into play is when discussing preferences for different techniques.
-
I steered clear of the path to attachment.
- Attachment in this context, according to Bennett, means falling in love, which is a considerable deviation from the more usual Romantic love or Ancient Greek love in Western societies. An interesting fact is that there are no historical records about Musashi having a partner at all, not even casual intercourse with prostitutes.
-
I cared not where I lived.
- As a samurai, he was basically a nomad, serving different lords throughout his life. But this was not an annoyance or burden to him, it actually made him more free as an individual. As many Cynic philosophers of Ancient Greece and the Roman Empire would have converged: having too many possessions is actually being the one possessed by.
Before you leave, I hope I have convinced you enough to join the unofficial Ridding the World of Bad Practices Club. We have quite some high-caliber members and we are always open to criticism. Personally, my life's purpose depends on this membership, and I think society could benefit a lot from us having more members.
Read about efficiency. That's what Musashi's book is ultimately about when generalized to other crafts. His work was an attempt at cleaning up all of the dirt and bad habits left throughout the ages, only leaving the bare minimum which we need to learn in order to achieve our goals in the most efficient manner.
Many books will be specific to whatever area you're interested in, but there are those which can be applied to any area of interest; some that come to mind are:
- Coherence: The Secret Science of Brillian Leadership, by coach and neuroscientist Dr. Alan Watkins.
- Never Split The Difference, by former FBI Hostage Negotiator and Instructor Chris Voss.
- Effective Notetaking, by Fiona McPherson, PhD.
- The Alter Ego Effect, by performance coach Todd Herman.
Musashi also believed that the samurai was two-fold — the pen and the sword — and, so, he also managed to be a master painter and calligrapher. You can read more about it in The Art of Miyamoto Musashi, by Brian Campbell, on Medium.


پیشنهاد ما برای شما
{{product.name}}
{{product.short_description}}
دسته بندی را انتخاب کنید
{{category.name}} {% if perms.market.change_category %} settings {% endif %}
{{product.name}} {% if perms.market.change_product %} settings {% endif %}
News in fashion
Productivy Apps
The best trends in fashion 2017
Don't be scared of the truth because we need to restart the human foundation in truth And I love you like Kanye loves Kanye I love Rick Owens’ bed design but the back is...
subject ReadFashion News
Kanye joins the Yeezy team at Adidas
Don't be scared of the truth because we need to restart the human foundation in truth And I love you like Kanye loves Kanye I love Rick Owens’ bed design but the back is...
subject ReadProductivy Apps
Learn how to use the new colors of 2017
Don't be scared of the truth because we need to restart the human foundation in truth And I love you like Kanye loves Kanye I love Rick Owens’ bed design but the back is...
subject ReadTutorials
Trending colors of 2017
Don't be scared of the truth because we need to restart the human foundation in truth And I love you like Kanye loves Kanye I love Rick Owens’ bed design but the back is...
subject ReadProductivy Style
Fashion & Style 2017
Don't be scared of the truth because we need to restart the human foundation in truth And I love you like Kanye loves Kanye I love Rick Owens’ bed design but the back is...
subject read


Add Custom Extension
Custom Extensions provides you with a facility to register any custom extensions or feature codes that you have created in a custom file and FreePBX doesn't otherwise know about them. This allows the Extension Registry to be aware of your own extensions so that it can detect conflicts or report back information about your custom extensions to other modules that may make use of the information. You should not put extensions that you create in the Misc Apps Module as those are not custom.


Package org.apache.cayenne
Interface ObjectContext
-
- All Superinterfaces:
DataChannel
,Serializable
- All Known Implementing Classes:
BaseContext
,DataContext
public interface ObjectContext extends DataChannel, Serializable
A Cayenne object facade to a persistent store. Instances of ObjectContext are used in the application code to access Cayenne persistence features.- Since:
- 1.2
-
-
Field Summary
-
Fields inherited from interface org.apache.cayenne.DataChannel
FLUSH_CASCADE_SYNC, FLUSH_NOCASCADE_SYNC, GRAPH_CHANGED_SUBJECT, GRAPH_FLUSHED_SUBJECT, GRAPH_ROLLEDBACK_SUBJECT, ROLLBACK_CASCADE_SYNC
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> ResultBatchIterator<T>
batchIterator(Select<T> query, int size)
Creates a ResultBatchIterator based on the provided query and batch size.void
commitChanges()
Flushes all changes to objects in this context to the parent DataChannel, cascading flush operation all the way through the stack, ultimately saving data in the database.void
commitChangesToParent()
Flushes all changes to objects in this context to the parent DataChannel.Collection<?>
deletedObjects()
Returns a collection of objects that are registered with this ObjectContext and have a state PersistenceState.DELETEDvoid
deleteObject(Object object)
Schedules deletion of a persistent object.void
deleteObjects(Collection<?> objects)
Schedules deletion of a collection of persistent objects.<T> void
deleteObjects(T... objects)
Schedules deletion of one or more persistent objects.DataChannel
getChannel()
Returns an DataChannel used by this context.EntityResolver
getEntityResolver()
Returns EntityResolver that stores all mapping information accessible by this ObjectContext.GraphManager
getGraphManager()
Returns GraphManager that manages object graph associated with this context.Object
getUserProperty(String key)
Returns a user-defined property previously set via 'setUserProperty'.boolean
hasChanges()
Returnstrue
if there are any modified, deleted or new objects registered with this ObjectContext,false
otherwise.void
invalidateObjects(Collection<?> objects)
Invalidates a Collection of persistent objects.<T> void
invalidateObjects(T... objects)
Invalidates one or more persistent objects.<T> void
iterate(Select<T> query, ResultIteratorCallback<T> callback)
Creates a ResultIterator based on the provided query and passes it to a callback for processing.<T> ResultIterator<T>
iterator(Select<T> query)
Creates a ResultIterator based on the provided query.<T extends Persistent>
TlocalObject(T objectFromAnotherContext)
Returns a local copy of 'objectFromAnotherContext' object.Collection<?>
modifiedObjects()
Returns a collection of objects that are registered with this ObjectContext and have a state PersistenceState.MODIFIED<T> T
newObject(Class<T> persistentClass)
Creates a new persistent object of a given class scheduled to be inserted to the database on next commit.Collection<?>
newObjects()
Returns a collection of objects that are registered with this ObjectContext and have a state PersistenceState.NEWQueryResponse
performGenericQuery(Query query)
Executes any kind of query providing the result in a form of QueryResponse.List
performQuery(Query query)
Executes a selecting query, returning a list of persistent objects or data rows.void
prepareForAccess(Persistent object, String property, boolean lazyFaulting)
A callback method that child Persistent objects are expected to call before accessing property values.void
propertyChanged(Persistent object, String property, Object oldValue, Object newValue)
A callback method that child Persistent objects are expected to call from inside the setter after modifying a value of a persistent property, including "simple" and "arc" properties.void
registerNewObject(Object object)
Registers a transient object with the context.void
rollbackChanges()
Resets all uncommitted changes made to the objects in this ObjectContext, cascading rollback operation all the way through the stack.void
rollbackChangesLocally()
Resets all uncommitted changes made to the objects in this ObjectContext.<T> List<T>
select(Select<T> query)
Executes a selecting query, returning a list of persistent objects or data rows.<T> T
selectFirst(Select<T> query)
Selects a single object using provided query.<T> T
selectOne(Select<T> query)
Executes a selecting query, returning either NULL if query matched no objects, or a single object.void
setUserProperty(String key, Object value)
Sets a user-defined property.Collection<?>
uncommittedObjects()
Returns a collection of MODIFIED, DELETED or NEW objects.-
Methods inherited from interface org.apache.cayenne.DataChannel
getEventManager, onQuery, onSync
-
-
-
-
Method Detail
-
getEntityResolver
EntityResolver getEntityResolver()
Returns EntityResolver that stores all mapping information accessible by this ObjectContext.- Specified by:
getEntityResolver
in interfaceDataChannel
-
newObjects
Collection<?> newObjects()
Returns a collection of objects that are registered with this ObjectContext and have a state PersistenceState.NEW
-
deletedObjects
Collection<?> deletedObjects()
Returns a collection of objects that are registered with this ObjectContext and have a state PersistenceState.DELETED
-
modifiedObjects
Collection<?> modifiedObjects()
Returns a collection of objects that are registered with this ObjectContext and have a state PersistenceState.MODIFIED
-
uncommittedObjects
Collection<?> uncommittedObjects()
Returns a collection of MODIFIED, DELETED or NEW objects.
-
localObject
<T extends Persistent> T localObject(T objectFromAnotherContext)
Returns a local copy of 'objectFromAnotherContext' object. "Local" means that the returned object is registered in this context. If the local object hasn't been previously cached in this context, a hollow object is created and returned to the caller. No DB query is performed to resolve an object.Note that passing an object with a non-existing id, may later result in FaultFailureException on attempt to read returned object properties.
- Since:
- 3.1
-
newObject
<T> T newObject(Class<T> persistentClass)
Creates a new persistent object of a given class scheduled to be inserted to the database on next commit.
-
registerNewObject
void registerNewObject(Object object)
Registers a transient object with the context. The difference withnewObject(Class)
is that a user creates an object herself, before attaching it to the context, instead of relying on Cayenne to do that.- Parameters:
object
- new object that needs to be made persistent.- Since:
- 3.0
-
deleteObject
void deleteObject(Object object) throws DeleteDenyException
Schedules deletion of a persistent object.- Throws:
DeleteDenyException
- if aDeleteRule.DENY
delete rule is applicable for object deletion.
-
deleteObjects
void deleteObjects(Collection<?> objects) throws DeleteDenyException
Schedules deletion of a collection of persistent objects.- Throws:
DeleteDenyException
- if aDeleteRule.DENY
delete rule is applicable for object deletion.
-
deleteObjects
<T> void deleteObjects(T... objects) throws DeleteDenyException
Schedules deletion of one or more persistent objects. Same asdeleteObjects(Collection)
only with a vararg argument list for easier deletion of individual objects.- Throws:
DeleteDenyException
- if aDeleteRule.DENY
delete rule is applicable for object deletion.- Since:
- 3.1
-
prepareForAccess
void prepareForAccess(Persistent object, String property, boolean lazyFaulting)
A callback method that child Persistent objects are expected to call before accessing property values. This callback allows ObjectContext to "inflate" unresolved objects on demand and also resolve properties that rely on lazy faulting.- Since:
- 3.0
-
propertyChanged
void propertyChanged(Persistent object, String property, Object oldValue, Object newValue)
A callback method that child Persistent objects are expected to call from inside the setter after modifying a value of a persistent property, including "simple" and "arc" properties.
-
commitChanges
void commitChanges()
Flushes all changes to objects in this context to the parent DataChannel, cascading flush operation all the way through the stack, ultimately saving data in the database.
-
commitChangesToParent
void commitChangesToParent()
Flushes all changes to objects in this context to the parent DataChannel. Same ascommitChanges()
, but no cascading flush occurs.
-
rollbackChanges
void rollbackChanges()
Resets all uncommitted changes made to the objects in this ObjectContext, cascading rollback operation all the way through the stack.
-
rollbackChangesLocally
void rollbackChangesLocally()
Resets all uncommitted changes made to the objects in this ObjectContext. Same asrollbackChanges()
, but rollback is local to this context and no cascading changes undoing occurs.
-
performQuery
List performQuery(Query query)
Executes a selecting query, returning a list of persistent objects or data rows.
-
select
<T> List<T> select(Select<T> query)
Executes a selecting query, returning a list of persistent objects or data rows.- Since:
- 4.0
-
selectOne
<T> T selectOne(Select<T> query)
Executes a selecting query, returning either NULL if query matched no objects, or a single object. If query matches more than one object,CayenneRuntimeException
is thrown.- Since:
- 4.0
-
selectFirst
<T> T selectFirst(Select<T> query)
Selects a single object using provided query. The query itself can match any number of objects, but will return only the first one. It returns null if no objects were matched.If it matched more than one object, the first object from the list is returned. This makes 'selectFirst' different from
selectOne(Select)
, which would throw in this situation. 'selectFirst' is useful e.g. when the query is ordered and we only want to see the first object (e.g. "most recent news article"), etc.Selecting the first object via "Select.selectFirst(ObjectContext)" is more comprehensible than selecting via "ObjectContext.selectFirst(Select)", because implementations of "Select" set fetch size limit to one.
- Since:
- 4.0
-
iterate
<T> void iterate(Select<T> query, ResultIteratorCallback<T> callback)
Creates a ResultIterator based on the provided query and passes it to a callback for processing. The caller does not need to worry about closing the iterator. This method takes care of it.- Since:
- 4.0
-
iterator
<T> ResultIterator<T> iterator(Select<T> query)
Creates a ResultIterator based on the provided query. It is usually backed by an open result set and is useful for processing of large data sets, preserving a constant memory footprint. The caller must wrap iteration in try/finally (or try-with-resources for Java 1.7 and higher) and close the ResultIterator explicitly. Or useiterate(Select, ResultIteratorCallback)
as an alternative.- Since:
- 4.0
-
batchIterator
<T> ResultBatchIterator<T> batchIterator(Select<T> query, int size)
Creates a ResultBatchIterator based on the provided query and batch size. It is usually backed by an open result set and is useful for processing of large data sets, preserving a constant memory footprint. The caller must wrap iteration in try/finally (or try-with-resources for Java 1.7 and higher) and close the ResultBatchIterator explicitly.- Since:
- 4.0
-
performGenericQuery
QueryResponse performGenericQuery(Query query)
Executes any kind of query providing the result in a form of QueryResponse.
-
getGraphManager
GraphManager getGraphManager()
Returns GraphManager that manages object graph associated with this context.
-
getChannel
DataChannel getChannel()
Returns an DataChannel used by this context.
-
hasChanges
boolean hasChanges()
Returnstrue
if there are any modified, deleted or new objects registered with this ObjectContext,false
otherwise.- Since:
- 3.0
-
invalidateObjects
void invalidateObjects(Collection<?> objects)
Invalidates a Collection of persistent objects. This operation only applies to the objects already committed to the database and does nothing to the NEW objects. It would remove each object's snapshot from caches and change object's state to HOLLOW. On the next access to this object, the object will be refetched.
-
invalidateObjects
<T> void invalidateObjects(T... objects)
Invalidates one or more persistent objects. Same asinvalidateObjects(Collection)
only with a vararg argument list for easier invalidation of individual objects. If no arguments are passed to this method, it does nothing.- Since:
- 3.1
-
getUserProperty
Object getUserProperty(String key)
Returns a user-defined property previously set via 'setUserProperty'. Concurrent access to properties does not require any special synchronization- Since:
- 3.0
-
-


This is a demo of the classic editor build, initialized using the DLL builds.
The package generator creates an example plugin (Togglelist
) which is loaded into the editor by default. If you changed its name or toolbar items it exposes, make sure to update the editor configuration in the sample/dll.html
file.
If the editor is not initialized correctly and the browser console displays an error such as the following:
Uncaught TypeError: Cannot read properties of undefined (reading 'Togglelist') at dll.html:85
it means that the DLL build of the @scope/ckeditor5-toggle-list
package has not been created.
Please call the yarn run dll:build
command in the CLI, and after it finishes, refresh the page.
The source of the DLL build is located in the src/index.js
file. It may export as many things as the package offers.
Whenever you change objects exported by the DLL build, please review the content of the sample. Things to keep in mind:
The primary purpose of the sample is to verify whether the plugins in the package will work together with CKEditor 5 created with the DLL approach.
By default, the build/
directory is specified in the #files
array in the package.json
file. It means all its contents will be published when calling the yarn publish
command.
Unfortunately, it is easy to forget to refresh the DLL build before making a new release. Hence, we created the prescript that would refresh the build automatically when calling the yarn publish
command.
If you found a problem with CKEditor 5 or the package generator, please, report an issue: