Compulsory Assignment
Please upload your solution to the fronter folder Compulsory paper Stat 210 2016. Each student is asked to hand in their own private solution. Please hand in only one file. The name of the file should start with your family name. It’s not important to type mathematical symbols nicely. You can, if you prefer, write longhand (by hand), scan and upload a pdf.
Please limit computer output as much as possible in your paper, and any computer output should be commented.
Exercise 1
You may use R or other statistical software for this exercise. The data for this exercise is called frystemp
and can be loaded from the file comp1.frystemp.RData
(all data sets are in the data folder of fronter). A lab has investigated the freezing temperature (called frystemp
in the dataset reproduced below) for three different brands (called merke
in the dataset).
Calculate mean and standard deviation for each brand. Calculate the overall mean (mean for all observations).
Table 4: Numerical Summary of frystemp
dataMean SD N merke1 -16.163 1.309 8 merke2 -13.562 1.283 8 merke3 -14.575 0.755 8 Overall -14.767 1.546 24 Consider the following model:
\[y_{ij} = \mu + \tau_i + \epsilon_{ij}, \; \text{ where, } \sum_{i = 1}^3\tau_i = 0\]
Here,
\[ \begin{aligned} y_{ij} &: \text{freezing temperature for each brand, } i = 1, 2, 3 \text{ and } j = 1, \ldots, 8 \\ \tau_i &: \text{effect of brand }i \end{aligned} \]
State the standard assumptions of the model. Use ANOVA to test if there is a difference between the brands. Formulate the hypothesis, carry out a test and formulate a conclusion. Give the ANOVA table.
The standard assumption of the model is, \[\epsilon_{ij} \sim N(0, \sigma^2)\]
It is also assumed that the \(y_{ij}\) are independent. The hypothesis for testing if there is a difference between the brands is,
\[ \begin{aligned} H_0 &: \tau_i = 0 \text{ for all } i \\ H_1 &: \tau_i \ne 0 \text{ for at least one } i \end{aligned} \]
The ANOVA table for the model is,
Table 5: ANOVA table for frystemp
modelDf Sum Sq Mean Sq F value Pr(>F) merke 2 27.48083 13.740417 10.48791 0.0006947 Residuals 21 27.51250 1.310119 Here, p-value \(\left(0.001\right)\) is much smaller than 0.05, so we reject \(H_0\) and claim that there is significant difference between
merke
at 95% confidence level.Estimate all parameters in the model.
The estimated parameters in the model can be obtained from model summary as below:
Table 6: Coefficient Estimate of Linear Model: frystemp
~merke
term estimate std.error statistic p.value \(\hat{\mu}\) -14.767 0.234 -63.202 0.000 \(\hat{\tau_1}\) -1.396 0.330 -4.224 0.000 \(\hat{\tau_2}\) 1.204 0.330 3.644 0.002 Table 6: Summary of Linear Model: frystemp
~merke
r.squared adj.r.squared sigma statistic p.value df df.residual 0.4997 0.4521 1.1446 10.4879 0.0007 3 21 From the output, we can estimate \(\tau_3\) from the assumption that the overall mean sum to zero. i.e. \(\hat{\tau}_3 = -\left(\tau_1 + \tau_2\right) = -(-1.4+1.2) = 0.192\)
Calculate confidence intervals for \(\tau_1 - \tau_2\), \(\tau_1 - \tau_3\) and \(\tau_2 - \tau_3\) using Tukey’s method. Are there any significant differences?
The confidence intervals for Tukey’s method can be computed as,
\[ \begin{aligned} \bar{y}_{i\cdot} - \bar{y}_{j\cdot} - q_\alpha (a, f)\sqrt{\frac{\text{MS}_\text{E}}{n}} &\le \mu_i - \mu_j\\ & \le \bar{y}_{i\cdot} - \bar{y}_{j\cdot} + q_\alpha (a, f)\sqrt{\frac{\text{MS}_\text{E}}{n}} &\le \mu_i - \mu_j, i \ne j \end{aligned} \]
since, \(\mu_i - \mu_j\) is same as \(\tau_i - \tau_j\), the conficence interval for group \(i\) and \(j\) can also be written as,
\[ \begin{aligned} \hat{\tau}_{i\cdot} - \hat{\tau}_{j\cdot} - q_\alpha (a, f)\sqrt{\frac{\text{MS}_\text{E}}{n}} &\le \mu_i - \mu_j\\ & \le \hat{\tau}_{i\cdot} - \hat{\tau}_{j\cdot} + q_\alpha (a, f)\sqrt{\frac{\text{MS}_\text{E}}{n}} &\le \mu_i - \mu_j, i \ne j \label{eqn:tukeyCI} \end{aligned} \]
Here we have,
\[ \begin{aligned} q_\alpha (a, f)\sqrt{\frac{\text{MS}_\text{E}}{n}} &= q_{0.05} (3, 21)\sqrt{\frac{1.310119}{8}} \\ &= 1.4425278 \label{eqn:tukeyCriteria} \end{aligned} \]
Further, this value is now compated with the absolute difference between the estimates. The difference between the estimates of various group-pairs are,
merke1 - merke2 merke1 - merke3 merke2 - merke3 -2.6 -1.5875 1.0125 If the absolute difference between two groups are larger than the value 1.443 than we reject the null hypothesis and claim that the pair are significantly different from each other. The R output for this test is,
Lower Center Upper Std.Err t value P(>t) merke1-merke2 -4.0425 -2.6000 -1.1575 0.5723 -4.543 0.0005 *** merke1-merke3 -3.0300 -1.5875 -0.1450 0.5723 -2.774 0.0294 * merke2-merke3 -0.4300 1.0125 2.4550 0.5723 1.769 0.2042 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Above output shows the difference between
merke2
andmerke1
whose interpretation will be same as the difference betweenmerke1
andmerke2
except the sign of Estimate and interval will switch. For instance, in this situation, the estimate will be -2.6 and the lower and upper confidence interval at 95% confidence level will be -4.043 and -2.600 respectively.The result shows that
marke1
is significantly different thanmarke2
andmarke3
at 95% confidence level.
Exercise 2 (Topic discussed at lecture August 23)
You are not supposed to use R or other statistical software for this exercise. (But you should use R to check. The dataset is ‘fett’ contained in the file comp2.fett.RData
).
We would like to investigate the fat concentration in milk (fettprosent
in the below data set). Three farms have been randomly selected and 5 cows from each farm (besetning
) is recruited to the study. The data is as given below:
Explain what is meant by a random effect and why
besetning
(farm) reasonably can be modeled as a random effect.In many situations, factors have infinitely many levels and a researcher randomly choose some of the levels and make inference about the whole population. Models with such factors are called Random effect models. In case of random effect model, the interest is on the population distribution of factor rather than some specific chosen levels.
For example, An experiment where some specific drugs are to be tested for their efficacy. A randomly chosen drug will barely be an interest in any experiment. Here, the experiment is oriented in finding the effect of those specific drugs and thus, this is the case of fixed effect model. While in another experiment where researcher is interested in finding if there is any differences between farm in Akershus area of Norway in the context of milk production. There can be many farms and the research is not interested on some specific farm but rather is interested on overal population of farm. So some farms are randomly choosen and are used to construct a model. This is the case of random effect model.
Consider the model, \[ \begin{aligned} y_{ij} &= \mu + \tau_i + \epsilon_{ij} \\ \tau_i &\sim \text{NID}\left(0, \sigma_\tau^2\right)\\ \epsilon_{ij} &\sim \text{N}\left(0, \sigma^2\right) \\ i &= 1, 2, 3\; j = 1, 2, \ldots 5\; N = 15 \end{aligned} \] Also, all random variables are independent
Use the output below:
Df Sum Sq F value Pr(>F) besetning 2 13.545 35.213 0.000009521 *** Residuals 12 2.308 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Estimate \(\sigma_\tau^2\) and \(\sigma^2\) and the correlation for animals from the same farm.
Here we can find \(\text{MS}_\text{treatment}\) and \(\text{MS}_\text{E}\) as,
\[ \begin{aligned} \text{MS}_\text{treatment} &= \frac{\text{SS}_\text{treatment}}{df_\text{treatment}} = 6.773 \\ \text{and, }\text{MS}_\text{E} &= \frac{\text{SS}_\text{E}}{df_\text{Error}} = 0.192 \end{aligned} \]
Therefore, we can find the estimates of variance components \(\hat{\sigma}_\tau^2\) and \(\hat{\sigma}^2\) as,
\[ \begin{aligned} \hat{\sigma}^2 &= \text{MS}_\text{E} = 0.192 \\ \hat{\sigma}_\tau^2 &= \frac{\text{MS}_\text{treatment}-\text{MS}_\text{E}}{n} \\ &= \frac{6.773 - 0.192}{5} = 1.316 \end{aligned} \]
Finally, the correlation for animals from the same farm is,
\[ \text{cor}(y_{ij}, y_{ik}) = \hat{\rho} = \frac{\hat{\sigma}_\tau^2}{\hat{\sigma}_\tau^2 + \hat{\sigma^2}} = \frac{1.32}{1.508} = 0.872 \]
Thus the correlation for animals from the same farm is 87.2 percent.
Is there a significant effect of
besetning
? Formulate the hypothesis and do the test.To test the significance of the random factor
besetning
, the hypothesis can be written as,\[ \begin{aligned} H_0 &: \sigma_\tau^2 = 0 \\ H_1 &: \sigma_\tau^2 > 0 \end{aligned} \]
Here, \(\sigma_\tau^2\) is the variation between farms and the null hypothesis states that there is no variation between farms. Given ANOVA table shows that the p-value corresponding to
besetning
is very small and thus we reject null hypothesis and claim that there is significant difference between farms. As this is a random effect model, the inference is made on just those specific farms but population of farms in general.Calculate a 99% confidence interval for \(\sigma^2\)
The confidence interval for \(\sigma^2\) at \(\alpha\) level of significance is,
\[\frac{\text{SS}_E}{\chi^2_{\alpha/2, N-a}} \le \sigma^2 \le \frac{\text{SS}_E}{\chi^2_{1 - \alpha/2, N-a}}\]
From Chi-square table, we can find chi-square values for \(\alpha = 0.01\) and \(N-a = 12\) as,
\[ \chi^2_{0.005, 12} = 28.3 \text{ and } \chi^2_{0.995, 12} = 3.074 \]
Therefore, using \(\text{SS}_E = 2.308\), we can find,
\[ \begin{aligned} \frac{\text{SS}_E}{\chi^2_{\alpha/2, N-a}} &\le \sigma^2 \le \frac{\text{SS}_E}{\chi^2_{1 - \alpha/2, N-a}} \\ \frac{2.308}{28.3} &\le \sigma^2 \le \frac{2.308}{3.074} \\ 0.082 &\le \sigma^2 \le 0.751 \end{aligned} \]
Thus at 99% confidence level, the true error variance \((\sigma^2)\) lie between the interval \(\left[0.082, 0.751\right]\).
Exercise 3 (Lectures August 24)
You are supposed to use R or other statistical software for this exercise. The data is comp3.dommere.RData
.
The purpose of the data of this exercise is to investigate if 5 different types of feeding (fortype
in the below data set) lead to differently tasting milk. Four judges (corresponding to Dommer
in the data) were asked to taste and rate on a scale from 1 to 10, 10 being best.
| Dommer | Fortype1 | Fortype2 | Fortype3 | Fortype4 | Fortype5 |
|---|---|---|---|---|---|
| Dommer1 | 6 | 6 | 3 | 4 | 3 |
| Dommer2 | 9 | 8 | 7 | 8 | 3 |
| Dommer3 | 10 | 8 | 5 | 7 | 6 |
| Dommer4 | 9 | 7 | 3 | 4 | 1 |
It is natural to let Dommer
be regarded as a block effect.
Assume two different model, one includes the blocks (Model 1), and the other without blocking (Model 2).
Describe the models and state the standard assumptions. Would you prefer Model 1 or Model2? Give reasons for your answer.
Model 1: Let \(y_{ij}\) be the
poeng
of \(i^\text{th}\) fortype given by \(j^\text{th}\) dommer.\[y_{ij} = \mu + \tau_i + \gamma_j + \epsilon_{ij}, \text{ where, } \sum_{i = 1}^5 \tau_i = 0 \text{ and } \sum_{j = 0}^4 \gamma_j = 0\]
Here, \(i = 1, \ldots, 5\) (Fortype) and \(j = 1, \ldots, 5\) (Dommer)
Model 2: Let \(y_{ij}\) be the \(j^\text{th}\) replication of
poeng
for \(i^\text{th}\) fortype.\[y_{ij} = \mu + \tau_i + \epsilon_{ij}, \text{ where, } \sum_{i = 1}^a \tau_i = 0\]
Here \(i = 1, \ldots, 5\) (Fortype) and \(j = 1, \ldots, 5\) (Replication) Since in this model dommer is not considered as blocking factor so, the points are considered as replications.
The error terms \(\epsilon_{ij}\) in both Model1 and Model2 are independent and follows normal distribution with mean 0 and constant variance \(\sigma^2\). i.e.,
\[\epsilon_{ij} \sim \text{NID}\left(0, \sigma^2\right)\]
ANOVA output from Model 1 and Model 2 are as follows,
Table 7: ANOVA for Model 1 Df Sum Sq Mean Sq F value Pr(>F) Fortype 4 70.30 17.5750 12.7818 0.0003 Dommer 3 31.75 10.5833 7.6970 0.0039 Residuals 12 16.50 1.3750 Table 8: ANOVA for Model 2 Df Sum Sq Mean Sq F value Pr(>F) Fortype 4 70.30 17.5750 5.4637 0.0064 Residuals 15 48.25 3.2167 From the ANOVA tables above, we can see that the block factor
Dommer
has significant effect in Model 1 which indicates that the analysis will be affected if it is removed from the model. In Model 2 the MSE has increased that consiquently decreases F-value corresponding to Fortype.Show that there is a significant effect of
Fortype
in Model 1.Table 9: ANOVA table for Model 1 Df Sum Sq Mean Sq F value Pr(>F) Fortype 4 70.30 17.5750 12.7818 0.0003 Dommer 3 31.75 10.5833 7.6970 0.0039 Residuals 12 16.50 1.3750 Since, the p-value corresponding to
Fortype
is (\(0.0003\)) << 0.05, there is significant effect ofFortype
.Which types of feeding (
Fortype
) differ significantly Use Model 1?Since there is significant effect of
Fortype
, it is desirable to perform pairwise comparison between differentFortype
. This can be done using Tukey’s pariwise comparison. The output from Tukey’s test is,Lower Center Upper Std.Err t value P(>t) Fortype1-Fortype2 -1.393 1.250 3.893 0.829 1.508 0.58 Fortype1-Fortype3 1.357 4.000 6.643 0.829 4.824 0.00 Fortype1-Fortype4 0.107 2.750 5.393 0.829 3.317 0.04 Fortype1-Fortype5 2.607 5.250 7.893 0.829 6.332 0.00 Fortype2-Fortype3 0.107 2.750 5.393 0.829 3.317 0.04 Fortype2-Fortype4 -1.143 1.500 4.143 0.829 1.809 0.41 Fortype2-Fortype5 1.357 4.000 6.643 0.829 4.824 0.00 Fortype3-Fortype4 -3.893 -1.250 1.393 0.829 -1.508 0.58 Fortype3-Fortype5 -1.393 1.250 3.893 0.829 1.508 0.58 Fortype4-Fortype5 -0.143 2.500 5.143 0.829 3.015 0.07
The result shows that at 95% confidence level,
Fortype1
is significantly different thanFortype3
,Fortype4
andFortype5
whileFortype2
is significantly different fromFrotype3
andFortype5
. In addition at 90% confidence level,Fortype4
andFortype5
are also significantly different.Fortype 1 and 2 are based on feed concentrates (Norwegian: Kraftfor), while Fortype 3 and 4 is based on rutabaga (Norwegian Kålrot).
Construct a contrast that measures the difference between these two feeding regimes, and test if the concentrates types taste significantly better than the other.
A contrast to test the average of
Fortype1
andFortype2
with average ofFortype3
andFortype4
can be written as,\[\text{Contrast: }(\Gamma) = \frac{1}{2}\left(\tau_1 + \tau_2\right) - \frac{1}{2}\left(\tau_3 + \tau_4\right) \]
The above hypothesis is written in terms of effects \(\tau_i\) rather than \(\mu_i\) since \(\mu_1 + \mu_2 = \mu_3 + \mu_4\) is same as \(\tau_1 + \tau_2 = \tau_3 + \tau_4\). Further, the coefficient of contrast is \(c_i = (0.5, 0.5, -0.5, -0.5, 0)\). The hypothesis to test if the difference between concentrates types (
Fortype1
andFortype2
) is better than Rutabaga (Foretype3
andFortype4
) is,\[H_0: \Gamma = 0 \text{ vs } H_1: \Gamma > 0\]
The test statistic for this hypothesis is,
\[ t_0 = \frac{\sum_{i = 1}^ac_i\hat{\tau}_{i\cdot}}{\sqrt{\text{MS}_E \sum_{i = 1}^a\frac{c_i^2}{n_i}}} \sim t_{0.05, N-a} \]
Using the test statistics above we can test the hypothesis. Test output obtained from R is as follows,
Estimate Std. Error t value Pr(>|t|) Fortype c=( 0.5 0.5 -0.5 -0.5 0 ) 2.75 0.586302 4.690416 0.0005228 From the test output, we can see that the p-value is very small (smaller than 0.05, level of significance). The p-value here is for two-sided test and for one-sided test, this p-value will be half of the p-value in output which is even smaller. So, we reject the null hypothesis and conclude that the concentrations types are significantly better than the rutabaga type.


