THE BITTER END
Join us for another sweet evening of a cappella at The Bitter End!
Join us for another sweet evening of a cappella at The Bitter End!
It's been a while since we've done a show at Alphabet Lounge, but we're happy to be heading back there.
Keep an eye out for us today around Manhattan! We'll be riding around on the top of a sightseeing bus branded for The Weather Channel's new morning show, "AMHQ with Sam Champion", and singing "weather-related" songs to everyone out on the street.
Join us for our first show of the year at Brooklyn's Trash Bar. Discounted advance tickets available online -- get yours today!
We'll be joining the ladies of Empire for a night of sweet a cappella tunes.
An unplugged set for the JCC's R&R program.
Private event.
An unplugged set for the JCC's R&R program.
Restated will be opening for Italian X-Factor winners CLUSTER—trust us, you don't want to miss this show!
Private event.
Come experience the aca-love in the City of Brotherly Love! We'll be performing in the Friday night CAL showcase, hosted by our friends from Keystone.
With hosts The Current, come see what NYC a cappella groups brought to their auditions for NBC's "The Sing Off."
An unplugged set for the JCC's R&R program.
An unplugged set for the JCC's R&R program.
Our 5th Anniversary show! With The Bridge and Empire.
VoCAL Nation 2012 is upon us! With Clearly Vocal, Cognitive Resonance, Empire, Euphonism, KeyStone, The Capital Hearings, The Seekers, and Cartoon Johnny.
Help us welcome our new friends Fermata Town on their first trip to NYC.


