Google Code offered in: English - Español - 日本語 - 한국어 - Português - Pусский - 中文(简体) - 中文(繁體)
At this point, you've created the initial implementation of the StockWatcher application and it seems pretty stable.
As the code base evolves, how can you ensure that you don't break existing functionality? The solution is unit testing. Creating a battery of good unit test cases is an important part of ensuring the quality of your application over its lifecycle.
To aid you with your testing efforts, GWT provides integration with the open-source JUnit testing framework. You'll be able to create units test that you can run in both development mode and production mode.
In this section, you'll add a JUnit unit test to the StockWatcher project.
This tutorial builds on the GWT concepts and the StockWatcher application created in the Getting Started tutorial. If you have not completed the Getting Started tutorial and are familiar with basic GWT concepts, you can import the StockWatcher project as coded to this point.
File
menu, select the Import...
menu option.Next
button.Finish
button.
If you are using ant, edit the gwt.sdk
property in StockWatcher/build.xml to point to where you unzipped GWT.
path_to_the_junit_jar
to point to the location of junit on your system.
Note: If you just completed the Getting Started tutorial but did not specify the -junit
option with webAppCreator, uncomment the javac.tests
, test.dev
, test.prod
, and test
targets in StockWatcher/build.xml and
replace all references to path_to_the_junit_jar
to point to the location of junit on your system before continuing.
When you specified the -junit
option, webAppCreator created all the files you need to begin developing JUnit tests. It generates a starter test class, ant targets to run the tests from the command line, and launch configuration files for Eclipse.
Starting with GWT 2.0, the former command-line tool junitCreator has been combined into webAppCreator.
In Eclipse, navigate down to the StockWatcherTest class by expanding the
test/
directory. If you are adding JUnit testing to an existing
application you will need add the test/
directory as a source
folder within you Eclipse project and update your Build Path to include a
reference to an existing JUnit library.
Take a look inside StockWatcherTest.java. This test class was generated in the com.google.gwt.sample.stockwatcher.client package under the StockWatcher/test directory. This is where you will write the unit tests for StockWatcher. Currently it contains a single, simple test: the method testSimple.
package com.google.gwt.sample.stockwatcher.client; import com.google.gwt.junit.client.GWTTestCase; /** * GWT JUnit tests must extend GWTTestCase. */ public class StockWatcherTest extends GWTTestCase { [1] /** * Must refer to a valid module that sources this class. */ public String getModuleName() { [2] return "com.google.gwt.sample.stockwatcher.StockWatcher"; } /** * Add as many tests as you like. */ public void testSimple() { [3] assertTrue(true); } }
[1] Like all GWT JUnit test cases, the StockWatcherTest class extends the GWTTestCase class in the com.google.gwt.junit.client package. You can create additional test cases by extending this class.
[2] The StockWatcherTest class has an abstract method (getModuleName) that must return the name of the GWT module. For StockWatcher, that is com.google.gwt.sample.stockwatcher.StockWatcher.
[3] The StockWatcherTest class is generated with one sample test case—a tautological test, testSimple. This testSimple method uses one of the many assert* functions that it inherits from the JUnit Assert class, which is an ancestor of GWTTestCase. The assertTrue(boolean) function asserts that the boolean argument passed in evaluates to true. If not, the testSimple test will fail when run in JUnit.
Before you start writing your own unit tests for StockWatcher, make sure the components of the test environment are in place. You can do that by running StockWatcherTest.java which will execute the starter test, testSimple.
You can run JUnit tests four ways:
The build.xml file generated by GWT webAppCreator includes three generated targets used for testing:
Note: In order to run tests from the command-line, you will need to have JUnit installed on your system.
If you just downloaded the StockWatcher project, you must first open build.xml and replace all references to /path/to/junit-3.8.1.jar
with the path to junit on your system.
ant test.dev
[junit] Running com.google.gwt.sample.stockwatcher.client.StockWatcherTest [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 15.851 sec
ant test.prod
[junit] Running com.google.gwt.sample.stockwatcher.client.StockWatcherTest [junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 37.042 sec
The Google Plugin for Eclipse makes it easy to run tests in Eclipse.
Run As > GWT Junit Test
Run As > GWT Junit Test (production mode)
You can run unit tests in Eclipse using the launch configurations generated by webAppCreator for both development mode and production mode.
Run > Run Configurations...
StockWatcherTest-dev
-XstartOnFirstThread -Xmx256M
Apply
Run
Run > Run Configurations...
StockWatcherTest-prod
-XstartOnFirstThread -Xmx256M
Apply
Run
If you want to select the browser on which to run unit tests, use manual test mode. In manual test mode, the JUnitShell main class runs as usual on a specified GWT module, but instead of running the test immediately, it prints out a URL and waits for a browser to connect. You can manually cut and paste this URL into the browser of your choice, and the unit tests will run in that browser.
In Depth: To learn how to run unit tests in manual mode, see the Developer's Guide, Creating a Test Case.
In a real testing scenario, you would want to verify the behavior of as much of StockWatcher as possible. You could add a number of unit tests to the StockWatcherTest class. You would write each test in the form of a public method.
If you had a large number of test cases, you could organize them by grouping them into different test classes.
However, to learn the process of setting up JUnit tests in GWT, in this tutorial you'll write just one test and run it.
/** * Verify that the instance fields in the StockPrice class are set correctly. */ public void testStockPriceCtor() { String symbol = "XYZ"; double price = 70.0; double change = 2.0; double changePercent = 100.0 * change / price; StockPrice sp = new StockPrice(symbol, price, change); assertNotNull(sp); assertEquals(symbol, sp.getSymbol()); assertEquals(price, sp.getPrice(), 0.001); assertEquals(change, sp.getChange(), 0.001); assertEquals(changePercent, sp.getChangePercent(), 0.001); }
[junit] Running com.google.gwt.sample.stockwatcher.client.StockWatcherTest [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 16.601 sec
To see what happens when a unit test fails, you'll reintroduce the arithmetic bug you fixed in the Getting Started tutorial. Originally, the percentage of change was not calculated correctly in the getChangePercent method. To make the unit test fail, you'll break this bit of code again.
public double getChangePercent() {
return 10.0 * this.change / this.price;
}
Testsuite: com.google.gwt.sample.stockwatcher.client.StockWatcherTest Tests run: 2, Failures: 1, Errors: 0, Time elapsed: 16.443 sec Testcase: testSimple took 16.238 sec Testcase: testStockPriceCtor took 0.155 sec FAILED Remote test failed at <IP_ADDRESS> / Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:<IP_ADDRESS>) Gecko/2008070208 Firefox/3.0.1 expected=2.857142857142857 actual=0.2857142857142857 delta=0.0010 junit.framework.AssertionFailedError: Remote test failed at <IP_ADDRESS> / Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:<IP_ADDRESS>) Gecko/2008070208 Firefox/3.0.1 expected=2.857142857142857 actual=0.2857142857142857 delta=0.0010 at com.google.gwt.sample.stockwatcher.client.StockWatcherTest.testStockPriceCtor(StockWatcherTest.java:38) at com.google.gwt.sample.stockwatcher.client.__StockWatcherTest_unitTestImpl.doRunTest(__StockWatcherTest_unitTestImpl.java:7) ...
Note: When running from the command line, complete test reports (including stack traces) will be located in the reports/htmlunit.dev/
directory for development mode
tests and reports/htmlunit.prod/
directory for production mode tests.
[junit] Running com.google.gwt.sample.stockwatcher.client.StockWatcherTest [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 16.114 sec
Best Practices: Because there can be subtle differences between the way GWT applications work when compiled to JavaScript and when running as Java bytecode, make sure you run your unit tests in both development and production modes as you develop your application. Be aware, though, that if your test cases fail when running in production mode, you won't get the full stack trace that you see in development mode.
At this point, you've created a JUnit test for StockWatcher and added a simple test case to it.
To learn more about all kinds of unit testing in GWT, see the Developer's Guide:


Disk Usage
From PostgreSQL Wiki
Finding the size of various object in your database
Finding the size of your biggest tables
Note this this only shows you the totals for the database you're currently connected to:
SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_relation_size(nspname || '.' || relname)) AS "size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
AND nspname !~ '^pg_toast'
AND pg_relation_size(nspname || '.' || relname)>0
ORDER BY pg_relation_size(nspname || '.' || relname) DESC
LIMIT 20;
Example output (from a database created with pgbench, scale=25):
relation | size
------------------------+------------
public.accounts | 326 MB
public.accounts_pkey | 44 MB
public.history | 592 kB
public.tellers_pkey | 16 kB
public.branches_pkey | 16 kB
public.tellers | 16 kB
public.branches | 8192 bytes


--- layout: page title: About header-img: "img/about-bg.png" ---
I'm not quite sure what this blog is about yet??


A film can never replace the wealth of information a book contains, but it can express, narrate, and capture experiences, ideas, and emotions that no book can because of its audiovisual nature. You may use these modules to critique on the quality of direction, content of screenplay, acting, cinematography, and other film elements expand and probe into the complexitieis of film and history.


Preparation time
30 mins to 1 hour
Cooking time
over 2 hours
Serves
Serves 4
Preheat the oven to 170C/340F/Gas 3.
Score the fat of the pork belly diagonally in a criss-crossed fashion.
Pour a kettle-full of boiling water over the pork to tighten the skin, then drain and pat dry with kitchen paper.
Place the onion, thyme, and white wine into a deep roasting tray and season well with salt and freshly ground black pepper.
Place the pork into the roasting tray and transfer to the oven to roast for two hours, basting occasionally.
Remove the pork and increase the oven heat to 220C/425F/Gas 7.
Take the pork out of the tray and place onto a chopping board. Set aside the tray containing the cooking liquor. Cut the pork into 10cm/4in squares and place onto a clean roasting tray.
Pour half of the honey over the squares of pork belly then place the tray into the oven and cook for 15 minutes, or until the pork top is golden-brown and crisp, and the meat completely cooked through.
Meanwhile, strain the cooking liquor into a pan over a medium heat and add the remaining honey. Bring to the boil, season well with salt and freshly ground black pepper, and reduce the liquid volume by a third.
Heat an ovenproof frying pan until hot. Season the salmon with salt and freshly ground black pepper and place into the pan. Cook for 1-2 minutes on each side, until golden-brown all over, then place the pan in the oven alongside the pork and cook for 5-6 minutes, or until just cooked through.
Heat a clean large frying pan until hot and add the olive oil, cabbage and parsley. Stir-fry for 3-4 minutes, until the cabbage has softened, but retains a little bite. Season, to taste, with salt and freshly ground black pepper.
To serve, place a spoonful of cabbage in the centre of each plate.  Spoon the reduced pan juices around the plate and serve.


Here are a few of my favorite websites that I look at almost everyday
I just started working for a design firm in Portland. I work significantly with developers and wanted to have a deeper understanding of their day-to-day, so that is why I am taking this class
When I am not working I am ususally doing on of my below hobbies.


About
Hi there, I am Rui Wang; a software engineer from Cambridge UK. Currently, providing enterprise solutions to biotech industry, a keen contributor to open-source projects.
I am open to interesting and fun consulting gigs, short-term contracts. If you think you have somthing we can work together on then get in touch.


Tidy offers many options for cleaning your HTML, correcting errors, identifying accessibility issues, and more. All of the available options are available in the document window pane labeled “Tidy Options,” as shown to the left.
If you select any of the Tidy options, a description of that option appears at the bottom of the Tidy Options panel.
Some of the descriptions are quite long, and so you may choose to hide the descriptions. This is easily done by clicking on the “DESCRIPTION” label in the options panel. Clicking it again will show the descriptions again.


In order to explore the Kubernetes cluster on Google Kubernetes Engine you need to install the Google Cloud SDK command line tool.
gcloud
tool, but stop before the step gcloud init
. You can find the guide hereEmail<EMAIL_ADDRESS>with the topic Kubernetes intro SA
to create a service account.
When you have received an service account, download the file. We will use it to authenticate with Google Cloud.
client_email
gcloud auth activate-service-account INSERT_CLIENT_EMAIL_HERE --key-file=PATH_TO_JSON_FILE --project INSERT_PROJECT_NAME
gcloud container clusters list
The result should be similar to this:NAME LOCATION MASTER_VERSION MASTER_IP MACHINE_TYPE NODE_VERSION NUM_NODES STATUS
cv-cluster europe-north1-a 1.10.2-gke.3 <IP_ADDRESS> n1-standard-2 1.10.2-gke.3 6 RUNNING
Now that we are authenticated, we can look at the components in our cluster by using the kubectl command.
kubectl get nodes
kubectl describe nodes <INSERT_NODE_NAME>
A node is a worker machine in Kubernetes. A node may be a VM or physical machine, depending on the cluster.
It's time to deploy the frontend and backend to your cluster!
The preferred way to configure Kubernetes resources is to specify them in YAML files.
In the folder yaml/ you find the YAML files specifying what resources Kubernetes should create.
There are two services, one for the backend application and one for the frontend application.
Same for the deployments.
spec.template.spec.containers.image
insert the path to the Docker image we have created for the backend: us.gcr.io/ndc-london-kubernetes/backend:1
.There are a few things to notice in the deployment file:
app: backend
is defined three places:metadata
is used by the service, which we will look at laterspec.selector.matchLabels
is how the Deployment knows which Pods to managespec.template.metadata
is the label added to the Podsspec.template.spec.containers.image
insert us.gcr.io/ndc-london-kubernetes/frontend:1
, which is a Docker image we have created for the frontend application.kubectl apply -f ./yaml/backend-deployment.yaml
kubectl apply -f ./yaml/frontend-deployment.yaml
watch kubectl get pods
If you don't have watch
installed, you can use this command instead:
kubectl get pods -w
When all pods are running, quit by ctrl + q
(or ctrl + c
when on Windows).
Pods are Kubernetes resources that mostly just contains one or more containers,
along with some Kubernetes network stuff and specifications on how to run the container(s).
All of our pods contains only one container. There are several use cases where you might want to specify several
containers in one pod, for instance if you need a proxy in front of your application.
The Pods were created when you applied the specification of the type Deployment
, which is a controller resource.
The Deployment specification contains a desired state and the Deployment controller changes the state to achieve this.
When creating the Deployment, it will create ReplicaSet, which it owns.
The ReplicaSet will then create the desired number of pods, and recreate them if the Deployment specification changes,
e.g. if you want another number of pods running or if you update the Docker image to use.
It will do so in a rolling-update manner, which we will explore soon. The Pods are running on the cluster nodes.
Did you noticed that the pod names were prefixed with the deployment names and two hashes? - The first hash is the hash of the ReplicaSet, the second is unique for the Pod.
kubectl get deployments
Here you can see the age of the Deployment and how many Pods that are desired in the configuration specification,
the number of running pods, the number of pods that are updated and how many that are available.
kubectl get replicaset
The statuses are similar to those of the Deployments, except that the ReplicaSet have no concept of updates.
If you run an update to a Deployment, it will create a new ReplicaSet with the updated specification and
tell the old ReplicaSet to scale number of pods down to zero.
Now that our applications are running, we would like to route traffic to them.
targetPort
if the port on the Pods are different from the incoming traffic portapp: backend
defines that it should route requests to our Deployment with the same labelkubectl apply -f ./yaml/backend-service.yaml
kubectl apply -f ./yaml/frontend-service.yaml
kubectl get service
As you can see, both services have defined internal IPs, CLUSTER-IP
. These internal IPs are only available inside the cluster. But we want our frontend application to be available from the internet. In order to do so, we must expose an external IP.
Ok, so now what? With the previous command, we saw that we had two services, one for our frontend and one for our backend. But they both had internal IPs, no external. We want to be able to browse our application from our browser.
Let's look at another way. The Service resource can have a different type, it can be set as a LoadBalancer.
type
to be LoadBalancer
kubectl apply -f ./yaml/frontend-service.yaml
watch kubectl get service frontend
or
kubectl get service frontend -w
kubectl delete replicaset -l app=frontend
By doing this, the Deployment will create a new ReplicaSet which will again create new Pods.As you read earlier, Kubernetes can update your application without down time with a rolling-update strategy.
It is time to update to the newest version of the frontend application. This version has an updated background color.
:2
watch kubectl get pods
If you don't have watch
installed, you can use this command instead:
kubectl get pods -w
Don't close this window.
kubectl apply -f ./yaml/frontend-deployment.yaml
and watch how the Pods are terminated and created in the other terminal window.
Notice that there are always at least one Pod running and that the last of the old Pods are first terminated when on of the new ones has the status running.
Ok, everything looks good!
But what if you need to inspect the logs and states of your applications?
Kubernetes have a built in log feature.
Let's take a look at our backend application, and see what information we can retrieve.
kubectl get pods -l app=backend
l
is used to filter by pods with the label app=backend
.kubectl logs <INSERT_THE_NAME_OF_A_POD>
kubectl logs -l app=backend
kubectl exec -it <INSERT_THE_NAME_OF_A_POD> -- printenv
Here you can see that we have IP addresses and ports to our frontend service.
These IP addresses are internal, not reachable from outside the cluster.
You can set your own environment variables in the deployment specification.
They will show up in this list as well.
kubectl describe deployment backend
Notice that StrategyType: RollingUpdate
that we saw when we applied an updated frontend is set by default.
A cool thing in Kubernetes is the Kubernetes DNS.
Inside the cluster, Pods and Services have their own DNS record.
For example, our backend service is reachable on backend.<NAMESPACE>.svc.cluster.local
. If you are sending the request from the same namespace, you can also reach it on backend
.
We will take a look at this.
kubectl config view | grep namespace:
If there is no output, your namespace is default
.
kubectl get pods -l app=frontend
curl
from one of our frontend containers to see that we can reach our backend internally on http://backend.<NAMESPACE>.svc.cluster.local:5000
kubectl exec -it INSERT_FRONTEND_POD_NAME -- curl -v http://backend.<NAMESPACE>.svc.cluster.local:5000
The HTTP status should be 200 along with the message "Hello, I'm alive"
curl
from the same container to see that we can reach our backend internally on the shortname http://backend:5000
as wellkubectl exec -it INSERT_FRONTEND_POD_NAME -- curl -v http://backend:5000
The output should be the same as above.
Right now we have exposed our frontend service by setting the service type to LoadBalancer
.
Another option would be to use an ingress.
An ingress is a resource that will allow traffic from outside the cluster to your services. We will now create such a resource to get an external IP and to allow requests to our frontend service.
frontend
service on port 8080
.kubectl apply -f ./yaml/ingress.yaml
watch kubectl get ingress cv-ingress
or
kubectl get ingress cv-ingress -w
It may take a few minutes for Kubernetes Engine to allocate an external IP address and set up forwarding rules until the load balancer is ready to serve your application. In the meanwhile, you may get errors such as HTTP 404 or HTTP 500 until the load balancer configuration is propagated across the globe.
The LoadBalancer type is dependent on your cloud provider. Google Cloud Platform supports these features, but other providers might not.
Kubernetes is using health checks and readiness checks to figure out the state of the pods.
If the health check responds with an error status code, Kubernetes will asume the container is unhealthy and kill the pod. Simliary, if the readiness check is unsuccessful, Kubernetes will asume it is not ready, and wait for it.
You can define your own.
The first way to define a health check is to define which endpoint the check should use. Our backend application contains the endpoint /healthz
. Go ahead and define this as the health-endpoint in the backend deployment file, under backend container in the list spec.containers
:
livenessProbe:
httpGet:
path: /healthz
port: 8080
httpHeaders:
- name: X-Custom-Header
value: Awesome
initialDelaySeconds: 3
periodSeconds: 3
When applying the new deployment file, run kubectl get pods
to see that that the deployment has created a new Pod. Describe it to see the new specification.
We can also specify a command to execute in the container. Lets do this for the frontend application:
livenessProbe:
exec:
command:
- ls
- /
initialDelaySeconds: 5
periodSeconds: 5
The command can be any command available in the container. The commands available in your container depends on the base image and how you build your image.
E.g. if your container has curl
installed, we could define that the probe is to curl the /healtz
endpoint from the container. This wouldn't make much sence, though...
We would love to get feedback to improve our workshop. You are awesome if you have time to fill out this form. It is of course anonymous.
Contact us on @linemoseng or @ingridguren.


Intro
Professor Sweet is conducting some research to investigate the risk factor and drivers of student exam success. In a recent analysis he considers the variable “exam successfully passed” (vs. not passed) as the criterion (output) and the amount of time spent for preparation (aka study time) as predictor.
Setup
Please make sure that all packages are installed before proceeding. Except pradadata
, all packages are on CRAN. [ Here’s] (https://github.com/sebastiansauer/pradadatathe installation guide for pradadata
.
# devtools::install_github("sebastiansauer/pradadata") install this packages if not yet installed
data(stats_test, package = "pradadata")
library(tidyverse)
library(ggpubr)
library(glue)
library(ggExtra)
library(broom)
Let’s change some output formatting of ggplot (see this post for details)
options(ggplot2.continuous.colour="viridis")
options(ggplot2.continuous.fill = "viridis")
scale_colour_discrete <- scale_colour_viridis_d
scale_fill_discrete <- scale_fill_viridis_d
theme_set(theme_pubr())
Glimpse
First, Professor Sweet checks the uni-variate distribution of each variable of interest:
stats_test <- stats_test %>%
mutate_if(is.integer, as.numeric)
glimpse(stats_test)
#> Observations: 1,646
#> Variables: 7
#> $ date_time <chr> "08.12.2015 07:34:29", "08.12.2015 12:46:49", "08.1...
#> $ study_time <dbl> 3, 4, 3, 4, 2, 2, 4, 1, 3, 3, 2, 4, 3, 3, 3, 4, 4, ...
#> $ self_eval <dbl> 7, 8, 4, 7, 6, 6, 6, 7, 8, 7, 8, 8, 7, 7, 4, 6, 8, ...
#> $ interest <dbl> 4, 5, 1, 5, 3, 4, 3, 4, 5, 5, 3, 5, 4, 4, 1, 4, 5, ...
#> $ score <dbl> 0.7500000, 0.8250000, 0.7894737, 0.8250000, 0.80000...
#> $ row_number <dbl> 21, 22, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34,...
#> $ bestanden <chr> "ja", "ja", "ja", "ja", "ja", "ja", "ja", "ja", "ja...
Add some noise
Let’s add some noise to study time in order to adjust for measurement error:
stats_test <- stats_test %>%
mutate(study_time_noise = study_time + rnorm(n = nrow(.), 0,.5))
p1 <- stats_test %>%
select(study_time_noise, score) %>%
map2(., names(.), ~ggplot(data = data_frame(.x), aes(x = .x)) +
labs(x = .y,
title = glue("Variable: {.y}")) +
geom_histogram())
print(p1)
#> $study_time_noise
#>
#> $score
Bivariate association
p2 <- ggplot(stats_test) +
aes(x = study_time_noise, y = score) +
geom_jitter(alpha = .5) +
geom_smooth() +
labs(title = "Bivariate association of study time \nand score")
p3 <- ggMarginal(p2)
p3
Regression
Now, Professor Sweet computes a simple regression. Curiously, he sits and watches what the software spits out. First, a visual sketch:
stats_test %>%
ggplot() +
aes(y = score, x = study_time_noise) +
geom_jitter(alpha = .5) +
geom_smooth(method = "lm")
Then he computes the actual regression:
lm1 <- lm(score ~ study_time_noise, data = stats_test)
tidy(lm1)
#> # A tibble: 2 x 5
#> term estimate std.error statistic p.value
#> <chr> <dbl> <dbl> <dbl> <dbl>
#> 1 (Intercept) 0.628 0.00827 75.9 0.
#> 2 study_time_noise 0.0493 0.00267 18.5 1.48e-69
Compute the predicted values:
stats_test <- stats_test %>%
mutate(pred_lm1 = predict(lm1, newdata = stats_test))
Visual sketch:
p4 <- stats_test %>%
ggplot() +
aes(x = study_time_noise) +
geom_jitter(aes(y = score), alpha = .5) +
geom_line(aes(y = pred_lm1), color = "red", size = 5) +
labs(title = "Regression of exam score \nby study time")
p4
But what would happen if study time was, say, 10?
data_new <- data_frame(
study_time_noise = 0:10,
score = predict(lm1, newdata = data.frame(study_time_noise = 0:10))
)
p5 <- ggplot(stats_test) +
aes(x = study_time_noise, y = score) +
geom_jitter(alpha = .5) +
geom_line(data = data_new, color = "red", size = 3) +
scale_x_continuous(limits = c(0,10)) +
scale_y_continuous(breaks = seq(0,1,.25)) +
labs(title = "Regression with high values \nof study time")
p5
Pause
Now the exhausted professor sits and pauses in an attempt to conceive whats has been achieved.
ggarrange(p3, p4, p5, labels = c("A", "B", "C"))
This approach may yield implausible score values, ie above 1. Clearly, a different approach is needed.
Sigmoid curve
A simple alternative would be to replace to straight line by a sigmoid curve, such as in the following.
In essence, that’s the formula: \[p(X=1) = \frac{e^x}{1+e^x}\]
That’s how it looks like:
logist <- function(x){
y = exp(x) / (1 + exp(x))
}
ggplot(data_frame()) +
stat_function(aes(-5:5), fun = logist)
This function computes it as the best fit to a bunch of data points:
glm1 <- glm(score ~ study_time_noise, data = stats_test, family = "binomial")
Add the according predicted values:
stats_test <- stats_test %>%
mutate(pred_glm1 = predict(glm1, newdata = stats_test, type = "response"))
Plot the predicted values:
df_glm <- data_frame(
study_time_noise = 0:10,
pred_glm1 = predict(glm1,
newdata = data.frame(study_time_noise = 0:10),
type = "response")
)
p6 <- ggplot(stats_test) +
aes(x = study_time_noise, y = score) +
geom_jitter(alpha = .5) +
labs(title = "Sigmoid regression line") +
geom_line(data = df_glm, aes(y = pred_glm1),
color = "red", size = 3)
p6
Pause again
ggarrange(p3, p4, p5, p6, labels = c("A", "B", "C", "D"))


在一台电脑上管理两个github账号，需要大家做以下步骤.
比如说，你有一个126的邮箱和一个gmail邮箱，名字分别取x和y.在.ssh/目录下使用下面的命令：
ssh-keygen -t rsa -C<EMAIL_ADDRESS>ssh-keygen -t rsa -C<EMAIL_ADDRESS>在键入第一条命令的时候，不要一路回车，需要你重命名一下，可以直接以id_rsa_x和id_rsa_y来命令，第二个提示框可以按回车直接进行下一步。这样就会生成四个文件:
id_rsa_x.pub id_rsa_y.pub
id_rsa_x id_rsa_y
上面以*.pub结尾的文件需要你填入你的两个github上面的设置的ssh key and gpg
单击上面的New ssh Key,把pub文件的内容填入对应的ssh的对应框。
ssh-agent -s
ssh-add ~/.ssh/id_rsa_x
ssh-add ~/.ssh/id_rsa_y
Host x.github.com
hostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_x
User x
Host y.github.com
HostName github.com
User y
IdentityFile ~/.ssh/id_rsa_y
ssh -T x.github.com
ssh -T y.github.com
将你的项目_clone_到本地，
git clone git@github.com:wahtever
还有一个重要的问题就是你的git配置文件大部分都设置为了全局文件，那么就要设置新的config文件，这是针对你的项目而言的。
# 取消全局 用户名/邮箱 配置,下面的user.name是你的原来的真实名字
git config --global --unset user.name
git config --global --unset user.email
#为每个repo设置不同的 用户名/邮箱
git config user.email<EMAIL_ADDRESS>git config user.name "x"
git remote rm origin
git remote add origin git@ieit.github.com:whatever
# 重新push
git push origin master
Enjoy!
If you have pushed commit into remote,how to reset it? Yes, from literly you know i means.
git reset --soft <版本号>
Notes: --soft
rollback verison before, but it retains the modifies for the local work, then restart push it.
--hard
discards the modify.
git push origin <branch-name> --force
If you use the command without --force
, it will reject.Forcing to over cover remote branch.
Done.
First, you have to understand it: in wireshark, the packet is very important concept.Above, items of menu have File
,Edit
, View
, Go
,Capture
,Analyze
and they use packets(born from TCP/IP) except file
.
Each line in the packet list corresponds to one packet in the capture file, if you select a line in this pane, more details will be displayed in the “packet pane” and “Packet Bytes” panes.
The picture is very happy:
…
wireshark -i eth0 -k
This will start Wireshark capturing on interface eth0.
Or you click “Capture” -> “Options”, which short key is ctrl + k
. You can add it and linux command ifconfig
into to test.
So, my eth0 is called ‘enp1s0’
This is a new post and it is sister message for http://www.aftermath.cn/kvms-resize.html
First, we can see if the filestsyem has any swap, you can type:
sudo swapon --show
If any thing does not display, this means your system does not have any swap space.
You can verify there is no active swap using free
utility:
free -h
total used free shared buff/cache available Mem: 2.0G 105M 262M 11M 1.6G 1.7G Swap: 0B 0B 0B
Via df -h
to check disk space
sudo fallocate -l 2G /swapfile
The program fallocate
to create a file named swapfile
in our (/) directory.
Because we have a RAM is 1024MB, so we create a swapfile which space is 2G.
ls -hl /swapfile
You can verify it now.
Now, we do not turn this into swap space.Make the file only accessible to root
by typing:
sudo chmod 600 /swapfile
Next, type:
sudo mkswap /swapfile
Then, to start utilizing it:
sudo swapon /swapfile
So, we have finished it.
sudo df -h
sudo free -h
Yes, it is in use on this start,you have to add it into /etc/fstab
First, back up your /etc/fstab
. Then,
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
The swappiness
parameter configures how often your system swaps data out of RAM to the space. This is a value between 0 ans 100 that represents a percentage.
If you have a deskop machine, the 60
is ok, but for server, it is better 0.
cat /proc/sys/vm/swappiness
It will show on my machine:
60
We can set the swappiness to a different value by using the sysctl
command.
sudo sysctl.swappiness=10
If you want to it persent permenant , edit /etc/sysvtl.conf
file to add:
vm.swappiness = 10
好不容易使用libvirt库结合qemu把虚拟机装起来，但是没有想到在跑项目的时候居然dik space 太小了，看来是自己当初安装虚拟机的时候把容量给小了，想办法在整回去呗.
首先声明，我使用的是qemu自带的qcow2文件格式，但是好像这个并不会影响的使用。现在，我的kvms已经扩充完毕，有些数据已经拿不到了，但是思路还在的，我可以使用我的笔记再一次演示一遍的.
我的pool文件定义在/opt/kvms/pools/devel/debian-9.qcow2
,
stop your VM
Use qemu-img resize /opt/kvms/pools/devel/debian-9.qcow2 +25G
Restart your VM
Adjust your VM LVM partition
First, the result below is updated,
sudo fdisk -l
Disk /dev/vda: 55 GiB,<PHONE_NUMBER>0 bytes, 115343360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x57a2ec91
Device Boot Start End Sectors Size Id Type
/dev/vda1 * 2048 115343359 115341312 55G 83 Linux
But you must know, my /dev/vda1
is 10G size only,the 55G is result i resized it.
Next we use the fdisk tool to temporarily delete
partition /dev/vda1
,then create it bigger.
Here: section start 2048.
In fact, The fdisk have detected the space is 55G, but my /dev/vda1
is 10G only, because i dont’t resize the /dev/vda1
filesystem.
The process is:
# fdisk /dev/vda
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): d
Selected partition 1
Partition 1 has been deleted.
Command (m for help): n
Partition type
p primary (0 primary, 0 extended, 4 free)
e extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-62914559, default 2048): 2048
Last sector, +sectors or +size{K,M,G,T,P} (2048-62914559, default 62914559): [ENTER for default]
Created a new partition 1 of type 'Linux' and of size 30 GiB.
Command (m for help): t
Selected partition 1
Partition type (type L to list all types): 83
Changed type of partition 'Linux' to 'Linux'.
Command (m for help): a
Selected partition 1
The bootable flag on partition 1 is enabled now.
Command (m for help): p
Disk /dev/vda: 30 GiB,<PHONE_NUMBER>0 bytes, 62914560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x3ac5a058
Device Boot Start End Sectors Size Id Type
/dev/vda1 * 2048 62914559 62912512 30G 83 Linux
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Re-reading the partition table failed.: Device or resource busy
The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).
First we enter d
to delete a partition, As there is only one partition(/dev/vda1) it is automatically selected.
Next we create a new partioion
n
to start the new partition function
p
for a primary partition
1
to create /dev/vda1
2048
as our start sector
t
is to set partition type, then enter 83
to set it to linux.
To set the bootable, press a
for the boot function and enter 1
if prompted for the partition number.
Enter p
to print the new partition table.
w
is write to the partition table.
Ok, we have finished the partition table.And you have noted the output, you have to use bash command to tell kerenl to load the new partition table.
partprobe /dev/vda
If success there is no output.
The last step is very important for the process, because you donnot resize /dev/vda1 filesystem.We have expanded the partition but the filesystem has not been expanded to fill it. How? resize2fs
resize2fs /dev/vda1
Hope it works!
sudo pip install pygal
python可以画比较优美的图表，现在介绍一下pygal的简单用法，下面模拟一个掷骰子的游戏。
code in die.py
from random import randint
class Die():
""" a class of die(骰子)"""
def __init__(self, num_sides = 6):
# default a die have 6 sides
self.num_sides = num_sides
def roll(self):
""" return a random number between 1 and side"""
return randint(1, self.num_sides)
下面是实例化的代码： code in die_visual.py
from die import Die
die = Die()
# throw die, result in a list
results = []
for roll_num in range(100):
result = die.roll()
results.append(result)
print(results)
上面的代码你应该知道怎么去运行吧？
很简单，就是简单的把１，２,,,６出现的频率分析一下：
--[snip]--
frequencier = []
for value in range(1, die.num_sides + 1):
frequency = results.count(value)
frequencier.append(frequency)
--[snip]--
这个思想和上面的没啥区别，关键有一点我不是很明白，为什么是从点数是从１到die.num_sides+1,直接到die.num_sides不行吗?不行，请看下面的代码:
for i in range(1, 6):
print i
# output: 1 2 3 4 5
原来是两端取一端的。
下面的才是今天的重点，
--[snip]--
# 绘制直方图
hist = pygal.Bar()
hist.title = u"投掷1000次的结果"
hist.x_labels = ['1','2','3','4','5','6']
hist.x_title = u"结果"
hist.y_title = u"结果的频率"
hist.add('D6', frequencier)
hist.render_to_file('die_visual.svg')
效果如下所示：
下面就是画出两个骰子的分布图，代码只需做一个修改，为了不占用空间，请参考


