NooBaa core backup can be done directly by disk backup (VMDK backup or any other low-level backup).
Any information that has been written to NooBaa between backups will be lost in case you need to restore the data.
A better approach would be using a cluster. Read more here


Author : Aman Hussain
Email<EMAIL_ADDRESS>Description : Classifying images of dogs and cats by finetuning the VGG16 model
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import os, json
from helper import utils
from helper.utils import plots
from helper import vgg16
from helper.vgg16 import Vgg16
The path to the dataset is defined here. It will point to the sample folder which contains lesser number of images for quick and iterative training on the local machine. For the final training, on the cloud we must change the path to the one commented out below.
# path = '../data/dogscats/sample/'
path = '../data/dogscats/'
The default batchsize for training and validation purposes
batchsize = 64
Instantiating the VGG16 class which implements the required utility methods
vgg = Vgg16()
Getting the training and validation batches
batches = vgg.get_batches(path+'train', batch_size=batchsize)
val_batches = vgg.get_batches(path+'valid', batch_size=batchsize)
Visualizing the images, only if we are exploring the samples
imgs, labels = next(batches)
val_imgs, val_labels = next(val_batches)
labels = ['dog' if i[0]==0 else 'cat' for i in labels]
val_labels = ['dog' if i[0]==0 else 'cat' for i in val_labels]
plots(val_imgs[:5], figsize=(20,10), titles=val_labels)
vgg.finetune(batches)
%%time
vgg.fit(batches, val_batches, nb_epoch=3)
Due to the quirkiness of the ImageDataGenerator.flow_from_directory() used by vgg.get_batches(), we have to make a sub directory under test directory by the name 'subdir_for_keras_ImageDataGenerator'.
batch_size = len(os.listdir(path+'test'+'/subdir_for_keras_ImageDataGenerator'))
Keras ImageDataGenerator does not return the filenames and loads them in the same order as os.listdir() returns. Here, we extract the filenames which will serve as the indexes.
img_index = os.listdir(path+'test'+'/subdir_for_keras_ImageDataGenerator')
img_index = [os.path.splitext(file)[0] for file in img_index]
With the class_mode set to None, it will return only the batch of images without labels
testbatch = vgg.get_batches(path+'test', shuffle=False, batch_size=batch_size, class_mode=None)
test_imgs = next(testbatch)
Manually verifying the predicitons
plots(test_imgs[:5])
probab, prediction, prediction_labels = vgg.predict(test_imgs[:5], details = True)
print(prediction_labels, probab, prediction)
img_index[:5]
We confirm the predictions manually.
Here, we make the predictions using our trained model
%%time
probab, prediction, prediction_labels = vgg.predict(test_imgs, details = True)
Preparing to save the predictions as submissions to the Kaggle competetion
np.save(path+'submissions/index', img_index)
np.save(path+'submissions/probab', probab)
np.save(path+'submissions/prediction', prediction)
np.save(path+'submissions/prediction_labels', prediction_labels)
Save the trained model
vgg.model.save("../models/vgg_dogsVScats.h5")
for predicted, index in enumerate(prediction):
# When a cat is predicted, get the complimentary value
if predicted == 0:
probab[index] = 1 - probab[index]
img_index.insert(0, 'id')
labels_pred = [str(label) for label in prediction]
labels_pred.insert(0, 'label')
labels_prob = [str(label) for label in probab]
labels_prob.insert(0, 'label')
submission_array_pred = np.vstack((img_index, labels_pred)).T.astype('str')
submission_array_prob = np.vstack((img_index, labels_prob)).T.astype('str')
Saving the array as a CSV
np.savetxt(path+'submissions/submission_pred.csv', submission_array_pred, delimiter=",", fmt='%1s')
np.savetxt(path+'submissions/submission_prob.csv', submission_array_prob, delimiter=",", fmt='%1s')
Loading the values predicted by the model
img_index = np.load(path+'submissions/index.npy')
probab = np.load(path+'submissions/probab.npy')
prediction = np.load(path+'submissions/prediction.npy')
Visualising the distribution of probabilities
plt.hist(probab)
Since the kaggle competetion evaluates results based on log loss, it heavily penalises values which are 1 or 0. So, we manually modify the 1 and 0 to read 0.95 and 0.05.
np.unique(prediction)
prediction = prediction.astype(float)
prediction[prediction == 1] = 0.95
prediction[prediction == 0] = 0.05
np.unique(prediction)
Now, we will prepare the list for submission
img_index = img_index.tolist()
img_index.insert(0, 'id')
labels_pred = [str(label) for label in prediction]
labels_pred.insert(0, 'label')
submission_array_pred = np.vstack((img_index, labels_pred)).T.astype('str')
Saving the new submission file
np.savetxt(path+'submissions/submission_pred_mod.csv', submission_array_pred, delimiter=",", fmt='%1s')


Async_Messaging: check_circle
Async_Messaging:
cancel
Please enable Async_Messaging property for your account before continue.
App selected:
cancel
There is not any app selected. Please add or install a new app.


Be a part of our wide range of products.
get what you need in very less price.
$50.00
$50.00
$50.00
$50.00
$50.00
$50.00
$50.00
$50.00
$50.00
$50.00
$50.00
$50.00
Exclusively Available on RedStore
orem Ipsum is simply dummy text of the printing and typesetting
industry.ake a
type specimen book. It has survived not only five
centuries, but also the leap into
electronic typesetting
orem Ipsum is simply dummy text of the printing and typesetting
industry.ake a
type specimen book. It has survived not only five
centuries, but also the leap into
electronic typesetting
orem Ipsum is simply dummy text of the printing and typesetting
industry.ake a
type specimen book. It has survived not only five
centuries, but also the leap into
electronic typesetting


?Y¡^r'
BOTANICAL
oARDe^i
New
York
Botanical
Garden
PLANTS
OF
DOMINICA,
LESSER
ANTILLES
Qplismenus
setarius
(Lam.)
Roem.
&
Schult.
Poaceae
Det.
S.R.Hill
11/92
ST.
PAUL
PARISH.
Archbold
Tropical
Research
Center,
Springfield
Guest
House,
Imperial
Highway.
Between
Guest
House
and
garage;
elev.
1150-1200
ft.
Occasional
trailing,
mat-forming
grass;
inflorescence
ascending.
Steven
R.
Hill
23942
26
July
1992
1604471
Legend -
Level of confidence that token is an accurately-transcribed word
extremely low
very low
low
undetermined
medium
high
very high


Brooklyn dentist gets money back after falling victim to mail ‘fishing’
by John CrudeleDear John: I am a dentist in Brooklyn who is a victim of ‘fishing.”
At the end of a working day, one of my staff members drops the mail (consisting of insurance claims and written checks to pay vendors and suppliers) into a local mailbox. Three checks were “fished” out of the mailbox with a mousetrap contraption.
And the checks the person pulled out were altered and cashed on a phone app.
One check was written to Optimum for a cable bill for $136.22. It was altered to pay a “Jada Gill,” rather than Optimum, $11,000.22.
It was deposited via a phone app to Bank of America and was paid by my bank, Chase.
I immediately reported it to Chase, which told me I would have to wait at least 90 days for it to review the situation and make a decision about returning my money. I sent Chase a copy of the obviously altered check.
Chase agreed it was altered, but I would still have to wait for my money. About one week after I reported it to Chase, a policeman called me and said they made a random traffic stop and the person in the car had about 80 altered checks, two of which were mine.
Along with the checks was the mousetrap contraption.
I gave the person’s name and copies of the other two checks (which were altered, but luckily never cashed) to Chase hoping to expedite getting my $11,000.22 back, but am getting stonewalled.
Can you please help me retrieve my own money, which never should have been paid from my account in the first place?
I have attached copies of the two checks that were in the car with the thief that were not cashed, but you can clearly see the alterations. The check cashed for $11,000.22 was the same poor quality. S.A.
Dear S.A.: Good news!
It took months, but I contacted both banks on your behalf, and you now have your money back.
As it turns out, Bank of America says the $11,000.22 check was never cashed either. Someone at the bank became suspicious and refused to pay “Jada Gill.”
The holdup was the banks arguing about who had the money. I don’t know which bank eventually owned up to it, but after a little arm twisting, one of them found the dough.
You probably already know the hard way that this sort of theft has become commonplace. The post office was even forced to change the design of its mailboxes to prevent “fishing.” But apparently the changes weren’t effective or your mailbox wasn’t one that was changed.
Anyway, glad I could help you get your money back.
It’s fun to speculate about the mind of a thief. He probably figured that a straight $11,000 would have looked curious, so he added the 22 cents.


×
Home
Web-Designs
Dance Gallery
Art Gallery
☰
EFFLORESCENCE
Blooming into a Dancer
Dance Gallery
Select your view:
2
4


Notice: This will be moved to https://JaxkDev.me/jb/repo soon.
Click here to try and open the repo automatically
To access the cydia repo go into cydia and type this URL:
http://JaxkDev.github.io/repoand it should show up after refreshing sources !