Chapter 15 Statistics for Categorical Data
library(PropCIs)
library(tidyverse)
library(binom)
library(pwr)
library(statmod)
library(EMT)
Biomedical research is full of studies that count discrete events.
A common mistake made by many researchers is to use statistics designed for measured variables on discrete count variables. For example, they transform count data into scaler measures (eg, percents, folds etc) and then apply statistics designed for continuous variables to events that are fundamentally discrete by nature. The problem with that is there are inherent differences in the behaviors of continuous and discrete variables. Therefore, it is important to recognize that there are statistical tests that can be used to analayze discrete data directly, without resorting to these transformations.
15.1 Types of categorical data
What proportion of cells express a specific antigen and does an experimental treatment cause that proportion to change? What proportion of rats treated with an anxiolytic drug choose one chamber over others in a maze test? How many people who express a certain marker go on to have cancer?
In these three scenarios the primary data are counts. All of the study results have integer values. The counts are categorized with variable attributes, thus they are called categorical data.
In fact, the three scenarios above are very different experimental designs. The first represent experiments that compare simple proportions. The second compare freqeuncies, and the third is an association study. The analysis of these require using a common suite of statistical tools in slightly different ways.
Broadly, all of these tools boil down to dealing with proportions. A few types of proportions (eg, odds ratio, relative risk) that can be calculated from these datasets are sometimes used as effect size parameters. Other times we’d use a confidence interval as a way of conveying an effect size. Statistical tests are then used to evaluate whether these effect sizes, or frequencies, or simple proportions, are extreme enough relative to null counterparts so that we can conclude the experimental variable had some sort of effect.
15.1.1 Proportions
We might…
Inactivate a gene hypothesized to function in the reproductive pathway. To test it, mating triangles would be set up to count the number of female mice that become pregnant or not.
Implant a tumor in mice, before counting the number of survivors and non-survivors at a given point later.
Mutate a protein that we hypothesize moves in and out of an intracellular compartment, before staining cells to count the number of cells where it is and is not located in a compartment of interest.
Each of the examples above have binomial
outcomes…pregnant vs not, dead vs alive, or inside vs outside.
In each case above, both the succesful and the failed events are counted in the experiment. A proportion is a simple ratio of counts of success to counts of failures.
15.1.2 Frequencies
Other kinds of counted data occur randomly in space and time. The examples below illustrate this. Note how only the number of events are recorded, rather than categorizing them as successes or failures. These counts therefore have the statistical property of frequency, such as counts per time or counts per volume or counts per area.
We can…
Expose a neuron to an excitatory neurotransmitter, then count the number of times it depolarizes over a given period of time.
In a model of asthma, count the number of immune cells that are washed out in a pulmonary lavage protocol after an immunosuppressive agent.
The key difference for these compared to binomial events is that their non-event counterparts are meaningless. For example, it is not possible to measure the number of depolarizations that don’t occur, or know the number of immune cells that don’t wash out in the lavage.
15.1.3 Associations
Lastly, the examples below illustrate the design of association studies, which are based upon, according to the null hypothesis, independent predictors and outcomes.
Here are some examples of association study designs:
You might wish to
identify causal alleles associated with a specific disease phenotype by counting the number of people with and without the disease, who have or don’t have a particular allelic variant.
determine if a history of exposure to certain carcinogens is associated with a higher risk of cancer by counting people with cancer who have been exposed.
know if a drug treatment causes a higher than expected frequency of a side-effect by counting the people on the drug with the side-effect.
In the simplest (and most general) case, association studies are 2X2 in design: A predictor is either present or absent as the row factor, and an outcome was either a success for a failure as the column factor. Subjects are categorized into groups on the basis of where they fall in the 4 possible combinations that such 2X2’s allow for.
It should be noted that higher order association studies are also possible, which can be either symmetric (eg, 3x3) or non-symmetric (eg,) 9X2, 2x3, and so on.
15.1.4 Statistics Covered Here
- Confidence intervals of proportions
- One-sample proportions test
- Two-sample proportions test
- Goodness of fit tests
- Tests of associations
- Power analysis of proportions (including Monte Carlo simulation)
- Plotting proportions with ggplot2
15.2 Exact v Asymptotic Calculations of p-values
The statistical tests for hypotheses on categorical data fall into two broad categories: exact tests (binom.test
, fisher.test
, multinomial.test
) and asymptotic tests (prop.test
, chisq.test
).
Exact tests calculate exact p-values. That’s made possible using factorial math. The prop.test
and chisq.test
generate asymptotic (aka, approximate) p-values. They calculate a \(\chi^2\) test statistic from the data before mapping it to a \(\chi^2\) probability density function. Because that function is continuous, the p-values it generates are asymptotically-estimated, rather than exactly calculated.
15.2.1 Choosing exact or asymptotic
As a general rule, given the same datasets and arguments, exact and approximate hypothesis test functions will almost always give you p-values that differ, but only slightly.
That’s usually not a problem unless you’re near a threshold value. Typically, an integrity crisis is evoked when that happens: “Which is”right???" Do you p-hack and choose the favorable one or not?
You should use the test you said you’d use when you first designed the experiment. And if you didn’t pre-plan…or at least have some idea about where you are going…recognize that the exact tests are more accurate.
Another issue that arises is how well the tests perform with low count numbers. For example, as a rule of thumb, avoid using the chisq.test
when the data have counts less than 5 in more than 20% of the cells because the accuracy of the chisq.test
is less at low cell counts. Use an exact test instead.
15.3 Overview of the types of hypothesis testing
We’ll go through each below in more detail, emphasizing practical experimental design and interpretation principles.
15.3.1 Proportion analysis
You can learn a lot about experimental statistics by thinking about proportions. So a lot of time is spent on it. Proportions are derived from events that can be classified as either successes or failures. Sometimes we want to compare simple proportions to decide if they are the same or not.
15.3.2 Goodness of fit testing
We do this when we want to compare the frequency distribution we observe in an experiment to the null expectation for that frequency distribution.
15.3.3 Contingency Analysis
Contingency analysis, otherwise known as tests of independence, are very different from goodness-of-fit test and simple proportion tests, in design and in purpose. They allow us to ask if two (or more) variables are associated with each other. Unlike a lot of the statistics we’ll deal with, there is a hint of a predictive element associated with these types of studies because the effect sizes we use to explain their results are related to odds and risk and likelihood. Which is not to say that we couldn’t use the same predictive concepts in proportions and goodness of fit testing.
Contingency tests are very common in epidemiology and in clinical science. You recognize by their names as cohort studies, case control studies, and so forth.
15.4 Comparing proportions
In their simplest use, the tests here can be used to compare one proportion to another. Is the proportion of successes to failures that results from a treatment different from the proportion that results from control? We’ll dive into this further below.
15.4.1 A Mouse T Cell Pilot Experiment: The Cytokine-inducible antigen gradstudin
Let’s imagine a small pilot experiment to see how a cytokine affects T cells. This is a very crude experiment designed mostly to illustrate some principles.
A cytokine is injected into a single mouse. There is no control injection, just one mouse/one cytokine injection. A time later, blood is harvested from the mouse to measure an antigen on T cells. Let’s call the antigen gradstudin.
Assume a method exists to detect T cells in the sample that express gradstudin and don’t express gradstudin.
That method implies some nominal
criteria are established to categorize
T cells as either expressing gradstudin or not. FACS machines are very useful for this. The machine typically produces continuous
fluorescent data, where intensity is proportional to gradstudin levels. But we don’t care about the magnitude of the expression level, we just care whether it is there or not.
Based upon our scientific expertise, we establish cutoff gating criteria above which fluoresence == gradstudin is present.
The machine therefore returns simple counts of both gradstudin-positive and gradstudin-negative cells.
15.4.2 Calculating Proportions
Here’s the data, counts of cells expressing and not expressing gradstudin. It is a very simple dataset:
pos <- 5042
neg <- 18492
A proportion is the count of a particular outcome relative to the total number of events. It’s customary to use the number of successes as the numerator. Whereas its customary to refer to the total number of events, n
, as the trial number rather than as sample size, but they mean the same thing.
n <- pos+neg #trial size
prop <- pos/n
prop
## [1] 0.2142432
15.4.3 What A Proportion Estimates
This sample proportion is descriptive statistic. It serves as a point estimate
of the true proportion of the population we sampled. The only way to know the true proportion would be to count every T cell in every drop of the subjects blood!
This point estimate is statistically valid if our sample meets two conditions. First, that this is a random sample of the T cells in the subject’s blood. Second, if we consider every T cell in the sample as statistically independent of every other T cell.
We can safely assume those conditions are met. Strictly, as an estimate this proportion only infers the population of blood borne T cells in that one subject. We really can’t generalize much further than that, including the composition of T cells in sequesterd compartments (thymus, nodes, etc).
Which is fine for our purposes now because we’re trying to keep this simple.
15.4.4 Confidence Intervals of Proportions
Confidence intervals (CI) have features of both descriptive and inferential statistics.
<IP_ADDRESS> Definition of a 95% CI
The 95% CI for a sample proportion represents a range of proportions within which 95% of the time we would expect the true population proportion.
There’s a lot going on there.
The value of the proportion we measured in the sample is a mathematical fact that is not in dispute. It is what it is. The question is, what does it represent?
Although there might be some error associated with measuring it, our single sample offers no real information about what that error might be. As an n=1 sample, there is no variation!
What is unknown is the true proportion of gradstudin+ T cells in the population we sampled.
CI’s are designed to give us some insights into that unknown.
95% CI’s are a range estimate
of what that true population proportion might be. CI’s are calculated in part upon the quality of the point estimate. In the case of proportions, the quality of the point estimate is driven by the size of the sample, the number of counts that are involved in calculating the proportion.
As you might imagine intuitively, the more counts we have in the sample, the more confidence we should have that our proportion provides a good estimate of the population’s proportion.
<IP_ADDRESS> Calculating CI with R
The PropCIs
package offers several ways to calculate a CI. Because of that, when publishing it is important is to state which CI method is used.
Is one better than the other? Sometimes, yes. For now, let’s not worry about that. Wilson’s score interval with continuity correction] is suggested as the most accurate for proportions.
Other methods are more commonly used than Wilson’s because they gained traction as being easier to compute by hand, and old habits die slowly.
Taking the data on cytokine induced gradstudin+ T cells, the chunk below illustrates how to use PropCIs
to derive a Wilscon score interval-based 95% CI:
scoreci(pos, n, conf.level=0.95)
##
##
##
## data:
##
## 95 percent confidence interval:
## 0.2090 0.2195
<IP_ADDRESS> Interpretation of a CI
The value of our sample proportion, 0.214, falls within this 95% CI. That’s not a big surprise, given the 95% CI was calculated from our proportion!
On the basis of the sample proportion, we can conclude from this CI that there is a 95% chance the true proportion of gradstudin positive T cells falls within this very narrow range.
<IP_ADDRESS> Using the CI as a quick test of statistical significance.
Let’s say, for example, that we have tremendous experience and great scientific reason to expect to see under normal conditions that only 15% of T cells would be gradstudin-positive normally. Does our sample proportion differ from that expectation?
Since a proportion of 0.15 is not within the 95% CI calculated above, we can conclude that the cytokine-induced sample proportion differs from this expectation at the 5% level of statistical significance.
We just did a statistical test, without running any software (sorta) or generating any p-values!! And it is perfectly valid inference.
15.4.5 A One-Sample Proportion Test
We’ll use prop.test
to run a test that generates a p-value to decide if the sample proportion we have above differs from 0.15.
<IP_ADDRESS> Hypothesis Tested in a One-Sample Proportion Test
In this test the sample antigen-positive proportion is compared to a theoretical proportion. If the typical proportion of antigen-positive T cells within a blood sample is 15%, is the result after cytokine treatment different from this proportion?
Let’s say that our scientific hypothesis going into all this is that the cytokine induces the antigen on T cells. Since we are predicting an increase, we should establish a one-sided alternative (thus using greater
as an argument in prop.test
below) as our statistical hypothesis.
Our statistical hypothesis is the null. We’ll decide whether or not to reject the null on the basis of the test results. Philosophically, we’re using a falsification method.
The statistical alternate hypothesis: \(\pi>15\%\)
The statistical null hypothesis: \(\pi\le15\%\)
We use Greek notation to represent the ‘true’ population proportion. This reminds us that a statistical hypothesis is an inferential test about the population proportion.
Again, there is no question that the sample proportion differs from a proportion of 15%. 21% != 15%. That’s a simple numerical fact. Statistical tests are not necessary to make that assertion.
On the basis of the sample proportion p, we’d like to draw inference on the composition of all of the T cells in the blood of the subject. Thus, the sample p is only an estimate of a true \(\pi\) (which we notate using Greek letters).
Statistical testing allows us to generate some insight into the reliability of our estimate.
The chunk below lays out these arguments using R’s prop.test
function:
#pos and n in the test arguments are objects that were defined above!
prop.test(
pos, n, p=0.15,
alternative = "greater",
conf.level = 0.95,
correct = TRUE
)
##
## 1-sample proportions test with continuity correction
##
## data: pos out of n, null probability 0.15
## X-squared = 761.29, df = 1, p-value < 2.2e-16
## alternative hypothesis: true p is greater than 0.15
## 95 percent confidence interval:
## 0.2098559 1.0000000
## sample estimates:
## p
## 0.2142432
<IP_ADDRESS> Interpreting one-sample prop.test output
Like all statistical tests, this one is evaluated under the assumption that the null hypothesis is true. We use the test outcome to decide whether the null hypothesis should be rejected.
The prop.test
conducts a chi-square analysis. The value of \(\chi^2\) for this sample is very large.
The p-value represents the probability of obtaining a \(\chi^2\) value as larger or larger then what is calculated from our sample.
If the null hypothesis is true in this case, the probability of a \(\chi^2\) value as large or larger than we obtained is 2.2e-16, which is very, very low.
The 95% CI is 0.2098 to 1.0. There is a 95% chance the population proportion is greater than 0.2098. The reason it differs from the Wilson’s CI calculated above is that we used greater
as a one-sided hypothesis argument in the prop.test. These CI’s from one-sided hypothesis tests are not particularly useful when attempting to use the CI as an index of accuracy.
<IP_ADDRESS> How to write this up
The proportion of gradstudin positive T cells after cytokine treatment in the subject differs from an expected value of 0.15 (one-sided one-sample proportions test, p-value=2.2e-16, 95% CI = 0.209 to 1.0)
Notice how I didn’t say “significantly” or “statistically significantly” or some such. Whether an outcome is signficant or not should be a scientific assertion, rather than statistical.
<IP_ADDRESS> An exact test for one proportion
R’s binom.test
function is an exact test for whether a proportion differs from a theoretical expectation. It compares proportions using an entirely different procedure.
As a one-proportion test the binom.test
gives an exact p-value derived from the binomial distribution, whereas the prop.test
gives approximate p-values because it uses the chi-square distribution.
That distinction is hard to see with our examples here, but the differences will become more noticable when analyzing samples with far fewer events.
Here’s the binomial test run on two different proportions. In each, the test is comparing the experimental proportion to the proportion value of 0.15.
binom.test(pos, n, p=0.15)
##
## Exact binomial test
##
## data: pos and n
## number of successes = 5042, number of trials = 23534, p-value <
## 2.2e-16
## alternative hypothesis: true probability of success is not equal to 0.15
## 95 percent confidence interval:
## 0.2090155 0.2195416
## sample estimates:
## probability of success
## 0.2142432
binom.test(x=567, n=1778, p=0.15)
##
## Exact binomial test
##
## data: 567 and 1778
## number of successes = 567, number of trials = 1778, p-value <
## 2.2e-16
## alternative hypothesis: true probability of success is not equal to 0.15
## 95 percent confidence interval:
## 0.2972673 0.3411272
## sample estimates:
## probability of success
## 0.3188976
15.4.6 Comparing Two Proportions
We can stick with the T cell-cytokine-gradstudin scenario, but let’s change up the experiment a tad.
Let’s imagine we’ve withdrawn a sample of blood from a subject and enriched for T cells. Half of the sample is exposed in vitro to a cytokine for a few hours. The other half is exposed to vehicle as a control. We count the gradstudin-positive and gradstudin-negative T cells in both groups.
We now have a predictor group at two levels (treatment = vehicle or cytokine) and an outcome group at two levels (antigen = positive or negative)
<IP_ADDRESS> Hypothesis Tested
Let’s test the hypothesis that the proportion of postive T cells in the two samples differ. The choice is not to test whether one proportion is greater than the other. We just want to know if they differ.
The statistical hypotheses here differs from the one sample hypotheses in two ways.
First, notice how we’re comparing the population proportion of cytokine- to that for vehicle-treatment.
Second, we’re making this a two-tailed (two.sided
) test instead of one-tailed (greater
).
The statistical alterate hypothesis: \(\pi_c\ne\pi_v\)
The statistical null hypothesis: \(\pi_c=\pi_v\)
A second way of writing these hypotheses to say the same thing:
Alternate: \(\pi_c-\pi_v\ne0\)
Null: \(\pi_c-\pi_v=0\)
<IP_ADDRESS> Running the test
Let’s say that here are the outcome data: gradstudin-positive, gradstudin-negative, total Cytokine-treated: 567, 1211, 1778 Vehicle-treated: 412, 1485, 1897
The data can be dumped directly into prop.test
. Normally we’d run this at 0.95 confidence level (type1 error of 5%). Let’s say we have good scientific reasons to run this test at a much more stringet threshold level for type1 error, because we’re really hoping to avoid a false positive:
prop.test(
x=c(567, 412),
n=c(1778, 1897),
conf.level=0.9999999
)
##
## 2-sample test for equality of proportions with continuity
## correction
##
## data: c(567, 412) out of c(1778, 1897)
## X-squared = 48.066, df = 1, p-value = 4.121e-12
## alternative hypothesis: two.sided
## 99.99999 percent confidence interval:
## 0.02364902 0.17977620
## sample estimates:
## prop 1 prop 2
## 0.3188976 0.2171850
<IP_ADDRESS> Interpretion of Two-Sample proportions test output
This test is evaluated under the assumption that the null hypothesis is true. The test results helps us decide whether the null hypothesis should be rejected. We’ll do that if the p-value is less than our type1 error threshold.
The prop.test
conducts a chi-square analysis using the Yates continuity correction. This \(\chi^2\) value is very large; extremely large.
The p-value represents the probability of obtaining a \(\chi^2\) value as larger or larger than that by chance. If the null hypothesis is true in this case, the probability of that sized \(\chi^2\) value is 4.12e-12, which is very low, and still much lower than our type1 error threshold.
We can reject the null.
If we subtract prop2 from prop1 we get a value of about 0.1017, as a point estimate for the difference between the two proportions.
The 99.99999% CI for the difference between two proportions does not include the value of 0. Since the 99.99999% CI does not overlap with 0, we can conclude from it alone that there is a difference between the two proportions. Even at this extremely high confidence level!!
<IP_ADDRESS> Write Up
The proportion of gradstudin positive T cells after cytokine differs from that in vehicle treated cells (two-sided two-sample proportions test, p-value=4.12e-12, 99.99999% CI for proportion difference = 0.023 to 0.179)
Note how we don’t say “statistically significantly different”.
Notice also how the 99.99999% CI is very wide. It would be narrower if run at a 95% confidence level. Why?
15.5 Exact tests for two proportions
An alternative to prop.test
to compare two proportions is the fisher.test
, which like the binom.test
calculates exact p-values.
The fisher.test
requires that data be input as a matrix or table of the successes and failures, so involves a bit more munging.
We need to make a matrix of the data first, then perform the fisher.test
on that matrix: gradstudin-positive, gradstudin-negative, total Cytokine-treated: 567, 1211, 1778 Vehicle-treated: 412, 1485, 1897
Notice below that here we’re entering the successes and the failures in the matrix. We’re tagging the matrix with some dimension names so it doesn’t get confusing.
M <- matrix(
c(567, 412, 1211, 1485),
nrow=2,
dimnames = list(
Treat=c("Cytokine", "Vehicle"),
Antigen=c("Positive", "Negative")
)
)
M
## Antigen
## Treat Positive Negative
## Cytokine 567 1211
## Vehicle 412 1485
fisher.test(M)
##
## Fisher's Exact Test for Count Data
##
## data: M
## p-value = 3.433e-12
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 1.451760 1.962188
## sample estimates:
## odds ratio
## 1.687312
Notice the output differs from the prop.test. In adddition to a p-value, the Fisher test produces an odds ratio and its confidence interval. The p-value leads to the same result and write-up as for the two proportion test. The odds ratio could be interpreted like this:
The cytokine increases the odds of gradstudin+ T cells by 1.687 compared to vehicle treatment (Fisher’s Exact Tet for Count Data, p = 3.433e-12, OR 95% CI = 1.45 to 1.96).
15.6 Goodness of fit Tests
Goodness-of-fit tests are useful for testing hypotheses about patterns of counts in time or space…whether the distribution of their observed frequencies differs from expectations of a null case. In other words, do they occur in a non-random pattern?
There is no independent variable in these tests.
The shape of these datasets is either as 1 row or 1 column, where every cell is a time or space and the cell value is the the number of counts that occured in that time or space.
Either the multinomial.test
(for exact p-values) or the chisq.test
(for approximate p-values) can be used for Goodness-of-fit testing. The latter is most commonly used.
These designs compare the disribution of events to a hypothetical (or expected) model null distribution of those events.
These expected counts are entered in the test script as a prop
or p
argument. This can be confusing. It’s important to recognize you should enter a vector of null probabilities in p or prop! Don’t enter the counts you hope to see if the test were positive!!!
Say we had a spatial memory test in which 28 independent subjects are placed into a maze for testing (one at a time) and we count which of 4 chambers they enter first. They do so at the following frequencies: A=14, B=3, C=7, D=4. Does this frequency distribution differ from the null expectation, A=7, B=7, C=7, D=7, where no chamber is more likely to be entered than another?
Failure is not an option in this design! Only successes are counted. Given enough time, a subject will always choose a chamber (iIf one fails the task, it should be censured).
Let’s test this at the 5% type1 error threshold:
15.6.1 An Exact Goodness of Fit test
NB:The multinomial.test function requires you to assert the null frequency distribution explicitly and as fractions whose sum is 1.
x <- c(A=14, B=3, C=7, D=4)
prob <- c(A=.25, B=.25, C=.25, D=.25)
multinomial.test(
x,
prob=prob
)
##
## Exact Multinomial Test, distance measure: p
##
## Events pObs p.value
## 4495 1e-04 0.0235
Note on the multinomial.test
output: Please see this site for further information on what is represented by events (its a combination result–a metric of the computation it took to do this) and pObs (its a multinomial probability).
We’re only intersted in the p-value, since we’re using this function as an exact goodness-of-fit hypothesis test for the null hypothesis.
Why use an exact test rather than a chisq.test
? Because we have two cells in the dataset with counts < 5! An exact p-value test will be more accurate than chisq.test
.
The test compares our sample frequency distribution to that in the null model. We actually wrote the latter explicitly in the function argument: null is uniform distribution–the subjects are equally likely to enter each chamber.
H0: The probability of choice is equal for each chamber. \(\pi_A=\pi_B=\pi_C=\pi_D\) H1: The probability of choice is not equal for each chamber. \(\pi_A\ne\pi_B\ne\pi_C\ne\pi_D\)
(Note: this is an omnibus test. It doesn’t explicity tell us which chambers are preferred by the subjects.)
Because the p-value is less than 0.05, we reject the null hypothesis and conclude that the chamber choice is not equitable across the four options.
<IP_ADDRESS> Write up
In a 4 chamber maze test, the subjects displayed a clear, non-uniform chamber preference (Exact Multinomial Test, n=28, p=0.0235) Note how this implies the null hypothesis.
15.6.2 An Approximate Goodness of Fit test
The \(\chi^2\) test of the same data is really simple to execute. It offers the same conclusion, but note how the p-value is very different.
Note also that we didn’t enter the null frequency argument. The chisq.test
function will coerce the null distribution if it is not entered as an argument explicitly, as you can see from the output for the second line. If for some reason to test against a non-uniform null distribution, you’ll need to write that in your argument explicitly (eg, p = c(A=0.5, B=0.25, C & D = 0.125).
chisq.test(x)
##
## Chi-squared test for given probabilities
##
## data: x
## X-squared = 10.571, df = 3, p-value = 0.01428
<IP_ADDRESS> Write up
The interpretation is no different than for the exact test. The write up is:
In a 4 chamber maze test, the subjects displayed a clear chamber preference (Chi square test for uniform probabilities, \(\chi^2\)=10.571, df=3, p=0.01428)
15.7 Contingency Testing
Contingency testing is for deciding whether two or more variables are associated or not. These either explicitly (ie, when using fisher.text
) or implicity (ie, when using chisq.test
) use ratio’s of proportions–the odds ratio, or relative risk, or the likelihood ratio, or sometimes other proportions–as parameters that express the magnitude of these associations.
In other words, the hypothesis test asks whether these ratio’s of proportions are more extreme than the null (which would be 1).
Let’s take the cancer marker data from the contingency analysis lecture. As you recall, a marker has been discovered that is hoped to be strongly associated with cancer. 100 people were tested for whether or not they have the marker, and whether or not they go on to have cancer.
We’ll create a simple matrix then pass it through the fisher.test
function to illustrate the procedure and interpretation.
x <- matrix(
c(14, 16, 6, 64),
ncol=2,
dimnames = list(
Marker=c("Present", "Absent"),
Cancer = c("Present", "Absent")
)
)
x
## Cancer
## Marker Present Absent
## Present 14 6
## Absent 16 64
fisher.test(x)
##
## Fisher's Exact Test for Count Data
##
## data: x
## p-value = 3.934e-05
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 2.762514 33.678765
## sample estimates:
## odds ratio
## 9.061278
#more argument customization than this is possible
15.7.1 Intepretation of Contingency Results
The odds of a person with the marker having cancer are 9.06 times greater than that for those who don’t have the marker.
There is a 95% chance the true odds ratio in the population is between 2.76 and 33.68.
There is an association between the presence of this marker and the probability that cancer occurs.
15.7.2 Write Up
The large OR indicates the presence of this marker is strongly associated with cancer (n=100, OR = 9.06, 95% CI = 2.76 to 33.68, Fisher’s Exact Test for Count Data, p = 3.934e-05).
The word “strongly” is used to emphasize the effect size, which is OR, not the smallness of the p-value.
Here are the other tests you might use to conduct for a contingency analysis, to illustrate how they differ: `
x <- matrix(
c(14, 16, 6, 64),
ncol=2,
dimnames = list(
Marker=c("Present", "Absent"),
Cancer = c("Present", "Absent")
)
)
x
## Cancer
## Marker Present Absent
## Present 14 6
## Absent 16 64
prop.test(x)
##
## 2-sample test for equality of proportions with continuity
## correction
##
## data: x
## X-squared = 16.741, df = 1, p-value = 4.284e-05
## alternative hypothesis: two.sided
## 95 percent confidence interval:
## 0.2496194 0.7503806
## sample estimates:
## prop 1 prop 2
## 0.7 0.2
chisq.test(x)
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: x
## X-squared = 16.741, df = 1, p-value = 4.284e-05
chisq.test(x, correct=F)
##
## Pearson's Chi-squared test
##
## data: x
## X-squared = 19.048, df = 1, p-value = 1.275e-05
First, note that the prop.test is just the chisq.test. You get the same \(\chi^2\) value and p-value for each. They just differ in parameter output and input options. If you’d like a confidence interval (you should), use prop.test
.
Second, note how turning off the Yates continuity correction changes the \(\chi^2\) value and the p-value. That’s to be expected, it changes the calculation! Both the prop.test and chisq.test use Yates by default. The best way to think about Yate’s is that it acts as a smoothing function to take off some of the jigger in the calculation of the \(\chi^2\) value.
15.7.3 Interpretation of chi-square output
There is an association between the presence of this marker and the probability that cancer occurs.
We could take the prop test’s calculation of the proportions and their difference, along with the 95% CI of their difference and make some hay out of that (the probability of getting cancer with the marker is 70%, and without the marker is 20%). But it’s more customary to use the odds ratio or relative risk rather than differences between probabilities to make effect size assertions.
15.7.4 Write Up
You would want to derive the odds ratio and its 95% CI, even though the \(\chi^2\) test doesn’t produce it for you. The easiest way to do that is with fisher.test
.
Having that:
The large OR indicates the presence of this marker is strongly associated with cancer (n=100, OR = 9.06, 95% CI = 2.76 to 33.68, Pearson’s Chi-square test with Yate’s continuity correction, p = 4.284e-05).
As before, the word “strongly” is used to emphasize the effect size, which is the OR, rather than the extremeness of the p-value.
15.7.5 Which contingency test is best?
With so many options, the question that always arises is which is best to use for contingency analysis?
The answer is, * make this decision in advance and use what you said you would use before you started the experiment. * when it comes to p-values, are you an exactophile or an exactophobe? * for datasets with low cell numbers (eg, counts less than 5 in a cell), exact tests tend to provide more accurate p-values. * the fact that fisher.test
generates the OR and its CI is very, very convenient.
I prefer the fisher.exact test. However, in R you’ll need to understand how to configure its arguments to get it to work on higher dimension contingency tables (eg, 2x3, 3x2, 3x3, etc).
15.7.6 Higher dimension contingency analysis
Not infrequently we have studies with many levels of a predictor variable and two outcomes (eg, 7x2), or two predictors and more than two outcomes (eg, 2x3). For these, you’ll find the chisq.test
works fairly automagically. In contrast, you’ll need to customize arguments in fisher.test
for it to pass in anything other than a 2x2 matrix.
Furthermore, with dimensions higher than 2x2 there is more than a single odds ratio or relative risk or likelihood ratio in higher dimensions to be computed.
A step-wise approach for these more complex analyses is to first run an omnibus chisq.test
on the intact dimension. If the test is positive (low p-value), analyze 2x2 segments of the grid post hoc using the fisher.test
to derive odds ratios and to see which of the proportion ratio’s explain the significance. Such post hoc analyses must include correction for multiple comparisons (eg, the Bonferroni correction) when drawing inference. To do this, pass a vector of p-values into the p.adjust
function.
15.7.7 Other experimental designs involving categorical data
Imagine an experiment to compare two or more conditions (eg, placebo v drug, wildtype vs mutant) and the outcome variable is discrete (eg, frequency counts or success and failure counts). The experiment involves several independent replications.
For example, cell depolarizations are counted both in the absence or presence of a condition on several different occassions.
| replicate | predictor | counts |
|---|---|---|
| one | wildtype | 87 |
| two | wildtype | 102 |
| three | wildtype | 105 |
| one | mutant | 125 |
| two | mutant | 126 |
| three | mutant | 139 |
Alternately, the fraction of cells in a culture dish that have died in the absence or presence of a condition is repeated a handful of times.
| replicate | predictor | alive | dead |
|---|---|---|---|
| one | wildtype | 30 | 67 |
| two | wildtype | 33 | 73 |
| three | wildtype | 37 | 76 |
| one | mutant | 65 | 38 |
| two | mutant | 56 | 36 |
| three | mutant | 62 | 42 |
The key distinction here, compared to what’s been discussed in this chapter up to this point, is that within each replicate, all of the events are intrinsically-linked. Through replication we’re establishing whether the events are repeatable.
Logistic (for dichotomous data) or poisson (for frequency data) regression are the appropriate analytical tools for these designs. These involve using the generalized linear model, conducted with the function glm
or the function glmer
(for so-called mixed models). These are discussed in the logistic regression chapter.
15.8 Doing a priori power analysis for proportion tests
Power analysis should be done before starting an experiment. The purpose of a conducting power calculations a priori is to determine the number of trials, or subjects or sample size, to use for the study.
This is a two step process.
Step 1: Using scientific judgement, decide what is the value of a null proportion and an alternate that you think would be a scientifically meaningful proportion to observe. You need to have some insight into the system you’re studying to make these calls. What’s important is to establish an expectation of what a minimally scientifically significant outcome would look like.
Step 2: Calculate the number of subjects (or trials) you’ll need to study, given these proportions (and also given some type1 and type2 error tolerances).
There are several options in R for the second step.
In the examples below, we’re declaring a 5% difference between the null (0.15) and alternate (0.20) proportions would be a scientifically meaningful. We’re also using 5% for type1 error and 20% for type2 error (80% power) as tolerance thresholds.
15.9 Power analysis functions for proportion tests
The function pwr.p.test
is for one-sample proportion tests. The calculations below return a sample size n that should be used in the study, given a null and an alternate proportions, in addition to error rates.
NB: Since takes a Cohen’s effect size as an argument, you 1st must calculate a Cohen effect size, h, given the alternate and null proportions you expect, using Es.h()
. Then plug that effect size into the power calculator.
h <- ES.h(0.2, 0.15)
h
## [1] 0.1318964
pwr.p.test(
h,
sig.level=0.05,
power=0.8,
alternative="two.sided"
)
##
## proportion power calculation for binomial distribution (arcsine transformation)
##
## h = 0.1318964
## n = 451.1706
## sig.level = 0.05
## power = 0.8
## alternative = two.sided
binom.power
is a function from the binom
package. Instead of returning sample size, this function returns power, given sample size. You iterate through (by hand) entering sample sizes until it returns an acceptable power. Then run the experiment at that sample size.
Note that it doesn’t give exactly the same result as pwr.p.test
. The calculation differs, but the result is close.
binom.power(
0.2,
n=451,
p=0.15,
alpha=0.05,
alternative = "two.sided",
method="exact"
)
## [1] 0.7908632
To estimate sample size needed for a two-sample proportion test design, use the power.prop.test
function.
power.prop.test(
p1=0.15,
p2=0.2,
sig.level = 0.05,
power=0.8
)
##
## Two-sample comparison of proportions power calculation
##
## n = 905.3658
## p1 = 0.15
## p2 = 0.2
## sig.level = 0.05
## power = 0.8
## alternative = two.sided
##
## NOTE: n is number in *each* group
Finally, the statmod
package has the power.fisher.test
, which returns the power for a Fisher’s exact test, given arguments of proportion, trial size and type1 error. Note how it is in close but not exact agreement with power.prop.test
.
power.fisher.test(
0.15, 0.2, 905, 905, 0.05,
alternative = "two.sided"
)
## [1] 0.81
<IP_ADDRESS> Monte Carlo power simulations
Monte Carlo’s are very simple.
The basic gist is to simulate and test a very large number of experiments. Each of these experiments is comprised of a random sample of some size, corresponding to your minimal effect size you define as scientifically meritorious.
These are run through the test of significance, to calculate a p-value. The fraction of simulations that are “hits”–for example, that have p-values < 0.05, is the power!
Simulations are re-run by adjusting the sample size until a desired power is achieved. That’s the sample size you’d use in a real experiment!
The question the script addresses is this: What is the power of an experiment, given this trial size n, the null and alternate proportions evaluated, and the type1 error threshold?
If n is too low, the test will return a power below 0.8 meaning it is not adequetely powered to test the difference between the null and alternate proportions.
Iterate through some a few sample sizes (n) until you arrive at an acceptable value for power.
<IP_ADDRESS>.1 monte carlo simulation for prop.test power
#these are the initializers
#number of experiments to simulate, each of trial size n
sims <- 1000
#expected null proportion
null <- 0.15
#expected minimal effect proportion
alternate <- 0.20
#binomial trial size, just a guess
n <- 450
#type 1 error threshold
alpha <- 0.05
#s1 is a random sample vector
#each value is the number of
#successes observed in a trial
#of size n, given the alternate proportion.
#it simulates the outcome of one experiment "sims" times
s1 <- rbinom(sims, n, alternate)
#t1 is a vector of p-values,
#derived from a one sample proportion test
#on each of the values in s1.
#read from inside the function to see the logic
t1 <- unlist(
lapply(
s1,
function(s1){
prop.test(
s1, n, null,
alternative="two.sided",
conf.level=1-alpha,
correct=T)$p.value
}
)
)
power <- length(which(t1 < alpha))/sims
power
## [1] 0.789
15.10 Graphing Proportions
(needs improvement…add mosaic plots)
Here’s a few ggplot2-based ways of visualizing proportion data.
First thing is to create a dataframe of the proportion data since data fed into ggplot2 must be in dataframe format.
prop.df <- data.frame(
group=c("positive", "negative"),
value=c(pos, neg)
)
prop.df
## group value
## 1 positive 5042
## 2 negative 18492
<IP_ADDRESS>.1 Simple stacked bar chart
ggplot(
prop.df,
(aes(x="",
y=value,
fill=group)
)
) +
geom_bar(stat="identity")
<IP_ADDRESS>.2 Side-by-side bar chart
Note: There is no error to report. There’s no variation. Cells were classified as either having or not having the antigen.
ggplot(
prop.df,
(aes(
x=group,
y=value,
fill=group)
)
) +
geom_bar(stat="identity")
..


--- short: t-filesfilter type: transformer color: indigo title: Files filter description: Filters input files by file name. ---
Transformer, allows the user to filter files by file name using Java regular expressions.
The {{page.title}} component takes the input files and only passes on those matching the specified filter. The filters use the Java regular expressions. You can test your regular expressions here.


| password: | |
| guesses: | |
| guesses_log2 (bits): | |
| guesses_log10: | |
| score: | |
| function runtime (ms): | |
| 100 / hour: | |
| 10 / second: | |
| 10k / second: | |
| 10B / second: |
| password: | |
| guesses: | |
| guesses_log2 (bits): | |
| guesses_log10: | |
| score: | |
| function runtime (ms): | |
| 100 / hour: | |
| 10 / second: | |
| 10k / second: | |
| 10B / second: |
Implementation of Dropbox's password strength estimator zxcvbn, comparing the old algorithm to the new one. I built this because I love zxcvbn, but I'm not a fan of the changes to calculating complexity. The checks are performed locally on your machine, and you can disconnect your internet connection. Although I wouldn't blame you for not trusting it with your actual passwords.
Here are some rough guidelines for speeds of different attacks.
online attack on a service that ratelimits password auth attempts: 100 / hour
online attack on a service that doesn't ratelimit, or where an attacker has outsmarted ratelimiting: 10 / second
offline attack, proper user-unique salting, and a slow hash function, such as bcrypt, scrypt, PBKDF2: 10k / second
offline attack with user-unique salting but a fast hash function like SHA-1, SHA-256 or MD5: 10B / second


You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.
You can use the overflow property when you want to have better control of the layout. Try to change the overflow property to: visible, hidden, auto, or inherit and see what happens. The default value is visible.


---
layout: page
title: "关于我"
description: "Hey, This is Rain Chen"
header-img: "img/about-bg.jpg"
---
写写代码，看看美剧，生活简单无趣
世界没那么大，我想宅在家。
无聊到透顶的人
做过的一些东西，右转
Project 👉
最后附上认真版的简历:
Designer or Engineer, things in between.
Some of my projects is put on my
Project 👉
Interested in more details? Checkout my resumes:


--- layout: post title: Web dev links tags: [] status: draft type: post published: false meta: {} ---
A set of links to good web development sites and topics (all fields)


I served in the U.S. Navy for 7 years, after that I followed my humanitarian passion and started bartending. I currently bartend at Husky stadium, Seattle convention center and Centurylink Field. Those jobs are mostly on weekends so I came to Code Fellows to start a career that I could do throughout the week to supplement my income.
I studied physics at WSU, and love dogs. I'm trying to move to being a backend developer because I've always loved solving problems, whether it be math, physics, chess or algorithms.
I obtained my BA in Environmental Policy from Fordham University in 2014. I’ve recently changed my career path to become a dev and I’m so happy to be at Code Fellows!
Graduate from high school last year, took some time of to find out what I wanted to do. Code fellows was recommended to me and I decided to try it out with my brother and sister, and now try to make this my career.


Spring Data
Created by Jonathan Kupcho
About me
- Using Spring since 2010
- Fullstack Dev
- Java by Day, JavaScript by Night
What we'll cover
- What is it?
- Why use it?
- Demo
What is it?
- Umbrella Project
- Common Conventions
- *Just Works* with Spring
Why use it?
- Abstracts common configuration
- Testability first class citizen
- Spring Boot sensible defaults
- Community Support


Enemy of the State, starring Will Smith, Gene Hackman and Jon Voight 2 1/2 stars out of 4
Depending on your level of paranoia, you will either scoff at Enemy of the State or check your toothbrush, smoke alarm, cell phone and various items of clothing to see if Big Brother is indeed monitoring every moment of your life.
Enemy of the State builds upon the concept that ours, because of video camera, spy satellites and other technological marvels, is a world in which privacy is a quickly becoming an illusion.
As chief villain Jon Voight explains, soon the only privacy will be what's in your head.
As the film opens, a congressional committee is looking at a bill that will allow the government to conduct unfettered surveillance of its citizens.  Thus the justification for the bill's passage.
To get what he wants, Voight, a top government official, resorts to murder. Unbeknownst, at least at the outset, to Voight and his team of techno-nerds, is that the crime was caught on tape.
This discovery sets off a chain of events that eventually involves Robert Dean (Will Smith), a labor lawyer whose life is turned upside down - and for most of the proceedings he doesn't even know why.
It seems he was slipped a copy of the incriminating footage copied onto a computer disk, and Voight's operatives are trying to retrieve it wouth tipping their hands.
What makes Enemy of the State work, and it does up until the last reel, is the little voice it sets off in the back of your mind. Sure, it's fiction, a movie.
But, does the government have the capabilities to watch our every move, and if it does, are we being spied upon right now.
The movie plays off the now common usage of video cameras everywhere - in restaurants, department store changing rooms, sky cams, cameras that monitor busy intersections.
Do they all feed into a mainframe somewhere that the government can log onto the check up on us? Possible, but highly, improbable. Or is it?
Eventually Dean teams up with a former operative (Gene Hackman) and all is made right with the world - or at least Dean's portio of it.
Director Tony Scott keeps the paranoia level high, continually showing scenes of a spy satellites being moved around merely to spy on one individual, while his operatives plant bugs and transmitters on Dean's clothes, shoes, phone and pen.
But eventually Scott and and his four screenwriters run out of imagination and resort to a ludicrious finale involving a stereotypical Mafia boss, who acts like a grade Z Don Corleone.
This nearly destroys all the nearly one hour and 45 minutes that lead up to this point.
Smith works very well as the confused, but determined lawyer who is in over his head, and completely unaware of the machinations going on around him.
As in Independence Day and Men in Black, Smith works best when paired with an older, more experienced actor. In ID4 it was Jeff Goldblum, Tommy Lee Jones created chemistry in Men in Black, and in Enemy of the State, Smith teams with Hackman, as a disheveled, semi-paranoid ex-operative who helps Dean regain his life and in the process, gets one for himself.
The real treat is watching the young supporting actors who play Voight's team of computer nerds who treat the entire affair as if it the planet was their own private video screen and we were all pawns they could move around in a game of life and death.
They're not evil, per se, just deadened. They have lost their humanity to their computers and are either unconcerned or unaware of the havoc they wreak.
Enemy of the State is a colorful political thriller. You may find it perposterous or you may think it hits too close to him - maybe too close. Either way, after seeing it, you'll be more conscious of the technology surrounding you.
Bob Bloom is the film critic at the Journal and Courier in Lafayette, Ind. He can be reached by e-mail at<EMAIL_ADDRESS>The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


Part 1: Review
- Object literals: for packaging values
- JavaScript中的OO 是基于对象的编程
- 更加接近OO的本质，OO其实不需要类这个概念
- Slots can hold any value, including functions
- Closures: functions on out-of-scope variables
i18n
- i18n stands for internationalization
- "Factor out" choice of language
- Here's a tiny example using an object literal
- Can you modify it to speak French instead?
Answer: i18n
- Just switch the object assigned to g
- We're swapping one "module" for another
Function Slots
- Slots(槽位) can hold any kind of value, including functions
- 这里就是对象属性，slots是传统对象编程的术语
Slot machine
- Here's a function that returns an object
- On object-oriented settings, called a constructor
- 返回对象的函数被称为构造函数
- Can you change it to greet you by name instead?
Answer: Slot machine
- Just change the argument to Greeter
Counting closures
- Our old friend the counter, with an initial value
- Note update to i, which is out of scope when Counter returns
- Can you make it count backwards from 10?
Answer: Counting closures
- Here's the answer: subtract one in the closure instead
- Start at 11, since it subtracts before printing
Part 2: Objects and Methods
- Methods: slots holding functions
- Accessing an object via methods alone
- Encapsulation of state
Up and down
- An object with slots holding functions
- These functions are called methods
- 对象的属性如果是函数，称为方法
Banking
- Same idea, this time for a bank account
- Try and withdraw too much money and see what happens
Answer: Banking
- If you withdraw too much, prints "no" and doesn't reduce balance
Attacking the Bank
- Can a robber reduce the balance without a withdrawal?
- No way to set bal from outside; it's encapsulated
- 无法直接修改bal的值, 它是一个 封装值
An Aside: Secure Banking
- Can't modify balance, but can break the bank anyway
- To fix this, can call Object.freeze(a): try it!
- 调用Object.freeze(a)方法，冻结对象，防止修改
More: Secure Banking
- Here's the same code, with freeze
- In practice, call freeze inside the constructor
Part 3: Sharing and Aliasing
- When two variables point to one object
- 对象的共享与别名，两个变量指向同一对象
- Idea is often confusing to novices
- Unexpected sharing is often confusing to experts
Bank Accounts
- How many account objects are there?
- What happens to a2 when you deposit in a1?
Answer: Bank Accounts
- How many account objects are there? Two!
- What happens to a2 when you deposit in a1? Nothing!
Multiple Variables
- How many account objects are there?
- What happens to a2 when you deposit in a1?
Answer: Multiple Variables
- How many account objects are there? One!
- What happens to a2 when you deposit in a1? It changes too!
Aliasing 别名
- Variable a1 and a2 are aliases or aliased
- The account object is shared between a1and a2
- Assignment x = e: make x point to the value of e
- Results in two names for one object
Aliasing, Visually
- Look at the picture
- Think of variables as pointers, not slots
- After the assignment, the situation is symmetrical!
Part 4: Callbacks
- APIs: using objects through specs
- Callbacks: functions that an object calls
- Registration methods
A Traffic light API
- To use an object, you just need specifications of methods
- Called an API: application programmers' interface
- Specifications of traffic light methods:
- red: switch to red light
- yellow: switch to yellow light
- green: switch to green light
- next: switch to next light in sequence
- Can you turn the light to green?
- Can you cycle through the colors on each click of run?
Answer: A Traffic light API
- Easy: just use the green method, and click run
- Then replace code by t.next() and click run
Don't call me, I'll call you
- We've seen that functions can be passed as arguments
- Callback or listener: function passed as argument, called later
- Example: account that lets you choose how success is reported
Traffic Light in the Bank
- Let's hook the account up to the traffic light
- Recall that t.green if a function that turns t green
- Can you change the withdrawal amount so that a red light shows?
- Can you make it show yellow for a failed account operation?
Answer: Traffic Light in the Bank
- To show yellow for failed account operation, just pass t.yellow instead
On the Button
- Often want to choose the callback dynamically
- Common idiom: provide a registration method
- Our button object has method onclick(f) to register f for clicks
- Run the code, and click the button to see what happens
Answer: Controlling the Lights
- The call to onclick binds the function t.next to the button
- Now every time the button is clicked, the traffic light switches to next color
Exercise: Action & Reaction
- Build a reaction tester
- Should go green after random delay
- Then you click button, and it reports your reaction time
- Hint: now() returns current time in ms
Some Functions
- Functions for the next exercise
Exercise: Action & Reaction Trace
- This time, compute average over multiple tries
- Complete the code inside the function report
- Hint: use some of map, reduce, zip, filter and pos, plus, max


GRE Reading Comprehension Passage 1 | GRE Reading Comprehension Passage 2 | GRE Reading Comprehension Passage 3 | GRE Reading Comprehension Passage 4 | GRE Reading Comprehension Passage 5
The ways in which organized society has dealt with criminal offenders
constitutes a long and painful chapter in the history of man. Reference
to that history need only be made in sufficient detail to demonstrate
that as unenlightened as our present penal system is today, it
represents a giant step forward from earlier societies. In primitive
societies, each individual dealt with wrongs done to him or to his
family in his own way. The victim was motivated chiefly by ideas of
revenge, retaliation, or compensation for loss of property. Since in
those early societies there were no well-established rules, the strong
predator very often went unpunished, and the strong victim sometimes
overreacted, resulting in a compounding of the damage.
As the primitive societies developed, the government, represented by
the chief or the king, gradually began taking over the protection of
persons and property and the punishment of offenders in the name of
public peace and order. The basic concept behind the intervention of
government, however, continued to be that of retribution � a
balancing of the scales of justice. The scales tended to be balanced on
the side of the superior power of the state. The death penalty was the
most common response to common crime. It is recorded that in London, in
January 1801, a 17 year old boy was hanged for stealing a silver spoon.
During the 16th and 17th centuries in Europe, some thirty types of
death penalties were in use, ranging from drawing and quartering to
burning at the stake and breaking on the wheel. Physical torture of all
forms was common, including mutilation, such as cutting out the tongue
and burning out the eyes. Public flogging and other forms of public
degradation were commonly in use for relatively minor offences.
Imprisonment was not looked upon as a means of punishment, but was used
rather for the purpose of guaranteeing the presence of the offender at
his trial and ultimate punishment.
With a relatively small population, there were eight hundred executions
in a year in England alone towards the end of the 16th century. Then,
even more than now, the recipients of these harsh punishments were
mainly the poor and the `underprivileged.
Massachusetts Bay Colony was founded by the pilgrims in 1620, not
merely out of a desire to worship as they chose, but also because of
the social, economic, and legal injustices then so commonplace in
England. However, strange as it may seem, the American colonists,
knowing no better way, brought with them criminal codes almost as
severe as those they had left behind.
The exception to the harsh colonial laws was the 'Great Law' of William
Penn, embodying the comparatively humane Quaker criminal code. This
continued in force in Pennsylvania until the death of William Penn,
when, in 1718, it was repealed, and Pennsylvania, along with the other
colonies, continued under the harsh laws of the American colonies until
the late 18th century and the beginning of the new Union.
The Quakers provided the keystone around which modern penal reform
developed in America, and was accompanied by parallel developments in
England and on the Continent. Although the harsh methods of Europe are
no longer used, current penologists are beginning to feel
dissatisfaction with the dichotomy between what our prisons are
supposed to be�institutions of rehabilitation, and what they all too
often are�institutions of punishment and demoralization. Many feel
that the movement away from torture and capital punishment to
containment is but the first step in effective penology.
Question 1
What is the main idea expressed in the passage?
A)The passage gives an account of the use of cruel and inhuman discipline in order to punish the offenders.
B)The passage deals with the use of unlimited power of the primitive government to suppress the people and gain supremacy.
C)The passage expresses the need for a better form of government in
order to overcome the cruelties afflicted by rulers in the past.
D)The passage traces the development of a reformed society in terms of law and order.
E)The main idea expressed in the passage is the rise and control of American power over its colonies.
Answer: A
Answer explanation: Option A expresses the main idea of the passage
most effectively. The passage describes use of harsh punishment in
order to bring justice. Thus it describes the penal system as
one-sided, favoring the government and the powerful, and not as a
system to restore peace and order. We reject option B since this
statement does not refer to punishments being used by the government.
It only refers to use of unlimited power, which can be interpreted in
other ways as well. Option C is also rejected since the writer is
revealing facts about cruelties done in the name of justice in the
past. He does not refer to any change required in the form of
government. The difference lies in the way the passage is written.
Option D also mentions a false statement. The passage is not about the
development of a reformed society, but of a society where reforms were
not brought about. Option E is obviously wrong since the passage does
not give us any details of the American power and its colonies.
Question 2
Which of the following best describes the passage?
A)The American Penal Code
B)History of Capital Punishment
C)Rule of The Kings
D)History of Severe Penal System
E)Development of Penal Reform
Answer: D
Answer explanation: Option D is the best answer since it covers the
whole topic effectively. The passage is about the use of harsh laws to
punish even those guilty of a crime most trivial in nature. It traces
the role of government of primitive societies in the execution of such
punishments, the extent of torture inflicted on people and the wide use
of such laws. Option B is rejected since the passage does not talk
about only death sentence, but harsh punishments in every form. Option
C is also rejected as according to it, the passage is about the rule in
general, and not about penal code specifically. Option E is also not
suitable since according to it the passage largely talks about the
reforms in the penal system, but out of the whole passage, only the end
is dedicated to this topic.
Question 3
Which of the following statements is true about the passage?
A)The writer says that a minority population was subjected to execution in England.
B)The modern American system of reformed justice is based on the guidelines of the Quaker law.
C)William Penn forced the harsh colonial laws.
D)A balance was created by the government in delivering justice.
E)Massachusetts Bay Colony served to bring economic growth.
Answer: B
Answer explanation: Option A is false since the writer mentions a
relatively small population, and not a minority, that was subjected to
about 800 executions in a year in England. Option B is an appropriate
answer since the passage mentions that Quaker law was the keystone
around which modern penal reform developed in America. Option C is a
distorted version of the fact mentioned in the passage, since William
Penn introduced the Great law that was an �exception� to the harsh
colonial law. Option D is false since the passage mentions that the
scales of justice were not equal and tended to be balanced towards the
state. Option E is rejected on grounds that it mentions the motive
behind the institution as economic growth, but it served to bring
reforms, and not growth.
Question 4
According to the passage, what was the main approach of the government in delivering justice in the primitive societies?
A)The approach was reformative, and the government wanted to introduce welfare.
B)The approach was of greed to gain more wealth.
C)The approach of the government was progressive to spread prosperity.
D)The approach of the government was positive to maintain law and order.
E)The approach of the government was harsh to give torturous punishments.
Answer: E
Answer explanation: According to the passage, the basic concept behind
the government�s way of punishing the offenders was cruel and harsh.
In the primitive societies, pain and suffering was inflicted on the
offenders without any scope of excuse. Thus E is the best answer
option. A is wrong since the passage does not refer to welfare of state
in primitive society, and reforms in the penal code were far from
practice. Option B is obviously wrong since there is no mention of the
government�s ways and measures of amassing wealth. Option C mentions
the approach as progressive in order to spread prosperity. We reject
this option since it is beyond the scope of the passage. Option D
mentions the approach as positive in order to maintain peace. However,
the means and approach to reach this goal was not positive, but harsh
and repressive. Thus we reject it.
Question 5
What can be understood by the �Great Law� from the passage?
A)It was a different form of colonial law.
B)It was enforced after the death of William Penn.
C)It was compassionate in nature.
D)It led Pennsylvania to compassionate penology forever.
E)It was prevalent in American colonies.
Answer: C
Answer explanation: We reject option A since the passage mentions the
Great Law as an �exception� to colonial law, thus it cannot be a
�different form� of the same. Option B is rejected since it was
William Penn who introduced this law and it was enforced as long as he
was alive. Option D can be rejected because it mentions that this law
led Pennsylvania to reformed penal justice �forever�. However,
according to the passage, harsh law of America continued after William
Penn�s death. According to option E this law was prevalent in all
American colonies, but this is a false statement since harsh and cruel
laws were administered in them instead of compassionate laws like the
Great Law. Option C is the best option, which mentions it as a
compassionate law. We conclude this from the passage where it is
referred to as �humane� and �exception� to harsh colonial laws.
Question 6
How does the second paragraph add to the development of the structure of the passage?
A)It forms the conclusion of the passage.
B)It is an introduction to the main idea in the passage.
C)It brings forth the hidden intention of the writer.
D)It reflects a counter-view of the main idea of the passage.
E)It forms the basis of the passage.
Answer: E
Answer explanation: The second paragraph gives an account of the harsh
punishments carried out by the kings and the government in the 16th and
17th century in the name of peace and order. This is the main focus of
the passage and thus this paragraph contains the main content, or forms
the basis of the passage. Thus option E is the best answer option. We
reject A since the writer is not deriving a conclusion but is
explaining the details of his topic. This paragraph is also not an
introduction to the passage since it is a direct explanation of the
subject matter in detail, and comes after the introductory first
paragraph. Thus we reject B. As mentioned, it is a direct explanation,
and thus there are no hidden intentions of the writer that come out in
this passage, which proves C wrong. Option D is obviously wrong since
the passage is about the cruelties carried out by the government, and
there is no counter-view mentioned.
Question 7
Fill in the blanks
In the 16th and 17th century, _______ was prevalent for comparatively________.
A)severe punishment�.serious crime
B)retribution�.trivial offence
C)justice�.minor sin
D)crime�.larger society
E)peace�bigger state
Answer: B
Answer explanation: The passage mentions that public torture and other
forms of public degradation were commonly in use for relatively minor
offences. Thus the best answer option is B. We reject A since it
suggests that harsh punishments were given for serious and big crimes,
but people were punished for small crimes equally. Option C is
obviously wrong, as it does not make much sense. Option D mentions that
crime was prevalent in large societies. However, the passage does not
focus on the crime and does not mention the extent of crime that was
prevalent, but the extent of punishment given for the most trivial
crime. Thus we reject D. Option E is also rejected since there is no
mention of peace being prevalent. The passage only mentions that the
government indulged in such judgment in order to maintain peace, but
there is no account of peace and order as it was mentioned in the
primitive societies.
Question 8
Which of the following is the synonym of the word �humane�?
A)Cruel
B)Individual
C)Benevolent
D)Natural
E)Sober
Answer: C
Answer explanation: A synonym is a word similar in meaning to the given
word. The word �humane� means showing kindness towards people by
making sure that they do not suffer more than required. Thus a synonym
of this word should represent this nature. Option C is therefore the
correct answer. Option A is an antonym of the given word since it is
opposite in meaning, thus it is rejected. Option B, D and E are not
related to the main word in any manner. Thus all these options are
incorrect.
GRE Reading Comprehension Passage 1 | GRE Reading Comprehension Passage 2 | GRE Reading Comprehension Passage 3 | GRE Reading Comprehension Passage 4 | GRE Reading Comprehension Passage 5
Spread The Word / Bookmark this content
Digg this Post to del.icio.us Post to Furl Post to Netscape.comGood GRE Scores
Read
gre test takers gre test experiences and gre success stories. Learn
about their gre test preparation and tips and strategies
Gre Success Stories
Graduate Record Examination GRE
GRE Word List - Alphabetical Order
GRE Antonyms Word List - Alphabetical Order
GRE Antonyms Word List - Random Order
Electical Engineering University Rankings
computer science US University rankings
college letter of recommendation
Graduate School statement of purpose


