The htmlTable package is intended for generating tables using HTML formatting. This format is compatible with Markdown when used for HTML-output. The most basic table can easily be created by just passing a matrix
or a data.frame
to the htmlTable
-function:
library(htmlTable)
library(magrittr)
# A simple output
matrix(1:4,
ncol = 2,
dimnames = list(c("Row 1", "Row 2"),
c("Column 1", "Column 2"))) %>%
htmlTable
| Column 1 | Column 2 | |
|---|---|---|
| Row 1 | 1 | 3 |
| Row 2 | 2 | 4 |
The function is also aware of the dimnames:
# A simple output
matrix(1:4,
ncol = 2,
dimnames = list(rows = c("Row 1", "Row 2"),
cols = c("Column 1", "Column 2"))) %>%
htmlTable
| cols | ||
|---|---|---|
| Column 1 | Column 2 | |
| rows | ||
| Row 1 | 1 | 3 |
| Row 2 | 2 | 4 |
This can be convenient when working with the base::table
function:
| gear | ||||||
|---|---|---|---|---|---|---|
| 3 | 4 | 5 | Sum | |||
| cyl | ||||||
| 4 | 1 | 8 | 2 | 11 | ||
| 6 | 2 | 4 | 1 | 7 | ||
| 8 | 12 | 0 | 2 | 14 | ||
| Sum | 15 | 12 | 5 | 32 |
As of version 1.1 you no longer need to specify results='asis'
for each knitr
chunk.
Tip: If you are working a lot with dplyr
and the tidyverse
approach to exploring data you can make your life much easier using the tidyHtmlTable()
function included in this package that automatically calculates the rgroup
, cgroup
and other parameters that make htmlTable
so useful.
Cell alignment is specified through the align
, align.header
, align.cgroup
arguments. For aligning the cell values just use align
. The argument can accept either a vector or a string, although supplying it with a string is the simplest option as in the example below:
1:3 %>%
addHtmlTableStyle(align = "lcr") %>%
htmlTable(rnames = "Row 1",
header = c("'l' = left", "'c' = center", "'r' = right"),
caption = "The alignment is set through the align options. Available alternatives are l, r, c as designated by the below table.")
| ‘l’ = left | ‘c’ = center | ‘r’ = right | |
|---|---|---|---|
| Row 1 | 1 | 2 | 3 |
| The alignment is set through the align options. Available alternatives are l, r, c as designated by the below table. |
Note that you can specify a string shorter than the number of columns. This can be useful if you have plenty of columns and you simply want all remaining columns to keep the alignment of the last column. To align the row name you can just add another letter to the string while the header is aligned through the align.header
argument:
1:3 %>%
addHtmlTableStyle(align = "clcr",
align.header = "lcr") %>%
htmlTable(rnames = "Row 1",
header = c("'l' = left", "'c' = center", "'r' = right"),
caption = "The alignment is set through the align options. Available alternatives are l, r, c as designated by the below table.")
| ‘l’ = left | ‘c’ = center | ‘r’ = right | |
|---|---|---|---|
| Row 1 | 1 | 2 | 3 |
| The alignment is set through the align options. Available alternatives are l, r, c as designated by the below table. |
While it may be sufficient for basic tables a more advanced layout is often needed in medical articles with elements such as:
As many journals require that a MS Word-document is submitted it is furthermore also important that the table imports correctly to a word processor, i.e. that the table also looks nice in the final document not only in the browser. The htmlTable
-function is written for all these purposes.
For demonstration purposes we will setup a basic matrix:
mx <- matrix(ncol = 6, nrow = 8)
rownames(mx) <- paste(c("1st", "2nd",
"3rd",
paste0(4:8, "th")),
"row")
colnames(mx) <- paste(c("1st", "2nd",
"3rd",
paste0(4:6, "th")),
"hdr")
for (nr in 1:nrow(mx)) {
for (nc in 1:ncol(mx)) {
mx[nr, nc] <-
paste0(nr, ":", nc)
}
}
The purpose of the row groups is to group variables that belong to the same group, e.g. a factored variable with more than two levels often benefit from grouping variables together.
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |
|---|---|---|---|---|---|---|
| Group A | ||||||
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 |
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 |
| Group B | ||||||
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 |
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 |
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 |
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 |
| Group C | ||||||
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 |
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 |
We can easily mix row groups with regular variables by having an empty row group name ""
:
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |
|---|---|---|---|---|---|---|
| Group A | ||||||
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 |
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 |
| Group B | ||||||
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 |
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 |
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 |
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 |
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 |
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 |
When mixing row groups with variables without row groups we may want to omit the bold formatting of the row group label:
mx %>%
addHtmlTableStyle(css.rgroup = "") %>%
htmlTable(rgroup = c(paste("Group", LETTERS[1:2]), ""),
n.rgroup = c(2,4,nrow(mx) - 6))
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |
|---|---|---|---|---|---|---|
| Group A | ||||||
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 |
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 |
| Group B | ||||||
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 |
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 |
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 |
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 |
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 |
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 |
The rgroup
is most commonly a single row without any additional cells but sometimes you may want to have a p-value or similar at the end of the row. This can be achieved by setting the ‘add’ attribute to the rgroup
:
rgroup <- c(paste("Group", LETTERS[1:2]), "")
attr(rgroup, "add") <- list(`2` = "More")
htmlTable(mx,
rgroup = rgroup,
n.rgroup = c(2,4,nrow(mx) - 6))
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |
|---|---|---|---|---|---|---|
| Group A | ||||||
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 |
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 |
| Group B | More | |||||
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 |
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 |
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 |
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 |
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 |
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 |
A column spanner spans 2 or more columns:
| Cgroup 1 | Cgroup 2 | |||||||
|---|---|---|---|---|---|---|---|---|
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |||
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 | ||
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 | ||
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 | ||
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 | ||
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 | ||
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 | ||
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 | ||
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 |
It can sometimes be convenient to have column spanners in multiple levels:
htmlTable(mx,
cgroup = rbind(c("", "Column spanners", NA),
c("", "Cgroup 1", "Cgroup 2")),
n.cgroup = rbind(c(1,2,NA),
c(2,2,2)))
| Column spanners | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Cgroup 1 | Cgroup 2 | |||||||||
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |||||
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 | ||||
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 | ||||
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 | ||||
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 | ||||
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 | ||||
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 | ||||
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 | ||||
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 |
Above example allows the column spanner to be a sum of the underlying cgroups (see n.cgroup), this is not required by the function and you can also provide a list
with elements that allows you to skip the NA
at the end of the matrix:
htmlTable(mx,
cgroup = list(c("Super column spanner", ""),
c("", "Another cgroup"),
c("", "Cgroup 1", "Cgroup 2")),
n.cgroup = list(c(5,1),
c(1,2),
c(2,2,2)))
| Super column spanner | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Another cgroup | ||||||||||||
| Cgroup 1 | Cgroup 2 | |||||||||||
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |||||||
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 | ||||||
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 | ||||||
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 | ||||||
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 | ||||||
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 | ||||||
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 | ||||||
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 | ||||||
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 |
A table spanner is similar to rgroup but has the primary purpose of combining 2 or more tables with the same columns into one:
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |
|---|---|---|---|---|---|---|
| Spanner A | ||||||
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 |
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 |
| Spanner B | ||||||
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 |
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 |
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 |
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 |
| Spanner C | ||||||
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 |
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 |
Note that you actually don’t need the last n.tspanner
, i.e. you can simplify the above to:
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |
|---|---|---|---|---|---|---|
| Spanner A | ||||||
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 |
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 |
| Spanner B | ||||||
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 |
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 |
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 |
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 |
| Spanner C | ||||||
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 |
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 |
Similarly you can use the number rgroups included in each tspanner instead of actual rows. This is convenient as the tspannners must align with underlying rgroups.
Many financial tables use the concept of a total row at the end that sums the above elements:
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |
|---|---|---|---|---|---|---|
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 |
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 |
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 |
This can also be combined with table spanners:
mx %>%
addHtmlTableStyle(css.total = c("border-top: 1px dashed grey;",
"border-top: 1px dashed grey;",
"border-top: 1px solid grey; font-weight: 900")) %>%
htmlTable(total = "tspanner",
tspanner = paste("Spanner", LETTERS[1:3]),
n.tspanner = c(2,4,nrow(mx) - 6))
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |
|---|---|---|---|---|---|---|
| Spanner A | ||||||
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 |
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 |
| Spanner B | ||||||
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 |
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 |
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 |
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 |
| Spanner C | ||||||
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 |
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 |
The htmlTable has built-in numbering, initialized by:
| 1st hdr | 2nd hdr | |
|---|---|---|
| 1st row | 1:1 | 1:2 |
| 2nd row | 2:1 | 2:2 |
| Table 1: A table caption with a numbering |
As we often want to reference the table number in the text there are two associated functions:
## [1] 1
## [1] 2
| 1st hdr | 2nd hdr | |
|---|---|---|
| 1st row | 1:1 | 1:2 |
| 2nd row | 2:1 | 2:2 |
| Table 2: Another table with numbering |
If you want to start the counter at 2 you can instead of setting table_counter to TRUE
set it to 1. Note that you need to set the value to one less as each time the table is called the counter is incremented by one. You can also turn off the feature by:
Zebra coloring is also know as an alternating color pattern or row shading. It is most commonly applied to rows:
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |
|---|---|---|---|---|---|---|
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 |
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 |
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 |
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 |
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 |
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 |
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 |
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 |
The zebra coloring in htmlTable
is unique in that it follows the rgroups. The zebra striping is centered around the rgroup although rows with no set rgroup, i.e. "" will have alternating colors event though they programatically are within the same group:
mx %>%
addHtmlTableStyle(col.rgroup = c("none", "#F7F7F7")) %>%
htmlTable(rgroup = c(paste("Group", LETTERS[1:2]), ""),
n.rgroup = c(2,2,nrow(mx) - 4))
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |
|---|---|---|---|---|---|---|
| Group A | ||||||
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 |
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 |
| Group B | ||||||
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 |
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 |
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 |
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 |
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 |
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 |
We can also color the columns:
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |
|---|---|---|---|---|---|---|
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 |
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 |
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 |
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 |
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 |
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 |
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 |
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 |
Or do both (note that the colors blend at the intersections):
mx %>%
addHtmlTableStyle(col.rgroup = c("none", "#F9FAF0"),
col.columns = c("none", "#F1F0FA")) %>%
htmlTable
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |
|---|---|---|---|---|---|---|
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 |
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 |
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 |
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 |
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 |
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 |
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 |
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 |
Now if we want to do everything in one table it may look like this:
rgroup = paste("Group", LETTERS[1:3])
attr(rgroup, "add") <- list(`3` = "Group p-value < 0.001")
mx %>%
addHtmlTableStyle(align = "rr|r",
align.header = "cc|c",
spacer.celltype = "double_cell",
col.columns = c(rep("none", 2),
rep("#F5FBFF", 4)),
col.rgroup = c("none", "#F7F7F7"),
css.cell = "padding-left: .5em; padding-right: .2em;",
css.header = "font-weight: normal") %>%
htmlTable(rgroup = rgroup,
n.rgroup = c(2,4),
tspanner = paste("Spanner", LETTERS[1:2]),
n.tspanner = c(1),
cgroup = list(c("", "Column spanners"),
c("", "Cgroup 1", "Cgroup 2†")),
n.cgroup = list(c(1,5),
c(2,2,2)),
caption = "A table with column spanners, row groups, and zebra striping",
tfoot = "† A table footer commment",
cspan.rgroup = 2)
| Column spanners | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Cgroup 1 | Cgroup 2† | |||||||||||
| 1st hdr | 2nd hdr | 3rd hdr | 4th hdr | 5th hdr | 6th hdr | |||||||
| Spanner A | ||||||||||||
| Group A | ||||||||||||
| 1st row | 1:1 | 1:2 | 1:3 | 1:4 | 1:5 | 1:6 | ||||||
| 2nd row | 2:1 | 2:2 | 2:3 | 2:4 | 2:5 | 2:6 | ||||||
| Spanner B | ||||||||||||
| Group B | ||||||||||||
| 3rd row | 3:1 | 3:2 | 3:3 | 3:4 | 3:5 | 3:6 | ||||||
| 4th row | 4:1 | 4:2 | 4:3 | 4:4 | 4:5 | 4:6 | ||||||
| 5th row | 5:1 | 5:2 | 5:3 | 5:4 | 5:5 | 5:6 | ||||||
| 6th row | 6:1 | 6:2 | 6:3 | 6:4 | 6:5 | 6:6 | ||||||
| Group C | Group p-value < 0.001 | |||||||||||
| 7th row | 7:1 | 7:2 | 7:3 | 7:4 | 7:5 | 7:6 | ||||||
| 8th row | 8:1 | 8:2 | 8:3 | 8:4 | 8:5 | 8:6 | ||||||
| A table with column spanners, row groups, and zebra striping | ||||||||||||
| † A table footer commment |


