text:
<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements. See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License. You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<component xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">

   <dependencySets>
      <dependencySet>
        <directoryMode>0755</directoryMode>
        <fileMode>0644</fileMode>
        <outputDirectory>lib</outputDirectory>
        <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
        <unpack>false</unpack>
        <useTransitiveDependencies>false</useTransitiveDependencies>
        <includes>
           <include>org.apache.activemq:artemis-boot</include>
        </includes>
        <useProjectArtifact>false</useProjectArtifact>
      </dependencySet>

      <dependencySet>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
         <includes>

            <!-- modules -->
            <include>org.apache.activemq:artemis-cli</include>
            <include>org.apache.activemq:artemis-commons</include>
            <include>org.apache.activemq:artemis-core-client</include>
            <include>org.apache.activemq:artemis-dto</include>
            <include>org.apache.activemq:artemis-jms-client</include>
            <include>org.apache.activemq:artemis-jms-server</include>
            <include>org.apache.activemq:artemis-journal</include>
            <include>org.apache.activemq:artemis-jdbc-store</include>
            <include>org.apache.activemq:activemq-artemis-native</include>
            <include>org.apache.activemq:artemis-amqp-protocol</include>
            <include>org.apache.activemq:artemis-openwire-protocol</include>
            <include>org.apache.activemq:artemis-hornetq-protocol</include>
            <include>org.apache.activemq:artemis-hqclient-protocol</include>
            <include>org.apache.activemq:artemis-stomp-protocol</include>
            <include>org.apache.activemq:artemis-mqtt-protocol</include>
            <include>org.apache.activemq:artemis-ra</include>
            <include>org.apache.activemq:artemis-selector</include>
            <include>org.apache.activemq:artemis-server</include>
            <include>org.apache.activemq:artemis-service-extensions</include>
            <include>org.apache.activemq:artemis-web</include>
            <include>org.apache.activemq.rest:artemis-rest</include>
            <include>org.apache.qpid:qpid-jms-client</include>
            <include>io.micrometer:micrometer-core</include>

            <!-- dependencies -->
            <include>jakarta.jms:jakarta.jms-api</include>
            <include>jakarta.transaction:jakarta.transaction-api</include>
            <include>org.wildfly.common:wildfly-common</include>
            <include>org.jboss.logmanager:jboss-logmanager</include>
            <include>org.jboss.logging:jboss-logging</include>
            <include>org.jboss.slf4j:slf4j-jboss-logmanager</include>
            <include>org.jctools:jctools-core</include>
            <include>org.apache.commons:commons-dbcp2</include>
            <include>org.apache.commons:commons-pool2</include>
            <include>io.netty:netty-all</include>
            <include>org.apache.qpid:proton-j</include>
            <include>org.apache.activemq:activemq-client</include>
            <include>org.apache.activemq:activemq-openwire-legacy</include>
            <include>org.slf4j:slf4j-api</include>
            <include>io.airlift:airline</include>
            <include>com.google.guava:guava</include>
            <include>jakarta.inject:jakarta.inject-api</include>
            <include>org.eclipse.jetty.aggregate:jetty-all:jar:uber</include>
            <include>org.apache.tomcat:tomcat-servlet-api</include>
            <include>commons-beanutils:commons-beanutils</include>
            <include>commons-logging:commons-logging</include>
            <include>commons-collections:commons-collections</include>
            <include>org.apache.commons:commons-configuration2</include>
            <include>org.apache.commons:commons-text</include>
            <include>org.apache.commons:commons-lang3</include>
            <include>org.fusesource.hawtbuf:hawtbuf</include>
            <include>org.jgroups:jgroups</include>
            <include>jakarta.json:jakarta.json-api</include>
            <include>org.apache.johnzon:johnzon-core</include>
            <include>jakarta.xml.bind:jakarta.xml.bind-api</include>
            <include>com.sun.xml.bind:jaxb-impl</include>
            <include>jakarta.activation:jakarta.activation-api</include>
            <include>jakarta.security.auth.message:jakarta.security.auth.message-api</include>
         </includes>
         <!--excludes>
            <exclude>org.apache.activemq:artemis-website</exclude>
         </excludes-->
         <outputDirectory>lib</outputDirectory>
         <unpack>false</unpack>
         <useProjectArtifact>false</useProjectArtifact>
      </dependencySet>
      <dependencySet>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
         <includes>
            <include>org.apache.activemq:artemis-jms-client-all</include>
         </includes>
         <outputDirectory>lib/client</outputDirectory>
         <unpack>false</unpack>
         <useProjectArtifact>false</useProjectArtifact>
      </dependencySet>
      <!-- native -->
      <dependencySet>
         <includes>
            <include>org.apache.activemq:activemq-artemis-native</include>
         </includes>
         <outputDirectory>bin</outputDirectory>
         <unpack>true</unpack>
         <unpackOptions>
            <includes>
               <include>**/*.so</include>
            </includes>
         </unpackOptions>
         <useProjectArtifact>false</useProjectArtifact>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
      </dependencySet>
      <dependencySet>
         <includes>
            <include>org.apache.activemq:artemis-website</include>
         </includes>
         <excludes>
            <exclude>org.apache.activemq:artemis-website:jar:javadoc</exclude>
         </excludes>
         <outputDirectory>web</outputDirectory>
         <unpack>true</unpack>
         <useProjectArtifact>false</useProjectArtifact>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
      </dependencySet>
      <dependencySet>
         <includes>
            <include>org.apache.activemq:artemis-website:jar:javadoc</include>
         </includes>
         <outputDirectory>web/api</outputDirectory>
         <unpack>true</unpack>
         <useProjectArtifact>false</useProjectArtifact>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
      </dependencySet>

      <!-- Management Console Dependencies -->
      <dependencySet>
         <includes>
            <include>org.apache.activemq:artemis-console:war</include>
         </includes>
         <outputDirectory>web</outputDirectory>
         <unpack>false</unpack>
         <outputFileNameMapping>console.war</outputFileNameMapping>
         <useProjectArtifact>false</useProjectArtifact>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
      </dependencySet>
      <dependencySet>
         <includes>
            <include>org.apache.activemq:activemq-branding:war</include>
         </includes>
         <outputDirectory>web</outputDirectory>
         <unpack>false</unpack>
         <outputFileNameMapping>activemq-branding.war</outputFileNameMapping>
         <useProjectArtifact>false</useProjectArtifact>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
      </dependencySet>
      <dependencySet>
         <includes>
            <include>org.apache.activemq:artemis-plugin:war</include>
         </includes>
         <outputDirectory>web</outputDirectory>
         <unpack>false</unpack>
         <outputFileNameMapping>artemis-plugin.war</outputFileNameMapping>
         <useProjectArtifact>false</useProjectArtifact>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
      </dependencySet>

   </dependencySets>
   <fileSets>
      <!-- schema -->
      <fileSet>
         <directory>${activemq.basedir}/artemis-server/src/main/resources/schema/</directory>
         <outputDirectory>schema</outputDirectory>
         <lineEnding>keep</lineEnding>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
      </fileSet>
      <fileSet>
         <directory>${activemq.basedir}/artemis-jms-server/src/main/resources/schema/</directory>
         <outputDirectory>schema</outputDirectory>
         <lineEnding>keep</lineEnding>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
      </fileSet>
      <fileSet>
         <directory>${activemq.basedir}/artemis-dto/target/schema/org.apache.activemq/dto/</directory>
         <outputDirectory>schema</outputDirectory>
         <lineEnding>keep</lineEnding>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
      </fileSet>
      <!-- resources -->
      <fileSet>
         <directory>src/main/resources</directory>
         <outputDirectory>${file.separator}</outputDirectory>
         <lineEnding>keep</lineEnding>
         <excludes>
            <exclude>bin/artemis</exclude>
            <exclude>**/target/**</exclude>
            <exclude>**/**/*.iml</exclude>
            <exclude>**/**/*.dat</exclude>
            <exclude>**/licenses/**</exclude>
         </excludes>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
      </fileSet>
      <fileSet>
         <directory>src/main/resources</directory>
         <outputDirectory>${file.separator}</outputDirectory>
         <lineEnding>keep</lineEnding>
         <includes>
            <include>bin/artemis</include>
         </includes>
         <directoryMode>0755</directoryMode>
         <fileMode>0755</fileMode>
      </fileSet>
      <!-- examples -->
      <fileSet>
         <directory>${activemq.basedir}/examples</directory>
         <outputDirectory>examples</outputDirectory>
         <lineEnding>keep</lineEnding>
         <excludes>
            <exclude>**/target/**</exclude>
            <exclude>**/**/*.iml</exclude>
            <exclude>**/**/*.dat</exclude>
            <exclude>**/**/*.md</exclude>
            <exclude>**/**/*.sh</exclude>
         </excludes>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
      </fileSet>
      <fileSet>
         <directory>${activemq.basedir}/examples</directory>
         <outputDirectory>examples</outputDirectory>
         <lineEnding>keep</lineEnding>
         <includes>
            <include>**/**/*.sh</include>
         </includes>
         <excludes>
            <exclude>**/target/**</exclude>
         </excludes>
         <directoryMode>0755</directoryMode>
         <fileMode>0755</fileMode>
      </fileSet>
      <fileSet>
         <directory>${project.build.directory}/markdown-pages/examples</directory>
         <outputDirectory>examples</outputDirectory>
         <lineEnding>keep</lineEnding>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
      </fileSet>
      <!-- Include license and notice files -->
      <fileSet>
         <directory>${activemq.basedir}/artemis-distribution/src/main/resources/licenses/bin</directory>
         <outputDirectory>${file.separator}</outputDirectory>
         <useDefaultExcludes>true</useDefaultExcludes>
         <directoryMode>0755</directoryMode>
         <fileMode>0644</fileMode>
      </fileSet>
   </fileSets>
</component>


text:
using UIKit;

namespace WorkoutTime
{
	public static class StoryboardExtensions
	{
		public static T Instantiate<T> (this UIStoryboard storyboard) where T : UIViewController
		{
			return storyboard.InstantiateViewController (typeof (T).Name) as T;
		}

		public static T Instantiate<T> (this UIStoryboard storyboard, string name) where T : UIViewController
		{
			return storyboard.InstantiateViewController (name) as T;
		}

		public static UIViewController Instantiate (this UIStoryboard storyboard, string name)
		{
			return storyboard.InstantiateViewController (name) as UIViewController;
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace Bounce.Framework.VisualStudio {
    public class ProjectFilePropertyExpressionParser {
        private readonly IPropertyValues Props;

        public ProjectFilePropertyExpressionParser(IPropertyValues props) {
            Props = props;
        }

        public T Parse<T>(string sourceString, Func<char[], int, ParseResult<T>> parser) {
            char[] source = sourceString.ToCharArray();
            ParseResult<T> parseResult = parser(source, 0);

            if (parseResult != null) {
                var whitespace = ParseWhitespace(source, parseResult.Index);

                if (whitespace != null && whitespace.Index == source.Length) {
                    return parseResult.Value;
                }
            }

            throw new ConditionParseException();
        }

        private ParseResult<object> ParseWhitespace(char [] source, int index) {
            while (index < source.Length && (source[index] == ' ' || source[index] == '\t'))
            {
                index++;
            }

            return new ParseResult<object> {Index = index};
        }

        private ParseResult<object> ParseKeyword(char [] source, int index, string keyword) {
            if (index < source.Length && new string(source, index, keyword.Length) == keyword) {
                return new ParseResult<object> {Index = index + keyword.Length};
            } else {
                return null;
            }
        }

        private ParseResult<bool> ParseOrExpression(char [] source, int index) {
            var left = ParseEqualityExpression(source, index);

            if (left == null) {
                return null;
            }

            var whitespace = ParseWhitespace(source, left.Index);
            var op = ParseKeyword(source, whitespace.Index, "Or");

            if (op == null) {
                return null;
            }

            whitespace = ParseWhitespace(source, op.Index);
            var right = ParseExpression(source, whitespace.Index);
            if (right == null) {
                return null;
            }

            return new ParseResult<bool> {Index = right.Index, Value = left.Value || right.Value};
        }

        private ParseResult<bool> ParseExpression(char [] source, int index) {
            var expressionParsers = new Func<char[], int, ParseResult<bool>>[] { ParseOrExpression, ParseEqualityExpression };
            return expressionParsers.Select(parser => parser(source, index)).FirstOrDefault(result => result != null);
        }

        private ParseResult<string> ParseTerminal(char [] source, int index) {
            var expressionParsers = new Func<char[], int, ParseResult<string>>[] { ParseVariable, ParseString };
            return expressionParsers.Select(parser => parser(source, index)).FirstOrDefault(result => result != null);
        }

        public ParseResult<bool> ParseEqualityExpression(char [] source, int index) {
            var whitespace = ParseWhitespace(source, index);
            var firstString = ParseTerminal(source, whitespace.Index);
            if (firstString == null) {
                return null;
            }
            whitespace = ParseWhitespace(source, firstString.Index);
            var equalityOperator = ParseEquality(source, whitespace.Index);
            if (equalityOperator == null) {
                return null;
            }
            whitespace = ParseWhitespace(source, equalityOperator.Index);
            var secondString = ParseTerminal(source, whitespace.Index);
            if (secondString == null) {
                return null;
            }

            return new ParseResult<bool> {Value = firstString.Value == secondString.Value, Index = secondString.Index};
        }

        private ParseResult<object> ParseEquality(char[] source, int index) {
            if (index >= source.Length) {
                return null;
            }

            if (source[index] != '=') {
                return null;
            }

            index++;
            if (index >= source.Length) {
                return null;
            }

            if (source[index] != '=') {
                return null;
            } else {
                index++;
                return new ParseResult<object> {Index = index};
            }
        }

        public ParseResult<string> ParseString(char [] source, int index) {
            if (index >= source.Length) {
                return null;
            }

            if (source[index] == '\'') {
                index++;

                var value = new StringBuilder();
                while (index < source.Length && source[index] != '\'')
                {
                    ParseResult<string> variable = ParseVariable(source, index);

                    if (variable != null) {
                        value.Append(variable.Value);
                        index = variable.Index;
                    } else {
                        value.Append(source[index]);
                        index++;
                    }
                }

                if (index < source.Length) {
                    index++;
                    return new ParseResult<string>() {Value = value.ToString(), Index = index};
                } else {
                    return null;
                }
            } else {
                return null;
            }
        }

        private ParseResult<string> ParseVariable(char[] source, int index) {
            if (source[index] != '$') {
                return null;
            }

            index++;

            if (index >= source.Length || source[index] != '(') {
                return null;
            }

            index++;

            var variable = new StringBuilder();

            while (index < source.Length && source[index] != ')') {
                variable.Append(source[index]);
                index++;
            }

            index++;

            if (index < source.Length) {
                return new ParseResult<string> {Value = Props[variable.ToString()], Index = index};
            } else {
                return null;
            }
        }

        public bool ParseCondition(string value) {
            return Parse(value, ParseExpression);
        }
    }
}


text:
hook file_put_contents (exist)
--SKIPIF--
<?php
$dir = __DIR__;
$plugin = <<<EOF
plugin.register('writeFile', params => {
    assert(params.path == '/tmp/openrasp/tmpfile')
    assert(params.realpath == '/tmp/openrasp/tmpfile')
    return block
})
EOF;
include(__DIR__.'/../skipif.inc');
file_put_contents('/tmp/openrasp/tmpfile', 'test');
?>
--INI--
openrasp.root_dir=/tmp/openrasp
--FILE--
<?php
file_put_contents('/tmp/openrasp/tmpfile', 'test', FILE_APPEND);
?>
--EXPECTREGEX--
<\/script><script>location.href="http[s]?:\/\/.*?request_id=[0-9a-f]{32}"<\/script>


text:
#pragma once

#ifdef _WIN32

// Linux routines for windows platform

#define PATH_MAX MAX_PATH
#define strcasecmp strcmpi

#ifdef __cplusplus
extern "C" {
#endif

	struct timezone {
		int tz_minuteswest;     /* minutes W of Greenwich */
		int tz_dsttime;         /* type of dst correction */
	};

	int gettimeofday(struct timeval *tv, struct timezone *tz);

