This project contains setup for Jenkins that creates jobs and pipelines via Jenkins Job DSL or Jenkinsfile for your projects. The pipelines and jobs use the scripts defined in Cloud Pipelines Scripts repo.
Introduction
This section describes how Jenkins works with Cloud Pipelines.
| You do not need to use all the pieces of Cloud Pipelines. You can (and should) gradually migrate your applications to use those pieces of Cloud Pipelines that you think best suit your needs. |
Five-second Introduction
Cloud Pipelines Jenkins provides setup for Jenkins that creates jobs and pipelines via Jenkins Job DSL or Jenkinsfile for your projects. The pipelines and jobs use the scripts defined in Cloud Pipelines Scripts repo.
Five-minute Introduction
In these sections you will learn how exactly Cloud Pipelines Jenkins integrates with Cloud Pipelines Scripts and how you can setup deployment pipelines for each project.
How to Use It
The suggested approach is to use the Project Crawler approach, where we scan your organization for projects and create deployment pipeline for each.
Another approach is to pass an environment variable with a list of repositories for which you would like the pipeline to be built.
How It Works
As the following image shows, Cloud Pipelines contains logic to generate a pipeline and the runtime to execute pipeline steps.
Once a pipeline is created (for example, by using Jenkins Job DSL), when the jobs are ran, they clone or download Cloud Pipelines
code to run each step. Those steps run functions that are
defined in the commons
module of Cloud Pipelines.
Cloud Pipelines performs steps to guess what kind of a project your repository is (e.g. JVM or PHP) and what framework it uses (Maven or Gradle), and it can deploy your application to a cloud (e.g. Cloud Foundry or Kubernetes)
Project Crawler
In Jenkins, you can generate the deployment pipelines by passing an environment variable with a comma-separated list of repositories. This, however, does not scale. We would like to automatically fetch a list of all repositories from a given organization and team.
To do so, we use the Project Crawler library, which can:
-
Fetch all projects for a given organization.
-
Fetch contents of a file for a given repository.
The following diagram depicts this situation:
Thanks to the Project Crawler, you can run the seed job, and ,automatically, all the new repositories are picked and pipelines are created for them. Project Crawler supports repositories stored at Github, Gitlab, and Bitbucket. You can also register your own implementation. See the Project Crawler repository for more information.
How Scripts Work with Spinnaker
With Spinnaker, the deployment pipeline is inside of Spinnaker. No longer do we treat Jenkins as a tool that does deployments. In Jenkins, we create only the CI jobs (that is, build and test) and prepare the JSON definitions of Spinnaker pipelines.
The following diagram shows how Jenkins, the seed job for Spinnaker, and Spinnaker cooperate:
Customizing the Project
Cloud Pipelines offers a way to override the way pipelines are built
Overriding Project Setup
If you want to customize the Cloud Pipelines build, you can update the contents
of the gradle/custom.gradle
build script. That way your customizations will not
interfere with the changes in the main part of the code, thus there should be
no merge conflicts when pulling the changes from Cloud Pipeline repositories.
Overriding Pipelines
Currently, the best way to extend Jenkins Jenkinsfile pipelines is to make a copy of the Jenkins seed and pipeline jobs.
Overriding Jenkins Job DSL pipelines
We provide an interface (called io.cloudpipelines.common.JobCustomizer
)
that lets you provide customization for:
-
all jobs
-
build jobs
-
test jobs
-
stage jobs
-
prod jobs
We use the JDK’s java.util.ServiceLoader
mechanism to achieve extensibility.
You can write an implementation of that interface (for example, com.example.MyJubCustomizer
)
and create a META-INF/io.cloudpipelines.common.JobCustomizer
file in which you put the
com.example.MyJubCustomizer
line.
If you create a JAR with your class (for example com.example:my-customizer:1.0.0
),
put it on the build classpath, as the following example shows:
dependencies {
// ...
libs "com.example:my-customizer:1.0.0"
// ...
}
If you do not want to create a separate library, you can create an implementation in the
sources under src/main/resources/META-INF
.
Regardless of what you chose, your implementation runs for each job. You can add notifications or any other customizations of your choosing.
Jenkins Pipeline (Common)
In this section we will present the common setup of Jenkins for any platform. We will also provide answers to most frequently asked questions.
Project setup
In the declarative-pipeline
you can find a definition of a declarative
pipeline. It’s used together with the Blueocean UI.
Under job-dsl
folder you’ll find all job-dsl
related setup. In its jobs
subfolder
you have all the seed jobs that will generate pipelines. You can read
comments inside each script to understand what it’s doing.
Under demo
folder you can find the setup prepared for demo purposes.
In its seed
subfolder folder you have the init.groovy
file which is executed when Jenkins starts.
 Under the k8s