chrome.experimental.* APIs
We'd like your feedback
on the following experimental APIs:
Caution:
Don't depend on these experimental APIs.
They might disappear,
and they will change.
Also, the Chrome Developer Dashboard doesn't allow you to
upload extensions that use experimental APIs.
How to use experimental APIs
-
Make sure you're using the
Dev channel
of Google Chrome.
Although the experimental APIs might work in other versions,
we need your feedback on the latest incarnation of the APIs,
which you can find on the Dev channel.
-
Using the
API documentation for the Dev channel,
write the code for your extension.
-
Specify the "experimental"
permission
in your extension's manifest, like this:
"permissions": [
"experimental",
...
],
-
Enable the experimental API in your browser.
You can do this in either of two ways:
-
Give us feedback!
Your comments and suggestions help us
improve the APIs and decide
which ones should move from experimental to supported.
More information
For information on the standard APIs that extensions can use, see
chrome.* APIs and
Other APIs.


Applies To
- Applications written using Servlets or JSP that interact with a database.
What to Do
Apply the principle of least privilege to any accounts used by the application to access the backend database server.
Why
Applying the principle of least privilege to all of the application's database accounts reduces the damage potential if such accounts get compromised by an attacker.
When
Apply least privileges any time your application uses a backend database server.
How
To apply the principle of least privilege to the application's database accounts:
- Identify all database accounts. Create a list of all of your application's database accounts and the respective servers and databases that they connect to.
- Identify the roles associated with each database account. Understand the purpose of each account and the functionality each will be executing. Using a table, map all accounts to the minimum privileges they require. None of the application's accounts should have administrative rights on the database server.
- Set appropriate privileges. Once all accounts and their roles have been identified, set the appropriate privileges at the respective database servers. Make sure that each account has enough privileges to execute the assigned tasks only. Any extra privileges should be revoked.


The task is to write a program that suggests common phrases based on a given text.
The input contains a set of phrases with usage frequencies and a set of queries. Your goal is to output up to 50 of the most common phrases that contain a given queried text. This should be done for every query.
The input & output could look something like this:
Input:
Common phrases:
30:Qui dolorem ipsum quia dolor sit amet
70:magnam aliquam quaerat
40:torquent per conubia nostra
90:tellus id magna elementum
Queries:
agna
dolor
Output:
Found: 2
tellus id magna elementum
magnam aliquam quaerat
Found: 1
Qui dolorem ipsum quia dolor sit amet
Since this isn’t a new problem by any means, there is a handful of approaches one can go with. Most notably, suffix trees and suffix arrays.
A suffix tree can be constructed in O(n) time, where n denotes the number of characters in a phrase, and it can answer queries in O(m) time, where m denotes the number of characters in a query. As I see it, the two biggest disadvantages of suffix trees are memory consumption (which shouldn’t be a problem as we were promptly informed in the original problem description) and secondly the complexity of creating the actual tree in O(n) time. It isn’t by any means a trivial algorithm, especially for first-year students.
A suffix array can be constructed in O(n * log n) at best, if you don’t want to build a suffix tree in O(n) time beforehand. It can answer queries in O(m * log n) in the worst case. Suffix arrays are much easier to construct and take up less space. On the other hand, they do seem much slower, compared to suffix trees, when you look at the time complexities.
Well, we already established the importance of good time complexity in regards to the number of characters in a phrase and the number of characters in a query, but there is one more thing we left out to consider. It’s the number of phrases we have to search through.
You might have thought about this and concluded that there is no reasonable way to include all phrases in one big suffix tree or one big suffix array because the worst-case time complexities would be insane. And you’re right, but this is where you made the mistake of not considering the type of data you are being given by Progtest.
The point to be taken here is, that with different types of input, the problems’ shape drastically changes. The only description of the input for the bonus test went something like this: “There will be many phrases, they will have many characters and there will be many queries”. What you need to realize is, that this doesn’t tell you absolutely anything. The way you design your algorithm should change based on if you’ll be getting 100 phrases that all look something like this:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
or if you’ll be getting 10 000 phrases that all look something like this:
abcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd
and so on…
So in my opinion, the right move to make here is to take a clue for the bonus test and figure out what is the structure of the data you’ll be getting.
If your clue looks anything like mine, then you should be able to deduce that each phrase will have about 160 characters, that there can be up to about 5000 phrases and that each query will have about 45 characters. And most importantly, that these phrases will be reasonable, meaning that there won’t be any phrases with one repeating letter or any fibonacci words, etc.
Taking the figures above, you can easily calculate that with 160 and 45 characters, the difference between a suffix tree and a suffix array will most likely not be noticeable. Both in search and in construction. What will be noticeable is the possible multiply factor of 5000 for each query.
I believe that you can use any reasonable algorithm as long as you optimize it in accordance with the Y-axis of the input data, meaning the number of phrases. I ended up just creating one big suffix array for all the phrases altogether.
a) Allocate an array for n * l suffixes, where n stands for the number of phrases and l stands for the average length of a phrase
b) Each suffix has these attributes:
c) Fill the array by iterating once through all the phrases
d) Sort the array. I’m literally just using quicksort with no additional tricks. This could take up to about O{ (n * l^2^) * log (n * l^2^) } because we have n * l items and we could need to compare up to l characters when comparing two suffixes. But that’s only if all the phrases were composed of just one repeating letter. Since we know that isn’t the case, quicksort will most likely need to compare only about the first 3-4 characters when comparing two suffixes. So the sorting should be reasonably fast.
a) Do a binary search on the suffix array and either return that no matches were found or return the position of a match.
b) Check for other matching suffixes around the one that was found and keep track of the phrases they belong to.
c) Take these phrases and print out up to 50 of the most common ones.
And that’s it!


There are many cool things on the roadmap for the Tribe platform like mobile device skins for each platform, seamless scale-out of the MessageHub component, better distributed event sourcing support, Azure Mobile Services integration and much more.
If you'd like to get involved, feel free to fork the github repository and submit pull requests. If you'd like to be part of the project, please email<EMAIL_ADDRESS>tweet @tribejs or use the feedback button at the top of the page.


Kibo Fono is a microphone recording and playback app. Record your own sounds and play them using the Koday Kibo or any other MIDI controller. Connect with Buetooth or MIDI below.


Start-up Wealthinity launches to help smaller wealth managers compete
by Ruby HinchliffeWealthtech start-up Wealthinity has launched to help smaller wealth managers compete with big firms by providing a web-based portfolio portal which it says can service clients in just 15 minutes.
Small to medium-sized financial advisors, wealth managers and private banks can partner with the start-up to offer customised investment solutions under their own brands (i.e. white label) “without any additional costs”.
The start-up is a spinoff of Westminster-headquartered Fusion Group, an institutional asset manager which now deals with high net worth and retail clients.
“In recent years, an increasing number of smaller wealth management and financial advisory firms have struggled with growth, due to failing to compete with larger financial institutions,” says Wealthinity’s co-founder, Taras Rybak.
“This is because they lack the same capabilities, ranging from in-house investment expertise, research and technology through to having a clear understanding of complex investment products together with access to a wide range of trading counterparties.”
Rybak says that by helping these smaller firms with portfolio construction, they can offer a more attractive service to clients which tackles the stagnation in growth many are currently experiencing.
Read next: Bank Mandiri selects Avaloq Banking Suite to consolidate legacy wealthtech


Exploratory Data Analysis Viewer
Table of Contents
Data UI
Load Data
Manipulate Data
Univariate Analysis
Bivariate Analysis


Menu
Home
Random quote
Invalid link (error page)
Default sentence to display.
Default sentence to display.
Next quote
Back to home
Do you want to add a new one?
Save
© 2017-2018


