text:
layout: page
title: Router
---

				RiotGear Router provides Riot apps with state based routes and URL management via the HTML History API.

Use

				Include the router in any tag you want to access the router from by "mixin" it in like so:

this.mixin('rg.router')

				Once you are happy to start the router call the start() function from either a tag:

this.router.start()

				or via the rg object:

rg.router.start()

			 The router does not start automatically.

API

				After adding the router your tag will have access to it via this.router.

Fluent API Interface

				If you want you can chain function calls together. For example:

rg.router.add().start().go()

To #! or to not #!

				By default the router uses #!, however you can change this easily by setting rg.router.hash to some other value.

.add()

				You can add states at any point in time, on mount, on update, on click, on resolve of a promise...whenever.

this.router.add({
  name: 'about',
  url: '/about',
  history: false,
  resolve: () => new Promise(function (resolve, reject) {
    window.setTimeout(resolve, 2000)
  })
})

name is required, is the name of the state and the identifier to use when calling go()

url is optional. It will update the browser URL on state change

history is optional. Set it to false to prevent the state from being added to your browser history

resolve is optional. The router will wait for .then() on the resolve function before going to the next state

				If you do not specify a url the browser back and forward buttons will still work.

				States names need to be unique. You can add a state with the same name but it will overwrite the state stored by the router.

/:state/:parameters

				You can use template patterns like this:

rg.router.add({
  name: 'rest',
  url: '/:collection/:id/:action'
})

				When the router starts it matches the URL with a state.

				/users/470129/edit will match against '/:collection/:id/:action'

				If successful the router will create a params object on the state and copy the values across which you can gain access to via the go event.

				e.g.

this.router.on('go', state = > {
  state.params.collection // users
  state.params.id         // 470129
  state.params.edit       // edit
})

				The template can be anything you'd like, for instance /about/:page or /alerts/:type/viewable.

				A parameter is prefixed with :

				When you call go() you can pass the state a params object that the router uses to construct the URL.

inherit.state.data

				You can add whatever you want to a state and get access to it via this.router.current from within your tag, for example:

this.router.add({
  name: 'about',
  title: 'About our website' // this.router.current.title
})

				You can also inherit the data from parent states by using dot notation in the state name:

this.router.add({
  name: 'about.people'
})

				When you go to about.people you will still have the title value available via this.router.current.title that
				was set on the about state.

				The history option is also inherited so if you want a child state to be part of the browser history reset it to true.

				Beware that the resolve function is also inherited. So if you navigate to a state whose parent is set to wait for a
				promise to resolve then the child will wait too. You can overwrite this by setting resolve to null on the child.

.remove()

this.router.remove('about')

				Just as with adding, you can remove states whenever you want in the lifecycle of your application.

.go()

this.router.go('users', params)

				Call go() if you want to change state. Calling go will update the current state, and if a URL is specified will update the URL on the browser.

				If you specify a state name that doesn't exist the router will throw you an error.

				The router will ignore attempts to go to the same state in succession.

				Calling go() will trigger an update on any tag the router is on via the mixin

				The router will update the URL based on the template URL on the state and the structure of the params object.

.stop()

this.router.stop()

				If you want to stop the router and switch to use a different one this function will remove the event listeners and set active to false.

.start()

this.router.start()

				On start the router will check the URL, match it with a state and call go().
				The router does not start automatically.
				Refreshing the browser will only return you to a state that has a URL. URL-less states can't be refreshed.

.active

this.router.active

				Check to see if the router is running or whether it has been stopped.

.current

this.router.current

				Current state the router is in. This will contain everything specified on the state as part of the add() function.

.on('add remove go start stop')

this.router.on('add', state = > console.log(state))
this.router.on('remove', state = > console.log(state))
this.router.on('go', (current, previous) = > console.log(current, previous))
this.router.on('start')
this.router.on('stop')

				The router is an observable and will trigger an event for each of the above API calls.

Install

npm install riotgear-router --save

Download

				» rg-router.js

				» rg-router.min.js


text:
from superset.security.analytics_db_safety import (
    check_sqlalchemy_uri,
    DBSecurityException,
)
from tests.base_tests import SupersetTestCase

class TestDBConnections(SupersetTestCase):
    def test_check_sqlalchemy_uri_ok(self):
        check_sqlalchemy_uri("postgres://user:password@test.com")

    def test_check_sqlalchemy_url_sqlite(self):
        with self.assertRaises(DBSecurityException):
            check_sqlalchemy_uri("sqlite:///home/superset/bad.db")

redpajama_set_name: RedPajamaGithub


text:
<?php

declare(strict_types=1);

namespace OpenTelemetry\SDK\Trace;

use OpenTelemetry\SDK\Behavior\LogsMessagesTrait;
use OpenTelemetry\SDK\Sdk;

final class TracerProviderFactory
{
    use LogsMessagesTrait;

    private ExporterFactory $exporterFactory;
    private SamplerFactory $samplerFactory;
    private SpanProcessorFactory $spanProcessorFactory;

    public function __construct(
        ?ExporterFactory $exporterFactory = null,
        ?SamplerFactory $samplerFactory = null,
        ?SpanProcessorFactory $spanProcessorFactory = null
    ) {
        $this->exporterFactory = $exporterFactory ?: new ExporterFactory();
        $this->samplerFactory = $samplerFactory ?: new SamplerFactory();
        $this->spanProcessorFactory = $spanProcessorFactory ?: new SpanProcessorFactory();
    }

    public function create(): TracerProviderInterface
    {
        if (Sdk::isDisabled()) {
            return new NoopTracerProvider();
        }

        try {
            $exporter = $this->exporterFactory->create();
        } catch (\Throwable $t) {
            self::logWarning('Unable to create exporter', ['exception' => $t]);
            $exporter = null;
        }

        try {
            $sampler = $this->samplerFactory->create();
        } catch (\Throwable $t) {
            self::logWarning('Unable to create sampler', ['exception' => $t]);
            $sampler = null;
        }

        try {
            $spanProcessor = $this->spanProcessorFactory->create($exporter);
        } catch (\Throwable $t) {
            self::logWarning('Unable to create span processor', ['exception' => $t]);
            $spanProcessor = null;
        }

        return new TracerProvider(
            $spanProcessor,
            $sampler,
        );
    }
}


text:
ACCEPTED

#### According to
Euro+Med Plantbase

#### Published in
null

#### Original name
Centaurea teydis C.Sm. ex Buch

### Remarks
null


text:
all: $(patsubst %.cc, %, $(wildcard *.cc))

#Each individual program (.cc) has its own make rule embedded in the
#first line as a comment. Just extract this line, remove the comment
#and directly execute the make target
%: %.cc Makefile
	@echo "CC   " $@
	@$(shell head -n 1 $@.cc | cut -c 3-)

clean:
	@echo "Cleaning all leetcode programs"
	@rm -f $(patsubst %.cc, %, $(wildcard *.cc))

.PHONY: all clean


text:
@keyframes spinAround {
  from {
    transform: rotate(0deg); }
  to {
    transform: rotate(359deg); } }

