Chapter 2 Basic Programming in R
This .rmd goes along with the building blocks screencast. Basic coding in R involves creating variables to store information, and then systematically manipulating the contents of variables to solve particular problems. Some of the basic coding building blocks are variables, logic, and loops. These three elements are combined together to produce an algorithm (set of steps) to solve a problem.
2.1 Variables
Below is code block contains 1 line that does a bunch of things.
- It creates a variable with the name
variable_name
- It stores the number 1 inside the variable using the assignment operator
<-
, which looks like an arrow (think: a 1 goes into the variable) - The hashtag allows us to comment the line to say what is happening. Anything after the comment turns green, and R does not attempt to run this part as code. Comments can be useful for helping other people read the code
- When you run this line, you will see a new variable listed in the Environment pane in R-studio
variable_name <- 1 #comment, this line stores a 1 in variable_name
Variables can have most any name, but they can’t start with a number, special character or contain a space.
# neither of these lines work, they will throw an error
1s <- 3
my variable <- 1
!s <- 1
It is good practice to use descriptive variable names that tell you and anyone else reading the code what the variable is storing. Let’s say you want to create three variables for storing your first name, last name, and favorite color. Here are good and bad examples:
# good examples
first_name <- "Matt"
last_name <- "Crump"
favorite_color <- "hot pink"
# bad examples
a <- "Matt"
temp_var <- "Crump"
cl <- "hot pink"
2.1.1 Style guide
It is a good idea to learn how to write good-looking code. This makes your code easier to read and easier for you and others to understand. There are different opinions about the style you should adopt. I recommend that you adopt the conventions in the tidyverse style guide, https://style.tidyverse.org. And, I will try to follow that style guide in examples that I make.
2.1.2 Double-checking your variable works
As mentioned previously, if you have made a new variable, you should be able to see it listed in the Environment tab. You can also type the name of the variable into the console and press enter. If the variable exists, the console will print the contents of the variable.
# Writing the variable name will cause R to print out it's contents
first_name
## [1] "Matt"
You can also use the print()
function to accomplish the same goal.
print(first_name)
## [1] "Matt"
2.1.3 Changing the contents of a variable
Any time you assign <-
something new into an existing variable, the contents of the variable will change.
Below we have three lines of code. By running this code block, R will follow the instructions in order. It will run the first line, then the second line, then the third line.
first_name <- "Matt"
first_name <- "A"
first_name <- "B"
What is the final contents of the variable first_name
? It will be the last thing that was put into that variable, in this case a B.
We can check that by printing out first_name
.
first_name
## [1] "B"
2.1.4 Properties of variables
As we go along we will learn about different kinds of variables in R. Each of them allow you to store different kinds of information in different formats. To illustrate the idea of different formats let’s look at these two variables.
a_number <- 1
a_character <- "1"
You can use the class()
function to find out information about variables in R.
class(a_number)
## [1] "numeric"
Notice that a_number
has the class numeric
. This means that R will treat the contents as a number.
class(a_character)
## [1] "character"
However, a_character
has a the class character
. This means that R will treat the contents as text.
If two variables contain numbers, then you can do math using the variables
a <- 1
b <- 2
a+b
## [1] 3
If the variables contain text, then math won’t work
a <- "1"
b <- "2"
a+b
2.1.5 Converting between numeric and character
In some cases R will allow you to convert variable classes. For example, if you have a numeric variable, you can convert it to a character. Below, we put a 1 into a
, then show it is a numeric. Afterward, we use the as.character()
function to convert a
into a character, and then show that a
is now a character, rather than a number
a <- 1
class(a)
## [1] "numeric"
a <- as.character(a)
class(a)
## [1] "character"
2.1.6 converting between character and numeric
as.numeric
can convert text into numbers, but the text needs to be a numeral in order for this to work
a <- "1"
class(a)
## [1] "character"
a <- as.numeric(1)
class(a)
## [1] "numeric"
This won’t work. R doesn’t know that “one” means 1. So, it will return NA, which stands for not available.
a <- "one"
a <- as.numeric(a)
2.2 Vectors
You will often want to store more than one thing inside a variable. One way to do this is using a vector. A vector can contain multiple elements, all of the same class.
Create a vector using the c()
function.
some_numbers <- c(4,5,3,7,8,2,1,4,5,6,4)
If we print some_numbers
, we can see it contains all the numbers we put into it.
some_numbers
## [1] 4 5 3 7 8 2 1 4 5 6 4
2.2.1 indexing
Once you have some numbers inside a vector, you may want to access individual elements. R uses square brackets []
for indexing particular slots in the vector (e.g., the number in a particular position from first to last in the vector)
some_numbers[1] # returns first number
## [1] 4
some_numbers[2] # returns second number
## [1] 5
some_numbers[1:3] # returns the first three numbers
## [1] 4 5 3
R has really powerful indexing abilities. For example, consider the following:
some_numbers[c(2,4)]
## [1] 5 7
We have put a vector c(2,4)
inside the square brackets. This will allow us to return the contents in slot 2, and 4 of the vector.
What about this one?
some_numbers[c(1,1,1)]
## [1] 4 4 4
We have put a vector c(1,1,1)
inside the square brackets. This will allow us to return the contents in slot 1 three times.
We haven’t covered logic statements yet, but it is worth pointing out that you can use logical indexing in R. For example, the following will return elements in the vector that are larger than a particular value.
some_numbers[some_numbers > 4]
## [1] 5 7 8 5 6
2.2.2 assignment and indexing
You can replace the contents of a vector at particular position using indexing.
Here we remind ourselves of the original list of numbers inside some_numbers
. Then we replace the number in position 1 with a 9, and print the variable to check that the replacement worked.
some_numbers <- c(4,5,3,7,8,2,1,4,5,6,4)
some_numbers[1] <- 9
some_numbers
## [1] 9 5 3 7 8 2 1 4 5 6 4
2.2.3 c is for combine
The c()
function stands for combine. We are telling R to combine all of the elements inside the function into a vector.
# combines the numbers 1-5 into a
a <- c(1,2,3,4,5)
# combine a with a 6 on the end
# append to the last part of the vector
a<- c(a, 6)
# multiple combines
b <- c(c(1,2,3),c(9,10,11))
2.3 Loops
Check R help for on Control Flow ?Control
.
for(){}
for(loop control){do something each iteration}
for(iterator in vector){
#do something
}
Loop control is defined in between the parentheses. The name of the iterator is placed on the left of in
(can be assigned any name you want, does not need to be declared in advance). During the execution of the loop, the iterator takes on the values inside the vector which is placed on the right side of in
. Specifically, the following is happening.
Loop steps: 1. iterator <- vector[1] 2. iterator <- vector[2] 3. iterator <- vector[3] 4. etc.
The loop will automatically stop once it reaches the last item in the vector. The loop can be stopped before that using the break
command.
# Make a loop do something 5 times
# i is the iterator
# 1:5 creates a vector with 5 numbers in it, 1, 2, 3, 4, 5
# the loop will run 5 times, because there are five things to assign to i
for(i in 1:5){
print(5)
}
## [1] 5
## [1] 5
## [1] 5
## [1] 5
## [1] 5
# show the value of i each step of the loop
for(i in 1:5){
print(i)
}
## [1] 1
## [1] 2
## [1] 3
## [1] 4
## [1] 5
# define the vector to loop over in advance
my_sequence <- 1:5
for(i in my_sequence){
print(i)
}
## [1] 1
## [1] 2
## [1] 3
## [1] 4
## [1] 5
# Reminder that i becomes the next value in the vector
# your vector can have any order
my_sequence <- c(1,5,2,3,4)
for(i in my_sequence){
print(i)
}
## [1] 1
## [1] 5
## [1] 2
## [1] 3
## [1] 4
# index vector does not need to be numbers
my_things <- c("A","B","C","D")
for(i in my_things){
print(i)
}
## [1] "A"
## [1] "B"
## [1] "C"
## [1] "D"
2.3.1 Breaking a loop
break
stops a loop. Used with logical statements to define the conditions necessary to cause the break.
for(i in 1:10){
if(i <5){
print(i)
} else{
break
}
}
## [1] 1
## [1] 2
## [1] 3
## [1] 4
2.3.2 While loops
While loops run until a logical condition is met. Here there is no iterator, just a logic statement that needs to be met.
This one prints i while i is less than 6. As soon as i becomes “not less than 6”, then the loop stops. Critically, inside the loop, the value of i increases each iteration.
i <- 1 # create an variable
while (i < 6) {
print(i)
i = i+1 #add one eachs step of the loop
}
## [1] 1
## [1] 2
## [1] 3
## [1] 4
## [1] 5
2.3.3 Repeat loops
Similar to while, but let’s do things until a condition is met.
i<-0
repeat{
i<-i+1
print(i)
if(i==5){
break
}
}
## [1] 1
## [1] 2
## [1] 3
## [1] 4
## [1] 5
2.3.4 Examples
Braces are not needed on one line
for(i in 1:5) print(i)
## [1] 1
## [1] 2
## [1] 3
## [1] 4
## [1] 5
Using the value of the iterator to assign in values systematically to another variable.
# put 1 into the first five positions of x
x <- c() # create empty vector
for(i in 1:5){
x[i] <- 1 # assign 1 to the ith slot in x
}
x
## [1] 1 1 1 1 1
# put the numbers 1-5 in the first 5 positions of x
x <-c()
for(i in 1:5){
x[i] <- i
}
x
## [1] 1 2 3 4 5
Make your own counter, when you need one
a <- c(1,4,3,5,7,6,8,2)
odd <- c()
counter <- 0
for(i in a){ # i will the values of a in each position
counter <- counter+1
if(i%%2 != 0){
odd[counter] <- "odd"
} else {
odd[counter] <- "even"
}
}
odd
## [1] "odd" "even" "odd" "odd" "odd" "even" "even" "even"
# An alternative strategy
a <- c(1,4,3,5,7,6,8,2)
odd <- c()
# 1:length(a) creates a sequence from 1 to length
for(i in 1:length(a)){
if(a[i]%%2 != 0){
odd[i] <- "odd"
} else {
odd[i] <- "even"
}
}
odd
## [1] "odd" "even" "odd" "odd" "odd" "even" "even" "even"
Nesting loops
for(i in 1:5){
for(j in 1:5){
print(c(i,j))
}
}
## [1] 1 1
## [1] 1 2
## [1] 1 3
## [1] 1 4
## [1] 1 5
## [1] 2 1
## [1] 2 2
## [1] 2 3
## [1] 2 4
## [1] 2 5
## [1] 3 1
## [1] 3 2
## [1] 3 3
## [1] 3 4
## [1] 3 5
## [1] 4 1
## [1] 4 2
## [1] 4 3
## [1] 4 4
## [1] 4 5
## [1] 5 1
## [1] 5 2
## [1] 5 3
## [1] 5 4
## [1] 5 5
# example of using nested loops to fill the contents
# of a matrix
my_matrix <- matrix(0,ncol=5,nrow=5)
for(i in 1:5){
for(j in 1:5){
my_matrix[i,j] <- i*j
}
}
my_matrix
## [,1] [,2] [,3] [,4] [,5]
## [1,] 1 2 3 4 5
## [2,] 2 4 6 8 10
## [3,] 3 6 9 12 15
## [4,] 4 8 12 16 20
## [5,] 5 10 15 20 25
break exits out of the immediate loop
# the inside loop stops when i+j is greater than 5
# the outside loop keeps going
sum_of_i_j <- c()
counter <- 0
for(i in 1:5){
for(j in 1:5){
counter <- counter+1
sum_of_i_j[counter] <- i+j
if(i+j > 5){
break
}
}
}
sum_of_i_j
## [1] 2 3 4 5 6 3 4 5 6 4 5 6 5 6 6
2.4 Logical comparison
Logic statements are used to compare two things, or two sets of things. The output of comparison is a TRUE or FALSE statment. If many things are being compared at once, the output could be many TRUE or FALSE statements for each comparison
2.4.1 equal to
1==1 # is 1 equal to 1?
## [1] TRUE
1==2 # is 1 equal to 2?
## [1] FALSE
c(1,2,3) == c(2,1,3) # compares each element with each element
## [1] FALSE FALSE TRUE
1 == c(2,1,3)
## [1] FALSE TRUE FALSE
2.4.2 not equal to
1!=1 # is 1 equal to 1?
## [1] FALSE
1!=2 # is 1 equal to 2?
## [1] TRUE
c(1,2,3) != c(2,1,3) # compares each element with each element
## [1] TRUE TRUE FALSE
1 != c(2,1,3)
## [1] TRUE FALSE TRUE
2.4.3 Greater than/ less than
1 > 1 # is 1 greater than 1?
## [1] FALSE
5 > 1 # is 5 greater than 1?
## [1] TRUE
3 < 2 # is 3 less than 2?
## [1] FALSE
3 < 1 # is 3 less than 1?
## [1] FALSE
c(1,2,3) > c(2,1,3) # ask the question element by element
## [1] FALSE TRUE FALSE
c(1,2,3) < c(2,1,3)
## [1] TRUE FALSE FALSE
2 > c(1,2,3) # is greater than each of the numbers
## [1] TRUE FALSE FALSE
2.4.4 >= <=
Is something greater than or equal to something else
1 >= 1 # is 1 greater than 1?
## [1] TRUE
5 >= 1 # is 5 greater than 1?
## [1] TRUE
3 <= 2 # is 3 less than 2?
## [1] FALSE
3 <= 1 # is 3 less than 1?
## [1] FALSE
c(1,2,3) >= c(2,1,3) # ask the question element by element
## [1] FALSE TRUE TRUE
c(1,2,3) <= c(2,1,3)
## [1] TRUE FALSE TRUE
2 >= c(1,2,3) # is greater than each of the numbers
## [1] TRUE TRUE FALSE
2.4.5 AND
The ampersand &
is used for AND, which allows use to evaluate whether two or more properties are all TRUE.
# is 16 divisible by 4 AND 8
16%%4 == 0 & 16%%8 ==0
## [1] TRUE
# is 16 divisible by 4 AND 3
16%%4 == 0 & 16%%3 ==0
## [1] FALSE
# is 16 divisible by 8 and 4 and 2
16%%4 == 0 & 16%%8 ==0 & 16%%2 ==0
## [1] TRUE
2.4.6 OR
The |
is used for OR, which allows use to evaluate at least one of the properties is TRUE.
# is 16 divisible by 4 OR 8
16%%4 == 0 | 16%%8 ==0
## [1] TRUE
# is 16 divisible by 4 OR 3
# it is divisible by 4, so the answer is TRUE
# because at least one of the comparisons is TRUE
16%%4 == 0 | 16%%3 ==0
## [1] TRUE
2.4.7 TRUE FALSE
When R returns values as TRUE or FALSE, it return a logical variable. It also treats TRUE as a 1, and FALSE as a 0. In the example below we see it is possible sum up a logical variable with multiple TRUE and FALSE entries.
c(1,2,3) == c(1,2,3)
## [1] TRUE TRUE TRUE
sum(c(1,2,3) == c(1,2,3))
## [1] 3
c(1,2,3) == c(2,1,3)
## [1] FALSE FALSE TRUE
sum(c(1,2,3) == c(2,1,3))
## [1] 1
2.5 IF ELSE
A carnival operator needs to check if people are taller than a line to see if they can ride the ride. Every time someone goes through the gate, they run an IF ELSE control structure in their head. IF the person is taller than the line, then they can go on the ride; ELSE (otherwise) the person can not go on the ride.
In other words, IF the situation is X, then do something; ELSE (if the situation is not X), then do something different.
IF and ELSE statements let us specify the conditions when specific actions are taken. Generally, IF and ELSE statements are used inside loops (for, or while, or repeat loops), because at each step or iteration of the loop, we want to check something, and then do something.
Consider this:
a <- 1 # define a to be a 1
if(a==1){
print(a) # this is what happens if a==1
} else {
print("A is not 1") # this is what happens if a is not 1
}
## [1] 1
a <- 2 # define a to be a 1
if(a==1){
print(a) # this is what happens if a==1
} else {
print("A is not 1") # this is what happens if a is not 1
}
## [1] "A is not 1"
Normally we find IF and ELSE in a loop like this:
a <- c(1,0,1,0,0,0,1) # make a variable contain 1s and 0s
# write a loop to check each element in the variable
# and do different things depending on the element
for(i in a){
if(i == 1){
print("I'm a 1") # what to do when i is 1
} else {
print("I'm not a 1") # what to do when i is not 1
}
}
## [1] "I'm a 1"
## [1] "I'm not a 1"
## [1] "I'm a 1"
## [1] "I'm not a 1"
## [1] "I'm not a 1"
## [1] "I'm not a 1"
## [1] "I'm a 1"
We can have multiple conditions in our if statements.
a <- c(1,2,3,1,2,0,1) # make a variable contain 1s and 0s
# write a loop to check each element in the variable
# and do different things depending on the element
for(i in a){
if(i == 1){
print("I'm a 1") # what to do when i is 1
} else if (i==2){
print("I'm a 2") # what to do when i is 2
} else if (i==3){
print("I'm a 3") # what to do when i is 3
} else {
print("I'm not any of the above") #what to do when none are true
}
}
## [1] "I'm a 1"
## [1] "I'm a 2"
## [1] "I'm a 3"
## [1] "I'm a 1"
## [1] "I'm a 2"
## [1] "I'm not any of the above"
## [1] "I'm a 1"
2.6 Functions
This section discusses the syntax for writing custom functions in R.
2.6.1 function syntax
function_name <- function(input1,input2){
#code here
return(something)
}
2.6.2 example functions
This function has no input between the ()
. Whenever you run this function, it will simply return whatever is placed inside the return
statement.
# define the function
print_hello_world <- function(){
return(print("hello world"))
}
# use the function
print_hello_world()
## [1] "hello world"
This function simply takes an input, and then returns the input without modifying it.
return_input <- function(input){
return(input)
}
# the variable input is assigned a 1
# then we return(input), which will result in a 1
# because the function internally assigns 1 to the input
return_input(1)
## [1] 1
a <- "something"
return_input(a)
## [1] "something"
This function takes an input, then creates an internal variable called temp and assigns input+1. Then the contents of temp is returned. Note there, is no checking of the input, so it will return an erro if you input a character (can’t add one to a character in R)
add_one <- function(input){
temp <- input+1
return(temp)
}
add_one(1)
## [1] 2
add_one("a")
## Error in input + 1: non-numeric argument to binary operator
This function adds some input checking. We only add one if the input is a numeric type. Otheriwse, we use stop()
to return an error message to the console
add_one <- function(input){
if(class(input) == "numeric"){
temp <- input+1
return(temp)
} else {
return(stop("input must be numeric"))
}
}
add_one(1)
## [1] 2
add_one("a")
## Error in add_one("a"): input must be numeric
A function with three inputs
add_multiply <- function(input, x_plus,x_times){
temp <- (input+x_plus)*x_times
return(temp)
}
# input is 1
# x_plus <- 2
# x_times <- 3
# will return (1+2)*3 = 9
add_multiply(1,2,3)
## [1] 9