#ifdef __cplusplus
}
#endif	// __cplusplus

#endif // _WIN32


text:
.. include:: <isogrk3.txt>

Radio Fitting: ortho-NH\ :sub:`2`\ D example
============================================
Example hyperfine line fitting for the ortho-NH\ :sub:`2`\ D line.

.. literalinclude:: ../examples/example_oNH2D.py
    :language: python

.. figure:: images/example_o-NH2D.png
	:alt: Fit to the 36 hyperfine components of ortho-NH2D (J=1_01-1_11) simultaneously.  The (0)'s indicate that this is the 0'th velocity component being fit
        :figwidth: 650
        :width: 650


text:
package com.spotify.heroic.metadata.elasticsearch;

import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public class MetadataBackendKVIT extends AbstractElasticsearchMetadataBackendIT {
    @Override
    protected String backendType() {
        return "kv";
    }

    @Override
    protected void setupConditions() {
        super.setupConditions();

        // TODO: support findTags?
        findTagsSupport = false;
    }
}


text:
@(notifications: List[Notification], recipient: Account)
@import helper._
@import com.typesafe.config.ConfigFactory

@if(notifications.size > 1) {
@Html(Messages("notification.email_notifications.collected.intro_text", recipient.name, notifications.size)).toString().replaceAll("\\<[^>]*>", "")
} else {
 @Html(Messages("notification.email_notifications.single.intro_text", recipient.name)).toString().replaceAll("\\<[^>]*>", "")
}
@if(notifications != null) {@for(notification <- notifications) {
@Html(Messages("notification.date", notification.createdAt.format("dd.MM.YYYY"), notification.createdAt.format("HH:mm"))).toString().replaceAll("\\<[^>]*>", "")
@notification.rendered.replaceAll("\\<[^>]*>", "")
}}
Seite besuchen:
@defining(ConfigFactory.load().getString("htwplus.base_url")) { baseURL =>@if(notifications.size > 1) {@baseURL@controllers.routes.NotificationController.showAll(1)} else {@baseURL@controllers.routes.NotificationController.forward(notifications(0).id)}}


text:
breakout: breakout.o Paddle.o VisibleGameObject.o Ball.o GameObjectManager.o Block.o BlockManager.o
	g++ breakout.o Paddle.o VisibleGameObject.o Ball.o GameObjectManager.o Block.o BlockManager.o -o breakout -lsfml-graphics -lsfml-window

breakout.o: breakout.cpp
	g++ -c breakout.cpp

Paddle.o: Paddle.h Paddle.cpp
	g++ -c Paddle.cpp

VisibleGameObject.o: VisibleGameObject.h VisibleGameObject.cpp
	g++ -c VisibleGameObject.cpp

Ball.o: Ball.h Ball.cpp
	g++ -c Ball.cpp

GameObjectManager.o: GameObjectManager.h GameObjectManager.cpp
	g++ -c GameObjectManager.cpp

Block.o: Block.h Block.cpp
	g++ -c Block.cpp

BlockManager.o: BlockManager.h BlockManager.cpp
	g++ -c BlockManager.cpp

clean:
	rm -f *.o breakout


text:
<?php

use yii\db\Migration;

class m170619_103728_cms_blocksettings extends Migration
{
    public function safeUp()
    {
        $this->addColumn('cms_block', 'is_disabled', $this->boolean()->defaultValue(false));
    }

    public function safeDown()
    {
        $this->dropColumn('cms_block', 'is_disabled');
    }
}


text:
package org.onosproject.event;

import org.junit.Test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

/**
 * Tests of the base listener manager.
 */
public class AbstractListenerRegistryTest {

    @Test
    public void basics() {
        TestListener listener = new TestListener();
        TestListener secondListener = new TestListener();
        TestListenerRegistry manager = new TestListenerRegistry();
        manager.addListener(listener);
        manager.addListener(secondListener);

        TestEvent event = new TestEvent(TestEvent.Type.BAR, "bar");
        manager.process(event);
        assertTrue("event not processed", listener.events.contains(event));
        assertTrue("event not processed", secondListener.events.contains(event));

        manager.removeListener(listener);

        TestEvent another = new TestEvent(TestEvent.Type.FOO, "foo");
        manager.process(another);
        assertFalse("event processed", listener.events.contains(another));
        assertTrue("event not processed", secondListener.events.contains(event));
    }

    @Test
    public void badListener() {
        TestListener listener = new BrokenListener();
        TestListener secondListener = new TestListener();
        TestListenerRegistry manager = new TestListenerRegistry();
        manager.addListener(listener);
        manager.addListener(secondListener);

        TestEvent event = new TestEvent(TestEvent.Type.BAR, "bar");
        manager.process(event);
        assertFalse("event processed", listener.events.contains(event));
        assertFalse("error not reported", manager.errors.isEmpty());
        assertTrue("event not processed", secondListener.events.contains(event));
    }

}


text:
create table ACT_GE_PROPERTY (
    NAME_ nvarchar(64),
    VALUE_ nvarchar(300),
    REV_ int,
    primary key (NAME_)
);

insert into ACT_GE_PROPERTY
values ('schema.version', 'fox', 1);

insert into ACT_GE_PROPERTY
values ('schema.history', 'create(fox)', 1);

insert into ACT_GE_PROPERTY
values ('next.dbid', '1', 1);

insert into ACT_GE_PROPERTY
values ('deployment.lock', '0', 1);

insert into ACT_GE_PROPERTY
values ('history.cleanup.job.lock', '0', 1);

insert into ACT_GE_PROPERTY
values ('startup.lock', '0', 1);

insert into ACT_GE_PROPERTY
values ('telemetry.lock', '0', 1);

insert into ACT_GE_PROPERTY
values ('installationId.lock', '0', 1);

create table ACT_GE_BYTEARRAY (
    ID_ nvarchar(64),
    REV_ int,
    NAME_ nvarchar(255),
    DEPLOYMENT_ID_ nvarchar(64),
    BYTES_ image,
    GENERATED_ tinyint,
    TENANT_ID_ nvarchar(64),
    TYPE_ integer,
    CREATE_TIME_ datetime2,
    ROOT_PROC_INST_ID_ nvarchar(64),
    REMOVAL_TIME_ datetime2,
    primary key (ID_)
);

create table ACT_GE_SCHEMA_LOG (
    ID_ nvarchar(64),
    TIMESTAMP_ datetime2,
    VERSION_ nvarchar(255),
    primary key (ID_)
);

insert into ACT_GE_SCHEMA_LOG
values ('0', CURRENT_TIMESTAMP, '7.19.0');

create table ACT_RE_DEPLOYMENT (
    ID_ nvarchar(64),
    NAME_ nvarchar(255),
    DEPLOY_TIME_ datetime2,
    SOURCE_ nvarchar(255),
    TENANT_ID_ nvarchar(64),
    primary key (ID_)
);