Command-Line Interface
Contiv uses the netctl command-line interface (CLI) to configure networks, policies, and service load balancers.
Note: netctl directly talks to netmaster, bypassing Contiv authentication and authorization. If you want to use this utility, set it up on a separate cluster node.
netctl
NAME:
netctl
- A new cli application
USAGE:
./netctl [global options] command [command options] [arguments...]
COMMANDS:
aci-gw
ACI Gateway information
app-profile
Application Profile manipulation tools
bgp
Router capability configuration
endpoint, ep
Endpoint Inspection
external-contracts
External contracts
global
Global information
group
Endpoint Group manipulation tools
login
Authenticate to Contiv
netprofile
Network profile manipulation tools
network, net
Network manipulation tools
policy
Policy manipulation tools
service
Service object creation
tenant
Tenant manipulation tools
version
Version Information
help, h
Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h
Show help
--insecure
Disable strict certificate checking
--netmaster "http://netmaster:9999"
The hostname of the netmaster [$NETMASTER]
--version, -v
Print the version
group
NAME:
group
- Endpoint Group manipulation tools
USAGE:
netctl group command [command options] [arguments...]
COMMANDS:
create
Create an endpoint group
inspect
Inspect a EndpointGroup
rm, delete
Delete an endpoint group
ls, list
List endpoint groups
help, h
Shows a list of commands or help for one command
OPTIONS:
--help, -h
show help
aci-gw
NAME:
netctl aci-gw
- ACI Gateway information
USAGE:
netctl aci-gw command [command options] [arguments...]
COMMANDS:
info
Show ACI gateway information
inspect
Inspect aci gateway operational information
set
Set aci-gw parameters.
help, h
Shows a list of commands or help for one command
OPTIONS:
--help, -h
show help
app-profile
NAME:
netctl app-profile
- Application Profile manipulation tools
USAGE:
netctl app-profile command [command options] [arguments...]
COMMANDS:
create
Create an application profile
update
Update an application profile
rm, delete
Delete an application profile
ls, list
List application profiles
group-ls, group-list
List groups in an app-profile
help, h
Shows a list of commands or help for one command
OPTIONS:
--help, -h
show help
bgp
NAME:
netctl bgp
- Router capability configuration
USAGE:
netctl bgp command [command options] [arguments...]
COMMANDS:
ls, list
List BGP configuration
rm, delete
Delete BGP configuration
create
Add BGP configuration.
inspect
Inspect BGP
help, h
Shows a list of commands or help for one command
OPTIONS:
--help, -h
show help
endpoint
NAME:
endpoint, ep
- Endpoint Inspection
USAGE:
netctl endpoint command [command options] [arguments...]
COMMANDS:
inspect
Inspect an Endpoint
help, h
Shows a list of commands or help for one command
external-contracts
NAME:
netctl external-contracts
- External contracts
USAGE:
netctl external-contracts command [command options] [arguments...]
COMMANDS:
ls, list
List external contracts
rm, delete
Delete external contracts
create
Create external contracts
help, h
Shows a list of commands or help for one command
OPTIONS:
--help, -h
show help
global
NAME:
netctl global
- Global information
USAGE:
netctl global command [command options] [arguments...]
COMMANDS:
info
Show global information
inspect
Inspect global operational information
set
Set global parameters
help, h
Shows a list of commands or help for one command
OPTIONS:
--help, -h
show help
login
Contiv comes with a proxy called auth_proxy which transparently sits in front of netmaster and provides authentication (Active Directory, LDAP, local users) and authorization (RBAC). netctl can send requests to auth_proxy as if it were sending requests directly to netmaster. For more details, please see the auth_proxy repo.
You must login before you can send any netctl requests to auth_proxy. Any requests destined for auth_proxy must include the global --netmaster
flag with the full HTTPS auth_proxy URL as the value.
If the target auth_proxy is using an expired, invalid, or untrusted certificate, you will additionally need to specify the global --insecure
flag.
netctl stores its auth_proxy access token under $HOME/.netctl/config.json
. To "logout", simply delete this file.
NAME:
netctl login
- Authenticate to Contiv
USAGE:
In these examples, set $AUTH_PROXY_URL
to the full HTTPS auth_proxy URL. This will look something like: https://<IP_ADDRESS>:10000
Login (you will be prompted for your username and password)
netctl --netmaster=$AUTH_PROXY_URL login
Send authenticated request (token is automatically sent)
netctl --netmaster=$AUTH_PROXY_URL network ls
Send request to auth_proxy with untrusted certificate
netctl --insecure --netmaster=$AUTH_PROXY_URL network ls
OPTIONS:
--help, -h show help
netprofile
NAME:
netctl netprofile
- Network profile manipulation tools
USAGE:
netctl netprofile command [command options] [arguments...]
COMMANDS:
create
Create a network profile
rm, delete
Delete a network profile
ls, list
List network profile
inspect
Inspect network profile
help, h
Shows a list of commands or help for one command
OPTIONS:
--help, -h show help
network
NAME:
netctl network
- Network manipulation tools
USAGE:
netctl network command [command options] [arguments...]
COMMANDS:
ls, list
List networks
inspect
Inspect a network
rm, delete
Delete a network
create
Create a network
help, h
Shows a list of commands or help for one command
OPTIONS:
--help, -h show help
policy
NAME:
netctl policy
- Policy manipulation tools
USAGE:
netctl policy command [command options] [arguments...]
COMMANDS:
create
Create a new policy
rm, delete
Delete a policy
ls, list
List policies
inspect
Inspect a policy
rule-ls
List rules for a given tenant, policy
rule-rm
Delete a rule from the policy
rule-add
Add a new rule to the policy
help, h
Shows a list of commands or help for one command
OPTIONS:
--help, -h
show help
service
NAME:
netctl service
- Service object creation
USAGE:
netctl service command [command options] [arguments...]
COMMANDS:
ls, list
List service objects
inspect
Inspect a Network
rm, delete
Delete service object
create
Create Service object.
help, h
Shows a list of commands or help for one command
OPTIONS:
--help, -h
show help
tenant
NAME:
tenant
Tenant manipulation tools
USAGE:
netctl tenant command [command options] [arguments...]
COMMANDS:
ls, list
List tenants
rm, delete
Delete a tenant
create
Create a tenant
inspect
Inspect a tenant
help, h
Shows a list of commands or help for one command
OPTIONS:
--help, -h
show help
version
netctl version
Version Information for netctl client and sever, git commit hash, and build time.
help
netctl help
Shows help information