-Dorg.netbeans.modules.debugger.localsviewenhancements.dontShowCustomIcons=true
humanresources.Employee
being debugged.
It extends humanresources.Person
. The debugger has stopped at a line in
humanresources.Employee
's toString() method.
The following image shows the enahanced Local Variables view.
Notice that the actual type of field humanresources.Person
is java.util.ArrayList
(Type column).
The declared type of field humanresources.Person
is java.util.List
(Declared Type column).
Also notice the Modifiers and Declared In columns.


--- title: \[MUST READ\] The Rules of Productivity layout: post ---
Fantastic collection of empirical insights about productivity. Every manager or potential manager must read.


Error
Navigation
About Me
Personal Projects
Fun Stuff
Blog
Other Links
Resume
Github
Linkedin
Page could not be found


Select a file or drag and drop it into the area below.
File uploaded successfully
File upload failed!
{{vm.uploadError}}


Expand your horizon with Dharma Yoga, join us and become a visionary.
Train your body, mind and spirit to focus on bettering yourself time and time again
Learn culture and teachings from Yogi's around thw world, be one with the earth.
Are you ready to take your mind, body and spiritual being to the next level and advance to horizons you thought may never be possible for yourself?
We at Dharma Yoga have the experience and wisdom to improve upon the skills and enlightenment of yoga enthusiasts no matter how long or little you have been active and practicing. Our goal is to establish a long lasting connection with our clients and class participants who we'd like to navigate through the ups and downs life brings with a spiritual ease.
Enjoy nature and take in the beautiful surroundings with our yogis, stretching outdoors with our state of the art yoga mats.
See our classes page for a full list of our yoga classes, our instructions will work with you to find you the class that most meets your goals.
Schedule a private session with one of our experienced yogis who will jon you for a personal yoga experience at the destination of your choice.
Looking for a class you don't see here? Check out our classes page!
© Avish-Khan-Works