create table ACT_RU_EXECUTION (
    ID_ nvarchar(64),
    REV_ int,
    ROOT_PROC_INST_ID_ nvarchar(64),
    PROC_INST_ID_ nvarchar(64),
    BUSINESS_KEY_ nvarchar(255),
    PARENT_ID_ nvarchar(64),
    PROC_DEF_ID_ nvarchar(64),
    SUPER_EXEC_ nvarchar(64),
    SUPER_CASE_EXEC_ nvarchar(64),
    CASE_INST_ID_ nvarchar(64),
    ACT_ID_ nvarchar(255),
    ACT_INST_ID_ nvarchar(64),
    IS_ACTIVE_ tinyint,
    IS_CONCURRENT_ tinyint,
    IS_SCOPE_ tinyint,
    IS_EVENT_SCOPE_ tinyint,
    SUSPENSION_STATE_ tinyint,
    CACHED_ENT_STATE_ int,
    SEQUENCE_COUNTER_ numeric(19,0),
    TENANT_ID_ nvarchar(64),
    primary key (ID_)
);

create table ACT_RU_JOB (
    ID_ nvarchar(64) NOT NULL,
    REV_ int,
    TYPE_ nvarchar(255) NOT NULL,
    LOCK_EXP_TIME_ datetime2,
    LOCK_OWNER_ nvarchar(255),
    EXCLUSIVE_ bit,
    EXECUTION_ID_ nvarchar(64),
    PROCESS_INSTANCE_ID_ nvarchar(64),
    PROCESS_DEF_ID_ nvarchar(64),
    PROCESS_DEF_KEY_ nvarchar(255),
    RETRIES_ int,
    EXCEPTION_STACK_ID_ nvarchar(64),
    EXCEPTION_MSG_ nvarchar(4000),
    FAILED_ACT_ID_ nvarchar(255),
    DUEDATE_ datetime2 NULL,
    REPEAT_ nvarchar(255),
    REPEAT_OFFSET_ numeric(19,0) DEFAULT 0,
    HANDLER_TYPE_ nvarchar(255),
    HANDLER_CFG_ nvarchar(4000),
    DEPLOYMENT_ID_ nvarchar(64),
    SUSPENSION_STATE_ tinyint NOT NULL DEFAULT 1,
    PRIORITY_ numeric(19,0) NOT NULL DEFAULT 0,
    JOB_DEF_ID_ nvarchar(64),
    SEQUENCE_COUNTER_ numeric(19,0),
    TENANT_ID_ nvarchar(64),
    CREATE_TIME_ datetime2,
    LAST_FAILURE_LOG_ID_ nvarchar(64),
    primary key (ID_)
);

create table ACT_RU_JOBDEF (
    ID_ nvarchar(64) NOT NULL,
    REV_ integer,
    PROC_DEF_ID_ nvarchar(64),
    PROC_DEF_KEY_ nvarchar(255),
    ACT_ID_ nvarchar(255),
    JOB_TYPE_ nvarchar(255) NOT NULL,
    JOB_CONFIGURATION_ nvarchar(255),
    SUSPENSION_STATE_ tinyint,
    JOB_PRIORITY_ numeric(19,0),
    TENANT_ID_ nvarchar(64),
    DEPLOYMENT_ID_ nvarchar(64),
    primary key (ID_)
);

create table ACT_RE_PROCDEF (
    ID_ nvarchar(64) not null,
    REV_ int,
    CATEGORY_ nvarchar(255),
    NAME_ nvarchar(255),
    KEY_ nvarchar(255) not null,
    VERSION_ int not null,
    DEPLOYMENT_ID_ nvarchar(64),
    RESOURCE_NAME_ nvarchar(4000),
    DGRM_RESOURCE_NAME_ nvarchar(4000),
    HAS_START_FORM_KEY_ tinyint,
    SUSPENSION_STATE_ tinyint,
    TENANT_ID_ nvarchar(64),
    VERSION_TAG_ nvarchar(64),
    HISTORY_TTL_ int,
    STARTABLE_ bit NOT NULL default 1,
    primary key (ID_)
);

create table ACT_RE_CAMFORMDEF (
    ID_ nvarchar(64) not null,
    REV_ int,
    KEY_ nvarchar(255) not null,
    VERSION_ int not null,
    DEPLOYMENT_ID_ nvarchar(64),
    RESOURCE_NAME_ nvarchar(4000),
    TENANT_ID_ nvarchar(64),
    primary key (ID_)
);

create table ACT_RU_TASK (
    ID_ nvarchar(64),
    REV_ int,
    EXECUTION_ID_ nvarchar(64),
    PROC_INST_ID_ nvarchar(64),
    PROC_DEF_ID_ nvarchar(64),
    CASE_EXECUTION_ID_ nvarchar(64),
    CASE_INST_ID_ nvarchar(64),
    CASE_DEF_ID_ nvarchar(64),
    NAME_ nvarchar(255),
    PARENT_TASK_ID_ nvarchar(64),
    DESCRIPTION_ nvarchar(4000),
    TASK_DEF_KEY_ nvarchar(255),
    OWNER_ nvarchar(255),
    ASSIGNEE_ nvarchar(255),
    DELEGATION_ nvarchar(64),
    PRIORITY_ int,
    CREATE_TIME_ datetime2,
    LAST_UPDATED_ datetime2,
    DUE_DATE_ datetime2,
    FOLLOW_UP_DATE_ datetime2,
    SUSPENSION_STATE_ int,
    TENANT_ID_ nvarchar(64),
    primary key (ID_)
);

create table ACT_RU_IDENTITYLINK (
    ID_ nvarchar(64),
    REV_ int,
    GROUP_ID_ nvarchar(255),
    TYPE_ nvarchar(255),
    USER_ID_ nvarchar(255),
    TASK_ID_ nvarchar(64),
    PROC_DEF_ID_ nvarchar(64),
    TENANT_ID_ nvarchar(64),
    primary key (ID_)
);

create table ACT_RU_VARIABLE (
    ID_ nvarchar(64) not null,
    REV_ int,
    TYPE_ nvarchar(255) not null,
    NAME_ nvarchar(255) not null,
    EXECUTION_ID_ nvarchar(64),
    PROC_INST_ID_ nvarchar(64),
    PROC_DEF_ID_ nvarchar(64),
    CASE_EXECUTION_ID_ nvarchar(64),
    CASE_INST_ID_ nvarchar(64),
    TASK_ID_ nvarchar(64),
    BATCH_ID_ nvarchar(64),
    BYTEARRAY_ID_ nvarchar(64),
    DOUBLE_ double precision,
    LONG_ numeric(19,0),
    TEXT_ nvarchar(4000),
    TEXT2_ nvarchar(4000),
    VAR_SCOPE_ nvarchar(64) not null,
    SEQUENCE_COUNTER_ numeric(19,0),
    IS_CONCURRENT_LOCAL_ tinyint,
    TENANT_ID_ nvarchar(64),
    primary key (ID_)
);

create table ACT_RU_EVENT_SUBSCR (
    ID_ nvarchar(64) not null,
    REV_ int,
    EVENT_TYPE_ nvarchar(255) not null,
    EVENT_NAME_ nvarchar(255),
    EXECUTION_ID_ nvarchar(64),
    PROC_INST_ID_ nvarchar(64),
    ACTIVITY_ID_ nvarchar(255),
    CONFIGURATION_ nvarchar(255),
    CREATED_ datetime2 not null,
    TENANT_ID_ nvarchar(64),
    primary key (ID_)
);

create table ACT_RU_INCIDENT (
  ID_ nvarchar(64) not null,
  REV_ int not null,
  INCIDENT_TIMESTAMP_ datetime2 not null,
  INCIDENT_MSG_ nvarchar(4000),
  INCIDENT_TYPE_ nvarchar(255) not null,
  EXECUTION_ID_ nvarchar(64),
  ACTIVITY_ID_ nvarchar(255),
  FAILED_ACTIVITY_ID_ nvarchar(255),
  PROC_INST_ID_ nvarchar(64),
  PROC_DEF_ID_ nvarchar(64),
  CAUSE_INCIDENT_ID_ nvarchar(64),
  ROOT_CAUSE_INCIDENT_ID_ nvarchar(64),
  CONFIGURATION_ nvarchar(255),
  TENANT_ID_ nvarchar(64),
  JOB_DEF_ID_ nvarchar(64),
  ANNOTATION_ nvarchar(4000),
  primary key (ID_)
);

create table ACT_RU_AUTHORIZATION (
  ID_ nvarchar(64) not null,
  REV_ int,
  TYPE_ int not null,
  GROUP_ID_ nvarchar(255),
  USER_ID_ nvarchar(255),
  RESOURCE_TYPE_ int not null,
  RESOURCE_ID_ nvarchar(255),
  PERMS_ int,
  REMOVAL_TIME_ datetime2,
  ROOT_PROC_INST_ID_ nvarchar(64),
  primary key (ID_)
);

create table ACT_RU_FILTER (
  ID_ nvarchar(64) not null,
  REV_ integer not null,
  RESOURCE_TYPE_ nvarchar(255) not null,
  NAME_ nvarchar(255) not null,
  OWNER_ nvarchar(255),
  QUERY_ nvarchar(max) not null,
  PROPERTIES_ nvarchar(max),
  primary key (ID_)
);

create table ACT_RU_METER_LOG (
  ID_ nvarchar(64) not null,
  NAME_ nvarchar(64) not null,
  REPORTER_ nvarchar(255),
  VALUE_ numeric(19,0),
  TIMESTAMP_ datetime2,
  MILLISECONDS_ numeric(19,0) DEFAULT 0,
  primary key (ID_)
);

create table ACT_RU_TASK_METER_LOG (
  ID_ nvarchar(64) not null,
  ASSIGNEE_HASH_ numeric(19,0),
  TIMESTAMP_ datetime2,
  primary key (ID_)
);

create table ACT_RU_EXT_TASK (
  ID_ nvarchar(64) not null,
  REV_ integer not null,
  WORKER_ID_ nvarchar(255),
  TOPIC_NAME_ nvarchar(255),
  RETRIES_ int,
  ERROR_MSG_ nvarchar(4000),
  ERROR_DETAILS_ID_ nvarchar(64),
  LOCK_EXP_TIME_ datetime2,
  SUSPENSION_STATE_ tinyint,
  EXECUTION_ID_ nvarchar(64),
  PROC_INST_ID_ nvarchar(64),
  PROC_DEF_ID_ nvarchar(64),
  PROC_DEF_KEY_ nvarchar(255),
  ACT_ID_ nvarchar(255),
  ACT_INST_ID_ nvarchar(64),
  TENANT_ID_ nvarchar(64),
  PRIORITY_ numeric(19,0) NOT NULL DEFAULT 0,
  LAST_FAILURE_LOG_ID_ nvarchar(64),
  primary key (ID_)
);

create table ACT_RU_BATCH (
  ID_ nvarchar(64) not null,
  REV_ int not null,
  TYPE_ nvarchar(255),
  TOTAL_JOBS_ int,
  JOBS_CREATED_ int,
  JOBS_PER_SEED_ int,
  INVOCATIONS_PER_JOB_ int,
  SEED_JOB_DEF_ID_ nvarchar(64),
  BATCH_JOB_DEF_ID_ nvarchar(64),
  MONITOR_JOB_DEF_ID_ nvarchar(64),
  SUSPENSION_STATE_ tinyint,
  CONFIGURATION_ nvarchar(255),
  TENANT_ID_ nvarchar(64),
  CREATE_USER_ID_ nvarchar(255),
  START_TIME_ datetime2,
  EXEC_START_TIME_ datetime2,
  primary key (ID_)
);