Kubernetes (Beta)
Edit (pull request)This page helps you configure and deploy a hybrid nodecellar application on Kubnernetes through Alien4Cloud/Cloudify.
Prerequisites
- A Kubernetes cluster
- A Cloudify Manager
- The Cloudify Manager has a kubectl installed on it.
- The Cloudify manager must have access to Kubernetes REST API.
- The Kubernetes nodes should eventually be able to communication with Cloudify’s agents. In our case, the Nodecellar node deployed on Kubernetes shouls be able to contact its MongoDB database deployed on Openstack through the port 3000.
You can deploy a Kubernetes Cluster with Alien4Cloud using our components:
Configurations
When configuring your orchestrator, before enabling it, configure the Kubernetes URL and port.
Upload TOSCA Components
In order to build our hybrid nodecellar topology, you will need to import some TOSCA components. Follow the import from Git location instructions to import the docker-tosca-types into Alien4Cloud.
Once uploaded, your Alien4Cloud will contains additional types:
- docker-types
- nodecellar-docker-types (with the 2 node types
alien.nodes.Application.Docker.Nodecellar
andalien.nodes.Application.Docker.Mongo
) - and 2 topology templates:
NodecellarDocker
andNodecellarDockerHybrid
Node that the NodecellarDocker
won’t deploy right now since the Kubernetes plugin do not yet support volumes.
But you can modify the topology by removing the 2 volumes and deploy the 2 containers.
Deploy the Hybrid Topology
Create a new application using the NodecellarDockerHybrid
topology template.
Finally, you just have to clic the deploy
button and wait for the deployment to complete.
And if you have access to the Kubernetes webui, you can check that you have a nodecellar deployed on it
Edit (pull request)


Provides sample size and power calculations when the treatment time-lag effect is present and the lag duration is homogeneous across the individual subject. The methods used are described in Xu, Z., Zhen, B., Park, Y., & Zhu, B. (2017) <doi:10.1002/sim.7157>.
| Version: | 0.0.4 |
| Imports: | msm, survival |
| Published: | 2017-09-01 |
| Author: | Zhenzhen Xu , Boguang Zhen, Yongsoek Park and Bin Zhu |
| Maintainer: | Zhenzhen Xu <Zhenzhen.Xu at fda.hhs.gov> |
| License: | GPL-2 |
| NeedsCompilation: | no |
| CRAN checks: | DelayedEffect.Design results |
| Reference manual: | DelayedEffect.Design.pdf |
| Package source: | DelayedEffect.Design_0.0.4.tar.gz |
| Windows binaries: | r-devel: DelayedEffect.Design_0.0.4.zip, r-release: DelayedEffect.Design_0.0.4.zip, r-oldrel: DelayedEffect.Design_0.0.4.zip |
| OS X binaries: | r-release: DelayedEffect.Design_0.0.4.tgz, r-oldrel: DelayedEffect.Design_0.0.4.tgz |
Please use the canonical form https://CRAN.R-project.org/package=DelayedEffect.Design to link to this page.


-
Structure from noise, Mental errors yield abstract representations of events
A very interesting paper on how brain learns from natural errors
-
From Patterns to Function in Living Systems, Dryland Ecosystems as a Case Study
A great review article on pattern formation with emphasize on vegetation patterns.
-
Don’t micromanage when communication is delayed
Network synchronization in noisy environments
-
Machine learning phases of matter
This is very interesting


This paragraph should have a blue background and yellow text.
This paragraph should have a yellow background and blue text.
This paragraph should have a green background and yellow text.


Please read the following instructions very carefully. It takes around 1-2 minutes to read, so please take your time.
You are paired with one other player. In each round, one of you is pick randomly and get to choose how you would like to split 100 kr. The player can choose to any split between 0 and 100 kr. After each round both players are informed about the split. Thereafter you both continue to the next round, where one of you are again picked randomly and asked to split 100 kr.
Your earnings will be the sum of all the splits allocated to you from all rounds.
Other players will not know your identity. You only be referred to as 'the other player'.


{% extends "base.html" %} {% load i18n %} {% block head_title %}Contributing to {{ SITE_TITLE }}{% endblock %} {% block body %}
This website can be up to date only with strong community support. If you wish to help or show your gratitude, there are plenty of ways in which you can do that:


Prediction Classes¶
ImageAI provides very powerful yet easy to use classes to perform Image Recognition tasks. You can perform all of these state-of-the-art computer vision tasks with python code that ranges between just 5 lines to 12 lines. Once you have Python, other dependencies and ImageAI installed on your computer system, there is no limit to the incredible applications you can create. Find below the classes and their respective functions available for you to use. These classes can be integrated into any traditional python program you are developing, be it a website, Windows/Linux/MacOS application or a system that supports or part of a Local-Area-Network.
======= imageai.Prediction.ImagePrediction =======
The ImagePrediction class provides you the functions to use state-of-the-art image recognition models like SqueezeNet, ResNet, InceptionV3 and DenseNet that were pre-trained on the the ImageNet-1000 dataset.This means you can use this class to predict/recognize 1000 different objects in any image or number of images. To initiate the class in your code, you will create a new instance of the class in your code as seen below
from imageai.Prediction import ImagePrediction
prediction = ImagePrediction()
We have provided pre-trained SqueezeNet, ResNet, InceptionV3 and DenseNet image recognition models which you use with your ImagePrediction class to recognize images. Find below the link to download the pre-trained models. You can download the model you want to use.
After creating a new instance of the ImagePrediction class, you can use the functions below to set your instance property and start recognizing objects in images.
.setModelTypeAsSqueezeNet() , This function sets the model type of the image recognition instance you created to the SqueezeNet model, which means you will be performing your image prediction tasks using the pre-trained “SqueezeNet” model you downloaded from the links above. Find example code below
prediction.setModelTypeAsSqueezeNet()
.setModelTypeAsResNet() , This function sets the model type of the image recognition instance you created to the ResNet model, which means you will be performing your image prediction tasks using the pre-trained “ResNet” model you downloaded from the links above. Find example code below
prediction.setModelTypeAsResNet()
.setModelTypeAsInceptionV3() , This function sets the model type of the image recognition instance you created to the InecptionV3 model, which means you will be performing your image prediction tasks using the pre-trained “InceptionV3” model you downloaded from the links above. Find example code below
prediction.setModelTypeAsInceptionV3()
.setModelTypeAsDenseNet() , This function sets the model type of the image recognition instance you created to the DenseNet model, which means you will be performing your image prediction tasks using the pre-trained “DenseNet” model you downloaded from the links above. Find example code below
prediction.setModelTypeAsDenseNet()
.setModelPath() , This function accepts a string which must be the path to the model file you downloaded and must corresponds to the model type you set for your image prediction instance. Find example code,and parameters of the function below
prediction.setModelPath("resnet50_weights_tf_dim_ordering_tf_kernels.h5")
– parameter model_path (required) : This is the path to your downloaded model file.
.loadModel() , This function loads the model from the path you specified in the function call above into your image prediction instance. Find example code below
prediction.loadModel()
– parameter prediction_speed (optional) : This parameter allows you to reduce the time it takes to predict in an image by up to 80% which leads to slight reduction in accuracy. This parameter accepts string values. The available values are “normal”, “fast”, “faster” and “fastest”. The default values is “normal”
.predictImage() , This is the function that performs actual prediction of an image. It can be called many times on many images once the model as been loaded into your prediction instance. Find example code,parameters of the function and returned values below
predictions, probabilities = prediction.predictImage("image1.jpg", result_count=10)
– parameter image_input (required) : This refers to the path to your image file, Numpy array of your image or image file stream of your image, depending on the input type you specified.
—parameter result_count (optional) : This refers to the number of possible predictions that should be returned. The parameter is set to 5 by default.
– parameter input_type (optional) : This refers to the type of input you are parse into the image_input parameter. It is “file” by default and it accepts “array” and “stream” as well.
—returns prediction_results (a python list) : The first value returned by the predictImage function is a list that contains all the possible prediction results. The results are arranged in descending order of the percentage probability.
– returns prediction_probabilities (a python list) : The second value returned by the predictImage function is a list that contains the corresponding percentage probability of all the possible predictions in the prediction_results.
.predictMultipleImages() , This function can be used to perform prediction on 2 or more images at once. Find example code,parameters of the function and returned values below
results_array = multiple_prediction.predictMultipleImages(all_images_array, result_count_per_image=5) for each_result in results_array: predictions, percentage_probabilities = each_result["predictions"], each_result["percentage_probabilities"] for index in range(len(predictions)): print(predictions[index] , " : " , percentage_probabilities[index]) print("-----------------------")
– parameter sent_images_array (required) : This refers to a list that contains the path to your image files, Numpy array of your images or image file stream of your images, depending on the input type you specified.
– parameter result_count_per_image (optional) : This refers to the number of possible predictions that should be returned for each of the images. The parameter is set to 2 by default.
– parameter input_type (optional) : This refers to the format in which your images are in the list you parsed into the sent_images_array parameter. It is “file” by default and it accepts “array” and “stream” as well.
– returns output_array (a python list) : The value returned by the predictMultipleImages function is a list that contains dictionaries. Each dictionary correspondes the images contained in the array you parsed into the sent_images_array. Each dictionary has “prediction_results” property which is a list of athe prediction result for the image in that index as well as the “prediction_probabilities” which is a list of the corresponding percentage probability for each result.
Sample Codes
Find below sample code for predicting one image
from imageai.Prediction import ImagePrediction
import os
execution_path = os.getcwd()
prediction = ImagePrediction()
prediction.setModelTypeAsResNet()
prediction.setModelPath(os.path.join(execution_path, "resnet50_weights_tf_dim_ordering_tf_kernels.h5"))
prediction.loadModel()
predictions, probabilities = prediction.predictImage(os.path.join(execution_path, "image1.jpg"), result_count=10)
for eachPrediction, eachProbability in zip(predictions, probabilities):
print(eachPrediction , " : " , eachProbability)
Find below sample code for prediction multiple images
from imageai.Prediction import ImagePrediction
import os
execution_path = os.getcwd()
multiple_prediction = ImagePrediction()
multiple_prediction.setModelTypeAsResNet()
multiple_prediction.setModelPath(os.path.join(execution_path, "resnet50_weights_tf_dim_ordering_tf_kernels.h5"))
multiple_prediction.loadModel()
all_images_array = []
all_files = os.listdir(execution_path)
for each_file in all_files:
if(each_file.endswith(".jpg") or each_file.endswith(".png")):
all_images_array.append(each_file)
results_array = multiple_prediction.predictMultipleImages(all_images_array, result_count_per_image=5)
for each_result in results_array:
predictions, percentage_probabilities = each_result["predictions"], each_result["percentage_probabilities"]
for index in range(len(predictions)):
print(predictions[index] , " : " , percentage_probabilities[index])
print("-----------------------")


Stronger public health measures
Bend the curve
Due to Alberta’s high case numbers, aggressive action is required now to protect our health system from being overwhelmed.
The current situation is critical. These mandatory restrictions apply provincewide and will be in place at least until January 12, 2021.
Health officials are monitoring the situation and will adjust measures if required.
Gathering restrictions
Alberta declared a State of Public Health Emergency to protect the health care system from COVID-19. Social gatherings are the top source of transmission.
Effective Dec. 8, all indoor and outdoor social gatherings are prohibited. This will be enforced with $1,000 fines.
Workplaces, schools and child care
-
Effective Dec. 8, masks are mandatory in all indoor public spaces and workplaces.
-
Effective Dec. 13, working from home is mandatory when physical presence is not required.
-
Current child care and K-12 learning measures remain in effect.
Isolation and quarantine requirements
Why we need to isolate or quarantine
Isolating and quarantining help prevent the spread of COVID-19 by reducing the number of people you could infect if you're sick. Both require staying home and avoiding situations where the virus could spread.
COVID-19 can take up to 14 days to cause symptoms. Some people who get it only have minor symptom or don't have any symptoms at all but could still be infectious.
By staying home, it lowers the chance of symptoms developing while you're in a public place, which lowers the chance of spreading the virus to others.
International travel
Departures
An official global travel advisory remains in effect. Avoid non-essential travel outside Canada until further notice.
- The Canada/U.S. border remains closed to non-essential travel.
- Some essential service workers are exempt from travel restrictions if they have no symptoms.
Arrivals
All non-exempt travellers returning to or entering Alberta from outside Canada are legally required to follow provincial and federal travel restrictions upon arrival.
Travellers must:
-
Quarantine (isolate) for 14 days
- Monitor for symptoms
-
Get tested if any symptom develops and isolate for at least 10 additional days from the beginning of symptoms or until feeling well, whichever takes longer
Public health orders
To protect the health and safety of Albertans, public health orders are legally-enforceable and fines can be issued for violations.
- Minimum mandatory quarantine for 14 days for anyone who returned to or entered Alberta from outside Canada, or are a close contact of someone with COVID-19.
- Minimum mandatory isolation for 10 days for anyone who has a confirmed case of COVID-19, or have core symptoms that are not related to a pre-existing illness or health condition: cough, fever, shortness of breath, runny nose or sore throat.
- Operational protocols, including limited visitation, are enforceable for all auxiliary hospitals, nursing homes, designated supportive living and long-term care facilities, seniors lodges and any facility in which residential addiction treatment services are offered.
- Outbreak standards are in place for operators, managers and staff at all congregate health settings, including all auxiliary hospitals, nursing homes, designated supportive living and long-term care facilities, seniors lodges and facilities in which residential addiction treatment services are offered.
Outbreaks in Alberta
Locations of outbreaks in acute care and continuing care facilities are reported publicly when there are 2 or more cases, indicating that a transmission within the facility has occurred.
Prisons, correctional facilities, shelters, child care settings, work camps, food processing/manufacturing facilities and public settings (restaurants, salons, gyms) are listed when there are 5 or more cases.
Events and other workplaces (like office buildings) are listed when there are 10 or more cases.
Outbreaks are declared over when 4 weeks have passed with no new cases, so not all outbreaks listed below have current transmission happening.
As a precaution, outbreak control measures are put in place at continuing care facilities and group homes with a single confirmed case.
Protecting congregate care residents
Licensed supportive living, long-term care and hospice settings
Visiting policy
Expectations for visiting have changed. These changes will ensure we continue to protect at-risk Albertans while helping them remain socially and emotionally connected.
The changes include the expectation that operators develop a safe visiting policy and process in collaboration with residents and families. Other changes include:
-
Each resident or alternate decision maker may identify up to 2 designated family/support persons who are essential to maintaining resident mental and physical health.
-
Multiple residents may have the same designated family/support persons.
-
Designated family/support persons are not required to be present for visits from others.
Help prevent the spread posters
Use these printable posters to share tips on ways to practice physical distancing, and let your clients or customers know your business or workplace is open.
How to wear a non-medical mask
English


SST/Macro
Main Page
Namespaces
Classes
Files
Class List
Class Index
Class Hierarchy
Class Members
Class Hierarchy
Go to the textual class hierarchy
Generated by
1.8.11