Popular movies
{% if popular_movies %}
{% include request.session.layout_movies_index|last with movies=popular_movies %}
{% else %}
No movies are currently in the database.
{% endif %}
Latest movies
{% if latest_movies %}
{% include request.session.layout_movies_index|last with movies=latest_movies %}
{% else %}
No movies are currently in the database.
{% endif %}


| 3706 - Exchange Europe - Northeastern Europe & Russian Republic - 2006/2007 | |||||
| Submit | Ranking |
You are taking part in a large project to automate operations for Northeastern Exchange of Resources and Commodities (NEERC). Different resources and commodities are traded on this exchange via public auction. Each resource or commodity is traded independently of the others and your task is to write a core engine for this exchange -- its order book. There is a separate instance of an order book for each traded resource or commodity and it is not your problem to get the correct orders into order books. The order book instance you will be writing is going to receive the appropriate orders from the rest of exchange system.
Order book receives a stream of messages. Messages are orders and requests to cancel previously issued orders. Orders that were not cancelled are called active. There are orders to buy and orders to sell. Each order to buy or to sell has a positive size and a positive price. Order book maintains a list of active orders and generates quotes and trades. Active order to buy at the highest price is the best buy order and its price is called bid price. Active order to sell at the lowest price is the best sell order and its price is called ask price. Ask price is always lower than bid price, that is, buyers are willing to pay less than sellers want to receive in return.
A current quote from the order book contains current bid size, bid price, ask size, and ask price. Here bid and ask sizes are sums of the the sizes of all active orders with the current bid price and the current ask price correspondingly.
A trade records information about transaction between buyer and seller. Each trade has size and price.
If an order to buy arrives to the order book at a price greater or equal to the current ask price, then the corresponding orders are matched and trade happens -- buyer and seller reached agreement on a price. Vice versa, if an order to sell arrives to the order book at a price less or equal to the current bid price, then trade happens, too. For the purpose of order matching, order book works like a FIFO queue for orders with the same price (read further for details).
When an order to buy arrives to the order book at a price greater or equal to the current ask price it is not immediately entered into the order book. First, a number of trades is generated, possibly reducing the size of incoming order. Trade is generated between incoming buy order and the best order to sell. If there are multiple best orders (at the ask price), then the order that entered the order book first is chosen. Trade is generated at the current ask price with the size of the trade being equal to the smaller of the sizes of two matching orders. Sizes of both matching orders are reduced by the size of the trade. If that reduces the size of sell order to zero, then it becomes inactive and is removed from the order book. If the size of incoming buy order becomes zero, then the process is over -- incoming order becomes inactive. If the size of incoming buy order is still positive and there is another sell order to match with, then the process continues generating further trades at the new ask price (ask price can increase as sell orders are traded against and become inactive). If there is no sell order to match with (current ask price became greater than incoming buy order price), then incoming buy order is added to the order book with its remaining size.
For incoming sell order everything works similarly -- it is matched with buy orders from the order book and trades are generated on bid price.
On incoming cancel request the corresponding order is simply removed from the order book and becomes inactive. Note, that by the time of the cancel request the quantity of the corresponding order might have been already partially reduced or the order might have become inactive. Requests to cancel inactive order do not change anything in the order book.
On every incoming message the order book has to generate all trades it causes and the current quote (bid size, bid price, ask size, ask price) after processing of the corresponding message, even when nothing has changed in the order book as a result of this message. Thus, the number of quotes the order book generates is always equal to the number of incoming messages.
The input will contain several test cases, each of them as described below. Consecutive test cases are separated by a single blank line.
The first line of the input contains a single integer number n
BUY and SELL denote
an order to buy or to sell correspondingly, and are followed by two
integers q
For each test case, the output must follow the description below.
The outputs of two consecutive cases will be separated by a blank line.
Write to the output a stream of quotes and trades that the
incoming messages generate. For every trade write TRADE followed after space
by the trade size and price. For every quote write QUOTE followed after
space by the quote bid size, bid price, minus sign (``-"), ask size,
ask price (all separated by spaces).
There is a special case when there
are no active orders to buy or to sell in the order book (bid and/or
ask are not defined). This case is treated as follows. If there is no
active order to buy, then it is assumed that bid size is zero and bid
price is zero. If there is no active order to sell, then it is assumed
that ask size is zero and ask price is 99 999. Note, that zero is not a
legal price, but 99 999 is a legal price. Recipient of quote messages
distinguishes actual 99 999 ask price from the special case of absent
orders to sell by looking at its ask size.
See example for further clarification.
Output
Sample Input
11
BUY 100 35
CANCEL 1
BUY 100 34
SELL 150 36
SELL 300 37
SELL 100 36
BUY 100 38
CANCEL 4
CANCEL 7
BUY 200 32
SELL 500 30
Sample Output
QUOTE 100 35 - 0 99999
QUOTE 0 0 - 0 99999
QUOTE 100 34 - 0 99999
QUOTE 100 34 - 150 36
QUOTE 100 34 - 150 36
QUOTE 100 34 - 250 36
TRADE 100 36
QUOTE 100 34 - 150 36
QUOTE 100 34 - 100 36
QUOTE 100 34 - 100 36
QUOTE 100 34 - 100 36
TRADE 100 34
TRADE 200 32
QUOTE 0 0 - 200 30
Northeastern Europe & Russian Republic 2006-2007


UX Driven Development Part One
Wednesday June 27th, 2012 - Started in the wee hours of the morning.
If there is one thing that I have learned in my first ten years of professional software development, it is that user experience driven development is far and away the most successful approach I have ever taken or observed. I plan to write a few blog posts exploring the topic and how it is relevant to everyone involved in software development.
Read more...Miscellaneous
Friday, June 22th, 2012 - Late, again. Again.
Quick updates. Did a quick new project. Feature ideas for blog. Self-recrimination. Home media sharing. I'm sure you're salivating by now. I'm absolutely sure of it. You can't help it!
Read more...The Baptismal Font
Thursday, June 21th, 2012 - Late, again.
I've fiddled my fonts around to a more pleasing arrangement. I liked the old one, but it began to feel sort of cartoony to me. I've always been a sucker for thin Helvetica, so I'm giving that a go as my main font. I picked a serif Google Web Font to contrast a bit in headers.
Read more...Blog Generation - THE WHOLE TRUTH
Wednesday, June 20th, 2012 - Late Afternoon
Well, I've finished my second project on this site! Hurray! My blog is now generated entirely by a simple utility that I can run locally on Markdown files. Look ma, no database!
Read more...Blog Generation...
Wednesday, June 20th, 2012 - Middle of the night!
This is a test of the python blog generation system. This is only a test.
Read more...rswitch
Tuesday, June 19th, 2012 - Evening
I've ended up buying a Retina Macbook Pro for a variety of reasons. That's another blog post. This blog post is about a little utility I wrote to switch to the native resolution.
Read more...Mixer Fixer
Saturday, June 16th, 2012 - Evening
A long, long time ago, we had a working stand mixer. The KitchenAid Professional 600. It served us well; we made all manner of dough with its massive hook. One day, in the midst of such dough making, the machine gave a massive clank, and began to whir without any further motion in the actual mixing bowl. Upon inspection, we discovered that the mixing arm assembly had somehow fallen down about half a centimeter, with no evident cause. The mixer motor spun, but the arm spun no more. And a mixer that stops spinning is not much of a mixer, it turns out.
Read more...Engage Social Factor 1
Friday, May 11th, 2012 - Evening
Recently, I've found that I have wanted to be more connected than I have in past years. I've generally eschewed Facebook, Twitter and other social networking services. My general impression is that if I want to talk to you, I'll talk to you. If you want to talk to me, you can talk to me. I didn't really feel the need to use these social networks to do this - I had a cell phone and I had email, and I used both constantly.
Read more...


pepper hot RCP temperature growth change scenarios air {border-style fruit fruits leaf Lee, px;} #ffffff;} control leaves plants climate conditions days photosynthetic treatments Climate extreme treatment using yield addition, affected increased light significantly Lee concentration plant production weather characteristics high reduced Capsicum However, mg/L number physiological rate (Figure Kim, LSD moderate photosynthesis treatments. Environment, Growth Park, cabbage compared concentrations elevated higher physical px; response significant {font-family Horticultural L.) crop dry effects font-size precipitation scenario terms weight μmol (RCP .°C Choi, DAT. Figure Kimchi Korea annuum chlorophyll control, decreased development double; growth, model morphological parameters pepper. showed studies (C) Institute Intergovernmental John National Panel Plant Previous Science, Table USA). Wiley abnormal approximately border-color border-width chili differences effect exposed harvesting length matter net relative respectively respectively, respectively. responses soil solid; tested {font-style {font-weight μmol/mol, (Table (μmol An‐Ci Biotechnology, Cell Co., Control DAT Different Fruit Horticulture, Leaf Ltd, Moon, PPF, Photosynthetic Plant, Research Science Son, Sons, South approx. area assimilation based bold collab: columns compensation control. courier; em; existing exposure factors fresh grown humidity increase indicate indicated irrigation kg/ha leaves, letters maintained maximum mean measured phosphate photosynthesis, pt;} rate, results samples suggested temperature, temperatures test treatment. value


Newing, William John
| Birth Name | Newing, William John |
| Gender | male |
| Age at Death | 88 years |
Events
| Event | Date | Place | Description | Sources |
|---|---|---|---|---|
| Birth | 1861 | Kiama NSW #8124 | ||
|
|
||||
| Death | 1949 | Granville NSW #3541 | ||
|
|
Parents
| Relation to main person | Name | Birth date | Death date | Relation within this family (if not by birth) |
|---|---|---|---|---|
| Father | Newing, Thomas | |||
| Mother | Bailey, Maria | 1868 | ||
| Newing, William John | 1861 | 1949 | ||
| Sister | Newing, Ann M. | 1863 | ||
| Brother | Newing, Thomas Henry | 1865 | 1941 | |
| Brother | Newing, James B. | 1868 |
Families
Family of Newing, William John and Winley, Pricilla |
||||||||||||||||
| Unknown | Partner | Winley, Pricilla ( * 1861 + ... ) | ||||||||||||||
| Children |
| Name | Birth Date | Death Date |
|---|---|---|
| Newing, Lillian Margaret | 1883 | |
| Newing, William Charles | 1885 | |
| Newing, Lavinia Myrtle | 1890 |
| Type | Value | Notes | Sources |
|---|---|---|---|
| _UID | ECAA94E071E3DA119522FB440938335508AB |
Family of Newing, William John and Nye, Pheobe Ruth
| Event | Date | Place | Description | Sources |
|---|---|---|---|---|
| Marriage | 1903 | Mosman NSW Aust #8862 | ||
|
|
| Name | Birth Date | Death Date |
|---|---|---|
| Newing, Myee Olive Mona | 1905 | 1968-07-21 |
| Newing, Jack Alleyne | 1908 | 1983-06-14 |
| Newing, [Living] |
| Type | Value | Notes | Sources |
|---|---|---|---|
| _UID | E59162245FD5DA119522A48E4769D856E248 |
Attributes
| Type | Value | Notes | Sources |
|---|---|---|---|
| _UID | E49162245FD5DA119522A48E4769D856E138 |


Starting Location
Destination Location
Name
Phone
| Driver Name | {{trip.driver.name}} | Customer Name | {{trip.customer.name}} | Trip Status | {{trip.trip_status}} | Start Destination | {{trip.starting_location.name}} | Start Destination | {{trip.destination_location.name}} | Call Time | {{trip.call_time | date}} |
|---|
Name
Phone
| Driver Name | {{trip.driver.name}} | Customer Name | {{trip.customer.name}} | Trip Status | {{trip.trip_status}} | Start Destination | {{trip.starting_location.name}} | Start Destination | {{trip.destination_location.name}} | Call Time | {{trip.call_time | date}} |
|---|
Call Time
Arrived Time
Wating Time
| KM | Total | price | {{trip.total_price | currency}} | Waiting Time | ETTA fee | {{getEttaFee() | currency}} |
|
{{trip.time_added | date}} |
|
{{trip.time_arrived| date}} |
|---|


data class BotBusMockLog
(source)
The actions sent by the mocked bus.
<init> |
The actions sent by the mocked bus. BotBusMockLog(action: Action, delay: Long) |
action |
The action sent. val action: Action |
delay |
The delay before the action is sent. val delay: Long |
assert |
Assert that log contains specified text. infix fun assert(text: String): <ERROR CLASS>
Assert that log contains specified message. infix fun assert(message: ConnectorMessage): <ERROR CLASS> |
assertMessage |
Assert that log contains specified ConnectorMessage. fun assertMessage(message: ConnectorMessage, errorMessage: String? = null): <ERROR CLASS> |
assertText |
Assert that log contains specified text. fun assertText(text: String, errorMessage: String? = null): <ERROR CLASS> |
choice |
Retrieve choice member of main part of generic message with expected title fun choice(title: String): Choice? |
elementChoice |
Retrieve choice member with expected title belonging to element with specified index fun elementChoice(elementIndex: Int, title: String): Choice? |
genericMessage |
Convert current BotBusLog action first message to a generic message fun genericMessage(): GenericMessage? |
message |
The message of the specified ConnectorType if it exists. fun message(connectorType: ConnectorType): ConnectorMessage? |
text |
The text message if any. fun text(): String? |
alexa |
The Alexa message if any. fun BotBusMockLog.alexa(): AlexaMessage? |
ga |
The Google Assistant message if any. fun BotBusMockLog.ga(): GAResponseConnectorMessage? |
messenger |
The Messenger message if any. fun BotBusMockLog.messenger(): MessengerConnectorMessage? |
slack |
The Slack message if any. fun BotBusMockLog.slack(): SlackConnectorMessage? |
|
|
The WhatsApp message if any. fun BotBusMockLog.whatsapp(): WhatsAppBotMessage? |


!Lady Claudia:
Once you've been transformed, yes, exactly. They'll be so busy guarding their other entrances they won't think to check on one of their own walking through the front door, so to speak.
There was one slight problem--all the guards carry unique ID cards, without which they can't gain access to the Sanctum.
[Quest _195_SevenSignsSecretRitualofthePriests claudiaathebaldt_q195_2.htm|"That's been resolved though?"]


Hakkinen feels Vettel-Leclerc incident puts pressure on Binotto
by Tom MasonTwo-time F1 champion Mika Hakkinen believes that the incident which occurred at the Brazilian Grand Prix between teammates Charles Leclerc and Sebastian Vettel will only cause problems for the Ferrari team principal Mattia Binotto.
The pair clashed towards the end of the race in Brazil last weekend which resulted in both finishing outside the points, hampering their chances of securing third in the drivers' championship.
“The collision and double zero were the worst possible result for Vettel and Leclerc," Hakkinen told Unibet.
"And I can really understand what they felt. Sometimes it happens that teammates have an accident on the track.
"He puts under pressure the manager of the team Mattia Binotto, who now has to find a way to make the two drivers work better for the team for next year."


My Project
File List
Here is a list of all files with brief descriptions:
bird.cpp
bird.h
flock.cpp
flock.h
main.cpp
objloader.cpp
objloader.hpp
Octree.h
shader.cpp
shader.hpp
simulTimer.cpp
simulTimer.h
texture.cpp
texture.hpp
Generated by
1.8.13


NBNSProtocol Class¶
pysmb has a NBNSProtocol implementation for Twisted framework. This allows you to perform name query asynchronously without having your application to block and wait for the results.
- In your project,
- Create a NBNSProtocol instance.
- Just call queryName method which will return a Deferred instance. Add your callback function to the Deferred instance via addCallback method to receive the results of the name query.
- When you are done with the NBNSProtocol instance, call its <NBNSProtocol instance>.transport.stopListening method to remove this instance from the reactor.
-
class
nmb.NetBIOSProtocol.
NBNSProtocol
(broadcast=True, listen_port=0)[source]¶ -
__init__
(broadcast=True, listen_port=0)[source]¶ Instantiate a NBNSProtocol instance.
This automatically calls reactor.listenUDP method to start listening for incoming packets, so you must not call the listenUDP method again.
Parameters: - broadcast (boolean) – A boolean flag to indicate if we should setup the listening UDP port in broadcast mode
- listen_port (integer) – Specifies the UDP port number to bind to for listening. If zero, OS will automatically select a free port number.
-
queryIPForName
(ip, port=137, timeout=30)[source]¶ Send a query to the machine with ip and hopes that the machine will reply back with its name.
The implementation of this function is contributed by Jason Anderson.
Parameters: - ip (string) – If the NBNSProtocol instance was instianted with broadcast=True, then this parameter can be an empty string. We will leave it to the OS to determine an appropriate broadcast address. If the NBNSProtocol instance was instianted with broadcast=False, then you should provide a target IP to send the query.
- port (integer) – The NetBIOS-NS port (IANA standard defines this port to be 137). You should not touch this parameter unless you know what you are doing.
- timeout (integer/float) – Number of seconds to wait for a reply, after which the method will return None
Returns: A twisted.internet.defer.Deferred instance. The callback function will be called with a list of names of the machine at ip. On timeout, the errback function will be called with a Failure instance wrapping around a NetBIOSTimeout exception
-
queryName
(name, ip='', port=137, timeout=30)[source]¶ Send a query on the network and hopes that if machine matching the name will reply with its IP address.
Parameters: - ip (string) – If the NBNSProtocol instance was instianted with broadcast=True, then this parameter can be an empty string. We will leave it to the OS to determine an appropriate broadcast address. If the NBNSProtocol instance was instianted with broadcast=False, then you should provide a target IP to send the query.
- port (integer) – The NetBIOS-NS port (IANA standard defines this port to be 137). You should not touch this parameter unless you know what you are doing.
- timeout (integer/float) – Number of seconds to wait for a reply, after which the returned Deferred instance will be called with a NetBIOSTimeout exception.
Returns: A twisted.internet.defer.Deferred instance. The callback function will be called with a list of IP addresses in dotted notation (aaa.bbb.ccc.ddd). On timeout, the errback function will be called with a Failure instance wrapping around a NetBIOSTimeout exception
-


Here's some text: Supercalifragilisticexpialidocious! And subsequently, definitely more text.
Normal test markup
Here's some text:
Supercalifragilisticexpialidocious!
And subsequently, definitely more text.
Some additional test markup


HyunA is surrounded by nature in stunning MV teaser for 'Flower Shower' comeback
by danisurstHyunA has dropped a new music video teaser for comeback single "Flower Shower"!
Her agency P NATION released the clip through their official Instagram channel, reminding fans that her new single will be dropping on November 5 at 6 PM KST.
In the clip, fans can hear the introduction of the song, which was previously revealed in HyunA's dance practice spoiler. However, this time around, they also get their first look at the music video's stunning concept, where HyunA brings her trademark glamour to a flower-filled natural setting.
Check out the clip below, and stay tuned for HyunA's comeback!


Dashboard
sources
Items & Utilities
Categories
State & Provience
Alert Reports
Admin
Users & Roles
Settings
Items Categories
Last updated at 22 September , 2020
Export
Add New
Category
Cluster
Showing 10 entries
Category
Quantity By Items
Category Remarks
Added By
Actions
Kitchen Set
471
This category denotes the kithen utensil
Gokul SHarma
Kitchen Set
471
This category denotes the kithen utensil
Gokul SHarma
Kitchen Set
471
This category denotes the kithen utensil
Gokul SHarma
Kitchen Set
471
This category denotes the kithen utensil
Gokul SHarma
Kitchen Set
471
This category denotes the kithen utensil
Gokul SHarma
Kitchen Set
471
This category denotes the kithen utensil
Gokul SHarma
Kitchen Set
471
This category denotes the kithen utensil
Gokul SHarma
Kitchen Set
471
This category denotes the kithen utensil
Gokul SHarma
Kitchen Set
471
This category denotes the kithen utensil
Gokul SHarma
Kitchen Set
471
This category denotes the kithen utensil
Gokul SHarma
Showing 10 entries
Cluster Name
Quantity By Items
Cluster Remarks
Added By
Actions
Shelter
222
This category denotes the basic needs of stay
Gokul SHarma
Shelter
222
This category denotes the basic needs of stay
Gokul SHarma
Shelter
222
This category denotes the basic needs of stay
Gokul SHarma
Shelter
222
This category denotes the basic needs of stay
Gokul SHarma
Shelter
222
This category denotes the basic needs of stay
Gokul SHarma
Shelter
222
This category denotes the basic needs of stay
Gokul SHarma
Shelter
222
This category denotes the basic needs of stay
Gokul SHarma
Shelter
222
This category denotes the basic needs of stay
Gokul SHarma
Shelter
222
This category denotes the basic needs of stay
Gokul SHarma
Shelter
222
This category denotes the basic needs of stay
Gokul SHarma


---
# Mean Squared Displacement
Mean squared displacement is calculated using the formula below:
where N is the number of timesteps, r(t) is the position of particle at time t and dt is time delta.
In order to understand the type of diffusion one can calculate MSD for different timedelta values
and plot MSD vs dt.
---
### MSD vs dt
The shape of the MSd vs dt curve gives information about the type of the motion of the particle.
For true random walk (brownian motion) a linear line is expected.
If there are other forces affecting the motion of the particle then different behaviours can be expected.
---
## LAMMPS
#### US - Minimization
Calculate min energy and distance for each point
#### US - NVT & Spring (eps: 5)
Attached spring (k:5 kcal/mol) to each point and performed NVT simulations for 5 ns (dt: 1 fs).
Performed WHAM analysis which resulted in barriers ~0.15 kca/mol.
The activation energy of the molecule is 0.57 eV which corresponds to ~13 kcal/mol.
This suggests that surface-molecule interaction energy should be ~100 times larger.
---
#### US - NVT & Spring (eps: 500)
This resulted in molecule to explode (bonded atoms becoming too far apart).
This is presumably because the molecule is initially placed ~5 A above the surface and with the NVT
simulation the molecule is attracted to the surface with so much speed that the atoms just gain too much velocity.
This veolcity is however different for each atom therefore they might fly apart from each other losing bonds.
This can be alleviated by minimizing the system first.
Moreover by changing the epsilon coefficient the equilibrium z-distance might be changed.
Instead of using the same z position for the spring, for these simulations I decided to use the last z position from the minimization.
#### US - Minimization - NVT & Spring (eps: 500)
---
class: center, middle
#
Thank you!
### [Home](https://kbsezginel.github.io)


Using in your browser¶
Here’s sample walktrough how to create templates of reports and use them.
Go to url with Templado app, there is almost no content, because you haven’t created your templates yet. Let’s do this! Click on
Create Template
on the sidebar.- Now I will explain you the meaning of fields of form:
Title of template
- you can name it how you want, e.g. “Pro forma invoice”JSON template file
- here you upload json pattern of form for creating new report. I will show you sample file:{ "id": { "caption": "Report ID", "hint": "some number e.g. 21", "type": "text", "order": 1, "check": "^[0-9]+$" }, "year": { "caption": "Year", "hint": "YYYY", "type": "text", "order": 2, "check": "^[0-9][0-9][0-9][0-9]$" }, "items": { "caption": "Bought products", "order": 3, "type": [ { "price": { "caption": "Price", "hint": "e.g. 21.00", "type": "text", "order": 2, "check": "^[0-9]+\\.[0-9][0-9]$" }, "name": { "caption": "Name of product", "hint": "e.g. printer ink", "type": "text", "order": 1, "check": ".+" } } ] } }
As you can see, we declare what fields we want to show: “id”, “year” and “items”. Let’s look on it! It has:
- “caption”
represents what will show as label
- “hint”
placeholder for input
- “type”
based on the type of value we declare type of input, for string - text input, for list with dict - nested formset which can have several text inputs, only root form can have those
- “order”
number for ordering fields, because form pattern is represented as dict
- “check”
regular expression for validating input from user
HTML template file
- the file can be like this:  <title></title>
Invoice no. {{ id }}

 {% for element in items %}
 {{ element.name }}	 {{ element.price }}
 {% endfor %}

Here we specify how our pdf with report should look like. It will be filled with data user gives to the input in form. We’re using names from json file:
id
anditems
, and becauseitems
is formset it can have several entries. Each of them hasname
andprice
, so we can iterate over it.Tags
- some keywords separated with commaPattern for title
- it will show as title of report based on data from form, also uses Django template language e.g.:PFI/{{ id }}/{{ year }}
Pattern for tags
- your keywords, so it will be easier to find some specific report, e.g.:year: {{ year }}
Make sure you filled all fields and click
Create!
It will redirect you to viewTemplates
and create new report template from which you can generate new reports.Now you can create new report from template. To do this click
Generate
.There you have form, it has labels, captions, validations as we declared earlier in json pattern. Fill it as you like (in formset you can add new elements) and click
Generate PDF
.Finish! New report is created, click
Download
to see PDF based on html pattern we uploaded a few steps back and data we entered into form.


Your browser does not support the audio element.
Guydr Project
An alternative app client
Nearby Profiles
User Profile
Chats
Profiles
Chats


Our Business Plan is currently open for review:
Take A LookSUDO is a new society at the University of Canberra, we’re focused on innovation, planning & development and actual implementation in the technology sector.
We aim to be an entity to which members can belong and feel like they’re not on their own in pursuing their projects or to connect them with existing projects.
While primarily for STEM students for obvious reasons we aim to impact the UC Community as a whole through proposed campus interactivity and society tooling projects.
To Develop. That’s it. Whether it’s your app, the next Facebook, or a less hackable Census, the UC Student Developer Organisation exists for you.
SUDO is a new society at the University of Canberra, we’re focused on innovation, planning & development and actual implementation in the technology sector.
We aim to be an entity to which members can belong and feel like they’re not on their own in pursuing their projects or to connect them with existing projects.
While primarily for STEM students for obvious reasons we aim to impact the UC Community as a whole through proposed campus interactivity and society tooling projects.
SUDO is really new - we’re still in the stages of setting everything up and sorting out who does what.
Here’s a just a few things we plan to do:


Responsibility. People who take responsibility for problems and fix them should be rewarded.
Proactiveness. People who come up with ideas to make things better should be rewarded
Experimentation. We find out what works well by trying different things and learning new technologies
Velocity. At the end of the day, everyone has the same goal: to get the project done and delivered. You want to do this as fast as possible.
What We Want To Avoid:
Builds blame culture: everyone will be trying to blame everyone else for bugs that are found because it will affect their review
Encourages people not to take responsibility. If you do accept responsibility (it's my bug) then you get penalised
Hurts inter-team relations. Developers and testers don't usually get on, but can you imagine the animosity the developers will feel towards testers if every bug a tester finds effectively damages a developer in their review.
Slows velocity and costs more. Each spec is going to need to be written in huge detail or the developers won't touch it. There will be a massive increase in developer testing in order to ensure there are no bugs (and this probably
won't work anyway).
Risk-averse culture. Nobody will want to try anything new because new means risky. Forget about new techniques, new technologies, new organisational mechanisms.
Flight to safely. Nobody will want to work on the "hard" parts of the system because they will be more likely to introduce bugs. Everyone will want to write the admin screens, nobody will actually want to code the core functionality.


{%- extends 'utils/layout.html' -%} {%- block title -%} FAQ {%- endblock -%} {%- block content_header -%}
If your account is disabled (you will get this message when you try to log in), it means that a moderator or administrator has removed your privilege to use this site. This decision was made based on behavior in comments, chat, or to problem submissions. If you believe that this decision was made erroneously, please contact us and we will investigate the issue as soon as possible.


{{dialog.header ? "Virtual columns have header" : "Virtual columns do not have header"}}{{dialog.numericParse ? "Determine number cell type" : "Number cell type always number"}}{{dialog.skipEmptyRows ? "Skipping empty rows" : "Not skipping empty rows"}}{{dialog.includeSheetName ? "Including sheet name as additional column" : "Not including sheet name"}}


First: Kyria
Middle: Rebekah
Last: Beals
Maiden: Shoemaker
DOB: 1998-01-22
Eye: Hazel
Hair: Dark Brown. Occasional red streaks.
Married: To Charles Beals on June 8th, 2019.
School: K-12 Homeschooled. Attended classes at Haslett Highschool. Dual enrolled at Lansing Community College in high school. Took Russian classes at Michigan State University during gap year after High School graduation. Attended Spring Arbor University from 2016-2019, obtaining a BA in Art with concentrations in painting and drawing.
Father: Kevin Jon Shoemaker
Mother: Beth Ann Shoemaker (Booher)
Brother: Elliot Isaac Shoemaker
Brother: James Shoemaker*
Sister: Annika Israel Shoemaker
Sister: Rachelle Shoemaker*
Sister: Sophia Shoemaker
Brother: Enoch Shoemaker*
Brother: Pascal Shoemaker*
Sister: Pascaline Shoemaker*
Husband: Charles Fleming Beals
Son: Zander Amil Beals


{% extends 'base.html' %} {% block head %} {% endblock head %} {% block navbar %} {% if current_user.has_permission("read_membership") %}
| Character | {{ current_user.name }} | |||
|---|---|---|---|---|
| ESI | {% if not current_user.refresh_token or not current_user.access_token %}{% else %} | Provided | {% endif %}This will be the information that is used to review your application. All of the endpoints you provide are read-only. | {% if not current_user.refresh_token or not current_user.access_token %}{% else %} {% endif %} |
| {{ current_user.reddit }} | {% else %}Link Reddit | {% endif %}We require a reddit account as we use a private subreddit for our announcements, after-action-reports, SRP, etc. The account you link here can be a throw-away, as long as you are able to log into it. If you don't have a reddit account, you can make one at here. | {% if not current_user.reddit %}{% else %} {% endif %} |
If you have any questions, you can join our public Discord and ask for help by typing @Recruiters followed by your question.
Join Discord {% endblock content %}


Module: ROM::Cassandra::Commands
- Defined in:
- lib/rom/cassandra/commands.rb,
lib/rom/cassandra/commands/batch.rb,
lib/rom/cassandra/commands/create.rb,
lib/rom/cassandra/commands/delete.rb,
lib/rom/cassandra/commands/update.rb
Overview
The collection of Cassandra-specific ROM commands
Defined Under Namespace
Classes: Batch, Create, Delete, Update
Class Method Summary collapse
Instance Method Summary collapse
-
#execute(command = self) ⇒ Array
Implements the execute method of the `ROM::Command` abstract class.
-
#initialize ⇒ Object
Restricts the relation by a corresponding request.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object (private)
37 38 39 40 |
# File 'lib/rom/cassandra/commands.rb', line 37 def method_missing(name, *args) updated_relation = relation.public_send(name, *args) self.class.new updated_relation, initial: nil end |
Class Method Details
.included(klass) ⇒ Object
12 13 14 15 |
# File 'lib/rom/cassandra/commands.rb', line 12 def self.included(klass) klass.__send__ :adapter, :cassandra klass.__send__ :option, :initial, default: true end |
Instance Method Details
#execute(command = self) ⇒ Array
Implements the execute method of the `ROM::Command` abstract class
31 32 33 |
# File 'lib/rom/cassandra/commands.rb', line 31 def execute(command = self) command.to_a end |
#initialize ⇒ Object
Restricts the relation by a corresponding request
19 20 21 22 |
# File 'lib/rom/cassandra/commands.rb', line 19 def initialize(*) super @relation = relation.public_send(restriction) if .fetch(:initial) end |


Email Hasher
This page makes no external HTTP requests at all, not to hash the emails, nor to load any kind of scripts. Feel free to view source to confirm. No data is stored in any way and no usage is tracked. This page will work offline as well.
The default method is: SHA256(LOWER(TRIM(email))). Rows are cased consistently and trailing spaces are removed before hashing.
Hashing Algorithm:
SHA-1
SHA-256 (most secure)
SHA-1
SHA-256 (most secure)
Casing:
Upper Case
Lower Case
Upper Case
Lower Case
Created by Yahel Carmon.
Source on Github


In this lab we will have an opportunity to build spatially structured population models for the first time. The simplest type of spatially structured population model is the classical metapopulation model. In this model, we have a landscape with a certain number of habitable patches. Patches are either occupied (coded as 1) or not (coded as 0). We are not keeping track of abundance (\(N\)) any more- we are just keeping track of whether each population is occupied or not, and how many total occupied populations we have in our metapopulation.
A metapopulation is best considered a population of populations. If a population is composed of individuals, a metapopulation is composed of populations!
colonization is the process of a population going from unoccupied to occupied!
How can a metapopulation become colonized? The answer is immigration of course. That part of the “BIDE” equation that we have been ignoring up until now!
extirpation (or extinction) is the process of a patch going from occupied to unoccupied.
regional extinction represents extinction of all patches in the metapopulation.
More formally, here are some terms we will consider:
\(I\) is the total fraction of patches that are colonized by immigrants per time period (colonization rate, or “immigration” rate)
\(E\) is the total fraction of patches that go extinct per time period (extirpation rate)
\(f_t\) is the fraction, or proportion, of patches that are occupied at time \(t\). This is also known as the occupancy rate
Therefore, the change in occupancy can be expressed as:
\(\Delta f = I - E \qquad \text{(Eq. 1)}\)
\(p_i\) is the probability of colonization for any given (unoccupied) patch.
\(p_e\) is the probability of extinction for any given (occupied) patch.
The more sites are available for colonization, the higher the rate of colonization!
\(I = p_i\cdot (1-f) \qquad \text{(Eq. 2)}\)
The more sites are occupied, the higher the rate of extinction!
\(E = p_e\cdot f \qquad \text{(Eq. 3)}\)
Combining equation 1 with the above equations, we get a metapopulation model:
\(\Delta f = p_i(1-f)-p_ef \qquad \text{(Eq. 4)}\)
This model assumes the following:
Colonization occurs via immigration from a constant external source – a constant propagule rain
This is the simplest metapopulation model. \(p_i\) and \(p_e\) are fixed, totally constant.
Now, colonization can only happen via immigration from within the metapopulation itself. So when few populations are colonized, colonization is low because of a lack of potential immigrants in the metapopultion.
\(p_i = if \qquad \text{(Eq. 5)}\)
\(i\) represents the strength of internal immigration (how much the probability of colonization increases with each new occupied patch in the metapopulation.
Now, the extinction rate can be reduced by immigration from other populations in the metapopulation!
\(p_e = e(1-f) \qquad \text{(Eq. 6)}\)
\(e\) represents the strength of the rescue effect.
This one is pretty self-explanatory!
The term metapopulation is often used to refer to models where we don’t care about abundance, we only care about occupancy- as in the model described above. However, a metapopulation is simply a population of populations. We can keep track of patch abundance in a metapopulation model. In fact, if we want, each patch can contain a stage-structured, density dependent population if we really want!
Just as we can use metapopulation models to study the probability of regional extinction, we can also study regional abundance and regional abundance trends.
HINT: use the Gotelli book!!!
1a. An endangered frog population of 100 frogs lives in a single pond. One proposal for conserving the frog population is to split it into three populations of 33 frogs, each in a separate pond. You know from your demographic studies that decreasing the frog population from 100 to 33 individuals will increase the annual risk of extinction from 10 to 50% In the short run, is it a better strategy to retain the single population or to split it into three? Show your calculations, and explain your reasoning!
1b. Consider the simplest (island-mainland) metapopulation model. Under what conditions is the occupancy rate \(f\) constant? Explain your reasoning.
1c. Build an InsightMaker model for the basic island-mainland metapopulation model. The total fraction of occupied populations \(f\) should be represented as a [Stock] (this stock can not go negative, nor can it go above 1!) and there should be two [Flows]: one for colonization and one for extinction. Initialize \(f\) at 0.9. The extinction and colonization probabilities (\(p_e\) and \(p_i\)) should be represented as [Variables]. Set \(p_e\) to 0.15 and \(p_i\) to 0.4. Provide a link to your InsightMaker model as part of your lab write-up.
1d. On the basis of your Insightmaker model, what happens to \(f\) over the course of the simulation? Does the metapopulation go extinct (regional extinction)? Does \(f\) reach an equilibrium? If so, is this equilibrium stable or unstable? Explain your reasoning.
1e. Compare your InsightMaker results (provide a plot) with the results from applying Equation 4.4 from Gotelli. Show your work. Do the two answers match?
1f. Change your InsightMaker model to reflect internal colonization. Set the parameter \(i\) to 0.1. Provide a link to your InsightMaker model as part of your lab write-up.
1g. Compare your InsightMaker results (provide a plot) with the results from applying Equation 4.6 from Gotelli. Show your work. Do the two answers match?
1h. Change your InsightMaker model to reflect the rescue effect. Restore the colonization model to represent “propagule rain”. Set the parameter \(e\) to 0.25. Provide a link to your InsightMaker model as part of your lab write-up.
1i. Compare your InsightMaker results (provide a plot) with the results from applying Equation 4.8 from Gotelli. Show your work. Do the two answers match?
1j. Change your InsightMaker model to reflect the rescue effect AND internal colonization. Set the parameter \(i\) to 0.1. Set the parameter \(e\) to 0.25. Provide a link to your InsightMaker model as part of your lab write-up.
1k. Is this model stable? explain your reasoning. Under what conditions do you get perfect 100% occupancy?
As we already know, agent-based models are well-suited for considering spatial context.
I have already prepared an agent-based metapopulation model for you. You can access and clone this model here.
Each population/patch in the metapopulation is represented by an “individual”, or “agent”. These individuals cannot move (they are patches of land, after all), but they can influence each other via immigration and emigration!
The landscape is 200 km by 200 km. Each simulation run, patches are initialized randomly in the landscape. The metapopulation size (total number of patches) is initialized at 10.
Each patch potentially contains a population of animals. If it has >= 2 individuals living in it, it is considered “occupied”.
Each patch has its own carrying capacity (K)- some patches have very low carrying capacity, and some have very high carrying capacity. The distribution of K among populations is approximately lognormal. This means that there are usually a few very large populations in the landscape. The minimum K is 2 (minimum to support an “occupied” population).
Abundance dynamics are density-dependent, and population growth is computed as a function of r_max, local carrying capacity, and previous-year local abundance using the Ricker growth model:
\(N_{t+1} = N_t e^{r_{max}(1-\frac{N_t}{K})}\)
This is one of the most commonly used models for discrete logistic population growth (very analogous to the logistic growth model we have already seen!).
Population growth in each patch is also driven by migration to and from nearby populations. A fixed proportion of each population disperses each year (dispersal rate, set to 25% initially), and the maximum dispersal distance is set initially at 50 kilometers. If no neighboring population exists within that distance, all dispersers perish.
There is, of course, demographic stochasticity in this model!
Graphical summaries are available, which illustrate the spatial configuration of the patches, the total metapopulation occupancy, the Total metapopulation abundance, and the total numbers of immigrants/emigrants.
Take some time to open the model (clone it!) and get familiar with the parameters and model behavior. If you don’t understand something, ask your instructor! Make sure you have the following starting parameters:
Metapopulation size: 10 patches r_max: 0.11 maxdist (maximum dispersal distance): 50 kilometers dispersal rate: 0.25
NOTE: there is one parameter (max dispersal distance, maxdist) you will need to pay attention to, but it is not represented by a value slider (I couldn’t get it to work that way, unfortunately). To alter the maximum dispersal distance, you need to open the equation editor for the [Immigrants] variable, and change the value in the top line, which should look something like this:
maxdist <- 60
2a. Use InsightMaker’s sensitivity testing tool to run the model 50 times. What is the approximate risk of regional extinction of this metapopulation? What is the abundance trend (that is, overall regional, or metapopulation, abundance) over time? What is the trend in occupancy over time? Provide plots to justify your answer.
2b. Change the dispersal rate to zero. Run a few simulations to examine the model behavior. Re-run the sensitivity testing tool to examine expected patterns in occupancy and abundance over time. How did the trend in abundance and occupancy change relative to the scenario with 25% dispersal? What about the probability of regional extinction? Justify your answer, including figures. Do these results match with your expectation of what would happen? Why or why not?
2c. Change the dispersal rate back to 25 % and change the number of patches to 25. Run a few simulations to examine the model behavior. Re-run the sensitivity testing tool (note that InsightMaker will run slower with more patches!) to examine expected patterns in occupancy and abundance over time. How did the trend in abundance and occupancy change relative to the scenario with 10 patches? What about the probability of regional extinction? Justify your answer, including figures. Do these results match with your expectation of what would happen? Why or why not?
2d. Change the metapopulation size back to 10 patches and change the maximum dispersal distance (maxdist) to 100 km (remember you need to open the equation editor for the [Immigrants] variable to do this). Run a few simulations to examine the model behavior. Re-run the sensitivity testing tool to examine expected patterns in occupancy and abundance over time. How did the trend in abundance and occupancy change relative to the scenario with a dispersal distance of 50 km? What about the probability of regional extinction? Justify your answer, including figures. Do these results match with your expectation of what would happen? Why or why not?
2e. Imagine that this metapopulation represents the last remaining patches of habitat for an endangered butterfly. You have identified three possible management strategies: You could:
Which management strategy would be most effective for ensuring that the metapopulation does not go exinct (prevent regional extinction)? Justify your answer with supporting figures.
2f. [thought question] Is it possible for \(r_{max}\) to be positive and yet for the total regional abundance to exhibit a persistent declining trend? Explain your reasoning, using at least one biologically realistic example. You can use the agent-based metapopulation model in InsightMaker to help test your ideas, but this is not required.
Please bundle all your responses into a single Word document and submit using WebCampus!
Where appropriate, URLs for your InsightMaker models should be pasted in your lab submission (MS Word document). See details below…
Due Mar. 31 at 11 am.


Before Change
// Check that masks obtained from same FOV are the same
img1 = Nifti1Image(np.full((9, 9, 9), np.random.rand()), np.eye(4))
img2 = Nifti1Image(np.full((9, 9, 9), np.random.rand()), np.eye(4))
mask_img1 = compute_brain_mask(img1)
mask_img2 = compute_brain_mask(img2)
After Change
// Check that masks obtained from same FOV are the same
rng = np.random.RandomState(42)
img1 = Nifti1Image(np.full((9, 9, 9), rng.uniform()), np.eye(4))
img2 = Nifti1Image(np.full((9, 9, 9), rng.uniform()), np.eye(4))
mask_img1 = compute_brain_mask(img1)


Send GST-ready invoices in minutes and ensure that your business is tax compliant.
Effortlessly track time for projects and invoice your customers accordingly.
Record all business expenses and know how much you're spending.


You pay
{{to_currency.from_currency.symbol}}
They receive
{{to_currency.to_currency.symbol}}
| Account name | {{getSelectedAccount().bank_name || 'Not provided'}} | |||
|---|---|---|---|---|
| Account number | {{getSelectedAccount().number || 'Not provided'}} | |||
| Account type | {{getSelectedAccount().type || 'Not provided'}} | |||
| Bank name | {{getSelectedAccount().bank_name || 'Not provided'}} | |||
| Bank code | {{getSelectedAccount().bank_code || 'Not provided'}} | |||
| Branch code | {{getSelectedAccount().branch_code || 'Not provided'}} | |||
| Swift | {{getSelectedAccount().swift || 'Not provided'}} | |||
| IBAN | {{getSelectedAccount().iban || 'Not provided'}} | |||
| BIC | {{getSelectedAccount().bic || 'Not provided'}} | |||
| Wire | {{getSelectedAccount().wire || 'Not provided'}} |
Add a new recipient
If you see this message, it means you've indicated that you've made the payment. Our team will first wait for the payment to clear successfully. After that we'll process the transfer and let you know when the payout has been completed.
You have to transfer exactly {{active_quote.from_currency.symbol}} {{active_quote.from_amount*(-1)/100}} to the bank details below.
| Your reference | {{companyBankData.reference}} |
| Bank name | {{companyBankData.bank_name}} |
| Holder name | {{companyBankData.name}} |
| Account number | {{companyBankData.number}} |
| Account type | {{companyBankData.type}} |
| Branch code | {{companyBankData.branch_code}} |
| Bank code | {{companyBankData.bank_code}} |
| IBAN | {{companyBankData.iban}} |
| BIC | {{companyBankData.bic}} |
| Swift code | {{companyBankData.swift}} |


|
IdTool
0.4.2
A tool for inspecting and manipulating SQRL identities.
|
Represents a single item/setting within an IdentityBlock
.
More...
Public Member Functions | |
| QByteArray | toByteArray () |
Static Public Member Functions | |
| static ItemDataType | findDataType (QString dataType) |
| static QStringList | getDataTypeList () |
Public Attributes | |
| QString | name = "" |
| QString | description = "" |
| ItemDataType | dataType = ItemDataType::UNDEFINED |
| int | nrOfBytes = 0 |
| QString | value = "" |
| int | repeatIndex = -1 |
| int | repeatCount = 1 |
Static Public Attributes | |
| static QMap< ItemDataType, ItemDataTypeInfo > | DataTypeMap |
Represents a single item/setting within an IdentityBlock
.
IdentityBlockItem
objects and only converted to their native types once needed.More information SQRL's storage format can be found at https://www.grc.com/sqrl/SQRL_Cryptography.pdf
|
static |
Searches the DataTypeMap
for an ItemDataType
with a name of dataType. If the ItemDataType
is found, it is being returned. If no such data type exists, ItemDataType::UNDEFINED
is returned.
|
static |
Returns a list of possible IdentityBlockItem
data types.
| QByteArray IdentityBlockItem::toByteArray | ( | ) |
Returns the raw binary representation of the IdentityBlockItem
.
|
static |


Main features
The main features of the Eclipse Embedded CDT family of plug-ins are:
- create/build/manage embedded Arm/AArch64/RISC-V applications, using the managed project features of Eclipse CDT, i.e. without having to manually create and maintain makefiles
- provide ready to run templates for some Arm Cortex-M microcontrollers
- provide debugging support via JTAG/SWD
- provide a special view to examine and modify peripheral registers during debug sessions
Other features of the cross build plug-in are:
- supports a wide range of 32 and 64-bit toolchains
- provides extra build steps to generate the binary files required to write the controller flash memory
- supports the automatic discovery of system paths and macro definitions for accurate indexing and auto-completion
- provides common options for all toolchains
- provides fully configurable toolchain definitions
- provides advanced toolchain path management
- improved project portability
- … and many more
Supported toolchains
The build plug-in supports most existing toolchains currently available for both 32 and 64-bit Arm and RISC-V processors.
Arm toolchains
- xPack GNU Arm Embedded GCC (arm-none-eabi-*)
- GNU Arm Embedded Toolchain (arm-none-eabi-*)
- Linaro ARMv7 bare-metal EABI (arm-none-eabi-*)
- Linaro ARMv7 big-endian bare-metal EABI (armeb-none-eabi-*)
- Linaro ARMv7 Linux GNU EABI HF (arm-linux-gnueabihf-*)
- Linaro ARMv7 big-endian Linux GNU EABI HF (armeb-linux-gnueabihf-*)
- Mentor Sourcery CodeBench Lite for ARM EABI (arm-none-eabi-*)
- Mentor Sourcery CodeBench Lite for ARM GNU/Linux (arm-none-linux-gnueabi-*)
- devkit ARM EABI (arm-eabi-*) (obsolete, no longer maintained)
- Yagarto, Summon, etc. ARM EABI (arm-none-eabi-*) (obsolete, no longer maintained)
AArch64 toolchains
- Linaro AArch64 bare-metal ELF (aarch64-none-elf-*)
- Linaro AArch64 big-endian bare-metal ELF (aarch64_be-none-elf-*)
- Linaro AArch64 Linux GNU (aarch64-linux-gnu-*)
- Linaro AArch64 big-endian Linux GNU (aarch64_be-linux-gnu-*)
Extra build steps
In addition to building the ELF file, the build plug-in can also create a binary file (ihex, srec, binary) to be programmed in the microcontroller flash memory.
Since resources are usually limited, the plug-in can also display the program size, and create a listing.
Discovery Options & Indexing
Frankly, this is mainly a CDT feature, but in order for it to work, the build plug-in must provide the CDT with various toolchain details, like compiler command (for example arm-none-eabi-gcc), compiler options and the right path to the toolchain binary.
To understand Discovery Options, you need to understand what
Indexing is. In order to allow Eclipse user to navigate to
definitions, to declarations, to allow smart completion, refactoring
and all these nice features, the CDT needs to have exactly the
same knowledge of the source files as the compiler. For this, it also
needs to know the system headers used at compile time and the default
preprocessor definitions issued by the compiler. GCC provides a magic
combination of command options to do this
(-E -P -v -dD ${plugin_state_location}/specs.c
), so the CDT needs
to issue the proper compiler commands (one for each language,
C & C++). The build plug-in provides these details, for each toolchain.
This feature also provides a quick check if you configured properly your environment: after creating a new project, you should see the special folder Includes in the root of your project, containing the paths of the system include files used by your compiler. If you don’t see this, you probably misconfigured the toolchain path.
Simplified multiple tools configurations
In addition to being tedious, setting options for each tool (C compiler, C++ compiler, linker) might also be a source of subtle errors when incompatible options are used for different tools.
To minimise the risk of such errors, and to make the plug-in easier to use, unlike in most other CDT compiler settings plug-ins, special configuration entries were defined at toolchain level instead of specific tools. Options enabled at this level are used for all tools, without exception.
Fully configurable toolchains
Toolchain definitions include most of the configurable details, not only the prefix and the path, allowing the use of almost any GNU compatible toolchain.
Advanced toolchain path management
The traditional way of accessing the toolchain components was to add the toolchain path to the system PATH and later do nothing special inside Eclipse. Unfortunately this model does not scale; serious development often requires multiple toolchains (either different versions of the same toolchain, or even toolchains from different sources) on the same machine, and polluting the system PATH is a source of major headaches.
The Eclipse Embedded CDT cross build plug-in provides advanced toolchain path management; for more details, please read the separate Toolchain path management page.
Improved project portability
Even more, for improved project portability, the toolchain path is stored in the workspace, in preference to the path stored in the project.
Project portability is essential for team collaboration, when multiple developers use different platform to develop a single project. Without project portability, after a Windows machine would commit the project to a central repository, macOS or GNU/Linux users would have to manually adjust the path in their projects after each update, and the other way around; for more details, please read the separate Project portability page.
Functional ready to run templates
For beginners, who need initial help to put all details together for their first project, a complete sample, with startup code, linker scripts, semi-hosting enabled and all necessary options already set, can be a major time saver.
The Hello World Arm Cortex-M3 C Project template was destined exactly for such cases; please see the Tutorial: Create a Blinky Arm test project for more details.
Even more, specific templates are available for the STM families of microcontrollers STM32F[01234]x, and for some Freescale KLxx microcontrollers. They create the classical application that blinks a LED, and, specific for the Debug configuration, prints a string on the tracing (SWV or semi-hosting) output.
Debugging support
During the lifetime of a project, creating/editing source files and building binaries are certainly important activities, but in many cases the most time is spent during debugging sessions, and a reliable debugging environment is an absolute must.
There are many debugging techniques and tools, but we recommend two solutions:
- the SEGGER J-Link probe with its integrated GDB server, via the J-Link plug-in
-
the OpenOCD GDB server for many other JTAG probes.
We also recommend the use of specific Arm debugging support, like tracing via the SWO output, with a second choice for semihosting output (both are supported by the J-Link plug-in).
The packages manager perspective
The Eclipse Embedded CDT plug-ins were the first open source tools to benefit from the new CMSIS Packs technology promoted by Arm.
Packages are a convenient way to distribute software components, hardware descriptions and documentation, in a structured way.
There are many packages available, mostly maintained by Keil, and in order to conveniently manage them a dedicated perspective was created, with filtering and outline capabilities.
Among other things, the packages metadata include a complete list of devices, grouped by vendor, family, sub-family, and a list of development boards. These extra data allow to easily associate additional properties (like device name) to projects, and later use these definition to automate other configurations, like debugging sessions.
Peripherals registers view in debug
One of the great features of CMSIS Packs is the availability of hardware descriptions for all Cortex-M devices, with details down to the register field level.
These descriptions can be used to assist the debugger in examining and modifying memory mapped peripheral registers.
Device and board documentation files
The CMSIS packs also provide lots of documentation files, like device data sheets, user manuals, references manuals, and also board related files, including schematics and other manuals.
The list of documentation files is shown in a separate view, located on the right of the Outline view. In case the Documents view is not visible, a Reset is needed for the C/C++ perspective (right click the perspective button and select Reset).
To open the individual documents, double click their names and specific viewers will open, generally outside Eclipse.
Comments on the content of this page that might be useful for other readers are welcomed here. For question and general support, please use the project forums.


{% extends 'base.html'%} {% import 'macros.html' as macro%} {%block content%} {%import 'bootstrap/wtf.html' as wtf%}