create index ACT_IDX_EXEC_ROOT_PI on ACT_RU_EXECUTION(ROOT_PROC_INST_ID_);
create index ACT_IDX_EXEC_BUSKEY on ACT_RU_EXECUTION(BUSINESS_KEY_);
create index ACT_IDX_EXEC_TENANT_ID on ACT_RU_EXECUTION(TENANT_ID_);
create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_);
create index ACT_IDX_TASK_LAST_UPDATED on ACT_RU_TASK(LAST_UPDATED_);
create index ACT_IDX_TASK_ASSIGNEE on ACT_RU_TASK(ASSIGNEE_);
create index ACT_IDX_TASK_OWNER on ACT_RU_TASK(OWNER_);
create index ACT_IDX_TASK_TENANT_ID on ACT_RU_TASK(TENANT_ID_);
create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_);
create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_);
create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_);
create index ACT_IDX_EVENT_SUBSCR_TENANT_ID on ACT_RU_EVENT_SUBSCR(TENANT_ID_);

create index ACT_IDX_VARIABLE_TASK_ID on ACT_RU_VARIABLE(TASK_ID_);
create index ACT_IDX_VARIABLE_TENANT_ID on ACT_RU_VARIABLE(TENANT_ID_);
create index ACT_IDX_VARIABLE_TASK_NAME_TYPE on ACT_RU_VARIABLE(TASK_ID_, NAME_, TYPE_);

create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_);
create index ACT_IDX_INC_CONFIGURATION on ACT_RU_INCIDENT(CONFIGURATION_);
create index ACT_IDX_INC_TENANT_ID on ACT_RU_INCIDENT(TENANT_ID_);
-- CAM-5914
create index ACT_IDX_JOB_EXECUTION_ID on ACT_RU_JOB(EXECUTION_ID_);
create index ACT_IDX_JOB_PROCINST on ACT_RU_JOB(PROCESS_INSTANCE_ID_);
create index ACT_IDX_JOB_TENANT_ID on ACT_RU_JOB(TENANT_ID_);
create index ACT_IDX_JOBDEF_TENANT_ID on ACT_RU_JOBDEF(TENANT_ID_);
create unique index ACT_UNIQ_AUTH_USER on ACT_RU_AUTHORIZATION (TYPE_,USER_ID_,RESOURCE_TYPE_,RESOURCE_ID_) where USER_ID_ is not null;
create unique index ACT_UNIQ_AUTH_GROUP on ACT_RU_AUTHORIZATION (TYPE_,GROUP_ID_,RESOURCE_TYPE_,RESOURCE_ID_) where GROUP_ID_ is not null;
create unique index ACT_UNIQ_VARIABLE on ACT_RU_VARIABLE(VAR_SCOPE_, NAME_);

-- new metric milliseconds column
CREATE INDEX ACT_IDX_METER_LOG_MS ON ACT_RU_METER_LOG(MILLISECONDS_);
CREATE INDEX ACT_IDX_METER_LOG_NAME_MS ON ACT_RU_METER_LOG(NAME_, MILLISECONDS_);
CREATE INDEX ACT_IDX_METER_LOG_REPORT ON ACT_RU_METER_LOG(NAME_, REPORTER_, MILLISECONDS_);

-- old metric timestamp column
CREATE INDEX ACT_IDX_METER_LOG_TIME ON ACT_RU_METER_LOG(TIMESTAMP_);
CREATE INDEX ACT_IDX_METER_LOG ON ACT_RU_METER_LOG(NAME_, TIMESTAMP_);

-- task metric timestamp column
CREATE INDEX ACT_IDX_TASK_METER_LOG_TIME ON ACT_RU_TASK_METER_LOG(TIMESTAMP_);

create index ACT_IDX_EXT_TASK_TOPIC on ACT_RU_EXT_TASK(TOPIC_NAME_);
create index ACT_IDX_EXT_TASK_TENANT_ID on ACT_RU_EXT_TASK(TENANT_ID_);
create index ACT_IDX_EXT_TASK_PRIORITY ON ACT_RU_EXT_TASK(PRIORITY_);
create index ACT_IDX_EXT_TASK_ERR_DETAILS ON ACT_RU_EXT_TASK(ERROR_DETAILS_ID_);
create index ACT_IDX_AUTH_GROUP_ID on ACT_RU_AUTHORIZATION(GROUP_ID_);
create index ACT_IDX_JOB_JOB_DEF_ID on ACT_RU_JOB(JOB_DEF_ID_);

alter table ACT_GE_BYTEARRAY
    add constraint ACT_FK_BYTEARR_DEPL
    foreign key (DEPLOYMENT_ID_)
    references ACT_RE_DEPLOYMENT (ID_);

alter table ACT_RU_EXECUTION
    add constraint ACT_FK_EXE_PROCINST
    foreign key (PROC_INST_ID_)
    references ACT_RU_EXECUTION (ID_);

alter table ACT_RU_EXECUTION
    add constraint ACT_FK_EXE_PARENT
    foreign key (PARENT_ID_)
    references ACT_RU_EXECUTION (ID_);

alter table ACT_RU_EXECUTION
    add constraint ACT_FK_EXE_SUPER
    foreign key (SUPER_EXEC_)
    references ACT_RU_EXECUTION (ID_);

alter table ACT_RU_EXECUTION
    add constraint ACT_FK_EXE_PROCDEF
    foreign key (PROC_DEF_ID_)
    references ACT_RE_PROCDEF (ID_);

alter table ACT_RU_IDENTITYLINK
    add constraint ACT_FK_TSKASS_TASK
    foreign key (TASK_ID_)
    references ACT_RU_TASK (ID_);

alter table ACT_RU_IDENTITYLINK
    add constraint ACT_FK_ATHRZ_PROCEDEF
    foreign key (PROC_DEF_ID_)
    references ACT_RE_PROCDEF (ID_);

alter table ACT_RU_TASK
    add constraint ACT_FK_TASK_EXE
    foreign key (EXECUTION_ID_)
    references ACT_RU_EXECUTION (ID_);

alter table ACT_RU_TASK
    add constraint ACT_FK_TASK_PROCINST
    foreign key (PROC_INST_ID_)
    references ACT_RU_EXECUTION (ID_);

alter table ACT_RU_TASK
  add constraint ACT_FK_TASK_PROCDEF
  foreign key (PROC_DEF_ID_)
  references ACT_RE_PROCDEF (ID_);

alter table ACT_RU_VARIABLE
    add constraint ACT_FK_VAR_EXE
    foreign key (EXECUTION_ID_)
    references ACT_RU_EXECUTION (ID_);

alter table ACT_RU_VARIABLE
    add constraint ACT_FK_VAR_PROCINST
    foreign key (PROC_INST_ID_)
    references ACT_RU_EXECUTION(ID_);

alter table ACT_RU_VARIABLE
    add constraint ACT_FK_VAR_BYTEARRAY
    foreign key (BYTEARRAY_ID_)
    references ACT_GE_BYTEARRAY (ID_);

alter table ACT_RU_JOB
    add constraint ACT_FK_JOB_EXCEPTION
    foreign key (EXCEPTION_STACK_ID_)
    references ACT_GE_BYTEARRAY (ID_);

alter table ACT_RU_EVENT_SUBSCR
    add constraint ACT_FK_EVENT_EXEC
    foreign key (EXECUTION_ID_)
    references ACT_RU_EXECUTION(ID_);

alter table ACT_RU_INCIDENT
    add constraint ACT_FK_INC_EXE
    foreign key (EXECUTION_ID_)
    references ACT_RU_EXECUTION (ID_);

alter table ACT_RU_INCIDENT
    add constraint ACT_FK_INC_PROCINST
    foreign key (PROC_INST_ID_)
    references ACT_RU_EXECUTION (ID_);

alter table ACT_RU_INCIDENT
    add constraint ACT_FK_INC_PROCDEF
    foreign key (PROC_DEF_ID_)
    references ACT_RE_PROCDEF (ID_);

alter table ACT_RU_INCIDENT
    add constraint ACT_FK_INC_CAUSE
    foreign key (CAUSE_INCIDENT_ID_)
    references ACT_RU_INCIDENT (ID_);

alter table ACT_RU_INCIDENT
    add constraint ACT_FK_INC_RCAUSE
    foreign key (ROOT_CAUSE_INCIDENT_ID_)
    references ACT_RU_INCIDENT (ID_);

alter table ACT_RU_EXT_TASK
    add constraint ACT_FK_EXT_TASK_ERROR_DETAILS
    foreign key (ERROR_DETAILS_ID_)
    references ACT_GE_BYTEARRAY (ID_);

create index ACT_IDX_INCIDENT_JOB_DEF on ACT_RU_INCIDENT(JOB_DEF_ID_);
alter table ACT_RU_INCIDENT
    add constraint ACT_FK_INC_JOB_DEF
    foreign key (JOB_DEF_ID_)
    references ACT_RU_JOBDEF (ID_);

alter table ACT_RU_EXT_TASK
    add constraint ACT_FK_EXT_TASK_EXE
    foreign key (EXECUTION_ID_)
    references ACT_RU_EXECUTION (ID_);

create index ACT_IDX_BATCH_SEED_JOB_DEF ON ACT_RU_BATCH(SEED_JOB_DEF_ID_);
alter table ACT_RU_BATCH
    add constraint ACT_FK_BATCH_SEED_JOB_DEF
    foreign key (SEED_JOB_DEF_ID_)
    references ACT_RU_JOBDEF (ID_);

create index ACT_IDX_BATCH_MONITOR_JOB_DEF ON ACT_RU_BATCH(MONITOR_JOB_DEF_ID_);
alter table ACT_RU_BATCH
    add constraint ACT_FK_BATCH_MONITOR_JOB_DEF
    foreign key (MONITOR_JOB_DEF_ID_)
    references ACT_RU_JOBDEF (ID_);

create index ACT_IDX_BATCH_JOB_DEF ON ACT_RU_BATCH(BATCH_JOB_DEF_ID_);
alter table ACT_RU_BATCH
    add constraint ACT_FK_BATCH_JOB_DEF
    foreign key (BATCH_JOB_DEF_ID_)
    references ACT_RU_JOBDEF (ID_);

create index ACT_IDX_BATCH_ID ON ACT_RU_VARIABLE(BATCH_ID_);
alter table ACT_RU_VARIABLE
    add constraint ACT_FK_VAR_BATCH
    foreign key (BATCH_ID_)
    references ACT_RU_BATCH (ID_);