Courses
Choose a course from St. Vincent College of Cabuyao to be an entrepreneurial mindset ready for the knowledge-based global economy.
Scholarship Programs
St. Vincent College of Cabuyao offers financial aids for those student with less financial sustainability, to help them finish their course.
News
St. Vincent College of Cabuyao Roads to First-ever virtual EU-Whiz
St. Vincent College of Cabuyao is at stake at the annual EU-Whiz: Filipino Youth of the FEUture is here!
EU-Whiz is divided into three categories; Online Trivia Competition, the Digital Art Competition and the Video Competition. The said competition is open to bonafide Filipino students currently enrolled in Philippine universities for Academic Year 2021. Interested students must form a group of three members to participate. Cool gadgets and exclusive EU Whiz items await the winning teams.
SVCC's final list of delegates per category will be posted soon.
Mission
To be leading privately managed integrated community college in Laguna recognized for its adherence to academic excellence, environment sustainability, responsible citizenship and overall national development by 2030.
Vision
To produce critical thinkers and patriotic graduates with entrepreneurial mindset ready for the knowledge-based global economy.


the passage from Xylography to Typography. Those who write on the affirmative side of the question profess to see in the earlier typographical works, as well as in the historical statements handed down by the old authorities, the clearest evidence that wooden types were used, and that several of the most famous works of the first printers were executed by their means.
As regards the latter source of their confidence, it is at least remarkable that no single writer of the fifteenth century makes the slightest allusion to the use of wooden types. Indeed, it was not till Bibliander, in 1548,In Commentatione de ratione communi omnium linguarum et literarum. Tiguri, 1548, p. 80. first mentioned and described them, that anything professing to be a record on the subject existed. “First they cut their letters,” he says, “on wood blocks the size of an entire page, but because the labour and cost of that way was so great, they devised movable wooden types, perforated and joined one to the other by a thread.”
The legend, once started, found no lack of sponsors, and the typographical histories of the sixteenth century and onward abound with testimonies confirmatory more or less of Bibliander’s statement. Of these testimonies, those only are worthy of attention which profess to be based on actual inspection of the alleged perforated wooden types. Specklin (who died in 1589) asserts that he saw some of these relics at StrasburgIn Chronico Argentoratensi, m.s. ed. Jo. Schilterus, p. 442.  Angelo Roccha,De Bibliothecâ Vaticanâ. Romæ, 1591, p. 412. “Characteres enim a primis illis inventoribus non ita eleganter et expedite, ut a nostris fieri solet, sed filo in litterarum foramen immisso connectebantur, sicut Venetiis id genus typos me vidisse memini.” in 1591, vouches for the existence of similar letters (though he does not say whether wood or metal) at Venice.


Uses a taglib module, to make a set of tags available.
The above example makes the tags defined in the module Html::Form available. This means you can use
the tags <o2 input> and <o2 select>, among others.
Perl looks for the module under lib/O2/Template/Taglibs, or for backend taglibs under lib/O2CMS/Template/Taglibs
or for plugin taglibs under lib/O2Plugin/<pluginName>/Template/Taglibs.
The core module (Core.pm) is always included and doesn't have to be 'used'.


 Do you have something to say?
You seem to be looking for someone!
Are you going to report me to the Magus of the dark arts?


UPI BUTTON GENERATOR HTML
Button Text
Name
UPI Id
Button Design
Button Code
--
CrackingFactory Socials:-
CLICK HERE
Official Telegram:-
CLICK HERE
Made with ❤ By CrackingFactory


publications
Selected Papers.
For patents please see my Google scholar profile
Papers:
2022
-
Perspectives on the System-level Design of a Safe Autonomous Driving Stack AI Communications 2022 [Download]
2021
2019
-
Robust propagation of probability boxes by Interval Predictor Models Structural Safety 2019 [Download]
-
Analytic Probabilistic Safety Analysis Under Severe Uncertainty ASCE-ASME Journal of Risk and Uncertainty in Engineering Systems, Part A: Civil Engineering 2019 [Download]
-
On the robust estimation of small failure probabilities for strong non-linear models ASCE-ASME Journal of Risk and Uncertainty in Engineering Systems Part B: Mechanical Engineering 2019 [Download]
2016
-
Structural reliability of pre-stressed concrete containments Nuclear Engineering and Design 2016 [Download]
Thesis:
2020
-
Uncertainty Modelling for Scarce and Imprecise Data in Engineering Applications University of Liverpool 2020 [Download]
Technical Reports:
2019
Conference Papers/Talks:
2018
-
Robust propagation of probability boxes by Interval Predictor Models In Proceedings of the joint ASCE ICVRAM ISUMA UNCERTAINTIES conference 2018
-
OpenCossan 2.0: an efficient computational toolbox for risk, reliability and resilience analysis In Proceedings of the joint ASCE ICVRAM ISUMA UNCERTAINTIES conference 2018 [Download]
-
Probability Box Propagation: Benchmarking Challenge Problems In 19th working conference of the IFIP Working Group 7.5 on Reliability and Optimization of Structural Systems 2018
2017
-
History Matching with Robust Predictive Metamodels In 12th International Conference on Structural Safety & Reliability 2017
-
Cossan Software: A Multidisciplinary And Collaborative Software For Uncertainty Quantification In 2nd ECCOMAS Thematic Conference on Uncertainty Quantification in Computational Sciences and Engineering 2017 [Download]


To the Editor: Dengue is the most prevalent arthropod-borne viral disease in tropical and subtropical countries. Every year, dengue virus (DENV) infections cause more than 50 million cases, 500,000 hospitalizations, and 12,500 deaths worldwide ( 1 ). DENV belongs to the genus Flavivirus and is transmitted by Aedes spp. mosquitoes. There are 4 distinct serotypes (DENV-1 to DENV-4), and infection with 1 serotype does not provide long-term, cross-protective immunity against the other 3 serotypes.
In New Caledonia, DENV outbreaks have occurred since World War II and have been caused mainly by 1 serotype/genotype introduced from a country to which dengue is hyperendemic. Since 2000, New Caledonia has had recurrent DENV-1 outbreaks ( 2 ). In 2014, circulation of DENV-1 and DENV-3 was still reported in this country ( 3 ).
Zika virus (ZIKV) is an emerging mosquito-borne virus that belongs to the genus Flavivirus and was first isolated in Uganda ( 4 ). ZIKV is believed to be transmitted to humans by Aedes spp. mosquitoes. Before 2007, few human cases of infection had been reported. In 2007, the first Zika epidemic occurred in Yap, Federated States of Micronesia ( 5 ). In October 2013, a ZIKV outbreak was reported in French Polynesia ( 6 ).
In New Caledonia, the first cases of ZIKV infection imported from French Polynesia were confirmed at the end of November 2013, and the first autochthonous cases were reported by mid-January 2014. Early in February 2014, the New Caledonia Health Authority declared an outbreak situation. Since February 2014, a total of 1,385 ZIKV laboratory-confirmed cases have been detected, including 35 imported cases (32 from French Polynesia, 2 from Vanuatu, and 1 from the Cook Islands). Concomitant with this ZIKV outbreak, circulation of DENV-1 and DENV-3 was reported; >150 cases were biologically confirmed during January–September 2014 ( 3 ). Thus, New Caledonia currently has 3 arboviruses co-circulating.
In recent years, co-circulation of multiple DENV serotypes or DENV and chikungunya virus has been reported. Although rare co-infections have been identified ( 7 , 8 ), given the similar clinical features and lack of concurrent testing, co-infections might not be identified. We report detection of ZIKV and DENV genomes in serum of a traveler (patient 1) who returned from French Polynesia where ZIKV and DENV were co-circulating ( 6 , 9 ) and in serum of a person (patient 2) in New Caledonia who had no travel history. The traveler was co-infected with ZIKV and DENV-3, and the local patient was co-infected with ZIKV and DENV-1.
Patient 1 was a 14-year-old boy who had fever (39.5°C), headache, arthralgia, asthenia, and myalgia. No hemorrhagic or neurologic findings were reported, and the patient recovered within 3 days. A complete blood count showed mild thrombocytopenia (platelet count 129 × 10 9 platelets/L; reference range 150–400 × 10 9 platelets/L), leukopenia (leukocyte count 2.75 × 10 9 cells/L; reference range 4–10 × 10 9 cells/L) with associated stimulated lymphocytes, and discreet hepatic cytolysis (aspartate aminotransferase 55 IU/L; reference value <34 UI/L, and alanine aminotransferase 51 IU/L; reference value <55 IU/L). Serum was analyzed by using real-time reverse transcription PCR (RT-PCR) and was positive for ZIKV as recommended by Lanciotti et al. ( 5 ) and DENV-3.
Patient 2 was a 38-year-old woman who had fever (40°C), headache, arthralgia, asthenia, myalgia, retroorbital pain, conjunctivitis, diarrhea, nausea, and a diffuse pruritic maculopapular rash. No hemorrhagic or neurologic findings were reported, but signs of illness lasted ≈1 week. The patient had mild thrombocytopenia (platelet count 123 × 10 9 platelets/L) and leukopenia (leukocyte count 2.65 × 10 9 cells/L). Serum was analyzed by using RT-PCR ( 5 ) and was positive for ZIKV and DENV-1.
Co-infections were assessed by sequencing partial ZIKV membrane–envelope gene regions for isolates (GenBank accession nos. KM212963 and KM212967) from both patients, partial DENV-1 envelope gene for an isolate (KM212960) from patient 2, and partial DENV-3 nonstructural protein 5 gene for an isolate (KM212962) from patient 1. Sequencing was conducted at La Plateforme du Vivant (Noumea, New Caledonia).
DENV-1 sequence obtained belonged to genotype I and clustered with DENV-1 sequences isolated in New Caledonia ( 2 ). DENV-3 sequence obtained belonged to genotype III, similar to DENV-3 recently isolated in French Polynesia ( 9 ). ZIKV sequences obtained belonged to the Asian lineage and had 99% identity with sequences of ZIKV isolated in French Polynesia in 2013 ( 10 ).
Serum specimens from both patients were cultured on Vero cells, and supernatants were evaluated by RT-PCR. Each specimen was positive only for DENV, which was probably caused by low viral loads for ZIKV.
We report co-infection of 2 patients with DENV and ZIKV; each patient was infected with a different DENV serotype. No synergistic effects of the 2 viral infections were observed because both patients were not hospitalized and recovered after a mild clinical course.
During this outbreak, patients in New Caledonia were tested for DENV, chikungunya virus, and ZIKV within the framework of the arboviruses sentinel network, which enabled detection of co-infections. Thus, clinicians should be aware of infections with multiple pathogens in the differential diagnosis of dengue-like illness, especially in patients who returned from tropical regions. This diagnostic procedure could be improved by using multiplex RT-PCR for travelers, given the frequent co-circulation of multiple arboviruses in tropical regions.
Suggested citation for this article: Dupont-Rouzeyrol M, O’Connor O, Calvez E, Daurès M, John M, Grangeon JP, et al. Co-infection with Zika and dengue viruses in 2 patients, New Caledonia, 2014 [letter]. Emerg Infect Dis. 2015 Feb [ date cited].
We thank C. Goarant for providing scientific advice and critically revising the manuscript and D. Baudon for providing scientific support.
This study was supported by the Institut Pasteur and the New Caledonia Government.