activity_viewer.api package¶
Submodules¶
activity_viewer.api.compute module¶
-
activity_viewer.api.compute.
slice_to_data_uri
(slice_data: numpy.ndarray, annotation: numpy.ndarray, rotate: int) → str¶ Convert an RGB or grayscale array to a PNG data URI.
- Parameters
slice_data (ndarray) – RGB or grayscale data array.
annotation (ndarray) – Annotation values for each pixel in the slice.
rotate (int) – Number of times to rotate the image 90 degrees (once for sagittal, none for coronal).
- Returns
data_uri – Base64-encoded PNG image with transparency.
- Return type
str
-
activity_viewer.api.compute.
slice_to_image
(slice_data: numpy.ndarray, annotation: numpy.ndarray, rotate: int) → <module ‘PIL.Image’ from ‘c:\users\alanc\source\repos\activity-viewer2\venv\lib\site-packages\PIL\Image.py’>¶
-
activity_viewer.api.compute.
summarize_timeseries
(data: numpy.ndarray) → dict¶ Compute min/max time, min/max values, and stride of timeseries.
- Parameters
data (ndarray) – Array of times and values for the timeseries.
- Returns
summary –
- Contains the following entries:
data: the data itself, as a list
stride: the stride of the data
timeMin: the minimum time value (time is assumed sorted)
timeMax: the maximum time value
timeStep: the minimum difference between adjacent time steps
minVal: the minimum timeseries value over all points
maxVal: the maximum timeseries value over all points
- Return type
dict
activity_viewer.api.routes module¶
-
activity_viewer.api.routes.
get_compartment_tree
()¶
-
activity_viewer.api.routes.
get_export_data_file
()¶
-
activity_viewer.api.routes.
get_image
(image_path: str)¶
-
activity_viewer.api.routes.
get_mesh
(structure_id: int)¶
-
activity_viewer.api.routes.
get_penetration_data_file
(penetration_id: str)¶
-
activity_viewer.api.routes.
get_penetration_timeseries
()¶
-
activity_viewer.api.routes.
get_penetration_unit_stat
()¶
-
activity_viewer.api.routes.
get_penetration_vitals
(penetration_id: str)¶ Get IDs, coordinates, and compartments for each point in penetration_id.
-
activity_viewer.api.routes.
get_penetrations
()¶
-
activity_viewer.api.routes.
get_pseudocoronal_annotation_slice
(penetration_id: str)¶
-
activity_viewer.api.routes.
get_settings
()¶ Update or fetch settings in use.
-
activity_viewer.api.routes.
get_slices
()¶
-
activity_viewer.api.routes.
get_timeseries_list
(penetration_id: str)¶
-
activity_viewer.api.routes.
get_timeseries_summary
(timeseries_id: str)¶
-
activity_viewer.api.routes.
get_unit_stat
(penetration_id: str, stat_id: str)¶
-
activity_viewer.api.routes.
get_unit_stat_by_id
(stat_id: str)¶
-
activity_viewer.api.routes.
get_unit_stats_list
(penetration_id: str)¶
-
activity_viewer.api.routes.
hello
()¶
activity_viewer.api.state module¶
-
class
activity_viewer.api.state.
APIState
(settings: activity_viewer.settings.avsettings.AVSettings = None)¶ Bases:
object
Class representing state of the HTTP API.
-
add_penetrations
(file_paths: List[Union[str, pathlib.Path]])¶ Add one or more penetrations to the set of current penetrations.
- Parameters
file_paths (list of str or Path) –
-
property
cache
¶ Cache object.
-
clear_penetrations
()¶ Remove all penetrations from state.
-
get_compartment_tree
()¶ Get the entire compartment hierarchy.
-
get_compartments
(penetration_id: str)¶ Get compartments for each point in penetration_id.
-
get_coordinates
(penetration_id: str)¶ Get CCF coordinates for penetration_id.
-
get_coronal_annotation_rgb
(ap_coordinate: float)¶
-
get_coronal_annotation_slice
(ap_coordinate: float)¶
-
get_coronal_template_slice
(ap_coordinate: float)¶
-
get_penetration_filename
(penetration_id: str)¶
-
get_pseudocoronal_annotation_slice
(penetration_id: str)¶ Get voxel values for pseudocoronal plane of best fit for penetration_id.
-
get_sagittal_annotation_rgb
(lr_coordinate: float)¶
-
get_sagittal_annotation_slice
(lr_coordinate: float)¶
-
get_sagittal_template_slice
(lr_coordinate: float)¶
-
get_timeseries
(penetration_id: str, timeseries_id: str) → Optional[numpy.ndarray]¶ Get a specific timeseries’ values for a specific penetration.
-
get_timeseries_list
(penetration_id: str)¶ Get a list of timeseries for a specific penetration.
-
get_unit_ids
(penetration_id: str)¶ Get point ids for penetration_id.
-
get_unit_stat
(penetration_id: str, stat_id: str)¶ Get a specific unit statistic for a given penetration.
-
get_unit_stats_list
(penetration_id: str)¶ Get a list of unit stats for a specific penetration.
-
has_penetration
(penetration_id: str) → bool¶ Return true if and only if penetration_id exists.
-
load_penetration
(penetration_id: str)¶ Load data from penetration file.
-
make_timeseries_summary
(timeseries_id: str) → activity_viewer.compute.summaries.TimeseriesSummary¶
-
property
npz_loader
¶ NPZ file loader object.
-
property
penetrations
¶ List of loaded and valid penetrations.
-
rm_penetrations
(penetration_ids: List[str])¶ Remove a penetration from state.
-
property
settings
¶ Settings object.
-
-
activity_viewer.api.state.
make_settings
(app: flask.app.Flask, filename: Optional[Union[str, pathlib.Path]]) → activity_viewer.settings.avsettings.AVSettings¶ Make an AVSettings object for use with the Flask app.
- Parameters
app (Flask) – The Flask app. Used for logging.
filename (str or Path) – Path to file to create settings object from.
- Returns
settings
- Return type