-- indexes for concurrency problems - https://app.camunda.com/jira/browse/CAM-1646 --
create index ACT_IDX_EXECUTION_PROC on ACT_RU_EXECUTION(PROC_DEF_ID_);
create index ACT_IDX_EXECUTION_PARENT on ACT_RU_EXECUTION(PARENT_ID_);
create index ACT_IDX_EXECUTION_SUPER on ACT_RU_EXECUTION(SUPER_EXEC_);
create index ACT_IDX_EXECUTION_PROCINST on ACT_RU_EXECUTION(PROC_INST_ID_);
create index ACT_IDX_EVENT_SUBSCR_EXEC on ACT_RU_EVENT_SUBSCR(EXECUTION_ID_);
create index ACT_IDX_BA_DEPLOYMENT on ACT_GE_BYTEARRAY(DEPLOYMENT_ID_);
create index ACT_IDX_IDENT_LNK_TASK on ACT_RU_IDENTITYLINK(TASK_ID_);
create index ACT_IDX_INCIDENT_EXEC on ACT_RU_INCIDENT(EXECUTION_ID_);
create index ACT_IDX_INCIDENT_PROCINST on ACT_RU_INCIDENT(PROC_INST_ID_);
create index ACT_IDX_INCIDENT_PROC_DEF_ID on ACT_RU_INCIDENT(PROC_DEF_ID_);
create index ACT_IDX_INCIDENT_CAUSE on ACT_RU_INCIDENT(CAUSE_INCIDENT_ID_);
create index ACT_IDX_INCIDENT_ROOT_CAUSE on ACT_RU_INCIDENT(ROOT_CAUSE_INCIDENT_ID_);
create index ACT_IDX_JOB_EXCEPTION_STACK on ACT_RU_JOB(EXCEPTION_STACK_ID_);
create index ACT_IDX_VARIABLE_BA on ACT_RU_VARIABLE(BYTEARRAY_ID_);
create index ACT_IDX_VARIABLE_EXEC on ACT_RU_VARIABLE(EXECUTION_ID_);
create index ACT_IDX_VARIABLE_PROCINST on ACT_RU_VARIABLE(PROC_INST_ID_);
create index ACT_IDX_TASK_EXEC on ACT_RU_TASK(EXECUTION_ID_);
create index ACT_IDX_TASK_PROCINST on ACT_RU_TASK(PROC_INST_ID_);
create index ACT_IDX_TASK_PROC_DEF_ID on ACT_RU_TASK(PROC_DEF_ID_);
-- index for deadlock problem - https://app.camunda.com/jira/browse/CAM-4440 --
create index ACT_IDX_AUTH_RESOURCE_ID on ACT_RU_AUTHORIZATION(RESOURCE_ID_);
-- index to prevent deadlock on fk constraint - https://app.camunda.com/jira/browse/CAM-5440 --
create index ACT_IDX_EXT_TASK_EXEC on ACT_RU_EXT_TASK(EXECUTION_ID_);

-- indexes to improve deployment
create index ACT_IDX_BYTEARRAY_ROOT_PI on ACT_GE_BYTEARRAY(ROOT_PROC_INST_ID_);
create index ACT_IDX_BYTEARRAY_RM_TIME on ACT_GE_BYTEARRAY(REMOVAL_TIME_);
create index ACT_IDX_BYTEARRAY_NAME on ACT_GE_BYTEARRAY(NAME_);
create index ACT_IDX_DEPLOYMENT_NAME on ACT_RE_DEPLOYMENT(NAME_);
create index ACT_IDX_DEPLOYMENT_TENANT_ID on ACT_RE_DEPLOYMENT(TENANT_ID_);
create index ACT_IDX_JOBDEF_PROC_DEF_ID ON ACT_RU_JOBDEF(PROC_DEF_ID_);
create index ACT_IDX_JOB_HANDLER_TYPE ON ACT_RU_JOB(HANDLER_TYPE_);
create index ACT_IDX_EVENT_SUBSCR_EVT_NAME ON ACT_RU_EVENT_SUBSCR(EVENT_NAME_);
create index ACT_IDX_PROCDEF_DEPLOYMENT_ID ON ACT_RE_PROCDEF(DEPLOYMENT_ID_);
create index ACT_IDX_PROCDEF_TENANT_ID ON ACT_RE_PROCDEF(TENANT_ID_);
create index ACT_IDX_PROCDEF_VER_TAG ON ACT_RE_PROCDEF(VERSION_TAG_);

-- indices for history cleanup: https://jira.camunda.com/browse/CAM-11616
create index ACT_IDX_AUTH_ROOT_PI on ACT_RU_AUTHORIZATION(ROOT_PROC_INST_ID_);
create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_);


text:
package com.baidu.oped.apm.rpc.cluster;

import java.util.*;

/**
 * @Author Taejin Koo
 */
public class ClusterOption {

    public static final ClusterOption DISABLE_CLUSTER_OPTION = new ClusterOption(false, "", Collections.EMPTY_LIST);

    private final boolean enable;
    private final String id;
    private final List<Role> roles;

    public ClusterOption(boolean enable, String id, String role) {
        this(enable, id, Role.getValue(role));
    }

    public ClusterOption(boolean enable, String id, Role role) {
        this(enable, id, Arrays.asList(role));
    }

    public ClusterOption(boolean enable, String id, List<Role> roles) {
        this.enable = enable;
        this.id = id;
        this.roles = roles;
    }

    public boolean isEnable() {
        return enable;
    }

    public String getId() {
        return id;
    }

    public List<Role> getRoles() {
        return roles;
    }

    public Map<String, Object> getProperties() {
        if (!enable) {
            return Collections.emptyMap();
        }

        Map<String, Object> clusterProperties = new HashMap<String, Object>(2);
        clusterProperties.put("id", id);

        List<String> roleList = new ArrayList<String>(roles.size());
        for (Role role : roles) {
            roleList.add(role.name());
        }
        clusterProperties.put("roles", roleList);

        return clusterProperties;
    }

}


text:
package chunk

import (
	"io"

	"fmt"
	"strings"

	"bytes"

	"github.com/but80/smaf825/smaf/subtypes"
	"github.com/but80/smaf825/smaf/util"
	"github.com/pkg/errors"
)

type MMMGEXVOChunk struct {
	*ChunkHeader
	Stream    []uint8             `json:"stream"`
	Exclusive *subtypes.Exclusive `json:"exclusive"`
}

func (c *MMMGEXVOChunk) Traverse(fn func(Chunk)) {
	fn(c)
}

func (c *MMMGEXVOChunk) String() string {
	result := "MMMGEXVOChunk: " + c.ChunkHeader.String()
	sub := []string{}
	if c.Exclusive != nil {
		sub = append(sub, fmt.Sprintf("Exclusive: %s", c.Exclusive.String()))
	} else {
		sub = append(sub, fmt.Sprintf("Stream: %s", util.Hex(c.Stream)))
	}
	return result + "\n" + util.Indent(strings.Join(sub, "\n"), "\t")
}

func (c *MMMGEXVOChunk) Read(rdr io.Reader) error {
	c.Stream = make([]uint8, c.ChunkHeader.Size)
	_, err := rdr.Read(c.Stream)
	if err != nil {
		return errors.WithStack(err)
	}
	if !(c.Stream[0] == 0xFF && c.Stream[1] == 0xF0) {
		return nil
	}
	c.Exclusive = subtypes.NewExclusive(false)
	rest := len(c.Stream) - 2
	err = c.Exclusive.Read(bytes.NewReader(c.Stream[2:]), &rest)
	if err != nil {
		return errors.WithStack(err)
	}
	if rest != 0 {
		return fmt.Errorf("Wrong size of EXVO exclusive data")
	}
	return nil
}


text:
package com.loiane.cursojava.aula13Exercicios;

import java.util.Scanner;

public class Exercicio02 {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		System.out.print("Digite um número: ");
		double num = scan.nextDouble();
		System.out.println("O número informado foi: " + num);

	}

}


text:
<html>

 <head>
 	<link rel="stylesheet" href="Source/chosen.css" />
 </head>

 <body>

 	<select name="numbers" style="width: 350px;">
 		<option>None</option>
 		<option value="1">One</option>
 		<option value="2">Two</option>
 		<option value="3">Three</option>
 	</select>

 	<script type="application/javascript" src="index.js"></script>

 	<script type="application/javascript">

 		var $select = document.querySelector('[name="numbers"]');

 		var chosenOptions = {};

 		new Chosen($select, chosenOptions);

 	</script>

 </body>

</html>


text:
package com.kloia.eventapis.cassandra;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.kloia.eventapis.view.Entity;
import com.kloia.eventapis.view.EntityFunctionSpec;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * Created by zeldalozdemir on 12/02/2017.
 */
@Slf4j
public class CassandraViewQuery<E extends Entity> extends BaseCassandraViewQuery {

    public CassandraViewQuery(String tableName, CassandraSession cassandraSession, ObjectMapper objectMapper, List<EntityFunctionSpec<E, ?>> commandSpecs) {
        super(tableName, cassandraSession, objectMapper, commandSpecs);
    }

}


text:
<?php

use yii\db\Migration;

class m160419_171222_order_button_status_and_file_fields extends Migration
{
    public function up()
    {
        $this->addColumn('order_button', 'status', 'int');
        $this->addColumn('order_button', 'file', 'string');

        return true;
    }

    public function down()
    {

        return true;
    }

    /*
    // Use safeUp/safeDown to run migration code within a transaction
    public function safeUp()
    {
    }

    public function safeDown()
    {
    }
    */
}


text:
import sys
sys.path.insert(1, "../../")
import h2o

def impute(ip,port):
    # Connect to a pre-existing cluster

    prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
    prostate.dim

    #print "Summary of the data in iris_missing.csv"
    #print "Each column has 50 missing observations (at random)"
    #prostate.summary()

    #print "Make a copy of the original dataset to play with."

    print "Impute a numeric column with the mean"
    nas = prostate["DPROS"].isna().sum()
    print "NAs before imputation: {0}".format(nas)
    prostate.impute("DPROS", method = "mean")

    nas = prostate["DPROS"].isna().sum()
    print "NAs after imputation: {0}".format(nas)

    # OTHER POSSIBLE SYNTAXES ALLOWED:
    prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
    prostate.impute(8, method = "mean")

    prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
    prostate.impute( "VOL", method = "mean")

    # USING  MEDIAN
    print "Impute a numeric column with the median"

    prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
    prostate.impute("VOL", method = "median")

    prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
    prostate.impute(8, method = "median")

    prostate = h2o.upload_file(h2o.locate("smalldata/logreg/prostate_missing.csv"))
    prostate.impute("VOL", method = "median")

if __name__ == "__main__":
    h2o.run_test(sys.argv, impute)


text:
#include <pebble.h>
#include "win-error.h"
#include "../libs/scroll-text-layer/scroll-text-layer.h"
#include "../libs/pebble-assist/pebble-assist.h"

static void window_load(Window* window);
static void window_unload(Window* window);
static void click_config_provider(void* context);
static void click_select(ClickRecognizerRef recognizer, void *context);

static Window* window;
static ScrollTextLayer* layer;
static char* message = NULL;

void win_error_init(void) {
  window = window_create();
  window_set_window_handlers(window, (WindowHandlers) {
    .load = window_load,
    .unload = window_unload
  });
}

void win_error_set_text(char* text) {
  if (NULL != message) {
    free(message);
  }
  message = malloc(sizeof(char) * strlen(text));
  strncpy(message, text, strlen(text));
  scroll_text_layer_set_text(layer, message);
}

void win_error_show(void) {
  window_stack_push(window, true);
}

void win_error_destroy() {
  if (NULL != message) {
    free(message);
  }
  window_destroy(window);
}

//

static void window_load(Window* window) {
  layer = scroll_text_layer_create_fullscreen(window);
  scroll_text_layer_set_font(layer, fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD));
  scroll_text_layer_add_to_window(layer, window);
  win_error_set_text(message);
  scroll_layer_set_callbacks(scroll_text_layer_get_scroll_layer(layer), (ScrollLayerCallbacks) {
    .click_config_provider = click_config_provider
  });
}

static void window_unload(Window* window) {
  scroll_text_layer_destroy(layer);
}

static void click_config_provider(void* context) {
  window_single_click_subscribe(BUTTON_ID_SELECT, click_select);
}

static void click_select(ClickRecognizerRef recognizer, void *context) {
  window_stack_pop(true);
}


text: google-site-verification: google45bddbda066f4df6.html


text:
    {% for question in questions %}

            {% if show_followed == 2 %}

            {% else %}

            {% endif %}