WEEK 33 FRIDAY
Year 1 (Year 2)
FIRST READING 1 Maccabees 4:36-37.52-59
“They celebrated the dedication of the altar and offered burnt offerings with gladness.”
A reading from the first Book of Maccabees
In those days: Judas and his brothers said,
"Behold, our enemies are crushed; let us go up to cleanse the sanctuary
and dedicate it." So all the army assembled and they went up to
The word of the Lord
RESPONSORIAL PSALM 1 Chr 29:10.11abc.11d-12a.12bcd (R. 13b)
R. We praise your glorious name, O Lord.
Blessed are you, O LORD, the God of Israel our
father, for ever and ever!
R. We praise your glorious name, O Lord.
Yours, O LORD, is the greatness, and the power, and
the glory, and the victory, and the majesty; for all that is in the heavens and
in the earth is yours; yours is the kingdom, O LORD.
R. We praise your glorious name, O Lord.
You are exalted as head above all. Both riches and
honour come from you.
R. We praise your glorious name, O Lord.
You rule over all. In your hand are power and
might; and in your hand it is to make great and to give strength to all.
R. We praise your glorious name, O Lord.
FIRST READING Revelation 10:8-11
“I took the little scroll and ate it.”
A reading from the Book of Revelation
The voice which I, John, had heard from heaven
spoke to me again, saying, "Go, take the scroll which
is open in the hand of the angel who is standing on the sea and on the
land." So I went to the angel and told him to give me the little scroll;
and he said to me, "Take it and eat; it will be bitter to your stomach,
but sweet as honey in your mouth." And I took the little scroll from the
hand of the angel and ate it; it was sweet as honey in my mouth, but when I had
eaten it my stomach was made bitter. And I was told, "You must again
prophesy about many peoples and nations and tongues and kings."
The word of the Lord
RESPONSORIAL PSALM
Psalm 119:<IP_ADDRESS>.111.131 (R. 103a)
R. How sweet is your promise to my tongue, O Lord!
I rejoice in the way of your precepts, as though
all riches were mine.
R. How sweet is your promise to my tongue, O Lord!
See, your decrees are my delight; your statutes are
my counsellors.
R. How sweet is your promise to my tongue, O Lord!
The law from your mouth means more to me than large
quantities of silver and gold.
R. How sweet is your promise to my tongue, O Lord!
How sweet is your promise to my tongue, more than
honey in the mouth.
R. How sweet is your promise to my tongue, O Lord!
Your decrees are my heritage for ever, the joy of
my heart.
R. How sweet is your promise to my tongue, O Lord!
I have opened my mouth and I sigh, for I yearn for
your commands.
R. How sweet is your promise to my tongue, O Lord!
R. Alleluia. My sheep hear my voice, says the Lord; and I know them, and they follow me. R. Alleluia.
GOSPEL Luke 19:45-48
You have made my house a den of robbers.
A reading from the holy Gospel according to Luke
At that time: Jesus entered the temple and began to
drive out those who sold, saying to them, "It is written, 'My house shall
be a house of prayer'; but you have made it a den of robbers." And he was
teaching daily in the temple. The chief priests and the scribes and the
principal men of the people sought to destroy him; but they did not find
anything they could do, for all the people hung upon his words.
The Gospel of the Lord


--- layout: page title: Ignite! Charlotte tags: [] status: publish type: page published: true meta: _edit_last: '3' _wp_page_template: default image: '' video-embed: ! "\r\n\t " quote-author: Unknown quote-url: http:// quote-copy: Unknown audio: http:// link-url: http:// seo_follow: 'false' ---
I've been excited about Charlotte's potential for a long time, and the conversations I've been a part of since my participation in Ignite! have proven to me that this city has everything it needs to meet the 21st century head on. I would encourage anyone to share their big idea in this format for this audience. My experience as a speaker was incredible and unforgettable, and I'm humbled to have shared a stage with my co-presenters.
I was happy with this performance, even though I stumble and you can see the pizza stain on my shirt!


The brief description of what this resource is and who it is intended for should go right here.
The brief description of what this resource is and who it is intended for should go right here.
Tips for Success will help answer a range of questions, from how to prepare an instrument replacement plan to how to expand the learning power of music. These tips are complemented by short videos and will enhance the user's experience.


In this example this text block is given a position on the grid. At the 460 pixel breakpoint it goes into the first row spanning both columns. At 660 pixels it spans 2 rows and goes into the second column, spanning two columns.
The other items are display according to the grid auto placement algorithm, with grid-auto-flow set to dense.
At the 660 pixel breakpoint I set two of the images to span 2 columns. These wide images mean that if we set grid-auto-flow to sparse there would be a gap where the image 'balloons 5' sits as it would be displayed in source order after the wider 'balloons 4' image which needs to drop down to the next row to have room.
Balloons 1
Balloons 2
Balloons 3
Balloons 4
Balloons 5
Balloons 6
Balloons 7
Balloons 8


So I usually work on separate vnc sessions in order to isolate the work that I do under different themes. That becomes tedious sometimes since you have so many sessions running because you don’t want to lose the status of the task in each of the windows. Hence, I end up creating more and more sessions. Now that also becomes an issue when you see that the number of sessions is too much.
At the beginning I did start to keep track through a text file, but that didn’t scale much since it uses a text editor window everytime to do that, and if there’s something that I open up in addition to that, then the vnc assignment file just doesn’t match up properly.
So I used a sticky note app. Did work for some time, but then I got tired of that too.
So I turned to look for what could give me a proper kind of output with minimal overhead. I’m all up for to do lists, but then this goes back to something similar to maintaining the text file.
Hence the solution should have to do something with the VNC instances themselves.
I got to know that there’s a command called vncconfig
that does that. The command is pretty simple:
vncconfig -display
The above returns the name of the VNC session which you can set through -name option while starting up the vnc session.
I also figured that vncconfig can even let you set the name dynamically. This was like a charm to me. Yes yes! I would like to be able to set the name of the vnc session just to make sure that I am using the right vnc session for the task at hand and when I am done with that task, I don’t have to just do away with the vnc session completely and make a new one with the -name switch.
The command is:
vncconfig -display
This was just awesome.
Tied it up with a bash script and an alias for the bash script and we are up for the fun.
So now I do: vncls # shows me the list of VNC sessions with their names vncset 1 integration # sets the vnc name of display 1 to “integration” vncfree 1 # sets the vnc name of display 1 to “[]” which signifies it is free of any tasks. I have a separate vnckill command to shutdown the vncserver.
The scripts are in the folder /scripts/2017/4/6/vncconfig-bash-scripts/ folder in this repo.
That’s enough for today! :P
Shivam


New Goodwill store now open in Punta Gorda
by WFTX Digital TeamPUNTA GORDA, Fla. -- There is now a new place to shop while helping people in the community.
A brand new Goodwill store and donation center opened Thursday in Punta Gorda. This new location offers an expanded retail space and has been customized for the community.
It is located on Tamiami Trail just south of Aqui Esta Drive, in the former Laishley Marine store.
A grand opening ribbon-cutting was held at 8:45 a.m. Thursday.
The new store will also serve as a collection site for new teddy bears for the "very beary" tree, which will be one of the decorated trees at this year's Festival of Trees at the Sidney and Berne Davis Art Center in downtown Fort Myers next month.


Real Madrid 0-0 Real Betis: Los Blancos fail to capitalise on Barça loss
Zidane's side couldn't break down Betis at the Bernabeu on Saturday
by Juan Carlos GraciaReal Madrid missed the chance to move to the top of La Liga as they were held to a goalless draw by Real Betis at the Santiago Bernabeu on Saturday.
Barcelona had slipped up earlier in the day, losing at Levante, while Atletico Madrid were held by Sevilla. However, Zinedine Zidane's side were unable to break down Betis.
They thought they were ahead inside 10 minutes when Eden Hazard scored, only for VAR to rule the goal out for offside. Left-back Ferland Mendy then passed up their best chance later in the half.
The draw sees Madrid move level with Barça on 22 points from 11 games, but they trail the Catalans on goal difference.
Atletico and Sevilla are one point back on 21 points having played a game more, while Granada (20 points) could go top on Sunday if they beat Real Sociedad, although they also will have played one more match than Madrid and Barça.
MATCH FACTS
LaLiga Santander
| 0-0 | BET |
Real Madrid
Courtois, Carvajal, Varane, Sergio Ramos, Mendy, Modric, Casemiro, Kroos, Rodrygo (Vinicius, 64'), Benzema (Jovic, 83') y Hazard.
Real Betis
Joel Robles, Emerson, Mandi, Feddal, Sidnei, Álex Moreno (Barragán, 90+3), Guardado, Bartra, Canales, Fekir (Ismael, 90+5') y Loren (Borja Iglesias, 73').
Árbitro
Sánchez Martínez (colegio murciano). Mostró tarjeta amarilla a: Bartra (10'), Casemiro (39'), Joel Robles (64'), Feddal (74'), Mendy (79') y Guardado (84').
Incidencias
Partido correspondiente a la duodécima jornada de LaLiga Santander disputado en el estadio Santiago Bernabéu.