Chapter 13 Hypothesis Tests
In this chapter we’ll cover 1 and 2 sample null hypothesis tests: like the t-test, correlation test, and chi-square test:
library(yarrr) # Load yarrr to get the pirates data
# 1 sample t-test
# Are pirate ages different than 30 on average?
t.test(x = pirates$age,
mu = 30)
# 2 sample t-test
# Do females and males have different numbers of tattoos?
sex.ttest <- t.test(formula = tattoos ~ sex,
data = pirates,
subset = sex %in% c("male", "female"))
sex.ttest # Print result
## Access specific values from test
sex.ttest$statistic
sex.ttest$p.value
sex.ttest$conf.int
# Correlation test
# Is there a relationship between age and height?
cor.test(formula = ~ age + height,
data = pirates)
# Chi-Square test
# Is there a relationship between college and favorite pirate?
chisq.test(x = pirates$college,
y = pirates$favorite.pirate)
Do we get more treasure from chests buried in sand or at the bottom of the ocean? Is there a relationship between the number of scars a pirate has and how much grogg he can drink? Are pirates with body piercings more likely to wear bandannas than those without body piercings? Glad you asked, in this chapter, we’ll answer these questions using 1 and 2 sample frequentist hypothesis tests.
As this is a Pirate’s Guide to R, and not a Pirate’s Guide to Statistics, we won’t cover all the theoretical background behind frequentist null hypothesis tests (like t-tests) in much detail. However, it’s important to cover three main concepts: Descriptive statistics, Test statistics, and p-values. To do this, let’s talk about body piercings.
13.1 A short introduction to hypothesis tests
As you may know, pirates are quite fond of body piercings. Both as a fashion statement, and as a handy place to hang their laundry. Now, there is a stereotype that European pirates have more body piercings than American pirates. But is this true? To answer this, I conducted a survey where I asked 10 American and 10 European pirates how many body piercings they had. The results are below, and a Pirateplot of the data is in Figure :
# Body piercing data
american.bp <- c(3, 5, 2, 1, 4, 4, 6, 3, 5, 4)
european.bp <- c(6, 5, 7, 7, 6, 3, 4, 6, 5, 4)
# Store data in a dataframe
bp.survey <- data.frame("bp" = c(american.bp, european.bp),
"group" = rep(c("American", "European"), each = 10),
stringsAsFactors = FALSE)
yarrr::pirateplot(bp ~ group,
data = bp.survey,
main = "Body Piercing Survey",
ylab = "Number of Body Piercings",
xlab = "Group",
theme = 2, point.o = .8, cap.beans = TRUE)
13.1.1 Null v Alternative Hypothesis
In null hypothesis tests, you always start with a null hypothesis. The specific null hypothesis you choose will depend on the type of question you are asking, but in general, the null hypothesis states that nothing is going on and everything is the same. For example, in our body piercing study, our null hypothesis is that American and European pirates have the same number of body piercings on average.
The alternative hypothesis is the opposite of the null hypothesis. In this case, our alternative hypothesis is that American and European pirates do not have the same number of piercings on average. We can have different types of alternative hypotheses depending on how specific we want to be about our prediction. We can make a 1-sided (also called 1-tailed) hypothesis, by predicting the direction of the difference between American and European pirates. For example, our alternative hypothesis could be that European pirates have more piercings on average than American pirates.
Alternatively, we could make a 2-sided (also called 2-tailed) alternative hypothesis that American and European pirates simply differ in their average number of piercings, without stating which group has more piercings than the other.
Once we’ve stated our null and alternative hypotheses, we collect data and then calculate descriptive statistics.
13.1.2 Descriptive statistics
Descriptive statistics (also called sample statistics) describe samples of data. For example, a mean, median, or standard deviation of a dataset is a descriptive statistic of that dataset. Let’s calculate some descriptive statistics on our body piercing survey American and European pirates using the summary()
function:
# Pring descriptive statistics of the piercing data
summary(american.bp)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.0 3.0 4.0 3.7 4.8 6.0
summary(european.bp)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 3.0 4.2 5.5 5.3 6.0 7.0
Well, it looks like our sample of 10 American pirates had 3.7 body piercings on average, while our sample of 10 European pirates had 5.3 piercings on average. But is this difference large or small? Are we justified in concluding that American and European pirates in general differ in how many body piercings they have? To answer this, we need to calculate a test statistic
13.1.3 Test Statistics
An test statistic compares descriptive statistics, and determines how different they are. The formula you use to calculate a test statistics depends the type of test you are conducting, which depends on many factors, from the scale of the data (i.e.; is it nominal or interval?), to how it was collected (i.e.; was the data collected from the same person over time or were they all different people?), to how its distributed (i.e.; is it bell-shaped or highly skewed?).
For now, I can tell you that the type of data we are analyzing calls for a two-sample T-test. This test will take the descriptive statistics from our study, and return a test-statistic we can then use to make a decision about whether American and European pirates really differ. To calculate a test statistic from a two-sample t-test, we can use the t.test()
function in R. Don’t worry if it’s confusing for now, we’ll go through it in detail shortly.
# Conduct a two-sided t-test comparing the vectors american.bp and european.bp
# and save the results in an object called bp.test
bp.test <- t.test(x = american.bp,
y = european.bp,
alternative = "two.sided")
# Print the main results
bp.test
##
## Welch Two Sample t-test
##
## data: american.bp and european.bp
## t = -3, df = 20, p-value = 0.02
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -2.93 -0.27
## sample estimates:
## mean of x mean of y
## 3.7 5.3
It looks like our test-statistic is -2.52. If there was really no difference between the groups of pirates, we would expect a test statistic close to 0. Because test-statistic is -2.52, this makes us think that there really is a difference. However, in order to make our decision, we need to get the p-value from the test.
13.1.4 p-value
The p-value is a probability that reflects how consistent the test statistic is with the hypothesis that the groups are actually the same. Or more formally, a p-value can be interpreted as follows:
<IP_ADDRESS> Definition of a p-value: Assuming that there the null hypothesis is true (i.e.; that there is no difference between the groups), what is the probability that we would have gotten a test statistic as far away from 0 as the one we actually got?
For this problem, we can access the p-value as follows:
# What is the p-value from our t-test?
bp.test$p.value
## [1] 0.021
The p-value we got was 0.02, this means that, assuming the two populations of American and European pirates have the same number of body piercings on average, the probability that we would obtain a test statistic as large as -2.52 is 2.1% . This is very small, but is it small enough to decide that the null hypothesis is not true? It’s hard to say and there is no definitive answer. However, most pirates use a decision threshold of p < 0.05 to determine if we should reject the null hypothesis or not. In other words, if you obtain a p-value less than 0.05, then you reject the null hypothesis. Because our p-value of 0.02 is less than 0.05, we would reject the null hypothesis and conclude that the two populations are not be the same.
<IP_ADDRESS> p-values are bullshit detectors against the null hypothesis
P-values sounds complicated – because they are (In fact, most psychology PhDs get the definition wrong). It’s very easy to get confused and not know what they are or how to use them.   There’s no way you would get data like that if the groups were the same!” If a p-value is not too small, the bullshit alarm stays silent, and we conclude that we cannot reject the null hypothesis.
<IP_ADDRESS> How small of a p-value is too small?
Traditionally a p-value of 0.05 (or sometimes 0.01) is used to determine ‘statistical significance.’ In other words, if a p-value is less than .05, most researchers then conclude that the null hypothesis is false. However, .05 is not a magical number. Anyone who really believes that a p-value of .06 is much less significant than a p-value of 0.04 has been sniffing too much glue. However, in order to be consistent with tradition, I will adopt this threshold for the remainder of this chapter. That said, let me reiterate that a p-value threshold of 0.05 is just as arbitrary as a p-value of 0.09, 0.06, or 0.12156325234.
<IP_ADDRESS> Does the p-value tell us the probability that the null hypothesis is true?
No!!! The p-value does not tell you the probability that the null hypothesis is true. In other words, if you calculate a p-value of .04, this does not mean that the probability that the null hypothesis is true is 4%. Rather, it means that if the null hypothesis was true, the probability of obtaining the result you got is 4%.
Let me convince you of this with a short example. Imagine that you and your partner have been trying to have a baby for the past year.  I took a pregnancy test and it came back positive!! I’m pregnant!!” So, given the positive pregnancy test, what is the probability that your partner is really pregnant?
Now, imagine that the pregnancy test your partner took gives incorrect results in 1% of cases. In other words, if you are pregnant, there is a 1% chance that the test will make a mistake and say that you are not pregnant. If you really are not pregnant, there is a 1% change that the test make a mistake and say you are pregnant.
Ok, so in this case, the null hypothesis here is that your partner is not pregnant, and the alternative hypothesis is that they are pregnant. Now, if the null hypothesis is true, then the probability that they would have gotten an (incorrect) positive test result is just 1%. Does this mean that the probability that your partner is not pregnant is only 1%.
No. Your partner is a man. The probability that the null hypothesis is true (i.e. that he is not pregnant), is 100%, not 1%.
This is an extreme example of course – in most tests that you do, there will be some positive probability that the null hypothesis is false. However, in order to reasonably calculate an accurate probability that the null hypothesis is true after collecting data, you must take into account the prior probability that the null hypothesis was true before you collected data. The method we use to do this is with Bayesian statistics. We’ll go over Bayesian statistics in a later chapter.
13.2 Hypothesis test objects: htest
R stores hypothesis tests in special object classes called htest
. htest
objects contain all the major results from a hypothesis test, from the test statistic (e.g.; a t-statistic for a t-test, or a correlation coefficient for a correlation test), to the p-value, to a confidence interval. To show you how this works, let’s create an htest
object called height.htest
containing the results from a two-sample t-test comparing the heights of male and female pirates:
# T-test comparing male and female heights
# stored in a new htest object called height.htest
height.htest <- t.test(formula = height ~ sex,
data = pirates,
subset = sex %in% c("male", "female"))
Once you’ve created an htest
object, you can view a print-out of the main results by just evaluating the object name:
# Print main results from height.htest
height.htest
##
## Welch Two Sample t-test
##
## data: height by sex
## t = -20, df = 1000, p-value <2e-16
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -15 -13
## sample estimates:
## mean in group female mean in group male
## 163 177
Just like in dataframes, you can also access specific elements of the htest
object by using the $
symbol. To see all the named elements in the object, run names()
:
# Show me all the elements in the height.htest object
names(height.htest)
## [1] "statistic" "parameter" "p.value" "conf.int" "estimate"
## [6] "null.value" "alternative" "method" "data.name"
Now, if we want to access the test statistic or p-value directly, we can just use $
:
# Get the test statistic
height.htest$statistic
## t
## -21
# Get the p-value
height.htest$p.value
## [1] 1.4e-78
# Get a confidence interval for the mean
height.htest$conf.int
## [1] -15 -13
## attr(,"conf.level")
## [1] 0.95
13.3 T-test: t.test()
To compare the mean of 1 group to a specific value, or to compare the means of 2 groups, you do a t-test. The t-test function in R is t.test()
. The t.test()
function can take several arguments, here I’ll emphasize a few of them. To see them all, check the help menu for t.test (?t.test
).
13.3.1 1-sample t-test
| Argument | Description |
|---|---|
x |
A vector of data whose mean you want to compare to the null hypothesis mu |
mu |
The population mean under the null hypothesis. For example, mu = 0 will test the null hypothesis that the true population mean is 0. |
alternative |
A string specifying the alternative hypothesis. Can be "two.sided" indicating a two-tailed test, or "greater" or “less" for a one-tailed test. |
In a one-sample t-test, you compare the data from one group of data to some hypothesized mean. For example, if someone said that pirates on average have 5 tattoos, we could conduct a one-sample test comparing the data from a sample of pirates to a hypothesized mean of 5. To conduct a one-sample t-test in R using t.test()
, enter a vector as the main argument x
, and the null hypothesis as the argument mu
Here, I’ll conduct a t-test to see if the average number of tattoos owned by pirates is different from 5:
tattoo.ttest <- t.test(x = pirates$tattoos, # Vector of data
mu = 5) # Null: Mean is 5
# Print the result
tattoo.ttest
##
## One Sample t-test
##
## data: pirates$tattoos
## t = 40, df = 1000, p-value <2e-16
## alternative hypothesis: true mean is not equal to 5
## 95 percent confidence interval:
## 9.2 9.6
## sample estimates:
## mean of x
## 9.4
As you can see, the function printed lots of information: the sample mean was 9.43, the test statistic (41.59), and the p-value was 2e-16
(which is virtually 0). Because 2e-16 is less than 0.05, we would reject the null hypothesis that the true mean is equal to 5.
Now, what happens if I change the null hypothesis to a mean of 9.4? Because the sample mean was 9.43, quite close to 9.4, the test statistic should decrease, and the p-value should increase:
tattoo.ttest <- t.test(x = pirates$tattoos,
mu = 9.5) # Null: Mean is 9.4
tattoo.ttest
##
## One Sample t-test
##
## data: pirates$tattoos
## t = -0.7, df = 1000, p-value = 0.5
## alternative hypothesis: true mean is not equal to 9.5
## 95 percent confidence interval:
## 9.2 9.6
## sample estimates:
## mean of x
## 9.4
Just as we predicted! The test statistic decreased to just -0.67, and the p-value increased to 0.51. In other words, our sample mean of 9.43 is reasonably consistent with the hypothesis that the true population mean is 9.50.
13.3.2 2-sample t-test
In a two-sample t-test, you compare the means of two groups of data and test whether or not they are the same. We can specify two-sample t-tests in one of two ways. If the dependent and independent variables are in a dataframe, you can use the formula notation in the form y ~ x
, and specify the dataset containing the data in data
# Fomulation of a two-sample t-test
# Method 1: Formula
t.test(formula = y ~ x, # Formula
data = df) # Dataframe containing the variables
Alternatively, if the data you want to compare are in individual vectors (not together in a dataframe), you can use the vector notation:
# Method 2: Vector
t.test(x = x, # First vector
y = y) # Second vector
For example, let’s test a prediction that pirates who wear eye patches have fewer tattoos on average than those who don’t wear eye patches. Because the data are in the pirates
dataframe, we can do this using the formula method:
# 2-sample t-test
# IV = eyepatch (0 or 1)
# DV = tattoos
tat.patch.htest <- t.test(formula = tattoos ~ eyepatch,
data = pirates)
This test gave us a test statistic of 1.22 and a p-value of 0.22. Because the p-value is greater than 0.05, we would fail to reject the null hypothesis.
# Show me all of the elements in the htest object
names(tat.patch.htest)
## [1] "statistic" "parameter" "p.value" "conf.int" "estimate"
## [6] "null.value" "alternative" "method" "data.name"
Now, we can, for example, access the confidence interval for the mean differences using $
# Confidence interval for mean differences
tat.patch.htest$conf.int
## [1] -0.16 0.71
## attr(,"conf.level")
## [1] 0.95
<IP_ADDRESS> Using subset
to select levels of an IV
If your independent variable has more than two values, the t.test()
function will return an error because it doesn’t know which two groups you want to compare. For example, let’s say I want to compare the number of tattoos of pirates of different ages. Now, the age column has many different values, so if I don’t tell t.test()
which two values of age
I want to compare, I will get an error like this:
# Will return an error because there are more than
# 2 levels of the age IV
t.test(formula = tattoos ~ age,
data = pirates)
To fix this, I need to tell the t.test()
function which two values of age
I want to test. To do this, use the subset
argument and indicate which values of the IV you want to test using the %in%
operator. For example, to compare the number of tattoos between pirates of age 29 and 30, I would add the subset = age %in% c(29, 30)
argument like this:
# Compare the tattoos of pirates aged 29 and 30:
tatage.htest <- t.test(formula = tattoos ~ age,
data = pirates,
subset = age %in% c(29, 30)) # Compare age of 29 to 30
tatage.htest
##
## Welch Two Sample t-test
##
## data: tattoos by age
## t = 0.3, df = 100, p-value = 0.8
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -1.1 1.4
## sample estimates:
## mean in group 29 mean in group 30
## 10.1 9.9
Looks like we got a p-value of 0.79 which is pretty high and suggests that we should fail to reject the null hypothesis.
You can select any subset of data in the subset
argument to the t.test()
function – not just the primary independent variable. For example, if I wanted to compare the number of tattoos between pirates who wear headbands or not, but only for female pirates, I would do the following
# Is there an effect of college on # of tattoos
# only for female pirates?
t.test(formula = tattoos ~ college,
data = pirates,
subset = sex == "female")
##
## Welch Two Sample t-test
##
## data: tattoos by college
## t = 1, df = 500, p-value = 0.3
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -0.27 0.92
## sample estimates:
## mean in group CCCC mean in group JSSFP
## 9.6 9.3
13.4 Correlation: cor.test()
| Argument | Description |
|---|---|
formula |
A formula in the form ~ x + y , where x and y are the names of the two variables you are testing. These variables should be two separate columns in a dataframe. |
data |
The dataframe containing the variables x and y |
alternative |
A string specifying the alternative hypothesis. Can be "two.sided" indicating a two-tailed test, or "greater" or “less" for a one-tailed test. |
method |
A string indicating which correlation coefficient to calculate and test. "pearson" (the default) stands for Pearson, while "kendall" and "spearman" stand for Kendall and Spearman correlations respectively. |
subset |
A vector specifying a subset of observations to use. E.g.; subset = sex == "female" |
Next we’ll cover two-sample correlation tests. In a correlation test, you are accessing the relationship between two variables on a ratio or interval scale: like height and weight, or income and beard length. The test statistic in a correlation test is called a correlation coefficient and is represented by the letter r. The coefficient can range from -1 to +1, with -1 meaning a strong negative relationship, and +1 meaning a strong positive relationship. The null hypothesis in a correlation test is a correlation of 0, which means no relationship at all:
To run a correlation test between two variables x and y, use the cor.test()
function. You can do this in one of two ways, if x and y are columns in a dataframe, use the formula notation (formula = ~ x + y
). If x and y are separate vectors (not in a dataframe), use the vector notation (x, y
):
# Correlation Test
# Correlating two variables x and y
# Method 1: Formula notation
## Use if x and y are in a dataframe
cor.test(formula = ~ x + y,
data = df)
# Method 2: Vector notation
## Use if x and y are separate vectors
cor.test(x = x,
y = y)
Let’s conduct a correlation test on the pirates
dataset to see if there is a relationship between a pirate’s age and number of parrots they’ve had in their lifetime. Because the variables (age and parrots) are in a dataframe, we can do this in formula notation:
# Is there a correlation between a pirate's age and
# the number of parrots (s)he's owned?
# Method 1: Formula notation
age.parrots.ctest <- cor.test(formula = ~ age + parrots,
data = pirates)
# Print result
age.parrots.ctest
##
## Pearson's product-moment correlation
##
## data: age and parrots
## t = 6, df = 1000, p-value = 1e-09
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.13 0.25
## sample estimates:
## cor
## 0.19
We can also do the same thing using vector notation – the results will be exactly the same:
# Method 2: Vector notation
age.parrots.ctest <- cor.test(x = pirates$age,
y = pirates$parrots)
# Print result
age.parrots.ctest
##
## Pearson's product-moment correlation
##
## data: pirates$age and pirates$parrots
## t = 6, df = 1000, p-value = 1e-09
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.13 0.25
## sample estimates:
## cor
## 0.19
Looks like we have a positive correlation of 0.19 and a very small p-value. To see what information we can extract for this test, let’s run the command names()
on the test object:
names(age.parrots.ctest)
## [1] "statistic" "parameter" "p.value" "estimate" "null.value"
## [6] "alternative" "method" "data.name" "conf.int"
Looks like we’ve got a lot of information in this test object. As an example, let’s look at the confidence interval for the population correlation coefficient:
# 95% confidence interval of the correlation
# coefficient
age.parrots.ctest$conf.int
## [1] 0.13 0.25
## attr(,"conf.level")
## [1] 0.95
Just like the t.test()
function, we can use the subset
argument in the cor.test()
function to conduct a test on a subset of the entire dataframe. For example, to run the same correlation test between a pirate’s age and the number of parrot’s she’s owned, but only for female pirates, I can add the subset = sex == "female"
argument:
# Is there a correlation between age and
# number parrots ONLY for female pirates?
cor.test(formula = ~ age + parrots,
data = pirates,
subset = sex == "female")
##
## Pearson's product-moment correlation
##
## data: age and parrots
## t = 5, df = 500, p-value = 4e-06
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.12 0.30
## sample estimates:
## cor
## 0.21
The results look pretty much identical. In other words, the strength of the relationship between a pirate’s age and the number of parrot’s they’ve owned is pretty much the same for female pirates and pirates in general.
13.5 Chi-square: chsq.test()
Next, we’ll cover chi-square tests. In a chi-square test test, we test whether or not there is a difference in the rates of outcomes on a nominal scale (like sex, eye color, first name etc.). The test statistic of a chi-square text is \(\chi^2\) and can range from 0 to Infinity. The null-hypothesis of a chi-square test is that \(\chi^2\) = 0 which means no relationship.
A key difference between the chisq.test()
and the other hypothesis tests we’ve covered is that chisq.test()
requires a table created using the table()
function as its main argument. You’ll see how this works when we get to the examples.
<IP_ADDRESS> 1-sample Chi-square test
If you conduct a 1-sample chi-square test, you are testing if there is a difference in the number of members of each category in the vector. Or in other words, are all category memberships equally prevalent? Here’s the general form of a one-sample chi-square test:
# General form of a one-sample chi-square test
chisq.test(x = table(x))
As you can see, the main argument to chisq.test()
should be a table of values created using the table()
function. For example, let’s conduct a chi-square test to see if all pirate colleges are equally prevalent in the pirates
data. We’ll start by creating a table of the college data:
# Frequency table of pirate colleges
table(pirates$college)
##
## CCCC JSSFP
## 658 342
Just by looking at the table, it looks like pirates are much more likely to come from Captain Chunk’s Cannon Crew (CCCC) than Jack Sparrow’s School of Fashion and Piratery (JSSFP). For this reason, we should expect a very large test statistic and a very small p-value. Let’s test it using the chisq.test()
function.
# Are all colleges equally prevelant?
college.cstest <- chisq.test(x = table(pirates$college))
college.cstest
##
## Chi-squared test for given probabilities
##
## data: table(pirates$college)
## X-squared = 100, df = 1, p-value <2e-16
Indeed, with a test statistic of 99.86 and a tiny p-value, we can safely reject the null hypothesis and conclude that certain college are more popular than others.
<IP_ADDRESS> 2-sample Chi-square test
If you want to see if the frequency of one nominal variable depends on a second nominal variable, you’d conduct a 2-sample chi-square test. For example, we might want to know if there is a relationship between the college a pirate went to, and whether or not he/she wears an eyepatch. We can get a contingency table of the data from the pirates
dataframe as follows:
# Do pirates that wear eyepatches have come from different colleges
# than those that do not wear eyepatches?
table(pirates$eyepatch,
pirates$college)
##
## CCCC JSSFP
## 0 225 117
## 1 433 225
To conduct a chi-square test on these data, we will enter table of the two data vectors:
# Is there a relationship between a pirate's
# college and whether or not they wear an eyepatch?
colpatch.cstest <- chisq.test(x = table(pirates$college,
pirates$eyepatch))
colpatch.cstest
##
## Pearson's Chi-squared test with Yates' continuity correction
##
## data: table(pirates$college, pirates$eyepatch)
## X-squared = 0, df = 1, p-value = 1
It looks like we got a test statistic of \(\chi^2\) = 0 and a p-value of 1. At the traditional p = .05 threshold for significance, we would conclude that we fail to reject the null hypothesis and state that we do not have enough information to determine if pirates from different colleges differ in how likely they are to wear eye patches.
13.5.1 Getting APA-style conclusions with the apa
function
Most people think that R pirates are a completely unhinged, drunken bunch of pillaging buffoons. But nothing could be further from the truth! R pirates are a very organized and formal people who like their statistical output to follow strict rules. The most famous rules are those written by the American Pirate Association (APA). These rules specify exactly how an R pirate should report the results of the most common hypothesis tests to her fellow pirates.
For example, in reporting a t-test, APA style dictates that the result should be in the form t(df) = X, p = Y (Z-tailed), where df is the degrees of freedom of the text, X is the test statistic, Y is the p-value, and Z is the number of tails in the test. Now you can of course read these values directly from the test result, but if you want to save some time and get the APA style conclusion quickly, just use the apa function. Here’s how it works:
Consider the following two-sample t-test on the pirates dataset that compares whether or not there is a significant age difference between pirates who wear headbands and those who do not:
test.result <- t.test(age ~ headband,
data = pirates)
test.result
##
## Welch Two Sample t-test
##
## data: age by headband
## t = 0.4, df = 100, p-value = 0.7
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -1.0 1.5
## sample estimates:
## mean in group no mean in group yes
## 28 27
It looks like the test statistic is 0.35, degrees of freedom is 135.47, and the p-value is 0.73. Let’s see how the apa function gets these values directly from the test object:
yarrr::apa(test.result)
## [1] "mean difference = -0.22, t(135.47) = 0.35, p = 0.73 (2-tailed)"
As you can see, the apa function got the values we wanted and reported them in proper APA style. The apa function will even automatically adapt the output for Chi-Square and correlation tests if you enter such a test object. Let’s see how it works on a correlation test where we correlate a pirate’s age with the number of parrots she has owned:
# Print an APA style conclusion of the correlation
# between a pirate's age and # of parrots
age.parrots.ctest <- cor.test(formula = ~ age + parrots,
data = pirates)
# Pring result
age.parrots.ctest
##
## Pearson's product-moment correlation
##
## data: age and parrots
## t = 6, df = 1000, p-value = 1e-09
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
## 0.13 0.25
## sample estimates:
## cor
## 0.19
# Print the apa style conclusion!
yarrr::apa(age.parrots.ctest)
## [1] "r = 0.19, t(998) = 6.13, p < 0.01 (2-tailed)"
The apa function has a few optional arguments that control things like the number of significant digits in the output, and the number of tails in the test. Run ?apa
to see all the options.
13.6 Test your R might!
The following questions are based on data from either the movies
or the pirates
dataset in the yarrr package. Make sure to load the package first to get access to the data!
Do male pirates have significantly longer beards than female pirates? Test this by conducting a t-test on the relevant data in the pirates dataset. (Hint: You’ll have to select just the female and male pirates and remove the ‘other’ ones using
subset()
)Are pirates whose favorite pixar movie is Up more or less likely to wear an eye patch than those whose favorite pixar movie is Inside Out? Test this by conducting a chi-square test on the relevant data in the pirates dataset. (Hint: Create a new dataframe that only contains data from pirates whose favorite move is either Up or Inside Out using . Then do the test on this new dataframe.)
Do longer movies have significantly higher budgets than shorter movies? Answer this question by conducting a correlation test on the appropriate data in the movies dataset.
Do R rated movies earn significantly more money than PG-13 movies? Test this by conducting a t-test on the relevant data in the movies dataset.
Are certain movie genres significantly more common than others in the movies dataset? Test this by conducting a 1-sample chi-square test on the relevant data in the movies dataset.
Do sequels and non-sequels differ in their ratings? Test this by conducting a 2-sample chi-square test on the relevant data in the movies dataset.