[% page.title = "Perl 5.8.5 Release Announcement" %]
The Perl 5 developer team is pleased to announce the Perl Release 5.8.5, the fifth maintenance release of Perl 5.8.
md5sums for the tarballs:
9db6be76aa275f415d75c224ad1d4029 perl-5.8.5.tar.bz2
49baa8d7d29b4a9713c06edeb81e6b1b perl-5.8.5.tar.gz
5.8.5 is a maintenance release for perl 5.8, incorporating various minor
bugfixes and optimisations. Please see the perldelta
for the full details. Please report bugs using the perlbug
utility. If the build or regression tests fail, make nok
. If
the build fails to early to run this, please mail perlbug at perl.org
directly.
This is a source code release, not a binary release. You will need a C development environment to build the sources. Binary releases will be made available by various vendors. To build and install Perl, and to find out how to report problems, please read the INSTALL file, and any relevant README.platform file. As specified in the licenses for Perl (see the files named Artistic or Copying), THIS PACKAGE IS PROVIDED WITH ABSOLUTELY NO WARRANTY. As always, you should conduct an appropriate level of testing before using any new product in your production environment.
The perldelta, which describes the most important changes for this release is available in the source distribution. Also see the Perl 5.8.4 announcement, or find much more about Perl.
-- Nicholas Clark, on behalf of the Perl5 Porters, 2004-07-21