folder there are all the configuration
files required for deployment to a Kubernetes cluster.
Optional customization steps
All the steps below are not necessary to run the demo. They are needed only when you want to do some custom changes.
Setup settings.xml for Maven deployment
| If you want to use the default connection to the Docker version of Artifactory you can skip this step |
So that ./mvnw deploy
works with Artifactory from Docker we’re
already copying the missing settings.xml
file for you. It looks more or less like this:
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<servers>
<server>
<id>${M2_SETTINGS_REPO_ID}</id>
<username>${M2_SETTINGS_REPO_USERNAME}</username>
<password>${M2_SETTINGS_REPO_PASSWORD}</password>
</server>
<server>
<id>${DOCKER_SERVER_ID}</id>
<username>${DOCKER_USERNAME}</username>
<password>${DOCKER_PASSWORD}</password>
<configuration>
<email>${DOCKER_EMAIL}</email>
</configuration>
</server>
</servers>
</settings>
As you can see the file is parameterized. In Maven it’s enough to pass
to ./mvnw
command the proper system property to override that value. For example to pass
a different docker email you’d have to call ./mvnw<EMAIL_ADDRESS>and the value
gets updated.
If you want to use your own version of Artifactory / Nexus you have to update
the file (it’s in seed/settings.xml
).
Setup Jenkins env vars
If you want to only play around with the demo that we’ve prepared you have to set ONE variable which is the REPOS
variable.
That variable needs to consists of comma separated list of URLs to repositories containing business apps. So you should pass your forked repos URLs.
You can do it in the following ways:
-
globally via Jenkins global env vars (then when you run the seed that variable will be taken into consideration and proper pipelines will get built)
-
modify the seed job parameters (you’ll have to modify the seed job configuration and change the
REPOS
property) -
provide the repos parameter when running the seed job
For the sake of simplicity let’s go with the last option.
If you’re choosing the global envs, you HAVE to remove the other approach
(e.g. if you set the global env for REPOS , please remove that property in the
seed job
|
If you’re using the Project Crawler based solution, you can also provide your own implementation to customize the created jobs.
Seed properties
Click on the seed job and pick Build with parameters
. Then as presented in the screen below (you’ll have far more properties to set) just modify the REPOS
property by providing the comma separated list of URLs to your forks. Whatever you set will be parsed by the seed job and passed to the generated Jenkins jobs.
This is very useful when the repos you want to build differ. E.g. use
different JDK. Then some seeds can set the JDK_VERSION param to one version
of Java installation and the others to another one.
|
Example screen:
In the screenshot we could parametrize the REPOS
and REPO_WITH_BINARIES
params.
Global envs
| This section is presented only for informational purposes - for the sake of demo you can skip it |
You can add env vars (go to configure Jenkins → Global Properties) for the following properties (example with defaults for PCF Dev):
Example screen:
Set Git email / user
Since our pipeline is setting the git user / name explicitly for the build step
you’d have to go to Configure
of the build step and modify the Git name / email.
If you want to set it globally you’ll have to remove the section from the build
step and follow these steps to set it globally.
You can set Git email / user globally like this:
Add Jenkins credentials for GitHub
You have to set credentials with id: git
.
Below you can find instructions on how to set a credential (e.g. for Cloud Foundry cf-test
credential but
remember to provide the one with id git
).
git
credential ID (in this example cf-test
)
Testing Jenkins scripts
To run the tests against your bash and Groovy scripts just call
./gradlew clean build
How to work with Jenkins Job DSL plugin
Check out the tutorial. Provide the link to this repository in your Jenkins installation.
Docker Image
If you would like to run the pre-configured Jenkins image somewhere other than your local machine, we
have an image you can pull and use on DockerHub.
The latest
tag corresponds to the latest snapshot build. You can also find tags
corresponding to stable releases that you can use as well.
The Jenkins docker image is setup for demo purposes. For example it has the following
system property -Dpermissive-script-security.enabled=no_security that disables script
security. YOU SHOULD NOT USE IT ON PRODUCTION UNLESS YOU KNOW WHAT YOU’RE DOING.
|
All Environment Variables
Below you can find a table with all environment variables
| Environment variable name | Description |
|---|---|
|
ID of credentials used for GIT interaction |
|
ID of credentials used for GIT interaction via ssh |
|
if set to |
|
Username used for GIT integration |
|
Password used for GIT integration |
|
Token used for GIT integration |
|
Email used for GIT integration |
|
Name used for GIT integration |
|
Name of the used JDK installation |
|
Folder to which the app will output files |
|
Should API compatibility step be there? Defaults to |
|
Should DB rollback step be there? Defaults to |
|
Should test steps be there? Defaults to |
|
Should stage steps be there? Defaults to |
|
Should deploy to stage automatically? Defaults to |
|
Should deploy to prod automatically? Defaults to |
|
Project name that should override the default one (which is the one taken from the build) |
|
Type of the project. Depends on the used framework. Can be e.g. Maven, Gradle etc. Depending on the value of this env variable a proper {@code projectType/pipeline-$PROJECT_TYPE.sh } script will be sourced |
|
Type of the used PAAS. Can be e.g. CF, K8S, etc. Depending on the value of this env variable a proper {@code pipeline-$PAAS_TYPE.sh } script will be sourced |
|
URL of the repository containing scripts to be used within the build. Defaults to the tar.gz package of the master branch of the Cloud Pipelines repo. You can provide URL to either tar.gz or .git repository. |
|
Branch of the repository containing scripts to be used within the build. Defaults to |
|
URL of the repository containing scripts to be used within the build. Defaults to the tar.gz package of the master branch of the Cloud Pipelines repo. You can provide URL to either tar.gz or .git repository. |
|
Branch of the repository containing scripts to be used within the build. Defaults to |
|
id of the credentials that will be put to |
|
username put inside |
|
password put inside |
|
id of the credentials that will be passed to your build if you need to upload artifacts to a binary storage |
|
URL of the repo that contains binaries |
|
URL for uploading of the repo that contains binaries. Often points to the |
|
name of the pipeline descriptor. Defaults to {@code cloud-pipelines.yml} |
|
name of the legacy pipeline descriptor. Defaults to {@code sc-pipelines.yml}. Will be used as a fallback if the |
|
env var containing the version of the pipeline |
|
env var containing the Jenkins workspace path |
|
used for tests - descriptor to be returned for test purposes |
|
used in integration tests. URL of the deployed application |
|
used in integration tests. URL of the deployed Stub Runner application |
|
used in rollback tests deployment and tests. Latest production version of the application. |
|
used in rollback tests deployment and tests. Latest production tag of the application. |
|
used in rollback tests deployment and tests. Latest production tag of the application. Certain CI tools (e.g. Concourse) add the PASSED_ prefix before the env var. |
|
organization / team to crawl by project crawler |
|
type of repo management used. Can be GITHUB, GITLAB, BITBUCKET or OTHER |
|
URL of the API to reach to crawl the organization |
|
Pattern of projects to exclude |
|
URL of the test environment |
|
URL of the stage environment |
|
URL of the prod environment |
|
ID of credentials used to connect to test env |
|
Username used to connect to test env |
|
Password used to connect to test env |
|
Username used to connect to stage env |
|
Password used to connect to stage env |
|
ID of credentials used to connect to prod env |
|
ID of credentials used to connect to stage env |
|
Username used to connect to prod env |
|
Password used to connect to prod env |
|
Organization used for the test environment |
|
Prefix prepended to the application name. Together forms a unique name of a test space. |
|
Organization used for the stage environment |
|
Space used for the stage environment |
|
Organization used for the prod environment |
|
Space used for the prod environment |
|
Hostname prepended to the route. When the name of the app is already taken, the route typically is also used. That’s why you can use this env var to prepend additional value to the hostname |
|
defaults to true, forces to redownload CLI regardless of whether it’s already downloaded or not |
|
URL from which CF should be downloaded |
|
if true, will not connect to CF to fetch info about app host |
|
URL of the docker registry |
|
Organization where your Docker repo lays |
|
ID of credentials used to push Docker images |
|
Username used to push Docker images |
|
Password used to push Docker images |
|
In |
|
Email used for Docker repository interaction |
|
Path to the test CA in the container |
|
Path to the stage CA in the container |
|
Path to the prod CA in the container |
|
Path to the client certificate for test environment |
|
Path to the client certificate for stage environment |
|
Path to the client certificate for prod environment |
|
Path to the client key for test environment |
|
Path to the client key for stage environment |
|
Path to the client key for prod environment |
|
Token used to login to PAAS |
|
Path to the file containing the token for test env |
|
Path to the file containing the token for stage env |
|
Path to the file containing the token for prod env |
|
ID of the token used to connect to test environment |
|
ID of the token used to connect to stage environment |
|
ID of the token used to connect to prod environment |
|
Name of the cluster for test env |
|
Name of the cluster for stage env |
|
Name of the cluster for prod env |
|
Name of the user to connect to test environment |
|
Name of the user to connect to stage environment |
|
Name of the user to connect to prod environment |
|
Name of the system for test env |
|
Name of the system for stage env |
|
Name of the system for prod env |
|
Namespace used for the test env |
|
Namespace used for the stage env |
|
Namespace used for the prod env |
|
set to |
|
ID of the MYSQL ROOT user credentials |
|
Username of the MYSQL user |
|
ID of the MYSQL user credentials |
|
Username of the MYSQL user |
|
Account used for deployment to test env |
|
Account used for deployment to stage env |
|
Account used for deployment to prod env |
|
name of the Jenkins host used by Spinnaker |
|
name of the Jenkins account used by Spinnaker |
|
name of the Jenkins master installation |
|
the hostname appended to the routes for test envs |
|
the hostname appended to the routes for test envs |
|
the hostname appended to the routes for test envs |
Jenkins Pipeline (Cloud Foundry)
| In this chapter, we assume that you deploy your Java application to Cloud Foundry PaaS. The chosen language is just an example, you could perform similar tasks with another language. |
The Cloud Pipelines repository contains job definitions and the opinionated setup pipeline, which uses the Jenkins Job DSL plugin. Those jobs form an empty pipeline and a opinionated sample pipeline that you can use in your company.
The following projects take part in the microservice setup
for this demo.
-
Github Analytics: The app that has a REST endpoint and uses messaging — part off our business application.
-
Github Webhook: Project that emits messages that are used by Github Analytics — part of our business application.
-
Eureka: Simple Eureka Server. This is an infrastructure application.
-
Github Analytics Stub Runner Boot: Stub Runner Boot server to be used for tests with Github Analytics and using Eureka and Messaging. This is an infrastructure application.
Step-by-step
This is a guide for the Jenkins Job DSL based pipeline.
If you want only to run the demo as far as possible using PCF Dev and Docker Compose, do the following:
Fork Repositories
Four applications compose the pipeline:
You need to fork only the following, because only then can you tag and push the tag to your repository:
Start Jenkins and Artifactory
Jenkins + Artifactory can be ran locally. To do so, run the
start.sh
script from this repository. The following listing shows the script:
git clone https://github.com/CloudPipelines/jenkins
cd jenkins/demo
./start.sh yourGitUsername yourGitPassword yourForkedGithubOrg
Then Jenkins runs on port 8080
, and Artifactory runs on port 8081
.
The parameters are passed as environment variables to the Jenkins VM,
and credentials are set. That way, you need not do
any manual work on the Jenkins side. In the above parameters, the third parameter
could be yourForkedGithubOrg
or yourGithubUsername
. Also the REPOS
environment variable
contains your GitHub org (in which you have the forked repos).
Instead of the Git username and password parameters, you could pass -key <path_to_private_key>
(if you prefer to use key-based authentication with your Git repositories).
Deploy the Infra JARs to Artifactory
When Artifactory is running, run the tools/deploy-infra.sh
script from this repo. The following listing shows the script:
git clone https://github.com/CloudPipelines/jenkins
cd jenkins/
./tools/deploy-infra.sh
As a result, both the eureka
and stub runner
repositories are cloned, built,
and uploaded to Artifactory.
Start PCF Dev
| You can skip this step if you have CF installed and do not want to use PCF Dev. In that case, the only thing you have to do is to set up spaces. |
| Servers often run run out of resources at the stage step. If that happens clear some apps from PCF Dev and continue. |
You have to download and start PCF Dev, as described here.
The default credentials when using PCF Dev are as follows:
username: user
password: pass
email: user
org: pcfdev-org
space: pcfdev-space
api: api.local.pcfdev.io
You can start PCF Dev as follows:
cf dev start
You must create three separate spaces, as follows:
cf login -a https://api.local.pcfdev.io --skip-ssl-validation -u admin -p admin -o pcfdev-org
cf create-space pcfdev-test
cf set-space-role user pcfdev-org pcfdev-test SpaceDeveloper
cf create-space pcfdev-stage
cf set-space-role user pcfdev-org pcfdev-stage SpaceDeveloper
cf create-space pcfdev-prod
cf set-space-role user pcfdev-org pcfdev-prod SpaceDeveloper
You can also run the ./tools/cf-helper.sh setup-spaces
script to do this.
Run the Seed Job
We created the seed job for you, but you have to run it. When you do run it, you have to provide some properties. By default we create a seed that has all the properties options, but you can delete most of it. If you set the properties as global environment variables, you have to remove them from the seed.
To run the demo, provide a comma-separated
list of the URLs of the two aforementioned forks (github-webhook
and github-analytics') in the `REPOS
variable.
The following images shows the steps involved:
jenkins-pipeline-seed-k8s
for Kubernetes
REPOS
parameter should already contain your forked repos (you’ll have more properties than the ones in the screenshot)
Run the github-webhook
Pipeline
We already created the seed job for you, but you have to run it. When you do run it, you have to provide some properties. By default, we create a seed that has all the properties options, but you can delete most of it. If you set the properties as global environment variables, you have to remove them from the seed.
To run the demo, provide a comma-separated
list of URLs of the two aforementioned forks (github-webhook
and github-analytics
) in the REPOS
variable.
The following images shows the steps involved:
| If your build fails on deploy previous version to stage due to a missing jar, that means that you forgot to clear the tags in your repository. Typically, that happens because you removed the Artifactory volume with a deployed jar while a tag in the repository still points there. See here for how to remove the tag. |
| Servers often run run out of resources at the stage step. For that reason, we suggest killing all applications on test. See the FAQ for more detail. |
Declarative Pipeline & Blue Ocean
You can also use the declarative pipeline approach with the Blue Ocean UI.
The Blue Ocean UI is available under the blue/
URL (for example, for Docker Machine-based setup: https://<IP_ADDRESS>:8080/blue
).
The following images show the various steps involved:
github-webhook-declarative-pipeline
Run
button
run
Proceed
| There is no possibility of restarting a pipeline from a specific stage after failure. See this issue for more information |
| Currently, there is no way to introduce manual steps in a performant way. Jenkins blocks an executor when a manual step is required. That means that you run out of executors pretty quickly. See this issue and this StackOverflow question for more information. |
Jenkins Cloud Foundry Customization
You can customize Jenkins for Cloud Foundry by setting a variety of environment variables.
| You need not see all the environment variables described in this section to run the demo. They are needed only when you want to make custom changes. |
Environment Variable Summary
The environment variables that are used in all of the jobs are as follows:
| Property Name | Property Description | Default value |
|---|---|---|
|
The URL to the CF API for the TEST environment |
|
|
The URL to the CF API for the STAGE environment |
|
|
The URL to the CF API for the PROD environment |
|
|
Name of the org for the test env |
|
|
Prefix of the name of the CF space for the test environment to which the app name is appended |
|
|
Name of the org for the stage environment |
|
|
Name of the space for the stage environment |
|
|
Name of the org for the prod environment |
|
|
Name of the space for the prod environment |
|
|
URL of the repository with the deployed jars |
|
|
The ID of server from Maven |
|
|
The name of the JDK installation |
|
|
The version of the pipeline (ultimately, also the version of the jar) |
|
|
The email used by Git to tag the repository |
|
|
The name used by Git to tag the repository |
|
|
Additional suffix for the route. In a shared environment, the default routes can be already taken |
|
|
Whether deployment to stage be automatic |
|
|
Whether deployment to prod be automatic |
|
|
Whether the API compatibility step is required |
|
|
Whether the DB rollback step is present |
|
|
Whether to the deploy-to-stage step be present |
|
|
Additional options you would like to pass to the Maven / Gradle build |
|
|
Extension of the binary uploaded to Artifactory / Nexus. Example: |
|
Jenkins Credentials
Our scripts reference the credentials by IDs. The following table describes the defaults for the credentials:
| Property Name | Property Description | Default value |
|---|---|---|
|
Credential ID used to tag a Git repo |
|
|
SSH credential ID used to tag a Git repo |
|
|
If |
|
|
Credential ID used for the repository with jars |
|
|
Credential ID for CF Test environment access |
|
|
Credential ID for CF Stage environment access |
|
|
Credential ID for CF Prod environment access |
|
If you already have in your system a credential to (for example) tag a repository,
you can use it by passing the value of the GIT_CREDENTIAL_ID
property.
See the cf-helper script for all the configuration options.
|
Jenkins Pipeline (Kubernetes)
| In this chapter, we assume that you deploy your application to Kubernetes PaaS. |
The Cloud Pipelines repository contains job definitions and the opinionated setup pipeline that uses Jenkins Job DSL plugin. Those jobs form an empty pipeline and an opinionated sample pipeline that you can use in your company.
The following projects take part in the microservice setup
for this demo.
-
Github Analytics: The app that has a REST endpoint and uses messaging — part of our business application.
-
Github Webhook: Project that emits messages that are used by Github Analytics — part of our business application.
-
Eureka: Simple Eureka Server. This is an infrastructure application.
-
Github Analytics Stub Runner Boot: Stub Runner Boot server to be used for tests with Github Analytics ad uses Eureka and Messaging. This is an infrastructure application.
Step-by-step
This is a guide for a Jenkins Job DSL based pipeline.
If you want only to run the demo as far as possible by using PCF Dev and Docker Compose, do the following:
Fork Repositories
Four applications compose the pipeline
You need to fork only the following repositories, because only then can you tag and push the tag to your repository:
Start Jenkins and Artifactory
Jenkins and Artifactory can be ran locally. To do so, run the
start.sh
script from this repo. The following listing shows the script:
git clone https://github.com/CloudPipelines/jenkins
cd jenkins/demo
./start.sh yourGitUsername yourGitPassword yourForkedGithubOrg yourDockerRegistryOrganization yourDockerRegistryUsername yourDockerRegistryPassword yourDockerRegistryEmail
Then Jenkins runs on port 8080
, and Artifactory runs on port 8081
.
The provided parameters are passed as environment variables to the Jenkins VM
and credentials are set. That way, you need not do
any manual work on the Jenkins side. In the preceding script, the third parameter
could be yourForkedGithubOrg
or yourGithubUsername
.
Instead of the Git username and password parameters, you could pass -key <path_to_private_key>
if you prefer to use the key-based authentication with your Git repositories.
You need to pass the credentials for the Docker organization (by default, we search for the Docker images at Docker Hub) so that the pipeline can push images to your org.
Deploy the Infra JARs to Artifactory
When Artifactory is running, run the tools/deploy-infra.sh
script from this repo.
The following listing shows the script:
git clone https://github.com/CloudPipelines/jenkins
cd jenkins
./tools/deploy-infra-k8s.sh
As a result, both the eureka
and stub runner
repos are cloned, built, and
uploaded to Artifactory and their docker images are built.
| Your local Docker process is reused by the Jenkins instance running in Docker. That is why you do not have to push these images to Docker Hub. On the other hand, if you run this sample in a remote Kubernetes cluster, the driver is not shared by the Jenkins workers, so you can consider pushing these Docker images to Docker Hub too. |
Run the seed job
We created the seed job for you, but you have to run it. When you do run it, you have to provide some properties. By default we create a seed that has all the properties options, but you can delete most of it. If you set the properties as global environment variables, you have to remove them from the seed.
To run the demo, provide a comma-separated
list of the URLs of the two aforementioned forks (github-webhook
and github-analytics') in the `REPOS
variable.
The following images shows the steps involved:
jenkins-pipeline-seed-k8s
for Kubernetes
REPOS
parameter should already contain your forked repos (you’ll have more properties than the ones in the screenshot)
Run the github-webhook
pipeline
We already created the seed job for you, but you have to run it. When you do run it, you have to provide some properties. By default, we create a seed that has all the properties options, but you can delete most of it. If you set the properties as global environment variables, you have to remove them from the seed.
To run the demo, provide a comma-separated
list of URLs of the two aforementioned forks (github-webhook
and github-analytics
) in the REPOS
variable.
The following images shows the steps involved:
| If your build fails on deploy previous version to stage due to a missing jar, that means that you forgot to clear the tags in your repository. Typically, that happens because you removed the Artifactory volume with a deployed jar while a tag in the repository still points there. See here for how to remove the tag. |
| Servers often run run out of resources at the stage step. For that reason, we suggest killing all applications on test. See the FAQ for more detail. |
Declarative pipeline & Blue Ocean
You can also use the declarative pipeline approach with the Blue Ocean UI.
The Blue Ocean UI is available under the blue/
URL (for example, for Docker Machine-based setup: https://<IP_ADDRESS>:8080/blue
).
The following images show the various steps involved:
github-webhook-declarative-pipeline
Run
button
run
Proceed
| There is no possibility of restarting a pipeline from a specific stage after failure. See this issue for more information |
| Currently, there is no way to introduce manual steps in a performant way. Jenkins blocks an executor when a manual step is required. That means that you run out of executors pretty quickly. See this issue and this StackOverflow question for more information. |
Jenkins Kubernetes customization
You can customize Jenkins for Cloud Foundry by setting a variety of environment variables.
| You need not see all the environment variables described in this section to run the demo. They are needed only when you want to make custom changes. |
All env vars
The environment variables that are used in all of the jobs are as follows:
| Property Name | Property Description | Default value |
|---|---|---|
|
Name of the docker organization to which Docker images should be deployed |
|
|
Credential ID used to push Docker images |
|
|
Server ID in |
|
|
Email used to connect to Docker registry and Maven builds |
|
|
URL of the Kubernetes cluster for the test environment |
|
|
URL of the docker registry |
|
|
URL of the API of the Kubernetes cluster for the test environment |
|
|
URL of the API of the Kubernetes cluster for the stage environment |
|
|
URL of the API of the Kubernetes cluster for the prod environment |
|
|
Path to the certificate authority for test the environment |
|
|
Path to the certificate authority for stage the environment |
|
|
Path to the certificate authority for the prod environment |
|
|
Path to the client certificate for the test environment |
|
|
Path to the client certificate for the stage environment |
|
|
Path to the client certificate for the prod environment |
|
|
Path to the client key for the test environment |
|
|
Path to the client key for the stage environment |
|
|
Path to the client key for the test environment |
|
|
Path to the file containing the token for the test environment |
|
|
Path to the file containing the token for the stage environment |
|
|
Path to the file containing the token for the prod environment |
|
|
ID of the credential containing access token for test environment |
|
|
ID of the credential containing access token for the stage environment |
|
|
ID of the credential containing access token for the prod environment |
|
|
Name of the cluster for the test environment |
|
|
Name of the cluster for the stage environment |
|
|
Name of the cluster for the prod environment |
|
|
Name of the user for the test environment |
|
|
Name of the user for the stage environment |
|
|
Name of the user for the prod environment |
|
|
Name of the system for the test environment |
|
|
Name of the system for the stage environment |
|
|
Name of the system for the prod environment |
|
|
Namespace for the test environment |
|
|
Namespace for the stage environment |
|
|
Namespace for the prod environment |
|
|
Whether to connect to Minikube |
|
|
URL of the repository with the deployed jars |
|
|
Credential ID used for the repository with jars |
|
|
The ID of server from Maven |
|
|
The name of the JDK installation |
|
|
The version of the pipeline (ultimately, also the version of the jar) |
|
|
The email used by Git to tag the repository |
|
|
The name used by Git to tag the repository |
|
|
Whether deployment to stage be automatic |
|
|
Whether deployment to prod be automatic |
|
|
Whether the API compatibility step is required |
|
|
Whether the DB rollback step is present |
|
|
Whether the deploy-to-stage step is present |
|
|
Additional options you would like to pass to the Maven / Gradle build |
Preparing to Connect to GCE
| Skip this step if you do not use GCE |
In order to use GCE, we need to have gcloud
running. If you already have the
CLI installed, skip this step. If not run the following command to have the CLI
downloaded and an installer started:
$ ./tools/k8s-helper.sh download-gcloud
Next, configure gcloud
. Run gcloud init
and log in
to your cluster. You are redirected to a login page. Pick the
proper Google account and log in.
Pick an existing project or create a new one.
Go to your platform page (click on Container Engine
) in GCP and connect to your cluster with the following values:
$ CLUSTER_NAME=...
$ ZONE=us-east1-b
$ PROJECT_NAME=...
$ gcloud container clusters get-credentials ${CLUSTER_NAME} --zone ${ZONE} --project ${PROJECT_NAME}
$ kubectl proxy
The Kubernetes dashboard runs at http://localhost:8001/ui/
.
We need a Persistent Disk for our Jenkins installation. Create it as follows:
$ ZONE=us-east1-b
$ gcloud compute disks create --size=200GB --zone=${ZONE} cloudpipelines-jenkins-disk
Once the disk has been created, you need to format it. See the instructions at https://cloud.google.com/compute/docs/disks/add-persistent-disk#formatting
Connecting to a Kubo or GCE Cluster
| Skip this step if you do not use Kubo or GCE |
This section describes how to deploy Jenkins and Artifactory to a Kubernetes cluster deployed with Kubo.
To see the dashboard, run kubectl proxy and access localhost:8081/ui .
|
-
Log in to the cluster.
-
Deploy Jenkins and Artifactory to the cluster:
-
./tools/k8s-helper.sh setup-tools-infra-vsphere
for a cluster deployed on VSphere -
./tools/k8s-helper.sh setup-tools-infra-gce
for a cluster deployed to GCE
-
-
Forward the ports so that you can access the Jenkins UI from your local machine, by using the following settings
$ NAMESPACE=default
$ JENKINS_POD=jenkins-1430785859-nfhx4
$ LOCAL_PORT=32044
$ CONTAINER_PORT=8080
$ kubectl port-forward --namespace=${NAMESPACE} ${JENKINS_POD} ${LOCAL_PORT}:${CONTAINER_PORT}
----
-
Go to
Credentials
, clickSystem
andGlobal credentials
, as the following image shows: -
Update
git
,repo-with-binaries
anddocker-registry
credentials -
Run the
jenkins-pipeline-k8s-seed
seed job and fill it out with the following data -
Put
kubernetes.default:443
here (orKUBERNETES_API:KUBERNETES_PORT
)-
PAAS_TEST_API_URL
-
PAAS_STAGE_API_URL
-
PAAS_PROD_API_URL
-
-
Put
/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
data here:-
PAAS_TEST_CA_PATH
-
PAAS_STAGE_CA_PATH
-
PAAS_PROD_CA_PATH
-
-
Uncheck the
Kubernetes Minikube
value.-
Clear the following variables:
-
PAAS_TEST_CLIENT_CERT_PATH
-
PAAS_STAGE_CLIENT_CERT_PATH
-
PAAS_PROD_CLIENT_CERT_PATH
-
PAAS_TEST_CLIENT_KEY_PATH
-
PAAS_STAGE_CLIENT_KEY_PATH
-
PAAS_PROD_CLIENT_KEY_PATH
-
-
-
Set
/var/run/secrets/kubernetes.io/serviceaccount/token
value to these variables:-
PAAS_TEST_CLIENT_TOKEN_PATH
-
PAAS_STAGE_CLIENT_TOKEN_PATH
-
PAAS_STAGE_CLIENT_TOKEN_PATH
-
Set the cluster name to these variables (you can get the cluster name by calling
kubectl config current-context
):
-
-
PAAS_TEST_CLUSTER_NAME
-
PAAS_STAGE_CLUSTER_NAME
-
PAAS_PROD_CLUSTER_NAME
-
-
Set the system name to these variables (you can get the system name by calling
kubectl config current-context
):-
PAAS_TEST_SYSTEM_NAME
-
PAAS_STAGE_SYSTEM_NAME
-
PAAS_PROD_SYSTEM_NAME
-
-
Update the
DOCKER_EMAIL
property with your email address. -
Update the
DOCKER_REGISTRY_ORGANIZATION
with your Docker organization name. -
If you do not want to upload the images to DockerHub, update
DOCKER_REGISTRY_URL
. -
Run the pipeline
Setup examples
You can go to setup subpage to read more about different setup scenarios.
Building the Project
This section covers how to build the project. It covers:
Project Setup
The declarative-pipeline
folder contains all logic related to the Declarative Pipeline based
approach of deploying software.
Under demo
folder you can find the setup prepared to start a demo instance of Jenkins and Artifactory.
In docs
you can find HTML documentation built from contents of docs-sources
.
The job-dsl
folder contains all logic related to the Jenkins Job DSL based
approach of deploying software.
The tools
folder contains tools required for building and that ease the work
with demo setup.
Prerequisites
As prerequisites, you need to have shellcheck,
bats, jq
and ruby installed. If you use a Linux
machine, bats
and shellcheck
are installed for you.
To install the required software on Linux, type the following command:
$ sudo apt-get install -y ruby jq
If you use a Mac, run the following commands to install the missing software:
$ brew install jq
$ brew install ruby
$ brew install bats
$ brew install shellcheck
Bats Submodules
To make bats
work properly, we needed to attach Git submodules. To have them
initialized, either clone the project or (if you have already cloned the project)
pull to update it. The following command clones the project:
$ git clone --recursive https://github.com/CloudPipelines/jenkins.git
The following commands pull the project:
$ git submodule init
$ git submodule update
If you forget about this step, Gradle runs these steps for you.
Build and test
Once you have installed all the prerequisites, you can run the following command to build and test the project:
$ ./gradlew clean build
Generate Documentation
To generate the documentation, run the following command:
$ ./gradlew generateDocs
Releasing the Project
This section covers how to release the project by publishing a Docker image.
Publishing A Docker Image
Gradle is fully setup to build and release the project. Just pass the -PreleaseDocker
property to the build to also upload the Docker images.
$ ./gradlew clean build -PreleaseDocker
You need to setup the environment variables / system properties / build properties
-
DOCKER_REGISTRY_URL
- defaults tohttps://index.docker.io/v1/
-
DOCKER_HUB_USERNAME
- defaults tochangeme
-
DOCKER_HUB_PASSWORD
- defaults tochangeme
-
DOCKER_HUB_EMAIL
- defaults<EMAIL_ADDRESS>CI Server Worker Prerequisites
Cloud Pipelines uses Bash scripts extensively. The following list shows the software that needs to be installed on a CI server worker for the build to pass:
apt-get -y install \
bash \
git \
tar \
zip \
curl \
ruby \
wget \
unzip \
python \
jq
| In the demo setup all of these libraries are already installed. |
Jenkins FAQ
This section provides answers to the most frequently asked questions about using Jenkins with Cloud Pipelines.
- Pipeline version contains ${PIPELINE_VERSION}
-
You can check the Jenkins logs and see the following warning:
WARNING: Skipped parameter `PIPELINE_VERSION` as it is undefined on `jenkins-pipeline-sample-build`. Set `-Dhudson.model.ParametersAction.keepUndefinedParameters`=true to allow undefined parameters to be injected as environment variables or `-Dhudson.model.ParametersAction.safeParameters=[comma-separated list]` to whitelist specific parameter names, even though it represents a security breach
To fix it, you have to do exactly what the warning suggests. Also, you should ensure that the
Groovy token macro processing
checkbox is set. - Pipeline version is not passed to the build
-
You can see that the Jenkins version is properly set. However, in the build version, it is still snapshot and the
echo "${PIPELINE_VERSION}"
does not print anything.You can check the Jenkins logs and see the following warning:
WARNING: Skipped parameter `PIPELINE_VERSION` as it is undefined on `jenkins-pipeline-sample-build`. Set `-Dhudson.model.ParametersAction.keepUndefinedParameters`=true to allow undefined parameters to be injected as environment variables or `-Dhudson.model.ParametersAction.safeParameters=[comma-separated list]` to whitelist specific parameter names, even though it represents a security breach
To fix it, you have to do exactly what the warning suggests.
- The build times out with
pipeline.sh
information -
This is a Docker compose issue. The problem is that for some reason, only in Docker, the execution of Java hangs. However, it hangs randomly and only the first time you try to run the pipeline.
The solution to this issue is to run the pipeline again. If it passes once, it will pass for any subsequent build.
Another thing that you can try is to run it with plain Docker. That helps sometimes.
- Can I use the pipeline for some other repositories?
-
Yes. You can pass the
REPOS
variable with a comma-separated list ofproject_name$project_url
format. If you do not provide thePROJECT_NAME
, the repository name is extracted and used as the name of the project.For example, a
REPOS
value equal tohttps://github.com/spring-cloud-samples/github-analytics,https://github.com/spring-cloud-samples/github-webhook
results in the creation of pipelines with root namesgithub-analytics
andgithub-webhook
.For example, a
REPOS
equal tomyanalytics$https://github.com/spring-cloud-samples/github-analytics,myfeed$https://github.com/spring-cloud-samples/atom-feed
results in the creation of pipelines with root namesmyanalytics
forgithub-analytics
andmyfeed
forgithub-webhook
. - Can this work for ANY project out of the box?
-
Not really. This is an “opinionated pipeline”. That is why we took some opinionated decisions
- Can I modify this to reuse in my project?
-
Yes. It is open-source. The important thing is that the core part of the logic is written in Bash scripts. That way, in the majority of cases, you could change only the bash scripts without changing the whole pipeline.
- The rollback step fails due to a missing JAR
-
You must have pushed some tags and have removed the Artifactory volume that contained them. To fix this, remove the tags by using the following command:
$ git tag -l | xargs -n 1 git push --delete origin
- I want to provide a different JDK version.
-
-
By default, we assume that you have configured a JDK with an ID of
jdk8
. -
If you want a different one, override the
JDK_VERSION
environment variable to point to the proper one.The docker image comes in with Java installed at /usr/lib/jvm/java-8-openjdk-amd64
. You can go toGlobal Tools
and create a JDK with an ID ofjdk8
and setJAVA_HOME
to/usr/lib/jvm/java-8-openjdk-amd64
.
-
To change the default settings, follow the steps shown in the following images:
- How can I enable groovy token macro processing?
-
We scripted that. However, if you need to this manually, follow the steps shown in the following images:
- How can I make deployment to stage and prod be automatic?
-
Set the relevant property or environment variable to
true
:-
AUTO_DEPLOY_TO_STAGE
to automatically deploy to stage. -
AUTO_DEPLOY_TO_PROD
to automatically deploy to prod.
-
- How can I skip testing API compatibility?
-
Set the
API_COMPATIBILITY_STEP_REQUIRED
environment variable tofalse
and re-run the seed (you can pick it from the seed job’s properties, too). - I can’t tag the repo.
-
You may get an error similar to the following:
19:01:44 stderr: remote: Invalid username or password. 19:01:44 fatal: Authentication failed for 'https://github.com/marcingrzejszczak/github-webhook/' 19:01:44 19:01:44 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1740) 19:01:44 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1476) 19:01:44 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63) 19:01:44 at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$8.execute(CliGitAPIImpl.java:1816) 19:01:44 at hudson.plugins.git.GitPublisher.perform(GitPublisher.java:295) 19:01:44 at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45) 19:01:44 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779) 19:01:44 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:720) 19:01:44 at hudson.model.Build$BuildExecution.post2(Build.java:185) 19:01:44 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:665) 19:01:44 at hudson.model.Run.execute(Run.java:1745) 19:01:44 at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43) 19:01:44 at hudson.model.ResourceController.execute(ResourceController.java:98) 19:01:44 at hudson.model.Executor.run(Executor.java:404)
Most likely, you passed a wrong password. Check the credentials section for how to update your credentials.
- I am unauthorized to deploy infrastructure jars.
-
Most likely, you forgot to update your local
settings.xml
file with the Artifactory’s setup. Check out this section of the docs and update yoursettings.xml
file. - Signing Artifacts
-
In some cases, it may be required that, when you perform a release, that the artifacts be signed before you push them to the repository. To do this, you need to import your GPG keys into the Docker image that runs Jenkins. This can be done by placing a file called
public.key
that contains your public key and a file calledprivate.key
that contains your private key in theseed
directory. These keys are imported by theinit.groovy
script runs when Jenkins starts. - Using SSH keys for Git
-
The seed job checks whether an environment variable called
GIT_USE_SSH_KEY
is set totrue
. If it istrue
, the environment variable calledGIT_SSH_CREDENTIAL_ID
is chosen as the one that contains the ID of the credential that contains SSH private key. By default,GIT_CREDENTIAL_ID
is picked as the one that contains the username and password to connect to git.You can set these values in the seed job by filling out the form and toggling a checkbox.
- Deploy to stage fails and does not redeploy a service (Kubernetes).
-
There can be a number of reasons for this issue. Remember, though, that, for stage, we assume that a sequence of manual steps needs to be performed. We do not redeploy any existing services, because, most likely, you deliberately have it set up that way. If, in the logs of your application, you can see that you cannot connect to a service, first ensure that the service is forwarding traffic to a pod. Next, if that is not the case, delete the service and re-run the step in the pipeline. That way, Cloud Pipelines redeploy the service and the underlying pods.
- I ran out of resources. (Cloud Foundry)
-
[jenkins-cf-resources]] When deploying the application to stage or prod, you can get an
Insufficient resources
exception. The way to solve it is to kill some applications from the test and stage environments. To do so, run the following commands:$ cf target -o pcfdev-org -s pcfdev-test $ cf stop github-webhook $ cf stop github-eureka $ cf stop stubrunner
You can also run
./tools/cf-helper.sh kill-all-apps
to remove all demo-related apps deployed to PCF Dev. - Deploying to test or stage or prod fails with an error about finding space (Cloud Foundry)
-
You receive an exception similar to the following:
20:26:18 API endpoint: https://api.local.pcfdev.io (API version: 2.58.0) 20:26:18 User: user 20:26:18 Org: pcfdev-org 20:26:18 Space: No space targeted, use 'cf target -s SPACE' 20:26:18 FAILED 20:26:18 Error finding space pcfdev-test 20:26:18 Space pcfdev-test not found
It means that you forgot to create the spaces in your PCF Dev installation.
- The route is already in use (Cloud Foundry).
-
If you play around with Jenkins, you can end up with routes that are already occupied, as identified by errors similar to the following:
Using route github-webhook-test.local.pcfdev.io Binding github-webhook-test.local.pcfdev.io to github-webhook... FAILED The route github-webhook-test.local.pcfdev.io is already in use.
To resolve the issue, delete the offending routes, by using commands similar to the following:
$ yes | cf delete-route local.pcfdev.io -n github-webhook-test $ yes | cf delete-route local.pcfdev.io -n github-eureka-test $ yes | cf delete-route local.pcfdev.io -n stubrunner-test $ yes | cf delete-route local.pcfdev.io -n github-webhook-stage $ yes | cf delete-route local.pcfdev.io -n github-eureka-stage $ yes | cf delete-route local.pcfdev.io -n github-webhook-prod $ yes | cf delete-route local.pcfdev.io -n github-eureka-prod
You can also run the
./tools/cf-helper.sh delete-routes
script. - How can I run helper scripts against a real Cloud Foundry instance that I’m logged into?
-
Assuming that you are already logged into the cluster, uyou can run the helper script with the
REUSE_CF_LOGIN=true
env variable, as shown in the following example:REUSE_CF_LOGIN=true ./tools/cf-helper.sh setup-prod-infra
This script create the MySQL database and the RabbitMQ service and downloads and deploys Eureka to the space and organization you are logged into.