Submit an Cannabis Retail Store Application and track the status below.
Due to the high volume of applications, we ask that you limit questions about the status of your application as much as possible. Answering fewer questions provides us more capacity to process applications.
We will contact you regarding your application as soon as we have an update to communicate, have information that you will need to know, or are requesting additional information from you.
Thank you for your patience.
You do not have any In Progress Applications.
| Application | Status | Actions | |
|---|---|---|---|
| {{i+1}} |
{{item.establishmentName}} Application No: {{item.jobNumber}} Reference #: {{item.name}} |
{{item.applicationStatus}}
This application has not yet been submitted. This relocation application has not yet been submitted This transfer application has not yet been submitted Your application has been received and is being reviewed by the LCRB. Your transfer application has been received and is being reviewed by the LCRB. Your relocation application has been received and is being reviewed by the LCRB. Your application is incomplete. You must provide additional information for it to be processed. Your application has been sent for local government, financial integrity, and security screening reviews. Your application has been approved in principle. An inspector will be contacting you to organize a final inspection. |
0">Here are your current approved Cannabis Retail Store Licences.
You do not have any Licenced Stores.
| Licence | Location | Actions | |
|---|---|---|---|
| {{i+1}} |
{{item.establishmentName}} Application No: {{item.jobNumber}} Reference #: {{item.name}} |
{{item?.establishmentAddressStreet}} {{item?.establishmentAddressCity}} British Columbia {{item?.establishmentAddressPostalCode}} Canada |
Pay Licence Fee
Renew Licence
Download Licence
[Beta] Request Relocation |