While I was creating a swap between KMD and NIX, this issue was being spammed within the console:
Error JsonRpcError { request: JsonRpcRequest { jsonrpc: "1.0", id: "0", method: "getblock", params: [String("264895"), Bool(true)] }, error: Transport("rpc_clients:244] Rpc request JsonRpcRequest { jsonrpc: "1.0", id: "0", method: "getblock", params: [String("264895"), Bool(true)] } failed with HTTP status code 500 Internal Server Error, response body: {"result":null,"error":{"cod...


Lorem ipsum dolor sit amet consectetur adipisicing elit. Placeat sapiente nisi a, dolor eos quod consequatur, nobis omnis quisquam iusto provident est sunt laudantium inventore similique, recusandae veritatis eligendi neque.
Did Hannah grow up in DC?
Although Hannah was born in Silver Spring, MD, she grew up in Northwest, Washington, DC from infancy through secondary school. She graduated from School Without Walls SHS of DC public schools.
Has Hannah lived in 5 countries?
Hannah has lived in 5 countries. She grew up in the US. She studied in both France (high school) and Switzerland (undergraduate). She has also worked in the former-Soviet republic of Georgia and Nigeria.
Does Hannah have a daughter?
Hannah has one daughter. Her name is Nessa and she is 2 years old.
Does Hannah have three sisters?
Hannah has three sisters. She is the oldest of 4 daughters.
Does Hannah have any pets?
Hannah has one pet: a resue dog named Coco.
Some of my hobbies
- Hanging out with my daughter
- Watching horror movies (without my daughter)
- Exercise, like jogging, walking, and hiking
Hannah's Top 10 Countries to Visit
- Italy
- Phillippines
- Cambodia
- Taiwan
- Guyana
- China
- Mexico
- Iceland
- Namibia
- Saint Lucia


Burma
What's Happening?
In the Rakhine state of Mynmar, ethnic conflict between Rakhine Buddhists and Rohingya Muslims has risen to frightening extremes. Discriminatory policies by the Mynmar government have caused hundereds of thousands of Rohingya to flee the country since the late 1970s. Rohingya Muslims and the Rakhine Buddhists have been in a historical argument about the origin of their ethnicities in Mynmar. With the Rohingya being the minority, policies by the majority Buddhist government have inflated to unimaginable extremes such as genocide and warfare.
Demographics
Total number of Rohinya refugees: 420,000
Number of intenally displaced persons: 120,000
Estimated refugees fled since 2012: 168,000
Personal Accounts
"I had to save my other children. We had to escape [from Burma] "
"We haven’t spoken to anybody who has told us that the burnings have been done by anyone other than the military."
"Soldiers and Moghs were raping and torturing the people around us. My children were murdered. I was beaten and they broke my waist. My husband was taken away by the soldiers and he has disappeared since then,"
Helpful Links


WELCOME
ADMINISTRATOR
DASHBOARD
VISITOR SLIP
VISITOR INFO
LOGOUT
VISITOR GATEPASS
@csrf
Capture Image
Capture Image
Contact Number
SEND OTP
Enter OTP
VERIFY OTP
Visitor name
Purpose
Select
Faculty
Student
Others
Departure
Request Gatepass
VISITOR SLIP
Visitor Name:
Visit Purpose:
Issued On :
Valid Upto :
AUTHORISED SIGNATURE
Print
Close


This is a landing page that I made for a auction company.
This is my second react project , using css grid system. I remember that when I first time develpe web paging using React js, I was really repelling it. And now I think Reac js is really a fantastic library to develpe the web page.
I thought this game would be more complex than the last project, tic tac toe, cause it´s the last project from FCC for the front end developer certificate. But it turns out that it only took me one day to finish it. It shows that I really have maken a lot of progress these three months.
This is a classic game like tic tac toe, so the basic feature is : the user should memorize the move that go through the computer, and after computer move, the user should repeat these moves. There four colors , nad each color has a different sound. the user can turn on strict mode, that means once the user fails , he has to start over from level 1.
I´m so happy that finnlay I have finished all the projects from FCC for the front end developer certificate. And it´s not the end, it´s just another beginning for new challenges.
This is a the first game project than I have done with html5 canvas and javascript.
This project is totally the most complex than the others projects that I have done till now. Fisrt I have to use html5 canvas to animate each circle and X for each move. And the second,the AI logic is complex, and I almost thought I could not finish this project.
There is not so much to describe for the basic feature of the project, it´s a classic tic tac toe game. The user can choose play X or O, and also can choose who play first.
I´m so happy that I can finish it all by my own, and I´m satisfied with the result.
This project is a little bit more difficult than the others, becasue this is my first time using Html5 canvas , I find it quite intimidating, it´s not like usual javascritp code and I can´t use other Html tag. But I find it´s very interesting. It makes the web design more creative.
And I use Adobe Animate CC to make the intro animation, represent how the thing evolve according to hte time, with the sound track of star war.
The basic function of this app is : the user can set a session time nad a break time, and the user can pause ,continuo and change the time on the fly. the center image will change according to each session.
This is a simple caculator APP, I designed it first in Adobe Experice Design. And and I love how it turned out.
The dificulty is how to make the logic right between all the components. For example, at beginning the user can´t type any operator without typing any number. And the user can´t type two operaters one after another. ANf when the user get the result, he/she can´t typing any number or operator any more. And so on.
A project that I did for fun, for the purpose of practicing javascript.
Typing speed test
This is a project that I did por the purpose of practicing Javascript.
The main feature of this APP is: there are three test for user to choose to do the speed test. When the user type the first word, it begins to count the time, if (the user types wrong), {the outline of the input box will show red}, else{the outline will be green}.
When the user finish the test, a result box will show show up. It containes several information, include how many times has tired the user, the time it has taken the user to finish the test, the record (high score), how many error has made, the accuracy and the typing speed.
The dificulty is how to make the logic right between all the components. And two versiones of language definitely makes the code more complex.
This is anther project from FreeCode Camp, it´s a wiki search app that require using media wiki API to get the wikipedia page
Wikiserach
This is another project from FreeCode Camp, and it requires using media wiki API to get the wikipedia page and also the user can click a button and generate a random wikipedia page.
Basically it´s quite the same with my last project , the weather app, but this time I find more complicated due to the page layout and the API call. This time worked with XML format instead of JSON, and to get the random page I have to make two API calls. But I have so much fun with it and I´ve learn a lot form it.
So the basical function of this APP is: First, the language page will show up to request the user to choose a language (English or Spanish) and then it will lead to the user to the main serach page.
In this page the use can type a subject that he wants search in the search bar, then will silde in another page to show the generally conent of the subject, if the user wants to know more, he can click "know more" button to get the wikipedia page, or he can click "back" button to go back to the search page.
And another function is the user can click "give a try button", then will slide in another page to show the user 10 random articles, if the user is interested in one article ,he can click on it , and it will lead to the corresponding wikipedia page, or he can click "another try" button to get another 10 random articles. And the last hte user can click "back" button to go back to the main search page.
This is anther project from FreeCode Camp, it´s an web app that require using API to get the current weather
local weather
This is another project from FreeCode Camp, and it requires using API to get the current weather. And this is my first time to build a web page using API, so I did find it a little difficult, but in the end I have made it and I´ve learned a lot how to deal with AJAX and geolocation by building this page.
How to design the page is really bothering me a lot. finllay I decide use just white background to represent a simply and clear interface.
So basically this app can show you the current location, the date, temperature, a simply description, sunrise time, wind speed, humidity and can turn the tempwratur from celsius to fahrenheit. And finally I add a search bar that can allows you to search the weather of another city, and another button to come back to the current city.
I used a jquery plugin called easyAutoComplete to help me finish the live search bar, but the challenge is how to position the search bar nad how to rewrite the css, it really took me a lot time to figure it out.
This is a project from FreeCode Camp, and I really love how the project turns out. I´ve applied AJAX and JSON to this project
quote generator
This is a project from FreeCode Camp, and I really love how the project turns out. I´ve applied AJAX and JSON to this project, and also a Jquery plugin named Typed.js. It was only a spanish quote generator only, cause I want to contribute it to all my gym pals. But later I thought it will be cool if I can add an English version.
This is not a difficult project, however I did encontered some problems when I dealed with it, like how to control the font size to be responsible according to the amount of the words of each quote,and later on how to control two version of language, so that when one version show up , the other version should be hide.
And I also encountered a browser render problem. Cause when I "glow" the header, it worked fine in my desktop, but when I test it in the mobile device, the letters were typing out with so much lag, so I had to remove the text glow and add it to the end, which I think it´s even better than before.
This is a project for my trip to china, I´m going back to Chong Qing, china in septembre, I create this little web App to remind me
countdown
This is a quite simple project, so there is not too much to comment. I use a Jquery plugin called "countdown" for this project. And I did customize a little the time style. And I have two images for the background, one is bigger which is for desktop o ipad, the other is smaller which is for moible.
And I use photoshop to enchnce the orignal photo which is much dimmer than the photo you see right now.


--- layout: post title: Is Virtualization A Means To An End? date: '2012-02-15T13:12:53-08:00' tags: tumblr_url: http://alexhwilliams.tumblr.com/post/17671505575/is-virtualization-a-means-to-an-end ---
http://bit.ly/xHSZJ4


My first experiences with peer pairing was reminiscent of my very first date in middle school. Lots of awkward silences, bad jokes, and failed attempts at getting a kiss in the movie theater. Fortunately, just as I learned that girls don't appreciate the nuances of a your mom joke, I learned how to effectively pair with others to the point where I don't feel like a detriment. Working with someone else makes completing my weekly challenges so much easier, as I am the type of person who thrives when I have at least one other person to bounce ideas off of. I also really appreciate the fact that I have the opportunity to get to know my cohort-mates beforehand; I’ve already made strong connections with others which will help us all once phase 1 starts.
One thing i've really come to appreciate is the quality of people DBC has managed to round up. I have yet to meet someone who is not extremely smart, understanding, and motivated to learn. Every person i've paired with has given me invaluable advice on how to improve my coding as well as my mindset on learning in general.
I honestly feel extremely humbled whenever I read the feedback that is given to me. In my opinion the vast majority of the people I’ve worked with seemed so much smarter and more experienced; the fact that many of them were saying how I was extremely helpful during our sessions has greatly boosted my self-esteem. I'll be perfectly honest, after the nightmare that was the first week of phase 0 I was seriously questioning whether or not I belonged in DBC. But as I read more and more positive and encouraging feedback from others I began to think that maybe I actually do belong.


Routines for creating, manipulating, and performing Bayesian inference about Gaussian processes in one and two dimensions using the Fourier basis approximation: simulation and plotting of processes, calculation of coefficient variances, calculation of process density, coefficient proposals (for use in MCMC). It uses R environments to store GP objects as references/pointers.
| Version: | 1.3.3 |
| Depends: | R (≥ 1.9.0) |
| Imports: | graphics, stats, grDevices |
| Published: | 2015-07-01 |
| Author: | Chris Paciorek |
| Maintainer: | Chris Paciorek <paciorek at alumni.cmu.edu> |
| License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
| URL: | http://www.jstatsoft.org/v19/a2 |
| NeedsCompilation: | no |
| Citation: | spectralGP citation info |
| Materials: | NEWS |
| CRAN checks: | spectralGP results |
| Reference manual: | spectralGP.pdf |
| Package source: | spectralGP_1.3.3.tar.gz |
| Windows binaries: | r-devel: spectralGP_1.3.3.zip, r-release: spectralGP_1.3.3.zip, r-oldrel: spectralGP_1.3.3.zip |
| OS X binaries: | r-release: spectralGP_1.3.3.tgz, r-oldrel: spectralGP_1.3.3.tgz |
| Old sources: | spectralGP archive |
Please use the canonical form https://CRAN.R-project.org/package=spectralGP to link to this page.


How the duration of pattern presentation affects learning in this model?
Question #2
Is it possible to learn more patterns?What's the probability of this scenario?
\[p_n(\varepsilon) = \text{Pr}(d_{(n)} - d_{(1)} \leq \varepsilon) =
\int_{-\infty}^\varepsilon \text{Pr}(d_{(n)} - d_{(1)} = \varepsilon)d\varepsilon\]
\[=\int_{-\infty}^\varepsilon \text{Pr}(X = \varepsilon)d\varepsilon \]


@linksVending()
How was your BeautyTouch experience?
Our support team has been notified.
Please email<EMAIL_ADDRESS>or provide your phone number below to tell us more and we'll make it right.
Thank you. A customer service representative will be in touch shortly.
| 1 | 2 | 3 | ||||||
| 4 | 5 | 6 | ||||||
| 7 | 8 | 9 | ||||||
| 0 | Delete |


Code for input functions.
More...
#include "Input.h"
#include "Includes.h"
Go to the source code of this file.
◆ ReadBoardSize()
Read the board size (width and height) for a tourney. ReadUnsigned(UINT&, Parity, UINT) is called to read from the user until they enter a large enough unsigned integer of the correct parity, or the letter 'q' to quit.
- Parameters
-
| n | [out] The board size typed by the user. |
| t | Tourney descriptor. |
- Returns
- true If the user wants to quit instead.
Definition at line 91 of file Input.cpp.
◆ ReadCharacter()
| char ReadCharacter |
( |
std::set< char > & |
s | ) |
|
This function will return only when the user types a character from a particular set.
- Parameters
-
| s | Set of allowable characters. |
- Returns
- The allowable character that the user typed (eventually).
Definition at line 106 of file Input.cpp.
◆ ReadCycleType()
Read a character from stdin and decode it into a cycle type.
- Parameters
-
| t | [out] The type of tour that the user wants. |
- Returns
- true If the user wants to restart instead.
Definition at line 216 of file Input.cpp.
◆ ReadGeneratorType()
Read a character from stdin and decode it into a generator type.
- Parameters
-
| t | [out] The type of generator that the user wants. |
- Returns
- true If the user wants to restart instead.
Definition at line 152 of file Input.cpp.
◆ ReadObfuscate()
| bool ReadObfuscate |
( |
bool & |
obfuscate | ) |
|
Read a character from stdin and decode it into obfuscate status.
- Parameters
-
| obfuscate | [out] true if the user requests blurring. |
- Returns
- true If the user wants to restart instead.
Definition at line 262 of file Input.cpp.
◆ ReadTask()
| bool ReadTask |
( |
Task & |
t | ) |
|
Read a character from stdin and decode it into a task.
- Parameters
-
| t | [out] The task that the user wants. |
- Returns
- true If the user wants to quit instead.
Definition at line 293 of file Input.cpp.
◆ ReadUnsigned()
Read from the user until they enter a large enough unsigned integer of the correct parity, or the letter 'q' to quit.
- Parameters
-
| n | [out] The unsigned integer typed by the user. |
| parity | The parity of the unsigned integer to be read. |
| lo | Lower bound for the unsigned integer to be read. |
- Returns
- true If the user wants to quit instead.
Definition at line 36 of file Input.cpp.


Home
About
Features
Pricing
Card Details
Billing Address
Australia
Canada
USA
Rent Information
Rent Information
Rent Information


Eco-Safari Services
Fast, convenient and affordable business rides
Take control of how your team moves. Commutes, meetings, airport transfers, courtesy rides. Manage everything from one place,
Find a Car
Join the community of +500,000 Eco-Safari users around the world.
Learn More →
Earn Money Driving
Use Eco-Safari to ride from or to the city. Later, use Eco-Safari to ride like a local.
Learn More →
Add your fleet to Eco-Safari
Manage drivers, vehicles and documents


This is the first JavaScript taller.
Calculate the area and perimeter of a square:
Calculate the area and perimeter of a circle:
Calculate the area and perimeter of a triangle:


Defines a list of data aggregators for this column. Aggregators provide the ability to generate summaries and totals for a given column's data. A new row will be added to the bottom of the grid (and the bottom of each group) that displays an aggregate value of your choosing. See the Aggregators example for a preview of the result.
An aggregator item is defined as a dictionary with the following params:
active
(boolean)
- Determines whether or not this is the currently active aggregator for this column. Only one aggregator can be displayed at any given time. By default, the first aggregator will be enabled if none specified.fn
(function)
- This is the main aggregator function.name
(string)
- The name for this aggregator.
The main aggregator fn
function takes in the following argument:
column
(object)
- This is the column definition object that you can use within your aggregator.
The main aggregator
function must have two public functions: process
and formatter
. The process
function takes in an 'item' object for each row in the grid. And the formatter
function outputs the final HTML string that will be inserted into the cell of the aggregator totals row. An additional exporter
function can be used if you want to have the aggregate values be copied and exported.
(array)
: Defaultundefined
.
// This is a simple sum aggregator
{
aggregators: [{
name: "Total Summary",
description: "A simple aggregator for calculating the total of all values in this column",
fn: function (column) {
// exporter()
// This function will be called when the Aggregator cell value is being exported.
//
// @return string
this.exporter = function () {
return (this.total || "");
};
// formatter()
// This function will be called when the Aggregator cell is being rendered.
// Should return a valid HTML string.
//
// @return string
this.formatter = function () {
return "" + this.total + "";
};
// process()
// This function will be called on each item row when processing the aggregator.
//
// @param item object The row data item
//
this.process = function (item) {
this.total += (item.data[column.field] || 0);
};
// reset()
// This function will be called anytime the aggregator needs to be reset, like
// in the event of a filter being applied to the data set.
//
this.reset = function () {
this.total = 0;
};
return this;
}
}]
}