.input,
.textarea {
  -moz-appearance: none;
  -webkit-appearance: none;
  align-items: center;
  border: none;
  border-radius: 3px;
  box-shadow: none;
  display: inline-flex;
  font-size: 1rem;
  height: 2.285em;
  justify-content: flex-start;
  line-height: 1.5;
  padding-left: 0.75em;
  padding-right: 0.75em;
  position: relative;
  vertical-align: top;
  background-color: white;
  border: 1px solid #dbdbdb;
  color: #363636;
  box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.1);
  max-width: 100%;
  width: 100%; }
  .input:focus, .input.is-focused, .input:active, .input.is-active,
  .textarea:focus,
  .textarea.is-focused,
  .textarea:active,
  .textarea.is-active {
    outline: none; }
  .input[disabled], .input.is-disabled,
  .textarea[disabled],
  .textarea.is-disabled {
    pointer-events: none; }
  .input:hover, .input.is-hovered,
  .textarea:hover,
  .textarea.is-hovered {
    border-color: #b5b5b5; }
  .input:focus, .input.is-focused, .input:active, .input.is-active,
  .textarea:focus,
  .textarea.is-focused,
  .textarea:active,
  .textarea.is-active {
    border-color: #00d1b2; }
  .input[disabled], .input.is-disabled,
  .textarea[disabled],
  .textarea.is-disabled {
    background-color: whitesmoke;
    border-color: whitesmoke;
    box-shadow: none;
    color: #7a7a7a; }
    .input[disabled]::-moz-placeholder, .input.is-disabled::-moz-placeholder,
    .textarea[disabled]::-moz-placeholder,
    .textarea.is-disabled::-moz-placeholder {
      color: rgba(54, 54, 54, 0.3); }
    .input[disabled]::-webkit-input-placeholder, .input.is-disabled::-webkit-input-placeholder,
    .textarea[disabled]::-webkit-input-placeholder,
    .textarea.is-disabled::-webkit-input-placeholder {
      color: rgba(54, 54, 54, 0.3); }
    .input[disabled]:-moz-placeholder, .input.is-disabled:-moz-placeholder,
    .textarea[disabled]:-moz-placeholder,
    .textarea.is-disabled:-moz-placeholder {
      color: rgba(54, 54, 54, 0.3); }
    .input[disabled]:-ms-input-placeholder, .input.is-disabled:-ms-input-placeholder,
    .textarea[disabled]:-ms-input-placeholder,
    .textarea.is-disabled:-ms-input-placeholder {
      color: rgba(54, 54, 54, 0.3); }
  .input[type="search"],
  .textarea[type="search"] {
    border-radius: 290486px; }
  .input.is-white,
  .textarea.is-white {
    border-color: white; }
  .input.is-black,
  .textarea.is-black {
    border-color: #0a0a0a; }
  .input.is-light,
  .textarea.is-light {
    border-color: whitesmoke; }
  .input.is-dark,
  .textarea.is-dark {
    border-color: #363636; }
  .input.is-primary,
  .textarea.is-primary {
    border-color: #00d1b2; }
  .input.is-info,
  .textarea.is-info {
    border-color: #3273dc; }
  .input.is-success,
  .textarea.is-success {
    border-color: #23d160; }
  .input.is-warning,
  .textarea.is-warning {
    border-color: #ffdd57; }
  .input.is-danger,
  .textarea.is-danger {
    border-color: #ff3860; }
  .input.is-small,
  .textarea.is-small {
    border-radius: 2px;
    font-size: 0.75rem; }
  .input.is-medium,
  .textarea.is-medium {
    font-size: 1.25rem; }
  .input.is-large,
  .textarea.is-large {
    font-size: 1.5rem; }
  .input.is-fullwidth,
  .textarea.is-fullwidth {
    display: block;
    width: 100%; }
  .input.is-inline,
  .textarea.is-inline {
    display: inline;
    width: auto; }

.textarea {
  display: block;
  line-height: 1.25;
  max-height: 600px;
  max-width: 100%;
  min-height: 120px;
  min-width: 100%;
  padding: 10px;
  resize: vertical; }

.checkbox,
.radio {
  align-items: center;
  cursor: pointer;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  position: relative;
  vertical-align: top; }
  .checkbox input,
  .radio input {
    cursor: pointer;
    margin-right: 0.5em; }
  .checkbox:hover,
  .radio:hover {
    color: #363636; }
  .checkbox.is-disabled,
  .radio.is-disabled {
    color: #7a7a7a;
    pointer-events: none; }
    .checkbox.is-disabled input,
    .radio.is-disabled input {
      pointer-events: none; }

.radio + .radio {
  margin-left: 0.5em; }

.select {
  display: inline-block;
  height: 2.5em;
  position: relative;
  vertical-align: top; }
  .select:after {
    border: 1px solid #00d1b2;
    border-right: 0;
    border-top: 0;
    content: " ";
    display: block;
    height: 0.5em;
    pointer-events: none;
    position: absolute;
    transform: rotate(-45deg);
    width: 0.5em;
    margin-top: -0.375em;
    right: 1.125em;
    top: 50%;
    z-index: 4; }
  .select select {
    -moz-appearance: none;
    -webkit-appearance: none;
    align-items: center;
    border: none;
    border-radius: 3px;
    box-shadow: none;
    display: inline-flex;
    font-size: 1rem;
    height: 2.285em;
    justify-content: flex-start;
    line-height: 1.5;
    padding-left: 0.75em;
    padding-right: 0.75em;
    position: relative;
    vertical-align: top;
    background-color: white;
    border: 1px solid #dbdbdb;
    color: #363636;
    cursor: pointer;
    display: block;
    font-size: 1em;
    outline: none;
    padding-right: 2.5em; }
    .select select:focus, .select select.is-focused, .select select:active, .select select.is-active {
      outline: none; }
    .select select[disabled], .select select.is-disabled {
      pointer-events: none; }
    .select select:hover, .select select.is-hovered {
      border-color: #b5b5b5; }
    .select select:focus, .select select.is-focused, .select select:active, .select select.is-active {
      border-color: #00d1b2; }
    .select select[disabled], .select select.is-disabled {
      background-color: whitesmoke;
      border-color: whitesmoke;
      box-shadow: none;
      color: #7a7a7a; }
      .select select[disabled]::-moz-placeholder, .select select.is-disabled::-moz-placeholder {
        color: rgba(54, 54, 54, 0.3); }
      .select select[disabled]::-webkit-input-placeholder, .select select.is-disabled::-webkit-input-placeholder {
        color: rgba(54, 54, 54, 0.3); }
      .select select[disabled]:-moz-placeholder, .select select.is-disabled:-moz-placeholder {
        color: rgba(54, 54, 54, 0.3); }
      .select select[disabled]:-ms-input-placeholder, .select select.is-disabled:-ms-input-placeholder {
        color: rgba(54, 54, 54, 0.3); }
    .select select:hover {
      border-color: #b5b5b5; }
    .select select::ms-expand {
      display: none; }
  .select:hover:after {
    border-color: #363636; }
  .select.is-small {
    border-radius: 2px;
    font-size: 0.75rem; }
  .select.is-medium {
    font-size: 1.25rem; }
  .select.is-large {
    font-size: 1.5rem; }
  .select.is-fullwidth {
    width: 100%; }
    .select.is-fullwidth select {
      width: 100%; }

.label {
  color: #363636;
  display: block;
  font-weight: bold; }
  .label:not(:last-child) {
    margin-bottom: 0.5em; }

.help {
  display: block;
  font-size: 0.75rem;
  margin-top: 5px; }
  .help.is-white {
    color: white; }
  .help.is-black {
    color: #0a0a0a; }
  .help.is-light {
    color: whitesmoke; }
  .help.is-dark {
    color: #363636; }
  .help.is-primary {
    color: #00d1b2; }
  .help.is-info {
    color: #3273dc; }
  .help.is-success {
    color: #23d160; }
  .help.is-warning {
    color: #ffdd57; }
  .help.is-danger {
    color: #ff3860; }

@media screen and (max-width: 768px) {
  .control-label {
    margin-bottom: 0.5em; } }

@media screen and (min-width: 769px) {
  .control-label {
    flex-basis: 0;
    flex-grow: 1;
    flex-shrink: 0;
    margin-right: 1.5em;
    padding-top: 0.5em;
    text-align: right; } }

.control {
  position: relative;
  text-align: left; }
  .control:not(:last-child) {
    margin-bottom: 0.75rem; }
  .control.has-addons {
    display: flex;
    justify-content: flex-start; }
    .control.has-addons .button,
    .control.has-addons .input,
    .control.has-addons .select {
      border-radius: 0;
      margin-right: -1px;
      width: auto; }
      .control.has-addons .button:hover,
      .control.has-addons .input:hover,
      .control.has-addons .select:hover {
        z-index: 2; }
      .control.has-addons .button:focus, .control.has-addons .button:active,
      .control.has-addons .input:focus,
      .control.has-addons .input:active,
      .control.has-addons .select:focus,
      .control.has-addons .select:active {
        z-index: 3; }
      .control.has-addons .button:first-child,
      .control.has-addons .input:first-child,
      .control.has-addons .select:first-child {
        border-radius: 3px 0 0 3px; }
        .control.has-addons .button:first-child select,
        .control.has-addons .input:first-child select,
        .control.has-addons .select:first-child select {
          border-radius: 3px 0 0 3px; }
      .control.has-addons .button:last-child,
      .control.has-addons .input:last-child,
      .control.has-addons .select:last-child {
        border-radius: 0 3px 3px 0; }
        .control.has-addons .button:last-child select,
        .control.has-addons .input:last-child select,
        .control.has-addons .select:last-child select {
          border-radius: 0 3px 3px 0; }
      .control.has-addons .button.is-expanded,
      .control.has-addons .input.is-expanded,
      .control.has-addons .select.is-expanded {
        flex-grow: 1;
        flex-shrink: 0; }
    .control.has-addons .select select:hover {
      z-index: 2; }
    .control.has-addons .select select:focus, .control.has-addons .select select:active {
      z-index: 3; }
    .control.has-addons.has-addons-centered {
      justify-content: center; }
    .control.has-addons.has-addons-right {
      justify-content: flex-end; }
    .control.has-addons.has-addons-fullwidth .button,
    .control.has-addons.has-addons-fullwidth .input,
    .control.has-addons.has-addons-fullwidth .select {
      flex-grow: 1;
      flex-shrink: 0; }
  .control.has-icon .icon {
    color: #dbdbdb;
    pointer-events: none;
    position: absolute;
    top: 1.25rem;
    z-index: 4; }
  .control.has-icon .input:focus + .icon {
    color: #7a7a7a; }
  .control.has-icon .input.is-small + .icon {
    top: 0.9375rem; }
  .control.has-icon .input.is-medium + .icon {
    top: 1.5625rem; }
  .control.has-icon .input.is-large + .icon {
    top: 1.875rem; }
  .control.has-icon:not(.has-icon-right) .icon {
    left: 1.25rem;
    transform: translateX(-50%) translateY(-50%); }
  .control.has-icon:not(.has-icon-right) .input {
    padding-left: 2.5em; }
    .control.has-icon:not(.has-icon-right) .input.is-small + .icon {
      left: 0.9375rem; }
    .control.has-icon:not(.has-icon-right) .input.is-medium + .icon {
      left: 1.5625rem; }
    .control.has-icon:not(.has-icon-right) .input.is-large + .icon {
      left: 1.875rem; }
  .control.has-icon.has-icon-right .icon {
    right: 1.25rem;
    transform: translateX(50%) translateY(-50%); }
  .control.has-icon.has-icon-right .input {
    padding-right: 2.5em; }
    .control.has-icon.has-icon-right .input.is-small + .icon {
      right: 0.9375rem; }
    .control.has-icon.has-icon-right .input.is-medium + .icon {
      right: 1.5625rem; }
    .control.has-icon.has-icon-right .input.is-large + .icon {
      right: 1.875rem; }
  .control.is-grouped {
    display: flex;
    justify-content: flex-start; }
    .control.is-grouped > .control {
      flex-basis: 0;
      flex-shrink: 0; }
      .control.is-grouped > .control:not(:last-child) {
        margin-bottom: 0;
        margin-right: 0.75rem; }
      .control.is-grouped > .control.is-expanded {
        flex-grow: 1;
        flex-shrink: 1; }
    .control.is-grouped.is-grouped-centered {
      justify-content: center; }
    .control.is-grouped.is-grouped-right {
      justify-content: flex-end; }
  @media screen and (min-width: 769px) {
    .control.is-horizontal {
      display: flex; }
      .control.is-horizontal > .control {
        display: flex;
        flex-basis: 0;
        flex-grow: 5;
        flex-shrink: 1; } }
  .control.is-loading:after {
    animation: spinAround 500ms infinite linear;
    border: 2px solid #dbdbdb;
    border-radius: 290486px;
    border-right-color: transparent;
    border-top-color: transparent;
    content: "";
    display: block;
    height: 1rem;
    position: relative;
    width: 1rem;
    position: absolute !important;
    right: 0.75em;
    top: 0.75em; }

.button {
  -moz-appearance: none;
  -webkit-appearance: none;
  align-items: center;
  border: none;
  border-radius: 3px;
  box-shadow: none;
  display: inline-flex;
  font-size: 1rem;
  height: 2.285em;
  justify-content: flex-start;
  line-height: 1.5;
  padding-left: 0.75em;
  padding-right: 0.75em;
  position: relative;
  vertical-align: top;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  background-color: white;
  border: 1px solid #dbdbdb;
  color: #363636;
  cursor: pointer;
  justify-content: center;
  padding-left: 0.75em;
  padding-right: 0.75em;
  text-align: center;
  white-space: nowrap; }
  .button:focus, .button.is-focused, .button:active, .button.is-active {
    outline: none; }
  .button[disabled], .button.is-disabled {
    pointer-events: none; }
  .button strong {
    color: inherit; }
  .button .icon:first-child:not(:last-child) {
    margin-left: -0.25rem;
    margin-right: 0.5rem; }
  .button .icon:last-child:not(:first-child) {
    margin-left: 0.5rem;
    margin-right: -0.25rem; }
  .button .icon:first-child:last-child {
    margin-left: calc(-1px + -0.25rem);
    margin-right: calc(-1px + -0.25rem); }
  .button .icon.is-small:first-child:not(:last-child) {
    margin-left: 0rem; }
  .button .icon.is-small:last-child:not(:first-child) {
    margin-right: 0rem; }
  .button .icon.is-small:first-child:last-child {
    margin-left: calc(-1px + 0rem);
    margin-right: calc(-1px + 0rem); }
  .button .icon.is-medium:first-child:not(:last-child) {
    margin-left: -0.5rem; }
  .button .icon.is-medium:last-child:not(:first-child) {
    margin-right: -0.5rem; }
  .button .icon.is-medium:first-child:last-child {
    margin-left: calc(-1px + -0.5rem);
    margin-right: calc(-1px + -0.5rem); }
  .button .icon.is-large:first-child:not(:last-child) {
    margin-left: -1rem; }
  .button .icon.is-large:last-child:not(:first-child) {
    margin-right: -1rem; }
  .button .icon.is-large:first-child:last-child {
    margin-left: calc(-1px + -1rem);
    margin-right: calc(-1px + -1rem); }
  .button:hover, .button.is-hovered {
    border-color: #b5b5b5;
    color: #363636; }
  .button:focus, .button.is-focused {
    border-color: #00d1b2;
    box-shadow: 0 0 0.5em rgba(0, 209, 178, 0.25);
    color: #363636; }
  .button:active, .button.is-active {
    border-color: #4a4a4a;
    box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.2);
    color: #363636; }
  .button.is-link {
    background-color: transparent;
    border-color: transparent;
    color: #4a4a4a;
    text-decoration: underline; }
    .button.is-link:hover, .button.is-link.is-hovered, .button.is-link:focus, .button.is-link.is-focused, .button.is-link:active, .button.is-link.is-active {
      background-color: whitesmoke;
      color: #363636; }
  .button.is-white {
    background-color: white;
    border-color: transparent;
    color: #0a0a0a; }
    .button.is-white:hover, .button.is-white.is-hovered {
      background-color: #f9f9f9;
      border-color: transparent;
      color: #0a0a0a; }
    .button.is-white:focus, .button.is-white.is-focused {
      border-color: transparent;
      box-shadow: 0 0 0.5em rgba(255, 255, 255, 0.25);
      color: #0a0a0a; }
    .button.is-white:active, .button.is-white.is-active {
      background-color: #f2f2f2;
      border-color: transparent;
      box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.2);
      color: #0a0a0a; }
    .button.is-white.is-inverted {
      background-color: #0a0a0a;
      color: white; }
      .button.is-white.is-inverted:hover {
        background-color: black; }
    .button.is-white.is-loading:after {
      border-color: transparent transparent #0a0a0a #0a0a0a !important; }
    .button.is-white.is-outlined {
      background-color: transparent;
      border-color: white;
      color: white; }
      .button.is-white.is-outlined:hover, .button.is-white.is-outlined:focus {
        background-color: white;
        border-color: white;
        color: #0a0a0a; }
    .button.is-white.is-inverted.is-outlined {
      background-color: transparent;
      border-color: #0a0a0a;
      color: #0a0a0a; }
      .button.is-white.is-inverted.is-outlined:hover, .button.is-white.is-inverted.is-outlined:focus {
        background-color: #0a0a0a;
        color: white; }
  .button.is-black {
    background-color: #0a0a0a;
    border-color: transparent;
    color: white; }
    .button.is-black:hover, .button.is-black.is-hovered {
      background-color: #040404;
      border-color: transparent;
      color: white; }
    .button.is-black:focus, .button.is-black.is-focused {
      border-color: transparent;
      box-shadow: 0 0 0.5em rgba(10, 10, 10, 0.25);
      color: white; }
    .button.is-black:active, .button.is-black.is-active {
      background-color: black;
      border-color: transparent;
      box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.2);
      color: white; }
    .button.is-black.is-inverted {
      background-color: white;
      color: #0a0a0a; }
      .button.is-black.is-inverted:hover {
        background-color: #f2f2f2; }
    .button.is-black.is-loading:after {
      border-color: transparent transparent white white !important; }
    .button.is-black.is-outlined {
      background-color: transparent;
      border-color: #0a0a0a;
      color: #0a0a0a; }
      .button.is-black.is-outlined:hover, .button.is-black.is-outlined:focus {
        background-color: #0a0a0a;
        border-color: #0a0a0a;
        color: white; }
    .button.is-black.is-inverted.is-outlined {
      background-color: transparent;
      border-color: white;
      color: white; }
      .button.is-black.is-inverted.is-outlined:hover, .button.is-black.is-inverted.is-outlined:focus {
        background-color: white;
        color: #0a0a0a; }
  .button.is-light {
    background-color: whitesmoke;
    border-color: transparent;
    color: #363636; }
    .button.is-light:hover, .button.is-light.is-hovered {
      background-color: #eeeeee;
      border-color: transparent;
      color: #363636; }
    .button.is-light:focus, .button.is-light.is-focused {
      border-color: transparent;
      box-shadow: 0 0 0.5em rgba(245, 245, 245, 0.25);
      color: #363636; }
    .button.is-light:active, .button.is-light.is-active {
      background-color: #e8e8e8;
      border-color: transparent;
      box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.2);
      color: #363636; }
    .button.is-light.is-inverted {
      background-color: #363636;
      color: whitesmoke; }
      .button.is-light.is-inverted:hover {
        background-color: #292929; }
    .button.is-light.is-loading:after {
      border-color: transparent transparent #363636 #363636 !important; }
    .button.is-light.is-outlined {
      background-color: transparent;
      border-color: whitesmoke;
      color: whitesmoke; }
      .button.is-light.is-outlined:hover, .button.is-light.is-outlined:focus {
        background-color: whitesmoke;
        border-color: whitesmoke;
        color: #363636; }
    .button.is-light.is-inverted.is-outlined {
      background-color: transparent;
      border-color: #363636;
      color: #363636; }
      .button.is-light.is-inverted.is-outlined:hover, .button.is-light.is-inverted.is-outlined:focus {
        background-color: #363636;
        color: whitesmoke; }
  .button.is-dark {
    background-color: #363636;
    border-color: transparent;
    color: whitesmoke; }
    .button.is-dark:hover, .button.is-dark.is-hovered {
      background-color: #2f2f2f;
      border-color: transparent;
      color: whitesmoke; }
    .button.is-dark:focus, .button.is-dark.is-focused {
      border-color: transparent;
      box-shadow: 0 0 0.5em rgba(54, 54, 54, 0.25);
      color: whitesmoke; }
    .button.is-dark:active, .button.is-dark.is-active {
      background-color: #292929;
      border-color: transparent;
      box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.2);
      color: whitesmoke; }
    .button.is-dark.is-inverted {
      background-color: whitesmoke;
      color: #363636; }
      .button.is-dark.is-inverted:hover {
        background-color: #e8e8e8; }
    .button.is-dark.is-loading:after {
      border-color: transparent transparent whitesmoke whitesmoke !important; }
    .button.is-dark.is-outlined {
      background-color: transparent;
      border-color: #363636;
      color: #363636; }
      .button.is-dark.is-outlined:hover, .button.is-dark.is-outlined:focus {
        background-color: #363636;
        border-color: #363636;
        color: whitesmoke; }
    .button.is-dark.is-inverted.is-outlined {
      background-color: transparent;
      border-color: whitesmoke;
      color: whitesmoke; }
      .button.is-dark.is-inverted.is-outlined:hover, .button.is-dark.is-inverted.is-outlined:focus {
        background-color: whitesmoke;
        color: #363636; }
  .button.is-primary {
    background-color: #00d1b2;
    border-color: transparent;
    color: #fff; }
    .button.is-primary:hover, .button.is-primary.is-hovered {
      background-color: #00c4a7;
      border-color: transparent;
      color: #fff; }
    .button.is-primary:focus, .button.is-primary.is-focused {
      border-color: transparent;
      box-shadow: 0 0 0.5em rgba(0, 209, 178, 0.25);
      color: #fff; }
    .button.is-primary:active, .button.is-primary.is-active {
      background-color: #00b89c;
      border-color: transparent;
      box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.2);
      color: #fff; }
    .button.is-primary.is-inverted {
      background-color: #fff;
      color: #00d1b2; }
      .button.is-primary.is-inverted:hover {
        background-color: #f2f2f2; }
    .button.is-primary.is-loading:after {
      border-color: transparent transparent #fff #fff !important; }
    .button.is-primary.is-outlined {
      background-color: transparent;
      border-color: #00d1b2;
      color: #00d1b2; }
      .button.is-primary.is-outlined:hover, .button.is-primary.is-outlined:focus {
        background-color: #00d1b2;
        border-color: #00d1b2;
        color: #fff; }
    .button.is-primary.is-inverted.is-outlined {
      background-color: transparent;
      border-color: #fff;
      color: #fff; }
      .button.is-primary.is-inverted.is-outlined:hover, .button.is-primary.is-inverted.is-outlined:focus {
        background-color: #fff;
        color: #00d1b2; }
  .button.is-info {
    background-color: #3273dc;
    border-color: transparent;
    color: #fff; }
    .button.is-info:hover, .button.is-info.is-hovered {
      background-color: #276cda;
      border-color: transparent;
      color: #fff; }
    .button.is-info:focus, .button.is-info.is-focused {
      border-color: transparent;
      box-shadow: 0 0 0.5em rgba(50, 115, 220, 0.25);
      color: #fff; }
    .button.is-info:active, .button.is-info.is-active {
      background-color: #2366d1;
      border-color: transparent;
      box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.2);
      color: #fff; }
    .button.is-info.is-inverted {
      background-color: #fff;
      color: #3273dc; }
      .button.is-info.is-inverted:hover {
        background-color: #f2f2f2; }
    .button.is-info.is-loading:after {
      border-color: transparent transparent #fff #fff !important; }
    .button.is-info.is-outlined {
      background-color: transparent;
      border-color: #3273dc;
      color: #3273dc; }
      .button.is-info.is-outlined:hover, .button.is-info.is-outlined:focus {
        background-color: #3273dc;
        border-color: #3273dc;
        color: #fff; }
    .button.is-info.is-inverted.is-outlined {
      background-color: transparent;
      border-color: #fff;
      color: #fff; }
      .button.is-info.is-inverted.is-outlined:hover, .button.is-info.is-inverted.is-outlined:focus {
        background-color: #fff;
        color: #3273dc; }
  .button.is-success {
    background-color: #23d160;
    border-color: transparent;
    color: #fff; }
    .button.is-success:hover, .button.is-success.is-hovered {
      background-color: #22c65b;
      border-color: transparent;
      color: #fff; }
    .button.is-success:focus, .button.is-success.is-focused {
      border-color: transparent;
      box-shadow: 0 0 0.5em rgba(35, 209, 96, 0.25);
      color: #fff; }
    .button.is-success:active, .button.is-success.is-active {
      background-color: #20bc56;
      border-color: transparent;
      box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.2);
      color: #fff; }
    .button.is-success.is-inverted {
      background-color: #fff;
      color: #23d160; }
      .button.is-success.is-inverted:hover {
        background-color: #f2f2f2; }
    .button.is-success.is-loading:after {
      border-color: transparent transparent #fff #fff !important; }
    .button.is-success.is-outlined {
      background-color: transparent;
      border-color: #23d160;
      color: #23d160; }
      .button.is-success.is-outlined:hover, .button.is-success.is-outlined:focus {
        background-color: #23d160;
        border-color: #23d160;
        color: #fff; }
    .button.is-success.is-inverted.is-outlined {
      background-color: transparent;
      border-color: #fff;
      color: #fff; }
      .button.is-success.is-inverted.is-outlined:hover, .button.is-success.is-inverted.is-outlined:focus {
        background-color: #fff;
        color: #23d160; }
  .button.is-warning {
    background-color: #ffdd57;
    border-color: transparent;
    color: rgba(0, 0, 0, 0.7); }
    .button.is-warning:hover, .button.is-warning.is-hovered {
      background-color: #ffdb4a;
      border-color: transparent;
      color: rgba(0, 0, 0, 0.7); }
    .button.is-warning:focus, .button.is-warning.is-focused {
      border-color: transparent;
      box-shadow: 0 0 0.5em rgba(255, 221, 87, 0.25);
      color: rgba(0, 0, 0, 0.7); }
    .button.is-warning:active, .button.is-warning.is-active {
      background-color: #ffd83d;
      border-color: transparent;
      box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.2);
      color: rgba(0, 0, 0, 0.7); }
    .button.is-warning.is-inverted {
      background-color: rgba(0, 0, 0, 0.7);
      color: #ffdd57; }
      .button.is-warning.is-inverted:hover {
        background-color: rgba(0, 0, 0, 0.7); }
    .button.is-warning.is-loading:after {
      border-color: transparent transparent rgba(0, 0, 0, 0.7) rgba(0, 0, 0, 0.7) !important; }
    .button.is-warning.is-outlined {
      background-color: transparent;
      border-color: #ffdd57;
      color: #ffdd57; }
      .button.is-warning.is-outlined:hover, .button.is-warning.is-outlined:focus {
        background-color: #ffdd57;
        border-color: #ffdd57;
        color: rgba(0, 0, 0, 0.7); }
    .button.is-warning.is-inverted.is-outlined {
      background-color: transparent;
      border-color: rgba(0, 0, 0, 0.7);
      color: rgba(0, 0, 0, 0.7); }
      .button.is-warning.is-inverted.is-outlined:hover, .button.is-warning.is-inverted.is-outlined:focus {
        background-color: rgba(0, 0, 0, 0.7);
        color: #ffdd57; }
  .button.is-danger {
    background-color: #ff3860;
    border-color: transparent;
    color: #fff; }
    .button.is-danger:hover, .button.is-danger.is-hovered {
      background-color: #ff2b56;
      border-color: transparent;
      color: #fff; }
    .button.is-danger:focus, .button.is-danger.is-focused {
      border-color: transparent;
      box-shadow: 0 0 0.5em rgba(255, 56, 96, 0.25);
      color: #fff; }
    .button.is-danger:active, .button.is-danger.is-active {
      background-color: #ff1f4b;
      border-color: transparent;
      box-shadow: inset 0 1px 2px rgba(10, 10, 10, 0.2);
      color: #fff; }
    .button.is-danger.is-inverted {
      background-color: #fff;
      color: #ff3860; }
      .button.is-danger.is-inverted:hover {
        background-color: #f2f2f2; }
    .button.is-danger.is-loading:after {
      border-color: transparent transparent #fff #fff !important; }
    .button.is-danger.is-outlined {
      background-color: transparent;
      border-color: #ff3860;
      color: #ff3860; }
      .button.is-danger.is-outlined:hover, .button.is-danger.is-outlined:focus {
        background-color: #ff3860;
        border-color: #ff3860;
        color: #fff; }
    .button.is-danger.is-inverted.is-outlined {
      background-color: transparent;
      border-color: #fff;
      color: #fff; }
      .button.is-danger.is-inverted.is-outlined:hover, .button.is-danger.is-inverted.is-outlined:focus {
        background-color: #fff;
        color: #ff3860; }
  .button.is-small {
    border-radius: 2px;
    font-size: 0.75rem; }
    .button.is-small .icon:first-child:not(:last-child) {
      margin-left: -0.375rem;
      margin-right: 0.375rem; }
    .button.is-small .icon:last-child:not(:first-child) {
      margin-left: 0.375rem;
      margin-right: -0.375rem; }
    .button.is-small .icon:first-child:last-child {
      margin-left: calc(-1px + -0.375rem);
      margin-right: calc(-1px + -0.375rem); }
    .button.is-small .icon.is-small:first-child:not(:last-child) {
      margin-left: -0.125rem; }
    .button.is-small .icon.is-small:last-child:not(:first-child) {
      margin-right: -0.125rem; }
    .button.is-small .icon.is-small:first-child:last-child {
      margin-left: calc(-1px + -0.125rem);
      margin-right: calc(-1px + -0.125rem); }
    .button.is-small .icon.is-medium:first-child:not(:last-child) {
      margin-left: -0.625rem; }
    .button.is-small .icon.is-medium:last-child:not(:first-child) {
      margin-right: -0.625rem; }
    .button.is-small .icon.is-medium:first-child:last-child {
      margin-left: calc(-1px + -0.625rem);
      margin-right: calc(-1px + -0.625rem); }
    .button.is-small .icon.is-large:first-child:not(:last-child) {
      margin-left: -1.125rem; }
    .button.is-small .icon.is-large:last-child:not(:first-child) {
      margin-right: -1.125rem; }
    .button.is-small .icon.is-large:first-child:last-child {
      margin-left: calc(-1px + -1.125rem);
      margin-right: calc(-1px + -1.125rem); }
  .button.is-medium {
    font-size: 1.25rem; }
    .button.is-medium .icon:first-child:not(:last-child) {
      margin-left: -0.125rem;
      margin-right: 0.625rem; }
    .button.is-medium .icon:last-child:not(:first-child) {
      margin-left: 0.625rem;
      margin-right: -0.125rem; }
    .button.is-medium .icon:first-child:last-child {
      margin-left: calc(-1px + -0.125rem);
      margin-right: calc(-1px + -0.125rem); }
    .button.is-medium .icon.is-small:first-child:not(:last-child) {
      margin-left: 0.125rem; }
    .button.is-medium .icon.is-small:last-child:not(:first-child) {
      margin-right: 0.125rem; }
    .button.is-medium .icon.is-small:first-child:last-child {
      margin-left: calc(-1px + 0.125rem);
      margin-right: calc(-1px + 0.125rem); }
    .button.is-medium .icon.is-medium:first-child:not(:last-child) {
      margin-left: -0.375rem; }
    .button.is-medium .icon.is-medium:last-child:not(:first-child) {
      margin-right: -0.375rem; }
    .button.is-medium .icon.is-medium:first-child:last-child {
      margin-left: calc(-1px + -0.375rem);
      margin-right: calc(-1px + -0.375rem); }
    .button.is-medium .icon.is-large:first-child:not(:last-child) {
      margin-left: -0.875rem; }
    .button.is-medium .icon.is-large:last-child:not(:first-child) {
      margin-right: -0.875rem; }
    .button.is-medium .icon.is-large:first-child:last-child {
      margin-left: calc(-1px + -0.875rem);
      margin-right: calc(-1px + -0.875rem); }
  .button.is-large {
    font-size: 1.5rem; }
    .button.is-large .icon:first-child:not(:last-child) {
      margin-left: 0rem;
      margin-right: 0.75rem; }
    .button.is-large .icon:last-child:not(:first-child) {
      margin-left: 0.75rem;
      margin-right: 0rem; }
    .button.is-large .icon:first-child:last-child {
      margin-left: calc(-1px + 0rem);
      margin-right: calc(-1px + 0rem); }
    .button.is-large .icon.is-small:first-child:not(:last-child) {
      margin-left: 0.25rem; }
    .button.is-large .icon.is-small:last-child:not(:first-child) {
      margin-right: 0.25rem; }
    .button.is-large .icon.is-small:first-child:last-child {
      margin-left: calc(-1px + 0.25rem);
      margin-right: calc(-1px + 0.25rem); }
    .button.is-large .icon.is-medium:first-child:not(:last-child) {
      margin-left: -0.25rem; }
    .button.is-large .icon.is-medium:last-child:not(:first-child) {
      margin-right: -0.25rem; }
    .button.is-large .icon.is-medium:first-child:last-child {
      margin-left: calc(-1px + -0.25rem);
      margin-right: calc(-1px + -0.25rem); }
    .button.is-large .icon.is-large:first-child:not(:last-child) {
      margin-left: -0.75rem; }
    .button.is-large .icon.is-large:last-child:not(:first-child) {
      margin-right: -0.75rem; }
    .button.is-large .icon.is-large:first-child:last-child {
      margin-left: calc(-1px + -0.75rem);
      margin-right: calc(-1px + -0.75rem); }
  .button[disabled], .button.is-disabled {
    opacity: 0.5; }
  .button.is-fullwidth {
    display: flex;
    width: 100%; }
  .button.is-loading {
    color: transparent !important;
    pointer-events: none; }
    .button.is-loading:after {
      animation: spinAround 500ms infinite linear;
      border: 2px solid #dbdbdb;
      border-radius: 290486px;
      border-right-color: transparent;
      border-top-color: transparent;
      content: "";
      display: block;
      height: 1rem;
      position: relative;
      width: 1rem;
      left: 50%;
      margin-left: -8px;
      margin-top: -8px;
      position: absolute;
      top: 50%;
      position: absolute !important; }

.resp-sharing-button__link,
.resp-sharing-button__icon {
  display: inline-block; }

.resp-sharing-button__link {
  text-decoration: none;
  color: #fff;
  margin: 0.5em; }

.resp-sharing-button {
  border-radius: 5px;
  transition: 25ms ease-out;
  padding: 0.5em 0.75em;
  font-family: Helvetica Neue,Helvetica,Arial,sans-serif; }

.resp-sharing-button__icon svg {
  width: 1.5em;
  height: 1.5em;
  margin-right: 0.5em;
  vertical-align: top; }

.resp-sharing-button--small svg {
  margin: 0;
  vertical-align: middle; }

/* Non solid icons get a stroke */
.resp-sharing-button__icon {
  stroke: #fff;
  fill: none; }

/* Solid icons get a fill */
.resp-sharing-button__icon--solid,
.resp-sharing-button__icon--solidcircle {
  fill: #fff;
  stroke: none; }

.resp-sharing-button--twitter {
  background-color: #55acee; }

.resp-sharing-button--twitter:hover {
  background-color: #2795e9; }

.resp-sharing-button--pinterest {
  background-color: #bd081c; }

.resp-sharing-button--pinterest:hover {
  background-color: #8c0615; }

.resp-sharing-button--facebook {
  background-color: #3b5998; }

.resp-sharing-button--facebook:hover {
  background-color: #2d4373; }

.resp-sharing-button--tumblr {
  background-color: #35465C; }

.resp-sharing-button--tumblr:hover {
  background-color: #222d3c; }

.resp-sharing-button--reddit {
  background-color: #5f99cf; }

.resp-sharing-button--reddit:hover {
  background-color: #3a80c1; }

.resp-sharing-button--google {
  background-color: #dd4b39; }

.resp-sharing-button--google:hover {
  background-color: #c23321; }

.resp-sharing-button--linkedin {
  background-color: #0077b5; }

.resp-sharing-button--linkedin:hover {
  background-color: #046293; }

.resp-sharing-button--email {
  background-color: #777; }

.resp-sharing-button--email:hover {
  background-color: #5e5e5e; }

.resp-sharing-button--xing {
  background-color: #1a7576; }

.resp-sharing-button--xing:hover {
  background-color: #114c4c; }

.resp-sharing-button--whatsapp {
  background-color: #25D366; }

.resp-sharing-button--whatsapp:hover {
  background-color: #1da851; }

.resp-sharing-button--hackernews {
  background-color: #FF6600; }

.resp-sharing-button--hackernews:hover, .resp-sharing-button--hackernews:focus {
  background-color: #FB6200; }

.resp-sharing-button--vk {
  background-color: #507299; }

.resp-sharing-button--vk:hover {
  background-color: #43648c; }

.resp-sharing-button--facebook {
  background-color: #3b5998;
  border-color: #3b5998; }

.resp-sharing-button--facebook:hover,
.resp-sharing-button--facebook:active {
  background-color: #2d4373;
  border-color: #2d4373; }

.resp-sharing-button--twitter {
  background-color: #55acee;
  border-color: #55acee; }

.resp-sharing-button--twitter:hover,
.resp-sharing-button--twitter:active {
  background-color: #2795e9;
  border-color: #2795e9; }

.resp-sharing-button--google {
  background-color: #dd4b39;
  border-color: #dd4b39; }

.resp-sharing-button--google:hover,
.resp-sharing-button--google:active {
  background-color: #c23321;
  border-color: #c23321; }

.resp-sharing-button--email {
  background-color: #777777;
  border-color: #777777; }

.resp-sharing-button--email:hover,
.resp-sharing-button--email:active {
  background-color: #5e5e5e;
  border-color: #5e5e5e; }

.resp-sharing-button--linkedin {
  background-color: #0077b5;
  border-color: #0077b5; }

.resp-sharing-button--linkedin:hover,
.resp-sharing-button--linkedin:active {
  background-color: #046293;
  border-color: #046293; }

.sharing {
  display: flex;
  justify-content: center;
  background-color: #eee;
  border: 3px solid #ddd;
  padding: 12px 10px;
  border-radius: 3px; }

body {
  height: 100vh;
  background-color: #14317b;
  background-image: url("/img/site-bg2.jpg");
  background-size: cover; }

.wrapper {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center; }
  @media (max-width: 767px) {
    .wrapper {
      height: auto; } }

.container {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 6px;
  padding: 50px;
  max-width: 600px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.39), 0 6px 6px rgba(0, 0, 0, 0.43);
  margin: 30px; }
  @media (max-width: 768px) {
    .container {
      padding: 15px; } }

p {
  font-size: 18px;
  color: #444;
  text-align: center; }

h3 {
  text-transform: uppercase;
  text-align: center;
  color: #999;
  font-weight: 300;
  font-size: 27px;
  margin-top: 0; }
  @media (max-width: 768px) {
    h3 {
      font-size: 18px; } }

.title {
  text-align: center;
  font-size: 8em;
  text-transform: uppercase;
  font-family: "Oswald", sans-serif;
  color: #444;
  font-weight: 700;
  margin: 0;
  line-height: 1.3em; }
  @media (max-width: 768px) {
    .title {
      font-size: 4.5em; } }
  @media (max-width: 320px) {
    .title {
      font-size: 3em; } }
  .title a {
    text-decoration: none;
    color: #444; }

.scriptfont {
  font-family: "Bangers", cursive;
  font-size: 1.22em;
  color: #f56061; }

#mc_embed_signup,
#mc_embed_signup #mc-embedded-subscribe-form div.mce_inline_error {
  background: none;
  background-color: none; }

#mc_embed_signup .button {
  background: #f56061;
  width: 96%;
  padding: 25px 22px;
  line-height: 0;
  text-transform: uppercase;
  font-size: 1.1em;
  letter-spacing: .05em;
  font-weight: bold; }
  #mc_embed_signup .button:hover {
    background: #dd4142; }


text:
layout: post
title: "Hello World"
author: Awen
date: 2016-03-27 19:33:45 -0700
categories: test
---

This is my first post on [awen.io](https://awen.io). I plan on occasionally documenting projects that I am working on. Watch this space.

--Awen


text:
package info.ineighborhood.cardme.vcard.errors;

/**
 * Copyright (c) 2004, Neighborhood Technologies
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 *
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * Neither the name of Neighborhood Technologies nor the names of its contributors
 * may be used to endorse or promote products derived from this software
 * without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/**
 *
 * @author Georges El-Haddad
 * @author Jeff Prickett
 *

 * Aug 9, 2006
 *
 */
public class VCardException extends RuntimeException {

	/**
	 *
UID for serialization.

	 */
	private static final long serialVersionUID = -9211462689626599334L;

	/**
	 *
Constructor for a VCard Exception

	 *
	 * @param description
	 */
	public VCardException(String description) {
		super(description);

	}

	public VCardException(String description, Throwable throwable) {
		super(description, throwable);
	}
}


text:
/*************************************************************************/
/*  rigid_body_bullet.cpp                                                */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#include "rigid_body_bullet.h"

#include "btRayShape.h"
#include "bullet_physics_server.h"
#include "bullet_types_converter.h"
#include "bullet_utilities.h"
#include "godot_motion_state.h"
#include "joint_bullet.h"

#include <BulletCollision/CollisionDispatch/btGhostObject.h>
#include <BulletCollision/CollisionShapes/btConvexPointCloudShape.h>
#include <BulletDynamics/Dynamics/btRigidBody.h>
#include <btBulletCollisionCommon.h>

#include <assert.h>

/**
	@author AndreaCatania
*/

Vector3 BulletPhysicsDirectBodyState::get_total_gravity() const {
	Vector3 gVec;
	B_TO_G(body->btBody->getGravity(), gVec);
	return gVec;
}

float BulletPhysicsDirectBodyState::get_total_angular_damp() const {
	return body->btBody->getAngularDamping();
}

float BulletPhysicsDirectBodyState::get_total_linear_damp() const {
	return body->btBody->getLinearDamping();
}

Vector3 BulletPhysicsDirectBodyState::get_center_of_mass() const {
	Vector3 gVec;
	B_TO_G(body->btBody->getCenterOfMassPosition(), gVec);
	return gVec;
}

Basis BulletPhysicsDirectBodyState::get_principal_inertia_axes() const {
	return Basis();
}

float BulletPhysicsDirectBodyState::get_inverse_mass() const {
	return body->btBody->getInvMass();
}

Vector3 BulletPhysicsDirectBodyState::get_inverse_inertia() const {
	Vector3 gVec;
	B_TO_G(body->btBody->getInvInertiaDiagLocal(), gVec);
	return gVec;
}

Basis BulletPhysicsDirectBodyState::get_inverse_inertia_tensor() const {
	Basis gInertia;
	B_TO_G(body->btBody->getInvInertiaTensorWorld(), gInertia);
	return gInertia;
}

void BulletPhysicsDirectBodyState::set_linear_velocity(const Vector3 &p_velocity) {
	body->set_linear_velocity(p_velocity);
}

Vector3 BulletPhysicsDirectBodyState::get_linear_velocity() const {
	return body->get_linear_velocity();
}

void BulletPhysicsDirectBodyState::set_angular_velocity(const Vector3 &p_velocity) {
	body->set_angular_velocity(p_velocity);
}

Vector3 BulletPhysicsDirectBodyState::get_angular_velocity() const {
	return body->get_angular_velocity();
}

void BulletPhysicsDirectBodyState::set_transform(const Transform &p_transform) {
	body->set_transform(p_transform);
}

Transform BulletPhysicsDirectBodyState::get_transform() const {
	return body->get_transform();
}

Vector3 BulletPhysicsDirectBodyState::get_velocity_at_local_position(const Vector3 &p_position) const {
	btVector3 local_position;
	G_TO_B(p_position, local_position);

	Vector3 velocity;
	B_TO_G(body->btBody->getVelocityInLocalPoint(local_position), velocity);

	return velocity;
}

void BulletPhysicsDirectBodyState::add_central_force(const Vector3 &p_force) {
	body->apply_central_force(p_force);
}

void BulletPhysicsDirectBodyState::add_force(const Vector3 &p_force, const Vector3 &p_pos) {
	body->apply_force(p_force, p_pos);
}

void BulletPhysicsDirectBodyState::add_torque(const Vector3 &p_torque) {
	body->apply_torque(p_torque);
}

void BulletPhysicsDirectBodyState::apply_central_impulse(const Vector3 &p_impulse) {
	body->apply_central_impulse(p_impulse);
}

void BulletPhysicsDirectBodyState::apply_impulse(const Vector3 &p_pos, const Vector3 &p_impulse) {
	body->apply_impulse(p_pos, p_impulse);
}

void BulletPhysicsDirectBodyState::apply_torque_impulse(const Vector3 &p_impulse) {
	body->apply_torque_impulse(p_impulse);
}

void BulletPhysicsDirectBodyState::set_sleep_state(bool p_enable) {
	body->set_activation_state(p_enable);
}

bool BulletPhysicsDirectBodyState::is_sleeping() const {
	return !body->is_active();
}

int BulletPhysicsDirectBodyState::get_contact_count() const {
	return body->collisionsCount;
}

Vector3 BulletPhysicsDirectBodyState::get_contact_local_position(int p_contact_idx) const {
	return body->collisions[p_contact_idx].hitLocalLocation;
}

Vector3 BulletPhysicsDirectBodyState::get_contact_local_normal(int p_contact_idx) const {
	return body->collisions[p_contact_idx].hitNormal;
}

float BulletPhysicsDirectBodyState::get_contact_impulse(int p_contact_idx) const {
	return body->collisions[p_contact_idx].appliedImpulse;
}

int BulletPhysicsDirectBodyState::get_contact_local_shape(int p_contact_idx) const {
	return body->collisions[p_contact_idx].local_shape;
}

RID BulletPhysicsDirectBodyState::get_contact_collider(int p_contact_idx) const {
	return body->collisions[p_contact_idx].otherObject->get_self();
}

Vector3 BulletPhysicsDirectBodyState::get_contact_collider_position(int p_contact_idx) const {
	return body->collisions[p_contact_idx].hitWorldLocation;
}

ObjectID BulletPhysicsDirectBodyState::get_contact_collider_id(int p_contact_idx) const {
	return body->collisions[p_contact_idx].otherObject->get_instance_id();
}

int BulletPhysicsDirectBodyState::get_contact_collider_shape(int p_contact_idx) const {
	return body->collisions[p_contact_idx].other_object_shape;
}

Vector3 BulletPhysicsDirectBodyState::get_contact_collider_velocity_at_position(int p_contact_idx) const {
	RigidBodyBullet::CollisionData &colDat = body->collisions.write[p_contact_idx];

	btVector3 hitLocation;
	G_TO_B(colDat.hitLocalLocation, hitLocation);

	Vector3 velocityAtPoint;
	B_TO_G(colDat.otherObject->get_bt_rigid_body()->getVelocityInLocalPoint(hitLocation), velocityAtPoint);

	return velocityAtPoint;
}

real_t BulletPhysicsDirectBodyState::get_step() const {
	return body->get_space()->get_delta_time();
}

PhysicsDirectSpaceState *BulletPhysicsDirectBodyState::get_space_state() {
	return body->get_space()->get_direct_state();
}

RigidBodyBullet::KinematicUtilities::KinematicUtilities(RigidBodyBullet *p_owner) :
		owner(p_owner),
		safe_margin(0.001) {
}

RigidBodyBullet::KinematicUtilities::~KinematicUtilities() {
	just_delete_shapes(shapes.size()); // don't need to resize
}

void RigidBodyBullet::KinematicUtilities::setSafeMargin(btScalar p_margin) {
	safe_margin = p_margin;
	copyAllOwnerShapes();
}

void RigidBodyBullet::KinematicUtilities::copyAllOwnerShapes() {
	const Vector<CollisionObjectBullet::ShapeWrapper> &shapes_wrappers(owner->get_shapes_wrappers());
	const int shapes_count = shapes_wrappers.size();

	just_delete_shapes(shapes_count);

	const CollisionObjectBullet::ShapeWrapper *shape_wrapper;

	btVector3 owner_scale(owner->get_bt_body_scale());

	for (int i = shapes_count - 1; 0 <= i; --i) {
		shape_wrapper = &shapes_wrappers[i];
		if (!shape_wrapper->active) {
			continue;
		}

		shapes.write[i].transform = shape_wrapper->transform;
		shapes.write[i].transform.getOrigin() *= owner_scale;
		switch (shape_wrapper->shape->get_type()) {
			case PhysicsServer::SHAPE_SPHERE:
			case PhysicsServer::SHAPE_BOX:
			case PhysicsServer::SHAPE_CAPSULE:
			case PhysicsServer::SHAPE_CYLINDER:
			case PhysicsServer::SHAPE_CONVEX_POLYGON:
			case PhysicsServer::SHAPE_RAY: {
				shapes.write[i].shape = static_cast<btConvexShape *>(shape_wrapper->shape->create_bt_shape(owner_scale * shape_wrapper->scale, safe_margin));
			} break;
			default:
				WARN_PRINT("RigidBody in 3D only supports primitive shapes or convex polygon shapes. Concave (trimesh) polygon shapes are not supported.");
				shapes.write[i].shape = nullptr;
		}
	}
}

void RigidBodyBullet::KinematicUtilities::just_delete_shapes(int new_size) {
	for (int i = shapes.size() - 1; 0 <= i; --i) {
		if (shapes[i].shape) {
			bulletdelete(shapes.write[i].shape);
		}
	}
	shapes.resize(new_size);
}

RigidBodyBullet::RigidBodyBullet() :
		RigidCollisionObjectBullet(CollisionObjectBullet::TYPE_RIGID_BODY),
		kinematic_utilities(nullptr),
		locked_axis(0),
		mass(1),
		gravity_scale(1),
		linearDamp(0),
		angularDamp(0),
		can_sleep(true),
		omit_forces_integration(false),
		can_integrate_forces(false),
		maxCollisionsDetection(0),
		collisionsCount(0),
		prev_collision_count(0),
		maxAreasWhereIam(10),
		areaWhereIamCount(0),
		countGravityPointSpaces(0),
		isScratchedSpaceOverrideModificator(false),
		previousActiveState(true),
		force_integration_callback(nullptr) {
	godotMotionState = bulletnew(GodotMotionState(this));

	// Initial properties
	const btVector3 localInertia(0, 0, 0);
	btRigidBody::btRigidBodyConstructionInfo cInfo(mass, godotMotionState, nullptr, localInertia);

	btBody = bulletnew(btRigidBody(cInfo));
	reload_shapes();
	setupBulletCollisionObject(btBody);

	set_mode(PhysicsServer::BODY_MODE_RIGID);
	reload_axis_lock();

	areasWhereIam.resize(maxAreasWhereIam);
	for (int i = areasWhereIam.size() - 1; 0 <= i; --i) {
		areasWhereIam.write[i] = NULL;
	}
	btBody->setSleepingThresholds(0.2, 0.2);

	prev_collision_traces = &collision_traces_1;
	curr_collision_traces = &collision_traces_2;

	direct_access = memnew(BulletPhysicsDirectBodyState);
	direct_access->body = this;
}

RigidBodyBullet::~RigidBodyBullet() {
	bulletdelete(godotMotionState);
	memdelete(direct_access);
	if (force_integration_callback) {
		memdelete(force_integration_callback);
	}

	destroy_kinematic_utilities();
}

void RigidBodyBullet::init_kinematic_utilities() {
	kinematic_utilities = memnew(KinematicUtilities(this));
	reload_kinematic_shapes();
}

void RigidBodyBullet::destroy_kinematic_utilities() {
	if (kinematic_utilities) {
		memdelete(kinematic_utilities);
		kinematic_utilities = nullptr;
	}
}

void RigidBodyBullet::main_shape_changed() {
	CRASH_COND(!get_main_shape());
	btBody->setCollisionShape(get_main_shape());
	set_continuous_collision_detection(is_continuous_collision_detection_enabled()); // Reset
}

void RigidBodyBullet::reload_body() {
	if (space) {
		space->remove_rigid_body(this);
		if (get_main_shape()) {
			space->add_rigid_body(this);
		}
	}
}

void RigidBodyBullet::set_space(SpaceBullet *p_space) {
	// Clear the old space if there is one
	if (space) {
		can_integrate_forces = false;
		isScratchedSpaceOverrideModificator = false;
		// Remove any constraints
		space->remove_rigid_body_constraints(this);
		// Remove this object form the physics world
		space->remove_rigid_body(this);
	}

	space = p_space;

	if (space) {
		space->add_rigid_body(this);
	}
}

void RigidBodyBullet::dispatch_callbacks() {
	/// The check isFirstTransformChanged is necessary in order to call integrated forces only when the first transform is sent
	if ((btBody->isKinematicObject() || btBody->isActive() || previousActiveState != btBody->isActive()) && force_integration_callback && can_integrate_forces) {
		if (omit_forces_integration) {
			btBody->clearForces();
		}

		Variant variantBodyDirect = direct_access;

		Object *obj = ObjectDB::get_instance(force_integration_callback->id);
		if (!obj) {
			// Remove integration callback
			set_force_integration_callback(0, StringName());
		} else {
			const Variant *vp[2] = { &variantBodyDirect, &force_integration_callback->udata };

			Variant::CallError responseCallError;
			int argc = (force_integration_callback->udata.get_type() == Variant::NIL) ? 1 : 2;
			obj->call(force_integration_callback->method, vp, argc, responseCallError);
		}
	}

	if (isScratchedSpaceOverrideModificator || 0 < countGravityPointSpaces) {
		isScratchedSpaceOverrideModificator = false;
		reload_space_override_modificator();
	}

	/// Lock axis
	btBody->setLinearVelocity(btBody->getLinearVelocity() * btBody->getLinearFactor());
	btBody->setAngularVelocity(btBody->getAngularVelocity() * btBody->getAngularFactor());

	previousActiveState = btBody->isActive();
}

void RigidBodyBullet::set_force_integration_callback(ObjectID p_id, const StringName &p_method, const Variant &p_udata) {
	if (force_integration_callback) {
		memdelete(force_integration_callback);
		force_integration_callback = nullptr;
	}

	if (p_id != 0) {
		force_integration_callback = memnew(ForceIntegrationCallback);
		force_integration_callback->id = p_id;
		force_integration_callback->method = p_method;
		force_integration_callback->udata = p_udata;
	}
}

void RigidBodyBullet::scratch_space_override_modificator() {
	isScratchedSpaceOverrideModificator = true;
}

void RigidBodyBullet::on_collision_filters_change() {
	if (space) {
		space->reload_collision_filters(this);
	}

	set_activation_state(true);
}

void RigidBodyBullet::on_collision_checker_start() {
	prev_collision_count = collisionsCount;
	collisionsCount = 0;

	// Swap array
	Vector<RigidBodyBullet *> *s = prev_collision_traces;
	prev_collision_traces = curr_collision_traces;
	curr_collision_traces = s;
}

void RigidBodyBullet::on_collision_checker_end() {
	// Always true if active and not a static or kinematic body
	updated = btBody->isActive() && !btBody->isStaticOrKinematicObject();
}

bool RigidBodyBullet::add_collision_object(RigidBodyBullet *p_otherObject, const Vector3 &p_hitWorldLocation, const Vector3 &p_hitLocalLocation, const Vector3 &p_hitNormal, const float &p_appliedImpulse, int p_other_shape_index, int p_local_shape_index) {
	if (collisionsCount >= maxCollisionsDetection) {
		return false;
	}

	CollisionData &cd = collisions.write[collisionsCount];
	cd.hitLocalLocation = p_hitLocalLocation;
	cd.otherObject = p_otherObject;
	cd.hitWorldLocation = p_hitWorldLocation;
	cd.hitNormal = p_hitNormal;
	cd.appliedImpulse = p_appliedImpulse;
	cd.other_object_shape = p_other_shape_index;
	cd.local_shape = p_local_shape_index;

	curr_collision_traces->write[collisionsCount] = p_otherObject;

	++collisionsCount;
	return true;
}

bool RigidBodyBullet::was_colliding(RigidBodyBullet *p_other_object) {
	for (int i = prev_collision_count - 1; 0 <= i; --i) {
		if ((*prev_collision_traces)[i] == p_other_object) {
			return true;
		}
	}
	return false;
}

void RigidBodyBullet::set_activation_state(bool p_active) {
	if (p_active) {
		btBody->activate();
	} else {
		btBody->setActivationState(WANTS_DEACTIVATION);
	}
}

bool RigidBodyBullet::is_active() const {
	return btBody->isActive();
}

void RigidBodyBullet::set_omit_forces_integration(bool p_omit) {
	omit_forces_integration = p_omit;
}

void RigidBodyBullet::set_param(PhysicsServer::BodyParameter p_param, real_t p_value) {
	switch (p_param) {
		case PhysicsServer::BODY_PARAM_BOUNCE:
			btBody->setRestitution(p_value);
			break;
		case PhysicsServer::BODY_PARAM_FRICTION:
			btBody->setFriction(p_value);
			break;
		case PhysicsServer::BODY_PARAM_MASS: {
			ERR_FAIL_COND(p_value < 0);
			mass = p_value;
			_internal_set_mass(p_value);
			break;
		}
		case PhysicsServer::BODY_PARAM_LINEAR_DAMP:
			linearDamp = p_value;
			// Mark for updating total linear damping.
			scratch_space_override_modificator();
			break;
		case PhysicsServer::BODY_PARAM_ANGULAR_DAMP:
			angularDamp = p_value;
			// Mark for updating total angular damping.
			scratch_space_override_modificator();
			break;
		case PhysicsServer::BODY_PARAM_GRAVITY_SCALE:
			gravity_scale = p_value;
			// The Bullet gravity will be is set by reload_space_override_modificator.
			// Mark for updating total gravity scale.
			scratch_space_override_modificator();
			break;
		default:
			WARN_PRINT("Parameter " + itos(p_param) + " not supported by bullet. Value: " + itos(p_value));
	}
}

real_t RigidBodyBullet::get_param(PhysicsServer::BodyParameter p_param) const {
	switch (p_param) {
		case PhysicsServer::BODY_PARAM_BOUNCE:
			return btBody->getRestitution();
		case PhysicsServer::BODY_PARAM_FRICTION:
			return btBody->getFriction();
		case PhysicsServer::BODY_PARAM_MASS: {
			const btScalar invMass = btBody->getInvMass();
			return 0 == invMass ? 0 : 1 / invMass;
		}
		case PhysicsServer::BODY_PARAM_LINEAR_DAMP:
			return linearDamp;
		case PhysicsServer::BODY_PARAM_ANGULAR_DAMP:
			return angularDamp;
		case PhysicsServer::BODY_PARAM_GRAVITY_SCALE:
			return gravity_scale;
		default:
			WARN_PRINT("Parameter " + itos(p_param) + " not supported by bullet");
			return 0;
	}
}

void RigidBodyBullet::set_mode(PhysicsServer::BodyMode p_mode) {
	// This is necessary to block force_integration untile next move
	can_integrate_forces = false;
	destroy_kinematic_utilities();
	// The mode change is relevant to its mass
	switch (p_mode) {
		case PhysicsServer::BODY_MODE_KINEMATIC:
			mode = PhysicsServer::BODY_MODE_KINEMATIC;
			reload_axis_lock();
			_internal_set_mass(0);
			init_kinematic_utilities();
			break;
		case PhysicsServer::BODY_MODE_STATIC:
			mode = PhysicsServer::BODY_MODE_STATIC;
			reload_axis_lock();
			_internal_set_mass(0);
			break;
		case PhysicsServer::BODY_MODE_RIGID:
			mode = PhysicsServer::BODY_MODE_RIGID;
			reload_axis_lock();
			_internal_set_mass(0 == mass ? 1 : mass);
			scratch_space_override_modificator();
			break;
		case PhysicsServer::BODY_MODE_CHARACTER:
			mode = PhysicsServer::BODY_MODE_CHARACTER;
			reload_axis_lock();
			_internal_set_mass(0 == mass ? 1 : mass);
			scratch_space_override_modificator();
			break;
	}

	btBody->setAngularVelocity(btVector3(0, 0, 0));
	btBody->setLinearVelocity(btVector3(0, 0, 0));
}
PhysicsServer::BodyMode RigidBodyBullet::get_mode() const {
	return mode;
}

void RigidBodyBullet::set_state(PhysicsServer::BodyState p_state, const Variant &p_variant) {
	switch (p_state) {
		case PhysicsServer::BODY_STATE_TRANSFORM:
			set_transform(p_variant);
			break;
		case PhysicsServer::BODY_STATE_LINEAR_VELOCITY:
			set_linear_velocity(p_variant);
			break;
		case PhysicsServer::BODY_STATE_ANGULAR_VELOCITY:
			set_angular_velocity(p_variant);
			break;
		case PhysicsServer::BODY_STATE_SLEEPING:
			set_activation_state(!bool(p_variant));
			break;
		case PhysicsServer::BODY_STATE_CAN_SLEEP:
			can_sleep = bool(p_variant);
			if (!can_sleep) {
				// Can't sleep
				btBody->forceActivationState(DISABLE_DEACTIVATION);
			} else {
				btBody->forceActivationState(ACTIVE_TAG);
			}
			break;
	}
}

Variant RigidBodyBullet::get_state(PhysicsServer::BodyState p_state) const {
	switch (p_state) {
		case PhysicsServer::BODY_STATE_TRANSFORM:
			return get_transform();
		case PhysicsServer::BODY_STATE_LINEAR_VELOCITY:
			return get_linear_velocity();
		case PhysicsServer::BODY_STATE_ANGULAR_VELOCITY:
			return get_angular_velocity();
		case PhysicsServer::BODY_STATE_SLEEPING:
			return !is_active();
		case PhysicsServer::BODY_STATE_CAN_SLEEP:
			return can_sleep;
		default:
			WARN_PRINT("This state " + itos(p_state) + " is not supported by Bullet");
			return Variant();
	}
}

void RigidBodyBullet::apply_central_impulse(const Vector3 &p_impulse) {
	btVector3 btImpu;
	G_TO_B(p_impulse, btImpu);
	if (Vector3() != p_impulse) {
		btBody->activate();
	}
	btBody->applyCentralImpulse(btImpu);
}

void RigidBodyBullet::apply_impulse(const Vector3 &p_pos, const Vector3 &p_impulse) {
	btVector3 btImpu;
	btVector3 btPos;
	G_TO_B(p_impulse, btImpu);
	G_TO_B(p_pos, btPos);
	if (Vector3() != p_impulse) {
		btBody->activate();
	}
	btBody->applyImpulse(btImpu, btPos);
}

void RigidBodyBullet::apply_torque_impulse(const Vector3 &p_impulse) {
	btVector3 btImp;
	G_TO_B(p_impulse, btImp);
	if (Vector3() != p_impulse) {
		btBody->activate();
	}
	btBody->applyTorqueImpulse(btImp);
}

void RigidBodyBullet::apply_force(const Vector3 &p_force, const Vector3 &p_pos) {
	btVector3 btForce;
	btVector3 btPos;
	G_TO_B(p_force, btForce);
	G_TO_B(p_pos, btPos);
	if (Vector3() != p_force) {
		btBody->activate();
	}
	btBody->applyForce(btForce, btPos);
}

void RigidBodyBullet::apply_central_force(const Vector3 &p_force) {
	btVector3 btForce;
	G_TO_B(p_force, btForce);
	if (Vector3() != p_force) {
		btBody->activate();
	}
	btBody->applyCentralForce(btForce);
}

void RigidBodyBullet::apply_torque(const Vector3 &p_torque) {
	btVector3 btTorq;
	G_TO_B(p_torque, btTorq);
	if (Vector3() != p_torque) {
		btBody->activate();
	}
	btBody->applyTorque(btTorq);
}

void RigidBodyBullet::set_applied_force(const Vector3 &p_force) {
	btVector3 btVec = btBody->getTotalTorque();

	if (Vector3() != p_force) {
		btBody->activate();
	}

	btBody->clearForces();
	btBody->applyTorque(btVec);

	G_TO_B(p_force, btVec);
	btBody->applyCentralForce(btVec);
}

Vector3 RigidBodyBullet::get_applied_force() const {
	Vector3 gTotForc;
	B_TO_G(btBody->getTotalForce(), gTotForc);
	return gTotForc;
}

void RigidBodyBullet::set_applied_torque(const Vector3 &p_torque) {
	btVector3 btVec = btBody->getTotalForce();

	if (Vector3() != p_torque) {
		btBody->activate();
	}

	btBody->clearForces();
	btBody->applyCentralForce(btVec);

	G_TO_B(p_torque, btVec);
	btBody->applyTorque(btVec);
}

Vector3 RigidBodyBullet::get_applied_torque() const {
	Vector3 gTotTorq;
	B_TO_G(btBody->getTotalTorque(), gTotTorq);
	return gTotTorq;
}

void RigidBodyBullet::set_axis_lock(PhysicsServer::BodyAxis p_axis, bool lock) {
	if (lock) {
		locked_axis |= p_axis;
	} else {
		locked_axis &= ~p_axis;
	}

	reload_axis_lock();
}

bool RigidBodyBullet::is_axis_locked(PhysicsServer::BodyAxis p_axis) const {
	return locked_axis & p_axis;
}

void RigidBodyBullet::reload_axis_lock() {
	btBody->setLinearFactor(btVector3(float(!is_axis_locked(PhysicsServer::BODY_AXIS_LINEAR_X)), float(!is_axis_locked(PhysicsServer::BODY_AXIS_LINEAR_Y)), float(!is_axis_locked(PhysicsServer::BODY_AXIS_LINEAR_Z))));
	if (PhysicsServer::BODY_MODE_CHARACTER == mode) {
		/// When character angular is always locked
		btBody->setAngularFactor(btVector3(0., 0., 0.));
	} else {
		btBody->setAngularFactor(btVector3(float(!is_axis_locked(PhysicsServer::BODY_AXIS_ANGULAR_X)), float(!is_axis_locked(PhysicsServer::BODY_AXIS_ANGULAR_Y)), float(!is_axis_locked(PhysicsServer::BODY_AXIS_ANGULAR_Z))));
	}
}

void RigidBodyBullet::set_continuous_collision_detection(bool p_enable) {
	if (p_enable) {
		// This threshold enable CCD if the object moves more than
		// 1 meter in one simulation frame
		btBody->setCcdMotionThreshold(1e-7);

		/// Calculate using the rule writte below the CCD swept sphere radius
		///     CCD works on an embedded sphere of radius, make sure this radius
		///     is embedded inside the convex objects, preferably smaller:
		///     for an object of dimensions 1 meter, try 0.2
		btScalar radius(1.0);
		if (btBody->getCollisionShape()) {
			btVector3 center;
			btBody->getCollisionShape()->getBoundingSphere(center, radius);
		}
		btBody->setCcdSweptSphereRadius(radius * 0.2);
	} else {
		btBody->setCcdMotionThreshold(0.);
		btBody->setCcdSweptSphereRadius(0.);
	}
}

bool RigidBodyBullet::is_continuous_collision_detection_enabled() const {
	return 0. < btBody->getCcdMotionThreshold();
}

void RigidBodyBullet::set_linear_velocity(const Vector3 &p_velocity) {
	btVector3 btVec;
	G_TO_B(p_velocity, btVec);
	if (Vector3() != p_velocity) {
		btBody->activate();
	}
	btBody->setLinearVelocity(btVec);
}

Vector3 RigidBodyBullet::get_linear_velocity() const {
	Vector3 gVec;
	B_TO_G(btBody->getLinearVelocity(), gVec);
	return gVec;
}

void RigidBodyBullet::set_angular_velocity(const Vector3 &p_velocity) {
	btVector3 btVec;
	G_TO_B(p_velocity, btVec);
	if (Vector3() != p_velocity) {
		btBody->activate();
	}
	btBody->setAngularVelocity(btVec);
}

Vector3 RigidBodyBullet::get_angular_velocity() const {
	Vector3 gVec;
	B_TO_G(btBody->getAngularVelocity(), gVec);
	return gVec;
}

void RigidBodyBullet::set_transform__bullet(const btTransform &p_global_transform) {
	if (mode == PhysicsServer::BODY_MODE_KINEMATIC) {
		if (space && space->get_delta_time() != 0) {
			btBody->setLinearVelocity((p_global_transform.getOrigin() - btBody->getWorldTransform().getOrigin()) / space->get_delta_time());
		}
		// The kinematic use MotionState class
		godotMotionState->moveBody(p_global_transform);
	} else {
		// Is necessary to avoid wrong location on the rendering side on the next frame
		godotMotionState->setWorldTransform(p_global_transform);
	}
	CollisionObjectBullet::set_transform__bullet(p_global_transform);
}

const btTransform &RigidBodyBullet::get_transform__bullet() const {
	if (is_static()) {
		return RigidCollisionObjectBullet::get_transform__bullet();
	} else {
		return godotMotionState->getCurrentWorldTransform();
	}
}

void RigidBodyBullet::reload_shapes() {
	RigidCollisionObjectBullet::reload_shapes();

	const btScalar invMass = btBody->getInvMass();
	const btScalar mass = invMass == 0 ? 0 : 1 / invMass;

	if (mainShape) {
		// inertia initialised zero here because some of bullet's collision
		// shapes incorrectly do not set the vector in calculateLocalIntertia.
		// Arbitrary zero is preferable to undefined behaviour.
		btVector3 inertia(0, 0, 0);
		if (EMPTY_SHAPE_PROXYTYPE != mainShape->getShapeType()) { // Necessary to avoid assertion of the empty shape
			mainShape->calculateLocalInertia(mass, inertia);
		}
		btBody->setMassProps(mass, inertia);
	}
	btBody->updateInertiaTensor();

	reload_kinematic_shapes();
	set_continuous_collision_detection(is_continuous_collision_detection_enabled());
	reload_body();
}

void RigidBodyBullet::on_enter_area(AreaBullet *p_area) {
	/// Add this area to the array in an ordered way
	++areaWhereIamCount;
	if (areaWhereIamCount >= maxAreasWhereIam) {
		--areaWhereIamCount;
		return;
	}
	for (int i = 0; i < areaWhereIamCount; ++i) {
		if (NULL == areasWhereIam[i]) {
			// This area has the highest priority
			areasWhereIam.write[i] = p_area;
			break;
		} else {
			if (areasWhereIam[i]->get_spOv_priority() > p_area->get_spOv_priority()) {
				// The position was found, just shift all elements
				for (int j = areaWhereIamCount; j > i; j--) {
					areasWhereIam.write[j] = areasWhereIam[j - 1];
				}
				areasWhereIam.write[i] = p_area;
				break;
			}
		}
	}
	if (PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED != p_area->get_spOv_mode()) {
		scratch_space_override_modificator();
	}

	if (p_area->is_spOv_gravityPoint()) {
		++countGravityPointSpaces;
		ERR_FAIL_COND(countGravityPointSpaces <= 0);
	}
}

void RigidBodyBullet::on_exit_area(AreaBullet *p_area) {
	RigidCollisionObjectBullet::on_exit_area(p_area);
	/// Remove this area and keep the order
	/// N.B. Since I don't want resize the array I can't use the "erase" function
	bool wasTheAreaFound = false;
	for (int i = 0; i < areaWhereIamCount; ++i) {
		if (p_area == areasWhereIam[i]) {
			// The area was found, just shift down all elements
			for (int j = i; j < areaWhereIamCount; ++j) {
				areasWhereIam.write[j] = areasWhereIam[j + 1];
			}
			wasTheAreaFound = true;
			break;
		}
	}
	if (wasTheAreaFound) {
		if (p_area->is_spOv_gravityPoint()) {
			--countGravityPointSpaces;
			ERR_FAIL_COND(countGravityPointSpaces < 0);
		}

		--areaWhereIamCount;
		areasWhereIam.write[areaWhereIamCount] = NULL; // Even if this is not required, I clear the last element to be safe
		if (PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED != p_area->get_spOv_mode()) {
			scratch_space_override_modificator();
		}
	}
}

void RigidBodyBullet::reload_space_override_modificator() {
	if (mode == PhysicsServer::BODY_MODE_STATIC) {
		return;
	}

	if (omit_forces_integration) {
		// Custom behaviour.
		btBody->setGravity(btVector3(0, 0, 0));
		btBody->setDamping(0, 0);
		return;
	}

	Vector3 newGravity(0.0, 0.0, 0.0);
	real_t newLinearDamp = MAX(0.0, linearDamp);
	real_t newAngularDamp = MAX(0.0, angularDamp);

	AreaBullet *currentArea;
	// Variable used to calculate new gravity for gravity point areas, it is pointed by currentGravity pointer
	Vector3 support_gravity(0, 0, 0);

	bool stopped = false;
	for (int i = areaWhereIamCount - 1; (0 <= i) && !stopped; --i) {
		currentArea = areasWhereIam[i];

		if (!currentArea || PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED == currentArea->get_spOv_mode()) {
			continue;
		}

		/// Here is calculated the gravity
		if (currentArea->is_spOv_gravityPoint()) {
			/// It calculates the direction of new gravity
			support_gravity = currentArea->get_transform().xform(currentArea->get_spOv_gravityVec()) - get_transform().get_origin();
			real_t distanceMag = support_gravity.length();
			// Normalized in this way to avoid the double call of function "length()"
			if (distanceMag == 0) {
				support_gravity.x = 0;
				support_gravity.y = 0;
				support_gravity.z = 0;
			} else {
				support_gravity.x /= distanceMag;
				support_gravity.y /= distanceMag;
				support_gravity.z /= distanceMag;
			}

			/// Here is calculated the final gravity
			if (currentArea->get_spOv_gravityPointDistanceScale() > 0) {
				// Scaled gravity by distance
				support_gravity *= currentArea->get_spOv_gravityMag() / Math::pow(distanceMag * currentArea->get_spOv_gravityPointDistanceScale() + 1, 2);
			} else {
				// Unscaled gravity
				support_gravity *= currentArea->get_spOv_gravityMag();
			}
		} else {
			support_gravity = currentArea->get_spOv_gravityVec() * currentArea->get_spOv_gravityMag();
		}

		switch (currentArea->get_spOv_mode()) {
			case PhysicsServer::AREA_SPACE_OVERRIDE_DISABLED:
				/// This area does not affect gravity/damp. These are generally areas
				/// that exist only to detect collisions, and objects entering or exiting them.
				break;
			case PhysicsServer::AREA_SPACE_OVERRIDE_COMBINE:
				/// This area adds its gravity/damp values to whatever has been
				/// calculated so far. This way, many overlapping areas can combine
				/// their physics to make interesting
				newGravity += support_gravity;
				newLinearDamp += currentArea->get_spOv_linearDamp();
				newAngularDamp += currentArea->get_spOv_angularDamp();
				break;
			case PhysicsServer::AREA_SPACE_OVERRIDE_COMBINE_REPLACE:
				/// This area adds its gravity/damp values to whatever has been calculated
				/// so far. Then stops taking into account the rest of the areas, even the
				/// default one.
				newGravity += support_gravity;
				newLinearDamp += currentArea->get_spOv_linearDamp();
				newAngularDamp += currentArea->get_spOv_angularDamp();
				stopped = true;
				break;
			case PhysicsServer::AREA_SPACE_OVERRIDE_REPLACE:
				/// This area replaces any gravity/damp, even the default one, and
				/// stops taking into account the rest of the areas.
				newGravity = support_gravity;
				newLinearDamp = currentArea->get_spOv_linearDamp();
				newAngularDamp = currentArea->get_spOv_angularDamp();
				stopped = true;
				break;
			case PhysicsServer::AREA_SPACE_OVERRIDE_REPLACE_COMBINE:
				/// This area replaces any gravity/damp calculated so far, but keeps
				/// calculating the rest of the areas, down to the default one.
				newGravity = support_gravity;
				newLinearDamp = currentArea->get_spOv_linearDamp();
				newAngularDamp = currentArea->get_spOv_angularDamp();
				break;
		}
	}

	// Add default gravity and damping from space.
	if (!stopped) {
		newGravity += space->get_gravity_direction() * space->get_gravity_magnitude();
		newLinearDamp += space->get_linear_damp();
		newAngularDamp += space->get_angular_damp();
	}

	btVector3 newBtGravity;
	G_TO_B(newGravity * gravity_scale, newBtGravity);

	btBody->setGravity(newBtGravity);
	btBody->setDamping(newLinearDamp, newAngularDamp);
}

void RigidBodyBullet::reload_kinematic_shapes() {
	if (!kinematic_utilities) {
		return;
	}
	kinematic_utilities->copyAllOwnerShapes();
}

void RigidBodyBullet::notify_transform_changed() {
	RigidCollisionObjectBullet::notify_transform_changed();
	can_integrate_forces = true;
}

void RigidBodyBullet::_internal_set_mass(real_t p_mass) {
	btVector3 localInertia(0, 0, 0);

	int clearedCurrentFlags = btBody->getCollisionFlags();
	clearedCurrentFlags &= ~(btCollisionObject::CF_KINEMATIC_OBJECT | btCollisionObject::CF_STATIC_OBJECT | btCollisionObject::CF_CHARACTER_OBJECT);

	// Rigidbody is dynamic if and only if mass is non Zero, otherwise static
	const bool isDynamic = p_mass != 0.f;
	if (isDynamic) {
		if (PhysicsServer::BODY_MODE_RIGID != mode && PhysicsServer::BODY_MODE_CHARACTER != mode) {
			return;
		}

		m_isStatic = false;
		if (mainShape) {
			mainShape->calculateLocalInertia(p_mass, localInertia);
		}

		if (PhysicsServer::BODY_MODE_RIGID == mode) {
			btBody->setCollisionFlags(clearedCurrentFlags); // Just set the flags without Kin and Static
		} else {
			btBody->setCollisionFlags(clearedCurrentFlags | btCollisionObject::CF_CHARACTER_OBJECT);
		}

		if (can_sleep) {
			btBody->forceActivationState(ACTIVE_TAG); // ACTIVE_TAG 1
		} else {
			btBody->forceActivationState(DISABLE_DEACTIVATION); // DISABLE_DEACTIVATION 4
		}
	} else {
		if (PhysicsServer::BODY_MODE_STATIC != mode && PhysicsServer::BODY_MODE_KINEMATIC != mode) {
			return;
		}

		m_isStatic = true;
		if (PhysicsServer::BODY_MODE_STATIC == mode) {
			btBody->setCollisionFlags(clearedCurrentFlags | btCollisionObject::CF_STATIC_OBJECT);
		} else {
			btBody->setCollisionFlags(clearedCurrentFlags | btCollisionObject::CF_KINEMATIC_OBJECT);
			set_transform__bullet(btBody->getWorldTransform()); // Set current Transform using kinematic method
		}
		btBody->forceActivationState(DISABLE_SIMULATION); // DISABLE_SIMULATION 5
	}

	btBody->setMassProps(p_mass, localInertia);
	btBody->updateInertiaTensor();

	reload_body();
}


text:
'use strict';

angular.module('services.velocity', ['restangular'])

  .factory('VelocityConfig', ['Restangular', function (Restangular) {
    return {
      all: function () {
        return Restangular.all('velocity_config').getList();
      },
      page: function (query) {
        return Restangular.one('velocity_config').get(query);
      },
      get: function (id) {
        return Restangular.one('velocity_config', id).get();
      },
      add: function (config) {
        return Restangular.all('velocity_config').post(config);
      },
      save: function (id, config) {
        return Restangular.one('velocity_config', id).put(config);
      },
      delete: function (id) {
        return Restangular.one('velocity_config', id).remove();
      }
    }
  }])

  .factory('Velocity', ['Restangular', function (Restangular) {
    return {
      metrics: function (filter) {
        return Restangular.all('velocity/redis/metrics').getList(filter);
      },
      history: function (filter) {
        return Restangular.all('velocity/redis/history').getList(filter);
      },
      check: function (metrics) {
        return Restangular.all('velocity/redis/check').post(metrics);
      }
    }
  }]);


text:
extern "Java"
{
  namespace java
  {
    namespace awt
    {
      namespace event
      {
          class ActionEvent;
      }
    }
  }
  namespace javax
  {
    namespace swing
    {
      namespace text
      {
          class DefaultEditorKit$DefaultKeyTypedAction;
      }
    }
  }
}

class javax::swing::text::DefaultEditorKit$DefaultKeyTypedAction : public ::javax::swing::text::TextAction
{

public:
  DefaultEditorKit$DefaultKeyTypedAction();
  virtual void actionPerformed(::java::awt::event::ActionEvent *);
  static ::java::lang::Class class$;
};

#endif // __javax_swing_text_DefaultEditorKit$DefaultKeyTypedAction__