| Package | org.igniterealtime.xiff.core |
| Class | public class XMPPBOSHConnection |
| Inheritance | XMPPBOSHConnection XMPPConnection flash.events.EventDispatcher |
Using BOSH do not prevent your application from respecting Adobe Flash Player policy file issues. HTTP requests to your server must be authorized with a crossdomain.xml file in your webserver root.
For eJabberd users : if your crossdomain policy file cannot be served by your server, this issue can be solved with an Apache proxy redirect so that any automatic Flash/Flex calls to an URL like http://xmppserver:5280/crossdomain.xml will be redirected as an URL of your choice such as http://webserver/crossdomain.xml
Warning: if you are using BOSH through HTTPS, your crossdomain policy file must also be served through HTTPS. Your application (if online) must also be served through HTTPS else you will have a crossdomain policy issue. This issue can be solved by using the secure property of the allow-access-from node in the crossdomain.xml file. But this is not recommended by Adobe.
See also
| Property | Defined by | ||
|---|---|---|---|
| boshPath : String | XMPPBOSHConnection | ||
| compress : Boolean
Shall the zlib compression be allowed if the server supports it.
| XMPPConnection | ||
| domain : String
The XMPP domain to use with the server.
| XMPPConnection | ||
| hold : uint | XMPPBOSHConnection | ||
| httpServer : String [read-only]
Server URI
| XMPPBOSHConnection | ||
| ignoreWhiteSpace : Boolean
Determines whether whitespace will be ignored on incoming XML data.
| XMPPConnection | ||
| incomingBytes : uint
Get the count of the received bytes.
| XMPPConnection | ||
| jid : UnescapedJID
Gets the fully qualified unescaped JID of the user.
| XMPPConnection | ||
| maxConcurrentRequests : uint | XMPPBOSHConnection | ||
| openConnections : Array [static]
| XMPPConnection | ||
| outgoingBytes : uint
Get the count of current bytes sent by this connection
| XMPPConnection | ||
| password : String
The password to use when logging in.
| XMPPConnection | ||
| port : uint
The port to use when connecting.
| XMPPConnection | ||
| queuePresences : Boolean
Should the connection queue presence events for a small interval so that it can send multiple in a batch?
| XMPPConnection | ||
| resource : String
The resource to use when logging in.
| XMPPConnection | ||
| secure : Boolean
HTTP bind requests type.
| XMPPBOSHConnection | ||
| server : String
The XMPP server to use for connection.
| XMPPConnection | ||
| useAnonymousLogin : Boolean
Whether to use anonymous login or not.
| XMPPConnection | ||
| username : String
The username to use for connection.
| XMPPConnection | ||
| wait : uint | XMPPBOSHConnection |
| Method | Defined by | ||
|---|---|---|---|
|
XMPPBOSHConnection(secure:Boolean = false)
| XMPPBOSHConnection | ||
|
changePassword(newPassword:String):void
Changes the user's account password on the server.
| XMPPConnection | ||
|
connect(streamType:uint = 0):Boolean
| XMPPBOSHConnection | ||
|
disableSASLMechanism(name:String):void
[static]
| XMPPConnection | ||
|
disconnect():void
| XMPPBOSHConnection | ||
|
getRegistrationFields():void
Issues a request for the information that must be submitted for registration with the server.
| XMPPConnection | ||
|
isActive():Boolean
Determines whether the connection with the server is currently active.
| XMPPConnection | ||
|
isLoggedIn():Boolean
Determines whether the user is connected and logged into the server.
| XMPPConnection | ||
|
pauseSession(seconds:uint):Boolean
| XMPPBOSHConnection | ||
|
processConnectionResponse(responseBody:XMLNode):void
| XMPPBOSHConnection | ||
|
registerSASLMechanism(name:String, authClass:Class):void
[static]
| XMPPConnection | ||
|
send(o:XMPPStanza):void
Sends data to the server.
| XMPPConnection | ||
|
sendKeepAlive():void
| XMPPBOSHConnection | ||
|
sendRegistrationFields(fieldMap:Object, key:String):void
Registers a new account with the server, sending the registration data as specified in the fieldMap
| XMPPConnection |
| Method | Defined by | ||
|---|---|---|---|
|
changePassword_result(resultIQ:IQ):void
| XMPPConnection | ||
|
chooseStreamTags(type:uint):void
Choose the stream start and ending tags based on the given type.
| XMPPConnection | ||
|
configureAuthMechanisms(mechanisms:XMLNode):void
Use the authentication which is first in the list (saslMechanisms) if possible.
| XMPPConnection | ||
|
configureStreamCompression():void
Ask the server to enable Zlib compression of the stream.
| XMPPConnection | ||
|
createSocket():void
| XMPPConnection | ||
|
flushPresenceQueue(event:TimerEvent):void
| XMPPConnection | ||
|
getRegistrationFields_result(resultIQ:IQ):void
| XMPPConnection | ||
|
handleBindError(packet:IQ):void
Error handler callback
| XMPPConnection | ||
|
handleNodeType(node:XMLNode):void
| XMPPBOSHConnection | ||
|
handleStreamFeatures(node:XMLNode):void
| XMPPConnection | ||
|
handleStreamTLS(node:XMLNode):void
| XMPPConnection | ||
|
parseDataReceived(bytedata:ByteArray):void
Parses the data which the socket just received.
| XMPPConnection | ||
|
restartStream():void
| XMPPBOSHConnection | ||
|
sendXML(someData:*):void
| XMPPBOSHConnection | ||
|
socketClosed(event:Event):void
| XMPPConnection | ||
|
socketConnected(event:Event):void
| XMPPConnection | ||
|
socketDataReceived(event:ProgressEvent):void
| XMPPConnection |
| Constant | Defined by | ||
|---|---|---|---|
| BOSH_VERSION : String = "1.6" [static]
| XMPPBOSHConnection | ||
| HTTP_PORT : uint = 7070 [static]
The default port as per XMPP specification.
| XMPPBOSHConnection | ||
| HTTPS_PORT : uint = 7443 [static]
The default secure port as per XMPP specification.
| XMPPBOSHConnection | ||
| STREAM_TYPE_FLASH : uint = 2 [static]
Stream type lets user set opening/closing tag.
| XMPPConnection | ||
| STREAM_TYPE_FLASH_TERMINATED : uint = 3 [static]
Stream type lets user set opening/closing tag.
| XMPPConnection | ||
| STREAM_TYPE_STANDARD : uint = 0 [static]
Stream type lets user set opening/closing tag.
| XMPPConnection | ||
| STREAM_TYPE_STANDARD_TERMINATED : uint = 1 [static]
Stream type lets user set opening/closing tag.
| XMPPConnection |
| boshPath | property |
boshPath:String
[read-write]Implementation
public function get boshPath():String
public function set boshPath(value:String):void
| hold | property |
hold:uint
[read-write]Implementation
public function get hold():uint
public function set hold(value:uint):void
| httpServer | property |
httpServer:String
[read-only]Server URI
Implementation public function get httpServer():String
| maxConcurrentRequests | property |
maxConcurrentRequests:uint
[read-write]Implementation
public function get maxConcurrentRequests():uint
public function set maxConcurrentRequests(value:uint):void
| secure | property |
secure:Boolean
[read-write]HTTP bind requests type. If secure, the requests will be sent through HTTPS. If not, through HTTP.
Implementation public function get secure():Boolean
public function set secure(value:Boolean):void
| wait | property |
wait:uint
[read-write]Implementation
public function get wait():uint
public function set wait(value:uint):void
| XMPPBOSHConnection | () | constructor |
public function XMPPBOSHConnection(secure:Boolean = false)
Parameters
secure:Boolean (default = false ) — Determines which port is used
|
| connect | () | method |
public override function connect(streamType:uint = 0):Boolean
Parameters
streamType:uint (default = 0 )
|
Boolean |
| disconnect | () | method |
public override function disconnect():void
| handleNodeType | () | method |
protected override function handleNodeType(node:XMLNode):void
Parameters
node:XMLNode |
| pauseSession | () | method |
public function pauseSession(seconds:uint):Boolean
Parameters
seconds:uint |
Boolean — true if pause request is sent
|
| processConnectionResponse | () | method |
public function processConnectionResponse(responseBody:XMLNode):void
Parameters
responseBody:XMLNode |
| restartStream | () | method |
protected override function restartStream():void
| sendKeepAlive | () | method |
public override function sendKeepAlive():void
| sendXML | () | method |
protected override function sendXML(someData:*):void
Parameters
someData:* |
| BOSH_VERSION | constant |
public static const BOSH_VERSION:String = "1.6"
The default value is 1.6
.
| HTTP_PORT | constant |
public static const HTTP_PORT:uint = 7070
The default port as per XMPP specification.
The default value is 7070
.
| HTTPS_PORT | constant |
public static const HTTPS_PORT:uint = 7443
The default secure port as per XMPP specification.
The default value is 7443
.


An experiment by Tom McCracken.
Link to GitHub repository
containing source, demonstration/documentation (this page) and license for use.
Link to GitHub repository
containing source, demonstration/documentation (this page) and license for use.
A fluid simulation web experiment based on smoothed particle hydrodynamics.
Link to demonstration.
The aim of this project is to develop a fluid simulation web experiment based on smoothed particle hydrodynamics (SPH).
Most fluid simulations are centered around solving the Navier–Stokes equations for the motion of viscous fluids. These simulations are generally based on one of the following methods:
This simulation uses SPH, a "particle" method, to calculate fluid densities, pressures and fluid forces (pressure force and viscosity force). The fluid particles are advected based on these forces using a position based "Verlet" numerical time integration scheme.
The density and force calculations used in this SPH implementation are generally based on this paper. Note: The surface tension force described in the paper has not been implemented at this time.
SPH is a computational method for simulating continuum mechanics. In this simulation the fluid is discretised as a collection of particles. A physical quantity of the fluid, at a particular particle, can be determined by summing the weighted relevant properties of all neighbouring particles. The weighting is achieved using a kernel function with a range proportional to the characteristic smoothing length. The smoothing kernels implemented for this simulation have a range exactly equal to the smoothing length. This is computationally advantageous as it avoids square root operations. The following key steps are involved in the simulation:
Apply initial conditions
Loop while simulating
For all particles
Find neighbours
For all particles
Calculate density using SPH
Approximate pressure from density
For all particles
Calculate pressure force using SPH
Calculate viscosity force using SPH
Apply gravity force
Collision detection and response
Time integration
Render scene
Note: The core logic of this standalone fluid simulation project was originally developed as part of an update to the particle based physics engine jsRubble. Some additional functionality from jsRubble has also been included to enable richer demonstration scenes. This includes a constraint solver (with support for distance, point and contact constraints) and a main loop with decoupled physics and rendering updates.
The particles are advected based on the calculated forces using the Verlet integration scheme. This approach makes position based constraints trivial to implement.
A key part of the SPH method, and a significant contributor to simulation computational cost, involves searching for a particle's neighbours. Due to the selected kernel functions described above, the neighbour search needs to identify all particles within a circle with a radius equal to the smoothing length.
One simple but naive approach to this involves checking each particle against every other particle. (time complexity of ON²). Whilst this might be adequate for simulations involving relatively small numbers of particles, a more sophisticated approach would be required as particle count increases.
Spatial partitioning can improve performance by reducing the number of particle nieghbour pair checks. This simulation implements a "grid" based scheme where the domain is divided up into a collection of "bins" using a high level grid construct. The grid extends across the entire domain and is determined at the beginning of the simulation based on the selected SPH smoothing length (ie bin height/width equals smoothing length). The initial stage of performing a neighbour search involves iterating over all particles and determining what bin each particle resides within. After this process, a neighbour search for a particular particle only needs to consider particles located within the bins immediately adjacent to the particle.
Another approach might involve using a spatial hash. Similar to the grid method, the spatial hash divides the domain up into "bins". Rather that attaching fixed bins to a fixed grid, a spatial hash uses a hash table to store a list of particles in a dictionary where the x and y co-ordinate of the bin makes up the key to the value. This approach enables the spatial hash to grow and shrink to encompass only the portions of the domain that are occupied by particles. This data structure aligns with one of the inherent advantages of particle based methods, ie that the fluid can travel within a nearly "infinite" domain (limited by computer science constraints).
Once the number of particles reaches a certain tipping point, the overhead computational cost of applying a spatial partitioning technique will be offset by the significantly reduced time complexity associated with checking a much smaller subset of the collection of particles.
This project uses a simple approach to rendering.
The contact radius of each particle (ie the radius at which a particle can contact another particle or a world boundary) is rendered as a dark blue circle.
The smoothing length of each particle is represented as a blue circle with a translucency gradient that approaches full transparency at the smoothing length.
Fixed non-fluid particles are rendered as red circles, dynamic non-fluid particles are rendered as green circles.
A "debug draw" mode can also be activated which displays contact constraints, particle numbers, a representation of the spatial partitioning scheme and more definitive particle smoothing length circumferences.


