text:
package com.muatik.repository;

import com.fasterxml.jackson.databind.ser.std.IterableSerializer;
import com.muatik.model.Person;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Slice;
import org.springframework.data.domain.Sort;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by muatik on 1/7/17.
 */

@Repository
public interface PersonRepository extends CrudRepository<Person, Long>{
    Iterable<Person> findAllByHeight(float height);
    Iterable<Person> findAllByOrderByHeightDesc();
    Iterable<Person> findByAddress_Country(String country);

    // will cause an extra count query
    Page<Person> findAllByAddress_Country(String country, Pageable pageable);

    // however, this does not need to count
    List<Person> findAllWithoutCountByAddress_Country(String country, Pageable pageable);

    Slice<Person> findAllByHeight(float height, Pageable pageable);

    Person findTopByOrderByHeightDesc();

    List<Person> findTop3ByOrderByHeightDesc();
}

redpajama_set_name: RedPajamaGithub


text:
angular.module('accelerometer',[])

.run([function(){

}])

.config([function(){

}])


text:
package org.springframework.http.server.reactive;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.ByteBuffer;
import java.util.concurrent.atomic.AtomicLong;

import javax.net.ssl.SSLSession;

import io.undertow.connector.ByteBufferPool;
import io.undertow.connector.PooledByteBuffer;
import io.undertow.server.HttpServerExchange;
import io.undertow.server.handlers.Cookie;
import org.xnio.channels.StreamSourceChannel;
import reactor.core.publisher.Flux;

import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.core.io.buffer.DataBufferFactory;
import org.springframework.http.HttpCookie;
import org.springframework.http.HttpMethod;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;

/**
 * Adapt {@link ServerHttpRequest} to the Undertow {@link HttpServerExchange}.
 *
 * @author Marek Hawrylczak
 * @author Rossen Stoyanchev
 * @author Juergen Hoeller
 * @since 5.0
 */
class UndertowServerHttpRequest extends AbstractServerHttpRequest {

	private static final AtomicLong logPrefixIndex = new AtomicLong();

	private final HttpServerExchange exchange;

	private final RequestBodyPublisher body;

	public UndertowServerHttpRequest(HttpServerExchange exchange, DataBufferFactory bufferFactory)
			throws URISyntaxException {

		super(initUri(exchange), "", new UndertowHeadersAdapter(exchange.getRequestHeaders()));
		this.exchange = exchange;
		this.body = new RequestBodyPublisher(exchange, bufferFactory);
		this.body.registerListeners(exchange);
	}

	private static URI initUri(HttpServerExchange exchange) throws URISyntaxException {
		Assert.notNull(exchange, "HttpServerExchange is required");
		String requestURL = exchange.getRequestURL();
		String query = exchange.getQueryString();
		String requestUriAndQuery = (StringUtils.hasLength(query) ? requestURL + "?" + query : requestURL);
		return new URI(requestUriAndQuery);
	}

	@Override
	public HttpMethod getMethod() {
		return HttpMethod.valueOf(this.exchange.getRequestMethod().toString());
	}

	@Override
	protected MultiValueMap<String, HttpCookie> initCookies() {
		MultiValueMap<String, HttpCookie> cookies = new LinkedMultiValueMap<>();
		for (Cookie cookie : this.exchange.requestCookies()) {
			HttpCookie httpCookie = new HttpCookie(cookie.getName(), cookie.getValue());
			cookies.add(cookie.getName(), httpCookie);
		}
		return cookies;
	}

	@Override
	@Nullable
	public InetSocketAddress getLocalAddress() {
		return this.exchange.getDestinationAddress();
	}

	@Override
	@Nullable
	public InetSocketAddress getRemoteAddress() {
		return this.exchange.getSourceAddress();
	}

	@Nullable
	@Override
	protected SslInfo initSslInfo() {
		SSLSession session = this.exchange.getConnection().getSslSession();
		if (session != null) {
			return new DefaultSslInfo(session);
		}
		return null;
	}

	@Override
	public Flux<DataBuffer> getBody() {
		return Flux.from(this.body);
	}

	@SuppressWarnings("unchecked")
	@Override
	public <T> T getNativeRequest() {
		return (T) this.exchange;
	}

	@Override
	protected String initId() {
		return ObjectUtils.getIdentityHexString(this.exchange.getConnection()) +
				"-" + logPrefixIndex.incrementAndGet();
	}

	private class RequestBodyPublisher extends AbstractListenerReadPublisher<DataBuffer> {

		private final StreamSourceChannel channel;

		private final DataBufferFactory bufferFactory;

		private final ByteBufferPool byteBufferPool;

		public RequestBodyPublisher(HttpServerExchange exchange, DataBufferFactory bufferFactory) {
			super(UndertowServerHttpRequest.this.getLogPrefix());
			this.channel = exchange.getRequestChannel();
			this.bufferFactory = bufferFactory;
			this.byteBufferPool = exchange.getConnection().getByteBufferPool();
		}

		private void registerListeners(HttpServerExchange exchange) {
			exchange.addExchangeCompleteListener((ex, next) -> {
				onAllDataRead();
				next.proceed();
			});
			this.channel.getReadSetter().set(c -> onDataAvailable());
			this.channel.getCloseSetter().set(c -> onAllDataRead());
			this.channel.resumeReads();
		}

		@Override
		protected void checkOnDataAvailable() {
			this.channel.resumeReads();
			// We are allowed to try, it will return null if data is not available
			onDataAvailable();
		}

		@Override
		protected void readingPaused() {
			this.channel.suspendReads();
		}

		@Override
		@Nullable
		protected DataBuffer read() throws IOException {
			PooledByteBuffer pooledByteBuffer = this.byteBufferPool.allocate();
			try (pooledByteBuffer) {
				ByteBuffer byteBuffer = pooledByteBuffer.getBuffer();
				int read = this.channel.read(byteBuffer);

				if (rsReadLogger.isTraceEnabled()) {
					rsReadLogger.trace(getLogPrefix() + "Read " + read + (read != -1 ? " bytes" : ""));
				}

				if (read > 0) {
					byteBuffer.flip();
					DataBuffer dataBuffer = this.bufferFactory.allocateBuffer(read);
					dataBuffer.write(byteBuffer);
					return dataBuffer;
				}
				else if (read == -1) {
					onAllDataRead();
				}
				return null;
			}
		}

		@Override
		protected void discardData() {
			// Nothing to discard since we pass data buffers on immediately..
		}
	}

}


text:
from __future__ import unicode_literals

from django.db import migrations, models
from django.conf import settings