You can use a comma to specify multiple criteria for a selection. For instance, p, #foo will select all the <p> elements on a page and the element with id foo.
p, #foo
<p>
foo
select me


Brooks's Law
`Prev `__
B
`Next `__
--------------
**Brooks's Law**: prov.
“Adding manpower to a late software project makes it later” — a result
of the fact that the expected advantage from splitting development work
among ``N`` programmers is ``O(N)`` (that is, proportional to ``N``),
but the complexity and communications cost associated with coordinating
and then merging their work is ``O(N^2)`` (that is, proportional to the
square of ``N``). The quote is from Fred Brooks, a manager of IBM's
OS/360 project and author of *The Mythical Man-Month* (Addison-Wesley,
1975, ISBN 0-201-00650-2), an excellent early book on software
engineering. The myth in question has been most tersely expressed as
“Programmer time is fungible” and Brooks established conclusively that
it is not. Hackers have never forgotten his advice (though it's not the
whole story; see `*bazaar* `__); too often,
`*management* <../M/management.html>`__ still does. See also
`*creationism* <../C/creationism.html>`__, `*second-system
effect* <../S/second-system-effect.html>`__,
`*optimism* <../O/optimism.html>`__.
--------------
+---------------------------+----------------------------+----------------------------------------+
| `Prev `__ | `Up <../B.html>`__ | `Next `__ |
+---------------------------+----------------------------+----------------------------------------+
| broket | `Home <../index.html>`__ | brown-paper-bag bug |
+---------------------------+----------------------------+----------------------------------------+


title = "About Us" url = "/about" layout = "default" hidden = "0" meta_title = "Sylvie Bitter-larkin | About" meta_description = "Sylvie Bitter-larkin was the founder of the S. Bitter-Larkin Gallery in New York, which specialized in discovering and promoting the careers of new artists such as, among others, Patrick Corillon, Thomas Demand, Roland Flexner, Jim Lutes, Michel Mouffe, Yigal Ozeri, Michal Rovner, Karin Sander." seo_keywords = "private art dealer ny, contemporary art ny, art consultant ny, new york, private art dealer new york, contemporary art new york, sylvie bitter-larkin, sbitterlarkin, art consultant geneva, art advisor new york, art advisor ny, art dealer new york, art dealer geneva, sylvie bitterlarkin, selling art new york, buying art new york, sylvie bitterlarkin ny, sylvie bitterlarkin private art dealer ny, sbitterlarkin private art dealer ny, sbitterlarkin about, sylvie bitter-larkin about" robot_index = "index" robot_follow = "follow" ==


Last update: 03-Sep-2010 23:16 UTC
RFC-2783 describes the PPSAPI application programming interface for external precision time signals, such as the pulse-per-second (PPS) signal generated by some radio clocks and cesium oscillators. The PPSAPI provides a generic capability in the ubiquitous Unix kernel which can be used for a wide variety of measurement applications, including network time synchronization and related experiments. The hardware to do this requires only a serial port and a modem control lead, such as the data carrier detect (DCD) lead, which can be driven by an external source via a level converter/pulse generator such as described on the Pulse-per-second (PPS) Signal Interfacing page. In some systems a parallel port can be used for the same purpose.
The PPSAPI interface defined in RFC-2783 is the only PPS interface supported in NTP Version 4. The PPSAPI is supported in stock FreeBSD and, with the addition of the PPSkit kernel module, in Linux.
The special header file /usr/include/sys/timepps.h implements the PPSAPI using whatever primitives are available in each archeticture and operating system. It obsoletes previous APIs based on the tty_clock and ppsclock line disciplines and streams modules, which are no longer supported.
The PPS Clock Discipline driver (type 22) uses the PPSAPI in conjunction with a local radio clock or remote NTP server as a reference clock. The driver can also use the PPSAPI as an interface directly to the kernel PPS facility as described on the Kernel Model for Precision Timekeeping page.
The PPSAPI interface provides the following functions:
The entire PPS interface functionality is currently provided by inline code in the timepps.h header file. While not all implementations support the full PPSAPI specification, they do support all the functions required for the PPS driver described next. The FreeBSD, Linux and Solaris implementations can be used with the stock kernels provided with those systems; however, the Tru64 and SunOS kernels require additional functions not provided in the stock kernels. Solaris users are cautioned that these functions operate improperly in Solaris versions prior to 2.8 with patch Generic_108528-02. Header files for other systems can be found via the web at nanokernel.tar.gz.


My name is Mwangi Margaret Waithera.I studied Mathematics and Computer Science in JKuat and Cloud Computing at Amazon Web Services.(AWS).I love programming beacause its one way of solving and simplifying problems.For instance,through programming we are able to develop Apps,that simplify peoples lives in such ways that you find whatever someone needs either services or goods they are able to access it online even without going to the specific physical locations.
HTMl
CSS
Javascript
Command Line
Git and Version Control
Watching Movies.
Listening to Movitional talks and Spoken Words.
Coding and Learning new Programming Languages.
Name: Margaret W. Mwangi
Tel:<PHONE_NUMBER>
email: maggiemwas91@gmail.com


Boolean equality
Enter two boolean expressions, then click Verify to determine whether or not they are equivalent.
Equality
Truth table
Expression 1
Expression 2
done
Verify
Output
Waiting for input...


WrongSecrets
Home
Challenges
Challenge 1
Challenge 2
Challenge 3
Challenge 4
Challenge 5
Challenge 6
Challenge 7
Challenge 8
Challenge 9
Challenge 10
Challenge 11
Github
Answer to solution :
There are 11 challenges (/challenge/1-11), can you solve them all?
Go back to
the main page
.