Create particles by drawing with your mouse.
Gravity
Gravity Angle
Restitution
Friction
Drag
Mouse Mass


Fetch Data
Toggle Toolbar
Grid Assistant
Voltage Contour
Voltage Visualization
State Demands
Demand Frequency
Power Flow Visualization
ClearConsole


Squawk 7x00 is reported and shown.
This is most likely an error in receiving or decoding.
Please do not call the local authorities, they already know about it if it is a valid squawk.
Problem fetching data from dump978.
The displayed map data will be out of date.


You are here:
Your rights, crime and the law
Crime and police
Abuse, family matters and protection orders
Domestic violence orders
Prepare your application for a protection order
Prepare your application for a protection order
Licence
Last updated
26 April 2016
Prepare your application for a protection order
Before you begin
What you need
1
Your situation
2
Who needs protection?
3
Who do they need protection from?
4
Relationship
5
Grounds
6
Conditions
7
Urgent applications
What we need to know at court
8
Aggrieved details
9
Children
10
Relatives/associates
11
Respondent details
12
Other orders
13
Applicant details
Applying for a protection order
14
Preparing for court
15
Download your application


Kogi polls: Thugs attack journalists at Ayaingba - The Nation Newspaper
Agency Reporter
Thugs suspected to belong one of the political parties contesting in the Governorship and National Assembly elections in Kogi, have allegedly attacked Mr Sam Egwu of the Leadership newspaper and Mr Sunday Omachi of Radio Kogi.
The News Agency of Nigeria (NAN) reports that the incident happened at Ayaingba.
Both journalists were on election duty when they were attacked by the hoodlums at Unity Roundabout , Ayaingba.
READ ALSO: Kogi polls: Group cautions against inflammatory statements
Meanwhile, the Commissioner of police in the state, Mr Akeem Busari, said reinforcements had been sent to Ayaingba to bring the situation under control.
Busari, however, has yet to confirm arrests over the incident.
(NAN)


Defined in generated file: python/ops/gen_string_ops.py
Converts each string in the input Tensor to its hash mod by a number of buckets.
tf.compat.v1.string_to_hash_bucket_fast
tf.compat.v1.strings.to_hash_bucket_fast
tf.compat.v2.strings.to_hash_bucket_fast
tf.strings.to_hash_bucket_fast( input, num_buckets, name=None )
The hash function is deterministic on the content of the string within the
process and will never change. However, it is not suitable for cryptography.
This function may be used when CPU time is scarce and inputs are trusted or
unimportant. There is a risk of adversaries constructing inputs that all hash
to the same bucket. To prevent this problem, use a strong hash function with
tf.string_to_hash_bucket_strong
.
input
: A Tensor
of type string
. The strings to assign a hash bucket.num_buckets
: An int
that is >= 1
. The number of buckets.name
: A name for the operation (optional).A Tensor
of type int64
.


Here is a list of my top 5 favorite places to travel.
If you want to travel to some of these places, visit Google Flights to find tickets to fun destinations.


--- layout: post authors: ["Greg Wilson"] title: The Missing Side of the Triangle date: 2013-02-03 time: "11:00:00" tags: ["Opinion"] ---
A few weeks ago, John Cook posted the following:
In a review of linear programming solvers from 1987 to 2002, Bob Bixby says that solvers benefited as much from algorithm improvements as from Moore's law.
Three orders of magnitude in machine speed and three orders of magnitude in algorithmic speed add up to six orders of magnitude in solving power. A model that might have taken a year to solve 10 years ago can now solve in less than 30 seconds.
A million-fold speedup is pretty impressive, but faster hardware and better algorithms are only two sides to the triangle. The third is development time, and while I think it has improved since 1987, I also think the speedup is measured in single-digit multiples, not orders of magnitude.
Which brings us, again, to Amdahl's Law and the purpose of Software Carpentry. The time needed to produce a new computational result is D+R, where D is how long it takes to get the code to work and R is how long it takes that code to run. R depends on hardware and algorithms; as it goes to zero, the time required to get a new result is dominated by the time required to write, test, maintain, install, and configure software [1]. Reducing that is the "effiency" part of our long-term aim to improve novelty, efficiency, and trust.
[1] In practice, R doesn't go to zero for many interesting scientific applications, because scientists scale up their problems to keep running times constant. (As a colleague of mine once said, every simulation takes roughly one publication cycle to run.)