The super keyword is used to call functions on an object's parent.
The super.prop
and super[expr]
expressions are valid in any method definition in both classes and object literals.
super([arguments]); // calls the parent constructor. super.functionOnParent([arguments]);
When used in a constructor, the super
keyword appears alone and must be used before the this
keyword can be used. This keyword can also be used to call functions on a parent object.
super
in classesThis code snippet is taken from the classes sample (live demo).
class Polygon { constructor(height, width) { this.name = 'Polygon'; this.height = height; this.width = width; } sayName() { console.log('Hi, I am a ', this.name + '.'); } } class Square extends Polygon { constructor(length) { this.height; // ReferenceError, super needs to be called first! // Here, it calls the parent class' constructor with lengths // provided for the Polygon's width and height super(length, length); // Note: In derived classes, super() must be called before you // can use 'this'. Leaving this out will cause a reference error. this.name = 'Square'; } get area() { return this.height * this.width; } set area(value) { this.area = value; } }
You are also able to call super on static methods.
class Human { constructor() {} static ping() { return 'ping'; } } class Computer extends Human { constructor() {} static pingpong() { return super.ping() + ' pong'; } } Computer.pingpong(); // 'ping pong'
You can not use the delete operator and super.prop
or super[expr]
to delete a parent class' property, it will throw a ReferenceError.
class Base { constructor() {} foo() {} } class Derived { constructor() {} delete() { delete super.foo; } } new Derived().delete(); // ReferenceError: invalid delete involving 'super'.
Super.prop
can not overwrite non-writable propertiesWhen defining non-writable properties with e.g. Object.defineProperty, super
can not overwrite the value of the property.
class X { constructor() { Object.defineProperty(this, "prop", { configurable: true, writable: false, value: 1 }); } f() { super.prop = 2; } } var x = new X(); x.f(); console.log(x.prop); // 1
super.prop
in object literalsSuper can also be used in the object initializer / literal notation. In this example, two objects define a method. In the second object, super
calls the first object's method. This works with the help of Object.setPrototypeOf() with which we are able to set the prototype of obj2
to obj1
, so that super
is able to find method1
on obj1
.
var obj1 = { method1() { console.log("method 1"); } } var obj2 = { method2() { super.method1(); } } Object.setPrototypeOf(obj2, obj1); obj2.method2(); // logs "method 1"
Created by Mozilla Contributors, license: CC-BY-SA 2.5


Family in Ottawa
I blasted through Ottawa with Joan this weekend to see my mom who was up from the US of A, my sister up from TO and to see my brother and his family (who are in Greely). We stayed in Stittsville, where Graham kindly let us stay while he was at Smuggler's Notch, bouldering.
It was a blast, great to see the kids, especially now that Derek has a bit more personality and Dean's a whirlwind.
Alas, that meant no time for the myth box, but that's alright as it finally came together. I did re-install it, and once I figgered the little things that had changed, it was all good.
I'm now wondering if a P4 will throttle itself energy-wise appropriately when idle. I did have an Athlon in there, which using 'athcool', may have been the better energy-wise choice. Especially since I don't recall ACPI on Linux being friendly with my P4 mobo.
(We have a couple of hours of Simpsons recorded...)
About this entry
You"re currently reading "Family in Ottawa," an entry on a crick in the net
- Published:
- 09.26.05 / 7pm
- Category:
- Circular File, Gadget-o-rama, Enviroh-oh-Oh!
I think you don't love us anymore.
*sniff*
I do, I just don't have control of my schedule! I have to get your phone number as it looks like we'll be there next weekend. (I'll dig through my mail, it should be there)


 The first step in registering your venture with IDEA is to attend a New Venture Orientation. You must have some connection with Northeastern University to take advantage of our program, such as being a student, an alumni, or a faculty member.
The IDEA management team is led by 27 Northeastern Undergraduate students from varying educational backgrounds that are passionate about helping ventures succeed and growing the IDEA program to reach its full potential.
Another way to get involved with IDEA is by becoming a Coach. The ideal candidate for a Coach is someone who has some type of industry expertise. There are two ways to get involved as a Coach: either as a Venture Coach or as a Ready Stage Coach.


DPGraph
Problem Statement
Accuracy Frontier
Performance Frontier
Empirical Findings
Finding Overview
Competitive Algorithm
Effect of Data Shape
Comparison Against Baseline
Background Overview
Reference: Glossary
Reference: Dataset
Reference: Algorithms
Reference: Differential Privacy
Privacy Performance Frontier
Node DP
Edge DP
Degree Distribution
Subgraph Counting
Dataset:
CIT
DBLP
Facebook
WIKI
4kclique
3kstar
2ktriangle
0ktriangle
Apply Setting
Please specify input settings.


This is a simple game.  Take these for example:
whole - extended - close - large - nuclear
Here the win word would be...family. In fact it is the word which is somehow related to all the 5 given words.
it suits the whole family
mine is an extended family
they really were a close family
my husband's family is a large one...
the idea that the nuclear family is...
In the auto-mode the tuples of the 5 + 1 (clue and unknown) words are generated automatically from collocations data downloaded from collocates.info.
Current constraints are:
You can also play via Telegram by adding MWE_bot to your contacts.
This is still in beta.
MWE is a language game built for fun by Angelo Basile and Federico Sangati. Please note this is still in beta.
If you found a bug, or want to make a suggestions or maybe you want to know more, then contact us by email.


open class RequestCookies
RequestCookies(request: ApplicationRequest) |
val rawCookies: Map<String, String> |
|
val request: ApplicationRequest |
open fun fetchCookies(): Map<String, String> |
|
operator fun get(name: String, encoding: CookieEncoding = CookieEncoding.URI_ENCODING): String? |


Let's decide us
Lazy man's mail voting system
Uops something went wrong 500
We'll take a look a it a soon as we can!!


Fraktals Chat Welcome Login / Register Enter your name. Your name is editable. Sorry, this name is already in use. To add this app to the home screen, press and than add to Home Screen. Room: Online users: no users « Back Login Username: Password: E-mail only for registration Sorry this combination does not exist. Usernames and Passwords are not yet secure, implementation follows shortly!


Our comprehensive tools and analytics allows you to see the data that matters, moderate your server, and increase user activity, all within a sleek dashboard.
Aside from data and analytics, the Scaliir bot will allow for multi-purpose use, even including an economy game!
Scaliir is still in it's development phase and will come (hopefully) this summer! Follow our social links to get more updates!


Chapter 12: Matrices
Chapter Objectives
This chapter shows matrices as logical extensions of arrays. You will learn about two specialized operations performed with matrices:
- Multiplication for rotating coordinates
- Division for solving simultaneous linear equations
Introduction
Although the matrix operations that are the subject of this chapter can be performed on pairs of vectors or arrays that meet certain criteria, when using these operations, we tend to refer to the data objects as matrices. In most mathematical discussions, the words "matrix" and "array" can be used interchangeably, and rightly so, because they store data in exactly the same form. Moreover, almost all of the operations we can perform on an array can also be performed on a matrix—logical operations, concatenation, slicing, and most of the arithmetic operations behave identically. The fact that some of the mathematical operations are defined differently gives us a chance to think about an important concept that is usually well hidden within the MATLAB language definition.
12.1 Concept: Behavioral Abstraction
Recall the following concepts:
- Abstraction is the ability to ignore specific details and generalize the description of an entity
- Data abstraction is the specific example of abstraction that we first considered whereby we could treat vectors of data (and later other collections like structures and arrays) as single entities rather than enumerating their elements individually
- Procedural abstraction are functions that collect multiple operations into a form; once they are developed, we can overlook the specific details and treat them as a "black box," much as we treat built-in functions
Behavioral abstraction combines data and procedural abstraction, encapsulating not only collections of data, but also the operations that are legal to perform on that data. One might argue that this is a new, irrelevant concept best ignored until “we just have to!” However, consider the rules we have had to establish for what we can and cannot do with data collections we have seen so far. For example, am I able to add two arrays together? Yes, but only if they have the same number of rows and columns, or if one of them is scalar. Can I add two character strings? Almost the same answer, except that each string is first converted to a numerical quantity and the result is a vector of numbers and not a string. Can I add two cell arrays? No.
So at least some, and maybe all, data collections also "understand" the set of operations that are permitted on the data. This encapsulation of data and operations is the essence of behavioral abstraction. Therefore, we distinguish arrays from matrices not by the data they collect, but by the operations that are legal to perform on them.
12.2 Matrix Operations
The arithmetic operations that differ between arrays and matrices are multiplication, division, and exponentiation.
12.2.1 Matrix Multiplication
Figure 12.1: Matrix Dot Multiply
Figure 12.2: Mechanics of Matrix Multiplication
Figure 12.3: Matrix Multiplication
Previously, when we considered multiplying two arrays, we called this scalar multiplication, and it had the following typical array operation characteristics:
- Either the two arrays must be the same size, or one of them must be scalar
- The multiplication was indicated with the .* operator
- The result was an array with the same size as the larger original array
- Each element of the result was the product of the corresponding elements in the original two arrays
This is best illustrated in Figure 12.1. Scalar division and exponentiation have the same constraints.
Matrix multiplication, on the other hand, performed using the normal * operator, is an entirely different logical operation, as shown in Figure 12.2. The logical characteristics of matrix multiplication are as follows:
- The two matrices do not have to be the same size.
- One of the matrices is a scalar, in which case the matrix operation reduces to a scalar multiply.
- The number of columns in the first matrix must equal the number of rows in the second. We refer to these as the inner dimensions. The result is a new matrix with the column count of the first matrix and the row count of the second.
- If, as illustrated,
A
is anm x n
matrix and B is ann x p
matrix, the result ofA * B
is anm x p
matrix. - The item at
(i, j)
in the result matrix is the sum of the scalar product of theith
row ofA
and thejth
column ofB
. - Whereas with scalar multiplication
A .* B
gives the same result asB .* A
, this is not the case with matrix multiplication. In fact, ifA * B
works,B * A
will not work unless both matrices are square, and even then the results are different. (Proof of this can be derived immediately from Figure 12.3 by eliminating the third row and column and exchanginga
forb
. All four terms of the result ofA * B
are different fromB * A
.) - Whereas with scalar multiplication the original array
A
can be recovered by dividing the result byB
, this is not the case with matrix multiplication unless both matrices are square. - The identity matrix, sometimes given the symbol
In
, is a square matrix withn
rows andn
columns that is zero everywhere except on its major diagonal, which contains the value 1. In has the special property that when pre-multiplied by any matrixA
withn
columns, or post-multiplied with any matrixA
withn
rows, the result isA
. We will need this property to derive matrix division below. (The built-in functioneye(...)
generates the identity matrix.)
- The requirements are either:
Figure 12.3 illustrates the mathematics for the case where a 3 x 2 matrix is multiplied by a 2 x 3 matrix, resulting in a 3 x 3 matrix.
12.2.2 Matrix Division
Matrix division is the logical process of reversing the effects of a matrix multiplication. The goal is as follows: given Anxn
, Bnxp
, and Cnxp
, where C = A * B
, we wish to define the mathematical equivalent of C/A
that will result in B
.
Since C = A * B
, we are actually searching for some matrix Kn3n by which we can multiply each side of the above equation:
K * C = K * A * B
This multiplication would accomplish the division we desire if K * A
were to result in In
, the identity matrix. If this were the case, pre-multiplying C
by would result in
In * B
, or simply B
by the definition of In
above. The matrix K
is referred to as the inverse of A
, or A-1
. The algebra for computing this inverse is messy but well defined. In fact, Gaussian Elimination to solve linear simultaneous equations accomplishes the same thing. The MATLAB language defines both functions (inv(A)
) and operators ("back divide," \) that accomplish this. However, two things should be noted:
- This inverse does not exist for all matrices — if any two rows or columns of a matrix are linearly related, the matrix is singular and does not have an inverse
- Only non-singular, square matrices have an inverse (just as a set of linear equations is soluble only if there are as many equations as there are unknown variables)
12.2.3 Matrix Exponentiation
For completeness, we mention here that matrix operations include exponentiation. However, this does not suggest that one would encounter AnxnBnxn
in the scope of our applications. Rather, our usage of matrix exponentiation will be confined to Ak
where k
is any non-zero integer value. The result for positive k
is accomplished by multiplying A
by itself k
times (using matrix multiplication). The result for negative k
is accomplished by inverting A-k
. (There is, in fact, meaning in matrix exponentials with non-scalar exponents, but this involves advanced concepts with Eigen values and Eigenvectors and is beyond the scope of this text.)
12.3 Implementation
In this section, we see how MATLAB implements matrix multiplication and division. However, since applications that require matrix exponentiation Ak where k is anything but a scalar quantity are beyond the scope of this text, we will not look at its implementation in MATLAB.
12.3.1 Matrix Multiplication
Matrix multiplication is accomplished by using the "normal" multiplication symbol, as illustrated in Exercise 12.1.
12.3.2 Matrix Division
Matrix division is accomplished in a number of ways, all of which appear to work, but some give the wrong answer. Returning to the division problem described in Section 12.2.2, we know that A
is a square matrix of side n
, and B
and C
have n
rows, and C = A * B
. If we are actually given the matrices A
and B
, we can compute B
in one of the following ways:
B = inv(A) * C
— using the MATLABinv(...)
function to compute the inverse ofB
B = A \ C
— "back dividing"B
intoC
to produce the same resultB = C / A
&mdash apparently performing the same operation, but giving different answers
The order in which the matrix multiply is done affects the value of the result; therefore, care must be taken to ensure that the appropriate inversion or division is used. Study the results of Exercise 12.2 carefully.
12.4 Rotating Coordinates
A common use for matrix multiplication is for rotating coordinates in two or three dimensions. Previously we have seen the ability to rotate a complete picture by changing the viewing angle. We can move and scale items on a plot by adding coordinate offsets or multiplying them by scalar quantities. However, frequently the need arises to rotate the coordinates of a graphical object by some angle. We can use matrix multiplication to rotate individual items in a picture in two or three dimensions.
12.4.1 2-D Rotation
Figure 12.4: Rotating Cartesian Coordinates
The mathematics implementing rotation in two dimensions is relatively straightforward, as shown in Figure 12.4. If the original point location P is (x, y) and you wish to find the point P* (x*, y*) that is the result of rotating P by the angle θ about the origin of coordinates, the mathematics are as follows:
x* = x cosθ − y sinθ
y* = x sinθ + y cosθ
which can be expressed as the matrix equation:
P* = A * P
where A is found by:
A = [cosθ −sinθ; sinθ cosθ]
To rotate the x-y coordinates of a graphic object in the x-y plane about some point, P, other than the origin, you would do as follows:
- Translate the object so that P is at the origin by subtracting P from all the object's coordinates
- Perform the rotation by multiplying each coordinate by the rotation matrix shown above
- Translate the rotated object back to P by adding P to all the rotated coordinates
Rotating a Line Listing 12.1 illustrates a simple script to rotate a line about the origin.
Figure 12.5 shows the plot resulting from this script.
Listing 12.1Figure 12.5: Line Rotations
Figure 12.6: Stars
Twinkling Stars As a second example, consider the problem of simulating twinkling stars. One way to accomplish this is to draw two triangles for each star rotating in opposite directions. The script shown in Listing 12.2 accomplishes this.
The results of this script are shown in Figure 12.6.
12.4.2 3-D Rotation
The mathematics implementing rotation in three dimensions is a natural extension of the 2-D rotation case. We present here a simple way to make this extension. The 2-D rotation in Section 12.4.1 that rotates by the angle θ in the x-y plane is actually rotating about the z-axis. If P* and P are now 3-D coordinates, we can rotate P by an angle θ about the z-axis with the equation:
P* = Rz * P
where Rz is computed as
Rz = [cosθ, -sinθ, 0; sinθ, cosθ, 0; 0, 0 1]
Similarly, we can develop matrices Rx and Ry that rotate about the x and y axes by angles φ and ψ, respectively.
Rx = [1, 0, 0; 0, cosφ, -sinφ; 0, sinφ, cosφ]
Ry = [cosψ, 0, sinψ; 0, 1, 0; -sinψ, 0, cosψ]
P* = Rx * Ry * Rz * P
Figure 12.7: Solid Cubes
An example of a script to rotate the solid cube drawn in Chapter 11 is shown in Listing 12.4. The major problem with rotating solid objects is that the coordinates of the object are defined as arrays of points. However, the rotation matrices need each set of coordinates in single rows. To accomplish this, we will use the reshape(...)
function to transform the coordinates to and from the row vectors necessary for the coordinate rotation.
The results after running this script are shown in Figure 12.7. Notice that the mechanization of the top face has caused a "wrapped parcel" effect on the light reflections off that surface.
12.5 Solving Simultaneous Linear Equations
A common use for matrix division is solving simultaneous linear equations. To be solvable, simultaneous linear equations must be expressed as N independent equations involving N unknown variables, xi. They are usually expressed in the following form:
A11x1 + A12x2 + ... + A1NxN = c1
A21x1 + A22x2 + ... + A2NxN = c2
...
AN1x1 + AN2x2 + ... + ANNxN = cN
In matrix form, they can be expressed as follows:
AN x N * XN x 1 = CN x 1
from which, since all of the values in A and C are constants, we can immediately solve for the column vector X by back division:
X = A\C
or by using the matrix inverse function:
X = inv(A) * C
12.5.1 Intersecting Lines
Figure 12.8: Lines intersecting
A typical example of a simultaneous equation problem might take the following form. Consider two straight lines on a plot with the following general form:
A11x + A12y = c1
A21x + A22y = c2
These lines intersect at some point P (x, y) that is the solution to both of these equations. The equations can be rewritten in matrix form as follows:
A * V = c
where c
is the column vector [c1 c2]'
and V
is the required result, the column vector [x y]'
. The solution is obtained by matrix division as follows:
V = A \ c
Recall that back divide, like the inv(...)
function, will fail to produce a result if the matrix is singular, that is, has two rows or columns that have a linear relationship. In the specific example of two intersecting lines, this singularity occurs when the two lines are parallel, in which case there is no point of intersection. Listing 12.5 shows the solution to a pair of simultaneous equations.
Figure 12.8 shows the result of this script.
12.6 Engineering Examples
The following examples illustrate applications of the matrix capabilities discussed in this chapter.
12.6.1 Ceramic Composition
Industrial ceramics plants require mixtures with precise formulations in order to produce products of consistent quality. For example, a factory might require 100 kg of a mix consisting of 67% silica, 5% alumina, 2% calcium oxide, and 26% magnesium oxide. However, the raw material provided is not pure quantities of these materials. Rather, they are delivered as batches of material that consist of the required components in different proportions. Each batch of raw materials is analyzed to determine their composition, and we will need to do the analysis to determine the proportions of the raw materials to mix in order to accomplish the appropriate formulation. The raw materials we will use here are feldspar, diatomite, magnesite, and talc. Table 12.1 illustrates a typical analysis of the composition of these compounds.
| Silica | Alumina | CaO | MgO | |
|---|---|---|---|---|
| Feldspar | 0.6950 | 0.1750 | 0.0080 | 0.1220 |
| Diatomite | 0.8970 | 0.0372 | 0.0035 | 0.0623 |
| Magnesite | 0.0670 | 0.0230 | 0.0600 | 0.8500 |
| Talc | 0.6920 | 0.0160 | 0.0250 | 0.2670 |
For example, if we mixed Wf kg of feldspar, Wd kg of diatomite, Wm kg of magnesite, and Wt kg of talc, the amount of silica would be 0.695 Wf + 0.897 Wd + 0.067 Wm + 0.692 Wt. Repeating this equation for the other components produces a matrix equation that reduces to:
C = A * W
where C is the required composition of the resulting mix, A is a 4 x 4 matrix showing the results of analyzing the four raw materials, and W is the proportions in which should we mix the raw material to produce the desired result. We find the appropriate amounts of the raw material by solving these equations:
W = A\B
A script that works this problem is shown in
12.6.2 Analyzing an Electrical Circuit
Figure 12.9 illustrates a typical electrical circuit with two voltage sources connected to five resistors with three closed loops. The voltages and resistances are given. We are asked to determine the voltage drop across R1. Solution techniques apply Ohm's Law to the voltage drops around each closed circuit. When this technique is applied, the equations are as follows:
Figure 12.9: Typical electrical circuit
V1 = i1 * R1 + (i1 − i2) * R4
0 = i2 * R2 + (i2 − i3) * R5 + (i2 − i1) * R4
−V2 = i3 * R3 + (i3 − i2) * R5
When these three equations are manipulated to isolate the three currents, we have the following matrix equation:
V = A * I
which can be solved as usual by:
I = A \ V
The script to accomplish this is shown in Listing 12.7.
Chapter Summary
This chapter presented two specialized operations performed with matrices:
- Matrix multiplication can be used for 2-D and 3-D coordinate rotations by building the appropriate rotation matrices
- Matrix division can be used for solving simultaneous equations by setting up the equations in the general form
B = A * x
, where the known matrixA
isn x n
and the known column vectorB
isn x 1
; the unknown vectorx
is then found byx = A\B
orx = inv(A) * B
Self Test
True or False
- All MATLAB classes exhibit some form of behavioral abstraction.
- Matrix multiplication requires that the inner dimensions match.
- The results of A * B and B * A are identical.
- Both A * A -1 and A -1 * A return the identity matrix.
- Multiplying inv(A) * B is logically equivalent to B / A.
- All sets of simultaneous linear equations can be solved by matrix inversion.
Fill in the Blanks
- Behavioral abstraction combines _____________ abstraction and _______________ abstraction.
- The result of a matrix multiplication is a new matrix with the __________ count of the first matrix and the ___________ count of the second.
- To rotate a graphic object in the x-y plane about some point, P, other than the origin, you first ___________, then __________, and then _____________________.
- To be soluble, simultaneous linear equations must be expressed as ______________ equations involving _______________variables, xi, and _____________values.
Programming Projects
- This is a set of simple matrix manipulations.
- Create a five by six matrix, A , that contains random numbers between 0 and 10.
- Create a six by five matrix, B , that contains random numbers between 0 and 10.
- Find the inverse of matrix A*B and store it in the variable, C.
- Without iteration, create a new matrix D that is the same as A except that all values less than 5 are replaced by zero.
- Using iteration, create a new matrix F that is the same as A except that all values less than 5 are replaced by zero.
- Create a new matrix G that is the matrix A with the columns
reversed.
For example:
if A is [1 2 3; 3 2 5; 1 7 4],
G should be [3 2 1; 5 2 3; 4 7 1] - Find the minimum value among all the elements in A and store your answer in the variable H.
- Imagine that world leaders have decided to come up with a single
currency for the world. This new currency, called the Eullar, is
defined by the following:
Seven dollars and 3 Euros make 71 Eullars.
One dollar and 2 Euros make 20 Eullars.
You are a reputed economist, and your job is to find out the value of a dollar in terms of Eullars. - As an enthusiastic and motivated student, you decided to go
out and buy plenty of pens for all your classes this semester.
 So now, you're left with
four different types of pens and no
receipt—you only remember the total
amount you spent, and not the price of
each type of pen. You decide to get
together with three of your friends who
coincidentally did the same thing as
you, buying the same four types of pens and knowing only
the total amount. Write a script to find the prices of each type
of pen.
Hint: In order to find the price of each individual pen, you could create a matrix called "pens," where each column represents a different type of pen and each row represents a different person and a column vector totals that contains the amount of money each of you spent on the pens. - Write a function called rotateLine that takes in two vectors, x and
y , of the same length that represent a set or ordered pairs that
could be used to plot a line. Your function should also take in a
third parameter, theta , representing an angle in degrees. Your
function should return xprime and yprime where xprime and yprime
represent the line that is x and y rotated about the origin by the
angle theta.
For example:
x = [ 7 7 11 11 7];
y = [-5 -9 -9 -5 -5];
[xprime yprime] = rotateLine(x, y, 90) returns:
xprime = [5 9 9 5 5]
yprime = [7 7 11 11 7]


About Me
I’m Siddhartha Srivastava. I graduted from IIT Kanpur with a degree in Mathematics in 2020.
This Website
I haven’t really decided what I’ll write here. Writing is one of the many things I’m not really good at, so hard for me to know what I’ll write about until I’ve actually started writing.
To do
- Build commenting system using staticman (https://staticman.net/)
- Fix next/previous


The chicken (Gallus gallus domesticus) is a type of domesticated fowl, a subspecies of the red junglefowl (Gallus gallus).
Chickens are one of the most common and widespread domestic animals, with a total population of 23.7 billion as of 2018.
[1] up from more than 19 billion in 2011.[2] There are more chickens in the world than any other bird or domesticated fowl.
[2] Humans keep chickens primarily as a source of food (consuming both their meat and eggs) and, less commonly, as pets.
Originally raised for cockfighting or for special ceremonies,
chickens were not kept for food until the Hellenistic period (4th–2nd centuries BC).[3][4]
Genetic studies have pointed to multiple maternal origins in South Asia,
Southeast Asia, and East Asia,[5] but with the clade found in the Americas, Europe, the Middle East and Africa originating in the Indian subcontinent.
From ancient India, the domesticated chicken spread to Lydia in western Asia Minor, and to Greece by the 5th century BC.[6] Fowl had been known in Egypt since the mid-15th century BC,
with the "bird that gives birth every day" having come to Egypt from the land between Syria and Shinar, Babylonia, according to the annals of Thutmose III.[7][8][9]
The chicken (Gallus gallus domesticus) is a type of domesticated fowl, a subspecies of the red junglefowl (Gallus gallus).
Chickens are one of the most common and widespread domestic animals, with a total population of 23.7 billion as of 2018.
[1] up from more than 19 billion in 2011.[2] There are more chickens in the world than any other bird or domesticated fowl.
[2] Humans keep chickens primarily as a source of food (consuming both their meat and eggs) and, less commonly, as pets.
Originally raised for cockfighting or for special ceremonies,
chickens were not kept for food until the Hellenistic period (4th–2nd centuries BC).[3][4]
Genetic studies have pointed to multiple maternal origins in South Asia,
Southeast Asia, and East Asia,[5] but with the clade found in the Americas, Europe, the Middle East and Africa originating in the Indian subcontinent.
From ancient India, the domesticated chicken spread to Lydia in western Asia Minor, and to Greece by the 5th century BC.[6] Fowl had been known in Egypt since the mid-15th century BC,
with the "bird that gives birth every day" having come to Egypt from the land between Syria and Shinar, Babylonia, according to the annals of Thutmose III.[7][8][9]
The chicken (Gallus gallus domesticus) is a type of domesticated fowl, a subspecies of the red junglefowl (Gallus gallus).
Chickens are one of the most common and widespread domestic animals, with a total population of 23.7 billion as of 2018.
[1] up from more than 19 billion in 2011.[2] There are more chickens in the world than any other bird or domesticated fowl.
[2] Humans keep chickens primarily as a source of food (consuming both their meat and eggs) and, less commonly, as pets.
Originally raised for cockfighting or for special ceremonies,
chickens were not kept for food until the Hellenistic period (4th–2nd centuries BC).[3][4]
Genetic studies have pointed to multiple maternal origins in South Asia,
Southeast Asia, and East Asia,[5] but with the clade found in the Americas, Europe, the Middle East and Africa originating in the Indian subcontinent.
From ancient India, the domesticated chicken spread to Lydia in western Asia Minor, and to Greece by the 5th century BC.[6] Fowl had been known in Egypt since the mid-15th century BC,
with the "bird that gives birth every day" having come to Egypt from the land between Syria and Shinar, Babylonia, according to the annals of Thutmose III.[7][8][9]


Classes and IDs in CSS and HTML
The hows and whys
14 Feb 2015
CSS is a great way to add some flair to your basic HTML. There are a number of different ways apply CSS to your site. The most basic is to add your CSS styles 'inline' in your HTML document. Inline syntax looks like this:
However if you want to separate your CSS off into another document so that you can easily apply your styles multiple times over a number of different pages you are faced with a couple of choices about how you can implement that: classes or IDs.
ID names are signified on the stylesheet with a '#'. They look like this:
To link them to the element you want them to style you just add id='class-name' to the element in your HTML you want to modify. Here is what the header at the top of the page styled with IDs looks like:
IDs are unique identifiers and should only be used once per page. This makes them especially suited to things that only show up once on each page; like a header or footer. That is the example I use above.
Classes on the other hand can be used multiple times per page. Class names are written with a '.' on the stylesheet and look like this:
Classes are implemented in HTML in a fashion very similar to IDs. Here is an example of classes being used to style the text and images on this page:
To sum up: IDs are unique identifiers to only be used once per page while classes are to style repeating things like images and paragraphs. Hope this helps!


|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object visualize.PostVisualizer
public class PostVisualizer
Class for visualizing postprocessing information.
| Field Summary | |
|---|---|
private int |
coordinateSystem_
The coordinate system for drawing numerical values. |
static int |
deformed_
Static variable for drawing undeformed or deformed shape of structure. |
static int |
elasticStrains1D_
Static variable for the result option of drawing. |
static int |
elasticStrains2D_
Static variable for the result option of drawing. |
static int |
elasticStrains3D_
Static variable for the result option of drawing. |
private PostElement1DDisplay |
element1DDisplay_
One dimensional elements and element related results drawer of visualizer. |
private PostElement2DDisplay |
element2DDisplay_
Two dimensional elements and element related results drawer of visualizer. |
private PostElement3DDisplay |
element3DDisplay_
Three dimensional elements and element related results drawer of visualizer. |
static int |
elementDisp1D_
Static variable for the result option of drawing. |
static int |
elementDisp2D_
Static variable for the result option of drawing. |
static int |
elementDisp3D_
Static variable for the result option of drawing. |
private double[] |
factors_
Array storing the scaling factors of drawing. |
static int |
global_
Static variable for drawing coordinate system. |
static int |
internalForces1D_
Static variable for the result option of drawing. |
static int |
internalForces2D_
Static variable for the result option of drawing. |
static int |
local_
Static variable for drawing coordinate system. |
private double |
maxDisplacement_
Maximum displacement of all nodes. |
private double |
maxDistance_
Maximum and minimum distances between nodes. |
private double |
minDistance_
Maximum and minimum distances between nodes. |
static int |
misesStress1D_
Static variable for the result option of drawing. |
static int |
misesStress2D_
Static variable for the result option of drawing. |
static int |
misesStress3D_
Static variable for the result option of drawing. |
static int |
nodalDisp_
Static variable for the result option of drawing. |
private PostNodeDisplay |
nodeDisplay_
Node and node related results drawer of visualizer. |
static int |
noOption_
Static variable for the result option of drawing. |
static int |
principleStrains1D_
Static variable for the result option of drawing. |
static int |
principleStrains2D_
Static variable for the result option of drawing. |
static int |
principleStrains3D_
Static variable for the result option of drawing. |
static int |
principleStresses1D_
Static variable for the result option of drawing. |
static int |
principleStresses2D_
Static variable for the result option of drawing. |
static int |
principleStresses3D_
Static variable for the result option of drawing. |
static int |
reactionForces_
Static variable for the result option of drawing. |
private java.lang.Double |
scale_
Scaling factor used for scaling displacements when automatic scaling is not used. |
static int |
stresses1D_
Static variable for the result option of drawing. |
static int |
stresses2D_
Static variable for the result option of drawing. |
static int |
stresses3D_
Static variable for the result option of drawing. |
private Structure |
structure_
The structure to be visualized. |
static int |
undeformed_
Static variable for drawing undeformed or deformed shape of structure. |
| Constructor Summary | |
|---|---|
PostVisualizer()
|
| Method Summary | |
|---|---|
private void |
check(int option,
int[] comp)
Checks given parameters for graphics. |
private void |
computeScalors()
Computes maximum and minimum distances between nodes of structure. |
void |
drawDeformedShape(SolidMAT owner,
int option,
int[] comp,
boolean isScaled,
int step)
Draws results on deformed shape of the structure. |
private void |
drawScalor(SolidMAT owner,
int step)
Draws contour scalor for the deformed shape option. |
void |
drawUndeformedShape(SolidMAT owner,
int option,
int[] comp)
Draws results on undeformed shape of the structure. |
private void |
exceptionHandler(java.lang.String message)
Throws exception with the related message. |
private java.lang.String |
formatter(double number)
Formats given real number to scientific form and returns string. |
double[] |
getScalingFactors()
Returns the scaling factors array of drawing. |
void |
setCoordinateSystem(int coordinateSystem)
Sets coordinate system for drawing numerical values. |
void |
setScalingFactor(java.lang.Double scale)
Sets factor for scaling displacements when automatic scaling is not used. |
void |
setScalingFactors(double[] factors)
Sets scaling factors array for scaling the objects in the drawing. |
void |
setStructure(Structure structure)
Sets structure to post-visualizer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int nodalDisp_
public static final int reactionForces_
public static final int elementDisp1D_
public static final int elasticStrains1D_
public static final int stresses1D_
public static final int internalForces1D_
public static final int principleStrains1D_
public static final int principleStresses1D_
public static final int misesStress1D_
public static final int elementDisp2D_
public static final int elasticStrains2D_
public static final int stresses2D_
public static final int internalForces2D_
public static final int principleStrains2D_
public static final int principleStresses2D_
public static final int misesStress2D_
public static final int noOption_
public static final int elementDisp3D_
public static final int elasticStrains3D_
public static final int stresses3D_
public static final int principleStrains3D_
public static final int principleStresses3D_
public static final int misesStress3D_
public static final int global_
public static final int local_
private int coordinateSystem_
public static final int undeformed_
public static final int deformed_
private Structure structure_
private PostNodeDisplay nodeDisplay_
private PostElement1DDisplay element1DDisplay_
private PostElement2DDisplay element2DDisplay_
private PostElement3DDisplay element3DDisplay_
private double maxDistance_
private double minDistance_
private double maxDisplacement_
private java.lang.Double scale_
private double[] factors_
| Constructor Detail |
|---|
public PostVisualizer()
| Method Detail |
|---|
public void setStructure(Structure structure)
structure
- The stucture to be drawn.public void setCoordinateSystem(int coordinateSystem)
coordinateSystem
- The coordinate system of numerical values.public void setScalingFactor(java.lang.Double scale)
scale
- Scaling factor.public void setScalingFactors(double[] factors)
factors
- The scaling factors array to be set.public double[] getScalingFactors()
public void drawUndeformedShape(SolidMAT owner, int option, int[] comp)
owner
- The owner frame of drawing.option
- The result option for drawing results.comp
- The component to be drawn.public void drawDeformedShape(SolidMAT owner, int option, int[] comp, boolean isScaled, int step)
owner
- The owner frame of drawing.option
- The result option for drawing results.comp
- The component to be drawn.isScaled
- True if displacements are scaled, false if not.step
- The step number of drawing.private void drawScalor(SolidMAT owner, int step)
owner
- The owner of contour scalor.step
- The step number of drawing.private void computeScalors()
private void check(int option, int[] comp)
option
- Result option.comp
- The demanded component of result.private java.lang.String formatter(double number)
number
- The number to be formatted.
private void exceptionHandler(java.lang.String message)
message
- The message to be displayed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |


Review by Lars Lindahl<EMAIL_ADDRESS>"The Minus Man" (1999) ** (out of four)
Written and Directed by Hampton Fancher
Starring Owen Wilson, Janeane Garofalo, Mercedes Ruehl, Brian Cox, Dwight Yoakam, Dennis Haysbert, Eric Mabius, Larry Miller, Brent Briscoe, and Sheryl Crow.
I remember first seeing the preview to this low budget serial killer indie with a sold out crowd in front of The Blair Witch Project. The trailer was strikingly original compared to most plot-revealing advertisements today. There were no clips from the film, just a young couple intimately discussing what they had just seen at the theater. In fact, their discussion was so intimate that the young lady involved forgot about her life guarding responsibilities at a local pool. Arriving late to her job, she finds two huge cadavers floating in the pool. The laughter, following this bizarre moment, roared throughout the theater. After this disturbing event, words flew across the screen, accompanied by a Danny Elfman-esque score, first declaring that you will talk about this movie for a long, long time, then listing a cast of familiar names including Janeane Garafolo, Merecedes Ruehl, and rock star Sheryl Crow. >From this experience, I told myself I had to see this movie and I'm sure everyone else around me did the same but for one reason or another no one did, including myself.
I finally got a chance to catch this one on video a couple of days ago and, sadly, it was not worth the wait. I think I understand why there wasn't a scene from the movie in the preview – there is not one interesting or stand out moment in the whole film, not one surprising turn in the plot, not one particularly noteworthy acting performance, not one musically charged instant. Not one of anything really, except a lot of torturously slow paced dialogue. From beginning to end, everything remains consistently low-key.Writer/director Hampton Fancher tells an original story but he does nothing else. My only reaction when The Minus Man ended was `So? Is that it?' Fancher spends so many pointless scenes doing nothing that, as time goes by, the movie begins to drag and drag. The movie is way longer than it has to be and still there is little to get out of it once it is over. For a film that guarantees to be a conversation starter, the only thing my viewing partner and I had to talk about were the numerous plot holes left annoyingly (and ntentionally?) unfilled.
The film starts with a questionable casting choice. Thankfully Sheryl Crow is only in Minus Man for a couple of minutes because her acting skills are very limited. She plays an innocent victim to a serial killer by the name of Vann Siegert. Played ndifferently by Owen Wilson, Vann is the last man you'd expect to be a murderer. He has deceivingly sunny blonde hair, he's sober, and he's a text book example of a polite do-gooder. So when he rents out a room in the house of the emotionally troubled husband and wife Jane and Doug (Mercedes Ruehl and Brian Cox), he is quickly taken in as the child the aging couple wished they had. Vann immediately after arriving at this ghost town ironically takes on the stereotypical job of a post office worker, meets a girl (the unpredictably banal Janeane Garofalo), and whenever he feels like it, poisons a resident of the town.
Very similar to American Psycho, except without all of the gory murder scenes, The Minus Man is full of superfluous voiceovers by Vann. Sometimes interesting but mostly irrelevant, these glimpses at a serial killer's mind never tell us why he does what he does. Fancher occasionally hints that mentally unstable Vann feels a certain amount of power when he kills, but unfortunately nothing is for sure.
Some of the scenes in which the viewer enters the chaotic imagination of Vann are wonderfully eerie. Our narrator has dreams about two police detectives (Dennis Haysbert and Dwight Yoakam) interrogating him with cruel language and violence. But, like most of the movie, nothing ultimately comes out of this part of the story.
The Minus Man is not as depressing or disturbing as claims it is. I wanted to like this movie and its actors but no matter how hard I tried, I could not. Kudos to Artisan Entertainment. This is an example of clever advertising attracting me to something I should have avoided.
Grade: ** (out of four)
Lars Attacks! A teenager attacks past and present cinema http://www.geocities.com/larsattacks00/
<EMAIL_ADDRESS>(c) 2000 Lars Lindahl
Do You Yahoo!? Get Yahoo! Mail - Free email you can access from anywhere! http://mail.yahoo.com/
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


[1]
the savings in the room size has n't rendered a proportional saving in the room fees .
[2]
a while you realise that they are quite hopeless to use -/: like hangers and lighting .


tl;dr
You can see the result here :)
Hey guys, I’m here to show you a little simple technique, but it’s a tip that maybe someday help someone. The question is how to identify that someone is using web proxy (BURP)? well, a friend of mine aka Jerry was with me one afternoon and we decided to do a PoC, maybe a lot of people already know, but when starting BURP it automatically goes up to a “light” web server where you can for example download the BURP certificate to import into your browser or device at the following address http://burp/ The following image illustrates this interface:
Well, taking this as a starting point, on this little web server we have BURP’s favicon.ico too, where you can access it from the following URL http://burp/
according to google favicon.ico is for:
A favicon is a small 16 × 16 pixel icon that appears at the top of a web browser. It serves as branding for your website and a convenient way for visitors to locate your page when they have multiple tabs open. Because of their tiny size , favicons work best as simple images or one-to-three characters of text.
Because with this behavior, we can find out if a person(attacker) is using BURP, using a bit of Javascript. As shown in the following code:

<title> Burp Detection </title>

Using Burp ?

Let's see..

 By inc0gbyt3 and J3rry

With this code above, if you (attacker) access with burp running with default config, the javascript will check if favicon.ico is accessible, if yes, alert function will warn that you are using burp :), otherwise You will not do anything.
OBS: You can disable this burp functionality in Options, just uncheck the option that will take this service.