|
Copley Motion Library
|
Copley amplifier settings object. More...
Public Member Functions | |
| AmpSettings () | |
| Create a settings object with all default values. More... | |
Public Attributes | |
| uint32 | synchPeriod |
| Synch object period in microseconds. More... | |
| uint32 | synchID |
| Synch object CAN message ID. More... | |
| bool | synchUseFirstAmp |
| Use first initialized amplifier as synch producer. More... | |
| bool | synchProducer |
| Synch producer (true/false) If true, this node will produce synch messages. More... | |
| uint32 | timeStampID |
| High resolution time stamp CAN ID. More... | |
| uint16 | heartbeatPeriod |
| The CANopen heartbeat protocol is one of two standard methods used to constantly watch for network or device problems. More... | |
| uint16 | heartbeatTimeout |
| Additional time to wait before generating a heartbeat error (milliseconds) If the heartbeat protocol is used, then this value, combined with the heartbeatTime will determine how long the network master waits for the node's heartbeat message before it generates a heartbeat error. More... | |
| uint16 | guardTime |
| Node guarding guard time (milliseconds) More... | |
| uint8 | lifeFactor |
| Node guarding life time factor. More... | |
| bool | enableOnInit |
| Enable amplifier at init time. More... | |
| AMP_MODE | initialMode |
| Initial mode of operation. More... | |
| bool | resetOnInit |
| Reset the amplifier on init. More... | |
| uint8 | maxPvtSendCt |
| Max PVT segments to send in response to a PVT status update. More... | |
Copley amplifier settings object.
This object is passed to the Init() method of the Copley amp. It holds the various customizable settings used by the amplifier.
| AmpSettings | ( | void | ) |
Create a settings object with all default values.
Default constructor for amplifier settings object.
The default values for each member of this class are defined below.
This constructor sets all the settings to the default values.
| bool enableOnInit |
Enable amplifier at init time.
If this is true, then the amplifier will be enabled at the end of a successful init(). If false, the amplifier will be disabled when init() returns.
Default: true
| uint16 guardTime |
Node guarding guard time (milliseconds)
The CANopen node guarding protocol is a second method (the first being the heartbeat protocol) for devices on the network to watch for network problems. In this protocol, the master controller sends a request message out to the slave device at a specified interval. The slave device responds to this request with a message indicating it's state.
The main difference between this protocol and the heartbeat protocol is that both the slave node and the master are able to recognize network errors. With the heartbeat protocol only the network master is able to identify network problems.
Note that only one of these two protocols can be active in a node device at any time. If the heartbeat period is non-zero, then the heartbeat protocol will be used.
This parameter gives the node guarding period for use with this node. This is the period between node guarding request messages sent by the master controller.
Note that both this parameter, and the life time factor must be non-zero for node guarding to be used.
For EtherCAT networks, this parameter specifies the process data heartbeat timeout. This is similar to the CANopen node guarding timeout. If the drive is operational, and goes this long without receiving process data from the master, then it will identify a timeout condition.
Default 200 (ms)
| uint16 heartbeatPeriod |
The CANopen heartbeat protocol is one of two standard methods used to constantly watch for network or device problems.
When the heartbeat protocol is used, each device on the CANopen network transmits a 'heartbeat' message at a specified interval. The network master watches for these messages, and is able to detect a device error if it's heartbeat message is not received within the expected time.
This parameter configures the heartbeat period (milliseconds) that will be used by this amplifier to transmit it's heartbeat message.
If this parameter is set to zero, then the heartbeat protocol is disabled on this node.
This setting is not used on EtherCAT networks.
Default: zero (not used)
| uint16 heartbeatTimeout |
Additional time to wait before generating a heartbeat error (milliseconds) If the heartbeat protocol is used, then this value, combined with the heartbeatTime will determine how long the network master waits for the node's heartbeat message before it generates a heartbeat error.
Note that setting this to zero does not disable the heartbeat protocol. set the heartbeatPeriod value to zero to disable heartbeat.
This setting is not used on EtherCAT networks.
Default 200 (ms)
| AMP_MODE initialMode |
Initial mode of operation.
This defines the mode of operation that the amplifier will be placed in when it is initialized.
Default: AMPMODE_CAN_HOMING
| uint8 lifeFactor |
Node guarding life time factor.
When the node guarding protocol is used, this parameter is used by the slave device to determine how long to wait for a node guarding request from the master controller before signaling an error condition.
The life time factor is treated as a multiple of the guard time.
If this parameter and the node guard time are both non-zero, and the heartbeatTime is zero, then node guarding will be setup for the amplifier.
This setting is not used on EtherCAT networks.
Default 3 (multiples of the guard time)
| uint8 maxPvtSendCt |
Max PVT segments to send in response to a PVT status update.
This parameter may be used to limit the number of new PVT segments to send in response to a PVT status update. Normally, this parameter may be safely left at it's default setting.
Default 6
| bool resetOnInit |
| uint32 synchID |
Synch object CAN message ID.
This is the message ID used for the synch message. Default is 0x00000080
| uint32 synchPeriod |
Synch object period in microseconds.
The synch object is a message that is transmitted by one node on a CANopen network at a fixed interval. This message is used to synchronize the devices on the network.
Default is 10,000 (10 ms).
| bool synchProducer |
Synch producer (true/false) If true, this node will produce synch messages.
Default: false
Note: If the 'synchUseFirstAmp' setting of this object is true, then the passed value of this settings will not be used, and will be overwritten during initialization.
Note: There should be exactly one synch producer on every network.
| bool synchUseFirstAmp |
Use first initialized amplifier as synch producer.
If this setting is true (default), then the first amplifier to be initialized will be set as the synch producer, and all other amplifier's will be setup as synch consumers. This causes the value of the 'synchProducer' setting to be updated during init to indicate whether the amp is producing synch messages or not.
By default, this setting is true
| uint32 timeStampID |
High resolution time stamp CAN ID.
The high resolution time stamp is a PDO that is generated by the synch producer and consumed by the other amplifiers on the network. It is used to synchronize the clocks of the amplifiers. This parameter defines the CAN ID that will be used for this message. Setting to zero will disable the time stamp message. Default 0x0180


Kathy Halamka
Biography
Kathy A. Halamka has been exhibiting professionally for over three decades in both painting and photography. She earned her Bachelor of Arts Degree in painting and drawing from Stanford University in 1984 while working as a graphic designer. Her post-baccalaureate studies at institutions such as the Academy of Art College in San Francisco and the School of the Museum of Fine Arts include painting, photography, and printmaking. Kathy completed her Master of Fine Arts graduate degree at Tufts University/School of the Museum of Fine Arts in Boston in December 2004. She maintains her studio in Boston's South End, and is also a member of the artist run Bromfield Gallery.
She recently curated "Reveal" in 2006 for the New Art Center in Newton's curatorial competition. Kathy has taught photography at Bentley University, Chester College and University of Rhode Island, and printmaking, photography, and drawing at the School of the Museum of Fine Arts. She has held the position of president of the Boston Chapter of the national organization of the Women's Caucus for Art, co-chaired their National Conference in 2006, and continues to regularly curate exhibitions for the Chapter. In conjunction with her work for the Women's Caucus for Art, she co-edited a book in 2009, "Blaze: Discourse on Art, Women and Feminism ( Blaze ). Her most recent solo exhibition was the installation "a thousand little wishes" in November 2009 at the Bromfield Gallery.


Preparation time
less than 30 mins
Cooking time
30 mins to 1 hour
Serves
Serves 4
Preheat the oven to 180C/350F/Gas 4.
Stuff a quarter of the sausagemeat into each chicken pocket and press a piece of basil and tomato into each breast.
Drizzle a little olive oil, lemon juice and salt and freshly ground black pepper, to taste, over the chicken breasts and wrap each breast in the air-dried ham to form a neat roll. Wrap each bundle in aluminium foil, sealing each foil parcel.
Bake in the pre-heated oven for about 30 minutes - to check the chicken is cooked, carefully unwrap the parcels and pierce the chicken with a metal skewer, if the juices run clear the meat is cooked all the way through. Rest the meat, still covered, for at least five minutes before serving.
Meanwhile, make the rösti. Place the grated potato and onion in a large bowl and season well with salt and freshly ground black pepper. Tip the mixture into a tea towel and squeeze out the excess moisture with your hands.
Divide the mixture into four equal-sized patties.
Lightly grease four chefs' rings with butter and melt the remaining butter in a large frying pan. Divide the rösti mixture between the chefs' rings and fry over a medium heat for about ten minutes until golden-brown on one side. Remove the chefs' rings, turn over and cook until both sides are golden-brown on both sides.
Serve each chicken parcel with a rösti and pour over any juices from the foil bundle. Serve with a simple green salad on the side.


Welcome to Twitching Astronaut's Shipyard
There will be eventually several categories
Constellation Program Craft Files
Lifters
Crew Modules
Cargo Modules
Base Compontents
Support Components
Mod Pack Download
Mission Log


684_majestyhao.py
class Solution:
def getMinDistSum(self, positions: List[List[int]]) -> float:
dirs = [[0, -1e-4], [0, 1e-4], [-1e-4, 0], [1e-4, 0]]
def dist(pos, x, y):
res = 0
for p in pos:
res += sqrt((p[0] - x) ** 2 + (p[1] - y) ** 2)
return res
x, y = 0, 0
for p in positions:
x += p[0]
y += p[1]
x /= len(positions)
y /= len(positions)
# start by finding the sum of distances to the center of gravity
d = dist(positions, x, y);
# our step value, chosen by experimentation
step = 100;
# done is used to keep track of updates: if none of the neighbors of the current
# point that are *step* steps away improve the solution, then *step* is too big
# and we need to look closer to the current point, so we must half *step*.
done = 0;
eps = 1e-5
t = 0
# while we still need a more precise answer
while step > eps:
done = 0
for di in dirs:
# check the neighbors in all 4 directions.
nx = x + step * di[0];
ny = y + step * di[1];
# find the sum of distances to each neighbor
t = dist(positions, nx, ny);
# if a neighbor offers a better sum of distances
if t < d:
#update the current minimum
d = t;
x = nx;
y = ny;
# an improvement has been made, so
# don't half step in the next iteration, because we might need
# to jump the same amount again
done = 1;
break
# half the step size, because no update has been made, so we might have
# jumped too much, and now we need to head back some.
if not done:
step /= 2
return t


{% extends "base.html" %} {% block content %}
Select a Twitter handle below to see their recent tweets, or write a text sample and choose two existing handles. TwitOff will predict which user was most likely to tweet that.
Choose two Twitter users and type a text sample.
{% endblock content%}


Welcome {{userName}},
in order to activate your new account, please verify your email address by clicking on the link below.
If you have problems logging in or technical issues, please send an email to it@sirimangalo.org.