{% include 'common/resources-head.html' %}
Please read these terms of service ("terms", "terms of service") carefully before using OpenROAD Cloud website (the "service") operated by OpenROAD Team ("us", 'we", "our").
We will provide our services to you, which are subject to the conditions stated below in this document. Every time you visit this website, use its services or make a purchase, you accept the following conditions. This is why we urge you to read them carefully.
We don't sell your data to third-parties, nor use it to track you. We don't run on advertisement services. We keep track of all your sessions and usage of the web application for our own analytics and to improve the service.
Content published on this website (digital downloads, images, texts, graphics, logos) is the property of OpenROAD and/or its content creators and protected by USA copyright laws. The entire compilation of the content found on this website is the exclusive property of OpenROAD, with copyright authorship for this compilation by OpenROAD.
The entire communication with us is electronic. Every time you send us an email or visit our website, you are going to be communicating with us. You hereby consent to receive communications from us. If you subscribe to the news on our website, you are going to receive regular emails from us. We will continue to communicate with you by posting news and notices on our website and by sending you emails. You also agree that all notices, disclosures, agreements and other communications we provide to you electronically meet the legal requirements that such communications be in writing.
By visiting this website, you agree that the laws of the United States of America, without regard to principles of conflict laws, will govern these terms of service, or any dispute of any sort that might come between OpenROAD and you, or its business partners and associates.
Any dispute related in any way to your visit to this website or to products you purchase from us shall be arbitrated by state or federal court of United States of America and you consent to exclusive jurisdiction and venue of such courts.
Visitors may post content as long as it is not obscene, illegal, defamatory, threatening, infringing of
intellectual property rights, invasive of privacy or injurious in any other way to third parties.
Content has to be free of software viruses, political campaign, and commercial solicitation.
We reserve all rights (but not the obligation) to remove and/or edit such content.
When you post your content, you grant OpenROAD non-exclusive, royalty-free and irrevocable right to use,
reproduce, publish, modify such content throughout the world in any media.
By submitting your hardware design to our flow pipeline, you acknowledge that we keep track of the design and all related artifacts for our own research purposes and service improvements. We don't publish or trade your designs to any third-party.
We grant you a limited license to access and make personal use of this website. You are not allowed to download or modify it. This may be done only with written consent from us.
If you are an owner of an account on this website, you are solely responsible for maintaining
the confidentiality of your private user details (username and password).
You are responsible for all activities that occur under your account or password.
We reserve all rights to terminate accounts, edit or remove content and cancel submitted flows
in their sole discretion.


RIP Google Pixel 3: last year’s phone is out of stock everywhere
by Jared PetersThe Google Pixel 3 was a pretty good phone. It reviewed well, had some great promos, and will be supported for the next several years, and that’s not even mentioning how good its camera is, even if it didn’t really sell well.
But like all good things, the Pixel 3’s time must come to an end. Google looks to have finally exhausted its back stock of last year’s flagship phone, which means you’re only option going forward is the Pixel 4.
This out-of-stock situation applies to both the Google Store and Google Fi’s shop, and stretches across multiple countries. You might still luck out and find some old stock hanging out at a Best Buy or a Target, and there might even be a good sale to go along with dwindling inventory, but don’t expect that to be the case for much longer.
Say your goodbyes, folks. It’s Pixel 4 time.
source: 9to5Google


Requires that the samples are related (dependent). You can read more about the test
at Real Statistics.
Tests the hypotheses:
H0
The means of the samples are equal
H1
The means of the samples are different
Data Entry
No samples:
Sample A:
Sample B:
Sample C:
Significance level α
Upload CSV file:
Post-test:
Correction:
Test Result
Data Summary
Sample
N
Mean
Stdev
A
B
C
Result
Significance level α:
P-value:
Q-score:
Result:
Post-test
The post-test shows which pairs of samples that have different means (if any).
Check test assumptions
The test does not require that the samples are normally distributed. If they are, consider using Repeated Measures ANOVA instead.
Note that the normality test is not entirely accurate for sample sizes under 20.
Shapiro-Wilk test for normally distributed samples


--- layout: post title: Learn more about Rails 2.0 through video categories: - documentation author: David published: true date: 2007-12-03 19:54:00.000000000 +00:00 ---
Railscasts.com is running a special series on what’s new in Rails 2.0. They’ve been showing off how to simplify views, how to usethe new foxy fixtures, and how to use HTTP authentication. All great stuff. And they’re promising there’s more to come. Keep it up.


maritima densiflora Spartina hybrids tussocks flowering maximum species Castillo hybrid number temperature change climate establishment invasive native Figueroa expansion marshes period mean established recorded {border-style Ecol. temperatures plant px;} #ffffff;} environmental lateral pollen Figure rainfall Sci. Tussocks average changes higher increase low meteorological salt July Plant different global growth high Gallego-Tévar Iberian hybridization rate tussock Grewell effects estimated related seed species, < Climate conditions cordgrass middle monthly reproduction summer years ′–° Castellanos June June, Nieva clonal known maritima, marsh parental periods rates ratio stamens ./j.-...x Gulf Valdes annually beginning densiflora, end grains hybrids. pollen:ovule px; year {font-family (aerial August Biol. However, Invasive September Strong Supplementary Table Thus, change. changing climatic clones data diameter distribution estuaries font-size greater inflorescence maritima. parent photography production reciprocal rhizomes salinity significant spikelets tussocks; using .x, .°C Bot. Cadiz Change Evol. Guadiana July, Lovett Piedras San Sdxm) Smxd) Tinto-Odiel alterniflora annual calculated densiflora. double; exerted factors increases mainly maternal mild plants plasticity process salinities sexual spatial studied tillers warm .). Bruno FIGURE J.M. Lateral Meteorological New Odiel Peninsula Southwest University a). according air anther border-color border-width carried collab: conditions, diameters did evolutionary factor formation formed future habitat halophytes life long lower marshes, measured model months new phenology range relation similar solid; span spring study time {font-style {font-weight (). (L.) ./j.-..tb.x ./pnas. Am. Anaya-Romero Davis Doust Dukes Estuary Kittelson Mediterranean Relationships Research Rev. Spanish United Universidad abundant anglica article associated b). biological bold century conditions. constant correlations courier; dense dynamics em; exotic expected fitness flowers highest historical increased inflorescences intertidal marshes. natural obtained phenotypic plants. precipitation predictions pt;} reported reproductive respectively response responses size traits turfs zonation


Secret identifier can be found on Azure Portal.
Secret value will be interpreted as yaml. The following is an example
username: jenkins password: P@ssword
The following example uses the az-cli to load a yaml file as a secret into an Azure Keyvault
az keyvault secret --vault-name jenkins --name jenkins-cred --file jenkins-cred.yaml


Hello everyone, My name is Vaibhav Singh. I love to explore new things and interact people with it. I love to develop websites, Android Apps. That’s the most I can say of myself, my actions could suffice for the rest. You need to know me to know me.
Download CV Contact Me


Ruby vs JavaScript
So going back and forth between computer languages can have a bad effect on remembering which language uses that syntax or that language uses this syntax
You know you need help when your Ruby program is asking why you have a bunch of semicolons and your JavaScript program is asking what the heck def fizzbuzz num
is supposed to do.
For this reason, my cheatsheet will be comparing the two languages and referencing how to do what. For simplicity's sake, I'm only doing one way to define variables, objects, functions and so on in my preferential way.
| Thing to Compare |
Ruby |
JavaScript |
| Link to Docs |
Ruby 2.2.1 Doc |
JavaScript Mozilla Docs |
| Printing to the Console |
print / puts / put / p |
document.write(); / console.log();
|
| Variables |
my_variable = "..." |
var myVariable = "..."
|
| Branching |
if var == 1/elsif var == 2/else/end |
if (var === 1)/else if (var === 2)/else
|
| Loops |
counter = 0while counter < 5 counter += 1endarray.each do |thing| puts thingend |
counter = 0while (counter < 5){ counter++;};for (var i = 0; i < 5; i++){ console.log(i);} |
| Hashes/Objects |
my_hash = {"dog" => 10, "cat" => 3, "fish" => 12} |
var anObject = {dog: "Jerry", cat: "Scotty", fish: "Boyd"} |
| Functions |
def my_functionend |
var myFunction = function(){}; |


"""This module extend pandas.DataFrames with the main functions from statistics and
inequality modules.
"""
from . import _statistics
from . import inequality
from . import statistics
from . import utils
from .statistics import mean
from functools import partial
from types import MethodType
import inspect
import numpy as np
import pandas as pd
[docs]class Convey(pd.DataFrame):
def __init__(self, data=None, index=None, columns=None, weights=None,
group=None, **kw):
super(Convey, self).__init__(data=data, index=index, columns=columns,
**kw)
self.weights = weights
self.group = group
self._attach_method(statistics, self)
self._attach_method(inequality, self)
@property
def _constructor(self):
return Survey
@staticmethod
def _attach_method(module, instance):
# get methods names contained in module
res_names = list()
res_methods = list()
method_name_list = inspect.getmembers(module, inspect.isfunction)
for method_name, func in method_name_list:
# if method_name.startswith('_'): continue # avoid private methods
func = getattr(module, method_name) # get function
if 'weights' in inspect.signature(
func).parameters: # replace weights variable
func = partial(func, weights=instance.weights)
# func = partial(func, data=instance.data)
func = MethodType(func, instance)
res_methods.append(func)
res_names.append(method_name)
setattr(instance, method_name, func)
_constructor_sliced = pd.Series
[docs]class Survey(pd.DataFrame):
[docs] def __init__(self, data=None, index=None, columns=None, weights=None,
group=None, **kw):
super(Survey, self).__init__(data=data, index=index, columns=columns,
**kw)
self.weights = weights
self.group = group
@property
def _constructor(self):
return Survey
_constructor_sliced = pd.Series
[docs] def c_moment(self, variable=None, weights=None, order=2, param=None,
ddof=0):
"""Calculate the central moment of `x` with respect to `param` of order
`n`, given the weights `w`.
Parameters
----------
data :
variable : 1d-array
Variable
weights : 1d-array
Weights
order : int, optional
Moment order, 2 by default (variance)
param : int or array, optional
Parameter for which the moment is calculated, the default is None,
implies use the mean.
ddof : int, optional
Degree of freedom, zero by default.
Returns
-------
central_moment : float
Notes
-----
- The cmoment of order 1 is 0
- The cmoment of order 2 is the variance.
Source : https://en.wikipedia.org/wiki/Moment_(mathematics)
TODO
----
Implement: https://en.wikipedia.org/wiki/L-moment#cite_note-wang:96-6
"""
if weights is None:
weights = self.weights
return statistics.c_moment(variable, weights, self, order, param, ddof)
[docs] def percentile(self, variable=None, weights=None, p=50,
interpolate='lower'):
"""Calculate the value of a quantile given a variable and his weights.
Parameters
----------
data : pd.DataFrame, optional
pd.DataFrame that contains all variables needed.
variable : str or array
weights : str or array
q : float
Quantile level, if pass 0.5 means median.
interpolate : bool
Returns
-------
percentile : float or pd.Series
"""
if weights is None:
weights = self.weights
return statistics.percentile(variable, weights, self, p, interpolate)
[docs] def std_moment(self, variable=None, weights=None, param=None, order=3,
ddof=0):
"""Calculate the standardized moment of order `c` for the variable` x`
with respect to `c`.
Parameters
----------
data : pd.DataFrame, optional
pd.DataFrame that contains all variables needed.
variable : 1d-array
Random Variable
weights : 1d-array, optional
Weights or probability
order : int, optional
Order of Moment, three by default
param : int or float or array, optional
Central trend, default is the mean.
ddof : int, optional
Degree of freedom.
Returns
-------
std_moment : float
Returns the standardized `n` order moment.
References
----------
- https://en.wikipedia.org/wiki/Moment_(mathematics)#Significance_
of_the_moments
- https://en.wikipedia.org/wiki/Standardized_moment
TODO
----
It is the general case of the raw and central moments. Review
implementation.
"""
if weights is None:
weights = self.weights
return statistics.std_moment(variable, weights, self, param, order,
ddof)
[docs] def mean(self, variable=None, weights=None):
"""Calculate the mean of `variable` given `weights`.
Parameters
----------
variable : array-like or str
Variable on which the mean is estimated.
weights : array-like or str
Weights of the `x` variable.
data : pandas.DataFrame
Is possible pass a DataFrame with variable and weights, then you
must pass as `variable` and `weights` the column name stored in
`data`.
Returns
-------
mean : array-like or float
"""
# if pass a DataFrame separate variables.
if weights is None:
weights = self.weights
return statistics.mean(variable, weights, self)
[docs] def density(self, variable=None, weights=None, groups=None):
"""Calculates density in percentage. This make division of variable
inferring width in groups as max - min.
Parameters
----------
data : pd.DataFrame, optional
pandas.DataFrame that contains all variables needed.
variable :
weights :
groups :
Returns
-------
density : array-like
References
----------
Histogram. (2017, May 9). In Wikipedia, The Free Encyclopedia.
Retrieved:
https://en.wikipedia.org/w/index.php?title=Histogram&oldid=779516918
"""
if weights is None:
weights = self.weights
return statistics.density(variable, weights, groups, self)
[docs] def var(self, variable=None, weights=None, ddof=0):
"""Calculate the population variance of `variable` given `weights`.
Parameters
----------
data : pd.DataFrame, optional
pd.DataFrame that contains all variables needed.
variable : 1d-array or pd.Series or pd.DataFrame
Variable on which the quasivariation is estimated
weights : 1d-array or pd.Series or pd.DataFrame
Weights of the `variable`.
Returns
-------
variance : 1d-array or pd.Series or float
Estimation of quasivariance of `variable`
References
---------
Moment (mathematics). (2017, May 6). In Wikipedia, The Free
Encyclopedia.
Retrieved 14:40, May 15, 2017, from
https://en.wikipedia.org/w/index.php?title=Moment_(mathematics)&oldid=
778996402
Notes
-----
If stratificated sample must pass with groupby each strata.
"""
if weights is None:
weights = self.weights
return statistics.var(variable, weights, self, ddof)
[docs] def coef_variation(self, variable=None, weights=None):
"""Calculate the coefficient of variation of a `variable` given weights.
The coefficient of variation is the square root of the variance of the
incomes divided by the mean income. It has the advantages of being
mathematically tractable and is subgroup decomposable, but is not
bounded from above.
Parameters
----------
data : pandas.DataFrame
variable : array-like or str
weights : array-like or str
Returns
-------
coefficient_variation : float
References
----------
Coefficient of variation. (2017, May 5). In Wikipedia, The Free
Encyclopedia.
Retrieved 15:03, May 15, 2017, from
https://en.wikipedia.org/w/index.php?title=Coefficient_of_variation&
oldid=778842331
"""
# TODO complete docstring
if weights is None:
weights = self.weights
return statistics.coef_variation(variable, weights, self)
[docs] def kurt(self, variable=None, weights=None):
"""Calculate the asymmetry coefficient
Parameters
---------
variable : 1d-array
w : 1d-array
Returns
-------
kurt : float
Kurtosis coefficient.
References
---------
Moment (mathematics). (2017, May 6). In Wikipedia, The Free
Encyclopedia.
Retrieved 14:40, May 15, 2017, from
https://en.wikipedia.org/w/index.php?title=Moment_(mathematics)&
oldid=778996402
Notes
-----
It is an alias of the standardized fourth-order moment.
"""
if weights is None:
weights = self.weights
return statistics.kurt(variable, weights, self)
[docs] def skew(self, variable=None, weights=None):
"""Returns the asymmetry coefficient of a sample.
Parameters
---------
data : pandas.DataFrame
variable : array-like, str
weights : array-like, str
Returns
-------
skew : float
References
---------
Moment (mathematics). (2017, May 6). In Wikipedia, The Free
Encyclopedia.
Retrieved 14:40, May 15, 2017, from
https://en.wikipedia.org/w/index.php?title=Moment_(mathematics)&
oldid=778996402
Notes
-----
It is an alias of the standardized third-order moment.
"""
if weights is None:
weights = self.weights
return statistics.skew(variable, weights, self)
# INEQUALITY
# ----------
[docs] def concentration(self, income=None, weights=None, sort=True):
"""This function calculate the concentration index, according to the
notation used in [Jenkins1988]_ you can calculate the:
C_x = 2 / x · cov(x, F_x)
if x = g(x) then C_x becomes C_y
when there are taxes:
y = g(x) = x - t(x)
Parameters
----------
income : array-like
weights : array-like
data : pandas.DataFrame
sort : bool
Returns
-------
concentration : array-like
References
----------
Jenkins, S. (1988). Calculating income distribution indices
from micro-data. National Tax Journal. http://doi.org/10.2307/41788716
"""
# TODO complete docstring
if weights is None:
weights = self.weights
return inequality.concentration(income, weights, self, sort)
[docs] def lorenz(self, income=None, weights=None):
"""In economics, the Lorenz curve is a graphical representation of the
distribution of income or of wealth. It was developed by Max O. Lorenz
in 1905 for representing grouped of the wealth distribution. This
function compute the lorenz curve and returns a DF with two columns of
axis x and y.
Parameters
----------
data : pandas.DataFrame
A pandas.DataFrame that contains data.
income : str or 1d-array, optional
Population or wights, if a DataFrame is passed then `income` should
be a name of the column of DataFrame, else can pass a pandas.Series
or array.
weights : str or 1d-array
Income, monetary variable, if a DataFrame is passed then `y`is a
name of the series on this DataFrame, however, you can pass a
pd.Series or np.array.
Returns
-------
lorenz : pandas.Dataframe
Lorenz distribution in a Dataframe with two columns, labeled x and
y, that corresponds to plots axis.
References
----------
Lorenz curve. (2017, February 11). In Wikipedia, The Free Encyclopedia.
Retrieved 14:34, May 15, 2017, from
https://en.wikipedia.org/w/index.php?title=Lorenz_curve&oldid=764853675
"""
if weights is None:
weights = self.weights
return inequality.lorenz(income, weights, self)
[docs] def gini(self, income=None, weights=None, sort=True):
"""The Gini coefficient (sometimes expressed as a Gini ratio or a
normalized Gini index) is a measure of statistical dispersion intended
to represent the income or wealth distribution of a nation's residents,
and is the most commonly used measure of grouped. It was developed by
Corrado Gini.
The Gini coefficient measures the grouped among values of a frequency
distribution (for example, levels of income). A Gini coefficient of
zero expresses perfect equality, where all values are the same (for
example, where everyone has the same income). A Gini coefficient of 1
(or 100%) expresses maximal grouped among values (e.g., for a large
number of people, where only one person has all the income or
consumption, and all others have none, the Gini coefficient will be
very nearly one).
Parameters
---------
data : pandas.DataFrame
DataFrame that contains the data.
income : str or np.array, optional
Name of the monetary variable `x` in` df`
weights : str or np.array, optional
Name of the series containing the weights `x` in` df`
sorted : bool, optional
If the DataFrame is previously ordered by the variable `x`, it's
must pass True, but False by default.
Returns
-------
gini : float
Gini Index Value.
Notes
-----
The calculation is done following (discrete probability distribution):
G = 1 - [∑_i^n f(y_i)·(S_{i-1} + S_i)]
where:
- y_i = Income
- S_i = ∑_{j=1}^i y_i · f(y_i)
Reference
---------
- Gini coefficient. (2017, May 8). In Wikipedia, The Free Encyclopedia.
Retrieved 14:30, May 15, 2017, from
https://en.wikipedia.org/w/index.php?title=Gini_coefficient&oldid=779424616
- Jenkins, S. (1988). Calculating income distribution indices
from micro-data. National Tax Journal. http://doi.org/10.2307/41788716
TODO
----
- Implement statistical deviation calculation, VAR (GINI)
"""
if weights is None:
weights = self.weights
return inequality.gini(income, weights, self, sort)
[docs] def atkinson(self, income=None, weights=None, e=0.5):
"""More precisely labelled a family of income grouped measures, the
theoretical range of Atkinson values is 0 to 1, with 0 being a state of
equal distribution.
An intuitive interpretation of this index is possible: Atkinson values
can be used to calculate the proportion of total income that would be
required to achieve an equal level of social welfare as at present if
incomes were perfectly distributed.
For example, an Atkinson index value of 0.20 suggests
that we could achieve the same level of social welfare with only
1 – 0.20 = 80% of income. The theoretical range of Atkinson values is 0
to 1, with 0 being a state of equal distribution.
Parameters
---------
income : array or str
If `data` is none `income` must be an 1D-array, when `data` is a
pd.DataFrame, you must pass the name of income variable as string.
weights : array or str, optional
If `data` is none `weights` must be an 1D-array, when `data` is a
pd.DataFrame, you must pass the name of weights variable as string.
e : int, optional
Epsilon parameter interpreted by atkinson index as grouped
adversion, must be a number between 0 to 1.
data : pd.DataFrame, optional
data is a pd.DataFrame that contains the variables.
Returns
-------
atkinson : float
Reference
---------
Atkinson index. (2017, March 12). In Wikipedia, The Free Encyclopedia.
Retrieved 14:35, May 15, 2017, from
https://en.wikipedia.org/w/index.php?title=Atkinson_index&oldid=769991852
TODO
----
- Implement: CALCULATING INCOME DISTRIBUTION INDICES FROM MICRO-DATA
http://www.jstor.org/stable/41788716
- The results has difference with stata, maybe have a bug.
"""
if weights is None:
weights = self.weights
return inequality.atkinson(income, weights, self, e)
[docs] def kakwani(self, tax=None, income_pre_tax=None, weights=None):
"""The Kakwani (1977) index of tax progressivity is defined as twice the
area between the concentration curves for taxes and pre-tax income,
or equivalently, the concentration index for t(x) minus the Gini index
for x, i.e.
K = C(t) - G(x)
= (2/t) cov [t(x), F(x)] - (2/x) cov [x, F(x)].
Parameters
----------
data : pandas.DataFrame
This variable is a DataFrame that contains all data required in
columns.
tax_variable : array-like or str
This variable represent tax payment of person, if pass array-like
then data must be None, else you pass str-name column in `data`.
income_pre_tax : array-like or str
This variable represent income of person, if pass array-like
then data must be None, else you pass str-name column in `data`.
weights : array-like or str
This variable represent weights of each person, if pass array-like
then data must be None, else you pass str-name column in `data`.
Returns
-------
kakwani : float
References
----------
Jenkins, S. (1988). Calculating income distribution indices from
micro-data. National Tax Journal. http://doi.org/10.2307/41788716
"""
# main calc
if weights is None:
weights = self.weights
return inequality.kakwani(tax, income_pre_tax, weights, self)
[docs] def reynolds_smolensky(self, income_pre_tax=None, income_post_tax=None,
weights=None):
"""The Reynolds-Smolensky (1977) index of the redistributive effect of
taxes, which can also be interpreted as an index of progressivity
(Lambert 1985), is defined as:
L = Gx - Gy
= [2/x]cov[x,F(x)] - [2/ybar] cov [y, F(y)].
Parameters
----------
data : pandas.DataFrame
This variable is a DataFrame that contains all data required in it's
columns.
income_pre_tax : array-like or str
This variable represent tax payment of person, if pass array-like
then data must be None, else you pass str-name column in `data`.
income_post_tax : array-like or str
This variable represent income of person, if pass array-like
then data must be None, else you pass str-name column in `data`.
weights : array-like or str
This variable represent weights of each person, if pass array-like
then data must be None, else you pass str-name column in `data`.
Returns
-------
reynolds_smolensky : float
References
----------
Jenkins, S. (1988). Calculating income distribution indices from
micro-data. National Tax Journal. http://doi.org/10.2307/41788716
"""
if weights is None:
weights = self.weights
return inequality.reynolds_smolensky(income_pre_tax,
income_post_tax, weights, self)
[docs] def theil(self, income=None, weights=None):
"""The Theil index is a statistic primarily used to measure economic
grouped and other economic phenomena. It is a special case of the
generalized entropy index. It can be viewed as a measure of redundancy,
lack of diversity, isolation, segregation, grouped, non-randomness, and
compressibility. It was proposed by econometrician Henri Theil.
Parameters
----------
data : pandas.DataFrame
This variable is a DataFrame that contains all data required in it's
columns.
income : array-like or str
This variable represent tax payment of person, if pass array-like
then data must be None, else you pass str-name column in `data`.
weights : array-like or str
This variable represent weights of each person, if pass array-like
then data must be None, else you pass str-name column in `data`.
Returns
-------
theil : float
References
----------
Theil index. (2016, December 17). In Wikipedia, The Free Encyclopedia.
Retrieved 14:17, May 15, 2017, from
https://en.wikipedia.org/w/index.php?title=Theil_index&oldid=755407818
"""
if weights is None:
weights = self.weights
return inequality.theil(income, weights, self)
[docs] def avg_tax_rate(self, total_tax=None, total_base=None, weights=None):
"""This function compute the average tax rate given a base income and a
total tax.
Parameters
----------
total_base : str or numpy.array
total_tax : str or numpy.array
data : pd.DataFrame
Returns
-------
avg_tax_rate : float or pd.Series
Is the ratio between mean the tax income and base of income.
Reference
---------
Panel de declarantes de IRPF 1999-2007: Metodología, estructura y variables.
(2011). Panel de declarantes de IRPF 1999-2007:
Metodología, estructura y variables. Documentos.
"""
if weights is None:
weights = self.weights
return inequality.avg_tax_rate(total_tax, total_base, weights, self)


Across: 1. Smother little creature; it's backward (6) 5. With traditional marriage vow, married and tragically unmarried (7) 9. Scrabble 'N' he improbably held, winning 1704 battle for Churchill (8) 10. Crazy fellow accepts Indian capital for English (6) 11. Australian basketballer and friend on circuit (4) 12. Where he might bowl a ball will scare shaky tail-enders (5) 13.  Spot Los Angeles turning into city after lowliest of beginnings (8) 17. Penny rent to provide satisfaction (6) 19,7dn. 1923 24 3's winning side, with dash working west and east, recovers after losing middle half (6 9) 20. Perhaps ices up, sweating bullets? (8) 21. Good side not looking so good! (4) 23.  It sounds like a fair, although perhaps inevitable, outcome (4) 25. see 27 26. Content in playing (half the time) without offending (8) 27,25. 1923 24 3's losing side with terrible diet: human stew (4 3 6) 28,20dn. Having smoked head off cannibis crop, I rest (outwardly), and I sound hesitant making new venue for "the White Horse 3" (6 7) Down: 2. With back of boot... oh! Pele! terrific long shot! (9) 3. Match with firsts of firsts? It's nearly always last! (5) 4. No, I travel East to West, losing real high (9) 5,20dn. What 28 20 became as weeds immutably developed? (7 7) 6. Put off by odd lady taking drug (5) 7. see 19 across 8. Just a bit of dangle... poor rising! (5) 14.  Pilau Tom ate solves retention and gets things moving smoothly (9) 17. Where blackbird sat with Mandela's group, finally free with a bit of luck (9) 18. Teens were corrupted for bribe (9) 19. What the poor sometimes have to do: be good (3) 20. see 5 down or 28 across 22. Make fresh sausage up without one (5) 23. Dimension with left and right? (5) 24. France regularly get high for competition (1. 1. 3)


Clppr
Official
Documentation
Clappr is an extensible, open source, plugin oriented, html5-first media player for web and mobile. It can play, among others formats: hls, dash, ogg, webm, mp4, rtmp either live or video on demand.
One of its strongest features is the ability to extend it with plugins, there are at least two main ways of doing this:
But before we start to create these plugins, we should understand the basics behind Clappr's architecture. It was designed around these main components:
And you can create plugins around these abstractions, here's the kinds of plugins you can do:
To summarize Clappr is aiming to:
Clppr
All parameters listed below shall be added on Clappr.Player
object instantiation.
| Parameter | Type | Default | Discussion |
|---|---|---|---|
autoPlay |
Boolean |
true if video should automatically play after page load
|
|
autoPlayVisible |
Boolean |
partial if video should play automatically when it is partially appearing on the screen.
full to auto play only when it is full visible
|
|
chromeless |
Boolean | false |
true if you want the player to act in chromeless mode.
|
height |
Integer | ||
hideMediaControl |
Boolean | true |
false to disable media control auto hide
|
hideVolumeBar |
Boolean | false |
true to hide volume bars
|
mediacontrol |
Object | you can customize control bar colors adding the mediacontrol hash, eg: mediacontrol:
seekbar: "#E113D3", buttons: "#66B2FF"
|
|
mute |
Boolean | false |
true if you want to start player with no sound
|
persistConfig |
Boolean | true |
false if you don't want to persist player's volume through your videos, by default
it saves. These configuration are being saved at user's browser (through localStorage).
|
preload |
String | In case you're loading a on demand video (mp4), it's possible to define the way the video will be
preloaded according to preload
attribute options. Add preload: <type> on embed parameters. By default, Clappr will
try to download only video metadata (preload: 'metadata' ).
|
|
width |
Integer |
You can listen to several events from Clappr.


Hello!
Welcome to your profile, you can view and edit your lists here.
Click Here to see your watchlist
Your Favorites:
| Remove | Title | Year | Category | Poster |
|---|
Your Watch List :
| Remove | Title | Year | Category | Poster |
|---|


Lorem ipsum dolor sit amet, consectetur adipisicing elit. Sed voluptate nihil eum consectetur similique? Consectetur, quod, incidunt, harum nisi dolores delectus reprehenderit voluptatem perferendis dicta dolorem non blanditiis ex fugiat.
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Saepe, magni, aperiam vitae illum voluptatum aut sequi impedit non velit ab ea pariatur sint quidem corporis eveniet. Odit, temporibus reprehenderit dolorum!
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Et, consequuntur, modi mollitia corporis ipsa voluptate corrupti eum ratione ex ea praesentium quibusdam? Aut, in eum facere corrupti necessitatibus perspiciatis quis?
We have been building homes all over the New Jersey area for the past three decades. Our projects have ranged from single-story to multi-million dollar homes.
We have built offices, banks, and medical/dental offices. We also have had several remodeling and addition projects to existing structures.
Most of the houses we've built were designed in-house. We have engineers and designers on staff. We also offer architectural services such as drafting and 3D-Modeling.
3481 Melrose Place
Beverly Hills, CA 90210
P:<PHONE_NUMBER>
H: Monday - Friday: 9:00 AM to 5:00 PM


WITNESS LIST Government Organization Committee May 16, 2005 - 9:00A HB 972 FOR: Klein, Dr. Franz President (Texas Chiropractic Association), Austin, TX Registering, but not testifying: On: Leroux, Emilie Policy Analyst (Sunset Commission), Austin, TX Smith, Sandra Executive Director (Texas Board of Chiropractic Examiners), Austin, TX HB 1283 ON: Kennedy, Kelly Policy Analyst (Sunset Commission), Austin, TX Registering, but not testifying: For: Cullen, Sue Career Development Consultant (Self), Austin, TX Friese, Jan Executive Director (Texas Counseling Association), Austin, TX On: Alexander, Bobbe Executive Director, LPC Board (Department of State Health Services, Counselor Board), Austin, TX HB 1535 FOR: Barnett, Mary M. Certified Nurse Midwife (Consortium of Texas Certified Nurse Midwives), Austin, TX Beltz, Faith Certified Professional Midwife (Association of Texas Midwives), Austin, TX Chamberlain, Amy at-home parent (Texans for Midwifery), Austin, TX Registering, but not testifying: On: Peterson, Debbie Manager (Department of State Health Services), Austin, TX Walraven, Joe Policy Analyst (Sunset Advisory Commission), Austin, TX HB 2025 FOR: Holmes, Ned Commissioner (Texas Parks and Wildlife Commission), Houston, TX Kerr, John Investments (Admiral Nimitz Foundation), San Antonio, TX HB 2048 Registering, but not testifying: For: Campbell, Amanda Sales (Oracle), Austin, TX Ikard, Kathy Senior Manager (Bearing Point), Austin, TX Jacks, Andrew VP Operations (teleNetwork Inc.), Austin, TX Parr, Mike (EMC), Austin, TX Richter, Tim Account Manager (MCI), Austin, TX Rogers, William Manager (Self), Austin, TX Russell, Randy Relationship Manager (Sun Microsystems), Austin, TX Watkins, Joe Bill Attorney (Vinson and Elkins LLP), Austin, TX On: Burroughs, Robert Major (Texas Department of Public Safety), Austin, TX Frederick, Gary Mgr. State Government (Texas Workforce Commission), Austin, TX Hutchison, Larry DIR - TexasOnline (DIR), Austin, TX HB 2473 Registering, but not testifying: On: Shirley, Beverley Librarian (Texas State Library and Archives Commission), Austin, TX HB 2856 FOR: Friese, Jan Executive Director (Texas Counseling Association), Austin, TX ON: Kuntz, William Executive Director (Texas Department of Licensing and Regulation), Austin, TX Registering, but not testifying: For: Cullen, Sue Career Development Consultant (Self), Austin, TX HB 2902 Registering, but not testifying: On: Oaks, Larry Texas Historical Commission (Executive Director), Austin, TX HB 3147 ON: Mayes, Christopher T. Investment Banker (Caprock Securities, Inc.), Austin, TX McCabe, Brian T. Attorney (Candey and Hanger), Austin, TX Registering, but not testifying: For: Foster, Stephen (Caprock Securities), Austin, TX On: Edwards, Kimberly K. Executive Director (Texas Public Finance Authority), Austin, TX HB 3269 ON: Oaks, Larry Executive Director (Texas Historical Commission), Austin, TX


Julian Assange rape investigation dropped by Sweden
WikiLeaks founder also sought by US authorities over his activities
A Swedish prosecutor said on Tuesday she would not proceed with an investigation into an allegation of rape against WikiLeaks founder Julian Assange after a review of the evidence.
Deputy Chief Prosecutor Eva-Marie Persson said that the complainant’s evidence was deemed credible and reliable, but that after nearly a decade, witnesses’ memories had faded.
“After conducting a comprehensive assessment of what has emerged during the course of the preliminary investigation I then make the assessment that the evidence is not strong enough to form the basis for filing an indictment,” Persson told a news conference.
The 48-year-old Australian citizen has repeatedly denied the allegation against him, made in 2010.
The move by the prosecutor heads off a possible dilemma for the British courts which could potentially have had to decide between competing extradition requests from the United States and Sweden. However, the prosecutor said the decision to drop the investigation could be appealed.
Assange is being held in a British jail pending a hearing in February on extradition to the United States, which wants the 48 year-old Australian citizen over 18 criminal counts including conspiring to hack government computers and violating an espionage law.
He was dragged from the Ecuadorian embassy in London in April this year after spending almost seven years holed up there to avoid extradition on the Swedish allegations. Since then, he has served a British jail sentence for skipping bail. –Reuters


From left to right: Kim Seokjin (Jin), Park Jimin, Kim Namjoon (RM), Min Yoongi (Suga), Kim Taehyung (V), Jeon Jungkook, Jung Hoseok (J-Hope).
BTS, also known as the Bangtan Boys, is a seven-member South Korean boy band that was formed in 2010 and debuted in 2013 under Big Hit Entertainment. The septet—composed of Jin, Suga, J-Hope, RM, Jimin, V, and Jungkook—co-writes and co-produces much of their own output. Originally a hip hop group, their musical style has evolved to include a wide range of genres. Their lyrics, often focused on personal and social commentary, touch on the themes of mental health, troubles of school-age youth and coming of age, loss, the journey towards loving oneself, and individualism. Their work also often references literature and psychological concepts and includes an alternative universe storyline.
Follow them on Twitter: BTS's Twitter Page
Dope
| Album Name | Title Track | Release Date |
|---|---|---|
| Dark & Wild | Danger | August 20, 2014 |
| Wings | Blood Sweat & Tears | October 10, 2016 |
| Love Yourself: Tear | Fake Love | May 18, 2018 |


Having upgraded to V5, I have a problem displaying a multigraph in a dashboard on my Android device - 4.1.1 using the stock Android browser.
If I clear the browser cache, it loads correctly. However, if I then refresh the screen, the page loads, but the multigraph does not appear. This is repeatable every time I have tried it. This was not a problem in V4. Everything appears to be OK on my desktop (IE 10).
I notice that the spacing of the black menu bar at the top seems to be different - it seems to be narrower than before?
Can anyone help with this please?
Re: Multigraph not displaying correctly on Android
Does anyone have any pointers as to what might be causing this please?
Re: Multigraph not displaying correctly on Android
I have a clue: the problem seems to only occur when I use a wi-fi connection. If I use a 3G connection (which is presumably slower), the graph displays correctly. I am guessing that this means that there is a timing issue somewhere? Any ideas?
Re: Multigraph not displaying correctly on Android
I'm still struggling with this and don't really have any pointers. Here is the dashboard that doesn't display when refreshed:
http://emoncms.org/engeeaitch
Does anyone have any suggestions please?
Re: Multigraph not displaying correctly on Android
Hello engeeaitch, I can confirm it loads first time and then for me a refresh crashes the page and the browser exits. Are you viewing it on a tablet? its a wide dashboard for a phone?!
Re: Multigraph not displaying correctly on Android
I can also confirm it crashes on one of my own multigraphs and at a smaller size.
Re: Multigraph not displaying correctly on Android
Checked with the android debugger, this is the log on page refresh:
05-22 13:50:26.498 2337 2337 E browser : Console: Uncaught ReferenceError: jQuery is not defined http://mydomain/emoncms/Lib/flot/jquery.flot.min.js:27
05-22 13:50:26.545 2337 2337 E browser : Console: Uncaught ReferenceError: jQuery is not defined http://mydomain/emoncms/Lib/flot/jquery.flot.selection.min.js:79
05-22 13:50:26.545 2337 2337 E browser : Console: Uncaught ReferenceError: jQuery is not defined http://mydomain/emoncms/Lib/flot/jquery.flot.time.min.js:424
05-22 13:50:26.545 2337 2337 E browser : Console: Uncaught ReferenceError: $ is not defined http://mydomain/emoncms/vis/multigraph?embed=1&mid=1:46
Adding
<script type="text/javascript" src="<?php echo $path;?>/Lib/jquery-1.9.1.min.js"></script>
in vis/visualizations/multigraph.php on line 16 (before the other jquery includes) fixes the error, the graph is still displayed with full width, but it is better than nothing.
It does not happen with chrome as far as I can tell, so it must be a problem specific to the android browser. Adding the jquery reference does not break the visualization on my main pc, as far as I can tell
Regards
Re: Multigraph not displaying correctly on Android
on a second thought, maybe adding
<?php if ($embed) { ?>
<script type="text/javascript" src="<?php echo $path;?>/Lib/jquery-1.9.1.min.js"></script>
<?php } ?>
instead of including it even when not embedding it in an Iframe would be better ...
Re: Multigraph not displaying correctly on Android
Thanks a lot Mattia, how do you get the android debugger?
<script type="text/javascript" src="<?php echo $path;?>/Lib/jquery-1.9.1.min.js"></script>
is defined in Theme/embed.php which is the theme that anything that is embedded is wrapped in. I wonder how its missing that reference?
I thought Id sorted this issue before by using a slightly older version of jquery but it seems to be affecting all visualization types, strange.
Re: Multigraph not displaying correctly on Android
Hi Trystan
you have to connect the phone to a pc with the usb cable, enable usb debugging on the phone, and then run (after installing the android sdk)
adb logcat (for all logs)
or
adb logcat -s "browser"
to filter only browser related messages
You can then read all the messages that would normally be output on the browser console
and if I check from a real browser, when I hit refresh I can see that jquery is loaded corerctly even without the hack .... the only thing that comes to mind is that there's a bug in the android browser that prevents it to load the jquery lib when it is included in the headers .... or that because of some race condition the other scripts are loaded and evaluated before it ... running a quick google search did not turn up any meaningful answer though ... I guess it should be a fairly common problem though ...
Re: Multigraph not displaying correctly on Android
Hi all - thanks for your efforts. I am using this on a mobile phone - landscape. It serves my purpose well (when it works). So is there a recommended solution? Just a reminder - I don't think that this was a problem in emoncms V4.
Nick
Re: Multigraph not displaying correctly on Android
Hi - just wondering if there was any chance of a fix for this please?
Nick
Re: Multigraph not displaying correctly on Android
Hi Nick,
I thought it was already evident from the previous posts ... anyway ... until Trystan commits a fix on the main emoncms code tree, you'll have either to use another browser (if your phone supports it I'd go with Chrome) or edit emoncms / Modules / vis / visualisations / multigraph.php and add on line 16 these lines:
<?php if ($embed) { ?>
<script type="text/javascript" src="<?php echo $path;?>/Lib/jquery-1.9.1.min.js"></script>
<?php } ?>
This should fix the problem (that apparently is in the android browser, not emoncms ....
Regards
Re: Multigraph not displaying correctly on Android
Hi - thanks for the reply.
I have added this fix to my local copy of emoncms, but it doesn't seem to make any difference. I did a bit of looking around using Chrome Inspect Element on the desktop to make sure that I had added the lines correctly - I think that there should not be a / before the Lib directory? With the forward slash removed, the line appeared OK in the browser on the desktop, but on testing on Android, the problem was still there - i.e. if I clear the cache, it loads fine, but then on doing a refresh, the graph does not load.
Any ideas as to where to go next?
Nick
Re: Multigraph not displaying correctly on Android
If anyone's interested - this problem went away with the upgrade to Android 4.2.2


| Level | Money | Fate Points |
| Strength | Agility | Wisdom | Charisma | Health |
| Race | Strength | Agility | Wisdom | Charisma | Health | Bonus |
| Weapons | Action | Dice Pool | Effect | Rule |
| Armor | Rating | Rule |
| Combat Perks | Description |
| Combat Techniques | Description |
| Generic Perks | Description |
| Social Talents | Prerequisite | Result | Modifier | Description |
| Spells | Modifiers | Description |
Test strings come here


 This allows hackers to monitor, intercept, or steal their data streams.
This is not always a bogus WiFi, it can be an attractive website or social media platform. A watering hole is a way to harvest data or spread a malware infection to the maximum number of devices.
The Virtual Private Network (VPN) remains your safest option when using any wireless access.
The Blue Pill shows animals drinking from the water hole, everything seems happy.
The Red Pill shows a crocodile jumping up and has eaten the animals.
This represents the hacker stealing your personal information.


one
sub one
sub two
sub three
sub four
sub five
two
three
four
one
sub one
sub two
sub three
sub four
sub five
two
three
four


Interface Structure
- All Superinterfaces:
PersistentDataHolder
A structure is a mutable template of captured blocks and entities that can be
copied back into the world. The StructureManager
, retrieved via
Server.getStructureManager()
, allows you to create new
structures, load existing structures, and save structures.
In order for a structure to be usable by structure blocks, it needs to be
null registered
with the StructureManager
, or located in the primary
world folder, a DataPack, or the server's own default resources, so that the
StructureManager can find it.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Fills the structure from an area in a world.void
fill
(@NotNull Location origin, @NotNull BlockVector size, boolean includeEntities) Fills the Structure from an area in a world, starting at the specified origin and extending in each axis according to the specified size vector.Gets a list of entities that have been included in the Structure.int
Gets the number of entities in this structure.int
Gets the number of palettes in this structure.Gets a list of available block palettes.getSize()
Gets the current size of the structure.void
place
(@NotNull Location location, boolean includeEntities, @NotNull StructureRotation structureRotation, @NotNull Mirror mirror, int palette, float integrity, @NotNull Random random) Place a structure in the world.void
place
(@NotNull RegionAccessor regionAccessor, @NotNull BlockVector location, boolean includeEntities, @NotNull StructureRotation structureRotation, @NotNull Mirror mirror, int palette, float integrity, @NotNull Random random) Place a structure in the world.Methods inherited from interface org.bukkit.persistence.PersistentDataHolder
getPersistentDataContainer
-
Method Details
-
getSize
Gets the current size of the structure.The size of the structure may not be fixed.
- Returns:
- A new vector that represents the size of the structure along each axis.
-
getPalettes
Gets a list of available block palettes.- Returns:
- a list of available variants of this structure.
-
getPaletteCount
int getPaletteCount()Gets the number of palettes in this structure.- Returns:
- The number of palettes in this structure
-
getEntities
Gets a list of entities that have been included in the Structure. The entity positions are offsets relative to the structure's position that is provided once the structure is placed into the world.- Returns:
- a list of Entities included in the Structure.
-
getEntityCount
int getEntityCount()Gets the number of entities in this structure.- Returns:
- The number of entities in this structure
-
place
void place(@NotNull @NotNull Location location, boolean includeEntities, @NotNull @NotNull StructureRotation structureRotation, @NotNull @NotNull Mirror mirror, int palette, float integrity, @NotNull @NotNull Random random) Place a structure in the world.- Parameters:
location
- The location to place the structure at.includeEntities
- If the entities present in the structure should be spawned.structureRotation
- The rotation of the structure.mirror
- The mirror settings of the structure.palette
- The palette index of the structure to use, starting at0
, or-1
to pick a random palette.integrity
- Determines how damaged the building should look by randomly skipping blocks to place. This value can range from 0 to 1. With 0 removing all blocks and 1 spawning the structure in pristine condition.random
- The randomizer used for setting the structure'sLootTable
s and integrity.
-
place
void place(@NotNull @NotNull RegionAccessor regionAccessor, @NotNull @NotNull BlockVector location, boolean includeEntities, @NotNull @NotNull StructureRotation structureRotation, @NotNull @NotNull Mirror mirror, int palette, float integrity, @NotNull @NotNull Random random) Place a structure in the world.- Parameters:
regionAccessor
- The world to place the structure in.location
- The location to place the structure at.includeEntities
- If the entities present in the structure should be spawned.structureRotation
- The rotation of the structure.mirror
- The mirror settings of the structure.palette
- The palette index of the structure to use, starting at0
, or-1
to pick a random palette.integrity
- Determines how damaged the building should look by randomly skipping blocks to place. This value can range from 0 to 1. With 0 removing all blocks and 1 spawning the structure in pristine condition.random
- The randomizer used for setting the structure'sLootTable
s and integrity.
-
fill
void fill(@NotNull @NotNull Location corner1, @NotNull @NotNull Location corner2, boolean includeEntities) Fills the structure from an area in a world. The origin and size will be calculated automatically from the two corners provided.Be careful as this will override the current data of the structure.
Be aware that this method allows for creating structures larger than the 48x48x48 size that Minecraft's Structure blocks support. Any structures saved this way can not be loaded by using a structure block. Using the API however will still work.
- Parameters:
corner1
- A corner of the structure.corner2
- The corner opposite from corner1.includeEntities
- true if entities should be included in the saved structure.
-
fill
void fill(@NotNull @NotNull Location origin, @NotNull @NotNull BlockVector size, boolean includeEntities) Fills the Structure from an area in a world, starting at the specified origin and extending in each axis according to the specified size vector.Be careful as this will override the current data of the structure.
Be aware that this method allows for saving structures larger than the 48x48x48 size that Minecraft's Structure blocks support. Any structures saved this way can not be loaded by using a structure block. Using the API however will still work.
- Parameters:
origin
- The origin of the structure.size
- The size of the structure, must be at least 1x1x1.includeEntities
- true if entities should be included in the saved structure.- Throws:
IllegalArgumentException
- Thrown if size is smaller than 1x1x1
-


TABLE OF INTERACTIONS WITH
ANTIHYPERTENSIVE ALPHA BLOCKERS
From the French ANSM drug interactions document of September 2016, p. 25
ANTIHYPERTENSIVE ALPHA BLOCKERS CLASS CODE: C02CA0-001 |
ALPHA BLOCKERS FOR UROLOGICAL USE CLASS CODE: G04CA-001 |
Increase of the hypotensive effect. Risk of severe orthostatic hypotension |
Not recommended |
ANTIHYPERTENSIVE ALPHA BLOCKERS CLASS CODE: C02CA0-001 |
ANTIHYPERTENSIVES EXCEPT ALPHA BLOCKERS CLASS CODE: C0-001 |
Increase of the hypotensive effect. Greater risk of orthostatic hypotension. |
Take into account |
ANTIHYPERTENSIVE ALPHA BLOCKERS CLASS CODE: C02CA0-001 |
TYPE 5 PHOSPHODIESTERASE INHIBITORS CLASS CODE: G04BE |
Risk of orthostatic hypotension, especially with older patients |
Not recommended -with the doxazosine Precaution for use -with the other alpha blockers Begin the treatment with the minimum recommended dosages and adjust the doses progressively if needed |


Algorithms to compute spherical k-means partitions. Features several methods, including a genetic and a fixed-point algorithm and an interface to the CLUTO vcluster program.
| Version: | 0.2-11 |
| Imports: | slam (≥ 0.1-31), clue (≥ 0.3-39), cluster, stats, utils |
| Enhances: | Matrix, kmndirs |
| Published: | 2017-08-08 |
| Author: | Kurt Hornik [aut, cre], Ingo Feinerer [aut], Martin Kober [aut] |
| Maintainer: | Kurt Hornik <Kurt.Hornik at R-project.org> |
| License: | GPL-2 |
| NeedsCompilation: | no |
| Citation: | skmeans citation info |
| In views: | Cluster, NaturalLanguageProcessing |
| CRAN checks: | skmeans results |
| Reference manual: | skmeans.pdf |
| Package source: | skmeans_0.2-11.tar.gz |
| Windows binaries: | r-devel: skmeans_0.2-11.zip, r-release: skmeans_0.2-11.zip, r-oldrel: skmeans_0.2-11.zip |
| OS X binaries: | r-release: skmeans_0.2-11.tgz, r-oldrel: skmeans_0.2-11.tgz |
| Old sources: | skmeans archive |
| Reverse imports: | movMF |
| Reverse suggests: | flexclust |
Please use the canonical form https://CRAN.R-project.org/package=skmeans to link to this page.


|
libcaer
2.0.0-r03701472c913c547a88c15e2d287b3729f798d31
|
Go to the source code of this file.
Macros | |
| #define | CAER_HOST_CONFIG_USB -1 |
| #define | CAER_HOST_CONFIG_DATAEXCHANGE -2 |
| #define | CAER_HOST_CONFIG_PACKETS -3 |
| #define | CAER_HOST_CONFIG_USB_BUFFER_NUMBER 0 |
| #define | CAER_HOST_CONFIG_USB_BUFFER_SIZE 1 |
| #define | CAER_HOST_CONFIG_DATAEXCHANGE_BUFFER_SIZE 0 |
| #define | CAER_HOST_CONFIG_DATAEXCHANGE_BLOCKING 1 |
| #define | CAER_HOST_CONFIG_DATAEXCHANGE_START_PRODUCERS 2 |
| #define | CAER_HOST_CONFIG_DATAEXCHANGE_STOP_PRODUCERS 3 |
| #define | CAER_HOST_CONFIG_PACKETS_MAX_CONTAINER_PACKET_SIZE 0 |
| #define | CAER_HOST_CONFIG_PACKETS_MAX_CONTAINER_INTERVAL 1 |
Typedefs | |
| typedef struct caer_device_handle * | caerDeviceHandle |
Functions | |
| caerDeviceHandle | caerDeviceOpen (uint16_t deviceID, uint16_t deviceType, uint8_t busNumberRestrict, uint8_t devAddressRestrict, const char *serialNumberRestrict) |
| bool | caerDeviceClose (caerDeviceHandle *handle) |
| bool | caerDeviceSendDefaultConfig (caerDeviceHandle handle) |
| bool | caerDeviceConfigSet (caerDeviceHandle handle, int8_t modAddr, uint8_t paramAddr, uint32_t param) |
| bool | caerDeviceConfigGet (caerDeviceHandle handle, int8_t modAddr, uint8_t paramAddr, uint32_t *param) |
| bool | caerDeviceDataStart (caerDeviceHandle handle, void(*dataNotifyIncrease)(void *ptr), void(*dataNotifyDecrease)(void *ptr), void *dataNotifyUserPtr, void(*dataShutdownNotify)(void *ptr), void *dataShutdownUserPtr) |
| bool | caerDeviceDataStop (caerDeviceHandle handle) |
| caerEventPacketContainer | caerDeviceDataGet (caerDeviceHandle handle) |
Common functions to access, configure and exchange data with supported USB devices. Also contains defines for host/USB related configuration options.
| #define CAER_HOST_CONFIG_DATAEXCHANGE -2 |
Module address: host-side data exchange (ring-buffer) configuration.
| #define CAER_HOST_CONFIG_DATAEXCHANGE_BLOCKING 1 |
Parameter address for module CAER_HOST_CONFIG_DATAEXCHANGE: when calling caerDeviceDataGet(), the function can either be blocking, meaning it waits until it has a valid EventPacketContainer to return, or not, meaning it returns right away. This behavior can be set with this flag. Please see the caerDeviceDataGet() documentation for more information on its return values.
| #define CAER_HOST_CONFIG_DATAEXCHANGE_BUFFER_SIZE 0 |
Parameter address for module CAER_HOST_CONFIG_DATAEXCHANGE: set size of elements that can be held by the thread-safe FIFO buffer between the USB data transfer thread and the main thread. The default values are usually fine, only change them if you're running into lots of dropped/missing packets; you can turn on the INFO log level to see when this is the case.
| #define CAER_HOST_CONFIG_DATAEXCHANGE_START_PRODUCERS 2 |
Parameter address for module CAER_HOST_CONFIG_DATAEXCHANGE: whether to start all the data producer modules on the device (DVS, APS, Mux, ...) automatically when starting the USB data transfer thread with caerDeviceDataStart() or not. If disabled, be aware you will have to start the right modules manually, which can be useful if you need precise control over which ones are running at any time.
| #define CAER_HOST_CONFIG_DATAEXCHANGE_STOP_PRODUCERS 3 |
Parameter address for module CAER_HOST_CONFIG_DATAEXCHANGE: whether to stop all the data producer modules on the device (DVS, APS, Mux, ...) automatically when stopping the USB data transfer thread with caerDeviceDataStop() or not. If disabled, be aware you will have to stop the right modules manually, to halt the data flow, which can be useful if you need precise control over which ones are running at any time.
| #define CAER_HOST_CONFIG_PACKETS -3 |
Module address: host-side event packets generation configuration.
| #define CAER_HOST_CONFIG_PACKETS_MAX_CONTAINER_INTERVAL 1 |
Parameter address for module CAER_HOST_CONFIG_PACKETS: set the time interval between subsequent packet containers. The value is in microseconds, and is checked across all types of events contained in the EventPacketContainer.
| #define CAER_HOST_CONFIG_PACKETS_MAX_CONTAINER_PACKET_SIZE 0 |
Parameter address for module CAER_HOST_CONFIG_PACKETS: set the maximum number of events any of a packet container's packets may hold before it's made available to the user. This is checked for each number of events held in each typed EventPacket that is a part of the EventPacketContainer.
| #define CAER_HOST_CONFIG_USB -1 |
Module address: host-side USB configuration.
| #define CAER_HOST_CONFIG_USB_BUFFER_NUMBER 0 |
Parameter address for module CAER_HOST_CONFIG_USB: set number of buffers used by libusb for asynchronous data transfers with the USB device. The default values are usually fine, only change them if you're running into I/O limits.
| #define CAER_HOST_CONFIG_USB_BUFFER_SIZE 1 |
Parameter address for module CAER_HOST_CONFIG_USB: set size of each buffer used by libusb for asynchronous data transfers with the USB device. The default values are usually fine, only change them if you're running into I/O limits.
| typedef struct caer_device_handle* caerDeviceHandle |
Reference to an open device on which to operate.
| bool caerDeviceClose | ( | caerDeviceHandle * | handle | ) |
Close a previously opened USB device and invalidate its handle.
| handle | pointer to a valid device handle. Will set handle to NULL if closing is successful, to prevent further usage of this handle for other operations. |
| bool caerDeviceConfigGet | ( | caerDeviceHandle | handle, |
| int8_t | modAddr, | ||
| uint8_t | paramAddr, | ||
| uint32_t * | param | ||
| ) |
Get the value of a configuration parameter.
| handle | a valid device handle. |
| modAddr | a module address, used to specify which configuration module one wants to query. Negative addresses are used for host-side configuration, while positive addresses (including zero) are used for device-side configuration. |
| paramAddr | a parameter address, to select a specific parameter to query from this particular configuration module. Only positive numbers (including zero) are allowed. |
| param | a pointer to an integer, in which to store the configuration parameter's current value. The integer will always be either set to zero (on failure), or to the current value (on success). |
| bool caerDeviceConfigSet | ( | caerDeviceHandle | handle, |
| int8_t | modAddr, | ||
| uint8_t | paramAddr, | ||
| uint32_t | param | ||
| ) |
Set a configuration parameter to a given value.
| handle | a valid device handle. |
| modAddr | a module address, used to specify which configuration module one wants to update. Negative addresses are used for host-side configuration, while positive addresses (including zero) are used for device-side configuration. |
| paramAddr | a parameter address, to select a specific parameter to update from this particular configuration module. Only positive numbers (including zero) are allowed. |
| param | a configuration parameter's new value. |
| caerEventPacketContainer caerDeviceDataGet | ( | caerDeviceHandle | handle | ) |
Get an event packet container, which contains events of various types generated by the device, from the USB data transfer thread for further processing. The returned data structures are allocated in memory and will need to be freed. The caerEventPacketContainerFree() function can be used to correctly free the full container memory. For single caerEventPackets, just use free(). This function can be made blocking with the CAER_HOST_CONFIG_DATAEXCHANGE_BLOCKING configuration parameter. By default it is non-blocking.
| handle | a valid device handle. |
| bool caerDeviceDataStart | ( | caerDeviceHandle | handle, |
| void(*)(void *ptr) | dataNotifyIncrease, | ||
| void(*)(void *ptr) | dataNotifyDecrease, | ||
| void * | dataNotifyUserPtr, | ||
| void(*)(void *ptr) | dataShutdownNotify, | ||
| void * | dataShutdownUserPtr | ||
| ) |
Start getting data from the device, setting up the USB data transfer thread and starting the data producers (see CAER_HOST_CONFIG_DATAEXCHANGE_START_PRODUCERS). Supports notification of new data and shutdown events via user-defined call-backs.
| handle | a valid device handle. |
| dataNotifyIncrease | function pointer, called every time a new piece of data available and has been put in the FIFO buffer for consumption. dataNotifyUserPtr will be passed as parameter to the function. |
| dataNotifyDecrease | function pointer, called every time a new piece of data has been consumed from the FIFO buffer inside caerDeviceDataGet(). dataNotifyUserPtr will be passed as parameter to the function. |
| dataNotifyUserPtr | pointer that will be passed to the dataNotifyIncrease and dataNotifyDecrease functions. Can be NULL. |
| dataShutdownNotify | function pointer, called on shut-down of the USB data transfer thread. This can be used to detect exceptional shut-downs that do not come from calling caerDeviceDataStop(), such as when the device is disconnected or all USB transfers fail. |
| dataShutdownUserPtr | pointer that will be passed to the dataShutdownNotify function. Can be NULL. |
| bool caerDeviceDataStop | ( | caerDeviceHandle | handle | ) |
Stop getting data from the device, shutting down the USB data transfer thread and stopping the data producers (see CAER_HOST_CONFIG_DATAEXCHANGE_STOP_PRODUCERS). This normal shut-down will also generate a notification (see caerDeviceDataStart()).
| handle | a valid device handle. |
| caerDeviceHandle caerDeviceOpen | ( | uint16_t | deviceID, |
| uint16_t | deviceType, | ||
| uint8_t | busNumberRestrict, | ||
| uint8_t | devAddressRestrict, | ||
| const char * | serialNumberRestrict | ||
| ) |
Open a specified USB device, assign an ID to it and return a handle for further usage. Various means can be employed to limit the selection of the device.
| deviceID | a unique ID to identify the device from others. Will be used as the source for EventPackets being generate from its data. |
| deviceType | type of the device to open. Currently supported are: CAER_DEVICE_DVS128, CAER_DEVICE_DAVIS_FX2, CAER_DEVICE_DAVIS_FX3 |
| busNumberRestrict | restrict the search for viable devices to only this USB bus number. |
| devAddressRestrict | restrict the search for viable devices to only this USB device address. |
| serialNumberRestrict | restrict the search for viable devices to only devices which do possess the given Serial Number in their USB SerialNumber descriptor. |
| bool caerDeviceSendDefaultConfig | ( | caerDeviceHandle | handle | ) |
Send a set of good default configuration settings to the device. This avoids users having to set every configuration option each time, especially when wanting to get going quickly or just needing to change a few settings to get to the desired operating mode.
| handle | a valid device handle. |


Welcome to Joshua Wood's portfolio site!
Thanks for visiting. Feel free to look around!
Explore
code
menu
Jump right to my projects!
Click the button below to check out what I've worked on.
Explore
code
menu
Josh Wood
call
703-459-3345
email
<EMAIL_ADDRESS>Connect
LinkedIn
GitHub
Site
Home
weekend
Portfolio
work
Resumé
photo_library