Before Change
for val in vals:
// for processing the key likes "foo.bar"
name, field = val
ks = key.split(".")
def reducer(obj, key):
if isinstance(obj, list):
results = []
After Change
class Example(object):
@classmethod
def fromJSON(cls, data, fields):
warnings.warn("{} class has ".format(self.__class__.__name__) +
"been retired and moved to torchtext.legacy. Please " +
"import from torchtext.legacy.data if you still want it.", UserWarning)
raise ImportWarning
@classmethod
def fromdict(cls, data, fields):


{% set thisTab = 'Payment' %} {% set pageTab = 'Policy' %} {% extends "pp_layout.html" %} {% block page_content %}
Permit fees will vary based on fee calculation rules determined by each individual council. In some cases the permit may be issued free of charge, for example, if the resident is the first member of the household to apply.
Your service can accept payment via a number of channels, including cheques, bank transfers or online payments. Councils can find a supplier on the Digital Marketplace.
In the future, your service will be able to accept payments using GOV.UK Pay.
{% endblock %}


---
subject: Welcome to Startochic
---
Startochic
New Arrivals
Best Sellers
Shoes
Dresses
Tops
Bottoms
This email was sent to you by startochic.com. To ensure that our fashion updates get to you, please add our e-mail address to your address book. If you have any questions regarding your orders or products, please contact us at
service@startochic.com.


CAB seize documents in Galway search
by By Digital Desk staffOfficers from the Criminal Assets Bureau have carried out a search in Galway aimed at targeting the assets and activities of a member of an organised crime gang involved in burglary and theft.
The operation relates to the theft of high end vehicles and machinery across the country.
The search took place at a house in Tuam this morning.
Documents relating to accounts, and the purchase of vehicles and property were seized.
A Revenue Assessment for approximately €500,000 was served on an individual.
READ MORE
Two arrested in Dublin in connection with ATM fraud incidents


This is a DEMO page
DO NOT SEND REAL ETHER!Make sure to have your MetaMask set on Rinkeby Test Network.
To get free ETH on Rinkeby Test Network use the faucet.
Project Details
Options
Token Details
Crowdsale Details
Start time
End time
Raised
/ ETH
Sold
Exchange Rate
/ETH
Token purchase agreement
Before invest please read the terms of use and confirm the facts in the checkboxes below in order to proceed.
Do not send ETH from exchange like Coinbase, Bitfinex, GDAX or similar. They don’t give you any access to your wallet so sending ETH from one of these means for you losing your rewards tokens and we won’t be able to help you to recover them.
Invest using MetaMask
ETH
You will receive
Invest using your preferred wallet
Send the amount of ETH you want to invest to the Crowdsale address below.
Invest using QR Code
Send the amount of ETH you want to invest to the Crowdsale address using QR Code.


Get best prices from shopping giants like flipkart, snapdeal and amazon.
Beacause we know how much you love them
Know about the deals the world prefers
It's no harm to take shortcuts for an easier an better lifestyle.
You can have us here...
Facebook
Youtube


WATCH: “When Bad MakeUp Happens To Good People”
by Timothy NdoroA video has gone viral on social media which shows the pitfalls of applying too much make-up without the aid of feedback.
In the video, the woman’s makeup is drastically different from her skin one and seems to have been gratuitously applied, perhaps without the aid of a mirror.
Unfortunately, for the lady in question, she does not seem to appreciate how bad her makeup is and how horrible she looks.
The video does not appear to have been shot in Zimbabwe though.
To View and Apply for the latest Jobs and Vacancies in Zimbabwe, Please Visit our Sister website iHarare Jobs


Tools for getting historical weather information and forecasts from wunderground.com. Historical weather and forecast data includes, but is not limited to, temperature, humidity, windchill, wind speed, dew point, heat index. Additionally, the weather underground weather API also includes information on sunrise/sunset, tidal conditions, satellite/webcam imagery, weather alerts, hurricane alerts and historical high/low temperatures.
| Version: | 0.1.8 |
| Imports: | httr, dplyr, countrycode, lubridate, tibble |
| Published: | 2018-05-01 |
| Author: | Alex Shum |
| Maintainer: | Eric Hare <eric at omnianalytics.io> |
| BugReports: | https://github.com/alshum/rwunderground/issues |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| URL: | https://github.com/ALShum/rwunderground, http://www.wunderground.com/weather/api |
| NeedsCompilation: | no |
| Materials: | README NEWS |
| CRAN checks: | rwunderground results |
| Reference manual: | rwunderground.pdf |
| Package source: | rwunderground_0.1.8.tar.gz |
| Windows binaries: | r-devel: rwunderground_0.1.8.zip, r-release: rwunderground_0.1.8.zip, r-oldrel: rwunderground_0.1.8.zip |
| OS X binaries: | r-release: rwunderground_0.1.8.tgz, r-oldrel: rwunderground_0.1.8.tgz |
| Old sources: | rwunderground archive |
Please use the canonical form https://CRAN.R-project.org/package=rwunderground to link to this page.


|
Serial Wombat Arduino Library
|
A class to control Servos attached to the Serial Wombat. More...
#include <SerialWombatServo.h>
Public Member Functions | |
| SerialWombatServo (SerialWombat &sw) | |
| Constructor for the SerialWombatServo Class. More... | |
| ~SerialWombatServo () | |
| void | attach (uint8_t pin) |
| Initialize a servo on the specified pin. More... | |
| void | attach (uint8_t pin, bool reverse) |
| Initialize a servo on the specified pin. More... | |
| void | attach (uint8_t pin, uint16_t min, uint16_t max) |
| Initialize a servo on the specified pin. More... | |
| void | attach (uint8_t pin, uint16_t min, uint16_t max, bool reverse) |
| Initialize a servo on the specified pin. More... | |
| void | write (uint8_t angle) |
| Writes a value to the servo. More... | |
| void | write16bit (uint16_t position) |
| Writes a 16 bit value to the servo. More... | |
| uint8_t | read (void) |
| returns the last position of the servo scaled to a number from 0 to 180. More... | |
A class to control Servos attached to the Serial Wombat.
The SerialWombatServo class is used to control hobby servos attached to the Serial Wombat.
Any output-capable pin may be attached to an instance of the SerialWombatServo class. A separate instance should be declared for each Servo.
The SW4B_Ard_Servo example included with the Arduino library shows how to use this class.
This class uses "attach" rather than "begin" to initialize servos to be consistent with the Arduino Servo native API.
A Tutorial video is also avaialble:
| SerialWombatServo::SerialWombatServo | ( | SerialWombat & | sw | ) |
Constructor for the SerialWombatServo Class.
| sw | A reference to a previously declared SerialWombat to which the Servo is connected. |
| SerialWombatServo::~SerialWombatServo | ( | ) |
| void SerialWombatServo::attach | ( | uint8_t | pin | ) |
Initialize a servo on the specified pin.
This function must be called after the SerialWombat instance specified in the constructor has been initialized with a begin call.
This function initializes a servo with a minimum pulse of 544 uS and a maximum pulse of 2400uS to be consistent with the native Arduino API attach function.
| pin | The Serial Wombat pin to set. Valid values for SW4A: 0-3 SW4B: 1-3 |
| void SerialWombatServo::attach | ( | uint8_t | pin, |
| bool | reverse | ||
| ) |
Initialize a servo on the specified pin.
This function must be called after the SerialWombat instance specified in the constructor has been initialized with a begin call.
This function initializes a servo with a minimum pulse of 544 uS and a maximum pulse of 2400uS to be consistent with the native Arduino API attach function.
| pin | The Serial Wombat pin to set. Valid values for SW4A: 0-3 SW4B: 1-3 |
| reverse | If true, the pulse widths will be reversed, with the longest pulse width corresponding to 0 position. |
| void SerialWombatServo::attach | ( | uint8_t | pin, |
| uint16_t | min, | ||
| uint16_t | max | ||
| ) |
Initialize a servo on the specified pin.
This function must be called after the SerialWombat instance specified in the constructor has been initialized with a begin call.
| pin | The Serial Wombat pin to set. Valid values for SW4A: 0-3 SW4B: 1-3 |
| min | Minimum pulse width in uS. Minimum functional value is 100. |
| max | Maximum pulse width in uS |
| void SerialWombatServo::attach | ( | uint8_t | pin, |
| uint16_t | min, | ||
| uint16_t | max, | ||
| bool | reverse | ||
| ) |
Initialize a servo on the specified pin.
This function must be called after the SerialWombat instance specified in the constructor has been initialized with a begin call.
| pin | The Serial Wombat pin to set. Valid values for SW4A: 0-3 SW4B: 1-3 |
| min | Minimum pulse width in uS. Minimum functional value is 100. |
| max | Maximum pulse width in uS |
| reverse | If true, the pulse widths will be reversed, with the longest pulse width corresponding to 0 position. |
| uint8_t SerialWombatServo::read | ( | void | ) |
returns the last position of the servo scaled to a number from 0 to 180.
| void SerialWombatServo::write | ( | uint8_t | angle | ) |
Writes a value to the servo.
This funciton allows setting the "angle" of a servo, although actual travel may vary. Consider using the Serial Wombat function write16bit for higher resolution
| angle | A value from 0 to 180 |
| void SerialWombatServo::write16bit | ( | uint16_t | position | ) |
Writes a 16 bit value to the servo.
This funciton scales the pulse width of the signal being sent to the servo.
| position | Servo position. 0 sends the minimum pulse width. 65535 sends the maximum pulse width (unless Reverse is enabled) |