class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('about', models.TextField(verbose_name='About')),
                ('zip', models.CharField(help_text='Your zip code is used to keep search results local', max_length=5, verbose_name='Zip Code', blank=True)),
                ('photo', models.ImageField(upload_to=b'', verbose_name='Photo', blank=True)),
                ('user', models.OneToOneField(related_name='profile', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]


text:
package com.intita.wschat.models;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

import com.fasterxml.jackson.annotation.JsonIgnore;

@Entity
public class BotCategory implements java.io.Serializable {
	@Id
	@GeneratedValue
	private Long id;

	private String name;

	@OneToOne
	@JsonIgnore
	private BotDialogItem mainElement;

	@JsonIgnore
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "category")
	List<BotDialogItem> elements = new ArrayList<BotDialogItem>();

	public BotCategory(){

	}
	public BotCategory(String name){
		this.name = name;
	}

	public List<BotDialogItem> getElements() {
		return elements;
	}

	public void setElements(ArrayList<BotDialogItem> elements) {
		this.elements = elements;
	}
	public void addElement(BotDialogItem element){
		this.elements.add(element);
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	public BotDialogItem getMainElement() {
		return mainElement;
	}
	public void setMainElement(BotDialogItem mainElement) {
		this.mainElement = mainElement;
	}

	@ManyToMany(mappedBy = "botCategories", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JsonIgnore
	Set<ChatTenant> chatUsers  = new HashSet<>();

	public Set<ChatTenant> getChatUsers() {
		return chatUsers;
	}
	public void setChatUsers(Set<ChatTenant> chatUsers) {
		this.chatUsers = chatUsers;
	}

}


text:
mkdir -p bin # for silencing the next line, in case the folder does not exist
rm -r bin
mkdir -p build
touch build/touched # for silencing the next line, in case the folder was just created
rm -r build/*
cd build

echo "Building CEFSimpleSample::Independent"
g++ -c ../CEFSimpleSample/Independent/*.cpp \
	-I ../CEFSimpleSample/Independent \
	-I ../CEFSimpleSample/CEF/Linux \
	-I ../CEFSimpleSample/CEF/Linux/include \
	`pkg-config --cflags --libs gtk+-2.0`

echo "Building CEFSimpleSample::Linux"
g++ -c ../CEFSimpleSample/Linux/*.cpp \
	-I ../CEFSimpleSample/Independent \
	-I ../CEFSimpleSample/CEF/Linux \
	-I ../CEFSimpleSample/CEF/Linux/include \
	`pkg-config --cflags --libs gtk+-2.0`

echo "Linking..."
g++ *.o \
	../CEFSimpleSample/CEF/Linux/lib/libcef_dll_wrapper.a \
	-o CEFSimpleSample \
	`pkg-config --cflags --libs gtk+-2.0` \
	-L ../CEFSimpleSample/CEF/Linux/lib \
	-ldl \
	-lcef \
	-Wl,-R. -Wl,-R/usr/lib

echo "Copying files around..."
rm *.o
mkdir bin
mv CEFSimpleSample bin/
cp -r ../CEFSimpleSample/CEF/Linux/resources/* bin/
cp -r ../CEFSimpleSample/CEF/Linux/lib/*.so bin/
cp -r ../CEFSimpleSample/Independent/html bin/
mv bin ..
cd ..
rm -r build


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="JavaScriptLibraryMappings">
    <file url="file://$PROJECT_DIR$" libraries="{node-xero node_modules}" />
    <file url="PROJECT" libraries="{Node.js v0.10.13 Core Modules}" />
    <includedPredefinedLibrary name="Node.js Globals" />
    <excludedPredefinedLibrary name="HTML" />
  </component>
</project>


text:
from test_config import Declarative, write_template_file, restart_apache
from test_config import stop_apache
import ssl
import requests.exceptions
import os

class test_suite1(Declarative):
    @classmethod
    def setUpClass(cls):
        write_template_file('suite1.tmpl', 'work/httpd/conf/test.conf', {'DBPREFIX': os.environ.get('DBPREFIX', '')})
        restart_apache()

    @classmethod
    def tearDownClass(cls):
        stop_apache()

    tests = [

        dict(
            desc='Basic SSL connection',
            request=('/', {}),
            expected=200,
        ),

        dict(
            desc='Basic SSL connection, 404',
            request=('/notfound', {}),
            expected=404,
        ),

        dict(
            desc='SSL connection, fail to verify',
            request=('/', {'verify': True}),
            expected=requests.exceptions.SSLError(),
        ),

        dict(
            desc='SSL AES128-SHA cipher check',
            request=('/index.html', {}),
            expected=200,
            cipher='AES128-SHA',
        ),

        dict(
            desc='Default protocol check',
            request=('/', {}),
            expected=200,
            protocol='TLSv1/SSLv3',
        ),

        dict(
            desc='server-side RC4 cipher check',
            request=('/rc4_cipher/', {'ciphers': 'ALL'}),
            expected=200,
            cipher='RC4-MD5',
        ),

        dict(
            desc='client-side RC4 cipher check',
            request=('/', {'ciphers': 'RC4-MD5'}),
            expected=200,
            cipher='RC4-MD5',
        ),

        dict(
            desc='server-side OpenSSL-style RC4 cipher check',
            request=('/openssl_rc4_cipher/', {'ciphers': 'ALL'}),
            expected=200,
        ),

        dict(
            desc='server-side OpenSSL-style AES cipher check',
            request=('/openssl_aes_cipher/', {'ciphers': 'AES128-SHA'}),
            expected=200,
        ),

        dict(
            desc='Basic client auth, no certificate',
            request=('/acl/aclS01.html', {}),
            expected=requests.exceptions.SSLError(),
        ),

        dict(
            desc='Basic client auth, valid certificate',
            request=('/acl/aclS01.html', {
                      'key_file': 'work/httpd/alpha.key',
                      'cert_file': 'work/httpd/alpha.crt',}
            ),
            expected=200,
        ),

        dict(
            desc='NSSRequire auth, no certificate',
            request=('/acl/aclS02.html', {}),
            expected=requests.exceptions.SSLError(),
        ),

        dict(
            desc='NSSRequire auth, valid certificate',
            request=('/acl/aclS02.html', {
                      'key_file': 'work/httpd/alpha.key',
                      'cert_file': 'work/httpd/alpha.crt',}
            ),
            expected=200,
        ),

        dict(
            desc='NSSRequire auth, not allowed certificate',
            request=('/acl/aclS02.html', {
                      'key_file': 'work/httpd/beta.key',
                      'cert_file': 'work/httpd/beta.crt',}
            ),
            expected=403,
        ),

        dict(
            desc='FakeBasicAuth, no certificate',
            request=('/acl/aclS03.html', {}),
            expected=requests.exceptions.SSLError(),
        ),

        dict(
            desc='FakeBasicAuth, valid certificate',
            request=('/acl/aclS03.html', {
                      'key_file': 'work/httpd/alpha.key',
                      'cert_file': 'work/httpd/alpha.crt',}
            ),
            expected=200,
        ),

        dict(
            desc='FakeBasicAuth, not allowed user',
            request=('/acl/aclS03.html', {
                      'key_file': 'work/httpd/beta.key',
                      'cert_file': 'work/httpd/beta.crt',}
            ),
            expected=401,
        ),

        dict(
            desc='Secret key size',
            request=('/secret-test.html', {}),
            expected=200,
        ),

        dict(
            desc='Impossible secret key size',
            request=('/secret-test-impossible.html', {}),
            expected=403,
        ),

        # Only SSLv3-TLSv1.1 enabled on 8000
        dict(
            desc='Requires TLS v1.2, no support',
            request=('/protocoltls12/index.html', {}),
            expected=403,
        ),

        dict(
            desc='Try SSLv2 on default server',
            request=('/protocoltls12/index.html',
                    {'ssl_version': ssl.PROTOCOL_SSLv2}
            ),
            expected=requests.exceptions.SSLError(),
        ),

        dict(
            desc='Try SSLv23 client on SSLv3 location',
            request=('/protocolssl3/index.html',
                    {'ssl_version': ssl.PROTOCOL_SSLv23}
            ),
            expected=403, # connects as TLSv1
        ),

        dict(
            desc='Try TLSv1 client on SSLv3 location',
            request=('/protocoltls1/index.html',
                    {'ssl_version': ssl.PROTOCOL_TLSv1}
            ),
            expected=200,
        ),

        dict(
            desc='Try TLSv1 client on TLSv1.1 location',
            request=('/protocoltls11/index.html',
                    {'ssl_version': ssl.PROTOCOL_TLSv1}
            ),
            expected=403,
        ),

        dict(
            desc='Try SSLv23 client on TLSv1 location',
            request=('/protocoltls1/index.html',
                    {'ssl_version': ssl.PROTOCOL_SSLv23}
            ),
            expected=200,
        ),

        dict(
            desc='Try SSLv23 client on 1.2-only location',
            request=('/protocoltls12/index.html',
                    {'ssl_version': ssl.PROTOCOL_SSLv23}
            ),
            expected=403,
        ),

        dict(
            desc='Requires TLSv1.2 on VH that provides it',
            request=('/protocoltls12/index.html', {'port': 8001}),
            expected=200,
        ),

        dict(
            desc='Try SSLv2 client on 1.2-only VH',
            request=('/protocoltls12/index.html',
                    {'port': 8001,
                     'ssl_version': ssl.PROTOCOL_SSLv2}
            ),
            expected=requests.exceptions.SSLError(),
        ),

        dict(
            desc='Try SSLv3 client on 1.2-only VH',
            request=('/protocoltls12/index.html',
                    {'port': 8001,
                     'ssl_version': ssl.PROTOCOL_SSLv3}
            ),
            expected=requests.exceptions.SSLError(),
        ),

        dict(
            desc='Try TLSv1 client on 1.2-only VH',
            request=('/protocoltls12/index.html',
                    {'port': 8001,
                     'ssl_version': ssl.PROTOCOL_TLSv1}
            ),
            expected=requests.exceptions.SSLError(),
        ),

    ]


text:
//////////////////////////////////////
////////// Class Definition //////////
//////////////////////////////////////

/**
 * Creates a wrapper for a DOM element.
 *
 * @class A stateful generic wrapper for DOM elements. Different DOM
 *     elements need different instances of this class, since it
 *     internally maintains the state relevant only to the wrapped element.
 * @extends uiUtil_Object
 */
function uiHtml_Element(domElement, inline) {
  this._super();

  /**
   * The wrapped DOM element.
   *
   * @type HTMLElement
   * @private
   */
  this.__domElement = domElement;
  /**
   * A delegate object for most of the methods.
   *
   * @type uiHtml_ElementWrapper
   * @private
   */
  this.__supporter = uiHtml_ElementWrapper.getInstance();
}

uiHtml_Element = uiUtil_Object.declareClass(uiHtml_Element, uiUtil_Object);

////////////////////////////////////////
////////// Non-static Methods //////////
////////////////////////////////////////

/////
// Style-related method section starts.
/**
 * Sets the value of a certain inline style attribute of an element.
 *
 * @see uiHtml_ElementWrapper#setStyleAttribute
 * @param {String} name the attribute name
 * @param {String} value the attribute value
 */
uiHtml_Element.prototype.setStyleAttribute = function(name, value) {
  this.__supporter.setStyleAttribute(this.__domElement, name, value);
};

/**
 * Returns a cascaded style attribute value of an element as specified by
 * global style sheets, inline styles, and HTML attributes.
 *
 * @see uiHtml_ElementWrapper#getCascadedStyleAttribute
 * @param {String} name the attribute name
 * @return the attribute value
 * @type String
 */
uiHtml_Element.prototype.getCascadedStyleAttribute = function(name) {
  return this.__supporter.getCascadedStyleAttribute(this.__domElement, name);
};

/**
 * Returns an element's visibility status.
 *
 * @see uiHtml_ElementWrapper#isShowing
 * @return true if the element is visible, false
 *     otherwise
 * @type boolean
 */
uiHtml_Element.prototype.isShowing = function() {
  return this.__supporter.isShowing(this.__domElement);
};

/**
 * Makes an element visible.
 *
 * @see uiHtml_ElementWrapper#show
 */
uiHtml_Element.prototype.show = function() {
  this.__supporter.show(this.__domElement);
};

/**
 * Makes an element invisible. Note that although the element is not
 * visible, it still occupies its original space in the browser window.
 *
 * @see uiHtml_ElementWrapper#hide
 */
uiHtml_Element.prototype.hide = function() {
  this.__supporter.hide(this.__domElement);
};

/**
 * Checks if an element is appearing.
 *
 * @see uiHtml_ElementWrapper#isAppearing
 * @return true if the element is appearing, false
 *     otherwise
 * @type boolean
 */
uiHtml_Element.prototype.isAppearing = function() {
  return this.__supporter.isAppearing(this.__domElement);
};

/**
 * Makes an element appear.
 *
 * @see uiHtml_ElementWrapper#appear
 */
uiHtml_Element.prototype.appear = function() {
  this.__supporter.appear(this.__domElement);
};

/**
 * Makes an element disappear. Note that the element does not occupy any
 * space in the browser window.
 *
 * @see uiHtml_ElementWrapper#disappear
 */
uiHtml_Element.prototype.disappear = function() {
  this.__supporter.disappear(this.__domElement);
};

/**
 * Sets the z-index of an element.
 *
 * @see uiHtml_ElementWrapper#setDepth
 * @param {int} depth the z-index value
 */
uiHtml_Element.prototype.setDepth = function(depth) {
  this.__supporter.setDepth(this.__domElement, depth);
};

/**
 * Returns the z-index of an element.
 *
 * @see uiHtml_ElementWrapper#getDepth
 * @return the z-index value
 */
uiHtml_Element.prototype.getDepth = function() {
  return this.__supporter.getDepth(this.__domElement);
};

/**
 * Sets the dimension of the element. Any null argument value
 * indicates the old value to be retained. Note that this operation
 * takes effect only when the position style attribute is absolute.
 *
 * @see uiHtml_ElementWrapper#setDimension
 * @param {int} x the x coordinate
 * @param {int} y the y coordinate
 * @param {int} width the element width
 * @param {int} height the element height
 */
uiHtml_Element.prototype.setDimension = function(x, y, width, height) {
  this.__supporter.setDimension(this.__domElement, x, y, width, height);
};

/**
 * Sets the dimension of the element. This is a convenience method for
 * performing exactly the same operation as {@link #setDimension}.
 *
 * @see uiHtml_ElementWrapper#setDimensionObject
 * @param {uiUtil_Dimension} dimension the dimension object
 */
uiHtml_Element.prototype.setDimensionObject = function(dimension) {
  this.__supporter.setDimensionObject(this.__domElement, dimension);
};
// Style-related method section ends.
/////

/////
// Event-related method section starts.
/**
 * Prepends a function to the event handler list of the element.
 *
 * @see uiHtml_ElementWrapper#prependEventHandler
 * @param {String} eventName name of the event
 * @param {function} eventHandler the event handler
 * @return an ID of the event handler
 * @type int
 */
uiHtml_Element.prototype.prependEventHandler = function(eventName, eventHandler) {
  return this.__supporter.prependEventHandler(
      this.__domElement, eventName, eventHandler);
};

/**
 * Appends a function to the event handler list of the element.
 *
 * @see uiHtml_ElementWrapper#appendEventHandler
 * @param {String} eventName name of the event
 * @param {function} eventHandler the event handler
 * @return an ID of the event handler
 * @type int
 */
uiHtml_Element.prototype.appendEventHandler = function(eventName, eventHandler) {
  return this.__supporter.appendEventHandler(
      this.__domElement, eventName, eventHandler);
};

/**
 * Removes a certain function from the event handler list of a DOM element.
 *
 * @see uiHtml_ElementWrapper#removeEventHandler
 * @param {HTMLElement} domElement the DOM element
 * @param {String} eventName event name of the removed handlers
 * @param {int} handlerId ID of the prepended/appended event handler
 */
uiHtml_Element.prototype.removeEventHandler = function(
    eventName, startIndex, optCount) {
  this.__supporter.removeEventHandler(
      this.__domElement, eventName, startIndex, optCount);
};

/**
 * Removes all functions that were added to a DOM element's event handler
 * list using {@link #prependEventHandler} or {@link #appendEventHandler}.
 *
 * @see uiHtml_ElementWrapper#clearEventHandlerExtension
 * @param {HTMLElement} domElement the DOM element
 * @param {String} eventName event name of the cleared handlers
 */
uiHtml_Element.prototype.clearEventHandlerExtension = function(eventName) {
  this.__supporter.clearEventHandlerExtension(this.__domElement, eventName);
};

/**
 * Executes the aggregated handler of an event. It is recommended to
 * execute the event handler through this method instead of invoking it
 * via the event handler property directly, because it is important to
 * ensure that the domElement is the owner of the method execution
 * (thus the "this" keyword refers to the correct object -- the owner).
 *

 * Note that although this the optDomEvent argument is
 * optional, it is recommended that a DOM event object is provided,
 * since some event handlers need the event object to perform operation.
 * It is safe to ignore the optDomEvent only if it is
 * known that all of the handlers do not need it.
 *
 * @see uiHtml_ElementWrapper#executeAggregateEventHandler
 * @param {String} eventName event name of the cleared handlers
 * @param {DOMEvent} optDomEvent the optional DOM event object
 */
uiHtml_Element.prototype.executeAggregateEventHandler = function(
    eventName, optDomEvent) {
  this.__supporter.executeAggregateEventHandler(
      this.__domElement, eventName, optDomEvent);
};

/**
 * Appends a handler for continuous mouse press on a certain element.
 * On mouse press, the handler will be executed once and then after a certain
 * amount of time will be continuously executed until the mouse is released.
 *
 * @see uiHtml_ElementWrapper#appendMousePressHandler
 * @param {function} eventHandler the event handler
 */
uiHtml_Element.prototype.appendMousePressHandler = function(eventHandler) {
  this.__supporter.appendMousePressHandler(this.__domElement, eventHandler);
};

/**
 * Makes this element draggable and performs initialization for dragging.
 *
 * @see uiHtml_ElementWrapper#enableDragSupport
 * @param {uiHtml_Element} optTrigger an optional drag handle,
 *     by default this element is the handle.
 */
uiHtml_Element.prototype.enableDragSupport = function(optTrigger) {
  var element = this;
  this.__supporter.enableDragSupport(this.__domElement, optTrigger, function(x, y) {
    element.setDimension(x, y, null, null);
  });
};

/**
 * Specifies a rectangular boundary that limits the positioning of a
 * dragged element.
 *
 * @see uiHtml_ElementWrapper#restrictDragging
 * @param {int} optLeft left coordinate of the rectangle
 * @param {int} optTop top coordinate of the rectangle
 * @param {int} optWidth width of the rectangle
 * @param {int} optHeight height of the rectangle
 */
uiHtml_Element.prototype.restrictDragging = function(
    optLeft, optTop, optMaxWidth, optMaxHeight) {
  this.__supporter.restrictDragging(
      this.__domElement, optLeft, optTop, optMaxWidth, optMaxHeight);
};
// Event-related method section ends.
/////

/////
// Generic method section starts.
/**
 * Returns the width of the element. Note that overriding this
 * method will also affect the width value returned by the dimension
 * related methods (i.e. #_obtainRelativeDimension, #_obtainAbsoluteDimension,
 * #_getDimension, #getRelativeDimension, and #getAbsoluteDimension).
 *
 * @see uiHtml_ElementWrapper#getWidth
 */
uiHtml_Element.prototype.getWidth = function() {
  return this.__supporter.getWidth(this.__domElement);
};

/**
 * Returns the height of the element. Note that overriding this
 * method will also affect the height value returned by the dimension
 * related methods (i.e. #_obtainRelativeDimension, #_obtainAbsoluteDimension,
 * #_getDimension, #getRelativeDimension, and #getAbsoluteDimension).
 *
 * @see uiHtml_ElementWrapper#getHeight
 */
uiHtml_Element.prototype.getHeight = function() {
  return this.__supporter.getHeight(this.__domElement);
};

/**
 * Returns the position of an element relative to its parent/container.
 *
 * @see uiHtml_ElementWrapper#getRelativeDimension
 * @return the dimension
 * @type uiUtil_Dimension
 */
uiHtml_Element.prototype.getRelativeDimension = function() {
  // Use the getWidth() and getHeight() of this element to allow the
  // child classes to override their implementations.
  var element = this;
  return this.__supporter._getDimension(this.__domElement,
      this.__supporter._obtainRelativeDimension,
      function() { return element.getWidth(); },
      function() { return element.getHeight(); });
};

/**
 * Returns the absolute position of an element.
 *
 * @see uiHtml_ElementWrapper#getAbsoluteDimension
 * @return the dimension
 * @type uiUtil_Dimension
 */
uiHtml_Element.prototype.getAbsoluteDimension = function() {
  // Use the getWidth() and getHeight() of this element to allow the
  // child classes to override their implementations.
  var element = this;
  return this.__supporter._getDimension(this.__domElement,
      this.__supporter._obtainAbsoluteDimension,
      function() { return element.getWidth(); },
      function() { return element.getHeight(); });
};

/**
 * Enables/Disables a widget.
 *
 * @see uiHtml_ElementWrapper#setDisabled
 * @param {boolean} value the disabled status -- true indicates
 *     disabled, while false indicates enabled
 */
uiHtml_Element.prototype.setDisabled = function(value) {
  this.__supporter.setDisabled(this.__domElement, value);
};

/**
 * Returns the wrapped DOM element.
 *
 * @return the DOM object
 * @type HTMLElement
 */
uiHtml_Element.prototype.getDomObject = function() {
  return this.__domElement;
};
// Generic method section ends.
/////

////////////////////////////////////
////////// Static Methods //////////
////////////////////////////////////

/**
 * Creates a wrapper for an element if it has not already been previously
 * created and thus cached, in which case the cached version will be returned.
 *
 * @param {String} id ID of the element
 * @param {String} name name of the element
 * @param {Class} optTypeClass an optional indication of the wrapper type
 *     of the element, if not specified, the most suitable wrapper for the
 *     element will be used
 * @return the wrapper
 * @type uiHtml_Element
 */
uiHtml_Element.createByEither = function(id, name, optTypeClass) {
  var uiDocument = uiHtml_Document.getInstance();
  var domObject = null;
  try {
    domObject = uiDocument.getDomObjectById(id, true);
  }
  catch (e) {
    if (name == null) {
      throw new uiUtil_IllegalArgumentException("Invalid element ID: " + id);
    }
    domObject = uiDocument.getDomObjectsByName(name, true)[0];
  }

  var extProps = uiHtml_Element.__getExtProps(domObject);
  if (extProps.__elementWrapper == null) {
    extProps.__elementWrapper = uiHtml_Element.__createElement(
          domObject, optTypeClass);
    uiHtml_Element.__logger.debug("Created new element " +
        extProps.__elementWrapper);
    uiHtml_Element.__logger.debug("ID/name: " + id + "/" + name);
  }
  return extProps.__elementWrapper;
};

/**
 * Creates a new class that wraps the provided DOM object, whose type is
 * determined by the optTypeClass argument. If the type is
 * not specified, a most suitable class for the object will be created
 * and returned.
 *
 * @param {HTMLElement} domObject the element DOM object
 * @param {Class} optTypeClass an optional indication of the wrapper type
 *     of the element, if not specified, the most suitable wrapper for the
 *     element will be used
 * @return the wrapper
 * @type uiHtml_Element
 */
uiHtml_Element.__createElement = function(domObject, optTypeClass) {
  if (optTypeClass != null &&
      uiUtil_Object.isAssignableFrom(uiHtml_Element, optTypeClass)) {
    return new optTypeClass(domObject);
  }
  return uiHtml_Element.createElementByType(domObject);
};

/**
 * Returns {@link uiHtml_Element}-related extended properties for an
 * element.
 *
 * @param {HTMLElement} domElement the element
 * @return the properties object
 * @type uiHtml_Element.DomExtProps
 */
uiHtml_Element.__getExtProps = function(domElement) {
  var supporter = uiHtml_ElementWrapper.getInstance();
  var extProps = supporter._getClassProperty(domElement, uiHtml_Element);
  if (extProps == null) {
    extProps = new uiHtml_Element.DomExtProps();
    supporter._setClassProperty(domElement, uiHtml_Element, extProps);
  }
  return extProps;
}

/**
 * Creates and returns the most appropriate wrapper (either an instance
 * of {@link uiHtml_Element} or its subclasses) for a HTML element.
 *
 * @param {HTMLElement} domElement the element
 * @return the created element
 * @type uiHtml_Element
 */
uiHtml_Element.createElementByType = function(domElement) {
  if (domElement == null) {
    return null;
  }

  switch(uiHtml_Element.getWidgetType(domElement)) {
    case "select"   : return new uiHtml_Select(domElement);
    default         : return new uiHtml_Element(domElement);
  }
};

/**
 * Returns a string representing the type of a widget. If a non-widget
 * object is provided, the string undefined will be returned.
 *
 * @param {HTMLElement} domElement the widget's DOM object
 * @return the type
 * @type String
 */
uiHtml_Element.getWidgetType = function(domElement) {
  var tagName = uiHtml_Element.getTagName(domElement);
  switch (tagName) {
    case "label"   :
    case "select"  :
    case "option"  :
    case "textarea": return tagName;
    case "input"   : // submit, button, text, radio, checkbox
                     return domElement.type.toLowerCase();
    default        : return "undefined";
  }
};

/**
 * author: ctoohey
 *
 * Checks whether the supplied object is an array.
 * A select widget is considered an array (of options).
 * select and radio group widgets are arrays.
 */
uiHtml_Element.isArray = function(domElement) {
  return domElement != null && domElement[0] != null;
}

/**
 * Returns the HTML tag name of an element.
 *
 * @param {HTMLElement} domElement the element
 * @return the tag name
 * @type String
 */
uiHtml_Element.getTagName = function(domElement) {
  var tagName = domElement.tagName;
  if (tagName == null) {
    return "undefined";
  }
  return tagName.toLowerCase();
};

/**
 * Initializes a newly created dom element. Some elements are to appear
 * when they are created, while some others might not.
 *
 * @param {HTMLElement} domElement the element
 * @param {boolean} optAppear an optional parameter indicating whether
 *     the element should initially appear or not (disappear).
 */
uiHtml_Element._initializeDomObject = function(domElement, optAppear) {
  var supporter = uiHtml_ElementWrapper.getInstance();
  if (uiUtil_Type.getBoolean(optAppear, true)) {
    supporter.appear(domElement);
  }
  else {
    supporter.disappear(domElement);
  }
};

///////////////////////////////////
////////// Inner Classes //////////
///////////////////////////////////

/**
 * Default constructor.
 *
 * @class An extended properties wrapper for elements
 * @extends uiUtil_Object
 */
function uiHtml_Element$DomExtProps() {
  /**
   * The HTML wrapper (i.e. Element, Select, Toggle, Panel, etc.) object
   * cache, intended to prevent instantiation of multiple wrappers for the
   * same DOM object, in which case, the state of the two wrappers might
   * not be consistent. Thus, to avoid the inconsistency problem, a DOM
   * HTML element is meant to have only one wrapper.
   *
   * @type uiHtml_Element
   * @private
   */
  this.__elementWrapper = null;
}

/** @ignore */
uiHtml_Element.DomExtProps = uiUtil_Object.declareClass(
    uiHtml_Element$DomExtProps, uiUtil_Object);


text:
POMDOG_SUPPRESS_WARNINGS_GENERATED_BY_STD_HEADERS_BEGIN
#include <Windows.h>
#include <tchar.h>
POMDOG_SUPPRESS_WARNINGS_GENERATED_BY_STD_HEADERS_END


text:
[Back to Modules](./)

## Installation Guide

To manually install a SmartFlat module, put the module into `smartflat/modules` and run `yarn run build`. You may need to create the `modules` folder.

Afterwards restart SmartFlat and the module should work.


text:
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc.  All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// 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 Google Inc. 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.

package com.google.protobuf;

import com.google.protobuf.Internal.EnumLite;

import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

/**
 * Internal representation of map fields in generated lite-runtime messages.
 *
 * This class is a protobuf implementation detail. Users shouldn't use this
 * class directly.
 */
public final class MapFieldLite<K, V> extends LinkedHashMap<K, V> {

  private boolean isMutable;

  private MapFieldLite() {
    this.isMutable = true;
  }

  private MapFieldLite(Map<K, V> mapData) {
    super(mapData);
    this.isMutable = true;
  }

  @SuppressWarnings({"rawtypes", "unchecked"})
  private static final MapFieldLite EMPTY_MAP_FIELD = new MapFieldLite(Collections.emptyMap());
  static {
    EMPTY_MAP_FIELD.makeImmutable();
  }

  /** Returns an singleton immutable empty MapFieldLite instance. */
  @SuppressWarnings({"unchecked", "cast"})
  public static <K, V> MapFieldLite<K, V> emptyMapField() {
    return (MapFieldLite<K, V>) EMPTY_MAP_FIELD;
  }

  public void mergeFrom(MapFieldLite<K, V> other) {
    ensureMutable();
    if (!other.isEmpty()) {
      putAll(other);
    }
  }

  @SuppressWarnings({"unchecked", "cast"})
  @Override public Set<Map.Entry<K, V>> entrySet() {
    return isEmpty() ? Collections.<Map.Entry<K, V>>emptySet() : super.entrySet();
  }

  @Override public void clear() {
    ensureMutable();
    clear();
  }

  @Override public V put(K key, V value) {
    ensureMutable();
    return super.put(key, value);
  }

  public V put(Map.Entry<K, V> entry) {
    return put(entry.getKey(), entry.getValue());
  }

  @Override public void putAll(Map<? extends K, ? extends V> m) {
    ensureMutable();
    super.putAll(m);
  }

  @Override public V remove(Object key) {
    ensureMutable();
    return super.remove(key);
  }

  private static boolean equals(Object a, Object b) {
    if (a instanceof byte[] && b instanceof byte[]) {
      return Arrays.equals((byte[]) a, (byte[]) b);
    }
    return a.equals(b);
  }

  /**
   * Checks whether two {@link Map}s are equal. We don't use the default equals
   * method of {@link Map} because it compares by identity not by content for
   * byte arrays.
   */
  static <K, V> boolean equals(Map<K, V> a, Map<K, V> b) {
    if (a == b) {
      return true;
    }
    if (a.size() != b.size()) {
      return false;
    }
    for (Map.Entry<K, V> entry : a.entrySet()) {
      if (!b.containsKey(entry.getKey())) {
        return false;
      }
      if (!equals(entry.getValue(), b.get(entry.getKey()))) {
        return false;
      }
    }
    return true;
  }

  /**
   * Checks whether two map fields are equal.
   */
  @SuppressWarnings("unchecked")
  @Override
  public boolean equals(Object object) {
    return (object instanceof Map) && equals(this, (Map<K, V>) object);
  }

  private static int calculateHashCodeForObject(Object a) {
    if (a instanceof byte[]) {
      return Internal.hashCode((byte[]) a);
    }
    // Enums should be stored as integers internally.
    if (a instanceof EnumLite) {
      throw new UnsupportedOperationException();
    }
    return a.hashCode();
  }

  /**
   * Calculates the hash code for a {@link Map}. We don't use the default hash
   * code method of {@link Map} because for byte arrays and protobuf enums it
   * use {@link Object#hashCode()}.
   */
  static <K, V> int calculateHashCodeForMap(Map<K, V> a) {
    int result = 0;
    for (Map.Entry<K, V> entry : a.entrySet()) {
      result += calculateHashCodeForObject(entry.getKey())
          ^ calculateHashCodeForObject(entry.getValue());
    }
    return result;
  }

  @Override
  public int hashCode() {
    return calculateHashCodeForMap(this);
  }

  private static Object copy(Object object) {
    if (object instanceof byte[]) {
      byte[] data = (byte[]) object;
      return Arrays.copyOf(data, data.length);
    }
    return object;
  }

  /**
   * Makes a deep copy of a {@link Map}. Immutable objects in the map will be
   * shared (e.g., integers, strings, immutable messages) and mutable ones will
   * have a copy (e.g., byte arrays, mutable messages).
   */
  @SuppressWarnings("unchecked")
  static <K, V> Map<K, V> copy(Map<K, V> map) {
    Map<K, V> result = new LinkedHashMap<K, V>();
    for (Map.Entry<K, V> entry : map.entrySet()) {
      result.put(entry.getKey(), (V) copy(entry.getValue()));
    }
    return result;
  }

  /** Returns a deep copy of this map field. */
  public MapFieldLite<K, V> mutableCopy() {
    return isEmpty() ? new MapFieldLite<K, V>() : new MapFieldLite<K, V>(this);
  }

  /**
   * Makes this field immutable. All subsequent modifications will throw an
   * {@link UnsupportedOperationException}.
   */
  public void makeImmutable() {
    isMutable = false;
  }

  /**
   * Returns whether this field can be modified.
   */
  public boolean isMutable() {
    return isMutable;
  }

  private void ensureMutable() {
    if (!isMutable()) {
      throw new UnsupportedOperationException();
    }
  }
}


text:
/** @author Jia Pan */

#ifndef FCL_TRAVERSAL_MESHSHAPEDISTANCETRAVERSALNODE_H
#define FCL_TRAVERSAL_MESHSHAPEDISTANCETRAVERSALNODE_H

#include "fcl/geometry/shape/utility.h"
#include "fcl/narrowphase/detail/traversal/distance/bvh_shape_distance_traversal_node.h"

namespace fcl
{

namespace detail
{

/// @brief Traversal node for distance between mesh and shape
template <typename BV, typename Shape, typename NarrowPhaseSolver>
class MeshShapeDistanceTraversalNode
    : public BVHShapeDistanceTraversalNode<BV, Shape>
{
public:

  using S = typename BV::S;

  MeshShapeDistanceTraversalNode();

  /// @brief Distance testing between leaves (one triangle and one shape)
  void leafTesting(int b1, int b2) const;

  /// @brief Whether the traversal process can stop early
  bool canStop(S c) const;

  Vector3<S>* vertices;
  Triangle* tri_indices;

  S rel_err;
  S abs_err;

  const NarrowPhaseSolver* nsolver;
};

template <typename BV, typename Shape, typename NarrowPhaseSolver>
void meshShapeDistanceOrientedNodeLeafTesting(
    int b1, int /* b2 */,
    const BVHModel<BV>* model1,
    const Shape& model2,
    Vector3<typename BV::S>* vertices,
    Triangle* tri_indices,
    const Transform3<typename BV::S>& tf1,
    const Transform3<typename BV::S>& tf2,
    const NarrowPhaseSolver* nsolver,
    bool enable_statistics,
    int & num_leaf_tests,
    const DistanceRequest<typename BV::S>& /* request */,
    DistanceResult<typename BV::S>& result);

template <typename BV, typename Shape, typename NarrowPhaseSolver>
void distancePreprocessOrientedNode(
    const BVHModel<BV>* model1,
    Vector3<typename BV::S>* vertices,
    Triangle* tri_indices,
    int init_tri_id,
    const Shape& model2,
    const Transform3<typename BV::S>& tf1,
    const Transform3<typename BV::S>& tf2,
    const NarrowPhaseSolver* nsolver,
    const DistanceRequest<typename BV::S>& /* request */,
    DistanceResult<typename BV::S>& result);

/// @brief Initialize traversal node for distance computation between one mesh
/// and one shape, given the current transforms
template <typename BV, typename Shape, typename NarrowPhaseSolver>
bool initialize(
    MeshShapeDistanceTraversalNode<BV, Shape, NarrowPhaseSolver>& node,
    BVHModel<BV>& model1,
    Transform3<typename BV::S>& tf1,
    const Shape& model2,
    const Transform3<typename BV::S>& tf2,
    const NarrowPhaseSolver* nsolver,
    const DistanceRequest<typename BV::S>& request,
    DistanceResult<typename BV::S>& result,
    bool use_refit = false, bool refit_bottomup = false);

/// @brief Traversal node for distance between mesh and shape, when mesh BVH is one of the oriented node (RSS, OBBRSS, kIOS)
template <typename Shape, typename NarrowPhaseSolver>
class MeshShapeDistanceTraversalNodeRSS
    : public MeshShapeDistanceTraversalNode<
    RSS<typename Shape::S>, Shape, NarrowPhaseSolver>
{
public:
  using S = typename Shape::S;

  MeshShapeDistanceTraversalNodeRSS();

  void preprocess();

  void postprocess();

  S BVTesting(int b1, int b2) const;

  void leafTesting(int b1, int b2) const;
};

template <typename Shape, typename NarrowPhaseSolver>
bool initialize(
    MeshShapeDistanceTraversalNodeRSS<Shape, NarrowPhaseSolver>& node,
    const BVHModel<RSS<typename Shape::S>>& model1,
    const Transform3<typename Shape::S>& tf1,
    const Shape& model2,
    const Transform3<typename Shape::S>& tf2,
    const NarrowPhaseSolver* nsolver,
    const DistanceRequest<typename Shape::S>& request,
    DistanceResult<typename Shape::S>& result);

template <typename Shape, typename NarrowPhaseSolver>
class MeshShapeDistanceTraversalNodekIOS
    : public MeshShapeDistanceTraversalNode<kIOS<typename Shape::S>, Shape, NarrowPhaseSolver>
{
public:
  using S = typename Shape::S;

  MeshShapeDistanceTraversalNodekIOS();

  void preprocess();

  void postprocess();

  S BVTesting(int b1, int b2) const;

  void leafTesting(int b1, int b2) const;

};

/// @brief Initialize traversal node for distance computation between one mesh and one shape, specialized for kIOS type
template <typename Shape, typename NarrowPhaseSolver>
bool initialize(
    MeshShapeDistanceTraversalNodekIOS<Shape, NarrowPhaseSolver>& node,
    const BVHModel<kIOS<typename Shape::S>>& model1, const Transform3<typename Shape::S>& tf1,
    const Shape& model2, const Transform3<typename Shape::S>& tf2,
    const NarrowPhaseSolver* nsolver,
    const DistanceRequest<typename Shape::S>& request,
    DistanceResult<typename Shape::S>& result);

template <typename Shape, typename NarrowPhaseSolver>
class MeshShapeDistanceTraversalNodeOBBRSS
    : public MeshShapeDistanceTraversalNode<OBBRSS<typename Shape::S>, Shape, NarrowPhaseSolver>
{
public:
  using S = typename Shape::S;

  MeshShapeDistanceTraversalNodeOBBRSS();

  void preprocess();

  void postprocess();

  S BVTesting(int b1, int b2) const;

  void leafTesting(int b1, int b2) const;

};

/// @brief Initialize traversal node for distance computation between one mesh and one shape, specialized for OBBRSS type
template <typename Shape, typename NarrowPhaseSolver>
bool initialize(
    MeshShapeDistanceTraversalNodeOBBRSS<Shape, NarrowPhaseSolver>& node,
    const BVHModel<OBBRSS<typename Shape::S>>& model1,
    const Transform3<typename Shape::S>& tf1,
    const Shape& model2,
    const Transform3<typename Shape::S>& tf2,
    const NarrowPhaseSolver* nsolver,
    const DistanceRequest<typename Shape::S>& request,
    DistanceResult<typename Shape::S>& result);

} // namespace detail
} // namespace fcl

#include "fcl/narrowphase/detail/traversal/distance/mesh_shape_distance_traversal_node-inl.h"

#endif


text:
package eu.ydp.empiria.player.client.util.events.internal.feedback;

import eu.ydp.empiria.player.client.util.events.internal.AbstractEvent;
import eu.ydp.empiria.player.client.util.events.internal.EventTypes;
import eu.ydp.empiria.player.client.util.events.internal.EventType;

public class FeedbackEvent extends AbstractEvent<FeedbackEventHandler, FeedbackEventTypes> {

    private static final EventTypes<FeedbackEventHandler, FeedbackEventTypes> types = new EventTypes<FeedbackEventHandler, FeedbackEventTypes>();

    private boolean isMuted;

    public FeedbackEvent(FeedbackEventTypes type, Object source) {
        super(type, source);
    }

    public FeedbackEvent(FeedbackEventTypes type, boolean isMuted, Object source) {
        super(type, source);
        this.isMuted = isMuted;
    }

    @Override
    protected EventTypes<FeedbackEventHandler, FeedbackEventTypes> getTypes() {
        return types;
    }

    @Override
    public void dispatch(FeedbackEventHandler handler) {
        handler.onFeedbackEvent(this);
    }

    public static EventType<FeedbackEventHandler, FeedbackEventTypes> getType(FeedbackEventTypes type) {
        return types.getType(type);
    }

    public boolean isMuted() {
        return isMuted;
    }

}


text:
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { SharedModule } from 'app/shared/shared.module';
import { CommonListOfSpeakersSlideComponent } from '../common/common-list-of-speakers-slide.component';
import { CommonListOfSpeakersSlideModule } from '../common/common-list-of-speakers-slide.module';
import { SlideToken } from '../../slide-token';

@NgModule({
    imports: [CommonModule, SharedModule, CommonListOfSpeakersSlideModule],
    providers: [{ provide: SlideToken.token, useValue: CommonListOfSpeakersSlideComponent }]
})
export class ListOfSpeakersSlideModule {}


text:
const API_ENDPOINT = `https://api.canonn.tech`;
const API_LIMIT = 1000;

const capi = axios.create({
	baseURL: API_ENDPOINT,
	headers: {
		'Content-Type': 'application/json',
		'Accept': 'application/json',
	},
});

let sites = {
	gysites: [],
};

const go = async types => {
	const keys = Object.keys(types);
	return (await Promise.all(
			keys.map(type => getSites(type))
	)).reduce((acc, res, i) => {
			acc[keys[i]] = res;
			return acc;
	}, {});
};

const getSites = async type => {
	let records = [];
	let keepGoing = true;
	let API_START = 0;
	while (keepGoing) {
		let response = await reqSites(API_START, type);
		await records.push.apply(records, response.data);
		API_START += API_LIMIT;
		if (response.data.length < API_LIMIT) {
			keepGoing = false;
			return records;
		}
	}
};

const reqSites = async (API_START, type) => {

	let payload = await capi({
		url: `/${type}?_limit=${API_LIMIT}&_start=${API_START}`,
		method: 'get'
	});

	return payload;
};

var canonnEd3d_gy = {
	//Define Categories
	systemsData: {
		categories: {
			'Geysers - (GY)': {
				'201': {
					name: 'Water Geyser',
					color: randomColor().replace('#', '').toString()
				},
				'202': {
					name: 'Water Ice Geyser',
					color: randomColor().replace('#', '').toString()
				},
				'203': {
					name: 'Carbon Dioxide Ice Geyser',
					color: randomColor().replace('#', '').toString()
				},
				'204': {
					name: 'Ammonia Ice Geyser',
					color: randomColor().replace('#', '').toString()
				},
				'205': {
					name: 'Methane Ice Geyser',
					color: randomColor().replace('#', '').toString()
				},
				'206': {
					name: 'Nitrogen Ice Geyser',
					color: randomColor().replace('#', '').toString()
				}
			},
			'Unknown Type': {
				'2000': {
					name: 'Unknown Site',
					color: '800000',
				},
			},
		},
		systems: [],
	},

	formatSites: async function(data, resolvePromise) {
		sites = await go(data);

		let siteTypes = Object.keys(data);

		for (var i = 0; i < siteTypes.length; i++) {
			for (var d = 0; d < sites[siteTypes[i]].length; d++) {
				let siteData = sites[siteTypes[i]];
				if (siteData[d].system.systemName && siteData[d].system.systemName.replace(' ', '').length > 1) {
					var poiSite = {};
					poiSite['name'] = siteData[d].system.systemName;

					//Check Site Type and match categories
					if (siteData[d].type.type == 'Water Geyser') {
						poiSite['cat'] = [201];
					} else if (siteData[d].type.type == 'Water Ice Geyser') {
						poiSite['cat'] = [202];
					} else if (siteData[d].type.type == 'Carbon Dioxide Ice Geyser') {
						poiSite['cat'] = [203];
					} else if (siteData[d].type.type == 'Ammonia Ice Geyser') {
						poiSite['cat'] = [204];
					} else if (siteData[d].type.type == 'Methane Ice Geyser') {
						poiSite['cat'] = [205];
					} else if (siteData[d].type.type == 'Nitrogen Ice Geyser') {
						poiSite['cat'] = [206];
					} else {
						poiSite['cat'] = [2000];
					}
					poiSite['coords'] = {
						x: parseFloat(siteData[d].system.edsmCoordX),
						y: parseFloat(siteData[d].system.edsmCoordY),
						z: parseFloat(siteData[d].system.edsmCoordZ),
					};

					// We can then push the site to the object that stores all systems
					canonnEd3d_gy.systemsData.systems.push(poiSite);
				}
			}
		}
		document.getElementById("loading").style.display = "none";
		resolvePromise();
	},

	init: function() {
		//Sites Data
		var p1 = new Promise(function(resolve, reject) {
			canonnEd3d_gy.formatSites(sites, resolve);
		});

		Promise.all([p1]).then(function() {
			Ed3d.init({
				container: 'edmap',
				json: canonnEd3d_gy.systemsData,
				withFullscreenToggle: false,
				withHudPanel: true,
				hudMultipleSelect: true,
				effectScaleSystem: [20, 500],
				startAnim: false,
				showGalaxyInfos: true,
				cameraPos: [25, 14100, -12900],
				systemColor: '#FF9D00',
			});
		});
	},
};


text:
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
-->

<link rel="import" href="../../bower_components/polymer/polymer.html">

<dom-module id="my-markdown">
  <style>
    :host {
      display: block;
    }
  </style>
  <template>
    <span id="content" />
  </template>
</dom-module>
<script>
(function() {
/* globals markdown: false */
var me;

  var xmlhttp = new XMLHttpRequest();
  xmlhttp.onreadystatechange = function() {
      if (xmlhttp.readyState === 4 && xmlhttp.status === 200) {
          me.$.content.innerHTML = markdown.toHTML(xmlhttp.responseText);
      }
  };

  var observe = function() {
    if (this.src && this.suffix) {
      var url = this.src + this.suffix + '.md';
      me = this;
      xmlhttp.open('GET', url, true);
      xmlhttp.send();
    }
  };

  Polymer({
    is: 'my-markdown',
    observe: observe,
    properties: {
      suffix: {
        type: String,
        value: 'src',
        notify: true,
        observer: 'observe'
      },
      src: {
        type: String,
        value: 'src',
        notify: true,
        observer: 'observe'
      }
    }
  });
})();
</script>


text:
package org.trustedanalytics.cfbroker.store.zookeeper.service.integration;

import java.util.Arrays;
import java.util.List;

import org.apache.curator.test.TestingServer;
import org.apache.zookeeper.ZooDefs;
import org.apache.zookeeper.data.ACL;
import org.apache.zookeeper.data.Id;
import org.apache.zookeeper.server.auth.DigestAuthenticationProvider;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.trustedanalytics.cfbroker.store.zookeeper.service.ZookeeperClient;
import org.trustedanalytics.cfbroker.store.zookeeper.service.ZookeeperClientBuilder;
import org.trustedanalytics.cfbroker.store.zookeeper.service.utils.ZookeeperTestUtils;

public class ZookeeperClientBuilderTest {

  private static final String ROOT_DIR = "/store/test";
  private static final String USERNAME = "admin";
  private static final String PASSWORD = "haselko_maselko";
  private static String connectionString;
  private TestingServer zookeeperServer;
  private ZookeeperTestUtils.ZookeeperCredentials zookeeperCredentials;

  @Before
  public void setup() throws Exception {
    initTestServer();

  }

  @After
  public void tearDown() {
    try {
      zookeeperServer.stop();
    } catch (Exception e) {
      e.printStackTrace();
    }
  }

  @Test
  public void build_createWithoutRootCreation_rootExists() throws Exception {
    ZookeeperTestUtils.createDir(zookeeperCredentials, ROOT_DIR);
    testZookeeperClientWithoutRootCreation();
  }

  @Test(expected = IllegalArgumentException.class)
  public void build_createWithoutRootCreation_rootNotExists() throws Exception {
    testZookeeperClientWithoutRootCreation();
  }

  @Test
  public void build_createWithRootCreation_rootExists() throws Exception {
    ZookeeperTestUtils.createDir(zookeeperCredentials, ROOT_DIR);
    testZookeeperClientWithRootCreation();
  }

  @Test
  public void build_createWithRootCreation_rootNotExists() throws Exception {
    testZookeeperClientWithRootCreation();
  }

  private void testZookeeperClientWithoutRootCreation() throws Exception {
    ZookeeperClient zkClient =
        new ZookeeperClientBuilder(connectionString, USERNAME, PASSWORD, ROOT_DIR).build();
    zkClient.init();
    zkClient.exists(ROOT_DIR);
    zkClient.destroy();
  }

  private void testZookeeperClientWithRootCreation() throws Exception {
    String digest =
        DigestAuthenticationProvider.generateDigest(String.format("%s:%s", USERNAME, PASSWORD));
    List<ACL> acl = Arrays.asList(new ACL(ZooDefs.Perms.ALL, new Id("digest", digest)));

    ZookeeperClient zkClient =
        new ZookeeperClientBuilder(connectionString, USERNAME, PASSWORD, ROOT_DIR)
            .withRootCreation(acl).build();
    zkClient.init();
    zkClient.exists(ROOT_DIR);
    zkClient.destroy();
  }

  private void initTestServer() throws Exception {
    zookeeperServer = new TestingServer();
    zookeeperServer.start();
    connectionString = zookeeperServer.getConnectString();
    zookeeperCredentials =
        new ZookeeperTestUtils.ZookeeperCredentials(connectionString, USERNAME, PASSWORD);
  }

}


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBotsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('bots', function(Blueprint $table)
		{
			$table->increments('id');

			$table->string('name')->unique();
			$table->string('forum')->unique();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('bots');
	}

}


text:
import {PropTypes} from 'react';
import {
  requireNativeComponent,
  View
} from 'react-native';

import BarLineChartBase from './BarLineChartBase';
import ChartDataSetConfig from './ChartDataSetConfig';

const iface = {
  name: 'LineChart',
  propTypes: {
    ...BarLineChartBase.propTypes,

    data: PropTypes.shape({
      datasets: PropTypes.arrayOf(PropTypes.shape({
        yValues: PropTypes.arrayOf(PropTypes.number),
        label: PropTypes.string,
        config: PropTypes.shape({
          ...ChartDataSetConfig.common,
          ...ChartDataSetConfig.barLineScatterCandleBubble,
          ...ChartDataSetConfig.lineScatterCandleRadar,
          ...ChartDataSetConfig.lineRadar,

          circleRadius: PropTypes.number,
          drawCircles: PropTypes.bool,
          drawCubic: PropTypes.bool,
          drawCubicIntensity: PropTypes.number,
          circleColor: PropTypes.string,
          circleColors: PropTypes.arrayOf(PropTypes.string),
          circleColorHole: PropTypes.string,
          drawCircleHole: PropTypes.bool,

          dashedLine: PropTypes.shape({
            lineLength: PropTypes.number.isRequired,
            spaceLength: PropTypes.number.isRequired,
            phase: PropTypes.number,
          })
        })
      })),
      xValues: PropTypes.arrayOf(PropTypes.string)
    })
  }
};

export default requireNativeComponent('MPAndroidLineChart', iface);


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <!-- Module Metadata -->
  <parent>
    <groupId>org.ihtsdo.otf.mapping</groupId>
    <artifactId>mapping-parent</artifactId>
    <version>1.5.16-SNAPSHOT</version>
    <relativePath>../../parent</relativePath>
  </parent>

  <artifactId>mapping-admin-qa</artifactId>
  <name>OTF RF2 Admin Quality Assurance</name>
  <description>OTF RF2 Administrator Tools to Run Quality Assurance Checks</description>
  <packaging>pom</packaging>

  <!-- The mojo properties -->
  <properties>
    <!-- The refset id -->
    <refset.id></refset.id>
    <!-- The mode for the QA map groups QA -->
    <mode></mode>
  </properties>

  <profiles>

    <!-- QA Workflow for project, specify -Drun.config=... -->
    <profile>
      <id>Workflow</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.ihtsdo.otf.mapping</groupId>
            <artifactId>mapping-admin-mojo</artifactId>
            <executions>
              <execution>
                <id>qa-workflow</id>
                <phase>package</phase>
                <goals>
                  <goal>qa-workflow</goal>
                </goals>
                <configuration>
                  <refsetId>${refset.id}</refsetId>
                  <sendNotification>${send.notification}</sendNotification>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <!-- Database QA, specify -Drun.config=... -->
    <profile>
      <id>Database</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.ihtsdo.otf.mapping</groupId>
            <artifactId>mapping-admin-mojo</artifactId>
            <executions>
              <execution>
                <id>qa-database</id>
                <phase>package</phase>
                <goals>
                  <goal>qa-database</goal>
                </goals>
                <configuration>
                  <!-- Queries should select >1 fields to avoid issues -->
                  <queries>

                    <property>
                      <name>Reports have unique timestamp for definition and
                        project</name>
                      <value>
                        select mapProjectId, name,
                        from_unixtime(timestamp/1000)
                        from reports group by
                        mapProjectId, name, from_unixtime(timestamp/1000)
                        having
                        count(*)>1;
                      </value>
                    </property>

                    <property>
                      <name>Validate non-rule based projects have empty rules</name>
                      <value>
                        SELECT mapRecord_id, id, rule FROM map_entries
                        WHERE rule != '' AND mapRecord_id in
                        (SELECT id FROM
                        map_records
                        WHERE mapProjectId in
                        (SELECT id FROM
                        map_projects WHERE ruleBased = 0));
                      </value>
                    </property>

                    <property>
                      <name>Validate rule based projects never have empty rules</name>
                      <value>
                        SELECT mapRecord_id, id, rule FROM map_entries
                        WHERE rule = '' AND mapRecord_id in
                        (SELECT id FROM
                        map_records
                        WHERE mapProjectId in
                        (SELECT id FROM
                        map_projects WHERE ruleBased = 1));
                      </value>
                    </property>

                    <property>
                      <name>Validate map entry targetId is never null</name>
                      <value>
                        SELECT mapRecord_id, id FROM map_entries
                        WHERE
                        targetId is null;
                      </value>
                    </property>

                    <property>
                      <name>Validate map entry targetName is "No target" when targetId is blank</name>
                      <value>
                        SELECT mapRecord_id, id FROM map_entries
                        WHERE
                        targetId = '' and targetName != 'No target';
                      </value>
                    </property>

                    <property>
                      <name>Validate active concept default preferred names -
                        SNOMEDCT</name>
                      <value>
                        SELECT terminologyId, defaultPreferredName
                        FROM
                        concepts a
                        WHERE a.active = 1 AND terminology =
                        'SNOMEDCT' AND NOT EXISTS
                        (SELECT * FROM descriptions b,
                        language_refset_members c
                        WHERE a.id =
                        b.concept_id
                        AND
                        b.active = 1 AND c.active =
                        1
                        AND b.id = c.description_id
                        AND
                        b.typeId='900000000000003001'
                        AND c.refSetId =
                        '900000000000509007'
                        AND c.acceptabilityId =
                        '900000000000548007'
                        AND a.defaultPreferredName =
                        b.term);
                      </value>
                    </property>

                    <property>
                      <name>Validate concept default preferred names - not
                        SNOMEDCT</name>
                      <value>
                        SELECT terminologyId, defaultPreferredName
                        FROM
                        concepts a
                        WHERE terminology != 'SNOMEDCT'
                          AND defaultPreferredName not like '% - %'
                          AND NOT EXISTS
                        (SELECT * FROM descriptions b
                        WHERE a.id = b.concept_id
                        AND a.defaultPreferredName = b.term);
                      </value>
                    </property>

                    <property>
                      <name>Validate active concepts have tree positions</name>
                      <value>
                        SELECT terminologyId, defaultPreferredName
                        FROM
                        concepts a
                        WHERE active = 1 AND terminology='SNOMEDCT'
                        and terminologyId != '26383008'
                        AND
                        NOT EXISTS
                        (SELECT * FROM tree_positions b
                        WHERE
                        a.terminologyId = b.terminologyId
                        AND a.terminology =
                        b.terminology
                        AND a.terminologyVersion =
                        b.terminologyVersion);
                      </value>
                    </property>

                    <property>
                      <name>Validate map project source terminology exists</name>
                      <value>
                        SELECT a.id, a.name, a.sourceTerminology
                        FROM
                        map_projects a
                        WHERE NOT EXISTS
                        (SELECT * FROM concepts b
                        WHERE a.sourceTerminology = b.terminology
                        AND
                        a.sourceTerminologyVersion = b.terminologyVersion);
                      </value>
                    </property>

                    <property>
                      <name>Validate map project destination terminology exists</name>
                      <value>
                        SELECT a.id, a.name, a.destinationTerminology
                        FROM
                        map_projects a
                        WHERE NOT EXISTS
                        (SELECT * FROM concepts b
                        WHERE a.destinationTerminology = b.terminology
                        AND
                        a.destinationTerminologyVersion = b.terminologyVersion);
                      </value>
                    </property>

                    <!-- This check has a temporary exception for project 10 because
                      it does not have a real refset id -->
                    <property>
                      <name>Map project refSetId exists in concepts</name>
                      <value>
                        SELECT a.id, a.name, refSetId, refSetName
                        FROM
                        map_projects a
                        WHERE a.name not like 'Published%' AND NOT EXISTS
                        (SELECT *
                        FROM concepts b
                        WHERE a.refSetId = b.terminologyId
                        AND
                        a.sourceTerminology = b.terminology
                        AND
                        a.sourceTerminologyVersion = b.terminologyVersion);
                      </value>
                    </property>

                    <property>
                      <name>Map project scope concepts should exist</name>
                      <value>
                        SELECT a.id, a.name
                        FROM map_projects a,
                        map_projects_scope_concepts b
                        WHERE a.id = b.id
                        AND NOT
                        EXISTS
                        (SELECT * FROM concepts c
                        WHERE b.scopeConcepts =
                        c.terminologyId
                        AND a.sourceTerminology = c.terminology
                        AND a.sourceTerminologyVersion = c.terminologyVersion);
                      </value>
                    </property>

                    <property>
                      <name>Map project scope excluded concepts should exist</name>
                      <value>
                        SELECT a.id, a.name
                        FROM map_projects a,
                        map_projects_scope_excluded_concepts b
                        WHERE a.id = b.id
                        AND NOT EXISTS
                        (SELECT * FROM concepts c
                        WHERE
                        b.scopeExcludedConcepts = c.terminologyId
                        AND
                        a.sourceTerminology = c.terminology
                        AND
                        a.sourceTerminologyVersion = c.terminologyVersion);
                      </value>
                    </property>

                    <property>
                      <name>Every map record should have a valid concept</name>
                      <value>
                        SELECT b.id, a.conceptId
                        FROM map_records a,
                        map_projects b
                        WHERE mapProjectId = b.id
                        AND NOT EXISTS
                        (SELECT * FROM concepts c
                        WHERE a.conceptId =
                        c.terminologyId
                        AND b.sourceTerminology = c.terminology
                        AND b.sourceTerminologyVersion = c.terminologyVersion);
                      </value>
                    </property>

                    <property>
                      <!-- Have an ICDO exception because legacy map data works this way. -->
                      <name>Every map entry should have a valid targetId (if not empty)</name>
                      <value>
                        SELECT b.conceptId, c.id, a.targetId
                        FROM
                        map_entries a, map_records b, map_projects c
                        WHERE c.destinationTerminology != 'ICDO'
                        AND a.mapRecord_id = b.id
                        AND b.mapProjectId = c.id
                        AND
                        targetId != ''
                        AND NOT EXISTS
                        (SELECT * FROM concepts d
                        WHERE a.targetId = d.terminologyId
                        AND
                        c.destinationTerminology = d.terminology
                        AND
                        c.destinationTerminologyVersion = d.terminologyVersion);
                      </value>
                    </property>

                    <property>
                      <name>Every feedback should belong to a legitimate project</name>
                      <value>
                        SELECT terminologyId, mapProjectId
                        FROM
                        feedback_conversations
                        WHERE mapProjectId NOT IN (SELECT
                        id FROM map_projects);
                      </value>
                    </property>

                    <property>
                      <name>Every feedback should belong to a legitimate record</name>
                      <value>
                        SELECT terminologyId, mapProjectId, mapRecordId,
                        terminology,
                        terminologyVersion
                        FROM
                        feedback_conversations a
                        WHERE NOT EXISTS
                        (SELECT * FROM
                        map_records_AUD b, map_projects c
                        WHERE a.terminologyId =
                        b.conceptId
                        AND a.terminology = c.sourceTerminology
                        AND
                        a.terminologyVersion = c.sourceTerminologyVersion
                        AND
                        a.mapRecordId = b.id
                        AND b.mapProjectId = c.id
                        AND
                        a.mapProjectId = b.mapProjectId);
                      </value>
                    </property>

                    <property>
                      <name>A map record should have only a single feedback
                        conversation</name>
                      <value>
                        SELECT mapProjectId, mapRecordId FROM
                        feedback_conversations
                        GROUP BY mapProjectId, mapRecordId
                        HAVING count(*)>1;
                      </value>
                    </property>

                    <property>
                      <name>No orphaned report definitions</name>
                      <value>
                        SELECT id, name FROM report_definitions a
                        WHERE NOT
                        EXISTS
                        (SELECT * FROM map_projects_report_definitions b
                        WHERE a.id =
                        b.reportDefinitions_id);
                      </value>
                    </property>

                    <property>
                      <name>Map record origins should exist</name>
                      <value>
                        SELECT * FROM map_records_origin_ids a
                        WHERE NOT
                        EXISTS
                        (SELECT * FROM map_records_AUD b
                        WHERE a.originIds
                        = b.id);
                      </value>
                    </property>

                    <property>
                      <name>No orphaned advice</name>
                      <value>
                        SELECT id, name FROM map_advices a
                        WHERE NOT EXISTS
                        (SELECT * FROM map_projects_map_advices b WHERE a.id =
                        b.mapAdvices_id);
                      </value>
                    </property>

                    <property>
                      <name>No orphaned principles</name>
                      <value>
                        SELECT id, name FROM map_principles a
                        WHERE NOT
                        EXISTS
                        (SELECT * FROM map_projects_map_principles b WHERE
                        a.id =
                        b.mapPrinciples_id);
                      </value>
                    </property>

                    <property>
                      <name>No orphaned relations</name>
                      <value>
                        SELECT id, name FROM map_relations a
                        WHERE NOT
                        EXISTS
                        (SELECT * FROM map_projects_map_relations b WHERE
                        a.id =
                        b.mapRelations_id);
                      </value>
                    </property>

                    <property>
                      <name>No orphaned preset age ranges</name>
                      <value>
                        SELECT id, name FROM map_age_ranges a
                        WHERE NOT
                        EXISTS
                        (SELECT * FROM map_projects_map_age_ranges b WHERE
                        a.id =
                        b.presetAgeRanges_id);
                      </value>
                    </property>

                    <!-- Interesting but not a requirement <property> <name>No orphaned
                      users</name> <value> SELECT id, userName FROM map_users a WHERE applicationRole !=
                      'VIEWER' and NOT EXISTS (SELECT * FROM map_projects_map_specialists b WHERE a.id
                      = b.map_users_id UNION SELECT * FROM map_projects_map_leads b WHERE a.id = b.map_users_id
                      UNION SELECT * FROM map_projects_map_administrators b WHERE a.id = b.map_users_id)
                      AND userName NOT IN ('default','guest','legacy','loader','qa'); </value> </property> -->
                    <property>
                      <name>Workflow exceptions have valid projects</name>
                      <value>
                        SELECT * FROM workflow_exceptions a
                        WHERE NOT EXISTS
                        (SELECT * FROM map_projects b WHERE b.id =
                        a.mapProjectId);
                      </value>
                    </property>

                    <property>
                      <name>PUBLISHED or READY_FOR_PUBLICATION map records do
                        not have tracking records</name>
                      <value>
                        SELECT a.mapProjectId, a.id, a.conceptId, a.conceptName, a.workflowStatus
                        FROM
                        map_records a, tracking_records t
                        WHERE a.workflowStatus in ('PUBLISHED',
                        'READY_FOR_PUBLICATION')
                        and a.conceptId = t.terminologyId
                        and a.mapProjectId = t.mapProjectId
                        order by a.mapProjectId, a.conceptId;

                      </value>
                    </property>

                    <property>
                      <name>Non-PUBLISHED and non-READY_FOR_PUBLICATION map
                        records always have a tracking record</name>
                      <value>
                        SELECT mapProjectId, a.id, workflowStatus
                        FROM
                        map_records a, concepts c
                        WHERE workflowStatus not in ('PUBLISHED',
                        'READY_FOR_PUBLICATION')
                        AND c.terminologyId = a.conceptId
                        AND c.active = 1
                        AND NOT EXISTS
                        (SELECT * FROM
                        tracking_records b
                        WHERE a.mapProjectId = b.mapProjectId
                        AND a.conceptId = b.terminologyId);
                      </value>
                    </property>

                    <property>
                      <name>Empty target has only acceptable map relations</name>
                      <value>
                        SELECT d.id, c.conceptId, b.name
                        FROM map_entries a,
                        map_relations b, map_records c, map_projects d
                        WHERE
                        a.mapRelation_id = b.id
                        AND a.mapRecord_id = c.id
                        AND
                        c.mapProjectId = d.id
                        AND a. targetId = ''
                        AND
                        isAllowableForNullTarget != 1;
                      </value>
                    </property>

                    <property>
                      <name>Non empty target has only acceptable map relations</name>
                      <value>
                        SELECT d.id, c.conceptId, b.name
                        FROM map_entries a,
                        map_relations b, map_records c, map_projects d
                        WHERE
                        a.mapRelation_id = b.id
                        AND a.mapRecord_id = c.id
                        AND
                        c.mapProjectId = d.id
                        AND a. targetId != '' AND
                        a.targetId IS NOT null
                        AND isAllowableForNullTarget != 0;
                      </value>
                    </property>

                    <property>
                      <name>Empty target has only acceptable map advices</name>
                      <value>
                        SELECT e.id, d.conceptId, b.name
                        FROM map_entries a,
                        map_advices b, map_entries_map_advices c,
                        map_records d,
                        map_projects e
                        WHERE a.id = c.map_entries_id
                        AND b.id =
                        c.mapAdvices_id
                        AND a.mapRecord_id = d.id
                        AND
                        d.mapProjectId = e.id
                        AND a. targetId = ''
                        AND
                        b.isAllowableForNullTarget != 1;
                      </value>
                    </property>

                    <property>
                      <name>Non empty target has only acceptable map advices</name>
                      <value>
                        SELECT e.id, d.conceptId, b.name
                        FROM map_entries a,
                        map_advices b, map_entries_map_advices c,
                        map_records d,
                        map_projects e
                        WHERE a.id = c.map_entries_id
                        AND b.id =
                        c.mapAdvices_id
                        AND a.mapRecord_id = d.id
                        AND
                        d.mapProjectId = e.id
                        AND a.targetId != '' AND a.targetId
                        IS NOT NULL
                        AND b.isAllowableForNullTarget != 0;
                      </value>
                    </property>

                  </queries>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

  </profiles>
</project>