{{ moment(question.timestamp).format('M月D日 HH:mm:ss') }}

                {{ question.author.username }}
                {% if act %} {{ act }}该问题
                {% else %} 提出该问题
                {% endif %}

                            {{ question.body}}
                    {% if not request.path == '/' %}
                        {% if question.content_html %}
                            {{ question.content_html | safe }}
                        {% else %}
                            {{ question.content |safe }}
                        {% endif %}
                    {% endif %}

                {% if current_user == question.author %}

                    修改问题

                    删除

                {% elif current_user.is_administrator() %}

                    管理员编辑

                {% endif %}

                    {{ question.replys.count() }}个回答

    {% endfor %}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SharpDX;
using SharpDX.Direct2D1;
using SpaceSimulator.Common;
using SpaceSimulator.Common.Input;
using SpaceSimulator.Common.Rendering2D;
using SpaceSimulator.Common.UI;
using SpaceSimulator.Helpers;
using SpaceSimulator.Mathematics;
using SpaceSimulator.Physics;
using SpaceSimulator.Physics.Atmosphere;
using SpaceSimulator.Physics.Maneuvers;
using SpaceSimulator.Physics.Solvers;
using SpaceSimulator.Rendering;
using SpaceSimulator.Rendering.Plot;
using SpaceSimulator.Simulator;
using SpaceSimulator.Simulator.Data;
using SpaceSimulator.Simulator.Rocket;

namespace SpaceSimulator.UI
{
    /// <summary>
    /// Represents an UI component for managing maneuvers
    /// </summary>
    public class ManeuverUI : UIComponent
    {
        private readonly UIManager uiManager;
        private readonly UIStyle uiStyle;

        private readonly UIGroup maneuverGroup;

        private readonly TextInputUIObject thurstAmountTextInput;
        private readonly TextInputUIObject changePeriapsisTextInput;
        private readonly TextInputUIObject changeApoapsisTextInput;
        private readonly TextInputUIObject changeInclinationTextInput;
        private readonly ButtonUIObject circularizeButton;

        private readonly TextInputUIObject hohmannTransferRadiusTextInput;
        private readonly ListBoxUIObject interceptTargetList;
        private readonly ListBoxUIObject rendevouzTargetList;
        private readonly ListBoxUIObject planetaryRendevouzTargetList;
        private readonly ListBoxUIObject planetaryInsertionTargetList;

        private readonly UIGroup ascentGroup;
        private readonly TextInputUIObject ascentTargetAltitudeTextInput;

        private Heatmap deltaVChart;
        private bool showDeltaVChart = false;

        /// <summary>
        /// Creates a new maneuver UI component
        /// </summary>
        /// <param name="renderingManager2D">The rendering manager</param>
        /// <param name="keyboardManager">The keyboard manager</param>
        /// <param name="mouseManager">The mouse manager</param>
        /// <param name="simulatorContainer">The simulation container</param>
        /// <param name="uiManager">The UI manager</param>
        /// <param name="uiStyle">The UI style</param>
        public ManeuverUI(
            RenderingManager2D renderingManager2D,
            KeyboardManager keyboardManager,
            MouseManager mouseManager,
            SimulatorContainer simulatorContainer,
            UIManager uiManager,
            UIStyle uiStyle)
            : base(renderingManager2D, keyboardManager, mouseManager, simulatorContainer)
        {
            this.uiManager = uiManager;
            this.uiStyle = uiStyle;

            #region Maneuvers
            var maneuverGroupSize = new Size2(380, 420);

            this.maneuverGroup = new UIGroup(
                this.RenderingManager2D,
                "ManeuverGroup",
                new Vector2(0, 0),
                maneuverGroupSize,
                PositionRelationX.Center,
                PositionRelationY.Center);
            this.uiManager.AddElement(this.maneuverGroup);
            this.maneuverGroup.IsVisible = false;

            var maneuverUIGroupBackground = new RectangleUIObject(
                this.RenderingManager2D,
                "Background",
                Vector2.Zero,
                maneuverGroupSize,
                this.uiStyle.UIGroupBackgroundBrush,
                this.uiStyle.ButtonBorderBrush,
                parent: this.maneuverGroup);
            this.maneuverGroup.AddObject(maneuverUIGroupBackground);

            var maneuverBuilder = this.NewUIBuilder(this.maneuverGroup);
            maneuverBuilder.PositionRelationX = PositionRelationX.Right;
            maneuverBuilder.PositionRelationY = PositionRelationY.Top;
            maneuverBuilder.ResetPosition(205, 20);

            this.thurstAmountTextInput = maneuverBuilder.AddButtonAndTextInput(
                "ApplyThrustButton",
                "Apply Thrust",
                "ThrustAmountTextInput",
                "100P",
                this.CreateExecuteManeuver(this.ApplyThrust));

            this.changePeriapsisTextInput = maneuverBuilder.AddButtonAndTextInput(
                "ChangePeriapsisButton",
                "Change periapsis",
                "ChangePeriapsisTextInput",
                "0",
                this.CreateExecuteManeuver(this.ChangePeriapsis));

            this.changeApoapsisTextInput = maneuverBuilder.AddButtonAndTextInput(
                "ChangeApoapsisButton",
                "Change apoapsis",
                "ChangeApoapsisTextInput",
                "0",
                this.CreateExecuteManeuver(this.ChangeApoapsis));

            this.changeInclinationTextInput = maneuverBuilder.AddButtonAndTextInput(
                "ChangeInclinationButton",
                "Change inclination",
                "ChangeInclinationTextInput",
                "0",
                this.CreateExecuteManeuver(this.ChangeInclination));

            this.circularizeButton = maneuverBuilder.AddButton(
                "CircularizeButton",
                "Circularize",
                this.Circularize);

            maneuverBuilder.ResetPosition(20, 20);

            this.hohmannTransferRadiusTextInput = maneuverBuilder.AddButtonAndTextInput(
                "HohmannTransferButton",
                "Hohmann transfer",
                "HohmannTransferRadiusTextInput",
                "0",
                this.CreateExecuteManeuver(this.HohmannTransfer));

            this.interceptTargetList = maneuverBuilder.AddButtonAndListBox(
                "InterceptButton",
                "Intercept",
                "InterceptTargetList",
                this.CreateExecuteManeuver(this.Intercept));
            this.UpdateInterceptTargetList(this.SelectedObject);

            this.rendevouzTargetList = maneuverBuilder.AddButtonAndListBox(
                "RendevouzButton",
                "Rendevouz",
                "RendevouzTargetList",
                this.CreateExecuteManeuver(this.Rendevouz));
            this.UpdateRendevouzTargetList(this.SelectedObject);

            this.planetaryRendevouzTargetList = maneuverBuilder.AddButtonAndListBox(
                "PlanetaryRendevouzButton",
                "Planetary rendevouz",
                "RendevouzTargetList",
                this.CreateExecuteManeuver(this.PlanetaryRendevouz));
            this.UpdatePlanetaryRendevouzTargetList(this.SelectedObject);

            //maneuverBuilder.ResetPosition(20, maneuverBuilder.CurrentPosition.Y + maneuverBuilder.DeltaY);

            this.planetaryInsertionTargetList = maneuverBuilder.AddButtonAndListBox(
                "PlanetaryInsertionButton",
                "Planetary insertion",
                "RendevouzTargetList",
                this.CreateExecuteManeuver(this.PlanetaryInsertion));
            this.UpdatePlanetaryInsertionTargetList(this.SelectedObject);

            this.SimulatorContainer.SelectedObjectChanged += (sender, args) =>
            {
                this.UpdateRendevouzTargetList(args);
                this.UpdatePlanetaryRendevouzTargetList(args);
                this.UpdateInterceptTargetList(args);
                this.UpdatePlanetaryInsertionTargetList(args);
            };
            #endregion

            #region Ascent
            var ascentGroupSize = new Size2(200, 110);

            this.ascentGroup = new UIGroup(
                this.RenderingManager2D,
                "AscentGroup",
                new Vector2(0, 0),
                ascentGroupSize,
                PositionRelationX.Center,
                PositionRelationY.Center);
            this.uiManager.AddElement(this.ascentGroup);
            this.ascentGroup.IsVisible = false;

            var ascentUIGroupBackground = new RectangleUIObject(
                this.RenderingManager2D,
                "Background",
                Vector2.Zero,
                ascentGroupSize,
                this.uiStyle.UIGroupBackgroundBrush,
                this.uiStyle.ButtonBorderBrush,
                parent: this.ascentGroup);
            this.ascentGroup.AddObject(ascentUIGroupBackground);

            var ascentBuilder = this.NewUIBuilder(this.ascentGroup);
            ascentBuilder.PositionRelationX = PositionRelationX.Center;
            ascentBuilder.ResetPosition(0, 20);

            this.ascentTargetAltitudeTextInput = ascentBuilder.AddButtonAndTextInput(
                "AscendToOrbitButton",
                "Start ascent",
                "AscentTargetAltitudeTextInput",
                "300 km",
                this.CreateExecuteManeuver(this.AscendToOrbit));
            #endregion
        }

        /// <summary>
        /// Returns a function that will execute the given maneuver and handle errors
        /// </summary>
        /// <param name="maneuver">The maneuver</param>
        private Action CreateExecuteManeuver(Action maneuver)
        {
            return () =>
            {
                try
                {
                    if (!this.SimulatorContainer.IsFrozen)
                    {
                        maneuver();
                    }
                }
                catch (Exception exception)
                {
                    Console.WriteLine(exception.Message);
                }
            };
        }

        /// <summary>
        /// Creates a new UI builder
        /// </summary>
        /// <param name="parent">The parent</param>
        private UIBuilder NewUIBuilder(UIGroup parent)
        {
            var builder = new UIBuilder(
                this.RenderingManager2D,
                this.KeyboardManager,
                this.uiManager,
                this.uiStyle,
                parent);

            return builder;
        }

        /// <summary>
        /// Applies thrust
        /// </summary>
        private void ApplyThrust()
        {
            var deltaV = DataFormatter.ParseDeltaVelocity(
                this.SelectedObject,
                this.thurstAmountTextInput.Text);

            this.SimulatorEngine.ScheduleManeuver(this.SelectedObject,
                OrbitalManeuver.Burn(
                    this.SimulatorEngine,
                    this.SelectedObject,
                    deltaV,
                    OrbitalManeuverTime.Now()));
        }

        /// <summary>
        /// Changes the periapsis
        /// </summary>
        private void ChangePeriapsis()
        {
            var newPeriapsis = UIComponentHelpers.ParseDistance(this.changePeriapsisTextInput.Text, this.SelectedObject.PrimaryBody);
            this.SimulatorEngine.ScheduleManeuver(this.SelectedObject,
                BasicManeuver.ChangePeriapsis(
                    this.SimulatorEngine,
                    this.SelectedObject,
                    newPeriapsis));
        }

        /// <summary>
        /// Changes the apoapsis
        /// </summary>
        private void ChangeApoapsis()
        {
            var newApoapsis = UIComponentHelpers.ParseDistance(this.changeApoapsisTextInput.Text, this.SelectedObject.PrimaryBody);
            this.SimulatorEngine.ScheduleManeuver(this.SelectedObject,
                BasicManeuver.ChangeApoapsis(
                    this.SimulatorEngine,
                    this.SelectedObject,
                    newApoapsis));
        }