Scientific Knowledge Engineering ('SKE') involves combining ontology/knowledge engineering, artificial intelligence, the semantic web, machine reading and science informatics techniques to support the development of next-generation scientific informatics infrastructure. This work is lead by Gully Burns, who joined the Chan Zuckerberg Initiative in December 2018.
My work has included development of:
- The BioScholar and NeuroScholar systems as prototypes of general purpose scientific knowledge management systems
- The Knowledge Engineering from Experimental Design (KEfED) methodology as a practical method for developing ontologies for complex, experimental biomedical data
- The Scientific Discourse Tagger (SciDT) system (in collaboration with Ed Hovy's group at CMU)
- The TechKnAcq tool for extracting reading lists from copora of scientific documents
- The NeuARt neuroanatomical data viewer
- The NIHMaps topic mapping system neuroanatomical data viewer
The SciKnowEngine 'swirl' logo represents the Cycle of Scientific Investigation as a group of combined threads that resembles a breaking ocean wave. The color scheme is derived from Van Gogh's Starry Night.


I am Alexander Sanford, I am an MLIS student attending the University of Pittsburgh.
This website is designed to showcase the portfolio of my work while attending the University.
Thank you for taking the timee to view my work, and see what I have to offer.
Thank you,
Alex Sanford


Kyle Scott Bradell
Republican
Uber/Lyft Driver.
The highest education I have is an undergraduate's degree from Saint Louis University in which I earned it in only three years. My degree is in political science and Spanish.
80210
My experience comes from running for political office and a member of RTD's disability committee. While on the disability committee, I have advocated greatly that RTD does more. I have seen for three years now that RTD is very slow in making decisions. When I share my ideas and solutions, the disability committee members agree with me. Outside of that, nothing else.
2016 - GOP Candidate for Colorado's 6th Congressional District. I lost at the GOP 6th Congressional Convention in April 2016. 2020 - RTD Board of Directors District A. RTD is nonpartisan and, as such, I attended local Democrat and Republican meetings to let voters know they could vote for me. I lost the election. I have donated to the Trump Campaign since 2017. Maybe once to the Colorado State GOP party. I have paid entrance fees to GOP meetings for breakfast clubs and lunch clubs. For local and state campaigns, I don't think I have ever donated to an individual candidate campaign. Also, forgot to add a precinct person for my precinct for the 2020 election cycle.
For the past three years, I have been a volunteer member on RTD's Advisory Committee for People with Disabilities (ACPD). I graduated from Denver Regional Council of Governments (DRCOG)'s Citizens Academy.
One, it is my duty to serve America. Just like President John F. Kennedy said: "Ask not what your country can do for you; ask what you can do for your country." Well, I am doing exactly what he said with serving on this Commission. Two, I enjoy challenges and solving puzzles. I was an accountant for almost 9 years. Everyday I had problems coming my way, but I soon discovered that many of these problems can be avoided with easy solutions and talking to my coworkers. And I did just that and it worked!
I can be fair and impartial easily. For example, while running for the nonpartisan race of RTD, I went to Democrat and Republican meetings. I went door-to-door during my campaign asking for people's votes. I did not care if they were Green, Socialist, Republican, Unaffiliated, etc. I care greatly about RTD and wanted everyone to know how I can make it better for everyone. I can promote consensus amongst the commissioners as I have patience and the ability to listen to people. I prefer to listen, first, before making any kind of judgement. That way, I can think carefully and provide great ideas and solutions that will work for my colleagues, such as the commissioners.
For this answer, it comes from almost nine years as an accountant. As a former accountant, I had to apply logic and reason to problems every single day. If I didn't nothing would get done and the balance sheets and the GLs would be messed up allowing the potential for misuse of funds and runaway expenses. Thus, I can do the same with this Commission. There is only a set number of people that Colorado will have. This means we can easily piece the puzzle together and come to an amicable solution for everyone.


Weathered Rock:
You defeated the fallen angel on this rock. Now take its blood to High Priest Raymond in Gludio.


--- layout: default title: Comparisons ---
This article attempts to describe the whole open source configuration space, and Jsonnet's place within it. Needless to say this is challenging and this will be a living document.
JSON is used to describe data literally. Jsonnet extends JSON. Jsonnet has relaxed syntax and comments to make it easier for humans to write. Jsonnet also adds constructs for generating, translating and refining data. Because Jsonnet is an extension of JSON, valid JSON is also valid Jsonnet that just emits that JSON unchanged.
YAML is also an extension of JSON that generates JSON. Like Jsonnet, YAML is intended to improve the user experience when data is transferred over the human / machine boundary. Its syntax is very tight; YAML files are much shorter than their JSON equivalents. However its constructs for generating, translating, and refining data are very weak in comparison to Jsonnet. Moreover, the tightness of its syntax makes it hard to extend YAML to add these features. In particular, YAML and Jsonnet disagree about what 1+1 should mean. YAML already defines it to mean the string "1+1", whereas in Jsonnet we want it to be 2. Jsonnet therefore builds from JSON and not YAML.
Jsonnet is a form of templating language as it generates data from programs that interleave verbatim data with computation constructs. However other templating languages operate on plain text. That is to say that the data amongst which the computational constructs are intermingled are simply plain text, and the output of the evaluation is also plain text. This means such systems can be used to produce files with arbitrary syntax, e.g. custom configuration file syntax, HTML, or even JSON.
However, since these templating languages are unaware of the syntax of the file they're generating (they think it is simply plain text), they cannot help the programmer avoid creating errors in the underlying representation.
By analogy, the C preprocessor has no understanding of C syntax. C preprocessor macros can break that syntax if they are used wrongly. The net result of this is that problems with the use of these macros must be debugged by examining the output of the evaluation (i.e. the generated C code). Errors cannot be presented at the level at which the programmer is actually working. For this reason, the vast majority of modern languages do not feature a pre-processor.
The situation is the same when templating languages are used to generate HTML, often the developer will check the generated HTML because successful evaluation of the template does not imply the HTML is correct. The same is true when the target language is JSON. Jsonnet avoids these problems, as although it is limited to JSON output, it is guaranteed that the output will be valid JSON.
ML is a functional language like Jsonnet. However ML is not pure, and also has strict evaluation.  Providing static type safety means programmers have to understand type inference, unification errors, and also provide the occasional type annotation. Even then, some correct programs are rejected.
The Nix expression language, which is a pure lazy functional language with dynamic typing, is therefore closer to Jsonnet. Jsonnet differs from the Nix expression language mainly in that it also has object-oriented semantics in the form of mixins. Also, Jsonnet is an extension of JSON, whereas the Nix expression language is not (in particular it lacks floating point numbers).
Most scripting languages are dynamically typed languages, often with object-oriented features.
However, Jsonnet is also a templating language, which makes it very good for generating data that is a mixture of verbatim and computed elements. Jsonnet programs can be easily understood and modified by someone who only knows JSON. Any parts of the program which are just JSON (i.e. do not make use of the extended Jsonnet constructs) can be modified with predictable results. Jsonnet's pure functional semantics also make modifying the program more predictable.
More importantly, Jsonnet has the property of hermeticity. This means that regardless of when or where a Jsonnet program is evaluated, it will always generate the same JSON. This means the program can be freely converted to data, and thus it can be thought of as equivalent to data. This is not the case with general purpose languages, as they are allowed to read files, contact the network, look up the time, or any number of other sources of non-deterministic behavior. While it is possible to sandbox some scripting languages in order to patch all of these holes, the result of this is a new language that is incompatible with the original language. This makes Jsonnet a lot more suitable for configuration than general purpose scripting languages.
One advantage that is often put forward for using general purpose scripting languages as configuration languages is that they are already well-understood by a large number of people. However this is also true of Jsonnet, because of its backwards compatibility with JSON, its use of mixins (a decades old construct that is well-understood) and the mimicking of Python syntax in cases where that makes sense (e.g. string formatting and comprehension constructs).
Finally, Jsonnet is a much smaller language than most general purpose scripting languages, yet despite this it has considerable expressive power.
Coil is a configuration language that is interpreted by a Python library. Like Jsonnet, it has a JSON-like data model and some facilities for extending objects to avoid duplication, referring to other parts of the structure, and importing from other files. However it is a long way from the expressiveness of the object-oriented semantics of Jsonnet, and it also does not have the ability to do arithmetic beyond substituting values into strings. Finally, coil binds variables according to dynamic scoping rules, which have long been discredited because they quickly make code very difficult to understand. Jsonnet uses static scoping, like almost all mainstream languages.
Pystachio is a Python framework that
makes it easier to use Python itself as a configuration language. It extends Python's
existing data literals (which are JSON-like) to enforce immutability and add some templating
functionality. However it lacks the full computational abilities of Jsonnet. Although it
does allow some computation within string values via template expansion, the only variables
you can access are stored in separate "environments", and there is no direct access to the
data being configured. Even if we assume that all data is stored in environments and object
fields merely forward to the environment, the language does not have any true
object-orientation features. While scopes are inherited from outer objects, this just an
implicit way of doing what you can do in Jsonnet with $
or local
.
In Pystachio there is no way to derive a struct from another struct with a few changes, let
alone use late binding or the expressive power of mixins.
Finally, there are a number of other configuration languages that have grown to be used by a range of applications. For example INI files or Apache config files. Typically these offer few features beyond simple JSON and provide very little functionality when compared to Jsonnet.


{% load static %}
Now Playing
Now Playing
Title
Artist
Album
Skip
0
Re-add
0
Add Music to Playlist
Next Up
{% for item in playlist %}
{{ item.0 }}
{{ item.1 }}
{% endfor %}
Alert
Disconnected from host. Please refresh.


EquatableList<(Of <(<'T>)>)> Members
The EquatableList<(Of <(<'T>)>)> type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| EquatableList<(Of <(<'T>)>)>()()()() |
Initializes a new instance of the
EquatableList<(Of <(<'T>)>)> class that is empty and has the
default initial capacity.
|
|
| EquatableList<(Of <(<'T>)>)>(IList<(Of <<'(T>)>>), Boolean) |
Initializes a new instance of EquatableList<(Of <(<'T>)>)>.
If the wrap parameter is true, the
collection is used as is without doing
a copy operation. Otherwise, the collection is copied
(which is the same operation as the
[EquatableList{T}.EquatableList(IEnumerable{T})] overload).
The internal collection is used for
all operations except for Equals(IList<(Of <<'(T>)>>)), GetHashCode()()()(),
and ToString()()()(), which are all based on deep analysis
of this collection and any nested collections.
|
|
| EquatableList<(Of <(<'T>)>)>(IEnumerable<(Of <<'(T>)>>)) |
Initializes a new
instance of the EquatableList<(Of <(<'T>)>)>
class that contains elements copied from the specified collection and has
sufficient capacity to accommodate the number of elements copied.
|
|
| EquatableList<(Of <(<'T>)>)>(Int32) |
Initializes a new instance of the EquatableList<(Of <(<'T>)>)>
class that is empty and has the specified initial capacity.
|
Methods
| Name | Description | |
|---|---|---|
| Add |
Adds an item to the EquatableList<(Of <(<'T>)>)>.
|
|
| Clear |
Removes all items from the EquatableList<(Of <(<'T>)>)>.
|
|
| Clone |
Creates a new object that is a copy of the current instance of equatable
list.
|
|
| Contains |
Determines whether the EquatableList<(Of <(<'T>)>)> contains a specific value.
|
|
| CopyTo |
Copies the entire EquatableList<(Of <(<'T>)>)> to a compatible one-dimensional array,
starting at the specified index of the target array.
|
|
| Equals(IList<(Of <<'(T>)>>)) |
Compares this sequence to another IList
implementation, returning true if they are equal, false otherwise.
The comparison takes into consideration any values in this collection and values
of any nested collections, but does not take into consideration the data type.
Therefore, EquatableList<(Of <(<'T>)>)> can equal any IList
with the exact same values in the same order.
|
|
| Equals(Object) |
If the object passed implements IList,
compares this sequence to obj, returning true if they
are equal, false otherwise.
The comparison takes into consideration any values in this collection and values
of any nested collections, but does not take into consideration the data type.
Therefore, EquatableList<(Of <(<'T>)>)> can equal any IList
with the exact same values in the same order.
|
|
| Finalize | (Inherited from Object.) | |
| GetEnumerator |
Returns an enumerator that iterates through the EquatableList<(Of <(<'T>)>)>.
|
|
| GetHashCode |
Returns the hash code value for this list.
The hash code determination takes into consideration any values in
this collection and values of any nested collections, but does not
take into consideration the data type. Therefore, the hash codes will
be exactly the same for this EquatableList<(Of <(<'T>)>)> and another
IList (including arrays) with the same values in the
same order.
|
|
| GetType | (Inherited from Object.) | |
| IndexOf |
Determines the index of a specific item in the EquatableList<(Of <(<'T>)>)>.
|
|
| Insert |
Inserts an item to the EquatableList<(Of <(<'T>)>)> at the specified index.
|
|
| MemberwiseClone | (Inherited from Object.) | |
| Remove |
Removes the first occurrence of a specific object from the EquatableList<(Of <(<'T>)>)>.
|
|
| RemoveAt |
Removes the EquatableList<(Of <(<'T>)>)> item at the specified index.
|
|
| ToString |
Returns a string representation of this collection (and any nested collections).
The string representation consists of a list of the collection's elements in
the order they are returned by its enumerator, enclosed in square brackets
("[]"). Adjacent elements are separated by the characters ", " (comma and space).
|
Operators
| Name | Description | |
|---|---|---|
| Equality |
Overload of the == operator, it compares a
EquatableList<(Of <(<'T>)>)> to an IEnumerable
implementation.
|
|
| Inequality |
Overload of the != operator, it compares a
EquatableList<(Of <(<'T>)>)> to an IEnumerable
implementation.
|
Properties
| Name | Description | |
|---|---|---|
| Count |
Gets the number of elements contained in the EquatableList<(Of <(<'T>)>)>.
|
|
| IsReadOnly |
Gets a value indicating whether the EquatableList<(Of <(<'T>)>)> is read-only.
|
|
| Item |
Gets or sets the element at the specified index.
|


Welcome to the Populous Symmetry Tool, which can help level designers with the chore of making levels fair, with equal wood, land, height, huts, wildmen etc. It works by creating a mirror image of one half of the map, or mirror image in two directions of one quarter of the map. Both land and objects can be mirrored, and in the case of objects specific to one tribe, they can be modified in colour to create the same number of objects for each tribe. Other features include rotatation and movement of the map.
This Symmetry Tool is a fresh remake of the original Symmetry Tool made a few years back. Version 2.0 now uses .Net Framework and is more up to date with the current operating systems. Version 1.5 can still be downloaded via it's Official Site.
For more information visit the Official Site where more of TedTycoon's programs can be found.


Introduction to Ruby Classes
Classes in Ruby are like a template or blueprint for defining data as objects and the methods that can operate on that data. The idea of the class is to group things together into one unit so we can have access to them. Every time we create something it becomes an Object(a piece of data that has been created from the Class blueprint).
Class defines a "state" and the "behaviour" of an object . They can be instantiated or having objects created that are instances of the class, we do that the following way:
obj = Object.new
When we use the dot on the class we send message to the class, in this case we have the "constructor" method whose purpose is to return us a new instance of the class. We define a class with the "class" keyword, and we name them with constants that begin with a capital letter. Lets create a Triangle class , initialize an object and give it a properties like side and lenght:
class Triangle
def initialize(side, length)
@side = side
@length = length
end
end
First what is the "initialize" method doing? The "initialize" method defines the creation of the object, or "initialize" is called whenever a new object is created with the class. We take its parametars and we turn them into instance variables "@side" and "@length" that we set them equal to the Object's side and the length. Instance variables store the side and the length of the Triangle. Instance variables are like any other other variable except they are visible to the Object they belong to, and can be passed between any other methods that are defined in that class.
Let's create two more methods where we will get the length of the Triangle and set a length ot the same and call those methods like this:
class Triangle
def initialize(side, length)
@side = side
@length = length
end
def length=(new_length)
@length = new_length
end
def length
@length
end
end
triangle = Triangle.new(3, 5)
triangle.length
>> 5
triangle.length =(10)
>> 10
triangle.length
>> 10
Now why do we use getter and setter methods? When we need to set , add or change an Object's state at some point we use setter method, or lets put it this way, "getters" and "setters" are methods that are responsible for setting an instance variable (setter), and retrieving the value of an instance variable (getter). Another interesting thing is that Ruby has built in methods to make the code cleaner and simpler that are equivalent to these getter and setter methods, we call them them the "attr_*" method family. Lets refactor the code above :
class Triangle
attr_reader :side , :length
attr_writer :length
def initialize(side, length)
@side = side
@length = length
end
end
Beautiful right! The "attr_reader" is an attribute of an object that allows its value to be viewed and called outside of the class, it is immutable and equivalent to the "getter" method. The "attr_writer" is an attribute of an object that allows its value to be changed, added etc., from outside of the class and equivalent to the "setter" method. These attributes are wrapped around our instance variables , and the instance variable that has the ability to get and set values can be also listed with the "attr_accessor" instead. This "attr_accessor" has the ability of both combined "attr_reader" and "attr_writer", it creates the reader and writer methods, and it gives us even better , simpler one-line code. So it would look something like this:
class Triangle
attr_reader :side
attr_accessor :length
def initialize(side, length)
@side = side
@length = length
end
end
I think in short notes i pointed out to some of the important topics of creating, initializing and organizing Objects with Classes. Hope you found it useful!


Public Member Functions | |
| LevelManager () | |
| LevelManager (int level) | |
| void | setLevel (int level) |
| int | getLevel () |
| bool | isEnableLevel (int level) |
Static Public Member Functions | |
| static std::string | getLevelName (int level) |
Instance of LevelManager
is immutable and threadsafe
Requirements:
Copyright © 1997, Company, Inc. All rights reserved.
| com::afrigis::util::logsystem::LevelManager::LevelManager | ( | ) |
Default constructor of level manager, initialize the level up to DEBUG
| com::afrigis::util::logsystem::LevelManager::LevelManager | ( | int | level | ) |
Constructor of level manager, initialize the level up to given value
| level |
| void com::afrigis::util::logsystem::LevelManager::setLevel | ( | int | level | ) |
set level for the current logger
| level |
| int com::afrigis::util::logsystem::LevelManager::getLevel | ( | ) |
return current log level
| bool com::afrigis::util::logsystem::LevelManager::isEnableLevel | ( | int | level | ) |
Is the given level is enabled by the current level
| level | given level |
| std::string com::afrigis::util::logsystem::LevelManager::getLevelName | ( | int | level | ) | [static] |
convert a level to sting name.
| level | given level to convert |


WinLock uses these open source softwares.
/* * CredentialUI.cs - Windows Credential UI Helper * * License: Public Domain * */Part of file.
Microsoft Public License (Ms-PL) This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software. 1. Definitions The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law. A "contribution" is the original software, or any additions or changes to the software. A "contributor" is any person that distributes its contribution under this license. "Licensed patents" are a contributor's patent claims that read directly on its contribution. 2. Grant of Rights (A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create. (B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software. 3. Conditions and Limitations (A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks. (B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically. (C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software. (D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license. (E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.from Github
The MIT License (MIT) Copyright (c) 2006 Damien Miller<EMAIL_ADDRESS>(jBCrypt) Copyright (c) 2013 Ryan D. Emerle (.Net port) Copyright (c) 2016/2020 Chris McKee (.Net-core port / patches) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.from Github


Step 1: Set up your email template
- Add a folder to your Outlook inbox called "Mail Merge Templates."
- In the folder, write an email to use as a template.
- Use tags in your template to represent text that will change based on who the recipient is.
- Save the email as a draft.
Step 2: Fill out your mailing list in Excel
- After selecting a template, we generate a table in your Excel spreadsheet for you to fill in your recipients' information.
- Enter recipients' email addresses in the EmailAddress column.
- Add recipients' information to all cells that have an email address and a column header.
Step 3: Preview and send your email
- After using the add-in to merge your email template with your recipients' information, you will have a personalized email to send out to each of your recipients.


Whether you have a message for someone special or want to reach the whole city we will make sure they see it. With streaming letters, logo boards, bill boards and letter boards, our team diverse of pilots and suport staff are ready to help you develop and targe you message to you audience or make that special person in you life feel that they mean the world to you.
Our fleat of planes will fly your banner accross nation's skies on a regular schedule making sure your logo gets the attention it deserves.
Add aerial advertising to your campaign. We can target a particular neighborhood or area at the right times to get to your target audiance.
Bring attention to your cause and make sure your message gets through.
Have a proposal? or just want to let your partner know they are special? Well it can be afordably and unforgetable.
Ready to start ready to touch thier hearts? That's great! Give us a call or send us an email and we'll make it happen!
+1(510)356-3944


---
layout: post
title: 10/27
date: '2012-10-27T22:57:00.002-06:00'
author: Jacob .
tags:
modified_time: '2012-10-27T22:57:22.430-06:00'
blogger_id: tag:blogger.com,1999:blog-6400085873105072120.post-9180541819774384511
blogger_orig_url: http://www.svlark.com/2012/10/1027.html
---
Audrey and I did the first lesson from Teach Your Child to Read. She was pretty bored by the whole thing. Or so I thought. I drew her some learning-to-write paper for the writing part of the lesson. You know the kind where the solid lines are spaced an inch and a half apart and have a dashed line between them? Well anyway, 10 minutes after we wrapped the lesson up, she was sitting at the table drawing herself some writing paper with solid and dashed lines. Funny kid.
Lew Rockwell reminded me of something that needs to go on our todo list to be taken care of ASAP: We need to get our passports squared away. It's not going to be getting any easier to get passports any time soon.
We finished The Capable Cruiser. Next up: It's Your Boat Too.
-11.5


--- layout: post title: "My Week in Review" date: 2019-09-29 17:00:00 +0000 image: https://s3.amazonaws.com/audreywatters/2019-09-29-vw.jpg imagecredits: https://www.flickr.com/photos/ourcommon/2456437358 ---
I’ve got an October 15 deadline to finalize this particular revision of the manuscript, and I think I’m on track. This week was spent revising the final chapter – the final chapter before the conclusion, that is – which covers Skinner’s (and teaching machines’) fall from grace.
HEWN, No. 323 via substack.com
I talked to Christopher Hoadley about some research he’s undertaking for the Spencer Foundation.
I started watching Unbelievable. I’m still reading Clockwork Orange. Kin and I saw Vampire Weekend on Friday night.
Icon credits: The Noun Project


Heading no 01
HOME
ABOUT US
Bag
Mobile
Shoge
Clogth
SERVICE
Bag
Mobile
Shoge
Clogth
CLINT
AGENT
MAIL
***notice***
welcome to bangladesh welcome to bangladesh welcome to bangladesh
***notice***
LOGO
DASHBOARD
WITHDRAW REQUEST
CHECK YOUR ACCOUNT
I AM SHAHADAT HOSSAIN
FROM NOWAKHALI , BANGLADESH


--- title: Fun with nuclear game theory layout: post ---
The Soviets had taken game theory one step further than Kubrick, Szilard, and everyone else: They built a system to deter themselves.
Fascinating... this is really outstanding insight on the Russian leaders' parts if its true.


George Kent's Gigantic Impeachment Nalgene Has Me Quid Pro Quenched
by R. Eric ThomasU.S. Deputy Assistant Secretary George Kent spent the first day of the impeachment inquiry straight guzzling from a Nalgene tall boy of water on national television and I have never been more inspired in my whole dang life. The bow-tied bureaucrat took 48 ounces of pure H2O to the head over the course of the hours-long testimony leaving me, yes, I'll say it again, quid pro quenched. Am I thirsty for impeachment? Yes indeedy. Am I thirsty for anything else? Not after pounding a liter and a half of aqua like my boy George over here.
 Who is this water bottle's agent because it showed up in every shot. This water bottle books!
Here's George Kent pledging allegiance to getting eight glasses a day.
Here's a dramatic still from the excellent Sally Field film Not Without My Water.
Not to sound like Japeth, Noah's arc-bound son who had a gift for stating the obvious, but this is just so much water.
Politics aside, if I saw a witness stride into a hearing with a full wide-mouth 48-ounce Nalgene Silo, sit down, unscrew the lid, leave it unscrewed (!!!), and proceed to take generous sip of it throughout his testimony whilst staring me directly in the face, I wouldn't even need to hear testimony. I'd be like, "Case closed. Lock them up.  He's got the enormous bladder of a true patriot."
Lizzo: Baby, how you feelin'?
George Kent's Bladder: Feeling full as hell!
This big honkin' water bottle is so impressive that the lawyer for the Republicans, who I believe is Nicholas Cage playing Castor Troy from Face/Off, took one look at it and threw in the towel. He was like, "Our defense doesn't hold water, but this does! This witness is slaked! Time to slowly deflate in my chair like an unruly preteen at a required family dinner."
Today's hearing wasn't even the first time George Kent wanted to get the gentle sloshing noises of 48 ounces of liquid on the Congressional record. On October 15, sporting a different bowtie, he toted the Nalgene to a closed session of the House Intelligence Committee. Consistency!
In all seriousness, it is deeply inspiring to witness George Kent becoming the first person to finish one of those gigantic water bottles that everyone at your office is always half-drinking and then dumps into the sink at 5 o'clock, only to come back the next day with another bottle full of dreams. This man rolled up to Congress with all the hydrated energy of an REI employee on a rock-climbing excursion, Tevas straight up flapping with the earned confidence of a man who will not be bested by any line of questioning, any weird WhatsApp from Rudolph Giuliani, or any amount of liquid.
QUENCHED.


loading...
VIDEO
JAN17 – January 2017 Newsletter
NOV16 November 2016 Newsletter
OCT16 October 2016 Newsletter
SEP16 September 2016 Newsletter
AUG16 August 2016 Newsletter
show more


Preparation time
less than 30 mins
Cooking time
10 to 30 mins
Serves
Serves 1
Wrap the goats' cheese halves with the pancetta.
Heat a frying pan on a medium to high heat. Place the goats' cheese in the frying pan and fry for two minutes on each side, until golden.
For the pear chutney, place all of the chutney ingredients into a saucepan over a medium heat and simmer together for ten minutes.
For the pear salad, melt the butter in a small pan. Add the pears and fry over a medium to high heat for five minutes, turning occasionally, until browned all over.
For the dressing, whisk together all of the dressing ingredients in a clean bowl and season, to taste, with salt and freshly ground black pepper.
To serve, place the watercress onto a plate and pour over the dressing. Top with the pan-fried pears and goats' cheese and serve the chutney in a bowl alongside.


Template integer-sequence
Since C++14 a generator for compile-time integer sequences is available in the standard library. How does this work? How to create your own implementation if this is not available in your distribution? How to modify the sequence? Here, we want to look at these questions and want to show and analyze some different implementations found in the web.
A compile-time integer sequence is a variadic class template with integer non-type template parameters, e.g.
template <int... Is>
struct Seq { using type = Seq; };
Sometimes it is necessary to have a specific sequence of increasing values, that
can be used in parameter pack expansions. As an example we want to store all values
of an std::array
in a C-Array, using the template function std::get<I>(array)
.
Here, an integer sequence is used as a function parameter that can be deduces
and unpacked automatically, to have all the indices at hand and to be used in
a pack expansion:
template <class T, int N, int... Is>
void foo(std::array<T, N> const& source, Seq<Is...>) {
T target[] = {std::get<Is>(source)...};
// ...
}
// function call:
foo(array, Seq<0,1,2,3,4,5,6,(...)>());
The question is, how to generate the template Seq<0,1,2,3,(...),N-1>
automatically,
for any given upper index N-1
.
Linear complexity
Version A/B
The simplest (direct) approach has linear complexity in the template recursion
depth and recursively pushes back an integer number to the sequence. If we have
the template class Seq
as above, then a push-back class that adds an integer to
the end of a sequence could look like:
// primary template
template <int I, class S>
struct PushBack;
// specialization for Seq<I0,I1,(...)>
template <int I, int... Is>
struct PushBack<I, Seq<Is...>> {
using type = Seq<Is..., I>;
};
or simply
template <int I, int... Is>
struct PushBack<I, Seq<Is...>> : Seq<Is..., I> {};
for the specialization, since Seq
itself provides a type
type-attribute.
An integer sequence can now be generated, by adding the upper index recursively
to an already generated smaller sequence. Therefore, we have to write a break
condition for the smallest sequence, e.g. a sequence with length 0. We
write a template class MakeSeq<N>
with a type
attribute, that represents the
Seq<0,1,...,N-1>
sequence with N integers:
template <int N>
struct MakeSeq
{
using type = typename PushBack<N-1, typename MakeSeq<N-2>::type>::type;
};
template <> struct MakeSeq<1> { using type = Seq<0>; };
template <> struct MakeSeq<0> { using type = Seq<>; };
or a bit shorter:
template <int N>
struct MakeSeq : PushBack<N-1, typename MakeSeq<N-2>::type>::type {};
template <> struct MakeSeq<1> : Seq<0> {};
template <> struct MakeSeq<0> : Seq<> {};
That’s it. A small test could be to compare the length of the sequence to N:
template <int... Is>
constexpr unsigned size(Seq<Is...>) {
return sizeof...(Is);
}
int main() {
static_assert( size(typename MakeSeq<LENGTH>::type()) == LENGTH, "" );
}
Version C
On Stackoverflow
another variant of the sequential implementation to create an integer sequence
is published. There, the break condition is realized using a std::conditional
statement and the PushBack
helper class is included in the MakeSeq
class directly.
This may reduce the number of templates to be instantiated by the compiler and may be
preferable in this context:
// helper meta-class that represents the template type.
template <class T> struct id { using type = T; };
template <int N, int... Is>
struct MakeSeq
{
using type = typename std::conditional< N == 0, // if
id< Seq<Is...> >, // then
MakeSeq< N-1, N-1, Is... // else
>::type::type;
};
Version D
Motivated by the implementation in the standard library a variant of the integer
sequence generation is provided that works directly on the variadic integer
sequences, i.e. the Seq
template, and adds a type attribute next
that
represents a sequence with one more integer appended:
template <int... Is>
struct Seq
{
using next = Seq<Is..., sizeof...(Is)>;
};
The generator template MakeSeq
now simply adds an alias that calls the next
type:
template <int N>
struct MakeSeq
{
using type = typename MakeSeq<N-1>::type::next;
};
template <> struct MakeSeq<0> { using type = Seq<>; };
Time measurement
A measurement of the time to instantiate (generate) the integer-sequence shows, that
there is a difference between compilers and also between the way of implementing
the classes, i.e. using an own type attribute (Version A), deriving from the
Seq
class (Version B), or using the Stackoverflow one-class implementation (Version C).
For LENGTH=900 we get the average timings in seconds
| Version | A | B | C | D |
|---|---|---|---|---|
| clang-3.6 | 0.690 | 0.692 | 0.572 | 0.311 |
| clang-3.7 | 0.636 | 0.624 | 0.516 | 0.280 |
| g++-4.8.5 | 0.865 | 1.273 | 0.877 | 0.727 |
| g++-5.3.0 | 1.727 | 2.530 | 1.719 | 1.428 |
for the call COMPILER -std=c++11 -DLENGTH=900 -ftemplate-depth=1000 SOURCE.cc
. The
clang compilers have problems with larger LENGTH
parameters and stop with a
Segmentation fault. This is not the case for g++. There the template instantiation
depth could be increased a lot further.
Logarithmic complexity
How to improve the implementation further? In a linear implementation where indices are appended to the sequence one by one, the compiler can not reuse already instantiated parts of the template and must go down the full depth.
A recursive implementation with logarithmic instantiation depth can be formulated by splitting the sequence into two parts [0,N/2] and [N/2+1,N], creating sequences for both parts recursively, and finally concatenating the partial sequences.
Version E
The first implementation creates a linear sequence [start, start+1, start+2, …, end] by splitting in the middle of the interval [start, end]. Therefore, we introduce a template with two parameters and a corresponding alias template as shortcut:
template <int Start, int End>
struct MakeSeqImpl;
template <int Start, int End>
using MakeSeqImpl_t = typename MakeSeqImpl<Start, End>::type;
and the MakeSeq
class can be recapitulated from MakeSeqImpl
by template specialization:
template <int N>
using MakeSeq_t = typename MakeSeqImpl<0, N-1>::type;
here implemented as alias template.
Similar to the PushBack
template of above, a Concat
template is used that
pushes all the indices from the second sequence at the end of the indices of the
first sequence:
template <class S1, class S2> struct Concat;
template <class S1, class S2> using Concat_t = typename Concat<S1,S2>::type;
template <int... I1s, int... I2s>
struct Concat<Seq<I1s...>, Seq<I2s...>> {
using type = Seq<I1s..., I2s...>;
};
The implementation of MakeSeqImpl
now calls Concat
of two subsequences:
template <int Start, int End>
struct MakeSeqImpl<Start, End> {
using type = Concat_t<MakeSeqImpl_t<Start, (Start+End)/2>,
MakeSeqImpl_t<(Start+End)/2+1, End> >;
};
// break condition:
template <int I>
struct MakeSeqImpl<I,I> {
using type = Seq<I>;
};
Version F
A slightly more involved implementation introduces a shift in the concatenation and creates recursively two sequences that do overlap, where the second one is shifted by the length of the first one. This variant is show on Stackoverflow/Answer-1 by user Xeo.
The Concat
template is modified slightly:
template <int... I1, int... I2>
struct Concat<Seq<I1...>, Seq<I2...>> {
using type = Seq<I1..., (sizeof...(I1) + I2)...>;
};
and the MakeSeq
class can now be implemented directly, without the help of the
class MakeSeqImpl
, by
template <int N> struct MakeSeq;
template <int N> using MakeSeq_t = typename MakeSeq<N>::type;
template <int N>
struct MakeSeq
{
using type = Concat_t<MakeSeq_t<N/2>, MakeSeq_t<N - N/2>>;
};
// break conditions
template <> struct MakeSeq<1> { using type = Seq<0>; };
template <> struct MakeSeq<0> { using type = Seq<>; };
where the parameter N
is now, as before, the length of the sequence. We need both
break conditions, since each of those can not be implemented without the other one.
The advantage of this variant is that both ranges may be the same and thus, the compiler may reuse the instantiation of one.
Version G
On Stackoverflow/Answer-2
the user Khurshid posted an answer that uses this idea even more strictly,
by creating twice the same sequence and concatenating those, using Concat
as
above. Only in the case that N
is not divisible by two, a final index is added
to the sequence.
template <int N>
struct MakeSeq {
using type = typename IncSeq_if< (N % 2 != 0),
typename Concat<N/2, typename MakeSeq<N/2>::type>::type >::type;
};
// break condition
template <> struct MakeSeq<0> { using type = Seq<>; };
where IncSeq_if
implements the push-back of the final index, in the case that the
first template argument is true
:
template <bool /* = false */, class S>
struct IncSeq_if { using type = S; }; // do not increase
template <int... Is>
struct IncSeq_if<true, Seq<Is...>> // Seq<0,1,...,Size-1>
{
using type = Seq<Is..., sizeof...(Is)>;
};
and Concat
is slightly modified to reuse the same sequence twice:
template <int Size, class S>
struct Concat;
template <int Size, int... Is>
struct Concat<Size, Seq<Is... >>
{
using type = Seq<Is..., (Size + Is)... >;
};
Time measurement
In a same way as above we measure the time to compile the various variants of the logarithmic integer sequence implementation, using the compilers clang and g++:
| Version | E | F | G |
|---|---|---|---|
| clang-3.6 | 0.115 | 0.062 | 0.060 |
| clang-3.7 | 0.104 | 0.057 | 0.055 |
| g++-4.8.5 | 0.131 | 0.059 | 0.034 |
| g++-5.3.0 | 0.169 | 0.049 | 0.047 |
We see that the compilation times are about a factor > 5 lower than for the linear implementation and that the most specialized variant F outperforms all the other implementations. Thus, it makes sense to optimize the way of instantiating templates when large instantiation depth are necessary and if we want to reduce compilation times.
Download source files
You can download all the source-files, by following the links in the table below:
| Version | Link |
|---|---|
| A | source |
| B | source |
| C | source |
| D | source |
| E | source |
| F | source |
| G | source |


Actress Han Ye Seul unveils her new tattoo
by olmalActress Han Ye Seul got inked again and it's sexier than ever! On November 16, Han Ye Seul posted a photo of her new tattoo with a caption "Weapon of choice" on her Instagram.
Netizens have been commenting, saying:
"I love how she is living her life to the fullest, doing whatever she wants to do."
"She's gorgeous though it's unconventional for an actress."
"40 is the new 20."
How are you liking her latest addition?


Modelling Functions
OpenFAIR modelling components
|
|
compare_tef_vuln()
|
Calculate number of loss events which occur in a simulated period |
|
get_mean_control_strength()
|
Calculate difficulty strength across multiple controls by taking the mean |
|
openfair_tef_tc_diff_lm()
|
Run an OpenFAIR simulation at the TEF/TC/DIFF/LM levels |
|
run_simulations()
|
Run simulations for all scenarios |
|
sample_diff()
|
Calculate the difficulty presented by controls, given a function and
parameters for that function |
|
sample_lef()
|
Sample loss event frequency |
|
sample_lm()
|
Given a number of loss events and a loss distribution, calculate losses |
|
sample_tc()
|
Sample threat capabilities (TC) from a distribution function |
|
sample_tef()
|
Calculate the number of simulated threat event frequencies (TEF) |
|
sample_vuln()
|
Calculate the vulnerability |
|
select_loss_opportunities()
|
Determine which threat events result in loss opportunities |


I am a recent Electrical Engineer graduate from the University of Washington. My studies focused on Embedded Software interfacing low level hardware and software. I am currently looking for a job in the field of Embedded Systems or Software Engineering. My long term goal is to be a successful developer regardless of what field I go into. I will do this by learning and adapting to new technologies


Donate to help
Give us some feed back or some suggestions
Help the people who are faceing racism
Have any question send it to us at
The purpose of the website is to help us become aware of how racism impacts ALL of our lives, and how we all unconsciously and consciously participate in racist systems. We want to help out the people who get discrimination by others, so they can live a normal life in America just like others. Our research is utilized by the media, nonprofits and the public in general. We have used these findings to identify discriminatory public policies and practices and deficient civil rights laws. We are going to have succeeded in getting appropriate changes. Stop Racism In School has also placed greater emphasis on collaboration with allied organizations to effectuate change, working with various coalitions, the Progressive Network, and the More than 100 adults have joined Stop racism in school's Partnership for Racial Equity. Also, 75 individuals have participated in our Unraveling Racism Training, a week intensive workshop that explores institutional racism, and almost 5000 high school students have participated in our leadership training and youth roundtables. Therefore we can have more people that can fight racism among us. Just think that you are not alone when you are fighting to end racism. There are going to be a lot of people are doing the same thing you are doing. If we keep doing it then more people will feel what are we trying to do also as teenagers grow older they will become much maturer. Last we want to help kids to have a fair education.
Dontate to this program it help students have a equailty education in school.
DontateAlso if you want to get involve click the button and learn more about the
Click Me!


{% extends "layout.html" %}
{% block content %}
The following files have been created:
1.) Alteon configuration file: {{ user_output_file }}_config
2.) Script logs file: {{ user_output_file }}_logs
Please review these files before importing the configuration to the Alteon.


Synchronization
Functions to synchronize eyetracker data with other experimental data
|
|
eye_synchro_acceptable()
|
This function decides whether the list is acceptable |
|
eye_to_unity_times()
|
replaces eyetracker_times for quest_times |
|
find_better_match()
|
Returns either a list with best synchronised event or NULL if none is found |
|
find_group_match()
|
tries to find a sequency of N elements in eye_durations that correspond to the synchro durations
returns index of first matchin eye event |
|
find_preprocessed_files()
|
returns filepaths of preprocessed fixations and events |
|
try_fit_event()
|
Returns a data frome with synchronising times for each set
Table is in format of set_id, time_eyetracker, time_unity |


Mainland China students flee Hong Kong over protest violence fears
HONG KONG: Mainland Chinese students have begun fleeing Hong Kong campuses over security fears, police and university officials said Wednesday (Nov 13), as the city's seething political crisis saw some of its worst violence this week.
The most intense clashes on Tuesday occurred at the Chinese University of Hong Kong (CUHK), where pitched battles were fought with the police firing tear gas, water cannon and rubber bullets and protesters throwing petrol bombs and bricks, paralysing the campus and the area around it.
READ: Protesters block central Hong Kong streets as chaos grips city
A group of mainland students at CUHK attempted to depart the campus Wednesday morning over safety concerns but had to be shuttled away by boat because they were unable to leave via obstructed roads, the police said.
READ: In photos: Hong Kong university campuses burn as student protesters battle police
READ: How violence and brazen actions in Hong Kong were normalised, a commentary
"The police decided to deploy a police launch to assist the group of students to go to a safe location," the force said.
Images on local outlet Stand News showed dozens of people - some carrying luggage - standing next to a vessel with police markings, purportedly fleeing the campus.
The Hong Kong University of Science and Technology meanwhile arranged a special bus service to shuttle students from its campus to a station that offers services to the mainland.
"While we are not aware of any imminent threat to campus safety, we understand some staff and students have the desire to leave campus," the university said in an email to students.
It was not immediately clear how many mainland Chinese students have left Hong Kong during the latest escalation of violence.
The protest movement is the biggest challenge to Beijing's rule since Hong Kong was returned by Britain in 1997, fuelled by fears that China is choking the liberties and freedoms the city is meant to have under the handover deal.
More radical demonstrators have targeted businesses and people perceived to be pro-China. In a particularly shocking incident, a man was doused in a flammable liquid and set on fire during an argument with protesters.
The city government has announced that classes at all Hong Kong schools will be suspended on Thursday.
MORE: Our coverage of the Hong Kong protests
Follow us on Telegram for the latest on Hong Kong: https://cna.asia/telegram


--- layout: page title: "link" description: "" header-img: "img/Link-bg-Tree.jpg" ---
Investment: BuffetsBooks.com
Computer Science: Crash Course Computer Science
Website design and develop: EJ Media
Python developer: Python Training by Dan Bader
Python skills: Sentdex
Sublime Text 3 tutorial: LearnWebCode
Git tutorial: Thenewboston
AstroPython.cn Playlist : 热血沸腾
AstroPython.cn Playlist : 柔和缓慢


public class FrcJoystick
extends Joystick
| Constructor and Description |
|---|
FrcJoystick(java.lang.String instanceName,
int port)
Constructor: Create an instance of the object.
|
FrcJoystick(java.lang.String instanceName,
int port,
double deadbandThreshold)
Constructor: Create an instance of the object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
buttonEventTask(trclib.TrcTaskMgr.TaskType taskType,
trclib.TrcRobot.RunMode runMode)
This method runs periodically and checks for changes in the button states.
|
FrcButtonHandler |
getButtonHandler()
This method returns the current button event handler.
|
double |
getDirectionDegreesWithDeadband(boolean squared)
This method returns the value of the analog stick direction in degrees.
|
double |
getDirectionDegreesWithDeadband(boolean squared,
double deadbandThreshold)
This method returns the value of the analog stick direction in degrees.
|
double |
getDirectionRadiansWithDeadband(boolean squared)
This method returns the value of the analog stick direction in radians.
|
double |
getDirectionRadiansWithDeadband(boolean squared,
double deadbandThreshold)
This method returns the value of the analog stick direction in radians.
|
double |
getMagnitudeWithDeadband(boolean squared)
This method returns the value of the analog stick magnitude.
|
double |
getMagnitudeWithDeadband(boolean squared,
double deadbandThreshold)
This method returns the value of the analog magnitude.
|
double |
getThrottleWithDeadband(boolean squared)
This method returns the value of the analog Throttle.
|
double |
getThrottleWithDeadband(boolean squared,
double deadbandThreshold)
This method returns the value of the analog Throttle.
|
double |
getTwistWithDeadband(boolean squared)
This method returns the value of the Twist analog stick.
|
double |
getTwistWithDeadband(boolean squared,
double deadbandThreshold)
This method returns the value of the Twist analog stick.
|
double |
getXWithDeadband(boolean squared)
This method returns the value of the X analog stick.
|
double |
getXWithDeadband(boolean squared,
double deadbandThreshold)
This method returns the value of the X analog stick.
|
double |
getYWithDeadband(boolean squared)
This method returns the value of the Y analog stick.
|
double |
getYWithDeadband(boolean squared,
double deadbandThreshold)
This method returns the value of the Y analog stick.
|
double |
getZWithDeadband(boolean squared)
This method returns the value of the Z analog stick.
|
double |
getZWithDeadband(boolean squared,
double deadbandThreshold)
This method returns the value of the Z analog stick.
|
void |
setButtonEventTracer(trclib.TrcDbgTrace buttonEventTracer)
This method enables/disables button event tracing by setting the event tracer.
|
void |
setButtonHandler(FrcButtonHandler buttonHandler)
This method sets the object that will handle button events.
|
void |
setSamplingPeriod(double period)
This method sets the joystick button sampling period.
|
void |
setYInverted(boolean inverted)
This method inverts the y-axis of the analog sticks.
|
java.lang.String |
toString()
This method returns the instance name.
|
public static final int LOGITECH_TRIGGER
public static final int LOGITECH_BUTTON2
public static final int LOGITECH_BUTTON3
public static final int LOGITECH_BUTTON4
public static final int LOGITECH_BUTTON5
public static final int LOGITECH_BUTTON6
public static final int LOGITECH_BUTTON7
public static final int LOGITECH_BUTTON8
public static final int LOGITECH_BUTTON9
public static final int LOGITECH_BUTTON10
public static final int LOGITECH_BUTTON11
public static final int LOGITECH_BUTTON12
public static final int DUALACTION_BUTTONX
public static final int DUALACTION_BUTTONA
public static final int DUALACTION_BUTTONB
public static final int DUALACTION_BUTTONY
public static final int DUALACTION_LB
public static final int DUALACTION_RB
public static final int DUALACTION_LT
public static final int DUALACTION_RT
public static final int DUALACTION_BACK
public static final int DUALACTION_START
public static final int DUALACTION_LTOP
public static final int DUALACTION_RTOP
public static final int SIDEWINDER_TRIGGER
public static final int SIDEWINDER_BUTTON2
public static final int SIDEWINDER_BUTTON3
public static final int SIDEWINDER_BUTTON4
public static final int SIDEWINDER_BUTTON5
public static final int SIDEWINDER_BUTTON6
public static final int SIDEWINDER_BUTTON7
public static final int SIDEWINDER_BUTTON8
public static final int SIDEWINDER_BUTTON9
public static final int PANEL_BUTTON_RED1
public static final int PANEL_BUTTON_GREEN1
public static final int PANEL_BUTTON_BLUE1
public static final int PANEL_BUTTON_YELLOW1
public static final int PANEL_BUTTON_WHITE1
public static final int PANEL_BUTTON_RED2
public static final int PANEL_BUTTON_GREEN2
public static final int PANEL_BUTTON_BLUE2
public static final int PANEL_BUTTON_YELLOW2
public static final int PANEL_BUTTON_WHITE2
public static final int PANEL_SWITCH_WHITE1
public static final int PANEL_SWITCH_RED1
public static final int PANEL_SWITCH_GREEN1
public static final int PANEL_SWITCH_BLUE1
public static final int PANEL_SWITCH_YELLOW1
public static final int PANEL_SWITCH_WHITE2
public static final int PANEL_SWITCH_RED2
public static final int PANEL_SWITCH_GREEN2
public static final int PANEL_SWITCH_BLUE2
public static final int PANEL_SWITCH_YELLOW2
public FrcJoystick(java.lang.String instanceName, int port)
instanceName
- specifies the instance name.port
- specifies the joystick port ID.public FrcJoystick(java.lang.String instanceName, int port, double deadbandThreshold)
instanceName
- specifies the instance name.port
- specifies the joystick port ID.deadbandThreshold
- specifies the deadband of the analog sticks.public java.lang.String toString()
public void setButtonEventTracer(trclib.TrcDbgTrace buttonEventTracer)
buttonEventTracer
- specifies the tracer to use when enabling button events tracing, null to disable
event tracing.public void setButtonHandler(FrcButtonHandler buttonHandler)
buttonHandler
- specifies the object that will handle the button events. Set to null clear previously
set handler.public FrcButtonHandler getButtonHandler()
public void setSamplingPeriod(double period)
period
- specifies the new sampling period in seconds.public void setYInverted(boolean inverted)
inverted
- specifies true if inverting the y-axis, false otherwise.public double getXWithDeadband(boolean squared, double deadbandThreshold)
squared
- specifies true to apply a squared curve to the output value, false otherwise.deadbandThreshold
- specifies the deadband value to apply on this stick.public double getXWithDeadband(boolean squared)
squared
- specifies true to apply a squared curve to the output value, false otherwise.public double getYWithDeadband(boolean squared, double deadbandThreshold)
squared
- specifies true to apply a squared curve to the output value, false otherwise.deadbandThreshold
- specifies the deadband value to apply on this stick.public double getYWithDeadband(boolean squared)
squared
- specifies true to apply a squared curve to the output value, false otherwise.public double getZWithDeadband(boolean squared, double deadbandThreshold)
squared
- specifies true to apply a squared curve to the output value, false otherwise.deadbandThreshold
- specifies the deadband value to apply on this stick.public double getZWithDeadband(boolean squared)
squared
- specifies true to apply a squared curve to the output value, false otherwise.public double getTwistWithDeadband(boolean squared, double deadbandThreshold)
squared
- specifies true to apply a squared curve to the output value, false otherwise.deadbandThreshold
- specifies the deadband value to apply on this stick.public double getTwistWithDeadband(boolean squared)
squared
- specifies true to apply a squared curve to the output value, false otherwise.public double getThrottleWithDeadband(boolean squared, double deadbandThreshold)
squared
- specifies true to apply a squared curve to the output value, false otherwise.deadbandThreshold
- specifies the deadband value to apply on this stick.public double getThrottleWithDeadband(boolean squared)
squared
- specifies true to apply a squared curve to the output value, false otherwise.public double getMagnitudeWithDeadband(boolean squared, double deadbandThreshold)
squared
- specifies true to apply a squared curve to the output value, false otherwise.deadbandThreshold
- specifies the deadband value to apply on this stick.public double getMagnitudeWithDeadband(boolean squared)
squared
- specifies true to apply a squared curve to the output value, false otherwise.public double getDirectionRadiansWithDeadband(boolean squared, double deadbandThreshold)
squared
- specifies true to apply a squared curve to the output value, false otherwise.deadbandThreshold
- specifies the deadband value to apply on this stick.public double getDirectionRadiansWithDeadband(boolean squared)
squared
- specifies true to apply a squared curve to the output value, false otherwise.public double getDirectionDegreesWithDeadband(boolean squared, double deadbandThreshold)
squared
- specifies true to apply a squared curve to the output value, false otherwise.deadbandThreshold
- specifies the deadband value to apply on this stick.public double getDirectionDegreesWithDeadband(boolean squared)
squared
- specifies true to apply a squared curve to the output value, false otherwise.public void buttonEventTask(trclib.TrcTaskMgr.TaskType taskType, trclib.TrcRobot.RunMode runMode)
taskType
- specifies the type of task being run.runMode
- specifies the current robot run mode.