--- layout: post title: "Replace overloading with Discriminated Unions" description: "In F#, Discriminated Unions provide a good alternative to overloading." date: 2013-10-21 7:15 UTC tags: [F#, Software Design] --- {% include JB/setup %}
{{ page.description }}
When you're learning a new programming language, you may experience these phases:
From C#, I'm used to method overloading as a design technique to provide an API with easy-to-learn default methods, and more complicated, but more flexible, methods - all in the same family of methods. Alas, in F#, function overloading isn't possible. (Well, method overloading is still possible, because you can create .NET classes in F#, but if you're creating a module with free-standing functions, you can't have two functions with the same name, but different parameters.)
This really bothered me until I realized that F# has other language constructs that enable you to approach that problem differently. Discriminated Unions is one such language construct.
Recently, I was working with a little module that enabled me to list a range of dates. As an example, I wanted to be able to list all dates in a given year, or all dates in a given month.
My first attempt looked like this:
module Dates = let InitInfinite (date : DateTime) = date |> Seq.unfold (fun d -> Some(d, d.AddDays 1.0)) let InYear year = DateTime(year, 1, 1) |> InitInfinite |> Seq.takeWhile (fun d -> d.Year = year) let InMonth year month = DateTime(year, month, 1) |> InitInfinite |> Seq.takeWhile (fun d -> d.Month = month)
These functions did what I wanted them to do, but I found the names awkward. The InYear and InMonth functions are closely related, so I would have liked to call them both In, as I would have been able to do in C#. That would have enabled me to write code such as:
let actual = Dates.In year
and
let actual = Dates.In year month
where year
and month
are integer values. Alas, that's not possible, so instead I had to settle for the slightly more clumsy InYear:
let actual = Dates.InYear year
and InMonth:
let actual = Dates.InMonth year month
That is, until I realized that I could model this better with a Discriminated Union.
After a day or so, I had one of those small revelations described in Domain-Driven Design: implicitly, I was working with a concept of a period. Time to make the implicit concept explicit:
type Period = | Year of int | Month of int * int module Dates = let InitInfinite (date : DateTime) = date |> Seq.unfold (fun d -> Some(d, d.AddDays 1.0)) let private InYear year = DateTime(year, 1, 1) |> InitInfinite |> Seq.takeWhile (fun d -> d.Year = year) let private InMonth year month = DateTime(year, month, 1) |> InitInfinite |> Seq.takeWhile (fun d -> d.Month = month) let In period = match period with | Year(y) -> InYear y | Month(y, m) -> InMonth y m
Notice that I defined a Period Discriminated Union outside the module, because it enables me to write client code like:
let actual = Dates.In(Year(year))
and
let actual = Dates.In(Month(year, month))
This syntax requires slightly more characters than the previous alternative, but is (subjectively) more elegant.
If you prefer, you can refactor the In function to:
let In = function | Year(y) -> InYear y | Month(y, m) -> InMonth y m
You may have noticed that this implementation still relies on the two private functions InYear and InMonth, but it's easy to refactor the In function to a single function:
let In period = let generate dt predicate = dt |> InitInfinite |> Seq.takeWhile predicate match period with | Year(y) -> generate (DateTime(y, 1, 1)) (fun d -> d.Year = y) | Month(y, m) -> generate (DateTime(y, m, 1)) (fun d -> d.Month = m)
As you can see, the introduction of a Period Discriminated Union enabled me to express the API in a way that closely resembles what I originally envisioned.
Once I made the change to a Discriminated Union, I discovered that I could make my API richer. Soon, I had this Dates module:
type Period = | Year of int | Month of int * int | Day of int * int * int module Dates = let InitInfinite (date : DateTime) = date |> Seq.unfold (fun d -> Some(d, d.AddDays 1.0)) let In period = let generate dt predicate = dt |> InitInfinite |> Seq.takeWhile predicate match period with | Year(y) -> generate (DateTime(y, 1, 1)) (fun d -> d.Year = y) | Month(y, m) -> generate (DateTime(y, m, 1)) (fun d -> d.Month = m) | Day(y, m, d) -> DateTime(y, m, d) |> Seq.singleton let BoundariesIn period = let getBoundaries firstTick (forward : DateTime -> DateTime) = let lastTick = forward(firstTick).AddTicks -1L (firstTick, lastTick) match period with | Year(y) -> getBoundaries (DateTime(y, 1, 1)) (fun d -> d.AddYears 1) | Month(y, m) -> getBoundaries (DateTime(y, m, 1)) (fun d -> d.AddMonths 1) | Day(y, m, d) -> getBoundaries (DateTime(y, m, d)) (fun d -> d.AddDays 1.0)
Notice that I added a Day
case. Originally, I didn't think it would be valuable, as Dates.In(Day(year, month, day))
seemed like quite a convoluted way of saying DateTime(year, month, day)
. However, it turned out that the In
abstraction was valuable, also with a single day - simply because it's an abstraction.
Additionally, I then discovered the utility of a function called BoundariesIn, which gives me the boundaries of a Period - that is, the very first and last tick of the Period.
It's easy to become frustrated while learning a new programming language. In F#, I was annoyed by the lack of function overloading, until I realized that a single function taking a Discriminated Union might actually be a richer idiom.


Connect to LOGIC, INFORMATION AND COMP. in the Course Register.
LOGIC, INFORMATION AND COMP.
LGIC-010 FORMAL LOGIC I 1 CU FORMAL REASONING COURSE 401 LEC MW 10-11AM ANNS 111 SINGER D CROSS LISTED: PHIL-005 MAX W/CROSS LIST: 67 RECITATION 0 CU 402 REC F 12-1PM WILL 421 BARNETT M CROSS LISTED: PHIL-005 MAX W/CROSS LIST: 30 403 REC F 11-12NOON WILL 421 BARNETT M CROSS LISTED: PHIL-005 MAX W/CROSS LIST: 30 LGIC-220 DISCRETE MATHEMATICS II 1 CU 401 LEC TR 1:30-3PM DRLB 4C2 TOWSNER H CROSS LISTED: MATH-341 SECTION MAX: 15 MAX W/CROSS LIST: 30
Return to Course & Room Roster
Comments to:
Office of the University Registrar
University of Pennsylvania
Room 221 Franklin Building
3451 Walnut Street
Philadelphia, PA 19104-6291
Phone:<PHONE_NUMBER> Fax:<PHONE_NUMBER>
<EMAIL_ADDRESS>Updated: Sat Jan 17 08:30:02 2015


99 Red Beacons Tracker is the application that goes alongside the artwork "99 Red Beacons" for Nuit Blanche Ottawa + Gatineau.
99 flashing red balloons tour the city, each one with a morse code message of a member of the Canadian Armed Forces. Inspired by the Cold War song 99 Luftballons, "99 Red Beacons" deals with the themes of invisible communication & military influence. This is the application that tracks the participants of the artwork during the night to be displayed at SAW Gallery. This application was made possible because of the generosity of Nuit Blanche Ottawa + Gatineau, Ontario Arts Council, and SAW Gallery.
This app collects and transmits your position for the purpose of the Nuit Blanche 2013 art installation. It will continue to run in the background unless you turn off the GPS toggle. Your position is sent with a unique id, but no other identifying information. Your data will not be resold or distributed to any third parties.
Made possible by...


Toggle navigation
Neighborhood map
Weather
Filter spots
Sorry, Google Maps could not be loaded
×
/10
Pictures from flickr
Loading pictures...
Pictures could not be loaded
Address:
Opening hours:
Failed to get venue details from Foursquare
Links:
Website
Foursquare
Facebook
Twitter
flickr
Wikipedia
Wikipedia failed
Could not get data from Foursquare
Top tip from Foursquare
Failed to get tips from Foursquare
×
Weekly forecast for Trondheim
No weather data could be found


| Class | ActiveRecord::Base |
| In: |
lib/search.rb
vendor/plugins/rspec_on_rails/lib/spec/rails/extensions/active_record/base.rb |
| Parent: | Object |
Search the movie database for the given parameters:
text = a string to search for :only => an array of fields in which to search for the text; default is 'all text or string columns' :except => an array of fields to exclude from the default searchable columns :case => :sensitive or :insensitive :include => an array of tables to include in the joins. Fields that have searchable text will automatically be included in the default set of :search_columns. :join_include => an array of tables to include in the joins, but only for joining. (Searchable fields will not automatically be included.) :conditions => a string of additional conditions (constraints) :offset => paging offset (integer) :limit => number of rows to return (integer) :order => sort order (order_by SQL snippet)
Extension for should have on AR Model instances
model.should have(:no).errors_on(:attribute) model.should have(1).error_on(:attribute) model.should have(n).errors_on(:attribute)


Start-up of the Week: UnitX - Making supercomputers accessible and affordable
RIYADH: Saudi Minister of Labor and Social Development Ahmed bin Suleiman Al-Rajhi has issued a decision in partnership with the Health Ministry to gradually localize, in two phases, the dental profession in the Kingdom.
The first phase will target the localization of 25 percent of the institutions as of March 26, 2020, while the second phase will target the localization of 30 percent of the institutions as of Aug. 20, 2020.
The ministry’s spokesman, Khaled Aba Al-Khail, said that the decision to localize the dental profession would be applied to institutions where the number of expatriates exceeded three dentists.
The decision comes within the implementation of the Localization of Professions Initiative, one of the ministry’s initiatives announced on Oct. 1, 2018, in partnership with the Ministry of Health, the Council of Saudi Chambers, the Saudi Commission for Health Specialties, and the Human Resources Fund (HRF), and aims to provide suitable job opportunities for citizens in vital disciplines.
Al-Khail pointed out that the ministry would take all necessary measures to ensure the institutions’ commitment to implement the decision.
Any institution that violates it will be penalized.
It should be noted that mechanisms have been put in place to support and stimulate training and employment within the HRF programs.


Enhances standard checkbox and radio input element to themeable buttons with appropriate hover and active styles.
Want to learn more about the checkboxradio widget? Check out the API documentation.


pyrex.io.HDF5Reader¶
-
class
pyrex.io.
HDF5Reader
(filename, slice_range=None)¶ Class for reading data from an hdf5 file.
Works as a context manager and allows for reading simulation/real data or analysis-level data from the given file.
- Parameters
- filenamestr
File name to open in read mode.
- slice_rangeint, optional
Number of events to include in each slice when iterating the file. Loads the entire file at once by default. For large files specifying a value will result in the file being read in chunks, allowing for reduced memory consumption at the cost of some speed.
See also
pyrex.io.EventIterator
Class for iterating over event data from an hdf5 file.
- Attributes
- filenamestr
Name of the file (to be) opened.
is_open
Boolean of whether the file is currently open.
antenna_info
Antenna data from the file.
file_metadata
Metadata from the file’s metadata datasets.
Methods
close
()Close the hdf5 file.
get_waveforms
([event_id, antenna_id, …])Get waveform data from the file.
open
()Open the hdf5 file for reading.


Home
Photos
More About Me
Guess where I am?
Previous
Next
A graduation + hawaii family trip video I made ...
Social Media Links
Looking forward to meeting you!


Written by: Alexa Junge
Transcribed by: Eric Aasen
[Scene: Monica and Rachel's: everyone is there and they are watching an info-mercial that stars Joey.]
Host: Welcome everybody, welcome to Amazing Discoveries!
Phoebe: Oh, oh! It's on again!
Joey: You guys, can we please not watch this all right.
All: Shhhh!
Host: Folks, has this ever happened to you. You go to the refrigerator to get a nice glass of milk, (Joey is in the background struggling to open a cartoon of milk) and these darn cartons are so flingin'-flangin' hard to open.
Joey: (on tv) Oh, you said it Mike. (rips open the carton and spills milk on the counter) Aw! There's got to be a better way!
Mike: And there is Kevin.
Joey: Can we please turn this off?
Rachel: Noo way, Kevin.
Mike: There is a revolutionary new product that guarantees that you'll never have to open up milk cartons again. Meet the Milk Master 2000.
Ross: (to Chandler) Are you intrigued?
Chandler: You're flingin'-flangin' right I am!
Mike: Keep in mind, he's never used this product before, you're gonna see how easy this is to do. (to Kevin) Go ahead. ('Kevin' starts using the product, it is a spout that you jab into a paper milk carton so that you don't have to rip it open.) This works with any milk carton.
Joey: (on TV, finishing installing the Milk Master 2000) Wow, it is easy. (starts to poor the milk) Now, I can have milk everyday.
(They all start laughing at him)
Opening Credits
[Scene: Central Perk, Chandler, Monica, Janice are sitting on the couch, and Phoebe is sitting next to them in the chair.]
Chandler: Well, it's official there are no good movies.
Janice: Well, let's go to a bad one and make out. (they start to kiss and lean back into Monica.)
Monica: Perhaps, you would like me to turn like this, (turns sideways on the couch) so that you can bunny bump against my back.
Joey: (entering) Hey!
Phoebe: Hey.
Chandler: Hey, man. What's up?
Joey: Maybe you can tell me. My agent would like to know why I didn't show up at the audition I didn't know I had today. The first good thing she gets me in weeks. How could you not give me the message?!
Chandler: Well, I'll tell ya I do enjoy guilt, but, ah, it wasn't me.
Phoebe: Yes, it was! It was him! Uh huh! (they all stare at her) Okay, it was me!
Joey: How is it you?
Phoebe: Well, it was just, it was all so crazy, you know. I mean, Chandler was in the closet, counting to 10, and he was up to 7 and I hadn't found a place to hide yet.  See, all of it. (shows him her hand)
Joey: Yep, that's my audition.
Monica: See, now this is why I keep notepads everywhere.
Phoebe: Yep, and that's why we don't invite you to play.
Janice: What is the great tragedy here?
Joey: Well, Estelle tried, you know. The casting director told her that I missed my chance.
Phoebe: That is unfair. I'll call her and tell her it was totally my fault.
Joey: Pheebs, you can't do that. The casting director doesn't talk to friends, she only talks to agents.
 Okay, ooh (starts dialing).
Joey: What, what are you doing? What are you doing?
Phoebe: No, no, no, I know, I know, ooh. (on the phone in a different voice) 'Hi, this is Katelynn, from Phoebe Buffay's office. Um, is um, Ann there for Phoebe, she'll know what it's about.'
Joey: Hang up, hang up. (reaches with his good arm, but Phoebe grabs it and he tries to reach the phone with his other arm but can't because of the sling.)
Phoebe: (on phone) 'Annie! Hi. Listen we got a problem with Joey Tribbiani, apparently he missed his audition. Who did you speak to in my office? Estelle, no, I don't know what I'm going to do with her. No. All right, so your husband leaves and burns down the apartment, the world does not stop.'
Chandler: Is anybody else scared?
Phoebe: (on phone) 'Right, well look, um, if Joey loses this audition, that is it for Estelle. I don't care! Annie you are a doll, what time can you see him?' (to Monica) I need a pen. (Chandler hands her one, but she needs something to right on, so she tilts Chandler's head over and writes on the back of his neck)
Chandler: Get the woman a pad! Get the woman a pad! A pad! A pad!
Monica: Oh, now you want a pad.
[Scene: Monica and Rachel's, Carol and Susan are dropping off Ben]
Carol and Susan: (entering) Hey!!
Ross: There's my boy! Here's my boy! And here's his Barbi (Ben is holding a Barbi doll) What's ah, what's my boy doing with a Barbi?
Carol: He picked it out of the toy store himself, he loves it.
Susan: He carries it everywhere, it's like a security blanket, but with ski boots and a kicky beret.
Ross: Yeah, it's, it's, it's cute. Why, why, why does he have it, again?
Susan: So he's got a doll? So what? Unless you're afraid he's gonna grow up and be in show business.
Carol: This doesn't have anything to do with the fact that he is being raised by two women, does it?
Ross: You know what it's fine. If you're okay with the Barbi thing, so am I.
(cut to later in the day)
Ross: Give daddy the Barbi! Ben, give, give me the Barbi.  Why can't your son just play with his doll? (uses the Milk Master 2000 to pour milk into her cereal)
Monica: (entering from her bedroom) I gotta go to work. Has anybody seen my left boob?
Joey: I love that movie. (Joey is using it as a pillow)
Monica: There it is. Joey, what are you doing?
Joey: I'm sorry, it just felt nice.
Chandler: (entering with his ringing phone) Joe. Joe! Answer the phone.
Joey: Hey, I only got one good arm, you know. You should be doing stuff for me. Go get me a sweater.
Chandler: Just do it! Okay, it's Janice and if I get it I'm going to have to see her tonight. (phone stops ringing) Oh, that's great I'm gonna have to see her tonight.
Rachel: What's the big deal? Why don't you wanna see Janice?
Chandler: Okay, last night at dinner, when the meals came, she put half her chicken piccata on my plate and took my tomatoes.

Chandler: Noo.
Ross: You didn't want to share your tomatoes, tomatoes are very important to you.
Chandler: No, it's like all of the sudden, we were this couple. And this alarm started going off in my head: 'Run for your life! Get out of the building!'
Rachel: Men are unbelievable.
Monica: What is it with you people!

Monica: Oh, you mean like that guy thing where you act mean and distant until you get us to break up with you.
Joey: Hey, you know about that?!
Chandler: Look what do I do? I wanna get past this, I don't wanna be afraid of the commitment thing. I wanna go through the tunnel, to the other side!
(Joey looks quizzically at Ross)
Ross: (to Joey) Where there is no fear of commitment.
Chandler: Do we have any...(turns around and bumps Monica's fake chest) Do we have any thoughts here?
Joey: Well, I've never been through the tunnel myself, 'cause as I understand it, you're not allowed to go through with more than one girl in the car, right. But, it seems to me it's pretty much like anything else, you know, face your fear. It have a fear of heights, you go to the top of the building! If you're afraid of bugs.....get a bug. Right. In this case, you have a fear of commitment, so I say you go in there and be the most committed guy there ever was.
Rachel: Amazingly, that makes sense.
Chandler: You think?
Joey: Oh, yeah.
Chandler: Yeah, Joe, I assure you if I'm staring down the barrel of a gun, I'm pretty much peeing every which way.
[Scene: Central Perk, Phoebe's beeper is going off]
Phoebe: Oh, it's your audition from this morning. Can I use the phone again?
Rachel: Sure Pheebs, you know, that's what it's there for, emergencies and pretend agents.
Joey: Come on baby, come on!
Phoebe: (on phone, in 'Katelynn's' voice) 'Hi, I have Phoebe Buffay returning a page. Okay, well, um, she's in her car I'll have to patch you through.'
Rachel: Very nice touch.
 Well, I don't know about that, (Joey clears his throat to signify yes) except that I do and he will.  I would love to have lunch with you, how about we have lunch next....(hangs up phone) Op, went through a tunnel.
Rachel: Unbelievable.
Joey: Thank you so much.
Phoebe: It was really fun, I mean I've never talked on a car phone before.
Joey: You were amazing, could you just do me this huge favor, you see there's this one other audition that I really, really want, and Estelle couldn't get me in.
Phoebe: Oh, I don't know. I mean it was fun one time.
Joey: Come on, please, it'll be just this one more, well actually it's two.
Phoebe: Two?
Joey: Yeah! Well, well really it's three. Please. You're so good at it. I love you.
Phoebe: Okay, I'll do it, but just these three, right
Joey: Nooo, four.
[Scene: Chandler and Joey's, Chandler and Janice are having dinner]
Janice: So, how come you wanted to eat in tonight?
 I never really know what to say when someone you're sleeping with gives you contact paper.
Chandler: Well, wait there's, there's more. See the contact paper is to go into your brand new drawer. (gives her a drawer) See, the drawer actually goes in my dresser.
Janice: Oh, you didn't have to do this.
Chandler: Yes, I did. Yes, I did. Because, you're my girlfriend, and that's what girlfriends should, should get.
Janice: Well, I gotta buy a vowel. Because, oh my Gawd! Who, would've thought that someday, Chandler Bing would buy me a drawer.
Chandler: Well, not me. But that's what's happened, and, ah, and, and there's more. We should take a trip.
Janice: We should?
Chandler: Yep, we're a couple and that's what couples do. And, I wanna meet your parents. We should take a trip with your parents!
Janice: (laughs) I don't think we need to, because you're tripping me out right now! Are you okay?
Chandler: I am, I actually am. I mean this is amazing. My entire life I have feared this place, and now that I'm here it's like what was the big deal. I could probably say 'Let's move in together.' and I'd be okay.
Janice: You probably want us to move in together?
Chandler: It doesn't scare me!
Janice: Yeah, well, it scares me! I mean I not even divorced yet, Chandler. You know, you just invited me over here for pasta, and all of the sudden you're talking about moving in together. And, and I wasn't even that hungry. You know what, it's getting a little late, and I-I should just, um...(starts to leave)
Chandler: Oh, no, no, no, don't go! I've scared ya'! I've said too much! I'm hopeless, and awkward, and desperate for love!! (Janice leaves, Chandler then calls Janice to leave a message on her machine) Hey, Janice! It's me. Um, yeah, I-I-I just wanna apologize in advance for having chased you down the street. (runs out the door)
Commercial Break
[Scene: Monica and Rachel's, Monica and Rachel are comforting Chandler]
Rachel: Honey, this will help. (hands him a tub of ice cream)
Chandler: So, I finally catch up to her and she says this relationship is going to fast and we have to slow down.
Rachel and Monica: Uff.
Monica: That is never good.
Chandler: Then I got all needy and clingy.
Rachel: Okay, wait a minute, wait a minute, wait a minute. Maybe it's not so bad. How did you leave it?
Chandler: She said she'd call me.
Rachel and Monica: Ohh! (both grab there stomachs in pain)
Chandler: Oh God.
Monica: Welcome to our side of the tunnel.

Rachel: Yeah, well that's that lo-cal, non dairy, soy milk junk. We sort of, we save the real stuff for those really terminal cases.

Rachel: Yeah, you do.
Chandler: So, you don't think I'm terminal?
Monica: Well, no, not at all, you're not terminal, you just, you just need some damage control.
Chandler: Okay, okay. So, should I call her?
Rachel and Monica: Nooo!
Rachel: This is a very critical time right now.  You want her back you have to start acting aloof.
Monica: She has to know that your not ready.
Rachel: Right. So, what you have to do is, you have to accidentally run into her on purpose. And then act aloof.
Chandler: So I'm not, not gonna lose her?

Rachel: Oh.
[Scene: Monica and Rachel's, Ross is still trying to get Ben to play with something other than the Barbi doll.]
Ross: Guess who's here. It's the toughest guy in toy land, Ben. (singing) 'A real American hero. I'm G.I. Joe!' Drop the Barbi, drop the Barbi.
Rachel: G.I. Joe? Do you really think he's gonna fall for that?
Joey: (entering) G. I. Joe! Cool! Can I play?
Ross: Look Ben, it's a toy that protects U.S. oil interests overseas!
Joey and Ross: Go Joe!!!
Phoebe: (entering) Helloo! Oh! (sees Joey and starts to leave)
Joey: Pheebs! There you are!
Phoebe: No it's not, sorry.
Joey: But Phoebe, wait! Wait! Phoebe. Phoebe! (catches her in the hallway)
Phoebe: Oh, Joey! Oh, okay, see I didn't recognize you wearing, in those....pants.
Joey: Look listen, that TV movie I went in for? Did you hear anything? I think I got a shot at it.
Phoebe: Yes! They called and you didn't get it! Okay, I mean you didn't get it, I'm sorry, I'm sorry.
Joey: It's okay, these things happen.
Phoebe: But they shouldn't happen, you know what, you're, you're in a terrible, terrible business.
Joey: I'm, I'm okay. See. (tries to smile, but fails horribly)
Phoebe: Oh, now you're sad and creepy, oh. You know what, I, I'm sorry I quit, okay, I just quit.
Joey: No! No, no you can't quit! You're the best agent I ever had! Look Pheebs, rejection is part being an actor, you can't take it personally.
Phoebe: Not personal, really, well they said that they never met an Italian actor with a worse Italian accent.
Joey: They actually said that?
Phoebe: Yeah. Ooh God, there's that face again! See I can't do this job! I...
Joey: No, no, no, see that's why you have to do this job, agents always lie. You know, Estelle just says stuff like 'They went another way', but this, I can use this. (in a very bad Italian accent) I canna work on a new accent.
Phoebe: Yeah okay, no if it helps you okay. Yeah.
Ross: (running into the hall, in slow motion) You'll never get me, Joe!!! (he then pretends that he gets shot repeatedly and falls back against Joey and Chandler's door, dead.)
[Scene: A grocery store that Janice shops in. Chandler is on purpose, accidentally bumping into her.]
Janice: (to butcher) No, thank you. (Chandler makes a sound and she notices him) Chandler!
Chandler: (in a British accent) Hello, Janice.
Janice: What are you doing here?
Chandler: (in accent) Oh, just a bit of shopping. How've you been?

Chandler: (normal voice) No. Not anymore.
Janice: Why are you shopping here? You don't live in this neighborhood. Were you here waiting for me?
Chandler: Yeah, huh. I'm just uh, you know I'm just picking up some things for a party. (grabs a bag off of the shelf)
Janice: Barley? What kind of party serves barley?
Chandler: Well, I'm sorry if my friends aren't as sophisticated as yours.
Janice: Where is this party?
Chandler: Here in Chelsea.
Janice: Who's party is it?
Chandler: A woman's
Janice: What woman?!
Chandler: (shyly) Chelsea.
Janice: Okay, you know, one of two things is happening here.  Or, else you're pretending that you're seeing somebody, which just makes you so pathetic that I could start crying right here in the cereal aisle. So like which of these two guys do you want to be? (another guy walks by)
Chandler: Can I be that guy?
[Scene: Central Perk, Joey and Phoebe are there]
Phoebe: Okay, so we got some more good rejections, lots of stuff to work on.
Joey: Okay, shoot.
Phoebe: Okay, um, oh, the zoo commercial.
Joey: I didn't get it?
Phoebe: No. They said you 'Weren't believable as a human being.' So, you can work on that.
Joey: Okay, what else?
Phoebe: Um, the off-Broadway play people said 'You were pretty but dumb.'
Joey: Oh.
Phoebe: Oh no wait, I'm sorry, that's 'pretty dumb.'
Joey: Look, it's okay, no, no, no, really, look um, I really appreciate this Pheebs, but I think I'm gonna have to go back to Estelle.
Phoebe: Oh.

Phoebe: Yeah, no, I understand.
Joey: You do, thanks.
Phoebe: Yeah. Sorry. (she starts to leave)
Joey: Wait a minute.
Phoebe: What?
Joey: Wait a minute, did you just make up all that stuff just to get out of being my agent.
Phoebe: (in a coy tone) Oh, you caught me. I am so busted.
Joey: (in a really, really bad Italian accent) That's-ah what I suspected-ah.
[Scene: Chandler and Joey's, Chandler is laying on the counter and Rachel and Monica are comforting him again.]
Chandler: ....And then I just, you know, threw the bag of barley at her, and ran out of the store.
Monica: My God! Chandler, we said be 'aloof' not 'a doof'.
Chandler: I've actually ruined this haven't I? It's time for the good ice cream now, right?
Rachel: Yeah, it is.
Monica: You know what, everything's gonna be okay.
(phone rings)
Chandler: (answering phone) Hello. Hi, Janice! Can you hold on for a second? Okay. (to Monica and Rachel) Okay, what do I do?
Rachel: Shhh...I don't know what to do, this is totally unprecedented.
Monica: If-if-if we ever did what you did a man would never call.
Rachel: Yeah.
Chandler: Hello!
 Be sleepy.
Rachel: Yes, and grumpy.
Chandler: What are you, stop naming dwarves! (on phone) Hello, Janice. Hi, I'm so glad that you called, I know I've been acting a really weird lately. And, it's just because I'm crazy about you, and I just got...stupid, and, and scared, and....stupid a couple of more times. I'm sorry. (listens) Really?! (listens) Really?!
Rachel: He's soo lucky, if Janice were a guy, she'd be sleeping with somebody else by now.
Chandler: (on phone) I love you too.
Monica: Aw, it's soo unfair. (they both start digging into the 'good' ice cream)
[Scene: Monica and Rachel's, Carol and Susan are picking up Ben, while Monica is pouring chocolate syrup, lots of it, into her ice cream.]
Carol: G. I. Joe. G. I. Joe?!
Ross: Hey, I don't know what to tell you guys that's the doll he chose.
Susan: What'd you do, dip it in sugar?
Ross: Look, G. I. Joe's in, Barbi's out. And if you guys can't deal with it, that's your 'too bad.'
 So he has a Barbi, big deal.
Ross: What?
Monica: Well, you used to dress up in Mom's clothes all the time.
Ross: What are you talking about?
Monica: The big hat, the pearls, the little pick handbag.
Ross: Okay, you are totally making this up.
Monica: How can you not remember? You made us call you...Bea.
Ross: (remembering) Oh God.
Susan: I've literally never been this happy.
Monica: Wasn't there a little song?
Carol: Oh please God, let there be a song.
Ross: There was no song. (to Monica) There was no song!
Monica: (singing) 'I am Bea.'
Ross: Okay.
Monica: 'I drink tea.'
 '
Ross: (coming out of the bathroom) Won't you dance around with me.
Monica: A-ha!!! (they all start laughing, as Ross hides in the bathroom)
Closing Credits
[Scene: It's an old home movie of the Geller's backyard, young Ross is dressed up as Bea, and pouring himself/herself some tea.]
Young Ross: (singing) 'I am Bea. I drink tea. Won't you dance around with....' (spills some tea and it drips onto his/her dress) Ohhh! (runs away crying)
Young Monica: (entering the shot) Ross!!! (starts to wipe up the spill)
End