        /// <summary>
        /// Changes the inclination
        /// </summary>
        private void ChangeInclination()
        {
            var newInclination = UIComponentHelpers.ParseDouble(this.changeInclinationTextInput.Text);
            this.SimulatorEngine.ScheduleManeuver(
                this.SelectedObject,
                BasicManeuver.ChangeInclination(
                    this.SimulatorEngine,
                    this.SelectedObject,
                    newInclination * MathUtild.Deg2Rad));
        }

        /// <summary>
        /// Circularizes the current orbit
        /// </summary>
        private void Circularize()
        {
            this.SimulatorEngine.ScheduleManeuver(
                this.SelectedObject,
                BasicManeuver.Circularize(
                    this.SimulatorEngine,
                    this.SelectedObject));
        }

        /// <summary>
        /// Applies a hohmann transfer
        /// </summary>
        private void HohmannTransfer()
        {
            var newRadius = UIComponentHelpers.ParseDistance(this.hohmannTransferRadiusTextInput.Text, this.SelectedObject.PrimaryBody);
            var state = this.SelectedObject.State;
            var orbitPosition = OrbitPosition.CalculateOrbitPosition(this.SelectedObject);

            this.SimulatorEngine.ScheduleManeuver(this.SelectedObject,
                HohmannTransferOrbit.Create(
                    this.SimulatorEngine,
                    this.SelectedObject,
                    ref state,
                    ref orbitPosition,
                    newRadius,
                    OrbitalManeuverTime.Periapsis()));
        }

        /// <summary>
        /// Calculates an orbital intercept
        /// </summary>
        /// <param name="selectedObject">The selected object</param>
        /// <param name="targetOrbitPosition">The target orbit position</param>
        private void OrbitalIntercept(PhysicsObject selectedObject, ref OrbitPosition targetOrbitPosition)
        {
            var hohmannCoastTime = MiscHelpers.RoundToDays(HohmannTransferOrbit.CalculateBurn(
                selectedObject.PrimaryBody.StandardGravitationalParameter,
                selectedObject.ReferenceOrbit.SemiMajorAxis,
                targetOrbitPosition.Orbit.SemiMajorAxis).CoastTime);

            var synodicPeriod = OrbitFormulas.SynodicPeriod(
                selectedObject.ReferenceOrbit.Period,
                targetOrbitPosition.Orbit.Period);

            var deltaTime = MathHelpers.Clamp(1000, 2.0 * 24 * 60 * 60, synodicPeriod / 1000.0);

            this.SimulatorEngine.ScheduleManeuver(
                selectedObject,
                InterceptManeuver.Intercept(
                    this.SimulatorEngine,
                    this.SelectedObject,
                    selectedObject.Target,
                    targetOrbitPosition,
                    hohmannCoastTime * 0.5,
                    hohmannCoastTime * 2.0,
                    0,
                    synodicPeriod * 1.25,
                    deltaTime));
        }

        /// <summary>
        /// Calculates a ground intercept
        /// </summary>
        /// <param name="selectedObject">The selected object</param>
        /// <param name="targetOrbitPosition">The target orbit position</param>
        private void GroundIntercept(PhysicsObject selectedObject, ref OrbitPosition targetOrbitPosition)
        {
            var deltaTime = 600.0;
            if (targetOrbitPosition.Orbit.Period > 24.0 * 60 * 60.0)
            {
                deltaTime = MathHelpers.Clamp(600.0, 24.0 * 60.0 * 60.0, targetOrbitPosition.Orbit.Period / (24.0 * 6.0));
            }

            this.SimulatorEngine.ScheduleManeuver(
                this.SelectedObject,
                InterceptManeuver.Intercept(
                    this.SimulatorEngine,
                    this.SelectedObject,
                    selectedObject.Target,
                    targetOrbitPosition,
                    targetOrbitPosition.Orbit.Period * 0.1,
                    targetOrbitPosition.Orbit.Period,
                    0,
                    targetOrbitPosition.Orbit.Period * 3,
                    deltaTime));
        }

        /// <summary>
        /// Intercepts with an object
        /// </summary>
        private void Intercept()
        {
            this.SelectedObject.Target = (PhysicsObject)this.interceptTargetList.SelectedItem?.Tag;

            var startTime = DateTime.UtcNow;
            if (this.SelectedObject.Target != null)
            {
                var targetOrbitPosition = OrbitPosition.CalculateOrbitPosition(this.SelectedObject.Target);

                if (this.SelectedObject.HasImpacted)
                {
                    this.GroundIntercept(this.SelectedObject, ref targetOrbitPosition);
                }
                else
                {
                    this.OrbitalIntercept(this.SelectedObject, ref targetOrbitPosition);
                }
            }
            Console.WriteLine("Computed intercept in: " + (DateTime.UtcNow - startTime));
        }

        /// <summary>
        /// The rendevouz maneuver
        /// </summary>
        private void Rendevouz()
        {
            var targetObject = (PhysicsObject)this.rendevouzTargetList.SelectedItem?.Tag;

            if (targetObject != null)
            {
                var targetOrbitPosition = OrbitPosition.CalculateOrbitPosition(targetObject);
                var manevuer = RendevouzManeuver.Rendevouz(
                    this.SimulatorEngine,
                    this.SelectedObject,
                    ref targetOrbitPosition);
                this.SimulatorEngine.ScheduleManeuver(this.SelectedObject, manevuer);
                this.SelectedObject.Target = targetObject;
            }
        }

        /// <summary>
        /// The planetary rendevouz maneuver
        /// </summary>
        private void PlanetaryRendevouz()
        {
            var targetObject = (PhysicsObject)planetaryRendevouzTargetList.SelectedItem?.Tag;

            if (targetObject != null)
            {
                //var maneuver = InterplanetaryManeuver.PlanetaryTransfer(
                //    this.SimulatorEngine,
                //    this.SelectedObject,
                //    targetObject,
                //    out var possibleDepartureBurns);

                //this.SimulatorEngine.ScheduleManeuver(this.SelectedObject, maneuver);
                //this.SelectedObject.Target = targetObject;

                //this.showDeltaVChart = true;
                //this.deltaVChart = PlotHeatmap.CreateDeltaVChart(this.RenderingManager2D, possibleDepartureBurns);

                this.SimulatorContainer.Freeze();
                var task = new Task(state =>
                {
                    var stateTuple = ((PhysicsObject, PhysicsObject))state;
                    var maneuver = InterplanetaryManeuver.PlanetaryTransfer(
                        this.SimulatorEngine,
                        stateTuple.Item1,
                        stateTuple.Item2,
                        out var possibleDepartureBurns);

                    this.ScheduleMain(() =>
                    {
                        this.SimulatorEngine.ScheduleManeuver(stateTuple.Item1, maneuver);
                        this.SelectedObject.Target = stateTuple.Item2;

                        if (possibleDepartureBurns.Count > 0)
                        {
                            if (this.deltaVChart != null)
                            {
                                this.deltaVChart.ReleaseResources();
                            }

                            this.showDeltaVChart = true;
                            this.deltaVChart = Heatmap.CreateDeltaVChart(this.RenderingManager2D, new Vector2(400, 50), possibleDepartureBurns);
                        }

                        this.SimulatorContainer.Unfreeze();
                    });
                }, (this.SelectedObject, targetObject));
                task.Start();
            }
        }

        /// <summary>
        /// The planetary insertion maneuver
        /// </summary>
        private void PlanetaryInsertion()
        {
            var targetObject = (NaturalSatelliteObject)planetaryRendevouzTargetList.SelectedItem?.Tag;

            if (targetObject != null)
            {
                var insertionBurns = InterplanetaryManeuver.PlanetaryInsertion(this.SimulatorEngine, this.SelectedObject, targetObject);
                this.SimulatorEngine.ScheduleManeuver(this.SelectedObject, insertionBurns);
            }
        }

        /// <summary>
        /// Updates the intercept target list
        /// </summary>
        /// <param name="selectedObject">The current selected object</param>
        private void UpdateInterceptTargetList(PhysicsObject selectedObject)
        {
            var validTargets = this.SimulatorEngine.Objects
                   .Where(x =>
                            !x.IsObjectOfReference
                            && x != selectedObject
                            && x.PrimaryBody == selectedObject.PrimaryBody)
                   .ToList();

            this.interceptTargetList.SetItems(validTargets.Select(x => new ListBoxUIObject.Item(x.Name, x)).ToList());
        }

        /// <summary>
        /// Updates the rendevouz target list
        /// </summary>
        /// <param name="selectedObject">The current selected object</param>
        private void UpdateRendevouzTargetList(PhysicsObject selectedObject)
        {
            var validTargets = this.SimulatorEngine.Objects
                   .Where(x => x.Type == Simulator.PhysicsObjectType.ArtificialSatellite && x != selectedObject)
                   .ToList();

            this.rendevouzTargetList.SetItems(validTargets.Select(x => new ListBoxUIObject.Item(x.Name, x)).ToList());
        }

        /// <summary>
        /// Updates the planetary rendevouz target list
        /// </summary>
        /// <param name="selectedObject">The current selected object</param>
        private void UpdatePlanetaryRendevouzTargetList(PhysicsObject selectedObject)
        {
            if (selectedObject.Type != PhysicsObjectType.ObjectOfReference)
            {
                var validTargets = this.SimulatorEngine.Objects
                       .Where(x => x.Type == Simulator.PhysicsObjectType.NaturalSatellite
                                   && x != selectedObject
                                   && x != selectedObject.PrimaryBody
                                   && x.PrimaryBody == selectedObject.PrimaryBody.PrimaryBody)
                       .ToList();

                this.planetaryRendevouzTargetList.SetItems(validTargets.Select(x => new ListBoxUIObject.Item(x.Name, x)).ToList());
            }
            else
            {
                this.planetaryRendevouzTargetList.SetItems(new List<ListBoxUIObject.Item>());
            }
        }

        /// <summary>
        /// Updates the planetary insertion target list
        /// </summary>
        /// <param name="selectedObject">The current selected object</param>
        private void UpdatePlanetaryInsertionTargetList(PhysicsObject selectedObject)
        {
            if (selectedObject.Type != PhysicsObjectType.ObjectOfReference)
            {
                var validTargets = this.SimulatorEngine.Objects
                       .Where(x => x.Type == Simulator.PhysicsObjectType.NaturalSatellite
                                   && x != selectedObject
                                   && x != selectedObject.PrimaryBody
                                   && x.PrimaryBody == selectedObject.PrimaryBody.PrimaryBody)
                       .ToList();

                this.planetaryInsertionTargetList.SetItems(validTargets.Select(x => new ListBoxUIObject.Item(x.Name, x)).ToList());
            }
            else
            {
                this.planetaryInsertionTargetList.SetItems(new List<ListBoxUIObject.Item>());
            }
        }

        /// <summary>
        /// Ascends to orbit
        /// </summary>
        private void AscendToOrbit()
        {
            if (this.SelectedObject.HasImpacted && this.SelectedObject is RocketObject rocketObject)
            {
                var targetAltitude = UIComponentHelpers.ParseDistance(this.ascentTargetAltitudeTextInput.Text, this.SelectedObject.PrimaryBody);
                var targetOrbit = Physics.Orbit.New(this.SelectedObject.PrimaryBody, semiMajorAxis: targetAltitude, eccentricity: 0.0);

                var bestPitchStart = 1E3;
                var bestPitchEnd = 2E3;

                rocketObject.SetControlProgram(new AscentProgram(
                    rocketObject,
                    targetOrbit,
                    bestPitchStart,
                    bestPitchEnd,
                    this.SimulatorEngine.TextOutputWriter));

                rocketObject.StartProgram();
            }
        }