vApprun 1.0 User Guide
Introduction
With vSphere 4, we introduced a set of new features for managing and configuring virtual appliances, namely vApps, OVF properties, and the OVF environment. A vApp is a container for a distributed, multi-VM software solution. It has power-on operations just as a virtual machine, and can be imported or exported as an OVF package. The OVF properties and OVF environment provides a flexible mechanism for parameterizing guest software inside a VM upon deployment. Using the OVF properties, it is possible to both configure OS level properties, such as IP settings, and application level parameters, such as IP addresses of external servers.
Until now, these features have been exclusive to vSphere 4, but with VMware vApprun, these features become available to both Workstation and Fusion users. The vApprun tool implements the same vApp/OVF feature set as the vSphere 4 release. Thus, Workstation/Fusion can be used as a development environment for advanced OVF packages, and it can be used to evaluate and test OVF packages on your desktops and laptops.
Along with the vApprun tool, we will shortly release a technical preview of VMware OVF Tool 2.0. One of the new features is support for vApprun workspaces as both a source and target. Thus, OVF packages can be deployed and run directly on Workstation and Fusion, even when they use advanced features such as OVF properties or contain multiple VMs. Furthermore, the vApps and VMs that are created using vApprun can be exported as OVF packages, deployed to vSphere installations, or even into vCloud accounts.
Features
- vApps that contain multiple VMs and nested vApps.
- For a vApp, the start/stop sequence of the child entities can be configured.
- Start/stop/shutdown of vApps.
- Create OVF properties and access the OVF environment from guest software.
- Supports ISO and guestInfo OVF environment transports.
- Supports fixed, transient, and DHCP IP allocation modes and IP pools.
- Import OVF packages and run it with vApprun (using OVF Tool 2.0).
- Export vApps and VMs created with vApprun to OVF packages (using OVF Tool 2.0).
- Command-line, workspace-oriented user interaction.
- Cross-platform - available for Windows/Mac/Linux.
- VMware vSphere 4 compatible.
Concepts
The vApprun tool is centered around three main objects: Workspaces, vApps, and virtual machines (VMs). A workspace is a container for vApps and VMs. The vApp and VM objects can be configured with OVF properties, as well as be linked to parent vApps. Both VMs and vApps can have parent links, so it is possible to create deeply nested vApps. In addition to being a container of the VM and vApp objects, a workspace also contains an IP pool. The following figure illustrates the relationship between the objects and what kinds of configuration they contain (in this particular figure the workspace contains one vApp and two VMs):
A link is not just a link to a parent. Each link contains configuration, such as start-up order, start delay (i.e., how long to wait until the next in the sequence should be started), and so forth. This information is used when starting or stopping a vApp. The power-down sequence is the reverse of the power-up sequence.
OVF properties are used to parameterize VM and vApps. A vApp/VM can be configured with a set of property definitions. Each property definition consists of a key, a type, and a default value. A property definition works much like a shell variable (e.g., such as $MY_CONFIG) in a normal UNIX shell. For each deployment of the vApp/VM, the set of property definitions remain fixed, but the value of the properties are configured differently. Often, OVF properties are used to pass deployment-specific information into the guest software, such as IP addresses, netmasks, gateways, dns servers, IP or DNS names of external servers, admin emails, and performance tuning settings.
The IP Pool object in the workspace contains common configuration for the deployment environment as well as a pool of IP addresses that can be assigned to the VMs in the workspace. The OVF property syntax allow OVF definitions to automatically be assigned values from the IP Pool. For example, properties that automatically get the value of the DNS servers or automatically get assigned an IP address. This can greatly simplify deployment since common configuration only has to be provided once (per workspace).
When a VM is powered on, the OVF properties are used to populate an OVF environment for the VM. The OVF environment is a standardized XML document that contains the key/value pair of each property that is visible to the VM. By definition, this is all properties that are defined on the VM and on its immediate parent, if any. The OVF environment is made available to the guest software in one of two ways: i) As a file on an ISO image that is mounted into an available CD-ROM drive, or 2) available through VMware Tools in the guestInfo.ovfEnv variable. The method used to transport the OVF environment is configurable per VM. With OVF properties and the OVF environment, a VM or vApp can be parameterized. The deployment-time configuration (the values for each property) is made available to the guest software. The author of the VM/vApp is responsible for installing a script or other software that reacts appropriately on the configured values.
Example OVF environment:
<?xml version="1.0" encoding="UTF-8"?> <Environment xmlns="http://schemas.dmtf.org/ovf/environment/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oe="http://schemas.dmtf.org/ovf/environment/1" oe:id="MyVM"> <PlatformSection> <Kind>vapprun</Kind> <Version>1.0</Version> <Vendor>VMware, Inc.</Vendor> <Locale>en_US</Locale> </PlatformSection> <PropertySection> <Property oe:key="DNS_servers" oe:value="<IP_ADDRESS>,<IP_ADDRESS>"/> <Property oe:key="Gateway_Address" oe:value="<IP_ADDRESS>"/> <Property oe:key="IP_Address" oe:value="<IP_ADDRESS>"/> <Property oe:key="Network_Mask" oe:value="<IP_ADDRESS>"/> </PropertySection> </Environment>
Setting up a Workspace
To use vApprun, you need to set up a workspace. A workspace is a directory where vApprun stores the configuration of the workspace, including the VMs and vApp entities that is created in the workspace. You can create multiple workspaces. Each workspace is independent and self-contained.
To create a workspace, create a directory and run the init command:
>mkdir myws >cd myws >vapprun init
Under the covers, the vapprun command has created a vapprun.cfg file in the directory. The presence of this file marks the directory as a vApprun workspace, as well as stores the IP pool configuration.
All vApprun commands (except init and help) must be executed in the context of a workspace. The current workspace is found relative to the current directory. Thus, you must be in the workspace directory or in a subdirectory of the workspace directory when executing a vapprun command. The general form of the vapprun tool is:
>vapprun Usage: vapprun <command> [options] [<target> [<arguments>]] Type 'vapprun help' for help
Use the vapprun help command to see a list of all the commands, and vapprun help <command> to get information about a specific command.
To see the configuration of the workspace use the workspace command:
>vapprun workspace IP Pool settings: dns = domainName = example.com gateway = <IP_ADDRESS> hostPrefix = vapprun- httpProxy = netmask = <IP_ADDRESS> range = <IP_ADDRESS>#8 searchPath = Free IP addreses <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>
The configuration of the workspace is changed by supplying arguments to the
>vapprun workspace dns=vmware.com range=<IP_ADDRESS>#4 IP Pool settings: dns = vmware.com domainName = example.com gateway = <IP_ADDRESS> hostPrefix = vapprun- httpProxy = netmask = <IP_ADDRESS> range = <IP_ADDRESS>#4 searchPath = Free IP addreses <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>
Note: On Windows, you often have to quote the arguments (vapprun workspace "dns=vmware.com" "range=<IP_ADDRESS>#4").
The list command is used to see the workspace inventory:
>vapprun list Empty workspace
As expected, the workspace is empty.
The last workspace related command is the fsck command. This checks the integrity of the workspace. Hopefully, you will never have to use it, but if vApprun is acting up, it might be helpful to check if some stray files needs to get cleaned up.
>vapprun fsck No stray files in workspace
Run this with the -d option, and it will delete the stray files it finds.
Creating and running vApps and VMs
There are two commands for creating virtual machines in a vApprun workspace: create-vm and link-vm. They both create a new VM entity inside the vApprun workspace. The difference is that the create-vm command creates a new blank VM with a single disk that is stored inside the current workspace, where as the link-vm links to an existing .vmx file that is stored outside the workspace. The following shows examples of these two commands:
>vapprun create-vm myVm disk=5 Creating disk '~/myws/MyVM/vmx/disk.vmdk' Virtual disk creation successful. Created VM entity MyVM successfully >vapprun link-vm MyLinkedVM vmx=~/VMs/LampVM.vmx Created VM entity MyLinkedVM successfully
Functionally, there is no differences between a VM entity created with the two commands, except when an entity is deleted. If the VM is created with the create-vm, the VM files will be deleted too. To delete a vApp or VM use the delete command.
To create a vApp, use the create-vapp command:
>vapprun create-vapp MyVApp
At this point, we have ended up with a workspace with 3 entities: MyVM, MyLinkedVM, and MyVApp.
>vapprun list Name Type State IP AppUrl -------------------------------------------------------------------------- MyLinkedVM VM Powered Off MyVApp vApp Powered Off MyVM VM Powered Off
A vApp is a container that can contain other vApps and virtual machines. The edit command is used to change the configuration of a vApp or VM entity. The parent setting is used to configure the vApp hierarchy. In the following example, we create another vApp (AnotherVApp) and configure a simple hierarchy:
>vapprun create-vapp AnotherVApp >vapprun edit MyVM parent=MyVApp >vapprun edit MyLinkedVM parent=AnotherVApp >vapprun edit AnotherVApp parent=MyVApp
The end result can be seen with the list command:
Name Type State IP AppUrl -------------------------------------------------------------------------- MyVApp vApp Powered Off AnotherVApp vApp Powered Off MyLinkedVM VM Powered Off MyVM VM Powered Off
Hint: Use the -q option with list command (vapprun list -q) to make it run faster by not showing the power-state and the IP addresses.
Once the desired vApp hierarchy is set up, we need to configure the individual entities. This includes OVF properties, IP allocation policy, start-up order, application URLs, and so forth. We will cover OVF properties and IP allocation policies in the following sections. To list the current configuration use the list command with the name of the entity:
>vapprun list MyVApp Name.......: MyVApp Type.......: vApp IP Policy..: fixed Children: Name Order StartWait WaitForTools StopWait ------------------------------------------------------------ AnotherVApp 30 30 True 30 MyVM 30 30 True 30
The Order, StartWait, WaitForTools, and StopWait are all settings on the children and the edit command is used to set them:
>vapprun edit MyVM startOrder=10 startWait=10 waitForTools=True stopWait=10
A vApp is started by powering on the children in accending order. If a child is a vApp, then the vApp is started recursively. The start command continues to the next VM once the number of seconds specified in startWait has elapsed. If waitForTools is set to true, it moves to the next child in the power-on sequence either when a VMware Tools heartbeat is received or when the number of seconds in startWait has elapsed (whichever comes first). The power-off sequence is the reverse of the start sequence and the stopWait is used instead.
The three commands that are used to start and stop VMs and vApps are: start, stop, and shutdown. The differences between the stop and shutdown is that shutdown executes a hard power-off, whereas stop executes a soft power-off (guest initiated).
By default, all virtual machines are started headless. The -gui option can be used with the start command to show the VM console when a VM/vApp starts.
>vapprun start -gui MyVApp Starting MyVApp Starting MyVM Waiting for 10 secs... Starting AnotherVApp Starting MyLinkedVM Waiting for 30 secs... Waiting for 20 secs... Waiting for 10 secs... >vapprun stop MyVApp/ Stopping MyVApp Stopping AnotherVApp Stopping MyLinkedVM Stopping MyVM
Note: When using the -gui option on Mac OS X, it is necessary to manually close the opened console windows and clean out the VM entries from the Fusion's Virtual Machine Library. Right click on them, select delete, and make sure to select keep files.
OVF Properties and OVF Environment
Virtual machines are very practical containers for encasulating an application stack. Once the virtual machine is configured with the desired set of software, it can be copied, shared, and deployed many times. This approach is often used to simplify and robustify software deployments inside IT organizations, or used to distribute software to end-users (virtual appliance model). However, one issue with the above approach is that each deployment is not exactly the same. The software inside the VM needs to be customized to the particular deployment scenario. For example, configuration settings such as IP addresses of external systems, security settings, administrator email are different for each deployment. Thus, what we need is a way to create a parameterized virtual machine or vApp, where the deployer can customize parts of the application to suit the particular deployment scenario.
OVF Properties and the OVF Environment are exactly designed for this. They support what is commonly known as self-customization. Self-customization is a flexible, open-ended scheme for getting the bits inside a virtual machine customized for a particular deployment scenario. The scheme works as follows:- VM/vApp Author:
- Defines a set of OVF properties that covers the set of parameters that need to be customized at deployment time.
- Installs a script in the guest, that upon boot of the virtual machine(s), will read the values provided for each OVF property and customize the software accordingly.
- VM/VApp Deployer:
- The deployment tool (e.g., vApprun, vSphere, OVF Tool) will prompt for values for each of the declared OVF properties.
- Power-on the VM or vApp.
There are two types of property values, ones that must be configured by the user and ones that are configured automatically by the deployment environment (such as VirtualCenter or vApprun). The former are called static properties, and the latter are called automatic properties. Most of the automatic properties are centered around passing IP-level configuration into the VMs, such as IP addresses, netmask, and gateway information. We will discuss them more in the next section.
The vApp/VM author uses the def-property command to define properties on a VM or vApp, and the deployer uses the set-property command to specify the deployment time values for OVF properties:
>vapprun def-property MyVApp key=adminEmail type=string >vapprun set-property MyVApp<EMAIL_ADDRESS>>vapprun list MyVApp Name.......: MyVApp Type.......: vApp IP Policy..: fixed Property Definitions: Key Type Value UserConfig ------------------------------------------------------------------------------- adminEmail string True Property Settings: Key Value ------------------------------------------------ adminEmail<EMAIL_ADDRESS>Note: property type validation is not implemented in vApprun 1.0. You can use any value for type you like(except for expression and ip:Network which we will cover it the next section). It is recommended to use string for now, as it is a valid type.
A virtual machine will receive the configured values for all OVF properties in an OVF environment. The OVF environment contains the key/value pairs of all properties that are defined on the virtual machine entity itself, as well as the key/value pairs of all properties defined on the immediate parent vApp, if any. In the above example, the OVF environment will look like:
<?xml version="1.0" encoding="UTF-8"?> <Environment xmlns="http://schemas.dmtf.org/ovf/environment/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oe="http://schemas.dmtf.org/ovf/environment/1" oe:id="MyVM"> <PlatformSection> <Kind>vapprun</Kind> <Version>1.0</Version> <Vendor>VMware, Inc.</Vendor> <Locale>en_US</Locale> </PlatformSection> <PropertySection> <Property oe:key="adminEmail"<EMAIL_ADDRESS></PropertySection> </Environment>
For further details on the OVF environment, see the Open Virtualization Format 1.0 specification. There is link to this in the Learn More section.
Two methods exist for transferring the OVF environment into the virtual machine, so it can be read by the guest software. These methods are called the iso and com.vmware.guestInfo transports. The transport option is set using the edit command and is only applicable to a VM entity:
vapprun edit MyVM transport=iso
Multiple transports can be specified, separated by spaces. When the iso transport is used, vApprun will generate an ISO image with the OVF environment stored in a file called ovf-env.xml in the root directory. This ISO image is mounted in the first available CD-ROM drive that is found. When the guestinfo transport is used, the value of the OVF environment can be retrieved using a VMware Tools command (running in the guest):
vmware-guestd --cmd 'info-get guestinfo.ovfEnv' # Linux Guest VMwareService.exe --cmd "info-get guestinfo.ovfEnv" # Windows Guest
The above commands are only available if VMware Tools are installed in the guest. For more information about the VMware Tools commands, see the VMware Scripting API User's Manual.
For an example of a guest script, see the following blog entry: Self-Configuration and the OVF Environment.
Network Configuration
When installing a virtual appliance, it needs to be customized for the particular deployment environment. Ideally, you would like a nice, simple web/gui based user interface to specify your desired IP configuration (DHCP, no DHCP, IP address netmasks, gateways, etc.). However, instead most virtual appliances force you to use a BIOS-style text interface in the VM console. This is not because the appliance vendors are particular ignorant about a good user experience (in fact, most care deeply about this), but because they are running into a catch-22 problem. To enter this information using a nice web-based interface you need the IP information! To solve this, a bit of help from the deployment infrastructure is needed. In this section, we will see how we can use OVF properties and the OVF environment to:
- Eliminate the need to go to the VM console.
- Provide the ability to create appliances that work in both DHCP and non-DHCP networking environments.
- Enable automatic IP configuration of multi-tiered software solutions. In particular, allowing the different tiers to discover each others IP addresses. (in both DHCP and non-DHCP environments.)
- Reduce manual configuration by automatically propagating common IP configuration to the appliances.
To achieve the above, we use the following three features of vApprun: i) the IP pool, ii) IP allocation policy, and iii) dynamic properties. Each workspace has an IP Pool (see the Workspace section). This IP pool is configured with a list of free IP addresses and common network settings that are shared across all VMs in the workspace. To list or change the IP Pool configuration, use the workspace command:
>vapprun workspace IP Pool settings: dns = <IP_ADDRESS> domainName = example.com gateway = <IP_ADDRESS> hostPrefix = vapprun- httpProxy = netmask = <IP_ADDRESS> range = <IP_ADDRESS>#4 searchPath = eng.example.com;example.com Free IP addreses <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>, <IP_ADDRESS>
An OVF property can directly refer to the values in the IP pool by specifying the type as expression and the value as ${<cmd>:<network>}, where the cmd is one of the properties defined in the IP pool and network is the string Network. For example:
>vapprun def-property MyVApp key=dns type=expression value=\${dns:Network} >vapprun def-property MyVApp key=domainName type=expression value=\${domainName:Network} >vapprun def-property MyVApp key=gateway type=expression value=\${gateway:Network} >vapprun def-property MyVApp key=hostPrefix type=expression value=\${hostPrefix:Network} >vapprun def-property MyVApp key=httpProxy type=expression value=\${httpProxy:Network} >vapprun def-property MyVApp key=netmask type=expression value=\${netmask:Network} >vapprun def-property MyVApp key=searchPath type=expression value=\${searchPath:Network}
Note: The \$ is a Linux/Mac OS X shell escape for a single dollar sign. On Windows, simply use a $ and put the arguments in quotes.
The property key can be anything. In the above example, we used the same names as the IP pool names, but that is not a requirement. The benefit of using dynamic properties is that they are automatically assigned the values from the IP pool at start-up. Thus, the deployer does not have to manually enter these.
The final expression type is the property assignment which has the form ${<fromKey>}. This assigns a property value from a property defined in the parent vApp. We will use this in the Example section.
By using the expression types, we can eliminate the need to type in common network configuration, such as DNS and gateways. The next issue is to simplify how IP addresses are assigned to the VMs. How an IP address is allocated and what IP address to use is highly deployment environment dependent. The deployer can specify whether the IP allocation policy should be DHCP, transient, or fixed. For DHCP, the virtual machine is instructed to allocate its own IP address using a DHCP server, for transient the IP address is allocated from the Workspace's IP pool, and finally for fixed, the deployer is specifying the value explicitly. The IP allocation policy is configured by using one of the following options -dhcp, -transient, or -fixed with the set-property command:
>vapprun set-property -transient MyVApp
The IP allocation policy affects how properties of type ip:Network behave:
>vapprun def-property MyVApp key=dbIP type=ip:Network
Properties are initialized when a vApp/VM is powered on. For properties of the above type, the following happens:
- DHCP policy: The property will be initialized to the empty string, and once the power-on completes for the VM, the IP address retrieved through VMware tools are assigned into the property. See the Example section for more details.
- Transient policy: An IP address is allocated and assigned to the property from the workspace's IP pool. If the IP pool is empty, the power on operation will fail.
- Fixed policy: The deployer needs to explicitly configure the property with a value using the set-property command. If the property has no value, the power-on will fail.
Based on the above behavior, the guest can know whether to use DHCP or static IP assignment. If the property in the OVF environment is empty, it should use DHCP assignment. If the property is non-empty, it should use the IP address passed in as a static IP address. Notice that from the guest's perspective, it cannot tell the difference between transient and fixed policy.
Example
To put it all together, lets see how we can use vApprun to create a multi-tiered LAMP stack with a database and app-server virtual machine. It will be configured through properties that automatically set up the IP connection from the Web VM to the DB VM, and for which we specify whether to use DHCP, transient, or fixed IP allocation policy. In this example, we will assume that we already have two VMs with the right guest code installed (to read and apply the OVF properties we define), so that we can just focus on the vApprun aspects of this.
To set up the LAMP vApp in the workspace, we execute the following set of operations:# Step 1: Create vApp entity and properties vapprun create-vapp LAMP vapprun def-property LAMP key=ws_ip type=ip:Network vapprun def-property LAMP key=db_ip type=ip:Network vapprun def-property LAMP key=netmask type=expression value=\${netmask:Network} vapprun def-property LAMP key=gateway type=expression value=\${gateway:Network} vapprun def-property LAMP key=hostprefix type=expression value=\${hostPrefix:Network} vapprun def-property LAMP key=dns type=expression value=\${dns:Network} vapprun def-property LAMP key=dnssearchpath type=expression value=\${searchPath:Network} # Step 2: Setup webVM as a child VM and with a property ip assigned from parent vApp vapprun link-vm webVM vmx=~/VMs/webVm/webVm.vmx vapprun edit webVM parent=LAMP vapprun def-property webVM key=ip type=expression value=\${ws_ip} # Step 3: Setup dbVM as a child VM and with a property ip assigned from parent vApp vapprun link-vm dbVM vmx=~/VMs/dbVm/dbVm.vmx vapprun edit dbVM parent=LAMP vapprun edit dbVM startOrder=10 startWait=320 waitForTools=True stopWait=320 vapprun def-property dbVM key=ip type=expression value=\${db_ip} # Step 4: Setup a URL to the application server vapprun edit LAMP "appUrl=http://${ws_ip}/"
Notice that in Step 2 and 3, we use an expression property to assign the ip property for the VM into the property with key ip. This is done for a couple of reasons: i) The same script can be used to configure the IP address inside the guest for both VMs, and 2) more importantly, this is the magic glue that makes ip assignment work if the DHCP ip allocation policy is chosen.
Let's look at how the power-on sequence will proceed if the DHCP allocation policy is chosen:
- The start-up order of the VMs is such that the dbVM starts up first. When the dbVM starts up, both the property db_ip and ws_ip will be set to the empty string in its OVF environment.
- Since we have configured the startup to waitForGuest, we wait for VMware Tools to return us the IP address. Once we receive the IP address, we backfill the IP address into a property of type ip:Network. In this case, it will be the ip property of dbVM and the db_ip property of the LAMP vApp. The backfill follows assignments expression in reverse order.
- We then proceed to power-on the webVM (which is next in the power on start sequence). Its OVF environment will have the ip address of the dbVM in the db_ip property (since a VM also gets the properties of its parent vApp), and the ip and ws_ip properties will be empty. Thus, the webVM is able to hook up to the dbVM and know that it should allocate an IP address itself using DHCP.
- Once it is powered on, the same backfill happens, and we get the ws_ip property initialized in the OVF environment.
- Thus, the appUrl property will show the correct dynamic URL to the LAMP stack.
To see what we created, we used the list command:
Name.......: LAMP Type.......: vApp AppUrl.....: http://${ws_ip}/ IP Policy..: transient Children: Name Order StartWait WaitForTools StopWait ------------------------------------------------------------ dbVM 10 320 True 320 webVM 20 320 True 320 Property Definitions: Key Type Value UserConfig ------------------------------------------------------------------------------- ws_ip ip:Network True db_ip ip:Network True netmask expression ${netmask:Network} False gateway expression ${gateway:Network} False hostprefix expression ${hostPrefix:Network} False dns expression ${dns:Network} False searchpath expression ${searchPath:Network} False
So all that is left is to power it on using the vapprun start LAMP command:
>vapprun start LAMP Starting LAMP Starting Database Waiting for 120 secs... Waiting for 110 secs... Waiting for 100 secs... Waiting for 90 secs... Waiting for 80 secs... (ip: <IP_ADDRESS>) Starting Web server Waiting for 120 secs... Waiting for 110 secs... Waiting for 100 secs... Waiting for 90 secs... (ip: <IP_ADDRESS>) Access at: http://<IP_ADDRESS>/
Learn More
Use the following references to learn more about vApps, the Open Virtualization Format (OVF), and virtual appliances:- The vApp Developer blog. The following two blog entries are good starting points: OVF and vApps in Action! and Self-Configuration and the OVF Environment.
- The Virtual Appliances marketplace and VMware Studio.
- The Open Virtual Machine Format on vmware.com. This has links to the OVF specification and the VMware OVF Tool.