        public override void Update(TimeSpan elapsed)
        {
            this.RunScheduledTasks();

            if (this.KeyboardManager.IsKeyPressed(SharpDX.DirectInput.Key.Escape))
            {
                this.showDeltaVChart = false;
            }

            if (this.SelectedObject is RocketObject rocketObject)
            {
                var rotation = Quaterniond.Identity;

                //if (this.KeyboardManager.IsKeyDown(SharpDX.DirectInput.Key.Space))
                //{
                //    rotation = Quaterniond.RotationAxis(Vector3d.Right, MathUtild.Deg2Rad * 2.5);
                //}

                var amount = 0.5f;
                if (this.KeyboardManager.IsKeyDown(SharpDX.DirectInput.Key.LeftShift)
                    || this.KeyboardManager.IsKeyDown(SharpDX.DirectInput.Key.RightShift))
                {
                    amount = 0.05f;
                }

                if (this.KeyboardManager.IsKeyDown(SharpDX.DirectInput.Key.Up))
                {
                    rotation = Quaterniond.RotationAxis(Vector3d.Right, MathUtild.Deg2Rad * amount);
                }

                if (this.KeyboardManager.IsKeyDown(SharpDX.DirectInput.Key.Down))
                {
                    rotation = Quaterniond.RotationAxis(Vector3d.Right, -MathUtild.Deg2Rad * amount);
                }

                if (this.KeyboardManager.IsKeyDown(SharpDX.DirectInput.Key.Right))
                {
                    rotation = Quaterniond.RotationAxis(Vector3d.Up, MathUtild.Deg2Rad * amount);
                }

                if (this.KeyboardManager.IsKeyDown(SharpDX.DirectInput.Key.Left))
                {
                    rotation = Quaterniond.RotationAxis(Vector3d.Up, -MathUtild.Deg2Rad * amount);
                }

                if (this.KeyboardManager.IsKeyDown(SharpDX.DirectInput.Key.Q))
                {
                    rotation = Quaterniond.RotationAxis(Vector3d.ForwardLH, MathUtild.Deg2Rad * amount);
                }

                if (this.KeyboardManager.IsKeyDown(SharpDX.DirectInput.Key.E))
                {
                    rotation = Quaterniond.RotationAxis(Vector3d.ForwardLH, -MathUtild.Deg2Rad * amount);
                }

                if (rotation != Quaterniond.Identity)
                {
                    rocketObject.SetOrientation((rocketObject.Orientation * rotation).Normalized());
                }
            }
        }

        /// <summary>
        /// Draws the info text for the maneuvers
        /// </summary>
        /// <param name="deviceContex">The device context</param>
        private void DrawManeuverTexts(DeviceContext deviceContext)
        {
            var posY = 10;
            var posX = this.RenderingManager2D.ScreenRectangle.Width - 500;

            var outputBuilder = new StringBuilder();
            foreach (var maneuver in this.SimulatorEngine.Maneuvers)
            {
                var timeLeft = maneuver.Maneuver.ManeuverTime - this.SimulatorEngine.TotalTime;
                var dv = maneuver.Maneuver.DeltaVelocity.Length();

                var decimals = 2;
                var P = DataFormatter.Format(maneuver.Prograde, DataUnit.Velocity, decimals);
                var N = DataFormatter.Format(maneuver.Normal, DataUnit.Velocity, decimals);
                var R = DataFormatter.Format(maneuver.Radial, DataUnit.Velocity, decimals);

                var mainString = maneuver.Object.Name + " - time left: " + DataFormatter.Format(timeLeft, DataUnit.Time, 0);

                if (maneuver.Maneuver.DeltaVelocity != Vector3d.Zero)
                {
                    outputBuilder.AppendLine(mainString + ", Δv: " + DataFormatter.Format(dv, DataUnit.Velocity, decimals));
                    outputBuilder.AppendLine("(P: " + P + ", N: " + N + ", R: " + R + ")");
                }
                else
                {
                    outputBuilder.AppendLine(mainString);
                }
            }

            foreach (var currentEvent in this.SimulatorEngine.Events.Where(x => x.Type != SimulationEventType.Internal))
            {
                var timeLeft = currentEvent.Time - this.SimulatorEngine.TotalTime;
                var mainString = currentEvent.Object.Name + ": " + currentEvent.Type + " - time left: " + DataFormatter.Format(timeLeft, DataUnit.Time, 0);
                outputBuilder.AppendLine(mainString);
            }

            this.TextColorBrush.DrawText(
                deviceContext,
                outputBuilder.ToString(),
                this.TextFormat,
                this.RenderingManager2D.TextPosition(new Vector2(posX, posY)));
        }

        public override void Draw(DeviceContext deviceContext)
        {
            this.DrawManeuverTexts(deviceContext);

            if (this.showDeltaVChart)
            {
                this.deltaVChart.SetMousePosition(this.MouseManager.MousePosition);
                this.deltaVChart.Draw(deviceContext);
            }
        }
    }
}


text:
package org.springframework.security.access.expression.method;

import static org.assertj.core.api.Assertions.assertThat;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import org.aopalliance.intercept.MethodInvocation;
import org.junit.Test;
import org.springframework.security.access.AccessDecisionVoter;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.access.expression.method.PreInvocationExpressionAttribute;
import org.springframework.security.access.prepost.PreInvocationAuthorizationAdviceVoter;
import org.springframework.security.authentication.TestingAuthenticationToken;
import org.springframework.security.util.SimpleMethodInvocation;

@SuppressWarnings("unchecked")
public class MethodExpressionVoterTests {
	private TestingAuthenticationToken joe = new TestingAuthenticationToken("joe",
			"joespass", "ROLE_blah");
	private PreInvocationAuthorizationAdviceVoter am = new PreInvocationAuthorizationAdviceVoter(
			new ExpressionBasedPreInvocationAdvice());

	@Test
	public void hasRoleExpressionAllowsUserWithRole() throws Exception {
		MethodInvocation mi = new SimpleMethodInvocation(new TargetImpl(),
				methodTakingAnArray());
		assertThat(am.vote(joe, mi,
				createAttributes(new PreInvocationExpressionAttribute(null, null,
						"hasRole('blah')")))).isEqualTo(AccessDecisionVoter.ACCESS_GRANTED);
	}

	@Test
	public void hasRoleExpressionDeniesUserWithoutRole() throws Exception {
		List<ConfigAttribute> cad = new ArrayList<>(1);
		cad.add(new PreInvocationExpressionAttribute(null, null, "hasRole('joedoesnt')"));
		MethodInvocation mi = new SimpleMethodInvocation(new TargetImpl(),
				methodTakingAnArray());
		assertThat(am.vote(joe, mi, cad)).isEqualTo(AccessDecisionVoter.ACCESS_DENIED);
	}

	@Test
	public void matchingArgAgainstAuthenticationNameIsSuccessful() throws Exception {
		MethodInvocation mi = new SimpleMethodInvocation(new TargetImpl(),
				methodTakingAString(), "joe");
		assertThat(am.vote(joe, mi,
				createAttributes(new PreInvocationExpressionAttribute(null, null,
						"(#argument == principal) and (principal == 'joe')"))))
			.isEqualTo(AccessDecisionVoter.ACCESS_GRANTED);
	}

	@Test
	public void accessIsGrantedIfNoPreAuthorizeAttributeIsUsed() throws Exception {
		Collection arg = createCollectionArg("joe", "bob", "sam");
		MethodInvocation mi = new SimpleMethodInvocation(new TargetImpl(),
				methodTakingACollection(), arg);
		assertThat(am.vote(joe, mi,
				createAttributes(new PreInvocationExpressionAttribute(
						"(filterObject == 'jim')", "collection", null))))
			.isEqualTo(AccessDecisionVoter.ACCESS_GRANTED);
		// All objects should have been removed, because the expression is always false
		assertThat(arg).isEmpty();
	}

	@Test
	public void collectionPreFilteringIsSuccessful() throws Exception {
		List arg = createCollectionArg("joe", "bob", "sam");
		MethodInvocation mi = new SimpleMethodInvocation(new TargetImpl(),
				methodTakingACollection(), arg);
		am.vote(joe, mi, createAttributes(new PreInvocationExpressionAttribute(
				"(filterObject == 'joe' or filterObject == 'sam')", "collection",
				"permitAll")));
		assertThat(arg).containsExactly("joe", "sam");
	}

	@Test(expected = IllegalArgumentException.class)
	public void arraysCannotBePrefiltered() throws Exception {
		MethodInvocation mi = new SimpleMethodInvocation(new TargetImpl(),
				methodTakingAnArray(), createArrayArg("sam", "joe"));
		am.vote(joe, mi, createAttributes(new PreInvocationExpressionAttribute(
				"(filterObject == 'jim')", "someArray", null)));
	}

	@Test(expected = IllegalArgumentException.class)
	public void incorrectFilterTargetNameIsRejected() throws Exception {
		MethodInvocation mi = new SimpleMethodInvocation(new TargetImpl(),
				methodTakingACollection(), createCollectionArg("joe", "bob"));
		am.vote(joe, mi, createAttributes(new PreInvocationExpressionAttribute(
				"(filterObject == 'joe')", "collcetion", null)));
	}

	@Test(expected = IllegalArgumentException.class)
	public void nullNamedFilterTargetIsRejected() throws Exception {
		MethodInvocation mi = new SimpleMethodInvocation(new TargetImpl(),
				methodTakingACollection(), new Object[] { null });
		am.vote(joe, mi, createAttributes(new PreInvocationExpressionAttribute(
				"(filterObject == 'joe')", "collection", null)));
	}

	@Test
	public void ruleDefinedInAClassMethodIsApplied() throws Exception {
		MethodInvocation mi = new SimpleMethodInvocation(new TargetImpl(),
				methodTakingAString(), "joe");
		assertThat(

		am.vote(joe, mi,
				createAttributes(new PreInvocationExpressionAttribute(null, null,
						"T(org.springframework.security.access.expression.method.SecurityRules).isJoe(#argument)"))))
								.isEqualTo(AccessDecisionVoter.ACCESS_GRANTED);
	}

	private List<ConfigAttribute> createAttributes(ConfigAttribute... attributes) {
		return Arrays.asList(attributes);
	}

	private List createCollectionArg(Object... elts) {
		ArrayList result = new ArrayList(elts.length);
		result.addAll(Arrays.asList(elts));
		return result;
	}

	private Object createArrayArg(Object... elts) {
		ArrayList result = new ArrayList(elts.length);
		result.addAll(Arrays.asList(elts));
		return result.toArray(new Object[0]);
	}

	private Method methodTakingAnArray() throws Exception {
		return Target.class.getMethod("methodTakingAnArray", Object[].class);
	}

	private Method methodTakingAString() throws Exception {
		return Target.class.getMethod("methodTakingAString", String.class);
	}

	private Method methodTakingACollection() throws Exception {
		return Target.class.getMethod("methodTakingACollection", Collection.class);
	}

	// ~ Inner Classes
	// ==================================================================================================

	private interface Target {
		void methodTakingAnArray(Object[] args);

		void methodTakingAString(String argument);

		Collection methodTakingACollection(Collection collection);
	}

	private static class TargetImpl implements Target {
		public void methodTakingAnArray(Object[] args) {
		}

		public void methodTakingAString(String argument) {
		};

		public Collection methodTakingACollection(Collection collection) {
			return collection;
		}
	}
}


text:
class CreateRepos < ActiveRecord::Migration
  def change
    create_table :repos do |t|
      t.string :name
      t.decimal :size
      t.boolean :has_readme_file

      t.timestamps null: false
    end
  end
end